]> git.lyx.org Git - features.git/commitdiff
* src/paragraph.h:
authorMichael Schmitt <michael.schmitt@teststep.org>
Sun, 21 Jan 2007 21:11:27 +0000 (21:11 +0000)
committerMichael Schmitt <michael.schmitt@teststep.org>
Sun, 21 Jan 2007 21:11:27 +0000 (21:11 +0000)
* 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
src/paragraph.h

index 00dbb27ff906e99d36828bcd407957e6cda02cb0..b7c142ff78b1c9ad7445714870a49bd29b2337b4 100644 (file)
@@ -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;
 }
 
 
index 9dd468671686f8c1a7e52a495130170bd575b24d..e3f33e457ae42dd3d9449217a480bed76ab9b002 100644 (file)
@@ -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;