From c6a0782a8f641a1fe7c890eb7987cacb102a6bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 7 Sep 2013 00:08:28 +0200 Subject: [PATCH] HaikuDepot: Paragraph: Added IsEmpty(). --- src/apps/haiku-depot/textview/Paragraph.cpp | 6 ++++++ src/apps/haiku-depot/textview/Paragraph.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/apps/haiku-depot/textview/Paragraph.cpp b/src/apps/haiku-depot/textview/Paragraph.cpp index 26ad3e95ff..ffcd0c5454 100644 --- a/src/apps/haiku-depot/textview/Paragraph.cpp +++ b/src/apps/haiku-depot/textview/Paragraph.cpp @@ -143,3 +143,9 @@ Paragraph::Length() const return length; } + +bool +Paragraph::IsEmpty() const +{ + return fTextSpans.CountItems() == 0; +} diff --git a/src/apps/haiku-depot/textview/Paragraph.h b/src/apps/haiku-depot/textview/Paragraph.h index 4ad83f4ede..2c8ead001c 100644 --- a/src/apps/haiku-depot/textview/Paragraph.h +++ b/src/apps/haiku-depot/textview/Paragraph.h @@ -35,6 +35,7 @@ public: void Clear(); int32 Length() const; + bool IsEmpty() const; private: ParagraphStyle fStyle;