chart2: Match chart background color with DOCCOLOR in Calc

Chart background color would be hardcoded to white which meant newly inserted charts would have a different background color in Calc (in other components, the background color is later set to transparent)

Change-Id: I6ea55389f195155a96c4c8dcc94a902b2a862178
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159751
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
diff --git a/chart2/source/model/main/PageBackground.cxx b/chart2/source/model/main/PageBackground.cxx
index 592c24d..c866bdb 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>
@@ -48,7 +50,13 @@ const ::chart::tPropertyValueMap& StaticPageBackgroundDefaults()
            ::chart::FillProperties::AddDefaultsToMap( aTmp );

            // override other defaults
            ::chart::PropertyHelper::setPropertyValue< sal_Int32 >( aTmp, ::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( aTmp, ::chart::FillProperties::PROP_FILL_COLOR, aDocColor );
            ::chart::PropertyHelper::setPropertyValue( aTmp, ::chart::LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_NONE );
            return aTmp;
        }();