[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - chart2/qa oox/source
chart2/qa/extras/chart2export.cxx | 14 ++ chart2/qa/extras/data/odp/tdf121189.odp |binary oox/source/export/shapes.cxx|1 + 3 files changed, 15 insertions(+) New commits: commit 9ca974ddb5ba89b09c1c2cfd7efced5895fbead5 Author: Daniel Arato (NISZ) AuthorDate: Mon Aug 24 17:29:08 2020 +0200 Commit: Gabor Kelemen CommitDate: Wed Oct 14 23:21:14 2020 +0200 tdf#121189 PPTX export: fix missing chart Based on Regina Henschel's technical analysis and code pointer. Change-Id: Ifdea48c09d23dce495fa6bc90a9e1648dbb5ccb3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101283 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 0c5ac9d1cb39eac838a612092a8934a6ca12326f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104328 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 268e30d46d19..73f335574513 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -147,6 +147,7 @@ public: void testTdf119029(); void testTdf108022(); void testTdf121744(); +void testTdf121189(); void testTdf122031(); void testTdf115012(); void testTdf134118(); @@ -267,6 +268,7 @@ public: CPPUNIT_TEST(testTdf119029); CPPUNIT_TEST(testTdf108022); CPPUNIT_TEST(testTdf121744); +CPPUNIT_TEST(testTdf121189); CPPUNIT_TEST(testTdf122031); CPPUNIT_TEST(testTdf115012); CPPUNIT_TEST(testTdf134118); @@ -2391,6 +2393,18 @@ void Chart2ExportTest::testTdf121744() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:axId[2]", "val", YValueId ); } +void Chart2ExportTest::testTdf121189() +{ +load("/chart2/qa/extras/data/odp/", "tdf121189.odp"); +reload("Impress Office Open XML"); + +uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); +uno::Reference xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW); +CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xPage->getCount()); +uno::Reference xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW); +CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.OLE2Shape"), xShape->getShapeType()); +} + void Chart2ExportTest::testTdf122031() { //Checks pie chart data label format. diff --git a/chart2/qa/extras/data/odp/tdf121189.odp b/chart2/qa/extras/data/odp/tdf121189.odp new file mode 100644 index ..6f99e0054936 Binary files /dev/null and b/chart2/qa/extras/data/odp/tdf121189.odp differ diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 9f69e316cbec..4aa4522bd596 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1550,6 +1550,7 @@ static const NameToConvertMapType& lcl_GetConverters() { "com.sun.star.presentation.GraphicObjectShape" , ::WriteGraphicObjectShape }, { "com.sun.star.presentation.MediaShape" , ::WriteGraphicObjectShape }, +{ "com.sun.star.presentation.ChartShape" , ::WriteOLE2Shape }, { "com.sun.star.presentation.OLE2Shape", ::WriteOLE2Shape }, { "com.sun.star.presentation.TableShape" , ::WriteTableShape }, { "com.sun.star.presentation.TextShape", ::WriteTextShape }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - chart2/qa oox/source
chart2/qa/extras/chart2export.cxx | 11 +++ chart2/qa/extras/data/xlsx/tdf134118.xlsx |binary oox/source/drawingml/chart/chartspaceconverter.cxx | 11 ++- 3 files changed, 21 insertions(+), 1 deletion(-) New commits: commit f5977a2ac9a000b0fcef546a05f3ed6121906bbd Author: Balazs Varga AuthorDate: Wed Aug 12 08:34:42 2020 +0200 Commit: Gabor Kelemen CommitDate: Wed Oct 14 12:08:32 2020 +0200 tdf#134118 Chart OOXML import: fix gaps in month based data Leave gaps instead of zeroes, like MSO does, if data ranges contain empty cells at month based time resolution. Change-Id: Ie934b56d9d5cb556bcca41e0e4ddce3ea65f7228 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100573 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 886c2e35fadc7813498da041fc4ea8a8ba2fb358) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104288 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 58c2439d16e0..268e30d46d19 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -149,6 +149,7 @@ public: void testTdf121744(); void testTdf122031(); void testTdf115012(); +void testTdf134118(); void testTdf123206_customLabelText(); void testCustomLabelText(); void testTdf131979(); @@ -268,6 +269,7 @@ public: CPPUNIT_TEST(testTdf121744); CPPUNIT_TEST(testTdf122031); CPPUNIT_TEST(testTdf115012); +CPPUNIT_TEST(testTdf134118); CPPUNIT_TEST(testTdf123206_customLabelText); CPPUNIT_TEST(testCustomLabelText); CPPUNIT_TEST(testTdf131979); @@ -2412,6 +2414,15 @@ void Chart2ExportTest::testTdf115012() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", "zero"); } +void Chart2ExportTest::testTdf134118() +{ +load("/chart2/qa/extras/data/xlsx/", "tdf134118.xlsx"); +xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); +CPPUNIT_ASSERT(pXmlDoc); +// workaround: use leave-gap instead of zero to show the original line chart +assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", "gap"); +} + void Chart2ExportTest::testTdf123206_customLabelText() { load("/chart2/qa/extras/data/docx/", "tdf123206.docx"); diff --git a/chart2/qa/extras/data/xlsx/tdf134118.xlsx b/chart2/qa/extras/data/xlsx/tdf134118.xlsx new file mode 100644 index ..ca86fb8cf118 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf134118.xlsx differ diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx index 997aa4d41fbe..c37457e9f0b6 100644 --- a/oox/source/drawingml/chart/chartspaceconverter.cxx +++ b/oox/source/drawingml/chart/chartspaceconverter.cxx @@ -208,7 +208,16 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern { using namespace ::com::sun::star::chart::MissingValueTreatment; sal_Int32 nMissingValues = LEAVE_GAP; -switch( mrModel.mnDispBlanksAs ) + +// tdf#134118 leave gap if the time unit is month +bool bIsMonthBasedTimeUnit = false; +if( mrModel.mxPlotArea.is() && mrModel.mxPlotArea->maAxes.size() > 0 && +mrModel.mxPlotArea->maAxes[0]->monBaseTimeUnit.has() ) +{ +bIsMonthBasedTimeUnit = mrModel.mxPlotArea->maAxes[0]->monBaseTimeUnit.get() == XML_months; +} + +if (!bIsMonthBasedTimeUnit) switch( mrModel.mnDispBlanksAs ) { case XML_gap: nMissingValues = LEAVE_GAP; break; case XML_zero: nMissingValues = USE_ZERO; break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - chart2/qa oox/source
chart2/qa/extras/chart2import.cxx | 19 +++ chart2/qa/extras/data/docx/tdf134111.docx |binary oox/source/drawingml/chart/objectformatter.cxx |2 +- 3 files changed, 20 insertions(+), 1 deletion(-) New commits: commit d2cdc4a090b420b79bb5b7b76b152919d3596b15 Author: Balazs Varga AuthorDate: Fri Jun 19 11:07:04 2020 +0200 Commit: Gabor Kelemen CommitDate: Mon Aug 3 09:24:57 2020 +0200 tdf#134111 Chart OOXML Import: set text break to true of category axis labels, even if the XML do not contain Text Properties of category axis labels. Change-Id: Ia0b154b2dfbfb00ffa0762af771423196586a5ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96683 Tested-by: Jenkins Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 6d1e9482cf1519e5b4d73331a5bcdfbbc9a15776) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99842 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index b60540fb3dda..acfe42423231 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -157,6 +157,7 @@ public: void testTdf123206CustomLabelField(); void testStockChartShiftedCategoryPosition(); void testTdf91250(); +void testTdf134111(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -263,6 +264,7 @@ public: CPPUNIT_TEST(testTdf123206CustomLabelField); CPPUNIT_TEST(testStockChartShiftedCategoryPosition); CPPUNIT_TEST(testTdf91250); +CPPUNIT_TEST(testTdf134111); CPPUNIT_TEST_SUITE_END(); @@ -2466,6 +2468,23 @@ void Chart2ImportTest::testTdf91250() CPPUNIT_ASSERT_EQUAL(OUString("8.657"), aCategories[3]); } +void Chart2ImportTest::testTdf134111() +{ +// tdf134111 : To check TextBreak value is true +load("/chart2/qa/extras/data/docx/", "tdf134111.docx"); +uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromWriter(0); +CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); +uno::Reference< chart::XDiagram > mxDiagram(xChartDoc->getDiagram()); +CPPUNIT_ASSERT(mxDiagram.is()); +uno::Reference< chart::XAxisXSupplier > xAxisXSupp(mxDiagram, uno::UNO_QUERY); +CPPUNIT_ASSERT(xAxisXSupp.is()); +uno::Reference< beans::XPropertySet > xAxisProp(xAxisXSupp->getXAxis()); +bool bTextBreak = false; +xAxisProp->getPropertyValue("TextBreak") >>= bTextBreak; +// Expected value of 'TextBreak' is true +CPPUNIT_ASSERT(bTextBreak); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/docx/tdf134111.docx b/chart2/qa/extras/data/docx/tdf134111.docx new file mode 100644 index ..26e3a03e0b6d Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf134111.docx differ diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index 35663e4ef8b9..a12a8b94b12e 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -1151,7 +1151,7 @@ bool ObjectFormatter::getTextRotation( const ModelRef< TextBody >& rxTextProp, s } else { -return false; +return true; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - chart2/qa oox/source
chart2/qa/extras/chart2export.cxx | 22 ++ chart2/qa/extras/data/docx/tdf134255.docx |binary oox/source/drawingml/chart/objectformatter.cxx |4 3 files changed, 26 insertions(+) New commits: commit 83b929e3ed9d5b413f074a122480e01373cf99f1 Author: Balazs Varga AuthorDate: Tue Jul 7 13:11:19 2020 +0200 Commit: Gabor Kelemen CommitDate: Fri Jul 31 13:09:10 2020 +0200 tdf#134255 Chart OOXML Import: set the auto text wrap property to true, if we do not have text property attribute. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98252 Tested-by: Jenkins Reviewed-by: László Németh (cherry picked from commit c777cb492d12fb7038254f116102716b9cb84fa3) Change-Id: I1a416f74c3f034f902fd583790f9db307f5e8881 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99836 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 035b35456eba..58c2439d16e0 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -155,6 +155,7 @@ public: void testTdf126076(); void testTdf132076(); void testTdf132594(); +void testTdf134255(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(testErrorBarXLSX); @@ -273,6 +274,7 @@ public: CPPUNIT_TEST(testTdf126076); CPPUNIT_TEST(testTdf132076); CPPUNIT_TEST(testTdf132594); +CPPUNIT_TEST(testTdf134255); CPPUNIT_TEST_SUITE_END(); @@ -2512,6 +2514,26 @@ void Chart2ExportTest::testTdf132594() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:cat", 1); } +void Chart2ExportTest::testTdf134255() +{ +load("/chart2/qa/extras/data/docx/", "tdf134255.docx"); +Reference xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); +CPPUNIT_ASSERT(xChartDoc.is()); + +// import test +Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); +CPPUNIT_ASSERT(xDataSeries.is()); +Reference< beans::XPropertySet > xPropSet(xDataSeries, UNO_QUERY_THROW); +bool bWrap = false; +CPPUNIT_ASSERT((xPropSet->getPropertyValue("TextWordWrap") >>= bWrap) && bWrap); + +// export test +xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); +CPPUNIT_ASSERT(pXmlDoc); + +assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:txPr/a:bodyPr", "wrap", "square"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/docx/tdf134255.docx b/chart2/qa/extras/data/docx/tdf134255.docx new file mode 100644 index ..ff3cd8b67b53 Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf134255.docx differ diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index ed52ccf5c2b1..35663e4ef8b9 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -1086,6 +1086,10 @@ void ObjectFormatter::convertTextWrap( PropertySet& rPropSet, const ModelRef< Te } } } +else +{// set default value (in OOXML the default value is true) +rPropSet.setProperty( PROP_TextWordWrap, true ); +} } void ObjectFormatter::convertNumberFormat( PropertySet& rPropSet, const NumberFormat& rNumberFormat, bool bAxis, bool bShowPercent ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - chart2/qa oox/source
chart2/qa/extras/chart2import.cxx| 22 ++ chart2/qa/extras/data/docx/tdf91250.docx |binary oox/source/drawingml/chart/datasourcecontext.cxx |3 +++ 3 files changed, 25 insertions(+) New commits: commit 8a6985e301e5f4a98ef5306739529efdcdf13049 Author: Balazs Varga AuthorDate: Mon Jun 8 14:26:33 2020 +0200 Commit: Gabor Kelemen CommitDate: Sun Jul 26 20:31:09 2020 +0200 tdf#91250 Chart DOCX Import: Fix decimal place formatting issue Use UNLIMITED_PRECISION in case of GENERAL number format of CATEGORY axis labels in embedded charts, just like Calc does. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95802 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit f2a7f1bb080d882fd23b63a4f7a4833d6691b6e7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95985 Tested-by: Jenkins Reviewed-by: Xisco Fauli (cherry picked from commit 8cde18843c155531c3a735e1e825f54aa671a47e) Change-Id: I30cb50955c67824bd1aa88fb139618ce0f0974fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99397 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index d81a1cacd3d1..b60540fb3dda 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -156,6 +156,7 @@ public: void testTdf125444PercentageCustomLabel(); void testTdf123206CustomLabelField(); void testStockChartShiftedCategoryPosition(); +void testTdf91250(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -261,6 +262,7 @@ public: CPPUNIT_TEST(testTdf125444PercentageCustomLabel); CPPUNIT_TEST(testTdf123206CustomLabelField); CPPUNIT_TEST(testStockChartShiftedCategoryPosition); +CPPUNIT_TEST(testTdf91250); CPPUNIT_TEST_SUITE_END(); @@ -2444,6 +2446,26 @@ void Chart2ImportTest::testStockChartShiftedCategoryPosition() CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition); } +void Chart2ImportTest::testTdf91250() +{ +load("/chart2/qa/extras/data/docx/", "tdf91250.docx"); +uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); +CPPUNIT_ASSERT(xChartDoc.is()); +Reference xInternalProvider(xChartDoc->getDataProvider(), uno::UNO_QUERY); +CPPUNIT_ASSERT(xInternalProvider.is()); + +Reference xDescAccess(xInternalProvider, uno::UNO_QUERY); +CPPUNIT_ASSERT(xDescAccess.is()); + +// Get the category labels. +Sequence aCategories = xDescAccess->getRowDescriptions(); +CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aCategories.getLength()); +CPPUNIT_ASSERT_EQUAL(OUString("12.3254"), aCategories[0]); +CPPUNIT_ASSERT_EQUAL(OUString("11.62315"), aCategories[1]); +CPPUNIT_ASSERT_EQUAL(OUString("9.26"), aCategories[2]); +CPPUNIT_ASSERT_EQUAL(OUString("8.657"), aCategories[3]); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/docx/tdf91250.docx b/chart2/qa/extras/data/docx/tdf91250.docx new file mode 100644 index ..4cb199b45795 Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf91250.docx differ diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx b/oox/source/drawingml/chart/datasourcecontext.cxx index 7fa7b12852a7..63a2762feeb6 100644 --- a/oox/source/drawingml/chart/datasourcecontext.cxx +++ b/oox/source/drawingml/chart/datasourcecontext.cxx @@ -130,6 +130,9 @@ void DoubleSequenceContext::onCharacters( const OUString& rChars ) double fValue = rChars.toDouble(); ::Color* pColor = nullptr; OUString aFormattedValue; +// tdf#91250: use UNLIMITED_PRECISION in case of GENERAL Number Format of category axis labels +if( pNumFrmt->GetStandardPrec() != SvNumberFormatter::UNLIMITED_PRECISION ) + pNumFrmt->ChangeStandardPrec(SvNumberFormatter::UNLIMITED_PRECISION); pNumFrmt->GetOutputString( fValue, nKey, aFormattedValue, ); mrModel.maData[ mnPtIndex ] <<= aFormattedValue; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - chart2/qa oox/source
chart2/qa/extras/chart2import.cxx | 22 ++ chart2/qa/extras/data/docx/tdf133632.docx |binary oox/source/drawingml/chart/seriesconverter.cxx |2 +- 3 files changed, 23 insertions(+), 1 deletion(-) New commits: commit 70b4f0358a9c67b851d8c68b26f2cdc8750c0b92 Author: Balazs Varga AuthorDate: Thu Jun 4 11:33:06 2020 +0200 Commit: Gabor Kelemen CommitDate: Sun Jul 26 12:30:38 2020 +0200 tdf#133632 Chart DOCX Import: fix percentage number format Set the LinkNumberFormatToSource to false only if we have an inner data table and the labels are shown as values. Regression from commit: e0da00d655ecca5986eea3812a8a670c6adbc40f (tdf#132174 Chart DOCX import: fix label number format) Change-Id: I879c5d81709995bfa49c18e0c84aaf6dc3dea41c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95493 Tested-by: Jenkins Reviewed-by: László Németh (cherry picked from commit 53eeb419836f31bc4e16a2276a7ef875bea4ff97) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95984 Reviewed-by: Xisco Fauli (cherry picked from commit 8da86149f3b7a04fb3a442e6f8733ba463945a57) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99304 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index a2b77a851002..d81a1cacd3d1 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -89,6 +89,7 @@ public: void testTextBreakXLSX(); void testNumberFormatsXLSX(); void testNumberFormatsDOCX(); +void testPercentageNumberFormatsDOCX(); void testTransparentBackground(OUString const & filename); @@ -202,6 +203,7 @@ public: CPPUNIT_TEST(testTextBreakXLSX); CPPUNIT_TEST(testNumberFormatsXLSX); CPPUNIT_TEST(testNumberFormatsDOCX); +CPPUNIT_TEST(testPercentageNumberFormatsDOCX); CPPUNIT_TEST(testAutoTitleDelDefaultValue2007XLSX); CPPUNIT_TEST(testAutoTitleDelDefaultValue2013XLSX); CPPUNIT_TEST(testDispBlanksAsDefaultValue2007XLSX); @@ -1291,6 +1293,26 @@ void Chart2ImportTest::testNumberFormatsDOCX() CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to false.", !bLinkNumberFormatToSource); } +void Chart2ImportTest::testPercentageNumberFormatsDOCX() +{ +load("/chart2/qa/extras/data/docx/", "tdf133632.docx"); +uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY); +CPPUNIT_ASSERT(xChartDoc.is()); + +css::uno::Reference xDiagram(xChartDoc->getFirstDiagram(), UNO_SET_THROW); +Reference xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); +uno::Reference xPropertySet(xDataSeries, uno::UNO_QUERY_THROW); +CPPUNIT_ASSERT(xPropertySet.is()); + +bool bLinkNumberFormatToSource = false; +chart2::DataPointLabel aLabel; +xPropertySet->getPropertyValue("Label") >>= aLabel; +CPPUNIT_ASSERT_EQUAL(sal_False, aLabel.ShowNumber); +CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent); +bool bSuccess = xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource; +CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess && bLinkNumberFormatToSource); +} + void Chart2ImportTest::testAutoTitleDelDefaultValue2007XLSX() { load("/chart2/qa/extras/data/xlsx/", "autotitledel_2007.xlsx"); diff --git a/chart2/qa/extras/data/docx/tdf133632.docx b/chart2/qa/extras/data/docx/tdf133632.docx new file mode 100644 index ..b970e73f4c2f Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf133632.docx differ diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 02479b80ec46..2acf265847dc 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -373,7 +373,7 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa { bool bMSO2007Doc = getFilter().isMSO2007Document(); // tdf#132174: the inner data table has no own cell number format. -if( getChartDocument()->hasInternalDataProvider() ) +if( getChartDocument()->hasInternalDataProvider() && mrModel.mobShowVal.get(!bMSO2007Doc) ) mrModel.maNumberFormat.mbSourceLinked = false; lclConvertLabelFormatting( aPropSet, getFormatter(), mrModel, rTypeGroup, true, bMSO2007Doc ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - chart2/qa oox/source
chart2/qa/extras/chart2export.cxx | 11 +++ chart2/qa/extras/data/xlsx/chart_pie2007.xlsx |binary oox/source/drawingml/chart/typegroupmodel.cxx |2 +- 3 files changed, 12 insertions(+), 1 deletion(-) New commits: commit ebbb5f9626e95a1b56a588161a7383561f1a160a Author: Tünde Tóth AuthorDate: Tue May 26 13:34:32 2020 +0200 Commit: Gabor Kelemen CommitDate: Thu Jul 16 23:06:05 2020 +0200 tdf#132594 Chart XLSX import: fix legend entries in pie charts Legend entry text of pie chart wasn't imported correctly in XLSX documents created with Excel 2007. Regression from commit: e0b0502516a10181bbd1737b93b38b2bba4c98e8 (tdf#128016 Chart OOXML Import: fix duplicated category labels) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94864 Tested-by: Jenkins Tested-by: László Németh Reviewed-by: László Németh Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95294 (cherry picked from commit 59a896d80feee9f4c25b931c77aee281da189868) Change-Id: I4567437a41fe66e124dccbd148c0c49196d5c007 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98848 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index f1666188a00c..035b35456eba 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -154,6 +154,7 @@ public: void testTdf131979(); void testTdf126076(); void testTdf132076(); +void testTdf132594(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(testErrorBarXLSX); @@ -271,6 +272,7 @@ public: CPPUNIT_TEST(testTdf131979); CPPUNIT_TEST(testTdf126076); CPPUNIT_TEST(testTdf132076); +CPPUNIT_TEST(testTdf132594); CPPUNIT_TEST_SUITE_END(); @@ -2501,6 +2503,15 @@ void Chart2ExportTest::testTdf132076() } } +void Chart2ExportTest::testTdf132594() +{ +load("/chart2/qa/extras/data/xlsx/", "chart_pie2007.xlsx"); +xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); +CPPUNIT_ASSERT(pXmlDoc); + +assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:cat", 1); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx b/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx new file mode 100644 index ..b122680257c0 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart_pie2007.xlsx differ diff --git a/oox/source/drawingml/chart/typegroupmodel.cxx b/oox/source/drawingml/chart/typegroupmodel.cxx index aae01ed0f58e..7353bafbecc7 100644 --- a/oox/source/drawingml/chart/typegroupmodel.cxx +++ b/oox/source/drawingml/chart/typegroupmodel.cxx @@ -57,7 +57,7 @@ TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc ) : mbSmooth( !bMSO2007Doc ), mbVaryColors( !bMSO2007Doc ), mbWireframe( !bMSO2007Doc ), -mbCatAxisVisible( !bMSO2007Doc ) +mbCatAxisVisible( true ) { } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - chart2/qa oox/source
chart2/qa/extras/chart2export.cxx| 20 chart2/qa/extras/data/ods/tdf132076.ods |binary chart2/qa/extras/data/xlsx/tdf132076.xlsx|binary oox/source/drawingml/chart/axisconverter.cxx | 11 ++-- oox/source/export/chartexport.cxx| 62 --- 5 files changed, 82 insertions(+), 11 deletions(-) New commits: commit 7cd9fece534dd73be92a1acdcdf89ed17f3cbb8e Author: Balazs Varga AuthorDate: Thu Apr 16 22:08:15 2020 +0200 Commit: Balazs Varga CommitDate: Thu Jul 16 08:23:42 2020 +0200 tdf#132076 Chart OOXML: fix lost date format of X axis labels. Set the number format of category or date axes too and use date axis type for date axes at import. Export the real axis type of the X axis. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92396 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 75156c6fd73dc202df541306e1636727d51d6fc3) Change-Id: I45f5c69f0aadc4ec1db0b8873b5e374e2728d39c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98833 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 6c693be3cce5..f1666188a00c 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -153,6 +153,7 @@ public: void testCustomLabelText(); void testTdf131979(); void testTdf126076(); +void testTdf132076(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(testErrorBarXLSX); @@ -269,6 +270,7 @@ public: CPPUNIT_TEST(testCustomLabelText); CPPUNIT_TEST(testTdf131979); CPPUNIT_TEST(testTdf126076); +CPPUNIT_TEST(testTdf132076); CPPUNIT_TEST_SUITE_END(); @@ -2481,6 +2483,24 @@ void Chart2ExportTest::testTdf126076() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:marker", 0); } +void Chart2ExportTest::testTdf132076() +{ +{ +load("/chart2/qa/extras/data/ods/", "tdf132076.ods"); +xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); +CPPUNIT_ASSERT(pXmlDoc); +assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:numFmt", "formatCode", "dd"); +assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:numFmt", "sourceLinked", "0"); +} +{ +load("/chart2/qa/extras/data/xlsx/", "tdf132076.xlsx"); +xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); +CPPUNIT_ASSERT(pXmlDoc); +assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:numFmt", "formatCode", "dd"); +assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:numFmt", "sourceLinked", "0"); +} +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/ods/tdf132076.ods b/chart2/qa/extras/data/ods/tdf132076.ods new file mode 100644 index ..348dd0d71f25 Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf132076.ods differ diff --git a/chart2/qa/extras/data/xlsx/tdf132076.xlsx b/chart2/qa/extras/data/xlsx/tdf132076.xlsx new file mode 100644 index ..799ef9c8555a Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf132076.xlsx differ diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx index 86764b241e52..9c2b4fa9e993 100644 --- a/oox/source/drawingml/chart/axisconverter.cxx +++ b/oox/source/drawingml/chart/axisconverter.cxx @@ -207,10 +207,8 @@ void AxisConverter::convertFromModel( OSL_ENSURE( (mrModel.mnTypeId == C_TOKEN( catAx )) || (mrModel.mnTypeId == C_TOKEN( dateAx )), "AxisConverter::convertFromModel - unexpected axis model type (must: c:catAx or c:dateAx)" ); bool bDateAxis = mrModel.mnTypeId == C_TOKEN( dateAx ); -/* Chart2 requires axis type CATEGORY for automatic -category/date axis (even if it is a date axis -currently). */ -aScaleData.AxisType = (bDateAxis && !mrModel.mbAuto) ? cssc2::AxisType::DATE : cssc2::AxisType::CATEGORY; +// tdf#132076: set axis type to date, if it is a date axis! +aScaleData.AxisType = bDateAxis ? cssc2::AxisType::DATE : cssc2::AxisType::CATEGORY; aScaleData.AutoDateAxis = mrModel.mbAuto; aScaleData.Categories = rTypeGroups.front()->createCategorySequence(); /* set default ShiftedCategoryPosition values for some charttype, @@ -343,9 +341,10 @@ void AxisConverter::convertFromModel( xAxis->setScaleData( aScaleData ); // number format -- - -if( (aScaleData.AxisType ==
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - chart2/qa oox/source
chart2/qa/extras/chart2export.cxx | 14 ++ chart2/qa/extras/data/xlsx/auto_marker_excel10.xlsx |binary oox/source/export/chartexport.cxx |2 +- 3 files changed, 15 insertions(+), 1 deletion(-) New commits: commit 48e33a8d34fdb82b01e80fe8889e49ee74aa83e7 Author: Tünde Tóth AuthorDate: Tue Feb 11 15:16:34 2020 +0100 Commit: Gabor Kelemen CommitDate: Thu Jun 11 18:21:42 2020 +0200 tdf#126076 XLSX export: fix automatic line chart markers The default automatic line chart markers in XLSX spreadsheets created with Microsoft Excel 2010 became squares after export. Change-Id: I58a3e10212608a356eef8fbd1e100eda4dbebaca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88461 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit bae73c0726e7fdf7f427a8254c9d6d4b4c510daf) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96134 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 6826c3f53569..6c693be3cce5 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -152,6 +152,7 @@ public: void testTdf123206_customLabelText(); void testCustomLabelText(); void testTdf131979(); +void testTdf126076(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(testErrorBarXLSX); @@ -267,6 +268,7 @@ public: CPPUNIT_TEST(testTdf123206_customLabelText); CPPUNIT_TEST(testCustomLabelText); CPPUNIT_TEST(testTdf131979); +CPPUNIT_TEST(testTdf126076); CPPUNIT_TEST_SUITE_END(); @@ -2467,6 +2469,18 @@ void Chart2ExportTest::testTdf131979() } } +void Chart2ExportTest::testTdf126076() +{ +load("/chart2/qa/extras/data/xlsx/", "auto_marker_excel10.xlsx"); +xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); +CPPUNIT_ASSERT(pXmlDoc); + +// This was 12: all series exported with square markers +assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:marker/c:symbol[@val='square']", 0); +// instead of skipping markers +assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:marker", 0); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/auto_marker_excel10.xlsx b/chart2/qa/extras/data/xlsx/auto_marker_excel10.xlsx new file mode 100644 index ..c15756257251 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/auto_marker_excel10.xlsx differ diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 623a03b8ac97..ab2628ec11dd 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -3711,7 +3711,7 @@ void ChartExport::exportMarker(const Reference< XPropertySet >& xPropSet) if( GetProperty( xPropSet, "Symbol" ) ) mAny >>= aSymbol; -if(aSymbol.Style != chart2::SymbolStyle_STANDARD && aSymbol.Style != chart2::SymbolStyle_AUTO && aSymbol.Style != chart2::SymbolStyle_NONE) +if(aSymbol.Style != chart2::SymbolStyle_STANDARD && aSymbol.Style != chart2::SymbolStyle_NONE) return; FSHelperPtr pFS = GetFS(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits