[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - desktop/source framework/source include/desktop svx/source vcl/opengl vcl/source vcl/unx vcl/win

Juergen Funk (via logerrit) logerrit at kemper.freedesktop.org
Thu Jan 23 14:46:52 UTC 2020


 desktop/source/app/app.cxx                  |   39 ++---------
 desktop/source/app/crashreport.cxx          |   93 +++++++++++++++++-----------
 desktop/source/app/sofficemain.cxx          |   14 +---
 desktop/source/minidump/minidump.cxx        |   20 ++++--
 desktop/source/minidump/minidump_upload.cxx |    2 
 framework/source/services/desktop.cxx       |    2 
 include/desktop/crashreport.hxx             |   59 ++++++++++-------
 include/desktop/minidump.hxx                |   13 +++
 svx/source/dialog/crashreportdlg.cxx        |    5 -
 vcl/opengl/win/WinDeviceInfo.cxx            |    6 -
 vcl/opengl/x11/X11DeviceInfo.cxx            |    4 -
 vcl/source/opengl/OpenGLHelper.cxx          |    2 
 vcl/source/window/builder.cxx               |    2 
 vcl/unx/generic/plugadapt/salplug.cxx       |    2 
 vcl/win/app/salinst.cxx                     |    2 
 15 files changed, 147 insertions(+), 118 deletions(-)

New commits:
commit 645bb8690a80eeef8f33dfcbe6e1fd3db97fa23a
Author:     Juergen Funk <juergen.funk_ml at cib.de>
AuthorDate: Wed Sep 25 13:49:26 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Thu Jan 23 15:46:25 2020 +0100

    Refactoring of the class CrashReporter
    
     - remove double code
     - using of all the methode of the CrashReporter-Class
     - all methode only active when crash-dump enable
        except the addKeyValue
    
    With this change the handling for the patch
    tdf#127711 A runtime-switch for the MiniCrashDump
    would be simpler
    
    Reviewed-on: https://gerrit.libreoffice.org/79272
    Tested-by: Jenkins
    Reviewed-by: Juergen Funk (CIB) <juergen.funk_ml at cib.de>
    (cherry picked from commit 8fe03eef707561bb0b9e1655292619ec3cd347f5)
    
     Conflicts:
            desktop/source/app/crashreport.cxx
            vcl/opengl/x11/X11DeviceInfo.cxx
            vcl/source/app/salplug.cxx
    
    §§{JNKCMD:NoBuild}§§
    
    Change-Id: I339b3b8e06f7fc2cd3c0d34ece112a6fd352913a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87262
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index d1b76aa49d3c..e9995c8a5635 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -122,10 +122,6 @@
 
 #include "langselect.hxx"
 
-#if HAVE_FEATURE_BREAKPAD
-#include <fstream>
-#endif
-
 #if defined MACOSX
 #include <errno.h>
 #include <sys/wait.h>
@@ -889,26 +885,6 @@ void Desktop::HandleBootstrapErrors(
 
 namespace {
 
-bool crashReportInfoExists()
-{
-#if HAVE_FEATURE_BREAKPAD
-    std::string path = CrashReporter::getIniFileName();
-    std::ifstream aFile(path);
-    while (aFile.good())
-    {
-        std::string line;
-        std::getline(aFile, line);
-        int sep = line.find('=');
-        if (sep >= 0)
-        {
-            std::string key = line.substr(0, sep);
-            if (key == "DumpFile")
-                return true;
-        }
-    }
-#endif
-    return false;
-}
 
 #if HAVE_FEATURE_BREAKPAD
 void handleCrashReport()
@@ -967,7 +943,12 @@ void impl_checkRecoveryState(bool& bCrashed           ,
                              bool& bRecoveryDataExists,
                              bool& bSessionDataExists )
 {
-    bCrashed = officecfg::Office::Recovery::RecoveryInfo::Crashed::get() || crashReportInfoExists();
+    bCrashed = officecfg::Office::Recovery::RecoveryInfo::Crashed::get()
+#if HAVE_FEATURE_BREAKPAD
+        || CrashReporter::crashReportInfoExists();
+#else
+        ;
+#endif
     bool elements = officecfg::Office::Recovery::RecoveryList::get()->
         hasElements();
     bool session
@@ -2025,7 +2006,7 @@ void Desktop::OpenClients()
 #endif
 
 #if HAVE_FEATURE_BREAKPAD
-    if (officecfg::Office::Common::Misc::CrashReport::get() && crashReportInfoExists())
+    if (officecfg::Office::Common::Misc::CrashReport::get() && CrashReporter::crashReportInfoExists())
         handleCrashReport();
 #endif
 
@@ -2103,11 +2084,9 @@ void Desktop::OpenClients()
             }
         }
     }
-#if HAVE_FEATURE_BREAKPAD
-    CrashReporter::writeCommonInfo();
+
     // write this information here to avoid depending on vcl in the crash reporter lib
-    CrashReporter::addKeyValue("Language", Application::GetSettings().GetLanguageTag().getBcp47());
-#endif
+    CrashReporter::addKeyValue("Language", Application::GetSettings().GetLanguageTag().getBcp47(), CrashReporter::Create);
 
     RequestHandler::EnableRequests();
 
diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx
index f19b9f0305b2..2fb078c7417d 100644
--- a/desktop/source/app/crashreport.cxx
+++ b/desktop/source/app/crashreport.cxx
@@ -14,17 +14,17 @@
 #include <ucbhelper/proxydecider.hxx>
 #include <unotools/bootstrap.hxx>
 #include <o3tl/char16_t2wchar_t.hxx>
+#include <desktop/minidump.hxx>
 
 #include <config_version.h>
 #include <config_folders.h>
 
 #include <string>
-#include <fstream>
 
-osl::Mutex CrashReporter::maMutex;
 
 #if HAVE_FEATURE_BREAKPAD
 
+#include <fstream>
 #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
 #include <client/linux/handler/exception_handler.h>
 #elif defined WNT
@@ -38,41 +38,44 @@ osl::Mutex CrashReporter::maMutex;
 #endif
 #endif
 
+osl::Mutex CrashReporter::maMutex;
 google_breakpad::ExceptionHandler* CrashReporter::mpExceptionHandler = nullptr;
 bool CrashReporter::mbInit = false;
-std::map<OUString, OUString> CrashReporter::maKeyValues;
+CrashReporter::vmaKeyValues CrashReporter::maKeyValues;
 
-namespace {
 
-void writeToStream(std::ofstream& strm, const OUString& rKey, const OUString& rValue)
+void CrashReporter::writeToFile(std::ios_base::openmode Openmode)
 {
-    strm << rtl::OUStringToOString(rKey, RTL_TEXTENCODING_UTF8).getStr() << "=";
-    strm << rtl::OUStringToOString(rValue, RTL_TEXTENCODING_UTF8).getStr() << "\n";
-}
+    std::ofstream ini_file(getIniFileName(), Openmode);
+
+    for (auto& keyValue : maKeyValues)
+    {
+        ini_file << rtl::OUStringToOString(keyValue.first, RTL_TEXTENCODING_UTF8).getStr() << "=";
+        ini_file << rtl::OUStringToOString(keyValue.second, RTL_TEXTENCODING_UTF8).getStr() << "\n";
+    }
 
+    maKeyValues.clear();
+    ini_file.close();
 }
 
-void CrashReporter::addKeyValue(const OUString& rKey, const OUString& rValue)
+void CrashReporter::addKeyValue(const OUString& rKey, const OUString& rValue, tAddKeyHandling AddKeyHandling)
 {
     osl::MutexGuard aGuard(maMutex);
-    if (mbInit)
-    {
-        std::string ini_path = getIniFileName();
-        std::ofstream ini_file(ini_path, std::ios_base::app);
-        writeToStream(ini_file, rKey, rValue);
-    }
-    else
+
+    if(!rKey.isEmpty())
+        maKeyValues.push_back(mpair(rKey, rValue));
+
+    if(AddKeyHandling != AddItem)
     {
-        maKeyValues.insert(std::pair<OUString, OUString>(rKey, rValue));
+        if(mbInit)
+            writeToFile(std::ios_base::app);
+        else if (AddKeyHandling == Create)
+            writeCommonInfo();
     }
 }
 
-#endif
-
 void CrashReporter::writeCommonInfo()
 {
-    osl::MutexGuard aGuard(maMutex);
-
     ucbhelper::InternetProxyDecider proxy_decider(::comphelper::getProcessComponentContext());
 
     const OUString protocol = "https";
@@ -81,31 +84,31 @@ void CrashReporter::writeCommonInfo()
 
     const ucbhelper::InternetProxyServer proxy_server = proxy_decider.getProxy(protocol, url, port);
 
+    // save the Keys
+    vmaKeyValues atlast = maKeyValues;
+    maKeyValues.clear();
+
     // limit the amount of code that needs to be executed before the crash reporting
-    std::string ini_path = CrashReporter::getIniFileName();
-    std::ofstream minidump_file(ini_path, std::ios_base::trunc);
-    minidump_file << "ProductName=LibreOffice\n";
-    minidump_file << "Version=" LIBO_VERSION_DOTTED "\n";
-    minidump_file << "BuildID=" << utl::Bootstrap::getBuildIdData("") << "\n";
-    minidump_file << "URL=" << protocol << "://" << url << "/submit/\n";
+    addKeyValue("ProductName", "LibreOffice", AddItem);
+    addKeyValue("Version", LIBO_VERSION_DOTTED, AddItem);
+    addKeyValue("BuildID", utl::Bootstrap::getBuildIdData(""), AddItem);
+    addKeyValue("URL", protocol + "://" + url + "/submit/", AddItem);
 
     if (proxy_server.aName != OUString())
     {
-        minidump_file << "Proxy=" << proxy_server.aName << ":" << proxy_server.nPort << "\n";
+        addKeyValue("Proxy", proxy_server.aName + ":" + OUString::number(proxy_server.nPort), AddItem);
     }
 
-    for (auto& keyValue : maKeyValues)
-    {
-        writeToStream(minidump_file, keyValue.first, keyValue.second);
-    }
-    maKeyValues.clear();
-    minidump_file.close();
+    maKeyValues.insert(maKeyValues.end(), atlast.begin(), atlast.end());
 
     mbInit = true;
 
+    writeToFile(std::ios_base::trunc);
+
     updateMinidumpLocation();
 }
 
+
 namespace {
 
 OUString getCrashDirectory()
@@ -144,6 +147,25 @@ void CrashReporter::updateMinidumpLocation()
 #endif
 }
 
+bool CrashReporter::crashReportInfoExists()
+{
+    static bool first = true;
+    static bool InfoExist = false;
+
+    if (first)
+    {
+        first = false;
+        InfoExist = crashreport::readConfig(CrashReporter::getIniFileName(), nullptr);
+    }
+
+    return InfoExist;
+}
+
+bool CrashReporter::readSendConfig(std::string& response)
+{
+    return crashreport::readConfig(CrashReporter::getIniFileName(), &response);
+}
+
 void CrashReporter::storeExceptionHandler(google_breakpad::ExceptionHandler* pExceptionHandler)
 {
     mpExceptionHandler = pExceptionHandler;
@@ -157,4 +179,7 @@ std::string CrashReporter::getIniFileName()
     return aRet;
 }
 
+
+#endif //HAVE_FEATURE_BREAKPAD
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index 4fb84d39d2d1..d8fc55d86596 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -41,7 +41,6 @@
 #include <unotools/mediadescriptor.hxx>
 
 #if HAVE_FEATURE_BREAKPAD
-#include <fstream>
 #include <desktop/crashreport.hxx>
 
 #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
@@ -76,11 +75,9 @@
 #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
 static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* /*context*/, bool succeeded)
 {
-    std::string ini_path = CrashReporter::getIniFileName();
-    std::ofstream minidump_file(ini_path, std::ios_base::app);
-    minidump_file << "DumpFile=" << descriptor.path() << "\n";
-    minidump_file.close();
+    CrashReporter::addKeyValue("DumpFile", OStringToOUString(descriptor.path(), RTL_TEXTENCODING_UTF8), CrashReporter::Write);
     SAL_WARN("desktop", "minidump generated: " << descriptor.path());
+
     return succeeded;
 }
 #elif defined WNT
