summaryrefslogtreecommitdiff
path: root/sw/inc/calbck.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-10-29 11:09:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-29 18:10:32 +0200
commitf2ec354bf4f535132d34b206382cceb22ec7f43c (patch)
treef0c0af9e6328b8a2d662b6646f4b303ecc877b2b /sw/inc/calbck.hxx
parent32b0b79c3f71e4aca995aa92ee519d93a3ca2b3b (diff)
tdf#126788 dynamic_cast -> virtual call
use a virtual method to speed up dynamic_cast to SwTable node Change-Id: I0e8eb8d671ac7aa1d15f1f4b37fb4c17220fafca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142014 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc/calbck.hxx')
-rw-r--r--sw/inc/calbck.hxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 5359973a86d2..26dcd2566fc1 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -38,6 +38,7 @@ class SwAttrSet;
class SwCellFrame;
class SwTabFrame;
class SwRowFrame;
+class SwTable;
/*
SwModify and SwClient cooperate in propagating attribute changes.
@@ -123,6 +124,7 @@ namespace sw
virtual const SwCellFrame* DynCastCellFrame() const { return nullptr; }
virtual const SwTabFrame* DynCastTabFrame() const { return nullptr; }
virtual const SwRowFrame* DynCastRowFrame() const { return nullptr; }
+ virtual const SwTable* DynCastTable() const { return nullptr; }
};
enum class IteratorMode { Exact, UnwrapMulti };
}
@@ -328,6 +330,11 @@ namespace sw::detail
return dynamic_cast<const CastDest *>(pSource);
}
template<>
+ inline const SwTable* internal_dyn_cast(const sw::WriterListener * pSource)
+ {
+ return pSource->DynCastTable();
+ }
+ template<>
inline const SwCellFrame* internal_dyn_cast(const sw::WriterListener * pSource)
{
return pSource->DynCastCellFrame();