From 61bc0d058dd95961761056a104ecd729ddfa4a82 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Wed, 12 Sep 2018 14:47:49 +0200 Subject: tdf#118500 Impress losing slide transition sound on saving This reverts commit b223028d65d24ffcd8e27974c29c2744a5df6227. Change-Id: Iac12092a4f6b0edb3b6a5228ed17e7d0c1794357 Reviewed-on: https://gerrit.libreoffice.org/60391 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- xmloff/source/draw/animationexport.cxx | 59 ++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index 1229b5f922d0..297ed54a1f6c 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -586,42 +586,45 @@ void AnimationsExporterImpl::exportTransitionNode() SvXMLElementExport aElement( mrExport, XML_NAMESPACE_ANIMATION, XML_PAR, true, true ); - sal_Int16 nSubtype = 0; - bool bDirection = false; - sal_Int32 nFadeColor = 0; - double fDuration = 0.0; - mxPageProps->getPropertyValue("TransitionSubtype") >>= nSubtype; - mxPageProps->getPropertyValue("TransitionDirection") >>= bDirection; - mxPageProps->getPropertyValue("TransitionFadeColor") >>= nFadeColor; - mxPageProps->getPropertyValue("TransitionDuration") >>= fDuration; - - ::sax::Converter::convertDouble( sTmp, fDuration ); - sTmp.append( 's'); - mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DUR, sTmp.makeStringAndClear() ); + if( nTransition != 0 ) + { + sal_Int16 nSubtype = 0; + bool bDirection = false; + sal_Int32 nFadeColor = 0; + double fDuration = 0.0; + mxPageProps->getPropertyValue("TransitionSubtype") >>= nSubtype; + mxPageProps->getPropertyValue("TransitionDirection") >>= bDirection; + mxPageProps->getPropertyValue("TransitionFadeColor") >>= nFadeColor; + mxPageProps->getPropertyValue("TransitionDuration") >>= fDuration; + + ::sax::Converter::convertDouble( sTmp, fDuration ); + sTmp.append( 's'); + mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DUR, sTmp.makeStringAndClear() ); - SvXMLUnitConverter::convertEnum( sTmp, nTransition, aAnimations_EnumMap_TransitionType ); - mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TYPE, sTmp.makeStringAndClear() ); + SvXMLUnitConverter::convertEnum( sTmp, nTransition, aAnimations_EnumMap_TransitionType ); + mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TYPE, sTmp.makeStringAndClear() ); - if( nSubtype != TransitionSubType::DEFAULT ) - { - SvXMLUnitConverter::convertEnum( sTmp, nSubtype, aAnimations_EnumMap_TransitionSubType ); - mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_SUBTYPE, sTmp.makeStringAndClear() ); - } + if( nSubtype != TransitionSubType::DEFAULT ) + { + SvXMLUnitConverter::convertEnum( sTmp, nSubtype, aAnimations_EnumMap_TransitionSubType ); + mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_SUBTYPE, sTmp.makeStringAndClear() ); + } - if( !bDirection ) - mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DIRECTION, XML_REVERSE ); + if( !bDirection ) + mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DIRECTION, XML_REVERSE ); - if( (nTransition == TransitionType::FADE) && ((nSubtype == TransitionSubType::FADETOCOLOR) || (nSubtype == TransitionSubType::FADEFROMCOLOR) )) - { - ::sax::Converter::convertColor( sTmp, nFadeColor ); - mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FADECOLOR, sTmp.makeStringAndClear() ); + if( (nTransition == TransitionType::FADE) && ((nSubtype == TransitionSubType::FADETOCOLOR) || (nSubtype == TransitionSubType::FADEFROMCOLOR) )) + { + ::sax::Converter::convertColor( sTmp, nFadeColor ); + mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FADECOLOR, sTmp.makeStringAndClear() ); + } + SvXMLElementExport aElement2( mrExport, XML_NAMESPACE_ANIMATION, XML_TRANSITIONFILTER, true, true ); } - SvXMLElementExport aElement2( mrExport, XML_NAMESPACE_ANIMATION, XML_TRANSITIONFILTER, true, true ); if( bStopSound ) { mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_COMMAND, XML_STOP_AUDIO ); - SvXMLElementExport aElement3( mrExport, XML_NAMESPACE_ANIMATION, XML_COMMAND, true, true ); + SvXMLElementExport aElement2( mrExport, XML_NAMESPACE_ANIMATION, XML_COMMAND, true, true ); } else if( !sSoundURL.isEmpty()) { @@ -633,7 +636,7 @@ void AnimationsExporterImpl::exportTransitionNode() if( bLoopSound ) mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_REPEATCOUNT, XML_INDEFINITE ); - SvXMLElementExport aElement4( mrExport, XML_NAMESPACE_ANIMATION, XML_AUDIO, true, true ); + SvXMLElementExport aElement2( mrExport, XML_NAMESPACE_ANIMATION, XML_AUDIO, true, true ); } } } -- cgit