This commit is contained in:
ElenaSubbotina
2024-09-04 20:01:10 +03:00
parent ceeaff9585
commit 978ec43047
21 changed files with 333 additions and 163 deletions

View File

@ -92,5 +92,89 @@ namespace PPTX
break; break;
} }
} }
//------------------------------------------------------------------------------------------
PrintClrMode::PrintClrMode()
{
m_strValue = L"clr";
}
void PrintClrMode::set(const std::wstring& strValue)
{
if ((L"bw" == strValue) ||
(L"clr" == strValue) ||
(L"gray" == strValue))
{
m_strValue = strValue;
}
}
unsigned char PrintClrMode::GetBYTECode() const
{
if (L"bw" == m_strValue) return 0;
if (L"clr" == m_strValue) return 1;
if (L"gray" == m_strValue) return 2;
return 0;
}
void PrintClrMode::SetBYTECode(const unsigned char& src)
{
switch (src)
{
case 0: m_strValue = L"bw"; break;
case 1: m_strValue = L"clr"; break;
case 2: m_strValue = L"gray"; break;
default:
m_strValue = L"clr";
break;
}
}
//------------------------------------------------------------------------------------------
PrintWhat::PrintWhat()
{
m_strValue = L"slides";
}
void PrintWhat::set(const std::wstring& strValue)
{
if ((L"slides" == strValue) ||
(L"handouts1" == strValue) ||
(L"handouts2" == strValue) ||
(L"handouts3" == strValue) ||
(L"handouts4" == strValue) ||
(L"handouts6" == strValue) ||
(L"handouts9" == strValue) ||
(L"notes" == strValue) ||
(L"outline" == strValue))
{
m_strValue = strValue;
}
}
unsigned char PrintWhat::GetBYTECode() const
{
if (L"slides" == m_strValue) return 0;
if (L"handouts1" == m_strValue) return 1;
if (L"handouts2" == m_strValue) return 2;
if (L"handouts3" == m_strValue) return 3;
if (L"handouts4" == m_strValue) return 4;
if (L"handouts6" == m_strValue) return 5;
if (L"handouts9" == m_strValue) return 6;
if (L"notes" == m_strValue) return 7;
if (L"outline" == m_strValue) return 8;
return 0;
}
void PrintWhat::SetBYTECode(const unsigned char& src)
{
switch (src)
{
case 0: m_strValue = L"slides"; break;
case 1: m_strValue = L"handouts1"; break;
case 2: m_strValue = L"handouts2"; break;
case 3: m_strValue = L"handouts3"; break;
case 4: m_strValue = L"handouts4"; break;
case 5: m_strValue = L"handouts6"; break;
case 6: m_strValue = L"handouts9"; break;
case 7: m_strValue = L"notes"; break;
case 8: m_strValue = L"outline"; break;
default:
m_strValue = L"slides";
break;
}
}
} // namespace Limit } // namespace Limit
} // namespace PPTX } // namespace PPTX

View File

@ -38,5 +38,9 @@ namespace PPTX
namespace Limit namespace Limit
{ {
DEFINE_LIMIT_BASE(BWMode) DEFINE_LIMIT_BASE(BWMode)
DEFINE_LIMIT_BASE(PrintClrMode)
DEFINE_LIMIT_BASE(PrintWhat)
} // namespace Limit } // namespace Limit
} // namespace PPTX } // namespace PPTX

View File

