+ if (w < 0) {
+ return -1;
+ }
+ // check for margins left/right and extra right margin "const 5"
+ if ((w - ((2 * TEXT_TO_INSET_OFFSET) + 5)) >= 0)
+ w -= (2 * TEXT_TO_INSET_OFFSET) + 5;
+ if (topx_set && owner()) {
+ w -= top_x;
+ w += owner()->x();
+ } else if (owner()) {
+ // this is needed as otherwise we might have a too large inset if
+ // its top_x afterwards changes to LeftMargin so we try to put at
+ // least the default margin as top_x
+ w -= 20;
+ }
+ if (w < 10) {
+ w = 10;
+ }
+ return w;
+}
+
+
+LyXCursor const & Inset::cursor(BufferView * bv) const
+{
+ if (owner())
+ return owner()->getLyXText(bv, false)->cursor;
+ return bv->text->cursor;
+}
+
+
+string const UpdatableInset::selectNextWordToSpellcheck(BufferView *bv,
+ float & value) const
+{
+ // we have to unlock ourself in this function by default!
+ bv->unlockInset(const_cast<UpdatableInset *>(this));
+ value = 0;
+ return string();
+}
+
+
+bool UpdatableInset::searchForward(BufferView * bv, string const &,
+ bool, bool)
+{
+ // we have to unlock ourself in this function by default!
+ bv->unlockInset(const_cast<UpdatableInset *>(this));
+ return false;