[Libreoffice-commits] .: 3 commits - sw/source

Tor Lillqvist tml at kemper.freedesktop.org
Mon May 28 06:23:23 PDT 2012


 sw/source/core/undo/unattr.cxx |   48 +++++-------
 sw/source/core/undo/undel.cxx  |  130 +++++++++++++++-------------------
 sw/source/core/undo/undobj.cxx |  155 ++++++++++++++++++-----------------------
 3 files changed, 153 insertions(+), 180 deletions(-)

New commits:
commit f0c1887fc60b0537172dc07a14f1d59da902b44b
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date:   Sat May 26 14:33:51 2012 +0200

    Translate German comments in sw/source/core/undo/undobj.cxx

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 650ee75..b0a42ff 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -36,7 +36,7 @@
 #include <doc.hxx>
 #include <UndoManager.hxx>
 #include <docary.hxx>
-#include <swundo.hxx>           // fuer die UndoIds
+#include <swundo.hxx>
 #include <pam.hxx>
 #include <ndtxt.hxx>
 #include <UndoCore.hxx>
@@ -71,10 +71,7 @@ SV_IMPL_PTRARR( SwRedlineSaveDatas, SwRedlineSaveDataPtr )
 
 
 //------------------------------------------------------------
-
-// Diese Klasse speichert den Pam als sal_uInt16's und kann diese wieder zu
-
-// einem PaM zusammensetzen
+// This class saves the Pam as sal_uInt16s and can recompose those into a PaM
 SwUndRng::SwUndRng()
     : nSttNode( 0 ), nEndNode( 0 ), nSttCntnt( 0 ), nEndCntnt( 0 )
 {
@@ -97,7 +94,7 @@ void SwUndRng::SetValues( const SwPaM& rPam )
         nEndCntnt = pEnd->nContent.GetIndex();
     }
     else
-        // keine Selektion !!
+        // no selection !!
         nEndNode = 0, nEndCntnt = STRING_MAXLEN;
 
     nSttNode = pStt->nNode.GetIndex();
@@ -116,12 +113,12 @@ void SwUndRng::SetPaM( SwPaM & rPam, sal_Bool bCorrToCntnt ) const
     else
         rPam.GetPoint()->nContent.Assign( 0, 0 );
 
-    if( !nEndNode && STRING_MAXLEN == nEndCntnt )       // keine Selection
+    if( !nEndNode && STRING_MAXLEN == nEndCntnt )       // no selection
         return ;
 
     rPam.SetMark();
     if( nSttNode == nEndNode && nSttCntnt == nEndCntnt )
-        return;                             // nichts mehr zu tun
+        return;                             // nothing left to do
 
     rPam.GetPoint()->nNode = nEndNode;
     if( (pNd = rPam.GetNode())->IsCntntNode() )
@@ -183,8 +180,7 @@ void SwUndo::RemoveIdxFromRange( SwPaM& rPam, sal_Bool bMoveNext )
 
 void SwUndo::RemoveIdxRel( sal_uLong nIdx, const SwPosition& rPos )
 {
-    // nur die Crsr verschieben; die Bookmarks/TOXMarks/.. werden vom
-    // entsp. JoinNext/JoinPrev erledigt!
+    // Move only the Crsr. Bookmarks/TOXMarks/etc. are done by the corresponding JoinNext/JoinPrev
     SwNodeIndex aIdx( rPos.nNode.GetNode().GetNodes(), nIdx );
     ::PaMCorrRel( aIdx, rPos );
 }
@@ -338,15 +334,14 @@ SwUndoSaveCntnt::~SwUndoSaveCntnt()
     delete pHistory;
 }
 
-    // wird fuer das Loeschen von Inhalt benoetigt. Fuer das ReDo werden
-    // Inhalte in das UndoNodesArray verschoben. Diese Methoden fuegen
-    // am Ende eines TextNodes fuer die Attribute einen Trenner ein.
-    // Dadurch werden die Attribute nicht expandiert.
-    // MoveTo..     verschiebt aus dem NodesArray in das UndoNodesArray
-    // MoveFrom..   verschiebt aus dem UndoNodesArray in das NodesArray
+    // This is needed when deleting content. For REDO all contents will be moved into the
+    // UndoNodesArray. These methods add a seperator for the attributes to the end of TextNodes.
+    // As a result, the attributes will not be expanded.
+    // - MoveTo   moves from NodesArray into UndoNodesArray
+    // - MoveFrom moves from UndoNodesArray into NodesArray
 
-    // 2.8.93:  ist pEndNdIdx angebenen, wird vom Undo/Redo -Ins/DelFly
-    //          aufgerufen. Dann soll die gesamte Section verschoben werden.
+    // 2.8.93:  If pEndNdIdx is given, Undo/Redo calls -Ins/DelFly.
+    //          In that case the whole section should be moved.
 
 void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
                     SwIndex* pCntIdx, sal_uLong* pEndNdIdx, xub_StrLen* pEndCntIdx )
@@ -356,7 +351,7 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
 
     SwNoTxtNode* pCpyNd = rPaM.GetNode()->GetNoTxtNode();
 
-    // jetzt kommt das eigentliche Loeschen(Verschieben)
+    // here comes the actual delete (move)
     SwNodes & rNds = rDoc.GetUndoManager().GetUndoNodes();
     SwPosition aPos( pEndNdIdx ? rNds.GetEndOfPostIts()
                                : rNds.GetEndOfExtras() );
@@ -376,7 +371,7 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
     else
         aPos.nNode.GetNode().GetCntntNode()->MakeEndIndex( &aPos.nContent );
 
-    // als sal_uInt16 merken; die Indizies verschieben sich !!
+    // keep as sal_uInt16; the indices shift!
     sal_uLong nTmpMvNode = aPos.nNode.GetIndex();
     xub_StrLen nTmpMvCntnt = aPos.nContent.GetIndex();
 
@@ -392,17 +387,15 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
         rDoc.GetNodes().MoveRange( rPaM, aPos, rNds );
 
         SwTxtNode* pTxtNd = aPos.nNode.GetNode().GetTxtNode();
