[Libreoffice-commits] core.git: 3 commits - sc/source sw/source

Michael Stahl mstahl at redhat.com
Mon Oct 27 06:30:46 PDT 2014


 sc/source/core/data/attrib.cxx                   |   10 +++----
 sc/source/core/tool/defaultsoptions.cxx          |    2 -
 sc/source/core/tool/docoptio.cxx                 |    2 -
 sc/source/core/tool/formulaopt.cxx               |    2 -
 sc/source/core/tool/printopt.cxx                 |    2 -
 sc/source/core/tool/viewopti.cxx                 |    2 -
 sc/source/ui/app/uiitems.cxx                     |   18 +++++++-------
 sw/source/core/attr/cellatr.cxx                  |    6 ++--
 sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx |    6 ++--
 sw/source/core/layout/atrfrm.cxx                 |   28 +++++++++++-----------
 sw/source/core/para/paratr.cxx                   |    4 +--
 sw/source/core/tox/tox.cxx                       |    2 -
 sw/source/core/txtnode/atrfld.cxx                |    2 -
 sw/source/core/txtnode/atrflyin.cxx              |    2 -
 sw/source/core/txtnode/atrftn.cxx                |    2 -
 sw/source/core/txtnode/atrref.cxx                |    2 -
 sw/source/core/txtnode/fmtatr2.cxx               |   10 +++----
 sw/source/core/txtnode/thints.cxx                |   29 +++++++++++------------
 sw/source/uibase/chrdlg/ccoll.cxx                |    2 -
 sw/source/uibase/config/cfgitems.cxx             |    8 +++---
 sw/source/uibase/utlui/uiitems.cxx               |    6 ++--
 21 files changed, 73 insertions(+), 74 deletions(-)

New commits:
commit 8f7e364a5b6179fdc3b716a3b250e71341536220
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Oct 27 13:55:21 2014 +0100

    sw: deploy some asserts in SwpHints::TryInsertNesting()
    
    Change-Id: I584edadf13b34edf054e3405865c43bae74a7830

diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index a38fae5..c29f87e 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -164,8 +164,8 @@ bool isSelfNestable(const sal_uInt16 nWhich)
         (RES_TXTATR_CJK_RUBY == nWhich) ||
         (RES_TXTATR_INPUTFIELD == nWhich))
         return false;
-   OSL_ENSURE((RES_TXTATR_META  == nWhich) ||
-           (RES_TXTATR_METAFIELD  == nWhich), "???");
+    assert((RES_TXTATR_META  == nWhich) ||
+           (RES_TXTATR_METAFIELD  == nWhich));
     return true;
 }
 
@@ -175,9 +175,9 @@ bool isSplittable(const sal_uInt16 nWhich)
     if ((RES_TXTATR_INETFMT  == nWhich) ||
         (RES_TXTATR_CJK_RUBY == nWhich))
         return true;
-    OSL_ENSURE((RES_TXTATR_META  == nWhich) ||
+    assert((RES_TXTATR_META  == nWhich) ||
            (RES_TXTATR_METAFIELD  == nWhich) ||
-           (RES_TXTATR_INPUTFIELD  == nWhich), "???");
+           (RES_TXTATR_INPUTFIELD  == nWhich));
     return false;
 }
 
@@ -246,7 +246,7 @@ MakeTxtAttrNesting(SwTxtNode & rNode, SwTxtAttrNesting & rNesting,
             break;
         }
         default:
-            OSL_FAIL("MakeTxtAttrNesting: what the hell is that?");
+            assert(!"MakeTxtAttrNesting: what the hell is that?");
             break;
     }
     return static_txtattr_cast<SwTxtAttrNesting*>(pNew);
@@ -362,12 +362,11 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
     const sal_Int32 nNewEnd  ( *rNewHint.GetEnd()   );
     const bool bNewSelfNestable( isSelfNestable(nNewWhich) );
 
-    OSL_ENSURE( (RES_TXTATR_INETFMT   == nNewWhich) ||
+    assert( (RES_TXTATR_INETFMT   == nNewWhich) ||
             (RES_TXTATR_CJK_RUBY  == nNewWhich) ||
             (RES_TXTATR_META      == nNewWhich) ||
             (RES_TXTATR_METAFIELD == nNewWhich) ||
-            (RES_TXTATR_INPUTFIELD == nNewWhich),
-        "TryInsertNesting: Expecting INETFMT or RUBY or META or METAFIELD or INPUTFIELD" );
+            (RES_TXTATR_INPUTFIELD == nNewWhich));
 
     NestList_t OverlappingExisting; // existing hints to be split
     NestList_t OverwrittenExisting; // existing hints to be replaced
@@ -403,7 +402,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
                             static_txtattr_cast<SwTxtAttrNesting*>(pOther));
                         break;
                     default:
-                        OSL_FAIL("bad code monkey");
+                        assert(!"bad code monkey");
                         break;
                 }
             }
@@ -419,7 +418,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
                 {
                     if (rNewHint.HasDummyChar())
                     {
-                        OSL_FAIL("ERROR: inserting duplicate CH_TXTATR hint");
+                        assert(!"ERROR: inserting duplicate CH_TXTATR hint");
                         return false;
                     } else if (nNewEnd < nOtherEnd) {
                         // other has dummy char, new is inside other, but
@@ -428,7 +427,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
                         // in SwXMeta::createEnumeration
                         // SplitNew is sorted, so this is the first split
                         sal_Int32& rStart(SplitNew.front()->GetStart());
-                        OSL_ENSURE(rStart == nNewStart, "how did that happen?");
+                        assert(rStart == nNewStart);
                         rStart = nNewStart + 1;
                     }
                 }
@@ -436,7 +435,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
         }
     }
 
-   OSL_ENSURE(isSplittable(nNewWhich) || SplitNew.size() == 1,
+    assert((isSplittable(nNewWhich) || SplitNew.size() == 1) &&
             "splitting the unsplittable ???");
 
     // pass 2: split existing hints that overlap/nest with new hint
@@ -467,14 +466,14 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
             {
                 case POS_INSIDE:
                     {
-                        OSL_ENSURE(!bRemoveOverlap,
+                        assert(!bRemoveOverlap &&
                             "this one should be in OverwrittenExisting?");
                     }
                     break;
                 case POS_OUTSIDE:
                 case POS_EQUAL:
                     {
-                        OSL_FAIL("existing hint inside new hint: why?");
+                        assert(!"existing hint inside new hint: why?");
                     }
                     break;
                 case POS_OVERLAP_BEFORE:
@@ -551,7 +550,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
         }
         else
         {
-           OSL_ENSURE((nOtherStart < nNewStart) && (nNewEnd < nOtherEnd), "huh?");
+           assert((nOtherStart < nNewStart) && (nNewEnd < nOtherEnd));
         // scenario: there is a RUBY, and contained within that a META;
         // now a RUBY is inserted within the META => the exising RUBY is split:
         // here it is not possible to simply insert the left/right fragment
commit 8af112febc5fa8e81c7fb8e718bac8ba2a806b8a
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Oct 27 13:38:02 2014 +0100

    sc: assert SfxPoolItem::operator==
    
    Change-Id: I69b7d2b9e580b08ebd59866f1244e0e61c4b1dcb

diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index 1b37853..6adef02 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -393,7 +393,7 @@ bool ScProtectionAttr::SetHidePrint( bool bHPrint)
  */
 bool ScRangeItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" );
+    assert(SfxPoolItem::operator==(rAttr));
 
     return aRange == static_cast<const ScRangeItem&>(rAttr).aRange;
 }
@@ -479,7 +479,7 @@ ScTableListItem& ScTableListItem::operator=( const ScTableListItem& rCpy )
 
 bool ScTableListItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" );
+    assert(SfxPoolItem::operator==(rAttr));
 
     const ScTableListItem& rCmp   = static_cast<const ScTableListItem&>(rAttr);
     bool                   bEqual = (nCount == rCmp.nCount);
@@ -639,7 +639,7 @@ OUString ScPageHFItem::GetValueText() const
 
 bool ScPageHFItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScPageHFItem& r = static_cast<const ScPageHFItem&>(rItem);
 
@@ -948,7 +948,7 @@ OUString ScDoubleItem::GetValueText() const
 
 bool ScDoubleItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
     const ScDoubleItem& _rItem = static_cast<const ScDoubleItem&>(rItem);
     return nValue == _rItem.nValue;
 }
@@ -997,7 +997,7 @@ ScPageScaleToItem* ScPageScaleToItem::Clone( SfxItemPool* ) const
 
 bool ScPageScaleToItem::operator==( const SfxPoolItem& rCmp ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rCmp ), "ScPageScaleToItem::operator== - unequal wid or type" );
+    assert(SfxPoolItem::operator==(rCmp));
     const ScPageScaleToItem& rPageCmp = static_cast< const ScPageScaleToItem& >( rCmp );
     return ((mnWidth == rPageCmp.mnWidth) && (mnHeight == rPageCmp.mnHeight)) ? 1 : 0;
 }
diff --git a/sc/source/core/tool/defaultsoptions.cxx b/sc/source/core/tool/defaultsoptions.cxx
index 7c66d60..0226832 100644
--- a/sc/source/core/tool/defaultsoptions.cxx
+++ b/sc/source/core/tool/defaultsoptions.cxx
@@ -83,7 +83,7 @@ OUString ScTpDefaultsItem::GetValueText() const
 
 bool ScTpDefaultsItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScTpDefaultsItem& rPItem = static_cast<const ScTpDefaultsItem&>(rItem);
     return ( theOptions == rPItem.theOptions );
diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx
index d070865..dc61de0 100644
--- a/sc/source/core/tool/docoptio.cxx
+++ b/sc/source/core/tool/docoptio.cxx
@@ -123,7 +123,7 @@ OUString ScTpCalcItem::GetValueText() const
 
 bool ScTpCalcItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScTpCalcItem& rPItem = static_cast<const ScTpCalcItem&>(rItem);
 
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index 1abeaa3..346525d 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -174,7 +174,7 @@ OUString ScTpFormulaItem::GetValueText() const
 
 bool ScTpFormulaItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScTpFormulaItem& rPItem = static_cast<const ScTpFormulaItem&>(rItem);
     return ( theOptions == rPItem.theOptions );
diff --git a/sc/source/core/tool/printopt.cxx b/sc/source/core/tool/printopt.cxx
index 70926e1..00daafe 100644
--- a/sc/source/core/tool/printopt.cxx
+++ b/sc/source/core/tool/printopt.cxx
@@ -94,7 +94,7 @@ OUString ScTpPrintItem::GetValueText() const
 
 bool ScTpPrintItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScTpPrintItem& rPItem = static_cast<const ScTpPrintItem&>(rItem);
     return ( theOptions == rPItem.theOptions );
diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 4cc649c..ed047b3 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -217,7 +217,7 @@ OUString ScTpViewItem::GetValueText() const
 
 bool ScTpViewItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScTpViewItem& rPItem = static_cast<const ScTpViewItem&>(rItem);
 
diff --git a/sc/source/ui/app/uiitems.cxx b/sc/source/ui/app/uiitems.cxx
index f8618a0..0ab024f 100644
--- a/sc/source/ui/app/uiitems.cxx
+++ b/sc/source/ui/app/uiitems.cxx
@@ -77,7 +77,7 @@ OUString ScInputStatusItem::GetValueText() const
 
 bool ScInputStatusItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     return (aStartPos  == static_cast<const ScInputStatusItem&>(rItem).aStartPos)
              && (aEndPos    == static_cast<const ScInputStatusItem&>(rItem).aEndPos)