@ -32,7 +32,7 @@
#include "PresProps.h" #include "PresProps.h"
#include "ShowPr/ShowPr.h" #include "ShowPr/PresentationPr.h"
#include "ShowPr/Browse.h" #include "ShowPr/Browse.h"
#include "ShowPr/CustShow.h" #include "ShowPr/CustShow.h"
#include "ShowPr/Kiosk.h" #include "ShowPr/Kiosk.h"
@ -59,12 +59,17 @@ namespace PPTX
ClrMru.clear(); ClrMru.clear();
XmlUtils::CXmlNode oNodeClr; XmlUtils::CXmlNode oNodeClr;
if (oNode.GetNode(_T("p:clrMru"), oNodeClr)) if (oNode.GetNode(L"p:clrMru", oNodeClr))
XmlMacroLoadArray(oNodeClr, _T("*"), ClrMru, Logic::UniColor); XmlMacroLoadArray(oNodeClr, L"*", ClrMru, Logic::UniColor);
showPr = oNode.ReadNode(_T("p:showPr")); showPr = oNode.ReadNode(L"p:showPr");
printPr = oNode.ReadNode(L"p:printPr");
if(showPr.is_init()) if(showPr.is_init())
showPr->SetParentFilePointer(this); showPr->SetParentFilePointer(this);
if (printPr.is_init())
printPr->SetParentFilePointer(this);
} }
void PresProps::write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const void PresProps::write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const
{ {
@ -77,25 +82,27 @@ namespace PPTX
pWriter->WriteRecordArray(0, 0, ClrMru); pWriter->WriteRecordArray(0, 0, ClrMru);
pWriter->WriteRecord2(1, showPr); pWriter->WriteRecord2(1, showPr);
pWriter->WriteRecord2(2, printPr);
pWriter->EndRecord(); pWriter->EndRecord();
} }
void PresProps::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const void PresProps::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{ {
pWriter->StartNode(_T("p:presentationPr")); pWriter->StartNode(L"p:presentationPr");
pWriter->StartAttributes(); pWriter->StartAttributes();
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink); pWriter->WriteAttribute(L"xmlns:a", PPTX::g_Namespaces.a.m_strLink);
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink); pWriter->WriteAttribute(L"xmlns:r", PPTX::g_Namespaces.r.m_strLink);
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink); pWriter->WriteAttribute(L"xmlns:p", PPTX::g_Namespaces.p.m_strLink);
pWriter->EndAttributes(); pWriter->EndAttributes();
pWriter->WriteArray(_T("p:clrMru"), ClrMru); pWriter->WriteArray(L"p:clrMru", ClrMru);
pWriter->Write(showPr); pWriter->Write(showPr);
pWriter->Write(printPr);
pWriter->EndNode(_T("p:presentationPr")); pWriter->EndNode(L"p:presentationPr");
} }
void PresProps::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader) void PresProps::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{ {
@ -130,15 +137,18 @@ namespace PPTX
ClrMru.pop_back(); ClrMru.pop_back();
} }
} }
} }
break; }break;
}
case 1: case 1:
{ {
showPr = new nsShowPr::ShowPr(); showPr = new nsPresentationPr::ShowPr();
showPr->fromPPTY(pReader); showPr->fromPPTY(pReader);
break; }break;
} case 2:
{
printPr = new nsPresentationPr::PrintPr();
printPr->fromPPTY(pReader);
}break;
default: default:
{ {
pReader->SkipRecord(); pReader->SkipRecord();

View File

@ -30,8 +30,6 @@
* *
*/ */
#pragma once #pragma once
#ifndef PPTX_PRESPROPS_FILE_INCLUDE_H_
#define PPTX_PRESPROPS_FILE_INCLUDE_H_
#include "WrapperFile.h" #include "WrapperFile.h"
#include "FileContainer.h" #include "FileContainer.h"
@ -41,9 +39,10 @@
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
class ShowPr; class ShowPr;
class PrintPr;
} }
class PresProps : public WrapperFile, public PPTX::FileContainer class PresProps : public WrapperFile, public PPTX::FileContainer
@ -53,7 +52,6 @@ namespace PPTX
PresProps(OOX::Document* pMain, const OOX::CPath& filename, FileMap& map); PresProps(OOX::Document* pMain, const OOX::CPath& filename, FileMap& map);
virtual ~PresProps(); virtual ~PresProps();
public:
virtual void read(const OOX::CPath& filename, FileMap& map); virtual void read(const OOX::CPath& filename, FileMap& map);
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content) const; virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content) const;
@ -61,16 +59,12 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const; virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader); virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
public:
virtual const OOX::FileType type() const; virtual const OOX::FileType type() const;
virtual const OOX::CPath DefaultDirectory() const; virtual const OOX::CPath DefaultDirectory() const;
virtual const OOX::CPath DefaultFileName() const; virtual const OOX::CPath DefaultFileName() const;
public: std::vector<Logic::UniColor> ClrMru;
std::vector<Logic::UniColor> ClrMru; nullable<nsPresentationPr::ShowPr> showPr;
nullable<nsShowPr::ShowPr> showPr; nullable<nsPresentationPr::PrintPr> printPr;
//prnPr (Printing Properties)
}; };
} // namespace PPTX } // namespace PPTX
#endif // PPTX_PRESPROPS_FILE_INCLUDE_H_

View File

