[Libreoffice-commits] core.git: 3 commits - include/tools lotuswordpro/source package/inc package/source tools/source
Noel Grandin
noel at peralex.com
Thu Dec 11 04:58:26 PST 2014
include/tools/inetmime.hxx | 6 +-
lotuswordpro/source/filter/lwpfilehdr.cxx | 12 ++--
lotuswordpro/source/filter/lwpobjhdr.cxx | 36 ++++++------
lotuswordpro/source/filter/lwpobjid.cxx | 10 +--
lotuswordpro/source/filter/lwpsvstream.cxx | 12 ++--
lotuswordpro/source/filter/lwpsvstream.hxx | 12 ++--
package/inc/ByteChucker.hxx | 12 ++--
package/inc/ByteGrabber.hxx | 12 ++--
package/source/zipapi/ByteChucker.cxx | 12 ++--
package/source/zipapi/ByteGrabber.cxx | 12 ++--
package/source/zipapi/MemoryByteGrabber.hxx | 12 ++--
package/source/zipapi/ZipFile.cxx | 74 ++++++++++++------------
package/source/zipapi/ZipOutputStream.cxx | 84 ++++++++++++++--------------
tools/source/inet/inetmime.cxx | 10 +--
14 files changed, 158 insertions(+), 158 deletions(-)
New commits:
commit cf01aff0027f3254ec1f4519447086fc76cbba3b
Author: Noel Grandin <noel at peralex.com>
Date: Thu Dec 11 08:22:44 2014 +0200
remove operator>> and operator<< methods
in favour of ReadXXX/WriteXXX methods
Change-Id: I39dfeee92e5b01fdf43db3bbee0f2fc471017653
diff --git a/include/tools/inetmime.hxx b/include/tools/inetmime.hxx
index 7190c38..0e0269a 100644
--- a/include/tools/inetmime.hxx
+++ b/include/tools/inetmime.hxx
@@ -995,7 +995,7 @@ public:
~INetMIMEEncodedWordOutputSink();
- INetMIMEEncodedWordOutputSink & operator <<(sal_uInt32 nChar);
+ INetMIMEEncodedWordOutputSink & WriteUInt32(sal_uInt32 nChar);
inline void write(const sal_Char * pBegin, const sal_Char * pEnd);
@@ -1032,7 +1032,7 @@ inline void INetMIMEEncodedWordOutputSink::write(const sal_Char * pBegin,
"INetMIMEEncodedWordOutputSink::write(): Bad sequence");
while (pBegin != pEnd)
- operator <<(*pBegin++);
+ WriteUInt32(*pBegin++);
}
inline void INetMIMEEncodedWordOutputSink::write(const sal_Unicode * pBegin,
@@ -1042,7 +1042,7 @@ inline void INetMIMEEncodedWordOutputSink::write(const sal_Unicode * pBegin,
"INetMIMEEncodedWordOutputSink::write(): Bad sequence");
while (pBegin != pEnd)
- operator <<(*pBegin++);
+ WriteUInt32(*pBegin++);
}
inline bool INetMIMEEncodedWordOutputSink::flush()
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index 1772e0f..f39bc62 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -1712,7 +1712,7 @@ void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink,
if (++pBodyPtr == pBodyEnd)
break;
default:
- aOutput << *pBodyPtr++;
+ aOutput.WriteUInt32( *pBodyPtr++ );
break;
}
comment_done:
@@ -2334,16 +2334,16 @@ void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink,
case '\\':
if (++pStart != pBodyPtr)
- aOutput << *pStart++;
+ aOutput.WriteUInt32( *pStart++ );
break;
case '\x0D': // CR
pStart += 2;
- aOutput << *pStart++;
+ aOutput.WriteUInt32( *pStart++ );
break;
default:
- aOutput << *pStart++;
+ aOutput.WriteUInt32( *pStart++ );
break;
}
bInitialSpace = aOutput.flush();
@@ -3520,7 +3520,7 @@ INetMIMEEncodedWordOutputSink::~INetMIMEEncodedWordOutputSink()
}
INetMIMEEncodedWordOutputSink &
-INetMIMEEncodedWordOutputSink::operator <<(sal_uInt32 nChar)
+INetMIMEEncodedWordOutputSink::WriteUInt32(sal_uInt32 nChar)
{
if (nChar == ' ')
{
commit 70d4989c2726e2b640e725be7e7e923c4047b627
Author: Noel Grandin <noel at peralex.com>
Date: Thu Dec 11 08:21:51 2014 +0200
remove operator>> methods
in favour of ReadXXX methods.
Change-Id: I242b92da7dbcafe22aef69dc7348ac58dadc9241
diff --git a/package/inc/ByteChucker.hxx b/package/inc/ByteChucker.hxx
index 4fb0c1c..7e3e60c 100644
--- a/package/inc/ByteChucker.hxx
+++ b/package/inc/ByteChucker.hxx
@@ -48,12 +48,12 @@ public:
sal_Int64 GetPosition()
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- ByteChucker& operator << (sal_Int8 nInt8);
- ByteChucker& operator << (sal_Int16 nInt16);
- ByteChucker& operator << (sal_Int32 nInt32);
- ByteChucker& operator << (sal_uInt8 nuInt8);
- ByteChucker& operator << (sal_uInt16 nuInt16);
- ByteChucker& operator << (sal_uInt32 nuInt32);
+ ByteChucker& WriteInt8(sal_Int8 nInt8);
+ ByteChucker& WriteInt16(sal_Int16 nInt16);
+ ByteChucker& WriteInt32(sal_Int32 nInt32);
+ ByteChucker& WriteUInt8(sal_uInt8 nuInt8);
+ ByteChucker& WriteUInt16(sal_uInt16 nuInt16);
+ ByteChucker& WriteUInt32(sal_uInt32 nuInt32);
};
#endif
diff --git a/package/inc/ByteGrabber.hxx b/package/inc/ByteGrabber.hxx
index 85dd6da..26df1b1 100644
--- a/package/inc/ByteGrabber.hxx
+++ b/package/inc/ByteGrabber.hxx
@@ -58,12 +58,12 @@ public:
sal_Int64 SAL_CALL getLength( )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- ByteGrabber& operator >> (sal_Int8& rInt8);
- ByteGrabber& operator >> (sal_Int16& rInt16);
- ByteGrabber& operator >> (sal_Int32& rInt32);
- ByteGrabber& operator >> (sal_uInt8& ruInt8);
- ByteGrabber& operator >> (sal_uInt16& ruInt16);
- ByteGrabber& operator >> (sal_uInt32& ruInt32);
+ ByteGrabber& ReadInt8(sal_Int8& rInt8);
+ ByteGrabber& ReadInt16(sal_Int16& rInt16);
+ ByteGrabber& ReadInt32(sal_Int32& rInt32);
+ ByteGrabber& ReadUInt8(sal_uInt8& ruInt8);
+ ByteGrabber& ReadUInt16(sal_uInt16& ruInt16);
+ ByteGrabber& ReadUInt32(sal_uInt32& ruInt32);
};
#endif
diff --git a/package/source/zipapi/ByteChucker.cxx b/package/source/zipapi/ByteChucker.cxx
index af2f2ad..5bcf642 100644
--- a/package/source/zipapi/ByteChucker.cxx
+++ b/package/source/zipapi/ByteChucker.cxx
@@ -54,21 +54,21 @@ sal_Int64 ByteChucker::GetPosition( )
return xSeek->getPosition();
}
-ByteChucker& ByteChucker::operator << (sal_Int8 nInt8)
+ByteChucker& ByteChucker::WriteInt8(sal_Int8 nInt8)
{
p1Sequence[0] = nInt8 & 0xFF;
WriteBytes( a1Sequence );
return *this;
}
-ByteChucker& ByteChucker::operator << (sal_Int16 nInt16)
+ByteChucker& ByteChucker::WriteInt16(sal_Int16 nInt16)
{
p2Sequence[0] = static_cast< sal_Int8 >((nInt16 >> 0 ) & 0xFF);
p2Sequence[1] = static_cast< sal_Int8 >((nInt16 >> 8 ) & 0xFF);
WriteBytes( a2Sequence );
return *this;
}
-ByteChucker& ByteChucker::operator << (sal_Int32 nInt32)
+ByteChucker& ByteChucker::WriteInt32(sal_Int32 nInt32)
{
p4Sequence[0] = static_cast< sal_Int8 >((nInt32 >> 0 ) & 0xFF);
p4Sequence[1] = static_cast< sal_Int8 >((nInt32 >> 8 ) & 0xFF);
@@ -78,20 +78,20 @@ ByteChucker& ByteChucker::operator << (sal_Int32 nInt32)
return *this;
}
-ByteChucker& ByteChucker::operator << (sal_uInt8 nuInt8)
+ByteChucker& ByteChucker::WriteUInt8(sal_uInt8 nuInt8)
{
p1Sequence[0] = nuInt8 & 0xFF;
WriteBytes( a1Sequence );
return *this;
}
-ByteChucker& ByteChucker::operator << (sal_uInt16 nuInt16)
+ByteChucker& ByteChucker::WriteUInt16(sal_uInt16 nuInt16)
{
p2Sequence[0] = static_cast< sal_Int8 >((nuInt16 >> 0 ) & 0xFF);
p2Sequence[1] = static_cast< sal_Int8 >((nuInt16 >> 8 ) & 0xFF);
WriteBytes( a2Sequence );
return *this;
}
-ByteChucker& ByteChucker::operator << (sal_uInt32 nuInt32)
+ByteChucker& ByteChucker::WriteUInt32(sal_uInt32 nuInt32)
{
p4Sequence[0] = static_cast < sal_Int8 > ((nuInt32 >> 0 ) & 0xFF);
p4Sequence[1] = static_cast < sal_Int8 > ((nuInt32 >> 8 ) & 0xFF);
diff --git a/package/source/zipapi/ByteGrabber.cxx b/package/source/zipapi/ByteGrabber.cxx
index 8b670ff..9b47a36 100644
--- a/package/source/zipapi/ByteGrabber.cxx
+++ b/package/source/zipapi/ByteGrabber.cxx
@@ -100,7 +100,7 @@ sal_Int64 SAL_CALL ByteGrabber::getLength( )
throw io::IOException(THROW_WHERE );
}
-ByteGrabber& ByteGrabber::operator >> (sal_Int8& rInt8)
+ByteGrabber& ByteGrabber::ReadInt8(sal_Int8& rInt8)
{
::osl::MutexGuard aGuard( m_aMutex );
if (xStream->readBytes(aSequence,1) != 1)
@@ -110,7 +110,7 @@ ByteGrabber& ByteGrabber::operator >> (sal_Int8& rInt8)
return *this;
}
-ByteGrabber& ByteGrabber::operator >> (sal_Int16& rInt16)
+ByteGrabber& ByteGrabber::ReadInt16(sal_Int16& rInt16)
{
::osl::MutexGuard aGuard( m_aMutex );
if (xStream->readBytes ( aSequence, 2) != 2)
@@ -125,7 +125,7 @@ ByteGrabber& ByteGrabber::operator >> (sal_Int16& rInt16)
return *this;
}
-ByteGrabber& ByteGrabber::operator >> (sal_Int32& rInt32)
+ByteGrabber& ByteGrabber::ReadInt32(sal_Int32& rInt32)
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -143,7 +143,7 @@ ByteGrabber& ByteGrabber::operator >> (sal_Int32& rInt32)
return *this;
}
-ByteGrabber& ByteGrabber::operator >> (sal_uInt8& rInt8)
+ByteGrabber& ByteGrabber::ReadUInt8(sal_uInt8& rInt8)
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -153,7 +153,7 @@ ByteGrabber& ByteGrabber::operator >> (sal_uInt8& rInt8)
rInt8 = static_cast < sal_uInt8 > (aSequence[0] & 0xFF );
return *this;
}
-ByteGrabber& ByteGrabber::operator >> (sal_uInt16& rInt16)
+ByteGrabber& ByteGrabber::ReadUInt16(sal_uInt16& rInt16)
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -168,7 +168,7 @@ ByteGrabber& ByteGrabber::operator >> (sal_uInt16& rInt16)
}
return *this;
}
-ByteGrabber& ByteGrabber::operator >> (sal_uInt32& ruInt32)
+ByteGrabber& ByteGrabber::ReadUInt32(sal_uInt32& ruInt32)
{
::osl::MutexGuard aGuard( m_aMutex );
diff --git a/package/source/zipapi/MemoryByteGrabber.hxx b/package/source/zipapi/MemoryByteGrabber.hxx
index 5dcc2fc..318b93c 100644
--- a/package/source/zipapi/MemoryByteGrabber.hxx
+++ b/package/source/zipapi/MemoryByteGrabber.hxx
@@ -99,7 +99,7 @@ public:
{
return mnEnd;
}
- MemoryByteGrabber& operator >> (sal_Int8& rInt8)
+ MemoryByteGrabber& ReadInt8(sal_Int8& rInt8)
{
if (mnCurrent + 1 > mnEnd )
rInt8 = 0;
@@ -107,7 +107,7 @@ public:
rInt8 = mpBuffer [mnCurrent++] & 0xFF;
return *this;
}
- MemoryByteGrabber& operator >> (sal_Int16& rInt16)
+ MemoryByteGrabber& ReadInt16(sal_Int16& rInt16)
{
if (mnCurrent + 2 > mnEnd )
rInt16 = 0;
@@ -118,7 +118,7 @@ public:
}
return *this;
}
- MemoryByteGrabber& operator >> (sal_Int32& rInt32)
+ MemoryByteGrabber& ReadInt32(sal_Int32& rInt32)
{
if (mnCurrent + 4 > mnEnd )
rInt32 = 0;
@@ -132,7 +132,7 @@ public:
return *this;
}
- MemoryByteGrabber& operator >> (sal_uInt8& rInt8)
+ MemoryByteGrabber& ReadUInt8(sal_uInt8& rInt8)
{
if (mnCurrent + 1 > mnEnd )
rInt8 = 0;
@@ -140,7 +140,7 @@ public:
rInt8 = mpBuffer [mnCurrent++] & 0xFF;
return *this;
}
- MemoryByteGrabber& operator >> (sal_uInt16& rInt16)
+ MemoryByteGrabber& ReadUInt16(sal_uInt16& rInt16)
{
if (mnCurrent + 2 > mnEnd )
rInt16 = 0;
@@ -151,7 +151,7 @@ public:
}
return *this;
}
- MemoryByteGrabber& operator >> (sal_uInt32& rInt32)
+ MemoryByteGrabber& ReadUInt32(sal_uInt32& rInt32)
{
if (mnCurrent + 4 > mnEnd )
rInt32 = 0;
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index f2dc709..0fe8ff2 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -639,19 +639,19 @@ bool ZipFile::readLOC( ZipEntry &rEntry )
sal_Int64 nPos = -rEntry.nOffset;
aGrabber.seek(nPos);
- aGrabber >> nTestSig;
+ aGrabber.ReadInt32( nTestSig );
if (nTestSig != LOCSIG)
throw ZipIOException("Invalid LOC header (bad signature)" );
- aGrabber >> nVersion;
- aGrabber >> nFlag;
- aGrabber >> nHow;
- aGrabber >> nTime;
- aGrabber >> nCRC;
- aGrabber >> nCompressedSize;
- aGrabber >> nSize;
- aGrabber >> nPathLen;
- aGrabber >> nExtraLen;
+ aGrabber.ReadInt16( nVersion );
+ aGrabber.ReadInt16( nFlag );
+ aGrabber.ReadInt16( nHow );
+ aGrabber.ReadInt32( nTime );
+ aGrabber.ReadInt32( nCRC );
+ aGrabber.ReadInt32( nCompressedSize );
+ aGrabber.ReadInt32( nSize );
+ aGrabber.ReadInt16( nPathLen );
+ aGrabber.ReadInt16( nExtraLen );
rEntry.nOffset = aGrabber.getPosition() + nPathLen + nExtraLen;
// FIXME64: need to read 64bit LOC
@@ -763,9 +763,9 @@ sal_Int32 ZipFile::readCEN()
if (nEndPos == -1)
return -1;
aGrabber.seek(nEndPos + ENDTOT);
- aGrabber >> nTotal;
- aGrabber >> nCenLen;
- aGrabber >> nCenOff;
+ aGrabber.ReadUInt16( nTotal );
+ aGrabber.ReadInt32( nCenLen );
+ aGrabber.ReadInt32( nCenOff );
if ( nTotal * CENHDR > nCenLen )
throw ZipException("invalid END header (bad entry count)" );
@@ -796,34 +796,34 @@ sal_Int32 ZipFile::readCEN()
for (nCount = 0 ; nCount < nTotal; nCount++)
{
- aMemGrabber >> nTestSig;
+ aMemGrabber.ReadInt32( nTestSig );
if ( nTestSig != CENSIG )
throw ZipException("Invalid CEN header (bad signature)" );
aMemGrabber.skipBytes ( 2 );
- aMemGrabber >> aEntry.nVersion;
+ aMemGrabber.ReadInt16( aEntry.nVersion );
if ( ( aEntry.nVersion & 1 ) == 1 )
throw ZipException("Invalid CEN header (encrypted entry)" );
- aMemGrabber >> aEntry.nFlag;
- aMemGrabber >> aEntry.nMethod;
+ aMemGrabber.ReadInt16( aEntry.nFlag );
+ aMemGrabber.ReadInt16( aEntry.nMethod );
if ( aEntry.nMethod != STORED && aEntry.nMethod != DEFLATED)
throw ZipException("Invalid CEN header (bad compression method)" );
- aMemGrabber >> aEntry.nTime;
- aMemGrabber >> aEntry.nCrc;
+ aMemGrabber.ReadInt32( aEntry.nTime );
+ aMemGrabber.ReadInt32( aEntry.nCrc );
sal_uInt32 nCompressedSize, nSize, nOffset;
- aMemGrabber >> nCompressedSize;
- aMemGrabber >> nSize;
- aMemGrabber >> aEntry.nPathLen;
- aMemGrabber >> aEntry.nExtraLen;
- aMemGrabber >> nCommentLen;
+ aMemGrabber.ReadUInt32( nCompressedSize );
+ aMemGrabber.ReadUInt32( nSize );
+ aMemGrabber.ReadInt16( aEntry.nPathLen );
+ aMemGrabber.ReadInt16( aEntry.nExtraLen );
+ aMemGrabber.ReadInt16( nCommentLen );
aMemGrabber.skipBytes ( 8 );
- aMemGrabber >> nOffset;
+ aMemGrabber.ReadUInt32( nOffset );
// FIXME64: need to read the 64bit header instead
if ( nSize == 0xffffffff ||
@@ -905,22 +905,22 @@ sal_Int32 ZipFile::recover()
ZipEntry aEntry;
MemoryByteGrabber aMemGrabber ( Sequence< sal_Int8 >( ((sal_Int8*)(&(pBuffer[nPos+4]))), 26 ) );
- aMemGrabber >> aEntry.nVersion;
+ aMemGrabber.ReadInt16( aEntry.nVersion );
if ( ( aEntry.nVersion & 1 ) != 1 )
{
- aMemGrabber >> aEntry.nFlag;
- aMemGrabber >> aEntry.nMethod;
+ aMemGrabber.ReadInt16( aEntry.nFlag );
+ aMemGrabber.ReadInt16( aEntry.nMethod );
if ( aEntry.nMethod == STORED || aEntry.nMethod == DEFLATED )
{
sal_uInt32 nCompressedSize, nSize;
- aMemGrabber >> aEntry.nTime;
- aMemGrabber >> aEntry.nCrc;
- aMemGrabber >> nCompressedSize;
- aMemGrabber >> nSize;
- aMemGrabber >> aEntry.nPathLen;
- aMemGrabber >> aEntry.nExtraLen;
+ aMemGrabber.ReadInt32( aEntry.nTime );
+ aMemGrabber.ReadInt32( aEntry.nCrc );
+ aMemGrabber.ReadUInt32( nCompressedSize );
+ aMemGrabber.ReadUInt32( nSize );
+ aMemGrabber.ReadInt16( aEntry.nPathLen );
+ aMemGrabber.ReadInt16( aEntry.nExtraLen );
// FIXME64: need to read the 64bit header instead
if ( nSize == 0xffffffff ||
@@ -978,9 +978,9 @@ sal_Int32 ZipFile::recover()
sal_uInt32 nCompressedSize32, nSize32;
sal_Int64 nCompressedSize, nSize;
MemoryByteGrabber aMemGrabber ( Sequence< sal_Int8 >( ((sal_Int8*)(&(pBuffer[nPos+4]))), 12 ) );
- aMemGrabber >> nCRC32;
- aMemGrabber >> nCompressedSize32;
- aMemGrabber >> nSize32;
+ aMemGrabber.ReadInt32( nCRC32 );
+ aMemGrabber.ReadUInt32( nCompressedSize32 );
+ aMemGrabber.ReadUInt32( nSize32 );
// FIXME64: work to be done here ...
nCompressedSize = nCompressedSize32;
diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx
index 9c12527..f16327e 100644
--- a/package/source/zipapi/ZipOutputStream.cxx
+++ b/package/source/zipapi/ZipOutputStream.cxx
@@ -122,14 +122,14 @@ void ZipOutputStream::finish()
void ZipOutputStream::writeEND(sal_uInt32 nOffset, sal_uInt32 nLength)
throw(IOException, RuntimeException)
{
- m_aChucker << ENDSIG;
- m_aChucker << static_cast < sal_Int16 > ( 0 );
- m_aChucker << static_cast < sal_Int16 > ( 0 );
- m_aChucker << static_cast < sal_Int16 > ( m_aZipList.size() );
- m_aChucker << static_cast < sal_Int16 > ( m_aZipList.size() );
- m_aChucker << nLength;
- m_aChucker << nOffset;
- m_aChucker << static_cast < sal_Int16 > ( 0 );
+ m_aChucker.WriteInt32( ENDSIG );
+ m_aChucker.WriteInt16( static_cast < sal_Int16 > ( 0 ) );
+ m_aChucker.WriteInt16( static_cast < sal_Int16 > ( 0 ) );
+ m_aChucker.WriteInt16( static_cast < sal_Int16 > ( m_aZipList.size() ) );
+ m_aChucker.WriteInt16( static_cast < sal_Int16 > ( m_aZipList.size() ) );
+ m_aChucker.WriteUInt32( nLength );
+ m_aChucker.WriteUInt32( nOffset );
+ m_aChucker.WriteInt16( static_cast < sal_Int16 > ( 0 ) );
}
static sal_uInt32 getTruncated( sal_Int64 nNum, bool *pIsTruncated )
@@ -152,24 +152,24 @@ void ZipOutputStream::writeCEN( const ZipEntry &rEntry )
OString sUTF8Name = OUStringToOString( rEntry.sPath, RTL_TEXTENCODING_UTF8 );
sal_Int16 nNameLength = static_cast < sal_Int16 > ( sUTF8Name.getLength() );
- m_aChucker << CENSIG;
- m_aChucker << rEntry.nVersion;
- m_aChucker << rEntry.nVersion;
- m_aChucker << rEntry.nFlag;
- m_aChucker << rEntry.nMethod;
+ m_aChucker.WriteInt32( CENSIG );
+ m_aChucker.WriteInt16( rEntry.nVersion );
+ m_aChucker.WriteInt16( rEntry.nVersion );
+ m_aChucker.WriteInt16( rEntry.nFlag );
+ m_aChucker.WriteInt16( rEntry.nMethod );
bool bWrite64Header = false;
- m_aChucker << static_cast < sal_uInt32> ( rEntry.nTime );
- m_aChucker << static_cast < sal_uInt32> ( rEntry.nCrc );
- m_aChucker << getTruncated( rEntry.nCompressedSize, &bWrite64Header );
- m_aChucker << getTruncated( rEntry.nSize, &bWrite64Header );
- m_aChucker << nNameLength;
- m_aChucker << static_cast < sal_Int16> (0);
- m_aChucker << static_cast < sal_Int16> (0);
- m_aChucker << static_cast < sal_Int16> (0);
- m_aChucker << static_cast < sal_Int16> (0);
- m_aChucker << static_cast < sal_Int32> (0);
- m_aChucker << getTruncated( rEntry.nOffset, &bWrite64Header );
+ m_aChucker.WriteUInt32( static_cast < sal_uInt32> ( rEntry.nTime ) );
+ m_aChucker.WriteUInt32( static_cast < sal_uInt32> ( rEntry.nCrc ) );
+ m_aChucker.WriteUInt32( getTruncated( rEntry.nCompressedSize, &bWrite64Header ) );
+ m_aChucker.WriteUInt32( getTruncated( rEntry.nSize, &bWrite64Header ) );
+ m_aChucker.WriteInt16( nNameLength );
+ m_aChucker.WriteInt16( static_cast < sal_Int16> (0) );
+ m_aChucker.WriteInt16( static_cast < sal_Int16> (0) );
+ m_aChucker.WriteInt16( static_cast < sal_Int16> (0) );
+ m_aChucker.WriteInt16( static_cast < sal_Int16> (0) );
+ m_aChucker.WriteInt32( static_cast < sal_Int32> (0) );
+ m_aChucker.WriteUInt32( getTruncated( rEntry.nOffset, &bWrite64Header ) );
if( bWrite64Header )
{
@@ -188,10 +188,10 @@ void ZipOutputStream::writeEXT( const ZipEntry &rEntry )
{
bool bWrite64Header = false;
- m_aChucker << EXTSIG;
- m_aChucker << static_cast < sal_uInt32> ( rEntry.nCrc );
- m_aChucker << getTruncated( rEntry.nCompressedSize, &bWrite64Header );
- m_aChucker << getTruncated( rEntry.nSize, &bWrite64Header );
+ m_aChucker.WriteInt32( EXTSIG );
+ m_aChucker.WriteUInt32( static_cast < sal_uInt32> ( rEntry.nCrc ) );
+ m_aChucker.WriteUInt32( getTruncated( rEntry.nCompressedSize, &bWrite64Header ) );
+ m_aChucker.WriteUInt32( getTruncated( rEntry.nSize, &bWrite64Header ) );
if( bWrite64Header )
{
@@ -216,33 +216,33 @@ void ZipOutputStream::writeLOC( ZipEntry *pEntry, bool bEncrypt )
OString sUTF8Name = OUStringToOString( rEntry.sPath, RTL_TEXTENCODING_UTF8 );
sal_Int16 nNameLength = static_cast < sal_Int16 > ( sUTF8Name.getLength() );
- m_aChucker << LOCSIG;
- m_aChucker << rEntry.nVersion;
+ m_aChucker.WriteInt32( LOCSIG );
+ m_aChucker.WriteInt16( rEntry.nVersion );
- m_aChucker << rEntry.nFlag;
+ m_aChucker.WriteInt16( rEntry.nFlag );
// If it's an encrypted entry, we pretend its stored plain text
if (bEncrypt)
- m_aChucker << static_cast < sal_Int16 > ( STORED );
+ m_aChucker.WriteInt16( static_cast < sal_Int16 > ( STORED ) );
else
- m_aChucker << rEntry.nMethod;
+ m_aChucker.WriteInt16( rEntry.nMethod );
bool bWrite64Header = false;
- m_aChucker << static_cast < sal_uInt32 > (rEntry.nTime);
+ m_aChucker.WriteUInt32( static_cast < sal_uInt32 > (rEntry.nTime) );
if ((rEntry.nFlag & 8) == 8 )
{
- m_aChucker << static_cast < sal_Int32 > (0);
- m_aChucker << static_cast < sal_Int32 > (0);
- m_aChucker << static_cast < sal_Int32 > (0);
+ m_aChucker.WriteInt32( static_cast < sal_Int32 > (0) );
+ m_aChucker.WriteInt32( static_cast < sal_Int32 > (0) );
+ m_aChucker.WriteInt32( static_cast < sal_Int32 > (0) );
}
else
{
- m_aChucker << static_cast < sal_uInt32 > (rEntry.nCrc);
- m_aChucker << getTruncated( rEntry.nCompressedSize, &bWrite64Header );
- m_aChucker << getTruncated( rEntry.nSize, &bWrite64Header );
+ m_aChucker.WriteUInt32( static_cast < sal_uInt32 > (rEntry.nCrc) );
+ m_aChucker.WriteUInt32( getTruncated( rEntry.nCompressedSize, &bWrite64Header ) );
+ m_aChucker.WriteUInt32( getTruncated( rEntry.nSize, &bWrite64Header ) );
}
- m_aChucker << nNameLength;
- m_aChucker << static_cast < sal_Int16 > (0);
+ m_aChucker.WriteInt16( nNameLength );
+ m_aChucker.WriteInt16( static_cast < sal_Int16 > (0) );
if( bWrite64Header )
{
commit 5d75ef73a2e77e93da1ac3cf77c7dbb170107935
Author: Noel Grandin <noel at peralex.com>
Date: Thu Dec 11 08:20:21 2014 +0200
remove LwpSvStream::operator>> methods
in favour of ReadXXX methods.
Change-Id: Ifa627cf190b22315f4ce294c1ec268c4d1361748
diff --git a/lotuswordpro/source/filter/lwpfilehdr.cxx b/lotuswordpro/source/filter/lwpfilehdr.cxx
index d2d87ac..5bcbf6d 100644
--- a/lotuswordpro/source/filter/lwpfilehdr.cxx
+++ b/lotuswordpro/source/filter/lwpfilehdr.cxx
@@ -70,22 +70,22 @@ LwpFileHeader::LwpFileHeader()
sal_uInt32 LwpFileHeader::Read(LwpSvStream *pStrm)
{
sal_uInt32 len = 0;
- *pStrm >> m_nAppRevision;
+ pStrm->ReadUInt16( m_nAppRevision );
len += sizeof(m_nAppRevision);
- *pStrm >> m_nFileRevision;
+ pStrm->ReadUInt16( m_nFileRevision );
len += sizeof(m_nFileRevision);
- *pStrm >> m_nAppReleaseNo;
+ pStrm->ReadUInt16( m_nAppReleaseNo );
len += sizeof(m_nAppReleaseNo);
- *pStrm >> m_nRequiredAppRevision;
+ pStrm->ReadUInt16( m_nRequiredAppRevision );
len += sizeof(m_nRequiredAppRevision);
- *pStrm >> m_nRequiredFileRevision;
+ pStrm->ReadUInt16( m_nRequiredFileRevision );
len += sizeof(m_nRequiredFileRevision);
len += m_cDocumentID.Read(pStrm);
if (m_nFileRevision < 0x000B)
m_nRootIndexOffset = BAD_OFFSET;
else
{
- *pStrm >> m_nRootIndexOffset;
+ pStrm->ReadUInt32( m_nRootIndexOffset );
len += sizeof(m_nRootIndexOffset);
}
return len;
diff --git a/lotuswordpro/source/filter/lwpobjhdr.cxx b/lotuswordpro/source/filter/lwpobjhdr.cxx
index d15aa52..2010b78 100644
--- a/lotuswordpro/source/filter/lwpobjhdr.cxx
+++ b/lotuswordpro/source/filter/lwpobjhdr.cxx
@@ -85,11 +85,11 @@ bool LwpObjectHeader::Read(LwpSvStream &rStrm)
if ( LwpFileHeader::m_nFileRevision < 0x000B)
{
- rStrm >> m_nTag;
+ rStrm.ReadUInt32( m_nTag );
m_ID.Read(&rStrm);
- rStrm >> nVersionID;
- rStrm >> nRefCount;
- rStrm >> nNextVersionOffset;
+ rStrm.ReadUInt32( nVersionID );
+ rStrm.ReadUInt32( nRefCount );
+ rStrm.ReadUInt32( nNextVersionOffset );
nHeaderSize = sizeof(m_nTag) + m_ID.DiskSize()
+ sizeof(nVersionID)
@@ -100,17 +100,17 @@ bool LwpObjectHeader::Read(LwpSvStream &rStrm)
if ((m_nTag == TAG_AMI) || ( LwpFileHeader::m_nFileRevision < 0x0006))
{
sal_uInt32 nNextVersionID = 0;
- rStrm >> nNextVersionID;
+ rStrm.ReadUInt32( nNextVersionID );
nHeaderSize += sizeof(nNextVersionID);
}
- rStrm >> m_nSize;
+ rStrm.ReadUInt32( m_nSize );
}
else
{
sal_uInt8 nFlagBits = 0;
sal_uInt16 VOType = 0;
- rStrm >> VOType;
- rStrm >> nFlagBits;
+ rStrm.ReadUInt16( VOType );
+ rStrm.ReadUInt8( nFlagBits );
m_nTag = static_cast<sal_uInt32>(VOType);
m_ID.ReadIndexed(&rStrm);
@@ -121,19 +121,19 @@ bool LwpObjectHeader::Read(LwpSvStream &rStrm)
switch (nFlagBits & VERSION_BITS)
{
case ONE_BYTE_VERSION:
- rStrm >> tmpByte;
+ rStrm.ReadUInt8( tmpByte );
nVersionID = static_cast<sal_uInt32>( tmpByte );
nHeaderSize++;
break;
case TWO_BYTE_VERSION:
- rStrm >> tmpShort;
+ rStrm.ReadUInt16( tmpShort );
nVersionID = static_cast<sal_uInt32>( tmpShort );
nHeaderSize += 2;
break;
case FOUR_BYTE_VERSION:
- rStrm >> nVersionID;
+ rStrm.ReadUInt32( nVersionID );
nHeaderSize += 4;
break;
case DEFAULT_VERSION: //fall through
@@ -145,27 +145,27 @@ bool LwpObjectHeader::Read(LwpSvStream &rStrm)
switch (nFlagBits & REFCOUNT_BITS)
{
case ONE_BYTE_REFCOUNT:
- rStrm >> tmpByte;
+ rStrm.ReadUInt8( tmpByte );
nRefCount = static_cast<sal_uInt32>( tmpByte );
nHeaderSize++;
break;
case TWO_BYTE_REFCOUNT:
- rStrm >> tmpShort;
+ rStrm.ReadUInt16( tmpShort );
nRefCount = static_cast<sal_uInt32>( tmpShort );
nHeaderSize += 2;
break;
case FOUR_BYTE_REFCOUNT: //through
default:
- rStrm >> nRefCount;
+ rStrm.ReadUInt32( nRefCount );
nHeaderSize += 4;
break;
}
if (nFlagBits & HAS_PREVOFFSET)
{
- rStrm >> nNextVersionOffset;
+ rStrm.ReadUInt32( nNextVersionOffset );
nHeaderSize += 4;
}
else
@@ -174,20 +174,20 @@ bool LwpObjectHeader::Read(LwpSvStream &rStrm)
switch (nFlagBits & SIZE_BITS)
{
case ONE_BYTE_SIZE:
- rStrm >> tmpByte;
+ rStrm.ReadUInt8( tmpByte );
m_nSize = static_cast<sal_uInt32>( tmpByte );
nHeaderSize++;
break;
case TWO_BYTE_SIZE:
- rStrm >> tmpShort;
+ rStrm.ReadUInt16( tmpShort );
m_nSize = static_cast<sal_uInt32>(tmpShort);
nHeaderSize += 2;
break;
case FOUR_BYTE_SIZE: //go through
default:
- rStrm >> m_nSize;
+ rStrm.ReadUInt32( m_nSize );
nHeaderSize += 4;
break;
}
diff --git a/lotuswordpro/source/filter/lwpobjid.cxx b/lotuswordpro/source/filter/lwpobjid.cxx
index 0c64f91..54b4778 100644
--- a/lotuswordpro/source/filter/lwpobjid.cxx
+++ b/lotuswordpro/source/filter/lwpobjid.cxx
@@ -77,8 +77,8 @@ LwpObjectID::LwpObjectID(sal_uInt32 low, sal_uInt16 high)
*/
sal_uInt32 LwpObjectID::Read(LwpSvStream *pStrm)
{
- *pStrm >> m_nLow;
- *pStrm >> m_nHigh;
+ pStrm->ReadUInt32( m_nLow );
+ pStrm->ReadUInt16( m_nHigh );
return DiskSize();
}
/**
@@ -104,7 +104,7 @@ sal_uInt32 LwpObjectID::ReadIndexed(LwpSvStream *pStrm)
return Read(pStrm);
}
- *pStrm >> m_nIndex;
+ pStrm->ReadUInt8( m_nIndex );
if (m_nIndex)
{
@@ -117,9 +117,9 @@ sal_uInt32 LwpObjectID::ReadIndexed(LwpSvStream *pStrm)
}
else
{
- *pStrm >> m_nLow;
+ pStrm->ReadUInt32( m_nLow );
}
- *pStrm >> m_nHigh;
+ pStrm->ReadUInt16( m_nHigh );
return DiskSizeIndexed();
}
diff --git a/lotuswordpro/source/filter/lwpsvstream.cxx b/lotuswordpro/source/filter/lwpsvstream.cxx
index 3cd2c44..b65696f 100644
--- a/lotuswordpro/source/filter/lwpsvstream.cxx
+++ b/lotuswordpro/source/filter/lwpsvstream.cxx
@@ -70,37 +70,37 @@ sal_Int32 LwpSvStream::Read(void* buf, sal_Int32 nBytesToRead)
return m_pStream->Read(buf,nBytesToRead);
}
-LwpSvStream& LwpSvStream::operator>>( sal_uInt8& rUInt8 )
+LwpSvStream& LwpSvStream::ReadUInt8( sal_uInt8& rUInt8 )
{
m_pStream->ReadUChar( rUInt8 );
return *this;
}
-LwpSvStream& LwpSvStream::operator>>( sal_uInt16& rUInt16 )
+LwpSvStream& LwpSvStream::ReadUInt16( sal_uInt16& rUInt16 )
{
m_pStream->ReadUInt16( rUInt16 );
return *this;
}
-LwpSvStream& LwpSvStream::operator>>( sal_uInt32& rUInt32 )
+LwpSvStream& LwpSvStream::ReadUInt32( sal_uInt32& rUInt32 )
{
m_pStream->ReadUInt32( rUInt32 );
return *this;
}
-LwpSvStream& LwpSvStream::operator>>( sal_Int8& rInt8 )
+LwpSvStream& LwpSvStream::ReadInt8( sal_Int8& rInt8 )
{
m_pStream->ReadSChar( rInt8 );
return *this;
}
-LwpSvStream& LwpSvStream::operator>>( sal_Int16& rInt16 )
+LwpSvStream& LwpSvStream::ReadInt16( sal_Int16& rInt16 )
{
m_pStream->ReadInt16( rInt16 );
return *this;
}
-LwpSvStream& LwpSvStream::operator>>( sal_Int32& rInt32 )
+LwpSvStream& LwpSvStream::ReadInt32( sal_Int32& rInt32 )
{
m_pStream->ReadInt32( rInt32 );
return *this;
diff --git a/lotuswordpro/source/filter/lwpsvstream.hxx b/lotuswordpro/source/filter/lwpsvstream.hxx
index b8a4aa6..0917cd4 100644
--- a/lotuswordpro/source/filter/lwpsvstream.hxx
+++ b/lotuswordpro/source/filter/lwpsvstream.hxx
@@ -72,13 +72,13 @@ public:
sal_Int64 Tell();
sal_Int64 Seek( sal_Int64 pos );
- LwpSvStream& operator>>( sal_uInt8& rUInt8 );
- LwpSvStream& operator>>( sal_uInt16& rUInt16 );
- LwpSvStream& operator>>( sal_uInt32& rUInt32 );
+ LwpSvStream& ReadUInt8( sal_uInt8& rUInt8 );
+ LwpSvStream& ReadUInt16( sal_uInt16& rUInt16 );
+ LwpSvStream& ReadUInt32( sal_uInt32& rUInt32 );
- LwpSvStream& operator>>( sal_Int8& rInt8 );
- LwpSvStream& operator>>( sal_Int16& rInt16 );
- LwpSvStream& operator>>( sal_Int32& rInt32 );
+ LwpSvStream& ReadInt8( sal_Int8& rInt8 );
+ LwpSvStream& ReadInt16( sal_Int16& rInt16 );
+ LwpSvStream& ReadInt32( sal_Int32& rInt32 );
static const sal_uInt32 LWP_STREAM_BASE;
More information about the Libreoffice-commits
mailing list