[Libreoffice-commits] core.git: sw/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Mon Mar 6 14:26:04 UTC 2017


 sw/source/core/crsr/crsrsh.cxx     |    2 +-
 sw/source/core/doc/lineinfo.cxx    |    2 +-
 sw/source/core/draw/dflyobj.cxx    |    2 +-
 sw/source/core/edit/editsh.cxx     |    2 +-
 sw/source/core/frmedt/fefly1.cxx   |    2 +-
 sw/source/core/frmedt/feshview.cxx |    4 ++--
 sw/source/core/frmedt/fews.cxx     |    4 ++--
 sw/source/core/text/porfld.cxx     |    4 ++--
 8 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit fee627825f2efb228d9c4e81ed007dd8c7066c9b
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Mon Mar 6 12:28:43 2017 +0100

    sw: remove unnecessary upcasts
    
    guess some broken compiler needed these
    
    Change-Id: If0132f6363555fea2ef880bd7af343c2d7b2a0a4
    Reviewed-on: https://gerrit.libreoffice.org/34925
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index d252ad9..fb14f5a7 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2207,7 +2207,7 @@ void SwCursorShell::ShellGetFocus()
 /** Get current frame in which the cursor is positioned. */
 SwContentFrame *SwCursorShell::GetCurrFrame( const bool bCalcFrame ) const
 {
-    SET_CURR_SHELL( static_cast<SwViewShell*>(const_cast<SwCursorShell *>(this)) );
+    SET_CURR_SHELL( const_cast<SwCursorShell*>(this) );
     SwContentFrame *pRet = nullptr;
     SwContentNode *pNd = m_pCurrentCursor->GetContentNode();
     if ( pNd )
diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx
index 4839a3c..5da00dc 100644
--- a/sw/source/core/doc/lineinfo.cxx
+++ b/sw/source/core/doc/lineinfo.cxx
@@ -106,7 +106,7 @@ SwCharFormat* SwLineNumberInfo::GetCharFormat( IDocumentStylePoolAccess& rIDSPA
     if ( !GetRegisteredIn() )
     {
         SwCharFormat* pFormat = rIDSPA.GetCharFormatFromPool( RES_POOLCHR_LINENUM );
-        pFormat->Add( const_cast<SwClient*>(static_cast<SwClient const *>(this)) );
+        pFormat->Add( const_cast<SwLineNumberInfo*>(this) );
     }
     return const_cast<SwCharFormat*>(static_cast<const SwCharFormat*>(GetRegisteredIn()));
 }
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 59ab8b1..6513ec9 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -976,7 +976,7 @@ SdrObject* SwVirtFlyDrawObj::CheckMacroHit( const SdrObjMacroHitRec& rRec ) cons
             {
                 if( !rURL.GetMap() ||
                     m_pFlyFrame->GetFormat()->GetIMapObject( rRec.aPos, m_pFlyFrame ))
-                    return const_cast<SdrObject*>(static_cast<SdrObject const *>(this));
+                    return const_cast<SwVirtFlyDrawObj*>(this);
 
                 return nullptr;
             }
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index b58e657..f733d2b 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -577,7 +577,7 @@ void *SwEditShell::GetIMapInventor() const
 Graphic SwEditShell::GetIMapGraphic() const
 {
     // returns always a graphic if the cursor is in a Fly
-    SET_CURR_SHELL( const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this)) );
+    SET_CURR_SHELL( const_cast<SwEditShell*>(this) );
     Graphic aRet;
     SwPaM* pCursor = GetCursor();
     if ( !pCursor->HasMark() )
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 1536cf3..a2c30f8 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -990,7 +990,7 @@ bool SwFEShell::GetFlyFrameAttr( SfxItemSet &rSet ) const
         return false;
     }
 
-    SET_CURR_SHELL( const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this)) );
+    SET_CURR_SHELL( const_cast<SwFEShell*>(this) );
 
     if( !rSet.Set( pFly->GetFormat()->GetAttrSet() ) )
         return false;
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 840c05d..687b885 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -598,7 +598,7 @@ FrameTypeFlags SwFEShell::GetSelFrameType() const
     {
         // obtain marked item as fly frame; if no fly frame, it must
         // be a draw object
-        const SwFlyFrame* pFly = ::GetFlyFromMarked(pMarkList, const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this)));
+        const SwFlyFrame* pFly = ::GetFlyFromMarked(pMarkList, const_cast<SwFEShell*>(this));
         if ( pFly != nullptr )
         {
             if( pFly->IsFlyLayFrame() )
@@ -1153,7 +1153,7 @@ bool SwFEShell::IsFrameSelected() const
         return false;
     else
         return nullptr != ::GetFlyFromMarked( &Imp()->GetDrawView()->GetMarkedObjectList(),
-                                        const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this)) );
+                                        const_cast<SwFEShell*>(this) );
 }
 
 bool SwFEShell::IsObjSelected( const SdrObject& rObj ) const
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index f26b1cf..ab0a560 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -72,7 +72,7 @@ void SwFEShell::EndAllActionAndCall()
 // Determine the Content's nearest to the point
 Point SwFEShell::GetContentPos( const Point& rPoint, bool bNext ) const
 {
-    SET_CURR_SHELL( const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this)) );
+    SET_CURR_SHELL( const_cast<SwFEShell*>(this) );
     return GetLayout()->GetNextPrevContentPos( rPoint, bNext );
 }
 
@@ -81,7 +81,7 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
 {
     const SwFrame *pFrame = Imp()->HasDrawView()
                 ? ::GetFlyFromMarked( &Imp()->GetDrawView()->GetMarkedObjectList(),
-                                      const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this)))
+                                      const_cast<SwFEShell*>(this))
                 : nullptr;
 
     if( !pFrame )
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 4f24e63..1a7a3bf 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -657,7 +657,7 @@ void SwNumberPortion::Paint( const SwTextPaintInfo &rInf ) const
     // follow field portions
     if ( ! IsFollow() )
     {
-        SwLinePortion *pThis = const_cast<SwLinePortion*>(static_cast<SwLinePortion const *>(this));
+        SwNumberPortion *pThis = const_cast<SwNumberPortion*>(this);
         pThis->Width( nSumWidth );
         rInf.DrawViewOpt( *this, POR_NUMBER );
         pThis->Width( nOldWidth );
@@ -683,7 +683,7 @@ void SwNumberPortion::Paint( const SwTextPaintInfo &rInf ) const
         else
         {
             // logical const: reset width
-            SwLinePortion *pThis = const_cast<SwLinePortion*>(static_cast<SwLinePortion const *>(this));
+            SwNumberPortion *pThis = const_cast<SwNumberPortion*>(this);
             bPaintSpace = bPaintSpace && nFixWidth < nOldWidth;
             sal_uInt16 nSpaceOffs = nFixWidth;
             pThis->Width( nFixWidth );


More information about the Libreoffice-commits mailing list