diff options
author | Armin Le Grand <alg@apache.org> | 2014-01-29 16:10:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-30 09:21:30 +0000 |
commit | 90d39a8a22c3f75e7eb4a79062e1d94c1fa1ff85 (patch) | |
tree | 60231554ed1c8f7807847318a3e7fcf9612da46d /svtools | |
parent | 36c5078d244e5a757d92cdc0f183ebd11712f6fc (diff) |
Resolves: #i124085# disabled CF_DIBV5...
(no advantages but some problems), increased png support
(cherry picked from commit c991f7cae8dcb306cb0d1f32bc5fcd8ea0a1ea81)
Change-Id: I52bef1295b32eb3692a0428c96edd0c55287f34a
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 31fb53d72aeb..fe15173ff927 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 ); + } } } |