summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--avmedia/source/win/manager.cxx8
-rw-r--r--avmedia/source/win/player.cxx5
-rw-r--r--connectivity/source/drivers/ado/AColumns.cxx5
-rw-r--r--connectivity/source/drivers/ado/AConnection.cxx17
-rw-r--r--connectivity/source/drivers/ado/ADatabaseMetaData.cxx93
-rw-r--r--connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx22
-rw-r--r--connectivity/source/drivers/ado/ADriver.cxx4
-rw-r--r--connectivity/source/drivers/ado/APreparedStatement.cxx8
-rw-r--r--connectivity/source/drivers/ado/AStatement.cxx8
-rw-r--r--connectivity/source/drivers/ado/AViews.cxx3
-rw-r--r--embedserv/source/embed/docholder.cxx8
-rw-r--r--embedserv/source/embed/ed_ipersiststr.cxx3
-rw-r--r--embedserv/source/inc/docholder.hxx2
-rw-r--r--embedserv/source/inc/embeddoc.hxx3
-rw-r--r--extensions/source/ole/unoobjw.cxx3
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx29
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx6
17 files changed, 92 insertions, 135 deletions
diff --git a/avmedia/source/win/manager.cxx b/avmedia/source/win/manager.cxx
index 731effd5f80f..578ec9d2a5af 100644
--- a/avmedia/source/win/manager.cxx
+++ b/avmedia/source/win/manager.cxx
@@ -21,6 +21,7 @@
#include "player.hxx"
#include <cppuhelper/supportsservice.hxx>
+#include <rtl/ref.hxx>
#include <tools/urlobj.hxx>
using namespace ::com::sun::star;
@@ -39,14 +40,13 @@ Manager::~Manager()
uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const OUString& rURL )
{
- Player* pPlayer( new Player() );
- uno::Reference< media::XPlayer > xRet( pPlayer );
+ rtl::Reference<Player> pPlayer( new Player() );
const INetURLObject aURL( rURL );
if( !pPlayer->create( aURL.GetMainURL( INetURLObject::DecodeMechanism::Unambiguous ) ) )
- xRet.clear();
+ pPlayer.clear();
- return xRet;
+ return pPlayer;
}
diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx
index 7990e7aecdfe..8ff8f70c9b38 100644
--- a/avmedia/source/win/player.cxx
+++ b/avmedia/source/win/player.cxx
@@ -29,6 +29,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <o3tl/char16_t2wchar_t.hxx>
#include <osl/file.hxx>
+#include <rtl/ref.hxx>
#define AVMEDIA_WIN_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_DirectX"
#define AVMEDIA_WIN_PLAYER_SERVICENAME "com.sun.star.media.Player_DirectX"
@@ -407,7 +408,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co
if( mpVW && aSize.Width > 0 && aSize.Height > 0 )
{
- ::avmedia::win::Window* pWindow = new ::avmedia::win::Window( *this );
+ rtl::Reference<::avmedia::win::Window> pWindow = new ::avmedia::win::Window( *this );
xRet = pWindow;
@@ -425,7 +426,7 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber( )
if( !maURL.isEmpty() )
{
- FrameGrabber* pGrabber = new FrameGrabber();
+ rtl::Reference<FrameGrabber> pGrabber = new FrameGrabber();
xRet = pGrabber;
diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx
index 0ade4a071c45..010807610868 100644
--- a/connectivity/source/drivers/ado/AColumns.cxx
+++ b/connectivity/source/drivers/ado/AColumns.cxx
@@ -29,6 +29,7 @@
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
+#include <rtl/ref.hxx>
#include <algorithm>
#include <string_view>
#include <strings.hrc>
@@ -61,9 +62,9 @@ Reference< XPropertySet > OColumns::createDescriptor()
// XAppend
sdbcx::ObjectType OColumns::appendObject( const OUString&, const Reference< XPropertySet >& descriptor )
{
- OAdoColumn* pColumn = getUnoTunnelImplementation<OAdoColumn>( descriptor );
+ rtl::Reference<OAdoColumn> pColumn = getUnoTunnelImplementation<OAdoColumn>( descriptor );
Reference< XPropertySet > xColumn;
- if ( pColumn == nullptr )
+ if ( !pColumn.is() )
{
// m_pConnection->throwGenericSQLException( STR_INVALID_COLUMN_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
pColumn = new OAdoColumn(isCaseSensitive(),m_pConnection);
diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx
index 6a26265c4d42..664990f66564 100644
--- a/connectivity/source/drivers/ado/AConnection.cxx
+++ b/connectivity/source/drivers/ado/AConnection.cxx
@@ -163,10 +163,9 @@ Reference< XStatement > SAL_CALL OConnection::createStatement( )
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- OStatement* pStmt = new OStatement(this);
- Reference< XStatement > xStmt = pStmt;
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return pStmt;
+ Reference< XStatement > xStmt = new OStatement(this);
+ m_aStatements.push_back(WeakReferenceHelper(xStmt));
+ return xStmt;
}
Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const OUString& sql )
@@ -175,9 +174,8 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const OU
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- OPreparedStatement* pStmt = new OPreparedStatement(this, sql);
- Reference< XPreparedStatement > xPStmt = pStmt;
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
+ Reference< XPreparedStatement > xPStmt = new OPreparedStatement(this, sql);
+ m_aStatements.push_back(WeakReferenceHelper(xPStmt));
return xPStmt;
}
@@ -187,9 +185,8 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const OUStrin
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- OCallableStatement* pStmt = new OCallableStatement(this, sql);
- Reference< XPreparedStatement > xPStmt = pStmt;
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
+ Reference< XPreparedStatement > xPStmt = new OCallableStatement(this, sql);
+ m_aStatements.push_back(WeakReferenceHelper(xPStmt));
return xPStmt;
}
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaData.cxx b/connectivity/source/drivers/ado/ADatabaseMetaData.cxx
index 8e46761e8c27..a60afbd6f131 100644
--- a/connectivity/source/drivers/ado/ADatabaseMetaData.cxx
+++ b/connectivity/source/drivers/ado/ADatabaseMetaData.cxx
@@ -28,6 +28,7 @@
#include <FDatabaseMetaDataResultSet.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
+#include <rtl/ref.hxx>
using namespace ::comphelper;
@@ -86,10 +87,9 @@ Reference< XResultSet > ODatabaseMetaData::impl_getTypeInfo_throw( )
{
ADORecordset *pRecordset = m_pADOConnection->getTypeInfo();
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setTypeInfoMap(ADOS::isJetEngine(m_pConnection->getEngineType()));
- Reference< XResultSet > xRef = pResult;
- return xRef;
+ return pResult;
}
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs( )
@@ -101,13 +101,10 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs( )
m_pADOConnection->OpenSchema(adSchemaCatalogs,vtEmpty,vtEmpty,&pRecordset);
ADOS::ThrowException(*m_pADOConnection,*this);
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setCatalogsMap();
- xRef = pResult;
- return xRef;
+ return pResult;
}
OUString ODatabaseMetaData::impl_getCatalogSeparator_throw( )
@@ -124,12 +121,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas( )
m_pADOConnection->OpenSchema(adSchemaSchemata,vtEmpty,vtEmpty,&pRecordset);
ADOS::ThrowException(*m_pADOConnection,*this);
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setSchemasMap();
- xRef = pResult;
- return xRef;
+ return pResult;
}
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges(
@@ -139,12 +133,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges(
ADORecordset *pRecordset = m_pADOConnection->getColumnPrivileges(catalog,schema,table,columnNamePattern);
ADOS::ThrowException(*m_pADOConnection,*this);
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setColumnPrivilegesMap();
- xRef = pResult;
- return xRef;
+ return pResult;
}
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
@@ -154,13 +145,10 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
ADORecordset *pRecordset = m_pADOConnection->getColumns(catalog,schemaPattern,tableNamePattern,columnNamePattern);
ADOS::ThrowException(*m_pADOConnection,*this);
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setColumnsMap();
- xRef = pResult;
- return xRef;
+ return pResult;
}
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
@@ -170,13 +158,10 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
ADORecordset *pRecordset = m_pADOConnection->getTables(catalog,schemaPattern,tableNamePattern,types);
ADOS::ThrowException(*m_pADOConnection,*this);
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setTablesMap();
- xRef = pResult;
- return xRef;
+ return pResult;
}
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns(
@@ -186,13 +171,10 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns(
ADORecordset *pRecordset = m_pADOConnection->getProcedureColumns(catalog,schemaPattern,procedureNamePattern,columnNamePattern);
ADOS::ThrowException(*m_pADOConnection,*this);
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setProcedureColumnsMap();
- xRef = pResult;
- return xRef;
+ return pResult;
}
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
@@ -203,13 +185,10 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
ADORecordset *pRecordset = m_pADOConnection->getProcedures(catalog,schemaPattern,procedureNamePattern);
ADOS::ThrowException(*m_pADOConnection,*this);
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setProceduresMap();
- xRef = pResult;
- return xRef;
+ return pResult;
}
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( )
@@ -278,12 +257,10 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys(
ADORecordset *pRecordset = m_pADOConnection->getExportedKeys(catalog,schema,table);
ADOS::ThrowException(*m_pADOConnection,*this);
- Reference< XResultSet > xRef;
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setCrossReferenceMap();
- xRef = pResult;
- return xRef;
+ return pResult;
}
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
@@ -292,13 +269,10 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
ADORecordset *pRecordset = m_pADOConnection->getImportedKeys(catalog,schema,table);
ADOS::ThrowException(*m_pADOConnection,*this);
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setCrossReferenceMap();
- xRef = pResult;
- return xRef;
+ return pResult;
}
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
@@ -307,13 +281,10 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
ADORecordset *pRecordset = m_pADOConnection->getPrimaryKeys(catalog,schema,table);
ADOS::ThrowException(*m_pADOConnection,*this);
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setPrimaryKeysMap();
- xRef = pResult;
- return xRef;
+ return pResult;
}
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo(
@@ -323,13 +294,10 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo(
ADORecordset *pRecordset = m_pADOConnection->getIndexInfo(catalog,schema,table,unique,approximate);
ADOS::ThrowException(*m_pADOConnection,*this);
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setIndexInfoMap();
- xRef = pResult;
- return xRef;
+ return pResult;
}
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
@@ -343,13 +311,13 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
ADORecordset *pRecordset = m_pADOConnection->getTablePrivileges(catalog,schemaPattern,tableNamePattern);
ADOS::ThrowException(*m_pADOConnection,*this);
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setTablePrivilegesMap();
xRef = pResult;
}
else
{
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTablePrivileges);
+ rtl::Reference<::connectivity::ODatabaseMetaDataResultSet> pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTablePrivileges);
xRef = pResult;
::connectivity::ODatabaseMetaDataResultSet::ORows aRows;
::connectivity::ODatabaseMetaDataResultSet::ORow aRow(8);
@@ -393,13 +361,10 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
ADORecordset *pRecordset = m_pADOConnection->getCrossReference(primaryCatalog,primarySchema,primaryTable,foreignCatalog,foreignSchema,foreignTable);
ADOS::ThrowException(*m_pADOConnection,*this);
- Reference< XResultSet > xRef;
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset);
+ rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(pRecordset);
pResult->setCrossReferenceMap();
- xRef = pResult;
- return xRef;
+ return pResult;
}
sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( )
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
index a12f6e1fd6c4..caa4dd800324 100644
--- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
@@ -34,7 +34,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/seqstream.hxx>
#include <connectivity/dbexception.hxx>
-
+#include <rtl/ref.hxx>
#include <oledb.h>
@@ -795,7 +795,7 @@ void ODatabaseMetaDataResultSet::setProceduresMap()
aMap[DB_PT_FUNCTION] = ProcedureResult::RETURN;
m_aValueRange[4] = aMap;
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
+ rtl::Reference<ODatabaseMetaDataResultSetMetaData> pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
pMetaData->setProceduresMap();
m_xMetaData = pMetaData;
}
@@ -825,7 +825,7 @@ void ODatabaseMetaDataResultSet::setColumnPrivilegesMap()
m_aColMapping.push_back(9);
m_aColMapping.push_back(10);
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
+ rtl::Reference<ODatabaseMetaDataResultSetMetaData> pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
pMetaData->setColumnPrivilegesMap();
m_xMetaData = pMetaData;
}
@@ -902,7 +902,7 @@ void ODatabaseMetaDataResultSet::setColumnsMap()
aMap2[1] = "NO";
m_aIntValueRange[18] = aMap2;
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
+ rtl::Reference<ODatabaseMetaDataResultSetMetaData> pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
pMetaData->setColumnsMap();
m_xMetaData = pMetaData;
}
@@ -914,7 +914,7 @@ void ODatabaseMetaDataResultSet::setTablesMap()
m_aColMapping.push_back(i);
m_aColMapping.push_back(6);
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
+ rtl::Reference<ODatabaseMetaDataResultSetMetaData> pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
pMetaData->setTablesMap();
m_xMetaData = pMetaData;
}
@@ -981,7 +981,7 @@ void ODatabaseMetaDataResultSet::setProcedureColumnsMap()
m_aValueRange[10] = aMap;
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
+ rtl::Reference<ODatabaseMetaDataResultSetMetaData> pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
pMetaData->setProcedureColumnsMap();
m_xMetaData = pMetaData;
}
@@ -995,7 +995,7 @@ void ODatabaseMetaDataResultSet::setPrimaryKeysMap()
m_aColMapping.push_back(7);
m_aColMapping.push_back(8);
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
+ rtl::Reference<ODatabaseMetaDataResultSetMetaData> pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
pMetaData->setProcedureColumnsMap();
m_xMetaData = pMetaData;
}
@@ -1037,7 +1037,7 @@ void ODatabaseMetaDataResultSet::setIndexInfoMap()
m_aIntValueRange[21] = aMap3;
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
+ rtl::Reference<ODatabaseMetaDataResultSetMetaData> pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
pMetaData->setIndexInfoMap();
m_xMetaData = pMetaData;
}
@@ -1059,7 +1059,7 @@ void ODatabaseMetaDataResultSet::setTablePrivilegesMap()
m_aIntValueRange[7] = aMap;
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
+ rtl::Reference<ODatabaseMetaDataResultSetMetaData> pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
pMetaData->setTablePrivilegesMap();
m_xMetaData = pMetaData;
}
@@ -1090,7 +1090,7 @@ void ODatabaseMetaDataResultSet::setCrossReferenceMap()
m_aStrValueRange[14] = aMap;
m_aStrValueRange[15] = aMap;
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
+ rtl::Reference<ODatabaseMetaDataResultSetMetaData> pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
pMetaData->setCrossReferenceMap();
m_xMetaData = pMetaData;
}
@@ -1168,7 +1168,7 @@ void ODatabaseMetaDataResultSet::setTypeInfoMap(bool _bJetEngine)
::std::map<sal_Int32,sal_Int32> aCurrencyMapping;
m_aValueRange[11] = aCurrencyMapping;
- ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
+ rtl::Reference<ODatabaseMetaDataResultSetMetaData> pMetaData = new ODatabaseMetaDataResultSetMetaData(m_pRecordSet,this);
pMetaData->setTypeInfoMap();
m_xMetaData = pMetaData;
}
diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx
index 610f7722c697..fcda87a9c0ab 100644
--- a/connectivity/source/drivers/ado/ADriver.cxx
+++ b/connectivity/source/drivers/ado/ADriver.cxx
@@ -191,10 +191,10 @@ Reference< XTablesSupplier > SAL_CALL ODriver::getDataDefinitionByConnection( co
if(aCatalog.IsValid())
{
aCatalog.putref_ActiveConnection(*pConnection->getConnection());
- OCatalog* pCatalog = new OCatalog(aCatalog,pConnection);
+ rtl::Reference<OCatalog> pCatalog = new OCatalog(aCatalog,pConnection);
xTab = pCatalog;
pConnection->setCatalog(xTab);
- pConnection->setCatalog(pCatalog);
+ pConnection->setCatalog(pCatalog.get());
}
}
return xTab;
diff --git a/connectivity/source/drivers/ado/APreparedStatement.cxx b/connectivity/source/drivers/ado/APreparedStatement.cxx
index 34697fa4388a..c06b1267b57b 100644
--- a/connectivity/source/drivers/ado/APreparedStatement.cxx
+++ b/connectivity/source/drivers/ado/APreparedStatement.cxx
@@ -31,6 +31,7 @@
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
#include <connectivity/dbtools.hxx>
+#include <rtl/ref.hxx>
#include <strings.hrc>
#include <limits>
@@ -264,13 +265,12 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( )
CHECK_RETURN(m_RecordSet.get_CursorType(m_eCursorType))
CHECK_RETURN(m_RecordSet.get_LockType(m_eLockType))
- OResultSet* pSet = new OResultSet(m_RecordSet,this);
- Reference< XResultSet > xRs = pSet;
+ rtl::Reference<OResultSet> pSet = new OResultSet(m_RecordSet,this);
pSet->construct();
pSet->setMetaData(getMetaData());
- m_xResultSet = WeakReference<XResultSet>(xRs);
+ m_xResultSet = WeakReference<XResultSet>(pSet);
- return xRs;
+ return pSet;
}
void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x )
diff --git a/connectivity/source/drivers/ado/AStatement.cxx b/connectivity/source/drivers/ado/AStatement.cxx
index 599df13aba36..553d42a976f3 100644
--- a/connectivity/source/drivers/ado/AStatement.cxx
+++ b/connectivity/source/drivers/ado/AStatement.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/sdbc/FetchDirection.hpp>
#include <connectivity/dbexception.hxx>
#include <comphelper/types.hxx>
+#include <rtl/ref.hxx>
#undef max
@@ -305,13 +306,12 @@ Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const OUString&
CHECK_RETURN(aSet.get_CursorType(m_eCursorType))
CHECK_RETURN(aSet.get_LockType(m_eLockType))
- OResultSet* pSet = new OResultSet(aSet,this);
- Reference< XResultSet > xRs = pSet;
+ rtl::Reference<OResultSet> pSet = new OResultSet(aSet,this);
pSet->construct();
- m_xResultSet = WeakReference<XResultSet>(xRs);
+ m_xResultSet = WeakReference<XResultSet>(pSet);
- return xRs;
+ return pSet;
}
diff --git a/connectivity/source/drivers/ado/AViews.cxx b/connectivity/source/drivers/ado/AViews.cxx
index 77cc5abfae0f..cbe239e73825 100644
--- a/connectivity/source/drivers/ado/AViews.cxx
+++ b/connectivity/source/drivers/ado/AViews.cxx
@@ -27,6 +27,7 @@
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
+#include <rtl/ref.hxx>
#include <strings.hrc>
using namespace ::comphelper;
@@ -41,7 +42,7 @@ using namespace com::sun::star::container;
sdbcx::ObjectType OViews::createObject(const OUString& _rName)
{
- OAdoView* pView = new OAdoView(isCaseSensitive(),m_aCollection.GetItem(_rName));
+ rtl::Reference<OAdoView> pView = new OAdoView(isCaseSensitive(),m_aCollection.GetItem(_rName));
pView->setNew(false);
return pView;
}
diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx
index 762352579d94..3d322c3cf95e 100644
--- a/embedserv/source/embed/docholder.cxx
+++ b/embedserv/source/embed/docholder.cxx
@@ -63,6 +63,7 @@
#include <o3tl/any.hxx>
#include <osl/diagnose.h>
#include <rtl/process.h>
+#include <rtl/ref.hxx>
using namespace ::com::sun::star;
@@ -78,7 +79,6 @@ DocumentHolder::DocumentHolder(
m_pIOleIPUIWindow(nullptr),
m_pCHatchWin(nullptr),
m_xOleAccess( xOleAccess ),
- m_pInterceptor(nullptr),
m_xFactory( xFactory ),
m_bOnDeactivate(false),
m_hWndxWinParent(nullptr),
@@ -798,14 +798,14 @@ void DocumentHolder::ClearInterceptorInternally()
m_pInterceptor->DisconnectDocHolder();
m_xInterceptorLocker.clear();
- m_pInterceptor = nullptr;
+ m_pInterceptor.clear();
}
void DocumentHolder::ClearInterceptor()
{
::osl::MutexGuard aGuard( m_aMutex );
m_xInterceptorLocker.clear();
- m_pInterceptor = nullptr;
+ m_pInterceptor.clear();
}
@@ -967,7 +967,7 @@ void DocumentHolder::setTitle(const OUString& aDocumentName)
{
::osl::ClearableMutexGuard aGuard( m_aMutex );
- Interceptor* pTmpInter = nullptr;
+ rtl::Reference<Interceptor> pTmpInter;
uno::Reference< frame::XDispatchProviderInterceptor > xLock( m_xInterceptorLocker );
if ( xLock.is() && m_pInterceptor )
pTmpInter = m_pInterceptor;
diff --git a/embedserv/source/embed/ed_ipersiststr.cxx b/embedserv/source/embed/ed_ipersiststr.cxx
index 1ccb2bc28a05..df5f412593a4 100644
--- a/embedserv/source/embed/ed_ipersiststr.cxx
+++ b/embedserv/source/embed/ed_ipersiststr.cxx
@@ -175,7 +175,6 @@ EmbedDocument_Impl::EmbedDocument_Impl( const uno::Reference< lang::XMultiServic
{
m_xOwnAccess = new EmbeddedDocumentInstanceAccess_Impl( this );
m_pDocHolder = new DocumentHolder( xFactory, m_xOwnAccess );
- m_pDocHolder->acquire();
}
EmbedDocument_Impl::~EmbedDocument_Impl()
@@ -192,8 +191,6 @@ EmbedDocument_Impl::~EmbedDocument_Impl()
m_pDocHolder->CloseDocument();
m_pDocHolder->CloseFrame();
}
-
- m_pDocHolder->release();
}
uno::Sequence< beans::PropertyValue > EmbedDocument_Impl::fillArgsForLoading_Impl( uno::Reference< io::XInputStream > const & xStream, DWORD /*nStreamMode*/, LPCOLESTR pFilePath )
diff --git a/embedserv/source/inc/docholder.hxx b/embedserv/source/inc/docholder.hxx
index 7cb85af0fbf6..0c0816cc625f 100644
--- a/embedserv/source/inc/docholder.hxx
+++ b/embedserv/source/inc/docholder.hxx
@@ -62,7 +62,7 @@ private:
::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl > m_xOleAccess;
css::uno::WeakReference< css::frame::XDispatchProviderInterceptor > m_xInterceptorLocker;
- Interceptor* m_pInterceptor;
+ rtl::Reference<Interceptor> m_pInterceptor;
css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
diff --git a/embedserv/source/inc/embeddoc.hxx b/embedserv/source/inc/embeddoc.hxx
index eb9df82fd441..34d2bba1bfd0 100644
--- a/embedserv/source/inc/embeddoc.hxx
+++ b/embedserv/source/inc/embeddoc.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
+#include <rtl/ref.hxx>
#include <unordered_map>
#include "embeddocaccess.hxx"
@@ -152,7 +153,7 @@ protected:
css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
- DocumentHolder* m_pDocHolder;
+ rtl::Reference<DocumentHolder> m_pDocHolder;
OUString m_aFileName;
CComPtr< IStorage > m_pMasterStorage;
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx
index ad411479401b..5b47ecc18d31 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -143,8 +143,7 @@ private:
public:
static rtl::Reference< TerminationVetoer > get()
{
- static TerminationVetoer* pInstance = new TerminationVetoer;
- static rtl::Reference< TerminationVetoer > aInstance( pInstance );
+ static rtl::Reference< TerminationVetoer > aInstance( new TerminationVetoer );
return aInstance;
}
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index c21158695d70..ff6bc2f319e4 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -44,6 +44,7 @@
#include <comphelper/windowserrorstring.hxx>
#include <sal/log.hxx>
#include <rtl/locale.h>
+#include <rtl/ref.hxx>
#include <osl/nlsupport.h>
#include <osl/process.h>
#include <o3tl/char16_t2wchar_t.hxx>
@@ -57,7 +58,7 @@ using ::com::sun::star::lang::XSingleServiceFactory ;
using ::com::sun::star::xml::crypto::XSecurityEnvironment ;
using ::com::sun::star::security::XCertificate ;
-static X509Certificate_MSCryptImpl* MswcryCertContextToXCert( PCCERT_CONTEXT cert ) ;
+static rtl::Reference<X509Certificate_MSCryptImpl> MswcryCertContextToXCert( PCCERT_CONTEXT cert ) ;
namespace {
@@ -299,8 +300,8 @@ static BOOL WINAPI cert_enum_system_store_callback(const void *pvSystemStore,
uno::Sequence< uno::Reference < XCertificate > > SecurityEnvironment_MSCryptImpl::getPersonalCertificates()
{
sal_Int32 length ;
- X509Certificate_MSCryptImpl* xcert ;
- std::vector< X509Certificate_MSCryptImpl* > certsList ;
+ rtl::Reference<X509Certificate_MSCryptImpl> xcert ;
+ std::vector< rtl::Reference<X509Certificate_MSCryptImpl> > certsList ;
PCCERT_CONTEXT pCertContext = nullptr;
//firstly, we try to find private keys in given key store.
@@ -309,7 +310,7 @@ uno::Sequence< uno::Reference < XCertificate > > SecurityEnvironment_MSCryptImpl
while (pCertContext)
{
xcert = MswcryCertContextToXCert( pCertContext ) ;
- if( xcert != nullptr )
+ if( xcert.is() )
certsList.push_back( xcert ) ;
pCertContext = CertEnumCertificatesInStore( m_hKeyStore, pCertContext );
}
@@ -347,7 +348,7 @@ uno::Sequence< uno::Reference < XCertificate > > SecurityEnvironment_MSCryptImpl
// then TODO : Check the personal cert is valid or not.
xcert = MswcryCertContextToXCert( pCertContext ) ;
- if( xcert != nullptr )
+ if( xcert.is() )
certsList.push_back( xcert ) ;
pCertContext = CertEnumCertificatesInStore( hSystemKeyStore, pCertContext );
}
@@ -375,7 +376,7 @@ uno::Sequence< uno::Reference < XCertificate > > SecurityEnvironment_MSCryptImpl
uno::Reference< XCertificate > SecurityEnvironment_MSCryptImpl::getCertificate( const OUString& issuerName, const uno::Sequence< sal_Int8 >& serialNumber ) {
unsigned int i ;
- X509Certificate_MSCryptImpl *xcert = nullptr ;
+ rtl::Reference<X509Certificate_MSCryptImpl> xcert ;
PCCERT_CONTEXT pCertContext = nullptr ;
HCERTSTORE hCertStore = nullptr ;
CRYPT_INTEGER_BLOB cryptSerialNumber ;
@@ -561,8 +562,6 @@ uno::Reference< XCertificate > SecurityEnvironment_MSCryptImpl::getCertificate(
if( pCertContext != nullptr ) {
xcert = MswcryCertContextToXCert(pCertContext);
CertFreeCertificateContext(pCertContext);
- } else {
- xcert = nullptr ;
}
return xcert ;
@@ -660,7 +659,7 @@ uno::Sequence< uno::Reference < XCertificate > > SecurityEnvironment_MSCryptImpl
{
PCCERT_CONTEXT pCertInChain ;
PCERT_SIMPLE_CHAIN pCertChain ;
- X509Certificate_MSCryptImpl* pCert ;
+ rtl::Reference<X509Certificate_MSCryptImpl> pCert ;
pCertChain = pChainContext->rgpChain[0] ;
if( pCertChain->cElement ) {
@@ -674,7 +673,7 @@ uno::Sequence< uno::Reference < XCertificate > > SecurityEnvironment_MSCryptImpl
if( pCertInChain != nullptr ) {
pCert = MswcryCertContextToXCert( pCertInChain ) ;
- if( pCert != nullptr )
+ if( pCert.is() )
xCertChain[i] = pCert ;
}
}
@@ -692,13 +691,11 @@ uno::Sequence< uno::Reference < XCertificate > > SecurityEnvironment_MSCryptImpl
}
uno::Reference< XCertificate > SecurityEnvironment_MSCryptImpl::createCertificateFromRaw( const uno::Sequence< sal_Int8 >& rawCertificate ) {
- X509Certificate_MSCryptImpl* xcert ;
+ rtl::Reference<X509Certificate_MSCryptImpl> xcert ;
if( rawCertificate.getLength() > 0 ) {
xcert = new X509Certificate_MSCryptImpl() ;
xcert->setRawCert( rawCertificate ) ;
- } else {
- xcert = nullptr ;
}
return xcert ;
@@ -970,15 +967,13 @@ bool SecurityEnvironment_MSCryptImpl::defaultEnabled() {
return m_bEnableDefault ;
}
-static X509Certificate_MSCryptImpl* MswcryCertContextToXCert( PCCERT_CONTEXT cert )
+static rtl::Reference<X509Certificate_MSCryptImpl> MswcryCertContextToXCert( PCCERT_CONTEXT cert )
{
- X509Certificate_MSCryptImpl* xcert ;
+ rtl::Reference<X509Certificate_MSCryptImpl> xcert ;
if( cert != nullptr ) {
xcert = new X509Certificate_MSCryptImpl() ;
xcert->setMswcryCert( cert ) ;
- } else {
- xcert = nullptr ;
}
return xcert ;
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index d9d45f5e7062..ce65672987c5 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -32,6 +32,7 @@
#include "oid.hxx"
#include <rtl/locale.h>
+#include <rtl/ref.hxx>
#include <osl/nlsupport.h>
#include <osl/process.h>
#include <o3tl/char16_t2wchar_t.hxx>
@@ -359,7 +360,7 @@ css::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_MSCryptImpl::getSubjectU
css::uno::Sequence< css::uno::Reference< css::security::XCertificateExtension > > SAL_CALL X509Certificate_MSCryptImpl::getExtensions() {
if( m_pCertContext != nullptr && m_pCertContext->pCertInfo != nullptr && m_pCertContext->pCertInfo->cExtension != 0 ) {
- CertificateExtension_XmlSecImpl* xExtn ;
+ rtl::Reference<CertificateExtension_XmlSecImpl> xExtn ;
Sequence< Reference< XCertificateExtension > > xExtns( m_pCertContext->pCertInfo->cExtension ) ;
for( unsigned int i = 0; i < m_pCertContext->pCertInfo->cExtension; i++ ) {
@@ -386,9 +387,8 @@ css::uno::Sequence< css::uno::Reference< css::security::XCertificateExtension >
css::uno::Reference< css::security::XCertificateExtension > SAL_CALL X509Certificate_MSCryptImpl::findCertificateExtension( const css::uno::Sequence< sal_Int8 >& /*oid*/ ) {
if( m_pCertContext != nullptr && m_pCertContext->pCertInfo != nullptr && m_pCertContext->pCertInfo->cExtension != 0 ) {
- CertificateExtension_XmlSecImpl* xExtn ;
+ rtl::Reference<CertificateExtension_XmlSecImpl> xExtn ;
- xExtn = nullptr ;
for( unsigned int i = 0; i < m_pCertContext->pCertInfo->cExtension; i++ ) {
CERT_EXTENSION* pExtn = &( m_pCertContext->pCertInfo->rgExtension[i] ) ;