From 1a413a2d98f848e83f061ed48f49e53607108713 Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Sun, 21 Jan 2007 21:11:27 +0000 Subject: [PATCH] * src/paragraph.h: * src/paragraph.C: stripLeadingSpaces(); return boolean indicating whether any character has been deleted - either physically or logically git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16798 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/paragraph.C | 4 ++-- src/paragraph.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/paragraph.C b/src/paragraph.C index 00dbb27ff9..b7c142ff78 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -561,7 +561,7 @@ void Paragraph::makeSameLayout(Paragraph const & par) } -int Paragraph::stripLeadingSpaces(bool trackChanges) +bool Paragraph::stripLeadingSpaces(bool trackChanges) { if (isFreeSpacing()) return 0; @@ -576,7 +576,7 @@ int Paragraph::stripLeadingSpaces(bool trackChanges) ++pos; } - return count; + return count + pos > 0; } diff --git a/src/paragraph.h b/src/paragraph.h index 9dd4686716..e3f33e457a 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -341,8 +341,9 @@ public: /// returns -1 if inset not found int getPositionOfInset(InsetBase const * inset) const; - /// Returns the number of line breaks and white-space stripped at the start - int stripLeadingSpaces(bool trackChanges); + /// returns true if at least one line break or line separator has been deleted + /// at the beginning of the paragraph (either physically or logically) + bool stripLeadingSpaces(bool trackChanges); /// return true if we allow multiple spaces bool isFreeSpacing() const; -- 2.39.5