sc/source/core/tool/detfunc.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 7c539ecc3892f854d48fd33daffae8886fca3aee
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Jan 30 10:26:55 2026 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Fri Jan 30 11:48:43 2026 +0100

    tdf#168696 speedup trace dependants
    
    takes the calculation time from 18s to 6s
    
    Change-Id: I757dcf50de1057d25b02fe04659c98ac26e5db20
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198405
    Reviewed-by: Noel Grandin <[email protected]>
    Tested-by: Jenkins

diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 024d6b7c193b..ebd8a3f989dc 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -95,9 +95,12 @@ private:
     SfxItemSet  aFromTabSet;
     SfxItemSet  aCircleSet;         //TODO: individually ?
     sal_uInt16  nMaxLevel;
+    bool mbModelWasLocked;
+    SdrModel* mpModel;
 
 public:
     explicit ScDetectiveData( SdrModel* pModel );
+    ~ScDetectiveData();
 
     SfxItemSet& GetBoxSet()     { return aBoxSet; }
     SfxItemSet& GetArrowSet()   { return aArrowSet; }
@@ -127,7 +130,8 @@ ScDetectiveData::ScDetectiveData( SdrModel* pModel ) :
     aToTabSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END> ),
     aFromTabSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END> 
),
     aCircleSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END> 
),
-    nMaxLevel(0)
+    nMaxLevel(0),
+    mpModel(pModel)
 {
 
     aBoxSet.Put( XLineColorItem( OUString(), ScDetectiveFunc::GetArrowColor() 
) );
@@ -178,6 +182,15 @@ ScDetectiveData::ScDetectiveData( SdrModel* pModel ) :
     aCircleSet.Put( XLineColorItem( OUString(), 
ScDetectiveFunc::GetErrorColor() ) );
     aCircleSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
     aCircleSet.Put( XLineWidthItem( 55 ) ); // 54 = 1 Pixel
+
+    // lock model during calculation to avoid some broadcasting work
+    mbModelWasLocked = mpModel->isLocked();
+    pModel->setLock(true);
+}
+
+ScDetectiveData::~ScDetectiveData()
+{
+    mpModel->setLock(mbModelWasLocked);
 }
 
 void ScDetectiveFunc::Modified()

Reply via email to