]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.C
cleanup after svn hang-up, #undef CursorShape. Should be compilable ganin now.
[lyx.git] / src / BufferView.C
index 2cde9ab9f09631f2a8ff34577917fa535bd1baea..86d8c8e761bf3df6fa100afb5abf53fc9d26ea04 100644 (file)
@@ -157,12 +157,6 @@ BufferView::~BufferView()
 }
 
 
-void BufferView::unsetXSel()
-{
-       xsel_cache_.set = false;
-}
-
-
 Buffer * BufferView::buffer() const
 {
        return buffer_;
@@ -517,12 +511,6 @@ void BufferView::setCursorFromScrollbar()
 }
 
 
-bool BufferView::available() const
-{
-       return buffer_;
-}
-
-
 Change const BufferView::getCurrentChange()
 {
        if (!buffer_->params().tracking_changes || !cursor_.selection())
@@ -1020,18 +1008,16 @@ bool BufferView::dispatch(FuncRequest const & cmd)
 }
 
 
-void BufferView::selectionRequested()
+docstring const BufferView::requestSelection()
 {
-       static docstring sel;
-
        if (!buffer_)
-               return;
+               return docstring();
 
        LCursor & cur = cursor_;
 
        if (!cur.selection()) {
                xsel_cache_.set = false;
-               return;
+               return docstring();
        }
 
        if (!xsel_cache_.set ||
@@ -1041,14 +1027,13 @@ void BufferView::selectionRequested()
                xsel_cache_.cursor = cur.top();
                xsel_cache_.anchor = cur.anchor_.top();
                xsel_cache_.set = cur.selection();
-               sel = cur.selectionAsString(false);
-               if (!sel.empty())
-                       owner_->gui().selection().put(sel);
+               return cur.selectionAsString(false);
        }
+       return docstring();
 }
 
 
-void BufferView::selectionLost()
+void BufferView::clearSelection()
 {
        if (buffer_) {
                cursor_.clearSelection();
@@ -1399,7 +1384,7 @@ void BufferView::menuInsertLyXFile(string const & filenm)
                // Launch a file browser
                string initpath = lyxrc.document_path;
 
-               if (available()) {
+               if (buffer_) {
                        string const trypath = buffer_->filePath();
                        // If directory is writeable, use this as default.
                        if (isDirWriteable(trypath))