Hi!

There was a call for GetLine( nInsPos-1 ); with nInsPos == 0 so it wanted to 
return aLines[ nLine ]; where nLine == -1.
(vector< CompareLine* > aLines;)

Files: sw/source/core/doc/doccomp.cxx (in SwCompareData::ShowDelete)

Szabolcs
                                          
From 0d726dc30eb85745eab8b83c710b57df99ee17e0 Mon Sep 17 00:00:00 2001
From: Szabolcs Dezsi <[email protected]>
Date: Thu, 8 Mar 2012 14:52:14 +0100
Subject: [PATCH] Comparing empty document with attached one crashes LO

---
 sw/source/core/doc/doccomp.cxx |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 80c77c4..11c43f3 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1536,14 +1536,17 @@ void SwCompareData::ShowDelete( const CompareData& rData, sal_uLong nStt,
         ((SwCompareLine*)rData.GetLine( nEnd-1 ))->GetEndNode(), 1 );
 
     sal_uInt16 nOffset = 0;
-    const CompareLine* pLine;
-    if( GetLineCount() == nInsPos )
+    const CompareLine* pLine = 0;
+    if( nInsPos >= 1 )
     {
-        pLine = GetLine( nInsPos-1 );
-        nOffset = 1;
+        if( GetLineCount() == nInsPos )
+        {
+            pLine = GetLine( nInsPos-1 );
+            nOffset = 1;
+        }
+        else
+            pLine = GetLine( nInsPos );
     }
-    else
-        pLine = GetLine( nInsPos );
 
     const SwNode* pLineNd;
     if( pLine )
-- 
1.7.7

_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to