[Libreoffice-commits] .: 2 commits - binfilter/bf_sw binfilter/inc

Caolán McNamara caolan at kemper.freedesktop.org
Wed Nov 24 07:41:46 PST 2010


 binfilter/bf_sw/source/core/sw3io/sw_sw3attr.cxx   |   19 +++++--------------
 binfilter/bf_sw/source/core/text/itratr.hxx        |   15 +++++++++++++--
 binfilter/bf_sw/source/core/text/itrform2.hxx      |    4 ++--
 binfilter/bf_sw/source/core/text/itrpaint.hxx      |    4 ++--
 binfilter/bf_sw/source/core/text/porlay.hxx        |    7 +++++--
 binfilter/bf_sw/source/core/text/sw_txtfrm.cxx     |   14 ++++++++------
 binfilter/bf_sw/source/core/text/sw_txttab.cxx     |   15 ++++++++-------
 binfilter/bf_sw/source/core/text/sw_widorp.cxx     |    7 +++++--
 binfilter/bf_sw/source/core/unocore/sw_unotext.cxx |    6 ------
 binfilter/inc/bf_sw/fmtclds.hxx                    |    2 +-
 binfilter/inc/bf_sw/fmtftntx.hxx                   |    7 +++++--
 11 files changed, 54 insertions(+), 46 deletions(-)

New commits:
commit fa4cb59e300c99576d68ba500dcea0a389c3d751
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 24 14:10:11 2010 +0000

    silence some annoying warnings

diff --git a/binfilter/bf_sw/source/core/sw3io/sw_sw3attr.cxx b/binfilter/bf_sw/source/core/sw3io/sw_sw3attr.cxx
index 11650f8..471a2f7 100644
--- a/binfilter/bf_sw/source/core/sw3io/sw_sw3attr.cxx
+++ b/binfilter/bf_sw/source/core/sw3io/sw_sw3attr.cxx
@@ -912,11 +912,8 @@ SvStream& SwGammaGrf::Store(SvStream & rStrm, USHORT ) const
 
 // -----------------------------------------------------------------------
 
-/*N*/ SvStream& SwRegisterItem::Store( SvStream& rStrm, USHORT nIVer ) const
+/*N*/ SvStream& SwRegisterItem::Store( SvStream& rStrm, USHORT /*nIVer*/ ) const
 /*N*/ {
-/*N*/ 	ASSERT( nIVer != USHRT_MAX,
-/*N*/ 			"SwRegisterItem: Wer faengt da Version USHRT_MAX nicht ab?" );
-/*N*/ 
 /*N*/ 	rStrm << (BYTE)GetValue();
 /*N*/ 	return rStrm;
 /*N*/ }
@@ -945,11 +942,8 @@ SvStream& SwGammaGrf::Store(SvStream & rStrm, USHORT ) const
 
 // -----------------------------------------------------------------------
 
-/*N*/ SvStream& SwFmtLineNumber::Store( SvStream& rStrm, USHORT nIVer ) const
+/*N*/ SvStream& SwFmtLineNumber::Store( SvStream& rStrm, USHORT /*nIVer*/ ) const
 /*N*/ {
-/*N*/ 	ASSERT( nIVer != USHRT_MAX,
-/*N*/ 			"SwFmtLineNumber: Wer faengt da Version USHRT_MAX nicht ab?" );
-/*N*/ 
 /*N*/ 	rStrm << static_cast<sal_uInt32>(nStartValue) << IsCount();
 /*N*/ 	return rStrm;
 /*N*/ }
@@ -982,11 +976,8 @@ SvStream& SwGammaGrf::Store(SvStream & rStrm, USHORT ) const
 
 // -----------------------------------------------------------------------
 
