]> git.lyx.org Git - features.git/commitdiff
Better safe than sorry...
authorEnrico Forestieri <forenr@lyx.org>
Mon, 15 Oct 2007 13:48:44 +0000 (13:48 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 15 Oct 2007 13:48:44 +0000 (13:48 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20972 a592a061-630c-0410-9148-cb99ea01b6c8

src/Paragraph.cpp

index 5c3b2cb63b8e04f791637149ac6db90d04903a34..9bd4e6e0b5943f52a1d7d130a7fbcd36f82b5f39 100644 (file)
@@ -597,7 +597,7 @@ bool Paragraph::Pimpl::simpleTeXBlanks(Encoding const & encoding,
        if (style.pass_thru)
                return false;
 
-       if (i < size() - 1) {
+       if (i + 1 < size()) {
                char_type next = getChar(i + 1);
                if (Encodings::isCombiningChar(next)) {
                        // This space has an accent, so we must always output it.
@@ -611,7 +611,7 @@ bool Paragraph::Pimpl::simpleTeXBlanks(Encoding const & encoding,
            && column > lyxrc.plaintext_linelen
            && i
            && getChar(i - 1) != ' '
-           && (i < size() - 1)
+           && (i + 1 < size())
            // same in FreeSpacing mode
            && !owner_->isFreeSpacing()
            // In typewriter mode, we want to avoid
@@ -650,7 +650,7 @@ int Paragraph::Pimpl::knownLangChars(odocstream & os,
        docstring const latex1 = rtrim(encoding.latexChar(c), "}");
        int length = latex1.length();
        os << latex1;
-       while (i < size() - 1) {
+       while (i + 1 < size()) {
                char_type next = getChar(i + 1);
                // Stop here if next character belongs to another
                // language or there is a change tracking status.
@@ -1011,7 +1011,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
 
                        if (pnr == phrases_nr && c != '\0') {
                                Encoding const & encoding = *(runparams.encoding);
-                               if (i < size() - 1) {
+                               if (i + 1 < size()) {
                                        char_type next = getChar(i + 1);
                                        if (Encodings::isCombiningChar(next)) {
                                                column += latexSurrogatePair(os, c, next, encoding) - 1;