diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-28 12:29:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-28 13:25:27 +0200 |
commit | 1705fbe9daac56ee9bea8d8fd7c7f57e2bec49b5 (patch) | |
tree | aaf39244173a4cf20df6568140ebdbe5ec055656 /dbaccess | |
parent | dfa8e18e8e6c7ad87e423393f8293a20188de1fd (diff) |
move the castToFastAttributeList function
to the slightly higher namespace, to make it easy and more readable to
use directly in a for-loop-range expression.
And make it return a reference rather than a pointer, since it is never
allowed to be nullptr.
Change-Id: I15d0b32493ef65cfc601b247c272b318f1eadfd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93049
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/filter/xml/xmlColumn.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlComponent.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlConnectionResource.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlDataSource.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlDataSourceInfo.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlDataSourceSetting.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlHierarchyCollection.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlLogin.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlQuery.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlServerDatabase.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlTable.cxx | 8 |
12 files changed, 13 insertions, 39 deletions
diff --git a/dbaccess/source/filter/xml/xmlColumn.cxx b/dbaccess/source/filter/xml/xmlColumn.cxx index fdd343555cdf..334c4fbfcbe4 100644 --- a/dbaccess/source/filter/xml/xmlColumn.cxx +++ b/dbaccess/source/filter/xml/xmlColumn.cxx @@ -46,9 +46,7 @@ OXMLColumn::OXMLColumn( ODBFilter& rImport ,m_bHidden(false) { OUString sType; - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); diff --git a/dbaccess/source/filter/xml/xmlComponent.cxx b/dbaccess/source/filter/xml/xmlComponent.cxx index f2be6482acde..863a98f1673b 100644 --- a/dbaccess/source/filter/xml/xmlComponent.cxx +++ b/dbaccess/source/filter/xml/xmlComponent.cxx @@ -44,9 +44,7 @@ OXMLComponent::OXMLComponent( ODBFilter& rImport OUString sHREF; bool bAsTemplate(false); static const OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE); - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); diff --git a/dbaccess/source/filter/xml/xmlConnectionResource.cxx b/dbaccess/source/filter/xml/xmlConnectionResource.cxx index 768ca19840fc..b2c37fc3584a 100644 --- a/dbaccess/source/filter/xml/xmlConnectionResource.cxx +++ b/dbaccess/source/filter/xml/xmlConnectionResource.cxx @@ -40,9 +40,7 @@ OXMLConnectionResource::OXMLConnectionResource( ODBFilter& rImport, if (!xDataSource.is()) return; - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); aProperty.Name.clear(); diff --git a/dbaccess/source/filter/xml/xmlDataSource.cxx b/dbaccess/source/filter/xml/xmlDataSource.cxx index 66f1ab44f979..53095dfe0e2f 100644 --- a/dbaccess/source/filter/xml/xmlDataSource.cxx +++ b/dbaccess/source/filter/xml/xmlDataSource.cxx @@ -52,9 +52,7 @@ OXMLDataSource::OXMLDataSource( ODBFilter& rImport, static const OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE); if (xDataSource.is()) { - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); diff --git a/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx b/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx index 502d0cd4f34b..82ab36eb2c75 100644 --- a/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx +++ b/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx @@ -37,9 +37,7 @@ OXMLDataSourceInfo::OXMLDataSourceInfo( ODBFilter& rImport PropertyValue aProperty; bool bAutoEnabled = false; bool bFoundField = false,bFoundThousand = false, bFoundCharset = false; - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); diff --git a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx index 3432c33bbba7..3b7e6d512dc9 100644 --- a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx +++ b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx @@ -45,9 +45,7 @@ OXMLDataSourceSetting::OXMLDataSourceSetting( ODBFilter& rImport m_aPropType = cppu::UnoType<void>::get(); - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); diff --git a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx index 5d7207a98486..8070790e4e8c 100644 --- a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx +++ b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx @@ -42,9 +42,7 @@ OXMLFileBasedDatabase::OXMLFileBasedDatabase( ODBFilter& rImport, OUString sLocation,sMediaType,sFileTypeExtension; if (xDataSource.is()) { - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); diff --git a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx index 79035c07bdac..d542a1ad7807 100644 --- a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx +++ b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx @@ -46,9 +46,7 @@ OXMLHierarchyCollection::OXMLHierarchyCollection( ODBFilter& rImport ,m_sComponentServiceName(_sComponentServiceName) { OUString sName; - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); diff --git a/dbaccess/source/filter/xml/xmlLogin.cxx b/dbaccess/source/filter/xml/xmlLogin.cxx index c94f0a07162d..c74d98be7ddd 100644 --- a/dbaccess/source/filter/xml/xmlLogin.cxx +++ b/dbaccess/source/filter/xml/xmlLogin.cxx @@ -41,9 +41,7 @@ OXMLLogin::OXMLLogin( ODBFilter& rImport, if (!xDataSource.is()) return; - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); diff --git a/dbaccess/source/filter/xml/xmlQuery.cxx b/dbaccess/source/filter/xml/xmlQuery.cxx index cd52e183c08b..7ab4940da9d2 100644 --- a/dbaccess/source/filter/xml/xmlQuery.cxx +++ b/dbaccess/source/filter/xml/xmlQuery.cxx @@ -41,9 +41,7 @@ OXMLQuery::OXMLQuery( ODBFilter& rImport OXMLTable( rImport, _xAttrList,_xParentContainer, "com.sun.star.sdb.CommandDefinition" ) ,m_bEscapeProcessing(true) { - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); diff --git a/dbaccess/source/filter/xml/xmlServerDatabase.cxx b/dbaccess/source/filter/xml/xmlServerDatabase.cxx index ad5d51c21aa3..87ff119b5a79 100644 --- a/dbaccess/source/filter/xml/xmlServerDatabase.cxx +++ b/dbaccess/source/filter/xml/xmlServerDatabase.cxx @@ -40,9 +40,7 @@ OXMLServerDatabase::OXMLServerDatabase( ODBFilter& rImport, OUString sType,sHostName,sPortNumber,sDatabaseName; if (xDataSource.is()) { - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); diff --git a/dbaccess/source/filter/xml/xmlTable.cxx b/dbaccess/source/filter/xml/xmlTable.cxx index 18c7f25dbaf3..9477f13faf54 100644 --- a/dbaccess/source/filter/xml/xmlTable.cxx +++ b/dbaccess/source/filter/xml/xmlTable.cxx @@ -49,9 +49,7 @@ OXMLTable::OXMLTable( ODBFilter& _rImport ,m_bApplyFilter(false) ,m_bApplyOrder(false) { - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); @@ -200,9 +198,7 @@ void OXMLTable::fillAttributes(const uno::Reference< XFastAttributeList > & _xAt ,OUString& _rsTableCatalog ) { - sax_fastparser::FastAttributeList *pAttribList = - sax_fastparser::FastAttributeList::castToFastAttributeList( _xAttrList ); - for (auto &aIter : *pAttribList) + for (auto &aIter : sax_fastparser::castToFastAttributeList( _xAttrList )) { OUString sValue = aIter.toString(); |