sc/source/core/data/patattr.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 2ca381b31e40d516c5d79ce4e59cecbf9683b616
Author:     Pranam Lashkari <lpra...@collabora.com>
AuthorDate: Wed Aug 28 01:00:16 2024 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Aug 28 13:09:34 2024 +0200

    sc: LOK: automatic text color was based on doc color instead background
    
    problem:
    when document was in light mode but cell had black background,
    automatic font color was black based on the doc color but ideally
    it should have been while based on the background color
    
    partially reverts 8534ad7b7b9aae2520d731cf748ff0aadfe2f0ed for online
    
    Change-Id: I155cc6044dd97e642619b88f24b82fb98a7b393f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172483
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 0f3a8ecb9f62..86b59f5ffc01 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -535,7 +535,17 @@ void ScPatternAttr::fillColor(model::ComplexColor& 
rComplexColor, const SfxItemS
             aSysTextColor = 
SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
         }
 
-        aColor = aSysTextColor;
+        if (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current())
+        {
+            if (aBackColor.IsDark())
+                aColor = COL_WHITE;
+            else
+                aColor = COL_BLACK;
+        }
+        else
+        {
+            aColor = aSysTextColor;
+        }
     }
     aComplexColor.setFinalColor(aColor);
     rComplexColor = aComplexColor;

Reply via email to