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 | dccade618b3fcb9a0f799a0c970ebdc2d9552352 (patch) | |
tree | bdfcb7ade389a2c965ba723a78ecbe93bdd6b96a /svx/source/unodraw | |
parent | edf1b3886d597f8ad7d062216e48eb7ae41a99f7 (diff) |
CWS-TOOLING: integrate CWS impress158_DEV300
Diffstat (limited to 'svx/source/unodraw')
-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 0e523019a1..c98137c1ac 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; |