chart2/source/model/main/ChartModel_Persistence.cxx |    8 --------
 chart2/source/tools/ChartStyle.cxx                  |   19 +++++++++++++++++++
 2 files changed, 19 insertions(+), 8 deletions(-)

New commits:
commit 78f6221057f13eec4a736d12b282a5904a68d883
Author:     Markus Mohrhard <markus.mohrh...@googlemail.com>
AuthorDate: Sat Aug 10 03:18:09 2019 +0800
Commit:     Markus Mohrhard <markus.mohrh...@googlemail.com>
CommitDate: Sat Aug 10 03:18:09 2019 +0800

    move chart wall default formatting to style
    
    Change-Id: Ieddeb087df2c60ffa59c5ebba378f862350377bf

diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx 
b/chart2/source/model/main/ChartModel_Persistence.cxx
index db3b05ea195c..6ab5ebf9135b 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -434,14 +434,6 @@ void ChartModel::insertDefaultChart()
                 //set some new 'defaults' for wall and floor
                 if( xDiagram.is() )
                 {
-                    Reference< beans::XPropertySet > xWall( 
xDiagram->getWall() );
-                    if( xWall.is() )
-                    {
-                        xWall->setPropertyValue( "LineStyle", uno::Any( 
drawing::LineStyle_SOLID ) );
-                        xWall->setPropertyValue( "FillStyle", uno::Any( 
drawing::FillStyle_NONE ) );
-                        xWall->setPropertyValue( "LineColor", uno::Any( 
static_cast< sal_Int32 >( 0xb3b3b3 ) ) ); // gray30
-                        xWall->setPropertyValue( "FillColor", uno::Any( 
static_cast< sal_Int32 >( 0xe6e6e6 ) ) ); // gray10
-                    }
                     Reference< beans::XPropertySet > xFloor( 
xDiagram->getFloor() );
                     if( xFloor.is() )
                     {
diff --git a/chart2/source/tools/ChartStyle.cxx 
b/chart2/source/tools/ChartStyle.cxx
index b383f4316b03..71e94867dc3a 100644
--- a/chart2/source/tools/ChartStyle.cxx
+++ b/chart2/source/tools/ChartStyle.cxx
@@ -142,6 +142,16 @@ void ChartStyle::register_styles()
         *chart::wall::StaticWallInfo::get(), 
*chart::wall::StaticWallInfoHelper::get(),
         *chart::wall::StaticWallDefaults::get());
 
+    css::uno::Reference<css::beans::XPropertySet> xWallStyle
+        = m_xChartStyle[css::chart2::ChartObjectType::WALL];
+
+    xWallStyle->setPropertyValue("LineStyle", 
css::uno::Any(css::drawing::LineStyle_SOLID));
+    xWallStyle->setPropertyValue("FillStyle", 
css::uno::Any(css::drawing::FillStyle_NONE));
+    xWallStyle->setPropertyValue("LineColor",
+                                 
css::uno::Any(static_cast<sal_Int32>(0xb3b3b3))); // gray30
+    xWallStyle->setPropertyValue("FillColor",
+                                 
css::uno::Any(static_cast<sal_Int32>(0xe6e6e6))); // gray10
+
     m_xChartStyle[css::chart2::ChartObjectType::GRID] = new ChartObjectStyle(
         *chart::grid::StaticGridInfo::get(), 
*chart::grid::StaticGridInfoHelper::get(),
         *chart::grid::StaticGridDefaults::get());
@@ -187,6 +197,15 @@ ChartStyle::applyStyleToDiagram(const 
css::uno::Reference<css::chart2::XDiagram>
             m_xChartStyle.find(css::chart2::ChartObjectType::LEGEND)->second,
             css::uno::UNO_QUERY_THROW));
     }
+
+    css::uno::Reference<css::style::XStyleSupplier> 
xWallStyle(xDiagram->getWall(),
+                                                               
css::uno::UNO_QUERY);
+    if (xWallStyle.is())
+    {
+        xWallStyle->setStyle(css::uno::Reference<css::style::XStyle>(
+            m_xChartStyle.find(css::chart2::ChartObjectType::WALL)->second,
+            css::uno::UNO_QUERY_THROW));
+    }
 }
 
 //
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to