diff options
author | Pranam Lashkari <lpranam@collabora.com> | 2024-08-28 01:00:16 +0200 |
---|---|---|
committer | Pranam Lashkari <lpranam@collabora.com> | 2024-08-29 03:00:14 +0200 |
commit | 0427231a1485d324519e94246ff702bc0cb18b89 (patch) | |
tree | 0a562c61316fad3356c2d8c3f1a587d3a95133f2 /sc | |
parent | 33863317e216b1ecd843f5eb584e99998a76305f (diff) |
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 <jenkinscollaboraoffice@gmail.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 2ca381b31e40d516c5d79ce4e59cecbf9683b616)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172495
Tested-by: Jenkins
Reviewed-by: Pranam Lashkari <lpranam@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/patattr.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
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); |