diff options
author | Jianyuan Li <lijiany@apache.org> | 2012-09-11 08:00:21 +0000 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-06-26 16:45:28 +0100 |
commit | f38487511957971f9d08dd5c9af8f8128371540e (patch) | |
tree | 5416c6f70d5bcae9d11e0294e5ba4ddfd8937f2e | |
parent | 55162d7422a3b175c7fe9c175e0dec91b1932b6a (diff) |
#119467# Form controls cannot be saved into .ppt file in AOO3.4
Reported by: Du Jing
Patch by: Jianyuan Li
Review by: sunying
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 32 | ||||
-rw-r--r-- | include/filter/msfilter/escherex.hxx | 2 | ||||
-rw-r--r-- | sd/source/filter/eppt/eppt.cxx | 3 | ||||
-rw-r--r-- | sd/source/filter/eppt/epptso.cxx | 4 |
4 files changed, 40 insertions, 1 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 369625148fb2..bd6b0e40ba82 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -18,6 +18,7 @@ */ #include "eschesdo.hxx" +#include <svx/svdxcgv.hxx> #include <svx/svdomedia.hxx> #include <svx/xflftrit.hxx> #include <filter/msfilter/escherex.hxx> @@ -3812,6 +3813,37 @@ MSO_SPT EscherPropertyContainer::GetCustomShapeType( const uno::Reference< drawi return GetCustomShapeType( rXShape, nMirrorFlags, aShapeType ); } +//Implement for form control export +sal_Bool EscherPropertyContainer::CreateBlipPropertiesforOLEControl(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape) +{ + SdrObject* pShape = GetSdrObjectFromXShape( rXShape ); + if ( pShape ) + { + SdrModel* pMod = pShape->GetModel(); + Graphic aGraphic(SdrExchangeView::GetObjGraphic( pMod, pShape)); + + GraphicObject aGraphicObject = aGraphic; + OString aUniqueId = aGraphicObject.GetUniqueID(); + if ( aUniqueId.getLength() ) + { + if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect ) + { + Rectangle aRect( Point( 0, 0 ), pShapeBoundRect->GetSize() ); + + sal_uInt32 nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aRect, NULL ); + if ( nBlibId ) + { + AddOpt( ESCHER_Prop_pib, nBlibId, sal_True ); + ImplCreateGraphicAttributes( rXPropSet, nBlibId, sal_False ); + return sal_True; + } + } + } + } + + return sal_False; +} + EscherPersistTable::EscherPersistTable() { } diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx index 4b7a0c9d3bf8..e21805a0d208 100644 --- a/include/filter/msfilter/escherex.hxx +++ b/include/filter/msfilter/escherex.hxx @@ -1262,6 +1262,8 @@ public: const sal_Bool bFillBitmapModeAllowed = sal_True ); + sal_Bool CreateBlipPropertiesforOLEControl( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape); + sal_Bool CreatePolygonProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, sal_uInt32 nFlags, diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 861d06abbf0f..d7eeb5d62fb3 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -1325,7 +1325,8 @@ void PPTWriter::ImplWriteOLE( ) if ( pPtr->xControlModel.is() ) { OUString aName; - ::com::sun::star::awt::Size aSize; + //Initialize the graphic size which will be used on export + ::com::sun::star::awt::Size aSize( pPtr->xShape->getSize() ); SvStorageRef xDest( new SvStorage( new SvMemoryStream(), sal_True ) ); sal_Bool bOk = oox::ole::MSConvertOCXControls::WriteOCXStream( mXModel, xDest, pPtr->xControlModel, aSize, aName ); if ( bOk ) diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index fa1a46b017a7..3d45f89b109b 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -2573,6 +2573,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a << nPageId; PPTExOleObjEntry* pEntry = new PPTExOleObjEntry( OCX_CONTROL, mpExEmbed->Tell() ); pEntry->xControlModel = aXControlModel; + pEntry->xShape = mXShape; maExOleObj.push_back( pEntry ); mnExEmbed++; @@ -2644,6 +2645,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a ImplCreateShape( ESCHER_ShpInst_HostControl, nSpFlags, aSolverContainer ); if ( aPropOpt.CreateGraphicProperties( mXPropSet, OUString( "MetaFile" ), sal_False ) ) aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 ); + //export form control graphic + else if ( aPropOpt.CreateBlipPropertiesforOLEControl(mXPropSet,mXShape)) + aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 ); aPropOpt.AddOpt( ESCHER_Prop_pictureId, mnExEmbed ); aPropOpt.AddOpt( ESCHER_Prop_pictureActive, 0x10000 ); |