cui/Library_cui.mk | 1 - cui/source/customize/SvxMenuConfigPage.cxx | 2 +- cui/source/customize/SvxToolbarConfigPage.cxx | 2 +- cui/source/dialogs/MacroManagerDialog.cxx | 2 +- cui/source/factory/dlgfact.cxx | 2 +- cui/source/options/optaboutconfig.hxx | 2 +- cui/source/options/optjava.cxx | 2 +- cui/source/tabpages/tpcolor.cxx | 10 ++++------ include/svtools/dlgname.hxx | 13 +++++++------ svtools/Library_svt.mk | 1 + svtools/source/dialogs/dlgname.cxx | 3 +-- 11 files changed, 19 insertions(+), 21 deletions(-)
New commits: commit f89f83e64529f0241d5f6e9aea1c6e6f7ebcf706 Author: Michael Weghorn <[email protected]> AuthorDate: Tue Feb 17 16:08:39 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Feb 17 17:42:06 2026 +0100 tdf#158280 Use SvxNameDialog directly in SvxColorTabPage As mentioned in previous commit Change-Id: I26023712b09bcd7c303053e88cce40a3e1cae964 Author: Michael Weghorn <[email protected]> Date: Tue Feb 17 15:43:22 2026 +0100 tdf#158280 Move SvxNameDialog etc. from cui to svtools , SvxNameDialog can now be used directly instead of via the AbstractSvxNameDialog abstraction. Do so in SvxColorTabPage::ClickAddHdl_Impl. Change-Id: I089fbe434088c0a6bce969e9bb8fd1ce3722d154 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199551 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 171a40ae33d6..b9dac3ce716e 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -35,6 +35,7 @@ #include <dialmgr.hxx> #include <cuitabline.hxx> #include <sfx2/AdditionsDialogHelper.hxx> +#include <svtools/dlgname.hxx> #include <svx/dialmgr.hxx> #include <svx/strings.hrc> #include <officecfg/Office/Common.hxx> @@ -333,13 +334,12 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, weld::Button&, void) bValidColorName = (FindInCustomColors(aName) == -1); } - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc)); + SvxNameDialog aNameDialog(GetFrameWeld(), aName, aDesc); sal_uInt16 nError = 1; - while (pDlg->Execute() == RET_OK) + while (aNameDialog.run() == RET_OK) { - aName = pDlg->GetName(); + aName = aNameDialog.GetName(); bValidColorName = (FindInCustomColors(aName) == -1); if (bValidColorName) @@ -354,8 +354,6 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, weld::Button&, void) break; } - pDlg.disposeAndClear(); - if (!nError) { m_xSelectPalette->set_active(0); commit 7c42839f7b4a26d1f239a5f1968b65295f9c4117 Author: Michael Weghorn <[email protected]> AuthorDate: Tue Feb 17 15:43:22 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Feb 17 17:41:58 2026 +0100 tdf#158280 Move SvxNameDialog etc. from cui to svtools tdf#158280 suggests to replace all uses of the sfx2 InputDialog with SvxNameDialog. For uses in sfx2 itself however (e.g. sfx2/source/doc/templatedlg.cxx, see work-in-progress change [1]), this poses the problem that even the existing AbstractSvxNameDialog abstraction is not sufficient to avoid a cyclic dependency because the SvxAbstractDialogFactory required to create an instance is in the svx module, which is still above the sfx2 module in the dependency chain. Move SvxNameDialog and the other common dialogs defined in the same header down into svtools and make the header a global svtools header, so it can be used directly in sfx2 and elsewhere. Existing uses of AbstractSvxNameDialog can be simplified to directly use SvxNameDialog in separate commits. [1] https://gerrit.libreoffice.org/c/core/+/198880 Change-Id: I26023712b09bcd7c303053e88cce40a3e1cae964 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199550 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index 7899e3826cd1..ae03e5ce9422 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -123,7 +123,6 @@ $(eval $(call gb_Library_add_exception_objects,cui,\ cui/source/dialogs/cuigrfflt \ cui/source/dialogs/cuiimapwnd \ cui/source/dialogs/cuitbxform \ - cui/source/dialogs/dlgname \ cui/source/dialogs/DiagramDialog \ cui/source/dialogs/FontFeaturesDialog \ cui/source/dialogs/hangulhanjadlg \ diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx index 78c29ebbb8c3..25173630f79f 100644 --- a/cui/source/customize/SvxMenuConfigPage.cxx +++ b/cui/source/customize/SvxMenuConfigPage.cxx @@ -20,7 +20,7 @@ #include <sal/config.h> #include <sal/log.hxx> -#include <dlgname.hxx> +#include <svtools/dlgname.hxx> #include <vcl/weld/Builder.hxx> #include <vcl/weld/Menu.hxx> #include <vcl/weld/MessageDialog.hxx> diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx index 8102436755be..4b1958d15b4c 100644 --- a/cui/source/customize/SvxToolbarConfigPage.cxx +++ b/cui/source/customize/SvxToolbarConfigPage.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <sal/log.hxx> +#include <svtools/dlgname.hxx> #include <vcl/event.hxx> #include <vcl/weld/Builder.hxx> #include <vcl/weld/Menu.hxx> @@ -40,7 +41,6 @@ #include <SvxConfigPageHelper.hxx> #include <dialmgr.hxx> -#include <dlgname.hxx> #include <comphelper/processfactory.hxx> static OUString GetDefaultToolbar() { return ITEM_TOOLBAR_URL + "standardbar"; } diff --git a/cui/source/dialogs/MacroManagerDialog.cxx b/cui/source/dialogs/MacroManagerDialog.cxx index db985be0d4c8..f210ef54ac68 100644 --- a/cui/source/dialogs/MacroManagerDialog.cxx +++ b/cui/source/dialogs/MacroManagerDialog.cxx @@ -33,6 +33,7 @@ #include <sfx2/sfxsids.hrc> #include <svl/itemset.hxx> #include <svl/stritem.hxx> +#include <svtools/dlgname.hxx> #include <svx/passwd.hxx> #include <unotools/viewoptions.hxx> #include <vcl/commandevent.hxx> @@ -42,7 +43,6 @@ #include <vcl/weld/Dialog.hxx> #include <vcl/weld/MessageDialog.hxx> #include <vcl/weld/Menu.hxx> -#include <dlgname.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/frame/XFrame.hpp> diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index f4be469d9dec..2e5e98190940 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -26,11 +26,11 @@ #include "dlgfact.hxx" #include <about.hxx> -#include <dlgname.hxx> #include <securityoptions.hxx> #include <AdditionsDialog.hxx> #include <sfx2/app.hxx> #include <sfx2/pageids.hxx> +#include <svtools/dlgname.hxx> #include <svx/dialogs.hrc> #include <svx/svxids.hrc> #include <numfmt.hxx> diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx index 614d2fe647ca..bd898f8fff05 100644 --- a/cui/source/options/optaboutconfig.hxx +++ b/cui/source/options/optaboutconfig.hxx @@ -11,8 +11,8 @@ #include <com/sun/star/container/XNameAccess.hpp> -#include <dlgname.hxx> #include <i18nutil/searchopt.hxx> +#include <svtools/dlgname.hxx> #include <vcl/weld/DialogController.hxx> #include <vcl/weld/Entry.hxx> #include <vcl/weld/TreeView.hxx> diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index c84de5c806bb..2ab77d5a814e 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -37,6 +37,7 @@ #include <strings.hrc> #include <vcl/svapp.hxx> +#include <svtools/dlgname.hxx> #include <tools/debug.hxx> #include <tools/urlobj.hxx> #include <vcl/weld/Builder.hxx> @@ -50,7 +51,6 @@ #include <comphelper/diagnose_ex.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> -#include <dlgname.hxx> #include <o3tl/string_view.hxx> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp> diff --git a/cui/inc/dlgname.hxx b/include/svtools/dlgname.hxx similarity index 91% rename from cui/inc/dlgname.hxx rename to include/svtools/dlgname.hxx index df6f41bdaab1..c2bc2c451b8b 100644 --- a/cui/inc/dlgname.hxx +++ b/include/svtools/dlgname.hxx @@ -18,6 +18,7 @@ */ #pragma once +#include <svtools/svtdllapi.h> #include <vcl/formatter.hxx> #include <vcl/weld/DialogController.hxx> #include <vcl/weld/Entry.hxx> @@ -28,7 +29,7 @@ #include <vcl/weld/weld.hxx> /// Dialog for editing a name -class SvxNameDialog final : public weld::GenericDialogController +class SVT_DLLPUBLIC SvxNameDialog final : public weld::GenericDialogController { private: std::unique_ptr<weld::Entry> m_xEdtName; @@ -78,7 +79,7 @@ public: }; /// Dialog for editing a number -class SvxNumberDialog final : public weld::GenericDialogController +class SVT_DLLPUBLIC SvxNumberDialog final : public weld::GenericDialogController { private: std::unique_ptr<weld::SpinButton> m_xEdtNumber; @@ -91,7 +92,7 @@ public: sal_Int64 GetNumber() const { return m_xEdtNumber->get_value(); } }; -class SvxDecimalNumberDialog final : public weld::GenericDialogController +class SVT_DLLPUBLIC SvxDecimalNumberDialog final : public weld::GenericDialogController { private: std::unique_ptr<weld::FormattedSpinButton> m_xEdtNumber; @@ -106,7 +107,7 @@ public: /** #i68101# Dialog for editing Object name plus uniqueness-callback-linkHandler */ -class SvxObjectNameDialog final : public weld::GenericDialogController +class SVT_DLLPUBLIC SvxObjectNameDialog final : public weld::GenericDialogController { private: // name @@ -133,7 +134,7 @@ public: /** #i68101# Dialog for editing Object Title and Description */ -class SvxObjectTitleDescDialog final : public weld::GenericDialogController +class SVT_DLLPUBLIC SvxObjectTitleDescDialog final : public weld::GenericDialogController { private: // title @@ -168,7 +169,7 @@ enum class ListMode }; /** Generic dialog to edit lists */ -class SvxListDialog : public weld::GenericDialogController +class SVT_DLLPUBLIC SvxListDialog : public weld::GenericDialogController { private: ListMode m_aMode; diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index 232cc20dd17d..a23b4f080d99 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -108,6 +108,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\ svtools/source/control/valueacc \ svtools/source/control/valueset \ svtools/source/dialogs/addresstemplate \ + svtools/source/dialogs/dlgname \ svtools/source/dialogs/insdlg \ svtools/source/dialogs/PlaceEditDialog \ svtools/source/dialogs/prnsetup \ diff --git a/cui/source/dialogs/dlgname.cxx b/svtools/source/dialogs/dlgname.cxx similarity index 99% rename from cui/source/dialogs/dlgname.cxx rename to svtools/source/dialogs/dlgname.cxx index ae163b9528ff..02ed7e8f2e80 100644 --- a/cui/source/dialogs/dlgname.cxx +++ b/svtools/source/dialogs/dlgname.cxx @@ -17,9 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <dlgname.hxx> - #include <comphelper/string.hxx> +#include <svtools/dlgname.hxx> #include <vcl/weld/Builder.hxx> #include <vcl/weld/Dialog.hxx>
