From 816f65da41c8c30e5854e333a6498e58c64303aa Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Thu, 24 May 2012 12:37:57 +0200 Subject: resolved fdo#41214 crash due to offset error --- sc/source/core/data/attarray.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 9de2b0211519..f201e5d82bf2 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1800,12 +1800,11 @@ bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData, bool bFu while ( nPos < nCount ) { // find range of visually equal formats - SCSIZE nStartPos = nPos; - SCSIZE nEndPos = nStartPos + 1; + SCSIZE nEndPos = nPos; while ( nEndPos < nCount-1 && pData[nEndPos].pPattern->IsVisibleEqual( *pData[nEndPos+1].pPattern)) ++nEndPos; - SCROW nAttrStartRow = ( nStartPos > 0 ) ? ( pData[nStartPos-1].nRow + 1 ) : 0; + SCROW nAttrStartRow = ( nPos > 0 ) ? ( pData[nPos-1].nRow + 1 ) : 0; if ( nAttrStartRow <= nLastData ) nAttrStartRow = nLastData + 1; SCROW nAttrSize = pData[nEndPos].nRow + 1 - nAttrStartRow; @@ -1816,7 +1815,7 @@ bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData, bool bFu rLastRow = pData[nEndPos].nRow; bFound = true; } - nPos = nEndPos; + nPos = nEndPos + 1; } return bFound; -- cgit v1.2.3