Index: /CKEditor/branches/features/readonly/_source/plugins/button/plugin.js
===================================================================
--- /CKEditor/branches/features/readonly/_source/plugins/button/plugin.js	(revision 6753)
+++ /CKEditor/branches/features/readonly/_source/plugins/button/plugin.js	(revision 6754)
@@ -94,17 +94,4 @@
 	var keydownFn = CKEDITOR.tools.addFunction( CKEDITOR.ui.button._.keydown, CKEDITOR.ui.button._ ),
 		focusFn = CKEDITOR.tools.addFunction( CKEDITOR.ui.button._.focus, CKEDITOR.ui.button._ );
-
-function updateState( editor )
-{
-	// "this" is a CKEDITOR.ui.button instance.
-
-	var mode = editor.mode;
-
-	// Restore saved button state.
-	var state = this.modes[ mode ] ? modeStates[ mode ] != undefined ? modeStates[ mode ] :
-			CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
-
-	this.setState( editor.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : state );
-}
 
 CKEDITOR.ui.button.prototype =
@@ -155,7 +142,25 @@
 		{
 			var modeStates = {};
+
+			function updateState()
+			{
+				// "this" is a CKEDITOR.ui.button instance.
+
+				var mode = editor.mode;
+
+				if ( mode )
+				{
+					// Restore saved button state.
+					var state = this.modes[ mode ] ? modeStates[ mode ] != undefined ? modeStates[ mode ] :
+							CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
+
+					this.setState( editor.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : state );
+				}
+			}
+
 			editor.on( 'beforeModeUnload', function()
 				{
-					modeStates[ editor.mode ] = this._.state;
+					if ( editor.mode && this._.state != CKEDITOR.TRISTATE_DISABLED )
+						modeStates[ editor.mode ] = this._.state;
 				}, this );
 
Index: /CKEditor/branches/features/readonly/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/branches/features/readonly/_source/plugins/wysiwygarea/plugin.js	(revision 6753)
+++ /CKEditor/branches/features/readonly/_source/plugins/wysiwygarea/plugin.js	(revision 6754)
@@ -1180,4 +1180,7 @@
 			function blinkCursor( retry )
 			{
+				if ( editor.readOnly )
+					return;
+
 				CKEDITOR.tools.tryThese(
 					function()
