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

Noel Grandin noel.grandin at collabora.co.uk
Wed Mar 14 06:19:25 UTC 2018


 sw/source/core/inc/noteurl.hxx     |   30 ------------------------------
 sw/source/core/layout/paintfrm.cxx |    1 -
 sw/source/core/text/noteurl.cxx    |   22 ----------------------
 3 files changed, 53 deletions(-)

New commits:
commit ed2ae3c3bb0a708cafc3de6a01adc9ddc43fb859
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Mar 13 16:29:46 2018 +0200

    remove dead SwNoteURL
    
    According to:
    
    <mst_> noelgrandin: apparently this code exists so you can export a text
    
         frame as an image and then the urls in the text become
        image-map links
    
    which means that according to my analysis below, nobody has noticed the
    removal in 17 years :-)
    
    SwNoteURL::InsertURLNote was the last place that constructed an
    SwNoteURL and it was removed in
        commit bb7ade140df807b6a0f12766a1365b8f8d0fd342
        Author: Noel Grandin <noel.grandin at collabora.co.uk>
        Date:   Wed Mar 7 13:42:58 2018 +0200
        loplugin:unusedmethods
    
    and SwNoteURL::InsertURLNote was dead because
       void SwTextPaintInfo::NotifyURL_( const SwLinePortion &rPor ) const
    was removed in
        commit 73139fe600fc1399ae828077981a2498cb0a0b0c
        Author: Noel Grandin <noel.grandin at collabora.co.uk>
        Date:   Fri Jan 19 13:10:22 2018 +0200
        loplugin:unusedmethods
    
    and SwTextPaintInfo::NotifyURL_ was dead because
       void SwTextPaintInfo::NotifyURL( const SwLinePortion &rPor ) const
    was removed in
        commit be8c414567f49242164b1fdfb12764b16be355c1
        Author: Noel Grandin <noel.grandin at collabora.co.uk>
        Date:   Fri Jan 19 09:13:03 2018 +0200
        loplugin:unusedmethods also check for functions returning bool
    
    and NotifyURL was dead because calls to it were removed in
        commit 1b666235f6b0b0f0b13f473bf3b639f4f5f0b12f
        Author: Noel Grandin <noel.grandin at collabora.co.uk>
        Date:   Wed Jan 3 09:08:52 2018 +0200
        loplugin:singlevalfields improve copy constructor check
    those calls were removed because the m_bURL field of SwFont was always
    false.
    
    tracing back, we find that m_bURL was called bURL before
        commit b4e2a13f46a247002b239d04ff3bf1d1a98d08c2
        Author: Miklos Vajna <vmiklos at collabora.co.uk>
        Date:   Mon Oct 26 08:55:17 2015 +0100
        sw: prefix members of SwFont
    
    and we find that a method
         void SwFont::SetURL(const bool)
    that modified bURL was removed in
        commit 407731c9f403c35357a0d1428c9b99835f79a5f7
        Author: Noel Grandin <noel at peralex.com>
        Date:   Tue Jul 21 10:44:17 2015 +0200
        loplugin:unusedmethods sw
    
    and we find that calls to SetURL were removed in
        commit da7671e4f7482110ecd0cfbfd7dbd9e0b873c81c
        Author: Andreas Martens <ama at openoffice.org>
        Date:   Thu Mar 15 14:59:12 2001 +0000
        Opt.(FME): The new attribute handler makes a lot of code superfluous
    
    which appears to be the root of the problem
    
    Change-Id: Id2362ce216c06bc8dcf71698695d708eb494af4e
    Reviewed-on: https://gerrit.libreoffice.org/51225
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sw/source/core/inc/noteurl.hxx b/sw/source/core/inc/noteurl.hxx
index 08b4f3f1d506..fd52fffb5dea 100644
--- a/sw/source/core/inc/noteurl.hxx
+++ b/sw/source/core/inc/noteurl.hxx
@@ -20,38 +20,8 @@
 #ifndef INCLUDED_SW_SOURCE_CORE_INC_NOTEURL_HXX
 #define INCLUDED_SW_SOURCE_CORE_INC_NOTEURL_HXX
 
-#include <swrect.hxx>
-
-#include <rtl/ustring.hxx>
-
-#include <vector>
-
-class ImageMap;
-class MapMode;
-
-class SwURLNote
-{
-    OUString aURL;
-    OUString aTarget;
-    SwRect aRect;
-public:
-    SwURLNote( const OUString& rURL, const OUString& rTarget, const SwRect& rRect )
-    : aURL( rURL ), aTarget( rTarget ), aRect( rRect )
-    {}
-    const OUString& GetURL()      const { return aURL; }
-    const OUString& GetTarget()   const { return aTarget; }
-    const SwRect& GetRect()     const { return aRect; }
-};
-
 class SwNoteURL
 {
-private:
-    std::vector<SwURLNote> m_List;
-
-public:
-    SwNoteURL() {}
-
-    void FillImageMap( ImageMap* pMap, const Point& rPos, const MapMode& rMap );
 };
 
 // globale Variable, in NoteURL.Cxx angelegt
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index d9c727202df4..cd9d53cfbd74 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -7367,7 +7367,6 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap )
         if( bNoteURL )
         {
             OSL_ENSURE( pNoteURL, "MakeGraphic: Good Bye, NoteURL." );
-            pNoteURL->FillImageMap( pMap, pFly->getFrameArea().Pos(), aMap );
             delete pNoteURL;
             pNoteURL = nullptr;
         }
diff --git a/sw/source/core/text/noteurl.cxx b/sw/source/core/text/noteurl.cxx
index e36ca87038b8..d6060c690553 100644
--- a/sw/source/core/text/noteurl.cxx
+++ b/sw/source/core/text/noteurl.cxx
@@ -28,26 +28,4 @@
 // Global variable
 SwNoteURL *pNoteURL = nullptr;
 
-void SwNoteURL::FillImageMap( ImageMap *pMap, const Point &rPos,
-    const MapMode& rMap )
-{
-    OSL_ENSURE( pMap, "FillImageMap: No ImageMap, no cookies!" );
-    const size_t nCount = m_List.size();
-    if( nCount )
-    {
-        MapMode aMap( MapUnit::Map100thMM );
-        for( size_t i = 0; i < nCount; ++i )
-        {
-            const SwURLNote &rNote = m_List[i];
-            SwRect aSwRect( rNote.GetRect() );
-            aSwRect -= rPos;
-            tools::Rectangle aRect( OutputDevice::LogicToLogic( aSwRect.SVRect(),
-                                                         rMap, aMap ) );
-            IMapRectangleObject aObj( aRect, rNote.GetURL(), OUString(), OUString(),
-                                      rNote.GetTarget(), OUString(), true, false );
-            pMap->InsertIMapObject( aObj );
-        }
-    }
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list