-/*N*/ SvStream& SwNumRuleItem::Store( SvStream& rStrm, USHORT nIVer ) const
+/*N*/ SvStream& SwNumRuleItem::Store( SvStream& rStrm, USHORT /*nIVer*/ ) const
 /*N*/ {
-/*N*/ 	ASSERT( nIVer != USHRT_MAX,
-/*N*/ 			"SwNumRuleItem: Wer faengt da Version USHRT_MAX nicht ab?" );
-/*N*/ 
 /*N*/ 	// Damit wir Pool-NumRules umbenennen koennen, muessen wir die
 /*N*/ 	// PoolId der NumRule rausfinden und mit speichern.
 /*N*/ 	UINT16 nPoolId = USHRT_MAX;
@@ -1042,7 +1033,7 @@ SvStream& SwGammaGrf::Store(SvStream & rStrm, USHORT ) const
 // -----------------------------------------------------------------------
 
 
-/*N*/ SfxPoolItem* SwTblBoxNumFormat::Create( SvStream& rStrm, USHORT nVer) const
+/*N*/ SfxPoolItem* SwTblBoxNumFormat::Create( SvStream& rStrm, USHORT /*nVer*/ ) const
 /*N*/ {
 /*N*/ 	BYTE nFlag;
 /*N*/ 	UINT32 nTmp;
@@ -1059,7 +1050,7 @@ SvStream& SwGammaGrf::Store(SvStream & rStrm, USHORT ) const
 /*N*/ }
 
 
-/*N*/ SvStream& SwTblBoxNumFormat::Store( SvStream& rStrm, USHORT nIVer ) const
+/*N*/ SvStream& SwTblBoxNumFormat::Store( SvStream& rStrm, USHORT /*nIVer*/ ) const
 /*N*/ {
 /*N*/ 	rStrm << GetValue() << (BYTE)bAuto;
 /*N*/ 	return rStrm;
diff --git a/binfilter/bf_sw/source/core/text/itratr.hxx b/binfilter/bf_sw/source/core/text/itratr.hxx
index 4f58e38..72d8ed2 100644
--- a/binfilter/bf_sw/source/core/text/itratr.hxx
+++ b/binfilter/bf_sw/source/core/text/itratr.hxx
@@ -91,12 +91,23 @@ protected:
     void CtorInit( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf );
 #endif
     inline SwAttrIter()
-        : pFnt(0), pLastOut(0),	nChgCnt(0), nPropFont(0), pShell(0), pRedln(0){}
+        : pShell(0)
+        , pFnt(0)
+        , pLastOut(0)
+        , nChgCnt(0)
+        , pRedln(0)
+        , nPropFont(0)
+        {}
 
 public:
     // Konstruktor, Destruktor
     inline SwAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf )
-        : pFnt(0), pLastOut(0), nChgCnt(0), nPropFont(0), pShell(0), pRedln(0)
+        : pShell(0)
+        , pFnt(0)
+        , pLastOut(0)
+        , nChgCnt(0)
+        , pRedln(0)
+        , nPropFont(0)
         { CtorInit( rTxtNode, rScrInf ); }
 
     virtual ~SwAttrIter();
diff --git a/binfilter/bf_sw/source/core/text/itrform2.hxx b/binfilter/bf_sw/source/core/text/itrform2.hxx
index a104222..fdc7529 100644
--- a/binfilter/bf_sw/source/core/text/itrform2.hxx
+++ b/binfilter/bf_sw/source/core/text/itrform2.hxx
@@ -139,8 +139,8 @@ public:
     sal_Bool CalcOnceMore();
 
     void CtorInit( SwTxtFrm *pFrm, SwTxtFormatInfo *pInf );
-    inline SwTxtFormatter( SwTxtFrm *pFrm, SwTxtFormatInfo *pInf )
-           { CtorInit( pFrm, pInf ); }
+    inline SwTxtFormatter( SwTxtFrm *pTxtFrm, SwTxtFormatInfo *pTxtFrmInf )
+           { CtorInit( pTxtFrm, pTxtFrmInf ); }
     ~SwTxtFormatter();
 
     xub_StrLen FormatLine( const xub_StrLen nStart );
diff --git a/binfilter/bf_sw/source/core/text/itrpaint.hxx b/binfilter/bf_sw/source/core/text/itrpaint.hxx
index ba0fecb..21b8482 100644
--- a/binfilter/bf_sw/source/core/text/itrpaint.hxx
+++ b/binfilter/bf_sw/source/core/text/itrpaint.hxx
@@ -46,8 +46,8 @@ protected:
     void CtorInit( SwTxtFrm *pFrm, SwTxtPaintInfo *pInf );
     inline SwTxtPainter() { }
 public:
-    inline SwTxtPainter( SwTxtFrm *pFrm, SwTxtPaintInfo *pInf )
-           { CtorInit( pFrm, pInf ); }
+    inline SwTxtPainter( SwTxtFrm *pTxtFrm, SwTxtPaintInfo *pTxtPaintInf )
+           { CtorInit( pTxtFrm, pTxtPaintInf ); }
     // if PaintMultiPortion is called recursively, we have to pass the
     // surrounding SwBidiPortion
     inline void SetPaintDrop( const sal_Bool bNew ) { bPaintDrop = bNew; }
diff --git a/binfilter/bf_sw/source/core/text/porlay.hxx b/binfilter/bf_sw/source/core/text/porlay.hxx
index 67ef2e5..68eb638 100644
--- a/binfilter/bf_sw/source/core/text/porlay.hxx
+++ b/binfilter/bf_sw/source/core/text/porlay.hxx
@@ -326,8 +326,11 @@ inline void SwLineLayout::ResetFlags()
 }
 
 inline SwLineLayout::SwLineLayout()
