summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-06-23 12:49:17 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2020-06-25 12:52:50 +0200
commite9123adc14068b57943da087f377a5c60e82c9c7 (patch)
tree28c3353c9c4b2ee54405a3011654a51c18a7d2ed /include
parent58750ad38fc1e9809cc4febebf218c95845dfe05 (diff)
jsdialog: get widget depending on viewshell
Notebookbar always gets window id 0 what causes conflict in map and some widgets doesn't work Change-Id: I15b4e83d385e83bcf898148a871ddf540257cc81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97099 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/notebookbar/WeldedTabbedNotebookbar.hxx4
-rw-r--r--include/vcl/jsdialog/jsdialogbuilder.hxx13
2 files changed, 10 insertions, 7 deletions
diff --git a/include/sfx2/notebookbar/WeldedTabbedNotebookbar.hxx b/include/sfx2/notebookbar/WeldedTabbedNotebookbar.hxx
index d709fc64fcf1..b5ae5dcfb517 100644
--- a/include/sfx2/notebookbar/WeldedTabbedNotebookbar.hxx
+++ b/include/sfx2/notebookbar/WeldedTabbedNotebookbar.hxx
@@ -13,7 +13,6 @@
#include <sfx2/dllapi.h>
#include <rtl/ustring.hxx>
#include <vcl/weld.hxx>
-#include <sfx2/weldutils.hxx>
#include <com/sun/star/frame/XFrame.hpp>
/** Tabbed implementation of NotebookBar for Writer
@@ -27,7 +26,8 @@ class SFX2_DLLPUBLIC WeldedTabbedNotebookbar
public:
WeldedTabbedNotebookbar(VclPtr<vcl::Window>& pContainerWindow, const OUString& rUIFilePath,
- const css::uno::Reference<css::frame::XFrame>& rFrame);
+ const css::uno::Reference<css::frame::XFrame>& rFrame,
+ sal_uInt64 nWindowId);
};
#endif // INCLUDED_SFX2_NOTEBOOKBAR_SFXNOTEBOOKBAR_HXX
diff --git a/include/vcl/jsdialog/jsdialogbuilder.hxx b/include/vcl/jsdialog/jsdialogbuilder.hxx
index 380226e43937..8ca5a3919093 100644
--- a/include/vcl/jsdialog/jsdialogbuilder.hxx
+++ b/include/vcl/jsdialog/jsdialogbuilder.hxx
@@ -21,6 +21,7 @@
#include <vcl/fmtfield.hxx>
class ToolBox;
+class SfxViewShell;
typedef std::map<OString, weld::Widget*> WidgetMap;
@@ -50,19 +51,21 @@ public:
class VCL_DLLPUBLIC JSInstanceBuilder : public SalInstanceBuilder
{
- vcl::LOKWindowId m_nWindowId;
+ sal_uInt64 m_nWindowId;
/// used in case of tab pages where dialog is not a direct top level
VclPtr<vcl::Window> m_aParentDialog;
bool m_bHasTopLevelDialog;
- static std::map<vcl::LOKWindowId, WidgetMap>& GetLOKWeldWidgetsMap();
- static void InsertWindowToMap(int nWindowId);
+ static std::map<sal_uInt64, WidgetMap>& GetLOKWeldWidgetsMap();
+ static void InsertWindowToMap(sal_uInt64 nWindowId);
void RememberWidget(const OString& id, weld::Widget* pWidget);
public:
JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile);
+ /// optional nWindowId is used if getting parent id failed
JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
- const css::uno::Reference<css::frame::XFrame>& rFrame);
+ const css::uno::Reference<css::frame::XFrame>& rFrame,
+ sal_uInt64 nWindowId = 0);
virtual ~JSInstanceBuilder() override;
virtual std::unique_ptr<weld::Dialog> weld_dialog(const OString& id,
bool bTakeOwnership = true) override;
@@ -91,7 +94,7 @@ public:
VclMessageType eMessageType,
VclButtonsType eButtonType,
const OUString& rPrimaryMessage);
- static weld::Widget* FindWeldWidgetsMap(vcl::LOKWindowId nWindowId, const OString& rWidget);
+ static weld::Widget* FindWeldWidgetsMap(sal_uInt64 nWindowId, const OString& rWidget);
};
template <class BaseInstanceClass, class VclClass>