diff options
author | Szabolcs Dezsi <dezsiszabi@hotmail.com> | 2012-03-08 14:52:14 +0100 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-03-08 16:01:08 +0200 |
commit | 706cac767c90281b74fbc27a134b022d27e2ce21 (patch) | |
tree | 849b4356d2fd392c982873c63362dde56c29c931 /sw | |
parent | 0c075735344122c1c016289951f2bf832cec69a7 (diff) |
fdo#43424: Comparing empty document with attached one crashes LO
Diffstat (limited to 'sw')
-rw-r--r-- | 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 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 ) |