bool DocIterator::inRegexped() const
{
- InsetMathHull * i = dynamic_cast<InsetMathHull *>(inset().asInsetMath());
- return i && i->getType() == hullRegexp;
+ InsetMath * im = inset().asInsetMath();
+ if (!im)
+ return false;
+ InsetMathHull * hull = im->asHullInset();
+ return hull && hull->getType() == hullRegexp;
}
LASSERT(inTexted(), /**/);
// if we are in a tabular, we need the cell
if (inset().lyxCode() == TABULAR_CODE) {
- InsetTabular & tabular = static_cast<InsetTabular&>(inset());
- return tabular.cell(idx()).get();
+ InsetTabular * tabular = inset().asInsetTabular();
+ return tabular->cell(idx()).get();
}
return &inset();
}
}
+FontSpan DocIterator::locateWord(word_location const loc) const
+{
+ FontSpan f = FontSpan();
+
+ if (!top().text()->empty()) {
+ f.first = pos();
+ top().paragraph().locateWord(f.first, f.last, loc);
+ }
+ return f;
+}
+
+
CursorSlice const & DocIterator::innerTextSlice() const
{
LASSERT(!empty(), /**/);