summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2004-12-23 09:10:39 +0000
committerVladimir Glazounov <vg@openoffice.org>2004-12-23 09:10:39 +0000
commitcc592ebea31f2d24e9254fe843595e0529875302 (patch)
tree1ef538b5729ed96d61c372abc6238bc01ee39385
parente224fba02bebb5eecd0623114e3b04c89d211d16 (diff)
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
-rw-r--r--sw/source/core/undo/unsort.cxx40
1 files changed, 30 insertions, 10 deletions
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 <redline.hxx>
#endif
-
+#ifndef _NODE2LAY_HXX
+#include <node2lay.hxx>
+#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
{