From 21d1457c8d6acc090a31709ab6645bb6580b7128 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Wed, 21 Feb 2007 21:17:39 +0000 Subject: [PATCH] * 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 --- src/CutAndPaste.C | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index daed0e234f..1557a98b9e 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -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); -- 2.39.2