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

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Fri Nov 21 06:47:00 PST 2014


 sw/source/core/crsr/callnk.cxx                          |    3 -
 sw/source/core/doc/DocumentContentOperationsManager.cxx |    3 -
 sw/source/core/doc/doclay.cxx                           |    3 -
 sw/source/core/doc/doctxm.cxx                           |    2 
 sw/source/core/doc/htmltbl.cxx                          |    3 -
 sw/source/core/doc/tblcpy.cxx                           |    3 -
 sw/source/core/layout/ftnfrm.cxx                        |    2 
 sw/source/core/text/itradj.cxx                          |    6 --
 sw/source/core/txtnode/txtedt.cxx                       |    2 
 sw/source/filter/ww8/wrtww8gr.cxx                       |    4 -
 sw/source/filter/ww8/ww8toolbar.cxx                     |    3 -
 sw/source/ui/misc/outline.cxx                           |    2 
 sw/source/ui/vba/vbatablehelper.cxx                     |   14 ++++--
 sw/source/uibase/table/tablemgr.cxx                     |   33 ++++++++++------
 sw/source/uibase/wrtsh/move.cxx                         |    3 -
 15 files changed, 42 insertions(+), 44 deletions(-)

New commits:
commit 949f3099f05d642ca4ee4b6ad676152bbea04824
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Fri Nov 21 12:56:13 2014 +0100

    dead init (clang)
    
    Change-Id: I7ad48c2a7bd1a63ebb9bda41fb5c28b19e7e6eab

diff --git a/sw/source/uibase/wrtsh/move.cxx b/sw/source/uibase/wrtsh/move.cxx
index 64a390e..7916c27 100644
--- a/sw/source/uibase/wrtsh/move.cxx
+++ b/sw/source/uibase/wrtsh/move.cxx
@@ -520,10 +520,9 @@ bool SwWrtShell::PopCrsr(bool bUpdate, bool bSelect)
 
 void SwWrtShell::_ResetCursorStack()
 {
-    CrsrStack *pTmp = pCrsrStack;
     while(pCrsrStack)
     {
-        pTmp = pCrsrStack->pNext;
+        CrsrStack* const pTmp = pCrsrStack->pNext;
         delete pCrsrStack;
         pCrsrStack = pTmp;
     }
commit b5248ce4c5b5b8ec87dd604f616dc889bdb3a79b
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Fri Nov 21 12:53:51 2014 +0100

    dead init (clang)
    
    Change-Id: Idc482b3b801bc755042f2a25676fa90c3066f14c

diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 2cab3c5..5b52fc1 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -1065,7 +1065,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
                 }
                 nXStart /= 2;
                 nXStart += 2;
-                long nTextOffset = 2 * nXStep;
+                long nTextOffset;
                 if( SVX_NUM_BITMAP == rFmt.GetNumberingType() )
                 {
                     lcl_DrawGraphic(pVDev.get(), rFmt, nXStart, nYStart, nWidthRelation);
commit cda69956c9d0769c4cb254c0e08ac912fe136fdb
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Fri Nov 21 12:52:21 2014 +0100

    dead init (clang)
    
    Change-Id: I009bad46c35c1cc76c59441ed4f6a03a31967e68

diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx
index e33a8c5..bb0a00c 100644
--- a/sw/source/filter/ww8/ww8toolbar.cxx
+++ b/sw/source/filter/ww8/ww8toolbar.cxx
@@ -122,8 +122,7 @@ bool SwCTBWrapper::Read( SvStream& rS )
         // but the size of a SwTBC element is dynamic ( and this relates to TBDelta's
         int nStart = rS.Tell();
 
-        int bytesRead = 0;
-        int bytesToRead = cbDTBC - bytesRead;
+        int bytesToRead;
         // cbDTBC specifies the size ( in bytes ) taken by an array ( of unspecified size )
         // of SwTBC records ( SwTBC records have dynamic length, so we need to check our position
         // after each read )
commit 185009b7993d64d4240a580383eb16ab2b652f11
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Fri Nov 21 12:50:59 2014 +0100

    dead init (clang)
    
    Change-Id: Ie219bde00f4f0ec73d4474e30d1ad8af30c5b54c

diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 58164c6..2e0e573 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1482,7 +1482,7 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, sal_Int32 /*nActPos*/
         rSmartTagMgr.RecognizeTextRange(xRange, xTextMarkup, xController);
 
         sal_Int32 nLangBegin = nBegin;
-        sal_Int32 nLangEnd = nEnd;
+        sal_Int32 nLangEnd;
 
         // smart tag recognition has to be done for each language portion:
         SwLanguageIterator aIter( *pNode, nLangBegin );
commit c6262d54395939e3d9514cb51f338a033b290d42
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Fri Nov 21 12:43:28 2014 +0100

    dead init (clang)
    
    Change-Id: I67688e22f4486020a19e90baa4c4211fc4ef2d4f

diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index edad812..c85e7b9 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -1248,7 +1248,7 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
             }
             nCmpPos  = ::lcl_FindFtnPos( pDoc, pSibling->GetAttr() );
 
-            SwFtnBossFrm *pNxtB = this; // remember the last one to not
+            SwFtnBossFrm *pNxtB; // remember the last one to not
             SwFtnFrm  *pLastSib = 0;    // go too far.
 
             while ( pSibling && nCmpPos <= nStPos )
commit 75e7d9cdc976c1efd0db7d0b8f325759ad5da68b
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Thu Nov 20 21:20:25 2014 +0100

    expand complex cascading conditional operator
    
    Change-Id: I523399c04e1535e546e31e67107e8dfd7372396c

diff --git a/sw/source/uibase/table/tablemgr.cxx b/sw/source/uibase/table/tablemgr.cxx
index c20ea83..3f48722 100644
--- a/sw/source/uibase/table/tablemgr.cxx
+++ b/sw/source/uibase/table/tablemgr.cxx
@@ -69,10 +69,15 @@ SwTwips SwTableFUNC::GetColWidth(sal_uInt16 nNum) const
     {
         if(aCols.Count() == GetColCount())
         {
-            nWidth = (SwTwips)((nNum == aCols.Count()) ?
-                    aCols.GetRight() - aCols[nNum-1] :
-                    nNum == 0 ? aCols[nNum] - aCols.GetLeft() :
-                                aCols[nNum] - aCols[nNum-1]);
+            if(nNum == aCols.Count())
+                nWidth = aCols.GetRight() - aCols[nNum-1];
+            else
+            {
+                if(nNum == 0)
+                    nWidth = aCols[nNum] - aCols.GetLeft();
+                else
+                    nWidth = aCols[nNum] - aCols[nNum-1];
+            }
         }
         else
         {
@@ -87,7 +92,6 @@ SwTwips SwTableFUNC::GetColWidth(sal_uInt16 nNum) const
     }
     else
         nWidth = aCols.GetRight();
-
     return nWidth;
 }
 
@@ -99,13 +103,18 @@ SwTwips SwTableFUNC::GetMaxColWidth( sal_uInt16 nNum ) const
     {
         // The maximum width arises from the own width and
         // the width each of the neighbor cells reduced by MINLAY.
-        SwTwips nMax =  nNum == 0 ?
-            GetColWidth(1) - MINLAY :
-                nNum == GetColCount() ?
-                    GetColWidth( nNum-1 ) - MINLAY :
-                        GetColWidth(nNum - 1) + GetColWidth( nNum + 1 ) - 2 * MINLAY;
-
-        return nMax + GetColWidth(nNum) ;
+        SwTwips nMax;
+        if(nNum == 0)
+            nMax = GetColWidth(1) - MINLAY;
+        else
+        {
+            nMax = GetColWidth(nNum-1);
+            if(nNum == GetColCount())
+                nMax -= MINLAY;
+            else
+                nMax += GetColWidth(nNum+1) - 2 * MINLAY;
+        }
+        return nMax + GetColWidth(nNum);
     }
     else
         return GetColWidth(nNum);
