mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
remove Inset::update()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7298 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
cf31c9b219
commit
e62ce55f8c
@ -162,9 +162,6 @@ public:
|
||||
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;
|
||||
///
|
||||
|
@ -289,23 +289,6 @@ int InsetCollapsable::docbook(Buffer const * buf, ostream & os, bool mixcont) co
|
||||
}
|
||||
|
||||
|
||||
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: "
|
||||
|
@ -51,8 +51,6 @@ public:
|
||||
/// 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);
|
||||
|
@ -453,7 +453,6 @@ Inset::RESULT InsetERT::localDispatch(FuncRequest const & cmd)
|
||||
* taken by the text).
|
||||
*/
|
||||
inset.getLyXText(cmd.view())->fullRebreak();
|
||||
inset.update(cmd.view(), true);
|
||||
bv->updateInset(this);
|
||||
result = DISPATCHED;
|
||||
}
|
||||
@ -550,6 +549,7 @@ bool InsetERT::checkInsertChar(LyXFont & /* font */)
|
||||
|
||||
void InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
{
|
||||
setButtonLabel();
|
||||
if (inlined())
|
||||
inset.metrics(mi, dim);
|
||||
else
|
||||
@ -662,17 +662,6 @@ int InsetERT::getMaxWidth(BufferView * bv, UpdatableInset const * in) const
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
|
@ -114,8 +114,6 @@ public:
|
||||
}
|
||||
///
|
||||
int getMaxWidth(BufferView *, UpdatableInset const *) const;
|
||||
///
|
||||
void update(BufferView *, bool =false);
|
||||
|
||||
private:
|
||||
///
|
||||
|
@ -119,7 +119,6 @@ dispatch_result InsetMinipage::localDispatch(FuncRequest const & cmd)
|
||||
/* 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;
|
||||
}
|
||||
|
@ -410,11 +410,6 @@ void InsetTabular::drawCellSelection(Painter & pain, int x, int y,
|
||||
}
|
||||
|
||||
|
||||
void InsetTabular::update(BufferView * bv, bool reinit)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
string const InsetTabular::editMessage() const
|
||||
{
|
||||
return _("Opened table");
|
||||
@ -1270,8 +1265,6 @@ bool InsetTabular::calculate_dimensions_of_cells(BufferView * bv, bool reinit) c
|
||||
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;
|
||||
|
@ -86,8 +86,6 @@ public:
|
||||
///
|
||||
void draw(PainterInfo & pi, int x, int y) const;
|
||||
///
|
||||
void update(BufferView *, bool = false);
|
||||
///
|
||||
string const editMessage() const;
|
||||
//
|
||||
void insetUnlock(BufferView *);
|
||||
|
@ -403,12 +403,6 @@ void InsetText::drawFrame(Painter & pain, int x) const
|
||||
}
|
||||
|
||||
|
||||
void InsetText::update(BufferView * bv, bool reinit)
|
||||
{
|
||||
setViewCache(bv);
|
||||
}
|
||||
|
||||
|
||||
void InsetText::setUpdateStatus(int what) const
|
||||
{
|
||||
need_update |= what;
|
||||
|
@ -92,8 +92,6 @@ public:
|
||||
///
|
||||
void draw(PainterInfo & pi, int x, int y) const;
|
||||
///
|
||||
void update(BufferView *, bool = false);
|
||||
///
|
||||
void setUpdateStatus(int what) const;
|
||||
///
|
||||
string const editMessage() const;
|
||||
|
31
src/text.C
31
src/text.C
@ -35,6 +35,7 @@
|
||||
#include "paragraph_funcs.h"
|
||||
#include "rowpainter.h"
|
||||
#include "lyxrow_funcs.h"
|
||||
#include "metricsinfo.h"
|
||||
|
||||
#include "insets/insettext.h"
|
||||
|
||||
@ -319,9 +320,15 @@ int LyXText::singleWidth(ParagraphList::iterator pit,
|
||||
// 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;
|
||||
}
|
||||
@ -1079,13 +1086,21 @@ void LyXText::setHeightOfRow(RowList::iterator rit)
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user