sc/source/filter/excel/excrecds.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit c8fa51cec19eb89ef1506adfd461e5fdbcb4477a
Author:     Markus Mohrhard <[email protected]>
AuthorDate: Thu Jul 17 16:57:16 2025 +0800
Commit:     Markus Mohrhard <[email protected]>
CommitDate: Tue Nov 18 17:31:30 2025 +0100

    don't export empty customList for autofilters
    
    Change-Id: Ic1aacbea206f1e98e31b2bf808ecdfaffed2d401
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188057
    Reviewed-by: Markus Mohrhard <[email protected]>
    Tested-by: Jenkins

diff --git a/sc/source/filter/excel/excrecds.cxx 
b/sc/source/filter/excel/excrecds.cxx
index b47c7ada1834..221e804338a3 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -1166,17 +1166,19 @@ void ExcAutoFilterRecs::SaveXml( XclExpXmlStream& rStrm 
)
 
         for (const auto & rSortCriteria : maSortCustomList)
         {
+            OString aCustomList = 
OUStringToOString(std::get<1>(rSortCriteria), RTL_TEXTENCODING_UTF8);
+            const char* pCustomList = aCustomList.isEmpty() ? nullptr : 
aCustomList.getStr();
             if (std::get<2>(rSortCriteria))
                 rWorksheet->singleElement(XML_sortCondition,
                                           XML_ref, 
XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(),
                                                                           
std::get<0>(rSortCriteria)),
                                           XML_descending, "1",
-                                          XML_customList, 
std::get<1>(rSortCriteria));
+                                          XML_customList, pCustomList);
             else
                 rWorksheet->singleElement(XML_sortCondition,
                                           XML_ref, 
XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(),
                                                                           
std::get<0>(rSortCriteria)),
-                                          XML_customList, 
std::get<1>(rSortCriteria));
+                                          XML_customList, pCustomList);
         }
 
         rWorksheet->endElement(XML_sortState);

Reply via email to