sc/source/core/data/attarray.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 816f65da41c8c30e5854e333a6498e58c64303aa
Author: Eike Rathke <er...@redhat.com>
Date:   Thu May 24 12:37:57 2012 +0200

    resolved fdo#41214 crash due to offset error

diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 9de2b02..f201e5d 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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to