sc/inc/document.hxx                  |    3 +++
 sc/source/core/data/documen2.cxx     |    1 +
 sc/source/core/data/documen9.cxx     |    5 +++++
 sc/source/filter/oox/excelfilter.cxx |    2 ++
 sc/source/ui/docshell/docfunc.cxx    |    5 +++--
 5 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 7eed1ed77f2c0a1a09db927daa119dea11527cc9
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed May 21 19:40:30 2025 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Sun Jun 15 22:50:34 2025 +0200

    tdf#166684 suppress scanning of rotation attributes
    
    the same way we do when importing XLSX, shaves 25% off load time
    
    Change-Id: Ib854a449514ef070177324a0031f0bb0976ea4a2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185649
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins
    (cherry picked from commit 916e00d3a9a91680c6ce757ca2f37b81df732784)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185736
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 027abc943f15..0dfa4d1030c1 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -549,6 +549,7 @@ private:
     bool                bInsertingFromOtherDoc;
     bool                bLoadingMedium;
     bool                bImportingXML;      // special handling of formula text
+    bool                mbImportingXLSX;
     bool                bCalcingAfterLoad;              // in CalcAfterLoad 
TRUE
     // don't construct/destruct listeners temporarily
     bool                bNoListening;
@@ -2315,6 +2316,8 @@ public:
     void            SetLoadingMedium( bool bVal );
     SC_DLLPUBLIC void SetImportingXML( bool bVal );
     bool            IsImportingXML() const { return bImportingXML; }
+    SC_DLLPUBLIC void SetImportingXLSX( bool bVal );
+    bool            IsImportingXLSX() const { return mbImportingXLSX; }
     bool            IsCalcingAfterLoad() const { return bCalcingAfterLoad; }
     void            SetNoListening( bool bVal ) { bNoListening = bVal; }
     bool            GetNoListening() const { return bNoListening; }
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 3890a5194e85..107e9d22036c 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -171,6 +171,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, ScDocShell* 
pDocShell ) :
         bInsertingFromOtherDoc( false ),
         bLoadingMedium( false ),
         bImportingXML( false ),
+        mbImportingXLSX( false ),
         bCalcingAfterLoad( false ),
         bNoListening( false ),
         mbIdleEnabled(true),
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 0a3c8f30c2c3..8c537b4c984a 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -604,6 +604,11 @@ void ScDocument::SetImportingXML( bool bVal )
     SetLoadingMedium(bVal);
 }
 
+void ScDocument::SetImportingXLSX( bool bVal )
+{
+    mbImportingXLSX = bVal;
+}
+
 const std::shared_ptr<SvxForbiddenCharactersTable>& 
ScDocument::GetForbiddenCharacters() const
 {
     return xForbiddenCharacters;
diff --git a/sc/source/filter/oox/excelfilter.cxx 
b/sc/source/filter/oox/excelfilter.cxx
index eed4f162c51a..01a25bd7e87d 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -106,6 +106,7 @@ bool ExcelFilter::importDocument()
             rtl::Reference<WorkbookFragment> xWorkbookFragment( new 
WorkbookFragment(*xBookGlob, aWorkbookPath));
 
             ScDocument& rDoc = xWorkbookFragment->getScDocument();
+            rDoc.SetImportingXLSX(true);
             ScDocShell* pDocSh = rDoc.GetDocumentShell();
             assert( pDocSh );
             pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
@@ -121,6 +122,7 @@ bool ExcelFilter::importDocument()
                 else if (rAC.isRowOverflow())
                     pDocSh->SetError(SCWARN_IMPORT_ROW_OVERFLOW);
             }
+            rDoc.SetImportingXLSX(false);
             return bRet;
         }
     }
diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index d94763e9baba..0ec3c510f631 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1456,6 +1456,7 @@ bool ScDocFunc::ApplyAttributes( const ScMarkData& rMark, 
const ScPatternAttr& r
         bRecord = false;
 
     bool bImportingXML = rDoc.IsImportingXML();
+    bool bImportingXLSX = rDoc.IsImportingXLSX();
     // Cell formats can still be set if the range isn't editable only because 
of matrix formulas.
     // #i62483# When loading XML, the check can be skipped altogether.
     bool bOnlyNotBecauseOfMatrix;
@@ -1494,7 +1495,7 @@ bool ScDocFunc::ApplyAttributes( const ScMarkData& rMark, 
const ScPatternAttr& r
 
     // While loading XML it is not necessary to ask HasAttrib. It needs too 
much time.
     sal_uInt16 nExtFlags = 0;
-    if ( !bImportingXML )
+    if ( !bImportingXML && !bImportingXLSX )
         rDocShell.UpdatePaintExt( nExtFlags, aMultiRange );     // content 
before the change
 
     bool bChanged = false;
@@ -1502,7 +1503,7 @@ bool ScDocFunc::ApplyAttributes( const ScMarkData& rMark, 
const ScPatternAttr& r
 
     if(bChanged)
     {
-        if ( !bImportingXML )
+        if ( !bImportingXML && !bImportingXLSX )
             rDocShell.UpdatePaintExt( nExtFlags, aMultiRange );     // content 
after the change
 
         if (!AdjustRowHeight( aMultiRange, true, bApi ))

Reply via email to