summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-02-10 16:40:30 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-02-10 16:46:02 +0100
commit4c726e9607fbcd54c5ef39c951202e3776ec35ae (patch)
treea95fc69742026856a59c09ad25b129bd3668224d /framework/source
parent5306890b2c960235183caad0bf89e5f31f2f29a0 (diff)
Survive missing UIElementFactories.
And try to not use AddonsToolBarFactory in native code generator. Change-Id: I4782e6c719bdc7e01da14d2ea026e119da542517
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/uifactory/uielementfactorymanager.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/framework/source/uifactory/uielementfactorymanager.cxx b/framework/source/uifactory/uielementfactorymanager.cxx
index 68cf917d9d5a..2282b0626895 100644
--- a/framework/source/uifactory/uielementfactorymanager.cxx
+++ b/framework/source/uifactory/uielementfactorymanager.cxx
@@ -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 )