@ -34,7 +34,7 @@
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
void Browse::fromXML(XmlUtils::CXmlNode& node) void Browse::fromXML(XmlUtils::CXmlNode& node)
{ {
@ -88,5 +88,5 @@ namespace PPTX
void Browse::FillParentPointersForChilds() void Browse::FillParentPointersForChilds()
{ {
} }
} // namespace nsShowPr } // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX

View File

@ -30,14 +30,12 @@
* *
*/ */
#pragma once #pragma once
#ifndef PPTX_SHOWPR_BROWSE_INCLUDE_H_
#define PPTX_SHOWPR_BROWSE_INCLUDE_H_
#include "./../WrapperWritingElement.h" #include "./../WrapperWritingElement.h"
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
class Browse : public WrapperWritingElement class Browse : public WrapperWritingElement
{ {
@ -52,13 +50,11 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const; virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader); virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
public: nullable_bool showScrollbar;
nullable_bool showScrollbar;
protected: protected:
virtual void FillParentPointersForChilds(); virtual void FillParentPointersForChilds();
}; };
} // namespace nsShowPr } // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX
#endif // PPTX_SHOWPR_BROWSE_INCLUDE_H_

View File

@ -34,7 +34,7 @@
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
void CustShow::fromXML(XmlUtils::CXmlNode& node) void CustShow::fromXML(XmlUtils::CXmlNode& node)
{ {
@ -88,5 +88,5 @@ namespace PPTX
void CustShow::FillParentPointersForChilds() void CustShow::FillParentPointersForChilds()
{ {
} }
} // namespace nsShowPr } // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX

View File

@ -30,21 +30,18 @@
* *
*/ */
#pragma once #pragma once
#ifndef PPTX_SHOWPR_CUSTSHOW_INCLUDE_H_
#define PPTX_SHOWPR_CUSTSHOW_INCLUDE_H_
#include "./../WrapperWritingElement.h" #include "./../WrapperWritingElement.h"
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
class CustShow : public WrapperWritingElement class CustShow : public WrapperWritingElement
{ {
public: public:
PPTX_LOGIC_BASE(CustShow) PPTX_LOGIC_BASE(CustShow)
public:
virtual void fromXML(XmlUtils::CXmlNode& node); virtual void fromXML(XmlUtils::CXmlNode& node);
virtual std::wstring toXML() const; virtual std::wstring toXML() const;
@ -52,13 +49,10 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const; virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader); virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
public: nullable_int id;
nullable_int id;
protected: protected:
virtual void FillParentPointersForChilds(); virtual void FillParentPointersForChilds();
}; };
} // namespace nsShowPr } // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX
#endif // PPTX_SHOWPR_CUSTSHOW_INCLUDE_H_

View File

@ -34,7 +34,7 @@
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
void Kiosk::fromXML(XmlUtils::CXmlNode& node) void Kiosk::fromXML(XmlUtils::CXmlNode& node)
{ {
@ -88,5 +88,5 @@ namespace PPTX
void Kiosk::FillParentPointersForChilds() void Kiosk::FillParentPointersForChilds()
{ {
} }
} // namespace nsShowPr } // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX

View File

@ -30,21 +30,18 @@
* *
*/ */
#pragma once #pragma once
#ifndef PPTX_SHOWPR_KIOSK_INCLUDE_H_
#define PPTX_SHOWPR_KIOSK_INCLUDE_H_
#include "./../WrapperWritingElement.h" #include "./../WrapperWritingElement.h"
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
class Kiosk : public WrapperWritingElement class Kiosk : public WrapperWritingElement
{ {
public: public:
PPTX_LOGIC_BASE(Kiosk) PPTX_LOGIC_BASE(Kiosk)
public:
virtual void fromXML(XmlUtils::CXmlNode& node); virtual void fromXML(XmlUtils::CXmlNode& node);
virtual std::wstring toXML() const; virtual std::wstring toXML() const;
@ -52,13 +49,10 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const; virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader); virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
public: nullable_int restart;
nullable_int restart;
protected: protected:
virtual void FillParentPointersForChilds(); virtual void FillParentPointersForChilds();
}; };
} // namespace nsShowPr } // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX
#endif // PPTX_SHOWPR_KIOSK_INCLUDE_H_

View File

@ -34,7 +34,7 @@
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
void Present::fromXML(XmlUtils::CXmlNode& node) void Present::fromXML(XmlUtils::CXmlNode& node)
{ {
@ -53,5 +53,5 @@ namespace PPTX
void Present::FillParentPointersForChilds() void Present::FillParentPointersForChilds()
{ {
} }
} // namespace nsShowPr } // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX

View File

@ -30,21 +30,18 @@
* *
*/ */
#pragma once #pragma once
#ifndef PPTX_SHOWPR_PRESENT_INCLUDE_H_
#define PPTX_SHOWPR_PRESENT_INCLUDE_H_
#include "./../WrapperWritingElement.h" #include "./../WrapperWritingElement.h"
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
class Present : public WrapperWritingElement class Present : public WrapperWritingElement
{ {
public: public:
PPTX_LOGIC_BASE(Present) PPTX_LOGIC_BASE(Present)
public:
virtual void fromXML(XmlUtils::CXmlNode& node); virtual void fromXML(XmlUtils::CXmlNode& node);
virtual std::wstring toXML() const; virtual std::wstring toXML() const;
@ -54,7 +51,5 @@ namespace PPTX
protected: protected:
virtual void FillParentPointersForChilds(); virtual void FillParentPointersForChilds();
}; };
} // namespace nsShowPr } // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX
#endif // PPTX_SHOWPR_PRESENT_INCLUDE_H_

View File

@ -30,7 +30,7 @@
* *
*/ */
#include "ShowPr.h" #include "PresentationPr.h"
#include "./Browse.h" #include "./Browse.h"
#include "./CustShow.h" #include "./CustShow.h"
@ -41,31 +41,31 @@
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
void ShowPr::fromXML(XmlUtils::CXmlNode& node) void ShowPr::fromXML(XmlUtils::CXmlNode& node)
{ {
XmlMacroReadAttributeBase(node, _T("loop"), loop); XmlMacroReadAttributeBase(node, L"loop", loop);
XmlMacroReadAttributeBase(node, _T("showAnimation"), showAnimation); XmlMacroReadAttributeBase(node, L"showAnimation", showAnimation);
XmlMacroReadAttributeBase(node, _T("showNarration"), showNarration); XmlMacroReadAttributeBase(node, L"showNarration", showNarration);
XmlMacroReadAttributeBase(node, _T("useTimings"), useTimings); XmlMacroReadAttributeBase(node, L"useTimings", useTimings);
Browse = node.ReadNodeNoNS(_T("browse")); Browse = node.ReadNodeNoNS(L"browse");
CustShow = node.ReadNodeNoNS(_T("custShow")); CustShow = node.ReadNodeNoNS(L"custShow");
Kiosk = node.ReadNodeNoNS(_T("kiosk")); Kiosk = node.ReadNodeNoNS(L"kiosk");
XmlUtils::CXmlNode node1 = node.ReadNodeNoNS(_T("penClr")); XmlUtils::CXmlNode node1 = node.ReadNodeNoNS(L"penClr");
PenClr.GetColorFrom(node1); PenClr.GetColorFrom(node1);
Present = node.ReadNodeNoNS(_T("present")); Present = node.ReadNodeNoNS(L"present");
SldAll = node.ReadNodeNoNS(_T("sldAll")); SldAll = node.ReadNodeNoNS(L"sldAll");
SldRg = node.ReadNodeNoNS(_T("sldRg")); SldRg = node.ReadNodeNoNS(L"sldRg");
} }
std::wstring ShowPr::toXML() const std::wstring ShowPr::toXML() const
{ {
XmlUtils::CAttribute oAttr; XmlUtils::CAttribute oAttr;
oAttr.Write(_T("loop"), loop); oAttr.Write(L"loop", loop);
oAttr.Write(_T("showAnimation"), showAnimation); oAttr.Write(L"showAnimation", showAnimation);
oAttr.Write(_T("showNarration"), showNarration); oAttr.Write(L"showNarration", showNarration);
oAttr.Write(_T("useTimings"), useTimings); oAttr.Write(L"useTimings", useTimings);
XmlUtils::CNodeValue oValue; XmlUtils::CNodeValue oValue;
oValue.WriteNullable(Present); oValue.WriteNullable(Present);
@ -76,7 +76,7 @@ namespace PPTX
oValue.WriteNullable(CustShow); oValue.WriteNullable(CustShow);
oValue.Write(PenClr); oValue.Write(PenClr);
return XmlUtils::CreateNode(_T("p:ShowPr"), oAttr, oValue); return XmlUtils::CreateNode(L"p:ShowPr", oAttr, oValue);
} }
void ShowPr::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const void ShowPr::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{ {
@ -97,14 +97,14 @@ namespace PPTX
} }
void ShowPr::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const void ShowPr::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{ {
pWriter->StartNode(_T("p:showPr")); pWriter->StartNode(L"p:showPr");
pWriter->StartAttributes(); pWriter->StartAttributes();
pWriter->WriteAttribute(_T("loop"), loop); pWriter->WriteAttribute(L"loop", loop);
pWriter->WriteAttribute(_T("showAnimation"), showAnimation); pWriter->WriteAttribute(L"showAnimation", showAnimation);
pWriter->WriteAttribute(_T("showNarration"), showNarration); pWriter->WriteAttribute(L"showNarration", showNarration);
pWriter->WriteAttribute(_T("useTimings"), useTimings); pWriter->WriteAttribute(L"useTimings", useTimings);
pWriter->EndAttributes(); pWriter->EndAttributes();
@ -116,12 +116,12 @@ namespace PPTX
pWriter->Write(CustShow); pWriter->Write(CustShow);
if(PenClr.is_init()) if(PenClr.is_init())
{ {
pWriter->WriteString(_T("<p:penClr>")); pWriter->WriteString(L"<p:penClr>");
PenClr.toXmlWriter(pWriter); PenClr.toXmlWriter(pWriter);
pWriter->WriteString(_T("</p:penClr>")); pWriter->WriteString(L"</p:penClr>");
} }
pWriter->EndNode(_T("p:showPr")); pWriter->EndNode(L"p:showPr");
} }
void ShowPr::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader) void ShowPr::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{ {
@ -154,19 +154,19 @@ namespace PPTX
{ {
case 0: case 0:
{ {
Browse = new nsShowPr::Browse(); Browse = new nsPresentationPr::Browse();
Browse->fromPPTY(pReader); Browse->fromPPTY(pReader);
break; break;
} }
case 1: case 1:
{ {
CustShow = new nsShowPr::CustShow(); CustShow = new nsPresentationPr::CustShow();
CustShow->fromPPTY(pReader); CustShow->fromPPTY(pReader);
break; break;
} }
case 2: case 2:
{ {
Kiosk = new nsShowPr::Kiosk(); Kiosk = new nsPresentationPr::Kiosk();
Kiosk->fromPPTY(pReader); Kiosk->fromPPTY(pReader);
break; break;
} }
@ -177,19 +177,19 @@ namespace PPTX
} }
case 4: case 4:
{ {
Present = new nsShowPr::Present(); Present = new nsPresentationPr::Present();
pReader->SkipRecord(); pReader->SkipRecord();
break; break;
} }
case 5: case 5:
{ {
SldAll = new nsShowPr::SldAll(); SldAll = new nsPresentationPr::SldAll();
pReader->SkipRecord(); pReader->SkipRecord();
break; break;
} }
case 6: case 6:
{ {
SldRg = new nsShowPr::SldRg(); SldRg = new nsPresentationPr::SldRg();
SldRg->fromPPTY(pReader); SldRg->fromPPTY(pReader);
break; break;
} }
@ -203,5 +203,94 @@ namespace PPTX
void ShowPr::FillParentPointersForChilds() void ShowPr::FillParentPointersForChilds()
{ {
} }
} // namespace nsShowPr //--------------------------------------------------------------------------------------------------------
void PrintPr::fromXML(XmlUtils::CXmlNode& node)
{
XmlMacroReadAttributeBase(node, L"clrMode", clrMode);
XmlMacroReadAttributeBase(node, L"prnWhat", prnWhat);
XmlMacroReadAttributeBase(node, L"frameSlides", frameSlides);
XmlMacroReadAttributeBase(node, L"hiddenSlides", hiddenSlides);
XmlMacroReadAttributeBase(node, L"scaleToFitPaper", scaleToFitPaper);
XmlUtils::CXmlNode list = node.ReadNodeNoNS(L"extLst");
if (list.IsValid())
{
std::vector<XmlUtils::CXmlNode> oNodes;
if (list.GetNodes(L"*", oNodes))
{
size_t nCount = oNodes.size();
for (size_t i = 0; i < nCount; ++i)
{
XmlUtils::CXmlNode& oNode = oNodes[i];
Logic::Ext element;
element.fromXML(oNode);
ExtLst.push_back(element);
}
}
}
}
std::wstring PrintPr::toXML() const
{
XmlUtils::CAttribute oAttr;
oAttr.Write(L"frameSlides", frameSlides);
oAttr.Write(L"hiddenSlides", hiddenSlides);
oAttr.Write(L"scaleToFitPaper", scaleToFitPaper);
oAttr.WriteLimitNullable(L"clrMode", clrMode);
oAttr.WriteLimitNullable(L"prnWhat", prnWhat);
XmlUtils::CNodeValue oValue;
return XmlUtils::CreateNode(L"p:PrintPr", oAttr, oValue);
}
void PrintPr::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteBool2(0, frameSlides);
pWriter->WriteBool2(1, hiddenSlides);
pWriter->WriteBool2(2, scaleToFitPaper);
pWriter->WriteLimit2(3, clrMode);
pWriter->WriteLimit2(4, prnWhat);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
}
void PrintPr::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->WriteString(toXML());
}
void PrintPr::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
case 0:
frameSlides = pReader->GetBool(); break;
case 1:
hiddenSlides = pReader->GetBool(); break;
case 2:
scaleToFitPaper = pReader->GetBool(); break;
case 3:
clrMode = pReader->GetUChar(); break;
case 4:
prnWhat = pReader->GetUChar(); break;
default:
break;
}
}
pReader->Seek(_end_rec);
}
void PrintPr::FillParentPointersForChilds()
{
}
} // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX

View File

@ -30,15 +30,15 @@
* *
*/ */
#pragma once #pragma once
#ifndef PPTX_SHOWPR_FILE_INCLUDE_H_
#define PPTX_SHOWPR_FILE_INCLUDE_H_
#include "./../WrapperWritingElement.h" #include "../WrapperWritingElement.h"
#include "../Logic/UniColor.h" #include "../Logic/UniColor.h"
#include "../Limit/BWMode.h"
#include "../Logic/ExtP.h"
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
class Browse; class Browse;
class CustShow; class CustShow;
@ -52,7 +52,6 @@ namespace PPTX
public: public:
PPTX_LOGIC_BASE(ShowPr) PPTX_LOGIC_BASE(ShowPr)
public:
virtual void fromXML(XmlUtils::CXmlNode& node); virtual void fromXML(XmlUtils::CXmlNode& node);
virtual std::wstring toXML() const; virtual std::wstring toXML() const;
@ -60,24 +59,46 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const; virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader); virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
public: nullable<nsPresentationPr::Browse> Browse;
nullable<nsShowPr::Browse> Browse; nullable<nsPresentationPr::CustShow> CustShow;
nullable<nsShowPr::CustShow> CustShow; nullable<nsPresentationPr::Kiosk> Kiosk;
nullable<nsShowPr::Kiosk> Kiosk;
Logic::UniColor PenClr; Logic::UniColor PenClr;
nullable<nsShowPr::Present> Present; nullable<nsPresentationPr::Present> Present;
nullable<nsShowPr::SldAll> SldAll; nullable<nsPresentationPr::SldAll> SldAll;
nullable<nsShowPr::SldRg> SldRg; nullable<nsPresentationPr::SldRg> SldRg;
nullable_bool loop; nullable_bool loop;
nullable_bool showAnimation; nullable_bool showAnimation;
nullable_bool showNarration; nullable_bool showNarration;
nullable_bool useTimings; nullable_bool useTimings;
protected: protected:
virtual void FillParentPointersForChilds(); virtual void FillParentPointersForChilds();
}; };
} // namespace nsShowPr
class PrintPr : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(PrintPr)
virtual void fromXML(XmlUtils::CXmlNode& node);
virtual std::wstring toXML() const;
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
nullable_limit<Limit::PrintClrMode> clrMode;
nullable_limit<Limit::PrintWhat> prnWhat;
nullable_bool frameSlides;
nullable_bool hiddenSlides;
nullable_bool scaleToFitPaper;
std::vector<Logic::Ext> ExtLst;
protected:
virtual void FillParentPointersForChilds();
};
} // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX
#endif // PPTX_SHOWPR_FILE_INCLUDE_H_

View File

