summaryrefslogtreecommitdiff
path: root/svl/source/misc/adrparse.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svl/source/misc/adrparse.cxx')
-rw-r--r--svl/source/misc/adrparse.cxx138
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: */