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

Norbert Thiebaud nthiebaud at gmail.com
Sat Jan 25 20:51:07 PST 2014


 sw/source/core/text/itratr.hxx   |   14 +++++++++++-
 sw/source/core/text/itrform2.hxx |    8 +++++--
 sw/source/core/text/itrpaint.hxx |   12 ++++++++--
 sw/source/core/text/itrtxt.hxx   |   43 +++++++++++++++++++++++++++++++++------
 4 files changed, 65 insertions(+), 12 deletions(-)

New commits:
commit df5503af6a472afc40d2f5f144c616ebb686c248
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Jan 25 22:43:52 2014 -0600

    coverity#708449 coverity#708450 Unitialized scalar field
    
    Change-Id: I2774fea82ff207113cd4e8b5d8a5fa60803b2211

diff --git a/sw/source/core/text/itrtxt.hxx b/sw/source/core/text/itrtxt.hxx
index b68f6a2..6a194a0 100644
--- a/sw/source/core/text/itrtxt.hxx
+++ b/sw/source/core/text/itrtxt.hxx
@@ -63,10 +63,27 @@ protected:
         , pInf(NULL)
         , pCurr(NULL)
         , pPrev(NULL)
-    {}
+        , nFrameStart(0)
+        , nY(0)
+        , nRegStart(0)
+        , nStart(0)
+        , nRegDiff(0)
+        , nLineNr(0)
+        , bPrev(sal_False)
+        , bRegisterOn(sal_False)
+        , bOneBlock(sal_False)
+        , bLastBlock(sal_False)
+        , bLastCenter(sal_False)
+        {}
 public:
-    inline SwTxtIter( SwTxtFrm *pTxtFrm, SwTxtInfo *pTxtInf ) : SwAttrIter(pTxtFrm!=NULL?pTxtFrm->GetTxtNode():NULL)
-           { CtorInitTxtIter( pTxtFrm, pTxtInf ); }
+    inline SwTxtIter( SwTxtFrm *pTxtFrm, SwTxtInfo *pTxtInf )
+        : SwAttrIter( pTxtFrm != NULL ? pTxtFrm->GetTxtNode() : NULL)
+        , bOneBlock(sal_False)
+        , bLastBlock(sal_False)
+        , bLastCenter(sal_False)
+        {
+            CtorInitTxtIter( pTxtFrm, pTxtInf );
+        }
     inline const SwLineLayout *GetCurr() const { return pCurr; } // NEVER 0!
     inline const SwLineLayout *GetNext() const { return pCurr->GetNext(); }
            const SwLineLayout *GetPrev();
commit 39005f18173edb0b5432c2634a91f3d9bde90d0b
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Jan 25 22:31:39 2014 -0600

    coverity#708448 Unitialized scalar field
    
    Change-Id: I73e238a03755b7de08560aa63b427f60ac247b35

diff --git a/sw/source/core/text/itrtxt.hxx b/sw/source/core/text/itrtxt.hxx
index 591d42c..b68f6a2 100644
--- a/sw/source/core/text/itrtxt.hxx
+++ b/sw/source/core/text/itrtxt.hxx
@@ -150,10 +150,24 @@ protected:
     inline void SetDropLeft( const KSHORT nNew ) { nDropLeft = nNew; }
 
     void CtorInitTxtMargin( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf );
-    inline SwTxtMargin(SwTxtNode* pTxtNode) : SwTxtIter(pTxtNode) { }
+    inline SwTxtMargin(SwTxtNode* pTxtNode)
+        : SwTxtIter(pTxtNode)
+        , nLeft(0)
+        , nRight(0)
+        , nFirst(0)
+        , nDropLeft(0)
+        , nDropHeight(0)
+        , nDropDescent(0)
+        , nDropLines(0)
+        , nAdjust(0)
+        , mnTabLeft(0)
+        { }
 public:
-    inline SwTxtMargin( SwTxtFrm *pTxtFrm, SwTxtSizeInfo *pTxtSizeInf ) : SwTxtIter(pTxtFrm!=NULL?pTxtFrm->GetTxtNode():NULL)
-           { CtorInitTxtMargin( pTxtFrm, pTxtSizeInf ); }
+    inline SwTxtMargin( SwTxtFrm *pTxtFrm, SwTxtSizeInfo *pTxtSizeInf )
+        : SwTxtIter( pTxtFrm != NULL ? pTxtFrm->GetTxtNode() : NULL)
+        {
+            CtorInitTxtMargin( pTxtFrm, pTxtSizeInf );
+        }
     inline SwTwips GetLeftMargin() const;
     inline SwTwips Left() const;
     inline SwTwips Right() const { return nRight; }
commit 314696eadef31b981054b7f2897f0caff1168d43
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Jan 25 22:22:20 2014 -0600

    coverity#708447 Unitialized scalar field
    
    Change-Id: Id94d9062c6eaf71e3966cea8c63f836c612fe77a

diff --git a/sw/source/core/text/itrpaint.hxx b/sw/source/core/text/itrpaint.hxx
index 04b9170..1ddf4e2 100644
--- a/sw/source/core/text/itrpaint.hxx
+++ b/sw/source/core/text/itrpaint.hxx
@@ -36,11 +36,17 @@ class SwTxtPainter : public SwTxtCursor
                                 long nAdjustBaseLine = 0 );
 protected:
     void CtorInitTxtPainter( SwTxtFrm *pFrm, SwTxtPaintInfo *pInf );
-    inline SwTxtPainter(SwTxtNode* pTxtNode) : SwTxtCursor(pTxtNode) { }
+    inline SwTxtPainter(SwTxtNode* pTxtNode)
+        : SwTxtCursor(pTxtNode)
+        , bPaintDrop(sal_False)
+        { }
 
 public:
-    inline SwTxtPainter( SwTxtFrm *pTxtFrm, SwTxtPaintInfo *pTxtPaintInf ) : SwTxtCursor(pTxtFrm!=NULL?pTxtFrm->GetTxtNode():NULL)
-           { CtorInitTxtPainter( pTxtFrm, pTxtPaintInf ); }
+    inline SwTxtPainter( SwTxtFrm *pTxtFrm, SwTxtPaintInfo *pTxtPaintInf )
+        : SwTxtCursor( pTxtFrm != NULL ? pTxtFrm->GetTxtNode() : NULL)
+        {
+            CtorInitTxtPainter( pTxtFrm, pTxtPaintInf );
+        }
     void DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
                        const sal_Bool bUnderSz );
     void PaintDropPortion();
commit 47e152b46a7c520d14a168ef6aa6de8aad60212d
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Jan 25 22:13:31 2014 -0600

    coverity#708446 Unitialized scalar field
    
    Not done in CtorInitFormatter, because the later is used
    in SwTxtFrm::FormatOnceMore() to 're-initialize'
    and is in unclear that it is OK to trash/reset bUnclipped
    as that point.
    So doing it in the construcotr itself garanteed
    that bUnclipped is not left un-initialized
    without risking messing with the semantic of use
    in SwTxtFrm
    
    Change-Id: I62c7f2adf00c407cdf2e01fa50bdfa131f501064

diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx
index d75ad38..1dd2fa2 100644
--- a/sw/source/core/text/itrform2.hxx
+++ b/sw/source/core/text/itrform2.hxx
@@ -153,8 +153,12 @@ public:
     sal_Bool CalcOnceMore();
 
     void CtorInitTxtFormatter( SwTxtFrm *pFrm, SwTxtFormatInfo *pInf );
-    SwTxtFormatter( SwTxtFrm *pTxtFrm, SwTxtFormatInfo *pTxtFmtInf ) : SwTxtPainter(pTxtFrm!=NULL?pTxtFrm->GetTxtNode():NULL)
-           { CtorInitTxtFormatter( pTxtFrm, pTxtFmtInf ); }
+    SwTxtFormatter( SwTxtFrm *pTxtFrm, SwTxtFormatInfo *pTxtFmtInf )
+        : SwTxtPainter(pTxtFrm!=NULL ? pTxtFrm->GetTxtNode() : NULL)
+        , bUnclipped(sal_False)
+        {
+            CtorInitTxtFormatter( pTxtFrm, pTxtFmtInf );
+        }
     ~SwTxtFormatter();
 
     sal_Int32 FormatLine( const sal_Int32 nStart );
commit 703078f9436ae9ab2aff6b7d506a967cd48f283f
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Jan 25 21:56:22 2014 -0600

    coverity#708445 Unitialized scalar field
    
    Change-Id: I844cf39a38ba4ea2495997a91b20d5e82c3b3840

diff --git a/sw/source/core/text/itratr.hxx b/sw/source/core/text/itratr.hxx
index c76c10e..2a02086 100644
--- a/sw/source/core/text/itratr.hxx
+++ b/sw/source/core/text/itratr.hxx
@@ -69,7 +69,19 @@ protected:
     void Rst( SwTxtAttr *pHt );
     void CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, SwTxtFrm* pFrm = 0 );
     SwAttrIter(SwTxtNode* pTxtNode)
-        : pShell(0), pFnt(0), pHints(0), pAttrSet(0), pScriptInfo(0), pLastOut(0), nChgCnt(0), pRedln(0), nPropFont(0), m_pTxtNode(pTxtNode)
+        : pShell(0)
+        , pFnt(0)
+        , pHints(0)
+        , pAttrSet(0)
+        , pScriptInfo(0)
+        , pLastOut(0)
+        , nChgCnt(0)
+        , pRedln(0)
+        , nStartIndex(0)
+        , nEndIndex(0)
+        , nPos(0)
+        , nPropFont(0)
+        , m_pTxtNode(pTxtNode)
         {
             aMagicNo[SW_LATIN] = aMagicNo[SW_CJK] = aMagicNo[SW_CTL] = NULL;
         }


More information about the Libreoffice-commits mailing list