summaryrefslogtreecommitdiff
path: root/vcl/source/window/builder.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window/builder.cxx')
-rw-r--r--vcl/source/window/builder.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index c83f6339d432..be9b46984300 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -408,8 +408,11 @@ namespace weld
VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUString& sUIFile,
const OString& sID, const css::uno::Reference<css::frame::XFrame>& rFrame,
- bool bLegacy, const NotebookBarAddonsItem& aNotebookBarAddonsItem)
- : m_sID(sID)
+ bool bLegacy, const NotebookBarAddonsItem* pNotebookBarAddonsItem)
+ : m_pNotebookBarAddonsItem(pNotebookBarAddonsItem
+ ? new NotebookBarAddonsItem(*pNotebookBarAddonsItem)
+ : new NotebookBarAddonsItem{})
+ , m_sID(sID)
, m_sHelpRoot(OUStringToOString(sUIFile, RTL_TEXTENCODING_UTF8))
, m_pStringReplace(Translate::GetReadStringHook())
, m_pParent(pParent)
@@ -418,7 +421,6 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
, m_pParserState(new ParserState)
, m_xFrame(rFrame)
{
- m_pNotebookBarAddonsItem = aNotebookBarAddonsItem;
m_bToplevelHasDeferredInit = pParent &&
((pParent->IsSystemWindow() && static_cast<SystemWindow*>(pParent)->isDeferredInit()) ||
(pParent->IsDockingWindow() && static_cast<DockingWindow*>(pParent)->isDeferredInit()));
@@ -2239,7 +2241,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
{
customMakeWidget pFunction = GetCustomMakeWidget("sfxlo-NotebookbarToolBox");
if(pFunction != nullptr)
- NotebookBarAddonsMerger::MergeNotebookBarAddons(pParent, pFunction, m_xFrame, m_pNotebookBarAddonsItem, rMap);
+ NotebookBarAddonsMerger::MergeNotebookBarAddons(pParent, pFunction, m_xFrame, *m_pNotebookBarAddonsItem, rMap);
return nullptr;
}
else if (name == "GtkToolButton" || name == "GtkMenuToolButton" ||
@@ -3539,7 +3541,7 @@ void VclBuilder::insertMenuObject(PopupMenu *pParent, PopupMenu *pSubMenu, const
if(rClass == "NotebookBarAddonsMenuMergePoint")
{
- NotebookBarAddonsMerger::MergeNotebookBarMenuAddons(pParent, nNewId, rID, m_pNotebookBarAddonsItem);
+ NotebookBarAddonsMerger::MergeNotebookBarMenuAddons(pParent, nNewId, rID, *m_pNotebookBarAddonsItem);
m_pParserState->m_nLastMenuItemId = pParent->GetItemCount();
}
else if (rClass == "GtkMenuItem")