From 431604f9fa603a7acf67985c9e4851f37d9cd580 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 6 Dec 2011 04:36:22 +0100 Subject: refactor media embedding completely: Do the tempfile handling in SdrMediaObj, not in the window; this has the advantage that it works even in the presence of clipboard documents without SfxBaseModels and thus without storage (sc, sw). The SdrMediaObj instances share ownership of a temp file. --- svx/source/unodraw/unoshap4.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'svx/source/unodraw/unoshap4.cxx') diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index ebbbe38bcb15..c4c7e687df2c 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -878,9 +878,7 @@ bool SvxMediaShape::setPropertyValueImpl( const ::rtl::OUString& rName, const Sf if( rValue >>= aURL ) { bOk = true; - uno::Reference const xModel( - mpModel->getUnoModel(), uno::UNO_QUERY_THROW); - aItem.setURL( aURL, xModel); + aItem.setURL( aURL, 0 ); } } break; @@ -955,7 +953,9 @@ bool SvxMediaShape::setPropertyValueImpl( const ::rtl::OUString& rName, const Sf bool SvxMediaShape::getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { - if( ( pProperty->nWID >= OWN_ATTR_MEDIA_URL ) && ( pProperty->nWID <= OWN_ATTR_MEDIA_ZOOM ) ) + if ( ((pProperty->nWID >= OWN_ATTR_MEDIA_URL) && + (pProperty->nWID <= OWN_ATTR_MEDIA_ZOOM)) + || (pProperty->nWID == OWN_ATTR_GRAPHIC_STREAM)) { SdrMediaObj* pMedia = static_cast< SdrMediaObj* >( mpObj.get() ); const ::avmedia::MediaItem aItem( pMedia->getMediaProperties() ); @@ -982,6 +982,10 @@ bool SvxMediaShape::getPropertyValueImpl( const ::rtl::OUString& rName, const Sf rValue <<= aItem.getZoom(); break; + case OWN_ATTR_GRAPHIC_STREAM: + rValue <<= pMedia->GetInputStream(); + break; + default: OSL_FAIL("SvxMediaShape::getPropertyValueImpl(), unknown property!"); } -- cgit