diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-08-01 21:47:30 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-08-02 10:53:47 +0200 |
commit | 4804a1474ccba8df57f0a0151bd69237e82eb618 (patch) | |
tree | 256b0ec8ff72983a6c00d412ab5fff022f52c03e /sc | |
parent | bd8320952522165ee7f5f6cbe2675ea674ec5749 (diff) |
Directly prevent multiple change broadcasts
Instead of using members in SdrObject and a class
(SdrDelayBroadcastObjectChange) to prevent special,
selected SdrObnjects from executing BroadcastObjectChange,
use existing possibilities.
Change-Id: Iccab28249cfdc73219143b681495c84d7f520b62
Reviewed-on: https://gerrit.libreoffice.org/58451
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 7 | ||||
-rw-r--r-- | sc/source/core/data/postit.cxx | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 007a3a72f4fd..1c49c947cb01 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -895,8 +895,7 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati else { // Prevent multiple broadcasts during the series of changes. - SdrDelayBroadcastObjectChange aDelayBroadcastObjectChange(*pObj); - + pObj->getSdrModelFromSdrObject().setLock(true); bool bCanResize = bValid2 && !pObj->IsResizeProtect() && rData.mbResizeWithCell; //First time positioning, must be able to at least move it @@ -1018,6 +1017,10 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati // update 'unrotated' anchor ScDrawLayer::UpdateCellAnchorFromPositionEnd(*pObj, rNoRotatedAnchor, *pDoc, nTab1 ); } + + // End prevent multiple broadcasts during the series of changes. + pObj->getSdrModelFromSdrObject().setLock(false); + pObj->BroadcastObjectChange(); } } diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index d4c3372de75f..47928e54ee12 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -700,8 +700,7 @@ void ScPostIt::CreateCaptionFromInitData( const ScAddress& rPos ) const if( maNoteData.m_pCaption ) { // Prevent triple change broadcasts of the same object. - SdrDelayBroadcastObjectChange aDelayChange( *maNoteData.m_pCaption); - + maNoteData.m_pCaption->getSdrModelFromSdrObject().setLock(true); ScCaptionInitData& rInitData = *maNoteData.mxInitData; // transfer ownership of outliner object to caption, or set simple text @@ -736,6 +735,10 @@ void ScPostIt::CreateCaptionFromInitData( const ScAddress& rPos ) const maNoteData.m_pCaption->SetLogicRect( aCaptRect ); aCreator.FitCaptionToRect(); } + + // End prevent triple change broadcasts of the same object. + maNoteData.m_pCaption->getSdrModelFromSdrObject().setLock(false); + maNoteData.m_pCaption->BroadcastObjectChange(); } } // forget the initial caption data struct |