Index: /CKEditor/branches/features/pasting/_source/plugins/clipboard/plugin.js
===================================================================
--- /CKEditor/branches/features/pasting/_source/plugins/clipboard/plugin.js	(revision 4216)
+++ /CKEditor/branches/features/pasting/_source/plugins/clipboard/plugin.js	(revision 4217)
@@ -86,9 +86,6 @@
 					editor.focus();
 
-					if ( !editor.fire( 'beforePaste' )
-						&& !execIECommand( editor, 'paste' ) )
-					{
-							editor.openDialog( 'paste' );
-					}
+					if ( !execIECommand( editor, 'paste' ) )
+						editor.fire( 'pasteDialog' );
 				}
 			}
@@ -99,5 +96,5 @@
 					try
 					{
-						if ( !editor.fire( 'beforePaste' )
+						if ( !editor.document.getBody().fire( 'beforepaste' )
 							&& !editor.document.$.execCommand( 'Paste', false, null ) )
 						{
@@ -107,6 +104,8 @@
 					catch ( e )
 					{
-						// Open the paste dialog.
-						editor.openDialog( 'paste' );
+						setTimeout( function()
+						{
+							editor.fire( 'pasteDialog' );
+						}, 0 )
 					}
 				}
@@ -122,13 +121,16 @@
 			case CKEDITOR.SHIFT + 45 :		// SHIFT+INS
 
-				var editor = this;
+				var editor = this,
+					body = editor.document.getBody();
+
 				editor.fire( 'saveSnapshot' );		// Save before paste
 
-				if ( editor.fire( 'beforePaste' ) )
+				// Simulate 'beforepaste' event for all none-IEs.
+				if ( !CKEDITOR.env.ie && body.fire( 'beforepaste' ) )
 					event.cancel();
-				// Simulate native 'paste' event for Opera/Firefox2. 
-				else if( CKEDITOR.env.opera 
+				// Simulate 'paste' event for Opera/Firefox2.
+				else if( CKEDITOR.env.opera
 						 || CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 )
-					editor.document.getBody().fire( 'paste' );
+					body.fire( 'paste' );
 				return;
 
@@ -149,5 +151,5 @@
 	// Allow to peek clipboard content by redirecting the
 	// pasting content into a temporary bin and grab the content of it.
-	function getPasteBin( evt, callback ) {
+	function getPasteBin( evt, mode, callback ) {
 
 		var doc = this.document;
@@ -161,5 +163,6 @@
 
 		// Create container to paste into
-		var pastebin = CKEDITOR.dom.element.createFromHtml( '<div id="cke_pastebin">&nbsp;</div>', doc );
+		var pastebin = new CKEDITOR.dom.element( mode == 'text' ? 'textarea' : 'div', doc );
+		pastebin.setAttribute( 'id', 'cke_pastebin' );
 		doc.getBody().append( pastebin );
 
@@ -185,14 +188,25 @@
 			pastebin.remove();
 			evt.data.preventDefault();
-			callback( pastebin );
+			callback( pastebin[ 'get' + ( mode == 'text' ? 'Value' : 'Html' ) ]() );
 		}
 		else
 		{
 			var bms = sel.createBookmarks();
-			range.selectNodeContents( pastebin );
-			range.select();
+			// Turn off design mode temporarily,
+			// give focus to the paste bin.
+			if ( mode == 'text' )
+			{
+				doc.$.designMode = 'off';
+				pastebin.$.focus();
+			}
+			else
+			{
+				range.setStartAt( pastebin, CKEDITOR.POSITION_AFTER_START );
+				range.select();
+			}
 			// Wait a while and grab the pasted contents
 			window.setTimeout( function() {
 
+				doc.$.designMode = 'on';
 				pastebin.remove();
 
@@ -208,5 +222,5 @@
 				// Restore the old selection
 				sel.selectBookmarks( bms );
-				callback( pastebin );
+				callback( pastebin[ 'get' + ( mode == 'text' ? 'Value' : 'Html' ) ]() );
 
 			}, 0 );
@@ -257,4 +271,10 @@
 
 				}, null, null, 1000 );
+
+				editor.on( 'pasteDialog', function( evt )
+				{
+					// Open default paste dialog. 
+					editor.openDialog( 'paste' );
+				} );
 
 				function addButtonCommand( buttonName, commandName, command, ctxMenuOrder )
@@ -291,22 +311,28 @@
 
 				if( editor.config.autoDetectPaste )
+				{
+					var mode = editor.config.forcePasteAsPlainText ? 'text' : 'html';
 					editor.on( 'contentDom', function()
 					{
 						var body = editor.document.getBody();
-						body.on( 'paste', function( evt )
-						{
-							getPasteBin.call( editor, evt, function ( pasteBin )
-							{
-								var html = pasteBin.getHtml(),
-									dataTransfer =
+						body.on( ( mode == 'text' && !CKEDITOR.env.ie ) ?
+						          'beforepaste' : 'paste',
+								function( evt )
+								{
+									getPasteBin.call( editor, evt, mode, function ( data )
 									{
-										'html' : html
-									};
-								
-								editor.fire( 'paste', dataTransfer );
-							} );
-						} );
+										// The very last guard to make sure the
+										// paste has really happened.
+										if ( !data )
+											return;
+
+										var dataTransfer = {};
+										dataTransfer[ mode ] = data;
+										editor.fire( 'paste', dataTransfer );
+									} );
+								} );
 
 					} );
+				}
 
 				// If the "contextmenu" plugin is loaded, register the listeners.
Index: /CKEditor/branches/features/pasting/_source/plugins/pastetext/plugin.js
===================================================================
--- /CKEditor/branches/features/pasting/_source/plugins/pastetext/plugin.js	(revision 4216)
+++ /CKEditor/branches/features/pasting/_source/plugins/pastetext/plugin.js	(revision 4217)
@@ -1,3 +1,3 @@
-﻿/*
+/*
 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -43,16 +43,14 @@
 			CKEDITOR.dialog.add( commandName, CKEDITOR.getUrl( this.path + 'dialogs/pastetext.js' ) );
 
-			if ( editor.config.forcePasteAsPlainText )
+			if( editor.config.forcePasteAsPlainText )
 			{
-				editor.on( 'beforePaste', function( event )
-					{
-						if ( editor.mode == "wysiwyg" )
-						{
-							setTimeout( function() { command.exec(); }, 0 );
-							event.cancel();
-						}
-					},
-					null, null, 20 );
+				editor.on( 'pasteDialog', function ( evt )
+				{
+					editor.execCommand( 'pastetext' );
+					evt.cancel();
+				}, null, null, 0 );
+
 			}
+
 		},
 		requires : [ 'clipboard' ]
