From 83911dd753fbfd0328bae2dfa37d19f514d4b2f9 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 26 Feb 2016 14:48:09 +0200 Subject: loplugin:unuseddefaultparam in ucb Change-Id: Ie0ea0b4dc13271a2bde5e3843bb3f8042ab880b4 --- ucb/source/inc/regexpmap.hxx | 25 ++++++++---------------- ucb/source/ucp/webdav-neon/ContentProperties.cxx | 12 ++++-------- ucb/source/ucp/webdav-neon/ContentProperties.hxx | 10 ++++------ ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx | 5 +---- ucb/source/ucp/webdav-neon/webdavprovider.hxx | 3 +-- 5 files changed, 18 insertions(+), 37 deletions(-) (limited to 'ucb') diff --git a/ucb/source/inc/regexpmap.hxx b/ucb/source/inc/regexpmap.hxx index bf74e2aa959b..b8e6bced97ef 100644 --- a/ucb/source/inc/regexpmap.hxx +++ b/ucb/source/inc/regexpmap.hxx @@ -378,10 +378,9 @@ public: RegexpMap & operator =(RegexpMap const & rOther); - void add(OUString const & rKey, Val const & rValue, bool bOverwrite, - OUString * pReverse = nullptr); + void add(OUString const & rKey, Val const & rValue, bool bOverwrite); - iterator find(OUString const & rKey, OUString * pReverse = nullptr); + iterator find(OUString const & rKey); void erase(iterator const & rPos); @@ -396,7 +395,7 @@ public: size_type size() const; Val const * map(OUString const & rString, - OUString * pTranslation = nullptr, bool * pTranslated = nullptr) + OUString * pTranslation = nullptr) const; private: @@ -428,7 +427,7 @@ RegexpMap< Val > & RegexpMap< Val >::operator =(RegexpMap const & rOther) template< typename Val > void RegexpMap< Val >::add(rtl::OUString const & rKey, Val const & rValue, - bool bOverwrite, rtl::OUString * pReverse) + bool bOverwrite) { Regexp aRegexp(Regexp::parse(rKey)); @@ -463,20 +462,13 @@ void RegexpMap< Val >::add(rtl::OUString const & rKey, Val const & rValue, rTheList.push_back(Entry< Val >(aRegexp, rValue)); } - - if (pReverse) - *pReverse = aRegexp.getRegexp(true); } template< typename Val > -typename RegexpMap< Val >::iterator RegexpMap< Val >::find(rtl::OUString const & rKey, - rtl::OUString * pReverse) +typename RegexpMap< Val >::iterator RegexpMap< Val >::find(rtl::OUString const & rKey) { Regexp aRegexp(Regexp::parse(rKey)); - if (pReverse) - *pReverse = aRegexp.getRegexp(true); - if (aRegexp.isDefault()) { if (m_pImpl->m_pDefault) @@ -554,8 +546,7 @@ typename RegexpMap< Val >::size_type RegexpMap< Val >::size() const template< typename Val > Val const * RegexpMap< Val >::map(rtl::OUString const & rString, - rtl::OUString * pTranslation, - bool * pTranslated) const + rtl::OUString * pTranslation) const { for (int n = Regexp::KIND_DOMAIN; n >= Regexp::KIND_PREFIX; --n) { @@ -564,12 +555,12 @@ Val const * RegexpMap< Val >::map(rtl::OUString const & rString, typename List< Val >::const_iterator aEnd(rTheList.end()); for (typename List< Val >::const_iterator aIt(rTheList.begin()); aIt != aEnd; ++aIt) - if (aIt->m_aRegexp.matches(rString, pTranslation, pTranslated)) + if (aIt->m_aRegexp.matches(rString, pTranslation, nullptr)) return &aIt->m_aValue; } if (m_pImpl->m_pDefault && m_pImpl->m_pDefault->m_aRegexp.matches(rString, pTranslation, - pTranslated)) + nullptr)) return &m_pImpl->m_pDefault->m_aValue; return 0; } diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.cxx b/ucb/source/ucp/webdav-neon/ContentProperties.cxx index 1b1bb43ad4d4..34a9a0681658 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.cxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.cxx @@ -214,8 +214,7 @@ const PropertyValue * ContentProperties::get( // static void ContentProperties::UCBNamesToDAVNames( const uno::Sequence< beans::Property > & rProps, - std::vector< OUString > & propertyNames, - bool bIncludeUnmatched /* = true */ ) + std::vector< OUString > & propertyNames ) { // Assemble list of DAV properties to obtain from server. @@ -291,8 +290,7 @@ void ContentProperties::UCBNamesToDAVNames( } else { - if ( bIncludeUnmatched ) - propertyNames.push_back( rProp.Name ); + propertyNames.push_back( rProp.Name ); } } } @@ -301,8 +299,7 @@ void ContentProperties::UCBNamesToDAVNames( // static void ContentProperties::UCBNamesToHTTPNames( const uno::Sequence< beans::Property > & rProps, - std::vector< OUString > & propertyNames, - bool bIncludeUnmatched /* = true */ ) + std::vector< OUString > & propertyNames ) { // Assemble list of HTTP header names to obtain from server. @@ -336,8 +333,7 @@ void ContentProperties::UCBNamesToHTTPNames( } else { - if ( bIncludeUnmatched ) - propertyNames.push_back( rProp.Name ); + propertyNames.push_back( rProp.Name ); } } } diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.hxx b/ucb/source/ucp/webdav-neon/ContentProperties.hxx index e3f6bf02466b..3150f85ddff2 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.hxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.hxx @@ -99,25 +99,23 @@ public: // Maps the UCB property names contained in rProps with their DAV property // counterparts, if possible. All unmappable properties will be included - // unchanged in resulting vector unless bIncludeUnmatched is set to false. + // unchanged in resulting vector. // The vector filles by this method can directly be handed over to // DAVResourceAccess::PROPFIND. The result from PROPFIND // (vector< DAVResource >) can be used to create a ContentProperties // instance which can map DAV properties back to UCB properties. static void UCBNamesToDAVNames( const css::uno::Sequence< css::beans::Property > & rProps, - std::vector< OUString > & resources, - bool bIncludeUnmatched = true ); + std::vector< OUString > & resources ); // Maps the UCB property names contained in rProps with their HTTP header // counterparts, if possible. All unmappable properties will be included - // unchanged in resulting vector unless bIncludeUnmatched is set to false. + // unchanged in resulting vector. // The vector filles by this method can directly be handed over to // DAVResourceAccess::HEAD. The result from HEAD (vector< DAVResource >) // can be used to create a ContentProperties instance which can map header // names back to UCB properties. static void UCBNamesToHTTPNames( const css::uno::Sequence< css::beans::Property > & rProps, - std::vector< OUString > & resources, - bool bIncludeUnmatched = true ); + std::vector< OUString > & resources ); // return true, if all properties contained in rProps are contained in // this ContentProperties instance. Otherwiese, false will be returned. diff --git a/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx b/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx index 10b4cec3555e..3a2e566b27f6 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx @@ -61,7 +61,7 @@ using namespace webdav_ucp; bool ContentProvider::getProperty( - const OUString & rPropName, beans::Property & rProp, bool bStrict ) + const OUString & rPropName, beans::Property & rProp ) { if ( !m_pProps ) { @@ -269,9 +269,6 @@ bool ContentProvider::getProperty( } else { - if ( bStrict ) - return false; - // All unknown props are treated as: rProp = beans::Property( rPropName, diff --git a/ucb/source/ucp/webdav-neon/webdavprovider.hxx b/ucb/source/ucp/webdav-neon/webdavprovider.hxx index 2cb16a4fc899..60ba57d74c2f 100644 --- a/ucb/source/ucp/webdav-neon/webdavprovider.hxx +++ b/ucb/source/ucp/webdav-neon/webdavprovider.hxx @@ -118,8 +118,7 @@ public: // Non-interface methods. bool getProperty( const OUString & rPropName, - css::beans::Property & rProp, - bool bStrict = false ); + css::beans::Property & rProp ); }; } -- cgit v1.2.3