Wrong attachment. Try again. - Martin
Index: BufferView_pimpl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.581 diff -u -p -r1.581 BufferView_pimpl.C --- BufferView_pimpl.C 20 Apr 2005 17:35:46 -0000 1.581 +++ BufferView_pimpl.C 6 May 2005 12:19:45 -0000 @@ -618,9 +618,8 @@ void BufferView::Pimpl::update(bool fitc // Update macro store buffer_->buildMacros(); // First drawing step - - CoordCache backup; - std::swap(theCoords, backup); + // We _copy_ the coordinate cache to allow re-entrancy + CoordCache backup(theCoords); theCoords.startUpdating(); ViewMetricsInfo vi = metrics(); Index: coordcache.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/coordcache.C,v retrieving revision 1.7 diff -u -p -r1.7 coordcache.C --- coordcache.C 26 Apr 2005 10:30:21 -0000 1.7 +++ coordcache.C 6 May 2005 12:19:45 -0000 @@ -40,14 +40,13 @@ void CoordCache::clear() } void CoordCache::startUpdating() { - BOOST_ASSERT(!updating); - updating = true; + updating++; } void CoordCache::doneUpdating() { BOOST_ASSERT(updating); - updating = false; + updating--; } Point CoordCache::get(LyXText const * text, lyx::pit_type pit) Index: coordcache.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/coordcache.h,v retrieving revision 1.9 diff -u -p -r1.9 coordcache.h --- coordcache.h 26 Apr 2005 11:12:09 -0000 1.9 +++ coordcache.h 6 May 2005 12:19:45 -0000 @@ -141,10 +141,11 @@ private: ParPosCache pars_; /** - * Debugging flag only: Set to true while the cache is being built. + * Debugging counter only: nonzero while the cache is being built. + * Counter, not bool, to allow re-entrant BufferView::update. * No changes to the structure are allowed unless we are updating. */ - bool updating; + int updating; }; extern CoordCache theCoords;
signature.asc
Description: This is a digitally signed message part