summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzabolcs Dezsi <dezsiszabi@hotmail.com>2012-03-08 14:52:14 +0100
committerAndras Timar <atimar@suse.com>2012-04-23 08:55:40 +0200
commitfb172ff8a71765799d5e45edebfeae72243dcf46 (patch)
tree3b719d350a4b845ddc14edb3e7ea0995c68a6504
parent1ad284007d898c68665c91979be3bd326c290ba1 (diff)
fdo#43424: Comparing empty document with attached one crashes LO
Signed-off-by: Andras Timar <atimar@suse.com>
-rw-r--r--sw/source/core/doc/doccomp.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 8f4f56d59ff2..1e1bd0631eee 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1327,14 +1327,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 )