summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2019-05-28 22:03:58 +0300
committerTor Lillqvist <tml@collabora.com>2019-05-28 22:44:08 +0300
commitedf1f755d40c5423ffb411ff17f024fbafeb02b3 (patch)
tree6445ebd8a75a3442ade7acc6b58709a185068d97 /sw
parente1cd536edd2636d150ae50b0d44a5aee1b8d4e34 (diff)
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
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx24
1 files changed, 21 insertions, 3 deletions
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index e5e71a251629..5641758d1bfb 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -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;