Skip to content

Commit

Permalink
Remove aTransitionSubtypeOutMap and aTransitionTypeOutMap
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rohanKanojia authored and mcecchetti committed Jan 23, 2017
1 parent c010fe8 commit 3067256
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions filter/source/svg/presentation_engine.js
Expand Up @@ -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' )
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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() )
Expand Down Expand Up @@ -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() )
Expand Down Expand Up @@ -15022,6 +15021,7 @@ ElapsedTime.prototype.getElapsedTimeImpl = function()
};



/*****
* @libreofficeend
*
Expand Down

0 comments on commit 3067256

Please sign in to comment.