summaryrefslogtreecommitdiff
path: root/connectivity/source/sdbcx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/sdbcx')
-rw-r--r--connectivity/source/sdbcx/VCatalog.cxx2
-rw-r--r--connectivity/source/sdbcx/VCollection.cxx29
-rw-r--r--connectivity/source/sdbcx/VColumn.cxx42
-rw-r--r--connectivity/source/sdbcx/VDescriptor.cxx34
-rw-r--r--connectivity/source/sdbcx/VGroup.cxx13
-rw-r--r--connectivity/source/sdbcx/VIndex.cxx18
-rw-r--r--connectivity/source/sdbcx/VIndexColumn.cxx6
-rw-r--r--connectivity/source/sdbcx/VKey.cxx16
-rw-r--r--connectivity/source/sdbcx/VKeyColumn.cxx11
-rw-r--r--connectivity/source/sdbcx/VTable.cxx31
-rw-r--r--connectivity/source/sdbcx/VUser.cxx26
-rw-r--r--connectivity/source/sdbcx/VView.cxx28
12 files changed, 109 insertions, 147 deletions
diff --git a/connectivity/source/sdbcx/VCatalog.cxx b/connectivity/source/sdbcx/VCatalog.cxx
index b30519fcaab1..79f4400d1025 100644
--- a/connectivity/source/sdbcx/VCatalog.cxx
+++ b/connectivity/source/sdbcx/VCatalog.cxx
@@ -35,7 +35,7 @@ using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
-IMPLEMENT_SERVICE_INFO(OCatalog,"com.sun.star.comp.connectivity.OCatalog","com.sun.star.sdbcx.DatabaseDefinition")
+IMPLEMENT_SERVICE_INFO(OCatalog,u"com.sun.star.comp.connectivity.OCatalog"_ustr,u"com.sun.star.sdbcx.DatabaseDefinition"_ustr)
OCatalog::OCatalog(const Reference< XConnection> &_xConnection) : OCatalog_BASE(m_aMutex)
{
diff --git a/connectivity/source/sdbcx/VCollection.cxx b/connectivity/source/sdbcx/VCollection.cxx
index 860ead949074..e6671d4598a1 100644
--- a/connectivity/source/sdbcx/VCollection.cxx
+++ b/connectivity/source/sdbcx/VCollection.cxx
@@ -216,7 +216,7 @@ namespace
IObjectCollection::~IObjectCollection() {}
-IMPLEMENT_SERVICE_INFO(OCollection,"com.sun.star.sdbcx.VContainer" , "com.sun.star.sdbcx.Container")
+IMPLEMENT_SERVICE_INFO(OCollection,u"com.sun.star.sdbcx.VContainer"_ustr , u"com.sun.star.sdbcx.Container"_ustr)
OCollection::OCollection(::cppu::OWeakObject& _rParent
, bool _bCase
@@ -302,7 +302,7 @@ Any SAL_CALL OCollection::getByIndex( sal_Int32 Index )
if (Index < 0 || Index >= m_pElements->size() )
throw IndexOutOfBoundsException(OUString::number(Index),static_cast<XTypeProvider*>(this));
- return makeAny(getObject(Index));
+ return Any(getObject(Index));
}
Any SAL_CALL OCollection::getByName( const OUString& aName )
@@ -319,7 +319,7 @@ Any SAL_CALL OCollection::getByName( const OUString& aName )
throw NoSuchElementException( sError, static_cast< XTypeProvider* >( this ) );
}
- return makeAny(getObject(m_pElements->findColumn(aName)));
+ return Any(getObject(m_pElements->findColumn(aName)));
}
Sequence< OUString > SAL_CALL OCollection::getElementNames( )
@@ -374,7 +374,7 @@ void SAL_CALL OCollection::appendByDescriptor( const Reference< XPropertySet >&
if ( !xNewlyCreated.is() )
throw RuntimeException();
- ODescriptor* pDescriptor = comphelper::getUnoTunnelImplementation<ODescriptor>( xNewlyCreated );
+ ODescriptor* pDescriptor = dynamic_cast<ODescriptor*>( xNewlyCreated.get() );
if ( pDescriptor )
pDescriptor->setNew( false );
@@ -383,7 +383,7 @@ void SAL_CALL OCollection::appendByDescriptor( const Reference< XPropertySet >&
m_pElements->insert( sName, xNewlyCreated );
// notify our container listeners
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(sName), makeAny(xNewlyCreated), Any());
+ ContainerEvent aEvent(static_cast<XContainer*>(this), Any(sName), Any(xNewlyCreated), Any());
aGuard.clear();
m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvent );
}
@@ -423,20 +423,17 @@ void OCollection::dropImpl(sal_Int32 _nIndex, bool _bReallyDrop)
void OCollection::notifyElementRemoved(const OUString& _sName)
{
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_sName), Any(), Any());
+ ContainerEvent aEvent(static_cast<XContainer*>(this), Any(_sName), Any(), Any());
// note that xExistent may be empty, in case somebody removed the data source while it is not alive at this moment
- OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
+ OInterfaceIteratorHelper3 aListenerLoop(m_aContainerListeners);
while (aListenerLoop.hasMoreElements())
- static_cast<XContainerListener*>(aListenerLoop.next())->elementRemoved(aEvent);
+ aListenerLoop.next()->elementRemoved(aEvent);
}
sal_Int32 SAL_CALL OCollection::findColumn( const OUString& columnName )
{
if ( !m_pElements->exists(columnName) )
- {
::dbtools::throwInvalidColumnException( columnName, static_cast< XIndexAccess*>(this) );
- O3TL_UNREACHABLE;
- }
return m_pElements->findColumn(columnName) + 1; // because columns start at one
}
@@ -458,12 +455,12 @@ void SAL_CALL OCollection::removeContainerListener( const Reference< XContainerL
m_aContainerListeners.removeInterface(_rxListener);
}
-void SAL_CALL OCollection::acquire() throw()
+void SAL_CALL OCollection::acquire() noexcept
{
m_rParent.acquire();
}
-void SAL_CALL OCollection::release() throw()
+void SAL_CALL OCollection::release() noexcept
{
m_rParent.release();
}
@@ -517,11 +514,11 @@ void OCollection::renameObject(const OUString& _sOldName, const OUString& _sNewN
if ( m_pElements->rename(_sOldName,_sNewName) )
{
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_sNewName), makeAny(m_pElements->getObject(_sNewName)),makeAny(_sOldName));
+ ContainerEvent aEvent(static_cast<XContainer*>(this), Any(_sNewName), Any(m_pElements->getObject(_sNewName)),Any(_sOldName));
// note that xExistent may be empty, in case somebody removed the data source while it is not alive at this moment
- OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
+ OInterfaceIteratorHelper3 aListenerLoop(m_aContainerListeners);
while (aListenerLoop.hasMoreElements())
- static_cast<XContainerListener*>(aListenerLoop.next())->elementReplaced(aEvent);
+ aListenerLoop.next()->elementReplaced(aEvent);
}
}
diff --git a/connectivity/source/sdbcx/VColumn.cxx b/connectivity/source/sdbcx/VColumn.cxx
index 23993453101a..bae1f7140c8a 100644
--- a/connectivity/source/sdbcx/VColumn.cxx
+++ b/connectivity/source/sdbcx/VColumn.cxx
@@ -23,6 +23,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <TConnection.hxx>
#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <utility>
using namespace connectivity;
using namespace connectivity::sdbcx;
@@ -36,13 +37,13 @@ using namespace ::com::sun::star::sdbc;
OUString SAL_CALL OColumn::getImplementationName( )
{
if(isNew())
- return "com.sun.star.sdbcx.VColumnDescriptor";
- return "com.sun.star.sdbcx.VColumn";
+ return u"com.sun.star.sdbcx.VColumnDescriptor"_ustr;
+ return u"com.sun.star.sdbcx.VColumn"_ustr;
}
css::uno::Sequence< OUString > SAL_CALL OColumn::getSupportedServiceNames( )
{
- return { isNew()?OUString("com.sun.star.sdbcx.ColumnDescriptor"):OUString("com.sun.star.sdbcx.Column") };
+ return { isNew()?u"com.sun.star.sdbcx.ColumnDescriptor"_ustr:u"com.sun.star.sdbcx.Column"_ustr };
}
sal_Bool SAL_CALL OColumn::supportsService( const OUString& _rServiceName )
@@ -65,9 +66,9 @@ OColumn::OColumn(bool _bCase)
}
OColumn::OColumn( const OUString& Name,
- const OUString& TypeName,
- const OUString& DefaultValue,
- const OUString& Description,
+ OUString TypeName,
+ OUString DefaultValue,
+ OUString Description,
sal_Int32 IsNullable,
sal_Int32 Precision,
sal_Int32 Scale,
@@ -76,14 +77,14 @@ OColumn::OColumn( const OUString& Name,
bool IsRowVersion,
bool IsCurrency,
bool _bCase,
- const OUString& CatalogName,
- const OUString& SchemaName,
- const OUString& TableName)
+ OUString CatalogName,
+ OUString SchemaName,
+ OUString TableName)
:OColumnDescriptor_BASE(m_aMutex)
,ODescriptor(OColumnDescriptor_BASE::rBHelper,_bCase)
- ,m_TypeName(TypeName)
- ,m_Description(Description)
- ,m_DefaultValue(DefaultValue)
+ ,m_TypeName(std::move(TypeName))
+ ,m_Description(std::move(Description))
+ ,m_DefaultValue(std::move(DefaultValue))
,m_IsNullable(IsNullable)
,m_Precision(Precision)
,m_Scale(Scale)
@@ -91,9 +92,9 @@ OColumn::OColumn( const OUString& Name,
,m_IsAutoIncrement(IsAutoIncrement)
,m_IsRowVersion(IsRowVersion)
,m_IsCurrency(IsCurrency)
- ,m_CatalogName(CatalogName)
- ,m_SchemaName(SchemaName)
- ,m_TableName(TableName)
+ ,m_CatalogName(std::move(CatalogName))
+ ,m_SchemaName(std::move(SchemaName))
+ ,m_TableName(std::move(TableName))
{
m_Name = Name;
@@ -114,12 +115,12 @@ OColumn::~OColumn()
return *OColumn_PROP::getArrayHelper(isNew() ? 1 : 0);
}
-void SAL_CALL OColumn::acquire() throw()
+void SAL_CALL OColumn::acquire() noexcept
{
OColumnDescriptor_BASE::acquire();
}
-void SAL_CALL OColumn::release() throw()
+void SAL_CALL OColumn::release() noexcept
{
OColumnDescriptor_BASE::release();
}
@@ -169,10 +170,6 @@ void OColumn::construct()
void OColumn::disposing()
{
OPropertySetHelper::disposing();
-
- ::osl::MutexGuard aGuard(m_aMutex);
- checkDisposed(OColumnDescriptor_BASE::rBHelper.bDisposed);
-
}
Reference< XPropertySet > SAL_CALL OColumn::createDataDescriptor( )
@@ -180,8 +177,7 @@ Reference< XPropertySet > SAL_CALL OColumn::createDataDescriptor( )
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OColumnDescriptor_BASE::rBHelper.bDisposed);
-
- OColumn* pNewColumn = new OColumn( m_Name,
+ rtl::Reference<OColumn> pNewColumn = new OColumn( m_Name,
m_TypeName,
m_DefaultValue,
m_Description,
diff --git a/connectivity/source/sdbcx/VDescriptor.cxx b/connectivity/source/sdbcx/VDescriptor.cxx
index 8a32a1b58b39..d6ceabc96837 100644
--- a/connectivity/source/sdbcx/VDescriptor.cxx
+++ b/connectivity/source/sdbcx/VDescriptor.cxx
@@ -28,7 +28,6 @@
namespace connectivity::sdbcx
{
using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
@@ -44,14 +43,6 @@ namespace connectivity::sdbcx
// css::lang::XUnoTunnel
- sal_Int64 SAL_CALL ODescriptor::getSomething( const Sequence< sal_Int8 >& rId )
- {
- return (isUnoTunnelId<ODescriptor>(rId))
- ? reinterpret_cast< sal_Int64 >( this )
- : 0;
- }
-
-
namespace
{
struct ResetROAttribute
@@ -76,10 +67,11 @@ namespace connectivity::sdbcx
Sequence< Property > aProperties;
describeProperties( aProperties );
+ auto [begin, end] = asNonConstRange(aProperties);
if ( isNew() )
- std::for_each( aProperties.begin(), aProperties.end(), ResetROAttribute() );
+ std::for_each( begin, end, ResetROAttribute() );
else
- std::for_each( aProperties.begin(), aProperties.end(), SetROAttribute() );
+ std::for_each( begin, end, SetROAttribute() );
return new ::cppu::OPropertyArrayHelper( aProperties );
}
@@ -87,26 +79,11 @@ namespace connectivity::sdbcx
bool ODescriptor::isNew( const Reference< XInterface >& _rxDescriptor )
{
- ODescriptor* pImplementation = comphelper::getUnoTunnelImplementation<ODescriptor>( _rxDescriptor );
+ ODescriptor* pImplementation = dynamic_cast<ODescriptor*>( _rxDescriptor.get() );
return pImplementation && pImplementation->isNew();
}
- Sequence< sal_Int8 > ODescriptor::getUnoTunnelId()
- {
- static ::cppu::OImplementationId implId;
-
- return implId.getImplementationId();
- }
-
-
- Any SAL_CALL ODescriptor::queryInterface( const Type & rType )
- {
- Any aRet = ::cppu::queryInterface(rType,static_cast< XUnoTunnel*> (this));
- return aRet.hasValue() ? aRet : ODescriptor_PBASE::queryInterface(rType);
- }
-
-
void ODescriptor::setNew(bool _bNew)
{
m_bNew = _bNew;
@@ -117,8 +94,7 @@ namespace connectivity::sdbcx
{
::cppu::OTypeCollection aTypes( cppu::UnoType<XMultiPropertySet>::get(),
cppu::UnoType<XFastPropertySet>::get(),
- cppu::UnoType<XPropertySet>::get(),
- cppu::UnoType<XUnoTunnel>::get());
+ cppu::UnoType<XPropertySet>::get());
return aTypes.getTypes();
}
diff --git a/connectivity/source/sdbcx/VGroup.cxx b/connectivity/source/sdbcx/VGroup.cxx
index ed11a617526f..c2a789a90574 100644
--- a/connectivity/source/sdbcx/VGroup.cxx
+++ b/connectivity/source/sdbcx/VGroup.cxx
@@ -26,13 +26,12 @@
using namespace ::connectivity::sdbcx;
using namespace ::connectivity;
using namespace ::dbtools;
-using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
-IMPLEMENT_SERVICE_INFO(OGroup,"com.sun.star.sdbcx.VGroup","com.sun.star.sdbcx.Group");
+IMPLEMENT_SERVICE_INFO(OGroup,u"com.sun.star.sdbcx.VGroup"_ustr,u"com.sun.star.sdbcx.Group"_ustr);
OGroup::OGroup(bool _bCase) : OGroup_BASE(m_aMutex)
, ODescriptor(OGroup_BASE::rBHelper,_bCase)
@@ -126,14 +125,14 @@ void SAL_CALL OGroup::grantPrivileges( const OUString& /*objName*/, sal_Int32 /*
{
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OGroup_BASE::rBHelper.bDisposed);
- throwFeatureNotImplementedSQLException( "XAuthorizable::grantPrivileges", *this );
+ throwFeatureNotImplementedSQLException( u"XAuthorizable::grantPrivileges"_ustr, *this );
}
void SAL_CALL OGroup::revokePrivileges( const OUString& /*objName*/, sal_Int32 /*objType*/, sal_Int32 /*objPrivileges*/ )
{
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OGroup_BASE::rBHelper.bDisposed);
- throwFeatureNotImplementedSQLException( "XAuthorizable::revokePrivileges", *this );
+ throwFeatureNotImplementedSQLException( u"XAuthorizable::revokePrivileges"_ustr, *this );
}
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL OGroup::getPropertySetInfo( )
@@ -148,16 +147,16 @@ OUString SAL_CALL OGroup::getName( )
void SAL_CALL OGroup::setName( const OUString& /*aName*/ )
{
- throwFeatureNotImplementedRuntimeException( "XNamed::setName", *this );
+ throwFeatureNotImplementedRuntimeException( u"XNamed::setName"_ustr, *this );
}
// XInterface
-void SAL_CALL OGroup::acquire() throw()
+void SAL_CALL OGroup::acquire() noexcept
{
OGroup_BASE::acquire();
}
-void SAL_CALL OGroup::release() throw()
+void SAL_CALL OGroup::release() noexcept
{
OGroup_BASE::release();
}
diff --git a/connectivity/source/sdbcx/VIndex.cxx b/connectivity/source/sdbcx/VIndex.cxx
index 1649ff83ad97..b69c1414d9f7 100644
--- a/connectivity/source/sdbcx/VIndex.cxx
+++ b/connectivity/source/sdbcx/VIndex.cxx
@@ -24,7 +24,8 @@
#include <connectivity/sdbcx/VCollection.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <TConnection.hxx>
-#include <tools/diagnose_ex.h>
+#include <utility>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::connectivity;
using namespace ::dbtools;
@@ -32,7 +33,6 @@ using namespace ::connectivity::sdbcx;
using namespace ::cppu;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
@@ -41,13 +41,13 @@ using namespace ::com::sun::star::lang;
OUString SAL_CALL OIndex::getImplementationName( )
{
if(isNew())
- return "com.sun.star.sdbcx.VIndexDescriptor";
- return "com.sun.star.sdbcx.VIndex";
+ return u"com.sun.star.sdbcx.VIndexDescriptor"_ustr;
+ return u"com.sun.star.sdbcx.VIndex"_ustr;
}
css::uno::Sequence< OUString > SAL_CALL OIndex::getSupportedServiceNames( )
{
- return { isNew()?OUString("com.sun.star.sdbcx.IndexDescriptor"):OUString("com.sun.star.sdbcx.Index") };
+ return { isNew()?u"com.sun.star.sdbcx.IndexDescriptor"_ustr:u"com.sun.star.sdbcx.Index"_ustr };
}
sal_Bool SAL_CALL OIndex::supportsService( const OUString& _rServiceName )
@@ -64,13 +64,13 @@ OIndex::OIndex(bool _bCase) : ODescriptor_BASE(m_aMutex)
}
OIndex::OIndex( const OUString& Name,
- const OUString& Catalog,
+ OUString Catalog,
bool _isUnique,
bool _isPrimaryKeyIndex,
bool _isClustered,
bool _bCase) : ODescriptor_BASE(m_aMutex)
,ODescriptor(ODescriptor_BASE::rBHelper, _bCase)
- ,m_Catalog(Catalog)
+ ,m_Catalog(std::move(Catalog))
,m_IsUnique(_isUnique)
,m_IsPrimaryKeyIndex(_isPrimaryKeyIndex)
,m_IsClustered(_isClustered)
@@ -181,12 +181,12 @@ void SAL_CALL OIndex::setName( const OUString& /*aName*/ )
}
// XInterface
-void SAL_CALL OIndex::acquire() throw()
+void SAL_CALL OIndex::acquire() noexcept
{
ODescriptor_BASE::acquire();
}
-void SAL_CALL OIndex::release() throw()
+void SAL_CALL OIndex::release() noexcept
{
ODescriptor_BASE::release();
}
diff --git a/connectivity/source/sdbcx/VIndexColumn.cxx b/connectivity/source/sdbcx/VIndexColumn.cxx
index edd1ea93e9a2..4f55fc864167 100644
--- a/connectivity/source/sdbcx/VIndexColumn.cxx
+++ b/connectivity/source/sdbcx/VIndexColumn.cxx
@@ -30,13 +30,13 @@ using namespace ::com::sun::star::uno;
OUString SAL_CALL OIndexColumn::getImplementationName( )
{
if(isNew())
- return "com.sun.star.sdbcx.VIndexColumnDescriptor";
- return "com.sun.star.sdbcx.VIndexColumn";
+ return u"com.sun.star.sdbcx.VIndexColumnDescriptor"_ustr;
+ return u"com.sun.star.sdbcx.VIndexColumn"_ustr;
}
css::uno::Sequence< OUString > SAL_CALL OIndexColumn::getSupportedServiceNames( )
{
- return { isNew()?OUString("com.sun.star.sdbcx.IndexColumnDescriptor"):OUString("com.sun.star.sdbcx.IndexColumn") };
+ return { isNew()?u"com.sun.star.sdbcx.IndexColumnDescriptor"_ustr:u"com.sun.star.sdbcx.IndexColumn"_ustr };
}
sal_Bool SAL_CALL OIndexColumn::supportsService( const OUString& _rServiceName )
diff --git a/connectivity/source/sdbcx/VKey.cxx b/connectivity/source/sdbcx/VKey.cxx
index 33e9340b51c7..0780d13fc944 100644
--- a/connectivity/source/sdbcx/VKey.cxx
+++ b/connectivity/source/sdbcx/VKey.cxx
@@ -24,12 +24,12 @@
#include <cppuhelper/supportsservice.hxx>
#include <connectivity/sdbcx/VCollection.hxx>
#include <TConnection.hxx>
+#include <utility>
using namespace connectivity;
using namespace connectivity::sdbcx;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
@@ -38,13 +38,13 @@ using namespace ::com::sun::star::lang;
OUString SAL_CALL OKey::getImplementationName( )
{
if(isNew())
- return "com.sun.star.sdbcx.VKeyDescriptor";
- return "com.sun.star.sdbcx.VKey";
+ return u"com.sun.star.sdbcx.VKeyDescriptor"_ustr;
+ return u"com.sun.star.sdbcx.VKey"_ustr;
}
css::uno::Sequence< OUString > SAL_CALL OKey::getSupportedServiceNames( )
{
- return { isNew()?OUString("com.sun.star.sdbcx.KeyDescriptor"):OUString("com.sun.star.sdbcx.Key") };
+ return { isNew()?u"com.sun.star.sdbcx.KeyDescriptor"_ustr:u"com.sun.star.sdbcx.Key"_ustr };
}
sal_Bool SAL_CALL OKey::supportsService( const OUString& _rServiceName )
@@ -58,10 +58,10 @@ OKey::OKey(bool _bCase) : ODescriptor_BASE(m_aMutex)
{
}
-OKey::OKey(const OUString& Name,const std::shared_ptr<KeyProperties>& _rProps, bool _bCase)
+OKey::OKey(const OUString& Name,std::shared_ptr<KeyProperties> _xProps, bool _bCase)
: ODescriptor_BASE(m_aMutex)
,ODescriptor(ODescriptor_BASE::rBHelper, _bCase)
- ,m_aProps(_rProps)
+ ,m_aProps(std::move(_xProps))
{
m_Name = Name;
}
@@ -188,12 +188,12 @@ void SAL_CALL OKey::setName( const OUString& /*aName*/ )
}
// XInterface
-void SAL_CALL OKey::acquire() throw()
+void SAL_CALL OKey::acquire() noexcept
{
ODescriptor_BASE::acquire();
}
-void SAL_CALL OKey::release() throw()
+void SAL_CALL OKey::release() noexcept
{
ODescriptor_BASE::release();
}
diff --git a/connectivity/source/sdbcx/VKeyColumn.cxx b/connectivity/source/sdbcx/VKeyColumn.cxx
index b6f69e65c9de..4bf85159d932 100644
--- a/connectivity/source/sdbcx/VKeyColumn.cxx
+++ b/connectivity/source/sdbcx/VKeyColumn.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <TConnection.hxx>
+#include <utility>
using namespace connectivity;
using namespace connectivity::sdbcx;
@@ -31,13 +32,13 @@ using namespace cppu;
OUString SAL_CALL OKeyColumn::getImplementationName( )
{
if(isNew())
- return "com.sun.star.sdbcx.VKeyColumnDescriptor";
- return "com.sun.star.sdbcx.VKeyColumn";
+ return u"com.sun.star.sdbcx.VKeyColumnDescriptor"_ustr;
+ return u"com.sun.star.sdbcx.VKeyColumn"_ustr;
}
css::uno::Sequence< OUString > SAL_CALL OKeyColumn::getSupportedServiceNames( )
{
- return { isNew()?OUString("com.sun.star.sdbcx.KeyColumnDescriptor"):OUString("com.sun.star.sdbcx.KeyColumn") };
+ return { isNew()?u"com.sun.star.sdbcx.KeyColumnDescriptor"_ustr:u"com.sun.star.sdbcx.KeyColumn"_ustr };
}
sal_Bool SAL_CALL OKeyColumn::supportsService( const OUString& _rServiceName )
@@ -50,7 +51,7 @@ OKeyColumn::OKeyColumn(bool _bCase) : OColumn(_bCase)
construct();
}
-OKeyColumn::OKeyColumn( const OUString& ReferencedColumn,
+OKeyColumn::OKeyColumn( OUString ReferencedColumn,
const OUString& Name,
const OUString& TypeName,
const OUString& DefaultValue,
@@ -77,7 +78,7 @@ OKeyColumn::OKeyColumn( const OUString& ReferencedColumn,
CatalogName,
SchemaName,
TableName)
- , m_ReferencedColumn(ReferencedColumn)
+ , m_ReferencedColumn(std::move(ReferencedColumn))
{
construct();
}
diff --git a/connectivity/source/sdbcx/VTable.cxx b/connectivity/source/sdbcx/VTable.cxx
index 90c7427823c0..afa70c87b745 100644
--- a/connectivity/source/sdbcx/VTable.cxx
+++ b/connectivity/source/sdbcx/VTable.cxx
@@ -25,6 +25,7 @@
#include <connectivity/dbtools.hxx>
#include <connectivity/dbexception.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <utility>
using namespace ::connectivity;
using namespace ::connectivity::sdbcx;
@@ -40,14 +41,14 @@ using namespace ::com::sun::star::lang;
OUString SAL_CALL OTable::getImplementationName( )
{
if(isNew())
- return "com.sun.star.sdbcx.VTableDescriptor";
- return "com.sun.star.sdbcx.Table";
+ return u"com.sun.star.sdbcx.VTableDescriptor"_ustr;
+ return u"com.sun.star.sdbcx.Table"_ustr;
}
css::uno::Sequence< OUString > SAL_CALL OTable::getSupportedServiceNames( )
{
- return { isNew()?OUString("com.sun.star.sdbcx.TableDescriptor"):OUString("com.sun.star.sdbcx.Table") };
+ return { isNew()?u"com.sun.star.sdbcx.TableDescriptor"_ustr:u"com.sun.star.sdbcx.Table"_ustr };
}
sal_Bool SAL_CALL OTable::supportsService( const OUString& _rServiceName )
@@ -65,14 +66,14 @@ OTable::OTable(OCollection* _pTables,
OTable::OTable( OCollection* _pTables,
bool _bCase,
- const OUString& Name, const OUString& Type,
- const OUString& Description,const OUString& SchemaName,
- const OUString& CatalogName) : OTableDescriptor_BASE(m_aMutex)
+ const OUString& Name, OUString Type,
+ OUString Description, OUString SchemaName,
+ OUString CatalogName) : OTableDescriptor_BASE(m_aMutex)
,ODescriptor(OTableDescriptor_BASE::rBHelper,_bCase)
- ,m_CatalogName(CatalogName)
- ,m_SchemaName(SchemaName)
- ,m_Description(Description)
- ,m_Type(Type)
+ ,m_CatalogName(std::move(CatalogName))
+ ,m_SchemaName(std::move(SchemaName))
+ ,m_Description(std::move(Description))
+ ,m_Type(std::move(Type))
,m_pTables(_pTables)
{
m_Name = Name;
@@ -94,12 +95,12 @@ void OTable::construct()
registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE), PROPERTY_ID_TYPE, nAttrib,&m_Type, ::cppu::UnoType<OUString>::get());
}
-void SAL_CALL OTable::acquire() throw()
+void SAL_CALL OTable::acquire() noexcept
{
OTableDescriptor_BASE::acquire();
}
-void SAL_CALL OTable::release() throw()
+void SAL_CALL OTable::release() noexcept
{
OTableDescriptor_BASE::release();
}
@@ -210,7 +211,7 @@ Reference< XPropertySet > SAL_CALL OTable::createDataDescriptor( )
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
- OTable* pTable = new OTable(m_pTables,isCaseSensitive(),m_Name,m_Type,m_Description,m_SchemaName,m_CatalogName);
+ rtl::Reference<OTable> pTable = new OTable(m_pTables,isCaseSensitive(),m_Name,m_Type,m_Description,m_SchemaName,m_CatalogName);
pTable->setNew(true);
return pTable;
}
@@ -263,12 +264,12 @@ Reference< XDatabaseMetaData> OTable::getMetaData() const
// XAlterTable
void SAL_CALL OTable::alterColumnByName( const OUString& /*colName*/, const Reference< XPropertySet >& /*descriptor*/ )
{
- throwFeatureNotImplementedSQLException( "XAlterTable::alterColumnByName", *this );
+ throwFeatureNotImplementedSQLException( u"XAlterTable::alterColumnByName"_ustr, *this );
}
void SAL_CALL OTable::alterColumnByIndex( sal_Int32 /*index*/, const Reference< XPropertySet >& /*descriptor*/ )
{
- throwFeatureNotImplementedSQLException( "XAlterTable::alterColumnByIndex", *this );
+ throwFeatureNotImplementedSQLException( u"XAlterTable::alterColumnByIndex"_ustr, *this );
}
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL OTable::getPropertySetInfo( )
diff --git a/connectivity/source/sdbcx/VUser.cxx b/connectivity/source/sdbcx/VUser.cxx
index 9cecd7dfdd46..0e897260e032 100644
--- a/connectivity/source/sdbcx/VUser.cxx
+++ b/connectivity/source/sdbcx/VUser.cxx
@@ -22,17 +22,17 @@
#include <connectivity/sdbcx/VCollection.hxx>
#include <connectivity/dbexception.hxx>
#include <comphelper/sequence.hxx>
+#include <o3tl/unreachable.hxx>
using namespace connectivity;
using namespace connectivity::sdbcx;
-using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
-IMPLEMENT_SERVICE_INFO(OUser,"com.sun.star.sdbcx.VUser","com.sun.star.sdbcx.User");
+IMPLEMENT_SERVICE_INFO(OUser,u"com.sun.star.sdbcx.VUser"_ustr,u"com.sun.star.sdbcx.User"_ustr);
OUser::OUser(bool _bCase) : OUser_BASE(m_aMutex)
, ODescriptor(OUser_BASE::rBHelper,_bCase,true)
@@ -86,7 +86,7 @@ void SAL_CALL OUser::changePassword( const OUString& /*objPassword*/, const OUSt
{
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OUser_BASE::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedSQLException( "XUser::changePassword", *this );
+ ::dbtools::throwFeatureNotImplementedSQLException( u"XUser::changePassword"_ustr, *this );
}
// XGroupsSupplier
@@ -113,40 +113,32 @@ Reference< XNameAccess > SAL_CALL OUser::getGroups( )
return m_pGroups.get();
}
-
-SAL_WNOUNREACHABLE_CODE_PUSH
-
sal_Int32 SAL_CALL OUser::getPrivileges( const OUString& /*objName*/, sal_Int32 /*objType*/ )
{
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OUser_BASE::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedSQLException( "XAuthorizable::changePassword", *this );
- return 0;
+ ::dbtools::throwFeatureNotImplementedSQLException( u"XAuthorizable::changePassword"_ustr, *this );
}
sal_Int32 SAL_CALL OUser::getGrantablePrivileges( const OUString& /*objName*/, sal_Int32 /*objType*/ )
{
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OUser_BASE::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedSQLException( "XAuthorizable::getGrantablePrivileges", *this );
- return 0;
+ ::dbtools::throwFeatureNotImplementedSQLException( u"XAuthorizable::getGrantablePrivileges"_ustr, *this );
}
-SAL_WNOUNREACHABLE_CODE_POP
-
-
void SAL_CALL OUser::grantPrivileges( const OUString& /*objName*/, sal_Int32 /*objType*/, sal_Int32 /*objPrivileges*/ )
{
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OUser_BASE::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedSQLException( "XAuthorizable::grantPrivileges", *this );
+ ::dbtools::throwFeatureNotImplementedSQLException( u"XAuthorizable::grantPrivileges"_ustr, *this );
}
void SAL_CALL OUser::revokePrivileges( const OUString& /*objName*/, sal_Int32 /*objType*/, sal_Int32 /*objPrivileges*/ )
{
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OUser_BASE::rBHelper.bDisposed);
- ::dbtools::throwFeatureNotImplementedSQLException( "XAuthorizable::revokePrivileges", *this );
+ ::dbtools::throwFeatureNotImplementedSQLException( u"XAuthorizable::revokePrivileges"_ustr, *this );
}
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL OUser::getPropertySetInfo( )
@@ -166,12 +158,12 @@ void SAL_CALL OUser::setName( const OUString& /*aName*/ )
}
// XInterface
-void SAL_CALL OUser::acquire() throw()
+void SAL_CALL OUser::acquire() noexcept
{
OUser_BASE::acquire();
}
-void SAL_CALL OUser::release() throw()
+void SAL_CALL OUser::release() noexcept
{
OUser_BASE::release();
}
diff --git a/connectivity/source/sdbcx/VView.cxx b/connectivity/source/sdbcx/VView.cxx
index 317e985b5199..cd634cc68db8 100644
--- a/connectivity/source/sdbcx/VView.cxx
+++ b/connectivity/source/sdbcx/VView.cxx
@@ -22,38 +22,38 @@
#include <comphelper/sequence.hxx>
#include <connectivity/dbtools.hxx>
#include <TConnection.hxx>
+#include <utility>
using namespace connectivity;
using namespace connectivity::sdbcx;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
-IMPLEMENT_SERVICE_INFO(OView,"com.sun.star.sdbcx.VView","com.sun.star.sdbcx.View");
+IMPLEMENT_SERVICE_INFO(OView,u"com.sun.star.sdbcx.VView"_ustr,u"com.sun.star.sdbcx.View"_ustr);
OView::OView(bool _bCase,
const OUString& Name,
- const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _xMetaData,
- const OUString& Command,
- const OUString& SchemaName,
- const OUString& CatalogName) : ODescriptor(::comphelper::OMutexAndBroadcastHelper::m_aBHelper,_bCase)
- ,m_CatalogName(CatalogName)
- ,m_SchemaName(SchemaName)
- ,m_Command(Command)
+ css::uno::Reference< css::sdbc::XDatabaseMetaData > _xMetaData,
+ OUString Command,
+ OUString SchemaName,
+ OUString CatalogName) : ODescriptor(::comphelper::OMutexAndBroadcastHelper::m_aBHelper,_bCase)
+ ,m_CatalogName(std::move(CatalogName))
+ ,m_SchemaName(std::move(SchemaName))
+ ,m_Command(std::move(Command))
,m_CheckOption(0)
- ,m_xMetaData(_xMetaData)
+ ,m_xMetaData(std::move(_xMetaData))
{
m_Name = Name;
construct();
}
-OView::OView(bool _bCase, const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _xMetaData)
+OView::OView(bool _bCase, css::uno::Reference< css::sdbc::XDatabaseMetaData > _xMetaData)
: ODescriptor(::comphelper::OMutexAndBroadcastHelper::m_aBHelper, _bCase, true)
- ,m_xMetaData(_xMetaData)
+ ,m_xMetaData(std::move(_xMetaData))
{
construct();
}
@@ -118,12 +118,12 @@ void SAL_CALL OView::setName( const OUString& )
{
}
-void SAL_CALL OView::acquire() throw()
+void SAL_CALL OView::acquire() noexcept
{
OView_BASE::acquire();
}
-void SAL_CALL OView::release() throw()
+void SAL_CALL OView::release() noexcept
{
OView_BASE::release();
}