#161491# fixed handling of generic schemes
This commit is contained in:
parent
abea9e8269
commit
f2363e3b4f
1 changed files with 12 additions and 25 deletions
|
@ -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;
|
||||
|
@ -1235,7 +1229,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;
|
||||
|
@ -1343,7 +1337,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))
|
||||
|
@ -1355,7 +1349,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,
|
||||
|
@ -1372,9 +1365,8 @@ bool INetURLObject::setAbsURIRef(rtl::OUString const & rTheAbsURIRef,
|
|||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (pHostPortBegin == pPort)
|
||||
if (pHostPortBegin == pPort && pPort != pHostPortEnd)
|
||||
{
|
||||
setInvalid();
|
||||
return false;
|
||||
|
@ -2167,11 +2159,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;
|
||||
|
@ -2894,7 +2882,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(
|
||||
|
@ -2911,7 +2898,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;
|
||||
}
|
||||
|
@ -2990,7 +2977,6 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
|
|||
break;
|
||||
|
||||
case INET_PROT_FILE:
|
||||
case INET_PROT_VND_SUN_STAR_WFS:
|
||||
{
|
||||
if (bSkippedInitialSlash)
|
||||
aTheSynPath.append(sal_Unicode('/'));
|
||||
|
@ -3403,7 +3389,6 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
|
|||
if (aTheSynPath.getLength() == 0)
|
||||
return false;
|
||||
break;
|
||||
|
||||
default:
|
||||
OSL_ASSERT(false);
|
||||
break;
|
||||
|
@ -3439,6 +3424,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;
|
||||
}
|
||||
}
|
||||
|
@ -4012,7 +4001,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
|
||||
|
@ -4167,7 +4155,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(
|
||||
|
@ -4188,7 +4175,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme,
|
|||
break;
|
||||
|
||||
default:
|
||||
if (aSynHost.getLength() == 0)
|
||||
if (aSynHost.getLength() == 0 && nThePort != 0)
|
||||
{
|
||||
setInvalid();
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue