diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-05-15 09:52:44 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-05-15 09:52:44 +0000 |
commit | 304830269aa7899f7feaf19c0c91ea39583205fe (patch) | |
tree | 2a3277fdb118512199eaf8513d07d9f8f9f3d01f /framework | |
parent | 66e367284fa328ab06d2252b975401c393b96ab8 (diff) |
INTEGRATION: CWS fwk02 (1.5.8); FILE MERGED
2003/05/13 08:02:27 as 1.5.8.1: #109537# use ofa res explicit
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/services/backingcomp.cxx | 58 |
1 files changed, 38 insertions, 20 deletions
diff --git a/framework/source/services/backingcomp.cxx b/framework/source/services/backingcomp.cxx index 9477d226a233..09ca22f65fcc 100644 --- a/framework/source/services/backingcomp.cxx +++ b/framework/source/services/backingcomp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: backingcomp.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: rt $ $Date: 2003-04-24 13:33:46 $ + * last change: $Author: vg $ $Date: 2003-05-15 10:52:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -178,6 +178,10 @@ #include <svtools/urihelper.hxx> #endif +#ifndef _OSL_FILE_HXX_ +#include <osl/file.hxx> +#endif + namespace framework { @@ -633,25 +637,39 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f m_xStatus = css::uno::Reference< css::task::XStatusIndicatorFactory >(static_cast< ::cppu::OWeakObject* >(pIndicatorFactoryHelper), css::uno::UNO_QUERY); // load the default menu from the ofa resource - ResMgr* pOfaResMgr = CREATERESMGR(ofa); - INetURLObject aResFile (URIHelper::SmartRelToAbs(pOfaResMgr->GetFileName())); - ::rtl::OUStringBuffer sMenuRes(256); - sMenuRes.appendAscii("private:resource/"); - sMenuRes.append (aResFile.GetName() ); - sMenuRes.appendAscii("/261" ); - - css::util::URL aURL; - aURL.Complete = sMenuRes.makeStringAndClear(); - css::uno::Reference< css::util::XURLTransformer > xParser(m_xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), css::uno::UNO_QUERY); - if (xParser.is()) - xParser->parseStrict(aURL); - - css::uno::Reference< css::frame::XDispatchProvider > xProvider(m_xFrame, css::uno::UNO_QUERY); - if (xProvider.is()) + ResMgr* pOfaResMgr = CREATERESMGR(ofa); + if (pOfaResMgr) { - css::uno::Reference< css::frame::XDispatch > xDispatch = xProvider->queryDispatch(aURL, SPECIALTARGET_MENUBAR, 0); - if (xDispatch.is()) - xDispatch->dispatch(aURL, css::uno::Sequence< css::beans::PropertyValue>()); + ::rtl::OUString sResPath(pOfaResMgr->GetFileName()); + ::rtl::OUString sResFile; + if (::osl::FileBase::getFileURLFromSystemPath(sResPath, sResFile) == ::osl::FileBase::E_None) + { + INetURLObject aResFile(sResFile); + String sResName = aResFile.GetName(); + + if (sResName.Len()) + { + ::rtl::OUStringBuffer sMenuRes(256); + sMenuRes.appendAscii("private:resource/"); + sMenuRes.append (sResName ); + sMenuRes.appendAscii("/261" ); + + css::util::URL aURL; + aURL.Complete = sMenuRes.makeStringAndClear(); + + css::uno::Reference< css::util::XURLTransformer > xParser(m_xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), css::uno::UNO_QUERY); + if (xParser.is()) + xParser->parseStrict(aURL); + + css::uno::Reference< css::frame::XDispatchProvider > xProvider(m_xFrame, css::uno::UNO_QUERY); + if (xProvider.is()) + { + css::uno::Reference< css::frame::XDispatch > xDispatch = xProvider->queryDispatch(aURL, SPECIALTARGET_MENUBAR, 0); + if (xDispatch.is()) + xDispatch->dispatch(aURL, css::uno::Sequence< css::beans::PropertyValue>()); + } + } + } } // establish listening for key accelerators |