Commit f5b141ee authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent 1e47dc11
...@@ -273,7 +273,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm) ...@@ -273,7 +273,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
CP_XML_ATTR(L"accent6",L"accent6"); CP_XML_ATTR(L"accent6",L"accent6");
CP_XML_ATTR(L"accent5",L"accent5"); CP_XML_ATTR(L"accent5",L"accent5");
CP_XML_ATTR(L"accent4",L"accent4"); CP_XML_ATTR(L"accent4",L"accent4");
CP_XML_ATTR(L"accent3",L"accent5"); CP_XML_ATTR(L"accent3",L"accent3");
CP_XML_ATTR(L"accent2",L"accent2"); CP_XML_ATTR(L"accent2",L"accent2");
CP_XML_ATTR(L"accent1",L"accent1"); CP_XML_ATTR(L"accent1",L"accent1");
CP_XML_ATTR(L"tx2",L"dk2"); CP_XML_ATTR(L"tx2",L"dk2");
...@@ -283,7 +283,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm) ...@@ -283,7 +283,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
} }
CP_XML_NODE(L"p:sldLayoutIdLst") CP_XML_NODE(L"p:sldLayoutIdLst")
{ {
for (int i = 0; i < layoutsId_.size(); i++) for (size_t i = 0; i < layoutsId_.size(); i++)
{ {
CP_XML_NODE(L"p:sldLayoutId") CP_XML_NODE(L"p:sldLayoutId")
{ {
...@@ -420,9 +420,13 @@ void pptx_xml_presentation::write_to(std::wostream & strm) ...@@ -420,9 +420,13 @@ void pptx_xml_presentation::write_to(std::wostream & strm)
{ {
CP_XML_STREAM() << slideMastersData_.str(); CP_XML_STREAM() << slideMastersData_.str();
} }
std::wstring notesMaster = slideNotesMastersData_.str();
if (notesMaster.empty() == false)
{
CP_XML_NODE(L"p:notesMasterIdLst") CP_XML_NODE(L"p:notesMasterIdLst")
{ {
CP_XML_STREAM() << slideNotesMastersData_.str(); CP_XML_STREAM() << notesMaster;
}
} }
CP_XML_NODE(L"p:sldIdLst") CP_XML_NODE(L"p:sldIdLst")
{ {
......
...@@ -311,7 +311,7 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -311,7 +311,7 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
else if (filter_attlist_.smil_subtype_.get()==L"topLeft") dir = L"rd"; else if (filter_attlist_.smil_subtype_.get()==L"topLeft") dir = L"rd";
else if (filter_attlist_.smil_subtype_.get()==L"fromTopLeft") dir = L"rd"; else if (filter_attlist_.smil_subtype_.get()==L"fromTopLeft") dir = L"rd";
else if (filter_attlist_.smil_subtype_.get()==L"fromBottomLeft") dir = L"ru"; else if (filter_attlist_.smil_subtype_.get()==L"fromBottomLeft")dir = L"ru";
else if (filter_attlist_.smil_subtype_.get()==L"fromTopRight") dir = L"ld"; else if (filter_attlist_.smil_subtype_.get()==L"fromTopRight") dir = L"ld";
else if (filter_attlist_.smil_subtype_.get()==L"fromBottomRight")dir = L"lu"; else if (filter_attlist_.smil_subtype_.get()==L"fromBottomRight")dir = L"lu";
......
...@@ -84,22 +84,22 @@ std::wostream & operator << (std::wostream & _Wostream, const clockvalue & _Val) ...@@ -84,22 +84,22 @@ std::wostream & operator << (std::wostream & _Wostream, const clockvalue & _Val)
return _Wostream; return _Wostream;
} }
static bool parseTime(const std::wstring & Time, double & Hours, double & Minutes, double & Seconds, int & Ms) bool parseTime(std::wstring Time, double & Hours, double & Minutes, double & Seconds, int & Ms)
{ {
try try
{ {
boost::match_results<std::wstring::const_iterator> res;
//Full clock values: //Full clock values:
// 02:30:03 = 2 hours, 30 minutes and 3 seconds // 02:30:03 = 2 hours, 30 minutes and 3 seconds
// 50:00:10.25 = 50 hours, 10 seconds and 250 milliseconds // 50:00:10.25 = 50 hours, 10 seconds and 250 milliseconds
boost::match_results<std::wstring::const_iterator> res1;
boost::wregex r1 (L"([\\d]+):([\\d]+):([\\d+(\\.\\d{0,})?]+)"); boost::wregex r1 (L"([\\d]+):([\\d]+):([\\d+(\\.\\d{0,})?]+)");
if (boost::regex_match(Time, res, r1)) if (boost::regex_match(Time, res1, r1))
{ {
Hours = boost::lexical_cast<int>(res[1].str()); Hours = boost::lexical_cast<int>(res1[1].str());
Minutes = boost::lexical_cast<int>(res[2].str()); Minutes = boost::lexical_cast<int>(res1[2].str());
Seconds = boost::lexical_cast<double>(res[3].str()); Seconds = boost::lexical_cast<double>(res1[3].str());
return true; return true;
} }
...@@ -107,11 +107,12 @@ static bool parseTime(const std::wstring & Time, double & Hours, double & Minute ...@@ -107,11 +107,12 @@ static bool parseTime(const std::wstring & Time, double & Hours, double & Minute
// 02:33 = 2 minutes and 33 seconds // 02:33 = 2 minutes and 33 seconds
// 00:10.5 = 10.5 seconds = 10 seconds and 500 milliseconds // 00:10.5 = 10.5 seconds = 10 seconds and 500 milliseconds
std::wstring Time2 = L"00:10.5"; std::wstring Time2 = L"00:10.5";
boost::match_results<std::wstring::const_iterator> res2;
boost::wregex r2 (L"([\\d]+):([\\d+(\\.\\d{0,})?]+)"); boost::wregex r2 (L"([\\d]+):([\\d+(\\.\\d{0,})?]+)");
if (boost::regex_match(Time, res, r2)) if (boost::regex_match(Time, res2, r2))
{ {
Minutes = boost::lexical_cast<int>(res[1].str()); Minutes = boost::lexical_cast<int>(res2[1].str());
Seconds = boost::lexical_cast<double>(res[2].str()); Seconds = boost::lexical_cast<double>(res2[2].str());
return true; return true;
} }
...@@ -121,32 +122,51 @@ static bool parseTime(const std::wstring & Time, double & Hours, double & Minute ...@@ -121,32 +122,51 @@ static bool parseTime(const std::wstring & Time, double & Hours, double & Minute
// 30s = 30 seconds // 30s = 30 seconds
// 5ms = 5 milliseconds // 5ms = 5 milliseconds
// 12.467 = 12 seconds and 467 milliseconds // 12.467 = 12 seconds and 467 milliseconds
boost::wregex r3 (L"([\\d+(\\.\\d{0,})?]+)([A-Za-z]{0,})"); std::vector<std::wstring> values;
if (boost::regex_match(Time, res, r3)) boost::wregex r3 (L"([\\d+(\\.\\d{0,})?]+)([A-Za-z]+)");
if (boost::regex_split(std::back_inserter(values), Time, r3, boost::match_default | boost::format_all))
{ {
if (!res[2].str().empty()) int val = -1;
for (size_t i = 0; i < values.size() ; i++ )
{ {
std::wstring n = res[2].str(); if (values[i].empty()) continue;
std::transform(n.begin(), n.end(), n.begin(), ::tolower);
if (n == L"h") if (values[i] == L"h")
{ {
Hours = boost::lexical_cast<double>(res[1].str()); if (val >= 0)
Hours = val;
val = -1;
} }
else if (n == L"min") else if (values[i] == L"min")
{ {
Minutes = boost::lexical_cast<double>(res[1].str()); if (val >= 0)
Minutes = val;
val = -1;
} }
else if (n == L"s") else if (values[i] == L"s")
{ {
Seconds = boost::lexical_cast<double>(res[1].str()); if (val >= 0)
Seconds = val;
val = -1;
} }
else if (n == L"ms") else if (values[i] == L"ms")
{ {
Ms = boost::lexical_cast<int>(res[1].str()); if (val >= 0)
} Ms = val;
val = -1;
} }
else else
Seconds = boost::lexical_cast<double>(res[1].str()); {
try
{
val = boost::lexical_cast<double>(values[i]);
}
catch(...)
{
continue;
}
}
}
return true; return true;
} }
......
...@@ -653,6 +653,11 @@ void PptxConverter::convert(PPTX::Logic::EmptyTransition *oox_transition) ...@@ -653,6 +653,11 @@ void PptxConverter::convert(PPTX::Logic::EmptyTransition *oox_transition)
odp_context->current_slide().set_transition_type(20); //miscShapeWipe odp_context->current_slide().set_transition_type(20); //miscShapeWipe
odp_context->current_slide().set_transition_subtype(L"cornersOut"); odp_context->current_slide().set_transition_subtype(L"cornersOut");
} }
else if (oox_transition->name == L"switch")
{
odp_context->current_slide().set_transition_type(20); //miscShapeWipe
odp_context->current_slide().set_transition_subtype(L"topToBottom");
}
else else
{ {
odp_context->current_slide().set_transition_type(36); //fade odp_context->current_slide().set_transition_type(36); //fade
...@@ -772,7 +777,8 @@ void PptxConverter::convert(PPTX::Logic::SplitTransition *oox_transition) ...@@ -772,7 +777,8 @@ void PptxConverter::convert(PPTX::Logic::SplitTransition *oox_transition)
{ {
if (!oox_transition) return; if (!oox_transition) return;
//name == split //name == split
odp_context->current_slide().set_transition_type(8); odp_context->current_slide().set_transition_type(3);
odp_context->current_slide().set_transition_subtype(L"vertical");
} }
void PptxConverter::convert(PPTX::Logic::ZoomTransition *oox_transition) void PptxConverter::convert(PPTX::Logic::ZoomTransition *oox_transition)
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
QT -= core QT -= core
QT -= gui QT -= gui
VERSION = 2.4.456.0 VERSION = 2.4.460.0
DEFINES += INTVER=$$VERSION DEFINES += INTVER=$$VERSION
TARGET = x2t TARGET = x2t
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment