X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLexer.cpp;h=098faa9737282c3fc40458ec67665b26b8b881ef;hb=a128c373f9e3563a52405a485d9a672e210208b0;hp=9cb5452ea9fa383cfea108b5179edc5451da0145;hpb=75bfed55079cab6b73fbea6ce4ae3f10d1af3b91;p=lyx.git diff --git a/src/Lexer.cpp b/src/Lexer.cpp index 9cb5452ea9..098faa9737 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -148,7 +148,7 @@ public: } }; -} // end of anon namespace +} // namespace Lexer::Pimpl::Pimpl(LexerKeyword * tab, int num) @@ -738,7 +738,7 @@ docstring Lexer::getLongString(docstring const & endtoken) break; if (firstline) { - size_t i = tmpstr.find_first_not_of(char_type(' ')); + size_t i = tmpstr.find_first_not_of(from_ascii(" \t")); if (i != string::npos) prefix = tmpstr.substr(0, i); firstline = false; @@ -747,10 +747,10 @@ docstring Lexer::getLongString(docstring const & endtoken) // further lines in long strings may have the same // whitespace prefix as the first line. Remove it. - if (prefix.length() && prefixIs(tmpstr, prefix)) - tmpstr.erase(0, prefix.length() - 1); + if (!prefix.empty() && prefixIs(tmpstr, prefix)) + tmpstr.erase(0, prefix.length()); - str += ltrim(tmpstr, "\t") + '\n'; + str += tmpstr + '\n'; } if (!pimpl_->is)