[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| Michael Gerz <[EMAIL PROTECTED]> writes:
| 
| | John C. McCabe-Dansted wrote:
| | 
| | >On Sunday 01 January 2006 01:15, Michael Gerz wrote:
| | >
| | >>SCREEN IS NOT UPDATED AFTER DELETION
| | >>
| | >> 1. New doc
| | >> 2. Enter "hello"
| | >> 3. Activate change tracking
| | >> 4. Place cursor in front of "hello"
| | >> 5. Press delete key
| | >> =>  The character is deleted  internally but the screen is not updated
| | >>(row signature problem?)
| | >>
| | >>SCREEN IS NOT UPDATED AFTER BACKSPACE
| | >>
| | >> dito
| | >>
| | >
| | >The other bugs occur on my system as well.
| | >
| | I guess this bug has been "introduced" yesterday. Martin, this looks
| | like a row signature bug.
| 
| yes... tracker info is not stored directly in the row. so on a change
| like this the row signature will stay the same.

Actually I think the simple solution for now is to use

Changes::isChange on the row range, and if we have a change, just repaint the 
row always.

This can be accessed through Paragraph::isChanged.

So in rowpainter.C: paintPar:

bool haveChanges = par.isChanged(rit->pos(), rit->endPos());

if (repaintAll || haveChanges || ...) {
        // repaint row
        ...
}

If you do this manually, is the repainting fixed then?

diff -u -p -r1.161 rowpainter.C
--- rowpainter.C        30 Dec 2005 19:02:52 -0000      1.161
+++ rowpainter.C        31 Dec 2005 15:46:45 -0000
@@ -764,6 +764,9 @@ void paintPar
        for (RowList::const_iterator rit = rb; rit != re; ++rit, ++rowno) {
                y += rit->ascent();

+                bool const haveChanges =
+                    par.isChanged(rit->pos(), rit->endpos());
+
                // Row signature; has row changed since last paint?
                lyx::size_type const row_sig =
                        calculateRowSignature(*rit, par);

@@ -774,8 +777,9 @@ void paintPar
                // If selection is on, the current row signature differs from
                // from cache, or cursor is inside an inset _on this row_,
                // then paint the row
-               if (repaintAll || par.rowSignature()[rowno] != row_sig
-                          || cur_in_inset_in_row) {
+               if (repaintAll || haveChanges
+                    || par.rowSignature()[rowno] != row_sig
+                    || cur_in_inset_in_row) {
                        // Add to row signature cache
                        par.rowSignature()[rowno] = row_sig;


-- 
        Lgb

Reply via email to