diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-07-21 18:56:16 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-07-21 18:56:16 +0200 |
commit | a233dac0653f3f3054f7ad2da114ed989747e89a (patch) | |
tree | bf1e11438321c06125a94308649c496648061ccb /svl/source/misc/adrparse.cxx | |
parent | not link cairocanvas against stl anymore (diff) | |
parent | callcatcher: clean up Dir and DirEntry (diff) | |
download | core-a233dac0653f3f3054f7ad2da114ed989747e89a.tar.gz core-a233dac0653f3f3054f7ad2da114ed989747e89a.zip |
resyncing to master
Diffstat (limited to 'svl/source/misc/adrparse.cxx')
-rw-r--r-- | svl/source/misc/adrparse.cxx | 138 |
1 files changed, 0 insertions, 138 deletions
diff --git a/svl/source/misc/adrparse.cxx b/svl/source/misc/adrparse.cxx index e0087aa5220d..b6aa9d9e6ff2 100644 --- a/svl/source/misc/adrparse.cxx +++ b/svl/source/misc/adrparse.cxx @@ -780,142 +780,4 @@ SvAddressParser::~SvAddressParser() m_aRest.clear(); } -//============================================================================ -// static -bool SvAddressParser::createRFC822Mailbox(String const & rPhrase, - String const & rAddrSpec, - String & rMailbox) -{ - String aTheAddrSpec; - sal_Unicode const * p = rAddrSpec.GetBuffer(); - sal_Unicode const * pEnd = p + rAddrSpec.Len(); - {for (bool bSegment = false;;) - { - p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd); - if (p == pEnd) - return false; - if (bSegment) - { - sal_Unicode c = *p++; - if (c == '@') - break; - else if (c != '.') - return false; - aTheAddrSpec += '.'; - p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd); - if (p == pEnd) - return false; - } - else - bSegment = true; - if (*p == '"') - { - aTheAddrSpec += *p++; - for (;;) - { - if (INetMIME::startsWithLineFolding(p, pEnd)) - p += 2; - if (p == pEnd) - return false; - if (*p == '"') - break; - if (*p == '\x0D' || (*p == '\\' && ++p == pEnd) - || !INetMIME::isUSASCII(*p)) - return false; - if (INetMIME::needsQuotedStringEscape(*p)) - aTheAddrSpec += '\\'; - aTheAddrSpec += *p++; - } - aTheAddrSpec += *p++; - } - else if (INetMIME::isAtomChar(*p)) - while (p != pEnd && INetMIME::isAtomChar(*p)) - aTheAddrSpec += *p++; - else - return false; - }} - aTheAddrSpec += '@'; - {for (bool bSegment = false;;) - { - p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd); - if (p == pEnd) - { - if (bSegment) - break; - else - return false; - } - if (bSegment) - { - if (*p++ != '.') - return false; - aTheAddrSpec += '.'; - p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd); - if (p == pEnd) - return false; - } - else - bSegment = true; - if (*p == '[') - { - aTheAddrSpec += *p++; - for (;;) - { - if (INetMIME::startsWithLineFolding(p, pEnd)) - p += 2; - if (p == pEnd) - return false; - if (*p == ']') - break; - if (*p == '\x0D' || *p == '[' || (*p == '\\' && ++p == pEnd) - || !INetMIME::isUSASCII(*p)) - return false; - if (*p >= '[' && *p <= ']') - aTheAddrSpec += '\\'; - aTheAddrSpec += *p++; - } - aTheAddrSpec += *p++; - } - else if (INetMIME::isAtomChar(*p)) - while (p != pEnd && INetMIME::isAtomChar(*p)) - aTheAddrSpec += *p++; - else - return false; - }} - - if (rPhrase.Len() == 0) - rMailbox = aTheAddrSpec; - else - { - bool bQuotedString = false; - p = rPhrase.GetBuffer(); - pEnd = p + rPhrase.Len(); - for (;p != pEnd; ++p) - if (!(INetMIME::isAtomChar(*p))) - { - bQuotedString = true; - break; - } - String aTheMailbox; - if (bQuotedString) - { - aTheMailbox = '"'; - for (p = rPhrase.GetBuffer(); p != pEnd; ++p) - { - if (INetMIME::needsQuotedStringEscape(*p)) - aTheMailbox += '\\'; - aTheMailbox += *p; - } - aTheMailbox += '"'; - } - else - aTheMailbox = rPhrase; - aTheMailbox.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" <")); - aTheMailbox += aTheAddrSpec; - aTheMailbox += '>'; - rMailbox = aTheMailbox; - } - return true; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |