The writing code for converting hwp format and fixed bugs

This commit is contained in:
Green
2024-12-23 15:15:24 +03:00
parent 4a110d68c1
commit bb33e70b3e
74 changed files with 1722 additions and 248 deletions

View File

@ -3,6 +3,8 @@
#include "HwpDoc/HWPFile_Private.h"
#include "../DesktopEditor/common/File.h"
#include "HwpDoc/Conversion/Converter2OOXML.h"
CHWPFile::CHWPFile(const std::wstring& wsFileName)
: m_pInternal(new HWP::CHWPFile_Private(wsFileName))
{}
@ -13,6 +15,11 @@ CHWPFile::~CHWPFile()
delete m_pInternal;
}
void CHWPFile::SetTempDirectory(const std::wstring& wsTempDirectory)
{
m_wsTempDirectory = wsTempDirectory;
}
bool CHWPFile::Open()
{
if (nullptr == m_pInternal)
@ -26,3 +33,13 @@ void CHWPFile::Close()
if (nullptr != m_pInternal)
m_pInternal->Close();
}
bool CHWPFile::ConvertToOOXML(const std::wstring& wsFilePath)
{
HWP::CConverter2OOXML oConverter;
oConverter.SetHWPFile(m_pInternal);
oConverter.SetTempDirectory(m_wsTempDirectory);
return oConverter.ConvertTo(wsFilePath);
}