[Libreoffice-commits] core.git: compilerplugins/clang include/svx svx/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 27 06:35:21 UTC 2019


 compilerplugins/clang/virtualdead.results |    9 ----
 include/svx/sdr/table/tablecontroller.hxx |    1 
 include/svx/selectioncontroller.hxx       |    3 -
 include/svx/svdobj.hxx                    |    3 -
 include/svx/svdoedge.hxx                  |    1 
 svx/source/dialog/docrecovery.cxx         |   10 -----
 svx/source/inc/docrecovery.hxx            |    5 --
 svx/source/svdraw/selectioncontroller.cxx |    5 --
 svx/source/svdraw/svdedxv.cxx             |    3 -
 svx/source/svdraw/svdmark.cxx             |   57 ++++++++++++++----------------
 svx/source/svdraw/svdobj.cxx              |    5 --
 svx/source/svdraw/svdoedge.cxx            |    8 ----
 svx/source/table/tablecontroller.cxx      |    6 ---
 svx/source/unodraw/gluepts.cxx            |   19 ++++------
 14 files changed, 36 insertions(+), 99 deletions(-)

New commits:
commit c0731052db789a876fbc98aceba0f067abba93d1
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Sep 26 11:11:37 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Sep 27 08:33:58 2019 +0200

    loplugin:virtualdead in svx
    
    Change-Id: I8af09a2f0a4a8c7952c5855b2934f2d0a64d9740
    Reviewed-on: https://gerrit.libreoffice.org/79638
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/virtualdead.results b/compilerplugins/clang/virtualdead.results
index f390455930ec..b8b5fa873949 100644
--- a/compilerplugins/clang/virtualdead.results
+++ b/compilerplugins/clang/virtualdead.results
@@ -100,12 +100,6 @@ include/svl/undo.hxx:168
 include/svtools/unoevent.hxx:199
     unsigned short SvEventDescriptor::getMacroItemWhich()const
     108
-include/svx/selectioncontroller.hxx:68
-    _Bool sdr::SelectionController::TakeFormatPaintBrush(class std::shared_ptr<class SfxItemSet> &,)
-    0
-include/svx/svdobj.hxx:711
-    _Bool SdrObject::IsNode()const
-    1
 include/test/text/xtextcontent.hxx:29
     _Bool apitest::XTextContent::isAttachSupported()
     1
@@ -143,9 +137,6 @@ slideshow/source/engine/animationfactory.cxx:443
 slideshow/source/inc/slide.hxx:118
     void slideshow::internal::Slide::disablePaintOverlay()
     empty
-svx/source/inc/docrecovery.hxx:162
-    void svx::DocRecovery::IRecoveryUpdateListener::start()
-    empty
 vcl/inc/salframe.hxx:145
     void SalFrame::SetRepresentedURL(const class rtl::OUString &,)
     empty
diff --git a/include/svx/sdr/table/tablecontroller.hxx b/include/svx/sdr/table/tablecontroller.hxx
index 1c8e6e214d28..8359a15c4dbe 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -64,7 +64,6 @@ public:
     SVX_DLLPRIVATE virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const override;
     SVX_DLLPRIVATE virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr ) override;
 
-    SVX_DLLPRIVATE virtual bool TakeFormatPaintBrush( std::shared_ptr< SfxItemSet >& rFormatSet  ) override;
     SVX_DLLPRIVATE virtual bool ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats ) override;
 
     // slots
diff --git a/include/svx/selectioncontroller.hxx b/include/svx/selectioncontroller.hxx
index 70bdaced27d6..79c19f60dc61 100644
--- a/include/svx/selectioncontroller.hxx
+++ b/include/svx/selectioncontroller.hxx
@@ -64,9 +64,6 @@ public:
     virtual SdrObject* GetMarkedSdrObjClone( SdrModel& rTargetModel );
     virtual bool PasteObjModel( const SdrModel& rModel );
 
