summaryrefslogtreecommitdiff
path: root/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/core/dataaccess/ComponentDefinition.cxx')
-rw-r--r--dbaccess/source/core/dataaccess/ComponentDefinition.cxx70
1 files changed, 22 insertions, 48 deletions
diff --git a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
index 10361a3aa280..2a5d15388a65 100644
--- a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
+++ b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,35 +29,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx"
-#ifndef DBA_COREDATAACESS_COMPONENTDEFINITION_HXX
#include "ComponentDefinition.hxx"
-#endif
-#ifndef _DBASHARED_APITOOLS_HXX_
#include "apitools.hxx"
-#endif
-#ifndef DBACCESS_SHARED_DBASTRINGS_HRC
#include "dbastrings.hrc"
-#endif
#include "module_dba.hxx"
-#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
-#endif
-#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <osl/diagnose.h>
#include <comphelper/sequence.hxx>
-#endif
-#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
#include <com/sun/star/lang/DisposedException.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#endif
-#ifndef _COMPHELPER_PROPERTY_HXX_
#include <comphelper/property.hxx>
-#endif
-#ifndef _DBACORE_DEFINITIONCOLUMN_HXX_
#include "definitioncolumn.hxx"
-#endif
#include <cppuhelper/implbase1.hxx>
#include <comphelper/componentcontext.hxx>
@@ -75,10 +59,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
@@ -108,7 +91,7 @@ OComponentDefinition_Impl::OComponentDefinition_Impl()
{
DBG_CTOR(OComponentDefinition_Impl,NULL);
}
-// -----------------------------------------------------------------------------
+
OComponentDefinition_Impl::~OComponentDefinition_Impl()
{
DBG_DTOR(OComponentDefinition_Impl,NULL);
@@ -116,9 +99,9 @@ OComponentDefinition_Impl::~OComponentDefinition_Impl()
//==========================================================================
//= OComponentDefinition
//==========================================================================
-//--------------------------------------------------------------------------
+
DBG_NAME(OComponentDefinition)
-//--------------------------------------------------------------------------
+
void OComponentDefinition::registerProperties()
{
m_xColumnPropertyListener = ::comphelper::ImplementationReference<OColumnPropertyListener,XPropertyChangeListener>(new OColumnPropertyListener(this));
@@ -138,7 +121,6 @@ void OComponentDefinition::registerProperties()
}
}
-//--------------------------------------------------------------------------
OComponentDefinition::OComponentDefinition(const Reference< XMultiServiceFactory >& _xORB
,const Reference< XInterface >& _xParentContainer
,const TContentPtr& _pImpl
@@ -150,13 +132,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
@@ -170,26 +152,23 @@ OComponentDefinition::OComponentDefinition( const Reference< XInterface >& _rxCo
registerProperties();
m_pImpl->m_aProps.aTitle = _rElementName;
- DBG_ASSERT(m_pImpl->m_aProps.aTitle.getLength() != 0, "OComponentDefinition::OComponentDefinition : invalid name !");
+ OSL_ENSURE(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);
@@ -199,18 +178,17 @@ Sequence< ::rtl::OUString > OComponentDefinition::getSupportedServiceNames_stati
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();
@@ -219,26 +197,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
@@ -246,7 +223,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);
@@ -269,7 +245,7 @@ Reference< XNameAccess> OComponentDefinition::getColumns() throw (RuntimeExcepti
}
return m_pColumns.get();
}
-// -----------------------------------------------------------------------------
+
OColumn* OComponentDefinition::createColumn(const ::rtl::OUString& _rName) const
{
const OComponentDefinition_Impl& rDefinition( getDefinition() );
@@ -279,28 +255,28 @@ OColumn* OComponentDefinition::createColumn(const ::rtl::OUString& _rName) const
aFind->second->addPropertyChangeListener(::rtl::OUString(),m_xColumnPropertyListener.getRef());
return new OTableColumnWrapper( aFind->second, aFind->second, true );
}
- OSL_ENSURE( false, "OComponentDefinition::createColumn: is this a valid case?" );
+ OSL_FAIL( "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)
{
getDefinition().erase( _sName );
notifyDataSourceModified();
}
-// -----------------------------------------------------------------------------
+
void OComponentDefinition::columnAppended( const Reference< XPropertySet >& _rxSourceDescriptor )
{
::rtl::OUString sName;
@@ -322,7 +298,5 @@ void OComponentDefinition::columnAppended( const Reference< XPropertySet >& _rxS
notifyDataSourceModified();
}
-//........................................................................
} // namespace dbaccess
-//........................................................................
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */