diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-03-15 12:05:26 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-03-15 12:05:26 +0000 |
commit | 1343a7531c01a14a092c3cc748495b8ae7d28a10 (patch) | |
tree | 66cd565d9ff48a64541e5653575850c3aadadf85 /sfx2/source/appl/sfxhelp.cxx | |
parent | 78767c5881e827e6c2689198f7b3153d24b6b02e (diff) |
INTEGRATION: CWS c01v005 (1.60.122); FILE MERGED
2005/03/07 13:42:19 pb 1.60.122.3: fix: #120028# no 'drafts' any longer
2005/03/05 01:12:53 hjs 1.60.122.2: RESYNC: (1.60-1.61); FILE MERGED
2005/03/03 08:48:37 pb 1.60.122.1: fix: #120028# GetCurrentModuleIdentifier() added
Diffstat (limited to 'sfx2/source/appl/sfxhelp.cxx')
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 98fd3cfcee..0cb5d86a29 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sfxhelp.cxx,v $ * - * $Revision: 1.61 $ + * $Revision: 1.62 $ * - * last change: $Author: kz $ $Date: 2005-03-01 19:58:09 $ + * last change: $Author: obo $ $Date: 2005-03-15 13:05:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -485,44 +485,54 @@ SfxHelp::~SfxHelp() return sDefaultModule; } -String SfxHelp::GetHelpModuleName_Impl() +::rtl::OUString getCurrentModuleIdentifier_Impl() { - String sModuleName; + ::rtl::OUString sIdentifier; Reference < XFramesSupplier > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); Reference < XFrame > xActiveTask = xDesktop->getActiveFrame(); Reference < XModuleManager > xModuleManager( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.ModuleManager") ), UNO_QUERY ); - rtl::OUString aModuleIdentifier; - rtl::OUString aFactoryShortName; - if ( xActiveTask.is() ) { try { - aModuleIdentifier = xModuleManager->identify( xActiveTask ); + sIdentifier = xModuleManager->identify( xActiveTask ); } catch ( ::com::sun::star::frame::UnknownModuleException& ) { - DBG_WARNING( "SfxHelp::GetHelpModuleName_Impl(): unknown module (help in help?)" ); + DBG_WARNING( "SfxHelp::getCurrentModuleIdentifier_Impl(): unknown module (help in help?)" ); } catch ( Exception& ) { - DBG_ERRORFILE( "SfxHelp::GetHelpModuleName_Impl(): exception of XModuleManager::identify()" ); + DBG_ERRORFILE( "SfxHelp::getCurrentModuleIdentifier_Impl(): exception of XModuleManager::identify()" ); } } + return sIdentifier; +} + +String SfxHelp::GetHelpModuleName_Impl() +{ + String sModuleName; + rtl::OUString aFactoryShortName; + rtl::OUString aModuleIdentifier = getCurrentModuleIdentifier_Impl(); + if ( aModuleIdentifier.getLength() > 0 ) { try { + Reference < XModuleManager > xModuleManager( + ::comphelper::getProcessServiceFactory()->createInstance( + DEFINE_CONST_UNICODE("com.sun.star.frame.ModuleManager") ), UNO_QUERY ); Sequence< PropertyValue > lProps; Reference< ::com::sun::star::container::XNameAccess > xCont( xModuleManager, UNO_QUERY); - xCont->getByName( aModuleIdentifier ) >>= lProps; - for (sal_Int32 i=0; i<lProps.getLength(); ++i) + if ( xCont.is() ) + xCont->getByName( aModuleIdentifier ) >>= lProps; + for ( sal_Int32 i = 0; i < lProps.getLength(); ++i ) { - if (lProps[i].Name.equalsAscii("ooSetupFactoryShortName")) + if ( lProps[i].Name.equalsAscii("ooSetupFactoryShortName") ) { lProps[i].Value >>= aFactoryShortName; break; @@ -953,3 +963,8 @@ String SfxHelp::GetDefaultHelpModule() return getDefaultModule_Impl(); } +::rtl::OUString SfxHelp::GetCurrentModuleIdentifier() +{ + return getCurrentModuleIdentifier_Impl(); +} + |