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

New commits:
commit 0427231a1485d324519e94246ff702bc0cb18b89
Author:     Pranam Lashkari <lpra...@collabora.com>
AuthorDate: Wed Aug 28 01:00:16 2024 +0200
Commit:     Pranam Lashkari <lpra...@collabora.com>
CommitDate: Thu Aug 29 03:00:14 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>
    (cherry picked from commit 2ca381b31e40d516c5d79ce4e59cecbf9683b616)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172495
    Tested-by: Jenkins
    Reviewed-by: Pranam Lashkari <lpra...@collabora.com>

diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 8998f697489d..b5814947b906 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -805,7 +805,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 = std::move(aComplexColor);

Reply via email to