[Libreoffice-commits] core.git: avmedia/source basctl/source cui/source dbaccess/source editeng/source include/editeng include/svx sc/source sfx2/source svl/source svx/source sw/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Oct 6 09:59:55 UTC 2019


 avmedia/source/avmediadummy.cxx               |    5 +++--
 basctl/source/basicide/sbxitem.cxx            |    4 +---
 cui/source/options/cfgchart.cxx               |    8 +-------
 cui/source/options/connpoolsettings.cxx       |    5 ++---
 cui/source/options/dbregistersettings.cxx     |    4 +++-
 dbaccess/source/ui/dlg/DbAdminImpl.cxx        |    4 ++--
 dbaccess/source/ui/dlg/optionalboolitem.cxx   |    7 ++-----
 dbaccess/source/ui/misc/stringlistitem.cxx    |    6 ++++--
 editeng/source/items/bulitem.cxx              |    2 +-
 editeng/source/items/numitem.cxx              |    3 ++-
 editeng/source/items/paraitem.cxx             |    7 -------
 editeng/source/items/textitem.cxx             |    9 +--------
 editeng/source/items/writingmodeitem.cxx      |    7 -------
 editeng/source/items/xmlcnitm.cxx             |    5 ++---
 include/editeng/charrotateitem.hxx            |    2 --
 include/editeng/paravertalignitem.hxx         |    3 ---
 include/editeng/writingmodeitem.hxx           |    1 -
 include/svx/ofaitem.hxx                       |    3 ++-
 sc/source/core/data/attrib.cxx                |    8 ++++----
 sc/source/core/data/patattr.cxx               |    5 +++--
 sc/source/ui/condformat/condformatdlgitem.cxx |    3 ++-
 sfx2/source/control/sorgitm.cxx               |    3 +--
 sfx2/source/dialog/dinfdlg.cxx                |    2 +-
 sfx2/source/doc/objitem.cxx                   |    7 ++++---
 sfx2/source/view/frame.cxx                    |   11 +++++++----
 sfx2/source/view/viewfrm.cxx                  |    3 ++-
 svl/source/items/aeitem.cxx                   |    3 +--
 svl/source/items/globalnameitem.cxx           |    3 ++-
 svl/source/items/grabbagitem.cxx              |    5 ++---
 svl/source/items/ilstitem.cxx                 |    2 +-
 svl/source/items/imageitm.cxx                 |    4 ++--
 svl/source/items/int64item.cxx                |    2 +-
 svl/source/items/lckbitem.cxx                 |    2 +-
 svl/source/items/poolitem.cxx                 |    4 +++-
 svx/source/dialog/svxgrahicitem.cxx           |    2 +-
 svx/source/items/clipfmtitem.cxx              |    2 ++
 svx/source/items/ofaitem.cxx                  |    3 ++-
 svx/source/xoutdev/xattr2.cxx                 |    2 +-
 sw/source/core/attr/fmtfollowtextflow.cxx     |    1 -
 sw/source/core/attr/hints.cxx                 |    2 +-
 sw/source/core/txtnode/fmtatr2.cxx            |    3 +--
 sw/source/filter/basflt/fltshell.cxx          |   14 +++++++++-----
 sw/source/uibase/config/cfgitems.cxx          |    5 +++--
 sw/source/uibase/dialog/swwrtshitem.cxx       |    3 ++-
 sw/source/uibase/utlui/uiitems.cxx            |   18 ++++++++----------
 45 files changed, 93 insertions(+), 114 deletions(-)

New commits:
commit 6a789e617ed07bfddc516c8fc0cf94cd6dfe7250
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Oct 5 13:32:10 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Oct 6 11:58:50 2019 +0200

    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 at collabora.co.uk>

diff --git a/avmedia/source/avmediadummy.cxx b/avmedia/source/avmediadummy.cxx
index 74ac0ecf3a1d..2c642541bfb8 100644
--- a/avmedia/source/avmediadummy.cxx
+++ b/avmedia/source/avmediadummy.cxx
@@ -87,9 +87,10 @@ SfxPoolItem* MediaItem::Clone( SfxItemPool*) const
   return nullptr;
 }
 
