diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-03-22 10:05:39 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-03-22 09:01:58 +0100 |
commit | 561cb62a5ac81053e89ec9bf1eed739801570c2d (patch) | |
tree | 15dd209a037283ff066dad01119f6c03bef563b8 /connectivity/source/drivers | |
parent | 6c16dc217ef5cbe25166df7a3728ade12a148880 (diff) |
Simplify CoCreateInstance / CoGetClassObject with COMReference
Change-Id: Ieb1035410c3c6c4b40ea779e829a940460d19b5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131922
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r-- | connectivity/source/drivers/ado/AColumn.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/AConnection.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/AGroup.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/Awrapado.cxx | 6 |
5 files changed, 10 insertions, 10 deletions
diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx index e136e39f4e2b..a521586b9551 100644 --- a/connectivity/source/drivers/ado/AColumn.cxx +++ b/connectivity/source/drivers/ado/AColumn.cxx @@ -40,7 +40,7 @@ using namespace com::sun::star::sdbc; void WpADOColumn::Create() { - pInterface.TryCoCreateInstance(ADOS::CLSID_ADOCOLUMN_25, nullptr, CLSCTX_INPROC_SERVER); + pInterface.CoCreateInstance(ADOS::CLSID_ADOCOLUMN_25, nullptr, CLSCTX_INPROC_SERVER); } OAdoColumn::OAdoColumn(bool _bCase,OConnection* _pConnection,_ADOColumn* _pColumn) diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index 5b44d9e6f4fb..c393d6a4dc3e 100644 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -59,7 +59,7 @@ OConnection::OConnection(ODriver* _pDriver) osl_atomic_increment( &m_refCount ); sal::systools::COMReference<IClassFactory2> pIUnknown; - if (!FAILED(pIUnknown.TryCoGetClassObject(ADOS::CLSID_ADOCONNECTION_21, CLSCTX_INPROC_SERVER))) + if (!FAILED(pIUnknown.CoGetClassObject(ADOS::CLSID_ADOCONNECTION_21, CLSCTX_INPROC_SERVER))) { HRESULT hr = pIUnknown->CreateInstanceLic(nullptr, nullptr, diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx index 42cf95a827ae..037fdb6fe41d 100644 --- a/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx +++ b/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx @@ -385,7 +385,7 @@ RightsEnum OAdoGroup::Map2Right(sal_Int32 _eNum) void WpADOIndex::Create() { - pInterface.TryCoCreateInstance(ADOS::CLSID_ADOINDEX_25, nullptr, CLSCTX_INPROC_SERVER); + pInterface.CoCreateInstance(ADOS::CLSID_ADOINDEX_25, nullptr, CLSCTX_INPROC_SERVER); } void OAdoIndex::fillPropertyValues() @@ -401,7 +401,7 @@ void OAdoIndex::fillPropertyValues() void WpADOKey::Create() { - pInterface.TryCoCreateInstance(ADOS::CLSID_ADOKEY_25, nullptr, CLSCTX_INPROC_SERVER); + pInterface.CoCreateInstance(ADOS::CLSID_ADOKEY_25, nullptr, CLSCTX_INPROC_SERVER); } void OAdoKey::fillPropertyValues() @@ -498,7 +498,7 @@ KeyTypeEnum OAdoKey::Map2KeyRule(sal_Int32 _eNum) void WpADOTable::Create() { - pInterface.TryCoCreateInstance(ADOS::CLSID_ADOTABLE_25, nullptr, CLSCTX_INPROC_SERVER); + pInterface.CoCreateInstance(ADOS::CLSID_ADOTABLE_25, nullptr, CLSCTX_INPROC_SERVER); } OUString WpADOCatalog::GetObjectOwner(std::u16string_view _rName, ObjectTypeEnum _eNum) @@ -533,7 +533,7 @@ void OAdoTable::fillPropertyValues() void WpADOUser::Create() { - pInterface.TryCoCreateInstance(ADOS::CLSID_ADOUSER_25, nullptr, CLSCTX_INPROC_SERVER); + pInterface.CoCreateInstance(ADOS::CLSID_ADOUSER_25, nullptr, CLSCTX_INPROC_SERVER); } diff --git a/connectivity/source/drivers/ado/AGroup.cxx b/connectivity/source/drivers/ado/AGroup.cxx index 932cfc232de3..a347fb96de70 100644 --- a/connectivity/source/drivers/ado/AGroup.cxx +++ b/connectivity/source/drivers/ado/AGroup.cxx @@ -36,7 +36,7 @@ using namespace com::sun::star::sdbcx; void WpADOGroup::Create() { - pInterface.TryCoCreateInstance(ADOS::CLSID_ADOGROUP_25, nullptr, CLSCTX_INPROC_SERVER); + pInterface.CoCreateInstance(ADOS::CLSID_ADOGROUP_25, nullptr, CLSCTX_INPROC_SERVER); } OAdoGroup::OAdoGroup(OCatalog* _pParent,bool _bCase, ADOGroup* _pGroup) : OGroup_ADO(_bCase),m_pCatalog(_pParent) diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx index 2a9f66656956..44a38090b5d3 100644 --- a/connectivity/source/drivers/ado/Awrapado.cxx +++ b/connectivity/source/drivers/ado/Awrapado.cxx @@ -28,7 +28,7 @@ using namespace connectivity::ado; void WpADOCatalog::Create() { - pInterface.TryCoCreateInstance(ADOS::CLSID_ADOCATALOG_25, nullptr, CLSCTX_INPROC_SERVER); + pInterface.CoCreateInstance(ADOS::CLSID_ADOCATALOG_25, nullptr, CLSCTX_INPROC_SERVER); } @@ -256,7 +256,7 @@ void WpADOCommand::put_ActiveConnection(/* [in] */ const OLEVariant& vConn) void WpADOCommand::Create() { sal::systools::COMReference<IClassFactory2> pInterface2; - if (!FAILED(pInterface2.TryCoGetClassObject(ADOS::CLSID_ADOCOMMAND_21, CLSCTX_INPROC_SERVER))) + if (!FAILED(pInterface2.CoGetClassObject(ADOS::CLSID_ADOCOMMAND_21, CLSCTX_INPROC_SERVER))) { sal::systools::COMReference<ADOCommand> pCommand; @@ -649,7 +649,7 @@ bool WpADOProperty::PutAttributes(sal_Int32 _nDefSize) void WpADORecordset::Create() { sal::systools::COMReference<IClassFactory2> pInterface2; - if (!FAILED(pInterface2.TryCoGetClassObject(ADOS::CLSID_ADORECORDSET_21, CLSCTX_INPROC_SERVER))) + if (!FAILED(pInterface2.CoGetClassObject(ADOS::CLSID_ADORECORDSET_21, CLSCTX_INPROC_SERVER))) { sal::systools::COMReference<ADORecordset> pRec; HRESULT hr = pInterface2->CreateInstanceLic(nullptr, |