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 #include +#include + #include #include @@ -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 #include -#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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)