Revert John's change as it breaks reading of the user preamble.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4845 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-08-02 16:18:15 +00:00
parent 4e350da717
commit 1c9df5074e
2 changed files with 26 additions and 20 deletions

View File

@ -1,3 +1,8 @@
2002-08-02 Angus Leeming <leeming@lyx.org>
* lyxlex.C: revert John's change as it breaks reading of the user
preamble.
2002-08-02 Angus Leeming <leeming@lyx.org> 2002-08-02 Angus Leeming <leeming@lyx.org>
* importer.C (Import): * importer.C (Import):

View File

@ -168,28 +168,29 @@ string const LyXLex::getLongString(string const & endtoken)
// We do a case independent comparison, like search_kw // We do a case independent comparison, like search_kw
// does. // does.
if (compare_ascii_no_case(token, endtoken) == 0) if (compare_ascii_no_case(token, endtoken) != 0) {
break;
string tmpstr = getString(); string tmpstr = getString();
if (firstline) { if (firstline) {
string::size_type i(tmpstr.find_first_not_of(' ')); unsigned int i = 0;
if (i != string::npos) while (i < tmpstr.length()
prefix = tmpstr.substr(0, i); && tmpstr[i] == ' ') {
++i;
prefix += ' ';
}
firstline = false; firstline = false;
lyxerr[Debug::PARSER] lyxerr[Debug::PARSER] << "Prefix = `" << prefix
<< "Prefix = `" << prefix << "\'" << endl; << '\'' << endl;
} }
// further lines in long strings may have the same if (!prefix.empty()
// whitespace prefix as the first line. Remove it. && prefixIs(tmpstr, prefix)) {
if (prefixIs(tmpstr, prefix)) {
tmpstr.erase(0, prefix.length() - 1); tmpstr.erase(0, prefix.length() - 1);
} }
str += ltrim(tmpstr, "\t") + '\n'; str += ltrim(tmpstr, "\t") + '\n';
} }
else // token == endtoken
break;
}
if (!isOK()) { if (!isOK()) {
printError("Long string not ended by `" + endtoken + '\''); printError("Long string not ended by `" + endtoken + '\'');
} }