chart2/source/model/main/PageBackground.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
New commits: commit e8c50822c459504659bf6eb846364ec981e22e14 Author: offtkp <[email protected]> AuthorDate: Mon Nov 20 22:58:20 2023 +0200 Commit: Andras Timar <[email protected]> CommitDate: Tue Nov 21 13:50:50 2023 +0100 chart2: Match chart background color with DOCCOLOR in Calc Change-Id: I6ea55389f195155a96c4c8dcc94a902b2a862178 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159744 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Andras Timar <[email protected]> diff --git a/chart2/source/model/main/PageBackground.cxx b/chart2/source/model/main/PageBackground.cxx index 561b297aba78..776e751b2934 100644 --- a/chart2/source/model/main/PageBackground.cxx +++ b/chart2/source/model/main/PageBackground.cxx @@ -23,6 +23,8 @@ #include <UserDefinedProperties.hxx> #include <PropertyHelper.hxx> #include <ModifyListenerHelper.hxx> +#include <svtools/colorcfg.hxx> +#include <sfx2/viewsh.hxx> #include <com/sun/star/drawing/LineStyle.hpp> #include <cppuhelper/supportsservice.hxx> @@ -54,7 +56,13 @@ private: ::chart::FillProperties::AddDefaultsToMap( rOutMap ); // override other defaults - ::chart::PropertyHelper::setPropertyValue< sal_Int32 >( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR, 0xffffff ); + Color aDocColor = COL_WHITE; + if (SfxViewShell::Current()) { + aDocColor = SfxViewShell::Current()->GetColorConfigColor(svtools::DOCCOLOR); + } else { + SAL_WARN("chart2", "SfxViewShell::Current() returned nullptr"); + } + ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR, aDocColor ); ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_NONE ); } };
