mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
fix bug #70716
This commit is contained in:
@ -39,8 +39,34 @@ namespace PPTX
|
||||
void BgPr::fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlMacroReadAttributeBase(node, L"shadeToTitle", shadeToTitle);
|
||||
Fill.GetFillFrom(node);
|
||||
EffectList.GetEffectListFrom(node);
|
||||
|
||||
std::vector<XmlUtils::CXmlNode> oNodes;
|
||||
if (node.GetNodes(L"*", oNodes))
|
||||
{
|
||||
size_t nCount = oNodes.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode& oNode = oNodes[i];
|
||||
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if (L"blipFill" == strName ||
|
||||
L"gradFill" == strName ||
|
||||
L"grpFill" == strName ||
|
||||
L"noFill" == strName ||
|
||||
L"pattFill" == strName ||
|
||||
L"solidFill" == strName)
|
||||
{
|
||||
Fill.fromXML(oNode);
|
||||
}
|
||||
else if (L"effectDag" == strName ||
|
||||
L"effectLst" == strName)
|
||||
{
|
||||
EffectList.fromXML(oNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
@ -50,8 +50,6 @@ namespace PPTX
|
||||
}
|
||||
void EffectLst::fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
@ -197,7 +195,19 @@ namespace PPTX
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
EffectLst& EffectLst::operator=(const EffectLst& oSrc)
|
||||
{
|
||||
blur = oSrc.blur;
|
||||
fillOverlay = oSrc.fillOverlay;
|
||||
glow = oSrc.glow;
|
||||
innerShdw = oSrc.innerShdw;
|
||||
outerShdw = oSrc.outerShdw;
|
||||
prstShdw = oSrc.prstShdw;
|
||||
reflection = oSrc.reflection;
|
||||
softEdge = oSrc.softEdge;
|
||||
|
||||
return *this;
|
||||
}
|
||||
void EffectLst::Merge(EffectLst& effectLst) const
|
||||
{
|
||||
if (blur.IsInit())
|
||||
|
||||
@ -30,8 +30,6 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef PPTX_LOGIC_EFFECTLST_INCLUDE_H_
|
||||
#define PPTX_LOGIC_EFFECTLST_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "Effects/Blur.h"
|
||||
@ -61,10 +59,6 @@ namespace PPTX
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
|
||||
virtual std::wstring toXML() const;
|
||||
@ -90,5 +84,3 @@ namespace PPTX
|
||||
};
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_LOGIC_EFFECTLST_INCLUDE_H_
|
||||
|
||||
@ -35,6 +35,52 @@ namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
EffectProperties& EffectProperties::operator=(const EffectProperties& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
List.reset();
|
||||
if (oSrc.List.IsInit())
|
||||
{
|
||||
if (oSrc.List.is<EffectLst>())
|
||||
{
|
||||
List.reset(new EffectLst());
|
||||
List.as<EffectLst>() = oSrc.List.as<EffectLst>();
|
||||
}
|
||||
else if (oSrc.List.is<EffectDag>())
|
||||
{
|
||||
List.reset(new EffectDag());
|
||||
List.as<EffectDag>() = oSrc.List.as<EffectDag>();
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
OOX::EElementType EffectProperties::getType() const
|
||||
{
|
||||
if (List.IsInit())
|
||||
return List->getType();
|
||||
return OOX::et_Unknown;
|
||||
}
|
||||
void EffectProperties::fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
|
||||
|
||||
if (strName == L"effectLst")
|
||||
{
|
||||
Logic::EffectLst* pEffectLst = new Logic::EffectLst();
|
||||
*pEffectLst = oReader;
|
||||
List.reset(pEffectLst);
|
||||
}
|
||||
else if (strName == L"effectDag")
|
||||
{
|
||||
Logic::EffectDag* pEffectDag = new Logic::EffectDag();
|
||||
*pEffectDag = oReader;
|
||||
List.reset(pEffectDag);
|
||||
}
|
||||
else
|
||||
List.reset();
|
||||
}
|
||||
void EffectProperties::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG pos = pReader->GetPos();
|
||||
@ -60,6 +106,50 @@ namespace PPTX
|
||||
pReader->SkipRecord();
|
||||
}
|
||||
}
|
||||
void EffectProperties::fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(node.GetName());
|
||||
|
||||
if (L"effectLst" == strName)
|
||||
{
|
||||
Logic::EffectLst* pEffectLst = new Logic::EffectLst();
|
||||
pEffectLst->fromXML(node);
|
||||
List.reset(pEffectLst);
|
||||
}
|
||||
else if (L"effectDag" == strName)
|
||||
{
|
||||
Logic::EffectDag* pEffectDag = new Logic::EffectDag();
|
||||
pEffectDag->fromXML(node);
|
||||
List.reset(pEffectDag);
|
||||
}
|
||||
else List.reset();
|
||||
}
|
||||
std::wstring EffectProperties::toXML() const
|
||||
{
|
||||
if (!List.IsInit())
|
||||
return L"";
|
||||
return List->toXML();
|
||||
}
|
||||
void EffectProperties::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (List.is_init())
|
||||
List->toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
void EffectProperties::Merge(EffectProperties& effectProperties) const
|
||||
{
|
||||
if (List.IsInit() && List.is<EffectLst>())
|
||||
{
|
||||
effectProperties.List.reset(new EffectLst());
|
||||
List.as<EffectLst>().Merge(effectProperties.List.as<EffectLst>());
|
||||
}
|
||||
}
|
||||
|
||||
void EffectProperties::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
if (List.is_init())
|
||||
List->toPPTY(pWriter);
|
||||
}
|
||||
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
@ -30,8 +30,6 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef PPTX_LOGIC_EFFECTPROPERTIES_INCLUDE_H_
|
||||
#define PPTX_LOGIC_EFFECTPROPERTIES_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "EffectLst.h"
|
||||
@ -47,39 +45,10 @@ namespace PPTX
|
||||
WritingElement_AdditionMethods(EffectProperties)
|
||||
PPTX_LOGIC_BASE2(EffectProperties)
|
||||
|
||||
EffectProperties& operator=(const EffectProperties& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
EffectProperties& operator=(const EffectProperties& oSrc);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual OOX::EElementType getType () const
|
||||
{
|
||||
if (List.IsInit())
|
||||
return List->getType();
|
||||
return OOX::et_Unknown;
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
|
||||
|
||||
if (strName == _T("effectLst"))
|
||||
{
|
||||
Logic::EffectLst* pEffectLst = new Logic::EffectLst();
|
||||
*pEffectLst = oReader;
|
||||
List.reset(pEffectLst);
|
||||
}
|
||||
else if(strName == _T("effectDag"))
|
||||
{
|
||||
Logic::EffectDag* pEffectDag = new Logic::EffectDag();
|
||||
*pEffectDag = oReader;
|
||||
List.reset(pEffectDag);
|
||||
}
|
||||
else
|
||||
List.reset();
|
||||
}
|
||||
virtual OOX::EElementType getType() const;
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
|
||||
virtual bool is_init() const {return (List.IsInit());};
|
||||
|
||||
@ -87,72 +56,15 @@ namespace PPTX
|
||||
template<class T> T& as() {return static_cast<T&>(*List);}
|
||||
template<class T> const T& as() const {return static_cast<const T&>(*List);}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(node.GetName());
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
|
||||
if (strName == _T("effectLst"))
|
||||
{
|
||||
Logic::EffectLst* pEffectLst = new Logic::EffectLst();
|
||||
*pEffectLst = node;
|
||||
List.reset(pEffectLst);
|
||||
}
|
||||
else if(strName == _T("effectDag"))
|
||||
{
|
||||
Logic::EffectDag* pEffectDag = new Logic::EffectDag();
|
||||
*pEffectDag = node;
|
||||
List.reset(pEffectDag);
|
||||
}
|
||||
else List.reset();
|
||||
}
|
||||
virtual std::wstring toXML() const;
|
||||
|
||||
virtual void GetEffectListFrom(XmlUtils::CXmlNode& element)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode = element.ReadNodeNoNS(_T("effectLst"));
|
||||
if (oNode.IsValid())
|
||||
{
|
||||
Logic::EffectLst* pEffectLst = new Logic::EffectLst();
|
||||
*pEffectLst = oNode;
|
||||
List.reset(pEffectLst);
|
||||
return;
|
||||
}
|
||||
oNode = element.ReadNodeNoNS(_T("effectDag"));
|
||||
if (oNode.IsValid())
|
||||
{
|
||||
Logic::EffectDag* pEffectDag = new Logic::EffectDag();
|
||||
*pEffectDag = oNode;
|
||||
List.reset(pEffectDag);
|
||||
}
|
||||
else List.reset();
|
||||
}
|
||||
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
if (!List.IsInit())
|
||||
return _T("");
|
||||
return List->toXML();
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
if (List.is_init())
|
||||
List->toPPTY(pWriter);
|
||||
}
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (List.is_init())
|
||||
List->toXmlWriter(pWriter);
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
|
||||
void Merge(EffectProperties& effectProperties) const
|
||||
{
|
||||
if (List.IsInit() && List.is<EffectLst>())
|
||||
{
|
||||
effectProperties.List.reset(new EffectLst());
|
||||
List.as<EffectLst>().Merge(effectProperties.List.as<EffectLst>());
|
||||
}
|
||||
}
|
||||
void Merge(EffectProperties& effectProperties) const;
|
||||
|
||||
nullable<WrapperWritingElement> List;
|
||||
protected:
|
||||
@ -166,5 +78,3 @@ namespace PPTX
|
||||
};
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_LOGIC_EFFECTPROPERTIES_INCLUDE_H
|
||||
|
||||
@ -35,15 +35,52 @@ namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
EffectStyle& EffectStyle::operator=(const EffectStyle& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Effects = oSrc.Effects;
|
||||
scene3d = oSrc.scene3d;
|
||||
sp3d = oSrc.sp3d;
|
||||
return *this;
|
||||
}
|
||||
void EffectStyle::fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
EffectList.GetEffectListFrom(node);
|
||||
scene3d = node.ReadNode(_T("a:scene3d"));
|
||||
sp3d = node.ReadNode(_T("a:sp3d"));
|
||||
std::vector<XmlUtils::CXmlNode> oNodes;
|
||||
if (node.GetNodes(L"*", oNodes))
|
||||
{
|
||||
size_t nCount = oNodes.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode& oNode = oNodes[i];
|
||||
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if (L"scene3d" == strName)
|
||||
scene3d = oNode;
|
||||
else if (L"sp3d" == strName)
|
||||
sp3d = oNode;
|
||||
else if (L"effectDag" == strName ||
|
||||
L"effectLst" == strName)
|
||||
{
|
||||
Effects.fromXML(oNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
void EffectStyle::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(L"a:effectStyle");
|
||||
pWriter->EndAttributes();
|
||||
|
||||
Effects.toXmlWriter(pWriter);
|
||||
pWriter->Write(scene3d);
|
||||
pWriter->Write(sp3d);
|
||||
|
||||
pWriter->EndNode(L"a:effectStyle");
|
||||
}
|
||||
void EffectStyle::fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
@ -58,15 +95,49 @@ namespace PPTX
|
||||
else if (strName == L"a:sp3d")
|
||||
sp3d = oReader;
|
||||
else
|
||||
EffectList.fromXML(oReader);
|
||||
Effects.fromXML(oReader);
|
||||
}
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
void EffectStyle::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteRecord1(0, Effects);
|
||||
pWriter->WriteRecord2(1, scene3d);
|
||||
pWriter->WriteRecord2(2, sp3d);
|
||||
}
|
||||
void EffectStyle::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetRecordSize() + 4;
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Effects.fromPPTY(pReader);
|
||||
}break;
|
||||
case 1:
|
||||
{
|
||||
scene3d = new Logic::Scene3d();
|
||||
scene3d->fromPPTY(pReader);
|
||||
}break;
|
||||
case 2:
|
||||
{
|
||||
sp3d = new Logic::Sp3d();
|
||||
sp3d->fromPPTY(pReader);
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
void EffectStyle::FillParentPointersForChilds()
|
||||
{
|
||||
EffectList.SetParentPointer(this);
|
||||
Effects.SetParentPointer(this);
|
||||
if(scene3d.IsInit())
|
||||
scene3d->SetParentPointer(this);
|
||||
if(sp3d.IsInit())
|
||||
|
||||
@ -47,16 +47,8 @@ namespace PPTX
|
||||
WritingElement_AdditionMethods(EffectStyle)
|
||||
PPTX_LOGIC_BASE2(EffectStyle)
|
||||
|
||||
EffectStyle& operator=(const EffectStyle& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
EffectStyle& operator=(const EffectStyle& oSrc);
|
||||
|
||||
EffectList = oSrc.EffectList;
|
||||
scene3d = oSrc.scene3d;
|
||||
sp3d = oSrc.sp3d;
|
||||
return *this;
|
||||
}
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_a_effectStyle;
|
||||
@ -64,20 +56,12 @@ namespace PPTX
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:effectStyle"));
|
||||
pWriter->EndAttributes();
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
|
||||
EffectList.toXmlWriter(pWriter);
|
||||
pWriter->Write(scene3d);
|
||||
pWriter->Write(sp3d);
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
|
||||
pWriter->EndNode(_T("a:effectStyle"));
|
||||
}
|
||||
|
||||
public:
|
||||
EffectProperties EffectList;
|
||||
EffectProperties Effects;
|
||||
nullable<Scene3d> scene3d;
|
||||
nullable<Sp3d> sp3d;
|
||||
protected:
|
||||
|
||||
@ -105,7 +105,7 @@ namespace PPTX
|
||||
void GrpSpPr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("bwMode"), bwMode )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, L"bwMode", bwMode )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
void GrpSpPr::fromXML(XmlUtils::CXmlNode& node)
|
||||
@ -115,7 +115,7 @@ namespace PPTX
|
||||
XmlMacroReadAttributeBase(node, L"bwMode", bwMode);
|
||||
|
||||
std::vector<XmlUtils::CXmlNode> oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
if (node.GetNodes(L"*", oNodes))
|
||||
{
|
||||
size_t count = oNodes.size();
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
@ -123,28 +123,39 @@ namespace PPTX
|
||||
XmlUtils::CXmlNode& oNode = oNodes[i];
|
||||
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
if (_T("xfrm") == strName)
|
||||
if (L"xfrm" == strName)
|
||||
{
|
||||
if (!xfrm.IsInit())
|
||||
xfrm = oNode;
|
||||
}
|
||||
else if (_T("scene3d") == strName)
|
||||
else if (L"blipFill" == strName ||
|
||||
L"gradFill" == strName ||
|
||||
L"grpFill" == strName ||
|
||||
L"noFill" == strName ||
|
||||
L"pattFill" == strName ||
|
||||
L"solidFill" == strName)
|
||||
{
|
||||
Fill.fromXML(oNode);
|
||||
}
|
||||
else if (L"scene3d" == strName)
|
||||
{
|
||||
if (!scene3d.IsInit())
|
||||
scene3d = oNode;
|
||||
}
|
||||
else if (L"effectDag" == strName ||
|
||||
L"effectLst" == strName)
|
||||
{
|
||||
EffectList.fromXML(oNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Fill.GetFillFrom(node);
|
||||
EffectList.GetEffectListFrom(node);
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
std::wstring GrpSpPr::toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.WriteLimitNullable(_T("bwMode"), bwMode);
|
||||
oAttr.WriteLimitNullable(L"bwMode", bwMode);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteNullable(xfrm);
|
||||
@ -168,7 +179,7 @@ namespace PPTX
|
||||
pWriter->StartNode(namespace_ + L":grpSpPr");
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("bwMode"), bwMode);
|
||||
pWriter->WriteAttribute(L"bwMode", bwMode);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->Write(xfrm);
|
||||
|
||||
@ -112,8 +112,6 @@ namespace PPTX
|
||||
XmlMacroReadAttributeBase(node, L"cmpd", cmpd);
|
||||
XmlMacroReadAttributeBase(node, L"w", w);
|
||||
|
||||
Fill.GetFillFrom(node);
|
||||
|
||||
std::vector<XmlUtils::CXmlNode> oNodes;
|
||||
if (node.GetNodes(L"*", oNodes))
|
||||
{
|
||||
@ -139,6 +137,20 @@ namespace PPTX
|
||||
{
|
||||
prstDash = oNode;
|
||||
}
|
||||
else if (L"blipFill" == strName ||
|
||||
L"gradFill" == strName ||
|
||||
L"grpFill" == strName ||
|
||||
L"noFill" == strName ||
|
||||
L"pattFill" == strName ||
|
||||
L"solidFill" == strName)
|
||||
{
|
||||
Fill.fromXML(oNode);
|
||||
}
|
||||
else if (L"effectDag" == strName ||
|
||||
L"effectLst" == strName)
|
||||
{
|
||||
Effects.fromXML(oNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -367,12 +367,23 @@ namespace PPTX
|
||||
uFillTx = oNode;
|
||||
else if (L"highlight" == strName)
|
||||
highlight = oNode;
|
||||
else if (L"blipFill" == strName ||
|
||||
L"gradFill" == strName ||
|
||||
L"grpFill" == strName ||
|
||||
L"noFill" == strName ||
|
||||
L"pattFill" == strName ||
|
||||
L"solidFill" == strName)
|
||||
{
|
||||
Fill.fromXML(oNode);
|
||||
}
|
||||
else if (L"effectDag" == strName ||
|
||||
L"effectLst" == strName)
|
||||
{
|
||||
EffectList.fromXML(oNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Fill.GetFillFrom(node);
|
||||
EffectList.GetEffectListFrom(node);
|
||||
|
||||
Normalize();
|
||||
|
||||
FillParentPointersForChilds();
|
||||
|
||||
@ -126,14 +126,10 @@ namespace PPTX
|
||||
{
|
||||
m_namespace = XmlUtils::GetNamespace(node.GetName());
|
||||
|
||||
Geometry.GetGeometryFrom(node);
|
||||
Fill.GetFillFrom(node);
|
||||
EffectList.GetEffectListFrom(node);
|
||||
|
||||
XmlMacroReadAttributeBase(node,L"bwMode", bwMode);
|
||||
|
||||
std::vector<XmlUtils::CXmlNode> oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
if (node.GetNodes(L"*", oNodes))
|
||||
{
|
||||
size_t nCount = oNodes.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
@ -142,17 +138,35 @@ namespace PPTX
|
||||
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if (_T("xfrm") == strName)
|
||||
if (L"xfrm" == strName)
|
||||
xfrm = oNode;
|
||||
else if (_T("ln") == strName)
|
||||
else if (L"ln" == strName)
|
||||
ln = oNode;
|
||||
else if (_T("scene3d") == strName)
|
||||
else if (L"scene3d" == strName)
|
||||
scene3d = oNode;
|
||||
else if (_T("sp3d") == strName)
|
||||
else if (L"sp3d" == strName)
|
||||
sp3d = oNode;
|
||||
else if (L"blipFill" == strName ||
|
||||
L"gradFill" == strName ||
|
||||
L"grpFill" == strName ||
|
||||
L"noFill" == strName ||
|
||||
L"pattFill" == strName ||
|
||||
L"solidFill" == strName)
|
||||
{
|
||||
Fill.fromXML(oNode);
|
||||
}
|
||||
else if ( L"effectDag" == strName ||
|
||||
L"effectLst" == strName)
|
||||
{
|
||||
EffectList.fromXML(oNode);
|
||||
}
|
||||
else if (L"prstGeom" == strName ||
|
||||
L"custGeom" == strName)
|
||||
{
|
||||
Geometry.fromXML(oNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
std::wstring SpPr::toXML() const
|
||||
@ -226,42 +240,35 @@ namespace PPTX
|
||||
case 0:
|
||||
{
|
||||
xfrm = new Logic::Xfrm();
|
||||
xfrm->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
xfrm->fromPPTY(pReader);
|
||||
}break;
|
||||
case 1:
|
||||
{
|
||||
Geometry.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
Geometry.fromPPTY(pReader);
|
||||
}break;
|
||||
case 2:
|
||||
{
|
||||
Fill.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
Fill.fromPPTY(pReader);
|
||||
}break;
|
||||
case 3:
|
||||
{
|
||||
ln = new Logic::Ln();
|
||||
ln->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
ln->fromPPTY(pReader);
|
||||
}break;
|
||||
case 4:
|
||||
{
|
||||
EffectList.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
EffectList.fromPPTY(pReader);
|
||||
}break;
|
||||
case 5:
|
||||
{
|
||||
scene3d = new Logic::Scene3d();
|
||||
scene3d->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
scene3d->fromPPTY(pReader);
|
||||
}break;
|
||||
case 6:
|
||||
{
|
||||
sp3d = new Logic::Sp3d();
|
||||
sp3d->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
sp3d->fromPPTY(pReader);
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -276,7 +283,7 @@ namespace PPTX
|
||||
void SpPr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("bwMode"), bwMode )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, L"bwMode", bwMode )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
void SpPr::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
@ -303,7 +310,7 @@ namespace PPTX
|
||||
pWriter->StartNode(name_);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("bwMode"), bwMode);
|
||||
pWriter->WriteAttribute(L"bwMode", bwMode);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->Write(xfrm);
|
||||
@ -311,7 +318,7 @@ namespace PPTX
|
||||
|
||||
if ((pWriter->m_lFlag & 0x02) != 0 && !Fill.is_init())
|
||||
{
|
||||
pWriter->WriteString(_T("<a:grpFill/>"));
|
||||
pWriter->WriteString(L"<a:grpFill/>");
|
||||
}
|
||||
Fill.toXmlWriter(pWriter);
|
||||
|
||||
|
||||
@ -118,13 +118,6 @@ namespace PPTX
|
||||
}
|
||||
void TableProperties::fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Fill.GetFillFrom(node);
|
||||
Effects.GetEffectListFrom(node);
|
||||
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (node.GetNode(_T("a:tableStyleId"), oNode))
|
||||
TableStyleId = oNode.GetTextExt();
|
||||
|
||||
XmlMacroReadAttributeBase(node, L"rtl", Rtl);
|
||||
XmlMacroReadAttributeBase(node, L"firstRow", FirstRow);
|
||||
XmlMacroReadAttributeBase(node, L"firstCol", FirstCol);
|
||||
@ -133,6 +126,36 @@ namespace PPTX
|
||||
XmlMacroReadAttributeBase(node, L"bandRow", BandRow);
|
||||
XmlMacroReadAttributeBase(node, L"bandCol", BandCol);
|
||||
|
||||
std::vector<XmlUtils::CXmlNode> oNodes;
|
||||
if (node.GetNodes(L"*", oNodes))
|
||||
{
|
||||
size_t nCount = oNodes.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode& oNode = oNodes[i];
|
||||
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if (L"tableStyleId" == strName)
|
||||
{
|
||||
TableStyleId = oNode.GetTextExt();
|
||||
}
|
||||
else if (L"blipFill" == strName ||
|
||||
L"gradFill" == strName ||
|
||||
L"grpFill" == strName ||
|
||||
L"noFill" == strName ||
|
||||
L"pattFill" == strName ||
|
||||
L"solidFill" == strName)
|
||||
{
|
||||
Fill.fromXML(oNode);
|
||||
}
|
||||
else if (L"effectDag" == strName ||
|
||||
L"effectLst" == strName)
|
||||
{
|
||||
Effects.fromXML(oNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
void TableProperties::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
|
||||
@ -58,19 +58,19 @@ namespace PPTX
|
||||
effectStyleLst.clear();
|
||||
bgFillStyleLst.clear();
|
||||
|
||||
name = node.GetAttribute(_T("name"));
|
||||
name = node.GetAttribute(L"name");
|
||||
|
||||
XmlUtils::CXmlNode oNode1 = node.ReadNode(_T("a:fillStyleLst"));
|
||||
XmlMacroLoadArray(oNode1, _T("*"), fillStyleLst, Logic::UniFill);
|
||||
XmlUtils::CXmlNode oNode1 = node.ReadNode(L"a:fillStyleLst");
|
||||
XmlMacroLoadArray(oNode1, L"*", fillStyleLst, Logic::UniFill);
|
||||
|
||||
XmlUtils::CXmlNode oNode2 = node.ReadNode(_T("a:lnStyleLst"));
|
||||
XmlMacroLoadArray(oNode2, _T("a:ln"), lnStyleLst, Logic::Ln);
|
||||
XmlUtils::CXmlNode oNode2 = node.ReadNode(L"a:lnStyleLst");
|
||||
XmlMacroLoadArray(oNode2, L"a:ln", lnStyleLst, Logic::Ln);
|
||||
|
||||
XmlUtils::CXmlNode oNode3 = node.ReadNode(_T("a:effectStyleLst"));
|
||||
XmlMacroLoadArray(oNode3, _T("a:effectStyle"), effectStyleLst, Logic::EffectStyle);
|
||||
XmlUtils::CXmlNode oNode3 = node.ReadNode(L"a:effectStyleLst");
|
||||
XmlMacroLoadArray(oNode3, L"a:effectStyle", effectStyleLst, Logic::EffectStyle);
|
||||
|
||||
XmlUtils::CXmlNode oNode4 = node.ReadNode(_T("a:bgFillStyleLst"));
|
||||
XmlMacroLoadArray(oNode4, _T("*"), bgFillStyleLst, Logic::UniFill);
|
||||
XmlUtils::CXmlNode oNode4 = node.ReadNode(L"a:bgFillStyleLst");
|
||||
XmlMacroLoadArray(oNode4, L"*", bgFillStyleLst, Logic::UniFill);
|
||||
|
||||
FillWithDefaults();
|
||||
FillParentPointersForChilds();
|
||||
@ -78,38 +78,45 @@ namespace PPTX
|
||||
std::wstring FmtScheme::toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("name"), name);
|
||||
oAttr.Write(L"name", name);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteArray(_T("a:fillStyleLst"), fillStyleLst);
|
||||
oValue.WriteArray(_T("a:lnStyleLst"), lnStyleLst);
|
||||
oValue.WriteArray(_T("a:effectStyleLst"), effectStyleLst);
|
||||
oValue.WriteArray(_T("a:bgFillStyleLst"), bgFillStyleLst);
|
||||
oValue.WriteArray(L"a:fillStyleLst", fillStyleLst);
|
||||
oValue.WriteArray(L"a:lnStyleLst", lnStyleLst);
|
||||
oValue.WriteArray(L"a:effectStyleLst", effectStyleLst);
|
||||
oValue.WriteArray(L"a:bgFillStyleLst", bgFillStyleLst);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:fmtScheme"), oAttr, oValue);
|
||||
return XmlUtils::CreateNode(L"a:fmtScheme", oAttr, oValue);
|
||||
}
|
||||
void FmtScheme::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:fmtScheme"));
|
||||
pWriter->StartNode(L"a:fmtScheme");
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute2(_T("name"), name);
|
||||
pWriter->WriteAttribute2(L"name", name);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->WriteArray(_T("a:fillStyleLst"), fillStyleLst);
|
||||
pWriter->WriteArray(_T("a:lnStyleLst"), lnStyleLst);
|
||||
//pWriter->WriteArray(_T("a:effectStyleLst"), effectStyleLst);
|
||||
// вот такой поуерпоинт (эффекты пока не читаем - а они нужны. даже если и не используются нигде)
|
||||
pWriter->WriteString(_T("<a:effectStyleLst><a:effectStyle><a:effectLst>\
|
||||
pWriter->WriteArray(L"a:fillStyleLst", fillStyleLst);
|
||||
pWriter->WriteArray(L"a:lnStyleLst", lnStyleLst);
|
||||
|
||||
if (effectStyleLst.empty())
|
||||
{
|
||||
// вот такой поуерпоинт (эффекты пока не читаем - а они нужны. даже если и не используются нигде)
|
||||
pWriter->WriteString(L"<a:effectStyleLst><a:effectStyle><a:effectLst>\
|
||||
<a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"38000\"/></a:srgbClr></a:outerShdw>\
|
||||
</a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">\
|
||||
<a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst>\
|
||||
<a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr>\
|
||||
</a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst>"));
|
||||
</a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst>");
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->WriteArray(L"a:effectStyleLst", effectStyleLst);
|
||||
}
|
||||
|
||||
pWriter->WriteArray(_T("a:bgFillStyleLst"), bgFillStyleLst);
|
||||
pWriter->WriteArray(L"a:bgFillStyleLst", bgFillStyleLst);
|
||||
|
||||
pWriter->EndNode(_T("a:fmtScheme"));
|
||||
pWriter->EndNode(L"a:fmtScheme");
|
||||
}
|
||||
void FmtScheme::GetLineStyle(int number, Logic::Ln& lnStyle) const
|
||||
{
|
||||
|
||||
@ -1307,15 +1307,15 @@ void OoxConverter::convert(PPTX::Logic::EffectStyle *oox_effects, DWORD ARGB)
|
||||
{
|
||||
if (!oox_effects) return;
|
||||
|
||||
if (oox_effects->EffectList.is_init())
|
||||
if (oox_effects->Effects.is_init())
|
||||
{
|
||||
if (oox_effects->EffectList.is<PPTX::Logic::EffectLst>())
|
||||
if (oox_effects->Effects.is<PPTX::Logic::EffectLst>())
|
||||
{
|
||||
convert(dynamic_cast<PPTX::Logic::EffectLst*>(oox_effects->EffectList.List.GetPointer()), ARGB);
|
||||
convert(dynamic_cast<PPTX::Logic::EffectLst*>(oox_effects->Effects.List.GetPointer()), ARGB);
|
||||
}
|
||||
else if(oox_effects->EffectList.is<PPTX::Logic::EffectDag>())
|
||||
else if(oox_effects->Effects.is<PPTX::Logic::EffectDag>())
|
||||
{
|
||||
convert(dynamic_cast<PPTX::Logic::EffectDag*>(oox_effects->EffectList.List.GetPointer()), ARGB);
|
||||
convert(dynamic_cast<PPTX::Logic::EffectDag*>(oox_effects->Effects.List.GetPointer()), ARGB);
|
||||
}
|
||||
}
|
||||
if (oox_effects->scene3d.IsInit())
|
||||
|
||||
Reference in New Issue
Block a user