-    : pNext( 0 ), nRealHeight( 0 ), pSpaceAdd( 0 ), pKanaComp( 0 ),
-      bUnderscore( sal_False )
+    : pNext( 0 )
+    , pSpaceAdd( 0 )
+    , pKanaComp( 0 )
+    , nRealHeight( 0 )
+    , bUnderscore( sal_False )
 {
     ResetFlags();
     SetWhichPor( POR_LAY );
diff --git a/binfilter/bf_sw/source/core/text/sw_txtfrm.cxx b/binfilter/bf_sw/source/core/text/sw_txtfrm.cxx
index 72d912a..0536a11 100644
--- a/binfilter/bf_sw/source/core/text/sw_txtfrm.cxx
+++ b/binfilter/bf_sw/source/core/text/sw_txtfrm.cxx
@@ -448,12 +448,12 @@ namespace binfilter {
 /*N*/ 	// 4291: Unterlauf bei Flys
 /*N*/ 	if( aInf.GetTxtFly()->IsOn() )
 /*N*/ 	{
-/*N*/ 		SwRect aFrm( Frm() );
+/*N*/ 		SwRect aTmpFrm( Frm() );
 /*N*/ 		if( nDelta < 0 )
-/*N*/ 			aFrm.Height( Prt().Height() );
+/*N*/ 			aTmpFrm.Height( Prt().Height() );
 /*N*/ 		else
-/*N*/ 			aFrm.Height( aNewSize.Height() );
-/*N*/ 		if( aInf.GetTxtFly()->Relax( aFrm ) )
+/*N*/ 			aTmpFrm.Height( aNewSize.Height() );
+/*N*/ 		if( aInf.GetTxtFly()->Relax( aTmpFrm ) )
 /*N*/ 		{
 /*?*/ 			Init();
 /*?*/ 			return;
@@ -517,8 +517,6 @@ namespace binfilter {
 
 /*N*/ void lcl_ModifyOfst( SwTxtFrm* pFrm, xub_StrLen nPos, xub_StrLen nLen )
 /*N*/ {
-/*N*/ 	if( nLen < 0 )
-/*N*/ 		nPos -= nLen;
 /*N*/ 	while( pFrm && pFrm->GetOfst() <= nPos )
 /*N*/ 		pFrm = pFrm->GetFollow();
 /*N*/ 	while( pFrm )
@@ -1161,6 +1159,8 @@ namespace binfilter {
 /*N*/ 
 /*N*/ 				return;
 /*N*/ 			}
+/*N*/ 			default:
+/*N*/               break;
 /*N*/ 		}
 /*N*/ 	}
 /*N*/ 
@@ -1814,6 +1814,8 @@ public:
 /*?*/ 		case SVX_INTER_LINE_SPACE_FIX:
 /*?*/ 			if ( rSpace.GetInterLineSpace() > 0 )
 /*?*/ 				nRet = (KSHORT)rSpace.GetInterLineSpace();
+/*?*/ 		default:
+/*?*/ 		    break;
 /*N*/ 	}
 /*N*/ 	return nRet;
 /*N*/ }
diff --git a/binfilter/bf_sw/source/core/text/sw_txttab.cxx b/binfilter/bf_sw/source/core/text/sw_txttab.cxx
index 72ab21d..4d1c1d0 100644
--- a/binfilter/bf_sw/source/core/text/sw_txttab.cxx
+++ b/binfilter/bf_sw/source/core/text/sw_txttab.cxx
@@ -100,7 +100,8 @@ namespace binfilter {
 /*N*/ 	if( nTabPos < rInf.X() )
 /*N*/ 		nTabPos = rInf.X();
 /*N*/ 
-/*N*/ 	xub_Unicode cFill, cDec;
+/*N*/ 	xub_Unicode cFill = 0;
+/*N*/ 	xub_Unicode cDec = 0;
 /*N*/ 	SvxTabAdjust eAdj;
 /*N*/ 
 /*N*/ 	KSHORT nNewTabPos;
@@ -119,17 +120,17 @@ namespace binfilter {
 /*N*/ 
 /*N*/ 		const SwTwips nLinePos = GetLeftMargin();
 /*N*/ 		const SwTwips nLineTab = nLinePos + nTabPos;
-/*N*/         SwTwips nRight = Right();
+/*N*/         SwTwips nMyRight = Right();
 /*N*/ 
 /*N*/         if ( pFrm->IsVertical() )
 /*N*/         {
-/*N*/             Point aRightTop( nRight, pFrm->Frm().Top() );
-/*N*/             nRight = aRightTop.Y();
+/*N*/             Point aRightTop( nMyRight, pFrm->Frm().Top() );
+/*N*/             nMyRight = aRightTop.Y();
 /*N*/         }
 /*N*/ 
 /*N*/ 		SwTwips nNextPos;
 /*N*/ 		const SvxTabStop* pTabStop =
-/*N*/ 			aLineInf.GetTabStop( nLineTab, nTabLeft, nRight );
+/*N*/ 			aLineInf.GetTabStop( nLineTab, nTabLeft, nMyRight );
 /*N*/ 		if( pTabStop )
 /*N*/ 		{
 /*N*/ 			cFill = ' ' != pTabStop->GetFill() ? pTabStop->GetFill() : 0;
@@ -225,8 +226,8 @@ namespace binfilter {
 // Die Basisklasse wird erstmal ohne alles initialisiert.
 
 
-/*N*/ SwTabPortion::SwTabPortion( const KSHORT nTabPos, const xub_Unicode cFill )
-/*N*/ 	: SwFixPortion( 0, 0 ), nTabPos(nTabPos), cFill(cFill)
+/*N*/ SwTabPortion::SwTabPortion( const KSHORT nTabPosition, const xub_Unicode cFillChar )
+/*N*/ 	: SwFixPortion( 0, 0 ), nTabPos(nTabPosition), cFill(cFillChar)
 /*N*/ {
 /*N*/ 	nLineLength = 1;
 /*N*/ #ifdef DBG_UTIL
diff --git a/binfilter/bf_sw/source/core/text/sw_widorp.cxx b/binfilter/bf_sw/source/core/text/sw_widorp.cxx
index ef9e671..aaa24f0 100644
--- a/binfilter/bf_sw/source/core/text/sw_widorp.cxx
+++ b/binfilter/bf_sw/source/core/text/sw_widorp.cxx
@@ -71,7 +71,8 @@ namespace binfilter {
  *************************************************************************/
 
 /*N*/ SwTxtFrmBreak::SwTxtFrmBreak( SwTxtFrm *pFrm, const SwTwips nRst )
-/*N*/     : pFrm(pFrm), nRstHeight(nRst)
+/*N*/     : nRstHeight(nRst)
+/*N*/     , pFrm(pFrm)
 /*N*/ {
 /*N*/     SWAP_IF_SWAPPED( pFrm )
 /*N*/     SWRECTFN( pFrm )
@@ -246,7 +247,9 @@ sal_Bool SwTxtFrmBreak::WouldFit( SwTxtMargin &rLine )
 
 /*N*/ WidowsAndOrphans::WidowsAndOrphans( SwTxtFrm *pFrm, const SwTwips nRst,
 /*N*/ 	sal_Bool bChkKeep	)
-/*N*/ 	: SwTxtFrmBreak( pFrm, nRst ), nOrphLines( 0 ), nWidLines( 0 )
+/*N*/ 	: SwTxtFrmBreak( pFrm, nRst )
+/*N*/ 	, nWidLines( 0 )
+/*N*/ 	, nOrphLines( 0 )
 /*N*/ {
 /*N*/     SWAP_IF_SWAPPED( pFrm )
 /*N*/     SWRECTFN( pFrm )
diff --git a/binfilter/inc/bf_sw/fmtclds.hxx b/binfilter/inc/bf_sw/fmtclds.hxx
index 462cb01..dfd0cd2 100644
--- a/binfilter/inc/bf_sw/fmtclds.hxx
+++ b/binfilter/inc/bf_sw/fmtclds.hxx
@@ -132,7 +132,7 @@ public:
     USHORT GetGutterWidth( BOOL bMin = FALSE ) const;
 
 //	void SetLinePen( const Pen& rNew )  { aPen = rNew; }
-    void SetLineWidth(ULONG nWidth)   		{ nLineWidth = nWidth;}
+    void SetLineWidth(ULONG nWidth_)   		{ nLineWidth = nWidth_;}
     void SetLineColor(const Color& rCol )  	{ aLineColor = rCol;}
     void SetLineHeight( BYTE nNew )     { nLineHeight = nNew; }
     void SetLineAdj( SwColLineAdj eNew ){ eAdj = eNew; }
diff --git a/binfilter/inc/bf_sw/fmtftntx.hxx b/binfilter/inc/bf_sw/fmtftntx.hxx
index cb313d9..d497e29 100644
--- a/binfilter/inc/bf_sw/fmtftntx.hxx
+++ b/binfilter/inc/bf_sw/fmtftntx.hxx
@@ -57,8 +57,11 @@ protected:
         : SfxEnumItem( nWhich, ePos ), nOffset( 0 )
     {}
     SwFmtFtnEndAtTxtEnd( const SwFmtFtnEndAtTxtEnd& rAttr )
-        : SfxEnumItem( rAttr ), nOffset( rAttr.nOffset ), aFmt( rAttr.aFmt ),
-        sPrefix( rAttr.sPrefix ), sSuffix( rAttr.sSuffix )
+        : SfxEnumItem( rAttr )
+        , sPrefix( rAttr.sPrefix )
+        , sSuffix( rAttr.sSuffix )
+        , aFmt( rAttr.aFmt )
+        , nOffset( rAttr.nOffset )
     {}
 
 public:
commit c1187dce2b9f06187dd77dfb17e676a29a09fdd9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 24 11:49:17 2010 +0000

    cppcheck: unused variables

diff --git a/binfilter/bf_sw/source/core/unocore/sw_unotext.cxx b/binfilter/bf_sw/source/core/unocore/sw_unotext.cxx
index 2fd0c60..84640a2 100644
--- a/binfilter/bf_sw/source/core/unocore/sw_unotext.cxx
+++ b/binfilter/bf_sw/source/core/unocore/sw_unotext.cxx
@@ -408,12 +408,6 @@ void SwXText::insertTextContent(const uno::Reference< XTextRange > & xRange,
                                         SwXText::getUnoTunnelId());
             }
 
-
-            uno::Reference< XTextCursor >  xOwnCursor = createCursor();
-            uno::Reference<lang::XUnoTunnel> xOwnTunnel( xOwnCursor, uno::UNO_QUERY);
-            OTextCursorHelper* pOwnCursor = (OTextCursorHelper*)xOwnTunnel->getSomething(
-                                    OTextCursorHelper::getUnoTunnelId());
-
             const SwStartNode* pOwnStartNode = GetStartNode();
             SwStartNodeType eSearchNodeType = SwNormalStartNode;
             switch(eCrsrType)


More information about the Libreoffice-commits mailing list