sw/source/core/inc/cellfrm.hxx   |    3 +++
 sw/source/core/inc/frame.hxx     |    4 ++--
 sw/source/core/layout/tabfrm.cxx |   16 ++++++++++++----
 3 files changed, 17 insertions(+), 6 deletions(-)

New commits:
commit b4494f276795d1bb419d258ed0b2ec33c92c7290
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Nov 25 15:55:48 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Nov 27 08:25:34 2019 +0100

    tdf#108642 remove dynamic_cast
    
    use virtual method instead.
    Takes the opening time from 10.5s to 9.2s for me.
    
    Change-Id: I015c05b112dd7e8b7ea3ef722e082d25a3062cce
    Reviewed-on: https://gerrit.libreoffice.org/83847
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx
index 4e293a601f45..43de64d2adf6 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -55,6 +55,9 @@ public:
     SwCellFrame* GetFollowCell() const;
     SwCellFrame* GetPreviousCell() const;
 
+    virtual bool IsLeaveUpperAllowed() const override;
+    virtual bool IsCoveredCell() const override;
+
     // used for rowspan stuff:
     const SwCellFrame& FindStartEndOfRowSpanCell( bool bStart ) const;
     long GetLayoutRowSpan() const;
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 38d1026706bc..a16deaf02094 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -891,8 +891,8 @@ public:
     // NEW TABLES
     // Some functions for covered/covering table cells. This way unnecessary
     // includes can be avoided
-    bool IsLeaveUpperAllowed() const;
-    bool IsCoveredCell() const;
+    virtual bool IsLeaveUpperAllowed() const;
+    virtual bool IsCoveredCell() const;
     bool IsInCoveredCell() const;
 
     // #i81146# new loop control
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index b7ffcceabdd5..1327dfbbe755 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -5694,14 +5694,22 @@ SwTwips SwTabFrame::CalcHeightOfFirstContentLine() const
 
 bool SwFrame::IsLeaveUpperAllowed() const
 {
-    const SwCellFrame* pThisCell = dynamic_cast<const SwCellFrame*>(this);
-    return pThisCell && pThisCell->GetLayoutRowSpan() > 1;
+    return false;
+}
+
+bool SwCellFrame::IsLeaveUpperAllowed() const
+{
+    return GetLayoutRowSpan() > 1;
 }
 
 bool SwFrame::IsCoveredCell() const
 {
-    const SwCellFrame* pThisCell = dynamic_cast<const SwCellFrame*>(this);
-    return pThisCell && pThisCell->GetLayoutRowSpan() < 1;
+    return false;
+}
+
+bool SwCellFrame::IsCoveredCell() const
+{
+    return GetLayoutRowSpan() < 1;
 }
 
 bool SwFrame::IsInCoveredCell() const
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to