summaryrefslogtreecommitdiff
path: root/sw/source/core/draw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-06-10 10:02:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-06-10 20:43:38 +0200
commit474a9171e7e996116037bb9ca6c985d0a3d6c0c3 (patch)
tree7ca10ffc1a6514817ff173e41d1ac04251b69c9a /sw/source/core/draw
parentb0ede91f5e64767bd3ba9f427687e1faf2297e0c (diff)
loplugin:buriedassign in sw
limited this only fixing assignments inside "if" statements, since other things are harder to change Change-Id: If3188a3e3d5fcd94123211c97fee097ece5e2797 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95990 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/draw')
-rw-r--r--sw/source/core/draw/dcontact.cxx17
-rw-r--r--sw/source/core/draw/dview.cxx4
2 files changed, 11 insertions, 10 deletions
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 4d077fe401b4..54e931ac3821 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -181,10 +181,11 @@ SwContact* GetUserCall( const SdrObject* pObj )
/// Returns true if the SrdObject is a Marquee-Object (scrolling text)
bool IsMarqueeTextObj( const SdrObject& rObj )
{
- SdrTextAniKind eTKind;
- return SdrInventor::Default == rObj.GetObjInventor() &&
- OBJ_TEXT == rObj.GetObjIdentifier() &&
- ( SdrTextAniKind::Scroll == ( eTKind = static_cast<const SdrTextObj&>(rObj).GetTextAniKind())
+ if (SdrInventor::Default != rObj.GetObjInventor() ||
+ OBJ_TEXT != rObj.GetObjIdentifier())
+ return false;
+ SdrTextAniKind eTKind = static_cast<const SdrTextObj&>(rObj).GetTextAniKind();
+ return ( SdrTextAniKind::Scroll == eTKind
|| SdrTextAniKind::Alternate == eTKind || SdrTextAniKind::Slide == eTKind );
}
@@ -518,8 +519,8 @@ SwVirtFlyDrawObj* SwFlyDrawContact::CreateNewRef(SwFlyFrame* pFly, SwFlyFrameFor
// order to transport the z-order.
// After creating the first Reference the Masters are removed from the
// List and are not important anymore.
- SdrPage* pPg(nullptr);
- if(nullptr != (pPg = pContact->GetMaster()->getSdrPageFromSdrObject()))
+ SdrPage* pPg = pContact->GetMaster()->getSdrPageFromSdrObject();
+ if(nullptr != pPg)
{
const size_t nOrdNum = pContact->GetMaster()->GetOrdNum();
pPg->ReplaceObject(pDrawObj, nOrdNum);
@@ -2222,9 +2223,9 @@ void SwDrawVirtObj::AddToDrawingPage()
SdrObject* pOrgMasterSdrObj = mrDrawContact.GetMaster();
// insert 'virtual' drawing object into page, set layer and user call.
- SdrPage* pDrawPg;
+ SdrPage* pDrawPg = pOrgMasterSdrObj->getSdrPageFromSdrObject();
// #i27030# - apply order number of referenced object
- if ( nullptr != ( pDrawPg = pOrgMasterSdrObj->getSdrPageFromSdrObject() ) )
+ if ( nullptr != pDrawPg )
{
// #i27030# - apply order number of referenced object
pDrawPg->InsertObject( this, GetReferencedObj().GetOrdNum() );
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index fd69be2ca96a..155339cbcc5d 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -224,8 +224,8 @@ void SwDrawView::AddCustomHdl()
if (RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId())
return;
- const SwFrame* pAnch;
- if(nullptr == (pAnch = CalcAnchor()))
+ const SwFrame* pAnch = CalcAnchor();
+ if(nullptr == pAnch)
return;
Point aPos(m_aAnchorPoint);