int descent(BufferView *, LyXFont const &) const;
///
int width(BufferView *, LyXFont const &) const;
- /// update the inset representation
- virtual void update(BufferView *, bool = false)
- {}
/// what appears in the minibuffer when opening
virtual string const editMessage() const;
///
}
-void InsetCollapsable::update(BufferView * bv, bool reinit)
-{
- if (in_update) {
- if (reinit && owner()) {
- owner()->update(bv, true);
- }
- return;
- }
- in_update = true;
- inset.update(bv, reinit);
- if (reinit && owner()) {
- owner()->update(bv, true);
- }
- in_update = false;
-}
-
-
Inset::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd)
{
lyxerr << "InsetCollapsable::localDispatch: "
/// draw, either inlined (no button) or collapsed/open
void draw(PainterInfo & pi, int x, int y, bool inlined) const;
///
- void update(BufferView *, bool = false);
- ///
EDITABLE editable() const;
///
bool insertInset(BufferView *, Inset * inset);
* taken by the text).
*/
inset.getLyXText(cmd.view())->fullRebreak();
- inset.update(cmd.view(), true);
bv->updateInset(this);
result = DISPATCHED;
}
void InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const
{
+ setButtonLabel();
if (inlined())
inset.metrics(mi, dim);
else
}
-void InsetERT::update(BufferView * bv, bool reinit)
-{
- if (inset.need_update & InsetText::INIT ||
- inset.need_update & InsetText::FULL) {
- setButtonLabel();
- }
-
- InsetCollapsable::update(bv, reinit);
-}
-
-
string const InsetERTMailer::name_("ert");
InsetERTMailer::InsetERTMailer(InsetERT & inset)
}
///
int getMaxWidth(BufferView *, UpdatableInset const *) const;
- ///
- void update(BufferView *, bool =false);
private:
///
/* FIXME: I refuse to believe we have to live
* with ugliness like this ... */
inset.getLyXText(cmd.view())->fullRebreak();
- inset.update(cmd.view(), true);
cmd.view()->updateInset(this);
return DISPATCHED;
}
}
-void InsetTabular::update(BufferView * bv, bool reinit)
-{
-}
-
-
string const InsetTabular::editMessage() const
{
return _("Opened table");
continue;
++cell;
inset = tabular.getCellInset(cell);
- if (!reinit && !tabular.getPWidth(cell).zero())
- inset->update(bv, false);
maxAsc = max(maxAsc, inset->ascent(bv, font));
maxDesc = max(maxDesc, inset->descent(bv, font));
changed = tabular.setWidthOfCell(cell, inset->width(bv, font)) || changed;
///
void draw(PainterInfo & pi, int x, int y) const;
///
- void update(BufferView *, bool = false);
- ///
string const editMessage() const;
//
void insetUnlock(BufferView *);
}
-void InsetText::update(BufferView * bv, bool reinit)
-{
- setViewCache(bv);
-}
-
-
void InsetText::setUpdateStatus(int what) const
{
need_update |= what;
///
void draw(PainterInfo & pi, int x, int y) const;
///
- void update(BufferView *, bool = false);
- ///
void setUpdateStatus(int what) const;
///
string const editMessage() const;
#include "paragraph_funcs.h"
#include "rowpainter.h"
#include "lyxrow_funcs.h"
+#include "metricsinfo.h"
#include "insets/insettext.h"
// this IS needed otherwise on initialitation we don't get the fill
// of the row right (ONLY on initialization if we read a file!)
// should be changed! (Jug 20011204)
- tmpinset->update(bv());
+ //tmpinset->update(bv());
+ Dimension dim;
+ MetricsInfo mi;
+ mi.base.bv = bv();
+ mi.base.font = font;
+ tmpinset->metrics(mi, dim);
#endif
- return tmpinset->width(bv(), font);
+ //return tmpinset->width(bv(), font);
+ return dim.wid;
}
return 0;
}
if (tmpinset) {
#if 1 // this is needed for deep update on initialitation
#warning inset->update FIXME
- tmpinset->update(bv());
+ //tmpinset->update(bv());
+ Dimension dim;
+ MetricsInfo mi;
+ mi.base.bv = bv();
+ mi.base.font = tmpfont;
+ tmpinset->metrics(mi, dim);
#endif
- maxwidth += tmpinset->width(bv(), tmpfont);
- maxasc = max(maxasc,
- tmpinset->ascent(bv(), tmpfont));
- maxdesc = max(maxdesc,
- tmpinset->descent(bv(), tmpfont));
+ //maxwidth += tmpinset->width(bv(), tmpfont);
+ //maxasc = max(maxasc,
+ // tmpinset->ascent(bv(), tmpfont));
+ //maxdesc = max(maxdesc,
+ // tmpinset->descent(bv(), tmpfont));
+ maxwidth += dim.wid;
+ maxasc = max(maxasc, dim.asc);
+ maxdesc = max(maxdesc, dim.des);
}
} else {
maxwidth += singleWidth(pit, pos);