tdf#119388 use virtual to bypass dynamic_cast

in SdrObjList::ReformatAllEdgeObjects, shaves 10% of the time off

Change-Id: Iceee362d0e3326d046f1ef5039457941160cee4f
Reviewed-on: https://gerrit.libreoffice.org/78019
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 0b1e5c3..2d3dd91 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -911,6 +911,8 @@ public:

    void setSuitableOutlinerBg(Outliner& rOutliner) const;

    virtual bool IsSdrEdgeObj() const { return false; }

protected:
    tools::Rectangle            aOutRect;     // surrounding rectangle for Paint (incl. LineWidth, ...)
    Point                       aAnchor;      // anchor position (Writer)
diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx
index 16127d9..f2b707f 100644
--- a/include/svx/svdoedge.hxx
+++ b/include/svx/svdoedge.hxx
@@ -168,6 +168,8 @@ public:
    void SetSuppressDefaultConnect(bool bNew) { mbSuppressDefaultConnect = bNew; }
    bool GetSuppressDefaultConnect() const { return mbSuppressDefaultConnect; }

    virtual bool IsSdrEdgeObj() const override { return true; }

protected:
    virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;

diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 77941e8..0d38249 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -612,12 +612,12 @@ void SdrObjList::ReformatAllEdgeObjects()

    while(aIter.IsMore())
    {
        SdrEdgeObj* pSdrEdgeObj = dynamic_cast< SdrEdgeObj* >(aIter.Next());
        SdrObject* pObj = aIter.Next();
        if (!pObj->IsSdrEdgeObj())
            continue;

        if(pSdrEdgeObj)
        {
            pSdrEdgeObj->Reformat();
        }
        SdrEdgeObj* pSdrEdgeObj = static_cast< SdrEdgeObj* >(pObj);
        pSdrEdgeObj->Reformat();
    }
}