diff options
Diffstat (limited to 'tools/source/fsys/urlobj.cxx')
-rw-r--r-- | tools/source/fsys/urlobj.cxx | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 7ee92a3382b6..980619ea5d26 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -3999,7 +3999,8 @@ OUString INetURLObject::getName(sal_Int32 nIndex, bool bIgnoreFinalSlash, return decode(pSegBegin, p, eMechanism, eCharset); } -bool INetURLObject::setName(OUString const & rTheName) +bool INetURLObject::setName(OUString const& rTheName, EncodeMechanism eMechanism, + rtl_TextEncoding eCharset) { SubString aSegment(getSegment(LAST_SEGMENT, true)); if (!aSegment.isPresent()) @@ -4020,8 +4021,7 @@ bool INetURLObject::setName(OUString const & rTheName) OUStringBuffer aNewPath; aNewPath.append(pPathBegin, pSegBegin - pPathBegin); - aNewPath.append(encodeText(rTheName, PART_PCHAR, - EncodeMechanism::WasEncoded, RTL_TEXTENCODING_UTF8, true)); + aNewPath.append(encodeText(rTheName, PART_PCHAR, eMechanism, eCharset, true)); aNewPath.append(p, pPathEnd - p); return setPath(aNewPath.makeStringAndClear(), EncodeMechanism::NotCanonical, @@ -4919,17 +4919,6 @@ OUString INetURLObject::GetBase() const return getBase(LAST_SEGMENT, true, DecodeMechanism::WithCharset); } -void INetURLObject::SetName(OUString const & rTheName, - EncodeMechanism eMechanism, - rtl_TextEncoding eCharset) -{ - INetURLObject aTemp(*this); - if (aTemp.removeSegment() - && aTemp.insertName(rTheName, false, LAST_SEGMENT, eMechanism, - eCharset)) - *this = aTemp; -} - void INetURLObject::SetExtension(OUString const & rTheExtension) { setExtension(rTheExtension, LAST_SEGMENT, false); |