diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-28 04:12:59 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-28 10:12:39 +0100 |
commit | f5dd208719b6667394b2ab95d4a17296fb898224 (patch) | |
tree | 51fc7e3b45db3d01368b7f94f8092e67850cf230 /sd | |
parent | 1132e59172f7beca5a39653cf9ee448f9f4577b1 (diff) |
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: I2b2ea62ff4ed3e16cd4fa2a5e588d001d21121cb
Reviewed-on: https://gerrit.libreoffice.org/62465
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/sdpage.cxx | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 2415061add75..dd593036321c 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -726,40 +726,42 @@ void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const ::tools if ( getSdrModelFromSdrPage().isLocked()) break; - SdrObject* pObj = const_cast<SdrObject*>(&rObj); - - if (pObj) + if (!mbMaster) { - if (!mbMaster) + if (rObj.GetUserCall()) { - if( pObj->GetUserCall() ) - { - SfxUndoManager* pUndoManager = static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()).GetUndoManager(); - const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); - - if( bUndo ) - pUndoManager->AddUndoAction( o3tl::make_unique<UndoObjectUserCall>(*pObj) ); - - // Object was resized by user and does not listen to its slide anymore - pObj->SetUserCall(nullptr); - } + SdrObject& _rObj = const_cast<SdrObject&>(rObj); + SfxUndoManager* pUndoManager + = static_cast<SdDrawDocument&>(getSdrModelFromSdrPage()) + .GetUndoManager(); + const bool bUndo + = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); + + if (bUndo) + pUndoManager->AddUndoAction( + o3tl::make_unique<UndoObjectUserCall>(_rObj)); + + // Object was resized by user and does not listen to its slide anymore + _rObj.SetUserCall(nullptr); } - else + } + else + { + // Object of the master page changed, therefore adjust + // object on all pages + sal_uInt16 nPageCount = static_cast<SdDrawDocument&>(getSdrModelFromSdrPage()) + .GetSdPageCount(mePageKind); + + for (sal_uInt16 i = 0; i < nPageCount; i++) { - // Object of the master page changed, therefore adjust - // object on all pages - sal_uInt16 nPageCount = static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()).GetSdPageCount(mePageKind); + SdPage* pLoopPage = static_cast<SdDrawDocument&>(getSdrModelFromSdrPage()) + .GetSdPage(i, mePageKind); - for (sal_uInt16 i = 0; i < nPageCount; i++) + if (pLoopPage && this == &(pLoopPage->TRG_GetMasterPage())) { - SdPage* pLoopPage = static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()).GetSdPage(i, mePageKind); - - if (pLoopPage && this == &(pLoopPage->TRG_GetMasterPage())) - { - // Page listens to this master page, therefore - // adjust AutoLayout - pLoopPage->SetAutoLayout(pLoopPage->GetAutoLayout()); - } + // Page listens to this master page, therefore + // adjust AutoLayout + pLoopPage->SetAutoLayout(pLoopPage->GetAutoLayout()); } } } |