summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-11-19 01:11:21 +0100
committerEike Rathke <erack@redhat.com>2016-11-19 15:26:16 +0100
commit451c4cccc7e3ec3f1e046d3232cb52f6fc443f59 (patch)
treef8327e93c7e6726e04d2626b6c5fdbbfbf31c5ea /svx
parent87c67a4ad344cf1b7c7c9f89f2362cc82901aec3 (diff)
sc-perf: bundle SdrObject::BroadcastObjectChange() calls during Save
Test doc https://bugs.documentfoundation.org/attachment.cgi?id=128252 from https://bugs.documentfoundation.org/show_bug.cgi?id=103493 ScPostIt::CreateCaptionFromInitData() called through ScDocument::CreateAllNoteCaptions() Incl. Self Called Before: 326,418,830,114 487,308 6,645 After: 145,055,889,118 511,681 6,645 Reduced to 44% or speed-up by factor 2.25 Overall ScDocShell::SaveXML() Before: 370,433,720,090 After: 189,120,982,786 Reduced to 51% or speed-up by factor 1.96 There's still too much broadcasting to accessibility going on though.. Change-Id: I50555fd9751ac24006cc96b2fa8e82b32aba0748
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdobj.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index f87ecd1b6276..0f3de29393c0 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -302,6 +302,8 @@ SdrObject::SdrObject() :
,pGrabBagItem(nullptr)
,mnNavigationPosition(SAL_MAX_UINT32)
,mnLayerID(0)
+ ,mbDelayBroadcastObjectChange(false)
+ ,mbBroadcastObjectChangePending(false)
,mpSvxShape( nullptr )
,maWeakUnoShape()
,mbDoNotInsertIntoPageAutomatically(false)
@@ -880,6 +882,12 @@ void SdrObject::BroadcastObjectChange() const
if( pModel && pModel->isLocked() )
return;
+ if (mbDelayBroadcastObjectChange)
+ {
+ mbBroadcastObjectChangePending = true;
+ return;
+ }
+
bool bPlusDataBroadcast(pPlusData && pPlusData->pBroadcast);
bool bObjectChange(IsInserted() && pModel);
@@ -3092,6 +3100,27 @@ bool SdrObject::HasText() const
return false;
}
+
+SdrDelayBroadcastObjectChange::SdrDelayBroadcastObjectChange( SdrObject& rObj ) :
+ mrObj(rObj), mbOldDelayBroadcastObjectChange( rObj.mbDelayBroadcastObjectChange)
+{
+ mrObj.mbDelayBroadcastObjectChange = true;
+}
+
+SdrDelayBroadcastObjectChange::~SdrDelayBroadcastObjectChange()
+{
+ if (!mbOldDelayBroadcastObjectChange)
+ {
+ mrObj.mbDelayBroadcastObjectChange = false;
+ if (mrObj.mbBroadcastObjectChangePending)
+ {
+ mrObj.mbBroadcastObjectChangePending = false;
+ mrObj.BroadcastObjectChange();
+ }
+ }
+}
+
+
SdrObject* SdrObjFactory::CreateObjectFromFactory( sal_uInt32 nInventor, sal_uInt16 nObjIdentifier, SdrPage* , SdrModel* )
{
SdrObjCreatorParams aParams { nInventor, nObjIdentifier };