include/vcl/rendercontext/State.hxx |    2 +-
 starmath/source/document.cxx        |   10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 672378476d214290a10cdaaa03f591bdd4a8ecf5
Author:     Khaled Hosny <kha...@libreoffice.org>
AuthorDate: Mon Feb 26 17:46:42 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 27 12:22:55 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>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164018

diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index ff28f448cbbd..2c5399ba1c99 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)
commit 9393b6fcd08db7cb7776388393bb42d318b8a87b
Author:     Khaled Hosny <kha...@libreoffice.org>
AuthorDate: Sat Feb 24 11:18:04 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 27 12:22:49 2024 +0100

    tdf#159251: Blind fix
    
    Hopefully fixes regression introduced in:
    
    commit 611694b707eb43e4c0f20b781f6869016a3ba099
    Author: Khaled Hosny <kha...@libreoffice.org>
    Date:   Thu Aug 17 17:39:29 2023 +0300
    
        vcl: Allow pushing/popping OutputDevice’s RTLEnabled state
    
    Change-Id: I9236bd6951d83a512390934127031204d94d14bb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163877
    Tested-by: Jenkins
    Reviewed-by: خالد حسني <kha...@libreoffice.org>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164017

diff --git a/include/vcl/rendercontext/State.hxx 
b/include/vcl/rendercontext/State.hxx
index 0359a486e4b2..33970dcccb7f 100644
--- a/include/vcl/rendercontext/State.hxx
+++ b/include/vcl/rendercontext/State.hxx
@@ -67,7 +67,7 @@ template <> struct typed_flags<vcl::PushFlags> : 
is_typed_flags<vcl::PushFlags,
 #define PUSH_ALLFONT                                                           
                    \
     (vcl::PushFlags::TEXTCOLOR | vcl::PushFlags::TEXTFILLCOLOR | 
vcl::PushFlags::TEXTLINECOLOR     \
      | vcl::PushFlags::OVERLINECOLOR | vcl::PushFlags::TEXTALIGN | 
vcl::PushFlags::TEXTLAYOUTMODE  \
-     | vcl::PushFlags::TEXTLANGUAGE | vcl::PushFlags::RTLENABLED | 
vcl::PushFlags::FONT)
+     | vcl::PushFlags::TEXTLANGUAGE | vcl::PushFlags::FONT)
 
 namespace vcl::text
 {

Reply via email to