summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-01 14:23:45 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-04-04 09:09:39 +0000
commit953f8f2cfecbe3005eb7de84daf1c9d86379244c (patch)
tree6cfd12b025f709c6d27c319e1597c9e5122198ed /tools
parente099c5bdaa458105148059228ec11c98b9d13029 (diff)
loplugin:constantparam in tools
Change-Id: I8b2a722b525722bd09ed1f27c648062d6f29cce7 Reviewed-on: https://gerrit.libreoffice.org/23723 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/fsys/urlobj.cxx55
-rw-r--r--tools/source/memtools/multisel.cxx25
2 files changed, 35 insertions, 45 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 825076282ff3..eb0b025ec848 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -1470,7 +1470,6 @@ void INetURLObject::changeScheme(INetProtocol eTargetScheme) {
}
bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
- bool bOctets,
INetURLObject & rTheAbsURIRef,
bool & rWasAbsolute,
EncodeMechanism eMechanism,
@@ -1533,7 +1532,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
q, pEnd - q, '\\');
sal_Unicode const * qe = n == -1 ? pEnd : q + n;
if (parseHostOrNetBiosName(
- q, qe, bOctets, ENCODE_ALL, RTL_TEXTENCODING_DONTKNOW,
+ q, qe, false/*bOctets*/, ENCODE_ALL, RTL_TEXTENCODING_DONTKNOW,
true, nullptr))
{
bFSys = true; // 1st
@@ -1542,7 +1541,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
if (bFSys)
{
INetURLObject aNewURI;
- aNewURI.setAbsURIRef(rTheRelURIRef, bOctets, eMechanism,
+ aNewURI.setAbsURIRef(rTheRelURIRef, false/*bOctets*/, eMechanism,
eCharset, true, eStyle);
if (!aNewURI.HasError())
{
@@ -1649,7 +1648,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
{
EscapeType eEscapeType;
sal_uInt32 nUTF32
- = getUTF32(p, pEnd, bOctets, eMechanism,
+ = getUTF32(p, pEnd, false/*bOctets*/, eMechanism,
eCharset, eEscapeType);
if (eEscapeType == ESCAPE_NO)
{
@@ -1661,7 +1660,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
break;
}
}
- appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, bOctets,
+ appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, false/*bOctets*/,
PART_VISIBLE, eCharset, true);
}
}
@@ -1704,7 +1703,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
{
EscapeType eEscapeType;
sal_uInt32 nUTF32
- = getUTF32(p, pEnd, bOctets, eMechanism, eCharset, eEscapeType);
+ = getUTF32(p, pEnd, false/*bOctets*/, eMechanism, eCharset, eEscapeType);
if (eEscapeType == ESCAPE_NO)
{
if (nUTF32 == nFragmentDelimiter)
@@ -1715,7 +1714,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
else if (nUTF32 == nSegmentDelimiter)
nUTF32 = '/';
}
- appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, bOctets, ePart,
+ appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, false/*bOctets*/, ePart,
eCharset, true);
}
}
@@ -1797,9 +1796,9 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
{
EscapeType eEscapeType;
sal_uInt32 nUTF32
- = getUTF32(p, pEnd, bOctets, eMechanism,
+ = getUTF32(p, pEnd, false/*bOctets*/, eMechanism,
eCharset, eEscapeType);
- appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, bOctets, ePart,
+ appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, false/*bOctets*/, ePart,
eCharset, true);
}
if (p != pEnd && *p == nSegmentDelimiter)
@@ -1813,8 +1812,8 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
{
EscapeType eEscapeType;
sal_uInt32 nUTF32
- = getUTF32(p, pEnd, bOctets, eMechanism, eCharset, eEscapeType);
- appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, bOctets, ePart,
+ = getUTF32(p, pEnd, false/*bOctets*/, eMechanism, eCharset, eEscapeType);
+ appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, false/*bOctets*/, ePart,
eCharset, true);
}
@@ -1843,8 +1842,8 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
{
EscapeType eEscapeType;
sal_uInt32 nUTF32
- = getUTF32(p, pEnd, bOctets, eMechanism, eCharset, eEscapeType);
- appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, bOctets,
+ = getUTF32(p, pEnd, false/*bOctets*/, eMechanism, eCharset, eEscapeType);
+ appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, false/*bOctets*/,
PART_VISIBLE, eCharset, true);
}
}
@@ -1886,7 +1885,7 @@ bool INetURLObject::convertAbsToRel(OUString const & rTheAbsURIRef,
// ref:
INetURLObject aSubject;
bool bWasAbsolute;
- if (!convertRelToAbs(rTheAbsURIRef, false/*bOctets*/, aSubject, bWasAbsolute,
+ if (!convertRelToAbs(rTheAbsURIRef, aSubject, bWasAbsolute,
eEncodeMechanism, eCharset, false, false, false,
eStyle))
{
@@ -2226,7 +2225,6 @@ INetURLObject::SubString INetURLObject::getAuthority() const
}
bool INetURLObject::setUser(OUString const & rTheUser,
- EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
if (
@@ -2237,7 +2235,7 @@ bool INetURLObject::setUser(OUString const & rTheUser,
}
OUString aNewUser(encodeText(rTheUser, false/*bOctets*/, PART_USER_PASSWORD,
- eMechanism, eCharset, false));
+ WAS_ENCODED, eCharset, false));
sal_Int32 nDelta;
if (m_aUser.isPresent())
nDelta = m_aUser.set(m_aAbsURIRef, aNewUser);
@@ -2287,13 +2285,12 @@ bool INetURLObject::clearPassword()
}
bool INetURLObject::setPassword(OUString const & rThePassword,
- EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
if (!getSchemeInfo().m_bPassword)
return false;
OUString aNewAuth(encodeText(rThePassword, false/*bOctets*/, PART_USER_PASSWORD,
- eMechanism, eCharset, false));
+ WAS_ENCODED, eCharset, false));
sal_Int32 nDelta;
if (m_aAuth.isPresent())
nDelta = m_aAuth.set(m_aAbsURIRef, aNewAuth);
@@ -2825,7 +2822,6 @@ bool INetURLObject::parseHostOrNetBiosName(
}
bool INetURLObject::setHost(OUString const & rTheHost,
- EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
if (!getSchemeInfo().m_bHost)
@@ -2856,7 +2852,7 @@ bool INetURLObject::setHost(OUString const & rTheHost,
}
if (!parseHostOrNetBiosName(
aSynHost.getStr(), aSynHost.getStr() + aSynHost.getLength(),
- false/*bOctets*/, eMechanism, eCharset, bNetBiosName, &aSynHost))
+ false/*bOctets*/, WAS_ENCODED, eCharset, bNetBiosName, &aSynHost))
return false;
sal_Int32 nDelta = m_aHost.set(m_aAbsURIRef, aSynHost.makeStringAndClear());
m_aPort += nDelta;
@@ -3154,8 +3150,7 @@ bool INetURLObject::appendSegment(OUString const & rTheSegment,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
- return insertName(rTheSegment, false/*bOctets*/, false, LAST_SEGMENT, true,
- eMechanism, eCharset);
+ return insertName(rTheSegment, false, LAST_SEGMENT, eMechanism, eCharset);
}
INetURLObject::SubString INetURLObject::getSegment(sal_Int32 nIndex,
@@ -3204,9 +3199,8 @@ INetURLObject::SubString INetURLObject::getSegment(sal_Int32 nIndex,
pSegEnd - pSegBegin);
}
-bool INetURLObject::insertName(OUString const & rTheName, bool bOctets,
+bool INetURLObject::insertName(OUString const & rTheName,
bool bAppendFinalSlash, sal_Int32 nIndex,
- bool bIgnoreFinalSlash,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
@@ -3225,7 +3219,7 @@ bool INetURLObject::insertName(OUString const & rTheName, bool bOctets,
if (nIndex == LAST_SEGMENT)
{
pPrefixEnd = pPathEnd;
- if (bIgnoreFinalSlash && pPrefixEnd > pPathBegin &&
+ if (pPrefixEnd > pPathBegin &&
pPrefixEnd[-1] == '/')
{
--pPrefixEnd;
@@ -3241,14 +3235,14 @@ bool INetURLObject::insertName(OUString const & rTheName, bool bOctets,
(pPathBegin == pPathEnd && bAppendFinalSlash);
pSuffixBegin =
(pPathEnd - pPathBegin == 1 && *pPathBegin == '/' &&
- !bAppendFinalSlash && bIgnoreFinalSlash)
+ !bAppendFinalSlash)
? pPathEnd : pPathBegin;
}
else
{
pPrefixEnd = pPathBegin;
sal_Unicode const * pEnd = pPathEnd;
- if (bIgnoreFinalSlash && pEnd > pPathBegin && pEnd[-1] == '/')
+ if (pEnd > pPathBegin && pEnd[-1] == '/')
--pEnd;
bool bSkip = pPrefixEnd < pEnd && *pPrefixEnd == '/';
bInsertSlash = false;
@@ -3280,7 +3274,7 @@ bool INetURLObject::insertName(OUString const & rTheName, bool bOctets,
OUStringBuffer aNewPath;
aNewPath.append(pPathBegin, pPrefixEnd - pPathBegin);
aNewPath.append('/');
- aNewPath.append(encodeText(rTheName, bOctets, PART_PCHAR,
+ aNewPath.append(encodeText(rTheName, false/*bOctets*/, PART_PCHAR,
eMechanism, eCharset, true));
if (bInsertSlash) {
aNewPath.append('/');
@@ -3842,7 +3836,7 @@ OUString INetURLObject::GetAbsURL(OUString const & rTheBaseURIRef,
INetURLObject aTheAbsURIRef;
bool bWasAbsolute;
return INetURLObject(rTheBaseURIRef, eEncodeMechanism, eCharset).
- convertRelToAbs(rTheRelURIRef, false, aTheAbsURIRef,
+ convertRelToAbs(rTheRelURIRef, aTheAbsURIRef,
bWasAbsolute, eEncodeMechanism,
eCharset, bIgnoreFragment, false,
false, FSYS_DETECT)
@@ -4147,7 +4141,6 @@ OUString INetURLObject::getExtension(sal_Int32 nIndex,
bool INetURLObject::setExtension(OUString const & rTheExtension,
sal_Int32 nIndex, bool bIgnoreFinalSlash,
- EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
SubString aSegment(getSegment(nIndex, bIgnoreFinalSlash));
@@ -4175,7 +4168,7 @@ bool INetURLObject::setExtension(OUString const & rTheExtension,
aNewPath.append(pPathBegin, pExtension - pPathBegin);
aNewPath.append('.');
aNewPath.append(encodeText(rTheExtension, false, PART_PCHAR,
- eMechanism, eCharset, true));
+ WAS_ENCODED, eCharset, true));
aNewPath.append(p, pPathEnd - p);
return setPath(aNewPath.makeStringAndClear(), NOT_CANONIC,
diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx
index d671130bc650..9e17b76ff907 100644
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -561,22 +561,19 @@ bool StringRangeEnumerator::checkValue( sal_Int32 i_nValue, const std::set< sal_
return true;
}
-bool StringRangeEnumerator::insertRange( sal_Int32 i_nFirst, sal_Int32 i_nLast, bool bSequence, bool bMayAdjust )
+bool StringRangeEnumerator::insertRange( sal_Int32 i_nFirst, sal_Int32 i_nLast, bool bSequence )
{
bool bSuccess = true;
if( bSequence )
{
- if( bMayAdjust )
- {
- if( i_nFirst < mnMin )
- i_nFirst = mnMin;
- if( i_nFirst > mnMax )
- i_nFirst = mnMax;
- if( i_nLast < mnMin )
- i_nLast = mnMin;
- if( i_nLast > mnMax )
- i_nLast = mnMax;
- }
+ if( i_nFirst < mnMin )
+ i_nFirst = mnMin;
+ if( i_nFirst > mnMax )
+ i_nFirst = mnMax;
+ if( i_nLast < mnMin )
+ i_nLast = mnMin;
+ if( i_nLast > mnMax )
+ i_nLast = mnMax;
if( checkValue( i_nFirst ) && checkValue( i_nLast ) )
{
maSequence.push_back( Range( i_nFirst, i_nLast ) );
@@ -614,7 +611,7 @@ bool StringRangeEnumerator::insertJoinedRanges(
return true;
if( nCount == 1 )
- return insertRange( rNumbers[0], -1, false, true );
+ return insertRange( rNumbers[0], -1, false );
for( size_t i = 0; i < nCount - 1; i++ )
{
@@ -626,7 +623,7 @@ bool StringRangeEnumerator::insertJoinedRanges(
else if( nFirst < nLast ) nFirst++;
}
- insertRange( nFirst, nLast, nFirst != nLast, true );
+ insertRange( nFirst, nLast, nFirst != nLast );
}
return true;