}
-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())