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 e0c8191d7f30957a50fbfa3b5938cb6f9dacc9bf
Author:     Hossein <hoss...@libreoffice.org>
AuthorDate: Fri Oct 4 11:27:02 2024 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Sat Oct 5 19:49:16 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
    (cherry picked from commit bb0e5aa97965b2710200da677db032289c373afe)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174447
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi
index 7130ff4cabd8..cfdc827b2423 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 0d4bed12a9a7..0ecefa67fe04 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 12f5490c7b99..d3aa0ee2312f 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -3624,28 +3624,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 14f89dbabf63..19591f377a00 100644
--- a/sfx2/sdi/appslots.sdi
+++ b/sfx2/sdi/appslots.sdi
@@ -342,6 +342,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 8d3298b541b4..a397b041bc65 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 a53cbd7ff9e1..a133c0ae4f18 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -1585,6 +1585,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();

Reply via email to