]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
adjust
[lyx.git] / src / Paragraph.cpp
index 299af8263cfd124a8cc908ca1af3be1c12c79f26..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.
@@ -808,7 +808,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
 
                if ((inset->lyxCode() == GRAPHICS_CODE
                     || inset->lyxCode() == MATH_CODE
-                    || inset->lyxCode() == URL_CODE)
+                    || inset->lyxCode() == HYPERLINK_CODE)
                    && running_font.isRightToLeft()) {
                        if (running_font.language()->lang() == "farsi")
                                os << "\\beginL{}";
@@ -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;