From 5ba447bdcd13ba3d7c27c8609f207910227e4ab6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 7 Nov 2017 13:55:06 +0200 Subject: new loplugin simplifydynamiccast simplify dynamic_cast followed by static_cast Change-Id: I965afcf05d1675094cfde53d3590a0fd00f26279 Reviewed-on: https://gerrit.libreoffice.org/44460 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- sd/source/ui/func/futext.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sd/source/ui/func/futext.cxx') diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 9ea0570e6e17..2b4ca65526cb 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -1313,9 +1313,8 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const ::tools::Rect if(pObj) { - if( dynamic_cast< SdrTextObj *>( pObj ) != nullptr) + if( auto pText = dynamic_cast< SdrTextObj *>( pObj ) ) { - SdrTextObj* pText = static_cast(pObj); pText->SetLogicRect(rRectangle); bool bVertical = (SID_ATTR_CHAR_VERTICAL == nID || SID_TEXT_FITTOSIZE_VERTICAL == nID); -- cgit