summaryrefslogtreecommitdiff
path: root/sc/source/ui/pagedlg
diff options
context:
space:
mode:
authorHeiko Tietze <tietze.heiko@gmail.com>2022-08-29 15:16:17 +0200
committerCaolán McNamara <caolanm@redhat.com>2022-08-30 14:55:10 +0200
commit9ddbae9c65e795e9122c43eea0b4fa3a4d118939 (patch)
tree1ad2f71846aa43e00f2a71ba079fea890d9fccd7 /sc/source/ui/pagedlg
parentbc8e1c3d3f471823dfd68beb8c7e0974be00f20e (diff)
Resolves tdf#145159 - Use display colors in Header/Footer dialog
Change-Id: Ia19babe3603f653fa631f3d138b43103a553e944 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138998 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/pagedlg')
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index 60a0f53d0ea2..db08e91050a8 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -23,6 +23,7 @@
#include <editeng/editobj.hxx>
#include <editeng/editview.hxx>
#include <editeng/adjustitem.hxx>
+#include <editeng/colritem.hxx>
#include <editeng/fhgtitem.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/sfxdlg.hxx>
@@ -87,6 +88,10 @@ void ScEditWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea)
if (mbRTL)
m_xEditEngine->SetDefaultHorizontalTextDirection(EEHorizontalTextDirection::R2L);
+ Color aBgColor = svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+ rDevice.SetBackground(aBgColor);
+ m_xEditView->SetBackgroundColor(aBgColor);
+
if (auto tmpAcc = mxAcc.get())
{
OUString sName;
@@ -146,6 +151,13 @@ void ScEditWindow::SetFont( const ScPatternAttr& rPattern )
pSet->Put( rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT) );
pSet->Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK) );
pSet->Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL) );
+ // font color used, suitable header/footer background color set in ScEditWindow::SetDrawingArea
+ Color aFgColor = svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR, false).nColor;
+ if (aFgColor == COL_AUTO) {
+ Color aBgColor = svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+ aFgColor = aBgColor.IsDark() ? COL_WHITE : COL_BLACK;
+ }
+ pSet->Put(SvxColorItem(aFgColor, EE_CHAR_COLOR));
if (mbRTL)
pSet->Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) );
GetEditEngine()->SetDefaults( std::move(pSet) );