diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-07 13:55:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-09 07:31:24 +0100 |
commit | 5ba447bdcd13ba3d7c27c8609f207910227e4ab6 (patch) | |
tree | 9a59e7058ef40be90867518590e35abb6c0615f5 /editeng | |
parent | ea4a47d7d442d5d897cfa3a6e9f09ce3f1f233c5 (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 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 2ba8c6cde892..ff2cd22249af 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -3496,10 +3496,10 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable( { const SvxFieldItem* pField = static_cast<const SvxFieldItem*>(pAttr->GetItem()); const SvxFieldData* pFld = pField->GetField(); - if ( dynamic_cast<const SvxURLField* >(pFld) != nullptr ) + if ( auto pUrlField = dynamic_cast<const SvxURLField* >(pFld) ) { // Office-Bookmark - pDataObj->GetURL() = static_cast<const SvxURLField*>(pFld)->GetURL(); + pDataObj->GetURL() = pUrlField->GetURL(); } } } diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index ba56dce73a14..6d153502585f 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -3617,7 +3617,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po if( pFieldItem ) { const SvxFieldData* pFieldData = pFieldItem->GetField(); - if ( dynamic_cast< const SvxURLField* >( pFieldData ) != nullptr) + if ( auto pUrlField = dynamic_cast< const SvxURLField* >( pFieldData ) ) { Point aTopLeft( aTmpPos ); aTopLeft.Y() -= pLine->GetMaxAscent(); @@ -3625,7 +3625,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po tools::Rectangle aRect( aTopLeft, rTextPortion.GetSize() ); vcl::PDFExtOutDevBookmarkEntry aBookmark; aBookmark.nLinkId = pPDFExtOutDevData->CreateLink( aRect ); - aBookmark.aBookmark = static_cast<const SvxURLField*>(pFieldData)->GetURL(); + aBookmark.aBookmark = pUrlField->GetURL(); std::vector< vcl::PDFExtOutDevBookmarkEntry >& rBookmarks = pPDFExtOutDevData->GetBookmarks(); rBookmarks.push_back( aBookmark ); } |