]> git.lyx.org Git - lyx.git/commitdiff
Extracted from r14281
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 8 Jul 2006 20:40:04 +0000 (20:40 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 8 Jul 2006 20:40:04 +0000 (20:40 +0000)
* CoordCache:
  - startUpdating(), doneUpdating(): deleted because the screen drawing
    is now done at one place (WorkArea::redraw()) and cannot be called
    for within itself. Those debug methods are then not useful.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14382 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/coordcache.C
src/coordcache.h

index 2fb94a60adc337e9922aa72e4f4864be90b662bb..c1643596948068475fed639d6edb55bb96b21ae7 100644 (file)
@@ -699,11 +699,6 @@ void BufferView::Pimpl::update(Update::flags flags)
                        << "]  buffer: " << buffer_ << endl;
        }
 
-       // This, together with doneUpdating(), verifies (using
-       // asserts) that screen redraw is not called from
-       // within itself.
-       theCoords.startUpdating();
-
        // Check needed to survive LyX startup
        if (buffer_) {
                // Update macro store
@@ -727,10 +722,6 @@ void BufferView::Pimpl::update(Update::flags flags)
 
        owner_->redrawWorkArea();
        owner_->view_state_changed();
-
-       // Abort updating of the coord
-       // cache - just restore the old one
-       theCoords.doneUpdating();
 }
 
 
index 956ed41a9a98a11e21b90c1a3f33b88cf6b39a27..51920e25c71ad81c4a479c7091851581662aaa46 100644 (file)
@@ -33,7 +33,6 @@ void lyxbreaker(void const * data, const char * hint, int size)
 
 void CoordCache::clear()
 {
-       BOOST_ASSERT(updating);
        arrays_.clear();
        insets_.clear();
        pars_.clear();
@@ -42,20 +41,6 @@ void CoordCache::clear()
 }
 
 
-void CoordCache::startUpdating()
-{
-       BOOST_ASSERT(!updating);
-       updating = true;
-}
-
-
-void CoordCache::doneUpdating()
-{
-       BOOST_ASSERT(updating);
-       updating = false;
-}
-
-
 Point CoordCache::get(LyXText const * text, lyx::pit_type pit)
 {
        ParPosCache::iterator const it = pars_.find(text);
index 9effe582390f016d838edb78856930f64246a012..535a712716335793da79335c2392b64481edeaa5 100644 (file)
@@ -108,12 +108,6 @@ private:
  */
 class CoordCache {
 public:
-       CoordCache() : updating(false) { }
-       /// In order to find bugs, we record when we start updating the cache
-       void startUpdating();
-       /// When we are done, we record that to help find bugs
-       void doneUpdating();
-
        void clear();
        Point get(LyXText const *, lyx::pit_type);
 
@@ -125,18 +119,17 @@ public:
        typedef std::map<LyXText const *, InnerParPosCache> SliceCache;
 
        /// A map from MathArray to position on the screen
-       CoordCacheBase<MathArray> & arrays() { BOOST_ASSERT(updating); return arrays_; }
+       CoordCacheBase<MathArray> & arrays() { return arrays_; }
        CoordCacheBase<MathArray> const & getArrays() const { return arrays_; }
        /// A map from insets to positions on the screen
-       CoordCacheBase<InsetBase> & insets() { BOOST_ASSERT(updating); return insets_; }
+       CoordCacheBase<InsetBase> & insets() { return insets_; }
        CoordCacheBase<InsetBase> const & getInsets() const { return insets_; }
        /// A map from (LyXText, paragraph) pair to screen positions
-       ParPosCache & parPos() { BOOST_ASSERT(updating); return pars_; }
+       ParPosCache & parPos() { return pars_; }
        ParPosCache const & getParPos() const { return pars_; }
        ///
        SliceCache & slice(bool boundary)
        {
-               BOOST_ASSERT(updating);
                return boundary ? slices1_ : slices0_;
        }
        SliceCache const & getSlice(bool boundary) const
@@ -155,12 +148,6 @@ private:
        SliceCache slices0_;
        /// Used with boundary == 1
        SliceCache slices1_;
-
-       /**
-        * Debugging flag only: Set to true while the cache is being built.
-        * No changes to the structure are allowed unless we are updating.
-        */
-       bool updating;
 };
 
 extern CoordCache theCoords;