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

Michael Meeks michael at kemper.freedesktop.org
Tue Feb 21 07:45:10 PST 2012


 sw/source/core/layout/flylay.cxx |  134 ++++++++++++++++++---------------------
 sw/source/core/layout/hffrm.cxx  |   42 ++++++------
 sw/source/core/layout/newfrm.cxx |   56 +++++++---------
 3 files changed, 111 insertions(+), 121 deletions(-)

New commits:
commit 561c30b331f48e8e5ba5ee78d43ab011549dc6c4
Author: David Vogt <david.vogt at adfinis-sygroup.ch>
Date:   Tue Feb 21 15:47:14 2012 +0100

    Correct spelling and fix trailing whitespace

diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 1d44594..09bafcd 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -114,7 +114,7 @@ TYPEINIT1(SwFlyFreeFrm,SwFlyFrm);
 |*  Description      notifies the background (all CntntFrms that currently
 |*       are overlapping. Additionally, the window is also directly
 |*       invalidated (especially where there are no overlapping CntntFrms)
-|*       This also takes into account the CntntFrms within other Flys.
+|*       This also takes CntntFrms within other Flys into account.
 |*
 |*************************************************************************/
 
@@ -290,10 +290,10 @@ bool SwFlyFreeFrm::HasEnvironmentAutoSize() const
 
 void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
 {
-    // It's probably time now to take appropriate measures if the Fly
-    // doesn't fit into it's surrounding.
-    // First, the Fly gives up it's position. Then it's formatted first.
-    // Only if it still doesn't fit after giving up the position, the
+    // It's probably time now to take appropriate measures, if the Fly
+    // doesn't fit into its surrounding.
+    // First, the Fly gives up its position, then it's formatted.
+    // Only if it still doesn't fit after giving up its position, the
     // width or height are given up as well. The frame will be squeezed
     // as much as needed.
 
@@ -340,8 +340,6 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
                 const SwFmtHoriOrient &rH = GetFmt()->GetHoriOrient();
                 // Left-aligned ones may not be moved to the left when they
                 // are avoiding another one.
-                // TODO comment-translator: what left-aligned things are they
-                //                          talking about here?
                 if( rH.GetHoriOrient() == text::HoriOrientation::LEFT )
                     Frm().Pos().X() = nOld;
                 else
@@ -353,11 +351,11 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
             bValidSize = sal_False;
         else
         {
-            // If we reach this place, the Frm protrudes into forbidden
+            // If we reach this branch, the Frm protrudes into forbidden
             // sections, and correcting the position is neither allowed
             // nor possible nor required.
 
-            // With Flys that have OLE objects as lower, we make sure that
+            // For Flys with OLE objects as lower, we make sure that
             // we always resize proportionally
             Size aOldSize( Frm().SSize() );
 
@@ -445,9 +443,8 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
                 }
             }
 
-            // Now change the Frm; with columns, put the new values into the
-            // attributes, because there may occur pretty bad oscillations
-            // otherwise.
+            // Now change the Frm; for columns, we put the new values into the attributes,
+            // otherwise we'll end up with unwanted side-effects
             const long nPrtHeightDiff = Frm().Height() - Prt().Height();
             const long nPrtWidthDiff  = Frm().Width()  - Prt().Width();
             Frm().Height( aFrmRect.Height() );
@@ -725,8 +722,7 @@ void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
     // Don't delete collections just yet. This will happen at the end of the
     // action in the RemoveSuperfluous of the page, kicked off by a method of
     // the same name in the root.
-    // The FlyColl might be gone already, because the page's dtor is currently
-    // "running".
+    // The FlyColl might be gone already, because the page's dtor is being executed.
     if ( pSortedObjs )
     {
         pSortedObjs->Remove( *pToRemove );
@@ -776,8 +772,7 @@ void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
                                   ->DisposeAccessibleFrm( pToMove, sal_True );
     }
 
-    // The FlyColl might be gone already, because the page's dtor is currently
-    // "running".
+    // The FlyColl might be gone already, because the page's dtor is being executed.
     if ( pSortedObjs )
     {
         pSortedObjs->Remove( *pToMove );
@@ -946,7 +941,7 @@ void SwPageFrm::PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt )
     }
     else
     {
-        // if we received a Fly, we use that one. Otherwise, create a new
+        // If we received a Fly, we use that one. Otherwise, create a new
         // one using the Format.
         if ( pFly )
             AppendFly( pFly );
@@ -966,15 +961,14 @@ void SwPageFrm::PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt )
 |*************************************************************************/
 // #i18732# - adjustments for following text flow or not
 // AND alignment at 'page areas' for to paragraph/to character anchored objects
