diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2019-10-05 13:32:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-06 11:58:50 +0200 |
commit | 6a789e617ed07bfddc516c8fc0cf94cd6dfe7250 (patch) | |
tree | 11d6097893a301ae65cf4668077134ac7510091a /basctl | |
parent | 070b3a848d6824ea154ae2d68fc7571feed60a5f (diff) |
improve SfxPoolItem operator== implementations
(*) make them all call the superclass operator==
(*) make the base class check which and typeid to ensure
we are only comparing the safe subclasses together
(*) remove a couple of operator== that were not doing
anything useful
Change-Id: Ia6234aed42df04157a5d6a323dc951916a9cb316
Reviewed-on: https://gerrit.libreoffice.org/80308
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/sbxitem.cxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/basctl/source/basicide/sbxitem.cxx b/basctl/source/basicide/sbxitem.cxx index e1281f62510a..0de7757a52c4 100644 --- a/basctl/source/basicide/sbxitem.cxx +++ b/basctl/source/basicide/sbxitem.cxx @@ -60,11 +60,9 @@ SfxPoolItem *SbxItem::Clone(SfxItemPool*) const bool SbxItem::operator==(const SfxPoolItem& rCmp) const { - SbxItem const* pSbxItem = dynamic_cast<SbxItem const*>(&rCmp); - assert(pSbxItem); //no SbxItem! + SbxItem const* pSbxItem = static_cast<SbxItem const*>(&rCmp); return SfxPoolItem::operator==(rCmp) && - pSbxItem && m_aDocument == pSbxItem->m_aDocument && m_aLibName == pSbxItem->m_aLibName && m_aName == pSbxItem->m_aName && |