From 318bc4b58c0e4a6320eefdb7fc9437f963578ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 22 Jan 2014 22:55:11 +0100 Subject: [PATCH] TextSpan: Added Append() method for convenience. --- src/apps/haiku-depot/textview/TextSpan.cpp | 7 +++++++ src/apps/haiku-depot/textview/TextSpan.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/apps/haiku-depot/textview/TextSpan.cpp b/src/apps/haiku-depot/textview/TextSpan.cpp index 08511aa920..f9fbd588e1 100644 --- a/src/apps/haiku-depot/textview/TextSpan.cpp +++ b/src/apps/haiku-depot/textview/TextSpan.cpp @@ -75,6 +75,13 @@ TextSpan::SetStyle(const CharacterStyle& style) } +bool +TextSpan::Append(const BString& text) +{ + return Insert(fCharCount, text); +} + + bool TextSpan::Insert(int32 offset, const BString& text) { diff --git a/src/apps/haiku-depot/textview/TextSpan.h b/src/apps/haiku-depot/textview/TextSpan.h index 6387b3c933..efa5d9d460 100644 --- a/src/apps/haiku-depot/textview/TextSpan.h +++ b/src/apps/haiku-depot/textview/TextSpan.h @@ -33,6 +33,7 @@ public: inline int32 CountChars() const { return fCharCount; } + bool Append(const BString& text); bool Insert(int32 offset, const BString& text); bool Remove(int32 start, int32 count);