Kaydet (Commit) 5ffd11cb authored tarafından Armin Le Grand's avatar Armin Le Grand

i122215 Avoid double paste, allow paste of WMF/EMF as bitmap

üst 3c404572
...@@ -1204,6 +1204,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper, ...@@ -1204,6 +1204,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
{ {
// if no object was inserted, insert a picture // if no object was inserted, insert a picture
InsertMetaFile( aDataHelper, rPos, pImageMap, true ); InsertMetaFile( aDataHelper, rPos, pImageMap, true );
bReturn = true;
} }
} }
...@@ -1273,7 +1274,29 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper, ...@@ -1273,7 +1274,29 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
{ {
BitmapEx aBmpEx; 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 ); Point aInsertPos( rPos );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment