From 73140c6f3485e3f221fe6f272c21104b8575e12c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 23 Mar 2016 09:58:27 +0200 Subject: loplugin:constantparam in fpicker Change-Id: I7225c996030eed494e3ca8a9dabc501fc505e101 --- fpicker/source/office/iodlg.cxx | 17 +++++++---------- fpicker/source/office/iodlg.hxx | 12 +----------- 2 files changed, 8 insertions(+), 21 deletions(-) (limited to 'fpicker') diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index ec41f7305060..dc1e570322ef 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -787,7 +787,7 @@ IMPL_LINK_NOARG_TYPED( SvtFileDialog, NewFolderHdl_Impl, Button*, void) } } -bool SvtFileDialog::createNewUserFilter( const OUString& _rNewFilter, bool _bAllowUserDefExt ) +bool SvtFileDialog::createNewUserFilter( const OUString& _rNewFilter ) { // delete the old user filter and create a new one DELETEZ( _pImp->_pUserFilter ); @@ -817,13 +817,10 @@ bool SvtFileDialog::createNewUserFilter( const OUString& _rNewFilter, bool _bAll bUseCurFilterExt = false; } - if ( !_bAllowUserDefExt || bUseCurFilterExt ) - { - if ( _pImp->GetCurFilter( ) ) - SetDefaultExt( _pImp->GetCurFilter( )->GetExtension() ); - else - EraseDefaultExt(); - } + if ( _pImp->GetCurFilter( ) ) + SetDefaultExt( _pImp->GetCurFilter( )->GetExtension() ); + else + EraseDefaultExt(); // outta here return bIsAllFiles; @@ -861,7 +858,7 @@ sal_uInt16 SvtFileDialog::adjustFilter( const OUString& _rFilter ) { nReturn |= FLT_USERFILTER; // no filter found : use it as user defined filter - if ( createNewUserFilter( _rFilter, false ) ) + if ( createNewUserFilter( _rFilter ) ) { // it's the "all files" filter nReturn |= FLT_ALLFILESFILTER; @@ -1386,7 +1383,7 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl // activate filter _rFilterChanged = _pImp->_pUserFilter || ( _pImp->GetCurFilter() != pFilter ); - createNewUserFilter( _rFilter, false ); + createNewUserFilter( _rFilter ); break; } diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index c360d522df94..a83da18df277 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -239,19 +239,9 @@ private: /** updates _pUserFilter with a new filter

No checks for necessity are made.

- @param _bAllowUserDefExt - set to if a filter like "*.txt" should reset the DefaultExtension to doc. -

- In a file-save-dialog this would have the following effect:
- Say that auto-extension is checked, and the user enters *.txt, while a non-txt filter is selected.
- If _bAllowUserDefExt is set to , then a user input of "foo" would save a foo.txt, but in a format - which is determined by the filter selected (which is no txt file as said above).
- If _bAllowUserDefExt is set to , the default extension will be the one of the selected filter, means - in the above scenario a file "foo." will be saved where ext is the extension of the selected filter. -

@return if the new filter is "*.*" */ - bool createNewUserFilter( const OUString& _rNewFilter, bool _bAllowUserDefExt ); + bool createNewUserFilter( const OUString& _rNewFilter ); sal_uInt16 adjustFilter( const OUString& _rFilter ); -- cgit v1.2.3