From 3aff028b8f8c62d948d0d6f29a8bd4d169d1e762 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 20 Nov 2015 14:06:06 +0200 Subject: loplugin:unusedfields in dbaccess Change-Id: I563c3727c1719fe21acced269e5469c2de7112e8 --- dbaccess/source/filter/xml/xmlExport.cxx | 35 ++++++-------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) (limited to 'dbaccess/source/filter') diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 25fafb18dea2..14bf274a63af 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -612,36 +612,13 @@ void ODBExport::exportConnectionData() Reference< XPropertySet > xDataSourceSettings( xProp->getPropertyValue( PROPERTY_SETTINGS ), UNO_QUERY_THROW ); Reference< XPropertySetInfo > xSettingsInfo( xDataSourceSettings->getPropertySetInfo(), UNO_SET_THROW ); - struct PropertyMap - { - const sal_Char* pAsciiPropertyName; - sal_uInt16 nAttributeId; - - PropertyMap( const sal_Char* _pAsciiPropertyName, const sal_uInt16 _nAttributeId ) - :pAsciiPropertyName( _pAsciiPropertyName ) - ,nAttributeId( _nAttributeId ) - { - } - }; - PropertyMap aProperties[] = - { - PropertyMap( "LocalSocket", XML_LOCAL_SOCKET ) - //PropertyMap( "NamedPipe", 0 /* TODO */ ) - }; - - for ( size_t i=0; - i < sizeof( aProperties ) / sizeof( aProperties[0] ); - ++i - ) + + const OUString sPropertyName = "LocalSocket"; + if ( xSettingsInfo->hasPropertyByName( sPropertyName ) ) { - const OUString sPropertyName = OUString::createFromAscii( aProperties[i].pAsciiPropertyName ); - if ( xSettingsInfo->hasPropertyByName( sPropertyName ) ) - { - OUString sPropertyValue; - if ( ( xDataSourceSettings->getPropertyValue( sPropertyName ) >>= sPropertyValue ) && !sPropertyValue.isEmpty() ) - AddAttribute( XML_NAMESPACE_DB, XML_LOCAL_SOCKET, sPropertyValue ); - - } + OUString sPropertyValue; + if ( ( xDataSourceSettings->getPropertyValue( sPropertyName ) >>= sPropertyValue ) && !sPropertyValue.isEmpty() ) + AddAttribute( XML_NAMESPACE_DB, XML_LOCAL_SOCKET, sPropertyValue ); } } catch( const Exception& ) -- cgit