diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-01-11 08:35:48 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-01-11 14:27:51 +0100 |
commit | 74b3924a98dfeeec719f7bc27a2e0a2e1a597167 (patch) | |
tree | f2375ba227971ed7b080b3fa7259e6a741435282 /connectivity/source/drivers | |
parent | 4a0f40113d83742792d765eb1abcbb239cbbf2dd (diff) |
connectivity: various small cleanups in the Writer driver
Change-Id: I91735c3e92262fd37966c53f973d5eee1522cd61
Reviewed-on: https://gerrit.libreoffice.org/47741
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'connectivity/source/drivers')
5 files changed, 24 insertions, 29 deletions
diff --git a/connectivity/source/drivers/writer/WConnection.cxx b/connectivity/source/drivers/writer/WConnection.cxx index d0e6b2983c14..bbcd869f2271 100644 --- a/connectivity/source/drivers/writer/WConnection.cxx +++ b/connectivity/source/drivers/writer/WConnection.cxx @@ -34,10 +34,10 @@ #include <cppuhelper/exc_hlp.hxx> #include <comphelper/processfactory.hxx> -typedef connectivity::file::OConnection OConnection_BASE; - using namespace ::com::sun::star; +using OConnection_BASE = connectivity::file::OConnection; + namespace connectivity { namespace writer @@ -45,20 +45,17 @@ namespace writer OWriterConnection::OWriterConnection(ODriver* _pDriver) : OConnection(_pDriver),m_nDocCount(0) { - // m_aFilenameExtension is not used } -OWriterConnection::~OWriterConnection() -{ -} +OWriterConnection::~OWriterConnection() = default; -void OWriterConnection::construct(const OUString& url,const uno::Sequence< beans::PropertyValue >& info) +void OWriterConnection::construct(const OUString& rURL, const uno::Sequence< beans::PropertyValue >& rInfo) { // open file - sal_Int32 nLen = url.indexOf(':'); - nLen = url.indexOf(':',nLen+1); - OUString aDSN(url.copy(nLen+1)); + sal_Int32 nLen = rURL.indexOf(':'); + nLen = rURL.indexOf(':',nLen+1); + OUString aDSN(rURL.copy(nLen+1)); m_aFileName = aDSN; INetURLObject aURL; @@ -78,8 +75,8 @@ void OWriterConnection::construct(const OUString& url,const uno::Sequence< beans m_sPassword.clear(); const char pPwd[] = "password"; - const beans::PropertyValue* pIter = info.getConstArray(); - const beans::PropertyValue* pEnd = pIter + info.getLength(); + const beans::PropertyValue* pIter = rInfo.getConstArray(); + const beans::PropertyValue* pEnd = pIter + rInfo.getLength(); for (; pIter != pEnd; ++pIter) { if (pIter->Name == pPwd) @@ -210,7 +207,7 @@ css::uno::Reference< css::sdbcx::XTablesSupplier > OWriterConnection::createCata uno::Reference< css::sdbcx::XTablesSupplier > xTab = m_xCatalog; if (!xTab.is()) { - OWriterCatalog* pCat = new OWriterCatalog(this); + auto pCat = new OWriterCatalog(this); xTab = pCat; m_xCatalog = xTab; } diff --git a/connectivity/source/drivers/writer/WDatabaseMetaData.cxx b/connectivity/source/drivers/writer/WDatabaseMetaData.cxx index 5dcad41d3eb2..f811205666a2 100644 --- a/connectivity/source/drivers/writer/WDatabaseMetaData.cxx +++ b/connectivity/source/drivers/writer/WDatabaseMetaData.cxx @@ -32,9 +32,7 @@ OWriterDatabaseMetaData::OWriterDatabaseMetaData(file::OConnection* pConnection) { } -OWriterDatabaseMetaData::~OWriterDatabaseMetaData() -{ -} +OWriterDatabaseMetaData::~OWriterDatabaseMetaData() = default; OUString SAL_CALL OWriterDatabaseMetaData::getURL() { @@ -50,7 +48,7 @@ uno::Reference<sdbc::XResultSet> SAL_CALL OWriterDatabaseMetaData::getTables( { ::osl::MutexGuard aGuard(m_aMutex); - ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTables); + auto pResult = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTables); uno::Reference<sdbc::XResultSet> xRef = pResult; // check if ORowSetValue type is given diff --git a/connectivity/source/drivers/writer/WDriver.cxx b/connectivity/source/drivers/writer/WDriver.cxx index d07d2f326b31..55b5111b7e55 100644 --- a/connectivity/source/drivers/writer/WDriver.cxx +++ b/connectivity/source/drivers/writer/WDriver.cxx @@ -60,7 +60,7 @@ uno::Reference< sdbc::XConnection > SAL_CALL ODriver::connect(const OUString& ur if (! acceptsURL(url)) return nullptr; - OWriterConnection* pCon = new OWriterConnection(this); + auto pCon = new OWriterConnection(this); pCon->construct(url, info); uno::Reference< sdbc::XConnection > xCon = pCon; m_xConnections.push_back(uno::WeakReferenceHelper(*pCon)); diff --git a/connectivity/source/drivers/writer/WTable.cxx b/connectivity/source/drivers/writer/WTable.cxx index 2c3618cfb1e2..89e7720bdfb4 100644 --- a/connectivity/source/drivers/writer/WTable.cxx +++ b/connectivity/source/drivers/writer/WTable.cxx @@ -159,7 +159,7 @@ void OWriterTable::fillColumns() // check if the column name already exists OUString aAlias = aColumnName; - OSQLColumns::Vector::const_iterator aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase); + auto aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase); sal_Int32 nExprCnt = 0; while (aFind != m_aColumns->get().end()) { @@ -261,8 +261,8 @@ bool OWriterTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns& _rCols, // fields - OSQLColumns::Vector::const_iterator aIter = _rCols.get().begin(); - OSQLColumns::Vector::const_iterator aEnd = _rCols.get().end(); + auto aIter = _rCols.get().begin(); + auto aEnd = _rCols.get().end(); const OValueRefVector::Vector::size_type nCount = _rRow->get().size(); for (OValueRefVector::Vector::size_type i = 1; aIter != aEnd && i < nCount; ++aIter, i++) diff --git a/connectivity/source/drivers/writer/Wservices.cxx b/connectivity/source/drivers/writer/Wservices.cxx index ad59d7639153..6d77471f65b5 100644 --- a/connectivity/source/drivers/writer/Wservices.cxx +++ b/connectivity/source/drivers/writer/Wservices.cxx @@ -22,14 +22,14 @@ using namespace com::sun::star; -typedef uno::Reference< lang::XSingleServiceFactory > (* createFactoryFunc) -( - const uno::Reference< lang::XMultiServiceFactory >& rServiceManager, - const OUString& rComponentName, - ::cppu::ComponentInstantiation pCreateFunction, - const uno::Sequence< OUString >& rServiceNames, - rtl_ModuleCount* -); +using createFactoryFunc = uno::Reference<lang::XSingleServiceFactory> (*) + ( + const uno::Reference< lang::XMultiServiceFactory >& rServiceManager, + const OUString& rComponentName, + ::cppu::ComponentInstantiation pCreateFunction, + const uno::Sequence< OUString >& rServiceNames, + rtl_ModuleCount* + ); struct ProviderRequest |