@@ -89,17 +86,14 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* id,
                             MDRawAssertionInfo* /*assertion*/,
                             bool succeeded)
 {
-    std::string ini_path = CrashReporter::getIniFileName();
-    std::ofstream minidump_file(ini_path, std::ios_base::app);
     // TODO: moggi: can we avoid this conversion
 #ifdef _MSC_VER
 #pragma warning (disable: 4996)
 #endif
     std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1;
     std::string aPath = conv1.to_bytes(std::wstring(path)) + conv1.to_bytes(std::wstring(id)) + ".dmp";
-    minidump_file << "DumpFile=" << aPath << "\n";
-    minidump_file << "GDIHandles=" << ::GetGuiResources (::GetCurrentProcess(), GR_GDIOBJECTS) << "\n";
-    minidump_file.close();
+    CrashReporter::addKeyValue("DumpFile", OStringToOUString(aPath.c_str(), RTL_TEXTENCODING_UTF8), CrashReporter::AddItem);
+    CrashReporter::addKeyValue("GDIHandles", OUString::number(::GetGuiResources (::GetCurrentProcess(), GR_GDIOBJECTS)), CrashReporter::Write);
     SAL_WARN("desktop", "minidump generated: " << aPath);
     return succeeded;
 }
diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx
index 0e83ac98905c..05cf13a1e929 100644
--- a/desktop/source/minidump/minidump.cxx
+++ b/desktop/source/minidump/minidump.cxx
@@ -191,7 +191,7 @@ bool uploadContent(std::map<std::string, std::string>& parameters, std::string&
 
 namespace crashreport {
 
-bool readConfig(const std::string& iniPath, std::string& response)
+bool readConfig(const std::string& iniPath, std::string * response)
 {
     std::ifstream file(iniPath);
     std::map<std::string, std::string> parameters = readStrings(file);
@@ -199,17 +199,29 @@ bool readConfig(const std::string& iniPath, std::string& response)
     // make sure that at least the mandatory parameters are in there
     if (parameters.find("DumpFile") == parameters.end())
     {
-        response = "ini file needs to contain a key DumpFile!";
+        if(response != nullptr)
+            *response = "ini file needs to contain a key DumpFile!";
         return false;
     }
 
     if (parameters.find("Version") == parameters.end())
     {
-        response = "ini file needs to contain a key Version!";
+        if (response != nullptr)
+            *response = "ini file needs to contain a key Version!";
         return false;
     }
 
-    return uploadContent(parameters, response);
+    if (parameters.find("URL") == parameters.end())
+    {
+        if (response != nullptr)
+            *response = "ini file needs to contain a key URL!";
+        return false;
+    }
+
+    if (response != nullptr)
+        return uploadContent(parameters, *response);
+
+    return true;
 }
 
 }
diff --git a/desktop/source/minidump/minidump_upload.cxx b/desktop/source/minidump/minidump_upload.cxx
index ded2f1df0a43..15af26430764 100644
--- a/desktop/source/minidump/minidump_upload.cxx
+++ b/desktop/source/minidump/minidump_upload.cxx
@@ -22,7 +22,7 @@ int main(int argc, char** argv)
 
     std::string iniPath(argv[1]);
     std::string response;
-    if (!crashreport::readConfig(iniPath, response))
+    if (!crashreport::readConfig(iniPath, &response))
         return EXIT_FAILURE;
 
     std::cout << "Response: " << response << std::endl;
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 3ca73dbb13a4..0b296b90dd35 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -314,7 +314,7 @@ sal_Bool SAL_CALL Desktop::terminate()
         // see dispose() for further information.
         /* SAFE AREA --------------------------------------------------------------------------------------- */
         SolarMutexClearableGuard aWriteLock;
-        CrashReporter::addKeyValue("ShutDown", OUString::boolean(true));
+        CrashReporter::addKeyValue("ShutDown", OUString::boolean(true), CrashReporter::Write);
         m_bIsTerminated = true;
         aWriteLock.clear();
         /* UNSAFE AREA ------------------------------------------------------------------------------------- */
diff --git a/include/desktop/crashreport.hxx b/include/desktop/crashreport.hxx
index e3486bbf0863..3af83b8e637c 100644
--- a/include/desktop/crashreport.hxx
+++ b/include/desktop/crashreport.hxx
@@ -17,7 +17,8 @@
 
 #include <config_features.h>
 
-#include <map>
+// vector not sort the entries
+#include <vector>
 #include <string>
 
 namespace google_breakpad
@@ -41,40 +42,50 @@ CRASHREPORT_DLLPUBLIC
 /*class*/ CrashReporter
 {
 public:
-    static void addKeyValue(const OUString& rKey, const OUString& rValue);
-
-    static std::string getIniFileName();
-
-    static void writeCommonInfo();
+    typedef enum {AddItem, Write, Create} tAddKeyHandling;
+#if HAVE_FEATURE_BREAKPAD
+    static void addKeyValue(const OUString& rKey, const OUString& rValue, tAddKeyHandling AddKeyHandling);
 
     static void storeExceptionHandler(google_breakpad::ExceptionHandler* pExceptionHandler);
 
-    // when we create the ExceptionHandler we have no access to the user
-    // profile yet, so update when we have access
-    static void updateMinidumpLocation();
+    static bool crashReportInfoExists();
 
-private:
+    static bool readSendConfig(std::string& response);
 
+private:
     static osl::Mutex maMutex;
-
     static bool mbInit;
-
-    static std::map<OUString, OUString> maKeyValues; // used to temporarily save entries before the old info has been uploaded
+    typedef  struct _mpair
+    {
+        OUString first;
+        OUString second;
+        _mpair(const OUString& First, const OUString& Second)
+        {
+            first  = First;
+            second = Second;
+        };
+    } mpair;
+
+    typedef std::vector<mpair> vmaKeyValues;
+    static vmaKeyValues maKeyValues; // used to temporarily save entries before the old info has been uploaded
 
     static google_breakpad::ExceptionHandler* mpExceptionHandler;
-};
 
-// Add dummy methods for the non-breakpad case. That allows us to use
-// the code without linking to the lib and without adding HAVE_FEATURE_BREAKPAD
-// everywhere we want to log something to the crash report system.
-#if HAVE_FEATURE_BREAKPAD
-#else
-inline void CrashReporter::addKeyValue(SAL_UNUSED_PARAMETER const OUString& /*rKey*/, SAL_UNUSED_PARAMETER const OUString& /*rValue*/)
-{
-}
-#endif
+    static std::string getIniFileName();
+    static void writeCommonInfo();
+    static void writeToFile(std::ios_base::openmode Openmode);
+    // when we create the ExceptionHandler we have no access to the user
+    // profile yet, so update when we have access
+    static void updateMinidumpLocation();
 
+#else
+    // Add dummy methods for the non-breakpad case. That allows us to use
+    // // the code without linking to the lib and without adding HAVE_FEATURE_BREAKPAD
+    // // everywhere we want to log something to the crash report system.
+    inline static void addKeyValue(SAL_UNUSED_PARAMETER const OUString& /*rKey*/, SAL_UNUSED_PARAMETER const OUString& /*rValue*/, SAL_UNUSED_PARAMETER tAddKeyHandling /*AddKeyHandling*/) {};
+#endif // HAVE_FEATURE_BREAKPAD
+};
 
