loplugin:unuseddefaultparam in ucb

Change-Id: Ie0ea0b4dc13271a2bde5e3843bb3f8042ab880b4
This commit is contained in:
Noel Grandin
2016-02-26 14:48:09 +02:00
parent 1110346b3b
commit 83911dd753
5 changed files with 18 additions and 37 deletions

View File

@@ -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;
}

View File

@@ -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 );
}
}
}

View File

@@ -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.

View File

@@ -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,

View File

@@ -118,8 +118,7 @@ public:
// Non-interface methods.
bool getProperty( const OUString & rPropName,
css::beans::Property & rProp,
bool bStrict = false );
css::beans::Property & rProp );
};
}