summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unoframe.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-07 13:55:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-09 07:31:24 +0100
commit5ba447bdcd13ba3d7c27c8609f207910227e4ab6 (patch)
tree9a59e7058ef40be90867518590e35abb6c0615f5 /sw/source/core/unocore/unoframe.cxx
parentea4a47d7d442d5d897cfa3a6e9f09ce3f1f233c5 (diff)
new loplugin simplifydynamiccast
simplify dynamic_cast followed by static_cast Change-Id: I965afcf05d1675094cfde53d3590a0fd00f26279 Reviewed-on: https://gerrit.libreoffice.org/44460 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/unocore/unoframe.cxx')
-rw-r--r--sw/source/core/unocore/unoframe.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 7d81aa8a3b40..d907daa6ce6a 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1548,11 +1548,8 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
{
// see SwFEShell::SetFrameFormat( SwFrameFormat *pNewFormat, bool bKeepOrient, Point* pDocPos )
SwFlyFrame *pFly = nullptr;
- {
- const SwFrameFormat* pFormatXX = pFormat;
- if (dynamic_cast<const SwFlyFrameFormat*>( pFormatXX) )
- pFly = static_cast<const SwFlyFrameFormat*>(pFormatXX)->GetFrame();
- }
+ if (auto pFlyFrameFormat = dynamic_cast<const SwFlyFrameFormat*>(pFormat) )
+ pFly = pFlyFrameFormat->GetFrame();
if ( pFly )
{
const ::SfxPoolItem* pItem;
@@ -1933,8 +1930,8 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
{
// see SwFEShell::SetFlyFrameAttr( SfxItemSet& rSet )
SwFlyFrame *pFly = nullptr;
- if (dynamic_cast<SwFlyFrameFormat*>( pFormat) )
- pFly = static_cast<SwFlyFrameFormat*>(pFormat)->GetFrame();
+ if (auto pFrameFormat = dynamic_cast<SwFlyFrameFormat*>( pFormat) )
+ pFly = pFrameFormat->GetFrame();
if (pFly)
{
const ::SfxPoolItem* pItem;