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>
This commit is contained in:
Noel Grandin
2016-04-01 14:23:45 +02:00
committed by Noel Grandin
parent e099c5bdaa
commit 953f8f2cfe
4 changed files with 48 additions and 76 deletions

View File

@@ -94,7 +94,7 @@ class TOOLS_DLLPUBLIC StringRangeEnumerator
bool mbValidInput; bool mbValidInput;
bool setRange( const OUString& i_rNewRange ); bool setRange( const OUString& i_rNewRange );
bool insertRange( sal_Int32 nFirst, sal_Int32 nLast, bool bSequence, bool bMayAdjust ); bool insertRange( sal_Int32 nFirst, sal_Int32 nLast, bool bSequence );
bool insertJoinedRanges( const std::vector< sal_Int32 >& rNumbers ); bool insertJoinedRanges( const std::vector< sal_Int32 >& rNumbers );
bool checkValue( sal_Int32, const std::set< sal_Int32 >* i_pPossibleValues = nullptr ) const; bool checkValue( sal_Int32, const std::set< sal_Int32 >* i_pPossibleValues = nullptr ) const;
public: public:

View File

@@ -422,7 +422,7 @@ public:
{ return decode(m_aAuth, eMechanism, eCharset); } { return decode(m_aAuth, eMechanism, eCharset); }
inline bool SetUser(OUString const & rTheUser) inline bool SetUser(OUString const & rTheUser)
{ return setUser(rTheUser, WAS_ENCODED, RTL_TEXTENCODING_UTF8); } { return setUser(rTheUser, RTL_TEXTENCODING_UTF8); }
inline bool SetPass(OUString const & rThePassword); inline bool SetPass(OUString const & rThePassword);
@@ -444,7 +444,7 @@ public:
sal_uInt32 GetPort() const; sal_uInt32 GetPort() const;
inline bool SetHost(OUString const & rTheHost) inline bool SetHost(OUString const & rTheHost)
{ return setHost(rTheHost, WAS_ENCODED, RTL_TEXTENCODING_UTF8); } { return setHost(rTheHost, RTL_TEXTENCODING_UTF8); }
bool SetPort(sal_uInt32 nThePort); bool SetPort(sal_uInt32 nThePort);
@@ -539,7 +539,7 @@ public:
the specified place to insert the new segment does not exist, false is the specified place to insert the new segment does not exist, false is
returned. If false is returned, the object is not modified. returned. If false is returned, the object is not modified.
*/ */
inline bool insertName(OUString const & rTheName, bool insertName(OUString const & rTheName,
bool bAppendFinalSlash = false, bool bAppendFinalSlash = false,
sal_Int32 nIndex = LAST_SEGMENT, sal_Int32 nIndex = LAST_SEGMENT,
EncodeMechanism eMechanism = WAS_ENCODED, EncodeMechanism eMechanism = WAS_ENCODED,
@@ -665,8 +665,6 @@ public:
@param bIgnoreFinalSlash If true, a final slash at the end of the @param bIgnoreFinalSlash If true, a final slash at the end of the
hierarchical path does not denote an empty segment, but is ignored. hierarchical path does not denote an empty segment, but is ignored.
@param eMechanism See the general discussion for set-methods.
@param eCharset See the general discussion for set-methods. @param eCharset See the general discussion for set-methods.
@return True if the extension has successfully been modified (and the @return True if the extension has successfully been modified (and the
@@ -677,7 +675,6 @@ public:
bool setExtension(OUString const & rTheExtension, bool setExtension(OUString const & rTheExtension,
sal_Int32 nIndex = LAST_SEGMENT, sal_Int32 nIndex = LAST_SEGMENT,
bool bIgnoreFinalSlash = true, bool bIgnoreFinalSlash = true,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8); rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
/** Remove the extension of the name of a segment. /** Remove the extension of the name of a segment.
@@ -1015,7 +1012,7 @@ private:
// Relative URLs: // Relative URLs:
bool convertRelToAbs( bool convertRelToAbs(
OUString const & rTheRelURIRef, bool bOctets, OUString const & rTheRelURIRef,
INetURLObject & rTheAbsURIRef, bool & rWasAbsolute, INetURLObject & rTheAbsURIRef, bool & rWasAbsolute,
EncodeMechanism eMechanism, rtl_TextEncoding eCharset, EncodeMechanism eMechanism, rtl_TextEncoding eCharset,
bool bIgnoreFragment, bool bSmart, bool bRelativeNonURIs, bool bIgnoreFragment, bool bSmart, bool bRelativeNonURIs,
@@ -1061,13 +1058,13 @@ private:
bool setUser( bool setUser(
OUString const & rTheUser, OUString const & rTheUser,
EncodeMechanism eMechanism, rtl_TextEncoding eCharset); rtl_TextEncoding eCharset);
bool clearPassword(); bool clearPassword();
bool setPassword( bool setPassword(
OUString const & rThePassword, OUString const & rThePassword,
EncodeMechanism eMechanism, rtl_TextEncoding eCharset); rtl_TextEncoding eCharset);
// Host and Port: // Host and Port:
@@ -1082,7 +1079,7 @@ private:
bool setHost( bool setHost(
OUString const & rTheHost, OUString const & rTheHost,
EncodeMechanism eMechanism, rtl_TextEncoding eCharset); rtl_TextEncoding eCharset);
// Path: // Path:
@@ -1109,11 +1106,6 @@ private:
TOOLS_DLLPRIVATE SubString getSegment( TOOLS_DLLPRIVATE SubString getSegment(
sal_Int32 nIndex, bool bIgnoreFinalSlash) const; sal_Int32 nIndex, bool bIgnoreFinalSlash) const;
bool insertName(
OUString const & rTheName, bool bOctets, bool bAppendFinalSlash,
sal_Int32 nIndex, bool bIgnoreFinalSlash, EncodeMechanism eMechanism,
rtl_TextEncoding eCharset);
// Query: // Query:
bool clearQuery(); bool clearQuery();
@@ -1235,7 +1227,7 @@ INetURLObject::smartRel2Abs(OUString const & rTheRelURIRef,
FSysStyle eStyle) const FSysStyle eStyle) const
{ {
INetURLObject aTheAbsURIRef; INetURLObject aTheAbsURIRef;
convertRelToAbs(rTheRelURIRef, false, aTheAbsURIRef, rWasAbsolute, convertRelToAbs(rTheRelURIRef, aTheAbsURIRef, rWasAbsolute,
eMechanism, eCharset, bIgnoreFragment, true, eMechanism, eCharset, bIgnoreFragment, true,
bRelativeNonURIs, eStyle); bRelativeNonURIs, eStyle);
return aTheAbsURIRef; return aTheAbsURIRef;
@@ -1247,7 +1239,7 @@ inline bool INetURLObject::GetNewAbsURL(OUString const & rTheRelURIRef,
{ {
INetURLObject aTheAbsURIRef; INetURLObject aTheAbsURIRef;
bool bWasAbsolute; bool bWasAbsolute;
if (!convertRelToAbs(rTheRelURIRef, false, aTheAbsURIRef, bWasAbsolute, if (!convertRelToAbs(rTheRelURIRef, aTheAbsURIRef, bWasAbsolute,
WAS_ENCODED, RTL_TEXTENCODING_UTF8, false/*bIgnoreFragment*/, false, false, WAS_ENCODED, RTL_TEXTENCODING_UTF8, false/*bIgnoreFragment*/, false, false,
FSYS_DETECT)) FSYS_DETECT))
return false; return false;
@@ -1299,26 +1291,16 @@ inline bool INetURLObject::SetPass(OUString const & rThePassword)
{ {
return rThePassword.isEmpty() ? return rThePassword.isEmpty() ?
clearPassword() : clearPassword() :
setPassword(rThePassword, WAS_ENCODED, RTL_TEXTENCODING_UTF8); setPassword(rThePassword, RTL_TEXTENCODING_UTF8);
} }
inline bool INetURLObject::SetUserAndPass(OUString const & rTheUser, inline bool INetURLObject::SetUserAndPass(OUString const & rTheUser,
OUString const & rThePassword) OUString const & rThePassword)
{ {
return setUser(rTheUser, WAS_ENCODED, RTL_TEXTENCODING_UTF8) return setUser(rTheUser, RTL_TEXTENCODING_UTF8)
&& (rThePassword.isEmpty() ? && (rThePassword.isEmpty() ?
clearPassword() : clearPassword() :
setPassword(rThePassword, WAS_ENCODED, RTL_TEXTENCODING_UTF8)); setPassword(rThePassword, RTL_TEXTENCODING_UTF8));
}
inline bool INetURLObject::insertName(OUString const & rTheName,
bool bAppendFinalSlash,
sal_Int32 nIndex,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
return insertName(rTheName, false, bAppendFinalSlash, nIndex,
true/*bIgnoreFinalSlash*/, eMechanism, eCharset);
} }
inline bool INetURLObject::SetParam(OUString const & rTheQuery, inline bool INetURLObject::SetParam(OUString const & rTheQuery,

View File

@@ -1470,7 +1470,6 @@ void INetURLObject::changeScheme(INetProtocol eTargetScheme) {
} }
bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef, bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
bool bOctets,
INetURLObject & rTheAbsURIRef, INetURLObject & rTheAbsURIRef,
bool & rWasAbsolute, bool & rWasAbsolute,
EncodeMechanism eMechanism, EncodeMechanism eMechanism,
@@ -1533,7 +1532,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
q, pEnd - q, '\\'); q, pEnd - q, '\\');
sal_Unicode const * qe = n == -1 ? pEnd : q + n; sal_Unicode const * qe = n == -1 ? pEnd : q + n;
if (parseHostOrNetBiosName( if (parseHostOrNetBiosName(
q, qe, bOctets, ENCODE_ALL, RTL_TEXTENCODING_DONTKNOW, q, qe, false/*bOctets*/, ENCODE_ALL, RTL_TEXTENCODING_DONTKNOW,
true, nullptr)) true, nullptr))
{ {
bFSys = true; // 1st bFSys = true; // 1st
@@ -1542,7 +1541,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
if (bFSys) if (bFSys)
{ {
INetURLObject aNewURI; INetURLObject aNewURI;
aNewURI.setAbsURIRef(rTheRelURIRef, bOctets, eMechanism, aNewURI.setAbsURIRef(rTheRelURIRef, false/*bOctets*/, eMechanism,
eCharset, true, eStyle); eCharset, true, eStyle);
if (!aNewURI.HasError()) if (!aNewURI.HasError())
{ {
@@ -1649,7 +1648,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
{ {
EscapeType eEscapeType; EscapeType eEscapeType;
sal_uInt32 nUTF32 sal_uInt32 nUTF32
= getUTF32(p, pEnd, bOctets, eMechanism, = getUTF32(p, pEnd, false/*bOctets*/, eMechanism,
eCharset, eEscapeType); eCharset, eEscapeType);
if (eEscapeType == ESCAPE_NO) if (eEscapeType == ESCAPE_NO)
{ {
@@ -1661,7 +1660,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
break; break;
} }
} }
appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, bOctets, appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, false/*bOctets*/,
PART_VISIBLE, eCharset, true); PART_VISIBLE, eCharset, true);
} }
} }
@@ -1704,7 +1703,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
{ {
EscapeType eEscapeType; EscapeType eEscapeType;
sal_uInt32 nUTF32 sal_uInt32 nUTF32
= getUTF32(p, pEnd, bOctets, eMechanism, eCharset, eEscapeType); = getUTF32(p, pEnd, false/*bOctets*/, eMechanism, eCharset, eEscapeType);
if (eEscapeType == ESCAPE_NO) if (eEscapeType == ESCAPE_NO)
{ {
if (nUTF32 == nFragmentDelimiter) if (nUTF32 == nFragmentDelimiter)
@@ -1715,7 +1714,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
else if (nUTF32 == nSegmentDelimiter) else if (nUTF32 == nSegmentDelimiter)
nUTF32 = '/'; nUTF32 = '/';
} }
appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, bOctets, ePart, appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, false/*bOctets*/, ePart,
eCharset, true); eCharset, true);
} }
} }
@@ -1797,9 +1796,9 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
{ {
EscapeType eEscapeType; EscapeType eEscapeType;
sal_uInt32 nUTF32 sal_uInt32 nUTF32
= getUTF32(p, pEnd, bOctets, eMechanism, = getUTF32(p, pEnd, false/*bOctets*/, eMechanism,
eCharset, eEscapeType); eCharset, eEscapeType);
appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, bOctets, ePart, appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, false/*bOctets*/, ePart,
eCharset, true); eCharset, true);
} }
if (p != pEnd && *p == nSegmentDelimiter) if (p != pEnd && *p == nSegmentDelimiter)
@@ -1813,8 +1812,8 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
{ {
EscapeType eEscapeType; EscapeType eEscapeType;
sal_uInt32 nUTF32 sal_uInt32 nUTF32
= getUTF32(p, pEnd, bOctets, eMechanism, eCharset, eEscapeType); = getUTF32(p, pEnd, false/*bOctets*/, eMechanism, eCharset, eEscapeType);
appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, bOctets, ePart, appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, false/*bOctets*/, ePart,
eCharset, true); eCharset, true);
} }
@@ -1843,8 +1842,8 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
{ {
EscapeType eEscapeType; EscapeType eEscapeType;
sal_uInt32 nUTF32 sal_uInt32 nUTF32
= getUTF32(p, pEnd, bOctets, eMechanism, eCharset, eEscapeType); = getUTF32(p, pEnd, false/*bOctets*/, eMechanism, eCharset, eEscapeType);
appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, bOctets, appendUCS4(aSynAbsURIRef, nUTF32, eEscapeType, false/*bOctets*/,
PART_VISIBLE, eCharset, true); PART_VISIBLE, eCharset, true);
} }
} }
@@ -1886,7 +1885,7 @@ bool INetURLObject::convertAbsToRel(OUString const & rTheAbsURIRef,
// ref: // ref:
INetURLObject aSubject; INetURLObject aSubject;
bool bWasAbsolute; bool bWasAbsolute;
if (!convertRelToAbs(rTheAbsURIRef, false/*bOctets*/, aSubject, bWasAbsolute, if (!convertRelToAbs(rTheAbsURIRef, aSubject, bWasAbsolute,
eEncodeMechanism, eCharset, false, false, false, eEncodeMechanism, eCharset, false, false, false,
eStyle)) eStyle))
{ {
@@ -2226,7 +2225,6 @@ INetURLObject::SubString INetURLObject::getAuthority() const
} }
bool INetURLObject::setUser(OUString const & rTheUser, bool INetURLObject::setUser(OUString const & rTheUser,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset) rtl_TextEncoding eCharset)
{ {
if ( if (
@@ -2237,7 +2235,7 @@ bool INetURLObject::setUser(OUString const & rTheUser,
} }
OUString aNewUser(encodeText(rTheUser, false/*bOctets*/, PART_USER_PASSWORD, OUString aNewUser(encodeText(rTheUser, false/*bOctets*/, PART_USER_PASSWORD,
eMechanism, eCharset, false)); WAS_ENCODED, eCharset, false));
sal_Int32 nDelta; sal_Int32 nDelta;
if (m_aUser.isPresent()) if (m_aUser.isPresent())
nDelta = m_aUser.set(m_aAbsURIRef, aNewUser); nDelta = m_aUser.set(m_aAbsURIRef, aNewUser);
@@ -2287,13 +2285,12 @@ bool INetURLObject::clearPassword()
} }
bool INetURLObject::setPassword(OUString const & rThePassword, bool INetURLObject::setPassword(OUString const & rThePassword,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset) rtl_TextEncoding eCharset)
{ {
if (!getSchemeInfo().m_bPassword) if (!getSchemeInfo().m_bPassword)
return false; return false;
OUString aNewAuth(encodeText(rThePassword, false/*bOctets*/, PART_USER_PASSWORD, OUString aNewAuth(encodeText(rThePassword, false/*bOctets*/, PART_USER_PASSWORD,
eMechanism, eCharset, false)); WAS_ENCODED, eCharset, false));
sal_Int32 nDelta; sal_Int32 nDelta;
if (m_aAuth.isPresent()) if (m_aAuth.isPresent())
nDelta = m_aAuth.set(m_aAbsURIRef, aNewAuth); nDelta = m_aAuth.set(m_aAbsURIRef, aNewAuth);
@@ -2825,7 +2822,6 @@ bool INetURLObject::parseHostOrNetBiosName(
} }
bool INetURLObject::setHost(OUString const & rTheHost, bool INetURLObject::setHost(OUString const & rTheHost,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset) rtl_TextEncoding eCharset)
{ {
if (!getSchemeInfo().m_bHost) if (!getSchemeInfo().m_bHost)
@@ -2856,7 +2852,7 @@ bool INetURLObject::setHost(OUString const & rTheHost,
} }
if (!parseHostOrNetBiosName( if (!parseHostOrNetBiosName(
aSynHost.getStr(), aSynHost.getStr() + aSynHost.getLength(), aSynHost.getStr(), aSynHost.getStr() + aSynHost.getLength(),
false/*bOctets*/, eMechanism, eCharset, bNetBiosName, &aSynHost)) false/*bOctets*/, WAS_ENCODED, eCharset, bNetBiosName, &aSynHost))
return false; return false;
sal_Int32 nDelta = m_aHost.set(m_aAbsURIRef, aSynHost.makeStringAndClear()); sal_Int32 nDelta = m_aHost.set(m_aAbsURIRef, aSynHost.makeStringAndClear());
m_aPort += nDelta; m_aPort += nDelta;
@@ -3154,8 +3150,7 @@ bool INetURLObject::appendSegment(OUString const & rTheSegment,
EncodeMechanism eMechanism, EncodeMechanism eMechanism,
rtl_TextEncoding eCharset) rtl_TextEncoding eCharset)
{ {
return insertName(rTheSegment, false/*bOctets*/, false, LAST_SEGMENT, true, return insertName(rTheSegment, false, LAST_SEGMENT, eMechanism, eCharset);
eMechanism, eCharset);
} }
INetURLObject::SubString INetURLObject::getSegment(sal_Int32 nIndex, INetURLObject::SubString INetURLObject::getSegment(sal_Int32 nIndex,
@@ -3204,9 +3199,8 @@ INetURLObject::SubString INetURLObject::getSegment(sal_Int32 nIndex,
pSegEnd - pSegBegin); pSegEnd - pSegBegin);
} }
bool INetURLObject::insertName(OUString const & rTheName, bool bOctets, bool INetURLObject::insertName(OUString const & rTheName,
bool bAppendFinalSlash, sal_Int32 nIndex, bool bAppendFinalSlash, sal_Int32 nIndex,
bool bIgnoreFinalSlash,
EncodeMechanism eMechanism, EncodeMechanism eMechanism,
rtl_TextEncoding eCharset) rtl_TextEncoding eCharset)
{ {
@@ -3225,7 +3219,7 @@ bool INetURLObject::insertName(OUString const & rTheName, bool bOctets,
if (nIndex == LAST_SEGMENT) if (nIndex == LAST_SEGMENT)
{ {
pPrefixEnd = pPathEnd; pPrefixEnd = pPathEnd;
if (bIgnoreFinalSlash && pPrefixEnd > pPathBegin && if (pPrefixEnd > pPathBegin &&
pPrefixEnd[-1] == '/') pPrefixEnd[-1] == '/')
{ {
--pPrefixEnd; --pPrefixEnd;
@@ -3241,14 +3235,14 @@ bool INetURLObject::insertName(OUString const & rTheName, bool bOctets,
(pPathBegin == pPathEnd && bAppendFinalSlash); (pPathBegin == pPathEnd && bAppendFinalSlash);
pSuffixBegin = pSuffixBegin =
(pPathEnd - pPathBegin == 1 && *pPathBegin == '/' && (pPathEnd - pPathBegin == 1 && *pPathBegin == '/' &&
!bAppendFinalSlash && bIgnoreFinalSlash) !bAppendFinalSlash)
? pPathEnd : pPathBegin; ? pPathEnd : pPathBegin;
} }
else else
{ {
pPrefixEnd = pPathBegin; pPrefixEnd = pPathBegin;
sal_Unicode const * pEnd = pPathEnd; sal_Unicode const * pEnd = pPathEnd;
if (bIgnoreFinalSlash && pEnd > pPathBegin && pEnd[-1] == '/') if (pEnd > pPathBegin && pEnd[-1] == '/')
--pEnd; --pEnd;
bool bSkip = pPrefixEnd < pEnd && *pPrefixEnd == '/'; bool bSkip = pPrefixEnd < pEnd && *pPrefixEnd == '/';
bInsertSlash = false; bInsertSlash = false;
@@ -3280,7 +3274,7 @@ bool INetURLObject::insertName(OUString const & rTheName, bool bOctets,
OUStringBuffer aNewPath; OUStringBuffer aNewPath;
aNewPath.append(pPathBegin, pPrefixEnd - pPathBegin); aNewPath.append(pPathBegin, pPrefixEnd - pPathBegin);
aNewPath.append('/'); aNewPath.append('/');
aNewPath.append(encodeText(rTheName, bOctets, PART_PCHAR, aNewPath.append(encodeText(rTheName, false/*bOctets*/, PART_PCHAR,
eMechanism, eCharset, true)); eMechanism, eCharset, true));
if (bInsertSlash) { if (bInsertSlash) {
aNewPath.append('/'); aNewPath.append('/');
@@ -3842,7 +3836,7 @@ OUString INetURLObject::GetAbsURL(OUString const & rTheBaseURIRef,
INetURLObject aTheAbsURIRef; INetURLObject aTheAbsURIRef;
bool bWasAbsolute; bool bWasAbsolute;
return INetURLObject(rTheBaseURIRef, eEncodeMechanism, eCharset). return INetURLObject(rTheBaseURIRef, eEncodeMechanism, eCharset).
convertRelToAbs(rTheRelURIRef, false, aTheAbsURIRef, convertRelToAbs(rTheRelURIRef, aTheAbsURIRef,
bWasAbsolute, eEncodeMechanism, bWasAbsolute, eEncodeMechanism,
eCharset, bIgnoreFragment, false, eCharset, bIgnoreFragment, false,
false, FSYS_DETECT) false, FSYS_DETECT)
@@ -4147,7 +4141,6 @@ OUString INetURLObject::getExtension(sal_Int32 nIndex,
bool INetURLObject::setExtension(OUString const & rTheExtension, bool INetURLObject::setExtension(OUString const & rTheExtension,
sal_Int32 nIndex, bool bIgnoreFinalSlash, sal_Int32 nIndex, bool bIgnoreFinalSlash,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset) rtl_TextEncoding eCharset)
{ {
SubString aSegment(getSegment(nIndex, bIgnoreFinalSlash)); SubString aSegment(getSegment(nIndex, bIgnoreFinalSlash));
@@ -4175,7 +4168,7 @@ bool INetURLObject::setExtension(OUString const & rTheExtension,
aNewPath.append(pPathBegin, pExtension - pPathBegin); aNewPath.append(pPathBegin, pExtension - pPathBegin);
aNewPath.append('.'); aNewPath.append('.');
aNewPath.append(encodeText(rTheExtension, false, PART_PCHAR, aNewPath.append(encodeText(rTheExtension, false, PART_PCHAR,
eMechanism, eCharset, true)); WAS_ENCODED, eCharset, true));
aNewPath.append(p, pPathEnd - p); aNewPath.append(p, pPathEnd - p);
return setPath(aNewPath.makeStringAndClear(), NOT_CANONIC, return setPath(aNewPath.makeStringAndClear(), NOT_CANONIC,

View File

@@ -561,22 +561,19 @@ bool StringRangeEnumerator::checkValue( sal_Int32 i_nValue, const std::set< sal_
return true; 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; bool bSuccess = true;
if( bSequence ) if( bSequence )
{ {
if( bMayAdjust ) if( i_nFirst < mnMin )
{ i_nFirst = mnMin;
if( i_nFirst < mnMin ) if( i_nFirst > mnMax )
i_nFirst = mnMin; i_nFirst = mnMax;
if( i_nFirst > mnMax ) if( i_nLast < mnMin )
i_nFirst = mnMax; i_nLast = mnMin;
if( i_nLast < mnMin ) if( i_nLast > mnMax )
i_nLast = mnMin; i_nLast = mnMax;
if( i_nLast > mnMax )
i_nLast = mnMax;
}
if( checkValue( i_nFirst ) && checkValue( i_nLast ) ) if( checkValue( i_nFirst ) && checkValue( i_nLast ) )
{ {
maSequence.push_back( Range( i_nFirst, i_nLast ) ); maSequence.push_back( Range( i_nFirst, i_nLast ) );
@@ -614,7 +611,7 @@ bool StringRangeEnumerator::insertJoinedRanges(
return true; return true;
if( nCount == 1 ) 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++ ) for( size_t i = 0; i < nCount - 1; i++ )
{ {
@@ -626,7 +623,7 @@ bool StringRangeEnumerator::insertJoinedRanges(
else if( nFirst < nLast ) nFirst++; else if( nFirst < nLast ) nFirst++;
} }
insertRange( nFirst, nLast, nFirst != nLast, true ); insertRange( nFirst, nLast, nFirst != nLast );
} }
return true; return true;