Kaydet (Commit) 816f65da authored tarafından Eike Rathke's avatar Eike Rathke

resolved fdo#41214 crash due to offset error

üst 9812152a
...@@ -1800,12 +1800,11 @@ bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData, bool bFu ...@@ -1800,12 +1800,11 @@ bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData, bool bFu
while ( nPos < nCount ) while ( nPos < nCount )
{ {
// find range of visually equal formats // find range of visually equal formats
SCSIZE nStartPos = nPos; SCSIZE nEndPos = nPos;
SCSIZE nEndPos = nStartPos + 1;
while ( nEndPos < nCount-1 && while ( nEndPos < nCount-1 &&
pData[nEndPos].pPattern->IsVisibleEqual( *pData[nEndPos+1].pPattern)) pData[nEndPos].pPattern->IsVisibleEqual( *pData[nEndPos+1].pPattern))
++nEndPos; ++nEndPos;
SCROW nAttrStartRow = ( nStartPos > 0 ) ? ( pData[nStartPos-1].nRow + 1 ) : 0; SCROW nAttrStartRow = ( nPos > 0 ) ? ( pData[nPos-1].nRow + 1 ) : 0;
if ( nAttrStartRow <= nLastData ) if ( nAttrStartRow <= nLastData )
nAttrStartRow = nLastData + 1; nAttrStartRow = nLastData + 1;
SCROW nAttrSize = pData[nEndPos].nRow + 1 - nAttrStartRow; SCROW nAttrSize = pData[nEndPos].nRow + 1 - nAttrStartRow;
...@@ -1816,7 +1815,7 @@ bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData, bool bFu ...@@ -1816,7 +1815,7 @@ bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData, bool bFu
rLastRow = pData[nEndPos].nRow; rLastRow = pData[nEndPos].nRow;
bFound = true; bFound = true;
} }
nPos = nEndPos; nPos = nEndPos + 1;
} }
return bFound; return bFound;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment