include/vcl/builderbase.hxx   |    4 ++++
 include/vcl/widgetbuilder.hxx |    5 +----
 vcl/source/window/builder.cxx |    8 ++++++++
 3 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 70a183875aaa11f3099b8280ff76cff1a3db0d2b
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Thu Sep 26 13:40:54 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Thu Sep 26 15:33:38 2024 +0200

    Fix build: move CrashReporter code to vcl/source/window/builder.cxx
    
    This problem appeared after commit 1a1bf2b78d689a570cc71b7bcb3e0100947a2fb1
    (tdf#130857 VclBuilder: Extract helper to start parsing UI file, 
2024-09-26):
    
    [LNK] Library/libvclplug_qt5lo.so
    /home/mk/core/include/vcl/widgetbuilder.hxx:55: error: undefined reference 
to 'CrashReporter::addKeyValue(rtl::OUString const&, rtl::OUString const&, 
CrashReporter::tAddKeyHandling)'
    collect2: error: ld returned 1 exit status
    make[1]: *** [/home/mk/core/vcl/Library_vclplug_qt5.mk:20: 
/home/mk/build/instdir/program/libvclplug_qt5lo.so] Error 1
    
    Change-Id: I212aa3cbc381770de8fec07ea6454ab209edefc6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173977
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/include/vcl/builderbase.hxx b/include/vcl/builderbase.hxx
index a3ca6e4f673c..3c9ab89b9110 100644
--- a/include/vcl/builderbase.hxx
+++ b/include/vcl/builderbase.hxx
@@ -14,6 +14,8 @@
 #include <vcl/dllapi.h>
 #include <vcl/EnumContext.hxx>
 
+#include <com/sun/star/uno/Exception.hpp>
+
 #include <map>
 #include <vector>
 
@@ -105,6 +107,8 @@ protected:
 
     virtual void resetParserState();
 
+    static void reportException(const css::uno::Exception& rExcept);
+
 private:
     struct ParserState
     {
diff --git a/include/vcl/widgetbuilder.hxx b/include/vcl/widgetbuilder.hxx
index b0ea18da1a47..54d3d89c4d4f 100644
--- a/include/vcl/widgetbuilder.hxx
+++ b/include/vcl/widgetbuilder.hxx
@@ -11,7 +11,6 @@
 
 #include <com/sun/star/uno/Exception.hpp>
 #include <comphelper/diagnose_ex.hxx>
-#include <desktop/crashreport.hxx>
 #include <sal/log.hxx>
 #include <vcl/builderbase.hxx>
 #include <xmlreader/span.hxx>
@@ -52,9 +51,7 @@ protected:
         catch (const css::uno::Exception& rExcept)
         {
             TOOLS_WARN_EXCEPTION("vcl.builder", "Unable to read .ui file " << 
getUIFileUrl());
-            CrashReporter::addKeyValue(u"VclBuilderException"_ustr,
-                                       "Unable to read .ui file: " + 
rExcept.Message,
-                                       CrashReporter::Write);
+            reportException(rExcept);
             assert(false && "missing ui file or missing 
gb_CppunitTest_use_uiconfigs dependency");
             throw;
         }
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 9ca9be6e7e49..8000b7c565fd 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -72,6 +72,7 @@
 #include <PriorityHBox.hxx>
 #include <window.h>
 #include <xmlreader/xmlreader.hxx>
+#include <desktop/crashreport.hxx>
 #include <calendar.hxx>
 #include <menutogglebutton.hxx>
 #include <salinst.hxx>
@@ -442,6 +443,13 @@ namespace weld
     }
 }
 
+// static
+void BuilderBase::reportException(const css::uno::Exception& rExcept)
+{
+    CrashReporter::addKeyValue(u"VclBuilderException"_ustr,
+                               "Unable to read .ui file: " + rExcept.Message, 
CrashReporter::Write);
+}
+
 BuilderBase::BuilderBase(std::u16string_view sUIDir, const OUString& rUIFile, 
bool bLegacy)
     : m_pParserState(new ParserState)
     , m_sUIFileUrl(sUIDir + rUIFile)

Reply via email to