From 6ae1c47fa1033619bf191a0f4228394ff90f5df6 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 20 Sep 2023 11:28:38 +0300 Subject: [PATCH] tdf#32418: Add Tools -> Special Character... to Math MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0f4e12f82a3b8e7be2459f4ccfa91f7d30d67f78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157095 Tested-by: Jenkins Reviewed-by: خالد حسني --- starmath/sdi/smslots.sdi | 5 +++++ starmath/source/view.cxx | 25 +++++++++++++++++++++ starmath/uiconfig/smath/menubar/menubar.xml | 1 + 3 files changed, 31 insertions(+) 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 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 @@ +