diff options
Diffstat (limited to 'sd/source/ui/func')
-rw-r--r-- | sd/source/ui/func/fubullet.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsert.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsfil.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fumorph.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/func/fuoltext.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fupoor.cxx | 13 | ||||
-rw-r--r-- | sd/source/ui/func/fuprlout.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fuscale.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/futext.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/func/futhes.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fuvect.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/sdundogr.cxx | 4 |
12 files changed, 29 insertions, 34 deletions
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index 1574d2d6b7ba..deacffc1b0ef 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -205,7 +205,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq ) ::Outliner* pOL = nullptr; // determine depending on ViewShell Outliner and OutlinerView - if(mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) + if(dynamic_cast< const DrawViewShell *>( mpViewShell )) { pOV = mpView->GetTextEditOutlinerView(); if (pOV) @@ -213,7 +213,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq ) pOL = mpView->GetTextEditOutliner(); } } - else if(mpViewShell && dynamic_cast< const OutlineViewShell *>( mpViewShell ) != nullptr) + else if(dynamic_cast< const OutlineViewShell *>( mpViewShell )) { pOL = &static_cast<OutlineView*>(mpView)->GetOutliner(); pOV = static_cast<OutlineView*>(mpView)->GetViewByWindow( diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index 2ba29aa2e041..d9b7e9c5b555 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -168,7 +168,7 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq ) } } } - if( mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr) + if( dynamic_cast< DrawViewShell *>( mpViewShell ) ) { sal_Int8 nAction = DND_ACTION_COPY; SdrObject* pPickObj; diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 92ea81841391..aeedf65ff0fd 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -266,7 +266,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq ) SfxGetpApp()->GetFilterMatcher().GuessFilter(*xMedium, pFilter); - bool bDrawMode = mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr; + bool bDrawMode = dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr; bool bInserted = false; if( pFilter ) diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 45fd78f522a3..d69085ed82a6 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -110,15 +110,15 @@ void FuMorph::DoExecute( SfxRequest& ) while(aIter1.IsMore()) { SdrObject* pObj = aIter1.Next(); - if(pObj && dynamic_cast< SdrPathObj *>( pObj ) != nullptr) - aPolyPoly1.append(static_cast<SdrPathObj*>(pObj)->GetPathPoly()); + if(auto pPathObj = dynamic_cast< SdrPathObj *>( pObj )) + aPolyPoly1.append(pPathObj->GetPathPoly()); } while(aIter2.IsMore()) { SdrObject* pObj = aIter2.Next(); - if(pObj && dynamic_cast< SdrPathObj *>( pObj ) != nullptr) - aPolyPoly2.append(static_cast<SdrPathObj*>(pObj)->GetPathPoly()); + if(auto pPathObj = dynamic_cast< SdrPathObj *>( pObj )) + aPolyPoly2.append(pPathObj->GetPathPoly()); } // perform morphing diff --git a/sd/source/ui/func/fuoltext.cxx b/sd/source/ui/func/fuoltext.cxx index 5510866ae957..5d53b3aa09f5 100644 --- a/sd/source/ui/func/fuoltext.cxx +++ b/sd/source/ui/func/fuoltext.cxx @@ -164,11 +164,11 @@ bool FuOutlineText::MouseButtonUp(const MouseEvent& rMEvt) { const SvxFieldData* pField = pFieldItem->GetField(); - if( pField && dynamic_cast< const SvxURLField *>( pField ) != nullptr ) + if( auto pURLField = dynamic_cast< const SvxURLField *>( pField ) ) { bReturn = true; mpWindow->ReleaseMouse(); - SfxStringItem aStrItem( SID_FILE_NAME, static_cast<const SvxURLField*>(pField)->GetURL() ); + SfxStringItem aStrItem( SID_FILE_NAME, pURLField->GetURL() ); SfxStringItem aReferer( SID_REFERER, mpDocSh->GetMedium()->GetName() ); SfxBoolItem aBrowseItem( SID_BROWSE, true ); SfxViewFrame* pFrame = mpViewShell->GetViewFrame(); diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index a8ba3eb89d22..2e939b91d11b 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -214,7 +214,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) { SdrObject* pObj = aIter.Next(); - if(pObj && dynamic_cast< const SdrTextObj *>( pObj ) != nullptr) + if(dynamic_cast< const SdrTextObj *>( pObj )) { SdrInventor nInv(pObj->GetObjInventor()); sal_uInt16 nKnd(pObj->GetObjIdentifier()); @@ -257,7 +257,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< const SdrOle2Obj* >( pObj ) != nullptr && !mpDocSh->IsUIActive() ) + if( dynamic_cast< const SdrOle2Obj* >( pObj ) && !mpDocSh->IsUIActive() ) { //HMHmpView->HideMarkHdl(); mpViewShell->ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 ); @@ -623,7 +623,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) bool bOldSuppress = false; SdrEdgeObj* pEdgeObj = nullptr; - if(pHdl && pHdl->GetObj() && nullptr != dynamic_cast< const SdrEdgeObj *>( pHdl->GetObj() ) && 0 == pHdl->GetPolyNum()) + if(pHdl && dynamic_cast< const SdrEdgeObj *>( pHdl->GetObj() ) && 0 == pHdl->GetPolyNum()) { pEdgeObj = static_cast<SdrEdgeObj*>(pHdl->GetObj()); @@ -846,7 +846,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) { SdrObject* pObj = aIter.Next(); - if(pObj && dynamic_cast< const SdrTextObj *>( pObj ) != nullptr) + if(dynamic_cast< const SdrTextObj *>( pObj )) { SdrInventor nInv(pObj->GetObjInventor()); sal_uInt16 nKnd(pObj->GetObjIdentifier()); @@ -1055,11 +1055,8 @@ void FuPoor::ImpForceQuadratic(::tools::Rectangle& rRect) void FuPoor::SwitchLayer (sal_Int32 nOffset) { - if(mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) + if(auto pDrawViewShell = dynamic_cast<DrawViewShell *>( mpViewShell )) { - DrawViewShell* pDrawViewShell = - static_cast<DrawViewShell*>(mpViewShell); - // Calculate the new index. sal_Int32 nIndex = pDrawViewShell->GetActiveTabLayerIndex() + nOffset; diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx index 4d6002d46571..8f3aaca436c7 100644 --- a/sd/source/ui/func/fuprlout.cxx +++ b/sd/source/ui/func/fuprlout.cxx @@ -271,10 +271,8 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) // fake a mode change to repaint the page tab bar - if( mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr ) + if( auto pDrawViewSh = dynamic_cast<DrawViewShell *>( mpViewShell ) ) { - DrawViewShell* pDrawViewSh = - static_cast<DrawViewShell*>(mpViewShell); EditMode eMode = pDrawViewSh->GetEditMode(); bool bLayer = pDrawViewSh->IsLayerModeActive(); pDrawViewSh->ChangeEditMode( eMode, !bLayer ); diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx index 49b0cff83f8f..9a486d488d39 100644 --- a/sd/source/ui/func/fuscale.cxx +++ b/sd/source/ui/func/fuscale.cxx @@ -75,7 +75,7 @@ void FuScale::DoExecute( SfxRequest& rReq ) nValue = static_cast<sal_Int16>(mpWindow->GetZoom()); // zoom on page size? - if( mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr && + if( dynamic_cast< DrawViewShell *>( mpViewShell ) && static_cast<DrawViewShell*>(mpViewShell)->IsZoomOnPage() ) { pZoomItem.reset(new SvxZoomItem( SvxZoomType::WHOLEPAGE, nValue )); diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 8ce4589973d6..ae817ac5d000 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -337,9 +337,9 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) if (bMarkChanges) mpView->MarkObj(aVEvt.pRootObj, pPV); - if (aVEvt.pObj && dynamic_cast< const SdrTextObj *>( aVEvt.pObj ) != nullptr) + if (auto pSdrTextObj = dynamic_cast<SdrTextObj *>( aVEvt.pObj )) { - mxTextObj.reset( static_cast<SdrTextObj*>(aVEvt.pObj) ); + mxTextObj.reset( pSdrTextObj ); } SetInEditMode(rMEvt, true); @@ -1196,10 +1196,10 @@ bool FuText::RequestHelp(const HelpEvent& rHEvt) const SvxFieldItem* pFieldItem = pOLV->GetFieldUnderMousePointer(); const SvxFieldData* pField = pFieldItem->GetField(); - if (pField && dynamic_cast< const SvxURLField *>( pField ) != nullptr) + if (auto pURLField = dynamic_cast< const SvxURLField *>( pField )) { // URL-Field - aHelpText = INetURLObject::decode( static_cast<const SvxURLField*>(pField)->GetURL(), INetURLObject::DecodeMechanism::WithCharset ); + aHelpText = INetURLObject::decode( pURLField->GetURL(), INetURLObject::DecodeMechanism::WithCharset ); } if (!aHelpText.isEmpty()) { @@ -1255,9 +1255,9 @@ void FuText::ReceiveRequest(SfxRequest& rReq) mpView->PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt); mpView->MarkObj(aVEvt.pRootObj, pPV); - if (aVEvt.pObj && dynamic_cast< SdrTextObj *>( aVEvt.pObj ) != nullptr) + if (auto pSdrTextObj = dynamic_cast< SdrTextObj *>( aVEvt.pObj )) { - mxTextObj.reset( static_cast< SdrTextObj* >( aVEvt.pObj ) ); + mxTextObj.reset( pSdrTextObj ); } } } diff --git a/sd/source/ui/func/futhes.cxx b/sd/source/ui/func/futhes.cxx index 75d0e665b207..b6596189d0cc 100644 --- a/sd/source/ui/func/futhes.cxx +++ b/sd/source/ui/func/futhes.cxx @@ -66,7 +66,7 @@ void FuThesaurus::DoExecute( SfxRequest& ) SfxErrorContext aContext(ERRCTX_SVX_LINGU_THESAURUS, OUString(), mpWindow->GetFrameWeld(), RID_SVXERRCTX, SvxResLocale()); - if (mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr) + if (dynamic_cast< DrawViewShell *>( mpViewShell )) { SdrTextObj* pTextObj = nullptr; @@ -108,7 +108,7 @@ void FuThesaurus::DoExecute( SfxRequest& ) DBG_ASSERT(eState != EESpellState::NoSpeller, "No SpellChecker"); } } - else if (mpViewShell && dynamic_cast< OutlineViewShell *>( mpViewShell ) != nullptr) + else if (dynamic_cast< OutlineViewShell *>( mpViewShell )) { Outliner* pOutliner = mpDoc->GetOutliner(); OutlinerView* pOutlView = pOutliner->GetView(0); diff --git a/sd/source/ui/func/fuvect.cxx b/sd/source/ui/func/fuvect.cxx index b2591437653a..d7fa7dc25378 100644 --- a/sd/source/ui/func/fuvect.cxx +++ b/sd/source/ui/func/fuvect.cxx @@ -59,12 +59,12 @@ void FuVectorize::DoExecute( SfxRequest& ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr ) + if( auto pSdrGrafObj = dynamic_cast< const SdrGrafObj *>( pObj ) ) { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); ScopedVclPtr<AbstractSdVectorizeDlg> pDlg( pFact->CreateSdVectorizeDlg(mpWindow ? mpWindow->GetFrameWeld() : nullptr, - static_cast<SdrGrafObj*>( pObj )->GetGraphic().GetBitmapEx().GetBitmap(), mpDocSh ) ); + pSdrGrafObj->GetGraphic().GetBitmapEx().GetBitmap(), mpDocSh ) ); if( pDlg->Execute() == RET_OK ) { const GDIMetaFile& rMtf = pDlg->GetGDIMetaFile(); diff --git a/sd/source/ui/func/sdundogr.cxx b/sd/source/ui/func/sdundogr.cxx index 64a6aae8c4b5..37b243f2b208 100644 --- a/sd/source/ui/func/sdundogr.cxx +++ b/sd/source/ui/func/sdundogr.cxx @@ -26,9 +26,9 @@ bool SdUndoGroup::Merge( SfxUndoAction* pNextAction ) { bool bRet = false; - if( pNextAction && dynamic_cast< const SdUndoAction *>( pNextAction ) != nullptr ) + if( auto pSdUndoAction = dynamic_cast<SdUndoAction *>( pNextAction ) ) { - SdUndoAction* pClone = static_cast< SdUndoAction* >( pNextAction )->Clone(); + SdUndoAction* pClone = pSdUndoAction->Clone(); if( pClone ) { |