summaryrefslogtreecommitdiffstats
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-02-22 17:09:35 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-02-24 08:08:00 +0100
commitad73967e99235a2ba9b5a2106c5d6d0f8efaa1ca (patch)
tree5b11b7812b84c2647c64d1002bad7ed8a1d1754d /connectivity
parentReplace deprecated std::auto_ptr with boost::scoped_ptr (diff)
downloadcore-ad73967e99235a2ba9b5a2106c5d6d0f8efaa1ca.tar.gz
core-ad73967e99235a2ba9b5a2106c5d6d0f8efaa1ca.zip
Remove unnecessary extractInterface
Change-Id: I4848bf84615274ad5732223a354fb7a6b845d9a8
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/TKeys.cxx3
-rw-r--r--connectivity/source/commontools/TTableHelper.cxx6
-rw-r--r--connectivity/source/cpool/ZPoolCollection.cxx15
-rw-r--r--connectivity/source/drivers/dbase/DDatabaseMetaData.cxx14
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx13
-rw-r--r--connectivity/source/drivers/file/FDatabaseMetaData.cxx5
-rw-r--r--connectivity/source/drivers/flat/EDatabaseMetaData.cxx8
-rw-r--r--connectivity/source/manager/mdrivermanager.cxx3
8 files changed, 34 insertions, 33 deletions
diff --git a/connectivity/source/commontools/TKeys.cxx b/connectivity/source/commontools/TKeys.cxx
index 6e83e7be05c3..1841fd445169 100644
--- a/connectivity/source/commontools/TKeys.cxx
+++ b/connectivity/source/commontools/TKeys.cxx
@@ -24,7 +24,6 @@
#include <com/sun/star/sdbcx/KeyType.hpp>
#include <com/sun/star/sdbc/KeyRule.hpp>
#include "connectivity/dbtools.hxx"
-#include <comphelper/extract.hxx>
#include <comphelper/types.hxx>
#include <comphelper/property.hxx>
#include "TConnection.hxx"
@@ -182,7 +181,7 @@ sdbcx::ObjectType OKeysHelper::appendObject( const OUString& _rForName, const Re
{
if ( i > 0 )
aSql.appendAscii(",");
- ::cppu::extractInterface(xColProp,xColumns->getByIndex(i));
+ xColProp.set(xColumns->getByIndex(i), css::uno::UNO_QUERY);
aSql.append( ::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))) );
}
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
index c186b67c4946..fd8215fbfdcd 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -27,7 +27,6 @@
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <comphelper/implementationreference.hxx>
#include <comphelper/sequence.hxx>
-#include <comphelper/extract.hxx>
#include <comphelper/types.hxx>
#include "connectivity/dbtools.hxx"
#include "connectivity/sdbcx/VCollection.hxx"
@@ -554,8 +553,9 @@ void SAL_CALL OTableHelper::alterColumnByIndex( sal_Int32 index, const Reference
#endif
);
- Reference< XPropertySet > xOld;
- if(::cppu::extractInterface(xOld,m_pColumns->getByIndex(index)) && xOld.is())
+ Reference< XPropertySet > xOld(
+ m_pColumns->getByIndex(index), css::uno::UNO_QUERY);
+ if(xOld.is())
alterColumnByName(getString(xOld->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))),descriptor);
}
diff --git a/connectivity/source/cpool/ZPoolCollection.cxx b/connectivity/source/cpool/ZPoolCollection.cxx
index 30aa321560db..5df6034fb2c6 100644
--- a/connectivity/source/cpool/ZPoolCollection.cxx
+++ b/connectivity/source/cpool/ZPoolCollection.cxx
@@ -27,7 +27,6 @@
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/reflection/ProxyFactory.hpp>
#include <com/sun/star/sdbc/DriverManager.hpp>
-#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -359,13 +358,19 @@ Reference<XInterface> OPoolCollection::openNode(const OUString& _rPath,const Ref
{
if (xDirectAccess.is() && xDirectAccess->hasByName(_rPath))
{
- if (!::cppu::extractInterface(xNode, xDirectAccess->getByName(_rPath)))
- SAL_WARN("connectivity.cpool", "OConfigurationNode::openNode: could not open the node!");
+ xNode.set(xDirectAccess->getByName(_rPath), css::uno::UNO_QUERY);
+ SAL_WARN_IF(
+ !xNode.is(), "connectivity.cpool",
+ "OConfigurationNode::openNode: could not open the node!");
}
else if (xHierarchyAccess.is())
{
- if (!::cppu::extractInterface(xNode, xHierarchyAccess->getByHierarchicalName(_rPath)))
- SAL_WARN("connectivity.cpool", "OConfigurationNode::openNode: could not open the node!");
+ xNode.set(
+ xHierarchyAccess->getByHierarchicalName(_rPath),
+ css::uno::UNO_QUERY);
+ SAL_WARN_IF(
+ !xNode.is(), "connectivity.cpool",
+ "OConfigurationNode::openNode: could not open the node!");
}
}
diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
index 3047b5b77aec..13b7b96d3f3c 100644
--- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
@@ -29,7 +29,6 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include "dbase/DIndex.hxx"
#include "connectivity/FValue.hxx"
-#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/types.hxx>
#include <ucbhelper/content.hxx>
@@ -181,8 +180,8 @@ Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getColumns(
{
if(match(tableNamePattern,*pTabBegin,'\0'))
{
- Reference< XColumnsSupplier> xTable;
- ::cppu::extractInterface(xTable,xNames->getByName(*pTabBegin));
+ Reference< XColumnsSupplier> xTable(
+ xNames->getByName(*pTabBegin), css::uno::UNO_QUERY);
OSL_ENSURE(xTable.is(),"Table not found! Normallya exception had to be thrown here!");
aRow[3] = new ORowSetValueDecorator(*pTabBegin);
@@ -201,7 +200,8 @@ Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getColumns(
{
aRow[4] = new ORowSetValueDecorator(*pBegin);
- ::cppu::extractInterface(xColumn,xColumns->getByName(*pBegin));
+ xColumn.set(
+ xColumns->getByName(*pBegin), css::uno::UNO_QUERY);
OSL_ENSURE(xColumn.is(),"Columns contains a column who isn't a fastpropertyset!");
aRow[5] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))));
aRow[6] = new ORowSetValueDecorator(getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME))));
@@ -266,8 +266,8 @@ Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getIndexInfo(
aRow[5] = new ORowSetValueDecorator(OUString());
aRow[10] = new ORowSetValueDecorator(OUString("A"));
- Reference< XIndexesSupplier> xTable;
- ::cppu::extractInterface(xTable,xNames->getByName(table));
+ Reference< XIndexesSupplier> xTable(
+ xNames->getByName(table), css::uno::UNO_QUERY);
aRow[3] = new ORowSetValueDecorator(table);
aRow[7] = new ORowSetValueDecorator((sal_Int32)3);
@@ -282,7 +282,7 @@ Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getIndexInfo(
Reference< XPropertySet> xIndex;
for(;pBegin != pEnd;++pBegin)
{
- ::cppu::extractInterface(xIndex,xIndexes->getByName(*pBegin));
+ xIndex.set(xIndexes->getByName(*pBegin), css::uno::UNO_QUERY);
OSL_ENSURE(xIndex.is(),"Indexes contains a column who isn't a fastpropertyset!");
if(unique && !getBOOL(xIndex->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE))))
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index b23085cf3f1c..0747cfc22058 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -36,7 +36,6 @@
#include <rtl/math.hxx>
#include <stdio.h>
#include <ucbhelper/content.hxx>
-#include <comphelper/extract.hxx>
#include <connectivity/dbexception.hxx>
#include <connectivity/dbconversion.hxx>
#include <com/sun/star/lang/DisposedException.hpp>
@@ -1598,7 +1597,7 @@ sal_Bool ODbaseTable::DeleteRow(const OSQLColumns& _rCols)
Reference<XPropertySet> xIndex = isUniqueByColumnName(i);
if (xIndex.is())
{
- ::cppu::extractInterface(xCol,m_pColumns->getByIndex(i));
+ xCol.set(m_pColumns->getByIndex(i), css::uno::UNO_QUERY);
OSL_ENSURE(xCol.is(),"ODbaseTable::DeleteRow column is null!");
if(xCol.is())
{
@@ -1646,7 +1645,7 @@ Reference<XPropertySet> ODbaseTable::isUniqueByColumnName(sal_Int32 _nColumnPos)
Reference<XPropertySet> xIndex;
for(sal_Int32 i=0;i<m_pIndexes->getCount();++i)
{
- ::cppu::extractInterface(xIndex,m_pIndexes->getByIndex(i));
+ xIndex.set(m_pIndexes->getByIndex(i), css::uno::UNO_QUERY);
if(xIndex.is() && getBOOL(xIndex->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE))))
{
Reference<XNameAccess> xCols(Reference<XColumnsSupplier>(xIndex,UNO_QUERY)->getColumns());
@@ -1696,8 +1695,8 @@ sal_Bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,
for(nPos = 0;nPos<_xCols->getCount();++nPos)
{
- Reference<XPropertySet> xFindCol;
- ::cppu::extractInterface(xFindCol,_xCols->getByIndex(nPos));
+ Reference<XPropertySet> xFindCol(
+ _xCols->getByIndex(nPos), css::uno::UNO_QUERY);
OSL_ENSURE(xFindCol.is(),"ODbaseTable::UpdateBuffer column is null!");
if(aCase(getString(xFindCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))),aColName))
break;
@@ -1796,8 +1795,8 @@ sal_Bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,
xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName;
for(nPos = 0;nPos<_xCols->getCount();++nPos)
{
- Reference<XPropertySet> xFindCol;
- ::cppu::extractInterface(xFindCol,_xCols->getByIndex(nPos));
+ Reference<XPropertySet> xFindCol(
+ _xCols->getByIndex(nPos), css::uno::UNO_QUERY);
if(aCase(getString(xFindCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))),aColName))
break;
}
diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
index 5b123cb3f23e..d952a4ac161f 100644
--- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
@@ -30,7 +30,6 @@
#include <tools/urlobj.hxx>
#include "file/FDriver.hxx"
#include "file/FTable.hxx"
-#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>
#include <tools/debug.hxx>
#include <ucbhelper/content.hxx>
@@ -419,8 +418,8 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
aRow[7] = new ORowSetValueDecorator(OUString("NO"));
aRows.push_back(aRow);
- Reference< XPropertySet> xTable;
- ::cppu::extractInterface(xTable,xNames->getByName(*pBegin));
+ Reference< XPropertySet> xTable(
+ xNames->getByName(*pBegin), css::uno::UNO_QUERY);
if(xTable.is())
{
Reference<XUnoTunnel> xTunnel(xTable,UNO_QUERY);
diff --git a/connectivity/source/drivers/flat/EDatabaseMetaData.cxx b/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
index 7a9733323307..8dd793e4212a 100644
--- a/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
@@ -27,7 +27,6 @@
#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
#include "FDatabaseMetaDataResultSet.hxx"
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <comphelper/extract.hxx>
#include <comphelper/types.hxx>
using namespace ::comphelper;
@@ -176,8 +175,8 @@ Reference< XResultSet > SAL_CALL OFlatDatabaseMetaData::getColumns(
{
if(match(tableNamePattern,*pTabBegin,'\0'))
{
- Reference< XColumnsSupplier> xTable;
- ::cppu::extractInterface(xTable,xNames->getByName(*pTabBegin));
+ Reference< XColumnsSupplier> xTable(
+ xNames->getByName(*pTabBegin), css::uno::UNO_QUERY);
aRow[3] = new ORowSetValueDecorator(*pTabBegin);
Reference< XNameAccess> xColumns = xTable->getColumns();
@@ -195,7 +194,8 @@ Reference< XResultSet > SAL_CALL OFlatDatabaseMetaData::getColumns(
{
aRow[4] = new ORowSetValueDecorator(*pBegin);
- ::cppu::extractInterface(xColumn,xColumns->getByName(*pBegin));
+ xColumn.set(
+ xColumns->getByName(*pBegin), css::uno::UNO_QUERY);
OSL_ENSURE(xColumn.is(),"Columns contains a column who isn't a fastpropertyset!");
aRow[5] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))));
aRow[6] = new ORowSetValueDecorator(getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME))));
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx
index 484af4a08106..792c079f40b5 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -28,7 +28,6 @@
#include <com/sun/star/beans/NamedValue.hpp>
#include <tools/diagnose_ex.h>
-#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -280,7 +279,7 @@ void OSDBCDriverManager::bootstrapDrivers()
Reference< XServiceInfo > xSI;
while (xEnumDrivers->hasMoreElements())
{
- ::cppu::extractInterface( xFactory, xEnumDrivers->nextElement() );
+ xFactory.set(xEnumDrivers->nextElement(), css::uno::UNO_QUERY);
OSL_ENSURE( xFactory.is(), "OSDBCDriverManager::bootstrapDrivers: no factory extracted" );
if ( xFactory.is() )