diff options
author | Mayank Gupta <techfreakworm@gmail.com> | 2016-03-30 11:47:01 +0530 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-06-09 09:54:55 +0000 |
commit | 248c5ea771255b54e64394458a321ccf829bbd02 (patch) | |
tree | 62e1a344fe05e5bde6e0119a7395d10c8d64a7d1 | |
parent | a97b392879c96145701b2454b26dc0c4f6aa4bb2 (diff) |
Slideshow: Add 'Oval' Shape Transition variant
Change-Id: Ibc3d617d3bb94bdd0702bb4d60ce5fbe2eea8e24
Reviewed-on: https://gerrit.libreoffice.org/23661
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu | 33 | ||||
-rw-r--r-- | oox/source/ppt/slidetransition.cxx | 11 | ||||
-rw-r--r-- | oox/source/ppt/slidetransitioncontext.cxx | 7 | ||||
-rw-r--r-- | sd/qa/unit/data/AllTransitions.odp | bin | 13757 -> 15719 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 3 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptbase.cxx | 11 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptooxml.cxx | 6 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptanimations.hxx | 2 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 12 | ||||
-rw-r--r-- | sd/xml/effects.xml | 16 | ||||
-rw-r--r-- | sd/xml/transitions.xml | 6 | ||||
-rw-r--r-- | slideshow/source/engine/transitions/ellipsewipe.cxx | 25 | ||||
-rw-r--r-- | slideshow/source/engine/transitions/ellipsewipe.hxx | 4 | ||||
-rw-r--r-- | slideshow/source/engine/transitions/transitionfactorytab.cxx | 2 |
14 files changed, 127 insertions, 11 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu index 765a0d51d3c9..23824c1fd56a 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu @@ -50,6 +50,11 @@ <value xml:lang="en-US">Circle</value> </prop> </node> + <node oor:name="ooo-entrance-oval" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Oval Vertical</value> + </prop> + </node> <node oor:name="ooo-entrance-fly-in-slow" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Fly in Slow</value> @@ -1728,6 +1733,16 @@ <value xml:lang="en-US">Circle</value> </prop> </node> + <node oor:name="oval-horizontal" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Oval Horizontal</value> + </prop> + </node> + <node oor:name="oval-vertical" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Oval Vertical</value> + </prop> + </node> <node oor:name="diamond" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Diamond</value> @@ -2051,6 +2066,22 @@ <value>circle</value> </prop> </node> + <node oor:name="shape-oval-horizontal" oor:op="replace"> + <prop oor:name="Set" oor:type="xs:string"> + <value>shape</value> + </prop> + <prop oor:name="Variant" oor:type="xs:string"> + <value>oval-horizontal</value> + </prop> + </node> + <node oor:name="shape-oval-vertical" oor:op="replace"> + <prop oor:name="Set" oor:type="xs:string"> + <value>shape</value> + </prop> + <prop oor:name="Variant" oor:type="xs:string"> + <value>oval-vertical</value> + </prop> + </node> <node oor:name="shape-diamond" oor:op="replace"> <prop oor:name="Set" oor:type="xs:string"> <value>shape</value> @@ -2383,7 +2414,7 @@ <value xml:lang="en-US">Basic</value> </prop> <prop oor:name="Effects" oor:type="oor:string-list"> - <value oor:separator=";">ooo-entrance-appear;ooo-entrance-fly-in;ooo-entrance-venetian-blinds;ooo-entrance-box;ooo-entrance-checkerboard;ooo-entrance-circle;ooo-entrance-fly-in-slow;ooo-entrance-diamond;ooo-entrance-dissolve-in;ooo-entrance-flash-once;ooo-entrance-peek-in;ooo-entrance-plus;ooo-entrance-random-bars;ooo-entrance-split;ooo-entrance-diagonal-squares;ooo-entrance-wedge;ooo-entrance-wheel;ooo-entrance-wipe;ooo-entrance-random</value> + <value oor:separator=";">ooo-entrance-appear;ooo-entrance-fly-in;ooo-entrance-venetian-blinds;ooo-entrance-box;ooo-entrance-checkerboard;ooo-entrance-circle;ooo-entrance-oval;ooo-entrance-fly-in-slow;ooo-entrance-diamond;ooo-entrance-dissolve-in;ooo-entrance-flash-once;ooo-entrance-peek-in;ooo-entrance-plus;ooo-entrance-random-bars;ooo-entrance-split;ooo-entrance-diagonal-squares;ooo-entrance-wedge;ooo-entrance-wheel;ooo-entrance-wipe;ooo-entrance-random</value> </prop> </node> <node oor:name="special" oor:op="replace"> diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx index 9ae715fa49c0..49e24cf679b3 100644 --- a/oox/source/ppt/slidetransition.cxx +++ b/oox/source/ppt/slidetransition.cxx @@ -371,6 +371,17 @@ namespace oox { namespace ppt { mnTransitionType = TransitionType::ELLIPSEWIPE; mnTransitionSubType = TransitionSubType::CIRCLE; break; + case PPT_TOKEN( oval ): + mnTransitionType = TransitionType::ELLIPSEWIPE; + if( ooxToOdpDirection( param1 ) == TransitionSubType::VERTICAL ) + { + mnTransitionSubType = TransitionSubType::VERTICAL; + } + else + { + mnTransitionSubType = TransitionSubType::HORIZONTAL; + } + break; case PPT_TOKEN( diamond ): mnTransitionType = TransitionType::IRISWIPE; mnTransitionSubType = TransitionSubType::DIAMOND; diff --git a/oox/source/ppt/slidetransitioncontext.cxx b/oox/source/ppt/slidetransitioncontext.cxx index 9b29653e98e6..957d02569c2a 100644 --- a/oox/source/ppt/slidetransitioncontext.cxx +++ b/oox/source/ppt/slidetransitioncontext.cxx @@ -125,6 +125,13 @@ SlideTransitionContext::~SlideTransitionContext() throw() } return this; case PPT_TOKEN( circle ): + case PPT_TOKEN( oval ) : + if (!mbHasTransition) + { + mbHasTransition = true; + maTransition.setOoxTransitionType( aElementToken, rAttribs.getToken( XML_dir, XML_vert), 0); + } + return this; case PPT_TOKEN( diamond ): case PPT_TOKEN( dissolve ): case PPT_TOKEN( newsflash ): diff --git a/sd/qa/unit/data/AllTransitions.odp b/sd/qa/unit/data/AllTransitions.odp Binary files differindex dfb8d2ace8e6..8922a0756d4b 100644 --- a/sd/qa/unit/data/AllTransitions.odp +++ b/sd/qa/unit/data/AllTransitions.odp diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 150e0b524fc0..e56219176a01 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -1502,6 +1502,9 @@ void SdExportTest::testExportTransitionsPPTX() // NEWSFLASH CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 74, TransitionType::ZOOM, TransitionSubType::ROTATEIN)); + //OVAL VERTICAL + CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 76, TransitionType::ELLIPSEWIPE, TransitionSubType::VERTICAL)); + xDocShRef->DoClose(); } diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx index 7bd4b658cc3d..8775200c5bcf 100644 --- a/sd/source/filter/eppt/pptx-epptbase.cxx +++ b/sd/source/filter/eppt/pptx-epptbase.cxx @@ -798,7 +798,16 @@ sal_Int8 PPTWriterBase::GetTransition( sal_Int16 nTransitionType, sal_Int16 nTra break; case TransitionType::ELLIPSEWIPE : { - nPPTTransitionType = PPT_TRANSITION_TYPE_CIRCLE; + switch( nTransitionSubtype ) { + case TransitionSubType::VERTICAL: + nPPTTransitionType = PPT_TRANSITION_TYPE_OVAL_VERTICAL; + break; + case TransitionSubType::HORIZONTAL: + nPPTTransitionType = PPT_TRANSITION_TYPE_OVAL_HORIZONTAL; + break; + default: + nPPTTransitionType = PPT_TRANSITION_TYPE_CIRCLE; + } } break; case TransitionType::FOURBOXWIPE : diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 32f717196b83..46c06ccc5654 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -696,6 +696,12 @@ void PowerPointExport::WriteTransition( const FSHelperPtr& pFS ) case PPT_TRANSITION_TYPE_CIRCLE: nTransition = XML_circle; break; + case PPT_TRANSITION_TYPE_OVAL_VERTICAL: + nTransition = XML_oval; + break; + case PPT_TRANSITION_TYPE_OVAL_HORIZONTAL: + nTransition = XML_oval; + break; case PPT_TRANSITION_TYPE_COMB: nTransition = XML_comb; pDirection = (nDirection == 1) ? "vert" : "horz"; diff --git a/sd/source/filter/ppt/pptanimations.hxx b/sd/source/filter/ppt/pptanimations.hxx index 599af58b01d7..534f7b61a8e4 100644 --- a/sd/source/filter/ppt/pptanimations.hxx +++ b/sd/source/filter/ppt/pptanimations.hxx @@ -60,6 +60,8 @@ namespace ppt #define PPT_TRANSITION_TYPE_SMOOTHFADE 23 // Alpha Fade in MS-PPT Specs #define PPT_TRANSITION_TYPE_WHEEL 26 #define PPT_TRANSITION_TYPE_CIRCLE 27 +#define PPT_TRANSITION_TYPE_OVAL_HORIZONTAL 28 +#define PPT_TRANSITION_TYPE_OVAL_VERTICAL 29 // atoms #define DFF_msofbtAnimEvent 0xf125 diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index a8f38b4b5ced..2955b715901f 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -1720,6 +1720,18 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations pPage->setTransitionSubtype( animations::TransitionSubType::CIRCLE ); } break; + case PPT_TRANSITION_TYPE_OVAL_VERTICAL : + { + pPage->setTransitionType( animations::TransitionType::ELLIPSEWIPE ); + pPage->setTransitionSubtype( animations::TransitionSubType::VERTICAL ); + } + break; + case PPT_TRANSITION_TYPE_OVAL_HORIZONTAL : + { + pPage->setTransitionType( animations::TransitionType::ELLIPSEWIPE ); + pPage->setTransitionSubtype( animations::TransitionSubType::HORIZONTAL ); + } + break; case PPT_TRANSITION_TYPE_WEDGE : { pPage->setTransitionType( animations::TransitionType::FANWIPE ); diff --git a/sd/xml/effects.xml b/sd/xml/effects.xml index bef5e0580b94..b7789383ed27 100644 --- a/sd/xml/effects.xml +++ b/sd/xml/effects.xml @@ -91,6 +91,22 @@ </anim:par> <anim:par smil:begin="indefinite" smil:fill="hold"> <anim:par smil:begin="0" smil:fill="hold"> + <anim:par pres:preset-property="Direction" smil:begin="0" smil:fill="hold" pres:node-type="on-click" pres:preset-class="entrance" pres:preset-id="ooo-entrance-oval" pres:preset-sub-type="in"> + <anim:set smil:begin="0" smil:dur="0.001" smil:fill="hold" smil:attributeName="visibility" smil:to="visible"/> + <anim:transitionFilter smil:dur="2" smil:type="ellipseWipe" smil:subtype="vertical" smil:direction="reverse"/> + </anim:par> + </anim:par> + </anim:par> + <anim:par smil:begin="indefinite" smil:fill="hold"> + <anim:par smil:begin="0" smil:fill="hold"> + <anim:par pres:preset-property="Direction" smil:begin="0" smil:fill="hold" pres:node-type="on-click" pres:preset-class="entrance" pres:preset-id="ooo-entrance-oval" pres:preset-sub-type="out"> + <anim:set smil:begin="0" smil:dur="0.001" smil:fill="hold" smil:attributeName="visibility" smil:to="visible"/> + <anim:transitionFilter smil:dur="2" smil:type="ellipseWipe" smil:subtype="vertical"/> + </anim:par> + </anim:par> + </anim:par> + <anim:par smil:begin="indefinite" smil:fill="hold"> + <anim:par smil:begin="0" smil:fill="hold"> <anim:par pres:preset-property="Direction" smil:begin="0" smil:fill="hold" pres:node-type="on-click" pres:preset-class="entrance" pres:preset-id="ooo-entrance-fly-in-slow" pres:preset-sub-type="from-bottom"> <anim:set smil:begin="0" smil:dur="0.001" smil:fill="hold" smil:attributeName="visibility" smil:to="visible"/> <anim:animate smil:dur="5" smil:fill="hold" smil:attributeName="x" smil:values="x;x" smil:keyTimes="0;1"/> diff --git a/sd/xml/transitions.xml b/sd/xml/transitions.xml index 8b96d7959e0e..cefcab31cf36 100644 --- a/sd/xml/transitions.xml +++ b/sd/xml/transitions.xml @@ -107,6 +107,12 @@ <anim:par pres:preset-id="shape-circle"> <anim:transitionFilter smil:type="ellipseWipe" smil:subtype="circle"/> </anim:par> + <anim:par pres:preset-id="shape-oval-horizontal"> + <anim:transitionFilter smil:type="ellipseWipe" smil:subtype="horizontal"/> + </anim:par> + <anim:par pres:preset-id="shape-oval-vertical"> + <anim:transitionFilter smil:type="ellipseWipe" smil:subtype="vertical"/> + </anim:par> <!-- <anim:par pres:preset-id="circle-in"> --> <!-- <anim:transitionFilter smil:type="ellipseWipe" smil:subtype="circle" smil:direction="reverse"/> --> <!-- </anim:par> --> diff --git a/slideshow/source/engine/transitions/ellipsewipe.cxx b/slideshow/source/engine/transitions/ellipsewipe.cxx index 35aa9ec69a99..c3dd9ccb8aaa 100644 --- a/slideshow/source/engine/transitions/ellipsewipe.cxx +++ b/slideshow/source/engine/transitions/ellipsewipe.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - +#include <com/sun/star/animations/TransitionSubType.hpp> #include <basegfx/numeric/ftools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include "ellipsewipe.hxx" @@ -29,12 +29,23 @@ namespace internal { ::basegfx::B2DPolyPolygon EllipseWipe::operator () ( double t ) { - // currently only circle: - ::basegfx::B2DPolygon poly( - ::basegfx::tools::createPolygonFromCircle( - ::basegfx::B2DPoint( 0.5, 0.5 ), - ::basegfx::pruneScaleValue( t * M_SQRT2 / 2.0 ) ) ); - return ::basegfx::B2DPolyPolygon( poly ); + ::basegfx::B2DPoint rCenter(0.5,0.5); + double fRadius = ::basegfx::pruneScaleValue( t * M_SQRT2 / 2.0 ); + + if( mnSubType == com::sun::star::animations::TransitionSubType::VERTICAL ) + { + //oval : + ::basegfx::B2DPolygon poly ( + ::basegfx::tools::createPolygonFromEllipse( rCenter, fRadius*2, fRadius ) ); //Horizontal Ellipse is rotated by 90 degress + return ::basegfx::B2DPolyPolygon( poly ); + } + else + { + // circle: + ::basegfx::B2DPolygon poly( + ::basegfx::tools::createPolygonFromCircle( rCenter, fRadius ) ); + return ::basegfx::B2DPolyPolygon( poly ); + } } } diff --git a/slideshow/source/engine/transitions/ellipsewipe.hxx b/slideshow/source/engine/transitions/ellipsewipe.hxx index d710cba27794..c8d991b509f8 100644 --- a/slideshow/source/engine/transitions/ellipsewipe.hxx +++ b/slideshow/source/engine/transitions/ellipsewipe.hxx @@ -30,8 +30,10 @@ namespace internal { class EllipseWipe : public ParametricPolyPolygon { public: - explicit EllipseWipe( sal_Int32 /*nTransitionSubType xxx todo */ ) {} + explicit EllipseWipe( sal_Int32 nSubType ): mnSubType( nSubType ) {} virtual ::basegfx::B2DPolyPolygon operator () ( double x ) override; +private: + sal_Int32 mnSubType; }; } diff --git a/slideshow/source/engine/transitions/transitionfactorytab.cxx b/slideshow/source/engine/transitions/transitionfactorytab.cxx index 8f10a551d219..021c3592ab61 100644 --- a/slideshow/source/engine/transitions/transitionfactorytab.cxx +++ b/slideshow/source/engine/transitions/transitionfactorytab.cxx @@ -699,7 +699,7 @@ static const TransitionInfo lcl_transitionInfo[] = 1.0, // no scaling TransitionInfo::REVERSEMETHOD_SUBTRACT_AND_INVERT, true, // 'out' by parameter sweep inversion - false // scale isotrophically to target size + true // scale isotrophically to target size }, |