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

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Sun Nov 23 05:42:11 PST 2014


 sw/source/core/crsr/swcrsr.cxx                          |    1 -
 sw/source/core/doc/DocumentContentOperationsManager.cxx |    7 ++-----
 sw/source/core/doc/doccomp.cxx                          |   16 ++++++++--------
 sw/source/core/doc/docfld.cxx                           |    1 -
 sw/source/core/doc/tblcpy.cxx                           |    4 +---
 sw/source/core/docnode/nodes.cxx                        |    4 +---
 sw/source/core/edit/autofmt.cxx                         |    1 -
 sw/source/core/layout/sectfrm.cxx                       |    3 ---
 sw/source/core/swg/SwXMLTextBlocks.cxx                  |    2 +-
 sw/source/core/text/frmform.cxx                         |    7 +------
 10 files changed, 14 insertions(+), 32 deletions(-)

New commits:
commit 700277174650e10cc120d632f1124f2f34314c97
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 22 03:50:10 2014 +0100

    dead assign (clang)
    
    Change-Id: Ic1e7578e85e52df68f1b9e1e8c7835614518b165

diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index a1f71ad..14bc83e 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1269,13 +1269,8 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
     if( rReformat.Len() > nStrLen )
         rReformat.Len() = nStrLen;
 
-    // Optimized:
-    sal_Int32 nEnd = rReformat.Start() + rReformat.Len();
-    if( nEnd > nStrLen )
-    {
+    if( rReformat.Start() + rReformat.Len() > nStrLen )
         rReformat.Len() = nStrLen - rReformat.Start();
-        nEnd = nStrLen;
-    }
 
     SwTwips nOldBottom;
     if( GetOfst() && !IsFollow() )
commit 2d990b4cb48b74c50c757db3424e3653b06ee013
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 22 03:45:17 2014 +0100

    dead assign (clang)
    
    Change-Id: I021a278a773b704f35aed1da5eda4c51ede648e2

diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index 664ad6a..7f581c2 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -324,7 +324,7 @@ sal_uLong SwXMLTextBlocks::BeginPutDoc( const OUString& rShort, const OUString&
 
 sal_uLong SwXMLTextBlocks::PutBlock( SwPaM& , const OUString& )
 {
-    sal_uLong nRes = 0;
+    sal_uLong nRes = 0; // dead variable, this always returns 0
     sal_uInt16 nCommitFlags = nFlags & (SWXML_CONVBLOCK|SWXML_NOROOTCOMMIT);
 
     nFlags |= nCommitFlags;
commit f0cd77e9b38b356ff29d8e79c5fda862cf645437
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 22 03:42:13 2014 +0100

    dead assign (clang)
    
    Change-Id: I5756dfa36a7ab55236811807c532f3713c5eb548

diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index a3b5a18..acad18d 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -997,10 +997,7 @@ void SwSectionFrm::_CheckClipping( bool bGrow, bool bMaximize )
     {
         nDiff = (*fnRect->fnYDiff)( nDeadLine, (Frm().*fnRect->fnGetTop)() );
         if( nDiff < 0 )
-        {
-            nDiff = 0;
             nDeadLine = (Frm().*fnRect->fnGetTop)();
-        }
         const Size aOldSz( Prt().SSize() );
         long nTop = (this->*fnRect->fnGetTopMargin)();
         (Frm().*fnRect->fnSetBottom)( nDeadLine );
commit d2ab77ce54fa46fc5bd6b3d18a5041ceb29ebb71
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 22 03:39:10 2014 +0100

    dead assign (clang)
    
    Change-Id: I99b24839202191364ea2e9b133b2259d46b64022

diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index b542a36..aadc7c3 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -2051,7 +2051,6 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos )
                 {
                     SetRedlineTxt( STR_AUTOFMTREDL_CPTL_STT_SENT );
                     pATst->FnCptlSttSntnc( aACorrDoc, *pTxt, true, nSttPos, nPos, eLang);
-                    bFirst = false;
                 }
 
                 bFirst = bFirstSent;
commit 6c25384656c8d90d4641f62a44a3b0c21b4bad64
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 22 03:34:55 2014 +0100

    dead assign (clang)
    
    Change-Id: I5f2dee2ac947c22292a5ee42fe51506cd881e35f

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index fcdeb8e..00b9a87 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1944,11 +1944,9 @@ SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx,
                 (bSkipProtect && rSect.IsProtectFlag()) )
                 // than skip the section
                 aTmp = *pNd->EndOfSectionNode();
-            bFirst = false;
         }
         else if( bFirst )
         {
-            bFirst = false;
             if( pNd->pStartOfSection->IsSectionNode() )
             {
                 const SwSection& rSect = static_cast<SwSectionNode*>(pNd->
commit 725f54ac3fd07ec7891628c469bef4cee336bc55
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 22 03:24:31 2014 +0100

    dead assign (clang)
    
    Change-Id: I6782bc870fa5ce6404b3f5436bcf86b96527f69e

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 24da3ef..fcdeb8e 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1002,7 +1002,7 @@ void SwNodes::SectionUp(SwNodeRange *pRange)
         DelNodes( pRange->aEnd, 1 );
     else
     {
-        pAktNode = new SwStartNode( pRange->aEnd );
+        new SwStartNode( pRange->aEnd );
 /*?? which NodeType ??*/
         aTmpIdx = *pRange->aEnd.GetNode().EndOfSectionNode();
         pRange->aEnd--;
commit 4e9691a783ce7b6c65cbb586fcdde0284c35d408
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 22 03:17:48 2014 +0100

    kill some follow-up dead inits
    
    Change-Id: Id8d9309c3d09224c55ff15521d4fa54b9fbb23c2

diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index 6640f90..cd750e0 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -837,7 +837,6 @@ bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
     // Boxes!
     if( 1 != rCpyTbl.GetTabSortBoxes().size() )
     {
-        SwTableLine* pSttLine = pSttBox->GetUpper();
         _FndBox* pFndBox;
 
         sal_uInt16 nFndCnt = aFndBox.GetLines().size();
@@ -847,8 +846,7 @@ bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
         // Check if we have enough space for all Lines and Boxes
         sal_uInt16 nTstLns = 0;
         pFLine = &aFndBox.GetLines().front();
-        pSttLine = pFLine->GetLine();
-        sal_uInt16 nSttLine = GetTabLines().GetPos( pSttLine );
+        sal_uInt16 nSttLine = GetTabLines().GetPos( pFLine->GetLine() );
         // Do we have as many rows, actually?
         if( 1 == nFndCnt )
         {
commit a145874600dcdee9650d7332015e9b15da00c6b5
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 22 03:10:19 2014 +0100

    dead assign (clang)
    
    Change-Id: I161a3f50f89c21a2a9b4cebaca02634501786d44

diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 138ef10..6bf1a6a 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -668,7 +668,6 @@ void SwDoc::ChangeDBFields( const std::vector<OUString>& rOldNames,
                                 lcl_DBDataToString(static_cast<SwDBNameInfField*>(pFld)->GetRealDBData())))
                 {
                     static_cast<SwDBNameInfField*>(pFld)->SetDBData(aNewDBData);
-                    bExpand = true;
                 }
                 // no break;
             case RES_HIDDENTXTFLD:
commit c5f02f7d8c9bc85a65d1952b9998888bd6c9f520
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 22 03:06:33 2014 +0100

    actually do a two-way compare
    
    This seems to have intended to compare data two ways, but instead
    compared twice the same way. Discovered with clangs "assigned value is
    never read" warning.
    
    Change-Id: I678f5deffbb2aa2035a701a700d3645fc3aea15e

diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 8634835..d6fdf69 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -870,13 +870,10 @@ sal_uLong Compare::CompareSequence::CheckDiag( sal_uLong nStt1, sal_uLong nEnd1,
     }
 }
 
-void Compare::ShiftBoundaries( CompareData& rData1, CompareData& rData2 )
+namespace
 {
-    for( int iz = 0; iz < 2; ++iz )
+    static inline void lcl_ShiftBoundariesOneway( CompareData* const pData, CompareData* const pOtherData)
     {
-        CompareData* pData = &rData1;
-        CompareData* pOtherData = &rData2;
-
         sal_uLong i = 0;
         sal_uLong j = 0;
         sal_uLong i_end = pData->GetLineCount();
@@ -940,12 +937,15 @@ void Compare::ShiftBoundaries( CompareData& rData1, CompareData& rData2 )
             preceding = i;
             other_preceding = j;
         }
-
-        pData = &rData2;
-        pOtherData = &rData1;
     }
 }
 
+void Compare::ShiftBoundaries( CompareData& rData1, CompareData& rData2 )
+{
+    lcl_ShiftBoundariesOneway(&rData1, &rData2);
+    lcl_ShiftBoundariesOneway(&rData2, &rData1);
+}
+
 class SwCompareLine : public CompareLine
 {
     const SwNode& rNode;
commit d9809a2f11a049f31cfc336d0854caa903a46c7e
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 22 02:37:40 2014 +0100

    dead assign (clang)
    
    Change-Id: I567d5d40642a50ab1a4690df874daffdd17506d3

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 05d527f..c73da6a 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3374,7 +3374,6 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
         aAnchor.SetAnchor( &newPos );
 
         // Check recursion: copy content in its own frame, then don't copy it.
-        bool bMakeCpy = true;
         if( pDest == &m_rDoc )
         {
             const SwFmtCntnt& rCntnt = (*it).GetFmt()->GetCntnt();
@@ -3384,16 +3383,14 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
                 pSNd->GetIndex() < rStartIdx.GetIndex() &&
                 rStartIdx.GetIndex() < pSNd->EndOfSectionIndex() )
             {
-                bMakeCpy = false;
                 aSet.erase (it++);
                 continue;
             }
         }
 
         // Copy the format and set the new anchor
-        if( bMakeCpy )
-            aVecSwFrmFmt.push_back( pDest->getIDocumentLayoutAccess().CopyLayoutFmt( *(*it).GetFmt(),
-                        aAnchor, false, true ) );
+        aVecSwFrmFmt.push_back( pDest->getIDocumentLayoutAccess().CopyLayoutFmt( *(*it).GetFmt(),
+                aAnchor, false, true ) );
         ++it;
     }
 
commit 2f8ea45940c4dd4ffb0363ef82daa5c0a734c0b7
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 22 02:33:15 2014 +0100

    dead assign (clang)
    
    Change-Id: I941676bc43f6d22da60d5b043821bb5cfc0a2f7c

diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 071d51b..f5129b0 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -354,7 +354,6 @@ bool SwCursor::IsSelOvr( int eFlags )
             {
                 // set this CntntNode as new position
                 rPtIdx = *pCNd;
-                pNd = pCNd;
 
                 // assign corresponding ContentIndex
                 const sal_Int32 nTmpPos = bGoNxt ? 0 : pCNd->Len();


More information about the Libreoffice-commits mailing list