[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/source
Tor Lillqvist (via logerrit)
logerrit at kemper.freedesktop.org
Fri Sep 20 12:14:18 UTC 2019
sw/source/uibase/dochdl/swdtflvr.cxx | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
New commits:
commit 1db820d9132ad3e813d018b8d847749a91cbe08b
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue May 28 22:03:58 2019 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Fri Sep 20 14:13:24 2019 +0200
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
Reviewed-on: https://gerrit.libreoffice.org/79231
Reviewed-by: Tor Lillqvist <tml at collabora.com>
Tested-by: Tor Lillqvist <tml at collabora.com>
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index ef5abb43a505..ea12ee91601a 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -831,8 +831,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 );
@@ -840,9 +842,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 );
@@ -862,8 +866,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
@@ -881,6 +886,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
AddFormat( rItem );
}
}
+#endif
m_eBufferType = TransferBufferType::Ole;
}
// Is there anything to provide anyway?
@@ -943,15 +949,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 );
@@ -961,9 +971,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 );
@@ -980,10 +992,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;
@@ -996,7 +1010,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 );
}
@@ -1007,7 +1023,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;
More information about the Libreoffice-commits
mailing list