incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suny...@apache.org
Subject svn commit: r1382625 - in /incubator/ooo/trunk/main: filter/inc/filter/msfilter/escherex.hxx filter/source/msfilter/escherex.cxx sd/source/filter/eppt/epptso.cxx sd/source/filter/ppt/pptin.cxx
Date Mon, 10 Sep 2012 02:56:29 GMT
Author: sunying
Date: Mon Sep 10 02:56:28 2012
New Revision: 1382625

URL: http://svn.apache.org/viewvc?rev=1382625&view=rev
Log:
#119753# fix audio video object lost when save .ppt file
Reported by: Li Feng Wang 
Patch by: Ying Sun
Review by: Jian Yuan Li

Modified:
    incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx
    incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx
    incubator/ooo/trunk/main/sd/source/filter/eppt/epptso.cxx
    incubator/ooo/trunk/main/sd/source/filter/ppt/pptin.cxx

Modified: incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx?rev=1382625&r1=1382624&r2=1382625&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx (original)
+++ incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx Mon Sep 10 02:56:28 2012
@@ -1202,6 +1202,9 @@ class MSFILTER_DLLPUBLIC EscherPropertyC
 		sal_Bool	CreateShapeProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape
> & rXShape );
         sal_Bool    CreateOLEGraphicProperties( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShape > & rXOleObject );
 
+		sal_Bool	CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape
> & rXShape,
+			const GraphicObject& rGraphicObj );
+		sal_Bool	CreateMediaGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape
> & rXMediaObject );
         /** Creates a complex ESCHER_Prop_fillBlip containing the BLIP directly (for Excel
charts). */
         sal_Bool    CreateEmbeddedBitmapProperties( const ::rtl::OUString& rBitmapUrl,
                         ::com::sun::star::drawing::BitmapMode eBitmapMode );

Modified: incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx?rev=1382625&r1=1382624&r2=1382625&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx Mon Sep 10 02:56:28 2012
@@ -24,6 +24,7 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_filter.hxx"
 #include "eschesdo.hxx"
+#include <svx/svdomedia.hxx>
 #include <svx/xflftrit.hxx>
 #include <filter/msfilter/escherex.hxx>
 #include <svx/unoapi.hxx>
@@ -1324,38 +1325,61 @@ sal_Bool EscherPropertyContainer::Create
 			if ( pGraphic )
 			{
 				GraphicObject aGraphicObject( *pGraphic );
-                ByteString aUniqueId( aGraphicObject.GetUniqueID() );
-				if ( aUniqueId.Len() )
-				{
-					AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture );
-					uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
+                bRetValue = CreateGraphicProperties( rXShape,aGraphicObject );
+				// End
+			}
+		}
+	}
+	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, String( RTL_CONSTASCII_USTRINGPARAM(
"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;
+	ByteString aUniqueId( rGraphicObj.GetUniqueID() );
+	if ( aUniqueId.Len() )
+	{
+		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, String( RTL_CONSTASCII_USTRINGPARAM(
"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)->getGraphic() );
+			bRetValue = CreateGraphicProperties( rXShape, aGraphicObject );
+		}
+	}
+	return bRetValue;
+}
 
 sal_Bool EscherPropertyContainer::ImplCreateEmbeddedBmp( const ByteString& rUniqueId
)
 {

Modified: incubator/ooo/trunk/main/sd/source/filter/eppt/epptso.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/filter/eppt/epptso.cxx?rev=1382625&r1=1382624&r2=1382625&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/filter/eppt/epptso.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/filter/eppt/epptso.cxx Mon Sep 10 02:56:28 2012
@@ -5251,7 +5251,8 @@ void PPTWriter::ImplWritePage( const PHL
 				mnAngle = 0;
                 mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
                 ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
-
+				if ( aPropOpt.CreateMediaGraphicProperties( mXShape ) )
+					aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
 				::com::sun::star::uno::Any aAny;
 				if ( PropValue::GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM(
"MediaURL" ) ), sal_True ) )
 				{
@@ -5302,6 +5303,18 @@ void PPTWriter::ImplWritePage( const PHL
 									 << (sal_uInt16)EPP_ExObjRefAtom
 									 << (sal_uInt32)4
 									 << nRefId;
+						// write EPP_InteractiveInfo container for no_action
+						*pClientData << (sal_uInt32)( ( EPP_InteractiveInfo << 16 ) | 0xf ) <<
(sal_uInt32)24;
+						*pClientData << (sal_uInt16)0
+									 << (sal_uInt16)EPP_InteractiveInfoAtom
+									 << (sal_uInt32)16
+									 << (sal_uInt32) 0
+									 << (sal_uInt32) 0
+									 << (sal_uInt8) 6
+									 << (sal_uInt8) 0
+									 << (sal_uInt8) 0
+									 << (sal_uInt8) 0
+									 << (sal_uInt32) 0;
 					}
 				}
 			}

Modified: incubator/ooo/trunk/main/sd/source/filter/ppt/pptin.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/filter/ppt/pptin.cxx?rev=1382625&r1=1382624&r2=1382625&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/filter/ppt/pptin.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/filter/ppt/pptin.cxx Mon Sep 10 02:56:28 2012
@@ -2051,6 +2051,8 @@ String ImplSdPPTImport::ReadMedia( sal_u
 												if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aStr, aRetVal ) )
 												{
 													aRetVal = INetURLObject( aRetVal ).GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS
);
+												}else{ 
+													aRetVal = aStr;
 												}
 											}
 										}



Mime
View raw message