diff options
author | Steffen Grund <Steffen.Grund@sun.com> | 2010-01-19 12:50:52 +0100 |
---|---|---|
committer | Steffen Grund <Steffen.Grund@sun.com> | 2010-01-19 12:50:52 +0100 |
commit | bd261abc608e982ccd5307eecd64618ba9caf966 (patch) | |
tree | 20bc99528f9f6df57c81e3e689455434ef1da1f4 /tools | |
parent | df23161a602841c7a5cbcc69ab1263a7b173151c (diff) |
#161491# fixed handling of generic schemes
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/fsys/urlobj.cxx | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index e0f711bd2883..0360f63da87e 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -194,11 +194,6 @@ using namespace com::sun; name = *(escaped / alphanum / "!" / "$" / "'" / "(" / ")" / "*" / "+" / "," / "-" / "." / ":" / ";" / "=" / "?" / "@" / "_" / "~" - ; prvate (see RFC 1738, RFC 2396) - vnd-sun-star-wfs-url = "VND.SUN.STAR.WFS://" [host / "LOCALHOST"] ["/" segment *("/" segment)] - segment = *pchar - - ; private vnd-sun-star-hier-url = "VND.SUN.STAR.HIER:" ["//"reg_name] *("/" *pchar) reg_name = 1*(escaped / alphanum / "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / "-" / "." / ":" / ";" / "=" / "@" / "_" / "~") @@ -406,8 +401,6 @@ static INetURLObject::SchemeInfo const aSchemeInfoMap[INET_PROT_END] false, false }, { "out", "out://", 0, true, false, false, false, false, false, false, false }, - { "vnd.sun.star.wfs", "vnd.sun.star.wfs://", 0, true, false, false, - false, true, true, true, false }, { "vnd.sun.star.hier", "vnd.sun.star.hier:", 0, true, false, false, false, false, false, true, false }, { "vim", "vim://", 0, true, true, false, true, false, false, true, @@ -432,6 +425,7 @@ static INetURLObject::SchemeInfo const aSchemeInfoMap[INET_PROT_END] false, false, false, false, false }, { "vnd.sun.star.tdoc", "vnd.sun.star.tdoc:", 0, false, false, false, false, false, false, true, false }, +// { "", "", 0, true, false, false, false, true, true, true, false }, { "", "", 0, false, false, false, false, false, false, false, false }, { "smb", "smb://", 139, true, true, false, true, true, true, true, true } }; @@ -881,7 +875,7 @@ bool INetURLObject::setAbsURIRef(rtl::OUString const & rTheAbsURIRef, // Parse //<user>;AUTH=<auth>@<host>:<port> or // //<user>:<password>@<host>:<port> or // //<reg_name> - if (getSchemeInfo().m_bAuthority) + if (m_eScheme == INET_PROT_GENERIC || getSchemeInfo().m_bAuthority) { sal_Unicode const * pUserInfoBegin = 0; sal_Unicode const * pUserInfoEnd = 0; @@ -1233,7 +1227,7 @@ bool INetURLObject::setAbsURIRef(rtl::OUString const & rTheAbsURIRef, pUserInfoBegin = pAuthority; pUserInfoEnd = pPos; } - else if (getSchemeInfo().m_bHost) + else if (m_eScheme == INET_PROT_GENERIC || getSchemeInfo().m_bHost) { pHostPortBegin = pAuthority; pHostPortEnd = pPos; @@ -1341,7 +1335,7 @@ bool INetURLObject::setAbsURIRef(rtl::OUString const & rTheAbsURIRef, if (pHostPortBegin) { sal_Unicode const * pPort = pHostPortEnd; - if (getSchemeInfo().m_bPort && pHostPortBegin < pHostPortEnd) + if ( (m_eScheme == INET_PROT_GENERIC || getSchemeInfo().m_bPort) && pHostPortBegin < pHostPortEnd ) { sal_Unicode const * p1 = pHostPortEnd - 1; while (p1 > pHostPortBegin && INetMIME::isDigit(*p1)) @@ -1353,7 +1347,6 @@ bool INetURLObject::setAbsURIRef(rtl::OUString const & rTheAbsURIRef, switch (m_eScheme) { case INET_PROT_FILE: - case INET_PROT_VND_SUN_STAR_WFS: // If the host equals "LOCALHOST" (unencoded and ignoring // case), turn it into an empty host: if (INetMIME::equalIgnoreCase(pHostPortBegin, pPort, @@ -1370,9 +1363,8 @@ bool INetURLObject::setAbsURIRef(rtl::OUString const & rTheAbsURIRef, return false; } break; - default: - if (pHostPortBegin == pPort) + if (pHostPortBegin == pPort && pPort != pHostPortEnd) { setInvalid(); return false; @@ -2165,11 +2157,7 @@ INetURLObject::getPrefix(sal_Unicode const *& rBegin, { "vnd.sun.star.tdoc:", 0, INET_PROT_VND_SUN_STAR_TDOC, PrefixInfo::OFFICIAL }, { "vnd.sun.star.webdav:", 0, INET_PROT_VND_SUN_STAR_WEBDAV, - PrefixInfo::OFFICIAL }, - { "vnd.sun.star.wfs:", 0, INET_PROT_VND_SUN_STAR_WFS, - PrefixInfo::OFFICIAL }, - { "wfs:", "vnd.sun.star.wfs:", INET_PROT_VND_SUN_STAR_WFS, - PrefixInfo::ALIAS } }; + PrefixInfo::OFFICIAL } }; PrefixInfo const * pFirst = aMap + 1; PrefixInfo const * pLast = aMap + sizeof aMap / sizeof (PrefixInfo) - 1; PrefixInfo const * pMatch = 0; @@ -2892,7 +2880,6 @@ bool INetURLObject::setHost(rtl::OUString const & rTheHost, bool bOctets, switch (m_eScheme) { case INET_PROT_FILE: - case INET_PROT_VND_SUN_STAR_WFS: { rtl::OUString sTemp(aSynHost); if (sTemp.equalsIgnoreAsciiCaseAsciiL( @@ -2909,7 +2896,7 @@ bool INetURLObject::setHost(rtl::OUString const & rTheHost, bool bOctets, break; default: - if (aSynHost.getLength() == 0) + if (aSynHost.getLength() == 0 && m_aPort.isPresent()) return false; break; } @@ -2988,7 +2975,6 @@ bool INetURLObject::parsePath(INetProtocol eScheme, break; case INET_PROT_FILE: - case INET_PROT_VND_SUN_STAR_WFS: { if (bSkippedInitialSlash) aTheSynPath.append(sal_Unicode('/')); @@ -3401,7 +3387,6 @@ bool INetURLObject::parsePath(INetProtocol eScheme, if (aTheSynPath.getLength() == 0) return false; break; - default: OSL_ASSERT(false); break; @@ -3437,6 +3422,10 @@ bool INetURLObject::checkHierarchical() const { false, "INetURLObject::checkHierarchical vnd.sun.star.expand"); return true; } else { + // set hierarchical for generic schemes + if (m_eScheme == INET_PROT_GENERIC) { + return true; + } return getSchemeInfo().m_bHierarchical; } } @@ -4010,7 +3999,6 @@ bool INetURLObject::operator ==(INetURLObject const & rObject) const switch (m_eScheme) { case INET_PROT_FILE: - case INET_PROT_VND_SUN_STAR_WFS: { // If the URL paths of two file URLs only differ in that one has a // final '/' and the other has not, take the two paths as @@ -4165,7 +4153,6 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme, switch (m_eScheme) { case INET_PROT_FILE: - case INET_PROT_VND_SUN_STAR_WFS: { rtl::OUString sTemp(aSynHost); if (sTemp.equalsIgnoreAsciiCaseAsciiL( @@ -4186,7 +4173,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme, break; default: - if (aSynHost.getLength() == 0) + if (aSynHost.getLength() == 0 && nThePort != 0) { setInvalid(); return false; |