}
-void BufferView::unsetXSel()
-{
- xsel_cache_.set = false;
-}
-
-
Buffer * BufferView::buffer() const
{
return buffer_;
}
-bool BufferView::available() const
-{
- return buffer_;
-}
-
-
Change const BufferView::getCurrentChange()
{
if (!buffer_->params().tracking_changes || !cursor_.selection())
}
-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 ||
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();
// 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))