summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-10-26 18:27:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-10-27 09:57:42 +0200
commite027d2956834a716b400a32dfdb4b0adfaeaa2f6 (patch)
treea13241ccd47c43750c9bb5f5dca0d10e8fe2583a /sw
parent1b87cdadb88da0ece66c2da1a06c37420e45111c (diff)
coverity#1420315 Unchecked dynamic_cast
Change-Id: Ie522a0691ce269a4cc090057ddb54d8d0b1fa5e6 Reviewed-on: https://gerrit.libreoffice.org/43918 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/draw/dflyobj.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 1acaa2bb4605..06319ff4d7f3 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -395,13 +395,13 @@ void SwVirtFlyDrawObj::Rotate(const Point& rRef, long nAngle, double sn, double
nAngle += 3600;
}
- if(0 != nAngle)
+ SwWrtShell *pShForAngle = nAngle ? dynamic_cast<SwWrtShell*>(GetFlyFrame()->getRootFrame()->GetCurrShell()) : nullptr;
+ if (pShForAngle)
{
// RotGrfFlyFrame: Add transformation to placeholder object
Size aSize;
const sal_uInt16 nOldRot(SwVirtFlyDrawObj::getPossibleRotationFromFraphicFrame(aSize));
- SwWrtShell *pSh = dynamic_cast<SwWrtShell*>( GetFlyFrame()->getRootFrame()->GetCurrShell() );
- SwFlyFrameAttrMgr aMgr(false, pSh, Frmmgr_Type::NONE);
+ SwFlyFrameAttrMgr aMgr(false, pShForAngle, Frmmgr_Type::NONE);
aMgr.SetRotation(nOldRot, (nOldRot + static_cast<sal_uInt16>(nAngle)) % 3600, aSize);
}