@ -34,7 +34,7 @@
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
void SldAll::fromXML(XmlUtils::CXmlNode& node) void SldAll::fromXML(XmlUtils::CXmlNode& node)
{ {
@ -53,5 +53,5 @@ namespace PPTX
void SldAll::FillParentPointersForChilds() void SldAll::FillParentPointersForChilds()
{ {
} }
} // namespace nsShowPr } // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX

View File

@ -30,21 +30,18 @@
* *
*/ */
#pragma once #pragma once
#ifndef PPTX_SHOWPR_SLDALL_INCLUDE_H_
#define PPTX_SHOWPR_SLDALL_INCLUDE_H_
#include "./../WrapperWritingElement.h" #include "./../WrapperWritingElement.h"
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
class SldAll : public WrapperWritingElement class SldAll : public WrapperWritingElement
{ {
public: public:
PPTX_LOGIC_BASE(SldAll) PPTX_LOGIC_BASE(SldAll)
public:
virtual void fromXML(XmlUtils::CXmlNode& node); virtual void fromXML(XmlUtils::CXmlNode& node);
virtual std::wstring toXML() const; virtual std::wstring toXML() const;
@ -54,7 +51,5 @@ namespace PPTX
protected: protected:
virtual void FillParentPointersForChilds(); virtual void FillParentPointersForChilds();
}; };
} // namespace nsShowPr } // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX
#endif // PPTX_SHOWPR_SLDALL_INCLUDE_H_

View File

