summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2018-07-08 19:30:28 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-07-17 10:26:33 +0200
commit923131f8b47f7ae53b1385df213722991673bffa (patch)
treea2a2fe163cf11aec36edef4905c4dd47ea4e563e
parenta51e14849606111e9dcbccb2707786c53e0f732d (diff)
tdf#105262 Clean up CopyGraphic
It's only available in read-only mode, it doesn't work and the images can be copied with the normal copy option Change-Id: I6493147309104b2b0f3881a667547c38d7633ef3 Reviewed-on: https://gerrit.libreoffice.org/57162 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--include/svtools/transfer.hxx3
-rw-r--r--svtools/source/misc/transfer2.cxx45
-rw-r--r--sw/source/uibase/docvw/romenu.cxx12
-rw-r--r--sw/source/uibase/docvw/romenu.hxx1
-rw-r--r--sw/uiconfig/swriter/ui/readonlymenu.ui8
5 files changed, 0 insertions, 69 deletions
diff --git a/include/svtools/transfer.hxx b/include/svtools/transfer.hxx
index 4091a8f087d1..dfd6e1b77dc0 100644
--- a/include/svtools/transfer.hxx
+++ b/include/svtools/transfer.hxx
@@ -487,9 +487,6 @@ public:
virtual ~TransferDataContainer() override;
void CopyINetBookmark( const INetBookmark& rBkmk );
- void CopyINetImage( const INetImage& rINtImg );
- void CopyImageMap( const ImageMap& rImgMap );
- void CopyGraphic( const Graphic& rGrf );
void CopyString( const OUString& rStr );
void CopyString( SotClipboardFormatId nFmt, const OUString& rStr );
void CopyAny( SotClipboardFormatId nFmt, const css::uno::Any& rAny );
diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx
index b1ece2619f52..f41163a729ba 100644
--- a/svtools/source/misc/transfer2.cxx
+++ b/svtools/source/misc/transfer2.cxx
@@ -427,51 +427,6 @@ void TransferDataContainer::CopyByteString( SotClipboardFormatId nFormatId,
}
-void TransferDataContainer::CopyINetImage( const INetImage& rINtImg )
-{
- SvMemoryStream aMemStm( 1024, 1024 );
- aMemStm.SetVersion( SOFFICE_FILEFORMAT_50 );
- rINtImg.Write( aMemStm, SotClipboardFormatId::INET_IMAGE );
- CopyAnyData( SotClipboardFormatId::INET_IMAGE, static_cast<sal_Char const *>(aMemStm.GetData()),
- aMemStm.Seek( STREAM_SEEK_TO_END ) );
-}
-
-
-void TransferDataContainer::CopyImageMap( const ImageMap& rImgMap )
-{
- SvMemoryStream aMemStm( 8192, 8192 );
- aMemStm.SetVersion( SOFFICE_FILEFORMAT_50 );
- rImgMap.Write( aMemStm );
- CopyAnyData( SotClipboardFormatId::SVIM, static_cast<sal_Char const *>(aMemStm.GetData()),
- aMemStm.Seek( STREAM_SEEK_TO_END ) );
-}
-
-
-void TransferDataContainer::CopyGraphic( const Graphic& rGrf )
-{
- GraphicType nType = rGrf.GetType();
- if( GraphicType::NONE == nType )
- return;
-
- if( !pImpl->pGrf )
- pImpl->pGrf.reset( new Graphic( rGrf ) );
- else
- *pImpl->pGrf = rGrf;
-
- AddFormat( SotClipboardFormatId::SVXB );
-
- if( GraphicType::Bitmap == nType )
- {
- AddFormat( SotClipboardFormatId::PNG );
- AddFormat( SotClipboardFormatId::BITMAP );
- }
- else if( GraphicType::GdiMetafile == nType )
- {
- AddFormat( SotClipboardFormatId::GDIMETAFILE );
- }
-}
-
-
void TransferDataContainer::CopyString( SotClipboardFormatId nFmt, const OUString& rStr )
{
if( !rStr.isEmpty() )
diff --git a/sw/source/uibase/docvw/romenu.cxx b/sw/source/uibase/docvw/romenu.cxx
index af8a625c55cf..3b56c4b2fb29 100644
--- a/sw/source/uibase/docvw/romenu.cxx
+++ b/sw/source/uibase/docvw/romenu.cxx
@@ -102,7 +102,6 @@ SwReadOnlyPopup::SwReadOnlyPopup(const Point &rDPos, SwView &rV)
, m_nReadonlyBackgroundTogallerylink(m_xMenu->GetItemId("backaslink"))
, m_nReadonlyBackgroundTogallerycopy(m_xMenu->GetItemId("backascopy"))
, m_nReadonlyCopylink(m_xMenu->GetItemId("copylink"))
- , m_nReadonlyCopyGraphic(m_xMenu->GetItemId("copygraphic"))
, m_nReadonlyLoadGraphic(m_xMenu->GetItemId("loadgraphic"))
, m_nReadonlyGraphicoff(m_xMenu->GetItemId("imagesoff"))
, m_nReadonlyFullscreen(m_xMenu->GetItemId("fullscreen"))
@@ -133,7 +132,6 @@ SwReadOnlyPopup::SwReadOnlyPopup(const Point &rDPos, SwView &rV)
if ( nullptr == (pGrf = rSh.GetGrfAtPos( m_rDocPos, m_sGrfName, bLink )) )
{
m_xMenu->EnableItem(m_nReadonlySaveGraphic, false);
- m_xMenu->EnableItem(m_nReadonlyCopyGraphic, false);
}
else
{
@@ -318,16 +316,6 @@ void SwReadOnlyPopup::Execute( vcl::Window* pWin, sal_uInt16 nId )
pClipCntnr = new TransferDataContainer;
pClipCntnr->CopyString( m_sURL );
}
- else if (nId == m_nReadonlyCopyGraphic)
- {
- pClipCntnr = new TransferDataContainer;
- pClipCntnr->CopyGraphic( m_aGraphic );
-
- if( m_pImageMap )
- pClipCntnr->CopyImageMap( *m_pImageMap );
- if( m_pTargetURL )
- pClipCntnr->CopyINetImage( *m_pTargetURL );
- }
else if (nId == m_nReadonlyLoadGraphic)
{
bool bModified = rSh.IsModified();
diff --git a/sw/source/uibase/docvw/romenu.hxx b/sw/source/uibase/docvw/romenu.hxx
index 7ddf442f7f17..06ac4ee3536b 100644
--- a/sw/source/uibase/docvw/romenu.hxx
+++ b/sw/source/uibase/docvw/romenu.hxx
@@ -52,7 +52,6 @@ class SwReadOnlyPopup
sal_uInt16 m_nReadonlyBackgroundTogallerylink;
sal_uInt16 m_nReadonlyBackgroundTogallerycopy;
sal_uInt16 m_nReadonlyCopylink;
- sal_uInt16 m_nReadonlyCopyGraphic;
sal_uInt16 m_nReadonlyLoadGraphic;
sal_uInt16 m_nReadonlyGraphicoff;
sal_uInt16 m_nReadonlyFullscreen;
diff --git a/sw/uiconfig/swriter/ui/readonlymenu.ui b/sw/uiconfig/swriter/ui/readonlymenu.ui
index aab8ca271bc0..830772063720 100644
--- a/sw/uiconfig/swriter/ui/readonlymenu.ui
+++ b/sw/uiconfig/swriter/ui/readonlymenu.ui
@@ -186,14 +186,6 @@
</object>
</child>
<child>
- <object class="GtkMenuItem" id="copygraphic">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="readonlymenu|copygraphic">Copy _Image</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
<object class="GtkSeparatorMenuItem" id="menuitem6">
<property name="visible">True</property>
<property name="can_focus">False</property>