Kaydet (Commit) 3e9aa8b2 authored tarafından Michael Stahl's avatar Michael Stahl

lotuswordpro: fix some endian issues

Change-Id: I224c2d894071d6ec7d0afd5e2780a42b842aa32e
üst 4849f342
...@@ -84,7 +84,7 @@ void LwpSdwFileLoader::CreateDrawObjects(std::vector< rtl::Reference<XFFrame> >* ...@@ -84,7 +84,7 @@ void LwpSdwFileLoader::CreateDrawObjects(std::vector< rtl::Reference<XFFrame> >*
if (BinSignature[0] == 'S' && BinSignature[1] == 'M') if (BinSignature[0] == 'S' && BinSignature[1] == 'M')
{ {
unsigned short nVersion; unsigned short nVersion;
m_pStream->Read(&nVersion,2); m_pStream->ReadUInt16(nVersion);
m_pStream->Seek(0); m_pStream->Seek(0);
if (nVersion<0x0102) if (nVersion<0x0102)
......
...@@ -106,7 +106,7 @@ void LwpSdwGroupLoaderV0102::BeginDrawObjects(std::vector< rtl::Reference<XFFram ...@@ -106,7 +106,7 @@ void LwpSdwGroupLoaderV0102::BeginDrawObjects(std::vector< rtl::Reference<XFFram
} }
//version //version
unsigned short nVersion; unsigned short nVersion;
m_pStream->Read(&nVersion,2); m_pStream->ReadUInt16(nVersion);
if (nVersion<0x0102) if (nVersion<0x0102)
{ {
assert(false); assert(false);
...@@ -116,15 +116,15 @@ void LwpSdwGroupLoaderV0102::BeginDrawObjects(std::vector< rtl::Reference<XFFram ...@@ -116,15 +116,15 @@ void LwpSdwGroupLoaderV0102::BeginDrawObjects(std::vector< rtl::Reference<XFFram
m_pStream->SeekRel(4); m_pStream->SeekRel(4);
//record count //record count
unsigned short nRecCount; unsigned short nRecCount;
m_pStream->Read(&nRecCount,2); m_pStream->ReadUInt16(nRecCount);
// selCount // selCount
m_pStream->SeekRel(2); m_pStream->SeekRel(2);
//boundrect //boundrect
unsigned short left,top,right,bottom; unsigned short left,top,right,bottom;
m_pStream->Read(&left,2); m_pStream->ReadUInt16(left);
m_pStream->Read(&top,2); m_pStream->ReadUInt16(top);
m_pStream->Read(&right,2); m_pStream->ReadUInt16(right);
m_pStream->Read(&bottom,2); m_pStream->ReadUInt16(bottom);
// fileSize // fileSize
m_pStream->SeekRel(2); m_pStream->SeekRel(2);
...@@ -251,7 +251,7 @@ XFDrawGroup* LwpSdwGroupLoaderV0102::CreateDrawGroupObject() ...@@ -251,7 +251,7 @@ XFDrawGroup* LwpSdwGroupLoaderV0102::CreateDrawGroupObject()
} }
//version //version
unsigned short nVersion; unsigned short nVersion;
m_pStream->Read(&nVersion,2); m_pStream->ReadUInt16(nVersion);
if (nVersion<0x0102) if (nVersion<0x0102)
{ {
assert(false); assert(false);
...@@ -261,15 +261,15 @@ XFDrawGroup* LwpSdwGroupLoaderV0102::CreateDrawGroupObject() ...@@ -261,15 +261,15 @@ XFDrawGroup* LwpSdwGroupLoaderV0102::CreateDrawGroupObject()
m_pStream->SeekRel(4); m_pStream->SeekRel(4);
//record count //record count
unsigned short nRecCount; unsigned short nRecCount;
m_pStream->Read(&nRecCount,2); m_pStream->ReadUInt16(nRecCount);
// selCount // selCount
m_pStream->SeekRel(2); m_pStream->SeekRel(2);
//boundrect //boundrect
unsigned short left,top,right,bottom; unsigned short left,top,right,bottom;
m_pStream->Read(&left,2); m_pStream->ReadUInt16(left);
m_pStream->Read(&top,2); m_pStream->ReadUInt16(top);
m_pStream->Read(&right,2); m_pStream->ReadUInt16(right);
m_pStream->Read(&bottom,2); m_pStream->ReadUInt16(bottom);
// fileSize // fileSize
m_pStream->SeekRel(2); m_pStream->SeekRel(2);
...@@ -304,7 +304,7 @@ XFFrame* LwpSdwGroupLoaderV0102::CreateDrawObject() ...@@ -304,7 +304,7 @@ XFFrame* LwpSdwGroupLoaderV0102::CreateDrawObject()
{ {
//record type //record type
unsigned char recType; unsigned char recType;
m_pStream->Read(&recType,1); m_pStream->ReadUChar(recType);
LwpDrawObj* pDrawObj = nullptr; LwpDrawObj* pDrawObj = nullptr;
XFFrame* pRetObjct = nullptr; XFFrame* pRetObjct = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment