]> git.lyx.org Git - features.git/commitdiff
* src/CutAndPaste.C
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Wed, 21 Feb 2007 21:17:39 +0000 (21:17 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Wed, 21 Feb 2007 21:17:39 +0000 (21:17 +0000)
(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

index daed0e234f60f3c502979fde3e38e1cf03189440..1557a98b9e2f6ab439b7a3518a8f37b000d58594 100644 (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);