desktop/source/app/app.cxx     |    1 +
 desktop/source/app/updater.cxx |   22 +++++++++++-----------
 2 files changed, 12 insertions(+), 11 deletions(-)

New commits:
commit 8686b480ba1d79463f33fe931a454d9d92c3d739
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Tue Dec 5 14:05:36 2023 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Tue Dec 5 18:07:06 2023 +0100

    Fix apparent copy/paste typo
    
    ...present ever since the code got introduced in
    569269078576fa832143ec4f0bf03283ff358f48 "improve the update checker"
    
    Change-Id: I38d0efee3cb3f6954dd30690ba9afddf0b66c959
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160348
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 1af82cf85fc9..0cd95da8d4e7 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -477,7 +477,7 @@ update_info parse_response(const std::string& rResponse)
     }
 
     orcus::json::node aLanguageNode = aDocumentRoot.child("languages");
-    if (aUpdateNode.type() != orcus::json::node_t::object)
+    if (aLanguageNode.type() != orcus::json::node_t::object)
     {
         throw invalid_update_info();
     }
commit 7f49fa220225d2afbefac756a03586212d8ce1c6
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Tue Dec 5 12:35:08 2023 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Tue Dec 5 18:06:51 2023 +0100

    Make --enable-online-update=mar at least compile again, on Linux
    
    Seen it build (but no idea yet whether it actually would work) with
    autogen.input including
    
    > --enable-online-update=mar
    > --with-update-config=/home/sberg/lo/update.ini
    
    and ~/lo/update.ini containing
    
    > [Updater]
    > ServerURL=TODO
    > base-url=TODO
    > certificate-der=/home/sberg/lo/certificate.der
    > certificate-name=TODO
    > certificate-path=TODO
    > channel=TODO
    > upload-url=TODO
    
    and ~/lo/certificate.der containing
    
    > TODO
    
    Change-Id: Ib40417c09c6454fe9cf678c029a06716415e5cb0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160339
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index cd1d1de0d6ea..4c13a2a8e716 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -118,6 +118,7 @@
 #include <svl/eitem.hxx>
 #include <basic/sbstar.hxx>
 #include <desktop/crashreport.hxx>
+#include <tools/time.hxx>
 #include <tools/urlobj.hxx>
 #include <comphelper/diagnose_ex.hxx>
 #include <svtools/fontsubstconfig.hxx>
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index edac2cb38350..1af82cf85fc9 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -36,7 +36,6 @@
 
 #include <orcus/json_document_tree.hpp>
 #include <orcus/config.hpp>
-#include <orcus/pstring.hpp>
 
 #include <systools/curlinit.hxx>
 #include <comphelper/hash.hxx>
@@ -48,6 +47,7 @@
 #include <functional>
 #include <memory>
 #include <set>
+#include <string_view>
 
 namespace {
 
@@ -391,9 +391,9 @@ public:
     }
 };
 
-OUString toOUString(const std::string& rStr)
+OUString toOUString(const std::string_view& rStr)
 {
-    return OUString::fromUtf8(rStr.c_str());
+    return OUString::fromUtf8(rStr);
 }
 
 update_file parse_update_file(orcus::json::node& rNode)
@@ -422,12 +422,12 @@ update_file parse_update_file(orcus::json::node& rNode)
     }
 
     update_file aUpdateFile;
-    aUpdateFile.aURL = toOUString(aURLNode.string_value().str());
+    aUpdateFile.aURL = toOUString(aURLNode.string_value());
 
     if (aUpdateFile.aURL.isEmpty())
         throw invalid_update_info();
 
-    aUpdateFile.aHash = toOUString(aHashNode.string_value().str());
+    aUpdateFile.aHash = toOUString(aHashNode.string_value());
     aUpdateFile.nSize = static_cast<sal_uInt32>(aSizeNode.numeric_value());
     return aUpdateFile;
 }
@@ -454,7 +454,7 @@ update_info parse_response(const std::string& rResponse)
     {
         update_info aUpdateInfo;
         auto aMsgNode = aDocumentRoot.child("response");
-        aUpdateInfo.aMessage = toOUString(aMsgNode.string_value().str());
+        aUpdateInfo.aMessage = toOUString(aMsgNode.string_value());
         return aUpdateInfo;
     }
 
@@ -483,17 +483,17 @@ update_info parse_response(const std::string& rResponse)
     }
 
     update_info aUpdateInfo;
-    aUpdateInfo.aFromBuildID = toOUString(aFromNode.string_value().str());
-    aUpdateInfo.aSeeAlsoURL = toOUString(aSeeAlsoNode.string_value().str());
+    aUpdateInfo.aFromBuildID = toOUString(aFromNode.string_value());
+    aUpdateInfo.aSeeAlsoURL = toOUString(aSeeAlsoNode.string_value());
 
     aUpdateInfo.aUpdateFile = parse_update_file(aUpdateNode);
 
-    std::vector<orcus::pstring> aLanguages = aLanguageNode.keys();
+    std::vector<std::string_view> aLanguages = aLanguageNode.keys();
     for (auto const& language : aLanguages)
     {
         language_file aLanguageFile;
         auto aLangEntry = aLanguageNode.child(language);
-        aLanguageFile.aLangCode = toOUString(language.str());
+        aLanguageFile.aLangCode = toOUString(language);
         aLanguageFile.aUpdateFile = parse_update_file(aLangEntry);
         aUpdateInfo.aLanguageFiles.push_back(aLanguageFile);
     }

Reply via email to