[Libreoffice-commits] core.git: include/svtools svtools/source sw/source sw/uiconfig

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jul 17 08:26:54 UTC 2018


 include/svtools/transfer.hxx           |    3 --
 svtools/source/misc/transfer2.cxx      |   45 ---------------------------------
 sw/source/uibase/docvw/romenu.cxx      |   12 --------
 sw/source/uibase/docvw/romenu.hxx      |    1 
 sw/uiconfig/swriter/ui/readonlymenu.ui |    8 -----
 5 files changed, 69 deletions(-)

New commits:
commit 923131f8b47f7ae53b1385df213722991673bffa
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Sun Jul 8 19:30:28 2018 +0200
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Tue Jul 17 10:26:33 2018 +0200

    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 at collabora.co.uk>

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>


More information about the Libreoffice-commits mailing list