summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/NotebookBarAddonsMerger.cxx4
-rw-r--r--vcl/source/window/builder.cxx12
-rw-r--r--vcl/source/window/printdlg.cxx4
3 files changed, 13 insertions, 7 deletions
diff --git a/vcl/source/window/NotebookBarAddonsMerger.cxx b/vcl/source/window/NotebookBarAddonsMerger.cxx
index f9f4c70343fa..01c8bbd0977e 100644
--- a/vcl/source/window/NotebookBarAddonsMerger.cxx
+++ b/vcl/source/window/NotebookBarAddonsMerger.cxx
@@ -110,9 +110,9 @@ NotebookBarAddonsMerger::NotebookBarAddonsMerger() {}
NotebookBarAddonsMerger::~NotebookBarAddonsMerger() {}
void NotebookBarAddonsMerger::MergeNotebookBarAddons(
- vcl::Window* pParent, const customMakeWidget& pFunction,
+ vcl::Window* pParent, const VclBuilder::customMakeWidget& pFunction,
const css::uno::Reference<css::frame::XFrame>& m_xFrame,
- const NotebookBarAddonsItem& aNotebookBarAddonsItem, NotebookBarAddonsMerger::stringmap rMap)
+ const NotebookBarAddonsItem& aNotebookBarAddonsItem, VclBuilder::stringmap& rMap)
{
std::vector<Image> aImageVec = aNotebookBarAddonsItem.aImageValues;
unsigned long nIter = 0;
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")
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 0efcbab73225..0fa17941e317 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -59,11 +59,15 @@ enum
extern "C" SAL_DLLPUBLIC_EXPORT void makePrintPreviewWindow(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap &)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makePrintPreviewWindow)>);
rRet = VclPtr<PrintDialog::PrintPreviewWindow>::Create(pParent);
}
extern "C" SAL_DLLPUBLIC_EXPORT void makeShowNupOrderWindow(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap &)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeShowNupOrderWindow)>);
rRet = VclPtr<PrintDialog::ShowNupOrderWindow>::Create(pParent);
}