mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Compare commits
33 Commits
core-windo
...
core-windo
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d688b3922 | |||
| be8d427e26 | |||
| 7e0749ddda | |||
| 9f2324d208 | |||
| 6e258b85d7 | |||
| 24e55018a0 | |||
| 2352ae5d88 | |||
| 2cba43e6f3 | |||
| abcf8d0246 | |||
| c18b955467 | |||
| 7896b75001 | |||
| 7d188b2213 | |||
| 79ead484cc | |||
| be65f18a0e | |||
| 60f61109a1 | |||
| 4201bcecc6 | |||
| 7b7bfbc5dd | |||
| a70255e500 | |||
| 7e9dede9b3 | |||
| 9b7ad03465 | |||
| 3162bb0bfe | |||
| ec95648c43 | |||
| 72ac11ac07 | |||
| f70ea2b74f | |||
| db834666ba | |||
| 6ed0e13178 | |||
| 446e519110 | |||
| fb1fc01963 | |||
| 4651ae1bbb | |||
| 18606e23c6 | |||
| ed6d070d1f | |||
| f00cecbcaf | |||
| c9aee26fd6 |
@ -7196,6 +7196,8 @@ namespace BinDocxRW
|
||||
}
|
||||
void WriteColorSchemeMapping(const PPTX::Logic::ClrMap& oColorSchemeMapping)
|
||||
{
|
||||
int re_index[] = {0, 1, 2, 3, 4, 5, 10, 11, 6, 7, 8, 9, 10, 11, 10, 6, 7};
|
||||
|
||||
int nCurPos = 0;
|
||||
std::map<std::wstring, PPTX::Limit::ColorSchemeIndex>::const_iterator pFind;
|
||||
|
||||
@ -7204,84 +7206,84 @@ namespace BinDocxRW
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent1);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"accent2");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent2);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"accent3");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent3);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"accent4");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent4);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"accent5");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent5);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"accent6");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent6);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"bg1");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Bg1);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"bg2");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Bg2);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"folHlink");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::FollowedHyperlink);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"hlink");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Hyperlink);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"tx1");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::T1);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"tx2");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::T2);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Version="8,00"
|
||||
Name="OdfFileReaderTest"
|
||||
ProjectGUID="{C2882DDD-07E6-4314-AD4B-48F43F38D722}"
|
||||
RootNamespace="ASCOfficeOdfFileTest"
|
||||
|
||||
@ -49,6 +49,8 @@ struct _rect
|
||||
|
||||
struct drawing_object_description
|
||||
{
|
||||
bool bNotes_;
|
||||
|
||||
oox::RelsType type_;
|
||||
|
||||
std::wstring name_;
|
||||
|
||||
@ -144,7 +144,8 @@ void styles_context::docx_serialize_table_style(std::wostream & strm, std::wstri
|
||||
}
|
||||
namespace oox
|
||||
{
|
||||
math_context::math_context(odf_reader::fonts_container & fonts, bool graphic) : base_font_size_(12), fonts_container_(fonts)
|
||||
math_context::math_context(odf_reader::fonts_container & fonts, bool graphic) :
|
||||
base_font_size_(12), fonts_container_(fonts)
|
||||
{
|
||||
graphRPR_ = graphic;
|
||||
|
||||
|
||||
@ -57,9 +57,25 @@ namespace svg_path
|
||||
{
|
||||
CP_XML_NODE(val.command)
|
||||
{
|
||||
for (size_t i = 0; i < val.points.size(); i++)
|
||||
{
|
||||
oox_serialize(CP_XML_STREAM(), val.points[i]);
|
||||
if (val.command == L"a:ArcTo")
|
||||
{
|
||||
if (val.points.size() > 0)
|
||||
{
|
||||
CP_XML_ATTR(L"wR", (int)(val.points[0].x.get()));
|
||||
CP_XML_ATTR(L"hR", (int)(val.points[0].y.get()));
|
||||
}
|
||||
if (val.points.size() > 1)
|
||||
{
|
||||
CP_XML_ATTR(L"stAng", (int)(val.points[1].x.get() * 60000));
|
||||
CP_XML_ATTR(L"swAng", (int)(val.points[1].y.get() * 60000));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 0; i < val.points.size(); i++)
|
||||
{
|
||||
oox_serialize(CP_XML_STREAM(), val.points[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -112,7 +128,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
|
||||
_CP_OPT(std::wstring) strStrokeColor;
|
||||
_CP_OPT(int) iStroke;
|
||||
_CP_OPT(double) dStrokeWidth;
|
||||
_CP_OPT(double) dStrokeOpacity;
|
||||
_CP_OPT(double) dStrokeOpacity;
|
||||
_CP_OPT(bool) bWordArt;
|
||||
|
||||
odf_reader::GetProperty(prop, L"wordArt", bWordArt);
|
||||
@ -151,15 +167,23 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
|
||||
{
|
||||
if (fill != L"a:noFill")
|
||||
{
|
||||
if (color.length() < 1 && always_draw) color = L"000000";
|
||||
else if (color.length() <1 ) color = L"ffffff";
|
||||
if ( color.empty() )
|
||||
{
|
||||
if (always_draw) color = L"000000";
|
||||
else color = L"ffffff";
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
{
|
||||
CP_XML_ATTR(L"val",color);
|
||||
|
||||
if (dStrokeOpacity) CP_XML_NODE(L"a:alpha"){CP_XML_ATTR(L"val", *dStrokeOpacity);}
|
||||
|
||||
if (dStrokeOpacity)
|
||||
{
|
||||
CP_XML_NODE(L"a:alpha")
|
||||
{
|
||||
CP_XML_ATTR(L"val", (int)(*dStrokeOpacity * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -187,69 +211,33 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
|
||||
}
|
||||
void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_property> & prop)
|
||||
{
|
||||
_CP_OPT(int) iShapeIndex;
|
||||
_CP_OPT(bool) bWordArt;
|
||||
|
||||
odf_reader::GetProperty(prop, L"wordArt" , bWordArt);
|
||||
odf_reader::GetProperty(prop, L"odf-custom-draw-index" , iShapeIndex);
|
||||
|
||||
int count_values = 0, min_value = 0, max_value = 0;
|
||||
|
||||
if (!bWordArt && iShapeIndex)
|
||||
{
|
||||
count_values = _OO_OOX_custom_shapes[*iShapeIndex].count_values;
|
||||
min_value = _OO_OOX_custom_shapes[*iShapeIndex].min;
|
||||
max_value = _OO_OOX_custom_shapes[*iShapeIndex].max;
|
||||
}
|
||||
else if (iShapeIndex)
|
||||
{
|
||||
count_values = _OO_OOX_wordart[*iShapeIndex].count_values;
|
||||
min_value = _OO_OOX_wordart[*iShapeIndex].min;
|
||||
max_value = _OO_OOX_wordart[*iShapeIndex].max;
|
||||
}
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"a:avLst")
|
||||
{
|
||||
_CP_OPT(std::wstring) strVal;
|
||||
if (odf_reader::GetProperty(prop,L"draw-modifiers",strVal) && iShapeIndex)
|
||||
_CP_OPT(bool) bModifiers;
|
||||
_CP_OPT(std::wstring) strModifiers;
|
||||
odf_reader::GetProperty(prop, L"bModifiers", bModifiers);
|
||||
odf_reader::GetProperty(prop, L"oox-draw-modifiers", strModifiers);
|
||||
if (strModifiers)
|
||||
{
|
||||
std::vector< std::wstring > values;
|
||||
boost::algorithm::split(values, strVal.get(), boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
boost::algorithm::split(values, strModifiers.get(), boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
|
||||
if( count_values >0 && values.size()>0 && count_values < 3)//временное ограниечение .. хз как там свойства путаются
|
||||
{//если не заданы доп свойства - нефиг мучится
|
||||
int i=1;
|
||||
if (!values.empty() && values.back().empty()) values.pop_back();
|
||||
|
||||
_CP_OPT(int) iMax,iMin;
|
||||
odf_reader::GetProperty(prop,L"draw-modifiers-min",iMin);
|
||||
odf_reader::GetProperty(prop,L"draw-modifiers-max",iMax);
|
||||
values.resize(count_values);
|
||||
|
||||
BOOST_FOREACH(std::wstring & v, values)
|
||||
for (size_t i = 0; i < values.size(); i++)
|
||||
{
|
||||
if (values[i].empty()) continue;
|
||||
CP_XML_NODE(L"a:gd")
|
||||
{
|
||||
CP_XML_NODE(L"a:gd")
|
||||
{
|
||||
if (values.size() >1)
|
||||
CP_XML_ATTR(L"name",(L"adj" + boost::lexical_cast<std::wstring>(i++)));
|
||||
else
|
||||
CP_XML_ATTR(L"name",L"adj");
|
||||
double val=0;
|
||||
if (v.length()>0)val= boost::lexical_cast<double>(v);
|
||||
|
||||
if (iMin && iMax && iShapeIndex)
|
||||
{
|
||||
if (min_value < max_value)
|
||||
{
|
||||
double W = *iMax - *iMin;
|
||||
val = (val- (*iMin))/W * (max_value - min_value) + min_value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CP_XML_ATTR(L"fmla",L"val " + boost::lexical_cast<std::wstring>(static_cast<int>(val)));
|
||||
}
|
||||
if (values.size() > 1 || bModifiers)
|
||||
//весьма странное .. для некоторых модификаторов (напр math...) нужно указывать множественность их
|
||||
CP_XML_ATTR(L"name", L"adj" + std::to_wstring(i+1));
|
||||
else
|
||||
CP_XML_ATTR(L"name", L"adj");
|
||||
|
||||
CP_XML_ATTR(L"fmla", L"val " + values[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -342,37 +330,39 @@ void _oox_drawing::serialize_bodyPr(std::wostream & strm, const std::wstring & n
|
||||
|
||||
void _oox_drawing::serialize_shape(std::wostream & strm)
|
||||
{
|
||||
_CP_OPT(std::wstring) strVal;
|
||||
_CP_OPT(double) dVal;
|
||||
_CP_OPT(int) iOoxShapeIndex;
|
||||
_CP_OPT(bool) bWordArt, bOoxShape;
|
||||
_CP_OPT(std::wstring) sCustomPath;
|
||||
|
||||
odf_reader::GetProperty(additional, L"wordArt", bWordArt);
|
||||
odf_reader::GetProperty(additional, L"oox-geom-index", iOoxShapeIndex);
|
||||
odf_reader::GetProperty(additional, L"oox-geom", bOoxShape);
|
||||
|
||||
std::wstring shapeType;
|
||||
_CP_OPT(bool) bWordArt;
|
||||
|
||||
odf_reader::GetProperty(additional,L"wordArt", bWordArt);
|
||||
odf_reader::GetProperty(additional, L"custom_path", sCustomPath);
|
||||
|
||||
std::wstring shapeGeomPreset;
|
||||
|
||||
if (sub_type == 7)//custom
|
||||
{
|
||||
_CP_OPT(int) iVal;
|
||||
odf_reader::GetProperty(additional, L"odf-custom-draw-index",iVal);
|
||||
|
||||
if (iVal)
|
||||
shapeType = _OO_OOX_custom_shapes[*iVal].oox;
|
||||
else
|
||||
if (iOoxShapeIndex)
|
||||
shapeGeomPreset = _OO_OOX_custom_shapes[*iOoxShapeIndex].oox;
|
||||
else if (sCustomPath)
|
||||
sub_type = 6; //path
|
||||
|
||||
if (shapeType == L"textBox")
|
||||
if (shapeGeomPreset == L"textBox")
|
||||
{
|
||||
sub_type = 1;
|
||||
shapeType = L"rect";
|
||||
shapeGeomPreset = L"rect";
|
||||
}
|
||||
}
|
||||
else if (sub_type < 9 && sub_type >= 0)
|
||||
{
|
||||
shapeType = _ooxShapeType[sub_type];
|
||||
shapeGeomPreset = _ooxShapeType[sub_type]; //odf -> oox
|
||||
}
|
||||
|
||||
if (bWordArt) sub_type = 1;
|
||||
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
if (sub_type == 6 || sub_type == 8)
|
||||
@ -391,36 +381,44 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
|
||||
CP_XML_ATTR(L"t", 0);
|
||||
}
|
||||
//<a:rect b="b" l="0" r="r" t="0"/>
|
||||
if (odf_reader::GetProperty(additional, L"custom_path", strVal))
|
||||
{
|
||||
_CP_OPT(int) w, h;
|
||||
odf_reader::GetProperty(additional, L"custom_path_w", w);
|
||||
odf_reader::GetProperty(additional, L"custom_path_h", h);
|
||||
_CP_OPT(int) w, h;
|
||||
odf_reader::GetProperty(additional, L"custom_path_w", w);
|
||||
odf_reader::GetProperty(additional, L"custom_path_h", h);
|
||||
|
||||
CP_XML_NODE(L"a:pathLst")
|
||||
{
|
||||
CP_XML_NODE(L"a:path")
|
||||
{
|
||||
CP_XML_ATTR(L"w", w ? *w : cx);
|
||||
CP_XML_ATTR(L"h", h ? *h : cy);
|
||||
|
||||
CP_XML_STREAM() << strVal.get();
|
||||
|
||||
CP_XML_NODE(L"a:pathLst")
|
||||
{
|
||||
CP_XML_NODE(L"a:path")
|
||||
{
|
||||
CP_XML_ATTR(L"w", w ? *w : cx);
|
||||
CP_XML_ATTR(L"h", h ? *h : cy);
|
||||
|
||||
if (sCustomPath)
|
||||
{
|
||||
CP_XML_STREAM() << *sCustomPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shapeType.length() < 1)
|
||||
if (shapeGeomPreset.empty())
|
||||
{
|
||||
shapeType = L"rect";
|
||||
sub_type = 2;
|
||||
shapeGeomPreset = L"rect";
|
||||
sub_type = 2;
|
||||
}
|
||||
CP_XML_NODE(L"a:prstGeom")//автофигура
|
||||
{
|
||||
CP_XML_ATTR(L"prst", shapeType);
|
||||
if (!bWordArt) oox_serialize_aLst(CP_XML_STREAM(), additional);
|
||||
CP_XML_ATTR(L"prst", shapeGeomPreset);
|
||||
if (!bWordArt)
|
||||
{
|
||||
if (std::wstring::npos != shapeGeomPreset.find(L"mathPlus"))
|
||||
{
|
||||
additional.push_back(odf_reader::_property(L"bModifiers", true));
|
||||
}
|
||||
oox_serialize_aLst(CP_XML_STREAM(), additional);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bWordArt)
|
||||
|
||||
@ -153,7 +153,9 @@ void pptx_conversion_context::process_master_pages()
|
||||
get_text_context().set_process_layouts(true);
|
||||
|
||||
//берем только актуальные
|
||||
for (size_t master_index =0; master_index < masters.content.size();master_index++)
|
||||
odf_reader::office_element_ptr master_notes_;
|
||||
|
||||
for (size_t master_index = 0; master_index < masters.content.size(); master_index++)
|
||||
{
|
||||
start_master(master_index);
|
||||
|
||||
@ -163,10 +165,21 @@ void pptx_conversion_context::process_master_pages()
|
||||
if (master)
|
||||
{
|
||||
master->pptx_convert(*this);
|
||||
|
||||
if (!master_notes_ && master->presentation_notes_)
|
||||
master_notes_ = master->presentation_notes_;
|
||||
}
|
||||
|
||||
|
||||
end_master();
|
||||
}
|
||||
|
||||
if (master_notes_)
|
||||
{
|
||||
start_master_notes();
|
||||
master_notes_->pptx_convert(*this);
|
||||
end_master_notes();
|
||||
}
|
||||
process_masters_ = false;
|
||||
get_text_context().set_process_layouts(false);
|
||||
|
||||
@ -180,15 +193,15 @@ void pptx_conversion_context::process_theme(std::wstring name)
|
||||
{
|
||||
int current = themes_.size() + 1;
|
||||
|
||||
if (name.length()<1)
|
||||
if (name.empty())
|
||||
{
|
||||
name = L"User Theme: " + boost::lexical_cast<std::wstring>(current);
|
||||
}
|
||||
start_theme(name);
|
||||
//
|
||||
pptx_serialize_clrScheme(current_theme().clrSchemeData());
|
||||
pptx_serialize_fmtScheme(current_theme().fmtSchemeData());
|
||||
pptx_serialize_fontScheme(current_theme().fontSchemeData());
|
||||
pptx_serialize_clrScheme (current_theme().clrSchemeData());
|
||||
pptx_serialize_fmtScheme (current_theme().fmtSchemeData());
|
||||
pptx_serialize_fontScheme (current_theme().fontSchemeData());
|
||||
//
|
||||
end_theme();
|
||||
|
||||
@ -209,8 +222,6 @@ void pptx_conversion_context::start_document()
|
||||
|
||||
void pptx_conversion_context::end_document()
|
||||
{
|
||||
unsigned int count = 1;
|
||||
|
||||
for (size_t i = 0; i < slideMasters_.size(); i++)
|
||||
{
|
||||
pptx_xml_slideMaster_ptr& slideM = slideMasters_[i];
|
||||
@ -230,10 +241,11 @@ void pptx_conversion_context::end_document()
|
||||
CP_XML_ATTR(L"r:id", slideM->rId());
|
||||
}
|
||||
}
|
||||
count++;
|
||||
}
|
||||
if (!slideMasters_.empty())
|
||||
presentation_.slidesProperties() << slideMasters_[0]->Sizes().str();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
count=0;
|
||||
for (size_t i = 0; i < slides_.size(); i++)
|
||||
{
|
||||
pptx_xml_slide_ptr& slide = slides_[i];
|
||||
@ -249,13 +261,12 @@ void pptx_conversion_context::end_document()
|
||||
{
|
||||
CP_XML_NODE(L"p:sldId")
|
||||
{
|
||||
CP_XML_ATTR(L"id", 0x100 + count);
|
||||
CP_XML_ATTR(L"id", 0x100 + i);
|
||||
CP_XML_ATTR(L"r:id", slide->rId());
|
||||
}
|
||||
}
|
||||
count++;
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
//----------------------------------------------------------------------------------
|
||||
for (size_t i = 0; i < slideLayouts_.size(); i++)
|
||||
{
|
||||
pptx_xml_slideLayout_ptr& slideL = slideLayouts_[i];
|
||||
@ -267,30 +278,42 @@ void pptx_conversion_context::end_document()
|
||||
|
||||
output_document_->get_ppt_files().add_slideLayout(content);//slideMaster.xml
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//размеры страниц в презентации
|
||||
odf_reader::odf_read_context & context = root()->odf_context();
|
||||
odf_reader::page_layout_container & pageLayouts = context.pageLayoutContainer();
|
||||
|
||||
if ((pageLayouts.master_pages().size() > 0) && (pageLayouts.master_pages()[0]->attlist_.style_name_))//default
|
||||
{
|
||||
const std::wstring masterStyleName = pageLayouts.master_pages()[0]->attlist_.style_name_.get();
|
||||
const std::wstring pageProperties = root()->odf_context().pageLayoutContainer().page_layout_name_by_style(masterStyleName);
|
||||
//----------------------------------------------------------------------------------
|
||||
for (size_t i = 0; i < notes_.size(); i++)
|
||||
{
|
||||
pptx_xml_slideNotes_ptr& slideN = notes_[i];
|
||||
|
||||
odf_reader::page_layout_instance *pages_layouts = root()->odf_context().pageLayoutContainer().page_layout_by_name(pageProperties);
|
||||
|
||||
if (pages_layouts)pages_layouts->pptx_convert(*this);
|
||||
package::slide_content_ptr content = package::slide_content::create();
|
||||
|
||||
slideN->write_to(content->content());
|
||||
content->add_rels(slideN->Rels());//media & links rels
|
||||
|
||||
output_document_->get_ppt_files().add_notes(content);
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
pptx_serialize_size(current_presentation().notesSlidesSize(),6858000,9144000,L"p:notesSz");
|
||||
if (slideNotesMaster_)
|
||||
{
|
||||
package::slide_content_ptr content = package::slide_content::create();
|
||||
|
||||
slideNotesMaster_->write_to(content->content());
|
||||
content->add_rels(slideNotesMaster_->Rels());//media & links rels
|
||||
|
||||
output_document_->get_ppt_files().add_notesMaster(content);
|
||||
|
||||
CP_XML_WRITER(presentation_.slideNotesMastersData())//presentation.xml
|
||||
{
|
||||
CP_XML_NODE(L"p:notesMasterId")
|
||||
{
|
||||
CP_XML_ATTR(L"r:id", slideNotesMaster_->rId());
|
||||
}
|
||||
}
|
||||
}
|
||||
//else
|
||||
pptx_serialize_size(current_presentation().slidesNotesProperties(), 6858000, 9144000, L"p:notesSz");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//добавляем диаграммы
|
||||
|
||||
count = 0;
|
||||
for (size_t i = 0; i < charts_.size(); i++)
|
||||
{
|
||||
count++;
|
||||
package::chart_content_ptr content = package::chart_content::create();
|
||||
|
||||
charts_[i]->serialize(content->content());
|
||||
@ -300,7 +323,6 @@ void pptx_conversion_context::end_document()
|
||||
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//добавляем темы
|
||||
for (size_t i=0; i < themes_.size(); i++)
|
||||
{
|
||||
output_document_->get_ppt_files().add_theme(themes_[i]);
|
||||
@ -308,10 +330,10 @@ void pptx_conversion_context::end_document()
|
||||
}
|
||||
package::ppt_comments_files_ptr comments = package::ppt_comments_files::create(comments_context_handle_.content());
|
||||
|
||||
output_document_->get_ppt_files().set_presentation(presentation_);
|
||||
output_document_->get_ppt_files().set_comments(comments);
|
||||
output_document_->get_ppt_files().set_authors_comments(authors_comments_);
|
||||
output_document_->get_ppt_files().set_media(get_mediaitems(), applicationFonts_);
|
||||
output_document_->get_ppt_files().set_presentation (presentation_);
|
||||
output_document_->get_ppt_files().set_comments (comments);
|
||||
output_document_->get_ppt_files().set_authors_comments (authors_comments_);
|
||||
output_document_->get_ppt_files().set_media (get_mediaitems(), applicationFonts_);
|
||||
|
||||
output_document_->get_content_types_file().set_media(get_mediaitems());
|
||||
}
|
||||
@ -321,7 +343,28 @@ void pptx_conversion_context::start_body()
|
||||
|
||||
void pptx_conversion_context::end_body()
|
||||
{}
|
||||
|
||||
pptx_xml_slideNotesMaster & pptx_conversion_context::current_notesMaster()
|
||||
{
|
||||
if (slideNotesMaster_)
|
||||
{
|
||||
return *slideNotesMaster_;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw std::runtime_error("internal error");
|
||||
}
|
||||
}
|
||||
pptx_xml_slideNotes & pptx_conversion_context::current_notes()
|
||||
{
|
||||
if (!notes_.empty())
|
||||
{
|
||||
return *notes_.back().get();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw std::runtime_error("internal error");
|
||||
}
|
||||
}
|
||||
pptx_xml_slide & pptx_conversion_context::current_slide()
|
||||
{
|
||||
if (!slides_.empty())
|
||||
@ -384,9 +427,18 @@ pptx_xml_slideMaster & pptx_conversion_context::current_master()
|
||||
}
|
||||
void pptx_conversion_context::create_new_slide(std::wstring const & name)
|
||||
{
|
||||
pptx_xml_slide_ptr s = pptx_xml_slide::create(name,slides_.size()+1);
|
||||
pptx_xml_slide_ptr s = pptx_xml_slide::create(name,slides_.size() + 1);
|
||||
slides_.push_back(s);
|
||||
}
|
||||
void pptx_conversion_context::create_new_slideNotes()
|
||||
{
|
||||
pptx_xml_slideNotes_ptr s = pptx_xml_slideNotes::create( notes_.size() + 1);
|
||||
notes_.push_back(s);
|
||||
}
|
||||
void pptx_conversion_context::create_new_slideNotesMaster()
|
||||
{
|
||||
slideNotesMaster_ = pptx_xml_slideNotesMaster::create();
|
||||
}
|
||||
void pptx_conversion_context::create_new_slideLayout(int id)
|
||||
{
|
||||
pptx_xml_slideLayout_ptr s = pptx_xml_slideLayout::create(id);
|
||||
@ -397,7 +449,6 @@ void pptx_conversion_context::create_new_slideMaster(int id)
|
||||
pptx_xml_slideMaster_ptr s = pptx_xml_slideMaster::create(id);
|
||||
slideMasters_.push_back(s);
|
||||
}
|
||||
|
||||
bool pptx_conversion_context::start_page(const std::wstring & pageName, const std::wstring & pageStyleName,
|
||||
const std::wstring & pageLayoutName,
|
||||
const std::wstring & pageMasterName)
|
||||
@ -414,7 +465,7 @@ bool pptx_conversion_context::start_page(const std::wstring & pageName, const st
|
||||
root()->odf_context().styleContainer().presentation_layouts().add_or_find(pageLayoutName,pageMasterName);
|
||||
|
||||
current_slide().Rels().add(relationship(layout_id.second, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",
|
||||
std::wstring(L"../slideLayouts/slideLayout") + boost::lexical_cast<std::wstring>(layout_id.first) + L".xml"));
|
||||
std::wstring(L"../slideLayouts/slideLayout") + std::to_wstring(layout_id.first) + L".xml"));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -506,6 +557,14 @@ bool pptx_conversion_context::start_master(int master_index)
|
||||
current_master().add_layout(masters.content[master_index].layouts[i].Id, masters.content[master_index].layouts[i].rId, 0x80000000 + last_uniq_big_id++);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
//размеры страниц в презентации
|
||||
const std::wstring pageProperties = root()->odf_context().pageLayoutContainer().page_layout_name_by_style(masters.content[master_index].master_name);
|
||||
|
||||
odf_reader::page_layout_instance *pages_layouts = root()->odf_context().pageLayoutContainer().page_layout_by_name(pageProperties);
|
||||
|
||||
if (pages_layouts)
|
||||
pages_layouts->pptx_serialize(current_master().Sizes(), *this);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -530,6 +589,59 @@ void pptx_conversion_context::end_page()
|
||||
|
||||
get_slide_context().end_slide();
|
||||
}
|
||||
bool pptx_conversion_context::start_page_notes()
|
||||
{
|
||||
create_new_slideNotes( );
|
||||
|
||||
current_slide().Rels().add(relationship(notes_.back()->rId(), L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",
|
||||
L"../notesSlides/notesSlide" + std::to_wstring(notes_.size()) + L".xml"));
|
||||
|
||||
get_slide_context().start_slide();
|
||||
|
||||
current_notes().Rels().add(relationship(L"nId1", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide",
|
||||
L"../slides/slide" + std::to_wstring(slides_.size()) + L".xml"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void pptx_conversion_context::end_page_notes()
|
||||
{
|
||||
get_slide_context().serialize_background(current_notes().Background());
|
||||
get_slide_context().serialize_objects(current_notes().Data());
|
||||
|
||||
get_slide_context().dump_rels(current_notes().Rels());//hyperlinks, mediaitems, ...
|
||||
|
||||
get_slide_context().end_slide();
|
||||
}
|
||||
bool pptx_conversion_context::start_master_notes()
|
||||
{
|
||||
create_new_slideNotesMaster( );
|
||||
|
||||
get_slide_context().start_slide();
|
||||
|
||||
process_theme(L"");//add default theme - одинаковые но под разными именами
|
||||
current_notesMaster().add_theme(current_theme().id(), L"tId1");
|
||||
|
||||
get_slide_context().start_slide();
|
||||
return true;
|
||||
}
|
||||
|
||||
void pptx_conversion_context::end_master_notes()
|
||||
{
|
||||
get_slide_context().serialize_background(current_notesMaster().Background());
|
||||
get_slide_context().serialize_objects(current_notesMaster().Data());
|
||||
|
||||
get_slide_context().dump_rels(current_notesMaster().Rels());//hyperlinks, mediaitems, ...
|
||||
|
||||
get_slide_context().end_slide();
|
||||
|
||||
for (size_t i = 0; i < notes_.size(); i++)
|
||||
{
|
||||
notes_[i]->Rels().add(relationship(L"nmId1",
|
||||
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster",
|
||||
L"../notesMasters/notesMaster1.xml"));
|
||||
}
|
||||
}
|
||||
void pptx_conversion_context::end_layout()
|
||||
{
|
||||
get_slide_context().serialize_objects(current_layout().Data());
|
||||
|
||||
@ -88,6 +88,12 @@ public:
|
||||
const std::wstring & pageMasterName);
|
||||
void end_page();
|
||||
|
||||
bool start_page_notes();
|
||||
void end_page_notes();
|
||||
|
||||
bool start_master_notes();
|
||||
void end_master_notes();
|
||||
|
||||
bool start_layout( int layout_index);
|
||||
void end_layout();
|
||||
|
||||
@ -107,10 +113,13 @@ public:
|
||||
return odf_document_;
|
||||
}
|
||||
|
||||
pptx_xml_slide & current_slide();
|
||||
pptx_xml_slideLayout & current_layout();
|
||||
pptx_xml_slideMaster & current_master();
|
||||
pptx_xml_theme & current_theme();
|
||||
pptx_xml_slide & current_slide();
|
||||
pptx_xml_slideLayout & current_layout();
|
||||
pptx_xml_slideMaster & current_master();
|
||||
pptx_xml_theme & current_theme();
|
||||
pptx_xml_slideNotes & current_notes();
|
||||
pptx_xml_slideNotesMaster & current_notesMaster();
|
||||
|
||||
pptx_xml_presentation & current_presentation();//собственно она одна
|
||||
|
||||
oox_chart_context & current_chart();
|
||||
@ -138,6 +147,8 @@ private:
|
||||
void create_new_slide(std::wstring const & name);
|
||||
void create_new_slideLayout(int id);
|
||||
void create_new_slideMaster(int id);
|
||||
void create_new_slideNotes();
|
||||
void create_new_slideNotesMaster();
|
||||
|
||||
package::pptx_document * output_document_;
|
||||
odf_reader::odf_document * odf_document_;
|
||||
@ -152,10 +163,12 @@ private:
|
||||
std::vector<oox_chart_context_ptr> charts_;
|
||||
|
||||
std::vector<pptx_xml_slide_ptr> slides_;
|
||||
std::vector<pptx_xml_slideNotes_ptr> notes_;
|
||||
std::vector<pptx_xml_slideMaster_ptr> slideMasters_;
|
||||
std::vector<pptx_xml_slideLayout_ptr> slideLayouts_;
|
||||
std::vector<pptx_xml_theme_ptr> themes_;
|
||||
|
||||
pptx_xml_slideNotesMaster_ptr slideNotesMaster_;
|
||||
pptx_xml_authors_comments_ptr authors_comments_;
|
||||
pptx_xml_presentation presentation_;
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
std::wstring pptx_xml_slide::name() const
|
||||
{
|
||||
return name_;
|
||||
@ -53,7 +53,7 @@ std::wstring pptx_xml_slide::rId() const
|
||||
|
||||
pptx_xml_slide_ptr pptx_xml_slide::create(std::wstring const & name,int id)
|
||||
{
|
||||
const std::wstring rId = std::wstring(L"sId") + boost::lexical_cast<std::wstring>(id);
|
||||
const std::wstring rId = std::wstring(L"sId") + std::to_wstring(id);
|
||||
return boost::make_shared<pptx_xml_slide>(name,rId);
|
||||
}
|
||||
|
||||
@ -68,15 +68,15 @@ pptx_xml_slide::~pptx_xml_slide()
|
||||
}
|
||||
std::wostream & pptx_xml_slide::Data()
|
||||
{
|
||||
return slideData_;
|
||||
return strmData_;
|
||||
}
|
||||
std::wostream & pptx_xml_slide::Background()
|
||||
{
|
||||
return slideBackground_;
|
||||
return strmBackground_;
|
||||
}
|
||||
std::wostream & pptx_xml_slide::Timing()
|
||||
{
|
||||
return slideTiming_;
|
||||
return strmTiming_;
|
||||
}
|
||||
rels & pptx_xml_slide::Rels()
|
||||
{
|
||||
@ -100,14 +100,14 @@ void pptx_xml_slide::write_to(std::wostream & strm)
|
||||
{
|
||||
CP_XML_ATTR(L"name", name());
|
||||
|
||||
CP_XML_STREAM() << slideBackground_.str();
|
||||
CP_XML_STREAM() << strmBackground_.str();
|
||||
|
||||
CP_XML_NODE(L"p:spTree")
|
||||
{
|
||||
CP_XML_STREAM() << slideData_.str();
|
||||
CP_XML_STREAM() << strmData_.str();
|
||||
}
|
||||
}
|
||||
CP_XML_STREAM() << slideTiming_.str();
|
||||
CP_XML_STREAM() << strmTiming_.str();
|
||||
CP_XML_NODE(L"p:clrMapOvr")
|
||||
{
|
||||
CP_XML_NODE(L"a:masterClrMapping");
|
||||
@ -115,7 +115,7 @@ void pptx_xml_slide::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
std::wstring pptx_xml_slideLayout::rId() const
|
||||
{
|
||||
return rId_;
|
||||
@ -123,7 +123,7 @@ std::wstring pptx_xml_slideLayout::rId() const
|
||||
|
||||
pptx_xml_slideLayout_ptr pptx_xml_slideLayout::create(int id)
|
||||
{
|
||||
const std::wstring rId = std::wstring(L"lrId") + boost::lexical_cast<std::wstring>(id);
|
||||
const std::wstring rId = std::wstring(L"lrId") + std::to_wstring(id);
|
||||
return boost::make_shared<pptx_xml_slideLayout>(rId);
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ pptx_xml_slideLayout::~pptx_xml_slideLayout()
|
||||
}
|
||||
std::wostream & pptx_xml_slideLayout::Data()
|
||||
{
|
||||
return slideLayoutData_;
|
||||
return strmData_;
|
||||
}
|
||||
rels & pptx_xml_slideLayout::Rels()
|
||||
{
|
||||
@ -166,7 +166,7 @@ void pptx_xml_slideLayout::write_to(std::wostream & strm)
|
||||
{
|
||||
CP_XML_NODE(L"p:spTree")
|
||||
{
|
||||
CP_XML_STREAM() << slideLayoutData_.str();
|
||||
CP_XML_STREAM() << strmData_.str();
|
||||
|
||||
//в slideLayoutData_
|
||||
//contentPart (Content Part) §19.3.1.14
|
||||
@ -189,7 +189,7 @@ void pptx_xml_slideLayout::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
std::wstring pptx_xml_slideMaster::rId() const
|
||||
{
|
||||
return rId_;
|
||||
@ -197,7 +197,7 @@ std::wstring pptx_xml_slideMaster::rId() const
|
||||
|
||||
pptx_xml_slideMaster_ptr pptx_xml_slideMaster::create(int id)
|
||||
{
|
||||
const std::wstring rId = std::wstring(L"smId") + boost::lexical_cast<std::wstring>(id);
|
||||
const std::wstring rId = std::wstring(L"smId") + std::to_wstring(id);
|
||||
return boost::make_shared<pptx_xml_slideMaster>(rId,id);
|
||||
}
|
||||
|
||||
@ -212,15 +212,19 @@ pptx_xml_slideMaster::~pptx_xml_slideMaster()
|
||||
}
|
||||
std::wostream & pptx_xml_slideMaster::Data()
|
||||
{
|
||||
return slideMasterData_;
|
||||
return strmData_;
|
||||
}
|
||||
std::wostream & pptx_xml_slideMaster::DataExtra()
|
||||
{
|
||||
return slideMasterDataExtra_;
|
||||
return strmDataExtra_;
|
||||
}
|
||||
std::wostream & pptx_xml_slideMaster::Background()
|
||||
{
|
||||
return slideMasterBackground_;
|
||||
return strmBackground_;
|
||||
}
|
||||
std::wstringstream & pptx_xml_slideMaster::Sizes()
|
||||
{
|
||||
return strmSizes_;
|
||||
}
|
||||
rels & pptx_xml_slideMaster::Rels()
|
||||
{
|
||||
@ -229,7 +233,7 @@ rels & pptx_xml_slideMaster::Rels()
|
||||
void pptx_xml_slideMaster::add_theme(int id, const std::wstring & tId)
|
||||
{
|
||||
rels_.add(relationship( tId, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
|
||||
std::wstring(L"../theme/theme") + boost::lexical_cast<std::wstring>(id) + L".xml"));
|
||||
std::wstring(L"../theme/theme") + std::to_wstring(id) + L".xml"));
|
||||
}
|
||||
|
||||
void pptx_xml_slideMaster::add_layout(int id, const std::wstring & rId, const unsigned int & uniqId)
|
||||
@ -237,7 +241,7 @@ void pptx_xml_slideMaster::add_layout(int id, const std::wstring & rId, const un
|
||||
layoutsId_.push_back(std::pair<std::wstring, unsigned int>(rId, uniqId));
|
||||
|
||||
rels_.add(relationship( rId,L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",
|
||||
std::wstring(L"../slideLayouts/slideLayout") + boost::lexical_cast<std::wstring>(id) + L".xml"));
|
||||
std::wstring(L"../slideLayouts/slideLayout") + std::to_wstring(id) + L".xml"));
|
||||
}
|
||||
|
||||
void pptx_xml_slideMaster::write_to(std::wostream & strm)
|
||||
@ -255,11 +259,11 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
|
||||
|
||||
CP_XML_NODE(L"p:cSld")
|
||||
{
|
||||
CP_XML_STREAM() << slideMasterBackground_.str();
|
||||
CP_XML_STREAM() << strmBackground_.str();
|
||||
|
||||
CP_XML_NODE(L"p:spTree")
|
||||
{
|
||||
CP_XML_STREAM() << slideMasterData_.str();
|
||||
CP_XML_STREAM() << strmData_.str();
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"p:clrMap")
|
||||
@ -288,7 +292,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
CP_XML_STREAM() << slideMasterDataExtra_.str();
|
||||
CP_XML_STREAM() << strmDataExtra_.str();
|
||||
CP_XML_NODE(L"p:txStyles")
|
||||
{
|
||||
CP_XML_NODE(L"p:titleStyle");
|
||||
@ -299,6 +303,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
pptx_xml_theme_ptr pptx_xml_theme::create(std::wstring const & name,int id)
|
||||
{
|
||||
return boost::make_shared<pptx_xml_theme>(name,id);
|
||||
@ -336,6 +341,7 @@ void pptx_xml_theme::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
pptx_xml_authors_comments_ptr pptx_xml_authors_comments::create()
|
||||
{
|
||||
return boost::make_shared<pptx_xml_authors_comments>();
|
||||
@ -399,6 +405,7 @@ void pptx_xml_authors_comments::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
void pptx_xml_presentation::write_to(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
@ -412,14 +419,18 @@ void pptx_xml_presentation::write_to(std::wostream & strm)
|
||||
CP_XML_NODE(L"p:sldMasterIdLst")
|
||||
{
|
||||
CP_XML_STREAM() << slideMastersData_.str();
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"p:notesMasterIdLst")
|
||||
{
|
||||
CP_XML_STREAM() << slideNotesMastersData_.str();
|
||||
}
|
||||
CP_XML_NODE(L"p:sldIdLst")
|
||||
{
|
||||
CP_XML_STREAM() << slidesData_.str();
|
||||
}
|
||||
CP_XML_STREAM() << slidesProperties_.str();
|
||||
|
||||
CP_XML_STREAM() << notesSlidesSize_.str();
|
||||
CP_XML_STREAM() << slidesNotesProperties_.str();
|
||||
|
||||
CP_XML_NODE(L"p:defaultTextStyle")//??
|
||||
{
|
||||
@ -428,5 +439,155 @@ void pptx_xml_presentation::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
std::wstring pptx_xml_slideNotes::rId() const
|
||||
{
|
||||
return rId_;
|
||||
}
|
||||
|
||||
pptx_xml_slideNotes_ptr pptx_xml_slideNotes::create(int id)
|
||||
{
|
||||
const std::wstring rId = std::wstring(L"nId") + std::to_wstring(id);
|
||||
return boost::make_shared<pptx_xml_slideNotes>(rId);
|
||||
}
|
||||
|
||||
pptx_xml_slideNotes::pptx_xml_slideNotes(std::wstring const & id)
|
||||
{
|
||||
rId_ = id;
|
||||
}
|
||||
|
||||
pptx_xml_slideNotes::~pptx_xml_slideNotes()
|
||||
{
|
||||
}
|
||||
std::wostream & pptx_xml_slideNotes::Data()
|
||||
{
|
||||
return strmData_;
|
||||
}
|
||||
std::wostream & pptx_xml_slideNotes::Background()
|
||||
{
|
||||
return strmBackground_;
|
||||
}
|
||||
|
||||
rels & pptx_xml_slideNotes::Rels()
|
||||
{
|
||||
return rels_;
|
||||
}
|
||||
|
||||
void pptx_xml_slideNotes::write_to(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"p:notes")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:a", L"http://schemas.openxmlformats.org/drawingml/2006/main");
|
||||
CP_XML_ATTR(L"xmlns:p", L"http://schemas.openxmlformats.org/presentationml/2006/main");
|
||||
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
CP_XML_ATTR(L"xmlns:p14", L"http://schemas.microsoft.com/office/powerpoint/2010/main");
|
||||
CP_XML_ATTR(L"xmlns:p15", L"http://schemas.microsoft.com/office/powerpoint/2012/main");
|
||||
CP_XML_ATTR(L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006");
|
||||
|
||||
CP_XML_NODE(L"p:cSld")
|
||||
{
|
||||
CP_XML_STREAM() << strmBackground_.str();
|
||||
|
||||
CP_XML_NODE(L"p:spTree")
|
||||
{
|
||||
CP_XML_STREAM() << strmData_.str();
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"p:clrMapOvr")
|
||||
{
|
||||
CP_XML_NODE(L"a:masterClrMapping");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
std::wstring pptx_xml_slideNotesMaster::rId() const
|
||||
{
|
||||
return rId_;
|
||||
}
|
||||
|
||||
pptx_xml_slideNotesMaster_ptr pptx_xml_slideNotesMaster::create()
|
||||
{
|
||||
const std::wstring rId = std::wstring(L"nmId1");
|
||||
return boost::make_shared<pptx_xml_slideNotesMaster>(rId, 1);
|
||||
}
|
||||
|
||||
pptx_xml_slideNotesMaster::pptx_xml_slideNotesMaster(std::wstring const & rId, int id)
|
||||
{
|
||||
rId_ = rId;
|
||||
id_ = id;
|
||||
}
|
||||
|
||||
pptx_xml_slideNotesMaster::~pptx_xml_slideNotesMaster()
|
||||
{
|
||||
}
|
||||
std::wostream & pptx_xml_slideNotesMaster::Data()
|
||||
{
|
||||
return strmData_;
|
||||
}
|
||||
std::wostream & pptx_xml_slideNotesMaster::Background()
|
||||
{
|
||||
return strmBackground_;
|
||||
}
|
||||
std::wostream & pptx_xml_slideNotesMaster::Sizes()
|
||||
{
|
||||
return strmSizes_;
|
||||
}
|
||||
rels & pptx_xml_slideNotesMaster::Rels()
|
||||
{
|
||||
return rels_;
|
||||
}
|
||||
void pptx_xml_slideNotesMaster::add_theme(int id, const std::wstring & tId)
|
||||
{
|
||||
rels_.add(relationship( tId, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
|
||||
std::wstring(L"../theme/theme") + std::to_wstring(id) + L".xml"));
|
||||
}
|
||||
|
||||
void pptx_xml_slideNotesMaster::write_to(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"p:notesMaster")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:a", L"http://schemas.openxmlformats.org/drawingml/2006/main");
|
||||
CP_XML_ATTR(L"xmlns:p", L"http://schemas.openxmlformats.org/presentationml/2006/main");
|
||||
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
CP_XML_ATTR(L"xmlns:p14", L"http://schemas.microsoft.com/office/powerpoint/2010/main");
|
||||
CP_XML_ATTR(L"xmlns:p15", L"http://schemas.microsoft.com/office/powerpoint/2012/main");
|
||||
CP_XML_ATTR(L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006");
|
||||
|
||||
CP_XML_NODE(L"p:cSld")
|
||||
{
|
||||
CP_XML_STREAM() << strmBackground_.str();
|
||||
|
||||
CP_XML_NODE(L"p:spTree")
|
||||
{
|
||||
CP_XML_STREAM() << strmData_.str();
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"p:clrMap")
|
||||
{
|
||||
CP_XML_ATTR(L"folHlink",L"folHlink");
|
||||
CP_XML_ATTR(L"hlink",L"hlink");
|
||||
CP_XML_ATTR(L"accent6",L"accent6");
|
||||
CP_XML_ATTR(L"accent5",L"accent5");
|
||||
CP_XML_ATTR(L"accent4",L"accent4");
|
||||
CP_XML_ATTR(L"accent3",L"accent5");
|
||||
CP_XML_ATTR(L"accent2",L"accent2");
|
||||
CP_XML_ATTR(L"accent1",L"accent1");
|
||||
CP_XML_ATTR(L"tx2",L"dk2");
|
||||
CP_XML_ATTR(L"tx1",L"dk1");
|
||||
CP_XML_ATTR(L"bg2",L"lt2");
|
||||
CP_XML_ATTR(L"bg1",L"lt1");
|
||||
}
|
||||
CP_XML_NODE(L"p:notesStyle")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ class pptx_xml_slide: noncopyable
|
||||
public:
|
||||
pptx_xml_slide(std::wstring const & name,std::wstring const & id);
|
||||
~pptx_xml_slide();
|
||||
public:
|
||||
|
||||
std::wstring name() const;
|
||||
std::wstring rId() const;
|
||||
|
||||
@ -65,41 +65,68 @@ public:
|
||||
|
||||
private:
|
||||
std::wstring name_;
|
||||
std::wstringstream slideData_;
|
||||
std::wstringstream slideBackground_;
|
||||
std::wstringstream slideTiming_;
|
||||
std::wstringstream strmData_;
|
||||
std::wstringstream strmBackground_;
|
||||
std::wstringstream strmTiming_;
|
||||
std::wstring rId_;
|
||||
|
||||
rels rels_;
|
||||
};
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_slideNotes;
|
||||
typedef _CP_PTR(pptx_xml_slideNotes) pptx_xml_slideNotes_ptr;
|
||||
|
||||
class pptx_xml_slideNotes: noncopyable
|
||||
{
|
||||
public:
|
||||
pptx_xml_slideNotes(std::wstring const & id);
|
||||
~pptx_xml_slideNotes();
|
||||
|
||||
std::wstring rId() const;
|
||||
|
||||
std::wostream & Data();
|
||||
std::wostream & Background();
|
||||
|
||||
rels & Rels();
|
||||
|
||||
void write_to(std::wostream & strm);
|
||||
|
||||
static pptx_xml_slideNotes_ptr create(int id);
|
||||
|
||||
private:
|
||||
std::wstringstream strmData_;
|
||||
std::wstringstream strmBackground_;
|
||||
std::wstring rId_;
|
||||
|
||||
rels rels_;
|
||||
};
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_presentation: noncopyable
|
||||
{
|
||||
public:
|
||||
pptx_xml_presentation(){}
|
||||
~pptx_xml_presentation(){}
|
||||
|
||||
std::wstringstream & slidesData(){return slidesData_;}
|
||||
std::wstringstream & slideMastersData(){return slideMastersData_;}
|
||||
std::wstringstream & notesSlidesData(){return notesSlidesData_;}
|
||||
std::wstringstream & slidesData() {return slidesData_;}
|
||||
std::wstringstream & slideMastersData() {return slideMastersData_;}
|
||||
std::wstringstream & slideNotesMastersData() {return slideNotesMastersData_;}
|
||||
|
||||
std::wstringstream & slidesProperties(){return slidesProperties_;}
|
||||
std::wstringstream & notesSlidesSize(){return notesSlidesSize_;}
|
||||
std::wstringstream & slidesProperties() {return slidesProperties_;}
|
||||
std::wstringstream & slidesNotesProperties() {return slidesNotesProperties_;}
|
||||
|
||||
void write_to(std::wostream & strm);
|
||||
|
||||
private:
|
||||
std::wstringstream slidesProperties_;
|
||||
std::wstringstream notesSlidesSize_;
|
||||
|
||||
std::wstringstream slidesNotesProperties_;
|
||||
|
||||
std::wstringstream slidesData_;
|
||||
std::wstringstream slideMastersData_;
|
||||
std::wstringstream notesSlidesData_;
|
||||
std::wstringstream handoutMasterData_;
|
||||
std::wstringstream slideNotesMastersData_;
|
||||
std::wstringstream slideHandoutMasterData_;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_slideLayout;
|
||||
typedef _CP_PTR(pptx_xml_slideLayout) pptx_xml_slideLayout_ptr;
|
||||
|
||||
@ -121,12 +148,12 @@ public:
|
||||
static pptx_xml_slideLayout_ptr create(int id);
|
||||
|
||||
private:
|
||||
std::wstringstream slideLayoutData_;
|
||||
std::wstringstream strmData_;
|
||||
std::wstring rId_;
|
||||
|
||||
rels rels_;
|
||||
};
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_slideMaster;
|
||||
typedef _CP_PTR(pptx_xml_slideMaster) pptx_xml_slideMaster_ptr;
|
||||
|
||||
@ -135,12 +162,13 @@ class pptx_xml_slideMaster: noncopyable
|
||||
public:
|
||||
pptx_xml_slideMaster(std::wstring const & rId, int id);
|
||||
~pptx_xml_slideMaster();
|
||||
public:
|
||||
|
||||
std::wstring rId() const;
|
||||
|
||||
std::wostream & Data();
|
||||
std::wostream & DataExtra();
|
||||
std::wostream & Background();
|
||||
std::wostream & Data();
|
||||
std::wostream & DataExtra();
|
||||
std::wostream & Background();
|
||||
std::wstringstream & Sizes();
|
||||
rels & Rels();
|
||||
|
||||
void add_layout(int id, const std::wstring & rId, const unsigned int & uniqId);
|
||||
@ -151,9 +179,10 @@ public:
|
||||
static pptx_xml_slideMaster_ptr create(int id);
|
||||
|
||||
private:
|
||||
std::wstringstream slideMasterData_;
|
||||
std::wstringstream slideMasterDataExtra_;
|
||||
std::wstringstream slideMasterBackground_;
|
||||
std::wstringstream strmData_;
|
||||
std::wstringstream strmDataExtra_;
|
||||
std::wstringstream strmBackground_;
|
||||
std::wstringstream strmSizes_;
|
||||
|
||||
std::vector<std::pair<std::wstring, unsigned int>> layoutsId_;
|
||||
std::wstring rId_;
|
||||
@ -163,7 +192,42 @@ private:
|
||||
|
||||
rels rels_;
|
||||
};
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_slideNotesMaster;
|
||||
typedef _CP_PTR(pptx_xml_slideNotesMaster) pptx_xml_slideNotesMaster_ptr;
|
||||
|
||||
class pptx_xml_slideNotesMaster: noncopyable
|
||||
{
|
||||
public:
|
||||
pptx_xml_slideNotesMaster(std::wstring const & rId, int id);
|
||||
~pptx_xml_slideNotesMaster();
|
||||
|
||||
std::wstring rId() const;
|
||||
|
||||
std::wostream & Data();
|
||||
std::wostream & Background();
|
||||
std::wostream & Sizes();
|
||||
rels & Rels();
|
||||
|
||||
void add_theme(int id, const std::wstring & tId);
|
||||
|
||||
void write_to(std::wostream & strm);
|
||||
|
||||
static pptx_xml_slideNotesMaster_ptr create();
|
||||
|
||||
private:
|
||||
std::wstringstream strmData_;
|
||||
std::wstringstream strmBackground_;
|
||||
std::wstringstream strmSizes_;
|
||||
|
||||
std::wstring rId_;
|
||||
int id_;
|
||||
|
||||
std::wstring themeId_;
|
||||
|
||||
rels rels_;
|
||||
};
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_theme;
|
||||
typedef _CP_PTR(pptx_xml_theme) pptx_xml_theme_ptr;
|
||||
|
||||
@ -192,7 +256,7 @@ private:
|
||||
std::wstring name_;
|
||||
int id_;
|
||||
};
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_authors_comments;
|
||||
typedef _CP_PTR(pptx_xml_authors_comments) pptx_xml_authors_comments_ptr;
|
||||
|
||||
|
||||
@ -105,10 +105,11 @@ void slide_content::add_rels(rels & _r)
|
||||
rels_->get_rels().add(r[i]);
|
||||
}
|
||||
}
|
||||
////////////
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
slides_files::slides_files()
|
||||
{}
|
||||
{
|
||||
rels_ = NULL;
|
||||
}
|
||||
|
||||
void slides_files::add_slide(slide_content_ptr slide)
|
||||
{
|
||||
@ -127,13 +128,13 @@ void slides_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (!slides_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"slide") + boost::lexical_cast<std::wstring>( i + 1 ) + L".xml";
|
||||
const std::wstring fileName = std::wstring(L"slide") + std::to_wstring( i + 1 ) + L".xml";
|
||||
|
||||
contentTypes->add_override(std::wstring(L"/ppt/slides/") + fileName, kWSConType);
|
||||
|
||||
if (rels_)
|
||||
{
|
||||
const std::wstring id = std::wstring(L"sId") + boost::lexical_cast<std::wstring>( i + 1);
|
||||
const std::wstring id = std::wstring(L"sId") + std::to_wstring( i + 1);
|
||||
static const std::wstring kWSRel = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide";
|
||||
const std::wstring fileRef = std::wstring(L"slides/") + fileName;
|
||||
rels_->add(id, kWSRel, fileRef);
|
||||
@ -149,7 +150,42 @@ void slides_files::write(const std::wstring & RootPath)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////
|
||||
//---------------------------------------------------------------------------
|
||||
void notes_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"notesSlides" ;
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
content_type_content * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
static const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml";
|
||||
|
||||
for (int i = 0; i < slides_.size(); i++)
|
||||
{
|
||||
if (!slides_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"notesSlide") + std::to_wstring( i + 1 ) + L".xml";
|
||||
|
||||
contentTypes->add_override(std::wstring(L"/ppt/notesSlides/") + fileName, kWSConType);
|
||||
|
||||
if (rels_)
|
||||
{
|
||||
const std::wstring id = std::wstring(L"nId") + std::to_wstring( i + 1);
|
||||
static const std::wstring kWSRel = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide";
|
||||
const std::wstring fileRef = std::wstring(L"notesSlides/") + fileName;
|
||||
rels_->add(id, kWSRel, fileRef);
|
||||
}
|
||||
|
||||
slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//внитренние релсы
|
||||
|
||||
rels_files relFiles;
|
||||
relFiles.add_rel_file(slides_[i]->get_rel_file());
|
||||
relFiles.write(path);
|
||||
|
||||
package::simple_element(fileName, slides_[i]->str()).write(path);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
slideMasters_files::slideMasters_files()
|
||||
{}
|
||||
|
||||
@ -170,12 +206,12 @@ void slideMasters_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (!slides_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"slideMaster") + boost::lexical_cast<std::wstring>( i + 1 ) + L".xml";
|
||||
const std::wstring fileName = std::wstring(L"slideMaster") + std::to_wstring( i + 1 ) + L".xml";
|
||||
contentTypes->add_override(std::wstring(L"/ppt/slideMasters/") + fileName, kWSConType);
|
||||
|
||||
if (rels_)
|
||||
{
|
||||
const std::wstring id = std::wstring(L"smId") + boost::lexical_cast<std::wstring>( i + 1);
|
||||
const std::wstring id = std::wstring(L"smId") + std::to_wstring( i + 1);
|
||||
static const std::wstring kWSRel = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster";
|
||||
const std::wstring fileRef = std::wstring(L"slideMasters/") + fileName;
|
||||
rels_->add(id, kWSRel, fileRef);
|
||||
@ -191,7 +227,41 @@ void slideMasters_files::write(const std::wstring & RootPath)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////
|
||||
//---------------------------------------------------------------------------
|
||||
void notesMaster_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"notesMasters" ;
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
content_type_content * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
static const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml";
|
||||
|
||||
for (int i = 0; i < slides_.size(); i++)
|
||||
{
|
||||
if (!slides_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"notesMaster") + std::to_wstring( i + 1 ) + L".xml";
|
||||
contentTypes->add_override(std::wstring(L"/ppt/notesMasters/") + fileName, kWSConType);
|
||||
|
||||
if (rels_)
|
||||
{
|
||||
const std::wstring id = std::wstring(L"nmId") + std::to_wstring( i + 1);
|
||||
static const std::wstring kWSRel = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster";
|
||||
const std::wstring fileRef = std::wstring(L"notesMasters/") + fileName;
|
||||
rels_->add(id, kWSRel, fileRef);
|
||||
}
|
||||
|
||||
slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//внитренние релсы
|
||||
|
||||
rels_files relFiles;
|
||||
relFiles.add_rel_file(slides_[i]->get_rel_file());
|
||||
relFiles.write(path);
|
||||
|
||||
package::simple_element(fileName, slides_[i]->str()).write(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
slideLayouts_files::slideLayouts_files()
|
||||
{}
|
||||
|
||||
@ -209,7 +279,7 @@ void slideLayouts_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (!slides_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"slideLayout") + boost::lexical_cast<std::wstring>( i + 1 ) + L".xml";
|
||||
const std::wstring fileName = std::wstring(L"slideLayout") + std::to_wstring( i + 1 ) + L".xml";
|
||||
const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml";
|
||||
|
||||
content_type_content * contentTypes = get_main_document()->get_content_types_file().content();
|
||||
@ -225,7 +295,7 @@ void slideLayouts_files::write(const std::wstring & RootPath)
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------------
|
||||
authors_comments_element::authors_comments_element(pptx_xml_authors_comments_ptr & authors_comments) : authors_comments_(authors_comments)
|
||||
{
|
||||
}
|
||||
@ -261,7 +331,7 @@ void ppt_charts_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (!charts_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"chart") + boost::lexical_cast<std::wstring>( i + 1 ) + L".xml";
|
||||
const std::wstring fileName = std::wstring(L"chart") + std::to_wstring( i + 1 ) + L".xml";
|
||||
content_type_content * contentTypes = get_main_document()->get_content_types_file().content();
|
||||
|
||||
static const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.drawingml.chart+xml";
|
||||
@ -291,7 +361,7 @@ void ppt_themes_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (!themes_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"theme") + boost::lexical_cast<std::wstring>( i + 1) + L".xml";
|
||||
const std::wstring fileName = std::wstring(L"theme") + std::to_wstring( i + 1) + L".xml";
|
||||
const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.theme+xml";
|
||||
|
||||
content_type_content * contentTypes = get_main_document()->get_content_types_file().content();
|
||||
@ -345,6 +415,12 @@ void ppt_files::write(const std::wstring & RootPath)
|
||||
slideMasters_files_.set_main_document( this->get_main_document() );
|
||||
slideMasters_files_.write(path);
|
||||
|
||||
notes_files_.set_main_document( this->get_main_document() );
|
||||
notes_files_.write(path);
|
||||
|
||||
notesMaster_files_.set_rels(&rels_files_);
|
||||
notesMaster_files_.set_main_document( this->get_main_document() );
|
||||
notesMaster_files_.write(path);
|
||||
|
||||
//rels_files_.add( relationship( L"hId1", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", L"ppt/presentation.xml" ) );
|
||||
|
||||
@ -412,6 +488,10 @@ void ppt_files::add_slide(slide_content_ptr slide)
|
||||
{
|
||||
slides_files_.add_slide(slide);
|
||||
}
|
||||
void ppt_files::add_notes(slide_content_ptr slide)
|
||||
{
|
||||
notes_files_.add_slide(slide);
|
||||
}
|
||||
void ppt_files::add_slideLayout(slide_content_ptr slide)
|
||||
{
|
||||
slideLayouts_files_.add_slide(slide);
|
||||
@ -420,7 +500,10 @@ void ppt_files::add_slideMaster(slide_content_ptr slide)
|
||||
{
|
||||
slideMasters_files_.add_slide(slide);
|
||||
}
|
||||
|
||||
void ppt_files::add_notesMaster(slide_content_ptr slide)
|
||||
{
|
||||
notesMaster_files_.add_slide(slide);
|
||||
}
|
||||
void ppt_files::set_media(mediaitems & _Mediaitems, CApplicationFonts *pAppFonts)
|
||||
{
|
||||
if (_Mediaitems.count_image + _Mediaitems.count_media > 0)
|
||||
|
||||
@ -41,8 +41,10 @@ namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
class pptx_xml_presentation;
|
||||
|
||||
class pptx_xml_theme;
|
||||
typedef _CP_PTR(pptx_xml_theme) pptx_xml_theme_ptr;
|
||||
|
||||
class pptx_xml_authors_comments;
|
||||
typedef _CP_PTR(pptx_xml_authors_comments) pptx_xml_authors_comments_ptr;
|
||||
|
||||
@ -55,7 +57,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------
|
||||
class slide_content;
|
||||
typedef _CP_PTR(slide_content) slide_content_ptr;
|
||||
|
||||
@ -72,11 +74,10 @@ public:
|
||||
static _CP_PTR(slide_content) create();
|
||||
|
||||
private:
|
||||
std::wstringstream content_;
|
||||
rels_file_ptr rels_;
|
||||
std::wstringstream content_;
|
||||
rels_file_ptr rels_;
|
||||
};
|
||||
|
||||
// slides_files
|
||||
//------------------------------------------------------------------------------
|
||||
class slides_files : public element
|
||||
{
|
||||
public:
|
||||
@ -92,12 +93,18 @@ public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
void set_slide_ref(const std::wstring & ref_file_path,const std::wstring & ref_file_name);
|
||||
|
||||
public:
|
||||
std::vector<slide_content_ptr> slides_;
|
||||
rels_files * rels_;
|
||||
|
||||
};
|
||||
// slideLayouts_files
|
||||
//------------------------------------------------------------------------------
|
||||
class notes_files : public slides_files
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
class slideLayouts_files : public element
|
||||
{
|
||||
public:
|
||||
@ -107,12 +114,9 @@ public:
|
||||
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
public:
|
||||
std::vector<slide_content_ptr> slides_;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
class authors_comments_element : public element
|
||||
{
|
||||
public:
|
||||
@ -123,9 +127,7 @@ private:
|
||||
pptx_xml_authors_comments_ptr & authors_comments_;
|
||||
|
||||
};
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// slideMasters_files
|
||||
//------------------------------------------------------------------------------
|
||||
class slideMasters_files : public element
|
||||
{
|
||||
public:
|
||||
@ -140,16 +142,19 @@ public:
|
||||
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
public:
|
||||
std::vector<slide_content_ptr> slides_;
|
||||
rels_files * rels_;
|
||||
};
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
class notesMaster_files : public slideMasters_files
|
||||
{
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
class ppt_comments_files;
|
||||
typedef _CP_PTR(ppt_comments_files) ppt_comments_files_ptr;
|
||||
|
||||
// ppt_comments
|
||||
class ppt_comments_files: public element
|
||||
{
|
||||
public:
|
||||
@ -165,9 +170,7 @@ private:
|
||||
const std::vector<pptx_comment_elm> & comments_;
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ppt_charts_files
|
||||
//------------------------------------------------------------------------------
|
||||
class ppt_charts_files : public element
|
||||
{
|
||||
public:
|
||||
@ -179,8 +182,8 @@ public:
|
||||
std::vector<chart_content_ptr> charts_;
|
||||
|
||||
};
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ppt_theme_files
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class ppt_themes_files : public element
|
||||
{
|
||||
public:
|
||||
@ -192,13 +195,12 @@ public:
|
||||
std::vector<pptx_xml_theme_ptr> themes_;
|
||||
|
||||
};
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------
|
||||
class ppt_files : public element
|
||||
{
|
||||
public:
|
||||
ppt_files();
|
||||
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
void set_presentation(pptx_xml_presentation & presentation);
|
||||
@ -206,9 +208,11 @@ public:
|
||||
void set_styles(element_ptr Element);
|
||||
void set_comments(element_ptr Element);
|
||||
|
||||
void add_slide(slide_content_ptr sheet);
|
||||
void add_slide (slide_content_ptr sheet);
|
||||
void add_slideLayout(slide_content_ptr sheet);
|
||||
void add_slideMaster(slide_content_ptr sheet);
|
||||
void add_notes (slide_content_ptr sheet);
|
||||
void add_notesMaster(slide_content_ptr sheet);
|
||||
|
||||
void set_media(mediaitems & _Mediaitems, CApplicationFonts *pAppFonts);
|
||||
void add_charts(chart_content_ptr chart);
|
||||
@ -217,25 +221,21 @@ public:
|
||||
void set_authors_comments(pptx_xml_authors_comments_ptr & authors_comments);
|
||||
|
||||
private:
|
||||
rels_files rels_files_;
|
||||
rels_files rels_files_;
|
||||
|
||||
slides_files slides_files_;
|
||||
slideLayouts_files slideLayouts_files_;
|
||||
slideMasters_files slideMasters_files_;
|
||||
slides_files slides_files_;
|
||||
slideLayouts_files slideLayouts_files_;
|
||||
slideMasters_files slideMasters_files_;
|
||||
notes_files notes_files_;
|
||||
notesMaster_files notesMaster_files_;
|
||||
|
||||
//slides_files handoutMasters_files_;
|
||||
ppt_themes_files themes_files_;
|
||||
|
||||
ppt_charts_files charts_files_;
|
||||
//slides_files notesSlides_files_;
|
||||
//slides_files notesMasters_files_;
|
||||
//slides_files handoutMasters_files_;
|
||||
|
||||
element_ptr authors_comments_;
|
||||
|
||||
element_ptr authors_comments_;
|
||||
element_ptr presentation_;
|
||||
|
||||
element_ptr tableStyles_;
|
||||
|
||||
element_ptr comments_;
|
||||
element_ptr media_;
|
||||
element_ptr embeddings_;
|
||||
@ -247,7 +247,6 @@ class pptx_document : public document
|
||||
public:
|
||||
pptx_document();
|
||||
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
virtual content_types_file & get_content_types_file() { return content_type_file_; }
|
||||
|
||||
@ -53,7 +53,6 @@ typedef _CP_PTR(pptx_drawings) pptx_drawings_ptr;
|
||||
class pptx_slide_context::Impl
|
||||
{
|
||||
public:
|
||||
|
||||
struct _transition
|
||||
{
|
||||
bool Enabled;
|
||||
@ -66,7 +65,7 @@ public:
|
||||
bool onClick;
|
||||
};
|
||||
|
||||
Impl(const std::wstring & odfPacket) : mediaitems_(odfPacket),odfPacket_(odfPacket)
|
||||
Impl(const std::wstring & odfPacket) : mediaitems_(odfPacket), odfPacket_(odfPacket)
|
||||
{
|
||||
clear();
|
||||
}
|
||||
@ -75,24 +74,17 @@ public:
|
||||
std::vector<drawing_object_description> objects_;
|
||||
|
||||
_CP_OPT(_oox_fill) background_fill_;
|
||||
|
||||
_transition transition_;
|
||||
bool use_image_replacement_;
|
||||
|
||||
bool header, footer, date_time, slideNum;
|
||||
|
||||
void add_drawing(_pptx_drawing const & d,
|
||||
bool isInternal,
|
||||
std::wstring const & rid,
|
||||
std::wstring const & ref,
|
||||
RelsType type)
|
||||
void add_drawing(_pptx_drawing const & d, bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type)
|
||||
{
|
||||
pptx_drawings_->add(d, isInternal, rid, ref, type);
|
||||
}
|
||||
void add_additional_rels(
|
||||
bool isInternal,
|
||||
std::wstring const & rid,
|
||||
std::wstring const & ref,
|
||||
RelsType type)
|
||||
void add_additional_rels (bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type)
|
||||
{
|
||||
pptx_drawings_->add(isInternal, rid, ref, type);
|
||||
}
|
||||
@ -107,16 +99,16 @@ public:
|
||||
{
|
||||
objects_.clear();
|
||||
|
||||
background_fill_ = boost::none;
|
||||
background_fill_ = boost::none;
|
||||
|
||||
header=false;
|
||||
footer=false;
|
||||
date_time=false;
|
||||
slideNum=false;
|
||||
header = false;
|
||||
footer = false;
|
||||
date_time = false;
|
||||
slideNum = false;
|
||||
|
||||
rId_ = 1;
|
||||
|
||||
pptx_drawings_ = pptx_drawings::create();
|
||||
pptx_drawings_ = pptx_drawings::create();
|
||||
|
||||
transition_.Enabled = false;
|
||||
transition_.Speed = boost::none;
|
||||
@ -127,7 +119,6 @@ public:
|
||||
{
|
||||
return rId_++;;
|
||||
}
|
||||
|
||||
pptx_drawings_ptr get_drawings()
|
||||
{
|
||||
return pptx_drawings_;
|
||||
@ -137,7 +128,7 @@ public:
|
||||
void process_drawings();
|
||||
|
||||
private:
|
||||
void process_common_properties(drawing_object_description& obj,_pptx_drawing & drawing);
|
||||
void process_common_properties(drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
|
||||
void process_shape (drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
void process_image (drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
@ -145,14 +136,15 @@ private:
|
||||
void process_table (drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
void process_object (drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
|
||||
size_t rId_;
|
||||
mediaitems mediaitems_;
|
||||
pptx_drawings_ptr pptx_drawings_;
|
||||
size_t rId_;
|
||||
mediaitems mediaitems_;
|
||||
pptx_drawings_ptr pptx_drawings_;
|
||||
pptx_drawings_ptr pptx_notes_drawings_;
|
||||
};
|
||||
|
||||
void pptx_slide_context::Impl::process_drawings()
|
||||
{
|
||||
for (int i = 0; i < objects_.size(); i++)
|
||||
for (size_t i = 0; i < objects_.size(); i++)
|
||||
{
|
||||
_pptx_drawing drawing =_pptx_drawing();
|
||||
|
||||
@ -175,17 +167,19 @@ void pptx_slide_context::Impl::process_drawings()
|
||||
}
|
||||
|
||||
pptx_slide_context::pptx_slide_context(pptx_conversion_context & Context)
|
||||
: impl_(new pptx_slide_context::Impl(Context.root()->get_folder()))
|
||||
: impl_(new pptx_slide_context::Impl(Context.root()->get_folder()))
|
||||
{
|
||||
hlinks_size_ = 0;
|
||||
hlinks_size_ = 0;
|
||||
}
|
||||
void pptx_slide_context::start_slide()
|
||||
{
|
||||
impl_->clear(); // objects
|
||||
hlinks_size_ = 0;
|
||||
|
||||
hlinks_size_ = 0;
|
||||
|
||||
default_set(); //for current object
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void pptx_slide_context::start_slide_animation()
|
||||
{
|
||||
@ -202,10 +196,10 @@ void pptx_slide_context::start_slide_animation()
|
||||
|
||||
void pptx_slide_context::set_transitionFilter(std::wstring & type,_CP_OPT(std::wstring) & dir,_CP_OPT(std::wstring) & dop,_CP_OPT(int) & time)
|
||||
{
|
||||
impl_->transition_.Type = type;
|
||||
impl_->transition_.Time = time; // не путать длительность перехода с длительностью эффекта перехода (в oo его нет)
|
||||
impl_->transition_.Dir = dir;
|
||||
impl_->transition_.Param = dop;
|
||||
impl_->transition_.Type = type;
|
||||
impl_->transition_.Time = time; // не путать длительность перехода с длительностью эффекта перехода (в oo его нет)
|
||||
impl_->transition_.Dir = dir;
|
||||
impl_->transition_.Param = dop;
|
||||
}
|
||||
|
||||
void pptx_slide_context::set_transitionAction(bool val)
|
||||
@ -215,8 +209,8 @@ void pptx_slide_context::set_transitionAction(bool val)
|
||||
|
||||
void pptx_slide_context::set_transitionSpeed(std::wstring val)
|
||||
{
|
||||
if (val == L"medium")impl_->transition_.Speed=L"med";
|
||||
else impl_->transition_.Speed= val;//fast / slow
|
||||
if (val == L"medium") impl_->transition_.Speed = L"med";
|
||||
else impl_->transition_.Speed = val;//fast / slow
|
||||
}
|
||||
|
||||
|
||||
@ -227,6 +221,7 @@ void pptx_slide_context::default_set()
|
||||
impl_->object_description_.name_ = L"";
|
||||
impl_->object_description_.descriptor_ = L"";
|
||||
impl_->object_description_.anchor_ = L"";
|
||||
|
||||
impl_->object_description_.additional_.clear();
|
||||
|
||||
impl_->object_description_.clipping_string_= L"";
|
||||
@ -247,10 +242,10 @@ void pptx_slide_context::set_use_image_replacement()
|
||||
|
||||
void pptx_slide_context::set_placeHolder_type(std::wstring typeHolder)
|
||||
{
|
||||
if (typeHolder == L"ftr") impl_->footer= true;
|
||||
if (typeHolder == L"hdr") impl_->header= true;
|
||||
if (typeHolder == L"dt") impl_->date_time= true;
|
||||
if (typeHolder == L"sldNum")impl_->slideNum= true;
|
||||
if (typeHolder == L"ftr") impl_->footer = true;
|
||||
if (typeHolder == L"hdr") impl_->header = true;
|
||||
if (typeHolder == L"dt") impl_->date_time = true;
|
||||
if (typeHolder == L"sldNum")impl_->slideNum = true;
|
||||
|
||||
impl_->object_description_.additional_.push_back(odf_reader::_property(L"PlaceHolderType",typeHolder));
|
||||
}
|
||||
@ -445,7 +440,7 @@ void pptx_slide_context::process_drawings()
|
||||
return impl_->process_drawings();
|
||||
}
|
||||
|
||||
void pptx_slide_context::Impl::process_image(drawing_object_description& pic, _pptx_drawing & drawing)
|
||||
void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _pptx_drawing & drawing)
|
||||
{
|
||||
int pos_replaicement = 0, pos_preview = 0;
|
||||
|
||||
@ -453,22 +448,22 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& pic, _p
|
||||
drawing.fill.type = 2;
|
||||
|
||||
_CP_OPT(std::wstring) sTextContent;
|
||||
GetProperty(pic.additional_, L"text-content", sTextContent);
|
||||
GetProperty(obj.additional_, L"text-content", sTextContent);
|
||||
if (sTextContent)//в ms office на картинке нельзя сделать надпись - меняем тип на рект с заливкой картинкой
|
||||
{
|
||||
drawing.type = typeShape;
|
||||
drawing.sub_type = 2;//rect
|
||||
}
|
||||
|
||||
std::wstring fileName = odfPacket_ + FILE_SEPARATOR_STR + pic.xlink_href_;
|
||||
drawing.fill.bitmap->bCrop = odf_reader::parse_clipping(pic.clipping_string_,fileName,drawing.fill.bitmap->cropRect, NULL);
|
||||
std::wstring fileName = odfPacket_ + FILE_SEPARATOR_STR + obj.xlink_href_;
|
||||
drawing.fill.bitmap->bCrop = odf_reader::parse_clipping(obj.clipping_string_, fileName, drawing.fill.bitmap->cropRect, NULL);
|
||||
drawing.fill.bitmap->bStretch = true;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
std::wstring ref;/// это ссылка на выходной внешний объект
|
||||
bool isMediaInternal = false;
|
||||
|
||||
drawing.fill.bitmap->rId = get_mediaitems().add_or_find(pic.xlink_href_, typeImage, isMediaInternal, ref);
|
||||
drawing.fill.bitmap->rId = get_mediaitems().add_or_find(obj.xlink_href_, typeImage, isMediaInternal, ref);
|
||||
|
||||
if (drawing.type == typeShape)
|
||||
{
|
||||
@ -476,11 +471,13 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& pic, _p
|
||||
|
||||
isMediaInternal = true;
|
||||
std::wstring rId = get_mediaitems().add_or_find(L"", typeShape, isMediaInternal, ref);
|
||||
|
||||
add_drawing(drawing, isMediaInternal, rId, ref, typeShape);//объект
|
||||
|
||||
}else if (!drawing.fill.bitmap->rId.empty())
|
||||
}
|
||||
else if (!drawing.fill.bitmap->rId.empty())
|
||||
{
|
||||
add_drawing(drawing, isMediaInternal, drawing.fill.bitmap->rId , ref, drawing.type);//объект
|
||||
add_drawing(drawing, isMediaInternal, drawing.fill.bitmap->rId, ref, drawing.type);//объект
|
||||
}
|
||||
}
|
||||
void pptx_slide_context::Impl::process_chart(drawing_object_description & obj, _pptx_drawing & drawing)
|
||||
@ -488,8 +485,9 @@ void pptx_slide_context::Impl::process_chart(drawing_object_description & obj, _
|
||||
std::wstring ref;
|
||||
bool isMediaInternal = true;
|
||||
|
||||
drawing.objectId = get_mediaitems().add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
add_drawing(drawing, isMediaInternal, drawing.objectId, ref, drawing.type);
|
||||
drawing.objectId = get_mediaitems().add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
|
||||
add_drawing(drawing, isMediaInternal, drawing.objectId, ref, drawing.type);
|
||||
}
|
||||
|
||||
void pptx_slide_context::Impl::process_table(drawing_object_description & obj, _pptx_drawing & drawing)
|
||||
@ -499,6 +497,7 @@ void pptx_slide_context::Impl::process_table(drawing_object_description & obj, _
|
||||
std::wstring rId = get_mediaitems().add_or_find(L"", obj.type_, isMediaInternal, ref);
|
||||
|
||||
add_drawing(drawing, isMediaInternal, rId, ref, drawing.type);
|
||||
|
||||
}
|
||||
|
||||
void pptx_slide_context::Impl::process_shape(drawing_object_description & obj, _pptx_drawing & drawing)
|
||||
@ -511,6 +510,7 @@ void pptx_slide_context::Impl::process_shape(drawing_object_description & obj, _
|
||||
if (drawing.fill.bitmap)
|
||||
{
|
||||
drawing.fill.bitmap->rId = get_mediaitems().add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
|
||||
|
||||
add_additional_rels(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);
|
||||
}
|
||||
|
||||
@ -541,11 +541,12 @@ void pptx_slide_context::Impl::process_object(drawing_object_description& obj, _
|
||||
drawing.objectId = get_mediaitems().add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
drawing.objectProgId = obj.descriptor_;
|
||||
|
||||
add_drawing(drawing, isMediaInternal, drawing.objectId, ref, drawing.type);
|
||||
add_drawing(drawing, isMediaInternal, drawing.objectId, ref, drawing.type);
|
||||
|
||||
if (drawing.fill.bitmap)
|
||||
{
|
||||
drawing.fill.bitmap->rId = get_mediaitems().add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
|
||||
|
||||
add_additional_rels(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);
|
||||
}
|
||||
}
|
||||
@ -575,7 +576,6 @@ void pptx_slide_context::Impl::process_common_properties(drawing_object_descript
|
||||
drawing.fill = pic.fill_;
|
||||
}
|
||||
|
||||
|
||||
void pptx_slide_context::dump_rels(rels & Rels)
|
||||
{
|
||||
impl_->get_drawings()->dump_rels(Rels);
|
||||
@ -590,6 +590,7 @@ void pptx_slide_context::add_rels( bool isInternal, std::wstring const & rid, st
|
||||
{
|
||||
impl_->add_additional_rels(isInternal, rid, ref, type);
|
||||
}
|
||||
|
||||
void pptx_slide_context::set_footer()
|
||||
{
|
||||
impl_->footer = true;
|
||||
@ -608,7 +609,7 @@ void pptx_slide_context::set_date_time()
|
||||
}
|
||||
void pptx_slide_context::serialize_background(std::wostream & strm, bool always)
|
||||
{
|
||||
if (!always && ( (!impl_->background_fill_) || (impl_->background_fill_->type==0))) return;
|
||||
if (!always && ( (!impl_->background_fill_) || (impl_->background_fill_->type == 0))) return;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -618,7 +619,7 @@ void pptx_slide_context::serialize_background(std::wostream & strm, bool always)
|
||||
{
|
||||
if (impl_->background_fill_)
|
||||
{
|
||||
oox_serialize_fill(CP_XML_STREAM(),impl_->background_fill_.get());
|
||||
oox_serialize_fill(CP_XML_STREAM(), impl_->background_fill_.get());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -689,7 +690,6 @@ void pptx_slide_context::serialize_HeaderFooter(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pptx_slide_context::serialize_objects(std::wostream & strm)
|
||||
{
|
||||
int next_id = impl_->next_rId();
|
||||
@ -701,8 +701,8 @@ void pptx_slide_context::serialize_objects(std::wostream & strm)
|
||||
{
|
||||
CP_XML_NODE(L"p:cNvPr")
|
||||
{
|
||||
CP_XML_ATTR(L"name",L"noGroup");
|
||||
CP_XML_ATTR(L"id",next_id);
|
||||
CP_XML_ATTR(L"name", L"noGroup");
|
||||
CP_XML_ATTR(L"id", next_id);
|
||||
}
|
||||
CP_XML_NODE(L"p:cNvGrpSpPr");
|
||||
CP_XML_NODE(L"p:nvPr");
|
||||
|
||||
@ -89,16 +89,19 @@ public:
|
||||
void end_table();
|
||||
|
||||
void start_shape(int type);
|
||||
void end_shape();
|
||||
void end_shape ();
|
||||
|
||||
void set_use_image_replacement();
|
||||
|
||||
bool empty() const;
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void serialize_objects(std::wostream & strm);
|
||||
void serialize_HeaderFooter(std::wostream & strm);
|
||||
void serialize_background(std::wostream & strm, bool always=false);
|
||||
void serialize_animations(std::wostream & strm);
|
||||
|
||||
void serialize_HeaderFooter (std::wostream & strm);
|
||||
void serialize_animations (std::wostream & strm);
|
||||
|
||||
void serialize_objects (std::wostream & strm);
|
||||
|
||||
void serialize_background (std::wostream & strm, bool always = false);
|
||||
|
||||
void dump_rels(rels & Rels);
|
||||
|
||||
@ -106,7 +109,7 @@ public:
|
||||
|
||||
mediaitems & get_mediaitems();
|
||||
|
||||
void add_background(_oox_fill & fill);
|
||||
void add_background (_oox_fill & fill);
|
||||
|
||||
void add_rels( bool isInternal,
|
||||
std::wstring const & rid,
|
||||
|
||||
@ -421,8 +421,8 @@ void xlsx_table_state::serialize_table_format (std::wostream & strm)
|
||||
int col = -1, row = -1;
|
||||
try
|
||||
{
|
||||
col = boost::lexical_cast<int>(s_col);
|
||||
row = boost::lexical_cast<int>(s_row);
|
||||
if (!s_col.empty()) col = boost::lexical_cast<int>(s_col);
|
||||
if (!s_row.empty()) row = boost::lexical_cast<int>(s_row);
|
||||
}
|
||||
catch(...){}
|
||||
|
||||
|
||||
@ -317,77 +317,58 @@ void xlsx_text_context::Impl::write_rPr(std::wostream & strm)
|
||||
|
||||
ApplyTextProperties (span_style_name_, paragraph_style_name_, text_properties_);
|
||||
|
||||
_CP_OPT(double) dValFontSize;
|
||||
if (text_properties_.fo_font_size_)
|
||||
dValFontSize=text_properties_.fo_font_size_->get_length().get_value();
|
||||
|
||||
_CP_OPT(std::wstring) sValFontFamily;
|
||||
if (text_properties_.fo_font_family_)
|
||||
if (in_draw)
|
||||
{
|
||||
std::wstring val =text_properties_.fo_font_family_.get();
|
||||
//'Arial' глючит
|
||||
removeCharsFromString(val, _T("'"));
|
||||
|
||||
sValFontFamily=text_properties_.fo_font_family_.get();
|
||||
odf_reader::fonts_container fonts;
|
||||
text_properties_.drawing_serialize(strm, L"a:rPr", fonts);
|
||||
}
|
||||
//else if (text_properties_.style_font_name_) - тут может быть отсылка к font_face)decl !!!!
|
||||
// sValFontFamily=text_properties_.style_font_name_.get();
|
||||
|
||||
_CP_OPT(std::wstring) sValFontColor;
|
||||
if (text_properties_.fo_color_)
|
||||
sValFontColor=text_properties_.fo_color_->get_hex_value();
|
||||
|
||||
_CP_OPT(int) iValFontWeight;
|
||||
if (text_properties_.fo_font_weight_)
|
||||
iValFontWeight=text_properties_.fo_font_weight_->get_type();
|
||||
|
||||
_CP_OPT(int) iValFontStyle;
|
||||
if(text_properties_.fo_font_style_)
|
||||
iValFontStyle=text_properties_.fo_font_style_->get_type();
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
if (in_draw)
|
||||
{
|
||||
//oox_serialize_style_text(strm,text_properties_);
|
||||
//oox_serialize_style_text(strm,odf_reader::text_format_properties_content & properties);
|
||||
CP_XML_NODE(L"a:rPr")
|
||||
{
|
||||
//стр 3197
|
||||
if (dValFontSize) {CP_XML_ATTR(L"sz", (int)(dValFontSize.get()*100));}
|
||||
if ((iValFontStyle) && (iValFontStyle.get() >0)) {CP_XML_ATTR(L"i", "1");} //"true");} Exercícios de Aprendizagem.ods
|
||||
if ((iValFontWeight) && (iValFontWeight.get() >0)) {CP_XML_ATTR(L"b", "1");} //"true");} Exercícios de Aprendizagem.ods
|
||||
if (sValFontColor)
|
||||
{
|
||||
CP_XML_NODE(L"a:solidFill") {CP_XML_NODE(L"a:srgbClr"){CP_XML_ATTR(L"val", sValFontColor.get());}}
|
||||
}
|
||||
if (sValFontFamily)
|
||||
{
|
||||
CP_XML_NODE(L"a:latin"){CP_XML_ATTR(L"typeface", sValFontFamily.get());}
|
||||
}
|
||||
|
||||
|
||||
if (hyperlink_hId.length()>0)
|
||||
{
|
||||
CP_XML_NODE(L"a:hlinkClick ")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
CP_XML_ATTR(L"r:id", hyperlink_hId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"rPr")
|
||||
{
|
||||
if (sValFontFamily) {CP_XML_NODE(L"rFont") {CP_XML_ATTR(L"val", sValFontFamily.get());}}
|
||||
if (dValFontSize) {CP_XML_NODE(L"sz") {CP_XML_ATTR(L"val", (int)(dValFontSize.get()));}}
|
||||
if (sValFontColor) {CP_XML_NODE(L"color") {CP_XML_ATTR(L"rgb", sValFontColor.get());}}
|
||||
if ((iValFontStyle) &&
|
||||
(iValFontStyle.get() >0)) {CP_XML_NODE(L"i") {CP_XML_ATTR(L"val", "true");}}
|
||||
if ((iValFontWeight) &&
|
||||
(iValFontWeight.get() >0)) {CP_XML_NODE(L"b") {CP_XML_ATTR(L"val", "true");}}
|
||||
if (text_properties_.fo_font_family_)
|
||||
{
|
||||
CP_XML_NODE(L"rFont")
|
||||
{
|
||||
CP_XML_ATTR(L"val", text_properties_.fo_font_family_.get());
|
||||
}
|
||||
}
|
||||
if (text_properties_.fo_font_size_)
|
||||
{
|
||||
CP_XML_NODE(L"sz")
|
||||
{
|
||||
CP_XML_ATTR(L"val", (int)text_properties_.fo_font_size_->get_length().get_value());
|
||||
}
|
||||
}
|
||||
if (text_properties_.fo_color_)
|
||||
{
|
||||
CP_XML_NODE(L"color")
|
||||
{
|
||||
CP_XML_ATTR(L"rgb", text_properties_.fo_color_->get_hex_value());
|
||||
}
|
||||
}
|
||||
if (text_properties_.fo_font_style_)
|
||||
{
|
||||
CP_XML_NODE(L"i")
|
||||
{
|
||||
if (text_properties_.fo_font_style_->get_type() > 0)
|
||||
CP_XML_ATTR(L"val", "true");
|
||||
else
|
||||
CP_XML_ATTR(L"val", "false");
|
||||
}
|
||||
}
|
||||
if (text_properties_.fo_font_weight_)
|
||||
{
|
||||
CP_XML_NODE(L"b")
|
||||
{
|
||||
if (text_properties_.fo_font_weight_->get_type() > 0)
|
||||
CP_XML_ATTR(L"val", "true");
|
||||
else
|
||||
CP_XML_ATTR(L"val", "false");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,10 +54,9 @@ class xlsx_conversion_context;
|
||||
class xlsx_text_context: boost::noncopyable
|
||||
{
|
||||
public:
|
||||
//xlsx_text_context();
|
||||
xlsx_text_context(odf_reader::styles_container & styles_);
|
||||
~xlsx_text_context();
|
||||
public:
|
||||
xlsx_text_context (odf_reader::styles_container & styles_);
|
||||
~xlsx_text_context ();
|
||||
|
||||
void set_local_styles_container (odf_reader::styles_container *local_styles_);
|
||||
void set_cell_text_properties (odf_reader::text_format_properties_content *text_properties);
|
||||
|
||||
|
||||
@ -32,18 +32,14 @@
|
||||
|
||||
#include "anim_elements.h"
|
||||
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
#include "odfcontext.h"
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
|
||||
|
||||
#include "draw_common.h"
|
||||
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
@ -74,16 +70,16 @@ void anim_par::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
}
|
||||
///////////////////////// последовательности .. (если один элемент - основная последовательность, иное - взаимодействующая анимация)
|
||||
//slide_context().animation_context().start_sequence();
|
||||
BOOST_FOREACH(const office_element_ptr& elm, anim_seq_array_)
|
||||
for (size_t i = 0; i < anim_seq_array_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
anim_seq_array_[i]->pptx_convert(Context);
|
||||
}
|
||||
//slide_context().animation_context().end_sequence();
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//внутренние эффекты - те что внутри одной последовательности
|
||||
BOOST_FOREACH(const office_element_ptr& elm, content_)
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
}
|
||||
void anim_par::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -106,9 +102,9 @@ void anim_seq::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
|
||||
void anim_seq::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
BOOST_FOREACH(const office_element_ptr& elm, anim_par_array_)
|
||||
for (size_t i = 0; i < anim_par_array_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
anim_par_array_[i]->pptx_convert(Context);
|
||||
}
|
||||
}
|
||||
void anim_seq::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
|
||||
@ -251,7 +251,11 @@ static const _shape_converter _OO_OOX_custom_shapes[]=
|
||||
{L"" ,L"accentBorderCallout3",0 ,0 ,0 },
|
||||
{L"" ,L"accentBorderCallout2",0 ,0 ,0 },
|
||||
{L"" ,L"accentBorderCallout1",0 ,0 ,0 },
|
||||
{L"" ,L"halfFrame" ,0 ,0 ,0 }
|
||||
{L"" ,L"halfFrame" ,0 ,0 ,0 },
|
||||
{L"" ,L"leftCircularArrow",0 ,0 ,0 },
|
||||
{L"" ,L"leftRightRibbon",0 ,0 ,0 },
|
||||
{L"" ,L"pieWedge",0 ,0 ,0 },
|
||||
{L"" ,L"swooshArrow",0 ,0 ,0 }
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -126,13 +126,15 @@ std::wstring presentation_class::get_type_ms()
|
||||
res = L"sldNum";
|
||||
break;
|
||||
case subtitle:
|
||||
case page:
|
||||
case notes:
|
||||
case handout:
|
||||
case outline:
|
||||
case text:
|
||||
res = L"body";
|
||||
break;
|
||||
case page:
|
||||
res = L"sldImg";
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -32,13 +32,9 @@
|
||||
|
||||
#include "draw_page.h"
|
||||
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
#include "odfcontext.h"
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
@ -78,13 +74,15 @@ void draw_page::add_child_element( xml::sax * Reader, const std::wstring & Ns, c
|
||||
{
|
||||
if CP_CHECK_NAME(L"anim", L"par")
|
||||
CP_CREATE_ELEMENT(animation_);
|
||||
else if (L"presentation" == Ns && L"notes" == Name)
|
||||
CP_CREATE_ELEMENT(presentation_notes_);
|
||||
else
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
|
||||
void draw_page::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
draw_page_attr_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void draw_page::pptx_convert_placeHolder(oox::pptx_conversion_context & Context, std::wstring styleName, presentation_class::type PresentationClass)
|
||||
@ -96,7 +94,7 @@ void draw_page::pptx_convert_placeHolder(oox::pptx_conversion_context & Context,
|
||||
|
||||
int index=-1;
|
||||
|
||||
const std::wstring masterName = draw_page_attr_.master_page_name_.get_value_or(L"");
|
||||
const std::wstring masterName = attlist_.master_page_name_.get_value_or(L"");
|
||||
style_master_page * master = Context.root()->odf_context().pageLayoutContainer().master_page_by_name(masterName);
|
||||
|
||||
if (master)
|
||||
@ -129,16 +127,16 @@ void draw_page::pptx_convert_placeHolder(oox::pptx_conversion_context & Context,
|
||||
|
||||
void draw_page::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
const std::wstring pageStyleName = draw_page_attr_.draw_style_name_.get_value_or(L"");
|
||||
const std::wstring pageName = draw_page_attr_.draw_name_.get_value_or(L"");
|
||||
const std::wstring layoutName = draw_page_attr_.page_layout_name_.get_value_or(L"");
|
||||
const std::wstring masterName = draw_page_attr_.master_page_name_.get_value_or(L"");
|
||||
const std::wstring pageStyleName = attlist_.draw_style_name_.get_value_or(L"");
|
||||
const std::wstring pageName = attlist_.draw_name_.get_value_or(L"");
|
||||
const std::wstring layoutName = attlist_.page_layout_name_.get_value_or(L"");
|
||||
const std::wstring masterName = attlist_.master_page_name_.get_value_or(L"");
|
||||
|
||||
_CP_LOG << L"[info][xlsx] process page(slide) \"" << pageName /*L"" */<< L"\"" << std::endl;
|
||||
_CP_LOG << L"[info][pptx] process page(slide) \"" << pageName /*L"" */<< L"\"" << std::endl;
|
||||
|
||||
Context.start_page(pageName, pageStyleName, layoutName,masterName);
|
||||
|
||||
if (draw_page_attr_.draw_style_name_)
|
||||
if (attlist_.draw_style_name_)
|
||||
{
|
||||
style_instance * style_inst = Context.root()->odf_context().styleContainer().style_by_name(pageStyleName,style_family::DrawingPage,false);
|
||||
|
||||
@ -191,23 +189,30 @@ void draw_page::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
animation_->pptx_convert(Context);
|
||||
}
|
||||
/////////////////////////
|
||||
BOOST_FOREACH(const office_element_ptr& elm, content_)
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
|
||||
if (draw_page_attr_.use_footer_name_)//from master_page
|
||||
if (attlist_.use_footer_name_)//from master_page
|
||||
{
|
||||
std::wstring name = L"footer:" + *draw_page_attr_.use_footer_name_;
|
||||
std::wstring name = L"footer:" + *attlist_.use_footer_name_;
|
||||
pptx_convert_placeHolder(Context, name, presentation_class::footer);
|
||||
}
|
||||
if (draw_page_attr_.use_date_time_name_)//from master_page
|
||||
if (attlist_.use_date_time_name_)//from master_page
|
||||
{
|
||||
std::wstring name = L"datetime:" + *draw_page_attr_.use_date_time_name_;
|
||||
std::wstring name = L"datetime:" + *attlist_.use_date_time_name_;
|
||||
pptx_convert_placeHolder(Context, name, presentation_class::date_time);
|
||||
}
|
||||
|
||||
Context.end_page();
|
||||
|
||||
Context.end_page();
|
||||
if (presentation_notes_)
|
||||
{
|
||||
Context.start_page_notes();
|
||||
presentation_notes_->pptx_convert(Context);
|
||||
Context.end_page_notes();
|
||||
}
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * presentation_footer_decl::ns = L"presentation";
|
||||
@ -243,6 +248,117 @@ void presentation_date_time_decl::pptx_convert(oox::pptx_conversion_context & Co
|
||||
{
|
||||
Context.get_text_context().add_text(text_);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * presentation_notes::ns = L"presentation";
|
||||
const wchar_t * presentation_notes::name = L"notes";
|
||||
|
||||
void presentation_notes::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
|
||||
void presentation_notes::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void presentation_notes::pptx_convert_placeHolder(oox::pptx_conversion_context & Context, std::wstring styleName, presentation_class::type PresentationClass)
|
||||
{
|
||||
office_element_ptr elm = Context.root()->odf_context().drawStyles().find_by_style_name(styleName);
|
||||
//todooo если это элемент datatime -нужно вытащить формат поля
|
||||
|
||||
if (!elm)return;
|
||||
|
||||
int index=-1;
|
||||
|
||||
const std::wstring masterName = attlist_.master_page_name_.get_value_or(L"");
|
||||
style_master_page * master = Context.root()->odf_context().pageLayoutContainer().master_page_by_name(masterName);
|
||||
|
||||
//if (master)
|
||||
// index = master->find_placeHolderIndex(PresentationClass, Context.last_idx_placeHolder);
|
||||
|
||||
|
||||
Context.get_slide_context().start_shape(1);
|
||||
Context.get_slide_context().set_placeHolder_type(presentation_class(PresentationClass).get_type_ms());
|
||||
Context.get_slide_context().set_placeHolder_idx(index);
|
||||
|
||||
Context.get_text_context().start_object();
|
||||
|
||||
if (PresentationClass == presentation_class::date_time)
|
||||
{
|
||||
Context.get_text_context().start_field(oox::datetime, L"");
|
||||
}
|
||||
|
||||
elm->pptx_convert(Context);
|
||||
|
||||
std::wstring text_content_ = Context.get_text_context().end_object();
|
||||
|
||||
if (text_content_.length()>0)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"text-content",text_content_));
|
||||
}
|
||||
Context.get_slide_context().set_property(_property(L"no_rect",true));
|
||||
Context.get_slide_context().end_shape();
|
||||
|
||||
}
|
||||
|
||||
void presentation_notes::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
const std::wstring pageStyleName = attlist_.draw_style_name_.get_value_or(L"");
|
||||
const std::wstring layoutName = attlist_.page_layout_name_.get_value_or(L"");
|
||||
const std::wstring masterName = attlist_.master_page_name_.get_value_or(L"");
|
||||
|
||||
_CP_LOG << L"[info][pptx] process note slide" << std::endl;
|
||||
|
||||
if (attlist_.draw_style_name_)
|
||||
{
|
||||
style_instance * style_inst = Context.root()->odf_context().styleContainer().style_by_name(pageStyleName, style_family::DrawingPage, Context.process_masters_);
|
||||
|
||||
if ((style_inst) && (style_inst->content()))
|
||||
{
|
||||
const style_drawing_page_properties * properties = style_inst->content()->get_style_drawing_page_properties();
|
||||
|
||||
if (properties)
|
||||
{
|
||||
oox::_oox_fill fill;
|
||||
Compute_GraphicFill(properties->content().common_draw_fill_attlist_, office_element_ptr(),
|
||||
Context.root()->odf_context().drawStyles() ,fill);
|
||||
Context.get_slide_context().add_background(fill);
|
||||
|
||||
////////////////////////////////////////////////
|
||||
if ((properties->content().presentation_display_footer_) && (*properties->content().presentation_display_footer_))
|
||||
Context.get_slide_context().set_footer();
|
||||
|
||||
if ((properties->content().presentation_display_header_) && (*properties->content().presentation_display_header_))
|
||||
Context.get_slide_context().set_header();
|
||||
|
||||
if ((properties->content().presentation_display_page_number_) && (*properties->content().presentation_display_page_number_))
|
||||
Context.get_slide_context().set_page_number();
|
||||
|
||||
if ((properties->content().presentation_display_date_time_) && (*properties->content().presentation_display_date_time_))
|
||||
Context.get_slide_context().set_date_time();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
|
||||
if (attlist_.use_footer_name_)//from master_page_notes
|
||||
{
|
||||
std::wstring name = L"footer:" + *attlist_.use_footer_name_;
|
||||
pptx_convert_placeHolder(Context, name, presentation_class::footer);
|
||||
}
|
||||
if (attlist_.use_date_time_name_)//from master_page_notes
|
||||
{
|
||||
std::wstring name = L"datetime:" + *attlist_.use_date_time_name_;
|
||||
pptx_convert_placeHolder(Context, name, presentation_class::date_time);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,11 +79,11 @@ private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
private:
|
||||
office_element_ptr_array content_;
|
||||
office_element_ptr animation_;
|
||||
office_element_ptr_array content_;
|
||||
office_element_ptr animation_;
|
||||
office_element_ptr presentation_notes_;
|
||||
|
||||
draw_page_attr draw_page_attr_;
|
||||
draw_page_attr attlist_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_page);
|
||||
@ -139,5 +139,28 @@ private:
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(presentation_date_time_decl);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//presentation:date-time-decl
|
||||
class presentation_notes : public office_element_impl<presentation_notes>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typePresentationNotes;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
void pptx_convert_placeHolder(oox::pptx_conversion_context & Context, std::wstring styleName, odf_types::presentation_class::type PresentationClass);
|
||||
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
office_element_ptr_array content_;
|
||||
draw_page_attr attlist_;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(presentation_notes);
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,10 +163,10 @@ void draw_line::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
}
|
||||
void draw_line::reset_svg_attributes()
|
||||
{
|
||||
double x1=draw_line_attlist_.svg_x1_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double y1=draw_line_attlist_.svg_y1_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double x2=draw_line_attlist_.svg_x2_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double y2=draw_line_attlist_.svg_y2_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double x1 = draw_line_attlist_.svg_x1_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double y1 = draw_line_attlist_.svg_y1_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double x2 = draw_line_attlist_.svg_x2_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double y2 = draw_line_attlist_.svg_y2_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
|
||||
if (x1 > x2)
|
||||
{
|
||||
@ -431,8 +431,8 @@ void draw_equation::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
}
|
||||
int draw_enhanced_geometry::parsing(_CP_OPT(std::wstring) val)
|
||||
{
|
||||
int pos=0, res=-1;
|
||||
if (!val)return res;
|
||||
int pos = 0, res = -1;
|
||||
if (!val) return res;
|
||||
|
||||
BOOST_FOREACH(wchar_t c, val.get())
|
||||
{
|
||||
@ -533,12 +533,12 @@ void draw_enhanced_geometry::find_draw_type_oox()
|
||||
}
|
||||
else
|
||||
{
|
||||
bOoxType_ = true;
|
||||
std::wstring oox_type = odf_type.substr(pos + 6);
|
||||
for (long i = 0; i< count; i++)
|
||||
{
|
||||
if (_OO_OOX_custom_shapes[i].oox == oox_type)
|
||||
{
|
||||
bOoxType_ = true;
|
||||
draw_type_oox_index_ = i;
|
||||
break;
|
||||
}
|
||||
@ -550,38 +550,36 @@ void draw_enhanced_geometry::find_draw_type_oox()
|
||||
}
|
||||
}
|
||||
}
|
||||
std::wstringstream str;
|
||||
// for (size_t i = 0; i < draw_handle_.size(); i++)
|
||||
// {
|
||||
//draw_handle * handle = dynamic_cast<draw_handle *>(draw_handle_[i].get());
|
||||
//if (!handle) continue;
|
||||
|
||||
for (size_t i = 0; i < draw_handle_.size(); i++)
|
||||
{
|
||||
draw_handle * handle = dynamic_cast<draw_handle *>(draw_handle_[i].get());
|
||||
if (!handle) continue;
|
||||
//int min = -1, max = -1;
|
||||
//
|
||||
//try
|
||||
//{
|
||||
// min = parsing(handle->draw_handle_attlist_.draw_handle_range_y_minimum_);//пока статик .. и выдается только цыфровое значение
|
||||
// if (min < 0) min = parsing(handle->draw_handle_attlist_.draw_handle_range_x_minimum_);
|
||||
// if (min < 0) min = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_minimum_);
|
||||
//}
|
||||
//catch(...)
|
||||
//{
|
||||
//}
|
||||
//if (min < 0 ) min=0;
|
||||
|
||||
int min = -1, max = -1;
|
||||
|
||||
try
|
||||
{
|
||||
min = parsing(handle->draw_handle_attlist_.draw_handle_range_y_minimum_);//пока статик .. и выдается только цыфровое значение
|
||||
if (min < 0) min = parsing(handle->draw_handle_attlist_.draw_handle_range_x_minimum_);
|
||||
if (min < 0) min = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_minimum_);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
}
|
||||
if (min < 0 ) min=0;
|
||||
|
||||
try
|
||||
{
|
||||
max = parsing(handle->draw_handle_attlist_.draw_handle_range_y_maximum_);
|
||||
if (max < 0) max = parsing(handle->draw_handle_attlist_.draw_handle_range_x_maximum_);
|
||||
if (max < 0) max = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_maximum_);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
}
|
||||
draw_handle_geometry elm = {min, max};
|
||||
draw_handle_geometry_.push_back(elm);
|
||||
}
|
||||
//try
|
||||
//{
|
||||
// max = parsing(handle->draw_handle_attlist_.draw_handle_range_y_maximum_);
|
||||
// if (max < 0) max = parsing(handle->draw_handle_attlist_.draw_handle_range_x_maximum_);
|
||||
// if (max < 0) max = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_maximum_);
|
||||
//}
|
||||
//catch(...)
|
||||
//{
|
||||
//}
|
||||
//draw_handle_geometry elm = {min, max};
|
||||
//draw_handle_geometry_.push_back(elm);
|
||||
// }
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// draw-caption-attlist
|
||||
|
||||
@ -246,7 +246,8 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
|
||||
|
||||
if (draw_type_oox_index_)
|
||||
{
|
||||
shape->additional_.push_back(_property(L"odf-custom-draw-index", draw_type_oox_index_.get()));
|
||||
shape->additional_.push_back(_property(L"oox-geom-index", draw_type_oox_index_.get()));
|
||||
shape->additional_.push_back(_property(L"oox-geom", bOoxType_));
|
||||
|
||||
if (shape->word_art_ == true)
|
||||
shape->additional_.push_back(_property(L"wordArt", true));
|
||||
@ -259,7 +260,7 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
|
||||
shape->sub_type_ = sub_type_.get();
|
||||
set_shape = true;
|
||||
}
|
||||
std::wstring odf_path;
|
||||
std::wstring odf_path; //общая часть - объединить ...
|
||||
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
|
||||
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
@ -280,7 +281,7 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
|
||||
res = false;
|
||||
}
|
||||
|
||||
if (o_Polyline.size() > 1 && res )
|
||||
if (!o_Polyline.empty() && res )
|
||||
{
|
||||
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
|
||||
std::wstringstream output_;
|
||||
@ -317,14 +318,10 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
|
||||
{
|
||||
shape->additional_.push_back(_property(L"draw-modifiers",draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
if (draw_handle_geometry_.size()>0)
|
||||
if (bOoxType_)
|
||||
shape->additional_.push_back(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
else
|
||||
{
|
||||
if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
|
||||
{
|
||||
shape->additional_.push_back(_property(L"draw-modifiers-min", draw_handle_geometry_[0].min));
|
||||
shape->additional_.push_back(_property(L"draw-modifiers-max", draw_handle_geometry_[0].max));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -312,8 +312,9 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
|
||||
|
||||
if (draw_type_oox_index_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"odf-custom-draw-index", draw_type_oox_index_.get()));
|
||||
|
||||
Context.get_slide_context().set_property(_property(L"oox-geom-index", draw_type_oox_index_.get()));
|
||||
Context.get_slide_context().set_property(_property(L"oox-geom", bOoxType_));
|
||||
|
||||
if (word_art_ == true)
|
||||
Context.get_slide_context().set_property(_property(L"wordArt", true));
|
||||
|
||||
@ -325,7 +326,13 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
|
||||
set_shape = true;
|
||||
}
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
std::wstring odf_path;
|
||||
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
|
||||
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
|
||||
|
||||
if (!odf_path.empty())
|
||||
{
|
||||
std::vector<::svg_path::_polyline> o_Polyline;
|
||||
|
||||
@ -333,7 +340,7 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
|
||||
|
||||
try
|
||||
{
|
||||
res = ::svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
|
||||
res = ::svg_path::parseSvgD(o_Polyline, odf_path, true);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@ -375,16 +382,20 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
|
||||
}
|
||||
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"draw-modifiers",draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
|
||||
if (draw_handle_geometry_.size()>0)
|
||||
if (bOoxType_)
|
||||
Context.get_slide_context().set_property(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
else
|
||||
{
|
||||
if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"draw-modifiers-min",draw_handle_geometry_[0].min));
|
||||
Context.get_slide_context().set_property(_property(L"draw-modifiers-max",draw_handle_geometry_[0].max));
|
||||
}
|
||||
}
|
||||
|
||||
//if (draw_handle_geometry_.size()>0)
|
||||
//{
|
||||
// if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
|
||||
// {
|
||||
// Context.get_slide_context().set_property(_property(L"draw-modifiers-min",draw_handle_geometry_[0].min));
|
||||
// Context.get_slide_context().set_property(_property(L"draw-modifiers-max",draw_handle_geometry_[0].max));
|
||||
// }
|
||||
//}
|
||||
}
|
||||
if (!set_shape)
|
||||
{
|
||||
|
||||
@ -258,7 +258,8 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
|
||||
if (draw_type_oox_index_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"odf-custom-draw-index", draw_type_oox_index_.get()));
|
||||
Context.get_drawing_context().set_property(_property(L"oox-geom-index", draw_type_oox_index_.get()));
|
||||
Context.get_drawing_context().set_property(_property(L"oox-geom", bOoxType_));
|
||||
|
||||
if (word_art_ == true)
|
||||
Context.get_drawing_context().set_property(_property(L"wordArt", true));
|
||||
@ -269,7 +270,13 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
Context.get_drawing_context().start_shape(sub_type_.get());
|
||||
}
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
std::wstring odf_path;
|
||||
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
|
||||
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
|
||||
|
||||
if (!odf_path.empty())
|
||||
{
|
||||
std::vector<::svg_path::_polyline> o_Polyline;
|
||||
|
||||
@ -277,7 +284,7 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
|
||||
try
|
||||
{
|
||||
res = ::svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
|
||||
res = ::svg_path::parseSvgD(o_Polyline, odf_path, true);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@ -321,15 +328,10 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
}
|
||||
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"draw-modifiers",draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
|
||||
if (draw_handle_geometry_.size()>0)
|
||||
if (bOoxType_)
|
||||
Context.get_drawing_context().set_property(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
else
|
||||
{
|
||||
if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"draw-modifiers-min",draw_handle_geometry_[0].min));
|
||||
Context.get_drawing_context().set_property(_property(L"draw-modifiers-max",draw_handle_geometry_[0].max));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -292,7 +292,7 @@ void math_mstyle::oox_convert(oox::math_context & Context)
|
||||
{
|
||||
CP_XML_NODE(L"m:ctrlPr")
|
||||
{
|
||||
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -317,7 +317,7 @@ void math_mstyle::oox_convert(oox::math_context & Context)
|
||||
{
|
||||
CP_XML_NODE(L"m:ctrlPr")
|
||||
{
|
||||
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ void math_mi::oox_convert(oox::math_context & Context)
|
||||
}
|
||||
}
|
||||
|
||||
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
|
||||
CP_XML_NODE(L"m:t")
|
||||
{
|
||||
@ -162,7 +162,7 @@ void math_mo::oox_convert(oox::math_context & Context)
|
||||
{
|
||||
// + доп стили текста ... todoooo
|
||||
|
||||
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
|
||||
CP_XML_NODE(L"m:t")
|
||||
{
|
||||
@ -203,7 +203,7 @@ void math_mn::oox_convert(oox::math_context & Context)
|
||||
{
|
||||
// + доп стили текста ... todoooo
|
||||
|
||||
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
|
||||
CP_XML_NODE(L"m:t")
|
||||
{
|
||||
|
||||
@ -360,11 +360,11 @@ void page_layout_instance::docx_convert_serialize(std::wostream & strm, oox::doc
|
||||
if (props)
|
||||
props->docx_convert_serialize(strm, Context);
|
||||
}
|
||||
void page_layout_instance::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
void page_layout_instance::pptx_serialize(std::wostream & strm, oox::pptx_conversion_context & Context)
|
||||
{
|
||||
style_page_layout_properties * props = properties();
|
||||
if (props)
|
||||
props->pptx_convert(Context);
|
||||
props->pptx_serialize(strm, Context);
|
||||
}
|
||||
|
||||
void page_layout_container::add_page_layout(const style_page_layout * StylePageLayout)
|
||||
|
||||
@ -195,7 +195,7 @@ public:
|
||||
|
||||
void docx_convert_serialize (std::wostream & strm, oox::docx_conversion_context & Context);
|
||||
void xlsx_serialize (std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
void pptx_convert (oox::pptx_conversion_context & Context);
|
||||
void pptx_serialize (std::wostream & strm, oox::pptx_conversion_context & Context);
|
||||
|
||||
const style_page_layout * style_page_layout_;
|
||||
|
||||
|
||||
@ -316,6 +316,7 @@ enum ElementType
|
||||
typeDrawPage,
|
||||
typePresentationFooterDecl,
|
||||
typePresentationDateTimeDecl,
|
||||
typePresentationNotes,
|
||||
|
||||
typeAnimPar,
|
||||
typeAnimSeq,
|
||||
|
||||
@ -225,7 +225,7 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
|
||||
{
|
||||
CP_XML_NODE(L"a:spcBef")
|
||||
{
|
||||
if (fo_margin_bottom_->get_type() == length_or_percent::Length)
|
||||
if (fo_margin_top_->get_type() == length_or_percent::Length)
|
||||
{
|
||||
std::wstring w_before = pptx_process_margin(fo_margin_top_, length::pt, 100.0);
|
||||
CP_XML_NODE(L"a:spcPts")
|
||||
@ -235,11 +235,10 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstringstream s;
|
||||
s << fo_margin_top_;
|
||||
double pct = fo_margin_top_->get_percent().get_value();
|
||||
CP_XML_NODE(L"a:spcPct")
|
||||
{
|
||||
CP_XML_ATTR(L"val", s.str());
|
||||
CP_XML_ATTR(L"val", (int)(pct * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -258,11 +257,11 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstringstream s;
|
||||
s << fo_margin_bottom_;
|
||||
double pct = fo_margin_bottom_->get_percent().get_value();
|
||||
|
||||
CP_XML_NODE(L"a:spcPct")
|
||||
{
|
||||
CP_XML_ATTR(L"val", s.str());
|
||||
CP_XML_ATTR(L"val", (int)(pct * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -468,11 +467,11 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstringstream s;
|
||||
s << fo_margin_top_;
|
||||
double pct = fo_margin_top_->get_percent().get_value();
|
||||
|
||||
CP_XML_NODE(L"a:spcPct")
|
||||
{
|
||||
CP_XML_ATTR(L"val", s.str());
|
||||
CP_XML_ATTR(L"val", (int)(pct * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -491,11 +490,11 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstringstream s;
|
||||
s << fo_margin_bottom_;
|
||||
double pct = fo_margin_bottom_->get_percent().get_value();
|
||||
|
||||
CP_XML_NODE(L"a:spcPct")
|
||||
{
|
||||
CP_XML_ATTR(L"val", s.str());
|
||||
CP_XML_ATTR(L"val", (int)(pct * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -80,7 +80,9 @@ public:
|
||||
void pptx_convert (oox::pptx_conversion_context & Context);
|
||||
void pptx_convert_as_list (oox::pptx_conversion_context & Context);
|
||||
|
||||
void oox_convert (std::wostream & stream, bool graphic, fonts_container & fonts);
|
||||
void oox_serialize (std::wostream & stream, bool graphic, fonts_container & fonts);
|
||||
void docx_serialize (std::wostream & stream, fonts_container & fonts);
|
||||
void drawing_serialize (std::wostream & stream, std::wstring node, fonts_container & fonts, const odf_reader::style_instance *current_style = NULL, std::wstring hlink = L"");
|
||||
|
||||
void apply_from (const text_format_properties_content & Other);
|
||||
void apply_to (std::vector<_property> & properties);
|
||||
|
||||
@ -1378,6 +1378,50 @@ void style_page_layout_properties::pptx_convert(oox::pptx_conversion_context & C
|
||||
attlist_.pptx_convert(Context);
|
||||
}
|
||||
|
||||
void style_page_layout_properties::pptx_serialize(std::wostream & strm, oox::pptx_conversion_context & Context)
|
||||
{
|
||||
if (attlist_.fo_page_width_ || attlist_.fo_page_height_ || attlist_.style_print_orientation_)
|
||||
{
|
||||
std::wstring w_w, w_h;
|
||||
|
||||
_INT64 h = 0, w = 0;
|
||||
|
||||
if (attlist_.fo_page_width_)
|
||||
{
|
||||
w = attlist_.fo_page_width_->get_value_unit(length::emu);
|
||||
if (w < 914400) w = 914400;
|
||||
|
||||
w_w = boost::lexical_cast<std::wstring>(w);
|
||||
}
|
||||
if (attlist_.fo_page_height_)
|
||||
{
|
||||
h = attlist_.fo_page_height_->get_value_unit(length::emu);
|
||||
if (h < 914400) h = 914400;
|
||||
|
||||
w_h = std::to_wstring(h);
|
||||
}
|
||||
|
||||
std::wstring w_orient = L"custom";
|
||||
|
||||
//if (w && h)
|
||||
//{
|
||||
// double ratio = (double)w/(double)h;
|
||||
// if (abs(ratio - 16./9.)<0.01) w_orient = L"screen16x9";
|
||||
// if (abs(ratio - 4./3.)<0.01) w_orient = L"screen4x3";
|
||||
//}
|
||||
|
||||
strm << L"<p:sldSz ";
|
||||
if (!w_h.empty())
|
||||
strm << L"cy=\"" << w_h << L"\" ";
|
||||
|
||||
if (!w_w.empty())
|
||||
strm << L"cx=\"" << w_w << L"\" ";
|
||||
|
||||
strm << L"type=\"" << w_orient << L"\" ";
|
||||
|
||||
strm << L"/>";
|
||||
}
|
||||
}
|
||||
|
||||
// style-page-layout-properties-elements
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -1519,10 +1563,11 @@ void style_master_page::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_FOREACH(office_element_ptr elm, content_)
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
|
||||
}
|
||||
////////////////
|
||||
|
||||
@ -1698,9 +1743,9 @@ void style_presentation_page_layout::add_child_element( xml::sax * Reader, const
|
||||
}
|
||||
void style_presentation_page_layout::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
BOOST_FOREACH(office_element_ptr elm, content_)
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -980,6 +980,7 @@ public:
|
||||
|
||||
bool docx_background_serialize(std::wostream & strm, oox::docx_conversion_context & Context, oox::_oox_fill & fill, int id);
|
||||
void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
void pptx_serialize(std::wostream & strm, oox::pptx_conversion_context & Context);
|
||||
|
||||
style_page_layout_properties() { }
|
||||
|
||||
|
||||
@ -455,6 +455,45 @@ namespace svg_path
|
||||
}
|
||||
}break;
|
||||
|
||||
case 'G':
|
||||
{
|
||||
nPos++;
|
||||
skipSpaces(nPos, rSvgDStatement, nLen);
|
||||
|
||||
while(nPos < nLen && isOnNumberChar(rSvgDStatement, nPos))
|
||||
{
|
||||
double nX, nY;
|
||||
double A1, A2;
|
||||
|
||||
if(!importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
||||
if(!importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
||||
if(!importDoubleAndSpaces(A1, nPos, rSvgDStatement, nLen)) return false;
|
||||
if(!importDoubleAndSpaces(A2, nPos, rSvgDStatement, nLen)) return false;
|
||||
|
||||
if(bRelative)
|
||||
{
|
||||
nX += nLastX;
|
||||
nY += nLastY;
|
||||
}
|
||||
|
||||
aCurrPoly.command = L"a:ArcTo";
|
||||
// append curved edge
|
||||
aCurrPoly.points.push_back(_point(nX, nY));
|
||||
aCurrPoly.points.push_back(_point(A1, A2));
|
||||
|
||||
Polyline.push_back(aCurrPoly);
|
||||
aCurrPoly.points.clear();
|
||||
|
||||
// set last position
|
||||
nLastX = nX;
|
||||
nLastY = nY;
|
||||
|
||||
//keep control point
|
||||
nLastControlX = nX;
|
||||
nLastControlY = nY;
|
||||
}
|
||||
}break;
|
||||
|
||||
// #100617# quadratic beziers are imported as cubic ones
|
||||
//case 'q' :
|
||||
//{
|
||||
|
||||
@ -57,13 +57,13 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"mso-spt200" , 7}, // shapetypeActionButtonMovie,
|
||||
{ L"mso-spt197" , 7}, // shapetypeActionButtonReturn,
|
||||
{ L"mso-spt199" , 7}, // shapetypeActionButtonSound,
|
||||
{ L"ooxml-arc" , 7}, // shapetypeArc,
|
||||
{ L"" , 7}, // shapetypeArc,
|
||||
{ L"mso-spt91" , 7}, // shapetypeBentArrow,
|
||||
{ L"mso-spt33" , 7}, // shapetypeBentConnector2,
|
||||
{ L"mso-spt34" , 7}, // shapetypeBentConnector3,
|
||||
{ L"mso-spt35" , 7}, // shapetypeBentConnector4,
|
||||
{ L"mso-spt36" , 7}, // shapetypeBentConnector5,
|
||||
{ L"mso-spt90" , 7}, // shapetypeBentUpArrow,
|
||||
{ L"" , 7}, // shapetypeBentUpArrow,
|
||||
{ L"quad-bevel" , 7}, // shapetypeBevel,
|
||||
{ L"" , 7}, // shapetypeBlockArc,
|
||||
{ L"mso-spt49" , 7}, // shapetypeBorderCallout1,
|
||||
@ -78,7 +78,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeChartPlus,
|
||||
{ L"" , 7}, // shapetypeChartStar,
|
||||
{ L"" , 7}, // shapetypeChartX,
|
||||
{ L"chevron" , 7}, // shapetypeChevron,
|
||||
{ L"" , 7}, // shapetypeChevron,
|
||||
{ L"" , 7}, // shapetypeChord,
|
||||
{ L"" , 7}, // shapetypeCircularArrow,
|
||||
{ L"cloud" , 7}, // shapetypeCloud,
|
||||
@ -92,16 +92,16 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"mso-spt40" , 7}, // shapetypeCurvedConnector5,
|
||||
{ L"" , 7}, // shapetypeCurvedDownArrow,
|
||||
{ L"" , 7}, // shapetypeCurvedLeftArrow,
|
||||
{ L"mso-spt102" , 7}, // shapetypeCurvedRightArrow,
|
||||
{ L"" , 7}, // shapetypeCurvedRightArrow,
|
||||
{ L"mso-spt104" , 7}, // shapetypeCurvedUpArrow,
|
||||
{ L"" , 7}, // shapetypeDecagon,
|
||||
{ L"" , 7}, // shapetypeDiagStripe,
|
||||
{ L"diamond" , 7}, // shapetypeDiamond,
|
||||
{ L"" , 7}, // shapetypeDiamond,
|
||||
{ L"" , 7}, // shapetypeDodecagon,
|
||||
{ L"" , 7}, // shapetypeDonut,
|
||||
{ L"" , 7}, // shapetypeDoubleWave,
|
||||
{ L"down-arrow" , 7}, // shapetypeDownArrow,
|
||||
{ L"down-arrow-callout" , 7}, // shapetypeDownArrowCallout,
|
||||
{ L"" , 7}, // shapetypeDownArrow,
|
||||
{ L"" , 7}, // shapetypeDownArrowCallout,
|
||||
{ L"ellipse" , 3}, // shapetypeEllipse,
|
||||
{ L"mso-spt107" , 7}, // shapetypeEllipseRibbon,
|
||||
{ L"mso-spt108" , 7}, // shapetypeEllipseRibbon2,
|
||||
@ -112,7 +112,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"flowchart-delay" , 7}, // shapetypeFlowChartDelay,
|
||||
{ L"flowchart-display" , 7}, // shapetypeFlowChartDisplay,
|
||||
{ L"flowchart-document" , 7}, // shapetypeFlowChartDocument,
|
||||
{ L"flowchart-extract" , 7}, // shapetypeFlowChartExtract,
|
||||
{ L"" , 7}, // shapetypeFlowChartExtract,
|
||||
{ L"flowchart-data" , 7}, // shapetypeFlowChartInputOutput,
|
||||
{ L"flowchart-internal-storage" , 7}, // shapetypeFlowChartInternalStorage,
|
||||
{ L"flowchart-magnetic-disk" , 7}, // shapetypeFlowChartMagneticDisk,
|
||||
@ -135,7 +135,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"flowchart-summing-junction" , 7}, // shapetypeFlowChartSummingJunction,
|
||||
{ L"flowchart-terminator" , 7}, // shapetypeFlowChartTerminator,
|
||||
{ L"paper" , 7}, // shapetypeFoldedCorner,
|
||||
{ L"frame" , 7}, // shapetypeFrame,
|
||||
{ L"" , 7}, // shapetypeFrame,
|
||||
{ L"" , 7}, // shapetypeFunnel,
|
||||
{ L"" , 7}, // shapetypeGear6,
|
||||
{ L"" , 7}, // shapetypeGear9,
|
||||
@ -143,21 +143,21 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"heart" , 7}, // shapetypeHeart,
|
||||
{ L"" , 7}, // shapetypeHeptagon,
|
||||
{ L"hexagon" , 7}, // shapetypeHexagon,
|
||||
{ L"pentagon-right" , 7}, // shapetypeHomePlate,
|
||||
{ L"" , 7}, // shapetypeHomePlate,
|
||||
{ L"horizontal-scroll" , 7}, // shapetypeHorizontalScroll,
|
||||
{ L"" , 7}, // shapetypeIrregularSeal1,
|
||||
{ L"" , 7}, // shapetypeIrregularSeal2,
|
||||
{ L"left-arrow" , 7}, // shapetypeLeftArrow,
|
||||
{ L"left-arrow-callout" , 7}, // shapetypeLeftArrowCallout,
|
||||
{ L"" , 7}, // shapetypeLeftArrow,
|
||||
{ L"" , 7}, // shapetypeLeftArrowCallout,
|
||||
{ L"left-brace" , 7}, // shapetypeLeftBrace,
|
||||
{ L"left-bracket" , 7}, // shapetypeLeftBracket,
|
||||
{ L"" , 7}, // shapetypeLeftCircularArrow,
|
||||
{ L"left-right-arrow" , 7}, // shapetypeLeftRightArrow,
|
||||
{ L"" , 7}, // shapetypeLeftRightArrow,
|
||||
{ L"left-right-arrow-callout" , 7}, // shapetypeLeftRightArrowCallout,
|
||||
{ L"" , 7}, // shapetypeLeftRightCircularArrow,
|
||||
{ L"" , 7}, // shapetypeLeftRightRibbon,
|
||||
{ L"mso-spt182" , 7}, // shapetypeLeftRightUpArrow,
|
||||
{ L"mso-spt89" , 7}, // shapetypeLeftUpArrow,
|
||||
{ L"" , 7}, // shapetypeLeftUpArrow,
|
||||
{ L"lightning" , 7}, // shapetypeLightningBolt,
|
||||
{ L"" , 5}, // shapetypeLine,
|
||||
{ L"" , 7}, // shapetypeLineInv,
|
||||
@ -166,33 +166,33 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeMathMinus,
|
||||
{ L"" , 7}, // shapetypeMathMultiply,
|
||||
{ L"" , 7}, // shapetypeMathNotEqual,
|
||||
{ L"cross" , 7}, // shapetypeMathPlus,
|
||||
{ L"" , 7}, // shapetypeMathPlus,
|
||||
{ L"moon" , 7}, // shapetypeMoon,
|
||||
{ L"" , 7}, // shapetypeNonIsoscelesTrapezoid,
|
||||
{ L"forbidden" , 7}, // shapetypeNoSmoking,
|
||||
{ L"notched-right-arrow" , 7}, // shapetypeNotchedRightArrow,
|
||||
{ L"" , 7}, // shapetypeNotchedRightArrow,
|
||||
{ L"octagon" , 7}, // shapetypeOctagon,
|
||||
{ L"parallelogram" , 7}, // shapetypeParallelogram,
|
||||
{ L"" , 7}, // shapetypeParallelogram,
|
||||
{ L"pentagon" , 7}, // shapetypePentagon,
|
||||
{ L"" , 7}, // shapetypePie,
|
||||
{ L"" , 7}, // shapetypePieWedge,
|
||||
{ L"" , 7}, // shapetypePlaque,
|
||||
{ L"" , 7}, // shapetypePlaqueTabs,
|
||||
{ L"cross" , 7}, // shapetypePlus,
|
||||
{ L"" , 7}, // shapetypePlus,
|
||||
{ L"quad-arrow" , 7}, // shapetypeQuadArrow,
|
||||
{ L"quad-arrow-callout" , 7}, // shapetypeQuadArrowCallout,
|
||||
{ L"rectangle" , 2}, // shapetypeRect,
|
||||
{ L"mso-spt53" , 7}, // shapetypeRibbon,
|
||||
{ L"mso-spt54" , 7}, // shapetypeRibbon2,
|
||||
{ L"right-arrow" , 7}, // shapetypeRightArrow,
|
||||
{ L"right-arrow-callout" , 7}, // shapetypeRightArrowCallout,
|
||||
{ L"" , 7}, // shapetypeRightArrow,
|
||||
{ L"" , 7}, // shapetypeRightArrowCallout,
|
||||
{ L"right-brace" , 7}, // shapetypeRightBrace,
|
||||
{ L"right-bracket" , 7}, // shapetypeRightBracket,
|
||||
{ L"" , 7}, // shapetypeRound1Rect,
|
||||
{ L"" , 7}, // shapetypeRound2DiagRect,
|
||||
{ L"" , 7}, // shapetypeRound2SameRect,
|
||||
{ L"round-rectangle" , 7}, // shapetypeRoundRect,
|
||||
{ L"right-triangle" , 7}, // shapetypeRtTriangle,
|
||||
{ L"" , 7}, // shapetypeRoundRect,
|
||||
{ L"" , 7}, // shapetypeRtTriangle,
|
||||
{ L"smiley" , 7}, // shapetypeSmileyFace,
|
||||
{ L"" , 7}, // shapetypeSnip1Rect,
|
||||
{ L"" , 7}, // shapetypeSnip2DiagRect,
|
||||
@ -214,11 +214,11 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeSun,
|
||||
{ L"" , 7}, // shapetypeSwooshArrow,
|
||||
{ L"" , 7}, // shapetypeTeardrop,
|
||||
{ L"trapezoid" , 7}, // shapetypeTrapezoid,
|
||||
{ L"isosceles-triangle" , 7}, // shapetypeTriangle,
|
||||
{ L"up-arrow" , 7}, // shapetypeUpArrow,
|
||||
{ L"up-arrow-callout" , 7}, // shapetypeUpArrowCallout,
|
||||
{ L"up-down-arrow" , 7}, // shapetypeUpDownArrow,
|
||||
{ L"" , 7}, // shapetypeTrapezoid,
|
||||
{ L"" , 7}, // shapetypeTriangle,
|
||||
{ L"" , 7}, // shapetypeUpArrow,
|
||||
{ L"" , 7}, // shapetypeUpArrowCallout,
|
||||
{ L"" , 7}, // shapetypeUpDownArrow,
|
||||
{ L"up-down-arrow-callout" , 7}, // shapetypeUpDownArrowCallout,
|
||||
{ L"mso-spt101" , 7}, // shapetypeUturnArrow,
|
||||
{ L"vertical-scroll" , 7}, // shapetypeVerticalScroll,
|
||||
|
||||
@ -30,6 +30,12 @@
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
// shapetypeAccentBorderCallout1,
|
||||
// shapetypeAccentBorderCallout2,
|
||||
// shapetypeAccentBorderCallout3,
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
|
||||
}
|
||||
@ -29,3 +29,9 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
|
||||
}
|
||||
@ -30,12 +30,331 @@
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
// +shapetypeLeftCircularArrow,
|
||||
// shapetypeLeftRightCircularArrow,
|
||||
// +shapetypeSwooshArrow,
|
||||
// +shapetypeCircularArrow
|
||||
|
||||
//+ shapetypeLeftArrow,
|
||||
//+ shapetypeRightArrow,
|
||||
//+ shapetypeDownArrow,
|
||||
//+ shapetypeUpArrow,
|
||||
//+ shapetypeLeftRightArrow
|
||||
//+ shapetypeUpDownArrow
|
||||
//+ shapetypeLeftCircularArrow,
|
||||
// shapetypeLeftRightCircularArrow,
|
||||
//+ shapetypeSwooshArrow,
|
||||
//+ shapetypeCircularArrow
|
||||
//+ shapetypeNotchedRightArrow
|
||||
|
||||
//...
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_LeftArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_LeftArrow()
|
||||
{
|
||||
odf_type_name = L"ooxml-leftArrow";
|
||||
|
||||
enhanced_path = L"M 0 ?f7 L ?f5 0 ?f5 ?f8 ?f13 ?f8 ?f13 ?f9 ?f5 ?f9 ?f5 ?f14 Z N";
|
||||
text_areas = L"?f12 ?f8 ?f13 ?f9";
|
||||
modifiers = L"50000 50000";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"100000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f3", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"0+?f4 -0");
|
||||
add(L"f6", L"logheight*?f2 /200000");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f7 +?f6 -0");
|
||||
add(L"f10", L"logheight/2");
|
||||
add(L"f11", L"?f8 *?f4 /?f10 ");
|
||||
add(L"f12", L"?f5 +0-?f11 ");
|
||||
add(L"f13", L"logwidth");
|
||||
add(L"f14", L"logheight");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f13 ?f8";
|
||||
h1.y_minimum = L"0";
|
||||
h1.y_maximum = L"100000";
|
||||
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f5 0";
|
||||
h2.x_minimum = L"0";
|
||||
h2.x_maximum = L"?f1";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
class oox_shape_RightArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_RightArrow()
|
||||
{
|
||||
odf_type_name = L"ooxml-rightArrow";
|
||||
|
||||
enhanced_path = L"M 0 ?f8 L ?f5 ?f8 ?f5 0 ?f14 ?f7 ?f5 ?f13 ?f5 ?f9 0 ?f9 Z N";
|
||||
text_areas = L"?f12 ?f8 ?f13 ?f9";
|
||||
modifiers = L"50000 50000";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"100000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f3", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"logwidth+0-?f4 ");
|
||||
add(L"f6", L"logheight*?f2 /200000");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f7 +?f6 -0");
|
||||
add(L"f10", L"logheight/2");
|
||||
add(L"f11", L"?f8 *?f4 /?f10 ");
|
||||
add(L"f12", L"?f5 +?f11 -0");
|
||||
add(L"f13", L"logheight");
|
||||
add(L"f14", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"0 ?f8";
|
||||
h1.y_minimum = L"0";
|
||||
h1.y_maximum = L"100000";
|
||||
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f5 0";
|
||||
h2.x_minimum = L"0";
|
||||
h2.x_maximum = L"?f1";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
class oox_shape_DownArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_DownArrow()
|
||||
{
|
||||
odf_type_name = L"ooxml-downArrow";
|
||||
|
||||
enhanced_path = L"M 0 ?f5 L ?f8 ?f5 ?f8 0 ?f9 0 ?f9 ?f5 ?f14 ?f5 ?f7 ?f13 Z N";
|
||||
text_areas = L"?f8 0 ?f9 ?f12";
|
||||
modifiers = L"50000 50000";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"100000*logheight/?f0 ");
|
||||
add(L"f2", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f3", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"logheight+0-?f4 ");
|
||||
add(L"f6", L"logwidth*?f2 /200000");
|
||||
add(L"f7", L"logwidth/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f7 +?f6 -0");
|
||||
add(L"f10", L"logwidth/2");
|
||||
add(L"f11", L"?f8 *?f4 /?f10 ");
|
||||
add(L"f12", L"?f5 +?f11 -0");
|
||||
add(L"f13", L"logheight");
|
||||
add(L"f14", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f8 0";
|
||||
h1.y_minimum = L"0";
|
||||
h1.y_maximum = L"100000";
|
||||
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"0 ?f5";
|
||||
h2.x_minimum = L"0";
|
||||
h2.x_maximum = L"?f1";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
class oox_shape_UpArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_UpArrow()
|
||||
{
|
||||
odf_type_name = L"ooxml-upArrow";
|
||||
|
||||
enhanced_path = L"M 0 ?f5 L ?f7 0 ?f14 ?f5 ?f9 ?f5 ?f9 ?f13 ?f8 ?f13 ?f8 ?f5 Z N";
|
||||
text_areas = L"?f8 ?f12 ?f9 ?f13";
|
||||
modifiers = L"50000 50000";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"100000*logheight/?f0 ");
|
||||
add(L"f2", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f3", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"0+?f4 -0");
|
||||
add(L"f6", L"logwidth*?f2 /200000");
|
||||
add(L"f7", L"logwidth/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f7 +?f6 -0");
|
||||
add(L"f10", L"logwidth/2");
|
||||
add(L"f11", L"?f8 *?f4 /?f10 ");
|
||||
add(L"f12", L"?f5 +0-?f11 ");
|
||||
add(L"f13", L"logheight");
|
||||
add(L"f14", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f8 ?f13";
|
||||
h1.y_minimum = L"0";
|
||||
h1.y_maximum = L"100000";
|
||||
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"0 ?f5";
|
||||
h2.x_minimum = L"0";
|
||||
h2.x_maximum = L"?f1";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
class oox_shape_LeftRightArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_LeftRightArrow()
|
||||
{
|
||||
odf_type_name = L"ooxml-leftRightArrow";
|
||||
|
||||
enhanced_path = L"M 0 ?f7 L ?f4 0 ?f4 ?f8 ?f5 ?f8 ?f5 0 ?f14 ?f7 ?f5 ?f15 ?f5 ?f9 ?f4 ?f9 ?f4 ?f15 Z N";
|
||||
text_areas = L"?f12 ?f8 ?f13 ?f9";
|
||||
modifiers = L"50000 50000";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f3", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"logwidth+0-?f4 ");
|
||||
add(L"f6", L"logheight*?f2 /200000");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f7 +?f6 -0");
|
||||
add(L"f10", L"logheight/2");
|
||||
add(L"f11", L"?f8 *?f4 /?f10 ");
|
||||
add(L"f12", L"?f4 +0-?f11 ");
|
||||
add(L"f13", L"?f5 +?f11 -0");
|
||||
add(L"f14", L"logwidth");
|
||||
add(L"f15", L"logheight");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f5 ?f8";
|
||||
h1.y_minimum = L"0";
|
||||
h1.y_maximum = L"100000";
|
||||
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f4 0";
|
||||
h2.x_minimum = L"0";
|
||||
h2.x_maximum = L"?f1";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
class oox_shape_LeftUpArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_LeftUpArrow()
|
||||
{
|
||||
odf_type_name = L"ooxml-leftUpArrow";
|
||||
|
||||
enhanced_path = L"M 0 ?f12 L ?f6 ?f9 ?f6 ?f16 ?f14 ?f16 ?f14 ?f6 ?f8 ?f6 ?f11 0 ?f22 ?f6 ?f15 ?f6 ?f15 ?f17 ?f6 ?f17 ?f6 ?f21 Z N";
|
||||
text_areas = L"?f18 ?f16 ?f11 ?f17";
|
||||
modifiers = L"25000 25000 25000";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"if(0-$1 ,0,if(50000-$1 ,$1 ,50000))");
|
||||
add(L"f1", L"?f0 *2/1");
|
||||
add(L"f2", L"if(0-$0 ,0,if(?f1 -$0 ,$0 ,?f1 ))");
|
||||
add(L"f3", L"100000+0-?f1 ");
|
||||
add(L"f4", L"if(0-$2 ,0,if(?f3 -$2 ,$2 ,?f3 ))");
|
||||
add(L"f5", L"min(logwidth,logheight)");
|
||||
add(L"f6", L"?f5 *?f4 /100000");
|
||||
add(L"f7", L"?f5 *?f0 /50000");
|
||||
add(L"f8", L"logwidth+0-?f7 ");
|
||||
add(L"f9", L"logheight+0-?f7 ");
|
||||
add(L"f10", L"?f5 *?f0 /100000");
|
||||
add(L"f11", L"logwidth+0-?f10 ");
|
||||
add(L"f12", L"logheight+0-?f10 ");
|
||||
add(L"f13", L"?f5 *?f2 /200000");
|
||||
add(L"f14", L"?f11 +0-?f13 ");
|
||||
add(L"f15", L"?f11 +?f13 -0");
|
||||
add(L"f16", L"?f12 +0-?f13 ");
|
||||
add(L"f17", L"?f12 +?f13 -0");
|
||||
add(L"f18", L"?f13 *?f6 /?f10 ");
|
||||
add(L"f19", L"(?f6 +?f15 )/2");
|
||||
add(L"f20", L"(?f6 +?f17 )/2");
|
||||
add(L"f21", L"logheight");
|
||||
add(L"f22", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f14 ?f16";
|
||||
h1.y_minimum = L"0";
|
||||
h1.y_maximum = L"?f1";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f8 0";
|
||||
h2.x_minimum = L"0";
|
||||
h2.x_maximum = L"50000";
|
||||
handles.push_back(h2);
|
||||
|
||||
h1.position = L"?f14 ?f6";
|
||||
h1.y_minimum = L"0";
|
||||
h1.y_maximum = L"?f3";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
class oox_shape_UpDownArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_UpDownArrow()
|
||||
{
|
||||
odf_type_name = L"ooxml-upDownArrow";
|
||||
|
||||
enhanced_path = L"M 0 ?f4 L ?f7 0 ?f16 ?f4 ?f9 ?f4 ?f9 ?f5 ?f16 ?f5 ?f7 ?f15 0 ?f5 ?f8 ?f5 ?f8 ?f4 Z N";
|
||||
text_areas = L"?f8 ?f12 ?f9 ?f13";
|
||||
modifiers = L"50000 50000";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logheight/?f0 ");
|
||||
add(L"f2", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f3", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"logheight+0-?f4 ");
|
||||
add(L"f6", L"logwidth*?f2 /200000");
|
||||
add(L"f7", L"logwidth/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f7 +?f6 -0");
|
||||
add(L"f10", L"logwidth/2");
|
||||
add(L"f11", L"?f8 *?f4 /?f10 ");
|
||||
add(L"f12", L"?f4 +0-?f11 ");
|
||||
add(L"f13", L"?f5 +?f11 -0");
|
||||
add(L"f14", L"logheight/2");
|
||||
add(L"f15", L"logheight");
|
||||
add(L"f16", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h2.position = L"?f8 ?f5";
|
||||
h2.x_minimum = L"0";
|
||||
h2.x_maximum = L"100000";
|
||||
handles.push_back(h2);
|
||||
|
||||
h1.position = L"0 ?f4";
|
||||
h1.y_minimum = L"0";
|
||||
h1.y_maximum = L"?f1";
|
||||
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
class oox_shape_LeftCircularArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
@ -574,4 +893,46 @@ public:
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
class oox_shape_NotchedRightArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_NotchedRightArrow()
|
||||
{
|
||||
odf_type_name = L"ooxml-notchedRightArrow";
|
||||
|
||||
enhanced_path = L"M 0 ?f8 L ?f5 ?f8 ?f5 0 ?f13 ?f7 ?f5 ?f14 ?f5 ?f9 0 ?f9 ?f11 ?f7 Z N";
|
||||
text_areas = L"?f11 ?f8 ?f12 ?f9";
|
||||
modifiers = L"50000 50000";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"100000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f3", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"logwidth+0-?f4 ");
|
||||
add(L"f6", L"logheight*?f2 /200000");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f7 +?f6 -0");
|
||||
add(L"f10", L"logheight/2");
|
||||
add(L"f11", L"?f6 *?f4 /?f10 ");
|
||||
add(L"f12", L"logwidth+0-?f11 ");
|
||||
add(L"f13", L"logwidth");
|
||||
add(L"f14", L"logheight");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f13 ?f8";
|
||||
h1.y_minimum = L"0";
|
||||
h1.y_maximum = L"100000";
|
||||
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f5 0";
|
||||
h2.x_minimum = L"0";
|
||||
h2.x_maximum = L"?f1";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -29,3 +29,67 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
//+ shapetypeBentUpArrow
|
||||
// shapetypeBentArrow,
|
||||
// shapetypeBentConnector2,
|
||||
// shapetypeBentConnector3,
|
||||
// shapetypeBentConnector4,
|
||||
// shapetypeBentConnector5,
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_BentUpArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_BentUpArrow()
|
||||
{
|
||||
odf_type_name =L"ooxml-bentUpArrow";
|
||||
|
||||
enhanced_path = L"M 0 ?f13 L ?f10 ?f13 ?f10 ?f4 ?f6 ?f4 ?f8 0 ?f18 ?f4 ?f11 ?f4 ?f11 ?f17 0 ?f17 Z N";
|
||||
text_areas = L"0 ?f13 ?f11 ?f17";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 25000 25000";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
|
||||
add(L"f1", L"if(0-$1 ,0,if(50000-$1 ,$1 ,50000))");
|
||||
add(L"f2", L"if(0-$2 ,0,if(50000-$2 ,$2 ,50000))");
|
||||
add(L"f3", L"min(logwidth,logheight)");
|
||||
add(L"f4", L"?f3 *?f2 /100000");
|
||||
add(L"f5", L"?f3 *?f1 /50000");
|
||||
add(L"f6", L"logwidth+0-?f5 ");
|
||||
add(L"f7", L"?f3 *?f1 /100000");
|
||||
add(L"f8", L"logwidth+0-?f7 ");
|
||||
add(L"f9", L"?f3 *?f0 /200000");
|
||||
add(L"f10", L"?f8 +0-?f9 ");
|
||||
add(L"f11", L"?f8 +?f9 -0");
|
||||
add(L"f12", L"?f3 *?f0 /100000");
|
||||
add(L"f13", L"logheight+0-?f12 ");
|
||||
add(L"f14", L"?f11 *1/2");
|
||||
add(L"f15", L"(?f13 +logheight)/2");
|
||||
add(L"f16", L"(?f4 +logheight)/2");
|
||||
add(L"f17", L"logheight");
|
||||
add(L"f18", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"0 ?f13";
|
||||
h1.y_maximum= L"50000";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f6 0";
|
||||
h2.x_maximum= L"50000";
|
||||
h2.x_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h1.position = L"?f10 ?f4";
|
||||
h1.y_maximum= L"50000";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
@ -29,3 +29,253 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
//+ shapetypeLeftArrowCallout
|
||||
//+ shapetypeRightArrowCallout
|
||||
//+ shapetypeUpArrowCallout
|
||||
//+ shapetypeDownArrowCallout
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_LeftArrowCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_LeftArrowCallout()
|
||||
{
|
||||
odf_type_name =L"ooxml-leftArrowCallout";
|
||||
|
||||
enhanced_path = L"M 0 ?f12 L ?f17 ?f13 ?f17 ?f14 ?f19 ?f14 ?f19 0 ?f22 0 ?f22 ?f21 ?f19 ?f21 ?f19 ?f15 ?f17 ?f15 ?f17 ?f16 Z N";
|
||||
text_areas = L"?f19 0 ?f22 ?f21";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 25000 25000 64977";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logheight/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"?f2 *2/1");
|
||||
add(L"f4", L"if(0-$0 ,0,if(?f3 -$0 ,$0 ,?f3 ))");
|
||||
add(L"f5", L"100000*logwidth/?f0 ");
|
||||
add(L"f6", L"if(0-$2 ,0,if(?f5 -$2 ,$2 ,?f5 ))");
|
||||
add(L"f7", L"?f6 *?f0 /logwidth");
|
||||
add(L"f8", L"100000+0-?f7 ");
|
||||
add(L"f9", L"if(0-$3 ,0,if(?f8 -$3 ,$3 ,?f8 ))");
|
||||
add(L"f10", L"?f0 *?f2 /100000");
|
||||
add(L"f11", L"?f0 *?f4 /200000");
|
||||
add(L"f12", L"logheight/2");
|
||||
add(L"f13", L"?f12 +0-?f10 ");
|
||||
add(L"f14", L"?f12 +0-?f11 ");
|
||||
add(L"f15", L"?f12 +?f11 -0");
|
||||
add(L"f16", L"?f12 +?f10 -0");
|
||||
add(L"f17", L"?f0 *?f6 /100000");
|
||||
add(L"f18", L"logwidth*?f9 /100000");
|
||||
add(L"f19", L"logwidth+0-?f18 ");
|
||||
add(L"f20", L"(?f19 +logwidth)/2");
|
||||
add(L"f21", L"logheight");
|
||||
add(L"f22", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h2.position = L"?f17 ?f14";
|
||||
h2.y_maximum= L"?f3";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h2.position = L"0 ?f13";
|
||||
h2.y_maximum= L"?f1";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h1.position = L"?f17 0";
|
||||
h1.x_maximum= L"?f5";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f19 ?f21";
|
||||
h1.x_maximum= L"?f8";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_RightArrowCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_RightArrowCallout()
|
||||
{
|
||||
odf_type_name = L"ooxml-rightArrowCallout";
|
||||
|
||||
enhanced_path = L"M 0 0 L ?f19 0 ?f19 ?f14 ?f18 ?f14 ?f18 ?f13 ?f21 ?f12 ?f18 ?f16 ?f18 ?f15 ?f19 ?f15 ?f19 ?f22 0 ?f22 Z N";
|
||||
text_areas = L"0 0 ?f19 ?f22";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 25000 25000 64977";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logheight/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"?f2 *2/1");
|
||||
add(L"f4", L"if(0-$0 ,0,if(?f3 -$0 ,$0 ,?f3 ))");
|
||||
add(L"f5", L"100000*logwidth/?f0 ");
|
||||
add(L"f6", L"if(0-$2 ,0,if(?f5 -$2 ,$2 ,?f5 ))");
|
||||
add(L"f7", L"?f6 *?f0 /logwidth");
|
||||
add(L"f8", L"100000+0-?f7 ");
|
||||
add(L"f9", L"if(0-$3 ,0,if(?f8 -$3 ,$3 ,?f8 ))");
|
||||
add(L"f10", L"?f0 *?f2 /100000");
|
||||
add(L"f11", L"?f0 *?f4 /200000");
|
||||
add(L"f12", L"logheight/2");
|
||||
add(L"f13", L"?f12 +0-?f10 ");
|
||||
add(L"f14", L"?f12 +0-?f11 ");
|
||||
add(L"f15", L"?f12 +?f11 -0");
|
||||
add(L"f16", L"?f12 +?f10 -0");
|
||||
add(L"f17", L"?f0 *?f6 /100000");
|
||||
add(L"f18", L"logwidth+0-?f17 ");
|
||||
add(L"f19", L"logwidth*?f9 /100000");
|
||||
add(L"f20", L"?f19 *1/2");
|
||||
add(L"f21", L"logwidth");
|
||||
add(L"f22", L"logheight");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h2.position = L"?f18 ?f14";
|
||||
h2.y_maximum= L"?f3";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h2.position = L"?f21 ?f13";
|
||||
h2.y_maximum= L"?f1";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h1.position = L"?f18 0";
|
||||
h1.x_maximum= L"?f5";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f19 ?f22";
|
||||
h1.x_maximum= L"?f8";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_UpArrowCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_UpArrowCallout()
|
||||
{
|
||||
odf_type_name =L"ooxml-upArrowCallout";
|
||||
|
||||
enhanced_path = L"M 0 ?f19 L ?f14 ?f19 ?f14 ?f17 ?f13 ?f17 ?f12 0 ?f16 ?f17 ?f15 ?f17 ?f15 ?f19 ?f21 ?f19 ?f21 ?f22 0 ?f22 Z N";
|
||||
text_areas = L"0 ?f19 ?f21 ?f22";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 25000 25000 64977";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"?f2 *2/1");
|
||||
add(L"f4", L"if(0-$0 ,0,if(?f3 -$0 ,$0 ,?f3 ))");
|
||||
add(L"f5", L"100000*logheight/?f0 ");
|
||||
add(L"f6", L"if(0-$2 ,0,if(?f5 -$2 ,$2 ,?f5 ))");
|
||||
add(L"f7", L"?f6 *?f0 /logheight");
|
||||
add(L"f8", L"100000+0-?f7 ");
|
||||
add(L"f9", L"if(0-$3 ,0,if(?f8 -$3 ,$3 ,?f8 ))");
|
||||
add(L"f10", L"?f0 *?f2 /100000");
|
||||
add(L"f11", L"?f0 *?f4 /200000");
|
||||
add(L"f12", L"logwidth/2");
|
||||
add(L"f13", L"?f12 +0-?f10 ");
|
||||
add(L"f14", L"?f12 +0-?f11 ");
|
||||
add(L"f15", L"?f12 +?f11 -0");
|
||||
add(L"f16", L"?f12 +?f10 -0");
|
||||
add(L"f17", L"?f0 *?f6 /100000");
|
||||
add(L"f18", L"logheight*?f9 /100000");
|
||||
add(L"f19", L"logheight+0-?f18 ");
|
||||
add(L"f20", L"(?f19 +logheight)/2");
|
||||
add(L"f21", L"logwidth");
|
||||
add(L"f22", L"logheight");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f14 ?f17";
|
||||
h1.x_maximum= L"?f3";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f13 0";
|
||||
h1.x_maximum= L"?f1";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f21 ?f17";
|
||||
h2.y_maximum= L"?f5";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h2.position = L"0 ?f19";
|
||||
h2.y_maximum= L"?f8";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_DownArrowCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_DownArrowCallout()
|
||||
{
|
||||
odf_type_name =L"ooxml-downArrowCallout";
|
||||
|
||||
enhanced_path = L"M 0 0 L ?f22 0 ?f22 ?f19 ?f15 ?f19 ?f15 ?f18 ?f16 ?f18 ?f12 ?f21 ?f13 ?f18 ?f14 ?f18 ?f14 ?f19 0 ?f19 Z N";
|
||||
text_areas = L"0 0 ?f22 ?f19";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 25000 25000 64977";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"?f2 *2/1");
|
||||
add(L"f4", L"if(0-$0 ,0,if(?f3 -$0 ,$0 ,?f3 ))");
|
||||
add(L"f5", L"100000*logheight/?f0 ");
|
||||
add(L"f6", L"if(0-$2 ,0,if(?f5 -$2 ,$2 ,?f5 ))");
|
||||
add(L"f7", L"?f6 *?f0 /logheight");
|
||||
add(L"f8", L"100000+0-?f7 ");
|
||||
add(L"f9", L"if(0-$3 ,0,if(?f8 -$3 ,$3 ,?f8 ))");
|
||||
add(L"f10", L"?f0 *?f2 /100000");
|
||||
add(L"f11", L"?f0 *?f4 /200000");
|
||||
add(L"f12", L"logwidth/2");
|
||||
add(L"f13", L"?f12 +0-?f10 ");
|
||||
add(L"f14", L"?f12 +0-?f11 ");
|
||||
add(L"f15", L"?f12 +?f11 -0");
|
||||
add(L"f16", L"?f12 +?f10 -0");
|
||||
add(L"f17", L"?f0 *?f6 /100000");
|
||||
add(L"f18", L"logheight+0-?f17 ");
|
||||
add(L"f19", L"logheight*?f9 /100000");
|
||||
add(L"f20", L"?f19 *1/2");
|
||||
add(L"f21", L"logheight");
|
||||
add(L"f22", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f14 ?f18";
|
||||
h1.x_maximum= L"?f3";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f13 ?f21";
|
||||
h1.x_maximum= L"?f1";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f22 ?f18";
|
||||
h2.y_maximum= L"?f5";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h2.position = L"0 ?f19";
|
||||
h2.y_maximum= L"?f8";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@ -29,6 +29,32 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
// shapetypeChartPlus,
|
||||
// shapetypeChartStar,
|
||||
// shapetypeChartX,
|
||||
// shapetypeChartX
|
||||
//+ shapetypeFlowChartExtract
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_FlowChartExtract : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_FlowChartExtract()
|
||||
{
|
||||
odf_type_name =L"ooxml-flowChartExtract";
|
||||
|
||||
enhanced_path = L"M 0 2 L 1 0 2 2 Z N";
|
||||
text_areas = L"?f2 ?f3 ?f0 ?f4";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"logwidth*3/4");
|
||||
add(L"f1", L"logwidth/2");
|
||||
add(L"f2", L"logwidth/4");
|
||||
add(L"f3", L"logheight/2");
|
||||
add(L"f4", L"logheight");
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@ -29,3 +29,9 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
|
||||
}
|
||||
@ -35,202 +35,386 @@
|
||||
// shapetypeCurvedConnector5,
|
||||
//+ shapetypeCurvedDownArrow,
|
||||
//+ shapetypeCurvedLeftArrow,
|
||||
// shapetypeCurvedRightArrow,
|
||||
// shapetypeCurvedUpArrow,
|
||||
//+ shapetypeCurvedRightArrow,
|
||||
//+ shapetypeCurvedUpArrow,
|
||||
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_curvedLeftArrow : public oox_shape
|
||||
class oox_shape_CurvedLeftArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_curvedLeftArrow()
|
||||
oox_shape_CurvedLeftArrow()
|
||||
{
|
||||
odf_type_name =L"ooxml-curvedLeftArrow";
|
||||
|
||||
//modifiers = L"23520";
|
||||
enhanced_path = L"M ?f2 ?f8 A ?f65 ?f66 ?f67 ?f68 ?f2 ?f8 ?f62 ?f64 W ?f69 ?f70 ?f71 ?f72 ?f2 ?f8 ?f62 ?f64 Z N";
|
||||
text_areas = L"?f22 ?f24 ?f23 ?f25";
|
||||
glue_points = L"?f22 ?f24 ?f22 ?f25 ?f23 ?f25 ?f23 ?f24";
|
||||
view_box = L"0 0 21600 21600";
|
||||
enhanced_path = L"M 0 ?f31 L ?f32 ?f28 ?f32 ?f24 G ?f44 ?f8 ?f45 ?f46 ?f44 ?f8 ?f47 ?f48 L ?f32 ?f29 Z S N M ?f42 ?f18 G ?f44 ?f8 ?f49 ?f50 L 0 0 G ?f44 ?f8 ?f51 ?f52 Z I S N M ?f42 ?f18 G ?f44 ?f8 ?f53 ?f54 L 0 0 G ?f44 ?f8 ?f55 ?f56 L ?f42 ?f18 G ?f44 ?f8 ?f57 ?f58 L ?f32 ?f29 0 ?f31 ?f32 ?f28 ?f32 ?f24 G ?f44 ?f8 ?f59 ?f60 F N";
|
||||
text_areas = L"0 0 ?f42 ?f43";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 50000 25000";
|
||||
|
||||
add(L"f0", L"10800000");
|
||||
add(L"f0", L"10800000");
|
||||
add(L"f1", L"5400000");
|
||||
add(L"f2", L"left");
|
||||
add(L"f3", L"right");
|
||||
add(L"f4", L"top");
|
||||
add(L"f5", L"bottom");
|
||||
add(L"f6", L"?f5 - ?f4");
|
||||
add(L"f7", L"?f6 / 2");
|
||||
add(L"f8", L"?f4 + ?f7");
|
||||
add(L"f9", L"?f3 - ?f2");
|
||||
add(L"f10", L"?f9 / 2");
|
||||
add(L"f11", L"?f2 + ?f10");
|
||||
add(L"f12", L"5419351 / 1725033");
|
||||
add(L"f13", L"2700000 + ?f1");
|
||||
add(L"f14", L"?f13 * ?f12 / ?f0");
|
||||
add(L"f15", L"0 - ?f14");
|
||||
add(L"f16", L"sin(?f15)");
|
||||
add(L"f17", L"0 - ?f16");
|
||||
add(L"f18", L"?f17 * ?f10");
|
||||
add(L"f19", L"cos(?f15)");
|
||||
add(L"f20", L"0 - ?f19");
|
||||
add(L"f21", L"?f20 * ?f7");
|
||||
add(L"f22", L"?f11 - ?f18");
|
||||
add(L"f23", L"?f11 + ?f18");
|
||||
add(L"f24", L"?f8 - ?f21");
|
||||
add(L"f25", L"?f8 + ?f21");
|
||||
add(L"f26", L"21550000 - 21600000");
|
||||
add(L"f27", L"if(?f26, 21600000, 21550000)");
|
||||
add(L"f28", L"-21550000 - ?f27");
|
||||
add(L"f29", L"if(?f28, -21550000, ?f27)");
|
||||
add(L"f30", L"?f0 + ?f29");
|
||||
add(L"f31", L"?f0 + ?f1");
|
||||
add(L"f32", L"?f31 * ?f12 / ?f0");
|
||||
add(L"f33", L"0 - ?f32");
|
||||
add(L"f34", L"cos(?f33)");
|
||||
add(L"f35", L"0 - ?f34");
|
||||
add(L"f36", L"?f35 * ?f10");
|
||||
add(L"f37", L"sin(?f33)");
|
||||
add(L"f38", L"0 - ?f37");
|
||||
add(L"f39", L"?f38 * ?f7");
|
||||
add(L"f40", L"sqrt(?f36 * ?f36 + ?f39 * ?f39 + 0 * 0)");
|
||||
add(L"f41", L"?f10 * ?f7 / ?f40");
|
||||
add(L"f42", L"?f38 * ?f41");
|
||||
add(L"f43", L"?f2 - ?f42");
|
||||
add(L"f44", L"?f35 * ?f41");
|
||||
add(L"f45", L"?f8 - ?f44");
|
||||
add(L"f46", L"?f43 - ?f10");
|
||||
add(L"f47", L"?f45 - ?f7");
|
||||
add(L"f48", L"?f43 + ?f10");
|
||||
add(L"f49", L"?f45 + ?f7");
|
||||
add(L"f50", L"?f30 + ?f1");
|
||||
add(L"f51", L"?f50 * ?f12 / ?f0");
|
||||
add(L"f52", L"0 - ?f51");
|
||||
add(L"f53", L"cos(?f52)");
|
||||
add(L"f54", L"0 - ?f53");
|
||||
add(L"f55", L"?f54 * ?f10");
|
||||
add(L"f56", L"sin(?f52)");
|
||||
add(L"f57", L"0 - ?f56");
|
||||
add(L"f58", L"?f57 * ?f7");
|
||||
add(L"f59", L"sqrt(?f55 * ?f55 + ?f58 * ?f58 + 0 * 0)");
|
||||
add(L"f60", L"?f10 * ?f7 / ?f59");
|
||||
add(L"f61", L"?f57 * ?f60");
|
||||
add(L"f62", L"?f43 + ?f61");
|
||||
add(L"f63", L"?f54 * ?f60");
|
||||
add(L"f64", L"?f45 + ?f63");
|
||||
add(L"f65", L"if(?f29, ?f2, ?f46)");
|
||||
add(L"f66", L"if(?f29, ?f8, ?f47)");
|
||||
add(L"f67", L"if(?f29, ?f2, ?f48)");
|
||||
add(L"f68", L"if(?f29, ?f8, ?f49)");
|
||||
add(L"f69", L"if(?f29, ?f46, ?f62)");
|
||||
add(L"f70", L"if(?f29, ?f47, ?f64)");
|
||||
add(L"f71", L"if(?f29, ?f48, ?f62)");
|
||||
add(L"f72", L"if(?f29, ?f49, ?f64)");
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logheight/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"if(0-$0 ,0,if(?f2 -$0 ,$0 ,?f2 ))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"?f0 *?f2 /100000");
|
||||
add(L"f6", L"(?f4 +?f5 )/4");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f8 *2/1");
|
||||
add(L"f10", L"?f9 *?f9 /1");
|
||||
add(L"f11", L"?f4 *?f4 /1");
|
||||
add(L"f12", L"?f10 +0-?f11 ");
|
||||
add(L"f13", L"sqrt(?f12 )");
|
||||
add(L"f14", L"?f13 *logwidth/?f9 ");
|
||||
add(L"f15", L"100000*?f14 /?f0 ");
|
||||
add(L"f16", L"if(0-$2 ,0,if(?f15 -$2 ,$2 ,?f15 ))");
|
||||
add(L"f17", L"?f0 *?f16 /100000");
|
||||
add(L"f18", L"?f8 +?f4 -0");
|
||||
add(L"f19", L"logwidth*logwidth/1");
|
||||
add(L"f20", L"?f17 *?f17 /1");
|
||||
add(L"f21", L"?f19 +0-?f20 ");
|
||||
add(L"f22", L"sqrt(?f21 )");
|
||||
add(L"f23", L"?f22 *?f8 /logwidth");
|
||||
add(L"f24", L"?f8 +?f23 -0");
|
||||
add(L"f25", L"?f18 +?f23 -0");
|
||||
add(L"f26", L"?f5 +0-?f4 ");
|
||||
add(L"f27", L"?f26 *1/2");
|
||||
add(L"f28", L"?f24 +0-?f27 ");
|
||||
add(L"f29", L"?f25 +?f27 -0");
|
||||
add(L"f30", L"?f5 *1/2");
|
||||
add(L"f31", L"logheight+0-?f30 ");
|
||||
add(L"f32", L"0+?f17 -0");
|
||||
add(L"f33", L"(10800000*atan2(?f23 ,?f17 ))/pi");
|
||||
add(L"f34", L"0+0-?f33 ");
|
||||
add(L"f35", L"0+?f14 -0");
|
||||
add(L"f36", L"(?f8 +?f18 )/2");
|
||||
add(L"f37", L"?f4 *1/2");
|
||||
add(L"f38", L"(10800000*atan2(?f37 ,?f14 ))/pi");
|
||||
add(L"f39", L"?f38 +0-?f33 ");
|
||||
add(L"f40", L"?f33 +?f38 -0");
|
||||
add(L"f41", L"0+0-?f38 ");
|
||||
add(L"f42", L"logwidth");
|
||||
add(L"f43", L"logheight");
|
||||
add(L"f44", L"logwidth");
|
||||
add(L"f45", L"(?f33 )/60000.0");
|
||||
add(L"f46", L"(?f39 )/60000.0");
|
||||
add(L"f47", L"(?f41 )/60000.0");
|
||||
add(L"f48", L"(?f40 )/60000.0");
|
||||
add(L"f49", L"(0)/60000.0");
|
||||
add(L"f50", L"(-5400000)/60000.0");
|
||||
add(L"f51", L"(16200000)/60000.0");
|
||||
add(L"f52", L"(5400000)/60000.0");
|
||||
add(L"f53", L"(0)/60000.0");
|
||||
add(L"f54", L"(-5400000)/60000.0");
|
||||
add(L"f55", L"(16200000)/60000.0");
|
||||
add(L"f56", L"(5400000)/60000.0");
|
||||
add(L"f57", L"(0)/60000.0");
|
||||
add(L"f58", L"(?f33 )/60000.0");
|
||||
add(L"f59", L"(?f33 )/60000.0");
|
||||
add(L"f60", L"(?f39 )/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
h.position = L"0 ?f2";
|
||||
h.y_maximum= L"51965";
|
||||
h.y_minimum= L"0";
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f32 ?f24";
|
||||
h1.y_maximum= L"?f2";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
handles.push_back(h);
|
||||
h1.position = L"?f42 ?f28";
|
||||
h1.y_maximum= L"?f1";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f32 ?f43";
|
||||
h2.x_maximum= L"?f15";
|
||||
h2.x_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
class oox_shape_curvedDownArrow : public oox_shape
|
||||
class oox_shape_CurvedRightArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_curvedDownArrow()
|
||||
oox_shape_CurvedRightArrow()
|
||||
{
|
||||
odf_type_name =L"ooxml-curvedRightArrow";
|
||||
|
||||
enhanced_path = L"M 0 ?f8 G ?f45 ?f8 ?f46 ?f47 L ?f32 ?f28 ?f43 ?f31 ?f32 ?f29 ?f32 ?f25 G ?f45 ?f8 ?f48 ?f49 Z S N M ?f43 ?f4 G ?f45 ?f8 ?f50 ?f51 ?f45 ?f8 ?f52 ?f53 Z I S N M 0 ?f8 G ?f45 ?f8 ?f54 ?f55 L ?f32 ?f28 ?f43 ?f31 ?f32 ?f29 ?f32 ?f25 G ?f45 ?f8 ?f56 ?f57 L 0 ?f8 G ?f45 ?f8 ?f58 ?f59 L ?f43 ?f4 G ?f45 ?f8 ?f60 ?f61 F N";
|
||||
text_areas = L"0 0 ?f43 ?f44";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 50000 25000";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logheight/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"if(0-$0 ,0,if(?f2 -$0 ,$0 ,?f2 ))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"?f0 *?f2 /100000");
|
||||
add(L"f6", L"(?f4 +?f5 )/4");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f8 *2/1");
|
||||
add(L"f10", L"?f9 *?f9 /1");
|
||||
add(L"f11", L"?f4 *?f4 /1");
|
||||
add(L"f12", L"?f10 +0-?f11 ");
|
||||
add(L"f13", L"sqrt(?f12 )");
|
||||
add(L"f14", L"?f13 *logwidth/?f9 ");
|
||||
add(L"f15", L"100000*?f14 /?f0 ");
|
||||
add(L"f16", L"if(0-$2 ,0,if(?f15 -$2 ,$2 ,?f15 ))");
|
||||
add(L"f17", L"?f0 *?f16 /100000");
|
||||
add(L"f18", L"?f8 +?f4 -0");
|
||||
add(L"f19", L"logwidth*logwidth/1");
|
||||
add(L"f20", L"?f17 *?f17 /1");
|
||||
add(L"f21", L"?f19 +0-?f20 ");
|
||||
add(L"f22", L"sqrt(?f21 )");
|
||||
add(L"f23", L"?f22 *?f8 /logwidth");
|
||||
add(L"f24", L"?f8 +?f23 -0");
|
||||
add(L"f25", L"?f18 +?f23 -0");
|
||||
add(L"f26", L"?f5 +0-?f4 ");
|
||||
add(L"f27", L"?f26 *1/2");
|
||||
add(L"f28", L"?f24 +0-?f27 ");
|
||||
add(L"f29", L"?f25 +?f27 -0");
|
||||
add(L"f30", L"?f5 *1/2");
|
||||
add(L"f31", L"logheight+0-?f30 ");
|
||||
add(L"f32", L"logwidth+0-?f17 ");
|
||||
add(L"f33", L"(10800000*atan2(?f23 ,?f17 ))/pi");
|
||||
add(L"f34", L"10800000+0-?f33 ");
|
||||
add(L"f35", L"0+0-?f33 ");
|
||||
add(L"f36", L"logwidth+0-?f14 ");
|
||||
add(L"f37", L"(?f8 +?f18 )/2");
|
||||
add(L"f38", L"?f4 *1/2");
|
||||
add(L"f39", L"(10800000*atan2(?f38 ,?f14 ))/pi");
|
||||
add(L"f40", L"?f39 +0-5400000");
|
||||
add(L"f41", L"5400000+?f39 -0");
|
||||
add(L"f42", L"10800000+0-?f39 ");
|
||||
add(L"f43", L"logwidth");
|
||||
add(L"f44", L"logheight");
|
||||
add(L"f45", L"logwidth");
|
||||
add(L"f46", L"(10800000)/60000.0");
|
||||
add(L"f47", L"(?f35 )/60000.0");
|
||||
add(L"f48", L"(?f34 )/60000.0");
|
||||
add(L"f49", L"(?f33 )/60000.0");
|
||||
add(L"f50", L"(16200000)/60000.0");
|
||||
add(L"f51", L"(?f40 )/60000.0");
|
||||
add(L"f52", L"(?f42 )/60000.0");
|
||||
add(L"f53", L"(?f41 )/60000.0");
|
||||
add(L"f54", L"(10800000)/60000.0");
|
||||
add(L"f55", L"(?f35 )/60000.0");
|
||||
add(L"f56", L"(?f34 )/60000.0");
|
||||
add(L"f57", L"(?f33 )/60000.0");
|
||||
add(L"f58", L"(10800000)/60000.0");
|
||||
add(L"f59", L"(5400000)/60000.0");
|
||||
add(L"f60", L"(16200000)/60000.0");
|
||||
add(L"f61", L"(?f40 )/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f32 ?f24";
|
||||
h1.y_maximum= L"?f2";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f43 ?f28";
|
||||
h1.y_maximum= L"?f1";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f32 ?f43";
|
||||
h2.x_maximum= L"?f15";
|
||||
h2.x_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
class oox_shape_CurvedDownArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_CurvedDownArrow()
|
||||
{
|
||||
odf_type_name =L"ooxml-curvedDownArrow";
|
||||
|
||||
//modifiers = L"23520";
|
||||
enhanced_path = L"M ?f2 ?f8 A ?f65 ?f66 ?f67 ?f68 ?f2 ?f8 ?f62 ?f64 W ?f69 ?f70 ?f71 ?f72 ?f2 ?f8 ?f62 ?f64 Z N";
|
||||
text_areas = L"?f22 ?f24 ?f23 ?f25";
|
||||
glue_points = L"?f22 ?f24 ?f22 ?f25 ?f23 ?f25 ?f23 ?f24";
|
||||
view_box = L"0 0 21600 21600";
|
||||
enhanced_path = L"M ?f31 ?f43 L ?f28 ?f32 ?f24 ?f32 G ?f8 ?f45 ?f46 ?f47 L ?f18 0 G ?f8 ?f45 ?f48 ?f49 L ?f29 ?f32 Z S N M ?f36 ?f35 G ?f8 ?f45 ?f50 ?f51 L 0 ?f43 G ?f8 ?f45 ?f52 ?f53 Z I S N M ?f36 ?f35 G ?f8 ?f45 ?f54 ?f55 L 0 ?f43 G ?f8 ?f45 ?f56 ?f57 L ?f18 0 G ?f8 ?f45 ?f58 ?f59 L ?f29 ?f32 ?f31 ?f43 ?f28 ?f32 ?f24 ?f32 G ?f8 ?f45 ?f60 ?f61 F N";
|
||||
text_areas = L"0 0 ?f44 ?f43";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 50000 25000";
|
||||
|
||||
add(L"f0", L"10800000");
|
||||
add(L"f1", L"5400000");
|
||||
add(L"f2", L"left");
|
||||
add(L"f3", L"right");
|
||||
add(L"f4", L"top");
|
||||
add(L"f5", L"bottom");
|
||||
add(L"f6", L"?f5 - ?f4");
|
||||
add(L"f7", L"?f6 / 2");
|
||||
add(L"f8", L"?f4 + ?f7");
|
||||
add(L"f9", L"?f3 - ?f2");
|
||||
add(L"f10", L"?f9 / 2");
|
||||
add(L"f11", L"?f2 + ?f10");
|
||||
add(L"f12", L"5419351 / 1725033");
|
||||
add(L"f13", L"2700000 + ?f1");
|
||||
add(L"f14", L"?f13 * ?f12 / ?f0");
|
||||
add(L"f15", L"0 - ?f14");
|
||||
add(L"f16", L"sin(?f15)");
|
||||
add(L"f17", L"0 - ?f16");
|
||||
add(L"f18", L"?f17 * ?f10");
|
||||
add(L"f19", L"cos(?f15)");
|
||||
add(L"f20", L"0 - ?f19");
|
||||
add(L"f21", L"?f20 * ?f7");
|
||||
add(L"f22", L"?f11 - ?f18");
|
||||
add(L"f23", L"?f11 + ?f18");
|
||||
add(L"f24", L"?f8 - ?f21");
|
||||
add(L"f25", L"?f8 + ?f21");
|
||||
add(L"f26", L"21550000 - 21600000");
|
||||
add(L"f27", L"if(?f26, 21600000, 21550000)");
|
||||
add(L"f28", L"-21550000 - ?f27");
|
||||
add(L"f29", L"if(?f28, -21550000, ?f27)");
|
||||
add(L"f30", L"?f0 + ?f29");
|
||||
add(L"f31", L"?f0 + ?f1");
|
||||
add(L"f32", L"?f31 * ?f12 / ?f0");
|
||||
add(L"f33", L"0 - ?f32");
|
||||
add(L"f34", L"cos(?f33)");
|
||||
add(L"f35", L"0 - ?f34");
|
||||
add(L"f36", L"?f35 * ?f10");
|
||||
add(L"f37", L"sin(?f33)");
|
||||
add(L"f38", L"0 - ?f37");
|
||||
add(L"f39", L"?f38 * ?f7");
|
||||
add(L"f40", L"sqrt(?f36 * ?f36 + ?f39 * ?f39 + 0 * 0)");
|
||||
add(L"f41", L"?f10 * ?f7 / ?f40");
|
||||
add(L"f42", L"?f38 * ?f41");
|
||||
add(L"f43", L"?f2 - ?f42");
|
||||
add(L"f44", L"?f35 * ?f41");
|
||||
add(L"f45", L"?f8 - ?f44");
|
||||
add(L"f46", L"?f43 - ?f10");
|
||||
add(L"f47", L"?f45 - ?f7");
|
||||
add(L"f48", L"?f43 + ?f10");
|
||||
add(L"f49", L"?f45 + ?f7");
|
||||
add(L"f50", L"?f30 + ?f1");
|
||||
add(L"f51", L"?f50 * ?f12 / ?f0");
|
||||
add(L"f52", L"0 - ?f51");
|
||||
add(L"f53", L"cos(?f52)");
|
||||
add(L"f54", L"0 - ?f53");
|
||||
add(L"f55", L"?f54 * ?f10");
|
||||
add(L"f56", L"sin(?f52)");
|
||||
add(L"f57", L"0 - ?f56");
|
||||
add(L"f58", L"?f57 * ?f7");
|
||||
add(L"f59", L"sqrt(?f55 * ?f55 + ?f58 * ?f58 + 0 * 0)");
|
||||
add(L"f60", L"?f10 * ?f7 / ?f59");
|
||||
add(L"f61", L"?f57 * ?f60");
|
||||
add(L"f62", L"?f43 + ?f61");
|
||||
add(L"f63", L"?f54 * ?f60");
|
||||
add(L"f64", L"?f45 + ?f63");
|
||||
add(L"f65", L"if(?f29, ?f2, ?f46)");
|
||||
add(L"f66", L"if(?f29, ?f8, ?f47)");
|
||||
add(L"f67", L"if(?f29, ?f2, ?f48)");
|
||||
add(L"f68", L"if(?f29, ?f8, ?f49)");
|
||||
add(L"f69", L"if(?f29, ?f46, ?f62)");
|
||||
add(L"f70", L"if(?f29, ?f47, ?f64)");
|
||||
add(L"f71", L"if(?f29, ?f48, ?f62)");
|
||||
add(L"f72", L"if(?f29, ?f49, ?f64)");
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"?f0 *?f2 /100000");
|
||||
add(L"f6", L"(?f4 +?f5 )/4");
|
||||
add(L"f7", L"logwidth/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f8 *2/1");
|
||||
add(L"f10", L"?f9 *?f9 /1");
|
||||
add(L"f11", L"?f4 *?f4 /1");
|
||||
add(L"f12", L"?f10 +0-?f11 ");
|
||||
add(L"f13", L"sqrt(?f12 )");
|
||||
add(L"f14", L"?f13 *logheight/?f9 ");
|
||||
add(L"f15", L"100000*?f14 /?f0 ");
|
||||
add(L"f16", L"if(0-$2 ,0,if(?f15 -$2 ,$2 ,?f15 ))");
|
||||
add(L"f17", L"?f0 *$2 /100000");
|
||||
add(L"f18", L"?f8 +?f4 -0");
|
||||
add(L"f19", L"logheight*logheight/1");
|
||||
add(L"f20", L"?f17 *?f17 /1");
|
||||
add(L"f21", L"?f19 +0-?f20 ");
|
||||
add(L"f22", L"sqrt(?f21 )");
|
||||
add(L"f23", L"?f22 *?f8 /logheight");
|
||||
add(L"f24", L"?f8 +?f23 -0");
|
||||
add(L"f25", L"?f18 +?f23 -0");
|
||||
add(L"f26", L"?f5 +0-?f4 ");
|
||||
add(L"f27", L"?f26 *1/2");
|
||||
add(L"f28", L"?f24 +0-?f27 ");
|
||||
add(L"f29", L"?f25 +?f27 -0");
|
||||
add(L"f30", L"?f5 *1/2");
|
||||
add(L"f31", L"logwidth+0-?f30 ");
|
||||
add(L"f32", L"logheight+0-?f17 ");
|
||||
add(L"f33", L"(10800000*atan2(?f23 ,?f17 ))/pi");
|
||||
add(L"f34", L"0+0-?f33 ");
|
||||
add(L"f35", L"logheight+0-?f14 ");
|
||||
add(L"f36", L"(?f8 +?f18 )/2");
|
||||
add(L"f37", L"?f4 *1/2");
|
||||
add(L"f38", L"(10800000*atan2(?f37 ,?f14 ))/pi");
|
||||
add(L"f39", L"16200000+?f33 -0");
|
||||
add(L"f40", L"16200000+0-?f38 ");
|
||||
add(L"f41", L"?f38 +0-5400000");
|
||||
add(L"f42", L"5400000+?f38 -0");
|
||||
add(L"f43", L"logheight");
|
||||
add(L"f44", L"logwidth");
|
||||
add(L"f45", L"logheight");
|
||||
add(L"f46", L"(?f39 )/60000.0");
|
||||
add(L"f47", L"(?f34 )/60000.0");
|
||||
add(L"f48", L"(16200000)/60000.0");
|
||||
add(L"f49", L"(?f33 )/60000.0");
|
||||
add(L"f50", L"(?f40 )/60000.0");
|
||||
add(L"f51", L"(?f41 )/60000.0");
|
||||
add(L"f52", L"(10800000)/60000.0");
|
||||
add(L"f53", L"(?f42 )/60000.0");
|
||||
add(L"f54", L"(?f40 )/60000.0");
|
||||
add(L"f55", L"(?f41 )/60000.0");
|
||||
add(L"f56", L"(10800000)/60000.0");
|
||||
add(L"f57", L"(5400000)/60000.0");
|
||||
add(L"f58", L"(16200000)/60000.0");
|
||||
add(L"f59", L"(?f33 )/60000.0");
|
||||
add(L"f60", L"(?f39 )/60000.0");
|
||||
add(L"f61", L"(?f34 )/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
h.position = L"0 ?f2";
|
||||
h.y_maximum= L"51965";
|
||||
h.y_minimum= L"0";
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f25 ?f32";
|
||||
h1.x_maximum= L"$1";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f28 ?f43";
|
||||
h1.x_maximum= L"?f1";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f44 ?f32";
|
||||
h2.y_maximum= L"?f15";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
class oox_shape_CurvedUpArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_CurvedUpArrow()
|
||||
{
|
||||
odf_type_name =L"ooxml-curvedUpArrow";
|
||||
|
||||
enhanced_path = L"M ?f31 0 L ?f29 ?f32 ?f25 ?f32 G ?f8 ?f46 ?f47 ?f48 ?f8 ?f46 ?f49 ?f50 L ?f28 ?f32 Z S N M ?f8 ?f45 G ?f8 ?f46 ?f51 ?f52 L ?f4 0 G ?f8 ?f46 ?f53 ?f54 Z I S N M ?f36 ?f35 G ?f8 ?f46 ?f55 ?f56 L ?f28 ?f32 ?f31 0 ?f29 ?f32 ?f25 ?f32 G ?f8 ?f46 ?f57 ?f58 L ?f8 ?f45 G ?f8 ?f46 ?f59 ?f60 L ?f4 0 G ?f8 ?f46 ?f61 ?f62 F N";
|
||||
text_areas = L"0 0 ?f44 ?f45";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 50000 25000";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"?f0 *?f2 /100000");
|
||||
add(L"f6", L"(?f4 +?f5 )/4");
|
||||
add(L"f7", L"logwidth/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f8 *2/1");
|
||||
add(L"f10", L"?f9 *?f9 /1");
|
||||
add(L"f11", L"?f4 *?f4 /1");
|
||||
add(L"f12", L"?f10 +0-?f11 ");
|
||||
add(L"f13", L"sqrt(?f12 )");
|
||||
add(L"f14", L"?f13 *logheight/?f9 ");
|
||||
add(L"f15", L"100000*?f14 /?f0 ");
|
||||
add(L"f16", L"if(0-$2 ,0,if(?f15 -$2 ,$2 ,?f15 ))");
|
||||
add(L"f17", L"?f0 *$2 /100000");
|
||||
add(L"f18", L"?f8 +?f4 -0");
|
||||
add(L"f19", L"logheight*logheight/1");
|
||||
add(L"f20", L"?f17 *?f17 /1");
|
||||
add(L"f21", L"?f19 +0-?f20 ");
|
||||
add(L"f22", L"sqrt(?f21 )");
|
||||
add(L"f23", L"?f22 *?f8 /logheight");
|
||||
add(L"f24", L"?f8 +?f23 -0");
|
||||
add(L"f25", L"?f18 +?f23 -0");
|
||||
add(L"f26", L"?f5 +0-?f4 ");
|
||||
add(L"f27", L"?f26 *1/2");
|
||||
add(L"f28", L"?f24 +0-?f27 ");
|
||||
add(L"f29", L"?f25 +?f27 -0");
|
||||
add(L"f30", L"?f5 *1/2");
|
||||
add(L"f31", L"logwidth+0-?f30 ");
|
||||
add(L"f32", L"0+?f17 -0");
|
||||
add(L"f33", L"(10800000*atan2(?f23 ,?f17 ))/pi");
|
||||
add(L"f34", L"0+0-?f33 ");
|
||||
add(L"f35", L"0+?f14 -0");
|
||||
add(L"f36", L"(?f8 +?f18 )/2");
|
||||
add(L"f37", L"?f4 *1/2");
|
||||
add(L"f38", L"(10800000*atan2(?f37 ,?f14 ))/pi");
|
||||
add(L"f39", L"?f38 +0-?f33 ");
|
||||
add(L"f40", L"0+0-?f39 ");
|
||||
add(L"f41", L"5400000+0-?f33 ");
|
||||
add(L"f42", L"?f33 +?f38 -0");
|
||||
add(L"f43", L"5400000+0-?f38 ");
|
||||
add(L"f44", L"logwidth");
|
||||
add(L"f45", L"logheight");
|
||||
add(L"f46", L"logheight");
|
||||
add(L"f47", L"(?f41 )/60000.0");
|
||||
add(L"f48", L"(?f42 )/60000.0");
|
||||
add(L"f49", L"(?f43 )/60000.0");
|
||||
add(L"f50", L"(?f39 )/60000.0");
|
||||
add(L"f51", L"(5400000)/60000.0");
|
||||
add(L"f52", L"(5400000)/60000.0");
|
||||
add(L"f53", L"(10800000)/60000.0");
|
||||
add(L"f54", L"(-5400000)/60000.0");
|
||||
add(L"f55", L"(?f43 )/60000.0");
|
||||
add(L"f56", L"(?f39 )/60000.0");
|
||||
add(L"f57", L"(?f41 )/60000.0");
|
||||
add(L"f58", L"(?f33 )/60000.0");
|
||||
add(L"f59", L"(5400000)/60000.0");
|
||||
add(L"f60", L"(5400000)/60000.0");
|
||||
add(L"f61", L"(10800000)/60000.0");
|
||||
add(L"f62", L"(-5400000)/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f25 ?f32";
|
||||
h1.x_maximum= L"?f2";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f28 0";
|
||||
h1.x_maximum= L"?f1";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f44 ?f32";
|
||||
h2.y_maximum= L"?f15";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -30,11 +30,12 @@
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
// shapetypeMathDivide,
|
||||
//+ shapetypeMathDivide,
|
||||
//+ shapetypeMathEqual,
|
||||
// shapetypeMathMinus,
|
||||
//+ shapetypeMathMinus,
|
||||
//+ shapetypeMathMultiply,
|
||||
// shapetypeMathNotEqual,
|
||||
//+ shapetypeMathPlus,
|
||||
//+ shapetypeMathNotEqual,
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_mathMultiply : public oox_shape
|
||||
@ -160,4 +161,216 @@ public:
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
class oox_shape_mathDivide : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_mathDivide()
|
||||
{
|
||||
odf_type_name =L"ooxml-mathDivide";
|
||||
|
||||
enhanced_path = L"M ?f20 ?f18 G ?f11 ?f11 ?f25 ?f26 Z M ?f20 ?f19 G ?f11 ?f11 ?f27 ?f28 Z M ?f21 ?f14 L ?f22 ?f14 ?f22 ?f15 ?f21 ?f15 Z N";
|
||||
text_areas = L"?f21 ?f14 ?f22 ?f15";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"23520 5880 11760";
|
||||
|
||||
add(L"f0", L"if(1000-$0 ,1000,if(36745-$0 ,$0 ,36745))");
|
||||
add(L"f1", L"0+0-?f0 ");
|
||||
add(L"f2", L"(73490+?f1 )/4");
|
||||
add(L"f3", L"36745*logwidth/logheight");
|
||||
add(L"f4", L"min(?f2 ,?f3 )");
|
||||
add(L"f5", L"if(1000-$2 ,1000,if(?f4 -$2 ,$2 ,?f4 ))");
|
||||
add(L"f6", L"-4*?f5 /1");
|
||||
add(L"f7", L"73490+?f6 -?f0 ");
|
||||
add(L"f8", L"if(0-$1 ,0,if(?f7 -$1 ,$1 ,?f7 ))");
|
||||
add(L"f9", L"logheight*?f0 /200000");
|
||||
add(L"f10", L"logheight*?f8 /100000");
|
||||
add(L"f11", L"logheight*?f5 /100000");
|
||||
add(L"f12", L"logwidth*73490/200000");
|
||||
add(L"f13", L"logheight/2");
|
||||
add(L"f14", L"?f13 +0-?f9 ");
|
||||
add(L"f15", L"?f13 +?f9 -0");
|
||||
add(L"f16", L"?f10 +?f11 -0");
|
||||
add(L"f17", L"?f14 +0-?f16 ");
|
||||
add(L"f18", L"?f17 +0-?f11 ");
|
||||
add(L"f19", L"logheight+0-?f18 ");
|
||||
add(L"f20", L"logwidth/2");
|
||||
add(L"f21", L"?f20 +0-?f12 ");
|
||||
add(L"f22", L"?f20 +?f12 -0");
|
||||
add(L"f23", L"?f20 +0-?f11 ");
|
||||
add(L"f24", L"logwidth");
|
||||
add(L"f25", L"(16200000)/60000.0");
|
||||
add(L"f26", L"(21600000)/60000.0");
|
||||
add(L"f27", L"(5400000)/60000.0");
|
||||
add(L"f28", L"(21600000)/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h, h1;
|
||||
h.position = L"0 ?f14";
|
||||
h.y_maximum= L"36745";
|
||||
h.y_minimum= L"1000";
|
||||
handles.push_back(h);
|
||||
|
||||
h.position = L"?f24 ?f17";
|
||||
h.y_maximum= L"?f7";
|
||||
h.y_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
|
||||
h1.position = L"?f23 0";
|
||||
h1.x_maximum= L"?f4";
|
||||
h1.x_minimum= L"1000";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
class oox_shape_mathNotEqual : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_mathNotEqual()
|
||||
{
|
||||
odf_type_name =L"ooxml-mathNotEqual";
|
||||
|
||||
enhanced_path = L"M ?f9 ?f14 L ?f24 ?f14 ?f43 ?f47 ?f42 ?f46 ?f34 ?f14 ?f10 ?f14 ?f10 ?f12 ?f35 ?f12 ?f36 ?f13 ?f10 ?f13 ?f10 ?f15 ?f37 ?f15 ?f49 ?f51 ?f48 ?f50 ?f30 ?f15 ?f9 ?f15 ?f9 ?f13 ?f28 ?f13 ?f26 ?f12 ?f9 ?f12 Z N";
|
||||
text_areas = L"?f9 ?f14 ?f10 ?f15";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"23520 6600000 11760";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
|
||||
add(L"f1", L"if(4200000-$1 ,4200000,if(6600000-$1 ,$1 ,6600000))");
|
||||
add(L"f2", L"?f0 *2/1");
|
||||
add(L"f3", L"100000+0-2");
|
||||
add(L"f4", L"if(0-$2 ,0,if(?f3 -$2 ,$2 ,?f3 ))");
|
||||
add(L"f5", L"logheight*?f0 /100000");
|
||||
add(L"f6", L"logheight*?f4 /200000");
|
||||
add(L"f7", L"logwidth*73490/200000");
|
||||
add(L"f8", L"logwidth/2");
|
||||
add(L"f9", L"?f8 +0-?f7 ");
|
||||
add(L"f10", L"?f8 +?f7 -0");
|
||||
add(L"f11", L"logheight/2");
|
||||
add(L"f12", L"?f11 +0-?f6 ");
|
||||
add(L"f13", L"?f11 +?f6 -0");
|
||||
add(L"f14", L"?f12 +0-?f5 ");
|
||||
add(L"f15", L"?f13 +?f5 -0");
|
||||
add(L"f16", L"?f1 +0-5400000");
|
||||
add(L"f17", L"logheight/2");
|
||||
add(L"f18", L"?f17 *tan(pi*(?f16 )/10800000)");
|
||||
add(L"f19", L"sqrt(?f18 *?f18 +?f17 *?f17 +0*0)");
|
||||
add(L"f20", L"?f19 *?f5 /?f17 ");
|
||||
add(L"f21", L"?f20 *1/2");
|
||||
add(L"f22", L"?f8 +?f18 -?f21 ");
|
||||
add(L"f23", L"?f18 *?f14 /?f17 ");
|
||||
add(L"f24", L"?f22 +0-?f23 ");
|
||||
add(L"f25", L"?f18 *?f12 /?f17 ");
|
||||
add(L"f26", L"?f22 +0-?f25 ");
|
||||
add(L"f27", L"?f18 *?f13 /?f17 ");
|
||||
add(L"f28", L"?f22 +0-?f27 ");
|
||||
add(L"f29", L"?f18 *?f15 /?f17 ");
|
||||
add(L"f30", L"?f22 +0-?f29 ");
|
||||
add(L"f31", L"?f18 *2/1");
|
||||
add(L"f32", L"?f22 +0-?f31 ");
|
||||
add(L"f33", L"?f22 +?f20 -0");
|
||||
add(L"f34", L"?f24 +?f20 -0");
|
||||
add(L"f35", L"?f26 +?f20 -0");
|
||||
add(L"f36", L"?f28 +?f20 -0");
|
||||
add(L"f37", L"?f30 +?f20 -0");
|
||||
add(L"f38", L"?f32 +?f20 -0");
|
||||
add(L"f39", L"?f5 *?f17 /?f19 ");
|
||||
add(L"f40", L"?f22 +?f39 -0");
|
||||
add(L"f41", L"?f33 +0-?f39 ");
|
||||
add(L"f42", L"if(?f16 ,?f40 ,?f33 )");
|
||||
add(L"f43", L"if(?f16 ,?f22 ,?f41 )");
|
||||
add(L"f44", L"?f5 *?f18 /?f19 ");
|
||||
add(L"f45", L"0+0-?f44 ");
|
||||
add(L"f46", L"if(?f16 ,?f44 ,0)");
|
||||
add(L"f47", L"if(?f16 ,0,?f45 )");
|
||||
add(L"f48", L"logwidth+0-?f42 ");
|
||||
add(L"f49", L"logwidth+0-?f43 ");
|
||||
add(L"f50", L"logheight+0-?f46 ");
|
||||
add(L"f51", L"logheight+0-?f47 ");
|
||||
add(L"f52", L"(?f42 +?f43 )/2");
|
||||
add(L"f53", L"(?f49 +?f48 )/2");
|
||||
add(L"f54", L"(?f46 +?f47 )/2");
|
||||
add(L"f55", L"(?f14 +?f12 )/2");
|
||||
add(L"f56", L"(?f13 +?f15 )/2");
|
||||
add(L"f57", L"(?f51 +?f50 )/2");
|
||||
add(L"f58", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h, h1;
|
||||
h.position = L"0 ?f14";
|
||||
h.y_maximum= L"50000";
|
||||
h.y_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
|
||||
h1.position = L"?f43 0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h.position = L"?f58 ?f12";
|
||||
h.y_maximum= L"?f3";
|
||||
h.y_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
class oox_shape_mathPlus : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_mathPlus()
|
||||
{
|
||||
odf_type_name =L"ooxml-mathPlus";
|
||||
|
||||
enhanced_path = L"?f6 ?f12 L ?f7 ?f12 ?f7 ?f11 ?f8 ?f11 ?f8 ?f12 ?f9 ?f12 ?f9 ?f13 ?f8 ?f13 ?f8 ?f14 ?f7 ?f14 ?f7 ?f13 ?f6 ?f13 Z N";
|
||||
text_areas = L"?f6 ?f12 ?f9 ?f13";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"23520";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(73490-$0 ,$0 ,73490))");
|
||||
add(L"f1", L"logwidth*73490/200000");
|
||||
add(L"f2", L"logheight*73490/200000");
|
||||
add(L"f3", L"min(logwidth,logheight)");
|
||||
add(L"f4", L"?f3 *?f0 /200000");
|
||||
add(L"f5", L"logwidth/2");
|
||||
add(L"f6", L"?f5 +0-?f1 ");
|
||||
add(L"f7", L"?f5 +0-?f4 ");
|
||||
add(L"f8", L"?f5 +?f4 -0");
|
||||
add(L"f9", L"?f5 +?f1 -0");
|
||||
add(L"f10", L"logheight/2");
|
||||
add(L"f11", L"?f10 +0-?f2 ");
|
||||
add(L"f12", L"?f10 +0-?f4 ");
|
||||
add(L"f13", L"?f10 +?f4 -0");
|
||||
add(L"f14", L"?f10 +?f2 -0");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
h.position = L"0 ?f12";
|
||||
h.y_maximum= L"73490";
|
||||
h.y_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_mathMinus : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_mathMinus()
|
||||
{
|
||||
odf_type_name =L"ooxml-mathMinus";
|
||||
|
||||
enhanced_path = L"M ?f7 ?f4 L ?f8 ?f4 ?f8 ?f5 ?f7 ?f5 Z N";
|
||||
text_areas = L"?f7 ?f4 ?f8 ?f5";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"23520";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f1", L"logheight*?f0 /200000");
|
||||
add(L"f2", L"logwidth*73490/200000");
|
||||
add(L"f3", L"logheight/2");
|
||||
add(L"f4", L"?f3 +0-?f1 ");
|
||||
add(L"f5", L"?f3 +?f1 -0");
|
||||
add(L"f6", L"logwidth/2");
|
||||
add(L"f7", L"?f6 +0-?f2 ");
|
||||
add(L"f8", L"?f6 +?f2 -0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
h.position = L"0 ?f4";
|
||||
h.y_maximum= L"100000";
|
||||
h.y_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -29,12 +29,15 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
// shapetypeArc,
|
||||
//+ shapetypeArc,
|
||||
//+ shapetypeBevel,
|
||||
//+ shapetypeChevron,
|
||||
//+ shapetypeChord,
|
||||
//+ shapetypeCorner,
|
||||
// shapetypeCornerTabs,
|
||||
// shapetypeDecagon,
|
||||
// shapetypeDiagStripe,
|
||||
//+ shapetypeDiamond
|
||||
// shapetypeDodecagon,
|
||||
//+ shapetypeDoubleWave,
|
||||
//+ shapetypeFunnel,
|
||||
@ -42,13 +45,17 @@
|
||||
//+ shapetypeGear9,
|
||||
// shapetypeHalfFrame,
|
||||
// shapetypeHeptagon,
|
||||
//+ shapetypeHomePlate,
|
||||
// shapetypeNonIsoscelesTrapezoid,
|
||||
//+ shapetypeParallelogram
|
||||
//+ shapetypePie,
|
||||
//+ shapetypePieWedge,
|
||||
//+ shapetypePlaque,
|
||||
// shapetypePlaqueTabs,
|
||||
// shapetypeSquareTabs,
|
||||
// shapetypeTeardrop,
|
||||
// shapetypeTeardrop
|
||||
//+ shapetypeTriangle
|
||||
//+ shapetypeTrapezoid
|
||||
//+ shapetypeBlockArc
|
||||
//+ shapetypeDonut
|
||||
|
||||
@ -766,7 +773,7 @@ class oox_shape_PieWedge : public oox_shape
|
||||
public:
|
||||
oox_shape_PieWedge()
|
||||
{
|
||||
odf_type_name =L"ooxml-PieWedge";
|
||||
odf_type_name =L"ooxml-pieWedge";
|
||||
|
||||
enhanced_path = L"M 0 ?f7 G ?f8 ?f9 ?f10 ?f11 L ?f4 ?f7 Z N";
|
||||
text_areas = L"?f2 ?f3 ?f4 ?f7";
|
||||
@ -1103,4 +1110,376 @@ public:
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
class oox_shape_Chevron : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Chevron()
|
||||
{
|
||||
odf_type_name =L"ooxml-chevron";
|
||||
|
||||
enhanced_path = L"M 0 0 L ?f4 0 ?f11 ?f9 ?f4 ?f10 0 ?f10 ?f3 ?f9 Z N";
|
||||
text_areas = L"?f7 0 ?f8 ?f10";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"50000";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"100000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$0 ,0,if(?f1 -$0 ,$0 ,?f1 ))");
|
||||
add(L"f3", L"?f0 *?f2 /100000");
|
||||
add(L"f4", L"logwidth+0-?f3 ");
|
||||
add(L"f5", L"?f4 *1/2");
|
||||
add(L"f6", L"?f4 +0-?f3 ");
|
||||
add(L"f7", L"if(?f6 ,?f3 ,0)");
|
||||
add(L"f8", L"if(?f6 ,?f4 ,logwidth)");
|
||||
add(L"f9", L"logheight/2");
|
||||
add(L"f10", L"logheight");
|
||||
add(L"f11", L"logwidth");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f4 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"?f1";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
class oox_shape_Arc : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Arc()
|
||||
{
|
||||
odf_type_name =L"ooxml-arc";
|
||||
|
||||
enhanced_path = L"M ?f16 ?f18 G ?f5 ?f7 ?f46 ?f47 L ?f15 ?f17 Z S N M ?f16 ?f18 G ?f5 ?f7 ?f48 ?f49 F N";
|
||||
text_areas = L"?f36 ?f42 ?f24 ?f30";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"16200000 0";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(21599999-$0 ,$0 ,21599999))");
|
||||
add(L"f1", L"if(0-$1 ,0,if(21599999-$1 ,$1 ,21599999))");
|
||||
add(L"f2", L"?f1 +0-?f0 ");
|
||||
add(L"f3", L"?f2 +21600000-0");
|
||||
add(L"f4", L"if(?f2 ,?f2 ,?f3 )");
|
||||
add(L"f5", L"logwidth/2");
|
||||
add(L"f6", L"?f5 *sin(pi*(?f0 )/10800000)");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 *cos(pi*(?f0 )/10800000)");
|
||||
add(L"f9", L"?f5 *(cos(atan2(?f6 ,?f8 )))");
|
||||
add(L"f10", L"?f7 *(sin(atan2(?f6 ,?f8 )))");
|
||||
add(L"f11", L"?f5 *sin(pi*(?f1 )/10800000)");
|
||||
add(L"f12", L"?f7 *cos(pi*(?f1 )/10800000)");
|
||||
add(L"f13", L"?f5 *(cos(atan2(?f11 ,?f12 )))");
|
||||
add(L"f14", L"?f7 *(sin(atan2(?f11 ,?f12 )))");
|
||||
add(L"f15", L"logwidth/2");
|
||||
add(L"f16", L"?f15 +?f9 -0");
|
||||
add(L"f17", L"logheight/2");
|
||||
add(L"f18", L"?f17 +?f10 -0");
|
||||
add(L"f19", L"?f15 +?f13 -0");
|
||||
add(L"f20", L"?f17 +?f14 -0");
|
||||
add(L"f21", L"21600000+0-?f0 ");
|
||||
add(L"f22", L"?f4 +0-?f21 ");
|
||||
add(L"f23", L"max(?f16 ,?f19 )");
|
||||
add(L"f24", L"if(?f22 ,logwidth,?f23 )");
|
||||
add(L"f25", L"5400000+0-?f0 ");
|
||||
add(L"f26", L"27000000+0-?f0 ");
|
||||
add(L"f27", L"if(?f25 ,?f25 ,?f26 )");
|
||||
add(L"f28", L"?f4 +0-?f27 ");
|
||||
add(L"f29", L"max(?f18 ,?f20 )");
|
||||
add(L"f30", L"if(?f28 ,logheight,?f29 )");
|
||||
add(L"f31", L"10800000+0-?f0 ");
|
||||
add(L"f32", L"32400000+0-?f0 ");
|
||||
add(L"f33", L"if(?f31 ,?f31 ,?f32 )");
|
||||
add(L"f34", L"?f4 +0-?f33 ");
|
||||
add(L"f35", L"min(?f16 ,?f19 )");
|
||||
add(L"f36", L"if(?f34 ,0,?f35 )");
|
||||
add(L"f37", L"16200000+0-?f0 ");
|
||||
add(L"f38", L"37800000+0-?f0 ");
|
||||
add(L"f39", L"if(?f37 ,?f37 ,?f38 )");
|
||||
add(L"f40", L"?f4 +0-?f39 ");
|
||||
add(L"f41", L"min(?f18 ,?f20 )");
|
||||
add(L"f42", L"if(?f40 ,0,?f41 )");
|
||||
add(L"f43", L"?f0 +0-5400000");
|
||||
add(L"f44", L"?f1 +5400000-0");
|
||||
add(L"f45", L"(?f43 +?f44 )/2");
|
||||
add(L"f46", L"(?f0 )/60000.0");
|
||||
add(L"f47", L"(?f4 )/60000.0");
|
||||
add(L"f48", L"(?f0 )/60000.0");
|
||||
add(L"f49", L"(?f4 )/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f16 ?f18";
|
||||
handles.push_back(h);
|
||||
|
||||
h.position = L"?f19 ?f20";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class oox_shape_HomePlate : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_HomePlate()
|
||||
{
|
||||
odf_type_name =L"ooxml-homePlate";
|
||||
|
||||
enhanced_path = L"M 0 0 L ?f4 0 ?f9 ?f7 ?f4 ?f8 0 ?f8 Z N";
|
||||
text_areas = L"0 0 ?f5 ?f8";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"50000";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"100000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$0 ,0,if(?f1 -$0 ,$0 ,?f1 ))");
|
||||
add(L"f3", L"?f0 *?f2 /100000");
|
||||
add(L"f4", L"logwidth+0-?f3 ");
|
||||
add(L"f5", L"(?f4 +logwidth)/2");
|
||||
add(L"f6", L"?f4 *1/2");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"logheight");
|
||||
add(L"f9", L"logwidth");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f4 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"?f1";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_Bevel : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Bevel()
|
||||
{
|
||||
odf_type_name =L"ooxml-bevel";
|
||||
|
||||
enhanced_path = L"M ?f2 ?f2 L ?f3 ?f2 ?f3 ?f4 ?f2 ?f4 Z S N M 0 0 L ?f5 0 ?f3 ?f2 ?f2 ?f2 Z K S N M 0 ?f8 L ?f2 ?f4 ?f3 ?f4 ?f5 ?f8 Z I S N M 0 0 L ?f2 ?f2 ?f2 ?f4 0 ?f8 Z J S N M ?f5 0 L ?f5 ?f8 ?f3 ?f4 ?f3 ?f2 Z H S N M 0 0 L ?f5 0 ?f5 ?f8 0 ?f8 Z M ?f2 ?f2 L ?f3 ?f2 ?f3 ?f4 ?f2 ?f4 Z M 0 0 L ?f2 ?f2 M 0 ?f8 L ?f2 ?f4 M ?f5 0 L ?f3 ?f2 M ?f5 ?f8 L ?f3 ?f4 F N";
|
||||
text_areas = L"?f2 ?f2 ?f3 ?f4";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"12500";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
|
||||
add(L"f1", L"min(logwidth,logheight)");
|
||||
add(L"f2", L"?f1 *?f0 /100000");
|
||||
add(L"f3", L"logwidth+0-?f2 ");
|
||||
add(L"f4", L"logheight+0-?f2 ");
|
||||
add(L"f5", L"logwidth");
|
||||
add(L"f6", L"logheight/2");
|
||||
add(L"f7", L"logwidth/2");
|
||||
add(L"f8", L"logheight");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f2 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"50000";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class oox_shape_Trapezoid : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Trapezoid()
|
||||
{
|
||||
odf_type_name =L"ooxml-trapezoid";
|
||||
|
||||
enhanced_path = L"M 0 ?f14 L ?f4 0 ?f5 0 ?f15 ?f14 Z N";
|
||||
text_areas = L"?f8 ?f10 ?f11 ?f14";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logwidth/?f0");
|
||||
add(L"f2", L"if(0-$0 ,0,if(?f1 -$0 ,$0 ,?f1 ))");
|
||||
add(L"f3", L"?f0 *?f2 /200000");
|
||||
add(L"f4", L"?f0 *?f2 /100000");
|
||||
add(L"f5", L"logwidth+0-?f4");
|
||||
add(L"f6", L"logwidth+0-?f3");
|
||||
add(L"f7", L"logwidth/3");
|
||||
add(L"f8", L"?f7 *?f2 /?f1");
|
||||
add(L"f9", L"logheight/3");
|
||||
add(L"f10", L"?f9 *?f2 /?f1");
|
||||
add(L"f11", L"logwidth+0-?f8");
|
||||
add(L"f12", L"logwidth/2");
|
||||
add(L"f13", L"logheight/2");
|
||||
add(L"f14", L"logheight");
|
||||
add(L"f15", L"logwidth");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f4 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"?f1";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class oox_shape_Triangle : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Triangle()
|
||||
{
|
||||
odf_type_name =L"ooxml-triangle";
|
||||
|
||||
enhanced_path = L"M 0 ?f6 L ?f2 0 ?f7 ?f6 Z N";
|
||||
text_areas = L"?f1 ?f5 ?f4 ?f6";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"50000";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f1", L"logwidth*?f0 /200000");
|
||||
add(L"f2", L"logwidth*?f0 /100000");
|
||||
add(L"f3", L"logwidth/2");
|
||||
add(L"f4", L"?f1 +?f3 -0");
|
||||
add(L"f5", L"logheight/2");
|
||||
add(L"f6", L"logheight");
|
||||
add(L"f7", L"logwidth");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f2 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"100000";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_Diamond : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Diamond()
|
||||
{
|
||||
odf_type_name =L"ooxml-diamond";
|
||||
|
||||
enhanced_path = L"M 0 ?f3 L ?f2 0 ?f5 ?f3 ?f2 ?f4 Z N";
|
||||
text_areas = L"?f6 ?f7 ?f0 ?f1";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"logwidth*3/4");
|
||||
add(L"f1", L"logheight*3/4");
|
||||
add(L"f2", L"logwidth/2");
|
||||
add(L"f3", L"logheight/2");
|
||||
add(L"f4", L"logheight");
|
||||
add(L"f5", L"logwidth");
|
||||
add(L"f6", L"logwidth/4");
|
||||
add(L"f7", L"logheight/4");
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_Parallelogram : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Parallelogram()
|
||||
{
|
||||
odf_type_name =L"ooxml-parallelogram";
|
||||
|
||||
enhanced_path = L"M 0 ?f22 L ?f4 0 ?f23 0 ?f6 ?f22 Z N";
|
||||
text_areas = L"?f13 ?f14 ?f15 ?f16";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"100000*logwidth/?f0");
|
||||
add(L"f2", L"if(0-$0 ,0,if(?f1 -$0 ,$0 ,?f1 ))");
|
||||
add(L"f3", L"?f0 *?f2 /200000");
|
||||
add(L"f4", L"?f0 *?f2 /100000");
|
||||
add(L"f5", L"logwidth+0-?f3");
|
||||
add(L"f6", L"logwidth+0-?f4");
|
||||
add(L"f7", L"?f6 *1/2");
|
||||
add(L"f8", L"logwidth+0-?f7");
|
||||
add(L"f9", L"logwidth/2");
|
||||
add(L"f10", L"?f9 *?f2 /?f1");
|
||||
add(L"f11", L"5*?f2 /?f1 ");
|
||||
add(L"f12", L"(1+?f11 )/12");
|
||||
add(L"f13", L"?f12 *logwidth/1");
|
||||
add(L"f14", L"?f12 *logheight/1");
|
||||
add(L"f15", L"logwidth+0-?f13");
|
||||
add(L"f16", L"logheight+0-?f14");
|
||||
add(L"f17", L"logwidth/2");
|
||||
add(L"f18", L"logheight*?f17 /?f4");
|
||||
add(L"f19", L"if(0-?f18 ,0,if(logheight-?f18 ,?f18 ,logheight))");
|
||||
add(L"f20", L"logheight+0-?f19");
|
||||
add(L"f21", L"logheight/2");
|
||||
add(L"f22", L"logheight");
|
||||
add(L"f23", L"logwidth");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f4 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"?f1";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_RtTriangle : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_RtTriangle()
|
||||
{
|
||||
odf_type_name =L"ooxml-rtTriangle";
|
||||
|
||||
enhanced_path = L"M 0 ?f4 L 0 0 ?f6 ?f4 Z N";
|
||||
text_areas = L"?f7 ?f0 ?f1 ?f2";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"logheight*7/12");
|
||||
add(L"f1", L"logwidth*7/12");
|
||||
add(L"f2", L"logheight*11/12");
|
||||
add(L"f3", L"logheight/2");
|
||||
add(L"f4", L"logheight");
|
||||
add(L"f5", L"logwidth/2");
|
||||
add(L"f6", L"logwidth");
|
||||
add(L"f7", L"logwidth/12");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class oox_shape_Plus : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Plus()
|
||||
{
|
||||
odf_type_name =L"ooxml-plus";
|
||||
|
||||
enhanced_path = L"M 0 ?f2 L ?f2 ?f2 ?f2 0 ?f3 0 ?f3 ?f2 ?f13 ?f2 ?f13 ?f4 ?f3 ?f4 ?f3 ?f12 ?f2 ?f12 ?f2 ?f4 0 ?f4 Z N";
|
||||
text_areas = L"?f6 ?f8 ?f7 ?f9";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
|
||||
add(L"f1", L"min(logwidth,logheight)");
|
||||
add(L"f2", L"?f1 *?f0 /100000");
|
||||
add(L"f3", L"logwidth+0-?f2 ");
|
||||
add(L"f4", L"logheight+0-?f2 ");
|
||||
add(L"f5", L"logwidth+0-logheight");
|
||||
add(L"f6", L"if(?f5 ,0,?f2 )");
|
||||
add(L"f7", L"if(?f5 ,logwidth,?f3 )");
|
||||
add(L"f8", L"if(?f5 ,?f2 ,0)");
|
||||
add(L"f9", L"if(?f5 ,?f4 ,logheight)");
|
||||
add(L"f10", L"logwidth/2");
|
||||
add(L"f11", L"logheight/2");
|
||||
add(L"f12", L"logheight");
|
||||
add(L"f13", L"logwidth");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f2 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"50000";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};}
|
||||
|
||||
@ -719,4 +719,45 @@ public:
|
||||
add(L"f198", L"if(?f26, ?f175, ?f190)");
|
||||
}
|
||||
};
|
||||
class oox_shape_roundRect : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_roundRect()
|
||||
{
|
||||
odf_type_name =L"ooxml-roundRect";
|
||||
|
||||
enhanced_path = L"M 0 ?f2 G ?f2 ?f2 ?f12 ?f13 L ?f3 0 G ?f2 ?f2 ?f14 ?f15 L ?f11 ?f4 G ?f2 ?f2 ?f16 ?f17 L ?f2 ?f10 G ?f2 ?f2 ?f18 ?f19 Z N";
|
||||
text_areas = L"?f5 ?f5 ?f6 ?f7";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"16667";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
|
||||
add(L"f1", L"min(logwidth,logheight)");
|
||||
add(L"f2", L"?f1 *?f0 /100000");
|
||||
add(L"f3", L"logwidth+0-?f2 ");
|
||||
add(L"f4", L"logheight+0-?f2 ");
|
||||
add(L"f5", L"?f2 *29289/100000");
|
||||
add(L"f6", L"logwidth+0-?f5 ");
|
||||
add(L"f7", L"logheight+0-?f5 ");
|
||||
add(L"f8", L"logwidth/2");
|
||||
add(L"f9", L"logheight/2");
|
||||
add(L"f10", L"logheight");
|
||||
add(L"f11", L"logwidth");
|
||||
add(L"f12", L"(10800000)/60000.0");
|
||||
add(L"f13", L"(5400000)/60000.0");
|
||||
add(L"f14", L"(16200000)/60000.0");
|
||||
add(L"f15", L"(5400000)/60000.0");
|
||||
add(L"f16", L"(0)/60000.0");
|
||||
add(L"f17", L"(5400000)/60000.0");
|
||||
add(L"f18", L"(5400000)/60000.0");
|
||||
add(L"f19", L"(5400000)/60000.0");
|
||||
//-----------------------------------------------------------------
|
||||
_handle h1;
|
||||
|
||||
h1.position = L"?f2 0";
|
||||
h1.x_maximum= L"50000";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -46,17 +46,17 @@ namespace odf_writer {
|
||||
|
||||
void draw_page_attr::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"draw:id", draw_id_);
|
||||
CP_XML_ATTR_OPT(L"draw:id", draw_id_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"draw:name", draw_name_);
|
||||
CP_XML_ATTR_OPT(L"draw:style-name", draw_style_name_);
|
||||
CP_XML_ATTR_OPT(L"draw:name", draw_name_);
|
||||
CP_XML_ATTR_OPT(L"draw:style-name", draw_style_name_);
|
||||
CP_XML_ATTR_OPT(L"draw:master-page-name", draw_master_page_name_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"presentation:presentation-page-layout-name", page_layout_name_);
|
||||
CP_XML_ATTR_OPT(L"draw:master-page-name", master_page_name_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"presentation:use-date-time-name", use_date_time_name_);
|
||||
CP_XML_ATTR_OPT(L"presentation:use-footer-name", use_footer_name_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"style:page-layout-name", style_page_layout_name_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"presentation:presentation-page-layout-name", presentation_page_layout_name_);
|
||||
CP_XML_ATTR_OPT(L"presentation:use-date-time-name", presentation_use_date_time_name_);
|
||||
CP_XML_ATTR_OPT(L"presentation:use-footer-name", presentation_use_footer_name_);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -85,7 +85,7 @@ void draw_page::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
draw_page_attr_.serialize(CP_GET_XML_NODE());
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
for (int i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->serialize(CP_XML_STREAM());
|
||||
@ -107,7 +107,7 @@ const wchar_t * presentation_footer_decl::name = L"footer-decl";
|
||||
// CP_XML_ATTR_OPT(L"presentation:name", presentation_name_);
|
||||
//}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------
|
||||
const wchar_t * presentation_date_time_decl::ns = L"presentation";
|
||||
const wchar_t * presentation_date_time_decl::name = L"date-time-decl";
|
||||
//
|
||||
@ -119,5 +119,33 @@ const wchar_t * presentation_date_time_decl::name = L"date-time-decl";
|
||||
//}
|
||||
//
|
||||
|
||||
//------------------------------------------------------
|
||||
const wchar_t * presentation_notes::ns = L"presentation";
|
||||
const wchar_t * presentation_notes::name = L"notes";
|
||||
|
||||
void presentation_notes::create_child_element( const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
void presentation_notes::add_child_element( const office_element_ptr & child_element)
|
||||
{
|
||||
content_.push_back(child_element);
|
||||
}
|
||||
|
||||
void presentation_notes::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
for (int i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,12 +54,13 @@ public:
|
||||
_CP_OPT(std::wstring) draw_name_;
|
||||
_CP_OPT(std::wstring) draw_id_;
|
||||
_CP_OPT(std::wstring) draw_style_name_;
|
||||
_CP_OPT(std::wstring) draw_master_page_name_;
|
||||
|
||||
_CP_OPT(std::wstring) page_layout_name_;
|
||||
_CP_OPT(std::wstring) master_page_name_;
|
||||
_CP_OPT(std::wstring) style_page_layout_name_;
|
||||
|
||||
_CP_OPT(std::wstring) use_footer_name_;
|
||||
_CP_OPT(std::wstring) use_date_time_name_;
|
||||
_CP_OPT(std::wstring) presentation_use_footer_name_;
|
||||
_CP_OPT(std::wstring) presentation_use_date_time_name_;
|
||||
_CP_OPT(std::wstring) presentation_page_layout_name_;
|
||||
};
|
||||
|
||||
class draw_page : public office_element_impl<draw_page>
|
||||
@ -79,7 +80,7 @@ public:
|
||||
office_element_ptr_array content_;
|
||||
office_element_ptr animation_;
|
||||
|
||||
draw_page_attr draw_page_attr_;
|
||||
draw_page_attr attlist_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_page);
|
||||
@ -127,6 +128,26 @@ public:
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(presentation_date_time_decl);
|
||||
//---------------------------------------------------------------------
|
||||
class presentation_notes : public office_element_impl<presentation_notes>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typePresentationNotes;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
office_element_ptr_array content_;
|
||||
draw_page_attr attlist_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(presentation_notes);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,7 +264,7 @@ public:
|
||||
bool is_footer_;
|
||||
bool is_header_;
|
||||
bool is_background_;
|
||||
_CP_OPT(bool) is_presentation_;
|
||||
_CP_OPT(int) is_presentation_;
|
||||
|
||||
void create_draw_base(int type);
|
||||
office_element_ptr create_draw_element(int type);
|
||||
@ -312,12 +312,12 @@ void odf_drawing_context::set_styles_context(odf_style_context* styles_context)
|
||||
impl_->styles_context_ = styles_context;
|
||||
}
|
||||
|
||||
void odf_drawing_context::set_presentation (bool bMaster)
|
||||
void odf_drawing_context::set_presentation (int type)
|
||||
{
|
||||
impl_->is_presentation_ = bMaster;
|
||||
impl_->is_presentation_ = type;
|
||||
}
|
||||
|
||||
_CP_OPT(bool) odf_drawing_context::get_presentation ()
|
||||
_CP_OPT(int) odf_drawing_context::get_presentation ()
|
||||
{
|
||||
return impl_->is_presentation_;
|
||||
}
|
||||
@ -500,8 +500,8 @@ void odf_drawing_context::end_drawing()
|
||||
if (impl_->current_drawing_state_.presentation_class_ || impl_->current_drawing_state_.presentation_placeholder_)
|
||||
{
|
||||
_CP_OPT(std::wstring) draw_layer;
|
||||
if (impl_->is_presentation_.get() == true)
|
||||
{//master
|
||||
if (impl_->is_presentation_.get() > 0)
|
||||
{//masters
|
||||
draw_layer = L"backgroundobjects";
|
||||
|
||||
if (!impl_->current_drawing_state_.presentation_class_)
|
||||
@ -958,7 +958,8 @@ void odf_drawing_context::end_shape()
|
||||
{
|
||||
oox_shape_ptr shape_define = oox_shape::create(impl_->current_drawing_state_.oox_shape_preset_);
|
||||
|
||||
if (!shape_define) shape_define = impl_->current_drawing_state_.oox_shape_;
|
||||
if (!shape_define)
|
||||
shape_define = impl_->current_drawing_state_.oox_shape_;
|
||||
|
||||
if (shape_define)
|
||||
{
|
||||
@ -1206,7 +1207,15 @@ void odf_drawing_context::set_placeholder_type (int val)
|
||||
|
||||
switch(val)
|
||||
{
|
||||
case 0: impl_->current_drawing_state_.presentation_class_ = presentation_class::outline; break;
|
||||
case 0:
|
||||
{
|
||||
if (impl_->is_presentation_ == 2) //notes master
|
||||
impl_->current_drawing_state_.presentation_class_ = presentation_class::notes;
|
||||
else if (impl_->is_presentation_ == 3) //handout master
|
||||
impl_->current_drawing_state_.presentation_class_ = presentation_class::handout;
|
||||
else
|
||||
impl_->current_drawing_state_.presentation_class_ = presentation_class::outline;
|
||||
}break;
|
||||
case 1: impl_->current_drawing_state_.presentation_class_ = presentation_class::chart; break;
|
||||
case 2: impl_->current_drawing_state_.presentation_class_ = presentation_class::graphic; break;
|
||||
case 3: impl_->current_drawing_state_.presentation_class_ = presentation_class::title; break;
|
||||
@ -1217,7 +1226,7 @@ void odf_drawing_context::set_placeholder_type (int val)
|
||||
case 8: impl_->current_drawing_state_.presentation_class_ = presentation_class::object; break;
|
||||
case 9: impl_->current_drawing_state_.presentation_class_ = presentation_class::object; break;
|
||||
case 10: impl_->current_drawing_state_.presentation_class_ = presentation_class::graphic; break;
|
||||
case 11: impl_->current_drawing_state_.presentation_class_ = presentation_class::graphic; break;
|
||||
case 11: impl_->current_drawing_state_.presentation_class_ = presentation_class::page; break;
|
||||
case 12: impl_->current_drawing_state_.presentation_class_ = presentation_class::page_number;break;
|
||||
case 13: impl_->current_drawing_state_.presentation_class_ = presentation_class::subtitle; break;
|
||||
case 14: impl_->current_drawing_state_.presentation_class_ = presentation_class::table; break;
|
||||
@ -2618,15 +2627,15 @@ void odf_drawing_context::set_gradient_angle(double angle)
|
||||
draw_gradient * gradient = dynamic_cast<draw_gradient *>(impl_->styles_context_->last_state(style_family::Gradient)->get_office_element().get());
|
||||
if (!gradient) return;
|
||||
|
||||
gradient->draw_angle_ = (270- angle) * 10;//(int)((360 - angle)/180. * 3.14159265358979323846);
|
||||
gradient->draw_angle_ = (270 - angle) * 10;//(int)((360 - angle)/180. * 3.14159265358979323846);
|
||||
}
|
||||
void odf_drawing_context::set_gradient_rect(double l, double t, double r,double b)
|
||||
void odf_drawing_context::set_gradient_rect(double l, double t, double r, double b)
|
||||
{
|
||||
draw_gradient * gradient = dynamic_cast<draw_gradient *>(impl_->styles_context_->last_state(style_family::Gradient)->get_office_element().get());
|
||||
if (!gradient) return;
|
||||
|
||||
gradient->draw_cy_ = percent((b-t)/2. + 50.);
|
||||
gradient->draw_cx_ = percent((r-l)/2. + 50.);
|
||||
gradient->draw_cy_ = percent((b - t)/2. + 50.);
|
||||
gradient->draw_cx_ = percent((r - l)/2. + 50.);
|
||||
}
|
||||
void odf_drawing_context::set_gradient_center(double cx, double cy)
|
||||
{
|
||||
|
||||
@ -60,8 +60,8 @@ public:
|
||||
odf_drawing_context (odf_conversion_context *odf_context);
|
||||
~odf_drawing_context ();
|
||||
|
||||
void set_presentation (bool bMaster);
|
||||
_CP_OPT(bool) get_presentation ();
|
||||
void set_presentation (int type);
|
||||
_CP_OPT(int) get_presentation ();
|
||||
|
||||
void set_drawings_rect (_CP_OPT(double) x_pt, _CP_OPT(double) y_pt, _CP_OPT(double) width_pt, _CP_OPT(double) height_pt);
|
||||
void clear ();
|
||||
|
||||
@ -584,7 +584,8 @@ void odf_page_layout_context::set_pages_mirrored(bool val)
|
||||
|
||||
style_page_layout_properties * odf_page_layout_context::get_properties()
|
||||
{
|
||||
if (layout_state_list_.size() < 1) return NULL;
|
||||
if (layout_state_list_.empty()) return NULL;
|
||||
|
||||
style_page_layout_properties * props = layout_state_list_.back().get_properties();
|
||||
if (props == NULL)
|
||||
{
|
||||
|
||||
@ -84,7 +84,7 @@ void odf_master_state::set_name(std::wstring & name)
|
||||
|
||||
if (!style_)return;
|
||||
|
||||
style_->style_master_page_attlist_.style_name_ = name;
|
||||
style_->attlist_.style_name_ = name;
|
||||
}
|
||||
void odf_master_state::set_display_name(std::wstring & name)
|
||||
{
|
||||
@ -92,7 +92,7 @@ void odf_master_state::set_display_name(std::wstring & name)
|
||||
|
||||
if (!style_)return;
|
||||
|
||||
style_->style_master_page_attlist_.style_display_name_ = name;
|
||||
style_->attlist_.style_display_name_ = name;
|
||||
}
|
||||
|
||||
void odf_master_state::set_layout_style_name(std::wstring name)
|
||||
@ -101,14 +101,14 @@ void odf_master_state::set_layout_style_name(std::wstring name)
|
||||
|
||||
if (!style_)return;
|
||||
|
||||
style_->style_master_page_attlist_.style_page_layout_name_ = name;
|
||||
style_->attlist_.style_page_layout_name_ = name;
|
||||
}
|
||||
std::wstring odf_master_state::get_name()
|
||||
{
|
||||
style_master_page* style_ = dynamic_cast<style_master_page*>(elements_[0].elm.get());
|
||||
if (!style_)return L"";
|
||||
|
||||
return style_->style_master_page_attlist_.style_name_.get_value_or(L"");
|
||||
return style_->attlist_.style_name_.get_value_or(L"");
|
||||
}
|
||||
void odf_master_state::add_footer(office_element_ptr & elm)
|
||||
{
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
|
||||
#include "odp_conversion_context.h"
|
||||
#include "office_presentation.h"
|
||||
#include "draw_page.h"
|
||||
|
||||
#include "styles.h"
|
||||
#include "style_table_properties.h"
|
||||
@ -95,7 +96,7 @@ void odp_conversion_context::start_slide()
|
||||
create_element(L"draw", L"page", root_presentation_->pages_, this);
|
||||
slide_context_.start_page(root_presentation_->pages_.back());
|
||||
|
||||
drawing_context()->set_presentation(false);
|
||||
drawing_context()->set_presentation(0);
|
||||
}
|
||||
void odp_conversion_context::end_slide()
|
||||
{
|
||||
@ -108,7 +109,7 @@ void odp_conversion_context::start_master_slide(std::wstring name)
|
||||
page_layout_context()->add_master_page(name);
|
||||
slide_context_.start_page(page_layout_context()->last_master()->get_root());
|
||||
|
||||
drawing_context()->set_presentation(true);
|
||||
drawing_context()->set_presentation(1);
|
||||
}
|
||||
void odp_conversion_context::end_master_slide()
|
||||
{
|
||||
@ -122,7 +123,7 @@ void odp_conversion_context::start_layout_slide()
|
||||
|
||||
slide_context_.start_page(elm);
|
||||
|
||||
drawing_context()->set_presentation(true);
|
||||
drawing_context()->set_presentation(1);
|
||||
}
|
||||
void odp_conversion_context::end_layout_slide()
|
||||
{
|
||||
@ -147,7 +148,28 @@ void odp_conversion_context::end_drawings()
|
||||
{
|
||||
current_slide().drawing_context()->clear();
|
||||
}
|
||||
void odp_conversion_context::start_note(bool bMaster)
|
||||
{
|
||||
office_element_ptr note_elm;
|
||||
create_element(L"presentation", L"notes", note_elm, this);
|
||||
|
||||
current_slide().drawing_context()->start_drawing();
|
||||
current_slide().drawing_context()->start_element(note_elm);
|
||||
|
||||
slide_context_.start_page(note_elm);
|
||||
|
||||
if (bMaster)
|
||||
{
|
||||
page_layout_context()->create_layout_page();
|
||||
|
||||
odf_writer::presentation_notes* notes = dynamic_cast<odf_writer::presentation_notes*>(note_elm.get());
|
||||
notes->attlist_.style_page_layout_name_ = page_layout_context()->last_layout()->get_name();
|
||||
|
||||
drawing_context()->set_presentation(2);
|
||||
}
|
||||
else
|
||||
drawing_context()->set_presentation(0);
|
||||
}
|
||||
void odp_conversion_context::start_comment(int oox_comm_id)
|
||||
{
|
||||
office_element_ptr comm_elm;
|
||||
@ -182,6 +204,15 @@ void odp_conversion_context::end_comment()
|
||||
current_slide().drawing_context()->end_element();
|
||||
current_slide().drawing_context()->end_drawing();
|
||||
}
|
||||
void odp_conversion_context::end_note()
|
||||
{
|
||||
slide_context_.end_page();
|
||||
|
||||
slide_context_.remove_page();
|
||||
|
||||
current_slide().drawing_context()->end_element();
|
||||
current_slide().drawing_context()->end_drawing();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,6 +77,9 @@ public:
|
||||
void start_comment_content ();
|
||||
void end_comment_content ();
|
||||
|
||||
void start_note(bool bMaster = false);
|
||||
void end_note();
|
||||
|
||||
private:
|
||||
odp_slide_context slide_context_;
|
||||
|
||||
|
||||
@ -72,12 +72,12 @@ void odp_page_state::set_page_name(std::wstring name)
|
||||
|
||||
draw_page* page = dynamic_cast<draw_page*>(page_elm_.get());
|
||||
if (page)
|
||||
page->draw_page_attr_.draw_name_ = name;
|
||||
page->attlist_.draw_name_ = name;
|
||||
else
|
||||
{
|
||||
//style_master_page *master_page = dynamic_cast<style_master_page*>(page_elm_.get());
|
||||
//if (master_page)
|
||||
// master_page->style_master_page_attlist_.style_display_name_ = name;
|
||||
// master_page->attlist_.style_display_name_ = name;
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ void odp_page_state::set_layout_page(std::wstring name)
|
||||
draw_page* page = dynamic_cast<draw_page*>(page_elm_.get());
|
||||
if (page == NULL)return;
|
||||
|
||||
page->draw_page_attr_.page_layout_name_ = name;
|
||||
page->attlist_.presentation_page_layout_name_ = name;
|
||||
}
|
||||
|
||||
void odp_page_state::set_master_page(std::wstring name)
|
||||
@ -98,7 +98,7 @@ void odp_page_state::set_master_page(std::wstring name)
|
||||
draw_page* page = dynamic_cast<draw_page*>(page_elm_.get());
|
||||
if (page == NULL)return;
|
||||
|
||||
page->draw_page_attr_.master_page_name_ = name;
|
||||
page->attlist_.draw_master_page_name_ = name;
|
||||
}
|
||||
|
||||
void odp_page_state::set_page_style(office_element_ptr & elm)
|
||||
@ -111,12 +111,18 @@ void odp_page_state::set_page_style(office_element_ptr & elm)
|
||||
|
||||
draw_page* page = dynamic_cast<draw_page*>(page_elm_.get());
|
||||
if (page)
|
||||
page->draw_page_attr_.draw_style_name_ = office_page_style_->style_name_;
|
||||
page->attlist_.draw_style_name_ = office_page_style_->style_name_;
|
||||
else
|
||||
{
|
||||
style_master_page *master_page = dynamic_cast<style_master_page*>(page_elm_.get());
|
||||
if (master_page)
|
||||
master_page->style_master_page_attlist_.draw_style_name_ = office_page_style_->style_name_;
|
||||
master_page->attlist_.draw_style_name_ = office_page_style_->style_name_;
|
||||
else
|
||||
{
|
||||
presentation_notes* notes = dynamic_cast<presentation_notes*>(page_elm_.get());
|
||||
if (notes)
|
||||
notes->attlist_.draw_style_name_ = office_page_style_->style_name_;
|
||||
}
|
||||
}
|
||||
}
|
||||
void odp_page_state::add_child_element( const office_element_ptr & child_element)
|
||||
|
||||
@ -44,8 +44,9 @@ namespace cpdoccore {
|
||||
|
||||
namespace odf_writer {
|
||||
|
||||
odp_slide_context::odp_slide_context(odp_conversion_context & Context): context_(Context), table_context_(&Context), comment_context_(&Context)
|
||||
odp_slide_context::odp_slide_context(odp_conversion_context & Context) : context_(Context), table_context_(&Context), comment_context_(&Context)
|
||||
{
|
||||
count_slides_ = 0;
|
||||
styles_context_ = Context.styles_context();
|
||||
}
|
||||
void odp_slide_context::set_styles_context(odf_style_context* styles_context)
|
||||
@ -67,17 +68,13 @@ void odp_slide_context::start_page(office_element_ptr & elm)
|
||||
{
|
||||
page_state_list_.push_back( odp_page_state(&context_, elm) );
|
||||
|
||||
std::wstring style_name_new = L"dp" + boost::lexical_cast<std::wstring>(page_state_list_.size());
|
||||
std::wstring style_name_new = L"dp" + std::to_wstring(++count_slides_);
|
||||
|
||||
office_element_ptr & style = styles_context_->add_or_find(style_name_new, style_family::DrawingPage, true);
|
||||
style->create_child_element(L"style", L"drawing-page-properties");
|
||||
|
||||
state().set_page_style(style);
|
||||
state().drawing_context()->set_styles_context(styles_context_);
|
||||
|
||||
//для свойств страницы, а не таблицы - нужно создать master-page c page layout и связать по имени со стилем таблицы
|
||||
//причем здесь, т.к. с другой стороны это ВСЕ еще свойства листа. то есть совйства листа разделить на свйства страницы и таблицы ..
|
||||
//todooo
|
||||
//????
|
||||
}
|
||||
|
||||
void odp_slide_context::end_page()
|
||||
@ -85,6 +82,11 @@ void odp_slide_context::end_page()
|
||||
state().drawing_context()->finalize(state().page_elm_);
|
||||
}
|
||||
|
||||
void odp_slide_context::remove_page()
|
||||
{
|
||||
page_state_list_.pop_back();
|
||||
}
|
||||
|
||||
odf_table_context* odp_slide_context::table_context()
|
||||
{
|
||||
return &table_context_;
|
||||
|
||||
@ -53,6 +53,8 @@ public:
|
||||
void start_page (office_element_ptr & elm);
|
||||
void end_page ();
|
||||
|
||||
void remove_page();
|
||||
|
||||
void set_styles_context(odf_style_context* styles_context);
|
||||
odf_style_context* get_styles_context();
|
||||
|
||||
@ -81,6 +83,7 @@ private:
|
||||
odf_comment_context comment_context_;
|
||||
|
||||
std::list<odp_page_state> page_state_list_;
|
||||
int count_slides_;
|
||||
|
||||
friend class odp_conversion_context;
|
||||
|
||||
|
||||
@ -157,8 +157,6 @@ enum ElementType
|
||||
typeStylePresentationPlaceholder,
|
||||
typeStyleDrawingPageProperties,
|
||||
|
||||
typePresentationNotes,
|
||||
|
||||
typeStyleColumns,
|
||||
typeStyleColumn,
|
||||
typeStyleColumnSep,
|
||||
@ -264,6 +262,7 @@ enum ElementType
|
||||
typeDrawPage,
|
||||
typePresentationFooterDecl,
|
||||
typePresentationDateTimeDecl,
|
||||
typePresentationNotes,
|
||||
|
||||
typeAnimPar,
|
||||
typeAnimSeq,
|
||||
|
||||
@ -44,6 +44,8 @@
|
||||
#include "Shapes/oox_shapeConnectors.h"
|
||||
#include "Shapes/oox_shapeWordArt.h"
|
||||
#include "Shapes/oox_shapeCurvedArrows.h"
|
||||
#include "Shapes/oox_shapeCallouts.h"
|
||||
#include "Shapes/oox_shapeBents.h"
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/Common/SimpleTypes_Drawing.h"
|
||||
|
||||
@ -61,7 +63,12 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
|
||||
{
|
||||
case SimpleTypes::shapetypeMathMultiply: return boost::make_shared<oox_shape_mathMultiply>();
|
||||
case SimpleTypes::shapetypeMathEqual: return boost::make_shared<oox_shape_mathEqual>();
|
||||
case SimpleTypes::shapetypeSun: return boost::make_shared<oox_shape_sun>();
|
||||
case SimpleTypes::shapetypeMathPlus: return boost::make_shared<oox_shape_mathPlus>();
|
||||
case SimpleTypes::shapetypeMathNotEqual: return boost::make_shared<oox_shape_mathNotEqual>();
|
||||
case SimpleTypes::shapetypeMathDivide: return boost::make_shared<oox_shape_mathDivide>();
|
||||
case SimpleTypes::shapetypeMathMinus: return boost::make_shared<oox_shape_mathMinus>();
|
||||
|
||||
case SimpleTypes::shapetypeRoundRect: return boost::make_shared<oox_shape_roundRect>();
|
||||
case SimpleTypes::shapetypeRound1Rect: return boost::make_shared<oox_shape_round1Rect>();
|
||||
case SimpleTypes::shapetypeRound2DiagRect: return boost::make_shared<oox_shape_round2DiagRect>();
|
||||
case SimpleTypes::shapetypeRound2SameRect: return boost::make_shared<oox_shape_round2SameRect>();
|
||||
@ -69,23 +76,46 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
|
||||
case SimpleTypes::shapetypeSnip2DiagRect: return boost::make_shared<oox_shape_snip2DiagRect>();
|
||||
case SimpleTypes::shapetypeSnip2SameRect: return boost::make_shared<oox_shape_snip2SameRect>();
|
||||
case SimpleTypes::shapetypeSnipRoundRect: return boost::make_shared<oox_shape_snipRoundRect>();
|
||||
|
||||
case SimpleTypes::shapetypeStar6: return boost::make_shared<oox_shape_star6>();
|
||||
case SimpleTypes::shapetypeStar7: return boost::make_shared<oox_shape_star7>();
|
||||
case SimpleTypes::shapetypeStar10: return boost::make_shared<oox_shape_star10>();
|
||||
case SimpleTypes::shapetypeStar12: return boost::make_shared<oox_shape_star12>();
|
||||
case SimpleTypes::shapetypeStar16: return boost::make_shared<oox_shape_star16>();
|
||||
case SimpleTypes::shapetypeStar32: return boost::make_shared<oox_shape_star32>();
|
||||
case SimpleTypes::shapetypeSun: return boost::make_shared<oox_shape_sun>();
|
||||
|
||||
case SimpleTypes::shapetypeCircularArrow: return boost::make_shared<oox_shape_CircularArrow>();
|
||||
case SimpleTypes::shapetypeCurvedLeftArrow: return boost::make_shared<oox_shape_CurvedLeftArrow>();
|
||||
case SimpleTypes::shapetypeCurvedRightArrow: return boost::make_shared<oox_shape_CurvedRightArrow>();
|
||||
case SimpleTypes::shapetypeCurvedDownArrow: return boost::make_shared<oox_shape_CurvedDownArrow>();
|
||||
case SimpleTypes::shapetypeLeftCircularArrow: return boost::make_shared<oox_shape_LeftCircularArrow>();
|
||||
case SimpleTypes::shapetypeSwooshArrow: return boost::make_shared<oox_shape_SwooshArrow>();
|
||||
case SimpleTypes::shapetypeLeftArrow: return boost::make_shared<oox_shape_LeftArrow>();
|
||||
case SimpleTypes::shapetypeLeftRightArrow: return boost::make_shared<oox_shape_LeftRightArrow>();
|
||||
case SimpleTypes::shapetypeLeftUpArrow: return boost::make_shared<oox_shape_LeftUpArrow>();
|
||||
case SimpleTypes::shapetypeUpDownArrow: return boost::make_shared<oox_shape_UpDownArrow>();
|
||||
case SimpleTypes::shapetypeRightArrow: return boost::make_shared<oox_shape_RightArrow>();
|
||||
case SimpleTypes::shapetypeDownArrow: return boost::make_shared<oox_shape_DownArrow>();
|
||||
case SimpleTypes::shapetypeUpArrow: return boost::make_shared<oox_shape_UpArrow>();
|
||||
case SimpleTypes::shapetypeNotchedRightArrow: return boost::make_shared<oox_shape_NotchedRightArrow>();
|
||||
|
||||
case SimpleTypes::shapetypeFunnel: return boost::make_shared<oox_shape_Funnel>();
|
||||
case SimpleTypes::shapetypeGear6: return boost::make_shared<oox_shape_Gear6>();
|
||||
case SimpleTypes::shapetypeGear9: return boost::make_shared<oox_shape_Gear9>();
|
||||
case SimpleTypes::shapetypeCircularArrow: return boost::make_shared<oox_shape_CircularArrow>();
|
||||
case SimpleTypes::shapetypeCurvedLeftArrow: return boost::make_shared<oox_shape_curvedLeftArrow>();
|
||||
case SimpleTypes::shapetypeCurvedDownArrow: return boost::make_shared<oox_shape_curvedDownArrow>();
|
||||
case SimpleTypes::shapetypeLeftCircularArrow: return boost::make_shared<oox_shape_LeftCircularArrow>();
|
||||
case SimpleTypes::shapetypeSwooshArrow: return boost::make_shared<oox_shape_SwooshArrow>();
|
||||
case SimpleTypes::shapetypeBlockArc: return boost::make_shared<oox_shape_BlockArc>();
|
||||
case SimpleTypes::shapetypeCorner: return boost::make_shared<oox_shape_Corner>();
|
||||
case SimpleTypes::shapetypeChord: return boost::make_shared<oox_shape_Chord>();
|
||||
case SimpleTypes::shapetypeChevron: return boost::make_shared<oox_shape_Chevron>();
|
||||
case SimpleTypes::shapetypeHomePlate: return boost::make_shared<oox_shape_HomePlate>();
|
||||
case SimpleTypes::shapetypeBevel: return boost::make_shared<oox_shape_Bevel>();
|
||||
case SimpleTypes::shapetypeArc: return boost::make_shared<oox_shape_Arc>();
|
||||
case SimpleTypes::shapetypeTrapezoid: return boost::make_shared<oox_shape_Trapezoid>();
|
||||
case SimpleTypes::shapetypeTriangle: return boost::make_shared<oox_shape_Triangle>();
|
||||
case SimpleTypes::shapetypeRtTriangle: return boost::make_shared<oox_shape_RtTriangle>();
|
||||
case SimpleTypes::shapetypeParallelogram: return boost::make_shared<oox_shape_Parallelogram>();
|
||||
case SimpleTypes::shapetypeDiamond: return boost::make_shared<oox_shape_Diamond>();
|
||||
case SimpleTypes::shapetypePlus: return boost::make_shared<oox_shape_Plus>();
|
||||
|
||||
case SimpleTypes::shapetypePlaque: return boost::make_shared<oox_shape_Plaque>();
|
||||
case SimpleTypes::shapetypeDoubleWave: return boost::make_shared<oox_shape_DoubleWave>();
|
||||
@ -93,7 +123,15 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
|
||||
case SimpleTypes::shapetypePie: return boost::make_shared<oox_shape_Pie>();
|
||||
case SimpleTypes::shapetypeDonut: return boost::make_shared<oox_shape_Donut>();
|
||||
case SimpleTypes::shapetypeLeftRightRibbon: return boost::make_shared<oox_shape_LeftRightRibbon>();
|
||||
|
||||
|
||||
case SimpleTypes::shapetypeFlowChartExtract: return boost::make_shared<oox_shape_FlowChartExtract>();
|
||||
|
||||
case SimpleTypes::shapetypeLeftArrowCallout: return boost::make_shared<oox_shape_LeftArrowCallout>();
|
||||
case SimpleTypes::shapetypeRightArrowCallout: return boost::make_shared<oox_shape_RightArrowCallout>();
|
||||
case SimpleTypes::shapetypeUpArrowCallout: return boost::make_shared<oox_shape_UpArrowCallout>();
|
||||
case SimpleTypes::shapetypeDownArrowCallout: return boost::make_shared<oox_shape_DownArrowCallout>();
|
||||
|
||||
case SimpleTypes::shapetypeBentUpArrow: return boost::make_shared<oox_shape_BentUpArrow>();
|
||||
|
||||
//case (2001 + SimpleTypes::textshapetypeTextArchDown):
|
||||
//case (2001 + SimpleTypes::textshapetypeTextArchDownPour):
|
||||
|
||||
@ -1270,7 +1270,7 @@ void style_master_page::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
style_master_page_attlist_.serialize( CP_GET_XML_NODE());
|
||||
attlist_.serialize( CP_GET_XML_NODE());
|
||||
|
||||
if (style_footer_) style_footer_->serialize(CP_XML_STREAM());
|
||||
if (style_header_) style_header_->serialize(CP_XML_STREAM());
|
||||
|
||||
@ -505,7 +505,7 @@ public:
|
||||
|
||||
int find_placeHolderIndex(odf_types::presentation_class::type placeHolder,int & last_idx);
|
||||
|
||||
style_master_page_attlist style_master_page_attlist_;
|
||||
style_master_page_attlist attlist_;
|
||||
|
||||
office_element_ptr style_header_;
|
||||
office_element_ptr style_header_left_;
|
||||
|
||||
@ -437,8 +437,6 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape)
|
||||
{
|
||||
if (oox_shape == NULL) return;
|
||||
|
||||
_CP_OPT(bool) bMasterPresentation = odf_context()->drawing_context()->get_presentation();
|
||||
|
||||
if (oox_shape->txXfrm.IsInit())
|
||||
{
|
||||
odf_context()->drawing_context()->start_group();
|
||||
@ -856,10 +854,10 @@ void OoxConverter::convert(PPTX::Logic::GradFill *oox_grad_fill, DWORD nARGB)
|
||||
}
|
||||
if (oox_grad_fill->path->rect.IsInit())
|
||||
{
|
||||
odf_context()->drawing_context()->set_gradient_rect( XmlUtils::GetInteger(oox_grad_fill->path->rect->l.get_value_or(L"")),
|
||||
XmlUtils::GetInteger(oox_grad_fill->path->rect->t.get_value_or(L"")),
|
||||
XmlUtils::GetInteger(oox_grad_fill->path->rect->r.get_value_or(L"")),
|
||||
XmlUtils::GetInteger(oox_grad_fill->path->rect->b.get_value_or(L"")));
|
||||
odf_context()->drawing_context()->set_gradient_rect( XmlUtils::GetInteger(oox_grad_fill->path->rect->l.get_value_or(L"")) / 1000.,
|
||||
XmlUtils::GetInteger(oox_grad_fill->path->rect->t.get_value_or(L"")) / 1000.,
|
||||
XmlUtils::GetInteger(oox_grad_fill->path->rect->r.get_value_or(L"")) / 1000.,
|
||||
XmlUtils::GetInteger(oox_grad_fill->path->rect->b.get_value_or(L"")) / 1000.);
|
||||
}
|
||||
}
|
||||
odf_context()->drawing_context()->set_gradient_type(grad_style);
|
||||
@ -1424,9 +1422,9 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T
|
||||
|
||||
if (list_local)
|
||||
{
|
||||
_CP_OPT(bool) inStyles = odf_context()->drawing_context()->get_presentation();
|
||||
_CP_OPT(int) inStyles = odf_context()->drawing_context()->get_presentation();
|
||||
|
||||
odf_context()->styles_context()->lists_styles().start_style(inStyles && *inStyles);
|
||||
odf_context()->styles_context()->lists_styles().start_style(inStyles && *inStyles > 0);
|
||||
convert_list_level(oox_paragraph->pPr.GetPointer(), list_level /*- 1*/);
|
||||
odf_context()->styles_context()->lists_styles().end_style();
|
||||
|
||||
@ -1528,13 +1526,13 @@ void OoxConverter::convert(PPTX::Logic::TextParagraphPr *oox_paragraph_pr , odf_
|
||||
{
|
||||
paragraph_properties->content_.fo_text_indent_ = odf_types::length_or_percent(odf_types::length(oox_paragraph_pr->indent.get() / 12700., odf_types::length::pt));
|
||||
}
|
||||
if (oox_paragraph_pr->rtl.IsInit())
|
||||
if (oox_paragraph_pr->rtl.IsInit() && *oox_paragraph_pr->rtl)
|
||||
{
|
||||
paragraph_properties->content_.style_writing_mode_= odf_types::writing_mode(odf_types::writing_mode::RlTb);
|
||||
}
|
||||
}
|
||||
//nullable<SimpleTypes::CDecimalNumber<> > m_oLvl;
|
||||
//nullable<SimpleTypes::CCoordinate32<> > m_oDefTabSz;
|
||||
//nullable<SimpleTypes::CTextFontAlignType<>> m_oFontAlgn;
|
||||
//defTabSz;
|
||||
//fontAlgn;
|
||||
|
||||
if (oox_paragraph_pr->defRPr.IsInit())
|
||||
{
|
||||
@ -1571,7 +1569,7 @@ void OoxConverter::convert(PPTX::Logic::RunProperties *oox_run_pr, odf_writer::s
|
||||
|
||||
//------------------------------------------------------
|
||||
odf_writer::odf_drawing_context *drawing = odf_context()->drawing_context();
|
||||
if (drawing) //from styles impossible(
|
||||
if (drawing) //from styles drawing impossible( ... todoooo ???
|
||||
{
|
||||
if ((oox_run_pr->Fill.is<PPTX::Logic::GradFill>()) ||
|
||||
((oox_run_pr->ln.IsInit()) && (oox_run_pr->ln->Fill.is_init() && oox_run_pr->ln->Fill.getType() != OOX::et_a_noFill)))
|
||||
@ -1709,37 +1707,99 @@ void OoxConverter::convert(PPTX::Logic::RunProperties *oox_run_pr, odf_writer::s
|
||||
{
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style (odf_types::line_style::Solid);
|
||||
text_properties->content_.style_text_underline_type_ = odf_types::line_type (odf_types::line_type::Single);
|
||||
|
||||
|
||||
switch(oox_run_pr->u->GetBYTECode())
|
||||
{
|
||||
case SimpleTypes::underlineNone :
|
||||
text_properties->content_.style_text_underline_type_= odf_types::line_type(odf_types::line_type::None);break;
|
||||
case SimpleTypes::underlineDash :
|
||||
case SimpleTypes::underlineDashedHeavy:
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Dash);break;
|
||||
case SimpleTypes::underlineDotDash :
|
||||
case SimpleTypes::underlineDashDotHeavy:
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::DotDash);break;
|
||||
case SimpleTypes::underlineDashLong:
|
||||
case SimpleTypes::underlineDashLongHeavy:
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::LongDash);break;
|
||||
case SimpleTypes::underlineDotDotDash:
|
||||
case SimpleTypes::underlineDashDotDotHeavy :
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::DotDotDash);break;
|
||||
case SimpleTypes::underlineDotted:
|
||||
case SimpleTypes::underlineDottedHeavy:
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Dotted);break;
|
||||
case SimpleTypes::underlineWave :
|
||||
case SimpleTypes::underlineWavyHeavy :
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Wave);break;
|
||||
case SimpleTypes::underlineDouble :
|
||||
case SimpleTypes::underlineThick :
|
||||
text_properties->content_.style_text_underline_type_= odf_types::line_type(odf_types::line_type::Double);break;
|
||||
case SimpleTypes::underlineWavyDouble :
|
||||
text_properties->content_.style_text_underline_type_= odf_types::line_type(odf_types::line_type::Double);
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Wave);break;
|
||||
case 12:
|
||||
text_properties->content_.style_text_underline_style_ = boost::none;
|
||||
text_properties->content_.style_text_underline_type_ = odf_types::line_type(odf_types::line_type::None);break;
|
||||
case 0:
|
||||
case 1:
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Dash);break;
|
||||
case 5:
|
||||
case 6:
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::DotDash);break;
|
||||
case 2:
|
||||
case 3:
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::LongDash);break;
|
||||
case 7:
|
||||
case 8:
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::DotDotDash);break;
|
||||
case 9:
|
||||
case 10:
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Dotted);break;
|
||||
case 14:
|
||||
case 16:
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Wave);break;
|
||||
case 4:
|
||||
text_properties->content_.style_text_underline_type_ = odf_types::line_type(odf_types::line_type::Double);break;
|
||||
case 15:
|
||||
text_properties->content_.style_text_underline_type_ = odf_types::line_type(odf_types::line_type::Double);
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Wave);break;
|
||||
}
|
||||
PPTX::Logic::UniFill *fill = NULL;
|
||||
if (oox_run_pr->uFillTx.IsInit()) fill = &oox_run_pr->uFillTx->Fill;
|
||||
else if (oox_run_pr->uFill.IsInit()) fill = &oox_run_pr->uFill->Fill;
|
||||
if (fill && fill->is<PPTX::Logic::SolidFill>() )
|
||||
{
|
||||
PPTX::Logic::SolidFill &solid = fill->as<PPTX::Logic::SolidFill>();
|
||||
|
||||
_CP_OPT(double) opacityText;
|
||||
std::wstring hexColorText;
|
||||
convert(&solid.Color, hexColorText, opacityText);
|
||||
if (!hexColorText.empty())
|
||||
{
|
||||
text_properties->content_.style_text_underline_color_ = odf_types::color(hexColorText);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (oox_run_pr->highlight.IsInit())
|
||||
{
|
||||
_CP_OPT(double) opacityText;
|
||||
std::wstring hexColorText;
|
||||
convert(&oox_run_pr->highlight->Color, hexColorText, opacityText);
|
||||
|
||||
text_properties->content_.fo_background_color_ = odf_types::color(hexColorText);
|
||||
}
|
||||
|
||||
if (oox_run_pr->strike.IsInit())
|
||||
{
|
||||
switch(oox_run_pr->strike->GetBYTECode())
|
||||
{
|
||||
case 0:
|
||||
text_properties->content_.style_text_line_through_style_ = odf_types::line_style (odf_types::line_style::Solid);
|
||||
text_properties->content_.style_text_line_through_type_ = odf_types::line_type(odf_types::line_type::Double); break;
|
||||
case 1:
|
||||
text_properties->content_.style_text_line_through_style_ = boost::none;
|
||||
text_properties->content_.style_text_line_through_type_ = odf_types::line_type(odf_types::line_type::None); break;
|
||||
case 2:
|
||||
text_properties->content_.style_text_line_through_style_ = odf_types::line_style (odf_types::line_style::Solid);
|
||||
text_properties->content_.style_text_line_through_type_ = odf_types::line_type(odf_types::line_type::Single); break;
|
||||
}
|
||||
}
|
||||
|
||||
if (oox_run_pr->baseline.IsInit())
|
||||
{
|
||||
text_properties->content_.style_text_position_ = odf_types::text_position(*oox_run_pr->baseline / 1000.);
|
||||
}
|
||||
if (oox_run_pr->cap.IsInit())
|
||||
{
|
||||
switch(oox_run_pr->cap->GetBYTECode())
|
||||
{
|
||||
case 0:
|
||||
text_properties->content_.fo_text_transform_ = odf_types::text_transform(odf_types::text_transform::Uppercase); break;
|
||||
case 1:
|
||||
text_properties->content_.fo_font_variant_ = odf_types::font_variant(odf_types::font_variant::SmallCaps); break;
|
||||
case 2:
|
||||
text_properties->content_.fo_font_variant_ = odf_types::font_variant(odf_types::font_variant::Normal); break;
|
||||
}
|
||||
|
||||
}
|
||||
if (oox_run_pr->normalizeH.IsInit() && *oox_run_pr->normalizeH)
|
||||
{
|
||||
text_properties->content_.fo_text_transform_ = odf_types::text_transform(odf_types::text_transform::Capitalize);
|
||||
}
|
||||
|
||||
}
|
||||
void OoxConverter::convert(PPTX::Logic::Run *oox_run)
|
||||
{
|
||||
@ -1763,9 +1823,27 @@ void OoxConverter::convert(PPTX::Logic::Run *oox_run)
|
||||
|
||||
if ((oox_run->rPr.IsInit()) && (oox_run->rPr->hlinkClick.IsInit()) && (oox_run->rPr->hlinkClick->id.IsInit()))
|
||||
{
|
||||
odf_writer::style_text_properties * text_properties = odf_context()->text_context()->get_text_properties();
|
||||
|
||||
if (!text_properties->content_.fo_color_)
|
||||
{
|
||||
PPTX::Logic::UniColor colorLink;
|
||||
colorLink.Color.reset(new PPTX::Logic::SchemeClr());
|
||||
|
||||
PPTX::Logic::SchemeClr & clr = colorLink.as<PPTX::Logic::SchemeClr>();
|
||||
clr.val.set(L"hlink");
|
||||
|
||||
std::wstring strHexColor;
|
||||
_CP_OPT(double) opacity;
|
||||
convert(&colorLink, strHexColor, opacity);
|
||||
if (!strHexColor.empty())
|
||||
text_properties->content_.fo_color_ = strHexColor;
|
||||
}
|
||||
text_properties->content_.style_text_underline_type_ = odf_types::line_type::Single;
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style::Solid;
|
||||
|
||||
std::wstring hlink = find_link_by_id(oox_run->rPr->hlinkClick->id.get(), 2);
|
||||
odf_context()->text_context()->add_hyperlink(hlink, oox_run->GetText());
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1846,9 +1924,9 @@ void OoxConverter::convert(PPTX::Logic::TextListStyle *oox_list_style)
|
||||
if (!oox_list_style) return;
|
||||
if (oox_list_style->IsListStyleEmpty()) return;
|
||||
|
||||
_CP_OPT(bool) inStyles = odf_context()->drawing_context()->get_presentation();
|
||||
_CP_OPT(int) inStyles = odf_context()->drawing_context()->get_presentation();
|
||||
|
||||
odf_context()->styles_context()->lists_styles().start_style(inStyles && *inStyles);
|
||||
odf_context()->styles_context()->lists_styles().start_style(inStyles && *inStyles > 0); // masters
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
OoxConverter::convert_list_level(oox_list_style->levels[i].GetPointer(), i);
|
||||
@ -1867,17 +1945,17 @@ void OoxConverter::convert(PPTX::Logic::TxBody *oox_txBody, PPTX::Logic::ShapeSt
|
||||
for (size_t i = 0; i < oox_txBody->Paragrs.size(); i++)
|
||||
{
|
||||
convert(&oox_txBody->Paragrs[i], oox_txBody->lstStyle.GetPointer());
|
||||
|
||||
//внешние настройки для текста
|
||||
convert(oox_txBody->bodyPr.GetPointer());
|
||||
|
||||
if (oox_style)
|
||||
{
|
||||
convert(&oox_style->fontRef);
|
||||
}
|
||||
}
|
||||
odf_context()->drawing_context()->set_text( odf_context()->text_context());
|
||||
|
||||
//внешние настройки для текста
|
||||
|
||||
convert(oox_txBody->bodyPr.GetPointer());
|
||||
|
||||
if (oox_style)
|
||||
{
|
||||
convert(&oox_style->fontRef);
|
||||
}
|
||||
odf_context()->end_text_context();
|
||||
}
|
||||
void OoxConverter::convert(PPTX::Logic::ArcTo *oox_geom_path)
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Folder.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Presentation.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Slide.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/NotesMaster.h"
|
||||
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Table/Table.h"
|
||||
|
||||
@ -359,7 +360,14 @@ void PptxConverter::convert_slides()
|
||||
current_clrMap = slide->Layout->clrMapOvr->overrideClrMapping.GetPointer();
|
||||
current_slide = slide->Layout.operator->();
|
||||
|
||||
convert_slide(&slide->Layout->cSld, current_txStyles, true, bShowLayoutMasterSp);
|
||||
convert_slide(&slide->Layout->cSld, current_txStyles, true, bShowLayoutMasterSp);
|
||||
|
||||
if (!presentation->notesMasterIdLst.empty())
|
||||
{
|
||||
rId = presentation->notesMasterIdLst[0].rid.get();
|
||||
smart_ptr<PPTX::NotesMaster> notes_master = ((*presentation)[rId]).smart_dynamic_cast<PPTX::NotesMaster>();
|
||||
convert(notes_master.operator->());
|
||||
}
|
||||
//add note master
|
||||
odp_context->end_master_slide();
|
||||
|
||||
@ -409,9 +417,67 @@ void PptxConverter::convert_slides()
|
||||
odp_context->end_slide();
|
||||
}
|
||||
}
|
||||
void PptxConverter::convert(PPTX::NotesSlide *oox_note)
|
||||
void PptxConverter::convert(PPTX::NotesMaster *oox_notes)
|
||||
{
|
||||
if (!oox_note) return;
|
||||
if (!oox_notes) return;
|
||||
|
||||
odp_context->start_note(true);
|
||||
|
||||
PPTX::Theme* old_theme = current_theme;
|
||||
PPTX::Logic::ClrMap* old_clrMap = current_clrMap;
|
||||
|
||||
current_theme = oox_notes->theme_.operator->();
|
||||
current_clrMap = &oox_notes->clrMap;
|
||||
|
||||
current_slide = dynamic_cast<OOX::IFileContainer*>(oox_notes);
|
||||
//PPTX::Logic::TxStyles* current_txStyles = oox_notes->notesStyle.GetPointer();
|
||||
|
||||
if (presentation->notesSz.IsInit())
|
||||
{
|
||||
_CP_OPT(odf_types::length) width = odf_types::length(presentation->notesSz->cx / 12700., odf_types::length::pt);
|
||||
_CP_OPT(odf_types::length) height = odf_types::length(presentation->notesSz->cy / 12700., odf_types::length::pt);
|
||||
|
||||
odf_context()->page_layout_context()->set_page_size(width, height);
|
||||
}
|
||||
convert_slide(&oox_notes->cSld, NULL, true, true);
|
||||
|
||||
odp_context->end_note();
|
||||
|
||||
current_clrMap = old_clrMap;
|
||||
current_theme = old_theme;
|
||||
}
|
||||
void PptxConverter::convert(PPTX::NotesSlide *oox_notes)
|
||||
{
|
||||
if (!oox_notes) return;
|
||||
|
||||
PPTX::Theme* old_theme = current_theme;
|
||||
PPTX::Logic::ClrMap* old_clrMap = current_clrMap;
|
||||
|
||||
smart_ptr<PPTX::NotesMaster> notes_master;
|
||||
if (!presentation->notesMasterIdLst.empty())
|
||||
{
|
||||
std::wstring rId = presentation->notesMasterIdLst[0].rid.get();
|
||||
notes_master = ((*presentation)[rId]).smart_dynamic_cast<PPTX::NotesMaster>();
|
||||
}
|
||||
odp_context->start_note();
|
||||
|
||||
if (notes_master.IsInit())
|
||||
{
|
||||
current_theme = notes_master->theme_.operator->();
|
||||
current_clrMap = ¬es_master->clrMap;
|
||||
}
|
||||
|
||||
current_slide = dynamic_cast<OOX::IFileContainer*>(oox_notes);
|
||||
|
||||
if (oox_notes->clrMapOvr.IsInit() && oox_notes->clrMapOvr->overrideClrMapping.IsInit())
|
||||
current_clrMap = oox_notes->clrMapOvr->overrideClrMapping.GetPointer();
|
||||
|
||||
convert_slide(&oox_notes->cSld, NULL, true, true);
|
||||
|
||||
odp_context->end_note();
|
||||
|
||||
current_clrMap = old_clrMap;
|
||||
current_theme = old_theme;
|
||||
}
|
||||
|
||||
void PptxConverter::convert(OOX::WritingElement *oox_unknown)
|
||||
@ -967,8 +1033,6 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
|
||||
|
||||
convert(oox_slide->bg.GetPointer());
|
||||
|
||||
bool bMaster = *odf_context()->drawing_context()->get_presentation();
|
||||
|
||||
for (size_t i = 0 ; i < oox_slide->spTree.SpTreeElems.size(); i++)
|
||||
{
|
||||
smart_ptr<PPTX::WrapperWritingElement> pElem = oox_slide->spTree.SpTreeElems[i].GetElem();
|
||||
@ -987,9 +1051,6 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
|
||||
{
|
||||
int ph_type = pShape->nvSpPr.nvPr.ph->type->GetBYTECode();
|
||||
|
||||
//if (!bMaster && (ph_type == 5 || ph_type == 6 || ph_type == 7 || ph_type == 12))
|
||||
// continue;
|
||||
|
||||
odf_context()->drawing_context()->set_placeholder_type(ph_type);
|
||||
}
|
||||
else
|
||||
|
||||
@ -48,6 +48,7 @@ namespace PPTX
|
||||
{
|
||||
class TableStyles;
|
||||
class NotesSlide;
|
||||
class NotesMaster;
|
||||
class Presentation;
|
||||
class Comments;
|
||||
class Folder;
|
||||
@ -110,7 +111,8 @@ namespace Oox2Odf
|
||||
void convert_slide (PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp);
|
||||
void convert_layout (PPTX::Logic::CSld *oox_slide);
|
||||
void convert (PPTX::Comments *oox_comments);
|
||||
void convert (PPTX::NotesSlide *oox_note);
|
||||
void convert (PPTX::NotesSlide *oox_notes);
|
||||
void convert (PPTX::NotesMaster *oox_notes);
|
||||
|
||||
void convert(PPTX::Logic::Bg *oox_background);
|
||||
void convert(PPTX::Logic::Timing *oox_timing, PPTX::Logic::Transition *oox_transition);
|
||||
|
||||
@ -347,12 +347,18 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
convert(oox_sheet->m_oSheetViews.GetPointer());
|
||||
convert(oox_sheet->m_oHeaderFooter.GetPointer());
|
||||
convert(oox_sheet->m_oPageSetup.GetPointer());
|
||||
convert(oox_sheet->m_oPageMargins.GetPointer());
|
||||
convert(oox_sheet->m_oPicture.GetPointer());
|
||||
|
||||
xlsx_current_container = old_container;
|
||||
}
|
||||
void XlsxConverter::convert(OOX::Spreadsheet::CHeaderFooter * oox_header_footer)
|
||||
{
|
||||
if (!oox_header_footer) return;
|
||||
|
||||
}
|
||||
void XlsxConverter::convert(OOX::Spreadsheet::CPictureWorksheet *oox_background)
|
||||
{
|
||||
if (!oox_background) return;
|
||||
|
||||
@ -89,6 +89,7 @@ namespace OOX
|
||||
class CSi;
|
||||
class CWorkbookView;
|
||||
class CPictureWorksheet;
|
||||
class CHeaderFooter;
|
||||
}
|
||||
}
|
||||
|
||||
@ -153,6 +154,7 @@ namespace Oox2Odf
|
||||
void convert(OOX::Spreadsheet::CDefinedName *oox_defined);
|
||||
void convert(OOX::Spreadsheet::CTable *oox_table_part);
|
||||
void convert(OOX::Spreadsheet::CPictureWorksheet *oox_background);
|
||||
void convert(OOX::Spreadsheet::CHeaderFooter *oox_header_footer);
|
||||
|
||||
void convert(OOX::Spreadsheet::CCol *oox_column);
|
||||
void convert(OOX::Spreadsheet::CRow *oox_row);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="Oox2OdfConverter"
|
||||
ProjectGUID="{BEE01B53-244A-44E6-8947-ED9342D9247E}"
|
||||
RootNamespace="Oox2OdfConverter"
|
||||
|
||||
@ -208,40 +208,48 @@ void NSPresentationEditor::CPPTXWriter::WriteContentTypes()
|
||||
<Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\" />\
|
||||
<Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\" />");
|
||||
|
||||
int nThemes = (int)m_pDocument->m_arThemes.size();
|
||||
int nIndexLayout = 0;
|
||||
for (int nT = 0; nT < nThemes; ++nT)
|
||||
int nIndexLayout = 1, nIndexTheme = 1;
|
||||
|
||||
for (size_t nT = 0; nT < m_pDocument->m_arThemes.size(); nT++, nIndexTheme++)
|
||||
{
|
||||
strContentTypes += L"<Override PartName=\"/ppt/theme/theme" + std::to_wstring(nT + 1) +
|
||||
L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\" />\
|
||||
<Override PartName=\"/ppt/slideMasters/slideMaster" + std::to_wstring(nT + 1) +
|
||||
strContentTypes += L"<Override PartName=\"/ppt/theme/theme" + std::to_wstring(nIndexTheme) + \
|
||||
L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\" />";
|
||||
|
||||
strContentTypes += L"<Override PartName=\"/ppt/slideMasters/slideMaster" + std::to_wstring(nIndexTheme) + \
|
||||
L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml\"/>";
|
||||
|
||||
|
||||
int nCountL = (int)m_pDocument->m_arThemes[nT].m_arLayouts.size();
|
||||
for (int nL = 0; nL < nCountL; ++nL, ++nIndexLayout)
|
||||
for (size_t nL = 0; nL < m_pDocument->m_arThemes[nT].m_arLayouts.size(); nL++, nIndexLayout++)
|
||||
{
|
||||
strContentTypes += L"<Override PartName=\"/ppt/slideLayouts/slideLayout" + std::to_wstring(nIndexLayout + 1) +
|
||||
strContentTypes += L"<Override PartName=\"/ppt/slideLayouts/slideLayout" + std::to_wstring(nIndexLayout) +
|
||||
L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/>";
|
||||
}
|
||||
}
|
||||
std::wstring strNotesTheme = L"<Override PartName=\"/ppt/theme/theme" + std::to_wstring(nThemes + 1) + L".xml\" \
|
||||
ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/>";
|
||||
|
||||
if (m_pDocument->m_pNotesMaster)
|
||||
{
|
||||
strContentTypes += L"<Override PartName=\"/ppt/theme/theme" + std::to_wstring(nIndexTheme++) + L".xml\" \
|
||||
ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/>";
|
||||
strContentTypes += L"<Override PartName=\"/ppt/notesMasters/notesMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml\"/>";
|
||||
}
|
||||
if (m_pDocument->m_pHandoutMaster)
|
||||
{
|
||||
strContentTypes += L"<Override PartName=\"/ppt/theme/theme" + std::to_wstring(nIndexTheme++) + L".xml\" \
|
||||
ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/>";
|
||||
strContentTypes += L"<Override PartName=\"/ppt/handoutMasters/handoutMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml\"/>";
|
||||
}
|
||||
|
||||
strContentTypes += strNotesTheme;
|
||||
strContentTypes += _T("<Override PartName=\"/ppt/notesMasters/notesMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml\"/>");
|
||||
|
||||
int nCountS = (int)m_pDocument->m_arSlides.size();
|
||||
for (int nS = 0; nS < nCountS; ++nS)
|
||||
for (size_t nS = 0; nS < m_pDocument->m_arSlides.size(); ++nS)
|
||||
{
|
||||
strContentTypes += L"<Override PartName=\"/ppt/slides/slide" + std::to_wstring( nS + 1)
|
||||
+ L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\"/>";
|
||||
}
|
||||
|
||||
for (size_t nS = 0; nS < m_pDocument->m_arNotes.size(); ++nS)
|
||||
{
|
||||
strContentTypes += L"<Override PartName=\"/ppt/notesSlides/notesSlide" + std::to_wstring( nS + 1)
|
||||
+ L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml\"/>";
|
||||
}
|
||||
|
||||
strContentTypes += _T("</Types>");
|
||||
|
||||
CFile oFile;
|
||||
@ -264,9 +272,9 @@ void NSPresentationEditor::CPPTXWriter::WriteApp(CFile& oFile)
|
||||
oFile.WriteStringUTF8(str1);
|
||||
|
||||
oFile.WriteStringUTF8(L"<Slides>" + std::to_wstring(m_pDocument->m_arSlides.size()) + L"</Slides>");
|
||||
oFile.WriteStringUTF8(L"<Notes>" + std::to_wstring(m_pDocument->m_arNotes.size()) + L"</Notes>");
|
||||
|
||||
oFile.WriteStringUTF8(L"<Notes>0</Notes>\
|
||||
<HiddenSlides>0</HiddenSlides>\
|
||||
oFile.WriteStringUTF8(L"<HiddenSlides>0</HiddenSlides>\
|
||||
<MMClips>2</MMClips>\
|
||||
<ScaleCrop>false</ScaleCrop>\
|
||||
<HeadingPairs>\
|
||||
@ -301,7 +309,7 @@ void NSPresentationEditor::CPPTXWriter::WriteApp(CFile& oFile)
|
||||
<LinksUpToDate>false</LinksUpToDate>\
|
||||
<SharedDoc>false</SharedDoc>\
|
||||
<HyperlinksChanged>false</HyperlinksChanged>\
|
||||
<AppVersion>1.0000</AppVersion>\
|
||||
<AppVersion>4.4000</AppVersion>\
|
||||
</Properties>");
|
||||
|
||||
strMemory += str5;
|
||||
@ -344,12 +352,14 @@ void NSPresentationEditor::CPPTXWriter::WritePresInfo()
|
||||
// presentation.xml + _rels/presentation.xml.rels
|
||||
std::wstring strPresRels;
|
||||
|
||||
std::wstring strPresMasters = _T("");
|
||||
std::wstring strPresSlides = _T("");
|
||||
std::wstring strPresMasters;
|
||||
std::wstring strPresSlides;
|
||||
std::wstring strNotesIDs;
|
||||
std::wstring strHandoutIDs;
|
||||
|
||||
size_t nCountLayouts = 0;
|
||||
size_t nCountThemes = m_pDocument->m_arThemes.size();
|
||||
for (size_t nIndexTheme = 0; nIndexTheme < nCountThemes; ++nIndexTheme)
|
||||
|
||||
for (size_t nIndexTheme = 0; nIndexTheme < m_pDocument->m_arThemes.size(); ++nIndexTheme)
|
||||
{
|
||||
strPresRels += L"<Relationship Id=\"rId" + std::to_wstring(2 * nIndexTheme + 1) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"slideMasters/slideMaster" +
|
||||
@ -365,9 +375,21 @@ void NSPresentationEditor::CPPTXWriter::WritePresInfo()
|
||||
nCountLayouts += 1;
|
||||
}
|
||||
|
||||
int nCurrentRels = (int)(2 * nCountThemes + 1);
|
||||
size_t nCountSlides = m_pDocument->m_arSlides.size();
|
||||
for (size_t nIndexSlide = 0; nIndexSlide < nCountSlides; ++nIndexSlide, ++nCurrentRels)
|
||||
int nCurrentRels = (int)(2 * m_pDocument->m_arThemes.size() + 1);
|
||||
|
||||
if (m_pDocument->m_pNotesMaster)
|
||||
{
|
||||
strNotesIDs = L"<p:notesMasterIdLst><p:notesMasterId r:id=\"rId" + std::to_wstring(nCurrentRels) + L"\"/></p:notesMasterIdLst>";
|
||||
strPresRels += L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>";
|
||||
++nCurrentRels;
|
||||
}
|
||||
if (m_pDocument->m_pHandoutMaster)
|
||||
{
|
||||
strHandoutIDs = L"<p:handoutMasterIdLst><p:handoutMasterId r:id=\"rId" + std::to_wstring(nCurrentRels) + L"\"/></p:handoutMasterIdLst>";
|
||||
strPresRels += L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/handoutMaster\" Target=\"handoutMasters/handoutMaster1.xml\"/>";
|
||||
++nCurrentRels;
|
||||
}
|
||||
for (size_t nIndexSlide = 0; nIndexSlide < m_pDocument->m_arSlides.size(); ++nIndexSlide, ++nCurrentRels)
|
||||
{
|
||||
strPresRels += L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slides/slide" +
|
||||
@ -376,17 +398,12 @@ void NSPresentationEditor::CPPTXWriter::WritePresInfo()
|
||||
strPresSlides += L"<p:sldId id=\"" + std::to_wstring(256 + nIndexSlide) + L"\" r:id=\"rId" + std::to_wstring(nCurrentRels) + L"\"/>";
|
||||
}
|
||||
|
||||
std::wstring strNotesIDs = L"<p:notesMasterIdLst><p:notesMasterId r:id=\"rId" + std::to_wstring(nCurrentRels) + L"\"/></p:notesMasterIdLst>";
|
||||
strPresRels += L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\" Target=\"presProps.xml\"/>";
|
||||
strPresRels += L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles\" Target=\"tableStyles.xml\"/>";
|
||||
strPresRels += L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\" Target=\"viewProps.xml\"/>";
|
||||
|
||||
std::wstring strRels0 = L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>";
|
||||
|
||||
++nCurrentRels;
|
||||
|
||||
std::wstring strRels1 = L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\" Target=\"presProps.xml\"/>";
|
||||
std::wstring strRels2 = L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles\" Target=\"tableStyles.xml\"/>";
|
||||
std::wstring strRels3 = L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\" Target=\"viewProps.xml\"/>";
|
||||
|
||||
strPresRels = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">") + strPresRels + strRels0 + strRels1 + strRels2 + strRels3 + _T("</Relationships>");
|
||||
strPresRels = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"
|
||||
+ strPresRels + L"</Relationships>";
|
||||
|
||||
std::wstring strPptRels = m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("_rels");
|
||||
|
||||
@ -401,7 +418,8 @@ void NSPresentationEditor::CPPTXWriter::WritePresInfo()
|
||||
L"\" cy=\"" + std::to_wstring(m_pDocument->m_oInfo.m_lUnitsHor) + L"\"/>";
|
||||
|
||||
std::wstring strDefaultTextStyle = _T("<p:defaultTextStyle>");
|
||||
if (m_pDocument->m_arThemes.size() > 0)
|
||||
|
||||
if (m_pDocument->m_arThemes.size() > 0)
|
||||
{
|
||||
strDefaultTextStyle += CStylesWriter::ConvertStyles(m_pDocument->m_arThemes[0].m_pStyles[0], m_pDocument->m_oInfo, 9);
|
||||
}
|
||||
@ -416,6 +434,7 @@ void NSPresentationEditor::CPPTXWriter::WritePresInfo()
|
||||
strPres += _T(">");
|
||||
strPres += _T("<p:sldMasterIdLst>") + strPresMasters + _T("</p:sldMasterIdLst>");
|
||||
strPres += strNotesIDs ;
|
||||
strPres += strHandoutIDs ;
|
||||
strPres +=_T("<p:sldIdLst>") + strPresSlides + _T("</p:sldIdLst>");
|
||||
strPres += strSizePres;
|
||||
strPres += strDefaultTextStyle;
|
||||
@ -437,79 +456,73 @@ void NSPresentationEditor::CPPTXWriter::WriteAll()
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("slideLayouts"));
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("slideLayouts") + FILE_SEPARATOR_STR + _T("_rels"));
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("slides"));
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("slides") + FILE_SEPARATOR_STR + _T("_rels"));
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("notesMasters"));
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR + _T("_rels"));
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("notesSlides"));
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("notesSlides") + FILE_SEPARATOR_STR + _T("_rels"));
|
||||
|
||||
std::wstring strNotesTheme = L"theme" + std::to_wstring((int)m_pDocument->m_arThemes.size() + 1) + L".xml";
|
||||
strNotesTheme = strPptDirectory + _T("theme") + FILE_SEPARATOR_STR + strNotesTheme;
|
||||
|
||||
Writers::DefaultNotesThemeWriter writerNotesTheme;
|
||||
writerNotesTheme.Write( strNotesTheme);
|
||||
|
||||
std::wstring strNotesMaster = strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR + _T("notesMaster1.xml");
|
||||
Writers::DefaultNotesMasterWriter writerNotesMaster;
|
||||
writerNotesMaster.Write(strNotesMaster);
|
||||
|
||||
std::wstring strNotesMasterRels = strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR +_T("_rels");
|
||||
NSDirectory::CreateDirectory(strNotesMasterRels);
|
||||
|
||||
std::wstring strThemeNotesNum = std::to_wstring((int)m_pDocument->m_arThemes.size() + 1);
|
||||
|
||||
std::wstring strVal = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
|
||||
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme") + strThemeNotesNum + _T(".xml\"/></Relationships>");
|
||||
|
||||
std::wstring strNotesMasterRelsFile = strNotesMasterRels+ FILE_SEPARATOR_STR + _T("notesMaster1.xml.rels");
|
||||
CFile oFileRels;
|
||||
oFileRels.CreateFile(strNotesMasterRelsFile);
|
||||
oFileRels.WriteStringUTF8(strVal);
|
||||
oFileRels.CloseFile();
|
||||
// -----------------------------------------------------
|
||||
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("slides") + FILE_SEPARATOR_STR + _T("_rels"));
|
||||
|
||||
if (m_pDocument->m_pHandoutMaster)
|
||||
{
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("handoutMasters"));
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("handoutMasters") + FILE_SEPARATOR_STR + _T("_rels"));
|
||||
}
|
||||
if (m_pDocument->m_pNotesMaster)
|
||||
{
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("notesMasters"));
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR + _T("_rels"));
|
||||
}
|
||||
if (!m_pDocument->m_arNotes.empty())
|
||||
{
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("notesSlides"));
|
||||
NSDirectory::CreateDirectory(strPptDirectory + _T("notesSlides") + FILE_SEPARATOR_STR + _T("_rels"));
|
||||
}
|
||||
WriteThemes();
|
||||
|
||||
WriteSlides();
|
||||
WriteNotes();
|
||||
}
|
||||
|
||||
void NSPresentationEditor::CPPTXWriter::WriteThemes()
|
||||
{
|
||||
std::wstring strPptDirectory = m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR ;
|
||||
int nStartLayout = 0, nIndexTheme = 0;
|
||||
|
||||
int nCount = (int)m_pDocument->m_arThemes.size();
|
||||
int nStartLayout = 0;
|
||||
|
||||
for (int nIndexTheme = 0; nIndexTheme < nCount; ++nIndexTheme)
|
||||
for (size_t i = 0; i < m_pDocument->m_arThemes.size(); i++)
|
||||
{
|
||||
CTheme* pTheme = &m_pDocument->m_arThemes[nIndexTheme];
|
||||
|
||||
std::wstring strThemeFile = L"theme" + std::to_wstring(nIndexTheme + 1) + L".xml";
|
||||
strThemeFile = strPptDirectory + _T("theme") + FILE_SEPARATOR_STR + strThemeFile;
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(strThemeFile);
|
||||
WriteTheme(&m_pDocument->m_arThemes[i], nIndexTheme, nStartLayout, 1);
|
||||
}
|
||||
|
||||
NSPresentationEditor::CStringWriter oStringWriter;
|
||||
WriteTheme(m_pDocument->m_pNotesMaster, nIndexTheme, nStartLayout, 2);
|
||||
WriteTheme(m_pDocument->m_pHandoutMaster, nIndexTheme, nStartLayout, 3);
|
||||
}
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\""));
|
||||
oStringWriter.WriteStringXML(pTheme->m_sThemeName);
|
||||
oStringWriter.WriteString(std::wstring(L"\"><a:themeElements>"));
|
||||
void NSPresentationEditor::CPPTXWriter::WriteTheme(CTheme* pTheme, int & nIndexTheme, int & nStartLayout, int Type)
|
||||
{
|
||||
if (!pTheme) return;
|
||||
|
||||
std::wstring strPptDirectory = m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR ;
|
||||
|
||||
WriteColorScheme(oStringWriter, L"Default", pTheme->m_arColorScheme);
|
||||
std::wstring strThemeFile = L"theme" + std::to_wstring(nIndexTheme + 1) + L".xml";
|
||||
strThemeFile = strPptDirectory + _T("theme") + FILE_SEPARATOR_STR + strThemeFile;
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(strThemeFile);
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"<a:fontScheme name=\"default\"><a:majorFont><a:latin typeface=\""));
|
||||
oStringWriter.WriteStringXML(pTheme->m_arFonts[0].Name);
|
||||
oStringWriter.WriteString(std::wstring(L"\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/></a:majorFont>"));
|
||||
NSPresentationEditor::CStringWriter oStringWriter;
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"<a:minorFont><a:latin typeface=\""));
|
||||
|
||||
if (pTheme->m_arFonts.size() >1 ) oStringWriter.WriteString(pTheme->m_arFonts[1].Name);
|
||||
else oStringWriter.WriteStringXML(pTheme->m_arFonts[0].Name);
|
||||
oStringWriter.WriteString(std::wstring(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\""));
|
||||
oStringWriter.WriteStringXML(pTheme->m_sThemeName);
|
||||
oStringWriter.WriteString(std::wstring(L"\"><a:themeElements>"));
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/></a:minorFont>"));
|
||||
oStringWriter.WriteString(std::wstring(L"</a:fontScheme>"));
|
||||
WriteColorScheme(oStringWriter, L"Default", pTheme->m_arColorScheme);
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"<a:fontScheme name=\"default\"><a:majorFont><a:latin typeface=\""));
|
||||
oStringWriter.WriteStringXML(pTheme->m_arFonts[0].Name);
|
||||
oStringWriter.WriteString(std::wstring(L"\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/></a:majorFont>"));
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"<a:minorFont><a:latin typeface=\""));
|
||||
|
||||
if (pTheme->m_arFonts.size() > 1 ) oStringWriter.WriteString (pTheme->m_arFonts[1].Name);
|
||||
else oStringWriter.WriteStringXML(pTheme->m_arFonts[0].Name);
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/></a:minorFont>"));
|
||||
oStringWriter.WriteString(std::wstring(L"</a:fontScheme>"));
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"<a:fmtScheme name=\"Default\">\
|
||||
<a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\">\
|
||||
@ -538,58 +551,67 @@ void NSPresentationEditor::CPPTXWriter::WriteThemes()
|
||||
<a:shade val=\"30000\"/><a:satMod val=\"200000\"/></a:schemeClr></a:gs></a:gsLst><a:path path=\"circle\">\
|
||||
<a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme>"));
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"</a:themeElements><a:objectDefaults/>"));
|
||||
oStringWriter.WriteString(std::wstring(L"<a:extraClrSchemeLst>"));
|
||||
oStringWriter.WriteString(std::wstring(L"</a:themeElements><a:objectDefaults/>"));
|
||||
oStringWriter.WriteString(std::wstring(L"<a:extraClrSchemeLst>"));
|
||||
|
||||
for (size_t i = 0 ; i < pTheme->m_arExtraColorScheme.size(); i++)
|
||||
{
|
||||
std::wstring str = L" " + std::to_wstring(i + 1);
|
||||
WriteColorScheme(oStringWriter, pTheme->m_sThemeName + str, pTheme->m_arExtraColorScheme[i], true); //extra
|
||||
}
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"</a:extraClrSchemeLst>"));
|
||||
oStringWriter.WriteString(std::wstring(L"</a:theme>"));
|
||||
|
||||
oFile.WriteStringUTF8(oStringWriter.GetData());
|
||||
oFile.CloseFile();
|
||||
|
||||
CRelsGenerator oRels(&m_oManager);
|
||||
int nCountLayouts = (int)pTheme->m_arLayouts.size();
|
||||
oRels.StartMaster(nIndexTheme, nStartLayout, nCountLayouts);
|
||||
|
||||
for (int i = 0 ; i < pTheme->m_arExtraColorScheme.size(); i++)
|
||||
{
|
||||
std::wstring str = L" " + std::to_wstring(i + 1);
|
||||
WriteColorScheme(oStringWriter, pTheme->m_sThemeName + str, pTheme->m_arExtraColorScheme[i], true); //extra
|
||||
}
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"</a:extraClrSchemeLst>"));
|
||||
oStringWriter.WriteString(std::wstring(L"</a:theme>"));
|
||||
CStringWriter oWriter;
|
||||
oWriter.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>");
|
||||
|
||||
if (Type == 1)
|
||||
{
|
||||
oWriter.WriteString(L"<p:sldMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">");
|
||||
}
|
||||
else if (Type == 2)
|
||||
{
|
||||
oWriter.WriteString(L"<p:notesMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">");
|
||||
}
|
||||
else if (Type == 3)
|
||||
{
|
||||
oWriter.WriteString(L"<p:handoutMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">");
|
||||
}
|
||||
oWriter.WriteString(L"<p:cSld>");
|
||||
|
||||
oFile.WriteStringUTF8(oStringWriter.GetData());
|
||||
oFile.CloseFile();
|
||||
|
||||
// теперь masterslide
|
||||
CRelsGenerator oRels(&m_oManager);
|
||||
int nCountLayouts = (int)pTheme->m_arLayouts.size();
|
||||
|
||||
oRels.StartMaster(nIndexTheme, nStartLayout, nCountLayouts);
|
||||
|
||||
CStringWriter oWriter;
|
||||
std::wstring str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
|
||||
<p:sldMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\
|
||||
<p:cSld>");
|
||||
oWriter.WriteString(str1);
|
||||
|
||||
if (pTheme->m_bIsBackground)
|
||||
{
|
||||
WriteBackground(oWriter, oRels, pTheme->m_oBackground);
|
||||
}
|
||||
std::wstring strElems = _T("<p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr>\
|
||||
if (pTheme->m_bIsBackground)
|
||||
{
|
||||
WriteBackground(oWriter, oRels, pTheme->m_oBackground);
|
||||
}
|
||||
oWriter.WriteString(L"<p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr>\
|
||||
<a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>");
|
||||
oWriter.WriteString(strElems);
|
||||
|
||||
size_t nElements = pTheme->m_arElements.size();
|
||||
for (size_t nEl = 0; nEl < nElements; ++nEl)
|
||||
{
|
||||
if (isBodyPlaceholder(pTheme->m_arElements[nEl]->m_lPlaceholderType))
|
||||
pTheme->m_arElements[nEl]->m_lPlaceholderType =100; //body тип прописывать !!
|
||||
for (size_t nEl = 0; nEl < pTheme->m_arElements.size(); ++nEl)
|
||||
{
|
||||
if (isBodyPlaceholder(pTheme->m_arElements[nEl]->m_lPlaceholderType))
|
||||
pTheme->m_arElements[nEl]->m_lPlaceholderType =100; //body тип прописывать !!
|
||||
|
||||
if (pTheme->m_arElements[nEl]->m_bBoundsEnabled == false)
|
||||
continue;
|
||||
|
||||
WriteElement(oWriter, oRels, pTheme->m_arElements[nEl]);
|
||||
}
|
||||
if (pTheme->m_arElements[nEl]->m_bBoundsEnabled == false)
|
||||
continue;
|
||||
|
||||
WriteElement(oWriter, oRels, pTheme->m_arElements[nEl]);
|
||||
}
|
||||
|
||||
oWriter.WriteString(std::wstring(L"</p:spTree></p:cSld>"));
|
||||
oWriter.WriteString(std::wstring(L"</p:spTree></p:cSld>"));
|
||||
|
||||
std::wstring strOverrideColorScheme = _T("<p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/>");
|
||||
oWriter.WriteString(strOverrideColorScheme);
|
||||
std::wstring strOverrideColorScheme = _T("<p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/>");
|
||||
oWriter.WriteString(strOverrideColorScheme);
|
||||
|
||||
if (Type == 1)
|
||||
{
|
||||
oWriter.WriteString(std::wstring(L"<p:sldLayoutIdLst>"));
|
||||
|
||||
size_t __nCountLayouts = 0;
|
||||
@ -601,17 +623,19 @@ void NSPresentationEditor::CPPTXWriter::WriteThemes()
|
||||
}
|
||||
|
||||
oWriter.WriteString(std::wstring(L"</p:sldLayoutIdLst>"));
|
||||
}
|
||||
|
||||
if (pTheme->m_bHasDate || pTheme->m_bHasFooter || pTheme->m_bHasSlideNumber)
|
||||
{
|
||||
oWriter.WriteString(std::wstring(L"<p:hf"));
|
||||
if (!pTheme->m_bHasDate) oWriter.WriteString(std::wstring(L" dt=\"0\""));
|
||||
if (!pTheme->m_bHasSlideNumber) oWriter.WriteString(std::wstring(L" sldNum=\"0\""));
|
||||
oWriter.WriteString(std::wstring(L" hdr=\"0\""));
|
||||
if (!pTheme->m_bHasFooter) oWriter.WriteString(std::wstring(L" ftr=\"0\""));
|
||||
oWriter.WriteString(std::wstring(L"/>"));
|
||||
}
|
||||
|
||||
if (pTheme->m_bHasDate || pTheme->m_bHasFooter || pTheme->m_bHasSlideNumber)
|
||||
{
|
||||
oWriter.WriteString(std::wstring(L"<p:hf"));
|
||||
if (!pTheme->m_bHasDate) oWriter.WriteString(std::wstring(L" dt=\"0\""));
|
||||
if (!pTheme->m_bHasSlideNumber) oWriter.WriteString(std::wstring(L" sldNum=\"0\""));
|
||||
oWriter.WriteString(std::wstring(L" hdr=\"0\""));
|
||||
if (!pTheme->m_bHasFooter) oWriter.WriteString(std::wstring(L" ftr=\"0\""));
|
||||
oWriter.WriteString(std::wstring(L"/>"));
|
||||
}
|
||||
if (Type == 1)
|
||||
{
|
||||
oWriter.WriteString(std::wstring(L"<p:txStyles>"));
|
||||
|
||||
oWriter.WriteString(std::wstring(L"<p:titleStyle>"));
|
||||
@ -626,25 +650,57 @@ void NSPresentationEditor::CPPTXWriter::WriteThemes()
|
||||
CStylesWriter::ConvertStyles(pTheme->m_pStyles[3], pTheme->m_oInfo, oWriter, 9);
|
||||
oWriter.WriteString(std::wstring(L"</p:otherStyle>"));
|
||||
|
||||
oWriter.WriteString(std::wstring(L"</p:txStyles></p:sldMaster>"));
|
||||
|
||||
std::wstring strSlideMasterFile = L"slideMaster" + std::to_wstring(nIndexTheme + 1) + L".xml";
|
||||
strSlideMasterFile = strPptDirectory + _T("slideMasters") + FILE_SEPARATOR_STR + strSlideMasterFile;
|
||||
|
||||
oFile.CreateFile(strSlideMasterFile);
|
||||
std::wstring strMaster = oWriter.GetData();
|
||||
oFile.WriteStringUTF8(strMaster);
|
||||
oFile.CloseFile();
|
||||
|
||||
oRels.CloseRels();
|
||||
|
||||
std::wstring strSlideMasterRelsFile = L"slideMaster" + std::to_wstring(nIndexTheme + 1) + L".xml.rels";
|
||||
strSlideMasterRelsFile = strPptDirectory + _T("slideMasters") + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR + strSlideMasterRelsFile;
|
||||
|
||||
oRels.SaveRels(strSlideMasterRelsFile);
|
||||
|
||||
nStartLayout += nCountLayouts;
|
||||
oWriter.WriteString(std::wstring(L"</p:txStyles>"));
|
||||
}
|
||||
else if (Type == 2)
|
||||
{
|
||||
oWriter.WriteString(std::wstring(L"<p:notesStyle>"));
|
||||
CStylesWriter::ConvertStyles(pTheme->m_pStyles[1], pTheme->m_oInfo, oWriter, 9);
|
||||
oWriter.WriteString(std::wstring(L"</p:notesStyle>"));
|
||||
}
|
||||
|
||||
std::wstring strSlideMasterFile;
|
||||
std::wstring strSlideMasterRelsFile;
|
||||
if (Type == 1)
|
||||
{
|
||||
oWriter.WriteString(std::wstring(L"</p:sldMaster>"));
|
||||
|
||||
strSlideMasterFile = L"slideMaster" + std::to_wstring(nIndexTheme + 1) + L".xml";
|
||||
strSlideMasterFile = strPptDirectory + _T("slideMasters") + FILE_SEPARATOR_STR + strSlideMasterFile;
|
||||
|
||||
strSlideMasterRelsFile = L"slideMaster" + std::to_wstring(nIndexTheme + 1) + L".xml.rels";
|
||||
strSlideMasterRelsFile = strPptDirectory + _T("slideMasters") + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR + strSlideMasterRelsFile;
|
||||
}
|
||||
else if (Type == 2)
|
||||
{
|
||||
oWriter.WriteString(std::wstring(L"</p:notesMaster>"));
|
||||
|
||||
strSlideMasterFile = L"notesMaster1.xml";
|
||||
strSlideMasterFile = strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR + strSlideMasterFile;
|
||||
|
||||
strSlideMasterRelsFile = L"notesMaster1.xml.rels";
|
||||
strSlideMasterRelsFile = strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR + strSlideMasterRelsFile;
|
||||
}
|
||||
else if (Type == 3)
|
||||
{
|
||||
oWriter.WriteString(std::wstring(L"</p:handoutMaster>"));
|
||||
|
||||
strSlideMasterFile = L"handoutMaster1.xml";
|
||||
strSlideMasterFile = strPptDirectory + _T("handoutMasters") + FILE_SEPARATOR_STR + strSlideMasterFile;
|
||||
|
||||
strSlideMasterRelsFile = L"handoutMaster1.xml.rels";
|
||||
strSlideMasterRelsFile = strPptDirectory + _T("handoutMasters") + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR + strSlideMasterRelsFile;
|
||||
}
|
||||
oFile.CreateFile(strSlideMasterFile);
|
||||
std::wstring strMaster = oWriter.GetData();
|
||||
oFile.WriteStringUTF8(strMaster);
|
||||
oFile.CloseFile();
|
||||
|
||||
oRels.CloseRels();
|
||||
oRels.SaveRels(strSlideMasterRelsFile);
|
||||
|
||||
nStartLayout += nCountLayouts;
|
||||
nIndexTheme++;
|
||||
}
|
||||
|
||||
void NSPresentationEditor::CPPTXWriter::WriteColorScheme(CStringWriter& oStringWriter, const std::wstring & name, const std::vector<CColor> & colors, bool extra)
|
||||
@ -826,14 +882,14 @@ void NSPresentationEditor::CPPTXWriter::WriteSlide(int nIndexSlide)
|
||||
CSlide* pSlide = m_pDocument->m_arSlides[nIndexSlide];
|
||||
|
||||
if (0 == pSlide->m_lThemeID)
|
||||
oRels.StartSlide(pSlide->m_lLayoutID, nIndexSlide);
|
||||
oRels.StartSlide(pSlide->m_lLayoutID, pSlide->m_lNotesID);
|
||||
else
|
||||
{
|
||||
int nLayout = pSlide->m_lLayoutID;
|
||||
for (int i = 0; i < pSlide->m_lThemeID; ++i)
|
||||
nLayout += (int)m_pDocument->m_arThemes[i].m_arLayouts.size();
|
||||
|
||||
oRels.StartSlide(nLayout, nIndexSlide);
|
||||
oRels.StartSlide(nLayout, pSlide->m_lNotesID);
|
||||
}
|
||||
|
||||
oWriter.WriteString(std::wstring(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"));
|
||||
@ -881,15 +937,66 @@ void NSPresentationEditor::CPPTXWriter::WriteSlide(int nIndexSlide)
|
||||
strFile = L"slide" + std::to_wstring(nIndexSlide + 1) + L".xml.rels";
|
||||
oRels.SaveRels(strFileSlidePath + _T("_rels") + FILE_SEPARATOR_STR + strFile);
|
||||
}
|
||||
void NSPresentationEditor::CPPTXWriter::WriteNotes(int nIndexNotes)
|
||||
{
|
||||
CStringWriter oWriter;
|
||||
CRelsGenerator oRels(&m_oManager);
|
||||
|
||||
CSlide* pNotes = m_pDocument->m_arNotes[nIndexNotes];
|
||||
|
||||
oRels.StartNotes(pNotes->m_lSlideID, m_pDocument->m_pNotesMaster != NULL);
|
||||
|
||||
oWriter.WriteString(std::wstring(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"));
|
||||
oWriter.WriteString(std::wstring(L"<p:notes xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\""));
|
||||
if (!pNotes->m_bShowMasterShapes)
|
||||
oWriter.WriteString(std::wstring(L" showMasterSp=\"0\""));
|
||||
oWriter.WriteString(std::wstring(L">"));
|
||||
|
||||
oWriter.WriteString(std::wstring(L"<p:cSld>"));
|
||||
|
||||
if (pNotes->m_bIsBackground)
|
||||
{
|
||||
WriteBackground(oWriter, oRels, pNotes->m_oBackground);
|
||||
}
|
||||
|
||||
oWriter.WriteString(std::wstring(L"<p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr>\
|
||||
<a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>"));
|
||||
|
||||
for (size_t nEl = 0; nEl < pNotes->m_arElements.size(); ++nEl)
|
||||
{
|
||||
WriteElement(oWriter, oRels, pNotes->m_arElements[nEl], NULL);
|
||||
}
|
||||
oWriter.WriteString(std::wstring(L"</p:spTree></p:cSld>"));
|
||||
|
||||
oWriter.WriteString(std::wstring(L"<p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr>"));
|
||||
oWriter.WriteString(std::wstring(L"</p:notes>"));
|
||||
|
||||
oRels.CloseRels();
|
||||
|
||||
std::wstring strXml = oWriter.GetData();
|
||||
std::wstring strFile = L"notesSlide" + std::to_wstring(nIndexNotes + 1) + L".xml";
|
||||
std::wstring strFileSlidePath = m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("notesSlides") + FILE_SEPARATOR_STR;
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(strFileSlidePath + strFile);
|
||||
oFile.WriteStringUTF8(strXml);
|
||||
oFile.CloseFile();
|
||||
|
||||
strFile = L"notesSlide" + std::to_wstring(nIndexNotes + 1) + L".xml.rels";
|
||||
oRels.SaveRels(strFileSlidePath + _T("_rels") + FILE_SEPARATOR_STR + strFile);
|
||||
}
|
||||
|
||||
void NSPresentationEditor::CPPTXWriter::WriteSlides()
|
||||
{
|
||||
size_t nCountSlides = m_pDocument->m_arSlides.size();
|
||||
|
||||
for (size_t nIndexS = 0; nIndexS < nCountSlides; ++nIndexS)
|
||||
for (size_t nIndexS = 0; nIndexS < m_pDocument->m_arSlides.size(); ++nIndexS)
|
||||
{
|
||||
CRelsGenerator::StartNotes((int)nIndexS, m_strTempDirectory, m_pDocument->m_arSlides[nIndexS]->m_strComment);
|
||||
WriteSlide((int)nIndexS);
|
||||
}
|
||||
}
|
||||
void NSPresentationEditor::CPPTXWriter::WriteNotes()
|
||||
{
|
||||
for (size_t nIndexS = 0; nIndexS < m_pDocument->m_arNotes.size(); ++nIndexS)
|
||||
{
|
||||
WriteNotes((int)nIndexS);
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,8 +54,6 @@ namespace NSPresentationEditor
|
||||
|
||||
CShapeWriter* m_pShapeWriter;
|
||||
|
||||
|
||||
public:
|
||||
CPPTXWriter();
|
||||
~CPPTXWriter();
|
||||
|
||||
@ -74,9 +72,12 @@ namespace NSPresentationEditor
|
||||
void WritePresInfo ();
|
||||
void WriteAll ();
|
||||
void WriteThemes ();
|
||||
void WriteTheme (CTheme* pTheme, int & nIndexTheme, int & nStartLayout, int Type = 1);
|
||||
void WriteSlides ();
|
||||
void WriteNotes ();
|
||||
void WriteLayout (CLayout& oLayout, int nIndexLayout, int nStartLayout, int nIndexTheme);
|
||||
void WriteSlide (int nIndexSlide);
|
||||
void WriteNotes (int nIndexNotes);
|
||||
|
||||
void WriteColorScheme (CStringWriter& oWriter, const std::wstring & name, const std::vector<CColor> & colors, bool extra = false);
|
||||
void WriteBackground (CStringWriter& oWriter, CRelsGenerator& oRels, CBrush& oBackground);
|
||||
|
||||
@ -170,12 +170,11 @@ namespace NSPresentationEditor
|
||||
|
||||
m_oWriter.WriteString(str1);
|
||||
|
||||
int nCurrent = nStartLayoutIndex;
|
||||
for (int i = 0; i < nCountLayouts; ++i)
|
||||
{
|
||||
std::wstring str = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout"
|
||||
+ std::to_wstring(nCurrent + 1) + L".xml\"/>";
|
||||
++nCurrent;
|
||||
+ std::to_wstring(nStartLayoutIndex + 1) + L".xml\"/>";
|
||||
nStartLayoutIndex++;
|
||||
m_oWriter.WriteString(str);
|
||||
}
|
||||
|
||||
@ -196,7 +195,23 @@ namespace NSPresentationEditor
|
||||
|
||||
m_oWriter.WriteString(str);
|
||||
}
|
||||
inline void StartSlide(int nIndexLayout, int nIndexSlide)
|
||||
inline void StartNotes(int nIndexSlide, bool bMaster)
|
||||
{
|
||||
m_oWriter.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
|
||||
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
|
||||
if (bMaster)
|
||||
{
|
||||
m_oWriter.WriteString(L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"../notesMasters/notesMaster1.xml\"/>");
|
||||
}
|
||||
if (nIndexSlide >= 0)
|
||||
{
|
||||
m_oWriter.WriteString(L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"../slides/slide"
|
||||
+ std::to_wstring(nIndexSlide + 1) + L".xml\"/>");
|
||||
}
|
||||
}
|
||||
inline void StartSlide(int nIndexLayout, int nIndexNotes)
|
||||
{
|
||||
m_oWriter.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
|
||||
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
|
||||
@ -204,51 +219,14 @@ namespace NSPresentationEditor
|
||||
m_oWriter.WriteString(L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout"
|
||||
+ std::to_wstring(nIndexLayout + 1) + L".xml\"/>");
|
||||
|
||||
m_oWriter.WriteString(L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide"
|
||||
+ std::to_wstring(nIndexSlide + 1) + L".xml\"/>");
|
||||
if (nIndexNotes >= 0)
|
||||
{
|
||||
m_oWriter.WriteString(L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide"
|
||||
+ std::to_wstring(nIndexNotes + 1) + L".xml\"/>");
|
||||
}
|
||||
}
|
||||
static inline void StartNotes(int nIndexSlide, std::wstring strDirectory, std::wstring strComment)
|
||||
{
|
||||
std::wstring sNum = std::to_wstring( nIndexSlide + 1);
|
||||
|
||||
std::wstring strNoteSlideRels = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
|
||||
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
|
||||
<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"../slides/slide") + sNum + _T(".xml\"/>\
|
||||
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"../notesMasters/notesMaster1.xml\"/>\
|
||||
</Relationships>");
|
||||
|
||||
std::wstring strNoteRels = strDirectory + FILE_SEPARATOR_STR + _T("ppt") +
|
||||
+ FILE_SEPARATOR_STR + _T("notesSlides")
|
||||
+ FILE_SEPARATOR_STR + _T("_rels")
|
||||
+ FILE_SEPARATOR_STR + _T("notesSlide") + sNum + _T(".xml.rels");
|
||||
CFile oFile;
|
||||
oFile.CreateFile(strNoteRels);
|
||||
oFile.WriteStringUTF8(strNoteSlideRels);
|
||||
oFile.CloseFile();
|
||||
|
||||
std::wstring strNoteSlide = strDirectory + FILE_SEPARATOR_STR + _T("ppt") +
|
||||
+ FILE_SEPARATOR_STR + _T("notesSlides")
|
||||
+ FILE_SEPARATOR_STR + _T("notesSlide") + sNum + _T(".xml");
|
||||
oFile.CreateFile(strNoteSlide);
|
||||
|
||||
std::wstring strW1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<p:notes xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\
|
||||
<p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/>\
|
||||
<a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"100000\" name=\"\"/>\
|
||||
<p:cNvSpPr><a:spLocks noGrp=\"1\" noChangeArrowheads=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/>\
|
||||
<p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr smtClean=\"0\"/><a:t>");
|
||||
std::wstring strW2 = _T("</a:t></a:r><a:endParaRPr/></a:p></p:txBody></p:sp></p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:notes>");
|
||||
|
||||
CorrectXmlString(strComment);
|
||||
|
||||
oFile.WriteStringUTF8(strW1);
|
||||
oFile.WriteStringUTF8(strComment);
|
||||
oFile.WriteStringUTF8(strW2);
|
||||
|
||||
oFile.CloseFile();
|
||||
}
|
||||
inline void CloseRels()
|
||||
inline void CloseRels()
|
||||
{
|
||||
std::wstring str = _T("</Relationships>");
|
||||
m_oWriter.WriteString(str);
|
||||
|
||||
@ -68,9 +68,6 @@ void CStylesWriter::ConvertStyleLevel(NSPresentationEditor::CTextStyleLevel& oLe
|
||||
{
|
||||
std::wstring strProp = std::to_wstring(pPF->leftMargin.get());
|
||||
oWriter.WriteString(L" marL=\"" + strProp + L"\"");
|
||||
|
||||
if (pPF->indent.is_init() == false)
|
||||
pPF->indent = (LONG)0;
|
||||
}
|
||||
if (pPF->indent.is_init())
|
||||
{
|
||||
@ -296,21 +293,79 @@ NSPresentationEditor::CShapeWriter::CShapeWriter()
|
||||
m_pImageElement = NULL;
|
||||
m_pShapeElement = NULL;
|
||||
}
|
||||
std::wstring NSPresentationEditor::CShapeWriter::ConvertLine(CPen & pen)
|
||||
std::wstring NSPresentationEditor::CShapeWriter::ConvertLine(CPen & pen)
|
||||
{
|
||||
NSPresentationEditor::CStringWriter line_writer;
|
||||
|
||||
std::wstring str = std::to_wstring( (int)(pen.Size * 36000));
|
||||
line_writer.WriteString(L"<a:ln w=\"" + str + L"\">");
|
||||
std::wstring strL;
|
||||
switch(pen.LineStyle)
|
||||
{
|
||||
case 1: strL = L" cmpd=\"dbl\""; break;
|
||||
case 2: strL = L" cmpd=\"thickThin\""; break;
|
||||
case 3: strL = L" cmpd=\"thinThick\""; break;
|
||||
case 4: strL = L" cmpd=\"tri\""; break;
|
||||
}
|
||||
line_writer.WriteString(L"<a:ln w=\"" + std::to_wstring((int)(pen.Size * 36000)) + L"\"" + strL + L">");
|
||||
|
||||
line_writer.WriteString(L"<a:solidFill>");
|
||||
line_writer.WriteString(ConvertColor(pen.Color, pen.Alpha));
|
||||
line_writer.WriteString(L"</a:solidFill>");
|
||||
|
||||
line_writer.WriteString(L"<a:round/><a:headEnd/><a:tailEnd/></a:ln>");
|
||||
switch(pen.DashStyle)
|
||||
{
|
||||
case 1: line_writer.WriteString(L"<a:prstDash val=\"sysDash\"/>"); break;
|
||||
case 2: line_writer.WriteString(L"<a:prstDash val=\"sysDot\"/>"); break;
|
||||
case 3: line_writer.WriteString(L"<a:prstDash val=\"sysDashDot\"/>"); break;
|
||||
case 4: line_writer.WriteString(L"<a:prstDash val=\"sysDashDotDot\"/>"); break;
|
||||
case 5: line_writer.WriteString(L"<a:prstDash val=\"dot\"/>"); break;
|
||||
case 6: line_writer.WriteString(L"<a:prstDash val=\"dash\"/>"); break;
|
||||
case 7: line_writer.WriteString(L"<a:prstDash val=\"lgDash\"/>"); break;
|
||||
case 8: line_writer.WriteString(L"<a:prstDash val=\"dashDot\"/>"); break;
|
||||
case 9: line_writer.WriteString(L"<a:prstDash val=\"lgDashDot\"/>"); break;
|
||||
case 10:line_writer.WriteString(L"<a:prstDash val=\"lgDashDotDot\"/>"); break;
|
||||
}
|
||||
switch(pen.LineJoin)
|
||||
{
|
||||
case 0: line_writer.WriteString(L"<a:bevel/>"); break;
|
||||
case 1: line_writer.WriteString(L"<a:miter/>"); break;
|
||||
case 2: line_writer.WriteString(L"<a:round/>"); break;
|
||||
}
|
||||
|
||||
line_writer.WriteString(L"<a:headEnd" + ConvertLineEnd(pen.LineStartCap, pen.LineStartLength, pen.LineStartWidth) + L"/>");
|
||||
line_writer.WriteString(L"<a:tailEnd" + ConvertLineEnd(pen.LineEndCap, pen.LineEndLength, pen.LineEndWidth) + L"/>");
|
||||
|
||||
line_writer.WriteString(L"</a:ln>");
|
||||
|
||||
return line_writer.GetData();
|
||||
}
|
||||
std::wstring NSPresentationEditor::CShapeWriter::ConvertLineEnd(unsigned char cap, unsigned char length, unsigned char width)
|
||||
{
|
||||
if (cap < 1) return L"";
|
||||
|
||||
std::wstring sResult;
|
||||
|
||||
switch(cap)
|
||||
{
|
||||
case 1: sResult += L" type=\"triangle\""; break;
|
||||
case 2: sResult += L" type=\"stealth\""; break;
|
||||
case 3: sResult += L" type=\"diamond\""; break;
|
||||
case 4: sResult += L" type=\"oval\""; break;
|
||||
case 5: sResult += L" type=\"arrow\""; break;
|
||||
}
|
||||
switch(length)
|
||||
{
|
||||
case 0: sResult += L" len=\"sm\""; break;
|
||||
case 1: sResult += L" len=\"med\""; break;
|
||||
case 2: sResult += L" len=\"lg\""; break;
|
||||
}
|
||||
switch(width)
|
||||
{
|
||||
case 0: sResult += L" w=\"sm\""; break;
|
||||
case 1: sResult += L" w=\"med\""; break;
|
||||
case 2: sResult += L" w=\"lg\""; break;
|
||||
}
|
||||
return sResult;
|
||||
}
|
||||
std::wstring NSPresentationEditor::CShapeWriter::ConvertBrush(CBrush & brush)
|
||||
{
|
||||
NSPresentationEditor::CStringWriter brush_writer;
|
||||
@ -798,11 +853,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
|
||||
if (pPF->leftMargin.is_init())
|
||||
{
|
||||
std::wstring strProp = std::to_wstring( pPF->leftMargin.get() );
|
||||
m_oWriter.WriteString(L" marL=\"" + strProp + L"\"");
|
||||
|
||||
if (pPF->indent.is_init() == false)
|
||||
pPF->indent = (LONG)0;
|
||||
|
||||
m_oWriter.WriteString(L" marL=\"" + strProp + L"\"");
|
||||
}
|
||||
if (pPF->indent.is_init())
|
||||
{
|
||||
@ -1175,7 +1226,8 @@ std::wstring NSPresentationEditor::CShapeWriter::ConvertShape()
|
||||
}
|
||||
m_oWriter.WriteString(std::wstring(L">"));
|
||||
|
||||
m_oWriter.WriteString(L"<a:off x=\"" + std::to_wstring((int)m_pShapeElement->m_rcBoundsOriginal.left) + L"\" y=\"" + std::to_wstring((int)m_pShapeElement->m_rcBoundsOriginal.top) + L"\"/>");
|
||||
m_oWriter.WriteString(L"<a:off x=\"" + std::to_wstring((int)m_pShapeElement->m_rcBoundsOriginal.left) +
|
||||
L"\" y=\"" + std::to_wstring((int)m_pShapeElement->m_rcBoundsOriginal.top) + L"\"/>");
|
||||
|
||||
int width = m_pShapeElement->m_rcBoundsOriginal.right - m_pShapeElement->m_rcBoundsOriginal.left;
|
||||
int height = m_pShapeElement->m_rcBoundsOriginal.bottom - m_pShapeElement->m_rcBoundsOriginal.top;
|
||||
|
||||
@ -213,6 +213,7 @@ namespace NSPresentationEditor
|
||||
std::wstring ConvertShadow (CShadow & shadow);
|
||||
std::wstring ConvertBrush (CBrush & brush);
|
||||
static std::wstring ConvertColor (CColor & color, long alpha);
|
||||
std::wstring ConvertLineEnd(unsigned char cap, unsigned char length, unsigned char width);
|
||||
// тип рендерера-----------------------------------------------------------------------------
|
||||
virtual HRESULT get_Type(LONG* lType) ;
|
||||
//-------- Функции для работы со страницей --------------------------------------------------
|
||||
|
||||
@ -52,8 +52,11 @@ CPPTUserInfo::CPPTUserInfo() : CDocument(),
|
||||
m_pDocumentInfo = NULL;
|
||||
m_lIndexThisUser = -1;
|
||||
|
||||
m_nWriteSlideTimeOffset = 0.0;
|
||||
m_nWriteSlideTime = 0.0;
|
||||
m_pNotesMasterWrapper = NULL;
|
||||
m_pHandoutMasterWrapper = NULL;
|
||||
|
||||
m_nWriteSlideTimeOffset = 0.0;
|
||||
m_nWriteSlideTime = 0.0;
|
||||
|
||||
m_strFileDirectory = _T("");
|
||||
m_bIsSetupEmpty = false;
|
||||
@ -90,6 +93,21 @@ void CPPTUserInfo::Clear()
|
||||
m_mapMasters.clear();
|
||||
m_arrMastersOrder.clear();
|
||||
|
||||
for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapNotesMasters.begin(); pPair != m_mapNotesMasters.end(); ++pPair)
|
||||
{
|
||||
RELEASEINTERFACE(pPair->second);
|
||||
}
|
||||
m_mapNotesMasters.clear();
|
||||
|
||||
for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapHandoutMasters.begin(); pPair != m_mapHandoutMasters.end(); ++pPair)
|
||||
{
|
||||
RELEASEINTERFACE(pPair->second);
|
||||
}
|
||||
m_mapHandoutMasters.clear();
|
||||
|
||||
RELEASEOBJECT(m_pNotesMasterWrapper);
|
||||
RELEASEOBJECT(m_pHandoutMasterWrapper);
|
||||
|
||||
for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapNotes.begin(); pPair != m_mapNotes.end(); ++pPair)
|
||||
{
|
||||
RELEASEINTERFACE(pPair->second);
|
||||
@ -97,11 +115,10 @@ void CPPTUserInfo::Clear()
|
||||
m_mapNotes.clear();
|
||||
m_arrNotesOrder.clear();
|
||||
|
||||
|
||||
m_oExMedia.Clear();
|
||||
m_arrFonts.clear();
|
||||
|
||||
for (int nIndex = 0; nIndex < m_mapAnimations.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < m_mapAnimations.size(); ++nIndex)
|
||||
{
|
||||
RELEASEOBJECT ( m_mapAnimations[nIndex]);
|
||||
}
|
||||
@ -148,13 +165,15 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
|
||||
|
||||
Clear();
|
||||
|
||||
std::map<DWORD, DWORD>::iterator nIndexPsrRef;
|
||||
|
||||
for (size_t index = 0; index < m_oDocument.m_arMasterPersists.size(); ++index)
|
||||
{
|
||||
std::map<DWORD, DWORD>::iterator nPsrRef = m_mapOffsetInPIDs.find(m_oDocument.m_arMasterPersists[index].m_nPsrRef);
|
||||
nIndexPsrRef = m_mapOffsetInPIDs.find(m_oDocument.m_arMasterPersists[index].m_nPsrRef);
|
||||
|
||||
if (nPsrRef != m_mapOffsetInPIDs.end())
|
||||
if (nIndexPsrRef != m_mapOffsetInPIDs.end())
|
||||
{
|
||||
long offset = (long)nPsrRef->second;
|
||||
long offset = (long)nIndexPsrRef->second;
|
||||
|
||||
StreamUtils::StreamSeek(offset, pStream);
|
||||
|
||||
@ -173,10 +192,9 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
|
||||
}
|
||||
m_arrMastersOrder.push_back(m_oDocument.m_arMasterPersists[index].m_nSlideID);
|
||||
}
|
||||
|
||||
for (size_t index = 0; index < m_oDocument.m_arNotePersists.size(); ++index)
|
||||
{
|
||||
std::map<DWORD, DWORD>::iterator nIndexPsrRef = m_mapOffsetInPIDs.find(m_oDocument.m_arNotePersists[index].m_nPsrRef);
|
||||
nIndexPsrRef = m_mapOffsetInPIDs.find(m_oDocument.m_arNotePersists[index].m_nPsrRef);
|
||||
|
||||
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
|
||||
{
|
||||
@ -201,7 +219,7 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
|
||||
|
||||
for (size_t index = 0; index < m_oDocument.m_arSlidePersists.size(); ++index)
|
||||
{
|
||||
std::map<DWORD, DWORD>::iterator nIndexPsrRef = m_mapOffsetInPIDs.find(m_oDocument.m_arSlidePersists[index].m_nPsrRef);
|
||||
nIndexPsrRef = m_mapOffsetInPIDs.find(m_oDocument.m_arSlidePersists[index].m_nPsrRef);
|
||||
|
||||
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
|
||||
{
|
||||
@ -239,7 +257,47 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
|
||||
}
|
||||
m_arrSlidesOrder.push_back(m_oDocument.m_arSlidePersists[index].m_nSlideID);
|
||||
}
|
||||
std::vector<CRecordDocumentAtom*> oArrayDoc;
|
||||
m_oDocument.GetRecordsByType(&oArrayDoc, true, true);
|
||||
|
||||
if (!oArrayDoc.empty())
|
||||
{
|
||||
nIndexPsrRef = m_mapOffsetInPIDs.find(oArrayDoc[0]->m_nNotesMasterPersistIDRef);
|
||||
|
||||
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
|
||||
{
|
||||
long offset = (long)nIndexPsrRef->second;
|
||||
|
||||
StreamUtils::StreamSeek(offset, pStream);
|
||||
|
||||
oHeader.ReadFromStream(pStream);
|
||||
|
||||
CRecordSlide* pSlide = new CRecordSlide();
|
||||
pSlide->ReadFromStream(oHeader, pStream);
|
||||
pSlide->m_oPersist.m_nPsrRef = oArrayDoc[0]->m_nNotesMasterPersistIDRef;
|
||||
pSlide->m_Index = 0;
|
||||
|
||||
m_mapNotesMasters.insert( std::pair<DWORD, CRecordSlide*>(0, pSlide ));
|
||||
}
|
||||
nIndexPsrRef = m_mapOffsetInPIDs.find(oArrayDoc[0]->m_nHandoutMasterPersistIDRef);
|
||||
|
||||
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
|
||||
{
|
||||
long offset = (long)nIndexPsrRef->second;
|
||||
|
||||
StreamUtils::StreamSeek(offset, pStream);
|
||||
|
||||
oHeader.ReadFromStream(pStream);
|
||||
|
||||
CRecordSlide* pSlide = new CRecordSlide();
|
||||
pSlide->ReadFromStream(oHeader, pStream);
|
||||
pSlide->m_oPersist.m_nPsrRef = oArrayDoc[0]->m_nHandoutMasterPersistIDRef;
|
||||
pSlide->m_Index = 0;
|
||||
|
||||
m_mapHandoutMasters.insert( std::pair<DWORD, CRecordSlide*>(0, pSlide ));
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------
|
||||
// так... теперь берем всю инфу о ExObject -----------------------------
|
||||
m_oExMedia.m_strPresentationDirectory = strFolderMem;
|
||||
m_oExMedia.m_strSourceDirectory = m_strFileDirectory;
|
||||
@ -271,7 +329,7 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
|
||||
std::vector<CRecordFontEntityAtom*> oArrayFonts;
|
||||
m_oDocument.GetRecordsByType(&oArrayFonts, true);
|
||||
|
||||
for (int nIndex = 0; nIndex < oArrayFonts.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < oArrayFonts.size(); ++nIndex)
|
||||
{
|
||||
CFont oFont;
|
||||
oFont.Name = oArrayFonts[nIndex]->m_strFaceName;
|
||||
@ -371,7 +429,7 @@ void CPPTUserInfo::FromDocument()
|
||||
double DurationSlide = PPT_DEFAULT_SLIDE_DURATION;
|
||||
|
||||
m_arSlides.reserve(m_arrSlidesOrder.size());
|
||||
for (int i=0; i< m_arrSlidesOrder.size(); i++)
|
||||
for (size_t i = 0; i < m_arrSlidesOrder.size(); i++)
|
||||
{
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapSlides.find(m_arrSlidesOrder[i]);
|
||||
|
||||
@ -382,12 +440,10 @@ void CPPTUserInfo::FromDocument()
|
||||
|
||||
DurationSlide = PPT_DEFAULT_SLIDE_DURATION;
|
||||
|
||||
CSlide *elm = new CSlide();
|
||||
m_arSlides.push_back(elm);
|
||||
// тут его заполняем...
|
||||
m_arSlides.push_back(new CSlide());
|
||||
|
||||
// если на слайде есть анимации
|
||||
std::map <DWORD, Animations::CSlideTimeLine*>::iterator pTimeLine = m_mapAnimations.find( pPair->first);
|
||||
std::map <DWORD, Animations::CSlideTimeLine*>::iterator pTimeLine = m_mapAnimations.find( pPair->first);
|
||||
|
||||
if ( m_mapAnimations.end() != pTimeLine )
|
||||
{
|
||||
@ -409,12 +465,196 @@ void CPPTUserInfo::FromDocument()
|
||||
pSlide->m_lWidth = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginWidth);
|
||||
pSlide->m_lHeight = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginHeight);
|
||||
|
||||
LoadSlide ( pPair->first, m_arSlides.back());
|
||||
LoadSlide ( pPair->first, pSlide);
|
||||
}
|
||||
|
||||
m_arNotes.reserve(m_arrNotesOrder.size());
|
||||
for (size_t i = 0; i< m_arrNotesOrder.size(); i++)
|
||||
{
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapNotes.find(m_arrNotesOrder[i]);
|
||||
|
||||
if (pPair == m_mapNotes.end())
|
||||
continue;
|
||||
|
||||
LoadNotesFromPrevUsers ( pPair->first );
|
||||
|
||||
DurationSlide = PPT_DEFAULT_SLIDE_DURATION;
|
||||
|
||||
m_arNotes.push_back(new CSlide());
|
||||
|
||||
CSlide* pSlide = m_arNotes.back();
|
||||
|
||||
pSlide->m_lOriginalWidth = lOriginWidth;
|
||||
pSlide->m_lOriginalHeight = lOriginHeight;
|
||||
|
||||
pSlide->m_lWidth = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginWidth);
|
||||
pSlide->m_lHeight = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginHeight);
|
||||
|
||||
LoadNotes ( pPair->first, pSlide);
|
||||
}
|
||||
|
||||
CalculateEditor(m_oInfo);
|
||||
}
|
||||
|
||||
void CPPTUserInfo::LoadNotes(DWORD dwNoteID, CSlide* pNotes)
|
||||
{
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPairNotes = m_mapNotes.find(dwNoteID);
|
||||
|
||||
if (pPairNotes == m_mapNotes.end()) return;
|
||||
|
||||
CRecordSlide* pRecordSlide = pPairNotes->second;
|
||||
|
||||
if (NULL == pRecordSlide) return;
|
||||
|
||||
pNotes->m_bUseLayoutColorScheme = true;
|
||||
|
||||
CSlideInfo slide_info;
|
||||
m_arNotesWrapper.push_back(slide_info);
|
||||
|
||||
CSlideInfo* pNotesWrapper = &m_arNotesWrapper.back();
|
||||
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
|
||||
pNotesWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
pNotesWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
//грузим placeholder
|
||||
pNotesWrapper->m_arTextPlaceHolders = pRecordSlide->m_oPersist.m_arTextAttrs;
|
||||
|
||||
std::vector<CRecordNotesAtom*> oArrayNotesAtoms;
|
||||
pRecordSlide->GetRecordsByType(&oArrayNotesAtoms, false, true);
|
||||
if (0 == oArrayNotesAtoms.size())
|
||||
{
|
||||
// ошибка!!!
|
||||
return;
|
||||
}
|
||||
bool bMasterColorScheme = oArrayNotesAtoms[0]->m_bMasterScheme;
|
||||
bool bMasterBackGround = oArrayNotesAtoms[0]->m_bMasterBackground;
|
||||
bool bMasterObjects = oArrayNotesAtoms[0]->m_bMasterObjects;
|
||||
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPairSlide = m_mapSlides.find(oArrayNotesAtoms[0]->m_nSlideIDRef);
|
||||
|
||||
if (pPairSlide == m_mapSlides.end())
|
||||
{
|
||||
//????? у заметок нет слайда !!!
|
||||
}
|
||||
//-----------------------------------------------------
|
||||
CSlide* pSlide = m_arSlides[pPairSlide->second->m_Index];
|
||||
|
||||
pNotes->m_lSlideID = pPairSlide->second->m_Index;
|
||||
pSlide->m_lNotesID = m_arNotes.size() - 1;
|
||||
//-----------------------------------------------------
|
||||
|
||||
CTheme * pTheme = m_pNotesMaster;
|
||||
CSlideInfo * pThemeWrapper = m_pNotesMasterWrapper;
|
||||
|
||||
CLayout* pLayout = NULL;
|
||||
//-----------------------------------------------------
|
||||
std::vector<NSPresentationEditor::CColor>* pArrayColorScheme = pTheme ? &pTheme->m_arColorScheme : NULL;
|
||||
|
||||
// читаем цветовую схему -----------------------------------------------------------
|
||||
pNotes->m_bUseLayoutColorScheme = true;
|
||||
if (!bMasterColorScheme)
|
||||
{
|
||||
std::vector<CRecordColorSchemeAtom*> oArrayColors;
|
||||
pRecordSlide->GetRecordsByType(&oArrayColors, false);
|
||||
|
||||
for (size_t i = 0; i < oArrayColors.size(); ++i)
|
||||
{
|
||||
if (0x01 == oArrayColors[i]->m_oHeader.RecInstance)
|
||||
{
|
||||
pNotes->m_bUseLayoutColorScheme = false;
|
||||
oArrayColors[i]->ToArray(&pNotes->m_arColorScheme);
|
||||
CorrectColorScheme(pNotes->m_arColorScheme);
|
||||
|
||||
// проверим на совпадение
|
||||
size_t nCountC = pNotes->m_arColorScheme.size();
|
||||
size_t nIndexC = 0;
|
||||
if (pArrayColorScheme && nCountC == pArrayColorScheme->size())
|
||||
{
|
||||
for (; nIndexC < nCountC; ++nIndexC)
|
||||
{
|
||||
if (pNotes->m_arColorScheme[i].IsEqual(pArrayColorScheme->at(i)))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (nIndexC == nCountC)
|
||||
{
|
||||
pNotes->m_bUseLayoutColorScheme = true;
|
||||
pNotes->m_arColorScheme.clear();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------
|
||||
bool bHasDate = false;
|
||||
bool bHasSlideNumber = false;
|
||||
bool bHasFooter = false;
|
||||
int nFormatDate = 1;
|
||||
|
||||
std::vector<CRecordHeadersFootersContainer*> oArrayHeadersFootersInfo;
|
||||
pRecordSlide->GetRecordsByType(&oArrayHeadersFootersInfo, true, false);
|
||||
|
||||
if (!oArrayHeadersFootersInfo.empty())
|
||||
{
|
||||
if (oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom)
|
||||
{
|
||||
bHasDate = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasDate ||
|
||||
oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasTodayDate ||
|
||||
oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasUserDate;
|
||||
bHasFooter = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasFooter;
|
||||
bHasSlideNumber = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasSlideNumber;
|
||||
|
||||
if (oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasUserDate) nFormatDate = 2;
|
||||
}
|
||||
for (int i = 0 ; i < 3; i++)
|
||||
pNotes->m_PlaceholdersReplaceString[i] = oArrayHeadersFootersInfo[0]->m_HeadersFootersString[i];
|
||||
}
|
||||
//------------- читаем все элементы ------------------------------------------------------------------------------------------
|
||||
pNotes->m_bIsBackground = false;
|
||||
|
||||
std::vector<CRecordShapeContainer*> oArrayShapes;
|
||||
pRecordSlide->GetRecordsByType(&oArrayShapes, true);
|
||||
|
||||
for (size_t nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
IElement* pElement = NULL;
|
||||
|
||||
oArrayShapes[nShape]->GetElement(&pElement, &m_oExMedia, pNotes->m_lOriginalWidth, pNotes->m_lOriginalHeight,
|
||||
pTheme, pLayout, pThemeWrapper, pNotesWrapper, pNotes);
|
||||
|
||||
if (NULL != pElement)
|
||||
{
|
||||
if (pElement->m_bIsBackground && !pElement->m_bHaveAnchor && !bMasterBackGround)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
if (NULL != pShape)
|
||||
{
|
||||
pShape->SetupProperties(pNotes, pTheme, pLayout);
|
||||
|
||||
pNotes->m_bIsBackground = true;
|
||||
pNotes->m_oBackground = pShape->m_oBrush;
|
||||
}
|
||||
RELEASEOBJECT(pElement);
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
if (pElement->m_bHaveAnchor)
|
||||
{
|
||||
pNotes->m_arElements.push_back(pElement);
|
||||
}
|
||||
if ( pElement->m_lPlaceholderType >0)
|
||||
{
|
||||
pNotes->m_mapPlaceholders.insert(std::pair<int, int>(pElement->m_lPlaceholderType, pNotes->m_arElements.size()-1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
{
|
||||
@ -562,7 +802,7 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
std::vector<CRecordColorSchemeAtom*> oArrayColors;
|
||||
pRecordSlide->GetRecordsByType(&oArrayColors, false);
|
||||
|
||||
for (int i = 0; i < oArrayColors.size(); ++i)
|
||||
for (size_t i = 0; i < oArrayColors.size(); ++i)
|
||||
{
|
||||
if (0x01 == oArrayColors[i]->m_oHeader.RecInstance)
|
||||
{
|
||||
@ -573,7 +813,7 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
// проверим на совпадение
|
||||
size_t nCountC = pSlide->m_arColorScheme.size();
|
||||
size_t nIndexC = 0;
|
||||
if (nCountC == pArrayColorScheme->size())
|
||||
if (pArrayColorScheme && nCountC == pArrayColorScheme->size())
|
||||
{
|
||||
for (; nIndexC < nCountC; ++nIndexC)
|
||||
{
|
||||
@ -628,7 +868,7 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
std::vector<CRecordCString*> oArrayStrings;
|
||||
pRecordSlide->GetRecordsByType(&oArrayStrings, false, false);
|
||||
|
||||
for (int i=0; i < oArrayStrings.size(); i++)
|
||||
for (size_t i = 0; i < oArrayStrings.size(); i++)
|
||||
{
|
||||
if (oArrayStrings[i]->m_oHeader.RecType == 0x0fba)
|
||||
{
|
||||
@ -642,7 +882,7 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
|
||||
pSlide->m_bIsBackground = false;
|
||||
|
||||
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
for (size_t nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
IElement* pElement = NULL;
|
||||
|
||||
@ -1029,7 +1269,8 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
}
|
||||
std::vector<CRecordCString*> oArrayStrings;
|
||||
pMaster->GetRecordsByType(&oArrayStrings, false, false);
|
||||
for (int i=0; i < oArrayStrings.size(); i++)
|
||||
|
||||
for (size_t i = 0; i < oArrayStrings.size(); i++)
|
||||
{
|
||||
if (oArrayStrings[i]->m_oHeader.RecType == 0x0fba)
|
||||
{
|
||||
@ -1100,7 +1341,7 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
std::vector<CRecordTextMasterStyleAtom*> oArrayTextMasters;
|
||||
pMaster->GetRecordsByType(&oArrayTextMasters, true, false);
|
||||
|
||||
for (int i = 0; i < oArrayTextMasters.size(); ++i)
|
||||
for (size_t i = 0; i < oArrayTextMasters.size(); ++i)
|
||||
{
|
||||
LONG lType = (LONG)oArrayTextMasters[i]->m_oHeader.RecInstance;
|
||||
if ((0 > lType) || (lType > 8))
|
||||
@ -1142,7 +1383,7 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
|
||||
CLayout* pLayout = NULL; // ну нету тут разметок ...!!
|
||||
|
||||
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
for (size_t nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
NSPresentationEditor::IElement* pElement = NULL;
|
||||
oArrayShapes[nShape]->GetElement(&pElement, &m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pMasterWrapper, pMasterWrapper);
|
||||
@ -1177,7 +1418,7 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
|
||||
void CPPTUserInfo::LoadMasters(const LONG& lOriginWidth, const LONG& lOriginHeight)
|
||||
{
|
||||
for (long i=0; i< m_arrMastersOrder.size(); i++)
|
||||
for (size_t i = 0; i< m_arrMastersOrder.size(); i++)
|
||||
{
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapMasters.find(m_arrMastersOrder[i]);
|
||||
if (pPair == m_mapMasters.end())continue;
|
||||
@ -1185,15 +1426,244 @@ void CPPTUserInfo::LoadMasters(const LONG& lOriginWidth, const LONG& lOriginHeig
|
||||
LoadMainMaster(pPair->first, lOriginWidth, lOriginHeight);
|
||||
}
|
||||
|
||||
for (long i=0; i< m_arrMastersOrder.size(); i++)
|
||||
for (size_t i = 0; i< m_arrMastersOrder.size(); i++)
|
||||
{
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapMasters.find(m_arrMastersOrder[i]);
|
||||
if (pPair == m_mapMasters.end())continue;
|
||||
|
||||
LoadNoMainMaster(pPair->first, lOriginWidth, lOriginHeight);
|
||||
}
|
||||
}
|
||||
|
||||
LoadNotesMasterFromPrevUsers(0);
|
||||
if (!m_mapNotesMasters.empty())
|
||||
{
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapNotesMasters.begin();
|
||||
|
||||
LoadMaster(pPair->second, m_pNotesMasterWrapper, m_pNotesMaster);
|
||||
}
|
||||
|
||||
LoadHandoutMasterFromPrevUsers(0);
|
||||
if (!m_mapHandoutMasters.empty())
|
||||
{
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapHandoutMasters.begin();
|
||||
|
||||
LoadMaster(pPair->second, m_pHandoutMasterWrapper, m_pHandoutMaster);
|
||||
}
|
||||
}
|
||||
void CPPTUserInfo::LoadMaster(CRecordSlide* pMaster, CSlideInfo *& pMasterWrapper, CTheme *& pTheme)
|
||||
{
|
||||
if (pMaster == NULL)
|
||||
return;
|
||||
|
||||
LONG lOriginWidth = 0, lOriginHeight = 0;
|
||||
|
||||
bool bMasterColorScheme = false;
|
||||
bool bMasterBackGround = false;
|
||||
bool bMasterObjects = false;
|
||||
|
||||
DWORD dwID = 0;
|
||||
|
||||
std::vector<CRecordSlideAtom*> oArraySlideAtoms;
|
||||
pMaster->GetRecordsByType(&oArraySlideAtoms, true);
|
||||
|
||||
if (!oArraySlideAtoms.empty())
|
||||
{
|
||||
dwID = (DWORD)oArraySlideAtoms[0]->m_nMasterIDRef;
|
||||
|
||||
bMasterColorScheme = oArraySlideAtoms[0]->m_bMasterScheme;
|
||||
bMasterBackGround = oArraySlideAtoms[0]->m_bMasterBackground;
|
||||
bMasterObjects = oArraySlideAtoms[0]->m_bMasterObjects;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<CRecordNotesAtom*> oArrayNotesAtoms;
|
||||
pMaster->GetRecordsByType(&oArrayNotesAtoms, true);
|
||||
|
||||
if (!oArrayNotesAtoms.empty())
|
||||
{
|
||||
dwID = (DWORD)oArrayNotesAtoms[0]->m_nSlideIDRef;
|
||||
|
||||
bMasterColorScheme = oArrayNotesAtoms[0]->m_bMasterScheme;
|
||||
bMasterBackGround = oArrayNotesAtoms[0]->m_bMasterBackground;
|
||||
bMasterObjects = oArrayNotesAtoms[0]->m_bMasterObjects;
|
||||
}
|
||||
}
|
||||
|
||||
pTheme = new CTheme();
|
||||
|
||||
pTheme->m_lOriginalWidth = lOriginWidth;
|
||||
pTheme->m_lOriginalHeight = lOriginHeight;
|
||||
|
||||
std::vector<CRecordHeadersFootersContainer*> oArrayHeadersFootersInfo;
|
||||
pMaster->GetRecordsByType(&oArrayHeadersFootersInfo, true, false);
|
||||
|
||||
if (0 != oArrayHeadersFootersInfo.size())
|
||||
{
|
||||
if (oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom)
|
||||
{
|
||||
pTheme->m_bHasDate = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasDate ||
|
||||
oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasTodayDate ||
|
||||
oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasUserDate;
|
||||
pTheme->m_bHasFooter = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasFooter;
|
||||
pTheme->m_bHasSlideNumber = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasSlideNumber;
|
||||
|
||||
if (oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasUserDate ) pTheme->m_nFormatDate = 2;
|
||||
}
|
||||
for(int i = 0 ; i< 3; i++) pTheme->m_PlaceholdersReplaceString[i] = oArrayHeadersFootersInfo[0]->m_HeadersFootersString[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
pTheme->m_bHasDate = m_bHasDate;
|
||||
pTheme->m_bHasFooter = m_bHasFooter;
|
||||
pTheme->m_bHasSlideNumber = m_bHasSlideNumber;
|
||||
pTheme->m_nFormatDate = m_nFormatDate;
|
||||
for (int i = 0 ; i < 3; i++) pTheme->m_PlaceholdersReplaceString[i] = m_PlaceholdersReplaceString[i];
|
||||
}
|
||||
std::vector<CRecordCString*> oArrayStrings;
|
||||
pMaster->GetRecordsByType(&oArrayStrings, false, false);
|
||||
|
||||
for (size_t i = 0; i < oArrayStrings.size(); i++)
|
||||
{
|
||||
if (oArrayStrings[i]->m_oHeader.RecType == 0x0fba)
|
||||
{
|
||||
pTheme->m_sThemeName = oArrayStrings[i]->m_strText;
|
||||
}
|
||||
}
|
||||
|
||||
pMasterWrapper = new CSlideInfo();
|
||||
|
||||
// записываем шрифты ---------------------------------------------------------------
|
||||
int nCountFonts = m_arrFonts.size();
|
||||
for (int i = 0; i < nCountFonts; ++i)
|
||||
{
|
||||
pTheme->m_arFonts.push_back(m_arrFonts[i]);
|
||||
}
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
// читаем цветовую схему -----------------------------------------------------------
|
||||
std::vector<CRecordColorSchemeAtom*> oArrayColors;
|
||||
pMaster->GetRecordsByType(&oArrayColors, false);
|
||||
|
||||
int nColorCount = oArrayColors.size();
|
||||
for (int i = 0; i < nColorCount; ++i)
|
||||
{
|
||||
if (0x01 == oArrayColors[i]->m_oHeader.RecInstance)
|
||||
{
|
||||
if ( m_oSchemeColors.empty())
|
||||
{
|
||||
oArrayColors[i]->ToArray(&m_oSchemeColors);
|
||||
CorrectColorScheme(m_oSchemeColors);//??
|
||||
}
|
||||
if ( pTheme->m_arColorScheme.empty())
|
||||
{
|
||||
oArrayColors[i]->ToArray(&pTheme->m_arColorScheme);
|
||||
CorrectColorScheme(pTheme->m_arColorScheme);
|
||||
}
|
||||
}
|
||||
|
||||
if (0x06 == oArrayColors[i]->m_oHeader.RecInstance)
|
||||
{
|
||||
std::vector<CColor> extra;
|
||||
oArrayColors[i]->ToArray(&extra);
|
||||
|
||||
CorrectColorScheme(extra);
|
||||
pTheme->m_arExtraColorScheme.push_back(extra);
|
||||
}
|
||||
}
|
||||
if (pTheme->m_arColorScheme.empty() && !pTheme->m_arExtraColorScheme.empty())
|
||||
{
|
||||
pTheme->m_arColorScheme = pTheme->m_arExtraColorScheme[0];
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
int indexUser = 0;
|
||||
//std::map<DWORD, CRecordSlide*>::iterator pPairMaster1 = m_mapMasters.find(dwMasterID);
|
||||
//if (pPairMaster1 != m_mapMasters.end())
|
||||
//{
|
||||
// indexUser = pPairMaster1->second->m_IndexUser;
|
||||
// pMasterWrapper->m_arTextPlaceHolders = pPairMaster1->second->m_oPersist.m_arTextAttrs;
|
||||
//}
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
pMasterWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
// читаем настройки текстовых стилей -----------------------------------------------
|
||||
std::vector<CRecordTextMasterStyleAtom*> oArrayTextMasters;
|
||||
pMaster->GetRecordsByType(&oArrayTextMasters, true, false);
|
||||
|
||||
for (size_t i = 0; i < oArrayTextMasters.size(); ++i)
|
||||
{
|
||||
LONG lType = (LONG)oArrayTextMasters[i]->m_oHeader.RecInstance;
|
||||
if ((0 > lType) || (lType > 8))
|
||||
continue;
|
||||
|
||||
pMasterWrapper->m_pStyles[lType] = new NSPresentationEditor::CTextStyles();
|
||||
pMasterWrapper->m_pStyles[lType]->SetStyles((NSPresentationEditor::CTextStyles*)oArrayTextMasters[i]);
|
||||
|
||||
CTheme::CalculateStyle(pTheme, pMasterWrapper->m_pStyles[lType].get());
|
||||
}
|
||||
if (pMasterWrapper->m_pStyles[3].is_init())
|
||||
pMasterWrapper->m_pStyles[3]->ApplyBefore(m_oDefaultTextStyle);
|
||||
else
|
||||
pMasterWrapper->m_pStyles[3] = m_oDefaultTextStyle;
|
||||
|
||||
CTextStyles oPPTDefaultStyle;
|
||||
CreateDefaultStyle(oPPTDefaultStyle, pTheme);
|
||||
oPPTDefaultStyle.ApplyAfter(m_oDefaultTextStyle);
|
||||
|
||||
// выставим стили теме
|
||||
pTheme->m_pStyles[0] = oPPTDefaultStyle;
|
||||
pTheme->m_pStyles[1] = oPPTDefaultStyle;
|
||||
pTheme->m_pStyles[2] = oPPTDefaultStyle;
|
||||
pTheme->m_pStyles[3] = oPPTDefaultStyle;
|
||||
|
||||
if (pMasterWrapper->m_pStyles[0].is_init())
|
||||
pTheme->m_pStyles[1].ApplyAfter(pMasterWrapper->m_pStyles[0].get());
|
||||
if (pMasterWrapper->m_pStyles[1].is_init())
|
||||
pTheme->m_pStyles[2].ApplyAfter(pMasterWrapper->m_pStyles[1].get());
|
||||
if (pMasterWrapper->m_pStyles[2].is_init())
|
||||
pTheme->m_pStyles[3].ApplyAfter(pMasterWrapper->m_pStyles[3].get());
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// читаем все элементы...-----------------------------------------------------------
|
||||
std::vector<CRecordShapeContainer*> oArrayShapes;
|
||||
pMaster->GetRecordsByType(&oArrayShapes, true);
|
||||
|
||||
pTheme->CalculateStyles();
|
||||
|
||||
CLayout* pLayout = NULL; // ну нету тут разметок ...!!
|
||||
|
||||
for (size_t nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
NSPresentationEditor::IElement* pElement = NULL;
|
||||
oArrayShapes[nShape]->GetElement(&pElement, &m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pMasterWrapper, pMasterWrapper);
|
||||
|
||||
if (NULL != pElement)
|
||||
{
|
||||
//AddAnimation ( dwMasterID, lOriginWidth, lOriginHeight, pElement );
|
||||
|
||||
if (pElement->m_bIsBackground && !pElement->m_bHaveAnchor)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
if (NULL != pShape)
|
||||
{
|
||||
pShape->SetupProperties(NULL, pTheme, pLayout);
|
||||
|
||||
pTheme->m_bIsBackground = true;
|
||||
pTheme->m_oBackground = pShape->m_oBrush;
|
||||
}
|
||||
|
||||
RELEASEINTERFACE(pElement);
|
||||
continue;
|
||||
}
|
||||
pTheme->m_arElements.push_back(pElement);
|
||||
|
||||
if ( pElement->m_lPlaceholderType > 0)
|
||||
{
|
||||
pTheme->m_mapPlaceholders.insert(std::pair<int, int>(pElement->m_lPlaceholderType, pTheme->m_arElements.size()-1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, const LONG& lOriginHeight)
|
||||
{
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapMasters.find(dwMasterID);
|
||||
@ -1266,10 +1736,10 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
|
||||
CLayout* pLayout = NULL;
|
||||
|
||||
int lLayoutID = AddNewLayout(pTheme, pCurMaster, false, false);
|
||||
int lLayoutID = AddNewLayout(pTheme, pCurMaster, false, false);
|
||||
|
||||
pLayout = &pTheme->m_arLayouts[lLayoutID];
|
||||
pLayout->m_bShowMasterShapes = false;
|
||||
pLayout->m_bShowMasterShapes = false;
|
||||
|
||||
pTheme->m_mapTitleLayout[dwMasterID] = lLayoutID;
|
||||
|
||||
@ -1281,7 +1751,7 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
pCurMaster->GetRecordsByType(&oArrayColors, false);
|
||||
|
||||
pLayout->m_arColorScheme.clear();
|
||||
for (int i = 0; i < oArrayColors.size(); ++i)
|
||||
for (size_t i = 0; i < oArrayColors.size(); ++i)
|
||||
{
|
||||
if (0x01 == oArrayColors[i]->m_oHeader.RecInstance)
|
||||
{
|
||||
@ -1292,7 +1762,7 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
// проверим на совпадение
|
||||
size_t nCountC = pLayout->m_arColorScheme.size();
|
||||
size_t nIndexC = 0;
|
||||
if (nCountC == pArrayColorScheme->size())
|
||||
if (pArrayColorScheme && nCountC == pArrayColorScheme->size())
|
||||
{
|
||||
for (; nIndexC < nCountC; ++nIndexC)
|
||||
{
|
||||
@ -1341,7 +1811,7 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
std::vector<CRecordCString*> oArrayStrings;
|
||||
pCurMaster->GetRecordsByType(&oArrayStrings, false, false);
|
||||
|
||||
for (int i=0; i < oArrayStrings.size(); i++)
|
||||
for (size_t i = 0; i < oArrayStrings.size(); i++)
|
||||
{
|
||||
if (oArrayStrings[i]->m_oHeader.RecType == 0x0fba)
|
||||
{
|
||||
@ -1352,7 +1822,7 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
std::vector<CRecordShapeContainer*> oArrayShapes;
|
||||
pCurMaster->GetRecordsByType(&oArrayShapes, true);
|
||||
|
||||
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
for (size_t nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
IElement* pElement = NULL;
|
||||
oArrayShapes[nShape]->GetElement(&pElement, &m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pThemeWrapper, pMasterWrapper);
|
||||
@ -1467,7 +1937,7 @@ void CPPTUserInfo::LoadMasterFromPrevUsers(DWORD dwMasterID)
|
||||
|
||||
size_t lUsersCount = m_pDocumentInfo->m_arUsers.size();
|
||||
|
||||
for (int lIndexUser = m_lIndexThisUser + 1; lIndexUser < lUsersCount; ++lIndexUser)
|
||||
for (size_t lIndexUser = m_lIndexThisUser + 1; lIndexUser < lUsersCount; ++lIndexUser)
|
||||
{
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPair = m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapMasters.find(dwMasterID);
|
||||
|
||||
@ -1496,23 +1966,21 @@ void CPPTUserInfo::LoadMasterFromPrevUsers(DWORD dwMasterID)
|
||||
}
|
||||
}
|
||||
}
|
||||
void CPPTUserInfo::LoadNoteFromPrevUsers(DWORD dwSlideID)
|
||||
void CPPTUserInfo::LoadNotesFromPrevUsers(DWORD dwSlideID)
|
||||
{
|
||||
if ((NULL == m_pDocumentInfo) || (-1 == m_lIndexThisUser))
|
||||
return;
|
||||
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapNotes.find(dwSlideID);
|
||||
if (pPair != m_mapNotes.end())
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPairSlide = m_mapNotes.find(dwSlideID);
|
||||
|
||||
if (pPairSlide != m_mapNotes.end() && pPairSlide->second)
|
||||
return; //есть
|
||||
|
||||
|
||||
size_t lUsersCount = m_pDocumentInfo->m_arUsers.size();
|
||||
|
||||
// у нас чем раньше - тем больше индекс
|
||||
for (size_t lIndexUser = m_lIndexThisUser + 1; lIndexUser < lUsersCount; lIndexUser++)
|
||||
//for (size_t lIndexUser = lUsersCount - 1; lIndexUser > m_lIndexThisUser; lIndexUser--)
|
||||
{
|
||||
pPair = m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapNotes.find(dwSlideID);
|
||||
|
||||
for (size_t lIndexUser = m_lIndexThisUser + 1; lIndexUser < lUsersCount; ++lIndexUser)
|
||||
{
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPair = m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapNotes.find(dwSlideID);
|
||||
if (pPair == m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapNotes.end())
|
||||
continue;
|
||||
|
||||
@ -1520,13 +1988,103 @@ void CPPTUserInfo::LoadNoteFromPrevUsers(DWORD dwSlideID)
|
||||
if (NULL != pSlideCur)
|
||||
{
|
||||
pSlideCur->AddRef();
|
||||
m_mapNotes.insert(std::pair<DWORD, CRecordSlide*>(dwSlideID, pSlideCur));
|
||||
m_arrNotesOrder.push_back(dwSlideID);
|
||||
|
||||
pSlideCur->m_IndexUser = lIndexUser;
|
||||
|
||||
if (pPairSlide != m_mapNotes.end())
|
||||
{
|
||||
pPairSlide->second = pSlideCur;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_mapNotes.insert(m_mapSlides.end(), std::pair<DWORD, CRecordSlide*>(dwSlideID, pSlideCur));
|
||||
m_arrNotesOrder.push_back(dwSlideID);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CPPTUserInfo::LoadNotesMasterFromPrevUsers(DWORD dwMasterID)
|
||||
{
|
||||
if ((NULL == m_pDocumentInfo) || (-1 == m_lIndexThisUser))
|
||||
return;
|
||||
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPairMaster = m_mapNotesMasters.find(dwMasterID);
|
||||
|
||||
if (pPairMaster != m_mapNotesMasters.end() && pPairMaster->second)
|
||||
return;//есть
|
||||
|
||||
size_t lUsersCount = m_pDocumentInfo->m_arUsers.size();
|
||||
|
||||
for (size_t lIndexUser = m_lIndexThisUser + 1; lIndexUser < lUsersCount; ++lIndexUser)
|
||||
{
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPair = m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapNotesMasters.find(dwMasterID);
|
||||
|
||||
if (pPair == m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapNotesMasters.end())
|
||||
continue;
|
||||
|
||||
CRecordSlide* pSlideCur = pPair->second;
|
||||
if (NULL != pSlideCur)
|
||||
{
|
||||
pSlideCur->AddRef();
|
||||
|
||||
//для каждого пользователя СВОИ активные картинки !!!
|
||||
pSlideCur->m_IndexUser = lIndexUser;
|
||||
|
||||
if (pPairMaster != m_mapNotesMasters.end())
|
||||
{
|
||||
//был найден ранее нулевым
|
||||
pPairMaster->second = pSlideCur;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_mapNotesMasters.insert(m_mapNotesMasters.end(), std::pair<DWORD, CRecordSlide*>(dwMasterID, pSlideCur));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
void CPPTUserInfo::LoadHandoutMasterFromPrevUsers(DWORD dwMasterID)
|
||||
{
|
||||
if ((NULL == m_pDocumentInfo) || (-1 == m_lIndexThisUser))
|
||||
return;
|
||||
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPairMaster = m_mapHandoutMasters.find(dwMasterID);
|
||||
|
||||
if (pPairMaster != m_mapHandoutMasters.end() && pPairMaster->second)
|
||||
return;//есть
|
||||
|
||||
size_t lUsersCount = m_pDocumentInfo->m_arUsers.size();
|
||||
|
||||
for (size_t lIndexUser = m_lIndexThisUser + 1; lIndexUser < lUsersCount; ++lIndexUser)
|
||||
{
|
||||
std::map<DWORD, CRecordSlide*>::iterator pPair = m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapHandoutMasters.find(dwMasterID);
|
||||
|
||||
if (pPair == m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapHandoutMasters.end())
|
||||
continue;
|
||||
|
||||
CRecordSlide* pSlideCur = pPair->second;
|
||||
if (NULL != pSlideCur)
|
||||
{
|
||||
pSlideCur->AddRef();
|
||||
|
||||
//для каждого пользователя СВОИ активные картинки !!!
|
||||
pSlideCur->m_IndexUser = lIndexUser;
|
||||
|
||||
if (pPairMaster != m_mapHandoutMasters.end())
|
||||
{
|
||||
//был найден ранее нулевым
|
||||
pPairMaster->second = pSlideCur;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_mapHandoutMasters.insert(m_mapHandoutMasters.end(), std::pair<DWORD, CRecordSlide*>(dwMasterID, pSlideCur));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
void CPPTUserInfo::LoadExternal(CRecordExObjListContainer* pExObjects)
|
||||
{
|
||||
// читаем SoundCollection
|
||||
@ -1569,7 +2127,7 @@ void CPPTUserInfo::LoadExternal(CRecordExObjListContainer* pExObjects)
|
||||
std::vector<CRecordExVideoContainer*> oArray;
|
||||
pExObjects->GetRecordsByType(&oArray, true);
|
||||
|
||||
for (int nIndex = 0; nIndex < oArray.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < oArray.size(); ++nIndex)
|
||||
{
|
||||
LoadExVideo(oArray[nIndex]);
|
||||
}
|
||||
@ -1588,15 +2146,15 @@ void CPPTUserInfo::LoadExternal(CRecordExObjListContainer* pExObjects)
|
||||
pExObjects->GetRecordsByType(&oArrayWAVLink , true);
|
||||
pExObjects->GetRecordsByType(&oArrayAudioEmbedded , true);
|
||||
|
||||
for (int nIndex = 0; nIndex < oArrayAudioMIDI.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < oArrayAudioMIDI.size(); ++nIndex)
|
||||
{
|
||||
LoadExAudio(oArrayAudioMIDI[nIndex]);
|
||||
}
|
||||
for (int nIndex = 0; nIndex < oArrayWAVLink.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < oArrayWAVLink.size(); ++nIndex)
|
||||
{
|
||||
LoadExAudio(oArrayWAVLink[nIndex]);
|
||||
}
|
||||
for (int nIndex = 0; nIndex < oArrayAudioEmbedded.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < oArrayAudioEmbedded.size(); ++nIndex)
|
||||
{
|
||||
DWORD dwKeySound = oArrayAudioEmbedded[nIndex]->m_nSoundID;
|
||||
DWORD dwKeyObj = oArrayAudioEmbedded[nIndex]->m_oMedia.m_nExObjID;
|
||||
@ -1613,7 +2171,7 @@ void CPPTUserInfo::LoadExternal(CRecordExObjListContainer* pExObjects)
|
||||
m_oExMedia.m_arAudios.push_back(oAudio);
|
||||
}
|
||||
}
|
||||
for (int nIndex = 0; nIndex < oArrayAudioCD.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < oArrayAudioCD.size(); ++nIndex)
|
||||
{
|
||||
DWORD dwKeyObj = oArrayAudioCD[nIndex]->m_oMedia.m_nExObjID;
|
||||
|
||||
@ -1633,7 +2191,7 @@ void CPPTUserInfo::LoadExternal(CRecordExObjListContainer* pExObjects)
|
||||
|
||||
pExObjects->GetRecordsByType(&oArrayHyperlinkContainer , true);
|
||||
|
||||
for (int nIndex = 0; nIndex < oArrayHyperlinkContainer.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < oArrayHyperlinkContainer.size(); ++nIndex)
|
||||
{
|
||||
std::vector<CRecordExHyperlinkAtom*> oArrayHyperlink;
|
||||
std::vector<CRecordCString*> oArrayCString;
|
||||
@ -1645,8 +2203,8 @@ void CPPTUserInfo::LoadExternal(CRecordExObjListContainer* pExObjects)
|
||||
{
|
||||
NSPresentationEditor::CExFilesInfo oInfo;
|
||||
|
||||
oInfo.m_dwID = oArrayHyperlink[0]->m_nHyperlinkID;
|
||||
for (int i = 0 ; i < oArrayCString.size(); i++)
|
||||
oInfo.m_dwID = oArrayHyperlink[0]->m_nHyperlinkID;
|
||||
for (size_t i = 0 ; i < oArrayCString.size(); i++)
|
||||
{
|
||||
if (oArrayCString[i]->m_oHeader.RecInstance == 1)
|
||||
oInfo.m_strFilePath = oArrayCString[i]->m_strText;
|
||||
|
||||
@ -47,12 +47,13 @@ public:
|
||||
std::map<DWORD, DWORD> m_mapOffsetInPIDs;
|
||||
CRecordDocument m_oDocument;
|
||||
|
||||
//todooo при переходе на C++11 использовать НУЖНЫЙ здесь unsorted_map - m_arr .. Order уберутся
|
||||
|
||||
std::map<DWORD, CRecordSlide*> m_mapSlides;
|
||||
std::map<DWORD, CRecordSlide*> m_mapMasters;
|
||||
std::map<DWORD, CRecordSlide*> m_mapNotes;
|
||||
|
||||
std::map<DWORD, CRecordSlide*> m_mapNotesMasters;
|
||||
std::map<DWORD, CRecordSlide*> m_mapHandoutMasters;
|
||||
|
||||
std::vector<DWORD> m_arrSlidesOrder;
|
||||
std::vector<DWORD> m_arrMastersOrder;
|
||||
std::vector<DWORD> m_arrNotesOrder;
|
||||
@ -66,6 +67,10 @@ public:
|
||||
// это как бы ППT-шная обертка над слайдом
|
||||
std::vector<CSlideInfo> m_arSlideWrapper;
|
||||
std::vector<CSlideInfo> m_arMasterWrapper;
|
||||
std::vector<CSlideInfo> m_arNotesWrapper;
|
||||
|
||||
CSlideInfo* m_pNotesMasterWrapper;
|
||||
CSlideInfo* m_pHandoutMasterWrapper;
|
||||
|
||||
// эти параметры - одни на весь документ.
|
||||
// чтобы поддержать нашу схему (пптх) - копируем их в темы
|
||||
@ -106,8 +111,8 @@ public:
|
||||
nullable<WORD> m_wLanguage; // язык пользователя (редактора)
|
||||
bool m_bRtl;
|
||||
bool m_bShowComments;
|
||||
public:
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------
|
||||
CPPTUserInfo();
|
||||
~CPPTUserInfo();
|
||||
|
||||
@ -119,15 +124,20 @@ public:
|
||||
void NormalizeCoords(long lWidth, long lHeight);
|
||||
|
||||
void LoadSlide(DWORD dwSlideID, CSlide* pSlide);
|
||||
void LoadNotes(DWORD dwNotesID, CSlide* pSlide);
|
||||
|
||||
void LoadMasters(const LONG& lOriginWidth, const LONG& lOriginHeight);
|
||||
|
||||
void LoadNoMainMaster (DWORD dwMasterID, const LONG& lOriginWidth, const LONG& lOriginHeight);
|
||||
void LoadMainMaster (DWORD dwMasterID, const LONG& lOriginWidth, const LONG& lOriginHeight);
|
||||
|
||||
void LoadMaster(CRecordSlide* pMaster, CSlideInfo *& pMasterWrapper, CTheme *& pTheme);
|
||||
|
||||
void LoadSlideFromPrevUsers (DWORD dwSlideID);
|
||||
void LoadMasterFromPrevUsers(DWORD dwSlideID);
|
||||
void LoadNoteFromPrevUsers (DWORD dwSlideID);
|
||||
void LoadSlideFromPrevUsers (DWORD dwSlideID);
|
||||
void LoadMasterFromPrevUsers (DWORD dwSlideID);
|
||||
void LoadNotesFromPrevUsers (DWORD dwSlideID);
|
||||
void LoadNotesMasterFromPrevUsers (DWORD dwSlideID);
|
||||
void LoadHandoutMasterFromPrevUsers (DWORD dwSlideID);
|
||||
|
||||
void LoadExternal(CRecordExObjListContainer* pExObjects);
|
||||
|
||||
@ -169,7 +179,6 @@ public:
|
||||
|
||||
oScheme = oArrayMem;
|
||||
}
|
||||
|
||||
|
||||
std::wstring ConvertLayoutType(INT nGeom, BYTE* pPlaceholders)
|
||||
{
|
||||
@ -287,6 +296,7 @@ public:
|
||||
return _T("blank");
|
||||
}
|
||||
|
||||
|
||||
void AddAnimation (DWORD dwSlideID, double Width, double Height, IElement* pElement);
|
||||
void AddAudioTransition (DWORD dwSlideID, CTransition* pTransition, const std::wstring& strFilePath);
|
||||
|
||||
|
||||
@ -73,10 +73,26 @@ typedef BYTE BOOL1;
|
||||
#define RECORD_TYPE_EXOBJLIST_ATOM 1034
|
||||
#define RECORD_TYPE_PPDRAWING_GROUP 1035
|
||||
#define RECORD_TYPE_PPDRAWING 1036
|
||||
#define RT_RoundTripTheme12Atom 1038
|
||||
#define RT_RoundTripColorMapping12Atom 1039
|
||||
#define RECORD_TYPE_NAMEDSHOWS 1040
|
||||
#define RECORD_TYPE_NAMEDSHOW 1041
|
||||
#define RECORD_TYPE_NAMEDSHOW_SLIDES 1042
|
||||
#define RECORD_TYPE_SHEET_PROPERTIES 1044
|
||||
|
||||
#define RECORD_TYPE_ORIGINALMAINMASTERID 1052
|
||||
#define RECORD_TYPE_COMPOSITEMASTERID 1053
|
||||
#define RECORD_TYPE_ROUNDTRIPCONTENTMASTERINFO12 1054
|
||||
#define RECORD_TYPE_ROUNDTRIPSHAPEID12 1055
|
||||
#define RECORD_TYPE_ROUNDTRIPHFPLACEHOLDER12 1056
|
||||
#define RECORD_TYPE_ROUNDTRIPCONTENTMASTERID 1058
|
||||
#define RECORD_TYPE_ROUNDTRIPOARTTEXTSTYLES12 1059
|
||||
#define RECORD_TYPE_ROUNDTRIPHEADERFOOTERDEFAULTS12ATOM 1060
|
||||
#define RECORD_TYPE_ROUNDTRIPDOCFLAGS12 1061
|
||||
#define RECORD_TYPE_ROUNDTRIPSHAPECHECKSUMFORCUSTOMLAYOUTS12 1062
|
||||
#define RECORD_TYPE_ROUNDTRIPNOTESMASTERTEXTSTYLES12 1063
|
||||
#define RECORD_TYPE_ROUNDTRIPCUSTOMTABLESTYLES12 1064
|
||||
|
||||
#define RECORD_TYPE_LIST 2000
|
||||
#define RECORD_TYPE_FONTCOLLECTION 2005
|
||||
#define RECORD_TYPE_BOOKMARKCOLLECTION 2019
|
||||
@ -182,19 +198,6 @@ typedef BYTE BOOL1;
|
||||
// Records ~12050 seem to be related to Document Encryption
|
||||
#define RECORD_TYPE_DOCUMENT_ENCRYPTION_ATOM 12052
|
||||
|
||||
#define RECORD_TYPE_ORIGINALMAINMASTERID 1052
|
||||
#define RECORD_TYPE_COMPOSITEMASTERID 1053
|
||||
#define RECORD_TYPE_ROUNDTRIPCONTENTMASTERINFO12 1054
|
||||
#define RECORD_TYPE_ROUNDTRIPSHAPEID12 1055
|
||||
#define RECORD_TYPE_ROUNDTRIPHFPLACEHOLDER12 1056
|
||||
#define RECORD_TYPE_ROUNDTRIPCONTENTMASTERID 1058
|
||||
#define RECORD_TYPE_ROUNDTRIPOARTTEXTSTYLES12 1059
|
||||
#define RECORD_TYPE_ROUNDTRIPHEADERFOOTERDEFAULTS12ATOM 1060
|
||||
#define RECORD_TYPE_ROUNDTRIPDOCFLAGS12 1061
|
||||
#define RECORD_TYPE_ROUNDTRIPSHAPECHECKSUMFORCUSTOMLAYOUTS12 1062
|
||||
#define RECORD_TYPE_ROUNDTRIPNOTESMASTERTEXTSTYLES12 1063
|
||||
#define RECORD_TYPE_ROUNDTRIPCUSTOMTABLESTYLES12 1064
|
||||
|
||||
//records greater then 0xF000 belong to with Microsoft Office Drawing format also known as Escher
|
||||
#define RECORD_TYPE_ESCHER_DGG_CONTAINER 0xF000
|
||||
#define RECORD_TYPE_ESCHER_DGG 0xF006
|
||||
@ -398,48 +401,47 @@ static std::string GetRecordName(DWORD dwType)
|
||||
case RECORD_TYPE_ROUNDTRIPNOTESMASTERTEXTSTYLES12 : { strName = ("RoundTripNotesMasterTextStyles12"); break; }
|
||||
case RECORD_TYPE_ROUNDTRIPCUSTOMTABLESTYLES12 : { strName = ("RoundTripCustomTableStyles12"); break; }
|
||||
|
||||
//records greater then 0xF000 belong to with Microsoft Office Drawing format also known as Escher
|
||||
case RECORD_TYPE_ESCHER_DGG_CONTAINER : { strName = ("Escher_DrawingGroupContainer"); break; }
|
||||
case RECORD_TYPE_ESCHER_DGG : { strName = ("Escher_DrawingGroupRecord"); break; }
|
||||
case RECORD_TYPE_ESCHER_CLSID : { strName = ("Escher_CLSID_Record"); break; }
|
||||
case RECORD_TYPE_ESCHER_OPT : { strName = ("Escher_OPT"); break; }
|
||||
case RECORD_TYPE_ESCHER_BSTORE_CONTAINER : { strName = ("Escher_BlipStoreContainer"); break; }
|
||||
case RECORD_TYPE_ESCHER_BSE : { strName = ("Escher_BlipStoreEntry"); break; }
|
||||
case RECORD_TYPE_ESCHER_BLIP_START : { strName = ("Escher_BlipStart"); break; }
|
||||
case RECORD_TYPE_ESCHER_BLIP_END : { strName = ("Escher_BlipEnd"); break; }
|
||||
case RECORD_TYPE_ESCHER_DG_CONTAINER : { strName = ("Escher_DrawingContainer"); break; }
|
||||
case RECORD_TYPE_ESCHER_DG : { strName = ("Escher_DrawingRecord"); break; }
|
||||
case RECORD_TYPE_ESCHER_REGROUPITEMS : { strName = ("Escher_RegGroupItems"); break; }
|
||||
case RECORD_TYPE_ESCHER_COLORSCHEME : { strName = ("Escher_ColorSheme"); break; }
|
||||
case RECORD_TYPE_ESCHER_SPGR_CONTAINER : { strName = ("Escher_GroupShapeContainer"); break; }
|
||||
case RECORD_TYPE_ESCHER_SP_CONTAINER : { strName = ("Escher_ShapeContainer"); break; }
|
||||
case RECORD_TYPE_ESCHER_SPGR : { strName = ("Escher_GroupShapeRecord"); break; }
|
||||
case RECORD_TYPE_ESCHER_SP : { strName = ("Escher_ShapeRecord"); break; }
|
||||
case RECORD_TYPE_ESCHER_TEXTBOX : { strName = ("Escher_TextBox"); break; }
|
||||
case RECORD_TYPE_ESCHER_CLIENTTEXTBOX : { strName = ("Escher_ClientTextBox"); break; }
|
||||
case RECORD_TYPE_ESCHER_ANCHOR : { strName = ("Escher_Anchor"); break; }
|
||||
case RECORD_TYPE_ESCHER_CHILDANCHOR : { strName = ("Escher_ChildAnchor"); break; }
|
||||
case RECORD_TYPE_ESCHER_CLIENTANCHOR : { strName = ("Escher_ClientAnchor"); break; }
|
||||
case RECORD_TYPE_ESCHER_CLIENTDATA : { strName = ("Escher_ClientData"); break; }
|
||||
case RECORD_TYPE_ESCHER_SOLVERCONTAINER : { strName = ("Escher_SolverContainer"); break; }
|
||||
case RECORD_TYPE_ESCHER_CONNECTORRULE : { strName = ("Escher_ConnectorRule"); break; }
|
||||
case RECORD_TYPE_ESCHER_ALIGNRULE : { strName = ("Escher_AlignRule"); break; }
|
||||
case RECORD_TYPE_ESCHER_ARCRULE : { strName = ("Escher_ArcRule"); break; }
|
||||
case RECORD_TYPE_ESCHER_CLIENTRULE : { strName = ("Escher_ClientRule"); break; }
|
||||
case RECORD_TYPE_ESCHER_CALLOUTRULE : { strName = ("Escher_CallOutRule"); break; }
|
||||
case RECORD_TYPE_ESCHER_SELECTION : { strName = ("Escher_Selection"); break; }
|
||||
case RECORD_TYPE_ESCHER_COLORMRU : { strName = ("Escher_ColorMRU"); break; }
|
||||
case RECORD_TYPE_ESCHER_DELETEDPSPL : { strName = ("Escher_DeletedPSPL"); break; }
|
||||
case RECORD_TYPE_ESCHER_SPLITMENUCOLORS : { strName = ("Escher_SplitMenuColors"); break; }
|
||||
case RECORD_TYPE_ESCHER_OLEOBJECT : { strName = ("Escher_OleObject"); break; }
|
||||
case RECORD_TYPE_ESCHER_SECONDARY_OPT : { strName = ("Escher_SecondaryOPT"); break; }
|
||||
case RECORD_TYPE_ESCHER_TETRIARY_OPT : { strName = ("Escher_TetriaryOPT"); break; }
|
||||
case RECORD_TYPE_ESCHER_DGG_CONTAINER : { strName = ("DrawingGroupContainer"); break; }
|
||||
case RECORD_TYPE_ESCHER_DGG : { strName = ("DrawingGroupRecord"); break; }
|
||||
case RECORD_TYPE_ESCHER_CLSID : { strName = ("CLSID_Record"); break; }
|
||||
case RECORD_TYPE_ESCHER_OPT : { strName = ("OPT"); break; }
|
||||
case RECORD_TYPE_ESCHER_BSTORE_CONTAINER : { strName = ("BlipStoreContainer"); break; }
|
||||
case RECORD_TYPE_ESCHER_BSE : { strName = ("BlipStoreEntry"); break; }
|
||||
case RECORD_TYPE_ESCHER_BLIP_START : { strName = ("BlipStart"); break; }
|
||||
case RECORD_TYPE_ESCHER_BLIP_END : { strName = ("BlipEnd"); break; }
|
||||
case RECORD_TYPE_ESCHER_DG_CONTAINER : { strName = ("DrawingContainer"); break; }
|
||||
case RECORD_TYPE_ESCHER_DG : { strName = ("DrawingRecord"); break; }
|
||||
case RECORD_TYPE_ESCHER_REGROUPITEMS : { strName = ("RegGroupItems"); break; }
|
||||
case RECORD_TYPE_ESCHER_COLORSCHEME : { strName = ("ColorSheme"); break; }
|
||||
case RECORD_TYPE_ESCHER_SPGR_CONTAINER : { strName = ("GroupShapeContainer"); break; }
|
||||
case RECORD_TYPE_ESCHER_SP_CONTAINER : { strName = ("ShapeContainer"); break; }
|
||||
case RECORD_TYPE_ESCHER_SPGR : { strName = ("GroupShapeRecord"); break; }
|
||||
case RECORD_TYPE_ESCHER_SP : { strName = ("ShapeRecord"); break; }
|
||||
case RECORD_TYPE_ESCHER_TEXTBOX : { strName = ("TextBox"); break; }
|
||||
case RECORD_TYPE_ESCHER_CLIENTTEXTBOX : { strName = ("ClientTextBox"); break; }
|
||||
case RECORD_TYPE_ESCHER_ANCHOR : { strName = ("Anchor"); break; }
|
||||
case RECORD_TYPE_ESCHER_CHILDANCHOR : { strName = ("ChildAnchor"); break; }
|
||||
case RECORD_TYPE_ESCHER_CLIENTANCHOR : { strName = ("ClientAnchor"); break; }
|
||||
case RECORD_TYPE_ESCHER_CLIENTDATA : { strName = ("ClientData"); break; }
|
||||
case RECORD_TYPE_ESCHER_SOLVERCONTAINER : { strName = ("SolverContainer"); break; }
|
||||
case RECORD_TYPE_ESCHER_CONNECTORRULE : { strName = ("ConnectorRule"); break; }
|
||||
case RECORD_TYPE_ESCHER_ALIGNRULE : { strName = ("AlignRule"); break; }
|
||||
case RECORD_TYPE_ESCHER_ARCRULE : { strName = ("ArcRule"); break; }
|
||||
case RECORD_TYPE_ESCHER_CLIENTRULE : { strName = ("ClientRule"); break; }
|
||||
case RECORD_TYPE_ESCHER_CALLOUTRULE : { strName = ("CallOutRule"); break; }
|
||||
case RECORD_TYPE_ESCHER_SELECTION : { strName = ("Selection"); break; }
|
||||
case RECORD_TYPE_ESCHER_COLORMRU : { strName = ("ColorMRU"); break; }
|
||||
case RECORD_TYPE_ESCHER_DELETEDPSPL : { strName = ("DeletedPSPL"); break; }
|
||||
case RECORD_TYPE_ESCHER_SPLITMENUCOLORS : { strName = ("SplitMenuColors"); break; }
|
||||
case RECORD_TYPE_ESCHER_OLEOBJECT : { strName = ("OleObject"); break; }
|
||||
case RECORD_TYPE_ESCHER_SECONDARY_OPT : { strName = ("SecondaryOPT"); break; }
|
||||
case RECORD_TYPE_ESCHER_TETRIARY_OPT : { strName = ("TetriaryOPT"); break; }
|
||||
default: break;
|
||||
};
|
||||
|
||||
if ((dwType > RECORD_TYPE_ESCHER_BLIP_START) && (dwType < RECORD_TYPE_ESCHER_BLIP_END))
|
||||
{
|
||||
strName = ("Escher_Blip");
|
||||
strName = ("Blip");
|
||||
}
|
||||
|
||||
return strName;
|
||||
|
||||
@ -95,8 +95,8 @@ IRecord* CreateByType(SRecordHeader oHeader)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_DOC_ROUTING_SLIP , CRecordDocRoutingSlipAtom)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_EXOBJLIST_ATOM , CRecordExObjListAtom)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN , CRecordGridSpacing10Atom)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN , CRecordRoundTripThemeAtom)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN , CRecordRoundTripColorMappingAtom)
|
||||
CREATE_BY_TYPE(RT_RoundTripTheme12Atom , CRecordRoundTripThemeAtom)
|
||||
CREATE_BY_TYPE(RT_RoundTripColorMapping12Atom , CRecordRoundTripColorMappingAtom)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_NAMEDSHOW_SLIDES , CRecordNamedShowSlidesAtom)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_SHEET_PROPERTIES , CRecordNormalViewSetInfoAtom)
|
||||
|
||||
@ -109,10 +109,10 @@ IRecord* CreateByType(SRecordHeader oHeader)
|
||||
CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPHFPLACEHOLDER12 , CRecordRoundTripHFPlaceholder12Atom)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPCONTENTMASTERID , CRecordRoundTripContentMasterId12Atom)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPOARTTEXTSTYLES12 , CRecordRoundTripOArtTextStyles12Atom)
|
||||
CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPHEADERFOOTERDEFAULTS12ATOM , CRecordRoundTripHeaderFooterDefaults12Atom)
|
||||
CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPHEADERFOOTERDEFAULTS12ATOM , CRecordRoundTripHeaderFooterDefaults12Atom)
|
||||
CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPNOTESMASTERTEXTSTYLES12 , CRecordRoundTripNotesMasterTextStyles12Atom)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPDOCFLAGS12 , CRecordRoundTripDocFlags12Atom)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPSHAPECHECKSUMFORCUSTOMLAYOUTS12 , CRecordRoundTripShapeCheckSumForCustomLayouts12Atom)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPNOTESMASTERTEXTSTYLES12 , CRecordRoundTripNotesMasterTextStyles12Atom)
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPCUSTOMTABLESTYLES12 , CRecordRoundTripCustomTableStyles12Atom)
|
||||
|
||||
//CREATE_BY_TYPE(RECORD_TYPE_BOOKMARK_SEED_ATOM , CRecordBookmarkSeedAtom)
|
||||
|
||||
@ -182,7 +182,7 @@ public:
|
||||
return;
|
||||
|
||||
// возвращаем указатели, их не удалять наверху!!!!
|
||||
for (int nIndex = 0; nIndex < m_arRecords.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < m_arRecords.size(); ++nIndex)
|
||||
{
|
||||
T pRec = dynamic_cast<T>(m_arRecords[nIndex]);
|
||||
if (NULL != pRec)
|
||||
|
||||
@ -85,7 +85,6 @@ public:
|
||||
std::map<int, std::wstring>* m_mapFilePictures;
|
||||
nullable_base<NSPresentationEditor::CTextStyles> m_pStyles[9];
|
||||
|
||||
public:
|
||||
CSlideInfo()
|
||||
{
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ namespace Animations
|
||||
std::vector<std::wstring> arMovePath;
|
||||
boost::algorithm::split(arMovePath, MovePath, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
|
||||
for (int i = 0 ; i < arMovePath.size(); i++)
|
||||
for (size_t i = 0 ; i < arMovePath.size(); i++)
|
||||
{
|
||||
ActionPoint aPoint;
|
||||
aPoint.TYPE = arMovePath[i++][0];
|
||||
@ -245,7 +245,7 @@ namespace Animations
|
||||
{
|
||||
std::wstring MovePath;
|
||||
|
||||
for ( int i = 0; i < m_Points.size(); ++i )
|
||||
for ( size_t i = 0; i < m_Points.size(); ++i )
|
||||
{
|
||||
std::wstring NextPoint;
|
||||
|
||||
|
||||
@ -39,9 +39,7 @@ public:
|
||||
std::vector<SSlidePersist> m_arNotePersists;
|
||||
std::vector<SSlidePersist> m_arSlidePersists;
|
||||
|
||||
public:
|
||||
|
||||
CRecordDocument() : m_arMasterPersists(), m_arNotePersists(), m_arSlidePersists()
|
||||
CRecordDocument()
|
||||
{
|
||||
}
|
||||
|
||||
@ -52,84 +50,6 @@ public:
|
||||
m_arSlidePersists.clear();
|
||||
}
|
||||
|
||||
/*virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
|
||||
{
|
||||
m_oHeader = oHeader;
|
||||
|
||||
m_arMasterPersists.clear();
|
||||
m_arNotePersists.clear();
|
||||
m_arSlidePersists.clear();
|
||||
|
||||
m_arRecords.clear();
|
||||
|
||||
UINT lCurLen = 0;
|
||||
ULONG lReadLen = 0;
|
||||
SRecordHeader oRec;
|
||||
while (lCurLen < m_oHeader.RecLen)
|
||||
{
|
||||
pStream->Read(&oRec, sizeof(oRec), &lReadLen);
|
||||
if (0 >= lReadLen)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (RECORD_TYPE_SLIDELISTWITHTEXT == oRec.RecType)
|
||||
{
|
||||
CRecordSlideListWithText* pAtom = new CRecordSlideListWithText();
|
||||
pAtom->ReadFromStream(oRec, pStream);
|
||||
std::vector<SSlidePersist>* pArray = NULL;
|
||||
|
||||
switch (pAtom->m_Type)
|
||||
{
|
||||
case CRecordSlideListWithText::CollectionOfMasterSlides:
|
||||
{
|
||||
pArray = &m_arMasterPersists;
|
||||
break;
|
||||
}
|
||||
|
||||
case CRecordSlideListWithText::CollectionOfNotesSlides:
|
||||
{
|
||||
pArray = &m_arNotePersists;
|
||||
break;
|
||||
}
|
||||
|
||||
case CRecordSlideListWithText::CollectionOfSlides:
|
||||
{
|
||||
pArray = &m_arSlidePersists;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
// этого не может быть...
|
||||
lCurLen += (8 + oRec.RecLen);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
size_t nCountItems = pAtom->m_arSlides.size();
|
||||
for (size_t index = 0; index < nCountItems; ++index)
|
||||
{
|
||||
SSlidePersist oPersist;
|
||||
oPersist.m_nPsrRef = pAtom->m_arSlides[index]->m_nPsrRef;
|
||||
oPersist.m_nSlideID = pAtom->m_arSlides[index]->m_nSlideID;
|
||||
|
||||
oPersist.m_arTextAttrs += pAtom->m_arTextPlaceHolders[index];
|
||||
|
||||
pArray->Add(oPersist);
|
||||
}
|
||||
|
||||
delete pAtom;
|
||||
}
|
||||
else
|
||||
{
|
||||
IRecord* pRecord = CreateByType(oRec);
|
||||
pRecord->ReadFromStream(oRec, pStream);
|
||||
m_arRecords.Add(pRecord);
|
||||
}
|
||||
lCurLen += (8 + oRec.RecLen);
|
||||
}
|
||||
}*/
|
||||
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
|
||||
{
|
||||
m_oHeader = oHeader;
|
||||
@ -145,31 +65,26 @@ public:
|
||||
std::vector<CRecordSlideListWithText*> oArraySlideWithText;
|
||||
this->GetRecordsByType(&oArraySlideWithText, true, false);
|
||||
|
||||
for (int nIndexList = 0; nIndexList < oArraySlideWithText.size(); ++nIndexList)
|
||||
for (size_t nIndexList = 0; nIndexList < oArraySlideWithText.size(); ++nIndexList)
|
||||
{
|
||||
CRecordSlideListWithText* pAtom = oArraySlideWithText[nIndexList];
|
||||
std::vector<SSlidePersist>* pArray = NULL;
|
||||
|
||||
switch (pAtom->m_Type)
|
||||
{
|
||||
case CRecordSlideListWithText::CollectionOfMasterSlides:
|
||||
case CRecordSlideListWithText::CollectionOfMasterSlides:
|
||||
{
|
||||
pArray = &m_arMasterPersists;
|
||||
break;
|
||||
}
|
||||
|
||||
case CRecordSlideListWithText::CollectionOfNotesSlides:
|
||||
pArray = &m_arMasterPersists;
|
||||
}break;
|
||||
case CRecordSlideListWithText::CollectionOfNotesSlides:
|
||||
{
|
||||
pArray = &m_arNotePersists;
|
||||
break;
|
||||
}
|
||||
|
||||
case CRecordSlideListWithText::CollectionOfSlides:
|
||||
pArray = &m_arNotePersists;
|
||||
}break;
|
||||
case CRecordSlideListWithText::CollectionOfSlides:
|
||||
{
|
||||
pArray = &m_arSlidePersists;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
pArray = &m_arSlidePersists;
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
// этого не может быть...
|
||||
continue;
|
||||
|
||||
@ -53,7 +53,7 @@ public:
|
||||
pArray->clear();
|
||||
|
||||
std::map<DWORD, int> image_map;
|
||||
for (int nIndex = 0; nIndex < m_arRecords.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < m_arRecords.size(); ++nIndex)
|
||||
{
|
||||
CRecordBlipStoreEntry* pEntry = dynamic_cast<CRecordBlipStoreEntry*>(m_arRecords[nIndex]);
|
||||
if (NULL != pEntry)
|
||||
|
||||
@ -71,7 +71,7 @@ public:
|
||||
oArrayShapes[0]->bGroupShape = true;//тут описание самой группы
|
||||
|
||||
int nIndexBreak = -1;
|
||||
for (int nIndex = 0; nIndex < oArrayShapes.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < oArrayShapes.size(); ++nIndex)
|
||||
{
|
||||
std::vector<CRecordGroupShape*> oArrayGroupShapes;
|
||||
oArrayShapes[nIndex]->GetRecordsByType(&oArrayGroupShapes, false, true);
|
||||
@ -120,7 +120,7 @@ public:
|
||||
bool bIsRecalc = ((lW1 > 0) && (lH1 > 0) && (lW2 > 0) && (lH2 > 0));
|
||||
if (bIsRecalc)
|
||||
{
|
||||
for (int nIndex = 0; nIndex < oArrayShapes.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < oArrayShapes.size(); ++nIndex)
|
||||
{
|
||||
if (nIndex != nIndexBreak)
|
||||
{
|
||||
|
||||
@ -575,212 +575,134 @@ public:
|
||||
}
|
||||
// line --------------------------------------------------------
|
||||
case lineBoolean: //Line Style Boolean Properties
|
||||
{
|
||||
bool bNoLineDrawDash = GETBIT(pProperty->m_lValue, 0);
|
||||
bool bLineFillShape = GETBIT(pProperty->m_lValue, 1);
|
||||
bool bHitTestLine = GETBIT(pProperty->m_lValue, 2);
|
||||
bool bLine = GETBIT(pProperty->m_lValue, 3);
|
||||
bool bArrowheadsOK = GETBIT(pProperty->m_lValue, 4);
|
||||
bool bInsetPenOK = GETBIT(pProperty->m_lValue, 5);
|
||||
bool bInsetPen = GETBIT(pProperty->m_lValue, 6);
|
||||
bool bLineOpaqueBackColor = GETBIT(pProperty->m_lValue, 9);
|
||||
{
|
||||
bool bNoLineDrawDash = GETBIT(pProperty->m_lValue, 0);
|
||||
bool bLineFillShape = GETBIT(pProperty->m_lValue, 1);
|
||||
bool bHitTestLine = GETBIT(pProperty->m_lValue, 2);
|
||||
bool bLine = GETBIT(pProperty->m_lValue, 3);
|
||||
bool bArrowheadsOK = GETBIT(pProperty->m_lValue, 4);
|
||||
bool bInsetPenOK = GETBIT(pProperty->m_lValue, 5);
|
||||
bool bInsetPen = GETBIT(pProperty->m_lValue, 6);
|
||||
bool bLineOpaqueBackColor = GETBIT(pProperty->m_lValue, 9);
|
||||
|
||||
bool bUsefNoLineDrawDash = GETBIT(pProperty->m_lValue, 16);
|
||||
bool bUsefLineFillShape = GETBIT(pProperty->m_lValue, 17);
|
||||
bool bUsefHitTestLine = GETBIT(pProperty->m_lValue, 18);
|
||||
bool bUsefLine = GETBIT(pProperty->m_lValue, 19);
|
||||
bool bUsefArrowheadsOK = GETBIT(pProperty->m_lValue, 20);
|
||||
bool bUsefInsetPenOK = GETBIT(pProperty->m_lValue, 21);
|
||||
bool bUsefInsetPen = GETBIT(pProperty->m_lValue, 22);
|
||||
bool bUsefLineOpaqueBackColor = GETBIT(pProperty->m_lValue, 25);
|
||||
bool bUsefNoLineDrawDash = GETBIT(pProperty->m_lValue, 16);
|
||||
bool bUsefLineFillShape = GETBIT(pProperty->m_lValue, 17);
|
||||
bool bUsefHitTestLine = GETBIT(pProperty->m_lValue, 18);
|
||||
bool bUsefLine = GETBIT(pProperty->m_lValue, 19);
|
||||
bool bUsefArrowheadsOK = GETBIT(pProperty->m_lValue, 20);
|
||||
bool bUsefInsetPenOK = GETBIT(pProperty->m_lValue, 21);
|
||||
bool bUsefInsetPen = GETBIT(pProperty->m_lValue, 22);
|
||||
bool bUsefLineOpaqueBackColor = GETBIT(pProperty->m_lValue, 25);
|
||||
|
||||
if (bUsefLine)
|
||||
pElement->m_bLine = bLine;
|
||||
}break;
|
||||
case lineStyle:
|
||||
if (bUsefLine)
|
||||
pElement->m_bLine = bLine;
|
||||
}break;
|
||||
case lineDashStyle://from Complex
|
||||
{
|
||||
pElement->m_bLine = true;
|
||||
}break;
|
||||
{
|
||||
pElement->m_bLine = true;
|
||||
}break;
|
||||
case lineColor:
|
||||
{
|
||||
SColorAtom oAtom;
|
||||
oAtom.FromValue(pProperty->m_lValue);
|
||||
|
||||
if (oAtom.bSysIndex)
|
||||
pElement->m_oPen.Color = CorrectSysColor(pProperty->m_lValue, pElement, pTheme);
|
||||
else
|
||||
oAtom.ToColor(&pElement->m_oPen.Color);
|
||||
break;
|
||||
}
|
||||
{
|
||||
SColorAtom oAtom;
|
||||
oAtom.FromValue(pProperty->m_lValue);
|
||||
|
||||
if (oAtom.bSysIndex)
|
||||
pElement->m_oPen.Color = CorrectSysColor(pProperty->m_lValue, pElement, pTheme);
|
||||
else
|
||||
oAtom.ToColor(&pElement->m_oPen.Color);
|
||||
}break;
|
||||
case lineOpacity:
|
||||
{
|
||||
pElement->m_oPen.Alpha = (BYTE)(std::min)(255, (int)CDirectory::NormFixedPoint(pProperty->m_lValue, 255));
|
||||
break;
|
||||
}
|
||||
{
|
||||
pElement->m_oPen.Alpha = (BYTE)(std::min)(255, (int)CDirectory::NormFixedPoint(pProperty->m_lValue, 255));
|
||||
}break;
|
||||
case lineBackColor:
|
||||
{
|
||||
SColorAtom oAtom;
|
||||
oAtom.FromValue(pProperty->m_lValue);
|
||||
|
||||
if (oAtom.bSysIndex)
|
||||
pElement->m_oPen.Color2 = CorrectSysColor(pProperty->m_lValue, pElement, pTheme);
|
||||
else
|
||||
oAtom.ToColor(&pElement->m_oPen.Color2);
|
||||
{
|
||||
SColorAtom oAtom;
|
||||
oAtom.FromValue(pProperty->m_lValue);
|
||||
|
||||
if (oAtom.bSysIndex)
|
||||
pElement->m_oPen.Color2 = CorrectSysColor(pProperty->m_lValue, pElement, pTheme);
|
||||
else
|
||||
oAtom.ToColor(&pElement->m_oPen.Color2);
|
||||
|
||||
}break;
|
||||
}break;
|
||||
case lineWidth:
|
||||
{
|
||||
pElement->m_oPen.Size = (double)pProperty->m_lValue / EMU_MM;
|
||||
pElement->m_bLine = true;
|
||||
break;
|
||||
}
|
||||
{
|
||||
pElement->m_oPen.Size = (double)pProperty->m_lValue / EMU_MM;
|
||||
pElement->m_bLine = true;
|
||||
}break;
|
||||
case lineStyle:
|
||||
{
|
||||
pElement->m_bLine = true;
|
||||
pElement->m_oPen.LineStyle = pProperty->m_lValue;
|
||||
}break;
|
||||
case lineDashing:
|
||||
{
|
||||
BYTE nDashStyle = 0;
|
||||
switch (pProperty->m_lValue)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
nDashStyle = 0; // solid
|
||||
}break;
|
||||
case 1:
|
||||
case 6:
|
||||
case 7:
|
||||
{
|
||||
nDashStyle = 1; // dash
|
||||
}break;
|
||||
case 2:
|
||||
case 5:
|
||||
{
|
||||
nDashStyle = 2; // dot
|
||||
}break;
|
||||
case 3:
|
||||
case 8:
|
||||
case 9:
|
||||
{
|
||||
nDashStyle = 3; // dashdot
|
||||
}break;
|
||||
case 4:
|
||||
case 10:
|
||||
{
|
||||
nDashStyle = 4;// dashdotdot
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
pElement->m_bLine = true;
|
||||
pElement->m_oPen.DashStyle = nDashStyle;
|
||||
break;
|
||||
}
|
||||
{
|
||||
pElement->m_bLine = true;
|
||||
pElement->m_oPen.DashStyle = pProperty->m_lValue;
|
||||
}break;
|
||||
case lineJoinStyle:
|
||||
{
|
||||
BYTE nLineJoin = 2;
|
||||
switch (pProperty->m_lValue)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
nLineJoin = 1; // bevel
|
||||
}break;
|
||||
case 1:
|
||||
{
|
||||
nLineJoin = 1; // Miter
|
||||
}break;
|
||||
case 2:
|
||||
{
|
||||
nLineJoin = 2; // round
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
pElement->m_oPen.LineJoin = nLineJoin;
|
||||
break;
|
||||
}
|
||||
{
|
||||
pElement->m_oPen.LineJoin = pProperty->m_lValue;
|
||||
}break;
|
||||
case lineStartArrowLength:
|
||||
{
|
||||
pElement->m_oPen.LineStartLength = pProperty->m_lValue;
|
||||
}break;
|
||||
case lineEndArrowLength:
|
||||
{
|
||||
pElement->m_oPen.LineEndLength = pProperty->m_lValue;
|
||||
}break;
|
||||
case lineStartArrowWidth:
|
||||
{
|
||||
pElement->m_oPen.LineStartWidth = pProperty->m_lValue;
|
||||
}break;
|
||||
case lineEndArrowWidth:
|
||||
{
|
||||
pElement->m_oPen.LineEndWidth = pProperty->m_lValue;
|
||||
}break;
|
||||
case lineStartArrowhead:
|
||||
{
|
||||
BYTE nStartCap = 0;
|
||||
switch (pProperty->m_lValue)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
case 5:
|
||||
{
|
||||
nStartCap = 0x14;
|
||||
}break;
|
||||
case 3:
|
||||
case 4:
|
||||
|
||||
{
|
||||
nStartCap = 2;
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
pElement->m_oPen.LineStartCap = nStartCap;
|
||||
|
||||
break;
|
||||
}
|
||||
{
|
||||
pElement->m_oPen.LineStartCap = pProperty->m_lValue;
|
||||
}break;
|
||||
case lineEndArrowhead:
|
||||
{
|
||||
BYTE nEndCap = 0;
|
||||
switch (pProperty->m_lValue)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
case 5:
|
||||
{
|
||||
nEndCap = 0x14;
|
||||
}break;
|
||||
case 3:
|
||||
case 4:
|
||||
|
||||
{
|
||||
nEndCap = 2;
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
pElement->m_oPen.LineEndCap = nEndCap;
|
||||
break;
|
||||
}
|
||||
{
|
||||
pElement->m_oPen.LineEndCap = pProperty->m_lValue;
|
||||
}break;
|
||||
case shadowType:
|
||||
{
|
||||
pElement->m_oShadow.Type = pProperty->m_lValue;
|
||||
|
||||
}break;
|
||||
{
|
||||
pElement->m_oShadow.Type = pProperty->m_lValue;
|
||||
}break;
|
||||
case shadowOriginX://in emu, relative from center shape
|
||||
{
|
||||
pElement->m_oShadow.OriginX = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
{
|
||||
pElement->m_oShadow.OriginX = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case shadowOriginY:
|
||||
{
|
||||
pElement->m_oShadow.OriginY = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
{
|
||||
pElement->m_oShadow.OriginY = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case shadowColor:
|
||||
{
|
||||
SColorAtom oAtom;
|
||||
oAtom.FromValue(pProperty->m_lValue);
|
||||
{
|
||||
SColorAtom oAtom;
|
||||
oAtom.FromValue(pProperty->m_lValue);
|
||||
|
||||
if (oAtom.bSysIndex)
|
||||
pElement->m_oShadow.Color = CorrectSysColor(pProperty->m_lValue, pElement, pTheme);
|
||||
else
|
||||
oAtom.ToColor(&pElement->m_oShadow.Color);
|
||||
if (oAtom.bSysIndex)
|
||||
pElement->m_oShadow.Color = CorrectSysColor(pProperty->m_lValue, pElement, pTheme);
|
||||
else
|
||||
oAtom.ToColor(&pElement->m_oShadow.Color);
|
||||
|
||||
}break;
|
||||
}break;
|
||||
case shadowWeight:
|
||||
{
|
||||
}break;
|
||||
case shadowOpacity:
|
||||
{
|
||||
pElement->m_oShadow.Alpha = (BYTE)(std::min)(255, (int)CDirectory::NormFixedPoint(pProperty->m_lValue, 255));
|
||||
}break;
|
||||
{
|
||||
pElement->m_oShadow.Alpha = (BYTE)(std::min)(255, (int)CDirectory::NormFixedPoint(pProperty->m_lValue, 255));
|
||||
}break;
|
||||
case shadowHighlight:
|
||||
{
|
||||
//оттенок двойной тени
|
||||
}break;
|
||||
{
|
||||
//оттенок двойной тени
|
||||
}break;
|
||||
case shadowOffsetX:
|
||||
{
|
||||
pElement->m_oShadow.DistanceX = ((int)pProperty->m_lValue) / EMU_MM;
|
||||
@ -949,65 +871,80 @@ public:
|
||||
|
||||
switch (pProperty->m_ePID)
|
||||
{
|
||||
// здесь просто применяем проперти...
|
||||
// geometry ----------------------------------------------------
|
||||
// top, left, right, bottom logic
|
||||
case NSOfficeDrawing::metroBlob:
|
||||
{
|
||||
//альтернатива в формате oox
|
||||
//NSFile::CFileBinary f;
|
||||
//f.CreateFileW(L"d:\\test.zip");
|
||||
//f.WriteFile(pProperty->m_pOptions, pProperty->m_lValue);
|
||||
//f.CloseFile();
|
||||
}break;
|
||||
{
|
||||
//альтернатива в формате oox
|
||||
//NSFile::CFileBinary f;
|
||||
//f.CreateFileW(L"d:\\test.zip");
|
||||
//f.WriteFile(pProperty->m_pOptions, pProperty->m_lValue);
|
||||
//f.CloseFile();
|
||||
}break;
|
||||
case NSOfficeDrawing::geoRight:
|
||||
{
|
||||
if (0 < pProperty->m_lValue)
|
||||
pParentShape->m_dWidthLogic = (double)(pProperty->m_lValue);
|
||||
}break;
|
||||
{
|
||||
if (0 < pProperty->m_lValue)
|
||||
pParentShape->m_dWidthLogic = (double)(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::geoBottom:
|
||||
{
|
||||
if (0 < pProperty->m_lValue)
|
||||
pParentShape->m_dHeightLogic = (double)(pProperty->m_lValue);
|
||||
}break;
|
||||
// shapePath
|
||||
{
|
||||
if (0 < pProperty->m_lValue)
|
||||
pParentShape->m_dHeightLogic = (double)(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::shapePath:
|
||||
{
|
||||
pShape->m_oCustomVML.SetPath((RulesType)pProperty->m_lValue);
|
||||
pShape->m_bCustomShape = true;
|
||||
}break;
|
||||
// segmentsInfo
|
||||
{
|
||||
pShape->m_oCustomVML.SetPath((RulesType)pProperty->m_lValue);
|
||||
pShape->m_bCustomShape = true;
|
||||
}break;
|
||||
case NSOfficeDrawing::pSegmentInfo:
|
||||
{
|
||||
if (pProperty->m_bComplex)
|
||||
{
|
||||
if (pProperty->m_bComplex)
|
||||
{
|
||||
pShape->m_oCustomVML.LoadSegments(pProperty);
|
||||
pShape->m_bCustomShape = true;
|
||||
}
|
||||
}break;
|
||||
// verticesInfo
|
||||
pShape->m_oCustomVML.LoadSegments(pProperty);
|
||||
pShape->m_bCustomShape = true;
|
||||
}
|
||||
}break;
|
||||
case NSOfficeDrawing::pVertices:
|
||||
{
|
||||
if (pProperty->m_bComplex)
|
||||
{
|
||||
if (pProperty->m_bComplex)
|
||||
{
|
||||
pShape->m_oCustomVML.LoadVertices(pProperty);
|
||||
pShape->m_bCustomShape = true;
|
||||
}
|
||||
}break;
|
||||
pShape->m_oCustomVML.LoadVertices(pProperty);
|
||||
pShape->m_bCustomShape = true;
|
||||
}
|
||||
}break;
|
||||
case NSOfficeDrawing::pConnectionSites:
|
||||
{
|
||||
if (pProperty->m_bComplex)
|
||||
{
|
||||
pShape->m_oCustomVML.LoadConnectionSites(pProperty);
|
||||
}
|
||||
}break;
|
||||
case NSOfficeDrawing::pConnectionSitesDir:
|
||||
{
|
||||
if (pProperty->m_bComplex)
|
||||
{
|
||||
pShape->m_oCustomVML.LoadConnectionSitesDir(pProperty);
|
||||
}
|
||||
}break;
|
||||
case NSOfficeDrawing::pGuides:
|
||||
{
|
||||
if (pProperty->m_bComplex/* && pShape->m_eType != sptNotchedCircularArrow*/)
|
||||
{//Тікбұрышты үшбұрыштарды.ppt - slide 25
|
||||
pShape->m_oCustomVML.LoadGuides(pProperty);
|
||||
}
|
||||
}break;
|
||||
case NSOfficeDrawing::pInscribe:
|
||||
{
|
||||
if (pProperty->m_bComplex)
|
||||
{
|
||||
if (pProperty->m_bComplex && pShape->m_eType != sptNotchedCircularArrow)
|
||||
{//Тікбұрышты үшбұрыштарды.ppt - slide 25
|
||||
pShape->m_oCustomVML.LoadGuides(pProperty);
|
||||
}
|
||||
}break;
|
||||
pShape->m_oCustomVML.LoadInscribe(pProperty);
|
||||
}
|
||||
}break;
|
||||
case NSOfficeDrawing::pAdjustHandles:
|
||||
{
|
||||
if (pProperty->m_bComplex)
|
||||
{
|
||||
if (pProperty->m_bComplex)
|
||||
{
|
||||
pShape->m_oCustomVML.LoadAHs(pProperty);
|
||||
}
|
||||
}break;
|
||||
pShape->m_oCustomVML.LoadAHs(pProperty);
|
||||
}
|
||||
}break;
|
||||
case NSOfficeDrawing::adjustValue:
|
||||
case NSOfficeDrawing::adjust2Value:
|
||||
case NSOfficeDrawing::adjust3Value:
|
||||
@ -1890,7 +1827,7 @@ protected:
|
||||
|
||||
if (master_levels)
|
||||
{
|
||||
for (int i = 0; i < pText->m_arParagraphs.size(); i++)
|
||||
for (size_t i = 0; i < pText->m_arParagraphs.size(); i++)
|
||||
{
|
||||
if (i >= master_levels->m_arrProps.size()) break;
|
||||
|
||||
@ -2198,7 +2135,7 @@ protected:
|
||||
pTextSettings->m_oStyles.ApplyAfter(pThemeWrapper->m_pStyles[nIndexType].get());
|
||||
}
|
||||
}
|
||||
if (eTypeOwn != NSOfficePPT::NoPresent && eTypeOwn != NSOfficePPT::Other && eTypeOwn != eTypePersist && eTypeOwn != eTypeMaster)
|
||||
if (eTypeOwn != NSOfficePPT::NoPresent/* && eTypeOwn != NSOfficePPT::Other*/ && eTypeOwn != eTypePersist && eTypeOwn != eTypeMaster)
|
||||
{
|
||||
int nIndexType = (int)eTypeOwn;
|
||||
|
||||
|
||||
@ -198,7 +198,7 @@ public:
|
||||
{
|
||||
CRecordsContainer::ReadFromStream(oHeader, pStream);
|
||||
|
||||
for (int i = 0 ; i < m_arRecords.size(); i++)
|
||||
for (size_t i = 0 ; i < m_arRecords.size(); i++)
|
||||
{
|
||||
switch(m_arRecords[i]->m_oHeader.RecType)
|
||||
{
|
||||
|
||||
@ -34,13 +34,12 @@
|
||||
|
||||
class CRecordNotesAtom : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
UINT m_nSlideIDRef;
|
||||
|
||||
bool m_bMasterObjects;
|
||||
bool m_bMasterScheme;
|
||||
bool m_bMasterBackground;
|
||||
|
||||
public:
|
||||
|
||||
CRecordNotesAtom()
|
||||
{
|
||||
@ -54,11 +53,11 @@ public:
|
||||
{
|
||||
m_oHeader = oHeader;
|
||||
|
||||
m_nSlideIDRef = (UINT)StreamUtils::ReadDWORD(pStream);
|
||||
m_nSlideIDRef = (UINT)StreamUtils::ReadDWORD(pStream);
|
||||
|
||||
USHORT nFlag = StreamUtils::ReadWORD(pStream);
|
||||
m_bMasterObjects = ((nFlag & 0x01) == 0x01);
|
||||
m_bMasterScheme = ((nFlag & 0x02) == 0x02);
|
||||
USHORT nFlag = StreamUtils::ReadWORD(pStream);
|
||||
m_bMasterObjects = ((nFlag & 0x01) == 0x01);
|
||||
m_bMasterScheme = ((nFlag & 0x02) == 0x02);
|
||||
m_bMasterBackground = ((nFlag & 0x04) == 0x04);
|
||||
|
||||
StreamUtils::StreamSkip(2, pStream);
|
||||
|
||||
@ -91,6 +91,7 @@
|
||||
#include "RoundTripColorMappingAtom.h"
|
||||
#include "RoundTripNewPlaceholderId12Atom.h"
|
||||
#include "RoundTripThemeAtom.h"
|
||||
#include "RoundTripNotesMasterTextStyles12Atom.h"
|
||||
#include "TextRulerAtom.h"
|
||||
#include "ShapeFlags10Atom.h"
|
||||
#include "ShapeFlagsAtom.h"
|
||||
|
||||
@ -34,9 +34,8 @@
|
||||
|
||||
class CRecordRoundTripColorMappingAtom : public CUnknownRecord
|
||||
{
|
||||
std::wstring m_pString;
|
||||
|
||||
public:
|
||||
std::string m_strData;
|
||||
|
||||
CRecordRoundTripColorMappingAtom()
|
||||
{
|
||||
@ -48,6 +47,7 @@ public:
|
||||
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
|
||||
{
|
||||
return CUnknownRecord::ReadFromStream(oHeader, pStream);
|
||||
m_oHeader = oHeader;
|
||||
m_strData = StreamUtils::ReadStringA(pStream, (long)m_oHeader.RecLen);
|
||||
}
|
||||
};
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#include "../Reader/Records.h"
|
||||
|
||||
class CRecordRoundTripNotesMasterTextStyles12Atom : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
std::string m_strData;
|
||||
|
||||
CRecordRoundTripNotesMasterTextStyles12Atom()
|
||||
{
|
||||
}
|
||||
|
||||
~CRecordRoundTripNotesMasterTextStyles12Atom()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
|
||||
{
|
||||
m_oHeader = oHeader;
|
||||
m_strData = StreamUtils::ReadStringA(pStream, (long)m_oHeader.RecLen);
|
||||
}
|
||||
};
|
||||
@ -34,9 +34,8 @@
|
||||
|
||||
class CRecordRoundTripThemeAtom : public CUnknownRecord
|
||||
{
|
||||
std::wstring m_strData;
|
||||
|
||||
public:
|
||||
std::string m_strData;
|
||||
|
||||
CRecordRoundTripThemeAtom()
|
||||
{
|
||||
@ -48,6 +47,7 @@ public:
|
||||
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
|
||||
{
|
||||
return CUnknownRecord::ReadFromStream(oHeader, pStream);
|
||||
m_oHeader = oHeader;
|
||||
m_strData = StreamUtils::ReadStringA(pStream, (long)m_oHeader.RecLen);
|
||||
}
|
||||
};
|
||||
|
||||
@ -129,7 +129,7 @@ public:
|
||||
|
||||
bool IsSlide()
|
||||
{
|
||||
for (int nIndex = 0; nIndex < m_arRecords.size(); ++nIndex)
|
||||
for (size_t nIndex = 0; nIndex < m_arRecords.size(); ++nIndex)
|
||||
{
|
||||
if ((RECORD_TYPE_SLIDE == m_arRecords[nIndex]->m_oHeader.RecType) ||
|
||||
(RECORD_TYPE_MAINMASTER == m_arRecords[nIndex]->m_oHeader.RecType) ||
|
||||
|
||||
@ -59,7 +59,7 @@ public:
|
||||
{
|
||||
pStream->read(pUTF16_low, m_oHeader.RecLen);
|
||||
|
||||
for (int i = 0 ; i < m_oHeader.RecLen; i++)
|
||||
for (UINT i = 0 ; i < m_oHeader.RecLen; i++)
|
||||
{
|
||||
pUTF16[i] = pUTF16_low[i];
|
||||
}
|
||||
|
||||
@ -86,11 +86,12 @@ public:
|
||||
|
||||
int pos_text = 0, pos_si = 0;
|
||||
int ind = 0;
|
||||
for (int i = 0; i < pText->m_arParagraphs.size(); i++)
|
||||
|
||||
for (size_t i = 0; i < pText->m_arParagraphs.size(); i++)
|
||||
{
|
||||
if (ind >= m_arrSIs.size()) break;
|
||||
|
||||
for (int j = 0 ; j < pText->m_arParagraphs[i].m_arSpans.size(); j++)
|
||||
for (size_t j = 0 ; j < pText->m_arParagraphs[i].m_arSpans.size(); j++)
|
||||
{
|
||||
if (pos_text + pText->m_arParagraphs[i].m_arSpans[j].m_strText.length() > pos_si + m_arrSIs[ind].lCount )
|
||||
{
|
||||
|
||||
@ -462,10 +462,6 @@
|
||||
RelativePath="..\Reader\ClassesAtom.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\Document.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Reader\PPTDocumentInfo.h"
|
||||
>
|
||||
@ -1030,6 +1026,26 @@
|
||||
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\XmlWriter.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="ppt shapes"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Shapes\BaseShape\PPTShape\customgeomshape.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Shapes\BaseShape\PPTShape\elementsettings.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Shapes\BaseShape\PPTShape\formula.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Shapes\BaseShape\PPTShape\PPTShape.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="OOXWriter"
|
||||
|
||||
@ -31,22 +31,30 @@
|
||||
*/
|
||||
// PptFormatTest.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
#include "../../PPTFormatLib/PPTFormatLib.h"
|
||||
#include "../../../OfficeUtils/src/OfficeUtils.h"
|
||||
#include "../PPTFormatLib/PPTFormatLib.h"
|
||||
#include "../../OfficeUtils/src/OfficeUtils.h"
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
|
||||
#include "../../DesktopEditor/common/Directory.h"
|
||||
|
||||
#include <tchar.h>
|
||||
|
||||
#if defined(_WIN64)
|
||||
#pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib")
|
||||
#elif defined (_WIN32)
|
||||
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
|
||||
#endif
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
if (argc < 2) return 1;
|
||||
|
||||
std::wstring sSrcPpt = argv[1];
|
||||
std::wstring sDstPptx = argc > 2 ? argv[2] : sSrcDoc + L"-my.pptx";
|
||||
std::wstring sDstPptx = argc > 2 ? argv[2] : sSrcPpt + L"-my.pptx";
|
||||
|
||||
std::wstring outputDir = FileSystem::Directory::GetFolderPath(sDstPptx);
|
||||
std::wstring dstTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
|
||||
std::wstring outputDir = NSDirectory::GetFolderPath(sDstPptx);
|
||||
std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
|
||||
|
||||
std::wstring tempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
|
||||
std::wstring tempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
|
||||
|
||||
COfficePPTFile pptFile;
|
||||
|
||||
@ -60,8 +68,8 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
hRes = oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), sDstPptx, -1);
|
||||
}
|
||||
|
||||
FileSystem::Directory::DeleteDirectory(dstTempPath);
|
||||
FileSystem::Directory::DeleteDirectory(tempPath);
|
||||
NSDirectory::DeleteDirectory(dstTempPath);
|
||||
NSDirectory::DeleteDirectory(tempPath);
|
||||
|
||||
return hRes;
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\Common\OfficeDrawing;"..\..\DesktopEditor\freetype-2.5.2\include";..\..\Common\OfficeDrawing\Shapes"
|
||||
PreprocessorDefinitions="_DEBUG;_CONSOLE;USE_ATL_CSTRINGS;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_"
|
||||
PreprocessorDefinitions="_DEBUG;_CONSOLE;USE_ATL_CSTRINGS;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_;DONT_WRITE_EMBEDDED_FONTS"
|
||||
MinimalRebuild="false"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
@ -340,14 +340,34 @@
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\ASCOfficeDocxFile2\BinWriter\BinWriters.cpp"
|
||||
<Filter
|
||||
Name="common"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\build\bin\icu\win_32\icuuc.lib"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ASCOfficeDocxFile2\BinWriter\BinWriters.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\OfficeFileFormatChecker2.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ASCOfficeDocxFile2\BinReader\Readers.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\UnicodeConverter\UnicodeConverter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DesktopEditor\xml\src\xmldom.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DesktopEditor\xml\src\xmllight.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="PptFormatTest.cpp"
|
||||
>
|
||||
|
||||
@ -478,10 +478,17 @@ namespace NSPresentationEditor
|
||||
long Alpha;
|
||||
double Size;
|
||||
|
||||
BYTE DashStyle;
|
||||
BYTE LineStartCap;
|
||||
BYTE LineEndCap;
|
||||
BYTE LineJoin;
|
||||
unsigned char DashStyle;
|
||||
unsigned char LineStyle;
|
||||
unsigned char LineJoin;
|
||||
|
||||
unsigned char LineEndCap;
|
||||
unsigned char LineEndLength;
|
||||
unsigned char LineEndWidth;
|
||||
|
||||
unsigned char LineStartCap;
|
||||
unsigned char LineStartLength;
|
||||
unsigned char LineStartWidth;
|
||||
|
||||
double* DashPattern;
|
||||
long Count;
|
||||
@ -492,9 +499,8 @@ namespace NSPresentationEditor
|
||||
double MiterLimit;
|
||||
|
||||
CColor Color2; //backLine
|
||||
public:
|
||||
|
||||
void GetDashPattern(double* arrDashPattern, long& nCount) const
|
||||
void GetDashPattern(double* arrDashPattern, long& nCount) const
|
||||
{
|
||||
if (nCount == Count)
|
||||
{
|
||||
@ -579,10 +585,16 @@ namespace NSPresentationEditor
|
||||
Alpha = 255;
|
||||
Size = 0.26458;
|
||||
|
||||
DashStyle = 0;
|
||||
LineStartCap = 0;
|
||||
LineEndCap = 0;
|
||||
LineJoin = 0;
|
||||
LineStyle = 0; //single(Simple)
|
||||
DashStyle = 0; //Solid
|
||||
LineJoin = 2; //round
|
||||
|
||||
LineStartCap = 0;
|
||||
LineEndCap = 0;
|
||||
LineEndLength = 1; //med
|
||||
LineStartLength = 1;
|
||||
LineEndWidth = 1;
|
||||
LineStartWidth = 1;
|
||||
|
||||
DashPattern = NULL;
|
||||
Count = 0;
|
||||
|
||||
@ -41,82 +41,59 @@ namespace NSPresentationEditor
|
||||
public:
|
||||
std::vector<CTheme> m_arThemes;
|
||||
std::vector<CSlide*> m_arSlides;
|
||||
std::vector<CSlide*> m_arNotes;
|
||||
|
||||
CTheme* m_pNotesMaster;
|
||||
CTheme* m_pHandoutMaster;
|
||||
|
||||
CMetricInfo m_oInfo;
|
||||
|
||||
public:
|
||||
|
||||
CDocument() : m_arThemes(), m_arSlides()
|
||||
{
|
||||
m_pHandoutMaster = NULL;
|
||||
m_pNotesMaster = NULL;
|
||||
}
|
||||
|
||||
~CDocument()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
CDocument& operator=(const CDocument& oSrc)
|
||||
{
|
||||
m_arThemes = oSrc.m_arThemes;
|
||||
m_arSlides = oSrc.m_arSlides;
|
||||
|
||||
m_oInfo = oSrc.m_oInfo;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
CDocument(const CDocument& oSrc)
|
||||
{
|
||||
*this = oSrc;
|
||||
}
|
||||
|
||||
public:
|
||||
inline void Clear()
|
||||
{
|
||||
ClearThemes();
|
||||
m_arThemes.clear();
|
||||
try
|
||||
{
|
||||
ClearSlides();
|
||||
ClearNotes();
|
||||
|
||||
RELEASEOBJECT(m_pHandoutMaster);
|
||||
RELEASEOBJECT(m_pNotesMaster);
|
||||
}catch(...)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// работа с темами
|
||||
inline void ClearThemes()
|
||||
{
|
||||
m_arThemes.clear();
|
||||
}
|
||||
inline void AddTheme(const CTheme& oTheme)
|
||||
{
|
||||
m_arThemes.push_back(oTheme);
|
||||
}
|
||||
inline void UpdateTheme(size_t nIndex, const CTheme& oTheme)
|
||||
{
|
||||
if (nIndex >= m_arThemes.size())
|
||||
return;
|
||||
|
||||
m_arThemes[nIndex] = oTheme;
|
||||
}
|
||||
// работа со слайдом
|
||||
inline void ClearSlides()
|
||||
{
|
||||
for (int i = 0 ; i < m_arSlides.size(); i++)
|
||||
for (size_t i = 0 ; i < m_arSlides.size(); i++)
|
||||
{
|
||||
RELEASEOBJECT(m_arSlides[i]);
|
||||
}
|
||||
m_arSlides.clear();
|
||||
}
|
||||
inline void AddSlide(CSlide* oSlide)
|
||||
inline void ClearNotes()
|
||||
{
|
||||
m_arSlides.push_back(oSlide);
|
||||
for (size_t i = 0 ; i < m_arNotes.size(); i++)
|
||||
{
|
||||
RELEASEOBJECT(m_arNotes[i]);
|
||||
}
|
||||
m_arNotes.clear();
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
// функция производит расчет по теме и слайдам
|
||||
std::wstring GetXmlSlideTransition ( CSlide& oSlide/*, CAudioOverlay& oAudioOverlay*/ )
|
||||
#if defined (_DEBUG)
|
||||
std::wstring GetXmlSlideTransition ( CSlide& oSlide/*, CAudioOverlay& oAudioOverlay*/ )
|
||||
{
|
||||
std::wstring Source = std::wstring ( _T("") );
|
||||
std::wstring Source = std::wstring ( _T("") );
|
||||
|
||||
int EffectID = 1;
|
||||
int lEffectDirection = oSlide.m_oSlideShow.m_oTransition.m_nEffectDirection;
|
||||
@ -314,7 +291,7 @@ namespace NSPresentationEditor
|
||||
break;
|
||||
}
|
||||
|
||||
Source = L"<VideoCompose Time=\"" + std::to_wstring(oSlide.m_oSlideShow.m_oTransition.m_dSpeed) + L"\" effectid=\"" + std::to_wstring(EffectID) + L"\"/>";
|
||||
Source = L"<VideoCompose Time=\"" + std::to_wstring(oSlide.m_oSlideShow.m_oTransition.m_dSpeed) + L"\" effectid=\"" + std::to_wstring(EffectID) + L"\"/>";
|
||||
|
||||
/*
|
||||
|
||||
@ -338,7 +315,7 @@ namespace NSPresentationEditor
|
||||
|
||||
return Source;
|
||||
}
|
||||
|
||||
#endif
|
||||
double CalculateTimes(CAudioOverlay& oAudioOverlay)
|
||||
{
|
||||
CaclulateSlideTimes();
|
||||
@ -486,7 +463,6 @@ namespace NSPresentationEditor
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
void ResetAutoText(IElement *pElement, vector_string const (&placeholdersReplaceString)[3])
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
|
||||
@ -488,6 +488,9 @@ namespace NSCustomVML
|
||||
std::vector<CSegment> m_arSegments;
|
||||
std::vector<CGuide> m_arGuides;
|
||||
std::vector<LONG>* m_pAdjustValues;
|
||||
std::vector<Aggplus::POINT> m_arConnectionSites;
|
||||
std::vector<Aggplus::RECT> m_arInscribe;
|
||||
std::vector<double> m_arConnectionSitesDir;
|
||||
|
||||
bool m_bIsVerticesPresent;
|
||||
bool m_bIsPathPresent;
|
||||
@ -496,7 +499,7 @@ namespace NSCustomVML
|
||||
CPen m_oPen;
|
||||
|
||||
public:
|
||||
CCustomVML() : m_arVertices(), m_arSegments(), m_arGuides(), m_pAdjustValues(NULL)
|
||||
CCustomVML() : m_pAdjustValues(NULL)
|
||||
{
|
||||
m_ePath = rtCurveTo/*rtLineTo*/;
|
||||
|
||||
@ -579,6 +582,63 @@ namespace NSCustomVML
|
||||
m_arVertices.push_back(oPoint);
|
||||
}
|
||||
}
|
||||
void LoadConnectionSitesDir(CProperty* pProperty)
|
||||
{
|
||||
NSOfficeDrawing::CBinaryReader oReader(pProperty->m_pOptions, pProperty->m_lValue);
|
||||
m_arConnectionSitesDir.clear();
|
||||
|
||||
WORD lCount = (WORD)(pProperty->m_lValue / 4);
|
||||
|
||||
for (WORD lIndex = 0; lIndex < lCount; ++lIndex)
|
||||
{
|
||||
DWORD v = oReader.ReadLONG();
|
||||
double val = (double)((WORD)(v >> 16) + ((WORD)(v) / 65536.0));
|
||||
m_arConnectionSitesDir.push_back(val);
|
||||
}
|
||||
}
|
||||
void LoadConnectionSites(CProperty* pProperty)
|
||||
{
|
||||
NSOfficeDrawing::CBinaryReader oReader(pProperty->m_pOptions, pProperty->m_lValue);
|
||||
m_arConnectionSites.clear();
|
||||
|
||||
WORD lCount = (WORD)(pProperty->m_lValue / 8);
|
||||
if (pProperty->m_bIsTruncated)
|
||||
{
|
||||
lCount = (WORD)(pProperty->m_lValue / 4);
|
||||
}
|
||||
|
||||
for (WORD lIndex = 0; lIndex < lCount; ++lIndex)
|
||||
{
|
||||
Aggplus::POINT oPoint;
|
||||
if (pProperty->m_bIsTruncated)
|
||||
{
|
||||
oPoint.x = (short)oReader.ReadWORD();
|
||||
oPoint.y = (short)oReader.ReadWORD();
|
||||
}
|
||||
else
|
||||
{
|
||||
oPoint.x = oReader.ReadLONG();
|
||||
oPoint.y = oReader.ReadLONG();
|
||||
}
|
||||
|
||||
LONG lMinF = (LONG)0x80000000;
|
||||
LONG lMaxF = (LONG)0x8000007F;
|
||||
if (lMinF <= oPoint.x)
|
||||
{
|
||||
int nGuideIndex = (DWORD)oPoint.x - 0x80000000;
|
||||
|
||||
bool b = false;
|
||||
}
|
||||
if (lMinF <= oPoint.y)
|
||||
{
|
||||
int nGuideIndex = (DWORD)oPoint.y - 0x80000000;
|
||||
|
||||
bool b = false;
|
||||
}
|
||||
|
||||
m_arConnectionSites.push_back(oPoint);
|
||||
}
|
||||
}
|
||||
void LoadVertices(CProperty* pProperty)
|
||||
{
|
||||
NSOfficeDrawing::CBinaryReader oReader(pProperty->m_pOptions, pProperty->m_lValue);
|
||||
@ -704,8 +764,38 @@ namespace NSCustomVML
|
||||
oInfo.Read(oReader);
|
||||
m_arGuides.push_back(oInfo);
|
||||
}
|
||||
|
||||
}
|
||||
void LoadInscribe(CProperty* pProperty)
|
||||
{
|
||||
NSOfficeDrawing::CBinaryReader oReader(pProperty->m_pOptions, pProperty->m_lValue);
|
||||
m_arInscribe.clear();
|
||||
|
||||
WORD lCount = (WORD)(pProperty->m_lValue / 16);
|
||||
if (pProperty->m_bIsTruncated)
|
||||
{
|
||||
lCount = (WORD)(pProperty->m_lValue / 8);
|
||||
}
|
||||
|
||||
for (WORD lIndex = 0; lIndex < lCount; ++lIndex)
|
||||
{
|
||||
Aggplus::RECT oRect;
|
||||
if (pProperty->m_bIsTruncated)
|
||||
{
|
||||
oRect.left = (short)oReader.ReadWORD();
|
||||
oRect.right = (short)oReader.ReadWORD();
|
||||
oRect.top = (short)oReader.ReadWORD();
|
||||
oRect.bottom = (short)oReader.ReadWORD();
|
||||
}
|
||||
else
|
||||
{
|
||||
oRect.left = (short)oReader.ReadLONG();
|
||||
oRect.right = (short)oReader.ReadLONG();
|
||||
oRect.top = (short)oReader.ReadLONG();
|
||||
oRect.bottom = (short)oReader.ReadLONG();
|
||||
}
|
||||
m_arInscribe.push_back(oRect);
|
||||
}
|
||||
}
|
||||
void LoadAdjusts(LONG lIndex, LONG lValue)
|
||||
{
|
||||
if (NULL == m_pAdjustValues)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user