diff options
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r-- | sd/source/ui/view/DocumentRenderer.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews8.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsf.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/view/outlnvsh.cxx | 8 |
4 files changed, 12 insertions, 15 deletions
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 608a4af642bb..426f06615983 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1414,8 +1414,8 @@ private: rOutliner.SetControlWord( nCntrl ); // When in outline view then apply all pending changes to the model. - if( dynamic_cast< OutlineViewShell *>( pShell ) != nullptr) - static_cast<OutlineViewShell*>(pShell)->PrepareClose (false); + if( auto pOutlineViewShell = dynamic_cast< OutlineViewShell *>( pShell ) ) + pOutlineViewShell->PrepareClose (false); // Collect some frequently used data. if (mpOptions->IsDate()) diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx index 29e6cb2ab683..3d0bf89a5888 100644 --- a/sd/source/ui/view/drviews8.cxx +++ b/sd/source/ui/view/drviews8.cxx @@ -97,7 +97,6 @@ void DrawViewShell::ScannerEvent() Point aPnt ( ( aPageSize.Width() - aBmpSize.Width() ) >> 1, ( aPageSize.Height() - aBmpSize.Height() ) >> 1 ); aPnt += Point( pPage->GetLeftBorder(), pPage->GetUpperBorder() ); ::tools::Rectangle aRect( aPnt, aBmpSize ); - SdrGrafObj* pGrafObj = nullptr; bool bInsertNewObject = true; if( GetView()->AreObjectsMarked() ) @@ -109,10 +108,8 @@ void DrawViewShell::ScannerEvent() SdrMark* pMark = rMarkList.GetMark(0); SdrObject* pObj = pMark->GetMarkedSdrObj(); - if( dynamic_cast< SdrGrafObj *>( pObj ) != nullptr ) + if( auto pGrafObj = dynamic_cast< SdrGrafObj *>( pObj ) ) { - pGrafObj = static_cast< SdrGrafObj* >( pObj ); - if( pGrafObj->IsEmptyPresObj() ) { bInsertNewObject = false; @@ -126,7 +123,7 @@ void DrawViewShell::ScannerEvent() if( bInsertNewObject ) { - pGrafObj = new SdrGrafObj( Graphic( aScanBmp ), aRect ); + auto pGrafObj = new SdrGrafObj( Graphic( aScanBmp ), aRect ); SdrPageView* pPV = GetView()->GetSdrPageView(); GetView()->InsertObjectAtView( pGrafObj, *pPV, SdrInsertFlags::SETDEFLAYER ); } diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index 28210ef42cb2..218312476031 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -96,11 +96,11 @@ void DrawViewShell::GetCtrlState(SfxItemSet &rSet) if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 ) { const SvxFieldData* pField = pFieldItem->GetField(); - if( dynamic_cast< const SvxURLField *>( pField ) != nullptr) + if( auto pUrlField = dynamic_cast< const SvxURLField *>( pField ) ) { - aHLinkItem.SetName(static_cast<const SvxURLField*>(pField)->GetRepresentation()); - aHLinkItem.SetURL(static_cast<const SvxURLField*>(pField)->GetURL()); - aHLinkItem.SetTargetFrame(static_cast<const SvxURLField*>(pField)->GetTargetFrame()); + aHLinkItem.SetName(pUrlField->GetRepresentation()); + aHLinkItem.SetURL(pUrlField->GetURL()); + aHLinkItem.SetTargetFrame(pUrlField->GetTargetFrame()); bField = true; } } diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 842ad38be060..6b53701739b8 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -362,11 +362,11 @@ void OutlineViewShell::GetCtrlState(SfxItemSet &rSet) if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 ) { const SvxFieldData* pField = pFieldItem->GetField(); - if ( dynamic_cast< const SvxURLField *>( pField ) != nullptr ) + if ( auto pUrlField = dynamic_cast< const SvxURLField *>( pField ) ) { - aHLinkItem.SetName(static_cast<const SvxURLField*>(pField)->GetRepresentation()); - aHLinkItem.SetURL(static_cast<const SvxURLField*>(pField)->GetURL()); - aHLinkItem.SetTargetFrame(static_cast<const SvxURLField*>(pField)->GetTargetFrame()); + aHLinkItem.SetName(pUrlField->GetRepresentation()); + aHLinkItem.SetURL(pUrlField->GetURL()); + aHLinkItem.SetTargetFrame(pUrlField->GetTargetFrame()); } } } |