summaryrefslogtreecommitdiff
path: root/include/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-02-25 13:54:41 +0200
committerNoel Grandin <noel@peralex.com>2015-03-02 08:59:17 +0200
commit63dc0b4fc067f611f6f235ebef4488c47c3a8137 (patch)
treeca68d8d25de6b7a5be11612b3ad19c65ceb794a8 /include/tools
parent1e4f2cc1a0fa75cc4d32a8a818c3fed906e099d3 (diff)
convert INETMSG_MIME_VERSION constants to enum class
Change-Id: Iaa2518f7f491f4e0e316dcb8695cf1275ffe8149
Diffstat (limited to 'include/tools')
-rw-r--r--include/tools/inetmsg.hxx31
1 files changed, 17 insertions, 14 deletions
diff --git a/include/tools/inetmsg.hxx b/include/tools/inetmsg.hxx
index 1134ef3ebcb4..6bf03d2f5956 100644
--- a/include/tools/inetmsg.hxx
+++ b/include/tools/inetmsg.hxx
@@ -106,13 +106,16 @@ enum class InetMessageField
NUMHDR = 16,
};
-#define INETMSG_MIME_VERSION 0
-#define INETMSG_MIME_CONTENT_DESCRIPTION 1
-#define INETMSG_MIME_CONTENT_DISPOSITION 2
-#define INETMSG_MIME_CONTENT_ID 3
-#define INETMSG_MIME_CONTENT_TYPE 4
-#define INETMSG_MIME_CONTENT_TRANSFER_ENCODING 5
-#define INETMSG_MIME_NUMHDR 6
+enum class InetMessageMime
+{
+ VERSION = 0,
+ CONTENT_DESCRIPTION = 1,
+ CONTENT_DISPOSITION = 2,
+ CONTENT_ID = 3,
+ CONTENT_TYPE = 4,
+ CONTENT_TRANSFER_ENCODING = 5,
+ NUMHDR = 6,
+};
enum INetMessageContainerType
{
@@ -141,7 +144,7 @@ class TOOLS_DLLPUBLIC INetMIMEMessage
::std::map<InetMessageField, sal_uIntPtr> m_nRFC822Index;
- sal_uIntPtr m_nMIMEIndex[INETMSG_MIME_NUMHDR];
+ ::std::map<InetMessageMime, sal_uIntPtr> m_nMIMEIndex;
INetMIMEMessage* pParent;
INetMIMEMessgeList_impl aChildren;
OString m_aBoundary;
@@ -361,35 +364,35 @@ public:
void SetMIMEVersion (const OUString& rVersion);
OUString GetMIMEVersion() const
{
- return GetHeaderValue (m_nMIMEIndex[INETMSG_MIME_VERSION]);
+ return GetHeaderValue (m_nMIMEIndex.at(InetMessageMime::VERSION));
}
OUString GetContentDescription() const
{
- return GetHeaderValue (m_nMIMEIndex[INETMSG_MIME_CONTENT_DESCRIPTION]);
+ return GetHeaderValue (m_nMIMEIndex.at(InetMessageMime::CONTENT_DESCRIPTION));
}
void SetContentDisposition (const OUString& rDisposition);
OUString GetContentDisposition() const
{
- return GetHeaderValue (m_nMIMEIndex[INETMSG_MIME_CONTENT_DISPOSITION]);
+ return GetHeaderValue (m_nMIMEIndex.at(InetMessageMime::CONTENT_DISPOSITION));
}
OUString GetContentID() const
{
- return GetHeaderValue (m_nMIMEIndex[INETMSG_MIME_CONTENT_ID]);
+ return GetHeaderValue (m_nMIMEIndex.at(InetMessageMime::CONTENT_ID));
}
void SetContentType (const OUString& rType);
OUString GetContentType() const
{
- return GetHeaderValue (m_nMIMEIndex[INETMSG_MIME_CONTENT_TYPE]);
+ return GetHeaderValue (m_nMIMEIndex.at(InetMessageMime::CONTENT_TYPE));
}
void SetContentTransferEncoding (const OUString& rEncoding);
OUString GetContentTransferEncoding() const
{
- return GetHeaderValue (m_nMIMEIndex[INETMSG_MIME_CONTENT_TRANSFER_ENCODING]);
+ return GetHeaderValue (m_nMIMEIndex.at(InetMessageMime::CONTENT_TRANSFER_ENCODING));
}
OUString GetDefaultContentType ();