From af331776895c1c3d036040599501d3f08a4d5562 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Thu, 31 Jan 2013 16:36:52 +0100 Subject: Template Manager: show some icons if there is no thumbnail --- sfx2/source/doc/templatedlg.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'sfx2/source/doc') diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index d3721ab8c6e1..8bb8035f018b 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -1534,6 +1534,31 @@ void SfxTemplateManagerDlg::syncRepositories() const } } +BitmapEx SfxTemplateManagerDlg::getDefaultThumbnail( const OUString& rPath ) +{ + INetURLObject aUrl(rPath); + OUString aExt = aUrl.getExtension(); + + BitmapEx aImg; + if ( aExt == "ott" || aExt == "stw" || aExt == "oth" || aExt == "dot" || aExt == "dotx" ) + { + aImg = BitmapEx ( SfxResId( SFX_THUMBNAIL_TEXT ) ); + } + else if ( aExt == "ots" || aExt == "stc" || aExt == "xlt" || aExt == "xltm" || aExt == "xltx" ) + { + aImg = BitmapEx ( SfxResId( SFX_THUMBNAIL_SHEET ) ); + } + else if ( aExt == "otp" || aExt == "sti" || aExt == "pot" || aExt == "potm" || aExt == "potx" ) + { + aImg = BitmapEx ( SfxResId( SFX_THUMBNAIL_PRESENTATION ) ); + } + else if ( aExt == "otg" || aExt == "std" ) + { + aImg = BitmapEx ( SfxResId( SFX_THUMBNAIL_DRAWING ) ); + } + return aImg; +} + static bool lcl_getServiceName ( const OUString &rFileURL, OUString &rName ) { bool bRet = false; -- cgit