summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-11-02 19:39:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-11-02 20:30:29 +0100
commit4d863fd8e38748607636d0033262baa62a3e9eb2 (patch)
treede15f5cd695199cfd56f1893bbb31cf06fc044d1 /sc
parent1a4151dcdf45a0fa946b6ddf5e1b5cca37d24619 (diff)
tdf#54857 elide more dynamic_cast
Change-Id: I42bef355eeef15e3733a5ee57b0569887cfa5e84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142183 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xiescher.cxx2
-rw-r--r--sc/source/filter/xcl97/xcl97esc.cxx2
-rw-r--r--sc/source/ui/drawfunc/drawsh4.cxx2
-rw-r--r--sc/source/ui/drawfunc/drtxtob2.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuconrec.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuconstr.cxx2
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx2
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx2
-rw-r--r--sc/source/ui/drawfunc/futext.cxx6
-rw-r--r--sc/source/ui/drawfunc/futext3.cxx2
10 files changed, 12 insertions, 12 deletions
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 4d60bd5b3f5d..7940758bffc5 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -1498,7 +1498,7 @@ rtl::Reference<SdrObject> XclImpTextObj::DoCreateSdrObj( XclImpDffConverter& rDf
void XclImpTextObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const
{
// set text data
- if( SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( &rSdrObj ) )
+ if( SdrTextObj* pTextObj = DynCastSdrTextObj( &rSdrObj ) )
{
if( maTextData.mxString )
{
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index cb87fb7c3731..03336e90b577 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -275,7 +275,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape
pAnchor->SetFlags( *pObj );
pCurrAppData->SetClientAnchor( pAnchor );
}
- const SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( pObj );
+ const SdrTextObj* pTextObj = DynCastSdrTextObj( pObj );
if( pTextObj && !lcl_IsFontwork( pTextObj ) && (pObj->GetObjIdentifier() != SdrObjKind::Caption) )
{
const OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
diff --git a/sc/source/ui/drawfunc/drawsh4.cxx b/sc/source/ui/drawfunc/drawsh4.cxx
index fdb0efe91615..226407b2ee1b 100644
--- a/sc/source/ui/drawfunc/drawsh4.cxx
+++ b/sc/source/ui/drawfunc/drawsh4.cxx
@@ -33,7 +33,7 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
if ( rMarkList.GetMarkCount() == 1 )
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >(pObj);
+ const SdrTextObj* pTextObj = DynCastSdrTextObj(pObj);
const bool bDeactivate(
!pObj ||
!pTextObj ||
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index a5b4a7394cdd..2c8ed5ac89cb 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -197,7 +197,7 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
if ( rMarkList.GetMarkCount() == 1 )
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >(pObj);
+ const SdrTextObj* pTextObj = DynCastSdrTextObj(pObj);
const bool bDeactivate(
!pObj ||
!pTextObj ||
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index 6c2d548094bb..d73915ca450e 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -137,7 +137,7 @@ bool FuConstRectangle::MouseButtonUp(const MouseEvent& rMEvt)
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
// create OutlinerParaObject now so it can be set to vertical
- if ( auto pSdrTextObj = dynamic_cast<SdrTextObj*>( pObj) )
+ if ( auto pSdrTextObj = DynCastSdrTextObj( pObj) )
pSdrTextObj->ForceOutlinerParaObject();
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
if( pOPO && !pOPO->IsEffectivelyVertical() )
diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx
index 1064a30e1093..0ffb6e832d3f 100644
--- a/sc/source/ui/drawfunc/fuconstr.cxx
+++ b/sc/source/ui/drawfunc/fuconstr.cxx
@@ -146,7 +146,7 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
SdrObject* pObj = pMark->GetMarkedSdrObj();
// if Uno-Controls no text mode
- if ( dynamic_cast<const SdrTextObj*>( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
+ if ( DynCastSdrTextObj( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
{
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
bool bVertical = ( pOPO && pOPO->IsEffectivelyVertical() );
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index ee9090765e2c..ea5f14a820d4 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -157,7 +157,7 @@ bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell& rViewShell, const KeyEvent* pInitialKey )
{
bool bReturn = false;
- if ( dynamic_cast<const SdrTextObj*>( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
+ if ( DynCastSdrTextObj( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
{
// start text edit - like FuSelection::MouseButtonUp,
// but with bCursorToEnd instead of mouse position
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 46b7fc47d040..2b051bb3bf11 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -490,7 +490,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
// not in UNO controls
// #i32352# not in media objects
- else if ( dynamic_cast<const SdrTextObj*>( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr && dynamic_cast<const SdrMediaObj*>( pObj) == nullptr )
+ else if ( DynCastSdrTextObj( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr && dynamic_cast<const SdrMediaObj*>( pObj) == nullptr )
{
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
bool bVertical = ( pOPO && pOPO->IsEffectivelyVertical() );
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index 7f0ec1281484..9bd670d3fa9d 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -416,7 +416,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
if(rMarkList.GetMark(0))
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if(auto pText = dynamic_cast<SdrTextObj*>( pObj))
+ if(auto pText = DynCastSdrTextObj( pObj))
{
SfxItemSet aSet(pDrDoc->GetItemPool());
@@ -557,7 +557,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
if (!(nSdrObjKind == SdrObjKind::Text ||
nSdrObjKind == SdrObjKind::TitleText ||
nSdrObjKind == SdrObjKind::OutlineText ||
- dynamic_cast<const SdrTextObj*>( pObj) != nullptr))
+ DynCastSdrTextObj( pObj) != nullptr))
return;
SdrPageView* pPV = pView->GetSdrPageView();
@@ -634,7 +634,7 @@ rtl::Reference<SdrObject> FuText::CreateDefaultObject(const sal_uInt16 nID, cons
if(pObj)
{
- if(auto pText = dynamic_cast<SdrTextObj*>( pObj.get() ))
+ if(auto pText = DynCastSdrTextObj( pObj.get() ))
{
pText->SetLogicRect(rRectangle);
diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx
index df601ea0d35c..1c13beea9388 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -122,7 +122,7 @@ void FuText::StopEditMode()
/* If the entire text has been cleared, the cell note and its caption
object have to be removed. */
- SdrTextObj* pTextObject = dynamic_cast< SdrTextObj* >( pObject );
+ SdrTextObj* pTextObject = DynCastSdrTextObj( pObject );
bool bDeleteNote = !pTextObject || !pTextObject->HasText();
if( bDeleteNote )
{