diff options
author | Rohan Kumar <rohankanojia420@gmail.com> | 2017-01-12 02:44:12 +0530 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2017-01-23 17:15:24 +0000 |
commit | 30672569d5576e86ea47e92c8bcb40416ebadd7c (patch) | |
tree | 02c43d4595833cd7d036c1881ecb91c1a4c259e8 /filter/source/svg/presentation_engine.js | |
parent | c010fe8e5eb781899d77ac18ce6c2c4b74f6fcfd (diff) |
Remove aTransitionSubtypeOutMap and aTransitionTypeOutMap
reverse mapping can be done at run time
Change-Id: Id04688ffb62cfa494d0eeaf6b73feb5ade58d53c
Reviewed-on: https://gerrit.libreoffice.org/32903
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'filter/source/svg/presentation_engine.js')
-rw-r--r-- | filter/source/svg/presentation_engine.js | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index df69b1414395..14017ab31593 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -1886,6 +1886,20 @@ function Rectangle( aSVGRectElem ) this.bottom = y + height; } +/* + * Returns key corresponding to a value in object, null otherwise. + * + * @param Object + * @param value + */ +function getKeyByValue(aObj, value) { + for(var key in aObj) { + if(aObj[key] == value) + return key; + } + return null; +} + function log( message ) { if( typeof console == 'object' ) @@ -5164,14 +5178,9 @@ aTransitionTypeInMap = { 'irisWipe' : IRISWIPE_TRANSITION }; -aTransitionTypeOutMap = [ '', 'barWipe', 'boxWipe', 'fourBoxWipe', 'ellipseWipe', - 'clockWipe', 'pinWheelWipe', 'pushWipe', 'slideWipe', - 'fade', 'randomBarWipe', 'checkerBoardWipe', 'dissolve' , 'irisWipe']; - - /* * All Transition subtypes should be in sync with aTransitionSubtypeInMap: - * Comments '//' followed by integers represent the transition values in their + * Comments '//' followed by integers represent the transition values in their * C++ implementations. */ // Transition Subtypes @@ -5256,16 +5265,6 @@ aTransitionSubtypeInMap = { 'leftCenter' : LEFTCENTER_TRANS_SUBTYPE }; -aTransitionSubtypeOutMap = [ 'default', 'leftToRight', 'topToBottom', 'cornersIn', - 'cornersOut', 'vertical', 'horizontal', 'down', 'circle', - 'clockwiseTwelve', 'clockwiseThree', 'clockwiseSix', - 'clockwiseNine', 'twoBladeVertical', 'twoBladeHorizontal', - 'fourBlade', 'fromLeft', 'fromTop', 'fromRight', - 'fromBottom', 'crossfade', 'fadeToColor', 'fadeFromColor', - 'fadeOverColor', 'threeBlade', 'eightBlade', 'oneBlade', - 'across', 'rectangle', 'diamond']; - - // Transition Modes TRANSITION_MODE_IN = 1; TRANSITION_MODE_OUT = 0; @@ -8246,10 +8245,10 @@ AnimationTransitionFilterNode.prototype.info = function( bVerbose ) if( bVerbose ) { // transition type - sInfo += '; type: ' + aTransitionTypeOutMap[ String( this.getTransitionType() ) ]; + sInfo += '; type: ' + getKeyByValue(aTransitionTypeInMap, this.getTransitionType()); // transition subtype - sInfo += '; subtype: ' + aTransitionSubtypeOutMap[ this.getTransitionSubType() ]; + sInfo += '; subtype: ' + getKeyByValue(aTransitionSubtypeInMap, this.getTransitionSubType()); // transition direction if( this.getReverseDirection() ) @@ -11090,10 +11089,10 @@ SlideTransition.prototype.info = function() var sInfo ='slide transition <' + this.sSlideId + '>: '; // transition type - sInfo += '; type: ' + aTransitionTypeOutMap[ String( this.getTransitionType() ) ]; + sInfo += '; type: ' + getKeyByValue(aTransitionTypeInMap, this.getTransitionType()); // transition subtype - sInfo += '; subtype: ' + aTransitionSubtypeOutMap[ this.getTransitionSubType() ]; + sInfo += '; subtype: ' + getKeyByValue(aTransitionSubtypeInMap, this.getTransitionSubType()); // transition direction if( !this.isDirectionForward() ) @@ -15022,6 +15021,7 @@ ElapsedTime.prototype.getElapsedTimeImpl = function() }; + /***** * @libreofficeend * |