diff options
-rw-r--r-- | desktop/source/lib/init.cxx | 6 | ||||
-rw-r--r-- | include/vcl/jsdialog/builder.hxx | 21 | ||||
-rw-r--r-- | vcl/inc/jsdialog/jsdialogbuilder.hxx (renamed from include/vcl/jsdialog/jsdialogbuilder.hxx) | 26 | ||||
-rw-r--r-- | vcl/jsdialog/jsdialogbuilder.cxx | 12 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 2 |
5 files changed, 44 insertions, 23 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 717e9d6a9d49..4623812f1853 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -148,9 +148,7 @@ #include <vcl/abstdlg.hxx> #include <tools/diagnose_ex.h> #include <vcl/uitest/uiobject.hxx> -#define VCL_INTERNALS 1 -#include <vcl/jsdialog/jsdialogbuilder.hxx> -#undef VCL_INTERNALS +#include <vcl/jsdialog/builder.hxx> // Needed for getUndoManager() #include <com/sun/star/document/XUndoManager.hpp> @@ -3617,7 +3615,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin try { OString sControlId = OUStringToOString(aMap["id"], RTL_TEXTENCODING_ASCII_US); - weld::Widget* pWidget = JSInstanceBuilder::FindWeldWidgetsMap(nWindowId, sControlId); + weld::Widget* pWidget = jsdialog::FindWeldWidgetsMap(nWindowId, sControlId); bIsWeldedDialog = pWidget != nullptr; bool bContinueWithLOKWindow = false; diff --git a/include/vcl/jsdialog/builder.hxx b/include/vcl/jsdialog/builder.hxx new file mode 100644 index 000000000000..ac4c8925cb87 --- /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(vcl::LOKWindowId nWindowId, const OString& rWidget); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/vcl/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 62f6d11a2d7a..5c7f5879af27 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> @@ -46,13 +46,16 @@ public: void notifyDialogState(); }; -class VCL_DLLPUBLIC JSInstanceBuilder : public SalInstanceBuilder +class JSInstanceBuilder : public SalInstanceBuilder { vcl::LOKWindowId 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(vcl::LOKWindowId nWindowId, + const OString& rWidget); + static std::map<vcl::LOKWindowId, WidgetMap>& GetLOKWeldWidgetsMap(); static void InsertWindowToMap(int nWindowId); void RememberWidget(const OString& id, weld::Widget* pWidget); @@ -81,11 +84,10 @@ public: VclMessageType eMessageType, VclButtonsType eButtonType, const OUString& rPrimaryMessage); - static weld::Widget* FindWeldWidgetsMap(vcl::LOKWindowId 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, @@ -114,7 +116,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, @@ -122,14 +124,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, @@ -137,7 +139,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, @@ -148,7 +150,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, @@ -160,7 +162,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, @@ -203,6 +205,4 @@ public: virtual void set_active(bool active) 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 d7f35b7d6039..fa7f25d33c00 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> @@ -88,12 +88,13 @@ std::map<vcl::LOKWindowId, WidgetMap>& JSInstanceBuilder::GetLOKWeldWidgetsMap() return s_aLOKWeldBuildersMap; } -weld::Widget* JSInstanceBuilder::FindWeldWidgetsMap(vcl::LOKWindowId nWindowId, - const OString& rWidget) +namespace jsdialog { - const auto it = GetLOKWeldWidgetsMap().find(nWindowId); +weld::Widget* FindWeldWidgetsMap(vcl::LOKWindowId 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()) @@ -102,6 +103,7 @@ weld::Widget* JSInstanceBuilder::FindWeldWidgetsMap(vcl::LOKWindowId nWindowId, return nullptr; } +} void JSInstanceBuilder::InsertWindowToMap(int nWindowId) { diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index cbb41e48056b..328c8ca024f0 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -68,7 +68,7 @@ #include <tools/diagnose_ex.h> #include <wizdlg.hxx> #include <tools/svlibrary.h> -#include <vcl/jsdialog/jsdialogbuilder.hxx> +#include <jsdialog/jsdialogbuilder.hxx> #if defined(DISABLE_DYNLOADING) || defined(LINUX) #include <dlfcn.h> |