Survive missing UIElementFactories.

And try to not use AddonsToolBarFactory in native code generator.

Change-Id: I4782e6c719bdc7e01da14d2ea026e119da542517
This commit is contained in:
Matúš Kukan
2014-02-10 16:40:30 +01:00
parent 5306890b2c
commit 4c726e9607
2 changed files with 12 additions and 5 deletions

View File

@@ -28,6 +28,7 @@
#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/loader/CannotActivateFactoryException.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XModuleManager2.hpp>
@@ -503,10 +504,17 @@ throw ( RuntimeException )
aServiceSpecifier = m_pConfigAccess->getFactorySpecifierFromTypeNameModule( aType, aName, aModuleId );
} // SAFE
if ( !aServiceSpecifier.isEmpty() )
return Reference< XUIElementFactory >( m_xContext->getServiceManager()->createInstanceWithContext(aServiceSpecifier, m_xContext), UNO_QUERY );
else
return Reference< XUIElementFactory >();
if ( !aServiceSpecifier.isEmpty() ) try
{
return Reference< XUIElementFactory >(m_xContext->getServiceManager()->
createInstanceWithContext(aServiceSpecifier, m_xContext), UNO_QUERY);
}
catch ( const css::loader::CannotActivateFactoryException& )
{
SAL_WARN("fwk.uielement", aServiceSpecifier <<
" not available. This should happen only on mobile platforms.");
}
return Reference< XUIElementFactory >();
}
void SAL_CALL UIElementFactoryManager::registerFactory( const OUString& aType, const OUString& aName, const OUString& aModuleId, const OUString& aFactoryImplementationName )

View File

@@ -48,7 +48,6 @@ core_factory_list = [
core_constructor_list = [
# framework/util/fwk.component
"com_sun_star_comp_framework_AddonsToolBarFactory_get_implementation",
"com_sun_star_comp_framework_AutoRecovery_get_implementation",
"com_sun_star_comp_framework_Frame_get_implementation",
"com_sun_star_comp_framework_JobExecutor_get_implementation",