diff --git a/OOXML/Binary/Document/BinWriter/BinEquationWriter.cpp b/OOXML/Binary/Document/BinWriter/BinEquationWriter.cpp index 6de8d963c3..cbb530a93d 100644 --- a/OOXML/Binary/Document/BinWriter/BinEquationWriter.cpp +++ b/OOXML/Binary/Document/BinWriter/BinEquationWriter.cpp @@ -32,6 +32,7 @@ #include "BinEquationWriter.h" #include "../../Presentation/BinaryFileReaderWriter.h" +#include "../../../Common/SimpleTypes_OMath.h" namespace MathEquation { diff --git a/OOXML/Binary/Document/BinWriter/BinEquationWriter.h b/OOXML/Binary/Document/BinWriter/BinEquationWriter.h index b3e5730adb..6752c5ecbb 100644 --- a/OOXML/Binary/Document/BinWriter/BinEquationWriter.h +++ b/OOXML/Binary/Document/BinWriter/BinEquationWriter.h @@ -34,7 +34,6 @@ #include "BinReaderWriterDefines.h" #include "../../MathEquation/OutputDev.h" -#include "../../../Common/SimpleTypes_OMath.h" #include "../../../Common/SimpleTypes_Shared.h" #include "../../../Common/SimpleTypes_Word.h" diff --git a/OOXML/DocxFormat/Logic/Dir.h b/OOXML/DocxFormat/Logic/Dir.h index e320e4ec16..1c3f531c03 100644 --- a/OOXML/DocxFormat/Logic/Dir.h +++ b/OOXML/DocxFormat/Logic/Dir.h @@ -30,11 +30,8 @@ * */ #pragma once -#ifndef OOX_LOGIC_DIR_INCLUDE_H_ -#define OOX_LOGIC_DIR_INCLUDE_H_ #include "../WritingElement.h" -#include "RunProperty.h" namespace OOX { @@ -65,5 +62,3 @@ namespace OOX }; } // namespace Logic } // namespace OOX - -#endif // OOX_LOGIC_DIR_INCLUDE_H_ diff --git a/OOXML/DocxFormat/Logic/FldSimple.h b/OOXML/DocxFormat/Logic/FldSimple.h index cca22ec9f7..4b74a50c59 100644 --- a/OOXML/DocxFormat/Logic/FldSimple.h +++ b/OOXML/DocxFormat/Logic/FldSimple.h @@ -38,7 +38,7 @@ #include "../WritingElement.h" #include "../../Common/SimpleTypes_Word.h" #include "../../Common/SimpleTypes_Shared.h" -#include "../../DocxFormat/Logic/FldChar.h" +#include "FldChar.h" namespace OOX { diff --git a/OOXML/DocxFormat/Logic/Paragraph.cpp b/OOXML/DocxFormat/Logic/Paragraph.cpp index e6e9542ddb..05a8be45a4 100644 --- a/OOXML/DocxFormat/Logic/Paragraph.cpp +++ b/OOXML/DocxFormat/Logic/Paragraph.cpp @@ -30,6 +30,7 @@ * */ #include "../DocxFlat.h" +#include "../Comments.h" #include "Paragraph.h" #include "Annotations.h" @@ -42,9 +43,9 @@ #include "Hyperlink.h" #include "SmartTag.h" #include "Dir.h" -#include "../Comments.h" -#include "../Math/oMathPara.h" + #include "../Math/OMath.h" +#include "../Math/oMathPara.h" // TO DO: Нехватающие классы: // @@ -424,197 +425,6 @@ namespace OOX WritingElement_ReadAttributes_End_No_NS( oReader ) } - void CParagraph::AddRun(CRun *pRun) - { - m_arrItems.push_back( (WritingElement*)pRun ); - } - void CParagraph::AddText(std::wstring& sText) - { - WritingElement *pR = new CRun(); - if ( !pR ) - return; - - WritingElement *pT = new CText(); - if ( !pT ) - { - delete pR; - return; - } - - CText *pText = (CText*)pT; - pText->m_sText = sText; - pText->m_oSpace = new SimpleTypes::CXmlSpace(); - pText->m_oSpace->SetValue( SimpleTypes::xmlspacePreserve ); - - - ((CRun*)pR)->m_arrItems.push_back( pT ); - - m_arrItems.push_back( pR ); - } - void CParagraph::AddText(std::wstring& sText, CRunProperty * pProperty) - { - WritingElement *pR = new CRun(); - if ( !pR ) - return; - - WritingElement *pT = new CText(); - if ( !pT ) - { - delete pR; - return; - } - - CText *pText = (CText*)pT; - pText->m_sText = sText; - pText->m_oSpace = new SimpleTypes::CXmlSpace(); - pText->m_oSpace->SetValue( SimpleTypes::xmlspacePreserve ); - - if ( pProperty ) - { - ((CRun*)pR)->m_arrItems.push_back( (WritingElement*)pProperty ); - ((CRun*)pR)->m_oRunProperty = pProperty;//копия для удобства - } - - ((CRun*)pR)->m_arrItems.push_back( pT ); - - m_arrItems.push_back( pR ); - } - void CParagraph::AddTab() - { - WritingElement *pR = new CRun(); - if ( !pR ) - return; - - WritingElement *pTab = new CTab(); - if ( !pTab ) - { - delete pR; - return; - } - - ((CRun*)pR)->m_arrItems.push_back( pTab ); - - m_arrItems.push_back( pR ); - } - void CParagraph::AddTab(CRunProperty *pProperty) - { - WritingElement *pR = new CRun(); - if ( !pR ) - return; - - WritingElement *pTab = new CTab(); - if ( !pTab ) - { - delete pR; - return; - } - if ( pProperty ) - ((CRun*)pR)->m_arrItems.push_back( (WritingElement*)pProperty ); - - ((CRun*)pR)->m_arrItems.push_back( pTab ); - - m_arrItems.push_back( pR ); - } - void CParagraph::AddBreak(SimpleTypes::EBrType eType) - { - WritingElement *pR = new CRun(); - if ( !pR ) - return; - - WritingElement *pBr = new CBr(); - if ( !pBr ) - { - delete pR; - return; - } - - ((CBr*)pBr)->m_oType.SetValue( eType ); - - ((CRun*)pR)->m_arrItems.push_back( pBr ); - - m_arrItems.push_back( pR ); - } - void CParagraph::AddSpace(const int nCount) - { - WritingElement *pR = new CRun(); - if ( !pR ) - return; - - WritingElement *pT = new CText(); - if ( !pT ) - { - delete pR; - return; - } - - CText *pText = (CText*)pT; - - char *sString = new char[nCount + 1]; - ::memset( sString, 0x20, nCount ); - sString[nCount] = '\0'; - std::string s(sString); - pText->m_sText = std::wstring(s.begin(), s.end()); - delete sString; - pText->m_oSpace = new SimpleTypes::CXmlSpace(); - pText->m_oSpace->SetValue( SimpleTypes::xmlspacePreserve ); - - ((CRun*)pR)->m_arrItems.push_back( pT ); - - m_arrItems.push_back( pR ); - } - void CParagraph::AddSpace(const int nCount, CRunProperty *pProperty) - { - WritingElement *pR = new CRun(); - if ( !pR ) - return; - - WritingElement *pT = new CText(); - if ( !pT ) - { - delete pR; - return; - } - - CText *pText = (CText*)pT; - char *sString = new char[nCount + 1]; - ::memset( sString, 0x20, nCount ); - sString[nCount] = '\0'; - std::string s(sString); - pText->m_sText = std::wstring(s.begin(), s.end()); - delete sString; - pText->m_oSpace = new SimpleTypes::CXmlSpace(); - pText->m_oSpace->SetValue( SimpleTypes::xmlspacePreserve ); - - if ( pProperty ) - ((CRun*)pR)->m_arrItems.push_back( (WritingElement*)pProperty ); - - ((CRun*)pR)->m_arrItems.push_back( pT ); - - m_arrItems.push_back( pR ); - } - void CParagraph::AddBookmarkStart(int nId, std::wstring& sName) - { - WritingElement *pBS = new CBookmarkStart(); - if ( !pBS ) - return; - - ((CBookmarkStart*)pBS)->m_oId = new SimpleTypes::CDecimalNumber(); - ((CBookmarkStart*)pBS)->m_oId->SetValue( nId ); - ((CBookmarkStart*)pBS)->m_sName = sName; - - m_arrItems.push_back( pBS ); - } - void CParagraph::AddBookmarkEnd (int nId) - { - WritingElement *pBE = new CBookmarkEnd(); - if ( !pBE ) - return; - - ((CBookmarkEnd*)pBE)->m_oId = new SimpleTypes::CDecimalNumber(); - ((CBookmarkEnd*)pBE)->m_oId->SetValue( nId ); - - m_arrItems.push_back( pBE ); - } EElementType CParagraph::getType() const { return et_w_p; diff --git a/OOXML/DocxFormat/Logic/Paragraph.h b/OOXML/DocxFormat/Logic/Paragraph.h index 53b3fdd11b..e98d01aa45 100644 --- a/OOXML/DocxFormat/Logic/Paragraph.h +++ b/OOXML/DocxFormat/Logic/Paragraph.h @@ -35,14 +35,6 @@ #include "../WritingElement.h" #include "../../Common/SimpleTypes_Word.h" -#include "RunProperty.h" -#include "Run.h" -#include "Hyperlink.h" -#include "SmartTag.h" -#include "Dir.h" -#include "Bdo.h" -#include "../Math/oMathPara.h" - namespace OOX { namespace Logic @@ -64,17 +56,6 @@ namespace OOX virtual void ClearItems(); - void AddRun(CRun *pRun); - void AddText(std::wstring& sText); - void AddText(std::wstring& sText, CRunProperty *pProperty); - void AddTab(); - void AddTab(CRunProperty *pProperty); - void AddBreak(SimpleTypes::EBrType eType); - void AddSpace(const int nCount); - void AddSpace(const int nCount, CRunProperty *pProperty); - void AddBookmarkStart(int nId, std::wstring& sName); - void AddBookmarkEnd (int nId); - virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; diff --git a/OOXML/DocxFormat/Logic/Run.cpp b/OOXML/DocxFormat/Logic/Run.cpp index 5e48a503a9..4ad089c781 100644 --- a/OOXML/DocxFormat/Logic/Run.cpp +++ b/OOXML/DocxFormat/Logic/Run.cpp @@ -29,6 +29,8 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ +#include "Run.h" + #include "../DocxFlat.h" #include "../Docx.h" #include "../Document.h" @@ -36,8 +38,18 @@ #include "../Footnote.h" #include "../Comments.h" #include "../Settings/Settings.h" +#include "../Drawing/Drawing.h" +#include "../Comments.h" -#include "Run.h" +#include "AlternateContent.h" +#include "RunProperty.h" +#include "RunContent.h" +#include "FldChar.h" +#include "FldSimple.h" +#include "Pict.h" +#include "Annotations.h" + +#include "../../../DesktopEditor/common/StringExt.h" namespace OOX { diff --git a/OOXML/DocxFormat/Logic/Run.h b/OOXML/DocxFormat/Logic/Run.h index 08224dfcbe..43117551b2 100644 --- a/OOXML/DocxFormat/Logic/Run.h +++ b/OOXML/DocxFormat/Logic/Run.h @@ -31,22 +31,15 @@ */ #pragma once -#include "RunProperty.h" -#include "RunContent.h" -#include "FldChar.h" -#include "FldSimple.h" - -#include "../Drawing/Drawing.h" -#include "../Comments.h" -#include "Pict.h" -#include "Annotations.h" -#include "AlternateContent.h" -#include "../../../DesktopEditor/common/StringExt.h" +#include "../../Base/Nullable.h" +#include "../WritingElement.h" +#include "../../Common/SimpleTypes_Word.h" namespace OOX { namespace Logic { + class CRunProperty; //-------------------------------------------------------------------------------- // CRun 17.3.2.25 (Part 1) //-------------------------------------------------------------------------------- diff --git a/OOXML/DocxFormat/Logic/Table.h b/OOXML/DocxFormat/Logic/Table.h index 41409d3c09..3e95c0baf8 100644 --- a/OOXML/DocxFormat/Logic/Table.h +++ b/OOXML/DocxFormat/Logic/Table.h @@ -30,11 +30,7 @@ * */ #pragma once -#ifndef OOX_LOGIC_TABLE_INCLUDE_H_ -#define OOX_LOGIC_TABLE_INCLUDE_H_ -#include "../WritingElement.h" -#include "../../Common/SimpleTypes_Word.h" #include "TableProperty.h" namespace ComplexTypes @@ -69,7 +65,7 @@ namespace ComplexTypes namespace OOX { namespace Logic - { + { //-------------------------------------------------------------------------------- // CTblGridChange 17.13.5.33 (Part 1) //-------------------------------------------------------------------------------- @@ -461,4 +457,3 @@ namespace OOX } // namespace Logic } // namespace OOX -#endif // OOX_LOGIC_TABLE_INCLUDE_H_ diff --git a/OOXML/DocxFormat/Logic/TableProperty.h b/OOXML/DocxFormat/Logic/TableProperty.h index 70652246ad..4bbde587dc 100644 --- a/OOXML/DocxFormat/Logic/TableProperty.h +++ b/OOXML/DocxFormat/Logic/TableProperty.h @@ -31,11 +31,7 @@ */ #pragma once -#ifndef OOX_LOGIC_TABLE_PROPERTY_INCLUDE_H_ -#define OOX_LOGIC_TABLE_PROPERTY_INCLUDE_H_ - #include "../WritingElement.h" - #include "../../Common/ComplexTypes.h" namespace ComplexTypes @@ -780,4 +776,3 @@ namespace OOX } // namespace Logic } // namespace OOX -#endif // OOX_LOGIC_TABLE_PROPERTY_INCLUDE_H_ diff --git a/OOXML/DocxFormat/Math/oMathPara.h b/OOXML/DocxFormat/Math/oMathPara.h index 63df629008..86a8f0306a 100644 --- a/OOXML/DocxFormat/Math/oMathPara.h +++ b/OOXML/DocxFormat/Math/oMathPara.h @@ -31,7 +31,6 @@ */ #pragma once #include "oMathContent.h" -#include "../Logic/Run.h" namespace OOX { diff --git a/OOXML/Projects/Linux/DocxFormatLib/DocxFormatLib.pro b/OOXML/Projects/Linux/DocxFormatLib/DocxFormatLib.pro index 7617d71079..787e7c0dc0 100644 --- a/OOXML/Projects/Linux/DocxFormatLib/DocxFormatLib.pro +++ b/OOXML/Projects/Linux/DocxFormatLib/DocxFormatLib.pro @@ -22,9 +22,9 @@ DEFINES += UNICODE _UNICODE \ #BOOST include($$PWD/../../../../Common/3dParty/boost/boost.pri) -#CONFIG += precompile_header -#PRECOMPILED_HEADER = precompiled.h -#HEADERS += precompiled.h +CONFIG += precompile_header +PRECOMPILED_HEADER = precompiled.h +HEADERS += precompiled.h core_release { SOURCES += \