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();
......@@ -221,4 +221,4 @@ namespace PPTX
};
} // namespace PPTX
#endif // PPTX_COMMENTS_COMMENTSAUTHORS_H_
\ No newline at end of file
#endif // PPTX_COMMENTS_COMMENTSAUTHORS_H_
#pragma once
#pragma once
#ifndef PPTX_LOGIC_CNVCXNSPPR_INCLUDE_H_
#define PPTX_LOGIC_CNVCXNSPPR_INCLUDE_H_
......@@ -106,8 +106,14 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:cNvCxnSpPr"));
pWriter->EndAttributes();
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"));
pWriter->StartAttributes();
......@@ -144,7 +150,12 @@ namespace PPTX
pWriter->EndNode(_T("a:endCxn"));
}
pWriter->EndNode(_T("p:cNvCxnSpPr"));
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"));
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
......@@ -287,4 +298,4 @@ namespace PPTX
} // namespace Logic
} // namespace PPTX
#endif // PPTX_LOGIC_CNVCXNSPPR_INCLUDE_H
\ No newline at end of file
#endif // PPTX_LOGIC_CNVCXNSPPR_INCLUDE_H
......@@ -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();
......@@ -214,4 +185,4 @@ namespace PPTX
} // namespace Logic
} // namespace PPTX
#endif // PPTX_LOGIC_C_NV_PROPERTIES_INCLUDE_H
\ No newline at end of file
#endif // PPTX_LOGIC_C_NV_PROPERTIES_INCLUDE_H
#pragma once
#pragma once
#ifndef PPTX_LOGIC_CXNSP_INCLUDE_H_
#define PPTX_LOGIC_CXNSP_INCLUDE_H_
......@@ -41,14 +41,34 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:cxnSp"));
pWriter->EndAttributes();
nvCxnSpPr.toXmlWriter(pWriter);
spPr.toXmlWriter(pWriter);
pWriter->Write(style);
pWriter->EndNode(_T("p:cxnSp"));
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"));
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
......
#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();
......@@ -280,4 +280,4 @@ namespace PPTX
} // namespace Logic
} // namespace PPTX
#endif // PPTX_LOGIC_GD_INCLUDE_H_
\ No newline at end of file
#endif // PPTX_LOGIC_GD_INCLUDE_H_
#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);
......@@ -65,4 +65,4 @@ namespace PPTX
} // namespace Logic
} // namespace PPTX
#endif // PPTX_LOGIC_WAVAUDIOFILE_INCLUDE_H_
\ No newline at end of file
#endif // PPTX_LOGIC_WAVAUDIOFILE_INCLUDE_H_
#pragma once
#pragma once
#ifndef PPTX_LOGIC_NVCXNSPPR_INCLUDE_H_
#define PPTX_LOGIC_NVCXNSPPR_INCLUDE_H_
......@@ -50,14 +50,25 @@ namespace PPTX
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:nvCxnSpPr"));
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);
pWriter->EndNode(_T("p:nvCxnSpPr"));
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"));
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
......
#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"));
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
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
......@@ -171,4 +182,4 @@ namespace PPTX
} // namespace Logic
} // namespace PPTX
#endif // PPTX_LOGIC_NV_PROPERTIES_INCLUDE_H
\ No newline at end of file
#endif // PPTX_LOGIC_NV_PROPERTIES_INCLUDE_H
#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);
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);
......@@ -250,4 +250,4 @@ namespace PPTX
} // namespace nsTheme
} // namespace PPTX
#endif // PPTX_THEME_FMTSCHEME_INCLUDE_H
\ No newline at end of file
#endif // PPTX_THEME_FMTSCHEME_INCLUDE_H
#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);
......@@ -117,4 +117,4 @@ namespace PPTX
} // namespace nsTheme
} // namespace PPTX
#endif // PPTX_THEME_FONTSCHEME_INCLUDE_H
\ No newline at end of file
#endif // PPTX_THEME_FONTSCHEME_INCLUDE_H
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