-    /** returns a format paint brush set from the current selection */
-    virtual bool TakeFormatPaintBrush( std::shared_ptr< SfxItemSet >& rFormatSet  );
-
     /** applies a format paint brush set from the current selection.
         if bNoCharacterFormats is true, no character attributes are changed.
         if bNoParagraphFormats is true, no paragraph attributes are changed.
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 46d81b7f4bbb..b16005c37290 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -707,9 +707,6 @@ public:
     // This is also true for SetGluePoint()... on the node.
     // On the other hand, moving/resizing an edge breaks the connection.
 
-    // is object a node?
-    virtual bool IsNode() const;
-
     // automatic glue points:
     // a node object must provide four vertex and corner positions
     // usually 0: top, 1: right, 2: bottom, 3: left
diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx
index 056c19ccae35..c78648d65019 100644
--- a/include/svx/svdoedge.hxx
+++ b/include/svx/svdoedge.hxx
@@ -199,7 +199,6 @@ public:
     virtual sal_uInt16 GetObjIdentifier() const override;
     virtual const tools::Rectangle& GetCurrentBoundRect() const override;
     virtual const tools::Rectangle& GetSnapRect() const override;
-    virtual bool IsNode() const override;
     virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const override;
     virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const override;
     virtual const SdrGluePointList* GetGluePointList() const override;
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index 0039c0fad917..75b9f3b87042 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -352,8 +352,6 @@ void SAL_CALL RecoveryCore::statusChanged(const css::frame::FeatureStateEvent& a
     //    FeatureDescriptor = "start" || "stop"
     if (aEvent.FeatureDescriptor == RECOVERY_OPERATIONSTATE_START)
     {
-        if (m_pListener)
-            m_pListener->start();
         return;
     }
 
@@ -632,10 +630,6 @@ void SaveProgressDialog::stepNext(TURLInfo* )
     */
 }
 
-void SaveProgressDialog::start()
-{
-}
-
 void SaveProgressDialog::end()
 {
     m_xDialog->response(DLG_RET_OK);
@@ -877,10 +871,6 @@ short RecoveryDialog::execute()
     return DLG_RET_OK;
 }
 
-void RecoveryDialog::start()
-{
-}
-
 void RecoveryDialog::updateItems()
 {
     int c = m_xFileListLB->n_children();
diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx
index 48014e6cdd63..525f589f3896 100644
--- a/svx/source/inc/docrecovery.hxx
+++ b/svx/source/inc/docrecovery.hxx
@@ -158,9 +158,6 @@ class IRecoveryUpdateListener
         // inform listener about changed items, which should be refreshed
         virtual void updateItems() = 0;
 
-        // inform listener about starting of the asynchronous recovery operation
-        virtual void start() = 0;
-
         // inform listener about ending of the asynchronous recovery operation
         virtual void end() = 0;
 
@@ -378,7 +375,6 @@ class SaveProgressDialog : public weld::GenericDialogController
         // IRecoveryUpdateListener
         virtual void updateItems() override;
         virtual void stepNext(TURLInfo* pItem) override;
-        virtual void start() override;
         virtual void end() override;
 };
 
@@ -431,7 +427,6 @@ class RecoveryDialog : public weld::GenericDialogController
         // IRecoveryUpdateListener
         virtual void updateItems() override;
         virtual void stepNext(TURLInfo* pItem) override;
-        virtual void start() override;
         virtual void end() override;
 
         short execute();
diff --git a/svx/source/svdraw/selectioncontroller.cxx b/svx/source/svdraw/selectioncontroller.cxx
index 8cb678d66467..28dda4ed27a2 100644
--- a/svx/source/svdraw/selectioncontroller.cxx
+++ b/svx/source/svdraw/selectioncontroller.cxx
@@ -90,11 +90,6 @@ bool SelectionController::PasteObjModel( const SdrModel& /*rModel*/ )
     return false;
 }
 
-bool SelectionController::TakeFormatPaintBrush( std::shared_ptr< SfxItemSet >& /*rFormatSet*/  )
-{
-    return false;
-}
-
 bool SelectionController::ApplyFormatPaintBrush( SfxItemSet& /*rFormatSet*/, bool /*bNoCharacterFormats*/, bool /*bNoParagraphFormats*/ )
 {
     return false;
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index bc4839d1ec15..ab186938f46c 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2678,9 +2678,6 @@ static const sal_uInt16* GetFormatRangeImpl(bool bTextOnly)
 
 void SdrObjEditView::TakeFormatPaintBrush(std::shared_ptr<SfxItemSet>& rFormatSet)
 {
-    if (mxSelectionController.is() && mxSelectionController->TakeFormatPaintBrush(rFormatSet))
-        return;
-
     const SdrMarkList& rMarkList = GetMarkedObjectList();
     if (rMarkList.GetMarkCount() > 0)
     {
diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx
index 9001e601ca8c..6f07641c1953 100644
--- a/svx/source/svdraw/svdmark.cxx
+++ b/svx/source/svdraw/svdmark.cxx
@@ -745,43 +745,40 @@ namespace sdr
                     // build transitive hull
                     ImplCollectCompleteSelection(pCandidate);
 
-                    if(pCandidate->IsNode())
+                    // travel over broadcaster/listener to access edges connected to the selected object
+                    const SfxBroadcaster* pBC = pCandidate->GetBroadcaster();
+
+                    if(pBC)
                     {
-                        // travel over broadcaster/listener to access edges connected to the selected object
-                        const SfxBroadcaster* pBC = pCandidate->GetBroadcaster();
+                        const size_t nLstCnt(pBC->GetSizeOfVector());
 
-                        if(pBC)
+                        for(size_t nl=0; nl < nLstCnt; ++nl)
                         {
-                            const size_t nLstCnt(pBC->GetSizeOfVector());
+                            SfxListener* pLst = pBC->GetListener(nl);
+                            SdrEdgeObj* pEdge = dynamic_cast<SdrEdgeObj*>( pLst );
 
-                            for(size_t nl=0; nl < nLstCnt; ++nl)
+                            if(pEdge && pEdge->IsInserted() && pEdge->getSdrPageFromSdrObject() == pCandidate->getSdrPageFromSdrObject())
                             {
-                                SfxListener* pLst = pBC->GetListener(nl);
-                                SdrEdgeObj* pEdge = dynamic_cast<SdrEdgeObj*>( pLst );
+                                SdrMark aM(pEdge, maMarkedObjectList.GetMark(a)->GetPageView());
 
-                                if(pEdge && pEdge->IsInserted() && pEdge->getSdrPageFromSdrObject() == pCandidate->getSdrPageFromSdrObject())
+                                if(pEdge->GetConnectedNode(true) == pCandidate)
+                                {
+                                    aM.SetCon1(true);
+                                }
+
+                                if(pEdge->GetConnectedNode(false) == pCandidate)
+                                {
+                                    aM.SetCon2(true);
+                                }
+
+                                if(SAL_MAX_SIZE == maMarkedObjectList.FindObject(pEdge))
+                                {
+                                    // check if it itself is selected
+                                    maEdgesOfMarkedNodes.InsertEntry(aM);
+                                }
+                                else
                                 {
-                                    SdrMark aM(pEdge, maMarkedObjectList.GetMark(a)->GetPageView());
-
-                                    if(pEdge->GetConnectedNode(true) == pCandidate)
-                                    {
-                                        aM.SetCon1(true);
-                                    }
-
-                                    if(pEdge->GetConnectedNode(false) == pCandidate)
-                                    {
-                                        aM.SetCon2(true);
-                                    }
-
-                                    if(SAL_MAX_SIZE == maMarkedObjectList.FindObject(pEdge))
-                                    {
-                                        // check if it itself is selected
-                                        maEdgesOfMarkedNodes.InsertEntry(aM);
-                                    }
-                                    else
-                                    {
-                                        maMarkedEdgesOfMarkedNodes.InsertEntry(aM);
-                                    }
+                                    maMarkedEdgesOfMarkedNodes.InsertEntry(aM);
                                 }
                             }
                         }
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index c1cb84e9b3c0..58d06fe6b25c 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -2182,11 +2182,6 @@ void SdrObject::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemove
 // Broadcasting while setting attributes is managed by the AttrObj.
 
 
-bool SdrObject::IsNode() const
-{
-    return true;
-}
-
 SdrGluePoint SdrObject::GetVertexGluePoint(sal_uInt16 nPosNum) const
 {
     // #i41936# Use SnapRect for default GluePoints
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index a06fde26b304..3e052fc825e1 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -408,11 +408,6 @@ void SdrEdgeObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
     rRect=GetSnapRect();
 }
 
-bool SdrEdgeObj::IsNode() const
-{
-    return true;
-}
-
 SdrGluePoint SdrEdgeObj::GetVertexGluePoint(sal_uInt16 nNum) const
 {
     Point aPt;
@@ -2164,8 +2159,7 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrO
         no--;
         SdrObject* pObj=pOL->GetObj(no);
         if (rVisLayer.IsSet(pObj->GetLayer()) && pObj->IsVisible() &&      // only visible objects
-            (pThis==nullptr || pObj!=static_cast<SdrObject const *>(pThis)) && // don't connect it to itself
-            pObj->IsNode())
+            (pThis==nullptr || pObj!=static_cast<SdrObject const *>(pThis))) // don't connect it to itself
         {
             tools::Rectangle aObjBound(pObj->GetCurrentBoundRect());
             if (aObjBound.IsOver(aMouseRect)) {
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 4bb15a495ce0..45a3840149ac 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -2816,12 +2816,6 @@ bool SvxTableController::PasteObject( SdrTableObj const * pPasteTableObj )
     return true;
 }
 
-bool SvxTableController::TakeFormatPaintBrush( std::shared_ptr< SfxItemSet >& /*rFormatSet*/  )
-{
-    // SdrView::TakeFormatPaintBrush() is enough
-    return false;
-}
-
 bool SvxTableController::ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats )
 {
     if(!mbCellSelectionMode)
diff --git a/svx/source/unodraw/gluepts.cxx b/svx/source/unodraw/gluepts.cxx
index 445313698ad5..2b1ba019292e 100644
--- a/svx/source/unodraw/gluepts.cxx
+++ b/svx/source/unodraw/gluepts.cxx
@@ -259,7 +259,7 @@ void SAL_CALL SvxUnoGluePointAccess::removeByIdentifier( sal_Int32 Identifier )
 // XIdentifierReplace
 void SAL_CALL SvxUnoGluePointAccess::replaceByIdentifer( sal_Int32 Identifier, const uno::Any& aElement )
 {
-    if( mpObject.is() && mpObject->IsNode() )
+    if( mpObject.is() )
     {
         struct drawing::GluePoint2 aGluePoint;
         if( (Identifier < NON_USER_DEFINED_GLUE_POINTS) || !(aElement >>= aGluePoint))
@@ -293,7 +293,7 @@ void SAL_CALL SvxUnoGluePointAccess::replaceByIdentifer( sal_Int32 Identifier, c
 // XIdentifierAccess
 uno::Any SAL_CALL SvxUnoGluePointAccess::getByIdentifier( sal_Int32 Identifier )
 {
-    if( mpObject.is() && mpObject->IsNode() )
+    if( mpObject.is() )
     {
         struct drawing::GluePoint2 aGluePoint;
 
@@ -447,14 +447,11 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::getCount()
     {
         // each node has a default of 4 glue points
         // and any number of user defined glue points
-        if( mpObject->IsNode() )
-        {
-            nCount += 4;
+        nCount += 4;
 
-            const SdrGluePointList* pList = mpObject->GetGluePointList();
-            if( pList )
-                nCount += pList->GetCount();
-        }
+        const SdrGluePointList* pList = mpObject->GetGluePointList();
+        if( pList )
+            nCount += pList->GetCount();
     }
 
     return nCount;
@@ -462,7 +459,7 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::getCount()
 
 uno::Any SAL_CALL SvxUnoGluePointAccess::getByIndex( sal_Int32 Index )
 {
-    if( Index >= 0 && mpObject.is() && mpObject->IsNode() )
+    if( Index >= 0 && mpObject.is() )
     {
         struct drawing::GluePoint2 aGluePoint;
 
@@ -498,7 +495,7 @@ uno::Type SAL_CALL SvxUnoGluePointAccess::getElementType()
 
 sal_Bool SAL_CALL SvxUnoGluePointAccess::hasElements()
 {
-    return mpObject.is() && mpObject->IsNode();
+    return mpObject.is();
 }
 
 /**


More information about the Libreoffice-commits mailing list