summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorParis Oplopoios <paris.oplopoios@collabora.com>2023-06-13 20:36:48 +0300
committerParis Oplopoios <parisoplop@gmail.com>2023-06-14 22:12:21 +0200
commit069c7dc4e9706b40ca12d83d83f90f41cec948f8 (patch)
tree5ce16648328e3093c3e73e5e8761383eb12500a0 /editeng
parentf3f64c77585d0c3c01c0d960f4959e18e9668c30 (diff)
Add editengine view separation in tiled rendering
Editengine now gets the background color from the current view instead from a global variable Change-Id: I98a0fccf4d0c83f4dabf8e534a9228b8a5e271d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152996 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Paris Oplopoios <parisoplop@gmail.com> (cherry picked from commit 7baa475342b67c10537e11da37b8862648679b02) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153073 Tested-by: Jenkins
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit3.cxx24
1 files changed, 20 insertions, 4 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index bcf0c044872f..e18562d3113f 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -52,6 +52,7 @@
#include <svl/asiancfg.hxx>
#include <svx/compatflags.hxx>
+#include <sfx2/viewsh.hxx>
#include <editeng/hngpnctitem.hxx>
#include <editeng/forbiddencharacterstable.hxx>
@@ -67,6 +68,7 @@
#include <i18nlangtag/mslangid.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/lok.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
#include <o3tl/safeint.hxx>
@@ -4686,15 +4688,29 @@ Reference < i18n::XExtendedInputSequenceChecker > const & ImpEditEngine::ImplGet
Color ImpEditEngine::GetAutoColor() const
{
- Color aColor = GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
+ Color aColor;
- if ( GetBackgroundColor() != COL_AUTO )
+ if (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current())
{
- if ( GetBackgroundColor().IsDark() && aColor.IsDark() )
+ // Get document background color from current view instead
+ aColor = SfxViewShell::Current()->GetColorConfigColor(svtools::DOCCOLOR);
+ if (aColor.IsDark())
aColor = COL_WHITE;
- else if ( GetBackgroundColor().IsBright() && aColor.IsBright() )
+ else
aColor = COL_BLACK;
}
+ else
+ {
+ aColor = GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
+
+ if ( GetBackgroundColor() != COL_AUTO )
+ {
+ if ( GetBackgroundColor().IsDark() && aColor.IsDark() )
+ aColor = COL_WHITE;
+ else if ( GetBackgroundColor().IsBright() && aColor.IsBright() )
+ aColor = COL_BLACK;
+ }
+ }
return aColor;
}