summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2014-01-29 16:10:39 +0000
committerTor Lillqvist <tml@collabora.com>2014-04-02 14:32:00 +0300
commit3ae6b906c50d2f1b955d877d2aec07f1c6ec0fc9 (patch)
tree6d5adb3787ff25adffb77368ab71a13478bb8e75 /svtools
parent10487efd41e42933bb88f75a3f9f97d1c6ccbb4e (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.cxx24
-rw-r--r--svtools/source/misc/transfer2.cxx7
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 );
+ }
}
}