fixed two consecutive spaces handling

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1948 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Allan Rae 2001-04-24 06:34:13 +00:00
parent c6e14e1536
commit 2a3b89c6f1
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2001-04-24 Allan Rae <rae@lyx.org>
* xforms_helpers.C (formatted): two consecutive spaces would kill it.
2001-04-20 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* xforms_helpers.C (formatted): do not use string::substr(1) on a

View File

@ -50,8 +50,10 @@ string formatted(string const & sin, int w, int size, int style)
for (string::const_iterator sit = sin.begin();
sit != sin.end(); ++sit) {
if ((*sit) == ' ' || (*sit) == '\n') {
sentence.push_back(word);
word.erase();
if (!word.empty()) {
sentence.push_back(word);
word.erase();
}
if ((*sit) == '\n') word += '\n';
} else {