Bug fix: correctly redraw a Row containing and inset which Dimension slightly changed. This replace the need for leftEdgeFixed boolean in rowpainter.C:paintPar() which can be removed now.

* Inset::dimension(): access to dim_

* TextMetrics?::redoParagraph(): checking Inset::metrics() returned boolean is not enough 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/branches/BRANCH_1_5_X@20221 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-09-11 20:37:03 +00:00
parent b01b6a3023
commit 5f24e6cc63
2 changed files with 4 additions and 0 deletions

View File

@ -216,6 +216,7 @@ 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;
@ -223,6 +224,7 @@ bool TextMetrics::redoParagraph(pit_type const pit)
bufferfont : text_->getFont(buffer, par, ii->pos);
MetricsInfo mi(bv_, font, w);
changed |= ii->inset->metrics(mi, dim);
changed |= (old_dim != dim);
}
// rebreak the paragraph

View File

@ -461,6 +461,8 @@ public:
/// reject the changes within the inset
virtual void rejectChanges(BufferParams const &) {};
/// inset dimension.
Dimension const & dimension() const { return dim_; }
/// inset width.
int width() const { return dim_.wid; }
/// inset ascent.