The below patch fixes the annoying bug #397.  I haven't committed it
(yet) since I'd like to get a little testing feedback. All I've tried
seems to work, but it's an easy fix for such an old bug, so I can't
help wonder if I've missed something.

The bug describes inserting FmtMrk when clearing text that has
different style than surrounding. That doesn't work - nor did it work
before my change. I think it would be neat to have, but it's a feature
that should be handled somewhere else, I think [I've advocated keeping
the styles separate from the Runs before - this would fix this problem
as well].

Jesper



Index: fv_View.cpp
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fv_View.cpp,v
retrieving revision 1.414
diff -u -5 -r1.414 fv_View.cpp
--- fv_View.cpp 2001/03/30 08:03:21     1.414
+++ fv_View.cpp 2001/03/30 08:57:44
@@ -1361,15 +1361,17 @@
        // Turn off list updates
        m_pDoc->disableListUpdates();
 
        if (!isSelectionEmpty())
        {
-               m_pDoc->beginUserAtomicGlob();
+               // This part used to be wrapped in a user atomic glob, but
+               // that caused some unfortunate behavior: the first letter
+               // entered of a word replacing a selection would undo
+               // separately from the other letters. See bug #397.
                PP_AttrProp AttrProp_Before;
                _deleteSelection(&AttrProp_Before);
                bResult = m_pDoc->insertSpan(getPoint(), text, count, 
&AttrProp_Before);
-               m_pDoc->endUserAtomicGlob();
        }
        else
        {
                _eraseInsertionPoint();
 

Reply via email to