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 <hossein@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
@@ -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; ]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2923,11 +2923,6 @@ interface DrawView
|
||||
ExecMethod = FuTemporary ;
|
||||
StateMethod = GetMenuState ;
|
||||
]
|
||||
SID_ADDITIONS_DIALOG
|
||||
[
|
||||
ExecMethod = FuTemporary ;
|
||||
StateMethod = GetMenuState ;
|
||||
]
|
||||
SID_ATTR_GLOW_COLOR
|
||||
[
|
||||
ExecMethod = FuTemporary ;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -346,6 +346,10 @@ shell SfxApplication
|
||||
[
|
||||
ExecMethod = OfaExec_Impl ;
|
||||
]
|
||||
SID_ADDITIONS_DIALOG
|
||||
[
|
||||
ExecMethod = OfaExec_Impl ;
|
||||
]
|
||||
}
|
||||
|
||||
shell SfxModule
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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 ;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user