Kaydet (Commit) 66cef813 authored tarafından Andre Fischer's avatar Andre Fischer

#i119953# Fixed crash on File->Insert.

Reported by: Yan Ji
Patch by: Oliver-Rainer Wittmann
Review by: Andre Fischer
üst 822661c1
...@@ -4048,31 +4048,27 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) ...@@ -4048,31 +4048,27 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
if (!mbNewDoc) if (!mbNewDoc)
{ {
// in ein Dokument einfuegen ? // inserting into an existing document:
// Da immer ganze Zeile eingelesen werden, muessen // As only complete paragraphs are inserted, the current one
// evtl. Zeilen eingefuegt / aufgebrochen werden // needs to be splitted - once or even twice.
//
const SwPosition* pPos = pPaM->GetPoint(); const SwPosition* pPos = pPaM->GetPoint();
SwTxtNode const*const pSttNd = pPos->nNode.GetNode().GetTxtNode();
sal_uInt16 nCntPos = pPos->nContent.GetIndex(); // split current paragraph to get new paragraph for the insertion
rDoc.SplitNode( *pPos, false );
// EinfuegePos nicht in leerer Zeile // another split, if insertion position was not at the end of the current paragraph.
if( nCntPos && pSttNd->GetTxt().Len() ) SwTxtNode const*const pTxtNd = pPos->nNode.GetNode().GetTxtNode();
rDoc.SplitNode( *pPos, false ); // neue Zeile erzeugen if ( pTxtNd->GetTxt().Len() )
{
if( pSttNd->GetTxt().Len() ) rDoc.SplitNode( *pPos, false );
{ // EinfuegePos nicht am Ende der Zeile // move PaM back to the newly empty paragraph
rDoc.SplitNode( *pPos, false ); // neue Zeile pPaM->Move( fnMoveBackward );
pPaM->Move( fnMoveBackward ); // gehe in leere Zeile
} }
// verhinder das Einlesen von Tabellen in Fussnoten / Tabellen // suppress insertion of tables inside footnotes.
sal_uLong nNd = pPos->nNode.GetIndex(); const sal_uLong nNd = pPos->nNode.GetIndex();
bReadNoTbl = 0 != pSttNd->FindTableNode() || bReadNoTbl = ( nNd < rDoc.GetNodes().GetEndOfInserts().GetIndex() &&
( nNd < rDoc.GetNodes().GetEndOfInserts().GetIndex() && rDoc.GetNodes().GetEndOfInserts().StartOfSectionIndex() < nNd );
rDoc.GetNodes().GetEndOfInserts().StartOfSectionIndex()
< nNd );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment