Commit f3ac6ad2 authored by Sergey Konovalov's avatar Sergey Konovalov Committed by GitHub

Merge pull request #15 from ONLYOFFICE/feature/footnotemath

Feature/footnotemath
parents 69d20d60 68f24fa7
...@@ -64,6 +64,8 @@ namespace Writers ...@@ -64,6 +64,8 @@ namespace Writers
StylesWriter m_oStylesWriter; StylesWriter m_oStylesWriter;
NumberingWriter m_oNumberingWriter; NumberingWriter m_oNumberingWriter;
HeaderFooterWriter m_oHeaderFooterWriter; HeaderFooterWriter m_oHeaderFooterWriter;
FootnotesWriter m_oFootnotesWriter;
EndnotesWriter m_oEndnotesWriter;
SettingWriter m_oSettingWriter; SettingWriter m_oSettingWriter;
CommentsWriter m_oCommentsWriter; CommentsWriter m_oCommentsWriter;
ChartWriter m_oChartWriter; ChartWriter m_oChartWriter;
...@@ -78,6 +80,8 @@ namespace Writers ...@@ -78,6 +80,8 @@ namespace Writers
m_pDrawingConverter(pDrawingConverter),m_sThemePath(sThemePath),m_bSaveChartAsImg(bSaveChartAsImg), m_pDrawingConverter(pDrawingConverter),m_sThemePath(sThemePath),m_bSaveChartAsImg(bSaveChartAsImg),
m_oContentTypesWriter(sDirOutput), m_oFontTableWriter(sDirOutput, sFontDir), m_oContentTypesWriter(sDirOutput), m_oFontTableWriter(sDirOutput, sFontDir),
m_oHeaderFooterWriter(sDirOutput, m_oContentTypesWriter), m_oHeaderFooterWriter(sDirOutput, m_oContentTypesWriter),
m_oFootnotesWriter(sDirOutput, m_oContentTypesWriter),
m_oEndnotesWriter(sDirOutput, m_oContentTypesWriter),
m_oMediaWriter(sDirOutput), m_oMediaWriter(sDirOutput),
m_oStylesWriter(sDirOutput, nVersion), m_oStylesWriter(sDirOutput, nVersion),
m_oNumberingWriter(sDirOutput, m_oContentTypesWriter), m_oNumberingWriter(sDirOutput, m_oContentTypesWriter),
......
...@@ -64,6 +64,12 @@ namespace Writers ...@@ -64,6 +64,12 @@ namespace Writers
static CString g_string_ftr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:ftr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">"); static CString g_string_ftr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:ftr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static CString g_string_ftr_End = _T("</w:ftr>"); static CString g_string_ftr_End = _T("</w:ftr>");
static CString g_string_footnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:footnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static CString g_string_footnotes_End = _T("</w:footnotes>");
static CString g_string_endnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:endnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static CString g_string_endnotes_End = _T("</w:endnotes>");
class HeaderFooterWriter class HeaderFooterWriter
{ {
CString m_sDir; CString m_sDir;
...@@ -122,5 +128,79 @@ namespace Writers ...@@ -122,5 +128,79 @@ namespace Writers
//return m_oDocumentRelsWriter.AddRels(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/") + sHeader, sFilename); //return m_oDocumentRelsWriter.AddRels(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/") + sHeader, sFilename);
} }
}; };
class FootnotesWriter
{
CString m_sDir;
ContentTypesWriter& m_oContentTypesWriter;
public:
ContentWriter m_oNotesWriter;
FootnotesWriter(CString sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
{
}
void Write()
{
if(!IsEmpty())
{
CString sFilename = getFilename();
CString filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + sFilename;
CFile oFile;
oFile.CreateFile(filePath);
oFile.WriteStringUTF8(g_string_footnotes_Start);
oFile.WriteStringUTF8(m_oNotesWriter.m_oContent.GetData());
oFile.WriteStringUTF8(g_string_footnotes_End);
oFile.CloseFile();
//ContentType
m_oContentTypesWriter.AddOverride(_T("/word/") + sFilename, _T("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml"));
}
}
CString getFilename()
{
return _T("footnotes.xml");
}
bool IsEmpty()
{
return !(m_oNotesWriter.m_oContent.GetCurSize() > 0);
}
};
class EndnotesWriter
{
CString m_sDir;
ContentTypesWriter& m_oContentTypesWriter;
public:
ContentWriter m_oNotesWriter;
EndnotesWriter(CString sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
{
}
void Write()
{
if(!IsEmpty())
{
CString sFilename = getFilename();
CString filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + sFilename;
CFile oFile;
oFile.CreateFile(filePath);
oFile.WriteStringUTF8(g_string_endnotes_Start);
oFile.WriteStringUTF8(m_oNotesWriter.m_oContent.GetData());
oFile.WriteStringUTF8(g_string_endnotes_End);
oFile.CloseFile();
//ContentType
m_oContentTypesWriter.AddOverride(_T("/word/") + sFilename, _T("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"));
}
}
CString getFilename()
{
return _T("endnotes.xml");
}
bool IsEmpty()
{
return !(m_oNotesWriter.m_oContent.GetCurSize() > 0);
}
};
} }
#endif // #ifndef HEADER_FOOTER_WRITER #endif // #ifndef HEADER_FOOTER_WRITER
...@@ -56,6 +56,8 @@ public: ...@@ -56,6 +56,8 @@ public:
CString sectPrChange; CString sectPrChange;
CString cols; CString cols;
CString pgBorders; CString pgBorders;
CString footnotePr;
CString endnotePr;
bool bHeader; bool bHeader;
bool bFooter; bool bFooter;
...@@ -97,6 +99,10 @@ public: ...@@ -97,6 +99,10 @@ public:
long nMFooter = SerializeCommon::Round(Footer * g_dKoef_mm_to_twips); long nMFooter = SerializeCommon::Round(Footer * g_dKoef_mm_to_twips);
if(!sHeaderFooterReference.IsEmpty()) if(!sHeaderFooterReference.IsEmpty())
sRes.Append(sHeaderFooterReference); sRes.Append(sHeaderFooterReference);
if(!footnotePr.IsEmpty())
sRes.Append(footnotePr);
if(!endnotePr.IsEmpty())
sRes.Append(endnotePr);
if(bSectionType) if(bSectionType)
{ {
CString sType; CString sType;
......
This diff is collapsed.
...@@ -150,7 +150,9 @@ extern int g_nCurFormatVersion; ...@@ -150,7 +150,9 @@ extern int g_nCurFormatVersion;
Document = 6, Document = 6,
Other = 7, Other = 7,
Comments = 8, Comments = 8,
Settings = 9 Settings = 9,
Footnotes = 10,
Endnotes = 11
};} };}
namespace c_oSerSigTypes{enum c_oSerSigTypes namespace c_oSerSigTypes{enum c_oSerSigTypes
{ {
...@@ -175,7 +177,7 @@ extern int g_nCurFormatVersion; ...@@ -175,7 +177,7 @@ extern int g_nCurFormatVersion;
AbstractNum_Type = 3, AbstractNum_Type = 3,
AbstractNum_Lvls = 4, AbstractNum_Lvls = 4,
Lvl = 5, Lvl = 5,
lvl_Format = 6, lvl_Format = 6,//deprecated (instead use lvl_NumFmt)
lvl_Jc = 7, lvl_Jc = 7,
lvl_LvlText = 8, lvl_LvlText = 8,
lvl_LvlTextItem = 9, lvl_LvlTextItem = 9,
...@@ -192,7 +194,10 @@ extern int g_nCurFormatVersion; ...@@ -192,7 +194,10 @@ extern int g_nCurFormatVersion;
Num_NumId = 20, Num_NumId = 20,
lvl_PStyle = 21, lvl_PStyle = 21,
NumStyleLink = 22, NumStyleLink = 22,
StyleLink = 23 StyleLink = 23,
lvl_NumFmt = 24,
NumFmtVal = 25,
NumFmtFormat = 26
};} };}
namespace c_oSerOtherTableTypes{enum c_oSerOtherTableTypes namespace c_oSerOtherTableTypes{enum c_oSerOtherTableTypes
{ {
...@@ -425,7 +430,9 @@ extern int g_nCurFormatVersion; ...@@ -425,7 +430,9 @@ extern int g_nCurFormatVersion;
pageNumType = 6, pageNumType = 6,
sectPrChange = 7, sectPrChange = 7,
cols = 8, cols = 8,
pgBorders = 9 pgBorders = 9,
footnotePr = 10,
endnotePr = 11
};} };}
namespace c_oSerProp_secPrSettingsType{enum c_oSerProp_secPrSettingsType namespace c_oSerProp_secPrSettingsType{enum c_oSerProp_secPrSettingsType
{ {
...@@ -492,7 +499,11 @@ extern int g_nCurFormatVersion; ...@@ -492,7 +499,11 @@ extern int g_nCurFormatVersion;
noBreakHyphen = 20, noBreakHyphen = 20,
softHyphen = 21, softHyphen = 21,
separator = 22, separator = 22,
continuationSeparator = 23 continuationSeparator = 23,
footnoteRef = 24,
endnoteRef = 25,
footnoteReference = 26,
endnoteReference = 27
};} };}
namespace c_oSerImageType{enum c_oSerImageType namespace c_oSerImageType{enum c_oSerImageType
{ {
...@@ -689,7 +700,9 @@ extern int g_nCurFormatVersion; ...@@ -689,7 +700,9 @@ extern int g_nCurFormatVersion;
ClrSchemeMapping = 0, ClrSchemeMapping = 0,
DefaultTabStop = 1, DefaultTabStop = 1,
MathPr = 2, MathPr = 2,
TrackRevisions = 3 TrackRevisions = 3,
FootnotePr = 4,
EndnotePr = 5
};} };}
namespace c_oSer_MathPrType{enum c_oSer_SettingsType namespace c_oSer_MathPrType{enum c_oSer_SettingsType
{ {
...@@ -948,6 +961,21 @@ extern int g_nCurFormatVersion; ...@@ -948,6 +961,21 @@ extern int g_nCurFormatVersion;
NoResize = 4, NoResize = 4,
NoSelect = 5 NoSelect = 5
};} };}
namespace c_oSerNotes{enum c_oSerNotes
{
Note = 0,
NoteType = 1,
NoteId = 2,
NoteContent = 3,
RefCustomMarkFollows = 4,
RefId = 5,
PrFmt = 6,
PrRestart = 7,
PrStart = 8,
PrFntPos = 9,
PrEndPos = 10,
PrRef = 11
};}
} }
#endif // #ifndef DOCX_BIN_READER_WRITER_DEFINES #endif // #ifndef DOCX_BIN_READER_WRITER_DEFINES
This diff is collapsed.
...@@ -346,6 +346,8 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const ...@@ -346,6 +346,8 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const
m_pCurFileWriter->m_oNumberingWriter.Write(); m_pCurFileWriter->m_oNumberingWriter.Write();
m_pCurFileWriter->m_oFontTableWriter.Write(); m_pCurFileWriter->m_oFontTableWriter.Write();
m_pCurFileWriter->m_oHeaderFooterWriter.Write(); m_pCurFileWriter->m_oHeaderFooterWriter.Write();
m_pCurFileWriter->m_oFootnotesWriter.Write();
m_pCurFileWriter->m_oEndnotesWriter.Write();
//Setting пишем после HeaderFooter, чтобы заполнить evenAndOddHeaders //Setting пишем после HeaderFooter, чтобы заполнить evenAndOddHeaders
m_pCurFileWriter->m_oSettingWriter.Write(); m_pCurFileWriter->m_oSettingWriter.Write();
m_pCurFileWriter->m_oWebSettingsWriter.Write(); m_pCurFileWriter->m_oWebSettingsWriter.Write();
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_ #ifndef PPTXOOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_
#define OOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_ #define PPTXOOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_
#include "./../WritingElement.h" #include "./../WritingElement.h"
#include "ExtensionTable.h" #include "ExtensionTable.h"
...@@ -95,4 +95,4 @@ namespace PPTX ...@@ -95,4 +95,4 @@ namespace PPTX
} // namespace ContentTypes } // namespace ContentTypes
} // namespace PPTX } // namespace PPTX
#endif // OOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_ #endif // PPTXOOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_CONTENT_TYPES_DEFAULT_TABLE_INCLUDE_H_ #ifndef PPTXOOX_CONTENT_TYPES_DEFAULT_TABLE_INCLUDE_H_
#define OOX_CONTENT_TYPES_DEFAULT_TABLE_INCLUDE_H_ #define PPTXOOX_CONTENT_TYPES_DEFAULT_TABLE_INCLUDE_H_
#include "./../WritingVector.h" #include "./../WritingVector.h"
#include "Default.h" #include "Default.h"
...@@ -91,4 +91,4 @@ namespace PPTX ...@@ -91,4 +91,4 @@ namespace PPTX
} // namespace ContentTypes } // namespace ContentTypes
} // namespace PPTX } // namespace PPTX
#endif // OOX_CONTENT)TYPES_DEFAULT_TABLE_INCLUDE_H_ #endif // PPTXOOX_CONTENT)TYPES_DEFAULT_TABLE_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_ #ifndef PPTXOOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_
#define OOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_ #define PPTXOOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_
#include "../../../../Common/DocxFormat/Source/Base/Base.h" #include "../../../../Common/DocxFormat/Source/Base/Base.h"
#include <map> #include <map>
...@@ -90,4 +90,4 @@ namespace PPTX ...@@ -90,4 +90,4 @@ namespace PPTX
} // namespace ContentTypes } // namespace ContentTypes
} // namespace PPTX } // namespace PPTX
#endif // OOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_ #endif // PPTXOOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_CONTENT_TYPES_FILE_INCLUDE_H_ #ifndef PPTXOOX_CONTENT_TYPES_FILE_INCLUDE_H_
#define OOX_CONTENT_TYPES_FILE_INCLUDE_H_ #define PPTXOOX_CONTENT_TYPES_FILE_INCLUDE_H_
#include "OverrideTable.h" #include "OverrideTable.h"
#include "DefaultTable.h" #include "DefaultTable.h"
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_ #ifndef PPTXOOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_
#define OOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_ #define PPTXOOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_
#include "./../WritingElement.h" #include "./../WritingElement.h"
#include "../../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h" #include "../../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h"
...@@ -98,4 +98,4 @@ namespace PPTX ...@@ -98,4 +98,4 @@ namespace PPTX
} // namespace ContentTypes } // namespace ContentTypes
} // namespace PPTX } // namespace PPTX
#endif // OOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_ #endif // PPTXOOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_ #ifndef PPTXOOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_
#define OOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_ #define PPTXOOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_
#include "./../WritingVector.h" #include "./../WritingVector.h"
#include "Override.h" #include "Override.h"
...@@ -74,4 +74,4 @@ namespace PPTX ...@@ -74,4 +74,4 @@ namespace PPTX
} // namespace ContentTypes } // namespace ContentTypes
} // namespace PPTX } // namespace PPTX
#endif // OOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_ #endif // PPTXOOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_DATE_TIME_INCLUDE_H_ #ifndef PPTXOOX_DATE_TIME_INCLUDE_H_
#define OOX_DATE_TIME_INCLUDE_H_ #define PPTXOOX_DATE_TIME_INCLUDE_H_
#include "../../../Common/DocxFormat/Source/Utility/Utility.h" #include "../../../Common/DocxFormat/Source/Utility/Utility.h"
...@@ -79,4 +79,4 @@ namespace PPTX ...@@ -79,4 +79,4 @@ namespace PPTX
const CString DateTime::s_pattern = _T("%YYYY-%MM-%DDT%hh:%mm:%ssZ"); const CString DateTime::s_pattern = _T("%YYYY-%MM-%DDT%hh:%mm:%ssZ");
} // namespace PPTX } // namespace PPTX
#endif // OOX_DATE_TIME_INCLUDE_H_ #endif // PPTXOOX_DATE_TIME_INCLUDE_H_
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_EXTERNAL_INCLUDE_H_ #ifndef PPTXOOX_EXTERNAL_INCLUDE_H_
#define OOX_EXTERNAL_INCLUDE_H_ #define PPTXOOX_EXTERNAL_INCLUDE_H_
#include "../File.h" #include "../File.h"
#include "../FileTypes.h" #include "../FileTypes.h"
...@@ -73,4 +73,4 @@ namespace PPTX ...@@ -73,4 +73,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_EXTERNAL_INCLUDE_H_ #endif // PPTXOOX_EXTERNAL_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_EXTERNALAUDIO_INCLUDE_H_ #ifndef PPTXOOX_EXTERNALAUDIO_INCLUDE_H_
#define OOX_EXTERNALAUDIO_INCLUDE_H_ #define PPTXOOX_EXTERNALAUDIO_INCLUDE_H_
#include "External.h" #include "External.h"
...@@ -68,4 +68,4 @@ namespace PPTX ...@@ -68,4 +68,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_EXTERNALAUDIO_INCLUDE_H_ #endif // PPTXOOX_EXTERNALAUDIO_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_EXTERNALIMAGE_INCLUDE_H_ #ifndef PPTXOOX_EXTERNALIMAGE_INCLUDE_H_
#define OOX_EXTERNALIMAGE_INCLUDE_H_ #define PPTXOOX_EXTERNALIMAGE_INCLUDE_H_
#include "External.h" #include "External.h"
...@@ -68,4 +68,4 @@ namespace PPTX ...@@ -68,4 +68,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_EXTERNALIMAGE_INCLUDE_H_ #endif // PPTXOOX_EXTERNALIMAGE_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_EXTERNALVIDEO_INCLUDE_H_ #ifndef PPTXOOX_EXTERNALVIDEO_INCLUDE_H_
#define OOX_EXTERNALVIDEO_INCLUDE_H_ #define PPTXOOX_EXTERNALVIDEO_INCLUDE_H_
#include "External.h" #include "External.h"
...@@ -68,4 +68,4 @@ namespace PPTX ...@@ -68,4 +68,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_EXTERNALVIDEO_INCLUDE_H_ #endif // PPTXOOX_EXTERNALVIDEO_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_HYPERLINK_INCLUDE_H_ #ifndef PPTXOOX_HYPERLINK_INCLUDE_H_
#define OOX_HYPERLINK_INCLUDE_H_ #define PPTXOOX_HYPERLINK_INCLUDE_H_
#include "External.h" #include "External.h"
...@@ -68,4 +68,4 @@ namespace PPTX ...@@ -68,4 +68,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_HYPERLINK_INCLUDE_H_ #endif // PPTXOOX_HYPERLINK_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_FILE_INCLUDE_H_ #ifndef PPTXOOX_FILE_INCLUDE_H_
#define OOX_FILE_INCLUDE_H_ #define PPTXOOX_FILE_INCLUDE_H_
#include "../../../Common/DocxFormat/Source/XML/XmlSimple.h" #include "../../../Common/DocxFormat/Source/XML/XmlSimple.h"
#include "../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h" #include "../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h"
...@@ -58,4 +58,4 @@ namespace PPTX ...@@ -58,4 +58,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_FILE_INCLUDE_H_ #endif // PPTXOOX_FILE_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_FILE_TYPE_INCLUDE_H_ #ifndef PPTXOOX_FILE_TYPE_INCLUDE_H_
#define OOX_FILE_TYPE_INCLUDE_H_ #define PPTXOOX_FILE_TYPE_INCLUDE_H_
#include "../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h" #include "../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h"
...@@ -112,4 +112,4 @@ namespace PPTX ...@@ -112,4 +112,4 @@ namespace PPTX
} }
} // namespace PPTX } // namespace PPTX
#endif // OOX_FILE_TYPE_INCLUDE_H_ #endif // PPTXOOX_FILE_TYPE_INCLUDE_H_
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_FILE_TYPES_INCLUDE_H_ #ifndef PPTXOOX_FILE_TYPES_INCLUDE_H_
#define OOX_FILE_TYPES_INCLUDE_H_ #define PPTXOOX_FILE_TYPES_INCLUDE_H_
#include "FileType.h" #include "FileType.h"
...@@ -285,4 +285,4 @@ namespace PPTX ...@@ -285,4 +285,4 @@ namespace PPTX
} // namespace FileTypes } // namespace FileTypes
} // namespace OOX } // namespace OOX
#endif // OOX_FILE_TYPES_INCLUDE_H_ #endif // PPTXOOX_FILE_TYPES_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_FILE_BUILDER_INCLUDE_H_ #ifndef PPTXOOX_FILE_BUILDER_INCLUDE_H_
#define OOX_FILE_BUILDER_INCLUDE_H_ #define PPTXOOX_FILE_BUILDER_INCLUDE_H_
#include "ContentTypes/File.h" #include "ContentTypes/File.h"
...@@ -50,4 +50,4 @@ namespace PPTX ...@@ -50,4 +50,4 @@ namespace PPTX
}; };
} // namespace OOX } // namespace OOX
#endif // OOX_FILE_BUILDER_INCLUDE_H_ #endif // PPTXOOX_FILE_BUILDER_INCLUDE_H_
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_IFILE_CONTAINER_INCLUDE_H_ #ifndef PPTXOOX_IFILE_CONTAINER_INCLUDE_H_
#define OOX_IFILE_CONTAINER_INCLUDE_H_ #define PPTXOOX_IFILE_CONTAINER_INCLUDE_H_
#include "RId.h" #include "RId.h"
#include "UnknowTypeFile.h" #include "UnknowTypeFile.h"
...@@ -126,4 +126,4 @@ namespace PPTX ...@@ -126,4 +126,4 @@ namespace PPTX
} // namespace PPTX } // namespace PPTX
#endif // OOX_IFILE_CONTAINER_INCLUDE_H_ #endif // PPTXOOX_IFILE_CONTAINER_INCLUDE_H_
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_AUDIO_INCLUDE_H_ #ifndef PPTXOOX_AUDIO_INCLUDE_H_
#define OOX_AUDIO_INCLUDE_H_ #define PPTXOOX_AUDIO_INCLUDE_H_
#include "Media.h" #include "Media.h"
...@@ -67,4 +67,4 @@ namespace PPTX ...@@ -67,4 +67,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_AUDIO_INCLUDE_H_ #endif // PPTXOOX_AUDIO_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_IMAGE_INCLUDE_H_ #ifndef PPTXOOX_IMAGE_INCLUDE_H_
#define OOX_IMAGE_INCLUDE_H_ #define PPTXOOX_IMAGE_INCLUDE_H_
#include "Media.h" #include "Media.h"
...@@ -96,4 +96,4 @@ namespace PPTX ...@@ -96,4 +96,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_IMAGE_INCLUDE_H_ #endif // PPTXOOX_IMAGE_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_MEDIA_INCLUDE_H_ #ifndef PPTXOOX_MEDIA_INCLUDE_H_
#define OOX_MEDIA_INCLUDE_H_ #define PPTXOOX_MEDIA_INCLUDE_H_
#include "../File.h" #include "../File.h"
#include "../FileTypes.h" #include "../FileTypes.h"
...@@ -100,4 +100,4 @@ namespace PPTX ...@@ -100,4 +100,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_MEDIA_INCLUDE_H_ #endif // PPTXOOX_MEDIA_INCLUDE_H_
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_OLE_OBJECT_INCLUDE_H_ #ifndef PPTXOOX_OLE_OBJECT_INCLUDE_H_
#define OOX_OLE_OBJECT_INCLUDE_H_ #define PPTXOOX_OLE_OBJECT_INCLUDE_H_
#include "Media.h" #include "Media.h"
...@@ -81,4 +81,4 @@ namespace PPTX ...@@ -81,4 +81,4 @@ namespace PPTX
}; };
} // namespace OOX } // namespace OOX
#endif // OOX_OLE_OBJECT_INCLUDE_H_ #endif // PPTXOOX_OLE_OBJECT_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_VIDEO_INCLUDE_H_ #ifndef PPTXOOX_VIDEO_INCLUDE_H_
#define OOX_VIDEO_INCLUDE_H_ #define PPTXOOX_VIDEO_INCLUDE_H_
#include "Media.h" #include "Media.h"
...@@ -68,4 +68,4 @@ namespace PPTX ...@@ -68,4 +68,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_VIDEO_INCLUDE_H_ #endif // PPTXOOX_VIDEO_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_NAMESPACE_OWN_INCLUDE_H_ #ifndef PPTXOOX_NAMESPACE_OWN_INCLUDE_H_
#define OOX_NAMESPACE_OWN_INCLUDE_H_ #define PPTXOOX_NAMESPACE_OWN_INCLUDE_H_
#include "Namespaces.h" #include "Namespaces.h"
...@@ -47,4 +47,4 @@ namespace PPTX ...@@ -47,4 +47,4 @@ namespace PPTX
static Namespaces g_Namespaces; static Namespaces g_Namespaces;
} // namespace PPTX } // namespace PPTX
#endif // OOX_NAMESPACE_OWN_INCLUDE_H_ #endif // PPTXOOX_NAMESPACE_OWN_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_NAMESPACES_INCLUDE_H_ #ifndef PPTXOOX_NAMESPACES_INCLUDE_H_
#define OOX_NAMESPACES_INCLUDE_H_ #define PPTXOOX_NAMESPACES_INCLUDE_H_
#include "../../../Common/DocxFormat/Source/Base/Base.h" #include "../../../Common/DocxFormat/Source/Base/Base.h"
#if defined(_WIN32) || defined (_WIN64) #if defined(_WIN32) || defined (_WIN64)
...@@ -135,4 +135,4 @@ namespace PPTX ...@@ -135,4 +135,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_NAMESPACES_INCLUDE_H_ #endif // PPTXOOX_NAMESPACES_INCLUDE_H_
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_RID_INCLUDE_H_ #ifndef PPTXOOX_RID_INCLUDE_H_
#define OOX_RID_INCLUDE_H_ #define PPTXOOX_RID_INCLUDE_H_
#include "../../../Common/DocxFormat/Source/Base/Base.h" #include "../../../Common/DocxFormat/Source/Base/Base.h"
#include "../../../Common/DocxFormat/Source/XML/xmlutils.h" #include "../../../Common/DocxFormat/Source/XML/xmlutils.h"
...@@ -133,4 +133,4 @@ namespace PPTX ...@@ -133,4 +133,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_RID_INCLUDE_H_ #endif // PPTXOOX_RID_INCLUDE_H_
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_RELS_FILE_INCLUDE_H_ #ifndef PPTXOOX_RELS_FILE_INCLUDE_H_
#define OOX_RELS_FILE_INCLUDE_H_ #define PPTXOOX_RELS_FILE_INCLUDE_H_
#include "RelationTable.h" #include "RelationTable.h"
#include "./../FileType.h" #include "./../FileType.h"
...@@ -157,4 +157,4 @@ namespace PPTX ...@@ -157,4 +157,4 @@ namespace PPTX
} // namespace Rels } // namespace Rels
} // namespace PPTX } // namespace PPTX
#endif // OOX_RELS_FILE_INCLUDE_H_ #endif // PPTXOOX_RELS_FILE_INCLUDE_H_
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_RELS_RELATION_SHIP_INCLUDE_H_ #ifndef PPTXOOX_RELS_RELATION_SHIP_INCLUDE_H_
#define OOX_RELS_RELATION_SHIP_INCLUDE_H_ #define PPTXOOX_RELS_RELATION_SHIP_INCLUDE_H_
#include "./../WritingElement.h" #include "./../WritingElement.h"
#include "./../RId.h" #include "./../RId.h"
...@@ -124,4 +124,4 @@ namespace PPTX ...@@ -124,4 +124,4 @@ namespace PPTX
} // namespace Rels } // namespace Rels
} // namespace PPTX } // namespace PPTX
#endif // OOX_RELS_RELATION_SHIP_INCLUDE_H_ #endif // PPTXOOX_RELS_RELATION_SHIP_INCLUDE_H_
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_RELS_RELATION_TABLE_INCLUDE_H_ #ifndef PPTXOOX_RELS_RELATION_TABLE_INCLUDE_H_
#define OOX_RELS_RELATION_TABLE_INCLUDE_H_ #define PPTXOOX_RELS_RELATION_TABLE_INCLUDE_H_
#include "./../WritingVector.h" #include "./../WritingVector.h"
#include "RelationShip.h" #include "RelationShip.h"
...@@ -75,4 +75,4 @@ namespace PPTX ...@@ -75,4 +75,4 @@ namespace PPTX
} // namespace Rels } // namespace Rels
} // namespace PPTX } // namespace PPTX
#endif // OOX_RELS_RELATION_TABLE_INCLUDE_H_ #endif // PPTXOOX_RELS_RELATION_TABLE_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_UNKNOW_TYPE_FILE_INCLUDE_H_ #ifndef PPTXOOX_UNKNOW_TYPE_FILE_INCLUDE_H_
#define OOX_UNKNOW_TYPE_FILE_INCLUDE_H_ #define PPTXOOX_UNKNOW_TYPE_FILE_INCLUDE_H_
#include "File.h" #include "File.h"
#include "FileTypes.h" #include "FileTypes.h"
...@@ -73,4 +73,4 @@ namespace PPTX ...@@ -73,4 +73,4 @@ namespace PPTX
}; };
} // namespace OOX } // namespace OOX
#endif // OOX_UNKNOW_TYPE_FILE_INCLUDE_H_ #endif // PPTXOOX_UNKNOW_TYPE_FILE_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -40,33 +40,6 @@ ...@@ -40,33 +40,6 @@
namespace PPTX namespace PPTX
{ {
#define WritingElement_AdditionConstructors(Class) \
Class(XmlUtils::CXmlNode& oNode)\
{\
fromXML( oNode );\
}\
const Class& operator =(const XmlUtils::CXmlNode &oNode)\
{\
fromXML( (XmlUtils::CXmlNode &)oNode );\
return *this;\
}
#define WritingElement_ReadNode( oRootNode, oChildNode, sNodeName, oValue ) \
if ( oRootNode.GetNode( sNodeName, oChildNode ) )\
oValue = oChildNode;
#define WritingElement_WriteNode_1( sStartNodeString, oValue ) \
if ( oValue.IsInit() )\
{\
sResult += sStartNodeString;\
sResult += oValue->ToString();\
sResult += _T("/>");\
}
#define WritingElement_WriteNode_2( oValue ) \
if ( oValue.IsInit() )\
sResult += oValue->toXML();
enum EElementType enum EElementType
{ {
et_Unknown, et_Unknown,
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* *
*/ */
#pragma once #pragma once
#ifndef OOX_WRITING_VECTOR_INCLUDE_H_ #ifndef PPTXOOX_WRITING_VECTOR_INCLUDE_H_
#define OOX_WRITING_VECTOR_INCLUDE_H_ #define PPTXOOX_WRITING_VECTOR_INCLUDE_H_
#include "WritingElement.h" #include "WritingElement.h"
...@@ -94,4 +94,4 @@ namespace PPTX ...@@ -94,4 +94,4 @@ namespace PPTX
}; };
} // namespace PPTX } // namespace PPTX
#endif // OOX_WRITING_VECTOR_INCLUDE_H_ #endif // PPTXOOX_WRITING_VECTOR_INCLUDE_H_
\ No newline at end of file \ No newline at end of file
...@@ -4724,8 +4724,8 @@ namespace SimpleTypes ...@@ -4724,8 +4724,8 @@ namespace SimpleTypes
enum ERestartNumber enum ERestartNumber
{ {
restartnumberContinious = 0, restartnumberContinious = 0,
restartnumberEachPage = 1, restartnumberEachSect = 1,
restartnumberEachSect = 2 restartnumberEachPage = 2
}; };
template<ERestartNumber eDefValue = restartnumberContinious> template<ERestartNumber eDefValue = restartnumberContinious>
......
...@@ -72,25 +72,33 @@ namespace OOX ...@@ -72,25 +72,33 @@ namespace OOX
CPath oRootPath; CPath oRootPath;
read(oRootPath, oPath); read(oRootPath, oPath);
} }
virtual void read(const CPath& oRootPath, const CPath& oPath) virtual void read(const CPath& oRootPath, const CPath& oFilePath)
{ {
IFileContainer::Read( oRootPath, oPath ); m_oReadPath = oFilePath;
IFileContainer::Read( oRootPath, oFilePath );
XmlUtils::CXmlNode oEndnotes; Common::readAllShapeTypes(oFilePath, m_arrShapeTypes);
oEndnotes.FromXmlFile( oPath.GetPath(), true );
if ( _T("w:endnotes") == oEndnotes.GetName() ) XmlUtils::CXmlLiteReader oReader;
{
XmlUtils::CXmlNodes oEndnoteList; if ( !oReader.FromFile( oFilePath.GetPath() ) )
oEndnotes.GetNodes( _T("w:endnote"), oEndnoteList ); return;
for ( int nIndex = 0; nIndex < oEndnoteList.GetCount(); nIndex++ ) if ( !oReader.ReadNextNode() )
return;
CWCharWrapper sName = oReader.GetName();
if ( _T("w:endnotes") == sName && !oReader.IsEmptyNode() )
{ {
XmlUtils::CXmlNode oEndnoteNode; int nNumberingDepth = oReader.GetDepth();
if ( oEndnoteList.GetAt( nIndex, oEndnoteNode ) ) while ( oReader.ReadNextSiblingNode( nNumberingDepth ) )
{ {
CFtnEdn *pEndnote = new CFtnEdn( oEndnoteNode ); sName = oReader.GetName();
m_arrEndnote.push_back( pEndnote ); if ( _T("w:endnote") == sName )
{
CFtnEdn *pEndnote = new CFtnEdn( oReader );
if (pEndnote) m_arrEndnote.push_back( pEndnote );
} }
} }
} }
...@@ -150,8 +158,9 @@ namespace OOX ...@@ -150,8 +158,9 @@ namespace OOX
} }
public: public:
CPath m_oReadPath;
std::vector<OOX::CFtnEdn*> m_arrEndnote; std::vector<OOX::CFtnEdn*> m_arrEndnote;
std::vector<CString> m_arrShapeTypes;
}; };
} // namespace OOX } // namespace OOX
#endif // OOX_ENDNOTE_INCLUDE_H_ #endif // OOX_ENDNOTE_INCLUDE_H_
...@@ -72,25 +72,33 @@ namespace OOX ...@@ -72,25 +72,33 @@ namespace OOX
CPath oRootPath; CPath oRootPath;
read(oRootPath, oPath); read(oRootPath, oPath);
} }
virtual void read(const CPath& oRootPath, const CPath& oPath) virtual void read(const CPath& oRootPath, const CPath& oFilePath)
{ {
IFileContainer::Read( oRootPath, oPath ); m_oReadPath = oFilePath;
IFileContainer::Read( oRootPath, oFilePath );
XmlUtils::CXmlNode oFootnotes; Common::readAllShapeTypes(oFilePath, m_arrShapeTypes);
oFootnotes.FromXmlFile( oPath.GetPath(), true );
if ( _T("w:footnotes") == oFootnotes.GetName() ) XmlUtils::CXmlLiteReader oReader;
{
XmlUtils::CXmlNodes oFootnoteList; if ( !oReader.FromFile( oFilePath.GetPath() ) )
oFootnotes.GetNodes( _T("w:footnote"), oFootnoteList ); return;
if ( !oReader.ReadNextNode() )
return;
for ( int nIndex = 0; nIndex < oFootnoteList.GetCount(); nIndex++ ) CWCharWrapper sName = oReader.GetName();
if ( _T("w:footnotes") == sName && !oReader.IsEmptyNode() )
{ {
XmlUtils::CXmlNode oFootnoteNode; int nNumberingDepth = oReader.GetDepth();
if ( oFootnoteList.GetAt( nIndex, oFootnoteNode ) ) while ( oReader.ReadNextSiblingNode( nNumberingDepth ) )
{ {
CFtnEdn *pFootnote = new CFtnEdn( oFootnoteNode ); sName = oReader.GetName();
if ( _T("w:footnote") == sName )
{
CFtnEdn *pFootnote = new CFtnEdn( oReader );
if (pFootnote) m_arrFootnote.push_back( pFootnote ); if (pFootnote) m_arrFootnote.push_back( pFootnote );
} }
} }
} }
...@@ -150,8 +158,9 @@ namespace OOX ...@@ -150,8 +158,9 @@ namespace OOX
} }
public: public:
CPath m_oReadPath;
std::vector<OOX::CFtnEdn*> m_arrFootnote; std::vector<OOX::CFtnEdn*> m_arrFootnote;
std::vector<CString> m_arrShapeTypes;
}; };
} // namespace OOX } // namespace OOX
......
...@@ -60,27 +60,15 @@ namespace OOX ...@@ -60,27 +60,15 @@ namespace OOX
class CFtnEdn : public WritingElementWithChilds<> class CFtnEdn : public WritingElementWithChilds<>
{ {
public: public:
WritingElement_AdditionConstructors(CFtnEdn)
CFtnEdn() CFtnEdn()
{ {
m_eType = et_Unknown; m_eType = et_Unknown;
} }
CFtnEdn(const XmlUtils::CXmlNode& oNode)
{
m_eType = et_Unknown;
fromXML( (XmlUtils::CXmlNode&)oNode );
}
virtual ~CFtnEdn() virtual ~CFtnEdn()
{ {
} }
public: public:
const CFtnEdn& operator =(const XmlUtils::CXmlNode& oNode)
{
ClearItems();
fromXML( (XmlUtils::CXmlNode&)oNode );
return *this;
}
virtual void ClearItems() virtual void ClearItems()
{ {
m_eType = et_Unknown; m_eType = et_Unknown;
...@@ -183,6 +171,100 @@ namespace OOX ...@@ -183,6 +171,100 @@ namespace OOX
} }
} }
} }
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
CWCharWrapper sName = oReader.GetName();
if ( _T("w:footnote") == sName )
m_eType = et_w_footnote;
else if ( _T("w:endnote") == sName )
m_eType = et_w_endnote;
else
return;
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
sName = oReader.GetName();
WritingElement *pItem = NULL;
/*if ( _T("w:altChunk") == sName )
pItem = new Logic::CAltChunk( oReader );
else */if ( _T("w:bookmarkEnd") == sName )
pItem = new Logic::CBookmarkEnd( oReader );
else if ( _T("w:bookmarkStart") == sName )
pItem = new Logic::CBookmarkStart( oReader );
else if ( _T("w:commentRangeEnd") == sName )
pItem = new Logic::CCommentRangeEnd( oReader );
else if ( _T("w:commentRangeStart") == sName )
pItem = new Logic::CCommentRangeStart( oReader );
//else if ( _T("w:customXml") == sName )
// pItem = new Logic::CCustomXml( oReader );
else if ( _T("w:customXmlDelRangeEnd") == sName )
pItem = new Logic::CCustomXmlDelRangeEnd( oReader );
else if ( _T("w:customXmlDelRangeStart") == sName )
pItem = new Logic::CCustomXmlDelRangeStart( oReader );
else if ( _T("w:customXmlInsRangeEnd") == sName )
pItem = new Logic::CCustomXmlInsRangeEnd( oReader );
else if ( _T("w:customXmlInsRangeStart") == sName )
pItem = new Logic::CCustomXmlInsRangeStart( oReader );
else if ( _T("w:customXmlMoveFromRangeEnd") == sName )
pItem = new Logic::CCustomXmlMoveFromRangeEnd( oReader );
else if ( _T("w:customXmlMoveFromRangeStart") == sName )
pItem = new Logic::CCustomXmlMoveFromRangeStart( oReader );
else if ( _T("w:customXmlMoveToRangeEnd") == sName )
pItem = new Logic::CCustomXmlMoveToRangeEnd( oReader );
else if ( _T("w:customXmlMoveToRangeStart") == sName )
pItem = new Logic::CCustomXmlMoveToRangeStart( oReader );
else if ( _T("w:del") == sName )
pItem = new Logic::CDel( oReader );
else if ( _T("w:ins") == sName )
pItem = new Logic::CIns( oReader );
//else if ( _T("w:moveFrom") == sName )
// pItem = new Logic::CMoveFrom( oReader );
else if ( _T("w:moveFromRangeEnd") == sName )
pItem = new Logic::CMoveToRangeEnd( oReader );
else if ( _T("w:moveFromRangeStart") == sName )
pItem = new Logic::CMoveToRangeStart( oReader );
//else if ( _T("w:moveTo") == sName )
// pItem = new Logic::CMoveTo( oReader );
else if ( _T("w:moveToRangeEnd") == sName )
pItem = new Logic::CMoveToRangeEnd( oReader );
else if ( _T("w:moveToRangeStart") == sName )
pItem = new Logic::CMoveToRangeStart( oReader );
else if ( _T("m:oMath") == sName )
pItem = new Logic::COMath( oReader );
else if ( _T("m:oMathPara") == sName )
pItem = new Logic::COMathPara( oReader );
else if ( _T("w:p") == sName )
pItem = new Logic::CParagraph( oReader );
else if ( _T("w:permEnd") == sName )
pItem = new Logic::CPermEnd( oReader );
else if ( _T("w:permStart") == sName )
pItem = new Logic::CPermStart( oReader );
else if ( _T("w:proofErr") == sName )
pItem = new Logic::CProofErr( oReader );
else if ( _T("w:sdt") == sName )
pItem = new Logic::CSdt( oReader );
else if ( _T("w:tbl") == sName )
pItem = new Logic::CTbl( oReader );
if ( pItem )
m_arrItems.push_back( pItem );
}
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if( oReader, _T("w:id"), m_oId )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("w:type"), m_oType )
WritingElement_ReadAttributes_End( oReader )
}
virtual CString toXML() const virtual CString toXML() const
{ {
CString sResult; CString sResult;
......
...@@ -1234,7 +1234,12 @@ namespace OOX ...@@ -1234,7 +1234,12 @@ namespace OOX
{ {
CString sResult = _T("<w:endnoteReference "); CString sResult = _T("<w:endnoteReference ");
ComplexTypes_WriteAttribute( _T("w:customMarkFollows=\""), m_oCustomMarkFollows ); if ( m_oCustomMarkFollows.IsInit() )
{
sResult += _T("w:customMarkFollows=\"");
sResult += m_oCustomMarkFollows->ToString2(SimpleTypes::onofftostring1);
sResult += _T("\" ");
}
ComplexTypes_WriteAttribute( _T("w:id=\""), m_oId ); ComplexTypes_WriteAttribute( _T("w:id=\""), m_oId );
sResult += _T("/>"); sResult += _T("/>");
...@@ -1343,7 +1348,12 @@ namespace OOX ...@@ -1343,7 +1348,12 @@ namespace OOX
{ {
CString sResult = _T("<w:footnoteReference "); CString sResult = _T("<w:footnoteReference ");
ComplexTypes_WriteAttribute( _T("w:customMarkFollows=\""), m_oCustomMarkFollows ); if ( m_oCustomMarkFollows.IsInit() )
{
sResult += _T("w:customMarkFollows=\"");
sResult += m_oCustomMarkFollows->ToString2(SimpleTypes::onofftostring1);
sResult += _T("\" ");
}
ComplexTypes_WriteAttribute( _T("w:id=\""), m_oId ); ComplexTypes_WriteAttribute( _T("w:id=\""), m_oId );
sResult += _T("/>"); sResult += _T("/>");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment