Compare commits

..

2 Commits

Author SHA1 Message Date
5c01b23dee . 2018-01-30 20:09:22 +03:00
db11b75a2e x2t version 2.4.514 2018-01-30 19:37:10 +03:00
31 changed files with 72 additions and 569 deletions

View File

@ -21,8 +21,6 @@ include($$PWD/../../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
_USE_LIBXML2_READER_ \
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS \

View File

@ -87,10 +87,14 @@ namespace BinDocxRW
BinaryDocumentTableWriter oBinaryDocumentTableWriter(m_oParamsWriter, oParamsDocumentWriter, m_mapIgnoreComments, NULL);
oBinaryDocumentTableWriter.prepareOfficeDrawingConverter(m_pOfficeDrawingConverter, oParamsDocumentWriter.m_pRels, pHdrFtr->m_arrShapeTypes);
smart_ptr<OOX::IFileContainer> oldRels = m_pOfficeDrawingConverter->GetRels();
m_pOfficeDrawingConverter->SetRels(oParamsDocumentWriter.m_pRels);
m_pOfficeDrawingConverter->ClearShapeTypes();
nCurPos = m_oBcw.WriteItemStart(c_oSerHdrFtrTypes::HdrFtr_Content);
oBinaryDocumentTableWriter.WriteDocumentContent(pHdrFtr->m_arrItems);
m_oBcw.WriteItemEnd(nCurPos);
m_pOfficeDrawingConverter->SetRels(oldRels);
}
}

View File

@ -3023,18 +3023,6 @@ namespace BinDocxRW
poDocument = NULL;
m_bWriteSectPr = false;
}
void prepareOfficeDrawingConverter(NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, OOX::IFileContainer *rels, std::vector<std::wstring>& aShapeTypes)
{
smart_ptr<OOX::IFileContainer> oldRels = pOfficeDrawingConverter->GetRels();
pOfficeDrawingConverter->SetRels(rels);
for(size_t i = 0, length = aShapeTypes.size(); i < length; ++i)
{
std::wstring& sShapeType = aShapeTypes[i];
pOfficeDrawingConverter->AddShapeType(sShapeType);
}
pOfficeDrawingConverter->SetRels(oldRels);
}
void WriteVbaProject(OOX::VbaProject& oVbaProject)
{
m_oBcw.m_oStream.StartRecord(0);
@ -7724,7 +7712,7 @@ namespace BinDocxRW
m_oParamsWriter.m_pCurRels = oParamsDocumentWriter.m_pRels;
int nStart = m_oBcw.WriteItemWithLengthStart();
WriteNotes(oFootnotes.m_arrFootnote, oParamsDocumentWriter, oFootnotes.m_arrShapeTypes);
WriteNotes(oFootnotes.m_arrFootnote, oParamsDocumentWriter);
m_oBcw.WriteItemWithLengthEnd(nStart);
}
void WriteEndnotes(OOX::CEndnotes& oEndnotes)
@ -7733,20 +7721,27 @@ namespace BinDocxRW
m_oParamsWriter.m_pCurRels = oParamsDocumentWriter.m_pRels;
int nStart = m_oBcw.WriteItemWithLengthStart();
WriteNotes(oEndnotes.m_arrEndnote, oParamsDocumentWriter, oEndnotes.m_arrShapeTypes);
WriteNotes(oEndnotes.m_arrEndnote, oParamsDocumentWriter);
m_oBcw.WriteItemWithLengthEnd(nStart);
}
void WriteNotes(const std::vector<OOX::CFtnEdn*>& arrNotes, ParamsDocumentWriter& oParamsDocumentWriter, std::vector<std::wstring>& arrShapeTypes)
void WriteNotes(const std::vector<OOX::CFtnEdn*>& arrNotes, ParamsDocumentWriter& oParamsDocumentWriter)
{
BinaryDocumentTableWriter oBinaryDocumentTableWriter(m_oParamsWriter, oParamsDocumentWriter, &m_oParamsWriter.m_mapIgnoreComments, NULL);
smart_ptr<OOX::IFileContainer> oldRels = m_pOfficeDrawingConverter->GetRels();
m_pOfficeDrawingConverter->SetRels(oParamsDocumentWriter.m_pRels);
m_pOfficeDrawingConverter->ClearShapeTypes();
int nCurPos = 0;
for(size_t i = 0 ; i < arrNotes.size(); ++i)
{
nCurPos = m_oBcw.WriteItemStart(c_oSerNotes::Note);
WriteNote(*arrNotes[i], oParamsDocumentWriter, arrShapeTypes);
WriteNote(*arrNotes[i], oBinaryDocumentTableWriter);
m_oBcw.WriteItemEnd(nCurPos);
}
m_pOfficeDrawingConverter->SetRels(oldRels);
}
void WriteNote(const OOX::CFtnEdn& oFtnEdn, ParamsDocumentWriter& oParamsDocumentWriter, std::vector<std::wstring>& arrShapeTypes)
void WriteNote(const OOX::CFtnEdn& oFtnEdn, BinaryDocumentTableWriter & oBinaryDocumentTableWriter)
{
int nCurPos = 0;
if(oFtnEdn.m_oType.IsInit())
@ -7761,10 +7756,6 @@ namespace BinDocxRW
m_oBcw.m_oStream.WriteLONG(oFtnEdn.m_oId->GetValue());
m_oBcw.WriteItemEnd(nCurPos);
}
BinaryDocumentTableWriter oBinaryDocumentTableWriter(m_oParamsWriter, oParamsDocumentWriter, &m_oParamsWriter.m_mapIgnoreComments, NULL);
oBinaryDocumentTableWriter.prepareOfficeDrawingConverter(m_pOfficeDrawingConverter, oParamsDocumentWriter.m_pRels, arrShapeTypes);
nCurPos = m_oBcw.WriteItemStart(c_oSerNotes::NoteContent);
oBinaryDocumentTableWriter.WriteDocumentContent(oFtnEdn.m_arrItems);
@ -7924,8 +7915,10 @@ namespace BinDocxRW
//DocumentTable всегда пишем последней, чтобы сначала заполнить все вспомогательные структуры, а при заполении документа, вызывать методы типа Style_Add...
BinDocxRW::BinaryDocumentTableWriter oBinaryDocumentTableWriter(m_oParamsWriter, oParamsDocumentWriter, &m_oParamsWriter.m_mapIgnoreComments, &oBinaryHeaderFooterTableWriter);
oBinaryDocumentTableWriter.prepareOfficeDrawingConverter(m_oParamsWriter.m_pOfficeDrawingConverter, oParamsDocumentWriter.m_pRels, oDocx.m_pDocument->m_arrShapeTypes);
m_oParamsWriter.m_pOfficeDrawingConverter->SetRels(oParamsDocumentWriter.m_pRels);
m_oParamsWriter.m_pOfficeDrawingConverter->ClearShapeTypes();
oBinaryDocumentTableWriter.pSectPr = pFirstSectPr;
oBinaryDocumentTableWriter.pBackground = oDocx.m_pDocument->m_oBackground.GetPointer();
oBinaryDocumentTableWriter.poDocument = oDocx.m_pDocument;

View File

@ -16,8 +16,6 @@ include($$PWD/../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
USE_AVSOFFICESTUDIO_XMLUTILS \
SOLUTION_ASCOFFICEDOCXFILE2 \
#DISABLE_FILE_DOWNLOADER \

View File

@ -22,8 +22,6 @@ include($$PWD/../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS

View File

@ -22,8 +22,6 @@ include($$PWD/../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS

View File

@ -23,8 +23,6 @@ DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
LIBXML_READER_ENABLED \
USE_LITE_READER \
_USE_XMLLITE_READER_ \
_PRESENTATION_WRITER_ \
_SVG_CONVERT_TO_IMAGE_ \
DONT_WRITE_EMBEDDED_FONTS

View File

@ -937,6 +937,12 @@ void CDrawingConverter::SetEmbedDstPath(const std::wstring& sPath)
NSDirectory::CreateDirectory(sPath);
}
void CDrawingConverter::ClearShapeTypes()
{
m_mapShapeTypes.clear();
}
HRESULT CDrawingConverter::AddShapeType(const std::wstring& bsXml)
{
std::wstring strXml = L"<main ";
@ -974,20 +980,24 @@ HRESULT CDrawingConverter::AddShapeType(const std::wstring& bsXml)
if (oNode.IsValid())
{
CPPTShape* pShape = new CPPTShape();
pShape->m_bIsShapeType = true;
XmlUtils::CXmlNode oNodeST = oNode.ReadNodeNoNS(L"shapetype");
std::wstring strId = oNodeST.GetAttribute(L"id");
pShape->LoadFromXMLShapeType(oNodeST);
CShapePtr pS = CShapePtr(new CShape(NSBaseShape::unknown, 0));
pS->setBaseShape(CBaseShapePtr(pShape));
LoadCoordSize(oNodeST, pS);
//if (m_mapShapeTypes.find(strId) == m_mapShapeTypes.end())//?? с затиранием ???
{
CPPTShape* pShape = new CPPTShape();
pShape->m_bIsShapeType = true;
pShape->LoadFromXMLShapeType(oNodeST);
m_mapShapeTypes.insert(std::pair<std::wstring, CShapePtr>(strId, pS));
CShapePtr pS = CShapePtr(new CShape(NSBaseShape::unknown, 0));
pS->setBaseShape(CBaseShapePtr(pShape));
LoadCoordSize(oNodeST, pS);
m_mapShapeTypes.insert(std::make_pair(strId, pS));
}
}
return S_OK;
@ -1094,6 +1104,12 @@ PPTX::Logic::SpTreeElem CDrawingConverter::ObjectFromXml(const std::wstring& sXm
}
else if (strName == L"pict" || strName == L"object")
{
//сначала shape type
XmlUtils::CXmlNode oNodeST;
if (oParseNode.GetNode(L"v:shapetype", oNodeST))
{
AddShapeType(oNodeST.GetXml());
}
XmlUtils::CXmlNodes oChilds;
if (oParseNode.GetNodes(L"*", oChilds))
{
@ -1148,10 +1164,6 @@ PPTX::Logic::SpTreeElem CDrawingConverter::ObjectFromXml(const std::wstring& sXm
#endif
}
}
else if (L"shapetype" == strNameP)
{
AddShapeType(oNodeP.GetXml());
}
else
{
continue;
@ -1447,6 +1459,13 @@ bool CDrawingConverter::ParceObject(const std::wstring& strXml, std::wstring** p
}
else if (strName == L"pict" || strName == L"object")
{
//сначала shape type
XmlUtils::CXmlNode oNodeST;
if (oParseNode.GetNode(L"v:shapetype", oNodeST))
{
AddShapeType(oNodeST.GetXml());
}
XmlUtils::CXmlNodes oChilds;
if (oParseNode.GetNodes(L"*", oChilds))
{
@ -1487,10 +1506,6 @@ bool CDrawingConverter::ParceObject(const std::wstring& strXml, std::wstring** p
doc_LoadGroup(pElem, oNodeP, pMainProps, true);
}
}
else if (L"shapetype" == strNameP)
{
AddShapeType(oNodeP.GetXml());
}
else
{
continue;
@ -2817,6 +2832,13 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
if (bIsTop) pTree->m_lGroupIndex = 0;
else pTree->m_lGroupIndex = 1;
//сначала shape type
XmlUtils::CXmlNode oNodeST;
if (oNode.GetNode(L"v:shapetype", oNodeST))
{
AddShapeType(oNodeST.GetXml());
}
XmlUtils::CXmlNodes oNodes;
if (oNode.GetNodes(L"*", oNodes))
{
@ -2828,30 +2850,7 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
std::wstring strNameP = XmlUtils::GetNameNoNS(oNodeT.GetName());
if (L"shapetype" == strNameP)
{
//AddShapeType(oNodeT.GetXml());
std::wstring strId = oNodeT.GetAttribute(L"id");
if (strId.length() > 0)
{
if (m_mapShapeTypes.find(strId) == m_mapShapeTypes.end())
{
CPPTShape* pShape = new CPPTShape();
pShape->m_bIsShapeType = true;
pShape->LoadFromXMLShapeType(oNodeT);
CShapePtr pS = CShapePtr(new CShape(NSBaseShape::unknown, 0));
pS->setBaseShape(CBaseShapePtr(pShape));
LoadCoordSize(oNodeT, pS);
m_mapShapeTypes.insert(std::pair<std::wstring, CShapePtr>(strId, pS));
}
}
}
else if (L"shape" == strNameP ||
if (L"shape" == strNameP ||
L"rect" == strNameP ||
L"oval" == strNameP ||
L"line" == strNameP ||
@ -2873,6 +2872,8 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
if (_el.is_init())
pTree->SpTreeElems.push_back(_el);
}
else
continue;
}
}

View File

@ -225,7 +225,8 @@ namespace NSBinPptxRW
void SetMediaDstPath (const std::wstring& sMediaPath);
void SetEmbedDstPath (const std::wstring& sEmbedPath);
HRESULT AddShapeType (const std::wstring& sXml);
void ClearShapeTypes ();
HRESULT AddObject (const std::wstring& sXml, std::wstring** pMainProps);
HRESULT SaveObject (long lStart, long lLength, const std::wstring& sMainProps, std::wstring & sXml);
@ -293,6 +294,7 @@ namespace NSBinPptxRW
void Clear();
HRESULT SetCurrentRelsPath();
HRESULT AddShapeType (const std::wstring& sXml);
};
}
#endif //OOX_IFILE_CONTAINER_INCLUDE_H_

View File

@ -26,8 +26,6 @@ include($$PWD/../../../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML \
#DISABLE_FILE_DOWNLOADER \
CXIMAGE_DONT_DECLARE_TCHAR \

View File

@ -21,8 +21,6 @@ include($$PWD/../../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE _UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS \
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML

View File

@ -19,8 +19,6 @@ include(../../../Common/base.pri)
DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
DONT_WRITE_EMBEDDED_FONTS \
LIBXML_READER_ENABLED

View File

@ -18,8 +18,6 @@ include(../../../Common/base.pri)
DEFINES += UNICODE _UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS
@ -72,7 +70,6 @@ SOURCES += \
../Source/Common/Index.cpp \
../Source/Common/NumFormat.cpp \
../Source/Common/Position.cpp \
../Source/Common/Utils.cpp \
../Source/Common/Wrap.cpp \
../Source/Common/ZIndex.cpp \
../Source/Common/SimpleTypes_Word.cpp \
@ -108,7 +105,6 @@ HEADERS += docxformatlib.h \
../Source/Common/SimpleTypes_Word.h \
../Source/Common/Size.h \
../Source/Common/Unit.h \
../Source/Common/Utils.h \
../Source/Common/Wrap.h \
../Source/Common/ZIndex.h \
../Source/DocxFormat/Drawing/Drawing.h \

View File

@ -59,7 +59,6 @@
#include "../Source/Common/Index.cpp"
#include "../Source/Common/NumFormat.cpp"
#include "../Source/Common/Position.cpp"
#include "../Source/Common/Utils.cpp"
#include "../Source/Common/Wrap.cpp"
#include "../Source/Common/ZIndex.cpp"
#include "../Source/Common/SimpleTypes_Word.cpp"

View File

@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -114,7 +114,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
PreprocessorDefinitions="_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -181,7 +181,7 @@
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories=".\..\Source\XML\libxml2\XML\include;.\..\Source\Utility;.\..\Source\XML;.\..\Source\Common;..\..\..\..\..\Redist;..\..\ASCOfficeOdtFile\Source\OfficeSvmFile"
PreprocessorDefinitions="USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
PreprocessorDefinitions="_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
ProgramDataBaseFileName="$(IntDir)\DocxFormat.pdb"
@ -246,7 +246,7 @@
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories=".\..\Source\XML\libxml2\XML\include;.\..\Source\Utility;.\..\Source\XML;.\..\Source\Common;..\..\..\..\..\Redist;..\..\ASCOfficeOdtFile\Source\OfficeSvmFile"
PreprocessorDefinitions="USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
PreprocessorDefinitions="_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
ProgramDataBaseFileName="$(IntDir)\DocxFormat.pdb"
@ -1381,14 +1381,6 @@
RelativePath="..\Source\Common\Unit.h"
>
</File>
<File
RelativePath="..\Source\Common\Utils.cpp"
>
</File>
<File
RelativePath="..\Source\Common\Utils.h"
>
</File>
<File
RelativePath="..\Source\Common\Wrap.cpp"
>

View File

@ -145,7 +145,6 @@ namespace NSCommon
this->m_pPointer = new Type(oNode);
return *this;
}
#ifdef _USE_XMLLITE_READER_
nullable<Type>& operator=(XmlUtils::CXmlLiteReader& oReader)
{
RELEASEOBJECT(this->m_pPointer);
@ -153,7 +152,6 @@ namespace NSCommon
this->m_pPointer = new Type(oReader);
return *this;
}
#endif
nullable<Type>& operator=(const wchar_t* cwsValue)
{
RELEASEOBJECT(this->m_pPointer);

View File

@ -1,56 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "Utils.h"
#include "../../../DesktopEditor/xml/include/xmlutils.h"
void Common::readAllShapeTypes(const OOX::CPath& oPath, std::vector<std::wstring>& aShapetypes)
{
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )
return;
while ( false != oReader.ReadNextNode() )
{
std::wstring sName = oReader.GetName();
if(_T("v:shapetype") == sName)
{
std::wstring sXml = oReader.GetOuterXml();
if(false == sXml.empty())
aShapetypes.push_back(sXml);
}
}
}

View File

@ -1,44 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef COMMON_UTILS_INCLUDE_H_
#define COMMON_UTILS_INCLUDE_H_
#include "../SystemUtility/SystemUtility.h"
#include <vector>
namespace Common
{
void readAllShapeTypes(const OOX::CPath& oPath, std::vector<std::wstring>& aShapetypes);
} // namespace Common
#endif // COMMON_UTILS_INCLUDE_H_

View File

@ -320,8 +320,6 @@ namespace OOX
}
virtual void read(const CPath& oFilePath)
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -341,7 +339,6 @@ namespace OOX
m_arrComments.push_back( new CComment(oReader) );
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const
@ -436,8 +433,6 @@ namespace OOX
}
virtual void read(const CPath& oFilePath)
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -457,7 +452,6 @@ namespace OOX
m_arrComments.push_back( new CCommentExt(oReader) );
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const
@ -598,7 +592,6 @@ namespace OOX
}
virtual void read(const CPath& oFilePath)
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -618,7 +611,6 @@ namespace OOX
m_arrPeoples.push_back( new CPerson(oReader) );
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const

View File

@ -186,9 +186,8 @@ namespace OOX
virtual void read(const CPath& oRootPath, const CPath& oFilePath)
{
IFileContainer::Read( oRootPath, oFilePath );
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
return;
@ -220,7 +219,6 @@ namespace OOX
}
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const

View File

@ -37,7 +37,6 @@
#include "../Common/SimpleTypes_Word.h"
#include "../Common/SimpleTypes_Shared.h"
#include "../Common/Utils.h"
#include "WritingElement.h"
#include "File.h"
@ -73,8 +72,6 @@ namespace OOX
virtual ~CBackground()
{
}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("w:color"), m_oColor );
@ -326,9 +323,6 @@ namespace OOX
m_bMacroEnabled = true;
}
#ifdef USE_LITE_READER
Common::readAllShapeTypes(oPath, m_arrShapeTypes);//todooo перенести на уровень OOX::Documet чтоли - при чтении xml
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )
@ -360,104 +354,6 @@ namespace OOX
}
}
}
#else
XmlUtils::CXmlNode oDocument;
oDocument.FromXmlFile2( oPath.GetPath() );
if ( _T("w:document") == oDocument.GetName() )
{
oDocument.ReadAttributeBase( _T("w:conformance"), m_oConformance );
XmlUtils::CXmlNode oBackground;
if ( oDocument.GetNode( _T("w:background"), oBackground ) )
m_oBackground = oBackground;
XmlUtils::CXmlNode oBody;
if ( oDocument.GetNode( _T("w:body"), oBody ) )
{
XmlUtils::CXmlNodes oBodyChilds;
if ( oBody.GetNodes( _T("*"), oBodyChilds ) )
{
XmlUtils::CXmlNode oItem;
for (unsigned int nIndex = 0; nIndex < oBodyChilds.GetCount(); nIndex++ )
{
if ( oBodyChilds.GetAt( nIndex, oItem ) )
{
std::wstring sName = oItem.GetName();
WritingElement *pItem = NULL;
/*if ( _T("w:altChunk") == sName )
pItem = new Logic::CAltChunk( oItem );
else*/ if ( _T("w:bookmarkEnd") == sName )
pItem = new Logic::CBookmarkEnd( oItem );
else if ( _T("w:bookmarkStart") == sName )
pItem = new Logic::CBookmarkStart( oItem );
else if ( _T("w:commentRangeEnd") == sName )
pItem = new Logic::CCommentRangeEnd( oItem );
else if ( _T("w:commentRangeStart") == sName )
pItem = new Logic::CCommentRangeStart( oItem );
//else if ( _T("w:customXml") == sName )
// pItem = new Logic::CCustomXml( oItem );
else if ( _T("w:customXmlDelRangeEnd") == sName )
pItem = new Logic::CCustomXmlDelRangeEnd( oItem );
else if ( _T("w:customXmlDelRangeStart") == sName )
pItem = new Logic::CCustomXmlDelRangeStart( oItem );
else if ( _T("w:customXmlInsRangeEnd") == sName )
pItem = new Logic::CCustomXmlInsRangeEnd( oItem );
else if ( _T("w:customXmlInsRangeStart") == sName )
pItem = new Logic::CCustomXmlInsRangeStart( oItem );
else if ( _T("w:customXmlMoveFromRangeEnd") == sName )
pItem = new Logic::CCustomXmlMoveFromRangeEnd( oItem );
else if ( _T("w:customXmlMoveFromRangeStart") == sName )
pItem = new Logic::CCustomXmlMoveFromRangeStart( oItem );
else if ( _T("w:customXmlMoveToRangeEnd") == sName )
pItem = new Logic::CCustomXmlMoveToRangeEnd( oItem );
else if ( _T("w:customXmlMoveToRangeStart") == sName )
pItem = new Logic::CCustomXmlMoveToRangeStart( oItem );
//else if ( _T("w:del") == sName )
// pItem = new Logic::CDel( oItem );
//else if ( _T("w:ins") == sName )
// pItem = new Logic::CIns( oItem );
//else if ( _T("w:moveFrom") == sName )
// pItem = new Logic::CMoveFrom( oItem );
else if ( _T("w:moveFromRangeEnd") == sName )
pItem = new Logic::CMoveFromRangeEnd( oItem );
else if ( _T("w:moveFromRangeStart") == sName )
pItem = new Logic::CMoveFromRangeStart( oItem );
//else if ( _T("w:moveTo") == sName )
// pItem = new Logic::CMoveTo( oItem );
else if ( _T("w:moveToRangeEnd") == sName )
pItem = new Logic::CMoveToRangeEnd( oItem );
else if ( _T("w:moveToRangeStart") == sName )
pItem = new Logic::CMoveToRangeStart( oItem );
else if ( _T("m:oMath") == sName )
pItem = new Logic::COMath( oItem );
else if ( _T("m:oMathPara") == sName )
pItem = new Logic::COMathPara( oItem );
else if ( _T("w:p") == sName )
pItem = new Logic::CParagraph( oItem );
else if ( _T("w:permEnd") == sName )
pItem = new Logic::CPermEnd( oItem );
else if ( _T("w:permStart") == sName )
pItem = new Logic::CPermStart( oItem );
else if ( _T("w:proofErr") == sName )
pItem = new Logic::CProofErr( oItem );
else if ( _T("w:sdt") == sName )
pItem = new Logic::CSdt( oItem );
else if ( _T("w:sectPr") == sName )
m_oSectPr = oItem;
else if ( _T("w:tbl") == sName )
pItem = new Logic::CTbl( oItem );
if ( pItem )
m_arrItems.push_back( pItem );
}
}
}
}
}
#endif
}
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
@ -664,8 +560,6 @@ mc:Ignorable=\"w14 wp14\">";
nullable<OOX::Logic::CBackground > m_oBackground;
std::vector<WritingElement *> m_arrItems;
std::vector<std::wstring> m_arrShapeTypes;
};
} // namespace OOX

View File

@ -80,8 +80,6 @@ namespace OOX
m_oReadPath = oFilePath;
IFileContainer::Read( oRootPath, oFilePath );
Common::readAllShapeTypes(oFilePath, m_arrShapeTypes);
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -158,7 +156,6 @@ namespace OOX
CPath m_oReadPath;
std::vector<OOX::CFtnEdn*> m_arrEndnote;
std::vector<std::wstring> m_arrShapeTypes;
};
} // namespace OOX
#endif // OOX_ENDNOTE_INCLUDE_H_

View File

@ -80,8 +80,6 @@ namespace OOX
m_oReadPath = oFilePath;
IFileContainer::Read( oRootPath, oFilePath );
Common::readAllShapeTypes(oFilePath, m_arrShapeTypes);
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -158,7 +156,6 @@ namespace OOX
CPath m_oReadPath;
std::vector<OOX::CFtnEdn*> m_arrFootnote;
std::vector<std::wstring> m_arrShapeTypes;
};
} // namespace OOX

View File

@ -78,8 +78,6 @@ namespace OOX
m_arrItems.clear();
}
public:
virtual void read(const CPath& oFilePath)
{
//don't use this. use read(const CPath& oRootPath, const CPath& oFilePath)
@ -90,8 +88,6 @@ namespace OOX
{
m_oReadPath = oFilePath;
IFileContainer::Read( oRootPath, oFilePath );
#ifdef USE_LITE_READER
Common::readAllShapeTypes(oFilePath, m_arrShapeTypes);
XmlUtils::CXmlLiteReader oReader;
@ -183,95 +179,6 @@ namespace OOX
m_arrItems.push_back( pItem );
}
}
#else
XmlUtils::CXmlNode oMainNode;
oMainNode.FromXmlFile( oFilePath.GetPath(), true );
if ( _T("w:ftr") == oMainNode.GetName() )
m_eType = et_w_ftr;
else if ( _T("w:hdr") == oMainNode.GetName() )
m_eType = et_w_hdr;
else
return;
XmlUtils::CXmlNodes oChilds;
if ( oMainNode.GetNodes( _T("*"), oChilds ) )
{
XmlUtils::CXmlNode oItem;
for ( int nIndex = 0; nIndex < oChilds.GetCount(); nIndex++ )
{
if ( oChilds.GetAt( nIndex, oItem ) )
{
std::wstring sName = oItem.GetName();
WritingElement *pItem = NULL;
/*if ( _T("w:altChunk") == sName )
pItem = new Logic::AltChunk( oItem );
else */if ( _T("w:bookmarkEnd") == sName )
pItem = new Logic::CBookmarkEnd( oItem );
else if ( _T("w:bookmarkStart") == sName )
pItem = new Logic::CBookmarkStart( oItem );
else if ( _T("w:commentRangeEnd") == sName )
pItem = new Logic::CCommentRangeEnd( oItem );
else if ( _T("w:commentRangeStart") == sName )
pItem = new Logic::CCommentRangeStart( oItem );
//else if ( _T("w:customXml") == sName )
// pItem = new Logic::CCustomXml( oItem );
else if ( _T("w:customXmlDelRangeEnd") == sName )
pItem = new Logic::CCustomXmlDelRangeEnd( oItem );
else if ( _T("w:customXmlDelRangeStart") == sName )
pItem = new Logic::CCustomXmlDelRangeStart( oItem );
else if ( _T("w:customXmlInsRangeEnd") == sName )
pItem = new Logic::CCustomXmlInsRangeEnd( oItem );
else if ( _T("w:customXmlInsRangeStart") == sName )
pItem = new Logic::CCustomXmlInsRangeStart( oItem );
else if ( _T("w:customXmlMoveFromRangeEnd") == sName )
pItem = new Logic::CCustomXmlMoveFromRangeEnd( oItem );
else if ( _T("w:customXmlMoveFromRangeStart") == sName )
pItem = new Logic::CCustomXmlMoveFromRangeStart( oItem );
else if ( _T("w:customXmlMoveToRangeEnd") == sName )
pItem = new Logic::CCustomXmlMoveToRangeEnd( oItem );
else if ( _T("w:customXmlMoveToRangeStart") == sName )
pItem = new Logic::CCustomXmlMoveToRangeStart( oItem );
//else if ( _T("w:del") == sName )
// pItem = new Logic::CDel( oItem );
//else if ( _T("w:ins") == sName )
// pItem = new Logic::CIns( oItem );
//else if ( _T("w:moveFrom") == sName )
// pItem = new Logic::CMoveFrom( oItem );
else if ( _T("w:moveFromRangeEnd") == sName )
pItem = new Logic::CMoveFromRangeEnd( oItem );
else if ( _T("w:moveFromRangeStart") == sName )
pItem = new Logic::CMoveFromRangeStart( oItem );
//else if ( _T("w:moveTo") == sName )
// pItem = new Logic::CMoveTo( oItem );
else if ( _T("w:moveToRangeEnd") == sName )
pItem = new Logic::CMoveToRangeEnd( oItem );
else if ( _T("w:moveToRangeStart") == sName )
pItem = new Logic::CMoveToRangeStart( oItem );
else if ( _T("m:oMath") == sName )
pItem = new Logic::COMath( oItem );
else if ( _T("m:oMathPara") == sName )
pItem = new Logic::COMathPara( oItem );
else if ( _T("w:p") == sName )
pItem = new Logic::CParagraph( oItem );
else if ( _T("w:permEnd") == sName )
pItem = new Logic::CPermEnd( oItem );
else if ( _T("w:permStart") == sName )
pItem = new Logic::CPermStart( oItem );
else if ( _T("w:proofErr") == sName )
pItem = new Logic::CProofErr( oItem );
else if ( _T("w:sdt") == sName )
pItem = new Logic::CSdt( oItem );
else if ( _T("w:tbl") == sName )
pItem = new Logic::CTbl( oItem );
if ( pItem )
m_arrItems.push_back( pItem );
}
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const
{
@ -371,7 +278,6 @@ mc:Ignorable=\"w14 wp14\">");
OOX::EElementType m_eType;
std::vector<WritingElement* > m_arrItems;
std::vector<std::wstring> m_arrShapeTypes;
};
} // namespace OOX

View File

@ -854,7 +854,6 @@ namespace OOX
virtual void read(const CPath& oRootPath, const CPath& oFilePath)
{
IFileContainer::Read( oRootPath, oFilePath );
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
@ -890,59 +889,6 @@ namespace OOX
}
}
}
#else
XmlUtils::CXmlNode oNumbering;
oNumbering.FromXmlFile( oFilePath.GetPath(), true );
if ( _T("w:numbering") == oNumbering.GetName() )
{
XmlUtils::CXmlNodes oAbstractNumList;
oNumbering.GetNodes( _T("w:abstractNum"), oAbstractNumList );
for ( int nIndex = 0; nIndex < oAbstractNumList.GetCount(); nIndex++ )
{
XmlUtils::CXmlNode oAbstractNumNode;
if ( oAbstractNumList.GetAt( nIndex, oAbstractNumNode ) )
{
//OOX::Numbering::CAbstractNum oAbstractNum = oAbstractNumNode;
m_arrAbstractNum.push_back( /*oAbstractNum*/ new OOX::Numbering::CAbstractNum (oAbstractNumNode) );
}
}
XmlUtils::CXmlNodes oNumList;
oNumbering.GetNodes( _T("w:num"), oNumList );
for ( int nIndex = 0; nIndex < oNumList.GetCount(); nIndex++ )
{
XmlUtils::CXmlNode oNumNode;
if ( oNumList.GetAt( nIndex, oNumNode ) )
{
//OOX::Numbering::CNum oNum = oNumNode;
m_arrNum.push_back( /*oNum*/ new OOX::Numbering::CNum (oNumNode) );
}
}
XmlUtils::CXmlNode oNumIdPicBulletNode;
if ( oNumbering.GetNode( _T("w:numIdMacAtCleanup"), oNumIdPicBulletNode ) )
m_oNumIdMacAtCleanup = oNumIdPicBulletNode;
// TO DO: ак будут сделаны классы CDrawing, нужно будет сделать чтение
// w:numPicBullet
XmlUtils::CXmlNodes oNumPicList;
oNumbering.GetNodes( _T("w:numPicBullet"), oNumPicList );
for ( int nIndex = 0; nIndex < oNumPicList.GetCount(); nIndex++ )
{
XmlUtils::CXmlNode oNumNode;
if ( oNumPicList.GetAt( nIndex, oNumNode ) )
{
//OOX::Numbering::CNumPicBullet oNum = oNumNode;
m_arrNumPicBullet.push_back( /*oNum*/ new OOX::Numbering::CNumPicBullet (oNumNode) );
}
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const

View File

@ -184,8 +184,6 @@ namespace OOX
{
CPath oRelsPath = CreateFileName( oFilePath );
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oRelsPath.GetPath() ) )
@ -217,33 +215,6 @@ namespace OOX
}
}
}
#else
XmlUtils::CXmlNode oNode;
if ( oNode.FromXmlFile( oRelsPath.GetPath() ) && _T("Relationships") == oNode.GetName() )
{
XmlUtils::CXmlNodes oNodes;
if ( oNode.GetNodes( _T("Relationship"), oNodes ) )
{
XmlUtils::CXmlNode oRelNode;
for ( int nIndex = 0; nIndex < oNodes.GetCount(); nIndex++ )
{
if ( oNodes.GetAt( nIndex, oRelNode ) )
{
Rels::CRelationShip *pRel = new Rels::CRelationShip (oRelNode);
if (pRel)
{
std::wstring rid = pRel->rId().get();
m_arRelations.push_back(pRel);
m_mapRelations.insert(std::make_pair( rid, pRel) );
}
}
}
}
}
#endif
}
void Write(const CPath& oFilePath) const
{

View File

@ -2847,7 +2847,6 @@ namespace OOX
public:
virtual void read(const CPath& oFilePath)
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -3024,16 +3023,6 @@ namespace OOX
}
}
}
#else
XmlUtils::CXmlNode oWebSettings;
oWebSettings.FromXmlFile( oFilePath.GetPath(), true );
if ( _T("w:settings") == oWebSettings.GetName() )
{
XmlUtils::CXmlNode oNode;
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const
{

View File

@ -160,7 +160,6 @@ namespace OOX
public:
virtual void read(const CPath& oFilePath)
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -182,22 +181,6 @@ namespace OOX
m_oOptimizeForBrowser = oReader;
}
}
#else
XmlUtils::CXmlNode oWebSettings;
oWebSettings.FromXmlFile( oFilePath.GetPath(), true );
if ( _T("w:webSettings") == oWebSettings.GetName() )
{
XmlUtils::CXmlNode oNode;
if ( oWebSettings.GetNode( _T("w:allowPNG"), oNode ) )
m_oAllowPNG = oNode;
if ( oWebSettings.GetNode( _T("w:optimizeForBrowser"), oNode ) )
m_oOptimizeForBrowser = oNode;
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const
{

View File

@ -799,8 +799,6 @@ namespace OOX
public:
virtual void read(const CPath& oFilePath)
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -835,41 +833,6 @@ namespace OOX
m_oLatentStyles = oReader;
}
}
#else
XmlUtils::CXmlNode oStyles;
oStyles.FromXmlFile( oFilePath.GetPath(), true );
if ( _T("w:styles") == oStyles.GetName() )
{
XmlUtils::CXmlNode oChild;
if ( oStyles.GetNode( _T("w:docDefaults"), oChild ) )
m_oDocDefaults = oChild;
if ( oStyles.GetNode( _T("w:latentStyles"), oChild ) )
m_oLatentStyles = oChild;
XmlUtils::CXmlNodes oStyleList;
oStyles.GetNodes( _T("w:style"), oStyleList );
for ( int nStlyeIndex = 0; nStlyeIndex < oStyleList.GetCount(); nStlyeIndex++ )
{
XmlUtils::CXmlNode oStyleNode;
if ( oStyleList.GetAt( nStlyeIndex, oStyleNode ) )
{
OOX::CStyle *oStyle = new OOX::CStyle (oStyleNode);
if (oStyle)
{
if (oStyle->m_oName.IsInit())
{
m_arrStyleNamesMap[oStyle->m_oName->ToString()] = m_arrStyle.size();
}
m_arrStyle.push_back( oStyle );
}
}
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const
{

View File

@ -1,4 +1,4 @@
VERSION = 2.4.512.0
VERSION = 2.4.514.0
DEFINES += INTVER=$$VERSION
# CONFIGURATION

View File

@ -41,8 +41,6 @@ core_linux_64 {
DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
#DISABLE_FILE_DOWNLOADER \
FILTER_FLATE_DECODE_ENABLED \
CXIMAGE_DONT_DECLARE_TCHAR \