mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Fix bug 75045
This commit is contained in:
@ -37,12 +37,19 @@
|
|||||||
#include "../DesktopEditor/graphics/commands/DocInfo.h"
|
#include "../DesktopEditor/graphics/commands/DocInfo.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
enum class ShapeSerializeType
|
||||||
|
{
|
||||||
|
sstBinary,
|
||||||
|
sstXml
|
||||||
|
};
|
||||||
|
|
||||||
class CDocxRenderer_Private
|
class CDocxRenderer_Private
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NSDocxRenderer::CDocument m_oDocument;
|
NSDocxRenderer::CDocument m_oDocument;
|
||||||
std::wstring m_sTempDirectory;
|
std::wstring m_sTempDirectory;
|
||||||
bool m_bIsSupportShapeCommands = false;
|
bool m_bIsSupportShapeCommands = false;
|
||||||
|
ShapeSerializeType m_eShapeSerializeType = ShapeSerializeType::sstBinary;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CDocxRenderer_Private(NSFonts::IApplicationFonts* pFonts, IRenderer* pRenderer) : m_oDocument(pRenderer, pFonts)
|
CDocxRenderer_Private(NSFonts::IApplicationFonts* pFonts, IRenderer* pRenderer) : m_oDocument(pRenderer, pFonts)
|
||||||
@ -139,7 +146,9 @@ std::vector<std::wstring> CDocxRenderer::ScanPagePptx(IOfficeDrawingFile* pFile,
|
|||||||
m_pInternal->m_oDocument.m_oCurrentPage.m_bWriteStyleRaw = true;
|
m_pInternal->m_oDocument.m_oCurrentPage.m_bWriteStyleRaw = true;
|
||||||
m_pInternal->m_bIsSupportShapeCommands = true;
|
m_pInternal->m_bIsSupportShapeCommands = true;
|
||||||
|
|
||||||
|
m_pInternal->m_eShapeSerializeType = ShapeSerializeType::sstXml;
|
||||||
DrawPage(pFile, nPage);
|
DrawPage(pFile, nPage);
|
||||||
|
m_pInternal->m_eShapeSerializeType = ShapeSerializeType::sstBinary;
|
||||||
|
|
||||||
auto xml_shapes = m_pInternal->m_oDocument.m_oCurrentPage.GetXmlShapesPptx();
|
auto xml_shapes = m_pInternal->m_oDocument.m_oCurrentPage.GetXmlShapesPptx();
|
||||||
m_pInternal->m_oDocument.Clear();
|
m_pInternal->m_oDocument.Clear();
|
||||||
@ -230,10 +239,13 @@ HRESULT CDocxRenderer::AdvancedCommand(IAdvancedCommand* command)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sUtf8Shape.empty())
|
if (sUtf8Shape.empty())
|
||||||
return S_OK;
|
return S_FALSE;
|
||||||
|
|
||||||
if ('<' == sUtf8Shape.at(0))
|
if ('<' == sUtf8Shape.at(0))
|
||||||
{
|
{
|
||||||
|
if (m_pInternal->m_eShapeSerializeType == ShapeSerializeType::sstBinary)
|
||||||
|
return S_FALSE;
|
||||||
|
|
||||||
if (0xFFFFFFFF != nImageId)
|
if (0xFFFFFFFF != nImageId)
|
||||||
{
|
{
|
||||||
std::string sNewId = "r:embed=\"rId" + std::to_string(nImageId + c_iStartingIdForImages) + "\"";
|
std::string sNewId = "r:embed=\"rId" + std::to_string(nImageId + c_iStartingIdForImages) + "\"";
|
||||||
@ -243,6 +255,9 @@ HRESULT CDocxRenderer::AdvancedCommand(IAdvancedCommand* command)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (m_pInternal->m_eShapeSerializeType == ShapeSerializeType::sstXml)
|
||||||
|
return S_FALSE;
|
||||||
|
|
||||||
if (0xFFFFFFFF != nImageId)
|
if (0xFFFFFFFF != nImageId)
|
||||||
{
|
{
|
||||||
std::wstring rId_new = L"rId" + std::to_wstring(nImageId + c_iStartingIdForImages);
|
std::wstring rId_new = L"rId" + std::to_wstring(nImageId + c_iStartingIdForImages);
|
||||||
|
|||||||
Reference in New Issue
Block a user