Kaydet (Commit) a1d4c241 authored tarafından Balazs Varga's avatar Balazs Varga Kaydeden (comit) László Németh

tdf#120341 OOXML export: fix export of Pie Chart Wall Borderline

Export LineStyle_NONE instead of default linestyle of PlotArea border,
because LibreOffice make invisible the Wall shape properties in case of
PIE/NET/FILLED_NET charts. Or other solution in the future is set the
default LineStyle of these charts to LineStyle_NONE.

Change-Id: I59e6f18058713f4a0d4c77da8760a319f9c25152
Reviewed-on: https://gerrit.libreoffice.org/61547
Tested-by: Jenkins
Reviewed-by: 's avatarLászló Németh <nemeth@numbertext.org>
üst 5da57ff0
...@@ -57,6 +57,7 @@ public: ...@@ -57,6 +57,7 @@ public:
void testDisplayUnits(); void testDisplayUnits();
// void testFdo74115WallGradientFill(); // void testFdo74115WallGradientFill();
void testFdo74115WallBitmapFill(); void testFdo74115WallBitmapFill();
void testPieChartWallLineStyle();
void testBarChartRotation(); void testBarChartRotation();
void testShapeFollowedByChart(); void testShapeFollowedByChart();
void testPieChartDataLabels(); void testPieChartDataLabels();
...@@ -140,6 +141,7 @@ public: ...@@ -140,6 +141,7 @@ public:
CPPUNIT_TEST(testDisplayUnits); CPPUNIT_TEST(testDisplayUnits);
// CPPUNIT_TEST(testFdo74115WallGradientFill); // CPPUNIT_TEST(testFdo74115WallGradientFill);
CPPUNIT_TEST(testFdo74115WallBitmapFill); CPPUNIT_TEST(testFdo74115WallBitmapFill);
CPPUNIT_TEST(testPieChartWallLineStyle);
CPPUNIT_TEST(testBarChartRotation); CPPUNIT_TEST(testBarChartRotation);
CPPUNIT_TEST(testShapeFollowedByChart); CPPUNIT_TEST(testShapeFollowedByChart);
CPPUNIT_TEST(testPieChartDataLabels); CPPUNIT_TEST(testPieChartDataLabels);
...@@ -712,6 +714,14 @@ void Chart2ExportTest::testFdo74115WallBitmapFill() ...@@ -712,6 +714,14 @@ void Chart2ExportTest::testFdo74115WallBitmapFill()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:blipFill"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:blipFill");
} }
void Chart2ExportTest::testPieChartWallLineStyle()
{
load("/chart2/qa/extras/data/odt/", "testPieChartWallLineStyle.odt");
xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:spPr/a:ln/a:noFill");
}
//The below test case tests the built in marker 'x' for Office 2010 in Line charts //The below test case tests the built in marker 'x' for Office 2010 in Line charts
void Chart2ExportTest::testFdo78290LineChartMarkerX() void Chart2ExportTest::testFdo78290LineChartMarkerX()
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/drawing/BitmapMode.hpp> #include <com/sun/star/drawing/BitmapMode.hpp>
#include <com/sun/star/awt/XBitmap.hpp> #include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
...@@ -1178,6 +1179,16 @@ void ChartExport::exportPlotArea( const Reference< css::chart::XChartDocument >& ...@@ -1178,6 +1179,16 @@ void ChartExport::exportPlotArea( const Reference< css::chart::XChartDocument >&
Reference< beans::XPropertySet > xWallPropSet( xWallFloorSupplier->getWall(), uno::UNO_QUERY ); Reference< beans::XPropertySet > xWallPropSet( xWallFloorSupplier->getWall(), uno::UNO_QUERY );
if( xWallPropSet.is() ) if( xWallPropSet.is() )
{ {
uno::Any aAny = xWallPropSet->getPropertyValue("LineStyle");
sal_Int32 eChartType = getChartType( );
// Export LineStyle_NONE instead of default linestyle of PlotArea border, because LibreOffice
// make invisible the Wall shape properties, in case of these charts. Or in the future set
// the default LineStyle of these charts to LineStyle_NONE.
bool noSupportWallProp = ( (eChartType == chart::TYPEID_PIE) || (eChartType == chart::TYPEID_RADARLINE) || (eChartType == chart::TYPEID_RADARAREA) );
if ( noSupportWallProp && (aAny != drawing::LineStyle_NONE) )
{
xWallPropSet->setPropertyValue( "LineStyle", uno::Any(drawing::LineStyle_NONE) );
}
exportShapeProps( xWallPropSet ); exportShapeProps( xWallPropSet );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment