Index: sc/source/core/data/compressedarray.cxx
===================================================================
RCS file: /cvs/sc/sc/source/core/data/compressedarray.cxx,v
retrieving revision 1.8
diff -u -p -r1.8 compressedarray.cxx
--- sc/source/core/data/compressedarray.cxx	21 Jul 2006 10:50:30 -0000	1.8
+++ sc/source/core/data/compressedarray.cxx	21 Aug 2007 19:39:54 -0000
@@ -325,7 +325,7 @@ void ScCompressedArray<A,D>::Remove( A n
         // make the algorithm used in SetValue() work correctly, it relies on
         // the fact that consecutive values actually differ.
         size_t nRemove;
-        if (pData[nIndex-1].aValue == pData[nIndex+1].aValue)
+        if (nIndex > 0 && pData[nIndex-1].aValue == pData[nIndex+1].aValue)
         {
             nRemove = 2;
             --nIndex;
