From 2d3040aba2a0fbd2abb9b5fac6069ca8160c69b5 Mon Sep 17 00:00:00 2001 From: ElenaSubbotina Date: Thu, 19 Jan 2017 11:26:33 +0300 Subject: [PATCH] x2t - pptx format(refactoring common docxFormat), bug 33782(prepare) --- .../DocFormatTest/DocFormatTest.cpp | 6 +- .../source/Oox2OdfConverter/DocxConverter.cpp | 30 +- .../ASCOfficeDrawingConverter.cpp | 139 +++---- .../ASCOfficePPTXFileRealization.cpp | 4 +- ASCOfficePPTXFile/Editor/Converter.h | 12 +- ASCOfficePPTXFile/PPTXFormat/App.h | 8 +- ASCOfficePPTXFile/PPTXFormat/CommentAuthors.h | 6 +- ASCOfficePPTXFile/PPTXFormat/Comments.h | 6 +- ASCOfficePPTXFile/PPTXFormat/Core.h | 8 +- .../DocxFormat/ContentTypes/Default.h | 98 ----- .../DocxFormat/ContentTypes/DefaultTable.h | 94 ----- .../DocxFormat/ContentTypes/ExtensionTable.h | 93 ----- .../PPTXFormat/DocxFormat/ContentTypes/File.h | 104 ----- .../DocxFormat/ContentTypes/Override.h | 101 ----- .../DocxFormat/ContentTypes/OverrideTable.h | 77 ---- .../DocxFormat/Drawing/LegacyDiagramText.h | 10 +- .../DocxFormat/Drawing/VmlDrawing.h | 14 +- .../PPTXFormat/DocxFormat/External/External.h | 76 ---- .../DocxFormat/External/ExternalAudio.h | 71 ---- .../DocxFormat/External/ExternalImage.h | 71 ---- .../DocxFormat/External/ExternalVideo.h | 71 ---- .../DocxFormat/External/HyperLink.h | 71 ---- .../PPTXFormat/DocxFormat/File.h | 61 --- .../PPTXFormat/DocxFormat/FileType.h | 115 ------ .../PPTXFormat/DocxFormat/FileTypes.h | 63 +-- .../PPTXFormat/DocxFormat/IFileContainer.cpp | 365 ------------------ .../PPTXFormat/DocxFormat/IFileContainer.h | 129 ------- .../PPTXFormat/DocxFormat/Media/Audio.h | 70 ---- .../PPTXFormat/DocxFormat/Media/Image.h | 99 ----- .../PPTXFormat/DocxFormat/Media/Media.h | 103 ----- .../PPTXFormat/DocxFormat/Media/OleObject.h | 84 ---- .../PPTXFormat/DocxFormat/Media/Video.h | 71 ---- ASCOfficePPTXFile/PPTXFormat/DocxFormat/RId.h | 137 ------- .../PPTXFormat/DocxFormat/Rels/File.h | 16 +- .../PPTXFormat/DocxFormat/Rels/RelationShip.h | 19 +- .../DocxFormat/Rels/RelationTable.h | 8 +- .../PPTXFormat/DocxFormat/UnknowTypeFile.h | 76 ---- .../PPTXFormat/FileContainer.cpp | 56 +-- ASCOfficePPTXFile/PPTXFormat/FileContainer.h | 12 +- ASCOfficePPTXFile/PPTXFormat/FileFactory.cpp | 174 +++++---- ASCOfficePPTXFile/PPTXFormat/FileFactory.h | 6 +- ASCOfficePPTXFile/PPTXFormat/FileMap.h | 10 +- ASCOfficePPTXFile/PPTXFormat/Folder.cpp | 45 +-- ASCOfficePPTXFile/PPTXFormat/Folder.h | 2 +- ASCOfficePPTXFile/PPTXFormat/HandoutMaster.h | 8 +- ASCOfficePPTXFile/PPTXFormat/Logic/Bg.cpp | 2 +- .../PPTXFormat/Logic/Colors/SchemeClr.cpp | 2 +- ASCOfficePPTXFile/PPTXFormat/Logic/Controls.h | 2 +- ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.cpp | 2 +- ASCOfficePPTXFile/PPTXFormat/Logic/ExtP.h | 4 +- .../PPTXFormat/Logic/Fills/Blip.cpp | 10 +- .../PPTXFormat/Logic/Fills/Blip.h | 10 +- .../PPTXFormat/Logic/Fills/BlipFill.h | 4 +- .../PPTXFormat/Logic/GraphicFrame.cpp | 2 +- .../PPTXFormat/Logic/GraphicFrame.h | 7 +- .../PPTXFormat/Logic/Hyperlink.cpp | 4 +- .../PPTXFormat/Logic/Hyperlink.h | 4 +- .../PPTXFormat/Logic/Media/MediaFile.h | 4 +- .../PPTXFormat/Logic/Media/WavAudioFile.h | 4 +- ASCOfficePPTXFile/PPTXFormat/Logic/Pic.cpp | 8 +- ASCOfficePPTXFile/PPTXFormat/Logic/Pic.h | 10 +- ASCOfficePPTXFile/PPTXFormat/Logic/Shape.cpp | 2 +- .../PPTXFormat/Logic/ShapeProperties.cpp | 2 +- .../PPTXFormat/Logic/ShapeTextProperties.cpp | 2 +- .../PPTXFormat/Logic/SmartArt.cpp | 168 ++++---- ASCOfficePPTXFile/PPTXFormat/Logic/SmartArt.h | 4 +- ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.cpp | 2 +- .../PPTXFormat/Logic/SpTreeElem.cpp | 2 +- .../PPTXFormat/Logic/Table/TableCell.cpp | 2 +- .../PPTXFormat/Logic/Timing/BuildNodeBase.cpp | 2 +- .../PPTXFormat/Logic/Timing/TgtEl.h | 4 +- .../PPTXFormat/Logic/Timing/TimeNodeBase.cpp | 2 +- .../PPTXFormat/Logic/Transitions/StSnd.h | 4 +- .../Logic/Transitions/TransitionBase.cpp | 2 +- .../PPTXFormat/Logic/UniColor.cpp | 2 +- .../PPTXFormat/Logic/UniEffect.cpp | 2 +- ASCOfficePPTXFile/PPTXFormat/Logic/UniFill.h | 4 +- ASCOfficePPTXFile/PPTXFormat/Logic/XmlId.h | 13 +- ASCOfficePPTXFile/PPTXFormat/NotesMaster.h | 12 +- ASCOfficePPTXFile/PPTXFormat/NotesSlide.h | 8 +- ASCOfficePPTXFile/PPTXFormat/PresProps.h | 8 +- ASCOfficePPTXFile/PPTXFormat/Presentation.h | 8 +- ASCOfficePPTXFile/PPTXFormat/Slide.h | 53 ++- ASCOfficePPTXFile/PPTXFormat/SlideLayout.h | 35 +- ASCOfficePPTXFile/PPTXFormat/SlideMaster.h | 35 +- ASCOfficePPTXFile/PPTXFormat/TableStyles.h | 8 +- ASCOfficePPTXFile/PPTXFormat/Theme.h | 26 +- ASCOfficePPTXFile/PPTXFormat/ViewProps.h | 8 +- ASCOfficePPTXFile/PPTXFormat/WrapperFile.h | 4 +- ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj | 80 ---- .../DocxFormatLib/DocxFormatLib.pro | 3 +- .../DocxFormat/Projects/DocxFormat2005.vcproj | 10 +- .../Source/DocxFormat/ContentTypes.h | 3 - .../DocxFormat/Diagram/DiagramDrawing.h | 256 ++++++------ .../Source/DocxFormat/Drawing/DrawingExt.cpp | 14 +- .../Source/DocxFormat/Drawing/DrawingExt.h | 53 +++ .../Source/DocxFormat/Drawing/DrawingShape.h | 4 +- .../Source/DocxFormat/FileFactory.cpp | 9 +- .../Source/DocxFormat/IFileContainer.h | 11 +- Common/DocxFormat/Source/DocxFormat/RId.h | 53 ++- Common/DocxFormat/Source/DocxFormat/Rels.h | 5 +- .../Source/DocxFormat/Settings/Settings.h | 6 +- .../Source/DocxFormat/WritingElement.h | 5 + 103 files changed, 780 insertions(+), 3134 deletions(-) delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/Default.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/DefaultTable.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/ExtensionTable.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/File.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/Override.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/OverrideTable.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/External.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/ExternalAudio.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/ExternalImage.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/ExternalVideo.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/HyperLink.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/File.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/FileType.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/IFileContainer.cpp delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/IFileContainer.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Audio.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Image.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Media.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/OleObject.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Video.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/RId.h delete mode 100644 ASCOfficePPTXFile/PPTXFormat/DocxFormat/UnknowTypeFile.h diff --git a/ASCOfficeDocFile/DocFormatTest/DocFormatTest.cpp b/ASCOfficeDocFile/DocFormatTest/DocFormatTest.cpp index 1ae28e5e31..ba5e1dd24f 100644 --- a/ASCOfficeDocFile/DocFormatTest/DocFormatTest.cpp +++ b/ASCOfficeDocFile/DocFormatTest/DocFormatTest.cpp @@ -37,7 +37,7 @@ #include "../../OfficeUtils/src/OfficeUtils.h" -#include "../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h" +#include "../../DesktopEditor/common/Directory.h" #include #include @@ -55,8 +55,8 @@ int _tmain(int argc, _TCHAR* argv[]) std::wstring sSrcDoc = argv[1]; std::wstring sDstDocx = argc > 2 ? argv[2] : sSrcDoc + L"-my.docx"; - std::wstring outputDir = FileSystem::Directory::GetFolderPath(sDstDocx); - std::wstring dstTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir); + std::wstring outputDir = NSDirectory::GetFolderPath(sDstDocx); + std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir); // doc->docx COfficeDocFile docFile; diff --git a/ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp b/ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp index a9b5d77aaa..228e8b97b5 100644 --- a/ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp +++ b/ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp @@ -36,6 +36,7 @@ #include "../../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h" #include "../../../Common/DocxFormat/Source/XlsxFormat/Chart/Chart.h" #include "../../../Common/DocxFormat/Source/DocxFormat/Diagram/DiagramDrawing.h" +#include "../../../Common/DocxFormat/Source/DocxFormat/Diagram/DiagramData.h" #include "VmlShapeTypes2Oox.h" @@ -2829,40 +2830,33 @@ void DocxConverter::convert(OOX::Drawing::CDiagrammParts *oox_diagramm) if (oox_diagramm == NULL)return; if (oox_diagramm->m_oRId_Data.IsInit() == false) return; - smart_ptr pDiagData; + smart_ptr oFile; if (oox_current_child_document) - pDiagData = docx_document->GetDocument()->GetImage(oox_diagramm->m_oRId_Data->GetValue()); + oFile = docx_document->GetDocument()->Find(oox_diagramm->m_oRId_Data->GetValue()); else - pDiagData = docx_document->GetDocument()->GetImage(oox_diagramm->m_oRId_Data->GetValue()); + oFile = docx_document->GetDocument()->Find(oox_diagramm->m_oRId_Data->GetValue()); - NSCommon::nullable id_drawing; + NSCommon::nullable id_drawing; - if (pDiagData.IsInit()) + if (oFile.IsInit()) { - std::wstring strDiagDataPath = pDiagData->filename().m_strFilename; + OOX::CDiagramData* pDiagData = (OOX::CDiagramData*)oFile.operator->(); - XmlUtils::CXmlNode oNodeDiagData; - if (oNodeDiagData.FromXmlFile(strDiagDataPath)) + if ((pDiagData) && (pDiagData->m_oExtLst.IsInit())) { - XmlUtils::CXmlNode oNode2 = oNodeDiagData.ReadNode(_T("dgm:extLst")); - if (oNode2.IsValid()) + for (int i = 0 ; i < pDiagData->m_oExtLst->m_arrExt.size(); i++) { - XmlUtils::CXmlNode oNode3 = oNode2.ReadNode(_T("a:ext")); - if (oNode3.IsValid()) + if ( pDiagData->m_oExtLst->m_arrExt[i]->m_oDataModelExt.IsInit()) { - XmlUtils::CXmlNode oNode4 = oNode3.ReadNode(_T("dsp:dataModelExt")); - if (oNode4.IsValid()) - { - oNode4.ReadAttributeBase(L"relId", id_drawing); - } + id_drawing = pDiagData->m_oExtLst->m_arrExt[i]->m_oDataModelExt->m_oRelId; } } } } if (id_drawing.is_init() == false) return; - smart_ptr oFile = docx_document->GetDocument()->Find( *id_drawing ); + oFile = docx_document->GetDocument()->Find( *id_drawing ); if (oFile.is_init() && OOX::FileTypes::DiagDrawing == oFile->type()) { diff --git a/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp b/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp index d2efb14cde..3a09db10bf 100644 --- a/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp +++ b/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp @@ -44,7 +44,6 @@ #include "./PPTXFormat/Logic/Colors/PrstClr.h" #include "./PPTXFormat/Logic/Colors/SchemeClr.h" #include "./PPTXFormat/Logic/Colors/SysClr.h" -#include "./PPTXFormat/DocxFormat/Media/Image.h" #include "./PPTXFormat/PPTX.h" #include "./PPTXFormat/DocxFormat/Drawing/LegacyDiagramText.h" @@ -52,7 +51,10 @@ #include "./Editor/Drawing/Shapes/BaseShape/PPTXShape/pptx2pptshapeconverter.h" #include "../DesktopEditor/common/Directory.h" + #include "../Common/DocxFormat/Source/Common/SimpleTypes_Base.h" +#include "../Common/DocxFormat/Source/DocxFormat/Diagram/DiagramData.h" +#include "../Common/DocxFormat/Source/DocxFormat/Media/Image.h" const double g_emu_koef = 25.4 * 36000 / 72.0; @@ -1078,90 +1080,89 @@ bool CDrawingConverter::ParceObject(const std::wstring& strXml, std::wstring** p if (L"dgm:relIds" == oNodeContent.GetName() && m_pBinaryWriter->m_pCommonRels->is_init()) { - nullable id_data; + nullable id_data; oNodeContent.ReadAttributeBase(L"r:dm", id_data); + nullable id_drawing; if (id_data.is_init()) { - smart_ptr pDiagData = (*m_pBinaryWriter->m_pCommonRels)->image(*id_data); + smart_ptr oFile = (*m_pBinaryWriter->m_pCommonRels)->Find(*id_data); - if (pDiagData.is_init()) + if (oFile.is_init()) { - std::wstring strDiagDataPath = pDiagData->filename().m_strFilename; - - XmlUtils::CXmlNode oNodeDiagData; - if (oNodeDiagData.FromXmlFile(strDiagDataPath)) + OOX::CDiagramData* pDiagramData = dynamic_cast(oFile.operator->()); + if ((pDiagramData) && (pDiagramData->m_oExtLst.IsInit())) { - nullable id_drawing; - - XmlUtils::CXmlNode oNode2 = oNodeDiagData.ReadNode(L"dgm:extLst"); - if (oNode2.IsValid()) + for (int i = 0; i < pDiagramData->m_oExtLst->m_arrExt.size(); i++) { - XmlUtils::CXmlNode oNode3 = oNode2.ReadNode(L"a:ext"); - if (oNode3.IsValid()) + if (pDiagramData->m_oExtLst->m_arrExt[i]->m_oDataModelExt.IsInit()) { - XmlUtils::CXmlNode oNode4 = oNode3.ReadNode(L"dsp:dataModelExt"); - if (oNode4.IsValid()) - { - oNode4.ReadAttributeBase(L"relId", id_drawing); - } + id_drawing = pDiagramData->m_oExtLst->m_arrExt[i]->m_oDataModelExt->m_oRelId; + break; } } + } - if (id_drawing.is_init()) + if (id_drawing.is_init()) + { + smart_ptr pDiagDW = (*m_pBinaryWriter->m_pCommonRels)->GetImage(OOX::RId(*id_drawing)); + + if (pDiagDW.is_init()) { - smart_ptr pDiagDW = (*m_pBinaryWriter->m_pCommonRels)->image(*id_drawing); + std::wstring strPathDiagDW = pDiagDW->filename().m_strFilename; - if (pDiagDW.is_init()) + XmlUtils::CXmlNode oNodeDW; + oNodeDW.FromXmlFile(strPathDiagDW); + + XmlUtils::CXmlNode oNodeS = oNodeDW.ReadNodeNoNS(L"spTree"); + oElem = oNodeS; + + if (oElem.is()) { - std::wstring strPathDiagDW = pDiagDW->filename().m_strFilename; - - XmlUtils::CXmlNode oNodeDW; - oNodeDW.FromXmlFile(strPathDiagDW); - - XmlUtils::CXmlNode oNodeS = oNodeDW.ReadNodeNoNS(L"spTree"); - oElem = oNodeS; - - if (oElem.is()) + PPTX::Logic::SpTree& _pElem = oElem.as(); + if (!_pElem.grpSpPr.xfrm.is_init()) { - PPTX::Logic::SpTree& _pElem = oElem.as(); - if (!_pElem.grpSpPr.xfrm.is_init()) - { - _pElem.grpSpPr.xfrm = new PPTX::Logic::Xfrm(); + _pElem.grpSpPr.xfrm = new PPTX::Logic::Xfrm(); - _pElem.grpSpPr.xfrm->offX = (int)0; - _pElem.grpSpPr.xfrm->offY = (int)0; - _pElem.grpSpPr.xfrm->extX = m_pBinaryWriter->m_lWidthCurShape; - _pElem.grpSpPr.xfrm->extY = m_pBinaryWriter->m_lHeightCurShape; - _pElem.grpSpPr.xfrm->chOffX = (int)0; - _pElem.grpSpPr.xfrm->chOffY = (int)0; - _pElem.grpSpPr.xfrm->chExtX = m_pBinaryWriter->m_lWidthCurShape; - _pElem.grpSpPr.xfrm->chExtY = m_pBinaryWriter->m_lHeightCurShape; - } - else - { - if (!_pElem.grpSpPr.xfrm->offX.is_init()) - _pElem.grpSpPr.xfrm->offX = (int)0; - if (!_pElem.grpSpPr.xfrm->offY.is_init()) - _pElem.grpSpPr.xfrm->offY = (int)0; - if (!_pElem.grpSpPr.xfrm->extX.is_init()) - _pElem.grpSpPr.xfrm->extX = m_pBinaryWriter->m_lWidthCurShape; - if (!_pElem.grpSpPr.xfrm->extY.is_init()) - _pElem.grpSpPr.xfrm->extY = m_pBinaryWriter->m_lHeightCurShape; - if (!_pElem.grpSpPr.xfrm->chOffX.is_init()) - _pElem.grpSpPr.xfrm->chOffX = (int)0; - if (!_pElem.grpSpPr.xfrm->chOffY.is_init()) - _pElem.grpSpPr.xfrm->chOffY = (int)0; - if (!_pElem.grpSpPr.xfrm->chExtX.is_init()) - _pElem.grpSpPr.xfrm->chExtX = m_pBinaryWriter->m_lWidthCurShape; - if (!_pElem.grpSpPr.xfrm->chExtY.is_init()) - _pElem.grpSpPr.xfrm->chExtY = m_pBinaryWriter->m_lHeightCurShape; - } + _pElem.grpSpPr.xfrm->offX = (int)0; + _pElem.grpSpPr.xfrm->offY = (int)0; + _pElem.grpSpPr.xfrm->extX = m_pBinaryWriter->m_lWidthCurShape; + _pElem.grpSpPr.xfrm->extY = m_pBinaryWriter->m_lHeightCurShape; + _pElem.grpSpPr.xfrm->chOffX = (int)0; + _pElem.grpSpPr.xfrm->chOffY = (int)0; + _pElem.grpSpPr.xfrm->chExtX = m_pBinaryWriter->m_lWidthCurShape; + _pElem.grpSpPr.xfrm->chExtY = m_pBinaryWriter->m_lHeightCurShape; + } + else + { + if (!_pElem.grpSpPr.xfrm->offX.is_init()) + _pElem.grpSpPr.xfrm->offX = (int)0; + if (!_pElem.grpSpPr.xfrm->offY.is_init()) + _pElem.grpSpPr.xfrm->offY = (int)0; + if (!_pElem.grpSpPr.xfrm->extX.is_init()) + _pElem.grpSpPr.xfrm->extX = m_pBinaryWriter->m_lWidthCurShape; + if (!_pElem.grpSpPr.xfrm->extY.is_init()) + _pElem.grpSpPr.xfrm->extY = m_pBinaryWriter->m_lHeightCurShape; + if (!_pElem.grpSpPr.xfrm->chOffX.is_init()) + _pElem.grpSpPr.xfrm->chOffX = (int)0; + if (!_pElem.grpSpPr.xfrm->chOffY.is_init()) + _pElem.grpSpPr.xfrm->chOffY = (int)0; + if (!_pElem.grpSpPr.xfrm->chExtX.is_init()) + _pElem.grpSpPr.xfrm->chExtX = m_pBinaryWriter->m_lWidthCurShape; + if (!_pElem.grpSpPr.xfrm->chExtY.is_init()) + _pElem.grpSpPr.xfrm->chExtY = m_pBinaryWriter->m_lHeightCurShape; } - - m_strCurrentRelsPath = strPathDiagDW; - SetCurrentRelsPath(); } + + m_strCurrentRelsPath = strPathDiagDW; + SetCurrentRelsPath(); + } + } + else + {//BG-FSC1.docx + + if (pDiagramData->m_oDgmPtLst.IsInit()) + { } } } @@ -2348,7 +2349,7 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo if (sId.length() > 0 && m_pBinaryWriter->m_pCommonRels->IsInit()) { - PPTX::RId rId(sId); + OOX::RId rId(sId); smart_ptr pExt = (*m_pBinaryWriter->m_pCommonRels)->legacyDiagramText(rId); if (pExt.IsInit()) @@ -3530,7 +3531,7 @@ void CDrawingConverter::CheckBrushShape(PPTX::Logic::SpTreeElem& oElem, XmlUtils PPTX::Logic::BlipFill* pBlipFill = new PPTX::Logic::BlipFill(); pBlipFill->m_namespace = L"a"; pBlipFill->blip = new PPTX::Logic::Blip(); - pBlipFill->blip->embed = new PPTX::RId(*sRid); + pBlipFill->blip->embed = new OOX::RId(*sRid); if (sType.is_init() && ((*sType == L"tile") || (*sType == L"pattern"))) { @@ -3670,7 +3671,7 @@ void CDrawingConverter::CheckBrushShape(PPTX::Logic::SpTreeElem& oElem, XmlUtils pBlipFill->blip = new PPTX::Logic::Blip(); std::wstring sId = sRid.IsInit() ? *sRid : (sRelid.IsInit() ? *sRelid : L""); - pBlipFill->blip->embed = new PPTX::RId(sId); + pBlipFill->blip->embed = new OOX::RId(sId); if (sType.is_init() && *sType == L"tile") { diff --git a/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp b/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp index 55402095df..214c284a29 100644 --- a/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp +++ b/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp @@ -123,7 +123,7 @@ HRESULT CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath RELEASEOBJECT(m_pFolder); return S_FALSE; } - smart_ptr presentation = m_pFolder->get(PPTX::FileTypes::Presentation).smart_dynamic_cast(); + smart_ptr presentation = m_pFolder->Get(OOX::Presentation::FileTypes::Presentation).smart_dynamic_cast(); if (!presentation.is_init()) { NSDirectory::DeleteDirectory(m_strTempDir, false); @@ -289,7 +289,7 @@ HRESULT CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutp RELEASEOBJECT(m_pFolder); return S_FALSE; } - smart_ptr presentation = m_pFolder->get(PPTX::FileTypes::Presentation).smart_dynamic_cast(); + smart_ptr presentation = m_pFolder->Get(OOX::Presentation::FileTypes::Presentation).smart_dynamic_cast(); if (!presentation.is_init()) { NSDirectory::DeleteDirectory(m_strTempDir, false); diff --git a/ASCOfficePPTXFile/Editor/Converter.h b/ASCOfficePPTXFile/Editor/Converter.h index 5948bafc3f..f9f1b55448 100644 --- a/ASCOfficePPTXFile/Editor/Converter.h +++ b/ASCOfficePPTXFile/Editor/Converter.h @@ -50,7 +50,7 @@ namespace PPTX2EditorAdvanced std::vector> _notes; std::vector> _notesMasters; - smart_ptr presentation = oFolder.get(PPTX::FileTypes::Presentation).smart_dynamic_cast(); + smart_ptr presentation = oFolder.Get(OOX::Presentation::FileTypes::Presentation).smart_dynamic_cast(); int cx = presentation->sldSz->cx; int cy = presentation->sldSz->cy; @@ -218,7 +218,7 @@ namespace PPTX2EditorAdvanced oBinaryWriter.WriteULONG(0); // App - smart_ptr app = oFolder.get(PPTX::FileTypes::App).smart_dynamic_cast(); + smart_ptr app = oFolder.Get(OOX::Presentation::FileTypes::App).smart_dynamic_cast(); if (app.is_init()) { oBinaryWriter.StartMainRecord(NSMainTables::App); @@ -226,7 +226,7 @@ namespace PPTX2EditorAdvanced } // Core - smart_ptr core = oFolder.get(PPTX::FileTypes::Core).smart_dynamic_cast(); + smart_ptr core = oFolder.Get(OOX::Presentation::FileTypes::Core).smart_dynamic_cast(); if (core.is_init()) { oBinaryWriter.StartMainRecord(NSMainTables::Core); @@ -234,7 +234,7 @@ namespace PPTX2EditorAdvanced } // PresProps - smart_ptr presProps = presentation->get(PPTX::FileTypes::PresProps).smart_dynamic_cast(); + smart_ptr presProps = presentation->Get(OOX::Presentation::FileTypes::PresProps).smart_dynamic_cast(); if (presProps.is_init()) { oBinaryWriter.StartMainRecord(NSMainTables::PresProps); @@ -242,7 +242,7 @@ namespace PPTX2EditorAdvanced } // ViewProps - smart_ptr viewProps = presentation->get(PPTX::FileTypes::ViewProps).smart_dynamic_cast(); + smart_ptr viewProps = presentation->Get(OOX::Presentation::FileTypes::ViewProps).smart_dynamic_cast(); if (viewProps.is_init()) { oBinaryWriter.StartMainRecord(NSMainTables::ViewProps); @@ -250,7 +250,7 @@ namespace PPTX2EditorAdvanced } // TableStyles - smart_ptr tablestyles = presentation->get(PPTX::FileTypes::TableStyles).smart_dynamic_cast(); + smart_ptr tablestyles = presentation->Get(OOX::Presentation::FileTypes::TableStyles).smart_dynamic_cast(); if (tablestyles.is_init()) { oBinaryWriter.StartMainRecord(NSMainTables::TableStyles); diff --git a/ASCOfficePPTXFile/PPTXFormat/App.h b/ASCOfficePPTXFile/PPTXFormat/App.h index f52a5177be..afa2a0758f 100644 --- a/ASCOfficePPTXFile/PPTXFormat/App.h +++ b/ASCOfficePPTXFile/PPTXFormat/App.h @@ -111,7 +111,7 @@ namespace PPTX Normalize(); } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { XmlUtils::CAttribute oAttr; oAttr.Write(_T("xmlns"), PPTX::g_Namespaces.xmlns.m_strLink); @@ -168,16 +168,16 @@ namespace PPTX //DigSig (Digital Signature) //HLinks - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName.m_strFilename = filename.GetFilename(); } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::App; + return OOX::Presentation::FileTypes::App; } virtual const OOX::CPath DefaultDirectory() const { diff --git a/ASCOfficePPTXFile/PPTXFormat/CommentAuthors.h b/ASCOfficePPTXFile/PPTXFormat/CommentAuthors.h index 53ea0cff80..c8c0c67ddd 100644 --- a/ASCOfficePPTXFile/PPTXFormat/CommentAuthors.h +++ b/ASCOfficePPTXFile/PPTXFormat/CommentAuthors.h @@ -173,14 +173,14 @@ namespace PPTX m_arAuthors.back().fromXML(oCm); } } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::CommentAuthors; + return OOX::Presentation::FileTypes::CommentAuthors; } virtual const OOX::CPath DefaultDirectory() const { diff --git a/ASCOfficePPTXFile/PPTXFormat/Comments.h b/ASCOfficePPTXFile/PPTXFormat/Comments.h index 49b3be0fab..5b43f9ab9f 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Comments.h +++ b/ASCOfficePPTXFile/PPTXFormat/Comments.h @@ -310,14 +310,14 @@ namespace PPTX m_arComments.back().fromXML(oCm); } } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::SlideComments; + return OOX::Presentation::FileTypes::SlideComments; } virtual const OOX::CPath DefaultDirectory() const { diff --git a/ASCOfficePPTXFile/PPTXFormat/Core.h b/ASCOfficePPTXFile/PPTXFormat/Core.h index 108ef97c57..57a380694e 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Core.h +++ b/ASCOfficePPTXFile/PPTXFormat/Core.h @@ -84,7 +84,7 @@ namespace PPTX version = document.Root.element("version").text(); */ } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { XmlUtils::CAttribute oAttr; oAttr.Write(_T("xmlns:dc"), PPTX::g_Namespaces.dc.m_strLink); @@ -138,15 +138,15 @@ namespace PPTX if(version.is_init()) root.push_back(XML::XElement("version", XML::XText(version))); */ - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName = filename.GetFilename(); } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::Core; + return OOX::Presentation::FileTypes::Core; } virtual const OOX::CPath DefaultDirectory() const { diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/Default.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/Default.h deleted file mode 100644 index 59da6eecb1..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/Default.h +++ /dev/null @@ -1,98 +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 PPTXOOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_ -#define PPTXOOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_ - -#include "./../WritingElement.h" -#include "ExtensionTable.h" - -namespace PPTX -{ - namespace ContentTypes - { - class Default : public WritingElement - { - public: - Default() - { - m_extension = _T(""); - } - Default(const std::wstring& extension) : m_extension(extension) - { - } - virtual ~Default() - { - } - explicit Default(XmlUtils::CXmlNode& node) - { - fromXML(node); - } - const Default& operator =(XmlUtils::CXmlNode& node) - { - fromXML(node); - return *this; - } - - public: - virtual void fromXML(XmlUtils::CXmlNode& node) - { - m_extension = node.GetAttribute(_T("Extension")); - } - virtual std::wstring toXML() const - { - static const ExtensionTable table; - - XmlUtils::CAttribute oAttr; - oAttr.Write(_T("Extension"), m_extension); - oAttr.Write(_T("ContentType"), table[m_extension]); - - return XmlUtils::CreateNode(_T("Default"), oAttr); - } - virtual EElementType getType() const - { - return et_Default; - } - - public: - const bool operator ==(const std::wstring& rhs) const - { - return m_extension == rhs; - } - - private: - std::wstring m_extension; - }; - } // namespace ContentTypes -} // namespace PPTX - -#endif // PPTXOOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/DefaultTable.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/DefaultTable.h deleted file mode 100644 index 828e2a9e28..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/DefaultTable.h +++ /dev/null @@ -1,94 +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 PPTXOOX_CONTENT_TYPES_DEFAULT_TABLE_INCLUDE_H_ -#define PPTXOOX_CONTENT_TYPES_DEFAULT_TABLE_INCLUDE_H_ - -#include "./../WritingVector.h" -#include "Default.h" - - -namespace PPTX -{ - namespace ContentTypes - { - class DefaultTable : public WritingVector - { - public: - DefaultTable() - { - m_items.push_back(Default(_T("rels"))); - m_items.push_back(Default(_T("xml"))); - } - virtual ~DefaultTable() - { - } - explicit DefaultTable(XmlUtils::CXmlNode& node) - { - fromXML(node); - } - const DefaultTable& operator =(XmlUtils::CXmlNode& node) - { - fromXML(node); - return *this; - } - - public: - virtual void fromXML(XmlUtils::CXmlNode& node) - { - node.LoadArray(_T("Default"), m_items); - } - - public: - void add(const OOX::CPath& path) - { - std::wstring ext = path.GetExtention(); - const std::wstring extension = ext.substr(1); - - size_t nCount = m_items.size(); - size_t nIndex = 0; - - while (nIndex < nCount) - { - if (m_items[nIndex] == extension) - break; - ++nIndex; - } - - if (nIndex == nCount) - m_items.push_back(Default(extension)); - } - }; - } // namespace ContentTypes -} // namespace PPTX - -#endif // PPTXOOX_CONTENT)TYPES_DEFAULT_TABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/ExtensionTable.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/ExtensionTable.h deleted file mode 100644 index 5f772cf31c..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/ExtensionTable.h +++ /dev/null @@ -1,93 +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 PPTXOOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_ -#define PPTXOOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_ - -#include "../../../../Common/DocxFormat/Source/Base/Base.h" -#include - -namespace PPTX -{ - namespace ContentTypes - { - class ExtensionTable - { - public: - ExtensionTable() - { - m_table.insert( std::pair( _T("gif"), _T("image/gif"))); - m_table.insert( std::pair( _T("png"), _T("image/png"))); - m_table.insert( std::pair( _T("tif"), _T("image/tiff"))); - m_table.insert( std::pair( _T("tiff"), _T("image/tiff"))); - m_table.insert( std::pair( _T("jpeg"), _T("image/jpeg"))); - m_table.insert( std::pair( _T("jpg"), _T("image/jpeg"))); - m_table.insert( std::pair( _T("jpe"), _T("image/jpeg"))); - m_table.insert( std::pair( _T("jfif"), _T("image/jpeg"))); - m_table.insert( std::pair( _T("rels"), _T("application/vnd.openxmlformats-package.relationships+xml"))); - m_table.insert( std::pair( _T("bin"), _T("application/vnd.openxmlformats-officedocument.oleObject"))); - m_table.insert( std::pair( _T("xml"), _T("application/xml"))); - m_table.insert( std::pair( _T("emf"), _T("image/x-emf"))); - m_table.insert( std::pair( _T("emz"), _T("image/x-emz"))); - m_table.insert( std::pair( _T("wmf"), _T("image/x-wmf"))); - m_table.insert( std::pair( _T("svm"), _T("image/svm"))); - m_table.insert( std::pair( _T("wav"), _T("audio/wav"))); - m_table.insert( std::pair( _T("xls"), _T("application/vnd.ms-excel"))); - m_table.insert( std::pair( _T("xlsm"), _T("application/vnd.ms-excel.sheet.macroEnabled.12"))); - m_table.insert( std::pair( _T("xlsb"), _T("application/vnd.ms-excel.sheet.binary.macroEnabled.12"))); - m_table.insert( std::pair( _T("xlsx"), _T("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"))); - m_table.insert( std::pair( _T("ppt"), _T("application/vnd.ms-powerpoint"))); - m_table.insert( std::pair( _T("pptm"), _T("application/vnd.ms-powerpoint.presentation.macroEnabled.12"))); - m_table.insert( std::pair( _T("pptx"), _T("application/vnd.openxmlformats-officedocument.presentationml.presentation"))); - m_table.insert( std::pair( _T("sldm"), _T("application/vnd.ms-powerpoint.slide.macroEnabled.12"))); - m_table.insert( std::pair( _T("sldx"), _T("application/vnd.openxmlformats-officedocument.presentationml.slide"))); - m_table.insert( std::pair( _T("doc"), _T("application/msword"))); - m_table.insert( std::pair( _T("docm"), _T("aapplication/vnd.ms-word.document.macroEnabled.12"))); - m_table.insert( std::pair( _T("docx"), _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document"))); - m_table.insert( std::pair( _T("vml"), _T("application/vnd.openxmlformats-officedocument.vmlDrawing"))); - } - const std::wstring operator[] (const std::wstring& extension) const - { - std::map::const_iterator it = m_table.find(extension); - if (it == m_table.end()) - return _T(""); - - return it->second; - } - - private: - std::map m_table; - }; - } // namespace ContentTypes -} // namespace PPTX - -#endif // PPTXOOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_ diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/File.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/File.h deleted file mode 100644 index e5283ec55e..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/File.h +++ /dev/null @@ -1,104 +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 PPTXOOX_CONTENT_TYPES_FILE_INCLUDE_H_ -#define PPTXOOX_CONTENT_TYPES_FILE_INCLUDE_H_ - -#include "OverrideTable.h" -#include "DefaultTable.h" -#include "./../FileType.h" - - -namespace PPTX -{ - namespace ContentTypes - { - static const OOX::CPath s_filename (L"[Content_Types].xml"); - - class File - { - public: - File() - { - } - File(const OOX::CPath& path) - { - read(path); - } - virtual ~File() - { - } - - public: - virtual void read(const OOX::CPath& path) - { - OOX::CPath oPath = path / s_filename; - XmlUtils::CXmlNode oNode; - if (oNode.FromXmlFile(oPath.m_strFilename)) - { - Default = oNode; - Override = oNode; - } - } - virtual void write(const OOX::CPath& path) const - { - XmlUtils::CAttribute oAttr; - oAttr.Write(_T("xmlns"), _T("http://schemas.openxmlformats.org/package/2006/content-types")); - - XmlUtils::CNodeValue oValue; - oValue.Write(Default); - oValue.Write(Override); - - OOX::CPath savepath = path / s_filename; - - XmlUtils::SaveToFile(savepath.m_strFilename, XmlUtils::CreateNode(_T("Types"), oAttr, oValue)); - } - virtual const bool isValid() const - { - return true; - } - - public: - void registration(const std::wstring& type, const OOX::CPath& directory, const OOX::CPath& filename) - { - Override.add(type, directory / filename.m_strFilename); - Default.add(directory / filename.m_strFilename); - } - - public: - OverrideTable Override; - DefaultTable Default; - }; - } // namespace ContentTypes -} // namespace PPTX - -#endif // DOCX_CONTENT_TYPES_FILE_INCLUDE_H_ diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/Override.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/Override.h deleted file mode 100644 index 9e87b423c7..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/Override.h +++ /dev/null @@ -1,101 +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 PPTXOOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_ -#define PPTXOOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_ - -#include "./../WritingElement.h" -#include "../../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h" - -namespace PPTX -{ - namespace ContentTypes - { - class Override : public WritingElement - { - public: - Override() - { - } - Override(const std::wstring& type, const OOX::CPath& path) : m_type(type), m_part(path) - { - } - virtual ~Override() - { - } - explicit Override(XmlUtils::CXmlNode& node) - { - fromXML(node); - } - const Override& operator =(XmlUtils::CXmlNode& node) - { - fromXML(node); - return *this; - } - - public: - virtual void fromXML(XmlUtils::CXmlNode& node) - { - m_part = node.GetAttribute(_T("PartName")); - m_type = node.GetAttribute(_T("ContentType")); - } - virtual std::wstring toXML() const - { - XmlUtils::CAttribute oAttr; - oAttr.Write(_T("PartName"), _T("/") + m_part.m_strFilename); - oAttr.Write(_T("ContentType"), m_type); - - return XmlUtils::CreateNode(_T("Override"), oAttr); - } - virtual EElementType getType() const - { - return et_Override; - } - - public: - AVSINLINE const std::wstring type() const - { - return m_type; - } - AVSINLINE const OOX::CPath filename() const - { - return m_part; - } - - private: - std::wstring m_type; - OOX::CPath m_part; - }; - } // namespace ContentTypes -} // namespace PPTX - -#endif // PPTXOOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/OverrideTable.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/OverrideTable.h deleted file mode 100644 index 2e32a402e1..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/ContentTypes/OverrideTable.h +++ /dev/null @@ -1,77 +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 PPTXOOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_ -#define PPTXOOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_ - -#include "./../WritingVector.h" -#include "Override.h" - -namespace PPTX -{ - namespace ContentTypes - { - class OverrideTable : public WritingVector - { - public: - OverrideTable() - { - } - virtual ~OverrideTable() - { - } - explicit OverrideTable(XmlUtils::CXmlNode& node) - { - fromXML(node); - } - const OverrideTable& operator =(XmlUtils::CXmlNode& node) - { - fromXML(node); - return *this; - } - - public: - void fromXML(XmlUtils::CXmlNode& node) - { - node.LoadArray(_T("Override"), m_items); - } - - public: - void add(const std::wstring& type, const OOX::CPath& path) - { - m_items.push_back(Override(type, path)); - } - }; - } // namespace ContentTypes -} // namespace PPTX - -#endif // PPTXOOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Drawing/LegacyDiagramText.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Drawing/LegacyDiagramText.h index 59003eaffb..c3d45350a5 100644 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Drawing/LegacyDiagramText.h +++ b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Drawing/LegacyDiagramText.h @@ -43,7 +43,7 @@ namespace PPTX { - class LegacyDiagramText : public File + class LegacyDiagramText : public OOX::File //[MS-PPT] Section 2.9.1; DocumentTextInfoContainer { public: @@ -92,10 +92,10 @@ namespace PPTX // щас используется 'нулевой' вариант // незабыть поменять в doc_LoadShape (ASCOfficeDrawingConvert.cpp) } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { //старье на запись не поддерживаем - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); } LegacyDiagramText& operator=(const LegacyDiagramText& oSrc) @@ -104,9 +104,9 @@ namespace PPTX return *this; } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::LegacyDiagramText; + return OOX::Presentation::FileTypes::LegacyDiagramText; } virtual const OOX::CPath DefaultDirectory() const { diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Drawing/VmlDrawing.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Drawing/VmlDrawing.h index d57443f67d..7cdc74f579 100644 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Drawing/VmlDrawing.h +++ b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Drawing/VmlDrawing.h @@ -36,7 +36,7 @@ #include "../../WrapperFile.h" #include "../../FileContainer.h" -#include "../RId.h" +#include "../../../../Common/DocxFormat/Source/DocxFormat/RId.h" #include "../../../../Common/DocxFormat/Source/DocxFormat/Logic/Vml.h" namespace PPTX @@ -103,9 +103,9 @@ namespace PPTX } } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = false; //m_WrittenFileName = filename.GetFilename(); @@ -113,9 +113,9 @@ namespace PPTX } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::VmlDrawing; + return OOX::Presentation::FileTypes::VmlDrawing; } virtual const OOX::CPath DefaultDirectory() const { @@ -292,13 +292,13 @@ namespace PPTX } if (bReadyElement) { - if (sSpid.length() > 0) + if (!sSpid.empty()) { //m_mapShapes.insert(std::pair(sSpid, m_arrItems.size()-1)); m_mapShapesXml.insert(std::pair(sSpid,elementContent)); } - elementContent = _T(""); + elementContent.clear(); bReadyElement = false; } delete pItem; diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/External.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/External.h deleted file mode 100644 index c603227cd9..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/External.h +++ /dev/null @@ -1,76 +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 PPTXOOX_EXTERNAL_INCLUDE_H_ -#define PPTXOOX_EXTERNAL_INCLUDE_H_ - -#include "../File.h" -#include "../FileTypes.h" - - -namespace PPTX -{ - class External : public File - { - public: - External() - { - } - External(const OOX::CPath& uri) - { - read(uri); - } - ~External() - { - } - - public: - virtual void read(const OOX::CPath& uri) - { - m_uri = uri; - } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const - { - } - - public: - AVSINLINE OOX::CPath Uri() const - { - return m_uri; - } - - protected: - OOX::CPath m_uri; - }; -} // namespace PPTX - -#endif // PPTXOOX_EXTERNAL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/ExternalAudio.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/ExternalAudio.h deleted file mode 100644 index d727e1a498..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/ExternalAudio.h +++ /dev/null @@ -1,71 +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 PPTXOOX_EXTERNALAUDIO_INCLUDE_H_ -#define PPTXOOX_EXTERNALAUDIO_INCLUDE_H_ - -#include "External.h" - - -namespace PPTX -{ - class ExternalAudio : public External - { - public: - ExternalAudio() - { - } - ExternalAudio(const OOX::CPath& uri) - { - read(uri); - } - ~ExternalAudio() - { - } - - public: - virtual const FileType type() const - { - return FileTypes::ExternalAudio; - } - virtual const OOX::CPath DefaultDirectory() const - { - return type().DefaultDirectory(); - } - virtual const OOX::CPath DefaultFileName() const - { - return type().DefaultFileName(); - } - }; -} // namespace PPTX - -#endif // PPTXOOX_EXTERNALAUDIO_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/ExternalImage.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/ExternalImage.h deleted file mode 100644 index c2f3e1137a..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/ExternalImage.h +++ /dev/null @@ -1,71 +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 PPTXOOX_EXTERNALIMAGE_INCLUDE_H_ -#define PPTXOOX_EXTERNALIMAGE_INCLUDE_H_ - -#include "External.h" - - -namespace PPTX -{ - class ExternalImage : public External - { - public: - ExternalImage() - { - } - ExternalImage(const OOX::CPath& uri) - { - read(uri); - } - ~ExternalImage() - { - } - - public: - virtual const FileType type() const - { - return FileTypes::ExternalImage; - } - virtual const OOX::CPath DefaultDirectory() const - { - return type().DefaultDirectory(); - } - virtual const OOX::CPath DefaultFileName() const - { - return type().DefaultFileName(); - } - }; -} // namespace PPTX - -#endif // PPTXOOX_EXTERNALIMAGE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/ExternalVideo.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/ExternalVideo.h deleted file mode 100644 index 08bb621d05..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/ExternalVideo.h +++ /dev/null @@ -1,71 +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 PPTXOOX_EXTERNALVIDEO_INCLUDE_H_ -#define PPTXOOX_EXTERNALVIDEO_INCLUDE_H_ - -#include "External.h" - - -namespace PPTX -{ - class ExternalVideo : public External - { - public: - ExternalVideo() - { - } - ExternalVideo(const OOX::CPath& uri) - { - read(uri); - } - ~ExternalVideo() - { - } - - public: - virtual const FileType type() const - { - return FileTypes::ExternalVideo; - } - virtual const OOX::CPath DefaultDirectory() const - { - return type().DefaultDirectory(); - } - virtual const OOX::CPath DefaultFileName() const - { - return type().DefaultFileName(); - } - }; -} // namespace PPTX - -#endif // PPTXOOX_EXTERNALVIDEO_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/HyperLink.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/HyperLink.h deleted file mode 100644 index 4b96f99afa..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/External/HyperLink.h +++ /dev/null @@ -1,71 +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 PPTXOOX_HYPERLINK_INCLUDE_H_ -#define PPTXOOX_HYPERLINK_INCLUDE_H_ - -#include "External.h" - - -namespace PPTX -{ - class HyperLink : public External - { - public: - HyperLink() - { - } - HyperLink(const OOX::CPath& uri) - { - read(uri); - } - ~HyperLink() - { - } - - public: - virtual const FileType type() const - { - return FileTypes::HyperLink; - } - virtual const OOX::CPath DefaultDirectory() const - { - return type().DefaultDirectory(); - } - virtual const OOX::CPath DefaultFileName() const - { - return type().DefaultFileName(); - } - }; -} // namespace PPTX - -#endif // PPTXOOX_HYPERLINK_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/File.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/File.h deleted file mode 100644 index 78749f66ec..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/File.h +++ /dev/null @@ -1,61 +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 PPTXOOX_FILE_INCLUDE_H_ -#define PPTXOOX_FILE_INCLUDE_H_ - -#include "../../../Common/DocxFormat/Source/XML/XmlSimple.h" -#include "../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h" - -#include "FileType.h" -#include "ContentTypes/File.h" - -namespace PPTX -{ - class File - { - public: - File(){} - virtual ~File(){} - - public: - virtual void read(const OOX::CPath& filename) = 0; - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const = 0; - - public: - virtual const PPTX::FileType type() const = 0; - virtual const OOX::CPath DefaultDirectory() const = 0; - virtual const OOX::CPath DefaultFileName() const = 0; - }; -} // namespace PPTX - -#endif // PPTXOOX_FILE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/FileType.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/FileType.h deleted file mode 100644 index 0b8ed70427..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/FileType.h +++ /dev/null @@ -1,115 +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 PPTXOOX_FILE_TYPE_INCLUDE_H_ -#define PPTXOOX_FILE_TYPE_INCLUDE_H_ - -#include "../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h" - -namespace PPTX -{ - class FileType - { - public: - FileType(const OOX::CPath& defaultDirectory, const OOX::CPath& defaultFileName, - const std::wstring& overrideType, - const std::wstring& relationType) : m_defaultDirectory(defaultDirectory), - m_defaultFileName(defaultFileName), - m_overrideType(overrideType), - m_relationType(relationType) - { - } - - FileType(const WCHAR* defaultDirectory, const WCHAR* defaultFileName, - const std::wstring& overrideType, - const std::wstring& relationType) : m_defaultDirectory(defaultDirectory, false), - m_defaultFileName(defaultFileName, false), - m_overrideType(overrideType), - m_relationType(relationType) - { - } - - ~FileType() - { - } - - public: - const bool operator ==(const FileType& rhs) const - { - return (m_relationType == rhs.m_relationType); - } - - public: - inline const std::wstring OverrideType() const - { - return m_overrideType; - } - inline const std::wstring RelationType() const - { - return m_relationType; - } - inline const OOX::CPath DefaultDirectory() const - { - return m_defaultDirectory; - } - inline const OOX::CPath DefaultFileName() const - { - return m_defaultFileName; - } - - private: - std::wstring m_overrideType; - std::wstring m_relationType; - OOX::CPath m_defaultDirectory; - OOX::CPath m_defaultFileName; - }; - - static const bool operator ==(const std::wstring& type, const FileType& file) - { - //RelationType - //http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument - //http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument - //is valid and equal so compare tail - int nIndexType = type.rfind('/'); - std::wstring relationType = file.RelationType(); - int nIndexFile = relationType.rfind('/'); - std::wstring tempType = (-1 == nIndexType) ? type : type.substr(nIndexType); // +1 ????? - std::wstring tempFile = (-1 == nIndexFile) ? relationType : relationType.substr(nIndexFile); //+1 ????? - return (tempType == tempFile); - } - static const bool operator ==(const FileType& file, const std::wstring& type) - { - return type == file; - } -} // namespace PPTX - -#endif // PPTXOOX_FILE_TYPE_INCLUDE_H_ diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/FileTypes.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/FileTypes.h index e0f0464aa2..a2fa45c3b0 100644 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/FileTypes.h +++ b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/FileTypes.h @@ -33,10 +33,11 @@ #ifndef PPTXOOX_FILE_TYPES_INCLUDE_H_ #define PPTXOOX_FILE_TYPES_INCLUDE_H_ -#include "FileType.h" +#include "../../Common/DocxFormat/Source/DocxFormat/FileType.h" - -namespace PPTX +namespace OOX +{ +namespace Presentation { namespace FileTypes { @@ -100,58 +101,6 @@ namespace PPTX _T("application/vnd.openxmlformats-officedocument.customXmlProperties+xml"), _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps")); - const FileType HyperLink(L"", L"", - _T(""), - _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink")); - - const FileType ExternalImage(L"", L"", - _T(""), - _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image")); - - const FileType ExternalAudio(L"", L"", - _T(""), - _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio")); - - const FileType ExternalVideo(L"", L"", - _T(""), - _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/video")); - - const FileType Image(L"media", L"image", - _T(""), - _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image")); - - const FileType Audio(L"media", L"audio", - _T(""), - _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio")); - - const FileType Video(L"media", L"video", - _T(""), - _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/video")); - - const FileType Data(L"diagrams", L"data.xml", - _T("application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml"), - _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData")); - - const FileType DrawingDiag(L"diagrams", L"drawing.xml", - _T("application/vnd.openxmlformats-officedocument.drawingml.diagramDrawing+xml"), - _T("http://schemas.microsoft.com/office/2007/relationships/diagramDrawing")); - - const FileType Layout(L"diagrams", L"layout.xml", - _T("application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml"), - _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramLayout")); - - const FileType Colors(L"diagrams", L"colors.xml", - _T("application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml"), - _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramColors")); - - const FileType QuickStyle(L"diagrams", L"quickStyle.xml", - _T("application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml"), - _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramQuickStyle")); - - const FileType Chart(L"charts", L"chart.xml", - _T("application/vnd.openxmlformats-officedocument.drawingml.chart+xml"), - _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart")); - const FileType MicrosoftOfficeExcelWorksheet(L"embeddings", L"Microsoft_Office_Excel_Worksheet.xlsx", _T(""), @@ -279,10 +228,8 @@ namespace PPTX const FileType Media(L"ppt/media", L"", _T(""), _T("http://schemas.microsoft.com/office/2007/relationships/media")); - - const FileType Unknow(L"", L"", _T(""), _T("")); - } // namespace FileTypes + } //Presentation } // namespace OOX #endif // PPTXOOX_FILE_TYPES_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/IFileContainer.cpp b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/IFileContainer.cpp deleted file mode 100644 index 2f88803dd1..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/IFileContainer.cpp +++ /dev/null @@ -1,365 +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 "./stdafx.h" - -#include "IFileContainer.h" -#include "Rels/File.h" - -#ifndef NODOCX -//#include "FileFactory.h" -#endif - -#include "ContentTypes/File.h" -#include "FileType.h" -#include "External/External.h" -#include "External/HyperLink.h" -#include "Drawing/LegacyDiagramText.h" -#include "Media/Image.h" -#include "Media/OleObject.h" -#include "FileTypes.h" - -#include -#include - -namespace PPTX -{ - UnknowTypeFile IFileContainer::unknow; - - void IFileContainer::read(const OOX::CPath& filename) - { - PPTX::Rels::File rels(filename); - read(rels, filename.GetDirectory()); - } - - - void IFileContainer::read(const Rels::File& rels, const OOX::CPath& path) - { -#ifndef NODOCX - /*BOOST_FOREACH(const PPTX::Rels::RelationShip& relation, *rels.Relations) - { - add(relation.rId(), PPTX::CreateFile(path, relation)); - }*/ - - size_t nCount = rels.Relations.m_items.size(); - for (size_t i = 0; i < nCount; ++i) - { - add(rels.Relations.m_items[i].rId(), PPTX::CreateFile(path, rels.Relations.m_items[i])); - } -#endif - } - - - void IFileContainer::write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const - { - PPTX::Rels::File rels; - OOX::CPath current = filename.GetDirectory(); - write(rels, current, directory, content); - rels.write(filename); - } - - - void IFileContainer::write(Rels::File& rels, const OOX::CPath& curdir, const OOX::CPath& directory, ContentTypes::File& content) const - { - std::map namepair; - for (std::map>::const_iterator it = m_container.begin(); it != m_container.end(); ++it) - { - smart_ptr pFile = it->second; - smart_ptr pExt = pFile.smart_dynamic_cast(); - - if (!pExt.IsInit()) - { - OOX::CPath defdir = pFile->DefaultDirectory(); - OOX::CPath name = pFile->DefaultFileName(); - - std::map::const_iterator pNamePair = namepair.find( name.m_strFilename ); - if ( pNamePair == namepair.end()) - namepair [name.m_strFilename] = 1; - else - name = name + pNamePair->first; - - OOX::CSystemUtility::CreateDirectories(curdir / defdir); - pFile->write(curdir / defdir / name, directory / defdir, content); - rels.registration(it->first, pFile->type(), defdir / name); - } - else - { - //const HyperLink hyperlink = static_cast(*pair.second); - //rels.registration(pair.first, hyperlink); - rels.registration(it->first, pExt); - } - } - } - - - void IFileContainer::Commit(const OOX::CPath& path) - { - std::map namepair; - for (std::map>::const_iterator it = m_container.begin(); it != m_container.end(); ++it) - { - smart_ptr pFile = it->second; - smart_ptr pExt = pFile.smart_dynamic_cast(); - - if (!pExt.IsInit()) - { - OOX::CPath defdir = pFile->DefaultDirectory(); - OOX::CPath name = pFile->DefaultFileName(); - - std::map::const_iterator pNamePair = namepair.find( name.m_strFilename ); - if ( pNamePair == namepair.end()) - namepair [name.m_strFilename] = 1; - else - name = name + pNamePair->first; - - OOX::CSystemUtility::CreateDirectories(path / defdir); - - smart_ptr fileBuilder = it->second.smart_dynamic_cast(); - if (fileBuilder.is_init()) - fileBuilder->Commit(path / defdir / name); - } - } - } - - - void IFileContainer::Finalize(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) - { - PPTX::Rels::File rels; - OOX::CPath current = filename.GetDirectory(); - Finalize(rels, current, directory, content); - rels.write(filename); - } - - - void IFileContainer::Finalize(Rels::File& rels, const OOX::CPath& curdir, const OOX::CPath& directory, ContentTypes::File& content) - { - std::map namepair; - for (std::map>::const_iterator it = m_container.begin(); it != m_container.end(); ++it) - { - smart_ptr pFile = it->second; - smart_ptr pExt = pFile.smart_dynamic_cast(); - - if (!pExt.IsInit()) - { - OOX::CPath defdir = pFile->DefaultDirectory(); - OOX::CPath name = pFile->DefaultFileName(); - - std::map::const_iterator pNamePair = namepair.find( name.m_strFilename ); - if ( pNamePair == namepair.end()) - namepair [name.m_strFilename] = 1; - else - name = name + pNamePair->first; - - OOX::CSystemUtility::CreateDirectories(curdir / defdir); - - smart_ptr fileBuilder = pFile.smart_dynamic_cast(); - - if ( fileBuilder.is_init() ) - { - fileBuilder->Finalize(curdir / defdir / name, directory / defdir, content); - } - else - { - pFile->write(curdir / defdir / name, directory / defdir, content); - } - - rels.registration(it->first, pFile->type(), defdir / name); - } - else - { - rels.registration(it->first, pExt); - } - } - } - - - void IFileContainer::extractPictures(const OOX::CPath& path) const - { - for (std::map>::const_iterator it = m_container.begin(); it != m_container.end(); ++it) - { - smart_ptr pFile = it->second; - - smart_ptr pImage = pFile.smart_dynamic_cast(); - if ( pImage.is_init() ) - { - pImage->copy_to( path ); - continue; - } - - smart_ptr pExt = pFile.smart_dynamic_cast(); - if ( pExt.is_init() ) - { - pExt->extractPictures( path ); - continue; - } - } - } - - - smart_ptr IFileContainer::image(const RId& rId) const - { - std::map>::const_iterator pPair = m_container.find(rId.get()); - if (pPair == m_container.end ()) - return smart_ptr(); - return pPair->second.smart_dynamic_cast(); - } - - smart_ptr IFileContainer::hyperlink(const RId& rId) const - { - std::map>::const_iterator pPair = m_container.find(rId.get()); - if (pPair == m_container.end ()) - return smart_ptr(); - return pPair->second.smart_dynamic_cast(); - } - - smart_ptr IFileContainer::oleObject(const RId& rId) const - { - std::map>::const_iterator pPair = m_container.find(rId.get()); - if (pPair == m_container.end ()) - return smart_ptr(); - return pPair->second.smart_dynamic_cast(); - } - smart_ptr IFileContainer::legacyDiagramText(const RId& rId) const - { - std::map>::const_iterator pPair = m_container.find(rId.get()); - if (pPair == m_container.end ()) - return smart_ptr(); - return pPair->second.smart_dynamic_cast(); - } - const bool IFileContainer::exist(const FileType& type) const - { - for (std::map>::const_iterator it = m_container.begin(); it != m_container.end(); ++it) - { - if (type == it->second->type()) - return true; - } - - return false; - } - - - const bool IFileContainer::exist(const RId& rId) const - { - std::map>::const_iterator it = m_container.find(rId.get()); - return (it != m_container.end()); - } - - - const bool IFileContainer::isExternal(const PPTX::RId& rId) const - { - std::map>::const_iterator it = m_container.find(rId.get()); - - if (it != m_container.end()) - { - std::wstring type = it->second->type().RelationType(); - std::wstring name = it->second->type().DefaultFileName().m_strFilename; - - return (((type == PPTX::FileTypes::ExternalAudio) || (type == PPTX::FileTypes::ExternalImage) - || (type == PPTX::FileTypes::ExternalVideo)) && (name == _T(""))); - } - return true; - } - - - smart_ptr IFileContainer::get(const FileType& type) - { - for (std::map>::const_iterator it = m_container.begin(); it != m_container.end(); ++it) - { - if (type == it->second->type()) - return it->second; - } - - return smart_ptr(new UnknowTypeFile( unknow )); - } - - - const RId IFileContainer::add(const smart_ptr& file) - { - const RId rId = maxRId().next(); - add(rId, file); - return rId; - } - - - void IFileContainer::add(const PPTX::RId rId, const smart_ptr& file) - { - //m_lMaxRid = max(m_lMaxRid, rId.get()); - m_container [rId.get()] = file; - } - - - smart_ptr IFileContainer::find(const FileType& type) const - { - for (std::map>::const_iterator it = m_container.begin(); it != m_container.end(); ++it) - { - if (type == it->second->type()) - return it->second; - - } - - return smart_ptr((PPTX::File*)new UnknowTypeFile()); - } - - smart_ptr IFileContainer::find(const PPTX::RId& rId) const - { - std::map>::const_iterator it = m_container.find(rId.get()); - - if (it != m_container.end()) - return it->second; - - smart_ptr pointer; - return pointer; - } - - - smart_ptr IFileContainer::operator [](const PPTX::RId rId) - { - std::map>::const_iterator it = m_container.find(rId.get()); - - if (it != m_container.end()) - return it->second; - - smart_ptr pointer; - return pointer; - } - - - smart_ptr IFileContainer::operator [](const FileType& type) - { - return find(type); - } - - const RId IFileContainer::maxRId() - { - ++m_lMaxRid; - return RId(m_lMaxRid); - } - -} // namespace PPTX diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/IFileContainer.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/IFileContainer.h deleted file mode 100644 index d123db6a49..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/IFileContainer.h +++ /dev/null @@ -1,129 +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 PPTXOOX_IFILE_CONTAINER_INCLUDE_H_ -#define PPTXOOX_IFILE_CONTAINER_INCLUDE_H_ - -#include "RId.h" -#include "UnknowTypeFile.h" -#include "IFileBuilder.h" - -namespace PPTX {class File;} -namespace PPTX {class FileType;} -namespace PPTX {namespace Rels {class File;}} -namespace PPTX {namespace ContentTypes {class File;}} -namespace PPTX {class Image;} -namespace PPTX {class HyperLink;} -namespace PPTX {class OleObject;} -namespace PPTX {class LegacyDiagramText;} - - -namespace PPTX -{ - class IFileContainer - { - public: - IFileContainer() - { - m_lMaxRid = 0; - } - virtual ~IFileContainer() - { - } - protected: - std::map> m_container; - size_t m_lMaxRid; - - protected: - void read(const OOX::CPath& filename); - void read(const Rels::File& rels, const OOX::CPath& path); - void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const; - void write(Rels::File& rels, const OOX::CPath& current, const OOX::CPath& directory, ContentTypes::File& content) const; - - protected: - void Commit(const OOX::CPath& path); - void Finalize(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content); - void Finalize(Rels::File& rels, const OOX::CPath& current, const OOX::CPath& directory, ContentTypes::File& content); - - public: - void extractPictures(const OOX::CPath& path) const; - - public: - virtual smart_ptr image (const RId& rId) const; - virtual smart_ptr hyperlink (const RId& rId) const; - virtual smart_ptr oleObject (const RId& rId) const; - virtual smart_ptrlegacyDiagramText (const RId& rId) const; - public: - template const bool exist() const; - const bool exist(const FileType& type) const; - const bool exist(const PPTX::RId& rId) const; - const bool isExternal(const PPTX::RId& rId) const; - - smart_ptr get(const FileType& type); - const RId add(const smart_ptr& file); - void add(const PPTX::RId rId, const smart_ptr& file); - - smart_ptr find(const FileType& type) const; - - smart_ptr find(const PPTX::RId& type) const; - - smart_ptr operator [](const PPTX::RId rId); - - smart_ptr operator [](const FileType& type); - - template T& find(); - - protected: - static UnknowTypeFile unknow; - - private: - const RId maxRId(); - }; - - - template - const bool IFileContainer::exist() const - { - T file; - return exist(file.type()); - } - - template - T& IFileContainer::find() - { - T file; - return dynamic_cast(find(file.type())); - } - -} // namespace PPTX - -#endif // PPTXOOX_IFILE_CONTAINER_INCLUDE_H_ diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Audio.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Audio.h deleted file mode 100644 index 1007fd408a..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Audio.h +++ /dev/null @@ -1,70 +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 PPTXOOX_AUDIO_INCLUDE_H_ -#define PPTXOOX_AUDIO_INCLUDE_H_ - -#include "Media.h" - -namespace PPTX -{ - class Audio : public Media - { - public: - Audio() - { - } - Audio(const OOX::CPath& filename) - { - read(filename); - } - virtual ~Audio() - { - } - - public: - virtual const FileType type() const - { - return FileTypes::Audio; - } - virtual const OOX::CPath DefaultDirectory() const - { - return type().DefaultDirectory(); - } - virtual const OOX::CPath DefaultFileName() const - { - return m_filename.GetFilename(); - } - }; -} // namespace PPTX - -#endif // PPTXOOX_AUDIO_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Image.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Image.h deleted file mode 100644 index 284ce825d1..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Image.h +++ /dev/null @@ -1,99 +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 PPTXOOX_IMAGE_INCLUDE_H_ -#define PPTXOOX_IMAGE_INCLUDE_H_ - -#include "Media.h" - -namespace PPTX -{ - class Image : public Media - { - public: - Image() - { - } - Image(const OOX::CPath& filename) - { - read(filename); - } - virtual ~Image() - { - } - - public: - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const - { - std::wstring newFilename = filename.GetFilename(); - OOX::CPath newFilePath = filename.GetDirectory(); - - boost::algorithm::replace_all(newFilename, L" ", L"_"); - if (OOX::CSystemUtility::IsFileExist(m_filename) && !OOX::CSystemUtility::IsFileExist(newFilePath/newFilename)) - { - //if (m_filename.GetExtention(true) == _T(".svm")) - //{ - // ConvertSvmToImage(m_filename, replace_extension(newFilePath/newFilename, L"png")); - //} - //else if (m_filename.extension() != L"") - //{ - // boost::filesystem::copy_file(m_filename, newFilePath/newFilename); - //} - //else - //{ - // newFilename += L".wmf"; - // boost::filesystem::copy_file(m_filename, newFilePath/newFilename); - //} - } - //if (m_filename.extension() == L".svm") - // content.Default->add(replace_extension(newFilePath/newFilename, L"png")); - //else - // content.Default->add(newFilePath/newFilename); - } - - public: - virtual const FileType type() const - { - return FileTypes::Image; - } - virtual const OOX::CPath DefaultDirectory() const - { - return type().DefaultDirectory(); - } - virtual const OOX::CPath DefaultFileName() const - { - return m_filename.GetFilename(); - } - }; -} // namespace PPTX - -#endif // PPTXOOX_IMAGE_INCLUDE_H_ diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Media.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Media.h deleted file mode 100644 index 9b712e2a54..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Media.h +++ /dev/null @@ -1,103 +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 PPTXOOX_MEDIA_INCLUDE_H_ -#define PPTXOOX_MEDIA_INCLUDE_H_ - -#include "../File.h" -#include "../FileTypes.h" - -#ifdef AVS_OFFICE_SVM_FILE -#include "OfficeSvmFile.h" -#include "SvmConverter.h" -#endif - - -namespace PPTX -{ - class Media : public File - { - public: - Media() - { - } - Media(const OOX::CPath& filename) - { - read(filename); - } - virtual ~Media() - { - } - - public: - virtual void read(const OOX::CPath& filename) - { - m_filename = filename; - } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const - { - //std::wstring newFilename = filename.filename(); - //boost::filesystem::wpath newFilePath = filename.parent_path(); - //boost::replace_all(newFilename, L" ", L"_"); - //if (boost::filesystem::exists(m_filename) && !boost::filesystem::exists(newFilePath/newFilename)) - //{ - // if (m_filename.extension() == L".svm") - // ConvertSvmToImage(m_filename, replace_extension(newFilePath/newFilename, L"png")); - // else - // boost::filesystem::copy_file(m_filename, newFilePath/newFilename); - //} - //if (m_filename.extension() == L".svm") - // content.Default->add(replace_extension(newFilePath/newFilename, L"png")); - //else - // content.Default->add(m_filename); - } - - public: - const OOX::CPath filename() const - { - return m_filename; - } - void copy_to(const OOX::CPath& path) const - { - //std::wstring newFilename = m_filename.filename(); - //boost::replace_all(newFilename, L" ", L"_"); - - //if (boost::filesystem::exists(m_filename) && !boost::filesystem::exists(path/m_filename.filename())) - // boost::filesystem::copy_file(m_filename, path/newFilename); - } - - protected: - OOX::CPath m_filename; - }; -} // namespace PPTX - -#endif // PPTXOOX_MEDIA_INCLUDE_H_ diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/OleObject.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/OleObject.h deleted file mode 100644 index c00d29e01b..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/OleObject.h +++ /dev/null @@ -1,84 +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 PPTXOOX_OLE_OBJECT_INCLUDE_H_ -#define PPTXOOX_OLE_OBJECT_INCLUDE_H_ - -#include "Media.h" - - -namespace PPTX -{ - class OleObject : public Media - { - public: - OleObject() - { - } - OleObject(const OOX::CPath& filename) - { - read(filename); - } - virtual ~OleObject() - { - } - - public: - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const - { - //std::wstring newFilename = filename.filename(); - //boost::filesystem::wpath newFilePath = filename.parent_path(); - //boost::replace_all(newFilename, L" ", L"_"); - //if (m_filename.extension() != L".bin") - // newFilename += L".bin" ; - // - //boost::filesystem::copy_file(m_filename, newFilePath/newFilename); - //content.Default->add(newFilePath/newFilename); - } - - public: - virtual const FileType type() const - { - return FileTypes::OleObject; - } - virtual const OOX::CPath DefaultDirectory() const - { - return type().DefaultDirectory(); - } - virtual const OOX::CPath DefaultFileName() const - { - return m_filename.GetFilename(); - } - }; -} // namespace OOX - -#endif // PPTXOOX_OLE_OBJECT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Video.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Video.h deleted file mode 100644 index 55c01f5ab1..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Media/Video.h +++ /dev/null @@ -1,71 +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 PPTXOOX_VIDEO_INCLUDE_H_ -#define PPTXOOX_VIDEO_INCLUDE_H_ - -#include "Media.h" - - -namespace PPTX -{ - class Video : public Media - { - public: - Video() - { - } - Video(const OOX::CPath& filename) - { - read(filename); - } - virtual ~Video() - { - } - - public: - virtual const FileType type() const - { - return FileTypes::Video; - } - virtual const OOX::CPath DefaultDirectory() const - { - return type().DefaultDirectory(); - } - virtual const OOX::CPath DefaultFileName() const - { - return m_filename.GetFilename(); - } - }; -} // namespace PPTX - -#endif // PPTXOOX_VIDEO_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/RId.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/RId.h deleted file mode 100644 index 3a6381d271..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/RId.h +++ /dev/null @@ -1,137 +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 PPTXOOX_RID_INCLUDE_H_ -#define PPTXOOX_RID_INCLUDE_H_ - -#include "../../../Common/DocxFormat/Source/Base/Base.h" -#include "../../../Common/DocxFormat/Source/XML/Utils.h" -#include "../../../DesktopEditor/xml/include/xmlutils.h" - -namespace PPTX -{ - class RId - { - public: - RId() : m_id(_T("rId0")) - { - } - RId(const size_t id) - { - m_id = _T("rId") + XmlUtils::UIntToString(id); - } - RId(const std::wstring& rid) - { - m_id = rid; - } - RId(const RId& oSrc) - { - m_id = oSrc.m_id; - } - - public: - const RId& operator= (const size_t id) - { - m_id = _T("rId") + XmlUtils::UIntToString(id); - return *this; - } - const RId& operator= (const std::wstring& rid) - { - m_id = rid; - return *this; - } -#if defined(_WIN32) || defined (_WIN64) - const RId& operator= (const BSTR& rid) - { - m_id = (std::wstring)rid; - return *this; - } -#endif - const RId& operator= (const RId& oSrc) - { - m_id = oSrc.m_id; - return *this; - } - - public: - const bool operator ==(const RId& lhs) const - { - return m_id == lhs.m_id; - } - const bool operator !=(const RId& lhs) const - { - return m_id != lhs.m_id; - } - const bool operator < (const RId& lhs) const - { - return m_id < lhs.m_id; - } - const bool operator <=(const RId& lhs) const - { - return m_id <= lhs.m_id; - } - const bool operator >(const RId& lhs) const - { - return m_id > lhs.m_id; - } - const bool operator >=(const RId& lhs) const - { - return m_id >= lhs.m_id; - } - - AVSINLINE std::wstring get() const { return m_id; } - - public: - const RId next() const - { - return RId(m_id + _T("1")); - } - - public: - const std::wstring ToString() const - { - return m_id; - } - - template - void toPPTY(BYTE type, T pWriter) const - { - pWriter->WriteBYTE(type); - pWriter->WriteStringW(m_id.c_str()); - } - - private: - std::wstring m_id; - }; -} // namespace PPTX - -#endif // PPTXOOX_RID_INCLUDE_H_ diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/File.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/File.h index 7853782369..3213058f99 100644 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/File.h +++ b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/File.h @@ -34,10 +34,10 @@ #define PPTXOOX_RELS_FILE_INCLUDE_H_ #include "RelationTable.h" -#include "./../FileType.h" -#include "./../FileTypes.h" -#include "./../RId.h" -#include "./../External/External.h" +#include "../FileTypes.h" +#include "../../Common/DocxFormat/Source/DocxFormat/FileTypes.h" +#include "../../Common/DocxFormat/Source/DocxFormat/RId.h" +#include "../../Common/DocxFormat/Source/DocxFormat/External/External.h" #include "../../../../Common/DocxFormat/Source/Base/SmartPtr.h" #include "../../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h" @@ -109,12 +109,12 @@ namespace PPTX } public: - void registration(const RId& rId, const FileType& type, const OOX::CPath& filename) + void registration(const OOX::RId& rId, const OOX::FileType& type, const OOX::CPath& filename) { - if(!(type == FileTypes::Unknow)) + if(!(type == OOX::FileTypes::Unknow)) { std::wstring strFileName = filename.m_strFilename; - std::wstring strDir = filename.GetDirectory() + _T(""); + std::wstring strDir = filename.GetDirectory() + _T(""); if (_T("") == filename.GetExtention()) { if (type.RelationType() == _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject")) @@ -134,7 +134,7 @@ namespace PPTX } } } - void registration(const RId& rId, const smart_ptr external) + void registration(const OOX::RId& rId, const smart_ptr external) { Relations.registration(rId, external); } diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/RelationShip.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/RelationShip.h index bd224c6424..fddafcd008 100644 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/RelationShip.h +++ b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/RelationShip.h @@ -34,8 +34,8 @@ #define PPTXOOX_RELS_RELATION_SHIP_INCLUDE_H_ #include "./../WritingElement.h" -#include "./../RId.h" -#include "./../External/External.h" +#include "../../Common/DocxFormat/Source/DocxFormat/RId.h" +#include "../../Common/DocxFormat/Source/DocxFormat/External/External.h" #include @@ -46,11 +46,11 @@ namespace PPTX class RelationShip : public WritingElement { public: - RelationShip(const PPTX::RId& rId, const std::wstring& type, const OOX::CPath& filename) : m_rId(rId), m_target(filename), m_type(type) + RelationShip(const OOX::RId& rId, const std::wstring& type, const OOX::CPath& filename) : m_rId(rId), m_target(filename), m_type(type) { boost::algorithm::replace_all(m_target.m_strFilename, L" ", L"_"); } - RelationShip(const PPTX::RId& rId, const smart_ptr external): m_rId(rId), m_target(external->Uri()), + RelationShip(const OOX::RId& rId, const smart_ptr external): m_rId(rId), m_target(external->Uri()), m_type(external->type().RelationType()) { m_mode = new std::wstring(_T("External")); @@ -93,7 +93,6 @@ namespace PPTX return m_rId < rhs.m_rId; } - public: const std::wstring type() const { return m_type; @@ -112,16 +111,16 @@ namespace PPTX return false; return (*m_mode == _T("External")); } - const RId rId() const + const OOX::RId rId() const { return m_rId; } private: - RId m_rId; - OOX::CPath m_target; - std::wstring m_type; - nullable_string m_mode; + OOX::RId m_rId; + OOX::CPath m_target; + std::wstring m_type; + nullable_string m_mode; }; } // namespace Rels } // namespace PPTX diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/RelationTable.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/RelationTable.h index a5c319feab..83b61fa7b1 100644 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/RelationTable.h +++ b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/RelationTable.h @@ -35,7 +35,7 @@ #include "./../WritingVector.h" #include "RelationShip.h" -#include "./../RId.h" +#include "../../Common/DocxFormat/Source/DocxFormat/RId.h" namespace PPTX {class External;} @@ -61,13 +61,11 @@ namespace PPTX fromXML(node); return *this; } - - public: - void registration(const RId& rId, const std::wstring& type, const OOX::CPath& filename) + void registration(const OOX::RId& rId, const std::wstring& type, const OOX::CPath& filename) { m_items.push_back(RelationShip(rId, type, filename)); } - void registration(const RId& rId, const smart_ptr external) + void registration(const OOX::RId& rId, const smart_ptr external) { m_items.push_back(RelationShip(rId, external)); } diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/UnknowTypeFile.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/UnknowTypeFile.h deleted file mode 100644 index 27637d9d8b..0000000000 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/UnknowTypeFile.h +++ /dev/null @@ -1,76 +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 PPTXOOX_UNKNOW_TYPE_FILE_INCLUDE_H_ -#define PPTXOOX_UNKNOW_TYPE_FILE_INCLUDE_H_ - -#include "File.h" -#include "FileTypes.h" - - -namespace PPTX -{ - class UnknowTypeFile : public File - { - public: - UnknowTypeFile() - { - } - virtual ~UnknowTypeFile() - { - } - - public: - virtual void read(const OOX::CPath& filename) - { - } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const - { - } - - public: - virtual const FileType type() const - { - return FileTypes::Unknow; - } - virtual const OOX::CPath DefaultDirectory() const - { - return type().DefaultDirectory(); - } - virtual const OOX::CPath DefaultFileName() const - { - return type().DefaultFileName(); - } - }; -} // namespace OOX - -#endif // PPTXOOX_UNKNOW_TYPE_FILE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/FileContainer.cpp b/ASCOfficePPTXFile/PPTXFormat/FileContainer.cpp index d9ba777563..b3c2393a1e 100644 --- a/ASCOfficePPTXFile/PPTXFormat/FileContainer.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/FileContainer.cpp @@ -29,17 +29,19 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "FileContainer.h" #include "DocxFormat/Rels/File.h" +#include "DocxFormat/Drawing/LegacyDiagramText.h" #include "FileFactory.h" -#include "DocxFormat/ContentTypes/File.h" -#include "DocxFormat/FileType.h" -#include "DocxFormat/FileTypes.h" -#include "DocxFormat/External/HyperLink.h" #include "WrapperFile.h" +#include "../../Common/DocxFormat/Source/DocxFormat/ContentTypes.h" +#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h" +#include "../../Common/DocxFormat/Source/DocxFormat/FileTypes.h" +#include "DocxFormat/FileTypes.h" + #include namespace PPTX @@ -53,7 +55,13 @@ namespace PPTX { //not implement FileContainer.read } - + smart_ptr FileContainer::legacyDiagramText(const OOX::RId& rId) const + { + std::map>::const_iterator pPair = m_mContainer.find(rId.get()); + if (pPair == m_mContainer.end ()) + return smart_ptr(); + return pPair->second.smart_dynamic_cast(); + } void FileContainer::read(const OOX::CPath& filename, FileMap& map, IPPTXEvent* Event) { PPTX::Rels::File rels(filename); @@ -64,9 +72,9 @@ namespace PPTX void FileContainer::read(const PPTX::Rels::File& rels, const OOX::CPath& path, FileMap& map, IPPTXEvent* Event) { bool bIsSlide = false; - PPTX::File* pSrcFile = dynamic_cast(this); + OOX::File* pSrcFile = dynamic_cast(this); if (NULL != pSrcFile) - bIsSlide = (pSrcFile->type() == PPTX::FileTypes::Slide) ? true : false; + bIsSlide = (pSrcFile->type() == OOX::Presentation::FileTypes::Slide) ? true : false; size_t nCount = rels.Relations.m_items.size(); @@ -75,17 +83,17 @@ namespace PPTX const PPTX::Rels::RelationShip* pRelation = &(rels.Relations.m_items[i]); OOX::CPath normPath = path / pRelation->target(); - std::map>::const_iterator pPair = map.find(normPath); + std::map>::const_iterator pPair = map.find(normPath); - if (bIsSlide && (pRelation->type() == PPTX::FileTypes::Slide)) + if (bIsSlide && (pRelation->type() == OOX::Presentation::FileTypes::Slide)) { long percent = Event->GetPercent(); - smart_ptr file = smart_ptr(new PPTX::HyperLink(pRelation->target())); + smart_ptr file = smart_ptr(new OOX::HyperLink(pRelation->target())); bool res = Event->Progress(0, percent + m_lPercent); - add(pRelation->rId(), file); + Add(pRelation->rId(), file); if (res || m_bCancelled) { @@ -97,16 +105,16 @@ namespace PPTX { if (pPair != map.m_map.end()) { - add(pRelation->rId(), pPair->second); + Add(pRelation->rId(), pPair->second); } else { long percent = Event->GetPercent(); - smart_ptr file = PPTX::FileFactory::CreateFilePPTX(path, *pRelation, map); + smart_ptr file = PPTX::FileFactory::CreateFilePPTX(path, *pRelation, map); map.add(normPath, file); - add(pRelation->rId(), file); + Add(pRelation->rId(), file); smart_ptr pContainer = file.smart_dynamic_cast(); bool res = Event->Progress(0, percent + m_lPercent); @@ -131,7 +139,7 @@ namespace PPTX } } - void FileContainer::write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content) const + void FileContainer::write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content) const { PPTX::Rels::File rels; OOX::CPath current = filename.GetDirectory(); @@ -139,13 +147,13 @@ namespace PPTX rels.write(filename); } - void FileContainer::write(PPTX::Rels::File& rels, const OOX::CPath& curdir, const OOX::CPath& directory, PPTX::ContentTypes::File& content) const + void FileContainer::write(PPTX::Rels::File& rels, const OOX::CPath& curdir, const OOX::CPath& directory, OOX::CContentTypes& content) const { std::map mNamePair; - for (std::map>::const_iterator pPair = m_container.begin(); pPair != m_container.end(); ++pPair) + for (std::map>::const_iterator pPair = m_mContainer.begin(); pPair != m_mContainer.end(); ++pPair) { - smart_ptr pFile = pPair->second; - smart_ptr pExt = pFile.smart_dynamic_cast(); + smart_ptr pFile = pPair->second; + smart_ptr pExt = pFile.smart_dynamic_cast(); if ( !pExt.IsInit() ) { smart_ptr file = pFile.smart_dynamic_cast(); @@ -190,9 +198,9 @@ namespace PPTX void FileContainer::WrittenSetFalse() { - for (std::map>::const_iterator pPair = m_container.begin(); pPair != m_container.end(); ++pPair) + for (std::map>::const_iterator pPair = m_mContainer.begin(); pPair != m_mContainer.end(); ++pPair) { - smart_ptr pFile = pPair->second; + smart_ptr pFile = pPair->second; smart_ptr pWrapFile = pFile.smart_dynamic_cast(); smart_ptr pWrapCont = pFile.smart_dynamic_cast(); @@ -216,8 +224,8 @@ namespace PPTX { const PPTX::Rels::RelationShip* pRelation = &(rels.Relations.m_items[i]); - smart_ptr _file = PPTX::FileFactory::CreateFilePPTX_OnlyMedia(path, *pRelation); - add(pRelation->rId(), _file); + smart_ptr _file = PPTX::FileFactory::CreateFilePPTX_OnlyMedia(path, *pRelation); + Add(pRelation->rId(), _file); } } diff --git a/ASCOfficePPTXFile/PPTXFormat/FileContainer.h b/ASCOfficePPTXFile/PPTXFormat/FileContainer.h index a59f2f7f20..c29e24a619 100644 --- a/ASCOfficePPTXFile/PPTXFormat/FileContainer.h +++ b/ASCOfficePPTXFile/PPTXFormat/FileContainer.h @@ -33,13 +33,15 @@ #ifndef PPTX_IFILE_CONTAINER_INCLUDE_H_ #define PPTX_IFILE_CONTAINER_INCLUDE_H_ -#include "DocxFormat/IFileContainer.h" +#include "../../Common/DocxFormat/Source/DocxFormat/IFileContainer.h" #include "FileMap.h" #include "PPTXEvent.h" namespace PPTX { - class FileContainer : public PPTX::IFileContainer + class LegacyDiagramText; + + class FileContainer : public OOX::IFileContainer { public: FileContainer() @@ -50,14 +52,16 @@ namespace PPTX virtual ~FileContainer() { } + smart_ptr legacyDiagramText (const OOX::RId& rId) const; + protected: void read(const OOX::CPath& filename); void read(const PPTX::Rels::File& rels, const OOX::CPath& path); void read(const OOX::CPath& filename, FileMap& map, IPPTXEvent* Event); void read(const PPTX::Rels::File& rels, const OOX::CPath& path, FileMap& map, IPPTXEvent* Event); - void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content) const; - void write(PPTX::Rels::File& rels, const OOX::CPath& current, const OOX::CPath& directory, PPTX::ContentTypes::File& content) const; + void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content) const; + void write(PPTX::Rels::File& rels, const OOX::CPath& current, const OOX::CPath& directory, OOX::CContentTypes& content) const; void WrittenSetFalse(); diff --git a/ASCOfficePPTXFile/PPTXFormat/FileFactory.cpp b/ASCOfficePPTXFile/PPTXFormat/FileFactory.cpp index a9c7bf5b3c..7a70feb8dc 100644 --- a/ASCOfficePPTXFile/PPTXFormat/FileFactory.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/FileFactory.cpp @@ -29,10 +29,10 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "FileFactory.h" -#include "DocxFormat/File.h" +#include "../../Common/DocxFormat/Source/DocxFormat/File.h" #include "DocxFormat/FileTypes.h" #include "DocxFormat/Rels/RelationShip.h" #include "App.h" @@ -51,89 +51,91 @@ #include "NotesSlide.h" #include "NotesMaster.h" -#include "DocxFormat/Media/Image.h" -#include "DocxFormat/Media/Audio.h" -#include "DocxFormat/Media/Video.h" -#include "DocxFormat/Media/OleObject.h" -#include "DocxFormat/External/HyperLink.h" -#include "DocxFormat/External/ExternalImage.h" -#include "DocxFormat/External/ExternalAudio.h" -#include "DocxFormat/External/ExternalVideo.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Diagram/DiagramData.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Media/Image.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Media/Video.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h" +#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h" +#include "../../Common/DocxFormat/Source/DocxFormat/External/ExternalImage.h" +#include "../../Common/DocxFormat/Source/DocxFormat/External/ExternalAudio.h" +#include "../../Common/DocxFormat/Source/DocxFormat/External/ExternalVideo.h" +#include "../../Common/DocxFormat/Source/DocxFormat/UnknowTypeFile.h" #include "DocxFormat/Drawing/VmlDrawing.h" #include "DocxFormat/Drawing/LegacyDiagramText.h" -#include "DocxFormat/UnknowTypeFile.h" #include "FileMap.h" namespace PPTX { - const smart_ptr FileFactory::CreateFilePPTX(const OOX::CPath& path, const PPTX::Rels::RelationShip& relation, FileMap& map) + const smart_ptr FileFactory::CreateFilePPTX(const OOX::CPath& path, const PPTX::Rels::RelationShip& relation, FileMap& map) { OOX::CPath filename = path / relation.filename(); - if (relation.type() == PPTX::FileTypes::App) - return smart_ptr(new PPTX::App(filename, map)); - else if (relation.type() == PPTX::FileTypes::Core) - return smart_ptr(new PPTX::Core(filename, map)); - else if (relation.type() == PPTX::FileTypes::Presentation) - return smart_ptr(new PPTX::Presentation(filename, map)); - else if (relation.type() == PPTX::FileTypes::Theme) - return smart_ptr(new PPTX::Theme(filename, map)); - else if (relation.type() == PPTX::FileTypes::SlideMaster) - return smart_ptr(new PPTX::SlideMaster(filename, map)); - else if (relation.type() == PPTX::FileTypes::SlideLayout) - return smart_ptr(new PPTX::SlideLayout(filename, map)); - else if (relation.type() == PPTX::FileTypes::Slide) - return smart_ptr(new PPTX::Slide(filename, map)); - else if (relation.type() == PPTX::FileTypes::HandoutMaster) - return smart_ptr(new PPTX::HandoutMaster(filename, map)); - else if (relation.type() == PPTX::FileTypes::NotesMaster) - return smart_ptr(new PPTX::NotesMaster(filename, map)); - else if (relation.type() == PPTX::FileTypes::NotesSlide) - return smart_ptr(new PPTX::NotesSlide(filename, map)); - else if (relation.type() == PPTX::FileTypes::PresProps) - return smart_ptr(new PPTX::PresProps(filename, map)); - else if (relation.type() == PPTX::FileTypes::ViewProps) - return smart_ptr(new PPTX::ViewProps(filename, map)); - else if (relation.type() == PPTX::FileTypes::TableStyles) - return smart_ptr(new PPTX::TableStyles(filename, map)); - else if (relation.type() == PPTX::FileTypes::LegacyDiagramText) - return smart_ptr(new PPTX::LegacyDiagramText(filename)); - else if (relation.type() == PPTX::FileTypes::VmlDrawing) - return smart_ptr(new PPTX::VmlDrawing(filename, map)); - else if (relation.type() == PPTX::FileTypes::HyperLink) - return smart_ptr(new PPTX::HyperLink(relation.target())); - else if ((relation.type() == PPTX::FileTypes::ExternalImage) && (relation.isExternal())) - return smart_ptr(new PPTX::ExternalImage(relation.target())); - else if ((relation.type() == PPTX::FileTypes::ExternalAudio) && (relation.isExternal())) - return smart_ptr(new PPTX::ExternalAudio(relation.target())); - else if ((relation.type() == PPTX::FileTypes::ExternalVideo) && (relation.isExternal())) - return smart_ptr(new PPTX::ExternalVideo(relation.target())); - else if (relation.type() == PPTX::FileTypes::Image) - return smart_ptr(new PPTX::Image(filename)); - else if (relation.type() == PPTX::FileTypes::Audio) - return smart_ptr(new PPTX::Audio(filename)); - else if (relation.type() == PPTX::FileTypes::Video) - return smart_ptr(new PPTX::Video(filename)); - else if (relation.type() == PPTX::FileTypes::Media) // FOR NONE OPTIMIZED PPTX FILES - return smart_ptr(new PPTX::HyperLink(filename)); - else if (relation.type() == PPTX::FileTypes::Data) // нужен только filepath - return smart_ptr(new PPTX::Image(filename)); - else if (relation.type() == PPTX::FileTypes::DrawingDiag) - return smart_ptr(new PPTX::Image(filename)); // нужен только filepath - else if (relation.type() == PPTX::FileTypes::Chart) - return smart_ptr(new PPTX::Image(filename)); // нужен только filepath - else if (relation.type() == PPTX::FileTypes::CommentAuthors) - return smart_ptr(new PPTX::Authors(filename, map)); - else if (relation.type() == PPTX::FileTypes::SlideComments) - return smart_ptr(new PPTX::Comments(filename, map)); - else if (relation.type() == PPTX::FileTypes::OleObject) - return smart_ptr(new PPTX::OleObject(filename)); + if (relation.type() == OOX::Presentation::FileTypes::App) + return smart_ptr(new PPTX::App(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::Core) + return smart_ptr(new PPTX::Core(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::Presentation) + return smart_ptr(new PPTX::Presentation(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::Theme) + return smart_ptr(new PPTX::Theme(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::SlideMaster) + return smart_ptr(new PPTX::SlideMaster(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::SlideLayout) + return smart_ptr(new PPTX::SlideLayout(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::Slide) + return smart_ptr(new PPTX::Slide(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::HandoutMaster) + return smart_ptr(new PPTX::HandoutMaster(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::NotesMaster) + return smart_ptr(new PPTX::NotesMaster(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::NotesSlide) + return smart_ptr(new PPTX::NotesSlide(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::PresProps) + return smart_ptr(new PPTX::PresProps(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::ViewProps) + return smart_ptr(new PPTX::ViewProps(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::TableStyles) + return smart_ptr(new PPTX::TableStyles(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::LegacyDiagramText) + return smart_ptr(new PPTX::LegacyDiagramText(filename)); + else if (relation.type() == OOX::Presentation::FileTypes::VmlDrawing) + return smart_ptr(new PPTX::VmlDrawing(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::Media) // FOR NONE OPTIMIZED PPTX FILES + return smart_ptr(new OOX::HyperLink(filename)); + else if (relation.type() == OOX::FileTypes::Chart) + return smart_ptr(new OOX::Image(filename)); // нужен только filepath + else if (relation.type() == OOX::Presentation::FileTypes::CommentAuthors) + return smart_ptr(new PPTX::Authors(filename, map)); + else if (relation.type() == OOX::Presentation::FileTypes::SlideComments) + return smart_ptr(new PPTX::Comments(filename, map)); - return smart_ptr(new PPTX::UnknowTypeFile()); + else if (relation.type() == OOX::FileTypes::HyperLink) + return smart_ptr(new OOX::HyperLink(relation.target())); + else if ((relation.type() == OOX::FileTypes::ExternalImage) && (relation.isExternal())) + return smart_ptr(new OOX::ExternalImage(relation.target())); + else if ((relation.type() == OOX::FileTypes::ExternalAudio) && (relation.isExternal())) + return smart_ptr(new OOX::ExternalAudio(relation.target())); + else if ((relation.type() == OOX::FileTypes::ExternalVideo) && (relation.isExternal())) + return smart_ptr(new OOX::ExternalVideo(relation.target())); + else if (relation.type() == OOX::FileTypes::Image) + return smart_ptr(new OOX::Image(filename)); + else if (relation.type() == OOX::FileTypes::Audio) + return smart_ptr(new OOX::Audio(filename)); + else if (relation.type() == OOX::FileTypes::Video) + return smart_ptr(new OOX::Video(filename)); + else if (relation.type() == OOX::FileTypes::Data) + return smart_ptr(new OOX::CDiagramData(filename)); + else if (relation.type() == OOX::FileTypes::DiagDrawing) // нужен только filepath + return smart_ptr(new OOX::Image(filename)); // нужен только filepath + else if (relation.type() == OOX::FileTypes::OleObject) + return smart_ptr(new OOX::OleObject(filename)); + + return smart_ptr(new OOX::UnknowTypeFile()); } - const smart_ptr FileFactory::CreateFilePPTX_OnlyMedia(const OOX::CPath& path, const PPTX::Rels::RelationShip& relation) + const smart_ptr FileFactory::CreateFilePPTX_OnlyMedia(const OOX::CPath& path, const PPTX::Rels::RelationShip& relation) { bool bIsDownload = false; std::wstring strFile = relation.filename().GetPath(); @@ -154,23 +156,25 @@ namespace PPTX std::wstring strT = relation.type(); - if (strT == PPTX::FileTypes::Image || - strT == PPTX::FileTypes::Data || - strT == PPTX::FileTypes::DrawingDiag || - strT == PPTX::FileTypes::Chart) + if (strT == OOX::FileTypes::Image || + strT == OOX::FileTypes::DiagDrawing || + strT == OOX::FileTypes::Chart) { - return smart_ptr(new PPTX::Image(filename)); + return smart_ptr(new OOX::Image(filename)); } - else if(strT == PPTX::FileTypes::HyperLink) - return smart_ptr(new PPTX::HyperLink(relation.target())); - - else if(strT == PPTX::FileTypes::LegacyDiagramText) - return smart_ptr(new PPTX::LegacyDiagramText(filename)); + else if(strT == OOX::FileTypes::Data) + return smart_ptr(new OOX::CDiagramData(relation.target())); - else if(strT == PPTX::FileTypes::OleObject) - return smart_ptr(new PPTX::OleObject(filename)); + else if(strT == OOX::FileTypes::HyperLink) + return smart_ptr(new OOX::HyperLink(relation.target())); - return smart_ptr(new PPTX::UnknowTypeFile()); + else if(strT == OOX::FileTypes::LegacyDiagramText) + return smart_ptr(new PPTX::LegacyDiagramText(filename)); + + else if(strT == OOX::FileTypes::OleObject) + return smart_ptr(new OOX::OleObject(filename)); + + return smart_ptr(new OOX::UnknowTypeFile()); } } // namespace PPTX diff --git a/ASCOfficePPTXFile/PPTXFormat/FileFactory.h b/ASCOfficePPTXFile/PPTXFormat/FileFactory.h index 15ac772ed9..c09cc87def 100644 --- a/ASCOfficePPTXFile/PPTXFormat/FileFactory.h +++ b/ASCOfficePPTXFile/PPTXFormat/FileFactory.h @@ -33,7 +33,7 @@ #ifndef PPTX_FILE_FACTORY_INCLUDE_H_ #define PPTX_FILE_FACTORY_INCLUDE_H_ -#include "DocxFormat/File.h" +#include "../../Common/DocxFormat/Source/DocxFormat/File.h" //namespace PPTX {class File;} namespace PPTX {namespace Rels {class RelationShip;}} @@ -43,8 +43,8 @@ namespace PPTX class FileFactory { public: - static const smart_ptr CreateFilePPTX(const OOX::CPath& path, const PPTX::Rels::RelationShip& relation, FileMap& map); - static const smart_ptr CreateFilePPTX_OnlyMedia(const OOX::CPath& path, const PPTX::Rels::RelationShip& relation); + static const smart_ptr CreateFilePPTX(const OOX::CPath& path, const PPTX::Rels::RelationShip& relation, FileMap& map); + static const smart_ptr CreateFilePPTX_OnlyMedia(const OOX::CPath& path, const PPTX::Rels::RelationShip& relation); }; } // namespace PPTX diff --git a/ASCOfficePPTXFile/PPTXFormat/FileMap.h b/ASCOfficePPTXFile/PPTXFormat/FileMap.h index a92c3977c8..867c05a1a0 100644 --- a/ASCOfficePPTXFile/PPTXFormat/FileMap.h +++ b/ASCOfficePPTXFile/PPTXFormat/FileMap.h @@ -33,7 +33,9 @@ #ifndef PPTX_FILEMAP_INCLUDE_H_ #define PPTX_FILEMAP_INCLUDE_H_ -#include "DocxFormat/File.h" +#include "../../Common/DocxFormat/Source/DocxFormat/File.h" +#include "../../Common/DocxFormat/Source/DocxFormat/ContentTypes.h" +#include "DocxFormat/Rels/File.h" #include @@ -51,16 +53,16 @@ namespace PPTX } public: - std::map> m_map; + std::map> m_map; public: - AVSINLINE std::map>::const_iterator find(const OOX::CPath& path) + AVSINLINE std::map>::const_iterator find(const OOX::CPath& path) { return m_map.find(path.m_strFilename); } - AVSINLINE void add(const OOX::CPath& key, const smart_ptr& value) + AVSINLINE void add(const OOX::CPath& key, const smart_ptr& value) { m_map[key.m_strFilename] = value; } diff --git a/ASCOfficePPTXFile/PPTXFormat/Folder.cpp b/ASCOfficePPTXFile/PPTXFormat/Folder.cpp index 1bb1e8670d..ac414db5cd 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Folder.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Folder.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "Folder.h" #include "DocxFormat/Rels/File.h" @@ -70,17 +70,17 @@ namespace PPTX if(m_bCancelled && percent < 1000000) return; - smart_ptr _presentation = FileContainer::get(PPTX::FileTypes::Presentation).smart_dynamic_cast(); + smart_ptr _presentation = FileContainer::Get(OOX::Presentation::FileTypes::Presentation).smart_dynamic_cast(); if (_presentation.is_init()) { - _presentation->commentAuthors = _presentation->get(PPTX::FileTypes::CommentAuthors).smart_dynamic_cast(); + _presentation->commentAuthors = _presentation->Get(OOX::Presentation::FileTypes::CommentAuthors).smart_dynamic_cast(); } - for (std::map>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair) + for (std::map>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair) { - const PPTX::FileType& curType = pPair->second->type(); + const OOX::FileType& curType = pPair->second->type(); - if (PPTX::FileTypes::ThemePPTX == curType) + if (OOX::Presentation::FileTypes::ThemePPTX == curType) { smart_ptr pTheme = pPair->second.smart_dynamic_cast(); if (pTheme.IsInit()) @@ -88,11 +88,11 @@ namespace PPTX } } - for (std::map>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair) + for (std::map>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair) { - const PPTX::FileType& curType = pPair->second->type(); + const OOX::FileType& curType = pPair->second->type(); - if (PPTX::FileTypes::SlideMaster == curType) + if (OOX::Presentation::FileTypes::SlideMaster == curType) { smart_ptr pointer = pPair->second.smart_dynamic_cast(); if (pointer.is_init()) @@ -102,11 +102,11 @@ namespace PPTX } - for (std::map>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair) + for (std::map>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair) { - const PPTX::FileType& curType = pPair->second->type(); + const OOX::FileType& curType = pPair->second->type(); - if (PPTX::FileTypes::SlideLayout == curType) + if (OOX::Presentation::FileTypes::SlideLayout == curType) { smart_ptr pointer = pPair->second.smart_dynamic_cast(); if (pointer.is_init()) @@ -115,11 +115,11 @@ namespace PPTX } - for (std::map>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair) + for (std::map>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair) { - const PPTX::FileType& curType = pPair->second->type(); + const OOX::FileType& curType = pPair->second->type(); - if (PPTX::FileTypes::Slide == curType) + if (OOX::Presentation::FileTypes::Slide == curType) { smart_ptr pointer = pPair->second.smart_dynamic_cast(); if (pointer.is_init()) @@ -128,10 +128,11 @@ namespace PPTX } - for (std::map>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair) + for (std::map>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair) { - const PPTX::FileType& curType = pPair->second->type(); - if (PPTX::FileTypes::NotesMaster == curType) + const OOX::FileType& curType = pPair->second->type(); + + if (OOX::Presentation::FileTypes::NotesMaster == curType) { smart_ptr pointer = pPair->second.smart_dynamic_cast(); if (pointer.is_init()) @@ -147,13 +148,13 @@ namespace PPTX OOX::CSystemUtility::CreateDirectories(path); PPTX::Rels::File rels; - PPTX::ContentTypes::File content; + OOX::CContentTypes content; OOX::CPath dir = path; FileContainer::write(rels, path, dir, content); rels.write(path / FILE_SEPARATOR_STR); - content.write(path); + content.Write(path); FileContainer::WrittenSetFalse(); } @@ -164,13 +165,13 @@ namespace PPTX const bool Folder::isValid(const OOX::CPath& path) const { - return true;//FileContainer::exist(PPTX::FileTypes::Presentation); + return true;//FileContainer::exist(OOX::Presentation::FileTypes::Presentation); } void Folder::extractPictures(const OOX::CPath& path) { OOX::CSystemUtility::CreateDirectories(path); - FileContainer::extractPictures(path); + FileContainer::ExtractPictures(path); } void Folder::extractPictures(const OOX::CPath& source, const OOX::CPath& path) diff --git a/ASCOfficePPTXFile/PPTXFormat/Folder.h b/ASCOfficePPTXFile/PPTXFormat/Folder.h index 226016c6d3..291850b2f0 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Folder.h +++ b/ASCOfficePPTXFile/PPTXFormat/Folder.h @@ -34,7 +34,7 @@ #define PPTX_FOLDER_INCLUDE_H_ #include "FileContainer.h" -#include "DocxFormat/RId.h" +#include "../../Common/DocxFormat/Source/DocxFormat/RId.h" namespace PPTX { diff --git a/ASCOfficePPTXFile/PPTXFormat/HandoutMaster.h b/ASCOfficePPTXFile/PPTXFormat/HandoutMaster.h index 2d8d78ecaa..15d0efcd34 100644 --- a/ASCOfficePPTXFile/PPTXFormat/HandoutMaster.h +++ b/ASCOfficePPTXFile/PPTXFormat/HandoutMaster.h @@ -76,7 +76,7 @@ namespace PPTX if (hf.is_init()) hf->SetParentFilePointer(this); } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { XmlUtils::CAttribute oAttr; oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink); @@ -91,16 +91,16 @@ namespace PPTX XmlUtils::SaveToFile(filename.m_strFilename, XmlUtils::CreateNode(_T("p:handoutMaster"), oAttr, oValue)); - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName = filename.GetFilename(); FileContainer::write(filename, directory, content); } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::HandoutMaster; + return OOX::Presentation::FileTypes::HandoutMaster; } virtual const OOX::CPath DefaultDirectory() const { diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Bg.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/Bg.cpp index adfa22304a..42ab53b800 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Bg.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Bg.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "Bg.h" #include "../Slide.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SchemeClr.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SchemeClr.cpp index 423e47b6c3..b983141369 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SchemeClr.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SchemeClr.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "SchemeClr.h" #include "./../../Slide.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Controls.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Controls.h index fee734db6d..7704314613 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Controls.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Controls.h @@ -106,7 +106,7 @@ namespace PPTX nullable_bool showAsIcon; nullable> height; nullable> width; - nullable rId; + nullable rId; nullable pic; /// todooo diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.cpp index c8d2121470..58e9ef1e97 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "CxnSp.h" #include "SpTree.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/ExtP.h b/ASCOfficePPTXFile/PPTXFormat/Logic/ExtP.h index 217a50ce67..8d3bf2e7ed 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/ExtP.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/ExtP.h @@ -33,7 +33,7 @@ #define PPTX_LOGIC_EXTP_PROPERTIES_INCLUDE_H_ #include "./../WrapperWritingElement.h" -#include "../DocxFormat/RId.h" +#include "../../../Common/DocxFormat/Source/DocxFormat/RId.h" /* @@ -97,7 +97,7 @@ namespace PPTX public: - PPTX::RId link; + OOX::RId link; // trim nullable_double st; diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.cpp index 3af1e282f3..eecf460ab5 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "Blip.h" #include "./../../Slide.h" @@ -85,7 +85,7 @@ namespace PPTX { if (pRels != NULL) { - smart_ptr p = pRels->image(*embed); + smart_ptr p = pRels->GetImage(*embed); if (p.is_init()) return p->filename().m_strFilename; } @@ -104,7 +104,7 @@ namespace PPTX { if (pRels != NULL) { - smart_ptr p = pRels->image(*link); + smart_ptr p = pRels->GetImage(*link); if (p.is_init()) return p->filename().m_strFilename; } @@ -121,11 +121,11 @@ namespace PPTX } return _T(""); } - std::wstring Blip::GetFullOleName(const PPTX::RId& oRId, FileContainer* pRels)const + std::wstring Blip::GetFullOleName(const OOX::RId& oRId, FileContainer* pRels)const { if (pRels != NULL) { - smart_ptr p = pRels->oleObject(oRId); + smart_ptr p = pRels->GetOleObject(oRId); if (p.is_init()) return p->filename().m_strFilename; } diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.h index e8fa36f9bf..9597fb70ea 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.h @@ -36,7 +36,7 @@ #include "./../../WrapperWritingElement.h" #include "./../../Limit/BlipCompression.h" #include "./../UniEffect.h" -#include "../../DocxFormat/RId.h" +#include "../../../../Common/DocxFormat/Source/DocxFormat/RId.h" namespace PPTX { @@ -142,7 +142,7 @@ namespace PPTX } else if(!oleRid.empty()) { - olePath= this->GetFullOleName(PPTX::RId(oleRid), pRels); + olePath= this->GetFullOleName(OOX::RId(oleRid), pRels); } NSShapeImageGen::CImageInfo oId = pWriter->m_pCommon->m_pImageManager->WriteImage(this->GetFullPicName(pRels), olePath, dX, dY, dW, dH); @@ -158,14 +158,14 @@ namespace PPTX } public: virtual std::wstring GetFullPicName(FileContainer* pRels = NULL)const; - virtual std::wstring GetFullOleName(const PPTX::RId& pRId, FileContainer* pRels = NULL)const; + virtual std::wstring GetFullOleName(const OOX::RId& pRId, FileContainer* pRels = NULL)const; public: std::vector Effects; nullable_limit cstate; - nullable embed; - nullable link; + nullable embed; + nullable link; //private: public: std::wstring m_namespace; diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h index 408df7deff..7ec677a553 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h @@ -407,11 +407,11 @@ namespace PPTX if (!blip.is_init()) blip = new PPTX::Logic::Blip(); - blip->embed = new PPTX::RId((size_t)oRelsGeneratorInfo.m_nImageRId); + blip->embed = new OOX::RId((size_t)oRelsGeneratorInfo.m_nImageRId); if(oRelsGeneratorInfo.m_nOleRId > 0) { - blip->oleRid = PPTX::RId((size_t)oRelsGeneratorInfo.m_nOleRId).get(); + blip->oleRid = OOX::RId((size_t)oRelsGeneratorInfo.m_nOleRId).get(); blip->oleFilepathBin = oRelsGeneratorInfo.m_sFilepathBin; blip->oleFilepathImg = oRelsGeneratorInfo.m_sFilepathImg; blip->oleRidImg = blip->embed->get(); diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp index da24f76d18..12342381b3 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "GraphicFrame.h" #include "SpTree.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.h b/ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.h index f2510044f0..e0c0322723 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.h @@ -37,7 +37,6 @@ #include "NvGraphicFramePr.h" #include "Xfrm.h" #include "ShapeProperties.h" -//#include "DocxFormat/RId.h" #include "Table/Table.h" #include "SmartArt.h" #include "Pic.h" @@ -68,11 +67,7 @@ namespace PPTX public: NvGraphicFramePr nvGraphicFramePr; Xfrm xfrm; - //property grpahic; - //nullable_property dm; - //nullable_property lo; - //nullable_property qs; - //nullable_property cs; + nullable_string spid; nullable table; nullable smartArt; diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Hyperlink.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/Hyperlink.cpp index 6eddc5b298..387b878367 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Hyperlink.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Hyperlink.cpp @@ -45,12 +45,12 @@ namespace PPTX { if(id.IsInit() && *id != _T("")) { - PPTX::RId rid(*id); + OOX::RId rid(*id); std::wstring sLink = _T(""); if (pRels != NULL) { - smart_ptr p = pRels->hyperlink(rid); + smart_ptr p = pRels->GetHyperlink(rid); if (p.is_init()) sLink = p->Uri().m_strFilename; } diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Hyperlink.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Hyperlink.h index ca9238161e..94f266bccb 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Hyperlink.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Hyperlink.h @@ -34,7 +34,7 @@ #define PPTX_LOGIC_HYPERLINK_INCLUDE_H_ #include "./../WrapperWritingElement.h" -#include "../DocxFormat/RId.h" +#include "../../../Common/DocxFormat/Source/DocxFormat/RId.h" #include "Media/WavAudioFile.h" namespace PPTX @@ -210,7 +210,7 @@ namespace PPTX public: nullable snd; - nullable_string id;// id;// + nullable_string id;// id;// nullable_string invalidUrl;//default="" nullable_string action;//default="" nullable_string tgtFrame;//default="" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Media/MediaFile.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Media/MediaFile.h index aaafa93db7..f102c9addf 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Media/MediaFile.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Media/MediaFile.h @@ -34,7 +34,7 @@ #define PPTX_LOGIC_MEDIAFILE_INCLUDE_H_ #include "../../WrapperWritingElement.h" -#include "../../DocxFormat/RId.h" +#include "../../../../Common/DocxFormat/Source/DocxFormat/RId.h" namespace PPTX { @@ -76,7 +76,7 @@ namespace PPTX } public: std::wstring name; - PPTX::RId link; + OOX::RId link; nullable_string contentType; protected: virtual void FillParentPointersForChilds(){}; diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Media/WavAudioFile.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Media/WavAudioFile.h index e2ae218cb2..cbc57c3054 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Media/WavAudioFile.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Media/WavAudioFile.h @@ -34,7 +34,7 @@ #define PPTX_LOGIC_WAVAUDIOFILE_INCLUDE_H_ #include "../../WrapperWritingElement.h" -#include "../../DocxFormat/RId.h" +#include "../../../../Common/DocxFormat/Source/DocxFormat/RId.h" namespace PPTX { @@ -87,7 +87,7 @@ namespace PPTX public: nullable_string name; - PPTX::RId embed; + OOX::RId embed; public: std::wstring m_name; protected: diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Pic.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/Pic.cpp index 39c0149746..8dca6b6576 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Pic.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Pic.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "Pic.h" #include "SpTree.h" @@ -141,7 +141,7 @@ namespace PPTX if (pWriter->m_pCommonRels->is_init()) pRels = pWriter->m_pCommonRels->operator ->(); - sFilePath = this->GetFullOleName(PPTX::RId(m_oId.get()), pRels); + sFilePath = this->GetFullOleName(OOX::RId(m_oId.get()), pRels); } if(!sFilePath.empty()) { @@ -220,11 +220,11 @@ namespace PPTX return m_sProgId.IsInit() && (m_sData.IsInit() || m_oId.IsInit() || m_sFilepathBin.IsInit()); } - std::wstring COLEObject::GetFullOleName(const PPTX::RId& oRId, FileContainer* pRels)const + std::wstring COLEObject::GetFullOleName(const OOX::RId& oRId, FileContainer* pRels)const { if (pRels != NULL) { - smart_ptr p = pRels->oleObject(oRId); + smart_ptr p = pRels->GetOleObject(oRId); if (p.is_init()) return p->filename().m_strFilename; } diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Pic.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Pic.h index 2dfb9edec4..3b8828d90f 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Pic.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Pic.h @@ -190,13 +190,13 @@ namespace PPTX virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader); virtual void FillParentPointersForChilds(); bool isValid(); - std::wstring GetFullOleName(const PPTX::RId& oRId, FileContainer* pRels)const; + std::wstring GetFullOleName(const OOX::RId& oRId, FileContainer* pRels)const; std::wstring GetOleData(const std::wstring& sFilePath)const; public: // Attributes nullable_limit m_oDrawAspect; - nullable m_oId; + nullable m_oId; nullable_string m_sObjectId; nullable_string m_sProgId; nullable_string m_sShapeId; @@ -207,7 +207,7 @@ namespace PPTX nullable_string m_sData; nullable_string m_sFilepathBin; nullable_string m_sFilepathImg; - nullable m_oIdImg; + nullable m_oIdImg; nullable_int m_oDxaOrig; nullable_int m_oDyaOrig; }; @@ -390,10 +390,10 @@ namespace PPTX } if(blipFill.blip.IsInit() && !blipFill.blip->oleRid.empty() && oleObject.IsInit()) { - oleObject->m_oId = PPTX::RId(blipFill.blip->oleRid); + oleObject->m_oId = OOX::RId(blipFill.blip->oleRid); oleObject->m_sFilepathBin = blipFill.blip->oleFilepathBin; oleObject->m_sFilepathImg = blipFill.blip->oleFilepathImg; - oleObject->m_oIdImg = PPTX::RId(blipFill.blip->oleRidImg); + oleObject->m_oIdImg = OOX::RId(blipFill.blip->oleRidImg); } pReader->Seek(_end_rec); diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Shape.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/Shape.cpp index 3864ce4927..5818dd375a 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Shape.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Shape.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "Shape.h" #include "./../SlideLayout.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/ShapeProperties.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/ShapeProperties.cpp index cd3e3a9698..fc00a12607 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/ShapeProperties.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/ShapeProperties.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "ShapeProperties.h" #include "Fills/SolidFill.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/ShapeTextProperties.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/ShapeTextProperties.cpp index aaded97bbb..b1104b5ad3 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/ShapeTextProperties.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/ShapeTextProperties.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "ShapeTextProperties.h" #include "Fills/SolidFill.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/SmartArt.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/SmartArt.cpp index b55809fb3d..909d901bb6 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/SmartArt.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/SmartArt.cpp @@ -29,15 +29,15 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "stdafx.h" -#include "./SmartArt.h" +#include "SmartArt.h" #include "../Slide.h" #include "../SlideLayout.h" #include "../SlideMaster.h" #include "../../ASCOfficeDrawingConverter.h" #include "../../../ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.h" +#include "../../../Common/DocxFormat/Source/DocxFormat/Diagram/DiagramData.h" namespace PPTX { @@ -45,125 +45,97 @@ namespace PPTX { void SmartArt::LoadDrawing(NSBinPptxRW::CBinaryFileWriter* pWriter) { - std::wstring strDataPath; - FileContainer* pRels = NULL; if (pWriter->m_pCommonRels->is_init()) pRels = pWriter->m_pCommonRels->operator ->(); + smart_ptr oFile; if(id_data.IsInit()) { if(parentFileIs()) - strDataPath = parentFileAs().GetMediaFullPathNameFromRId(*id_data); + oFile = parentFileAs().Find(*id_data); else if(parentFileIs()) - strDataPath = parentFileAs().GetMediaFullPathNameFromRId(*id_data); + oFile = parentFileAs().Find(*id_data); else if(parentFileIs()) - strDataPath = parentFileAs().GetMediaFullPathNameFromRId(*id_data); + oFile = parentFileAs().Find(*id_data); else if(parentFileIs()) - strDataPath = parentFileAs().GetMediaFullPathNameFromRId(*id_data); + oFile = parentFileAs().Find(*id_data); else if (pRels != NULL) - { - smart_ptr p = pRels->image(*id_data); - if (p.is_init()) - strDataPath = p->filename().m_strFilename; - } + oFile = pRels->Find(*id_data); } + nullable id_drawing; + + std::wstring strPathDiagramDrawing; - if (strDataPath.empty()) - return; - - nullable id_drawing; - - XmlUtils::CXmlNode oNode; - if (oNode.FromXmlFile(strDataPath) == false) return; - - XmlUtils::CXmlNode oNode2 = oNode.ReadNode(L"dgm:extLst"); - if (oNode2.IsValid()) + if (oFile.is_init()) { - XmlUtils::CXmlNode oNode3 = oNode2.ReadNode(L"a:ext"); - if (oNode3.IsValid()) + OOX::CDiagramData* pDiagramData = (OOX::CDiagramData*)oFile.operator->(); + + if ((pDiagramData) && (pDiagramData->m_oExtLst.IsInit())) { - //https://msdn.microsoft.com/library/documentformat.openxml.office.drawing.datamodelextensionblock.aspx - XmlUtils::CXmlNode oNode4 = oNode3.ReadNode(L"dsp:dataModelExt"); - if (oNode4.IsValid()) + for (int i = 0; i < pDiagramData->m_oExtLst->m_arrExt.size(); i++) { - oNode4.ReadAttributeBase(L"relId", id_drawing); - } - } - } - - if (id_drawing.is_init()) - { - std::wstring strDWPath; - - if(parentFileIs()) - strDWPath = parentFileAs().GetMediaFullPathNameFromRId(*id_drawing); - else if(parentFileIs()) - strDWPath = parentFileAs().GetMediaFullPathNameFromRId(*id_drawing); - else if(parentFileIs()) - strDWPath = parentFileAs().GetMediaFullPathNameFromRId(*id_drawing); - else if(parentFileIs()) - strDWPath = parentFileAs().GetMediaFullPathNameFromRId(*id_drawing); - else if (pRels != NULL) - { - smart_ptr p = pRels->image(*id_drawing); - if (p.is_init()) - strDWPath = p->filename().m_strFilename; - } - - - if (!strDWPath.empty()) - { - XmlUtils::CXmlNode oNodeDW; - if (oNodeDW.FromXmlFile(strDWPath)) - { - XmlUtils::CXmlNode oNodeS = oNodeDW.ReadNodeNoNS(L"spTree"); - - if (oNodeS.IsValid()) + if (pDiagramData->m_oExtLst->m_arrExt[i]->m_oDataModelExt.IsInit()) { - m_diag = oNodeS; - - CCommonRels* pRels = new CCommonRels(); - OOX::CPath filename = strDWPath; - pRels->_read(filename); - - m_oCommonRels = pRels; - - return; + id_drawing = pDiagramData->m_oExtLst->m_arrExt[i]->m_oDataModelExt->m_oRelId; + break; } } } - } - //Monetizing_Innovation.pptx (слайд 13) - diagrams/data1.xml не ссылается на diagrams/drawing1.xml - //пробуем по тому же пути с номером data.xml - // easy4cargo1.pptx - слайд 2 - в диаграмме Smart вместо ссылки на drawing.xml ссылка на стороннюю картинку - - OOX::CPath pathDiagramData = strDataPath; - - int a1 = pathDiagramData.GetFilename().find(L"."); - std::wstring strId = pathDiagramData.GetFilename().substr(4,pathDiagramData.GetFilename().length() - 8); - - OOX::CPath pathDiagramDrawing = pathDiagramData.GetDirectory() + FILE_SEPARATOR_STR + L"drawing" + strId + L".xml"; - - XmlUtils::CXmlNode oNodeDW; - if (oNodeDW.FromXmlFile(pathDiagramDrawing.GetPath()))//todooo ... сделать отдельно .. повтор - { - XmlUtils::CXmlNode oNodeS = oNodeDW.ReadNodeNoNS(L"spTree"); - - if (oNodeS.IsValid()) + if (id_drawing.is_init()) { - m_diag = oNodeS; + if(parentFileIs()) + strPathDiagramDrawing = parentFileAs().GetMediaFullPathNameFromRId(*id_drawing); + else if(parentFileIs()) + strPathDiagramDrawing = parentFileAs().GetMediaFullPathNameFromRId(*id_drawing); + else if(parentFileIs()) + strPathDiagramDrawing = parentFileAs().GetMediaFullPathNameFromRId(*id_drawing); + else if(parentFileIs()) + strPathDiagramDrawing = parentFileAs().GetMediaFullPathNameFromRId(*id_drawing); + else if (pRels != NULL) + { + smart_ptr p = pRels->GetImage(*id_drawing); + if (p.is_init()) + strPathDiagramDrawing = p->filename().m_strFilename; + } + } + else + { + //Monetizing_Innovation.pptx (слайд 13) - diagrams/data1.xml не ссылается на diagrams/drawing1.xml + //пробуем по тому же пути с номером data.xml + // easy4cargo1.pptx - слайд 2 - в диаграмме Smart вместо ссылки на drawing.xml ссылка на стороннюю картинку + OOX::CPath pathDiagramData = pDiagramData->m_strFilename; - CCommonRels* pRels = new CCommonRels(); - pRels->_read(pathDiagramDrawing); - - m_oCommonRels = pRels; - - return; + int a1 = pathDiagramData.GetFilename().find(L"."); + std::wstring strId = pathDiagramData.GetFilename().substr(4, pathDiagramData.GetFilename().length() - 8); + + OOX::CPath pathDiagramDrawing = pathDiagramData.GetDirectory() + FILE_SEPARATOR_STR + L"drawing" + strId + L".xml"; + + strPathDiagramDrawing = pathDiagramDrawing.GetPath(); } } + if (!strPathDiagramDrawing.empty()) + { + XmlUtils::CXmlNode oNodeDW; + if (oNodeDW.FromXmlFile(strPathDiagramDrawing)) + { + XmlUtils::CXmlNode oNodeS = oNodeDW.ReadNodeNoNS(L"spTree"); + if (oNodeS.IsValid()) + { + m_diag = oNodeS; + + CCommonRels* pRels = new CCommonRels(); + OOX::CPath filename = strPathDiagramDrawing; + pRels->_read(filename); + + m_oCommonRels = pRels; + + return; + } + } + } } void ChartRec::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const @@ -172,7 +144,7 @@ namespace PPTX if (pWriter->m_pCommonRels->is_init()) pRels = pWriter->m_pCommonRels->operator ->(); - std::wstring strDataPath = _T(""); + std::wstring strDataPath = L""; if(id_data.IsInit()) { if(parentFileIs()) @@ -185,7 +157,7 @@ namespace PPTX strDataPath = parentFileAs().GetMediaFullPathNameFromRId(*id_data); else if (pRels != NULL) { - smart_ptr p = pRels->image(*id_data); + smart_ptr p = pRels->GetImage(*id_data); if (p.is_init()) strDataPath = p->filename().m_strFilename; } @@ -269,7 +241,7 @@ xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" oDrawingConverter.m_pReader = pOldReader; oDrawingConverter.m_pImageManager = pOldImageManager; - id_data = new PPTX::RId((size_t)lId); + id_data = new OOX::RId((size_t)lId); } } // namespace Logic } // namespace PPTX diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/SmartArt.h b/ASCOfficePPTXFile/PPTXFormat/Logic/SmartArt.h index 4ea78de9e8..94ce6bbc8b 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/SmartArt.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/SmartArt.h @@ -88,7 +88,7 @@ namespace PPTX public: - nullable id_data; + nullable id_data; nullable m_diag; smart_ptr m_oCommonRels; @@ -158,7 +158,7 @@ namespace PPTX public: - nullable id_data; + nullable id_data; LONG m_lChartNumber; bool m_bData; diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.cpp index 42e7190c26..26e37bc96a 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "SpPr.h" #include "PrstGeom.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/SpTreeElem.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/SpTreeElem.cpp index 4e94ddc789..41f25594ba 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/SpTreeElem.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/SpTreeElem.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "SpTreeElem.h" #include "Shape.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Table/TableCell.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/Table/TableCell.cpp index afbfea0dce..ada59f58a0 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Table/TableCell.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Table/TableCell.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "TableCell.h" #include "../../Slide.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/BuildNodeBase.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/BuildNodeBase.cpp index 8452c48a37..d46ba4f983 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/BuildNodeBase.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/BuildNodeBase.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "BuildNodeBase.h" #include "BldP.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/TgtEl.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/TgtEl.h index be96b8fea3..f85664cffe 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/TgtEl.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/TgtEl.h @@ -34,7 +34,7 @@ #define PPTX_LOGIC_TGTEL_INCLUDE_H_ #include "./../../WrapperWritingElement.h" -#include "../../DocxFormat/RId.h" +#include "../../../../Common/DocxFormat/Source/DocxFormat/RId.h" #include "SpTgt.h" namespace PPTX @@ -93,7 +93,7 @@ namespace PPTX //sndTgt nullable_string name; - nullable embed; + nullable embed; nullable_bool builtIn; nullable spTgt; diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/TimeNodeBase.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/TimeNodeBase.cpp index baf3111483..515e9c0c7f 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/TimeNodeBase.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/TimeNodeBase.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "TimeNodeBase.h" #include "Seq.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/StSnd.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/StSnd.h index d617ee20a0..9114fbecb2 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/StSnd.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/StSnd.h @@ -34,7 +34,7 @@ #define PPTX_SLIDES_STSND_INCLUDE_H_ #include "./../../WrapperWritingElement.h" -#include "../../DocxFormat/RId.h" +#include "../../../../Common/DocxFormat/Source/DocxFormat/RId.h" namespace PPTX { @@ -73,7 +73,7 @@ namespace PPTX } public: - PPTX::RId embed; + OOX::RId embed; nullable_string name; nullable_bool loop; protected: diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/TransitionBase.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/TransitionBase.cpp index fc532bc408..0c3fc8aeeb 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/TransitionBase.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/TransitionBase.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "TransitionBase.h" #include "EmptyTransition.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/UniColor.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/UniColor.cpp index 734f6edbe6..126a0bde15 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/UniColor.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/UniColor.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "UniColor.h" #include "Colors/SrgbClr.h" diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/UniEffect.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/UniEffect.cpp index 3bc9d9f5c6..03310bd875 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/UniEffect.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/UniEffect.cpp @@ -29,7 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -//#include "./stdafx.h" + #include "UniEffect.h" #include "Effects/OuterShdw.h" //1 diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/UniFill.h b/ASCOfficePPTXFile/PPTXFormat/Logic/UniFill.h index 78f58442c9..5cd41d1d6e 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/UniFill.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/UniFill.h @@ -394,13 +394,13 @@ namespace PPTX if (!pFill->blip.is_init()) pFill->blip = new PPTX::Logic::Blip(); - pFill->blip->embed = new PPTX::RId((size_t)oRelsGeneratorInfo.m_nImageRId); + pFill->blip->embed = new OOX::RId((size_t)oRelsGeneratorInfo.m_nImageRId); if (pFill->blip.is_init()) pFill->blip->m_namespace = _T("a"); if(oRelsGeneratorInfo.m_nOleRId > 0) { - pFill->blip->oleRid = PPTX::RId((size_t)oRelsGeneratorInfo.m_nOleRId).get(); + pFill->blip->oleRid = OOX::RId((size_t)oRelsGeneratorInfo.m_nOleRId).get(); pFill->blip->oleFilepathBin = oRelsGeneratorInfo.m_sFilepathBin; pFill->blip->oleFilepathImg = oRelsGeneratorInfo.m_sFilepathImg; pFill->blip->oleRidImg = pFill->blip->embed->get(); diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/XmlId.h b/ASCOfficePPTXFile/PPTXFormat/Logic/XmlId.h index c792a8db4e..ee46d14394 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/XmlId.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/XmlId.h @@ -34,7 +34,7 @@ #define PPTX_PPTSLIDES_XMLID_INCLUDE_H_ #include "./../WrapperWritingElement.h" -#include "../DocxFormat/RId.h" +#include "../../../Common/DocxFormat/Source/DocxFormat/RId.h" namespace PPTX { @@ -45,10 +45,9 @@ namespace PPTX public: PPTX_LOGIC_BASE(XmlId) - public: virtual void fromXML(XmlUtils::CXmlNode& node) { - m_name = XmlUtils::GetNameNoNS(node.GetName()); + m_name = XmlUtils::GetNameNoNS(node.GetName()); node.ReadAttributeBase(L"r:id", rid); node.ReadAttributeBase(L"id", id); } @@ -65,7 +64,9 @@ namespace PPTX { pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart); pWriter->WriteString2(0, id); + rid.toPPTY(1, pWriter); + pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd); } @@ -81,11 +82,9 @@ namespace PPTX pWriter->EndNode(_T("p:") + m_name); } - public: nullable_string id; - PPTX::RId rid; - public: - std::wstring m_name; + OOX::RId rid; + std::wstring m_name; protected: virtual void FillParentPointersForChilds(){}; }; diff --git a/ASCOfficePPTXFile/PPTXFormat/NotesMaster.h b/ASCOfficePPTXFile/PPTXFormat/NotesMaster.h index b0fe5b6f39..9c34c281a8 100644 --- a/ASCOfficePPTXFile/PPTXFormat/NotesMaster.h +++ b/ASCOfficePPTXFile/PPTXFormat/NotesMaster.h @@ -79,7 +79,7 @@ namespace PPTX if (notesStyle.is_init()) notesStyle->SetParentFilePointer(this); } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { XmlUtils::CAttribute oAttr; oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink); @@ -95,16 +95,16 @@ namespace PPTX XmlUtils::SaveToFile(filename.m_strFilename, XmlUtils::CreateNode(_T("p:notesMaster"), oAttr, oValue)); - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName = filename.GetFilename(); FileContainer::write(filename, directory, content); } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::NotesMaster; + return OOX::Presentation::FileTypes::NotesMaster; } virtual const OOX::CPath DefaultDirectory() const { @@ -117,12 +117,12 @@ namespace PPTX void ApplyRels() { - theme_= (FileContainer::get(PPTX::FileTypes::ThemePPTX)).smart_dynamic_cast(); + theme_= (FileContainer::Get(OOX::Presentation::FileTypes::ThemePPTX)).smart_dynamic_cast(); if (theme_.IsInit()) theme_->SetColorMap(clrMap); - tableStyles_ = (theme_->presentation->get(PPTX::FileTypes::TableStyles)).smart_dynamic_cast(); + tableStyles_ = (theme_->presentation->Get(OOX::Presentation::FileTypes::TableStyles)).smart_dynamic_cast(); } virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const diff --git a/ASCOfficePPTXFile/PPTXFormat/NotesSlide.h b/ASCOfficePPTXFile/PPTXFormat/NotesSlide.h index 05c99d8175..50a4e414aa 100644 --- a/ASCOfficePPTXFile/PPTXFormat/NotesSlide.h +++ b/ASCOfficePPTXFile/PPTXFormat/NotesSlide.h @@ -73,7 +73,7 @@ namespace PPTX if (clrMapOvr.IsInit()) clrMapOvr->SetParentFilePointer(this); } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { XmlUtils::CAttribute oAttr; oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink); @@ -91,16 +91,16 @@ namespace PPTX XmlUtils::SaveToFile(filename.m_strFilename, XmlUtils::CreateNode(_T("p:notes"), oAttr, oValue)); - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName = filename.GetFilename(); FileContainer::write(filename, directory, content); } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::NotesSlide; + return OOX::Presentation::FileTypes::NotesSlide; } virtual const OOX::CPath DefaultDirectory() const { diff --git a/ASCOfficePPTXFile/PPTXFormat/PresProps.h b/ASCOfficePPTXFile/PPTXFormat/PresProps.h index b03acded17..97e02b1112 100644 --- a/ASCOfficePPTXFile/PPTXFormat/PresProps.h +++ b/ASCOfficePPTXFile/PPTXFormat/PresProps.h @@ -72,7 +72,7 @@ namespace PPTX if(showPr.is_init()) showPr->SetParentFilePointer(this); } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { XmlUtils::CAttribute oAttr; oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink); @@ -85,7 +85,7 @@ namespace PPTX XmlUtils::SaveToFile(filename.m_strFilename, XmlUtils::CreateNode(_T("p:presentationPr"), oAttr, oValue)); - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName = filename.GetFilename(); FileContainer::write(filename, directory, content); @@ -169,9 +169,9 @@ namespace PPTX pReader->Seek(end); } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::PresProps; + return OOX::Presentation::FileTypes::PresProps; } virtual const OOX::CPath DefaultDirectory() const { diff --git a/ASCOfficePPTXFile/PPTXFormat/Presentation.h b/ASCOfficePPTXFile/PPTXFormat/Presentation.h index dede2a2b3e..aab04fb65e 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Presentation.h +++ b/ASCOfficePPTXFile/PPTXFormat/Presentation.h @@ -170,7 +170,7 @@ namespace PPTX Normalize(); } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { XmlUtils::CAttribute oAttr; oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink); @@ -212,7 +212,7 @@ namespace PPTX XmlUtils::SaveToFile(filename.m_strFilename, XmlUtils::CreateNode(_T("p:presentation"), oAttr, oValue)); - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName = filename.GetFilename(); FileContainer::write(filename, directory, content); @@ -408,9 +408,9 @@ namespace PPTX } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::Presentation; + return OOX::Presentation::FileTypes::Presentation; } virtual const OOX::CPath DefaultDirectory() const { diff --git a/ASCOfficePPTXFile/PPTXFormat/Slide.h b/ASCOfficePPTXFile/PPTXFormat/Slide.h index 946ca03eff..1da38630db 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Slide.h +++ b/ASCOfficePPTXFile/PPTXFormat/Slide.h @@ -50,10 +50,10 @@ #include "NotesSlide.h" #include "TableStyles.h" -#include "DocxFormat/Media/Image.h" -#include "DocxFormat/Media/OleObject.h" -#include "DocxFormat/External/External.h" -#include "DocxFormat/External/HyperLink.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Media/Image.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h" +#include "../../Common/DocxFormat/Source/DocxFormat/External/External.h" +#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h" #include "DocxFormat/Drawing/VmlDrawing.h" #include "Comments.h" @@ -129,7 +129,7 @@ namespace PPTX if (timing.IsInit()) timing->SetParentFilePointer(this); } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { XmlUtils::CAttribute oAttr; oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink); @@ -149,16 +149,14 @@ namespace PPTX XmlUtils::SaveToFile(filename.m_strFilename, XmlUtils::CreateNode(_T("p:sld"), oAttr, oValue)); - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName = filename.GetFilename(); FileContainer::write(filename, directory, content); } - - public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::Slide; + return OOX::Presentation::FileTypes::Slide; } virtual const OOX::CPath DefaultDirectory() const { @@ -168,8 +166,7 @@ namespace PPTX { return type().DefaultFileName(); } - - public: +//------------------------------------------------- virtual void FillShapeProperties(Logic::ShapeProperties& props, const std::wstring& type)const { if (Layout.IsInit()) @@ -201,41 +198,41 @@ namespace PPTX } return false; } - virtual std::wstring GetMediaFullPathNameFromRId(const PPTX::RId& rid)const + + virtual std::wstring GetMediaFullPathNameFromRId(const OOX::RId& rid)const { - smart_ptr p = image(rid); + smart_ptr p = GetImage(rid); if (!p.is_init()) return _T(""); return p->filename().m_strFilename; } - virtual std::wstring GetFullHyperlinkNameFromRId(const PPTX::RId& rid)const + virtual std::wstring GetFullHyperlinkNameFromRId(const OOX::RId& rid)const { - smart_ptr p = hyperlink(rid); + smart_ptr p = GetHyperlink(rid); if (!p.is_init()) return _T(""); return p->Uri().m_strFilename; } - virtual std::wstring GetLinkFromRId(const PPTX::RId& rid)const + virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const { //return relsTable.Links.GetTargetById(rid); - smart_ptr pExt = find(rid).smart_dynamic_cast(); + smart_ptr pExt = Find(rid).smart_dynamic_cast(); if (pExt.IsInit()) return pExt->Uri().m_strFilename; - smart_ptr pMedia = find(rid).smart_dynamic_cast(); + smart_ptr pMedia = Find(rid).smart_dynamic_cast(); if (pMedia.IsInit()) return pMedia->filename().m_strFilename; return _T(""); } - virtual std::wstring GetOleFromRId(const PPTX::RId& rid)const + virtual std::wstring GetOleFromRId (const OOX::RId& rid)const { - smart_ptr p = oleObject(rid); + smart_ptr p = GetOleObject(rid); if (!p.is_init()) return _T(""); return p->filename().m_strFilename; } - virtual DWORD GetRGBAFromMap(const std::wstring& str)const { if(!(clrMapOvr.is_init())) @@ -407,17 +404,17 @@ namespace PPTX public: void ApplyRels() { - Layout = FileContainer::get(PPTX::FileTypes::SlideLayout).smart_dynamic_cast();//boost::shared_dynamic_cast(FileContainer::get(PPTX::FileTypes::SlideLayout)); - Note = FileContainer::get(PPTX::FileTypes::NotesSlide).smart_dynamic_cast(); - comments = FileContainer::get(PPTX::FileTypes::SlideComments).smart_dynamic_cast(); + Layout = FileContainer::Get(OOX::Presentation::FileTypes::SlideLayout).smart_dynamic_cast();//boost::shared_dynamic_cast(FileContainer::get(OOX::Presentation::FileTypes::SlideLayout)); + Note = FileContainer::Get(OOX::Presentation::FileTypes::NotesSlide).smart_dynamic_cast(); + comments = FileContainer::Get(OOX::Presentation::FileTypes::SlideComments).smart_dynamic_cast(); Master = Layout->Master; theme = Layout->theme; - tableStyles_= theme->presentation->get(PPTX::FileTypes::TableStyles).smart_dynamic_cast();//boost::shared_dynamic_cast(Theme->Presentation->get(PPTX::FileTypes::TableStyles)); + tableStyles_= theme->presentation->Get(OOX::Presentation::FileTypes::TableStyles).smart_dynamic_cast();//boost::shared_dynamic_cast(Theme->Presentation->get(OOX::Presentation::FileTypes::TableStyles)); - if (exist(PPTX::FileTypes::VmlDrawing)) + if (IsExist(OOX::Presentation::FileTypes::VmlDrawing)) { - Vml = FileContainer::get(PPTX::FileTypes::VmlDrawing).smart_dynamic_cast();//boost::shared_dynamic_cast(FileContainer::get(PPTX::FileTypes::VmlDrawing)); + Vml = FileContainer::Get(OOX::Presentation::FileTypes::VmlDrawing).smart_dynamic_cast();//boost::shared_dynamic_cast(FileContainer::get(OOX::Presentation::FileTypes::VmlDrawing)); } } diff --git a/ASCOfficePPTXFile/PPTXFormat/SlideLayout.h b/ASCOfficePPTXFile/PPTXFormat/SlideLayout.h index 21a6f02a0c..c88219c398 100644 --- a/ASCOfficePPTXFile/PPTXFormat/SlideLayout.h +++ b/ASCOfficePPTXFile/PPTXFormat/SlideLayout.h @@ -52,9 +52,9 @@ #include "TableStyles.h" #include "DocxFormat/FileTypes.h" -#include "DocxFormat/Media/Image.h" -#include "DocxFormat/Media/OleObject.h" -#include "DocxFormat/External/HyperLink.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Media/Image.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h" +#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h" #include "DocxFormat/Drawing/VmlDrawing.h" @@ -108,7 +108,7 @@ namespace PPTX oNode.ReadAttributeBase(L"type", attrType); oNode.ReadAttributeBase(L"userDrawn", userDrawn); } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { XmlUtils::CAttribute oAttr; @@ -134,16 +134,16 @@ namespace PPTX XmlUtils::SaveToFile(filename.m_strFilename, XmlUtils::CreateNode(_T("p:sldLayout"), oAttr, oValue)); - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName = filename.GetFilename(); FileContainer::write(filename, directory, content); } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::SlideLayout; + return OOX::Presentation::FileTypes::SlideLayout; } virtual const OOX::CPath DefaultDirectory() const { @@ -251,28 +251,27 @@ namespace PPTX Master->GetBackground(bg, ARGB); } } - virtual std::wstring GetMediaFullPathNameFromRId(const PPTX::RId& rid)const + virtual std::wstring GetMediaFullPathNameFromRId(const OOX::RId& rid)const { - smart_ptr p = image(rid); + smart_ptr p = GetImage(rid); if (!p.is_init()) return _T(""); return p->filename().m_strFilename; } - virtual std::wstring GetFullHyperlinkNameFromRId(const PPTX::RId& rid)const + virtual std::wstring GetFullHyperlinkNameFromRId(const OOX::RId& rid)const { - smart_ptr p = hyperlink(rid); + smart_ptr p = GetHyperlink(rid); if (!p.is_init()) return _T(""); return p->Uri().m_strFilename; } - virtual std::wstring GetOleFromRId(const PPTX::RId& rid)const + virtual std::wstring GetOleFromRId(const OOX::RId& rid)const { - smart_ptr p = oleObject(rid); + smart_ptr p = GetOleObject(rid); if (!p.is_init()) return _T(""); return p->filename().m_strFilename; } - virtual DWORD GetRGBAFromMap(const std::wstring& str)const { if(!(clrMapOvr.is_init())) @@ -474,7 +473,7 @@ namespace PPTX public: void ApplyRels() { - smart_ptr pFile = FileContainer::get(PPTX::FileTypes::SlideMaster); + smart_ptr pFile = FileContainer::Get(OOX::Presentation::FileTypes::SlideMaster); Master = pFile.smart_dynamic_cast(); @@ -483,11 +482,11 @@ namespace PPTX if (theme.IsInit()) { - tableStyles = theme->presentation->get(PPTX::FileTypes::TableStyles).smart_dynamic_cast(); + tableStyles = theme->presentation->Get(OOX::Presentation::FileTypes::TableStyles).smart_dynamic_cast(); } - if (exist(PPTX::FileTypes::VmlDrawing)) + if (IsExist(OOX::Presentation::FileTypes::VmlDrawing)) { - Vml = FileContainer::get(PPTX::FileTypes::VmlDrawing).smart_dynamic_cast();//boost::shared_dynamic_cast(FileContainer::get(PPTX::FileTypes::VmlDrawing)); + Vml = FileContainer::Get(OOX::Presentation::FileTypes::VmlDrawing).smart_dynamic_cast();//boost::shared_dynamic_cast(FileContainer::get(OOX::Presentation::FileTypes::VmlDrawing)); } } diff --git a/ASCOfficePPTXFile/PPTXFormat/SlideMaster.h b/ASCOfficePPTXFile/PPTXFormat/SlideMaster.h index eb02e2e563..a6cac3dd52 100644 --- a/ASCOfficePPTXFile/PPTXFormat/SlideMaster.h +++ b/ASCOfficePPTXFile/PPTXFormat/SlideMaster.h @@ -52,9 +52,9 @@ #include "Theme.h" #include "TableStyles.h" -#include "DocxFormat/Media/Image.h" -#include "DocxFormat/Media/OleObject.h" -#include "DocxFormat/External/HyperLink.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Media/Image.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h" +#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h" #include "DocxFormat/Drawing/VmlDrawing.h" namespace PPTX @@ -115,7 +115,7 @@ namespace PPTX if(txStyles.is_init()) txStyles->SetParentFilePointer(this); } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { XmlUtils::CAttribute oAttr; oAttr.Write(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink); @@ -136,16 +136,16 @@ namespace PPTX XmlUtils::SaveToFile(filename.m_strFilename, XmlUtils::CreateNode(_T("p:sldMaster"), oAttr, oValue)); - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName = filename.GetFilename(); FileContainer::write(filename, directory, content); } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::SlideMaster; + return OOX::Presentation::FileTypes::SlideMaster; } virtual const OOX::CPath DefaultDirectory() const { @@ -319,29 +319,28 @@ namespace PPTX } } } - virtual std::wstring GetMediaFullPathNameFromRId(const PPTX::RId& rid)const + virtual std::wstring GetMediaFullPathNameFromRId(const OOX::RId& rid)const { - smart_ptr p = image(rid); + smart_ptr p = GetImage(rid); if (!p.is_init()) return _T(""); return p->filename().m_strFilename; } - virtual std::wstring GetFullHyperlinkNameFromRId(const PPTX::RId& rid)const + virtual std::wstring GetFullHyperlinkNameFromRId(const OOX::RId& rid)const { - smart_ptr p = hyperlink(rid); + smart_ptr p = GetHyperlink(rid); if (!p.is_init()) return _T(""); return p->Uri().m_strFilename; } - virtual std::wstring GetOleFromRId(const PPTX::RId& rid)const + virtual std::wstring GetOleFromRId(const OOX::RId& rid)const { - smart_ptr p = oleObject(rid); + smart_ptr p = GetOleObject(rid); if (!p.is_init()) return _T(""); return p->filename().m_strFilename; } - //---------------------Colors from map--------------------------------------- DWORD GetRGBAFromMap(const std::wstring& str)const @@ -514,16 +513,16 @@ namespace PPTX public: void ApplyRels() { - theme = (FileContainer::get(PPTX::FileTypes::ThemePPTX)).smart_dynamic_cast(); + theme = (FileContainer::Get(OOX::Presentation::FileTypes::ThemePPTX)).smart_dynamic_cast(); if (theme.IsInit()) theme->SetColorMap(clrMap); //Theme->Master.reset((PPTX::WrapperFile*)this); - tableStyles = (theme->presentation->get(PPTX::FileTypes::TableStyles)).smart_dynamic_cast(); + tableStyles = (theme->presentation->Get(OOX::Presentation::FileTypes::TableStyles)).smart_dynamic_cast(); - if (exist(PPTX::FileTypes::VmlDrawing)) + if (IsExist(OOX::Presentation::FileTypes::VmlDrawing)) { - Vml = FileContainer::get(PPTX::FileTypes::VmlDrawing).smart_dynamic_cast();//boost::shared_dynamic_cast(FileContainer::get(PPTX::FileTypes::VmlDrawing)); + Vml = FileContainer::Get(OOX::Presentation::FileTypes::VmlDrawing).smart_dynamic_cast();//boost::shared_dynamic_cast(FileContainer::get(OOX::Presentation::FileTypes::VmlDrawing)); } } diff --git a/ASCOfficePPTXFile/PPTXFormat/TableStyles.h b/ASCOfficePPTXFile/PPTXFormat/TableStyles.h index 7481fecfb6..f2118c58df 100644 --- a/ASCOfficePPTXFile/PPTXFormat/TableStyles.h +++ b/ASCOfficePPTXFile/PPTXFormat/TableStyles.h @@ -83,7 +83,7 @@ namespace PPTX pPair->second.SetParentFilePointer(this); } } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { std::wstring strValue = _T(""); for (std::map::const_iterator pPair = Styles.begin(); pPair != Styles.end(); ++pPair) @@ -96,15 +96,15 @@ namespace PPTX XmlUtils::SaveToFile(filename.m_strFilename, XmlUtils::CreateNode(_T("a:tblStyleLst"), oAttr, strValue)); - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName = filename.GetFilename(); } public: - virtual const FileType type() const + virtual const OOX::FileType type() const { - return FileTypes::TableStyles; + return OOX::Presentation::FileTypes::TableStyles; } virtual const OOX::CPath DefaultDirectory() const { diff --git a/ASCOfficePPTXFile/PPTXFormat/Theme.h b/ASCOfficePPTXFile/PPTXFormat/Theme.h index 9420dc707a..4469af1541 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Theme.h +++ b/ASCOfficePPTXFile/PPTXFormat/Theme.h @@ -44,9 +44,9 @@ #include "Logic/ClrMap.h" #include "Presentation.h" -#include "DocxFormat/Media/Image.h" -#include "DocxFormat/Media/OleObject.h" -#include "DocxFormat/External/HyperLink.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Media/Image.h" +#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h" +#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h" namespace PPTX { @@ -120,7 +120,7 @@ namespace PPTX for (size_t i = 0; i < count; ++i) extraClrSchemeLst[i].SetParentFilePointer(this); } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { XmlUtils::CAttribute oAttr; oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink); @@ -139,7 +139,7 @@ namespace PPTX XmlUtils::SaveToFile(filename.m_strFilename, XmlUtils::CreateNode(_T("a:theme"), oAttr, oValue)); - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName = filename.GetFilename(); FileContainer::write(filename, directory, content); @@ -281,9 +281,9 @@ namespace PPTX } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::ThemePPTX; + return OOX::Presentation::FileTypes::ThemePPTX; } virtual const OOX::CPath DefaultDirectory() const { @@ -348,23 +348,23 @@ namespace PPTX props.SetMajorLatin(themeElements.fontScheme.majorFont.latin); props.SetMinorLatin(themeElements.fontScheme.minorFont.latin); } - virtual std::wstring GetMediaFullPathNameFromRId(const PPTX::RId& rid)const + virtual std::wstring GetMediaFullPathNameFromRId(const OOX::RId& rid)const { - smart_ptr p = image(rid); + smart_ptr p = GetImage(rid); if (!p.is_init()) return _T(""); return p->filename().m_strFilename; } - virtual std::wstring GetFullHyperlinkNameFromRId(const PPTX::RId& rid)const + virtual std::wstring GetFullHyperlinkNameFromRId(const OOX::RId& rid)const { - smart_ptr p = hyperlink(rid); + smart_ptr p = GetHyperlink(rid); if (!p.is_init()) return _T(""); return p->Uri().m_strFilename; } - virtual std::wstring GetOleFromRId(const PPTX::RId& rid)const + virtual std::wstring GetOleFromRId(const OOX::RId& rid)const { - smart_ptr p = oleObject(rid); + smart_ptr p = GetOleObject(rid); if (!p.is_init()) return _T(""); return p->filename().m_strFilename; diff --git a/ASCOfficePPTXFile/PPTXFormat/ViewProps.h b/ASCOfficePPTXFile/PPTXFormat/ViewProps.h index bba05b0e75..1ff0721036 100644 --- a/ASCOfficePPTXFile/PPTXFormat/ViewProps.h +++ b/ASCOfficePPTXFile/PPTXFormat/ViewProps.h @@ -105,7 +105,7 @@ namespace PPTX if(SorterViewPr.is_init()) SorterViewPr->SetParentFilePointer(this); } - virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const + virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { XmlUtils::CAttribute oAttr; oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink); @@ -125,16 +125,16 @@ namespace PPTX XmlUtils::SaveToFile(filename.m_strFilename, XmlUtils::CreateNode(_T("p:viewPr"), oAttr, oValue)); - content.registration(type().OverrideType(), directory, filename); + content.Registration(type().OverrideType(), directory, filename); m_written = true; m_WrittenFileName = filename.GetFilename(); FileContainer::write(filename, directory, content); } public: - virtual const PPTX::FileType type() const + virtual const OOX::FileType type() const { - return PPTX::FileTypes::ViewProps; + return OOX::Presentation::FileTypes::ViewProps; } virtual const OOX::CPath DefaultDirectory() const { diff --git a/ASCOfficePPTXFile/PPTXFormat/WrapperFile.h b/ASCOfficePPTXFile/PPTXFormat/WrapperFile.h index 82a8d63d97..37c9c1a312 100644 --- a/ASCOfficePPTXFile/PPTXFormat/WrapperFile.h +++ b/ASCOfficePPTXFile/PPTXFormat/WrapperFile.h @@ -33,7 +33,7 @@ #ifndef PPTX_WRAPPER_FILE_INCLUDE_H_ #define PPTX_WRAPPER_FILE_INCLUDE_H_ -#include "DocxFormat/File.h" +#include "../../Common/DocxFormat/Source/DocxFormat/File.h" #include "DocxFormat/NamespaceOwn.h" #include "FileMap.h" @@ -41,7 +41,7 @@ namespace PPTX { - class WrapperFile : public PPTX::File + class WrapperFile : public OOX::File { public: WrapperFile() diff --git a/ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj b/ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj index 42cff27d94..d82c69c111 100644 --- a/ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj +++ b/ASCOfficePPTXFile/PPTXLib/PPTXFormat.vcproj @@ -411,10 +411,6 @@ RelativePath="..\.\PPTXFormat\DocxFormat\DateTime.h" > - - @@ -597,62 +593,6 @@ RelativePath="..\.\PPTXFormat\Folder.h" > - - - - - - - - - - - - - - - - - - - - - - @@ -3286,26 +3226,6 @@ > - - - - - - - - - - diff --git a/Common/DocxFormat/DocxFormatLib/DocxFormatLib.pro b/Common/DocxFormat/DocxFormatLib/DocxFormatLib.pro index 9715478da2..2a0f0dabc9 100644 --- a/Common/DocxFormat/DocxFormatLib/DocxFormatLib.pro +++ b/Common/DocxFormat/DocxFormatLib/DocxFormatLib.pro @@ -273,4 +273,5 @@ HEADERS += docxformatlib.h \ ../Source/XlsxFormat/ExternalLinks/ExternalLinkPath.h \ ../Source/XlsxFormat/ExternalLinks/ExternalLinks.h \ ../Source/XlsxFormat/Worksheets/Sparkline.h \ - ../Source/XlsxFormat/Ole/OleObjects.h + ../Source/XlsxFormat/Ole/OleObjects.h \ + ../Source/DocxFormat/Diagram/DiagramData.h diff --git a/Common/DocxFormat/Projects/DocxFormat2005.vcproj b/Common/DocxFormat/Projects/DocxFormat2005.vcproj index 5edf452dff..3883ed5cfb 100644 --- a/Common/DocxFormat/Projects/DocxFormat2005.vcproj +++ b/Common/DocxFormat/Projects/DocxFormat2005.vcproj @@ -1,7 +1,7 @@ + + @@ -1996,10 +2000,6 @@ RelativePath="..\Source\DocxFormat\Docx.h" > - - diff --git a/Common/DocxFormat/Source/DocxFormat/ContentTypes.h b/Common/DocxFormat/Source/DocxFormat/ContentTypes.h index ca7c4c3f6b..d1bb2882ed 100644 --- a/Common/DocxFormat/Source/DocxFormat/ContentTypes.h +++ b/Common/DocxFormat/Source/DocxFormat/ContentTypes.h @@ -221,10 +221,7 @@ namespace OOX }; } // namespace ContentTypes -} // namespace OOX -namespace OOX -{ static const CPath c_oContentTypeFileName (_T("[Content_Types].xml")); class CContentTypes diff --git a/Common/DocxFormat/Source/DocxFormat/Diagram/DiagramDrawing.h b/Common/DocxFormat/Source/DocxFormat/Diagram/DiagramDrawing.h index 78c64909a0..02272f5221 100644 --- a/Common/DocxFormat/Source/DocxFormat/Diagram/DiagramDrawing.h +++ b/Common/DocxFormat/Source/DocxFormat/Diagram/DiagramDrawing.h @@ -44,149 +44,149 @@ namespace OOX { -namespace Diagram -{ - //-------------------------------------------------------------------------------- - // ?????? sp (Shape) - //-------------------------------------------------------------------------------- - class CShape : public WritingElement - { - public: - CShape(XmlUtils::CXmlNode &oNode) - { - fromXML( oNode ); - } - CShape(XmlUtils::CXmlLiteReader& oReader) - { - fromXML( oReader ); - } - CShape() - { - } - virtual ~CShape() - { - } + namespace Diagram + { + //-------------------------------------------------------------------------------- + // ?????? sp (Shape) + //-------------------------------------------------------------------------------- + class CShape : public WritingElement + { + public: + CShape(XmlUtils::CXmlNode &oNode) + { + fromXML( oNode ); + } + CShape(XmlUtils::CXmlLiteReader& oReader) + { + fromXML( oReader ); + } + CShape() + { + } + virtual ~CShape() + { + } - public: - virtual std::wstring toXML() const - { - return _T(""); - } - virtual void toXML(XmlUtils::CStringWriter& writer) const - { - } - virtual void fromXML(XmlUtils::CXmlNode& node) - { - } - virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) - { - ReadAttributes( oReader ); + public: + virtual std::wstring toXML() const + { + return _T(""); + } + virtual void toXML(XmlUtils::CStringWriter& writer) const + { + } + virtual void fromXML(XmlUtils::CXmlNode& node) + { + } + virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) + { + ReadAttributes( oReader ); - if ( oReader.IsEmptyNode() ) - return; + if ( oReader.IsEmptyNode() ) + return; - int nCurDepth = oReader.GetDepth(); - while( oReader.ReadNextSiblingNode( nCurDepth ) ) - { - std::wstring sName = oReader.GetName(); + int nCurDepth = oReader.GetDepth(); + while( oReader.ReadNextSiblingNode( nCurDepth ) ) + { + std::wstring sName = oReader.GetName(); - if ( _T("dsp:spPr") == sName ) - m_oSpPr = oReader; - //else if ( _T("dsp:nvSpPr") == sName ) - // m_oNvSpPr = oReader; - else if ( _T("dsp:style") == sName ) - m_oShapeStyle = oReader; - else if (_T("dsp:txBody") == sName) - m_oTxBody = oReader; - else if (_T("dsp:txXfrm") == sName) - m_oTxXfrm = oReader; - } - } + if ( _T("dsp:spPr") == sName ) + m_oSpPr = oReader; + //else if ( _T("dsp:nvSpPr") == sName ) + // m_oNvSpPr = oReader; + else if ( _T("dsp:style") == sName ) + m_oShapeStyle = oReader; + else if (_T("dsp:txBody") == sName) + m_oTxBody = oReader; + else if (_T("dsp:txXfrm") == sName) + m_oTxXfrm = oReader; + } + } - virtual EElementType getType () const - { - return et_dsp_Shape; - } + virtual EElementType getType () const + { + return et_dsp_Shape; + } - private: - void ReadAttributes(XmlUtils::CXmlLiteReader& oReader) - { - } - public: - //nullable m_oNvSpPr; + private: + void ReadAttributes(XmlUtils::CXmlLiteReader& oReader) + { + } + public: + //nullable m_oNvSpPr; - nullable m_oSpPr; - nullable m_oShapeStyle; - nullable m_oTxBody; - nullable m_oTxXfrm; + nullable m_oSpPr; + nullable m_oShapeStyle; + nullable m_oTxBody; + nullable m_oTxXfrm; - //extLst (Extension List) І20.1.2.2.15 + //extLst (Extension List) І20.1.2.2.15 - }; + }; - class CShapeTree : public WritingElementWithChilds - { - public: - WritingElement_AdditionConstructors(CShapeTree) - CShapeTree() - { - } - virtual ~CShapeTree() - { - } + class CShapeTree : public WritingElementWithChilds + { + public: + WritingElement_AdditionConstructors(CShapeTree) + CShapeTree() + { + } + virtual ~CShapeTree() + { + } - public: - virtual void fromXML(XmlUtils::CXmlNode& oNode) - { - } - virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) - { - ReadAttributes( oReader ); + public: + virtual void fromXML(XmlUtils::CXmlNode& oNode) + { + } + virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) + { + ReadAttributes( oReader ); - if ( oReader.IsEmptyNode() ) - return; + if ( oReader.IsEmptyNode() ) + return; - int nParentDepth = oReader.GetDepth(); - while( oReader.ReadNextSiblingNode( nParentDepth ) ) - { - std::wstring sName = oReader.GetName(); - WritingElement *pItem = NULL; + int nParentDepth = oReader.GetDepth(); + while( oReader.ReadNextSiblingNode( nParentDepth ) ) + { + std::wstring sName = oReader.GetName(); + WritingElement *pItem = NULL; - if ( _T("dsp:sp") == sName ) - m_arrItems.push_back( new Diagram::CShape( oReader )); - //else if ( _T("dsp:nvGrpSpPr") == sName ) - // m_oGroupShapeNonVisual = oReader; - else if ( _T("dsp:grpSpPr") == sName ) - m_oGroupShapeProperties = oReader; - } - } - virtual std::wstring toXML() const - { - std::wstring sResult = _T(""); - return sResult; - } + if ( _T("dsp:sp") == sName ) + m_arrItems.push_back( new Diagram::CShape( oReader )); + //else if ( _T("dsp:nvGrpSpPr") == sName ) + // m_oGroupShapeNonVisual = oReader; + else if ( _T("dsp:grpSpPr") == sName ) + m_oGroupShapeProperties = oReader; + } + } + virtual std::wstring toXML() const + { + std::wstring sResult = _T(""); + return sResult; + } - virtual EElementType getType() const - { - return et_dsp_ShapeTree; - } - private: - void ReadAttributes(XmlUtils::CXmlLiteReader& oReader) - { - // Читаем атрибуты - WritingElement_ReadAttributes_Start( oReader ) - WritingElement_ReadAttributes_End( oReader ) - } + virtual EElementType getType() const + { + return et_dsp_ShapeTree; + } + private: + void ReadAttributes(XmlUtils::CXmlLiteReader& oReader) + { + // Читаем атрибуты + WritingElement_ReadAttributes_Start ( oReader ) + WritingElement_ReadAttributes_End ( oReader ) + } - public: + public: - // Attributes + // Attributes - // Childs - //nullable m_oGroupShapeNonVisual; - nullable m_oGroupShapeProperties; - }; -} + // Childs + //nullable m_oGroupShapeNonVisual; + nullable m_oGroupShapeProperties; + }; + } class CDiagramDrawing : public OOX::File, public OOX::IFileContainer { public: @@ -203,8 +203,6 @@ namespace Diagram delete m_arrShapeTree[i]; m_arrShapeTree.clear(); } - public: - virtual void read(const CPath& oFilePath) { //don't use this. use read(const CPath& oRootPath, const CPath& oFilePath) @@ -242,8 +240,6 @@ namespace Diagram { } - public: - virtual const OOX::FileType type() const { return FileTypes::DiagDrawing; @@ -257,8 +253,6 @@ namespace Diagram return type().DefaultFileName(); } - public: - std::vector m_arrShapeTree; }; diff --git a/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingExt.cpp b/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingExt.cpp index 9e8a58f24f..d4604ce080 100644 --- a/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingExt.cpp +++ b/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingExt.cpp @@ -31,6 +31,7 @@ */ #include "DrawingExt.h" #include "../../XlsxFormat/Worksheets/Sparkline.h" +#include "../Diagram/DiagramData.h" namespace OOX { @@ -40,21 +41,26 @@ namespace OOX { ReadAttributes( oReader ); - if ((m_sUri.IsInit()) && (*m_sUri == _T("{63B3BB69-23CF-44E3-9099-C40C66FF867C}") || - *m_sUri == _T("{05C60535-1F16-4fd2-B633-F4F36F0B64E0}"))) //2.2.6.2 Legacy Object Wrapper + if ((m_sUri.IsInit()) && (*m_sUri == L"{63B3BB69-23CF-44E3-9099-C40C66FF867C}" || + *m_sUri == L"{05C60535-1F16-4fd2-B633-F4F36F0B64E0}" || + *m_sUri == L"http://schemas.microsoft.com/office/drawing/2008/diagram")) { int nCurDepth = oReader.GetDepth(); while( oReader.ReadNextSiblingNode( nCurDepth ) ) { std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName()); - if (sName == _T("compatExt"))//2.3.1.2 compatExt + if (sName == L"compatExt")//2.3.1.2 compatExt { //attributes spid -https://msdn.microsoft.com/en-us/library/hh657207(v=office.12).aspx m_oCompatExt = oReader; } - else if (sName == _T("sparklineGroups")) + else if (sName == L"sparklineGroups") { m_oSparklineGroups = oReader; } + else if (sName == L"dataModelExt") + { + m_oDataModelExt = oReader; + } } } else diff --git a/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingExt.h b/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingExt.h index 37b57782cb..35fb91755a 100644 --- a/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingExt.h +++ b/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingExt.h @@ -94,6 +94,58 @@ namespace OOX // Childs }; + class CDataModelExt : public WritingElement + { + public: + WritingElement_AdditionConstructors(CDataModelExt) + CDataModelExt() + { + } + virtual ~CDataModelExt() + { + } + + public: + + virtual void fromXML(XmlUtils::CXmlNode& oNode) + { + //todo + } + virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) + { + ReadAttributes( oReader ); + + if ( !oReader.IsEmptyNode() ) + oReader.ReadTillEnd(); + } + virtual std::wstring toXML() const + { + return _T(""); + } + virtual EElementType getType() const + { + return OOX::et_a_compatExt; + } + + private: + + void ReadAttributes(XmlUtils::CXmlLiteReader& oReader) + { + // Читаем атрибуты + WritingElement_ReadAttributes_Start_No_NS( oReader ) + WritingElement_ReadAttributes_Read_if( oReader, _T("relId"), m_oRelId ) + WritingElement_ReadAttributes_End( oReader ) + } + + public: + + // Attributes + nullable m_oRelId; + + // Childs + }; + + //-------------------------------------------------------------------------------- // COfficeArtExtension 20.1.2.2.14 (Part 1) //-------------------------------------------------------------------------------- @@ -141,6 +193,7 @@ namespace OOX // Childs nullable m_oCompatExt; nullable m_oSparklineGroups; + nullable m_oDataModelExt; }; //-------------------------------------------------------------------------------- // COfficeArtExtensionList 20.1.2.2.15 (Part 1) diff --git a/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingShape.h b/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingShape.h index f715350848..08759f49d0 100644 --- a/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingShape.h +++ b/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingShape.h @@ -413,10 +413,10 @@ namespace OOX virtual void toXML(XmlUtils::CStringWriter& writer) const { } - virtual void fromXML(XmlUtils::CXmlNode& node) + virtual void fromXML(XmlUtils::CXmlNode& node) { } - virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) + virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) { ReadAttributes( oReader ); diff --git a/Common/DocxFormat/Source/DocxFormat/FileFactory.cpp b/Common/DocxFormat/Source/DocxFormat/FileFactory.cpp index 0e6652bc99..f390812beb 100644 --- a/Common/DocxFormat/Source/DocxFormat/FileFactory.cpp +++ b/Common/DocxFormat/Source/DocxFormat/FileFactory.cpp @@ -58,6 +58,7 @@ #include "Comments.h" #include "UnknowTypeFile.h" #include "Diagram/DiagramDrawing.h" +#include "Diagram/DiagramData.h" namespace OOX @@ -125,8 +126,8 @@ namespace OOX return smart_ptr(new CPeople( oFileName )); //// - else if (oRelation.Type() == FileTypes::Data) // нужен только filepath - return smart_ptr(new Image( oFileName )); + else if (oRelation.Type() == FileTypes::Data) + return smart_ptr(new CDiagramData( oRootPath, oFileName )); else if (oRelation.Type() == FileTypes::DiagDrawing) return smart_ptr(new CDiagramDrawing( oRootPath, oFileName )); @@ -197,8 +198,8 @@ namespace OOX else if ( pRelation->Type() == FileTypes::People ) return smart_ptr(new CPeople( oFileName )); //// - else if (pRelation->Type() == FileTypes::Data) // нужен только filepath - return smart_ptr(new Image( oFileName )); + else if (pRelation->Type() == FileTypes::Data) + return smart_ptr(new CDiagramData( oRootPath, oFileName )); else if (pRelation->Type() == FileTypes::DiagDrawing) return smart_ptr(new CDiagramDrawing( oRootPath, oFileName )); diff --git a/Common/DocxFormat/Source/DocxFormat/IFileContainer.h b/Common/DocxFormat/Source/DocxFormat/IFileContainer.h index 111a166922..2cc5db985b 100644 --- a/Common/DocxFormat/Source/DocxFormat/IFileContainer.h +++ b/Common/DocxFormat/Source/DocxFormat/IFileContainer.h @@ -62,17 +62,14 @@ namespace OOX } protected: - std::map> m_mContainer; - size_t m_lMaxRid; - - protected: + std::map> m_mContainer; + size_t m_lMaxRid; void Read (const OOX::CPath& oRootPath, const OOX::CPath& oPath); void Read (const OOX::CRels& oRels, const OOX::CPath& oRootPath, const CPath& oPath); void Write(const OOX::CPath& oFileName, const CPath& oDir, OOX::CContentTypes& oContent) const; void Write(OOX::CRels& oRels, const CPath& oCurrent, const CPath& oDir, OOX::CContentTypes& oContent) const; - protected: void Commit (const CPath& oPath); void Finalize(const CPath& oFilefilename, const CPath& oDir, OOX::CContentTypes& oContent); void Finalize(OOX::CRels& oRels, const CPath& oCurrent, const CPath& oDir, OOX::CContentTypes& oContent); @@ -81,14 +78,10 @@ namespace OOX void ExtractPictures(const OOX::CPath& oPath) const; - public: - virtual smart_ptr GetImage (const RId& rId) const; virtual smart_ptr GetHyperlink(const RId& rId) const; virtual smart_ptr GetOleObject(const RId& rId) const; - public: - template const bool IsExist() const; const bool IsExist(const FileType& oType) const; diff --git a/Common/DocxFormat/Source/DocxFormat/RId.h b/Common/DocxFormat/Source/DocxFormat/RId.h index 4ff5987309..6102273057 100644 --- a/Common/DocxFormat/Source/DocxFormat/RId.h +++ b/Common/DocxFormat/Source/DocxFormat/RId.h @@ -57,12 +57,6 @@ namespace OOX (*this) = oSrc; } - public: - //const RId& operator= (const size_t id) - //{ - // m_id = id; - // return *this; - //} const RId& operator= (const std::wstring& rid) { //Учитывает только rid начинающиеся с rId, остальные сохраняем так как есть @@ -90,7 +84,6 @@ namespace OOX return *this; } - public: const bool operator ==(const RId& lhs) const { return m_id == lhs.m_id && m_sId == lhs.m_sId; @@ -99,35 +92,34 @@ namespace OOX { return !operator ==(lhs); } - //const bool operator < (const RId& lhs) const - //{ - // return m_id < lhs.m_id; - //} - //const bool operator <=(const RId& lhs) const - //{ - // return m_id <= lhs.m_id; - //} - //const bool operator >(const RId& lhs) const - //{ - // return m_id > lhs.m_id; - //} - //const bool operator >=(const RId& lhs) const - //{ - // return m_id >= lhs.m_id; - //} + const bool operator < (const RId& lhs) const + { + return m_id < lhs.m_id; + } + const bool operator <=(const RId& lhs) const + { + return m_id <= lhs.m_id; + } + const bool operator >(const RId& lhs) const + { + return m_id > lhs.m_id; + } + const bool operator >=(const RId& lhs) const + { + return m_id >= lhs.m_id; + } AVSINLINE std::wstring get() const { return ToString(); } AVSINLINE size_t getNumber() const { return m_id; } - public: + const RId next() const { return RId(m_id + 1); } - public: const std::wstring ToString() const { if(!m_sId.empty()) @@ -135,10 +127,15 @@ namespace OOX else return _T("rId") + std::to_wstring(m_id); } - + template + void toPPTY(BYTE type, T pWriter) const + { + pWriter->WriteBYTE(type); + pWriter->WriteStringW(ToString()); + } private: - size_t m_id; - std::wstring m_sId; + size_t m_id; + std::wstring m_sId; }; } // namespace OOX diff --git a/Common/DocxFormat/Source/DocxFormat/Rels.h b/Common/DocxFormat/Source/DocxFormat/Rels.h index e7b38c1215..b9f5ff9985 100644 --- a/Common/DocxFormat/Source/DocxFormat/Rels.h +++ b/Common/DocxFormat/Source/DocxFormat/Rels.h @@ -164,9 +164,7 @@ namespace OOX }; } // namespace Rels -} // namespace OOX -namespace OOX -{ + class CRels { public: @@ -276,7 +274,6 @@ namespace OOX } } - public: void Registration(const RId& rId, const FileType& oType, const CPath& oPath) { diff --git a/Common/DocxFormat/Source/DocxFormat/Settings/Settings.h b/Common/DocxFormat/Source/DocxFormat/Settings/Settings.h index 05325a1a3f..88b44480ba 100644 --- a/Common/DocxFormat/Source/DocxFormat/Settings/Settings.h +++ b/Common/DocxFormat/Source/DocxFormat/Settings/Settings.h @@ -150,12 +150,12 @@ namespace OOX public: // Attributes - nullable m_sAppName; + nullable m_sAppName; nullable> m_oCheckSyle; - nullable m_sDllVersion; + nullable m_sDllVersion; nullable m_oLang; nullable> m_oNlCheck; - nullable m_sVendorID; + nullable m_sVendorID; }; //-------------------------------------------------------------------------------- // CAutoCaption 17.15.1.7 (Part 1) diff --git a/Common/DocxFormat/Source/DocxFormat/WritingElement.h b/Common/DocxFormat/Source/DocxFormat/WritingElement.h index 3afb101782..8d3f54ce8d 100644 --- a/Common/DocxFormat/Source/DocxFormat/WritingElement.h +++ b/Common/DocxFormat/Source/DocxFormat/WritingElement.h @@ -322,6 +322,11 @@ namespace OOX et_a_ShapeNonVisual, et_dgm_DiagrammParts, // + et_dgm_ptLst, // + et_dgm_pt, // + et_dgm_prSet, // + et_dgm_spPr, // + et_dgm_t, // et_dsp_Shape, // et_dsp_ShapeTree, // et_dsp_spPr, //