summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2011-07-13 22:32:17 +0200
committerThomas Arnhold <thomas@arnhold.org>2011-07-14 08:19:57 +0200
commit9a5c6464357a3b820409241960dbed95ac25a7df (patch)
tree0361bcf135610be62d720434cdc5f1d162b88acf /tools
parentcallcatcher: cleanup INetIStream (diff)
downloadcore-9a5c6464357a3b820409241960dbed95ac25a7df.tar.gz
core-9a5c6464357a3b820409241960dbed95ac25a7df.zip
callcatcher: cleanup INetMIMEMessage
Diffstat (limited to 'tools')
-rw-r--r--tools/inc/tools/inetmsg.hxx3
-rw-r--r--tools/source/inet/inetmsg.cxx201
2 files changed, 0 insertions, 204 deletions
diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx
index cfdd78153e47..60e0a8f0cb0d 100644
--- a/tools/inc/tools/inetmsg.hxx
+++ b/tools/inc/tools/inetmsg.hxx
@@ -500,7 +500,6 @@ public:
return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_DISPOSITION]);
}
- void SetContentID (const UniString& rID);
UniString GetContentID (void) const
{
return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_ID]);
@@ -547,8 +546,6 @@ public:
INetMessageContainerType eType = INETMSG_MULTIPART_MIXED);
sal_Bool AttachChild (
INetMIMEMessage& rChildMsg, sal_Bool bOwner = sal_True);
- sal_Bool DetachChild (
- sal_uIntPtr nIndex, INetMIMEMessage& rChildMsg) const;
/** Stream operators.
*/
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index 235d6fd4d20b..8a390b3f060b 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -1035,14 +1035,6 @@ void INetMIMEMessage::SetContentDisposition (const String& rDisposition)
m_nIndex[INETMSG_MIME_CONTENT_DISPOSITION]);
}
-void INetMIMEMessage::SetContentID (const String& rID)
-{
- SetHeaderField_Impl (
- INetMIME::HEADER_FIELD_TEXT,
- MIMEHDR(INETMSG_MIME_CONTENT_ID), rID,
- m_nIndex[INETMSG_MIME_CONTENT_ID]);
-}
-
void INetMIMEMessage::SetContentType (const String& rType)
{
SetHeaderField_Impl (
@@ -1182,199 +1174,6 @@ sal_Bool INetMIMEMessage::AttachChild (
}
/*
- * DetachChild.
- */
-sal_Bool INetMIMEMessage::DetachChild (
- sal_uIntPtr nIndex, INetMIMEMessage& rChildMsg) const
-{
- if (IsContainer())
- {
- // Check document stream.
- if (GetDocumentLB() == NULL) return sal_False;
- SvStream *pDocStrm = new SvStream (GetDocumentLB());
-
- // Initialize message buffer.
- char pMsgBuffer[1024];
- char *pMsgRead, *pMsgWrite;
- pMsgRead = pMsgWrite = pMsgBuffer;
-
- // Initialize message parser stream.
- INetMIMEMessageStream *pMsgStrm = NULL;
-
- // Check for "multipart/uvw" or "message/xyz".
- if (IsMultipart())
- {
- // Multipart message body. Initialize multipart delimiters.
- ByteString aDelim ("--");
- aDelim += GetMultipartBoundary();
- ByteString aClose = aDelim;
- aClose += "--";
-
- // Initialize line buffer.
- SvMemoryStream aLineBuf;
-
- // Initialize control variables.
- INetMessageStreamState eState = INETMSG_EOL_SCR;
- int nCurIndex = -1;
-
- // Go!
- while (nCurIndex < (int)(nIndex + 1))
- {
- if ((pMsgRead - pMsgWrite) > 0)
- {
- // Bytes still in buffer.
- if (eState == INETMSG_EOL_FCR)
- {
- // Check for 2nd line break character.
- if ((*pMsgWrite == '\r') || (*pMsgWrite == '\n'))
- aLineBuf << *pMsgWrite++;
-
- // Check current index.
- if (nCurIndex == (int)nIndex)
- {
- // Found requested part.
- if (pMsgStrm == NULL)
- {
- // Create message parser stream.
- pMsgStrm = new INetMIMEMessageStream;
- pMsgStrm->SetTargetMessage (&rChildMsg);
- }
-
- // Put message down-stream.
- int status = pMsgStrm->Write (
- (const sal_Char *) aLineBuf.GetData(), aLineBuf.Tell());
- if (status != INETSTREAM_STATUS_OK)
- {
- // Cleanup.
- delete pDocStrm;
- delete pMsgStrm;
-
- // Finish.
- return (!(status == INETSTREAM_STATUS_OK));
- }
- }
-
- // Reset to <Begin-of-Line>.
- aLineBuf.Seek (STREAM_SEEK_TO_BEGIN);
- eState = INETMSG_EOL_SCR;
- }
- else if ((*pMsgWrite == '\r') || (*pMsgWrite == '\n'))
- {
- /*
- * Found any line break character.
- * Compare buffered line with part/close delimiter.
- * Increment current part index upon match.
- */
- sal_uInt16 nLen = (sal_uInt16)(aLineBuf.Tell() & 0xffff);
- if (nLen == aDelim.Len())
- {
- if (aDelim.CompareTo ((const sal_Char *) aLineBuf.GetData(), nLen)
- == COMPARE_EQUAL) nCurIndex++;
- }
- else if (nLen == aClose.Len())
- {
- if (aClose.CompareTo ((const sal_Char *) aLineBuf.GetData(), nLen)
- == COMPARE_EQUAL) nCurIndex++;
- }
- aLineBuf << *pMsgWrite++;
- eState = INETMSG_EOL_FCR;
- }
- else
- {
- // Insert into line buffer.
- aLineBuf << *pMsgWrite;
- }
- }
- else
- {
- // Buffer empty. Reset to <Begin-of-Buffer>.
- pMsgRead = pMsgWrite = pMsgBuffer;
-
- // Read document stream.
- sal_uIntPtr nRead = pDocStrm->Read (
- pMsgBuffer, sizeof (pMsgBuffer));
- if (nRead > 0)
- {
- // Set read pointer.
- pMsgRead += nRead;
- }
- else
- {
- // Premature end.
- if (pMsgStrm)
- {
- // Assume end of requested part.
- nCurIndex++;
- }
- else
- {
- // Requested part not found.
- delete pDocStrm;
- return sal_False;
- }
- }
- }
- } // while (nCurIndex < (nIndex + 1))
- }
- else
- {
- // Encapsulated message body. Create message parser stream.
- pMsgStrm = new INetMIMEMessageStream;
- pMsgStrm->SetTargetMessage (&rChildMsg);
-
- // Initialize control variables.
- INetMessageStreamState eState = INETMSG_EOL_BEGIN;
-
- // Go.
- while (eState == INETMSG_EOL_BEGIN)
- {
- if ((pMsgRead - pMsgWrite) > 0)
- {
- // Bytes still in buffer. Put message down-stream.
- int status = pMsgStrm->Write (
- pMsgBuffer, (pMsgRead - pMsgWrite));
- if (status != INETSTREAM_STATUS_OK)
- {
- // Cleanup.
- delete pDocStrm;
- delete pMsgStrm;
-
- // Finish.
- return (!(status == INETSTREAM_STATUS_ERROR));
- }
- pMsgWrite = pMsgBuffer + (pMsgRead - pMsgWrite);
- }
- else
- {
- // Buffer empty. Reset to <Begin-of-Buffer>.
- pMsgRead = pMsgWrite = pMsgBuffer;
-
- // Read document stream.
- sal_uIntPtr nRead = pDocStrm->Read (
- pMsgBuffer, sizeof (pMsgBuffer));
- if (nRead > 0)
- {
- // Set read pointer.
- pMsgRead += nRead;
- }
- else
- {
- // Mark we're done.
- eState = INETMSG_EOL_DONE;
- }
- }
- } // while (eState == INETMSG_EOL_BEGIN)
- }
-
- // Done.
- if (pDocStrm) delete pDocStrm;
- if (pMsgStrm) delete pMsgStrm;
- return sal_True;
- }
- return sal_False;
-}
-
-/*
* operator<<
*/
SvStream& INetMIMEMessage::operator<< (SvStream& rStrm) const