[Libreoffice-commits] core.git: sd/source
Katarina Behrens
Katarina.Behrens at cib.de
Fri Feb 23 14:28:07 UTC 2018
sd/source/core/drawdoc4.cxx | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
New commits:
commit e208b81540d43e2b7d3012dfe6bebc59ce638c12
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Mon Feb 19 14:37:19 2018 +0100
Don't reformat all connectors every time spellchecking timer fires
Editing document with many (~1k) connectors eats all available CPU
power as every spellchecking event locks and then unlocks SdrModel
which in turn repositions ALL connectors in entire document, so let's
not do that
Additionally, set OutlinerParaObject and broadcast only when something
has actually changed
Change-Id: I647b7309729dce153b8e05eff4677fe7bb9840a7
Reviewed-on: https://gerrit.libreoffice.org/49995
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 8b584df557da..9fec6a7b947b 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -896,20 +896,24 @@ void SdDrawDocument::SpellObject(SdrTextObj* pObj)
if (mbHasOnlineSpellErrors)
{
- sd::ModifyGuard aGuard( this );
- SdrModel* pModel = pObj->GetModel();
- bool bLock = false;
- if ( pModel )
+ OutlinerParaObject* pOPO = pOutl->CreateParaObject();
+ if (pOPO)
{
- bLock = pModel->isLocked();
- pModel->setLock(true);
+ if (!( *pOPO == *pObj->GetOutlinerParaObject() ) ||
+ !pObj->GetOutlinerParaObject()->isWrongListEqual( *pOPO ))
+ {
+ sd::ModifyGuard aGuard( this );
+
+ // taking text from the outliner
+ pObj->SetOutlinerParaObject( pOPO );
+ // SetOPO takes care of broadcasting object change
+
+ pOPO = nullptr;
+ }
+ else
+ delete pOPO;
}
- // taking text from the outliner
- pObj->SetOutlinerParaObject( pOutl->CreateParaObject() );
- pObj->BroadcastObjectChange();
- if ( pModel )
- pModel->setLock(bLock);
}
}
More information about the Libreoffice-commits
mailing list