}
-string const LyXText::selectionAsString(Buffer const * buffer) const
+string const LyXText::selectionAsString(Buffer const * buffer,
+ bool label) const
{
if (!selection.set()) return string();
string result;
if (selection.start.par() == selection.end.par()) {
result += selection.start.par()->asString(buffer,
selection.start.pos(),
- selection.end.pos());
+ selection.end.pos(),
+ label);
return result;
}
// First paragraph in selection
result += selection.start.par()->asString(buffer,
selection.start.pos(),
- selection.start.par()->size())
+ selection.start.par()->size(),
+ label)
+ "\n\n";
// The paragraphs in between (if any)
tmpcur.par(tmpcur.par()->next());
while (tmpcur.par() != selection.end.par()) {
result += tmpcur.par()->asString(buffer, 0,
- tmpcur.par()->size()) +"\n\n";
+ tmpcur.par()->size(),
+ label) + "\n\n";
tmpcur.par(tmpcur.par()->next());
}
// Last paragraph in selection
result += selection.end.par()->asString(buffer, 0,
- selection.end.pos());
+ selection.end.pos(), label);
return result;
}
return string();
}
- idxstring = selectionAsString(bview->buffer());
+ idxstring = selectionAsString(bview->buffer(), false);
// Implicit selections are cleared afterwards
//and cursor is set to the original position.
// finished. The solution used currently just works, to make it
// faster we need to be more clever and probably also have more
// calls to stuffClipboard. (Lgb)
- bview->stuffClipboard(selectionAsString(bview->buffer()));
+ bview->stuffClipboard(selectionAsString(bview->buffer(), true));
// This doesn't make sense, if there is no selection
if (!selection.set())
// finished. The solution used currently just works, to make it
// faster we need to be more clever and probably also have more
// calls to stuffClipboard. (Lgb)
- bview->stuffClipboard(selectionAsString(bview->buffer()));
+ bview->stuffClipboard(selectionAsString(bview->buffer(), true));
// this doesnt make sense, if there is no selection
if (!selection.set())
Paragraph * endpar;
Paragraph * actpar = cursor.par();
-
int pos = cursor.pos();
+
CutAndPaste::pasteSelection(&actpar, &endpar, pos,
bview->buffer()->params.textclass);
setCursor(bview, cursor.par(), cursor.pos());
clearSelection();
- selection.cursor = cursor;
setCursor(bview, actpar, pos);
- setSelection(bview);
updateCounters(bview, cursor.row());
}
// and open and lock the inset (bla bla bla)
// stuff I don't know... so can you have a look?
// (Lgb)
- // I moved the lyxerr stuff in here so we can see if this
- // is actually really needed and where!
+ // I moved the lyxerr stuff in here so we can see if
+ // this is actually really needed and where!
// (Jug)
it->getLyXText(bview)->setCursorIntern(bview, par, pos, setfont,
boundary);