summaryrefslogtreecommitdiff
path: root/svx/source/gallery2/galctrl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/gallery2/galctrl.cxx')
-rw-r--r--svx/source/gallery2/galctrl.cxx28
1 files changed, 27 insertions, 1 deletions
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index abe2e2fd02..9f751c98fa 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -38,10 +38,14 @@
#include "helpid.hrc"
#include "galbrws2.hxx"
#include "galtheme.hxx"
-#include "galmisc.hxx"
+#include "svx/galmisc.hxx"
#include "galctrl.hxx"
#include "AccessibleStringWrap.hxx"
#include <svx/svxfont.hxx>
+#include "galobj.hxx"
+#include <avmedia/mediawindow.hxx>
+#include "gallery.hrc"
+#include <svx/impgrf.hxx>
// -----------
// - Defines -
@@ -82,6 +86,28 @@ GalleryPreview::~GalleryPreview()
{
}
+
+bool GalleryPreview::SetGraphic( const INetURLObject& _aURL )
+{
+ bool bRet = true;
+ Graphic aGraphic;
+ if( ::avmedia::MediaWindow::isMediaURL( _aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ) )
+ {
+ aGraphic = BitmapEx( GAL_RESID( RID_SVXBMP_GALLERY_MEDIA ) );
+ }
+ else
+ {
+ GraphicFilter* pFilter = GetGrfFilter();
+ GalleryProgress aProgress( pFilter );
+ if( pFilter->ImportGraphic( aGraphic, _aURL, GRFILTER_FORMAT_DONTKNOW ) )
+ bRet = false;
+ }
+
+ SetGraphic( aGraphic );
+ Invalidate();
+ return bRet;
+}
+
// ------------------------------------------------------------------------
void GalleryPreview::InitSettings()