commit 4ea7a6f4f4a885dbf7c17e0738df45396da685bf
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Thu Nov 20 21:20:15 2014 +0100

    expand complex cascading conditional operator
    
    Change-Id: I315f3a929a465c9fd0ec91999e947afcd08f1522

diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx
index 8dda034..5c39062 100644
--- a/sw/source/ui/vba/vbatablehelper.cxx
+++ b/sw/source/ui/vba/vbatablehelper.cxx
@@ -208,10 +208,16 @@ sal_Int32 SwVbaTableHelper::GetColWidth( SwTabCols& rCols, sal_Int32 nNum ) thro
     {
         if(rCols.Count() == static_cast<size_t>(GetColCount( rCols )))
         {
-            nWidth = ((static_cast<size_t>(nNum) == rCols.Count()) ?
-                    rCols.GetRight() - rCols[nNum-1] :
-                    nNum == 0 ? rCols[nNum] - rCols.GetLeft() :
-                                rCols[nNum] - rCols[nNum-1]);
+            if(static_cast<size_t>(nNum) == rCols.Count())
+                nWidth = rCols.GetRight() - rCols[nNum-1];
+            else
+            {
+                nWidth = rCols[nNum];
+                if(nNum == 0)
+                    nWidth -= rCols.GetLeft();
+                else
+                    nWidth -= rCols[nNum-1];
+            }
         }
         else
         {
commit 0469d54c22d691a70eca407421306192a4ae0a12
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Thu Nov 20 21:13:39 2014 +0100

    dead init (clang)
    
    Change-Id: I84fdb360ec59315af88751ba0fb9be37324637da

diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 6725f43..1c1a095 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -231,7 +231,8 @@ SwCallLink::~SwCallLink()
 
 long SwCallLink::getLayoutFrm( const SwRootFrm* pRoot, SwTxtNode& rNd, sal_Int32 nCntPos, bool bCalcFrm )
 {
-    SwTxtFrm* pFrm = static_cast<SwTxtFrm*>(rNd.getLayoutFrm(pRoot,0,0,bCalcFrm)), *pNext = pFrm;
+    SwTxtFrm* pFrm = static_cast<SwTxtFrm*>(rNd.getLayoutFrm(pRoot,0,0,bCalcFrm));
+    SwTxtFrm* pNext;
     if ( pFrm && !pFrm->IsHiddenNow() )
     {
         if( pFrm->HasFollow() )
commit 01160e5b3aaa3320586d688760327951b31ed430
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Thu Nov 20 21:11:56 2014 +0100

    dead init (clang)
    
    Change-Id: Ic36b07e5632cc2d1e0e525543bb8da30f9785ddb

diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index d9bb700..6640f90 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -838,7 +838,6 @@ bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
     if( 1 != rCpyTbl.GetTabSortBoxes().size() )
     {
         SwTableLine* pSttLine = pSttBox->GetUpper();
-        sal_uInt16 nSttLine = GetTabLines().GetPos( pSttLine );
         _FndBox* pFndBox;
 
         sal_uInt16 nFndCnt = aFndBox.GetLines().size();
@@ -849,7 +848,7 @@ bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
         sal_uInt16 nTstLns = 0;
         pFLine = &aFndBox.GetLines().front();
         pSttLine = pFLine->GetLine();
-        nSttLine = GetTabLines().GetPos( pSttLine );
+        sal_uInt16 nSttLine = GetTabLines().GetPos( pSttLine );
         // Do we have as many rows, actually?
         if( 1 == nFndCnt )
         {
commit 5fc1efd15490db736c877e25bade4ca2d33183fb
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Thu Nov 20 21:10:27 2014 +0100

    dead init (clang)
    
    Change-Id: I741f19caf1fdffd4c5ed40f8a91ae1b938dd04bb

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index fd8f452..078c499 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1608,7 +1608,7 @@ void SwTOXBaseSection::UpdatePageNum()
                     if( pFrm->IsTxtFrm() && static_cast<SwTxtFrm*>(pFrm)->HasFollow() )
                     {
                         // find the right one
-                        SwTxtFrm* pNext = static_cast<SwTxtFrm*>(pFrm);
+                        SwTxtFrm* pNext;
                         while( 0 != ( pNext = static_cast<SwTxtFrm*>(pFrm->GetFollow()) )
                                 && rTOXSource.nPos >= pNext->GetOfst() )
                             pFrm = pNext;
commit 5d7c3b4d1926b59d2bb17497ef82c694b6f99597
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Thu Nov 20 21:09:05 2014 +0100

    dead init (clang)
    
    Change-Id: I86e37b3c6bac6694f41138ab46e2e51a92a0dd76

diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index b2f57f6..7534d6e 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -204,8 +204,7 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
     }
 
     // Anchor not yet set?
-    RndStdIds eAnchorId = pAnchor ? pAnchor->GetAnchorId()
-                                  : pFmt->GetAnchor().GetAnchorId();
+    RndStdIds eAnchorId;
     // #i107811# Assure that at-page anchored fly frames have a page num or a
     // content anchor set.
     if ( !pAnchor ||
commit 3c1660de22542c188f3ee8038ed42bc717225551
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Thu Nov 20 21:07:22 2014 +0100

    dead init (clang)
    
    Change-Id: Iaff0e7dbcd9a574d250dbf7edcad3ae9d11d79b9

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 7fa56d1..05d527f 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3785,8 +3785,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt
         OUString sRepl( rStr );
         SwTxtNode* pTxtNd = pStt->nNode.GetNode().GetTxtNode();
         sal_Int32 nStt = pStt->nContent.GetIndex();
-        sal_Int32 nEnd = bOneNode ? pEnd->nContent.GetIndex()
-                                : pTxtNd->GetTxt().getLength();
+        sal_Int32 nEnd;
 
         SwDataChanged aTmp( aDelPam );
 
commit f9379a20f4f3cfc29d2392bd981bf583b448c47d
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Thu Nov 20 21:04:47 2014 +0100

    dead increment (clang)
    
    Change-Id: Ie3dd7ed98bef939e5ff82b70e107c3594a3d3325

diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index c115eee..c0f0717 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -688,10 +688,6 @@ void SwWW8WrGrf::WritePICFHeader(SvStream& rStrm, const sw::Frame &rFly,
         Set_UInt16( pArr, nCropR );                     // set dxaCropRight
         Set_UInt16( pArr, nCropB );                     // set dyaCropBottom
     }
-    else
-    {
-        pArr += 8;
-    }
 
     rStrm.Write( aArr, nHdrLen );
 }
commit 41e356cea76b6aba25a0d04b7698e06462181543
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Thu Nov 20 21:03:17 2014 +0100

    dead increment (clang)
    
    Change-Id: Ifd6f445ce177e009a2a067f0c8d20c809ba73737

diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index 9c219df..cf6b790 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -1784,9 +1784,6 @@ bool SwHTMLTableLayout::Resize( sal_uInt16 nAbsAvail, bool bRecalc,
 
     if( nDelay==0 && aResizeTimer.IsActive() )
     {
-        // If there is an asynchronous resize left to process when we call
-        // a synchronous resize, we only take over the new values.
-        bRecalc |= bDelayedResizeRecalc;
         nDelayedResizeAbsAvail = nAbsAvail;
         return false;
     }
commit cd5269ea73eff410288c779c6f4cde3c5af290ed
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Thu Nov 20 21:02:17 2014 +0100

    dead increment (clang)
    
    Change-Id: Ic705fc00b213aebe3c59f349bbd37f0dcb8cc351

diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index b2af4d6..e86d904 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -513,12 +513,6 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
         }
         else if( pPos->InGlueGrp() && pPos->InFixMargGrp() )
         {
-            if( nCompress )
-            {
-                nKanaDiffSum *= nCompress;
-                nKanaDiffSum /= 10000;
-            }
-
             pPos->Width( static_cast<sal_uInt16>(pPos->Width() - nDecompress) );
 
             if ( pPos->InTabGrp() )


More information about the Libreoffice-commits mailing list