Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B60E9D609 for ; Mon, 9 Jul 2012 16:09:19 +0000 (UTC) Received: (qmail 22083 invoked by uid 500); 9 Jul 2012 16:09:19 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 21981 invoked by uid 500); 9 Jul 2012 16:09:19 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 21974 invoked by uid 99); 9 Jul 2012 16:09:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jul 2012 16:09:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jul 2012 16:09:17 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 021792388980; Mon, 9 Jul 2012 16:08:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1359246 - /incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par.cxx Date: Mon, 09 Jul 2012 16:08:56 -0000 To: ooo-commits@incubator.apache.org From: af@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120709160857.021792388980@eris.apache.org> Author: af Date: Mon Jul 9 16:08:56 2012 New Revision: 1359246 URL: http://svn.apache.org/viewvc?rev=1359246&view=rev Log: #i119953# Fixed crash on File->Insert. Reported by: Yan Ji Patch by: Oliver-Rainer Wittmann Review by: Andre Fischer Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par.cxx Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par.cxx?rev=1359246&r1=1359245&r2=1359246&view=diff ============================================================================== --- incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par.cxx (original) +++ incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par.cxx Mon Jul 9 16:08:56 2012 @@ -4048,31 +4048,27 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8G if (!mbNewDoc) { - // in ein Dokument einfuegen ? - // Da immer ganze Zeile eingelesen werden, muessen - // evtl. Zeilen eingefuegt / aufgebrochen werden - // + // inserting into an existing document: + // As only complete paragraphs are inserted, the current one + // needs to be splitted - once or even twice. 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 - if( nCntPos && pSttNd->GetTxt().Len() ) - rDoc.SplitNode( *pPos, false ); // neue Zeile erzeugen - - if( pSttNd->GetTxt().Len() ) - { // EinfuegePos nicht am Ende der Zeile - rDoc.SplitNode( *pPos, false ); // neue Zeile - pPaM->Move( fnMoveBackward ); // gehe in leere Zeile - } - - // verhinder das Einlesen von Tabellen in Fussnoten / Tabellen - sal_uLong nNd = pPos->nNode.GetIndex(); - bReadNoTbl = 0 != pSttNd->FindTableNode() || - ( nNd < rDoc.GetNodes().GetEndOfInserts().GetIndex() && - rDoc.GetNodes().GetEndOfInserts().StartOfSectionIndex() - < nNd ); + // another split, if insertion position was not at the end of the current paragraph. + SwTxtNode const*const pTxtNd = pPos->nNode.GetNode().GetTxtNode(); + if ( pTxtNd->GetTxt().Len() ) + { + rDoc.SplitNode( *pPos, false ); + // move PaM back to the newly empty paragraph + pPaM->Move( fnMoveBackward ); + } + + // suppress insertion of tables inside footnotes. + const sal_uLong nNd = pPos->nNode.GetIndex(); + bReadNoTbl = ( nNd < rDoc.GetNodes().GetEndOfInserts().GetIndex() && + rDoc.GetNodes().GetEndOfInserts().StartOfSectionIndex() < nNd ); }