diff --git a/Common/DocxFormat/Source/DocxFormat/VmlDrawing.h b/Common/DocxFormat/Source/DocxFormat/VmlDrawing.h index e001687a37..3573d7feb8 100644 --- a/Common/DocxFormat/Source/DocxFormat/VmlDrawing.h +++ b/Common/DocxFormat/Source/DocxFormat/VmlDrawing.h @@ -20,9 +20,10 @@ namespace OOX class CVmlDrawing : public OOX::WritingElementWithChilds, public OOX::FileGlobalEnumerated, public OOX::IFileContainer { public: - CVmlDrawing() + CVmlDrawing(bool bSpreadsheet_ = false) { - m_mapComments = NULL; + bSpreadsheet = bSpreadsheet_; + m_mapComments = NULL; } CVmlDrawing(const CPath& oRootPath, const CPath& oPath) { @@ -350,7 +351,8 @@ namespace OOX } virtual const OOX::FileType type() const { - return OOX::FileTypes::VmlDrawing; + if (bSpreadsheet) return OOX::Spreadsheet::FileTypes::VmlDrawing; + else return OOX::FileTypes::VmlDrawing; } virtual const CPath DefaultDirectory() const { @@ -370,6 +372,8 @@ namespace OOX { } + bool bSpreadsheet; + public: std::map* m_mapComments; std::map m_mapShapes; //связь id (_x0000_s1025) с номером объекта для комментов diff --git a/Common/DocxFormat/Source/XlsxFormat/FileTypes_Spreadsheet.h b/Common/DocxFormat/Source/XlsxFormat/FileTypes_Spreadsheet.h index 9352ef64d9..9a6ffe5e4b 100644 --- a/Common/DocxFormat/Source/XlsxFormat/FileTypes_Spreadsheet.h +++ b/Common/DocxFormat/Source/XlsxFormat/FileTypes_Spreadsheet.h @@ -66,6 +66,10 @@ namespace OOX const FileType ExternalLinkPath(L"", L"", _T(""), _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath")); + + const FileType VmlDrawing(L"../drawings", L"vmlDrawing.vml", + _T(""), + _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing"), true, true); } // namespace FileTypes } } // namespace OOX diff --git a/XlsxSerializerCom/Writer/BinaryReader.h b/XlsxSerializerCom/Writer/BinaryReader.h index 3b115b77fb..aa16ab02ef 100644 --- a/XlsxSerializerCom/Writer/BinaryReader.h +++ b/XlsxSerializerCom/Writer/BinaryReader.h @@ -1928,7 +1928,10 @@ namespace BinXlsxRW { oBinaryCommentReader.Read(length, poResult); if(m_pCurWorksheet->m_mapComments.size() > 0) { - OOX::CVmlDrawing* pVmlDrawing = new OOX::CVmlDrawing(); + OOX::CPath pathDrawingsDir = m_sDestinationDir + FILE_SEPARATOR_STR + _T("xl") + FILE_SEPARATOR_STR + _T("drawings"); + OOX::CSystemUtility::CreateDirectories(pathDrawingsDir.GetPath()); + + OOX::CVmlDrawing* pVmlDrawing = new OOX::CVmlDrawing(true); pVmlDrawing->m_mapComments = &m_pCurWorksheet->m_mapComments; NSCommon::smart_ptr pVmlDrawingFile(pVmlDrawing);