]> git.lyx.org Git - lyx.git/blobdiff - src/cursor.C
Partial fix bug 2092: branches not propagated to child documents
[lyx.git] / src / cursor.C
index 9af38d2fe61ea7d4d4ebe549a6d5ae3e349f7dcf..ff206f532005623129edbbec1758a2ea7194a9f7 100644 (file)
@@ -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();
 }