mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Fix bug 74431
x2t doctrenderer and edit use the same CPdfFile instance
This commit is contained in:
@ -109,6 +109,8 @@ bool CPdfFile::EditPdf(const std::wstring& wsDstFile)
|
||||
if (wsDstFile.empty() || !m_pInternal->pReader)
|
||||
return false;
|
||||
|
||||
m_pInternal->pReader->CleanUp();
|
||||
|
||||
RELEASEOBJECT(m_pInternal->pWriter);
|
||||
m_pInternal->pWriter = new CPdfWriter(m_pInternal->pAppFonts, false, this, true, m_pInternal->wsTempFolder);
|
||||
|
||||
|
||||
@ -244,6 +244,11 @@ void CPdfReader::Clear()
|
||||
delete pPDFContext;
|
||||
m_vPDFContext.clear();
|
||||
}
|
||||
void CPdfReader::CleanUp()
|
||||
{
|
||||
while(UnmergePages());
|
||||
m_eError = errNone;
|
||||
}
|
||||
|
||||
bool CPdfReader::IsNeedCMap()
|
||||
{
|
||||
@ -682,7 +687,7 @@ bool CPdfReader::MergePages(const std::wstring& wsFile, const std::wstring& wsPa
|
||||
}
|
||||
bool CPdfReader::UnmergePages()
|
||||
{
|
||||
if (m_vPDFContext.size() < 1)
|
||||
if (m_vPDFContext.size() <= 1)
|
||||
return false;
|
||||
CPdfReaderContext* pPDFContext = m_vPDFContext.back();
|
||||
delete pPDFContext;
|
||||
|
||||
@ -62,6 +62,7 @@ public:
|
||||
bool LoadFromMemory(NSFonts::IApplicationFonts* pAppFonts, BYTE* data, DWORD length, const std::wstring& owner_password = L"", const std::wstring& user_password = L"");
|
||||
|
||||
void Close();
|
||||
void CleanUp();
|
||||
|
||||
void SetParams(COfficeDrawingPageParams* pParams);
|
||||
std::wstring GetTempDirectory();
|
||||
|
||||
Reference in New Issue
Block a user