sc/source/filter/excel/xedbdata.cxx  |    8 +++++---
 sc/source/filter/oox/tablebuffer.cxx |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit c64e803d2e307e9915962e23cb7d7131d1f89808
Author:     Balazs Varga <[email protected]>
AuthorDate: Thu Dec 4 18:14:24 2025 +0100
Commit:     Balazs Varga <[email protected]>
CommitDate: Fri Dec 5 20:54:44 2025 +0100

    Table Styles: ooxml export the 'None' table style as
    
    Table context as well, to keep the necessary infos.
    
    Change-Id: I10f244f985ca21a68b262356367eeb5d1076d4d0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195036
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Balazs Varga <[email protected]>

diff --git a/sc/source/filter/excel/xedbdata.cxx 
b/sc/source/filter/excel/xedbdata.cxx
index 0a9b89a7ffde..fad30749c746 100644
--- a/sc/source/filter/excel/xedbdata.cxx
+++ b/sc/source/filter/excel/xedbdata.cxx
@@ -320,12 +320,14 @@ void XclExpTables::SaveTableXml( XclExpXmlStream& rStrm, 
const Entry& rEntry )
 
     if (const ScTableStyleParam* pParam = rData.GetTableStyleInfo())
     {
-        const OUString& rStyleName = pParam->maStyleID;
         if (const ScTableStyles* pTableStyles = 
rStrm.GetRoot().GetDoc().GetTableStyles())
         {
-            if (pTableStyles->GetTableStyle(rStyleName))
+            if (pParam->maStyleID == u"none" || 
pTableStyles->GetTableStyle(pParam->maStyleID))
             {
-                pTableStrm->singleElement(XML_tableStyleInfo, XML_name, 
rStyleName.toUtf8(),
+                std::optional<OString> aNameAttr
+                    = (pParam->maStyleID == u"none") ? std::nullopt
+                          : std::make_optional(pParam->maStyleID.toUtf8());
+                pTableStrm->singleElement(XML_tableStyleInfo, XML_name, 
aNameAttr,
                                           XML_showFirstColumn, 
ToPsz10(pParam->mbFirstColumn),
                                           XML_showLastColumn, 
ToPsz10(pParam->mbLastColumn),
                                           XML_showRowStripes, 
ToPsz10(pParam->mbRowStripes),
diff --git a/sc/source/filter/oox/tablebuffer.cxx 
b/sc/source/filter/oox/tablebuffer.cxx
index f7a8ffa77a68..e2dbd282a94f 100644
--- a/sc/source/filter/oox/tablebuffer.cxx
+++ b/sc/source/filter/oox/tablebuffer.cxx
@@ -96,7 +96,7 @@ void Table::importTable( SequenceInputStream& rStrm, 
sal_Int16 nSheet )
 void Table::importTableStyleInfo(const AttributeList& rAttribs)
 {
     TableStyleInfo aInfo;
-    aInfo.maStyleName = rAttribs.getString(XML_name, OUString());
+    aInfo.maStyleName = rAttribs.getString(XML_name, u"none"_ustr);
     aInfo.mbShowFirstColumn = rAttribs.getBool(XML_showFirstColumn, true);
     aInfo.mbShowLastColumn = rAttribs.getBool(XML_showLastColumn, true);
     aInfo.mbShowRowStripes = rAttribs.getBool(XML_showRowStripes, true);

Reply via email to