Author: af
Date: Thu Apr 4 08:27:44 2013
New Revision: 1464353
URL: http://svn.apache.org/r1464353
Log:
i121420: Avoid assertions on context switches during document destruction.
Modified:
openoffice/branches/sidebar/main/sfx2/source/sidebar/ResourceManager.cxx
Modified: openoffice/branches/sidebar/main/sfx2/source/sidebar/ResourceManager.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/ResourceManager.cxx?rev=1464353&r1=1464352&r2=1464353&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/sidebar/ResourceManager.cxx (original)
+++ openoffice/branches/sidebar/main/sfx2/source/sidebar/ResourceManager.cxx Thu Apr 4 08:27:44
2013
@@ -559,12 +559,15 @@ void ResourceManager::ReadLegacyAddons (
::rtl::OUString ResourceManager::GetModuleName (
const cssu::Reference<css::frame::XFrame>& rxFrame)
{
+ if ( ! rxFrame.is() || ! rxFrame->getController().is())
+ return OUString();
+
try
{
const ::comphelper::ComponentContext aContext (::comphelper::getProcessServiceFactory());
const Reference<frame::XModuleManager> xModuleManager (
- aContext.createComponent("com.sun.star.frame.ModuleManager" ),
- UNO_QUERY_THROW );
+ aContext.createComponent("com.sun.star.frame.ModuleManager"),
+ UNO_QUERY_THROW);
return xModuleManager->identify(rxFrame);
}
catch (const Exception&)
|