mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-24 13:48:59 +00:00
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:
parent
4e350da717
commit
1c9df5074e
@ -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>
|
||||
|
||||
* importer.C (Import):
|
||||
|
27
src/lyxlex.C
27
src/lyxlex.C
@ -168,28 +168,29 @@ string const LyXLex::getLongString(string const & endtoken)
|
||||
|
||||
// We do a case independent comparison, like search_kw
|
||||
// does.
|
||||
if (compare_ascii_no_case(token, endtoken) == 0)
|
||||
break;
|
||||
|
||||
if (compare_ascii_no_case(token, endtoken) != 0) {
|
||||
string tmpstr = getString();
|
||||
if (firstline) {
|
||||
string::size_type i(tmpstr.find_first_not_of(' '));
|
||||
if (i != string::npos)
|
||||
prefix = tmpstr.substr(0, i);
|
||||
unsigned int i = 0;
|
||||
while (i < tmpstr.length()
|
||||
&& tmpstr[i] == ' ') {
|
||||
++i;
|
||||
prefix += ' ';
|
||||
}
|
||||
firstline = false;
|
||||
lyxerr[Debug::PARSER]
|
||||
<< "Prefix = `" << prefix << "\'" << endl;
|
||||
lyxerr[Debug::PARSER] << "Prefix = `" << prefix
|
||||
<< '\'' << endl;
|
||||
}
|
||||
|
||||
// further lines in long strings may have the same
|
||||
// whitespace prefix as the first line. Remove it.
|
||||
if (prefixIs(tmpstr, prefix)) {
|
||||
if (!prefix.empty()
|
||||
&& prefixIs(tmpstr, prefix)) {
|
||||
tmpstr.erase(0, prefix.length() - 1);
|
||||
}
|
||||
|
||||
str += ltrim(tmpstr, "\t") + '\n';
|
||||
}
|
||||
|
||||
else // token == endtoken
|
||||
break;
|
||||
}
|
||||
if (!isOK()) {
|
||||
printError("Long string not ended by `" + endtoken + '\'');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user