summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@libreoffice.org>2023-09-20 11:28:38 +0300
committerخالد حسني <khaled@libreoffice.org>2023-09-20 12:21:43 +0200
commit6ae1c47fa1033619bf191a0f4228394ff90f5df6 (patch)
tree01af7de888e4dd9ceed25cd9379cd8cc318bb749 /starmath
parent8bf38cc394f96a1f1592a7bbd62e1f7db03f3db6 (diff)
tdf#32418: Add Tools -> Special Character... to Math
Change-Id: I0f4e12f82a3b8e7be2459f4ccfa91f7d30d67f78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157095 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/sdi/smslots.sdi5
-rw-r--r--starmath/source/view.cxx25
-rw-r--r--starmath/uiconfig/smath/menubar/menubar.xml1
3 files changed, 31 insertions, 0 deletions
diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi
index 64586466cea1..2cf17fa342f4 100644
--- a/starmath/sdi/smslots.sdi
+++ b/starmath/sdi/smslots.sdi
@@ -282,6 +282,11 @@ interface FormulaView
ExecMethod = Execute ;
StateMethod = GetState ;
]
+ SID_CHARMAP //idlpp ole : no , status : no
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ ]
SID_ATTR_PARA_LEFT_TO_RIGHT
[
ExecMethod = Execute ;
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index eb7074c2d811..a2f1b53c19b4 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -2107,6 +2107,31 @@ void SmViewShell::Execute(SfxRequest& rReq)
}
break;
+ case SID_CHARMAP:
+ {
+ const SfxItemSet* pArgs = rReq.GetArgs();
+ const SfxStringItem* pItem = nullptr;
+ if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_CHARMAP, true, &pItem))
+ {
+ if (IsInlineEditEnabled())
+ GetDoc()->GetCursor().InsertText(pItem->GetValue());
+ else if (pWin)
+ pWin->InsertText(pItem->GetValue());
+ break;
+ }
+
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ SfxAllItemSet aSet(GetViewFrame().GetObjectShell()->GetPool());
+ aSet.Put(SfxBoolItem(FN_PARAM_1, false));
+ aSet.Put(SfxStringItem(SID_FONT_NAME,
+ GetDoc()->GetFormat().GetFont(FNT_VARIABLE).GetFamilyName()));
+ ScopedVclPtr<SfxAbstractDialog> pDialog(
+ pFact->CreateCharMapDialog(pWin ? pWin->GetFrameWeld() : nullptr, aSet,
+ GetViewFrame().GetFrame().GetFrameInterface()));
+ pDialog->Execute();
+ }
+ break;
+
case SID_ATTR_PARA_LEFT_TO_RIGHT:
case SID_ATTR_PARA_RIGHT_TO_LEFT:
{
diff --git a/starmath/uiconfig/smath/menubar/menubar.xml b/starmath/uiconfig/smath/menubar/menubar.xml
index c3b7865f6449..903ba7189664 100644
--- a/starmath/uiconfig/smath/menubar/menubar.xml
+++ b/starmath/uiconfig/smath/menubar/menubar.xml
@@ -122,6 +122,7 @@
<menu:menu menu:id=".uno:ToolsMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:SymbolCatalogue"/>
+ <menu:menuitem menu:id=".uno:InsertSymbol"/>
<menu:menuitem menu:id=".uno:ImportFormula"/>
<menu:menuitem menu:id=".uno:ImportMathMLClipboard"/>
<menu:menuseparator/>