mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-12 02:45:56 +08:00
Compare commits
21 Commits
core/devel
...
core/devel
| Author | SHA1 | Date | |
|---|---|---|---|
| bf6bfce051 | |||
| 805c24ff1a | |||
| 2c4bb7c808 | |||
| 15a711396f | |||
| 3d8403346b | |||
| 5700503efe | |||
| d01b1e7d41 | |||
| 584cc6ab80 | |||
| 4b727edde8 | |||
| 9d10c4ddce | |||
| d5026d014d | |||
| ac0b7e4e22 | |||
| 623fe25415 | |||
| c4c9d50aae | |||
| 5d8dda02ec | |||
| bc3461147d | |||
| 80d4e6057b | |||
| 2dc5c2916a | |||
| 5f9631a3c5 | |||
| ef7df69036 | |||
| b3961994d2 |
@ -6589,6 +6589,9 @@ public:
|
||||
OOX::CPath pathChartsWorksheetDir = m_oFileWriter.m_oChartWriter.m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR +_T("embeddings");
|
||||
OOX::CSystemUtility::CreateDirectories(pathChartsWorksheetDir.GetPath());
|
||||
|
||||
bool oldValueType = m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_bIsWord;
|
||||
|
||||
m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_bIsWord = false;
|
||||
m_oFileWriter.m_pDrawingConverter->SetDstContentRels();
|
||||
|
||||
std::wstring sThemeDir;
|
||||
@ -6640,6 +6643,8 @@ public:
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(bstrChartRelType, sRelsName, std::wstring(), &rIdChart);
|
||||
|
||||
pDrawingProperty->sChartRels = L"rId" + std::to_wstring( rIdChart);
|
||||
|
||||
m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_bIsWord = oldValueType;
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
@ -6689,7 +6694,7 @@ public:
|
||||
else if ( c_oSerImageType2::RelativeHeight == type )
|
||||
{
|
||||
pDrawingProperty->bRelativeHeight = true;
|
||||
pDrawingProperty->RelativeHeight = m_oBufferedStream.GetLong();
|
||||
pDrawingProperty->RelativeHeight = m_oBufferedStream.GetULong();
|
||||
}
|
||||
else if ( c_oSerImageType2::BSimplePos == type )
|
||||
{
|
||||
|
||||
@ -5651,7 +5651,7 @@ namespace BinDocxRW
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::RelativeHeight);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pAnchor.m_oRelativeHeight->GetValue());
|
||||
m_oBcw.m_oStream.WriteULONG(pAnchor.m_oRelativeHeight->GetValue());
|
||||
}
|
||||
if(pAnchor.m_bSimplePos.IsInit())
|
||||
{
|
||||
|
||||
@ -263,7 +263,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
|
||||
|
||||
if(false != Base64::Base64Decode((const char*)(pBase64Data + nIndex), nBase64DataSize - nIndex, pData, &nDataSize))
|
||||
{
|
||||
NSBinPptxRW::CDrawingConverter oDrawingConverter;
|
||||
NSBinPptxRW::CDrawingConverter oDrawingConverter;
|
||||
NSBinPptxRW::CBinaryFileReader& oBufferedStream = *oDrawingConverter.m_pReader;
|
||||
oBufferedStream.Init(pData, 0, nDataSize);
|
||||
|
||||
|
||||
@ -85,9 +85,9 @@ namespace BinXlsxRW{
|
||||
}
|
||||
bool CXlsxSerializer::loadFromFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sMediaDir, const std::wstring& sEmbedDir)
|
||||
{
|
||||
NSBinPptxRW::CDrawingConverter oOfficeDrawingConverter;
|
||||
oOfficeDrawingConverter.SetMediaDstPath(sMediaDir);
|
||||
oOfficeDrawingConverter.SetEmbedDstPath(sEmbedDir);
|
||||
NSBinPptxRW::CDrawingConverter oOfficeDrawingConverter;
|
||||
oOfficeDrawingConverter.SetMediaDstPath(sMediaDir);
|
||||
oOfficeDrawingConverter.SetEmbedDstPath(sEmbedDir);
|
||||
|
||||
//папка с бинарников
|
||||
std::wstring strFileInDir = NSSystemPath::GetDirectoryName(sSrcFileName);
|
||||
@ -95,7 +95,7 @@ namespace BinXlsxRW{
|
||||
oOfficeDrawingConverter.SetSourceFileDir(strFileInDir, 2);
|
||||
|
||||
BinXlsxRW::BinaryFileReader oBinaryFileReader;
|
||||
oBinaryFileReader.ReadFile(sSrcFileName, sDstPath, &oOfficeDrawingConverter, sXMLOptions);
|
||||
oBinaryFileReader.ReadFile(sSrcFileName, sDstPath, &oOfficeDrawingConverter, sXMLOptions);
|
||||
return true;
|
||||
}
|
||||
bool CXlsxSerializer::saveToFile(const std::wstring& sDstFileName, const std::wstring& sSrcPath, const std::wstring& sXMLOptions)
|
||||
|
||||
@ -166,8 +166,7 @@ std::wstring mediaitems::detectImageFileExtension(std::wstring &fileName)
|
||||
|
||||
std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, bool & isInternal, std::wstring & ref)
|
||||
{
|
||||
bool isMediaInternal = is_internal(href, odf_packet_);
|
||||
|
||||
bool isMediaInternal = true;
|
||||
std::wstring sub_path = L"media/";
|
||||
|
||||
std::wstring inputFileName;
|
||||
@ -175,10 +174,13 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
|
||||
{
|
||||
sub_path = L"charts/";
|
||||
}
|
||||
if ( type == typeMsObject || type == typeOleObject)
|
||||
else if ( type == typeMsObject || type == typeOleObject)
|
||||
{
|
||||
sub_path = L"embeddings/";
|
||||
}
|
||||
else
|
||||
isMediaInternal = is_internal(href, odf_packet_);
|
||||
|
||||
int number=0;
|
||||
|
||||
if ( type == typeChart) number = count_charts + 1;
|
||||
|
||||
@ -110,7 +110,7 @@ namespace utils {
|
||||
{
|
||||
if (!a_.empty())
|
||||
{
|
||||
return boost::lexical_cast<int>(a_.length())-1;
|
||||
return boost::lexical_cast<int>(a_) - 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
||||
@ -1763,7 +1763,11 @@ void XlsxConverter::convert(OOX::Spreadsheet::CCellAnchor *oox_anchor)
|
||||
else if (oox_anchor->m_oGroupShape.IsInit())
|
||||
{
|
||||
convert(oox_anchor->m_oGroupShape.GetPointer());
|
||||
}
|
||||
}
|
||||
else if (oox_anchor->m_oGraphicFrame.IsInit())
|
||||
{
|
||||
OoxConverter::convert(oox_anchor->m_oGraphicFrame.GetPointer());
|
||||
}
|
||||
}
|
||||
|
||||
void XlsxConverter::convert(OOX::Spreadsheet::CDrawing *oox_drawing)
|
||||
|
||||
@ -2962,12 +2962,10 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
|
||||
{
|
||||
if (!result) return;
|
||||
|
||||
PPTX::Logic::SpTree* pTree = new PPTX::Logic::SpTree();
|
||||
PPTX::Logic::SpTree* pTree = new PPTX::Logic::SpTree(L"wp");
|
||||
|
||||
if (bIsTop)
|
||||
pTree->m_name = L"wpg:wgp";
|
||||
else
|
||||
pTree->m_name = L"wpg:grpSp";
|
||||
if (bIsTop) pTree->m_lGroupIndex = 0;
|
||||
else pTree->m_lGroupIndex = 1;
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (oNode.GetNodes(L"*", oNodes))
|
||||
|
||||
@ -1066,7 +1066,7 @@ namespace NSBinPptxRW
|
||||
xfrm->chOffY = 0;
|
||||
xfrm->chExtX = 0;
|
||||
xfrm->chExtY = 0;
|
||||
m_oDefaultNote.cSld.spTree.m_name = _T("p:spTree");
|
||||
|
||||
m_oDefaultNote.cSld.spTree.grpSpPr.xfrm = xfrm;
|
||||
|
||||
// shape comment !!! (TODO:)
|
||||
@ -1090,6 +1090,11 @@ namespace NSBinPptxRW
|
||||
pTxRun->SetText(_T("")); // enter simple comment here
|
||||
|
||||
pShape->txBody = pTxBody;
|
||||
if (pShape->txBody.IsInit())
|
||||
{
|
||||
if (!pShape->txBody->bodyPr.IsInit())
|
||||
pShape->txBody->bodyPr = new PPTX::Logic::BodyPr;
|
||||
}
|
||||
|
||||
PPTX::Logic::RunElem elm;
|
||||
pTxBody->Paragrs[0].RunElems.push_back(elm);
|
||||
|
||||
@ -110,6 +110,8 @@ namespace PPTX
|
||||
|
||||
OOX::CPath FileContainer::CorrectPathRels(const OOX::CPath& path, OOX::Rels::CRelationShip* relation )
|
||||
{
|
||||
if (relation->IsExternal()) return relation->Target();
|
||||
|
||||
OOX::CPath filename = path / relation->Target();
|
||||
|
||||
if ( NSFile::CFileBinary::Exists(filename.GetPath()) == true ) return filename;
|
||||
|
||||
@ -75,9 +75,9 @@ namespace PPTX
|
||||
int nParentDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth ) )
|
||||
{
|
||||
std::wstring strName = oReader.GetName();
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
|
||||
|
||||
if (strName == L"a:graphicFrameLocks")
|
||||
if (strName == L"graphicFrameLocks")
|
||||
{
|
||||
ReadAttributesLocks(oReader);
|
||||
}
|
||||
@ -98,29 +98,29 @@ namespace PPTX
|
||||
{
|
||||
m_namespace = XmlUtils::GetNamespace(node.GetName());
|
||||
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (node.GetNode(_T("a:graphicFrameLocks"), oNode))
|
||||
XmlUtils::CXmlNode oNode = node.ReadNodeNoNS(L"graphicFrameLocks");
|
||||
if (oNode.IsValid())
|
||||
{
|
||||
oNode.ReadAttributeBase(L"noChangeAspect", noChangeAspect);
|
||||
oNode.ReadAttributeBase(L"noDrilldown", noDrilldown);
|
||||
oNode.ReadAttributeBase(L"noGrp", noGrp);
|
||||
oNode.ReadAttributeBase(L"noMove", noMove);
|
||||
oNode.ReadAttributeBase(L"noResize", noResize);
|
||||
oNode.ReadAttributeBase(L"noSelect", noSelect);
|
||||
oNode.ReadAttributeBase(L"noChangeAspect", noChangeAspect);
|
||||
oNode.ReadAttributeBase(L"noDrilldown", noDrilldown);
|
||||
oNode.ReadAttributeBase(L"noGrp", noGrp);
|
||||
oNode.ReadAttributeBase(L"noMove", noMove);
|
||||
oNode.ReadAttributeBase(L"noResize", noResize);
|
||||
oNode.ReadAttributeBase(L"noSelect", noSelect);
|
||||
}
|
||||
}
|
||||
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("noChangeAspect"), noChangeAspect);
|
||||
oAttr.Write(_T("noDrilldown"), noDrilldown);
|
||||
oAttr.Write(_T("noGrp"), noGrp);
|
||||
oAttr.Write(_T("noMove"), noMove);
|
||||
oAttr.Write(_T("noResize"), noResize);
|
||||
oAttr.Write(_T("noSelect"), noSelect);
|
||||
oAttr.Write(_T("noChangeAspect"), noChangeAspect);
|
||||
oAttr.Write(_T("noDrilldown"), noDrilldown);
|
||||
oAttr.Write(_T("noGrp"), noGrp);
|
||||
oAttr.Write(_T("noMove"), noMove);
|
||||
oAttr.Write(_T("noResize"), noResize);
|
||||
oAttr.Write(_T("noSelect"), noSelect);
|
||||
|
||||
return XmlUtils::CreateNode(m_namespace + L":cNvGraphicFramePr>", XmlUtils::CreateNode(_T("a:graphicFrameLocks"), oAttr));
|
||||
return XmlUtils::CreateNode(m_namespace + L":cNvGraphicFramePr", oAttr.m_strValue.empty() ? L"" : XmlUtils::CreateNode(L"a:graphicFrameLocks", oAttr));
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
@ -128,6 +128,7 @@ namespace PPTX
|
||||
std::wstring namespace_ = m_namespace;
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) namespace_ = L"xdr";
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX) namespace_ = L"wp";
|
||||
|
||||
pWriter->StartNode(namespace_ + L":cNvGraphicFramePr");
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ namespace PPTX
|
||||
{
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
|
||||
|
||||
if (_T("a:picLocks") == strName)
|
||||
if (_T("picLocks") == strName)
|
||||
{
|
||||
ReadAttributesLocks(oReader);
|
||||
}
|
||||
|
||||
@ -105,20 +105,31 @@ namespace PPTX
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual std::wstring toXML() const
|
||||
|
||||
std::wstring toXML2(std::wstring node_name) const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("id"), id);
|
||||
oAttr.Write(_T("name"), name);
|
||||
oAttr.Write(_T("descr"), descr);
|
||||
oAttr.Write(_T("hidden"), hidden);
|
||||
oAttr.Write(_T("title"), title);
|
||||
oAttr.Write(_T("id"), id);
|
||||
oAttr.Write(_T("name"), XmlUtils::EncodeXmlString(name));
|
||||
if (descr.IsInit())
|
||||
{
|
||||
std::wstring d = XmlUtils::EncodeXmlString(descr.get());
|
||||
XmlUtils::replace_all(d, L"\n", L"
");
|
||||
|
||||
oAttr.Write(_T("descr"), d);
|
||||
}
|
||||
oAttr.Write(_T("hidden"), hidden);
|
||||
if (title.IsInit()) oAttr.Write(_T("title"), XmlUtils::EncodeXmlString(title.get()));
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteNullable(hlinkClick);
|
||||
oValue.WriteNullable(hlinkHover);
|
||||
|
||||
return XmlUtils::CreateNode(m_namespace + L":cNvPr", oAttr, oValue);
|
||||
return XmlUtils::CreateNode(node_name.empty() ? (m_namespace + L":cNvPr") : node_name, oAttr, oValue);
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
return toXML2(L"");
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
@ -133,9 +144,6 @@ namespace PPTX
|
||||
}
|
||||
void toXmlWriter2(const std::wstring& strNS, NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
//if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX && id == -1)
|
||||
// return;
|
||||
|
||||
pWriter->StartNode(strNS + _T(":cNvPr"));
|
||||
|
||||
int _id = id;
|
||||
@ -153,11 +161,16 @@ namespace PPTX
|
||||
}
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute (_T("id"), _id);
|
||||
pWriter->WriteAttribute2(_T("name"), name);
|
||||
pWriter->WriteAttribute2(_T("descr"), descr);
|
||||
pWriter->WriteAttribute (_T("hidden"), hidden);
|
||||
pWriter->WriteAttribute (_T("title"), title);
|
||||
pWriter->WriteAttribute (_T("id"), _id);
|
||||
pWriter->WriteAttribute (_T("name"), XmlUtils::EncodeXmlString(name));
|
||||
if (descr.IsInit())
|
||||
{
|
||||
std::wstring d = XmlUtils::EncodeXmlString(descr.get());
|
||||
XmlUtils::replace_all(d, L"\n", L"
");
|
||||
pWriter->WriteAttribute (_T("descr"), d);
|
||||
}
|
||||
pWriter->WriteAttribute (_T("hidden"), hidden);
|
||||
if (title.IsInit()) pWriter->WriteAttribute (_T("title"), XmlUtils::EncodeXmlString(title.get()));
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
|
||||
@ -46,7 +46,10 @@ namespace PPTX
|
||||
{
|
||||
public:
|
||||
WritingElement_AdditionConstructors(CSld)
|
||||
PPTX_LOGIC_BASE2(CSld)
|
||||
|
||||
CSld() : spTree(L"p")
|
||||
{
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -149,7 +152,6 @@ namespace PPTX
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
spTree.m_name = _T("p:spTree");
|
||||
spTree.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
@ -164,7 +166,6 @@ namespace PPTX
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_string attrName;
|
||||
|
||||
nullable<Bg> bg;
|
||||
|
||||
@ -82,6 +82,9 @@ namespace PPTX
|
||||
|
||||
if (sName == L"a:avLst")
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
continue;
|
||||
|
||||
int nParentDepth1 = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
|
||||
{
|
||||
@ -97,6 +100,9 @@ namespace PPTX
|
||||
}
|
||||
else if (sName == L"a:gdLst")
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
continue;
|
||||
|
||||
int nParentDepth1 = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
|
||||
{
|
||||
@ -114,6 +120,9 @@ namespace PPTX
|
||||
rect = oReader;
|
||||
else if (sName == L"a:pathLst")
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
continue;
|
||||
|
||||
int nParentDepth1 = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
|
||||
{
|
||||
@ -129,6 +138,9 @@ namespace PPTX
|
||||
}
|
||||
else if (sName == L"a:ahLst")
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
continue;
|
||||
|
||||
int nParentDepth1 = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
|
||||
{
|
||||
@ -150,6 +162,9 @@ namespace PPTX
|
||||
}
|
||||
else if (sName == L"a:cxnLst")
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
continue;
|
||||
|
||||
int nParentDepth1 = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
|
||||
{
|
||||
|
||||
@ -144,7 +144,7 @@ namespace PPTX
|
||||
public:
|
||||
std::wstring GetODString()const
|
||||
{
|
||||
return _T("<cxn ang=\"") + ang + _T("\"><pos x=\"") + x + _T("\" y=\"") + y + _T("\" /></cxn>");
|
||||
return _T("<cxn ang=\"") + ang + _T("\"><pos x=\"") + x + _T("\" y=\"") + y + _T("\"/></cxn>");
|
||||
}
|
||||
};
|
||||
} // namespace Logic
|
||||
|
||||
@ -46,7 +46,11 @@ namespace PPTX
|
||||
class DefaultShapeDefinition : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(DefaultShapeDefinition)
|
||||
WritingElement_AdditionConstructors(DefaultShapeDefinition)
|
||||
|
||||
DefaultShapeDefinition()
|
||||
{
|
||||
}
|
||||
|
||||
DefaultShapeDefinition& operator=(const DefaultShapeDefinition& oSrc)
|
||||
{
|
||||
@ -61,11 +65,32 @@ namespace PPTX
|
||||
|
||||
return *this;
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
m_name = XmlUtils::GetNameNoNS(oReader.GetName());
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
int nCurDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nCurDepth ) )
|
||||
{
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
|
||||
|
||||
if (_T("spPr") == strName)
|
||||
spPr.fromXML(oReader);
|
||||
else if (_T("bodyPr") == strName)
|
||||
bodyPr = oReader;
|
||||
else if (_T("lstStyle") == strName)
|
||||
lstStyle.fromXML(oReader);
|
||||
else if (_T("style") == strName)
|
||||
style = oReader;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_name = XmlUtils::GetNameNoNS(node.GetName());
|
||||
m_name = XmlUtils::GetNameNoNS(node.GetName());
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
|
||||
@ -35,16 +35,35 @@
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/RId.h"
|
||||
|
||||
/*
|
||||
|
||||
<p:ext uri="{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}">
|
||||
<p14:media xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" r:embed="rId2">
|
||||
<p14:trim st="93333.0816" end="96583.4816"/>
|
||||
</p14:media>
|
||||
</p:ext>
|
||||
|
||||
*/
|
||||
//<p:ext uri="{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}">
|
||||
//<p14:media xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" r:embed="rId2">
|
||||
//<p14:trim st="93333.0816" end="96583.4816"/>
|
||||
//</p14:media>
|
||||
//</p:ext>
|
||||
|
||||
|
||||
//<ext uri="{05C60535-1F16-4fd2-B633-F4F36F0B64E0}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main">
|
||||
// <x14:sparklineGroups xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">
|
||||
// <x14:sparklineGroup displayEmptyCellsAs="gap">
|
||||
// <x14:colorSeries theme="5" tint="-0.499984740745262"/>
|
||||
// <x14:colorNegative theme="6"/>
|
||||
// <x14:colorAxis rgb="FF000000"/>
|
||||
// <x14:colorMarkers theme="5" tint="-0.499984740745262"/>
|
||||
// <x14:colorFirst theme="5" tint="0.39997558519241921"/>
|
||||
// <x14:colorLast theme="5" tint="0.39997558519241921"/>
|
||||
// <x14:colorHigh theme="5"/>
|
||||
// <x14:colorLow theme="5"/>
|
||||
// <x14:sparklines>
|
||||
// <x14:sparkline>
|
||||
// <xm:f>Лист1!D10:D12</xm:f>
|
||||
// <xm:sqref>H12</xm:sqref>
|
||||
// </x14:sparkline>
|
||||
// </x14:sparklines>
|
||||
// </x14:sparklineGroup>
|
||||
// </x14:sparklineGroups>
|
||||
//</ext>
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
|
||||
@ -77,7 +77,7 @@ namespace PPTX
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start_No_NS( oReader )
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("r:embed"), embed)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("r:link"), link )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("cstate"), cstate )
|
||||
|
||||
@ -84,25 +84,13 @@ namespace PPTX
|
||||
{
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
|
||||
if (_T("blip") == strName)
|
||||
{
|
||||
if (!blip.IsInit())
|
||||
blip = oReader;
|
||||
}
|
||||
blip = oReader;
|
||||
else if (_T("srcRect") == strName)
|
||||
{
|
||||
if (!srcRect.IsInit())
|
||||
srcRect = oReader;
|
||||
}
|
||||
srcRect = oReader;
|
||||
else if (_T("tile") == strName)
|
||||
{
|
||||
if (!tile.IsInit())
|
||||
tile = oReader;
|
||||
}
|
||||
tile = oReader;
|
||||
else if (_T("stretch") == strName)
|
||||
{
|
||||
if (!stretch.IsInit())
|
||||
stretch = oReader;
|
||||
}
|
||||
stretch = oReader;
|
||||
}
|
||||
}
|
||||
virtual OOX::EElementType getType () const
|
||||
|
||||
@ -98,6 +98,9 @@ namespace PPTX
|
||||
tileRect = oReader;
|
||||
else if (_T("gsLst") == strName)
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
continue;
|
||||
|
||||
int nCurDepth1 = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nCurDepth1 ) )
|
||||
{
|
||||
|
||||
@ -46,7 +46,9 @@ namespace PPTX
|
||||
{
|
||||
public:
|
||||
WritingElement_AdditionConstructors(Geometry)
|
||||
PPTX_LOGIC_BASE2(Geometry)
|
||||
Geometry()
|
||||
{
|
||||
}
|
||||
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
|
||||
@ -294,27 +294,20 @@ namespace PPTX
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
void GraphicFrame::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
void GraphicFrame::toXmlWriter2(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring namespace_ = m_namespace;
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX && pWriter->m_lGroupIndex >= 0) namespace_ = L"wpg";
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX && pWriter->m_lGroupIndex >= 0) namespace_ = L"xdr";
|
||||
|
||||
pWriter->StartNode(namespace_ + L":graphicFrame");
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
nvGraphicFramePr.toXmlWriter(pWriter);
|
||||
|
||||
if (xfrm.IsInit())
|
||||
|
||||
if (xfrm.IsInit() && pWriter->m_lDocType != XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
std::wstring namespace_ = m_namespace;
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX && pWriter->m_lGroupIndex >= 0) namespace_ = L"xdr";
|
||||
|
||||
xfrm->m_ns = namespace_;
|
||||
xfrm->toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
if (table.is_init())
|
||||
if (table.is_init())
|
||||
{
|
||||
pWriter->WriteString (L"<a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/table\">");
|
||||
table->toXmlWriter (pWriter);
|
||||
@ -326,6 +319,19 @@ namespace PPTX
|
||||
chartRec->toXmlWriter(pWriter);
|
||||
pWriter->WriteString(L"</a:graphicData></a:graphic>");
|
||||
}
|
||||
}
|
||||
void GraphicFrame::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring namespace_ = m_namespace;
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX && pWriter->m_lGroupIndex >= 0) namespace_ = L"wpg";
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX && pWriter->m_lGroupIndex >= 0) namespace_ = L"xdr";
|
||||
|
||||
pWriter->StartNode(namespace_ + L":graphicFrame");
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
toXmlWriter2(pWriter);
|
||||
|
||||
pWriter->EndNode(namespace_ + L":graphicFrame");
|
||||
}
|
||||
@ -527,24 +533,18 @@ namespace PPTX
|
||||
parentAs<Logic::SpTree>().NormalizeRect(pRect);
|
||||
}
|
||||
|
||||
std::wstring GraphicFrame::toXML() const
|
||||
|
||||
std::wstring GraphicFrame::toXML2() const
|
||||
{
|
||||
std::wstring sXml;
|
||||
|
||||
sXml += L"<" + m_namespace + L":graphicFrame macro=\"\">";
|
||||
|
||||
std::wstring sXml;
|
||||
sXml += nvGraphicFramePr.toXML();
|
||||
|
||||
sXml += L"<" + m_namespace + L":xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/>";
|
||||
sXml += L"</" + m_namespace + L":xfrm>";
|
||||
|
||||
if (xfrm.IsInit())
|
||||
|
||||
if (xfrm.IsInit() && m_namespace != L"wp")
|
||||
{
|
||||
xfrm->m_ns = m_namespace;
|
||||
sXml += xfrm->toXML();
|
||||
}
|
||||
|
||||
if (table.IsInit())
|
||||
if (table.IsInit())
|
||||
{
|
||||
sXml += L"<a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/table\">";
|
||||
sXml += table->toXML();
|
||||
@ -556,6 +556,15 @@ namespace PPTX
|
||||
sXml += chartRec->toXML();
|
||||
sXml += L"</a:graphicData></a:graphic>";
|
||||
}
|
||||
return sXml;
|
||||
}
|
||||
std::wstring GraphicFrame::toXML() const
|
||||
{
|
||||
std::wstring sXml;
|
||||
|
||||
sXml += L"<" + m_namespace + L":graphicFrame macro=\"\">";
|
||||
|
||||
sXml += toXML2();
|
||||
|
||||
sXml += L"</" + m_namespace + L":graphicFrame>";
|
||||
sXml += L"<" + m_namespace + L":clientData/>";
|
||||
@ -578,19 +587,6 @@ namespace PPTX
|
||||
if (pic.is_init())
|
||||
pic->SetParentPointer(this);
|
||||
}
|
||||
|
||||
//OOX::CPath GraphicFrame::GetPathBySpid()const
|
||||
//{
|
||||
// OOX::CPath filename;
|
||||
// if(parentFileIs<PPTX::Slide>())
|
||||
// filename = parentFileAs<PPTX::Slide>().GetPathBySpid(spid.get_value_or(_T("")));
|
||||
// else if(parentFileIs<PPTX::SlideLayout>())
|
||||
// filename = parentFileAs<PPTX::SlideLayout>().GetPathBySpid(spid.get_value_or(_T("")));
|
||||
// else if(parentFileIs<PPTX::SlideMaster>())
|
||||
// filename = parentFileAs<PPTX::SlideMaster>().GetPathBySpid(spid.get_value_or(_T("")));
|
||||
|
||||
// return filename;
|
||||
//}
|
||||
std::wstring GraphicFrame::GetVmlXmlBySpid(std::wstring & rels)const
|
||||
{
|
||||
std::wstring xml;
|
||||
|
||||
@ -70,9 +70,12 @@ namespace PPTX
|
||||
void ReadAttributes3(XmlUtils::CXmlLiteReader& oReader);
|
||||
|
||||
virtual std::wstring toXML() const;
|
||||
virtual void GetRect(Aggplus::RECT& pRect)const;
|
||||
std::wstring toXML2() const;
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
void toXmlWriter2(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
|
||||
virtual void GetRect(Aggplus::RECT& pRect)const;
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
|
||||
@ -50,8 +50,9 @@ namespace PPTX
|
||||
public:
|
||||
WritingElement_AdditionConstructors(GrpSpPr)
|
||||
|
||||
GrpSpPr()
|
||||
GrpSpPr(std::wstring ns = L"p")
|
||||
{
|
||||
m_namespace = ns;
|
||||
}
|
||||
GrpSpPr& operator=(const GrpSpPr& oSrc)
|
||||
{
|
||||
@ -71,9 +72,48 @@ namespace PPTX
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
m_namespace = XmlUtils::GetNamespace(oReader.GetName());
|
||||
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
int nParentDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth ) )
|
||||
{
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
|
||||
|
||||
if ( L"xfrm" == sName)
|
||||
xfrm = oReader;
|
||||
else if ( L"blipFill" == sName ||
|
||||
L"gradFill" == sName ||
|
||||
L"grpFill" == sName ||
|
||||
L"noFill" == sName ||
|
||||
L"pattFill" == sName ||
|
||||
L"solidFill" == sName )
|
||||
{
|
||||
Fill.fromXML(oReader);
|
||||
}
|
||||
else if ( L"effectDag" == sName ||
|
||||
L"effectLst" == sName ||
|
||||
L"extLst" == sName )
|
||||
{
|
||||
EffectList.fromXML(oReader);
|
||||
}
|
||||
}
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("bwMode"), bwMode )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_namespace = XmlUtils::GetNamespace(node.GetName());
|
||||
|
||||
node.ReadAttributeBase(L"bwMode", bwMode);
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
@ -117,17 +157,16 @@ namespace PPTX
|
||||
oValue.Write(EffectList);
|
||||
oValue.WriteNullable(scene3d);
|
||||
|
||||
return XmlUtils::CreateNode(_T("p:grpSpPr"), oAttr, oValue);
|
||||
return XmlUtils::CreateNode(m_namespace + L":grpSpPr", oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
pWriter->StartNode(_T("wpg:grpSpPr"));
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->StartNode(_T("xdr:grpSpPr"));
|
||||
else
|
||||
pWriter->StartNode(_T("p:grpSpPr"));
|
||||
std::wstring namespace_ = m_namespace;
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX) namespace_ = L"wpg";
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) namespace_ = L"xdr";
|
||||
|
||||
pWriter->StartNode(namespace_ + L":grpSpPr");
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("bwMode"), bwMode);
|
||||
@ -138,12 +177,7 @@ namespace PPTX
|
||||
EffectList.toXmlWriter(pWriter);
|
||||
pWriter->Write(scene3d);
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
pWriter->EndNode(_T("wpg:grpSpPr"));
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->EndNode(_T("xdr:grpSpPr"));
|
||||
else
|
||||
pWriter->EndNode(_T("p:grpSpPr"));
|
||||
pWriter->EndNode(namespace_ + L":grpSpPr");
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
@ -215,8 +249,9 @@ namespace PPTX
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
std::wstring m_namespace;
|
||||
|
||||
public:
|
||||
nullable<Xfrm> xfrm;
|
||||
UniFill Fill;
|
||||
EffectProperties EffectList;
|
||||
@ -226,12 +261,11 @@ namespace PPTX
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
if(xfrm.IsInit())
|
||||
xfrm->SetParentPointer(this);
|
||||
Fill.SetParentPointer(this);
|
||||
EffectList.SetParentPointer(this);
|
||||
if(scene3d.IsInit())
|
||||
scene3d->SetParentPointer(this);
|
||||
|
||||
if(xfrm.IsInit()) xfrm->SetParentPointer(this);
|
||||
if(scene3d.IsInit()) scene3d->SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
} // namespace Logic
|
||||
|
||||
@ -37,6 +37,8 @@
|
||||
#include "./../Limit/PenAlign.h"
|
||||
#include "./../Limit/LineCap.h"
|
||||
#include "./../Limit/CompoundLine.h"
|
||||
|
||||
#include "EffectProperties.h"
|
||||
#include "UniFill.h"
|
||||
#include "PrstDash.h"
|
||||
#include "LineEnd.h"
|
||||
@ -97,8 +99,8 @@ namespace PPTX
|
||||
prstDash = oReader;
|
||||
//m_eDashType = OOX::Drawing::linedashtypePreset;
|
||||
}
|
||||
//else if ( _T("a:extLst") == sName )
|
||||
// extLst = oReader;
|
||||
else if ( _T("a:extLst") == sName )
|
||||
Effects.fromXML(oReader);
|
||||
}
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
@ -344,15 +346,15 @@ namespace PPTX
|
||||
public:
|
||||
// OOX::Drawing::ELineDashType m_eDashType; // Тип штриха
|
||||
|
||||
EffectProperties Effects;
|
||||
UniFill Fill;
|
||||
|
||||
nullable<PrstDash> prstDash;
|
||||
//custDash (Custom Dash) ยง20.1.8.21
|
||||
LineJoin Join;
|
||||
nullable<LineEnd> headEnd;
|
||||
nullable<LineEnd> tailEnd;
|
||||
|
||||
// nullable<ExtLst> extLst;
|
||||
|
||||
nullable_limit<Limit::PenAlign> algn;
|
||||
nullable_limit<Limit::LineCap> cap;
|
||||
nullable_limit<Limit::CompoundLine> cmpd;
|
||||
|
||||
@ -48,9 +48,9 @@ namespace PPTX
|
||||
public:
|
||||
WritingElement_AdditionConstructors(NvGrpSpPr)
|
||||
|
||||
NvGrpSpPr()
|
||||
NvGrpSpPr(std::wstring ns = L"p")
|
||||
{
|
||||
m_namespace = L"p";
|
||||
m_namespace = ns;
|
||||
}
|
||||
|
||||
NvGrpSpPr& operator=(const NvGrpSpPr& oSrc)
|
||||
@ -76,7 +76,9 @@ namespace PPTX
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring namespace_ = m_namespace;
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) namespace_ = L"xdr";
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX) namespace_ = L"wpg";
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) namespace_ = L"xdr";
|
||||
|
||||
pWriter->StartNode(namespace_ + L":nvGrpSpPr");
|
||||
|
||||
@ -132,7 +134,7 @@ namespace PPTX
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
std::wstring m_namespace;
|
||||
std::wstring m_namespace;
|
||||
|
||||
CNvPr cNvPr;
|
||||
CNvGrpSpPr cNvGrpSpPr;
|
||||
|
||||
@ -80,6 +80,9 @@ namespace PPTX
|
||||
ph = oReader;
|
||||
else if (strName == L"extLst")
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
continue;
|
||||
|
||||
int nParentDepth1 = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
|
||||
{
|
||||
|
||||
@ -138,6 +138,9 @@ namespace PPTX
|
||||
RunElems.push_back(RunElem(oReader));
|
||||
else if (_T("AlternateContent") == strName)
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
continue;
|
||||
|
||||
int nParentDepth1 = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
|
||||
{
|
||||
|
||||
@ -134,11 +134,11 @@ namespace PPTX
|
||||
|
||||
virtual std::wstring GetODString()const
|
||||
{
|
||||
std::wstring str = L"<a:pt x=\"" + x + L"\" y=\"" + y + L"\" />";
|
||||
return _T("<lnTo>") + str + _T("</lnTo>");
|
||||
std::wstring str = L"<pt x=\"" + x + L"\" y=\"" + y + L"\" />";
|
||||
return _T("<lnTo>") + str + _T("</lnTo>");
|
||||
}
|
||||
};
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_LOGIC_LINETO_INCLUDE_H_
|
||||
#endif // PPTX_LOGIC_LINETO_INCLUDE_H_
|
||||
|
||||
@ -132,7 +132,7 @@ namespace PPTX
|
||||
public:
|
||||
virtual std::wstring GetODString()const
|
||||
{
|
||||
std::wstring str = L"<a:pt x=\"" + x + L"\" y=\"" + y + L"\" />";
|
||||
std::wstring str = L"<pt x=\"" + x + L"\" y=\"" + y + L"\" />";
|
||||
return _T("<moveTo>") + str + _T("</moveTo>");
|
||||
}
|
||||
};
|
||||
|
||||
@ -161,8 +161,8 @@ namespace PPTX
|
||||
|
||||
virtual std::wstring GetODString()const
|
||||
{
|
||||
std::wstring str1 = L"<a:pt x=\"" + x[0] + L"\" y=\"" + y[0] + L"\" />";
|
||||
std::wstring str2 = L"<a:pt x=\"" + x[1] + L"\" y=\"" + y[1] + L"\" />";
|
||||
std::wstring str1 = L"<pt x=\"" + x[0] + L"\" y=\"" + y[0] + L"\" />";
|
||||
std::wstring str2 = L"<pt x=\"" + x[1] + L"\" y=\"" + y[1] + L"\" />";
|
||||
|
||||
return _T("<quadBezTo>") + str1 + str2 + _T("</quadBezTo>");
|
||||
}
|
||||
@ -170,4 +170,4 @@ namespace PPTX
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_LOGIC_QUADBEZTO_INCLUDE_H_
|
||||
#endif // PPTX_LOGIC_QUADBEZTO_INCLUDE_H_
|
||||
|
||||
@ -75,6 +75,9 @@ namespace PPTX
|
||||
|
||||
if (sName == L"a:avLst")
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
continue;
|
||||
|
||||
int nParentDepth1 = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
|
||||
{
|
||||
@ -95,7 +98,7 @@ namespace PPTX
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("r:prst"), prst)
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("prst"), prst)
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
|
||||
@ -75,6 +75,9 @@ namespace PPTX
|
||||
|
||||
if (_T("a:avLst") == strName)
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
continue;
|
||||
|
||||
int nCurDepth1 = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nCurDepth1 ) )
|
||||
{
|
||||
|
||||
@ -113,12 +113,14 @@ namespace PPTX
|
||||
|
||||
virtual bool is_init() const {return (Elem.IsInit());};
|
||||
virtual std::wstring GetText() const{return Elem->GetText();}
|
||||
|
||||
smart_ptr<RunBase> GetElem()
|
||||
{
|
||||
return Elem;
|
||||
}
|
||||
template<class T> AVSINLINE const bool is() const { return Elem.is<T>(); }
|
||||
template<class T> AVSINLINE T& as() { return Elem.as<T>(); }
|
||||
template<class T> AVSINLINE const T& as() const { return Elem.as<T>(); }
|
||||
|
||||
//public:
|
||||
private:
|
||||
smart_ptr<RunBase> Elem;
|
||||
protected:
|
||||
|
||||
@ -177,7 +177,7 @@ namespace PPTX
|
||||
{
|
||||
std::wstring name_ = m_name;
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX) name_ = L"wps:wsp";
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX) name_ = L"wps:wsp";
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) name_ = L"xdr:sp";
|
||||
|
||||
pWriter->StartNode(name_);
|
||||
@ -210,10 +210,8 @@ namespace PPTX
|
||||
|
||||
if (style.is_init())
|
||||
{
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
style->m_namespace = _T("wps");
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
style->m_namespace = _T("xdr");
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX) style->m_namespace = _T("wps");
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) style->m_namespace = _T("xdr");
|
||||
|
||||
pWriter->Write(style);
|
||||
}
|
||||
|
||||
@ -56,6 +56,12 @@ namespace PPTX
|
||||
m_diag = oSrc.m_diag;
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual OOX::EElementType getType () const
|
||||
{
|
||||
return OOX::et_dgm_DiagrammParts;
|
||||
}
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start ( oReader )
|
||||
|
||||
@ -51,8 +51,10 @@ namespace PPTX
|
||||
public:
|
||||
WritingElement_AdditionConstructors(SpTree)
|
||||
|
||||
SpTree()
|
||||
SpTree(std::wstring ns = L"p") : nvGrpSpPr(ns), grpSpPr(ns)
|
||||
{
|
||||
m_namespace = ns;
|
||||
m_lGroupIndex = 0;
|
||||
}
|
||||
|
||||
SpTree& operator=(const SpTree& oSrc)
|
||||
@ -66,7 +68,8 @@ namespace PPTX
|
||||
for (size_t i=0; i < oSrc.SpTreeElems.size(); i++)
|
||||
SpTreeElems.push_back(oSrc.SpTreeElems[i]);
|
||||
|
||||
m_name = oSrc.m_name;
|
||||
m_namespace = oSrc.m_namespace;
|
||||
m_lGroupIndex = oSrc.m_lGroupIndex;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@ -76,7 +79,7 @@ namespace PPTX
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
m_name = oReader.GetName();
|
||||
m_namespace = XmlUtils::GetNamespace(oReader.GetName());
|
||||
|
||||
SpTreeElems.clear();
|
||||
|
||||
@ -104,7 +107,14 @@ namespace PPTX
|
||||
{
|
||||
SpTreeElem elem(oReader);
|
||||
if (elem.is_init())
|
||||
{
|
||||
if (elem.getType() == OOX::et_p_ShapeTree)
|
||||
{
|
||||
smart_ptr<SpTree> e = elem.GetElem().smart_dynamic_cast<SpTree>();
|
||||
e->m_lGroupIndex = m_lGroupIndex + 1;
|
||||
}
|
||||
SpTreeElems.push_back(elem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,7 +123,7 @@ namespace PPTX
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_name = node.GetName();
|
||||
m_namespace = XmlUtils::GetNamespace(node.GetName());
|
||||
|
||||
nvGrpSpPr = node.ReadNodeNoNS(_T("nvGrpSpPr"));
|
||||
grpSpPr = node.ReadNodeNoNS(_T("grpSpPr"));
|
||||
@ -143,7 +153,14 @@ namespace PPTX
|
||||
{
|
||||
SpTreeElem elem(oNode);
|
||||
if (elem.is_init())
|
||||
{
|
||||
if (elem.getType() == OOX::et_p_ShapeTree)
|
||||
{
|
||||
smart_ptr<SpTree> e = elem.GetElem().smart_dynamic_cast<SpTree>();
|
||||
e->m_lGroupIndex = m_lGroupIndex + 1;
|
||||
}
|
||||
SpTreeElems.push_back(elem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -153,29 +170,45 @@ namespace PPTX
|
||||
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
std::wstring name_;
|
||||
if (m_namespace == L"wp")
|
||||
{
|
||||
if (m_lGroupIndex == 0) name_ = L"wpg:wgp";
|
||||
else name_ = L"wpg:grpSp";
|
||||
}
|
||||
else if (m_namespace == L"xdr") name_ = L"xdr:grpSp";
|
||||
else
|
||||
{
|
||||
if (m_lGroupIndex == 0) name_ = L"p:spTree";
|
||||
else name_ = L"p:grpSp";
|
||||
}
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(nvGrpSpPr);
|
||||
oValue.Write(grpSpPr);
|
||||
|
||||
oValue.WriteArray(SpTreeElems);
|
||||
|
||||
return XmlUtils::CreateNode(m_name, oValue);
|
||||
return XmlUtils::CreateNode(name_, oValue);
|
||||
}
|
||||
|
||||
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::WrapperFile>& oTheme, smart_ptr<PPTX::WrapperWritingElement>& oClrMap, bool in_group = false);
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring name_;
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
if (pWriter->m_lGroupIndex == 0)
|
||||
pWriter->StartNode(_T("wpg:wgp"));
|
||||
else
|
||||
pWriter->StartNode(_T("wpg:grpSp"));
|
||||
if (pWriter->m_lGroupIndex == 0) name_ = L"wpg:wgp";
|
||||
else name_ = L"wpg:grpSp";
|
||||
}
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->StartNode(_T("xdr:grpSp"));
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) name_ = L"xdr:grpSp";
|
||||
else
|
||||
pWriter->StartNode(m_name);
|
||||
{
|
||||
if (pWriter->m_lGroupIndex == 0) name_ = L"p:spTree";
|
||||
else name_ = L"p:grpSp";
|
||||
}
|
||||
pWriter->StartNode(name_);
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
@ -196,18 +229,8 @@ namespace PPTX
|
||||
SpTreeElems[i].toXmlWriter(pWriter);
|
||||
|
||||
pWriter->m_lGroupIndex--;
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
if (pWriter->m_lGroupIndex == 0)
|
||||
pWriter->EndNode(_T("wpg:wgp"));
|
||||
else
|
||||
pWriter->EndNode(_T("wpg:grpSp"));
|
||||
}
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->EndNode(_T("xdr:grpSp"));
|
||||
else
|
||||
pWriter->EndNode(m_name);
|
||||
|
||||
pWriter->EndNode(name_);
|
||||
}
|
||||
|
||||
void NormalizeRect(Aggplus::RECT& rect)const
|
||||
@ -273,12 +296,16 @@ namespace PPTX
|
||||
if(nElemLength > 0)
|
||||
{
|
||||
SpTreeElem elm;
|
||||
SpTreeElems.push_back(elm);
|
||||
SpTreeElems.back().fromPPTY(pReader);
|
||||
elm.fromPPTY(pReader);
|
||||
|
||||
if (!SpTreeElems.back().is_init())
|
||||
if (elm.is_init())
|
||||
{
|
||||
SpTreeElems.pop_back();
|
||||
if (elm.getType() == OOX::et_p_ShapeTree)
|
||||
{
|
||||
smart_ptr<SpTree> e = elm.GetElem().smart_dynamic_cast<SpTree>();
|
||||
e->m_lGroupIndex = m_lGroupIndex + 1;
|
||||
}
|
||||
SpTreeElems.push_back(elm);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -297,7 +324,8 @@ namespace PPTX
|
||||
Logic::GrpSpPr grpSpPr;
|
||||
std::vector<SpTreeElem> SpTreeElems;
|
||||
|
||||
std::wstring m_name;
|
||||
std::wstring m_namespace;
|
||||
int m_lGroupIndex;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
|
||||
@ -352,9 +352,14 @@ namespace PPTX
|
||||
case SPTREE_TYPE_SPTREE:
|
||||
{
|
||||
Logic::SpTree* p = new Logic::SpTree();
|
||||
p->m_name = _T("p:grpSp");
|
||||
pReader->Seek(pReader->GetPos() - 5); // type back + len
|
||||
p->fromPPTY(pReader);
|
||||
|
||||
if (getType() == OOX::et_p_ShapeTree)
|
||||
{
|
||||
smart_ptr<PPTX::Logic::SpTree> parent = GetElem().smart_dynamic_cast<PPTX::Logic::SpTree>();
|
||||
p->m_lGroupIndex = parent->m_lGroupIndex + 1;
|
||||
}
|
||||
m_elem.reset(p);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -86,6 +86,9 @@ namespace PPTX
|
||||
|
||||
if (strName == L"tblGrid")
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
continue;
|
||||
|
||||
int nParentDepth1 = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
|
||||
{
|
||||
|
||||
@ -107,25 +107,36 @@ namespace PPTX
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
std::wstring strName = oReader.GetName();
|
||||
|
||||
int nCurDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nCurDepth ) )
|
||||
if (_T("a:noAutofit") == strName)
|
||||
type = FitNo;
|
||||
else if (_T("a:spAutoFit") == strName)
|
||||
type = FitSpAuto;
|
||||
else if (_T("a:normAutofit") == strName)
|
||||
{
|
||||
std::wstring sName = oReader.GetName();
|
||||
type = FitNormAuto;
|
||||
|
||||
ReadAttributes(oReader);
|
||||
}
|
||||
}
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
nullable_string sFontScale;
|
||||
nullable_string sLnSpcRed;
|
||||
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("fontScale"), sFontScale)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("lnSpcReduction"), sLnSpcRed)
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
|
||||
Normalize(sFontScale, sLnSpcRed);
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
type = FitEmpty;
|
||||
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(node.GetName());
|
||||
std::wstring strName = node.GetName();
|
||||
|
||||
if (_T("a:noAutofit") == strName)
|
||||
type = FitNo;
|
||||
@ -141,33 +152,7 @@ namespace PPTX
|
||||
node.ReadAttributeBase(L"fontScale", sFontScale);
|
||||
node.ReadAttributeBase(L"lnSpcReduction", sLnSpcRed);
|
||||
|
||||
if (sFontScale.is_init())
|
||||
{
|
||||
int nFound = (int)sFontScale->rfind(wchar_t('%'));
|
||||
if (nFound < 0)
|
||||
fontScale = *sFontScale;
|
||||
else
|
||||
{
|
||||
std::wstring sRet = sFontScale->substr(0, nFound);
|
||||
double dRet = XmlUtils::GetDouble(sRet);
|
||||
int val = (int)(dRet * 1000);
|
||||
fontScale = val;
|
||||
}
|
||||
}
|
||||
|
||||
if (sLnSpcRed.is_init())
|
||||
{
|
||||
int nFound = (int)sLnSpcRed->rfind(wchar_t('%'));
|
||||
if (nFound < 0)
|
||||
lnSpcReduction = *sLnSpcRed;
|
||||
else
|
||||
{
|
||||
std::wstring sRet = sLnSpcRed->substr(0, nFound);
|
||||
double dRet = XmlUtils::GetDouble(sRet);
|
||||
int val = (int)(dRet * 1000);
|
||||
lnSpcReduction = val;
|
||||
}
|
||||
}
|
||||
Normalize(sFontScale, sLnSpcRed);
|
||||
}
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
@ -287,6 +272,37 @@ namespace PPTX
|
||||
nullable_int lnSpcReduction;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){}
|
||||
|
||||
void Normalize(nullable_string & sFontScale, nullable_string & sLnSpcRed)
|
||||
{
|
||||
if (sFontScale.is_init())
|
||||
{
|
||||
int nFound = (int)sFontScale->rfind(wchar_t('%'));
|
||||
if (nFound < 0)
|
||||
fontScale = *sFontScale;
|
||||
else
|
||||
{
|
||||
std::wstring sRet = sFontScale->substr(0, nFound);
|
||||
double dRet = XmlUtils::GetDouble(sRet);
|
||||
int val = (int)(dRet * 1000);
|
||||
fontScale = val;
|
||||
}
|
||||
}
|
||||
|
||||
if (sLnSpcRed.is_init())
|
||||
{
|
||||
int nFound = (int)sLnSpcRed->rfind(wchar_t('%'));
|
||||
if (nFound < 0)
|
||||
lnSpcReduction = *sLnSpcRed;
|
||||
else
|
||||
{
|
||||
std::wstring sRet = sLnSpcRed->substr(0, nFound);
|
||||
double dRet = XmlUtils::GetDouble(sRet);
|
||||
int val = (int)(dRet * 1000);
|
||||
lnSpcReduction = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
@ -97,7 +97,7 @@ namespace PPTX
|
||||
|
||||
if (spcPct.is_init())
|
||||
{
|
||||
oValue.m_strValue = L"<a:spcPct val=\"" + std::to_wstring(*spcPct) + L"\">";
|
||||
oValue.m_strValue = L"<a:spcPct val=\"" + std::to_wstring(*spcPct) + L"\"/>";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -47,9 +47,9 @@ namespace PPTX
|
||||
class TxBody : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
TxBody()
|
||||
TxBody(std::wstring name = L"p:txBody")
|
||||
{
|
||||
m_name = _T("p:txBody");
|
||||
m_name = name;
|
||||
}
|
||||
virtual ~TxBody() {}
|
||||
explicit TxBody(XmlUtils::CXmlNode& node)
|
||||
@ -161,10 +161,6 @@ namespace PPTX
|
||||
|
||||
void toXmlWriterExcel(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
/*
|
||||
pWriter->StartNode(_T("c:rich"));
|
||||
pWriter->EndAttributes();
|
||||
*/
|
||||
if (bodyPr.IsInit())
|
||||
{
|
||||
bodyPr->m_namespace = _T("a");
|
||||
@ -194,12 +190,12 @@ namespace PPTX
|
||||
return result;
|
||||
}
|
||||
|
||||
void Merge(nullable<TxBody>& txBody)const
|
||||
void Merge(nullable<TxBody>& txBody)
|
||||
{
|
||||
if(!txBody.is_init()) return;
|
||||
if (!bodyPr.IsInit())
|
||||
bodyPr = new Logic::BodyPr();
|
||||
|
||||
if(bodyPr.IsInit())
|
||||
bodyPr->Merge(txBody->bodyPr);
|
||||
bodyPr->Merge(txBody->bodyPr);
|
||||
|
||||
if(lstStyle.IsInit())
|
||||
lstStyle->Merge(txBody->lstStyle);
|
||||
@ -252,9 +248,11 @@ namespace PPTX
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
if (!bodyPr.IsInit())
|
||||
bodyPr = new Logic::BodyPr();
|
||||
}
|
||||
|
||||
nullable<BodyPr> bodyPr;
|
||||
nullable<TextListStyle> lstStyle;
|
||||
std::vector<Paragraph> Paragrs;
|
||||
@ -275,18 +273,10 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
bool IsOneLineParagraphs() const
|
||||
{
|
||||
if (!bodyPr.is_init()) return false;
|
||||
|
||||
if (!bodyPr->wrap.is_init()) return false;
|
||||
|
||||
return (bodyPr->wrap->get() == _T("none"));
|
||||
}
|
||||
|
||||
std::wstring GetDocxTxBoxContent(NSBinPptxRW::CBinaryFileWriter* pWriter, const nullable<PPTX::Logic::ShapeStyle>& shape_style);
|
||||
};
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_LOGIC_TXBODY_INCLUDE_H
|
||||
#endif // PPTX_LOGIC_TXBODY_INCLUDE_H
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
6967B1C11E27B4B800A129E2 /* RtfWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B1991E27B4B800A129E2 /* RtfWriter.cpp */; };
|
||||
6967B1C21E27B4B800A129E2 /* OOXDocumentWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B19F1E27B4B800A129E2 /* OOXDocumentWriter.cpp */; };
|
||||
6967B1C31E27B4B800A129E2 /* OOXWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B1A81E27B4B800A129E2 /* OOXWriter.cpp */; };
|
||||
69ACB6D31E7A983400096E94 /* svg_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69ACB6D11E7A983400096E94 /* svg_parser.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
@ -167,6 +168,8 @@
|
||||
6967B1C61E27B81B00A129E2 /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringBuilder.h; path = ../../../../DesktopEditor/common/StringBuilder.h; sourceTree = "<group>"; };
|
||||
6967B1C71E27B89400A129E2 /* PPTShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PPTShape.h; path = ../../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PPTShape.h; sourceTree = "<group>"; };
|
||||
6967B1C81E27B8F900A129E2 /* BaseShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaseShape.h; path = ../../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/BaseShape.h; sourceTree = "<group>"; };
|
||||
69ACB6D11E7A983400096E94 /* svg_parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = svg_parser.cpp; path = ../../../../ASCOfficeOdfFile/src/odf/svg_parser.cpp; sourceTree = "<group>"; };
|
||||
69ACB6D21E7A983400096E94 /* svg_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = svg_parser.h; path = ../../../../ASCOfficeOdfFile/src/odf/svg_parser.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -208,6 +211,7 @@
|
||||
6967B13D1E27B4B800A129E2 /* Reader */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69ACB6D01E7A982B00096E94 /* odf */,
|
||||
6967B13E1E27B4B800A129E2 /* OOXAbstractNumReader.h */,
|
||||
6967B13F1E27B4B800A129E2 /* OOXAppReader.h */,
|
||||
6967B1401E27B4B800A129E2 /* OOXBorderReader.h */,
|
||||
@ -355,6 +359,15 @@
|
||||
name = common;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69ACB6D01E7A982B00096E94 /* odf */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69ACB6D11E7A983400096E94 /* svg_parser.cpp */,
|
||||
69ACB6D21E7A983400096E94 /* svg_parser.h */,
|
||||
);
|
||||
name = odf;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@ -419,6 +432,7 @@
|
||||
6967B1B61E27B4B800A129E2 /* RtfField.cpp in Sources */,
|
||||
6967B1BB1E27B4B800A129E2 /* RtfParagraph.cpp in Sources */,
|
||||
6967B1AC1E27B4B800A129E2 /* OOXDrawingGraphicReader.cpp in Sources */,
|
||||
69ACB6D31E7A983400096E94 /* svg_parser.cpp in Sources */,
|
||||
6967B1AD1E27B4B800A129E2 /* OOXHeaderReader.cpp in Sources */,
|
||||
6967B1B31E27B4B800A129E2 /* RtfBookmark.cpp in Sources */,
|
||||
6967B1C11E27B4B800A129E2 /* RtfWriter.cpp in Sources */,
|
||||
@ -547,6 +561,7 @@
|
||||
PPT_DEF,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@ -579,6 +594,7 @@
|
||||
PPT_DEF,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
||||
@ -176,7 +176,9 @@ namespace OOX
|
||||
if ( m_sDescr.IsInit() )
|
||||
{
|
||||
sResult += _T("descr=\"");
|
||||
sResult += m_sDescr.get2();
|
||||
std::wstring d = XmlUtils::EncodeXmlString(m_sDescr.get());
|
||||
XmlUtils::replace_all(d, L"\n", L"
");
|
||||
sResult += d;
|
||||
sResult += _T("\" ");
|
||||
}
|
||||
if ( m_oHidden.IsInit() ) sResult += _T("hidden=\"") + m_oHidden->ToString() + _T("\" ");
|
||||
|
||||
@ -297,7 +297,13 @@ namespace OOX
|
||||
case 'x':
|
||||
|
||||
if ( _T("x:ClientData") == sName )
|
||||
{
|
||||
pItem = new OOX::Vml::CClientData( oReader );
|
||||
OOX::Vml::CClientData * client_data = dynamic_cast<OOX::Vml::CClientData*>(pItem);
|
||||
if ((client_data) && (client_data->m_oObjectType.IsInit()))
|
||||
if (client_data->m_oObjectType->GetValue() == SimpleTypes::Vml::vmlclientdataobjecttypeNote)
|
||||
m_bComment = true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ namespace OOX
|
||||
{
|
||||
public:
|
||||
WritingElement_AdditionConstructors(CVmlCommonElements)
|
||||
CVmlCommonElements(){}
|
||||
CVmlCommonElements(){m_bComment = false;}
|
||||
|
||||
virtual ~CVmlCommonElements(){}
|
||||
|
||||
@ -137,6 +137,9 @@ namespace OOX
|
||||
|
||||
std::wstring WriteAttributes() const;
|
||||
std::wstring WriteElements() const;
|
||||
|
||||
//internal
|
||||
bool m_bComment;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
@ -102,7 +102,7 @@ namespace OOX
|
||||
ReadAttributes( oReader );
|
||||
|
||||
std::wstring elementContent;
|
||||
bool bReadyElement = false;//собираем все до нахождения собственно элемента
|
||||
bool bReadyElement = false;//собираем все до нахождения собственно элемента
|
||||
|
||||
if ( !oReader.IsEmptyNode() )
|
||||
{
|
||||
@ -219,12 +219,15 @@ namespace OOX
|
||||
|
||||
OOX::Vml::CVmlCommonElements* common = dynamic_cast<OOX::Vml::CVmlCommonElements*>(pItem);
|
||||
std::wstring sSpid;
|
||||
|
||||
bool bComment = false;
|
||||
|
||||
if (common)
|
||||
{
|
||||
if (common->m_sSpId.IsInit()) sSpid = *common->m_sSpId;
|
||||
else if (common->m_sId.IsInit())sSpid = *common->m_sId;
|
||||
}
|
||||
|
||||
bComment = common->m_bComment;
|
||||
}
|
||||
else
|
||||
{
|
||||
OOX::Vml::CGroup *group = dynamic_cast<OOX::Vml::CGroup*>(pItem);
|
||||
@ -243,11 +246,13 @@ namespace OOX
|
||||
element.nId = (int)m_arrItems.size()-1;
|
||||
element.sXml = elementContent;
|
||||
element.pElement = pItem;
|
||||
element.bUsed = bComment;
|
||||
|
||||
m_mapShapes.insert(std::make_pair(sSpid, element));
|
||||
}
|
||||
elementContent.clear();
|
||||
bReadyElement = false;
|
||||
bReadyElement = false;
|
||||
bComment = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -224,7 +224,15 @@ namespace OOX
|
||||
|
||||
if (pShape == NULL) continue;
|
||||
|
||||
for(size_t j = 0, length2 = pShape->m_arrItems.size(); j < length2; ++j)
|
||||
if (pShape->m_sId.IsInit())
|
||||
{//mark shape as used
|
||||
std::map<std::wstring, OOX::CVmlDrawing::_vml_shape>::iterator pFind = pVmlDrawing->m_mapShapes.find(pShape->m_sId.get());
|
||||
if (pFind != pVmlDrawing->m_mapShapes.end())
|
||||
{
|
||||
pFind->second.bUsed = true;
|
||||
}
|
||||
}
|
||||
for(size_t j = 0, length2 = pShape->m_arrItems.size(); j < length2; ++j)
|
||||
{
|
||||
OOX::WritingElement* pElem = pShape->m_arrItems[j];
|
||||
if( OOX::et_v_ClientData == pElem->getType())
|
||||
|
||||
@ -553,6 +553,11 @@ HRESULT CPdfRenderer::NewPage()
|
||||
m_oFont.Reset();
|
||||
m_oPath.Clear();
|
||||
|
||||
// clear font!!!
|
||||
m_oFont.SetName(L"");
|
||||
m_oFont.SetSize(-1);
|
||||
m_oFont.SetStyle(1 << 5);
|
||||
|
||||
m_lClipDepth = 0;
|
||||
|
||||
m_nPagesCount++;//printf("Page %d\n", m_nPagesCount++);
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
QT -= core
|
||||
QT -= gui
|
||||
|
||||
VERSION = 2.0.3.444
|
||||
VERSION = 2.0.3.447
|
||||
DEFINES += INTVER=$$VERSION
|
||||
|
||||
TARGET = x2t
|
||||
|
||||
@ -344,52 +344,41 @@ namespace NExtractTools
|
||||
else return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
|
||||
return pptx_dir2pptt_bin(sTempUnpackedPPTX, sTo, params);
|
||||
return pptx_dir2pptt_bin(sTempUnpackedPPTX, sTo, sTemp, params);
|
||||
}
|
||||
int pptx_dir2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params)
|
||||
int pptx_dir2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
|
||||
{
|
||||
// convert unzipped pptx to unzipped pptt
|
||||
CPPTXFile *pptx_file = new CPPTXFile(NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
int nRes = 0;
|
||||
|
||||
|
||||
if (pptx_file)
|
||||
{
|
||||
#if defined(_WIN32) || defined (_WIN64)
|
||||
BSTR bstrFontPath = SysAllocString(params.getFontPath().c_str());
|
||||
BSTR bstrTempUnpackedPPTX = SysAllocString(sFrom.c_str());
|
||||
BSTR bstrTo = SysAllocString(sTo.c_str());
|
||||
|
||||
pptx_file->SetFontDir (bstrFontPath);
|
||||
nRes = (S_OK == pptx_file->OpenFileToPPTY (bstrTempUnpackedPPTX, bstrTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
|
||||
|
||||
SysFreeString(bstrFontPath);
|
||||
SysFreeString(bstrTempUnpackedPPTX);
|
||||
SysFreeString(bstrTo);
|
||||
#else
|
||||
pptx_file->put_TempDirectory(sTemp);
|
||||
pptx_file->SetFontDir (params.getFontPath());
|
||||
nRes = (S_OK == pptx_file->OpenFileToPPTY (sFrom, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
|
||||
#endif
|
||||
|
||||
delete pptx_file;
|
||||
}
|
||||
|
||||
|
||||
return nRes;
|
||||
}
|
||||
}
|
||||
// pptx -> pptt
|
||||
int pptx2pptt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
|
||||
{
|
||||
std::wstring sResultPpttDir = sTemp + FILE_SEPARATOR_STR + L"pptt_unpacked";
|
||||
std::wstring sTempPpttFileEditor = sResultPpttDir + FILE_SEPARATOR_STR + L"Editor.bin";
|
||||
|
||||
std::wstring sResultPpttDir = sTemp + FILE_SEPARATOR_STR + _T("pptt_unpacked");
|
||||
std::wstring sTempPpttFileEditor = sResultPpttDir + FILE_SEPARATOR_STR + _T("Editor.bin");
|
||||
|
||||
NSDirectory::CreateDirectory(sResultPpttDir);
|
||||
|
||||
|
||||
int nRes = pptx2pptt_bin(sFrom, sTempPpttFileEditor, sTemp, params);
|
||||
if (SUCCEEDED_X2T(nRes))
|
||||
{
|
||||
// zip pptt folder to output file
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
return nRes;
|
||||
}
|
||||
|
||||
@ -2160,36 +2149,36 @@ namespace NExtractTools
|
||||
}
|
||||
|
||||
int fromPptxDir(const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params)
|
||||
{
|
||||
int nRes = 0;
|
||||
if(0 != (AVS_OFFICESTUDIO_FILE_PRESENTATION & nFormatTo))
|
||||
{
|
||||
if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX == nFormatTo)
|
||||
{
|
||||
nRes = dir2zip(sFrom, sTo);
|
||||
}
|
||||
//else if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT == nFormatTo)
|
||||
//else if(AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP == nFormatTo)
|
||||
else
|
||||
nRes = AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
else if(AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION == nFormatTo)
|
||||
{
|
||||
nRes = pptx_dir2pptt_bin(sFrom, sTo, params);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring sPpttDir = sTemp + FILE_SEPARATOR_STR + L"pptt_unpacked";
|
||||
NSDirectory::CreateDirectory(sPpttDir);
|
||||
std::wstring sTFile = sPpttDir + FILE_SEPARATOR_STR + L"Editor.bin";
|
||||
|
||||
nRes = pptx_dir2pptt_bin(sFrom, sTFile, params);
|
||||
if(SUCCEEDED_X2T(nRes))
|
||||
{
|
||||
nRes = fromPpttBin(sTFile, sTo, nFormatTo, sTemp, sThemeDir, bFromChanges, bPaid, params);
|
||||
}
|
||||
}
|
||||
return nRes;
|
||||
{
|
||||
int nRes = 0;
|
||||
if(0 != (AVS_OFFICESTUDIO_FILE_PRESENTATION & nFormatTo))
|
||||
{
|
||||
if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX == nFormatTo)
|
||||
{
|
||||
nRes = dir2zip(sFrom, sTo);
|
||||
}
|
||||
//else if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT == nFormatTo)
|
||||
//else if(AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP == nFormatTo)
|
||||
else
|
||||
nRes = AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
else if(AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION == nFormatTo)
|
||||
{
|
||||
nRes = pptx_dir2pptt_bin(sFrom, sTo, sTemp, params);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring sPpttDir = sTemp + FILE_SEPARATOR_STR + _T("pptt_unpacked");
|
||||
NSDirectory::CreateDirectory(sPpttDir);
|
||||
std::wstring sTFile = sPpttDir + FILE_SEPARATOR_STR + _T("Editor.bin");
|
||||
|
||||
nRes = pptx_dir2pptt_bin(sFrom, sTFile, sTemp, params);
|
||||
if(SUCCEEDED_X2T(nRes))
|
||||
{
|
||||
nRes = fromPpttBin(sTFile, sTo, nFormatTo, sTemp, sThemeDir, bFromChanges, bPaid, params);
|
||||
}
|
||||
}
|
||||
return nRes;
|
||||
}
|
||||
int fromPpttBin(const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params)
|
||||
{
|
||||
|
||||
50
XlsxSerializerCom/Common/BinReaderWriterDefines.h
Normal file → Executable file
50
XlsxSerializerCom/Common/BinReaderWriterDefines.h
Normal file → Executable file
@ -242,39 +242,41 @@ namespace BinXlsxRW
|
||||
};}
|
||||
namespace c_oSerWorksheetColTypes{enum c_oSerWorksheetColTypes
|
||||
{
|
||||
BestFit = 0,
|
||||
Hidden = 1,
|
||||
Max = 2,
|
||||
Min = 3,
|
||||
Style = 4,
|
||||
Width = 5,
|
||||
CustomWidth = 6
|
||||
BestFit = 0,
|
||||
Hidden = 1,
|
||||
Max = 2,
|
||||
Min = 3,
|
||||
Style = 4,
|
||||
Width = 5,
|
||||
CustomWidth = 6,
|
||||
OutLevel = 7
|
||||
};}
|
||||
namespace c_oSerHyperlinkTypes{enum c_oSerWorksheetColTypes
|
||||
{
|
||||
Ref = 0,
|
||||
Hyperlink = 1,
|
||||
Location = 2,
|
||||
Tooltip = 3,
|
||||
Display = 4
|
||||
Ref = 0,
|
||||
Hyperlink = 1,
|
||||
Location = 2,
|
||||
Tooltip = 3,
|
||||
Display = 4
|
||||
};}
|
||||
namespace c_oSerSheetFormatPrTypes{enum c_oSerSheetFormatPrTypes
|
||||
{
|
||||
DefaultColWidth = 0,
|
||||
DefaultRowHeight = 1,
|
||||
BaseColWidth = 2,
|
||||
CustomHeight = 3,
|
||||
ZeroHeight = 4
|
||||
DefaultColWidth = 0,
|
||||
DefaultRowHeight = 1,
|
||||
BaseColWidth = 2,
|
||||
CustomHeight = 3,
|
||||
ZeroHeight = 4
|
||||
};}
|
||||
namespace c_oSerRowTypes{enum c_oSerRowTypes
|
||||
{
|
||||
Row = 0,
|
||||
Style = 1,
|
||||
Height = 2,
|
||||
Hidden = 3,
|
||||
Cells = 4,
|
||||
Cell = 5,
|
||||
CustomHeight = 6
|
||||
Row = 0,
|
||||
Style = 1,
|
||||
Height = 2,
|
||||
Hidden = 3,
|
||||
Cells = 4,
|
||||
Cell = 5,
|
||||
CustomHeight = 6,
|
||||
OutLevel = 7
|
||||
};}
|
||||
namespace c_oSerCellTypes{enum c_oSerCellTypes
|
||||
{
|
||||
|
||||
@ -1937,14 +1937,20 @@ namespace BinXlsxRW {
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDoubleReal(oCol.m_oWidth->GetValue());
|
||||
}
|
||||
//CustomWidth
|
||||
if(oCol.m_oCustomWidth.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWorksheetColTypes::CustomWidth);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oCol.m_oCustomWidth->ToBool());
|
||||
}
|
||||
}
|
||||
//CustomWidth
|
||||
if(oCol.m_oCustomWidth.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWorksheetColTypes::CustomWidth);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oCol.m_oCustomWidth->ToBool());
|
||||
}
|
||||
if(oCol.m_oOutlineLevel.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWorksheetColTypes::OutLevel);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(oCol.m_oOutlineLevel->GetValue());
|
||||
}
|
||||
}
|
||||
|
||||
void WriteSheetViews(const OOX::Spreadsheet::CSheetViews& oSheetViews)
|
||||
{
|
||||
@ -2402,7 +2408,13 @@ namespace BinXlsxRW {
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBOOL(oRows.m_oCustomHeight->ToBool());
|
||||
}
|
||||
if(oRows.m_arrItems.size() > 0)
|
||||
if(oRows.m_oOutlineLevel.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerRowTypes::OutLevel);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(oRows.m_oOutlineLevel->GetValue());
|
||||
}
|
||||
if(oRows.m_arrItems.size() > 0)
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerRowTypes::Cells);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
|
||||
|
||||
@ -2118,7 +2118,7 @@ namespace BinXlsxRW {
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
};
|
||||
}
|
||||
int ReadWorksheetProp(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
@ -2140,7 +2140,7 @@ namespace BinXlsxRW {
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
};
|
||||
}
|
||||
int ReadWorksheetCols(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
@ -2153,7 +2153,7 @@ namespace BinXlsxRW {
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
};
|
||||
}
|
||||
int ReadWorksheetCol(BYTE type, long length, void* poResult)
|
||||
{
|
||||
OOX::Spreadsheet::CCol* pCol = static_cast<OOX::Spreadsheet::CCol*>(poResult);
|
||||
@ -2198,10 +2198,15 @@ namespace BinXlsxRW {
|
||||
pCol->m_oCustomWidth.Init();
|
||||
pCol->m_oCustomWidth->SetValue(false != m_oBufferedStream.GetBool() ? SimpleTypes::onoffTrue : SimpleTypes::onoffFalse);
|
||||
}
|
||||
else
|
||||
else if(c_oSerWorksheetColTypes::OutLevel == type)
|
||||
{
|
||||
pCol->m_oOutlineLevel.Init();
|
||||
pCol->m_oOutlineLevel->SetValue(m_oBufferedStream.GetLong());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
};
|
||||
}
|
||||
int ReadSheetViews(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
@ -2978,7 +2983,12 @@ namespace BinXlsxRW {
|
||||
pRow->m_oCustomHeight.Init();
|
||||
pRow->m_oCustomHeight->SetValue(false != m_oBufferedStream.GetBool() ? SimpleTypes::onoffTrue : SimpleTypes::onoffFalse);
|
||||
}
|
||||
else if(c_oSerRowTypes::Cells == type)
|
||||
else if(c_oSerRowTypes::OutLevel == type)
|
||||
{
|
||||
pRow->m_oOutlineLevel.Init();
|
||||
pRow->m_oOutlineLevel->SetValue(m_oBufferedStream.GetLong());
|
||||
}
|
||||
else if(c_oSerRowTypes::Cells == type)
|
||||
{
|
||||
res = Read1(length, &BinaryWorksheetsTableReader::ReadCells, this, pRow);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user