From af74913da2b63857a248ac8fc4fa438b7a8663ec Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 8 Mar 2016 10:59:06 +0200 Subject: loplugin:constantparams in ucb Change-Id: I6b925336b13404ccf0f78f194bd3488a22f99b97 --- ucb/source/inc/regexp.hxx | 2 +- ucb/source/inc/regexpmap.hxx | 2 +- ucb/source/regexp/regexp.cxx | 26 +++++--------------------- 3 files changed, 7 insertions(+), 23 deletions(-) (limited to 'ucb/source') diff --git a/ucb/source/inc/regexp.hxx b/ucb/source/inc/regexp.hxx index e04120b47c56..18b09a36393f 100644 --- a/ucb/source/inc/regexp.hxx +++ b/ucb/source/inc/regexp.hxx @@ -45,7 +45,7 @@ public: bool matches(OUString const & rString, OUString * pTranslation, bool * pTranslated) const; - OUString getRegexp(bool bReverse) const; + OUString getRegexp() const; static Regexp parse(OUString const & rRegexp); diff --git a/ucb/source/inc/regexpmap.hxx b/ucb/source/inc/regexpmap.hxx index e4d446e5f44e..ab714ed6f793 100644 --- a/ucb/source/inc/regexpmap.hxx +++ b/ucb/source/inc/regexpmap.hxx @@ -150,7 +150,7 @@ void RegexpMapIterImpl< Val >::setEntry() const Entry< Val > const & rTheEntry = m_nList == -1 ? *m_pMap->m_pDefault : *m_aIndex; m_aEntry - = RegexpMapEntry< Val >(rTheEntry.m_aRegexp.getRegexp(false), + = RegexpMapEntry< Val >(rTheEntry.m_aRegexp.getRegexp(), const_cast< Val * >(&rTheEntry.m_aValue)); m_bEntrySet = true; } diff --git a/ucb/source/regexp/regexp.cxx b/ucb/source/regexp/regexp.cxx index f2c53e8691c7..fae2aee293be 100644 --- a/ucb/source/regexp/regexp.cxx +++ b/ucb/source/regexp/regexp.cxx @@ -210,21 +210,13 @@ void appendStringLiteral(OUStringBuffer * pBuffer, } -OUString Regexp::getRegexp(bool bReverse) const +OUString Regexp::getRegexp() const { if (m_bTranslation) { OUStringBuffer aBuffer; - if (bReverse) - { - if (!m_aReversePrefix.isEmpty()) - appendStringLiteral(&aBuffer, m_aReversePrefix); - } - else - { - if (!m_aPrefix.isEmpty()) - appendStringLiteral(&aBuffer, m_aPrefix); - } + if (!m_aPrefix.isEmpty()) + appendStringLiteral(&aBuffer, m_aPrefix); switch (m_eKind) { case KIND_PREFIX: @@ -244,16 +236,8 @@ OUString Regexp::getRegexp(bool bReverse) const break; } aBuffer.append("->"); - if (bReverse) - { - if (!m_aPrefix.isEmpty()) - appendStringLiteral(&aBuffer, m_aPrefix); - } - else - { - if (!m_aReversePrefix.isEmpty()) - appendStringLiteral(&aBuffer, m_aReversePrefix); - } + if (!m_aReversePrefix.isEmpty()) + appendStringLiteral(&aBuffer, m_aReversePrefix); aBuffer.append("\\1"); return aBuffer.makeStringAndClear(); } -- cgit v1.2.3