chart2/Library_chart2.mk | 14 chart2/qa/extras/chart2export2.cxx | 80 ++ chart2/qa/extras/data/xlsx/boxWhisker.xlsx |binary chart2/qa/extras/data/xlsx/clusteredColumn.xlsx |binary chart2/qa/extras/data/xlsx/paretoLine.xlsx |binary chart2/qa/extras/data/xlsx/regionMap.xlsx |binary chart2/qa/extras/data/xlsx/sunburst.xlsx |binary chart2/qa/extras/data/xlsx/treemap.xlsx |binary chart2/qa/extras/data/xlsx/waterfall.xlsx |binary chart2/source/chart2.component | 35 + chart2/source/controller/dialogs/ChartResourceGroups.cxx | 1 chart2/source/inc/servicenames_charttypes.hxx | 14 chart2/source/model/template/BoxWhiskerChartType.cxx | 78 ++ chart2/source/model/template/BoxWhiskerChartType.hxx | 40 + chart2/source/model/template/BoxWhiskerChartTypeTemplate.cxx | 191 ++++++ chart2/source/model/template/BoxWhiskerChartTypeTemplate.hxx | 61 ++ chart2/source/model/template/ChartTypeManager.cxx | 49 + chart2/source/model/template/ClusteredColumnChartType.cxx | 78 ++ chart2/source/model/template/ClusteredColumnChartType.hxx | 40 + chart2/source/model/template/ClusteredColumnChartTypeTemplate.cxx | 193 ++++++ chart2/source/model/template/ClusteredColumnChartTypeTemplate.hxx | 62 ++ chart2/source/model/template/FunnelChartTypeTemplate.cxx | 4 chart2/source/model/template/ParetoLineChartType.cxx | 78 ++ chart2/source/model/template/ParetoLineChartType.hxx | 40 + chart2/source/model/template/ParetoLineChartTypeTemplate.cxx | 191 ++++++ chart2/source/model/template/ParetoLineChartTypeTemplate.hxx | 61 ++ chart2/source/model/template/RegionMapChartType.cxx | 78 ++ chart2/source/model/template/RegionMapChartType.hxx | 40 + chart2/source/model/template/RegionMapChartTypeTemplate.cxx | 191 ++++++ chart2/source/model/template/RegionMapChartTypeTemplate.hxx | 61 ++ chart2/source/model/template/SunburstChartType.cxx | 78 ++ chart2/source/model/template/SunburstChartType.hxx | 40 + chart2/source/model/template/SunburstChartTypeTemplate.cxx | 191 ++++++ chart2/source/model/template/SunburstChartTypeTemplate.hxx | 61 ++ chart2/source/model/template/TreemapChartType.cxx | 75 ++ chart2/source/model/template/TreemapChartType.hxx | 40 + chart2/source/model/template/TreemapChartTypeTemplate.cxx | 191 ++++++ chart2/source/model/template/TreemapChartTypeTemplate.hxx | 61 ++ chart2/source/model/template/WaterfallChartType.cxx | 78 ++ chart2/source/model/template/WaterfallChartType.hxx | 40 + chart2/source/model/template/WaterfallChartTypeTemplate.cxx | 191 ++++++ chart2/source/model/template/WaterfallChartTypeTemplate.hxx | 61 ++ chart2/source/tools/ChartTypeHelper.cxx | 12 download.lst | 4 external/lcms2/0001-Mark-some-tables-as-const.patch.1 | 40 - external/lcms2/0003-mark-more-const.patch.1 | 277 ---------- external/lcms2/ExternalPackage_lcms2.mk | 2 external/lcms2/UnpackedTarball_lcms2.mk | 1 include/oox/export/chartexport.hxx | 19 oox/inc/drawingml/chart/typegroupcontext.hxx | 3 oox/inc/drawingml/chart/typegroupconverter.hxx | 10 oox/source/core/contexthandler2.cxx | 4 oox/source/drawingml/chart/datasourcecontext.cxx | 1 oox/source/drawingml/chart/plotareacontext.cxx | 50 + oox/source/drawingml/chart/seriescontext.cxx | 1 oox/source/drawingml/chart/typegroupcontext.cxx | 54 - oox/source/drawingml/chart/typegroupconverter.cxx | 33 - oox/source/export/chartexport.cxx | 207 ++++++- oox/source/token/tokens.txt | 2 starmath/source/ooxmlexport.cxx | 16 sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 3 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 20 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 21 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 6 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 18 sw/source/core/layout/frmtool.cxx | 5 sw/source/filter/ww8/docxattributeoutput.cxx | 7 sw/source/filter/ww8/docxexport.cxx | 14 sw/source/filter/ww8/docxexport.hxx | 2 sw/source/filter/ww8/docxtablestyleexport.cxx | 61 +- sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx | 26 71 files changed, 3247 insertions(+), 459 deletions(-)
New commits: commit 989778e2ec37fd941966fec9ae182ae6ad1d3104 Author: Justin Luth <[email protected]> AuthorDate: Tue Jan 6 14:52:06 2026 -0500 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 13 10:23:00 2026 +0100 tdf#170208 docx import: conjure up a tblInd if none is provided This has always been wrong for compat14, but some documents have accidentally 'looked right' at various times, most recently before 25.8.3 commit a80d7ba9c01c8c5c95bf01960d969b82dc7edffc Author: Aron Budea on Mon Sep 29 14:59:18 2025 +0930 tdf#168598 Fix for tdf#148578 should only apply to RTF Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191587 This patch is based solely on experimentation. MS docuemntation gives no indication that it just makes up an 'indent from left' when none is provided. Even their errata documentation doesn't mention this. As noted in the bug report, this made-up value is different in Word 2024 than in Word 2010. Fortunately the 'modern' version is a simple calculation. make CppunitTest_sw_ooxmlexport8 CPPUNIT_TEST_NAME=testN780853 make CppunitTest_sw_ooxmlfieldexport CPPUNIT_TEST_NAME=testfdo78886 Change-Id: Iba59184b988a48fe4d7176e6d3b1000870c87dab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196625 Reviewed-by: Justin Luth <[email protected]> Tested-by: Jenkins (cherry picked from commit d0fbf21288d27833a3d3c6b95252c68bcedd1d5c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197134 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 3cac5f867bd7..12fcb07b6388 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -529,6 +529,12 @@ DECLARE_OOXMLEXPORT_TEST(testN780853, "n780853.docx") //tdf#102619 - I would have expected this to be "Standard", but MSO 2013/2010/2003 all give FollowStyle==Date uno::Reference< beans::XPropertySet > properties(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Date"_ustr), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(u"Date"_ustr, getProperty<OUString>(properties, u"FollowStyle"_ustr)); + + // tdf#170208: compatibilityMode12 document - emulate table placement + // MS Word conjures up an 'indent from left' tblInd that cancels out the 'shift by cell margin'. + // Without the fix, it spilled into the left margin by the border spacing distance (-203/0.2cm) + uno::Reference<text::XTextTable> xTable(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xTable, "LeftMargin")); } DECLARE_OOXMLEXPORT_TEST(testN780843, "n780843.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index a8f92ffdb5f5..4b65fe4b8fc8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -459,6 +459,18 @@ CPPUNIT_TEST_FIXTURE(Test, testfdo78886) xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[2]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[2]/w:fldChar[1]", 0); + + // tdf#170208: compatibilityMode12 document - emulate table placement + // TableGrid style defines tblInd - which we adjust by the border spacing to emulate positioning + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + // The left margin (1619 / 1.62cm) is adjusted by the border spacing (203 / 0.2cm) + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1416), getProperty<sal_Int32>(xTable, "LeftMargin")); + + xTable.set(xIndexAccess->getByIndex(1), uno::UNO_QUERY); + // Without the fix, this was -191 (DEF_BORDER_DIST) + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-203), getProperty<sal_Int32>(xTable, "LeftMargin")); } CPPUNIT_TEST_FIXTURE(Test, testFdo78910) diff --git a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx index 6c282aed8935..9d0df3dbf5f1 100644 --- a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx @@ -491,14 +491,16 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo m_aTableProperties->Insert( PROP_TABLE_INTEROP_GRAB_BAG, uno::Any( aGrabBag.getAsConstPropertyValueList() ) ); } + bool bLeftMarginProvided = false; std::optional<PropertyMap::Property> oLeftMarginFromStyle = m_aTableProperties->getProperty(PROP_LEFT_MARGIN); if (oLeftMarginFromStyle) { - oLeftMarginFromStyle->second >>= nLeftMargin; + bLeftMarginProvided = oLeftMarginFromStyle->second >>= nLeftMargin; // don't need to erase, we will push back the adjusted value // of this (or the direct formatting, if that exists) later } - m_aTableProperties->getValue( TablePropertyMap::LEFT_MARGIN, nLeftMargin ); + if (m_aTableProperties->getValue(TablePropertyMap::LEFT_MARGIN, nLeftMargin)) + bLeftMarginProvided = true; m_aTableProperties->getValue( TablePropertyMap::CELL_MAR_LEFT, rInfo.nLeftBorderDistance ); @@ -605,7 +607,14 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo { const sal_Int32 nMinLeftBorderDistance = aLeftBorder.LineWidth / 2; sal_Int32 nLeftBorderDistance = rInfo.nLeftBorderDistance; - if (!m_aCellProperties.empty() && !m_aCellProperties[0].empty()) + if (!bLeftMarginProvided) + { + // Interestingly, MS Word 'makes up' an 'indent from left' if none is provided, + // and that value varies depending on the version of MS Word. + // Most recent versions effectively make it look like compat15 would... + nLeftBorderDistance = nMinLeftBorderDistance; + } + else if (!m_aCellProperties.empty() && !m_aCellProperties[0].empty()) { // only the border spacing of the first row affects the placement of the table std::optional<PropertyMap::Property> aCellLeftBorderDistance commit 7bb9f7792100843cb0623a6bc4248971dc3ba687 Author: Noel Grandin <[email protected]> AuthorDate: Sat Jan 10 17:47:36 2026 +0200 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 13 10:23:00 2026 +0100 officeotron: fix order of sub-elements of tblCellMar and tblBorders Change-Id: I05b4cacb310cdb78f9683cdb0472de383432c6d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196974 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins (cherry picked from commit a83869739c5ea8c3ac7d2f1515ffdfb874ccc597) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197110 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 4bc3eaa4d005..019ba34c476b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -814,9 +814,6 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf88583) DECLARE_OOXMLEXPORT_TEST(testTdf97090, "tdf97090.docx") { - // FIXME: validation error in OOXML export: Errors: 39 - skipValidation(); - uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx b/sw/source/filter/ww8/docxtablestyleexport.cxx index 0e864b095015..b1dd48005fdd 100644 --- a/sw/source/filter/ww8/docxtablestyleexport.cxx +++ b/sw/source/filter/ww8/docxtablestyleexport.cxx @@ -154,27 +154,29 @@ void DocxTableStyleExport::TableStyles(sal_Int32 nCountStylesToWrite) void DocxTableStyleExport::Impl::tableStyleTableCellMar( const uno::Sequence<beans::PropertyValue>& rTableCellMar, sal_Int32 nType) { - static DocxStringTokenMap const aTableCellMarTokens[] - = { { "left", XML_left }, { "right", XML_right }, { "start", XML_start }, - { "end", XML_end }, { "top", XML_top }, { "bottom", XML_bottom }, - { nullptr, 0 } }; + // use table to output elements in correct order + static std::pair<OUString, sal_Int32> constexpr aTableCellOrder[]{ + { u"top"_ustr, XML_top }, { u"start"_ustr, XML_start }, { u"left"_ustr, XML_left }, + { u"bottom"_ustr, XML_bottom }, { u"end"_ustr, XML_end }, { u"right"_ustr, XML_right } + }; if (!rTableCellMar.hasElements()) return; m_pSerializer->startElementNS(XML_w, nType); - for (const auto& rProp : rTableCellMar) + + comphelper::SequenceAsHashMap aCellMap(rTableCellMar); + for (const std::pair<OUString, sal_Int32>& rPair : aTableCellOrder) { - if (sal_Int32 nToken = DocxStringGetToken(aTableCellMarTokens, rProp.Name)) - { - comphelper::SequenceAsHashMap aMap( - rProp.Value.get<uno::Sequence<beans::PropertyValue>>()); - m_pSerializer->singleElementNS(XML_w, nToken, FSNS(XML_w, XML_w), - OString::number(aMap[u"w"_ustr].get<sal_Int32>()), - FSNS(XML_w, XML_type), - aMap[u"type"_ustr].get<OUString>()); - } + uno::Any aAny = aCellMap.getValue(rPair.first); + if (!aAny.hasValue()) + continue; + comphelper::SequenceAsHashMap aMap(aAny.get<uno::Sequence<beans::PropertyValue>>()); + m_pSerializer->singleElementNS(XML_w, rPair.second, FSNS(XML_w, XML_w), + OString::number(aMap[u"w"_ustr].get<sal_Int32>()), + FSNS(XML_w, XML_type), aMap[u"type"_ustr].get<OUString>()); } + m_pSerializer->endElementNS(XML_w, nType); } @@ -204,26 +206,27 @@ void DocxTableStyleExport::Impl::tableStyleTcBorder( void DocxTableStyleExport::Impl::tableStyleTcBorders( const uno::Sequence<beans::PropertyValue>& rTcBorders, sal_Int32 nToken) { - static DocxStringTokenMap const aTcBordersTokens[] = { { "left", XML_left }, - { "right", XML_right }, - { "start", XML_start }, - { "end", XML_end }, - { "top", XML_top }, - { "bottom", XML_bottom }, - { "insideH", XML_insideH }, - { "insideV", XML_insideV }, - { "tl2br", XML_tl2br }, - { "tr2bl", XML_tr2bl }, - { nullptr, 0 } }; + // use table to output elements in correct order + static std::pair<OUString, sal_Int32> constexpr aBordersOrder[]{ + { u"top"_ustr, XML_top }, { u"start"_ustr, XML_start }, + { u"left"_ustr, XML_left }, { u"bottom"_ustr, XML_bottom }, + { u"end"_ustr, XML_end }, { u"right"_ustr, XML_right }, + { u"insideH"_ustr, XML_insideH }, { u"insideV"_ustr, XML_insideV }, + { u"tl2br"_ustr, XML_tl2br }, { u"tr2bl"_ustr, XML_tr2bl }, + }; if (!rTcBorders.hasElements()) return; + comphelper::SequenceAsHashMap aBorderMap(rTcBorders); m_pSerializer->startElementNS(XML_w, nToken); - for (const auto& rTcBorder : rTcBorders) - if (sal_Int32 nSubToken = DocxStringGetToken(aTcBordersTokens, rTcBorder.Name)) - tableStyleTcBorder(nSubToken, - rTcBorder.Value.get<uno::Sequence<beans::PropertyValue>>()); + for (const auto& rPair : aBordersOrder) + { + uno::Any aAny = aBorderMap.getValue(rPair.first); + if (!aAny.hasValue()) + continue; + tableStyleTcBorder(rPair.second, aAny.get<uno::Sequence<beans::PropertyValue>>()); + } m_pSerializer->endElementNS(XML_w, nToken); } commit fa0d4d3012e95fddc295c75dbba033985f7b78d3 Author: Justin Luth <[email protected]> AuthorDate: Thu Jan 8 16:52:31 2026 -0500 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 13 10:23:00 2026 +0100 tdf#168977 docx export: prevent multiple chart rels to embeddings/file MS Word considers a document to be corrupt if multiple files have a relationship to the same embeddings/file. Since we only round-trip existing embeddings, just make sure that if we duplicate a chart internally, that we only write an externalData link once. make CppunitTest_sw_ooxmlexport4 CPPUNIT_TEST_NAME=testChartInFooter Change-Id: I8905412b07fdf8dc065d1fed4c239c63aab24935 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196895 Reviewed-by: Justin Luth <[email protected]> Tested-by: Jenkins (cherry picked from commit 81a1539bf2e197de1275af762b26e98652551a8a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196940 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 1545e246fd15bbbcb4ebe9234d8d915989b0aba4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197120 diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx index 543a83f49a42..2837238974ad 100644 --- a/include/oox/export/chartexport.hxx +++ b/include/oox/export/chartexport.hxx @@ -141,6 +141,7 @@ class ChartExport final : public DrawingML { public: // first: data sequence for label, second: data sequence for values. typedef ::std::vector< AxisIdPair > AxisVector; + bool mbLinkToExternalData = true; private: sal_Int32 mnXmlNamespace; diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index fa89b448f129..1d44dd413a57 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1827,7 +1827,7 @@ void ChartExport::exportExternalData( const Reference< css::chart::XChartDocumen if (bIsChartex) return; // TODO!! // Embedded external data is grab bagged for docx file hence adding export part of // external data for docx files only. - if(GetDocumentType() != DOCUMENT_DOCX) + if(!mbLinkToExternalData || GetDocumentType() != DOCUMENT_DOCX) return; OUString externalDataPath; diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 089150d11c78..ea570064eb17 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -467,6 +467,21 @@ CPPUNIT_TEST_FIXTURE(Test, testChartInFooter) u"rId1"); CPPUNIT_ASSERT_EQUAL(1, getShapes()); + + // tdf#168977: MS Word reports corrupt if same embeddings/file referred to by multiple charts + // Currently, we duplicate a chart into the first page footer (from the 'default' footer) + xmlDocUniquePtr pXmlChart1Rels = parseExport(u"word/charts/_rels/chart1.xml.rels"_ustr); + assertXPath(pXmlChart1Rels, + "//rels:Relationship[@Target='../embeddings/Microsoft_Excel_Worksheet1.xlsx']"); + + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess + = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), + maTempFile.GetURL()); + CPPUNIT_ASSERT(xNameAccess->hasByName(u"word/charts/chart2.xml"_ustr)); // first page footer + // without the fix, this was true; both charts referred to the same 'Microsoft_Excel_Worksheet1' + CPPUNIT_ASSERT_EQUAL(false, + bool(xNameAccess->hasByName(u"word/charts/_rels/chart2.xml.rels"_ustr))); + } CPPUNIT_TEST_FIXTURE(Test, testNestedTextFrames) diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index fa8ce467faf3..00d9a1005d8f 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -405,7 +405,21 @@ OString DocxExport::OutputChart( uno::Reference< frame::XModel > const & xModel, oox::drawingml::ChartExport aChartExport(XML_w, pChartFS, xModel, &m_rFilter, oox::drawingml::DOCUMENT_DOCX); css::uno::Reference<css::util::XModifiable> xModifiable(xModel, css::uno::UNO_QUERY); const bool bOldModified = xModifiable && xModifiable->isModified(); + + // Currently, content in ../embeddings is simply grab-bagged as OOEmbeddings + // and must only be referred to once or else MS Word considers the document corrupt, + // so if a chart is duplicated (common in headers/footers) then only exportExternalData once. + for (const auto& xExport : m_aExportedCharts) + { + if (xExport != xModel) + continue; + + aChartExport.mbLinkToExternalData = false; + break; + } + aChartExport.ExportContent(); + m_aExportedCharts.push_back(xModel); if (!bOldModified && xModifiable && xModifiable->isModified()) // tdf#134973: the model could get modified: e.g., calling XChartDocument::getSubTitle(), // which creates the object if absent, and sets the modified state. diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 6f092664ad1a..ac5700d77867 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -126,6 +126,8 @@ class DocxExport : public MSWordExportBase std::set<SwNode*> m_aDummyFloatingTableAnchors; + std::vector<css::uno::Reference<frame::XModel>> m_aExportedCharts; + public: DocxExportFilter& GetFilter() { return m_rFilter; }; commit e2533a43017d06a87ae3d3b6c26dcce1ceab2ad3 Author: Justin Luth <[email protected]> AuthorDate: Sat Jan 3 17:02:37 2026 -0500 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 13 10:23:00 2026 +0100 tdf#170208 docx import: shift table by cell margin, not style margin This has always been wrong, but some documents have accidentally 'looked right' at various times, most recently before 25.8.3 commit a80d7ba9c01c8c5c95bf01960d969b82dc7edffc Author: Aron Budea on Mon Sep 29 14:59:18 2025 +0930 tdf#168598 Fix for tdf#148578 should only apply to RTF Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191587 make CppunitTest_sw_ooxmlfieldexport \ CPPUNIT_TEST_NAME=testTdf158661_blockSDT Another nice example was nested-floating-table.docx Change-Id: Ie4e256dc0651ade8d302bf78646b2a5215414bc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196462 Tested-by: Jenkins Reviewed-by: Justin Luth <[email protected]> (cherry picked from commit a63534ef77c620c06d41be9ad29c283fe636bf7f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196587 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 53e53fa279c11ba28829164ca68a159e614368d3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197121 diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 7ed052daf2c3..a8f92ffdb5f5 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -564,6 +564,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158661_blockSDT) xContentControlEnum = xContentControlEnumAccess->createEnumeration(); xTextPortionRange.set(xContentControlEnum->nextElement(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(u"Test"_ustr, xTextPortionRange->getString()); + + // tdf#170208: compatibilityMode14 document - emulate table placement + // TODO: the first table is also not correctly positioned + + // table2's cell margin (in the first row) is zero, so compat14 table shifts by zero, not .19cm + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xTable, "LeftMargin")); } CPPUNIT_TEST_FIXTURE(Test, testSdt2Run) diff --git a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx index b4e2174f52dc..6c282aed8935 100644 --- a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx @@ -603,7 +603,18 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo if (m_rDMapper_Impl.IsOOXMLImport() && (nMode < 0 || (0 < nMode && nMode <= 14)) && rInfo.nNestLevel == 1) { - const sal_Int32 nAdjustedMargin = nLeftMargin - rInfo.nLeftBorderDistance; + const sal_Int32 nMinLeftBorderDistance = aLeftBorder.LineWidth / 2; + sal_Int32 nLeftBorderDistance = rInfo.nLeftBorderDistance; + if (!m_aCellProperties.empty() && !m_aCellProperties[0].empty()) + { + // only the border spacing of the first row affects the placement of the table + std::optional<PropertyMap::Property> aCellLeftBorderDistance + = m_aCellProperties[0][0]->getProperty(PROP_LEFT_BORDER_DISTANCE); + if (aCellLeftBorderDistance) + aCellLeftBorderDistance->second >>= nLeftBorderDistance; + } + nLeftBorderDistance = std::max(nMinLeftBorderDistance, nLeftBorderDistance); + const sal_Int32 nAdjustedMargin = nLeftMargin - nLeftBorderDistance; m_aTableProperties->Insert( PROP_LEFT_MARGIN, uno::Any( nAdjustedMargin ) ); } else commit 028123109452aa11dd5bc0205104bd06842652da Author: Jim Raykowski <[email protected]> AuthorDate: Mon Dec 15 15:03:33 2025 -0900 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 13 10:23:00 2026 +0100 tdf#90993 Fix anchored objects disappear A stab at fixing when an anchor of a frame is changed all draw objects anchored to the frame or anchored in the frame content disappear. Change-Id: Icce446b759def60460a2b72bd9eb57b5749cd26f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195689 Tested-by: Jenkins Reviewed-by: Jim Raykowski <[email protected]> (cherry picked from commit dfc0ec48f86b39f7159d0c856fa7d497bea3ea13) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196089 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 3933f9a758bf..73317fe0fcfe 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1077,7 +1077,10 @@ void AppendObj(SwFrame *const pFrame, SwPageFrame *const pPage, SwFrameFormat *c { if ( !pNew->GetAnchorFrame() ) { - pFrame->AppendDrawObj( *(pNew->GetAnchoredObj( nullptr )) ); + SwAnchoredObject& rAnchorObj = *(pNew->GetAnchoredObj(nullptr)); + pFrame->AppendDrawObj(rAnchorObj); + if (rAnchorObj.GetDrawObj()->IsVisible()) + pNew->MoveObjToVisibleLayer(rAnchorObj.DrawObj()); } // OD 19.06.2003 #108784# - add 'virtual' drawing object, // if necessary. But control objects have to be excluded. commit 2a5086e664726896503faa5a451fb9667bedb044 Author: Xisco Fauli <[email protected]> AuthorDate: Fri Jan 9 15:13:44 2026 +0100 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 13 10:23:00 2026 +0100 lcms2: upgrade to 2.18 0001-Mark-some-tables-as-const.patch.1 has been fixed upstream Downloaded from https://sourceforge.net/projects/lcms/files/lcms/2.18/lcms2-2.18.tar.gz/download Change-Id: Ie2191419c63fd6fdb478f91d573630e745a16d2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196926 Reviewed-by: Xisco Fauli <[email protected]> Tested-by: Jenkins Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196969 Reviewed-by: Noel Grandin <[email protected]> diff --git a/download.lst b/download.lst index 07ecb5285060..589c445d0118 100644 --- a/download.lst +++ b/download.lst @@ -468,8 +468,8 @@ LANGTAGREG_TARBALL := language-subtag-registry-2025-08-25.tar.bz2 # three static lines # so that git cherry-pick # will not run into conflicts -LCMS2_SHA256SUM := d11af569e42a1baa1650d20ad61d12e41af4fead4aa7964a01f93b08b53ab074 -LCMS2_TARBALL := lcms2-2.17.tar.gz +LCMS2_SHA256SUM := ee67be3566f459362c1ee094fde2c159d33fa0390aa4ed5f5af676f9e5004347 +LCMS2_TARBALL := lcms2-2.18.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/lcms2/0001-Mark-some-tables-as-const.patch.1 b/external/lcms2/0001-Mark-some-tables-as-const.patch.1 deleted file mode 100644 index 6c00dd89faba..000000000000 --- a/external/lcms2/0001-Mark-some-tables-as-const.patch.1 +++ /dev/null @@ -1,40 +0,0 @@ -From 58affbcc90f060b6b34bad2ed508a2d159fd9320 Mon Sep 17 00:00:00 2001 -From: Marti Maria <[email protected]> -Date: Mon, 21 Jul 2025 20:12:09 +0200 -Subject: [PATCH] Mark some tables as const - -per PR #501 ---- - src/cmsalpha.c | 2 +- - src/cmscgats.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/cmsalpha.c b/src/cmsalpha.c -index a5f1a16..b8e1a26 100644 ---- a/src/cmsalpha.c -+++ b/src/cmsalpha.c -@@ -377,7 +377,7 @@ int FormatterPos(cmsUInt32Number frm) - static - cmsFormatterAlphaFn _cmsGetFormatterAlpha(cmsContext id, cmsUInt32Number in, cmsUInt32Number out) - { --static cmsFormatterAlphaFn FormattersAlpha[6][6] = { -+static const cmsFormatterAlphaFn FormattersAlpha[6][6] = { - - /* from 8 */ { copy8, from8to16, from8to16SE, from8toHLF, from8toFLT, from8toDBL }, - /* from 16*/ { from16to8, copy16, from16to16, from16toHLF, from16toFLT, from16toDBL }, -diff --git a/src/cmscgats.c b/src/cmscgats.c -index 53e3442..7df8a16 100644 ---- a/src/cmscgats.c -+++ b/src/cmscgats.c -@@ -266,7 +266,7 @@ typedef struct { - WRITEMODE as; // How is supposed to be written - } PROPERTY; - --static PROPERTY PredefinedProperties[] = { -+static const PROPERTY PredefinedProperties[] = { - - {"NUMBER_OF_FIELDS", WRITE_UNCOOKED}, // Required - NUMBER OF FIELDS - {"NUMBER_OF_SETS", WRITE_UNCOOKED}, // Required - NUMBER OF SETS --- -2.49.0 - diff --git a/external/lcms2/ExternalPackage_lcms2.mk b/external/lcms2/ExternalPackage_lcms2.mk index a71b31ef7395..896af12ad31f 100644 --- a/external/lcms2/ExternalPackage_lcms2.mk +++ b/external/lcms2/ExternalPackage_lcms2.mk @@ -17,7 +17,7 @@ $(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.2.dy else ifeq ($(COM),MSC) $(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/lcms2.dll,bin/lcms2.dll)) else -$(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.so.2,src/.libs/liblcms2.so.2.0.17)) +$(eval $(call gb_ExternalPackage_add_file,lcms2,$(LIBO_LIB_FOLDER)/liblcms2.so.2,src/.libs/liblcms2.so.2.0.18)) endif endif # $(DISABLE_DYNLOADING) diff --git a/external/lcms2/UnpackedTarball_lcms2.mk b/external/lcms2/UnpackedTarball_lcms2.mk index c3e818ce96d8..946b790d4978 100644 --- a/external/lcms2/UnpackedTarball_lcms2.mk +++ b/external/lcms2/UnpackedTarball_lcms2.mk @@ -25,7 +25,6 @@ endif $(eval $(call gb_UnpackedTarball_add_patches,lcms2,\ external/lcms2/lcms2-2.4-windows.patch \ - external/lcms2/0001-Mark-some-tables-as-const.patch.1 \ external/lcms2/0002-mark-more-const.patch.1 \ external/lcms2/0003-mark-more-const.patch.1 \ )) commit dc3b09305b3b95a1971e95f5fb257a27f41e3057 Author: Xisco Fauli <[email protected]> AuthorDate: Fri Jan 9 14:06:13 2026 +0100 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 13 10:23:00 2026 +0100 lcms2: Drop not related changes in patch Since commit 66f99a4fdbd1a8bc1ec7366cf9482576ca2ed7fa Author: Noel Grandin <[email protected]> Date: Mon Jul 28 14:31:59 2025 +0200 mark more const in lcms2 Change-Id: I88fbbda06bfabecf381c17acfd399f3f6cd20cbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196923 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196968 diff --git a/external/lcms2/0003-mark-more-const.patch.1 b/external/lcms2/0003-mark-more-const.patch.1 index a5680fc0b4e2..d35bfbb94787 100644 --- a/external/lcms2/0003-mark-more-const.patch.1 +++ b/external/lcms2/0003-mark-more-const.patch.1 @@ -1,238 +1,3 @@ -Only in lcms2: a-conftest.dwo -Only in lcms2: build.log -Only in lcms2: config.log -Only in lcms2: config.status -Only in lcms2/include: Makefile -Only in lcms2: lcms2.pc -Only in lcms2: libtool -Only in lcms2: Makefile -Only in lcms2/plugins/fast_float/include: Makefile -Only in lcms2/plugins/fast_float: Makefile -Only in lcms2/plugins/fast_float/src/.deps: fast_16_tethra.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_8_curves.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_8_matsh.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_8_matsh_sse.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_8_tethra.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_float_15bits.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_float_15mats.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_float_cmyk.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_float_curves.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_float_lab.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_float_matsh.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_float_separate.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_float_sup.Plo -Only in lcms2/plugins/fast_float/src/.deps: fast_float_tethra.Plo -Only in lcms2/plugins/fast_float/src: Makefile -Only in lcms2/plugins/fast_float/testbed/.deps: fast_float_testbed.Po -Only in lcms2/plugins/fast_float/testbed: Makefile -diff -ur lcms2.org/plugins/Makefile lcms2/plugins/Makefile ---- lcms2.org/plugins/Makefile 2025-07-28 14:27:59.953675836 +0200 -+++ lcms2/plugins/Makefile 2025-07-28 14:30:37.410209400 +0200 -@@ -184,28 +184,28 @@ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" --ACLOCAL = ${SHELL} '/home/marti/git/Little-CMS/missing' aclocal-1.16 -+ACLOCAL = ${SHELL} '/home/noel/libo3/workdir/UnpackedTarball/lcms2/missing' aclocal-1.16 - AMTAR = $${TAR-tar} - AM_DEFAULT_VERBOSITY = 1 --AR = ar -+AR = gcc-ar - AS = as --AUTOCONF = ${SHELL} '/home/marti/git/Little-CMS/missing' autoconf --AUTOHEADER = ${SHELL} '/home/marti/git/Little-CMS/missing' autoheader --AUTOMAKE = ${SHELL} '/home/marti/git/Little-CMS/missing' automake-1.16 --AWK = mawk --CC = gcc -+AUTOCONF = ${SHELL} '/home/noel/libo3/workdir/UnpackedTarball/lcms2/missing' autoconf -+AUTOHEADER = ${SHELL} '/home/noel/libo3/workdir/UnpackedTarball/lcms2/missing' autoheader -+AUTOMAKE = ${SHELL} '/home/noel/libo3/workdir/UnpackedTarball/lcms2/missing' automake-1.16 -+AWK = gawk -+CC = /usr/bin/ccache gcc - CCDEPMODE = depmode=gcc3 --CFLAGS = -g -O2 -fvisibility=hidden -pthread --CPP = gcc -E --CPPFLAGS = -+CFLAGS = -O2 -mtune=generic -ggdb2 -gsplit-dwarf -gdwarf-4 -ggnu-pubnames -fvisibility=hidden -pthread -+CPP = /usr/bin/ccache gcc -E -+CPPFLAGS = -I/usr/lib/jvm/java-21-openjdk-amd64/include -I/usr/lib/jvm/java-21-openjdk-amd64/include/linux - CSCOPE = cscope - CTAGS = ctags --CXX = g++ --CXXCPP = g++ -E -+CXX = /usr/bin/ccache g++ -+CXXCPP = /usr/bin/ccache g++ -E - CXXDEPMODE = depmode=gcc3 - CXXFLAGS = -g -O2 -pthread - CYGPATH_W = echo --DEFS = -DPACKAGE_NAME=\"lcms2\" -DPACKAGE_TARNAME=\"lcms2\" -DPACKAGE_VERSION=\"2.16\" -DPACKAGE_STRING=\"lcms2\ 2.16\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FUNC_ATTRIBUTE_VISIBILITY=1 -DHAVE_GMTIME_R=1 -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DHasTHREADS=1 -DHasJPEG=1 -DHasZLIB=1 -DHasTIFF=1 -DHAVE_TIFFCONF_H=1 -+DEFS = -DPACKAGE_NAME=\"lcms2\" -DPACKAGE_TARNAME=\"lcms2\" -DPACKAGE_VERSION=\"2.17\" -DPACKAGE_STRING=\"lcms2\ 2.17\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FUNC_ATTRIBUTE_VISIBILITY=1 -DHAVE_GMTIME_R=1 -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DHasTHREADS=1 -DHasZLIB=1 - DEPDIR = .deps - DLLTOOL = false - DSYMUTIL = -@@ -224,32 +224,32 @@ - INSTALL_PROGRAM = ${INSTALL} - INSTALL_SCRIPT = ${INSTALL} - INSTALL_STRIP_PROGRAM = $(install_sh) -c -s --JPEGICC_DEPLIBS = -ljpeg -lm -lpthread -+JPEGICC_DEPLIBS = -lm -lpthread - LCMS_LIB_DEPLIBS = -lm -lpthread - LD = /usr/bin/ld -m elf_x86_64 - LDFLAGS = - LIBOBJS = - LIBRARY_AGE = 0 - LIBRARY_CURRENT = 2 --LIBRARY_REVISION = 16 -+LIBRARY_REVISION = 17 - LIBS = - LIBTOOL = $(SHELL) $(top_builddir)/libtool - LIBTOOL_DEPS = .//ltmain.sh --LIB_JPEG = -ljpeg -+LIB_JPEG = - LIB_MATH = -lm - LIB_PLUGINS = - LIB_THREAD = -lpthread --LIB_TIFF = -ltiff -+LIB_TIFF = - LIB_ZLIB = -lz - LIPO = - LN_S = ln -s - LTLIBOBJS = - LT_SYS_LIBRARY_PATH = --MAINT = --MAKEINFO = ${SHELL} '/home/marti/git/Little-CMS/missing' makeinfo -+MAINT = # -+MAKEINFO = ${SHELL} '/home/noel/libo3/workdir/UnpackedTarball/lcms2/missing' makeinfo - MANIFEST_TOOL = : - MKDIR_P = /usr/bin/mkdir -p --NM = /usr/bin/nm -B -+NM = gcc-nm - NMEDIT = - OBJDUMP = objdump - OBJEXT = o -@@ -258,29 +258,29 @@ - PACKAGE = lcms2 - PACKAGE_BUGREPORT = - PACKAGE_NAME = lcms2 --PACKAGE_STRING = lcms2 2.16 -+PACKAGE_STRING = lcms2 2.17 - PACKAGE_TARNAME = lcms2 - PACKAGE_URL = --PACKAGE_VERSION = 2.16 -+PACKAGE_VERSION = 2.17 - PATH_SEPARATOR = : --PTHREAD_CC = gcc -+PTHREAD_CC = /usr/bin/ccache gcc - PTHREAD_CFLAGS = -pthread --PTHREAD_CXX = g++ -+PTHREAD_CXX = /usr/bin/ccache g++ - PTHREAD_LIBS = -lpthread --RANLIB = ranlib -+RANLIB = gcc-ranlib - SED = /usr/bin/sed - SET_MAKE = - SHELL = /bin/bash - STRIP = strip --TIFFICC_DEPLIBS = -ltiff -ljpeg -lz -lm -lpthread --VERSION = 2.16 --abs_builddir = /home/marti/git/Little-CMS/plugins --abs_srcdir = /home/marti/git/Little-CMS/plugins --abs_top_builddir = /home/marti/git/Little-CMS --abs_top_srcdir = /home/marti/git/Little-CMS --ac_ct_AR = ar --ac_ct_CC = gcc --ac_ct_CXX = g++ -+TIFFICC_DEPLIBS = -lz -lm -lpthread -+VERSION = 2.17 -+abs_builddir = /home/noel/libo3/workdir/UnpackedTarball/lcms2/plugins -+abs_srcdir = /home/noel/libo3/workdir/UnpackedTarball/lcms2/plugins -+abs_top_builddir = /home/noel/libo3/workdir/UnpackedTarball/lcms2 -+abs_top_srcdir = /home/noel/libo3/workdir/UnpackedTarball/lcms2 -+ac_ct_AR = -+ac_ct_CC = -+ac_ct_CXX = - ac_ct_DUMPBIN = - am__include = include - am__leading_dot = . -@@ -290,7 +290,7 @@ - ax_pthread_config = - bindir = ${exec_prefix}/bin - build = x86_64-pc-linux-gnu --build_alias = -+build_alias = x86_64-pc-linux-gnu - build_cpu = x86_64 - build_os = linux-gnu - build_vendor = pc -@@ -301,7 +301,7 @@ - dvidir = ${docdir} - exec_prefix = ${prefix} - host = x86_64-pc-linux-gnu --host_alias = -+host_alias = x86_64-pc-linux-gnu - host_cpu = x86_64 - host_os = linux-gnu - host_vendor = pc -@@ -309,7 +309,7 @@ - includedir = ${prefix}/include - infodir = ${datarootdir}/info - inline = --install_sh = ${SHELL} /home/marti/git/Little-CMS/install-sh -+install_sh = ${SHELL} /home/noel/libo3/workdir/UnpackedTarball/lcms2/install-sh - libdir = ${exec_prefix}/lib - libexecdir = ${exec_prefix}/libexec - localedir = ${datarootdir}/locale -@@ -334,7 +334,7 @@ - all: all-recursive - - .SUFFIXES: --$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) -+$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ -@@ -358,9 +358,9 @@ - $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - --$(top_srcdir)/configure: $(am__configure_deps) -+$(top_srcdir)/configure: # $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh --$(ACLOCAL_M4): $(am__aclocal_m4_deps) -+$(ACLOCAL_M4): # $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - $(am__aclocal_m4_deps): - -Only in lcms2/plugins/threaded/include: Makefile -Only in lcms2/plugins/threaded: Makefile -Only in lcms2/plugins/threaded/src/.deps: threaded_core.Plo -Only in lcms2/plugins/threaded/src/.deps: threaded_main.Plo -Only in lcms2/plugins/threaded/src/.deps: threaded_scheduler.Plo -Only in lcms2/plugins/threaded/src/.deps: threaded_split.Plo -Only in lcms2/plugins/threaded/src: Makefile -Only in lcms2/plugins/threaded/testbed/.deps: threaded_testbed.Po -Only in lcms2/plugins/threaded/testbed: Makefile -Only in lcms2/src: cmsalpha.lo -Only in lcms2/src: cmscam02.lo -Only in lcms2/src: cmscgats.lo -Only in lcms2/src: cmscnvrt.lo -Only in lcms2/src: cmserr.lo -Only in lcms2/src: cmsgamma.lo -Only in lcms2/src: cmsgmt.lo -Only in lcms2/src: cmshalf.lo -Only in lcms2/src: cmsintrp.lo -Only in lcms2/src: cmsio0.lo -Only in lcms2/src: cmsio1.lo -Only in lcms2/src: cmslut.lo -Only in lcms2/src: cmsmd5.lo -Only in lcms2/src: cmsmtrx.lo -Only in lcms2/src: cmsnamed.lo -Only in lcms2/src: cmsopt.lo -Only in lcms2/src: cmspack.lo -Only in lcms2/src: cmspcs.lo -Only in lcms2/src: cmsplugin.lo -Only in lcms2/src: cmsps2.lo -Only in lcms2/src: cmssamp.lo -Only in lcms2/src: cmssm.lo diff -ur lcms2.org/src/cmstypes.c lcms2/src/cmstypes.c --- lcms2.org/src/cmstypes.c 2025-07-28 14:27:59.954279541 +0200 +++ lcms2/src/cmstypes.c 2025-07-28 14:30:31.630036454 +0200 @@ -254,45 +19,3 @@ diff -ur lcms2.org/src/cmstypes.c lcms2/src/cmstypes.c { cmsSigAToB0Tag, { 1, 3, { cmsSigLut16Type, cmsSigLutAtoBType, cmsSigLut8Type}, DecideLUTtypeA2B}, &SupportedTags[1]}, { cmsSigAToB1Tag, { 1, 3, { cmsSigLut16Type, cmsSigLutAtoBType, cmsSigLut8Type}, DecideLUTtypeA2B}, &SupportedTags[2]}, -Only in lcms2/src: cmstypes.lo -Only in lcms2/src: cmsvirt.lo -Only in lcms2/src: cmswtpnt.lo -Only in lcms2/src: cmsxform.lo -Only in lcms2/src/.deps: cmsalpha.Plo -Only in lcms2/src/.deps: cmscam02.Plo -Only in lcms2/src/.deps: cmscgats.Plo -Only in lcms2/src/.deps: cmscnvrt.Plo -Only in lcms2/src/.deps: cmserr.Plo -Only in lcms2/src/.deps: cmsgamma.Plo -Only in lcms2/src/.deps: cmsgmt.Plo -Only in lcms2/src/.deps: cmshalf.Plo -Only in lcms2/src/.deps: cmsintrp.Plo -Only in lcms2/src/.deps: cmsio0.Plo -Only in lcms2/src/.deps: cmsio1.Plo -Only in lcms2/src/.deps: cmslut.Plo -Only in lcms2/src/.deps: cmsmd5.Plo -Only in lcms2/src/.deps: cmsmtrx.Plo -Only in lcms2/src/.deps: cmsnamed.Plo -Only in lcms2/src/.deps: cmsopt.Plo -Only in lcms2/src/.deps: cmspack.Plo -Only in lcms2/src/.deps: cmspcs.Plo -Only in lcms2/src/.deps: cmsplugin.Plo -Only in lcms2/src/.deps: cmsps2.Plo -Only in lcms2/src/.deps: cmssamp.Plo -Only in lcms2/src/.deps: cmssm.Plo -Only in lcms2/src/.deps: cmstypes.Plo -Only in lcms2/src/.deps: cmsvirt.Plo -Only in lcms2/src/.deps: cmswtpnt.Plo -Only in lcms2/src/.deps: cmsxform.Plo -Only in lcms2/src: liblcms2.la -Only in lcms2/src: .libs -Only in lcms2/src: Makefile -Only in lcms2/testbed/.deps: testcms2.Po -Only in lcms2/testbed/.deps: testplugin.Po -Only in lcms2/testbed/.deps: zoo_icc.Po -Only in lcms2/testbed: Makefile -Only in lcms2/utils/jpgicc: Makefile -Only in lcms2/utils/linkicc: Makefile -Only in lcms2/utils/psicc: Makefile -Only in lcms2/utils/tificc: Makefile -Only in lcms2/utils/transicc: Makefile commit 5ac090882bf21ed8c96a62aa8a6d85f55882c94d Author: Aron Budea <[email protected]> AuthorDate: Mon Dec 1 00:27:05 2025 +1030 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 13 10:23:00 2026 +0100 tdf#142693 tdf#169419 sw: Limit page size exported to DOCX Based on what Word can roundtrip, which is 64K twips, even though that size (115 cm) can't be set via the UI. Officially 2.1.220 Part 1 Section 17.6.13 of [MS-OI29500] says 31680 twips, but let's keep to the value that works in practice. Don't adjust size on import, only on export, Writer can handle much larger sizes. 446771fe3e91eb7d154e86b9c6a614374110e9ca was related. Change-Id: I88540e80f4e94fd8fc3703c18d8b151a7bd270e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194843 Tested-by: Jenkins Reviewed-by: Aron Budea <[email protected]> (cherry picked from commit 714c2ee044b31f6974cbedc3f8cb3f80db475afc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197012 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/data/tdf142693_hugePaperSizeImport.docx b/sw/qa/extras/ooxmlexport/data/tdf142693_hugePaperSize.docx similarity index 100% rename from sw/qa/extras/ooxmlexport/data/tdf142693_hugePaperSizeImport.docx rename to sw/qa/extras/ooxmlexport/data/tdf142693_hugePaperSize.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index e88f5cd76fac..6b61b86c6bfa 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -1347,13 +1347,25 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127741, "tdf127741.docx") CPPUNIT_ASSERT(visitedStyleName.equalsIgnoreAsciiCase("Visited Internet Link")); } -CPPUNIT_TEST_FIXTURE(Test, testTdf142693_hugePaperSizeImport) +CPPUNIT_TEST_FIXTURE(Test, testTdf142693_hugePaperSize) { - createSwDoc("tdf142693_hugePaperSizeImport.docx"); + createSwDoc("tdf142693_hugePaperSize.docx"); + + // Verify that original page size is imported as is, since Writer can handle + // large page sizes + uno::Reference<beans::XPropertySet> xPageStyle( + getStyles(u"PageStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Page Width (mm) ", sal_Int32(1594), + getProperty<sal_Int32>(xPageStyle, u"Width"_ustr) / 100); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Page Height (mm)", sal_Int32(1841), + getProperty<sal_Int32>(xPageStyle, u"Height"_ustr) / 100); + save(TestFilter::DOCX); xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); - assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "w", u"90369"); - assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "h", u"104372"); + // Verify that exported page size is limited to conform to max page dimensions + // Word can handle in practice, which is about 64k twips (as opposed to 31680 in [MS-OI29500]) + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "w", u"65500"); + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "h", u"65500"); } CPPUNIT_TEST_FIXTURE(Test, testTdf127925) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 0c329ca663b3..402782f02560 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -9416,8 +9416,11 @@ void DocxAttributeOutput::FormatFrameSize( const SwFormatFrameSize& rSize ) if ( m_rExport.m_pCurrentPageDesc->GetLandscape( ) ) attrList->add( FSNS( XML_w, XML_orient ), "landscape" ); - attrList->add( FSNS( XML_w, XML_w ), OString::number( rSize.GetWidth( ) ) ); - attrList->add( FSNS( XML_w, XML_h ), OString::number( rSize.GetHeight( ) ) ); + // Max page dimensions in practice, (2.1.220 Part 1 Section 17.6.13 in [MS-OI29500] says 31680, + // but Word can handle about 64k twips + const tools::Long nMaxSize = 65500; + attrList->add( FSNS( XML_w, XML_w ), OString::number( std::min( nMaxSize, rSize.GetWidth( ) ) ) ); + attrList->add( FSNS( XML_w, XML_h ), OString::number( std::min( nMaxSize, rSize.GetHeight( ) ) ) ); m_pSerializer->singleElementNS( XML_w, XML_pgSz, attrList ); } commit 6da6d6c39583f93d003207b5616dcb16b3c5ac34 Author: Kurt Nordback <[email protected]> AuthorDate: Mon Jan 5 11:41:08 2026 -0700 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 13 10:22:59 2026 +0100 tdf#165742 Step 5.3: Fix pareto chart import Restructure chartex parsing architecture a bit, to fix handling of multiple series in a chart (as in pareto charts, as created by MSO). This is necessitated by the difference between chart and chartex structure: the former includes a 'type group' tag (e.g., barChart) which can contain multiple series; the latter has the chart type attached to the series tag as an attribute. Change-Id: I4bd20b189248888dc88939398bf47bd750f57c26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196580 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196929 diff --git a/chart2/qa/extras/chart2export2.cxx b/chart2/qa/extras/chart2export2.cxx index d28c87dcfef1..fc207d8a19d6 100644 --- a/chart2/qa/extras/chart2export2.cxx +++ b/chart2/qa/extras/chart2export2.cxx @@ -196,17 +196,12 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartexTitleXLSX) pXmlDoc = parseExport(u"xl/charts/chartEx1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); -#if 0 - // This is what it really should be, based on MSO output - assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", - 2, 0, "layoutId", u"clusteredColumn"); - assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", - 2, 1, "layoutId", u"paretoLine"); -#else - // This is what LO currently produces + // A pareto chart from MSO really consists of two subcharts: a pareto line + // and a clustered column chart. assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", 2, 0, + "layoutId", u"clusteredColumn"); + assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", 2, 1, "layoutId", u"paretoLine"); -#endif assertXPathContent(pXmlDoc, "/cx:chartSpace/cx:chart/cx:title/cx:tx/cx:txData/cx:v", u"ParetoLine"); // ==== diff --git a/oox/inc/drawingml/chart/typegroupcontext.hxx b/oox/inc/drawingml/chart/typegroupcontext.hxx index c64f18d74c72..07b45d5c50bd 100644 --- a/oox/inc/drawingml/chart/typegroupcontext.hxx +++ b/oox/inc/drawingml/chart/typegroupcontext.hxx @@ -162,9 +162,6 @@ public: explicit ChartexTypeGroupContext( ::oox::core::ContextHandler2Helper& rParent, TypeGroupModel& rModel ); virtual ~ChartexTypeGroupContext() override; - // Explicitly create a new series - void CreateSeries(); - virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override; }; diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx index 731c23368933..c3c3fc6af82f 100644 --- a/oox/source/drawingml/chart/plotareacontext.cxx +++ b/oox/source/drawingml/chart/plotareacontext.cxx @@ -170,7 +170,7 @@ ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, [[maybe_ case CX_TOKEN(plotArea) : switch (nElement) { case CX_TOKEN(plotAreaRegion) : - return new ChartexTypeGroupContext(*this, mrModel.maTypeGroups.create(nElement, false)); + return this; case CX_TOKEN(axis) : if (rAttribs.hasAttribute(XML_id)) { sal_Int32 nId = rAttribs.getInteger(XML_id, -1); @@ -186,6 +186,54 @@ ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, [[maybe_ return nullptr; } break; + case CX_TOKEN(plotAreaRegion): + switch (nElement) { + case CX_TOKEN(series): + if (rAttribs.hasAttribute(XML_layoutId)) { + sal_Int32 nTypeId = 0; + OUString sChartId = rAttribs.getStringDefaulted(XML_layoutId); + assert(!sChartId.isEmpty()); + + if (sChartId == "boxWhisker") { + nTypeId = CX_TOKEN(boxWhisker); + } else if (sChartId == "clusteredColumn") { + nTypeId = CX_TOKEN(clusteredColumn); + } else if (sChartId == "funnel") { + nTypeId = CX_TOKEN(funnel); + } else if (sChartId == "paretoLine") { + nTypeId = CX_TOKEN(paretoLine); + } else if (sChartId == "regionMap") { + nTypeId = CX_TOKEN(regionMap); + } else if (sChartId == "sunburst") { + nTypeId = CX_TOKEN(sunburst); + } else if (sChartId == "treemap") { + nTypeId = CX_TOKEN(treemap); + } else if (sChartId == "waterfall") { + nTypeId = CX_TOKEN(waterfall); + } else { + assert(false); + } + + // The chartex schema doesn't have the same structure as + // chart. Specifically, there's not a chart type tag + // (which corresponds to the "type group" used in oox) + // plus enclosed series tags. Instead, in chartex, each + // series has an attribute specifying the chart type. As + // a result, we don't want to call the type group + // context handler, but we still need to create a type + // group in the model tree, since much of the existing + // machinery depends on it. + mrModel.maTypeGroups.create(nTypeId, false); + std::shared_ptr<TypeGroupModel> aTGM = + mrModel.maTypeGroups.get(mrModel.maTypeGroups.size() - 1); + return new ChartexSeriesContext(*this, aTGM->maSeries.create(false)); + } + return nullptr; + case CX_TOKEN(plotSurface) : + // TODO + return nullptr; + + } } return nullptr; } diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx index f29b42ab42bf..4f2ea33652e9 100644 --- a/oox/source/drawingml/chart/typegroupcontext.cxx +++ b/oox/source/drawingml/chart/typegroupcontext.cxx @@ -405,61 +405,11 @@ ChartexTypeGroupContext::~ChartexTypeGroupContext() { } -void ChartexTypeGroupContext::CreateSeries() -{ - mrModel.maSeries.create(false); -} - ContextHandlerRef ChartexTypeGroupContext::onCreateContext( [[maybe_unused]] sal_Int32 nElement, [[maybe_unused]] const AttributeList& rAttribs ) { - if (isRootElement()) switch (nElement) { - case CX_TOKEN(plotSurface) : - // TODO - return nullptr; - case CX_TOKEN(series) : - if (rAttribs.hasAttribute(XML_layoutId)) { - // If this is the first series, then the type ID is currently - // set to <cx:plotAreaRegion>. If this is not the first series - // in a multi-series chart, it should be set to the previous - // chart type in the series (which *should* only be another - // chartex type, not a <c> type). In either case, set it - // to the specific chart type based on the layoutId attribute - assert(mrModel.mnTypeId == CX_TOKEN(plotAreaRegion) || - mrModel.mnTypeId == CX_TOKEN(boxWhisker) || - mrModel.mnTypeId == CX_TOKEN(clusteredColumn) || - mrModel.mnTypeId == CX_TOKEN(funnel) || - mrModel.mnTypeId == CX_TOKEN(paretoLine) || - mrModel.mnTypeId == CX_TOKEN(regionMap) || - mrModel.mnTypeId == CX_TOKEN(sunburst) || - mrModel.mnTypeId == CX_TOKEN(treemap) || - mrModel.mnTypeId == CX_TOKEN(waterfall)); - OUString sChartId = rAttribs.getStringDefaulted(XML_layoutId); - assert(!sChartId.isEmpty()); - - if (sChartId == "boxWhisker") { - mrModel.mnTypeId = CX_TOKEN(boxWhisker); - } else if (sChartId == "clusteredColumn") { - mrModel.mnTypeId = CX_TOKEN(clusteredColumn); - } else if (sChartId == "funnel") { - mrModel.mnTypeId = CX_TOKEN(funnel); - } else if (sChartId == "paretoLine") { - mrModel.mnTypeId = CX_TOKEN(paretoLine); - } else if (sChartId == "regionMap") { - mrModel.mnTypeId = CX_TOKEN(regionMap); - } else if (sChartId == "sunburst") { - mrModel.mnTypeId = CX_TOKEN(sunburst); - } else if (sChartId == "treemap") { - mrModel.mnTypeId = CX_TOKEN(treemap); - } else if (sChartId == "waterfall") { - mrModel.mnTypeId = CX_TOKEN(waterfall); - } else { - assert(false); - } - - return new ChartexSeriesContext(*this, mrModel.maSeries.create(false)); - } - break; + if (isRootElement()) { + return new ChartexSeriesContext(*this, mrModel.maSeries.create(false)); } return nullptr; commit fcb2772855518def0dcbeefe5fb47ba11f76cd67 Author: Kurt Nordback <[email protected]> AuthorDate: Mon Dec 29 13:36:25 2025 -0700 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 13 10:22:59 2026 +0100 tdf#165742 Step 5.2: Fix some round-trip failures Fix formula references in chartex data elements, and put in special handling for sunburst and treemap formula references (these two types, at least, require category references as well as value references). Change-Id: Id9a2b1c54559f0f19a39d3635ff314e5894a9f0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196316 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196928 diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx b/oox/source/drawingml/chart/datasourcecontext.cxx index d27b715dbbc7..2532b6ad866d 100644 --- a/oox/source/drawingml/chart/datasourcecontext.cxx +++ b/oox/source/drawingml/chart/datasourcecontext.cxx @@ -298,6 +298,7 @@ void StringSequenceContext::onCharacters( const OUString& rChars ) switch( getCurrentElement() ) { case C_TOKEN( f ): + case CX_TOKEN( f ): mrModel.maFormula = rChars; break; case C15_TOKEN( f ): diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx index c913aa31928e..ba0876e2222b 100644 --- a/oox/source/drawingml/chart/seriescontext.cxx +++ b/oox/source/drawingml/chart/seriescontext.cxx @@ -790,6 +790,7 @@ ContextHandlerRef ChartexSeriesContext::onCreateContext( sal_Int32 nElement, con return new DataLabelsContext( *this, mrModel.mxLabels.create(false) ); case CX_TOKEN( dataId ): mrModel.mnDataId = rAttribs.getInteger(XML_val, -1); + mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 ); return nullptr; case CX_TOKEN( layoutPr ): // This looks complicated. TODO diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 3b8cc5e99712..fa89b448f129 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1589,14 +1589,49 @@ void ChartExport::exportData_chartex( [[maybe_unused]] const Reference< css::cha // The data id needs to agree with the id in exportSeries(). See DATA_ID_COMMENT pFS->startElement(FSNS(XML_cx, XML_data), XML_id, OUString::number(nSeriesIndex)); - // .xlsx chartex files seem to have this magical "_xlchart.v2.0" string, + // .xlsx chartex files seem to have this magical "_xlchart..." string, // and no explicit data, while .docx and .pptx contain the literal data, // as well as a ../embeddings file (which LO doesn't seem to produce). // But there's probably a smarter way to determine which pathway to take // than based on document type. if (GetDocumentType() == DOCUMENT_XLSX) { // Just hard-coding this for now - pFS->startElement(FSNS(XML_cx, XML_numDim), XML_type, "val"); + + sal_Int32 nSuffixVal = nSeriesIndex; + + // Output category data formula for some chart types. + // (This is completely hacky) + if (eChartType == chart::TYPEID_SUNBURST || + eChartType == chart::TYPEID_TREEMAP) { + pFS->startElement(FSNS(XML_cx, XML_strDim), XML_type, "cat"); + pFS->startElement(FSNS(XML_cx, XML_f)); + + std::string sFormulaId = "_xlchart.v1."; + sFormulaId.append(std::to_string(nSuffixVal)); + + pFS->writeEscaped(sFormulaId); + + pFS->endElement(FSNS(XML_cx, XML_f)); + pFS->endElement(FSNS(XML_cx, XML_strDim)); + + ++nSuffixVal; + } + + // Set the ST_NumericDimensionType. For some (stupid?) + // reason, MSO requires the value data for sunburst and + // treemap to be type "size", while for most other chart + // types it's of type "val". + std::string sNumDimType; + if (eChartType == chart::TYPEID_SUNBURST || + eChartType == chart::TYPEID_TREEMAP) { + sNumDimType = "size"; + } else { + sNumDimType = "val"; + } + + // Now output value data formula + pFS->startElement(FSNS(XML_cx, XML_numDim), XML_type, + sNumDimType.c_str()); pFS->startElement(FSNS(XML_cx, XML_f)); // Set the formula value based on the chart type. This @@ -1627,7 +1662,7 @@ void ChartExport::exportData_chartex( [[maybe_unused]] const Reference< css::cha // Append the id value, which seems (?) to be what // follows the period in the string. E.g., for id=2 we // might end up with "_xlchart.v1.2" - sFormulaId.append(std::to_string(nSeriesIndex)); + sFormulaId.append(std::to_string(nSuffixVal)); pFS->writeEscaped(sFormulaId); commit 259cd508ccb43c931ee0b7489b4077f8fe379f7d Author: Kurt Nordback <[email protected]> AuthorDate: Fri Nov 21 09:57:20 2025 -0700 Commit: Andras Timar <[email protected]> CommitDate: Tue Jan 13 10:22:59 2026 +0100 tdf#165742 Step 5.1: Support basic I/O for additional chartex types Previous work on this project added support for Funnel charts, one of the chartex types. This commit expands that to all the other chartex types, including RegionMap. Largely this is parallel to what was done for Funnel, but there are some namespace differences, and ParetoLine requires some special handling because Microsoft Office seems to encode it as a combination of clusteredColumn type and paretoLine type. ParetoLine support is incomplete, especially on the export side. Change-Id: Ib751632ec05f3fbf248e0f194f7a6f36f2fa6a88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194933 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196927 diff --git a/chart2/Library_chart2.mk b/chart2/Library_chart2.mk index 187b640189f0..3cf268eeb9cb 100644 --- a/chart2/Library_chart2.mk +++ b/chart2/Library_chart2.mk @@ -308,6 +308,8 @@ $(eval $(call gb_Library_add_exception_objects,chart2,\ chart2/source/model/template/AreaChartTypeTemplate \ chart2/source/model/template/BarChartType \ chart2/source/model/template/BarChartTypeTemplate \ + chart2/source/model/template/BoxWhiskerChartType \ + chart2/source/model/template/BoxWhiskerChartTypeTemplate \ chart2/source/model/template/BubbleChartType \ chart2/source/model/template/BubbleChartTypeTemplate \ chart2/source/model/template/BubbleDataInterpreter \ @@ -315,6 +317,8 @@ $(eval $(call gb_Library_add_exception_objects,chart2,\ chart2/source/model/template/ChartType \ chart2/source/model/template/ChartTypeManager \ chart2/source/model/template/ChartTypeTemplate \ + chart2/source/model/template/ClusteredColumnChartType \ + chart2/source/model/template/ClusteredColumnChartTypeTemplate \ chart2/source/model/template/ColumnChartType \ chart2/source/model/template/ColumnLineChartTypeTemplate \ chart2/source/model/template/ColumnLineDataInterpreter \ @@ -326,12 +330,22 @@ $(eval $(call gb_Library_add_exception_objects,chart2,\ chart2/source/model/template/LineChartTypeTemplate \ chart2/source/model/template/NetChartType \ chart2/source/model/template/NetChartTypeTemplate \ + chart2/source/model/template/ParetoLineChartType \ + chart2/source/model/template/ParetoLineChartTypeTemplate \ chart2/source/model/template/PieChartType \ chart2/source/model/template/PieChartTypeTemplate \ + chart2/source/model/template/RegionMapChartType \ + chart2/source/model/template/RegionMapChartTypeTemplate \ chart2/source/model/template/ScatterChartType \ chart2/source/model/template/ScatterChartTypeTemplate \ + chart2/source/model/template/SunburstChartType \ + chart2/source/model/template/SunburstChartTypeTemplate \ chart2/source/model/template/StockChartTypeTemplate \ chart2/source/model/template/StockDataInterpreter \ + chart2/source/model/template/TreemapChartType \ + chart2/source/model/template/TreemapChartTypeTemplate \ + chart2/source/model/template/WaterfallChartType \ + chart2/source/model/template/WaterfallChartTypeTemplate \ chart2/source/model/template/XYDataInterpreter \ )) diff --git a/chart2/qa/extras/chart2export2.cxx b/chart2/qa/extras/chart2export2.cxx index 1be3ab2a3822..d28c87dcfef1 100644 --- a/chart2/qa/extras/chart2export2.cxx +++ b/chart2/qa/extras/chart2export2.cxx @@ -152,9 +152,32 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCrossBetweenODS) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartexTitleXLSX) { + xmlDocUniquePtr pXmlDoc; + + // ==== + loadFromFile(u"xlsx/boxWhisker.xlsx"); + save(TestFilter::XLSX); + pXmlDoc = parseExport(u"xl/charts/chartEx1.xml"_ustr); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", 3, 0, + "layoutId", u"boxWhisker"); + assertXPathContent(pXmlDoc, "/cx:chartSpace/cx:chart/cx:title/cx:tx/cx:txData/cx:v", + u"BoxWhisker"); + // ==== + loadFromFile(u"xlsx/clusteredColumn.xlsx"); + save(TestFilter::XLSX); + pXmlDoc = parseExport(u"xl/charts/chartEx1.xml"_ustr); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", + "layoutId", u"clusteredColumn"); + assertXPathContent(pXmlDoc, "/cx:chartSpace/cx:chart/cx:title/cx:tx/cx:txData/cx:v", + u"Clustered Column"); + // ==== loadFromFile(u"xlsx/funnel1.xlsx"); save(TestFilter::XLSX); - xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chartEx1.xml"_ustr); + pXmlDoc = parseExport(u"xl/charts/chartEx1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", @@ -166,6 +189,66 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartexTitleXLSX) "val", u"c55a11"); assertXPathContent(pXmlDoc, "/cx:chartSpace/cx:chart/cx:title/cx:tx/cx:txData/cx:v", u"Funnel chart!"); + + // ==== + loadFromFile(u"xlsx/paretoLine.xlsx"); + save(TestFilter::XLSX); + pXmlDoc = parseExport(u"xl/charts/chartEx1.xml"_ustr); + CPPUNIT_ASSERT(pXmlDoc); + +#if 0 + // This is what it really should be, based on MSO output + assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", + 2, 0, "layoutId", u"clusteredColumn"); + assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", + 2, 1, "layoutId", u"paretoLine"); +#else + // This is what LO currently produces + assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", 2, 0, + "layoutId", u"paretoLine"); +#endif + assertXPathContent(pXmlDoc, "/cx:chartSpace/cx:chart/cx:title/cx:tx/cx:txData/cx:v", + u"ParetoLine"); + // ==== + loadFromFile(u"xlsx/regionMap.xlsx"); + save(TestFilter::XLSX); + pXmlDoc = parseExport(u"xl/charts/chartEx1.xml"_ustr); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", + "layoutId", u"regionMap"); + assertXPathContent(pXmlDoc, "/cx:chartSpace/cx:chart/cx:title/cx:tx/cx:txData/cx:v", + u"RegionMap"); + // ==== + loadFromFile(u"xlsx/sunburst.xlsx"); + save(TestFilter::XLSX); + pXmlDoc = parseExport(u"xl/charts/chartEx1.xml"_ustr); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", + "layoutId", u"sunburst"); + assertXPathContent(pXmlDoc, "/cx:chartSpace/cx:chart/cx:title/cx:tx/cx:txData/cx:v", + u"Sunburst"); + // ==== + loadFromFile(u"xlsx/treemap.xlsx"); + save(TestFilter::XLSX); + pXmlDoc = parseExport(u"xl/charts/chartEx1.xml"_ustr); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", + "layoutId", u"treemap"); + assertXPathContent(pXmlDoc, "/cx:chartSpace/cx:chart/cx:title/cx:tx/cx:txData/cx:v", + u"Treemap"); + // ==== + loadFromFile(u"xlsx/waterfall.xlsx"); + save(TestFilter::XLSX); + pXmlDoc = parseExport(u"xl/charts/chartEx1.xml"_ustr); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/cx:chartSpace/cx:chart/cx:plotArea/cx:plotAreaRegion/cx:series", + "layoutId", u"waterfall"); + assertXPathContent(pXmlDoc, "/cx:chartSpace/cx:chart/cx:title/cx:tx/cx:txData/cx:v", + u"Waterfall"); } CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testChartexPPTX) diff --git a/chart2/qa/extras/data/xlsx/boxWhisker.xlsx b/chart2/qa/extras/data/xlsx/boxWhisker.xlsx new file mode 100644 index 000000000000..68b2b5be652b Binary files /dev/null and b/chart2/qa/extras/data/xlsx/boxWhisker.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/clusteredColumn.xlsx b/chart2/qa/extras/data/xlsx/clusteredColumn.xlsx new file mode 100644 index 000000000000..708fe47bba1c Binary files /dev/null and b/chart2/qa/extras/data/xlsx/clusteredColumn.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/paretoLine.xlsx b/chart2/qa/extras/data/xlsx/paretoLine.xlsx new file mode 100644 index 000000000000..0f4458cbc6da Binary files /dev/null and b/chart2/qa/extras/data/xlsx/paretoLine.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/regionMap.xlsx b/chart2/qa/extras/data/xlsx/regionMap.xlsx new file mode 100644 index 000000000000..55ff2b005e89 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/regionMap.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/sunburst.xlsx b/chart2/qa/extras/data/xlsx/sunburst.xlsx new file mode 100644 index 000000000000..010ea1054a17 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/sunburst.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/treemap.xlsx b/chart2/qa/extras/data/xlsx/treemap.xlsx new file mode 100644 index 000000000000..52f98fab9bd0 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/treemap.xlsx differ diff --git a/chart2/qa/extras/data/xlsx/waterfall.xlsx b/chart2/qa/extras/data/xlsx/waterfall.xlsx new file mode 100644 index 000000000000..c810d9490823 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/waterfall.xlsx differ diff --git a/chart2/source/chart2.component b/chart2/source/chart2.component index 5e41ddf69b1a..4f1fcb92ed0d 100644 --- a/chart2/source/chart2.component +++ b/chart2/source/chart2.component @@ -116,6 +116,11 @@ <service name="com.sun.star.chart2.BarChartType"/> <service name="com.sun.star.chart2.ChartType"/> </implementation> + <implementation name="com.sun.star.comp.chart.BoxWhiskerChartType" + constructor="com_sun_star_comp_chart_BoxWhiskerChartType_get_implementation"> + <service name="com.sun.star.chart2.ChartType"/> + <service name="com.sun.star.chart2.BoxWhiskerChartType"/> + </implementation> <implementation name="com.sun.star.comp.chart.BubbleChartType" constructor="com_sun_star_comp_chart_BubbleChartType_get_implementation"> <service name="com.sun.star.beans.PropertySet"/> @@ -132,6 +137,11 @@ constructor="com_sun_star_comp_chart_ChartTypeManager_get_implementation"> <service name="com.sun.star.chart2.ChartTypeManager"/> </implementation> + <implementation name="com.sun.star.comp.chart.ClusteredColumnChartType" + constructor="com_sun_star_comp_chart_ClusteredColumnChartType_get_implementation"> + <service name="com.sun.star.chart2.ChartType"/> + <service name="com.sun.star.chart2.ClusteredColumnChartType"/> + </implementation> <implementation name="com.sun.star.comp.chart.ColumnChartType" constructor="com_sun_star_comp_chart_ColumnChartType_get_implementation"> <service name="com.sun.star.chart2.ChartType"/> @@ -172,18 +182,43 @@ <service name="com.sun.star.chart2.ChartType"/> <service name="com.sun.star.chart2.NetChartType"/> </implementation> + <implementation name="com.sun.star.comp.chart.ParetoLineChartType" + constructor="com_sun_star_comp_chart_ParetoLineChartType_get_implementation"> + <service name="com.sun.star.chart2.ChartType"/> + <service name="com.sun.star.chart2.ParetoLineChartType"/> + </implementation> <implementation name="com.sun.star.comp.chart.PieChartType" constructor="com_sun_star_comp_chart_PieChartType_get_implementation"> <service name="com.sun.star.beans.PropertySet"/> <service name="com.sun.star.chart2.ChartType"/> <service name="com.sun.star.chart2.PieChartType"/> </implementation> + <implementation name="com.sun.star.comp.chart.RegionMapChartType" + constructor="com_sun_star_comp_chart_RegionMapChartType_get_implementation"> + <service name="com.sun.star.chart2.ChartType"/> + <service name="com.sun.star.chart2.RegionMapChartType"/> + </implementation> <implementation name="com.sun.star.comp.chart.ScatterChartType" constructor="com_sun_star_comp_chart_ScatterChartType_get_implementation"> <service name="com.sun.star.beans.PropertySet"/> <service name="com.sun.star.chart2.ChartType"/> <service name="com.sun.star.chart2.ScatterChartType"/> </implementation> + <implementation name="com.sun.star.comp.chart.SunburstChartType" + constructor="com_sun_star_comp_chart_SunburstChartType_get_implementation"> + <service name="com.sun.star.chart2.ChartType"/> + <service name="com.sun.star.chart2.SunburstChartType"/> + </implementation> + <implementation name="com.sun.star.comp.chart.TreemapChartType" + constructor="com_sun_star_comp_chart_TreemapChartType_get_implementation"> + <service name="com.sun.star.chart2.ChartType"/> + <service name="com.sun.star.chart2.TreemapChartType"/> + </implementation> + <implementation name="com.sun.star.comp.chart.WaterfallChartType" + constructor="com_sun_star_comp_chart_WaterfallChartType_get_implementation"> + <service name="com.sun.star.chart2.ChartType"/> + <service name="com.sun.star.chart2.WaterfallChartType"/> + </implementation> <implementation name="com.sun.star.comp.chart2.Axis" constructor="com_sun_star_comp_chart2_Axis_get_implementation"> <service name="com.sun.star.beans.PropertySet"/> diff --git a/chart2/source/controller/dialogs/ChartResourceGroups.cxx b/chart2/source/controller/dialogs/ChartResourceGroups.cxx index b344a1fda3c8..9d4f1099f59b 100644 --- a/chart2/source/controller/dialogs/ChartResourceGroups.cxx +++ b/chart2/source/controller/dialogs/ChartResourceGroups.cxx @@ -34,6 +34,7 @@ Dim3DLookResourceGroup::Dim3DLookResourceGroup(weld::Builder* pBuilder) { m_xCB_3DLook->connect_toggled(LINK(this, Dim3DLookResourceGroup, Dim3DLookCheckHdl)); m_xLB_Scheme->connect_changed(LINK(this, Dim3DLookResourceGroup, SelectSchemeHdl)); + m_xCB_3DLook->set_active(false); } void Dim3DLookResourceGroup::showControls(bool bShow) diff --git a/chart2/source/inc/servicenames_charttypes.hxx b/chart2/source/inc/servicenames_charttypes.hxx index 5a84e3b92c0c..22e9f446a996 100644 --- a/chart2/source/inc/servicenames_charttypes.hxx +++ b/chart2/source/inc/servicenames_charttypes.hxx @@ -40,7 +40,21 @@ inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK = u"com.sun.star.chart2.CandleStickChartType"_ustr; inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE = u"com.sun.star.chart2.BubbleChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_BOXWHISKER + = u"com.sun.star.chart2.BoxWhiskerChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_CLUSTEREDCOLUMN + = u"com.sun.star.chart2.ClusteredColumnChartType"_ustr; inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_FUNNEL = u"com.sun.star.chart2.FunnelChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_PARETOLINE + = u"com.sun.star.chart2.ParetoLineChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_REGIONMAP + = u"com.sun.star.chart2.RegionMapChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_SUNBURST + = u"com.sun.star.chart2.SunburstChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_TREEMAP + = u"com.sun.star.chart2.TreemapChartType"_ustr; +inline constexpr OUString CHART2_SERVICE_NAME_CHARTTYPE_WATERFALL + = u"com.sun.star.chart2.WaterfallChartType"_ustr; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/BoxWhiskerChartType.cxx b/chart2/source/model/template/BoxWhiskerChartType.cxx new file mode 100644 index 000000000000..02847c668107 --- /dev/null +++ b/chart2/source/model/template/BoxWhiskerChartType.cxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "BoxWhiskerChartType.hxx" +#include <servicenames_charttypes.hxx> +#include <cppuhelper/supportsservice.hxx> + +namespace com::sun::star::uno +{ +class XComponentContext; +} + +using namespace ::com::sun::star; + +namespace chart +{ +BoxWhiskerChartType::BoxWhiskerChartType() {} + +BoxWhiskerChartType::BoxWhiskerChartType(const BoxWhiskerChartType& rOther) + : ChartType(rOther) +{ +} + +BoxWhiskerChartType::~BoxWhiskerChartType() {} + +// ____ XCloneable ____ +uno::Reference<util::XCloneable> SAL_CALL BoxWhiskerChartType::createClone() +{ + return uno::Reference<util::XCloneable>(new BoxWhiskerChartType(*this)); +} + +rtl::Reference<ChartType> BoxWhiskerChartType::cloneChartType() const +{ + return new BoxWhiskerChartType(*this); +} + +// ____ XChartType ____ +OUString SAL_CALL BoxWhiskerChartType::getChartType() +{ + return CHART2_SERVICE_NAME_CHARTTYPE_BOXWHISKER; +} + +uno::Sequence<OUString> BoxWhiskerChartType::getSupportedPropertyRoles() +{ + return { "FillColor", "BorderColor" }; +} + +OUString SAL_CALL BoxWhiskerChartType::getImplementationName() +{ + return "com.sun.star.comp.chart.BoxWhiskerChartType"; +} + +sal_Bool SAL_CALL BoxWhiskerChartType::supportsService(const OUString& rServiceName) +{ + return cppu::supportsService(this, rServiceName); +} + +css::uno::Sequence<OUString> SAL_CALL BoxWhiskerChartType::getSupportedServiceNames() +{ + return { CHART2_SERVICE_NAME_CHARTTYPE_BOXWHISKER, "com.sun.star.chart2.ChartType" }; +} + +} // namespace chart + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_chart_BoxWhiskerChartType_get_implementation( + css::uno::XComponentContext* /*context*/, css::uno::Sequence<css::uno::Any> const&) +{ + return cppu::acquire(new ::chart::BoxWhiskerChartType); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/BoxWhiskerChartType.hxx b/chart2/source/model/template/BoxWhiskerChartType.hxx new file mode 100644 index 000000000000..76a25d3fba0f --- /dev/null +++ b/chart2/source/model/template/BoxWhiskerChartType.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#pragma once + +#include <ChartType.hxx> + +namespace chart +{ +class BoxWhiskerChartType final : public ChartType +{ +public: + explicit BoxWhiskerChartType(); + virtual ~BoxWhiskerChartType() override; + + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; + + virtual rtl::Reference<ChartType> cloneChartType() const override; + +private: + explicit BoxWhiskerChartType(const BoxWhiskerChartType& rOther); + + // ____ XChartType ____ + virtual OUString SAL_CALL getChartType() override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedPropertyRoles() override; + + // ____ XCloneable ____ + virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() override; +}; + +} // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/BoxWhiskerChartTypeTemplate.cxx b/chart2/source/model/template/BoxWhiskerChartTypeTemplate.cxx new file mode 100644 index 000000000000..116321b53dd4 --- /dev/null +++ b/chart2/source/model/template/BoxWhiskerChartTypeTemplate.cxx @@ -0,0 +1,191 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "BoxWhiskerChartTypeTemplate.hxx" +#include "BoxWhiskerChartType.hxx" +#include <Diagram.hxx> +#include <DataSeries.hxx> +#include <DataSeriesHelper.hxx> +#include <PropertyHelper.hxx> +#include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/drawing/LineStyle.hpp> +#include <com/sun/star/chart2/DataPointGeometry3D.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <comphelper/diagnose_ex.hxx> + +#include <algorithm> + +using namespace ::com::sun::star; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::beans::Property; + +namespace +{ +enum +{ + PROP_BOXWHISKER_TEMPLATE_DIMENSION, + PROP_BOXWHISKER_TEMPLATE_GEOMETRY3D +}; + +void lcl_AddPropertiesToVector(std::vector<Property>& rOutProperties) +{ + rOutProperties.emplace_back( + "Dimension", PROP_BOXWHISKER_TEMPLATE_DIMENSION, cppu::UnoType<sal_Int32>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT); + rOutProperties.emplace_back( + "Geometry3D", PROP_BOXWHISKER_TEMPLATE_GEOMETRY3D, cppu::UnoType<sal_Int32>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT); +} + +::cppu::OPropertyArrayHelper& StaticBoxWhiskerChartTypeTemplateInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aPropHelper = []() { + std::vector<css::beans::Property> aProperties; + lcl_AddPropertiesToVector(aProperties); + + std::sort(aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess()); + + return comphelper::containerToSequence(aProperties); + }(); + return aPropHelper; +}; + +} // anonymous namespace + +namespace chart +{ +BoxWhiskerChartTypeTemplate::BoxWhiskerChartTypeTemplate( + Reference<uno::XComponentContext> const& xContext, const OUString& rServiceName, + sal_Int32 nDim /* = 2 */) + : ChartTypeTemplate(xContext, rServiceName) + , m_nDim(nDim) +{ +} + +BoxWhiskerChartTypeTemplate::~BoxWhiskerChartTypeTemplate() {} + +sal_Int32 BoxWhiskerChartTypeTemplate::getDimension() const { return m_nDim; } + +// ____ ChartTypeTemplate ____ +bool BoxWhiskerChartTypeTemplate::matchesTemplate2(const rtl::Reference<::chart::Diagram>& xDiagram, + bool bAdaptProperties) +{ + bool bResult = ChartTypeTemplate::matchesTemplate2(xDiagram, bAdaptProperties); + + // adapt solid-type of template according to values in series + if (bAdaptProperties && bResult && getDimension() == 3) + { + bool bGeomFound = false, bGeomAmbiguous = false; + sal_Int32 aCommonGeom = xDiagram->getGeometry3D(bGeomFound, bGeomAmbiguous); + + if (!bGeomAmbiguous) + { + setFastPropertyValue_NoBroadcast(PROP_BOXWHISKER_TEMPLATE_GEOMETRY3D, + uno::Any(aCommonGeom)); + } + } + + return bResult; +} + +rtl::Reference<ChartType> + BoxWhiskerChartTypeTemplate::getChartTypeForIndex(sal_Int32 /*nChartTypeIndex*/) +{ + return new BoxWhiskerChartType(); +} + +rtl::Reference<ChartType> BoxWhiskerChartTypeTemplate::getChartTypeForNewSeries2( + const std::vector<rtl::Reference<ChartType>>& aFormerlyUsedChartTypes) +{ + rtl::Reference<ChartType> xResult(getChartTypeForIndex(0)); + ChartTypeTemplate::copyPropertiesFromOldToNewCoordinateSystem(aFormerlyUsedChartTypes, xResult); + return xResult; +} + +// ____ OPropertySet ____ +void BoxWhiskerChartTypeTemplate::GetDefaultValue(sal_Int32 nHandle, uno::Any& rAny) const +{ + static ::chart::tPropertyValueMap aStaticDefaults = []() { + ::chart::tPropertyValueMap aTmp; + ::chart::PropertyHelper::setPropertyValueDefault<sal_Int32>( + aTmp, PROP_BOXWHISKER_TEMPLATE_DIMENSION, 2); + ::chart::PropertyHelper::setPropertyValueDefault(aTmp, PROP_BOXWHISKER_TEMPLATE_GEOMETRY3D, + ::chart2::DataPointGeometry3D::CUBOID); + return aTmp; + }(); + tPropertyValueMap::const_iterator aFound(aStaticDefaults.find(nHandle)); + if (aFound == aStaticDefaults.end()) + rAny.clear(); + else + rAny = (*aFound).second; +} + +::cppu::IPropertyArrayHelper& SAL_CALL BoxWhiskerChartTypeTemplate::getInfoHelper() +{ + return StaticBoxWhiskerChartTypeTemplateInfoHelper(); +} + +// ____ XPropertySet ____ +Reference<beans::XPropertySetInfo> SAL_CALL BoxWhiskerChartTypeTemplate::getPropertySetInfo() +{ + static uno::Reference<beans::XPropertySetInfo> xPropertySetInfo( + ::cppu::OPropertySetHelper::createPropertySetInfo( + StaticBoxWhiskerChartTypeTemplateInfoHelper())); + return xPropertySetInfo; +} + +void BoxWhiskerChartTypeTemplate::applyStyle2(const rtl::Reference<DataSeries>& xSeries, + ::sal_Int32 nChartTypeIndex, ::sal_Int32 nSeriesIndex, + ::sal_Int32 nSeriesCount) +{ + ChartTypeTemplate::applyStyle2(xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount); + xSeries->setPropertyAlsoToAllAttributedDataPoints("BorderStyle", + uno::Any(drawing::LineStyle_NONE)); + if (getDimension() != 3) + return; + + try + { + //apply Geometry3D + uno::Any aAGeometry3D; + getFastPropertyValue(aAGeometry3D, PROP_BOXWHISKER_TEMPLATE_GEOMETRY3D); + xSeries->setPropertyAlsoToAllAttributedDataPoints("Geometry3D", aAGeometry3D); + } + catch (const uno::Exception&) + { + DBG_UNHANDLED_EXCEPTION("chart2"); + } +} + +void BoxWhiskerChartTypeTemplate::resetStyles2(const rtl::Reference<::chart::Diagram>& xDiagram) +{ + ChartTypeTemplate::resetStyles2(xDiagram); + std::vector<rtl::Reference<DataSeries>> aSeriesVec(xDiagram->getDataSeries()); + uno::Any aLineStyleAny(drawing::LineStyle_NONE); + for (auto const& series : aSeriesVec) + { + if (getDimension() == 3) + series->setPropertyToDefault("Geometry3D"); + if (series->getPropertyValue("BorderStyle") == aLineStyleAny) + { + series->setPropertyToDefault("BorderStyle"); + } + } + + xDiagram->setVertical(false); +} + +IMPLEMENT_FORWARD_XINTERFACE2(BoxWhiskerChartTypeTemplate, ChartTypeTemplate, OPropertySet) +IMPLEMENT_FORWARD_XTYPEPROVIDER2(BoxWhiskerChartTypeTemplate, ChartTypeTemplate, OPropertySet) + +} // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/BoxWhiskerChartTypeTemplate.hxx b/chart2/source/model/template/BoxWhiskerChartTypeTemplate.hxx new file mode 100644 index 000000000000..a6721483ea16 --- /dev/null +++ b/chart2/source/model/template/BoxWhiskerChartTypeTemplate.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#pragma once + +#include <OPropertySet.hxx> +#include <comphelper/uno3.hxx> + +#include <ChartTypeTemplate.hxx> + +namespace chart +{ +class BoxWhiskerChartTypeTemplate : public ChartTypeTemplate, public ::property::OPropertySet +{ +public: + BoxWhiskerChartTypeTemplate(css::uno::Reference<css::uno::XComponentContext> const& xContext, + const OUString& rServiceName, sal_Int32 nDim = 2); + virtual ~BoxWhiskerChartTypeTemplate() override; + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +protected: + // ____ OPropertySet ____ + virtual void GetDefaultValue(sal_Int32 nHandle, css::uno::Any& rAny) const override; + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + + // ____ XPropertySet ____ + virtual css::uno::Reference<css::beans::XPropertySetInfo> + SAL_CALL getPropertySetInfo() override; + + // ____ ChartTypeTemplate ____ + virtual bool matchesTemplate2(const rtl::Reference<::chart::Diagram>& xDiagram, + bool bAdaptProperties) override; + virtual rtl::Reference<::chart::ChartType> getChartTypeForNewSeries2( + const std::vector<rtl::Reference<::chart::ChartType>>& aFormerlyUsedChartTypes) override; + virtual void applyStyle2(const rtl::Reference<::chart::DataSeries>& xSeries, + ::sal_Int32 nChartTypeGroupIndex, ::sal_Int32 nSeriesIndex, + ::sal_Int32 nSeriesCount) override; + virtual void resetStyles2(const rtl::Reference<::chart::Diagram>& xDiagram) override; + + // ____ ChartTypeTemplate ____ + virtual sal_Int32 getDimension() const override; + + virtual rtl::Reference<::chart::ChartType> + getChartTypeForIndex(sal_Int32 nChartTypeIndex) override; + +private: + sal_Int32 m_nDim; +}; + +} // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx index 7acb02a6c894..89cb3518ff3f 100644 --- a/chart2/source/model/template/ChartTypeManager.cxx +++ b/chart2/source/model/template/ChartTypeManager.cxx @@ -30,6 +30,13 @@ #include "NetChartTypeTemplate.hxx" #include "BubbleChartTypeTemplate.hxx" #include "FunnelChartTypeTemplate.hxx" +#include "BoxWhiskerChartTypeTemplate.hxx" +#include "ClusteredColumnChartTypeTemplate.hxx" +#include "ParetoLineChartTypeTemplate.hxx" +#include "RegionMapChartTypeTemplate.hxx" +#include "SunburstChartTypeTemplate.hxx" +#include "TreemapChartTypeTemplate.hxx" +#include "WaterfallChartTypeTemplate.hxx" #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/container/XContentEnumerationAccess.hpp> #include <com/sun/star/lang/XServiceName.hpp> @@ -118,6 +125,13 @@ enum TemplateId TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE, TEMPLATE_BUBBLE, TEMPLATE_FUNNEL, + TEMPLATE_BOXWHISKER, + TEMPLATE_CLUSTEREDCOLUMN, + TEMPLATE_PARETOLINE, + TEMPLATE_REGIONMAP, + TEMPLATE_SUNBURST, + TEMPLATE_TREEMAP, + TEMPLATE_WATERFALL, // TEMPLATE_SURFACE, // TEMPLATE_ADDIN, TEMPLATE_NOT_FOUND = 0xffff @@ -196,6 +210,13 @@ const tTemplateMapType & lcl_DefaultChartTypeMap() {"com.sun.star.chart2.template.StockVolumeOpenLowHighClose", TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE}, {"com.sun.star.chart2.template.Bubble", TEMPLATE_BUBBLE}, {"com.sun.star.chart2.template.Funnel", TEMPLATE_FUNNEL}, + {"com.sun.star.chart2.template.BoxWhisker", TEMPLATE_BOXWHISKER}, + {"com.sun.star.chart2.template.ClusteredColumn", TEMPLATE_CLUSTEREDCOLUMN}, + {"com.sun.star.chart2.template.ParetoLine", TEMPLATE_PARETOLINE}, + {"com.sun.star.chart2.template.RegionMap", TEMPLATE_REGIONMAP}, + {"com.sun.star.chart2.template.Sunburst", TEMPLATE_SUNBURST}, + {"com.sun.star.chart2.template.Treemap", TEMPLATE_TREEMAP}, + {"com.sun.star.chart2.template.Waterfall", TEMPLATE_WATERFALL}, // {"com.sun.star.chart2.template.Surface", TEMPLATE_SURFACE}, // {"com.sun.star.chart2.template.Addin", TEMPLATE_ADDIN}, }; @@ -532,6 +553,34 @@ rtl::Reference< ::chart::ChartTypeTemplate > ChartTypeManager::createTemplate( xTemplate.set( new FunnelChartTypeTemplate( m_xContext, aServiceSpecifier)); break; + case TEMPLATE_BOXWHISKER: + xTemplate.set( new BoxWhiskerChartTypeTemplate( m_xContext, + aServiceSpecifier)); + break; + case TEMPLATE_CLUSTEREDCOLUMN: + xTemplate.set( new ClusteredColumnChartTypeTemplate( m_xContext, + aServiceSpecifier)); + break; + case TEMPLATE_PARETOLINE: + xTemplate.set( new ParetoLineChartTypeTemplate( m_xContext, + aServiceSpecifier)); + break; + case TEMPLATE_REGIONMAP: + xTemplate.set( new RegionMapChartTypeTemplate( m_xContext, + aServiceSpecifier)); + break; + case TEMPLATE_SUNBURST: + xTemplate.set( new SunburstChartTypeTemplate( m_xContext, + aServiceSpecifier)); + break; + case TEMPLATE_TREEMAP: + xTemplate.set( new TreemapChartTypeTemplate( m_xContext, + aServiceSpecifier)); + break; + case TEMPLATE_WATERFALL: + xTemplate.set( new WaterfallChartTypeTemplate( m_xContext, + aServiceSpecifier)); + break; case TEMPLATE_NOT_FOUND: SAL_WARN("chart2", "Couldn't instantiate service: "<< aServiceSpecifier ); assert(false); diff --git a/chart2/source/model/template/ClusteredColumnChartType.cxx b/chart2/source/model/template/ClusteredColumnChartType.cxx new file mode 100644 index 000000000000..618286b894f8 --- /dev/null +++ b/chart2/source/model/template/ClusteredColumnChartType.cxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "ClusteredColumnChartType.hxx" +#include <servicenames_charttypes.hxx> +#include <cppuhelper/supportsservice.hxx> + +namespace com::sun::star::uno +{ +class XComponentContext; +} + +using namespace ::com::sun::star; + +namespace chart +{ +ClusteredColumnChartType::ClusteredColumnChartType() {} + +ClusteredColumnChartType::ClusteredColumnChartType(const ClusteredColumnChartType& rOther) + : ChartType(rOther) +{ +} + +ClusteredColumnChartType::~ClusteredColumnChartType() {} + +// ____ XCloneable ____ +uno::Reference<util::XCloneable> SAL_CALL ClusteredColumnChartType::createClone() +{ + return uno::Reference<util::XCloneable>(new ClusteredColumnChartType(*this)); +} + +rtl::Reference<ChartType> ClusteredColumnChartType::cloneChartType() const +{ + return new ClusteredColumnChartType(*this); +} + +// ____ XChartType ____ +OUString SAL_CALL ClusteredColumnChartType::getChartType() +{ + return CHART2_SERVICE_NAME_CHARTTYPE_CLUSTEREDCOLUMN; +} + +uno::Sequence<OUString> ClusteredColumnChartType::getSupportedPropertyRoles() +{ + return { "FillColor", "BorderColor" }; +} + +OUString SAL_CALL ClusteredColumnChartType::getImplementationName() +{ + return "com.sun.star.comp.chart.ClusteredColumnChartType"; +} + +sal_Bool SAL_CALL ClusteredColumnChartType::supportsService(const OUString& rServiceName) +{ + return cppu::supportsService(this, rServiceName); +} + +css::uno::Sequence<OUString> SAL_CALL ClusteredColumnChartType::getSupportedServiceNames() +{ + return { CHART2_SERVICE_NAME_CHARTTYPE_CLUSTEREDCOLUMN, "com.sun.star.chart2.ChartType" }; +} + +} // namespace chart + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_chart_ClusteredColumnChartType_get_implementation( + css::uno::XComponentContext* /*context*/, css::uno::Sequence<css::uno::Any> const&) +{ + return cppu::acquire(new ::chart::ClusteredColumnChartType); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/ClusteredColumnChartType.hxx b/chart2/source/model/template/ClusteredColumnChartType.hxx new file mode 100644 index 000000000000..d60d7753afa5 --- /dev/null +++ b/chart2/source/model/template/ClusteredColumnChartType.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#pragma once + +#include <ChartType.hxx> + +namespace chart +{ +class ClusteredColumnChartType final : public ChartType +{ +public: + explicit ClusteredColumnChartType(); + virtual ~ClusteredColumnChartType() override; + + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; + + virtual rtl::Reference<ChartType> cloneChartType() const override; + +private: + explicit ClusteredColumnChartType(const ClusteredColumnChartType& rOther); + + // ____ XChartType ____ + virtual OUString SAL_CALL getChartType() override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedPropertyRoles() override; + + // ____ XCloneable ____ + virtual css::uno::Reference<css::util::XCloneable> SAL_CALL createClone() override; +}; + +} // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/ClusteredColumnChartTypeTemplate.cxx b/chart2/source/model/template/ClusteredColumnChartTypeTemplate.cxx new file mode 100644 index 000000000000..355c14e1ce05 --- /dev/null +++ b/chart2/source/model/template/ClusteredColumnChartTypeTemplate.cxx @@ -0,0 +1,193 @@ -e ... etc. - the rest is truncated
