/// does this contain text that can be change track marked in DVI?
virtual bool canTrackChanges() const { return false; }
/// is this inset based on the TextInset class?
- virtual InsetText * asTextInset() const { return 0; }
+ virtual InsetText const * asTextInset() const { return 0; }
/// return true if the inset should be removed automatically
virtual bool autoDelete() const;
///
bool canTrackChanges() const { return true; }
///
- InsetText * asTextInset() const { return const_cast<InsetText *>(this); }
+ InsetText const * asTextInset() const { return this; }
///
int latex(Buffer const &, std::ostream &,
OutputParams const &) const;
pi.ltr_pos = (text_.bidi.level(pos) % 2 == 0);
pi.erased_ = erased_ || isDeletedText(par_, pos);
theCoords.insets().add(inset, int(x_), yo_);
- InsetBase * in = const_cast<InsetBase *>(inset);
+ InsetText const * const in = inset->asTextInset();
// non-wide insets are painted completely. Recursive
bool tmp = bv_.repaintAll();
- if (!in->asTextInset() || !static_cast<InsetText*>(in)->Wide()) {
+ if (!in || !in->Wide()) {
bv_.repaintAll(true);
lyxerr[Debug::PAINTING] << endl << "Paint inset fully" << endl;
}
// If this is the only object on the row, we can make it wide
for (pos_type i = rit->pos() ; i != rit->endpos(); ++i) {
- InsetBase* in
- = const_cast<InsetBase*>(par.getInset(i));
- if (in && in->asTextInset()) {
- static_cast<InsetText*>(in)->Wide()
- = in_inset_alone_on_row &&
- static_cast<InsetText*>(in)->Tall();
+ InsetBase const * const in = par.getInset(i);
+ if (in) {
+ InsetText const * const t = in->asTextInset();
+ if (t)
+ t->Wide() = in_inset_alone_on_row &&
+ t->Tall();
}
}