[Libreoffice-commits] .: 6 commits - tools/inc tools/source vcl/inc
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Jun 15 01:09:24 PDT 2011
tools/inc/tools/bigint.hxx | 6 --
tools/inc/tools/inetmime.hxx | 39 -----------------
tools/inc/tools/inetmsg.hxx | 8 ---
tools/source/generic/bigint.cxx | 91 ++++------------------------------------
tools/source/inet/inetmime.cxx | 81 -----------------------------------
tools/source/inet/inetmsg.cxx | 8 ---
vcl/inc/svdata.hxx | 2
7 files changed, 12 insertions(+), 223 deletions(-)
New commits:
commit 34673061036f72b7848814ff405536a404686853
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jun 15 01:09:26 2011 +0100
ImplGetSVEmptyByteStr unused
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 380e555..0e3ea5b 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -412,8 +412,6 @@ FieldUnitStringList* ImplGetCleanedFieldUnits();
inline const String& ImplGetSVEmptyStr()
{ return String::EmptyString(); }
-inline const ByteString& ImplGetSVEmptyByteStr()
- { return ByteString::EmptyString(); }
// -----------------------------------------------------------------------
commit e8f7eaed924e4ce9f3201779cc25f01114b15c94
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jun 15 00:46:16 2011 +0100
remove unused INetMIMEUnicodeOutputSink
diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx
index 226eba2..d5b56b0 100644
--- a/tools/inc/tools/inetmime.hxx
+++ b/tools/inc/tools/inetmime.hxx
@@ -1208,42 +1208,6 @@ inline ByteString INetMIMEStringOutputSink::takeBuffer()
}
//============================================================================
-class INetMIMEUnicodeOutputSink: public INetMIMEOutputSink
-{
- UniString m_aBuffer;
- bool m_bOverflow;
-
- using INetMIMEOutputSink::writeSequence;
-
- virtual void writeSequence(const sal_Char * pBegin,
- const sal_Char * pEnd);
-
- virtual void writeSequence(const sal_uInt32 * pBegin,
- const sal_uInt32 * pEnd);
-
- virtual void writeSequence(const sal_Unicode * pBegin,
- const sal_Unicode * pEnd);
-
-public:
- inline INetMIMEUnicodeOutputSink(sal_uInt32 nColumn = 0,
- sal_uInt32 nLineLengthLimit
- = INetMIME::SOFT_LINE_LENGTH_LIMIT):
- INetMIMEOutputSink(nColumn, nLineLengthLimit), m_bOverflow(false) {}
-
- virtual ErrCode getError() const;
-
- inline UniString takeBuffer();
-};
-
-inline UniString INetMIMEUnicodeOutputSink::takeBuffer()
-{
- UniString aTheBuffer = m_aBuffer;
- m_aBuffer.Erase();
- m_bOverflow = false;
- return aTheBuffer;
-}
-
-//============================================================================
class INetMIMEEncodedWordOutputSink
{
public:
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index 689cebe..082b8d2 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -3598,68 +3598,6 @@ ErrCode INetMIMEStringOutputSink::getError() const
//============================================================================
//
-// INetMIMEUnicodeOutputSink
-//
-//============================================================================
-
-// virtual
-void INetMIMEUnicodeOutputSink::writeSequence(const sal_Char * pBegin,
- const sal_Char * pEnd)
-{
- DBG_ASSERT(pBegin && pBegin <= pEnd,
- "INetMIMEUnicodeOutputSink::writeSequence(): Bad sequence");
-
- sal_Unicode * pBufferBegin = new sal_Unicode[pEnd - pBegin];
- sal_Unicode * pBufferEnd = pBufferBegin;
- while (pBegin != pEnd)
- *pBufferEnd++ = sal_uChar(*pBegin++);
- writeSequence(pBufferBegin, pBufferEnd);
- delete[] pBufferBegin;
-}
-
-//============================================================================
-// virtual
-void INetMIMEUnicodeOutputSink::writeSequence(const sal_uInt32 * pBegin,
- const sal_uInt32 * pEnd)
-{
- DBG_ASSERT(pBegin && pBegin <= pEnd,
- "INetMIMEUnicodeOutputSink::writeSequence(): Bad sequence");
-
- sal_Unicode * pBufferBegin = new sal_Unicode[pEnd - pBegin];
- sal_Unicode * pBufferEnd = pBufferBegin;
- while (pBegin != pEnd)
- {
- DBG_ASSERT(*pBegin < 256,
- "INetMIMEOutputSink::writeSequence(): Bad octet");
- *pBufferEnd++ = sal_Unicode(*pBegin++);
- }
- writeSequence(pBufferBegin, pBufferEnd);
- delete[] pBufferBegin;
-}
-
-//============================================================================
-// virtual
-void INetMIMEUnicodeOutputSink::writeSequence(const sal_Unicode * pBegin,
- const sal_Unicode * pEnd)
-{
- DBG_ASSERT(pBegin && pBegin <= pEnd,
- "INetMIMEUnicodeOutputSink::writeSequence(): Bad sequence");
-
- m_bOverflow = m_bOverflow
- || pEnd - pBegin > STRING_MAXLEN - m_aBuffer.Len();
- if (!m_bOverflow)
- m_aBuffer.Append(pBegin, static_cast< xub_StrLen >(pEnd - pBegin));
-}
-
-//============================================================================
-// virtual
-ErrCode INetMIMEUnicodeOutputSink::getError() const
-{
- return m_bOverflow ? ERRCODE_IO_OUTOFMEMORY : ERRCODE_NONE;
-}
-
-//============================================================================
-//
// INetMIMEEncodedWordOutputSink
//
//============================================================================
commit b8286a245d5bbb6d9efbb2dd408fca7e8d35f3f2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jun 15 00:36:55 2011 +0100
remove unused Get/SetXMailer
diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx
index c22e632..f59f9d1 100644
--- a/tools/inc/tools/inetmsg.hxx
+++ b/tools/inc/tools/inetmsg.hxx
@@ -441,14 +441,6 @@ public:
INetMIME::HEADER_FIELD_TEXT);
}
- void SetXMailer (const UniString& rXMailer);
- UniString GetXMailer (void) const
- {
- return GetHeaderValue_Impl (
- m_nIndex[INETMSG_RFC822_X_MAILER],
- INetMIME::HEADER_FIELD_TEXT);
- }
-
/** Stream operators.
*/
friend SvStream& operator<< (
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index b23d44b..ec21249 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -898,14 +898,6 @@ void INetRFC822Message::SetTo (const UniString& rTo)
m_nIndex[INETMSG_RFC822_TO]);
}
-void INetRFC822Message::SetXMailer (const UniString& rXMailer)
-{
- SetHeaderField_Impl (
- INetMIME::HEADER_FIELD_TEXT,
- HDR(INETMSG_RFC822_X_MAILER), rXMailer,
- m_nIndex[INETMSG_RFC822_X_MAILER]);
-}
-
/*
* operator<<
*/
commit da61365b54a00719d9952f09ac45c96f95e68439
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jun 15 00:33:33 2011 +0100
remove unused decodeUTF8
diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx
index 4c07917..226eba2 100644
--- a/tools/inc/tools/inetmime.hxx
+++ b/tools/inc/tools/inetmime.hxx
@@ -614,9 +614,6 @@ public:
rtl_TextEncoding eEncoding,
sal_uInt32 & rCharacter);
- static ByteString decodeUTF8(const ByteString & rText,
- rtl_TextEncoding eEncoding);
-
static UniString decodeHeaderFieldBody(HeaderFieldType eType,
const ByteString & rBody);
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index ca96dd1..689cebe 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -3056,25 +3056,6 @@ bool INetMIME::translateUTF8Char(const sal_Char *& rBegin,
//============================================================================
// static
-ByteString INetMIME::decodeUTF8(const ByteString & rText,
- rtl_TextEncoding eEncoding)
-{
- const sal_Char * p = rText.GetBuffer();
- const sal_Char * pEnd = p + rText.Len();
- ByteString sDecoded;
- while (p != pEnd)
- {
- sal_uInt32 nCharacter = 0;
- if (translateUTF8Char(p, pEnd, eEncoding, nCharacter))
- sDecoded += sal_Char(nCharacter);
- else
- sDecoded += sal_Char(*p++);
- }
- return sDecoded;
-}
-
-//============================================================================
-// static
UniString INetMIME::decodeHeaderFieldBody(HeaderFieldType eType,
const ByteString & rBody)
{
commit 5a19b3e56f4acd212b19f34b0edff43d002f9f81
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jun 15 00:19:28 2011 +0100
throw out this ctor
diff --git a/tools/inc/tools/bigint.hxx b/tools/inc/tools/bigint.hxx
index 9650e92..f1da828 100644
--- a/tools/inc/tools/bigint.hxx
+++ b/tools/inc/tools/bigint.hxx
@@ -83,8 +83,7 @@ public:
BigInt( sal_uInt16 nVal );
BigInt( sal_uInt32 nVal );
BigInt( const BigInt& rBigInt );
- BigInt( const ByteString& rString );
- BigInt( const UniString& rString );
+ BigInt( const String& rString );
#ifdef _TLBIGINT_INT64
BigInt( const SbxINT64 &r );
BigInt( const SbxUINT64 &r );
@@ -98,7 +97,7 @@ public:
operator sal_uIntPtr() const;
void Set( sal_Bool bSet ) { bIsSet = bSet; }
- UniString GetString() const;
+ String GetString() const;
sal_Bool IsSet() const { return bIsSet; }
sal_Bool IsNeg() const;
diff --git a/tools/source/generic/bigint.cxx b/tools/source/generic/bigint.cxx
index 92808eb..cb052c3 100644
--- a/tools/source/generic/bigint.cxx
+++ b/tools/source/generic/bigint.cxx
@@ -525,35 +525,7 @@ BigInt::BigInt( const BigInt& rBigInt )
// -----------------------------------------------------------------------
-BigInt::BigInt( const ByteString& rString )
-{
- bIsSet = sal_True;
- bIsNeg = sal_False;
- bIsBig = sal_False;
- nVal = 0;
-
- sal_Bool bNeg = sal_False;
- const sal_Char* p = rString.GetBuffer();
- if ( *p == '-' )
- {
- bNeg = sal_True;
- p++;
- }
- while( *p >= '0' && *p <= '9' )
- {
- *this *= 10;
- *this += *p - '0';
- p++;
- }
- if ( bIsBig )
- bIsNeg = bNeg;
- else if( bNeg )
- nVal = -nVal;
-}
-
-// -----------------------------------------------------------------------
-
-BigInt::BigInt( const UniString& rString )
+BigInt::BigInt( const String& rString )
{
bIsSet = sal_True;
bIsNeg = sal_False;
@@ -686,12 +658,12 @@ BigInt::operator double() const
// -----------------------------------------------------------------------
-UniString BigInt::GetString() const
+String BigInt::GetString() const
{
- UniString aString;
+ String aString;
if ( !bIsBig )
- aString = UniString::CreateFromInt32( nVal );
+ aString = String::CreateFromInt32( nVal );
else
{
BigInt aTmp( *this );
@@ -704,23 +676,23 @@ UniString BigInt::GetString() const
a %= a1000000000;
aTmp /= a1000000000;
- UniString aStr = aString;
+ String aStr = aString;
if ( a.nVal < 100000000L )
{ // leading 0s
- aString = UniString::CreateFromInt32( a.nVal + 1000000000L );
+ aString = String::CreateFromInt32( a.nVal + 1000000000L );
aString.Erase(0,1);
}
else
- aString = UniString::CreateFromInt32( a.nVal );
+ aString = String::CreateFromInt32( a.nVal );
aString += aStr;
}
while( aTmp.bIsBig );
- UniString aStr = aString;
+ String aStr = aString;
if ( bIsNeg )
- aString = UniString::CreateFromInt32( -aTmp.nVal );
+ aString = String::CreateFromInt32( -aTmp.nVal );
else
- aString = UniString::CreateFromInt32( aTmp.nVal );
+ aString = String::CreateFromInt32( aTmp.nVal );
aString += aStr;
}
commit 3a3b4a7ba852d2c23897f963229eb08b810d4c9c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 14 23:53:44 2011 +0100
GetByteString unused
diff --git a/tools/inc/tools/bigint.hxx b/tools/inc/tools/bigint.hxx
index 4abf1c7..9650e92 100644
--- a/tools/inc/tools/bigint.hxx
+++ b/tools/inc/tools/bigint.hxx
@@ -98,7 +98,6 @@ public:
operator sal_uIntPtr() const;
void Set( sal_Bool bSet ) { bIsSet = bSet; }
- ByteString GetByteString() const;
UniString GetString() const;
sal_Bool IsSet() const { return bIsSet; }
diff --git a/tools/source/generic/bigint.cxx b/tools/source/generic/bigint.cxx
index 26b78f6..92808eb 100644
--- a/tools/source/generic/bigint.cxx
+++ b/tools/source/generic/bigint.cxx
@@ -686,49 +686,6 @@ BigInt::operator double() const
// -----------------------------------------------------------------------
-ByteString BigInt::GetByteString() const
-{
- ByteString aString;
-
- if ( !bIsBig )
- aString = ByteString::CreateFromInt32( nVal );
- else
- {
- BigInt aTmp( *this );
- BigInt a1000000000( 1000000000L );
- aTmp.Abs();
-
- do
- {
- BigInt a = aTmp;
- a %= a1000000000;
- aTmp /= a1000000000;
-
- ByteString aStr = aString;
- if ( a.nVal < 100000000L )
- { // leading 0s
- aString = ByteString::CreateFromInt32( a.nVal + 1000000000L );
- aString.Erase( 0, 1 );
- }
- else
- aString = ByteString::CreateFromInt32( a.nVal );
- aString += aStr;
- }
- while( aTmp.bIsBig );
-
- ByteString aStr = aString;
- if ( bIsNeg )
- aString = ByteString::CreateFromInt32( -aTmp.nVal );
- else
- aString = ByteString::CreateFromInt32( aTmp.nVal );
- aString += aStr;
- }
-
- return aString;
-}
-
-// -----------------------------------------------------------------------
-
UniString BigInt::GetString() const
{
UniString aString;
More information about the Libreoffice-commits
mailing list