diff options
author | Armin Le Grand <alg@apache.org> | 2014-01-29 16:10:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-31 15:26:41 +0000 |
commit | 1711bf49b0a426908c74b98e215c0ef8f3d2e601 (patch) | |
tree | c4399f76d4a0d565ae2b29209dec604476b0979c /svtools | |
parent | 6a227525d8994be2ccc07e8bda2b51d8827d241c (diff) |
Resolves: #i124085# disabled CF_DIBV5...
(no advantages but some problems), increased png support
(cherry picked from commit c991f7cae8dcb306cb0d1f32bc5fcd8ea0a1ea81)
Change-Id: I52bef1295b32eb3692a0428c96edd0c55287f34a
Reviewed-on: https://gerrit.libreoffice.org/8784
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/misc/transfer.cxx | 24 | ||||
-rw-r--r-- | svtools/source/misc/transfer2.cxx | 7 |
2 files changed, 20 insertions, 11 deletions
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 32430046f26e..73537b636cb8 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -674,8 +674,8 @@ void TransferableHelper::AddFormat( const DataFlavor& rFlavor ) if( FORMAT_BITMAP == aFlavorEx.mnSotId ) { - AddFormat( SOT_FORMATSTR_ID_BMP ); AddFormat( SOT_FORMATSTR_ID_PNG ); + AddFormat( SOT_FORMATSTR_ID_BMP ); } else if( FORMAT_GDIMETAFILE == aFlavorEx.mnSotId ) { @@ -786,18 +786,19 @@ sal_Bool TransferableHelper::SetBitmapEx( const BitmapEx& rBitmapEx, const DataF { const Bitmap aBitmap(rBitmapEx.GetBitmap()); - if(rBitmapEx.IsTransparent()) - { - const Bitmap aMask(rBitmapEx.GetAlpha().GetBitmap()); - - // explicitely use Bitmap::Write with bCompressed = sal_False and bFileHeader = sal_True - WriteDIBV5(aBitmap, aMask, aMemStm); - } - else - { + // #i124085# take out DIBV5 for writing to the clipboard + //if(rBitmapEx.IsTransparent()) + //{ + // const Bitmap aMask(rBitmapEx.GetAlpha().GetBitmap()); + // + // // explicitely use Bitmap::Write with bCompressed = sal_False and bFileHeader = sal_True + // WriteDIBV5(aBitmap, aMask, aMemStm); + //} + //else + //{ // explicitely use Bitmap::Write with bCompressed = sal_False and bFileHeader = sal_True WriteDIB(aBitmap, aMemStm, false, true); - } + //} } maAny <<= Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aMemStm.GetData() ), aMemStm.Seek( STREAM_SEEK_TO_END ) ); @@ -1725,6 +1726,7 @@ sal_Bool TransferableDataHelper::GetBitmapEx( const DataFlavor& rFlavor, BitmapE Bitmap aMask; // explicitely use Bitmap::Read with bFileHeader = sal_True + // #i124085# keep DIBV5 for read from clipboard, but should not happen ReadDIBV5(aBitmap, aMask, *xStm); if(aMask.IsEmpty()) diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx index 7eac621ebf8e..eb282c13f6b6 100644 --- a/svtools/source/misc/transfer2.cxx +++ b/svtools/source/misc/transfer2.cxx @@ -449,6 +449,7 @@ sal_Bool TransferDataContainer::GetData( const break; case SOT_FORMATSTR_ID_SVXB: + case SOT_FORMATSTR_ID_PNG: case SOT_FORMAT_BITMAP: case SOT_FORMAT_GDIMETAFILE: if( pImpl->pGrf ) @@ -537,10 +538,16 @@ void TransferDataContainer::CopyGraphic( const Graphic& rGrf ) *pImpl->pGrf = rGrf; AddFormat( SOT_FORMATSTR_ID_SVXB ); + if( GRAPHIC_BITMAP == nType ) + { + AddFormat( SOT_FORMATSTR_ID_PNG ); AddFormat( SOT_FORMAT_BITMAP ); + } else if( GRAPHIC_GDIMETAFILE == nType ) + { AddFormat( SOT_FORMAT_GDIMETAFILE ); + } } } |