[ooo-build-commit] .: patches/dev300
Radek DoulÃk
rodo at kemper.freedesktop.org
Mon Feb 1 08:44:18 PST 2010
patches/dev300/apply | 5
patches/dev300/sd-sound.diff | 743 ++++++++++++++++++++++++++++++++++++
patches/dev300/slideshow-sound.diff | 353 +++++++++++++++++
patches/dev300/svx-sound.diff | 140 ++++++
4 files changed, 1241 insertions(+)
New commits:
commit 4fe2eb7f5ee5cabbaa83a27ce9c5e09e2ecfc320
Author: Radek Doulik <rodo at obluda.lounovice>
Date: Mon Feb 1 17:43:12 2010 +0100
fixes n#515553
makes sounds spanning multiple slides to work in ppt import
* patches/dev300/apply:
* patches/dev300/sd-sound.diff:
* patches/dev300/slideshow-sound.diff:
* patches/dev300/svx-sound.diff:
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 1a99327..e7c41e1 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3519,3 +3519,8 @@ oowintool-java6.diff, fridrich
[ Netbook ]
vcl-netbook.diff, rodo
framework-netbook.diff, rodo
+
+[ Fixes ]
+svx-sound.diff, n#515553, rodo
+sd-sound.diff, n#515553, rodo
+slideshow-sound.diff, n#515553, rodo
diff --git a/patches/dev300/sd-sound.diff b/patches/dev300/sd-sound.diff
new file mode 100644
index 0000000..9f858a4
--- /dev/null
+++ b/patches/dev300/sd-sound.diff
@@ -0,0 +1,743 @@
+diff -rup sd-orig/inc/diadef.h sd/inc/diadef.h
+--- sd-orig/inc/diadef.h 2009-09-28 11:30:35.000000000 +0200
++++ sd/inc/diadef.h 2009-09-30 17:16:08.000000000 +0200
+@@ -35,11 +35,12 @@ enum PresChange
+ {
+ PRESCHANGE_MANUAL = 0,
+ PRESCHANGE_AUTO = 1,
+- PRESCHANGE_SEMIAUTO = 2
++ PRESCHANGE_SEMIAUTO = 2,
++ PRESCHANGE_AUTO_PPT = 3
+ };
+
+ // muss angepasst werden!
+-#define PRESCHANGE_COUNT 3
++#define PRESCHANGE_COUNT 4
+
+ #endif // _SD_DIADEF_H
+
+Only in sd/inc: diadef.h~
+Only in sd/source/core: CustomAnimationEffect.cxx~
+diff -rup sd-orig/source/filter/ppt/ppt97animations.cxx sd/source/filter/ppt/ppt97animations.cxx
+--- sd-orig/source/filter/ppt/ppt97animations.cxx 2009-09-28 11:30:35.000000000 +0200
++++ sd/source/filter/ppt/ppt97animations.cxx 2009-10-04 22:06:21.000000000 +0200
+@@ -175,6 +175,10 @@ UINT32 Ppt97Animation::GetSoundRef() con
+ {
+ return m_aAtom.nSoundRef;
+ }
++UINT16 Ppt97Animation::GetSlidesCount() const
++{
++ return m_aAtom.nSlideCount;
++}
+ void Ppt97Animation::SetSoundFileUrl( const ::rtl::OUString& rSoundFileUrl )
+ {
+ m_aSoundFileUrl = rSoundFileUrl;
+Only in sd/source/filter/ppt: ppt97animations.cxx~
+diff -rup sd-orig/source/filter/ppt/ppt97animations.hxx sd/source/filter/ppt/ppt97animations.hxx
+--- sd-orig/source/filter/ppt/ppt97animations.hxx 2009-09-28 11:30:35.000000000 +0200
++++ sd/source/filter/ppt/ppt97animations.hxx 2009-10-04 22:05:33.000000000 +0200
+@@ -111,6 +111,7 @@ public: //public methods
+ bool HasSoundEffect() const;
+ sal_Int32 GetDimColor() const;
+ UINT32 GetSoundRef() const;
++ UINT16 GetSlidesCount() const;
+ bool HasAnimateAssociatedShape() const; //true if the shape should be animated in addition to the text
+
+ //set methods
+Only in sd/source/filter/ppt: ppt97animations.hxx~
+Only in sd/source/filter/ppt: pptanimations.hxx~
+diff -rup sd-orig/source/filter/ppt/pptinanimations.cxx sd/source/filter/ppt/pptinanimations.cxx
+--- sd-orig/source/filter/ppt/pptinanimations.cxx 2009-09-28 11:30:35.000000000 +0200
++++ sd/source/filter/ppt/pptinanimations.cxx 2009-10-07 16:04:36.000000000 +0200
+@@ -27,7 +27,6 @@
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+-
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_sd.hxx"
+ #include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
+@@ -243,11 +242,11 @@ AnimationImporter::AnimationImporter( Im
+
+ // --------------------------------------------------------------------
+
+-void AnimationImporter::import( const Reference< XDrawPage >& xPage, const DffRecordHeader& rProgTagContentHd )
++void AnimationImporter::import( const Reference< XDrawPage >& xPage, const DffRecordHeader& rProgTagContentHd, bool& bAfterSound )
+ {
+ #ifdef DBG_ANIM_LOG
+- mpFile = fopen( "c:\\output.xml", "w+" );
+- //mpFile = stdout;
++ //mpFile = fopen( "c:\\output.xml", "w+" );
++ mpFile = stdout;
+ #endif
+ dump("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+
+@@ -262,7 +261,7 @@ void AnimationImporter::import( const Re
+ const Atom* pAtom = Atom::import( rProgTagContentHd, mrStCtrl );
+ if( pAtom )
+ {
+- importAnimationContainer( pAtom, xParent );
++ importAnimationContainer( pAtom, xParent, bAfterSound );
+ }
+
+ processAfterEffectNodes();
+@@ -376,7 +375,7 @@ static bool is_random( const AnimationNo
+ }
+
+
+-void AnimationImporter::importAnimationContainer( const Atom* pAtom, const Reference< XAnimationNode >& xParent )
++void AnimationImporter::importAnimationContainer( const Atom* pAtom, const Reference< XAnimationNode >& xParent, bool& bAfterSound )
+ {
+ if( pAtom->seekToContent() )
+ {
+@@ -416,7 +415,7 @@ void AnimationImporter::importAnimationC
+ // import if we have a node and its not random
+ if( xNode.is() )
+ {
+- fillNode( xNode, aNode, aSet );
++ fillNode( xNode, aNode, aSet, bAfterSound );
+
+ switch( aNode.mnGroupType )
+ {
+@@ -425,7 +424,7 @@ void AnimationImporter::importAnimationC
+ dump( "<par" );
+ dump( aNode );
+ dump( aSet );
+- importTimeContainer( pAtom, xNode );
++ importTimeContainer( pAtom, xNode, bAfterSound );
+ dump( "</par>\n" );
+
+ // for iteration containers, map target from childs to iteration
+@@ -476,7 +475,7 @@ void AnimationImporter::importAnimationC
+ dump( "<seq" );
+ dump( aNode );
+ dump( aSet );
+- importTimeContainer( pAtom, xNode );
++ importTimeContainer( pAtom, xNode, bAfterSound );
+ dump( "</seq>\n" );
+
+ if( aSet.hasProperty( DFF_ANIM_NODE_TYPE ) )
+@@ -557,7 +556,7 @@ void AnimationImporter::importAnimationC
+ dump( "<audio" );
+ dump( aNode );
+ dump( aSet );
+- importAudioContainer( pAtom, xNode );
++ importAudioContainer( pAtom, xNode );
+ dump( "</audio>\n" );
+ }
+ break;
+@@ -613,7 +612,7 @@ void AnimationImporter::fixMainSequenceT
+ // with node
+ xE2->nextElement() >>= xEA2;
+ if( xEA2.is() )
+- xE2.query( xEA2->createEnumeration() );
++ xE2.set( xEA2->createEnumeration(), UNO_QUERY );
+ else
+ xE2.clear();
+
+@@ -959,9 +958,9 @@ bool AnimationImporter::convertAnimation
+ sal_Int32 nA = aString.getToken( 0, (sal_Unicode)',', index ).toInt32();
+ sal_Int32 nB = aString.getToken( 0, (sal_Unicode)',', index ).toInt32();
+ sal_Int32 nC = aString.getToken( 0, (sal_Unicode)',', index ).toInt32();
+- dump( "hsl(%ld", nA );
+- dump( ",%ld", nB );
+- dump( ",%ld)", nC );
++ dump( "hsl(%d", nA );
++ dump( ",%d", nB );
++ dump( ",%d)", nC );
+ Sequence< double > aHSL( 3 );
+ aHSL[0] = nA * 360.0/255.0;
+ aHSL[1] = nB / 255.0;
+@@ -1120,7 +1119,7 @@ static OUString getConvertedSubType( sal
+
+ // --------------------------------------------------------------------
+
+-void AnimationImporter::fillNode( Reference< XAnimationNode >& xNode, const AnimationNode& rNode, const PropertySet& rSet )
++void AnimationImporter::fillNode( Reference< XAnimationNode >& xNode, const AnimationNode& rNode, PropertySet& rSet, bool& bAfterSound )
+ {
+ sal_Bool bAfterEffect = false;
+
+@@ -1185,6 +1184,7 @@ void AnimationImporter::fillNode( Refere
+ if( rSet.getProperty( DFF_ANIM_NODE_TYPE ) >>= nPPTNodeType )
+ {
+ sal_Int16 nNodeType = ::com::sun::star::presentation::EffectNodeType::DEFAULT;
++
+ switch( nPPTNodeType )
+ {
+ case DFF_ANIM_NODE_TYPE_ON_CLICK: nNodeType = ::com::sun::star::presentation::EffectNodeType::ON_CLICK; break;
+@@ -1194,7 +1194,11 @@ void AnimationImporter::fillNode( Refere
+ case DFF_ANIM_NODE_TYPE_TIMING_ROOT: nNodeType = ::com::sun::star::presentation::EffectNodeType::TIMING_ROOT; break;
+ case DFF_ANIM_NODE_TYPE_INTERACTIVE_SEQ:nNodeType = ::com::sun::star::presentation::EffectNodeType::INTERACTIVE_SEQUENCE; break;
+ }
+-
++ if( bAfterSound
++ && ( nPPTNodeType == DFF_ANIM_NODE_TYPE_ON_CLICK
++ || nPPTNodeType == DFF_ANIM_NODE_TYPE_WITH_PREVIOUS
++ || nPPTNodeType == DFF_ANIM_NODE_TYPE_AFTER_PREVIOUS ) )
++ bAfterSound = false;
+ sal_Int32 nSize = aUserData.getLength();
+ aUserData.realloc(nSize+1);
+ aUserData[nSize].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "node-type" ) );
+@@ -1229,7 +1233,7 @@ void AnimationImporter::fillNode( Refere
+ case DFF_ANIM_PRESS_CLASS_EMPHASIS: nEffectPresetClass = EffectPresetClass::EMPHASIS; break;
+ case DFF_ANIM_PRESS_CLASS_MOTIONPATH: nEffectPresetClass = EffectPresetClass::MOTIONPATH; break;
+ case DFF_ANIM_PRESS_CLASS_OLE_ACTION: nEffectPresetClass = EffectPresetClass::OLEACTION; break;
+- case DFF_ANIM_PRESS_CLASS_MEDIACALL: nEffectPresetClass = EffectPresetClass::MEDIACALL; break;
++ case DFF_ANIM_PRESS_CLASS_MEDIACALL: nEffectPresetClass = EffectPresetClass::MEDIACALL; bAfterSound = true; break;
+ }
+ sal_Int32 nSize = aUserData.getLength();
+ aUserData.realloc(nSize+1);
+@@ -1419,7 +1423,7 @@ void AnimationImporter::fillNode( Refere
+
+ // --------------------------------------------------------------------
+
+-void AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference< XAnimationNode >& xNode )
++void AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference< XAnimationNode >& xNode, bool& bAfterSound )
+ {
+ DBG_ASSERT( pAtom && xNode.is(), "invalid call to ppt::AnimationImporter::importTimeContainer()!");
+ if( pAtom && xNode.is() )
+@@ -1457,13 +1461,13 @@ void AnimationImporter::importTimeContai
+ }
+ else
+ {
+- importAnimationContainer( pChildAtom, xNode );
++ importAnimationContainer( pChildAtom, xNode, bAfterSound );
+ }
+ }
+ break;
+ case DFF_msofbtAnimGroup :
+ {
+- importAnimationContainer( pChildAtom, xNode );
++ importAnimationContainer( pChildAtom, xNode, bAfterSound );
+ }
+ break;
+ case DFF_msofbtAnimIteration:
+@@ -1491,9 +1495,9 @@ void AnimationImporter::importTimeContai
+ dump( "<iterate" );
+ dump( " iterateType=\"%s\"", (nTextUnitEffect == 0) ? "byElement" : (nTextUnitEffect == 1) ? "byWord" : "byLetter" );
+ dump( " iterateInterval=\"%g\"", fInterval );
+- dump( " u1=\"%ld\"", nU1 );
+- dump( " u2=\"%ld\"", nU2 );
+- dump( " u3=\"%ld\"/>\n", nU3 );
++ dump( " u1=\"%d\"", nU1 );
++ dump( " u2=\"%d\"", nU2 );
++ dump( " u3=\"%d\"/>\n", nU3 );
+ }
+ }
+ break;
+@@ -1504,7 +1508,7 @@ void AnimationImporter::importTimeContai
+ sal_uInt32 nU1, nU2;
+ mrStCtrl >> nU1 >> nU2;
+
+- fprintf( mpFile, "<unknown_0xf136 nU1=\"%ld\" nU2=\"%ld\"/>\n", nU1, nU2 );
++ fprintf( mpFile, "<unknown_0xf136 nU1=\"%d\" nU2=\"%d\"/>\n", nU1, nU2 );
+ #endif
+ }
+ break;
+@@ -1708,7 +1712,7 @@ void AnimationImporter::importAnimateFil
+ break;
+
+ default:
+- dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() );
++ dump( " unknown_atom=\"%d\"", (sal_Int32)pChildAtom->getType() );
+ break;
+
+ }
+@@ -1842,7 +1846,7 @@ void AnimationImporter::importAnimateAtt
+ break;
+
+ default:
+- dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() );
++ dump( " unknown_atom=\"%d\"", (sal_Int32)pChildAtom->getType() );
+ break;
+ }
+
+@@ -1889,17 +1893,17 @@ Any AnimationImporter::implGetColorAny(
+ {
+ case 0: // rgb
+ {
+- dump( "rgb(%ld", nA );
+- dump( ",%ld", nB );
+- dump( ",%ld)", nC );
++ dump( "rgb(%d", nA );
++ dump( ",%d", nB );
++ dump( ",%d)", nC );
+ Color aColor( (UINT8)nA, (UINT8)nB, (UINT8)nC );
+ return makeAny( (sal_Int32)aColor.GetRGBColor() );
+ }
+ case 1: // hsl
+ {
+- dump( "hsl(%ld", nA );
+- dump( ",%ld", nB );
+- dump( ",%ld)", nC );
++ dump( "hsl(%d", nA );
++ dump( ",%d", nB );
++ dump( ",%d)", nC );
+ Sequence< double > aHSL( 3 );
+ aHSL[0] = nA * 360.0/255.0;
+ aHSL[1] = nB / 255.0;
+@@ -1911,19 +1915,19 @@ Any AnimationImporter::implGetColorAny(
+ {
+ Color aColor;
+ mpPPTImport->GetColorFromPalette((USHORT)nA, aColor );
+- dump( "index(%ld", nA );
+- dump( " [%ld", (sal_Int32)aColor.GetRed() );
+- dump( ",%ld", (sal_Int32)aColor.GetGreen() );
+- dump( ",%ld])", (sal_Int32)aColor.GetBlue() );
++ dump( "index(%d", nA );
++ dump( " [%d", (sal_Int32)aColor.GetRed() );
++ dump( ",%d", (sal_Int32)aColor.GetGreen() );
++ dump( ",%d])", (sal_Int32)aColor.GetBlue() );
+ return makeAny( (sal_Int32)aColor.GetRGBColor() );
+ }
+
+ default:
+ {
+- dump( "unknown_%ld(", nMode );
+- dump( "%ld", nA );
+- dump( ",%ld", nB );
+- dump( ",%ld)", nC );
++ dump( "unknown_%d(", nMode );
++ dump( "%d", nA );
++ dump( ",%d", nB );
++ dump( ",%d)", nC );
+ DBG_ERROR( "ppt::implGetColorAny(), unhandled color type" );
+
+ Any aAny;
+@@ -1993,7 +1997,7 @@ void AnimationImporter::importAnimateCol
+ break;
+
+ default:
+- dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() );
++ dump( " unknown_atom=\"%d\"", (sal_Int32)pChildAtom->getType() );
+ break;
+ }
+
+@@ -2028,8 +2032,8 @@ void AnimationImporter::importAnimateSet
+ sal_Int32 nU1, nU2;
+ mrStCtrl >> nU1 >> nU2;
+
+- dump( " set_1=\"%ld\"", nU1 ),
+- dump( " set_2=\"%ld\"", nU2 );
++ dump( " set_1=\"%d\"", nU1 ),
++ dump( " set_2=\"%d\"", nU2 );
+ }
+ break;
+
+@@ -2052,7 +2056,7 @@ void AnimationImporter::importAnimateSet
+ break;
+
+ default:
+- dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() );
++ dump( " unknown_atom=\"%d\"", (sal_Int32)pChildAtom->getType() );
+ break;
+ }
+
+@@ -2131,7 +2135,7 @@ void AnimationImporter::importAnimateCon
+ }
+ break;
+ default:
+- dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() );
++ dump( " unknown_atom=\"%d\"", (sal_Int32)pChildAtom->getType() );
+ break;
+ }
+
+@@ -2210,7 +2214,7 @@ void AnimationImporter::importAnimateMot
+ break;
+
+ default:
+- dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() );
++ dump( " unknown_atom=\"%d\"", (sal_Int32)pChildAtom->getType() );
+ break;
+ }
+
+@@ -2276,7 +2280,7 @@ void AnimationImporter::importCommandCon
+ break;
+
+ default:
+- dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() );
++ dump( " unknown_atom=\"%d\"", (sal_Int32)pChildAtom->getType() );
+ break;
+ }
+
+@@ -2410,7 +2414,7 @@ void AnimationImporter::importAudioConta
+ break;
+
+ default:
+- dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() );
++ dump( " unknown_atom=\"%d\"", (sal_Int32)pChildAtom->getType() );
+ break;
+ }
+
+@@ -2516,7 +2520,7 @@ void AnimationImporter::importAnimateSca
+ break;
+
+ default:
+- dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() );
++ dump( " unknown_atom=\"%d\"", (sal_Int32)pChildAtom->getType() );
+ break;
+ }
+
+@@ -2576,7 +2580,7 @@ void AnimationImporter::importAnimateRot
+ fprintf( mpFile, " to=\"%g\"", (double)fTo );
+
+ if( nU1 )
+- fprintf( mpFile, " rotation_1=\"%ld\"", nU1 );
++ fprintf( mpFile, " rotation_1=\"%d\"", nU1 );
+ #endif
+ }
+ break;
+@@ -2586,7 +2590,7 @@ void AnimationImporter::importAnimateRot
+ break;
+
+ default:
+- dump( " unknown_atom=\"%ld\"", (sal_Int32)pChildAtom->getType() );
++ dump( " unknown_atom=\"%d\"", (sal_Int32)pChildAtom->getType() );
+ break;
+ }
+
+@@ -2690,7 +2694,7 @@ void AnimationImporter::importAnimationV
+ sal_Int32 nAutoreverse;
+ mrStCtrl >> nAutoreverse;
+ xNode->setAutoReverse( nAutoreverse != 0 );
+- dump( " autoreverse=\"%#lx\"", nAutoreverse );
++ dump( " autoreverse=\"%#x\"", nAutoreverse );
+ }
+ break;
+
+@@ -2699,7 +2703,7 @@ void AnimationImporter::importAnimationV
+ sal_uInt32 nUnknown;
+ mrStCtrl >> nUnknown;
+ #ifdef DBG_ANIM_LOG
+- fprintf(mpFile, " attribute_%d=\"%#lx\"", nType, nUnknown );
++ fprintf(mpFile, " attribute_%d=\"%#x\"", nType, nUnknown );
+ #endif
+ }
+ break;
+@@ -2822,7 +2826,7 @@ void AnimationImporter::importAnimateKey
+ else if( aValuePair.First >>= nVal )
+ dump( "%f", nVal );
+ else
+- dump( "%X", (sal_Int32)&aValuePair.First );
++ dump( "unknown" );
+
+ if( aValuePair.Second >>= aStr )
+ dump( ",%s",
+@@ -2831,7 +2835,7 @@ void AnimationImporter::importAnimateKey
+ else if( aValuePair.Second >>= nVal )
+ dump( ",%f", nVal );
+ else
+- dump( ",%X", (sal_Int32)&aValuePair.Second );
++ dump( ",unknown" );
+ }
+ }
+ }
+@@ -3071,8 +3075,8 @@ void AnimationImporter::importAnimationA
+ dump( " endSync=\"%s\"", nEndSync == 1 ? "all" : "unknown" );
+ }
+
+- dump( " action_4=\"%#lx\"", nU4 );
+- dump( " action_5=\"%#lx\"", nU5 );
++ dump( " action_4=\"%#x\"", nU4 );
++ dump( " action_5=\"%#x\"", nU5 );
+ #endif
+ }
+ }
+@@ -3187,8 +3191,8 @@ sal_Int32 AnimationImporter::importTarge
+ #ifdef DBG_ANIM_LOG
+ if((begin != -1) || (end != -1) )
+ {
+-// dump( " text_begin=\"%ld\"", begin );
+-// dump( " text_end=\"%ld\"", end );
++// dump( " text_begin=\"%d\"", begin );
++// dump( " text_end=\"%d\"", end );
+ }
+ #endif
+ }
+@@ -3199,7 +3203,7 @@ sal_Int32 AnimationImporter::importTarge
+ mrStCtrl >> nU1;
+
+ // HINT: nU1 == 1 : target document. ?
+-// dump( " unknown_0x2b01=\"%#lx\"", nU1 );
++// dump( " unknown_0x2b01=\"%#x\"", nU1 );
+ }
+ break;
+ default:
+@@ -3310,7 +3314,7 @@ void AnimationImporter::dump_atom_header
+
+ void AnimationImporter::dump( UINT32 nLen, bool bNewLine )
+ {
+- char * faul = "0123456789abcdef";
++ const char * faul = "0123456789abcdef";
+
+ UINT32 i = 0;
+ int b = 0;
+@@ -3357,7 +3361,7 @@ void AnimationImporter::dump_atom( const
+
+ if( aValue >>= nInt )
+ {
+- fprintf(mpFile, " value=\"%ld\"", nInt );
++ fprintf(mpFile, " value=\"%d\"", nInt );
+ }
+ else if( aValue >>= aString )
+ {
+@@ -3437,7 +3441,7 @@ void AnimationImporter::dump_anim_group(
+ break;
+ default:
+ {
+- fprintf( mpFile, "unknown_node_%#lx", rNode.mnNodeType );
++ fprintf( mpFile, "unknown_node_%#x", rNode.mnNodeType );
+ }
+ break;
+ }
+@@ -3446,7 +3450,7 @@ void AnimationImporter::dump_anim_group(
+ fprintf( mpFile, "media" );
+ break;
+ default:
+- fprintf( mpFile, "unknown_group_%#lx", rNode.mnGroupType );
++ fprintf( mpFile, "unknown_group_%#x", rNode.mnGroupType );
+ break;
+ }
+
+@@ -3485,9 +3489,9 @@ void AnimationImporter::dump( const Anim
+ fprintf(mpFile, " dur=\"indefinite\"" );
+ }
+
+- if( rNode.mnU1 ) fprintf(mpFile," u1=\"%#lx\"", rNode.mnU1);
+- if( rNode.mnU3 ) fprintf(mpFile," u3=\"%#lx\"", rNode.mnU3);
+- if( rNode.mnU4 ) fprintf(mpFile," u4=\"%#lx\"", rNode.mnU4);
++ if( rNode.mnU1 ) fprintf(mpFile," u1=\"%#x\"", rNode.mnU1);
++ if( rNode.mnU3 ) fprintf(mpFile," u3=\"%#x\"", rNode.mnU3);
++ if( rNode.mnU4 ) fprintf(mpFile," u4=\"%#x\"", rNode.mnU4);
+ }
+
+ void AnimationImporter::dump( Any& rAny )
+@@ -3519,7 +3523,7 @@ void AnimationImporter::dump( Any& rAny
+ }
+ else if( rAny >>= nInt )
+ {
+- fprintf( mpFile, "%ld", nInt );
++ fprintf( mpFile, "%d", nInt );
+ }
+ else if( rAny >>= bBool )
+ {
+@@ -3638,7 +3642,7 @@ void AnimationImporter::dump( const Prop
+ sal_Int32 nPresetId ;
+ if( aAny >>= nPresetId )
+ {
+- fprintf(mpFile, " presetid=\"%ld\"", nPresetId );
++ fprintf(mpFile, " presetid=\"%d\"", nPresetId );
+ bKnown = true;
+ }
+ }
+@@ -3649,7 +3653,7 @@ void AnimationImporter::dump( const Prop
+ sal_Int32 nPointsType ;
+ if( aAny >>= nPointsType )
+ {
+- fprintf(mpFile, " presetSubType=\"%ld\"", nPointsType );
++ fprintf(mpFile, " presetSubType=\"%d\"", nPointsType );
+ bKnown = true;
+ }
+ }
+@@ -3673,7 +3677,7 @@ void AnimationImporter::dump( const Prop
+ default:
+ {
+ static char buffer[128];
+- sprintf( buffer, "%ld", nPresetClass );
++ sprintf( buffer, "%d", nPresetClass );
+ pMode = buffer;
+ }
+ break;
+@@ -3702,7 +3706,7 @@ void AnimationImporter::dump( const Prop
+ default :
+ {
+ static char buffer[128];
+- sprintf( buffer, "%ld", nNodeType );
++ sprintf( buffer, "%d", nNodeType );
+ pNode = buffer;
+ }
+ break;
+@@ -3719,7 +3723,7 @@ void AnimationImporter::dump( const Prop
+ sal_Int32 nGroupId;
+ if ( aAny >>= nGroupId )
+ {
+- fprintf( mpFile, " groupId=\"%ld\"", nGroupId );
++ fprintf( mpFile, " groupId=\"%d\"", nGroupId );
+ bKnown = true;
+ }
+ }
+@@ -3756,7 +3760,7 @@ void AnimationImporter::dump( const Prop
+ sal_Int32 nEndAfterSlide;
+ if( aAny >>= nEndAfterSlide )
+ {
+- fprintf(mpFile, " endAfterSlide=\"%ld\"", nEndAfterSlide );
++ fprintf(mpFile, " endAfterSlide=\"%d\"", nEndAfterSlide );
+ bKnown = true;
+ }
+ }
+@@ -3814,7 +3818,7 @@ void AnimationImporter::dump( const Prop
+
+ if( !bKnown )
+ {
+- fprintf( mpFile, " unknown_%lu=\"", nInstance );
++ fprintf( mpFile, " unknown_%u=\"", nInstance );
+ dump( aAny );
+ fprintf( mpFile, "\"" );
+ }
+Only in sd/source/filter/ppt: pptinanimations.cxx~
+diff -rup sd-orig/source/filter/ppt/pptinanimations.hxx sd/source/filter/ppt/pptinanimations.hxx
+--- sd-orig/source/filter/ppt/pptinanimations.hxx 2009-09-28 11:30:35.000000000 +0200
++++ sd/source/filter/ppt/pptinanimations.hxx 2009-09-30 18:17:05.000000000 +0200
+@@ -61,11 +61,11 @@ class AnimationImporter
+ public:
+ AnimationImporter( ImplSdPPTImport* pPPTImport, SvStream& rStCtrl );
+
+- void import( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xPage, const DffRecordHeader& rProgTagContentHd );
++ void import( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xPage, const DffRecordHeader& rProgTagContentHd, bool& bAfterSound );
+
+ private:
+- void importAnimationContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xParent );
+- void importTimeContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
++ void importAnimationContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xParent, bool& bAfterSound );
++ void importTimeContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode, bool& bAfterSound );
+ void importAnimationNodeContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
+ void importAnimationSubContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
+
+@@ -90,7 +90,7 @@ private:
+ bool importAttributeNamesContainer( const Atom* pAtom, rtl::OUString& rAttributeNames );
+ sal_Int32 importTargetElementContainer( const Atom* pAtom, ::com::sun::star::uno::Any& rTarget, sal_Int16& nSubType );
+
+- void fillNode( ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xTiming, const AnimationNode& rNode, const PropertySet& rSet );
++ void fillNode( ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xTiming, const AnimationNode& rNode, PropertySet& rSet, bool& bAfterEffect );
+ ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > createNode( const Atom* pAtom, const AnimationNode& rNode );
+
+ bool convertAnimationNode( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xParent );
+Only in sd/source/filter/ppt: pptinanimations.hxx~
+diff -rup sd-orig/source/filter/ppt/pptin.cxx sd/source/filter/ppt/pptin.cxx
+--- sd-orig/source/filter/ppt/pptin.cxx 2009-09-28 11:30:35.000000000 +0200
++++ sd/source/filter/ppt/pptin.cxx 2009-10-05 12:24:20.000000000 +0200
+@@ -256,6 +256,8 @@ sal_Bool ImplSdPPTImport::Import()
+ if ( !bOk )
+ return FALSE;
+
++ bool bAfterSound = false;
++
+ pSdrModel->setLock( sal_True );
+ SdrOutliner& rOutl = mpDoc->GetDrawOutliner();
+ sal_uInt32 nControlWord = rOutl.GetEditEngine().GetControlWord();
+@@ -841,7 +843,7 @@ sal_Bool ImplSdPPTImport::Import()
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xPage( pMPage->getUnoPage(), ::com::sun::star::uno::UNO_QUERY );
+ ppt::AnimationImporter aImporter( this, rStCtrl );
+- aImporter.import( xPage, aProgTagContentHd );
++ aImporter.import( xPage, aProgTagContentHd, bAfterSound );
+ bNewAnimationsUsed = sal_True;
+ }
+ break;
+@@ -974,7 +976,7 @@ sal_Bool ImplSdPPTImport::Import()
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xPage( pPage->getUnoPage(), ::com::sun::star::uno::UNO_QUERY );
+ ppt::AnimationImporter aImporter( this, rStCtrl );
+- aImporter.import( xPage, aProgTagContentHd );
++ aImporter.import( xPage, aProgTagContentHd, bAfterSound );
+ bNewAnimationsUsed = sal_True;
+ }
+ break;
+@@ -1810,7 +1812,7 @@ void ImplSdPPTImport::ImportPageEffect(
+
+ if ( nBuildFlags & 0x400 ) // slidechange by time
+ { // Standzeit (in Ticks)
+- pPage->SetPresChange( PRESCHANGE_AUTO );
++ pPage->SetPresChange( PRESCHANGE_AUTO_PPT );
+ pPage->SetTime( nSlideTime / 1000 );
+ }
+ else
+@@ -2022,7 +2024,7 @@ String ImplSdPPTImport::ReadSound(UINT32
+ //
+ //////////////////////////////////////////////////////////////////////////
+
+-String ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef ) const
++String ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef, bool& o_bLoop ) const
+ {
+ String aRetVal;
+ DffRecordHeader* pHd( const_cast<ImplSdPPTImport*>(this)->aDocRecManager.GetRecordHeader( PPT_PST_ExObjList, SEEK_FROM_BEGINNING ) );
+@@ -2035,6 +2037,28 @@ String ImplSdPPTImport::ReadMedia( sal_u
+ rStCtrl >> aHdMovie;
+ switch( aHdMovie.nRecType )
+ {
++ case DFF_PST_ExWAVAudioEmbedded :
++ {
++ DffRecordHeader aExMediaAtomHd;
++ if ( SeekToRec( rStCtrl, DFF_PST_ExMediaAtom, aHdMovie.GetRecEndFilePos(), &aExMediaAtomHd ) )
++ {
++ sal_uInt32 nRef, bLoop=0;
++ rStCtrl >> nRef >> bLoop;
++ if ( nRef == nMediaRef )
++ {
++ DffRecordHeader aExWaveAudioAtomHd;
++ if ( SeekToRec( rStCtrl, DFF_PST_ExWAVAudioEmbeddedAtom, aExMediaAtomHd.GetRecEndFilePos(), &aExWaveAudioAtomHd ) )
++ {
++ sal_uInt32 nSndId;
++ rStCtrl >> nSndId;
++ o_bLoop = bLoop != 0;
++
++ return ReadSound(nSndId);
++ }
++ }
++ }
++ break;
++ }
+ case PPT_PST_ExAviMovie :
+ case PPT_PST_ExMCIMovie :
+ {
+@@ -2600,6 +2624,7 @@ SdrObject* ImplSdPPTImport::ProcessObj(
+ while( TRUE )
+ {
+ UINT32 nClientDataLen = rHdClientData.GetRecEndFilePos();
++ sal_uInt32 nSlideCount = 1;
+ DffRecordHeader aHd;
+ do
+ {
+@@ -2650,6 +2675,9 @@ SdrObject* ImplSdPPTImport::ProcessObj(
+
+ bAnimationInfoFound = TRUE;
+ }
++ if( pAnimation->GetSlidesCount() > 1 )
++ nSlideCount = pAnimation->GetSlidesCount();
++
+ }
+ }
+ break;
+@@ -2678,14 +2706,18 @@ SdrObject* ImplSdPPTImport::ProcessObj(
+ DffRecordHeader aObjRefAtomHd;
+ if ( SeekToRec( rSt, PPT_PST_ExObjRefAtom, nHdRecEnd, &aObjRefAtomHd ) )
+ {
++ bool bLoop=false;
+ sal_uInt32 nRef;
+ rSt >> nRef;
+- String aMediaURL( ReadMedia( nRef ) );
++ String aMediaURL( ReadMedia( nRef, bLoop ) );
+ if ( !aMediaURL.Len() )
+ aMediaURL = ReadSound( nRef );
+ if ( aMediaURL.Len() )
+ {
+ SdrMediaObj* pMediaObj = new SdrMediaObj( pObj->GetSnapRect() );
++ if( nSlideCount > 1 && pMediaObj )
++ pMediaObj->setSlidesNumber( nSlideCount );
++
+ pMediaObj->SetModel( pObj->GetModel() );
+ pMediaObj->SetMergedItemSet( pObj->GetMergedItemSet() );
+
+Only in sd/source/filter/ppt: pptin.cxx~
+diff -rup sd-orig/source/filter/ppt/pptin.hxx sd/source/filter/ppt/pptin.hxx
+--- sd-orig/source/filter/ppt/pptin.hxx 2009-09-28 11:30:35.000000000 +0200
++++ sd/source/filter/ppt/pptin.hxx 2009-09-28 11:30:59.000000000 +0200
+@@ -85,7 +85,7 @@ class ImplSdPPTImport : public SdrPowerP
+ public:
+
+ String ReadSound( sal_uInt32 nSoundRef ) const;
+- String ReadMedia( sal_uInt32 nMediaRef ) const;
++ String ReadMedia( sal_uInt32 nMediaRef, bool& o_bLoop ) const;
+
+ ImplSdPPTImport( SdDrawDocument* pDoc, SvStorage& rStorage, SfxMedium& rMed, PowerPointImportParam& );
+ ~ImplSdPPTImport();
diff --git a/patches/dev300/slideshow-sound.diff b/patches/dev300/slideshow-sound.diff
new file mode 100644
index 0000000..8fd8feb
--- /dev/null
+++ b/patches/dev300/slideshow-sound.diff
@@ -0,0 +1,353 @@
+diff -rup slideshow-orig/source/engine/shapes/mediashape.cxx slideshow/source/engine/shapes/mediashape.cxx
+--- slideshow-orig/source/engine/shapes/mediashape.cxx 2009-09-30 16:38:08.000000000 +0200
++++ slideshow/source/engine/shapes/mediashape.cxx 2009-10-05 12:24:37.000000000 +0200
+@@ -101,6 +101,8 @@ namespace slideshow
+ virtual bool implIsIntrinsicAnimationPlaying() const;
+ virtual void implSetIntrinsicAnimationTime(double);
+
++ sal_uInt16 getSlidesNumber();
++
+ /// the list of active view shapes (one for each registered view layer)
+ typedef ::std::vector< ViewMediaShapeSharedPtr > ViewMediaShapeVector;
+ ViewMediaShapeVector maViewMediaShapes;
+@@ -117,6 +119,17 @@ namespace slideshow
+ {
+ }
+
++ sal_uInt16 MediaShape::getSlidesNumber()
++ {
++ uno::Reference< beans::XPropertySet > xPropSet( getXShape(), uno::UNO_QUERY );
++ sal_uInt16 nSlidesNumber = 1;
++
++ if( xPropSet.is() )
++ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaSlidesNumber" ) ) ) >>= nSlidesNumber;
++
++ return nSlidesNumber;
++ }
++
+ // ---------------------------------------------------------------------
+
+ void MediaShape::implViewChanged( const UnoViewSharedPtr& rView )
+@@ -202,7 +215,8 @@ namespace slideshow
+
+ bool MediaShape::clearAllViewLayers()
+ {
+- maViewMediaShapes.clear();
++ if( getSlidesNumber() <= 1 )
++ maViewMediaShapes.clear();
+ return true;
+ }
+
+@@ -244,11 +258,13 @@ namespace slideshow
+
+ bool MediaShape::implEndIntrinsicAnimation()
+ {
+- ::std::for_each( maViewMediaShapes.begin(),
+- maViewMediaShapes.end(),
+- ::boost::mem_fn( &ViewMediaShape::endMedia ) );
++ if( getSlidesNumber() <= 1 ) {
++ ::std::for_each( maViewMediaShapes.begin(),
++ maViewMediaShapes.end(),
++ ::boost::mem_fn( &ViewMediaShape::endMedia ) );
+
+- mbIsPlaying = false;
++ mbIsPlaying = false;
++ }
+
+ return true;
+ }
+Only in slideshow/source/engine/shapes: mediashape.cxx~
+diff -rup slideshow-orig/source/engine/slide/layermanager.cxx slideshow/source/engine/slide/layermanager.cxx
+--- slideshow-orig/source/engine/slide/layermanager.cxx 2009-09-30 16:38:08.000000000 +0200
++++ slideshow/source/engine/slide/layermanager.cxx 2009-10-09 14:38:59.000000000 +0200
+@@ -295,6 +295,28 @@ namespace slideshow
+ implAddShape( rShape );
+ }
+
++ void LayerManager::findPersistentMediaShapes( ShapeList& rList )
++ {
++ for( XShapeHash::iterator it = maXShapeHash.begin(); it != maXShapeHash.end(); it ++) {
++ uno::Reference< beans::XPropertySet > xPropSet( (*it).first, uno::UNO_QUERY );
++ if( xPropSet.is() ) {
++ sal_uInt16 nSlidesNumber = 1;
++
++ try {
++ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaSlidesNumber" ) ) ) >>= nSlidesNumber;
++
++ if( nSlidesNumber > 1 ) {
++ ShapeRefSharedPtr pShapeRef( new ShapeRef() );
++
++ pShapeRef->pShape = (*it).second;
++ pShapeRef->nSlidesNumber = nSlidesNumber;
++ rList.push_back( pShapeRef );
++ }
++ } catch( uno::Exception& ) {}
++ }
++ }
++ }
++
+ void LayerManager::putShape2BackgroundLayer( LayerShapeMap::value_type& rShapeEntry )
+ {
+ LayerSharedPtr& rBgLayer( maLayers.front() );
+Only in slideshow/source/engine/slide: layermanager.cxx~
+diff -rup slideshow-orig/source/engine/slide/layermanager.hxx slideshow/source/engine/slide/layermanager.hxx
+--- slideshow-orig/source/engine/slide/layermanager.hxx 2009-09-30 16:38:08.000000000 +0200
++++ slideshow/source/engine/slide/layermanager.hxx 2009-10-08 16:05:27.000000000 +0200
+@@ -147,6 +147,10 @@ namespace slideshow
+ ShapeSharedPtr lookupShape( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape >& xShape ) const;
+
++ /** lookup persistent media shapes
++ */
++ void findPersistentMediaShapes( ShapeList& rList );
++
+ /** Query a subset of the given original shape
+
+ This method queries a new (but not necessarily unique)
+Only in slideshow/source/engine/slide: layermanager.hxx~
+diff -rup slideshow-orig/source/engine/slide/slideimpl.cxx slideshow/source/engine/slide/slideimpl.cxx
+--- slideshow-orig/source/engine/slide/slideimpl.cxx 2009-09-30 16:38:08.000000000 +0200
++++ slideshow/source/engine/slide/slideimpl.cxx 2009-10-08 18:28:23.000000000 +0200
+@@ -142,6 +142,7 @@ public:
+ // but on canvas-independent basegfx bitmaps
+ virtual SlideBitmapSharedPtr getCurrentSlideBitmap( const UnoViewSharedPtr& rView ) const;
+
++ virtual void findPersistentMediaShapes( ShapeList& rList );
+
+ private:
+ // ViewEventHandler
+@@ -1212,5 +1213,27 @@ SlideSharedPtr createSlide( const uno::R
+ return pRet;
+ }
+
++void SlideImpl::findPersistentMediaShapes( ShapeList& rList )
++{
++ if( mpLayerManager ) {
++ ShapeList aList;
++ mpLayerManager->findPersistentMediaShapes( aList );
++
++ uno::Reference< beans::XPropertySet > xPropSet( mxDrawPage, uno::UNO_QUERY_THROW );
++ sal_Int16 nPageNumber = 0;
++ if( xPropSet.is() ) {
++ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Number" ) ) ) >>= nPageNumber;
++ }
++
++ for( ShapeList::iterator it = aList.begin(); it != aList.end(); it++ ) {
++ ShapeRefSharedPtr pShapeRef = *it;
++
++ pShapeRef->nPageNumber = nPageNumber;
++ }
++
++ rList.merge( aList );
++ }
++}
++
+ } // namespace internal
+ } // namespace slideshow
+Only in slideshow/source/engine/slide: slideimpl.cxx~
+diff -rup slideshow-orig/source/engine/slideshowimpl.cxx slideshow/source/engine/slideshowimpl.cxx
+--- slideshow-orig/source/engine/slideshowimpl.cxx 2009-09-30 16:38:08.000000000 +0200
++++ slideshow/source/engine/slideshowimpl.cxx 2009-10-09 14:39:41.000000000 +0200
+@@ -340,6 +340,8 @@ private:
+ private: SlideShowImpl& mrSlideShowImpl;
+ };
+
++ // update persistent media shapes after current slide changes
++ void updateMediaShapes();
+
+ /// Filter requested cursor shape against hard slideshow cursors (wait, etc.)
+ sal_Int16 calcActiveCursor( sal_Int16 nCursorShape ) const;
+@@ -365,6 +367,7 @@ private:
+ boost::optional<double> maUserPaintStrokeWidth;
+
+ boost::shared_ptr<canvas::tools::ElapsedTime> mpPresTimer;
++ boost::shared_ptr<canvas::tools::ElapsedTime> mpAdvanceTimer;
+ ScreenUpdater maScreenUpdater;
+ EventQueue maEventQueue;
+ EventMultiplexer maEventMultiplexer;
+@@ -408,6 +411,9 @@ private:
+ bool mbDisableAnimationZOrder;
+
+ EffectRewinder maEffectRewinder;
++
++ // list of persisten media shapes
++ ShapeList maMediaShapes;
+ };
+
+
+@@ -480,6 +486,7 @@ SlideShowImpl::SlideShowImpl(
+ maUserPaintColor(),
+ maUserPaintStrokeWidth(4.0),
+ mpPresTimer( new canvas::tools::ElapsedTime ),
++ mpAdvanceTimer( new canvas::tools::ElapsedTime ),
+ maScreenUpdater(maViewContainer),
+ maEventQueue( mpPresTimer ),
+ maEventMultiplexer( maEventQueue,
+@@ -550,6 +557,9 @@ void SlideShowImpl::disposing()
+ osl::MutexGuard const guard( m_aMutex );
+
+ maEffectRewinder.dispose();
++
++ // drop all references to persistent media shapes
++ maMediaShapes.clear();
+
+ // stop slide transition sound, if any:
+ stopSlideTransitionSound();
+@@ -949,6 +959,33 @@ private:
+ bool& mrbSkipSlideTransition;
+ };
+
++class media_shape_ptr_is_empty
++{
++public:
++ bool operator() (const ShapeRefSharedPtr& value) { return !value->pShape.get(); }
++};
++
++void SlideShowImpl::updateMediaShapes()
++{
++ mpCurrentSlide->findPersistentMediaShapes( maMediaShapes );
++
++ uno::Reference<beans::XPropertySet> xPropSet( mpCurrentSlide->getXDrawPage(), uno::UNO_QUERY );
++ if( xPropSet.is() ) {
++ sal_Int16 nPageNumber;
++ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Number" ) ) ) >>= nPageNumber;
++
++ for( ShapeList::iterator it = maMediaShapes.begin(); it != maMediaShapes.end(); it++ ) {
++ ShapeRefSharedPtr pShapeRef = *it;
++
++ if( nPageNumber >= pShapeRef->nPageNumber + pShapeRef->nSlidesNumber )
++ pShapeRef->pShape.reset();
++ }
++
++
++ maMediaShapes.remove_if( media_shape_ptr_is_empty() );
++ }
++}
++
+ void SlideShowImpl::displaySlide(
+ uno::Reference<drawing::XDrawPage> const& xSlide,
+ uno::Reference<animations::XAnimationNode> const& xRootNode,
+@@ -991,6 +1028,8 @@ void SlideShowImpl::displaySlide(
+ mpPreviousSlide = mpCurrentSlide;
+ mpCurrentSlide.reset();
+
++ mpAdvanceTimer->reset();
++
+ if (matches( mpPrefetchSlide, xSlide, xRootNode ))
+ {
+ // prefetched slide matches:
+@@ -1004,6 +1043,8 @@ void SlideShowImpl::displaySlide(
+ OSL_ASSERT( mpCurrentSlide );
+ if (mpCurrentSlide)
+ {
++ updateMediaShapes();
++
+ basegfx::B2DSize oldSlideSize;
+ if( mpPreviousSlide )
+ oldSlideSize = mpPreviousSlide->getSlideSize();
+@@ -1834,6 +1875,8 @@ void SlideShowImpl::notifySlideTransitio
+ "notifySlideTransitionEnded(): Invalid current slide" );
+ if (mpCurrentSlide)
+ {
++ mpAdvanceTimer->adjustTimer( -mpAdvanceTimer->getElapsedTime() / 2 );
++
+ // first init show, to give the animations
+ // the chance to register SlideStartEvents
+ const bool bBackgroundLayerRendered( !bPaintSlide );
+@@ -1844,7 +1887,8 @@ void SlideShowImpl::notifySlideTransitio
+
+ void queryAutomaticSlideTransition( uno::Reference<drawing::XDrawPage> const& xDrawPage,
+ double& nAutomaticNextSlideTimeout,
+- bool& bHasAutomaticNextSlide )
++ bool& bHasAutomaticNextSlide,
++ bool& bFromStart )
+ {
+ // retrieve slide change parameters from XDrawPage
+ // ===============================================
+@@ -1864,7 +1908,8 @@ void queryAutomaticSlideTransition( uno:
+ "Could not extract slide change mode from XDrawPage - assuming <none>\n" );
+ }
+
+- bHasAutomaticNextSlide = nChange == 1;
++ bHasAutomaticNextSlide = nChange == 1 || nChange == 3;
++ bFromStart = nChange == 3;
+
+ if( !xPropSet.is() ||
+ !getPropertyValue( nAutomaticNextSlideTimeout,
+@@ -1906,10 +1951,12 @@ void SlideShowImpl::notifySlideAnimation
+ "notifySlideAnimationsEnded(): Invalid current slide!" );
+
+ bool bHasAutomaticNextSlide=false;
++ bool bFromStart=false;
+ double nAutomaticNextSlideTimeout=0.0;
+ queryAutomaticSlideTransition(mpCurrentSlide->getXDrawPage(),
+ nAutomaticNextSlideTimeout,
+- bHasAutomaticNextSlide);
++ bHasAutomaticNextSlide,
++ bFromStart);
+
+ // check whether slide transition should happen
+ // 'automatically'. If yes, simply schedule the
+@@ -1921,6 +1968,14 @@ void SlideShowImpl::notifySlideAnimation
+ !mpRehearseTimingsActivity &&
+ bHasAutomaticNextSlide )
+ {
++ if( bFromStart ) {
++ double nCurrentTime = mpAdvanceTimer->getElapsedTime();
++ if( nAutomaticNextSlideTimeout > nCurrentTime )
++ nAutomaticNextSlideTimeout -= nCurrentTime;
++ else
++ nAutomaticNextSlideTimeout = 0;
++ }
++
+ aNotificationEvents = makeInterruptableDelay(
+ boost::bind( &SlideShowImpl::notifySlideEnded, this, false ),
+ nAutomaticNextSlideTimeout);
+diff -rup slideshow-orig/source/inc/shape.hxx slideshow/source/inc/shape.hxx
+--- slideshow-orig/source/inc/shape.hxx 2009-09-30 16:38:08.000000000 +0200
++++ slideshow/source/inc/shape.hxx 2009-10-09 10:00:39.000000000 +0200
+@@ -41,6 +41,7 @@
+
+ #include <boost/shared_ptr.hpp>
+ #include <boost/noncopyable.hpp>
++#include <list>
+ #include <set>
+ #include <vector>
+
+@@ -57,6 +58,15 @@ namespace slideshow
+
+ typedef ::boost::shared_ptr< Shape > ShapeSharedPtr;
+
++ struct ShapeRef
++ {
++ ShapeSharedPtr pShape;
++ sal_Int16 nPageNumber;
++ sal_uInt16 nSlidesNumber;
++ };
++ typedef ::boost::shared_ptr< ShapeRef > ShapeRefSharedPtr;
++ typedef ::std::list< ShapeRefSharedPtr > ShapeList;
++
+ /** Represents a slide's shape object.
+
+ This interface represents the view-independent aspects of a
+Only in slideshow/source/inc: shape.hxx~
+diff -rup slideshow-orig/source/inc/slide.hxx slideshow/source/inc/slide.hxx
+--- slideshow-orig/source/inc/slide.hxx 2009-09-30 16:38:08.000000000 +0200
++++ slideshow/source/inc/slide.hxx 2009-10-08 16:16:17.000000000 +0200
+@@ -35,6 +35,7 @@
+ #include "subsettableshapemanager.hxx"
+ #include "unoviewcontainer.hxx"
+ #include "slidebitmap.hxx"
++#include "shape.hxx"
+ #include "shapemaps.hxx"
+
+ #include <boost/shared_ptr.hpp>
+@@ -117,6 +118,8 @@ namespace slideshow
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::animations::XAnimationNode > getXAnimationNode() const = 0;
+
++ // get persistent media shapes
++ virtual void findPersistentMediaShapes( ShapeList& rList ) = 0;
+
+ // Slide bitmaps
+ // -------------------------------------------------------------------
diff --git a/patches/dev300/svx-sound.diff b/patches/dev300/svx-sound.diff
new file mode 100644
index 0000000..dee2a2a
--- /dev/null
+++ b/patches/dev300/svx-sound.diff
@@ -0,0 +1,140 @@
+diff -rup svx-orig/inc/svx/svdomedia.hxx svx/inc/svx/svdomedia.hxx
+--- svx-orig/inc/svx/svdomedia.hxx 2009-10-04 23:14:33.000000000 +0200
++++ svx/inc/svx/svdomedia.hxx 2009-10-05 11:24:04.000000000 +0200
+@@ -71,6 +71,9 @@ public:
+ void setURL( const ::rtl::OUString& rURL );
+ const ::rtl::OUString& getURL() const;
+
++ void setSlidesNumber( sal_uInt16 nSlidesNumber );
++ sal_uInt16 getSlidesNumber() const;
++
+ void setMediaProperties( const ::avmedia::MediaItem& rState );
+ const ::avmedia::MediaItem& getMediaProperties() const;
+
+@@ -90,6 +93,8 @@ private:
+
+ ::avmedia::MediaItem maMediaProperties;
+ ::std::auto_ptr< Graphic > mapGraphic;
++
++ sal_uInt16 mnSlidesNumber;
+ };
+
+ #endif //_SVDOMEDIA_HXX
+Only in svx/inc/svx: svdomedia.hxx~
+diff -rup svx-orig/inc/svx/unoshprp.hxx svx/inc/svx/unoshprp.hxx
+--- svx-orig/inc/svx/unoshprp.hxx 2009-10-04 23:14:33.000000000 +0200
++++ svx/inc/svx/unoshprp.hxx 2009-10-05 11:35:59.000000000 +0200
+@@ -194,6 +194,8 @@
+
+ #define OWN_ATTR_EDGE_POLYPOLYGONBEZIER (OWN_ATTR_VALUE_START+88)
+
++#define OWN_ATTR_MEDIA_SLIDES_NUMBER (OWN_ATTR_VALUE_START+89)
++
+ #define OWN_ATTR_VALUE_END OWN_ATTR_EDGE_POLYPOLYGONBEZIER // WARNING: ee items start at 3991!
+
+ // #FontWork#
+Only in svx/inc/svx: unoshprp.hxx~
+diff -rup svx-orig/source/svdraw/svdomedia.cxx svx/source/svdraw/svdomedia.cxx
+--- svx-orig/source/svdraw/svdomedia.cxx 2009-10-04 23:14:34.000000000 +0200
++++ svx/source/svdraw/svdomedia.cxx 2009-10-05 12:24:27.000000000 +0200
+@@ -45,14 +45,15 @@ TYPEINIT1( SdrMediaObj, SdrRectObj );
+
+ // ------------------------------------------------------------------------------
+
+-SdrMediaObj::SdrMediaObj()
++SdrMediaObj::SdrMediaObj() : mnSlidesNumber( 1 )
+ {
+ }
+
+ // ------------------------------------------------------------------------------
+
+ SdrMediaObj::SdrMediaObj( const Rectangle& rRect ) :
+- SdrRectObj( rRect )
++ SdrRectObj( rRect ),
++ mnSlidesNumber( 1 )
+ {
+ }
+
+@@ -166,6 +167,20 @@ const ::rtl::OUString& SdrMediaObj::getU
+ }
+
+ // ------------------------------------------------------------------------------
++
++void SdrMediaObj::setSlidesNumber( sal_uInt16 nSlidesNumber )
++{
++ mnSlidesNumber = nSlidesNumber;
++}
++
++// ------------------------------------------------------------------------------
++
++sal_uInt16 SdrMediaObj::getSlidesNumber() const
++{
++ return mnSlidesNumber;
++}
++
++// ------------------------------------------------------------------------------
+
+ void SdrMediaObj::setMediaProperties( const ::avmedia::MediaItem& rState )
+ {
+Only in svx/source/svdraw: svdomedia.cxx~
+diff -rup svx-orig/source/unodraw/unoprov.cxx svx/source/unodraw/unoprov.cxx
+--- svx-orig/source/unodraw/unoprov.cxx 2009-10-04 23:14:34.000000000 +0200
++++ svx/source/unodraw/unoprov.cxx 2009-10-04 23:23:14.000000000 +0200
+@@ -750,6 +750,7 @@ SfxItemPropertyMap* ImplGetSvxMediaShape
+ { MAP_CHAR_LEN(UNO_NAME_LINKDISPLAYNAME), OWN_ATTR_LDNAME, &::getCppuType(( const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
+ { MAP_CHAR_LEN("Transformation"), OWN_ATTR_TRANSFORMATION, &::getCppuType((const struct com::sun::star::drawing::HomogenMatrix3*)0), 0, 0 },
+ { MAP_CHAR_LEN("MediaURL"), OWN_ATTR_MEDIA_URL, &::getCppuType((const ::rtl::OUString*)0), 0, 0},
++ { MAP_CHAR_LEN("MediaSlidesNumber"), OWN_ATTR_MEDIA_SLIDES_NUMBER, &::getCppuType((const sal_uInt16*)0), 0, 0},
+ { MAP_CHAR_LEN("PreferredSize"), OWN_ATTR_MEDIA_PREFERREDSIZE, &::getCppuType((const ::com::sun::star::awt::Size*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
+ { MAP_CHAR_LEN("Loop"), OWN_ATTR_MEDIA_LOOP, &::getCppuType((const sal_Bool*)0), 0, 0},
+ { MAP_CHAR_LEN("Mute"), OWN_ATTR_MEDIA_MUTE, &::getCppuType((const sal_Bool*)0), 0, 0},
+diff -rup svx-orig/source/unodraw/unoshap4.cxx svx/source/unodraw/unoshap4.cxx
+--- svx-orig/source/unodraw/unoshap4.cxx 2009-10-04 23:14:34.000000000 +0200
++++ svx/source/unodraw/unoshap4.cxx 2009-10-05 11:37:12.000000000 +0200
+@@ -865,7 +865,7 @@ SvxMediaShape::~SvxMediaShape() throw()
+
+ bool SvxMediaShape::setPropertyValueImpl( const SfxItemPropertyMap* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ {
+- if( (pProperty->nWID >= OWN_ATTR_MEDIA_URL) && (pProperty->nWID <= OWN_ATTR_MEDIA_ZOOM) )
++ if( (pProperty->nWID >= OWN_ATTR_MEDIA_URL) && (pProperty->nWID <= OWN_ATTR_MEDIA_ZOOM) || pProperty->nWID == OWN_ATTR_MEDIA_SLIDES_NUMBER )
+ {
+ SdrMediaObj* pMedia = static_cast< SdrMediaObj* >( mpObj.get() );
+ ::avmedia::MediaItem aItem;
+@@ -884,6 +884,17 @@ bool SvxMediaShape::setPropertyValueImpl
+ }
+ break;
+
++ case OWN_ATTR_MEDIA_SLIDES_NUMBER:
++ {
++ sal_uInt16 nSlidesNumber;
++ if( rValue >>= nSlidesNumber )
++ {
++ bOk = true;
++ pMedia->setSlidesNumber( nSlidesNumber );
++ }
++ }
++ break;
++
+ case( OWN_ATTR_MEDIA_LOOP ):
+ {
+ sal_Bool bLoop = sal_Bool();
+@@ -954,7 +965,7 @@ bool SvxMediaShape::setPropertyValueImpl
+
+ bool SvxMediaShape::getPropertyValueImpl( const SfxItemPropertyMap* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ {
+- if( ( pProperty->nWID >= OWN_ATTR_MEDIA_URL ) && ( pProperty->nWID <= OWN_ATTR_MEDIA_ZOOM ) )
++ if( ( pProperty->nWID >= OWN_ATTR_MEDIA_URL ) && ( pProperty->nWID <= OWN_ATTR_MEDIA_ZOOM ) || pProperty->nWID == OWN_ATTR_MEDIA_SLIDES_NUMBER )
+ {
+ SdrMediaObj* pMedia = static_cast< SdrMediaObj* >( mpObj.get() );
+ const ::avmedia::MediaItem aItem( pMedia->getMediaProperties() );
+@@ -965,6 +976,10 @@ bool SvxMediaShape::getPropertyValueImpl
+ rValue <<= aItem.getURL();
+ break;
+
++ case OWN_ATTR_MEDIA_SLIDES_NUMBER:
++ rValue <<= pMedia->getSlidesNumber();
++ break;
++
+ case( OWN_ATTR_MEDIA_LOOP ):
+ rValue <<= (sal_Bool) aItem.isLoop();
+ break;
More information about the ooo-build-commit
mailing list