.connect(slot(this, &BufferView::Pimpl::tripleClick));
workarea_.workAreaKeyPress
.connect(slot(this, &BufferView::Pimpl::workAreaKeyPress));
+ workarea_.selectionRequested
+ .connect(slot(this, &BufferView::Pimpl::selectionRequested));
cursor_timeout.timeout.connect(slot(this,
&BufferView::Pimpl::cursorToggle));
}
+void BufferView::Pimpl::selectionRequested()
+{
+ string const sel(bv_->getLyXText()->selectionAsString(bv_->buffer(), false));
+ if (!sel.empty()) {
+ workarea_.putClipboard(sel);
+ }
+}
+
+
void BufferView::Pimpl::enterView()
{
if (active() && available()) {
if (button == 2)
return;
+ // finish selection
+ if (button == 1) {
+ workarea_.haveSelection(bv_->getLyXText()->selection.set());
+ }
+
setState();
owner_->showState();
owner_->updateMenubar();
string initpath = lyxrc.document_path;
if (available()) {
- string const trypath = owner_->buffer()->filepath;
+ string const trypath = owner_->buffer()->filePath();
// If directory is writeable, use this as default.
if (IsDirWriteable(trypath))
initpath = trypath;