summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2019-02-08 11:24:07 +0100
committerLászló Németh <nemeth@numbertext.org>2019-02-12 10:15:27 +0100
commitde73efb96fbb1d268caea0f41acbe20a234ec59f (patch)
tree7260740f62faaebdc65f1a1fbef7ed2eddd69fe0 /chart2
parente41b09d0126ecb28cff277c9b4b40eae7cc7c3f4 (diff)
tdf#122226 OOXML Chart Import: data label new line separator
Set the data label separator to "new line" if there is not present explicit point separator, just like in MS Office. Change-Id: I9ee0fb9f98fc1bb322892616af50954f4f8db0f9 Reviewed-on: https://gerrit.libreoffice.org/67533 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2import.cxx20
-rwxr-xr-xchart2/qa/extras/data/docx/testTdf122226.docxbin0 -> 19648 bytes
2 files changed, 20 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index f4f87734f27c..0d8eda002a3b 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -105,6 +105,7 @@ public:
void testTdf109858(); // Pie chart label placement settings(XLSX)
void testTdf111173();
+ void testTdf122226();
void testInternalDataProvider();
@@ -180,6 +181,7 @@ public:
CPPUNIT_TEST(testTdf90510);
CPPUNIT_TEST(testTdf109858);
CPPUNIT_TEST(testTdf111173);
+ CPPUNIT_TEST(testTdf122226);
CPPUNIT_TEST(testInternalDataProvider);
@@ -1447,6 +1449,24 @@ void Chart2ImportTest::testTdf111173()
uno::Reference< chart::XChartDocument > xChart1Doc( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW );
}
+void Chart2ImportTest::testTdf122226()
+{
+ load( "/chart2/qa/extras/data/docx/", "testTdf122226.docx" );
+ uno::Reference< chart2::XChartDocument > xChartDoc ( getChartDocFromWriter(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT( xChartDoc.is() );
+
+ css::uno::Reference<chart2::XDiagram> xDiagram(xChartDoc->getFirstDiagram(), UNO_QUERY_THROW);
+ Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
+ uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xPropertySet.is());
+
+ uno::Any aAny = xPropertySet->getPropertyValue( "LabelSeparator" );
+ CPPUNIT_ASSERT( aAny.hasValue() );
+ OUString nLabelSeparator;
+ CPPUNIT_ASSERT( aAny >>= nLabelSeparator );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data labels should be separated into new lines", OUString("\n"), nLabelSeparator );
+}
+
void Chart2ImportTest::testTdf115107()
{
load("/chart2/qa/extras/data/pptx/", "tdf115107.pptx");
diff --git a/chart2/qa/extras/data/docx/testTdf122226.docx b/chart2/qa/extras/data/docx/testTdf122226.docx
new file mode 100755
index 000000000000..7205525a7615
--- /dev/null
+++ b/chart2/qa/extras/data/docx/testTdf122226.docx
Binary files differ