[Libreoffice-commits] .: 3 commits - i18npool/CppunitTest_i18npool_test_breakiterator.mk i18npool/qa i18npool/source solenv/inc tools/inc tools/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Aug 31 02:44:41 PDT 2012
i18npool/CppunitTest_i18npool_test_breakiterator.mk | 4
i18npool/qa/cppunit/test_breakiterator.cxx | 21 ++-
i18npool/source/breakiterator/data/README | 7 -
solenv/inc/settings.mk | 2
tools/inc/tools/inetmsg.hxx | 126 +++++++++---------
tools/source/inet/inetmsg.cxx | 135 +++++++++-----------
tools/source/inet/inetstrm.cxx | 2
7 files changed, 157 insertions(+), 140 deletions(-)
New commits:
commit edfa6cd3e5d27d793bfb2e7d23e2fdb4dbc09a69
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 31 10:30:35 2012 +0100
Related: #i103552# add regression test for ã·ã£ãããã¦ã³
Change-Id: I30117fdf70036f6df8dc494fe33a8a56d5544635
diff --git a/i18npool/CppunitTest_i18npool_test_breakiterator.mk b/i18npool/CppunitTest_i18npool_test_breakiterator.mk
index 62100a0..3a7855d 100644
--- a/i18npool/CppunitTest_i18npool_test_breakiterator.mk
+++ b/i18npool/CppunitTest_i18npool_test_breakiterator.mk
@@ -51,4 +51,8 @@ $(eval $(call gb_CppunitTest_use_components,i18npool_test_breakiterator,\
i18npool/util/i18npool \
))
+$(call gb_CppunitTest_get_target,i18npool_test_breakiterator) : \
+ $(call gb_Library_get_target,dict_ja) \
+ $(call gb_Library_get_target,dict_zh)
+
# vim: set noet sw=4 ts=4:
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index 3fb555d..63f9708 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -61,6 +61,7 @@ public:
void testNorthernThai();
#endif
void testKhmer();
+ void testJapanese();
CPPUNIT_TEST_SUITE(TestBreakIterator);
CPPUNIT_TEST(testLineBreaking);
@@ -75,6 +76,7 @@ public:
CPPUNIT_TEST(testWordBoundaries);
CPPUNIT_TEST(testKhmer);
#endif
+ CPPUNIT_TEST(testJapanese);
CPPUNIT_TEST_SUITE_END();
private:
uno::Reference<i18n::XBreakIterator> m_xBreak;
@@ -820,9 +822,9 @@ void TestBreakIterator::testKhmer()
aLocale.Language = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("km"));
aLocale.Country = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KH"));
- const sal_Unicode KHMER1[] = { 0x17B2, 0x17D2, 0x1799, 0x1782, 0x17C1 };
+ const sal_Unicode KHMER[] = { 0x17B2, 0x17D2, 0x1799, 0x1782, 0x17C1 };
- rtl::OUString aTest(KHMER1, SAL_N_ELEMENTS(KHMER1));
+ rtl::OUString aTest(KHMER, SAL_N_ELEMENTS(KHMER));
i18n::Boundary aBounds = m_xBreak->getWordBoundary(aTest, 0, aLocale,
i18n::WordType::DICTIONARY_WORD, true);
@@ -835,6 +837,21 @@ void TestBreakIterator::testKhmer()
}
#endif
+void TestBreakIterator::testJapanese()
+{
+ lang::Locale aLocale;
+ aLocale.Language = OUString("ja");
+ aLocale.Country = OUString("JP");
+
+ const sal_Unicode JAPANESE[] = { 0x30B7, 0x30E3, 0x30C3, 0x30C8, 0x30C0, 0x30A6, 0x30F3 };
+
+ rtl::OUString aTest(JAPANESE, SAL_N_ELEMENTS(JAPANESE));
+ i18n::Boundary aBounds = m_xBreak->getWordBoundary(aTest, 5, aLocale,
+ i18n::WordType::DICTIONARY_WORD, true);
+
+ CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 7);
+}
+
void TestBreakIterator::setUp()
{
BootstrapFixtureBase::setUp();
diff --git a/i18npool/source/breakiterator/data/README b/i18npool/source/breakiterator/data/README
index 4899f60..95f6b00 100644
--- a/i18npool/source/breakiterator/data/README
+++ b/i18npool/source/breakiterator/data/README
@@ -16,12 +16,6 @@ latest versions.
to-review, later are ok:
-commit ae9d7c2cef9ecd42687d64f985b9e2dcbc68a034
-Author: Thomas Lange [tl] <tl at openoffice.org>
-Date: Tue Apr 27 10:09:22 2010 +0200
-
- cws tl80: #i103552# Japanese word for 'shutdown' added to ja.dic
-
commit ffdc043d7272d2e0a664f530bbc112f952acadab
Author: Thomas Lange [tl] <tl at openoffice.org>
Date: Mon Mar 15 09:22:49 2010 +0100
@@ -561,6 +555,7 @@ Date: Mon Mar 8 16:17:05 2004 +0000
done, regression tests added:
+#i103552# Japanese word for 'shutdown' added to ja.dic
#i113785# ligatures for spell checking will no longer break words
An opening quote should not be counted as a word by word count tool (regression test in in writer)
fdo#31271 wrong line break with (
commit aac3ff1d15bcc8e4d498900386bf6b05f3cad905
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 31 10:23:32 2012 +0100
-DRTL_USING for dmake modules as well
following logic of 608025986
Change-Id: I016b76bf350432a29e02d528814584c5dbbfff61
diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk
index 7c28ad5..230c060 100644
--- a/solenv/inc/settings.mk
+++ b/solenv/inc/settings.mk
@@ -1119,6 +1119,8 @@ CDEFS += -DHAVE_THREADSAFE_STATICS
CDEFS += -DDISABLE_DYNLOADING
.ENDIF
+CDEFS += -DRTL_USING
+
# compose flags and defines for GUI
.IF "$(TARGETTYPE)"=="GUI"
CFLAGSSLO+=$(CFLAGSSLOGUIMT)
commit 3e0e87545fa20dfeabe904395e2a6767a5d5ea4a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 31 10:01:07 2012 +0100
UniString->OUString
Change-Id: I65db3f419a69542d1dc19a3879eb1a07d7f2ff43
diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx
index 8788b68..395286a 100644
--- a/tools/inc/tools/inetmsg.hxx
+++ b/tools/inc/tools/inetmsg.hxx
@@ -20,11 +20,11 @@
#define _TOOLS_INETMSG_HXX
#include "tools/toolsdllapi.h"
-#include <sal/types.h>
+#include <rtl/string.hxx>
#include <rtl/textenc.h>
+#include <rtl/ustring.hxx>
#include <tools/inetmime.hxx>
#include <tools/stream.hxx>
-#include <tools/string.hxx>
#include <vector>
@@ -32,15 +32,15 @@ class DateTime;
class INetMessageHeader
{
- rtl::OString m_aName;
- rtl::OString m_aValue;
+ OString m_aName;
+ OString m_aValue;
public:
INetMessageHeader()
{}
INetMessageHeader (
- const rtl::OString& rName, const rtl::OString& rValue)
+ const OString& rName, const OString& rValue)
: m_aName (rName), m_aValue (rValue)
{}
@@ -59,8 +59,8 @@ public:
return *this;
}
- const rtl::OString& GetName() const { return m_aName; }
- const rtl::OString& GetValue() const { return m_aValue; }
+ const OString& GetName() const { return m_aName; }
+ const OString& GetValue() const { return m_aValue; }
friend SvStream& operator<< (
SvStream& rStrm, const INetMessageHeader& rHdr)
@@ -86,30 +86,30 @@ class INetMessage
HeaderList_impl m_aHeaderList;
sal_uIntPtr m_nDocSize;
- rtl::OUString m_aDocName;
+ OUString m_aDocName;
SvLockBytesRef m_xDocLB;
void ListCleanup_Impl();
void ListCopy (const INetMessage& rMsg);
protected:
- rtl::OUString GetHeaderName_Impl (
+ OUString GetHeaderName_Impl (
sal_uIntPtr nIndex, rtl_TextEncoding eEncoding) const
{
if ( nIndex < m_aHeaderList.size() ) {
- return rtl::OStringToOUString(m_aHeaderList[ nIndex ]->GetName(), eEncoding);
+ return OStringToOUString(m_aHeaderList[ nIndex ]->GetName(), eEncoding);
} else {
- return rtl::OUString();
+ return OUString();
}
}
- rtl::OUString GetHeaderValue_Impl (
+ OUString GetHeaderValue_Impl (
sal_uIntPtr nIndex, INetMIME::HeaderFieldType eType) const
{
if ( nIndex < m_aHeaderList.size() ) {
return INetMIME::decodeHeaderFieldBody(eType, m_aHeaderList[ nIndex ]->GetValue());
} else {
- return rtl::OUString();
+ return OUString();
}
}
@@ -131,9 +131,9 @@ protected:
void SetHeaderField_Impl (
INetMIME::HeaderFieldType eType,
- const rtl::OString &rName,
- const rtl::OUString &rValue,
- sal_uIntPtr &rnIndex);
+ const OString &rName,
+ const OUString &rValue,
+ sal_uIntPtr &rnIndex);
virtual SvStream& operator<< (SvStream& rStrm) const;
virtual SvStream& operator>> (SvStream& rStrm);
@@ -161,12 +161,12 @@ public:
sal_uIntPtr GetHeaderCount() const { return m_aHeaderList.size(); }
- rtl::OUString GetHeaderName (sal_uIntPtr nIndex) const
+ OUString GetHeaderName (sal_uIntPtr nIndex) const
{
return GetHeaderName_Impl (nIndex, RTL_TEXTENCODING_ASCII_US);
}
- rtl::OUString GetHeaderValue (sal_uIntPtr nIndex) const
+ OUString GetHeaderValue (sal_uIntPtr nIndex) const
{
return GetHeaderValue_Impl (nIndex, INetMIME::HEADER_FIELD_TEXT);
}
@@ -188,8 +188,8 @@ public:
sal_uIntPtr GetDocumentSize() const { return m_nDocSize; }
void SetDocumentSize (sal_uIntPtr nSize) { m_nDocSize = nSize; }
- const rtl::OUString& GetDocumentName() const { return m_aDocName; }
- void SetDocumentName (const rtl::OUString& rName) { m_aDocName = rName; }
+ const OUString& GetDocumentName() const { return m_aDocName; }
+ void SetDocumentName (const OUString& rName) { m_aDocName = rName; }
SvLockBytes* GetDocumentLB() const { return m_xDocLB; }
void SetDocumentLB (SvLockBytes *pDocLB) { m_xDocLB = pDocLB; }
@@ -240,8 +240,8 @@ public:
INetRFC822Message& operator= (const INetRFC822Message& rMsg);
- static sal_Bool ParseDateField (
- const rtl::OUString& rDateField, DateTime& rDateTime);
+ static bool ParseDateField (
+ const OUString& rDateField, DateTime& rDateTime);
using INetMessage::SetHeaderField;
virtual sal_uIntPtr SetHeaderField (
@@ -251,105 +251,105 @@ public:
// Header fields.
- rtl::OUString GetBCC() const
+ OUString GetBCC() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_BCC],
INetMIME::HEADER_FIELD_ADDRESS);
}
- rtl::OUString GetCC() const
+ OUString GetCC() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_CC],
INetMIME::HEADER_FIELD_ADDRESS);
}
- rtl::OUString GetComments() const
+ OUString GetComments() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_COMMENTS],
INetMIME::HEADER_FIELD_TEXT);
}
- rtl::OUString GetDate() const
+ OUString GetDate() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_DATE],
INetMIME::HEADER_FIELD_STRUCTURED);
}
- rtl::OUString GetFrom() const
+ OUString GetFrom() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_FROM],
INetMIME::HEADER_FIELD_ADDRESS);
}
- rtl::OUString GetInReplyTo() const
+ OUString GetInReplyTo() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_IN_REPLY_TO],
INetMIME::HEADER_FIELD_ADDRESS); // ??? MESSAGE_ID ???
}
- rtl::OUString GetKeywords() const
+ OUString GetKeywords() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_KEYWORDS],
INetMIME::HEADER_FIELD_PHRASE);
}
- rtl::OUString GetMessageID() const
+ OUString GetMessageID() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_MESSAGE_ID],
INetMIME::HEADER_FIELD_MESSAGE_ID);
}
- rtl::OUString GetReferences() const
+ OUString GetReferences() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_REFERENCES],
INetMIME::HEADER_FIELD_ADDRESS);
}
- rtl::OUString GetReplyTo() const
+ OUString GetReplyTo() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_REPLY_TO],
INetMIME::HEADER_FIELD_ADDRESS);
}
- rtl::OUString GetReturnPath() const
+ OUString GetReturnPath() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_RETURN_PATH],
INetMIME::HEADER_FIELD_ADDRESS);
}
- rtl::OUString GetReturnReceiptTo() const
+ OUString GetReturnReceiptTo() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_RETURN_RECEIPT_TO],
INetMIME::HEADER_FIELD_ADDRESS);
}
- rtl::OUString GetSender() const
+ OUString GetSender() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_SENDER],
INetMIME::HEADER_FIELD_ADDRESS);
}
- rtl::OUString GetSubject() const
+ OUString GetSubject() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_SUBJECT],
INetMIME::HEADER_FIELD_TEXT);
}
- rtl::OUString GetTo() const
+ OUString GetTo() const
{
return GetHeaderValue_Impl (
m_nIndex[INETMSG_RFC822_TO],
@@ -398,13 +398,13 @@ class TOOLS_DLLPUBLIC INetMIMEMessage : public INetRFC822Message
sal_uIntPtr m_nIndex[INETMSG_MIME_NUMHDR];
INetMIMEMessage* pParent;
INetMIMEMessgeList_impl aChildren;
- rtl::OString m_aBoundary;
- sal_Bool bHeaderParsed;
+ OString m_aBoundary;
+ bool bHeaderParsed;
friend class INetMIMEMessageStream;
- const rtl::OString& GetMultipartBoundary() const { return m_aBoundary; }
- void SetMultipartBoundary (const rtl::OString& rBnd) { m_aBoundary = rBnd; }
+ const OString& GetMultipartBoundary() const { return m_aBoundary; }
+ void SetMultipartBoundary (const OString& rBnd) { m_aBoundary = rBnd; }
void CleanupImp();
void CopyImp (const INetMIMEMessage& rMsg);
@@ -421,7 +421,7 @@ public:
INetMIMEMessage& operator= (const INetMIMEMessage& rMsg);
- sal_Bool HeaderParsed() const { return bHeaderParsed; }
+ bool HeaderParsed() const { return bHeaderParsed; }
virtual INetMIMEMessage* CreateMessage (
const INetMIMEMessage& rMsg) const;
@@ -434,57 +434,57 @@ public:
// Header fields.
- void SetMIMEVersion (const UniString& rVersion);
- UniString GetMIMEVersion() const
+ void SetMIMEVersion (const OUString& rVersion);
+ OUString GetMIMEVersion() const
{
return GetHeaderValue (m_nIndex[INETMSG_MIME_VERSION]);
}
- UniString GetContentDescription() const
+ OUString GetContentDescription() const
{
return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_DESCRIPTION]);
}
- void SetContentDisposition (const UniString& rDisposition);
- UniString GetContentDisposition() const
+ void SetContentDisposition (const OUString& rDisposition);
+ OUString GetContentDisposition() const
{
return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_DISPOSITION]);
}
- UniString GetContentID() const
+ OUString GetContentID() const
{
return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_ID]);
}
- void SetContentType (const UniString& rType);
- UniString GetContentType() const
+ void SetContentType (const OUString& rType);
+ OUString GetContentType() const
{
return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_TYPE]);
}
- void SetContentTransferEncoding (const rtl::OUString& rEncoding);
- rtl::OUString GetContentTransferEncoding() const
+ void SetContentTransferEncoding (const OUString& rEncoding);
+ OUString GetContentTransferEncoding() const
{
return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_TRANSFER_ENCODING]);
}
- rtl::OUString GetDefaultContentType ();
+ OUString GetDefaultContentType ();
// Message container methods.
- sal_Bool IsContainer() const
+ bool IsContainer() const
{
return (IsMessage() || IsMultipart());
}
- sal_Bool IsMessage() const
+ bool IsMessage() const
{
- UniString aType (GetContentType());
- return (aType.CompareIgnoreCaseToAscii("message/", 8) == 0);
+ OUString aType (GetContentType());
+ return aType.matchIgnoreAsciiCase("message/");
}
- sal_Bool IsMultipart() const
+ bool IsMultipart() const
{
- UniString aType (GetContentType());
- return (aType.CompareIgnoreCaseToAscii("multipart/", 10) == 0);
+ OUString aType (GetContentType());
+ return aType.matchIgnoreAsciiCase("multipart/");
}
INetMIMEMessage* GetChild (sal_uIntPtr nIndex) const
@@ -493,10 +493,10 @@ public:
}
INetMIMEMessage* GetParent() const { return pParent; }
- sal_Bool EnableAttachChild (
+ bool EnableAttachChild (
INetMessageContainerType eType = INETMSG_MULTIPART_MIXED);
- sal_Bool AttachChild (
- INetMIMEMessage& rChildMsg, sal_Bool bOwner = sal_True);
+ bool AttachChild (
+ INetMIMEMessage& rChildMsg, bool bOwner = true );
// Stream operators.
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index 5583770..35bd176 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -29,12 +29,12 @@
#include <stdio.h>
-inline sal_Bool ascii_isDigit( sal_Unicode ch )
+inline bool ascii_isDigit( sal_Unicode ch )
{
return ((ch >= 0x0030) && (ch <= 0x0039));
}
-inline sal_Bool ascii_isLetter( sal_Unicode ch )
+inline bool ascii_isLetter( sal_Unicode ch )
{
return (( (ch >= 0x0041) && (ch <= 0x005A)) || ((ch >= 0x0061) && (ch <= 0x007A)));
}
@@ -82,9 +82,9 @@ void INetMessage::ListCopy (const INetMessage &rMsg)
void INetMessage::SetHeaderField_Impl (
INetMIME::HeaderFieldType eType,
- const rtl::OString &rName,
- const rtl::OUString &rValue,
- sal_uIntPtr &rnIndex)
+ const OString &rName,
+ const OUString &rValue,
+ sal_uIntPtr &rnIndex)
{
INetMIMEStringOutputSink aSink (0, STRING_MAXLEN);
INetMIME::writeHeaderFieldBody (
@@ -148,33 +148,33 @@ namespace
{
struct ImplINetRFC822MessageHeaderDataImpl
{
- const rtl::OString* operator()()
+ const OString* operator()()
{
- static const rtl::OString _ImplINetRFC822MessageHeaderData[] =
+ static const OString _ImplINetRFC822MessageHeaderData[] =
{
- 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"))
+ OString(RTL_CONSTASCII_STRINGPARAM("BCC")),
+ OString(RTL_CONSTASCII_STRINGPARAM("CC")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Comments")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Date")),
+ OString(RTL_CONSTASCII_STRINGPARAM("From")),
+ OString(RTL_CONSTASCII_STRINGPARAM("In-Reply-To")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Keywords")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Message-ID")),
+ OString(RTL_CONSTASCII_STRINGPARAM("References")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Reply-To")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Return-Path")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Subject")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Sender")),
+ OString(RTL_CONSTASCII_STRINGPARAM("To")),
+ OString(RTL_CONSTASCII_STRINGPARAM("X-Mailer")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Return-Receipt-To"))
};
return &_ImplINetRFC822MessageHeaderData[0];
}
};
struct ImplINetRFC822MessageHeaderData
- : public rtl::StaticAggregate< const rtl::OString, ImplINetRFC822MessageHeaderDataImpl > {};
+ : public rtl::StaticAggregate< const OString, ImplINetRFC822MessageHeaderDataImpl > {};
}
#define HDR(n) ImplINetRFC822MessageHeaderData::get()[(n)]
@@ -241,23 +241,23 @@ static const sal_Char *months[12] =
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
-static sal_uInt16 ParseNumber(const rtl::OString& rStr, sal_uInt16& nIndex)
+static sal_uInt16 ParseNumber(const OString& rStr, sal_uInt16& nIndex)
{
sal_uInt16 n = nIndex;
while ((n < rStr.getLength()) && ascii_isDigit(rStr[n])) n++;
- rtl::OString aNum(rStr.copy(nIndex, (n - nIndex)));
+ OString aNum(rStr.copy(nIndex, (n - nIndex)));
nIndex = n;
return (sal_uInt16)(aNum.toInt32());
}
-static sal_uInt16 ParseMonth(const rtl::OString& rStr, sal_uInt16& nIndex)
+static sal_uInt16 ParseMonth(const OString& rStr, sal_uInt16& nIndex)
{
sal_uInt16 n = nIndex;
while ((n < rStr.getLength()) && ascii_isLetter(rStr[n])) n++;
- rtl::OString aMonth(rStr.copy(nIndex, 3));
+ OString aMonth(rStr.copy(nIndex, 3));
nIndex = n;
sal_uInt16 i;
@@ -266,13 +266,13 @@ static sal_uInt16 ParseMonth(const rtl::OString& rStr, sal_uInt16& nIndex)
return (i + 1);
}
-sal_Bool INetRFC822Message::ParseDateField (
- const rtl::OUString& rDateFieldW, DateTime& rDateTime)
+bool INetRFC822Message::ParseDateField (
+ const OUString& rDateFieldW, DateTime& rDateTime)
{
- rtl::OString aDateField(rtl::OUStringToOString(rDateFieldW,
+ OString aDateField(OUStringToOString(rDateFieldW,
RTL_TEXTENCODING_ASCII_US));
- if (aDateField.isEmpty()) return sal_False;
+ if (aDateField.isEmpty()) return false;
if (aDateField.indexOf(':') != -1)
{
@@ -297,7 +297,7 @@ sal_Bool INetRFC822Message::ParseDateField (
if (ascii_isLetter (aDateField[nIndex]))
{
// Format: ctime().
- if ((aDateField.getLength() - nIndex) < 20) return sal_False;
+ if ((aDateField.getLength() - nIndex) < 20) return false;
rDateTime.SetMonth (ParseMonth (aDateField, nIndex)); nIndex++;
rDateTime.SetDay (ParseNumber (aDateField, nIndex)); nIndex++;
@@ -314,7 +314,7 @@ sal_Bool INetRFC822Message::ParseDateField (
else
{
// Format: RFC1036 or RFC1123.
- if ((aDateField.getLength() - nIndex) < 17) return sal_False;
+ if ((aDateField.getLength() - nIndex) < 17) return false;
rDateTime.SetDay (ParseNumber (aDateField, nIndex)); nIndex++;
rDateTime.SetMonth (ParseMonth (aDateField, nIndex)); nIndex++;
@@ -332,7 +332,7 @@ sal_Bool INetRFC822Message::ParseDateField (
(aDateField[nIndex] == '-') )
{
// Offset from GMT: "(+|-)HHMM".
- sal_Bool bEast = (aDateField[nIndex++] == '+');
+ bool bEast = (aDateField[nIndex++] == '+');
sal_uInt16 nOffset = ParseNumber (aDateField, nIndex);
if (nOffset > 0)
{
@@ -366,7 +366,7 @@ sal_Bool INetRFC822Message::ParseDateField (
else
{
// Junk.
- return sal_False;
+ return false;
}
return (rDateTime.IsValidAndGregorian() &&
@@ -379,7 +379,7 @@ sal_Bool INetRFC822Message::ParseDateField (
sal_uIntPtr INetRFC822Message::SetHeaderField (
const INetMessageHeader &rHeader, sal_uIntPtr nNewIndex)
{
- rtl::OString aName (rHeader.GetName());
+ OString aName (rHeader.GetName());
const sal_Char *pData = aName.getStr();
const sal_Char *pStop = pData + aName.getLength() + 1;
const sal_Char *check = "";
@@ -635,23 +635,23 @@ namespace
{
struct ImplINetMIMEMessageHeaderDataImpl
{
- const rtl::OString* operator()()
+ const OString* operator()()
{
- static const rtl::OString _ImplINetMIMEMessageHeaderData[] =
+ static const OString _ImplINetMIMEMessageHeaderData[] =
{
- 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"))
+ OString(RTL_CONSTASCII_STRINGPARAM("MIME-Version")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Content-Description")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Content-Disposition")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Content-ID")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Content-Type")),
+ OString(RTL_CONSTASCII_STRINGPARAM("Content-Transfer-Encoding"))
};
return &_ImplINetMIMEMessageHeaderData[0];
}
};
struct ImplINetMIMEMessageHeaderData
- : public rtl::StaticAggregate< const rtl::OString, ImplINetMIMEMessageHeaderDataImpl > {};
+ : public rtl::StaticAggregate< const OString, ImplINetMIMEMessageHeaderDataImpl > {};
}
#define MIMEHDR(n) ImplINetMIMEMessageHeaderData::get()[(n)]
@@ -671,7 +671,7 @@ enum _ImplINetMIMEMessageHeaderState
INetMIMEMessage::INetMIMEMessage()
: INetRFC822Message (),
pParent (NULL),
- bHeaderParsed (sal_False)
+ bHeaderParsed (false)
{
for (sal_uInt16 i = 0; i < INETMSG_MIME_NUMHDR; i++)
m_nIndex[i] = CONTAINER_ENTRY_NOTFOUND;
@@ -743,7 +743,7 @@ INetMIMEMessage *INetMIMEMessage::CreateMessage (
sal_uIntPtr INetMIMEMessage::SetHeaderField (
const INetMessageHeader &rHeader, sal_uIntPtr nNewIndex)
{
- rtl::OString aName (rHeader.GetName());
+ OString aName (rHeader.GetName());
const sal_Char *pData = aName.getStr();
const sal_Char *pStop = pData + aName.getLength() + 1;
const sal_Char *check = "";
@@ -886,7 +886,7 @@ sal_uIntPtr INetMIMEMessage::SetHeaderField (
return nNewIndex;
}
-void INetMIMEMessage::SetMIMEVersion (const UniString& rVersion)
+void INetMIMEMessage::SetMIMEVersion (const OUString& rVersion)
{
SetHeaderField_Impl (
INetMIME::HEADER_FIELD_TEXT,
@@ -894,7 +894,7 @@ void INetMIMEMessage::SetMIMEVersion (const UniString& rVersion)
m_nIndex[INETMSG_MIME_VERSION]);
}
-void INetMIMEMessage::SetContentDisposition (const String& rDisposition)
+void INetMIMEMessage::SetContentDisposition (const OUString& rDisposition)
{
SetHeaderField_Impl (
INetMIME::HEADER_FIELD_TEXT,
@@ -902,7 +902,7 @@ void INetMIMEMessage::SetContentDisposition (const String& rDisposition)
m_nIndex[INETMSG_MIME_CONTENT_DISPOSITION]);
}
-void INetMIMEMessage::SetContentType (const String& rType)
+void INetMIMEMessage::SetContentType (const OUString& rType)
{
SetHeaderField_Impl (
INetMIME::HEADER_FIELD_TEXT,
@@ -911,7 +911,7 @@ void INetMIMEMessage::SetContentType (const String& rType)
}
void INetMIMEMessage::SetContentTransferEncoding (
- const rtl::OUString& rEncoding)
+ const OUString& rEncoding)
{
SetHeaderField_Impl (
INetMIME::HEADER_FIELD_TEXT,
@@ -919,28 +919,28 @@ void INetMIMEMessage::SetContentTransferEncoding (
m_nIndex[INETMSG_MIME_CONTENT_TRANSFER_ENCODING]);
}
-rtl::OUString INetMIMEMessage::GetDefaultContentType()
+OUString INetMIMEMessage::GetDefaultContentType()
{
if (pParent != NULL)
{
- rtl::OUString aParentCT (pParent->GetContentType());
+ OUString aParentCT (pParent->GetContentType());
if (aParentCT.isEmpty())
aParentCT = pParent->GetDefaultContentType();
if (aParentCT.equalsIgnoreAsciiCase("multipart/digest"))
- return rtl::OUString("message/rfc822");
+ return OUString("message/rfc822");
}
- return rtl::OUString("text/plain; charset=us-ascii");
+ return OUString("text/plain; charset=us-ascii");
}
-sal_Bool INetMIMEMessage::EnableAttachChild (INetMessageContainerType eType)
+bool INetMIMEMessage::EnableAttachChild (INetMessageContainerType eType)
{
// Check context.
if (IsContainer())
- return sal_False;
+ return false;
// Setup Content-Type header field.
- rtl::OStringBuffer aContentType;
+ OStringBuffer aContentType;
switch (eType)
{
case INETMSG_MESSAGE_RFC822:
@@ -992,25 +992,24 @@ sal_Bool INetMIMEMessage::EnableAttachChild (INetMessageContainerType eType)
}
// Set header fields.
- SetMIMEVersion (String (CONSTASCII_STRINGPARAM("1.0")));
- SetContentType (rtl::OStringToOUString(aContentType.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US));
- SetContentTransferEncoding (String (CONSTASCII_STRINGPARAM("7bit")));
+ SetMIMEVersion(OUString("1.0"));
+ SetContentType(OStringToOUString(aContentType.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US));
+ SetContentTransferEncoding(OUString("7bit"));
// Done.
- return sal_True;
+ return true;
}
-sal_Bool INetMIMEMessage::AttachChild (
- INetMIMEMessage& rChildMsg, sal_Bool bOwner)
+bool INetMIMEMessage::AttachChild(INetMIMEMessage& rChildMsg, bool bOwner)
{
- if (IsContainer() /*&& rChildMsg.GetContentType().Len() */)
+ if (IsContainer())
{
if (bOwner) rChildMsg.pParent = this;
aChildren.push_back( &rChildMsg );
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
SvStream& INetMIMEMessage::operator<< (SvStream& rStrm) const
diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx
index 37584d0..19db6ee 100644
--- a/tools/source/inet/inetstrm.cxx
+++ b/tools/source/inet/inetstrm.cxx
@@ -1573,7 +1573,7 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize)
* Single part message.
* Remove any ContentTransferEncoding.
*/
- if (pMsg->GetContentType().Len() == 0)
+ if (pMsg->GetContentType().isEmpty())
{
pMsg->SetContentType(pMsg->GetDefaultContentType());
}
More information about the Libreoffice-commits
mailing list