From 1679aa60d0c06fe3b461a5d593aaeca9d8748925 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Fri, 29 Mar 2013 06:48:30 +0100 Subject: Prefer prefix ++/-- operators for non-primitive types + use const_iterator for end iterator Change-Id: I8ad8db97e35ec4fad7c02c669be981f73c9165ca --- sdext/source/minimizer/fileopendialog.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sdext/source/minimizer/fileopendialog.cxx b/sdext/source/minimizer/fileopendialog.cxx index 28c0ba53be97..3e30d216adc4 100644 --- a/sdext/source/minimizer/fileopendialog.cxx +++ b/sdext/source/minimizer/fileopendialog.cxx @@ -122,10 +122,7 @@ FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxContext OUString( "com.sun.star.document.TypeDetection" ), rxContext ), UNO_QUERY_THROW ); Sequence< OUString > aTypeList( xFilters->getElementNames() ); -// mxFilePicker->setDefaultName( ); - - std::vector< FilterEntry >::iterator aIter( aFilterEntryList.begin() ); - while( aIter != aFilterEntryList.end() ) + for( std::vector< FilterEntry >::const_iterator aIter(aFilterEntryList.begin()), aEnd(aFilterEntryList.end()); aIter != aEnd; ++aIter ) { Sequence< PropertyValue > aTypeProperties; try @@ -152,7 +149,6 @@ FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxContext catch ( const Exception& ) { } - aIter++; } } FileOpenDialog::~FileOpenDialog() @@ -176,15 +172,13 @@ void FileOpenDialog::setDefaultName( const rtl::OUString& rDefaultName ) rtl::OUString aFilterName; Reference< XFilterManager > xFilterManager( mxFilePicker, UNO_QUERY_THROW ); rtl::OUString aUIName( xFilterManager->getCurrentFilter() ); - std::vector< FilterEntry >::const_iterator aIter( aFilterEntryList.begin() ); - while( aIter != aFilterEntryList.end() ) + for( std::vector< FilterEntry >::const_iterator aIter(aFilterEntryList.begin()), aEnd(aFilterEntryList.end()); aIter != aEnd; ++aIter ) { if ( aIter->maUIName == aUIName ) { aFilterName = aIter->maName; break; } - aIter++; } return aFilterName; }; -- cgit