[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Feb 28 10:04:14 UTC 2019


 sw/source/core/inc/txtfrm.hxx   |    4 ++--
 sw/source/core/text/frmform.cxx |   32 ++++++++++++++++----------------
 sw/source/core/text/txtfrm.cxx  |    2 +-
 sw/source/core/text/widorp.cxx  |   19 +++++++++----------
 4 files changed, 28 insertions(+), 29 deletions(-)

New commits:
commit 2dfffccde81b887752968387ccbdd578b1c4eb78
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Feb 26 18:43:10 2019 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Thu Feb 28 11:03:45 2019 +0100

    sw: fix some borked comments
    
    Change-Id: I18edeff43fcae98514c80d9f2c1594cc2f866e75
    Reviewed-on: https://gerrit.libreoffice.org/68401
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 7700dae25e65..4cf13bbdf1c5 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -211,8 +211,8 @@ class SW_DLLPUBLIC SwTextFrame: public SwContentFrame
     void ChangeOffset( SwTextFrame* pFrame, TextFrameIndex nNew );
 
     bool mbLocked        : 1;        // In the Format?
-    bool mbWidow         : 1;        // Are we a Widow?
-    bool mbJustWidow     : 1;        // Did we just request to be a Widow?
+    bool mbWidow         : 1;        // Is our follow a Widow?
+    bool mbJustWidow     : 1;        // Did we just request Widow flag on master?
     bool mbEmpty         : 1;        // Are we an empty paragraph?
     bool mbInFootnoteConnect  : 1;        // Is in Connect at the moment
     bool mbFootnote           : 1;        // Has at least one footnote
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index da5ce0f8e036..db81c7aca3e7 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -202,7 +202,7 @@ bool SwTextFrame::CalcFollow(TextFrameIndex const nTextOfst)
         if ( !IsInFly() && GetNext() )
         {
             pPage = FindPageFrame();
-            // Minimize = that is set back if needed - for invalidation see below
+            // Minimize (reset if possible) invalidations: see below
             bOldInvaContent  = pPage->IsInvalidContent();
         }
 
@@ -291,8 +291,8 @@ bool SwTextFrame::CalcFollow(TextFrameIndex const nTextOfst)
             }
 
             pPara = GetPara();
-            // As long as the Follow is requested due to orphan lines, it is passed these
-            // and is reformatted if possible
+            // As long as the Follow requests lines due to Orphans, it is
+            // passed these and is formatted again if possible
             if( pPara && pPara->IsPrepWidows() )
                 CalcPreps();
             else
@@ -893,7 +893,7 @@ bool SwTextFrame::CalcPreps()
 
                 WidowsAndOrphans aFrameBreak( this );
                 // Whatever the attributes say: we split the paragraph in
-                // MustFit in any case
+                // MustFit case if necessary
                 if( bPrepMustFit )
                 {
                     aFrameBreak.SetKeep( false );
@@ -910,10 +910,10 @@ bool SwTextFrame::CalcPreps()
                 }
                 if( bBreak )
                 {
-                    // We run into troubles: when TruncLines get called, the
+                    // We run into troubles: when TruncLines is called, the
                     // conditions in IsInside change immediately such that
                     // IsBreakNow can return different results.
-                    // For this reason, we make it clear to rFrameBreak, that the
+                    // For this reason, we tell rFrameBreak that the
                     // end is reached at the location of rLine.
                     // Let's see if it works ...
                     aLine.TruncLines();
@@ -1328,19 +1328,19 @@ void SwTextFrame::Format_( SwTextFormatter &rLine, SwTextFormatInfo &rInf,
         nOldBottom = 0;
     rLine.CharToLine( rReformat.Start() );
 
-    // Words can be swapped-out when inserting a space into the
-    // line that comes before the edited one. That's why we also
-    // need to format that.
-    // Optimization: If rReformat starts after the first word of the line
+    // When inserting or removing a Space, words can be moved out of the edited
+    // line and into the preceding line, hence the preceding line must be
+    // formatted as well.
+    // Optimization: If rReformat starts after the first word of the line,
     // this line cannot possibly influence the previous one.
-    // Unfortunately it can: Text size changes + FlyFrames.
-    // The backlash can affect multiple lines (Frame!)!
+    // ...Turns out that unfortunately it can: Text size changes + FlyFrames;
+    // the feedback can affect multiple lines (Frames!)!
 
     // i#46560
-    // FME: Yes, consider this case: (word) has to go to the next line
-    // because) is a forbidden character at the beginning of a line although
-    // (word would still fit on the previous line. Adding text right in front
-    // of) would not trigger a reformatting of the previous line. Adding 1
+    // FME: Yes, consider this case: "(word )" has to go to the next line
+    // because ")" is a forbidden character at the beginning of a line although
+    // "(word" would still fit on the previous line. Adding text right in front
+    // of ")" would not trigger a reformatting of the previous line. Adding 1
     // to the result of FindBrk() does not solve the problem in all cases,
     // nevertheless it should be sufficient.
     bool bPrev = rLine.GetPrev() &&
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 6d3cc8f5eeea..2eaaaeb1afb3 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -3719,7 +3719,7 @@ sal_uInt16 SwTextFrame::GetLineCount(TextFrameIndex const nPos)
 
 void SwTextFrame::ChgThisLines()
 {
-    // not necessary to format here (GerFormatted etc.), because we have to come from there!
+    // not necessary to format here (GetFormatted etc.), because we have to come from there!
     sal_uLong nNew = 0;
     const SwLineNumberInfo &rInf = GetDoc().GetLineNumberInfo();
     if ( !GetText().isEmpty() && HasPara() )
diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index a2d8761e968f..1e47974f5340 100644
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -440,20 +440,19 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine )
     }
 
     // Master to Follow
-    // If the Follow contains fewer rows than Widows after formatting,
-    // we still can cut off some rows from the Master. If the Orphans
-    // rule of the Master hereby comes into effect, we need to enlarge
-    // the Frame in CalcPrep() of the Master Frame, as it won't fit into
-    // the original page anymore.
-    // If the Master Frame can still miss a few more rows, we need to
-    // do a Shrink() in the CalcPrep(): the Follow with the Widows then
+    // If the Follow contains fewer lines than Widows after formatting,
+    // we still can move over some lines from the Master. If this triggers
+    // the Orphans rule of the Master, the Master frame must be Grow()n
+    // in its CalcPreps(), such that it won't fit onto its page anymore.
+    // But if the Master Frame can still lose a few lines, we need to
+    // do a Shrink() in the CalcPreps(); the Follow with the Widows then
     // moves onto the page of the Master, but remains unsplit, so that
     // it (finally) moves onto the next page. So much for the theory!
     //
-    // We only request one row at a time for now, because a Master's row could
-    // result in multiple lines for us.
+    // We only request one line at a time for now, because a Master's line
+    // could result in multiple lines for us.
     // Therefore, the CalcFollow() remains in control until the Follow got all
-    // necessary rows.
+    // necessary lines.
     sal_uInt16 nNeed = 1; // was: nWidLines - rLine.GetLineNr();
 
     // Special case: Master cannot give lines to follow


More information about the Libreoffice-commits mailing list