summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2018-12-15 10:06:03 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-12-18 22:41:25 +0100
commit6991784d9759ebfe0686f96a242d091799f81012 (patch)
treeeb5160090fca14d631a86c2fad0faae47c8eab77 /chart2
parent0cd4c92b56fb6259f8f3188fd50c315993883d2e (diff)
tdf#122090 Chart: Fix OOXML export of X axis labels rotation
The MS Office UI allows values only in range of [-90,90]. Because of this, we should reflect the angle if the Textrotation is between 90 and 270 degree. Also we have to recalculated the the Textrotation between 270 and 360 degree, because the OOXML counts clockwise. Change-Id: I2fbd53d93ab2e8ea4e26840fd056de20b337daa3 Reviewed-on: https://gerrit.libreoffice.org/65194 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> (cherry picked from commit 527772d8dfcedad56b11b5b13540ec1defa464e5) Reviewed-on: https://gerrit.libreoffice.org/65351 Reviewed-by: Balazs Varga <balazs.varga991@gmail.com> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2export.cxx12
-rwxr-xr-xchart2/qa/extras/data/xlsx/xAxisLabelsRotation.xlsxbin0 -> 13601 bytes
2 files changed, 12 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index b07e98661574..d39a6829bd9f 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -120,6 +120,7 @@ public:
void testChartTitlePropertiesColorFillPPTX();
void testChartTitlePropertiesGradientFillPPTX();
void testChartTitlePropertiesBitmapFillPPTX();
+ void testxAxisLabelsRotation();
void testTdf116163();
void testTdf119029();
@@ -204,6 +205,7 @@ public:
CPPUNIT_TEST(testChartTitlePropertiesColorFillPPTX);
CPPUNIT_TEST(testChartTitlePropertiesGradientFillPPTX);
CPPUNIT_TEST(testChartTitlePropertiesBitmapFillPPTX);
+ CPPUNIT_TEST(testxAxisLabelsRotation);
CPPUNIT_TEST(testTdf116163);
CPPUNIT_TEST(testTdf119029);
CPPUNIT_TEST_SUITE_END();
@@ -1916,6 +1918,16 @@ void Chart2ExportTest::testChartTitlePropertiesBitmapFillPPTX()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:spPr/a:ln/a:noFill", 1);
}
+void Chart2ExportTest::testxAxisLabelsRotation()
+{
+ load ("/chart2/qa/extras/data/xlsx/", "xAxisLabelsRotation.xlsx");
+ xmlDocPtr pXmlDoc1 = parseExport("xl/charts/chart","Calc Office Open XML");
+ CPPUNIT_ASSERT(pXmlDoc1);
+
+ // Chart1 xAxis labels should be 45 degree
+ assertXPath(pXmlDoc1, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:bodyPr", "rot", "2700000");
+}
+
void Chart2ExportTest::testTdf116163()
{
load("/chart2/qa/extras/data/pptx/", "tdf116163.pptx");
diff --git a/chart2/qa/extras/data/xlsx/xAxisLabelsRotation.xlsx b/chart2/qa/extras/data/xlsx/xAxisLabelsRotation.xlsx
new file mode 100755
index 000000000000..cf511dfaf2d7
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/xAxisLabelsRotation.xlsx
Binary files differ