* src/CutAndPaste.C

(copySelectionToStack): whitespace
	(copySelection): Avoid possibly expensive conversion if we are not
	debugging


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17295 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2007-02-21 21:17:39 +00:00
parent 4bbddb06e6
commit 21d1457c8d

View File

@ -609,9 +609,9 @@ void copySelectionToStack(LCursor & cur, CutStack & cutstack)
ParagraphList & pars = text->paragraphs();
pos_type pos = cur.selBegin().pos();
pit_type par = cur.selBegin().pit();
while (pos < pars[par].size()
&& pars[par].isLineSeparator(pos)
&& (par != cur.selEnd().pit() || pos < cur.selEnd().pos()))
while (pos < pars[par].size() &&
pars[par].isLineSeparator(pos) &&
(par != cur.selEnd().pit() || pos < cur.selEnd().pos()))
++pos;
copySelectionHelper(cur.buffer(), pars, par, cur.selEnd().pit(),
@ -651,8 +651,10 @@ void copySelection(LCursor & cur, docstring const & plaintext)
void saveSelection(LCursor & cur)
{
lyxerr[Debug::ACTION] << "cap::saveSelection: `"
<< to_utf8(cur.selectionAsString(true)) << "'." << endl;
if (lyxerr.debugging(Debug::ACTION))
lyxerr << "cap::saveSelection: `"
<< to_utf8(cur.selectionAsString(true)) << "'."
<< endl;
if (cur.selection())
copySelectionToStack(cur, selectionBuffer);