starmath/source/document.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 17d147952564e5cdfff035ead943b3816e998b96
Author:     Khaled Hosny <kha...@libreoffice.org>
AuthorDate: Mon Feb 26 17:46:42 2024 +0200
Commit:     خالد حسني <kha...@libreoffice.org>
CommitDate: Mon Feb 26 18:38:34 2024 +0100

    tdf#159251: Don’t use vcl::PushFlags::RTLENABLED
    
    I’m going to remove it.
    
    Change-Id: I23af5c67633069b7bb6b15c88bdea757815816ce
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163950
    Tested-by: Jenkins
    Reviewed-by: خالد حسني <kha...@libreoffice.org>

diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index d269f2aeaa1c..6da2c96e4265 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -263,10 +263,10 @@ void SmDocShell::ArrangeFormula()
     const SmFormat &rFormat = GetFormat();
     mpTree->Prepare(rFormat, *this, 0);
 
-    pOutDev->Push(vcl::PushFlags::TEXTLAYOUTMODE | 
vcl::PushFlags::TEXTLANGUAGE |
-                  vcl::PushFlags::RTLENABLED);
+    pOutDev->Push(vcl::PushFlags::TEXTLAYOUTMODE | 
vcl::PushFlags::TEXTLANGUAGE);
 
     // We want the device to always be LTR, we handle RTL formulas ourselves.
+    bool bOldRTL = pOutDev->IsRTLEnabled();
     pOutDev->EnableRTL(false);
 
     // For RTL formulas, we want the brackets to be mirrored.
@@ -279,6 +279,7 @@ void SmDocShell::ArrangeFormula()
 
     mpTree->Arrange(*pOutDev, rFormat);
 
+    pOutDev->EnableRTL(bOldRTL);
     pOutDev->Pop();
 
     SetFormulaArranged(true);
@@ -353,10 +354,10 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point 
&rPosition, bool bDrawSel
         bRestoreDrawMode = true;
     }
 
-    rDev.Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE |
-              vcl::PushFlags::RTLENABLED);
+    rDev.Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE);
 
     // We want the device to always be LTR, we handle RTL formulas ourselves.
+    bool bOldRTL = rDev.IsRTLEnabled();
     if (rDev.GetOutDevType() == OUTDEV_WINDOW)
         rDev.EnableRTL(bRTL);
     else
@@ -385,6 +386,7 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point 
&rPosition, bool bDrawSel
     //Drawing using visitor
     SmDrawingVisitor(rDev, aPosition, mpTree.get(), GetFormat());
 
+    rDev.EnableRTL(bOldRTL);
     rDev.Pop();
 
     if (bRestoreDrawMode)

Reply via email to