summaryrefslogtreecommitdiff
path: root/vcl
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 /vcl
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>
Diffstat (limited to 'vcl')
-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
4 files changed, 14 insertions, 8 deletions
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);
}