summaryrefslogtreecommitdiff
path: root/svx/source/unodraw/unoshap4.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2011-12-06 04:36:22 +0100
committerMichael Stahl <mstahl@redhat.com>2011-12-06 04:36:22 +0100
commit431604f9fa603a7acf67985c9e4851f37d9cd580 (patch)
tree2dbbe2e40af935229dbc8f2738dc446ab18a93b8 /svx/source/unodraw/unoshap4.cxx
parentf3c19f8263f3352ce4efff0965f8000d8347f6a5 (diff)
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.
Diffstat (limited to 'svx/source/unodraw/unoshap4.cxx')
-rw-r--r--svx/source/unodraw/unoshap4.cxx12
1 files changed, 8 insertions, 4 deletions
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<frame::XModel> 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!");
}