jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |   16 +++++++++++++---
 jvmfwk/source/framework.cxx                         |    8 ++++++--
 jvmfwk/source/fwkbase.cxx                           |    6 ++++--
 sc/inc/documentimport.hxx                           |    2 ++
 sc/source/core/data/documentimport.cxx              |   14 ++++++++++++++
 sc/source/filter/oox/sheetdatabuffer.cxx            |   16 ++++++++++++++--
 shell/source/win32/SysShExec.cxx                    |    2 +-
 7 files changed, 54 insertions(+), 10 deletions(-)

New commits:
commit 334a5749794b2a1292a267bf0a4973b75a2775c8
Author:     Renwa Hiwa <renwa...@gmail.com>
AuthorDate: Tue Feb 22 09:36:29 2022 +0000
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Feb 22 13:19:01 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 <michael.st...@allotropia.de>
    (cherry picked from commit ccaabe8e8100a3a0600456c5a65221ca2b263c95)

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 97a8df6e94b6..ec61e96f762b 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -425,7 +425,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 21653331a609100a4e005b922730a564b0c020b7
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Feb 16 11:14:48 2022 +0000
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Feb 22 13:19:01 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 <xiscofa...@libreoffice.org>
    (cherry picked from commit fea55f5ef8dba16706033c9efdd33c45477eb333)
    
    Change-Id: Ic2814ecbeafdeb99632d2a255ed6c1dedf7376b1

diff --git a/sc/inc/documentimport.hxx b/sc/inc/documentimport.hxx
index 758469f258a6..ed77561a5153 100644
--- a/sc/inc/documentimport.hxx
+++ b/sc/inc/documentimport.hxx
@@ -125,6 +125,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 e5c0cfbef37e..739a62d553ca 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -92,6 +92,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();
@@ -179,6 +188,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 03b35ef76e35..61539c8f90af 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -401,9 +401,22 @@ 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( const auto& [rRange, rTokens] : maArrayFormulas )
-        finalizeArrayFormula( rRange, rTokens );
+    {
+        finalizeArrayFormula(rRange, rTokens);
+
+        nStartTabInvalidatedIters = std::min(rRange.aStart.Tab(), 
nStartTabInvalidatedIters);
+        nEndTabInvalidatedIters = std::max(rRange.aEnd.Tab(), 
nEndTabInvalidatedIters);
+    }
+
+    for (SCTAB nTab = nStartTabInvalidatedIters; nTab <= 
nEndTabInvalidatedIters; ++nTab)
+        rDocImport.invalidateBlockPositionSet(nTab);
 
     // create all table operations
     for( const auto& [rRange, rModel] : maTableOperations )
@@ -439,7 +452,6 @@ void SheetDataBuffer::finalizeImport()
         }
     }
 
-    ScDocumentImport& rDocImport = getDocImport();
     ScDocument& rDoc = rDocImport.getDoc();
     StylesBuffer& rStyles = getStyles();
     for ( const auto& [rCol, rRowStyles] : maStylesPerColumn )
commit 441b43b300673eeb024140b45696180f2542f752
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Mon Feb 21 11:55:21 2022 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Feb 22 13:19:01 2022 +0100

    Avoid unnecessary empty -Djava.class.path=
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130242
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit 5e8f64e50f97d39e83a3358697be14db03566878)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130265
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    (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 4760ab629313..ea133ea6c78c 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -687,17 +687,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 += OStringChar(SAL_PATHSEPARATOR) + sAddPath;
+                sAddPath.clear();
+            }
         }
 #endif
         if (opt == "-Xint") {
@@ -742,6 +747,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 9684e13107cb..07916b867356 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 ece4dd2bd717..1a70000425e2 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -458,8 +458,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=" + sPaths;
     return sOptionClassPath;

Reply via email to