diff options
author | Khaled Hosny <khaled@libreoffice.org> | 2023-08-16 16:08:49 +0300 |
---|---|---|
committer | خالد حسني <khaled@libreoffice.org> | 2023-09-04 18:17:45 +0200 |
commit | b6c30b3d35eb01205acf0271d0192921c60eb73b (patch) | |
tree | 6c99972c334895d974c6bf0f37763dbbca5314b1 /starmath | |
parent | fb43c497f2cc71c988a967fa0126c27561f8c16d (diff) |
tdf#134193: Allow setting math direction
Add LTR/RTL buttons to the toolbar and make them change the
IsRightToLeft property.
Change-Id: I8ae793a9899c50b6dfaf3563a7c22c1f1eab8c8d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155739
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/sdi/smslots.sdi | 10 | ||||
-rw-r--r-- | starmath/source/view.cxx | 16 | ||||
-rw-r--r-- | starmath/uiconfig/smath/toolbar/toolbar.xml | 3 |
3 files changed, 29 insertions, 0 deletions
diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi index 47468ce5f11d..3f998e8b182b 100644 --- a/starmath/sdi/smslots.sdi +++ b/starmath/sdi/smslots.sdi @@ -282,6 +282,16 @@ interface FormulaView ExecMethod = Execute ; StateMethod = GetState ; ] + SID_ATTR_PARA_LEFT_TO_RIGHT + [ + ExecMethod = Execute ; + StateMethod = GetState ; + ] + SID_ATTR_PARA_RIGHT_TO_LEFT + [ + ExecMethod = Execute ; + StateMethod = GetState ; + ] } shell SmViewShell diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index a71438bc82b5..6505031f13ba 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -2067,6 +2067,15 @@ void SmViewShell::Execute(SfxRequest& rReq) aDialog.run(); } break; + + case SID_ATTR_PARA_LEFT_TO_RIGHT: + case SID_ATTR_PARA_RIGHT_TO_LEFT: + { + bool bRTL = rReq.GetSlot() == SID_ATTR_PARA_RIGHT_TO_LEFT; + GetDoc()->SetRightToLeft(bRTL); + GetViewFrame().GetBindings().Invalidate(bRTL ? SID_ATTR_PARA_LEFT_TO_RIGHT : SID_ATTR_PARA_RIGHT_TO_LEFT); + } + break; } rReq.Done(); } @@ -2155,6 +2164,13 @@ void SmViewShell::GetState(SfxItemSet &rSet) rSet.Put(SfxBoolItem(SID_ELEMENTSDOCKINGWINDOW, bState)); } break; + case SID_ATTR_PARA_LEFT_TO_RIGHT: + rSet.Put(SfxBoolItem(nWh, !GetDoc()->GetFormat().IsRightToLeft())); + break; + + case SID_ATTR_PARA_RIGHT_TO_LEFT: + rSet.Put(SfxBoolItem(nWh, GetDoc()->GetFormat().IsRightToLeft())); + break; } } } diff --git a/starmath/uiconfig/smath/toolbar/toolbar.xml b/starmath/uiconfig/smath/toolbar/toolbar.xml index 7501380c4383..2a093f9bb6e0 100644 --- a/starmath/uiconfig/smath/toolbar/toolbar.xml +++ b/starmath/uiconfig/smath/toolbar/toolbar.xml @@ -26,4 +26,7 @@ <toolbar:toolbaritem xlink:href=".uno:Draw"/> <toolbar:toolbaritem xlink:href=".uno:FormelCursor"/> <toolbar:toolbaritem xlink:href=".uno:SymbolCatalogue"/> + <toolbar:toolbarseparator/> + <toolbar:toolbaritem xlink:href=".uno:ParaLeftToRight"/> + <toolbar:toolbaritem xlink:href=".uno:ParaRightToLeft"/> </toolbar:toolbar> |