summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-08 13:33:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-08 14:38:15 +0200
commit3afb514362a2ce2701628256fa96d4a5324433d6 (patch)
tree914e6c3b6a37f66543db8515b1031ae65a230b63 /sw
parent73c8bd42650dafc38c87b5e6dc1ef222d4f6175c (diff)
simplify static_cast after dynamic_cast
Change-Id: I53ae7f18519fdd878730d1d0316ebc408271c66d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121811 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/swserv.cxx16
-rw-r--r--sw/source/core/text/txtfly.cxx2
2 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index cc2d3fe5dbf5..2236938a5ad2 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -299,14 +299,14 @@ SwDataChanged::~SwDataChanged()
{
::sfx2::SvLinkSourceRef refObj( rpLinkSrc );
// Anyone else interested in the Object?
- if( refObj->HasDataLinks() && dynamic_cast<const SwServerObject*>( refObj.get() ) != nullptr)
- {
- SwServerObject& rObj = *static_cast<SwServerObject*>( refObj.get() );
- if( m_pPos )
- rObj.SendDataChanged( *m_pPos );
- else
- rObj.SendDataChanged( *m_pPam );
- }
+ if( refObj->HasDataLinks())
+ if (auto pServerObj = dynamic_cast<SwServerObject*>( refObj.get() ))
+ {
+ if( m_pPos )
+ pServerObj->SendDataChanged( *m_pPos );
+ else
+ pServerObj->SendDataChanged( *m_pPam );
+ }
// We shouldn't have a connection anymore
if( !refObj->HasDataLinks() )
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 2e8e58b533ab..92508cde9bc3 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -224,7 +224,7 @@ SwRect SwContourCache::ContourRect( const SwFormat* pFormat,
// the graphic to change its size, call ClrObject()
tools::PolyPolygon aPoly;
if( !pVirtFlyDrawObj->GetFlyFrame()->GetContour( aPoly ) )
- aPoly = tools::PolyPolygon( static_cast<const SwVirtFlyDrawObj*>(pObj)->
+ aPoly = tools::PolyPolygon( pVirtFlyDrawObj->
GetFlyFrame()->getFrameArea().SVRect() );
aPolyPolygon.clear();
aPolyPolygon.append(aPoly.getB2DPolyPolygon());