summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2020-08-27 11:21:48 +0200
committerLászló Németh <nemeth@numbertext.org>2020-08-31 09:30:23 +0200
commite2f4e65a7b8024c00b049eebf0d87637efda7f24 (patch)
tree24f2beb652e115e46191c923c4952c82ecff283f /chart2
parent5fca6fefc9cb47737663fbcd04660d2c5bcfde93 (diff)
tdf#134571 chart2, xmloff: add loext:custom-leader-lines
new ODF chart series style attribute for saving not default (switched off) state of data labels in custom positions. Note: import of the embedded chart of the DOCX unit test document uses also ODF format in the background, testing also this loext attribute, i.e. the chart of the unit test document doesn't contain custom leader lines. Change-Id: Ia6b76e8d7fe5b6b6204761f3bbc2309f1b631008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101442 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2export.cxx18
-rw-r--r--chart2/qa/extras/data/docx/MSO_Custom_Leader_Line.docxbin0 -> 25883 bytes
-rw-r--r--chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx7
3 files changed, 21 insertions, 4 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 4be864c69ce4..6384ac17f0bc 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -2374,10 +2374,19 @@ void Chart2ExportTest::testCustomDataLabelMultipleSeries()
void Chart2ExportTest::testLeaderLines()
{
load("/chart2/qa/extras/data/xlsx/", "testTdf90749.xlsx");
- xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
- CPPUNIT_ASSERT(pXmlDoc);
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines", "val", "1");
- assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines", "val", "0");
+ {
+ xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines", "val", "1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines", "val", "0");
+ }
+ load("/chart2/qa/extras/data/docx/", "MSO_Custom_Leader_Line.docx");
+ {
+ xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1", "Office Open XML Text");
+ CPPUNIT_ASSERT(pXmlDoc);
+ // tdf#134571: Check the leader line is switch off.
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:extLst/c:ext/c15:showLeaderLines", "val", "0");
+ }
}
void Chart2ExportTest::testNumberFormatExportPPTX()
@@ -2882,6 +2891,7 @@ void Chart2ExportTest::testTdf123647()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart", 1);
}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/docx/MSO_Custom_Leader_Line.docx b/chart2/qa/extras/data/docx/MSO_Custom_Leader_Line.docx
new file mode 100644
index 000000000000..c158a0d76513
--- /dev/null
+++ b/chart2/qa/extras/data/docx/MSO_Custom_Leader_Line.docx
Binary files differ
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index a6d45dddaa47..6701c1061b01 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -79,6 +79,7 @@ enum
PROP_SERIES_DATAPOINT_LABEL_PLACEMENT,
//other series properties
PROP_SERIES_ATTACHED_AXIS,
+ PROP_SERIES_SHOW_CUSTOM_LEADERLINES,
PROP_SERIES_DATAPOINT_TEXT_ROTATION,
PROP_SERIES_DATAPOINT_LABEL_BORDER_STYLE,
PROP_SERIES_DATAPOINT_LABEL_BORDER_WIDTH,
@@ -211,6 +212,12 @@ void lcl_AddPropertiesToVector_SeriesOnly(
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT );
+
+ rOutProperties.emplace_back( "ShowCustomLeaderLines",
+ PROP_SERIES_SHOW_CUSTOM_LEADERLINES,
+ cppu::UnoType<sal_Bool>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT );
}
uno::Sequence< Property > lcl_GetPropertySequence( DataSeriesPointWrapper::eType _eType )