diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-02-20 16:03:20 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-02-21 08:09:46 +0100 |
commit | ba8a70365ef459c967cd8a71a6d48ca53dd341bd (patch) | |
tree | 397ae034cac2f06ea40ed550a7ce39cf4a42966e /framework | |
parent | 0adb36835bcbe55bdf2717556a98e51f1873b19f (diff) |
New loplugin:nestedunnamed
Change-Id: Ifb434589ef08428ce609bc7a40b015d4df13224c
Reviewed-on: https://gerrit.libreoffice.org/50048
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/services/autorecovery.cxx | 37 | ||||
-rw-r--r-- | framework/source/services/urltransformer.cxx | 79 |
2 files changed, 55 insertions, 61 deletions
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 861cfcffe1d7..f85756fe9016 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2683,29 +2683,26 @@ AutoRecovery::TDocumentList::iterator AutoRecovery::impl_searchDocument( Au return pIt; } -namespace +void lcl_changeVisibility( const css::uno::Reference< css::frame::XFramesSupplier >& i_rFrames, bool i_bVisible ) { - void lcl_changeVisibility( const css::uno::Reference< css::frame::XFramesSupplier >& i_rFrames, bool i_bVisible ) - { - css::uno::Reference< css::container::XIndexAccess > xFramesContainer( i_rFrames->getFrames(), css::uno::UNO_QUERY ); - const sal_Int32 count = xFramesContainer->getCount(); + css::uno::Reference< css::container::XIndexAccess > xFramesContainer( i_rFrames->getFrames(), css::uno::UNO_QUERY ); + const sal_Int32 count = xFramesContainer->getCount(); - Any aElement; - for ( sal_Int32 i=0; i < count; ++i ) - { - aElement = xFramesContainer->getByIndex(i); - // check for sub frames - css::uno::Reference< css::frame::XFramesSupplier > xFramesSupp( aElement, css::uno::UNO_QUERY ); - if ( xFramesSupp.is() ) - lcl_changeVisibility( xFramesSupp, i_bVisible ); - - css::uno::Reference< css::frame::XFrame > xFrame( aElement, css::uno::UNO_QUERY ); - if ( !xFrame.is() ) - continue; + Any aElement; + for ( sal_Int32 i=0; i < count; ++i ) + { + aElement = xFramesContainer->getByIndex(i); + // check for sub frames + css::uno::Reference< css::frame::XFramesSupplier > xFramesSupp( aElement, css::uno::UNO_QUERY ); + if ( xFramesSupp.is() ) + lcl_changeVisibility( xFramesSupp, i_bVisible ); + + css::uno::Reference< css::frame::XFrame > xFrame( aElement, css::uno::UNO_QUERY ); + if ( !xFrame.is() ) + continue; - css::uno::Reference< css::awt::XWindow > xWindow( xFrame->getContainerWindow(), UNO_SET_THROW ); - xWindow->setVisible( i_bVisible ); - } + css::uno::Reference< css::awt::XWindow > xWindow( xFrame->getContainerWindow(), UNO_SET_THROW ); + xWindow->setVisible( i_bVisible ); } } diff --git a/framework/source/services/urltransformer.cxx b/framework/source/services/urltransformer.cxx index dec58037d19f..b9508629ed5d 100644 --- a/framework/source/services/urltransformer.cxx +++ b/framework/source/services/urltransformer.cxx @@ -61,56 +61,53 @@ public: virtual OUString SAL_CALL getPresentation( const css::util::URL& aURL, sal_Bool bWithPassword ) override; }; -namespace +void lcl_ParserHelper(INetURLObject& _rParser, css::util::URL& _rURL,bool _bUseIntern) { - void lcl_ParserHelper(INetURLObject& _rParser, css::util::URL& _rURL,bool _bUseIntern) + // Get all information about this URL. + _rURL.Protocol = INetURLObject::GetScheme( _rParser.GetProtocol() ); + _rURL.User = _rParser.GetUser ( INetURLObject::DecodeMechanism::WithCharset ); + _rURL.Password = _rParser.GetPass ( INetURLObject::DecodeMechanism::WithCharset ); + _rURL.Server = _rParser.GetHost ( INetURLObject::DecodeMechanism::WithCharset ); + _rURL.Port = static_cast<sal_Int16>(_rParser.GetPort()); + + sal_Int32 nCount = _rParser.getSegmentCount( false ); + if ( nCount > 0 ) { - // Get all information about this URL. - _rURL.Protocol = INetURLObject::GetScheme( _rParser.GetProtocol() ); - _rURL.User = _rParser.GetUser ( INetURLObject::DecodeMechanism::WithCharset ); - _rURL.Password = _rParser.GetPass ( INetURLObject::DecodeMechanism::WithCharset ); - _rURL.Server = _rParser.GetHost ( INetURLObject::DecodeMechanism::WithCharset ); - _rURL.Port = static_cast<sal_Int16>(_rParser.GetPort()); - - sal_Int32 nCount = _rParser.getSegmentCount( false ); - if ( nCount > 0 ) - { - // Don't add last segment as it is the name! - --nCount; - - OUStringBuffer aPath; - for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ ) - { - aPath.append( '/'); - aPath.append( _rParser.getName( nIndex, false, INetURLObject::DecodeMechanism::NONE )); - } - - if ( nCount > 0 ) - aPath.append( '/' ); // final slash! + // Don't add last segment as it is the name! + --nCount; - _rURL.Path = aPath.makeStringAndClear(); - _rURL.Name = _rParser.getName( INetURLObject::LAST_SEGMENT, false, INetURLObject::DecodeMechanism::NONE ); - } - else + OUStringBuffer aPath; + for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ ) { - _rURL.Path = _rParser.GetURLPath( INetURLObject::DecodeMechanism::NONE ); - _rURL.Name = _rParser.GetName ( ); + aPath.append( '/'); + aPath.append( _rParser.getName( nIndex, false, INetURLObject::DecodeMechanism::NONE )); } - _rURL.Arguments = _rParser.GetParam(); - _rURL.Mark = _rParser.GetMark( INetURLObject::DecodeMechanism::WithCharset ); + if ( nCount > 0 ) + aPath.append( '/' ); // final slash! + + _rURL.Path = aPath.makeStringAndClear(); + _rURL.Name = _rParser.getName( INetURLObject::LAST_SEGMENT, false, INetURLObject::DecodeMechanism::NONE ); + } + else + { + _rURL.Path = _rParser.GetURLPath( INetURLObject::DecodeMechanism::NONE ); + _rURL.Name = _rParser.GetName ( ); + } - // INetURLObject supports only an intelligent method of parsing URL's. So write - // back Complete to have a valid encoded URL in all cases! - _rURL.Complete = _rParser.GetMainURL( INetURLObject::DecodeMechanism::NONE ); - if ( _bUseIntern ) - _rURL.Complete = _rURL.Complete.intern(); + _rURL.Arguments = _rParser.GetParam(); + _rURL.Mark = _rParser.GetMark( INetURLObject::DecodeMechanism::WithCharset ); - _rParser.SetMark ( OUString() ); - _rParser.SetParam( OUString() ); + // INetURLObject supports only an intelligent method of parsing URL's. So write + // back Complete to have a valid encoded URL in all cases! + _rURL.Complete = _rParser.GetMainURL( INetURLObject::DecodeMechanism::NONE ); + if ( _bUseIntern ) + _rURL.Complete = _rURL.Complete.intern(); - _rURL.Main = _rParser.GetMainURL( INetURLObject::DecodeMechanism::NONE ); - } + _rParser.SetMark ( OUString() ); + _rParser.SetParam( OUString() ); + + _rURL.Main = _rParser.GetMainURL( INetURLObject::DecodeMechanism::NONE ); } // XURLTransformer |