From ba8a70365ef459c967cd8a71a6d48ca53dd341bd Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 20 Feb 2018 16:03:20 +0100 Subject: New loplugin:nestedunnamed Change-Id: Ifb434589ef08428ce609bc7a40b015d4df13224c Reviewed-on: https://gerrit.libreoffice.org/50048 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- svtools/source/uno/wizard/unowizard.cxx | 91 ++++++++++++++------------------- 1 file changed, 39 insertions(+), 52 deletions(-) (limited to 'svtools') diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index c44c8de02a8f..9906d34e5ffe 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -67,23 +67,19 @@ namespace { namespace WizardButton = css::ui::dialogs::WizardButton; - - namespace + WizardButtonFlags lcl_convertWizardButtonToWZB( const sal_Int16 i_nWizardButton ) { - WizardButtonFlags lcl_convertWizardButtonToWZB( const sal_Int16 i_nWizardButton ) + switch ( i_nWizardButton ) { - switch ( i_nWizardButton ) - { - case WizardButton::NONE: return WizardButtonFlags::NONE; - case WizardButton::NEXT: return WizardButtonFlags::NEXT; - case WizardButton::PREVIOUS: return WizardButtonFlags::PREVIOUS; - case WizardButton::FINISH: return WizardButtonFlags::FINISH; - case WizardButton::CANCEL: return WizardButtonFlags::CANCEL; - case WizardButton::HELP: return WizardButtonFlags::HELP; - } - OSL_FAIL( "lcl_convertWizardButtonToWZB: invalid WizardButton constant!" ); - return WizardButtonFlags::NONE; + case WizardButton::NONE: return WizardButtonFlags::NONE; + case WizardButton::NEXT: return WizardButtonFlags::NEXT; + case WizardButton::PREVIOUS: return WizardButtonFlags::PREVIOUS; + case WizardButton::FINISH: return WizardButtonFlags::FINISH; + case WizardButton::CANCEL: return WizardButtonFlags::CANCEL; + case WizardButton::HELP: return WizardButtonFlags::HELP; } + OSL_FAIL( "lcl_convertWizardButtonToWZB: invalid WizardButton constant!" ); + return WizardButtonFlags::NONE; } typedef ::cppu::ImplInheritanceHelper < ::svt::OGenericUnoDialog @@ -147,8 +143,6 @@ namespace { { } - namespace { - OUString lcl_getHelpURL( const OString& sHelpId ) { OUStringBuffer aBuffer; @@ -161,8 +155,6 @@ namespace { return aBuffer.makeStringAndClear(); } - } - Wizard::~Wizard() { if ( m_pDialog ) @@ -176,53 +168,48 @@ namespace { } } - - namespace + void lcl_checkPaths( const Sequence< Sequence< sal_Int16 > >& i_rPaths, const Reference< XInterface >& i_rContext ) { - void lcl_checkPaths( const Sequence< Sequence< sal_Int16 > >& i_rPaths, const Reference< XInterface >& i_rContext ) + // need at least one path + if ( i_rPaths.getLength() == 0 ) + throw IllegalArgumentException( OUString(), i_rContext, 2 ); + + // each path must be of length 1, at least + for ( sal_Int32 i = 0; i < i_rPaths.getLength(); ++i ) { - // need at least one path - if ( i_rPaths.getLength() == 0 ) + if ( i_rPaths[i].getLength() == 0 ) throw IllegalArgumentException( OUString(), i_rContext, 2 ); - // each path must be of length 1, at least - for ( sal_Int32 i = 0; i < i_rPaths.getLength(); ++i ) + // page IDs must be in ascending order + sal_Int16 nPreviousPageID = i_rPaths[i][0]; + for ( sal_Int32 j=1; j& i_Arguments ) { ::osl::MutexGuard aGuard( m_aMutex ); -- cgit