@@ -173,7 +173,7 @@ OUString ScSortItem::GetValueText() const
 
 bool ScSortItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScSortItem& rOther = static_cast<const ScSortItem&>(rItem);
 
@@ -265,7 +265,7 @@ OUString ScQueryItem::GetValueText() const
 
 bool ScQueryItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScQueryItem& rQueryItem = static_cast<const ScQueryItem&>(rItem);
 
@@ -318,7 +318,7 @@ OUString ScSubTotalItem::GetValueText() const
 
 bool ScSubTotalItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScSubTotalItem& rSTItem = static_cast<const ScSubTotalItem&>(rItem);
 
@@ -368,7 +368,7 @@ OUString ScUserListItem::GetValueText() const
 
 bool ScUserListItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScUserListItem& r = static_cast<const ScUserListItem&>(rItem);
     bool bEqual = false;
@@ -420,7 +420,7 @@ OUString ScConsolidateItem::GetValueText() const
 
 bool ScConsolidateItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScConsolidateItem& rCItem = static_cast<const ScConsolidateItem&>(rItem);
 
@@ -469,7 +469,7 @@ OUString ScPivotItem::GetValueText() const
 
 bool ScPivotItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScPivotItem& rPItem = static_cast<const ScPivotItem&>(rItem);
     OSL_ENSURE( pSaveData && rPItem.pSaveData, "pSaveData" );
@@ -510,7 +510,7 @@ OUString ScSolveItem::GetValueText() const
 
 bool ScSolveItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScSolveItem& rPItem = static_cast<const ScSolveItem&>(rItem);
 
@@ -549,7 +549,7 @@ OUString ScTabOpItem::GetValueText() const
 
 bool ScTabOpItem::operator==( const SfxPoolItem& rItem ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+    assert(SfxPoolItem::operator==(rItem));
 
     const ScTabOpItem& rPItem = static_cast<const ScTabOpItem&>(rItem);
 
commit a54734c82a6584da6becadec2d0cb25fbc296624
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Oct 27 13:28:35 2014 +0100

    sw: assert SfxPoolItem::operator==
    
    Change-Id: I9b48fc25abcbdeceefd5a86d8305209f312c9976

diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx
index a497e6b..9bc8296 100644
--- a/sw/source/core/attr/cellatr.cxx
+++ b/sw/source/core/attr/cellatr.cxx
@@ -38,7 +38,7 @@ SwTblBoxNumFormat::SwTblBoxNumFormat( sal_uInt32 nFormat, bool bFlag )
 
 bool SwTblBoxNumFormat::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "no matching attributes" );
+    assert(SfxPoolItem::operator==(rAttr));
     return GetValue() == ( (SwTblBoxNumFormat&) rAttr ).GetValue() &&
            bAuto == ( (SwTblBoxNumFormat&) rAttr ).bAuto;
 }
@@ -57,7 +57,7 @@ SwTblBoxFormula::SwTblBoxFormula( const OUString& rFormula )
 
 bool SwTblBoxFormula::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return GetFormula() == ( (SwTblBoxFormula&) rAttr ).GetFormula() &&
            pDefinedIn == ( (SwTblBoxFormula&) rAttr ).pDefinedIn;
 }
@@ -202,7 +202,7 @@ SwTblBoxValue::SwTblBoxValue( const double nVal )
 
 bool SwTblBoxValue::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==(rAttr), "SwTblBoxValue: item not equal" );
+    assert(SfxPoolItem::operator==(rAttr));
     SwTblBoxValue const& rOther( static_cast<SwTblBoxValue const&>(rAttr) );
     // items with NaN should be equal to enable pooling
     return ::rtl::math::isNan( nValue )
diff --git a/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx b/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
index 7b8fd3b..ec44bb2 100644
--- a/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
+++ b/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
@@ -48,11 +48,11 @@ SwFmtWrapInfluenceOnObjPos& SwFmtWrapInfluenceOnObjPos::operator=( const SwFmtWr
     return *this;
 }
 
-bool SwFmtWrapInfluenceOnObjPos::operator==( const SfxPoolItem& _rAttr ) const
+bool SwFmtWrapInfluenceOnObjPos::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( _rAttr ), "no matching attributes" );
+    assert(SfxPoolItem::operator==(rAttr));
     return ( mnWrapInfluenceOnPosition ==
-                    static_cast<const SwFmtWrapInfluenceOnObjPos&>(_rAttr).
+                    static_cast<const SwFmtWrapInfluenceOnObjPos&>(rAttr).
                                                 GetWrapInfluenceOnObjPos() );
 }
 
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index f853151..d9ffa19 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -198,7 +198,7 @@ SwFmtFrmSize& SwFmtFrmSize::operator=( const SwFmtFrmSize& rCpy )
 
 bool SwFmtFrmSize::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return( m_eFrmHeightType  == ((SwFmtFrmSize&)rAttr).m_eFrmHeightType &&
             m_eFrmWidthType  == ((SwFmtFrmSize&)rAttr).m_eFrmWidthType &&
             m_aSize           == ((SwFmtFrmSize&)rAttr).GetSize()&&
@@ -464,7 +464,7 @@ SwFmtHeader::SwFmtHeader( bool bOn )
 
 bool SwFmtHeader::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return ( GetRegisteredIn() == ((SwFmtHeader&)rAttr).GetRegisteredIn() &&
              bActive == ((SwFmtHeader&)rAttr).IsActive() );
 }
@@ -514,7 +514,7 @@ void SwFmtFooter::RegisterToFormat( SwFmt& rFmt )
 
 bool SwFmtFooter::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return ( GetRegisteredIn() == ((SwFmtFooter&)rAttr).GetRegisteredIn() &&
              bActive == ((SwFmtFooter&)rAttr).IsActive() );
 }
@@ -551,7 +551,7 @@ void SwFmtCntnt::SetNewCntntIdx( const SwNodeIndex *pIdx )
 
 bool SwFmtCntnt::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     if( (bool)pStartNode != (bool)((SwFmtCntnt&)rAttr).pStartNode )
         return false;
     if( pStartNode )
@@ -602,7 +602,7 @@ bool SwFmtPageDesc::KnowsPageDesc() const
 
 bool SwFmtPageDesc::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return  ( pDefinedIn == ((SwFmtPageDesc&)rAttr).pDefinedIn ) &&
             ( oNumOffset == ((SwFmtPageDesc&)rAttr).oNumOffset ) &&
             ( GetPageDesc() == ((SwFmtPageDesc&)rAttr).GetPageDesc() );
@@ -829,7 +829,7 @@ SwFmtCol::SwFmtCol()
 
 bool SwFmtCol::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "no equal attributes" );
