svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx    |    3 +++
 svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx |   13 ++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 6381d366672234d899eeff278870cfb1c5d100e9
Author:     Armin Le Grand (collabora) <armin.legr...@collabora.com>
AuthorDate: Mon Jul 21 14:55:19 2025 +0200
Commit:     Armin Le Grand <armin.le.gr...@me.com>
CommitDate: Mon Jul 21 20:34:10 2025 +0200

    tdf#167511 correctly apply Color in HighContrast mode to text III
    
    need to react on change of EditViewActive in SdrTextPrimitive2D
    decomposition, added that. Only do that in HighContrast mode
    to not waste time if not needed.
    
    Change-Id: I7300dfdcf8d51ef4db9ecc67f56c785d45ef44e7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188112
    Reviewed-by: Armin Le Grand <armin.le.gr...@me.com>
    Tested-by: Jenkins

diff --git a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx 
b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
index ddb0a4075d3d..bff0ab884cff 100644
--- a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
+++ b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
@@ -72,6 +72,9 @@ namespace drawinglayer::primitive2d
             bool                                    mbContainsPageCountField : 
1;
             bool                                    mbContainsOtherFields : 1;
 
+            // tdf#167511 also need to react for EditViewActive to correctly 
show HighContrast
+            bool                                    mbEditViewActive : 1;
+
         protected:
             // support for XTEXT_PAINTSHAPE_BEGIN/XTEXT_PAINTSHAPE_END 
Metafile comments
             static Primitive2DReference 
encapsulateWithTextHierarchyBlockPrimitive2D(Primitive2DContainer&& aCandidate);
diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx 
b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
index cc1e850ccb68..a83fe8bbc8bc 100644
--- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
@@ -29,6 +29,7 @@
 #include <svx/svdpage.hxx>
 #include <svx/svdmodel.hxx>
 #include <svx/svdoutl.hxx>
+#include <vcl/svapp.hxx>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <utility>
 #include <osl/diagnose.h>
@@ -103,7 +104,8 @@ namespace drawinglayer::primitive2d
             mnLastPageCount(0),
             mbContainsPageField(false),
             mbContainsPageCountField(false),
-            mbContainsOtherFields(false)
+            mbContainsOtherFields(false),
+            mbEditViewActive(false)
         {
             const EditTextObject& rETO = maOutlinerParaObject.GetTextObject();
 
@@ -196,6 +198,14 @@ namespace drawinglayer::primitive2d
                     }
                 }
 
+                // tdf#167511 check if EditViewActive has changed, but only if 
we are in
+                // HighContrast mode at all
+                if (!bDoDelete && mbEditViewActive != 
rViewInformation.getEditViewActive()
+                    && 
Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+                {
+                    bDoDelete = true;
+                }
+
                 if(bDoDelete)
                 {
                     const_cast< SdrTextPrimitive2D* 
>(this)->setBuffered2DDecomposition(nullptr);
@@ -229,6 +239,7 @@ namespace drawinglayer::primitive2d
                 const_cast< SdrTextPrimitive2D* >(this)->mnLastPageNumber = 
nCurrentlyValidPageNumber;
                 const_cast< SdrTextPrimitive2D* >(this)->mnLastPageCount = 
nCurrentlyValidPageCount;
                 const_cast< SdrTextPrimitive2D* 
>(this)->maLastTextBackgroundColor = aNewTextBackgroundColor;
+                const_cast< SdrTextPrimitive2D* >(this)->mbEditViewActive = 
rViewInformation.getEditViewActive();
             }
 
             // call parent

Reply via email to