summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2014-01-29 16:10:39 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-31 15:26:41 +0000
commit1711bf49b0a426908c74b98e215c0ef8f3d2e601 (patch)
treec4399f76d4a0d565ae2b29209dec604476b0979c /sc
parent6a227525d8994be2ccc07e8bda2b51d8827d241c (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 'sc')
-rw-r--r--sc/source/ui/app/drwtrans.cxx7
-rw-r--r--sc/source/ui/app/seltrans.cxx4
-rw-r--r--sc/source/ui/app/transobj.cxx3
-rw-r--r--sc/source/ui/view/cellsh.cxx4
-rw-r--r--sc/source/ui/view/gridwin.cxx4
-rw-r--r--sc/source/ui/view/viewfun3.cxx2
-rw-r--r--sc/source/ui/view/viewfun5.cxx2
7 files changed, 21 insertions, 5 deletions
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index c1da078cf804..63a81c04ef13 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -308,6 +308,7 @@ void ScDrawTransferObj::AddSupportedFormats()
{
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
AddFormat( SOT_FORMATSTR_ID_SVXB );
+ AddFormat( SOT_FORMATSTR_ID_PNG );
AddFormat( SOT_FORMAT_BITMAP );
AddFormat( SOT_FORMAT_GDIMETAFILE );
}
@@ -319,6 +320,7 @@ void ScDrawTransferObj::AddSupportedFormats()
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
AddFormat( SOT_FORMATSTR_ID_SVXB );
AddFormat( SOT_FORMAT_GDIMETAFILE );
+ AddFormat( SOT_FORMATSTR_ID_PNG );
AddFormat( SOT_FORMAT_BITMAP );
}
else if ( pBookmark ) // url button
@@ -364,6 +366,7 @@ void ScDrawTransferObj::AddSupportedFormats()
// leave out bitmap and metafile if there are only controls
if ( !lcl_HasOnlyControls( pModel ) )
{
+ AddFormat( SOT_FORMATSTR_ID_PNG );
AddFormat( SOT_FORMAT_BITMAP );
AddFormat( SOT_FORMAT_GDIMETAFILE );
}
@@ -416,7 +419,9 @@ sal_Bool ScDrawTransferObj::GetData( const ::com::sun::star::datatransfer::DataF
{
bOK = SetObject( pModel, SCDRAWTRANS_TYPE_DRAWMODEL, rFlavor );
}
- else if ( nFormat == SOT_FORMAT_BITMAP || nFormat == SOT_FORMAT_GDIMETAFILE )
+ else if ( nFormat == SOT_FORMAT_BITMAP
+ || nFormat == SOT_FORMATSTR_ID_PNG
+ || nFormat == SOT_FORMAT_GDIMETAFILE )
{
// #i71538# use complete SdrViews
// SdrExchangeView aView( pModel );
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index 47c2bfd7860a..679a21e9e0c3 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -198,6 +198,7 @@ void ScSelectionTransferObj::AddSupportedFormats()
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
AddFormat( SOT_FORMAT_GDIMETAFILE );
+ AddFormat( SOT_FORMATSTR_ID_PNG );
AddFormat( SOT_FORMAT_BITMAP );
AddFormat( SOT_FORMATSTR_ID_HTML );
AddFormat( SOT_FORMATSTR_ID_SYLK );
@@ -214,6 +215,7 @@ void ScSelectionTransferObj::AddSupportedFormats()
case SC_SELTRANS_DRAW_BITMAP:
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
AddFormat( SOT_FORMATSTR_ID_SVXB );
+ AddFormat( SOT_FORMATSTR_ID_PNG );
AddFormat( SOT_FORMAT_BITMAP );
AddFormat( SOT_FORMAT_GDIMETAFILE );
break;
@@ -222,6 +224,7 @@ void ScSelectionTransferObj::AddSupportedFormats()
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
AddFormat( SOT_FORMATSTR_ID_SVXB );
AddFormat( SOT_FORMAT_GDIMETAFILE );
+ AddFormat( SOT_FORMATSTR_ID_PNG );
AddFormat( SOT_FORMAT_BITMAP );
break;
@@ -245,6 +248,7 @@ void ScSelectionTransferObj::AddSupportedFormats()
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
AddFormat( SOT_FORMATSTR_ID_DRAWING );
+ AddFormat( SOT_FORMATSTR_ID_PNG );
AddFormat( SOT_FORMAT_BITMAP );
AddFormat( SOT_FORMAT_GDIMETAFILE );
break;
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 5306c954c3db..b2187d5975f0 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -231,6 +231,7 @@ void ScTransferObj::AddSupportedFormats()
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
AddFormat( SOT_FORMAT_GDIMETAFILE );
+ AddFormat( SOT_FORMATSTR_ID_PNG );
AddFormat( SOT_FORMAT_BITMAP );
// ScImportExport formats
@@ -338,7 +339,7 @@ sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
OSL_FAIL("unknown DataType");
}
}
- else if ( nFormat == SOT_FORMAT_BITMAP )
+ else if ( nFormat == SOT_FORMAT_BITMAP || nFormat == SOT_FORMATSTR_ID_PNG )
{
Rectangle aMMRect = pDoc->GetMMRect( aBlock.aStart.Col(), aBlock.aStart.Row(),
aBlock.aEnd.Col(), aBlock.aEnd.Row(),
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index cf9d13b8c313..e4d1bd4466c8 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -381,6 +381,7 @@ void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFmtItem& rFormats )
lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_DRAWING );
lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_SVXB );
lcl_TestFormat( rFormats, aDataHelper, SOT_FORMAT_GDIMETAFILE );
+ lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_PNG );
lcl_TestFormat( rFormats, aDataHelper, SOT_FORMAT_BITMAP );
lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_EMBED_SOURCE );
@@ -409,7 +410,8 @@ static sal_Bool lcl_IsCellPastePossible( const TransferableDataHelper& rData )
bPossible = sal_True;
else
{
- if ( rData.HasFormat( SOT_FORMAT_BITMAP ) ||
+ if ( rData.HasFormat( SOT_FORMATSTR_ID_PNG ) ||
+ rData.HasFormat( SOT_FORMAT_BITMAP ) ||
rData.HasFormat( SOT_FORMAT_GDIMETAFILE ) ||
rData.HasFormat( SOT_FORMATSTR_ID_SVXB ) ||
rData.HasFormat( FORMAT_PRIVATE ) ||
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index f10ca07ab243..c7342e416deb 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3750,6 +3750,7 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt )
{
if ( IsDropFormatSupported(SOT_FORMATSTR_ID_SVXB)
|| IsDropFormatSupported(SOT_FORMAT_GDIMETAFILE)
+ || IsDropFormatSupported(SOT_FORMATSTR_ID_PNG)
|| IsDropFormatSupported(SOT_FORMAT_BITMAP) )
{
// graphic dragged onto drawing object
@@ -3784,6 +3785,7 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt )
IsDropFormatSupported( SOT_FORMATSTR_ID_SVXB ) ||
IsDropFormatSupported( SOT_FORMAT_RTF ) ||
IsDropFormatSupported( SOT_FORMAT_GDIMETAFILE ) ||
+ IsDropFormatSupported( SOT_FORMATSTR_ID_PNG ) ||
IsDropFormatSupported( SOT_FORMAT_BITMAP ) ||
IsDropFormatSupported( SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ) ||
IsDropFormatSupported( SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ) ||
@@ -3924,6 +3926,8 @@ static sal_uLong lcl_GetDropFormatId( const uno::Reference<datatransfer::XTransf
nFormatId = SOT_FORMAT_STRING;
else if ( aDataHelper.HasFormat( SOT_FORMAT_GDIMETAFILE ) )
nFormatId = SOT_FORMAT_GDIMETAFILE;
+ else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_PNG ) )
+ nFormatId = SOT_FORMATSTR_ID_PNG;
else if ( aDataHelper.HasFormat( SOT_FORMAT_BITMAP ) )
nFormatId = SOT_FORMAT_BITMAP;
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 210b3202e10c..f8454d3570c5 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -715,7 +715,7 @@ sal_Bool ScViewFunc::PasteOnDrawObject( const uno::Reference<datatransfer::XTran
if( aDataHelper.GetGDIMetaFile( FORMAT_GDIMETAFILE, aMtf ) )
bRet = ApplyGraphicToObject( pHitObj, Graphic(aMtf) );
}
- else if ( aDataHelper.HasFormat( SOT_FORMAT_BITMAP ) )
+ else if ( aDataHelper.HasFormat( SOT_FORMAT_BITMAP ) || aDataHelper.HasFormat( SOT_FORMATSTR_ID_PNG ) )
{
BitmapEx aBmpEx;
if( aDataHelper.GetBitmapEx( FORMAT_BITMAP, aBmpEx ) )
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 7b22da5cac04..9319bd6d5126 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -453,7 +453,7 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
}
}
}
- else if (nFormatId == SOT_FORMAT_BITMAP)
+ else if (nFormatId == SOT_FORMAT_BITMAP || nFormatId == SOT_FORMATSTR_ID_PNG)
{
BitmapEx aBmpEx;
if( aDataHelper.GetBitmapEx( FORMAT_BITMAP, aBmpEx ) )