]> git.lyx.org Git - lyx.git/commitdiff
Do not omit the starting space when copying (#9995)
authorGuillaume Munch <gm@lyx.org>
Tue, 1 Mar 2016 13:39:43 +0000 (13:39 +0000)
committerRichard Heck <rgheck@lyx.org>
Sat, 28 May 2016 21:42:31 +0000 (17:42 -0400)
The offending code appears to have been introduced a long time ago. My
understanding is that it is no longer relevant. Notably, it only appears on copy
and not on cut, which tells us that: 1) it should be safe to remove it, 2) we
should remove it for consistency.

src/CutAndPaste.cpp

index 95af6b84d18285b9add94cb10e17e1dfdf692626..5f3e8090fb524aa7d030309fe32e0bea46019da3 100644 (file)
@@ -961,20 +961,11 @@ void copySelectionToStack(Cursor const & cur, CutStack & cutstack)
                LBUFERR(text);
                // ok we have a selection. This is always between cur.selBegin()
                // and sel_end cursor
                LBUFERR(text);
                // ok we have a selection. This is always between cur.selBegin()
                // and sel_end cursor
-
-               // copy behind a space if there is one
-               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()))
-                       ++pos;
-
-               copySelectionHelper(*cur.buffer(), *text, par, cur.selEnd().pit(),
-                       pos, cur.selEnd().pos(), 
-                       cur.buffer()->params().documentClassPtr(), cutstack);
-
+               copySelectionHelper(*cur.buffer(), *text,
+                                   cur.selBegin().pit(), cur.selEnd().pit(),
+                                   cur.selBegin().pos(), cur.selEnd().pos(), 
+                                   cur.buffer()->params().documentClassPtr(),
+                                   cutstack);
                // Reset the dirty_tabular_stack_ flag only when something
                // is copied to the clipboard (not to the selectionBuffer).
                if (&cutstack == &theCuts)
                // Reset the dirty_tabular_stack_ flag only when something
                // is copied to the clipboard (not to the selectionBuffer).
                if (&cutstack == &theCuts)