diff options
author | Gil Forcada <gforcada@gnome.org> | 2010-10-12 23:48:07 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-10-13 12:25:14 +0200 |
commit | f061cefaf96f4937b58d0e2ba4fa5bf5187b2d6a (patch) | |
tree | 6d0fe69c978c6c01867c4b023bce322c90be8334 | |
parent | 2ab6d2bd492320472e33526674923b02876d427d (diff) |
Removed comments, trailing spaces and death code (2)
42 files changed, 349 insertions, 1096 deletions
diff --git a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx index f1d8b7006..df7a85434 100644 --- a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx +++ b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -58,10 +58,9 @@ extern "C" void SAL_CALL createRegistryInfo_OComponentDefinition() static ::dba::OAutoRegistration< ::dbaccess::OComponentDefinition > aAutoRegistration; } -//........................................................................ namespace dbaccess { -//........................................................................ + /// helper class for column property change events which holds the OComponentDefinition weak typedef ::cppu::WeakImplHelper1 < XPropertyChangeListener > TColumnPropertyListener_BASE; class OColumnPropertyListener : public TColumnPropertyListener_BASE @@ -86,22 +85,22 @@ public: } void clear() { m_pComponent = NULL; } }; -DBG_NAME(OComponentDefinition_Impl) +DBG_NAME(OComponentDefinition_Impl) OComponentDefinition_Impl::OComponentDefinition_Impl() { DBG_CTOR(OComponentDefinition_Impl,NULL); } -// ----------------------------------------------------------------------------- + OComponentDefinition_Impl::~OComponentDefinition_Impl() { - DBG_DTOR(OComponentDefinition_Impl,NULL); + DBG_DTOR(OComponentDefinition_Impl,NULL); } //========================================================================== //= OComponentDefinition //========================================================================== -//-------------------------------------------------------------------------- + DBG_NAME(OComponentDefinition) -//-------------------------------------------------------------------------- + void OComponentDefinition::registerProperties() { m_xColumnPropertyListener = ::comphelper::ImplementationReference<OColumnPropertyListener,XPropertyChangeListener>(new OColumnPropertyListener(this)); @@ -121,7 +120,6 @@ void OComponentDefinition::registerProperties() } } -//-------------------------------------------------------------------------- OComponentDefinition::OComponentDefinition(const Reference< XMultiServiceFactory >& _xORB ,const Reference< XInterface >& _xParentContainer ,const TContentPtr& _pImpl @@ -133,13 +131,13 @@ OComponentDefinition::OComponentDefinition(const Reference< XMultiServiceFactory DBG_CTOR(OComponentDefinition, NULL); registerProperties(); } -//-------------------------------------------------------------------------- + OComponentDefinition::~OComponentDefinition() { DBG_DTOR(OComponentDefinition, NULL); } -//-------------------------------------------------------------------------- + OComponentDefinition::OComponentDefinition( const Reference< XInterface >& _rxContainer ,const ::rtl::OUString& _rElementName ,const Reference< XMultiServiceFactory >& _xORB @@ -156,44 +154,40 @@ OComponentDefinition::OComponentDefinition( const Reference< XInterface >& _rxCo DBG_ASSERT(m_pImpl->m_aProps.aTitle.getLength() != 0, "OComponentDefinition::OComponentDefinition : invalid name !"); } -//-------------------------------------------------------------------------- IMPLEMENT_IMPLEMENTATION_ID(OComponentDefinition); IMPLEMENT_GETTYPES3(OComponentDefinition,ODataSettings,OContentHelper,OComponentDefinition_BASE); IMPLEMENT_FORWARD_XINTERFACE3( OComponentDefinition,OContentHelper,ODataSettings,OComponentDefinition_BASE) -//-------------------------------------------------------------------------- + ::rtl::OUString OComponentDefinition::getImplementationName_static( ) throw(RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.OComponentDefinition")); } -//-------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OComponentDefinition::getImplementationName( ) throw(RuntimeException) { return getImplementationName_static(); } -//-------------------------------------------------------------------------- Sequence< ::rtl::OUString > OComponentDefinition::getSupportedServiceNames_static( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aServices(2); aServices.getArray()[0] = SERVICE_SDB_TABLEDEFINITION; aServices.getArray()[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.Content")); - + return aServices; } -//-------------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL OComponentDefinition::getSupportedServiceNames( ) throw(RuntimeException) { return getSupportedServiceNames_static(); } -//------------------------------------------------------------------------------ + Reference< XInterface > OComponentDefinition::Create( const Reference< XComponentContext >& _rxContext ) { ::comphelper::ComponentContext aContext( _rxContext ); return *(new OComponentDefinition( aContext.getLegacyServiceFactory(), NULL, TContentPtr( new OComponentDefinition_Impl ) ) ); } -// ----------------------------------------------------------------------------- + void SAL_CALL OComponentDefinition::disposing() { OContentHelper::disposing(); @@ -202,26 +196,25 @@ void SAL_CALL OComponentDefinition::disposing() m_xColumnPropertyListener->clear(); m_xColumnPropertyListener.dispose(); } -// ----------------------------------------------------------------------------- + IPropertyArrayHelper& OComponentDefinition::getInfoHelper() { return *getArrayHelper(); } -//-------------------------------------------------------------------------- + IPropertyArrayHelper* OComponentDefinition::createArrayHelper( ) const { Sequence< Property > aProps; describeProperties(aProps); return new OPropertyArrayHelper(aProps); } -//-------------------------------------------------------------------------- + Reference< XPropertySetInfo > SAL_CALL OComponentDefinition::getPropertySetInfo( ) throw(RuntimeException) { Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } -// ----------------------------------------------------------------------------- ::rtl::OUString OComponentDefinition::determineContentType() const { return m_bTable @@ -229,7 +222,6 @@ Reference< XPropertySetInfo > SAL_CALL OComponentDefinition::getPropertySetInfo( : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/vnd.org.openoffice.DatabaseCommandDefinition" ) ); } -// ----------------------------------------------------------------------------- Reference< XNameAccess> OComponentDefinition::getColumns() throw (RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); @@ -252,7 +244,7 @@ Reference< XNameAccess> OComponentDefinition::getColumns() throw (RuntimeExcepti } return m_pColumns.get(); } -// ----------------------------------------------------------------------------- + OColumn* OComponentDefinition::createColumn(const ::rtl::OUString& _rName) const { const OComponentDefinition_Impl& rDefinition( getDefinition() ); @@ -260,30 +252,30 @@ OColumn* OComponentDefinition::createColumn(const ::rtl::OUString& _rName) const if ( aFind != rDefinition.end() ) { aFind->second->addPropertyChangeListener(::rtl::OUString(),m_xColumnPropertyListener.getRef()); - return new OTableColumnWrapper( aFind->second, aFind->second, true ); + return new OTableColumnWrapper( aFind->second, aFind->second, true ); } OSL_ENSURE( false, "OComponentDefinition::createColumn: is this a valid case?" ); // This here is the last place creating a OTableColumn, and somehow /me thinks it is not needed ... return new OTableColumn( _rName ); } -// ----------------------------------------------------------------------------- + Reference< XPropertySet > OComponentDefinition::createColumnDescriptor() { return new OTableColumnDescriptor( true ); } -// ----------------------------------------------------------------------------- + void OComponentDefinition::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception) { ODataSettings::setFastPropertyValue_NoBroadcast(nHandle,rValue); notifyDataSourceModified(); } -// ----------------------------------------------------------------------------- -void OComponentDefinition::columnDropped(const ::rtl::OUString& _sName) + +void OComponentDefinition::columnDropped(const ::rtl::OUString& _sName) { getDefinition().erase( _sName ); notifyDataSourceModified(); } -// ----------------------------------------------------------------------------- + void OComponentDefinition::columnAppended( const Reference< XPropertySet >& _rxSourceDescriptor ) { ::rtl::OUString sName; @@ -305,8 +297,5 @@ void OComponentDefinition::columnAppended( const Reference< XPropertySet >& _rxS notifyDataSourceModified(); } -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/ComponentDefinition.hxx b/dbaccess/source/core/dataaccess/ComponentDefinition.hxx index cd679a685..bcff73306 100644 --- a/dbaccess/source/core/dataaccess/ComponentDefinition.hxx +++ b/dbaccess/source/core/dataaccess/ComponentDefinition.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -99,14 +99,14 @@ class OComponentDefinition :public OContentHelper ,public ::comphelper::OPropertyArrayUsageHelper< OComponentDefinition > { OComponentDefinition(); - + protected: ::std::auto_ptr< OColumns > m_pColumns; - ::comphelper::ImplementationReference< OColumnPropertyListener,::com::sun::star::beans::XPropertyChangeListener> + ::comphelper::ImplementationReference< OColumnPropertyListener,::com::sun::star::beans::XPropertyChangeListener> m_xColumnPropertyListener; sal_Bool m_bTable; - virtual ~OComponentDefinition(); + virtual ~OComponentDefinition(); virtual void SAL_CALL disposing(); diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index 5350e75b7..824e7cad1 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -60,18 +60,16 @@ using namespace ::com::sun::star::container; using namespace ::comphelper; using namespace ::cppu; -// ----------------------------------------------------------------------------- DBG_NAME(OContentHelper_Impl) OContentHelper_Impl::OContentHelper_Impl() { - DBG_CTOR(OContentHelper_Impl,NULL); + DBG_CTOR(OContentHelper_Impl,NULL); } -// ----------------------------------------------------------------------------- + OContentHelper_Impl::~OContentHelper_Impl() { - DBG_DTOR(OContentHelper_Impl,NULL); + DBG_DTOR(OContentHelper_Impl,NULL); } -// ----------------------------------------------------------------------------- OContentHelper::OContentHelper(const Reference< XMultiServiceFactory >& _xORB ,const Reference< XInterface >& _xParentContainer @@ -86,7 +84,7 @@ OContentHelper::OContentHelper(const Reference< XMultiServiceFactory >& _xORB ,m_nCommandId(0) { } -//-------------------------------------------------------------------------- + void SAL_CALL OContentHelper::disposing() { ::osl::MutexGuard aGuard(m_aMutex); @@ -97,10 +95,10 @@ void SAL_CALL OContentHelper::disposing() m_xParentContainer = NULL; } -// ----------------------------------------------------------------------------- + IMPLEMENT_SERVICE_INFO1(OContentHelper,"com.sun.star.comp.sdb.Content","com.sun.star.ucb.Content"); IMPLEMENT_IMPLEMENTATION_ID(OContentHelper) -// ----------------------------------------------------------------------------- + // XContent Reference< XContentIdentifier > SAL_CALL OContentHelper::getIdentifier( ) throw (RuntimeException) { @@ -110,7 +108,7 @@ Reference< XContentIdentifier > SAL_CALL OContentHelper::getIdentifier( ) throw aIdentifier.append( impl_getHierarchicalName( true ) ); return new ::ucbhelper::ContentIdentifier( m_aContext.getLegacyServiceFactory(), aIdentifier.makeStringAndClear() ); } -// ----------------------------------------------------------------------------- + ::rtl::OUString OContentHelper::impl_getHierarchicalName( bool _includingRootContainer ) const { ::rtl::OUStringBuffer aHierarchicalName( m_pImpl->m_aProps.aTitle ); @@ -137,7 +135,6 @@ Reference< XContentIdentifier > SAL_CALL OContentHelper::getIdentifier( ) throw return sHierarchicalName; } -// ----------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OContentHelper::getContentType() throw (RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); @@ -149,21 +146,20 @@ Reference< XContentIdentifier > SAL_CALL OContentHelper::getIdentifier( ) throw return *m_pImpl->m_aProps.aContentType; } -// ----------------------------------------------------------------------------- + void SAL_CALL OContentHelper::addContentEventListener( const Reference< XContentEventListener >& _rxListener ) throw (RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); if ( _rxListener.is() ) m_aContentListeners.addInterface(_rxListener); } -// ----------------------------------------------------------------------------- + void SAL_CALL OContentHelper::removeContentEventListener( const Reference< XContentEventListener >& _rxListener ) throw (RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); if (_rxListener.is()) m_aContentListeners.removeInterface(_rxListener); } -// ----------------------------------------------------------------------------- // XCommandProcessor sal_Int32 SAL_CALL OContentHelper::createCommandIdentifier( ) throw (RuntimeException) @@ -172,7 +168,7 @@ sal_Int32 SAL_CALL OContentHelper::createCommandIdentifier( ) throw (RuntimeExc // Just increase counter on every call to generate an identifier. return ++m_nCommandId; } -// ----------------------------------------------------------------------------- + Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*CommandId*/, const Reference< XCommandEnvironment >& Environment ) throw (Exception, CommandAbortedException, RuntimeException) { Any aRet; @@ -258,11 +254,10 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma return aRet; } -// ----------------------------------------------------------------------------- + void SAL_CALL OContentHelper::abort( sal_Int32 /*CommandId*/ ) throw (RuntimeException) { } -// ----------------------------------------------------------------------------- // XPropertiesChangeNotifier void SAL_CALL OContentHelper::addPropertiesChangeListener( const Sequence< ::rtl::OUString >& PropertyNames, const Reference< XPropertiesChangeListener >& Listener ) throw (RuntimeException) @@ -286,7 +281,7 @@ void SAL_CALL OContentHelper::addPropertiesChangeListener( const Sequence< ::rtl } } } -// ----------------------------------------------------------------------------- + void SAL_CALL OContentHelper::removePropertiesChangeListener( const Sequence< ::rtl::OUString >& PropertyNames, const Reference< XPropertiesChangeListener >& Listener ) throw (RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); @@ -308,19 +303,18 @@ void SAL_CALL OContentHelper::removePropertiesChangeListener( const Sequence< :: } } } -// ----------------------------------------------------------------------------- // XPropertyContainer -void SAL_CALL OContentHelper::addProperty( const ::rtl::OUString& /*Name*/, sal_Int16 /*Attributes*/, const Any& /*DefaultValue*/ ) throw (PropertyExistException, IllegalTypeException, IllegalArgumentException, RuntimeException) +void SAL_CALL OContentHelper::addProperty( const ::rtl::OUString& /*Name*/, sal_Int16 /*Attributes*/, const Any& /*DefaultValue*/ ) throw (PropertyExistException, IllegalTypeException, IllegalArgumentException, RuntimeException) { DBG_ERROR( "OContentHelper::addProperty: not implemented!" ); } -// ----------------------------------------------------------------------------- + void SAL_CALL OContentHelper::removeProperty( const ::rtl::OUString& /*Name*/ ) throw (UnknownPropertyException, NotRemoveableException, RuntimeException) { DBG_ERROR( "OContentHelper::removeProperty: not implemented!" ); } -// ----------------------------------------------------------------------------- + // XInitialization void SAL_CALL OContentHelper::initialize( const Sequence< Any >& _aArguments ) throw(Exception, RuntimeException) { @@ -344,7 +338,7 @@ void SAL_CALL OContentHelper::initialize( const Sequence< Any >& _aArguments ) t } } } -// ----------------------------------------------------------------------------- + Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue >& rValues,const Reference< XCommandEnvironment >& /*xEnv*/ ) { osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); @@ -456,7 +450,7 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue return aRet; } -// ----------------------------------------------------------------------------- + //========================================================================= // static Reference< XRow > OContentHelper::getPropertyValues( const Sequence< Property >& rProperties) @@ -539,8 +533,7 @@ Reference< XRow > OContentHelper::getPropertyValues( const Sequence< Property >& return Reference< XRow >( xRow.get() ); } -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- + void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent >& evt ) const { @@ -564,7 +557,6 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent typedef Sequence< PropertyChangeEvent > PropertyEventSequence; typedef ::std::map< XPropertiesChangeListener*, PropertyEventSequence* > PropertiesEventListenerMap; PropertiesEventListenerMap aListeners; - const PropertyChangeEvent* propertyChangeEvent = evt.getConstArray(); @@ -618,9 +610,8 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent } } } -// ----------------------------------------------------------------------------- + // com::sun::star::lang::XUnoTunnel -//------------------------------------------------------------------ sal_Int64 OContentHelper::getSomething( const Sequence< sal_Int8 > & rId ) throw (RuntimeException) { if (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) @@ -629,7 +620,6 @@ sal_Int64 OContentHelper::getSomething( const Sequence< sal_Int8 > & rId ) throw return 0; } -// ----------------------------------------------------------------------------- OContentHelper* OContentHelper::getImplementation( const Reference< XInterface >& _rxComponent ) { OContentHelper* pContent( NULL ); @@ -641,20 +631,18 @@ OContentHelper* OContentHelper::getImplementation( const Reference< XInterface > return pContent; } -// ----------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OContentHelper::getParent( ) throw (RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); return m_xParentContainer; } -// ----------------------------------------------------------------------------- + void SAL_CALL OContentHelper::setParent( const Reference< XInterface >& _xParent ) throw (NoSupportException, RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); m_xParentContainer = _xParent; } -// ----------------------------------------------------------------------------- void OContentHelper::impl_rename_throw(const ::rtl::OUString& _sNewName,bool _bNotify ) { osl::ClearableGuard< osl::Mutex > aGuard(m_aMutex); @@ -670,9 +658,9 @@ void OContentHelper::impl_rename_throw(const ::rtl::OUString& _sNewName,bool _bN aChanges[0].PropertyHandle = PROPERTY_ID_NAME; aChanges[0].OldValue <<= m_pImpl->m_aProps.aTitle; aChanges[0].NewValue <<= _sNewName; - + aGuard.clear(); - + m_pImpl->m_aProps.aTitle = _sNewName; if ( _bNotify ) notifyPropertiesChange( aChanges ); @@ -683,50 +671,18 @@ void OContentHelper::impl_rename_throw(const ::rtl::OUString& _sNewName,bool _bN throw ElementExistException(_sNewName,*this); } } -// ----------------------------------------------------------------------------- + void SAL_CALL OContentHelper::rename( const ::rtl::OUString& newName ) throw (SQLException, ElementExistException, RuntimeException) { - + impl_rename_throw(newName); - //Reference<XNameContainer> xNameCont(m_xParentContainer,UNO_QUERY); - //if ( xNameCont.is() ) - //{ - // if ( xNameCont->hasByName(newName) ) - // throw ElementExistException(newName,*this); - - // try - // { - // if ( xNameCont->hasByName(m_pImpl->m_aProps.aTitle) ) - // xNameCont->removeByName(m_pImpl->m_aProps.aTitle); - - // m_pImpl->m_aProps.aTitle = newName; - // xNameCont->insertByName(m_pImpl->m_aProps.aTitle,makeAny(Reference<XContent>(*this,UNO_QUERY))); - // notifyDataSourceModified(); - // } - // catch(IllegalArgumentException) - // { - // throw SQLException(); - // } - // catch(NoSuchElementException) - // { - // throw SQLException(); - // } - // catch(WrappedTargetException) - // { - // throw SQLException(); - // } - //} - //else - // m_pImpl->m_aProps.aTitle = newName; - + } -// ----------------------------------------------------------------------------- + void OContentHelper::notifyDataSourceModified() { ::dbaccess::notifyDataSourceModified(m_xParentContainer,sal_True); } -//........................................................................ -} // namespace dbaccess -//........................................................................ +} // namespace dbaccess /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index d1951c5d1..30f005d83 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -95,33 +95,27 @@ using namespace ::dbtools; using namespace ::comphelper; namespace css = ::com::sun::star; -//........................................................................ namespace dbaccess { -//........................................................................ //============================================================ //= VosMutexFacade //============================================================ -//------------------------------------------------------------------------ VosMutexFacade::VosMutexFacade( ::osl::Mutex& _rMutex ) :m_rMutex( _rMutex ) { } -//------------------------------------------------------------------------ void SAL_CALL VosMutexFacade::acquire() { m_rMutex.acquire(); } -//------------------------------------------------------------------------ sal_Bool SAL_CALL VosMutexFacade::tryToAcquire() { return m_rMutex.tryToAcquire(); } -//------------------------------------------------------------------------ void SAL_CALL VosMutexFacade::release() { m_rMutex.release(); @@ -201,7 +195,6 @@ private: }; -//-------------------------------------------------------------------------- void DocumentStorageAccess::dispose() { ::osl::MutexGuard aGuard( m_aMutex ); @@ -228,7 +221,6 @@ void DocumentStorageAccess::dispose() m_pModelImplementation = NULL; } -//-------------------------------------------------------------------------- Reference< XStorage > DocumentStorageAccess::impl_openSubStorage_nothrow( const ::rtl::OUString& _rStorageName, sal_Int32 _nDesiredMode ) { OSL_ENSURE( _rStorageName.getLength(),"ODatabaseModelImpl::impl_openSubStorage_nothrow: Invalid storage name!" ); @@ -262,7 +254,6 @@ Reference< XStorage > DocumentStorageAccess::impl_openSubStorage_nothrow( const return xStorage; } -//-------------------------------------------------------------------------- void DocumentStorageAccess::disposeStorages() { m_bDisposingSubStorages = true; @@ -287,7 +278,6 @@ void DocumentStorageAccess::disposeStorages() m_bDisposingSubStorages = false; } -//-------------------------------------------------------------------------- void DocumentStorageAccess::commitStorages() SAL_THROW(( IOException, RuntimeException )) { try @@ -307,7 +297,6 @@ void DocumentStorageAccess::commitStorages() SAL_THROW(( IOException, RuntimeExc } } -//-------------------------------------------------------------------------- bool DocumentStorageAccess::commitEmbeddedStorage( bool _bPreventRootCommits ) { if ( _bPreventRootCommits ) @@ -332,7 +321,6 @@ bool DocumentStorageAccess::commitEmbeddedStorage( bool _bPreventRootCommits ) } -//-------------------------------------------------------------------------- Reference< XStorage > SAL_CALL DocumentStorageAccess::getDocumentSubStorage( const ::rtl::OUString& aStorageName, ::sal_Int32 _nDesiredMode ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -346,7 +334,6 @@ Reference< XStorage > SAL_CALL DocumentStorageAccess::getDocumentSubStorage( con return pos->second; } -//-------------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL DocumentStorageAccess::getDocumentSubStoragesNames( ) throw (IOException, RuntimeException) { Reference< XStorage > xRootStor( m_pModelImplementation->getRootStorage() ); @@ -367,13 +354,11 @@ Sequence< ::rtl::OUString > SAL_CALL DocumentStorageAccess::getDocumentSubStorag : Sequence< ::rtl::OUString >( &aNames[0], aNames.size() ); } -//-------------------------------------------------------------------------- void SAL_CALL DocumentStorageAccess::preCommit( const css::lang::EventObject& /*aEvent*/ ) throw (Exception, RuntimeException) { // not interested in } -//-------------------------------------------------------------------------- void SAL_CALL DocumentStorageAccess::commited( const css::lang::EventObject& aEvent ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -397,19 +382,16 @@ void SAL_CALL DocumentStorageAccess::commited( const css::lang::EventObject& aEv } } -//-------------------------------------------------------------------------- void SAL_CALL DocumentStorageAccess::preRevert( const css::lang::EventObject& /*aEvent*/ ) throw (Exception, RuntimeException) { // not interested in } -//-------------------------------------------------------------------------- void SAL_CALL DocumentStorageAccess::reverted( const css::lang::EventObject& /*aEvent*/ ) throw (RuntimeException) { // not interested in } -//-------------------------------------------------------------------------- void SAL_CALL DocumentStorageAccess::disposing( const css::lang::EventObject& Source ) throw ( RuntimeException ) { OSL_ENSURE( Reference< XStorage >( Source.Source, UNO_QUERY ).is(), "DocumentStorageAccess::disposing: No storage? What's this?" ); @@ -432,7 +414,7 @@ void SAL_CALL DocumentStorageAccess::disposing( const css::lang::EventObject& So //= ODatabaseModelImpl //============================================================ DBG_NAME(ODatabaseModelImpl) -//-------------------------------------------------------------------------- + ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XMultiServiceFactory >& _rxFactory, ODatabaseContext& _rDBContext ) :m_xModel() ,m_xDataSource() @@ -465,7 +447,6 @@ ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XMultiServiceFactory >& impl_construct_nothrow(); } -//-------------------------------------------------------------------------- ODatabaseModelImpl::ODatabaseModelImpl( const ::rtl::OUString& _rRegistrationName, const Reference< XMultiServiceFactory >& _rxFactory, @@ -499,13 +480,11 @@ ODatabaseModelImpl::ODatabaseModelImpl( impl_construct_nothrow(); } -//-------------------------------------------------------------------------- ODatabaseModelImpl::~ODatabaseModelImpl() { DBG_DTOR(ODatabaseModelImpl,NULL); } -// ----------------------------------------------------------------------------- void ODatabaseModelImpl::impl_construct_nothrow() { // create the property bag to hold the settings (also known as "Info" property) @@ -566,10 +545,8 @@ void ODatabaseModelImpl::impl_construct_nothrow() m_pDBContext->appendAtTerminateListener(*this); } -// ----------------------------------------------------------------------------- namespace { - // ......................................................................... ::rtl::OUString lcl_getContainerStorageName_throw( ODatabaseModelImpl::ObjectType _eType ) { const sal_Char* pAsciiName( NULL ); @@ -585,7 +562,6 @@ namespace return ::rtl::OUString::createFromAscii( pAsciiName ); } - // ......................................................................... bool lcl_hasObjectWithMacros_throw( const ODefinitionContainer_Impl& _rObjectDefinitions, const Reference< XStorage >& _rxContainerStorage ) { bool bSomeDocHasMacros = false; @@ -614,7 +590,6 @@ namespace return bSomeDocHasMacros; } - // ......................................................................... bool lcl_hasObjectsWithMacros_nothrow( ODatabaseModelImpl& _rModel, const ODatabaseModelImpl::ObjectType _eType ) { bool bSomeDocHasMacros = false; @@ -648,7 +623,6 @@ namespace } } -// ----------------------------------------------------------------------------- bool ODatabaseModelImpl::objectHasMacros( const Reference< XStorage >& _rxContainerStorage, const ::rtl::OUString& _rPersistentName ) { OSL_PRECOND( _rxContainerStorage.is(), "ODatabaseModelImpl::objectHasMacros: this will crash!" ); @@ -671,7 +645,6 @@ bool ODatabaseModelImpl::objectHasMacros( const Reference< XStorage >& _rxContai return bHasMacros; } -// ----------------------------------------------------------------------------- void ODatabaseModelImpl::reset() { m_bReadOnly = sal_False; @@ -685,7 +658,7 @@ void ODatabaseModelImpl::reset() m_pStorageAccess = NULL; } } -// ----------------------------------------------------------------------------- + void SAL_CALL ODatabaseModelImpl::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(RuntimeException) { Reference<XConnection> xCon(Source.Source,UNO_QUERY); @@ -711,7 +684,7 @@ void SAL_CALL ODatabaseModelImpl::disposing( const ::com::sun::star::lang::Event OSL_ENSURE( false, "ODatabaseModelImpl::disposing: where does this come from?" ); } } -//------------------------------------------------------------------------------ + void ODatabaseModelImpl::clearConnections() { OWeakConnectionArray aConnections; @@ -738,7 +711,7 @@ void ODatabaseModelImpl::clearConnections() m_pSharedConnectionManager = NULL; m_xSharedConnectionManager = NULL; } -//------------------------------------------------------------------------------ + void ODatabaseModelImpl::dispose() { // dispose the data source and the model @@ -793,7 +766,7 @@ void ODatabaseModelImpl::dispose() m_pStorageAccess = NULL; } } -// ----------------------------------------------------------------------------- + const Reference< XNumberFormatsSupplier > & ODatabaseModelImpl::getNumberFormatsSupplier() { if (!m_xNumberFormatsSupplier.is()) @@ -810,14 +783,12 @@ const Reference< XNumberFormatsSupplier > & ODatabaseModelImpl::getNumberFormats return m_xNumberFormatsSupplier; } -// ----------------------------------------------------------------------------- void ODatabaseModelImpl::setDocFileLocation( const ::rtl::OUString& i_rLoadedFrom ) { ENSURE_OR_THROW( i_rLoadedFrom.getLength(), "invalid URL" ); m_sDocFileLocation = i_rLoadedFrom; } -// ----------------------------------------------------------------------------- void ODatabaseModelImpl::setResource( const ::rtl::OUString& i_rDocumentURL, const Sequence< PropertyValue >& _rArgs ) { ENSURE_OR_THROW( i_rDocumentURL.getLength(), "invalid URL" ); @@ -842,7 +813,6 @@ void ODatabaseModelImpl::setResource( const ::rtl::OUString& i_rDocumentURL, con impl_switchToLogicalURL( i_rDocumentURL ); } -// ----------------------------------------------------------------------------- ::comphelper::NamedValueCollection ODatabaseModelImpl::stripLoadArguments( const ::comphelper::NamedValueCollection& _rArguments ) { OSL_ENSURE( !_rArguments.has( "Model" ), "ODatabaseModelImpl::stripLoadArguments: this is suspicious (1)!" ); @@ -854,18 +824,16 @@ void ODatabaseModelImpl::setResource( const ::rtl::OUString& i_rDocumentURL, con return aMutableArgs; } -// ----------------------------------------------------------------------------- void ODatabaseModelImpl::disposeStorages() SAL_THROW(()) { getDocumentStorageAccess()->disposeStorages(); } -// ----------------------------------------------------------------------------- Reference< XSingleServiceFactory > ODatabaseModelImpl::createStorageFactory() const { return Reference< XSingleServiceFactory >( m_aContext.createComponent( "com.sun.star.embed.StorageFactory" ), UNO_QUERY_THROW ); } -// ----------------------------------------------------------------------------- + void ODatabaseModelImpl::commitRootStorage() { Reference< XStorage > xStorage( getOrCreateRootStorage() ); @@ -876,7 +844,7 @@ void ODatabaseModelImpl::commitRootStorage() OSL_ENSURE( bSuccess || !xStorage.is(), "ODatabaseModelImpl::commitRootStorage: could commit the storage!" ); } -// ----------------------------------------------------------------------------- + Reference< XStorage > ODatabaseModelImpl::getOrCreateRootStorage() { if ( !m_xDocumentStorage.is() ) @@ -925,7 +893,7 @@ Reference< XStorage > ODatabaseModelImpl::getOrCreateRootStorage() } return m_xDocumentStorage.getTyped(); } -// ----------------------------------------------------------------------------- + DocumentStorageAccess* ODatabaseModelImpl::getDocumentStorageAccess() { if ( !m_pStorageAccess ) @@ -936,7 +904,6 @@ DocumentStorageAccess* ODatabaseModelImpl::getDocumentStorageAccess() return m_pStorageAccess; } -// ----------------------------------------------------------------------------- void ODatabaseModelImpl::modelIsDisposing( const bool _wasInitialized, ResetModelAccess ) { m_xModel = Reference< XModel >(); @@ -950,19 +917,16 @@ void ODatabaseModelImpl::modelIsDisposing( const bool _wasInitialized, ResetMode m_bDocumentInitialized = _wasInitialized; } -// ----------------------------------------------------------------------------- Reference< XDocumentSubStorageSupplier > ODatabaseModelImpl::getDocumentSubStorageSupplier() { return getDocumentStorageAccess(); } -// ----------------------------------------------------------------------------- bool ODatabaseModelImpl::commitEmbeddedStorage( bool _bPreventRootCommits ) { return getDocumentStorageAccess()->commitEmbeddedStorage( _bPreventRootCommits ); } -// ----------------------------------------------------------------------------- bool ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference< XStorage >& _rxStorage ) SAL_THROW(()) { bool bSuccess = false; @@ -976,7 +940,7 @@ bool ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference< } return bSuccess; } -// ----------------------------------------------------------------------------- + void ODatabaseModelImpl::setModified( sal_Bool _bModified ) { if ( isModifyLocked() ) @@ -996,7 +960,6 @@ void ODatabaseModelImpl::setModified( sal_Bool _bModified ) } } -// ----------------------------------------------------------------------------- Reference<XDataSource> ODatabaseModelImpl::getOrCreateDataSource() { Reference<XDataSource> xDs = m_xDataSource; @@ -1007,12 +970,12 @@ Reference<XDataSource> ODatabaseModelImpl::getOrCreateDataSource() } return xDs; } -// ----------------------------------------------------------------------------- + Reference< XModel> ODatabaseModelImpl::getModel_noCreate() const { return m_xModel; } -// ----------------------------------------------------------------------------- + Reference< XModel > ODatabaseModelImpl::createNewModel_deliverOwnership( bool _bInitialize ) { Reference< XModel > xModel( m_xModel ); @@ -1062,12 +1025,12 @@ Reference< XModel > ODatabaseModelImpl::createNewModel_deliverOwnership( bool _b } return xModel; } -// ----------------------------------------------------------------------------- + oslInterlockedCount SAL_CALL ODatabaseModelImpl::acquire() { return osl_incrementInterlockedCount(&m_refCount); } -// ----------------------------------------------------------------------------- + oslInterlockedCount SAL_CALL ODatabaseModelImpl::release() { if ( osl_decrementInterlockedCount(&m_refCount) == 0 ) @@ -1082,19 +1045,17 @@ oslInterlockedCount SAL_CALL ODatabaseModelImpl::release() } return m_refCount; } -// ----------------------------------------------------------------------------- + void ODatabaseModelImpl::commitStorages() SAL_THROW(( IOException, RuntimeException )) { getDocumentStorageAccess()->commitStorages(); } -// ----------------------------------------------------------------------------- Reference< XStorage > ODatabaseModelImpl::getStorage( const ObjectType _eType, const sal_Int32 _nDesiredMode ) { return getDocumentStorageAccess()->getDocumentSubStorage( getObjectContainerStorageName( _eType ), _nDesiredMode ); } -// ----------------------------------------------------------------------------- const AsciiPropertyValue* ODatabaseModelImpl::getDefaultDataSourceSettings() { static const AsciiPropertyValue aKnownSettings[] = @@ -1168,13 +1129,12 @@ const AsciiPropertyValue* ODatabaseModelImpl::getDefaultDataSourceSettings() AsciiPropertyValue( "Reports", makeAny( ::rtl::OUString() ) ), AsciiPropertyValue( "KeyAlterationServiceName", makeAny( ::rtl::OUString() ) ), AsciiPropertyValue( "IndexAlterationServiceName", makeAny( ::rtl::OUString() ) ), - + AsciiPropertyValue() }; return aKnownSettings; } -// ----------------------------------------------------------------------------- TContentPtr& ODatabaseModelImpl::getObjectContainer( ObjectType _eType ) { OSL_PRECOND( _eType >= E_FORM && _eType <= E_TABLE, "ODatabaseModelImpl::getObjectContainer: illegal index!" ); @@ -1189,20 +1149,17 @@ TContentPtr& ODatabaseModelImpl::getObjectContainer( ObjectType _eType ) return rContentPtr; } -// ----------------------------------------------------------------------------- void ODatabaseModelImpl::revokeDataSource() const { if ( m_pDBContext && m_sDocumentURL.getLength() ) m_pDBContext->revokeDatabaseDocument( *this ); } -// ----------------------------------------------------------------------------- bool ODatabaseModelImpl::adjustMacroMode_AutoReject() { return m_aMacroMode.adjustMacroMode( NULL ); } -// ----------------------------------------------------------------------------- bool ODatabaseModelImpl::checkMacrosOnLoading() { Reference< XInteractionHandler > xInteraction; @@ -1210,13 +1167,11 @@ bool ODatabaseModelImpl::checkMacrosOnLoading() return m_aMacroMode.checkMacrosOnLoading( xInteraction ); } -// ----------------------------------------------------------------------------- void ODatabaseModelImpl::resetMacroExecutionMode() { m_aMacroMode = ::sfx2::DocumentMacroMode( *this ); } -// ----------------------------------------------------------------------------- Reference< XStorageBasedLibraryContainer > ODatabaseModelImpl::getLibraryContainer( bool _bScript ) { Reference< XStorageBasedLibraryContainer >& rxContainer( _bScript ? m_xBasicLibraries : m_xDialogLibraries ); @@ -1252,7 +1207,6 @@ Reference< XStorageBasedLibraryContainer > ODatabaseModelImpl::getLibraryContain return rxContainer; } -// ----------------------------------------------------------------------------- void ODatabaseModelImpl::storeLibraryContainersTo( const Reference< XStorage >& _rxToRootStorage ) { if ( m_xBasicLibraries.is() ) @@ -1262,7 +1216,6 @@ void ODatabaseModelImpl::storeLibraryContainersTo( const Reference< XStorage >& m_xDialogLibraries->storeLibrariesToStorage( _rxToRootStorage ); } -// ----------------------------------------------------------------------------- Reference< XStorage > ODatabaseModelImpl::switchToStorage( const Reference< XStorage >& _rxNewRootStorage ) { if ( !_rxNewRootStorage.is() ) @@ -1271,7 +1224,6 @@ Reference< XStorage > ODatabaseModelImpl::switchToStorage( const Reference< XSto return impl_switchToStorage_throw( _rxNewRootStorage ); } -// ----------------------------------------------------------------------------- namespace { void lcl_modifyListening( ::sfx2::IModifiableDocument& _rDocument, @@ -1300,7 +1252,6 @@ namespace } } -// ----------------------------------------------------------------------------- namespace { static void lcl_rebaseScriptStorage_throw( const Reference< XStorageBasedLibraryContainer >& _rxContainer, @@ -1316,7 +1267,6 @@ namespace } } -// ----------------------------------------------------------------------------- Reference< XStorage > ODatabaseModelImpl::impl_switchToStorage_throw( const Reference< XStorage >& _rxNewRootStorage ) { // stop listening for modifications at the old storage @@ -1338,7 +1288,6 @@ Reference< XStorage > ODatabaseModelImpl::impl_switchToStorage_throw( const Refe return m_xDocumentStorage.getTyped(); } -// ----------------------------------------------------------------------------- void ODatabaseModelImpl::impl_switchToLogicalURL( const ::rtl::OUString& i_rDocumentURL ) { if ( i_rDocumentURL == m_sDocumentURL ) @@ -1375,13 +1324,11 @@ void ODatabaseModelImpl::impl_switchToLogicalURL( const ::rtl::OUString& i_rDocu } } -// ----------------------------------------------------------------------------- ::rtl::OUString ODatabaseModelImpl::getObjectContainerStorageName( const ObjectType _eType ) { return lcl_getContainerStorageName_throw( _eType ); } -// ----------------------------------------------------------------------------- sal_Int16 ODatabaseModelImpl::getCurrentMacroExecMode() const { sal_Int16 nCurrentMode = MacroExecMode::NEVER_EXECUTE; @@ -1396,14 +1343,12 @@ sal_Int16 ODatabaseModelImpl::getCurrentMacroExecMode() const return nCurrentMode; } -// ----------------------------------------------------------------------------- sal_Bool ODatabaseModelImpl::setCurrentMacroExecMode( sal_uInt16 nMacroMode ) { m_aMediaDescriptor.put( "MacroExecutionMode", nMacroMode ); return sal_True; } -// ----------------------------------------------------------------------------- ::rtl::OUString ODatabaseModelImpl::getDocumentLocation() const { return getURL(); @@ -1415,7 +1360,6 @@ sal_Bool ODatabaseModelImpl::setCurrentMacroExecMode( sal_uInt16 nMacroMode ) // this folder is considered to be secure. So, the document URL needs to be used to decide about the security. } -// ----------------------------------------------------------------------------- Reference< XStorage > ODatabaseModelImpl::getZipStorageToSign() { // we do not support signing the scripting storages, so we're allowed to @@ -1423,7 +1367,6 @@ Reference< XStorage > ODatabaseModelImpl::getZipStorageToSign() return Reference< XStorage >(); } -// ----------------------------------------------------------------------------- ODatabaseModelImpl::EmbeddedMacros ODatabaseModelImpl::determineEmbeddedMacros() { if ( !m_aEmbeddedMacros ) @@ -1446,59 +1389,48 @@ ODatabaseModelImpl::EmbeddedMacros ODatabaseModelImpl::determineEmbeddedMacros() return *m_aEmbeddedMacros; } -// ----------------------------------------------------------------------------- sal_Bool ODatabaseModelImpl::documentStorageHasMacros() const { const_cast< ODatabaseModelImpl* >( this )->determineEmbeddedMacros(); return ( *m_aEmbeddedMacros != eNoMacros ); } -// ----------------------------------------------------------------------------- Reference< XEmbeddedScripts > ODatabaseModelImpl::getEmbeddedDocumentScripts() const { return Reference< XEmbeddedScripts >( getModel_noCreate(), UNO_QUERY ); } -// ----------------------------------------------------------------------------- sal_Int16 ODatabaseModelImpl::getScriptingSignatureState() { // no support for signatures at the moment return SIGNATURESTATE_NOSIGNATURES; } -// ----------------------------------------------------------------------------- sal_Bool ODatabaseModelImpl::hasTrustedScriptingSignature( sal_Bool /*bAllowUIToAddAuthor*/ ) { // no support for signatures at the moment return sal_False; } -// ----------------------------------------------------------------------------- void ODatabaseModelImpl::showBrokenSignatureWarning( const Reference< XInteractionHandler >& /*_rxInteraction*/ ) const { OSL_ENSURE( false, "ODatabaseModelImpl::showBrokenSignatureWarning: signatures can't be broken - we do not support them!" ); } -// ----------------------------------------------------------------------------- void ODatabaseModelImpl::storageIsModified() { setModified( sal_True ); } -// ----------------------------------------------------------------------------- ModelDependentComponent::ModelDependentComponent( const ::rtl::Reference< ODatabaseModelImpl >& _model ) :m_pImpl( _model ) ,m_aMutex( _model->getSharedMutex() ) { } -// ----------------------------------------------------------------------------- ModelDependentComponent::~ModelDependentComponent() { } -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/ModelImpl.hxx b/dbaccess/source/core/dataaccess/ModelImpl.hxx index 36fdc427e..c461dbbf3 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.hxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -148,7 +148,7 @@ public: VosMutexFacade( ::osl::Mutex& _rMutex ); // IMutex - virtual void SAL_CALL acquire(); + virtual void SAL_CALL acquire(); virtual sal_Bool SAL_CALL tryToAcquire(); virtual void SAL_CALL release(); @@ -479,7 +479,7 @@ public: if any of the invoked operations does so */ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > - switchToStorage( + switchToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxNewRootStorage ); diff --git a/dbaccess/source/core/dataaccess/SharedConnection.cxx b/dbaccess/source/core/dataaccess/SharedConnection.cxx index 88a16ffe0..eaa262864 100644 --- a/dbaccess/source/core/dataaccess/SharedConnection.cxx +++ b/dbaccess/source/core/dataaccess/SharedConnection.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,140 +45,124 @@ DBG_NAME(OSharedConnection) OSharedConnection::OSharedConnection(Reference< XAggregation >& _rxProxyConnection) : OSharedConnection_BASE(m_aMutex) { - DBG_CTOR(OSharedConnection,NULL); + DBG_CTOR(OSharedConnection,NULL); setDelegation(_rxProxyConnection,m_refCount); } -// ----------------------------------------------------------------------------- + OSharedConnection::~OSharedConnection() { - DBG_DTOR(OSharedConnection,NULL); + DBG_DTOR(OSharedConnection,NULL); } -// ----------------------------------------------------------------------------- + void SAL_CALL OSharedConnection::disposing(void) { OSharedConnection_BASE::disposing(); OConnectionWrapper::disposing(); } -// ----------------------------------------------------------------------------- + Reference< XStatement > SAL_CALL OSharedConnection::createStatement( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(rBHelper.bDisposed); - return m_xConnection->createStatement(); } -// -------------------------------------------------------------------------------- + Reference< XPreparedStatement > SAL_CALL OSharedConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(rBHelper.bDisposed); - return m_xConnection->prepareStatement(sql); } -// -------------------------------------------------------------------------------- + Reference< XPreparedStatement > SAL_CALL OSharedConnection::prepareCall( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(rBHelper.bDisposed); - return m_xConnection->prepareCall(sql); } -// -------------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL OSharedConnection::nativeSQL( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(rBHelper.bDisposed); - return m_xConnection->nativeSQL(sql); } -// -------------------------------------------------------------------------------- + sal_Bool SAL_CALL OSharedConnection::getAutoCommit( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(rBHelper.bDisposed); - return m_xConnection->getAutoCommit(); } -// -------------------------------------------------------------------------------- + void SAL_CALL OSharedConnection::commit( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(rBHelper.bDisposed); - m_xConnection->commit(); } -// -------------------------------------------------------------------------------- + void SAL_CALL OSharedConnection::rollback( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(rBHelper.bDisposed); - m_xConnection->rollback(); } -// -------------------------------------------------------------------------------- + sal_Bool SAL_CALL OSharedConnection::isClosed( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - + return m_xConnection->isClosed(); } -// -------------------------------------------------------------------------------- + Reference< XDatabaseMetaData > SAL_CALL OSharedConnection::getMetaData( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(rBHelper.bDisposed); - + return m_xConnection->getMetaData(); } -// -------------------------------------------------------------------------------- + sal_Bool SAL_CALL OSharedConnection::isReadOnly( ) throw(SQLException, RuntimeException) -{ +{ ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(rBHelper.bDisposed); - return m_xConnection->isReadOnly(); } -// -------------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL OSharedConnection::getCatalog( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(rBHelper.bDisposed); - return m_xConnection->getCatalog(); } -// -------------------------------------------------------------------------------- + sal_Int32 SAL_CALL OSharedConnection::getTransactionIsolation( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(rBHelper.bDisposed); - return m_xConnection->getTransactionIsolation(); } -// -------------------------------------------------------------------------------- + Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OSharedConnection::getTypeMap( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(rBHelper.bDisposed); - return m_xConnection->getTypeMap(); } -// ----------------------------------------------------------------------------- -//........................................................................ } // namespace dbaccess -//........................................................................ - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/SharedConnection.hxx b/dbaccess/source/core/dataaccess/SharedConnection.hxx index 8f7ca35b2..fc6bbf0be 100644 --- a/dbaccess/source/core/dataaccess/SharedConnection.hxx +++ b/dbaccess/source/core/dataaccess/SharedConnection.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -71,10 +71,10 @@ namespace dbaccess virtual void SAL_CALL release() throw() { OSharedConnection_BASE::release(); } virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException) { - return ::comphelper::concatSequences( - OSharedConnection_BASE::getTypes(), + return ::comphelper::concatSequences( + OSharedConnection_BASE::getTypes(), OSharedConnection_BASE2::getTypes() - ); + ); } virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException) @@ -84,21 +84,20 @@ namespace dbaccess aReturn = OSharedConnection_BASE2::queryInterface(_rType); return aReturn; } - // -------------------------------------------------------------------------------- + // XCloseable virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { { ::osl::MutexGuard aGuard( m_aMutex ); ::connectivity::checkDisposed(rBHelper.bDisposed); - } dispose(); } // XConnection virtual void SAL_CALL setAutoCommit( sal_Bool /*autoCommit*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) - { + { throw ::com::sun::star::sdbc::SQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("This call is not allowed when sharing connections.")),*this,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S10000")),0,::com::sun::star::uno::Any()); } virtual void SAL_CALL setReadOnly( sal_Bool /*readOnly*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) @@ -132,13 +131,11 @@ namespace dbaccess virtual sal_Int32 SAL_CALL getTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); }; - + #ifdef IMPLEMENT_GET_IMPLEMENTATION_ID IMPLEMENT_GET_IMPLEMENTATION_ID( OSharedConnection ); #endif -//........................................................................ -} // namespace dbaccess -//........................................................................ -#endif // DBA_CORE_SHARED_CONNECTION_HXX +} // namespace dbaccess +#endif // DBA_CORE_SHARED_CONNECTION_HXX diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx index d908961dc..9caf1a583 100644 --- a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx +++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,16 +50,14 @@ using namespace ::osl; using namespace ::comphelper; using namespace ::cppu; -//........................................................................ namespace dbaccess { -//........................................................................ //========================================================================== //= OBookmarkContainer //========================================================================== DBG_NAME(OBookmarkContainer) -//-------------------------------------------------------------------------- + OBookmarkContainer::OBookmarkContainer(OWeakObject& _rParent, Mutex& _rMutex) :m_rParent(_rParent) ,m_aContainerListeners(_rMutex) @@ -68,7 +66,6 @@ OBookmarkContainer::OBookmarkContainer(OWeakObject& _rParent, Mutex& _rMutex) DBG_CTOR(OBookmarkContainer, NULL); } -//-------------------------------------------------------------------------- void OBookmarkContainer::dispose() { MutexGuard aGuard(m_rMutex); @@ -82,32 +79,27 @@ void OBookmarkContainer::dispose() m_aBookmarks.clear(); } -//-------------------------------------------------------------------------- void SAL_CALL OBookmarkContainer::acquire( ) throw() { m_rParent.acquire(); } -//-------------------------------------------------------------------------- void SAL_CALL OBookmarkContainer::release( ) throw() { m_rParent.release(); } -//-------------------------------------------------------------------------- OBookmarkContainer::~OBookmarkContainer() { DBG_DTOR(OBookmarkContainer, NULL); } // XServiceInfo -//-------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OBookmarkContainer::getImplementationName( ) throw(RuntimeException) { return ::rtl::OUString::createFromAscii("com.sun.star.comp.dba.OBookmarkContainer"); } -//-------------------------------------------------------------------------- sal_Bool SAL_CALL OBookmarkContainer::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) { MutexGuard aGuard(m_rMutex); @@ -115,7 +107,6 @@ sal_Bool SAL_CALL OBookmarkContainer::supportsService( const ::rtl::OUString& _r return findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -//-------------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL OBookmarkContainer::getSupportedServiceNames( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aReturn(1); @@ -124,7 +115,6 @@ Sequence< ::rtl::OUString > SAL_CALL OBookmarkContainer::getSupportedServiceName } // XNameContainer -//-------------------------------------------------------------------------- void SAL_CALL OBookmarkContainer::insertByName( const ::rtl::OUString& _rName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) { MutexGuard aGuard(m_rMutex); @@ -154,7 +144,6 @@ void SAL_CALL OBookmarkContainer::insertByName( const ::rtl::OUString& _rName, c } } -//-------------------------------------------------------------------------- void SAL_CALL OBookmarkContainer::removeByName( const ::rtl::OUString& _rName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) { ::rtl::OUString sOldBookmark; @@ -187,7 +176,6 @@ void SAL_CALL OBookmarkContainer::removeByName( const ::rtl::OUString& _rName ) } // XNameReplace -//-------------------------------------------------------------------------- void SAL_CALL OBookmarkContainer::replaceByName( const ::rtl::OUString& _rName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) { ClearableMutexGuard aGuard(m_rMutex); @@ -223,7 +211,6 @@ void SAL_CALL OBookmarkContainer::replaceByName( const ::rtl::OUString& _rName, } } -//-------------------------------------------------------------------------- void SAL_CALL OBookmarkContainer::addContainerListener( const Reference< XContainerListener >& _rxListener ) throw(RuntimeException) { MutexGuard aGuard(m_rMutex); @@ -231,7 +218,6 @@ void SAL_CALL OBookmarkContainer::addContainerListener( const Reference< XContai m_aContainerListeners.addInterface(_rxListener); } -//-------------------------------------------------------------------------- void SAL_CALL OBookmarkContainer::removeContainerListener( const Reference< XContainerListener >& _rxListener ) throw(RuntimeException) { MutexGuard aGuard(m_rMutex); @@ -240,7 +226,6 @@ void SAL_CALL OBookmarkContainer::removeContainerListener( const Reference< XCon } // XElementAccess -//-------------------------------------------------------------------------- Type SAL_CALL OBookmarkContainer::getElementType( ) throw (RuntimeException) { MutexGuard aGuard(m_rMutex); @@ -248,7 +233,6 @@ Type SAL_CALL OBookmarkContainer::getElementType( ) throw (RuntimeException) return ::getCppuType( static_cast< ::rtl::OUString* >(NULL) ); } -//-------------------------------------------------------------------------- sal_Bool SAL_CALL OBookmarkContainer::hasElements( ) throw (RuntimeException) { MutexGuard aGuard(m_rMutex); @@ -257,7 +241,6 @@ sal_Bool SAL_CALL OBookmarkContainer::hasElements( ) throw (RuntimeException) } // XEnumerationAccess -//-------------------------------------------------------------------------- Reference< XEnumeration > SAL_CALL OBookmarkContainer::createEnumeration( ) throw(RuntimeException) { MutexGuard aGuard(m_rMutex); @@ -265,7 +248,6 @@ Reference< XEnumeration > SAL_CALL OBookmarkContainer::createEnumeration( ) thr return new ::comphelper::OEnumerationByIndex(static_cast<XIndexAccess*>(this)); } -//-------------------------------------------------------------------------- // XIndexAccess sal_Int32 SAL_CALL OBookmarkContainer::getCount( ) throw(RuntimeException) { @@ -274,7 +256,6 @@ sal_Int32 SAL_CALL OBookmarkContainer::getCount( ) throw(RuntimeException) return m_aBookmarks.size(); } -//-------------------------------------------------------------------------- Any SAL_CALL OBookmarkContainer::getByIndex( sal_Int32 _nIndex ) throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException) { MutexGuard aGuard(m_rMutex); @@ -286,7 +267,6 @@ Any SAL_CALL OBookmarkContainer::getByIndex( sal_Int32 _nIndex ) throw(IndexOutO return makeAny(m_aBookmarksIndexed[_nIndex]->second); } -//-------------------------------------------------------------------------- Any SAL_CALL OBookmarkContainer::getByName( const ::rtl::OUString& _rName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) { MutexGuard aGuard(m_rMutex); @@ -298,7 +278,6 @@ Any SAL_CALL OBookmarkContainer::getByName( const ::rtl::OUString& _rName ) thro return makeAny(m_aBookmarks[_rName]); } -//-------------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL OBookmarkContainer::getElementNames( ) throw(RuntimeException) { MutexGuard aGuard(m_rMutex); @@ -318,7 +297,6 @@ Sequence< ::rtl::OUString > SAL_CALL OBookmarkContainer::getElementNames( ) thr return aNames; } -//-------------------------------------------------------------------------- sal_Bool SAL_CALL OBookmarkContainer::hasByName( const ::rtl::OUString& _rName ) throw(RuntimeException) { MutexGuard aGuard(m_rMutex); @@ -327,7 +305,6 @@ sal_Bool SAL_CALL OBookmarkContainer::hasByName( const ::rtl::OUString& _rName ) return checkExistence(_rName); } -//-------------------------------------------------------------------------- void OBookmarkContainer::implRemove(const ::rtl::OUString& _rName) { MutexGuard aGuard(m_rMutex); @@ -360,7 +337,6 @@ void OBookmarkContainer::implRemove(const ::rtl::OUString& _rName) m_aBookmarks.erase(aMapPos); } -//-------------------------------------------------------------------------- void OBookmarkContainer::implAppend(const ::rtl::OUString& _rName, const ::rtl::OUString& _rDocumentLocation) { MutexGuard aGuard(m_rMutex); @@ -369,7 +345,6 @@ void OBookmarkContainer::implAppend(const ::rtl::OUString& _rName, const ::rtl:: m_aBookmarksIndexed.push_back(m_aBookmarks.insert( MapString2String::value_type(_rName,_rDocumentLocation)).first); } -//-------------------------------------------------------------------------- void OBookmarkContainer::implReplace(const ::rtl::OUString& _rName, const ::rtl::OUString& _rNewLink) { MutexGuard aGuard(m_rMutex); @@ -378,25 +353,19 @@ void OBookmarkContainer::implReplace(const ::rtl::OUString& _rName, const ::rtl: m_aBookmarks[_rName] = _rNewLink; } -//-------------------------------------------------------------------------- void OBookmarkContainer::checkValid(sal_Bool /*_bIntendWriteAccess*/) const throw (RuntimeException, DisposedException) { } -//-------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OBookmarkContainer::getParent( ) throw (RuntimeException) { return m_rParent; } -//-------------------------------------------------------------------------- void SAL_CALL OBookmarkContainer::setParent( const Reference< XInterface >& /*Parent*/ ) throw (NoSupportException, RuntimeException) { throw NoSupportException(); } -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx index 69a9bff1c..e1cdda77f 100644 --- a/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx +++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,10 +42,8 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/DisposedException.hpp> -//........................................................................ namespace dbaccess { -//........................................................................ //========================================================================== //= OBookmarkContainer - base class of collections of database definition @@ -68,7 +66,7 @@ protected: DECLARE_STL_VECTOR(MapString2StringIterator, MapIteratorVector); MapString2String m_aBookmarks; // the bookmarks itself - MapIteratorVector m_aBookmarksIndexed; // for index access to the + MapIteratorVector m_aBookmarksIndexed; // for index access to the protected: ::cppu::OWeakObject& m_rParent; // for the ref counting @@ -168,15 +166,11 @@ protected: }; -//-------------------------------------------------------------------------- inline sal_Bool OBookmarkContainer::checkExistence(const ::rtl::OUString& _rName) { return m_aBookmarks.find(_rName) != m_aBookmarks.end(); } -//........................................................................ } // namespace dbaccess -//........................................................................ #endif // _DBA_CORE_BOOKMARKCONTAINER_HXX_ - diff --git a/dbaccess/source/core/dataaccess/commandcontainer.cxx b/dbaccess/source/core/dataaccess/commandcontainer.cxx index 094e626a8..3394cd0f0 100644 --- a/dbaccess/source/core/dataaccess/commandcontainer.cxx +++ b/dbaccess/source/core/dataaccess/commandcontainer.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,35 +44,33 @@ using namespace ::osl; using namespace ::comphelper; using namespace ::cppu; -//........................................................................ namespace dbaccess { -//........................................................................ //========================================================================== //= OCommandContainer //========================================================================== DBG_NAME(OCommandContainer) -//-------------------------------------------------------------------------- + OCommandContainer::OCommandContainer( const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB ,const Reference< XInterface >& _xParentContainer ,const TContentPtr& _pImpl ,sal_Bool _bTables - ) + ) :ODefinitionContainer(_xORB,_xParentContainer,_pImpl,!_bTables) ,m_bTables(_bTables) { DBG_CTOR(OCommandContainer, NULL); } -//-------------------------------------------------------------------------- + OCommandContainer::~OCommandContainer() { DBG_DTOR(OCommandContainer, NULL); } -// ----------------------------------------------------------------------------- + IMPLEMENT_FORWARD_XINTERFACE2( OCommandContainer,ODefinitionContainer,OCommandContainer_BASE) IMPLEMENT_TYPEPROVIDER2(OCommandContainer,ODefinitionContainer,OCommandContainer_BASE); -//-------------------------------------------------------------------------- + Reference< XContent > OCommandContainer::createObject( const ::rtl::OUString& _rName) { const ODefinitionContainer_Impl& rDefinitions( getDefinitions() ); @@ -84,26 +82,20 @@ Reference< XContent > OCommandContainer::createObject( const ::rtl::OUString& _r return new OCommandDefinition( *this, _rName, m_aContext.getLegacyServiceFactory(), pElementContent ); } -// ----------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OCommandContainer::createInstanceWithArguments(const Sequence< Any >& /*aArguments*/ ) throw (Exception, RuntimeException) { return createInstance( ); } -// ----------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OCommandContainer::createInstance( ) throw (Exception, RuntimeException) { return m_aContext.createComponent( (::rtl::OUString)( m_bTables ? SERVICE_SDB_TABLEDEFINITION : SERVICE_SDB_COMMAND_DEFINITION ) ); } -// ----------------------------------------------------------------------------- ::rtl::OUString OCommandContainer::determineContentType() const { return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/vnd.org.openoffice.DatabaseCommandDefinitionContainer" ) ); } -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/commandcontainer.hxx b/dbaccess/source/core/dataaccess/commandcontainer.hxx index 74a3d5abf..2fc2f6d0e 100644 --- a/dbaccess/source/core/dataaccess/commandcontainer.hxx +++ b/dbaccess/source/core/dataaccess/commandcontainer.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,10 +34,8 @@ #include <cppuhelper/implbase1.hxx> -//........................................................................ namespace dbaccess { -//........................................................................ //========================================================================== //= OCommandContainer //========================================================================== @@ -78,10 +76,7 @@ protected: virtual ::rtl::OUString determineContentType() const; }; -//........................................................................ } // namespace dbaccess -//........................................................................ - -#endif // _DBA_COREDATAACCESS_COMMANDCONTAINER_HXX_ +#endif // _DBA_COREDATAACCESS_COMMANDCONTAINER_HXX_ diff --git a/dbaccess/source/core/dataaccess/commanddefinition.cxx b/dbaccess/source/core/dataaccess/commanddefinition.cxx index 44ebd608e..6cfd92315 100644 --- a/dbaccess/source/core/dataaccess/commanddefinition.cxx +++ b/dbaccess/source/core/dataaccess/commanddefinition.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,10 +50,8 @@ using namespace ::osl; using namespace ::comphelper; using namespace ::cppu; -//........................................................................ namespace dbaccess { -//........................................................................ //========================================================================== //= OCommandDefinition @@ -63,9 +61,8 @@ extern "C" void SAL_CALL createRegistryInfo_OCommandDefinition() static ::dba::OAutoRegistration< OCommandDefinition > aAutoRegistration; } -//-------------------------------------------------------------------------- DBG_NAME(OCommandDefinition) -//-------------------------------------------------------------------------- + void OCommandDefinition::registerProperties() { OCommandDefinition_Impl& rCommandDefinition( getCommandDefinition() ); @@ -87,22 +84,20 @@ void OCommandDefinition::registerProperties() &rCommandDefinition.m_aLayoutInformation, ::getCppuType(&rCommandDefinition.m_aLayoutInformation)); } -//-------------------------------------------------------------------------- OCommandDefinition::OCommandDefinition(const Reference< XMultiServiceFactory >& _xORB ,const Reference< XInterface >& _rxContainer - ,const TContentPtr& _pImpl) + ,const TContentPtr& _pImpl) :OComponentDefinition(_xORB,_rxContainer,_pImpl,sal_False) { DBG_CTOR(OCommandDefinition, NULL); registerProperties(); } -//-------------------------------------------------------------------------- + OCommandDefinition::~OCommandDefinition() { DBG_DTOR(OCommandDefinition, NULL); } -//-------------------------------------------------------------------------- OCommandDefinition::OCommandDefinition( const Reference< XInterface >& _rxContainer ,const ::rtl::OUString& _rElementName ,const Reference< XMultiServiceFactory >& _xORB @@ -113,24 +108,21 @@ OCommandDefinition::OCommandDefinition( const Reference< XInterface >& _rxContai registerProperties(); } -//-------------------------------------------------------------------------- IMPLEMENT_IMPLEMENTATION_ID(OCommandDefinition); IMPLEMENT_GETTYPES2(OCommandDefinition,OCommandDefinition_Base,OComponentDefinition); IMPLEMENT_FORWARD_XINTERFACE2( OCommandDefinition,OComponentDefinition,OCommandDefinition_Base) IMPLEMENT_PROPERTYCONTAINER_DEFAULTS2(OCommandDefinition,OCommandDefinition_PROP) -//-------------------------------------------------------------------------- + ::rtl::OUString OCommandDefinition::getImplementationName_static( ) throw(RuntimeException) { return ::rtl::OUString::createFromAscii("com.sun.star.comp.dba.OCommandDefinition"); } -//-------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OCommandDefinition::getImplementationName( ) throw(RuntimeException) { return getImplementationName_static(); } -//-------------------------------------------------------------------------- Sequence< ::rtl::OUString > OCommandDefinition::getSupportedServiceNames_static( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aServices(3); @@ -140,20 +132,17 @@ Sequence< ::rtl::OUString > OCommandDefinition::getSupportedServiceNames_static( return aServices; } -//-------------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL OCommandDefinition::getSupportedServiceNames( ) throw(RuntimeException) { return getSupportedServiceNames_static(); } -//------------------------------------------------------------------------------ Reference< XInterface > OCommandDefinition::Create(const Reference< XComponentContext >& _rxContext) { ::comphelper::ComponentContext aContext( _rxContext ); return *(new OCommandDefinition( aContext.getLegacyServiceFactory(), NULL, TContentPtr( new OCommandDefinition_Impl ) ) ); } -// ----------------------------------------------------------------------------- void SAL_CALL OCommandDefinition::rename( const ::rtl::OUString& newName ) throw (SQLException, ElementExistException, RuntimeException) { try @@ -173,9 +162,6 @@ void SAL_CALL OCommandDefinition::rename( const ::rtl::OUString& newName ) throw throw ElementExistException(newName,*this); } } -// ----------------------------------------------------------------------------- -//........................................................................ -} // namespace dbaccess -//........................................................................ +} // namespace dbaccess /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/commanddefinition.hxx b/dbaccess/source/core/dataaccess/commanddefinition.hxx index 0aee88c3e..e5b43bcd8 100644 --- a/dbaccess/source/core/dataaccess/commanddefinition.hxx +++ b/dbaccess/source/core/dataaccess/commanddefinition.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -59,8 +59,7 @@ typedef ::cppu::ImplHelper1 < ::com::sun::star::sdbcx::XRename > OCommandDefinition_Base; class OCommandDefinition; typedef ::comphelper::OPropertyArrayUsageHelper< OCommandDefinition > - OCommandDefinition_PROP; - + OCommandDefinition_PROP; class OCommandDefinition :public OComponentDefinition ,public OCommandDefinition_Base diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx index 09e064575..490d0c47f 100644 --- a/dbaccess/source/core/dataaccess/connection.cxx +++ b/dbaccess/source/core/dataaccess/connection.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -80,27 +80,23 @@ using ::com::sun::star::sdb::tools::XTableName; using ::com::sun::star::sdb::tools::XObjectNames; using ::com::sun::star::sdb::tools::XDataSourceMetaData; -//........................................................................ namespace dbaccess { -//........................................................................ //========================================================================== // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString OConnection::getImplementationName( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getImplementationName" ); return rtl::OUString::createFromAscii("com.sun.star.comp.dbaccess.Connection"); } -//------------------------------------------------------------------------------ + sal_Bool OConnection::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::supportsService" ); return findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > OConnection::getSupportedServiceNames( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getSupportedServiceNames" ); @@ -117,7 +113,6 @@ Sequence< ::rtl::OUString > OConnection::getSupportedServiceNames( ) throw (Run } // XCloseable -//------------------------------------------------------------------------------ void OConnection::close(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::close" ); @@ -125,7 +120,6 @@ void OConnection::close(void) throw( SQLException, RuntimeException ) dispose(); } -//------------------------------------------------------------------------------ sal_Bool OConnection::isClosed(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::isClosed" ); @@ -134,7 +128,6 @@ sal_Bool OConnection::isClosed(void) throw( SQLException, RuntimeException ) } // XConnection -//------------------------------------------------------------------------------ Reference< XStatement > OConnection::createStatement(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::createStatement" ); @@ -150,7 +143,6 @@ Reference< XStatement > OConnection::createStatement(void) throw( SQLException, } return xStatement; } -//------------------------------------------------------------------------------ Reference< XPreparedStatement > OConnection::prepareStatement(const rtl::OUString& sql) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::prepareStatement" ); @@ -168,7 +160,6 @@ Reference< XPreparedStatement > OConnection::prepareStatement(const rtl::OUStri return xStatement; } -//------------------------------------------------------------------------------ Reference< XPreparedStatement > OConnection::prepareCall(const rtl::OUString& sql) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::prepareCall" ); @@ -185,7 +176,6 @@ Reference< XPreparedStatement > OConnection::prepareCall(const rtl::OUString& s return xStatement; } -//------------------------------------------------------------------------------ rtl::OUString OConnection::nativeSQL(const rtl::OUString& sql) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::nativeSQL" ); @@ -194,7 +184,6 @@ rtl::OUString OConnection::nativeSQL(const rtl::OUString& sql) throw( SQLExcepti return m_xMasterConnection->nativeSQL(sql); } -//------------------------------------------------------------------------------ void OConnection::setAutoCommit(sal_Bool autoCommit) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::setAutoCommit" ); @@ -203,7 +192,6 @@ void OConnection::setAutoCommit(sal_Bool autoCommit) throw( SQLException, Runtim m_xMasterConnection->setAutoCommit(autoCommit); } -//------------------------------------------------------------------------------ sal_Bool OConnection::getAutoCommit(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getAutoCommit" ); @@ -212,7 +200,6 @@ sal_Bool OConnection::getAutoCommit(void) throw( SQLException, RuntimeException return m_xMasterConnection->getAutoCommit(); } -//------------------------------------------------------------------------------ void OConnection::commit(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::commit" ); @@ -221,7 +208,6 @@ void OConnection::commit(void) throw( SQLException, RuntimeException ) m_xMasterConnection->commit(); } -//------------------------------------------------------------------------------ void OConnection::rollback(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::rollback" ); @@ -230,7 +216,6 @@ void OConnection::rollback(void) throw( SQLException, RuntimeException ) m_xMasterConnection->rollback(); } -//------------------------------------------------------------------------------ Reference< XDatabaseMetaData > OConnection::getMetaData(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getMetaData" ); @@ -239,7 +224,6 @@ Reference< XDatabaseMetaData > OConnection::getMetaData(void) throw( SQLExcepti return m_xMasterConnection->getMetaData(); } -//------------------------------------------------------------------------------ void OConnection::setReadOnly(sal_Bool readOnly) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::setReadOnly" ); @@ -248,7 +232,6 @@ void OConnection::setReadOnly(sal_Bool readOnly) throw( SQLException, RuntimeExc m_xMasterConnection->setReadOnly(readOnly); } -//------------------------------------------------------------------------------ sal_Bool OConnection::isReadOnly(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::isReadOnly" ); @@ -257,7 +240,6 @@ sal_Bool OConnection::isReadOnly(void) throw( SQLException, RuntimeException ) return m_xMasterConnection->isReadOnly(); } -//------------------------------------------------------------------------------ void OConnection::setCatalog(const rtl::OUString& catalog) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::setCatalog" ); @@ -266,7 +248,6 @@ void OConnection::setCatalog(const rtl::OUString& catalog) throw( SQLException, m_xMasterConnection->setCatalog(catalog); } -//------------------------------------------------------------------------------ rtl::OUString OConnection::getCatalog(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getCatalog" ); @@ -275,7 +256,6 @@ rtl::OUString OConnection::getCatalog(void) throw( SQLException, RuntimeExceptio return m_xMasterConnection->getCatalog(); } -//------------------------------------------------------------------------------ void OConnection::setTransactionIsolation(sal_Int32 level) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::setTransactionIsolation" ); @@ -284,7 +264,6 @@ void OConnection::setTransactionIsolation(sal_Int32 level) throw( SQLException, m_xMasterConnection->setTransactionIsolation(level); } -//------------------------------------------------------------------------------ sal_Int32 OConnection::getTransactionIsolation(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getTransactionIsolation" ); @@ -293,7 +272,6 @@ sal_Int32 OConnection::getTransactionIsolation(void) throw( SQLException, Runtim return m_xMasterConnection->getTransactionIsolation(); } -//------------------------------------------------------------------------------ Reference< XNameAccess > OConnection::getTypeMap(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getTypeMap" ); @@ -302,7 +280,6 @@ Reference< XNameAccess > OConnection::getTypeMap(void) throw( SQLException, Run return m_xMasterConnection->getTypeMap(); } -//------------------------------------------------------------------------------ void OConnection::setTypeMap(const Reference< XNameAccess > & typeMap) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::setTypeMap" ); @@ -314,7 +291,7 @@ void OConnection::setTypeMap(const Reference< XNameAccess > & typeMap) throw( SQ //= OConnection //========================================================================== DBG_NAME(OConnection) -//-------------------------------------------------------------------------- + OConnection::OConnection(ODatabaseSource& _rDB , Reference< XConnection >& _rxMaster , const Reference< XMultiServiceFactory >& _rxORB) @@ -415,7 +392,6 @@ OConnection::OConnection(ODatabaseSource& _rDB osl_decrementInterlockedCount( &m_refCount ); } -//-------------------------------------------------------------------------- OConnection::~OConnection() { delete m_pTables; @@ -423,9 +399,7 @@ OConnection::~OConnection() DBG_DTOR(OConnection,NULL); } - // XWarningsSupplier -//-------------------------------------------------------------------------- Any SAL_CALL OConnection::getWarnings() throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getWarnings" ); @@ -434,7 +408,6 @@ Any SAL_CALL OConnection::getWarnings() throw(SQLException, RuntimeException) return m_aWarnings.getWarnings(); } -//-------------------------------------------------------------------------- void SAL_CALL OConnection::clearWarnings( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::clearWarnings" ); @@ -443,7 +416,6 @@ void SAL_CALL OConnection::clearWarnings( ) throw(SQLException, RuntimeExceptio m_aWarnings.clearWarnings(); } -//-------------------------------------------------------------------------- namespace { struct CompareTypeByName : public ::std::binary_function< Type, Type, bool > @@ -461,8 +433,8 @@ namespace ::std::insert_iterator< TypeBag >( _out_rTypes, _out_rTypes.begin() ) ); } } + // com::sun::star::lang::XTypeProvider -//-------------------------------------------------------------------------- Sequence< Type > OConnection::getTypes() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getTypes" ); @@ -484,7 +456,6 @@ Sequence< Type > OConnection::getTypes() throw (RuntimeException) return aSupportedTypes; } -//-------------------------------------------------------------------------- Sequence< sal_Int8 > OConnection::getImplementationId() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getImplementationId" ); @@ -492,7 +463,6 @@ Sequence< sal_Int8 > OConnection::getImplementationId() throw (RuntimeException) } // com::sun::star::uno::XInterface -//-------------------------------------------------------------------------- Any OConnection::queryInterface( const Type & rType ) throw (RuntimeException) { if ( !m_bSupportsViews && rType.equals( XViewsSupplier::static_type() ) ) @@ -511,24 +481,19 @@ Any OConnection::queryInterface( const Type & rType ) throw (RuntimeException) return aReturn; } -//-------------------------------------------------------------------------- void OConnection::acquire() throw () { // include this one when you want to see who calls it (call graph) - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::acquire" ); OSubComponent::acquire(); } -//-------------------------------------------------------------------------- void OConnection::release() throw () { // include this one when you want to see who calls it (call graph) - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::release" ); OSubComponent::release(); } // OSubComponent -//------------------------------------------------------------------------------ void OConnection::disposing() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::disposing" ); @@ -574,7 +539,6 @@ void OConnection::disposing() } // XChild -//------------------------------------------------------------------------------ Reference< XInterface > OConnection::getParent(void) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getParent" ); @@ -583,7 +547,6 @@ Reference< XInterface > OConnection::getParent(void) throw( RuntimeException ) return m_xParent; } -//------------------------------------------------------------------------------ void OConnection::setParent(const Reference< XInterface > & /*Parent*/) throw( NoSupportException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::setParent" ); @@ -591,7 +554,6 @@ void OConnection::setParent(const Reference< XInterface > & /*Parent*/) throw( N } // XSQLQueryComposerFactory -//------------------------------------------------------------------------------ Reference< XSQLQueryComposer > OConnection::createQueryComposer(void) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::createQueryComposer" ); @@ -603,7 +565,7 @@ Reference< XSQLQueryComposer > OConnection::createQueryComposer(void) throw( Ru m_aComposers.push_back(WeakReferenceHelper(xComposer)); return xComposer; } -// ----------------------------------------------------------------------------- + void OConnection::impl_fillTableFilter() { Reference<XPropertySet> xProp(getParent(),UNO_QUERY); @@ -614,7 +576,6 @@ void OConnection::impl_fillTableFilter() } } -// ----------------------------------------------------------------------------- void OConnection::refresh(const Reference< XNameAccess >& _rToBeRefreshed) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::refresh" ); @@ -651,10 +612,8 @@ void OConnection::refresh(const Reference< XNameAccess >& _rToBeRefreshed) } } } -// ----------------------------------------------------------------------------- // XTablesSupplier -//------------------------------------------------------------------------------ Reference< XNameAccess > OConnection::getTables() throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getTables" ); @@ -665,7 +624,7 @@ Reference< XNameAccess > OConnection::getTables() throw( RuntimeException ) return m_pTables; } -// ----------------------------------------------------------------------------- + Reference< XNameAccess > SAL_CALL OConnection::getViews( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getViews" ); @@ -677,7 +636,6 @@ Reference< XNameAccess > SAL_CALL OConnection::getViews( ) throw(RuntimeExcepti return m_pViews; } // XQueriesSupplier -//------------------------------------------------------------------------------ Reference< XNameAccess > OConnection::getQueries(void) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getQueries" ); @@ -688,7 +646,6 @@ Reference< XNameAccess > OConnection::getQueries(void) throw( RuntimeException } // ::com::sun::star::sdb::XCommandPreparation -//------------------------------------------------------------------------------ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCommand( const ::rtl::OUString& command, sal_Int32 commandType ) throw(::com::sun::star::sdbc::SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::prepareCommand" ); @@ -720,7 +677,7 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCommand( const ::r // TODO EscapeProcessing return prepareStatement(aStatement); } -// ----------------------------------------------------------------------------- + Reference< XInterface > SAL_CALL OConnection::createInstance( const ::rtl::OUString& _sServiceSpecifier ) throw (Exception, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::createInstance" ); @@ -749,13 +706,13 @@ Reference< XInterface > SAL_CALL OConnection::createInstance( const ::rtl::OUStr } return Reference< XInterface >(xRet,UNO_QUERY); } -// ----------------------------------------------------------------------------- + Reference< XInterface > SAL_CALL OConnection::createInstanceWithArguments( const ::rtl::OUString& _sServiceSpecifier, const Sequence< Any >& /*Arguments*/ ) throw (Exception, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::createInstanceWithArguments" ); return createInstance(_sServiceSpecifier); } -// ----------------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL OConnection::getAvailableServiceNames( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getAvailableServiceNames" ); @@ -763,7 +720,7 @@ Sequence< ::rtl::OUString > SAL_CALL OConnection::getAvailableServiceNames( ) t aRet[0] = SERVICE_NAME_SINGLESELECTQUERYCOMPOSER; return aRet; } -// ----------------------------------------------------------------------------- + Reference< XTablesSupplier > OConnection::getMasterTables() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getMasterTables" ); @@ -782,7 +739,7 @@ Reference< XTablesSupplier > OConnection::getMasterTables() } return m_xMasterTables; } -// ----------------------------------------------------------------------------- + // XUsersSupplier Reference< XNameAccess > SAL_CALL OConnection::getUsers( ) throw(RuntimeException) { @@ -793,7 +750,7 @@ Reference< XNameAccess > SAL_CALL OConnection::getUsers( ) throw(RuntimeExcepti Reference<XUsersSupplier> xUsr(getMasterTables(),UNO_QUERY); return xUsr.is() ? xUsr->getUsers() : Reference< XNameAccess >(); } -// ----------------------------------------------------------------------------- + // XGroupsSupplier Reference< XNameAccess > SAL_CALL OConnection::getGroups( ) throw(RuntimeException) { @@ -804,7 +761,6 @@ Reference< XNameAccess > SAL_CALL OConnection::getGroups( ) throw(RuntimeExcept return xGrp.is() ? xGrp->getGroups() : Reference< XNameAccess >(); } -// ----------------------------------------------------------------------------- void OConnection::impl_loadConnectionTools_throw() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::impl_loadConnectionTools_throw" ); @@ -815,7 +771,6 @@ void OConnection::impl_loadConnectionTools_throw() throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "service not registered: com.sun.star.sdb.tools.ConnectionTools" ) ), *this ); } -// ----------------------------------------------------------------------------- Reference< XTableName > SAL_CALL OConnection::createTableName( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::createTableName" ); @@ -826,7 +781,6 @@ Reference< XTableName > SAL_CALL OConnection::createTableName( ) throw (Runtime return m_xConnectionTools->createTableName(); } -// ----------------------------------------------------------------------------- Reference< XObjectNames > SAL_CALL OConnection::getObjectNames( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getObjectNames" ); @@ -837,7 +791,6 @@ Reference< XObjectNames > SAL_CALL OConnection::getObjectNames( ) throw (Runtim return m_xConnectionTools->getObjectNames(); } -// ----------------------------------------------------------------------------- Reference< XDataSourceMetaData > SAL_CALL OConnection::getDataSourceMetaData( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getDataSourceMetaData" ); @@ -847,7 +800,7 @@ Reference< XDataSourceMetaData > SAL_CALL OConnection::getDataSourceMetaData( ) return m_xConnectionTools->getDataSourceMetaData(); } -// ----------------------------------------------------------------------------- + Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OConnection::getFieldsByCommandDescriptor( ::sal_Int32 commandType, const ::rtl::OUString& command, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& keepFieldsAlive ) throw (::com::sun::star::sdbc::SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getFieldsByCommandDescriptor" ); @@ -857,7 +810,7 @@ Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OConnection::getF return m_xConnectionTools->getFieldsByCommandDescriptor(commandType,command,keepFieldsAlive); } -//-------------------------------------------------------------------- + Reference< XSingleSelectQueryComposer > SAL_CALL OConnection::getComposer( ::sal_Int32 commandType, const ::rtl::OUString& command ) throw (::com::sun::star::uno::RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getComposer" ); @@ -868,7 +821,6 @@ Reference< XSingleSelectQueryComposer > SAL_CALL OConnection::getComposer( ::sal return m_xConnectionTools->getComposer(commandType,command); } -// ----------------------------------------------------------------------------- void OConnection::impl_checkTableQueryNames_nothrow() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::impl_checkTableQueryNames_nothrow" ); @@ -904,7 +856,6 @@ void OConnection::impl_checkTableQueryNames_nothrow() } } -// ----------------------------------------------------------------------------- Reference< XGraphic > SAL_CALL OConnection::getTableIcon( const ::rtl::OUString& _TableName, ::sal_Int32 _ColorMode ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getTableIcon" ); @@ -922,7 +873,6 @@ Reference< XGraphic > SAL_CALL OConnection::getTableIcon( const ::rtl::OUString& return xReturn; } -// ----------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OConnection::getTableEditor( const Reference< XDatabaseDocumentUI >& _DocumentUI, const ::rtl::OUString& _TableName ) throw (IllegalArgumentException, WrappedTargetException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getTableEditor" ); @@ -940,9 +890,5 @@ Reference< XInterface > SAL_CALL OConnection::getTableEditor( const Reference< X return xReturn; } - -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/connection.hxx b/dbaccess/source/core/dataaccess/connection.hxx index 321c4ae63..b79bda657 100644 --- a/dbaccess/source/core/dataaccess/connection.hxx +++ b/dbaccess/source/core/dataaccess/connection.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -167,7 +167,7 @@ public: virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); -// XConnection +// XConnection virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); diff --git a/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx b/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx index 4b71e5820..0a5432f79 100644 --- a/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx +++ b/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -145,7 +145,6 @@ namespace dbaccess #define REGISTER_PROPERTY( propname, member ) \ registerProperty( PROPERTY_##propname, PROPERTY_ID_##propname, PropertyAttribute::BOUND, &member, ::getCppuType( &member ) ) - //-------------------------------------------------------------------- DataAccessDescriptor::DataAccessDescriptor( const ::comphelper::ComponentContext& _rContext ) :DataAccessDescriptor_MutexBase() ,DataAccessDescriptor_TypeBase() @@ -188,24 +187,19 @@ namespace dbaccess REGISTER_PROPERTY( COLUMN, m_xColumn ); } - //-------------------------------------------------------------------- DataAccessDescriptor::~DataAccessDescriptor() { } - //-------------------------------------------------------------------- IMPLEMENT_FORWARD_XINTERFACE2( DataAccessDescriptor, DataAccessDescriptor_TypeBase, DataAccessDescriptor_PropertyBase ); - //-------------------------------------------------------------------- IMPLEMENT_FORWARD_XTYPEPROVIDER2( DataAccessDescriptor, DataAccessDescriptor_TypeBase, DataAccessDescriptor_PropertyBase ); - //-------------------------------------------------------------------- ::rtl::OUString SAL_CALL DataAccessDescriptor::getImplementationName() throw (RuntimeException) { return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.dba.DataAccessDescriptor" ) ); } - //-------------------------------------------------------------------- ::sal_Bool SAL_CALL DataAccessDescriptor::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) { Sequence< ::rtl::OUString > aServices( getSupportedServiceNames() ); @@ -214,7 +208,6 @@ namespace dbaccess return ::std::find( pStart, pEnd, rServiceName ) != pEnd; } - //-------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL DataAccessDescriptor::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aServices(1); @@ -222,20 +215,17 @@ namespace dbaccess return aServices; } - //------------------------------------------------------------------------- Reference< XPropertySetInfo > SAL_CALL DataAccessDescriptor::getPropertySetInfo() throw(RuntimeException) { Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } - //------------------------------------------------------------------------- ::cppu::IPropertyArrayHelper& DataAccessDescriptor::getInfoHelper() { return *getArrayHelper(); } - //------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper* DataAccessDescriptor::createArrayHelper( ) const { Sequence< Property > aProps; @@ -274,24 +264,20 @@ namespace dbaccess ::comphelper::ComponentContext m_aContext; }; - //-------------------------------------------------------------------- DataAccessDescriptorFactory::DataAccessDescriptorFactory( const Reference< XComponentContext >& _rxContext ) :m_aContext( _rxContext ) { } - //-------------------------------------------------------------------- DataAccessDescriptorFactory::~DataAccessDescriptorFactory() { } - //-------------------------------------------------------------------- ::rtl::OUString DataAccessDescriptorFactory::getSingletonName_static() { return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.DataAccessDescriptorFactory" ) ); } - //-------------------------------------------------------------------- Sequence< ::rtl::OUString > DataAccessDescriptorFactory::getSupportedServiceNames_static() throw( RuntimeException ) { Sequence< ::rtl::OUString > aServices(1); @@ -299,25 +285,21 @@ namespace dbaccess return aServices; } - //-------------------------------------------------------------------- ::rtl::OUString DataAccessDescriptorFactory::getImplementationName_static() throw( RuntimeException ) { return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.dba.DataAccessDescriptorFactory" ) ); } - //-------------------------------------------------------------------- Reference< XInterface > DataAccessDescriptorFactory::Create( const Reference< XComponentContext >& _rxContext ) { return *( new DataAccessDescriptorFactory( _rxContext ) ); } - //-------------------------------------------------------------------- ::rtl::OUString SAL_CALL DataAccessDescriptorFactory::getImplementationName() throw (RuntimeException) { return getImplementationName_static(); } - //-------------------------------------------------------------------- ::sal_Bool SAL_CALL DataAccessDescriptorFactory::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) { Sequence< ::rtl::OUString > aServices( getSupportedServiceNames_static() ); @@ -326,23 +308,18 @@ namespace dbaccess return ::std::find( pStart, pEnd, rServiceName ) != pEnd; } - //-------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL DataAccessDescriptorFactory::getSupportedServiceNames( ) throw (RuntimeException) { return getSupportedServiceNames_static(); } - //-------------------------------------------------------------------- Reference< XPropertySet > SAL_CALL DataAccessDescriptorFactory::createDataAccessDescriptor( ) throw (RuntimeException) { return new DataAccessDescriptor( m_aContext ); } -//........................................................................ } // namespace dbaccess -//........................................................................ -//-------------------------------------------------------------------------- extern "C" void SAL_CALL createRegistryInfo_DataAccessDescriptorFactory() { static ::dba::OSingletonRegistration< ::dbaccess::DataAccessDescriptorFactory > aAutoRegistration; diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index 08c0ea942..6fcf10a30 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -101,19 +101,15 @@ using ::com::sun::star::ucb::InteractiveIOException; using ::com::sun::star::ucb::IOErrorCode_NOT_EXISTING; using ::com::sun::star::ucb::IOErrorCode_NOT_EXISTING_PATH; -//========================================================================== extern "C" void SAL_CALL createRegistryInfo_ODatabaseContext() { static ::dba::OLegacySingletonRegistration< ::dbaccess::ODatabaseContext > aODatabaseContext_AutoRegistration; } -//........................................................................ namespace dbaccess { -//........................................................................ - // ............................................................................. typedef ::cppu::WeakImplHelper1 < XTerminateListener > DatabaseDocumentLoader_Base; class DatabaseDocumentLoader : public DatabaseDocumentLoader_Base @@ -139,7 +135,6 @@ namespace dbaccess virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); }; - // ............................................................................. DatabaseDocumentLoader::DatabaseDocumentLoader( const comphelper::ComponentContext& _aContext ) { acquire(); @@ -173,25 +168,24 @@ namespace dbaccess } } }; - // ............................................................................. + void SAL_CALL DatabaseDocumentLoader::queryTermination( const lang::EventObject& /*Event*/ ) throw (TerminationVetoException, RuntimeException) { ::std::list< const ODatabaseModelImpl* > aCopy(m_aDatabaseDocuments); ::std::for_each(aCopy.begin(),aCopy.end(),TerminateFunctor()); } - // ............................................................................. void SAL_CALL DatabaseDocumentLoader::notifyTermination( const lang::EventObject& /*Event*/ ) throw (RuntimeException) { } - // ............................................................................. + void SAL_CALL DatabaseDocumentLoader::disposing( const lang::EventObject& /*Source*/ ) throw (RuntimeException) { } //= ODatabaseContext //========================================================================== -//-------------------------------------------------------------------------- + ODatabaseContext::ODatabaseContext( const Reference< XComponentContext >& _rxContext ) :DatabaseAccessContext_Base(m_aMutex) ,m_aContext( _rxContext ) @@ -210,7 +204,6 @@ ODatabaseContext::ODatabaseContext( const Reference< XComponentContext >& _rxCon osl_decrementInterlockedCount( &m_refCount ); } -//-------------------------------------------------------------------------- ODatabaseContext::~ODatabaseContext() { ::basic::BasicManagerRepository::revokeCreationListener( *this ); @@ -223,20 +216,17 @@ ODatabaseContext::~ODatabaseContext() } // Helper -//------------------------------------------------------------------------------ rtl::OUString ODatabaseContext::getImplementationName_static() throw( RuntimeException ) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.ODatabaseContext")); } -//------------------------------------------------------------------------------ Reference< XInterface > ODatabaseContext::Create(const Reference< XComponentContext >& _rxContext) { return *( new ODatabaseContext( _rxContext ) ); } -//------------------------------------------------------------------------------ Sequence< rtl::OUString > ODatabaseContext::getSupportedServiceNames_static(void) throw( RuntimeException ) { Sequence< ::rtl::OUString > aSNS( 1 ); @@ -245,25 +235,21 @@ Sequence< rtl::OUString > ODatabaseContext::getSupportedServiceNames_static(void } // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString ODatabaseContext::getImplementationName( ) throw(RuntimeException) { return getImplementationName_static(); } -//------------------------------------------------------------------------------ sal_Bool ODatabaseContext::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) { return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > ODatabaseContext::getSupportedServiceNames( ) throw (RuntimeException) { return getSupportedServiceNames_static(); } -//-------------------------------------------------------------------------- Reference< XInterface > ODatabaseContext::impl_createNewDataSource() { ::rtl::Reference<ODatabaseModelImpl> pImpl( new ODatabaseModelImpl( m_aContext.getLegacyServiceFactory(), *this ) ); @@ -272,7 +258,6 @@ Reference< XInterface > ODatabaseContext::impl_createNewDataSource() return xDataSource.get(); } -//-------------------------------------------------------------------------- Reference< XInterface > SAL_CALL ODatabaseContext::createInstance( ) throw (Exception, RuntimeException) { // for convenience of the API user, we ensure the document is fully initialized (effectively: XLoadable::initNew @@ -280,7 +265,6 @@ Reference< XInterface > SAL_CALL ODatabaseContext::createInstance( ) throw (Exc return impl_createNewDataSource(); } -//-------------------------------------------------------------------------- Reference< XInterface > SAL_CALL ODatabaseContext::createInstanceWithArguments( const Sequence< Any >& _rArguments ) throw (Exception, RuntimeException) { ::comphelper::NamedValueCollection aArgs( _rArguments ); @@ -295,8 +279,8 @@ Reference< XInterface > SAL_CALL ODatabaseContext::createInstanceWithArguments( return xDataSource; } + // DatabaseAccessContext_Base -//------------------------------------------------------------------------------ void ODatabaseContext::disposing() { // notify our listener @@ -316,7 +300,6 @@ void ODatabaseContext::disposing() } // XNamingService -//------------------------------------------------------------------------------ Reference< XInterface > ODatabaseContext::getRegisteredObject(const rtl::OUString& _rName) throw( Exception, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -335,7 +318,7 @@ Reference< XInterface > ODatabaseContext::getRegisteredObject(const rtl::OUStri return loadObjectFromURL( _rName, sURL ); } -// ----------------------------------------------------------------------------- + Reference< XInterface > ODatabaseContext::loadObjectFromURL(const ::rtl::OUString& _rName,const ::rtl::OUString& _sURL) { INetURLObject aURL( _sURL ); @@ -400,17 +383,17 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const ::rtl::OUStrin return pModelImpl->getOrCreateDataSource().get(); } -// ----------------------------------------------------------------------------- + void ODatabaseContext::appendAtTerminateListener(const ODatabaseModelImpl& _rDataSourceModel) { m_pDatabaseDocumentLoader->append(_rDataSourceModel); } -// ----------------------------------------------------------------------------- + void ODatabaseContext::removeFromTerminateListener(const ODatabaseModelImpl& _rDataSourceModel) { m_pDatabaseDocumentLoader->remove(_rDataSourceModel); } -// ----------------------------------------------------------------------------- + void ODatabaseContext::setTransientProperties(const ::rtl::OUString& _sURL, ODatabaseModelImpl& _rDataSourceModel ) { if ( m_aDatasourceProperties.end() == m_aDatasourceProperties.find(_sURL) ) @@ -442,7 +425,6 @@ void ODatabaseContext::setTransientProperties(const ::rtl::OUString& _sURL, ODat } } -//------------------------------------------------------------------------------ void ODatabaseContext::registerObject(const rtl::OUString& _rName, const Reference< XInterface > & _rxObject) throw( Exception, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -469,7 +451,6 @@ void ODatabaseContext::registerObject(const rtl::OUString& _rName, const Referen m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvent ); } -//------------------------------------------------------------------------------ void ODatabaseContext::storeTransientProperties( ODatabaseModelImpl& _rModelImpl) { Reference< XPropertySet > xSource( _rModelImpl.getOrCreateDataSource(), UNO_QUERY ); @@ -527,19 +508,16 @@ void ODatabaseContext::storeTransientProperties( ODatabaseModelImpl& _rModelImpl } } -//------------------------------------------------------------------------------ void SAL_CALL ODatabaseContext::addContainerListener( const Reference< XContainerListener >& _rxListener ) throw(RuntimeException) { m_aContainerListeners.addInterface(_rxListener); } -//------------------------------------------------------------------------------ void SAL_CALL ODatabaseContext::removeContainerListener( const Reference< XContainerListener >& _rxListener ) throw(RuntimeException) { m_aContainerListeners.removeInterface(_rxListener); } -//------------------------------------------------------------------------------ void ODatabaseContext::revokeObject(const rtl::OUString& _rName) throw( Exception, RuntimeException ) { ClearableMutexGuard aGuard(m_aMutex); @@ -566,68 +544,57 @@ void ODatabaseContext::revokeObject(const rtl::OUString& _rName) throw( Exceptio m_aContainerListeners.notifyEach( &XContainerListener::elementRemoved, aEvent ); } -//------------------------------------------------------------------------------ ::sal_Bool SAL_CALL ODatabaseContext::hasRegisteredDatabase( const ::rtl::OUString& _Name ) throw (IllegalArgumentException, RuntimeException) { return m_xDatabaseRegistrations->hasRegisteredDatabase( _Name ); } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > SAL_CALL ODatabaseContext::getRegistrationNames() throw (RuntimeException) { return m_xDatabaseRegistrations->getRegistrationNames(); } -//------------------------------------------------------------------------------ ::rtl::OUString SAL_CALL ODatabaseContext::getDatabaseLocation( const ::rtl::OUString& _Name ) throw (IllegalArgumentException, NoSuchElementException, RuntimeException) { return m_xDatabaseRegistrations->getDatabaseLocation( _Name ); } -//------------------------------------------------------------------------------ void SAL_CALL ODatabaseContext::registerDatabaseLocation( const ::rtl::OUString& _Name, const ::rtl::OUString& _Location ) throw (IllegalArgumentException, ElementExistException, RuntimeException) { m_xDatabaseRegistrations->registerDatabaseLocation( _Name, _Location ); } -//------------------------------------------------------------------------------ void SAL_CALL ODatabaseContext::revokeDatabaseLocation( const ::rtl::OUString& _Name ) throw (IllegalArgumentException, NoSuchElementException, IllegalAccessException, RuntimeException) { m_xDatabaseRegistrations->revokeDatabaseLocation( _Name ); } -//------------------------------------------------------------------------------ void SAL_CALL ODatabaseContext::changeDatabaseLocation( const ::rtl::OUString& _Name, const ::rtl::OUString& _NewLocation ) throw (IllegalArgumentException, NoSuchElementException, IllegalAccessException, RuntimeException) { m_xDatabaseRegistrations->changeDatabaseLocation( _Name, _NewLocation ); } -//------------------------------------------------------------------------------ ::sal_Bool SAL_CALL ODatabaseContext::isDatabaseRegistrationReadOnly( const ::rtl::OUString& _Name ) throw (IllegalArgumentException, NoSuchElementException, RuntimeException) { return m_xDatabaseRegistrations->isDatabaseRegistrationReadOnly( _Name ); } -//------------------------------------------------------------------------------ void SAL_CALL ODatabaseContext::addDatabaseRegistrationsListener( const Reference< XDatabaseRegistrationsListener >& _Listener ) throw (RuntimeException) { m_xDatabaseRegistrations->addDatabaseRegistrationsListener( _Listener ); } -//------------------------------------------------------------------------------ void SAL_CALL ODatabaseContext::removeDatabaseRegistrationsListener( const Reference< XDatabaseRegistrationsListener >& _Listener ) throw (RuntimeException) { m_xDatabaseRegistrations->removeDatabaseRegistrationsListener( _Listener ); } // ::com::sun::star::container::XElementAccess -//------------------------------------------------------------------------------ Type ODatabaseContext::getElementType( ) throw(RuntimeException) { return::getCppuType(static_cast<Reference<XDataSource>*>(NULL)); } -//------------------------------------------------------------------------------ sal_Bool ODatabaseContext::hasElements(void) throw( RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -637,7 +604,6 @@ sal_Bool ODatabaseContext::hasElements(void) throw( RuntimeException ) } // ::com::sun::star::container::XEnumerationAccess -//------------------------------------------------------------------------------ Reference< ::com::sun::star::container::XEnumeration > ODatabaseContext::createEnumeration(void) throw( RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -645,7 +611,6 @@ Reference< ::com::sun::star::container::XEnumeration > ODatabaseContext::create } // ::com::sun::star::container::XNameAccess -//------------------------------------------------------------------------------ Any ODatabaseContext::getByName(const rtl::OUString& _rName) throw( NoSuchElementException, WrappedTargetException, RuntimeException ) { @@ -696,7 +661,6 @@ Any ODatabaseContext::getByName(const rtl::OUString& _rName) throw( NoSuchElemen } } -//------------------------------------------------------------------------------ Sequence< rtl::OUString > ODatabaseContext::getElementNames(void) throw( RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -705,7 +669,6 @@ Sequence< rtl::OUString > ODatabaseContext::getElementNames(void) throw( Runtime return getRegistrationNames(); } -//------------------------------------------------------------------------------ sal_Bool ODatabaseContext::hasByName(const rtl::OUString& _rName) throw( RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -714,7 +677,6 @@ sal_Bool ODatabaseContext::hasByName(const rtl::OUString& _rName) throw( Runtime return hasRegisteredDatabase( _rName ); } -// ----------------------------------------------------------------------------- Reference< XInterface > ODatabaseContext::getObject( const ::rtl::OUString& _rURL ) { ObjectCacheIterator aFind = m_aDatabaseObjects.find( _rURL ); @@ -723,7 +685,7 @@ Reference< XInterface > ODatabaseContext::getObject( const ::rtl::OUString& _rUR xExistent = aFind->second->getOrCreateDataSource(); return xExistent; } -// ----------------------------------------------------------------------------- + void ODatabaseContext::registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl ) { ::rtl::OUString sURL( _rModelImpl.getURL() ); @@ -738,7 +700,7 @@ void ODatabaseContext::registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl else OSL_ENSURE( false, "ODatabaseContext::registerDatabaseDocument: already have an object registered for this URL!" ); } -// ----------------------------------------------------------------------------- + void ODatabaseContext::revokeDatabaseDocument( const ODatabaseModelImpl& _rModelImpl ) { ::rtl::OUString sURL( _rModelImpl.getURL() ); @@ -747,7 +709,7 @@ void ODatabaseContext::revokeDatabaseDocument( const ODatabaseModelImpl& _rModel #endif m_aDatabaseObjects.erase( sURL ); } -// ----------------------------------------------------------------------------- + void ODatabaseContext::databaseDocumentURLChange( const ::rtl::OUString& _rOldURL, const ::rtl::OUString& _rNewURL ) { #if OSL_DEBUG_LEVEL > 1 @@ -763,7 +725,7 @@ void ODatabaseContext::databaseDocumentURLChange( const ::rtl::OUString& _rOldUR m_aDatabaseObjects[ _rNewURL ] = oldPos->second; m_aDatabaseObjects.erase( oldPos ); } -// ----------------------------------------------------------------------------- + sal_Int64 SAL_CALL ODatabaseContext::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException) { if (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) @@ -771,7 +733,7 @@ sal_Int64 SAL_CALL ODatabaseContext::getSomething( const Sequence< sal_Int8 >& r return 0; } -// ----------------------------------------------------------------------------- + Sequence< sal_Int8 > ODatabaseContext::getUnoTunnelImplementationId() { static ::cppu::OImplementationId * pId = 0; @@ -787,7 +749,6 @@ Sequence< sal_Int8 > ODatabaseContext::getUnoTunnelImplementationId() return pId->getImplementationId(); } -// ----------------------------------------------------------------------------- void ODatabaseContext::onBasicManagerCreated( const Reference< XModel >& _rxForDocument, BasicManager& _rBasicManager ) { // if it's a database document ... @@ -805,8 +766,5 @@ void ODatabaseContext::onBasicManagerCreated( const Reference< XModel >& _rxForD _rBasicManager.SetGlobalUNOConstant( "ThisDatabaseDocument", makeAny( xDatabaseDocument ) ); } -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/databasecontext.hxx b/dbaccess/source/core/dataaccess/databasecontext.hxx index 072299c76..1dab6800f 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.hxx +++ b/dbaccess/source/core/dataaccess/databasecontext.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -91,7 +91,6 @@ private: /** loads the given object from the given URL @throws WrappedTargetException if an error occurs accessing the URL via the UCB - */ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > loadObjectFromURL(const ::rtl::OUString& _rName,const ::rtl::OUString& _sURL); ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getObject( const ::rtl::OUString& _rURL ); diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index c0690bb6e..46a820187 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -122,15 +122,13 @@ using ::com::sun::star::awt::XWindow; using ::com::sun::star::ucb::XContent; using ::com::sun::star::sdb::application::XDatabaseDocumentUI; -//........................................................................ namespace dbaccess { -//........................................................................ //============================================================ //= ViewMonitor //============================================================ -//-------------------------------------------------------------------------- + bool ViewMonitor::onControllerConnected( const Reference< XController >& _rxController ) { bool bFirstControllerEver = ( m_bEverHadController == false ); @@ -142,7 +140,6 @@ bool ViewMonitor::onControllerConnected( const Reference< XController >& _rxCont return bFirstControllerEver; } -//-------------------------------------------------------------------------- bool ViewMonitor::onSetCurrentController( const Reference< XController >& _rxController ) { // we interpret this as "loading the document (including UI) is finished", @@ -161,13 +158,12 @@ bool ViewMonitor::onSetCurrentController( const Reference< XController >& _rxCon //= ODatabaseDocument //============================================================ DBG_NAME(ODatabaseDocument) -//-------------------------------------------------------------------------- + extern "C" void SAL_CALL createRegistryInfo_ODatabaseDocument() { static ::dba::OAutoRegistration< ODatabaseDocument > aAutoRegistration; } -//-------------------------------------------------------------------------- ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl ) :ModelDependentComponent( _pImpl ) ,ODatabaseDocument_OfficeDocument( getMutex() ) @@ -217,7 +213,6 @@ ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>& } } -//-------------------------------------------------------------------------- ODatabaseDocument::~ODatabaseDocument() { OSL_TRACE( "DD: dtor: %p: %p", this, m_pImpl.get() ); @@ -230,7 +225,7 @@ ODatabaseDocument::~ODatabaseDocument() delete m_pEventContainer, m_pEventContainer = NULL; } -// ----------------------------------------------------------------------------- + Any SAL_CALL ODatabaseDocument::queryInterface( const Type& _rType ) throw (RuntimeException) { // strip XEmbeddedScripts and XScriptInvocationContext if we have any form/report @@ -248,18 +243,17 @@ Any SAL_CALL ODatabaseDocument::queryInterface( const Type& _rType ) throw (Runt aReturn = ODatabaseDocument_Title::queryInterface(_rType); return aReturn; } -//------------------------------------------------------------------------------ + void SAL_CALL ODatabaseDocument::acquire( ) throw () { ODatabaseDocument_OfficeDocument::acquire(); } -//------------------------------------------------------------------------------ void SAL_CALL ODatabaseDocument::release( ) throw () { ODatabaseDocument_OfficeDocument::release(); } -//------------------------------------------------------------------------------ + Sequence< Type > SAL_CALL ODatabaseDocument::getTypes( ) throw (RuntimeException) { Sequence< Type > aTypes = ::comphelper::concatSequences( @@ -300,7 +294,7 @@ Sequence< Type > SAL_CALL ODatabaseDocument::getTypes( ) throw (RuntimeException return aTypes; } -//------------------------------------------------------------------------------ + Sequence< sal_Int8 > SAL_CALL ODatabaseDocument::getImplementationId( ) throw (RuntimeException) { static ::cppu::OImplementationId * pId = 0; @@ -316,19 +310,15 @@ Sequence< sal_Int8 > SAL_CALL ODatabaseDocument::getImplementationId( ) throw ( return pId->getImplementationId(); } -// ----------------------------------------------------------------------------- // local functions -// ----------------------------------------------------------------------------- namespace { - // ----------------------------------------------------------------------------- Reference< XStatusIndicator > lcl_extractStatusIndicator( const ::comphelper::NamedValueCollection& _rArguments ) { Reference< XStatusIndicator > xStatusIndicator; return _rArguments.getOrDefault( "StatusIndicator", xStatusIndicator ); } - // ----------------------------------------------------------------------------- static void lcl_triggerStatusIndicator_throw( const ::comphelper::NamedValueCollection& _rArguments, DocumentGuard& _rGuard, const bool _bStart ) { Reference< XStatusIndicator > xStatusIndicator( lcl_extractStatusIndicator( _rArguments ) ); @@ -351,7 +341,6 @@ namespace // note that |reset| can throw a DisposedException } - // ----------------------------------------------------------------------------- static void lcl_extractStatusIndicator( const ::comphelper::NamedValueCollection& _rArguments, Sequence< Any >& _rCallArgs ) { Reference< XStatusIndicator > xStatusIndicator( lcl_extractStatusIndicator( _rArguments ) ); @@ -363,7 +352,6 @@ namespace _rCallArgs[ nLength ] <<= xStatusIndicator; } - // ----------------------------------------------------------------------------- static void lcl_extractAndStartStatusIndicator( const ::comphelper::NamedValueCollection& _rArguments, Reference< XStatusIndicator >& _rxStatusIndicator, Sequence< Any >& _rCallArgs ) { @@ -385,7 +373,6 @@ namespace } } - // ----------------------------------------------------------------------------- static Sequence< PropertyValue > lcl_appendFileNameToDescriptor( const ::comphelper::NamedValueCollection& _rDescriptor, const ::rtl::OUString _rURL ) { ::comphelper::NamedValueCollection aMutableDescriptor( _rDescriptor ); @@ -398,7 +385,6 @@ namespace } } -// ----------------------------------------------------------------------------- void ODatabaseDocument::impl_setInitialized() { m_eInitState = Initialized; @@ -407,7 +393,6 @@ void ODatabaseDocument::impl_setInitialized() m_aEventNotifier.onDocumentInitialized(); } -// ----------------------------------------------------------------------------- void ODatabaseDocument::impl_reset_nothrow() { try @@ -432,7 +417,6 @@ void ODatabaseDocument::impl_reset_nothrow() m_pImpl->m_bDocumentReadOnly = sal_False; } -// ----------------------------------------------------------------------------- void ODatabaseDocument::impl_import_nolck_throw( const ::comphelper::ComponentContext _rContext, const Reference< XInterface >& _rxTargetComponent, const ::comphelper::NamedValueCollection& _rResource ) { @@ -470,7 +454,6 @@ void ODatabaseDocument::impl_import_nolck_throw( const ::comphelper::ComponentCo xStatusIndicator->end(); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::initNew( ) throw (DoubleInitializationException, IOException, Exception, RuntimeException) { // SYNCHRONIZED -> @@ -505,7 +488,6 @@ void SAL_CALL ODatabaseDocument::initNew( ) throw (DoubleInitializationExceptio impl_notifyStorageChange_nolck_nothrow( xTempStor ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::load( const Sequence< PropertyValue >& _Arguments ) throw (DoubleInitializationException, IOException, Exception, RuntimeException) { // SYNCHRONIZED -> @@ -551,10 +533,8 @@ void SAL_CALL ODatabaseDocument::load( const Sequence< PropertyValue >& _Argumen // <- SYNCHRONIZED } -// ----------------------------------------------------------------------------- namespace { - // ......................................................................... bool lcl_hasAnyModifiedSubComponent_throw( const Reference< XController >& i_rController ) { Reference< XDatabaseDocumentUI > xDatabaseUI( i_rController, UNO_QUERY_THROW ); @@ -582,7 +562,6 @@ namespace } } -// ----------------------------------------------------------------------------- ::sal_Bool SAL_CALL ODatabaseDocument::wasModifiedSinceLastSave() throw ( RuntimeException ) { DocumentGuard aGuard( *this ); @@ -621,7 +600,6 @@ namespace return sal_False; } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::storeToRecoveryFile( const ::rtl::OUString& i_TargetLocation, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException ) { DocumentGuard aGuard( *this ); @@ -658,7 +636,6 @@ void SAL_CALL ODatabaseDocument::storeToRecoveryFile( const ::rtl::OUString& i_T } } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::recoverFromFile( const ::rtl::OUString& i_SourceLocation, const ::rtl::OUString& i_SalvagedFile, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException ) { DocumentGuard aGuard( *this, DocumentGuard::InitMethod ); @@ -707,7 +684,6 @@ void SAL_CALL ODatabaseDocument::recoverFromFile( const ::rtl::OUString& i_Sourc } } -// ----------------------------------------------------------------------------- // XModel sal_Bool SAL_CALL ODatabaseDocument::attachResource( const ::rtl::OUString& _rURL, const Sequence< PropertyValue >& _rArguments ) throw (RuntimeException) { @@ -715,7 +691,6 @@ sal_Bool SAL_CALL ODatabaseDocument::attachResource( const ::rtl::OUString& _rUR return impl_attachResource( _rURL, _rArguments, aGuard ); } -// ----------------------------------------------------------------------------- sal_Bool ODatabaseDocument::impl_attachResource( const ::rtl::OUString& i_rLogicalDocumentURL, const Sequence< PropertyValue >& i_rMediaDescriptor, DocumentGuard& _rDocGuard ) { @@ -757,21 +732,18 @@ sal_Bool ODatabaseDocument::impl_attachResource( const ::rtl::OUString& i_rLogic return sal_True; } -// ----------------------------------------------------------------------------- ::rtl::OUString SAL_CALL ODatabaseDocument::getURL( ) throw (RuntimeException) { DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit ); return m_pImpl->getURL(); } -// ----------------------------------------------------------------------------- Sequence< PropertyValue > SAL_CALL ODatabaseDocument::getArgs( ) throw (RuntimeException) { DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit ); return m_pImpl->getMediaDescriptor().getPropertyValues(); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::connectController( const Reference< XController >& _xController ) throw (RuntimeException) { DocumentGuard aGuard( *this ); @@ -798,7 +770,6 @@ void SAL_CALL ODatabaseDocument::connectController( const Reference< XController m_pImpl->checkMacrosOnLoading(); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::disconnectController( const Reference< XController >& _xController ) throw (RuntimeException) { bool bNotifyViewClosed = false; @@ -843,7 +814,6 @@ void SAL_CALL ODatabaseDocument::disconnectController( const Reference< XControl } } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::lockControllers( ) throw (RuntimeException) { DocumentGuard aGuard( *this ); @@ -851,7 +821,6 @@ void SAL_CALL ODatabaseDocument::lockControllers( ) throw (RuntimeException) ++m_pImpl->m_nControllerLockCount; } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::unlockControllers( ) throw (RuntimeException) { DocumentGuard aGuard( *this ); @@ -859,7 +828,6 @@ void SAL_CALL ODatabaseDocument::unlockControllers( ) throw (RuntimeException) --m_pImpl->m_nControllerLockCount; } -// ----------------------------------------------------------------------------- sal_Bool SAL_CALL ODatabaseDocument::hasControllersLocked( ) throw (RuntimeException) { DocumentGuard aGuard( *this ); @@ -867,7 +835,6 @@ sal_Bool SAL_CALL ODatabaseDocument::hasControllersLocked( ) throw (RuntimeExce return m_pImpl->m_nControllerLockCount != 0; } -// ----------------------------------------------------------------------------- Reference< XController > SAL_CALL ODatabaseDocument::getCurrentController() throw (RuntimeException) { DocumentGuard aGuard( *this ); @@ -875,7 +842,6 @@ Reference< XController > SAL_CALL ODatabaseDocument::getCurrentController() thro return m_xCurrentController.is() ? m_xCurrentController : ( m_aControllers.empty() ? Reference< XController >() : *m_aControllers.begin() ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::setCurrentController( const Reference< XController >& _xController ) throw (NoSuchElementException, RuntimeException) { DocumentGuard aGuard( *this ); @@ -905,7 +871,6 @@ void SAL_CALL ODatabaseDocument::setCurrentController( const Reference< XControl } } -// ----------------------------------------------------------------------------- Reference< XInterface > SAL_CALL ODatabaseDocument::getCurrentSelection( ) throw (RuntimeException) { DocumentGuard aGuard( *this ); @@ -917,14 +882,13 @@ Reference< XInterface > SAL_CALL ODatabaseDocument::getCurrentSelection( ) thro return xRet; } -// ----------------------------------------------------------------------------- // XStorable sal_Bool SAL_CALL ODatabaseDocument::hasLocation( ) throw (RuntimeException) { return getLocation().getLength() > 0; } -// ----------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL ODatabaseDocument::getLocation( ) throw (RuntimeException) { DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit ); @@ -932,13 +896,13 @@ sal_Bool SAL_CALL ODatabaseDocument::hasLocation( ) throw (RuntimeException) // both XStorable::getLocation and XModel::getURL have to return the URL of the document, *not* // the location of the file which the docunment was possibly recovered from (which would be getDocFileLocation) } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL ODatabaseDocument::isReadonly( ) throw (RuntimeException) { DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit ); return m_pImpl->m_bDocumentReadOnly; } -// ----------------------------------------------------------------------------- + void SAL_CALL ODatabaseDocument::store( ) throw (IOException, RuntimeException) { DocumentGuard aGuard( *this ); @@ -976,7 +940,6 @@ void SAL_CALL ODatabaseDocument::store( ) throw (IOException, RuntimeException) } } -// ----------------------------------------------------------------------------- void ODatabaseDocument::impl_throwIOExceptionCausedBySave_throw( const Any& i_rError, const ::rtl::OUString& i_rTargetURL ) const { ::rtl::OUString sErrorMessage = extractExceptionMessage( m_pImpl->m_aContext, i_rError ); @@ -988,7 +951,6 @@ void ODatabaseDocument::impl_throwIOExceptionCausedBySave_throw( const Any& i_rE throw IOException( sErrorMessage, *const_cast< ODatabaseDocument* >( this ) ); } -// ----------------------------------------------------------------------------- void ODatabaseDocument::impl_storeAs_throw( const ::rtl::OUString& _rURL, const ::comphelper::NamedValueCollection& _rArguments, const StoreType _eType, DocumentGuard& _rGuard ) throw ( IOException, RuntimeException ) { @@ -1091,7 +1053,6 @@ void ODatabaseDocument::impl_storeAs_throw( const ::rtl::OUString& _rURL, const impl_notifyStorageChange_nolck_nothrow( xNewRootStorage ); } -// ----------------------------------------------------------------------------- Reference< XStorage > ODatabaseDocument::impl_createStorageFor_throw( const ::rtl::OUString& _rURL ) const { Reference < ::com::sun::star::ucb::XSimpleFileAccess > xTempAccess; @@ -1110,7 +1071,6 @@ Reference< XStorage > ODatabaseDocument::impl_createStorageFor_throw( const ::rt return Reference< XStorage >( xStorageFactory->createInstanceWithArguments( aParam ), UNO_QUERY_THROW ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::storeAsURL( const ::rtl::OUString& _rURL, const Sequence< PropertyValue >& _rArguments ) throw (IOException, RuntimeException) { // SYNCHRONIZED -> @@ -1159,7 +1119,6 @@ void SAL_CALL ODatabaseDocument::storeAsURL( const ::rtl::OUString& _rURL, const m_aEventNotifier.notifyDocumentEvent( "OnCreate" ); } -// ----------------------------------------------------------------------------- void ODatabaseDocument::impl_storeToStorage_throw( const Reference< XStorage >& _rxTargetStorage, const Sequence< PropertyValue >& _rMediaDescriptor, DocumentGuard& _rDocGuard ) const { @@ -1200,7 +1159,6 @@ void ODatabaseDocument::impl_storeToStorage_throw( const Reference< XStorage >& } } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::storeToURL( const ::rtl::OUString& _rURL, const Sequence< PropertyValue >& _rArguments ) throw (IOException, RuntimeException) { DocumentGuard aGuard( *this ); @@ -1242,7 +1200,6 @@ void SAL_CALL ODatabaseDocument::storeToURL( const ::rtl::OUString& _rURL, const m_aEventNotifier.notifyDocumentEventAsync( "OnSaveToDone", NULL, makeAny( _rURL ) ); } -// ----------------------------------------------------------------------------- // XModifyBroadcaster void SAL_CALL ODatabaseDocument::addModifyListener( const Reference< XModifyListener >& _xListener ) throw (RuntimeException) { @@ -1250,14 +1207,12 @@ void SAL_CALL ODatabaseDocument::addModifyListener( const Reference< XModifyList m_aModifyListeners.addInterface(_xListener); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::removeModifyListener( const Reference< XModifyListener >& _xListener ) throw (RuntimeException) { DocumentGuard aGuard( *this ); m_aModifyListeners.removeInterface(_xListener); } -// ----------------------------------------------------------------------------- // XModifiable sal_Bool SAL_CALL ODatabaseDocument::isModified( ) throw (RuntimeException) { @@ -1266,7 +1221,6 @@ sal_Bool SAL_CALL ODatabaseDocument::isModified( ) throw (RuntimeException) return m_pImpl->m_bModified; } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::setModified( sal_Bool _bModified ) throw (PropertyVetoException, RuntimeException) { DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit ); @@ -1277,7 +1231,6 @@ void SAL_CALL ODatabaseDocument::setModified( sal_Bool _bModified ) throw (Prope // a proper "modified" flag } -// ----------------------------------------------------------------------------- void ODatabaseDocument::impl_setModified_nothrow( sal_Bool _bModified, DocumentGuard& _rGuard ) { // SYNCHRONIZED -> @@ -1298,32 +1251,27 @@ void ODatabaseDocument::impl_setModified_nothrow( sal_Bool _bModified, DocumentG } } -// ----------------------------------------------------------------------------- // ::com::sun::star::document::XEventBroadcaster void SAL_CALL ODatabaseDocument::addEventListener(const uno::Reference< document::XEventListener >& _Listener ) throw (uno::RuntimeException) { m_aEventNotifier.addLegacyEventListener( _Listener ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::removeEventListener( const uno::Reference< document::XEventListener >& _Listener ) throw (uno::RuntimeException) { m_aEventNotifier.removeLegacyEventListener( _Listener ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::addDocumentEventListener( const Reference< XDocumentEventListener >& _Listener ) throw (RuntimeException) { m_aEventNotifier.addDocumentEventListener( _Listener ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::removeDocumentEventListener( const Reference< XDocumentEventListener >& _Listener ) throw (RuntimeException) { m_aEventNotifier.removeDocumentEventListener( _Listener ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::notifyDocumentEvent( const ::rtl::OUString& _EventName, const Reference< XController2 >& _ViewController, const Any& _Supplement ) throw (IllegalArgumentException, NoSupportException, RuntimeException) { if ( !_EventName.getLength() ) @@ -1343,33 +1291,29 @@ void SAL_CALL ODatabaseDocument::notifyDocumentEvent( const ::rtl::OUString& _Ev m_aEventNotifier.notifyDocumentEvent( _EventName, _ViewController, _Supplement ); } -// ----------------------------------------------------------------------------- Sequence< PropertyValue > SAL_CALL ODatabaseDocument::getPrinter( ) throw (RuntimeException) { DBG_ERROR( "ODatabaseDocument::getPrinter: not supported!" ); return Sequence< PropertyValue >(); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::setPrinter( const Sequence< PropertyValue >& /*aPrinter*/ ) throw (IllegalArgumentException, RuntimeException) { DBG_ERROR( "ODatabaseDocument::setPrinter: not supported!" ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::print( const Sequence< PropertyValue >& /*xOptions*/ ) throw (IllegalArgumentException, RuntimeException) { DBG_ERROR( "ODatabaseDocument::print: not supported!" ); } -// ----------------------------------------------------------------------------- void ODatabaseDocument::impl_reparent_nothrow( const WeakReference< XNameAccess >& _rxContainer ) { Reference< XChild > xChild( _rxContainer.get(), UNO_QUERY ); if ( xChild.is() ) xChild->setParent( *this ); } -// ----------------------------------------------------------------------------- + void ODatabaseDocument::clearObjectContainer( WeakReference< XNameAccess >& _rxContainer) { Reference< XNameAccess > xContainer = _rxContainer; @@ -1380,7 +1324,7 @@ void ODatabaseDocument::clearObjectContainer( WeakReference< XNameAccess >& _rxC xChild->setParent( NULL ); _rxContainer = Reference< XNameAccess >(); } -// ----------------------------------------------------------------------------- + Reference< XNameAccess > ODatabaseDocument::impl_getDocumentContainer_throw( ODatabaseModelImpl::ObjectType _eType ) { if ( ( _eType != ODatabaseModelImpl::E_FORM ) && ( _eType != ODatabaseModelImpl::E_REPORT ) ) @@ -1416,7 +1360,6 @@ Reference< XNameAccess > ODatabaseDocument::impl_getDocumentContainer_throw( ODa return xContainer; } -// ----------------------------------------------------------------------------- void ODatabaseDocument::impl_closeControllerFrames_nolck_throw( sal_Bool _bDeliverOwnership ) { Controllers aCopy = m_aControllers; @@ -1441,7 +1384,6 @@ void ODatabaseDocument::impl_closeControllerFrames_nolck_throw( sal_Bool _bDeliv } } -// ----------------------------------------------------------------------------- struct DisposeControllerFrame : public ::std::unary_function< Reference< XController >, void > { void operator()( const Reference< XController >& _rxController ) const @@ -1461,7 +1403,6 @@ struct DisposeControllerFrame : public ::std::unary_function< Reference< XContro }; }; -// ----------------------------------------------------------------------------- void ODatabaseDocument::impl_disposeControllerFrames_nothrow() { Controllers aCopy; @@ -1469,7 +1410,6 @@ void ODatabaseDocument::impl_disposeControllerFrames_nothrow() ::std::for_each( aCopy.begin(), aCopy.end(), DisposeControllerFrame() ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::close( sal_Bool _bDeliverOwnership ) throw (CloseVetoException, RuntimeException) { // nearly everything below can/must be done without our mutex locked, the below is just for @@ -1509,32 +1449,31 @@ void SAL_CALL ODatabaseDocument::close( sal_Bool _bDeliverOwnership ) throw (Clo m_bClosing = false; // <- SYNCHRONIZED } -// ----------------------------------------------------------------------------- + void SAL_CALL ODatabaseDocument::addCloseListener( const Reference< ::com::sun::star::util::XCloseListener >& Listener ) throw (RuntimeException) { DocumentGuard aGuard( *this ); m_aCloseListener.addInterface(Listener); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODatabaseDocument::removeCloseListener( const Reference< ::com::sun::star::util::XCloseListener >& Listener ) throw (RuntimeException) { DocumentGuard aGuard( *this ); m_aCloseListener.removeInterface(Listener); } -// ----------------------------------------------------------------------------- + Reference< XNameAccess > SAL_CALL ODatabaseDocument::getFormDocuments( ) throw (RuntimeException) { DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit ); return impl_getDocumentContainer_throw( ODatabaseModelImpl::E_FORM ); } -// ----------------------------------------------------------------------------- + Reference< XNameAccess > SAL_CALL ODatabaseDocument::getReportDocuments( ) throw (RuntimeException) { DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit ); return impl_getDocumentContainer_throw( ODatabaseModelImpl::E_REPORT ); } -// ----------------------------------------------------------------------------- void ODatabaseDocument::WriteThroughComponent( const Reference< XComponent >& xComponent, const sal_Char* pStreamName, const sal_Char* pServiceName, const Sequence< Any >& _rArguments, const Sequence< PropertyValue >& rMediaDesc, const Reference<XStorage>& _xStorageToSaveTo ) const @@ -1603,7 +1542,6 @@ void ODatabaseDocument::WriteThroughComponent( const Reference< XOutputStream >& xFilter->filter( rMediaDesc ); } -// ----------------------------------------------------------------------------- void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _rxTargetStorage, const ::comphelper::NamedValueCollection& _rMediaDescriptor ) const { // extract status indicator @@ -1666,7 +1604,6 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r m_pImpl->storeLibraryContainersTo( _rxTargetStorage ); } -// ----------------------------------------------------------------------------- Reference< XUIConfigurationManager > SAL_CALL ODatabaseDocument::getUIConfigurationManager( ) throw (RuntimeException) { DocumentGuard aGuard( *this ); @@ -1704,7 +1641,7 @@ Reference< XUIConfigurationManager > SAL_CALL ODatabaseDocument::getUIConfigurat return m_xUIConfigurationManager; } -// ----------------------------------------------------------------------------- + Reference< XStorage > SAL_CALL ODatabaseDocument::getDocumentSubStorage( const ::rtl::OUString& aStorageName, sal_Int32 nMode ) throw (RuntimeException) { DocumentGuard aGuard( *this ); @@ -1712,14 +1649,13 @@ Reference< XStorage > SAL_CALL ODatabaseDocument::getDocumentSubStorage( const : Reference< XDocumentSubStorageSupplier > xStorageAccess( m_pImpl->getDocumentSubStorageSupplier() ); return xStorageAccess->getDocumentSubStorage( aStorageName, nMode ); } -// ----------------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL ODatabaseDocument::getDocumentSubStoragesNames( ) throw (::com::sun::star::io::IOException, RuntimeException) { Reference< XDocumentSubStorageSupplier > xStorageAccess( m_pImpl->getDocumentSubStorageSupplier() ); return xStorageAccess->getDocumentSubStoragesNames(); } -//------------------------------------------------------------------------------ void ODatabaseDocument::impl_notifyStorageChange_nolck_nothrow( const Reference< XStorage >& _rxNewRootStorage ) { Reference< XInterface > xMe( *const_cast< ODatabaseDocument* >( this ) ); @@ -1728,7 +1664,6 @@ void ODatabaseDocument::impl_notifyStorageChange_nolck_nothrow( const Reference< boost::bind( &XStorageChangeListener::notifyStorageChange, _1, boost::cref( xMe ), boost::cref( _rxNewRootStorage ) ) ); } -//------------------------------------------------------------------------------ void ODatabaseDocument::disposing() { OSL_TRACE( "DD: disp: %p: %p", this, m_pImpl.get() ); @@ -1800,42 +1735,39 @@ void ODatabaseDocument::disposing() aKeepAlive.clear(); } -// ----------------------------------------------------------------------------- + // XComponent void SAL_CALL ODatabaseDocument::dispose( ) throw (RuntimeException) { ::cppu::WeakComponentImplHelperBase::dispose(); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODatabaseDocument::addEventListener( const Reference< lang::XEventListener >& _xListener ) throw (RuntimeException) { ::cppu::WeakComponentImplHelperBase::addEventListener( _xListener ); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODatabaseDocument::removeEventListener( const Reference< lang::XEventListener >& _xListener ) throw (RuntimeException) { ::cppu::WeakComponentImplHelperBase::removeEventListener( _xListener ); } + // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString ODatabaseDocument::getImplementationName( ) throw(RuntimeException) { return getImplementationName_static(); } -//------------------------------------------------------------------------------ rtl::OUString ODatabaseDocument::getImplementationName_static( ) throw(RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.comp.dba.ODatabaseDocument"); } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > ODatabaseDocument::getSupportedServiceNames( ) throw (RuntimeException) { return getSupportedServiceNames_static(); } -//------------------------------------------------------------------------------ Reference< XInterface > ODatabaseDocument::Create( const Reference< XComponentContext >& _rxContext ) { ::comphelper::ComponentContext aContext( _rxContext ); @@ -1847,7 +1779,6 @@ Reference< XInterface > ODatabaseDocument::Create( const Reference< XComponentCo return xModel.get(); } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > ODatabaseDocument::getSupportedServiceNames_static( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSNS( 2 ); @@ -1856,19 +1787,17 @@ Sequence< ::rtl::OUString > ODatabaseDocument::getSupportedServiceNames_static( return aSNS; } -//------------------------------------------------------------------------------ sal_Bool ODatabaseDocument::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) { return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -// ----------------------------------------------------------------------------- + Reference< XDataSource > SAL_CALL ODatabaseDocument::getDataSource() throw (RuntimeException) { DocumentGuard aGuard( *this, DocumentGuard::MethodWithoutInit ); return m_pImpl->getOrCreateDataSource(); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::loadFromStorage( const Reference< XStorage >& /*xStorage*/, const Sequence< PropertyValue >& /*aMediaDescriptor*/ ) throw (IllegalArgumentException, DoubleInitializationException, IOException, Exception, RuntimeException) { DocumentGuard aGuard( *this ); @@ -1879,14 +1808,12 @@ void SAL_CALL ODatabaseDocument::loadFromStorage( const Reference< XStorage >& / ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::storeToStorage( const Reference< XStorage >& _rxStorage, const Sequence< PropertyValue >& _rMediaDescriptor ) throw (IllegalArgumentException, IOException, Exception, RuntimeException) { DocumentGuard aGuard( *this ); impl_storeToStorage_throw( _rxStorage, _rMediaDescriptor, aGuard ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::switchToStorage( const Reference< XStorage >& _rxNewRootStorage ) throw (IllegalArgumentException, IOException, Exception, RuntimeException) { DocumentGuard aGuard( *this ); @@ -1897,56 +1824,48 @@ void SAL_CALL ODatabaseDocument::switchToStorage( const Reference< XStorage >& _ impl_notifyStorageChange_nolck_nothrow( xNewRootStorage ); } -// ----------------------------------------------------------------------------- Reference< XStorage > SAL_CALL ODatabaseDocument::getDocumentStorage( ) throw (IOException, Exception, RuntimeException) { DocumentGuard aGuard( *this ); return m_pImpl->getOrCreateRootStorage(); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::addStorageChangeListener( const Reference< XStorageChangeListener >& _Listener ) throw (RuntimeException) { DocumentGuard aGuard( *this ); m_aStorageListeners.addInterface( _Listener ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::removeStorageChangeListener( const Reference< XStorageChangeListener >& _Listener ) throw (RuntimeException) { DocumentGuard aGuard( *this ); m_aStorageListeners.addInterface( _Listener ); } -// ----------------------------------------------------------------------------- Reference< XStorageBasedLibraryContainer > SAL_CALL ODatabaseDocument::getBasicLibraries() throw (RuntimeException) { DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit ); return m_pImpl->getLibraryContainer( true ); } -// ----------------------------------------------------------------------------- Reference< XStorageBasedLibraryContainer > SAL_CALL ODatabaseDocument::getDialogLibraries() throw (RuntimeException) { DocumentGuard aGuard( *this ); return m_pImpl->getLibraryContainer( false ); } -// ----------------------------------------------------------------------------- ::sal_Bool SAL_CALL ODatabaseDocument::getAllowMacroExecution() throw (RuntimeException) { DocumentGuard aGuard( *this ); return m_pImpl->adjustMacroMode_AutoReject(); } -// ----------------------------------------------------------------------------- Reference< XEmbeddedScripts > SAL_CALL ODatabaseDocument::getScriptContainer() throw (RuntimeException) { DocumentGuard aGuard( *this ); return this; } -// ----------------------------------------------------------------------------- Reference< provider::XScriptProvider > SAL_CALL ODatabaseDocument::getScriptProvider( ) throw (RuntimeException) { DocumentGuard aGuard( *this ); @@ -1968,26 +1887,23 @@ Reference< provider::XScriptProvider > SAL_CALL ODatabaseDocument::getScriptProv return xScriptProvider; } -// ----------------------------------------------------------------------------- Reference< XNameReplace > SAL_CALL ODatabaseDocument::getEvents( ) throw (RuntimeException) { DocumentGuard aGuard( *this, DocumentGuard::MethodUsedDuringInit ); return m_pEventContainer; } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(RuntimeException) { if ( m_pImpl.is() ) m_pImpl->disposing(Source); } -//------------------------------------------------------------------ Reference< XInterface > ODatabaseDocument::getThis() const { return *const_cast< ODatabaseDocument* >( this ); } -// ----------------------------------------------------------------------------- + struct CreateAny : public ::std::unary_function< Reference<XController>, Any> { Any operator() (const Reference<XController>& lhs) const @@ -2004,14 +1920,14 @@ Reference< XEnumeration > SAL_CALL ODatabaseDocument::getControllers( ) throw ( ::std::transform( m_aControllers.begin(), m_aControllers.end(), aController.getArray(), CreateAny() ); return new ::comphelper::OAnyEnumeration(aController); } -// ----------------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL ODatabaseDocument::getAvailableViewControllerNames( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aNames(1); aNames[0] = SERVICE_SDB_APPLICATIONCONTROLLER; return aNames; } -// ----------------------------------------------------------------------------- + Reference< XController2 > SAL_CALL ODatabaseDocument::createDefaultViewController( const Reference< XFrame >& _Frame ) throw (IllegalArgumentException, Exception, RuntimeException) { return createViewController( @@ -2021,7 +1937,6 @@ Reference< XController2 > SAL_CALL ODatabaseDocument::createDefaultViewControlle ); } -// ----------------------------------------------------------------------------- Reference< XController2 > SAL_CALL ODatabaseDocument::createViewController( const ::rtl::OUString& _ViewName, const Sequence< PropertyValue >& _Arguments, const Reference< XFrame >& _Frame ) throw (IllegalArgumentException, Exception, RuntimeException) { if ( !_ViewName.equalsAscii( "Default" ) && !_ViewName.equalsAscii( "Preview" ) ) @@ -2046,8 +1961,6 @@ Reference< XController2 > SAL_CALL ODatabaseDocument::createViewController( cons return xController; } -// ----------------------------------------------------------------------------- -//============================================================================= Reference< XTitle > ODatabaseDocument::impl_getTitleHelper_throw() { if ( ! m_xTitleHelper.is ()) @@ -2066,7 +1979,6 @@ Reference< XTitle > ODatabaseDocument::impl_getTitleHelper_throw() return m_xTitleHelper; } -//============================================================================= uno::Reference< frame::XUntitledNumbers > ODatabaseDocument::impl_getUntitledHelper_throw(const uno::Reference< uno::XInterface >& _xComponent) { if ( !m_xModuleManager.is() ) @@ -2101,7 +2013,6 @@ uno::Reference< frame::XUntitledNumbers > ODatabaseDocument::impl_getUntitledHel return xNumberedControllers; } -//============================================================================= // css.frame.XTitle ::rtl::OUString SAL_CALL ODatabaseDocument::getTitle() throw (uno::RuntimeException) @@ -2111,7 +2022,6 @@ uno::Reference< frame::XUntitledNumbers > ODatabaseDocument::impl_getUntitledHel return impl_getTitleHelper_throw()->getTitle(); } -//============================================================================= // css.frame.XTitle void SAL_CALL ODatabaseDocument::setTitle( const ::rtl::OUString& sTitle ) throw (uno::RuntimeException) @@ -2123,7 +2033,6 @@ void SAL_CALL ODatabaseDocument::setTitle( const ::rtl::OUString& sTitle ) // <- SYNCHRONIZED } -//============================================================================= // css.frame.XTitleChangeBroadcaster void SAL_CALL ODatabaseDocument::addTitleChangeListener( const uno::Reference< frame::XTitleChangeListener >& xListener ) throw (uno::RuntimeException) @@ -2135,7 +2044,6 @@ void SAL_CALL ODatabaseDocument::addTitleChangeListener( const uno::Reference< f xBroadcaster->addTitleChangeListener( xListener ); } -//============================================================================= // css.frame.XTitleChangeBroadcaster void SAL_CALL ODatabaseDocument::removeTitleChangeListener( const uno::Reference< frame::XTitleChangeListener >& xListener ) throw (uno::RuntimeException) @@ -2147,7 +2055,6 @@ void SAL_CALL ODatabaseDocument::removeTitleChangeListener( const uno::Reference xBroadcaster->removeTitleChangeListener( xListener ); } -//============================================================================= // css.frame.XUntitledNumbers ::sal_Int32 SAL_CALL ODatabaseDocument::leaseNumber( const uno::Reference< uno::XInterface >& xComponent ) throw (lang::IllegalArgumentException, @@ -2157,7 +2064,6 @@ void SAL_CALL ODatabaseDocument::removeTitleChangeListener( const uno::Reference return impl_getUntitledHelper_throw(xComponent)->leaseNumber (xComponent); } -//============================================================================= // css.frame.XUntitledNumbers void SAL_CALL ODatabaseDocument::releaseNumber( ::sal_Int32 nNumber ) throw (lang::IllegalArgumentException, @@ -2167,7 +2073,6 @@ void SAL_CALL ODatabaseDocument::releaseNumber( ::sal_Int32 nNumber ) impl_getUntitledHelper_throw()->releaseNumber (nNumber); } -//============================================================================= // css.frame.XUntitledNumbers void SAL_CALL ODatabaseDocument::releaseNumberForComponent( const uno::Reference< uno::XInterface >& xComponent ) throw (lang::IllegalArgumentException, @@ -2177,17 +2082,11 @@ void SAL_CALL ODatabaseDocument::releaseNumberForComponent( const uno::Reference impl_getUntitledHelper_throw(xComponent)->releaseNumberForComponent (xComponent); } -//============================================================================= // css.frame.XUntitledNumbers ::rtl::OUString SAL_CALL ODatabaseDocument::getUntitledPrefix() throw (uno::RuntimeException) { return ::rtl::OUString();/*RTL_CONSTASCII_USTRINGPARAM(" : "));*/ } -//------------------------------------------------------------------ -//........................................................................ } // namespace dbaccess -//........................................................................ - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx b/dbaccess/source/core/dataaccess/databasedocument.hxx index a299d984e..9bbeca952 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.hxx +++ b/dbaccess/source/core/dataaccess/databasedocument.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -371,12 +371,12 @@ public: // XEventBroadcaster virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); - + // XDocumentEventBroadcaster virtual void SAL_CALL addDocumentEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentEventListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeDocumentEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentEventListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL notifyDocumentEvent( const ::rtl::OUString& _EventName, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >& _ViewController, const ::com::sun::star::uno::Any& _Supplement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); - + // XPrintable virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getPrinter( ) throw (::com::sun::star::uno::RuntimeException) ; virtual void SAL_CALL setPrinter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aPrinter ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) ; @@ -620,7 +620,6 @@ private: denotes additional document parameters @param _rDocGuard is the guard which currently protects the document instance - */ sal_Bool impl_attachResource( const ::rtl::OUString& i_rLogicalDocumentURL, @@ -703,7 +702,5 @@ private: const ODatabaseDocument& m_document; }; -//........................................................................ } // namespace dbaccess -//........................................................................ #endif // _DBA_COREDATAACCESS_DATABASEDOCUMENT_HXX_ diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.cxx b/dbaccess/source/core/dataaccess/databaseregistrations.cxx index 8b3741b00..83b6d482b 100644 --- a/dbaccess/source/core/dataaccess/databaseregistrations.cxx +++ b/dbaccess/source/core/dataaccess/databaseregistrations.cxx @@ -1,7 +1,7 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,11 +41,8 @@ #include <tools/urlobj.hxx> #include <unotools/confignode.hxx> -//........................................................................ namespace dbaccess { -//........................................................................ - /** === begin UNO using === **/ using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::XInterface; @@ -68,21 +65,18 @@ namespace dbaccess using ::com::sun::star::uno::XAggregation; /** === end UNO using === **/ - //-------------------------------------------------------------------- static const ::rtl::OUString& getConfigurationRootPath() { static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("org.openoffice.Office.DataAccess/RegisteredNames"); return s_sNodeName; } - //-------------------------------------------------------------------- const ::rtl::OUString& getLocationNodeName() { static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii( "Location" ); return s_sNodeName; } - //-------------------------------------------------------------------- const ::rtl::OUString& getNameNodeName() { static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii( "Name" ); @@ -151,7 +145,6 @@ namespace dbaccess //==================================================================== //= DatabaseRegistrations - implementation //==================================================================== - //-------------------------------------------------------------------- DatabaseRegistrations::DatabaseRegistrations( const ::comphelper::ComponentContext& _rxContext ) :m_aContext( _rxContext ) ,m_aConfigurationRoot() @@ -161,12 +154,10 @@ namespace dbaccess m_aContext.getLegacyServiceFactory(), getConfigurationRootPath(), -1, ::utl::OConfigurationTreeRoot::CM_UPDATABLE ); } - //-------------------------------------------------------------------- DatabaseRegistrations::~DatabaseRegistrations() { } - //-------------------------------------------------------------------- ::utl::OConfigurationNode DatabaseRegistrations::impl_getNodeForName_nothrow( const ::rtl::OUString& _rName ) { Sequence< ::rtl::OUString > aNames( m_aConfigurationRoot.getNodeNames() ); @@ -185,7 +176,6 @@ namespace dbaccess return ::utl::OConfigurationNode(); } - //-------------------------------------------------------------------- ::utl::OConfigurationNode DatabaseRegistrations::impl_getNodeForName_throw( const ::rtl::OUString& _rName, const bool _bMustExist ) { ::utl::OConfigurationNode aNodeForName( impl_getNodeForName_nothrow( _rName ) ); @@ -211,7 +201,7 @@ namespace dbaccess ::rtl::OUStringBuffer aReset( aNewNodeName ); sNewNodeName = aNewNodeName.makeStringAndClear(); sal_Int32 i=2; - while ( m_aConfigurationRoot.hasByName( sNewNodeName ) ) + while ( m_aConfigurationRoot.hasByName( sNewNodeName ) ) { aNewNodeName = aReset; aNewNodeName.appendAscii( " " ); @@ -225,7 +215,6 @@ namespace dbaccess return aNewNode; } - //-------------------------------------------------------------------- ::utl::OConfigurationNode DatabaseRegistrations::impl_checkValidName_throw( const ::rtl::OUString& _rName, const bool _bMustExist ) { if ( !m_aConfigurationRoot.isValid() ) @@ -237,7 +226,6 @@ namespace dbaccess return impl_getNodeForName_throw( _rName, _bMustExist ); } - //-------------------------------------------------------------------- void DatabaseRegistrations::impl_checkValidLocation_throw( const ::rtl::OUString& _rLocation ) { if ( !_rLocation.getLength() ) @@ -248,15 +236,13 @@ namespace dbaccess throw IllegalArgumentException( ::rtl::OUString(), *this, 2 ); } - //-------------------------------------------------------------------- ::sal_Bool SAL_CALL DatabaseRegistrations::hasRegisteredDatabase( const ::rtl::OUString& _Name ) throw (IllegalArgumentException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); ::utl::OConfigurationNode aNodeForName = impl_getNodeForName_nothrow( _Name ); return aNodeForName.isValid(); } - - //------------------------------------------------------------------------------ + Sequence< ::rtl::OUString > SAL_CALL DatabaseRegistrations::getRegistrationNames() throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -274,13 +260,11 @@ namespace dbaccess { ::utl::OConfigurationNode aRegistrationNode = m_aConfigurationRoot.openNode( *pName ); OSL_VERIFY( aRegistrationNode.getNodeValue( getNameNodeName() ) >>= *pDisplayName ); - } return aDisplayNames; } - //-------------------------------------------------------------------- ::rtl::OUString SAL_CALL DatabaseRegistrations::getDatabaseLocation( const ::rtl::OUString& _Name ) throw (IllegalArgumentException, NoSuchElementException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -293,8 +277,7 @@ namespace dbaccess return sLocation; } - - //-------------------------------------------------------------------- + void SAL_CALL DatabaseRegistrations::registerDatabaseLocation( const ::rtl::OUString& _Name, const ::rtl::OUString& _Location ) throw (IllegalArgumentException, ElementExistException, RuntimeException) { ::osl::ClearableMutexGuard aGuard( m_aMutex ); @@ -312,8 +295,7 @@ namespace dbaccess aGuard.clear(); m_aRegistrationListeners.notifyEach( &XDatabaseRegistrationsListener::registeredDatabaseLocation, aEvent ); } - - //-------------------------------------------------------------------- + void SAL_CALL DatabaseRegistrations::revokeDatabaseLocation( const ::rtl::OUString& _Name ) throw (IllegalArgumentException, NoSuchElementException, IllegalAccessException, RuntimeException) { ::osl::ClearableMutexGuard aGuard( m_aMutex ); @@ -338,8 +320,7 @@ namespace dbaccess aGuard.clear(); m_aRegistrationListeners.notifyEach( &XDatabaseRegistrationsListener::revokedDatabaseLocation, aEvent ); } - - //-------------------------------------------------------------------- + void SAL_CALL DatabaseRegistrations::changeDatabaseLocation( const ::rtl::OUString& _Name, const ::rtl::OUString& _NewLocation ) throw (IllegalArgumentException, NoSuchElementException, IllegalAccessException, RuntimeException) { ::osl::ClearableMutexGuard aGuard( m_aMutex ); @@ -365,7 +346,6 @@ namespace dbaccess m_aRegistrationListeners.notifyEach( &XDatabaseRegistrationsListener::changedDatabaseLocation, aEvent ); } - //-------------------------------------------------------------------- ::sal_Bool SAL_CALL DatabaseRegistrations::isDatabaseRegistrationReadOnly( const ::rtl::OUString& _Name ) throw (IllegalArgumentException, NoSuchElementException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -373,14 +353,12 @@ namespace dbaccess return aDataSourceRegistration.isReadonly(); } - //-------------------------------------------------------------------- void SAL_CALL DatabaseRegistrations::addDatabaseRegistrationsListener( const Reference< XDatabaseRegistrationsListener >& _Listener ) throw (RuntimeException) { if ( _Listener.is() ) m_aRegistrationListeners.addInterface( _Listener ); } - //-------------------------------------------------------------------- void SAL_CALL DatabaseRegistrations::removeDatabaseRegistrationsListener( const Reference< XDatabaseRegistrationsListener >& _Listener ) throw (RuntimeException) { if ( _Listener.is() ) @@ -395,8 +373,5 @@ namespace dbaccess return new DatabaseRegistrations( _rxContext ); } -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.hxx b/dbaccess/source/core/dataaccess/databaseregistrations.hxx index 927f484b7..cdfcc5141 100644 --- a/dbaccess/source/core/dataaccess/databaseregistrations.hxx +++ b/dbaccess/source/core/dataaccess/databaseregistrations.hxx @@ -1,6 +1,6 @@ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,16 +36,12 @@ namespace comphelper class ComponentContext; } -//........................................................................ namespace dbaccess { -//........................................................................ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > createDataSourceRegistrations( const ::comphelper::ComponentContext& _rxContext ); -//........................................................................ } // namespace dbaccess -//........................................................................ #endif // OOO_DATASOURCEREGISTRATIONS_HXX diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 53f93d9b5..1c09997b4 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -103,10 +103,8 @@ using namespace ::dbtools; using namespace ::comphelper; namespace css = ::com::sun::star; -//........................................................................ namespace dbaccess { -//........................................................................ //============================================================ //= FlushNotificationAdapter @@ -172,7 +170,6 @@ FlushNotificationAdapter::~FlushNotificationAdapter() DBG_DTOR( FlushNotificationAdapter, NULL ); } -//-------------------------------------------------------------------- void SAL_CALL FlushNotificationAdapter::impl_dispose( bool _bRevokeListener ) { Reference< XFlushListener > xKeepAlive( this ); @@ -188,7 +185,6 @@ void SAL_CALL FlushNotificationAdapter::impl_dispose( bool _bRevokeListener ) m_aBroadcaster = Reference< XFlushable >(); } -//-------------------------------------------------------------------- void SAL_CALL FlushNotificationAdapter::flushed( const EventObject& rEvent ) throw (RuntimeException) { Reference< XFlushListener > xListener( m_aListener ); @@ -198,7 +194,6 @@ void SAL_CALL FlushNotificationAdapter::flushed( const EventObject& rEvent ) thr impl_dispose( true ); } -//-------------------------------------------------------------------- void SAL_CALL FlushNotificationAdapter::disposing( const EventObject& Source ) throw (RuntimeException) { Reference< XFlushListener > xListener( m_aListener ); @@ -208,26 +203,22 @@ void SAL_CALL FlushNotificationAdapter::disposing( const EventObject& Source ) t impl_dispose( false ); } -//-------------------------------------------------------------------------- OAuthenticationContinuation::OAuthenticationContinuation() :m_bRemberPassword(sal_True), // TODO: a meaningfull default m_bCanSetUserName(sal_True) { } -//-------------------------------------------------------------------------- sal_Bool SAL_CALL OAuthenticationContinuation::canSetRealm( ) throw(RuntimeException) { return sal_False; } -//-------------------------------------------------------------------------- void SAL_CALL OAuthenticationContinuation::setRealm( const ::rtl::OUString& /*Realm*/ ) throw(RuntimeException) { DBG_ERROR("OAuthenticationContinuation::setRealm: not supported!"); } -//-------------------------------------------------------------------------- sal_Bool SAL_CALL OAuthenticationContinuation::canSetUserName( ) throw(RuntimeException) { // we alwas allow this, even if the database document is read-only. In this case, @@ -235,25 +226,21 @@ sal_Bool SAL_CALL OAuthenticationContinuation::canSetUserName( ) throw(RuntimeE return m_bCanSetUserName; } -//-------------------------------------------------------------------------- void SAL_CALL OAuthenticationContinuation::setUserName( const ::rtl::OUString& _rUser ) throw(RuntimeException) { m_sUser = _rUser; } -//-------------------------------------------------------------------------- sal_Bool SAL_CALL OAuthenticationContinuation::canSetPassword( ) throw(RuntimeException) { return sal_True; } -//-------------------------------------------------------------------------- void SAL_CALL OAuthenticationContinuation::setPassword( const ::rtl::OUString& _rPassword ) throw(RuntimeException) { m_sPassword = _rPassword; } -//-------------------------------------------------------------------------- Sequence< RememberAuthentication > SAL_CALL OAuthenticationContinuation::getRememberPasswordModes( RememberAuthentication& _reDefault ) throw(RuntimeException) { Sequence< RememberAuthentication > aReturn(1); @@ -261,25 +248,21 @@ Sequence< RememberAuthentication > SAL_CALL OAuthenticationContinuation::getReme return aReturn; } -//-------------------------------------------------------------------------- void SAL_CALL OAuthenticationContinuation::setRememberPassword( RememberAuthentication _eRemember ) throw(RuntimeException) { m_bRemberPassword = (RememberAuthentication_NO != _eRemember); } -//-------------------------------------------------------------------------- sal_Bool SAL_CALL OAuthenticationContinuation::canSetAccount( ) throw(RuntimeException) { return sal_False; } -//-------------------------------------------------------------------------- void SAL_CALL OAuthenticationContinuation::setAccount( const ::rtl::OUString& ) throw(RuntimeException) { DBG_ERROR("OAuthenticationContinuation::setAccount: not supported!"); } -//-------------------------------------------------------------------------- Sequence< RememberAuthentication > SAL_CALL OAuthenticationContinuation::getRememberAccountModes( RememberAuthentication& _reDefault ) throw(RuntimeException) { Sequence < RememberAuthentication > aReturn(1); @@ -288,7 +271,6 @@ Sequence< RememberAuthentication > SAL_CALL OAuthenticationContinuation::getReme return aReturn; } -//-------------------------------------------------------------------------- void SAL_CALL OAuthenticationContinuation::setRememberAccount( RememberAuthentication /*Remember*/ ) throw(RuntimeException) { DBG_ERROR("OAuthenticationContinuation::setRememberAccount: not supported!"); @@ -440,10 +422,8 @@ void OSharedConnectionManager::addEventListener(const Reference<XConnection>& _r osl_incrementInterlockedCount(&_rIter->second.nALiveCount); } -//---------------------------------------------------------------------- namespace { - //------------------------------------------------------------------ Sequence< PropertyValue > lcl_filterDriverProperties( const Reference< XDriver >& _xDriver, const ::rtl::OUString& _sUrl, const Sequence< PropertyValue >& _rDataSourceSettings, const AsciiPropertyValue* _pKnownSettings ) { @@ -485,15 +465,13 @@ namespace } } if ( !aRet.empty() ) - return Sequence< PropertyValue >(&(*aRet.begin()),aRet.size()); + return Sequence< PropertyValue >(&(*aRet.begin()),aRet.size()); } return Sequence< PropertyValue >(); } - //------------------------------------------------------------------ typedef ::std::map< ::rtl::OUString, sal_Int32 > PropertyAttributeCache; - //------------------------------------------------------------------ struct IsDefaultAndNotRemoveable : public ::std::unary_function< PropertyValue, bool > { private: @@ -522,13 +500,12 @@ namespace //= ODatabaseContext //============================================================ DBG_NAME(ODatabaseSource) -//-------------------------------------------------------------------------- + extern "C" void SAL_CALL createRegistryInfo_ODatabaseSource() { static ::dba::OAutoRegistration< ODatabaseSource > aAutoRegistration; } -//-------------------------------------------------------------------------- ODatabaseSource::ODatabaseSource(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl) :ModelDependentComponent( _pImpl ) ,ODatabaseSource_Base( getMutex() ) @@ -541,7 +518,6 @@ ODatabaseSource::ODatabaseSource(const ::rtl::Reference<ODatabaseModelImpl>& _pI OSL_TRACE( "DS: ctor: %p: %p", this, m_pImpl.get() ); } -//-------------------------------------------------------------------------- ODatabaseSource::~ODatabaseSource() { OSL_TRACE( "DS: dtor: %p: %p", this, m_pImpl.get() ); @@ -553,7 +529,6 @@ ODatabaseSource::~ODatabaseSource() } } -//-------------------------------------------------------------------------- void ODatabaseSource::setName( const Reference< XDocumentDataSource >& _rxDocument, const ::rtl::OUString& _rNewName, DBContextAccess ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::setName" ); @@ -565,7 +540,6 @@ void ODatabaseSource::setName( const Reference< XDocumentDataSource >& _rxDocume } // com::sun::star::lang::XTypeProvider -//-------------------------------------------------------------------------- Sequence< Type > ODatabaseSource::getTypes() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getTypes" ); @@ -579,7 +553,6 @@ Sequence< Type > ODatabaseSource::getTypes() throw (RuntimeException) ); } -//-------------------------------------------------------------------------- Sequence< sal_Int8 > ODatabaseSource::getImplementationId() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getImplementationId" ); @@ -597,55 +570,48 @@ Sequence< sal_Int8 > ODatabaseSource::getImplementationId() throw (RuntimeExcept } // com::sun::star::uno::XInterface -//-------------------------------------------------------------------------- Any ODatabaseSource::queryInterface( const Type & rType ) throw (RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::queryInterface" ); Any aIface = ODatabaseSource_Base::queryInterface( rType ); if ( !aIface.hasValue() ) aIface = ::cppu::OPropertySetHelper::queryInterface( rType ); return aIface; } -//-------------------------------------------------------------------------- void ODatabaseSource::acquire() throw () { ODatabaseSource_Base::acquire(); } -//-------------------------------------------------------------------------- void ODatabaseSource::release() throw () { ODatabaseSource_Base::release(); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODatabaseSource::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(RuntimeException) { if ( m_pImpl.is() ) m_pImpl->disposing(Source); } // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString ODatabaseSource::getImplementationName( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getImplementationName" ); return getImplementationName_static(); } -//------------------------------------------------------------------------------ rtl::OUString ODatabaseSource::getImplementationName_static( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getImplementationName_static" ); return rtl::OUString::createFromAscii("com.sun.star.comp.dba.ODatabaseSource"); } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > ODatabaseSource::getSupportedServiceNames( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getSupportedServiceNames" ); return getSupportedServiceNames_static(); } -//------------------------------------------------------------------------------ + Reference< XInterface > ODatabaseSource::Create( const Reference< XComponentContext >& _rxContext ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::Create" ); @@ -654,7 +620,6 @@ Reference< XInterface > ODatabaseSource::Create( const Reference< XComponentCont return xDBContext->createInstance(); } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > ODatabaseSource::getSupportedServiceNames_static( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getSupportedServiceNames_static" ); @@ -664,14 +629,13 @@ Sequence< ::rtl::OUString > ODatabaseSource::getSupportedServiceNames_static( ) return aSNS; } -//------------------------------------------------------------------------------ sal_Bool ODatabaseSource::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::supportsService" ); return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } + // OComponentHelper -//------------------------------------------------------------------------------ void ODatabaseSource::disposing() { OSL_TRACE( "DS: disp: %p, %p", this, m_pImpl.get() ); @@ -685,7 +649,7 @@ void ODatabaseSource::disposing() ODatabaseDocument::clearObjectContainer(m_pImpl->m_xTableDefinitions); m_pImpl.clear(); } -//------------------------------------------------------------------------------ + Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const ::rtl::OUString& _rUid, const ::rtl::OUString& _rPwd) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::buildLowLevelConnection" ); @@ -796,7 +760,6 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const ::rtl::O } // OPropertySetHelper -//------------------------------------------------------------------------------ Reference< XPropertySetInfo > ODatabaseSource::getPropertySetInfo() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getPropertySetInfo" ); @@ -804,7 +767,6 @@ Reference< XPropertySetInfo > ODatabaseSource::getPropertySetInfo() throw (Runt } // comphelper::OPropertyArrayUsageHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper* ODatabaseSource::createArrayHelper( ) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::createArrayHelper" ); @@ -826,16 +788,13 @@ Reference< XPropertySetInfo > ODatabaseSource::getPropertySetInfo() throw (Runt } // cppu::OPropertySetHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& ODatabaseSource::getInfoHelper() { return *getArrayHelper(); } -//------------------------------------------------------------------------------ sal_Bool ODatabaseSource::convertFastPropertyValue(Any & rConvertedValue, Any & rOldValue, sal_Int32 nHandle, const Any& rValue ) throw( IllegalArgumentException ) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::convertFastPropertyValue" ); sal_Bool bModified(sal_False); if ( m_pImpl.is() ) { @@ -907,7 +866,6 @@ sal_Bool ODatabaseSource::convertFastPropertyValue(Any & rConvertedValue, Any & return bModified; } -//------------------------------------------------------------------------------ namespace { struct SelectPropertyName : public ::std::unary_function< PropertyValue, ::rtl::OUString > @@ -980,7 +938,6 @@ namespace } } -//------------------------------------------------------------------------------ void ODatabaseSource::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::setFastPropertyValue_NoBroadcast" ); @@ -1026,7 +983,6 @@ void ODatabaseSource::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const } } -//------------------------------------------------------------------------------ void ODatabaseSource::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getFastPropertyValue" ); @@ -1115,7 +1071,6 @@ void ODatabaseSource::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) con } // XDataSource -//------------------------------------------------------------------------------ void ODatabaseSource::setLoginTimeout(sal_Int32 seconds) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::setLoginTimeout" ); @@ -1123,7 +1078,6 @@ void ODatabaseSource::setLoginTimeout(sal_Int32 seconds) throw( SQLException, Ru m_pImpl->m_nLoginTimeout = seconds; } -//------------------------------------------------------------------------------ sal_Int32 ODatabaseSource::getLoginTimeout(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getLoginTimeout" ); @@ -1131,33 +1085,31 @@ sal_Int32 ODatabaseSource::getLoginTimeout(void) throw( SQLException, RuntimeExc return m_pImpl->m_nLoginTimeout; } - // XCompletedConnection -//------------------------------------------------------------------------------ Reference< XConnection > SAL_CALL ODatabaseSource::connectWithCompletion( const Reference< XInteractionHandler >& _rxHandler ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::connectWithCompletion" ); return connectWithCompletion(_rxHandler,sal_False); } -// ----------------------------------------------------------------------------- + Reference< XConnection > ODatabaseSource::getConnection(const rtl::OUString& user, const rtl::OUString& password) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getConnection" ); return getConnection(user,password,sal_False); } -// ----------------------------------------------------------------------------- + Reference< XConnection > SAL_CALL ODatabaseSource::getIsolatedConnection( const ::rtl::OUString& user, const ::rtl::OUString& password ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getIsolatedConnection" ); return getConnection(user,password,sal_True); } -// ----------------------------------------------------------------------------- + Reference< XConnection > SAL_CALL ODatabaseSource::getIsolatedConnectionWithCompletion( const Reference< XInteractionHandler >& _rxHandler ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getIsolatedConnectionWithCompletion" ); return connectWithCompletion(_rxHandler,sal_True); } -// ----------------------------------------------------------------------------- + Reference< XConnection > SAL_CALL ODatabaseSource::connectWithCompletion( const Reference< XInteractionHandler >& _rxHandler,sal_Bool _bIsolated ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::connectWithCompletion" ); @@ -1245,7 +1197,6 @@ Reference< XConnection > SAL_CALL ODatabaseSource::connectWithCompletion( const } } -// ----------------------------------------------------------------------------- Reference< XConnection > ODatabaseSource::buildIsolatedConnection(const rtl::OUString& user, const rtl::OUString& password) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::buildIsolatedConnection" ); @@ -1260,7 +1211,7 @@ Reference< XConnection > ODatabaseSource::buildIsolatedConnection(const rtl::OUS } return xConn; } -//------------------------------------------------------------------------------ + Reference< XConnection > ODatabaseSource::getConnection(const rtl::OUString& user, const rtl::OUString& password,sal_Bool _bIsolated) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getConnection" ); @@ -1293,7 +1244,6 @@ Reference< XConnection > ODatabaseSource::getConnection(const rtl::OUString& use return xConn; } -//------------------------------------------------------------------------------ Reference< XNameAccess > SAL_CALL ODatabaseSource::getBookmarks( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getBookmarks" ); @@ -1301,7 +1251,6 @@ Reference< XNameAccess > SAL_CALL ODatabaseSource::getBookmarks( ) throw (Runti return static_cast< XNameContainer* >(&m_aBookmarks); } -//------------------------------------------------------------------------------ Reference< XNameAccess > SAL_CALL ODatabaseSource::getQueryDefinitions( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getQueryDefinitions" ); @@ -1332,9 +1281,8 @@ Reference< XNameAccess > SAL_CALL ODatabaseSource::getQueryDefinitions( ) throw( } return xContainer; } -//------------------------------------------------------------------------------ + // XTablesSupplier -//------------------------------------------------------------------------------ Reference< XNameAccess > ODatabaseSource::getTables() throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getTables" ); @@ -1349,7 +1297,7 @@ Reference< XNameAccess > ODatabaseSource::getTables() throw( RuntimeException ) } return xContainer; } -// ----------------------------------------------------------------------------- + void SAL_CALL ODatabaseSource::flush( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::flush" ); @@ -1379,7 +1327,6 @@ void SAL_CALL ODatabaseSource::flush( ) throw (RuntimeException) } } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseSource::flushed( const EventObject& /*rEvent*/ ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::flushed" ); @@ -1413,19 +1360,18 @@ void SAL_CALL ODatabaseSource::flushed( const EventObject& /*rEvent*/ ) throw (R m_pImpl->setModified( bWasModified ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseSource::addFlushListener( const Reference< ::com::sun::star::util::XFlushListener >& _xListener ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::addFlushListener" ); m_aFlushListeners.addInterface(_xListener); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODatabaseSource::removeFlushListener( const Reference< ::com::sun::star::util::XFlushListener >& _xListener ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::removeFlushListener" ); m_aFlushListeners.removeInterface(_xListener); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODatabaseSource::elementInserted( const ContainerEvent& /*Event*/ ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::elementInserted" ); @@ -1433,7 +1379,7 @@ void SAL_CALL ODatabaseSource::elementInserted( const ContainerEvent& /*Event*/ if ( m_pImpl.is() ) m_pImpl->setModified(sal_True); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODatabaseSource::elementRemoved( const ContainerEvent& /*Event*/ ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::elementRemoved" ); @@ -1441,7 +1387,7 @@ void SAL_CALL ODatabaseSource::elementRemoved( const ContainerEvent& /*Event*/ ) if ( m_pImpl.is() ) m_pImpl->setModified(sal_True); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODatabaseSource::elementReplaced( const ContainerEvent& /*Event*/ ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::elementReplaced" ); @@ -1449,7 +1395,7 @@ void SAL_CALL ODatabaseSource::elementReplaced( const ContainerEvent& /*Event*/ if ( m_pImpl.is() ) m_pImpl->setModified(sal_True); } -// ----------------------------------------------------------------------------- + // XDocumentDataSource Reference< XOfficeDatabaseDocument > SAL_CALL ODatabaseSource::getDatabaseDocument() throw (RuntimeException) { @@ -1462,16 +1408,12 @@ Reference< XOfficeDatabaseDocument > SAL_CALL ODatabaseSource::getDatabaseDocume return Reference< XOfficeDatabaseDocument >( xModel, UNO_QUERY_THROW ); } -// ----------------------------------------------------------------------------- + Reference< XInterface > ODatabaseSource::getThis() const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getThis" ); return *const_cast< ODatabaseSource* >( this ); } -// ----------------------------------------------------------------------------- -//........................................................................ -} // namespace dbaccess -//........................................................................ - +} // namespace dbaccess /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/datasource.hxx b/dbaccess/source/core/dataaccess/datasource.hxx index 305cf584b..94c91fc59 100644 --- a/dbaccess/source/core/dataaccess/datasource.hxx +++ b/dbaccess/source/core/dataaccess/datasource.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -61,10 +61,8 @@ #include <com/sun/star/sdb/XDocumentDataSource.hpp> #include "ModelImpl.hxx" -//........................................................................ namespace dbaccess { -//........................................................................ class OSharedConnectionManager; class OChildCommitListen_Impl; @@ -232,9 +230,7 @@ protected: using ::cppu::OPropertySetHelper::getFastPropertyValue; }; -//........................................................................ } // namespace dbaccess -//........................................................................ #endif // _DBA_COREDATAACCESS_DATALINK_HXX_ diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx index 9d229988d..0efce9c4a 100644 --- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx +++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -60,15 +60,12 @@ using namespace ::comphelper; using namespace ::cppu; using namespace ::com::sun::star::ucb; -//........................................................................ namespace dbaccess { -//........................................................................ //========================================================================== //= ODefinitionContainer_Impl //========================================================================== -//-------------------------------------------------------------------------- void ODefinitionContainer_Impl::erase( TContentPtr _pDefinition ) { NamedDefinitions::iterator aPos = find( _pDefinition ); @@ -76,7 +73,6 @@ void ODefinitionContainer_Impl::erase( TContentPtr _pDefinition ) m_aDefinitions.erase( aPos ); } -//-------------------------------------------------------------------------- ODefinitionContainer_Impl::const_iterator ODefinitionContainer_Impl::find( TContentPtr _pDefinition ) const { return ::std::find_if( @@ -89,7 +85,6 @@ ODefinitionContainer_Impl::const_iterator ODefinitionContainer_Impl::find( TCont ); } -//-------------------------------------------------------------------------- ODefinitionContainer_Impl::iterator ODefinitionContainer_Impl::find( TContentPtr _pDefinition ) { return ::std::find_if( @@ -106,7 +101,7 @@ ODefinitionContainer_Impl::iterator ODefinitionContainer_Impl::find( TContentPtr //= ODefinitionContainer //========================================================================== DBG_NAME(ODefinitionContainer) -//-------------------------------------------------------------------------- + ODefinitionContainer::ODefinitionContainer( const Reference< XMultiServiceFactory >& _xORB , const Reference< XInterface >& _xParentContainer , const TContentPtr& _pImpl @@ -134,7 +129,6 @@ ODefinitionContainer::ODefinitionContainer( const Reference< XMultiServiceFact DBG_CTOR(ODefinitionContainer, NULL); } -//-------------------------------------------------------------------------- void SAL_CALL ODefinitionContainer::disposing() { OContentHelper::disposing(); @@ -166,7 +160,6 @@ void SAL_CALL ODefinitionContainer::disposing() m_aDocumentMap.clear(); } -//-------------------------------------------------------------------------- ODefinitionContainer::~ODefinitionContainer() { DBG_DTOR(ODefinitionContainer, NULL); @@ -175,12 +168,11 @@ ODefinitionContainer::~ODefinitionContainer() IMPLEMENT_FORWARD_XINTERFACE2( ODefinitionContainer,OContentHelper,ODefinitionContainer_Base) IMPLEMENT_TYPEPROVIDER2(ODefinitionContainer,OContentHelper,ODefinitionContainer_Base); // XServiceInfo -//-------------------------------------------------------------------------- ::rtl::OUString SAL_CALL ODefinitionContainer::getImplementationName( ) throw(RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.ODefinitionContainer")); } -//-------------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL ODefinitionContainer::getSupportedServiceNames( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aReturn(2); @@ -190,7 +182,6 @@ Sequence< ::rtl::OUString > SAL_CALL ODefinitionContainer::getSupportedServiceNa } // XNameContainer -//-------------------------------------------------------------------------- void SAL_CALL ODefinitionContainer::insertByName( const ::rtl::OUString& _rName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) { ResettableMutexGuard aGuard(m_aMutex); @@ -204,7 +195,6 @@ void SAL_CALL ODefinitionContainer::insertByName( const ::rtl::OUString& _rName, notifyByName( aGuard, _rName, xNewElement, NULL, E_INSERTED, ContainerListemers ); } -//-------------------------------------------------------------------------- void SAL_CALL ODefinitionContainer::removeByName( const ::rtl::OUString& _rName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) { ResettableMutexGuard aGuard(m_aMutex); @@ -229,7 +219,6 @@ void SAL_CALL ODefinitionContainer::removeByName( const ::rtl::OUString& _rName } // XNameReplace -//-------------------------------------------------------------------------- void SAL_CALL ODefinitionContainer::replaceByName( const ::rtl::OUString& _rName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) { ResettableMutexGuard aGuard(m_aMutex); @@ -249,7 +238,6 @@ void SAL_CALL ODefinitionContainer::replaceByName( const ::rtl::OUString& _rName disposeComponent(xOldElement); } -// ----------------------------------------------------------------------------- namespace { typedef Reference< XVeto > ( SAL_CALL XContainerApproveListener::*ContainerApprovalMethod )( const ContainerEvent& ); @@ -288,7 +276,6 @@ namespace }; } -// ----------------------------------------------------------------------------- void ODefinitionContainer::notifyByName( ResettableMutexGuard& _rGuard, const ::rtl::OUString& _rName, const Reference< XContent >& _xNewElement, const Reference< XContent >& _xOldElement, ContainerOperation _eOperation, ListenerType _eType ) @@ -331,43 +318,36 @@ void ODefinitionContainer::notifyByName( ResettableMutexGuard& _rGuard, const :: _rGuard.reset(); } -//-------------------------------------------------------------------------- void SAL_CALL ODefinitionContainer::addContainerListener( const Reference< XContainerListener >& _rxListener ) throw(RuntimeException) { if (_rxListener.is()) m_aContainerListeners.addInterface(_rxListener); } -//-------------------------------------------------------------------------- void SAL_CALL ODefinitionContainer::removeContainerListener( const Reference< XContainerListener >& _rxListener ) throw(RuntimeException) { if (_rxListener.is()) m_aContainerListeners.removeInterface(_rxListener); } -//-------------------------------------------------------------------------- void SAL_CALL ODefinitionContainer::addContainerApproveListener( const Reference< XContainerApproveListener >& _Listener ) throw (RuntimeException) { if ( _Listener.is() ) m_aApproveListeners.addInterface( _Listener ); } -//-------------------------------------------------------------------------- void SAL_CALL ODefinitionContainer::removeContainerApproveListener( const Reference< XContainerApproveListener >& _Listener ) throw (RuntimeException) { if ( _Listener.is() ) m_aApproveListeners.removeInterface( _Listener ); } - // XElementAccess -//-------------------------------------------------------------------------- Type SAL_CALL ODefinitionContainer::getElementType( ) throw (RuntimeException) { return ::getCppuType( static_cast< Reference< XContent >* >(NULL) ); } -//-------------------------------------------------------------------------- sal_Bool SAL_CALL ODefinitionContainer::hasElements( ) throw (RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -375,14 +355,12 @@ sal_Bool SAL_CALL ODefinitionContainer::hasElements( ) throw (RuntimeException) } // XEnumerationAccess -//-------------------------------------------------------------------------- Reference< XEnumeration > SAL_CALL ODefinitionContainer::createEnumeration( ) throw(RuntimeException) { MutexGuard aGuard(m_aMutex); return new ::comphelper::OEnumerationByIndex(static_cast<XIndexAccess*>(this)); } -//-------------------------------------------------------------------------- // XIndexAccess sal_Int32 SAL_CALL ODefinitionContainer::getCount( ) throw(RuntimeException) { @@ -390,7 +368,6 @@ sal_Int32 SAL_CALL ODefinitionContainer::getCount( ) throw(RuntimeException) return m_aDocuments.size(); } -//-------------------------------------------------------------------------- Any SAL_CALL ODefinitionContainer::getByIndex( sal_Int32 _nIndex ) throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -411,7 +388,6 @@ Any SAL_CALL ODefinitionContainer::getByIndex( sal_Int32 _nIndex ) throw(IndexOu return makeAny(xProp); } -//-------------------------------------------------------------------------- Any SAL_CALL ODefinitionContainer::getByName( const ::rtl::OUString& _rName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -419,7 +395,6 @@ Any SAL_CALL ODefinitionContainer::getByName( const ::rtl::OUString& _rName ) th return makeAny( implGetByName( _rName, sal_True ) ); } -//-------------------------------------------------------------------------- Reference< XContent > ODefinitionContainer::implGetByName(const ::rtl::OUString& _rName, sal_Bool _bReadIfNeccessary) throw (NoSuchElementException) { Documents::iterator aMapPos = m_aDocumentMap.find(_rName); @@ -441,7 +416,6 @@ Reference< XContent > ODefinitionContainer::implGetByName(const ::rtl::OUString& return xProp; } -//-------------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL ODefinitionContainer::getElementNames( ) throw(RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -460,7 +434,6 @@ Sequence< ::rtl::OUString > SAL_CALL ODefinitionContainer::getElementNames( ) t return aNames; } -//-------------------------------------------------------------------------- sal_Bool SAL_CALL ODefinitionContainer::hasByName( const ::rtl::OUString& _rName ) throw(RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -468,7 +441,6 @@ sal_Bool SAL_CALL ODefinitionContainer::hasByName( const ::rtl::OUString& _rName return checkExistence(_rName); } -//-------------------------------------------------------------------------- void SAL_CALL ODefinitionContainer::disposing( const EventObject& _rSource ) throw(RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -487,7 +459,6 @@ void SAL_CALL ODefinitionContainer::disposing( const EventObject& _rSource ) thr } } -//-------------------------------------------------------------------------- void ODefinitionContainer::implRemove(const ::rtl::OUString& _rName) { // from the object maps @@ -503,7 +474,6 @@ void ODefinitionContainer::implRemove(const ::rtl::OUString& _rName) } } -//-------------------------------------------------------------------------- namespace { bool lcl_ensureName( const Reference< XContent >& _rxContent, const ::rtl::OUString& _rName ) @@ -511,7 +481,6 @@ namespace if ( !_rxContent.is() ) return true; - // .......................................................... // obtain the current name. If it's the same as the new one, // don't do anything try @@ -530,7 +499,6 @@ namespace OSL_ENSURE( sal_False, "lcl_ensureName: caught an exception while obtaining the current name!" ); } - // .......................................................... // set the new name Reference< XRename > xRename( _rxContent, UNO_QUERY ); OSL_ENSURE( xRename.is(), "lcl_ensureName: invalid content (not renameable)!" ); @@ -548,7 +516,7 @@ namespace return false; } } -//-------------------------------------------------------------------------- + void ODefinitionContainer::implAppend(const ::rtl::OUString& _rName, const Reference< XContent >& _rxNewObject) { MutexGuard aGuard(m_aMutex); @@ -592,7 +560,6 @@ void ODefinitionContainer::implAppend(const ::rtl::OUString& _rName, const Refer } } -//-------------------------------------------------------------------------- void ODefinitionContainer::implReplace(const ::rtl::OUString& _rName, const Reference< XContent >& _rxNewObject) { DBG_ASSERT(checkExistence(_rName), "ODefinitionContainer::implReplace : invalid name !"); @@ -603,7 +570,6 @@ void ODefinitionContainer::implReplace(const ::rtl::OUString& _rName, const Refe addObjectListener(aFind->second); } -// ----------------------------------------------------------------------------- void ODefinitionContainer::approveNewObject(const ::rtl::OUString& _sName,const Reference< XContent >& _rxObject) const { // check the arguments @@ -644,7 +610,6 @@ void ODefinitionContainer::approveNewObject(const ::rtl::OUString& _sName,const *this ); } -// ----------------------------------------------------------------------------- // XPropertyChangeListener void SAL_CALL ODefinitionContainer::propertyChange( const PropertyChangeEvent& evt ) throw (RuntimeException) { @@ -670,7 +635,7 @@ void SAL_CALL ODefinitionContainer::propertyChange( const PropertyChangeEvent& e m_bInPropertyChange = sal_False; } } -// ----------------------------------------------------------------------------- + // XVetoableChangeListener void SAL_CALL ODefinitionContainer::vetoableChange( const PropertyChangeEvent& aEvent ) throw (PropertyVetoException, RuntimeException) { @@ -684,7 +649,7 @@ void SAL_CALL ODefinitionContainer::vetoableChange( const PropertyChangeEvent& a throw PropertyVetoException(); } } -// ----------------------------------------------------------------------------- + void ODefinitionContainer::addObjectListener(const Reference< XContent >& _xNewObject) { OSL_ENSURE(_xNewObject.is(),"ODefinitionContainer::addObjectListener: Object is null!"); @@ -695,7 +660,7 @@ void ODefinitionContainer::addObjectListener(const Reference< XContent >& _xNewO xProp->addVetoableChangeListener(PROPERTY_NAME, this); } } -// ----------------------------------------------------------------------------- + void ODefinitionContainer::removeObjectListener(const Reference< XContent >& _xNewObject) { Reference<XPropertySet> xProp(_xNewObject,UNO_QUERY); @@ -705,15 +670,12 @@ void ODefinitionContainer::removeObjectListener(const Reference< XContent >& _xN xProp->removeVetoableChangeListener(PROPERTY_NAME, this); } } -// ----------------------------------------------------------------------------- + sal_Bool ODefinitionContainer::checkExistence(const ::rtl::OUString& _rName) { return m_aDocumentMap.find(_rName) != m_aDocumentMap.end(); } -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index 9e9c228f4..de94176e3 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -68,13 +68,11 @@ using namespace ::osl; using namespace ::comphelper; using namespace ::cppu; -//........................................................................ namespace dbaccess { -//........................................................................ //========================================================================== -//= LocalNameApproval +//= LocalNameApproval //========================================================================== class LocalNameApproval : public IContainerApprove { @@ -92,7 +90,6 @@ public: void SAL_CALL approveElement( const ::rtl::OUString& _rName, const Reference< XInterface >& _rxElement ); }; -//-------------------------------------------------------------------------- void SAL_CALL LocalNameApproval::approveElement( const ::rtl::OUString& _rName, const Reference< XInterface >& /*_rxElement*/ ) { if ( _rName.indexOf( '/' ) != -1 ) @@ -107,7 +104,7 @@ void SAL_CALL LocalNameApproval::approveElement( const ::rtl::OUString& _rName, //= ODocumentContainer //========================================================================== DBG_NAME(ODocumentContainer) -//-------------------------------------------------------------------------- + ODocumentContainer::ODocumentContainer(const Reference< XMultiServiceFactory >& _xORB ,const Reference< XInterface >& _xParentContainer ,const TContentPtr& _pImpl @@ -124,7 +121,6 @@ ODocumentContainer::ODocumentContainer(const Reference< XMultiServiceFactory >& setElementApproval( PContainerApprove( new LocalNameApproval ( _xORB ) ) ); } -//-------------------------------------------------------------------------- ODocumentContainer::~ODocumentContainer() { DBG_DTOR(ODocumentContainer, NULL); @@ -135,7 +131,7 @@ ODocumentContainer::~ODocumentContainer() dispose(); } } -// ----------------------------------------------------------------------------- + IMPLEMENT_FORWARD_XINTERFACE3( ODocumentContainer,ODefinitionContainer,ODocumentContainer_Base,OPropertyStateContainer) IMPLEMENT_TYPEPROVIDER3(ODocumentContainer,ODefinitionContainer,OPropertyStateContainer,ODocumentContainer_Base); IMPLEMENT_SERVICE_INFO_IMPLNAME(ODocumentContainer, "com.sun.star.comp.dba.ODocumentContainer"); @@ -149,13 +145,11 @@ Sequence< ::rtl::OUString > SAL_CALL ODocumentContainer::getSupportedServiceName return aSupported; } -// ----------------------------------------------------------------------------- ::rtl::OUString ODocumentContainer::determineContentType() const { return ::rtl::OUString(); } -//-------------------------------------------------------------------------- Reference< XContent > ODocumentContainer::createObject( const ::rtl::OUString& _rName) { const ODefinitionContainer_Impl& rDefinitions( getDefinitions() ); @@ -165,7 +159,7 @@ Reference< XContent > ODocumentContainer::createObject( const ::rtl::OUString& _ return new ODocumentContainer( m_aContext.getLegacyServiceFactory(), *this, aFind->second, m_bFormsContainer ); return new ODocumentDefinition( *this, m_aContext.getLegacyServiceFactory(), aFind->second, m_bFormsContainer ); } -// ----------------------------------------------------------------------------- + Reference< XInterface > SAL_CALL ODocumentContainer::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw (Exception, RuntimeException) { return createInstanceWithArguments( aServiceSpecifier, Sequence< Any >() ); @@ -184,7 +178,6 @@ namespace } } -// ----------------------------------------------------------------------------- Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const Sequence< Any >& _aArguments ) throw (Exception, RuntimeException) { Reference< XInterface > xRet; @@ -238,7 +231,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments if ( bNew ) { const static ::rtl::OUString sBaseName(RTL_CONSTASCII_USTRINGPARAM("Obj")); - // ----------------------------------------------------------------------------- + sPersistentName = sBaseName; sPersistentName += ::rtl::OUString::valueOf(sal_Int32(rDefinitions.size() + 1)); Reference<XNameAccess> xElements(getContainerStorage(),UNO_QUERY); @@ -317,11 +310,9 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments Reference< XCommandProcessor > xCommandProcessor(xContent,UNO_QUERY); if ( xContent.is() ) { - xCommandProcessor->execute(aCommand,-1,Reference< XCommandEnvironment >()); + xCommandProcessor->execute(aCommand,-1,Reference< XCommandEnvironment >()); } } - - // xRet = xContent; } else if ( ServiceSpecifier == SERVICE_NAME_FORM_COLLECTION || SERVICE_NAME_REPORT_COLLECTION == ServiceSpecifier ) { @@ -356,7 +347,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments pElementImpl = aFind->second; OSL_ENSURE( pElementImpl ," Invalid entry in map!"); xContent = new ODocumentContainer( m_aContext.getLegacyServiceFactory(), *this, pElementImpl, ServiceSpecifier == SERVICE_NAME_FORM_COLLECTION ); - + // copy children if ( xCopyFrom.is() ) { @@ -392,7 +383,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments { if ( m_bFormsContainer ) sServiceName = SERVICE_NAME_FORM_COLLECTION; - else + else sServiceName = SERVICE_NAME_REPORT_COLLECTION; } else @@ -409,7 +400,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments xRet = xContent; return xRet; } -// ----------------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL ODocumentContainer::getAvailableServiceNames( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSe(3); @@ -418,11 +409,11 @@ Sequence< ::rtl::OUString > SAL_CALL ODocumentContainer::getAvailableServiceName aSe[2] = SERVICE_NAME_REPORT_COLLECTION; return aSe; } -// ----------------------------------------------------------------------------- + Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 CommandId, const Reference< XCommandEnvironment >& Environment ) throw (Exception, CommandAbortedException, RuntimeException) { Any aRet; - if ( aCommand.Name.compareToAscii( "open" ) == 0 ) + if ( aCommand.Name.compareToAscii( "open" ) == 0 ) { ////////////////////////////////////////////////////////////////// // open command for a folder content @@ -499,11 +490,11 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com dispose(); } - else + else aRet = OContentHelper::execute(aCommand,CommandId,Environment); return aRet; } -// ----------------------------------------------------------------------------- + namespace { sal_Bool lcl_queryContent(const ::rtl::OUString& _sName,Reference< XNameContainer >& _xNameContainer,Any& _rRet,::rtl::OUString& _sSimpleName) @@ -530,13 +521,13 @@ namespace } } if ( nIndex == -1 ) - _sSimpleName = sName; // a content - else + _sSimpleName = sName; // a content + else _xNameContainer.clear(); // a sub folder doesn't exist return bRet; } } -// ----------------------------------------------------------------------------- + Reference< XComponent > SAL_CALL ODocumentContainer::loadComponentFromURL( const ::rtl::OUString& _sURL , const ::rtl::OUString& /*TargetFrameName*/ , sal_Int32 /*SearchFlags*/ @@ -586,7 +577,7 @@ Reference< XComponent > SAL_CALL ODocumentContainer::loadComponentFromURL( const } return xComp; } -// ----------------------------------------------------------------------------- + Any SAL_CALL ODocumentContainer::getByHierarchicalName( const ::rtl::OUString& _sName ) throw (NoSuchElementException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -597,7 +588,7 @@ Any SAL_CALL ODocumentContainer::getByHierarchicalName( const ::rtl::OUString& _ return aContent; throw NoSuchElementException(_sName,*this); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL ODocumentContainer::hasByHierarchicalName( const ::rtl::OUString& _sName ) throw (RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -606,7 +597,7 @@ sal_Bool SAL_CALL ODocumentContainer::hasByHierarchicalName( const ::rtl::OUStri ::rtl::OUString sName; return lcl_queryContent(_sName,xNameContainer,aContent,sName); } -// ----------------------------------------------------------------------------- + // XHierarchicalNameContainer void SAL_CALL ODocumentContainer::insertByHierarchicalName( const ::rtl::OUString& _sName, const Any& _aElement ) throw (IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) { @@ -620,7 +611,7 @@ void SAL_CALL ODocumentContainer::insertByHierarchicalName( const ::rtl::OUStrin ::rtl::OUString sName; if ( lcl_queryContent(_sName,xNameContainer,aContent,sName) ) throw ElementExistException(_sName,*this); - + if ( !xNameContainer.is() ) { ::rtl::OUString sMessage( DBA_RES( RID_STR_NO_SUB_FOLDER ) ); @@ -631,7 +622,7 @@ void SAL_CALL ODocumentContainer::insertByHierarchicalName( const ::rtl::OUStrin xNameContainer->insertByName(sName,_aElement); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODocumentContainer::removeByHierarchicalName( const ::rtl::OUString& _sName ) throw (NoSuchElementException, WrappedTargetException, RuntimeException) { if ( !_sName.getLength() ) @@ -646,7 +637,7 @@ void SAL_CALL ODocumentContainer::removeByHierarchicalName( const ::rtl::OUStrin xNameContainer->removeByName(sName); } -// ----------------------------------------------------------------------------- + // XHierarchicalNameReplace void SAL_CALL ODocumentContainer::replaceByHierarchicalName( const ::rtl::OUString& _sName, const Any& _aElement ) throw (IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) { @@ -664,14 +655,12 @@ void SAL_CALL ODocumentContainer::replaceByHierarchicalName( const ::rtl::OUStri xNameContainer->replaceByName(sName,_aElement); } -// ----------------------------------------------------------------------------- ::rtl::OUString SAL_CALL ODocumentContainer::getHierarchicalName() throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); return impl_getHierarchicalName( false ); } -// ----------------------------------------------------------------------------- ::rtl::OUString SAL_CALL ODocumentContainer::composeHierarchicalName( const ::rtl::OUString& i_rRelativeName ) throw (IllegalArgumentException, NoSupportException, RuntimeException) { ::rtl::OUStringBuffer aBuffer; @@ -681,7 +670,6 @@ void SAL_CALL ODocumentContainer::replaceByHierarchicalName( const ::rtl::OUStri return aBuffer.makeStringAndClear(); } -// ----------------------------------------------------------------------------- ::rtl::Reference<OContentHelper> ODocumentContainer::getContent(const ::rtl::OUString& _sName) const { ::rtl::Reference<OContentHelper> pContent = NULL; @@ -696,12 +684,12 @@ void SAL_CALL ODocumentContainer::replaceByHierarchicalName( const ::rtl::OUStri } return pContent; } -// ----------------------------------------------------------------------------- + void ODocumentContainer::getPropertyDefaultByHandle( sal_Int32 /*_nHandle*/, Any& _rDefault ) const { _rDefault.clear(); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODocumentContainer::commit( ) throw (::com::sun::star::io::IOException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -717,7 +705,7 @@ void SAL_CALL ODocumentContainer::commit( ) throw (::com::sun::star::io::IOExce if ( xTrans.is() ) xTrans->commit(); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODocumentContainer::revert( ) throw (::com::sun::star::io::IOException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -733,15 +721,14 @@ void SAL_CALL ODocumentContainer::revert( ) throw (::com::sun::star::io::IOExce if ( xTrans.is() ) xTrans->revert(); } -// ----------------------------------------------------------------------------- + Reference< XStorage> ODocumentContainer::getContainerStorage() const -{ +{ return m_pImpl->m_pDataSource ? m_pImpl->m_pDataSource->getStorage( m_bFormsContainer ? ODatabaseModelImpl::E_FORM : ODatabaseModelImpl::E_REPORT ) : Reference< XStorage>(); } -// ----------------------------------------------------------------------------- void SAL_CALL ODocumentContainer::removeByName( const ::rtl::OUString& _rName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) { ResettableMutexGuard aGuard(m_aMutex); @@ -769,8 +756,7 @@ void SAL_CALL ODocumentContainer::removeByName( const ::rtl::OUString& _rName ) notifyByName( aGuard, _rName, NULL, NULL, E_REMOVED, ContainerListemers ); } -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- + void SAL_CALL ODocumentContainer::rename( const ::rtl::OUString& newName ) throw (SQLException, ElementExistException, RuntimeException) { try @@ -794,8 +780,5 @@ void SAL_CALL ODocumentContainer::rename( const ::rtl::OUString& newName ) throw } } -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/documentcontainer.hxx b/dbaccess/source/core/dataaccess/documentcontainer.hxx index 0998a8209..5ef9950ef 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.hxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,10 +39,8 @@ #include <comphelper/proparrhlp.hxx> #include "apitools.hxx" -//........................................................................ namespace dbaccess { -//........................................................................ typedef ::cppu::ImplHelper5 < ::com::sun::star::frame::XComponentLoader , ::com::sun::star::lang::XMultiServiceFactory , ::com::sun::star::container::XHierarchicalNameContainer @@ -140,9 +138,6 @@ protected: virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; }; -//........................................................................ } // namespace dbaccess -//........................................................................ #endif // _DBA_COREDATAACCESS_DOCUMENTCONTAINER_HXX_ - diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index 096cec1c6..1cc87e2fc 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -141,10 +141,9 @@ namespace DatabaseObject = sdb::application::DatabaseObject; #define DEFAULT_WIDTH 10000 #define DEFAULT_HEIGHT 7500 -//............................................................................. + namespace dbaccess { -//............................................................................. typedef ::boost::optional< bool > optional_bool; @@ -206,7 +205,7 @@ namespace dbaccess virtual void SAL_CALL stateChanged( const lang::EventObject& aEvent, ::sal_Int32 nOldState, ::sal_Int32 nNewState ) throw (uno::RuntimeException); virtual void SAL_CALL disposing( const lang::EventObject& Source ) throw (uno::RuntimeException); }; - //------------------------------------------------------------------ + void SAL_CALL OEmbedObjectHolder::disposing() { if ( m_xBroadCaster.is() ) @@ -214,7 +213,7 @@ namespace dbaccess m_xBroadCaster = NULL; m_pDefinition = NULL; } - //------------------------------------------------------------------ + void SAL_CALL OEmbedObjectHolder::changingState( const lang::EventObject& /*aEvent*/, ::sal_Int32 nOldState, ::sal_Int32 nNewState ) throw (embed::WrongStateException, uno::RuntimeException) { if ( !m_bInChangingState && nNewState == EmbedStates::RUNNING && nOldState == EmbedStates::ACTIVE && m_pDefinition ) @@ -224,7 +223,7 @@ namespace dbaccess m_bInChangingState = false; } } - //------------------------------------------------------------------ + void SAL_CALL OEmbedObjectHolder::stateChanged( const lang::EventObject& aEvent, ::sal_Int32 nOldState, ::sal_Int32 nNewState ) throw (uno::RuntimeException) { if ( !m_bInStateChange && nNewState == EmbedStates::RUNNING && nOldState == EmbedStates::ACTIVE && m_pDefinition ) @@ -239,7 +238,7 @@ namespace dbaccess m_bInStateChange = false; } } - //------------------------------------------------------------------ + void SAL_CALL OEmbedObjectHolder::disposing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException) { m_xBroadCaster = NULL; @@ -353,7 +352,6 @@ namespace dbaccess protected: }; - //------------------------------------------------------------------ void SAL_CALL LifetimeCoupler::disposing( const css::lang::EventObject& /*Source*/ ) throw (RuntimeException) { m_xClient.clear(); @@ -377,14 +375,12 @@ namespace dbaccess virtual void SAL_CALL setName( const ::rtl::OUString& _sName,const Reference<XContent>& _xParent) throw(RuntimeException); }; - //------------------------------------------------------------------ void SAL_CALL ODocumentSaveContinuation::setName( const ::rtl::OUString& _sName,const Reference<XContent>& _xParent) throw(RuntimeException) { m_sName = _sName; m_xParentContainer = _xParent; } -// ----------------------------------------------------------------------------- ::rtl::OUString ODocumentDefinition::GetDocumentServiceFromMediaType( const Reference< XStorage >& _rxContainerStorage, const ::rtl::OUString& _rEntityName, const ::comphelper::ComponentContext& _rContext, Sequence< sal_Int8 >& _rClassId ) @@ -394,7 +390,6 @@ namespace dbaccess _rContext, _rClassId ); } -// ----------------------------------------------------------------------------- ::rtl::OUString ODocumentDefinition::GetDocumentServiceFromMediaType( const ::rtl::OUString& _rMediaType, const ::comphelper::ComponentContext& _rContext, Sequence< sal_Int8 >& _rClassId ) { @@ -442,13 +437,12 @@ namespace dbaccess } return sResult; } -// ----------------------------------------------------------------------------- + //========================================================================== //= ODocumentDefinition //========================================================================== DBG_NAME(ODocumentDefinition) -//-------------------------------------------------------------------------- ODocumentDefinition::ODocumentDefinition( const Reference< XInterface >& _rxContainer, const Reference< XMultiServiceFactory >& _xORB, const TContentPtr& _pImpl, sal_Bool _bForm ) :OContentHelper(_xORB,_rxContainer,_pImpl) @@ -464,7 +458,6 @@ ODocumentDefinition::ODocumentDefinition( const Reference< XInterface >& _rxCont registerProperties(); } -//-------------------------------------------------------------------------- void ODocumentDefinition::initialLoad( const Sequence< sal_Int8 >& i_rClassID, const Sequence< PropertyValue >& i_rCreationArgs, const Reference< XConnection >& i_rConnection ) { @@ -475,7 +468,6 @@ void ODocumentDefinition::initialLoad( const Sequence< sal_Int8 >& i_rClassID, c loadEmbeddedObject( i_rConnection, i_rClassID, i_rCreationArgs, false, false ); } -//-------------------------------------------------------------------------- ODocumentDefinition::~ODocumentDefinition() { DBG_DTOR(ODocumentDefinition, NULL); @@ -492,7 +484,7 @@ ODocumentDefinition::~ODocumentDefinition() m_pInterceptor = NULL; } } -// ----------------------------------------------------------------------------- + void ODocumentDefinition::closeObject() { ::osl::MutexGuard aGuard(m_aMutex); @@ -516,7 +508,7 @@ void ODocumentDefinition::closeObject() } } } -// ----------------------------------------------------------------------------- + void SAL_CALL ODocumentDefinition::disposing() { OContentHelper::disposing(); @@ -530,11 +522,11 @@ void SAL_CALL ODocumentDefinition::disposing() xCloseable->removeCloseListener(this); } } -// ----------------------------------------------------------------------------- + IMPLEMENT_TYPEPROVIDER3(ODocumentDefinition,OContentHelper,OPropertyStateContainer,ODocumentDefinition_Base); IMPLEMENT_FORWARD_XINTERFACE3( ODocumentDefinition,OContentHelper,OPropertyStateContainer,ODocumentDefinition_Base) IMPLEMENT_SERVICE_INFO1(ODocumentDefinition,"com.sun.star.comp.dba.ODocumentDefinition",SERVICE_SDB_DOCUMENTDEFINITION) -//-------------------------------------------------------------------------- + void ODocumentDefinition::registerProperties() { #define REGISTER_PROPERTY( name, location ) \ @@ -549,7 +541,6 @@ void ODocumentDefinition::registerProperties() REGISTER_PROPERTY ( IS_FORM, m_bForm ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODocumentDefinition::getFastPropertyValue( Any& o_rValue, sal_Int32 i_nHandle ) const { if ( i_nHandle == PROPERTY_ID_PERSISTENT_PATH ) @@ -570,21 +561,17 @@ void SAL_CALL ODocumentDefinition::getFastPropertyValue( Any& o_rValue, sal_Int3 OPropertyStateContainer::getFastPropertyValue( o_rValue, i_nHandle ); } -// ----------------------------------------------------------------------------- Reference< XPropertySetInfo > SAL_CALL ODocumentDefinition::getPropertySetInfo( ) throw(RuntimeException) { Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } -//-------------------------------------------------------------------------- IPropertyArrayHelper& ODocumentDefinition::getInfoHelper() { return *getArrayHelper(); } - -//-------------------------------------------------------------------------- IPropertyArrayHelper* ODocumentDefinition::createArrayHelper( ) const { // properties maintained by our base class (see registerProperties) @@ -601,7 +588,6 @@ IPropertyArrayHelper* ODocumentDefinition::createArrayHelper( ) const return new OPropertyArrayHelper( ::comphelper::concatSequences( aProps, aManualProps ) ); } -// ----------------------------------------------------------------------------- class OExecuteImpl { sal_Bool& m_rbSet; @@ -610,7 +596,6 @@ public: ~OExecuteImpl(){ m_rbSet = sal_False; } }; -// ----------------------------------------------------------------------------- namespace { bool lcl_extractOpenMode( const Any& _rValue, sal_Int32& _out_rMode ) @@ -630,7 +615,6 @@ namespace } } -// ----------------------------------------------------------------------------- void ODocumentDefinition::impl_removeFrameFromDesktop_throw( const ::comphelper::ComponentContext& _rContxt, const Reference< XFrame >& _rxFrame ) { Reference< XFramesSupplier > xDesktop( _rContxt.createComponent( (::rtl::OUString)SERVICE_FRAME_DESKTOP ), UNO_QUERY_THROW ); @@ -638,7 +622,6 @@ void ODocumentDefinition::impl_removeFrameFromDesktop_throw( const ::comphelper: xFrames->remove( _rxFrame ); } -// ----------------------------------------------------------------------------- void ODocumentDefinition::impl_onActivateEmbeddedObject_nothrow( const bool i_bReactivated ) { try @@ -675,7 +658,6 @@ void ODocumentDefinition::impl_onActivateEmbeddedObject_nothrow( const bool i_bR } } -// ----------------------------------------------------------------------------- namespace { // ========================================================================= @@ -768,7 +750,6 @@ namespace }; } -// ----------------------------------------------------------------------------- void ODocumentDefinition::impl_initFormEditView( const Reference< XController >& _rxController ) { try @@ -803,7 +784,6 @@ void ODocumentDefinition::impl_initFormEditView( const Reference< XController >& } } -// ----------------------------------------------------------------------------- void ODocumentDefinition::impl_showOrHideComponent_throw( const bool i_bShow ) { const sal_Int32 nCurrentState = m_xEmbeddedObject.is() ? m_xEmbeddedObject->getCurrentState() : EmbedStates::LOADED; @@ -836,7 +816,6 @@ void ODocumentDefinition::impl_showOrHideComponent_throw( const bool i_bShow ) } } -// ----------------------------------------------------------------------------- Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, const bool _bActivate, const Reference< XCommandEnvironment >& _rxEnvironment ) { @@ -1020,7 +999,6 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons return makeAny( xModel ); } -// ----------------------------------------------------------------------------- Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 CommandId, const Reference< XCommandEnvironment >& Environment ) throw (Exception, CommandAbortedException, RuntimeException) { Any aRet; @@ -1097,7 +1075,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co ::rtl::OUString sPersistentName; aIni[1] >>= sPersistentName; Reference< XStorage> xStorage = getContainerStorage(); - // ----------------------------------------------------------------------------- + xStorage->copyElementTo(m_pImpl->m_aProps.sPersistentName,xDest,sPersistentName); } else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "preview" ) ) ) @@ -1169,7 +1147,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co return aRet; } -// ----------------------------------------------------------------------------- + namespace { void lcl_resetChildFormsToEmptyDataSource( const Reference< XIndexAccess>& _rxFormsContainer ) @@ -1221,7 +1199,7 @@ namespace } } -// ----------------------------------------------------------------------------- + void ODocumentDefinition::onCommandInsert( const ::rtl::OUString& _sURL, const Reference< XCommandEnvironment >& Environment ) throw( Exception ) { @@ -1243,7 +1221,6 @@ void ODocumentDefinition::onCommandInsert( const ::rtl::OUString& _sURL, const R // Unreachable } - if ( !m_xEmbeddedObject.is() ) { Reference< XStorage> xStorage = getContainerStorage(); @@ -1282,13 +1259,9 @@ void ODocumentDefinition::onCommandInsert( const ::rtl::OUString& _sURL, const R } } -// @@@ -// storeData(); - aGuard.clear(); -// inserted(); } -// ----------------------------------------------------------------------------- + sal_Bool ODocumentDefinition::save(sal_Bool _bApprove) { // default handling: instantiate an interaction handler and let it handle the parameter request @@ -1376,7 +1349,7 @@ sal_Bool ODocumentDefinition::save(sal_Bool _bApprove) } return sal_True; } -// ----------------------------------------------------------------------------- + sal_Bool ODocumentDefinition::saveAs() { // default handling: instantiate an interaction handler and let it handle the parameter request @@ -1434,7 +1407,7 @@ sal_Bool ODocumentDefinition::saveAs() { Reference< XStorage> xStorage = getContainerStorage(); const static ::rtl::OUString sBaseName(RTL_CONSTASCII_USTRINGPARAM("Obj")); - // ----------------------------------------------------------------------------- + Reference<XNameAccess> xElements(xStorage,UNO_QUERY_THROW); ::rtl::OUString sPersistentName = ::dbtools::createUniqueName(xElements,sBaseName); xStorage->copyElementTo(m_pImpl->m_aProps.sPersistentName,xStorage,sPersistentName); @@ -1478,7 +1451,6 @@ sal_Bool ODocumentDefinition::saveAs() } } - } catch(Exception&) { @@ -1514,7 +1486,6 @@ namespace } } -// ----------------------------------------------------------------------------- namespace { Reference< XFrame > lcl_getDatabaseDocumentFrame( ODatabaseModelImpl& _rImpl ) @@ -1533,7 +1504,6 @@ namespace } } -// ----------------------------------------------------------------------------- sal_Bool ODocumentDefinition::objectSupportsEmbeddedScripts() const { bool bAllowDocumentMacros = !m_pImpl->m_pDataSource @@ -1546,13 +1516,11 @@ sal_Bool ODocumentDefinition::objectSupportsEmbeddedScripts() const return bAllowDocumentMacros; } -// ----------------------------------------------------------------------------- ::rtl::OUString ODocumentDefinition::determineContentType() const { return lcl_determineContentType_nothrow( getContainerStorage(), m_pImpl->m_aProps.sPersistentName ); } -// ----------------------------------------------------------------------------- void ODocumentDefinition::separateOpenCommandArguments( const Sequence< PropertyValue >& i_rOpenCommandArguments, ::comphelper::NamedValueCollection& o_rDocumentLoadArgs, ::comphelper::NamedValueCollection& o_rEmbeddedObjectDescriptor ) { @@ -1574,7 +1542,6 @@ void ODocumentDefinition::separateOpenCommandArguments( const Sequence< Property o_rDocumentLoadArgs.merge( aOpenCommandArguments, false ); } -// ----------------------------------------------------------------------------- Sequence< PropertyValue > ODocumentDefinition::fillLoadArgs( const Reference< XConnection>& _xConnection, const bool _bSuppressMacros, const bool _bReadOnly, const Sequence< PropertyValue >& i_rOpenCommandArguments, Sequence< PropertyValue >& _out_rEmbeddedObjectDescriptor ) { @@ -1658,7 +1625,7 @@ Sequence< PropertyValue > ODocumentDefinition::fillLoadArgs( const Reference< XC return aMediaDesc.getPropertyValues(); } -// ----------------------------------------------------------------------------- + void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_rConnection, const Sequence< sal_Int8 >& _aClassID, const Sequence< PropertyValue >& i_rOpenCommandArguments, const bool _bSuppressMacros, const bool _bReadOnly ) { @@ -1824,7 +1791,6 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_ m_xLastKnownConnection = i_rConnection; } -// ----------------------------------------------------------------------------- void ODocumentDefinition::onCommandPreview(Any& _rImage) { loadEmbeddedObjectForPreview(); @@ -1848,12 +1814,12 @@ void ODocumentDefinition::onCommandPreview(Any& _rImage) } } } -// ----------------------------------------------------------------------------- + void ODocumentDefinition::getPropertyDefaultByHandle( sal_Int32 /*_nHandle*/, Any& _rDefault ) const { _rDefault.clear(); } -// ----------------------------------------------------------------------------- + void ODocumentDefinition::onCommandGetDocumentProperties( Any& _rProps ) { loadEmbeddedObjectForPreview(); @@ -1872,7 +1838,7 @@ void ODocumentDefinition::onCommandGetDocumentProperties( Any& _rProps ) } } } -// ----------------------------------------------------------------------------- + Reference< util::XCloseable > ODocumentDefinition::impl_getComponent_throw( const bool i_ForceCreate ) { OSL_ENSURE(m_xEmbeddedObject.is(),"Illegal call for embeddedObject"); @@ -1900,14 +1866,12 @@ Reference< util::XCloseable > ODocumentDefinition::impl_getComponent_throw( cons return xComp; } -// ----------------------------------------------------------------------------- Reference< util::XCloseable > ODocumentDefinition::getComponent() throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); return impl_getComponent_throw( true ); } -// ----------------------------------------------------------------------------- namespace { Reference< XDatabaseDocumentUI > lcl_getDatabaseDocumentUI( ODatabaseModelImpl& _rModelImpl ) @@ -1921,7 +1885,6 @@ namespace } } -// ----------------------------------------------------------------------------- Reference< XComponent > ODocumentDefinition::impl_openUI_nolck_throw( bool _bForEditing ) { ::osl::ClearableMutexGuard aGuard( m_aMutex ); @@ -1958,7 +1921,6 @@ Reference< XComponent > ODocumentDefinition::impl_openUI_nolck_throw( bool _bFor return xComponent; } -// ----------------------------------------------------------------------------- void ODocumentDefinition::impl_store_throw() { Reference<XEmbedPersist> xPersist( m_xEmbeddedObject, UNO_QUERY ); @@ -1969,7 +1931,6 @@ void ODocumentDefinition::impl_store_throw() } } -// ----------------------------------------------------------------------------- bool ODocumentDefinition::impl_close_throw() { bool bSuccess = prepareClose(); @@ -1981,19 +1942,16 @@ bool ODocumentDefinition::impl_close_throw() return bSuccess; } -// ----------------------------------------------------------------------------- Reference< XComponent > SAL_CALL ODocumentDefinition::open( ) throw (WrappedTargetException, RuntimeException) { return impl_openUI_nolck_throw( false ); } -// ----------------------------------------------------------------------------- Reference< XComponent > SAL_CALL ODocumentDefinition::openDesign( ) throw (WrappedTargetException, RuntimeException) { return impl_openUI_nolck_throw( true ); } -// ----------------------------------------------------------------------------- void SAL_CALL ODocumentDefinition::store( ) throw (WrappedTargetException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -2009,7 +1967,6 @@ void SAL_CALL ODocumentDefinition::store( ) throw (WrappedTargetException, Runt } } -// ----------------------------------------------------------------------------- ::sal_Bool SAL_CALL ODocumentDefinition::close( ) throw (WrappedTargetException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -2028,14 +1985,12 @@ void SAL_CALL ODocumentDefinition::store( ) throw (WrappedTargetException, Runt return bSuccess; } -// ----------------------------------------------------------------------------- ::rtl::OUString SAL_CALL ODocumentDefinition::getHierarchicalName() throw (RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); return impl_getHierarchicalName( false ); } -// ----------------------------------------------------------------------------- ::rtl::OUString SAL_CALL ODocumentDefinition::composeHierarchicalName( const ::rtl::OUString& i_rRelativeName ) throw (IllegalArgumentException, NoSupportException, RuntimeException) { ::rtl::OUStringBuffer aBuffer; @@ -2045,7 +2000,6 @@ void SAL_CALL ODocumentDefinition::store( ) throw (WrappedTargetException, Runt return aBuffer.makeStringAndClear(); } -// ----------------------------------------------------------------------------- void SAL_CALL ODocumentDefinition::rename( const ::rtl::OUString& _rNewName ) throw (SQLException, ElementExistException, RuntimeException) { try @@ -2070,14 +2024,14 @@ void SAL_CALL ODocumentDefinition::rename( const ::rtl::OUString& _rNewName ) th throw ElementExistException(_rNewName,*this); } } -// ----------------------------------------------------------------------------- + Reference< XStorage> ODocumentDefinition::getContainerStorage() const { return m_pImpl->m_pDataSource ? m_pImpl->m_pDataSource->getStorage( m_bForm ? ODatabaseModelImpl::E_FORM : ODatabaseModelImpl::E_REPORT ) : Reference< XStorage>(); } -// ----------------------------------------------------------------------------- + sal_Bool ODocumentDefinition::isModified() { osl::ClearableGuard< osl::Mutex > aGuard(m_aMutex); @@ -2089,7 +2043,7 @@ sal_Bool ODocumentDefinition::isModified() } return bRet; } -// ----------------------------------------------------------------------------- + bool ODocumentDefinition::prepareClose() { if ( !m_xEmbeddedObject.is() ) @@ -2147,7 +2101,7 @@ bool ODocumentDefinition::prepareClose() return true; } -// ----------------------------------------------------------------------------- + void ODocumentDefinition::fillReportData( const ::comphelper::ComponentContext& _rContext, const Reference< util::XCloseable >& _rxComponent, const Reference< XConnection >& _rxActiveConnection ) @@ -2172,7 +2126,7 @@ void ODocumentDefinition::fillReportData( const ::comphelper::ComponentContext& DBG_UNHANDLED_EXCEPTION(); } } -// ----------------------------------------------------------------------------- + void ODocumentDefinition::updateDocumentTitle() { ::rtl::OUString sName = m_pImpl->m_aProps.aTitle; @@ -2188,7 +2142,7 @@ void ODocumentDefinition::updateDocumentTitle() if ( xUntitledProvider.is() ) sName += ::rtl::OUString::valueOf( xUntitledProvider->leaseNumber(getComponent()) ); } - + Reference< XTitle > xDatabaseDocumentModel(m_pImpl->m_pDataSource->getModel_noCreate(),uno::UNO_QUERY); if ( xDatabaseDocumentModel.is() ) sName = xDatabaseDocumentModel->getTitle() + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" : ")) + sName; @@ -2197,7 +2151,7 @@ void ODocumentDefinition::updateDocumentTitle() if ( xTitle.is() ) xTitle->setTitle(sName); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODocumentDefinition::queryClosing( const lang::EventObject& Source, ::sal_Bool GetsOwnership ) throw (util::CloseVetoException, uno::RuntimeException) { (void) Source; @@ -2212,16 +2166,15 @@ void SAL_CALL ODocumentDefinition::queryClosing( const lang::EventObject& Source throw util::CloseVetoException(); } } -// ----------------------------------------------------------------------------- + void SAL_CALL ODocumentDefinition::notifyClosing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException) { } -// ----------------------------------------------------------------------------- + void SAL_CALL ODocumentDefinition::disposing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException) { } -// ----------------------------------------------------------------------------- void ODocumentDefinition::firePropertyChange( sal_Int32 i_nHandle, const Any& i_rNewValue, const Any& i_rOldValue, sal_Bool i_bVetoable, const NotifierAccess ) { @@ -2231,7 +2184,6 @@ void ODocumentDefinition::firePropertyChange( sal_Int32 i_nHandle, const Any& i_ // ============================================================================= // NameChangeNotifier // ============================================================================= -// ----------------------------------------------------------------------------- NameChangeNotifier::NameChangeNotifier( ODocumentDefinition& i_rDocumentDefinition, const ::rtl::OUString& i_rNewName, ::osl::ResettableMutexGuard& i_rClearForNotify ) :m_rDocumentDefinition( i_rDocumentDefinition ) @@ -2242,13 +2194,11 @@ NameChangeNotifier::NameChangeNotifier( ODocumentDefinition& i_rDocumentDefiniti impl_fireEvent_throw( sal_True ); } -// ----------------------------------------------------------------------------- NameChangeNotifier::~NameChangeNotifier() { impl_fireEvent_throw( sal_False ); } -// ----------------------------------------------------------------------------- void NameChangeNotifier::impl_fireEvent_throw( const sal_Bool i_bVetoable ) { m_rClearForNotify.clear(); @@ -2257,8 +2207,5 @@ void NameChangeNotifier::impl_fireEvent_throw( const sal_Bool i_bVetoable ) m_rClearForNotify.reset(); } -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/documentdefinition.hxx b/dbaccess/source/core/dataaccess/documentdefinition.hxx index a17d40a9e..6b63a15d6 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.hxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -344,9 +344,7 @@ private: */ sal_Bool objectSupportsEmbeddedScripts() const; - //------------------------------------------------------------------------- //- commands - //------------------------------------------------------------------------- void onCommandGetDocumentProperties( ::com::sun::star::uno::Any& _rProps ); void onCommandInsert( const ::rtl::OUString& _sURL, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& Environment ) throw( ::com::sun::star::uno::Exception ); @@ -380,9 +378,6 @@ private: void impl_fireEvent_throw( const sal_Bool i_bVetoable ); }; -//........................................................................ } // namespace dbaccess -//........................................................................ #endif // _DBA_COREDATAACCESS_DOCUMENTDEFINITION_HXX_ - diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx index c94a54310..e044ba1b4 100644 --- a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx +++ b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx @@ -1,7 +1,7 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,10 +44,8 @@ #include <vcl/svapp.hxx> #include <vos/mutex.hxx> -//........................................................................ namespace dbaccess { -//........................................................................ /** === begin UNO using === **/ using ::com::sun::star::uno::Reference; @@ -90,7 +88,6 @@ namespace dbaccess } }; - //-------------------------------------------------------------------- namespace { static void lcl_dispatchScriptURL_throw( DocumentEventExecutor_Data& _rDocExecData, @@ -135,7 +132,6 @@ namespace dbaccess //==================================================================== //= DocumentEventExecutor //==================================================================== - //-------------------------------------------------------------------- DocumentEventExecutor::DocumentEventExecutor( const ::comphelper::ComponentContext& _rContext, const Reference< XEventsSupplier >& _rxDocument ) :m_pData( new DocumentEventExecutor_Data( _rxDocument ) ) @@ -158,12 +154,10 @@ namespace dbaccess } } - //-------------------------------------------------------------------- DocumentEventExecutor::~DocumentEventExecutor() { } - //-------------------------------------------------------------------- void SAL_CALL DocumentEventExecutor::documentEventOccured( const DocumentEvent& _Event ) throw (RuntimeException) { Reference< XEventsSupplier > xEventsSupplier( m_pData->xDocument.get(), UNO_QUERY ); @@ -188,7 +182,6 @@ namespace dbaccess const ::comphelper::NamedValueCollection aScriptDescriptor( xDocEvents->getByName( _Event.EventName ) ); - ::rtl::OUString sEventType; bool bScriptAssigned = aScriptDescriptor.get_ensureType( "EventType", sEventType ); @@ -219,16 +212,11 @@ namespace dbaccess DBG_UNHANDLED_EXCEPTION(); } } - - //-------------------------------------------------------------------- + void SAL_CALL DocumentEventExecutor::disposing( const lang::EventObject& /*_Source*/ ) throw (RuntimeException) { // not interested in } - -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.hxx b/dbaccess/source/core/dataaccess/documenteventexecutor.hxx index 518c2c6c0..e48e13f91 100644 --- a/dbaccess/source/core/dataaccess/documenteventexecutor.hxx +++ b/dbaccess/source/core/dataaccess/documenteventexecutor.hxx @@ -1,6 +1,6 @@ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,10 +41,8 @@ namespace comphelper class ComponentContext; } -//........................................................................ namespace dbaccess { -//........................................................................ struct DocumentEventExecutor_Data; //==================================================================== @@ -71,8 +69,6 @@ namespace dbaccess ::std::auto_ptr< DocumentEventExecutor_Data > m_pData; }; -//........................................................................ } // namespace dbaccess -//........................................................................ #endif // DBACCESS_DOCUMENTEVENTEXECUTOR_HXX diff --git a/dbaccess/source/core/dataaccess/documenteventnotifier.cxx b/dbaccess/source/core/dataaccess/documenteventnotifier.cxx index 735b03419..dabd16a93 100644 --- a/dbaccess/source/core/dataaccess/documenteventnotifier.cxx +++ b/dbaccess/source/core/dataaccess/documenteventnotifier.cxx @@ -1,7 +1,7 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,10 +39,8 @@ #include <cppuhelper/weak.hxx> #include <tools/diagnose_ex.h> -//........................................................................ namespace dbaccess { -//........................................................................ /** === begin UNO using === **/ using ::com::sun::star::uno::Reference; @@ -149,20 +147,17 @@ namespace dbaccess void impl_notifyEventAsync_nothrow( const DocumentEvent& _rEvent ); }; - //-------------------------------------------------------------------- void SAL_CALL DocumentEventNotifier_Impl::acquire() { osl_incrementInterlockedCount( &m_refCount ); } - //-------------------------------------------------------------------- void SAL_CALL DocumentEventNotifier_Impl::release() { if ( 0 == osl_decrementInterlockedCount( &m_refCount ) ) delete this; } - //-------------------------------------------------------------------- void DocumentEventNotifier_Impl::disposing() { // SYNCHRONIZED -> @@ -188,7 +183,6 @@ namespace dbaccess // <-- SYNCHRONIZED } - //-------------------------------------------------------------------- void DocumentEventNotifier_Impl::onDocumentInitialized() { if ( m_bInitialized ) @@ -200,7 +194,6 @@ namespace dbaccess m_pEventBroadcaster->create(); } - //-------------------------------------------------------------------- void DocumentEventNotifier_Impl::impl_notifyEvent_nothrow( const DocumentEvent& _rEvent ) { OSL_PRECOND( m_bInitialized, @@ -224,7 +217,6 @@ namespace dbaccess } } - //-------------------------------------------------------------------- void DocumentEventNotifier_Impl::impl_notifyEventAsync_nothrow( const DocumentEvent& _rEvent ) { if ( !m_pEventBroadcaster.is() ) @@ -238,7 +230,6 @@ namespace dbaccess m_pEventBroadcaster->addEvent( new DocumentEventHolder( _rEvent ), this ); } - // ----------------------------------------------------------------------------- void DocumentEventNotifier_Impl::processEvent( const ::comphelper::AnyEvent& _rEvent ) { // beware, this is called from the notification thread @@ -254,69 +245,56 @@ namespace dbaccess //==================================================================== //= DocumentEventNotifier //==================================================================== - //-------------------------------------------------------------------- DocumentEventNotifier::DocumentEventNotifier( ::cppu::OWeakObject& _rBroadcasterDocument, ::osl::Mutex& _rMutex ) :m_pImpl( new DocumentEventNotifier_Impl( _rBroadcasterDocument, _rMutex ) ) { } - //-------------------------------------------------------------------- DocumentEventNotifier::~DocumentEventNotifier() { } - //-------------------------------------------------------------------- void DocumentEventNotifier::disposing() { m_pImpl->disposing(); } - //-------------------------------------------------------------------- void DocumentEventNotifier::onDocumentInitialized() { m_pImpl->onDocumentInitialized(); } - //-------------------------------------------------------------------- void DocumentEventNotifier::addLegacyEventListener( const Reference< document::XEventListener >& _Listener ) { m_pImpl->addLegacyEventListener( _Listener ); } - //-------------------------------------------------------------------- void DocumentEventNotifier::removeLegacyEventListener( const Reference< document::XEventListener >& _Listener ) { m_pImpl->removeLegacyEventListener( _Listener ); } - //-------------------------------------------------------------------- void DocumentEventNotifier::addDocumentEventListener( const Reference< XDocumentEventListener >& _Listener ) { m_pImpl->addDocumentEventListener( _Listener ); } - //-------------------------------------------------------------------- void DocumentEventNotifier::removeDocumentEventListener( const Reference< XDocumentEventListener >& _Listener ) { m_pImpl->removeDocumentEventListener( _Listener ); } - //-------------------------------------------------------------------- void DocumentEventNotifier::notifyDocumentEvent( const ::rtl::OUString& _EventName, const Reference< XController2 >& _ViewController, const Any& _Supplement ) { m_pImpl->notifyDocumentEvent( _EventName, _ViewController, _Supplement ); } - //-------------------------------------------------------------------- void DocumentEventNotifier::notifyDocumentEventAsync( const ::rtl::OUString& _EventName, const Reference< XController2 >& _ViewController, const Any& _Supplement ) { m_pImpl->notifyDocumentEventAsync( _EventName, _ViewController, _Supplement ); } -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/documenteventnotifier.hxx b/dbaccess/source/core/dataaccess/documenteventnotifier.hxx index 3beb9b3cf..7cc3c2b1c 100644 --- a/dbaccess/source/core/dataaccess/documenteventnotifier.hxx +++ b/dbaccess/source/core/dataaccess/documenteventnotifier.hxx @@ -1,7 +1,7 @@ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,10 +40,8 @@ namespace cppu class OWeakObject; } -//........................................................................ namespace dbaccess { -//........................................................................ class DocumentEventNotifier_Impl; //==================================================================== @@ -137,8 +135,6 @@ namespace dbaccess ::rtl::Reference< DocumentEventNotifier_Impl > m_pImpl; }; -//........................................................................ } // namespace dbaccess -//........................................................................ #endif // DBACCESS_DOCUMENTEVENTNOTIFIER_HXX diff --git a/dbaccess/source/core/dataaccess/documentevents.cxx b/dbaccess/source/core/dataaccess/documentevents.cxx index 9ba3a199a..208b2486c 100644 --- a/dbaccess/source/core/dataaccess/documentevents.cxx +++ b/dbaccess/source/core/dataaccess/documentevents.cxx @@ -1,7 +1,7 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,10 +39,8 @@ #include <algorithm> #include <functional> -//........................................................................ namespace dbaccess { -//........................................................................ /** === begin UNO using === **/ using ::com::sun::star::uno::Reference; @@ -88,7 +86,6 @@ namespace dbaccess bool bNeedsSyncNotify; }; - //-------------------------------------------------------------------- namespace { static const DocumentEventData* lcl_getDocumentEventData() @@ -127,7 +124,6 @@ namespace dbaccess //==================================================================== //= DocumentEvents //==================================================================== - //-------------------------------------------------------------------- DocumentEvents::DocumentEvents( ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, DocumentEventsData& _rEventsData ) :m_pData( new DocumentEvents_Data( _rParent, _rMutex, _rEventsData ) ) { @@ -142,24 +138,20 @@ namespace dbaccess } } - //-------------------------------------------------------------------- DocumentEvents::~DocumentEvents() { } - //-------------------------------------------------------------------- void SAL_CALL DocumentEvents::acquire() throw() { m_pData->rParent.acquire(); } - //-------------------------------------------------------------------- void SAL_CALL DocumentEvents::release() throw() { m_pData->rParent.release(); } - //-------------------------------------------------------------------- bool DocumentEvents::needsSynchronousNotification( const ::rtl::OUString& _rEventName ) { const DocumentEventData* pEventData = lcl_getDocumentEventData(); @@ -174,7 +166,6 @@ namespace dbaccess return false; } - //-------------------------------------------------------------------- void SAL_CALL DocumentEvents::replaceByName( const ::rtl::OUString& _Name, const Any& _Element ) throw (IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) { ::osl::MutexGuard aGuard( m_pData->rMutex ); @@ -207,8 +198,7 @@ namespace dbaccess elementPos->second = aEventDescriptor; } - - //-------------------------------------------------------------------- + Any SAL_CALL DocumentEvents::getByName( const ::rtl::OUString& _Name ) throw (NoSuchElementException, WrappedTargetException, RuntimeException) { ::osl::MutexGuard aGuard( m_pData->rMutex ); @@ -223,8 +213,7 @@ namespace dbaccess aReturn <<= rEventDesc; return aReturn; } - - //-------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL DocumentEvents::getElementNames( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_pData->rMutex ); @@ -238,31 +227,24 @@ namespace dbaccess ); return aNames; } - - //-------------------------------------------------------------------- + ::sal_Bool SAL_CALL DocumentEvents::hasByName( const ::rtl::OUString& _Name ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_pData->rMutex ); return m_pData->rEventsData.find( _Name ) != m_pData->rEventsData.end(); } - - //-------------------------------------------------------------------- + Type SAL_CALL DocumentEvents::getElementType( ) throw (RuntimeException) { return ::cppu::UnoType< Sequence< PropertyValue > >::get(); } - - //-------------------------------------------------------------------- + ::sal_Bool SAL_CALL DocumentEvents::hasElements( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( m_pData->rMutex ); return !m_pData->rEventsData.empty(); } - -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/documentevents.hxx b/dbaccess/source/core/dataaccess/documentevents.hxx index 4951cefe5..b053a9790 100644 --- a/dbaccess/source/core/dataaccess/documentevents.hxx +++ b/dbaccess/source/core/dataaccess/documentevents.hxx @@ -1,6 +1,6 @@ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,10 +38,8 @@ #include <map> #include <boost/noncopyable.hpp> -//........................................................................ namespace dbaccess { -//........................................................................ typedef ::std::map< ::rtl::OUString, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > DocumentEventsData; @@ -83,8 +81,6 @@ namespace dbaccess ::std::auto_ptr< DocumentEvents_Data > m_pData; }; -//........................................................................ } // namespace dbaccess -//........................................................................ #endif // DBACCESS_DOCUMENTEVENTS_HXX diff --git a/dbaccess/source/core/dataaccess/intercept.cxx b/dbaccess/source/core/dataaccess/intercept.cxx index 4e2312a1b..1b950f285 100644 --- a/dbaccess/source/core/dataaccess/intercept.cxx +++ b/dbaccess/source/core/dataaccess/intercept.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -183,7 +183,7 @@ void SAL_CALL OInterceptor::dispatch( const URL& _URL,const Sequence<PropertyVal return; } - if ( _URL.Complete == m_aInterceptedURL[ DISPATCH_CLOSEDOC ] + if ( _URL.Complete == m_aInterceptedURL[ DISPATCH_CLOSEDOC ] || _URL.Complete == m_aInterceptedURL[ DISPATCH_CLOSEWIN ] || _URL.Complete == m_aInterceptedURL[ DISPATCH_CLOSEFRAME ] ) @@ -237,7 +237,7 @@ void SAL_CALL OInterceptor::addStatusListener( if ( m_pContentHolder && _URL.Complete == m_aInterceptedURL[DISPATCH_SAVEAS] ) { // SaveAs - + if ( !m_pContentHolder->isNewReport() ) { FeatureStateEvent aStateEvent; @@ -247,7 +247,7 @@ void SAL_CALL OInterceptor::addStatusListener( aStateEvent.Requery = sal_False; aStateEvent.State <<= (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("($3)"))); Control->statusChanged(aStateEvent); - } + } { osl::MutexGuard aGuard(m_aMutex); @@ -417,7 +417,7 @@ void SAL_CALL OInterceptor::setMasterDispatchProvider( osl::MutexGuard aGuard(m_aMutex); m_xMasterDispatchProvider = NewSupplier; } -// ----------------------------------------------------------------------------- + void SAL_CALL OInterceptor::notifyEvent( const ::com::sun::star::document::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException) { osl::ResettableMutexGuard _rGuard(m_aMutex); @@ -437,13 +437,10 @@ void SAL_CALL OInterceptor::notifyEvent( const ::com::sun::star::document::Event } } } -// ----------------------------------------------------------------------------- + void SAL_CALL OInterceptor::disposing( const ::com::sun::star::lang::EventObject& /*Source*/ ) throw (::com::sun::star::uno::RuntimeException) { } -//........................................................................ } // namespace dbaccess -//........................................................................ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/intercept.hxx b/dbaccess/source/core/dataaccess/intercept.hxx index ca9a6d634..ba0cb4c55 100644 --- a/dbaccess/source/core/dataaccess/intercept.hxx +++ b/dbaccess/source/core/dataaccess/intercept.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -53,104 +53,102 @@ protected: public: OInterceptor( ODocumentDefinition* _pContentHolder,sal_Bool _bAllowEditDoc ); - + void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException); - + //XDispatch - virtual void SAL_CALL - dispatch( + virtual void SAL_CALL + dispatch( const ::com::sun::star::util::URL& URL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments ) throw (::com::sun::star::uno::RuntimeException); - + virtual void SAL_CALL - addStatusListener( - const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XStatusListener >& Control, + addStatusListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XStatusListener >& Control, const ::com::sun::star::util::URL& URL ) throw ( ::com::sun::star::uno::RuntimeException ); - + virtual void SAL_CALL - removeStatusListener( - const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XStatusListener >& Control, - const ::com::sun::star::util::URL& URL ) + removeStatusListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XStatusListener >& Control, + const ::com::sun::star::util::URL& URL ) throw ( ::com::sun::star::uno::RuntimeException ); - + //XInterceptorInfo - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getInterceptedURLs( ) throw ( ::com::sun::star::uno::RuntimeException ); - + //XDispatchProvider ( inherited by XDispatchProviderInterceptor ) - virtual ::com::sun::star::uno::Reference< + virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL - queryDispatch( + queryDispatch( const ::com::sun::star::util::URL& URL, - const ::rtl::OUString& TargetFrameName, + const ::rtl::OUString& TargetFrameName, sal_Int32 SearchFlags ) throw ( ::com::sun::star::uno::RuntimeException ); - - virtual ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Reference< + + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL - queryDispatches( + queryDispatches( const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& Requests ) throw ( ::com::sun::star::uno::RuntimeException ); - - + //XDispatchProviderInterceptor virtual ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XDispatchProvider > SAL_CALL - getSlaveDispatchProvider( ) + ::com::sun::star::frame::XDispatchProvider > SAL_CALL + getSlaveDispatchProvider( ) throw ( ::com::sun::star::uno::RuntimeException ); - + virtual void SAL_CALL - setSlaveDispatchProvider( - const ::com::sun::star::uno::Reference< + setSlaveDispatchProvider( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& NewDispatchProvider ) throw ( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< + virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > SAL_CALL - getMasterDispatchProvider( ) + getMasterDispatchProvider( ) throw ( ::com::sun::star::uno::RuntimeException ); - + virtual void SAL_CALL - setMasterDispatchProvider( - const ::com::sun::star::uno::Reference< + setMasterDispatchProvider( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& NewSupplier ) throw ( ::com::sun::star::uno::RuntimeException - ); + ); // XEventListener virtual void SAL_CALL notifyEvent( const ::com::sun::star::document::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); - - + private: - + osl::Mutex m_aMutex; - + ODocumentDefinition* m_pContentHolder; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xSlaveDispatchProvider; @@ -163,12 +161,6 @@ private: sal_Bool m_bAllowEditDoc; }; - -//........................................................................ } // namespace dbaccess -//........................................................................ - #endif //DBA_INTERCEPT_HXX - - diff --git a/dbaccess/source/core/dataaccess/makefile.mk b/dbaccess/source/core/dataaccess/makefile.mk index 831eae349..e37544b70 100644 --- a/dbaccess/source/core/dataaccess/makefile.mk +++ b/dbaccess/source/core/dataaccess/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx b/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx index dc98f41b6..93177d05b 100644 --- a/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx +++ b/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -126,12 +126,10 @@ DataSupplier_Impl::~DataSupplier_Impl() } //========================================================================= -//========================================================================= // // DataSupplier Implementation. // //========================================================================= -//========================================================================= DBG_NAME(DataSupplier) DataSupplier::DataSupplier( const Reference< XMultiServiceFactory >& rxSMgr, @@ -143,16 +141,12 @@ DataSupplier::DataSupplier( const Reference< XMultiServiceFactory >& rxSMgr, } -//========================================================================= -// virtual DataSupplier::~DataSupplier() { DBG_DTOR(DataSupplier,NULL); } -//========================================================================= -// virtual rtl::OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) { osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); @@ -183,9 +177,7 @@ rtl::OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) return rtl::OUString(); } -//========================================================================= -// virtual -Reference< XContentIdentifier > +Reference< XContentIdentifier > DataSupplier::queryContentIdentifier( sal_uInt32 nIndex ) { osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); @@ -210,9 +202,7 @@ DataSupplier::queryContentIdentifier( sal_uInt32 nIndex ) return Reference< XContentIdentifier >(); } -//========================================================================= -// virtual -Reference< XContent > +Reference< XContent > DataSupplier::queryContent( sal_uInt32 _nIndex ) { osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); @@ -238,7 +228,7 @@ DataSupplier::queryContent( sal_uInt32 _nIndex ) sName = sName.getToken(0,'/',nIndex); m_pImpl->m_aResults[ _nIndex ]->xContent = m_pImpl->m_xContent->getContent(sName); - + xContent = m_pImpl->m_aResults[ _nIndex ]->xContent.get(); return xContent; @@ -250,8 +240,6 @@ DataSupplier::queryContent( sal_uInt32 _nIndex ) return Reference< XContent >(); } -//========================================================================= -// virtual sal_Bool DataSupplier::getResult( sal_uInt32 nIndex ) { osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); @@ -313,8 +301,6 @@ sal_Bool DataSupplier::getResult( sal_uInt32 nIndex ) return bFound; } -//========================================================================= -// virtual sal_uInt32 DataSupplier::totalCount() { osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); @@ -350,23 +336,17 @@ sal_uInt32 DataSupplier::totalCount() return m_pImpl->m_aResults.size(); } -//========================================================================= -// virtual sal_uInt32 DataSupplier::currentCount() { return m_pImpl->m_aResults.size(); } -//========================================================================= -// virtual sal_Bool DataSupplier::isCountFinal() { return m_pImpl->m_bCountFinal; } -//========================================================================= -// virtual -Reference< XRow > +Reference< XRow > DataSupplier::queryPropertyValues( sal_uInt32 nIndex ) { osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); @@ -394,8 +374,6 @@ DataSupplier::queryPropertyValues( sal_uInt32 nIndex ) return Reference< XRow >(); } -//========================================================================= -// virtual void DataSupplier::releasePropertyValues( sal_uInt32 nIndex ) { osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); @@ -404,17 +382,12 @@ void DataSupplier::releasePropertyValues( sal_uInt32 nIndex ) m_pImpl->m_aResults[ nIndex ]->xRow = Reference< XRow >(); } -//========================================================================= -// virtual void DataSupplier::close() { } -//========================================================================= -// virtual void DataSupplier::validate() throw( ResultSetException ) { } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/myucp_datasupplier.hxx b/dbaccess/source/core/dataaccess/myucp_datasupplier.hxx index a9e7f0bdd..cf9c90383 100644 --- a/dbaccess/source/core/dataaccess/myucp_datasupplier.hxx +++ b/dbaccess/source/core/dataaccess/myucp_datasupplier.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/dataaccess/myucp_resultset.cxx b/dbaccess/source/core/dataaccess/myucp_resultset.cxx index c7e2794a4..d59336d87 100644 --- a/dbaccess/source/core/dataaccess/myucp_resultset.cxx +++ b/dbaccess/source/core/dataaccess/myucp_resultset.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -53,12 +53,10 @@ using namespace ::com::sun::star::container; using namespace dbaccess; //========================================================================= -//========================================================================= // // DynamicResultSet Implementation. // //========================================================================= -//========================================================================= DynamicResultSet::DynamicResultSet( const Reference< XMultiServiceFactory >& rxSMgr, @@ -76,7 +74,6 @@ DynamicResultSet::DynamicResultSet( // Non-interface methods. // //========================================================================= - void DynamicResultSet::initStatic() { m_xResultSet1 @@ -88,7 +85,6 @@ void DynamicResultSet::initStatic() m_xEnv ); } -//========================================================================= void DynamicResultSet::initDynamic() { m_xResultSet1 @@ -100,5 +96,4 @@ void DynamicResultSet::initDynamic() m_xEnv ); m_xResultSet2 = m_xResultSet1; } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/core/dataaccess/myucp_resultset.hxx b/dbaccess/source/core/dataaccess/myucp_resultset.hxx index 2008dc6f2..f1457793a 100644 --- a/dbaccess/source/core/dataaccess/myucp_resultset.hxx +++ b/dbaccess/source/core/dataaccess/myucp_resultset.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite |