summaryrefslogtreecommitdiff
path: root/svx/source/unodraw/unoshtxt.cxx
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 /svx/source/unodraw/unoshtxt.cxx
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 'svx/source/unodraw/unoshtxt.cxx')
-rw-r--r--svx/source/unodraw/unoshtxt.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index 9dc311f9c438..b1ca3ff0c65e 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -110,7 +110,7 @@ private:
{
if (!mbShapeIsEditMode)
return false;
- SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( mpObject );
+ SdrTextObj* pTextObj = DynCastSdrTextObj( mpObject );
return pTextObj && pTextObj->IsTextEditActive();
}
@@ -170,7 +170,7 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject* pObject, SdrText* pText
if( !mpText )
{
- SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
+ SdrTextObj* pTextObj = DynCastSdrTextObj( mpObject );
if( pTextObj )
mpText = pTextObj->getText( 0 );
}
@@ -201,7 +201,7 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject& rObject, SdrText* pText
{
if( !mpText )
{
- SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
+ SdrTextObj* pTextObj = DynCastSdrTextObj( mpObject );
if( pTextObj )
mpText = pTextObj->getText( 0 );
}
@@ -441,7 +441,7 @@ void SvxTextEditSourceImpl::SetupOutliner()
if( !(mpObject && mpOutliner) )
return;
- SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( mpObject );
+ SdrTextObj* pTextObj = DynCastSdrTextObj( mpObject );
if( pTextObj )
{
tools::Rectangle aPaintRect;
@@ -462,7 +462,7 @@ void SvxTextEditSourceImpl::UpdateOutliner()
if( !(mpObject && mpOutliner) )
return;
- SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( mpObject );
+ SdrTextObj* pTextObj = DynCastSdrTextObj( mpObject );
if( pTextObj )
{
tools::Rectangle aPaintRect;
@@ -486,7 +486,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder()
{
if( mpOutliner == nullptr )
{
- SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( mpObject );
+ SdrTextObj* pTextObj = DynCastSdrTextObj( mpObject );
OutlinerMode nOutlMode = OutlinerMode::TextObject;
if( pTextObj && pTextObj->IsTextFrame() && pTextObj->GetTextKind() == SdrObjKind::OutlineText )
nOutlMode = OutlinerMode::OutlineObject;
@@ -536,7 +536,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder()
mpTextForwarder->flushCache();
std::optional<OutlinerParaObject> pOutlinerParaObject;
- SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( mpObject );
+ SdrTextObj* pTextObj = DynCastSdrTextObj( mpObject );
if( pTextObj && pTextObj->getActiveText() == mpText )
pOutlinerParaObject = pTextObj->CreateEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active
bool bOwnParaObj(false);
@@ -665,7 +665,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetTextForwarder()
{
assert(!mbForwarderIsEditMode); // because without a view there is no other option except !mbForwarderIsEditMode
bool bTextEditActive = false;
- SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>(mpObject);
+ SdrTextObj* pTextObj = DynCastSdrTextObj(mpObject);
// similar to the GetBackgroundTextForwarder check, see if the text edit is active
if (pTextObj && pTextObj->getActiveText() == mpText && pTextObj->CanCreateEditOutlinerParaObject())
bTextEditActive = true; // text edit active
@@ -685,7 +685,7 @@ std::unique_ptr<SvxDrawOutlinerViewForwarder> SvxTextEditSourceImpl::CreateViewF
mpView->GetTextEditOutliner()->SetNotifyHdl( LINK(this, SvxTextEditSourceImpl, NotifyHdl) );
mbNotifyEditOutlinerSet = true;
- SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( mpObject );
+ SdrTextObj* pTextObj = DynCastSdrTextObj( mpObject );
if( pTextObj )
{
tools::Rectangle aBoundRect( pTextObj->GetCurrentBoundRect() );
@@ -736,7 +736,7 @@ SvxEditViewForwarder* SvxTextEditSourceImpl::GetEditViewForwarder( bool bCreate
if(mpView->SdrBeginTextEdit(mpObject))
{
- SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( mpObject );
+ SdrTextObj* pTextObj = DynCastSdrTextObj( mpObject );
if (pTextObj && pTextObj->IsTextEditActive())
{
// create new view forwarder
@@ -773,7 +773,7 @@ void SvxTextEditSourceImpl::UpdateData()
{
if( mpOutliner && mpObject && mpText )
{
- SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
+ SdrTextObj* pTextObj = DynCastSdrTextObj( mpObject );
if( pTextObj )
{
if( (mpOutliner->GetParagraphCount() == 1 && mpOutliner->GetEditEngine().GetTextLen( 0 ) == 0 )