Commit 5e0a77b0 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander Trofimov

PPTX:merge from branches\Docx2DoctConverter Revision: 59944, 59941, 59883, 59848, 59833

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59961 954022d7-b5bf-4e40-9824-e11837661b57
parent ac3c2e4d
#pragma once
#pragma once
#ifndef PPTX_COMMENTS_COMMENTSAUTHORS_H_
#define PPTX_COMMENTS_COMMENTSAUTHORS_H_
......@@ -43,8 +43,8 @@ namespace PPTX
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("id"), id);
pWriter->WriteAttribute(_T("name"), name);
pWriter->WriteAttribute(_T("initials"), initials);
pWriter->WriteAttribute2(_T("name"), name);
pWriter->WriteAttribute2(_T("initials"), initials);
pWriter->WriteAttribute(_T("lastIdx"), last_idx);
pWriter->WriteAttribute(_T("clrIdx"), clr_idx);
pWriter->EndAttributes();
......
#pragma once
#pragma once
#ifndef PPTX_LOGIC_CNVCXNSPPR_INCLUDE_H_
#define PPTX_LOGIC_CNVCXNSPPR_INCLUDE_H_
......@@ -106,7 +106,13 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
pWriter->StartNode(_T("wps:cNvCxnSpPr"));
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
pWriter->StartNode(_T("xdr:cNvCxnSpPr"));
else
pWriter->StartNode(_T("p:cNvCxnSpPr"));
pWriter->EndAttributes();
pWriter->StartNode(_T("a:cxnSpLocks"));
......@@ -144,6 +150,11 @@ namespace PPTX
pWriter->EndNode(_T("a:endCxn"));
}
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
pWriter->EndNode(_T("wps:cNvCxnSpPr"));
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
pWriter->EndNode(_T("xdr:cNvCxnSpPr"));
else
pWriter->EndNode(_T("p:cNvCxnSpPr"));
}
......
......@@ -48,45 +48,16 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
CString namespace_;
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
pWriter->StartNode(_T("pic:cNvPr"));
namespace_= _T("pic");
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
pWriter->StartNode(_T("xdr:cNvPr"));
namespace_= _T("xdr");
else
pWriter->StartNode(_T("p:cNvPr"));
namespace_= _T("p");
int _id = id;
if (_id < 0)
{
_id = pWriter->m_lObjectId;
++pWriter->m_lObjectId;
}
else
{
if (pWriter->m_lObjectId <= _id)
{
pWriter->m_lObjectId = _id + 1;
}
}
toXmlWriter2(namespace_, pWriter);
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("id"), _id);
pWriter->WriteAttribute(_T("name"), name);
pWriter->WriteAttribute(_T("descr"), descr);
pWriter->WriteAttribute(_T("hidden"), hidden);
pWriter->WriteAttribute(_T("title"), title);
pWriter->EndAttributes();
pWriter->Write(hlinkClick);
pWriter->Write(hlinkHover);
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
pWriter->EndNode(_T("pic:cNvPr"));
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
pWriter->EndNode(_T("xdr:cNvPr"));
else
pWriter->EndNode(_T("p:cNvPr"));
}
void toXmlWriter2(const CString& strNS, NSBinPptxRW::CXmlWriter* pWriter) const
{
......@@ -111,10 +82,10 @@ namespace PPTX
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("id"), _id);
pWriter->WriteAttribute(_T("name"), name);
pWriter->WriteAttribute(_T("descr"), descr);
pWriter->WriteAttribute2(_T("name"), name);
pWriter->WriteAttribute2(_T("descr"), descr);
pWriter->WriteAttribute(_T("hidden"), hidden);
pWriter->WriteAttribute(_T("title"), title);
pWriter->WriteAttribute2(_T("title"), title);
pWriter->EndAttributes();
......
#pragma once
#pragma once
#ifndef PPTX_LOGIC_CXNSP_INCLUDE_H_
#define PPTX_LOGIC_CXNSP_INCLUDE_H_
......@@ -41,13 +41,33 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
pWriter->StartNode(_T("wps:cxnSp"));
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
pWriter->StartNode(_T("xdr:cxnSp"));
else
pWriter->StartNode(_T("p:cxnSp"));
pWriter->EndAttributes();
nvCxnSpPr.toXmlWriter(pWriter);
spPr.toXmlWriter(pWriter);
if (style.is_init())
{
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
style->m_ns = _T("wps");
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
style->m_ns = _T("xdr");
pWriter->Write(style);
}
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
pWriter->EndNode(_T("wps:cxnSp"));
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
pWriter->EndNode(_T("xdr:cxnSp"));
else
pWriter->EndNode(_T("p:cxnSp"));
}
......
#pragma once
#pragma once
#ifndef PPTX_LOGIC_GD_INCLUDE_H_
#define PPTX_LOGIC_GD_INCLUDE_H_
......@@ -50,7 +50,7 @@ namespace PPTX
pWriter->StartNode(_T("a:gd"));
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("name"), name);
pWriter->WriteAttribute2(_T("name"), name);
pWriter->WriteAttribute(_T("fmla"), fmla);
pWriter->EndAttributes();
......
#pragma once
#pragma once
#ifndef PPTX_LOGIC_HYPERLINK_INCLUDE_H_
#define PPTX_LOGIC_HYPERLINK_INCLUDE_H_
......@@ -164,10 +164,10 @@ namespace PPTX
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("r:id"), id);
pWriter->WriteAttribute(_T("invalidUrl"), invalidUrl);
pWriter->WriteAttribute(_T("action"), action);
pWriter->WriteAttribute(_T("tgtFrame"), tgtFrame);
pWriter->WriteAttribute(_T("tooltip"), tooltip);
pWriter->WriteAttribute2(_T("invalidUrl"), invalidUrl);
pWriter->WriteAttribute2(_T("action"), action);
pWriter->WriteAttribute2(_T("tgtFrame"), tgtFrame);
pWriter->WriteAttribute2(_T("tooltip"), tooltip);
pWriter->WriteAttribute(_T("history"), history);
pWriter->WriteAttribute(_T("highlightClick"), highlightClick);
pWriter->WriteAttribute(_T("endSnd"), endSnd);
......
#pragma once
#pragma once
#ifndef PPTX_LOGIC_WAVAUDIOFILE_INCLUDE_H_
#define PPTX_LOGIC_WAVAUDIOFILE_INCLUDE_H_
......@@ -48,7 +48,7 @@ namespace PPTX
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("r:embed"), embed.ToString());
pWriter->WriteAttribute(_T("name"), name);
pWriter->WriteAttribute2(_T("name"), name);
pWriter->EndAttributes();
pWriter->EndNode(_T("a:") + m_name);
......
#pragma once
#pragma once
#ifndef PPTX_LOGIC_NVCXNSPPR_INCLUDE_H_
#define PPTX_LOGIC_NVCXNSPPR_INCLUDE_H_
......@@ -50,13 +50,24 @@ namespace PPTX
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
pWriter->StartNode(_T("wps:nvCxnSpPr"));
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
pWriter->StartNode(_T("xdr:nvCxnSpPr"));
else
pWriter->StartNode(_T("p:nvCxnSpPr"));
pWriter->EndAttributes();
cNvPr.toXmlWriter(pWriter);
cNvCxnSpPr.toXmlWriter(pWriter);
nvPr.toXmlWriter(pWriter);
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
pWriter->EndNode(_T("wps:nvCxnSpPr"));
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
pWriter->EndNode(_T("xdr:nvCxnSpPr"));
else
pWriter->EndNode(_T("p:nvCxnSpPr"));
}
......
#ifndef PPTX_LOGIC_NV_PROPERTIES_INCLUDE_H_
#ifndef PPTX_LOGIC_NV_PROPERTIES_INCLUDE_H_
#define PPTX_LOGIC_NV_PROPERTIES_INCLUDE_H_
#include "./../WrapperWritingElement.h"
......@@ -68,10 +68,21 @@ namespace PPTX
return XmlUtils::CreateNode(_T("p:nvPr"), oAttr, oValue);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:nvPr"));
CString namespace_;
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
namespace_= _T("pic");
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
namespace_= _T("xdr");
else
namespace_= _T("p");
toXmlWriter2(namespace_, pWriter);
}
void toXmlWriter2(const CString& strNS, NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(strNS + _T(":nvPr"));
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("isPhoto"), isPhoto);
......@@ -82,7 +93,7 @@ namespace PPTX
media.toXmlWriter(pWriter);
pWriter->WriteArray(_T("p:extLst"), extLst);
pWriter->EndNode(_T("p:nvPr"));
pWriter->EndNode(strNS + _T(":nvPr"));
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
......
#pragma once
#pragma once
#ifndef PPTX_LOGIC_FLD_INCLUDE_H_
#define PPTX_LOGIC_FLD_INCLUDE_H_
......@@ -78,7 +78,16 @@ namespace PPTX
oValue.WriteNullable(pPr);
if (text.IsInit())
oValue.m_strValue += (_T("<a:t>") + *text + _T("</a:t>"));
{
CString s = *text;
s.Replace(_T("&"), _T("&amp;"));
s.Replace(_T("'"), _T("&apos;"));
s.Replace(_T("<"), _T("&lt;"));
s.Replace(_T(">"), _T("&gt;"));
s.Replace(_T("\""), _T("&quot;"));
oValue.m_strValue += (_T("<a:t>") + s + _T("</a:t>"));
}
return XmlUtils::CreateNode(_T("a:fld"), oAttr, oValue);
}
......@@ -96,7 +105,11 @@ namespace PPTX
pWriter->Write(pPr);
if (text.IsInit())
pWriter->WriteString(_T("<a:t>") + *text + _T("</a:t>"));
{
pWriter->WriteString(_T("<a:t>"));
pWriter->WriteStringXML(*text);
pWriter->WriteString(_T("</a:t>"));
}
pWriter->EndNode(_T("a:fld"));
}
......
#pragma once
#pragma once
#ifndef PPTX_LOGIC_RUN_INCLUDE_H_
#define PPTX_LOGIC_RUN_INCLUDE_H_
......@@ -61,7 +61,16 @@ namespace PPTX
oValue.WriteNullable(rPr);
if (text.IsInit())
oValue.m_strValue += (_T("<a:t>") + *text + _T("</a:t>"));
{
CString s = *text;
s.Replace(_T("&"), _T("&amp;"));
s.Replace(_T("'"), _T("&apos;"));
s.Replace(_T("<"), _T("&lt;"));
s.Replace(_T(">"), _T("&gt;"));
s.Replace(_T("\""), _T("&quot;"));
oValue.m_strValue += (_T("<a:t>") + s + _T("</a:t>"));
}
return XmlUtils::CreateNode(_T("a:r"), oValue);
}
......
#pragma once
#pragma once
#ifndef PPTX_LOGIC_SHAPE_INCLUDE_H_
#define PPTX_LOGIC_SHAPE_INCLUDE_H_
......@@ -144,9 +144,9 @@ namespace PPTX
style->m_ns = _T("wps");
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
style->m_ns = _T("xdr");
}
pWriter->Write(style);
}
if (pWriter->m_lDocType != XMLWRITER_DOC_TYPE_DOCX)
{
......
#pragma once
#pragma once
#ifndef PPTX_THEME_CLRSCHEME_INCLUDE_H_
#define PPTX_THEME_CLRSCHEME_INCLUDE_H_
......@@ -72,7 +72,7 @@ namespace PPTX
pWriter->StartNode(_T("a:clrScheme"));
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("name"), name);
pWriter->WriteAttribute2(_T("name"), name);
pWriter->EndAttributes();
CString arr[12] = {_T("dk1"), _T("lt1"), _T("dk2"), _T("lt2"), _T("accent1"), _T("accent2"), _T("accent3"), _T("accent4"),
......
......@@ -75,7 +75,7 @@ namespace PPTX
pWriter->StartNode(_T("a:fmtScheme"));
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("name"), name);
pWriter->WriteAttribute2(_T("name"), name);
pWriter->EndAttributes();
pWriter->WriteArray(_T("a:fillStyleLst"), fillStyleLst);
......
#pragma once
#pragma once
#ifndef PPTX_THEME_FONTSCHEME_INCLUDE_H_
#define PPTX_THEME_FONTSCHEME_INCLUDE_H_
......@@ -51,7 +51,7 @@ namespace PPTX
pWriter->StartNode(_T("a:fontScheme"));
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("name"), name);
pWriter->WriteAttribute2(_T("name"), name);
pWriter->EndAttributes();
majorFont.toXmlWriter(pWriter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment