From cc592ebea31f2d24e9254fe843595e0529875302 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Thu, 23 Dec 2004 09:10:39 +0000 Subject: INTEGRATION: CWS swqbugfixes10 (1.4.474); FILE MERGED 2004/11/29 10:32:53 fme 1.4.474.1: #i37739# Sorting of tables in frame without prev/next makes it necessary to use Node2Layout::RestoreUpperFrms instead of MakeFrms --- sw/source/core/undo/unsort.cxx | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) (limited to 'sw/source/core') diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx index 9c9b0acf43ad..e39c5e0c53f5 100644 --- a/sw/source/core/undo/unsort.cxx +++ b/sw/source/core/undo/unsort.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unsort.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: rt $ $Date: 2003-12-01 17:23:44 $ + * last change: $Author: vg $ $Date: 2004-12-23 10:10:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,7 +59,6 @@ * ************************************************************************/ - #pragma hdrstop #ifndef _DOC_HXX @@ -92,7 +91,9 @@ #ifndef _REDLINE_HXX #include #endif - +#ifndef _NODE2LAY_HXX +#include +#endif inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); } @@ -161,9 +162,13 @@ void SwUndoSort::Undo( SwUndoIter& rIter) pUndoTblAttr->Undo( rIter ); SwTableNode* pTblNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode(); + + // --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting + // does not work if the table is inside a frame and has no prev/next. + SwNode2Layout aNode2Layout( *pTblNd ); + // <-- + pTblNd->DelFrms(); - SwNodeIndex aBehindIdx( *pTblNd->EndOfSectionNode() ); - rDoc.GetNodes().GoNext( &aBehindIdx ); // Index in Cntnt, hinter der Tabelle const SwTable& rTbl = pTblNd->GetTable(); SwMovedBoxes aMovedList; @@ -181,7 +186,13 @@ void SwUndoSort::Undo( SwUndoIter& rIter) // schon Verschobenen in der Liste merken aMovedList.Insert(pTarget, aMovedList.Count() ); } - pTblNd->MakeFrms( &aBehindIdx); + + // Restore table frames: + // --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting + // does not work if the table is inside a frame and has no prev/next. + const ULONG nIdx = pTblNd->GetIndex(); + aNode2Layout.RestoreUpperFrms( rDoc.GetNodes(), nIdx, nIdx + 1 ); + // <-- } else { @@ -227,9 +238,13 @@ void SwUndoSort::Redo( SwUndoIter& rIter) RemoveIdxFromSection( rDoc, nSttNode, &nEndNode ); SwTableNode* pTblNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode(); + + // --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting + // does not work if the table is inside a frame and has no prev/next. + SwNode2Layout aNode2Layout( *pTblNd ); + // <-- + pTblNd->DelFrms(); - SwNodeIndex aBehindIdx( *pTblNd->EndOfSectionNode() ); - rDoc.GetNodes().GoNext( &aBehindIdx ); // Index in Cntnt, hinter der Tabelle const SwTable& rTbl = pTblNd->GetTable(); SwMovedBoxes aMovedList; @@ -250,7 +265,12 @@ void SwUndoSort::Redo( SwUndoIter& rIter) if( pUndoTblAttr ) pUndoTblAttr->Redo( rIter ); - pTblNd->MakeFrms( &aBehindIdx ); + // Restore table frames: + // --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting + // does not work if the table is inside a frame and has no prev/next. + const ULONG nIdx = pTblNd->GetIndex(); + aNode2Layout.RestoreUpperFrms( rDoc.GetNodes(), nIdx, nIdx + 1 ); + // <-- } else { -- cgit v1.2.3