From 6ac15c5bb9eb7c692918c9bf753b283b8b573910 Mon Sep 17 00:00:00 2001 From: Asger Ottar Alstrup Date: Sat, 21 Oct 2006 10:56:36 +0000 Subject: [PATCH] - Dump the inset position cache as well - More debugging printing stuff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15441 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.C | 2 ++ src/coordcache.C | 7 +++++++ src/coordcache.h | 3 +++ src/frontends/LyXView.C | 1 + src/frontends/WorkArea.C | 2 +- src/insets/insettext.C | 2 +- src/text2.C | 3 +++ 7 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/BufferView.C b/src/BufferView.C index 401f7c11e2..a448a86534 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -368,6 +368,8 @@ bool BufferView::update(Update::flags flags) if (!buffer_) return false; + lyxerr[Debug::WORKAREA] << "BufferView::update" << std::endl; + // Update macro store buffer_->buildMacros(); diff --git a/src/coordcache.C b/src/coordcache.C index 8f4e717b3e..cd652063d5 100644 --- a/src/coordcache.C +++ b/src/coordcache.C @@ -76,6 +76,13 @@ CoordCache::dump() const { lyxerr << "\" has point " << p.x_ << "," << p.y_ << std::endl; } } + + lyxerr << "InsetCache contains:" << std::endl; + for (CoordCacheBase::cache_type::const_iterator i = getInsets().getData().begin(); i != getInsets().getData().end(); ++i) { + InsetBase const * inset = (*i).first; + Point p = (*i).second; + lyxerr << "Inset " << inset << "(" << inset->getInsetName() << ") has point " << p.x_ << "," << p.y_ << std::endl; + } } } // namespace lyx diff --git a/src/coordcache.h b/src/coordcache.h index d5ac02f6eb..a14751f6f0 100644 --- a/src/coordcache.h +++ b/src/coordcache.h @@ -95,6 +95,9 @@ private: typedef std::map cache_type; cache_type data_; + +public: + cache_type const & getData() const { return data_; } }; /** diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C index 57893bce24..b27c02c2ec 100644 --- a/src/frontends/LyXView.C +++ b/src/frontends/LyXView.C @@ -96,6 +96,7 @@ void LyXView::setWorkArea(WorkArea * work_area) void LyXView::redrawWorkArea() { + lyxerr[Debug::WORKAREA] << "redrawWorkArea" << std::endl; work_area_->redraw(); updateStatusBar(); } diff --git a/src/frontends/WorkArea.C b/src/frontends/WorkArea.C index b34eaa969e..222fe48a7b 100644 --- a/src/frontends/WorkArea.C +++ b/src/frontends/WorkArea.C @@ -216,7 +216,7 @@ void WorkArea::redraw() greyed_out_ = false; getPainter().start(); paintText(*buffer_view_, vi, getPainter()); - lyxerr[Debug::DEBUG] << "Redraw screen" << endl; + lyxerr[Debug::WORKAREA] << "WorkArea::redraw screen" << endl; int const ymin = std::max(vi.y1, 0); int const ymax = ( vi.p2 < vi.size - 1 ? vi.y2 : height() ); diff --git a/src/insets/insettext.C b/src/insets/insettext.C index c6d2b0ca72..f84cf778a7 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -247,7 +247,7 @@ InsetBase * InsetText::editXY(LCursor & cur, int x, int y) void InsetText::doDispatch(LCursor & cur, FuncRequest & cmd) { - lyxerr[Debug::DEBUG] << BOOST_CURRENT_FUNCTION + lyxerr[Debug::ACTION] << BOOST_CURRENT_FUNCTION << " [ cmd.action = " << cmd.action << ']' << endl; setViewCache(&cur.bv()); diff --git a/src/text2.C b/src/text2.C index d88edd4af9..afc507d470 100644 --- a/src/text2.C +++ b/src/text2.C @@ -958,6 +958,9 @@ Row const & LyXText::getRowNearY(int y, pit_type pit) const // sets cursor recursively descending into nested editable insets InsetBase * LyXText::editXY(LCursor & cur, int x, int y) { + if (lyxerr.debugging(Debug::WORKAREA)) { + bv()->coordCache().dump(); + } pit_type pit = getPitNearY(y); BOOST_ASSERT(pit != -1); Row const & row = getRowNearY(y, pit); -- 2.39.2