incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chen...@apache.org
Subject svn commit: r1349625 - /incubator/ooo/trunk/main/sw/source/core/docnode/ndcopy.cxx
Date Wed, 13 Jun 2012 03:22:40 GMT
Author: chengjh
Date: Wed Jun 13 03:22:39 2012
New Revision: 1349625

URL: http://svn.apache.org/viewvc?rev=1349625&view=rev
Log:
Fix issue #i119955: Crash when inserting sample file to section

* sw/source/core/docnode/ndcopy.cxx
   overflow

Patch by: chengjh@apache.org
Suggested by: chengjh@apache.org
Found by: Yan Ji <yanji.yj@gmail.com>
Review by: zhengfan <zheng.easyfan@gmail.com>           

Modified:
    incubator/ooo/trunk/main/sw/source/core/docnode/ndcopy.cxx

Modified: incubator/ooo/trunk/main/sw/source/core/docnode/ndcopy.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/docnode/ndcopy.cxx?rev=1349625&r1=1349624&r2=1349625&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/docnode/ndcopy.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/docnode/ndcopy.cxx Wed Jun 13 03:22:39 2012
@@ -354,11 +354,23 @@ sal_Bool lcl_CopyTblBox( const SwTableBo
 		pNewBox = new SwTableBox( pBoxFmt, nLines, pCT->pInsLine );
 	else
 	{
+		//Modified for i119955,2012.6.13
+		//Avoid overflow problem...
+		int nIn = rpBox->GetSttIdx() - pCT->nOldTblSttIdx;
+		if ( nIn > 0 )
+		{
+		//End
 		SwNodeIndex aNewIdx( *pCT->pTblNd,
 							rpBox->GetSttIdx() - pCT->nOldTblSttIdx );
 		ASSERT( aNewIdx.GetNode().IsStartNode(), "Index nicht auf einem StartNode" );
 		pNewBox = new SwTableBox( pBoxFmt, aNewIdx, pCT->pInsLine );
         pNewBox->setRowSpan( rpBox->getRowSpan() );
+		//Modified for i119955,2012.6.13
+		}else
+		{
+			return sal_False;
+		}
+		//End
 	}
 
 	pCT->pInsLine->GetTabBoxes().C40_INSERT( SwTableBox, pNewBox,



Mime
View raw message