[Libreoffice-commits] core.git: 2 commits - svl/source
Michael Stahl
mstahl at redhat.com
Fri Oct 7 22:08:32 UTC 2016
svl/source/items/cenumitm.cxx | 3 +--
svl/source/items/cintitem.cxx | 21 +++++++--------------
svl/source/svdde/ddecli.cxx | 7 +++----
svl/source/svdde/ddesvr.cxx | 23 +++++++++++------------
4 files changed, 22 insertions(+), 32 deletions(-)
New commits:
commit 06f91e5c6d4528de00a188f0f8ba4b5678b94ad3
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Oct 7 22:50:30 2016 +0200
svl: convert DBG_ASSERTs to assert
Change-Id: Ied13d6588e1c6677898a8151fa881804c3c58ff1
diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx
index d81d57c..7d290e9 100644
--- a/svl/source/svdde/ddecli.cxx
+++ b/svl/source/svdde/ddecli.cxx
@@ -25,7 +25,6 @@
#include <svl/svdde.hxx>
#include <osl/thread.h>
-#include <tools/debug.hxx>
#include <comphelper/solarmutex.hxx>
#include <osl/mutex.hxx>
@@ -68,7 +67,7 @@ HDDEDATA CALLBACK DdeInternal::CliCallback( WORD nCode, WORD nCbType,
DdeConnection* self = 0;
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
for ( size_t i = 0; i < rAll.size(); ++i)
{
@@ -189,7 +188,7 @@ DdeConnection::~DdeConnection()
delete pTopic;
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
std::vector<DdeConnection*>::iterator it(std::find(pInst->aConnections.begin(),
pInst->aConnections.end(),
@@ -239,7 +238,7 @@ const OUString DdeConnection::GetTopicName()
const std::vector<DdeConnection*>& DdeConnection::GetConnections()
{
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
return pInst->aConnections;
}
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index 213990e..4205a05 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -24,7 +24,6 @@
#include <comphelper/string.hxx>
#include <rtl/ustring.hxx>
#include <svl/svdde.hxx>
-#include <tools/debug.hxx>
#include <osl/thread.h>
#include <o3tl/sorted_vector.hxx>
@@ -72,7 +71,7 @@ HDDEDATA CALLBACK DdeInternal::SvrCallback(
Conversation* pC;
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
switch( nCode )
{
@@ -378,7 +377,7 @@ DdeTopic* DdeInternal::FindTopic( DdeService& rService, HSZ hTopic )
std::vector<DdeTopic*> &rTopics = rService.aTopics;
bool bContinue = false;
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
do
{ // middle check loop
@@ -408,7 +407,7 @@ DdeItem* DdeInternal::FindItem( DdeTopic& rTopic, HSZ hItem )
std::vector<DdeItem*>::iterator iter;
std::vector<DdeItem*> &rItems = rTopic.aItems;
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
bool bContinue = false;
do
@@ -481,7 +480,7 @@ DdeService::DdeService( const OUString& rService )
DdeService::~DdeService()
{
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
if ( pInst->pServicesSvr )
pInst->pServicesSvr->erase(std::remove(pInst->pServicesSvr->begin(), pInst->pServicesSvr->end(), this), pInst->pServicesSvr->end());
@@ -512,7 +511,7 @@ const OUString DdeService::GetName() const
DdeServices& DdeService::GetServices()
{
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
return *(pInst->pServicesSvr);
}
@@ -586,7 +585,7 @@ void DdeService::RemoveFormat(SotClipboardFormatId nFmt)
DdeTopic::DdeTopic( const OUString& rName )
{
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
pName = new DdeString( pInst->hDdeInstSvr, rName );
}
@@ -658,7 +657,7 @@ void DdeTopic::NotifyClient( const OUString& rItem )
{
std::vector<DdeItem*>::iterator iter;
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
for ( iter = aItems.begin(); iter != aItems.end(); ++iter)
{
if ( (*iter)->GetName().equals(rItem) && (*iter)->pImpData)
@@ -701,7 +700,7 @@ bool DdeTopic::StartAdviseLoop()
DdeItem::DdeItem( const sal_Unicode* p )
{
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
pName = new DdeString( pInst->hDdeInstSvr, p );
nType = DDEITEM;
pMyTopic = 0;
@@ -711,7 +710,7 @@ DdeItem::DdeItem( const sal_Unicode* p )
DdeItem::DdeItem( const OUString& r)
{
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
pName = new DdeString( pInst->hDdeInstSvr, r );
nType = DDEITEM;
pMyTopic = 0;
@@ -721,7 +720,7 @@ DdeItem::DdeItem( const OUString& r)
DdeItem::DdeItem( const DdeItem& r)
{
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
pName = new DdeString( pInst->hDdeInstSvr, r.pName->toOUString() );
nType = DDEITEM;
pMyTopic = 0;
@@ -747,7 +746,7 @@ void DdeItem::NotifyClient()
if( pMyTopic && pImpData )
{
DdeInstData* pInst = ImpGetInstData();
- DBG_ASSERT(pInst,"SVDDE:No instance data");
+ assert(pInst);
DdePostAdvise( pInst->hDdeInstSvr, pMyTopic->pName->getHSZ(), pName->getHSZ() );
}
}
commit a97d2c7a4248dc8bd6b3b3c28d07cf4a573ba074
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Oct 7 23:01:59 2016 +0200
svl: convert some DBG_ASSERT to assert
Change-Id: Id859f5584b52849d5a40e0f9946e0bf58761fbcb
diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx
index 183c7f1..8603d2b 100644
--- a/svl/source/items/cenumitm.cxx
+++ b/svl/source/items/cenumitm.cxx
@@ -161,8 +161,7 @@ SfxBoolItem::SfxBoolItem(sal_uInt16 const nWhich, SvStream & rStream)
// virtual
bool SfxBoolItem::operator ==(const SfxPoolItem & rItem) const
{
- DBG_ASSERT(dynamic_cast<const SfxBoolItem*>( &rItem ) != nullptr,
- "SfxBoolItem::operator ==(): Bad type");
+ assert(dynamic_cast<const SfxBoolItem*>(&rItem) != nullptr);
return m_bValue == static_cast< SfxBoolItem const * >(&rItem)->m_bValue;
}
diff --git a/svl/source/items/cintitem.cxx b/svl/source/items/cintitem.cxx
index 0ce5f25..a6c73d0 100644
--- a/svl/source/items/cintitem.cxx
+++ b/svl/source/items/cintitem.cxx
@@ -26,8 +26,7 @@
// virtual
bool CntByteItem::operator ==(const SfxPoolItem & rItem) const
{
- DBG_ASSERT(dynamic_cast<const CntByteItem*>( &rItem ) != nullptr,
- "CntByteItem::operator ==(): Bad type");
+ assert(dynamic_cast<const CntByteItem*>(&rItem) != nullptr);
return m_nValue == (static_cast< const CntByteItem * >(&rItem))->m_nValue;
}
@@ -95,10 +94,8 @@ CntUInt16Item::CntUInt16Item(sal_uInt16 which, SvStream & rStream) :
// virtual
bool CntUInt16Item::operator ==(const SfxPoolItem & rItem) const
{
- DBG_ASSERT(dynamic_cast< const CntUInt16Item* >(&rItem) != nullptr,
- "CntUInt16Item::operator ==(): Bad type");
- return m_nValue == (static_cast< const CntUInt16Item * >(&rItem))->
- m_nValue;
+ assert(dynamic_cast<const CntUInt16Item*>(&rItem) != nullptr);
+ return m_nValue == static_cast<const CntUInt16Item *>(&rItem)->m_nValue;
}
// virtual
@@ -165,10 +162,8 @@ CntInt32Item::CntInt32Item(sal_uInt16 which, SvStream & rStream)
// virtual
bool CntInt32Item::operator ==(const SfxPoolItem & rItem) const
{
- DBG_ASSERT(dynamic_cast< const CntInt32Item*>(&rItem) != nullptr,
- "CntInt32Item::operator ==(): Bad type");
- return m_nValue == (static_cast< const CntInt32Item * >(&rItem))->
- m_nValue;
+ assert(dynamic_cast<const CntInt32Item*>(&rItem) != nullptr);
+ return m_nValue == static_cast<const CntInt32Item *>(&rItem)->m_nValue;
}
// virtual
@@ -234,10 +229,8 @@ CntUInt32Item::CntUInt32Item(sal_uInt16 which, SvStream & rStream) :
// virtual
bool CntUInt32Item::operator ==(const SfxPoolItem & rItem) const
{
- DBG_ASSERT(dynamic_cast< const CntUInt32Item* >(&rItem) != nullptr,
- "CntUInt32Item::operator ==(): Bad type");
- return m_nValue == (static_cast< const CntUInt32Item * >(&rItem))->
- m_nValue;
+ assert(dynamic_cast<const CntUInt32Item*>(&rItem) != nullptr);
+ return m_nValue == static_cast<const CntUInt32Item *>(&rItem)->m_nValue;
}
// virtual
More information about the Libreoffice-commits
mailing list