jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 16 +++++++++++++--- jvmfwk/source/framework.cxx | 8 ++++++-- jvmfwk/source/fwkbase.cxx | 6 ++++-- sc/inc/documentimport.hxx | 2 ++ sc/inc/mtvelements.hxx | 1 + sc/source/core/data/documentimport.cxx | 14 ++++++++++++++ sc/source/core/data/mtvelements.cxx | 5 +++++ sc/source/core/data/table2.cxx | 2 +- sc/source/core/data/table3.cxx | 4 ++++ sc/source/filter/oox/sheetdatabuffer.cxx | 13 +++++++++++++ shell/source/win32/SysShExec.cxx | 2 +- 11 files changed, 64 insertions(+), 9 deletions(-)
New commits: commit aa993b7667136ff858a7c8d6f3d1bac8f255151a Author: Renwa Hiwa <[email protected]> AuthorDate: Tue Feb 22 09:36:29 2022 +0000 Commit: Michael Stahl <[email protected]> CommitDate: Tue Feb 22 17:01:47 2022 +0100 Better handling of msi LIBREOFFICE-SK4E5D8N Change-Id: I44f25a47ab6ffeb9d2b679874c8c96af1319eb2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130317 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit ccaabe8e8100a3a0600456c5a65221ca2b263c95) diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index 3f917e050dc7..2a511804655a 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -399,7 +399,7 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa if (!(checkExtension(ext, env) && checkExtension( ext, - ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.CLASS;" + ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.MSI;.PY;.CLASS;" ".JAR;.APPLICATION;.LNK;.SCR"))) { throw css::lang::IllegalArgumentException( commit dfd94c37057f0859a0305d07a2ce7c2abd57759d Author: Caolán McNamara <[email protected]> AuthorDate: Wed Feb 16 11:14:48 2022 +0000 Commit: Michael Stahl <[email protected]> CommitDate: Tue Feb 22 16:56:52 2022 +0100 clear ScDocumentImport position cache if iterators are invalid SheetDataBuffer::finalizeArrayFormula calls ScCellRangeObj::setArrayTokens ScDocFunc::EnterMatrix ScDocument::InsertMatrixFormula and InsertMatrixFormula calls the variant of ScColumn::SetFormulaCell which doesn't take a sc::ColumnBlockPosition& param when SetFormulaCell adds a cell to the column so any iterators belonging to ScDocumentImport are invalid. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130151 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> (cherry picked from commit fea55f5ef8dba16706033c9efdd33c45477eb333) Change-Id: Ic2814ecbeafdeb99632d2a255ed6c1dedf7376b1 diff --git a/sc/inc/documentimport.hxx b/sc/inc/documentimport.hxx index 1a8b1cbd514f..7e5be71c8339 100644 --- a/sc/inc/documentimport.hxx +++ b/sc/inc/documentimport.hxx @@ -123,6 +123,8 @@ public: void setMergedCells(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); + void invalidateBlockPositionSet(SCTAB nTab); + void finalize(); /** Broadcast all formula cells that are marked with diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx index a7a3ba8e0326..079a752d55c7 100644 --- a/sc/source/core/data/documentimport.cxx +++ b/sc/source/core/data/documentimport.cxx @@ -93,6 +93,15 @@ struct ScDocumentImportImpl return rTab.getBlockPosition(nCol); } + void invalidateBlockPositionSet(SCTAB nTab) + { + if (sal_uInt16(nTab) >= maBlockPosSet.size()) + return; + + sc::TableColumnBlockPositionSet& rTab = maBlockPosSet[nTab]; + rTab.invalidate(); + } + void initForSheets() { size_t n = mrDoc.GetTableCount(); @@ -180,6 +189,11 @@ void ScDocumentImport::setOriginDate(sal_uInt16 nYear, sal_uInt16 nMonth, sal_uI mpImpl->mrDoc.pDocOptions->SetDate(nDay, nMonth, nYear); } +void ScDocumentImport::invalidateBlockPositionSet(SCTAB nTab) +{ + mpImpl->invalidateBlockPositionSet(nTab); +} + void ScDocumentImport::setAutoInput(const ScAddress& rPos, const OUString& rStr, const ScSetStringParam* pStringParam) { ScTable* pTab = mpImpl->mrDoc.FetchTable(rPos.Tab()); diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx index cf44072cd9e3..ccca237964f7 100644 --- a/sc/source/filter/oox/sheetdatabuffer.cxx +++ b/sc/source/filter/oox/sheetdatabuffer.cxx @@ -402,10 +402,23 @@ void SheetDataBuffer::addColXfStyle( sal_Int32 nXfId, sal_Int32 nFormatId, const void SheetDataBuffer::finalizeImport() { + ScDocumentImport& rDocImport = getDocImport(); + + SCTAB nStartTabInvalidatedIters(SCTAB_MAX); + SCTAB nEndTabInvalidatedIters(0); + // create all array formulas for( ArrayFormulaVector::iterator aIt = maArrayFormulas.begin(), aEnd = maArrayFormulas.end(); aIt != aEnd; ++aIt ) + { finalizeArrayFormula( aIt->first, aIt->second ); + nStartTabInvalidatedIters = std::min(aIt->first.aStart.Tab(), nStartTabInvalidatedIters); + nEndTabInvalidatedIters = std::max(aIt->first.aEnd.Tab(), nEndTabInvalidatedIters); + } + + for (SCTAB nTab = nStartTabInvalidatedIters; nTab <= nEndTabInvalidatedIters; ++nTab) + rDocImport.invalidateBlockPositionSet(nTab); + // create all table operations for( TableOperationVector::iterator aIt = maTableOperations.begin(), aEnd = maTableOperations.end(); aIt != aEnd; ++aIt ) finalizeTableOperation( aIt->first, aIt->second ); commit aa40111264ac9b323f63663f39e7eed8627878e9 Author: Luboš Luňák <[email protected]> AuthorDate: Wed Jul 1 11:24:08 2020 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Tue Feb 22 16:56:52 2022 +0100 don't add a cell to a non-existent column (tdf#104865) This change also needs invalidating column position hints if the columns get changed by the copying of the cells. Change-Id: I4793e25f253c0197d88b313bc9336435cef649f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97603 Tested-by: Jenkins Reviewed-by: Luboš Luňák <[email protected]> (cherry picked from commit ee2d2184133b3bf47d38a03b14abab2caa15dad1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97673 Reviewed-by: Xisco Fauli <[email protected]> (cherry picked from commit 8765592db900fae22ff2a0440fe94842dcbd805f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97684 (cherry picked from commit 6c3a6b9685acad171fda7bc5d44b0dd53b9f7268) diff --git a/sc/inc/mtvelements.hxx b/sc/inc/mtvelements.hxx index f13562d47fbd..e441e0473558 100644 --- a/sc/inc/mtvelements.hxx +++ b/sc/inc/mtvelements.hxx @@ -169,6 +169,7 @@ public: ~TableColumnBlockPositionSet(); ColumnBlockPosition* getBlockPosition( SCCOL nCol ); + void invalidate(); // discards cached positions }; ScRefCellValue toRefCell( const sc::CellStoreType::const_iterator& itPos, size_t nOffset ); diff --git a/sc/source/core/data/mtvelements.cxx b/sc/source/core/data/mtvelements.cxx index e34010af54d8..598b43f963f3 100644 --- a/sc/source/core/data/mtvelements.cxx +++ b/sc/source/core/data/mtvelements.cxx @@ -153,6 +153,11 @@ ColumnBlockPosition* TableColumnBlockPositionSet::getBlockPosition( SCCOL nCol ) return &it->second; } +void TableColumnBlockPositionSet::invalidate() +{ + mpImpl->maColumns.clear(); +} + ScRefCellValue toRefCell( const sc::CellStoreType::const_iterator& itPos, size_t nOffset ) { switch (itPos->type) diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 354aa4d26807..66c072d12cc0 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -3729,7 +3729,7 @@ void ScTable::CopyData( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW n if (bThisTab) { - aCell.release(aCol[nDestX], nDestY); + aCell.release(CreateColumnIfNotExists(nDestX), nDestY); SetPattern( nDestX, nDestY, *GetPattern( nCol, nRow ) ); } else diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 487e7eec6626..0b78cd9c31f4 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -3145,6 +3145,10 @@ SCSIZE ScTable::Query(const ScQueryParam& rParamOrg, bool bKeepSub) if (bResult) { CopyData( aParam.nCol1,j, aParam.nCol2,j, aParam.nDestCol,nOutRow,aParam.nDestTab ); +#if 0 + if( nTab == aParam.nDestTab ) // copy to self, changes may invalidate caching position hints + blockPos.invalidate(); +#endif ++nOutRow; } } commit a2470a4831b43563ed6db5ef9a70b7643c7c4ea1 Author: Stephan Bergmann <[email protected]> AuthorDate: Mon Feb 21 11:55:21 2022 +0100 Commit: Michael Stahl <[email protected]> CommitDate: Tue Feb 22 16:37:17 2022 +0100 Avoid unnecessary empty -Djava.class.path= Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130242 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> (cherry picked from commit 5e8f64e50f97d39e83a3358697be14db03566878) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130265 Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 04bb6f736f92b93497bed28b7420fac97753f95e) Change-Id: Idcfe7321077b60381c0273910b1faeb444ef1fd8 diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index cd024b1ac2c8..7b36cfa96ec1 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx @@ -686,17 +686,22 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( // all versions below 1.5.1 options.emplace_back("abort", reinterpret_cast<void*>(abort_handler)); bool hasStackSize = false; +#ifdef UNX + // Until java 1.5 we need to put a plugin.jar or javaplugin.jar (<1.4.2) + // in the class path in order to have applet support: + OString sAddPath = getPluginJarPath(pInfo->sVendor, pInfo->sLocation,pInfo->sVersion); +#endif for (int i = 0; i < cOptions; i++) { OString opt(arOptions[i].optionString); #ifdef UNX - // Until java 1.5 we need to put a plugin.jar or javaplugin.jar (<1.4.2) - // in the class path in order to have applet support: if (opt.startsWith("-Djava.class.path=")) { - OString sAddPath = getPluginJarPath(pInfo->sVendor, pInfo->sLocation,pInfo->sVersion); if (!sAddPath.isEmpty()) + { opt += OString(SAL_PATHSEPARATOR) + sAddPath; + sAddPath.clear(); + } } #endif if (opt == "-Xint") { @@ -741,6 +746,11 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( } #endif } +#ifdef UNX + if (!sAddPath.isEmpty()) { + options.emplace_back("-Djava.class.path=" + sAddPath, nullptr); + } +#endif std::unique_ptr<JavaVMOption[]> sarOptions(new JavaVMOption[options.size()]); for (std::vector<Option>::size_type i = 0; i != options.size(); ++i) { diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx index 9f97d8dd876f..c177d343082e 100644 --- a/jvmfwk/source/framework.cxx +++ b/jvmfwk/source/framework.cxx @@ -212,8 +212,12 @@ javaFrameworkError jfw_startVM( //In direct mode the options are specified by bootstrap variables //of the form UNO_JAVA_JFW_PARAMETER_1 .. UNO_JAVA_JFW_PARAMETER_n vmParams = jfw::BootParams::getVMParameters(); - sUserClassPath = - "-Djava.class.path=" + jfw::BootParams::getClasspath(); + auto const cp = jfw::BootParams::getClasspath(); + if (!cp.isEmpty()) + { + sUserClassPath = + "-Djava.class.path=" + cp; + } } else OSL_ASSERT(false); diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx index 05b2a0f5a0ca..8f15e65179d3 100644 --- a/jvmfwk/source/fwkbase.cxx +++ b/jvmfwk/source/fwkbase.cxx @@ -496,8 +496,10 @@ OString makeClassPathOption(OUString const & sUserClassPath) sBufCP.append(sAppCP); } - sPaths = OUStringToOString( - sBufCP.makeStringAndClear(), osl_getThreadTextEncoding()); + sPaths = OUStringToOString(sBufCP.makeStringAndClear(), osl_getThreadTextEncoding()); + if (sPaths.isEmpty()) { + return ""; + } OString sOptionClassPath("-Djava.class.path="); sOptionClassPath += sPaths;
