summaryrefslogtreecommitdiff
path: root/filter/source
diff options
context:
space:
mode:
authorSun Ying <sunying@apache.org>2012-09-10 01:56:28 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-05-27 11:06:26 +0100
commitb3faed955fa4e0c7e3b1f6843bfb81f15edc2826 (patch)
tree1320d66c8baf179e136e606a328f050069535d5c /filter/source
parent8d4e5e7938f7008bc3f973cc8158a39cbd1a5bdb (diff)
Resolves: #i119753# fix audio video object lost when save .ppt file
Reported by: Li Feng Wang Patch by: Ying Sun Review by: Jian Yuan Li (cherry picked from commit fbb7e8d8957877922f2f3a971e88685589f43939) Conflicts: filter/inc/filter/msfilter/escherex.hxx filter/source/msfilter/escherex.cxx Change-Id: I545a9e95c23cfba0cc918c9c4243528570734b2d (cherry picked from commit c05c16635b15a47591faa737947c2dce3dcb863e)
Diffstat (limited to 'filter/source')
-rw-r--r--filter/source/msfilter/escherex.cxx73
1 files changed, 48 insertions, 25 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 4c8fec021af0..68bd12dd6352 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -18,6 +18,7 @@
*/
#include "eschesdo.hxx"
+#include <svx/svdomedia.hxx>
#include <svx/xflftrit.hxx>
#include <filter/msfilter/escherex.hxx>
#include <svx/unoapi.hxx>
@@ -1283,38 +1284,60 @@ sal_Bool EscherPropertyContainer::CreateOLEGraphicProperties(
if ( pGraphic )
{
GraphicObject aGraphicObject( *pGraphic );
- OString aUniqueId( aGraphicObject.GetUniqueID() );
- if ( !aUniqueId.isEmpty() )
- {
- AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture );
- uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
+ bRetValue = CreateGraphicProperties( rXShape,aGraphicObject );
+ }
+ }
+ }
+ return bRetValue;
+}
- if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect && aXPropSet.is() )
- {
- ::com::sun::star::uno::Any aAny;
- ::com::sun::star::awt::Rectangle* pVisArea = NULL;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, OUString( "VisibleArea" ) ) )
- {
- pVisArea = new ::com::sun::star::awt::Rectangle;
- aAny >>= (*pVisArea);
- }
- Rectangle aRect( Point( 0, 0 ), pShapeBoundRect->GetSize() );
- sal_uInt32 nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aRect, pVisArea, NULL );
- if ( nBlibId )
- {
- AddOpt( ESCHER_Prop_pib, nBlibId, sal_True );
- ImplCreateGraphicAttributes( aXPropSet, nBlibId, sal_False );
- bRetValue = sal_True;
- }
- delete pVisArea;
- }
- }
+sal_Bool EscherPropertyContainer::CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, const GraphicObject& rGraphicObj )
+{
+ sal_Bool bRetValue = sal_False;
+ OString aUniqueId( rGraphicObj.GetUniqueID() );
+ if ( !aUniqueId.isEmpty() )
+ {
+ AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture );
+ uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
+
+ if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect && aXPropSet.is() )
+ {
+ ::com::sun::star::uno::Any aAny;
+ ::com::sun::star::awt::Rectangle* pVisArea = NULL;
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, OUString("VisibleArea" ) ) )
+ {
+ pVisArea = new ::com::sun::star::awt::Rectangle;
+ aAny >>= (*pVisArea);
}
+ Rectangle aRect( Point( 0, 0 ), pShapeBoundRect->GetSize() );
+ sal_uInt32 nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aRect, pVisArea, NULL );
+ if ( nBlibId )
+ {
+ AddOpt( ESCHER_Prop_pib, nBlibId, sal_True );
+ ImplCreateGraphicAttributes( aXPropSet, nBlibId, sal_False );
+ bRetValue = sal_True;
+ }
+ delete pVisArea;
}
}
return bRetValue;
}
+sal_Bool EscherPropertyContainer::CreateMediaGraphicProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape )
+{
+ sal_Bool bRetValue = sal_False;
+ if ( rXShape.is() )
+ {
+ SdrObject* pSdrMedia( GetSdrObjectFromXShape( rXShape ) ); // SJ: leaving unoapi, because currently there is
+ if ( pSdrMedia && pSdrMedia->ISA( SdrMediaObj ) ) // no access to the native graphic object
+ {
+ GraphicObject aGraphicObject( ((SdrMediaObj*)pSdrMedia)->getSnapshot() );
+ bRetValue = CreateGraphicProperties( rXShape, aGraphicObject );
+ }
+ }
+ return bRetValue;
+}
sal_Bool EscherPropertyContainer::ImplCreateEmbeddedBmp( const OString& rUniqueId )
{