summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2018-12-15 10:06:03 +0100
committerBartosz Kosiorek <gang65@poczta.onet.pl>2018-12-18 16:53:24 +0100
commit527772d8dfcedad56b11b5b13540ec1defa464e5 (patch)
tree3036cc99827cd8940d92d4ae54be4e0971d9525b /chart2
parent4575cc2bc0c6611294849132ff216995bfc07bf3 (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>
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 7ed7e6afaee9..5bf1e730f93c 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();
void testTdf108022();
@@ -206,6 +207,7 @@ public:
CPPUNIT_TEST(testChartTitlePropertiesColorFillPPTX);
CPPUNIT_TEST(testChartTitlePropertiesGradientFillPPTX);
CPPUNIT_TEST(testChartTitlePropertiesBitmapFillPPTX);
+ CPPUNIT_TEST(testxAxisLabelsRotation);
CPPUNIT_TEST(testTdf116163);
CPPUNIT_TEST(testTdf119029);
CPPUNIT_TEST(testTdf108022);
@@ -1920,6 +1922,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