diff options
author | Sedat Ak <sedat.ak.bm@gmail.com> | 2016-01-31 17:21:06 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-02-18 20:00:55 +0000 |
commit | e959fd9e2389727c74631b8b29c5d39b404b390a (patch) | |
tree | f77333800ac4d09977bcad63dd0bbbb9a9a8b91d | |
parent | 05d2684840d3956ff76ed6db00a43cf2d49c8454 (diff) |
tdf#43157 Clean up DBG_ASSERT for svx
Change-Id: Id09a9905aa152755d77aacde029dd3f701937b52
Reviewed-on: https://gerrit.libreoffice.org/21964
Reviewed-by: jan iversen <jani@documentfoundation.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | svx/source/dialog/rlrcitem.cxx | 20 | ||||
-rw-r--r-- | svx/source/sdr/properties/emptyproperties.cxx | 28 | ||||
-rw-r--r-- | svx/source/sdr/properties/groupproperties.cxx | 20 |
3 files changed, 34 insertions, 34 deletions
diff --git a/svx/source/dialog/rlrcitem.cxx b/svx/source/dialog/rlrcitem.cxx index 06ad0da4a9db..b7ab5198a854 100644 --- a/svx/source/dialog/rlrcitem.cxx +++ b/svx/source/dialog/rlrcitem.cxx @@ -57,14 +57,14 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState, case SID_ATTR_LONG_LRSPACE: { const SvxLongLRSpaceItem *pItem = dynamic_cast<const SvxLongLRSpaceItem*>( pState ); - DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxLRSpaceItem expected"); + SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", "SvxLRSpaceItem expected"); rRuler.UpdateFrame(pItem); break; } case SID_ATTR_LONG_ULSPACE: { const SvxLongULSpaceItem *pItem = dynamic_cast<const SvxLongULSpaceItem*>( pState ); - DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxULSpaceItem expected"); + SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", "SvxULSpaceItem expected"); rRuler.UpdateFrame(pItem); break; } @@ -72,7 +72,7 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState, case SID_ATTR_TABSTOP: { const SvxTabStopItem *pItem = dynamic_cast<const SvxTabStopItem*>( pState ); - DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxTabStopItem expected"); + SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", "SvxTabStopItem expected"); rRuler.Update(pItem); break; } @@ -80,7 +80,7 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState, case SID_ATTR_PARA_LRSPACE: { const SvxLRSpaceItem *pItem = dynamic_cast<const SvxLRSpaceItem*>( pState ); - DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxLRSpaceItem expected"); + SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", "SvxLRSpaceItem expected"); rRuler.UpdatePara(pItem); break; } @@ -90,7 +90,7 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState, case SID_RULER_ROWS_VERTICAL: { const SvxColumnItem *pItem = dynamic_cast<const SvxColumnItem*>( pState ); - DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxColumnItem expected"); + SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", "SvxColumnItem expected"); #ifdef DBG_UTIL if(pItem) { @@ -109,35 +109,35 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState, case SID_RULER_PAGE_POS: { // Position page, page width const SvxPagePosSizeItem *pItem = dynamic_cast<const SvxPagePosSizeItem*>( pState ); - DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxPagePosSizeItem expected"); + SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", "SvxPagePosSizeItem expected"); rRuler.Update(pItem); break; } case SID_RULER_OBJECT: { // Object selection const SvxObjectItem *pItem = dynamic_cast<const SvxObjectItem*>( pState ); - DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxObjectItem expected"); + SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", "SvxObjectItem expected"); rRuler.Update(pItem); break; } case SID_RULER_PROTECT: { const SvxProtectItem *pItem = dynamic_cast<const SvxProtectItem*>( pState ); - DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxProtectItem expected"); + SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", "SvxProtectItem expected"); rRuler.Update(pItem); break; } case SID_RULER_BORDER_DISTANCE: { const SvxLRSpaceItem *pItem = dynamic_cast<const SvxLRSpaceItem*>( pState ); - DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxLRSpaceItem expected"); + SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", "SvxLRSpaceItem expected"); rRuler.UpdateParaBorder(pItem); } break; case SID_RULER_TEXT_RIGHT_TO_LEFT : { const SfxBoolItem *pItem = dynamic_cast<const SfxBoolItem*>( pState ); - DBG_ASSERT(pState == nullptr || pItem != nullptr, "SfxBoolItem expected"); + SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", "SfxBoolItem expected"); rRuler.UpdateTextRTL(pItem); } break; diff --git a/svx/source/sdr/properties/emptyproperties.cxx b/svx/source/sdr/properties/emptyproperties.cxx index d91644547b47..e97d3e49334d 100644 --- a/svx/source/sdr/properties/emptyproperties.cxx +++ b/svx/source/sdr/properties/emptyproperties.cxx @@ -34,7 +34,7 @@ namespace sdr SfxItemSet* EmptyProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool) { // Basic implementation; Basic object has NO attributes - DBG_ASSERT(false, "EmptyProperties::CreateObjectSpecificItemSet() should never be called"); + SAL_WARN("svx.sdr", "EmptyProperties::CreateObjectSpecificItemSet() should never be called"); return new SfxItemSet(rPool); } @@ -73,66 +73,66 @@ namespace sdr const_cast<EmptyProperties*>(this)->mpEmptyItemSet = const_cast<EmptyProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool()); } - DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)"); - DBG_ASSERT(false, "EmptyProperties::GetObjectItemSet() should never be called (!)"); + SAL_WARN_IF(!mpEmptyItemSet, "svx.sdr", "Could not create an SfxItemSet(!)"); + SAL_WARN("svx.sdr", "EmptyProperties::GetObjectItemSet() should never be called (!)"); return *mpEmptyItemSet; } void EmptyProperties::SetObjectItem(const SfxPoolItem& /*rItem*/) { - DBG_ASSERT(false, "EmptyProperties::SetObjectItem() should never be called (!)"); + SAL_WARN("svx.sdr", "EmptyProperties::SetObjectItem() should never be called (!)"); } void EmptyProperties::SetObjectItemDirect(const SfxPoolItem& /*rItem*/) { - DBG_ASSERT(false, "EmptyProperties::SetObjectItemDirect() should never be called (!)"); + SAL_WARN("svx.sdr", "EmptyProperties::SetObjectItemDirect() should never be called (!)"); } void EmptyProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/) { - DBG_ASSERT(false, "EmptyProperties::ClearObjectItem() should never be called (!)"); + SAL_WARN("svx.sdr", "EmptyProperties::ClearObjectItem() should never be called (!)"); } void EmptyProperties::ClearObjectItemDirect(const sal_uInt16 /*nWhich*/) { - DBG_ASSERT(false, "EmptyProperties::ClearObjectItemDirect() should never be called (!)"); + SAL_WARN("svx.sdr", "EmptyProperties::ClearObjectItemDirect() should never be called (!)"); } void EmptyProperties::SetObjectItemSet(const SfxItemSet& /*rSet*/) { - DBG_ASSERT(false, "EmptyProperties::SetObjectItemSet() should never be called (!)"); + SAL_WARN("svx.sdr", "EmptyProperties::SetObjectItemSet() should never be called (!)"); } void EmptyProperties::ItemSetChanged(const SfxItemSet& /*rSet*/) { - DBG_ASSERT(false, "EmptyProperties::ItemSetChanged() should never be called (!)"); + SAL_WARN("svx.sdr", "EmptyProperties::ItemSetChanged() should never be called (!)"); } bool EmptyProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const { - DBG_ASSERT(false, "EmptyProperties::AllowItemChange() should never be called (!)"); + SAL_WARN("svx.sdr", "EmptyProperties::AllowItemChange() should never be called (!)"); return true; } void EmptyProperties::ItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) { - DBG_ASSERT(false, "EmptyProperties::ItemChange() should never be called (!)"); + SAL_WARN("svx.sdr", "EmptyProperties::ItemChange() should never be called (!)"); } void EmptyProperties::PostItemChange(const sal_uInt16 /*nWhich*/) { - DBG_ASSERT(false, "EmptyProperties::PostItemChange() should never be called (!)"); + SAL_WARN("svx.sdr", "EmptyProperties::PostItemChange() should never be called (!)"); } void EmptyProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, bool /*bDontRemoveHardAttr*/) { - DBG_ASSERT(false, "EmptyProperties::SetStyleSheet() should never be called (!)"); + SAL_WARN("svx.sdr", "EmptyProperties::SetStyleSheet() should never be called (!)"); } SfxStyleSheet* EmptyProperties::GetStyleSheet() const { - DBG_ASSERT(false, "EmptyProperties::GetStyleSheet() should never be called (!)"); + SAL_WARN("svx.sdr", "EmptyProperties::GetStyleSheet() should never be called (!)"); return nullptr; } } // end of namespace properties diff --git a/svx/source/sdr/properties/groupproperties.cxx b/svx/source/sdr/properties/groupproperties.cxx index 6e7e82890f9c..0227321b2589 100644 --- a/svx/source/sdr/properties/groupproperties.cxx +++ b/svx/source/sdr/properties/groupproperties.cxx @@ -61,7 +61,7 @@ namespace sdr const SfxItemSet& GroupProperties::GetObjectItemSet() const { - DBG_ASSERT(false, "GroupProperties::GetObjectItemSet() should never be called (!)"); + SAL_WARN("svx.sdr", "GroupProperties::GetObjectItemSet() should never be called (!)"); return DefaultProperties::GetObjectItemSet(); } @@ -133,22 +133,22 @@ namespace sdr void GroupProperties::SetObjectItem(const SfxPoolItem& /*rItem*/) { - DBG_ASSERT(false, "GroupProperties::SetObjectItem() should never be called (!)"); + SAL_WARN("svx.sdr", "GroupProperties::SetObjectItem() should never be called (!)"); } void GroupProperties::SetObjectItemDirect(const SfxPoolItem& /*rItem*/) { - DBG_ASSERT(false, "GroupProperties::SetObjectItemDirect() should never be called (!)"); + SAL_WARN("svx.sdr", "GroupProperties::SetObjectItemDirect() should never be called (!)"); } void GroupProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/) { - DBG_ASSERT(false, "GroupProperties::ClearObjectItem() should never be called (!)"); + SAL_WARN("svx.sdr", "GroupProperties::ClearObjectItem() should never be called (!)"); } void GroupProperties::ClearObjectItemDirect(const sal_uInt16 /*nWhich*/) { - DBG_ASSERT(false, "GroupProperties::ClearObjectItemDirect() should never be called (!)"); + SAL_WARN("svx.sdr", "GroupProperties::ClearObjectItemDirect() should never be called (!)"); } void GroupProperties::SetMergedItem(const SfxPoolItem& rItem) @@ -175,28 +175,28 @@ namespace sdr void GroupProperties::SetObjectItemSet(const SfxItemSet& /*rSet*/) { - DBG_ASSERT(false, "GroupProperties::SetObjectItemSet() should never be called (!)"); + SAL_WARN("svx.sdr", "GroupProperties::SetObjectItemSet() should never be called (!)"); } void GroupProperties::ItemSetChanged(const SfxItemSet& /*rSet*/) { - DBG_ASSERT(false, "GroupProperties::ItemSetChanged() should never be called (!)"); + SAL_WARN("svx.sdr", "GroupProperties::ItemSetChanged() should never be called (!)"); } bool GroupProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const { - DBG_ASSERT(false, "GroupProperties::AllowItemChange() should never be called (!)"); + SAL_WARN("svx.sdr", "GroupProperties::AllowItemChange() should never be called (!)"); return false; } void GroupProperties::ItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) { - DBG_ASSERT(false, "GroupProperties::ItemChange() should never be called (!)"); + SAL_WARN("svx.sdr", "GroupProperties::ItemChange() should never be called (!)"); } void GroupProperties::PostItemChange(const sal_uInt16 /*nWhich*/) { - DBG_ASSERT(false, "GroupProperties::PostItemChange() should never be called (!)"); + SAL_WARN("svx.sdr", "GroupProperties::PostItemChange() should never be called (!)"); } SfxStyleSheet* GroupProperties::GetStyleSheet() const |