summaryrefslogtreecommitdiffstats
path: root/lotuswordpro/source/filter/lwpobjhdr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'lotuswordpro/source/filter/lwpobjhdr.cxx')
-rw-r--r--lotuswordpro/source/filter/lwpobjhdr.cxx75
1 files changed, 38 insertions, 37 deletions
diff --git a/lotuswordpro/source/filter/lwpobjhdr.cxx b/lotuswordpro/source/filter/lwpobjhdr.cxx
index d93cf001fd19..13ade159cd82 100644
--- a/lotuswordpro/source/filter/lwpobjhdr.cxx
+++ b/lotuswordpro/source/filter/lwpobjhdr.cxx
@@ -64,12 +64,16 @@
#include <lwpfilehdr.hxx>
LwpObjectHeader::LwpObjectHeader()
- : m_nTag(0), m_ID(), m_nSize(0), m_bCompressed(false)
-{}
+ : m_nTag(0)
+ , m_ID()
+ , m_nSize(0)
+ , m_bCompressed(false)
+{
+}
/**
* @descr read header from stream
*/
-bool LwpObjectHeader::Read(LwpSvStream &rStrm)
+bool LwpObjectHeader::Read(LwpSvStream& rStrm)
{
sal_uInt32 nVersionID = 0;
sal_uInt32 nRefCount = 0;
@@ -78,34 +82,31 @@ bool LwpObjectHeader::Read(LwpSvStream &rStrm)
sal_Int64 nStartPos = rStrm.Tell();
- if ( LwpFileHeader::m_nFileRevision < 0x000B)
+ if (LwpFileHeader::m_nFileRevision < 0x000B)
{
- rStrm.ReadUInt32( m_nTag );
+ rStrm.ReadUInt32(m_nTag);
m_ID.Read(&rStrm);
- rStrm.ReadUInt32( nVersionID );
- rStrm.ReadUInt32( nRefCount );
- rStrm.ReadUInt32( nNextVersionOffset );
+ rStrm.ReadUInt32(nVersionID);
+ rStrm.ReadUInt32(nRefCount);
+ rStrm.ReadUInt32(nNextVersionOffset);
- nHeaderSize = sizeof(m_nTag) + LwpObjectID::DiskSize()
- + sizeof(nVersionID)
- + sizeof(nRefCount)
- + sizeof(nNextVersionOffset)
- + sizeof(m_nSize);
+ nHeaderSize = sizeof(m_nTag) + LwpObjectID::DiskSize() + sizeof(nVersionID)
+ + sizeof(nRefCount) + sizeof(nNextVersionOffset) + sizeof(m_nSize);
- if ((m_nTag == TAG_AMI) || ( LwpFileHeader::m_nFileRevision < 0x0006))
+ if ((m_nTag == TAG_AMI) || (LwpFileHeader::m_nFileRevision < 0x0006))
{
sal_uInt32 nNextVersionID = 0;
- rStrm.ReadUInt32( nNextVersionID );
+ rStrm.ReadUInt32(nNextVersionID);
nHeaderSize += sizeof(nNextVersionID);
}
- rStrm.ReadUInt32( m_nSize );
+ rStrm.ReadUInt32(m_nSize);
}
else
{
sal_uInt8 nFlagBits = 0;
sal_uInt16 VOType = 0;
- rStrm.ReadUInt16( VOType );
- rStrm.ReadUInt8( nFlagBits );
+ rStrm.ReadUInt16(VOType);
+ rStrm.ReadUInt8(nFlagBits);
m_nTag = static_cast<sal_uInt32>(VOType);
m_ID.ReadIndexed(&rStrm);
@@ -116,51 +117,51 @@ bool LwpObjectHeader::Read(LwpSvStream &rStrm)
switch (nFlagBits & VERSION_BITS)
{
case ONE_BYTE_VERSION:
- rStrm.ReadUInt8( tmpByte );
- nVersionID = static_cast<sal_uInt32>( tmpByte );
+ rStrm.ReadUInt8(tmpByte);
+ nVersionID = static_cast<sal_uInt32>(tmpByte);
nHeaderSize++;
break;
case TWO_BYTE_VERSION:
- rStrm.ReadUInt16( tmpShort );
- nVersionID = static_cast<sal_uInt32>( tmpShort );
+ rStrm.ReadUInt16(tmpShort);
+ nVersionID = static_cast<sal_uInt32>(tmpShort);
nHeaderSize += 2;
break;
case FOUR_BYTE_VERSION:
- rStrm.ReadUInt32( nVersionID );
+ rStrm.ReadUInt32(nVersionID);
nHeaderSize += 4;
break;
- case DEFAULT_VERSION: //fall through
+ case DEFAULT_VERSION: //fall through
default:
nVersionID = 2;
- break; // nothing
+ break; // nothing
}
switch (nFlagBits & REFCOUNT_BITS)
{
case ONE_BYTE_REFCOUNT:
- rStrm.ReadUInt8( tmpByte );
- nRefCount = static_cast<sal_uInt32>( tmpByte );
+ rStrm.ReadUInt8(tmpByte);
+ nRefCount = static_cast<sal_uInt32>(tmpByte);
nHeaderSize++;
break;
case TWO_BYTE_REFCOUNT:
- rStrm.ReadUInt16( tmpShort );
- nRefCount = static_cast<sal_uInt32>( tmpShort );
+ rStrm.ReadUInt16(tmpShort);
+ nRefCount = static_cast<sal_uInt32>(tmpShort);
nHeaderSize += 2;
break;
- case FOUR_BYTE_REFCOUNT: //through
+ case FOUR_BYTE_REFCOUNT: //through
default:
- rStrm.ReadUInt32( nRefCount );
+ rStrm.ReadUInt32(nRefCount);
nHeaderSize += 4;
break;
}
if (nFlagBits & HAS_PREVOFFSET)
{
- rStrm.ReadUInt32( nNextVersionOffset );
+ rStrm.ReadUInt32(nNextVersionOffset);
nHeaderSize += 4;
}
else
@@ -169,20 +170,20 @@ bool LwpObjectHeader::Read(LwpSvStream &rStrm)
switch (nFlagBits & SIZE_BITS)
{
case ONE_BYTE_SIZE:
- rStrm.ReadUInt8( tmpByte );
- m_nSize = static_cast<sal_uInt32>( tmpByte );
+ rStrm.ReadUInt8(tmpByte);
+ m_nSize = static_cast<sal_uInt32>(tmpByte);
nHeaderSize++;
break;
case TWO_BYTE_SIZE:
- rStrm.ReadUInt16( tmpShort );
+ rStrm.ReadUInt16(tmpShort);
m_nSize = static_cast<sal_uInt32>(tmpShort);
nHeaderSize += 2;
break;
- case FOUR_BYTE_SIZE: //go through
+ case FOUR_BYTE_SIZE: //go through
default:
- rStrm.ReadUInt32( m_nSize );
+ rStrm.ReadUInt32(m_nSize);
nHeaderSize += 4;
break;
}