[Libreoffice-commits] .: 3 commits - binfilter/bf_sw

Caolán McNamara caolan at kemper.freedesktop.org
Mon Feb 21 13:10:34 PST 2011


 binfilter/bf_sw/source/filter/inc/w4wpar.hxx     |   41 +++++++++--------
 binfilter/bf_sw/source/filter/sw6/makefile.mk    |    2 
 binfilter/bf_sw/source/filter/sw6/sw6par.hxx     |    2 
 binfilter/bf_sw/source/filter/sw6/sw_sw6file.cxx |    4 -
 binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx  |   46 ++++++++++---------
 binfilter/bf_sw/source/filter/w4w/sw_w4watr.cxx  |   26 ++---------
 binfilter/bf_sw/source/filter/w4w/sw_w4wgraf.cxx |   54 +++++++++--------------
 binfilter/bf_sw/source/filter/w4w/sw_w4wpar1.cxx |   47 ++++++++------------
 binfilter/bf_sw/source/filter/w4w/sw_w4wpar2.cxx |   33 +++++++-------
 binfilter/bf_sw/source/filter/w4w/sw_w4wpar3.cxx |    8 +--
 binfilter/bf_sw/source/filter/w4w/sw_w4wstk.cxx  |    4 +
 11 files changed, 122 insertions(+), 145 deletions(-)

New commits:
commit 0325c492a9cb78308deabe64a39a823be25a9aa4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Feb 21 21:06:35 2011 +0000

    throw out some warnings

diff --git a/binfilter/bf_sw/source/filter/inc/w4wpar.hxx b/binfilter/bf_sw/source/filter/inc/w4wpar.hxx
index 02432a4..b2611b0 100644
--- a/binfilter/bf_sw/source/filter/inc/w4wpar.hxx
+++ b/binfilter/bf_sw/source/filter/inc/w4wpar.hxx
@@ -230,19 +230,19 @@ struct W4WPDTInfo
     BOOL	bPageWidthUnknown	:1;// Page Margin rechts noch nicht eingestellt
     BOOL	bPageHeightUnknown	:1;//			  unten
     W4WPDTInfo()
-       :nPageType(    1 ),
-        nPageSubType( 0 ),
-        nRects(		  0 ),
-        pIds(         0 ),
-        nBodyRectId(  USHRT_MAX ),
-        nHdRectId(    USHRT_MAX ),
-        nFtRectId(    USHRT_MAX ),
-        nSwPdId(      USHRT_MAX )
-        {
-            bSwPdUsed			= FALSE;
-            bPageWidthUnknown	= TRUE;
-            bPageHeightUnknown	= TRUE;
-        }
+       : pIds(0)
+       , nPageType(1)
+       , nPageSubType(0)
+       , nRects(0)
+       , nSwPdId(USHRT_MAX)
+       , nBodyRectId(USHRT_MAX)
+       , nHdRectId(USHRT_MAX)
+       , nFtRectId(USHRT_MAX)
+    {
+        bSwPdUsed			= FALSE;
+        bPageWidthUnknown	= TRUE;
+        bPageHeightUnknown	= TRUE;
+    }
     ~W4WPDTInfo(){ delete pIds; }
     BOOL PageSizeKnown(){ return 0 == (   bPageWidthUnknown
                                         | bPageHeightUnknown ); }
@@ -258,10 +258,10 @@ struct W4WFLOInfo
     long	nRects;
     BOOL	bFlowUsed:1;
     W4WFLOInfo()
-       :nFlowId( 0 ),
-        nRects(  0 ),
-        pIds(    0 )
-        { bFlowUsed = FALSE; }
+       : pIds(0)
+       , nFlowId(0)
+       , nRects(0)
+    { bFlowUsed = FALSE; }
     ~W4WFLOInfo(){ delete pIds; }
 };
 typedef W4WFLOInfo* W4WFLOInfo_Ptr;
@@ -845,8 +845,11 @@ struct W4WStyleIdTabEntry
     W4WStyleIdTabEntry( SwW4WParser& rParser, USHORT nId,
                         const sal_Unicode* pName );
         // ctor fuers suchen !!
-    W4WStyleIdTabEntry( USHORT nSeekId ) :	nStyleId( nSeekId ), pColl(0),
-                                            bSetAttributes( TRUE ) {}
+    W4WStyleIdTabEntry( USHORT nSeekId )
+        : pColl(0)
+        , nStyleId( nSeekId )
+        , bSetAttributes( TRUE )
+    {}
 
     inline BOOL operator==( const W4WStyleIdTabEntry&) const;
     inline BOOL operator<( const W4WStyleIdTabEntry&) const;
commit ff06708c678d798b39bccbfbe0a4d8c26dddccd7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Feb 21 21:05:40 2011 +0000

    throw out some warnings

diff --git a/binfilter/bf_sw/source/filter/w4w/sw_w4watr.cxx b/binfilter/bf_sw/source/filter/w4w/sw_w4watr.cxx
index 151a9ff..9b76da7 100644
--- a/binfilter/bf_sw/source/filter/w4w/sw_w4watr.cxx
+++ b/binfilter/bf_sw/source/filter/w4w/sw_w4watr.cxx
@@ -132,26 +132,11 @@ inline int LO_BYTE( USHORT n )  { return (int)( n & 0xff ); }
 // PageDescs
 //
 
