patch -- fix for Bug 760 [and ChangeLog question]


Subject: patch -- fix for Bug 760 [and ChangeLog question]
From: Jesper Skov (jskov@redhat.com)
Date: Sun May 21 2000 - 03:26:00 CDT


Out of curiosity, how come ChangeLogs aren't used for abiword? They
sometimes come in handy when digging for the introduction of a bug (or
a bad fix like the below).

CVS logs don't quite capture the same information and are not suitable
for off-line use (think portables and European modem users).

Also, a ChangeLog entry can show all implicated files/functions for a
particular change which can be really nice to have.

As for the patch, I don't know if it's the right place for the fix. I
think it actually may be since that's where the problem is introduced :)

Still, the update() function should be able to make an update on a
block regardless of what state it's in, right? An alternative way to
fix this is to move the
checkForBeginOnForcedBreak();checkForEndOnForcedBreak() pair higher up
in update() -- assuming the below notifyListeners can be removed.

For someone with a clearer idea of what's going on to decide.

Cheers,
Jesper

2000-05-21 Jesper Skov <jskov@redhat.com>

        * fl_BlockLayout.cpp (doclistener_insertSpan): Pad block with empty
        runs to make it valid for size/point calls.

Index: fl_BlockLayout.cpp
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fl_BlockLayout.cpp,v
retrieving revision 1.151
diff -u -5 -r1.151 fl_BlockLayout.cpp
--- fl_BlockLayout.cpp 2000/05/18 00:03:05 1.151
+++ fl_BlockLayout.cpp 2000/05/21 08:15:08
@@ -2158,15 +2158,23 @@
                 _doInsertTextSpan(blockOffset + iNormalBase, i - iNormalBase);
         }
         
         setNeedsReformat();
 
+ // Ensure that the block has Runs that can contain the IP.
+ // This is a (temporary?) fix for Bug 760 This is partly
+ // required due to the notifyListeners below, but also due to
+ // the fl_BlockLayout::format() which does size calculations
+ // before calling these functions.
+ checkForBeginOnForcedBreak();
+ checkForEndOnForcedBreak();
+
         FV_View* pView = m_pLayout->getView();
         if (pView)
         {
                 pView->_setPoint(pcrs->getPosition()+len);
- pView->notifyListeners(AV_CHG_FMTCHAR); // TODO verify that this is necessary.
+ pView->notifyListeners(AV_CHG_FMTCHAR); // TODO verify that this is necessary. Also see above.
         }
 
         _insertSquiggles(blockOffset, len);
 
         return UT_TRUE;



This archive was generated by hypermail 2b25 : Sun May 21 2000 - 03:26:16 CDT