Kaydet (Commit) e959fd9e authored tarafından Sedat Ak's avatar Sedat Ak Kaydeden (comit) Michael Stahl

tdf#43157 Clean up DBG_ASSERT for svx

Change-Id: Id09a9905aa152755d77aacde029dd3f701937b52
Reviewed-on: https://gerrit.libreoffice.org/21964Reviewed-by: 's avatarjan iversen <jani@documentfoundation.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 05d26848
......@@ -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;
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment