sc/inc/document.hxx                |    2 +-
 sc/source/filter/excel/xestyle.cxx |   12 +++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 79d69277ab07c4d00456cfa1951a9bcb0df6dfcd
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Feb 17 14:22:40 2026 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Feb 17 18:10:29 2026 +0100

    tdf#167539 speedup color filter entry saving to XLSX
    
    takes the time from 18sec to < 1sec for me.
    
    Change-Id: Ie1f917d578b30395dd3d9ec427dcc21ec75abff3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199541
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index c203379f75b6..350c5e72c8fc 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1559,7 +1559,7 @@ public:
 
                         @returns true if there is any data, false if not.
                      */
-    bool            ShrinkToUsedDataArea( bool& o_bShrunk,
+    SC_DLLPUBLIC bool ShrinkToUsedDataArea( bool& o_bShrunk,
                                           SCTAB nTab, SCCOL& rStartCol, SCROW& 
rStartRow,
                                           SCCOL& rEndCol, SCROW& rEndRow, bool 
bColumnsOnly,
                                           bool bStickyTopRow = false, bool 
bStickyLeftCol = false,
diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index f0f6b6802fa3..d724535a7b52 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -56,6 +56,7 @@
 #include <pivot/PivotTableFormats.hxx>
 
 #include <o3tl/safeint.hxx>
+#include <o3tl/temporary.hxx>
 #include <oox/export/utils.hxx>
 #include <oox/token/tokens.hxx>
 #include <oox/token/namespaces.hxx>
@@ -3087,11 +3088,16 @@ XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot )
         {
             ScRange aRange;
             pData->GetArea(aRange);
-            for (auto nCol = aRange.aStart.Col(); nCol <= aRange.aEnd.Col(); 
nCol++)
+            SCCOL nStartCol = aRange.aStart.Col();
+            SCROW nStartRow = aRange.aStart.Row();
+            SCCOL nEndCol = aRange.aEnd.Col();
+            SCROW nEndRow = aRange.aEnd.Row();
+            rRoot.GetDoc().ShrinkToUsedDataArea(o3tl::temporary<bool>(false), 
nTab,
+                                nStartCol, nStartRow, nEndCol, nEndRow, 
/*bColumnsOnly*/false);
+            for (auto nCol = nStartCol; nCol <= nEndCol; nCol++)
             {
                 ScFilterEntries aFilterEntries;
-                rRoot.GetDoc().GetFilterEntriesArea(nCol, aRange.aStart.Row(),
-                                                    aRange.aEnd.Row(), nTab, 
true, aFilterEntries);
+                rRoot.GetDoc().GetFilterEntriesArea(nCol, nStartRow, nEndRow, 
nTab, true, aFilterEntries);
 
                 // Excel has all filter values stored as foreground colors
                 // Does not matter it is text color or cell background color

Reply via email to