summaryrefslogtreecommitdiff
path: root/chart2/qa
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.co.uk>2017-07-07 16:07:28 +0530
committerTomaž Vajngerl <quikee@gmail.com>2017-07-10 15:39:48 +0200
commitc86be45d343635f2e137b8ea710d87e1a612101d (patch)
tree322906867ff8bd6de635a858e4fe94b688928a33 /chart2/qa
parent18909d45977a897cbd921d76d1dde4bf3a466271 (diff)
tdf#108986 : no arrow for "Data" button on pivot chart
Also changed the fill color of "Data" button to a lighter shade to distiguish it from other buttons, for both row and column fields. Added matching testcase in chart2dump.cxx Change-Id: I2ae5da6c3552372f606da41055f1e0663b6f0802 Reviewed-on: https://gerrit.libreoffice.org/39687 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'chart2/qa')
-rwxr-xr-xchart2/qa/extras/chart2dump/chart2dump.cxx44
-rw-r--r--chart2/qa/extras/chart2dump/data/pivotchart_data_button.odsbin0 -> 18366 bytes
-rw-r--r--chart2/qa/extras/chart2dump/reference/pivotchartdatabuttontest/pivotchart_data_button.txt2
3 files changed, 46 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx b/chart2/qa/extras/chart2dump/chart2dump.cxx
index 989d50819d04..56bf59ecca31 100755
--- a/chart2/qa/extras/chart2dump/chart2dump.cxx
+++ b/chart2/qa/extras/chart2dump/chart2dump.cxx
@@ -1119,6 +1119,50 @@ DECLARE_DUMP_TEST(PointLineChartTest, Chart2DumpTest, false)
}
}
+DECLARE_DUMP_TEST( PivotChartDataButtonTest, Chart2DumpTest, false )
+{
+ const OUString aTestFile = "pivotchart_data_button.ods";
+
+ setTestFileName( aTestFile );
+ load( getTestFileDirName(), getTestFileName() );
+
+ // Check that we have pivot chart in the document
+ uno::Reference<table::XTablePivotCharts> xTablePivotCharts = getTablePivotChartsFromSheet( 1, mxComponent );
+ uno::Reference<container::XIndexAccess> xIndexAccess( xTablePivotCharts, UNO_QUERY_THROW );
+ CPPUNIT_ASSERT_EQUAL( sal_Int32(1), xIndexAccess->getCount() );
+
+ // Get the pivot chart document so we ca access its data
+ uno::Reference<chart2::XChartDocument> xChartDoc;
+ xChartDoc.set( getPivotChartDocFromSheet( xTablePivotCharts, 0 ) );
+ CPPUNIT_ASSERT( xChartDoc.is() );
+
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier( xChartDoc, uno::UNO_QUERY );
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ uno::Reference<drawing::XShapes> xShapes( xDrawPage->getByIndex(0), uno::UNO_QUERY );
+ CPPUNIT_ASSERT( xShapes.is() );
+
+ // Get the shape that represents the "Data" button.
+ uno::Reference<drawing::XShape> xButton = getShapeByName( xShapes, "FieldButton.Row.8",
+ []( const uno::Reference<drawing::XShape>& xShapeNode )
+ {
+ return xShapeNode->getShapeType() == "com.sun.star.drawing.TextShape";
+ } );
+ CPPUNIT_ASSERT_MESSAGE( OString( "Cannot find Data button shape" ).getStr(), xButton.is() );
+
+ // Make sure that there is no arrow shape with the Data button
+ uno::Reference<drawing::XShape> xArrow = getShapeByName( xShapes, "FieldButton.Row.8",
+ []( const uno::Reference<drawing::XShape>& xShapeNode )
+ {
+ return xShapeNode->getShapeType() == "com.sun.star.drawing.PolyPolygonShape";
+ } );
+ CPPUNIT_ASSERT_MESSAGE( OString( "Arrow shape should not be present for the Data button" ).getStr(), !xArrow.is() );
+
+ // Assert the background color of the Data button
+ util::Color aButtonFillColor = 0;
+ uno::Reference<beans::XPropertySet> xPropSet( xButton, UNO_QUERY_THROW );
+ xPropSet->getPropertyValue( UNO_NAME_FILLCOLOR ) >>= aButtonFillColor;
+ CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL( static_cast<sal_Int32>( aButtonFillColor ) );
+}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/chart2dump/data/pivotchart_data_button.ods b/chart2/qa/extras/chart2dump/data/pivotchart_data_button.ods
new file mode 100644
index 000000000000..d57edf66d29b
--- /dev/null
+++ b/chart2/qa/extras/chart2dump/data/pivotchart_data_button.ods
Binary files differ
diff --git a/chart2/qa/extras/chart2dump/reference/pivotchartdatabuttontest/pivotchart_data_button.txt b/chart2/qa/extras/chart2dump/reference/pivotchartdatabuttontest/pivotchart_data_button.txt
new file mode 100644
index 000000000000..3d7d8a55c6cc
--- /dev/null
+++ b/chart2/qa/extras/chart2dump/reference/pivotchartdatabuttontest/pivotchart_data_button.txt
@@ -0,0 +1,2 @@
+// static_cast<sal_Int32>( aButtonFillColor )
+16185078