diff options
author | Armin Le Grand <alg@apache.org> | 2013-05-03 12:22:53 +0000 |
---|---|---|
committer | Armin Le Grand <alg@apache.org> | 2013-05-03 12:22:53 +0000 |
commit | 5ffd11cb81aa2206fd523dab461c5bdbd6a00bcc (patch) | |
tree | 0b5565350d5da6a83ba2686e06d60e037d4078d8 /sd | |
parent | 3c4045722f20bddddef9143c4f393e6f251f6d2d (diff) |
i122215 Avoid double paste, allow paste of WMF/EMF as bitmap
Notes
Notes:
merged as: 6daec0854455b50b7f4318dce2ec6afd92aad324
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index e83bb2f35516..e42795d63c4b 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -1204,6 +1204,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper, { // if no object was inserted, insert a picture InsertMetaFile( aDataHelper, rPos, pImageMap, true ); + bReturn = true; } } @@ -1273,7 +1274,29 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper, { BitmapEx aBmpEx; - if( aDataHelper.GetBitmapEx( FORMAT_BITMAP, aBmpEx ) ) + // get basic Bitmap data + aDataHelper.GetBitmapEx(FORMAT_BITMAP, aBmpEx); + + if(aBmpEx.IsEmpty()) + { + // if this did not work, try to get graphic formats and convert these to bitmap + Graphic aGraphic; + + if(aDataHelper.GetGraphic(FORMAT_GDIMETAFILE, aGraphic)) + { + aBmpEx = aGraphic.GetBitmapEx(); + } + else if(aDataHelper.GetGraphic(SOT_FORMATSTR_ID_SVXB, aGraphic)) + { + aBmpEx = aGraphic.GetBitmapEx(); + } + else if(aDataHelper.GetGraphic(FORMAT_BITMAP, aGraphic)) + { + aBmpEx = aGraphic.GetBitmapEx(); + } + } + + if(!aBmpEx.IsEmpty()) { Point aInsertPos( rPos ); |