diff options
author | Kai Sommerfeld <kso@openoffice.org> | 2001-03-27 13:01:44 +0000 |
---|---|---|
committer | Kai Sommerfeld <kso@openoffice.org> | 2001-03-27 13:01:44 +0000 |
commit | 38db8874f9d9a01d503765c9c7713d275ecf387b (patch) | |
tree | 01608ac8400c19db33ad217c5b8b59610740bcad /ucbhelper/source | |
parent | 08dea1be70f6a2f6a6c7e0e50340edde82465a48 (diff) |
#85225# - Added additional params to Get[Command|propertySet]Info.
Diffstat (limited to 'ucbhelper/source')
-rw-r--r-- | ucbhelper/source/provider/contenthelper.cxx | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/ucbhelper/source/provider/contenthelper.cxx b/ucbhelper/source/provider/contenthelper.cxx index 095c534ff3ab..e62704855fdf 100644 --- a/ucbhelper/source/provider/contenthelper.cxx +++ b/ucbhelper/source/provider/contenthelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: contenthelper.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: mh $ $Date: 2001-01-31 13:41:49 $ + * last change: $Author: kso $ $Date: 2001-03-27 14:01:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -754,7 +754,12 @@ void SAL_CALL ContentImplHelper::addProperty( // exist in dynamic and static(!) properties. ////////////////////////////////////////////////////////////////////// - if ( getPropertySetInfo()->hasPropertyByName( Name ) ) + // @@@ Need real command environment here, but where to get it from? + // XPropertyContainer interface should be replaced by + // XCommandProcessor commands! + Reference< XCommandEnvironment > xEnv; + + if ( getPropertySetInfo( xEnv )->hasPropertyByName( Name ) ) { // Property does already exist. throw PropertyExistException(); @@ -839,7 +844,12 @@ void SAL_CALL ContentImplHelper::removeProperty( const OUString& Name ) try { - Property aProp = getPropertySetInfo()->getPropertyByName( Name ); + // @@@ Need real command environment here, but where to get it from? + // XPropertyContainer interface should be replaced by + // XCommandProcessor commands! + Reference< XCommandEnvironment > xEnv; + + Property aProp = getPropertySetInfo( xEnv )->getPropertyByName( Name ); if ( !( aProp.Attributes & PropertyAttribute::REMOVEABLE ) ) { @@ -1255,23 +1265,31 @@ sal_Bool ContentImplHelper::exchange( } //========================================================================= -Reference< XCommandInfo > ContentImplHelper::getCommandInfo() +Reference< XCommandInfo > ContentImplHelper::getCommandInfo( + const Reference< XCommandEnvironment > & xEnv, sal_Bool bCache ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); if ( !m_pImpl->m_xCommandsInfo.isValid() ) - m_pImpl->m_xCommandsInfo = new CommandProcessorInfo( m_xSMgr, this ); + m_pImpl->m_xCommandsInfo + = new CommandProcessorInfo( m_xSMgr, xEnv, this ); + else if ( !bCache ) + m_pImpl->m_xCommandsInfo->reset(); return Reference< XCommandInfo >( m_pImpl->m_xCommandsInfo.getBodyPtr() ); } //========================================================================= -Reference< XPropertySetInfo > ContentImplHelper::getPropertySetInfo() +Reference< XPropertySetInfo > ContentImplHelper::getPropertySetInfo( + const Reference< XCommandEnvironment > & xEnv, sal_Bool bCache ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); if ( !m_pImpl->m_xPropSetInfo.isValid() ) - m_pImpl->m_xPropSetInfo = new PropertySetInfo( m_xSMgr, this ); + m_pImpl->m_xPropSetInfo + = new PropertySetInfo( m_xSMgr, xEnv, this ); + else if ( !bCache ) + m_pImpl->m_xPropSetInfo->reset(); return Reference< XPropertySetInfo >( m_pImpl->m_xPropSetInfo.getBodyPtr() ); |