]> git.lyx.org Git - lyx.git/blobdiff - src/cursor.C
layout file converter for layout files in old format
[lyx.git] / src / cursor.C
index 5440d88c8d8a0e3c46193c9f1fbcb331f76cec3e..ff206f532005623129edbbec1758a2ea7194a9f7 100644 (file)
@@ -94,7 +94,7 @@ namespace {
                it.top().pos() = 0;
                DocIterator et = c;
                et.top().pos() = et.top().asMathInset()->cell(et.top().idx()).size();
-               for (int i = 0; ; ++i) {
+               for (size_t i = 0; ; ++i) {
                        int xo;
                        int yo;
                        it.inset().cursorPos(it.top(), c.boundary() && ((i+1) == it.depth()), xo, yo);
@@ -170,7 +170,7 @@ namespace {
 
 // FIXME: bit more work needed to get 'from' and 'to' right.
                pit_type from = cur.bottom().pit();
-               pit_type to = cur.bottom().pit();
+               //pit_type to = cur.bottom().pit();
                //lyxerr << "Pit start: " << from << endl;
 
                //lyxerr << "bruteFind3: x: " << x << " y: " << y
@@ -376,7 +376,8 @@ void LCursor::getPos(int & x, int & y) const
 
 void LCursor::paste(string const & data)
 {
-       dispatch(FuncRequest(LFUN_PASTE, data));
+       if (!data.empty())
+               dispatch(FuncRequest(LFUN_PASTE, data));
 }
 
 
@@ -467,9 +468,6 @@ void LCursor::setSelection(DocIterator const & where, size_t n)
        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);
 }
 
 
@@ -784,7 +782,7 @@ bool LCursor::erase()
        }
 
        // 'clever' UI hack: only erase large items if previously slected
-       if (pos() != lastpos() && inset().nargs() > 0) {
+       if (pos() != lastpos() && nextAtom()->nargs() > 0) {
                resetAnchor();
                selection() = true;
                ++pos();
@@ -1128,9 +1126,9 @@ string LCursor::selectionAsString(bool label) const
                return result;
        }
 
-#ifdef WITH_WARNINGS
-#warning and mathed?
-#endif
+       if (inMathed())
+               return lyx::cap::grabSelection(*this);
+
        return string();
 }