From 04338b6213cedd42dc8a247247d6f5a253553220 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 25 Sep 2012 14:35:12 +0100 Subject: cope with thumbnailing both linked and embedded media correctly. --- svx/source/svdraw/svdomedia.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx index 4e42ce8ed612..91774b7873a1 100644 --- a/svx/source/svdraw/svdomedia.cxx +++ b/svx/source/svdraw/svdomedia.cxx @@ -192,7 +192,12 @@ SdrMediaObj& SdrMediaObj::operator=(const SdrMediaObj& rObj) uno::Reference< graphic::XGraphic > SdrMediaObj::getSnapshot() { if( !m_pImpl->m_xCachedSnapshot.is() ) - m_pImpl->m_xCachedSnapshot = avmedia::MediaWindow::grabFrame(getURL(), true); + { + rtl::OUString aRealURL = m_pImpl->m_MediaProperties.getTempURL(); + if( aRealURL.isEmpty() ) + aRealURL = m_pImpl->m_MediaProperties.getURL(); + m_pImpl->m_xCachedSnapshot = avmedia::MediaWindow::grabFrame( aRealURL, true ); + } return m_pImpl->m_xCachedSnapshot; } @@ -357,6 +362,7 @@ static char const s_PkgScheme[] = "vnd.sun.star.Package:"; void SdrMediaObj::mediaPropertiesChanged( const ::avmedia::MediaItem& rNewProperties ) { + bool bBroadcastChanged = false; const sal_uInt32 nMaskSet = rNewProperties.getMaskSet(); // use only a subset of MediaItem properties for own own properties @@ -398,6 +404,7 @@ void SdrMediaObj::mediaPropertiesChanged( const ::avmedia::MediaItem& rNewProper m_pImpl->m_pTempFile.reset(); m_pImpl->m_MediaProperties.setURL(url, 0); } + bBroadcastChanged = true; } if( AVMEDIA_SETMASK_LOOP & nMaskSet ) @@ -411,6 +418,12 @@ void SdrMediaObj::mediaPropertiesChanged( const ::avmedia::MediaItem& rNewProper if( AVMEDIA_SETMASK_ZOOM & nMaskSet ) m_pImpl->m_MediaProperties.setZoom( rNewProperties.getZoom() ); + + if( bBroadcastChanged ) + { + SetChanged(); + BroadcastObjectChange(); + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3