summaryrefslogtreecommitdiff
path: root/starmath/source
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@libreoffice.org>2023-08-16 16:08:49 +0300
committerخالد حسني <khaled@libreoffice.org>2023-09-04 18:17:45 +0200
commitb6c30b3d35eb01205acf0271d0192921c60eb73b (patch)
tree6c99972c334895d974c6bf0f37763dbbca5314b1 /starmath/source
parentfb43c497f2cc71c988a967fa0126c27561f8c16d (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/source')
-rw-r--r--starmath/source/view.cxx16
1 files changed, 16 insertions, 0 deletions
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;
}
}
}