Refactoring

This commit is contained in:
Svetlana Kulikova
2024-08-13 16:32:41 +03:00
parent 2db2b98c8f
commit 1d6b895496
3 changed files with 15 additions and 58 deletions

View File

@ -54,7 +54,7 @@
#include "../../DesktopEditor/graphics/BaseThread.h"
#include "../../DesktopEditor/graphics/commands/DocInfo.h"
#include "../../DesktopEditor/graphics/AlphaMask.h"
//#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../Resources/BaseFonts.h"
#include <new>
@ -2864,46 +2864,13 @@ namespace PdfReader
return false;
BYTE* pBuffer = new BYTE[nLength];
/*
if (pStream->getKind() == strFlate)
Stream* pS = pStream->getUndecodedStream();
pS->reset();
nLength = pS->getBlock((char*)pBuffer, nLength);
if (!nLength)
{
Stream* pS = pStream->getBaseStream();
nLength = pS->getBlock((char*)pBuffer, nLength);
if (!nLength)
{
RELEASEARRAYOBJECTS(pBuffer);
return false;
}
COfficeUtils oOU;
if (oOU.IsArchive(pBuffer, nLength))
{
ULONG pDstBufferLen = nLength * 10;
BYTE* pDstBuffer = new BYTE[pDstBufferLen];
if (oOU.Uncompress(pDstBuffer, &pDstBufferLen, pBuffer, nLength) != S_OK)
{
RELEASEARRAYOBJECTS(pDstBuffer);
RELEASEARRAYOBJECTS(pBuffer);
return false;
}
RELEASEARRAYOBJECTS(pBuffer);
pBuffer = pDstBuffer;
nLength = pDstBufferLen;
}
}
else
*/
{
Stream* pS = pStream->getUndecodedStream();
pS->reset();
nLength = pS->getBlock((char*)pBuffer, nLength);
if (!nLength)
{
RELEASEARRAYOBJECTS(pBuffer);
return false;
}
RELEASEARRAYOBJECTS(pBuffer);
return false;
}
CBgraFrame oFrame;

View File

@ -36,9 +36,8 @@
#include "../../DesktopEditor/fontengine/ApplicationFontsWorker.h"
#include "../../DesktopEditor/xmlsec/src/include/CertificateCommon.h"
#include "../../DesktopEditor/graphics/MetafileToGraphicsRenderer.h"
#include "../../DesktopEditor/graphics/pro/Graphics.h"
#include "../../DesktopEditor/raster/BgraFrame.h"
#include "../PdfFile.h"
#include "../../DjVuFile/DjVu.h"
class CPdfFileTest : public testing::Test
{
@ -257,7 +256,7 @@ TEST_F(CPdfFileTest, SetMetaData)
TEST_F(CPdfFileTest, ConvertToRaster)
{
GTEST_SKIP();
//GTEST_SKIP();
LoadFromFile();
@ -420,7 +419,7 @@ TEST_F(CPdfFileTest, ChangePasswordToPassword)
TEST_F(CPdfFileTest, ImgDiff)
{
//GTEST_SKIP();
GTEST_SKIP();
LoadFromFile();