Commit f5b141ee authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent 1e47dc11
......@@ -273,7 +273,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
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"accent3",L"accent3");
CP_XML_ATTR(L"accent2",L"accent2");
CP_XML_ATTR(L"accent1",L"accent1");
CP_XML_ATTR(L"tx2",L"dk2");
......@@ -283,7 +283,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
}
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")
{
......@@ -420,9 +420,13 @@ void pptx_xml_presentation::write_to(std::wostream & strm)
{
CP_XML_STREAM() << slideMastersData_.str();
}
std::wstring notesMaster = slideNotesMastersData_.str();
if (notesMaster.empty() == false)
{
CP_XML_NODE(L"p:notesMasterIdLst")
{
CP_XML_STREAM() << slideNotesMastersData_.str();
CP_XML_STREAM() << notesMaster;
}
}
CP_XML_NODE(L"p:sldIdLst")
{
......
......@@ -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"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"fromBottomRight")dir = L"lu";
......
......@@ -84,22 +84,22 @@ std::wostream & operator << (std::wostream & _Wostream, const clockvalue & _Val)
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
{
boost::match_results<std::wstring::const_iterator> res;
//Full clock values:
// 02:30:03 = 2 hours, 30 minutes and 3 seconds
// 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,})?]+)");
if (boost::regex_match(Time, res, r1))
if (boost::regex_match(Time, res1, r1))
{
Hours = boost::lexical_cast<int>(res[1].str());
Minutes = boost::lexical_cast<int>(res[2].str());
Seconds = boost::lexical_cast<double>(res[3].str());
Hours = boost::lexical_cast<int>(res1[1].str());
Minutes = boost::lexical_cast<int>(res1[2].str());
Seconds = boost::lexical_cast<double>(res1[3].str());
return true;
}
......@@ -107,11 +107,12 @@ static bool parseTime(const std::wstring & Time, double & Hours, double & Minute
// 02:33 = 2 minutes and 33 seconds
// 00:10.5 = 10.5 seconds = 10 seconds and 500 milliseconds
std::wstring Time2 = L"00:10.5";
boost::match_results<std::wstring::const_iterator> res2;
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());
Seconds = boost::lexical_cast<double>(res[2].str());
Minutes = boost::lexical_cast<int>(res2[1].str());
Seconds = boost::lexical_cast<double>(res2[2].str());
return true;
}
......@@ -121,32 +122,51 @@ static bool parseTime(const std::wstring & Time, double & Hours, double & Minute
// 30s = 30 seconds
// 5ms = 5 milliseconds
// 12.467 = 12 seconds and 467 milliseconds
boost::wregex r3 (L"([\\d+(\\.\\d{0,})?]+)([A-Za-z]{0,})");
if (boost::regex_match(Time, res, r3))
std::vector<std::wstring> values;
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();
std::transform(n.begin(), n.end(), n.begin(), ::tolower);
if (n == L"h")
if (values[i].empty()) continue;
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
Seconds = boost::lexical_cast<double>(res[1].str());
{
try
{
val = boost::lexical_cast<double>(values[i]);
}
catch(...)
{
continue;
}
}
}
return true;
}
......
......@@ -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_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
{
odp_context->current_slide().set_transition_type(36); //fade
......@@ -772,7 +777,8 @@ void PptxConverter::convert(PPTX::Logic::SplitTransition *oox_transition)
{
if (!oox_transition) return;
//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)
{
......
......@@ -7,7 +7,7 @@
QT -= core
QT -= gui
VERSION = 2.4.456.0
VERSION = 2.4.460.0
DEFINES += INTVER=$$VERSION
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