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
c4927a1b
Kaydet (Commit)
c4927a1b
authored
Kas 16, 2011
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ByteString->rtl::OString[Buffer]
üst
7bab4645
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
109 deletions
+92
-109
inetmsg.hxx
tools/inc/tools/inetmsg.hxx
+1
-11
inetmsg.cxx
tools/source/inet/inetmsg.cxx
+55
-62
errinf.cxx
tools/source/ref/errinf.cxx
+36
-36
No files found.
tools/inc/tools/inetmsg.hxx
Dosyayı görüntüle @
c4927a1b
...
...
@@ -80,26 +80,16 @@ public:
friend
SvStream
&
operator
<<
(
SvStream
&
rStrm
,
const
INetMessageHeader
&
rHdr
)
{
#ifdef ENABLE_BYTESTRING_STREAM_OPERATORS
rStrm
<<
rHdr
.
m_aName
;
rStrm
<<
rHdr
.
m_aValue
;
#else
rStrm
.
WriteByteString
(
rHdr
.
m_aName
);
rStrm
.
WriteByteString
(
rHdr
.
m_aValue
);
#endif
return
rStrm
;
}
friend
SvStream
&
operator
>>
(
SvStream
&
rStrm
,
INetMessageHeader
&
rHdr
)
{
#ifdef ENABLE_BYTESTRING_STREAM_OPERATORS
rStrm
>>
rHdr
.
m_aName
;
rStrm
>>
rHdr
.
m_aValue
;
#else
rStrm
.
ReadByteString
(
rHdr
.
m_aName
);
rStrm
.
ReadByteString
(
rHdr
.
m_aValue
);
#endif
return
rStrm
;
}
};
...
...
@@ -160,7 +150,7 @@ protected:
void
SetHeaderField_Impl
(
INetMIME
::
HeaderFieldType
eType
,
const
ByteString
&
rName
,
const
rtl
::
OString
&
rName
,
const
UniString
&
rValue
,
sal_uIntPtr
&
rnIndex
);
...
...
tools/source/inet/inetmsg.cxx
Dosyayı görüntüle @
c4927a1b
...
...
@@ -110,7 +110,7 @@ void INetMessage::ListCopy (const INetMessage &rMsg)
*/
void
INetMessage
::
SetHeaderField_Impl
(
INetMIME
::
HeaderFieldType
eType
,
const
ByteString
&
rName
,
const
rtl
::
OString
&
rName
,
const
UniString
&
rValue
,
sal_uIntPtr
&
rnIndex
)
{
...
...
@@ -194,33 +194,33 @@ namespace
{
struct
ImplINetRFC822MessageHeaderDataImpl
{
const
Byte
String
*
operator
()()
const
rtl
::
O
String
*
operator
()()
{
static
const
Byte
String
_ImplINetRFC822MessageHeaderData
[]
=
static
const
rtl
::
O
String
_ImplINetRFC822MessageHeaderData
[]
=
{
ByteString
(
"BCC"
),
ByteString
(
"CC"
),
ByteString
(
"Comments"
),
ByteString
(
"Date"
),
ByteString
(
"From"
),
ByteString
(
"In-Reply-To"
),
ByteString
(
"Keywords"
),
ByteString
(
"Message-ID"
),
ByteString
(
"References"
),
ByteString
(
"Reply-To"
),
ByteString
(
"Return-Path"
),
ByteString
(
"Subject"
),
ByteString
(
"Sender"
),
ByteString
(
"To"
),
ByteString
(
"X-Mailer"
),
ByteString
(
"Return-Receipt-To"
)
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"BCC"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"CC"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Comments"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Date"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"From"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"In-Reply-To"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Keywords"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Message-ID"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"References"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Reply-To"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Return-Path"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Subject"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Sender"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"To"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"X-Mailer"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Return-Receipt-To"
)
)
};
return
&
_ImplINetRFC822MessageHeaderData
[
0
];
}
};
struct
ImplINetRFC822MessageHeaderData
:
public
rtl
::
StaticAggregate
<
const
Byte
String
,
ImplINetRFC822MessageHeaderDataImpl
>
{};
:
public
rtl
::
StaticAggregate
<
const
rtl
::
O
String
,
ImplINetRFC822MessageHeaderDataImpl
>
{};
}
#define HDR(n) ImplINetRFC822MessageHeaderData::get()[(n)]
...
...
@@ -305,28 +305,28 @@ static const sal_Char *months[12] =
/*
* ParseDateField and local helper functions.
*/
static
sal_uInt16
ParseNumber
(
const
Byte
String
&
rStr
,
sal_uInt16
&
nIndex
)
static
sal_uInt16
ParseNumber
(
const
rtl
::
O
String
&
rStr
,
sal_uInt16
&
nIndex
)
{
sal_uInt16
n
=
nIndex
;
while
((
n
<
rStr
.
Len
())
&&
ascii_isDigit
(
rStr
.
GetChar
(
n
)
))
n
++
;
while
((
n
<
rStr
.
getLength
())
&&
ascii_isDigit
(
rStr
[
n
]
))
n
++
;
rtl
::
OString
aNum
(
rStr
.
Copy
(
nIndex
,
(
n
-
nIndex
)));
rtl
::
OString
aNum
(
rStr
.
copy
(
nIndex
,
(
n
-
nIndex
)));
nIndex
=
n
;
return
(
sal_uInt16
)(
aNum
.
toInt32
());
}
static
sal_uInt16
ParseMonth
(
const
Byte
String
&
rStr
,
sal_uInt16
&
nIndex
)
static
sal_uInt16
ParseMonth
(
const
rtl
::
O
String
&
rStr
,
sal_uInt16
&
nIndex
)
{
sal_uInt16
n
=
nIndex
;
while
((
n
<
rStr
.
Len
())
&&
ascii_isLetter
(
rStr
.
GetChar
(
n
)
))
n
++
;
while
((
n
<
rStr
.
getLength
())
&&
ascii_isLetter
(
rStr
[
n
]
))
n
++
;
ByteString
aMonth
(
rStr
.
Copy
(
nIndex
,
3
));
rtl
::
OString
aMonth
(
rStr
.
copy
(
nIndex
,
3
));
nIndex
=
n
;
sal_uInt16
i
;
for
(
i
=
0
;
i
<
12
;
i
++
)
if
(
aMonth
.
CompareIgnoreCaseToAscii
(
months
[
i
])
==
0
)
break
;
if
(
aMonth
.
equalsIgnoreAsciiCase
(
months
[
i
])
)
break
;
return
(
i
+
1
);
}
...
...
@@ -446,9 +446,9 @@ sal_Bool INetRFC822Message::ParseDateField (
sal_uIntPtr
INetRFC822Message
::
SetHeaderField
(
const
INetMessageHeader
&
rHeader
,
sal_uIntPtr
nNewIndex
)
{
Byte
String
aName
(
rHeader
.
GetName
());
const
sal_Char
*
pData
=
aName
.
GetBuffe
r
();
const
sal_Char
*
pStop
=
pData
+
aName
.
Len
()
+
1
;
rtl
::
O
String
aName
(
rHeader
.
GetName
());
const
sal_Char
*
pData
=
aName
.
getSt
r
();
const
sal_Char
*
pStop
=
pData
+
aName
.
getLength
()
+
1
;
const
sal_Char
*
check
=
""
;
sal_uIntPtr
nIdx
=
LIST_APPEND
;
...
...
@@ -716,23 +716,23 @@ namespace
{
struct
ImplINetMIMEMessageHeaderDataImpl
{
const
Byte
String
*
operator
()()
const
rtl
::
O
String
*
operator
()()
{
static
const
Byte
String
_ImplINetMIMEMessageHeaderData
[]
=
static
const
rtl
::
O
String
_ImplINetMIMEMessageHeaderData
[]
=
{
ByteString
(
"MIME-Version"
),
ByteString
(
"Content-Description"
),
ByteString
(
"Content-Disposition"
),
ByteString
(
"Content-ID"
),
ByteString
(
"Content-Type"
),
ByteString
(
"Content-Transfer-Encoding"
)
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"MIME-Version"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Content-Description"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Content-Disposition"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Content-ID"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Content-Type"
)
),
rtl
::
OString
(
RTL_CONSTASCII_STRINGPARAM
(
"Content-Transfer-Encoding"
)
)
};
return
&
_ImplINetMIMEMessageHeaderData
[
0
];
}
};
struct
ImplINetMIMEMessageHeaderData
:
public
rtl
::
StaticAggregate
<
const
Byte
String
,
ImplINetMIMEMessageHeaderDataImpl
>
{};
:
public
rtl
::
StaticAggregate
<
const
rtl
::
O
String
,
ImplINetMIMEMessageHeaderDataImpl
>
{};
}
#define MIMEHDR(n) ImplINetMIMEMessageHeaderData::get()[(n)]
...
...
@@ -853,9 +853,9 @@ INetMIMEMessage *INetMIMEMessage::CreateMessage (
sal_uIntPtr
INetMIMEMessage
::
SetHeaderField
(
const
INetMessageHeader
&
rHeader
,
sal_uIntPtr
nNewIndex
)
{
Byte
String
aName
(
rHeader
.
GetName
());
const
sal_Char
*
pData
=
aName
.
GetBuffe
r
();
const
sal_Char
*
pStop
=
pData
+
aName
.
Len
()
+
1
;
rtl
::
O
String
aName
(
rHeader
.
GetName
());
const
sal_Char
*
pData
=
aName
.
getSt
r
();
const
sal_Char
*
pStop
=
pData
+
aName
.
getLength
()
+
1
;
const
sal_Char
*
check
=
""
;
sal_uIntPtr
nIdx
=
LIST_APPEND
;
...
...
@@ -1077,40 +1077,40 @@ sal_Bool INetMIMEMessage::EnableAttachChild (INetMessageContainerType eType)
return
sal_False
;
// Setup Content-Type header field.
ByteString
aContentType
;
rtl
::
OStringBuffer
aContentType
;
switch
(
eType
)
{
case
INETMSG_MESSAGE_RFC822
:
aContentType
=
"message/rfc822"
;
aContentType
.
append
(
RTL_CONSTASCII_STRINGPARAM
(
"message/rfc822"
))
;
break
;
case
INETMSG_MULTIPART_ALTERNATIVE
:
aContentType
=
"multipart/alternative"
;
aContentType
.
append
(
RTL_CONSTASCII_STRINGPARAM
(
"multipart/alternative"
))
;
break
;
case
INETMSG_MULTIPART_DIGEST
:
aContentType
=
"multipart/digest"
;
aContentType
.
append
(
RTL_CONSTASCII_STRINGPARAM
(
"multipart/digest"
))
;
break
;
case
INETMSG_MULTIPART_PARALLEL
:
aContentType
=
"multipart/parallel"
;
aContentType
.
append
(
RTL_CONSTASCII_STRINGPARAM
(
"multipart/parallel"
))
;
break
;
case
INETMSG_MULTIPART_RELATED
:
aContentType
=
"multipart/related"
;
aContentType
.
append
(
RTL_CONSTASCII_STRINGPARAM
(
"multipart/related"
))
;
break
;
case
INETMSG_MULTIPART_FORM_DATA
:
aContentType
=
"multipart/form-data"
;
aContentType
.
append
(
RTL_CONSTASCII_STRINGPARAM
(
"multipart/form-data"
))
;
break
;
default
:
aContentType
=
"multipart/mixed"
;
aContentType
.
append
(
RTL_CONSTASCII_STRINGPARAM
(
"multipart/mixed"
))
;
break
;
}
// Setup boundary for multipart types.
if
(
aContentType
.
CompareIgnoreCaseToAscii
(
"multipart/"
,
10
)
==
0
)
if
(
aContentType
.
toString
().
equalsIgnoreAsciiCaseL
(
RTL_CONSTASCII_STRINGPARAM
(
"multipart/"
))
)
{
// Generate a unique boundary from current time.
sal_Char
sTail
[
16
+
1
];
...
...
@@ -1124,13 +1124,13 @@ sal_Bool INetMIMEMessage::EnableAttachChild (INetMessageContainerType eType)
m_aBoundary
+=
sTail
;
// Append boundary as ContentType parameter.
aContentType
+=
"; boundary="
;
aContentType
+=
m_aBoundary
;
aContentType
.
append
(
RTL_CONSTASCII_STRINGPARAM
(
"; boundary="
))
;
aContentType
.
append
(
m_aBoundary
)
;
}
// Set header fields.
SetMIMEVersion
(
String
(
CONSTASCII_STRINGPARAM
(
"1.0"
)));
SetContentType
(
String
(
aContentType
,
RTL_TEXTENCODING_ASCII_US
));
SetContentType
(
rtl
::
OStringToOUString
(
aContentType
.
makeStringAndClear
()
,
RTL_TEXTENCODING_ASCII_US
));
SetContentTransferEncoding
(
String
(
CONSTASCII_STRINGPARAM
(
"7bit"
)));
// Done.
...
...
@@ -1163,11 +1163,7 @@ SvStream& INetMIMEMessage::operator<< (SvStream& rStrm) const
for
(
sal_uInt16
i
=
0
;
i
<
INETMSG_MIME_NUMHDR
;
i
++
)
rStrm
<<
static_cast
<
sal_uInt32
>
(
m_nIndex
[
i
]);
#ifdef ENABLE_BYTESTRING_STREAM_OPERATORS
rStrm
<<
m_aBoundary
;
#else
rStrm
.
WriteByteString
(
m_aBoundary
);
#endif
rStrm
<<
static_cast
<
sal_uInt32
>
(
aChildren
.
size
());
return
rStrm
;
...
...
@@ -1187,11 +1183,8 @@ SvStream& INetMIMEMessage::operator>> (SvStream& rStrm)
m_nIndex
[
i
]
=
nTemp
;
}
#ifdef ENABLE_BYTESTRING_STREAM_OPERATORS
rStrm
>>
m_aBoundary
;
#else
rStrm
.
ReadByteString
(
m_aBoundary
);
#endif
rStrm
>>
nTemp
;
return
rStrm
;
...
...
tools/source/ref/errinf.cxx
Dosyayı görüntüle @
c4927a1b
...
...
@@ -203,17 +203,15 @@ class ErrHdl_Impl
const
ErrorInfo
*
,
String
&
,
sal_uInt16
&
);
};
static
void
aDspFunc
(
const
String
&
rErr
,
const
String
&
rAction
)
{
ByteString
aErr
(
"Aktion: "
);
aErr
+=
ByteString
(
rAction
,
RTL_TEXTENCODING_ASCII_US
);
aErr
+=
" Fehler: "
;
aErr
+=
ByteString
(
rErr
,
RTL_TEXTENCODING_ASCII_US
);
OSL_FAIL
(
aErr
.
GetBuffe
r
());
rtl
::
OStringBuffer
aErr
(
RTL_CONSTASCII_STRINGPARAM
(
"Aktion: "
)
);
aErr
.
append
(
rtl
::
OUStringToOString
(
rAction
,
RTL_TEXTENCODING_ASCII_US
)
);
aErr
.
append
(
RTL_CONSTASCII_STRINGPARAM
(
" Fehler: "
))
;
aErr
.
append
(
rtl
::
OUStringToOString
(
rErr
,
RTL_TEXTENCODING_ASCII_US
)
);
OSL_FAIL
(
aErr
.
getSt
r
());
}
ErrorContext
::
ErrorContext
(
Window
*
pWinP
)
{
EDcrData
*
pData
=
EDcrData
::
GetData
();
...
...
@@ -327,45 +325,47 @@ sal_uInt16 ErrorHandler::HandleError_Impl(
if
(
ErrHdl_Impl
::
CreateString
(
pData
->
pFirstHdl
,
pInfo
,
aErr
,
nErrFlags
))
{
if
(
bJustCreateString
)
{
rError
=
aErr
;
return
1
;
}
else
{
if
(
!
pData
->
pDsp
)
if
(
bJustCreateString
)
{
ByteString
aStr
(
"Action: "
);
aStr
+=
ByteString
(
aAction
,
RTL_TEXTENCODING_ASCII_US
);
aStr
+=
ByteString
(
"
\n
Fehler: "
);
aStr
+=
ByteString
(
aErr
,
RTL_TEXTENCODING_ASCII_US
);
OSL_FAIL
(
aStr
.
GetBuffer
()
);
rError
=
aErr
;
return
1
;
}
else
{
delete
pInfo
;
if
(
!
pData
->
bIsWindowDsp
)
{
(
*
(
BasicDisplayErrorFunc
*
)
pData
->
pDsp
)(
aErr
,
aAction
);
return
0
;
if
(
!
pData
->
pDsp
)
{
rtl
::
OStringBuffer
aStr
(
RTL_CONSTASCII_STRINGPARAM
(
"Action: "
));
aStr
.
append
(
rtl
::
OUStringToOString
(
aAction
,
RTL_TEXTENCODING_ASCII_US
));
aStr
.
append
(
RTL_CONSTASCII_STRINGPARAM
(
"
\n
Fehler: "
));
aStr
.
append
(
rtl
::
OUStringToOString
(
aErr
,
RTL_TEXTENCODING_ASCII_US
));
OSL_FAIL
(
aStr
.
getStr
());
}
else
{
delete
pInfo
;
if
(
!
pData
->
bIsWindowDsp
)
{
(
*
(
BasicDisplayErrorFunc
*
)
pData
->
pDsp
)(
aErr
,
aAction
);
return
0
;
}
else
{
if
(
nFlags
!=
USHRT_MAX
)
nErrFlags
=
nFlags
;
return
(
*
(
WindowDisplayErrorFunc
*
)
pData
->
pDsp
)(
pParent
,
nErrFlags
,
aErr
,
aAction
);
}
}
}
else
{
if
(
nFlags
!=
USHRT_MAX
)
nErrFlags
=
nFlags
;
return
(
*
(
WindowDisplayErrorFunc
*
)
pData
->
pDsp
)(
pParent
,
nErrFlags
,
aErr
,
aAction
);
}
}
}
}
OSL_FAIL
(
"Error nicht behandelt"
);
// Error 1 ist General Error im Sfx
if
(
pInfo
->
GetErrorCode
()
!=
1
)
{
if
(
pInfo
->
GetErrorCode
()
!=
1
)
{
HandleError_Impl
(
1
,
USHRT_MAX
,
bJustCreateString
,
rError
);
}
else
{
else
{
OSL_FAIL
(
"Error 1 nicht gehandeled"
);
}
delete
pInfo
;
...
...
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