This commit is contained in:
Elena Subbotina
2025-03-12 19:08:23 +03:00
parent a438ae3d2e
commit 16023ed916
2 changed files with 10 additions and 8 deletions

View File

@ -95,9 +95,6 @@ namespace OOX
if (!CSystemUtility::IsFileExist(newFilePath / newFilename))
{
std::wstring ext = filename.GetExtention();
if (false == ext.empty()) content.AddDefault(ext.substr(1));
if (false == m_Data.empty())
{
NSFile::CFileBinary file;
@ -112,11 +109,8 @@ namespace OOX
copy_to(newFilePath);
}
}
else
{
std::wstring ext = filename.GetExtention();
if (false == ext.empty()) content.AddDefault(ext.substr(1));
}
std::wstring ext = filename.GetExtention();
if (false == ext.empty()) content.AddDefault(ext.substr(1));
}
void Media::set_filename(const std::wstring & file_path, bool bExternal)
{

View File

@ -39,6 +39,8 @@
#include "../DocxFormat/Media/OleObject.h"
#include "../DocxFormat/Media/Image.h"
#include "../../Common/OfficeFileFormatChecker.h"
namespace OOX
{
namespace Draw
@ -271,6 +273,12 @@ namespace OOX
OleObject* pOle = new OleObject(NULL, false, false);
pOle->set_filename(pReader->m_pRels->m_pManager->GetDstEmbed() + FILE_SEPARATOR_STR + ole_filename, false);
pOle->set_filename_cache(pReader->m_pRels->m_pManager->GetDstMedia() + FILE_SEPARATOR_STR + media_filename);
COfficeFileFormatChecker checker;
if (checker.isOOXFormatFile(pOle->filename().GetPath()))
{
pOle->set_MsPackage(true);
}
smart_ptr<OOX::File> oFile(pOle);