diff options
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r-- | sd/source/ui/view/GraphicObjectBar.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/MediaObjectBar.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/Outliner.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/view/ViewShellBase.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/view/drviews4.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews6.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdview2.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/sdview4.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdwindow.cxx | 9 |
10 files changed, 22 insertions, 26 deletions
diff --git a/sd/source/ui/view/GraphicObjectBar.cxx b/sd/source/ui/view/GraphicObjectBar.cxx index acecdffd7dac..e4974b1758fd 100644 --- a/sd/source/ui/view/GraphicObjectBar.cxx +++ b/sd/source/ui/view/GraphicObjectBar.cxx @@ -102,7 +102,7 @@ void GraphicObjectBar::GetFilterState( SfxItemSet& rSet ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< SdrGrafObj *>( pObj ) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) ) + if( dynamic_cast< SdrGrafObj *>( pObj ) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) ) bEnable = true; } @@ -118,7 +118,7 @@ void GraphicObjectBar::ExecuteFilter( SfxRequest const & rReq ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) + if( dynamic_cast< SdrGrafObj *>( pObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { GraphicObject aFilterObj( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); diff --git a/sd/source/ui/view/MediaObjectBar.cxx b/sd/source/ui/view/MediaObjectBar.cxx index ae9554124df3..b84d7b9ffac0 100644 --- a/sd/source/ui/view/MediaObjectBar.cxx +++ b/sd/source/ui/view/MediaObjectBar.cxx @@ -88,7 +88,7 @@ void MediaObjectBar::GetState( SfxItemSet& rSet ) { SdrObject* pObj =pMarkList->GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< SdrMediaObj *>( pObj ) != nullptr ) + if( dynamic_cast< SdrMediaObj *>( pObj ) ) { ::avmedia::MediaItem aItem( SID_AVMEDIA_TOOLBOX ); @@ -124,7 +124,7 @@ void MediaObjectBar::Execute( SfxRequest const & rReq ) { SdrObject* pObj = pMarkList->GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< SdrMediaObj *>( pObj ) != nullptr ) + if( dynamic_cast< SdrMediaObj *>( pObj ) ) { static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).executeMediaItem( static_cast< const ::avmedia::MediaItem& >( *pItem ) ); diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 1628d1c25693..4209c7ae90cf 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -307,7 +307,7 @@ void SdOutliner::EndSpelling() // When in <member>PrepareSpelling()</member> a new outline view has // been created then delete it here. - bool bViewIsDrawViewShell(pViewShell && nullptr != dynamic_cast< const sd::DrawViewShell *>( pViewShell.get() )); + bool bViewIsDrawViewShell(dynamic_cast< const sd::DrawViewShell *>( pViewShell.get() )); if (bViewIsDrawViewShell) { SetStatusEventHdl(Link<EditStatus&,void>()); @@ -335,8 +335,8 @@ void SdOutliner::EndSpelling() // changes were done at SpellCheck if(IsModified()) { - if(mpView && dynamic_cast< const sd::OutlineView *>( mpView ) != nullptr) - static_cast<sd::OutlineView*>(mpView)->PrepareClose(); + if(auto pOutlineView = dynamic_cast<sd::OutlineView *>( mpView )) + pOutlineView->PrepareClose(); if(mpDrawDocument && !mpDrawDocument->IsChanged()) mpDrawDocument->SetChanged(); } @@ -1650,7 +1650,7 @@ void SdOutliner::EndConversion() bool SdOutliner::ConvertNextDocument() { std::shared_ptr<sd::ViewShell> pViewShell (mpWeakViewShell.lock()); - if (pViewShell && nullptr != dynamic_cast< const sd::OutlineViewShell *>( pViewShell.get() ) ) + if (dynamic_cast< const sd::OutlineViewShell *>( pViewShell.get() ) ) return false; mpDrawDocument->GetDocSh()->SetWaitCursor( true ); diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 2f86b677ae67..a01519d09661 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -397,8 +397,7 @@ ViewShellBase* ViewShellBase::GetViewShellBase (SfxViewFrame const * pViewFrame) // Get the view shell for the frame and cast it to // sd::ViewShellBase. SfxViewShell* pSfxViewShell = pViewFrame->GetViewShell(); - if (pSfxViewShell!=nullptr && dynamic_cast< ::sd::ViewShellBase *>( pSfxViewShell ) != nullptr) - pBase = static_cast<ViewShellBase*>(pSfxViewShell); + pBase = dynamic_cast< ::sd::ViewShellBase *>( pSfxViewShell ); } return pBase; diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 40ade045b23e..45364638b196 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1327,7 +1327,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) + if( dynamic_cast< const SdrGrafObj *>( pObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); m_ExternalEdits.push_back( @@ -1348,7 +1348,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) + if( dynamic_cast< const SdrGrafObj *>( pObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap ) { SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj); CompressGraphicsDialog dialog(GetFrameWeld(), pGraphicObj, GetViewFrame()->GetBindings() ); @@ -2095,10 +2095,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( pFieldItem ) { const SvxFieldData* pField = pFieldItem->GetField(); - if( pField && dynamic_cast< const SvxURLField *>( pField ) != nullptr ) + if( auto pURLField = dynamic_cast< const SvxURLField *>( pField ) ) { - const SvxURLField* pURLField = static_cast< const SvxURLField* >( pField ); - SfxStringItem aUrl( SID_FILE_NAME, pURLField->GetURL() ); SfxStringItem aTarget( SID_TARGETNAME, pURLField->GetTargetFrame() ); diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index f8aca149a4ae..32f9fcf96c0f 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -155,7 +155,7 @@ bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin) { SdrObject* pObj = aIter.Next(); - if(pObj && dynamic_cast< const SdrTextObj *>( pObj ) != nullptr) + if(auto pSdrTextObj = dynamic_cast<SdrTextObj *>( pObj )) { SdrInventor nInv(pObj->GetObjInventor()); sal_uInt16 nKnd(pObj->GetObjIdentifier()); @@ -164,7 +164,7 @@ bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin) (OBJ_TITLETEXT == nKnd || OBJ_OUTLINETEXT == nKnd || OBJ_TEXT == nKnd) && bDidVisitOldObject) { - pCandidate = static_cast<SdrTextObj*>(pObj); + pCandidate = pSdrTextObj; } if(pObj == pOldObj) diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx index bfc0fe363e43..78330fcd6be8 100644 --- a/sd/source/ui/view/drviews6.cxx +++ b/sd/source/ui/view/drviews6.cxx @@ -337,7 +337,7 @@ void DrawViewShell::GetBmpMaskState( SfxItemSet& rSet ) pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); // valid graphic object? - if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && + if( dynamic_cast< const SdrGrafObj *>( pObj ) && !static_cast<const SdrGrafObj*>(pObj)->IsEPS() && !mpDrawView->IsTextEdit() ) { diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index ce98918f0021..539d69b4dfc4 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -114,7 +114,7 @@ css::uno::Reference< css::datatransfer::XTransferable > View::CreateClipboardDat { SdrObject* pObj = GetMarkedObjectByIndex(0); - if( pObj && dynamic_cast< const SdrOle2Obj *>( pObj ) != nullptr && static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) + if( dynamic_cast< const SdrOle2Obj *>( pObj ) && static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) { // If object has no persistence it must be copied as part of the document try @@ -160,7 +160,7 @@ css::uno::Reference< css::datatransfer::XTransferable > View::CreateDragDataObje { SdrObject* pObj = GetMarkedObjectByIndex( 0 ); - if( pObj && dynamic_cast< const SdrOle2Obj *>( pObj ) != nullptr && static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) + if( dynamic_cast< const SdrOle2Obj *>( pObj ) && static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) { // If object has no persistence it must be copied as part of the document try diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 61671f11d991..aa2d41b41440 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -317,7 +317,7 @@ SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rM pPV = nullptr; } - if( mnAction == DND_ACTION_LINK && pPickObj && pPV && dynamic_cast< SdrMediaObj *>( pPickObj ) != nullptr ) + if( mnAction == DND_ACTION_LINK && pPV && dynamic_cast< SdrMediaObj *>( pPickObj ) ) { pNewMediaObj = static_cast< SdrMediaObj* >( pPickObj->CloneSdrObject(pPickObj->getSdrModelFromSdrObject()) ); pNewMediaObj->setURL( rMediaURL, ""/*TODO?*/, rMimeType ); diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 5b3240157bfc..b807e2997bbb 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -353,9 +353,8 @@ long Window::SetZoomFactor(long nZoom) UpdateMapOrigin(); // Update the view's snapping to the new zoom factor. - if ( mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr ) - static_cast<DrawViewShell*>(mpViewShell)->GetView()-> - RecalcLogicSnapMagnetic(*this); + if ( auto pDrawViewShell = dynamic_cast< DrawViewShell *>( mpViewShell ) ) + pDrawViewShell->GetView()->RecalcLogicSnapMagnetic(*this); // Return the zoom factor just in case it has been changed above to lie // inside the valid range. @@ -592,7 +591,7 @@ void Window::UpdateMapMode() // removed old stuff here which still forced zoom to be // %BRUSH_SIZE which is outdated now - if (mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr) + if (dynamic_cast< DrawViewShell *>( mpViewShell )) { // page should not "stick" to the window border if (aPix.Width() == 0) @@ -959,7 +958,7 @@ css::uno::Reference<css::accessibility::XAccessible> Window::CreateAccessible() { // If current viewshell is PresentationViewShell, just return empty because the correct ShowWin will be created later. - if (mpViewShell && dynamic_cast< PresentationViewShell *>( mpViewShell ) != nullptr) + if (dynamic_cast< PresentationViewShell *>( mpViewShell )) { return vcl::Window::CreateAccessible (); } |