summaryrefslogtreecommitdiff
path: root/chart2/qa/extras/chart2import.cxx
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2018-12-14 14:38:49 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-02-08 15:43:09 +0100
commit415dbafb2dcc5b9b897b5febaed66fc9431a6857 (patch)
tree80d267288e2378a3cfaa220d456ff2e45306858b /chart2/qa/extras/chart2import.cxx
parent997a1ae35041dc8eba5ba7c4e7e3552632ea08d4 (diff)
tdf#108021 Chart: Fix text break of column chart X axis
With this patch the text break is allowed for column chart X axis if the text is rotated with 0, 90 or 270 degree. Also recalculate the nLimitedSpaceForText in case of 90 and 270 degree if the X axis label's text break is true. (cherry-picked from commit: f8d6de19181d749d7c2b345ce7084c0c07fa3eab) (cherry-picked from commit: 40ffaa4f23fe59f979222facf1688d25c60651b6) Change-Id: I5d78be6ed83dd195bbc34185d5f6b7e44f555d9b Reviewed-on: https://gerrit.libreoffice.org/66061 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'chart2/qa/extras/chart2import.cxx')
-rw-r--r--chart2/qa/extras/chart2import.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index caf55b448b92..aa46fbae8503 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -69,6 +69,7 @@ public:
void testTdf86624(); // manually placed legends
void testTdf105517();
void testTdf106217();
+ void testTdf108021();
void testAutoBackgroundXLSX();
void testChartAreaStyleBackgroundXLSX();
void testChartHatchFillXLSX();
@@ -148,6 +149,7 @@ public:
CPPUNIT_TEST(testTdf86624);
CPPUNIT_TEST(testTdf105517);
CPPUNIT_TEST(testTdf106217);
+ CPPUNIT_TEST(testTdf108021);
CPPUNIT_TEST(testAutoBackgroundXLSX);
CPPUNIT_TEST(testChartAreaStyleBackgroundXLSX);
CPPUNIT_TEST(testChartHatchFillXLSX);
@@ -847,6 +849,24 @@ void Chart2ImportTest::testTdf106217()
CPPUNIT_ASSERT_EQUAL(sal_Int32(2700), aSize.Height);
}
+void Chart2ImportTest::testTdf108021()
+{
+ // Tdf108021 : To check TextBreak value is true.
+ load("/chart2/qa/extras/data/ods/", "tdf108021.ods");
+ uno::Reference< chart::XDiagram > mxDiagram;
+ uno::Reference< beans::XPropertySet > xAxisProp;
+ bool bTextBreak = false;
+ uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW);
+ 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") >>= bTextBreak;
+ // Expected value of 'TextBreak' is true
+ CPPUNIT_ASSERT(bTextBreak);
+}
+
void Chart2ImportTest::testTransparentBackground(OUString const & filename)
{
load("/chart2/qa/extras/data/xlsx/", filename);