Fix thinko: default paste method for plain text

* src/lyxtext.h
	* src/text3.C
	(pasteString): Change argument to bool

	* src/text3.C
	(LyXText::dispatch): (LFUN_PASTE): Paste plain text as paragraphs,
	not as lines
	(LyXText::dispatch): Adjust to pasteString change

	* lib/bind/cua.bind:
	* lib/bind/sciword.bind:
	* lib/bind/mac.bind: Move shortcuts from "clipboard-paste paragraph"
	and "primary-selection-paste paragraph" to "primary-selection-paste"
	and "clipboard-paste", since the "paragaph" versions are used in
	LFUN_PASTE and middle-mouse-button paste. Now "primary-selection-paste"
	has the same shortcut it always had, and "clipboard-paste" has the
	shortcut that was originally assigned to
	"primary-selection-paste paragraph".


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16553 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2007-01-06 15:33:07 +00:00
parent 53e186297e
commit 1103be3d85
5 changed files with 16 additions and 14 deletions

View File

@ -68,8 +68,8 @@
\bind "C-c" "copy" \bind "C-c" "copy"
\bind "C-x" "cut" \bind "C-x" "cut"
\bind "C-v" "paste" \bind "C-v" "paste"
\bind "C-M-v" "clipboard-paste paragraph" \bind "C-S-v" "clipboard-paste"
\bind "C-S-v" "primary-selection-paste paragraph" \bind "C-M-v" "primary-selection-paste"
\bind "C-z" "undo" \bind "C-z" "undo"
\bind "C-y" "redo" \bind "C-y" "redo"

View File

@ -58,8 +58,8 @@
\bind "C-c" "copy" \bind "C-c" "copy"
\bind "C-x" "cut" \bind "C-x" "cut"
\bind "C-v" "paste" \bind "C-v" "paste"
\bind "C-M-v" "clipboard-paste paragraph" \bind "C-S-v" "clipboard-paste"
\bind "C-S-v" "primary-selection-paste paragraph" \bind "C-M-v" "primary-selection-paste"
\bind "C-z" "undo" \bind "C-z" "undo"
\bind "C-S-Z" "redo" \bind "C-S-Z" "redo"

View File

@ -105,8 +105,8 @@
\bind "C-u" "font-underline" \bind "C-u" "font-underline"
\bind "C-v" "paste" \bind "C-v" "paste"
\bind "C-M-v" "clipboard-paste paragraph" \bind "C-S-v" "clipboard-paste"
\bind "C-S-v" "primary-selection-paste paragraph" \bind "C-M-v" "primary-selection-paste"
\bind "C-w" "buffer-close" \bind "C-w" "buffer-close"
\bind "C-x" "cut" \bind "C-x" "cut"
\bind "C-z" "undo" \bind "C-z" "undo"

View File

@ -387,11 +387,11 @@ private:
/// set 'number' font property /// set 'number' font property
void number(LCursor & cur); void number(LCursor & cur);
/// paste string at current cursor. /// paste plain text at current cursor.
/// \param str string to paste /// \param str string to paste
/// \param argument method for parsing ("paragraph" is special) /// \param asParagraphs whether to paste as paragraphs or as lines
void pasteString(LCursor & cur, docstring const & str, void pasteString(LCursor & cur, docstring const & str,
docstring const & argument); bool asParagraphs);
}; };
} // namespace lyx } // namespace lyx

View File

@ -759,7 +759,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
cur.message(_("Paste")); cur.message(_("Paste"));
cap::replaceSelection(cur); cap::replaceSelection(cur);
if (cmd.argument().empty() && !theClipboard().isInternal()) if (cmd.argument().empty() && !theClipboard().isInternal())
pasteString(cur, theClipboard().get(), docstring()); pasteString(cur, theClipboard().get(), true);
else { else {
string const arg(to_utf8(cmd.argument())); string const arg(to_utf8(cmd.argument()));
pasteSelection(cur, bv->buffer()->errorList("Paste"), pasteSelection(cur, bv->buffer()->errorList("Paste"),
@ -866,11 +866,13 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
} }
case LFUN_CLIPBOARD_PASTE: case LFUN_CLIPBOARD_PASTE:
pasteString(cur, theClipboard().get(), cmd.argument()); pasteString(cur, theClipboard().get(),
cmd.argument() == "paragraph");
break; break;
case LFUN_PRIMARY_SELECTION_PASTE: case LFUN_PRIMARY_SELECTION_PASTE:
pasteString(cur, theSelection().get(), cmd.argument()); pasteString(cur, theSelection().get(),
cmd.argument() == "paragraph");
break; break;
case LFUN_UNICODE_INSERT: { case LFUN_UNICODE_INSERT: {
@ -1890,12 +1892,12 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
void LyXText::pasteString(LCursor & cur, docstring const & clip, void LyXText::pasteString(LCursor & cur, docstring const & clip,
docstring const & argument) bool asParagraphs)
{ {
cur.clearSelection(); cur.clearSelection();
if (!clip.empty()) { if (!clip.empty()) {
recordUndo(cur); recordUndo(cur);
if (argument == "paragraph") if (asParagraphs)
insertStringAsParagraphs(cur, clip); insertStringAsParagraphs(cur, clip);
else else
insertStringAsLines(cur, clip); insertStringAsLines(cur, clip);