diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-08-28 15:28:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-08-28 17:45:05 +0200 |
commit | b82489382e18494694530874480774e2bb29830e (patch) | |
tree | f5013bb451cf444d1e26f72f7fcf3a1fb17c9642 /tools/source | |
parent | a1a401acaafee0b1f154d368a247d74d61c62191 (diff) |
INetURLObject::setFSysPath is unused now
...after 056e1fff2ed232f2a50db933fbade1c71c0c2a65 "Simplify code removing the
last segment from a URL"
Change-Id: I3abe84ada119356191d8df9c0a8ee62dcf18d108
Reviewed-on: https://gerrit.libreoffice.org/78228
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/fsys/urlobj.cxx | 171 |
1 files changed, 0 insertions, 171 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 980619ea5d26..37f3791a4d30 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -4250,177 +4250,6 @@ bool INetURLObject::removeFinalSlash() return setPath(aNewPath, EncodeMechanism::NotCanonical, RTL_TEXTENCODING_UTF8); } -bool INetURLObject::setFSysPath(OUString const & rFSysPath, - FSysStyle eStyle) -{ - sal_Unicode const * pFSysBegin = rFSysPath.getStr(); - sal_Unicode const * pFSysEnd = pFSysBegin + rFSysPath.getLength(); - - switch (((eStyle & FSysStyle::Vos) ? 1 : 0) - + ((eStyle & FSysStyle::Unix) ? 1 : 0) - + ((eStyle & FSysStyle::Dos) ? 1 : 0)) - { - case 0: - return false; - - case 1: - break; - - default: - if (eStyle & FSysStyle::Vos - && pFSysEnd - pFSysBegin >= 2 - && pFSysBegin[0] == '/' - && pFSysBegin[1] == '/') - { - if (pFSysEnd - pFSysBegin >= 3 - && pFSysBegin[2] == '.' - && (pFSysEnd - pFSysBegin == 3 || pFSysBegin[3] == '/')) - { - eStyle = FSysStyle::Vos; // Production T1 - break; - } - - sal_Unicode const * p = pFSysBegin + 2; - OUString aHost; - if (parseHost(p, pFSysEnd, aHost) - && (p == pFSysEnd || *p == '/')) - { - eStyle = FSysStyle::Vos; // Production T2 - break; - } - } - - if (eStyle & FSysStyle::Dos - && pFSysEnd - pFSysBegin >= 2 - && pFSysBegin[0] == '\\' - && pFSysBegin[1] == '\\') - { - sal_Unicode const * p = pFSysBegin + 2; - OUString aHost; - if (parseHost(p, pFSysEnd, aHost) - && (p == pFSysEnd || *p == '\\')) - { - eStyle = FSysStyle::Dos; // Production T3 - break; - } - } - - if (eStyle & FSysStyle::Dos - && pFSysEnd - pFSysBegin >= 2 - && rtl::isAsciiAlpha(pFSysBegin[0]) - && pFSysBegin[1] == ':' - && (pFSysEnd - pFSysBegin == 2 - || pFSysBegin[2] == '/' - || pFSysBegin[2] == '\\')) - { - eStyle = FSysStyle::Dos; // Productions T4, T5 - break; - } - - if (!(eStyle & (FSysStyle::Unix | FSysStyle::Dos))) - return false; - - eStyle = guessFSysStyleByCounting(pFSysBegin, pFSysEnd, eStyle); - // Production T6 - break; - } - - OUStringBuffer aSynAbsURIRef("file://"); - - switch (eStyle) - { - case FSysStyle::Vos: - { - sal_Unicode const * p = pFSysBegin; - if (pFSysEnd - p < 2 || *p++ != '/' || *p++ != '/') - return false; - if (p != pFSysEnd && *p == '.' - && (pFSysEnd - p == 1 || p[1] == '/')) - ++p; - for (; p != pFSysEnd; ++p) - switch (*p) - { - case '#': - case '%': - appendEscape(aSynAbsURIRef, *p); - break; - - default: - aSynAbsURIRef.append(*p); - break; - } - break; - } - - case FSysStyle::Unix: - { - sal_Unicode const * p = pFSysBegin; - if (p != pFSysEnd && *p != '/') - return false; - for (; p != pFSysEnd; ++p) - switch (*p) - { - case '|': - case '#': - case '%': - appendEscape(aSynAbsURIRef, *p); - break; - - default: - aSynAbsURIRef.append(*p); - break; - } - break; - } - - case FSysStyle::Dos: - { - sal_uInt32 nAltDelimiter = 0x80000000; - sal_Unicode const * p = pFSysBegin; - if (pFSysEnd - p >= 3 && p[0] == '\\' && p[1] == '\\') - p += 2; - else - { - aSynAbsURIRef.append('/'); - if (pFSysEnd - p >= 2 - && rtl::isAsciiAlpha(p[0]) - && p[1] == ':' - && (pFSysEnd - p == 2 || p[2] == '\\' || p[2] == '/')) - nAltDelimiter = '/'; - } - for (; p != pFSysEnd; ++p) - if (*p == '\\' || *p == nAltDelimiter) - aSynAbsURIRef.append('/'); - else - switch (*p) - { - case '/': - case '#': - case '%': - appendEscape(aSynAbsURIRef, *p); - break; - - default: - aSynAbsURIRef.append(*p); - break; - } - break; - } - - default: - OSL_ASSERT(false); - break; - } - - INetURLObject aTemp(aSynAbsURIRef.makeStringAndClear(), EncodeMechanism::WasEncoded, - RTL_TEXTENCODING_UTF8); - if (aTemp.HasError()) - return false; - - *this = aTemp; - return true; -} - OUString INetURLObject::getFSysPath(FSysStyle eStyle, sal_Unicode * pDelimiter) const { |