filter/source/svg/presentation_engine.js | 852 ++++++++++++++------- filter/source/svg/svgexport.cxx | 598 +++++++------- filter/source/svg/svgfilter.cxx | 4 filter/source/svg/svgfilter.hxx | 20 filter/source/svg/svgwriter.cxx | 4 filter/source/svg/svgwriter.hxx | 5 filter/source/xsltdialog/xmlfiltertabpagebasic.cxx | 4 filter/source/xsltdialog/xmlfiltertabpagebasic.hxx | 2 filter/source/xsltdialog/xmlfiltertabpagexslt.cxx | 4 filter/source/xsltdialog/xmlfiltertabpagexslt.hxx | 2 framework/inc/dispatch/interceptionhelper.hxx | 4 framework/source/dispatch/interceptionhelper.cxx | 43 - sd/qa/unit/SVGExportTests.cxx | 18 13 files changed, 925 insertions(+), 635 deletions(-)
New commits: commit 187b7cd5c729b5ea7b08be5cedddf8830f066ceb Author: Thorsten Behrens <thorsten.behr...@cib.de> Date: Fri May 20 16:48:00 2016 +0200 framework: last dispatchInterceptor gets asked first Align implementation with API contract as spelled out in offapi/com/sun/star/frame/XDispatchProviderInterception.idl - no idea why this change happenend in 2003: Date: Fri Apr 4 16:16:05 2003 +0000 INTEGRATION: CWS fwk01 (1.1.72); FILE MERGED 2003/04/01 12:40:09 as 1.1.72.1: #107642# change order of used interception objects At any rate, with this change extensions actually get a chance to see dispatch requests first, and process/ignore at will. Change-Id: I58876150ee6d67e592f41b3e82a9ffc314e091a3 Reviewed-on: https://gerrit.libreoffice.org/25215 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> (cherry picked from commit 08cf2fd01064306eef7fdbb5b62320947c4d1089) diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index 2a5be00..affce9a 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -136,20 +136,19 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css: // b) OK - there is at least one interceptor already registered. // It's slave and it's master must be valid references ... - // because we created it. But we have to look for the static bool which - // regulate direction of using of interceptor objects! + // because we created it. - // insert it behind any other existing interceptor - means at the end of our list. + // insert it before any other existing interceptor - means at the beginning of our list. else { - css::uno::Reference< css::frame::XDispatchProvider > xMasterD = m_lInterceptionRegs.rbegin()->xInterceptor; - css::uno::Reference< css::frame::XDispatchProviderInterceptor > xMasterI (xMasterD, css::uno::UNO_QUERY); + css::uno::Reference< css::frame::XDispatchProvider > xSlaveD = m_lInterceptionRegs.begin()->xInterceptor; + css::uno::Reference< css::frame::XDispatchProviderInterceptor > xSlaveI (xSlaveD , css::uno::UNO_QUERY); - xInterceptor->setMasterDispatchProvider(xMasterD ); - xInterceptor->setSlaveDispatchProvider (m_xSlave ); - xMasterI->setSlaveDispatchProvider (aInfo.xInterceptor); + xInterceptor->setMasterDispatchProvider(xThis ); + xInterceptor->setSlaveDispatchProvider (xSlaveD ); + xSlaveI->setMasterDispatchProvider (aInfo.xInterceptor); - m_lInterceptionRegs.push_back(aInfo); + m_lInterceptionRegs.push_front(aInfo); } css::uno::Reference< css::frame::XFrame > xOwner(m_xOwnerWeak.get(), css::uno::UNO_QUERY); commit 01499f93930c13e3f605b5c484cd5dcf3c1122bb Author: Thorsten Behrens <thorsten.behr...@cib.de> Date: Wed Mar 2 15:28:36 2016 +0100 framework: avoid excessive queryDispatch calls Make better use of the css::frame::XInterceptorInfo interface, to avoid calling queryDispatch() pointlessly on interfaces that have explicitely opted out. Since that already broadcasts which urls we're interested in - so just don't bother calling entries who are not matching. Change-Id: Id5e780568fd60c38f4cee4ee800d747d65a31dae Reviewed-on: https://gerrit.libreoffice.org/25214 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> (cherry picked from commit 27b6cdb5ab5af33dbba561923c8db81e144c88b9) diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index ad746bb..2a5be00 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -52,16 +52,23 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD xInterceptor = pIt->xInterceptor; // b) No match by registration - but a valid interceptor list. - // Use first interceptor everytimes. - // Note: it doesn't matter, which direction this helper implementation use to ask interceptor objects. - // Using of member m_aInterceptorList will starts at the beginning everytimes. - // It depends from the filling operation, in which direction it works really! + // Find first interceptor w/o pattern, so we need to query it if (!xInterceptor.is() && m_lInterceptionRegs.size()>0) { - pIt = m_lInterceptionRegs.begin(); - xInterceptor = pIt->xInterceptor; + InterceptorList::const_iterator pIt2; + for (pIt2=m_lInterceptionRegs.begin(); pIt2!=m_lInterceptionRegs.end(); ++pIt2) + { + if (!pIt2->lURLPattern.getLength()) + { + // no pattern -> need to ask this guy! + xInterceptor = pIt2->xInterceptor; + break; + } + } + // if we didn't find any non-pattern interceptor, there's no-one + // registered for this command url (we already searched for matching + // patterns above) } - // c) No registered interceptor => use our direct slave. // This helper exist by design and must be valid everytimes ... // But to be more feature proof - we should check that .-) commit b9ccd55f86706cbbc6e527e35c374338b309c83b Author: shubhamtibra <shubh.ti...@gmail.com> Date: Sat Jan 16 21:50:24 2016 +0530 tdf#96949 Remove global static variable m_bPreferrFirstInterceptor and unused code Remove global static variable "m_bPreferrFirstInterceptor" which is always true, and remove the ifs where it is false. Change-Id: I54dcea7a6010c825a66020ec3f7448bb32d120b8 Reviewed-on: https://gerrit.libreoffice.org/21519 Reviewed-by: jan iversen <j...@documentfoundation.org> Tested-by: jan iversen <j...@documentfoundation.org> (cherry picked from commit 5d4f1f6f630d4382679087a4fb0da364c9c9692b) diff --git a/framework/inc/dispatch/interceptionhelper.hxx b/framework/inc/dispatch/interceptionhelper.hxx index 3db9b6d..090b981 100644 --- a/framework/inc/dispatch/interceptionhelper.hxx +++ b/framework/inc/dispatch/interceptionhelper.hxx @@ -142,10 +142,6 @@ class InterceptionHelper : public ::cppu::WeakImplHelper< /** @short contains all registered interceptor objects. */ InterceptorList m_lInterceptionRegs; - /** @short it regulates, which interceptor is used first. - The last or the first registered one. */ - static bool m_bPreferrFirstInterceptor; - // native interface public: diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index ad707f3..ad746bb 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -25,8 +25,6 @@ namespace framework{ -bool InterceptionHelper::m_bPreferrFirstInterceptor = true; - InterceptionHelper::InterceptionHelper(const css::uno::Reference< css::frame::XFrame >& xOwner, const css::uno::Reference< css::frame::XDispatchProvider >& xSlave) : m_xOwnerWeak (xOwner ) @@ -134,9 +132,8 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css: // because we created it. But we have to look for the static bool which // regulate direction of using of interceptor objects! - // b1) If "m_bPreferrFirstInterceptor" is set to true, we have to // insert it behind any other existing interceptor - means at the end of our list. - else if (m_bPreferrFirstInterceptor) + else { css::uno::Reference< css::frame::XDispatchProvider > xMasterD = m_lInterceptionRegs.rbegin()->xInterceptor; css::uno::Reference< css::frame::XDispatchProviderInterceptor > xMasterI (xMasterD, css::uno::UNO_QUERY); @@ -148,20 +145,6 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css: m_lInterceptionRegs.push_back(aInfo); } - // b2) If "m_bPreferrFirstInterceptor" is set to false, we have to - // insert it before any other existing interceptor - means at the beginning of our list. - else - { - css::uno::Reference< css::frame::XDispatchProvider > xSlaveD = m_lInterceptionRegs.begin()->xInterceptor; - css::uno::Reference< css::frame::XDispatchProviderInterceptor > xSlaveI (xSlaveD , css::uno::UNO_QUERY); - - xInterceptor->setMasterDispatchProvider(xThis ); - xInterceptor->setSlaveDispatchProvider (xSlaveD ); - xSlaveI->setMasterDispatchProvider (aInfo.xInterceptor); - - m_lInterceptionRegs.push_front(aInfo); - } - css::uno::Reference< css::frame::XFrame > xOwner(m_xOwnerWeak.get(), css::uno::UNO_QUERY); aWriteLock.clear(); commit 623dab207449a60eb6b260d655c70e1138a64780 Author: Andras Timar <andras.ti...@collabora.com> Date: Fri May 20 22:28:55 2016 +0200 bccu#1800 fix bogus loops in slide animations and transitions Change-Id: Ia0ba0921c3ebfbfbd66fddf81e43fec480f6d5bb diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index ea5774a..c9222f5 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -13381,7 +13381,7 @@ function ElapsedTime( aTimeBase ) { this.aTimeBase = aTimeBase; this.nLastQueriedTime = 0.0; - this.nStartTime = this.getSystemTime(); + this.nStartTime = this.getCurrentTime(); this.nFrozenTime = 0.0; this.bInPauseMode = false; this.bInHoldMode = false; @@ -13396,7 +13396,7 @@ ElapsedTime.prototype.getTimeBase = function() ElapsedTime.prototype.reset = function() { this.nLastQueriedTime = 0.0; - this.nStartTime = this.getSystemTime(); + this.nStartTime = this.getCurrentTime(); this.nFrozenTime = 0.0; this.bInPauseMode = false; this.bInHoldMode = false; commit 70424bfdd6451cfdb3d73b0986e78e9980eba1d6 Author: Henry Castro <hcas...@collabora.com> Date: Tue May 3 19:21:26 2016 -0400 filter: svg: avoid undefined variables Change-Id: Ibc3b678decfb36f5ac5779edb43aef1657507df2 Reviewed-on: https://gerrit.libreoffice.org/24627 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Jan Holesovsky <ke...@collabora.com> diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index 4432ddf..ea5774a 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -68,7 +68,6 @@ * @source http://code.google.com/p/jessyink/ */ - /** Convenience function to get an element depending on whether it has a * property with a particular name. * @@ -3652,6 +3651,9 @@ SVGPathElement.prototype.changeOrientation = function() * Note: Opera doesn't have any SVGPathSeg* class and rises an error. * We exploit this fact for providing a different implementation. */ + +var SVGPathSeg = typeof SVGPathSeg === 'undefined' ? function() {} : SVGPathSeg; + try { // Firefox, Google Chrome, Internet Explorer, Safari. @@ -13379,7 +13381,7 @@ function ElapsedTime( aTimeBase ) { this.aTimeBase = aTimeBase; this.nLastQueriedTime = 0.0; - this.nStartTime = this.getCurrentTime(); + this.nStartTime = this.getSystemTime(); this.nFrozenTime = 0.0; this.bInPauseMode = false; this.bInHoldMode = false; @@ -13394,7 +13396,7 @@ ElapsedTime.prototype.getTimeBase = function() ElapsedTime.prototype.reset = function() { this.nLastQueriedTime = 0.0; - this.nStartTime = this.getCurrentTime(); + this.nStartTime = this.getSystemTime(); this.nFrozenTime = 0.0; this.bInPauseMode = false; this.bInHoldMode = false; commit 4863be61b8fbcde076f1085b03a129b34f3ea77f Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Wed Jan 27 23:32:05 2016 +0100 svg export - skip/rewind slide transition The following actions messed up the animation engine if they were performed while a slide transition was running: - rewind/skip currect playing effect (Left/Right key) - rewind last/skip next effect (Up/Down key) - rewind/skip all effect (PgUp/PgDown key) - jump to first/last slide (Home/End key) Now: - Left/Up/PgUp key: rewind slide transition - Right/Down key: skip slide transition - PgDown key: skip slide transition and all new slide effects - Home key: skip slide transition and jump to first slide - End key: skip slide transition and jump to last slide Moreover the parsing of transition node properties missed to report some type of not supported transitions which caused the animation engine to hung. Change-Id: I7018b8e8fb3041a95cc80e250431b6544c875e98 Reviewed-on: https://gerrit.libreoffice.org/21855 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcek...@gmail.com> diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index d2afe9c..4432ddf 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -9740,6 +9740,7 @@ SlideTransition.prototype.createSlideTransition = function( aLeavingSlide, aEnte SlideTransition.prototype.parseElement = function() { + this.bIsValid = true; var aAnimElem = this.aElement; // type attribute @@ -9751,6 +9752,7 @@ SlideTransition.prototype.parseElement = function() } else { + this.bIsValid = false; log( 'SlideTransition.parseElement: transition type not valid: ' + sTypeAttr ); } @@ -9762,13 +9764,19 @@ SlideTransition.prototype.parseElement = function() if( sSubTypeAttr && ( aTransitionSubtypeInMap[ sSubTypeAttr ] !== undefined ) ) { this.eTransitionSubType = aTransitionSubtypeInMap[ sSubTypeAttr ]; - this.bIsValid = true; } else { + this.bIsValid = false; log( 'SlideTransition.parseElement: transition subtype not valid: ' + sSubTypeAttr ); } + if( this.bIsValid && aTransitionInfoTable[this.eTransitionType][this.eTransitionSubType] === undefined ) + { + this.bIsValid = false; + log( 'SlideTransition.parseElement: transition not valid: type: ' + sTypeAttr + ' subtype: ' + sSubTypeAttr ); + } + // direction attribute this.bReverseDirection = false; var sDirectionAttr = aAnimElem.getAttributeNS( NSS['smil'], 'direction' ); @@ -12271,6 +12279,7 @@ function SlideShow() this.bIsIdle = true; this.bIsEnabled = true; this.bNoSlideTransition = false; + this.bIsTransitionRunning = false; this.nCurrentEffect = 0; this.bIsNextEffectRunning = false; @@ -12357,6 +12366,11 @@ SlideShow.prototype.isRunning = function() return !this.bIsIdle; }; +SlideShow.prototype.isTransitionPlaying = function() +{ + return this.bIsTransitionRunning; +}; + SlideShow.prototype.isMainEffectPlaying = function() { return this.bIsNextEffectRunning; @@ -12438,6 +12452,17 @@ SlideShow.prototype.notifyTransitionEnd = function( nSlideIndex ) theMetaDoc.getCurrentSlide().slideElement.setAttribute('clip-path', sRef); } + this.bIsTransitionRunning = false; + if( this.bIsRewinding ) + { + theMetaDoc.aMetaSlideSet[nSlideIndex].hide(); + var nIndex = nCurSlide !== undefined ? nCurSlide : -1; + this.displaySlide( nIndex, true ); + this.skipAllEffects(); + this.bIsRewinding = false; + return; + } + theMetaDoc.setCurrentSlide(nSlideIndex); if( this.aSlideViewElement ) @@ -12486,6 +12511,12 @@ SlideShow.prototype.nextEffect = function() if( !this.isEnabled() ) return false; + if( this.isTransitionPlaying() ) + { + this.skipTransition(); + return true; + } + if( this.isAnyEffectPlaying() ) { this.skipAllPlayingEffects(); @@ -12506,6 +12537,23 @@ SlideShow.prototype.nextEffect = function() return true; }; +/** skipTransition + * Skip the current playing slide transition. + */ +SlideShow.prototype.skipTransition = function() +{ + if( this.bIsSkipping || this.bIsRewinding ) + return; + + this.bIsSkipping = true; + + this.aActivityQueue.endAll(); + this.aTimerEventQueue.forceEmpty(); + this.aActivityQueue.endAll(); + this.update(); + this.bIsSkipping = false; +}; + /** skipAllPlayingEffects * Skip all playing effect, independently to which animation sequence they * belong. @@ -12576,6 +12624,12 @@ SlideShow.prototype.skipNextEffect = function() */ SlideShow.prototype.skipPlayingOrNextEffect = function() { + if( this.isTransitionPlaying() ) + { + this.skipTransition(); + return true; + } + if( this.isAnyEffectPlaying() ) return this.skipAllPlayingEffects(); else @@ -12598,6 +12652,11 @@ SlideShow.prototype.skipAllEffects = function() this.bIsSkippingAll = true; + if( this.isTransitionPlaying() ) + { + this.skipTransition(); + } + if( this.isAnyEffectPlaying() ) { this.skipAllPlayingEffects(); @@ -12623,6 +12682,20 @@ SlideShow.prototype.skipAllEffects = function() return true; }; +/** rewindTransition + * Rewind the current playing slide transition. + */ +SlideShow.prototype.rewindTransition = function() +{ + if( this.bIsSkipping || this.bIsRewinding ) + return; + + this.bIsRewinding = true; + this.aActivityQueue.endAll(); + this.update(); + this.bIsRewinding = false; +}; + /** rewindEffect * Rewind all the effects started after at least one of the current playing * effects. If there is no playing effect, it rewinds the last played one, @@ -12732,6 +12805,11 @@ SlideShow.prototype.rewindEffect = function() */ SlideShow.prototype.rewindToPreviousSlide = function() { + if( this.isTransitionPlaying() ) + { + this.rewindTransition(); + return; + } if( this.isAnyEffectPlaying() ) return; var nNewSlide = nCurSlide - 1; @@ -12772,6 +12850,11 @@ SlideShow.prototype.displaySlide = function( nNewSlide, bSkipSlideTransition ) return; } + if( this.isTransitionPlaying() ) + { + this.skipTransition(); + } + // handle current slide var nOldSlide = nCurSlide; if( nOldSlide !== undefined ) @@ -12842,6 +12925,7 @@ SlideShow.prototype.displaySlide = function( nNewSlide, bSkipSlideTransition ) if( aTransitionActivity ) { + this.bIsTransitionRunning = true; this.aActivityQueue.addActivity( aTransitionActivity ); this.update(); } commit 259a095613154ef90df28e7e2b63948f6f2aadab Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Fri Jan 15 11:28:28 2016 +0100 svg export: fall back to crossfade for not supported transitions If we do not support the requested transition type we fall back to crossfade transition. If we do not provide an alternative transition and we set the state of the animation node to 'invalid' the animation engine stops itself. Change-Id: Ie476dd579248e9d776e27797dca2ea867f3e5e54 Reviewed-on: https://gerrit.libreoffice.org/21490 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcek...@gmail.com> diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index 09bf196..d2afe9c 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -7024,6 +7024,7 @@ AnimationTransitionFilterNode.prototype.createActivity = function() AnimationTransitionFilterNode.prototype.parseElement = function() { var bRet = AnimationTransitionFilterNode.superclass.parseElement.call( this ); + var bIsValidTransition = true; var aAnimElem = this.aElement; @@ -7036,7 +7037,7 @@ AnimationTransitionFilterNode.prototype.parseElement = function() } else { - this.eCurrentState = INVALID_NODE; + bIsValidTransition = false; log( 'AnimationTransitionFilterNode.parseElement: transition type not valid: ' + sTypeAttr ); } @@ -7051,10 +7052,20 @@ AnimationTransitionFilterNode.prototype.parseElement = function() } else { - this.eCurrentState = INVALID_NODE; + bIsValidTransition = false; log( 'AnimationTransitionFilterNode.parseElement: transition subtype not valid: ' + sSubTypeAttr ); } + // if we do not support the requested transition type we fall back to crossfade transition; + // note: if we do not provide an alternative transition and we set the state of the animation node to 'invalid' + // the animation engine stops itself; + if( !bIsValidTransition ) + { + this.eTransitionType = FADE_TRANSITION; + this.eTransitionSubType = CROSSFADE_TRANS_SUBTYPE; + log( 'AnimationTransitionFilterNode.parseElement: in place of the invalid transition a crossfade transition is used' ); + } + // direction attribute this.bReverseDirection = false; var sDirectionAttr = aAnimElem.getAttributeNS( NSS['smil'], 'direction' ); commit 9ed54cfa299aa8c82ec130b325ee0555c5a7078e Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Wed Jan 13 17:27:56 2016 +0100 svg export: simultaneous move and zoom issue - fixed Simultaneaous move and zoom of shapes did not work properly. Fixed. Change-Id: I445733c5ad3734966f6f5c08a5e5c798852cf74e Reviewed-on: https://gerrit.libreoffice.org/21448 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcek...@gmail.com> diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index 46946a0..09bf196 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -8788,7 +8788,6 @@ AnimatedElement.prototype.initElement = function() this.nCenterY = this.nBaseCenterY; this.nScaleFactorX = 1.0; this.nScaleFactorY = 1.0; - this.setCTM(); // add a transform attribute of type matrix this.aActiveElement.setAttribute( 'transform', makeMatrixString( 1, 0, 0, 1, 0, 0 ) ); @@ -9077,117 +9076,82 @@ AnimatedElement.prototype.getHeight = function() return this.nScaleFactorY * this.getBaseBBox().height; }; -AnimatedElement.prototype.setCTM = function() -{ - - this.aICTM.e = this.getBaseCenterX(); - this.aICTM.f = this.getBaseCenterY(); - - this.aCTM.e = -this.aICTM.e; - this.aCTM.f = -this.aICTM.f; -}; - AnimatedElement.prototype.updateTransformAttribute = function() { + //this.aActiveElement.setAttribute( 'transform', matrixToString( this.aTMatrix ) ); this.aTransformAttrList = this.aActiveElement.transform.baseVal; this.aTransformAttr = this.aTransformAttrList.getItem( 0 ); this.aTransformAttr.setMatrix( this.aTMatrix ); }; -AnimatedElement.prototype.setX = function( nXNewPos ) +AnimatedElement.prototype.setX = function( nNewCenterX ) { + if( nNewCenterX === this.nCenterX ) return; + this.aTransformAttrList = this.aActiveElement.transform.baseVal; this.aTransformAttr = this.aTransformAttrList.getItem( 0 ); - this.aTransformAttr.matrix.e += ( nXNewPos - this.getX() ); - this.nCenterX = nXNewPos; + this.aTMatrix = this.aTransformAttr.matrix.translate( nNewCenterX - this.nCenterX, 0 ); + this.aTransformAttr.setMatrix( this.aTMatrix ); + this.nCenterX = nNewCenterX; }; -AnimatedElement.prototype.setY = function( nYNewPos ) +AnimatedElement.prototype.setY = function( nNewCenterY ) { + if( nNewCenterY === this.nCenterY ) return; + this.aTransformAttrList = this.aActiveElement.transform.baseVal; this.aTransformAttr = this.aTransformAttrList.getItem( 0 ); - this.aTransformAttr.matrix.f += ( nYNewPos - this.getY() ); - this.nCenterY = nYNewPos; + this.aTMatrix = this.aTransformAttr.matrix.translate( 0, nNewCenterY - this.nCenterY ); + this.aTransformAttr.setMatrix( this.aTMatrix ); + this.nCenterY = nNewCenterY; }; AnimatedElement.prototype.setWidth = function( nNewWidth ) { - var nBaseWidth = this.getBaseBBox().width; - if( nBaseWidth <= 0 ) - return; - - this.nScaleFactorX = nNewWidth / nBaseWidth; - this.implScale(); -}; - -AnimatedElement.prototype.setHeight = function( nNewHeight ) -{ - var nBaseHeight = this.getBaseBBox().height; - if( nBaseHeight <= 0 ) - return; - - this.nScaleFactorY = nNewHeight / nBaseHeight; - this.implScale(); -}; - -AnimatedElement.prototype.implScale = function( ) -{ - this.aTMatrix = document.documentElement.createSVGMatrix(); - this.aTMatrix.a = this.nScaleFactorX; - this.aTMatrix.d = this.nScaleFactorY; - this.aTMatrix = this.aICTM.multiply( this.aTMatrix.multiply( this.aCTM ) ); - - var nDeltaX = this.getX() - this.getBaseCenterX(); - var nDeltaY = this.getY() - this.getBaseCenterY(); - this.aTMatrix = this.aTMatrix.translate( nDeltaX, nDeltaY ); - this.updateTransformAttribute(); -}; - -AnimatedElement.prototype.setWidth2 = function( nNewWidth ) -{ + ANIMDBG.print( 'AnimatedElement.setWidth: nNewWidth = ' + nNewWidth ); if( nNewWidth < 0 ) - log( 'AnimatedElement(' + this.getId() + ').setWidth: negative width!' ); - if( nNewWidth < 0.001 ) - nNewWidth = 0.001; + { + log('AnimatedElement(' + this.getId() + ').setWidth: negative height!'); + nNewWidth = 0; + } - this.setCTM(); + var nBaseWidth = this.getBaseBBox().width; + var nScaleFactorX = nNewWidth / nBaseWidth; - var nCurWidth = this.getWidth(); - if( nCurWidth <= 0 ) - nCurWidth = 0.001; + if( nScaleFactorX < 1e-5 ) nScaleFactorX = 1e-5; + if( nScaleFactorX == this.nScaleFactorX ) return; - var nScaleFactor = nNewWidth / nCurWidth; - if( nScaleFactor < 1e-5 ) - nScaleFactor = 1e-5; - this.aTMatrix = document.documentElement.createSVGMatrix(); - this.aTMatrix.a = nScaleFactor; - this.aTMatrix = this.aICTM.multiply( this.aTMatrix.multiply( this.aCTM ) ); + this.aTMatrix = document.documentElement.createSVGMatrix() + .translate( this.nCenterX, this.nCenterY ) + .scaleNonUniform( nScaleFactorX, this.nScaleFactorY ) + .translate( -this.nBaseCenterX, -this.nBaseCenterY ); this.updateTransformAttribute(); + + this.nScaleFactorX = nScaleFactorX; }; -AnimatedElement.prototype.setHeight2 = function( nNewHeight ) +AnimatedElement.prototype.setHeight = function( nNewHeight ) { - ANIMDBG.print( 'AnimatedElement.setHeight: nNewHeight = ' + nNewHeight ); + ANIMDBG.print( 'AnimatedElement.setWidth: nNewHeight = ' + nNewHeight ); if( nNewHeight < 0 ) - log( 'AnimatedElement(' + this.getId() + ').setWidth: negative height!' ); - if( nNewHeight < 0.001 ) - nNewHeight = 0.001; + { + log('AnimatedElement(' + this.getId() + ').setWidth: negative height!'); + nNewHeight = 0; + } - this.setCTM(); + var nBaseHeight = this.getBaseBBox().height; + var nScaleFactorY = nNewHeight / nBaseHeight; - var nCurHeight = this.getHeight(); - ANIMDBG.print( 'AnimatedElement.setHeight: nCurHeight = ' + nCurHeight ); - if( nCurHeight <= 0 ) - nCurHeight = 0.001; + if( nScaleFactorY < 1e-5 ) nScaleFactorY = 1e-5; + if( nScaleFactorY == this.nScaleFactorY ) return; - var nScaleFactor = nNewHeight / nCurHeight; - ANIMDBG.print( 'AnimatedElement.setHeight: nScaleFactor = ' + nScaleFactor ); - if( nScaleFactor < 1e-5 ) - nScaleFactor = 1e-5; - this.aTMatrix = document.documentElement.createSVGMatrix(); - this.aTMatrix.d = nScaleFactor; - this.aTMatrix = this.aICTM.multiply( this.aTMatrix.multiply( this.aCTM ) ); + this.aTMatrix = document.documentElement.createSVGMatrix() + .translate( this.nCenterX, this.nCenterY ) + .scaleNonUniform( this.nScaleFactorX, nScaleFactorY ) + .translate( -this.nBaseCenterX, -this.nBaseCenterY ); this.updateTransformAttribute(); + + this.nScaleFactorY = nScaleFactorY; }; AnimatedElement.prototype.getOpacity = function() commit 7f25a862b08b5d9a99b6ede5620bbd12460277a7 Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Wed Jan 13 16:44:51 2016 +0100 svg export: added support for anim:formula attribute Added support for formula attribute used from some effect such as spiral in. Better support for parsing value list. Change-Id: Ibf25482eba359acb279d9b212d7a829b3dc668b6 Reviewed-on: https://gerrit.libreoffice.org/21447 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcek...@gmail.com> diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index 757f4e1..46946a0 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -5986,6 +5986,7 @@ function AnimationBaseNode3( aAnimElem, aParentNode, aNodeContext ) this.aByValue = null; this.aKeyTimes = null; this.aValues = null; + this.aFormula= null; } extend( AnimationBaseNode3, AnimationBaseNode2 ); @@ -6036,6 +6037,9 @@ AnimationBaseNode3.prototype.parseElement = function() this.aValues = []; } + // formula attribute + this.aFormula = aAnimElem.getAttributeNS( NSS['anim'], 'formula' ); + return bRet; }; @@ -6069,6 +6073,11 @@ AnimationBaseNode3.prototype.getValues = function() return this.aValues; }; +AnimationBaseNode3.prototype.getFormula = function() +{ + return this.aFormula; +}; + AnimationBaseNode3.prototype.info = function( bVerbose ) { var sInfo = AnimationBaseNode3.superclass.info.call( this, bVerbose ); @@ -6097,6 +6106,10 @@ AnimationBaseNode3.prototype.info = function( bVerbose ) // values if( this.getKeyTimes().length ) sInfo += '; values: ' + this.getValues().join( ',' ); + + // formula + if( this.getFormula() ) + sInfo += '; formula: ' + this.getFormula(); } return sInfo; @@ -10977,6 +10990,7 @@ function ActivityParamSet() this.nDecelerationFraction = 0.0; this.nSlideWidth = undefined; this.nSlideHeight = undefined; + this.aFormula = null; this.aDiscreteTimes = []; } @@ -11642,6 +11656,7 @@ function FromToByActivityTemplate( BaseType ) // template parameter this.bDynamicStartValue = false; this.nIteration = 0; this.bCumulative = bAccumulate; + this.aFormula = aActivityParamSet.aFormula; //this.initAnimatedElement(); @@ -11651,7 +11666,10 @@ function FromToByActivityTemplate( BaseType ) // template parameter FromToByActivity.prototype.initAnimatedElement = function() { if( this.aAnimation && this.aFrom ) - this.aAnimation.perform( this.aFrom ); + { + var aValue = this.aFormula ? this.aFormula( this.aFrom ) : this.aFrom; + this.aAnimation.perform(aValue); + } }; FromToByActivity.prototype.startAnimation = function() @@ -11790,6 +11808,7 @@ function FromToByActivityTemplate( BaseType ) // template parameter aValue = this.add( this.scale( nRepeatCount, this.aEndValue ), aValue ); } + aValue = this.aFormula ? this.aFormula( aValue ) : aValue; this.aAnimation.perform( aValue ); if( this.bDynamicStartValue ) @@ -11803,10 +11822,9 @@ function FromToByActivityTemplate( BaseType ) // template parameter { if( this.aAnimation ) { - if( this.isAutoReverse() ) - this.aAnimation.perform( this.aStartValue ); - else - this.aAnimation.perform( this.aEndValue ); + var aValue = this.isAutoReverse() ? this.aStartValue : this.aEndValue; + aValue = this.aFormula ? this.aFormula( aValue ) : aValue; + this.aAnimation.perform( aValue ); } }; @@ -11848,6 +11866,7 @@ function ValueListActivityTemplate( BaseType ) // template parameter this.scale = aOperatorSet.scale; this.bCumulative = bAccumulate; this.aLastValue = this.aValueList[ this.aValueList.length - 1 ]; + this.aFormula = aActivityParamSet.aFormula; //this.initAnimatedElement(); } @@ -11867,7 +11886,11 @@ function ValueListActivityTemplate( BaseType ) // template parameter ValueListActivity.prototype.initAnimatedElement = function() { if( this.aAnimation ) - this.aAnimation.perform( this.aValueList[0] ); + { + var aValue = this.aValueList[0]; + aValue = this.aFormula ? this.aFormula( aValue ) : aValue; + this.aAnimation.perform(aValue); + } }; ValueListActivity.prototype.startAnimation = function() @@ -11912,6 +11935,8 @@ function ValueListActivityTemplate( BaseType ) // template parameter aValue = this.add( aValue, this.scale( nRepeatCount, this.aLastValue ) ); //aValue = aValue + nRepeatCount * this.aLastValue; } + + aValue = this.aFormula ? this.aFormula( aValue ) : aValue; this.aAnimation.perform( aValue ); }; @@ -11919,7 +11944,8 @@ function ValueListActivityTemplate( BaseType ) // template parameter { if( this.aAnimation ) { - this.aAnimation.perform( this.aLastValue ); + var aValue = this.aFormula ? this.aFormula( this.aLastValue ) : this.aLastValue; + this.aAnimation.perform( aValue ); } }; @@ -11967,7 +11993,27 @@ function createActivity( aActivityParamSet, aAnimationNode, aAnimation, aInterpo eValueType === STRING_PROPERTY || eValueType === ENUM_PROPERTY ); + if( aAnimationNode.getFormula() ) + { + var sFormula = aAnimationNode.getFormula(); + var reMath = /abs|sqrt|asin|acos|atan|sin|cos|tan|exp|log|min|max/g; + sFormula = sFormula.replace(reMath, 'Math.$&'); + sFormula = sFormula.replace(/pi(?!\w)/g, 'Math.PI'); + sFormula = sFormula.replace(/e(?!\w)/g, 'Math.E'); + sFormula = sFormula.replace(/\$/g, '__PARAM0__'); + + var aAnimatedElement = aAnimationNode.getAnimatedElement(); + var aBBox = aAnimatedElement.getBaseBBox(); + var width = aBBox.width / aActivityParamSet.nSlideWidth; + var height = aBBox.height / aActivityParamSet.nSlideHeight; + var x = ( aBBox.x + aBBox.width / 2 ) / aActivityParamSet.nSlideWidth; + var y = ( aBBox.y + aBBox.height / 2 ) / aActivityParamSet.nSlideHeight; + aActivityParamSet.aFormula = function( __PARAM0__ ) { + + return eval(sFormula); + }; + } aActivityParamSet.aDiscreteTimes = aAnimationNode.getKeyTimes(); @@ -12156,9 +12202,15 @@ function evalValuesAttribute( aValueList, aValueSet, aBBox, nSlideWidth, nSlideH var x = ( aBBox.x + aBBox.width / 2 ) / nSlideWidth; var y = ( aBBox.y + aBBox.height / 2 ) / nSlideHeight; + var reMath = /abs|sqrt|asin|acos|atan|sin|cos|tan|exp|log|min|max/g; + for( var i = 0; i < aValueSet.length; ++i ) { - var aValue = eval( aValueSet[i] ); + var sValue = aValueSet[i]; + sValue = sValue.replace(reMath, 'Math.$&'); + sValue = sValue.replace(/pi(?!\w)/g, 'Math.PI'); + sValue = sValue.replace(/e(?!\w)/g, 'Math.E'); + var aValue = eval( sValue ); aValueList.push( aValue ); } } commit 1126d40117cceb04a0380c34b0e63f3746027741 Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Tue Dec 15 18:52:00 2015 +0100 svg export: presentation engine: source code clean up Change-Id: I83f6d524feb21197ad930180f36224feae565ab0 Reviewed-on: https://gerrit.libreoffice.org/20808 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcek...@gmail.com> diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index 600bc61..757f4e1 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -75,25 +75,25 @@ * @param node element of the document * @param name attribute name * - * @returns an array containing all the elements of the tree with root + * @returns Array array containing all the elements of the tree with root * 'node' that own the property 'name' */ function getElementsByProperty( node, name ) { - var elems = new Array(); + var elements = []; if( node.getAttribute( name ) ) - elems.push( node ); + elements.push( node ); for( var counter = 0; counter < node.childNodes.length; ++counter ) { if( node.childNodes[counter].nodeType == 1 ) { - var subElems = getElementsByProperty( node.childNodes[counter], name ); - elems = elems.concat( subElems ); + var subElements = getElementsByProperty( node.childNodes[counter], name ); + elements = elements.concat( subElements ); } } - return elems; + return elements; } /** Event handler for key press. @@ -141,14 +141,14 @@ function onKeyPress( aEvt ) /** Function to supply the default key code dictionary. * - * @returns default key code dictionary + * @returns Object default key code dictionary */ function getDefaultKeyCodeDictionary() { - var keyCodeDict = new Object(); + var keyCodeDict = {}; - keyCodeDict[SLIDE_MODE] = new Object(); - keyCodeDict[INDEX_MODE] = new Object(); + keyCodeDict[SLIDE_MODE] = {}; + keyCodeDict[INDEX_MODE] = {}; // slide mode keyCodeDict[SLIDE_MODE][LEFT_KEY] @@ -199,14 +199,14 @@ function getDefaultKeyCodeDictionary() /** Function to supply the default char code dictionary. * - * @returns default char code dictionary + * @returns Object char code dictionary */ function getDefaultCharCodeDictionary() { - var charCodeDict = new Object(); + var charCodeDict = {}; - charCodeDict[SLIDE_MODE] = new Object(); - charCodeDict[INDEX_MODE] = new Object(); + charCodeDict[SLIDE_MODE] = {}; + charCodeDict[INDEX_MODE] = {}; // slide mode charCodeDict[SLIDE_MODE]['i'] @@ -390,14 +390,14 @@ function mouseClickHelper( aEvt ) /** Function to supply the default mouse handler dictionary. * - * @returns default mouse handler dictionary + * @returns Object default mouse handler dictionary */ function getDefaultMouseHandlerDictionary() { - var mouseHandlerDict = new Object(); + var mouseHandlerDict = {}; - mouseHandlerDict[SLIDE_MODE] = new Object(); - mouseHandlerDict[INDEX_MODE] = new Object(); + mouseHandlerDict[SLIDE_MODE] = {}; + mouseHandlerDict[INDEX_MODE] = {}; // slide mode mouseHandlerDict[SLIDE_MODE][MOUSE_UP] @@ -548,7 +548,7 @@ function configureDetectionTools() dav = n.appVersion, tv = parseFloat(dav); - has.add('air', dua.indexOf('AdobeAIR') >= 0), + has.add('air', dua.indexOf('AdobeAIR') >= 0); has.add('khtml', dav.indexOf('Konqueror') >= 0 ? tv : undefined); has.add('webkit', parseFloat(dua.split('WebKit/')[1]) || undefined); has.add('chrome', parseFloat(dua.split('Chrome/')[1]) || undefined); @@ -584,7 +584,7 @@ function configureDetectionTools() //Make sure isIE reflects the desired version. //document.documentMode of 5 means quirks mode. //Only switch the value if documentMode's major version - //is different from isIE's major version. + //is different from isIE major version. var mode = document.documentMode; if(mode && mode != 5 && Math.floor(isIE) != mode){ isIE = mode; @@ -720,7 +720,7 @@ function configureDetectionTools() * Several parts of the following code are the result of the porting, * started on August 2011, of the C++ code included in the source * files placed under the folder '/slideshow/source' and - * subfolders. This got later rebased onto the AL2-licensed versions + * sub-folders. This got later rebased onto the AL2-licensed versions * of those files in early 2013. * @source http://cgit.freedesktop.org/libreoffice/core/tree/slideshow/source * @@ -770,7 +770,7 @@ var aFooterClassName = 'Footer'; var aHeaderClassName = 'Header'; // Creating a namespace dictionary. -var NSS = new Object(); +var NSS = {}; NSS['svg']='http://www.w3.org/2000/svg'; NSS['rdf']='http://www.w3.org/1999/02/22-rdf-syntax-ns#'; NSS['xlink']='http://www.w3.org/1999/xlink'; @@ -790,7 +790,7 @@ var MOUSE_DOWN = 2; var MOUSE_MOVE = 3; var MOUSE_WHEEL = 4; -// Keycodes. +// Key-codes. var LEFT_KEY = 37; // cursor left keycode var UP_KEY = 38; // cursor up keycode var RIGHT_KEY = 39; // cursor right keycode @@ -874,7 +874,7 @@ function extend( aSubType, aSuperType ) function instantiate( TemplateClass, BaseType ) { if( !TemplateClass.instanceSet ) - TemplateClass.instanceSet = new Array(); + TemplateClass.instanceSet = []; var nSize = TemplateClass.instanceSet.length; @@ -884,7 +884,7 @@ function instantiate( TemplateClass, BaseType ) return TemplateClass.instanceSet[i].instance; } - TemplateClass.instanceSet[ nSize ] = new Object(); + TemplateClass.instanceSet[ nSize ] = {}; TemplateClass.instanceSet[ nSize ].base = BaseType; TemplateClass.instanceSet[ nSize ].instance = TemplateClass( BaseType ); @@ -985,7 +985,7 @@ function checkElemAndSetAttribute( aElem, sAttrName, aValue ) function getElementsByClassName( aElem, sClassName ) { - var aElementSet = new Array(); + var aElementSet = []; // not all browsers support the 'getElementsByClassName' method if( 'getElementsByClassName' in aElem ) { @@ -1215,16 +1215,16 @@ function MetaDocument() // The collections for handling properties of each slide, svg elements // related to master pages and content and properties of text fields. - this.aMetaSlideSet = new Array(); - this.aMasterPageSet = new Object(); - this.aTextFieldHandlerSet = new Object(); - this.aTextFieldContentProviderSet = new Array(); + this.aMetaSlideSet = []; + this.aMasterPageSet = {}; + this.aTextFieldHandlerSet = {}; + this.aTextFieldContentProviderSet = []; this.aSlideNumberProvider = new SlideNumberProvider( this.nStartSlideNumber + 1, this.sPageNumberingType ); // We create a map with key an id and value the svg element containing // the animations performed on the slide with such an id. this.bIsAnimated = false; - this.aSlideAnimationsMap = new Object(); + this.aSlideAnimationsMap = {}; this.initSlideAnimationsMap(); // We initialize dummy slide - used as leaving slide for transition on the first slide @@ -1386,7 +1386,7 @@ function MetaSlide( sMetaSlideId, aMetaDoc ) this.bIsDateTimeVariable = undefined; // We initialize the objects responsible to provide the content to text field. - this.aTextFieldContentProviderSet = new Object(); + this.aTextFieldContentProviderSet = {}; this.aTextFieldContentProviderSet[aSlideNumberClassName] = this.initSlideNumberFieldContentProvider(); this.aTextFieldContentProviderSet[aDateTimeClassName] = this.initDateTimeFieldContentProvider( aOOOAttrDateTimeField ); this.aTextFieldContentProviderSet[aFooterClassName] = this.initFixedTextFieldContentProvider( aOOOAttrFooterField ); @@ -1471,7 +1471,7 @@ initMasterPage : function() // We initialize aTextFieldHandlerSet[ sMasterPageId ] to an empty // collection. - this.theMetaDoc.aTextFieldHandlerSet[ sMasterPageId ] = new Object(); + this.theMetaDoc.aTextFieldHandlerSet[ sMasterPageId ] = {}; } return this.theMetaDoc.aMasterPageSet[ sMasterPageId ]; }, @@ -1549,7 +1549,7 @@ initFixedTextFieldContentProvider : function( aOOOAttribute ) collectTextShapes : function() { - var aTextShapeSet = new Array(); + var aTextShapeSet = []; var aTextShapeIndexElem = getElementByClassName( document, 'TextShapeIndex' ); if( aTextShapeIndexElem ) { @@ -1588,7 +1588,7 @@ collectTextShapes : function() initHyperlinks : function() { - var aHyperlinkSet = new Object(); + var aHyperlinkSet = {}; var i; for( i = 0; i < this.aTextShapeSet.length; ++i ) { @@ -1655,6 +1655,8 @@ getSlideAnimationsRoot : function() * @param sMasterPageId * A string representing the value of the id attribute of the master page * element to be handled. + * @param aMetaSlide + * A meta slide having as master page the one with the passed id. */ function MasterPage( sMasterPageId, aMetaSlide ) { @@ -1695,7 +1697,7 @@ function MasterPage( sMasterPageId, aMetaSlide ) var nSubGroupId = 1; var sClass; var sId = ''; - this.aBackgroundObjectSubGroupIdList = new Array(); + this.aBackgroundObjectSubGroupIdList = []; var i = 0; for( ; i < aBackgroundObjectList.length; ++i ) { @@ -1735,7 +1737,7 @@ function MasterPage( sMasterPageId, aMetaSlide ) } // We populate the collection of placeholders. - this.aPlaceholderShapeSet = new Object(); + this.aPlaceholderShapeSet = {}; this.initPlaceholderShapes(); } @@ -1978,7 +1980,7 @@ MasterPageView.prototype.createElement = function() // clone and initialize text field elements var aBackgroundObjectSubGroupIdList = this.aMasterPage.aBackgroundObjectSubGroupIdList; - this.aBackgroundSubGroupElementSet = new Array(); + this.aBackgroundSubGroupElementSet = []; var aPlaceholderShapeSet = this.aMasterPage.aPlaceholderShapeSet; var aTextFieldContentProviderSet = this.aMetaSlide.aTextFieldContentProviderSet; // where cloned elements are appended @@ -3069,17 +3071,6 @@ function bind2( aFunction ) return aResultFunction; } -//function concat3( s1, s2, s3 ) -//{ -// log( s1 + s2 + s3 ); -//} -// -//var bound1 = bind2( concat3, 'Qui' ); -//bound1( 'Quo', 'Qua' ); -// -//var bound2 = bind2( concat3, 'Qui', 'Quo' ); -//bound2( 'Qua' ); - function getCurrentSystemTime() { return ( new Date() ).getTime(); @@ -3096,11 +3087,12 @@ function getSlideAnimationsRoot( sSlideId ) * * @param aElement any XML element * - * @returns an array that contains all children elements + * @returns Array + * an array that contains all children elements */ function getElementChildren( aElement ) { - var aChildrenArray = new Array(); + var aChildrenArray = []; var nSize = aElement.childNodes.length; @@ -3119,8 +3111,8 @@ function removeWhiteSpaces( str ) return ''; var re = / */; - var aSplittedString = str.split( re ); - return aSplittedString.join(''); + var aSplitString = str.split( re ); + return aSplitString.join(''); } function clamp( nValue, nMinimum, nMaximum ) @@ -3805,7 +3797,7 @@ function SVGPathMatrixTransform( aPath, aSVGMatrix ) function PriorityQueue( aCompareFunc ) { - this.aSequence = new Array(); + this.aSequence = []; this.aCompareFunc = aCompareFunc; } @@ -3844,7 +3836,7 @@ PriorityQueue.prototype.push = function( aValue ) PriorityQueue.prototype.clear = function() { - this.aSequence = new Array(); + this.aSequence = []; }; PriorityQueue.prototype.pop = function() @@ -4150,7 +4142,7 @@ PINWHEELWIPE_TRANSITION = 6; // 23 PUSHWIPE_TRANSITION = 7; // 35 SLIDEWIPE_TRANSITION = 8; // 36 FADE_TRANSITION = 9; // 37 -RANDOMBARWIPE_TRANSITION = 10 // 38 +RANDOMBARWIPE_TRANSITION = 10; // 38 CHECKERBOARDWIPE_TRANSITION = 11; // 39 DISSOLVE_TRANSITION = 12; // 40 @@ -4182,7 +4174,7 @@ CORNERSIN_TRANS_SUBTYPE = 3; // 11 CORNERSOUT_TRANS_SUBTYPE = 4; VERTICAL_TRANS_SUBTYPE = 5; HORIZONTAL_TRANS_SUBTYPE = 6; // 14 -DOWN_TRANS_SUBTYPE = 7 // 19 +DOWN_TRANS_SUBTYPE = 7; // 19 CIRCLE_TRANS_SUBTYPE = 8; // 27 CLOCKWISETWELVE_TRANS_SUBTYPE = 9; // 33 CLOCKWISETHREE_TRANS_SUBTYPE = 10; @@ -4537,15 +4529,14 @@ aTransitionInfoTable[DISSOLVE_TRANSITION][DEFAULT_TRANS_SUBTYPE] = function createStateTransitionTable() { - var aSTT = {} - var aTable = null; + var aSTT = {}; aSTT[RESTART_MODE_NEVER] = {}; aSTT[RESTART_MODE_WHEN_NOT_ACTIVE] = {}; aSTT[RESTART_MODE_ALWAYS] = {}; // transition table for restart=NEVER, fill=REMOVE - aTable = + var aTable = aSTT[RESTART_MODE_NEVER][FILL_MODE_REMOVE] = {}; aTable[INVALID_NODE] = INVALID_NODE; aTable[UNRESOLVED_NODE] = RESOLVED_NODE | ENDED_NODE; @@ -4610,7 +4601,6 @@ function createStateTransitionTable() aTable[FROZEN_NODE] = RESOLVED_NODE | ACTIVE_NODE | ENDED_NODE; // restart is possible aTable[ENDED_NODE] = RESOLVED_NODE | ACTIVE_NODE | ENDED_NODE; // restart is possible - return aSTT; } @@ -4769,7 +4759,7 @@ Timing.prototype.parse = function() } else { - var aTimingSplit = new Array(); + var aTimingSplit = []; bPositiveOffset = true; if( this.sTimingDescription.indexOf( '+' ) != -1 ) { @@ -5138,7 +5128,7 @@ function BaseNode( aAnimElem, aParentNode, aNodeContext ) this.nStartDelay = aNodeContext.nStartDelay; this.eCurrentState = UNRESOLVED_NODE; this.nCurrentStateTransition = 0; - this.aDeactivatingListenerArray = new Array(); + this.aDeactivatingListenerArray = []; this.aActivationEvent = null; this.aDeactivationEvent = null; @@ -5221,7 +5211,7 @@ BaseNode.prototype.parseElement = function() this.nReapeatCount = 1; else this.nReapeatCount = parseFloat( sRepeatCount ); - if( ( this.nReapeatCount == NaN ) && ( sRepeatCount != 'indefinite' ) ) + if( ( isNaN(this.nReapeatCount) ) && ( sRepeatCount != 'indefinite' ) ) this.nReapeatCount = 1; // accelerate attribute @@ -5229,7 +5219,7 @@ BaseNode.prototype.parseElement = function() var sAccelerateAttr = aAnimElem.getAttributeNS( NSS['smil'], 'accelerate' ); if( sAccelerateAttr ) this.nAccelerate = parseFloat( sAccelerateAttr ); - if( this.nAccelerate == NaN ) + if( isNaN(this.nAccelerate) ) this.nAccelerate = 0.0; // decelerate attribute @@ -5237,7 +5227,7 @@ BaseNode.prototype.parseElement = function() var sDecelerateAttr = aAnimElem.getAttributeNS( NSS['smil'], 'decelerate' ); if( sDecelerateAttr ) this.nDecelerate = parseFloat( sDecelerateAttr ); - if( this.nDecelerate == NaN ) + if( isNaN(this.nDecelerate) ) this.nDecelerate = 0.0; // autoReverse attribute @@ -5430,7 +5420,7 @@ BaseNode.prototype.dispose = function() this.aActivationEvent.dispose(); if( this.aDeactivationEvent ) this.aDeactivationEvent.dispose(); - this.aDeactivatingListenerArray = new Array(); + this.aDeactivatingListenerArray = []; }; BaseNode.prototype.getState = function() @@ -6025,7 +6015,7 @@ AnimationBaseNode3.prototype.parseElement = function() this.aByValue = aAnimElem.getAttributeNS( NSS['smil'], 'by' ); // keyTimes attribute - this.aKeyTimes = new Array(); + this.aKeyTimes = []; var sKeyTimesAttr = aAnimElem.getAttributeNS( NSS['smil'], 'keyTimes' ); sKeyTimesAttr = removeWhiteSpaces( sKeyTimesAttr ); if( sKeyTimesAttr ) @@ -6043,7 +6033,7 @@ AnimationBaseNode3.prototype.parseElement = function() } else { - this.aValues = new Array(); + this.aValues = []; } return bRet; @@ -6121,7 +6111,7 @@ function BaseContainerNode( aAnimElem, aParentNode, aNodeContext ) this.sClassName = 'BaseContainerNode'; this.bIsContainer = true; - this.aChildrenArray = new Array(); + this.aChildrenArray = []; this.nFinishedChildren = 0; this.bDurationIndefinite = false; this.nLeftIterations = 1; @@ -6343,7 +6333,7 @@ BaseContainerNode.prototype.saveStateOfAnimatedElement = function() { this.aChildrenArray[i].saveStateOfAnimatedElement(); } -} +}; BaseContainerNode.prototype.forEachChildNode = function( aFunction, eNodeStateMask ) { @@ -7539,8 +7529,6 @@ function SlideChangeBase(aLeavingSlide, aEnteringSlide) */ SlideChangeBase.prototype.start = function() { - if( this.bIsFinished ) - return; }; /** end @@ -7851,7 +7839,7 @@ extend( ClippedSlideChange, SlideChangeBase ); ClippedSlideChange.prototype.start = function() { ClippedSlideChange.superclass.start.call( this ); - this.aEnteringSlide.notifyUsedAttribute( 'clip-path' );; + this.aEnteringSlide.notifyUsedAttribute( 'clip-path' ); this.performIn( 0 ); this.aEnteringSlide.show(); }; @@ -7932,7 +7920,7 @@ function ClippingFunctor( aParametricPolyPolygon, aTransitionInfo, switch( aTransitionInfo.reverseMethod ) { default: - log( 'ClippingFunctor: unexpected reverse method.' ) + log( 'ClippingFunctor: unexpected reverse method.' ); break; case REVERSEMETHOD_IGNORE: break; @@ -7996,7 +7984,7 @@ ClippingFunctor.aBoundingPath.setAttribute( 'd', 'M -1 -1 L 2 -1 L 2 2 L -1 2 L * The width of the bounding box of the slide/shape to be clipped. * @param nHeight * The height of the bounding box of the slide/shape to be clipped. - * @return {SVGPathElement} + * @return SVGPathElement * A svg <path> element representing the path to be used for the clipping * operation. */ @@ -8147,7 +8135,7 @@ function BarWipePath( nBars /* nBars > 1: blinds effect */ ) * * @param nT * A parameter in [0,1] representing the width of the generated bars. - * @return {SVGPathElement} + * @return SVGPathElement * A svg <path> element representing a multi-bars. */ BarWipePath.prototype.perform = function( nT ) @@ -8376,7 +8364,7 @@ function CheckerBoardWipePath( unitsPerEdge ) * * @param nT * A parameter in [0,1] representing the width of the generated bars. - * @return {SVGPathElement} + * @return SVGPathElement * A svg <path> element representing a multi-bars. */ CheckerBoardWipePath.prototype.perform = function( nT ) @@ -8431,28 +8419,28 @@ function RandomWipePath( nElements, bRandomBars ) this.aClipPath = createEmptyPath(); this.nAlreadyAppendedElements = 0; + var fEdgeLength, nPos, aTransform; + if( bRandomBars ) // random bar wipe { - var fEdgeLength = 1.0 / nElements; - var nPos; + fEdgeLength = 1.0 / nElements; for( nPos = 0; nPos < nElements; ++nPos ) { this.aPositionArray[nPos] = { x: 0.0, y: pruneScaleValue( nPos * fEdgeLength ) } } - var aTransform = SVGIdentityMatrix.scaleNonUniform( 1.0, pruneScaleValue( fEdgeLength ) ); + aTransform = SVGIdentityMatrix.scaleNonUniform( 1.0, pruneScaleValue( fEdgeLength ) ); } else // dissolve wipe { var nSqrtElements = Math.round( Math.sqrt( nElements ) ); - var fEdgeLength = 1.0 / nSqrtElements; - var nPos; + fEdgeLength = 1.0 / nSqrtElements; for( nPos = 0; nPos < nElements; ++nPos ) { this.aPositionArray[nPos] = { x: pruneScaleValue( ( nPos % nSqrtElements ) * fEdgeLength ), y: pruneScaleValue( ( nPos / nSqrtElements ) * fEdgeLength ) } } - var aTransform = SVGIdentityMatrix.scale( pruneScaleValue( fEdgeLength ) ); + aTransform = SVGIdentityMatrix.scale( pruneScaleValue( fEdgeLength ) ); } this.aBasePath.matrixTransform( aTransform ); @@ -8471,7 +8459,7 @@ function RandomWipePath( nElements, bRandomBars ) * * @param nT * A parameter in [0,1] representing the width of the generated bars or squares. - * @return {SVGPathElement} + * @return SVGPathElement * A svg <path> element representing a multi bars or a multi squared cells. */ RandomWipePath.prototype.perform = function( nT ) @@ -8526,7 +8514,7 @@ function AnimatedSlide( aMetaSlide ) this.aSlideElement = this.aMetaSlide.slideElement; this.sSlideId = this.aMetaSlide.slideId; - this.aUsedAttributeSet = new Array(); + this.aUsedAttributeSet = []; this.aClipPathElement = null; this.aClipPathContent = null; @@ -8587,7 +8575,7 @@ AnimatedSlide.prototype.reset = function() var sAttrName = this.aUsedAttributeSet[i]; this.aSlideElement.removeAttribute( sAttrName ); } - this.aUsedAttributeSet = new Array(); + this.aUsedAttributeSet = []; }; /** initClipPath @@ -8769,7 +8757,7 @@ function AnimatedElement( aElement ) this.aClipPathContent = null; this.aPreviousElement = null; - this.aStateSet = new Object(); + this.aStateSet = {}; this.eAdditiveMode = ADDITIVE_MODE_REPLACE; this.bIsUpdated = true; @@ -8923,7 +8911,7 @@ AnimatedElement.prototype.saveState = function( nAnimationNodeId ) ANIMDBG.print( 'AnimatedElement(' + this.getId() + ').saveState(' + nAnimationNodeId +')' ); if( !this.aStateSet[ nAnimationNodeId ] ) { - this.aStateSet[ nAnimationNodeId ] = new Object(); + this.aStateSet[ nAnimationNodeId ] = {}; } var aState = this.aStateSet[ nAnimationNodeId ]; aState.aElement = this.aActiveElement.cloneNode( true ); @@ -9399,12 +9387,12 @@ function AnimatedTextElement( aElement, aEventMultiplexer ) } // In case there are embedded bitmaps we need to clone them - var aBitmapElemSet = new Array(); - var aBitmapCloneSet = new Array(); + var aBitmapElemSet = []; + var aBitmapCloneSet = []; var aBitmapPlaceholderSet = getElementsByClassName( aElement, 'BitmapPlaceholder' ); + var i; if( aBitmapPlaceholderSet ) { - var i; for( i = 0; i < aBitmapPlaceholderSet.length; ++i ) { sId = aBitmapPlaceholderSet[i].getAttribute( 'id' ); @@ -9485,11 +9473,10 @@ function AnimatedTextElement( aElement, aEventMultiplexer ) this.nRunningAnimations = 0; // we collect all hyperlink ids - this.aHyperlinkIdSet = new Array(); + this.aHyperlinkIdSet = []; var aHyperlinkElementSet = getElementsByClassName( this.aParagraphElement, 'UrlField' ); - var i = 0; var sHyperlinkId; - for( ; i < aHyperlinkElementSet.length; ++i ) + for( i = 0; i < aHyperlinkElementSet.length; ++i ) { sHyperlinkId = aHyperlinkElementSet[i].getAttribute( 'id' ); if( sHyperlinkId ) @@ -9498,7 +9485,6 @@ function AnimatedTextElement( aElement, aEventMultiplexer ) log( 'error: AnimatedTextElement constructor: hyperlink element has no id' ); } - AnimatedTextElement.superclass.constructor.call( this, aAnimatableElement, aEventMultiplexer ); } @@ -9908,11 +9894,11 @@ SlideTransition.prototype.info = function() function SlideAnimations( aSlideShowContext ) { this.aContext = new NodeContext( aSlideShowContext ); - this.aAnimationNodeMap = new Object(); - this.aAnimatedElementMap = new Object(); - this.aSourceEventElementMap = new Object(); + this.aAnimationNodeMap = {}; + this.aAnimatedElementMap = {}; + this.aSourceEventElementMap = {}; this.aNextEffectEventArray = new NextEffectEventArray(); - this.aInteractiveAnimationSequenceMap = new Object(); + this.aInteractiveAnimationSequenceMap = {}; this.aEventMultiplexer = new EventMultiplexer( aSlideShowContext.aTimerEventQueue ); this.aRootNode = null; this.bElementsParsed = false; @@ -9990,10 +9976,7 @@ SlideAnimations.prototype.start = function() return false; // resolve root node - if( !this.aRootNode.resolve() ) - return false; - - return true; + return this.aRootNode.resolve(); }; SlideAnimations.prototype.end = function( bLeftEffectsSkipped ) @@ -10187,8 +10170,7 @@ function registerEvent( nNodeId, aTiming, aEvent, aNodeContext ) if( !aInteractiveAnimationSequenceMap[ nNodeId ] ) { - var aInteractiveAnimationSequence = new InteractiveAnimationSequence( nNodeId ); - aInteractiveAnimationSequenceMap[ nNodeId ] = aInteractiveAnimationSequence; + aInteractiveAnimationSequenceMap[ nNodeId ] = new InteractiveAnimationSequence(nNodeId); } var bEventRegistered = false; @@ -10430,7 +10412,6 @@ HyperlinkElement.prototype.handleClick = function( aMouseEvent ) } } - return true; }; @@ -10529,7 +10510,7 @@ function PriorityEntry( aValue, nPriority ) * An instance of type PriorityEntry. * @param aRhsEntry * An instance of type PriorityEntry. - * @return {Integer} + * @return Integer * -1 if the left entry has lower priority of the right entry, * 1 if the left entry has higher priority of the right entry, * 0 if the two entry have the same priority @@ -10557,17 +10538,17 @@ function EventMultiplexer( aTimerEventQueue ) { this.nId = EventMultiplexer.getUniqueId(); this.aTimerEventQueue = aTimerEventQueue; - this.aEventMap = new Object(); - this.aSkipEffectEndHandlerSet = new Array(); + this.aEventMap = {}; + this.aSkipEffectEndHandlerSet = []; this.aMouseClickHandlerSet = new PriorityQueue( PriorityEntry.compare ); this.aSkipEffectEvent = null; this.aRewindCurrentEffectEvent = null; this.aRewindLastEffectEvent = null; - this.aSkipInteractiveEffectEventSet = new Object(); - this.aRewindRunningInteractiveEffectEventSet = new Object(); - this.aRewindEndedInteractiveEffectEventSet = new Object(); - this.aRewindedEffectHandlerSet = new Object(); - this.aElementChangedHandlerSet = new Object(); + this.aSkipInteractiveEffectEventSet = {}; + this.aRewindRunningInteractiveEffectEventSet = {}; + this.aRewindEndedInteractiveEffectEventSet = {}; + this.aRewindedEffectHandlerSet = {}; + this.aElementChangedHandlerSet = {}; } EventMultiplexer.CURR_UNIQUE_ID = 0; @@ -10581,12 +10562,12 @@ EventMultiplexer.getUniqueId = function() EventMultiplexer.prototype.getId = function() { return this.nId; -} +}; EventMultiplexer.prototype.hasRegisteredMouseClickHandlers = function() { return !this.aMouseClickHandlerSet.isEmpty(); -} +}; EventMultiplexer.prototype.registerMouseClickHandler = function( aHandler, nPriority ) { @@ -10611,11 +10592,11 @@ EventMultiplexer.prototype.registerEvent = function( eEventType, aNotifierId, aE this.DBG( 'registerEvent', eEventType, aNotifierId ); if( !this.aEventMap[ eEventType ] ) { - this.aEventMap[ eEventType ] = new Object(); + this.aEventMap[ eEventType ] = {}; } if( !this.aEventMap[ eEventType ][ aNotifierId ] ) { - this.aEventMap[ eEventType ][ aNotifierId ] = new Array(); + this.aEventMap[ eEventType ][ aNotifierId ] = []; } this.aEventMap[ eEventType ][ aNotifierId ].push( aEvent ); }; @@ -10650,7 +10631,7 @@ EventMultiplexer.prototype.notifyNextEffectEndEvent = function() { (this.aSkipEffectEndHandlerSet[i])(); } - this.aSkipEffectEndHandlerSet = new Array(); + this.aSkipEffectEndHandlerSet = []; }; EventMultiplexer.prototype.registerSkipEffectEvent = function( aEvent ) @@ -10750,7 +10731,7 @@ EventMultiplexer.prototype.notifyRewindedEffectEvent = function( aNotifierId ) EventMultiplexer.prototype.registerElementChangedHandler = function( aNotifierId, aHandler ) { this.aElementChangedHandlerSet[ aNotifierId ] = aHandler; -} +}; EventMultiplexer.prototype.notifyElementChangedEvent = function( aNotifierId, aElement ) { @@ -10779,7 +10760,7 @@ EventMultiplexer.prototype.DBG = function( sMethodName, eEventType, aNotifierId, * Interpolator Handler and KeyStopLerp **********************************************************************************************/ -var aInterpolatorHandler = new Object(); +var aInterpolatorHandler = {}; aInterpolatorHandler.getInterpolator = function( eCalcMode, eValueType, eValueSubtype ) { @@ -10801,9 +10782,9 @@ aInterpolatorHandler.getInterpolator = function( eCalcMode, eValueType, eValueSu } }; -aInterpolatorHandler.aLerpFunctorMap = new Array(); -aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_DISCRETE ] = new Array(); -aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ] = new Array(); +aInterpolatorHandler.aLerpFunctorMap = []; +aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_DISCRETE ] = []; +aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ] = []; // interpolators for linear calculation @@ -10814,7 +10795,7 @@ aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ][ NUMBER_PROPERTY ] = return ( ( 1.0 - nT )* nFrom + nT * nTo ); }; -aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ][ COLOR_PROPERTY ] = new Array(); +aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ][ COLOR_PROPERTY ] = []; aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ][ COLOR_PROPERTY ][ COLOR_SPACE_RGB ] = function ( nFrom, nTo, nT ) @@ -10840,7 +10821,7 @@ function KeyStopLerp( aValueList ) { KeyStopLerp.validateInput( aValueList ); - this.aKeyStopList = new Array(); + this.aKeyStopList = []; this.nLastIndex = 0; this.nKeyStopDistance = aValueList[1] - aValueList[0]; if( this.nKeyStopDistance <= 0 ) @@ -10892,7 +10873,7 @@ KeyStopLerp.prototype.lerp = function( nAlpha ) nRawLerp = clamp( nRawLerp, 0.0, 1.0 ); - var aResult = new Object(); + var aResult = {}; aResult.nIndex = this.nLastIndex; aResult.nLerp = nRawLerp; @@ -10921,7 +10902,7 @@ KeyStopLerp.prototype.lerp_ported = function( nAlpha ) nRawLerp = clamp( nRawLerp, 0.0, 1.0 ); - var aResult = new Object(); + var aResult = {}; aResult.nIndex = this.nLastIndex; aResult.nLerp = nRawLerp; @@ -10934,10 +10915,10 @@ KeyStopLerp.prototype.lerp_ported = function( nAlpha ) * Operators **********************************************************************************************/ -var aOperatorSetMap = new Array(); +var aOperatorSetMap = []; // number operators -aOperatorSetMap[ NUMBER_PROPERTY ] = new Object(); +aOperatorSetMap[ NUMBER_PROPERTY ] = {}; aOperatorSetMap[ NUMBER_PROPERTY ].equal = function( a, b ) { @@ -10955,7 +10936,7 @@ aOperatorSetMap[ NUMBER_PROPERTY ].scale = function( k, v ) }; // color operators -aOperatorSetMap[ COLOR_PROPERTY ] = new Object(); +aOperatorSetMap[ COLOR_PROPERTY ] = {}; aOperatorSetMap[ COLOR_PROPERTY ].equal = function( a, b ) { @@ -10996,7 +10977,7 @@ function ActivityParamSet() this.nDecelerationFraction = 0.0; this.nSlideWidth = undefined; this.nSlideHeight = undefined; - this.aDiscreteTimes = new Array(); + this.aDiscreteTimes = []; } @@ -11267,10 +11248,7 @@ ActivityBase.prototype.getTargetElement = function() ActivityBase.prototype.isRepeatCountValid = function() { - if( this.nRepeats ) - return true; - else - return false; + return !!this.nRepeats; // first ! convert to bool }; ActivityBase.prototype.getRepeatCount = function() @@ -12070,7 +12048,7 @@ function createValueListActivity( aActivityParamSet, aAnimationNode, aAnimation, var aValueSet = aAnimationNode.getValues(); - var aValueList = new Array(); + var aValueList = []; extractAttributeValues( eValueType, aValueList, @@ -12099,7 +12077,7 @@ function createFromToByActivity( aActivityParamSet, aAnimationNode, aAnimation, var aOperatorSet = aOperatorSetMap[ eValueType ]; assert( aOperatorSet, 'createFromToByActivity: no operator set found' ); - var aValueSet = new Array(); + var aValueSet = []; aValueSet[0] = aAnimationNode.getFromValue(); aValueSet[1] = aAnimationNode.getToValue(); aValueSet[2] = aAnimationNode.getByValue(); @@ -12109,7 +12087,7 @@ function createFromToByActivity( aActivityParamSet, aAnimationNode, aAnimation, ', aTo = ' + aValueSet[1] + ', aBy = ' + aValueSet[2] ); - var aValueList = new Array(); + var aValueList = []; extractAttributeValues( eValueType, aValueList, @@ -12209,8 +12187,7 @@ function Effect( nId ) { this.nId = ( typeof( nId ) === typeof( 1 ) ) ? nId : -1; this.eState = Effect.NOT_STARTED; -}; - +} Effect.NOT_STARTED = 0; Effect.PLAYING = 1; Effect.ENDED = 2; @@ -12274,8 +12251,8 @@ function SlideShow() this.bIsSkipping = false; this.bIsSkippingAll = false; this.nTotalInteractivePlayingEffects = 0; - this.aStartedEffectList = new Array(); - this.aStartedEffectIndexMap = new Object(); + this.aStartedEffectList = []; + this.aStartedEffectIndexMap = {}; this.aStartedEffectIndexMap[ -1 ] = undefined; } @@ -12406,8 +12383,8 @@ SlideShow.prototype.notifySlideStart = function( nNewSlideIndex, nOldSlideIndex this.bIsSkipping = false; this.bIsSkippingAll = false; this.nTotalInteractivePlayingEffects = 0; - this.aStartedEffectList = new Array(); - this.aStartedEffectIndexMap = new Object(); + this.aStartedEffectList = []; + this.aStartedEffectIndexMap = {}; this.aStartedEffectIndexMap[ -1 ] = undefined; var aAnimatedElementMap; @@ -12463,7 +12440,7 @@ SlideShow.prototype.notifyInteractiveAnimationSequenceStart = function( nNodeId SlideShow.prototype.notifyInteractiveAnimationSequenceEnd = function( nNodeId ) { assert( this.isInteractiveEffectPlaying(), - 'SlideShow.notifyInteractiveAnimationSequenceEnd: no interactive effect playing.' ) + 'SlideShow.notifyInteractiveAnimationSequenceEnd: no interactive effect playing.' ); this.aStartedEffectList[ this.aStartedEffectIndexMap[ nNodeId ] ].end(); --this.nTotalInteractivePlayingEffects; @@ -12993,7 +12970,7 @@ FrameSynchronization.prototype.deactivate = function() function NextEffectEventArray() { - this.aEventArray = new Array(); + this.aEventArray = []; } @@ -13025,7 +13002,7 @@ NextEffectEventArray.prototype.appendEvent = function( aEvent ) NextEffectEventArray.prototype.clear = function( ) { - this.aEventArray = new Array(); + this.aEventArray = []; }; @@ -13157,9 +13134,9 @@ EventEntry.compare = function( aLhsEventEntry, aRhsEventEntry ) function ActivityQueue( aTimer ) { this.aTimer = aTimer; - this.aCurrentActivityWaitingSet = new Array(); - this.aCurrentActivityReinsertSet = new Array(); - this.aDequeuedActivitySet = new Array(); + this.aCurrentActivityWaitingSet = []; + this.aCurrentActivityReinsertSet = []; + this.aDequeuedActivitySet = []; } @@ -13222,7 +13199,7 @@ ActivityQueue.prototype.process = function() { // TODO: optimization, try to swap reference here this.aCurrentActivityWaitingSet = this.aCurrentActivityReinsertSet; - this.aCurrentActivityReinsertSet = new Array(); + this.aCurrentActivityReinsertSet = []; } }; @@ -13233,7 +13210,7 @@ ActivityQueue.prototype.processDequeued = function() for( var i = 0; i < nSize; ++i ) this.aDequeuedActivitySet[i].dequeued(); - this.aDequeuedActivitySet = new Array(); + this.aDequeuedActivitySet = []; }; ActivityQueue.prototype.isEmpty = function() @@ -13249,12 +13226,12 @@ ActivityQueue.prototype.clear = function() var i; for( i = 0; i < nSize; ++i ) this.aCurrentActivityWaitingSet[i].dequeued(); - this.aCurrentActivityWaitingSet = new Array(); + this.aCurrentActivityWaitingSet = []; nSize = this.aCurrentActivityReinsertSet.length; for( i = 0; i < nSize; ++i ) this.aCurrentActivityReinsertSet[i].dequeued(); - this.aCurrentActivityReinsertSet = new Array(); + this.aCurrentActivityReinsertSet = []; }; ActivityQueue.prototype.endAll = function() @@ -13264,12 +13241,12 @@ ActivityQueue.prototype.endAll = function() var i; for( i = 0; i < nSize; ++i ) this.aCurrentActivityWaitingSet[i].end(); - this.aCurrentActivityWaitingSet = new Array(); + this.aCurrentActivityWaitingSet = []; nSize = this.aCurrentActivityReinsertSet.length; for( i = 0; i < nSize; ++i ) this.aCurrentActivityReinsertSet[i].end(); - this.aCurrentActivityReinsertSet = new Array(); + this.aCurrentActivityReinsertSet = []; }; ActivityQueue.prototype.getTimer = function() commit becf4969bb7eed9011031cd4084d17a269b27995 Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Fri Dec 11 16:29:38 2015 +0100 svg export: added support for random bar and dissolve transitions Change-Id: Ib5e303599b04b031d7eefed56603bce0d1e1e570 Reviewed-on: https://gerrit.libreoffice.org/20650 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcek...@gmail.com> diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index 9b0678b..600bc61 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -1078,6 +1078,17 @@ function getSafeIndex( nIndex, nMin, nMax ) return nIndex; } +/** getRandomInt + * + * @param nMax + * @returns {number} + * an integer in [0,nMax[ + */ +function getRandomInt( nMax ) +{ + return Math.floor( Math.random() * nMax ); +} + function isTextFieldElement( aElement ) { var sClassName = aElement.getAttribute( 'class' ); @@ -3640,7 +3651,7 @@ SVGPathElement.prototype.changeOrientation = function() var aMovePathSeg = this.createSVGPathSegMovetoAbs( nCurrentX, nCurrentY ); aPathSegList.insertItemBefore( aMovePathSeg, 0 ); -} +}; /** matrixTransform and changeOrientation * We implement these methods for each path segment type still present @@ -4135,11 +4146,13 @@ BOXWIPE_TRANSITION = 2; FOURBOXWIPE_TRANSITION = 3; ELLIPSEWIPE_TRANSITION = 4; // 17 CLOCKWIPE_TRANSITION = 5; // 22 -PINWHEELWIPE_TRANSITION = 6; // 23 +PINWHEELWIPE_TRANSITION = 6; // 23 PUSHWIPE_TRANSITION = 7; // 35 SLIDEWIPE_TRANSITION = 8; // 36 FADE_TRANSITION = 9; // 37 -CHECKERBOARDWIPE_TRANSITION = 10; // 39 +RANDOMBARWIPE_TRANSITION = 10 // 38 +CHECKERBOARDWIPE_TRANSITION = 11; // 39 +DISSOLVE_TRANSITION = 12; // 40 aTransitionTypeInMap = { 'barWipe' : BARWIPE_TRANSITION, @@ -4151,12 +4164,14 @@ aTransitionTypeInMap = { 'pushWipe' : PUSHWIPE_TRANSITION, 'slideWipe' : SLIDEWIPE_TRANSITION, 'fade' : FADE_TRANSITION, - 'checkerBoardWipe' : CHECKERBOARDWIPE_TRANSITION + 'randomBarWipe' : RANDOMBARWIPE_TRANSITION, + 'checkerBoardWipe' : CHECKERBOARDWIPE_TRANSITION, + 'dissolve' : DISSOLVE_TRANSITION }; aTransitionTypeOutMap = [ '', 'barWipe', 'boxWipe', 'fourBoxWipe', 'ellipseWipe', 'clockWipe', 'pinWheelWipe', 'pushWipe', 'slideWipe', - 'fade', 'checkerBoardWipe' ]; + 'fade', 'randomBarWipe', 'checkerBoardWipe', 'dissolve' ]; // Transition Subtypes @@ -4190,6 +4205,7 @@ ONEBLADE_TRANS_SUBTYPE = 26; // 107 ACROSS_TRANS_SUBTYPE = 27; aTransitionSubtypeInMap = { + 'default' : DEFAULT_TRANS_SUBTYPE, 'leftToRight' : LEFTTORIGHT_TRANS_SUBTYPE, 'topToBottom' : TOPTOBOTTOM_TRANS_SUBTYPE, 'cornersIn' : CORNERSIN_TRANS_SUBTYPE, @@ -4459,6 +4475,29 @@ aTransitionInfoTable[FADE_TRANSITION][FADEOVERCOLOR_TRANS_SUBTYPE] = 'scaleIsotropically' : false }; + +aTransitionInfoTable[RANDOMBARWIPE_TRANSITION] = {}; +aTransitionInfoTable[RANDOMBARWIPE_TRANSITION][VERTICAL_TRANS_SUBTYPE] = +{ + 'class' : TRANSITION_CLIP_POLYPOLYGON, + 'rotationAngle' : 90.0, + 'scaleX' : 1.0, + 'scaleY' : 1.0, + 'reverseMethod' : REVERSEMETHOD_IGNORE, + 'outInvertsSweep' : true, + 'scaleIsotropically' : false +}; +aTransitionInfoTable[RANDOMBARWIPE_TRANSITION][HORIZONTAL_TRANS_SUBTYPE] = +{ + 'class' : TRANSITION_CLIP_POLYPOLYGON, + 'rotationAngle' : 0.0, + 'scaleX' : 1.0, + 'scaleY' : 1.0, + 'reverseMethod' : REVERSEMETHOD_IGNORE, + 'outInvertsSweep' : true, + 'scaleIsotropically' : false +}; + aTransitionInfoTable[CHECKERBOARDWIPE_TRANSITION] = {}; aTransitionInfoTable[CHECKERBOARDWIPE_TRANSITION][DOWN_TRANS_SUBTYPE] = { @@ -4481,6 +4520,18 @@ aTransitionInfoTable[CHECKERBOARDWIPE_TRANSITION][ACROSS_TRANS_SUBTYPE] = 'scaleIsotropically' : false }; +aTransitionInfoTable[DISSOLVE_TRANSITION] = {}; +aTransitionInfoTable[DISSOLVE_TRANSITION][DEFAULT_TRANS_SUBTYPE] = +{ + 'class' : TRANSITION_CLIP_POLYPOLYGON, + 'rotationAngle' : 0.0, + 'scaleX' : 1.0, + 'scaleY' : 1.0, + 'reverseMethod' : REVERSEMETHOD_IGNORE, + 'outInvertsSweep' : true, + 'scaleIsotropically' : true +}; + // Transition tables @@ -5630,7 +5681,7 @@ function AnimationBaseNode( aAnimElem, aParentNode, aNodeContext ) this.sClassName = 'AnimationBaseNode'; this.bIsContainer = false; this.aTargetElement = null; - this.bIsTargetTextElement = false + this.bIsTargetTextElement = false; this.aAnimatedElement = null; this.aActivity = null; @@ -6989,7 +7040,9 @@ AnimationTransitionFilterNode.prototype.parseElement = function() // subtype attribute this.eTransitionSubType = undefined; var sSubTypeAttr = aAnimElem.getAttributeNS( NSS['smil'], 'subtype' ); - if( sSubTypeAttr && aTransitionSubtypeInMap[ sSubTypeAttr ] ) + if( sSubTypeAttr === null ) + sSubTypeAttr = 'default'; + if( sSubTypeAttr && ( aTransitionSubtypeInMap[ sSubTypeAttr ] !== undefined ) ) { this.eTransitionSubType = aTransitionSubtypeInMap[ sSubTypeAttr ]; } @@ -8037,8 +8090,12 @@ function createClipPolyPolygon( nType, nSubtype ) return null; } return new PinWheelWipePath( nBlades ); + case RANDOMBARWIPE_TRANSITION: + return new RandomWipePath( 128, true /* bars */ ); case CHECKERBOARDWIPE_TRANSITION: return new CheckerBoardWipePath( 10 ); + case DISSOLVE_TRANSITION: + return new RandomWipePath( 16 * 16, false /* dissolve */ ); } } @@ -8053,6 +8110,14 @@ function createUnitSquarePath() return aPath; } +function createEmptyPath() +{ + var aPath = document.createElementNS( NSS['svg'], 'path' ); + var sD = 'M 0 0 L 0 0'; + aPath.setAttribute( 'd', sD ); + return aPath; +} + function pruneScaleValue( nVal ) { if( nVal < 0.0 ) @@ -8350,6 +8415,100 @@ CheckerBoardWipePath.prototype.perform = function( nT ) +/** Class RandomWipePath + * + * @param nElements + * The number of bars or cells to be used. + * @param bRandomBars + * true: generates a horizontal random bar wipe + * false: generates a dissolve wipe + */ +function RandomWipePath( nElements, bRandomBars ) +{ + this.nElements = nElements; + this.aBasePath = createUnitSquarePath(); + this.aPositionArray = new Array( nElements ); + this.aClipPath = createEmptyPath(); + this.nAlreadyAppendedElements = 0; + + if( bRandomBars ) // random bar wipe + { + var fEdgeLength = 1.0 / nElements; + var nPos; + for( nPos = 0; nPos < nElements; ++nPos ) + { + this.aPositionArray[nPos] = { x: 0.0, y: pruneScaleValue( nPos * fEdgeLength ) } + } + var aTransform = SVGIdentityMatrix.scaleNonUniform( 1.0, pruneScaleValue( fEdgeLength ) ); + } + else // dissolve wipe + { + var nSqrtElements = Math.round( Math.sqrt( nElements ) ); + var fEdgeLength = 1.0 / nSqrtElements; + var nPos; + for( nPos = 0; nPos < nElements; ++nPos ) + { + this.aPositionArray[nPos] = { + x: pruneScaleValue( ( nPos % nSqrtElements ) * fEdgeLength ), + y: pruneScaleValue( ( nPos / nSqrtElements ) * fEdgeLength ) } + } + var aTransform = SVGIdentityMatrix.scale( pruneScaleValue( fEdgeLength ) ); + } + this.aBasePath.matrixTransform( aTransform ); + + var nPos1, nPos2; + var tmp; + for( nPos1 = nElements - 1; nPos1 > 0; --nPos1 ) + { + nPos2 = getRandomInt( nPos1 + 1 ); + tmp = this.aPositionArray[nPos1]; + this.aPositionArray[nPos1] = this.aPositionArray[nPos2]; + this.aPositionArray[nPos2] = tmp; + } +} + +/** perform + * + * @param nT + * A parameter in [0,1] representing the width of the generated bars or squares. + * @return {SVGPathElement} + * A svg <path> element representing a multi bars or a multi squared cells. + */ +RandomWipePath.prototype.perform = function( nT ) +{ + var aPolyPath = createEmptyPath(); + var aPoint; + var aPath; + var aTransform; + var nElements = Math.round( nT * this.nElements ); + if( nElements === 0 ) + { + return aPolyPath; + } + // check if we need to reset the clip path + if( this.nAlreadyAppendedElements >= nElements ) + { + this.nAlreadyAppendedElements = 0; + this.aClipPath = createEmptyPath(); + } + var nPos; + for( nPos = this.nAlreadyAppendedElements; nPos < nElements; ++nPos ) + { + aPoint = this.aPositionArray[nPos]; + aPath = this.aBasePath.cloneNode( true ); + aTransform = SVGIdentityMatrix.translate( aPoint.x, aPoint.y ); + aPath.matrixTransform( aTransform ); + aPolyPath.appendPath( aPath ); + } + + this.nAlreadyAppendedElements = nElements; + this.aClipPath.appendPath( aPolyPath ); + + return this.aClipPath.cloneNode( true ); +}; + + + /** Class AnimatedSlide * This class handle a slide element during a slide transition. * @@ -9624,7 +9783,9 @@ SlideTransition.prototype.parseElement = function() // subtype attribute this.eTransitionSubType = undefined; var sSubTypeAttr = aAnimElem.getAttributeNS( NSS['smil'], 'subtype' ); - if( sSubTypeAttr && aTransitionSubtypeInMap[ sSubTypeAttr ] ) + if( sSubTypeAttr === null ) + sSubTypeAttr = 'default'; + if( sSubTypeAttr && ( aTransitionSubtypeInMap[ sSubTypeAttr ] !== undefined ) ) { this.eTransitionSubType = aTransitionSubtypeInMap[ sSubTypeAttr ]; this.bIsValid = true; commit cbadf62350f6e45b77b3ba22c1fd45b6d36c2f20 Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Tue Jan 12 17:15:16 2016 +0100 svg export - group shape + indefinite duration - fixed Fixed two issues: - group shapes were not animated - when smil:dur=indefinite final state of shapes was not frozen Now when an audio or command node is hit a log message is printed informing that such a type of animation nodes are not implemented. Change-Id: I81853c982e6a2b68c3644b2ebc09e2d565d706af Reviewed-on: https://gerrit.libreoffice.org/21446 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcek...@gmail.com> diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index a8b9f6b..9b0678b 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -3873,7 +3873,9 @@ aAnimationNodeTypeInMap = { 'animatemotion' : ANIMATION_NODE_ANIMATEMOTION, 'animatecolor' : ANIMATION_NODE_ANIMATECOLOR, 'animatetransform' : ANIMATION_NODE_ANIMATETRANSFORM, - 'transitionfilter' : ANIMATION_NODE_TRANSITIONFILTER + 'transitionfilter' : ANIMATION_NODE_TRANSITIONFILTER, + 'audio' : ANIMATION_NODE_AUDIO, + 'command' : ANIMATION_NODE_COMMAND }; @@ -5205,7 +5207,7 @@ BaseNode.prototype.parseElement = function() { this.eFillMode = ( this.aEnd || ( this.nReapeatCount != 1) || - this.aDuration ) + ( this.aDuration && !this.aDuration.isIndefinite() ) ) ? FILL_MODE_REMOVE : FILL_MODE_FREEZE; } @@ -7115,6 +7117,12 @@ function createAnimationNode( aElement, aParentNode, aNodeContext ) case ANIMATION_NODE_TRANSITIONFILTER: aCreatedNode = new AnimationTransitionFilterNode( aElement, aParentNode, aNodeContext ); break; + case ANIMATION_NODE_AUDIO: + log( 'createAnimationNode: AUDIO not implemented' ); + return null; + case ANIMATION_NODE_COMMAND: + log( 'createAnimationNode: COMMAND not implemented' ); + return null; default: log( 'createAnimationNode: invalid Animation Node Type: ' + eAnimationNodeType ); return null; diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 2fd65b3..b83fe22 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -1785,6 +1785,11 @@ bool SVGFilter::implExportShape( const Reference< XShape >& rxShape, if( xShapes.is() ) { mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "Group" ); + const OUString& rShapeId = implGetValidIDFromInterface( Reference<XInterface>(rxShape, UNO_QUERY) ); + if( !rShapeId.isEmpty() ) + { + mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", rShapeId ); + } SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true ); bRet = implExportShapes( xShapes, bMaster ); commit 57ce435525e6b1fd7a82713f7844565fe3b22157 Author: Noel Grandin <n...@peralex.com> Date: Mon Jan 11 13:13:24 2016 +0200 loplugin:unusedmethods unused return value in filter Change-Id: I42b24bed84ab9b745041166610732d9a074b5f72 diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 1adec14..2fd65b3 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -957,9 +957,8 @@ OUString implGenerateFieldId( std::vector< TextField* > & aFieldSet, -bool SVGFilter::implGenerateMetaData() +void SVGFilter::implGenerateMetaData() { - bool bRet = false; sal_Int32 nCount = mSelectedPages.getLength(); if( nCount != 0 ) { @@ -1184,18 +1183,13 @@ bool SVGFilter::implGenerateMetaData() } } } - bRet = true; } - - return bRet; } -bool SVGFilter::implExportAnimations() +void SVGFilter::implExportAnimations() { - bool bRet = false; - mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", "presentation-animations" ); SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true ); @@ -1251,9 +1245,6 @@ bool SVGFilter::implExportAnimations() } } } - - bRet = true; - return bRet; } @@ -1336,7 +1327,7 @@ void SVGFilter::implEmbedBulletGlyph( sal_Unicode cBullet, const OUString & sPat * We export bitmaps embedded into text shapes, such as those used by list * items with image style, only once in a specific <defs> element. */ -bool SVGFilter::implExportTextEmbeddedBitmaps() +void SVGFilter::implExportTextEmbeddedBitmaps() { mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "TextEmbeddedBitmaps" ); SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true ); @@ -1382,23 +1373,21 @@ bool SVGFilter::implExportTextEmbeddedBitmaps() else { OSL_FAIL( "implExportTextEmbeddedBitmaps: no shape bounding box." ); - return false; + return; } } else { OSL_FAIL( "implExportTextEmbeddedBitmaps: metafile should have MetaBmpExScaleAction only." ); - return false; + return; } } else { OSL_FAIL( "implExportTextEmbeddedBitmaps: metafile should have a single action." ); - return false; + return; } - } - return true; } @@ -1406,7 +1395,7 @@ bool SVGFilter::implExportTextEmbeddedBitmaps() #define SVGFILTER_EXPORT_SVGSCRIPT( z, n, aFragment ) \ xExtDocHandler->unknown( aFragment ## n ); -bool SVGFilter::implGenerateScript() +void SVGFilter::implGenerateScript() { mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "type", "text/ecmascript" ); @@ -1419,8 +1408,6 @@ bool SVGFilter::implGenerateScript() BOOST_PP_REPEAT( N_SVGSCRIPT_FRAGMENTS, SVGFILTER_EXPORT_SVGSCRIPT, aSVGScript ) } } - - return true; } @@ -1446,10 +1433,8 @@ Any SVGFilter::implSafeGetPagePropSet( const OUString & sPropertyName, * This method is used when exporting a single page * as implGenerateMetaData is not invoked. */ -bool SVGFilter::implGetPagePropSet( const Reference< XDrawPage > & rxPage ) +void SVGFilter::implGetPagePropSet( const Reference< XDrawPage > & rxPage ) { - bool bRet = false; - mVisiblePagePropSet.bIsBackgroundVisible = true; mVisiblePagePropSet.bAreBackgroundObjectsVisible = true; mVisiblePagePropSet.bIsPageNumberFieldVisible = false;; @@ -1493,12 +1478,8 @@ bool SVGFilter::implGetPagePropSet( const Reference< XDrawPage > & rxPage ) mVisiblePagePropSet.nPageNumberingType = pSdrModel->GetPageNumType(); } } - - bRet = true; } } - - return bRet; } @@ -1558,7 +1539,7 @@ bool SVGFilter::implExportMasterPages( const std::vector< Reference< XDrawPage > -bool SVGFilter::implExportDrawPages( const SVGFilter::XDrawPageSequence & rxPages, +void SVGFilter::implExportDrawPages( const SVGFilter::XDrawPageSequence & rxPages, sal_Int32 nFirstPage, sal_Int32 nLastPage ) { DBG_ASSERT( nFirstPage <= nLastPage, @@ -1590,7 +1571,6 @@ bool SVGFilter::implExportDrawPages( const SVGFilter::XDrawPageSequence & rxPage mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "SlideGroup" ); SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true ); - bool bRet = false; for( sal_Int32 i = nFirstPage; i <= nLastPage; ++i ) { Reference< XShapes > xShapes; @@ -1642,13 +1622,11 @@ bool SVGFilter::implExportDrawPages( const SVGFilter::XDrawPageSequence & rxPage SvXMLElementExport aSlideElement( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true ); - bRet = implExportPage( sPageId, rxPages[i], xShapes, false /* is not a master page */ ) || bRet; + implExportPage( sPageId, rxPages[i], xShapes, false /* is not a master page */ ); } } // append the </g> closing tag related to inserted elements } // append the </g> closing tag related to the svg element handling the slide visibility } - - return bRet; } @@ -2151,7 +2129,7 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & rxPag -bool SVGFilter::implCreateObjectsFromBackground( const Reference< XDrawPage >& rxDrawPage ) +void SVGFilter::implCreateObjectsFromBackground( const Reference< XDrawPage >& rxDrawPage ) { Reference< XGraphicExportFilter > xExporter = drawing::GraphicExportFilter::create( mxContext ); @@ -2173,8 +2151,6 @@ bool SVGFilter::implCreateObjectsFromBackground( const Reference< XDrawPage >& r aMtf.Read( *aFile.GetStream( StreamMode::READ ) ); (*mpObjects)[ rxDrawPage ] = ObjectRepresentation( rxDrawPage, aMtf ); - - return true; } diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx index 1e64c8b..89544ad 100644 --- a/filter/source/svg/svgfilter.hxx +++ b/filter/source/svg/svgfilter.hxx @@ -252,20 +252,20 @@ private: bool implExport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException, std::exception); static Reference< XWriter > implCreateExportDocumentHandler( const Reference< XOutputStream >& rxOStm ); - bool implGetPagePropSet( const Reference< XDrawPage > & rxPage ); - bool implGenerateMetaData(); + void implGetPagePropSet( const Reference< XDrawPage > & rxPage ); + void implGenerateMetaData(); void implExportTextShapeIndex(); void implEmbedBulletGlyphs(); void implEmbedBulletGlyph( sal_Unicode cBullet, const OUString & sPathData ); - bool implExportTextEmbeddedBitmaps(); - bool implGenerateScript(); + void implExportTextEmbeddedBitmaps(); + void implGenerateScript(); bool implExportDocument(); - bool implExportAnimations(); + void implExportAnimations(); bool implExportMasterPages( const std::vector< Reference< XDrawPage > >& rxPages, sal_Int32 nFirstPage, sal_Int32 nLastPage ); - bool implExportDrawPages( const XDrawPageSequence& rxPages, + void implExportDrawPages( const XDrawPageSequence& rxPages, sal_Int32 nFirstPage, sal_Int32 nLastPage ); bool implExportPage( const OUString & sPageId, const Reference< XDrawPage > & rxPage, @@ -280,7 +280,7 @@ private: bool implCreateObjects(); bool implCreateObjectsFromShapes( const Reference< XDrawPage > & rxPage, const Reference< XShapes >& rxShapes ); bool implCreateObjectsFromShape( const Reference< XDrawPage > & rxPage, const Reference< XShape >& rxShape ); - bool implCreateObjectsFromBackground( const Reference< XDrawPage >& rxMasterPage ); + void implCreateObjectsFromBackground( const Reference< XDrawPage >& rxMasterPage ); static OUString implGetClassFromShape( const Reference< XShape >& rxShape ); void implRegisterInterface( const Reference< XInterface >& rxIf ); diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index ceb2dec..8613369 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -858,7 +858,7 @@ void SVGTextWriter::implSetFontFamily() mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFontFamily, sFontFamily ); } -bool SVGTextWriter::createParagraphEnumeration() +void SVGTextWriter::createParagraphEnumeration() { if( mrTextShape.is() ) { @@ -869,7 +869,6 @@ bool SVGTextWriter::createParagraphEnumeration() if( xEnumeration.is() ) { mrParagraphEnumeration.set( xEnumeration ); - return true; } else { @@ -880,7 +879,6 @@ bool SVGTextWriter::createParagraphEnumeration() { OSL_FAIL( "SVGTextWriter::createParagraphEnumeration: no valid XText interface found." ); } - return false; } bool SVGTextWriter::nextParagraph() diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index 7afb41b..29a8fcf 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -213,7 +213,7 @@ class SVGTextWriter void setTextProperties( const GDIMetaFile& rMtf, sal_uLong nCurAction ); void addFontAttributes( bool bIsTextContainer ); - bool createParagraphEnumeration(); + void createParagraphEnumeration(); bool nextParagraph(); bool nextTextPortion(); @@ -295,11 +295,10 @@ private: bool mbIsPlaceholderShape; - SVGAttributeWriter* ImplAcquireContext() + void ImplAcquireContext() { maContextStack.push( mpContext = new SVGAttributeWriter( mrExport, mrFontExport ) ); maTextWriter.setContext( mpContext ); - return mpContext; } void ImplReleaseContext() { diff --git a/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx b/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx index 3f4d285..8739824 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx +++ b/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx @@ -83,7 +83,7 @@ static OUString checkExtensions( const OUString& rExtensions ) return aRet; } -bool XMLFilterTabPageBasic::FillInfo( filter_info_impl* pInfo ) +void XMLFilterTabPageBasic::FillInfo( filter_info_impl* pInfo ) { if( pInfo ) { @@ -118,8 +118,6 @@ bool XMLFilterTabPageBasic::FillInfo( filter_info_impl* pInfo ) } } } - - return true; } void XMLFilterTabPageBasic::SetInfo(const filter_info_impl* pInfo) diff --git a/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx b/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx index cc90664..e5809fa 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx +++ b/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx @@ -36,7 +36,7 @@ public: virtual ~XMLFilterTabPageBasic(); virtual void dispose() override; - bool FillInfo( filter_info_impl* pInfo ); + void FillInfo( filter_info_impl* pInfo ); void SetInfo(const filter_info_impl* pInfo); VclPtr<Edit> m_pEDFilterName; diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx index 8f844c8..47e24a9 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx +++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx @@ -74,7 +74,7 @@ void XMLFilterTabPageXSLT::dispose() TabPage::dispose(); } -bool XMLFilterTabPageXSLT::FillInfo( filter_info_impl* pInfo ) +void XMLFilterTabPageXSLT::FillInfo( filter_info_impl* pInfo ) { if( pInfo ) { @@ -84,8 +84,6 @@ bool XMLFilterTabPageXSLT::FillInfo( filter_info_impl* pInfo ) pInfo->maImportTemplate = GetURL( m_pEDImportTemplate ); pInfo->mbNeedsXSLT2 = m_pCBNeedsXSLT2->IsChecked(); } - - return true; } ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits