include/oox/core/xmlfilterbase.hxx       |   11 +++++++++++
 include/oox/export/drawingml.hxx         |   10 ----------
 include/oox/export/shapes.hxx            |    3 ---
 oox/source/export/chartexport.cxx        |    2 +-
 oox/source/export/drawingml.cxx          |   12 ------------
 oox/source/export/shapes.cxx             |    5 ++---
 sc/source/core/tool/compiler.cxx         |   10 ++--------
 sc/source/filter/excel/xeescher.cxx      |    6 +++---
 sc/source/filter/excel/xestream.cxx      |    1 -
 sc/source/filter/xcl97/xcl97rec.cxx      |    4 ++--
 sd/qa/unit/data/odp/tdf169952.odp        |binary
 sd/qa/unit/export-tests-ooxml3.cxx       |   10 ++++++++++
 sd/source/filter/eppt/pptx-epptooxml.cxx |    1 -
 13 files changed, 31 insertions(+), 44 deletions(-)

New commits:
commit 7269951b70ac807232a5ac0a317c25f8471c3615
Author:     Karthik Godha <[email protected]>
AuthorDate: Mon Jan 12 14:22:33 2026 +0530
Commit:     Xisco Fauli <[email protected]>
CommitDate: Fri Feb 6 12:22:56 2026 +0100

    tdf#169952: Convert static counters to member variables
    
    Move static counters of `DrawingML` and `ShapeExport` to `XmlFilterBase`
    and make them member variables.
    
    Change-Id: I5ede57f04324630107ee179e58b9183fc62ee5ff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197079
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    (cherry picked from commit 54efa07c05956bdcde0443cb8c130f693dd6d40e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198413
    Tested-by: Jenkins
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198786

diff --git a/include/oox/core/xmlfilterbase.hxx 
b/include/oox/core/xmlfilterbase.hxx
index fe69eb7f3c10..3a0c35ffd638 100644
--- a/include/oox/core/xmlfilterbase.hxx
+++ b/include/oox/core/xmlfilterbase.hxx
@@ -257,6 +257,11 @@ public:
 
     OUString getNamespaceURL(sal_Int32 nNSID) const;
 
+    sal_Int32 getNewDrawingUniqueId() { return ++mnDrawingMLCount; }
+    sal_Int32 getNewVMLUniqueId() { return ++mnVmlCount; }
+    sal_Int32 getNewChartUniqueId() { return ++mnChartCount; }
+    sal_Int32 getNewOLEUniqueId() { return ++mnOLECount; }
+
 protected:
     virtual css::uno::Reference< css::io::XInputStream >
         implGetInputStream( utl::MediaDescriptor& rMediaDesc ) const override;
@@ -280,6 +285,12 @@ private:
     sal_Int32 mnMaxDocId;
     bool mbMSO2007;
     bool mbMSO;
+
+    sal_Int32 mnDrawingMLCount = 0;
+    sal_Int32 mnVmlCount = 0;
+    sal_Int32 mnChartCount = 0;
+    sal_Int32 mnOLECount = 0;
+
 protected:
     bool mbMissingExtDrawing;
 };
diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
index 5fa0a2caa435..12915ac14d69 100644
--- a/include/oox/export/drawingml.hxx
+++ b/include/oox/export/drawingml.hxx
@@ -294,9 +294,6 @@ class DrawingML
 {
 
 private:
-    OOX_DLLPUBLIC static sal_Int32 mnDrawingMLCount;
-    OOX_DLLPUBLIC static sal_Int32 mnVmlCount;
-
     /// To specify where write eg. the images to (like 'ppt', or 'word' - 
according to the OPC).
     DocumentType meDocumentType;
     /// Parent exporter, used for text callback.
@@ -312,7 +309,6 @@ protected:
     /// If set, this is the parent of the currently handled shape.
     css::uno::Reference<css::drawing::XShape> m_xParent;
     bool                                      mbIsBackgroundDark;
-    OOX_DLLPUBLIC static sal_Int32 mnChartCount;
 
     /// True when exporting presentation placeholder shape.
     bool mbPlaceholder;
@@ -528,12 +524,6 @@ public:
     static bool IsGroupShape( const css::uno::Reference< css::drawing::XShape 
>& rXShape );
     sal_Int32 getBulletMarginIndentation (const css::uno::Reference< 
css::beans::XPropertySet >& rXPropSet,sal_Int16 nLevel, std::u16string_view 
propName);
 
-    OOX_DLLPUBLIC static void ResetMlCounters();
-
-    static sal_Int32 getNewDrawingUniqueId() { return ++mnDrawingMLCount; }
-    static sal_Int32 getNewVMLUniqueId() { return ++mnVmlCount; }
-    static sal_Int32 getNewChartUniqueId() { return ++mnChartCount; }
-
     // A Helper to decide the script type for given text in order to call 
WriteRunProperties.
     static sal_Int16 GetScriptType(const OUString& rStr);
 
diff --git a/include/oox/export/shapes.hxx b/include/oox/export/shapes.hxx
index f5b88f04724c..d05d0438a4e6 100644
--- a/include/oox/export/shapes.hxx
+++ b/include/oox/export/shapes.hxx
@@ -77,9 +77,6 @@ namespace oox::drawingml {
 
 class OOX_DLLPUBLIC ShapeExport : public DrawingML {
 
-private:
-    int m_nEmbeddedObjects;
-
 public:
     typedef std::unordered_map< css::uno::Reference< css::drawing::XShape>, 
sal_Int32> ShapeHashMap;
 
diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 05ab52fb1811..394728029581 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1888,7 +1888,7 @@ void ChartExport::exportAdditionalShapes( const 
Reference< css::chart::XChartDoc
             OUString sId;
             const char* sFullPath = nullptr;
             const char* sRelativePath = nullptr;
-            sal_Int32 nDrawing = getNewDrawingUniqueId();
+            sal_Int32 nDrawing = GetFB()->getNewDrawingUniqueId();
 
             switch (GetDocumentType())
             {
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 81a23466d926..d46d02daf35a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -249,11 +249,6 @@ void WriteGradientPath(const basegfx::BGradient& 
rBGradient, const FSHelperPtr&
 }
 }
 
-// not thread safe
-sal_Int32 DrawingML::mnDrawingMLCount = 0;
-sal_Int32 DrawingML::mnVmlCount = 0;
-sal_Int32 DrawingML::mnChartCount = 0;
-
 DrawingML::DrawingML(::sax_fastparser::FSHelperPtr pFS, 
::oox::core::XmlFilterBase* pFB, DocumentType eDocumentType, DMLTextExport* 
pTextExport)
     : meDocumentType(eDocumentType)
     , mpTextExport(pTextExport)
@@ -299,13 +294,6 @@ sal_Int16 DrawingML::GetScriptType(const OUString& rStr)
     return css::i18n::ScriptType::LATIN;
 }
 
-void DrawingML::ResetMlCounters()
-{
-    mnDrawingMLCount = 0;
-    mnVmlCount = 0;
-    mnChartCount = 0;
-}
-
 bool DrawingML::GetProperty( const Reference< XPropertySet >& rXPropertySet, 
const OUString& aName )
 {
     try
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 9f5a4d6273ce..4adb4f2a187c 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -326,7 +326,6 @@ namespace oox::drawingml {
 
 ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, 
ShapeHashMap* pShapeMap, XmlFilterBase* pFB, DocumentType eDocumentType, 
DMLTextExport* pTextExport, bool bUserShapes )
     : DrawingML( std::move(pFS), pFB, eDocumentType, pTextExport )
-    , m_nEmbeddedObjects(0)
     , mnShapeIdMax( 1 )
     , mbUserShapes( bUserShapes )
     , mnXmlNamespace( nXmlNamespace )
@@ -2849,7 +2848,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const 
Reference< XShape >& xShape )
         // TODO: With Chart extracted this cannot really happen since
         // no Chart could've been added at all
         ChartExport aChartExport( mnXmlNamespace, GetFS(), xChartDoc, GetFB(), 
GetDocumentType() );
-        aChartExport.WriteChartObj( xShape, GetNewShapeID( xShape ), 
++mnChartCount );
+        aChartExport.WriteChartObj(xShape, GetNewShapeID(xShape), 
mpFB->getNewChartUniqueId());
 #endif
         return *this;
     }
@@ -2967,7 +2966,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const 
Reference< XShape >& xShape )
         assert(!sRelationType.isEmpty());
         assert(!sSuffix.isEmpty());
 
-        OUString sNumber = OUString::number(++m_nEmbeddedObjects);
+        OUString sNumber = OUString::number(mpFB->getNewOLEUniqueId());
         OUString sFileName = u"embeddings/oleObject"_ustr + sNumber + 
u"."_ustr + sSuffix;
         OUString sFilePath = GetComponentDir() + u"/"_ustr + sFileName;
         uno::Reference<io::XOutputStream> const 
xOutStream(mpFB->openFragmentStream(sFilePath, sMediaType));
diff --git a/sc/source/filter/excel/xeescher.cxx 
b/sc/source/filter/excel/xeescher.cxx
index 5daf880b1a5a..b2ce7ac4f7e7 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1413,7 +1413,7 @@ OUString 
XclExpTbxControlObj::SaveControlPropertiesXml(XclExpXmlStream& rStrm) c
     {
         case EXC_OBJTYPE_CHECKBOX:
         {
-            const sal_Int32 nDrawing = DrawingML::getNewDrawingUniqueId();
+            const sal_Int32 nDrawing = rStrm.getNewDrawingUniqueId();
             sax_fastparser::FSHelperPtr pFormControl = 
rStrm.CreateOutputStream(
                     XclXmlUtils::GetStreamName( "xl/", "ctrlProps/ctrlProps", 
nDrawing ),
                     XclXmlUtils::GetStreamName( "../", "ctrlProps/ctrlProps", 
nDrawing ),
@@ -1463,7 +1463,7 @@ OUString 
XclExpTbxControlObj::SaveControlPropertiesXml(XclExpXmlStream& rStrm) c
         }
         case EXC_OBJTYPE_BUTTON:
         {
-            sal_Int32 nDrawing = DrawingML::getNewDrawingUniqueId();
+            sal_Int32 nDrawing = rStrm.getNewDrawingUniqueId();
             sax_fastparser::FSHelperPtr pFormControl = 
rStrm.CreateOutputStream(
                 XclXmlUtils::GetStreamName("xl/", "ctrlProps/ctrlProps", 
nDrawing),
                 XclXmlUtils::GetStreamName("../", "ctrlProps/ctrlProps", 
nDrawing),
@@ -1641,7 +1641,7 @@ void XclExpChartObj::SaveXml( XclExpXmlStream& rStrm )
         ChartExport aChartExport(XML_xdr, pDrawing, GetChartDoc(), &rStrm, 
drawingml::DOCUMENT_XLSX);
         auto pURLTransformer = std::make_shared<ScURLTransformer>(*mpDoc);
         aChartExport.SetURLTranslator(pURLTransformer);
-        sal_Int32 nChartCount = 
oox::drawingml::DrawingML::getNewChartUniqueId();
+        sal_Int32 nChartCount = rStrm.getNewChartUniqueId();
         sal_Int32 nID = rStrm.GetUniqueId();
         aChartExport.WriteChartObj( mxShape, nID, nChartCount );
         // TODO: get the correcto chart number
diff --git a/sc/source/filter/excel/xestream.cxx 
b/sc/source/filter/excel/xestream.cxx
index 16fc9929ef88..1b0274f09dbc 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -1056,7 +1056,6 @@ bool XclExpXmlStream::exportDocument()
     // SfxMedium::GetOutStream() anywhere in the xlsx export filter code!
     // Instead, write via XOutputStream instance.
     rtl::Reference<SotStorage> rStorage;
-    drawingml::DrawingML::ResetMlCounters();
 
     auto& rGraphicExportCache = drawingml::GraphicExportCache::get();
 
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 24f1de018026..e8518fc540ff 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -261,7 +261,7 @@ void SaveDrawingMLObjects( XclExpObjList& rList, 
XclExpXmlStream& rStrm )
     if (aList.empty())
         return;
 
-    sal_Int32 nDrawing = drawingml::DrawingML::getNewDrawingUniqueId();
+    sal_Int32 nDrawing = rStrm.getNewDrawingUniqueId();
     OUString sId;
     // export in [Content_Types].xml
     sax_fastparser::FSHelperPtr pDrawing = rStrm.CreateOutputStream(
@@ -348,7 +348,7 @@ void SaveVmlObjects( XclExpObjList& rList, XclExpXmlStream& 
rStrm )
     if( GetVmlObjectCount( rList ) == 0 )
         return;
 
-    sal_Int32 nDrawing = drawingml::DrawingML::getNewVMLUniqueId();
+    sal_Int32 nDrawing = rStrm.getNewVMLUniqueId();
     OUString sId;
     sax_fastparser::FSHelperPtr pVmlDrawing = rStrm.CreateOutputStream(
             XclXmlUtils::GetStreamName( "xl/", "drawings/vmlDrawing", nDrawing 
),
diff --git a/sd/qa/unit/data/odp/tdf169952.odp 
b/sd/qa/unit/data/odp/tdf169952.odp
new file mode 100644
index 000000000000..0888486ab21c
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf169952.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 2f67a226cf03..aa53f64cb97a 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -1149,6 +1149,16 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf169524)
         pXmlDoc, 
"/p:sldMaster/p:cSld/p:spTree/p:sp[2]/p:txBody/a:lstStyle/a:lvl1pPr", "marL");
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf169952)
+{
+    createSdImpressDoc("odp/tdf169952.odp");
+    save(TestFilter::PPTX);
+
+    xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart2.xml"_ustr);
+
+    CPPUNIT_ASSERT_MESSAGE("Without the fix chart2.xml is not exported", 
pXmlDoc);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 1fe9e644b6fa..e785fe8df2c7 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -441,7 +441,6 @@ bool PowerPointExport::importDocument() noexcept
 
 bool PowerPointExport::exportDocument()
 {
-    drawingml::DrawingML::ResetMlCounters();
     auto& rGraphicExportCache = drawingml::GraphicExportCache::get();
 
     rGraphicExportCache.push();
commit ed9b1695c3ea9db0a501c93f15eff0ecf6c8bac2
Author:     Karthik Godha <[email protected]>
AuthorDate: Thu Jan 8 15:27:39 2026 +0530
Commit:     Xisco Fauli <[email protected]>
CommitDate: Fri Feb 6 12:22:45 2026 +0100

    XLS->XLSX: Quote sheet names starting with numbers
    
    In 'definedNames' element enclose sheet names starting with numbers in
    quotes, this is what Microsoft Excel expects.
    
    bug document: fdo54055-1.xlsx
    
    Change-Id: I5e729defa4c75aba71b629fffbef05d0b710b76a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196832
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 978acf71136df9e491c0de78423f55da49bae4fd)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197080
    (cherry picked from commit 7a207d9974846b894eac2380042013f771abc8ba)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198412
    Tested-by: Jenkins
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198785

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 4561ad12b050..1d7464de06d4 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2011,8 +2011,8 @@ ScCompiler::~ScCompiler()
 void ScCompiler::CheckTabQuotes( OUString& rString,
                                  const FormulaGrammar::AddressConvention eConv 
)
 {
-    sal_Int32 nStartFlags = KParseTokens::ANY_LETTER_OR_NUMBER | 
KParseTokens::ASC_UNDERSCORE;
-    sal_Int32 nContFlags = nStartFlags;
+    sal_Int32 nStartFlags = KParseTokens::ANY_LETTER | 
KParseTokens::ASC_UNDERSCORE;
+    sal_Int32 nContFlags = nStartFlags | KParseTokens::ANY_NUMBER;
     ParseResult aRes = ScGlobal::getCharClass().parsePredefinedToken(
         KParseType::IDENTNAME, rString, 0, nStartFlags, OUString(), 
nContFlags, OUString());
     bool bNeedsQuote = !((aRes.TokenType & KParseType::IDENTNAME) && 
aRes.EndPos == rString.getLength());
@@ -2035,12 +2035,6 @@ void ScCompiler::CheckTabQuotes( OUString& rString,
             break;
     }
 
-    if ( !bNeedsQuote && CharClass::isAsciiNumeric( rString ) )
-    {
-        // Prevent any possible confusion resulting from pure numeric sheet 
names.
-        bNeedsQuote = true;
-    }
-
     if( bNeedsQuote )
     {
         rString = "'" + rString + "'";

Reply via email to