|
|
b48a986 |
From 580544213509feb73bd2dbc6403c233194da6be0 Mon Sep 17 00:00:00 2001
|
|
|
b48a986 |
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
|
b48a986 |
Date: Sun, 22 May 2011 21:15:05 +0100
|
|
|
b48a986 |
Subject: [PATCH] fix up endianness of higher-hanging QuickReads
|
|
|
b48a986 |
|
|
|
b48a986 |
---
|
|
|
b48a986 |
lotuswordpro/source/filter/lwpcharacterstyle.cxx | 16 ++++-----
|
|
|
b48a986 |
.../source/filter/lwpcharborderoverride.cxx | 4 +-
|
|
|
b48a986 |
lotuswordpro/source/filter/lwpmargins.hxx | 10 ++---
|
|
|
b48a986 |
lotuswordpro/source/filter/lwpoverride.cxx | 38 +++++++++----------
|
|
|
b48a986 |
.../source/filter/lwpparaborderoverride.cxx | 17 +++++----
|
|
|
b48a986 |
lotuswordpro/source/filter/lwpsilverbullet.cxx | 11 ++----
|
|
|
b48a986 |
6 files changed, 44 insertions(+), 52 deletions(-)
|
|
|
b48a986 |
|
|
|
b48a986 |
diff --git a/lotuswordpro/source/filter/lwpcharacterstyle.cxx b/lotuswordpro/source/filter/lwpcharacterstyle.cxx
|
|
|
b48a986 |
index d1c24b1..8b57de4 100644
|
|
|
b48a986 |
--- a/lotuswordpro/source/filter/lwpcharacterstyle.cxx
|
|
|
b48a986 |
+++ b/lotuswordpro/source/filter/lwpcharacterstyle.cxx
|
|
|
b48a986 |
@@ -115,10 +115,10 @@ LwpTextStyle::~LwpTextStyle()
|
|
|
b48a986 |
|
|
|
b48a986 |
void LwpTextStyle::ReadCommon()
|
|
|
b48a986 |
{
|
|
|
b48a986 |
- m_pObjStrm->QuickRead(&m_nFontID, 4);
|
|
|
b48a986 |
- m_pObjStrm->QuickRead(&m_nFinalFontID, 4);
|
|
|
b48a986 |
- m_pObjStrm->QuickRead(&m_nCSFlags, 2);
|
|
|
b48a986 |
- m_pObjStrm->QuickRead(&m_nUseCount, 4);
|
|
|
b48a986 |
+ m_nFontID = m_pObjStrm->QuickReaduInt32();
|
|
|
b48a986 |
+ m_nFinalFontID = m_pObjStrm->QuickReaduInt32();
|
|
|
b48a986 |
+ m_nCSFlags = m_pObjStrm->QuickReaduInt16();
|
|
|
b48a986 |
+ m_nUseCount = m_pObjStrm->QuickReaduInt32();
|
|
|
b48a986 |
|
|
|
b48a986 |
m_pDescription->Read(m_pObjStrm);
|
|
|
b48a986 |
|
|
|
b48a986 |
@@ -138,9 +138,7 @@ void LwpTextStyle::ReadCommon()
|
|
|
b48a986 |
//#endif
|
|
|
b48a986 |
sal_uInt16 nCount = 6;
|
|
|
b48a986 |
if (LwpFileHeader::m_nFileRevision > 0x0005)
|
|
|
b48a986 |
- {
|
|
|
b48a986 |
- m_pObjStrm->QuickRead(&nCount, 2);
|
|
|
b48a986 |
- }
|
|
|
b48a986 |
+ nCount = m_pObjStrm->QuickReaduInt16();
|
|
|
b48a986 |
|
|
|
b48a986 |
m_FaceStyle.ReadIndexed(m_pObjStrm);
|
|
|
b48a986 |
|
|
|
b48a986 |
@@ -155,11 +153,11 @@ void LwpTextStyle::ReadCommon()
|
|
|
b48a986 |
|
|
|
b48a986 |
if (m_pObjStrm->CheckExtra())
|
|
|
b48a986 |
{
|
|
|
b48a986 |
- m_pObjStrm->QuickRead(&m_nStyleDefinition, 4);
|
|
|
b48a986 |
+ m_nStyleDefinition = m_pObjStrm->QuickReaduInt32();
|
|
|
b48a986 |
|
|
|
b48a986 |
if (m_pObjStrm->CheckExtra())
|
|
|
b48a986 |
{
|
|
|
b48a986 |
- m_pObjStrm->QuickRead(&m_nKey, 2);
|
|
|
b48a986 |
+ m_nKey = m_pObjStrm->QuickReaduInt16();
|
|
|
b48a986 |
m_pObjStrm->SkipExtra();
|
|
|
b48a986 |
}
|
|
|
b48a986 |
}
|
|
|
b48a986 |
diff --git a/lotuswordpro/source/filter/lwpcharborderoverride.cxx b/lotuswordpro/source/filter/lwpcharborderoverride.cxx
|
|
|
b48a986 |
index b654afd..baf8df5 100644
|
|
|
b48a986 |
--- a/lotuswordpro/source/filter/lwpcharborderoverride.cxx
|
|
|
b48a986 |
+++ b/lotuswordpro/source/filter/lwpcharborderoverride.cxx
|
|
|
b48a986 |
@@ -111,8 +111,8 @@ void LwpCharacterBorderOverride::Read(LwpObjectStream* pStrm)
|
|
|
b48a986 |
ReadCommon(pStrm);
|
|
|
b48a986 |
m_pBorderStuff->Read(pStrm);
|
|
|
b48a986 |
m_pMargins->Read(pStrm);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nAboveWidth, 4);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nBelowWidth, 4);
|
|
|
b48a986 |
+ m_nAboveWidth = pStrm->QuickReaduInt32();
|
|
|
b48a986 |
+ m_nBelowWidth = pStrm->QuickReaduInt32();
|
|
|
b48a986 |
}
|
|
|
b48a986 |
|
|
|
b48a986 |
pStrm->SkipExtra();
|
|
|
b48a986 |
diff --git a/lotuswordpro/source/filter/lwpmargins.hxx b/lotuswordpro/source/filter/lwpmargins.hxx
|
|
|
b48a986 |
index eb19c5e..6dad472 100644
|
|
|
b48a986 |
--- a/lotuswordpro/source/filter/lwpmargins.hxx
|
|
|
b48a986 |
+++ b/lotuswordpro/source/filter/lwpmargins.hxx
|
|
|
b48a986 |
@@ -72,16 +72,14 @@ public:
|
|
|
b48a986 |
public:
|
|
|
b48a986 |
void Read(LwpObjectStream *pStrm)
|
|
|
b48a986 |
{
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nLeft, 4);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nTop, 4);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nRight, 4);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nBottom, 4);
|
|
|
b48a986 |
+ m_nLeft = pStrm->QuickReadInt32();
|
|
|
b48a986 |
+ m_nTop = pStrm->QuickReadInt32();
|
|
|
b48a986 |
+ m_nRight = pStrm->QuickReadInt32();
|
|
|
b48a986 |
+ m_nBottom = pStrm->QuickReadInt32();
|
|
|
b48a986 |
pStrm->SkipExtra();
|
|
|
b48a986 |
}
|
|
|
b48a986 |
- //add by , 01/26/2004
|
|
|
b48a986 |
inline void operator = (const LwpMargins& rOther);
|
|
|
b48a986 |
inline double GetMarginsValue(const sal_uInt8& nWhichSide);
|
|
|
b48a986 |
- //end add
|
|
|
b48a986 |
private:
|
|
|
b48a986 |
sal_Int32 m_nLeft;
|
|
|
b48a986 |
sal_Int32 m_nTop;
|
|
|
b48a986 |
diff --git a/lotuswordpro/source/filter/lwpoverride.cxx b/lotuswordpro/source/filter/lwpoverride.cxx
|
|
|
b48a986 |
index 6c39b47..21a0088 100644
|
|
|
b48a986 |
--- a/lotuswordpro/source/filter/lwpoverride.cxx
|
|
|
b48a986 |
+++ b/lotuswordpro/source/filter/lwpoverride.cxx
|
|
|
b48a986 |
@@ -82,9 +82,9 @@ LwpOverride::LwpOverride(LwpOverride const& rOther)
|
|
|
b48a986 |
|
|
|
b48a986 |
void LwpOverride::ReadCommon(LwpObjectStream* pStrm)
|
|
|
b48a986 |
{
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nValues, 2);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nOverride, 2);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nApply, 2);
|
|
|
b48a986 |
+ m_nValues = pStrm->QuickReaduInt16();
|
|
|
b48a986 |
+ m_nOverride = pStrm->QuickReaduInt16();
|
|
|
b48a986 |
+ m_nApply = pStrm->QuickReaduInt16();
|
|
|
b48a986 |
pStrm->SkipExtra();
|
|
|
b48a986 |
}
|
|
|
b48a986 |
|
|
|
b48a986 |
@@ -134,7 +134,7 @@ void LwpTextLanguageOverride::Read(LwpObjectStream* pStrm)
|
|
|
b48a986 |
if (pStrm->QuickReadBool())
|
|
|
b48a986 |
{
|
|
|
b48a986 |
ReadCommon(pStrm);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nLanguage, 2);
|
|
|
b48a986 |
+ m_nLanguage = pStrm->QuickReaduInt16();
|
|
|
b48a986 |
}
|
|
|
b48a986 |
|
|
|
b48a986 |
pStrm->SkipExtra();
|
|
|
b48a986 |
@@ -159,12 +159,10 @@ void LwpTextAttributeOverride::Read(LwpObjectStream* pStrm)
|
|
|
b48a986 |
if (pStrm->QuickReadBool())
|
|
|
b48a986 |
{
|
|
|
b48a986 |
ReadCommon(pStrm);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nHideLevels, 2);
|
|
|
b48a986 |
+ m_nHideLevels = pStrm->QuickReaduInt16();
|
|
|
b48a986 |
|
|
|
b48a986 |
if (LwpFileHeader::m_nFileRevision > 0x000A)
|
|
|
b48a986 |
- {
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nBaseLineOffset, 4);
|
|
|
b48a986 |
- }
|
|
|
b48a986 |
+ m_nBaseLineOffset = pStrm->QuickReaduInt32();
|
|
|
b48a986 |
}
|
|
|
b48a986 |
|
|
|
b48a986 |
pStrm->SkipExtra();
|
|
|
b48a986 |
@@ -192,7 +190,7 @@ void LwpKinsokuOptsOverride::Read(LwpObjectStream* pStrm)
|
|
|
b48a986 |
if (pStrm->QuickReadBool())
|
|
|
b48a986 |
{
|
|
|
b48a986 |
ReadCommon(pStrm);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nLevels, 2);
|
|
|
b48a986 |
+ m_nLevels = pStrm->QuickReaduInt16();
|
|
|
b48a986 |
}
|
|
|
b48a986 |
|
|
|
b48a986 |
pStrm->SkipExtra();
|
|
|
b48a986 |
@@ -317,9 +315,9 @@ void LwpAlignmentOverride::Read(LwpObjectStream * pStrm)
|
|
|
b48a986 |
if (pStrm->QuickReadBool())
|
|
|
b48a986 |
{
|
|
|
b48a986 |
ReadCommon(pStrm);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nAlignType, 1);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nPosition, 4);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nAlignChar, 2);
|
|
|
b48a986 |
+ m_nAlignType = static_cast<AlignType>(pStrm->QuickReaduInt8());
|
|
|
b48a986 |
+ m_nPosition = pStrm->QuickReaduInt32();
|
|
|
b48a986 |
+ m_nAlignChar = pStrm->QuickReaduInt16();
|
|
|
b48a986 |
}
|
|
|
b48a986 |
|
|
|
b48a986 |
pStrm->SkipExtra();
|
|
|
b48a986 |
@@ -344,9 +342,9 @@ void LwpSpacingCommonOverride::Read(LwpObjectStream* pStrm)
|
|
|
b48a986 |
if (pStrm->QuickReadBool())
|
|
|
b48a986 |
{
|
|
|
b48a986 |
ReadCommon(pStrm);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nSpacingType, 2);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nAmount, 4);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nMultiple, 4);
|
|
|
b48a986 |
+ m_nSpacingType = static_cast<SpacingType>(pStrm->QuickReaduInt16());
|
|
|
b48a986 |
+ m_nAmount = pStrm->QuickReadInt32();
|
|
|
b48a986 |
+ m_nMultiple = pStrm->QuickReadInt32();
|
|
|
b48a986 |
}
|
|
|
b48a986 |
|
|
|
b48a986 |
pStrm->SkipExtra();
|
|
|
b48a986 |
@@ -441,10 +439,10 @@ void LwpIndentOverride::Read(LwpObjectStream* pStrm)
|
|
|
b48a986 |
{
|
|
|
b48a986 |
ReadCommon(pStrm);
|
|
|
b48a986 |
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nAll, 4);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nFirst, 4);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nRest, 4);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nRight, 4);
|
|
|
b48a986 |
+ m_nAll = pStrm->QuickReadInt32();
|
|
|
b48a986 |
+ m_nFirst = pStrm->QuickReadInt32();
|
|
|
b48a986 |
+ m_nRest = pStrm->QuickReadInt32();
|
|
|
b48a986 |
+ m_nRight = pStrm->QuickReadInt32();
|
|
|
b48a986 |
}
|
|
|
b48a986 |
|
|
|
b48a986 |
pStrm->SkipExtra();
|
|
|
b48a986 |
@@ -493,7 +491,7 @@ void LwpAmikakeOverride::Read(LwpObjectStream* pStrm)
|
|
|
b48a986 |
|
|
|
b48a986 |
if (pStrm->CheckExtra())
|
|
|
b48a986 |
{
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nType, 2);
|
|
|
b48a986 |
+ m_nType = pStrm->QuickReaduInt16();
|
|
|
b48a986 |
pStrm->SkipExtra();
|
|
|
b48a986 |
}
|
|
|
b48a986 |
else
|
|
|
b48a986 |
diff --git a/lotuswordpro/source/filter/lwpparaborderoverride.cxx b/lotuswordpro/source/filter/lwpparaborderoverride.cxx
|
|
|
b48a986 |
index d232c76..8f6baf7 100644
|
|
|
b48a986 |
--- a/lotuswordpro/source/filter/lwpparaborderoverride.cxx
|
|
|
b48a986 |
+++ b/lotuswordpro/source/filter/lwpparaborderoverride.cxx
|
|
|
b48a986 |
@@ -138,22 +138,23 @@ void LwpParaBorderOverride::Read(LwpObjectStream *pStrm)
|
|
|
b48a986 |
m_pShadow->Read(pStrm);
|
|
|
b48a986 |
m_pMargins->Read(pStrm);
|
|
|
b48a986 |
|
|
|
b48a986 |
- pStrm->QuickRead(&m_eAboveType,2);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_eBelowType,2);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_eRightType,2);
|
|
|
b48a986 |
+ m_eAboveType = static_cast<BorderWidthType>(pStrm->QuickReaduInt16());
|
|
|
b48a986 |
+ m_eAboveType = static_cast<BorderWidthType>(pStrm->QuickReaduInt16());
|
|
|
b48a986 |
+ m_eBelowType = static_cast<BorderWidthType>(pStrm->QuickReaduInt16());
|
|
|
b48a986 |
+ m_eRightType = static_cast<BorderWidthType>(pStrm->QuickReaduInt16());
|
|
|
b48a986 |
|
|
|
b48a986 |
if( pStrm->CheckExtra() )
|
|
|
b48a986 |
{
|
|
|
b48a986 |
m_pBetweenStuff->Read(pStrm);
|
|
|
b48a986 |
|
|
|
b48a986 |
- pStrm->QuickRead(&m_eBetweenType,2);
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nBetweenWidth,4 );
|
|
|
b48a986 |
- pStrm->QuickRead(&m_nBetweenMargin,4 );
|
|
|
b48a986 |
+ m_eBetweenType = static_cast<BorderWidthType>(pStrm->QuickReaduInt16());
|
|
|
b48a986 |
+ m_nBetweenWidth = pStrm->QuickReaduInt32();
|
|
|
b48a986 |
+ m_nBetweenMargin = pStrm->QuickReaduInt32();
|
|
|
b48a986 |
|
|
|
b48a986 |
if( pStrm->CheckExtra() )
|
|
|
b48a986 |
{
|
|
|
b48a986 |
- pStrm->QuickRead( &m_eRightType, 2);
|
|
|
b48a986 |
- pStrm->QuickRead( &m_nRightWidth, 4);
|
|
|
b48a986 |
+ m_eRightType = static_cast<BorderWidthType>(pStrm->QuickReaduInt16());
|
|
|
b48a986 |
+ m_nRightWidth = pStrm->QuickReaduInt32();
|
|
|
b48a986 |
}
|
|
|
b48a986 |
}
|
|
|
b48a986 |
}
|
|
|
b48a986 |
diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx b/lotuswordpro/source/filter/lwpsilverbullet.cxx
|
|
|
b48a986 |
index 0f25dd1..1b16cdb 100644
|
|
|
b48a986 |
--- a/lotuswordpro/source/filter/lwpsilverbullet.cxx
|
|
|
b48a986 |
+++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx
|
|
|
b48a986 |
@@ -88,18 +88,15 @@ void LwpSilverBullet::Read()
|
|
|
b48a986 |
{
|
|
|
b48a986 |
LwpDLNFVList::Read();
|
|
|
b48a986 |
|
|
|
b48a986 |
- m_pObjStrm->QuickRead(&m_nFlags, 2);
|
|
|
b48a986 |
+ m_nFlags = m_pObjStrm->QuickReaduInt16();
|
|
|
b48a986 |
m_aStory.ReadIndexed(m_pObjStrm);
|
|
|
b48a986 |
|
|
|
b48a986 |
- sal_uInt16 nNumPos;
|
|
|
b48a986 |
- m_pObjStrm->QuickRead(&nNumPos, 2);
|
|
|
b48a986 |
+ sal_uInt16 nNumPos = m_pObjStrm->QuickReaduInt16();
|
|
|
b48a986 |
|
|
|
b48a986 |
for (sal_uInt8 nC = 0; nC < nNumPos; nC++)
|
|
|
b48a986 |
- {
|
|
|
b48a986 |
- m_pObjStrm->QuickRead(&m_pResetPositionFlags[nC], 1);
|
|
|
b48a986 |
- }
|
|
|
b48a986 |
+ m_pResetPositionFlags[nC] = m_pObjStrm->QuickReaduInt8();
|
|
|
b48a986 |
|
|
|
b48a986 |
- m_pObjStrm->QuickRead(&m_nUseCount, 4);
|
|
|
b48a986 |
+ m_nUseCount = m_pObjStrm->QuickReaduInt32();
|
|
|
b48a986 |
|
|
|
b48a986 |
m_pAtomHolder->Read(m_pObjStrm);
|
|
|
b48a986 |
}
|
|
|
b48a986 |
--
|
|
|
b48a986 |
1.7.7.6
|
|
|
b48a986 |
|