I think this should go in branch as well Jurgen.
Abdel.
[EMAIL PROTECTED] wrote:
Author: younes
Date: Mon Aug 27 18:30:57 2007
New Revision: 19838
URL: http://www.lyx.org/trac/changeset/19838
Log:
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.
Modified:
lyx-devel/trunk/src/TextMetrics.cpp
lyx-devel/trunk/src/insets/Inset.h
Modified: lyx-devel/trunk/src/TextMetrics.cpp
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/TextMetrics.cpp?rev=19838
==============================================================================
--- lyx-devel/trunk/src/TextMetrics.cpp (original)
+++ lyx-devel/trunk/src/TextMetrics.cpp Mon Aug 27 18:30:57 2007
@@ -221,13 +221,15 @@
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();
Modified: lyx-devel/trunk/src/insets/Inset.h
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/Inset.h?rev=19838
==============================================================================
--- lyx-devel/trunk/src/insets/Inset.h (original)
+++ lyx-devel/trunk/src/insets/Inset.h Mon Aug 27 18:30:57 2007
@@ -474,6 +474,8 @@
/// 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.