]> git.lyx.org Git - features.git/commitdiff
Bug fix: correctly redraw a Row containing and inset which Dimension slightly changed...
authorAbdelrazak Younes <younes@lyx.org>
Mon, 27 Aug 2007 16:30:57 +0000 (16:30 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 27 Aug 2007 16:30:57 +0000 (16:30 +0000)
* 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
src/insets/Inset.h

index 716e1fd77ba30cc4821b6fca09fe1fedc9c89a18..3a529020785624bf4a015800749383a08b843a05 100644 (file)
@@ -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();
index 25c343850d68f307bbfe51445a5e956f53bbf3be..850b1b1dc16d7ecfbc6c18e424a427d6e95a9881 100644 (file)
@@ -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.