-#endif
+#endif // INCLUDED_DESKTOP_CRASHREPORT_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/desktop/minidump.hxx b/include/desktop/minidump.hxx
index 63336cae5595..6ed0e18277f8 100644
--- a/include/desktop/minidump.hxx
+++ b/include/desktop/minidump.hxx
@@ -16,7 +16,18 @@
 
 namespace crashreport {
 
-CRASHREPORT_DLLPUBLIC bool readConfig(const std::string& iniPath, std::string& response);
+// when response = nullptr only make test
+/** Read+Send, Test and send info from the Dump.ini .
+
+        @param [in] iniPath Path-file to the read/test ini-file
+        @param [in] response=nullptr in this case made the Test only
+        @param [in] response!=nullptr in this case made the Read+Send
+
+        @retval true       Read+Send, Test was okay
+        @retval false      Read+Send, Test is a error
+*/
+
+CRASHREPORT_DLLPUBLIC bool readConfig(const std::string& iniPath, std::string * response);
 
 }
 
diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx
index 70799f969bba..482af1f28950 100644
--- a/svx/source/dialog/crashreportdlg.cxx
+++ b/svx/source/dialog/crashreportdlg.cxx
@@ -14,7 +14,6 @@
 
 #include <rtl/bootstrap.hxx>
 #include <desktop/crashreport.hxx>
-#include <desktop/minidump.hxx>
 #include <sfx2/safemode.hxx>
 #include <comphelper/processfactory.hxx>
 #include <osl/file.hxx>
@@ -77,10 +76,8 @@ IMPL_LINK(CrashReportDialog, BtnHdl, Button*, pBtn, void)
 {
     if (pBtn == mpBtnSend.get())
     {
-        std::string ini_path = CrashReporter::getIniFileName();
-
         std::string response;
-        bool bSuccess = crashreport::readConfig(ini_path, response);
+        bool bSuccess = CrashReporter::readSendConfig(response);
 
         OUString aCrashID = OUString::createFromAscii(response.c_str());
 
diff --git a/vcl/opengl/win/WinDeviceInfo.cxx b/vcl/opengl/win/WinDeviceInfo.cxx
index f82a5e8726a9..bf593ced7c5c 100644
--- a/vcl/opengl/win/WinDeviceInfo.cxx
+++ b/vcl/opengl/win/WinDeviceInfo.cxx
@@ -540,9 +540,9 @@ void writeToLog(SvStream& rStrm, const char* pKey, const OUString & rVal)
 
 bool WinOpenGLDeviceInfo::isDeviceBlocked()
 {
-    CrashReporter::addKeyValue("OpenGLVendor", maAdapterVendorID);
-    CrashReporter::addKeyValue("OpenGLDevice", maAdapterDeviceID);
-    CrashReporter::addKeyValue("OpenGLDriver", maDriverVersion);
+    CrashReporter::addKeyValue("OpenGLVendor", maAdapterVendorID, CrashReporter::AddItem);
+    CrashReporter::addKeyValue("OpenGLDevice", maAdapterDeviceID, CrashReporter::AddItem);
+    CrashReporter::addKeyValue("OpenGLDriver", maDriverVersion, CrashReporter::Write);
 
     SAL_INFO("vcl.opengl", maDriverVersion);
     SAL_INFO("vcl.opengl", maDriverDate);
diff --git a/vcl/opengl/x11/X11DeviceInfo.cxx b/vcl/opengl/x11/X11DeviceInfo.cxx
index 402f18dde304..6ac3269035f4 100644
--- a/vcl/opengl/x11/X11DeviceInfo.cxx
+++ b/vcl/opengl/x11/X11DeviceInfo.cxx
@@ -282,8 +282,8 @@ bool X11OpenGLDeviceInfo::isDeviceBlocked()
     if (mnGLMajorVersion == 1)
         return true;
 
-    CrashReporter::addKeyValue("AdapterVendorId", rtl::OStringToOUString(maVendor, RTL_TEXTENCODING_UTF8));
-    CrashReporter::addKeyValue("AdapterDeviceId", rtl::OStringToOUString(maRenderer, RTL_TEXTENCODING_UTF8));
+    CrashReporter::addKeyValue("AdapterVendorId", rtl::OStringToOUString(maVendor, RTL_TEXTENCODING_UTF8), CrashReporter::AddItem);
+    CrashReporter::addKeyValue("AdapterDeviceId", rtl::OStringToOUString(maRenderer, RTL_TEXTENCODING_UTF8), CrashReporter::Write);
 
     SAL_INFO("vcl.opengl", "Vendor: " << maVendor);
     SAL_INFO("vcl.opengl", "Renderer: " << maRenderer);
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 80a502b50727..cad628204626 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -1044,7 +1044,7 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
         if (!getenv("SAL_DISABLE_GL_WATCHDOG"))
             OpenGLWatchdogThread::start();
     }
-    CrashReporter::addKeyValue("UseOpenGL", OUString::boolean(bRet));
+    CrashReporter::addKeyValue("UseOpenGL", OUString::boolean(bRet), CrashReporter::Write);
 
     return bRet;
 }
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index a35c87d7ee20..2de55dd63d76 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -361,7 +361,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr
     catch (const css::uno::Exception &rExcept)
     {
         DBG_UNHANDLED_EXCEPTION("vcl.layout", "Unable to read .ui file");
-        CrashReporter::addKeyValue("VclBuilderException", "Unable to read .ui file: " + rExcept.Message);
+        CrashReporter::addKeyValue("VclBuilderException", "Unable to read .ui file: " + rExcept.Message, CrashReporter::Write);
         throw;
     }
 
diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx
index d500cf29e491..792b6ae1fff0 100644
--- a/vcl/unx/generic/plugadapt/salplug.cxx
+++ b/vcl/unx/generic/plugadapt/salplug.cxx
@@ -278,7 +278,7 @@ void SalAbort( const OUString& rErrorText, bool bDumpCore )
         std::fprintf( stderr, "Application Error\n" );
     else
     {
-        CrashReporter::addKeyValue("AbortMessage", rErrorText);
+        CrashReporter::addKeyValue("AbortMessage", rErrorText, CrashReporter::Write);
         std::fprintf( stderr, "%s\n", OUStringToOString(rErrorText, osl_getThreadTextEncoding()).getStr() );
     }
     if( bDumpCore )
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 5e204a5f7583..d67e5dc3c862 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -77,7 +77,7 @@ void SalAbort( const OUString& rErrorText, bool )
     }
     else
     {
-        CrashReporter::addKeyValue("AbortMessage", rErrorText);
+        CrashReporter::addKeyValue("AbortMessage", rErrorText, CrashReporter::Write);
         // make sure crash reporter is triggered
         RaiseException( 0, EXCEPTION_NONCONTINUABLE, 0, nullptr );
         FatalAppExitW( 0, o3tl::toW(rErrorText.getStr()) );


More information about the Libreoffice-commits mailing list