[LyX/master] Add commented-out code that might prove useful one day

Jean-Marc Lasgouttes lasgouttes at lyx.org
Mon Feb 20 12:52:01 UTC 2023


commit 92178fe4578a9cdbaa30749501df1f92373034cc
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Mon Feb 20 14:51:19 2023 +0100

    Add commented-out code that might prove useful one day
    
    The code in the dead branch looks reasonable to me, but I was not able
    to prove that it solves a problem (yet).
---
 src/Row.cpp |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/src/Row.cpp b/src/Row.cpp
index 361ef96..102b1ea 100644
--- a/src/Row.cpp
+++ b/src/Row.cpp
@@ -189,8 +189,20 @@ bool Row::Element::splitAt(int const width, int next_width, bool force,
 		// first_e row should be broken after the original element
 		first_e.row_flags |= BreakAfter;
 	} else {
-		// Restore the after flags of the original element.
+#if 1
+		// remove the BreakAfter that got added above.
 		first_e.row_flags &= ~BreakAfter;
+#else
+		// FIXME : the code below looks like a good idea, but I do not
+		//         have a use case yet. The question is what happens
+		//         when breaking at the end of a string with a
+		//         trailing space.
+		// if it turns out that no breaking was necessary, remove the
+		// BreakAfter that got added above.
+		if (first_e.dim.wid <= width)
+			first_e.row_flags &= ~BreakAfter;
+#endif
+		// Restore the after flags of the original element.
 		first_e.row_flags |= row_flags & AfterFlags;
 	}
 


More information about the lyx-cvs mailing list