summaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
authorSzabolcs Dezsi <dezsiszabi@hotmail.com>2012-03-08 14:52:14 +0100
committerTor Lillqvist <tlillqvist@suse.com>2012-03-08 16:01:08 +0200
commit706cac767c90281b74fbc27a134b022d27e2ce21 (patch)
tree849b4356d2fd392c982873c63362dde56c29c931 /sw
parentFixed crash when renaming AutoText (diff)
downloadcore-706cac767c90281b74fbc27a134b022d27e2ce21.tar.gz
core-706cac767c90281b74fbc27a134b022d27e2ce21.zip
fdo#43424: Comparing empty document with attached one crashes LO
Diffstat (limited to 'sw')
-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 80c77c4e4781..11c43f32496e 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 )