+2005-05-07 André Pönitz <poenitz@gmx.net>
+
+ * cursor.C (setSelection): open insets when selection is set there
+ to avoid crashs with cold coord cache
+
2005-05-07 André Pönitz <poenitz@gmx.net>
* trans_mgr.C (insert): move cursor to the right after inserting
void LCursor::setSelection()
{
selection() = true;
- // a selection with no contents is not a selection
+ // A selection with no contents is not a selection
#ifdef WITH_WARNINGS
#warning doesnt look ok
#endif
selection() = true;
anchor_ = where;
pos() += n;
+ // Open all collapsed insets
+ for (int i = depth() - 1; i >= 0; --i)
+ operator[](i).inset().setStatus(*this, InsetBase::Open);
}
/// used to toggle insets
/// is the inset open?
virtual bool isOpen() const { return false; }
- /// open the inset
- virtual void open() {}
- /// close the inset
- virtual void close() {}
/// should this inset be handled like a normal charater
virtual bool isChar() const { return false; }
/// is this equivalent to a letter?
virtual int ascent() const { return 10; }
/// pretty arbitrary
virtual int descent() const { return 10; }
+ ///
+ enum CollapseStatus {
+ Collapsed,
+ Inlined,
+ Open
+ };
+ ///
+ virtual void setStatus(LCursor &, CollapseStatus) {}
protected:
InsetBase();
InsetBase(InsetBase const &);
//lyxerr << "InsetCollapsable: edit left/right" << endl;
cur.push(*this);
InsetText::edit(cur, left);
- open();
}
///
static int const TEXT_TO_BOTTOM_OFFSET = 2;
///
- enum CollapseStatus {
- Collapsed,
- Inlined,
- Open
- };
- ///
InsetCollapsable(BufferParams const &, CollapseStatus status = Open);
///
void read(Buffer const &, LyXLex &);
bool allowSpellCheck() const { return true; }
///
bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
-
-protected:
///
void setStatus(LCursor & cur, CollapseStatus st);
+
+protected:
+
///
virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
///
default: {
view()->cursor().dispatch(cmd);
update |= view()->cursor().result().update();
- if (!view()->cursor().result().dispatched()) {
+ if (!view()->cursor().result().dispatched())
update |= view()->dispatch(cmd);
- }
-
break;
}
}
if (!grid.cell(grid.index(row, col)).empty())
return;
}
- grid.delRow(row + 1);
+ grid.delRow(row);
}