sw/source/core/frmedt/fecopy.cxx |   12 ++++--------
 sw/source/filter/ww8/ww8graf.cxx |    7 +++----
 2 files changed, 7 insertions(+), 12 deletions(-)

New commits:
commit d576baca31d2a2d9d96c203dfafb59dfda8f064b
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Oct 7 15:53:33 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Oct 7 17:46:04 2020 +0200

    dynamic_cast followed by static_cast
    
    Change-Id: I0e5b7a2531f10d7a9cafa45f33f128f82603f30f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104062
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index ffb74b457180..16a42d8a168b 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -397,10 +397,8 @@ bool SwFEShell::CopyDrawSel( SwFEShell& rDestShell, const 
Point& rSttPt,
                         pFormat->SetFormatAttr( SwFormatVertOrient( 
aPos.getY(), text::VertOrientation::NONE, text::RelOrientation::FRAME ) );
                         // #i47455# - notify draw frame format
                         // that position attributes are already set.
-                        if ( dynamic_cast<const SwDrawFrameFormat*>( pFormat) 
!=  nullptr )
-                        {
-                            
static_cast<SwDrawFrameFormat*>(pFormat)->PosAttrSet();
-                        }
+                        if (SwDrawFrameFormat *pDrawFormat = 
dynamic_cast<SwDrawFrameFormat*>(pFormat))
+                            pDrawFormat->PosAttrSet();
                     }
                     if( bSelectInsert )
                         pDestDrwView->MarkObj( pNew, pDestPgView );
@@ -997,10 +995,8 @@ bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable)
                                 pDV->MarkObj( pObj, pDV->GetSdrPageView() );
                                 // #i47455# - notify draw frame format
                                 // that position attributes are already set.
-                                if ( dynamic_cast<const SwDrawFrameFormat*>( 
pNew) !=  nullptr )
-                                {
-                                    
static_cast<SwDrawFrameFormat*>(pNew)->PosAttrSet();
-                                }
+                                if (SwDrawFrameFormat *pDrawFormat = 
dynamic_cast<SwDrawFrameFormat*>(pNew))
+                                    pDrawFormat->PosAttrSet();
                             }
                         }
                     }
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 53f9739502eb..3b24423abce6 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2817,11 +2817,10 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long 
nGrafAnchorCp )
         }
     }
 
+    SwDrawFrameFormat* pDrawFrameFormat = 
dynamic_cast<SwDrawFrameFormat*>(pRetFrameFormat);
     // #i44344#, #i44681# - positioning attributes already set
-    if ( pRetFrameFormat /*#i52825# */ && dynamic_cast< const 
SwDrawFrameFormat *>( pRetFrameFormat ) !=  nullptr )
-    {
-        static_cast<SwDrawFrameFormat*>(pRetFrameFormat)->PosAttrSet();
-    }
+    if (pDrawFrameFormat)
+        pDrawFrameFormat->PosAttrSet();
     if (!IsInlineEscherHack())
         MapWrapIntoFlyFormat(pRecord, pRetFrameFormat);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to