From 304830269aa7899f7feaf19c0c91ea39583205fe Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Thu, 15 May 2003 09:52:44 +0000 Subject: INTEGRATION: CWS fwk02 (1.5.8); FILE MERGED 2003/05/13 08:02:27 as 1.5.8.1: #109537# use ofa res explicit --- framework/source/services/backingcomp.cxx | 58 ++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 20 deletions(-) (limited to 'framework') 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 #endif +#ifndef _OSL_FILE_HXX_ +#include +#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 -- cgit