summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/builder.hxx2
-rw-r--r--include/vcl/builderbase.hxx4
-rw-r--r--include/vcl/widgetbuilder.hxx4
-rw-r--r--vcl/inc/jsdialog/jsdialogbuilder.hxx8
-rw-r--r--vcl/inc/salvtables.hxx2
-rw-r--r--vcl/jsdialog/jsdialogbuilder.cxx16
-rw-r--r--vcl/source/app/salvtables.cxx4
-rw-r--r--vcl/source/window/builder.cxx11
8 files changed, 27 insertions, 24 deletions
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 3ad480eece64..61f7172d0395 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -61,7 +61,7 @@ public:
typedef void (*customMakeWidget)(VclPtr<vcl::Window> &rRet, const VclPtr<vcl::Window> &pParent, stringmap &rVec);
public:
- VclBuilder(vcl::Window* pParent, const OUString& sUIRootDir, const OUString& sUIFile,
+ VclBuilder(vcl::Window* pParent, std::u16string_view sUIRootDir, const OUString& sUIFile,
OUString sID = {},
css::uno::Reference<css::frame::XFrame> xFrame
= css::uno::Reference<css::frame::XFrame>(),
diff --git a/include/vcl/builderbase.hxx b/include/vcl/builderbase.hxx
index 3c833c054434..cee443c26310 100644
--- a/include/vcl/builderbase.hxx
+++ b/include/vcl/builderbase.hxx
@@ -43,7 +43,7 @@ public:
typedef stringmap TextBuffer;
protected:
- BuilderBase(const OUString& rUIFile, bool bLegacy);
+ BuilderBase(std::u16string_view sUIDir, const OUString& rUIFile, bool bLegacy);
virtual ~BuilderBase() = default;
struct ListStore
@@ -76,6 +76,7 @@ protected:
static OUString getStyleClass(xmlreader::XmlReader& reader);
static bool hasOrientationVertical(stringmap& rMap);
+ OUString getUIFileUrl() { return m_sUIFileUrl; }
OUString getHelpRoot() { return m_sHelpRoot; }
bool isLegacy() { return m_bLegacy; }
const std::locale& getResLocale() const;
@@ -118,6 +119,7 @@ private:
std::unique_ptr<ParserState> m_pParserState;
+ OUString m_sUIFileUrl;
OUString m_sHelpRoot;
bool m_bLegacy;
};
diff --git a/include/vcl/widgetbuilder.hxx b/include/vcl/widgetbuilder.hxx
index da2370ad5845..ccd418e2c0d2 100644
--- a/include/vcl/widgetbuilder.hxx
+++ b/include/vcl/widgetbuilder.hxx
@@ -33,8 +33,8 @@
template <typename Widget, typename WidgetPtr> class WidgetBuilder : public BuilderBase
{
protected:
- WidgetBuilder(const OUString& rUIFile, bool bLegacy)
- : BuilderBase(rUIFile, bLegacy)
+ WidgetBuilder(std::u16string_view sUIDir, const OUString& rUIFile, bool bLegacy)
+ : BuilderBase(sUIDir, rUIFile, bLegacy)
{
}
virtual ~WidgetBuilder() = default;
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index ac529cef12b0..33bf2ccb6bd3 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -249,17 +249,17 @@ class JSInstanceBuilder final : public SalInstanceBuilder, public JSDialogSender
public:
/// used for dialogs or popups
- JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile,
+ JSInstanceBuilder(weld::Widget* pParent, std::u16string_view sUIRoot, const OUString& rUIFile,
bool bPopup = false);
/// used for sidebar panels
- JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile,
+ JSInstanceBuilder(weld::Widget* pParent, std::u16string_view sUIRoot, const OUString& rUIFile,
sal_uInt64 nLOKWindowId);
/// used for notebookbar, optional nWindowId is used if getting parent id failed
- JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
+ JSInstanceBuilder(vcl::Window* pParent, std::u16string_view sUIRoot, const OUString& rUIFile,
const css::uno::Reference<css::frame::XFrame>& rFrame,
sal_uInt64 nWindowId = 0);
/// used for formulabar
- JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
+ JSInstanceBuilder(vcl::Window* pParent, std::u16string_view sUIRoot, const OUString& rUIFile,
sal_uInt64 nLOKWindowId);
static std::unique_ptr<JSInstanceBuilder>
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index ba7653a0fc40..f57ecc9395e3 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -46,7 +46,7 @@ protected:
VclPtr<vcl::Window> m_aOwnedToplevel;
public:
- SalInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
+ SalInstanceBuilder(vcl::Window* pParent, std::u16string_view sUIRoot, const OUString& rUIFile,
const css::uno::Reference<css::frame::XFrame>& rFrame
= css::uno::Reference<css::frame::XFrame>());
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 7c90d59e8c48..797247fef13e 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -492,9 +492,9 @@ OUString JSInstanceBuilder::getMapIdFromWindowId() const
}
// used for dialogs
-JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot,
+JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, const std::u16string_view sUIRoot,
const OUString& rUIFile, bool bPopup)
- : SalInstanceBuilder(extract_sal_widget(pParent), rUIRoot, rUIFile)
+ : SalInstanceBuilder(extract_sal_widget(pParent), sUIRoot, rUIFile)
, m_nWindowId(0)
, m_aParentDialog(nullptr)
, m_aContentWindow(nullptr)
@@ -526,9 +526,9 @@ JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIR
}
// used for sidebar panels
-JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot,
+JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, std::u16string_view sUIRoot,
const OUString& rUIFile, sal_uInt64 nLOKWindowId)
- : SalInstanceBuilder(extract_sal_widget(pParent), rUIRoot, rUIFile)
+ : SalInstanceBuilder(extract_sal_widget(pParent), sUIRoot, rUIFile)
, m_nWindowId(nLOKWindowId)
, m_aParentDialog(nullptr)
, m_aContentWindow(nullptr)
@@ -568,11 +568,11 @@ JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIR
}
// used for notebookbar
-JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot,
+JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, std::u16string_view sUIRoot,
const OUString& rUIFile,
const css::uno::Reference<css::frame::XFrame>& rFrame,
sal_uInt64 nWindowId)
- : SalInstanceBuilder(pParent, rUIRoot, rUIFile, rFrame)
+ : SalInstanceBuilder(pParent, sUIRoot, rUIFile, rFrame)
, m_nWindowId(0)
, m_aParentDialog(nullptr)
, m_aContentWindow(nullptr)
@@ -601,9 +601,9 @@ JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRo
}
// used for formulabar
-JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot,
+JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, std::u16string_view sUIRoot,
const OUString& rUIFile, sal_uInt64 nLOKWindowId)
- : SalInstanceBuilder(pParent, rUIRoot, rUIFile)
+ : SalInstanceBuilder(pParent, sUIRoot, rUIFile)
, m_nWindowId(nLOKWindowId)
, m_aParentDialog(nullptr)
, m_aContentWindow(nullptr)
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 728f2ec8428d..c875b3847ea1 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -7078,11 +7078,11 @@ void SalInstancePopover::resize_to_request()
IMPL_LINK_NOARG(SalInstancePopover, PopupModeEndHdl, FloatingWindow*, void) { signal_closed(); }
-SalInstanceBuilder::SalInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot,
+SalInstanceBuilder::SalInstanceBuilder(vcl::Window* pParent, std::u16string_view sUIRoot,
const OUString& rUIFile,
const css::uno::Reference<css::frame::XFrame>& rFrame)
: weld::Builder()
- , m_xBuilder(new VclBuilder(pParent, rUIRoot, rUIFile, {}, rFrame, false))
+ , m_xBuilder(new VclBuilder(pParent, sUIRoot, rUIFile, {}, rFrame, false))
{
}
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 25bab94a1265..bfbab0d89a00 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -444,8 +444,9 @@ namespace weld
}
}
-BuilderBase::BuilderBase(const OUString& rUIFile, bool bLegacy)
+BuilderBase::BuilderBase(std::u16string_view sUIDir, const OUString& rUIFile, bool bLegacy)
: m_pParserState(new ParserState)
+ , m_sUIFileUrl(sUIDir + rUIFile)
, m_sHelpRoot(rUIFile)
, m_bLegacy(bLegacy)
{
@@ -487,10 +488,10 @@ OUString BuilderBase::finalizeValue(const OString& rContext, const OString& rVal
void BuilderBase::resetParserState() { m_pParserState.reset(); }
-VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUString& sUIFile,
+VclBuilder::VclBuilder(vcl::Window* pParent, std::u16string_view sUIDir, const OUString& sUIFile,
OUString sID, css::uno::Reference<css::frame::XFrame> xFrame,
bool bLegacy, const NotebookBarAddonsItem* pNotebookBarAddonsItem)
- : WidgetBuilder(sUIFile, bLegacy)
+ : WidgetBuilder(sUIDir, sUIFile, bLegacy)
, m_pNotebookBarAddonsItem(pNotebookBarAddonsItem
? new NotebookBarAddonsItem(*pNotebookBarAddonsItem)
: new NotebookBarAddonsItem{})
@@ -507,13 +508,13 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
try
{
- xmlreader::XmlReader reader(sUIDir + sUIFile);
+ xmlreader::XmlReader reader(getUIFileUrl());
handleChild(pParent, nullptr, reader);
}
catch (const css::uno::Exception &rExcept)
{
- TOOLS_WARN_EXCEPTION("vcl.builder", "Unable to read .ui file " << sUIDir << sUIFile);
+ 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);
assert(false && "missing ui file or missing gb_CppunitTest_use_uiconfigs dependency");
throw;