-// #i22305# - adjustment for following text flow
-// for to frame anchored objects
-// #i29778# - Because the calculation of the position of the
-// floating screen object (Writer fly frame or drawing object) doesn't perform
-// a calculation on its upper frames and its anchor frame, a calculation of
-// the upper frames in this method no longer sensible.
-// #i28701# - if document compatibility option 'Consider
-// wrapping style influence on object positioning' is ON, the clip area
-// corresponds to the one as the object doesn't follows the text flow.
+// #i22305# - adjustment for following text flow for to frame anchored objects
+// #i29778# - Because calculating the floating screen object's position
+// (Writer fly frame or drawing object) doesn't perform a calculation on its
+// upper frames and its anchor frame, a calculation of the upper frames in this
+// method is no longer sensible.
+// #i28701# - if document compatibility option 'Consider wrapping style influence
+// on object positioning' is ON, the clip area corresponds to the one as the
+// object doesn't follow the text flow.
 sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
 {
     sal_Bool bRet = sal_True;
commit 414848b276b0f8a6d9e73a78e0985f798ff9def1
Author: David Vogt <david.vogt at adfinis-sygroup.ch>
Date:   Mon Feb 6 12:10:38 2012 +0100

    flylay: german comments translated

diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 33c1e8c..1d44594 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -80,7 +80,7 @@ SwFlyFreeFrm::SwFlyFreeFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
 
 SwFlyFreeFrm::~SwFlyFreeFrm()
 {
-    //und Tschuess.
+    // and goodbye.
     // #i28701# - use new method <GetPageFrm()>
     if( GetPageFrm() )
     {
@@ -111,12 +111,10 @@ TYPEINIT1(SwFlyFreeFrm,SwFlyFrm);
 |*
 |*  SwFlyFreeFrm::NotifyBackground()
 |*
-|*  Beschreibung        Benachrichtigt den Hintergrund (alle CntntFrms die
-|*      gerade ueberlappt werden. Ausserdem wird das Window in einigen
-|*      Faellen direkt invalidiert (vor allem dort, wo keine CntntFrms
-|*      ueberlappt werden.
-|*      Es werden auch die CntntFrms innerhalb von anderen Flys
-|*      beruecksichtigt.
+|*  Description      notifies the background (all CntntFrms that currently
+|*       are overlapping. Additionally, the window is also directly
+|*       invalidated (especially where there are no overlapping CntntFrms)
+|*       This also takes into account the CntntFrms within other Flys.
 |*
 |*************************************************************************/
 
@@ -152,9 +150,9 @@ void SwFlyFreeFrm::MakeAll()
     if( !GetPageFrm() )
         return;
 
-    Lock(); //Der Vorhang faellt
+    Lock(); // The courtain drops
 
-    //uebernimmt im DTor die Benachrichtigung
+    // takes care of the notification in the dtor
     const SwFlyNotify aNotify( this );
 
     if ( IsClipped() )
@@ -182,13 +180,13 @@ void SwFlyFreeFrm::MakeAll()
     {
         SWRECTFN( this )
         const SwFmtFrmSize *pSz;
-        {   //Zusaetzlicher Scope, damit aAccess vor dem Check zerstoert wird!
+        {   // Additional scope, so aAccess will be destroyed before the check!
 
             SwBorderAttrAccess aAccess( SwFrm::GetCache(), this );
             const SwBorderAttrs &rAttrs = *aAccess.Get();
             pSz = &rAttrs.GetAttrSet().GetFrmSize();
 
-            //Nur einstellen wenn das Flag gesetzt ist!!
+            // Only set when the flag is set!
             if ( !bValidSize )
             {
                 bValidPrtArea = sal_False;
@@ -292,12 +290,12 @@ bool SwFlyFreeFrm::HasEnvironmentAutoSize() const
 
 void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
 {
-    //Jetzt ist es ggf. an der Zeit geignete Massnahmen zu ergreifen wenn
-    //der Fly nicht in seine Umgebung passt.
-    //Zuerst gibt der Fly seine Position auf. Danach wird er zunaechst
-    //formatiert. Erst wenn er auch durch die Aufgabe der Position nicht
-    //passt wird die Breite oder Hoehe aufgegeben - der Rahmen wird soweit
-    //wie notwendig zusammengequetscht.
+    // It's probably time now to take appropriate measures if the Fly
+    // doesn't fit into it's surrounding.
+    // First, the Fly gives up it's position. Then it's formatted first.
+    // Only if it still doesn't fit after giving up the position, the
+    // width or height are given up as well. The frame will be squeezed
+    // as much as needed.
 
     const SwVirtFlyDrawObj *pObj = GetVirtDrawObj();
     SwRect aClip, aTmpStretch;
@@ -340,8 +338,10 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
             if ( Frm().Left() != nOld )
             {
                 const SwFmtHoriOrient &rH = GetFmt()->GetHoriOrient();
-                // Links ausgerichtete duerfen nicht nach links verschoben werden,
-                // wenn sie einem anderen ausweichen.
+                // Left-aligned ones may not be moved to the left when they
+                // are avoiding another one.
+                // TODO comment-translator: what left-aligned things are they
+                //                          talking about here?
                 if( rH.GetHoriOrient() == text::HoriOrientation::LEFT )
                     Frm().Pos().X() = nOld;
                 else
@@ -353,22 +353,21 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
             bValidSize = sal_False;
         else
         {
-            //Wenn wir hier ankommen ragt der Frm in unerlaubte Bereiche
-            //hinein, und eine Positionskorrektur ist nicht erlaubt bzw.
-            //moeglich oder noetig.
+            // If we reach this place, the Frm protrudes into forbidden
+            // sections, and correcting the position is neither allowed
+            // nor possible nor required.
 
-            //Fuer Flys mit OLE-Objekten als Lower sorgen wir dafuer, dass
-            //immer proportional Resized wird.
+            // With Flys that have OLE objects as lower, we make sure that
+            // we always resize proportionally
             Size aOldSize( Frm().SSize() );
 
-            //Zuerst wird das FrmRect eingestellt, und dann auf den Frm
-            //uebertragen.
+            // First, setup the FrmRect, then transfer it to the Frm.
             SwRect aFrmRect( Frm() );
 
             if ( bBot )
             {
                 long nDiff = nClipBot;
-                nDiff -= aFrmRect.Top(); //nDiff ist die verfuegbare Strecke.
+                nDiff -= aFrmRect.Top(); // nDiff represents the available distance
                 nDiff = aFrmRect.Height() - nDiff;
                 aFrmRect.Height( aFrmRect.Height() - nDiff );
                 bHeightClipped = sal_True;
@@ -376,7 +375,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
             if ( bRig )
             {
                 long nDiff = nClipRig;
-                nDiff -= aFrmRect.Left();//nDiff ist die verfuegbare Strecke.
+                nDiff -= aFrmRect.Left();// nDiff represents the available distance
                 nDiff = aFrmRect.Width() - nDiff;
                 aFrmRect.Width( aFrmRect.Width() - nDiff );
                 bWidthClipped = sal_True;
@@ -396,8 +395,8 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
                  ( static_cast<SwCntntFrm*>(Lower())->GetNode()->GetOLENode() ||
                    !HasEnvironmentAutoSize() ) )
             {
-                //Wenn Breite und Hoehe angepasst wurden, so ist die
-                //groessere Veraenderung massgeblich.
+                // If width and height got adjusted, then the bigger
+                // change is relevant.
                 if ( aFrmRect.Width() != aOldSize.Width() &&
                      aFrmRect.Height()!= aOldSize.Height() )
                 {
@@ -408,14 +407,14 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
                         aFrmRect.Width( aOldSize.Width() );
                 }
 
-                //Breite angepasst? - Hoehe dann proportional verkleinern
+                // Adjusted the width? change height proportionally
                 if( aFrmRect.Width() != aOldSize.Width() )
                 {
                     aFrmRect.Height( aFrmRect.Width() * aOldSize.Height() /
                                      aOldSize.Width() );
                     bHeightClipped = sal_True;
                 }
-                //Hoehe angepasst? - Breite dann proportional verkleinern
+                // Adjusted the height? change width proportionally
                 else if( aFrmRect.Height() != aOldSize.Height() )
                 {
                     aFrmRect.Width( aFrmRect.Height() * aOldSize.Width() /
@@ -446,16 +445,16 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
                 }
             }
 
-            //Jetzt die Einstellungen am Frm vornehmen, bei Spalten werden
-            //die neuen Werte in die Attribute eingetragen, weil es sonst
-            //ziemlich fiese Oszillationen gibt.
+            // Now change the Frm; with columns, put the new values into the
+            // attributes, because there may occur pretty bad oscillations
+            // otherwise.
             const long nPrtHeightDiff = Frm().Height() - Prt().Height();
             const long nPrtWidthDiff  = Frm().Width()  - Prt().Width();
             Frm().Height( aFrmRect.Height() );
             Frm().Width ( Max( long(MINLAY), aFrmRect.Width() ) );
             if ( Lower() && Lower()->IsColumnFrm() )
             {
-                ColLock();  //Grow/Shrink locken.
+                ColLock();  //lock grow/shrink
                 const Size aTmpOldSize( Prt().SSize() );
                 Prt().Height( Frm().Height() - nPrtHeightDiff );
                 Prt().Width ( Frm().Width()  - nPrtWidthDiff );
@@ -463,7 +462,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
                 SwFrm *pLow = Lower();
                 do
                 {   pLow->Calc();
-                    // auch den (Column)BodyFrm mitkalkulieren
+                    // also calculate the (Column)BodyFrm
                     ((SwLayoutFrm*)pLow)->Lower()->Calc();
                     pLow = pLow->GetNext();
                 } while ( pLow );
@@ -523,13 +522,13 @@ void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
     if( RES_ATTRSET_CHG == nWhich && SFX_ITEM_SET ==
         ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_ANCHOR, sal_False,
             (const SfxPoolItem**)&pAnch ))
-        ;       // Beim GetItemState wird der AnkerPointer gesetzt !
+                // GetItemState sets the anchor pointer!
 
     else if( RES_ANCHOR == nWhich )
     {
-        //Ankerwechsel, ich haenge mich selbst um.
-        //Es darf sich nicht um einen Wechsel des Ankertyps handeln,
-        //dies ist nur ueber die SwFEShell moeglich.
+        // Change of anchor. I'm attaching myself to the new place.
+        // It's not allowed to change the anchor type. This is only
+        // possible via SwFEShell.
         pAnch = (SwFmtAnchor*)pNew;
     }
 
@@ -537,10 +536,9 @@ void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
     {
         OSL_ENSURE( pAnch->GetAnchorId() ==
                 GetFmt()->GetAnchor().GetAnchorId(),
-                "8-) Unzulaessiger Wechsel des Ankertyps." );
+                "8-) Invalid change of anchor type." );
 
-        //Abmelden, Seite besorgen, an den entsprechenden LayoutFrm
-        //haengen.
+        // Unregister, get hold of the page, attach to the corresponding LayoutFrm.
         SwRect aOld( GetObjRectWithSpaces() );
         // #i28701# - use new method <GetPageFrm()>
         SwPageFrm *pOldPage = GetPageFrm();
@@ -625,7 +623,7 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
             pObj->SetOrdNum( nNewNum );
     }
 
-    //Flys die im Cntnt sitzen beachten wir nicht weiter.
+    // Don't look further at Flys that sit inside the Cntnt.
     if ( pNew->IsFlyInCntFrm() )
         InvalidateFlyInCnt();
     else
@@ -709,7 +707,7 @@ void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
         ((SwRootFrm*)GetUpper())->InvalidateBrowseWidth();
     }
 
-    //Flys die im Cntnt sitzen beachten wir nicht weiter.
+    // Don't look further at Flys that sit inside the Cntnt.
     if ( pToRemove->IsFlyInCntFrm() )
         return;
 
@@ -724,11 +722,11 @@ void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
                                   ->DisposeAccessibleFrm( pToRemove, sal_True );
     }
 
-    //Collections noch nicht loeschen. Das passiert am Ende
-    //der Action im RemoveSuperfluous der Seite - angestossen von gleich-
-    //namiger Methode der Root.
-    //Die FlyColl kann bereits weg sein, weil der DTor der Seite
-    //gerade 'laeuft'
+    // Don't delete collections just yet. This will happen at the end of the
+    // action in the RemoveSuperfluous of the page, kicked off by a method of
+    // the same name in the root.
+    // The FlyColl might be gone already, because the page's dtor is currently
+    // "running".
     if ( pSortedObjs )
     {
         pSortedObjs->Remove( *pToRemove );
@@ -748,7 +746,7 @@ void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
 
 void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
 {
-    //Invalidierungen
+    // Invalidations
     if ( GetUpper() )
     {
         ((SwRootFrm*)GetUpper())->SetIdleFlags();
@@ -778,8 +776,8 @@ void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
                                   ->DisposeAccessibleFrm( pToMove, sal_True );
     }
 
-    //Die FlyColl kann bereits weg sein, weil der DTor der Seite
-    //gerade 'laeuft'
+    // The FlyColl might be gone already, because the page's dtor is currently
+    // "running".
     if ( pSortedObjs )
     {
         pSortedObjs->Remove( *pToMove );
@@ -788,7 +786,7 @@ void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
         }
     }
 
-    //Anmelden
+    // Register
     if ( !pDest->GetSortedObjs() )
         pDest->pSortedObjs = new SwSortedObjs();
 
@@ -948,12 +946,12 @@ void SwPageFrm::PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt )
     }
     else
     {
-        //Wenn ein Fly uebergeben wurde, so benutzen wir diesen, ansonsten wird
-        //mit dem Format einer erzeugt.
+        // if we received a Fly, we use that one. Otherwise, create a new
+        // one using the Format.
         if ( pFly )
             AppendFly( pFly );
         else
-        {   OSL_ENSURE( pFmt, ":-( kein Format fuer Fly uebergeben." );
+        {   OSL_ENSURE( pFmt, ":-( No Format given for Fly." );
             pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, this, this );
             AppendFly( pFly );
             ::RegistFlys( this, pFly );
@@ -1005,14 +1003,14 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
             rRect = pClip->Frm();
             SWRECTFN( pClip )
 
-            //Vertikales clipping: Top und Bottom, ggf. an PrtArea
+            // vertical clipping: Top and Bottom, also to PrtArea if neccessary
             if( rV.GetVertOrient() != text::VertOrientation::NONE &&
                 rV.GetRelationOrient() == text::RelOrientation::PRINT_AREA )
             {
                 (rRect.*fnRect->fnSetTop)( (pClip->*fnRect->fnGetPrtTop)() );
                 (rRect.*fnRect->fnSetBottom)( (pClip->*fnRect->fnGetPrtBottom)() );
             }
-            //Horizontales clipping: Left und Right, ggf. an PrtArea
+            // horizontal clipping: Top and Bottom, also to PrtArea if necessary
             const SwFmtHoriOrient &rH = pFly->GetFmt()->GetHoriOrient();
             if( rH.GetHoriOrient() != text::HoriOrientation::NONE &&
                 rH.GetRelationOrient() == text::RelOrientation::PRINT_AREA )
@@ -1178,8 +1176,8 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
                 }
                 if ( pCell )
                 {
-                    //CellFrms koennen auch in 'unerlaubten' Bereichen stehen, dann
-                    //darf der Fly das auch.
+                    // CellFrms might also sit in unallowed sections. In this case,
+                    // the Fly is allowed to do so as well
                     SwRect aTmp( pCell->Prt() );
                     aTmp += pCell->Frm().Pos();
                     rRect.Union( aTmp );
commit b4aa7d03033a0a4094af66da3f9063338724b486
Author: David Vogt <david.vogt at adfinis-sygroup.ch>
Date:   Mon Feb 6 11:00:35 2012 +0100

    Translated german code comments to english

diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index 723a91b..1f496c5 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -89,7 +89,7 @@ static SwTwips lcl_CalcContentHeight(SwLayoutFrm & frm)
         {
             nTmp = ((SwTxtFrm*)pFrm)->GetParHeight()
                 - pFrm->Prt().Height();
-            // Dieser TxtFrm waere gern ein bisschen groesser
+            // This TxtFrm would like to be a bit bigger
             nRemaining += nTmp;
         }
         else if( pFrm->IsSctFrm() && ((SwSectionFrm*)pFrm)->IsUndersized() )
@@ -124,9 +124,9 @@ SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, SwFrm* pSib, sal_uInt16 nTypeIn)
 
     const SwFmtCntnt &rCnt = pFmt->GetCntnt();
 
-    OSL_ENSURE( rCnt.GetCntntIdx(), "Kein Inhalt fuer Header." );
+    OSL_ENSURE( rCnt.GetCntntIdx(), "No content for Header." );
 
-    //Fuer Header Footer die Objekte gleich erzeugen lassen.
+    // Have the objects created right now for header and footer
     sal_Bool bOld = bObjsDirect;
     bObjsDirect = sal_True;
     sal_uLong nIndex = rCnt.GetCntntIdx()->GetIndex();
@@ -218,12 +218,12 @@ void SwHeadFootFrm::FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs)
     }
     else
     {
-        //Position einstellen.
+        // Set position
         aPrt.Left( pAttrs->CalcLeft( this ) );
         aPrt.Top ( pAttrs->CalcTop()  );
 
-        //Sizes einstellen; die Groesse gibt der umgebende Frm vor, die
-        //die Raender werden einfach abgezogen.
+        // Set sizes - the sizes are given by the surrounding Frm, just
+        // subtract the borders.
         // OD 23.01.2003 #106895# - add first parameter to <SwBorderAttrs::CalcRight(..)>
         SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
         aPrt.Width ( aFrm.Width() - nLR );
@@ -303,7 +303,7 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
 
                     if( pFrm->IsTxtFrm() &&
                         ((SwTxtFrm*)pFrm)->IsUndersized() )
-                        // Dieser TxtFrm waere gern ein bisschen groesser
+                        // This TxtFrm would like to be a bit bigger
                         nRemaining += ((SwTxtFrm*)pFrm)->GetParHeight()
                             - pFrm->Prt().Height();
                     else if( pFrm->IsSctFrm() &&
@@ -374,14 +374,14 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
                     }
                     else
                         Shrink( -nDiff );
-                    //Schnell auf dem kurzen Dienstweg die Position updaten.
+                    // Quickly update the position
 
                     MakePos();
                     ColLock();
                 }
                 else
                     break;
-                //Unterkante des Uppers nicht ueberschreiten.
+                // Don't overwrite the lower edge of the upper
                 if ( GetUpper() && Frm().Height() )
                 {
                     const SwTwips nDeadLine = GetUpper()->Frm().Top() +
@@ -413,7 +413,7 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
 
 void SwHeadFootFrm::Format(const SwBorderAttrs * pAttrs)
 {
-    OSL_ENSURE( pAttrs, "SwFooterFrm::Format, pAttrs ist 0." );
+    OSL_ENSURE( pAttrs, "SwFooterFrm::Format, pAttrs is 0." );
 
     if ( bValidPrtArea && bValidSize )
         return;
@@ -670,7 +670,7 @@ sal_Bool SwHeadFootFrm::GetEatSpacing() const
 |*
 |*  SwPageFrm::PrepareHeader()
 |*
-|*  Beschreibung        Erzeugt oder Entfernt Header
+|*  Description        Creates or removes headers
 |*
 |*************************************************************************/
 
@@ -708,11 +708,11 @@ void SwPageFrm::PrepareHeader()
     const sal_Bool bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode());
 
     if ( bOn && rH.IsActive() )
-    {   //Header einsetzen, vorher entfernen falls vorhanden.
-        OSL_ENSURE( rH.GetHeaderFmt(), "FrmFmt fuer Header nicht gefunden." );
+    {   //Implant header, but remove first, if already present
+        OSL_ENSURE( rH.GetHeaderFmt(), "FrmFmt for Header not found." );
 
         if ( pLay->GetFmt() == (SwFrmFmt*)rH.GetHeaderFmt() )
-            return; //Der Footer ist bereits der richtige
+            return; // Header is already the correct one.
 
         if ( pLay->IsHeaderFrm() )
         {   SwLayoutFrm *pDel = pLay;
@@ -721,14 +721,14 @@ void SwPageFrm::PrepareHeader()
             pDel->Cut();
             delete pDel;
         }
-        OSL_ENSURE( pLay, "Wohin mit dem Header?" );
+        OSL_ENSURE( pLay, "Where to with the Header?" );
         SwHeaderFrm *pH = new SwHeaderFrm( (SwFrmFmt*)rH.GetHeaderFmt(), this );
         pH->Paste( this, pLay );
         if ( GetUpper() )
             ::RegistFlys( this, pH );
     }
     else if ( pLay && pLay->IsHeaderFrm() )
-    {   //Header entfernen falls vorhanden.
+    {   // Remove header if present.
         ::DelFlys( pLay, this );
         pLay->Cut();
         delete pLay;
@@ -738,7 +738,7 @@ void SwPageFrm::PrepareHeader()
 |*
 |*  SwPageFrm::PrepareFooter()
 |*
-|*  Beschreibung        Erzeugt oder Entfernt Footer
+|*  Description        Creates or removes footer
 |*
 |*************************************************************************/
 
@@ -757,11 +757,11 @@ void SwPageFrm::PrepareFooter()
     const sal_Bool bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode());
 
     if ( bOn && rF.IsActive() )
-    {   //Footer einsetzen, vorher entfernen falls vorhanden.
-        OSL_ENSURE( rF.GetFooterFmt(), "FrmFmt fuer Footer nicht gefunden." );
+    {   //Implant footer, but remove first, if already present
+        OSL_ENSURE( rF.GetFooterFmt(), "FrmFmt for Footer not found." );
 
         if ( pLay->GetFmt() == (SwFrmFmt*)rF.GetFooterFmt() )
-            return; //Der Footer ist bereits der richtige.
+            return;  // Footer is already the correct one.
 
         if ( pLay->IsFooterFrm() )
         {   ::DelFlys( pLay, this );
@@ -774,7 +774,7 @@ void SwPageFrm::PrepareFooter()
             ::RegistFlys( this, pF );
     }
     else if ( pLay && pLay->IsFooterFrm() )
-    {   //Footer entfernen falls vorhanden.
+    {   // Remove footer if already present
         ::DelFlys( pLay, this );
         ViewShell *pShell;
         if ( pLay->GetPrev() && 0 != (pShell = getRootFrm()->GetCurrShell()) &&
commit cc6697fa0bac2a8963bfc4bf2ae6f717e654380e
Author: David Vogt <david.vogt at adfinis-sygroup.ch>
Date:   Tue Feb 21 14:26:06 2012 +0100

    Correct some spelling errors and trailing whitespace

diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 6aceb1b..3aa7a13 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -381,7 +381,7 @@ void _FrmFinit()
         if( (*SwFrm::GetCachePtr())[ --n ] )
         {
             SwCacheObj* pObj = (*SwFrm::GetCachePtr())[ n ];
-            OSL_ENSURE( !pObj, "Wer hat sich nicht ausgetragen?"); // TOOD: translate?
+            OSL_ENSURE( !pObj, "Who didn't derregister?");
         }
 #endif
     delete SwRootFrm::pVout;
@@ -468,7 +468,7 @@ void InitCurrShells( SwRootFrm *pRoot )
 |*  Description:
 |*      The RootFrm requests an own FrmFmt from the document, which it is
 |*      going to delete again in the dtor. The own FrmFmt is derived from
-|*      the passed-in FrmFmt.
+|*      the passed FrmFmt.
 |*
 |*************************************************************************/
 
commit d71b97c1687c3b87337737d4b975986e1933f352
Author: David Vogt <david.vogt at adfinis-sygroup.ch>
Date:   Mon Feb 6 10:45:17 2012 +0100

    Translated german code comments to english

diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 5f12ef5..6aceb1b 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -356,8 +356,8 @@ SwRectFn fnRectVL2R = &aVerticalRightToLeft;
 // #i65250#
 sal_uInt32 SwFrm::mnLastFrmId=0;
 
-TYPEINIT1(SwFrm,SwClient);      //rtti fuer SwFrm
-TYPEINIT1(SwCntntFrm,SwFrm);    //rtti fuer SwCntntFrm
+TYPEINIT1(SwFrm,SwClient);      //rtti for SwFrm
+TYPEINIT1(SwCntntFrm,SwFrm);    //rtti for SwCntntFrm
 
 
 void _FrmInit()
@@ -376,12 +376,12 @@ void _FrmInit()
 void _FrmFinit()
 {
 #if OSL_DEBUG_LEVEL > 0
-    // im Chache duerfen nur noch 0-Pointer stehen
+    // The cache may only contain null pointers at this time.
     for( sal_uInt16 n = SwFrm::GetCachePtr()->Count(); n; )
         if( (*SwFrm::GetCachePtr())[ --n ] )
         {
             SwCacheObj* pObj = (*SwFrm::GetCachePtr())[ n ];
-            OSL_ENSURE( !pObj, "Wer hat sich nicht ausgetragen?");
+            OSL_ENSURE( !pObj, "Wer hat sich nicht ausgetragen?"); // TOOD: translate?
         }
 #endif
     delete SwRootFrm::pVout;
@@ -390,7 +390,7 @@ void _FrmFinit()
 
 /*************************************************************************
 |*
-|*  RootFrm::Alles was so zur CurrShell gehoert
+|*  RootFrm::Everything that belongs to CurrShell
 |*
 |*************************************************************************/
 
@@ -400,7 +400,7 @@ SV_IMPL_PTRARR_SORT(SwCurrShells,CurrShellPtr)
 
 CurrShell::CurrShell( ViewShell *pNew )
 {
-    OSL_ENSURE( pNew, "0-Shell einsetzen?" );
+    OSL_ENSURE( pNew, "insert 0-Shell?" );
     pRoot = pNew->GetLayout();
     if ( pRoot )
     {
@@ -438,15 +438,15 @@ void SetShell( ViewShell *pSh )
 
 void SwRootFrm::DeRegisterShell( ViewShell *pSh )
 {
-    //Wenn moeglich irgendeine Shell aktivieren
+    // Activate some shell if possible
     if ( pCurrShell == pSh )
         pCurrShell = pSh->GetNext() != pSh ? (ViewShell*)pSh->GetNext() : 0;
 
-    //Das hat sich eruebrigt
+    // Doesn't matter anymore
     if ( pWaitingCurrShell == pSh )
         pWaitingCurrShell = 0;
 
-    //Referenzen entfernen.
+    // Remove references
     for ( sal_uInt16 i = 0; i < pCurrShells->Count(); ++i )
     {
         CurrShell *pC = (*pCurrShells)[i];
@@ -465,10 +465,10 @@ void InitCurrShells( SwRootFrm *pRoot )
 |*
 |*  SwRootFrm::SwRootFrm()
 |*
-|*  Beschreibung:
-|*      Der RootFrm laesst sich grundsaetzlich vom Dokument ein eigenes
-|*      FrmFmt geben. Dieses loescht er dann selbst im DTor.
-|*      Das eigene FrmFmt wird vom uebergebenen Format abgeleitet.
+|*  Description:
+|*      The RootFrm requests an own FrmFmt from the document, which it is
+|*      going to delete again in the dtor. The own FrmFmt is derived from
+|*      the passed-in FrmFmt.
 |*
 |*************************************************************************/
 
@@ -483,7 +483,7 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
     mbBookMode( false ),
     mbSidebarChanged( false ),
     mbNeedGrammarCheck( false ),
-    nBrowseWidth( MM50*4 ), //2cm Minimum
+    nBrowseWidth( MM50*4 ), //2cm minimum
     pTurbo( 0 ),
     pLastPage( 0 ),
     pCurrShell( pSh ),
@@ -508,8 +508,8 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
     IDocumentFieldsAccess *pFieldsAccess = pFmt->getIDocumentFieldsAccess();
     const IDocumentSettingAccess *pSettingAccess = pFmt->getIDocumentSettingAccess();
     pTimerAccess->StopIdling();
-    pLayoutAccess->SetCurrentViewShell( this->GetCurrShell() );     //Fuer das Erzeugen der Flys durch MakeFrms()   //swmod 071108//swmod 071225
-    bCallbackActionEnabled = sal_False; //vor Verlassen auf sal_True setzen!
+    pLayoutAccess->SetCurrentViewShell( this->GetCurrShell() );     // Helps creating the Flys by MakeFrms()   //swmod 071108//swmod 071225
+    bCallbackActionEnabled = sal_False; // needs to be set to sal_True before leaving!
 
     SdrModel *pMd = pFmt->getIDocumentDrawModelAccess()->GetDrawModel();
     if ( pMd )
@@ -522,10 +522,9 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
         pDrawPage->SetSize( Frm().SSize() );
     }
 
-    //Initialisierung des Layouts: Seiten erzeugen. Inhalt mit cntnt verbinden
-    //usw.
-    //Zuerst einiges initialiseren und den ersten Node besorgen (der wird
-    //fuer den PageDesc benoetigt).
+    // Initialize the layout: create pages, link content with Cntnt etc.
+    // First, initialize some stuff, then get hold of the first
+    // node (which will be needed for the PageDesc).
 
     SwDoc* pDoc = pFmt->GetDoc();
     SwNodeIndex aIndex( *pDoc->GetNodes().GetEndOfContent().StartOfSectionNode() );
@@ -533,8 +532,7 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
     // #123067# pNode = 0 can really happen
     SwTableNode *pTblNd= pNode ? pNode->FindTableNode() : 0;
 
-    //PageDesc besorgen (entweder vom FrmFmt des ersten Node oder den
-    //initialen.)
+    // Get hold of PageDesc (either via FrmFmt of the first node or the initial one).
     SwPageDesc *pDesc = 0;
     sal_uInt16 nPgNum = 1;
 
@@ -542,14 +540,14 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
     {
         const SwFmtPageDesc &rDesc = pTblNd->GetTable().GetFrmFmt()->GetPageDesc();
         pDesc = (SwPageDesc*)rDesc.GetPageDesc();
-        //#19104# Seitennummeroffset beruecksictigen!!
+        //#19104# respect the page number offset!!
         bIsVirtPageNum = 0 != ( nPgNum = rDesc.GetNumOffset() );
     }
     else if ( pNode )
     {
         const SwFmtPageDesc &rDesc = pNode->GetSwAttrSet().GetPageDesc();
         pDesc = (SwPageDesc*)rDesc.GetPageDesc();
-        //#19104# Seitennummeroffset beruecksictigen!!
+        //#19104# respect the page number offset!!
         bIsVirtPageNum = 0 != ( nPgNum = rDesc.GetNumOffset() );
     }
     else
@@ -559,17 +557,17 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
             &const_cast<const SwDoc *>(pDoc)->GetPageDesc( 0 );
     const sal_Bool bOdd = !nPgNum || 0 != ( nPgNum % 2 );
 
-    //Eine Seite erzeugen und in das Layout stellen
+    // Create a page and put it in the layout
     SwPageFrm *pPage = ::InsertNewPage( *pDesc, this, bOdd, sal_False, sal_False, 0 );
 
-    //Erstes Blatt im Bodytext-Bereich suchen.
+    // Find the first page in the Bodytext section.
     SwLayoutFrm *pLay = pPage->FindBodyCont();
     while( pLay->Lower() )
         pLay = (SwLayoutFrm*)pLay->Lower();
 
     SwNodeIndex aTmp( *pDoc->GetNodes().GetEndOfContent().StartOfSectionNode(), 1 );
     ::_InsertCnt( pLay, pDoc, aTmp.GetIndex(), sal_True );
-    //Noch nicht ersetzte Master aus der Liste entfernen.
+    //Remove masters that haven't been replaced yet from the list.
     RemoveMasterObjs( pDrawPage );
     if( pSettingAccess->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
         pFieldsAccess->UpdateRefFlds( NULL );
@@ -624,7 +622,7 @@ SwRootFrm::~SwRootFrm()
     delete pDestroy;
     pDestroy = 0;
 
-    //Referenzen entfernen.
+    // Remove references
     for ( sal_uInt16 i = 0; i < pCurrShells->Count(); ++i )
         (*pCurrShells)[i]->pRoot = 0;
 
@@ -642,7 +640,7 @@ SwRootFrm::~SwRootFrm()
 
 void SwRootFrm::RemoveMasterObjs( SdrPage *pPg )
 {
-    //Alle Masterobjekte aus der Page entfernen. Nicht loeschen!!
+    // Remove all master objects from the Page. But don't delete!
     for( sal_uLong i = pPg ? pPg->GetObjCount() : 0; i; )
     {
         SdrObject* pObj = pPg->GetObj( --i );


More information about the Libreoffice-commits mailing list