-void OutW4W_SwFmtPageDesc1(  const SwPageDesc* pPg )
+void OutW4W_SwFmtPageDesc1(  const SwPageDesc* )
 {
     return;
 }
 
-
-
-
-
-
-static void CalcFontSize(  const SwFmt& rFmt,
-                            USHORT& rFontId, USHORT& rFontHeight )
-{
-/*    UINT32 nFontHeight = rFmt.GetSize().GetHeight();
-    rFontHeight = ( nFontHeight > USHRT_MAX ) ? USHRT_MAX : (USHORT)nFontHeight;
-    rFontId = rW4WWrt.GetId( rFmt.GetFont() );
-*/
-}
-
-
 /* Ausgabe der Nodes */
 
 /*
@@ -175,12 +160,15 @@ struct W4WSttEndPos
 };
 
 W4WSttEndPos::W4WSttEndPos( const SwTxtAttr* pTxtAt, USHORT nFSize, USHORT nFId )
-    : pTxtAttr(pTxtAt), nFontSize(nFSize), nFontId( nFId )
+    : nFontSize(nFSize)
+    , nFontId( nFId )
+    , pTxtAttr(pTxtAt)
 {}
 
 W4WSttEndPos::W4WSttEndPos( const W4WSttEndPos & rSEPos )
-    : pTxtAttr( rSEPos.pTxtAttr), nFontSize( rSEPos.nFontSize ),
-    nFontId( rSEPos.nFontId )
+    : nFontSize( rSEPos.nFontSize )
+    , nFontId( rSEPos.nFontId )
+    , pTxtAttr( rSEPos.pTxtAttr)
 {}
 
 BOOL W4WSttEndPos::operator<( const W4WSttEndPos & rSEPos )
diff --git a/binfilter/bf_sw/source/filter/w4w/sw_w4wgraf.cxx b/binfilter/bf_sw/source/filter/w4w/sw_w4wgraf.cxx
index ae52f27..8c1f49a 100644
--- a/binfilter/bf_sw/source/filter/w4w/sw_w4wgraf.cxx
+++ b/binfilter/bf_sw/source/filter/w4w/sw_w4wgraf.cxx
@@ -372,16 +372,17 @@ if( 24 > n4ColBits )
         pB = pBuf;
         while ( nLeft > 0 ){
             nRun = (BYTE)GetHexByte();
-            if ( ( nRun & 0x80 ) != 0 ){    // komprimiert
+            if ( ( nRun & 0x80 ) != 0 ) //komprimiert
+            {
                 nRun &= 0x7f;
                 c = (BYTE)GetHexByte();
-                for ( x=0; x<nRun; x++){
+                for ( x=0; x<nRun && pB < pBuf+nWdtOut; x++)
                     *pB++ = c;
-                }
-            }else{                          // unkomprimiert
-                for ( x=0; x<nRun; x++){
+            }
+            else // unkomprimiert
+            {
+                for ( x=0; x<nRun && pB < pBuf+nWdtOut; x++)
                     *pB++ = (BYTE)GetHexByte();
-                }
             }
             nLeft -= nRun;
         }
@@ -717,23 +718,19 @@ int SwW4WGraf::GetNextVectRec(OutputDevice& rOut)
         */
         case W4WRG_TextBox: {
             // Dummy-Implementation
-            short nDummy;
-            for( USHORT i=0; i < nVarSize; i++) nDummy = GetHexByte();
+            for( USHORT i=0; i < nVarSize; i++) GetHexByte();
         } break;
         case W4WRG_StClPath: {
             // Dummy-Implementation
-            short nDummy;
-            for( USHORT i=0; i < nVarSize; i++) nDummy = GetHexByte();
+            for( USHORT i=0; i < nVarSize; i++) GetHexByte();
         } break;
         case W4WRG_EoClPath: {
             // Dummy-Implementation
-            short nDummy;
-            for( USHORT i=0; i < nVarSize; i++) nDummy = GetHexByte();
+            for( USHORT i=0; i < nVarSize; i++) GetHexByte();
         } break;
         case W4WRG_Bezier: {
             // Dummy-Implementation
-            short nDummy;
-            for( USHORT i=0; i < nVarSize; i++) nDummy = GetHexByte();
+            for( USHORT i=0; i < nVarSize; i++) GetHexByte();
         } break;
         /*
         case W4WRG_Dr24bitBMap: {
@@ -742,38 +739,31 @@ int SwW4WGraf::GetNextVectRec(OutputDevice& rOut)
         */
         case W4WRG_Comment: {
             // Dummy-Implementation
-            short nDummy;
-            for( USHORT i=0; i < nVarSize; i++) nDummy = GetHexByte();
+            for( USHORT i=0; i < nVarSize; i++) GetHexByte();
         } break;
         case W4WRG_Spline: {
             // Dummy-Implementation
-            short nDummy;
-            for( USHORT i=0; i < nVarSize; i++) nDummy = GetHexByte();
+            for( USHORT i=0; i < nVarSize; i++) GetHexByte();
         } break;
         case W4WRG_Transform: {
             // Dummy-Implementation
-            short nDummy;
-            for( USHORT i=0; i < nVarSize; i++) nDummy = GetHexByte();
+            for( USHORT i=0; i < nVarSize; i++) GetHexByte();
         } break;
         case W4WRG_LineHead: {
             // Dummy-Implementation
-            short nDummy;
-            for( USHORT i=0; i < nVarSize; i++) nDummy = GetHexByte();
+            for( USHORT i=0; i < nVarSize; i++) GetHexByte();
         } break;
         case W4WRG_LineTail: {
             // Dummy-Implementation
-            short nDummy;
-            for( USHORT i=0; i < nVarSize; i++) nDummy = GetHexByte();
+            for( USHORT i=0; i < nVarSize; i++) GetHexByte();
         } break;
         case W4WRG_CanvasCol: {
             // Dummy-Implementation
-            short nDummy;
-            for( USHORT i=0; i < nVarSize; i++) nDummy = GetHexByte();
+            for( USHORT i=0; i < nVarSize; i++) GetHexByte();
         } break;
         case W4WRG_BmpPos: {
             // Dummy-Implementation
-            short nDummy;
-            for( USHORT i=0; i < nVarSize; i++) nDummy = GetHexByte();
+            for( USHORT i=0; i < nVarSize; i++) GetHexByte();
         } break;
 
 // Bitmap und Vektoren gemischt geht nicht, denn im W4W-BitmapRec steht
@@ -953,8 +943,8 @@ short SwW4WGraf::ReadGrafFile( long nTyp, long nWidth, long nHeight )   // Grafi
                 // Info ueber ihn. Ich nehme mal an, dass er immer
                 // gleich ist wie in den Beispiel-Dateien von WpWin52
 
-                for ( int i = 0; i < sizeof( WpgFileHd ); i++ )  // Schreibe Header
-                    aOut << WpgFileHd[ i ];
+                for (size_t i = 0; i < sizeof(WpgFileHd); ++i)  // Schreibe Header
+                    aOut << WpgFileHd[i];
             }
             break;
 
@@ -964,8 +954,8 @@ short SwW4WGraf::ReadGrafFile( long nTyp, long nWidth, long nHeight )   // Grafi
                 // haben einen verstuemmelten Header
                 // sowie eine andere Dateilaenge als
                 // die Original-Dateien
-                short s = ReadChar();	// ueberlies " 0 | "
-                s = ReadChar();
+                ReadChar();	// ueberlies " 0 | "
+                ReadChar();
             }
             break;
 
diff --git a/binfilter/bf_sw/source/filter/w4w/sw_w4wpar1.cxx b/binfilter/bf_sw/source/filter/w4w/sw_w4wpar1.cxx
index 4f6b6d1..6fb3a14 100644
--- a/binfilter/bf_sw/source/filter/w4w/sw_w4wpar1.cxx
+++ b/binfilter/bf_sw/source/filter/w4w/sw_w4wpar1.cxx
@@ -537,8 +537,7 @@ void SwW4WParser::Read_SetTray()		// (SFB)
 
     if( bStyleDef ) return;
 
-    if( GetDecimal( nOldTray ) && !nError
-        && W4WR_TXTERM != GetDecimal( nTray ) || nError )
+    if ( (GetDecimal(nOldTray) && !nError && W4WR_TXTERM != GetDecimal(nTray)) || nError )
         return;
 
     pPageDesc->GetMaster().SetAttr( SvxPaperBinItem( RES_PAPER_BIN, (BYTE)nTray));
@@ -563,8 +562,10 @@ SV_DECL_PTRARR_SORT( W4WStyleIdTab, W4WStyleIdTabEntryPtr, 0, 4 )
 
 SwW4WParser::SwW4WParser( const SwPaM & rPaM, SvStream& rIstream,
                         BOOL bNewDoc, USHORT nFilterNo, const String& rVers )
-    : pCurPaM( (SwPaM*)&rPaM ), bNew( bNewDoc ), rVersion( rVers ),
-    rInp( rIstream )
+    : rVersion( rVers )
+    , pCurPaM( (SwPaM*)&rPaM )
+    , rInp( rIstream )
+    , bNew( bNewDoc )
 {
     pDoc = rPaM.GetDoc();
     rInp.Seek( STREAM_SEEK_TO_END );
@@ -1086,9 +1087,9 @@ BOOL SwW4WParser::GetString( String& rString, const int nEndCode1, const int nEn
 
 BYTE SwW4WParser::GetDeciByte( BYTE& rByteVal )
 {
-    register BYTE n;
-    register BOOL Ok = FALSE;
-    BYTE nCode;
+    BYTE n = 0;
+    BOOL Ok = FALSE;
+    BYTE nCode = 0;
 
     while( this )
     {
@@ -1118,9 +1119,9 @@ BYTE SwW4WParser::GetDeciByte( BYTE& rByteVal )
 
 BYTE SwW4WParser::GetHexByte( BYTE& rHexVal )
 {
-    register unsigned int c1 = 0;	// shorts sind schneller als char (WIN)
-    register unsigned int c2 = 0;
-    register unsigned int nRet;
+    unsigned int c1 = 0;	// shorts sind schneller als char (WIN)
+    unsigned int c2 = 0;
+    unsigned int nRet = 0;
 
     rHexVal = 0;
 
@@ -1280,7 +1281,7 @@ void SwW4WParser::Flush()
         {
             UpdatePageMarginSettings( CALLED_BY_FLUSH_OR_HNL );
         }
-        if ( nParaLen >= MAX_ASCII_PARA - CHARBUF_SIZE - 100 )
+        if ( nParaLen >= static_cast<long>(MAX_ASCII_PARA - CHARBUF_SIZE - 100) )
         {
             sal_Unicode* pBuf = aCharBuffer;
             for( ; 0 != *pBuf; ++pBuf )
@@ -1578,8 +1579,7 @@ void SwW4WParser::Read_HardNewLine()			// (HNL)
 
     BYTE c = ReadChar();
 
-    if(    (0   == c)
-        || (EOF == c) )
+    if ( (0 == c) || (EOF == c) )
     {
         nError = ERR_CHAR; 	// falsches Zeichen oder EOF
         return;
@@ -1636,9 +1636,9 @@ void SwW4WParser::Read_HardNewLine()			// (HNL)
             // wenn kein Style hart gesetzt ist
             // Override Style "Tabellenkopf", "Tabelleninhalt"
             // mit vorher gueltigem Style
-            const SwPosition& rPos = *pCurPaM->GetPoint();
-            pCtrlStck->NewAttr( rPos,  SwW4WStyle( nTabStyleId ) );
-            pCtrlStck->SetAttr( rPos, RES_FLTR_STYLESHEET );
+            const SwPosition& rLclPos = *pCurPaM->GetPoint();
+            pCtrlStck->NewAttr( rLclPos,  SwW4WStyle( nTabStyleId ) );
+            pCtrlStck->SetAttr( rLclPos, RES_FLTR_STYLESHEET );
         }
         ActivateTxtFlags();
 
@@ -1808,10 +1808,10 @@ void SwW4WParser::Read_DateTime()			// (DTF)
             pFormatter->PutandConvertEntry( *pLast, nCheckPos, nType, nKey,
                                             LANGUAGE_GERMAN,
                                             /*nLang*/LANGUAGE_SYSTEM );
-            SwDateTimeField aFld( (SwDateTimeFieldType*)
+            SwDateTimeField aLclFld( (SwDateTimeFieldType*)
                         pDoc->GetSysFldType( RES_DATETIMEFLD ),
                         &sTime == pLast ? TIMEFLD : DATEFLD, nKey );
-            pDoc->Insert( *pCurPaM, SwFmtFld( aFld ) );
+            pDoc->Insert( *pCurPaM, SwFmtFld( aLclFld ) );
         }
     }
 }
@@ -2551,8 +2551,6 @@ void SwW4WParser::Read_SetPitchAndOrFont()		// (SPF)
             SvxFontItem aFont( ((SvxFontItem&)pDoc->GetAttrPool().GetDefaultItem(
                                 RES_CHRATR_FONT ) ));
 
-            FontFamily eFamily = FAMILY_DONTKNOW;
-
             if( sFntNm.Len() )
             {
 #if defined( WIN ) || defined ( WNT )
@@ -2584,9 +2582,6 @@ void SwW4WParser::Read_SetPitchAndOrFont()		// (SPF)
                 else if ( sFntNm.EqualsAscii( "Courier New" ))
                     sFntNm.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Courier" ));
 #endif // MAC
-
-                if ( sFntNm.EqualsAscii( "Script" ))
-                    eFamily = FAMILY_SCRIPT;
             }
 
             switch( nOptProp )
@@ -3680,8 +3675,8 @@ ULONG W4WReader::Read( SwDoc &rDoc, SwPaM &rPam, const String & )
 
         // den Stream kommt mit dem internen Format oeffnen
         SfxMedium aMedium( aTmpFile, STREAM_READ, TRUE );
-        SvStream* pStrm = aMedium.GetInStream();
-        if( pStrm && SVSTREAM_OK == pStrm->GetError() )
+        SvStream* pLclStrm = aMedium.GetInStream();
+        if( pLclStrm && SVSTREAM_OK == pLclStrm->GetError() )
         {
             if( !bInsertMode )
             {
@@ -3689,7 +3684,7 @@ ULONG W4WReader::Read( SwDoc &rDoc, SwPaM &rPam, const String & )
                 Reader::ResetFrmFmts( rDoc );
             }
 
-            SwW4WParser *pParser = new SwW4WParser( rPam, *pStrm,
+            SwW4WParser *pParser = new SwW4WParser( rPam, *pLclStrm,
                             !bInsertMode, GetFilter(), GetVersion() );
             if( !pParser->CallParser() )
 // !! hier muss der interne Fehler noch auf den SWG-Fehler gemappt werden !!
diff --git a/binfilter/bf_sw/source/filter/w4w/sw_w4wpar2.cxx b/binfilter/bf_sw/source/filter/w4w/sw_w4wpar2.cxx
index 1185d80..ff5b112 100644
--- a/binfilter/bf_sw/source/filter/w4w/sw_w4wpar2.cxx
+++ b/binfilter/bf_sw/source/filter/w4w/sw_w4wpar2.cxx
@@ -968,8 +968,8 @@ void SwW4WParser::Read_BeginAbsPosObj()				// (APO)
         static const RndStdIds nAnchorTab[]={ FLY_AT_CNTNT,		// Absatz
                                               FLY_PAGE, 	 	// Seite
                                               FLY_IN_CNTNT }; 	// Buchstabe
-        if ( nAnchor >= sizeof(nAnchorTab)/sizeof(RndStdIds)) nAnchor = 0;
-
+        if (nAnchor >= static_cast<long>(SAL_N_ELEMENTS(nAnchorTab)))
+            nAnchor = 0;
         RndStdIds eAnchor = nAnchorTab[ nAnchor ];
 
         if ( ( nIniFlags & W4WFL_NO_FLY_IN_CNTNT )
@@ -992,12 +992,13 @@ void SwW4WParser::Read_BeginAbsPosObj()				// (APO)
         static const SwVertOrient nVAlignTab[]={ VERT_NONE, VERT_TOP,
                                                 VERT_CENTER, VERT_BOTTOM,
                                                 VERT_NONE };
-        if ( nVAlign >= sizeof(nVAlignTab)/sizeof(SwVertOrient)) nVAlign = 0;
+        if (nVAlign >= static_cast<long>(SAL_N_ELEMENTS(nVAlignTab)))
+            nVAlign = 0;
         SwVertOrient eVAlign = nVAlignTab[ nVAlign ];
 
         static const SwHoriOrient nHAlignTab[]={ HORI_LEFT, HORI_RIGHT,
                                                   HORI_CENTER, HORI_NONE};
-        if ( nHAlign >= sizeof(nHAlignTab)/sizeof(SwHoriOrient))
+        if (nHAlign >= static_cast<long>(SAL_N_ELEMENTS(nHAlignTab)))
             nHAlign = 3;
         SwHoriOrient eHAlign = nHAlignTab[ nHAlign ];
 
@@ -1647,7 +1648,7 @@ void SetCols( SwFrmFmt &rFmt, long nCols, W4W_ColdT* pActTabDefs, long nNettoWid
     long nLastDist	= 0;
     long nLastWidth	= 0;
 
-    for( int i=0; bEqual, i<(int)nCols; i++ )
+    for( int i=0; i<(int)nCols; i++ )
     {
         // Spalten-Breite
         long nActWidth = pActTabDefs[ i ].nRightTw - pActTabDefs[ i ].nLeftTw;
@@ -1672,7 +1673,7 @@ void SetCols( SwFrmFmt &rFmt, long nCols, W4W_ColdT* pActTabDefs, long nNettoWid
     {
         aCol.Init( (USHORT)nCols, (USHORT)nAveDist, USHRT_MAX );
         // Spalten unterschiedlich breit: fein, das kann der Writer inzwischen!
-        USHORT nWishWidth = 0, nLeftDist = 0, nRightDist = 0;
+        USHORT nWishWidth = 0, nLeftDist = 0;
         USHORT i;
         for( i = 0; i < nCols; i++ )
         {
@@ -1682,19 +1683,17 @@ void SetCols( SwFrmFmt &rFmt, long nCols, W4W_ColdT* pActTabDefs, long nNettoWid
             long nWidth = pActTabDefs[ i ].nRightTw - pActTabDefs[ i ].nLeftTw;
             if( i < nCols-1 )
             {
-                long nRightDist = pActTabDefs[ i ].nRightTw - pActTabDefs[ i+1 ].nLeftTw;
-                nRightDist = nWidth / 2;
-                pCol->SetRight( (USHORT)nRightDist );
+                long nLclRightDist = pActTabDefs[ i ].nRightTw - pActTabDefs[ i+1 ].nLeftTw;
+                nLclRightDist = nWidth / 2;
+                pCol->SetRight( (USHORT)nLclRightDist );
             }
-            else
-                nRightDist = 0; // letzte Spalte hat keinen Zwischenraum mehr
 
             pCol->SetWishWidth( nWidth + nLeftDist + pCol->GetRight() );
 
             // aufsummierte Spaltenbreiten ergeben Gesamtbreite
             nWishWidth += pCol->GetWishWidth();
             // Halber Abstand ist an naechster Spalte noch zu setzen
-            nLeftDist = nRightDist;
+            nLeftDist = 0;
         }
         aCol.SetWishWidth( nWishWidth );
     }
@@ -1940,12 +1939,14 @@ void SwW4WParser::Read_BeginColumnMode()		// (BCM)
     if( pCurPaM->GetPoint()->nContent.GetIndex() != 0 )
         pDoc->SplitNode( *pCurPaM->GetPoint() );
 
+    BOOL bOldIsTxtInPgDesc;
+
     if( bBCMStep2 && pDoc->IsIdxInTbl( pCurPaM->GetPoint()->nNode ) )
     {
         // Tabellen-Daten IN einer anderen Tabelle als Rohtext lesen
         Flush();
         BOOL bOldIsColMode = bIsColMode;
-        BOOL bOldIsTxtInPgDesc = bIsTxtInPgDesc;
+        bOldIsTxtInPgDesc = bIsTxtInPgDesc;
         bIsColMode         = TRUE;
         nTablInTablDepth++;
         while(     !nError
@@ -1975,7 +1976,7 @@ void SwW4WParser::Read_BeginColumnMode()		// (BCM)
     */
     ULONG nOldPos       = rInp.Tell();	 	// merke FilePos
     BOOL bOldTxtInDoc   = bTxtInDoc;
-    BOOL bOldIsTxtInPgDesc = bIsTxtInPgDesc;
+    bOldIsTxtInPgDesc = bIsTxtInPgDesc;
     BOOL bOldNoExec     = bNoExec;
     BYTE nOldErr        = nError;
     if( !pTabBorders )
@@ -2035,7 +2036,7 @@ void SwW4WParser::Read_BeginColumnMode()		// (BCM)
             USHORT* aAboveRow;
             if( iR > 0 )
                 aAboveRow = (*pTabBorders)[ iR-1 ];
-            USHORT* aBelowRow;
+            USHORT* aBelowRow(NULL);
             if( iR < nTabRows-1 )
                 aBelowRow = (*pTabBorders)[ iR+1 ];
 
@@ -2233,7 +2234,7 @@ void SwW4WParser::Read_BeginColumnMode()		// (BCM)
             und lies dabei den Tabellen-Inhalt in rTable ein
         */
         bWasCellAfterCBreak = FALSE;
-        BOOL bOldIsTxtInPgDesc = bIsTxtInPgDesc;
+        bOldIsTxtInPgDesc = bIsTxtInPgDesc;
         bBCMStep2 = TRUE;
         while (    !nError
                 && bIsColMode
diff --git a/binfilter/bf_sw/source/filter/w4w/sw_w4wpar3.cxx b/binfilter/bf_sw/source/filter/w4w/sw_w4wpar3.cxx
index 8ddcbad..1f7b351 100644
--- a/binfilter/bf_sw/source/filter/w4w/sw_w4wpar3.cxx
+++ b/binfilter/bf_sw/source/filter/w4w/sw_w4wpar3.cxx
@@ -82,7 +82,9 @@ SV_DECL_PTRARR_SORT( W4WStyleIdTab, W4WStyleIdTabEntryPtr, 0, 1 )
 
 W4WStyleIdTabEntry::W4WStyleIdTabEntry(	SwW4WParser& rParser, USHORT nId,
                                         const sal_Unicode* pName )
-    :  nStyleId( nId ), pColl( 0 ), bSetAttributes( TRUE )
+    : pColl( 0 )
+    , nStyleId( nId )
+    , bSetAttributes( TRUE )
 {
     String aName( pName );
 
@@ -1008,8 +1010,6 @@ BOOL SwW4WParser::Read_Analyze_FLO_PDT()// analysieren aller PDTs und ggfs.
                         SwRect& rBodyRect = rBodyInfo.aRect;
                         Point& rUpPos = pHdInfo ? pHdInfo->aRect.Pos()
                                                 : rBodyRect.Pos();
-                        Point& rLoPos = pFtInfo ? pFtInfo->aRect.Pos()
-                                                : rBodyRect.Pos();
 
                         nTop  = (USHORT)rUpPos.Y();
                         nLeft = (USHORT)rUpPos.X();
@@ -1313,8 +1313,6 @@ void SwW4WParser::Read_TextRectangelId()				// TRI
                         SwRect& rBodyRect = rBodyInfo.aRect;
                         Point& rUpPos = pHdInfo ? pHdInfo->aRect.Pos()
                                                 : rBodyRect.Pos();
-                        Point& rLoPos = pFtInfo ? pFtInfo->aRect.Pos()
-                                                : rBodyRect.Pos();
 
                         nTop  = (USHORT)rUpPos.Y();
                         nLeft = (USHORT)rUpPos.X();
diff --git a/binfilter/bf_sw/source/filter/w4w/sw_w4wstk.cxx b/binfilter/bf_sw/source/filter/w4w/sw_w4wstk.cxx
index 0bf3f5f..83a9bb9 100644
--- a/binfilter/bf_sw/source/filter/w4w/sw_w4wstk.cxx
+++ b/binfilter/bf_sw/source/filter/w4w/sw_w4wstk.cxx
@@ -187,7 +187,9 @@ BOOL W4WStkEntry::MakeRegion( SwPaM& rRegion ) const
 
 
 W4WCtrlStack::W4WCtrlStack( SwW4WParser& rPars )
-    : W4WCtrlStkEntries( 10, 5 ), pParentStack( 0 ), pParser( &rPars )
+    : W4WCtrlStkEntries( 10, 5 )
+    , pParser( &rPars )
+    , pParentStack( 0 )
 {
 }
 
commit 01b0c2970e75353b314486e998ac13c70f498891
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Feb 21 20:12:20 2011 +0000

    WaE: mark this dir as warnings free

diff --git a/binfilter/bf_sw/source/filter/sw6/makefile.mk b/binfilter/bf_sw/source/filter/sw6/makefile.mk
index c6d743e..c387886 100644
--- a/binfilter/bf_sw/source/filter/sw6/makefile.mk
+++ b/binfilter/bf_sw/source/filter/sw6/makefile.mk
@@ -25,8 +25,6 @@
 #
 #*************************************************************************
 
-EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-
 PRJ=..$/..$/..$/..
 BFPRJ=..$/..$/..
 
diff --git a/binfilter/bf_sw/source/filter/sw6/sw6par.hxx b/binfilter/bf_sw/source/filter/sw6/sw6par.hxx
index 2530af1..93defe2 100644
--- a/binfilter/bf_sw/source/filter/sw6/sw6par.hxx
+++ b/binfilter/bf_sw/source/filter/sw6/sw6par.hxx
@@ -130,7 +130,7 @@ private:
 
     void   InsertTOX(SwDoc &rDoc,SwPaM &rPaM,USHORT nLen,HFORM *pTmp,TOXTypes eTyp);
     void   InsertTab(USHORT nTab,TABU &rTab,SvxTabStopItem &rTabs,SwTwips nKor);
-    void   InsertExtra(SwDoc &rDoc,SwPaM &rPaM,const SwNodeIndex &rWohin,long lFPos,sal_Char *pcAKey=NULL);
+    void   InsertExtra(SwDoc &rDoc,SwPaM &rPaM,const SwNodeIndex &rWohin,long lFPos,const sal_Char *pcAKey=NULL);
     BOOL   InsertNote(SwDoc &rDoc,SwPaM &rPaM,USHORT nNote,BOOL bFuss);
     void   InsertAttr(SwDoc &rDoc,SwPaM &rPaM,ATTRBITS eAttr,BOOL bEin,SwTwips nSiz);
     void   InsertAForm(SwDoc &rDoc,SwPaM &rPaM,BYTE  *pCtrl);
diff --git a/binfilter/bf_sw/source/filter/sw6/sw_sw6file.cxx b/binfilter/bf_sw/source/filter/sw6/sw_sw6file.cxx
index a48807f..b61200c 100644
--- a/binfilter/bf_sw/source/filter/sw6/sw_sw6file.cxx
+++ b/binfilter/bf_sw/source/filter/sw6/sw_sw6file.cxx
@@ -362,8 +362,8 @@ BOOL Sw6File::ReadLn(String &rStr)
     rStr.Erase();                       // String ist leer
     while (FileOk())                    // Solange kein Fehler auftrat
     {
-        register BYTE *p = (BYTE *)&aBuf.pBuf[aBuf.nIdx], *pStt = p;
-        while (*p>'#' || *p>=' ' && *p<'#')
+        BYTE *p = (BYTE *)&aBuf.pBuf[aBuf.nIdx], *pStt = p;
+        while (*p>'#' || (*p>=' ' && *p<'#'))
             p++;
 
         xub_StrLen nAsc = p - pStt;
diff --git a/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx b/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx
index 2547bd2..82dfc71 100644
--- a/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx
+++ b/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx
@@ -3183,6 +3183,8 @@ void Sw6Layout::MerkeNoten(Bereich eNot)
             case ANot:
                 pLay->ANotenLink=Tell();
                 break;
+            default:
+                break;
         }
     }
 }
@@ -3566,8 +3568,8 @@ size_t Sw6Layout::PutRest(String &rStr,sal_Char *pCtrl)
                     else if (ScanKreuz("_N",pCtrl,nRet)){}
                     else if (ScanKreuz("_FN",pCtrl,nRet)){}
                     else if (ScanKreuz("_EN",pCtrl,nRet)){}
-                    else if (*pCtrl>='A' && *pCtrl<='Z' ||
-                             *pCtrl>='a' && *pCtrl<='z')
+                    else if ( (*pCtrl>='A' && *pCtrl<='Z') ||
+                             (*pCtrl>='a' && *pCtrl<='z') )
                     {
                         ByteString aFld(pCtrl,p-pCtrl);
                         aFld.Convert( RTL_TEXTENCODING_IBM_850,
@@ -3849,7 +3851,7 @@ BOOL Sw6Layout::LeseLayInfo(BOOL Konv)
         ReadLn(aStg);
         LocA->GliedLay=aStg.ToInt32();                     // Gliederungsebene
         if (LocA->GliedLay!=0 && LocA->
-            GliedLay<=sizeof(Glieder) &&
+            GliedLay<=static_cast<short>(sizeof(Glieder)) &&
             !Glieder[LocA->GliedLay-1])          // Gliederebene schon
         {                                        // mal genutzt worden?
           Glieder[LocA->GliedLay-1]=TRUE;
@@ -3974,7 +3976,7 @@ BOOL Sw6Layout::LeseLayInfo(BOOL Konv)
     return TRUE;
 }
 
-BOOL Sw6Layout::LeseKoFu(BOOL Kopf)
+BOOL Sw6Layout::LeseKoFu(BOOL bKopf)
 // Liesst harte Kopf- oder Fusstexte ein
 {
     short  Idx;
@@ -3982,13 +3984,13 @@ BOOL Sw6Layout::LeseKoFu(BOOL Kopf)
     String Stg;
     KOFU  *LocF;
 
-    pLay->DelLayout(FALSE,Kopf,!Kopf);           // Kopf oder Fusslayout loeschen
+    pLay->DelLayout(FALSE,bKopf,!bKopf);           // Kopf oder Fusslayout loeschen
     ReadLn(Stg);
     Anz=Stg.ToInt32();
     if (!FileOk()) return FALSE;
     for (Idx=0; Idx<Anz; Idx++)
     {
-        if (Kopf)
+        if (bKopf)
         {
             if ((LocF=pLay->HartKopf[Idx]=
                 new(KOFU))==NULL) return FALSE;
@@ -4037,6 +4039,8 @@ SvxAdjust Sw6Layout::TransAdj(SATZTYP eForm)
             break;
         case UnformSatz:               // Behandle wie linksbuendig
             break;
+        default:
+            break;
     } // switch
     return eAdj;
 }
@@ -4193,6 +4197,8 @@ void Sw6Layout::InsertTab(USHORT nTab,TABU &rTab,SvxTabStopItem &rTabs,SwTwips n
             break;
         case Tab_D:eAdjust=SVX_TAB_ADJUST_DECIMAL;
             break;
+        default:
+            break;
     } // switch
 
     SvxTabStop aTab(rTab.TabPos-nKor,eAdjust,cDfltDecimalChar,eFill);
@@ -4204,7 +4210,7 @@ void Sw6Layout::InsertTab(USHORT nTab,TABU &rTab,SvxTabStopItem &rTabs,SwTwips n
 }
 
 void Sw6Layout::InsertExtra(SwDoc &rDoc,SwPaM &rPaM,
-     const SwNodeIndex &rWohin,long lFPos,sal_Char *pcAKey)
+     const SwNodeIndex &rWohin,long lFPos,const sal_Char *pcAKey)
 // Fuege einen Sondertext an die Stelle rDoc/rPaM ein.
 // Dazu suche mittels Seek den Text, lese die Absaetze
 // ein und seeke wieder zurueck an die Ausgangsposition
@@ -4380,10 +4386,12 @@ void Sw6Layout::InsertLayouts(SwDoc &rDoc, SwPaM *pPaM)
 {
     short  Idx;         // Index fuer Layouts
 
-    SwFtnInfo aInfo;
-    aInfo=rDoc.GetFtnInfo();                     // Wow: was 'ne Aktion...!
-    aInfo.ePos=FTNPOS_PAGE;                      // GetFntInfo ist const &
-    rDoc.SetFtnInfo(aInfo);
+    {
+        SwFtnInfo aInfo;
+        aInfo=rDoc.GetFtnInfo();                     // Wow: was 'ne Aktion...!
+        aInfo.ePos=FTNPOS_PAGE;                      // GetFntInfo ist const &
+        rDoc.SetFtnInfo(aInfo);
+    }
 
     for (Idx=pLay->NumBlay-1; Idx>=0; Idx--)
     {
@@ -5299,14 +5307,13 @@ BOOL SwSw6Parser::ReadDocInfo(void)
 // Einlesen des DocInfo-Blocks
 // Wird auch gleich ins Doc gegeben
 {
-    BOOL bRet = FALSE, bIsTrans = IsTrans();
+    BOOL bIsTrans = IsTrans();
     SetTrans( TRUE );
 
     short Idx;
     if (ReadLn(pDat->DocInfo.Autor) &&
         ReadLn(pDat->DocInfo.Kateg))
     {
-        bRet = TRUE;
         pDat->DocInfo.Autor=pDat->DocInfo.Autor;
         pDat->DocInfo.Kateg=pDat->DocInfo.Kateg;
 
@@ -5319,10 +5326,7 @@ BOOL SwSw6Parser::ReadDocInfo(void)
                 rTmp.EraseTrailingChars();
             }
             else
-            {
-                bRet = FALSE;
                 break;
-            }
         }
         for (Idx=0;Idx<4;Idx++)
         {
@@ -5333,10 +5337,7 @@ BOOL SwSw6Parser::ReadDocInfo(void)
                 rTmp.EraseTrailingChars();
             }
             else
-            {
-                bRet = FALSE;
                 break;
-            }
         }
     }
     SetTrans( bIsTrans );
@@ -5513,9 +5514,10 @@ BOOL SwSw6Parser::CallParser()
 
 SwSw6Parser::SwSw6Parser(SwDoc *pSwDoc,const SwPaM &rSwPaM,
                          SvStream *pIstream,BOOL bNewDoc,
-                         ULONG *pErrno,const String *pFileName):
-        pDoc(pSwDoc),bNew(bNewDoc),
-        Sw6Layout(*pIstream,pErrno,pFileName)
+                         ULONG *pErrno,const String *pFileName)
+    : Sw6Layout(*pIstream,pErrno,pFileName)
+    , pDoc(pSwDoc)
+    , bNew(bNewDoc)
 
 // Konstruktor wie ihn der SWG benoetigt
 {


More information about the Libreoffice-commits mailing list