-        if( pTxtNd )        // fuege einen Trenner fuer die Attribute ein !
+        if( pTxtNd )        // add a seperator for the attributes
         {
-            // weil aber beim Insert die Attribute angefasst/sprich
-            // aus dem Array geloescht und wieder eingefuegt werden, koennen
-            // dadurch Attribute verschwinden (z.B "Fett aus" von 10-20,
-            // "Fett an" von 12-15, dann wird durchs Insert/Delete das
-            // "Fett an" geloescht !! Ist hier aber nicht erwuenscht !!)
-            // DARUM: nicht die Hints anfassen, direct den String manipulieren
+            // But since all attributes will be touched at an insert (meaning deleted from the
+            // array and re-added again), attributes might disappear (e.g. "no bold" for 10-20,
+            // "bold" for 12-15 -> when inserting/deleting, the "bold" will be deleted, which is
+            // not wanted here!)! Thus do not touch the hints but manipulate the string directly.
 
             String& rStr = (String&)pTxtNd->GetTxt();
-            // Zur Sicherheit lieber nur wenn wirklich am Ende steht
+            // For security reasons better only if positioned at the end
             if( rStr.Len() == aPos.nContent.GetIndex() )
             {
                 rStr.Insert( ' ' );
@@ -420,7 +413,7 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
     if( pEndCntIdx )
         *pEndCntIdx = aPos.nContent.GetIndex();
 
-    // alte Position
+    // old position
     aPos.nNode = nTmpMvNode;
     if( pNodeIdx )
         *pNodeIdx = aPos.nNode;
@@ -439,15 +432,15 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx,
                             xub_StrLen nCntIdx, SwPosition& rInsPos,
                             sal_uLong* pEndNdIdx, xub_StrLen* pEndCntIdx )
 {
-    // jetzt kommt das wiederherstellen
+    // here comes the recovery
     SwNodes & rNds = rDoc.GetUndoManager().GetUndoNodes();
     if( nNodeIdx == rNds.GetEndOfPostIts().GetIndex() )
-        return;     // nichts gespeichert
+        return;     // nothing saved
 
     ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
 
     SwPaM aPaM( rInsPos );
-    if( pEndNdIdx )         // dann hole aus diesem den Bereich
+    if( pEndNdIdx )         // than get the section from it
         aPaM.GetPoint()->nNode.Assign( rNds, *pEndNdIdx );
     else
     {
@@ -456,7 +449,7 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx,
     }
 
     SwTxtNode* pTxtNd = aPaM.GetNode()->GetTxtNode();
-    if( !pEndNdIdx && pTxtNd )  // loesche den Trenner wieder
+    if( !pEndNdIdx && pTxtNd )  // delete the seperator again
     {
         if( pEndCntIdx )
             aPaM.GetPoint()->nContent.Assign( pTxtNd, *pEndCntIdx );
@@ -474,9 +467,9 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx,
 
         rNds.MoveRange( aPaM, rInsPos, rDoc.GetNodes() );
 
-        // noch den letzen Node loeschen.
+        // delete the last Node as well
         if( !aPaM.GetPoint()->nContent.GetIndex() ||
-            ( aPaM.GetPoint()->nNode++ &&       // noch leere Nodes am Ende ??
+            ( aPaM.GetPoint()->nNode++ &&       // still empty Nodes at the end?
             &rNds.GetEndOfExtras() != &aPaM.GetPoint()->nNode.GetNode() ))
         {
             aPaM.GetPoint()->nContent.Assign( 0, 0 );
@@ -497,14 +490,13 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx,
 
     }
     else {
-        OSL_FAIL( "was ist es denn nun?" );
+        OSL_FAIL( "What happened now?" );
     }
 }
 
-// diese beiden Methoden bewegen den Point vom Pam zurueck/vor. Damit
-// kann fuer ein Undo/Redo ein Bereich aufgespannt werden. (Der
-// Point liegt dann vor dem manipuliertem Bereich !!)
-// Das Flag gibt an, ob noch vorm Point Inhalt steht.
+// These two methods move the Point of Pam backwards/forwards. With that, one can span an area for
+// a Undo/Redo. (The Point is then positioned in front of the area to manipulate!!)
+// The flag indicates if there is still content in front of Point.
 
 sal_Bool SwUndoSaveCntnt::MovePtBackward( SwPaM& rPam )
 {
@@ -512,9 +504,8 @@ sal_Bool SwUndoSaveCntnt::MovePtBackward( SwPaM& rPam )
     if( rPam.Move( fnMoveBackward ))
         return sal_True;
 
-    // gibt es nach vorne keinen Inhalt mehr, so setze den Point einfach
-    // auf die vorherige Position (Node und Content, damit der Content
-    // abgemeldet wird !!)
+    // If there is no content onwards, set Point simply to the previous position
+    // (Node and Content, so that Content will be detached!)
     rPam.GetPoint()->nNode--;
     rPam.GetPoint()->nContent.Assign( 0, 0 );
     return sal_False;
@@ -522,11 +513,11 @@ sal_Bool SwUndoSaveCntnt::MovePtBackward( SwPaM& rPam )
 
 void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, sal_Bool bMvBkwrd )
 {
-    // gab es noch Inhalt vor der Position ?
+    // Was there content before this position?
     if( bMvBkwrd )
         rPam.Move( fnMoveForward );
     else
-    {                       // setzen Point auf die naechste Position
+    {                       // set Point to the next position
         rPam.GetPoint()->nNode++;
         SwCntntNode* pCNd = rPam.GetCntntNode();
         if( pCNd )
@@ -538,13 +529,12 @@ void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, sal_Bool bMvBkwrd )
 
 
 /*
-   JP 21.03.94: loesche alle Objecte, die ContentIndizies auf den ang.
-                Bereich besitzen.
-                Zur Zeit gibts folgende Objecte
-                    - Fussnoten
+   JP 21.03.94: Delete all objects that have ContentIndices to the given area.
+                Currently these exist:
+                    - Footnotes
                     - Flys
                     - Bookmarks
-                    - Verzeichnisse
+                    - Directories
 */
 // #i81002# - extending method
 // delete certain (not all) cross-reference bookmarks at text node of <rMark>
@@ -560,7 +550,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
 
     ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
 
-    // 1. Fussnoten
+    // 1. Footnotes
     if( nsDelCntntType::DELCNT_FTN & nDelCntntType )
     {
         SwFtnIdxs& rFtnArr = pDoc->GetFtnIdxs();
@@ -571,7 +561,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
             rFtnArr.SeekEntry( pStt->nNode, &nPos );
             SwTxtFtn* pSrch;
 
-            // loesche erstmal alle, die dahinter stehen
+            // for now delete all that come afterwards
             while( nPos < rFtnArr.Count() && ( pFtnNd =
                 &( pSrch = rFtnArr[ nPos ] )->GetTxtNode())->GetIndex()
                         <= pEnd->nNode.GetIndex() )
@@ -584,12 +574,12 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
                     ( &pEnd->nNode.GetNode() == pFtnNd &&
                     nFtnSttIdx >= pEnd->nContent.GetIndex() )) )
                 {
-                    ++nPos;     // weiter suchen
+                    ++nPos;     // continue searching
                     continue;
                 }
 
-                // es muss leider ein Index angelegt werden. Sonst knallts im
-                // TextNode, weil im DTOR der SwFtn dieser geloescht wird !!
+                // Unfortunately an index needs to be created. Otherwise there will be problems
+                // with TextNode because the index will be deleted in the DTOR of SwFtn!
                 SwTxtNode* pTxtNd = (SwTxtNode*)pFtnNd;
                 if( !pHistory )
                     pHistory = new SwHistory;
@@ -610,10 +600,10 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
                     pStt->nContent.GetIndex() > nFtnSttIdx ) ||
                     ( &pEnd->nNode.GetNode() == pFtnNd &&
                     nFtnSttIdx >= pEnd->nContent.GetIndex() )))
-                    continue;               // weiter suchen
+                    continue;               // continue searching
 
-                // es muss leider ein Index angelegt werden. Sonst knallts im
-                // TextNode, weil im DTOR der SwFtn dieser geloescht wird !!
+                // Unfortunately an index needs to be created. Otherwise there will be problems
+                // with TextNode because the index will be deleted in the DTOR of SwFtn!
                 SwTxtNode* pTxtNd = (SwTxtNode*)pFtnNd;
                 if( !pHistory )
                     pHistory = new SwHistory;
@@ -661,7 +651,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
                             pAPos->nContent.GetIndex());
                         assert(pFlyHnt);
                         pHistory->Add( pFlyHnt, 0, false );
