Kaydet (Commit) edf1f755 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

tdf#124752: Reduce number of formats offered on clipboard on mobile devices

It seems a bit pointless to offer formats that no other app will use.

Change-Id: I54474a4ba40d91c184592cede4224cbfbb78d518
üst e1cd536e
......@@ -826,8 +826,10 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
SwDoc *const pDoc = lcl_GetDoc(*m_pClpDocFac);
m_pWrtShell->Copy( pDoc );
#if HAVE_FEATURE_DESKTOP
if (m_pOrigGraphic && !m_pOrigGraphic->GetBitmapEx().IsEmpty())
AddFormat( SotClipboardFormatId::SVXB );
#endif
PrepareOLE( m_aObjDesc );
AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
......@@ -835,9 +837,11 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
const Graphic* pGrf = m_pWrtShell->GetGraphic();
if( pGrf && pGrf->IsSupportedGraphic() )
{
AddFormat( SotClipboardFormatId::GDIMETAFILE );
AddFormat( SotClipboardFormatId::PNG );
#if HAVE_FEATURE_DESKTOP
AddFormat( SotClipboardFormatId::GDIMETAFILE );
AddFormat( SotClipboardFormatId::BITMAP );
#endif
}
m_eBufferType = TransferBufferType::Graphic;
m_pWrtShell->GetGrfNms( &sGrfNm, nullptr );
......@@ -857,8 +861,9 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
m_aObjDesc.maSize = OutputDevice::LogicToLogic(m_pWrtShell->GetObjSize(), MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM));
// <--
PrepareOLE( m_aObjDesc );
AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
#if HAVE_FEATURE_DESKTOP
AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
AddFormat( SotClipboardFormatId::GDIMETAFILE );
// Fetch the formats supported via embedtransferhelper as well
......@@ -876,6 +881,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
AddFormat( rItem );
}
}
#endif
m_eBufferType = TransferBufferType::Ole;
}
// Is there anything to provide anyway?
......@@ -938,15 +944,19 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
bDDELink = m_pWrtShell->HasWholeTabSelection();
}
#if HAVE_FEATURE_DESKTOP
//When someone needs it, we 'OLE' him something
AddFormat( SotClipboardFormatId::EMBED_SOURCE );
#endif
//put RTF ahead of the OLE's Metafile to have less loss
if( !m_pWrtShell->IsObjSelected() )
{
AddFormat( SotClipboardFormatId::RTF );
#if HAVE_FEATURE_DESKTOP
AddFormat( SotClipboardFormatId::RICHTEXT );
AddFormat( SotClipboardFormatId::HTML );
#endif
}
if( m_pWrtShell->IsSelection() )
AddFormat( SotClipboardFormatId::STRING );
......@@ -956,9 +966,11 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
AddFormat( SotClipboardFormatId::DRAWING );
if ( nSelection & SelectionType::DrawObject )
{
#if HAVE_FEATURE_DESKTOP
AddFormat( SotClipboardFormatId::GDIMETAFILE );
AddFormat( SotClipboardFormatId::PNG );
AddFormat( SotClipboardFormatId::BITMAP );
#endif
AddFormat( SotClipboardFormatId::PNG );
}
m_eBufferType = static_cast<TransferBufferType>( TransferBufferType::Graphic | m_eBufferType );
......@@ -975,10 +987,12 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
if( m_pWrtShell->GetURLFromButton( sURL, sDesc ) )
{
AddFormat( SotClipboardFormatId::STRING );
#if HAVE_FEATURE_DESKTOP
AddFormat( SotClipboardFormatId::SOLK );
AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK );
AddFormat( SotClipboardFormatId::FILECONTENT );
AddFormat( SotClipboardFormatId::FILEGRPDESCRIPTOR );
#endif
AddFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR );
m_eBufferType = TransferBufferType::InetField | m_eBufferType;
nRet = 1;
......@@ -991,7 +1005,9 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
nullptr != ( pDShell = m_pWrtShell->GetDoc()->GetDocShell()) &&
SfxObjectCreateMode::STANDARD == pDShell->GetCreateMode() )
{
#if HAVE_FEATURE_DESKTOP
AddFormat( SotClipboardFormatId::LINK );
#endif
m_xDdeLink = new SwTrnsfrDdeLink( *this, *m_pWrtShell );
}
......@@ -1002,7 +1018,9 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
m_aObjDesc.maSize = OutputDevice::LogicToLogic(aSz, MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM));
PrepareOLE( m_aObjDesc );
#if HAVE_FEATURE_DESKTOP
AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
#endif
}
else
nRet = 0;
......
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