diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-09-29 06:48:07 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-09-29 06:48:07 +0000 |
commit | 97734d28c1f4485a4bd8c9130dc50ce2b22fa36f (patch) | |
tree | 5babae014230dfdd0312951e6606d4899246ab0c | |
parent | fc842d9896d46164b2c71dcfd000e207a7185290 (diff) |
CWS-TOOLING: integrate CWS impress158_DEV300
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 32601ecbdd3d..bdc71d13572a 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -44,6 +44,7 @@ #include <vos/mutex.hxx> #include <svx/unotext.hxx> #include <svx/svdobj.hxx> +#include <svx/svdoole2.hxx> #include <osl/mutex.hxx> #include <comphelper/extract.hxx> @@ -3025,6 +3026,53 @@ bool SvxShape::getPropertyValueImpl( const SfxItemPropertyMap* pProperty, ::com: rValue <<= OUString( aTmp ); break; } + case OWN_ATTR_METAFILE: + { + SdrOle2Obj* pObj = dynamic_cast<SdrOle2Obj*>(mpObj.get()); + if( pObj ) + { + Graphic* pGraphic = pObj->GetGraphic(); + if( pGraphic ) + { + BOOL bIsWMF = FALSE; + if ( pGraphic->IsLink() ) + { + GfxLink aLnk = pGraphic->GetLink(); + if ( aLnk.GetType() == GFX_LINK_TYPE_NATIVE_WMF ) + { + bIsWMF = TRUE; + uno::Sequence<sal_Int8> aSeq((sal_Int8*)aLnk.GetData(), (sal_Int32) aLnk.GetDataSize()); + rValue <<= aSeq; + } + } + if ( !bIsWMF ) + { + GDIMetaFile aMtf; + if ( pGraphic->GetType() != GRAPHIC_BITMAP ) + aMtf = pObj->GetGraphic()->GetGDIMetaFile(); + else + { + VirtualDevice aVirDev; + aMtf.Record( &aVirDev ); + pGraphic->Draw( &aVirDev, Point(), pGraphic->GetPrefSize() ); + aMtf.Stop(); + aMtf.SetPrefSize( pGraphic->GetPrefSize() ); + aMtf.SetPrefMapMode( pGraphic->GetPrefMapMode() ); + } + SvMemoryStream aDestStrm( 65535, 65535 ); + ConvertGDIMetaFileToWMF( aMtf, aDestStrm, NULL, sal_False ); + uno::Sequence<sal_Int8> aSeq((sal_Int8*)aDestStrm.GetData(), aDestStrm.GetSize()); + rValue <<= aSeq; + } + } + } + else + { + rValue = GetBitmap( sal_True ); + } + break; + } + default: return false; |