Commit 1beb5440 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatWriter - transitions

parent 9a9ba4cc
......@@ -132,7 +132,7 @@ void pptx_conversion_context::process_layouts()
type == odf_types::presentation_class::header ||
type == odf_types::presentation_class::page_number)
{
if (frame->idx_in_owner <0)
if (frame->idx_in_owner < 0)
frame->idx_in_owner = last_idx_placeHolder++;
frame->pptx_convert_placeHolder(*this);
......
......@@ -58,6 +58,7 @@ const wchar_t * anim_par::name = L"par";
void anim_par::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
attlist_.add_attributes(Attributes);
}
void anim_par::pptx_convert(oox::pptx_conversion_context & Context)
......@@ -98,6 +99,7 @@ const wchar_t * anim_seq::name = L"seq";
void anim_seq::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
attlist_.add_attributes(Attributes);
}
void anim_seq::pptx_convert(oox::pptx_conversion_context & Context)
......@@ -211,11 +213,11 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
case smil_transition_type::checkerBoardWipe:
type = L"checker";
if (attlist_.smil_subtype_.get()==L"across") dir = L"horz";
if (attlist_.smil_subtype_.get()==L"down") dir = L"vert";
if (attlist_.smil_subtype_.get()==L"down") dir = L"vert";
break;
case smil_transition_type::blindsWipe:
type = L"blinds";
if (attlist_.smil_subtype_.get()==L"vertical") dir = L"vert";
if (attlist_.smil_subtype_.get()==L"vertical") dir = L"vert";
if (attlist_.smil_subtype_.get()==L"horizontal") dir = L"horz";
break;
case smil_transition_type::diagonalWipe:
......@@ -223,9 +225,9 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
type = L"strips";
if (attlist_.smil_subtype_)
{
if (attlist_.smil_subtype_.get() == L"horizontalLeft") dir = L"rd";
if (attlist_.smil_subtype_.get() == L"horizontalLeft") dir = L"rd";
else if (attlist_.smil_subtype_.get() == L"horizontalRight") dir = L"lu";
else if (attlist_.smil_subtype_.get() == L"verticalRight") dir = L"ld";
else if (attlist_.smil_subtype_.get() == L"verticalRight") dir = L"ld";
else dir = L"ru";
}
break;
......@@ -235,11 +237,11 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
case smil_transition_type::randomBarWipe:
type = L"randomBar";
if (attlist_.smil_subtype_.get() == L"vertical") dir = L"vert";
if (attlist_.smil_subtype_.get() == L"horizontal")dir = L"horz";
if (attlist_.smil_subtype_.get() == L"horizontal") dir = L"horz";
break;
case smil_transition_type::pushWipe:
type = L"push";
if (attlist_.smil_subtype_.get()==L"combVertical") {type = L"comb"; dir = L"vert";};
if (attlist_.smil_subtype_.get()==L"combVertical") {type = L"comb"; dir = L"vert";};
if (attlist_.smil_subtype_.get()==L"combHorizontal") {type = L"comb"; dir = L"horz";};
break;
case smil_transition_type::slideWipe:
......@@ -250,7 +252,7 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
break;
case smil_transition_type::barnDoorWipe:
type = L"split";
if (attlist_.smil_subtype_.get()==L"vertical") param = L"vert";
if (attlist_.smil_subtype_.get()==L"vertical") param = L"vert";
if (attlist_.smil_subtype_.get()==L"horizontal") param = L"horz";
break;
case smil_transition_type::barWipe:
......@@ -298,15 +300,15 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
if (attlist_.smil_subtype_.get()==L"fromTop") dir = L"d";
if (attlist_.smil_subtype_.get()==L"fromLeft") dir = L"r";
if (attlist_.smil_subtype_.get()==L"fromRight") dir = L"l";
if (attlist_.smil_subtype_.get()==L"fromBottom") dir = L"u";
if (attlist_.smil_subtype_.get()==L"fromBottom") dir = L"u";
if (attlist_.smil_subtype_.get()==L"topRight") dir = L"ld";
if (attlist_.smil_subtype_.get()==L"bottomLeft") dir = L"lu";
if (attlist_.smil_subtype_.get()==L"bottomLeft") dir = L"lu";
if (attlist_.smil_subtype_.get()==L"bottomRight") dir = L"ru";
if (attlist_.smil_subtype_.get()==L"topLeft") dir = L"rd";
if (attlist_.smil_subtype_.get()==L"fromTopLeft") dir = L"rd";
if (attlist_.smil_subtype_.get()==L"fromBottomLeft") dir = L"ru";
if (attlist_.smil_subtype_.get()==L"fromBottomLeft")dir = L"ru";
if (attlist_.smil_subtype_.get()==L"fromTopRight") dir = L"ld";
if (attlist_.smil_subtype_.get()==L"fromBottomRight")dir = L"lu";
......
......@@ -41,47 +41,47 @@ std::wostream & operator << (std::wostream & _Wostream, const smil_transition_ty
{
switch(_Val.get_type())
{
case smil_transition_type::barWipe : _Wostream << L"barwipe" ; break;
case smil_transition_type::boxWipe : _Wostream << L"boxwipe" ; break;
case smil_transition_type::fourBoxWipe : _Wostream << L"fourboxwipe" ; break;
case smil_transition_type::barnDoorWipe : _Wostream << L"barndoorwipe" ; break;
case smil_transition_type::diagonalWipe : _Wostream << L"diagonalwipe" ; break;
case smil_transition_type::bowTieWipe : _Wostream << L"bowtiewipe" ; break;
case smil_transition_type::miscDiagonalWipe : _Wostream << L"miscdiagonalwipe"; break;
case smil_transition_type::veeWipe : _Wostream << L"veewipe" ; break;
case smil_transition_type::barnVeeWipe : _Wostream << L"barnveewipe" ; break;
case smil_transition_type::zigZagWipe : _Wostream << L"zigzagwipe" ; break;
case smil_transition_type::barnZigZagWipe : _Wostream << L"barnzigzagwipe" ; break;
case smil_transition_type::irisWipe : _Wostream << L"iriswipe" ; break;
case smil_transition_type::triangleWipe : _Wostream << L"trianglewipe" ; break;
case smil_transition_type::arrowHeadWipe : _Wostream << L"arrowheadwipe" ; break;
case smil_transition_type::pentagonWipe : _Wostream << L"pentagonwipe" ; break;
case smil_transition_type::hexagonWipe : _Wostream << L"hexagonwipe" ; break;
case smil_transition_type::ellipseWipe : _Wostream << L"ellipsewipe" ; break;
case smil_transition_type::eyeWipe : _Wostream << L"eyewipe" ; break;
case smil_transition_type::roundRectWipe : _Wostream << L"roundrectwipe" ; break;
case smil_transition_type::starWipe : _Wostream << L"starwipe" ; break;
case smil_transition_type::miscShapeWipe : _Wostream << L"miscshapewipe" ; break;
case smil_transition_type::clockWipe : _Wostream << L"clockwipe" ; break;
case smil_transition_type::pinWheelWipe : _Wostream << L"pinwheelwipe" ; break;
case smil_transition_type::singleSweepWipe : _Wostream << L"singlesweepwipe" ; break;
case smil_transition_type::fanWipe : _Wostream << L"fanwipe" ; break;
case smil_transition_type::doubleFanWipe : _Wostream << L"doublefanwipe" ; break;
case smil_transition_type::doubleSweepWipe : _Wostream << L"doublesweepwipe" ; break;
case smil_transition_type::saloonDoorWipe : _Wostream << L"saloondoorwipe" ; break;
case smil_transition_type::windshieldWipe : _Wostream << L"windshieldwipe" ; break;
case smil_transition_type::snakeWipe : _Wostream << L"snakewipe" ; break;
case smil_transition_type::spiralWipe : _Wostream << L"spiralwipe" ; break;
case smil_transition_type::parallelSnakesWipe: _Wostream << L"parallelsnakeswipe"; break;
case smil_transition_type::boxSnakesWipe : _Wostream << L"boxsnakeswipe" ; break;
case smil_transition_type::waterfallWipe : _Wostream << L"waterfallwipe" ; break;
case smil_transition_type::pushWipe : _Wostream << L"pushwipe" ; break;
case smil_transition_type::slideWipe : _Wostream << L"slidewipe" ; break;
case smil_transition_type::barWipe : _Wostream << L"barWipe" ; break;
case smil_transition_type::boxWipe : _Wostream << L"boxWipe" ; break;
case smil_transition_type::fourBoxWipe : _Wostream << L"fourBoxWipe" ; break;
case smil_transition_type::barnDoorWipe : _Wostream << L"barnDoorWipe" ; break;
case smil_transition_type::diagonalWipe : _Wostream << L"diagonalWipe" ; break;
case smil_transition_type::bowTieWipe : _Wostream << L"bowTieWipe" ; break;
case smil_transition_type::miscDiagonalWipe : _Wostream << L"miscDiagonalWipe"; break;
case smil_transition_type::veeWipe : _Wostream << L"veeWipe" ; break;
case smil_transition_type::barnVeeWipe : _Wostream << L"barnVeeWipe" ; break;
case smil_transition_type::zigZagWipe : _Wostream << L"zigZagWipe" ; break;
case smil_transition_type::barnZigZagWipe : _Wostream << L"barnZigZagWipe" ; break;
case smil_transition_type::irisWipe : _Wostream << L"irisWipe" ; break;
case smil_transition_type::triangleWipe : _Wostream << L"triangleWipe" ; break;
case smil_transition_type::arrowHeadWipe : _Wostream << L"arrowHeadWipe" ; break;
case smil_transition_type::pentagonWipe : _Wostream << L"pentagonWipe" ; break;
case smil_transition_type::hexagonWipe : _Wostream << L"hexagonWipe" ; break;
case smil_transition_type::ellipseWipe : _Wostream << L"ellipseWipe" ; break;
case smil_transition_type::eyeWipe : _Wostream << L"eyeWipe" ; break;
case smil_transition_type::roundRectWipe : _Wostream << L"roundRectWipe" ; break;
case smil_transition_type::starWipe : _Wostream << L"starWipe" ; break;
case smil_transition_type::miscShapeWipe : _Wostream << L"miscShapeWipe" ; break;
case smil_transition_type::clockWipe : _Wostream << L"clockWipe" ; break;
case smil_transition_type::pinWheelWipe : _Wostream << L"pinWheelWipe" ; break;
case smil_transition_type::singleSweepWipe : _Wostream << L"singleSweepWipe" ; break;
case smil_transition_type::fanWipe : _Wostream << L"fanWipe" ; break;
case smil_transition_type::doubleFanWipe : _Wostream << L"doubleFanWipe" ; break;
case smil_transition_type::doubleSweepWipe : _Wostream << L"doubleSweepWipe" ; break;
case smil_transition_type::saloonDoorWipe : _Wostream << L"saloonDoorWipe" ; break;
case smil_transition_type::windshieldWipe : _Wostream << L"windshieldWipe" ; break;
case smil_transition_type::snakeWipe : _Wostream << L"snakeWipe" ; break;
case smil_transition_type::spiralWipe : _Wostream << L"spiralWipe" ; break;
case smil_transition_type::parallelSnakesWipe: _Wostream << L"parallelSnakesWipe"; break;
case smil_transition_type::boxSnakesWipe : _Wostream << L"boxSnakesWipe" ; break;
case smil_transition_type::waterfallWipe : _Wostream << L"waterfallWipe" ; break;
case smil_transition_type::pushWipe : _Wostream << L"pushWipe" ; break;
case smil_transition_type::slideWipe : _Wostream << L"slideWipe" ; break;
case smil_transition_type::fade : _Wostream << L"fade" ; break;
case smil_transition_type::checkerBoardWipe : _Wostream << L"checkerboardwipe"; break;
case smil_transition_type::blindsWipe : _Wostream << L"blindswipe" ; break;
case smil_transition_type::checkerBoardWipe : _Wostream << L"checkerboardWipe"; break;
case smil_transition_type::blindsWipe : _Wostream << L"blindsWipe" ; break;
case smil_transition_type::dissolve : _Wostream << L"dissolve" ; break;
case smil_transition_type::randomBarWipe : _Wostream << L"randombarwipe" ; break;
case smil_transition_type::randomBarWipe : _Wostream << L"randomBarWipe" ; break;
}
return _Wostream;
}
......@@ -91,47 +91,47 @@ smil_transition_type smil_transition_type::parse(const std::wstring & Str)
std::wstring tmp = Str;
boost::algorithm::to_lower(tmp);
if(tmp == L"barwipe") return smil_transition_type( barWipe );
else if(tmp == L"boxwipe") return smil_transition_type( boxWipe );
else if(tmp == L"fourboxwipe") return smil_transition_type( fourBoxWipe );
else if(tmp == L"barndoorwipe") return smil_transition_type( barnDoorWipe );
else if(tmp == L"diagonalwipe") return smil_transition_type( diagonalWipe );
else if(tmp == L"bowtiewipe") return smil_transition_type( bowTieWipe );
else if(tmp == L"miscdiagonalwipe") return smil_transition_type( miscDiagonalWipe );
else if(tmp == L"veewipe") return smil_transition_type( veeWipe );
else if(tmp == L"barnveewipe") return smil_transition_type( barnVeeWipe );
else if(tmp == L"zigzagwipe") return smil_transition_type( zigZagWipe );
else if(tmp == L"barnzigzagwipe") return smil_transition_type( barnZigZagWipe );
else if(tmp == L"iriswipe") return smil_transition_type( irisWipe);
else if(tmp == L"trianglewipe") return smil_transition_type( triangleWipe);
else if(tmp == L"arrowheadwipe") return smil_transition_type( arrowHeadWipe );
else if(tmp == L"pentagonwipe") return smil_transition_type( pentagonWipe );
else if(tmp == L"hexagonwipe") return smil_transition_type( hexagonWipe );
else if(tmp == L"ellipsewipe") return smil_transition_type( ellipseWipe );
else if(tmp == L"eyewipe") return smil_transition_type( eyeWipe );
else if(tmp == L"roundrectwipe") return smil_transition_type( roundRectWipe );
else if(tmp == L"starwipe") return smil_transition_type( starWipe );
else if(tmp == L"miscshapewipe") return smil_transition_type( miscShapeWipe );
else if(tmp == L"clockwipe") return smil_transition_type( clockWipe );
else if(tmp == L"pinwheelwipe") return smil_transition_type( pinWheelWipe );
else if(tmp == L"singlesweepwipe") return smil_transition_type( singleSweepWipe);
else if(tmp == L"fanwipe") return smil_transition_type( fanWipe );
else if(tmp == L"doublefanwipe") return smil_transition_type( doubleFanWipe );
else if(tmp == L"doublesweepwipe") return smil_transition_type( doubleSweepWipe );
else if(tmp == L"saloondoorwipe") return smil_transition_type( saloonDoorWipe );
else if(tmp == L"windshieldwipe") return smil_transition_type( windshieldWipe );
else if(tmp == L"snakewipe") return smil_transition_type( snakeWipe );
else if(tmp == L"spiralwipe") return smil_transition_type( spiralWipe );
else if(tmp == L"parallelsnakeswipe")return smil_transition_type( parallelSnakesWipe );
else if(tmp == L"boxsnakeswipe") return smil_transition_type( boxSnakesWipe );
else if(tmp == L"waterfallwipe") return smil_transition_type( waterfallWipe );
else if(tmp == L"pushwipe") return smil_transition_type( pushWipe );
else if(tmp == L"slidewipe") return smil_transition_type( slideWipe );
if(tmp == L"barWipe") return smil_transition_type( barWipe );
else if(tmp == L"boxWipe") return smil_transition_type( boxWipe );
else if(tmp == L"fourboxWipe") return smil_transition_type( fourBoxWipe );
else if(tmp == L"barndoorWipe") return smil_transition_type( barnDoorWipe );
else if(tmp == L"diagonalWipe") return smil_transition_type( diagonalWipe );
else if(tmp == L"bowtieWipe") return smil_transition_type( bowTieWipe );
else if(tmp == L"miscdiagonalWipe") return smil_transition_type( miscDiagonalWipe );
else if(tmp == L"veeWipe") return smil_transition_type( veeWipe );
else if(tmp == L"barnveeWipe") return smil_transition_type( barnVeeWipe );
else if(tmp == L"zigzagWipe") return smil_transition_type( zigZagWipe );
else if(tmp == L"barnzigzagWipe") return smil_transition_type( barnZigZagWipe );
else if(tmp == L"irisWipe") return smil_transition_type( irisWipe);
else if(tmp == L"triangleWipe") return smil_transition_type( triangleWipe);
else if(tmp == L"arrowheadWipe") return smil_transition_type( arrowHeadWipe );
else if(tmp == L"pentagonWipe") return smil_transition_type( pentagonWipe );
else if(tmp == L"hexagonWipe") return smil_transition_type( hexagonWipe );
else if(tmp == L"ellipseWipe") return smil_transition_type( ellipseWipe );
else if(tmp == L"eyeWipe") return smil_transition_type( eyeWipe );
else if(tmp == L"roundrectWipe") return smil_transition_type( roundRectWipe );
else if(tmp == L"starWipe") return smil_transition_type( starWipe );
else if(tmp == L"miscshapeWipe") return smil_transition_type( miscShapeWipe );
else if(tmp == L"clockWipe") return smil_transition_type( clockWipe );
else if(tmp == L"pinwheelWipe") return smil_transition_type( pinWheelWipe );
else if(tmp == L"singlesweepWipe") return smil_transition_type( singleSweepWipe);
else if(tmp == L"fanWipe") return smil_transition_type( fanWipe );
else if(tmp == L"doublefanWipe") return smil_transition_type( doubleFanWipe );
else if(tmp == L"doublesweepWipe") return smil_transition_type( doubleSweepWipe );
else if(tmp == L"saloondoorWipe") return smil_transition_type( saloonDoorWipe );
else if(tmp == L"windshieldWipe") return smil_transition_type( windshieldWipe );
else if(tmp == L"snakeWipe") return smil_transition_type( snakeWipe );
else if(tmp == L"spiralWipe") return smil_transition_type( spiralWipe );
else if(tmp == L"parallelsnakesWipe")return smil_transition_type( parallelSnakesWipe );
else if(tmp == L"boxsnakesWipe") return smil_transition_type( boxSnakesWipe );
else if(tmp == L"waterfallWipe") return smil_transition_type( waterfallWipe );
else if(tmp == L"pushWipe") return smil_transition_type( pushWipe );
else if(tmp == L"slideWipe") return smil_transition_type( slideWipe );
else if(tmp == L"fade") return smil_transition_type( fade );
else if(tmp == L"checkerboardwipe") return smil_transition_type( checkerBoardWipe);
else if(tmp == L"blindswipe") return smil_transition_type( blindsWipe);
else if(tmp == L"checkerboardWipe") return smil_transition_type( checkerBoardWipe);
else if(tmp == L"blindsWipe") return smil_transition_type( blindsWipe);
else if(tmp == L"dissolve") return smil_transition_type( dissolve);
else if(tmp == L"randombarwipe") return smil_transition_type( randomBarWipe);
else if(tmp == L"randombarWipe") return smil_transition_type( randomBarWipe);
else
{
return smil_transition_type( barWipe );
......
......@@ -342,11 +342,14 @@ namespace odf_writer
CP_XML_ATTR(L"xmlns:tableooo", L"http://openoffice.org/2009/table" );
CP_XML_ATTR(L"xmlns:drawooo", L"http://openoffice.org/2010/draw" );
CP_XML_ATTR(L"xmlns:chartooo", L"http://openoffice.org/2010/chart" );
CP_XML_ATTR(L"xmlns:smil", L"urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0");
CP_XML_ATTR(L"xmlns:anim", L"urn:oasis:names:tc:opendocument:xmlns:animation:1.0" );
CP_XML_ATTR(L"xmlns:calcext", L"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" );
CP_XML_ATTR(L"xmlns:field", L"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" );
CP_XML_ATTR(L"xmlns:formx", L"urn:openoffice:names:experimental:ooxml-odf_writer-interop:xmlns:form:1.0" );
CP_XML_ATTR(L"xmlns:loext", L"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" );
CP_XML_ATTR(L"xmlns:css3t", L"http://www.w3.org/TR/css3-text/" );
CP_XML_ATTR(L"office:version", L"1.2");
//CP_XML_NODE(L"office:scripts");
......@@ -402,6 +405,8 @@ namespace odf_writer
CP_XML_ATTR(L"xmlns:of", L"urn:oasis:names:tc:opendocument:xmlns:of:1.2" );
CP_XML_ATTR(L"xmlns:xhtml", L"http://www.w3.org/1999/xhtml" );
CP_XML_ATTR(L"xmlns:grddl", L"http://www.w3.org/2003/g/data-view#" );
CP_XML_ATTR(L"xmlns:smil", L"urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0");
CP_XML_ATTR(L"xmlns:anim", L"urn:oasis:names:tc:opendocument:xmlns:animation:1.0" );
CP_XML_ATTR(L"xmlns:officeooo", L"http://openoffice.org/2009/office" );
CP_XML_ATTR(L"xmlns:textooo", L"http://openoffice.org/2013/office" );
CP_XML_ATTR(L"xmlns:tableooo", L"http://openoffice.org/2009/table" );
......
......@@ -191,7 +191,7 @@ void odp_page_state::set_transition_type(int val)
{
anim_transitionFilter *trans = dynamic_cast<anim_transitionFilter*>(page_transaction.get());
if (trans)
trans->attlist_.smil_type_ = odf_types::smil_transition_type(odf_types::smil_transition_type::dissolve);
trans->attlist_.smil_type_ = odf_types::smil_transition_type((odf_types::smil_transition_type::type)val);
}
void odp_page_state::set_transition_subtype(std::wstring val)
{
......
......@@ -253,116 +253,88 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown)
{
case OOX::et_w_ptab:
{
OOX::Logic::CPTab* pT= dynamic_cast<OOX::Logic::CPTab*>(oox_unknown);
convert(pT);
convert(dynamic_cast<OOX::Logic::CPTab*>(oox_unknown));
}break;
case OOX::et_w_sdt:
{
OOX::Logic::CSdt* pP= dynamic_cast<OOX::Logic::CSdt*>(oox_unknown);
convert(pP);
convert(dynamic_cast<OOX::Logic::CSdt*>(oox_unknown));
}break;
case OOX::et_w_fldSimple:
{
OOX::Logic::CFldSimple* pFldS= dynamic_cast<OOX::Logic::CFldSimple*>(oox_unknown);
convert(pFldS);
convert(dynamic_cast<OOX::Logic::CFldSimple*>(oox_unknown));
}break;
case OOX::et_w_r:
{
OOX::Logic::CRun* pRun= dynamic_cast<OOX::Logic::CRun*>(oox_unknown);
convert(pRun);
convert(dynamic_cast<OOX::Logic::CRun*>(oox_unknown));
}break;
case OOX::et_w_p:
{
OOX::Logic::CParagraph* pP= dynamic_cast<OOX::Logic::CParagraph*>(oox_unknown);
convert(pP);
convert(dynamic_cast<OOX::Logic::CParagraph*>(oox_unknown));
}break;
case OOX::et_w_ins:
{
OOX::Logic::CIns* pIns= dynamic_cast<OOX::Logic::CIns*>(oox_unknown);
convert(pIns);
convert(dynamic_cast<OOX::Logic::CIns*>(oox_unknown));
}break;
case OOX::et_w_del:
{
OOX::Logic::CDel* pDel= dynamic_cast<OOX::Logic::CDel*>(oox_unknown);
convert(pDel);
convert(dynamic_cast<OOX::Logic::CDel*>(oox_unknown));
}break;
case OOX::et_w_smartTag:
{
OOX::Logic::CSmartTag* pTag= dynamic_cast<OOX::Logic::CSmartTag*>(oox_unknown);
convert(pTag);
convert(dynamic_cast<OOX::Logic::CSmartTag*>(oox_unknown));
}break;
case OOX::et_w_pPr:
{
OOX::Logic::CParagraphProperty* pPProp= dynamic_cast<OOX::Logic::CParagraphProperty*>(oox_unknown);
convert(pPProp);
convert(dynamic_cast<OOX::Logic::CParagraphProperty*>(oox_unknown));
}break;
case OOX::et_w_hyperlink:
{
OOX::Logic::CHyperlink* pH= dynamic_cast<OOX::Logic::CHyperlink*>(oox_unknown);
convert(pH);
convert(dynamic_cast<OOX::Logic::CHyperlink*>(oox_unknown));
}break;
case OOX::et_w_rPr:
{
OOX::Logic::CRunProperty* pRProp= dynamic_cast<OOX::Logic::CRunProperty*>(oox_unknown);
convert(pRProp);
convert(dynamic_cast<OOX::Logic::CRunProperty*>(oox_unknown));
}break;
case OOX::et_mc_alternateContent:
{
OOX::Logic::CAlternateContent* pAltCont= dynamic_cast<OOX::Logic::CAlternateContent*>(oox_unknown);
convert(pAltCont);
convert(dynamic_cast<OOX::Logic::CAlternateContent*>(oox_unknown));
}break;
case OOX::et_w_drawing:
{
OOX::Logic::CDrawing* pDrawing= dynamic_cast<OOX::Logic::CDrawing*>(oox_unknown);
convert(pDrawing);
convert(dynamic_cast<OOX::Logic::CDrawing*>(oox_unknown));
}break;
//case OOX::et_c_chart:
//{
// PPTX::Logic::ChartRec* pChart = dynamic_cast<PPTX::Logic::ChartRec*>(oox_unknown);
// convert(pChart);
//}break;
//case OOX::et_w_Shape:
//{
// OOX::Logic::CShape* pShape = dynamic_cast<OOX::Logic::CShape*>(oox_unknown);
// convert(pShape);
//}break;
case OOX::et_w_pict:
{
OOX::Logic::CPicture* pPic = dynamic_cast<OOX::Logic::CPicture*>(oox_unknown);
convert(pPic);
convert(dynamic_cast<OOX::Logic::CPicture*>(oox_unknown));
}break;
case OOX::et_w_object:
{
OOX::Logic::CObject* pObj = dynamic_cast<OOX::Logic::CObject*>(oox_unknown);
convert(pObj);
convert(dynamic_cast<OOX::Logic::CObject*>(oox_unknown));
}break;
case OOX::et_pic_pic:
case OOX::et_pic:
case OOX::et_p_pic:
{
PPTX::Logic::Pic* pPic = dynamic_cast<PPTX::Logic::Pic*>(oox_unknown);
convert(pPic);
convert(dynamic_cast<PPTX::Logic::Pic*>(oox_unknown));
}break;
case OOX::et_w_GroupShape:
case OOX::et_p_ShapeTree:
{
PPTX::Logic::SpTree* pGroupShape= dynamic_cast<PPTX::Logic::SpTree*>(oox_unknown);
convert(pGroupShape);
convert(dynamic_cast<PPTX::Logic::SpTree*>(oox_unknown));
}break;
case OOX::et_w_commentRangeEnd:
{
OOX::Logic::CCommentRangeEnd* pCommEnd = dynamic_cast<OOX::Logic::CCommentRangeEnd*>(oox_unknown);
convert(pCommEnd);
convert(dynamic_cast<OOX::Logic::CCommentRangeEnd*>(oox_unknown));
}break;
case OOX::et_w_commentRangeStart:
{
OOX::Logic::CCommentRangeStart* pCommStart = dynamic_cast<OOX::Logic::CCommentRangeStart*>(oox_unknown);
convert(pCommStart);
convert(dynamic_cast<OOX::Logic::CCommentRangeStart*>(oox_unknown));
}break;
case OOX::et_w_commentReference:
{
convert(dynamic_cast<OOX::Logic::CCommentReference*>(oox_unknown)); //если нет Start - означает начало с предыдущего Run
convert(dynamic_cast<OOX::Logic::CCommentReference*>(oox_unknown));
//если нет Start - означает начало с предыдущего Run
}break;
case OOX::et_w_footnoteReference:
{
......@@ -386,13 +358,11 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown)
}break;
case OOX::et_w_tr:
{
OOX::Logic::CTr* pRow= dynamic_cast<OOX::Logic::CTr*>(oox_unknown);
convert(pRow);
convert(dynamic_cast<OOX::Logic::CTr*>(oox_unknown));
}break;
case OOX::et_w_tc:
{
OOX::Logic::CTc* pCell= dynamic_cast<OOX::Logic::CTc*>(oox_unknown);
convert(pCell);
convert(dynamic_cast<OOX::Logic::CTc*>(oox_unknown));
}break;
case OOX::et_w_bookmarkStart:
{
......
......@@ -42,6 +42,16 @@
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Timing/Seq.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Timing/CTn.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/EmptyTransition.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/OrientationTransition.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/EightDirectionTransition.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/OptionalBlackTransition.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/SideDirectionTransition.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/CornerDirectionTransition.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/WheelTransition.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/SplitTransition.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/ZoomTransition.h"
#include <boost/lexical_cast.hpp>
#include "../OdfFormat/odp_conversion_context.h"
......@@ -365,13 +375,18 @@ void PptxConverter::convert_slides()
convert_slide(&slide->Layout->cSld, current_txStyles, true, bShowLayoutMasterSp, 3);
if (slide->Layout->transition.IsInit()) convert (slide->Layout->transition.GetPointer());
else convert (slide->Master->transition.GetPointer());
if (slide->Layout->timing.IsInit()) convert (slide->Layout->timing.GetPointer());
else convert (slide->Master->timing.GetPointer());
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();
m_mapMasters.insert(std::make_pair(master_name, master_style_name));
......@@ -490,6 +505,24 @@ void PptxConverter::convert(OOX::WritingElement *oox_unknown)
switch(oox_unknown->getType())
{
case OOX::et_p_EmptyTransition:
convert(dynamic_cast<PPTX::Logic::EmptyTransition*>(oox_unknown)); break;
case OOX::et_p_OrientationTransition:
convert(dynamic_cast<PPTX::Logic::OrientationTransition*>(oox_unknown)); break;
case OOX::et_p_EightDirectionTransition:
convert(dynamic_cast<PPTX::Logic::EightDirectionTransition*>(oox_unknown)); break;
case OOX::et_p_OptionalBlackTransition:
convert(dynamic_cast<PPTX::Logic::OptionalBlackTransition*>(oox_unknown)); break;
case OOX::et_p_CornerDirectionTransition:
convert(dynamic_cast<PPTX::Logic::CornerDirectionTransition*>(oox_unknown)); break;
case OOX::et_p_SideDirectionTransition:
convert(dynamic_cast<PPTX::Logic::SideDirectionTransition*>(oox_unknown)); break;
case OOX::et_p_WheelTransition:
convert(dynamic_cast<PPTX::Logic::WheelTransition*>(oox_unknown)); break;
case OOX::et_p_SplitTransition:
convert(dynamic_cast<PPTX::Logic::SplitTransition*>(oox_unknown)); break;
case OOX::et_p_ZoomTransition:
convert(dynamic_cast<PPTX::Logic::ZoomTransition*>(oox_unknown)); break;
default:
{
OoxConverter::convert(oox_unknown);
......@@ -542,8 +575,7 @@ void PptxConverter::convert( PPTX::Logic::Transition *oox_transition )
if (oox_transition->dur.is_init())
odp_context->current_slide().set_transition_duration(*oox_transition->dur);
odp_context->current_slide().set_transition_type(5);
//convert(oox_transition->base.operator->());
convert(oox_transition->base.base.operator->());
//if (oox_transition->sndAc.is_init() && oox_transition->sndAc->stSnd.is_init())
//{
......@@ -591,6 +623,127 @@ void PptxConverter::convert(PPTX::Logic::TimeNodeBase *oox_time_base)
odp_context->current_slide().end_timing_seq();
}
}
void PptxConverter::convert(PPTX::Logic::EmptyTransition *oox_transition)
{
if (!oox_transition) return;
if (oox_transition->name == L"random")
odp_context->current_slide().set_transition_type(40);
if (oox_transition->name == L"circle")
odp_context->current_slide().set_transition_type(16);
if (oox_transition->name == L"dissolve")
odp_context->current_slide().set_transition_type(39);
if (oox_transition->name == L"diamond")
{
odp_context->current_slide().set_transition_type(11);
odp_context->current_slide().set_transition_subtype(L"diamond");
}
if (oox_transition->name == L"newsflash")
odp_context->current_slide().set_transition_type(5);
if (oox_transition->name == L"plus")
odp_context->current_slide().set_transition_type(2);//??
if (oox_transition->name == L"wedge")
odp_context->current_slide().set_transition_type(24);
}
void PptxConverter::convert(PPTX::Logic::OrientationTransition *oox_transition)
{
if (!oox_transition) return;
if (oox_transition->name == L"blinds")
odp_context->current_slide().set_transition_type(38);
if (oox_transition->name == L"checker")
odp_context->current_slide().set_transition_type(37);
if (oox_transition->name == L"comb")
{
odp_context->current_slide().set_transition_type(34);
if (oox_transition->dir.IsInit())
{
if (oox_transition->dir->get() == L"horz")
odp_context->current_slide().set_transition_subtype(L"combHorizontal");
if (oox_transition->dir->get() == L"vert")
odp_context->current_slide().set_transition_subtype(L"combVertical");
}
}
if (oox_transition->name == L"randomBar")
odp_context->current_slide().set_transition_type(40);
}
void PptxConverter::convert(PPTX::Logic::EightDirectionTransition *oox_transition)
{
if (!oox_transition) return;
if (oox_transition->name == L"cover")
odp_context->current_slide().set_transition_type(1);
if (oox_transition->name == L"pull")
odp_context->current_slide().set_transition_type(35);
}
void PptxConverter::convert(PPTX::Logic::OptionalBlackTransition *oox_transition)
{
if (!oox_transition) return;
if (oox_transition->name == L"cut")
odp_context->current_slide().set_transition_type(36);
if (oox_transition->name == L"fade")
odp_context->current_slide().set_transition_type(36);
}
void PptxConverter::convert(PPTX::Logic::SideDirectionTransition *oox_transition)
{
if (!oox_transition) return;
std::wstring dir;
if (oox_transition->dir.IsInit()) dir = oox_transition->dir->get();
if (oox_transition->name == L"push")
{
odp_context->current_slide().set_transition_type(34);
if (dir == L"d") odp_context->current_slide().set_transition_subtype(L"fromTop");
if (dir == L"l") odp_context->current_slide().set_transition_subtype(L"fromRight");
if (dir == L"r") odp_context->current_slide().set_transition_subtype(L"fromLeft");
if (dir == L"u") odp_context->current_slide().set_transition_subtype(L"fromBottom");
}
if (oox_transition->name == L"wipe")
odp_context->current_slide().set_transition_type(0);
}
void PptxConverter::convert(PPTX::Logic::CornerDirectionTransition *oox_transition)
{
if (!oox_transition) return;
//name == strips
odp_context->current_slide().set_transition_type(4);
if (oox_transition->dir.IsInit())
{
if (oox_transition->dir->get() == L"rd") odp_context->current_slide().set_transition_subtype(L"horizontalLeft");
if (oox_transition->dir->get() == L"lu") odp_context->current_slide().set_transition_subtype(L"horizontalRight");
if (oox_transition->dir->get() == L"ld") odp_context->current_slide().set_transition_subtype(L"verticalRight");
}
}
void PptxConverter::convert(PPTX::Logic::WheelTransition *oox_transition)
{
if (!oox_transition) return;
//name == wheel
odp_context->current_slide().set_transition_type(21);
switch (oox_transition->spokes.get_value_or(0))
{
case 1: odp_context->current_slide().set_transition_subtype(L"oneBlade"); break;
case 3: odp_context->current_slide().set_transition_subtype(L"threeBlade"); break;
case 4: odp_context->current_slide().set_transition_subtype(L"fourBlade"); break;
case 8: odp_context->current_slide().set_transition_subtype(L"eightBlade"); break;
}
}
void PptxConverter::convert(PPTX::Logic::SplitTransition *oox_transition)
{
if (!oox_transition) return;
//name == split
odp_context->current_slide().set_transition_type(8);
}
void PptxConverter::convert(PPTX::Logic::ZoomTransition *oox_transition)
{
if (!oox_transition) return;
//name == zoom
odp_context->current_slide().set_transition_type(11);
}
void PptxConverter::convert(PPTX::Logic::CTn *oox_time_common)
{
if (!oox_time_common) return;
......
......@@ -69,7 +69,15 @@ namespace PPTX
class TxStyles;
class TimeNodeBase;
class CTn;
class EmptyTransition;
class OrientationTransition;
class EightDirectionTransition;
class OptionalBlackTransition;
class CornerDirectionTransition;
class SideDirectionTransition;
class WheelTransition;
class SplitTransition;
class ZoomTransition;
}
}
......@@ -136,6 +144,16 @@ namespace Oox2Odf
void convert(PPTX::Logic::Ln *oox_ln_border, std::wstring & odf_border);
private:
void convert(PPTX::Logic::EmptyTransition *oox_transition);
void convert(PPTX::Logic::OrientationTransition *oox_transition);
void convert(PPTX::Logic::EightDirectionTransition *oox_transition);
void convert(PPTX::Logic::OptionalBlackTransition *oox_transition);
void convert(PPTX::Logic::CornerDirectionTransition *oox_transition);
void convert(PPTX::Logic::SideDirectionTransition *oox_transition);
void convert(PPTX::Logic::WheelTransition *oox_transition);
void convert(PPTX::Logic::SplitTransition *oox_transition);
void convert(PPTX::Logic::ZoomTransition *oox_transition);
PPTX::Folder *pptx_document;
PPTX::Presentation *presentation;
cpdoccore::odf_writer::package::odf_document *output_document;
......
......@@ -45,7 +45,11 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(CornerDirectionTransition)
public:
virtual OOX::EElementType getType() const
{
return OOX::et_p_CornerDirectionTransition;
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
name = XmlUtils::GetNameNoNS(node.GetName());
......@@ -61,8 +65,8 @@ namespace PPTX
}
public:
std::wstring name;
nullable_limit<Limit::CornerDirectionVal> dir;
std::wstring name;
nullable_limit<Limit::CornerDirectionVal> dir;
protected:
virtual void FillParentPointersForChilds(){};
};
......
......@@ -45,7 +45,11 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(EightDirectionTransition)
public:
virtual OOX::EElementType getType() const
{
return OOX::et_p_EightDirectionTransition;
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
name = XmlUtils::GetNameNoNS(node.GetName());
......@@ -60,8 +64,7 @@ namespace PPTX
return XmlUtils::CreateNode(_T("p:") + name, oAttr);
}
public:
std::wstring name;
std::wstring name;
nullable_limit<Limit::EightDirectionVal> dir;
protected:
virtual void FillParentPointersForChilds(){};
......
......@@ -44,7 +44,11 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(EmptyTransition)
public:
virtual OOX::EElementType getType() const
{
return OOX::et_p_EmptyTransition;
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
name = XmlUtils::GetNameNoNS(node.GetName());
......@@ -55,7 +59,6 @@ namespace PPTX
return _T("<p:") + name + _T("/>");
}
public:
std::wstring name;
protected:
virtual void FillParentPointersForChilds(){};
......
......@@ -44,10 +44,14 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(OptionalBlackTransition)
public:
virtual OOX::EElementType getType() const
{
return OOX::et_p_OptionalBlackTransition;
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
name = XmlUtils::GetNameNoNS(node.GetName());
name = XmlUtils::GetNameNoNS(node.GetName());
node.ReadAttributeBase(L"thruBlk", thruBlk);
}
......@@ -59,9 +63,9 @@ namespace PPTX
return XmlUtils::CreateNode(_T("p:") + name, oAttr);
}
public:
std::wstring name;
nullable_bool thruBlk;
std::wstring name;
nullable_bool thruBlk;
protected:
virtual void FillParentPointersForChilds(){};
};
......
......@@ -45,7 +45,11 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(OrientationTransition)
public:
virtual OOX::EElementType getType() const
{
return OOX::et_p_OrientationTransition;
}
void fromXML(XmlUtils::CXmlNode& node)
{
name = XmlUtils::GetNameNoNS(node.GetName());
......@@ -60,9 +64,8 @@ namespace PPTX
return XmlUtils::CreateNode(_T("p:") + name, oAttr);
}
public:
std::wstring name;
nullable_limit<Limit::Orient> dir;
std::wstring name;
nullable_limit<Limit::Orient> dir;
protected:
virtual void FillParentPointersForChilds(){};
};
......
......@@ -45,7 +45,11 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(SideDirectionTransition)
public:
virtual OOX::EElementType getType() const
{
return OOX::et_p_SideDirectionTransition;
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
name = XmlUtils::GetNameNoNS(node.GetName());
......@@ -60,8 +64,7 @@ namespace PPTX
return XmlUtils::CreateNode(_T("p:") + name, oAttr);
}
public:
std::wstring name;
std::wstring name;
nullable_limit<Limit::SideDirectionVal> dir;
protected:
virtual void FillParentPointersForChilds(){};
......
......@@ -46,7 +46,11 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(SplitTransition)
public:
virtual OOX::EElementType getType() const
{
return OOX::et_p_SplitTransition;
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
node.ReadAttributeBase(L"dir", dir);
......@@ -62,7 +66,6 @@ namespace PPTX
return XmlUtils::CreateNode(_T("p:split"), oAttr);
}
public:
nullable_limit<Limit::InOutDirectionVal> dir;
nullable_limit<Limit::Orient> orient;
protected:
......
......@@ -44,7 +44,11 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(WheelTransition)
public:
virtual OOX::EElementType getType() const
{
return OOX::et_p_WheelTransition;
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
node.ReadAttributeBase(L"spokes", spokes);
......@@ -58,7 +62,6 @@ namespace PPTX
return XmlUtils::CreateNode(_T("p:wheel"), oAttr);
}
public:
nullable_int spokes;
protected:
virtual void FillParentPointersForChilds(){};
......
......@@ -45,7 +45,11 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(ZoomTransition)
public:
virtual OOX::EElementType getType() const
{
return OOX::et_p_ZoomTransition;
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
node.ReadAttributeBase(L"dir", dir);
......@@ -59,8 +63,7 @@ namespace PPTX
return XmlUtils::CreateNode(_T("p:zoom"), oAttr);
}
public:
nullable_limit<Limit::InOutDirectionVal> dir;
nullable_limit<Limit::InOutDirectionVal> dir;
protected:
virtual void FillParentPointersForChilds(){};
};
......
......@@ -375,6 +375,16 @@ namespace OOX
et_p_fld,
et_p_br,
et_p_MathPara,
et_p_EmptyTransition,
et_p_OrientationTransition,
et_p_EightDirectionTransition,
et_p_OptionalBlackTransition,
et_p_CornerDirectionTransition,
et_p_SideDirectionTransition,
et_p_WheelTransition,
et_p_SplitTransition,
et_p_ZoomTransition,
et_a_textFit,
et_a_hyperlink,
......
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