From 3d8403346b407dec84ec0c0e96108bc7a9830b07 Mon Sep 17 00:00:00 2001 From: ElenaSubbotina Date: Mon, 20 Mar 2017 17:42:00 +0300 Subject: [PATCH] fix added bug 34297 --- ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp | 2 +- ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.cpp | 8 ++++---- Common/DocxFormat/Source/DocxFormat/Logic/Vml.cpp | 6 ++++++ Common/DocxFormat/Source/DocxFormat/Logic/Vml.h | 5 ++++- Common/DocxFormat/Source/DocxFormat/VmlDrawing.h | 13 +++++++++---- X2tConverter/build/Qt/X2tConverter.pri | 2 +- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp b/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp index e4616ccef8..5d6616bcec 100644 --- a/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp +++ b/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp @@ -263,7 +263,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName, if(false != Base64::Base64Decode((const char*)(pBase64Data + nIndex), nBase64DataSize - nIndex, pData, &nDataSize)) { - NSBinPptxRW::CDrawingConverter oDrawingConverter; + NSBinPptxRW::CDrawingConverter oDrawingConverter; NSBinPptxRW::CBinaryFileReader& oBufferedStream = *oDrawingConverter.m_pReader; oBufferedStream.Init(pData, 0, nDataSize); diff --git a/ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.cpp b/ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.cpp index 74e7546f38..cfcfe31d33 100644 --- a/ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.cpp +++ b/ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.cpp @@ -85,9 +85,9 @@ namespace BinXlsxRW{ } bool CXlsxSerializer::loadFromFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sMediaDir, const std::wstring& sEmbedDir) { - NSBinPptxRW::CDrawingConverter oOfficeDrawingConverter; - oOfficeDrawingConverter.SetMediaDstPath(sMediaDir); - oOfficeDrawingConverter.SetEmbedDstPath(sEmbedDir); + NSBinPptxRW::CDrawingConverter oOfficeDrawingConverter; + oOfficeDrawingConverter.SetMediaDstPath(sMediaDir); + oOfficeDrawingConverter.SetEmbedDstPath(sEmbedDir); //папка с бинарников std::wstring strFileInDir = NSSystemPath::GetDirectoryName(sSrcFileName); @@ -95,7 +95,7 @@ namespace BinXlsxRW{ oOfficeDrawingConverter.SetSourceFileDir(strFileInDir, 2); BinXlsxRW::BinaryFileReader oBinaryFileReader; - oBinaryFileReader.ReadFile(sSrcFileName, sDstPath, &oOfficeDrawingConverter, sXMLOptions); + oBinaryFileReader.ReadFile(sSrcFileName, sDstPath, &oOfficeDrawingConverter, sXMLOptions); return true; } bool CXlsxSerializer::saveToFile(const std::wstring& sDstFileName, const std::wstring& sSrcPath, const std::wstring& sXMLOptions) diff --git a/Common/DocxFormat/Source/DocxFormat/Logic/Vml.cpp b/Common/DocxFormat/Source/DocxFormat/Logic/Vml.cpp index 42a7615e0a..acdd8bc085 100644 --- a/Common/DocxFormat/Source/DocxFormat/Logic/Vml.cpp +++ b/Common/DocxFormat/Source/DocxFormat/Logic/Vml.cpp @@ -297,7 +297,13 @@ namespace OOX case 'x': if ( _T("x:ClientData") == sName ) + { pItem = new OOX::Vml::CClientData( oReader ); + OOX::Vml::CClientData * client_data = dynamic_cast(pItem); + if ((client_data) && (client_data->m_oObjectType.IsInit())) + if (client_data->m_oObjectType->GetValue() == SimpleTypes::Vml::vmlclientdataobjecttypeNote) + m_bComment = true; + } break; diff --git a/Common/DocxFormat/Source/DocxFormat/Logic/Vml.h b/Common/DocxFormat/Source/DocxFormat/Logic/Vml.h index 5cc857dd62..6a27f27665 100644 --- a/Common/DocxFormat/Source/DocxFormat/Logic/Vml.h +++ b/Common/DocxFormat/Source/DocxFormat/Logic/Vml.h @@ -56,7 +56,7 @@ namespace OOX { public: WritingElement_AdditionConstructors(CVmlCommonElements) - CVmlCommonElements(){} + CVmlCommonElements(){m_bComment = false;} virtual ~CVmlCommonElements(){} @@ -137,6 +137,9 @@ namespace OOX std::wstring WriteAttributes() const; std::wstring WriteElements() const; + +//internal + bool m_bComment; }; //-------------------------------------------------------------------------------- diff --git a/Common/DocxFormat/Source/DocxFormat/VmlDrawing.h b/Common/DocxFormat/Source/DocxFormat/VmlDrawing.h index fd03afcea1..38ecc0df35 100644 --- a/Common/DocxFormat/Source/DocxFormat/VmlDrawing.h +++ b/Common/DocxFormat/Source/DocxFormat/VmlDrawing.h @@ -102,7 +102,7 @@ namespace OOX ReadAttributes( oReader ); std::wstring elementContent; - bool bReadyElement = false;//собираем все до нахождения собственно элемента + bool bReadyElement = false;//собираем все до нахождения собственно элемента if ( !oReader.IsEmptyNode() ) { @@ -219,12 +219,15 @@ namespace OOX OOX::Vml::CVmlCommonElements* common = dynamic_cast(pItem); std::wstring sSpid; - + bool bComment = false; + if (common) { if (common->m_sSpId.IsInit()) sSpid = *common->m_sSpId; else if (common->m_sId.IsInit())sSpid = *common->m_sId; - } + + bComment = common->m_bComment; + } else { OOX::Vml::CGroup *group = dynamic_cast(pItem); @@ -243,11 +246,13 @@ namespace OOX element.nId = (int)m_arrItems.size()-1; element.sXml = elementContent; element.pElement = pItem; + element.bUsed = bComment; m_mapShapes.insert(std::make_pair(sSpid, element)); } elementContent.clear(); - bReadyElement = false; + bReadyElement = false; + bComment = false; } } } diff --git a/X2tConverter/build/Qt/X2tConverter.pri b/X2tConverter/build/Qt/X2tConverter.pri index a533ab3086..1360a39b6a 100644 --- a/X2tConverter/build/Qt/X2tConverter.pri +++ b/X2tConverter/build/Qt/X2tConverter.pri @@ -7,7 +7,7 @@ QT -= core QT -= gui -VERSION = 2.0.3.446 +VERSION = 2.0.3.447 DEFINES += INTVER=$$VERSION TARGET = x2t