<< endl;
metrics_info_ = ViewMetricsInfo(pit1, pit2, y1, y2, singlepar, size);
+
+ if (lyxerr.debugging(Debug::WORKAREA)) {
+ coord_cache_.dump();
+ }
}
return posit->second;
}
+void
+CoordCache::dump() const {
+ lyxerr << "ParPosCache contains:" << std::endl;
+ for (ParPosCache::const_iterator i = getParPos().begin(); i != getParPos().end(); ++i) {
+ LyXText const * lt = (*i).first;
+ InnerParPosCache const & cache = (*i).second;
+ lyxerr << "LyXText:" << lt << std::endl;
+ for (InnerParPosCache::const_iterator j = cache.begin(); j != cache.end(); ++j) {
+ pit_type pit = (*j).first;
+ Paragraph const & par = lt->getPar(pit);
+ Point p = (*j).second;
+ lyxerr << "Paragraph " << pit << ": \"";
+ for (int k = 0; k < std::min(10, par.size()); ++k) {
+ lyxerr << lyx::to_utf8(docstring(1,par.getChar(k)));
+ }
+ lyxerr << "\" has point " << p.x_ << "," << p.y_ << std::endl;
+ }
+ }
+}
+
} // namespace lyx
* A global cache that allows us to come from a paragraph in a document
* to a position point on the screen.
* All points cached in this cache are only valid between subsequent
- * updated. (x,y) == (0,0) is the upper left screen corner, x increases
+ * updates. (x,y) == (0,0) is the upper left screen corner, x increases
* to the right, y increases downwords.
* The cache is built in BufferView::updateMetrics which is called
* from BufferView::Pimpl::update. The individual points are added
return boundary ? slices1_ : slices0_;
}
+ /// Dump the contents of the cache to lyxerr in debugging form
+ void dump() const;
private:
/// MathArrays
CoordCacheBase<MathArray> arrays_;