-bool MediaItem::operator==( const SfxPoolItem& ) const
+bool MediaItem::operator==( const SfxPoolItem& rItem ) const
 {
-  return false;
+    assert(SfxPoolItem::operator==(rItem)); (void)rItem;
+    return false;
 }
 
 } // namespace avmedia
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 &&
diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx
index 5641687fa94e..1aacff5a6395 100644
--- a/cui/source/options/cfgchart.cxx
+++ b/cui/source/options/cfgchart.cxx
@@ -275,13 +275,7 @@ bool SvxChartColorTableItem::operator==( const SfxPoolItem& rAttr ) const
 {
     assert(SfxPoolItem::operator==(rAttr));
 
-    const SvxChartColorTableItem * rCTItem( dynamic_cast<const SvxChartColorTableItem * >( & rAttr ));
-    if( rCTItem )
-    {
-        return (m_aColorTable == rCTItem->GetColorList());
-    }
-
-    return false;
+    return static_cast<const SvxChartColorTableItem & >( rAttr ).m_aColorTable == m_aColorTable;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/connpoolsettings.cxx b/cui/source/options/connpoolsettings.cxx
index 0f23b3fe9bd2..f794f669f659 100644
--- a/cui/source/options/connpoolsettings.cxx
+++ b/cui/source/options/connpoolsettings.cxx
@@ -52,9 +52,8 @@ namespace offapp
 
     bool DriverPoolingSettingsItem::operator==( const SfxPoolItem& _rCompare ) const
     {
-        const DriverPoolingSettingsItem* pItem = dynamic_cast<const DriverPoolingSettingsItem*>( &_rCompare );
-        if (!pItem)
-            return false;
+        assert(SfxPoolItem::operator==(_rCompare));
+        const DriverPoolingSettingsItem* pItem = static_cast<const DriverPoolingSettingsItem*>( &_rCompare );
 
         if (m_aSettings.size() != pItem->m_aSettings.size())
             return false;
diff --git a/cui/source/options/dbregistersettings.cxx b/cui/source/options/dbregistersettings.cxx
index dc67c27f1ec3..e9e2ae0fb167 100644
--- a/cui/source/options/dbregistersettings.cxx
+++ b/cui/source/options/dbregistersettings.cxx
@@ -35,7 +35,9 @@ namespace svx
 
     bool DatabaseMapItem::operator==( const SfxPoolItem& _rCompare ) const
     {
-        const DatabaseMapItem* pItem = dynamic_cast<const DatabaseMapItem*>( &_rCompare );
+        if (!SfxPoolItem::operator==(_rCompare))
+            return false;
+        const DatabaseMapItem* pItem = static_cast<const DatabaseMapItem*>( &_rCompare );
         if ( !pItem )
             return false;
 
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 3ceeda28c9ca..30037f1bbdf4 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -1064,8 +1064,8 @@ DbuTypeCollectionItem::DbuTypeCollectionItem(const DbuTypeCollectionItem& _rSour
 
 bool DbuTypeCollectionItem::operator==(const SfxPoolItem& _rItem) const
 {
-    const DbuTypeCollectionItem* pCompare = dynamic_cast<const DbuTypeCollectionItem*>( &_rItem );
-    return pCompare && (pCompare->getCollection() == getCollection());
+    return SfxPoolItem::operator==(_rItem) &&
+        static_cast<const DbuTypeCollectionItem&>( _rItem ).getCollection() == getCollection();
 }
 
 SfxPoolItem* DbuTypeCollectionItem::Clone(SfxItemPool* /*_pPool*/) const
diff --git a/dbaccess/source/ui/dlg/optionalboolitem.cxx b/dbaccess/source/ui/dlg/optionalboolitem.cxx
index 7fa87c72107b..b0b4aff525b1 100644
--- a/dbaccess/source/ui/dlg/optionalboolitem.cxx
+++ b/dbaccess/source/ui/dlg/optionalboolitem.cxx
@@ -31,11 +31,8 @@ namespace dbaui
 
     bool OptionalBoolItem::operator==( const SfxPoolItem& _rItem ) const
     {
-        const OptionalBoolItem* pCompare = dynamic_cast<const OptionalBoolItem*>( &_rItem  );
-        if ( !pCompare )
-            return false;
-
-        return m_aValue == pCompare->m_aValue;
+        return SfxPoolItem::operator==(_rItem) &&
+            static_cast<const OptionalBoolItem&>( _rItem  ).m_aValue == m_aValue;
     }
 
     SfxPoolItem* OptionalBoolItem::Clone( SfxItemPool* /*_pPool*/ ) const
diff --git a/dbaccess/source/ui/misc/stringlistitem.cxx b/dbaccess/source/ui/misc/stringlistitem.cxx
index fb865df54bb4..1d821edd2076 100644
--- a/dbaccess/source/ui/misc/stringlistitem.cxx
+++ b/dbaccess/source/ui/misc/stringlistitem.cxx
@@ -39,8 +39,10 @@ OStringListItem::OStringListItem(const OStringListItem& _rSource)
 
 bool OStringListItem::operator==(const SfxPoolItem& _rItem) const
 {
-    const OStringListItem* pCompare = dynamic_cast<const OStringListItem*>( &_rItem );
-    if ((!pCompare) || (pCompare->m_aList.getLength() != m_aList.getLength()))
+    if (!SfxPoolItem::operator==(_rItem))
+        return false;
+    const OStringListItem* pCompare = static_cast<const OStringListItem*>( &_rItem );
+    if (pCompare->m_aList.getLength() != m_aList.getLength())
         return false;
 
     // compare all strings individually
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index 9518cf4abbe9..46f6271f2c33 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -87,7 +87,7 @@ void SvxBulletItem::CopyValidProperties( const SvxBulletItem& rCopyFrom )
 
 bool SvxBulletItem::operator==( const SfxPoolItem& rItem ) const
 {
-    DBG_ASSERT(dynamic_cast< const SvxBulletItem* >(&rItem) !=  nullptr,"operator==Types not matching");
+    assert(SfxPoolItem::operator==(rItem));
     const SvxBulletItem& rBullet = static_cast<const SvxBulletItem&>(rItem);
     // Compare with ValidMask, otherwise no put possible in an AttrSet if the
     // item differs only in terms of the ValidMask from an existing one.
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index e35682e04fbe..67cf0373cc37 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -938,7 +938,8 @@ SvxNumBulletItem::~SvxNumBulletItem()
 
 bool SvxNumBulletItem::operator==( const SfxPoolItem& rCopy) const
 {
-    return *pNumRule == *static_cast<const SvxNumBulletItem&>(rCopy).pNumRule;
+    return SfxPoolItem::operator==(rCopy) &&
+        *pNumRule == *static_cast<const SvxNumBulletItem&>(rCopy).pNumRule;
 }
 
 SfxPoolItem*  SvxNumBulletItem::Clone( SfxItemPool * ) const
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index 2194b3ed9e5a..ed159e14ed08 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -1061,8 +1061,6 @@ bool SvxPageModelItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId
 
 bool SvxPageModelItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    assert(SfxPoolItem::operator==(rAttr));
-
     return SfxStringItem::operator==(rAttr) &&
            bAuto == static_cast<const SvxPageModelItem&>( rAttr ).bAuto;
 }
@@ -1217,11 +1215,6 @@ bool SvxParaVertAlignItem::PutValue( const css::uno::Any& rVal,
         return false;
 }
 
-bool SvxParaVertAlignItem::operator==( const SfxPoolItem& rItem ) const
-{
-    assert(SfxPoolItem::operator==(rItem));
-    return SfxUInt16Item::operator==( rItem );
-}
 
 
 SvxParaGridItem::SvxParaGridItem( bool bOn, const sal_uInt16 nId )
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index e4ce386c68c9..ffb4e63e2e21 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1040,8 +1040,7 @@ bool SvxTextLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
 
 bool SvxTextLineItem::operator==( const SfxPoolItem& rItem ) const
 {
-    assert(SfxPoolItem::operator==(rItem));
-    return SfxEnumItem::operator==( static_cast<const SfxEnumItem<FontLineStyle>&>(rItem) ) &&
+    return SfxEnumItem::operator==( rItem ) &&
            GetColor() == static_cast<const SvxTextLineItem&>(rItem).GetColor();
 }
 
@@ -2241,12 +2240,6 @@ bool SvxTextRotateItem::PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId)
     return bRet;
 }
 
-bool SvxTextRotateItem::operator==(const SfxPoolItem& rItem) const
-{
-    assert(SfxPoolItem::operator==(rItem));
-    return SfxUInt16Item::operator==(rItem);
-}
-
 void SvxTextRotateItem::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
     xmlTextWriterStartElement(pWriter, BAD_CAST("SvxTextRotateItem"));
diff --git a/editeng/source/items/writingmodeitem.cxx b/editeng/source/items/writingmodeitem.cxx
index dfa2df0de9cd..2fa4ce5ebbd4 100644
--- a/editeng/source/items/writingmodeitem.cxx
+++ b/editeng/source/items/writingmodeitem.cxx
@@ -38,13 +38,6 @@ SvxWritingModeItem::~SvxWritingModeItem()
 {
 }
 
-bool SvxWritingModeItem::operator==( const SfxPoolItem& rCmp ) const
-{
-    assert(SfxPoolItem::operator==(rCmp));
-
-    return GetValue() == static_cast<const SvxWritingModeItem&>(rCmp).GetValue();
-}
-
 SfxPoolItem* SvxWritingModeItem::Clone( SfxItemPool * ) const
 {
     return new SvxWritingModeItem( *this );
diff --git a/editeng/source/items/xmlcnitm.cxx b/editeng/source/items/xmlcnitm.cxx
index 4e0c25c9c239..be38d75ab5f4 100644
--- a/editeng/source/items/xmlcnitm.cxx
+++ b/editeng/source/items/xmlcnitm.cxx
@@ -53,9 +53,8 @@ SvXMLAttrContainerItem::~SvXMLAttrContainerItem()
 
 bool SvXMLAttrContainerItem::operator==( const SfxPoolItem& rItem ) const
 {
-    DBG_ASSERT( dynamic_cast< const SvXMLAttrContainerItem* >(&rItem) !=  nullptr,
-               "SvXMLAttrContainerItem::operator ==(): Bad type");
-    return *pImpl == *static_cast<const SvXMLAttrContainerItem&>(rItem).pImpl;
+    return SfxPoolItem::operator==(rItem) &&
+        *pImpl == *static_cast<const SvXMLAttrContainerItem&>(rItem).pImpl;
 }
 
 bool SvXMLAttrContainerItem::GetPresentation(
diff --git a/include/editeng/charrotateitem.hxx b/include/editeng/charrotateitem.hxx
index efa62398cec3..2b3ab2fedc7d 100644
--- a/include/editeng/charrotateitem.hxx
+++ b/include/editeng/charrotateitem.hxx
@@ -47,8 +47,6 @@ public:
     virtual bool            QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
     virtual bool            PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;
 
-    virtual bool operator==(const SfxPoolItem&) const override;
-
     // our currently only degree values
     void SetTopToBottom() { SetValue(2700); }
     void SetBottomToTop() { SetValue(900); }
diff --git a/include/editeng/paravertalignitem.hxx b/include/editeng/paravertalignitem.hxx
index 4aa3865739e9..09cfb7124504 100644
--- a/include/editeng/paravertalignitem.hxx
+++ b/include/editeng/paravertalignitem.hxx
@@ -53,9 +53,6 @@ public:
 
     Align                   GetValue() const { return static_cast<Align>(SfxUInt16Item::GetValue()); }
     void                    SetValue(Align n) { SfxUInt16Item::SetValue(static_cast<sal_uInt16>(n)); }
-
-    virtual bool            operator==( const SfxPoolItem& ) const override;
-
 };
 
 #endif
diff --git a/include/editeng/writingmodeitem.hxx b/include/editeng/writingmodeitem.hxx
index 6bdf02fe6986..e7e670c4543e 100644
--- a/include/editeng/writingmodeitem.hxx
+++ b/include/editeng/writingmodeitem.hxx
@@ -38,7 +38,6 @@ public:
     SvxWritingModeItem & operator =(SvxWritingModeItem &&) = delete; // due to SfxUInt16Item
 
     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = nullptr ) const override;
-    virtual bool            operator==( const SfxPoolItem& ) const override;
     css::text::WritingMode  GetValue() const { return static_cast<css::text::WritingMode>(SfxUInt16Item::GetValue()); }
 
     virtual bool GetPresentation( SfxItemPresentation ePres,
diff --git a/include/svx/ofaitem.hxx b/include/svx/ofaitem.hxx
index 7ee48b6908fa..aa3cf2b98297 100644
--- a/include/svx/ofaitem.hxx
+++ b/include/svx/ofaitem.hxx
@@ -48,7 +48,8 @@ public:
     {}
     virtual bool operator==( const SfxPoolItem& rItem ) const override
     {
-        return mxRef == static_cast<OfaRefItem<reference_type> const &>(rItem).mxRef;
+        return SfxPoolItem::operator==(rItem)
+            && mxRef == static_cast<OfaRefItem<reference_type> const &>(rItem).mxRef;
     }
     virtual SfxPoolItem* Clone( SfxItemPool* /*pPool = 0*/ ) const override
     {
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index f35d2c7219d7..5f1517250998 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -101,8 +101,7 @@ ScMergeAttr::~ScMergeAttr()
 
 bool ScMergeAttr::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( Which() != rItem.Which() || typeid(*this) == typeid(rItem), "which ==, type !=" );
-    return (Which() == rItem.Which())
+    return SfxPoolItem::operator==(rItem)
              && (nColMerge == static_cast<const ScMergeAttr&>(rItem).nColMerge)
              && (nRowMerge == static_cast<const ScMergeAttr&>(rItem).nRowMerge);
 }
@@ -333,8 +332,7 @@ bool ScProtectionAttr::GetPresentation
 
 bool ScProtectionAttr::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( Which() != rItem.Which() || typeid(*this) == typeid(rItem), "which ==, type !=" );
-    return (Which() == rItem.Which())
+    return SfxPoolItem::operator==(rItem)
              && (bProtection == static_cast<const ScProtectionAttr&>(rItem).bProtection)
              && (bHideFormula == static_cast<const ScProtectionAttr&>(rItem).bHideFormula)
              && (bHideCell == static_cast<const ScProtectionAttr&>(rItem).bHideCell)
@@ -689,6 +687,8 @@ ScCondFormatItem::~ScCondFormatItem()
 
 bool ScCondFormatItem::operator==( const SfxPoolItem& rCmp ) const
 {
+    if (!SfxPoolItem::operator==(rCmp))
+        return false;
     auto const & other = static_cast<const ScCondFormatItem&>(rCmp);
     if (maIndex.empty() && other.maIndex.empty())
         return true;
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index d3ce46ddff61..ec3ffb74bef0 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -139,8 +139,9 @@ bool ScPatternAttr::operator==( const SfxPoolItem& rCmp ) const
 {
     // #i62090# Use quick comparison between ScPatternAttr's ItemSets
 
-    return ( EqualPatternSets( GetItemSet(), static_cast<const ScPatternAttr&>(rCmp).GetItemSet() ) &&
-             StrCmp( GetStyleName(), static_cast<const ScPatternAttr&>(rCmp).GetStyleName() ) );
+    return SfxPoolItem::operator==(rCmp) &&
+            EqualPatternSets( GetItemSet(), static_cast<const ScPatternAttr&>(rCmp).GetItemSet() ) &&
+            StrCmp( GetStyleName(), static_cast<const ScPatternAttr&>(rCmp).GetStyleName() );
 }
 
 SvxCellOrientation ScPatternAttr::GetCellOrientation( const SfxItemSet& rItemSet, const SfxItemSet* pCondSet )
diff --git a/sc/source/ui/condformat/condformatdlgitem.cxx b/sc/source/ui/condformat/condformatdlgitem.cxx
index ee37c734d94d..ee1713b06f04 100644
--- a/sc/source/ui/condformat/condformatdlgitem.cxx
+++ b/sc/source/ui/condformat/condformatdlgitem.cxx
@@ -27,8 +27,9 @@ ScCondFormatDlgItem::~ScCondFormatDlgItem()
 {
 }
 
-bool ScCondFormatDlgItem::operator==(const SfxPoolItem& /*rItem*/) const
+bool ScCondFormatDlgItem::operator==(const SfxPoolItem& rItem) const
 {
+    assert(SfxPoolItem::operator==(rItem)); (void)rItem;
     return false;
 }
 
diff --git a/sfx2/source/control/sorgitm.cxx b/sfx2/source/control/sorgitm.cxx
index 1a5709f00a51..76bc397efee0 100644
--- a/sfx2/source/control/sorgitm.cxx
+++ b/sfx2/source/control/sorgitm.cxx
@@ -42,8 +42,7 @@ SfxPoolItem* SfxScriptOrganizerItem::Clone( SfxItemPool * ) const
 
 bool SfxScriptOrganizerItem::operator==( const SfxPoolItem& rItem) const
 {
-     return typeid(rItem) == typeid(*this) &&
-         SfxStringItem::operator==(rItem) &&
+     return SfxStringItem::operator==(rItem) &&
          aLanguage == static_cast<const SfxScriptOrganizerItem &>(rItem).aLanguage;
 }
 
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 27239b8ba1f7..184509187e2f 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -302,7 +302,7 @@ SfxPoolItem* SfxDocumentInfoItem::Clone( SfxItemPool * ) const
 
 bool SfxDocumentInfoItem::operator==( const SfxPoolItem& rItem) const
 {
-    if (!(typeid(rItem) == typeid(*this) && SfxStringItem::operator==(rItem)))
+    if (!SfxStringItem::operator==(rItem))
         return false;
     const SfxDocumentInfoItem& rInfoItem(static_cast<const SfxDocumentInfoItem&>(rItem));
 
diff --git a/sfx2/source/doc/objitem.cxx b/sfx2/source/doc/objitem.cxx
index 8e907b7602fc..5b5483df5ce8 100644
--- a/sfx2/source/doc/objitem.cxx
+++ b/sfx2/source/doc/objitem.cxx
@@ -32,7 +32,8 @@ SfxPoolItem* SfxObjectItem::CreateDefault() { return new SfxObjectItem; }
 
 bool SfxObjectShellItem::operator==( const SfxPoolItem &rItem ) const
 {
-     return dynamic_cast<const SfxObjectShellItem&>(rItem).pObjSh == pObjSh;
+     return SfxPoolItem::operator==(rItem) &&
+        static_cast<const SfxObjectShellItem&>(rItem).pObjSh == pObjSh;
 }
 
 SfxPoolItem* SfxObjectShellItem::Clone( SfxItemPool *) const
@@ -92,8 +93,8 @@ SfxObjectItem::SfxObjectItem( sal_uInt16 nWhichId, SfxShell *pSh )
 
 bool SfxObjectItem::operator==( const SfxPoolItem &rItem ) const
 {
-     const SfxObjectItem& rOther = dynamic_cast<const SfxObjectItem&>(rItem);
-     return rOther._pSh == _pSh;
+     return SfxPoolItem::operator==(rItem) &&
+        static_cast<const SfxObjectItem&>(rItem)._pSh == _pSh;
 }
 
 SfxPoolItem* SfxObjectItem::Clone( SfxItemPool *) const
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 5d341803996c..9cee64be4ccd 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -415,8 +415,9 @@ SfxFrameItem::SfxFrameItem( SfxFrame *p ):
 
 bool SfxFrameItem::operator==( const SfxPoolItem &rItem ) const
 {
-     return static_cast<const SfxFrameItem&>(rItem).pFrame == pFrame &&
-         static_cast<const SfxFrameItem&>(rItem).wFrame == wFrame;
+     return SfxPoolItem::operator==(rItem) &&
+        static_cast<const SfxFrameItem&>(rItem).pFrame == pFrame &&
+        static_cast<const SfxFrameItem&>(rItem).wFrame == wFrame;
 }
 
 SfxPoolItem* SfxFrameItem::Clone( SfxItemPool *) const
@@ -470,8 +471,9 @@ SfxUnoAnyItem::SfxUnoAnyItem( sal_uInt16 nWhichId, const css::uno::Any& rAny )
     aValue = rAny;
 }
 
-bool SfxUnoAnyItem::operator==( const SfxPoolItem& /*rItem*/ ) const
+bool SfxUnoAnyItem::operator==( const SfxPoolItem& rItem ) const
 {
+    assert(SfxPoolItem::operator==(rItem)); (void)rItem;
     return false;
 }
 
@@ -506,7 +508,8 @@ SfxUnoFrameItem::SfxUnoFrameItem( sal_uInt16 nWhichId, const css::uno::Reference
 
 bool SfxUnoFrameItem::operator==( const SfxPoolItem& i_rItem ) const
 {
-    return dynamic_cast< const SfxUnoFrameItem* >(&i_rItem)  !=  nullptr && static_cast< const SfxUnoFrameItem& >( i_rItem ).m_xFrame == m_xFrame;
+    return SfxPoolItem::operator==(i_rItem) &&
+        static_cast< const SfxUnoFrameItem& >( i_rItem ).m_xFrame == m_xFrame;
 }
 
 SfxPoolItem* SfxUnoFrameItem::Clone( SfxItemPool* ) const
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 90e79b29ff08..3540e91851de 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1745,7 +1745,8 @@ void SfxViewFrame::DoAdjustPosSizePixel //! divide on Inner.../Outer...
 
 bool SfxViewFrameItem::operator==( const SfxPoolItem &rItem ) const
 {
-    return dynamic_cast<const SfxViewFrameItem&>(rItem).pFrame == pFrame;
+    return SfxPoolItem::operator==(rItem) &&
+        static_cast<const SfxViewFrameItem&>(rItem).pFrame == pFrame;
 }
 
 SfxPoolItem* SfxViewFrameItem::Clone( SfxItemPool *) const
diff --git a/svl/source/items/aeitem.cxx b/svl/source/items/aeitem.cxx
index 00e58d27f464..5ac6fbac3980 100644
--- a/svl/source/items/aeitem.cxx
+++ b/svl/source/items/aeitem.cxx
@@ -62,10 +62,9 @@ void SfxAllEnumItem::SetTextByPos( sal_uInt16 nPos, const OUString &rText )
 
 bool SfxAllEnumItem::operator==( const SfxPoolItem& rCmp ) const
 {
-    assert(dynamic_cast< const SfxAllEnumItem* >(&rCmp) && "operator==Types not matching");
-    const SfxAllEnumItem& rOther = static_cast<const SfxAllEnumItem&>(rCmp);
     if (!SfxPoolItem::operator==(rCmp))
         return false;
+    const SfxAllEnumItem& rOther = static_cast<const SfxAllEnumItem&>(rCmp);
     return m_Values == rOther.m_Values;
 }
 
diff --git a/svl/source/items/globalnameitem.cxx b/svl/source/items/globalnameitem.cxx
index 529a3398c3b7..2cd289f05f84 100644
--- a/svl/source/items/globalnameitem.cxx
+++ b/svl/source/items/globalnameitem.cxx
@@ -49,7 +49,8 @@ SfxGlobalNameItem::~SfxGlobalNameItem()
 
 bool SfxGlobalNameItem::operator==( const SfxPoolItem& rItem ) const
 {
-    return static_cast<const SfxGlobalNameItem&>(rItem).m_aName == m_aName;
+    return SfxPoolItem::operator==(rItem) &&
+        static_cast<const SfxGlobalNameItem&>(rItem).m_aName == m_aName;
 }
 
 
diff --git a/svl/source/items/grabbagitem.cxx b/svl/source/items/grabbagitem.cxx
index 83c0323450ab..e4d70bded1e8 100644
--- a/svl/source/items/grabbagitem.cxx
+++ b/svl/source/items/grabbagitem.cxx
@@ -27,9 +27,8 @@ SfxGrabBagItem::~SfxGrabBagItem() = default;
 
 bool SfxGrabBagItem::operator==(const SfxPoolItem& rItem) const
 {
-    auto pItem = static_cast<const SfxGrabBagItem*>(&rItem);
-
-    return m_aMap == pItem->m_aMap;
+    return SfxPoolItem::operator==(rItem)
+           && m_aMap == static_cast<const SfxGrabBagItem*>(&rItem)->m_aMap;
 }
 
 SfxPoolItem* SfxGrabBagItem::Clone(SfxItemPool* /*pPool*/) const
diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx
index a63055c7ffef..221bb0b074e2 100644
--- a/svl/source/items/ilstitem.cxx
+++ b/svl/source/items/ilstitem.cxx
@@ -49,7 +49,7 @@ SfxIntegerListItem::~SfxIntegerListItem()
 
 bool SfxIntegerListItem::operator==( const SfxPoolItem& rPoolItem ) const
 {
-    if ( dynamic_cast< const SfxIntegerListItem* >( &rPoolItem) ==  nullptr )
+    if ( !SfxPoolItem::operator==(rPoolItem) )
         return false;
 
     const SfxIntegerListItem & rItem = static_cast<const SfxIntegerListItem&>(rPoolItem);
diff --git a/svl/source/items/imageitm.cxx b/svl/source/items/imageitm.cxx
index 269e80936af3..e7ca5db4455e 100644
--- a/svl/source/items/imageitm.cxx
+++ b/svl/source/items/imageitm.cxx
@@ -61,8 +61,8 @@ SfxPoolItem* SfxImageItem::Clone( SfxItemPool* ) const
 
 bool SfxImageItem::operator==( const SfxPoolItem& rItem ) const
 {
-    return (static_cast<const SfxImageItem&>(rItem).GetValue() == GetValue()) &&
-           (*pImpl == *static_cast<const SfxImageItem&>(rItem).pImpl);
+    return SfxInt16Item::operator==(rItem) &&
+           *pImpl == *static_cast<const SfxImageItem&>(rItem).pImpl;
 }
 
 bool SfxImageItem::QueryValue( css::uno::Any& rVal, sal_uInt8 ) const
diff --git a/svl/source/items/int64item.cxx b/svl/source/items/int64item.cxx
index f128bc4d4275..c7f46452c27a 100644
--- a/svl/source/items/int64item.cxx
+++ b/svl/source/items/int64item.cxx
@@ -18,7 +18,7 @@ SfxInt64Item::~SfxInt64Item() {}
 
 bool SfxInt64Item::operator== ( const SfxPoolItem& rItem ) const
 {
-    return mnValue == static_cast<const SfxInt64Item&>(rItem).mnValue;
+    return SfxPoolItem::operator==(rItem) && mnValue == static_cast<const SfxInt64Item&>(rItem).mnValue;
 }
 
 bool SfxInt64Item::GetPresentation(
diff --git a/svl/source/items/lckbitem.cxx b/svl/source/items/lckbitem.cxx
index 25cebefc01d5..e2ad91a4c30f 100644
--- a/svl/source/items/lckbitem.cxx
+++ b/svl/source/items/lckbitem.cxx
@@ -39,7 +39,7 @@ SfxLockBytesItem::~SfxLockBytesItem()
 
 bool SfxLockBytesItem::operator==( const SfxPoolItem& rItem ) const
 {
-    return static_cast<const SfxLockBytesItem&>(rItem)._xVal == _xVal;
+    return SfxPoolItem::operator==(rItem) && static_cast<const SfxLockBytesItem&>(rItem)._xVal == _xVal;
 }
 
 
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
index 5c4e81c89e10..ec37b68d3417 100644
--- a/svl/source/items/poolitem.cxx
+++ b/svl/source/items/poolitem.cxx
@@ -486,7 +486,9 @@ SfxPoolItem::~SfxPoolItem()
 
 bool SfxPoolItem::operator==( const SfxPoolItem& rCmp ) const
 {
-    return typeid(rCmp)  == typeid(*this);
+    assert(typeid(rCmp) == typeid(*this) && "comparing different pool item subclasses");
+    (void)rCmp;
+    return true;
 }
 
 
diff --git a/svx/source/dialog/svxgrahicitem.cxx b/svx/source/dialog/svxgrahicitem.cxx
index 4a036ed5dd7f..27691c1ada3f 100644
--- a/svx/source/dialog/svxgrahicitem.cxx
+++ b/svx/source/dialog/svxgrahicitem.cxx
@@ -28,7 +28,7 @@ SvxGraphicItem::SvxGraphicItem( const Graphic& rGraphic )
 
 bool SvxGraphicItem::operator==( const SfxPoolItem& rItem) const
 {
-    return static_cast<const SvxGraphicItem&>(rItem).aGraphic == aGraphic;
+    return SfxPoolItem::operator==(rItem) && static_cast<const SvxGraphicItem&>(rItem).aGraphic == aGraphic;
 }
 
 SfxPoolItem* SvxGraphicItem::Clone( SfxItemPool * ) const
diff --git a/svx/source/items/clipfmtitem.cxx b/svx/source/items/clipfmtitem.cxx
index 0a6df479f980..a9d1a0931062 100644
--- a/svx/source/items/clipfmtitem.cxx
+++ b/svx/source/items/clipfmtitem.cxx
@@ -87,6 +87,8 @@ bool SvxClipboardFormatItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nM
 
 bool SvxClipboardFormatItem::operator==( const SfxPoolItem& rComp ) const
 {
+    if (!SfxPoolItem::operator==(rComp))
+        return false;
     const SvxClipboardFormatItem& rCmp = static_cast<const SvxClipboardFormatItem&>(rComp);
     if(rCmp.pImpl->aFmtNms.size() != pImpl->aFmtNms.size())
         return false;
diff --git a/svx/source/items/ofaitem.cxx b/svx/source/items/ofaitem.cxx
index 6d487ee6b52e..4e0e6ac82209 100644
--- a/svx/source/items/ofaitem.cxx
+++ b/svx/source/items/ofaitem.cxx
@@ -28,7 +28,8 @@ OfaPtrItem::OfaPtrItem( sal_uInt16 _nWhich, void *_pPtr )
 
 bool OfaPtrItem::operator==( const SfxPoolItem& rItem) const
 {
-    return static_cast<const OfaPtrItem&>(rItem).pPtr == pPtr;
+    return SfxPoolItem::operator==(rItem) &&
+        static_cast<const OfaPtrItem&>(rItem).pPtr == pPtr;
 }
 
 SfxPoolItem* OfaPtrItem::Clone( SfxItemPool * ) const
diff --git a/svx/source/xoutdev/xattr2.cxx b/svx/source/xoutdev/xattr2.cxx
index 0d0d228249eb..6a59871ce1d2 100644
--- a/svx/source/xoutdev/xattr2.cxx
+++ b/svx/source/xoutdev/xattr2.cxx
@@ -203,7 +203,7 @@ bool AffineMatrixItem::operator==(const SfxPoolItem& rRef) const
         return false;
     }
 
-    const AffineMatrixItem* pRef = dynamic_cast< const AffineMatrixItem* >(&rRef);
+    const AffineMatrixItem* pRef = static_cast< const AffineMatrixItem* >(&rRef);
 
     if(!pRef)
     {
diff --git a/sw/source/core/attr/fmtfollowtextflow.cxx b/sw/source/core/attr/fmtfollowtextflow.cxx
index eee767f47aca..469440cc2ad1 100644
--- a/sw/source/core/attr/fmtfollowtextflow.cxx
+++ b/sw/source/core/attr/fmtfollowtextflow.cxx
@@ -79,7 +79,6 @@ bool SwFormatFollowTextFlow::QueryValue(css::uno::Any& rVal, sal_uInt8 aInt) con
 
 bool SwFormatFollowTextFlow::operator==(const SfxPoolItem& rItem) const
 {
-    assert(dynamic_cast<const SwFormatFollowTextFlow*>(&rItem) != nullptr);
     return SfxBoolItem::operator==(rItem)
            && mbLayoutInCell == static_cast<SwFormatFollowTextFlow const*>(&rItem)->mbLayoutInCell;
 }
diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx
index 96784aeabe03..1b92d14c4f8d 100644
--- a/sw/source/core/attr/hints.cxx
+++ b/sw/source/core/attr/hints.cxx
@@ -139,7 +139,7 @@ SwMsgPoolItem::SwMsgPoolItem( sal_uInt16 nWhch )
 
 bool SwMsgPoolItem::operator==( const SfxPoolItem& ) const
 {
-    OSL_FAIL( "SwMsgPoolItem knows no ==" );
+    assert( false && "SwMsgPoolItem knows no ==" );
     return false;
 }
 
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index 805d0dd1dddd..ef37d507efae 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -562,9 +562,8 @@ SwFormatMeta::~SwFormatMeta()
 
 bool SwFormatMeta::operator==( const SfxPoolItem & i_rOther ) const
 {
-    assert(SfxPoolItem::operator==(i_rOther));
     return SfxPoolItem::operator==( i_rOther )
-        && (m_pMeta == static_cast<SwFormatMeta const &>( i_rOther ).m_pMeta);
+        && m_pMeta == static_cast<SwFormatMeta const &>( i_rOther ).m_pMeta;
 }
 
 SfxPoolItem * SwFormatMeta::Clone( SfxItemPool * /*pPool*/ ) const
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index d530d73c77ac..950a3b0c2029 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -966,7 +966,8 @@ void SwFltAnchor::SetFrameFormat(SwFrameFormat * _pFrameFormat)
 
 bool SwFltAnchor::operator==(const SfxPoolItem& rItem) const
 {
-    return pFrameFormat == static_cast<const SwFltAnchor&>(rItem).pFrameFormat;
+    return SfxPoolItem::operator==(rItem) &&
+        pFrameFormat == static_cast<const SwFltAnchor&>(rItem).pFrameFormat;
 }
 
 SfxPoolItem* SwFltAnchor::Clone(SfxItemPool*) const
@@ -994,7 +995,8 @@ void SwFltAnchorListener::Notify(const SfxHint& rHint)
 // methods of SwFltRedline follow
 bool SwFltRedline::operator==(const SfxPoolItem& rItem) const
 {
-    return this == &rItem;
+    return SfxPoolItem::operator==(rItem) &&
+        this == &rItem;
 }
 
 SfxPoolItem* SwFltRedline::Clone( SfxItemPool* ) const
@@ -1026,8 +1028,9 @@ SwFltBookmark::SwFltBookmark( const OUString& rNa, const OUString& rVa,
 
 bool SwFltBookmark::operator==(const SfxPoolItem& rItem) const
 {
-    return ( maName == static_cast<const SwFltBookmark&>(rItem).maName)
-            && (mnHandle == static_cast<const SwFltBookmark&>(rItem).mnHandle);
+    return SfxPoolItem::operator==(rItem)
+        && maName == static_cast<const SwFltBookmark&>(rItem).maName
+        && mnHandle == static_cast<const SwFltBookmark&>(rItem).mnHandle;
 }
 
 SfxPoolItem* SwFltBookmark::Clone(SfxItemPool*) const
@@ -1085,7 +1088,8 @@ SwFltTOX::SwFltTOX(SwTOXBase* pBase)
 
 bool SwFltTOX::operator==(const SfxPoolItem& rItem) const
 {
-    return m_xTOXBase.get() == static_cast<const SwFltTOX&>(rItem).m_xTOXBase.get();
+    return SfxPoolItem::operator==(rItem) &&
+        m_xTOXBase.get() == static_cast<const SwFltTOX&>(rItem).m_xTOXBase.get();
 }
 
 SfxPoolItem* SwFltTOX::Clone(SfxItemPool*) const
diff --git a/sw/source/uibase/config/cfgitems.cxx b/sw/source/uibase/config/cfgitems.cxx
index c07a0c84bbed..8846665ba6f9 100644
--- a/sw/source/uibase/config/cfgitems.cxx
+++ b/sw/source/uibase/config/cfgitems.cxx
@@ -212,8 +212,9 @@ SfxPoolItem* SwShadowCursorItem::Clone( SfxItemPool* ) const
 
 bool SwShadowCursorItem::operator==( const SfxPoolItem& rCmp ) const
 {
-    return  IsOn() == static_cast<const SwShadowCursorItem&>(rCmp).IsOn() &&
-            GetMode() == static_cast<const SwShadowCursorItem&>(rCmp).GetMode();
+    return SfxPoolItem::operator==(rCmp) &&
+        IsOn() == static_cast<const SwShadowCursorItem&>(rCmp).IsOn() &&
+        GetMode() == static_cast<const SwShadowCursorItem&>(rCmp).GetMode();
 }
 
 void SwShadowCursorItem::FillViewOptions( SwViewOption& rVOpt ) const
diff --git a/sw/source/uibase/dialog/swwrtshitem.cxx b/sw/source/uibase/dialog/swwrtshitem.cxx
index 4c6671e5bbb9..03f7fabe4871 100644
--- a/sw/source/uibase/dialog/swwrtshitem.cxx
+++ b/sw/source/uibase/dialog/swwrtshitem.cxx
@@ -28,7 +28,8 @@ SwWrtShellItem::SwWrtShellItem( SwWrtShell* pSh )
 
 bool SwWrtShellItem::operator==( const SfxPoolItem& rItem) const
 {
-    return static_cast<const SwWrtShellItem&>(rItem).pWrtSh == pWrtSh;
+    return SfxPoolItem::operator==(rItem)
+        && pWrtSh == static_cast<const SwWrtShellItem&>(rItem).pWrtSh;
 }
 
 SfxPoolItem* SwWrtShellItem::Clone( SfxItemPool * /*pPool*/ ) const
diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx
index 89390a6735a4..20f9d48be8d8 100644
--- a/sw/source/uibase/utlui/uiitems.cxx
+++ b/sw/source/uibase/utlui/uiitems.cxx
@@ -51,8 +51,8 @@ SfxPoolItem*  SwPageFootnoteInfoItem::Clone( SfxItemPool * /*pPool*/ ) const
 
 bool SwPageFootnoteInfoItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( Which() == rAttr.Which(), "no equal attributes" );
-    return ( aFootnoteInfo == static_cast<const SwPageFootnoteInfoItem&>(rAttr).GetPageFootnoteInfo());
+    return SfxPoolItem::operator==(rAttr)
+        && aFootnoteInfo == static_cast<const SwPageFootnoteInfoItem&>(rAttr).aFootnoteInfo;
 }
 
 bool SwPageFootnoteInfoItem::GetPresentation
@@ -204,9 +204,8 @@ SfxPoolItem* SwPtrItem::Clone( SfxItemPool * /*pPool*/ ) const
 
 bool SwPtrItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    assert(SfxPoolItem::operator==(rAttr));
-    const SwPtrItem& rItem = static_cast<const SwPtrItem&>(rAttr);
-    return ( pMisc == rItem.pMisc );
+    return SfxPoolItem::operator==(rAttr)
+        && pMisc == static_cast<const SwPtrItem&>(rAttr).pMisc;
 }
 
 // SwUINumRuleItem for the NumTabPages of the FormatNumRule/Styleists
@@ -233,8 +232,8 @@ SfxPoolItem*  SwUINumRuleItem::Clone( SfxItemPool * /*pPool*/ ) const
 
 bool SwUINumRuleItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    assert(SfxPoolItem::operator==(rAttr));
-    return *pRule == *static_cast<const SwUINumRuleItem&>(rAttr).pRule;
+    return SfxPoolItem::operator==(rAttr)
+        && *pRule == *static_cast<const SwUINumRuleItem&>(rAttr).pRule;
 }
 
 bool SwUINumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
@@ -270,9 +269,8 @@ SfxPoolItem* SwPaMItem::Clone( SfxItemPool * /*pPool*/ ) const
 
 bool SwPaMItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    assert(SfxPoolItem::operator==(rAttr));
-    const SwPaMItem& rItem = static_cast<const SwPaMItem&>(rAttr);
-    return ( m_pPaM == rItem.m_pPaM );
+    return SfxPoolItem::operator==(rAttr)
+        && m_pPaM ==  static_cast<const SwPaMItem&>(rAttr).m_pPaM;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list