summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-09-03 12:54:48 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-09-03 22:24:23 +0200
commite44db461ca135fcbef7854c7304c894b65fcd497 (patch)
treebf24b37c2abdbddcde0eaee322d09c61c93569e7
parent446f4b086ccd4cdb9524637e4808dbe6b7d40f7e (diff)
Ensure that VCL builder entry points use proper function type
This removes duplicating typedefs from NotebookBarAddonsMerger, and removes dependency of include/vcl/builder.hxx on include/vcl/NotebookBarAddonsMerger.hxx. Change-Id: Ica5787c934d1b8ce21623f28ce155337637fdf54 Reviewed-on: https://gerrit.libreoffice.org/78549 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--cui/source/options/optcolor.cxx2
-rw-r--r--dbaccess/source/ui/dlg/indexfieldscontrol.cxx2
-rw-r--r--include/vcl/NotebookBarAddonsMerger.hxx9
-rw-r--r--include/vcl/builder.hxx7
-rw-r--r--include/vcl/builderfactory.hxx6
-rw-r--r--sfx2/source/appl/newhelp.cxx10
-rw-r--r--sfx2/source/sidebar/SidebarToolBox.cxx4
-rw-r--r--svtools/source/contnr/fileview.cxx2
-rw-r--r--svtools/source/control/ctrlbox.cxx6
-rw-r--r--svtools/source/control/inettbc.cxx2
-rw-r--r--svx/source/dialog/langbox.cxx4
-rw-r--r--svx/source/dialog/relfld.cxx2
-rw-r--r--svx/source/dialog/txencbox.cxx2
-rw-r--r--sw/source/uibase/utlui/numfmtlb.cxx2
-rw-r--r--vcl/source/control/notebookbar.cxx2
-rw-r--r--vcl/source/window/NotebookBarAddonsMerger.cxx4
-rw-r--r--vcl/source/window/builder.cxx12
-rw-r--r--vcl/source/window/printdlg.cxx4
18 files changed, 66 insertions, 16 deletions
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 7cf455e821fd..d85381cc70a5 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -861,6 +861,8 @@ void ColorConfigCtrl_Impl::dispose()
extern "C" SAL_DLLPUBLIC_EXPORT void makeColorConfigCtrl(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap &)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeColorConfigCtrl)>);
rRet = VclPtr<ColorConfigCtrl_Impl>::Create(pParent);
}
diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
index cfc8143a2288..dc3296a7187a 100644
--- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
+++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
@@ -81,6 +81,8 @@ static constexpr auto BROWSER_STANDARD_FLAGS = BrowserMode::COLUMNSELECTION | Br
extern "C" SAL_DLLPUBLIC_EXPORT void makeDbaIndexFieldsControl(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap &)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeDbaIndexFieldsControl)>);
rRet = VclPtr<IndexFieldsControl>::Create(pParent, WB_BORDER | WB_NOTABSTOP);
}
diff --git a/include/vcl/NotebookBarAddonsMerger.hxx b/include/vcl/NotebookBarAddonsMerger.hxx
index 913e50734472..9b13ff145625 100644
--- a/include/vcl/NotebookBarAddonsMerger.hxx
+++ b/include/vcl/NotebookBarAddonsMerger.hxx
@@ -20,6 +20,7 @@
#ifndef INCLUDED_VCL_NOTEBOOKBARADDONSMERGER_HXX
#define INCLUDED_VCL_NOTEBOOKBARADDONSMERGER_HXX
+#include <vcl/builder.hxx>
#include <vcl/window.hxx>
#include <vcl/image.hxx>
#include <vcl/menu.hxx>
@@ -60,15 +61,13 @@ struct AddonNotebookBarItem
class NotebookBarAddonsMerger
{
public:
- typedef std::map<OString, OUString> stringmap;
- typedef void (*customMakeWidget)(VclPtr<vcl::Window>& rRet, const VclPtr<vcl::Window>& pParent,
- stringmap& rVec);
NotebookBarAddonsMerger();
~NotebookBarAddonsMerger();
- static void MergeNotebookBarAddons(vcl::Window* pParent, const customMakeWidget& pFunction,
+ static void MergeNotebookBarAddons(vcl::Window* pParent,
+ const VclBuilder::customMakeWidget& pFunction,
const css::uno::Reference<css::frame::XFrame>& rFrame,
const NotebookBarAddonsItem& aNotebookBarAddonsItem,
- stringmap rVec);
+ VclBuilder::stringmap& rVec);
static void MergeNotebookBarMenuAddons(PopupMenu* pPopupMenu, sal_Int16 nItemId,
const OString& sItemIdName,
NotebookBarAddonsItem& aNotebookBarAddonsItem);
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 4cdd10930dea..35504dc0d701 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -15,7 +15,6 @@
#include <unotools/resmgr.hxx>
#include <tools/fldunit.hxx>
#include <vcl/dllapi.h>
-#include <vcl/NotebookBarAddonsMerger.hxx>
#include <vcl/window.hxx>
#include <vcl/vclptr.hxx>
#include <tools/wintypes.hxx>
@@ -45,6 +44,7 @@ class DateField;
class TimeField;
class VclExpander;
class VclMultiLineEdit;
+struct NotebookBarAddonsItem;
namespace xmlreader { class XmlReader; }
namespace com { namespace sun { namespace star { namespace frame { class XFrame; } } } }
@@ -73,11 +73,10 @@ public:
const css::uno::Reference<css::frame::XFrame>& rFrame
= css::uno::Reference<css::frame::XFrame>(),
bool bLegacy = true,
- const NotebookBarAddonsItem& aNotebookBarAddonsItem = NotebookBarAddonsItem());
+ const NotebookBarAddonsItem* pNotebookBarAddonsItem = nullptr);
~VclBuilder();
///releases references and disposes all children.
void disposeBuilder();
- NotebookBarAddonsItem m_pNotebookBarAddonsItem;
//sID must exist and be of type T
template <typename T> T* get(VclPtr<T>& ret, const OString& sID);
@@ -121,6 +120,8 @@ private:
//Show or Execute
stringmap m_aDeferredProperties;
+ std::unique_ptr<NotebookBarAddonsItem> m_pNotebookBarAddonsItem;
+
struct PackingData
{
bool m_bVerticalOrient;
diff --git a/include/vcl/builderfactory.hxx b/include/vcl/builderfactory.hxx
index 719f1d8b206c..c6b1b0ccf870 100644
--- a/include/vcl/builderfactory.hxx
+++ b/include/vcl/builderfactory.hxx
@@ -16,6 +16,8 @@
#define VCL_BUILDER_FACTORY(typeName) \
extern "C" SAL_DLLPUBLIC_EXPORT void make##typeName(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) \
{ \
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>, \
+ decltype(make##typeName)>); \
(void)rMap; \
rRet = VclPtr<typeName>::Create(pParent); \
}
@@ -23,6 +25,8 @@
#define VCL_BUILDER_FACTORY_ARGS(typeName,arg1) \
extern "C" SAL_DLLPUBLIC_EXPORT void make##typeName(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) \
{ \
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>, \
+ decltype(make##typeName)>); \
(void)rMap; \
rRet = VclPtr<typeName>::Create(pParent,arg1); \
}
@@ -30,6 +34,8 @@
#define VCL_BUILDER_FACTORY_CONSTRUCTOR(typeName,arg2) \
extern "C" SAL_DLLPUBLIC_EXPORT void make##typeName(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap) \
{ \
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>, \
+ decltype(make##typeName)>); \
OUString sBorder = BuilderUtils::extractCustomProperty(rMap); \
WinBits wb = arg2; \
if (!sBorder.isEmpty()) \
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 6a77c164a1b0..c34308afb72d 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -287,6 +287,8 @@ ContentListBox_Impl::ContentListBox_Impl(vcl::Window* pParent, WinBits nStyle)
extern "C" SAL_DLLPUBLIC_EXPORT void makeContentListBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeContentListBox)>);
WinBits nWinStyle = WB_TABSTOP;
OUString sBorder = BuilderUtils::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
@@ -472,6 +474,8 @@ IndexBox_Impl::IndexBox_Impl(vcl::Window* pParent, WinBits nStyle)
extern "C" SAL_DLLPUBLIC_EXPORT void makeIndexBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeIndexBox)>);
WinBits nWinBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK;
OUString sBorder = BuilderUtils::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
@@ -848,6 +852,8 @@ void IndexTabPage_Impl::OpenKeyword()
extern "C" SAL_DLLPUBLIC_EXPORT void makeSearchBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap &)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeSearchBox)>);
WinBits nWinBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE|WB_DROPDOWN;
VclPtrInstance<SearchBox_Impl> pComboBox(pParent, nWinBits);
pComboBox->EnableAutoSize(true);
@@ -879,6 +885,8 @@ void SearchBox_Impl::Select()
extern "C" SAL_DLLPUBLIC_EXPORT void makeSearchResultsBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeSearchResultsBox)>);
WinBits nWinBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK;
OUString sBorder = BuilderUtils::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
@@ -1137,6 +1145,8 @@ BookmarksBox_Impl::BookmarksBox_Impl(vcl::Window* pParent, WinBits nStyle)
extern "C" SAL_DLLPUBLIC_EXPORT void makeBookmarksBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeBookmarksBox)>);
WinBits nWinBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE;
OUString sBorder = BuilderUtils::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx
index c3f7ea376782..2aead2974987 100644
--- a/sfx2/source/sidebar/SidebarToolBox.cxx
+++ b/sfx2/source/sidebar/SidebarToolBox.cxx
@@ -333,6 +333,8 @@ public:
extern "C" SAL_DLLPUBLIC_EXPORT void makeSidebarToolBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeSidebarToolBox)>);
VclPtrInstance<SidebarToolBox> pBox(pParent);
pBox->InitToolBox(rMap);
rRet = pBox;
@@ -340,6 +342,8 @@ extern "C" SAL_DLLPUBLIC_EXPORT void makeSidebarToolBox(VclPtr<vcl::Window> & rR
extern "C" SAL_DLLPUBLIC_EXPORT void makeNotebookbarToolBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeNotebookbarToolBox)>);
VclPtrInstance<NotebookbarToolBox> pBox(pParent);
pBox->InitToolBox(rMap);
rRet = pBox;
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 23a32c0590b9..4c979935d108 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -881,6 +881,8 @@ void SvtFileView::dispose()
extern "C" SAL_DLLPUBLIC_EXPORT void makeSvtFileView(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeSvtFileView)>);
WinBits nBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK;
bool bDropdown = BuilderUtils::extractDropdown(rMap);
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index d731cacf8cf3..860186e80a3a 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -341,6 +341,8 @@ FontNameBox::FontNameBox( vcl::Window* pParent, WinBits nWinStyle ) :
extern "C" SAL_DLLPUBLIC_EXPORT void makeFontNameBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeFontNameBox)>);
bool bDropdown = BuilderUtils::extractDropdown(rMap);
WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
if (bDropdown)
@@ -727,6 +729,8 @@ Size FontStyleBox::GetOptimalSize() const
extern "C" SAL_DLLPUBLIC_EXPORT void makeFontStyleBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeFontStyleBox)>);
bool bDropdown = BuilderUtils::extractDropdown(rMap);
WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
if (bDropdown)
@@ -927,6 +931,8 @@ FontSizeBox::FontSizeBox( vcl::Window* pParent, WinBits nWinSize ) :
extern "C" SAL_DLLPUBLIC_EXPORT void makeFontSizeBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeFontSizeBox)>);
bool bDropdown = BuilderUtils::extractDropdown(rMap);
WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
if (bDropdown)
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index e40b8f703fe1..9d3c130f8880 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -1414,6 +1414,8 @@ SvtURLBox::SvtURLBox( vcl::Window* pParent, WinBits _nStyle, INetProtocol eSmart
extern "C" SAL_DLLPUBLIC_EXPORT void makeSvtURLBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap &)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeSvtURLBox)>);
WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP|
WB_DROPDOWN|WB_AUTOHSCROLL;
VclPtrInstance<SvtURLBox> pListBox(pParent, nWinBits, INetProtocol::NotValid, false);
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index a51290c0df9b..b30d234aed4a 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -95,6 +95,8 @@ static bool lcl_SeqHasLang( const Sequence< sal_Int16 > & rLangSeq, sal_Int16 nL
extern "C" SAL_DLLPUBLIC_EXPORT void makeSvxLanguageBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeSvxLanguageBox)>);
WinBits nBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
bool bDropdown = BuilderUtils::extractDropdown(rMap);
if (bDropdown)
@@ -108,6 +110,8 @@ extern "C" SAL_DLLPUBLIC_EXPORT void makeSvxLanguageBox(VclPtr<vcl::Window> & rR
extern "C" SAL_DLLPUBLIC_EXPORT void makeSvxLanguageComboBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeSvxLanguageComboBox)>);
WinBits nBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
bool bDropdown = BuilderUtils::extractDropdown(rMap);
if (bDropdown)
diff --git a/svx/source/dialog/relfld.cxx b/svx/source/dialog/relfld.cxx
index fc2c7a4df643..47642e3ec716 100644
--- a/svx/source/dialog/relfld.cxx
+++ b/svx/source/dialog/relfld.cxx
@@ -32,6 +32,8 @@ SvxRelativeField::SvxRelativeField(
extern "C" SAL_DLLPUBLIC_EXPORT void makeSvxRelativeField(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeSvxRelativeField)>);
OUString const custom(BuilderUtils::extractCustomProperty(rMap));
FieldUnit const eUnit(BuilderUtils::detectUnit(custom));
rRet = VclPtr<SvxRelativeField>::Create(pParent,
diff --git a/svx/source/dialog/txencbox.cxx b/svx/source/dialog/txencbox.cxx
index 0eec2058e451..68a6aaea3313 100644
--- a/svx/source/dialog/txencbox.cxx
+++ b/svx/source/dialog/txencbox.cxx
@@ -43,6 +43,8 @@ SvxTextEncodingBox::SvxTextEncodingBox( vcl::Window* pParent, WinBits nBits )
extern "C" SAL_DLLPUBLIC_EXPORT void makeSvxTextEncodingBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeSvxTextEncodingBox)>);
WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE;
bool bDropdown = BuilderUtils::extractDropdown(rMap);
if (bDropdown)
diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx
index 703e78a87674..078a85278181 100644
--- a/sw/source/uibase/utlui/numfmtlb.cxx
+++ b/sw/source/uibase/utlui/numfmtlb.cxx
@@ -63,6 +63,8 @@ NumFormatListBox::NumFormatListBox(vcl::Window* pWin, WinBits nStyle) :
extern "C" SAL_DLLPUBLIC_EXPORT void makeNumFormatListBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
{
+ static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
+ decltype(makeNumFormatListBox)>);
WinBits nBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
bool bDropdown = BuilderUtils::extractDropdown(rMap);
diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx
index 8fefed9c5841..b178962f5d11 100644
--- a/vcl/source/control/notebookbar.cxx
+++ b/vcl/source/control/notebookbar.cxx
@@ -62,7 +62,7 @@ NotebookBar::NotebookBar(Window* pParent, const OString& rID, const OUString& rU
if ( doesCustomizedUIExist )
sUIDir = getCustomizedUIRootDir();
m_pUIBuilder.reset(
- new VclBuilder(this, sUIDir, rUIXMLDescription, rID, rFrame, true, aNotebookBarAddonsItem));
+ new VclBuilder(this, sUIDir, rUIXMLDescription, rID, rFrame, true, &aNotebookBarAddonsItem));
mxFrame = rFrame;
// In the Notebookbar's .ui file must exist control handling context
// - implementing NotebookbarContextControl interface with id "ContextContainer"
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);
}