Commit 8a88039b authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

DocFormat - bug 31317

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@67355 954022d7-b5bf-4e40-9824-e11837661b57
parent 07ba4892
......@@ -305,14 +305,17 @@ typedef enum _BlipCompression
oMetaHeader.compression = m_fCompression;
oMetaHeader.filter = m_fFilter;
WmfPlaceableFileHeader oWmfHeader = {};
oMetaHeader.ToWMFHeader(&oWmfHeader);
LONG lLenHeader = 22;
BYTE* pMetaHeader = new BYTE[lLenHeader];
memcpy(pMetaHeader, (void*)(&oWmfHeader), lLenHeader);
oMetaFile.SetHeader(pMetaHeader, lLenHeader);
if (typeCode == 0xf01b)
{
WmfPlaceableFileHeader oWmfHeader = {};
oMetaHeader.ToWMFHeader(&oWmfHeader);
LONG lLenHeader = 22;
BYTE* pMetaHeader = new BYTE[lLenHeader];
memcpy(pMetaHeader, (void*)(&oWmfHeader), lLenHeader);
oMetaFile.SetHeader(pMetaHeader, lLenHeader);
}
oMetaFile.SetData(m_pvBits, oMetaHeader.cbSave, oMetaHeader.cbSize, 0 == oMetaHeader.compression);
......
......@@ -215,22 +215,13 @@ namespace DocFileFormat
//it's a meta image
MetafilePictBlip* metaBlip = static_cast<MetafilePictBlip*>(oBlipEntry->Blip);
if (metaBlip)
{
////meta images can be compressed
//unsigned char* decompressed = NULL;
//int decompressedSize = 0;
//decompressedSize = metaBlip->Decompress(&decompressed);
//if (0 != decompressedSize && NULL != decompressed)
//{
unsigned char *newData = NULL;
int newDataSize = metaBlip->oMetaFile.ToBuffer(newData);
m_ctx->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlipEntry->btWin32), std::vector<unsigned char>(newData, (newData + newDataSize))));
//RELEASEARRAYOBJECTS(decompressed);
RELEASEARRAYOBJECTS(newData);
//}
{//decompress inside MetafilePictBlip
unsigned char *newData = NULL;
int newDataSize = metaBlip->oMetaFile.ToBuffer(newData);
m_ctx->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlipEntry->btWin32), std::vector<unsigned char>(newData, (newData + newDataSize))));
RELEASEARRAYOBJECTS(newData);
}
}
break;
......
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