diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-01-31 16:36:52 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-01-31 16:40:14 +0100 |
commit | af331776895c1c3d036040599501d3f08a4d5562 (patch) | |
tree | 432efa9c4feb79ce3ea18d2f420677f00398e6b5 /sfx2/source/doc | |
parent | bdb3c21ee5a20046dfd80c486e41ad591b863c1c (diff) |
Template Manager: show some icons if there is no thumbnail
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
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; |