diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-02-03 16:26:28 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-02-03 19:09:20 +0100 |
commit | cd5bc4974d173cc38a95254302d165afc4faf159 (patch) | |
tree | 66c1b222da418c6f9ceff918744c2d89389e9b03 /sfx2 | |
parent | 1e8c4b769774226ae16dbb308e89e9a5fd0adde1 (diff) |
thumbnails: bSigned is always false, nobody uses the signed sign, kill it.
Not killing the icon itself, still seems to be used by on Windows in the shell
code.
Change-Id: I21c3b1ae6dfc65b6852659d6157b02324a485774
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/doc.hrc | 1 | ||||
-rw-r--r-- | sfx2/source/doc/graphhelp.cxx | 49 | ||||
-rw-r--r-- | sfx2/source/doc/graphhelp.hxx | 5 | ||||
-rw-r--r-- | sfx2/source/doc/graphhelp.src | 5 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 21 |
5 files changed, 4 insertions, 77 deletions
diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc index bcdbb714056b..99506ec82758 100644 --- a/sfx2/source/doc/doc.hrc +++ b/sfx2/source/doc/doc.hrc @@ -135,7 +135,6 @@ #define STR_LABEL_FILEFORMAT (RID_SFX_DOC_START+96) // some icons are commented out since they are removed -#define BMP_SIGNATURE (RID_SFX_DOC_START+97) #define BMP_128X128_CALC_DOC (RID_SFX_DOC_START+99) #define BMP_128X128_DRAW_DOC (RID_SFX_DOC_START+102) #define BMP_128X128_IMPRESS_DOC (RID_SFX_DOC_START+104) diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx index 515384ea4fbd..12482c236885 100644 --- a/sfx2/source/doc/graphhelp.cxx +++ b/sfx2/source/doc/graphhelp.cxx @@ -65,10 +65,6 @@ using namespace ::com::sun::star; -#define THUMBNAIL_RESOLUTION 256 - -//--------------------------------------------------------------- -// static SvMemoryStream* GraphicHelper::getFormatStrFromGDI_Impl( const GDIMetaFile* pGDIMeta, sal_uInt32 nFormat ) { SvMemoryStream* pResult = NULL; @@ -266,7 +262,6 @@ sal_Bool GraphicHelper::mergeBitmaps_Impl( const BitmapEx& rBmpEx, const BitmapE // static sal_Bool GraphicHelper::getThumbnailFormatFromGDI_Impl( GDIMetaFile* pMetaFile, - sal_Bool bSigned, const uno::Reference< io::XStream >& xStream ) { sal_Bool bResult = sal_False; @@ -278,54 +273,13 @@ sal_Bool GraphicHelper::getThumbnailFormatFromGDI_Impl( GDIMetaFile* pMetaFile, if ( pMetaFile && pStream && !pStream->GetError() ) { BitmapEx aResultBitmap; - BitmapEx* pSignatureBitmap = NULL; - - if ( bSigned ) - pSignatureBitmap = new BitmapEx( SfxResId( BMP_SIGNATURE ) ); - - bResult = pMetaFile->CreateThumbnail(aResultBitmap, THUMBNAIL_RESOLUTION, pSignatureBitmap); - - if ( bResult ) - bResult = ( !aResultBitmap.IsEmpty() - && GraphicConverter::Export( *pStream, aResultBitmap, CVT_PNG ) == 0 - && ( pStream->Flush(), !pStream->GetError() ) ); - - if ( pSignatureBitmap ) - delete pSignatureBitmap; - - delete pStream; - } - - return bResult; -} - -//--------------------------------------------------------------- -// static -sal_Bool GraphicHelper::getSignedThumbnailFormatFromBitmap_Impl( const BitmapEx& aBitmap, - const uno::Reference< io::XStream >& xStream ) -{ - sal_Bool bResult = sal_False; - SvStream* pStream = NULL; - - if ( xStream.is() ) - pStream = ::utl::UcbStreamHelper::CreateStream( xStream ); - - if ( pStream && !pStream->GetError() ) - { - BitmapEx aResultBitmap; - BitmapEx aSignatureBitmap( SfxResId( BMP_SIGNATURE ) ); - bResult = mergeBitmaps_Impl( aBitmap, - aSignatureBitmap, - Rectangle( Point(), aBitmap.GetSizePixel() ), - aResultBitmap ); + bResult = pMetaFile->CreateThumbnail(aResultBitmap); if ( bResult ) - { bResult = ( !aResultBitmap.IsEmpty() && GraphicConverter::Export( *pStream, aResultBitmap, CVT_PNG ) == 0 && ( pStream->Flush(), !pStream->GetError() ) ); - } delete pStream; } @@ -333,7 +287,6 @@ sal_Bool GraphicHelper::getSignedThumbnailFormatFromBitmap_Impl( const BitmapEx& return bResult; } -//--------------------------------------------------------------- // static sal_Bool GraphicHelper::getThumbnailReplacement_Impl( sal_Int32 nResID, const uno::Reference< io::XStream >& xStream ) { diff --git a/sfx2/source/doc/graphhelp.hxx b/sfx2/source/doc/graphhelp.hxx index 7f41f7124379..8acec37a19a9 100644 --- a/sfx2/source/doc/graphhelp.hxx +++ b/sfx2/source/doc/graphhelp.hxx @@ -46,11 +46,6 @@ public: static sal_Bool getThumbnailFormatFromGDI_Impl( GDIMetaFile* pMetaFile, - sal_Bool bSigned, - const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream ); - - static sal_Bool getSignedThumbnailFormatFromBitmap_Impl( - const BitmapEx& aBitmap, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream ); static sal_uInt16 getThumbnailReplacementIDByFactoryName_Impl( const OUString& aFactoryShortName, diff --git a/sfx2/source/doc/graphhelp.src b/sfx2/source/doc/graphhelp.src index 177c0451f67e..db2357fc1ab0 100644 --- a/sfx2/source/doc/graphhelp.src +++ b/sfx2/source/doc/graphhelp.src @@ -19,11 +19,6 @@ #include "doc.hrc" -Bitmap BMP_SIGNATURE -{ - File = "signet.png"; -}; - Bitmap BMP_128X128_CALC_DOC { File = "128x128_calc_doc-p.png"; diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 4a9a2bc9daf8..32bf23493d98 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1457,7 +1457,6 @@ sal_Bool SfxObjectShell::SaveTo_Impl // the thumbnail is not stored in case of encrypted document AddLog( OUString( OSL_LOG_PREFIX "Thumbnail creation." ) ); if ( !GenerateAndStoreThumbnail( bPasswdProvided, - sal_False, pFilter->IsOwnTemplateFormat(), xMedStorage ) ) { @@ -3525,7 +3524,6 @@ sal_Bool SfxObjectShell::CopyStoragesOfUnknownMediaType( const uno::Reference< e } sal_Bool SfxObjectShell::GenerateAndStoreThumbnail( sal_Bool bEncrypted, - sal_Bool bSigned, sal_Bool bIsTemplate, const uno::Reference< embed::XStorage >& xStor ) { @@ -3545,7 +3543,7 @@ sal_Bool SfxObjectShell::GenerateAndStoreThumbnail( sal_Bool bEncrypted, OUString("thumbnail.png"), embed::ElementModes::READWRITE ); - if ( xStream.is() && WriteThumbnail( bEncrypted, bSigned, bIsTemplate, xStream ) ) + if (xStream.is() && WriteThumbnail(bEncrypted, bIsTemplate, xStream)) { uno::Reference< embed::XTransactedObject > xTransact( xThumbnailStor, uno::UNO_QUERY_THROW ); xTransact->commit(); @@ -3563,7 +3561,6 @@ sal_Bool SfxObjectShell::GenerateAndStoreThumbnail( sal_Bool bEncrypted, } sal_Bool SfxObjectShell::WriteThumbnail( sal_Bool bEncrypted, - sal_Bool bSigned, sal_Bool bIsTemplate, const uno::Reference< io::XStream >& xStream ) { @@ -3585,19 +3582,7 @@ sal_Bool SfxObjectShell::WriteThumbnail( sal_Bool bEncrypted, OUString::createFromAscii( GetFactory().GetShortName() ), bIsTemplate ); if ( nResID ) - { - if ( !bSigned ) - { - bResult = GraphicHelper::getThumbnailReplacement_Impl( nResID, xStream ); - } - else - { - // retrieve the bitmap and write a signature bitmap over it - SfxResId aResId( nResID ); - BitmapEx aThumbBitmap( aResId ); - bResult = GraphicHelper::getSignedThumbnailFormatFromBitmap_Impl( aThumbBitmap, xStream ); - } - } + bResult = GraphicHelper::getThumbnailReplacement_Impl(nResID, xStream); } else { @@ -3606,7 +3591,7 @@ sal_Bool SfxObjectShell::WriteThumbnail( sal_Bool bEncrypted, if ( pMetaFile ) { bResult = GraphicHelper::getThumbnailFormatFromGDI_Impl( - pMetaFile.get(), bSigned, xStream ); + pMetaFile.get(), xStream); } } } |