summaryrefslogtreecommitdiffstats
path: root/dbaccess/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-10-19 11:17:29 +0200
committerStephan Bergmann <sbergman@redhat.com>2011-10-19 11:17:47 +0200
commit322d455f9f87deb0551d7360ba10e4ae6e3021ab (patch)
tree5c68c94ef4279cdb8066428fd193e3e0d00b66d7 /dbaccess/source
parentmake libxmlsec be built again with SYSTEM_MOZILLA=YES (diff)
downloadcore-322d455f9f87deb0551d7360ba10e4ae6e3021ab.tar.gz
core-322d455f9f87deb0551d7360ba10e4ae6e3021ab.zip
Simplified comphelper::OSequenceIterator and its uses.
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/filter/xml/xmlExport.cxx41
-rw-r--r--dbaccess/source/filter/xml/xmlExport.hxx2
2 files changed, 23 insertions, 20 deletions
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx
index 661e237e0a95..9f6a89f3c757 100644
--- a/dbaccess/source/filter/xml/xmlExport.cxx
+++ b/dbaccess/source/filter/xml/xmlExport.cxx
@@ -672,6 +672,19 @@ void ODBExport::exportConnectionData()
exportLogin();
}
// -----------------------------------------------------------------------------
+template< typename T > void ODBExport::exportDataSourceSettingsSequence(
+ ::std::vector< TypedPropertyValue >::iterator const & in)
+{
+ OSequenceIterator< T > i( in->Value );
+ ::rtl::OUString sCurrent;
+ while (i.hasMoreElements())
+ {
+ SvXMLElementExport aDataValue(*this,XML_NAMESPACE_DB, XML_DATA_SOURCE_SETTING_VALUE, sal_True, sal_False);
+ // (no whitespace inside the tag)
+ Characters(implConvertAny(i.nextElement()));
+ }
+}
+
void ODBExport::exportDataSourceSettings()
{
if ( m_aDataSourceSettings.empty() )
@@ -715,46 +728,34 @@ void ODBExport::exportDataSourceSettings()
else
{
// the not-that-simple case, we need to iterate through the sequence elements
- SAL_WNODEPRECATED_DECLARATIONS_PUSH
- ::std::auto_ptr<IIterator> pSequenceIterator;
- SAL_WNODEPRECATED_DECLARATIONS_POP
switch (aSimpleType.getTypeClass())
{
case TypeClass_STRING:
- pSequenceIterator.reset( new OSequenceIterator< ::rtl::OUString >( aIter->Value ) );
+ exportDataSourceSettingsSequence< ::rtl::OUString >(
+ aIter );
break;
case TypeClass_DOUBLE:
- pSequenceIterator.reset( new OSequenceIterator< double >( aIter->Value ) );
+ exportDataSourceSettingsSequence< double >( aIter );
break;
case TypeClass_BOOLEAN:
- pSequenceIterator.reset( new OSequenceIterator< sal_Bool >( aIter->Value ) );
+ exportDataSourceSettingsSequence< sal_Bool >( aIter );
break;
case TypeClass_BYTE:
- pSequenceIterator.reset( new OSequenceIterator< sal_Int8 >( aIter->Value ) );
+ exportDataSourceSettingsSequence< sal_Int8 >( aIter );
break;
case TypeClass_SHORT:
- pSequenceIterator.reset( new OSequenceIterator< sal_Int16 >( aIter->Value ) );
+ exportDataSourceSettingsSequence< sal_Int16 >( aIter );
break;
case TypeClass_LONG:
- pSequenceIterator.reset( new OSequenceIterator< sal_Int32 >( aIter->Value ) );
+ exportDataSourceSettingsSequence< sal_Int32 >( aIter );
break;
case TypeClass_ANY:
- pSequenceIterator.reset( new OSequenceIterator< Any >( aIter->Value ) );
+ exportDataSourceSettingsSequence< Any >( aIter );
break;
default:
OSL_FAIL("unsupported sequence type !");
break;
}
- if ( pSequenceIterator.get() )
- {
- ::rtl::OUString sCurrent;
- while (pSequenceIterator->hasMoreElements())
- {
- SvXMLElementExport aDataValue(*this,XML_NAMESPACE_DB, XML_DATA_SOURCE_SETTING_VALUE, sal_True, sal_False);
- // (no whitespace inside the tag)
- Characters(implConvertAny(pSequenceIterator->nextElement()));
- }
- }
}
}
}
diff --git a/dbaccess/source/filter/xml/xmlExport.hxx b/dbaccess/source/filter/xml/xmlExport.hxx
index 8dc662f85705..2a4fe268cc33 100644
--- a/dbaccess/source/filter/xml/xmlExport.hxx
+++ b/dbaccess/source/filter/xml/xmlExport.hxx
@@ -137,6 +137,8 @@ class ODBExport : public SvXMLExport
void exportDelimiter();
void exportAutoIncrement();
void exportCharSet();
+ template< typename T > void exportDataSourceSettingsSequence(
+ ::std::vector< TypedPropertyValue >::iterator const & in);
void exportDataSourceSettings();
void exportForms();
void exportReports();