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 916e00d3a9a91680c6ce757ca2f37b81df732784
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed May 21 19:40:30 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat May 24 14:09:55 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

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index da809f291e90..3dffd6e34dd7 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -536,6 +536,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;
@@ -2304,6 +2305,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 4dd8638b83fb..16ca4c7d16f8 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 f778304b9510..92b7bcc6c88f 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1455,6 +1455,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;
@@ -1493,7 +1494,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;
@@ -1501,7 +1502,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