";
for (auto p : Paragrs)
{
sResult += L"";
for (auto elm : p.RunElems)
{
smart_ptr run = elm.GetElem().smart_dynamic_cast();
if (run.IsInit())
{
if (run->rPr.IsInit())
{
sResult += L"rPr->latin.is_init())
{
sResult += L" face=\"" + run->rPr->latin->typeface + L"\"";
}
if (run->rPr->sz.is_init())
{
sResult += L" size=\"" + std::to_wstring(*run->rPr->sz / 5) + L"\""; //kf = 20
}
smart_ptr solidFill = run->rPr->Fill.Fill.smart_dynamic_cast();
if (solidFill.IsInit())
{
SimpleTypes::CHexColor color;
color.SetValue(SimpleTypes::hexcolorARGB);
color.Set_A(solidFill->Color.Color->alpha);
color.Set_R(solidFill->Color.Color->red);
color.Set_G(solidFill->Color.Color->green);
color.Set_B(solidFill->Color.Color->blue);
sResult += L" color=\"#" + color.ToStringNoAlpha() + L"\"";
}
sResult += L">";
if (run->rPr->b.is_init())
{
sResult += L"";
}
if (run->rPr->i.is_init())
{
sResult += L"";
}
sResult += run->GetText();
if (run->rPr->i.is_init())
{
sResult += L"";
}
if (run->rPr->b.is_init())
{
sResult += L"";
}
sResult += L"";
}
else
sResult += run->GetText();
}
}
sResult += L"
";
}
sResult += L"";
return sResult;
}
void TxBody::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(m_name);
pWriter->EndAttributes();
if (bodyPr.IsInit())
{
bodyPr->m_namespace = L"a";
bodyPr->toXmlWriter(pWriter);
}
if (sp3d.IsInit())
{
sp3d->toXmlWriter(pWriter);
}
if (lstStyle.IsInit())
lstStyle->m_name = L"a:lstStyle";
pWriter->Write(lstStyle);
size_t nCount = Paragrs.size();
for (size_t i = 0; i < nCount; ++i)
Paragrs[i].toXmlWriter(pWriter);
pWriter->EndNode(m_name);
}
void TxBody::toXmlWriterExcel(NSBinPptxRW::CXmlWriter* pWriter) const
{
if (bodyPr.IsInit())
{
bodyPr->m_namespace = L"a";
bodyPr->toXmlWriter(pWriter);
}
if (sp3d.IsInit())
{
sp3d->toXmlWriter(pWriter);
}
if (lstStyle.is_init())
lstStyle->m_name = L"a:lstStyle";
pWriter->Write(lstStyle);
size_t nCount = Paragrs.size();
for (size_t i = 0; i < nCount; ++i)
Paragrs[i].toXmlWriter(pWriter);
/*
pWriter->EndNode(L"c:rich"));
*/
}
std::wstring TxBody::GetText(bool bParagraphSeparator)const
{
std::wstring result;
size_t count = Paragrs.size();
for (size_t i = 0; i < count; ++i)
result += Paragrs[i].GetText(bParagraphSeparator);
return result;
}
void TxBody::Merge(nullable