-                        // n wieder zurueck, damit nicht ein Format uebesprungen wird !
+                        // reset n so that no Format is skipped
                         n = n >= rSpzArr.Count() ? rSpzArr.Count() : n+1;
                     }
                     break;
@@ -705,8 +695,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
                                 else
                                 {
                                     pHistory->Add( *pFmt, nChainInsPos );
-                                    // n wieder zurueck, damit nicht ein
-                                    // Format uebesprungen wird !
+                                    // reset n so that no Format is skipped
                                     n = n >= rSpzArr.Count() ?
                                         rSpzArr.Count() : n+1;
                                 }
@@ -754,7 +743,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
 
                         pHistory->Add( *pFmt, nChainInsPos );
 
-                        // n wieder zurueck, damit nicht ein Format uebesprungen wird !
+                        // reset n so that no Format is skipped
                         n = n >= rSpzArr.Count() ? rSpzArr.Count() : n+1;
                     }
                     break;
@@ -871,7 +860,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
 }
 
 
-// sicher eine vollstaendige Section im Undo-Nodes-Array
+// save a complete section into UndoNodes array
 
 SwUndoSaveSection::SwUndoSaveSection()
     : pMvStt( 0 ), pRedlSaveData( 0 ), nMvLen( 0 ), nStartPos( ULONG_MAX )
@@ -880,9 +869,9 @@ SwUndoSaveSection::SwUndoSaveSection()
 
 SwUndoSaveSection::~SwUndoSaveSection()
 {
-    if( pMvStt )        // loesche noch den Bereich aus dem UndoNodes Array
+    if( pMvStt )        // delete also the section from UndoNodes array
     {
-        // SaveSection speichert den Inhalt in der PostIt-Section
+        // SaveSection saves the content in the PostIt section.
         SwNodes& rUNds = pMvStt->GetNode().GetNodes();
         rUNds.Delete( *pMvStt, nMvLen );
 
@@ -902,7 +891,7 @@ void SwUndoSaveSection::SaveSection( SwDoc* , const SwNodeRange& rRange )
 {
     SwPaM aPam( rRange.aStart, rRange.aEnd );
 
-    // loesche alle Fussnoten / FlyFrames / Bookmarks / Verzeichnisse
+    // delete all Footnotes / FlyFrames / Bookmarks / Directories
     DelCntntIndex( *aPam.GetMark(), *aPam.GetPoint() );
 
     pRedlSaveData = new SwRedlineSaveDatas;
@@ -920,8 +909,7 @@ void SwUndoSaveSection::SaveSection( SwDoc* , const SwNodeRange& rRange )
     if( 0 != ( pCNd = aPam.GetCntntNode( sal_True )) )
         aPam.GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
 
-    // Positionen als SwIndex merken, damit im DTOR dieser Bereich
-    // entfernt werden kann !!
+    // Keep positions as SwIndex so that this section can be deleted in DTOR
     sal_uLong nEnd;
     pMvStt = new SwNodeIndex( rRange.aStart );
     MoveToUndoNds( aPam, pMvStt, 0, &nEnd, 0 );
@@ -931,14 +919,14 @@ void SwUndoSaveSection::SaveSection( SwDoc* , const SwNodeRange& rRange )
 void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, SwNodeIndex* pIdx,
                                         sal_uInt16 nSectType )
 {
-    if( ULONG_MAX != nStartPos )        // gab es ueberhaupt Inhalt ?
+    if( ULONG_MAX != nStartPos )        // was there any content?
     {
-        // ueberpruefe, ob der Inhalt an der alten Position steht
+        // check if the content is at the old position
         SwNodeIndex aSttIdx( pDoc->GetNodes(), nStartPos );
 //        OSL_ENSURE( !pDoc->GetNodes()[ aSttIdx ]->GetCntntNode(),
 //                "RestoreSection(): Position on content node");
 
-        // move den Inhalt aus dem UndoNodes-Array in den Fly
+        // move the content from UndoNodes array into Fly
         SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection( aSttIdx,
                                                 (SwStartNodeType)nSectType );
 
@@ -951,14 +939,13 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, SwNodeIndex* pIdx,
 
 void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, const SwNodeIndex& rInsPos )
 {
-    if( ULONG_MAX != nStartPos )        // gab es ueberhaupt Inhalt ?
+    if( ULONG_MAX != nStartPos )        // was there any content?
     {
         SwPosition aInsPos( rInsPos );
         sal_uLong nEnd = pMvStt->GetIndex() + nMvLen - 1;
         MoveFromUndoNds( *pDoc, pMvStt->GetIndex(), 0, aInsPos, &nEnd, 0 );
 
-        // Indizies wieder zerstoren, Inhalt ist aus dem UndoNodes-Array
-        // entfernt worden.
+        // destroy indices again, content was deleted from UndoNodes array
         DELETEZ( pMvStt );
         nMvLen = 0;
 
@@ -970,7 +957,7 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, const SwNodeIndex& rInsPos
     }
 }
 
-        // sicher und setze die RedlineDaten
+        // save and set the RedlineData
 
 SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
                                         const SwPosition& rSttPos,
@@ -985,32 +972,32 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
 
     switch( eCmpPos )
     {
-    case POS_OVERLAP_BEFORE:        // Pos1 ueberlappt Pos2 am Anfang
+    case POS_OVERLAP_BEFORE:        // Pos1 overlaps Pos2 at the beginning
         nEndNode = rEndPos.nNode.GetIndex();
         nEndCntnt = rEndPos.nContent.GetIndex();
         break;
-    case POS_OVERLAP_BEHIND:        // Pos1 ueberlappt Pos2 am Ende
+    case POS_OVERLAP_BEHIND:        // Pos1 overlaps Pos2 at the end
         nSttNode = rSttPos.nNode.GetIndex();
         nSttCntnt = rSttPos.nContent.GetIndex();
         break;
 
-    case POS_INSIDE:                // Pos1 liegt vollstaendig in Pos2
+    case POS_INSIDE:                // Pos1 lays completely in Pos2
         nSttNode = rSttPos.nNode.GetIndex();
         nSttCntnt = rSttPos.nContent.GetIndex();
         nEndNode = rEndPos.nNode.GetIndex();
         nEndCntnt = rEndPos.nContent.GetIndex();
         break;
 
-    case POS_OUTSIDE:               // Pos2 liegt vollstaendig in Pos1
+    case POS_OUTSIDE:               // Pos2 lays completely in Pos1
         if( rRedl.GetContentIdx() )
         {
-            // dann den Bereich ins UndoArray verschieben und merken
+            // than move section into UndoArray and memorize it
             SaveSection( rRedl.GetDoc(), *rRedl.GetContentIdx() );
             rRedl.SetContentIdx( 0 );
         }
         break;
 
-    case POS_EQUAL:                 // Pos1 ist genauso gross wie Pos2
+    case POS_EQUAL:                 // Pos1 ist exactly as big as Pos2
         break;
 
     default:
@@ -1040,9 +1027,9 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
         pRedl->SetContentIdx( &aIdx );
     }
     SetPaM( *pRedl );
-    // erstmal die "alten" entfernen, damit im Append keine unerwarteten
-    // Dinge passieren, wie z.B. eine Delete in eigenen Insert. Dann wird
-    // naehmlich das gerade restaurierte wieder geloescht - nicht das gewollte
+    // First, delete the "old" so that in an Append no unexpected things will happen, e.g. a delete
+    // in an insert. In the latter case the just restored content will be deleted and not the one
+    // you originally wanted.
     rDoc.DeleteRedline( *pRedl, false, USHRT_MAX );
 
     RedlineMode_t eOld = rDoc.GetRedlineMode();
commit a4fbd12762c8d856e5db48fbf685b9b4620c7b8e
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date:   Sat May 26 14:18:55 2012 +0200

    Translate German comments in sw/source/core/undo/undel.cxx

diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 028a9bf..1e157a7 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -37,7 +37,7 @@
 #include <doc.hxx>
 #include <UndoManager.hxx>
 #include <swtable.hxx>
-#include <swundo.hxx>           // fuer die UndoIds
+#include <swundo.hxx>
 #include <pam.hxx>
 #include <ndtxt.hxx>
 #include <UndoCore.hxx>
@@ -126,7 +126,7 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
     if( !pHistory )
         pHistory = new SwHistory;
 
-    // loesche erstmal alle Fussnoten
+    // delete all footnotes for now
     const SwPosition *pStt = rPam.Start(),
                     *pEnd = rPam.GetPoint() == pStt
                         ? rPam.GetMark()
@@ -147,7 +147,7 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
 
     nSetPos = pHistory ? pHistory->Count() : 0;
 
-    // wurde schon was geloescht ??
+    // Is already anything deleted?
     nNdDiff = nSttNode - pStt->nNode.GetIndex();
 
     bJoinNext = !bFullPara && pEnd == rPam.GetPoint();
@@ -162,23 +162,21 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
                     : pEnd->nNode.GetNode().GetTxtNode();
     }
 
-    sal_Bool bMoveNds = *pStt == *pEnd      // noch ein Bereich vorhanden ??
+    sal_Bool bMoveNds = *pStt == *pEnd      // any area still existent?
                 ? sal_False
                 : ( SaveCntnt( pStt, pEnd, pSttTxtNd, pEndTxtNd ) || bFromTableCopy );
 
     if( pSttTxtNd && pEndTxtNd && pSttTxtNd != pEndTxtNd )
     {
-        // zwei unterschiedliche TextNodes, also speicher noch die
-        // TextFormatCollection fuers
+        // two different TextNodes, thus save also the TextFormatCollection
         pHistory->Add( pSttTxtNd->GetTxtColl(),pStt->nNode.GetIndex(), ND_TEXTNODE );
         pHistory->Add( pEndTxtNd->GetTxtColl(),pEnd->nNode.GetIndex(), ND_TEXTNODE );
 
-        if( !bJoinNext )        // Selection von Unten nach Oben
+        if( !bJoinNext )        // Selection from bottom to top
         {
-            // Beim JoinPrev() werden die AUTO-PageBreak's richtig
-            // kopiert. Um diese beim Undo wieder herzustellen, muss das
-            // Auto-PageBreak aus dem EndNode zurueckgesetzt werden.
-            // - fuer die PageDesc, ColBreak dito !
+            // When using JoinPrev() all AUTO-PageBreak's will be copied correctly. To restore them
+            // with UNDO, Auto-PageBreak of the EndNode needs to be reset. Same for PageDesc and
+            // ColBreak.
             if( pEndTxtNd->HasSwAttrSet() )
             {
                 SwRegHistory aRegHist( *pEndTxtNd, pHistory );
@@ -194,21 +192,20 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
     }
 
 
-    // verschiebe jetzt noch den PaM !!!
-    // der SPoint steht am Anfang der SSelection
+    // Move now also the PaM. The SPoint is at the beginning of a SSelection.
     if( pEnd == rPam.GetPoint() && ( !bFullPara || pSttTxtNd || pEndTxtNd ) )
         rPam.Exchange();
 
     if( !pSttTxtNd && !pEndTxtNd )
         rPam.GetPoint()->nNode--;
-    rPam.DeleteMark();          // der SPoint ist aus dem Bereich
+    rPam.DeleteMark();          // the SPoint is in the selection
 
     if( !pEndTxtNd )
         nEndCntnt = 0;
     if( !pSttTxtNd )
         nSttCntnt = 0;
 
-    if( bMoveNds )      // sind noch Nodes zu verschieben ?
+    if( bMoveNds )      // Do Nodes exist that need to be moved?
     {
         SwNodes& rNds = pDoc->GetUndoManager().GetUndoNodes();
         SwNodes& rDocNds = pDoc->GetNodes();
@@ -225,8 +222,8 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
         // Step 2: Expand selection if necessary
         if( bJoinNext || bFullPara )
         {
-            // If all content of a section will be moved into Undo,
-            // the section itself should be moved complete.
+            // If all content of a section will be moved into Undo, the section itself should be
+            // moved completely.
             while( aRg.aEnd.GetIndex() + 2  < rDocNds.Count() &&
                 ( (pTmpNd = rDocNds[ aRg.aEnd.GetIndex()+1 ])->IsEndNode() &&
                 pTmpNd->StartOfSectionNode()->IsSectionNode() &&
@@ -254,8 +251,8 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
         }
         if( bBackSp || bFullPara )
         {
-            //See above, the selection has to expanded if there are "nearly empty" sections
-            // and a replacement dummy has to be set if needed.
+            // See above, the selection has to be expanded if there are "nearly
+            // empty" sections and a replacement dummy has to be set if needed.
             while( 1 < aRg.aStart.GetIndex() &&
                 ( (pTmpNd = rDocNds[ aRg.aStart.GetIndex()-1 ])->IsSectionNode() &&
                 pTmpNd->EndOfSectionIndex() < aRg.aEnd.GetIndex() ) )
@@ -292,7 +289,7 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
         nNode = rNds.GetEndOfContent().GetIndex();
         rDocNds._MoveNodes( aRg, rNds, SwNodeIndex( rNds.GetEndOfContent() ));
         pMvStt = new SwNodeIndex( rNds, nNode );
-        nNode = rNds.GetEndOfContent().GetIndex() - nNode;      // Differenz merken !
+        nNode = rNds.GetEndOfContent().GetIndex() - nNode;      // remember difference!
         if( pSttTxtNd && pEndTxtNd )
         {
             //Step 4: Moving around sections
@@ -319,9 +316,9 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
                 bJoinNext ? pEndTxtNd->GetIndex() : pSttTxtNd->GetIndex() );
     }
     else
-        nNode = 0;      // kein Node verschoben -> keine Differenz zum Ende
+        nNode = 0;      // moved no node -> no difference at the end
 
-    // wurden davor noch Nodes geloescht ?? (FootNotes haben ContentNodes!)
+    // Are there any Nodes that got deleted before that (FootNotes have ContentNodes)?
     if( !pSttTxtNd && !pEndTxtNd )
     {
         nNdDiff = nSttNode - rPam.GetPoint()->nNode.GetIndex() - (bFullPara ? 0 : 1);
@@ -338,7 +335,7 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
     if( !rPam.GetNode()->IsCntntNode() )
         rPam.GetPoint()->nContent.Assign( 0, 0 );
 
-    // wird die History ueberhaupt benoetigt ??
+    // is a history necessary here at all?
     if( pHistory && !pHistory->Count() )
         DELETEZ( pHistory );
 }
@@ -347,7 +344,7 @@ sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd
                     SwTxtNode* pSttTxtNd, SwTxtNode* pEndTxtNd )
 {
     sal_uLong nNdIdx = pStt->nNode.GetIndex();
-    // 1 - kopiere den Anfang in den Start-String
+    // 1 - copy start in Start-String
     if( pSttTxtNd )
     {
         sal_Bool bOneNode = nSttNode == nEndNode;
@@ -361,13 +358,12 @@ sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd
         if( !bOneNode && pSttTxtNd->HasSwAttrSet() )
                 pHistory->CopyFmtAttr( *pSttTxtNd->GetpSwAttrSet(), nNdIdx );
 
-        // die Laenge kann sich veraendert haben (!!Felder!!)
+        // the length might have changed (!!Fields!!)
         nLen = ( bOneNode ? pEnd->nContent.GetIndex() : pSttTxtNd->GetTxt().Len() )
                 - pStt->nContent.GetIndex();
 
 
-        // loesche jetzt noch den Text (alle Attribut-Aenderungen kommen in
-        // die Undo-History
+        // delete now also the text (all attribute changes are added to UNDO history)
         pSttStr = (String*)new String( pSttTxtNd->GetTxt().Copy( nSttCntnt, nLen ));
         pSttTxtNd->EraseText( pStt->nContent, nLen );
         if( pSttTxtNd->GetpSwpHints() )
@@ -383,19 +379,18 @@ sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd
         }
 
         if( bOneNode )
-            return sal_False;           // keine Nodes mehr verschieben
+            return sal_False;           // stop moving more nodes
     }
 
 
-    // 2 - kopiere das Ende in den End-String
+    // 2 - copy end into End-String
     if( pEndTxtNd )
     {
         SwIndex aEndIdx( pEndTxtNd );
         nNdIdx = pEnd->nNode.GetIndex();
         SwRegHistory aRHst( *pEndTxtNd, pHistory );
 
-        // always save all text atttibutes because of possibly overlapping
-        // areas of on/off
+        // always save all text atttibutes because of possibly overlapping areas of on/off
         pHistory->CopyAttr( pEndTxtNd->GetpSwpHints(), nNdIdx, 0,
                             pEndTxtNd->GetTxt().Len(), true );
 
@@ -403,8 +398,7 @@ sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd
             pHistory->CopyFmtAttr( *pEndTxtNd->GetpSwAttrSet(), nNdIdx );
 
 
-        // loesche jetzt noch den Text (alle Attribut-Aenderungen kommen in
-        // die Undo-History
+        // delete now also the text (all attribute changes are added to UNDO history)
         pEndStr = (String*)new String( pEndTxtNd->GetTxt().Copy( 0,
                                     pEnd->nContent.GetIndex() ));
         pEndTxtNd->EraseText( aEndIdx, pEnd->nContent.GetIndex() );
@@ -419,21 +413,21 @@ sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd
             : pEndTxtNd->CreateUndo();
     }
 
-    // sind es nur zwei Nodes, dann ist schon alles erledigt.
+    // if there are only two Nodes than we're done
     if( ( pSttTxtNd || pEndTxtNd ) && nSttNode + 1 == nEndNode )
-        return sal_False;           // keine Nodes mehr verschieben
+        return sal_False;           // do not move any Node
 
-    return sal_True;                // verschiebe die dazwischen liegenden Nodes
+    return sal_True;                // move Nodes lying in between
 }
 
 
 sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
 {
-    // ist das Undo groesser als 1 Node ? (sprich: Start und EndString)
+    // Is Undo greater than one Node (that is Start and EndString)?
     if( pSttStr ? !pSttStr->Len() || pEndStr : sal_True )
         return sal_False;
 
-    // es kann nur das Loeschen von einzelnen char's zusammengefasst werden
+    // only the deletion of single char's can be condensed
     if( nSttNode != nEndNode || ( !bGroup && nSttCntnt+1 != nEndCntnt ))
         return sal_False;
 
@@ -447,8 +441,8 @@ sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
         pEnd->nNode != nSttNode )
         return sal_False;
 
-    // untercheide zwischen BackSpace und Delete. Es muss dann das
-    // Undo-Array unterschiedlich aufgebaut werden !!
+    // Distinguish between BackSpace and Delete because the Undo array needs to be constructed
+    // differently!
     if( pEnd->nContent == nSttCntnt )
     {
         if( bGroup && !bBackSp ) return sal_False;
@@ -462,7 +456,7 @@ sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
     else
         return sal_False;
 
-    // sind die beiden Nodes (Nodes-/Undo-Array) ueberhaupt TextNodes?
+    // are both Nodes (Node/Undo array) TextNodes at all?
     SwTxtNode * pDelTxtNd = pStt->nNode.GetNode().GetTxtNode();
     if( !pDelTxtNd ) return sal_False;
 
@@ -489,13 +483,12 @@ sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
         pDoc->DeleteRedline( rDelPam, false, USHRT_MAX );
     }
 
-    // Ok, die beiden 'Deletes' koennen zusammen gefasst werden, also
-    // 'verschiebe' das enstprechende Zeichen
+    // Both 'deletes' can be consolidated, so 'move' the related character
     if( bBackSp )
-        nSttCntnt--;    // BackSpace: Zeichen in Array einfuegen !!
+        nSttCntnt--;    // BackSpace: add char to array!
     else
     {
-        nEndCntnt++;    // Delete: Zeichen am Ende anhaengen
+        nEndCntnt++;    // Delete: attach char at the end
         nUChrPos++;
     }
     pSttStr->Insert( cDelChar, nUChrPos );
@@ -511,9 +504,9 @@ SwUndoDelete::~SwUndoDelete()
 {
     delete pSttStr;
     delete pEndStr;
-    if( pMvStt )        // loesche noch den Bereich aus dem UndoNodes Array
+    if( pMvStt )        // Delete also the selection from UndoNodes array
     {
-        // Insert speichert den Inhalt in der IconSection
+        // Insert saves content in IconSection
         pMvStt->GetNode().GetNodes().Delete( *pMvStt, nNode );
         delete pMvStt;
     }
@@ -754,8 +747,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
     SwNodeIndex aIdx( pDoc->GetNodes(), nCalcStt );
     SwNode* pInsNd = &aIdx.GetNode();
 
-    {       // Block, damit der SwPosition beim loeschen vom Node
-            // abgemeldet ist
+        // code block so that SwPosition is detached when deleting a Node
         SwPosition aPos( aIdx );
         if( !bDelFullPara )
         {
@@ -772,17 +764,17 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
                 if( pInsNd->IsCntntNode() )
                     aPos.nContent.Assign( (SwCntntNode*)pInsNd, nSttCntnt );
                 if( !bTblDelLastNd )
-                    pInsNd = 0;         // Node nicht loeschen !!
+                    pInsNd = 0;         // do not delete Node!
             }
         }
         else
-            pInsNd = 0;         // Node nicht loeschen !!
+            pInsNd = 0;         // do not delete Node!
 
         sal_Bool bNodeMove = 0 != nNode;
 
         if( pEndStr )
         {
-            // alle Attribute verwerfen, wurden alle gespeichert!
+            // discard attributes since they all saved!
             SwTxtNode* pTxtNd = aPos.nNode.GetNode().GetTxtNode();
 
             if( pTxtNd && pTxtNd->HasSwAttrSet() )
@@ -884,8 +876,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
         {
             aPos.nNode = nSttNode - nNdDiff + ( bJoinNext ? 0 : nReplaceDummy );
             SwTxtNode * pTxtNd = aPos.nNode.GetNode().GetTxtNode();
-            // wenn mehr als ein Node geloescht wurde, dann wurden auch
-            // alle "Node"-Attribute gespeichert
+            // If more than a single Node got deleted, also all "Node" attributes were saved
 
             if (pTxtNd != NULL)
             {
@@ -895,8 +886,8 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
                 if( pTxtNd->GetpSwpHints() )
                     pTxtNd->ClearSwpHintsArr( true );
 
-                // SectionNode-Modus und von oben nach unten selektiert:
-                //  -> im StartNode steht noch der Rest vom Join => loeschen
+                // SectionNode mode and selection from top to bottom:
+                //  -> in StartNode is still the rest of the Join => delete
                 aPos.nContent.Assign( pTxtNd, nSttCntnt );
                 pTxtNd->InsertText( *pSttStr, aPos.nContent,
                         IDocumentContentOperations::INS_NOHINTEXPAND );
@@ -908,12 +899,12 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
         if( pHistory )
         {
             pHistory->TmpRollback( pDoc, nSetPos, false );
-            if( nSetPos )       // es gab Fussnoten/FlyFrames
+            if( nSetPos )       // there were Footnodes/FlyFrames
             {
-                // gibts ausser diesen noch andere ?
+                // are there others than these ones?
                 if( nSetPos < pHistory->Count() )
                 {
-                    // dann sicher die Attribute anderen Attribute
+                    // if so save the attributes of the others
                     SwHistory aHstr;
                     aHstr.Move( 0, pHistory, nSetPos );
                     pHistory->Rollback( pDoc );
@@ -939,7 +930,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
                 ((SwTableNode*)pNode)->GetTable().GetFrmFmt()->ResetFmtAttr( nStt, nEnd );
         }
     }
-    // den temp. eingefuegten Node noch loeschen !!
+    // delete the temporarily added Node
     if( pInsNd )
         pDoc->GetNodes().Delete( aIdx, 1 );
     if( pRedlSaveData )
@@ -970,11 +961,11 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
         RemoveIdxFromRange( rPam, sal_False );
         aTmpRng.SetPaM( rPam );
 
-        if( !bJoinNext )            // Dann Selektion von unten nach oben
-            rPam.Exchange();        // wieder herstellen!
+        if( !bJoinNext )           // then restore selection from bottom to top
+            rPam.Exchange();
     }
 
-    if( pHistory )      // wurden Attribute gesichert ?
+    if( pHistory )      // are the attributes saved?
     {
         pHistory->SetTmpEnd( pHistory->Count() );
         SwHistory aHstr;
@@ -982,7 +973,7 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
 
         if( bDelFullPara )
         {
-            OSL_ENSURE( rPam.HasMark(), "PaM ohne Mark" );
+            OSL_ENSURE( rPam.HasMark(), "PaM without Mark" );
             DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint(),
                             DelCntntType(nsDelCntntType::DELCNT_ALL | nsDelCntntType::DELCNT_CHKNOCNTNT) );
 
@@ -998,7 +989,7 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
     {
         if( bDelFullPara )
         {
-            OSL_ENSURE( rPam.HasMark(), "PaM ohne Mark" );
+            OSL_ENSURE( rPam.HasMark(), "PaM without Mark" );
             DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint(),
                             DelCntntType(nsDelCntntType::DELCNT_ALL | nsDelCntntType::DELCNT_CHKNOCNTNT) );
 
@@ -1019,7 +1010,7 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
         {
             if( bTblDelLastNd )
             {
-                // dann am Ende wieder einen Node einfuegen
+                // than add again a Node at the end
                 const SwNodeIndex aTmpIdx( *pTblNd->EndOfSectionNode(), 1 );
                 rDoc.GetNodes().MakeTxtNode( aTmpIdx,
                         rDoc.GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) );
@@ -1048,16 +1039,15 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
 
         rDoc.GetNodes().Delete( aSttIdx, nEndNode - nSttNode );
 
-        // setze den Cursor immer in einen ContentNode !!
+        // always set the cursor into a ContentNode!
         if( !rPam.Move( fnMoveBackward, fnGoCntnt ) &&
             !rPam.Move( fnMoveForward, fnGoCntnt ) )
             rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), 0 );
     }
     else if( bDelFullPara )
     {
-        // der Pam wurde am Point( == Ende) um eins erhoeht, um einen
-        // Bereich fuers Undo zu haben. Der muss jetzt aber wieder entfernt
-        // werden!!!
+        // The Pam was incremented by one at Point (== end) to provide space
+        // for UNDO. This now needs to be reverted!
         rPam.End()->nNode--;
         if( rPam.GetPoint()->nNode == rPam.GetMark()->nNode )
             *rPam.GetMark() = *rPam.GetPoint();
commit 230fddbc17e39034ca1a562fd74b2144b90bd387
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date:   Sat May 26 14:01:54 2012 +0200

    Translate German comments in sw/source/core/undo/unattr.cxx

diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index 309fbe9..dad2ccc 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -49,7 +49,7 @@
 #include <IDocumentUndoRedo.hxx>
 #include <IShellCursorSupplier.hxx>
 #include <docary.hxx>
-#include <swundo.hxx>           // fuer die UndoIds
+#include <swundo.hxx>
 #include <pam.hxx>
 #include <ndtxt.hxx>
 #include <swtable.hxx>
@@ -322,7 +322,7 @@ bool SwUndoFmtAttr::IsFmtInDoc( SwDoc* pDoc )
     return 0 != m_pFmt;
 }
 
-// prueft, ob es noch im Doc ist!
+// Check if it is still in Doc
 SwFmt* SwUndoFmtAttr::GetFmt( SwDoc& rDoc )
 {
     return m_pFmt && IsFmtInDoc( &rDoc ) ? m_pFmt : 0;
@@ -365,21 +365,19 @@ void SwUndoFmtAttr::RepeatImpl(::sw::RepeatContext & rContext)
             }
         }
         break;
-
 //  case RES_CHRFMT:
 //  case RES_FRMFMT:
 
     case RES_FLYFRMFMT:
         {
-            // erstal pruefen, ob der Cursor ueberhaupt in einem fliegenden
-            // Rahmen steht. Der Weg ist: suche in allen FlyFrmFormaten
-            // nach dem FlyCntnt-Attribut und teste ob der Cursor in der
-            // entsprechenden Section liegt.
+            // Check if the cursor is in a flying frame
+            // Steps: search in all FlyFrmFormats for the FlyCntnt attribute
+            // and validate if the cursor is in the respective section
             SwFrmFmt *const pFly =
                 rContext.GetRepeatPaM().GetNode()->GetFlyFmt();
             if( pFly )
             {
-                // Bug 43672: es duerfen nicht alle Attribute gesetzt werden!
+                // Bug 43672: do not set all attributes!
                 if (SFX_ITEM_SET ==
                         m_pFmt->GetAttrSet().GetItemState( RES_CNTNT ))
                 {
@@ -423,7 +421,7 @@ void SwUndoFmtAttr::PutAttr( const SfxPoolItem& rItem )
 
 void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt )
 {
-    // das Format ist gueltig, sonst wuerde man gar bis hier kommen
+    // Format is valid, otherwise you would not reach this point here
     if( bSvDrwPt )
     {
         if ( RES_DRAWFRMFMT == m_pFmt->Which() )
@@ -512,16 +510,16 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
     {
         if( RES_DRAWFRMFMT == pFrmFmt->Which() )
         {
-            // den alten zwischengespeicherten Wert herausholen.
+            // get the old cached value
             const SwFmtFrmSize& rOldSize = static_cast<const SwFmtFrmSize&>(
                     m_pOldSet->Get( RES_FRM_SIZE ) );
             aDrawSavePt.X() = rOldSize.GetWidth();
             aDrawSavePt.Y() = rOldSize.GetHeight();
             m_pOldSet->ClearItem( RES_FRM_SIZE );
 
-            // den akt. wieder zwischenspeichern
+            // write the current value into cache
             aDrawOldPt = pFrmFmt->FindSdrObject()->GetRelativePos();
-//JP 08.10.97: ist laut AMA/MA nicht mehr noetig
+// According to AMA/MA not needed anymore
 //          pCont->DisconnectFromLayout();
         }
         else
@@ -535,10 +533,10 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
     // Consider case, that as-character anchored object has moved its anchor position.
     if (FLY_AS_CHAR == rOldAnch.GetAnchorId())
     {
-        //Bei InCntnt's wird es spannend: Das TxtAttribut muss vernichtet
-        //werden. Leider reisst dies neben den Frms auch noch das Format mit
-        //in sein Grab. Um dass zu unterbinden loesen wir vorher die
-        //Verbindung zwischen Attribut und Format.
+        // With InCntnts it's tricky: the text attribute needs to be deleted.
+        // Unfortunately, this not only destroys the Frms but also the format.
+        // To prevent that, first detach the connection between attribute and
+        // format.
         const SwPosition *pPos = rOldAnch.GetCntntAnchor();
         SwTxtNode *pTxtNode = (SwTxtNode*)&pPos->nNode.GetNode();
         OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
@@ -551,8 +549,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
                     "Wrong TxtFlyCnt-Hint." );
         const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()).SetFlyFmt();
 
-        //Die Verbindung ist geloest, jetzt muss noch das Attribut vernichtet
-        //werden.
+        // Connection is now detached, therefore the attribute can be deleted
         pTxtNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx, nIdx );
     }
 
@@ -576,10 +573,9 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
     {
         SwDrawContact *pCont =
             static_cast<SwDrawContact*>(pFrmFmt->FindContactObj());
-        // das Draw-Model hat auch noch ein Undo-Object fuer die
-        // richtige Position vorbereitet; dieses ist aber relativ.
-        // Darum verhinder hier, das durch setzen des Ankers das
-        // Contact-Object seine Position aendert.
+        // The Draw model also prepared an Undo object for its right positioning
+        // which unfortunately is relative. Therefore block here a position
+        // change of the Contact object by setting the anchor.
 //JP 08.10.97: ist laut AMA/MA nicht mehr noetig
 //          pCont->ConnectToLayout();
         SdrObject* pObj = pCont->GetMaster();
@@ -591,7 +587,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
         }
         pObj->SetRelativePos( aDrawSavePt );
 
-        // den alten Wert wieder zwischenspeichern.
+        // cache the old value again
         m_pOldSet->Put(
             SwFmtFrmSize( ATT_VAR_SIZE, aDrawOldPt.X(), aDrawOldPt.Y() ) );
     }
@@ -740,7 +736,7 @@ void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext)
                     else
                         nCnt = 0;
                 }
-                // gefunden, also loeschen
+                // found one, thus delete it
                 if( nCnt-- )
                 {
                     rDoc.DeleteTOXMark( aArr[ nCnt ] );
@@ -855,7 +851,7 @@ void SwUndoAttr::UndoImpl(::sw::UndoRedoContext & rContext)
         }
         else
         {
-            // alle Format-Redlines entfernen, werden ggfs. neu gesetzt
+            // remove all format redlines, will be recreated if needed
             SetPaM(aPam);
             pDoc->DeleteRedline(aPam, false, nsRedlineType_t::REDLINE_FORMAT);
             if ( m_pRedlineSaveData.get() )
@@ -990,7 +986,7 @@ void SwUndoAttr::RemoveIdx( SwDoc& rDoc )
                     pTxtNd->GetTxtAttrForCharAt(nCntnt, RES_TXTATR_FTN);
                 if( pTxtHt )
                 {
-                    // ok, dann hole mal die Werte
+                    // ok, so get values
                     SwTxtFtn* pFtn = static_cast<SwTxtFtn*>(pTxtHt);
                     RemoveIdxFromSection( rDoc, pFtn->GetStartNode()->GetIndex() );
                     return ;


More information about the Libreoffice-commits mailing list