diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-02-03 15:59:05 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-02-03 19:09:19 +0100 |
commit | 1e8c4b769774226ae16dbb308e89e9a5fd0adde1 (patch) | |
tree | 4a82532c442c86dfd11d98696f914ab286c825dd | |
parent | 05857ac3232ee88dc9a2bde4c135f07dd25b4c91 (diff) |
thumbnails: Provide the size as a default parameter.
And increase it consistently to 256 pixels.
Change-Id: I123e11d597269d7e43298504f1dbd0098c9b0149
-rw-r--r-- | include/vcl/gdimtf.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/docinf.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/graphhelp.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 6 |
5 files changed, 8 insertions, 10 deletions
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx index d14d6a2a50bf..d7de82fd59f5 100644 --- a/include/vcl/gdimtf.hxx +++ b/include/vcl/gdimtf.hxx @@ -213,7 +213,8 @@ public: friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile ); friend VCL_DLLPUBLIC SvStream& WriteGDIMetaFile( SvStream& rOStm, const GDIMetaFile& rGDIMetaFile ); - sal_Bool CreateThumbnail( sal_uInt32 nMaximumExtent, BitmapEx& rBmpEx, const BitmapEx* pOverlay = NULL, const Rectangle* pOverlayRect = NULL ) const; + /// Creates an antialiased thumbnail, with maximum height or width of nMaximumExtent. + sal_Bool CreateThumbnail( BitmapEx& rBmpEx, sal_uInt32 nMaximumSize = 256, const BitmapEx* pOverlay = NULL, const Rectangle* pOverlayRect = NULL ) const; void UseCanvas( sal_Bool _bUseCanvas ); sal_Bool GetUseCanvas() const { return bUseCanvas; } diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 21fd8b534ee0..1aaa1c15934b 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -1111,8 +1111,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) ::boost::shared_ptr<GDIMetaFile> pMetaFile = pDocShell->GetPreviewMetaFile(); BitmapEx aBitmap; - if ( pMetaFile && pMetaFile->CreateThumbnail( 160, /* magic value taken from GraphicHelper::getThumbnailFormatFromGDI_Impl() */ - aBitmap ) ) + if (pMetaFile && pMetaFile->CreateThumbnail(aBitmap)) { SvMemoryStream aMemStream; WriteDIB(aBitmap.GetBitmap(), aMemStream, false, false); diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx index a5f967f69423..f3c56bd05118 100644 --- a/sfx2/source/doc/docinf.cxx +++ b/sfx2/source/doc/docinf.cxx @@ -306,8 +306,8 @@ uno::Sequence<sal_uInt8> SFX2_DLLPUBLIC convertMetaFile(GDIMetaFile* i_pThumb) if (i_pThumb) { BitmapEx aBitmap; SvMemoryStream aStream; -// magic value 160 taken from GraphicHelper::getThumbnailFormatFromGDI_Impl() - if( i_pThumb->CreateThumbnail( 160, aBitmap ) ) { + if (i_pThumb->CreateThumbnail(aBitmap)) + { WriteDIB(aBitmap.GetBitmap(), aStream, false, false); aStream.Seek(STREAM_SEEK_TO_END); uno::Sequence<sal_uInt8> aSeq(aStream.Tell()); diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx index 7cd16ee195d3..515384ea4fbd 100644 --- a/sfx2/source/doc/graphhelp.cxx +++ b/sfx2/source/doc/graphhelp.cxx @@ -283,7 +283,7 @@ sal_Bool GraphicHelper::getThumbnailFormatFromGDI_Impl( GDIMetaFile* pMetaFile, if ( bSigned ) pSignatureBitmap = new BitmapEx( SfxResId( BMP_SIGNATURE ) ); - bResult = pMetaFile->CreateThumbnail(THUMBNAIL_RESOLUTION, aResultBitmap, pSignatureBitmap); + bResult = pMetaFile->CreateThumbnail(aResultBitmap, THUMBNAIL_RESOLUTION, pSignatureBitmap); if ( bResult ) bResult = ( !aResultBitmap.IsEmpty() diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index d5bff9de99c5..9609d48e4614 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -2869,10 +2869,8 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm ) return rOStm; } -sal_Bool GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent, - BitmapEx& rBmpEx, - const BitmapEx* pOverlay, - const Rectangle* pOverlayRect ) const +sal_Bool GDIMetaFile::CreateThumbnail(BitmapEx& rBmpEx, sal_uInt32 nMaximumExtent, + const BitmapEx* pOverlay, const Rectangle* pOverlayRect) const { // initialization seems to be complicated but is used to avoid rounding errors VirtualDevice aVDev; |