Martin Vermeer wrote:
> Just for fun, have a look at stripLeadingSpaces in paragraph.C,
> and try to imagine how this should ever work with change tracking on...
> (remember that erase(0) only does a logical erase in this case.
> No whitespace is actually removed)
pandora's box...
> The method is called from DEPM. I am tempted to shortcut the whole
> of DEPM if CT is on, but perhaps I should only shortcut
> stripLeadingSpaces.
>
> Please advise ;-)
I think the attached patch is enough and better than switching DESM off. Works
for me at least.
What do you think?
Jürgen
Index: src/paragraph.C
===================================================================
--- src/paragraph.C (Revision 13407)
+++ src/paragraph.C (Arbeitskopie)
@@ -563,7 +563,8 @@ int Paragraph::stripLeadingSpaces()
return 0;
int i = 0;
- while (!empty() && (isNewline(0) || isLineSeparator(0))) {
+ while (!empty() && (isNewline(0) || isLineSeparator(0))
+ && (lookupChange(0) != Change::DELETED)) {
erase(0);
++i;
}