summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-05-24 12:37:57 +0200
committerEike Rathke <erack@redhat.com>2012-05-24 12:40:05 +0200
commit816f65da41c8c30e5854e333a6498e58c64303aa (patch)
treec51ec446289456035d7a915ecd65e07fb02eb67a /sc
parent9812152a2b562c57cc57de959d8f8d591aa9ebc5 (diff)
resolved fdo#41214 crash due to offset error
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/attarray.cxx7
1 files 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;