desktop/source/lib/init.cxx | 6 ++-- include/vcl/WeldedTabbedNotebookbar.hxx | 10 +++--- include/vcl/jsdialog/builder.hxx | 21 ++++++++++++++ sfx2/Library_sfx.mk | 1 sfx2/source/notebookbar/SfxNotebookBar.cxx | 2 - vcl/Library_vcl.mk | 1 vcl/inc/jsdialog/jsdialogbuilder.hxx | 36 ++++++++++++------------- vcl/jsdialog/jsdialogbuilder.cxx | 11 ++++--- vcl/source/control/WeldedTabbedNotebookbar.cxx | 4 +- vcl/source/window/builder.cxx | 2 - 10 files changed, 59 insertions(+), 35 deletions(-)
New commits: commit 78d7aec108cd9d979ff00d4376ad2f12dd867f05 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Jun 20 16:01:07 2020 +0100 Commit: Szymon Kłos <[email protected]> CommitDate: Fri Jun 26 10:10:14 2020 +0200 most of jsdialogbuilder is not used outside vcl so split it into the bit that is needed and just include that. add missing license headers Change-Id: I875f91176e6881e830fee6a58368d0b28ce9a0f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96774 Tested-by: Jenkins Reviewed-by: Szymon Kłos <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97118 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 9867c88709ab..0434818c7845 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -156,7 +156,7 @@ #include <vcl/abstdlg.hxx> #include <tools/diagnose_ex.h> #include <vcl/uitest/uiobject.hxx> -#include <vcl/jsdialog/jsdialogbuilder.hxx> +#include <vcl/jsdialog/builder.hxx> // Needed for getUndoManager() #include <com/sun/star/document/XUndoManager.hpp> @@ -3603,10 +3603,10 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned long try { OString sControlId = OUStringToOString(aMap["id"], RTL_TEXTENCODING_ASCII_US); - weld::Widget* pWidget = JSInstanceBuilder::FindWeldWidgetsMap(nWindowId, sControlId); + weld::Widget* pWidget = jsdialog::FindWeldWidgetsMap(nWindowId, sControlId); if (!pWidget && nWindowId == 0) { - pWidget = JSInstanceBuilder::FindWeldWidgetsMap(reinterpret_cast<sal_uInt64>(SfxViewShell::Current()), sControlId); + pWidget = jsdialog::FindWeldWidgetsMap(reinterpret_cast<sal_uInt64>(SfxViewShell::Current()), sControlId); } bIsWeldedDialog = pWidget != nullptr; diff --git a/include/sfx2/notebookbar/WeldedTabbedNotebookbar.hxx b/include/vcl/WeldedTabbedNotebookbar.hxx similarity index 79% rename from include/sfx2/notebookbar/WeldedTabbedNotebookbar.hxx rename to include/vcl/WeldedTabbedNotebookbar.hxx index b5ae5dcfb517..82996868cd2b 100644 --- a/include/sfx2/notebookbar/WeldedTabbedNotebookbar.hxx +++ b/include/vcl/WeldedTabbedNotebookbar.hxx @@ -7,17 +7,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef INCLUDED_SFX2_NOTEBOOKBAR_WRITERTABBEDNOTEBOOKBAR_HXX -#define INCLUDED_SFX2_NOTEBOOKBAR_WRITERTABBEDNOTEBOOKBAR_HXX +#ifndef INCLUDED_VCL_WRITERTABBEDNOTEBOOKBAR_HXX +#define INCLUDED_VCL_WRITERTABBEDNOTEBOOKBAR_HXX -#include <sfx2/dllapi.h> +#include <vcl/dllapi.h> #include <rtl/ustring.hxx> #include <vcl/weld.hxx> #include <com/sun/star/frame/XFrame.hpp> /** Tabbed implementation of NotebookBar for Writer */ -class SFX2_DLLPUBLIC WeldedTabbedNotebookbar +class VCL_DLLPUBLIC WeldedTabbedNotebookbar { std::unique_ptr<weld::Builder> m_xBuilder; @@ -30,6 +30,6 @@ public: sal_uInt64 nWindowId); }; -#endif // INCLUDED_SFX2_NOTEBOOKBAR_SFXNOTEBOOKBAR_HXX +#endif // INCLUDED_VCL_SFXNOTEBOOKBAR_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/jsdialog/builder.hxx b/include/vcl/jsdialog/builder.hxx new file mode 100644 index 000000000000..b054b1d00a08 --- /dev/null +++ b/include/vcl/jsdialog/builder.hxx @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include <vcl/dllapi.h> +#include <vcl/IDialogRenderable.hxx> +#include <vcl/weld.hxx> + +namespace jsdialog +{ +VCL_DLLPUBLIC weld::Widget* FindWeldWidgetsMap(sal_uInt64 nWindowId, const OString& rWidget); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index b8b33751581c..cc2386fe5f82 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -243,7 +243,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ sfx2/source/notebookbar/SfxNotebookBar \ sfx2/source/notebookbar/NotebookbarPopup \ sfx2/source/notebookbar/NotebookbarTabControl \ - sfx2/source/notebookbar/WeldedTabbedNotebookbar \ sfx2/source/notify/eventsupplier \ sfx2/source/notify/globalevents \ sfx2/source/notify/hintpost \ diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index 1e33810e552d..a3ef7e7aa2fd 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -34,7 +34,7 @@ #include <framework/addonsoptions.hxx> #include <vcl/NotebookBarAddonsMerger.hxx> #include <vector> -#include <sfx2/notebookbar/WeldedTabbedNotebookbar.hxx> +#include <vcl/WeldedTabbedNotebookbar.hxx> using namespace sfx2; using namespace css::uno; diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 706bb5755d84..c2ef1c606aaa 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -201,6 +201,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/control/listbox \ vcl/source/control/menubtn \ vcl/source/control/notebookbar \ + vcl/source/control/WeldedTabbedNotebookbar \ vcl/source/control/quickselectionengine \ vcl/source/control/prgsbar \ vcl/source/control/roadmap \ diff --git a/include/vcl/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx similarity index 86% rename from include/vcl/jsdialog/jsdialogbuilder.hxx rename to vcl/inc/jsdialog/jsdialogbuilder.hxx index 8ca5a3919093..c67b58d31331 100644 --- a/include/vcl/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -7,9 +7,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef INCLUDED_VCL_INC_JSDIALOG_JSDIALOG_HXX -#define INCLUDED_VCL_INC_JSDIALOG_JSDIALOG_HXX +#pragma once +#include <vcl/jsdialog/builder.hxx> #include <vcl/weld.hxx> #include <comphelper/string.hxx> #include <vcl/sysdata.hxx> @@ -49,13 +49,16 @@ public: void notifyDialogState(); }; -class VCL_DLLPUBLIC JSInstanceBuilder : public SalInstanceBuilder +class JSInstanceBuilder : public SalInstanceBuilder { 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; + friend VCL_DLLPUBLIC weld::Widget* jsdialog::FindWeldWidgetsMap(sal_uInt64 nWindowId, + const OString& rWidget); + static std::map<sal_uInt64, WidgetMap>& GetLOKWeldWidgetsMap(); static void InsertWindowToMap(sal_uInt64 nWindowId); void RememberWidget(const OString& id, weld::Widget* pWidget); @@ -94,11 +97,10 @@ public: VclMessageType eMessageType, VclButtonsType eButtonType, const OUString& rPrimaryMessage); - static weld::Widget* FindWeldWidgetsMap(sal_uInt64 nWindowId, const OString& rWidget); }; template <class BaseInstanceClass, class VclClass> -class VCL_DLLPUBLIC JSWidget : public BaseInstanceClass, public JSDialogSender +class JSWidget : public BaseInstanceClass, public JSDialogSender { public: JSWidget(VclPtr<vcl::Window> aOwnedToplevel, VclClass* pObject, SalInstanceBuilder* pBuilder, @@ -127,7 +129,7 @@ public: } }; -class VCL_DLLPUBLIC JSLabel : public JSWidget<SalInstanceLabel, FixedText> +class JSLabel : public JSWidget<SalInstanceLabel, FixedText> { public: JSLabel(VclPtr<vcl::Window> aOwnedToplevel, FixedText* pLabel, SalInstanceBuilder* pBuilder, @@ -135,14 +137,14 @@ public: virtual void set_label(const OUString& rText) override; }; -class VCL_DLLPUBLIC JSButton : public JSWidget<SalInstanceButton, ::Button> +class JSButton : public JSWidget<SalInstanceButton, ::Button> { public: JSButton(VclPtr<vcl::Window> aOwnedToplevel, ::Button* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership); }; -class VCL_DLLPUBLIC JSEntry : public JSWidget<SalInstanceEntry, ::Edit> +class JSEntry : public JSWidget<SalInstanceEntry, ::Edit> { public: JSEntry(VclPtr<vcl::Window> aOwnedToplevel, ::Edit* pEntry, SalInstanceBuilder* pBuilder, @@ -150,7 +152,7 @@ public: virtual void set_text(const OUString& rText) override; }; -class VCL_DLLPUBLIC JSListBox : public JSWidget<SalInstanceComboBoxWithoutEdit, ::ListBox> +class JSListBox : public JSWidget<SalInstanceComboBoxWithoutEdit, ::ListBox> { public: JSListBox(VclPtr<vcl::Window> aOwnedToplevel, ::ListBox* pListBox, SalInstanceBuilder* pBuilder, @@ -161,7 +163,7 @@ public: virtual void set_active(int pos) override; }; -class VCL_DLLPUBLIC JSComboBox : public JSWidget<SalInstanceComboBoxWithEdit, ::ComboBox> +class JSComboBox : public JSWidget<SalInstanceComboBoxWithEdit, ::ComboBox> { public: JSComboBox(VclPtr<vcl::Window> aOwnedToplevel, ::ComboBox* pComboBox, @@ -173,7 +175,7 @@ public: virtual void set_active(int pos) override; }; -class VCL_DLLPUBLIC JSNotebook : public JSWidget<SalInstanceNotebook, ::TabControl> +class JSNotebook : public JSWidget<SalInstanceNotebook, ::TabControl> { public: JSNotebook(VclPtr<vcl::Window> aOwnedToplevel, ::TabControl* pControl, @@ -188,7 +190,7 @@ public: virtual void append_page(const OString& rIdent, const OUString& rLabel) override; }; -class VCL_DLLPUBLIC JSSpinButton : public JSWidget<SalInstanceSpinButton, ::FormattedField> +class JSSpinButton : public JSWidget<SalInstanceSpinButton, ::FormattedField> { public: JSSpinButton(VclPtr<vcl::Window> aOwnedToplevel, ::FormattedField* pSpin, @@ -197,7 +199,7 @@ public: virtual void set_value(int value) override; }; -class VCL_DLLPUBLIC JSMessageDialog : public SalInstanceMessageDialog, public JSDialogSender +class JSMessageDialog : public SalInstanceMessageDialog, public JSDialogSender { public: JSMessageDialog(::MessageDialog* pDialog, SalInstanceBuilder* pBuilder, bool bTakeOwnership); @@ -207,7 +209,7 @@ public: virtual void set_secondary_text(const OUString& rText) override; }; -class VCL_DLLPUBLIC JSCheckButton : public JSWidget<SalInstanceCheckButton, ::CheckBox> +class JSCheckButton : public JSWidget<SalInstanceCheckButton, ::CheckBox> { public: JSCheckButton(VclPtr<vcl::Window> aOwnedToplevel, ::CheckBox* pCheckBox, @@ -216,7 +218,7 @@ public: virtual void set_active(bool active) override; }; -class VCL_DLLPUBLIC JSDrawingArea : public SalInstanceDrawingArea, public JSDialogSender +class JSDrawingArea : public SalInstanceDrawingArea, public JSDialogSender { public: JSDrawingArea(VclPtr<vcl::Window> aOwnedToplevel, VclDrawingArea* pDrawingArea, @@ -228,7 +230,7 @@ public: virtual void queue_draw_area(int x, int y, int width, int height) override; }; -class VCL_DLLPUBLIC JSToolbar : public JSWidget<SalInstanceToolbar, ::ToolBox> +class JSToolbar : public JSWidget<SalInstanceToolbar, ::ToolBox> { public: JSToolbar(VclPtr<vcl::Window> aOwnedToplevel, ::ToolBox* pToolbox, SalInstanceBuilder* pBuilder, @@ -237,6 +239,4 @@ public: void signal_clicked(const OString& rIdent) override; }; -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 83670466ef31..f4a1b17cf221 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -7,7 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <vcl/jsdialog/jsdialogbuilder.hxx> +#include <jsdialog/jsdialogbuilder.hxx> #include <sal/log.hxx> #include <boost/property_tree/json_parser.hpp> #include <comphelper/lok.hxx> @@ -106,11 +106,13 @@ std::map<sal_uInt64, WidgetMap>& JSInstanceBuilder::GetLOKWeldWidgetsMap() return s_aLOKWeldBuildersMap; } -weld::Widget* JSInstanceBuilder::FindWeldWidgetsMap(sal_uInt64 nWindowId, const OString& rWidget) +namespace jsdialog { - const auto it = GetLOKWeldWidgetsMap().find(nWindowId); +weld::Widget* FindWeldWidgetsMap(sal_uInt64 nWindowId, const OString& rWidget) +{ + const auto it = JSInstanceBuilder::GetLOKWeldWidgetsMap().find(nWindowId); - if (it != GetLOKWeldWidgetsMap().end()) + if (it != JSInstanceBuilder::GetLOKWeldWidgetsMap().end()) { auto widgetIt = it->second.find(rWidget); if (widgetIt != it->second.end()) @@ -119,6 +121,7 @@ weld::Widget* JSInstanceBuilder::FindWeldWidgetsMap(sal_uInt64 nWindowId, const return nullptr; } +} void JSInstanceBuilder::InsertWindowToMap(sal_uInt64 nWindowId) { diff --git a/sfx2/source/notebookbar/WeldedTabbedNotebookbar.cxx b/vcl/source/control/WeldedTabbedNotebookbar.cxx similarity index 90% rename from sfx2/source/notebookbar/WeldedTabbedNotebookbar.cxx rename to vcl/source/control/WeldedTabbedNotebookbar.cxx index baa4e598a554..2ecab57b267e 100644 --- a/sfx2/source/notebookbar/WeldedTabbedNotebookbar.cxx +++ b/vcl/source/control/WeldedTabbedNotebookbar.cxx @@ -7,9 +7,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <sfx2/notebookbar/WeldedTabbedNotebookbar.hxx> +#include <vcl/WeldedTabbedNotebookbar.hxx> #include <vcl/svapp.hxx> -#include <vcl/jsdialog/jsdialogbuilder.hxx> +#include <jsdialog/jsdialogbuilder.hxx> WeldedTabbedNotebookbar::WeldedTabbedNotebookbar( VclPtr<vcl::Window>& pContainerWindow, const OUString& rUIFilePath, diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 3604c2bd2f9b..c543736cb650 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -65,7 +65,7 @@ #include <wizdlg.hxx> #include <tools/svlibrary.h> #include <comphelper/lok.hxx> -#include <vcl/jsdialog/jsdialogbuilder.hxx> +#include <jsdialog/jsdialogbuilder.hxx> #if defined(DISABLE_DYNLOADING) || defined(LINUX) #include <dlfcn.h> _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
