[haiku-commits] haiku: hrev46768 - src/apps/haiku-depot/textview

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 27 Jan 2014 10:42:48 +0100 (CET)

hrev46768 adds 1 changeset to branch 'master'
old head: 819824e020bf6ab001077b4ae48de9f33d778349
new head: f429142df9d4e2a3c3d8345824919a29d6662ee4
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=f429142+%5E819824e

----------------------------------------------------------------------------

f429142: Paragraph::Remove() Keep last remaining span as empty span.

                                      [ Stephan Aßmus <superstippi@xxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev46768
Commit:      f429142df9d4e2a3c3d8345824919a29d6662ee4
URL:         http://cgit.haiku-os.org/haiku/commit/?id=f429142
Author:      Stephan Aßmus <superstippi@xxxxxx>
Date:        Mon Jan 27 09:41:33 2014 UTC

----------------------------------------------------------------------------

1 file changed, 3 insertions(+), 2 deletions(-)
src/apps/haiku-depot/textview/Paragraph.cpp | 5 +++--

----------------------------------------------------------------------------

diff --git a/src/apps/haiku-depot/textview/Paragraph.cpp 
b/src/apps/haiku-depot/textview/Paragraph.cpp
index 0409e55..db6ea8a 100644
--- a/src/apps/haiku-depot/textview/Paragraph.cpp
+++ b/src/apps/haiku-depot/textview/Paragraph.cpp
@@ -203,9 +203,10 @@ Paragraph::Remove(int32 offset, int32 length)
                }
        }
 
-       // See if anything from the TextSpan at offset remained
+       // See if anything from the TextSpan at offset remained, keep it as 
empty
+       // span if it is the last remaining span.
        index--;
-       if (span.CountChars() > 0) {
+       if (span.CountChars() > 0 || fTextSpans.CountItems() == 1) {
                fTextSpans.Replace(index, span);
        } else {
                fTextSpans.Remove(index);


Other related posts:

  • » [haiku-commits] haiku: hrev46768 - src/apps/haiku-depot/textview - superstippi