diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-06-21 01:29:47 +1000 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-06-21 04:37:53 +0200 |
commit | e7e87ad179d5d7383d1b6be58f624ba302c16d73 (patch) | |
tree | 4bc7e5904c50278cc7fa4dae900008bce750c4c1 /tools/source | |
parent | cb28e48bfd7e8727797435dc05bdfe1652fb34f0 (diff) |
Extend INetURLObject::setName and drop INetURLObject::SetName
Change-Id: I488313eeb363d2a9344d6bc801900d5b1f913020
Reviewed-on: https://gerrit.libreoffice.org/74463
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'tools/source')
-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); |