[Libreoffice-commits] .: sw/source

Julien Nabet serval2412 at kemper.freedesktop.org
Sat Feb 19 05:00:35 PST 2011


 sw/source/core/doc/doclay.cxx          |    4 ++--
 sw/source/core/undo/SwUndoPageDesc.cxx |   20 ++++++++++++--------
 2 files changed, 14 insertions(+), 10 deletions(-)

New commits:
commit e134799aefe62893f7992e69ea1fda0ab7ea58ed
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Feb 19 14:00:12 2011 +0100

    Some cppcheck cleaning

diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 3a29cc1..3282808 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1488,10 +1488,10 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
 {
 
     SwDrawContact* pContact = (SwDrawContact*)GetUserCall( &rSdrObj );
-    OSL_ENSURE( RES_DRAWFRMFMT == pContact->GetFmt()->Which(),
-            "Kein DrawFrmFmt" );
     if ( !pContact )
         return 0;
+    OSL_ENSURE( RES_DRAWFRMFMT == pContact->GetFmt()->Which(),
+            "Kein DrawFrmFmt" );
 
     SwDrawFrmFmt* pOldFmt = (SwDrawFrmFmt *)pContact->GetFmt();
     if( !pOldFmt )
diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx
index 893cb24..29959bd 100644
--- a/sw/source/core/undo/SwUndoPageDesc.cxx
+++ b/sw/source/core/undo/SwUndoPageDesc.cxx
@@ -53,12 +53,6 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
     ULONG nHeaderLeft = ULONG_MAX;
     ULONG nFooterMaster = ULONG_MAX;
     ULONG nFooterLeft = ULONG_MAX;
-    int nHeaderCount = 0;
-    int nLeftHeaderCount = 0;
-    int nFooterCount = 0;
-    int nLeftFooterCount = 0;
-    bool bSharedHeader = false;
-    bool bSharedFooter = false;
 
     SwFmtHeader& rHead = (SwFmtHeader&)rPageDesc.GetMaster().GetHeader();
     SwFmtFooter& rFoot = (SwFmtFooter&)rPageDesc.GetMaster().GetFooter();
@@ -72,27 +66,32 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
             SwClientIter aIter( *pHeaderFmt );
             SwClient *pLast = aIter.GoStart();
             if( pLast )
+            {
+                int nHeaderCount = 0;
                 do
                 {
                     ++nHeaderCount;
                 } while( 0 != ( pLast = aIter++ ));
+            }
             const SwFmtCntnt* pCntnt = &pHeaderFmt->GetCntnt();
             if( pCntnt->GetCntntIdx() )
                 nHeaderMaster = pCntnt->GetCntntIdx()->GetIndex();
             else
                 nHeaderMaster = 0;
         }
-        bSharedHeader = rPageDesc.IsHeaderShared();
         SwFrmFmt* pLeftHeaderFmt = rLeftHead.GetHeaderFmt();
         if( pLeftHeaderFmt )
         {
             SwClientIter aIter( *pLeftHeaderFmt );
             SwClient *pLast = aIter.GoStart();
             if( pLast )
+            {
+                int nLeftHeaderCount = 0;
                 do
                 {
                     ++nLeftHeaderCount;
                 } while( 0 != ( pLast = aIter++ ));
+            }
             const SwFmtCntnt* pLeftCntnt = &pLeftHeaderFmt->GetCntnt();
             if( pLeftCntnt->GetCntntIdx() )
                 nHeaderLeft = pLeftCntnt->GetCntntIdx()->GetIndex();
@@ -108,27 +107,32 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
             SwClientIter aIter( *pFooterFmt );
             SwClient *pLast = aIter.GoStart();
             if( pLast )
+            {
+                int nFooterCount = 0;
                 do
                 {
                     ++nFooterCount;
                 } while( 0 != ( pLast = aIter++ ));
+            }
             const SwFmtCntnt* pCntnt = &pFooterFmt->GetCntnt();
             if( pCntnt->GetCntntIdx() )
                 nFooterMaster = pCntnt->GetCntntIdx()->GetIndex();
             else
                 nFooterMaster = 0;
         }
-        bSharedFooter = rPageDesc.IsFooterShared();
         SwFrmFmt* pLeftFooterFmt = rLeftFoot.GetFooterFmt();
         if( pLeftFooterFmt )
         {
             SwClientIter aIter( *pLeftFooterFmt );
             SwClient *pLast = aIter.GoStart();
             if( pLast )
+            {
+                int nLeftFooterCount = 0;
                 do
                 {
                     ++nLeftFooterCount;
                 } while( 0 != ( pLast = aIter++ ));
+            }
             const SwFmtCntnt* pLeftCntnt = &pLeftFooterFmt->GetCntnt();
             if( pLeftCntnt->GetCntntIdx() )
                 nFooterLeft = pLeftCntnt->GetCntntIdx()->GetIndex();


More information about the Libreoffice-commits mailing list