diff options
author | Steffen Grund <Steffen.Grund@sun.com> | 2010-03-04 14:25:05 +0100 |
---|---|---|
committer | Steffen Grund <Steffen.Grund@sun.com> | 2010-03-04 14:25:05 +0100 |
commit | 81c3196a00d8a780e01ad399f05d26f2dc719613 (patch) | |
tree | be25c0b3e98e5a5acf70350de8a7f1e4c9cb0619 /tools/source/fsys/urlobj.cxx | |
parent | 9c0d0aedc5ec47e3701183478c30a9996f1d0637 (diff) |
#161491# further support for own generic schemes
Diffstat (limited to 'tools/source/fsys/urlobj.cxx')
-rw-r--r-- | tools/source/fsys/urlobj.cxx | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index b742e6c9a074..b127f33e5d0a 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -1605,7 +1605,23 @@ bool INetURLObject::convertRelToAbs(rtl::OUString const & rTheRelURIRef, STATE_DONE }; rtl::OUStringBuffer aSynAbsURIRef; - aSynAbsURIRef.appendAscii(getSchemeInfo().m_pScheme); + // make sure that the scheme is copied for generic schemes: getSchemeInfo().m_pScheme + // is empty ("") in that case, so take the scheme from m_aAbsURIRef + if (m_eScheme != INET_PROT_GENERIC) + { + aSynAbsURIRef.appendAscii(getSchemeInfo().m_pScheme); + } + else + { + sal_Unicode const * pSchemeBegin + = m_aAbsURIRef.getStr(); + sal_Unicode const * pSchemeEnd = pSchemeBegin; + while (pSchemeEnd[0] != ':') + { + ++pSchemeEnd; + } + aSynAbsURIRef.append(pSchemeBegin, pSchemeEnd - pSchemeBegin); + } aSynAbsURIRef.append(sal_Unicode(':')); sal_Char cEscapePrefix = getEscapePrefix(); @@ -3814,7 +3830,27 @@ INetURLObject::getAbbreviated( OSL_ENSURE(rStringWidth.is(), "specification violation"); sal_Char cEscapePrefix = getEscapePrefix(); rtl::OUStringBuffer aBuffer; - aBuffer.appendAscii(getSchemeInfo().m_pScheme); + // make sure that the scheme is copied for generic schemes: getSchemeInfo().m_pScheme + // is empty ("") in that case, so take the scheme from m_aAbsURIRef + if (m_eScheme != INET_PROT_GENERIC) + { + aBuffer.appendAscii(getSchemeInfo().m_pScheme); + } + else + { + if (m_aAbsURIRef) + { + sal_Unicode const * pSchemeBegin + = m_aAbsURIRef.getStr(); + sal_Unicode const * pSchemeEnd = pSchemeBegin; + + while (pSchemeEnd[0] != ':') + { + ++pSchemeEnd; + } + aBuffer.append(pSchemeBegin, pSchemeEnd - pSchemeBegin); + } + } aBuffer.append(static_cast< sal_Unicode >(':')); bool bAuthority = getSchemeInfo().m_bAuthority; sal_Unicode const * pCoreBegin |