Kaydet (Commit) 2eac095e authored tarafından Balazs Varga's avatar Balazs Varga Kaydeden (comit) László Németh

tdf#122915 Chart OOXML: Export individual data label prop

Export the xLabelPropSet instead of the xPropset and the
individual data label formatting will not be disappeared.

Change-Id: Ic8c64543ad1e8b40d6d6a5cb7a9a244923e028f1
Reviewed-on: https://gerrit.libreoffice.org/66995
Tested-by: Jenkins
Reviewed-by: 's avatarLászló Németh <nemeth@numbertext.org>
Tested-by: 's avatarLászló Németh <nemeth@numbertext.org>
üst a16372db
......@@ -82,6 +82,7 @@ public:
void testDataLabelDoughnutChartDOCX();
void testDataLabelAreaChartDOCX();
void testDataLabelDefaultLineChartDOCX();
void testIndividualDataLabelProps();
void testChartTitlePropertiesColorFillDOCX();
void testChartTitlePropertiesGradientFillDOCX();
void testChartTitlePropertiesBitmapFillDOCX();
......@@ -170,6 +171,7 @@ public:
CPPUNIT_TEST(testDataLabelDoughnutChartDOCX);
CPPUNIT_TEST(testDataLabelAreaChartDOCX);
CPPUNIT_TEST(testDataLabelDefaultLineChartDOCX);
CPPUNIT_TEST(testIndividualDataLabelProps);
CPPUNIT_TEST(testChartTitlePropertiesColorFillDOCX);
CPPUNIT_TEST(testChartTitlePropertiesGradientFillDOCX);
CPPUNIT_TEST(testChartTitlePropertiesBitmapFillDOCX);
......@@ -1094,6 +1096,17 @@ void Chart2ExportTest::testDataLabelDefaultLineChartDOCX()
CPPUNIT_ASSERT_EQUAL_MESSAGE("Line chart's default label placement should be 'right'.", chart::DataLabelPlacement::RIGHT, nLabelPlacement );
}
void Chart2ExportTest::testIndividualDataLabelProps()
{
load("/chart2/qa/extras/data/xlsx/", "tdf122915.xlsx");
xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML");
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr", "b", "1");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr", "sz", "1600");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr", "val", "ff0000");
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser[3]/c:dLbls/c:dLbl/c:txPr/a:p/a:pPr/a:defRPr/a:latin", "typeface", "Times New Roman");
}
void Chart2ExportTest::testChartTitlePropertiesColorFillDOCX()
{
load("/chart2/qa/extras/data/docx/", "testChartTitlePropertiesColorFill.docx");
......@@ -1736,7 +1749,8 @@ void Chart2ExportTest::testCustomDataLabel()
load("/chart2/qa/extras/data/pptx/", "tdf115107.pptx");
xmlDocPtr pXmlDoc = parseExport("ppt/charts/chart1", "Impress MS PowerPoint 2007 XML");
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:dLbl[1]/c:txPr/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr", "val", "404040");
// Check the data labels font color for the complete data series
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr", "val", "404040");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
......
......@@ -3247,7 +3247,7 @@ void ChartExport::exportDataLabels(
}
// Individual label property that overwrites the baseline.
exportTextProps( xPropSet );
exportTextProps( xLabelPropSet );
writeLabelProperties(pFS, this, xLabelPropSet, aParam);
pFS->endElement(FSNS(XML_c, XML_dLbl));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment