desktop/source/app/updater.cxx   |   48 ++++++++++-----------------------------
 desktop/source/app/updater.hxx   |    3 --
 external/onlineupdate/lo.patch   |    8 +++++-
 sc/source/core/tool/interpr1.cxx |   22 +++++++++++++++++
 4 files changed, 41 insertions(+), 40 deletions(-)

New commits:
commit 0ed516d3a5e018b873a711cdffa187d6bfb3f1d6
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Thu May 30 13:36:49 2024 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Jun 3 17:36:49 2024 +0200

    Consolidate on a single Updater::log overload
    
    Change-Id: Id812788f30ac4a327d450255cfe19181c69ae81e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168257
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>
    Tested-by: Jenkins
    (cherry picked from commit 253bd05e95ae5093e61a4685a9d28f31edc6f585)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168296
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index aed765d6eb3d..d60c006f6b6f 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -29,7 +29,9 @@
 #include <unotools/tempfile.hxx>
 #include <unotools/configmgr.hxx>
 #include <o3tl/char16_t2wchar_t.hxx>
+#include <o3tl/runtimetooustring.hxx>
 #include <osl/file.hxx>
+#include <osl/thread.h>
 #include <rtl/process.h>
 #include <sal/log.hxx>
 #include <tools/stream.hxx>
@@ -553,7 +555,7 @@ size_t WriteCallbackFile(void *ptr, size_t size,
 
 std::string download_content(const OString& rURL, bool bFile, OUString& rHash)
 {
-    Updater::log("Download: " + rURL);
+    Updater::log("Download: " + OStringToOUString(rURL, 
osl_getThreadTextEncoding()));
     std::unique_ptr<CURL, std::function<void(CURL *)>> curl(
         curl_easy_init(), [](CURL * p) { curl_easy_cleanup(p); });
 
@@ -729,7 +731,7 @@ void update_checker()
     OUString aDownloadCheckURL = aDownloadCheckBaseURL + "update/check/1/" + 
aProductName +
         "/" + aBuildID + "/" + aBuildTarget + "/" + aChannel;
     OString aURL = OUStringToOString(aDownloadCheckURL, RTL_TEXTENCODING_UTF8);
-    Updater::log("Update check: " + aURL);
+    Updater::log("Update check: " + OStringToOUString(aURL, 
osl_getThreadTextEncoding()));
 
     try
     {
@@ -779,27 +781,27 @@ void update_checker()
     catch (const invalid_update_info&)
     {
         SAL_WARN("desktop.updater", "invalid update information");
-        Updater::log(OString("warning: invalid update info"));
+        Updater::log("warning: invalid update info");
     }
     catch (const error_updater& e)
     {
         SAL_WARN("desktop.updater", "error during the update check: " << 
e.what());
-        Updater::log(OString("warning: error by the updater") + e.what());
+        Updater::log("warning: error by the updater" + 
o3tl::runtimeToOUString(e.what()));
     }
     catch (const invalid_size& e)
     {
         SAL_WARN("desktop.updater", e.what());
-        Updater::log(OString("warning: invalid size"));
+        Updater::log("warning: invalid size");
     }
     catch (const invalid_hash& e)
     {
         SAL_WARN("desktop.updater", e.what());
-        Updater::log(OString("warning: invalid hash"));
+        Updater::log("warning: invalid hash");
     }
     catch (...)
     {
         SAL_WARN("desktop.updater", "unknown error during the update check");
-        Updater::log(OString("warning: unknown exception"));
+        Updater::log("warning: unknown exception");
     }
 }
 
@@ -843,24 +845,6 @@ void Updater::log(const OUString& rMessage)
     aLog.WriteLine(OUStringToOString(rMessage, RTL_TEXTENCODING_UTF8));
 }
 
-void Updater::log(const OString& rMessage)
-{
-    SAL_INFO("desktop.updater", rMessage);
-    OUString aUpdateLog = getUpdateInfoLog();
-    SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE);
-    aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the 
end
-    aLog.WriteLine(rMessage);
-}
-
-void Updater::log(const char* pMessage)
-{
-    SAL_INFO("desktop.updater", pMessage);
-    OUString aUpdateLog = getUpdateInfoLog();
-    SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE);
-    aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the 
end
-    aLog.WriteOString(pMessage);
-}
-
 OUString Updater::getBuildID()
 {
     OUString aBuildID("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" 
SAL_CONFIGFILE("version") ":buildid}");
diff --git a/desktop/source/app/updater.hxx b/desktop/source/app/updater.hxx
index 8989f1f684a0..3fc767748094 100644
--- a/desktop/source/app/updater.hxx
+++ b/desktop/source/app/updater.hxx
@@ -27,8 +27,6 @@ public:
     static OUString getUpdateChannel();
 
     static void log(const OUString& rMessage);
-    static void log(const OString& rMessage);
-    static void log(const char* pMessage);
 
     static void removeUpdateFiles();
 };
commit d422233304c18af143c1d8cb861767a96742f06d
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Thu May 30 13:44:49 2024 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Jun 3 17:36:49 2024 +0200

    Make sure updates dir exists when writing updating.log
    
    Change-Id: Ib652fedde970d01b701ad4b61e75028cd43974f6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168258
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>
    (cherry picked from commit 48190a8f3783135c65538977cd38f34ba733f071)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168297
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 12bb4969a68c..aed765d6eb3d 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -803,14 +803,6 @@ void update_checker()
     }
 }
 
-OUString Updater::getUpdateInfoLog()
-{
-    OUString aUpdateInfoURL("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" 
SAL_CONFIGFILE("bootstrap") ":UserInstallation}/updates/updating.log");
-    rtl::Bootstrap::expandMacros(aUpdateInfoURL);
-
-    return aUpdateInfoURL;
-}
-
 OUString Updater::getPatchDirURL()
 {
     OUString aPatchDirURL("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" 
SAL_CONFIGFILE("bootstrap") ":UserInstallation}/updates/0/");
@@ -843,8 +835,10 @@ OUString Updater::getExecutableDirURL()
 void Updater::log(const OUString& rMessage)
 {
     SAL_INFO("desktop.updater", rMessage);
-    OUString aUpdateLog = getUpdateInfoLog();
-    SvFileStream aLog(aUpdateLog, StreamMode::STD_READWRITE);
+    OUString dir("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" 
SAL_CONFIGFILE("bootstrap") ":UserInstallation}/updates");
+    rtl::Bootstrap::expandMacros(dir);
+    osl::Directory::create(dir);
+    SvFileStream aLog(dir + "/updating.log", StreamMode::STD_READWRITE);
     aLog.Seek(aLog.Tell() + aLog.remainingSize()); // make sure we are at the 
end
     aLog.WriteLine(OUStringToOString(rMessage, RTL_TEXTENCODING_UTF8));
 }
diff --git a/desktop/source/app/updater.hxx b/desktop/source/app/updater.hxx
index 7f1ea920fbe9..8989f1f684a0 100644
--- a/desktop/source/app/updater.hxx
+++ b/desktop/source/app/updater.hxx
@@ -18,7 +18,6 @@ void update_checker();
 class Updater
 {
 public:
-    static OUString getUpdateInfoLog();
     static OUString getPatchDirURL();
     static OUString getUpdateFileURL();
     static OUString getExecutableDirURL();
commit 6daf242d84bbca4df8f330e3c0845987d5d512d8
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Fri May 31 10:35:06 2024 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Jun 3 17:36:49 2024 +0200

    tdf#161292: Fix create-partial-info for newly added files
    
    084c64982ef6187292fd73e6deaa4448e0b6f3de "Create MAR updates from msi rather
    than from archive" had patched make_add_instruction (in
    workdir/UnpackedTarball/onlineupdate/tools/update-packagin/common.sh) to
    unconditionally use add-if (with the file itself as test file) rather than 
plain
    add (because we can't reuse Mozilla's extension logic there to determine
    optional installation parts), and it noted in its commit message that 
"addition
    of files will cause a MAR update to miss them".
    
    Which turned out to be a problem with
    
<https://update-mar.libreoffice.org/24.2.2.2/LibreOffice_24.2.2.2_Windows_X86_64_d56cc158d8a96260b836f100ef4b4ef25d6f1a01_from_bf759d854b5ab45b6ef0bfd22e51c6dc4fb8b882_partial.mar>,
    updating from 24.2.2.1 with instdir/program/python-core-3.8.18/ to 24.2.2.2 
with
    instdir/program/python-core-3.8.19/:  All the files in python-core-3.8.19 
were
    recorded as add-if testing on themselves, so were never added.
    
    So a better approach is, for newly added files to make them add (so they get
    added unconditionally, even if they are part of some optional component that
    happens to not be installed; this hopefully won't cause further issues) 
instead
    of add-if.  (Existing files that are added instead of patched still use 
add-if,
    though.)  This does not address the create-update-info target for full mar
    updates (which is not used currently?), just the create-partial-info target.
    
    (The existing calls to make_add_instruction in the upstream Mozilla code 
already
    have a seemingly rotten mix of two-argument calls and calls with three 
arguments
    where the third argument is ignored, and would check for a fourth "forced"
    argument but which is never passed in.  So avoid extending that mess 
further,
    and just replace this never-use-add-if call to make_add_instruction directly
    with that function's (accordingly tweaked) body.)
    
    Change-Id: Ib596f3aa72c3ab9f896b20f7d623bc574eb15fd8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168285
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>
    Tested-by: Jenkins
    (cherry picked from commit c00014019e6d33bfb4729c563062db1645c48e9d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168310
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/external/onlineupdate/lo.patch b/external/onlineupdate/lo.patch
index 35dfb2f80fb8..571cea560d3c 100644
--- a/external/onlineupdate/lo.patch
+++ b/external/onlineupdate/lo.patch
@@ -372,7 +372,13 @@
        fi
      fi
    else
-@@ -270,7 +270,7 @@
+@@ -266,11 +266,12 @@
+   if check_for_add_if_not_update "$f"; then
+     make_add_if_not_instruction "$f" "$updatemanifestv3"
+   else
+-    make_add_instruction "$f" "$updatemanifestv3"
++    verbose_notice "     add \"$f\""
++    echo "add \"$f\"" >> "$updatemanifestv3"
    fi
  
  
commit ecd946a063253be3324a6144786b7b5cbbbbb5ec
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Fri May 31 17:34:35 2024 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Jun 3 17:36:49 2024 +0200

    Resolves: tdf#158789 operate on query array if no extra array or range given
    
    Also push error and bail out early if there was an error, or more
    important pResultMatrix is nullptr.
    
    Change-Id: I1094ed9d14795ea1bc3f4ff61d687cc28d0b94fb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168300
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <er...@redhat.com>
    (cherry picked from commit a523e9bf2d54fc84583c9da05af592297b055e40)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168315
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 7a9d885ac59b..8af5ecb675e0 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -5653,7 +5653,8 @@ void ScInterpreter::IterateParametersIf( ScIterFuncIf 
eFunc )
                 ScMatrixRef pResultMatrix = QueryMat( pQueryMatrix, aOptions);
                 if (nGlobalError != FormulaError::NONE || !pResultMatrix)
                 {
-                    SetError( FormulaError::IllegalParameter);
+                    PushIllegalParameter();
+                    return;
                 }
 
                 if (pSumExtraMatrix)
@@ -5677,6 +5678,25 @@ void ScInterpreter::IterateParametersIf( ScIterFuncIf 
eFunc )
                         }
                     }
                 }
+                else if (!bSumExtraRange)
+                {
+                    for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
+                    {
+                        for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
+                        {
+                            if (pResultMatrix->IsValue( nCol, nRow) &&
+                                    pResultMatrix->GetDouble( nCol, nRow))
+                            {
+                                if (pQueryMatrix->IsValue( nCol, nRow))
+                                {
+                                    fVal = pQueryMatrix->GetDouble( nCol, 
nRow);
+                                    ++fCount;
+                                    fSum += fVal;
+                                }
+                            }
+                        }
+                    }
+                }
                 else
                 {
                     for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)

Reply via email to