@ -34,7 +34,7 @@
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
void SldRg::fromXML(XmlUtils::CXmlNode& node) void SldRg::fromXML(XmlUtils::CXmlNode& node)
{ {
@ -94,5 +94,5 @@ namespace PPTX
void SldRg::FillParentPointersForChilds() void SldRg::FillParentPointersForChilds()
{ {
} }
} // namespace nsShowPr } // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX

View File

@ -30,21 +30,18 @@
* *
*/ */
#pragma once #pragma once
#ifndef PPTX_SHOWPR_SLDRG_INCLUDE_H_
#define PPTX_SHOWPR_SLDRG_INCLUDE_H_
#include "./../WrapperWritingElement.h" #include "./../WrapperWritingElement.h"
namespace PPTX namespace PPTX
{ {
namespace nsShowPr namespace nsPresentationPr
{ {
class SldRg : public WrapperWritingElement class SldRg : public WrapperWritingElement
{ {
public: public:
PPTX_LOGIC_BASE(SldRg) PPTX_LOGIC_BASE(SldRg)
public:
virtual void fromXML(XmlUtils::CXmlNode& node); virtual void fromXML(XmlUtils::CXmlNode& node);
virtual std::wstring toXML() const; virtual std::wstring toXML() const;
@ -52,14 +49,11 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const; virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader); virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
public: nullable_int st;
nullable_int st; nullable_int end;
nullable_int end;
protected: protected:
virtual void FillParentPointersForChilds(); virtual void FillParentPointersForChilds();
}; };
} // namespace nsShowPr } // namespace nsPresentationPr
} // namespace PPTX } // namespace PPTX
#endif // PPTX_SHOWPR_SLDRG_INCLUDE_H_

View File

@ -107,7 +107,7 @@ SOURCES += \
../../../PPTXFormat/Theme/FontScheme.cpp \ ../../../PPTXFormat/Theme/FontScheme.cpp \
../../../PPTXFormat/Theme/ThemeElements.cpp \ ../../../PPTXFormat/Theme/ThemeElements.cpp \
\ \
../../../PPTXFormat/ShowPr/ShowPr.cpp \ ../../../PPTXFormat/ShowPr/PresentationPr.cpp \
../../../PPTXFormat/ShowPr/Present.cpp \ ../../../PPTXFormat/ShowPr/Present.cpp \
../../../PPTXFormat/ShowPr/Kiosk.cpp \ ../../../PPTXFormat/ShowPr/Kiosk.cpp \
../../../PPTXFormat/ShowPr/CustShow.cpp \ ../../../PPTXFormat/ShowPr/CustShow.cpp \
@ -202,6 +202,6 @@ HEADERS += \
../../../PPTXFormat/ShowPr/CustShow.h \ ../../../PPTXFormat/ShowPr/CustShow.h \
../../../PPTXFormat/ShowPr/Kiosk.h \ ../../../PPTXFormat/ShowPr/Kiosk.h \
../../../PPTXFormat/ShowPr/Present.h \ ../../../PPTXFormat/ShowPr/Present.h \
../../../PPTXFormat/ShowPr/ShowPr.h \ ../../../PPTXFormat/ShowPr/PresentationPr.h \
../../../PPTXFormat/ShowPr/SldAll.h \ ../../../PPTXFormat/ShowPr/SldAll.h \
../../../PPTXFormat/ShowPr/SldRg.h ../../../PPTXFormat/ShowPr/SldRg.h

View File

@ -635,7 +635,7 @@
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\CustShow.h" /> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\CustShow.h" />
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\Kiosk.h" /> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\Kiosk.h" />
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\Present.h" /> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\Present.h" />
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\ShowPr.h" /> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\PresentationPr.h" />
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\SldAll.h" /> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\SldAll.h" />
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\SldRg.h" /> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\SldRg.h" />
<ClInclude Include="..\..\..\PPTXFormat\Slide.h" /> <ClInclude Include="..\..\..\PPTXFormat\Slide.h" />
@ -1266,7 +1266,7 @@
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\CustShow.cpp" /> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\CustShow.cpp" />
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\Kiosk.cpp" /> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\Kiosk.cpp" />
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\Present.cpp" /> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\Present.cpp" />
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\ShowPr.cpp" /> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\PresentationPr.cpp" />
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\SldAll.cpp" /> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\SldAll.cpp" />
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\SldRg.cpp" /> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\SldRg.cpp" />
<ClCompile Include="..\..\..\PPTXFormat\Slide.cpp" /> <ClCompile Include="..\..\..\PPTXFormat\Slide.cpp" />

View File

@ -708,25 +708,25 @@
<Filter>Presentation</Filter> <Filter>Presentation</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\Browse.h"> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\Browse.h">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\CustShow.h"> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\CustShow.h">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\Kiosk.h"> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\Kiosk.h">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\Present.h"> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\Present.h">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\ShowPr.h"> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\PresentationPr.h">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\SldAll.h"> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\SldAll.h">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\PPTXFormat\ShowPr\SldRg.h"> <ClInclude Include="..\..\..\PPTXFormat\ShowPr\SldRg.h">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\PPTXFormat\Theme\ClrScheme.h"> <ClInclude Include="..\..\..\PPTXFormat\Theme\ClrScheme.h">
<Filter>Theme</Filter> <Filter>Theme</Filter>
@ -2471,25 +2471,25 @@
<Filter>Presentation</Filter> <Filter>Presentation</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\Browse.cpp"> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\Browse.cpp">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\CustShow.cpp"> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\CustShow.cpp">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\Kiosk.cpp"> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\Kiosk.cpp">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\Present.cpp"> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\Present.cpp">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\ShowPr.cpp"> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\PresentationPr.cpp">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\SldAll.cpp"> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\SldAll.cpp">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\PPTXFormat\ShowPr\SldRg.cpp"> <ClCompile Include="..\..\..\PPTXFormat\ShowPr\SldRg.cpp">
<Filter>ShowPr</Filter> <Filter>PresentationPr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\PPTXFormat\Theme\ClrScheme.cpp"> <ClCompile Include="..\..\..\PPTXFormat\Theme\ClrScheme.cpp">
<Filter>Theme</Filter> <Filter>Theme</Filter>
@ -3769,9 +3769,6 @@
<Filter Include="Presentation"> <Filter Include="Presentation">
<UniqueIdentifier>{1bccfc22-686e-4d82-8fd1-353cbc5479f2}</UniqueIdentifier> <UniqueIdentifier>{1bccfc22-686e-4d82-8fd1-353cbc5479f2}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="ShowPr">
<UniqueIdentifier>{47677fd9-1e35-4520-bcb1-bf87d1fec730}</UniqueIdentifier>
</Filter>
<Filter Include="Theme"> <Filter Include="Theme">
<UniqueIdentifier>{200ee36f-100d-4ba7-b62c-2dccbb924a09}</UniqueIdentifier> <UniqueIdentifier>{200ee36f-100d-4ba7-b62c-2dccbb924a09}</UniqueIdentifier>
</Filter> </Filter>
@ -3802,5 +3799,8 @@
<Filter Include="Common\Xml"> <Filter Include="Common\Xml">
<UniqueIdentifier>{1461f41f-a436-4c57-bb70-199577dca246}</UniqueIdentifier> <UniqueIdentifier>{1461f41f-a436-4c57-bb70-199577dca246}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="PresentationPr">
<UniqueIdentifier>{47677fd9-1e35-4520-bcb1-bf87d1fec730}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
</Project> </Project>