Index: _source/plugins/stylescombo/plugin.js
===================================================================
--- _source/plugins/stylescombo/plugin.js	(revision 5206)
+++ _source/plugins/stylescombo/plugin.js	Wed Mar 03 18:51:10 CST 2010
@@ -16,7 +16,8 @@
 			var config = editor.config,
 				lang = editor.lang.stylesCombo,
 				pluginPath = this.path,
-				styles;
+				styles = {},
+				stylesList = [];
 
 			if ( !stylesManager )
 				stylesManager = CKEDITOR.stylesSet;
@@ -30,53 +31,63 @@
 						comboStylesSet.slice( 1 ).join( ':' ) :
 						pluginPath + 'styles/' + styleSetName + '.js', '' );
 
-			editor.ui.addRichCombo( 'Styles',
+			function loadStylesSet( callback )
-				{
+		   {
-					label : lang.label,
-					title : lang.panelTitle,
-					className : 'cke_styles',
-
-					panel :
-					{
-						css : editor.skin.editor.css.concat( config.contentsCss ),
-						multiSelect : true,
-						attributes : { 'aria-label' : lang.panelTitle }
-					},
-
-					init : function()
-					{
-						var combo = this;
-
-						CKEDITOR.stylesSet.load( styleSetName, function( stylesSet )
-							{
+			   CKEDITOR.stylesSet.load( styleSetName, function( stylesSet )
+				   {
+					   if( !stylesList.length )
+					   {
-								var stylesDefinitions = stylesSet[ styleSetName ],
-									style,
+						   var stylesDefinitions = stylesSet[ styleSetName ],
+							   style,
-									styleName,
-									stylesList = [];
+							   styleName;
 
-								styles = {};
-
-								// Put all styles into an Array.
-								for ( var i = 0 ; i < stylesDefinitions.length ; i++ )
-								{
-									var styleDefinition = stylesDefinitions[ i ];
+						   // Put all styles into an Array.
+						   for ( var i = 0 ; i < stylesDefinitions.length ; i++ )
+						   {
+							   var styleDefinition = stylesDefinitions[ i ];
 
-									styleName = styleDefinition.name;
+							   styleName = styleDefinition.name;
 
-									style = styles[ styleName ] = new CKEDITOR.style( styleDefinition );
-									style._name = styleName;
+							   style = styles[ styleName ] = new CKEDITOR.style( styleDefinition );
+							   style._name = styleName;
 
-									stylesList.push( style );
-								}
+							   stylesList.push( style );
+						   }
 
-								// Sorts the Array, so the styles get grouped
-								// by type.
-								stylesList.sort( sortStyles );
+						   // Sorts the Array, so the styles get grouped
+						   // by type.
+						   stylesList.sort( sortStyles );
+					   }
 
+					   callback && callback();
+				   });
+		   }
+
+			var combo = editor.ui.addRichCombo( 'Styles',
+				{
+					label : lang.label,
+					title : lang.panelTitle,
+					className : 'cke_styles',
+
+					panel :
+					{
+						css : editor.skin.editor.css.concat( config.contentsCss ),
+						multiSelect : true,
+						attributes : { 'aria-label' : lang.panelTitle }
+					},
+
+					init : function()
+					{
+						var combo = this;
+
+						loadStylesSet( function()
+							{
+								var style, styleName;
+
 								// Loop over the Array, adding all items to the
 								// combo.
 								var lastType;
-								for ( i = 0 ; i < stylesList.length ; i++ )
+								for ( var i = 0 ; i < stylesList.length ; i++ )
 								{
 									style = stylesList[ i ];
 									styleName = style._name;
@@ -130,6 +141,8 @@
 
 					onRender : function()
 					{
+						config.stylesCombo_stylesSetAutoLoadStartup && loadStylesSet();
+
 						editor.on( 'selectionChange', function( ev )
 							{
 								var currentValue = this.getValue();
@@ -280,3 +293,17 @@
  * config.stylesCombo_stylesSet = 'mystyles:http://www.example.com/editorstyles/styles.js';
  */
 CKEDITOR.config.stylesCombo_stylesSet = 'default';
+
+/**
+ * Whether to load the styles set file in background on editor's startup, which makes the
+ * styles combo value always stay updated to current editor selection, otherwise the combo will
+ * only be activated on the first opening.
+ * @name CKEDITOR.config.stylesCombo_stylesSetAutoLoadStartup
+ * @type Boolean
+ * @default false
+ * @example
+ *  // Load styles set on editor startup.
+ *  config.stylesCombo_stylesSetAutoLoadStartup = true;
+ */
+
+
