tdf#81765 slow loading of .ods with >1000 of conditional formats, part 4

This takes the loading time from 13s to 10.5s

Avoid expensive text-invalidation while we are loading

Change-Id: Ia74b84575fbf635b5ab5618c74ea2efc9f6ad827
Reviewed-on: https://gerrit.libreoffice.org/71043
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 7559331..3c91d5b 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -27,6 +27,7 @@
#include <editeng/justifyitem.hxx>
#include <osl/diagnose.h>
#include <svl/poolcach.hxx>
#include <sfx2/objsh.hxx>

#include <global.hxx>
#include <document.hxx>
@@ -494,9 +495,10 @@

            // ensure that attributing changes text width of cell
            // otherwise, conditional formats need to be reset or deleted
            bool bIsLoading = !pDocument->GetDocumentShell() || pDocument->GetDocumentShell()->IsLoading();
            while ( ns <= nEndRow )
            {
                if ( nCol != -1 )
                if ( nCol != -1 && !bIsLoading )
                {
                    const SfxItemSet& rNewSet = pPattern->GetItemSet();
                    const SfxItemSet& rOldSet = mvData[nx].pPattern->GetItemSet();