diff --git a/sfx2/source/sidebar/ControllerFactory.cxx b/sfx2/source/sidebar/ControllerFactory.cxx index 7de15515b482..085a8ccfe5f0 100644 --- a/sfx2/source/sidebar/ControllerFactory.cxx +++ b/sfx2/source/sidebar/ControllerFactory.cxx @@ -53,8 +53,10 @@ Reference ControllerFactory::CreateToolBoxController( rxFrame, rxController, nWidth)); + bool bFactoryHasController( xController.is() ); + // Create a controller for the new item. - if ( ! xController.is()) + if ( !bFactoryHasController ) { xController.set( static_cast(::framework::CreateToolBoxController( @@ -78,7 +80,7 @@ Reference ControllerFactory::CreateToolBoxController( // Initialize the controller with eg a service factory. Reference xInitialization (xController, UNO_QUERY); - if (xInitialization.is()) + if (!bFactoryHasController && xInitialization.is()) { beans::PropertyValue aPropValue; std::vector aPropertyVector;