diff options
30 files changed, 154 insertions, 152 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() ) diff --git a/cui/source/dialogs/showcols.cxx b/cui/source/dialogs/showcols.cxx index b16642e7b72f..8c9ac35ce3b4 100644 --- a/cui/source/dialogs/showcols.cxx +++ b/cui/source/dialogs/showcols.cxx @@ -89,7 +89,7 @@ void FmShowColsDialog::SetColumns(const ::com::sun::star::uno::Reference< ::com: for (sal_uInt16 i=0; i<xCols->getCount(); ++i) { sCurName = ""; - ::cppu::extractInterface(xCurCol, xCols->getByIndex(i)); + xCurCol.set(xCols->getByIndex(i), css::uno::UNO_QUERY); sal_Bool bIsHidden = sal_False; try { diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index a167d72fefe5..fa1b228a6578 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -57,7 +57,6 @@ #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <comphelper/processfactory.hxx> -#include <comphelper/extract.hxx> #include <comphelper/interaction.hxx> #include <comphelper/property.hxx> #include <comphelper/seqstream.hxx> @@ -359,7 +358,7 @@ void SAL_CALL ORowSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const m_bOwnConnection = sal_True; break; case PROPERTY_ID_TYPEMAP: - ::cppu::extractInterface(m_xTypeMap,m_aTypeMap); + m_xTypeMap.set(m_aTypeMap, css::uno::UNO_QUERY); break; case PROPERTY_ID_PROPCHANGE_NOTIFY: m_bPropChangeNotifyEnabled = ::cppu::any2bool(rValue); diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index e4cf2969071c..318bad4026de 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1385,8 +1385,8 @@ sal_Bool SbaXDataBrowserController::approveParameter(const ::com::sun::star::for const PropertyValue* pFinalValues = aFinalValues.getConstArray(); for (sal_Int32 i=0; i<aFinalValues.getLength(); ++i, ++pFinalValues) { - Reference< XPropertySet > xParam; - ::cppu::extractInterface(xParam, aRequest.Parameters->getByIndex(i)); + Reference< XPropertySet > xParam( + aRequest.Parameters->getByIndex(i), css::uno::UNO_QUERY); OSL_ENSURE(xParam.is(), "SbaXDataBrowserController::approveParameter: one of the parameters is no property set!"); if (xParam.is()) { diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 7a5aa0baca72..6cc20cd287c7 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -63,7 +63,6 @@ #include <connectivity/dbtools.hxx> #include <connectivity/dbconversion.hxx> #include <cppuhelper/typeprovider.hxx> -#include <comphelper/extract.hxx> #include <comphelper/servicehelper.hxx> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/sdbc/DataType.hpp> @@ -789,7 +788,7 @@ void SbaGridControl::SetColWidth(sal_uInt16 nColId) Reference< XIndexAccess > xCols(GetPeer()->getColumns(), UNO_QUERY); Reference< XPropertySet > xAffectedCol; if (xCols.is() && (nModelPos != (sal_uInt16)-1)) - ::cppu::extractInterface(xAffectedCol,xCols->getByIndex(nModelPos)); + xAffectedCol.set(xCols->getByIndex(nModelPos), css::uno::UNO_QUERY); if (xAffectedCol.is()) { @@ -868,7 +867,7 @@ void SbaGridControl::SetColAttrs(sal_uInt16 nColId) Reference< XIndexAccess > xCols(GetPeer()->getColumns(), UNO_QUERY); Reference< XPropertySet > xAffectedCol; if (xCols.is() && (nModelPos != (sal_uInt16)-1)) - ::cppu::extractInterface(xAffectedCol,xCols->getByIndex(nModelPos)); + xAffectedCol.set(xCols->getByIndex(nModelPos), css::uno::UNO_QUERY); // get the field the column is bound to Reference< XPropertySet > xField = getField(nModelPos); @@ -1326,8 +1325,9 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt ) Reference< XIndexAccess > xColumnControls((::com::sun::star::form::XGridPeer*)GetPeer(), UNO_QUERY); if (xColumnControls.is()) { - Reference< ::com::sun::star::awt::XTextComponent > xColControl; - ::cppu::extractInterface(xColControl,xColumnControls->getByIndex(GetViewColumnPos(nCol))); + Reference< ::com::sun::star::awt::XTextComponent > xColControl( + xColumnControls->getByIndex(GetViewColumnPos(nCol)), + css::uno::UNO_QUERY); if (xColControl.is()) { m_bActivatingForDrop = sal_True; diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 8dd70fb3c1db..b679a28d64cd 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -3026,8 +3026,9 @@ void SbaTableQueryBrowser::unloadAndCleanup( sal_Bool _bDisposeConnection ) xRowSetProps->getPropertyValue(PROPERTY_ACTIVE_CONNECTION) >>= xConn; #if OSL_DEBUG_LEVEL > 1 { - Reference< XComponent > xComp; - ::cppu::extractInterface(xComp, xRowSetProps->getPropertyValue(PROPERTY_ACTIVE_CONNECTION)); + Reference< XComponent > xComp( + xRowSetProps->getPropertyValue(PROPERTY_ACTIVE_CONNECTION), + css::uno::UNO_QUERY); } #endif diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index d47bbe71338d..8c08e7359554 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -55,7 +55,6 @@ #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> -#include <comphelper/extract.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/streamsection.hxx> #include <comphelper/types.hxx> @@ -1379,22 +1378,25 @@ void OTableController::assignTable() xNameAccess = xSup->getTables(); OSL_ENSURE(xNameAccess.is(),"no nameaccess for the queries!"); - Reference<XPropertySet> xProp; - if(xNameAccess->hasByName(m_sName) && ::cppu::extractInterface(xProp,xNameAccess->getByName(m_sName)) && xProp.is()) + if(xNameAccess->hasByName(m_sName)) { - m_xTable = xProp; - startTableListening(); - - // check if we set the table editable - Reference<XDatabaseMetaData> xMeta = getConnection()->getMetaData(); - setEditable( xMeta.is() && !xMeta->isReadOnly() && (isAlterAllowed() || isDropAllowed() || isAddAllowed()) ); - if(!isEditable()) + Reference<XPropertySet> xProp(xNameAccess->getByName(m_sName), css::uno::UNO_QUERY); + if (xProp.is()) { - ::std::for_each(m_vRowList.begin(),m_vRowList.end(),boost::bind( &OTableRow::SetReadOnly, _1, boost::cref( sal_True ))); + m_xTable = xProp; + startTableListening(); + + // check if we set the table editable + Reference<XDatabaseMetaData> xMeta = getConnection()->getMetaData(); + setEditable( xMeta.is() && !xMeta->isReadOnly() && (isAlterAllowed() || isDropAllowed() || isAddAllowed()) ); + if(!isEditable()) + { + ::std::for_each(m_vRowList.begin(),m_vRowList.end(),boost::bind( &OTableRow::SetReadOnly, _1, boost::cref( sal_True ))); + } + m_bNew = sal_False; + // be notified when the table is in disposing + InvalidateAll(); } - m_bNew = sal_False; - // be notified when the table is in disposing - InvalidateAll(); } } } diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index b507ed68bef8..dab46f859072 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -85,7 +85,6 @@ #include <com/sun/star/text/GraphicCrop.hpp> #include <unotools/ucbstreamhelper.hxx> #include <unotools/localfilehelper.hxx> -#include <comphelper/extract.hxx> #include <comphelper/string.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/virdev.hxx> @@ -1476,8 +1475,9 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties( } else if ( rSource == "Bitmap" ) { - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap >xBitmap; - if ( ::cppu::extractInterface( xBitmap, aAny ) ) + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap >xBitmap( + aAny, css::uno::UNO_QUERY); + if (xBitmap.is()) { ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap > xBmp; if ( aAny >>= xBmp ) diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 223adc8bc321..aed7bb88386c 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -58,7 +58,6 @@ #include <comphelper/basicio.hxx> #include <comphelper/container.hxx> #include <comphelper/enumhelper.hxx> -#include <comphelper/extract.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/seqstream.hxx> #include <comphelper/sequence.hxx> @@ -2471,8 +2470,8 @@ void SAL_CALL ODatabaseForm::setControlModels(const Sequence<Reference<XControlM // Find component in the list for (sal_Int32 j = 0; j < nCount; ++j) { - Reference<XFormComponent> xElement; - ::cppu::extractInterface(xElement, getByIndex(j)); + Reference<XFormComponent> xElement( + getByIndex(j), css::uno::UNO_QUERY); if (xComp == xElement) { Reference<XPropertySet> xSet(xComp, UNO_QUERY); diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index 746583ba30f6..1be7b6d48ac0 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -28,7 +28,6 @@ #include <com/sun/star/text/WritingMode2.hpp> #include <comphelper/basicio.hxx> #include <comphelper/container.hxx> -#include <comphelper/extract.hxx> #include <comphelper/processfactory.hxx> #include <cppuhelper/queryinterface.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -266,9 +265,13 @@ sal_Bool SAL_CALL OGridControlModel::select(const Any& rElement) throw(IllegalAr { ::osl::ClearableMutexGuard aGuard( m_aMutex ); Reference<XPropertySet> xSel; - if (rElement.hasValue() && !::cppu::extractInterface(xSel, rElement)) + if (rElement.hasValue()) { - throw IllegalArgumentException(); + xSel.set(rElement, css::uno::UNO_QUERY); + if (!xSel.is()) + { + throw IllegalArgumentException(); + } } InterfaceRef xMe = static_cast<XWeak*>(this); if (xSel.is()) diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index c7519a8881c6..d2f1be6f86c2 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -50,7 +50,6 @@ #include <tools/diagnose_ex.h> #include <vcl/svapp.hxx> #include <unotools/streamhelper.hxx> -#include <comphelper/extract.hxx> #include <comphelper/guarding.hxx> #include <comphelper/processfactory.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -959,7 +958,9 @@ void OImageControlControl::mousePressed(const ::com::sun::star::awt::MouseEvent& // If the Control is not bound, do not display a dialog (because the to-be-sent URL would be invalid anyway) Reference<XPropertySet> xBoundField; if (hasProperty(PROPERTY_BOUNDFIELD, xSet)) - ::cppu::extractInterface(xBoundField, xSet->getPropertyValue(PROPERTY_BOUNDFIELD)); + xBoundField.set( + xSet->getPropertyValue(PROPERTY_BOUNDFIELD), + css::uno::UNO_QUERY); if (!xBoundField.is()) { // but only if our IMAGE_URL property is handled as if it is transient, which is equivalent to diff --git a/include/comphelper/extract.hxx b/include/comphelper/extract.hxx index 6d401e66ae16..07acf4258417 100644 --- a/include/comphelper/extract.hxx +++ b/include/comphelper/extract.hxx @@ -20,7 +20,6 @@ #define INCLUDED_COMPHELPER_EXTRACT_HXX #include <com/sun/star/lang/IllegalArgumentException.hpp> -#include <com/sun/star/uno/XInterface.hpp> #include <com/sun/star/uno/TypeClass.hpp> #include <com/sun/star/uno/Type.hxx> #include <com/sun/star/uno/Any.hxx> @@ -101,24 +100,6 @@ inline ::com::sun::star::uno::Any SAL_CALL enum2any( E eEnum ) } /** - * Extracts interface from an any. If given any does not hold the demanded interface, - * it will be queried for it. - * If no interface is available, the out ref will be cleared. - *<BR> - * @param rxOut [out] demanded interface - * @param rAny interface - * @return sal_True if any reference (including the null ref) was retrieved from any else sal_False. - */ -template< class T > -inline bool SAL_CALL extractInterface( - ::com::sun::star::uno::Reference< T > & rxOut, - const ::com::sun::star::uno::Any & rAny ) -{ - rxOut.clear(); - return (rAny >>= rxOut); -} - -/** * extracts a boolean either as a sal_Bool or an integer from * an any. If there is no sal_Bool or integer inside the any * a ::com::sun::star::lang::IllegalArgumentException is thrown diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 96052cf52581..104a4a07a478 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -34,7 +34,6 @@ #include <i18nlangtag/languagetag.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/supportsservice.hxx> -#include <comphelper/extract.hxx> #include <boost/checked_delete.hpp> #include "lngsvcmgr.hxx" @@ -1075,7 +1074,12 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl() uno::Reference< lang::XSingleServiceFactory > xFactory; uno::Reference< linguistic2::XSpellChecker > xSvc; - if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) ) + xCompFactory.set(aCurrent, css::uno::UNO_QUERY); + if (!xCompFactory.is()) + { + xFactory.set(aCurrent, css::uno::UNO_QUERY); + } + if ( xCompFactory.is() || xFactory.is() ) { try { @@ -1132,7 +1136,12 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl() uno::Reference< lang::XSingleServiceFactory > xFactory; uno::Reference< linguistic2::XProofreader > xSvc; - if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) ) + xCompFactory.set(aCurrent, css::uno::UNO_QUERY); + if (!xCompFactory.is()) + { + xFactory.set(aCurrent, css::uno::UNO_QUERY); + } + if ( xCompFactory.is() || xFactory.is() ) { try { @@ -1189,7 +1198,12 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl() uno::Reference< lang::XSingleServiceFactory > xFactory; uno::Reference< linguistic2::XHyphenator > xSvc; - if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) ) + xCompFactory.set(aCurrent, css::uno::UNO_QUERY); + if (!xCompFactory.is()) + { + xFactory.set(aCurrent, css::uno::UNO_QUERY); + } + if ( xCompFactory.is() || xFactory.is() ) { try { @@ -1245,7 +1259,12 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl() uno::Reference< lang::XSingleServiceFactory > xFactory; uno::Reference< linguistic2::XThesaurus > xSvc; - if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) ) + xCompFactory.set(aCurrent, css::uno::UNO_QUERY); + if (!xCompFactory.is()) + { + xFactory.set(aCurrent, css::uno::UNO_QUERY); + } + if ( xCompFactory.is() || xFactory.is() ) { try { diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx index afa63d3c8bc0..04513c21d1ab 100644 --- a/sd/source/filter/eppt/pptx-epptbase.cxx +++ b/sd/source/filter/eppt/pptx-epptbase.cxx @@ -21,7 +21,6 @@ #include "eppt.hxx" #include "epptdef.hxx" -#include <comphelper/extract.hxx> #include <tools/globname.hxx> #include <tools/datetime.hxx> #include <tools/poly.hxx> @@ -618,16 +617,18 @@ sal_Bool PPTWriterBase::GetStyleSheets() if ( aXNameAccess->hasByName( aFamily ) ) { Any aAny( aXNameAccess->getByName( aFamily ) ); - if( aAny.getValue() && ::cppu::extractInterface( xNameAccess, aAny ) ) + xNameAccess.set(aAny, css::uno::UNO_QUERY); + if( xNameAccess.is() ) { Reference< XNameAccess > aXFamily; if ( aAny >>= aXFamily ) { if ( aXFamily->hasByName( aStyle ) ) { - Reference< XStyle > xStyle; aAny = aXFamily->getByName( aStyle ); - if( aAny.getValue() && ::cppu::extractInterface( xStyle, aAny ) ) + Reference< XStyle > xStyle( + aAny, css::uno::UNO_QUERY); + if( xStyle.is() ) { Reference< XStyle > aXStyle; aAny >>= aXStyle; diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index 2c0d731bb6d8..167369b50837 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -25,7 +25,6 @@ #include <svtools/helpid.hrc> #include <svtools/svtresid.hxx> #include <tools/debug.hxx> -#include <comphelper/extract.hxx> #include <comphelper/interaction.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> @@ -942,7 +941,9 @@ void AssignmentPersistentData::Commit() // get the table and the columns Reference< XColumnsSupplier > xSuppTableCols; if (m_xCurrentDatasourceTables->hasByName(sSelectedTable)) - ::cppu::extractInterface(xSuppTableCols, m_xCurrentDatasourceTables->getByName(sSelectedTable)); + xSuppTableCols.set( + m_xCurrentDatasourceTables->getByName(sSelectedTable), + css::uno::UNO_QUERY); Reference< XNameAccess > xColumns; if (xSuppTableCols.is()) xColumns = xSuppTableCols->getColumns(); diff --git a/svtools/source/uno/genericunodialog.cxx b/svtools/source/uno/genericunodialog.cxx index 3f225cd7a591..189b3b5853de 100644 --- a/svtools/source/uno/genericunodialog.cxx +++ b/svtools/source/uno/genericunodialog.cxx @@ -24,7 +24,6 @@ #include <com/sun/star/ucb/AlreadyInitializedException.hpp> #include <toolkit/awt/vclxwindow.hxx> -#include <comphelper/extract.hxx> #include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #include <comphelper/property.hxx> @@ -127,8 +126,7 @@ sal_Bool OGenericUnoDialog::convertFastPropertyValue( Any& rConvertedValue, Any& { case UNODIALOG_PROPERTY_ID_PARENT: { - Reference<starawt::XWindow> xNew; - ::cppu::extractInterface(xNew, rValue); + Reference<starawt::XWindow> xNew(rValue, css::uno::UNO_QUERY); if (xNew != m_xParent) { rConvertedValue <<= xNew; diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 25f3511d58d8..fd5bac9ff86e 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -52,7 +52,6 @@ #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> -#include <comphelper/extract.hxx> #include <comphelper/numbers.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/property.hxx> @@ -638,8 +637,8 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMe sal_uInt16 nPos2 = GetModelColumnPos(nColId); Reference< ::com::sun::star::container::XIndexContainer > xColumns(static_cast<FmGridControl*>(GetParent())->GetPeer()->getColumns()); - Reference< ::com::sun::star::beans::XPropertySet> xColumn; - ::cppu::extractInterface(xColumn, xColumns->getByIndex(nPos2)); + Reference< ::com::sun::star::beans::XPropertySet> xColumn( + xColumns->getByIndex(nPos2), css::uno::UNO_QUERY); Reference< ::com::sun::star::view::XSelectionSupplier > xSelSupplier(xColumns, UNO_QUERY); if (xSelSupplier.is()) xSelSupplier->select(makeAny(xColumn)); @@ -669,8 +668,8 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMe if (pMenu && xCols.is() && nColId) { - Reference< ::com::sun::star::beans::XPropertySet > xSet; - ::cppu::extractInterface(xSet, xCols->getByIndex(nPos)); + Reference< ::com::sun::star::beans::XPropertySet > xSet( + xCols->getByIndex(nPos), css::uno::UNO_QUERY); sal_Int16 nClassId; xSet->getPropertyValue(FM_PROP_CLASSID) >>= nClassId; @@ -718,7 +717,7 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMe Any aHidden,aName; for (sal_uInt16 i=0; i<xCols->getCount(); ++i) { - ::cppu::extractInterface(xCurCol, xCols->getByIndex(i)); + xCurCol.set(xCols->getByIndex(i), css::uno::UNO_QUERY); DBG_ASSERT(xCurCol.is(), "FmGridHeader::PreExecuteColumnContextMenu : the Peer has invalid columns !"); aHidden = xCurCol->getPropertyValue(FM_PROP_HIDDEN); DBG_ASSERT(aHidden.getValueType().getTypeClass() == TypeClass_BOOLEAN, @@ -789,8 +788,8 @@ void FmGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMe { case SID_FM_DELETECOL: { - Reference< XInterface > xCol; - ::cppu::extractInterface(xCol, xCols->getByIndex(nPos)); + Reference< XInterface > xCol( + xCols->getByIndex(nPos), css::uno::UNO_QUERY); xCols->removeByIndex(nPos); ::comphelper::disposeComponent(xCol); } break; @@ -850,8 +849,8 @@ void FmGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMe break; case SID_FM_HIDECOL: { - Reference< ::com::sun::star::beans::XPropertySet > xCurCol; - ::cppu::extractInterface(xCurCol, xCols->getByIndex(nPos)); + Reference< ::com::sun::star::beans::XPropertySet > xCurCol( + xCols->getByIndex(nPos), css::uno::UNO_QUERY); xCurCol->setPropertyValue(FM_PROP_HIDDEN, makeAny((sal_Bool)sal_True)); } break; @@ -875,7 +874,7 @@ void FmGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMe Reference< ::com::sun::star::beans::XPropertySet > xCurCol; for (sal_uInt16 i=0; i<xCols->getCount(); ++i) { - ::cppu::extractInterface(xCurCol, xCols->getByIndex(i)); + xCurCol.set(xCols->getByIndex(i), css::uno::UNO_QUERY); xCurCol->setPropertyValue(FM_PROP_HIDDEN, makeAny((sal_Bool)sal_False)); } // TODO : there must be a more clever way to do this .... @@ -889,7 +888,7 @@ void FmGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMe Reference< ::com::sun::star::beans::XPropertySet > xCurCol; for (sal_uInt16 i=0; i<xCols->getCount() && nExecutionResult; ++i) { - ::cppu::extractInterface(xCurCol, xCols->getByIndex(i)); + xCurCol.set(xCols->getByIndex(i), css::uno::UNO_QUERY); Any aHidden = xCurCol->getPropertyValue(FM_PROP_HIDDEN); if (::comphelper::getBOOL(aHidden)) if (!--nExecutionResult) @@ -1089,11 +1088,11 @@ void FmGridControl::SetDesignMode(bool bMode) Any aSelection = xSelSupplier->getSelection(); Reference< ::com::sun::star::beans::XPropertySet > xColumn; if (aSelection.getValueType().getTypeClass() == TypeClass_INTERFACE) - ::cppu::extractInterface(xColumn, aSelection); + xColumn.set(aSelection, css::uno::UNO_QUERY); Reference< XInterface > xCurrent; for (sal_uInt16 i=0; i<xColumns->getCount(); ++i) { - ::cppu::extractInterface(xCurrent, xColumns->getByIndex(i)); + xCurrent.set(xColumns->getByIndex(i), css::uno::UNO_QUERY); if (xCurrent == xColumn) { markColumn(GetColumnIdFromModelPos(i)); @@ -1528,7 +1527,7 @@ void FmGridControl::ColumnMoved(sal_uInt16 nId) Reference< XInterface > xCurrent; for (i = 0; !xCol.is() && i < xColumns->getCount(); i++) { - ::cppu::extractInterface(xCurrent, xColumns->getByIndex(i)); + xCurrent.set(xColumns->getByIndex(i), css::uno::UNO_QUERY); if (xCurrent == pCol->getModel()) { xCol = pCol->getModel(); @@ -1570,8 +1569,8 @@ void FmGridControl::InitColumnsByModels(const Reference< ::com::sun::star::conta Any aWidth; for (i = 0; i < xColumns->getCount(); ++i) { - Reference< ::com::sun::star::beans::XPropertySet > xCol; - ::cppu::extractInterface(xCol, xColumns->getByIndex(i)); + Reference< ::com::sun::star::beans::XPropertySet > xCol( + xColumns->getByIndex(i), css::uno::UNO_QUERY); OUString aName( comphelper::getString(xCol->getPropertyValue(FM_PROP_LABEL))); @@ -1593,8 +1592,8 @@ void FmGridControl::InitColumnsByModels(const Reference< ::com::sun::star::conta Any aHidden; for (i = 0; i < xColumns->getCount(); ++i) { - Reference< ::com::sun::star::beans::XPropertySet > xCol; - ::cppu::extractInterface(xCol, xColumns->getByIndex(i)); + Reference< ::com::sun::star::beans::XPropertySet > xCol( + xColumns->getByIndex(i), css::uno::UNO_QUERY); aHidden = xCol->getPropertyValue(FM_PROP_HIDDEN); if (::comphelper::getBOOL(aHidden)) HideColumn(GetColumnIdFromModelPos((sal_uInt16)i)); @@ -1691,8 +1690,8 @@ void FmGridControl::InitColumnsByFields(const Reference< ::com::sun::star::conta OSL_ENSURE(pCol,"No grid column!"); if ( pCol ) { - Reference< XPropertySet > xColumnModel; - ::cppu::extractInterface( xColumnModel, xColumns->getByIndex( i ) ); + Reference< XPropertySet > xColumnModel( + xColumns->getByIndex( i ), css::uno::UNO_QUERY); InitColumnByField( pCol, xColumnModel, xFieldsAsNames, _rxFields ); } @@ -1985,8 +1984,9 @@ void FmGridControl::Select() { if (nSelectedColumn != SAL_MAX_UINT16) { - Reference< XPropertySet > xColumn; - ::cppu::extractInterface(xColumn,xColumns->getByIndex(nSelectedColumn)); + Reference< XPropertySet > xColumn( + xColumns->getByIndex(nSelectedColumn), + css::uno::UNO_QUERY); xSelSupplier->select(makeAny(xColumn)); } else diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 659739661a3d..f50c77f45b41 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -45,7 +45,6 @@ #include <comphelper/container.hxx> #include <comphelper/enumhelper.hxx> -#include <comphelper/extract.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/property.hxx> #include <comphelper/sequence.hxx> @@ -1471,7 +1470,7 @@ void FmXGridPeer::propertyChange(const PropertyChangeEvent& evt) throw( RuntimeE for ( i = 0; i < m_xColumns->getCount(); i++) { - ::cppu::extractInterface(xCurrent, m_xColumns->getByIndex(i)); + xCurrent.set(m_xColumns->getByIndex(i), css::uno::UNO_QUERY); if (evt.Source == xCurrent) break; } @@ -1718,7 +1717,7 @@ void FmXGridPeer::setColumns(const Reference< XIndexContainer >& Columns) throw( Reference< XPropertySet > xCol; for (sal_Int32 i = 0; i < m_xColumns->getCount(); i++) { - ::cppu::extractInterface(xCol, m_xColumns->getByIndex(i)); + xCol.set(m_xColumns->getByIndex(i), css::uno::UNO_QUERY); removeColumnListeners(xCol); } Reference< XContainer > xContainer(m_xColumns, UNO_QUERY); @@ -1742,7 +1741,7 @@ void FmXGridPeer::setColumns(const Reference< XIndexContainer >& Columns) throw( Reference< XPropertySet > xCol; for (sal_Int32 i = 0; i < Columns->getCount(); i++) { - ::cppu::extractInterface(xCol, Columns->getByIndex(i)); + xCol.set(Columns->getByIndex(i), css::uno::UNO_QUERY); addColumnListeners(xCol); } @@ -1799,8 +1798,7 @@ void FmXGridPeer::elementInserted(const ContainerEvent& evt) throw( RuntimeExcep if (!pGrid || !m_xColumns.is() || pGrid->IsInColumnMove() || m_xColumns->getCount() == ((sal_Int32)pGrid->GetModelColCount())) return; - Reference< XPropertySet > xSet; - ::cppu::extractInterface(xSet, evt.Element); + Reference< XPropertySet > xSet(evt.Element, css::uno::UNO_QUERY); addColumnListeners(xSet); Reference< XPropertySet > xNewColumn(xSet); @@ -1834,10 +1832,9 @@ void FmXGridPeer::elementReplaced(const ContainerEvent& evt) throw( RuntimeExcep if (!pGrid || !m_xColumns.is() || pGrid->IsInColumnMove()) return; - Reference< XPropertySet > xNewColumn; - Reference< XPropertySet > xOldColumn; - ::cppu::extractInterface(xNewColumn, evt.Element); - ::cppu::extractInterface(xOldColumn, evt.ReplacedElement); + Reference< XPropertySet > xNewColumn(evt.Element, css::uno::UNO_QUERY); + Reference< XPropertySet > xOldColumn( + evt.ReplacedElement, css::uno::UNO_QUERY); sal_Bool bWasEditing = pGrid->IsEditing(); if (bWasEditing) @@ -1892,8 +1889,7 @@ void FmXGridPeer::elementRemoved(const ContainerEvent& evt) throw( RuntimeExcept pGrid->RemoveColumn(pGrid->GetColumnIdFromModelPos((sal_uInt16)::comphelper::getINT32(evt.Accessor))); - Reference< XPropertySet > xOldColumn; - ::cppu::extractInterface(xOldColumn, evt.Element); + Reference< XPropertySet > xOldColumn(evt.Element, css::uno::UNO_QUERY); removeColumnListeners(xOldColumn); } diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index ad402ddc863d..aca59abe9bc6 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -45,7 +45,6 @@ #include <com/sun/star/util/Time.hpp> #include <com/sun/star/util/Date.hpp> -#include <comphelper/extract.hxx> #include <comphelper/numbers.hxx> #include <comphelper/property.hxx> #include <comphelper/servicehelper.hxx> @@ -1324,7 +1323,7 @@ void DbFormattedField::Init( Window& rParent, const Reference< XRowSet >& xCurso Any aSupplier( xUnoModel->getPropertyValue(FM_PROP_FORMATSSUPPLIER)); if (aSupplier.hasValue()) { - ::cppu::extractInterface(m_xSupplier, aSupplier); + m_xSupplier.set(aSupplier, css::uno::UNO_QUERY); if (m_xSupplier.is()) { // wenn wir den Supplier vom Model nehmen, dann auch den Key @@ -3138,7 +3137,7 @@ void DbFilterField::Update() Reference< ::com::sun::star::sdbcx::XColumnsSupplier > xSupplyCols(xListCursor, UNO_QUERY); Reference< ::com::sun::star::container::XIndexAccess > xFields(xSupplyCols->getColumns(), UNO_QUERY); - ::cppu::extractInterface(xDataField, xFields->getByIndex(0)); + xDataField.set(xFields->getByIndex(0), css::uno::UNO_QUERY); if (!xDataField.is()) return; } diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 761426ecba81..b503013335f0 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -39,7 +39,6 @@ #include <com/sun/star/util/XCloneable.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/PropertyChangeEvent.hpp> -#include <comphelper/extract.hxx> #include <comphelper/processfactory.hxx> #include <tools/resid.hxx> #include <tools/diagnose_ex.h> @@ -771,8 +770,8 @@ DbGridRow::DbGridRow(CursorWrapper* pCur, sal_Bool bPaintCursor) DataColumn* pColumn; for (sal_Int32 i = 0; i < xColumns->getCount(); ++i) { - Reference< XPropertySet > xColSet; - ::cppu::extractInterface(xColSet, xColumns->getByIndex(i)); + Reference< XPropertySet > xColSet( + xColumns->getByIndex(i), css::uno::UNO_QUERY); pColumn = new DataColumn(xColSet); m_aVariants.push_back( pColumn ); } diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 97d3dd8c2c58..325765178b81 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -65,7 +65,6 @@ #include <com/sun/star/sdb/XColumn.hpp> #include <comphelper/enumhelper.hxx> -#include <comphelper/extract.hxx> #include <comphelper/interaction.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/processfactory.hxx> @@ -3967,8 +3966,8 @@ sal_Bool SAL_CALL FormController::approveParameter(const DatabaseParameterEvent& const PropertyValue* pFinalValues = aFinalValues.getConstArray(); for (sal_Int32 i=0; i<aFinalValues.getLength(); ++i, ++pFinalValues) { - Reference< XPropertySet > xParam; - ::cppu::extractInterface(xParam, aRequest.Parameters->getByIndex(i)); + Reference< XPropertySet > xParam( + aRequest.Parameters->getByIndex(i), css::uno::UNO_QUERY); if (xParam.is()) { #ifdef DBG_UTIL diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx index 11f2bd3c3d18..9032043ea408 100644 --- a/unotools/source/config/confignode.cxx +++ b/unotools/source/config/confignode.cxx @@ -30,7 +30,6 @@ #include <com/sun/star/util/XStringEscape.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/container/XNamed.hpp> -#include <comphelper/extract.hxx> #include <comphelper/namedvaluecollection.hxx> #include <rtl/string.hxx> #if OSL_DEBUG_LEVEL > 0 @@ -300,12 +299,17 @@ namespace utl Reference< XInterface > xNode; if (m_xDirectAccess.is() && m_xDirectAccess->hasByName(sNormalized)) { - if (!::cppu::extractInterface(xNode, m_xDirectAccess->getByName(sNormalized))) + xNode.set( + m_xDirectAccess->getByName(sNormalized), css::uno::UNO_QUERY); + if (!xNode.is()) OSL_FAIL("OConfigurationNode::openNode: could not open the node!"); } else if (m_xHierarchyAccess.is()) { - if (!::cppu::extractInterface(xNode, m_xHierarchyAccess->getByHierarchicalName(_rPath))) + xNode.set( + m_xHierarchyAccess->getByHierarchicalName(_rPath), + css::uno::UNO_QUERY); + if (!xNode.is()) OSL_FAIL("OConfigurationNode::openNode: could not open the node!"); } if (xNode.is()) diff --git a/xmloff/source/forms/eventimport.cxx b/xmloff/source/forms/eventimport.cxx index 87f490f237f9..2cedb83f0c7a 100644 --- a/xmloff/source/forms/eventimport.cxx +++ b/xmloff/source/forms/eventimport.cxx @@ -20,7 +20,6 @@ #include "eventimport.hxx" #include <com/sun/star/script/XEventAttacherManager.hpp> #include <com/sun/star/beans/PropertyValue.hpp> -#include <comphelper/extract.hxx> #include "strings.hxx" namespace xmloff @@ -126,7 +125,7 @@ namespace xmloff MapPropertySet2ScriptSequence::const_iterator aRegisteredEventsPos; for (sal_Int32 i=0; i<nCount; ++i) { - ::cppu::extractInterface(xCurrent, _rxContainer->getByIndex(i)); + xCurrent.set(_rxContainer->getByIndex(i), css::uno::UNO_QUERY); if (xCurrent.is()) { aRegisteredEventsPos = m_aEvents.find(xCurrent); |