sw/source/core/doc/doctxm.cxx | 3 ++- sw/source/core/frmedt/fecopy.cxx | 23 ++++++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-)
New commits: commit 091b734c82630b7d88de725ec0e41e76f4017f86 Author: Michael Stahl <mst...@redhat.com> Date: Thu Dec 5 23:16:51 2013 +0100 fdo#71866: sw: un-break index updates SwTOXBaseSection::GenerateText() wants to operate directly on SwTxtNode::m_Text and accepts no substitutes such as a temporary string on the stack; this regression shows that developers often significantly underestimate the craziness of the existing code. (regression from d6e321f8264188ce8371c060ebeb75b213f0c90f) Change-Id: I01b831f35a52bde207a7db8cae9d4aadb826b2d8 (cherry picked from commit 2e7bb8d12647e1c4adb4fa86961b4839afaca253) diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index bece385..6e6a448 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -1583,7 +1583,8 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, // pTOXNd is only set at the first mark SwTxtNode* pTOXNd = (SwTxtNode*)aSortArr[nArrayIdx]->pTOXNd; - OUString rTxt = pTOXNd->GetTxt(); + // FIXME this operates directly on the node text + OUString & rTxt = const_cast<OUString&>(pTOXNd->GetTxt()); rTxt = ""; for(sal_uInt16 nIndex = nArrayIdx; nIndex < nArrayIdx + nCount; nIndex++) { commit 2171fff4c1a57ede8f9693d7c0d95c1171a49a70 Author: Michael Stahl <mst...@redhat.com> Date: Thu Dec 5 21:58:11 2013 +0100 fdo#71892: sw: fix crash when pasting table in footnote The code that updates RSIDs assumes that the number of nodes copied is the same as the number of nodes inserted, which is not true when pasting a table into a footnote because Writer can't do that, hence all table nodes are missing. Count inserted nodes instead. (regression from 062eaeffe7cb986255063bb9b0a5f3fb3fc8e34c) (cherry picked from commit 4580094d2d9d5b952c4526ee23204f75a5bb2f1b) Conflicts: sw/source/core/frmedt/fecopy.cxx Change-Id: I77b5b7751d1036a6401f708532537d874969502e diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index e695fcb..af1dc82 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -1039,25 +1039,22 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames ) aIndexBefore--; pClpDoc->CopyRange( aCpyPam, rInsPos, false ); + // Note: aCpyPam is invalid now - { - ++aIndexBefore; - SwPaM aPaM(SwPosition(aIndexBefore), - SwPosition(rInsPos.nNode)); + ++aIndexBefore; + SwPaM aPaM(SwPosition(aIndexBefore), + SwPosition(rInsPos.nNode)); - aPaM.GetDoc()->MakeUniqueNumRules(aPaM); - } - } + aPaM.GetDoc()->MakeUniqueNumRules(aPaM); - // Update the rsid of each pasted text node. - { - xub_StrLen nNodesCnt = aCpyPam.End()->nNode.GetIndex() - aCpyPam.Start()->nNode.GetIndex(); + // Update the rsid of each pasted text node. SwNodes &rDestNodes = GetDoc()->GetNodes(); - xub_StrLen nDestStart = PCURCRSR->GetPoint()->nNode.GetIndex() - nNodesCnt; + sal_uLong const nEndIdx = aPaM.End()->nNode.GetIndex(); - for (xub_StrLen nIdx = 0; nIdx <= nNodesCnt; ++nIdx) + for (sal_uLong nIdx = aPaM.Start()->nNode.GetIndex(); + nIdx <= nEndIdx; ++nIdx) { - SwTxtNode *pTxtNode = rDestNodes[ nDestStart + nIdx ]->GetTxtNode(); + SwTxtNode *const pTxtNode = rDestNodes[nIdx]->GetTxtNode(); if ( pTxtNode ) { GetDoc()->UpdateParRsid( pTxtNode ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits