diff options
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 4 | ||||
-rw-r--r-- | include/filter/msfilter/svdfppt.hxx | 2 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 63 |
3 files changed, 35 insertions, 34 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 400b9716127f..422d34e411bb 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -216,7 +216,7 @@ sal_uInt16 PptSlidePersistList::FindPage(sal_uInt32 nId) const return PPTSLIDEPERSIST_ENTRY_NOTFOUND; } -SvStream& ReadPptInteractiveInfoAtom( SvStream& rIn, PptInteractiveInfoAtom& rAtom ) +bool ReadPptInteractiveInfoAtom( SvStream& rIn, PptInteractiveInfoAtom& rAtom ) { rIn.ReadUInt32( rAtom.nSoundRef ) .ReadUInt32( rAtom.nExHyperlinkId ) @@ -228,7 +228,7 @@ SvStream& ReadPptInteractiveInfoAtom( SvStream& rIn, PptInteractiveInfoAtom& rAt .ReadUChar( rAtom.nUnknown1 ) .ReadUChar( rAtom.nUnknown2 ) .ReadUChar( rAtom.nUnknown3 ); - return rIn; + return rIn.good(); } SvStream& ReadPptExOleObjAtom( SvStream& rIn, PptExOleObjAtom& rAtom ) diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx index 0fad50bf993f..ae5f600a7fa2 100644 --- a/include/filter/msfilter/svdfppt.hxx +++ b/include/filter/msfilter/svdfppt.hxx @@ -130,7 +130,7 @@ struct MSFILTER_DLLPUBLIC PptInteractiveInfoAtom public: - MSFILTER_DLLPUBLIC friend SvStream& ReadPptInteractiveInfoAtom( SvStream& rIn, PptInteractiveInfoAtom& rAtom ); + MSFILTER_DLLPUBLIC friend bool ReadPptInteractiveInfoAtom( SvStream& rIn, PptInteractiveInfoAtom& rAtom ); }; enum PptPageKind { PPT_MASTERPAGE, PPT_SLIDEPAGE, PPT_NOTEPAGE }; diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 53d28a3c46ea..3eaebfd1892b 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -2686,44 +2686,45 @@ rtl::Reference<SdrObject> ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData if ( SeekToRec( rSt, PPT_PST_InteractiveInfoAtom, nHdRecEnd, &aHdInteractiveInfoAtom ) ) { PptInteractiveInfoAtom aInteractiveInfoAtom; - ReadPptInteractiveInfoAtom( rSt, aInteractiveInfoAtom ); - - // interactive object - SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj, true); - - FillSdAnimationInfo(pInfo, aInteractiveInfoAtom, aMacroName); - if ( aInteractiveInfoAtom.nAction == 6 ) // Sj -> media action + if (ReadPptInteractiveInfoAtom(rSt, aInteractiveInfoAtom)) { - rHdClientData.SeekToContent( rStCtrl ); - DffRecordHeader aObjRefAtomHd; - if ( SeekToRec( rSt, PPT_PST_ExObjRefAtom, nHdRecEnd, &aObjRefAtomHd ) ) + // interactive object + SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj, true); + + FillSdAnimationInfo(pInfo, aInteractiveInfoAtom, aMacroName); + if ( aInteractiveInfoAtom.nAction == 6 ) // Sj -> media action { - sal_uInt32 nRef; - rSt.ReadUInt32( nRef ); - OUString aMediaURL( ReadMedia( nRef ) ); - if ( aMediaURL.isEmpty() ) - aMediaURL = ReadSound( nRef ); - if ( !aMediaURL.isEmpty() ) + rHdClientData.SeekToContent( rStCtrl ); + DffRecordHeader aObjRefAtomHd; + if ( SeekToRec( rSt, PPT_PST_ExObjRefAtom, nHdRecEnd, &aObjRefAtomHd ) ) { - rtl::Reference<SdrMediaObj> pMediaObj = new SdrMediaObj( - pObj->getSdrModelFromSdrObject(), - pObj->GetSnapRect()); - pMediaObj->SetMergedItemSet( pObj->GetMergedItemSet() ); - - //--remove object from maAnimations list and add the new object instead - Ppt97AnimationPtr pAnimation; + sal_uInt32 nRef; + rSt.ReadUInt32( nRef ); + OUString aMediaURL( ReadMedia( nRef ) ); + if ( aMediaURL.isEmpty() ) + aMediaURL = ReadSound( nRef ); + if ( !aMediaURL.isEmpty() ) { - tAnimationMap::iterator aFound = maAnimations.find( pObj.get() ); - if( aFound != maAnimations.end() ) + rtl::Reference<SdrMediaObj> pMediaObj = new SdrMediaObj( + pObj->getSdrModelFromSdrObject(), + pObj->GetSnapRect()); + pMediaObj->SetMergedItemSet( pObj->GetMergedItemSet() ); + + //--remove object from maAnimations list and add the new object instead + Ppt97AnimationPtr pAnimation; { - pAnimation = (*aFound).second; - maAnimations.erase(aFound); + tAnimationMap::iterator aFound = maAnimations.find( pObj.get() ); + if( aFound != maAnimations.end() ) + { + pAnimation = (*aFound).second; + maAnimations.erase(aFound); + } + maAnimations[pMediaObj.get()] = pAnimation; } - maAnimations[pMediaObj.get()] = pAnimation; - } - pObj = pMediaObj; // SJ: hoping that pObj is not inserted in any list - pMediaObj->setURL( aMediaURL, ""/*TODO?*/ ); + pObj = pMediaObj; // SJ: hoping that pObj is not inserted in any list + pMediaObj->setURL( aMediaURL, ""/*TODO?*/ ); + } } } } |