+    assert(SfxPoolItem::operator==(rAttr));
     const SwFmtCol &rCmp = (const SwFmtCol&)rAttr;
     if( !(m_eLineStyle        == rCmp.m_eLineStyle  &&
           m_nLineWidth        == rCmp.m_nLineWidth  &&
@@ -1112,7 +1112,7 @@ SwFmtSurround::SwFmtSurround( const SwFmtSurround &rCpy ) :
 
 bool SwFmtSurround::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return ( GetValue() == ((SwFmtSurround&)rAttr).GetValue() &&
              bAnchorOnly== ((SwFmtSurround&)rAttr).bAnchorOnly &&
              bContour== ((SwFmtSurround&)rAttr).bContour &&
@@ -1270,7 +1270,7 @@ SwFmtVertOrient::SwFmtVertOrient( SwTwips nY, sal_Int16 eVert,
 
 bool SwFmtVertOrient::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "not the same attributes" );
+    assert(SfxPoolItem::operator==(rAttr));
     return ( m_nYPos     == ((SwFmtVertOrient&)rAttr).m_nYPos &&
              m_eOrient   == ((SwFmtVertOrient&)rAttr).m_eOrient &&
              m_eRelation == ((SwFmtVertOrient&)rAttr).m_eRelation );
@@ -1353,7 +1353,7 @@ SwFmtHoriOrient::SwFmtHoriOrient( SwTwips nX, sal_Int16 eHori,
 
 bool SwFmtHoriOrient::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return ( nXPos == ((SwFmtHoriOrient&)rAttr).nXPos &&
              eOrient == ((SwFmtHoriOrient&)rAttr).eOrient &&
              eRelation == ((SwFmtHoriOrient&)rAttr).eRelation &&
@@ -1492,7 +1492,7 @@ SwFmtAnchor& SwFmtAnchor::operator=(const SwFmtAnchor& rAnchor)
 
 bool SwFmtAnchor::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     SwFmtAnchor const& rFmtAnchor(static_cast<SwFmtAnchor const&>(rAttr));
     // OD 2004-05-05 #i28701# - Note: <mnOrder> hasn't to be considered.
     return ( nAnchorId == rFmtAnchor.GetAnchorId() &&
@@ -1661,7 +1661,7 @@ SwFmtURL::~SwFmtURL()
 
 bool SwFmtURL::operator==( const SfxPoolItem &rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "not the same attributes" );
+    assert(SfxPoolItem::operator==(rAttr));
     const SwFmtURL &rCmp = (SwFmtURL&)rAttr;
     bool bRet = bIsServerMap     == rCmp.IsServerMap() &&
                 sURL             == rCmp.GetURL() &&
@@ -1967,7 +1967,7 @@ SfxPoolItem* SwFmtEndAtTxtEnd::Clone( SfxItemPool* ) const
 
 bool SwFmtChain::operator==( const SfxPoolItem &rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
 
     return GetPrev() == ((SwFmtChain&)rAttr).GetPrev() &&
            GetNext() == ((SwFmtChain&)rAttr).GetNext();
@@ -2041,7 +2041,7 @@ SwFmtLineNumber::~SwFmtLineNumber()
 
 bool SwFmtLineNumber::operator==( const SfxPoolItem &rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
 
     return nStartValue  == ((SwFmtLineNumber&)rAttr).GetStartValue() &&
            bCountLines  == ((SwFmtLineNumber&)rAttr).IsCount();
@@ -2115,7 +2115,7 @@ SwTextGridItem::~SwTextGridItem()
 
 bool SwTextGridItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     SwTextGridItem const& rOther(static_cast<SwTextGridItem const&>(rAttr));
     return m_eGridType == rOther.GetGridType()
         && m_nLines == rOther.GetLines()
diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx
index 028d3e8..c5daf58 100644
--- a/sw/source/core/para/paratr.cxx
+++ b/sw/source/core/para/paratr.cxx
@@ -108,7 +108,7 @@ bool SwFmtDrop::GetInfo( SfxPoolItem& ) const
 
 bool SwFmtDrop::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "No mathing attributes" );
+    assert(SfxPoolItem::operator==(rAttr));
     return ( nLines == ((SwFmtDrop&)rAttr).GetLines() &&
              nChars == ((SwFmtDrop&)rAttr).GetChars() &&
              nDistance ==  ((SwFmtDrop&)rAttr).GetDistance() &&
@@ -217,7 +217,7 @@ SfxPoolItem* SwNumRuleItem::Clone( SfxItemPool * ) const
 }
 bool SwNumRuleItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "No matching attributes" );
+    assert(SfxPoolItem::operator==(rAttr));
 
     return GetValue() == ((SwNumRuleItem&)rAttr).GetValue();
 }
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index bfa6cb2..100b83b 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -141,7 +141,7 @@ void SwTOXMark::RegisterToTOXType(SwTOXType& rType)
 
 bool SwTOXMark::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "Attributes are not the same" );
+    assert(SfxPoolItem::operator==(rAttr));
     return GetRegisteredIn() == ((SwTOXMark&)rAttr).GetRegisteredIn();
 }
 
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 6455a19..73c4d4c 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -185,7 +185,7 @@ void SwFmtFld::ClearTxtFld()
 
 bool SwFmtFld::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return ( ( mpField && ((SwFmtFld&)rAttr).GetField()
                && mpField->GetTyp() == ((SwFmtFld&)rAttr).GetField()->GetTyp()
                && mpField->GetFormat() == ((SwFmtFld&)rAttr).GetField()->GetFormat() ) )
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index 0250326..a961b64 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -44,7 +44,7 @@ SwFmtFlyCnt::SwFmtFlyCnt( SwFrmFmt *pFrmFmt )
 
 bool SwFmtFlyCnt::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return( pTxtAttr && ((SwFmtFlyCnt&)rAttr).pTxtAttr &&
             pTxtAttr->GetStart() == ((SwFmtFlyCnt&)rAttr).pTxtAttr->GetStart() &&
             pFmt == ((SwFmtFlyCnt&)rAttr).GetFrmFmt() );
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index e4dcdc6..0248f6b 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -128,7 +128,7 @@ SwFmtFtn::SwFmtFtn( bool bEndNote )
 
 bool SwFmtFtn::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return m_nNumber  == ((SwFmtFtn&)rAttr).m_nNumber &&
            m_aNumber  == ((SwFmtFtn&)rAttr).m_aNumber &&
            m_bEndNote == ((SwFmtFtn&)rAttr).m_bEndNote;
diff --git a/sw/source/core/txtnode/atrref.cxx b/sw/source/core/txtnode/atrref.cxx
index 48c87a4..db7ce9d 100644
--- a/sw/source/core/txtnode/atrref.cxx
+++ b/sw/source/core/txtnode/atrref.cxx
@@ -46,7 +46,7 @@ SwFmtRefMark::SwFmtRefMark( const SwFmtRefMark& rAttr )
 
 bool SwFmtRefMark::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return aRefName == ((SwFmtRefMark&)rAttr).aRefName;
 }
 
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index 2119610..efbfe77 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -73,7 +73,7 @@ SwFmtCharFmt::~SwFmtCharFmt() {}
 
 bool SwFmtCharFmt::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return GetCharFmt() == ((SwFmtCharFmt&)rAttr).GetCharFmt();
 }
 
@@ -124,7 +124,7 @@ SwFmtAutoFmt::~SwFmtAutoFmt()
 
 bool SwFmtAutoFmt::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "different attributes" );
