Commit 4af8d396 authored by ElenaSubbotina's avatar ElenaSubbotina Committed by Alexander Trofimov

DocFormatReader - fix Календарный_график_учебного_процесса.doc (кривые ole-объекты)

parent 3ee9c0fa
......@@ -183,10 +183,14 @@ namespace DocFileFormat
//skip the CompObjHeader
reader.ReadBytes( 28, false );
this->UserType = reader.ReadLengthPrefixedAnsiString();
this->ClipboardFormat = reader.ReadLengthPrefixedAnsiString();
this->Program = reader.ReadLengthPrefixedAnsiString();
int sz_obj = reader.GetSize() - reader.GetPosition();
if (sz_obj > 4)
{
UserType = reader.ReadLengthPrefixedAnsiString();
ClipboardFormat = reader.ReadLengthPrefixedAnsiString();
Program = reader.ReadLengthPrefixedAnsiString();
}
delete pCompStream;
}
}
......
......@@ -39,6 +39,8 @@ namespace DocFileFormat
VirtualStreamReader reader(stream, fc);
int sz_stream = reader.GetSize();
int lcb = reader.ReadInt32();
if (lcb > 10000000)
......
......@@ -27,7 +27,7 @@ public:
{
unsigned short rdUShort = 0;
if ( (stream != NULL) && (position + 2 < stream->size()))
if ( stream != NULL )
{
stream->seek( position );
stream->read((unsigned char*)(&rdUShort), sizeof( rdUShort ));
......@@ -42,7 +42,7 @@ public:
{
short rdShort = 0;
if ( (stream != NULL) && (position + 2 < stream->size()))
if ( stream != NULL )
{
stream->seek( position );
stream->read((unsigned char*)(&rdShort), sizeof( rdShort ));
......@@ -57,7 +57,7 @@ public:
{
int rdInt = 0;
if ( (stream != NULL) && (position + 4 < stream->size()))
if ( stream != NULL )
{
stream->seek( position );
stream->read( (unsigned char*) &rdInt, sizeof( rdInt ) );
......@@ -72,7 +72,7 @@ public:
{
int rdUInt = 0;
if ( (stream != NULL) && (position + 4 < stream->size()))
if ( stream != NULL )
{
stream->seek( position );
stream->read((unsigned char*) &rdUInt, sizeof( rdUInt ) );
......@@ -87,7 +87,7 @@ public:
{
unsigned char rdByte = 0;
if ( (stream != NULL) && (position + 1 < stream->size()))
if ( this->stream != NULL )
{
stream->seek( position);
stream->read( (unsigned char*)&rdByte, sizeof( rdByte ) );
......@@ -102,7 +102,7 @@ public:
{
unsigned char *rdBytes = NULL;
if ( ( stream != NULL ) && ( count > 0 ) && (position + count < stream->size()))
if ( ( stream != NULL ) && ( count > 0 ) && isResultNeeded )
{
rdBytes = new unsigned char[count];
......@@ -114,6 +114,10 @@ public:
position += sizeof( unsigned char )*count;
}
}
else
{
position += sizeof( unsigned char )*count;
}
return rdBytes;
}
......@@ -222,5 +226,6 @@ public:
private:
POLE::uint64 position;
//std::streampos position;
POLE::Stream* stream;
};
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