summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2019-05-12 13:19:56 +0000
committerTomaž Vajngerl <quikee@gmail.com>2019-05-14 03:23:20 +0200
commitea191cf9807d0b0725fbc4831053a26ba71c2328 (patch)
tree024439b27c65e0dd8e324ccebb6c26757186e12a /editeng
parentd14d1341f2b0cd62098425b36438ae20b887fe93 (diff)
tdf#90297 use field colors for math's edit engine
This adds a maTextColor to the EditEngine, which will override the default AutoColor. There is also a NOCOLORS mode and I thought about using it instead, but it defaults to COL_BLACK and overriding this seems wrong. Since the EditEngine does the whole drawing and now has the explicit FieldColor() and FieldTextColor() for background and text, my guess is we don't need an ApplySettings implementation. Change-Id: I6c2ecc843a3e07de98f97c86fc00a3b83cb78d97 Reviewed-on: https://gerrit.libreoffice.org/72197 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editeng.cxx10
-rw-r--r--editeng/source/editeng/impedit.hxx4
-rw-r--r--editeng/source/editeng/impedit2.cxx1
-rw-r--r--editeng/source/editeng/impedit3.cxx4
4 files changed, 18 insertions, 1 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 458f71b34d3f..5faf9eb9f3f3 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -183,6 +183,16 @@ Color const & EditEngine::GetBackgroundColor() const
return pImpEditEngine->GetBackgroundColor();
}
+void EditEngine::SetTextColor( const Color& rColor )
+{
+ pImpEditEngine->SetTextColor( rColor );
+}
+
+Color const & EditEngine::GetTextColor() const
+{
+ return pImpEditEngine->GetTextColor();
+}
+
Color EditEngine::GetAutoColor() const
{
return pImpEditEngine->GetAutoColor();
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 9f0e27909515..987281ef89e4 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -463,6 +463,7 @@ private:
EditSelectionEngine aSelEngine;
Color maBackgroundColor;
+ Color maTextColor;
sal_uInt16 nStretchX;
sal_uInt16 nStretchY;
@@ -678,6 +679,9 @@ private:
void SetBackgroundColor( const Color& rColor ) { maBackgroundColor = rColor; }
const Color& GetBackgroundColor() const { return maBackgroundColor; }
+ void SetTextColor( const Color& rColor ) { maTextColor = rColor; }
+ const Color& GetTextColor() const { return maTextColor; }
+
long CalcVertLineSpacing(Point& rStartPos) const;
Color GetAutoColor() const;
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 6b4b8da61b2e..0d1d3b399f93 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -124,6 +124,7 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) :
eDefLanguage = LANGUAGE_DONTKNOW;
maBackgroundColor = COL_AUTO;
+ maTextColor = COL_AUTO;
nAsianCompressionMode = CharCompressType::NONE;
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index ec3e10cf1290..0cdee12d70ae 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4418,7 +4418,9 @@ Reference < i18n::XExtendedInputSequenceChecker > const & ImpEditEngine::ImplGet
Color ImpEditEngine::GetAutoColor() const
{
- Color aColor = GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
+ Color aColor = GetTextColor();
+ if ( aColor == COL_AUTO )
+ aColor = GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
if ( GetBackgroundColor() != COL_AUTO )
{