Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
1e4f2cc1
Kaydet (Commit)
1e4f2cc1
authored
Şub 25, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert INETMSG_RFC822_ constants to enum class
Change-Id: Ib7b52fa3d0d3a675c662893d603f5e66172a2581
üst
6aeaa963
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
73 deletions
+79
-73
inetmsg.hxx
include/tools/inetmsg.hxx
+40
-33
inetmsg.cxx
tools/source/inet/inetmsg.cxx
+39
-40
No files found.
include/tools/inetmsg.hxx
Dosyayı görüntüle @
1e4f2cc1
...
...
@@ -27,6 +27,7 @@
#include <tools/stream.hxx>
#include <vector>
#include <map>
class
DateTime
;
...
...
@@ -81,23 +82,29 @@ public:
typedef
::
std
::
vector
<
INetMessageHeader
*
>
HeaderList_impl
;
#define INETMSG_RFC822_BCC 0
#define INETMSG_RFC822_CC 1
#define INETMSG_RFC822_COMMENTS 2
#define INETMSG_RFC822_DATE 3
#define INETMSG_RFC822_FROM 4
#define INETMSG_RFC822_IN_REPLY_TO 5
#define INETMSG_RFC822_KEYWORDS 6
#define INETMSG_RFC822_MESSAGE_ID 7
#define INETMSG_RFC822_REFERENCES 8
#define INETMSG_RFC822_REPLY_TO 9
#define INETMSG_RFC822_RETURN_PATH 10
#define INETMSG_RFC822_SENDER 11
#define INETMSG_RFC822_SUBJECT 12
#define INETMSG_RFC822_TO 13
#define INETMSG_RFC822_X_MAILER 14
#define INETMSG_RFC822_RETURN_RECEIPT_TO 15
#define INETMSG_RFC822_NUMHDR 16
/**
RFC822 fields
*/
enum
class
InetMessageField
{
BCC
=
0
,
CC
=
1
,
COMMENTS
=
2
,
DATE
=
3
,
FROM
=
4
,
IN_REPLY_TO
=
5
,
KEYWORDS
=
6
,
MESSAGE_ID
=
7
,
REFERENCES
=
8
,
REPLY_TO
=
9
,
RETURN_PATH
=
10
,
SENDER
=
11
,
SUBJECT
=
12
,
TO
=
13
,
X_MAILER
=
14
,
RETURN_RECEIPT_TO
=
15
,
NUMHDR
=
16
,
};
#define INETMSG_MIME_VERSION 0
#define INETMSG_MIME_CONTENT_DESCRIPTION 1
...
...
@@ -132,7 +139,7 @@ class TOOLS_DLLPUBLIC INetMIMEMessage
void
ListCleanup_Impl
();
void
ListCopy
(
const
INetMIMEMessage
&
rMsg
);
sal_uIntPtr
m_nRFC822Index
[
INETMSG_RFC822_NUMHDR
]
;
::
std
::
map
<
InetMessageField
,
sal_uIntPtr
>
m_nRFC822Index
;
sal_uIntPtr
m_nMIMEIndex
[
INETMSG_MIME_NUMHDR
];
INetMIMEMessage
*
pParent
;
...
...
@@ -249,105 +256,105 @@ public:
OUString
GetBCC
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_BCC
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
BCC
)
,
INetMIME
::
HEADER_FIELD_ADDRESS
);
}
OUString
GetCC
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_CC
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
CC
)
,
INetMIME
::
HEADER_FIELD_ADDRESS
);
}
OUString
GetComments
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_COMMENTS
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
COMMENTS
)
,
INetMIME
::
HEADER_FIELD_TEXT
);
}
OUString
GetDate
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_DATE
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
DATE
)
,
INetMIME
::
HEADER_FIELD_STRUCTURED
);
}
OUString
GetFrom
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_FROM
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
FROM
)
,
INetMIME
::
HEADER_FIELD_ADDRESS
);
}
OUString
GetInReplyTo
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_IN_REPLY_TO
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
REPLY_TO
)
,
INetMIME
::
HEADER_FIELD_ADDRESS
);
// ??? MESSAGE_ID ???
}
OUString
GetKeywords
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_KEYWORDS
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
KEYWORDS
)
,
INetMIME
::
HEADER_FIELD_PHRASE
);
}
OUString
GetMessageID
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_MESSAGE_ID
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
MESSAGE_ID
)
,
INetMIME
::
HEADER_FIELD_MESSAGE_ID
);
}
OUString
GetReferences
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_REFERENCES
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
REFERENCES
)
,
INetMIME
::
HEADER_FIELD_ADDRESS
);
}
OUString
GetReplyTo
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_REPLY_TO
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
REPLY_TO
)
,
INetMIME
::
HEADER_FIELD_ADDRESS
);
}
OUString
GetReturnPath
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_RETURN_PATH
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
RETURN_PATH
)
,
INetMIME
::
HEADER_FIELD_ADDRESS
);
}
OUString
GetReturnReceiptTo
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_RETURN_RECEIPT_TO
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
RETURN_RECEIPT_TO
)
,
INetMIME
::
HEADER_FIELD_ADDRESS
);
}
OUString
GetSender
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_SENDER
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
SENDER
)
,
INetMIME
::
HEADER_FIELD_ADDRESS
);
}
OUString
GetSubject
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_SUBJECT
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
SUBJECT
)
,
INetMIME
::
HEADER_FIELD_TEXT
);
}
OUString
GetTo
()
const
{
return
GetHeaderValue_Impl
(
m_nRFC822Index
[
INETMSG_RFC822_TO
]
,
m_nRFC822Index
.
at
(
InetMessageField
::
TO
)
,
INetMIME
::
HEADER_FIELD_TEXT
);
}
...
...
tools/source/inet/inetmsg.cxx
Dosyayı görüntüle @
1e4f2cc1
...
...
@@ -29,6 +29,7 @@
#include <comphelper/string.hxx>
#include <stdio.h>
#include <map>
inline
bool
ascii_isDigit
(
sal_Unicode
ch
)
{
...
...
@@ -87,24 +88,24 @@ void INetMIMEMessage::SetHeaderField_Impl (
INetMessageHeader
(
rName
,
aSink
.
takeBuffer
()),
rnIndex
);
}
static
const
char
*
ImplINetRFC822MessageHeaderData
[]
=
static
std
::
map
<
InetMessageField
,
const
char
*>
ImplINetRFC822MessageHeaderData
=
{
"BCC"
,
"CC"
,
"Comments"
,
"Date"
,
"From"
,
"In-Reply-To"
,
"Keywords"
,
"Message-ID"
,
"References"
,
"Reply-To"
,
"Return-Path"
,
"Subject"
,
"Sender"
,
"To"
,
"X-Mailer"
,
"Return-Receipt-To"
{
InetMessageField
::
BCC
,
"BCC"
}
,
{
InetMessageField
::
CC
,
"CC"
}
,
{
InetMessageField
::
COMMENTS
,
"Comments"
}
,
{
InetMessageField
::
DATE
,
"Date"
}
,
{
InetMessageField
::
FROM
,
"From"
}
,
{
InetMessageField
::
IN_REPLY_TO
,
"In-Reply-To"
}
,
{
InetMessageField
::
KEYWORDS
,
"Keywords"
}
,
{
InetMessageField
::
MESSAGE_ID
,
"Message-ID"
}
,
{
InetMessageField
::
REFERENCES
,
"References"
}
,
{
InetMessageField
::
REPLY_TO
,
"Reply-To"
}
,
{
InetMessageField
::
RETURN_PATH
,
"Return-Path"
}
,
{
InetMessageField
::
SUBJECT
,
"Subject"
}
,
{
InetMessageField
::
SENDER
,
"Sender"
}
,
{
InetMessageField
::
TO
,
"To"
}
,
{
InetMessageField
::
X_MAILER
,
"X-Mailer"
}
,
{
InetMessageField
::
RETURN_RECEIPT_TO
,
"Return-Receipt-To"
}
,
};
enum
_ImplINetRFC822MessageHeaderState
...
...
@@ -282,7 +283,7 @@ sal_uIntPtr INetMIMEMessage::SetRFC822HeaderField (
const
sal_Char
*
pStop
=
pData
+
aName
.
getLength
()
+
1
;
const
sal_Char
*
check
=
""
;
sal_uIntPtr
nIdx
=
CONTAINER_APPEND
;
InetMessageField
nIdx
=
static_cast
<
InetMessageField
>
(
CONTAINER_APPEND
)
;
int
eState
=
INETMSG_RFC822_BEGIN
;
int
eOkState
=
INETMSG_RFC822_OK
;
...
...
@@ -298,7 +299,7 @@ sal_uIntPtr INetMIMEMessage::SetRFC822HeaderField (
{
case
'b'
:
check
=
"cc"
;
nIdx
=
I
NETMSG_RFC822_
BCC
;
nIdx
=
I
netMessageField
::
BCC
;
break
;
case
'c'
:
...
...
@@ -307,27 +308,27 @@ sal_uIntPtr INetMIMEMessage::SetRFC822HeaderField (
case
'd'
:
check
=
"ate"
;
nIdx
=
I
NETMSG_RFC822_
DATE
;
nIdx
=
I
netMessageField
::
DATE
;
break
;
case
'f'
:
check
=
"rom"
;
nIdx
=
I
NETMSG_RFC822_
FROM
;
nIdx
=
I
netMessageField
::
FROM
;
break
;
case
'i'
:
check
=
"n-reply-to"
;
nIdx
=
I
NETMSG_RFC822_
IN_REPLY_TO
;
nIdx
=
I
netMessageField
::
IN_REPLY_TO
;
break
;
case
'k'
:
check
=
"eywords"
;
nIdx
=
I
NETMSG_RFC822_
KEYWORDS
;
nIdx
=
I
netMessageField
::
KEYWORDS
;
break
;
case
'm'
:
check
=
"essage-id"
;
nIdx
=
I
NETMSG_RFC822_
MESSAGE_ID
;
nIdx
=
I
netMessageField
::
MESSAGE_ID
;
break
;
case
'r'
:
...
...
@@ -341,7 +342,7 @@ sal_uIntPtr INetMIMEMessage::SetRFC822HeaderField (
case
't'
:
check
=
"o"
;
nIdx
=
I
NETMSG_RFC822_
TO
;
nIdx
=
I
netMessageField
::
TO
;
break
;
case
'x'
:
...
...
@@ -364,12 +365,12 @@ sal_uIntPtr INetMIMEMessage::SetRFC822HeaderField (
{
case
'f'
:
check
=
"erences"
;
nIdx
=
I
NETMSG_RFC822_
REFERENCES
;
nIdx
=
I
netMessageField
::
REFERENCES
;
break
;
case
'p'
:
check
=
"ly-to"
;
nIdx
=
I
NETMSG_RFC822_
REPLY_TO
;
nIdx
=
I
netMessageField
::
REPLY_TO
;
break
;
case
't'
:
...
...
@@ -392,12 +393,12 @@ sal_uIntPtr INetMIMEMessage::SetRFC822HeaderField (
{
case
'p'
:
check
=
"ath"
;
nIdx
=
I
NETMSG_RFC822_
RETURN_PATH
;
nIdx
=
I
netMessageField
::
RETURN_PATH
;
break
;
case
'r'
:
check
=
"eceipt-to"
;
nIdx
=
I
NETMSG_RFC822_
RETURN_RECEIPT_TO
;
nIdx
=
I
netMessageField
::
RETURN_RECEIPT_TO
;
break
;
default
:
...
...
@@ -415,7 +416,7 @@ sal_uIntPtr INetMIMEMessage::SetRFC822HeaderField (
{
case
'm'
:
check
=
"ailer"
;
nIdx
=
I
NETMSG_RFC822_
X_MAILER
;
nIdx
=
I
netMessageField
::
X_MAILER
;
break
;
default
:
...
...
@@ -433,12 +434,12 @@ sal_uIntPtr INetMIMEMessage::SetRFC822HeaderField (
{
case
'c'
:
check
=
""
;
nIdx
=
I
NETMSG_RFC822_
CC
;
nIdx
=
I
netMessageField
::
CC
;
break
;
case
'o'
:
check
=
"mments"
;
nIdx
=
I
NETMSG_RFC822_
COMMENTS
;
nIdx
=
I
netMessageField
::
COMMENTS
;
break
;
default
:
...
...
@@ -456,12 +457,12 @@ sal_uIntPtr INetMIMEMessage::SetRFC822HeaderField (
{
case
'e'
:
check
=
"nder"
;
nIdx
=
I
NETMSG_RFC822_
SENDER
;
nIdx
=
I
netMessageField
::
SENDER
;
break
;
case
'u'
:
check
=
"bject"
;
nIdx
=
I
NETMSG_RFC822_
SUBJECT
;
nIdx
=
I
netMessageField
::
SUBJECT
;
break
;
default
:
...
...
@@ -532,8 +533,8 @@ INetMIMEMessage::INetMIMEMessage()
pParent
(
NULL
),
bHeaderParsed
(
false
)
{
for
(
sal_uInt16
i
=
0
;
i
<
INETMSG_RFC822_NUMHDR
;
i
++
)
m_nRFC822Index
[
i
]
=
CONTAINER_ENTRY_NOTFOUND
;
for
(
sal_uInt16
i
=
0
;
i
<
static_cast
<
int
>
(
InetMessageField
::
NUMHDR
)
;
i
++
)
m_nRFC822Index
[
static_cast
<
InetMessageField
>
(
i
)
]
=
CONTAINER_ENTRY_NOTFOUND
;
for
(
sal_uInt16
i
=
0
;
i
<
INETMSG_MIME_NUMHDR
;
i
++
)
m_nMIMEIndex
[
i
]
=
CONTAINER_ENTRY_NOTFOUND
;
}
...
...
@@ -545,8 +546,7 @@ INetMIMEMessage::INetMIMEMessage (const INetMIMEMessage& rMsg)
pParent
(
NULL
)
{
ListCopy
(
rMsg
);
for
(
sal_uInt16
i
=
0
;
i
<
INETMSG_RFC822_NUMHDR
;
i
++
)
m_nRFC822Index
[
i
]
=
rMsg
.
m_nRFC822Index
[
i
];
m_nRFC822Index
=
rMsg
.
m_nRFC822Index
;
CopyImp
(
rMsg
);
}
...
...
@@ -559,8 +559,7 @@ INetMIMEMessage& INetMIMEMessage::operator= (
m_aDocName
=
rMsg
.
m_aDocName
;
m_xDocLB
=
rMsg
.
m_xDocLB
;
ListCopy
(
rMsg
);
for
(
sal_uInt16
i
=
0
;
i
<
INETMSG_RFC822_NUMHDR
;
i
++
)
m_nRFC822Index
[
i
]
=
rMsg
.
m_nRFC822Index
[
i
];
m_nRFC822Index
=
rMsg
.
m_nRFC822Index
;
CleanupImp
();
CopyImp
(
rMsg
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment