sc/sdi/tabvwsh.sdi | 1 - sc/source/ui/view/tabvwshb.cxx | 20 -------------------- sd/sdi/_drvwsh.sdi | 5 ----- sd/source/ui/view/drviews2.cxx | 22 ---------------------- sfx2/sdi/appslots.sdi | 4 ++++ sfx2/sdi/docslots.sdi | 5 ----- sfx2/sdi/sfx.sdi | 1 + sfx2/source/appl/appserv.cxx | 20 ++++++++++++++++++++ sw/sdi/viewsh.sdi | 6 ------ sw/source/uibase/uiview/viewdlg2.cxx | 18 ------------------ 10 files changed, 25 insertions(+), 77 deletions(-)
New commits: commit bb0e5aa97965b2710200da677db032289c373afe Author: Hossein <hoss...@libreoffice.org> AuthorDate: Fri Oct 4 11:27:02 2024 +0200 Commit: Hossein <hoss...@libreoffice.org> CommitDate: Fri Oct 4 13:04:38 2024 +0200 tdf#163291 Fix AdditionsDialog in start center Previously, AdditionsDialog was not working while in start center. Also, there were a lot of code duplicates. This patch fixes these issues. The UNO command .uno:AdditionsDialog was incorrectly implemented as application specific. There were multiple duplicate conditions for checking SID_ADDITIONS_DIALOG in each and every application. Now, this is only done in sfx2/source/appl/appserv.cxx in a single point. The AdditionsDialog can now be opened while in start center in different places of "Tools > Options" for icons, dictionaries, etc. Also, this LibreOffice BASIC code snippet opens it: Sub Main() oDispatch = CreateUnoService("com.sun.star.frame.DispatchHelper") Dim args(0) As New com.sun.star.beans.PropertyValue oDispatch.executeDispatch(StarDesktop.ActiveFrame, ".uno:AdditionsDialog", "", 0, args) End Sub Change-Id: Ifb7e466449008b9bb6e5b678da2e54f58bc101e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174469 Reviewed-by: Hossein <hoss...@libreoffice.org> Tested-by: Jenkins diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi index 48afa923e6fc..af9f3458b0d1 100644 --- a/sc/sdi/tabvwsh.sdi +++ b/sc/sdi/tabvwsh.sdi @@ -62,7 +62,6 @@ interface BaseSelection SID_INSERT_QRCODE [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ] SID_EDIT_QRCODE [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ] - SID_ADDITIONS_DIALOG [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ] SID_IMAP [ ExecMethod = ExecImageMap; StateMethod = GetImageMapState; ] SID_IMAP_EXEC [ ExecMethod = ExecImageMap; StateMethod = GetImageMapState; ] diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index a4204f57e767..0a174df6d84b 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -466,26 +466,6 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) break; } - case SID_ADDITIONS_DIALOG: - { - OUString sAdditionsTag = u""_ustr; - - const SfxStringItem* pStringArg = rReq.GetArg<SfxStringItem>(FN_PARAM_ADDITIONS_TAG); - if (pStringArg) - sAdditionsTag = pStringArg->GetValue(); - - VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create(); - VclPtr<AbstractAdditionsDialog> pDialog( - pFact->CreateAdditionsDialog(pWin->GetFrameWeld(), sAdditionsTag)); - pDialog->StartExecuteAsync( - [pDialog] (sal_Int32 /*nResult*/)->void - { - pDialog->disposeOnce(); - } - ); - break; - } - case SID_OBJECTRESIZE: { // the server would like to change the client size diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index f44bbfec51d7..159b5ffc75e4 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -2923,11 +2923,6 @@ interface DrawView ExecMethod = FuTemporary ; StateMethod = GetMenuState ; ] - SID_ADDITIONS_DIALOG - [ - ExecMethod = FuTemporary ; - StateMethod = GetMenuState ; - ] SID_ATTR_GLOW_COLOR [ ExecMethod = FuTemporary ; diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index ded35227175d..aafee36fa8b4 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -3601,28 +3601,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } break; - case SID_ADDITIONS_DIALOG: - { - OUString sAdditionsTag = u""_ustr; - - const SfxStringItem* pStringArg = rReq.GetArg<SfxStringItem>(FN_PARAM_ADDITIONS_TAG); - if (pStringArg) - sAdditionsTag = pStringArg->GetValue(); - - VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create(); - VclPtr<AbstractAdditionsDialog> pDlg( - pFact->CreateAdditionsDialog(GetFrameWeld(), sAdditionsTag)); - pDlg->StartExecuteAsync( - [pDlg] (sal_Int32 /*nResult*/)->void - { - pDlg->disposeOnce(); - } - ); - Cancel(); - rReq.Ignore (); - } - break; - case SID_ATTR_GLOW_COLOR: case SID_ATTR_GLOW_RADIUS: case SID_ATTR_GLOW_TRANSPARENCY: diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi index 45166d3376f6..9d8063487637 100644 --- a/sfx2/sdi/appslots.sdi +++ b/sfx2/sdi/appslots.sdi @@ -346,6 +346,10 @@ shell SfxApplication [ ExecMethod = OfaExec_Impl ; ] + SID_ADDITIONS_DIALOG + [ + ExecMethod = OfaExec_Impl ; + ] } shell SfxModule diff --git a/sfx2/sdi/docslots.sdi b/sfx2/sdi/docslots.sdi index 444dca508c47..082baef0f5d5 100644 --- a/sfx2/sdi/docslots.sdi +++ b/sfx2/sdi/docslots.sdi @@ -258,11 +258,6 @@ shell SfxObjectShell ExecMethod = ExecFile_Impl ; StateMethod = GetState_Impl ; ] - SID_ADDITIONS_DIALOG - [ - ExecMethod = ExecFile_Impl ; - StateMethod = GetState_Impl ; - ] SID_SIGNATURE [ ExecMethod = ExecFile_Impl; diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 6b45698d563b..eb70d5fe7c38 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -4491,6 +4491,7 @@ SfxVoidItem ClassificationApply SID_CLASSIFICATION_APPLY GroupId = SfxGroupId::Document; ] + SfxWatermarkItem Watermark SID_WATERMARK (SfxStringItem Text SID_WATERMARK, SfxStringItem Font SID_WATERMARK_FONT, SfxInt16Item Angle SID_WATERMARK_ANGLE, SfxInt16Item Transparency SID_WATERMARK_TRANSPARENCY, diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 5d94b1d5786f..4313d834b08c 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1679,6 +1679,26 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) break; } + case SID_ADDITIONS_DIALOG: + { + OUString sAdditionsTag = u""_ustr; + + const SfxStringItem* pStringArg = rReq.GetArg<SfxStringItem>(FN_PARAM_ADDITIONS_TAG); + if (pStringArg) + sAdditionsTag = pStringArg->GetValue(); + + VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create(); + VclPtr<AbstractAdditionsDialog> pDialog( + pFact->CreateAdditionsDialog(rReq.GetFrameWeld(), sAdditionsTag)); + pDialog->StartExecuteAsync( + [pDialog] (sal_Int32 /*nResult*/)->void + { + pDialog->disposeOnce(); + } + ); + break; + } + case SID_MORE_DICTIONARIES: { uno::Sequence<beans::PropertyValue> aArgs{ comphelper::makePropertyValue( diff --git a/sw/sdi/viewsh.sdi b/sw/sdi/viewsh.sdi index 86dd74a62c91..e18efeaebe86 100644 --- a/sw/sdi/viewsh.sdi +++ b/sw/sdi/viewsh.sdi @@ -65,12 +65,6 @@ interface TextEditView : BaseTextEditView StateMethod = GetState ; DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; ] - SID_ADDITIONS_DIALOG // status() - [ - ExecMethod = ExecDlgExt ; - StateMethod = GetState ; - DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; - ] FN_EDIT_FOOTNOTE // status(final|play) [ ExecMethod = ExecDlgExt ; diff --git a/sw/source/uibase/uiview/viewdlg2.cxx b/sw/source/uibase/uiview/viewdlg2.cxx index 61415b7badb4..5eb3340627c6 100644 --- a/sw/source/uibase/uiview/viewdlg2.cxx +++ b/sw/source/uibase/uiview/viewdlg2.cxx @@ -92,25 +92,7 @@ void SwView::ExecDlgExt(SfxRequest& rReq) }); break; } - case SID_ADDITIONS_DIALOG: - { - OUString sAdditionsTag = u""_ustr; - - const SfxStringItem* pStringArg = rReq.GetArg<SfxStringItem>(FN_PARAM_ADDITIONS_TAG); - if (pStringArg) - sAdditionsTag = pStringArg->GetValue(); - VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create(); - VclPtr<AbstractAdditionsDialog> pDialog( - pFact->CreateAdditionsDialog(GetFrameWeld(), sAdditionsTag)); - pDialog->StartExecuteAsync( - [pDialog] (sal_Int32 /*nResult*/)->void - { - pDialog->disposeOnce(); - } - ); - break; - } case SID_SIGN_SIGNATURELINE: { VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();