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

Caolán McNamara caolanm at redhat.com
Wed Dec 10 08:02:15 PST 2014


 editeng/source/editeng/editundo.cxx |    2 
 sw/source/core/doc/tblrwcl.cxx      |   81 ------------------------------------
 2 files changed, 2 insertions(+), 81 deletions(-)

New commits:
commit efcbb12a27a380a442292f17c7f508555a66d4af
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 10 15:58:42 2014 +0000

    Resolves: fdo#87141 Remove deletes the node, release doesn't
    
    regression from introduction of boost::ptr_vector originally one had to Remove
    and delete the return to delete it, while now the Remove automatically delete
    it. This bare Remove to just "release" it seems to have been overlooked
    
    Change-Id: I175f7c95862ce47402993e5e3b8feaa93af43e75

diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx
index 97ab743..674fc96 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -183,7 +183,7 @@ void EditUndoDelContent::Redo()
     pEE->RemoveParaPortion(nNode);
 
     // Do not delete node, depends on the undo!
-    pEE->GetEditDoc().Remove( nNode );
+    pEE->GetEditDoc().Release( nNode );
     if (pEE->IsCallParaInsertedOrDeleted())
         pEE->ParagraphDeleted( nNode );
 
commit 165c56d9d75268114aea4898bc06dbb09615b5f2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 10 15:23:34 2014 +0000

    coverity#735515 Logically dead code
    
    Change-Id: I884aca0e49f424823201a69f03c6bba4e816f3c1

diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index ac310b4..9f28bb3 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -1483,7 +1483,7 @@ static void lcl_Merge_MoveLine(_FndLine& rFndLine, _InsULPara *const pULPara)
                                         pULPara->pInsBox );
                 }
         }
-        else if( nLeft )
+        else
         {
             // There are still Boxes on the left side, so put the Left-
             // and Merge-Box into one Box and Line, insert before/after
@@ -1515,85 +1515,6 @@ static void lcl_Merge_MoveLine(_FndLine& rFndLine, _InsULPara *const pULPara)
                                         pLMBox );
             lcl_CalcWidth( pLMBox );        // calculate the Box's width
         }
-        else if( nRight+1 < (sal_uInt16)pFndLn->GetTabBoxes().size() )
-        {
-            // There are still Boxes on the right, so put the Right-
-            // and Merge-Box into one Box and Line, insert before/after
-            // a Line with a Box, into which the upper/lower Lines are
-            // inserted
-            SwTableLine* pInsLine = pULPara->pRightBox->GetUpper();
-            SwTableBox* pRMBox;
-            if( pULPara->pLeftBox->GetUpper() == pInsLine )
-            {
-                pRMBox = new SwTableBox(
-                    static_cast<SwTableBoxFmt*>(pULPara->pRightBox->GetFrmFmt()), 0, pInsLine );
-                SwTableLine* pRMLn = new SwTableLine(
-                    static_cast<SwTableLineFmt*>(pInsLine->GetFrmFmt()), 2, pRMBox );
-                pRMLn->ClaimFrmFmt()->ResetFmtAttr( RES_FRM_SIZE );
-                pRMBox->GetTabLines().insert( pRMBox->GetTabLines().begin(), pRMLn );
-
-                lcl_CpyBoxes( 1, 3, pInsLine->GetTabBoxes(), pRMLn );
-
-                pInsLine->GetTabBoxes().insert( pInsLine->GetTabBoxes().begin(), pRMBox );
-            }
-            else
-            {
-                // Left and Merge have been merged, so also move Right into the Line
-                pInsLine = pULPara->pLeftBox->GetUpper();
-                sal_uInt16 nMvPos = pULPara->pRightBox->GetUpper()->GetTabBoxes().GetPos(
-                                      pULPara->pRightBox );
-                lcl_CpyBoxes( nMvPos, nMvPos+1,
-                            pULPara->pRightBox->GetUpper()->GetTabBoxes(),
-                            pInsLine );
-                pRMBox = pInsLine->GetUpper();
-
-                // If there are already Lines, then these need to go into a new Line and Box
-                nMvPos = pRMBox->GetTabLines().GetPos( pInsLine );
-                if( pULPara->bUL ? nMvPos != 0
-                                : nMvPos+1 < (sal_uInt16)pRMBox->GetTabLines().size() )
-                {
-                    // Merge all Lines into a new Line and Box
-                    SwTableLine* pNewLn = new SwTableLine(
-                        static_cast<SwTableLineFmt*>(pInsLine->GetFrmFmt()), 1, pRMBox );
-                    pNewLn->ClaimFrmFmt()->ResetFmtAttr( RES_FRM_SIZE );
-                    pRMBox->GetTabLines().insert(
-                                pRMBox->GetTabLines().begin() + (pULPara->bUL ? nMvPos : nMvPos+1),
-                                pNewLn );
-                    pRMBox = new SwTableBox( static_cast<SwTableBoxFmt*>(pRMBox->GetFrmFmt()), 0, pNewLn );
-                    pNewLn->GetTabBoxes().insert( pNewLn->GetTabBoxes().begin(), pRMBox );
-
-                    sal_uInt16 nPos1, nPos2;
-                    if( pULPara->bUL )
-                        nPos1 = 0,
-                        nPos2 = nMvPos;
-                    else
-                        nPos1 = nMvPos+2,
-                        nPos2 = pNewLn->GetUpper()->GetTabLines().size();
-
-                    lcl_CpyLines( nPos1, nPos2,
-                                pNewLn->GetUpper()->GetTabLines(), pRMBox );
-                    lcl_CalcWidth( pRMBox );        // calculate the Box's width
-
-                    pRMBox = new SwTableBox( static_cast<SwTableBoxFmt*>(pRMBox->GetFrmFmt()), 0, pNewLn );
-                    pNewLn->GetTabBoxes().push_back( pRMBox );
-                }
-            }
-            if( pULPara->bUL )  // Upper ?
-            {
-                // If there are Lines before it, move them
-                if( 0 != ( nPos = pLines->GetPos( pFndLn )) )
-                    lcl_CpyLines( 0, nPos, *pLines, pRMBox, 0 );
-            }
-            else
-                // If there are Lines after it, move them
-                if( (nPos = pLines->GetPos( pFndLn )) + 1 < (sal_uInt16)pLines->size() )
-                    lcl_CpyLines( nPos+1, pLines->size(), *pLines,
-                                        pRMBox );
-            lcl_CalcWidth( pRMBox );        // calculate the Box's width
-        }
-        else {
-            OSL_FAIL( "So ... what do we do now?" );
-        }
     }
     // Left/Right
     else


More information about the Libreoffice-commits mailing list