chart2/qa/extras/chart2export2.cxx | 11 ---- chart2/qa/extras/chart2import.cxx | 31 ------------ chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | 10 --- chart2/source/model/main/Diagram.cxx | 7 -- dev/null |binary oox/inc/drawingml/chart/chartspacemodel.hxx | 1 oox/inc/drawingml/linepropertiescontext.hxx | 3 - oox/inc/drawingml/shapepropertiescontext.hxx | 4 - oox/source/drawingml/chart/chartspaceconverter.cxx | 7 -- oox/source/drawingml/chart/chartspacefragment.cxx | 1 oox/source/drawingml/chart/chartspacemodel.cxx | 1 oox/source/drawingml/chart/seriescontext.cxx | 3 - oox/source/drawingml/linepropertiescontext.cxx | 11 ---- oox/source/drawingml/shapepropertiescontext.cxx | 5 - oox/source/export/chartexport.cxx | 18 ------ oox/source/token/properties.txt | 1 oox/source/token/tokens.txt | 1 17 files changed, 10 insertions(+), 105 deletions(-)
New commits: commit 685c6a9e2896d020a258847537395993d44347d8 Author: Kurt Nordback <[email protected]> AuthorDate: Wed Jan 21 17:48:38 2026 -0700 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Mon Jan 26 11:56:49 2026 +0100 Revert "tdf#165742 Step 4.6: Establish a narrow export path for chartex" This reverts commit c2f99456df678356d036385869ef73205a5f41c1. Change-Id: I20978f013c8a050cea978ff8d37b42449f403720 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197900 Reviewed-by: Tomaž Vajngerl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 9f0abcd4c146..efcb9bf44d35 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -1219,37 +1219,6 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testNumberFormatsDOCX) } } -CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testShapePropsDefaultStrokeWidthXLSX) -{ - // Bar chart, for which rendering code is implemented - loadFromFile(u"xlsx/bartest-stroke.xlsx"); - { - uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0); - CPPUNIT_ASSERT(xChartDoc.is()); - - css::uno::Reference<chart2::XDiagram> xDiagram(xChartDoc->getFirstDiagram(), UNO_SET_THROW); - Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); - uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xPropertySet.is()); - sal_Int32 nWidth = xPropertySet->getPropertyValue(u"BorderWidth"_ustr).get<sal_Int32>(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Default bar stroke width should be 12700 emu (0.35mm)", sal_Int32(35), nWidth); - } - - // Funnel chart, for which rendering code is not yet implemented - loadFromFile(u"xlsx/color_funnel.xlsx"); - { - uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0); - CPPUNIT_ASSERT(xChartDoc.is()); - - css::uno::Reference<chart2::XDiagram> xDiagram(xChartDoc->getFirstDiagram(), UNO_SET_THROW); - Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0); - uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(xPropertySet.is()); - sal_Int32 nWidth = xPropertySet->getPropertyValue(u"BorderWidth"_ustr).get<sal_Int32>(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Default bar stroke width should be 12700 emu (0.35mm)", sal_Int32(35), nWidth); - } -} - CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testPercentageNumberFormatsDOCX) { loadFromFile(u"docx/tdf133632.docx"); diff --git a/chart2/qa/extras/data/xlsx/bartest-stroke.xlsx b/chart2/qa/extras/data/xlsx/bartest-stroke.xlsx deleted file mode 100644 index de8f59afe830..000000000000 Binary files a/chart2/qa/extras/data/xlsx/bartest-stroke.xlsx and /dev/null differ diff --git a/chart2/qa/extras/data/xlsx/color_funnel.xlsx b/chart2/qa/extras/data/xlsx/color_funnel.xlsx deleted file mode 100644 index 80d16d5d1b84..000000000000 Binary files a/chart2/qa/extras/data/xlsx/color_funnel.xlsx and /dev/null differ diff --git a/oox/inc/drawingml/linepropertiescontext.hxx b/oox/inc/drawingml/linepropertiescontext.hxx index 3617bffb8a75..041f50bf0d73 100644 --- a/oox/inc/drawingml/linepropertiescontext.hxx +++ b/oox/inc/drawingml/linepropertiescontext.hxx @@ -33,8 +33,7 @@ class LinePropertiesContext final : public ::oox::core::ContextHandler2 { public: LinePropertiesContext(::oox::core::ContextHandler2Helper const & rParent, const ::oox::AttributeList& rAttributes, - LineProperties& rLineProperties, model::LineStyle* pLineStyle = nullptr, - bool bForChart = false) noexcept; + LineProperties& rLineProperties, model::LineStyle* pLineStyle = nullptr) noexcept; virtual ~LinePropertiesContext() override; virtual ::oox::core::ContextHandlerRef diff --git a/oox/inc/drawingml/shapepropertiescontext.hxx b/oox/inc/drawingml/shapepropertiescontext.hxx index e8f0afb3bc03..9d047c15c224 100644 --- a/oox/inc/drawingml/shapepropertiescontext.hxx +++ b/oox/inc/drawingml/shapepropertiescontext.hxx @@ -28,15 +28,13 @@ namespace oox::drawingml class ShapePropertiesContext : public ::oox::core::ContextHandler2 { public: - ShapePropertiesContext(::oox::core::ContextHandler2Helper const& rParent, Shape& rShape, - bool bForChart = false); + ShapePropertiesContext(::oox::core::ContextHandler2Helper const& rParent, Shape& rShape); virtual ::oox::core::ContextHandlerRef onCreateContext(::sal_Int32 Element, const ::oox::AttributeList& rAttribs) override; protected: Shape& mrShape; - bool mbForChart; }; } diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx index 88688642bebe..4b3d18624c8c 100644 --- a/oox/source/drawingml/chart/seriescontext.cxx +++ b/oox/source/drawingml/chart/seriescontext.cxx @@ -421,8 +421,7 @@ ContextHandlerRef SeriesContextBase::onCreateContext( sal_Int32 nElement, const return nullptr; case C_TOKEN( spPr ): case CX_TOKEN( spPr ): - return new ShapePropertiesContext( *this, - mrModel.mxShapeProp.create(), true ); + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); case C_TOKEN( tx ): case CX_TOKEN( tx ): return new TextContext( *this, mrModel.mxText.create() ); diff --git a/oox/source/drawingml/linepropertiescontext.cxx b/oox/source/drawingml/linepropertiescontext.cxx index 00d2d50a093d..5a4c1fe449b8 100644 --- a/oox/source/drawingml/linepropertiescontext.cxx +++ b/oox/source/drawingml/linepropertiescontext.cxx @@ -32,19 +32,12 @@ using namespace ::oox::core; namespace oox::drawingml { LinePropertiesContext::LinePropertiesContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, - LineProperties& rLineProperties, model::LineStyle* pLineStyle, - bool bForChart) noexcept + LineProperties& rLineProperties, model::LineStyle* pLineStyle) noexcept : ContextHandler2(rParent) , mpLineStyle(pLineStyle) , mrLineProperties(rLineProperties) { - if (bForChart) { - // If width is not specified, then charts seem to assume a default line - // width of 12700 emu - mrLineProperties.moLineWidth = rAttribs.getInteger( XML_w, 12700 ); - } else { - mrLineProperties.moLineWidth = rAttribs.getInteger( XML_w ); - } + mrLineProperties.moLineWidth = rAttribs.getInteger( XML_w ); mrLineProperties.moLineCompound = rAttribs.getToken( XML_cmpd ); mrLineProperties.moLineCap = rAttribs.getToken( XML_cap ); diff --git a/oox/source/drawingml/shapepropertiescontext.cxx b/oox/source/drawingml/shapepropertiescontext.cxx index 619f19ed3387..3a9e474ba931 100644 --- a/oox/source/drawingml/shapepropertiescontext.cxx +++ b/oox/source/drawingml/shapepropertiescontext.cxx @@ -38,10 +38,9 @@ using namespace ::com::sun::star::drawing; namespace oox::drawingml { // CT_ShapeProperties -ShapePropertiesContext::ShapePropertiesContext( ContextHandler2Helper const & rParent, Shape& rShape, bool bForChart ) +ShapePropertiesContext::ShapePropertiesContext( ContextHandler2Helper const & rParent, Shape& rShape ) : ContextHandler2( rParent ) , mrShape( rShape ) -, mbForChart(bForChart) { } @@ -77,7 +76,7 @@ ContextHandlerRef ShapePropertiesContext::onCreateContext( sal_Int32 aElementTok // CT_LineProperties case A_TOKEN( ln ): - return new LinePropertiesContext( *this, rAttribs, mrShape.getLineProperties(), nullptr, mbForChart ); + return new LinePropertiesContext( *this, rAttribs, mrShape.getLineProperties() ); // EffectPropertiesGroup // todo not supported by core diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt index c54e350721db..fc8676a16195 100644 --- a/oox/source/token/tokens.txt +++ b/oox/source/token/tokens.txt @@ -5060,7 +5060,6 @@ stored stp str strCache -strDim strLit strRef strVal commit ca847e5c293318826bc468eb948b813e3d145d46 Author: Kurt Nordback <[email protected]> AuthorDate: Wed Jan 21 17:09:30 2026 -0700 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Mon Jan 26 11:56:37 2026 +0100 Revert "tdf#167368 - Chart style index is not exported to OOXML" This reverts commit 38fb2f70fe833be87ca14a1cee653f40c37b7f9a. Change-Id: Id79609018477dbfe767d185bc51d206cebe5274e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197899 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Tomaž Vajngerl <[email protected]> diff --git a/chart2/qa/extras/chart2export2.cxx b/chart2/qa/extras/chart2export2.cxx index 000dfcf90038..9f3235f098f1 100644 --- a/chart2/qa/extras/chart2export2.cxx +++ b/chart2/qa/extras/chart2export2.cxx @@ -944,17 +944,6 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testTdf123206_customLabelText) u"kiscica"); } -CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, test_style) -{ - loadFromFile(u"xlsx/column-style.xlsx"); - - save(u"Calc Office Open XML"_ustr); - xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr); - CPPUNIT_ASSERT(pXmlDoc); - // workaround: use leave-gap instead of zero to show the original line chart - assertXPath(pXmlDoc, "/c:chartSpace/c:style", "val", u"23"); -} - CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomLabelText) { loadFromFile(u"docx/testCustomlabeltext.docx"); diff --git a/chart2/qa/extras/data/xlsx/column-style.xlsx b/chart2/qa/extras/data/xlsx/column-style.xlsx deleted file mode 100644 index 95da9c97caa8..000000000000 Binary files a/chart2/qa/extras/data/xlsx/column-style.xlsx and /dev/null differ diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index c7f6ef51ebfb..ea38fcc87735 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -141,8 +141,7 @@ enum PROP_DIAGRAM_HAS_SECOND_Y_AXIS_TITLE, PROP_DIAGRAM_AUTOMATIC_SIZE, - PROP_DIAGRAM_EXTERNALDATA, - PROP_DIAGRAM_STYLE_INDEX + PROP_DIAGRAM_EXTERNALDATA }; void lcl_AddPropertiesToVector( @@ -394,18 +393,11 @@ void lcl_AddPropertiesToVector( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT ); - // chartSpace properties rOutProperties.emplace_back( "ExternalData", PROP_DIAGRAM_EXTERNALDATA, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID ); - - rOutProperties.emplace_back( "StyleIndex", - PROP_DIAGRAM_STYLE_INDEX, - cppu::UnoType<sal_Int32>::get(), - beans::PropertyAttribute::BOUND - | beans::PropertyAttribute::MAYBEVOID ); } const Sequence< Property >& StaticDiagramWrapperPropertyArray() diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 0dab2b29723f..c3c4e0be9cc6 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -101,8 +101,7 @@ enum PROP_DIAGRAM_SPLIT_POS, PROP_DIAGRAM_DATATABLEVBORDER, PROP_DIAGRAM_DATATABLEOUTLINE, - PROP_DIAGRAM_EXTERNALDATA, - PROP_DIAGRAM_STYLE_INDEX + PROP_DIAGRAM_EXTERNALDATA }; void lcl_AddPropertiesToVector( @@ -198,10 +197,6 @@ void lcl_AddPropertiesToVector( PROP_DIAGRAM_EXTERNALDATA, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID ); - rOutProperties.emplace_back( "StyleIndex", - PROP_DIAGRAM_STYLE_INDEX, - cppu::UnoType<OUString>::get(), - beans::PropertyAttribute::MAYBEVOID ); } const ::chart::tPropertyValueMap& StaticDiagramDefaults() diff --git a/oox/inc/drawingml/chart/chartspacemodel.hxx b/oox/inc/drawingml/chart/chartspacemodel.hxx index d66abb21f9d7..dda0f577ae32 100644 --- a/oox/inc/drawingml/chart/chartspacemodel.hxx +++ b/oox/inc/drawingml/chart/chartspacemodel.hxx @@ -54,7 +54,6 @@ struct ChartSpaceModel OUString maSheetPath; /// Path to embedded charts. sal_Int32 mnDispBlanksAs; /// Mode how to display blank values. sal_Int32 mnStyle; /// Index to default formatting. - bool mbExplicitStyle; /// Is there a <c:style> tag? bool mbAutoTitleDel; /// True = automatic title deleted manually. bool mbPlotVisOnly; /// True = plot visible cells in a sheet only. bool mbShowLabelsOverMax;/// True = show labels over chart maximum. diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx index d2d51fad3c43..b3bc7d4a8e21 100644 --- a/oox/source/drawingml/chart/chartspaceconverter.cxx +++ b/oox/source/drawingml/chart/chartspaceconverter.cxx @@ -240,13 +240,6 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern PropertySet aDiaProp( xDiagram ); aDiaProp.setProperty( PROP_MissingValueTreatment, nMissingValues ); - - if (mrModel.mbExplicitStyle) { - // The <c:style> value, now in mrModel.mnStyle, is handled in the - // ObjectFormatter code. Set it here as a property just so it can be - // stored for output. - aDiaProp.setProperty( PROP_StyleIndex, mrModel.mnStyle); - } } /* Following all conversions needing the old Chart1 API that involves full diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index 29e77e4b5095..88ee3c5bdf41 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -65,7 +65,6 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); case C_TOKEN( style ): mrModel.mnStyle = rAttribs.getInteger( XML_val, 2 ); - mrModel.mbExplicitStyle = true; return nullptr; case C_TOKEN( txPr ): return new TextBodyContext( *this, mrModel.mxTextProp.create() ); diff --git a/oox/source/drawingml/chart/chartspacemodel.cxx b/oox/source/drawingml/chart/chartspacemodel.cxx index 06303b9a8e02..3aa7366ff82e 100644 --- a/oox/source/drawingml/chart/chartspacemodel.cxx +++ b/oox/source/drawingml/chart/chartspacemodel.cxx @@ -25,7 +25,6 @@ namespace oox::drawingml::chart { ChartSpaceModel::ChartSpaceModel(bool bMSO2007Doc) : mnDispBlanksAs( bMSO2007Doc ? XML_gap : XML_zero ), // difference between OOXML spec and MSO 2007 mnStyle( 2 ), - mbExplicitStyle(false), mbAutoTitleDel( !bMSO2007Doc ), // difference between OOXML spec and MSO 2007 mbPlotVisOnly( !bMSO2007Doc ), mbShowLabelsOverMax( !bMSO2007Doc ), diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 1ab0e09ca228..75b1b8b4aada 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1281,27 +1281,11 @@ void ChartExport::exportChartSpace( const Reference< css::chart::XChartDocument pFS->singleElement(FSNS(XML_c, XML_roundedCorners), XML_val, "0"); } - // style - if (!bIsChartex) { - mxDiagram.set( xChartDoc->getDiagram() ); - Reference< XPropertySet > xPropSet(mxDiagram, uno::UNO_QUERY); - if (GetProperty(xPropSet, u"StyleIndex"_ustr)) { - sal_Int32 nStyleIdx = -1; - mAny >>= nStyleIdx; - assert(nStyleIdx >= 0); - pFS->singleElement(FSNS(XML_c, XML_style), XML_val, - OUString::number(nStyleIdx)); - } - } - - if( !bIncludeTable ) - { - // TODO:external data - } //XML_chart exportChart(xChartDoc, bIsChartex); // TODO: printSettings + // TODO: style // TODO: text properties Reference< XPropertySet > xPropSet = xChartDoc->getArea(); if( xPropSet.is() ) diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index e05a780bccaf..57404337c3fc 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -569,7 +569,6 @@ StartWith StartingAngle State StringItemList -StyleIndex SubPieType SubViewSize Subtotals
