From b52c339cceb3d939a26adf106bab72c835d66a17 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Mon, 27 Aug 2007 16:30:57 +0000 Subject: [PATCH] Bug fix: correctly redraw a Row containing and inset which Dimension slightly changed. This replace the need for the former leftEdgeFixed boolean in rowpainter.C:paintPar() before the removal of the wide() hack in revision 19834. * Inset::dimension(): access to dim_ * TextMetrics::redoParagraph(): don't trust Inset::metrics() returned boolean as the internal dimension is changed down in the inheritance chain for InsetFoot->InsetCollapsable->InsetText. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19838 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/TextMetrics.cpp | 4 +++- src/insets/Inset.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 716e1fd77b..3a52902078 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -221,13 +221,15 @@ bool TextMetrics::redoParagraph(pit_type const pit) InsetList::const_iterator ii = par.insetlist.begin(); InsetList::const_iterator iend = par.insetlist.end(); for (; ii != iend; ++ii) { + Dimension old_dim = ii->inset->dimension(); Dimension dim; int const w = max_width_ - text_->leftMargin(buffer, max_width_, pit, ii->pos) - right_margin; Font const & font = ii->inset->noFontChange() ? bufferfont : text_->getFont(buffer, par, ii->pos); MetricsInfo mi(bv_, font, w); - changed |= ii->inset->metrics(mi, dim); + ii->inset->metrics(mi, dim); + changed |= (old_dim != dim); } par.setBeginOfBody(); diff --git a/src/insets/Inset.h b/src/insets/Inset.h index 25c343850d..850b1b1dc1 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -474,6 +474,8 @@ public: /// reject the changes within the inset virtual void rejectChanges(BufferParams const &) {}; + /// FIXME: move dim_ out of Inset! + Dimension const & dimension() { return dim_; } /// inset width. int width() const { return dim_.wid; } /// inset ascent.