+    assert(SfxPoolItem::operator==(rAttr));
     return mpHandle == ((SwFmtAutoFmt&)rAttr).mpHandle;
 }
 
@@ -198,7 +198,7 @@ SwFmtINetFmt::~SwFmtINetFmt()
 
 bool SwFmtINetFmt::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     bool bRet = SfxPoolItem::operator==( (SfxPoolItem&) rAttr )
                 && msURL == ((SwFmtINetFmt&)rAttr).msURL
                 && msHyperlinkName == ((SwFmtINetFmt&)rAttr).msHyperlinkName
@@ -421,7 +421,7 @@ SwFmtRuby& SwFmtRuby::operator=( const SwFmtRuby& rAttr )
 
 bool SwFmtRuby::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+    assert(SfxPoolItem::operator==(rAttr));
     return sRubyTxt == ((SwFmtRuby&)rAttr).sRubyTxt &&
            sCharFmtName == ((SwFmtRuby&)rAttr).sCharFmtName &&
            nCharFmtId == ((SwFmtRuby&)rAttr).nCharFmtId &&
@@ -546,7 +546,7 @@ SwFmtMeta::~SwFmtMeta()
 
 bool SwFmtMeta::operator==( const SfxPoolItem & i_rOther ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==( i_rOther ), "i just copied this assert" );
+    assert(SfxPoolItem::operator==(i_rOther));
     return SfxPoolItem::operator==( i_rOther )
         && (m_pMeta == static_cast<SwFmtMeta const &>( i_rOther ).m_pMeta);
 }
diff --git a/sw/source/uibase/chrdlg/ccoll.cxx b/sw/source/uibase/chrdlg/ccoll.cxx
index 5de9a98..621f7a4 100644
--- a/sw/source/uibase/chrdlg/ccoll.cxx
+++ b/sw/source/uibase/chrdlg/ccoll.cxx
@@ -149,7 +149,7 @@ SfxPoolItem*   SwCondCollItem::Clone( SfxItemPool * /*pPool*/ ) const
 
 bool SwCondCollItem::operator==( const SfxPoolItem& rItem) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==(rItem), "different types" );
+    assert(SfxPoolItem::operator==(rItem));
     bool bReturn = true;
     for(sal_uInt16 i = 0; i < COND_COMMAND_COUNT; i++)
         if (m_sStyles[i] !=
diff --git a/sw/source/uibase/config/cfgitems.cxx b/sw/source/uibase/config/cfgitems.cxx
index c9a64b1..2f2138b 100644
--- a/sw/source/uibase/config/cfgitems.cxx
+++ b/sw/source/uibase/config/cfgitems.cxx
@@ -78,7 +78,7 @@ SfxPoolItem* SwDocDisplayItem::Clone( SfxItemPool*  ) const
 
 bool SwDocDisplayItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==(rAttr), "different types" );
+    assert(SfxPoolItem::operator==(rAttr));
 
     const SwDocDisplayItem& rItem = (SwDocDisplayItem&)rAttr;
 
@@ -169,7 +169,7 @@ SfxPoolItem* SwElemItem::Clone( SfxItemPool* ) const
 
 bool SwElemItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==(rAttr), "different types" );
+    assert(SfxPoolItem::operator==(rAttr));
 
     const SwElemItem& rItem = (SwElemItem&)rAttr;
 
@@ -250,7 +250,7 @@ SfxPoolItem* SwAddPrinterItem::Clone( SfxItemPool* ) const
 
 bool SwAddPrinterItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==(rAttr), "different types" );
+    assert(SfxPoolItem::operator==(rAttr));
 
     const SwAddPrinterItem& rItem = (SwAddPrinterItem&)rAttr;
 
@@ -327,7 +327,7 @@ SfxPoolItem* SwTestItem::Clone( SfxItemPool* ) const
 
 bool SwTestItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==(rAttr), "different types" );
+    assert(SfxPoolItem::operator==(rAttr));
 
     const SwTestItem& rItem = (const SwTestItem&) rAttr;
 
diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx
index 2bd0c8b..0f7fa70 100644
--- a/sw/source/uibase/utlui/uiitems.cxx
+++ b/sw/source/uibase/utlui/uiitems.cxx
@@ -214,7 +214,7 @@ SfxPoolItem* SwPtrItem::Clone( SfxItemPool * /*pPool*/ ) const
 
 bool SwPtrItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" );
+    assert(SfxPoolItem::operator==(rAttr));
     const SwPtrItem& rItem = (SwPtrItem&)rAttr;
     return ( pMisc == rItem.pMisc );
 }
@@ -244,7 +244,7 @@ SfxPoolItem*  SwUINumRuleItem::Clone( SfxItemPool * /*pPool*/ ) const
 
 bool SwUINumRuleItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" );
+    assert(SfxPoolItem::operator==(rAttr));
     return *pRule == *((SwUINumRuleItem&)rAttr).pRule;
 }
 
@@ -298,7 +298,7 @@ SfxPoolItem* SwPaMItem::Clone( SfxItemPool * /*pPool*/ ) const
 
 bool SwPaMItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" );
+    assert(SfxPoolItem::operator==(rAttr));
     const SwPaMItem& rItem = (SwPaMItem&)rAttr;
     return ( m_pPaM == rItem.m_pPaM );
 }


More information about the Libreoffice-commits mailing list