diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2019-01-04 15:12:38 +0100 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2019-01-07 13:54:55 +0100 |
commit | 015569fc919b702f7a1b0f09038bafa9f104ca70 (patch) | |
tree | 2eb901dd27f288aa6c3c2a961ce6be8f2b0baf09 /chart2/qa/extras | |
parent | 7fc28192864c30ae95b24aceb9cdf7e869dc9dcf (diff) |
tdf#122091 OOXML Import: Automatically break of X Axis labels
Set the TextBreak value automatically true, only if the X axis labels
rotation is 0 degree. The MS Office using a similar method because
there is no any XML tag in the OOXML standard which refer to this setting.
Change-Id: Ie84a95935f0d5c4c1f9a30803e22572141385960
Reviewed-on: https://gerrit.libreoffice.org/65853
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'chart2/qa/extras')
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 21 | ||||
-rwxr-xr-x | chart2/qa/extras/data/xlsx/chart_label_text_break.xlsx | bin | 0 -> 13940 bytes |
2 files changed, 21 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index b8b9a871142a..5d8b43e739a6 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -75,6 +75,7 @@ public: void testChartHatchFillXLSX(); void testAxisTextRotationXLSX(); // void testTextCanOverlapXLSX(); // TODO : temporarily disabled. + void testTextBreakXLSX(); void testNumberFormatsXLSX(); void testTransparentBackground(OUString const & filename); @@ -158,6 +159,7 @@ public: CPPUNIT_TEST(testChartHatchFillXLSX); CPPUNIT_TEST(testAxisTextRotationXLSX); // CPPUNIT_TEST(testTextCanOverlapXLSX); // TODO : temporarily disabled. + CPPUNIT_TEST(testTextBreakXLSX); CPPUNIT_TEST(testNumberFormatsXLSX); CPPUNIT_TEST(testAutoTitleDelDefaultValue2007XLSX); CPPUNIT_TEST(testAutoTitleDelDefaultValue2013XLSX); @@ -1013,6 +1015,25 @@ void Chart2ImportTest::testTextCanOverlapXLSX() } */ +void Chart2ImportTest::testTextBreakXLSX() +{ + // tdf#122091: To check textbreak value is true in case of 0° degree of Axis label rotation. + load("/chart2/qa/extras/data/xlsx/", "chart_label_text_break.xlsx"); + uno::Reference< chart::XDiagram > mxDiagram; + uno::Reference< beans::XPropertySet > xAxisProp; + bool textBreak = false; + uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW); + CPPUNIT_ASSERT(xChartDoc.is()); + mxDiagram.set(xChartDoc->getDiagram()); + CPPUNIT_ASSERT(mxDiagram.is()); + uno::Reference< chart::XAxisXSupplier > xAxisXSupp( mxDiagram, uno::UNO_QUERY ); + CPPUNIT_ASSERT(xAxisXSupp.is()); + xAxisProp = xAxisXSupp->getXAxis(); + xAxisProp->getPropertyValue("TextBreak") >>= textBreak; + // Expected value of 'TextBreak' is true + CPPUNIT_ASSERT(textBreak); +} + void Chart2ImportTest::testNumberFormatsXLSX() { load("/chart2/qa/extras/data/xlsx/", "number-formats.xlsx"); diff --git a/chart2/qa/extras/data/xlsx/chart_label_text_break.xlsx b/chart2/qa/extras/data/xlsx/chart_label_text_break.xlsx Binary files differnew file mode 100755 index 000000000000..81c4958604d5 --- /dev/null +++ b/chart2/qa/extras/data/xlsx/chart_label_text_break.xlsx |