diff options
-rw-r--r-- | desktop/source/lib/init.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/inc/inputwin.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/jsdialog/enabled.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/jsdialog/jsdialogbuilder.hxx | 5 | ||||
-rw-r--r-- | vcl/jsdialog/enabled.cxx | 14 | ||||
-rw-r--r-- | vcl/jsdialog/jsdialogbuilder.cxx | 9 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 8 |
8 files changed, 48 insertions, 10 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index b7312be1772e..f858b9fdd22a 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5206,6 +5206,8 @@ static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pA sWindowId = sCurrentShellId + "notebookbar"; if (nWindowId == static_cast<unsigned long long int>(-3)) sWindowId = sCurrentShellId + "formulabar"; + if (nWindowId == static_cast<unsigned long long int>(-4)) + sWindowId = sCurrentShellId + "addressinputfield"; // dialogs send own id but notebookbar and sidebar controls are remembered by SfxViewShell id if (jsdialog::ExecuteAction(sWindowId, sControlId, aMap)) @@ -5217,6 +5219,8 @@ static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pA return; if (jsdialog::ExecuteAction(sCurrentShellId + "formulabar", sControlId, aMap)) return; + if (jsdialog::ExecuteAction(sCurrentShellId + "addressinputfield", sControlId, aMap)) + return; // this is needed for dialogs shown before document is loaded: MacroWarning dialog, etc... // these dialogs are created with WindowId "0" if (!SfxViewShell::Current() && jsdialog::ExecuteAction(u"0"_ustr, sControlId, aMap)) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index b70a2d21aa90..f9d76b365959 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -144,7 +144,7 @@ SfxChildWinInfo ScInputWindowWrapper::GetInfo() const } -static VclPtr<ScInputBarGroup> lcl_chooseRuntimeImpl( vcl::Window* pParent, const SfxBindings* pBind ) +static ScTabViewShell* lcl_chooseRuntimeImpl( const SfxBindings* pBind ) { ScTabViewShell* pViewSh = nullptr; SfxDispatcher* pDisp = pBind->GetDispatcher(); @@ -154,15 +154,14 @@ static VclPtr<ScInputBarGroup> lcl_chooseRuntimeImpl( vcl::Window* pParent, cons if ( pViewFrm ) pViewSh = dynamic_cast<ScTabViewShell*>( pViewFrm->GetViewShell() ); } - - return VclPtr<ScInputBarGroup>::Create( pParent, pViewSh ); + return pViewSh; } ScInputWindow::ScInputWindow( vcl::Window* pParent, const SfxBindings* pBind ) : // With WB_CLIPCHILDREN otherwise we get flickering ToolBox ( pParent, WinBits(WB_CLIPCHILDREN | WB_BORDER | WB_NOSHADOW) ), - aWndPos ( !comphelper::LibreOfficeKit::isActive() ? VclPtr<ScPosWnd>::Create(this) : nullptr ), - mxTextWindow ( lcl_chooseRuntimeImpl( this, pBind ) ), + aWndPos ( VclPtr<ScPosWnd>::Create( this, lcl_chooseRuntimeImpl(pBind)) ), + mxTextWindow ( VclPtr<ScInputBarGroup>::Create( this, lcl_chooseRuntimeImpl(pBind)) ), pInputHdl ( nullptr ), mpViewShell ( nullptr ), mnMaxY (0), @@ -2253,8 +2252,9 @@ void ScTextWnd::TextGrabFocus() } // Position window -ScPosWnd::ScPosWnd(vcl::Window* pParent) - : InterimItemWindow(pParent, u"modules/scalc/ui/posbox.ui"_ustr, u"PosBox"_ustr) +ScPosWnd::ScPosWnd(vcl::Window* pParent, ScTabViewShell* pViewShell) + : InterimItemWindow(pParent, u"modules/scalc/ui/posbox.ui"_ustr, u"PosBox"_ustr, false, + reinterpret_cast<sal_uInt64>(pViewShell)) , m_xWidget(m_xBuilder->weld_combo_box(u"pos_window"_ustr)) , m_nAsyncGetFocusId(nullptr) , nTipVisible(nullptr) diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx index d98b5a85c56f..832a37356424 100644 --- a/sc/source/ui/inc/inputwin.hxx +++ b/sc/source/ui/inc/inputwin.hxx @@ -172,7 +172,7 @@ private: bool bFormulaMode; public: - ScPosWnd( vcl::Window* pParent ); + ScPosWnd(vcl::Window* pParent, ScTabViewShell* pViewSh); virtual ~ScPosWnd() override; virtual void dispose() override; diff --git a/vcl/inc/jsdialog/enabled.hxx b/vcl/inc/jsdialog/enabled.hxx index 70a867f0acb3..5c85f310f155 100644 --- a/vcl/inc/jsdialog/enabled.hxx +++ b/vcl/inc/jsdialog/enabled.hxx @@ -17,6 +17,8 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile); bool isBuilderEnabledForPopup(std::u16string_view rUIFile); bool isBuilderEnabledForMenu(std::u16string_view rUIFile); bool isBuilderEnabledForSidebar(std::u16string_view rUIFile); +bool isBuilderEnabledForAddressInput(std::u16string_view rUIFile); +bool isBuilderEnabledForFormulabar(std::u16string_view rUIFile); bool isInterimBuilderEnabledForNotebookbar(std::u16string_view rUIFile); } diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index d7fd64388b4b..e4456af57666 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -159,6 +159,11 @@ public: const OUString& rUIFile, sal_uInt64 nLOKWindowId); + static std::unique_ptr<JSInstanceBuilder> CreateAddressInputBuilder(vcl::Window* pParent, + const OUString& rUIRoot, + const OUString& rUIFile, + sal_uInt64 nLOKWindowId); + virtual ~JSInstanceBuilder() override; virtual std::unique_ptr<weld::MessageDialog> weld_message_dialog(const OUString& id) override; virtual std::unique_ptr<weld::Dialog> weld_dialog(const OUString& id) override; diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index cba8047ffd3d..5e25a9977518 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -422,6 +422,20 @@ bool isInterimBuilderEnabledForNotebookbar(std::u16string_view rUIFile) return false; } + +bool isBuilderEnabledForAddressInput(std::u16string_view rUIFile) +{ + if (rUIFile == u"modules/scalc/ui/posbox.ui") + return true; + return false; +} + +bool isBuilderEnabledForFormulabar(std::u16string_view rUIFile) +{ + if (rUIFile == u"modules/scalc/ui/inputbar.ui") + return true; + return false; +} } /* 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 f4c0c60073e1..2d1c614e1d0c 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -356,6 +356,15 @@ JSInstanceBuilder::CreateFormulabarBuilder(vcl::Window* pParent, const OUString& u"formulabar"); } +std::unique_ptr<JSInstanceBuilder> +JSInstanceBuilder::CreateAddressInputBuilder(vcl::Window* pParent, const OUString& rUIRoot, + const OUString& rUIFile, sal_uInt64 nLOKWindowId) +{ + return std::make_unique<JSInstanceBuilder>(nullptr, pParent, rUIRoot, rUIFile, + JSInstanceBuilder::Type::Formulabar, nLOKWindowId, + u"addressinputfield"); +} + JSInstanceBuilder::~JSInstanceBuilder() { // tab page closed -> refresh parent window diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 62469d222d82..ed59785cc791 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -207,8 +207,12 @@ std::unique_ptr<weld::Builder> Application::CreateInterimBuilder(vcl::Window* pP // Notebookbar sub controls if (jsdialog::isInterimBuilderEnabledForNotebookbar(rUIFile)) return JSInstanceBuilder::CreateNotebookbarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, css::uno::Reference<css::frame::XFrame>(), nLOKWindowId); - else if (rUIFile == u"modules/scalc/ui/inputbar.ui") - return JSInstanceBuilder::CreateFormulabarBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, nLOKWindowId); + else if (jsdialog::isBuilderEnabledForFormulabar(rUIFile)) + return JSInstanceBuilder::CreateFormulabarBuilder(pParent, AllSettings::GetUIRootDir(), + rUIFile, nLOKWindowId); + else if (jsdialog::isBuilderEnabledForAddressInput(rUIFile)) + return JSInstanceBuilder::CreateAddressInputBuilder( + pParent, AllSettings::GetUIRootDir(), rUIFile, nLOKWindowId); } return ImplGetSVData()->mpDefInst->CreateInterimBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile, bAllowCycleFocusOut, nLOKWindowId); |