nss: upgrade to release 3.73
[LibreOffice.git] / dbaccess / source / core / api / TableDeco.cxx
blob702723676c97d0d0b2b81c7723b2b350536e43a3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <TableDeco.hxx>
21 #include <apitools.hxx>
22 #include <definitioncolumn.hxx>
23 #include <stringconstants.hxx>
24 #include <core_resource.hxx>
25 #include <strings.hrc>
26 #include <osl/diagnose.h>
27 #include <sal/log.hxx>
29 #include <cppuhelper/typeprovider.hxx>
30 #include <comphelper/property.hxx>
31 #include <comphelper/servicehelper.hxx>
32 #include <com/sun/star/sdbc/SQLException.hpp>
33 #include <com/sun/star/sdbc/XConnection.hpp>
34 #include <com/sun/star/beans/PropertyAttribute.hpp>
35 #include <connectivity/dbtools.hxx>
36 #include <connectivity/dbexception.hxx>
37 #include <ContainerMediator.hxx>
39 using namespace dbaccess;
40 using namespace ::com::sun::star::uno;
41 using namespace ::com::sun::star::util;
42 using namespace ::com::sun::star::lang;
43 using namespace ::com::sun::star::beans;
44 using namespace ::com::sun::star::sdbc;
45 using namespace ::com::sun::star::sdbcx;
46 using namespace ::com::sun::star::container;
47 using namespace ::osl;
48 using namespace ::comphelper;
49 using namespace ::dbtools;
50 using namespace ::cppu;
52 // ODBTableDecorator
54 ODBTableDecorator::ODBTableDecorator( const Reference< XConnection >& _rxConnection, const Reference< XColumnsSupplier >& _rxNewTable,
55 const Reference< XNumberFormatsSupplier >& _rxNumberFormats, const Reference< XNameAccess >& _xColumnDefinitions )
56 :OTableDescriptor_BASE(m_aMutex)
57 ,ODataSettings(OTableDescriptor_BASE::rBHelper)
58 ,m_xTable(_rxNewTable)
59 ,m_xColumnDefinitions(_xColumnDefinitions)
60 ,m_xConnection( _rxConnection )
61 ,m_xMetaData( _rxConnection.is() ? _rxConnection->getMetaData() : Reference< XDatabaseMetaData >() )
62 ,m_xNumberFormats( _rxNumberFormats )
63 ,m_nPrivileges(-1)
65 ODataSettings::registerPropertiesFor(this);
68 ODBTableDecorator::~ODBTableDecorator()
72 Sequence< sal_Int8 > ODBTableDecorator::getImplementationId()
74 return css::uno::Sequence<sal_Int8>();
77 // OComponentHelper
78 void SAL_CALL ODBTableDecorator::disposing()
80 OPropertySetHelper::disposing();
81 OTableDescriptor_BASE::disposing();
83 MutexGuard aGuard(m_aMutex);
84 m_xTable = nullptr;
85 m_xMetaData = nullptr;
86 m_xColumnDefinitions = nullptr;
87 m_xNumberFormats = nullptr;
88 if ( m_pColumns )
89 m_pColumns->disposing();
90 m_xColumnMediator = nullptr;
93 sal_Bool SAL_CALL ODBTableDecorator::convertFastPropertyValue(
94 Any & rConvertedValue,
95 Any & rOldValue,
96 sal_Int32 nHandle,
97 const Any& rValue )
99 bool bRet = true;
100 switch(nHandle)
102 case PROPERTY_ID_PRIVILEGES:
103 case PROPERTY_ID_FILTER:
104 case PROPERTY_ID_ORDER:
105 case PROPERTY_ID_APPLYFILTER:
106 case PROPERTY_ID_FONT:
107 case PROPERTY_ID_ROW_HEIGHT:
108 case PROPERTY_ID_AUTOGROW:
109 case PROPERTY_ID_TEXTCOLOR:
110 case PROPERTY_ID_TEXTLINECOLOR:
111 case PROPERTY_ID_TEXTEMPHASIS:
112 case PROPERTY_ID_TEXTRELIEF:
113 case PROPERTY_ID_FONTCHARWIDTH:
114 case PROPERTY_ID_FONTCHARSET:
115 case PROPERTY_ID_FONTFAMILY:
116 case PROPERTY_ID_FONTHEIGHT:
117 case PROPERTY_ID_FONTKERNING:
118 case PROPERTY_ID_FONTNAME:
119 case PROPERTY_ID_FONTORIENTATION:
120 case PROPERTY_ID_FONTPITCH:
121 case PROPERTY_ID_FONTSLANT:
122 case PROPERTY_ID_FONTSTRIKEOUT:
123 case PROPERTY_ID_FONTSTYLENAME:
124 case PROPERTY_ID_FONTUNDERLINE:
125 case PROPERTY_ID_FONTWEIGHT:
126 case PROPERTY_ID_FONTWIDTH:
127 case PROPERTY_ID_FONTWORDLINEMODE:
128 case PROPERTY_ID_FONTTYPE:
129 bRet = ODataSettings::convertFastPropertyValue(rConvertedValue, rOldValue,nHandle,rValue);
130 break;
132 default:
134 Any aValue;
135 getFastPropertyValue(aValue,nHandle);
136 bRet = ::comphelper::tryPropertyValue(rConvertedValue,rOldValue,rValue,aValue,::cppu::UnoType<OUString>::get());
138 break; // we assume that it works
140 return bRet;
143 void ODBTableDecorator::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue)
145 switch(_nHandle)
147 case PROPERTY_ID_PRIVILEGES:
148 SAL_WARN("dbaccess", "Property is readonly!");
149 [[fallthrough]];
150 case PROPERTY_ID_FILTER:
151 case PROPERTY_ID_ORDER:
152 case PROPERTY_ID_APPLYFILTER:
153 case PROPERTY_ID_FONT:
154 case PROPERTY_ID_ROW_HEIGHT:
155 case PROPERTY_ID_AUTOGROW:
156 case PROPERTY_ID_TEXTCOLOR:
157 case PROPERTY_ID_TEXTLINECOLOR:
158 case PROPERTY_ID_TEXTEMPHASIS:
159 case PROPERTY_ID_TEXTRELIEF:
160 case PROPERTY_ID_FONTCHARWIDTH:
161 case PROPERTY_ID_FONTCHARSET:
162 case PROPERTY_ID_FONTFAMILY:
163 case PROPERTY_ID_FONTHEIGHT:
164 case PROPERTY_ID_FONTKERNING:
165 case PROPERTY_ID_FONTNAME:
166 case PROPERTY_ID_FONTORIENTATION:
167 case PROPERTY_ID_FONTPITCH:
168 case PROPERTY_ID_FONTSLANT:
169 case PROPERTY_ID_FONTSTRIKEOUT:
170 case PROPERTY_ID_FONTSTYLENAME:
171 case PROPERTY_ID_FONTUNDERLINE:
172 case PROPERTY_ID_FONTWEIGHT:
173 case PROPERTY_ID_FONTWIDTH:
174 case PROPERTY_ID_FONTWORDLINEMODE:
175 case PROPERTY_ID_FONTTYPE:
177 ODataSettings::setFastPropertyValue_NoBroadcast(_nHandle, _rValue);
178 break;
179 case PROPERTY_ID_CATALOGNAME:
181 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
182 xProp->setPropertyValue(PROPERTY_CATALOGNAME,_rValue);
184 break;
185 case PROPERTY_ID_SCHEMANAME:
187 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
188 xProp->setPropertyValue(PROPERTY_SCHEMANAME,_rValue);
190 break;
191 case PROPERTY_ID_NAME:
193 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
194 xProp->setPropertyValue(PROPERTY_NAME,_rValue);
196 break;
197 case PROPERTY_ID_DESCRIPTION:
199 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
200 xProp->setPropertyValue(PROPERTY_DESCRIPTION,_rValue);
202 break;
203 case PROPERTY_ID_TYPE:
205 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
206 xProp->setPropertyValue(PROPERTY_TYPE,_rValue);
208 break;
212 void ODBTableDecorator::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) const
215 switch(_nHandle)
217 case PROPERTY_ID_PRIVILEGES:
219 if ( -1 == m_nPrivileges )
220 fillPrivileges();
221 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
222 Reference<XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
223 if ( xInfo->hasPropertyByName(PROPERTY_PRIVILEGES) )
225 _rValue <<= m_nPrivileges;
226 break;
229 [[fallthrough]];
231 case PROPERTY_ID_FILTER:
232 case PROPERTY_ID_ORDER:
233 case PROPERTY_ID_APPLYFILTER:
234 case PROPERTY_ID_FONT:
235 case PROPERTY_ID_ROW_HEIGHT:
236 case PROPERTY_ID_AUTOGROW:
237 case PROPERTY_ID_TEXTCOLOR:
238 case PROPERTY_ID_TEXTLINECOLOR:
239 case PROPERTY_ID_TEXTEMPHASIS:
240 case PROPERTY_ID_TEXTRELIEF:
241 case PROPERTY_ID_FONTCHARWIDTH:
242 case PROPERTY_ID_FONTCHARSET:
243 case PROPERTY_ID_FONTFAMILY:
244 case PROPERTY_ID_FONTHEIGHT:
245 case PROPERTY_ID_FONTKERNING:
246 case PROPERTY_ID_FONTNAME:
247 case PROPERTY_ID_FONTORIENTATION:
248 case PROPERTY_ID_FONTPITCH:
249 case PROPERTY_ID_FONTSLANT:
250 case PROPERTY_ID_FONTSTRIKEOUT:
251 case PROPERTY_ID_FONTSTYLENAME:
252 case PROPERTY_ID_FONTUNDERLINE:
253 case PROPERTY_ID_FONTWEIGHT:
254 case PROPERTY_ID_FONTWIDTH:
255 case PROPERTY_ID_FONTWORDLINEMODE:
256 case PROPERTY_ID_FONTTYPE:
257 ODataSettings::getFastPropertyValue(_rValue, _nHandle);
258 break;
259 case PROPERTY_ID_CATALOGNAME:
261 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
262 _rValue = xProp->getPropertyValue(PROPERTY_CATALOGNAME);
264 break;
265 case PROPERTY_ID_SCHEMANAME:
267 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
268 _rValue = xProp->getPropertyValue(PROPERTY_SCHEMANAME);
270 break;
271 case PROPERTY_ID_NAME:
273 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
274 _rValue = xProp->getPropertyValue(PROPERTY_NAME);
276 break;
277 case PROPERTY_ID_DESCRIPTION:
279 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
280 _rValue = xProp->getPropertyValue(PROPERTY_DESCRIPTION);
282 break;
283 case PROPERTY_ID_TYPE:
285 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
286 _rValue = xProp->getPropertyValue(PROPERTY_TYPE);
288 break;
289 default:
290 SAL_WARN("dbaccess", "Invalid Handle for table");
294 void ODBTableDecorator::construct()
296 bool bNotFound = true;
297 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
298 if ( xProp.is() )
300 Reference<XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
301 bNotFound = !xInfo->hasPropertyByName(PROPERTY_PRIVILEGES);
303 if ( bNotFound )
304 registerProperty(PROPERTY_PRIVILEGES, PROPERTY_ID_PRIVILEGES, PropertyAttribute::BOUND | PropertyAttribute::READONLY,
305 &m_nPrivileges, ::cppu::UnoType<sal_Int32>::get());
308 ::cppu::IPropertyArrayHelper* ODBTableDecorator::createArrayHelper(sal_Int32 /*_nId*/) const
310 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
311 Reference<XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
313 Sequence< Property > aTableProps = xInfo->getProperties();
314 for (Property & prop : aTableProps)
316 if (prop.Name == PROPERTY_CATALOGNAME)
317 prop.Handle = PROPERTY_ID_CATALOGNAME;
318 else if (prop.Name == PROPERTY_SCHEMANAME)
319 prop.Handle = PROPERTY_ID_SCHEMANAME;
320 else if (prop.Name == PROPERTY_NAME)
321 prop.Handle = PROPERTY_ID_NAME;
322 else if (prop.Name == PROPERTY_DESCRIPTION)
323 prop.Handle = PROPERTY_ID_DESCRIPTION;
324 else if (prop.Name == PROPERTY_TYPE)
325 prop.Handle = PROPERTY_ID_TYPE;
326 else if (prop.Name == PROPERTY_PRIVILEGES)
327 prop.Handle = PROPERTY_ID_PRIVILEGES;
330 describeProperties(aTableProps);
332 return new ::cppu::OPropertyArrayHelper(aTableProps);
335 ::cppu::IPropertyArrayHelper & SAL_CALL ODBTableDecorator::getInfoHelper()
337 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
339 Reference<XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
340 bool bIsDescriptor = (xInfo->getPropertyByName(PROPERTY_NAME).Attributes & PropertyAttribute::READONLY) == 0;
342 return *ODBTableDecorator_PROP::getArrayHelper( bIsDescriptor ? 0 : 1 );
344 // TODO: this is a HACK, and prone to errors
345 // The OIdPropertyArrayUsageHelper is intended for classes where there exists a known, limited
346 // number of different property set infos (distinguished by the ID), all implemented by this very
347 // same class.
348 // However, in this case here we have an unknown, potentially unlimited number of different
349 // property set infos: Depending on the table for which we act as decorator, different property
350 // sets might exist.
353 // XServiceInfo
354 IMPLEMENT_SERVICE_INFO1(ODBTableDecorator, "com.sun.star.sdb.dbaccess.ODBTableDecorator", SERVICE_SDBCX_TABLE)
356 Any SAL_CALL ODBTableDecorator::queryInterface( const Type & rType )
358 Any aRet;
359 if(m_xTable.is())
361 aRet = m_xTable->queryInterface(rType);
362 if(aRet.hasValue())
363 { // now we know that our table supports this type so we return ourself
364 aRet = OTableDescriptor_BASE::queryInterface(rType);
365 if(!aRet.hasValue())
366 aRet = ODataSettings::queryInterface(rType);
370 return aRet;
373 Sequence< Type > SAL_CALL ODBTableDecorator::getTypes( )
375 Reference<XTypeProvider> xTypes(m_xTable,UNO_QUERY);
376 OSL_ENSURE(xTypes.is(),"Table must be a TypeProvider!");
377 return xTypes->getTypes();
380 // XRename,
381 void SAL_CALL ODBTableDecorator::rename( const OUString& _rNewName )
383 ::osl::MutexGuard aGuard(m_aMutex);
384 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
385 Reference<XRename> xRename(m_xTable,UNO_QUERY);
386 if(!xRename.is())
387 throw SQLException(DBA_RES(RID_STR_NO_TABLE_RENAME),*this,SQLSTATE_GENERAL,1000,Any() );
388 // not supported
389 xRename->rename(_rNewName);
392 // XAlterTable,
393 void SAL_CALL ODBTableDecorator::alterColumnByName( const OUString& _rName, const Reference< XPropertySet >& _rxDescriptor )
395 ::osl::MutexGuard aGuard(m_aMutex);
396 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
397 Reference<XAlterTable> xAlter(m_xTable,UNO_QUERY);
398 if(!xAlter.is())
399 throw SQLException(DBA_RES(RID_STR_COLUMN_ALTER_BY_NAME),*this,SQLSTATE_GENERAL,1000,Any() );
400 xAlter->alterColumnByName(_rName,_rxDescriptor);
401 if(m_pColumns)
402 m_pColumns->refresh();
405 void SAL_CALL ODBTableDecorator::alterColumnByIndex( sal_Int32 _nIndex, const Reference< XPropertySet >& _rxDescriptor )
407 ::osl::MutexGuard aGuard(m_aMutex);
408 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
409 Reference<XAlterTable> xAlter(m_xTable,UNO_QUERY);
410 if(!xAlter.is())
411 throw SQLException(DBA_RES(RID_STR_COLUMN_ALTER_BY_INDEX),*this,SQLSTATE_GENERAL,1000,Any() );
412 // not supported
413 xAlter->alterColumnByIndex(_nIndex,_rxDescriptor);
414 if(m_pColumns)
415 m_pColumns->refresh();
418 Reference< XNameAccess> ODBTableDecorator::getIndexes()
420 ::osl::MutexGuard aGuard(m_aMutex);
421 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
422 return Reference< XIndexesSupplier>(m_xTable,UNO_QUERY_THROW)->getIndexes();
425 Reference< XIndexAccess> ODBTableDecorator::getKeys()
427 ::osl::MutexGuard aGuard(m_aMutex);
428 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
429 return Reference< XKeysSupplier>(m_xTable,UNO_QUERY_THROW)->getKeys();
432 Reference< XNameAccess> ODBTableDecorator::getColumns()
434 ::osl::MutexGuard aGuard(m_aMutex);
435 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
437 if(!m_pColumns)
438 refreshColumns();
440 return m_pColumns.get();
443 OUString SAL_CALL ODBTableDecorator::getName()
445 ::osl::MutexGuard aGuard(m_aMutex);
446 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
447 Reference<XNamed> xName(m_xTable,UNO_QUERY);
448 OSL_ENSURE(xName.is(),"Table should support the XNamed interface");
449 return xName->getName();
452 sal_Int64 SAL_CALL ODBTableDecorator::getSomething( const Sequence< sal_Int8 >& rId )
454 if (isUnoTunnelId<ODBTableDecorator>(rId))
455 return reinterpret_cast<sal_Int64>(this);
457 sal_Int64 nRet = 0;
458 Reference<XUnoTunnel> xTunnel(m_xTable,UNO_QUERY);
459 if(xTunnel.is())
460 nRet = xTunnel->getSomething(rId);
461 return nRet;
464 Sequence< sal_Int8 > ODBTableDecorator::getUnoTunnelId()
466 static ::cppu::OImplementationId implId;
468 return implId.getImplementationId();
471 void ODBTableDecorator::fillPrivileges() const
473 // somebody is asking for the privileges and we do not know them, yet
474 m_nPrivileges = 0;
477 Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
478 if ( xProp.is() )
480 if ( xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_PRIVILEGES) )
482 xProp->getPropertyValue(PROPERTY_PRIVILEGES) >>= m_nPrivileges;
484 if ( m_nPrivileges == 0 ) // second chance
486 OUString sCatalog,sSchema,sName;
487 xProp->getPropertyValue(PROPERTY_CATALOGNAME) >>= sCatalog;
488 xProp->getPropertyValue(PROPERTY_SCHEMANAME) >>= sSchema;
489 xProp->getPropertyValue(PROPERTY_NAME) >>= sName;
490 m_nPrivileges = ::dbtools::getTablePrivileges(m_xMetaData, sCatalog,sSchema, sName);
494 catch(const SQLException&)
496 SAL_WARN("dbaccess", "ODBTableDecorator::ODBTableDecorator : could not collect the privileges !");
500 Reference< XPropertySet > SAL_CALL ODBTableDecorator::createDataDescriptor( )
502 ::osl::MutexGuard aGuard(m_aMutex);
503 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
505 Reference< XDataDescriptorFactory > xFactory( m_xTable, UNO_QUERY );
506 OSL_ENSURE( xFactory.is(), "ODBTableDecorator::createDataDescriptor: invalid table!" );
507 Reference< XColumnsSupplier > xColsSupp;
508 if ( xFactory.is() )
509 xColsSupp.set(xFactory->createDataDescriptor(), css::uno::UNO_QUERY);
511 return new ODBTableDecorator(
512 m_xConnection,
513 xColsSupp,
514 m_xNumberFormats,
515 nullptr
519 Reference< css::beans::XPropertySetInfo > SAL_CALL ODBTableDecorator::getPropertySetInfo( )
521 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
524 void ODBTableDecorator::refreshColumns()
526 ::osl::MutexGuard aGuard(m_aMutex);
527 ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
529 std::vector< OUString> aVector;
531 Reference<XNameAccess> xNames;
532 if(m_xTable.is())
534 xNames = m_xTable->getColumns();
535 if(xNames.is())
537 Sequence< OUString> aNames = xNames->getElementNames();
538 const OUString* pIter = aNames.getConstArray();
539 const OUString* pEnd = pIter + aNames.getLength();
540 for(;pIter != pEnd;++pIter)
541 aVector.push_back(*pIter);
544 if(!m_pColumns)
546 OColumns* pCol = new OColumns(*this,m_aMutex,xNames,m_xMetaData.is() && m_xMetaData->supportsMixedCaseQuotedIdentifiers(),aVector,
547 this,this,
548 m_xMetaData.is() && m_xMetaData->supportsAlterTableWithAddColumn(),
549 m_xMetaData.is() && m_xMetaData->supportsAlterTableWithDropColumn());
551 pCol->setParent(*this);
552 OContainerMediator* pMediator = new OContainerMediator( pCol, m_xColumnDefinitions );
553 m_xColumnMediator = pMediator;
554 pCol->setMediator( pMediator );
555 m_pColumns.reset(pCol);
557 else
558 m_pColumns->reFill(aVector);
561 OColumn* ODBTableDecorator::createColumn(const OUString& _rName) const
563 OColumn* pReturn = nullptr;
565 Reference<XNameAccess> xNames;
566 if ( m_xTable.is() )
568 xNames = m_xTable->getColumns();
570 if ( xNames.is() && xNames->hasByName(_rName) )
572 Reference<XPropertySet> xProp(xNames->getByName(_rName),UNO_QUERY);
574 Reference<XPropertySet> xColumnDefinition;
575 if ( m_xColumnDefinitions.is() && m_xColumnDefinitions->hasByName(_rName))
576 xColumnDefinition.set(m_xColumnDefinitions->getByName(_rName),UNO_QUERY);
578 pReturn = new OTableColumnWrapper( xProp, xColumnDefinition, false );
581 return pReturn;
584 void ODBTableDecorator::columnAppended( const Reference< XPropertySet >& /*_rxSourceDescriptor*/ )
586 // not interested in
589 void ODBTableDecorator::columnDropped(const OUString& _sName)
591 Reference<XDrop> xDrop(m_xColumnDefinitions,UNO_QUERY);
592 if ( xDrop.is() && m_xColumnDefinitions->hasByName(_sName) )
593 xDrop->dropByName(_sName);
596 Reference< XPropertySet > ODBTableDecorator::createColumnDescriptor()
598 Reference<XDataDescriptorFactory> xNames;
599 if(m_xTable.is())
600 xNames.set(m_xTable->getColumns(),UNO_QUERY);
601 Reference< XPropertySet > xRet;
602 if ( xNames.is() )
603 xRet = new OTableColumnDescriptorWrapper( xNames->createDataDescriptor(), false, true );
604 return xRet;
607 void SAL_CALL ODBTableDecorator::acquire() throw()
609 OTableDescriptor_BASE::acquire();
612 void SAL_CALL ODBTableDecorator::release() throw()
614 OTableDescriptor_BASE::release();
617 void SAL_CALL ODBTableDecorator::setName( const OUString& /*aName*/ )
619 throwFunctionNotSupportedRuntimeException( "XNamed::setName", *this );
622 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */