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>
This commit is contained in:
Rohan Kumar 2017-01-12 02:44:12 +05:30 committed by Marco Cecchetti
parent c010fe8e5e
commit 30672569d5

View File

@ -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
*