Kaydet (Commit) 3afe0c79 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

--enable-dbgutil --disable-assert-always-abort fixes

...which <https://ci.libreoffice.org/job/lo_tb_random_config_linux/>
occasionally stumbles across; plus some related loplugin:staticmethods fixes

Change-Id: If6998c302cfbabfcad626d9c68d94d3368548a41
Reviewed-on: https://gerrit.libreoffice.org/63808
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst f19dfaf8
...@@ -170,7 +170,7 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel) ...@@ -170,7 +170,7 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel)
assert(aAny.hasValue()); assert(aAny.hasValue());
OUString aCID; OUString aCID;
aAny >>= aCID; aAny >>= aCID;
#ifdef DBG_UTIL #if defined DBG_UTIL && !defined NDEBUG
ObjectType eType = ObjectIdentifier::getObjectType(aCID); ObjectType eType = ObjectIdentifier::getObjectType(aCID);
assert(eType == OBJECTTYPE_AXIS); assert(eType == OBJECTTYPE_AXIS);
#endif #endif
......
...@@ -227,7 +227,7 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel) ...@@ -227,7 +227,7 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel)
assert(aAny.hasValue()); assert(aAny.hasValue());
OUString aCID; OUString aCID;
aAny >>= aCID; aAny >>= aCID;
#ifdef DBG_UTIL #if defined DBG_UTIL && !defined NDEBUG
ObjectType eType = ObjectIdentifier::getObjectType(aCID); ObjectType eType = ObjectIdentifier::getObjectType(aCID);
assert(eType == OBJECTTYPE_DATA_ERRORS_X || assert(eType == OBJECTTYPE_DATA_ERRORS_X ||
eType == OBJECTTYPE_DATA_ERRORS_Y || eType == OBJECTTYPE_DATA_ERRORS_Y ||
......
...@@ -272,7 +272,7 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel) ...@@ -272,7 +272,7 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel)
if (aCID.isEmpty()) if (aCID.isEmpty())
return OUString(); return OUString();
#ifdef DBG_UTIL #if defined DBG_UTIL && !defined NDEBUG
ObjectType eType = ObjectIdentifier::getObjectType(aCID); ObjectType eType = ObjectIdentifier::getObjectType(aCID);
assert(eType == OBJECTTYPE_DATA_SERIES); assert(eType == OBJECTTYPE_DATA_SERIES);
#endif #endif
......
...@@ -65,7 +65,7 @@ using namespace com::sun::star::xml::dom; ...@@ -65,7 +65,7 @@ using namespace com::sun::star::xml::dom;
using namespace xforms; using namespace xforms;
#if OSL_DEBUG_LEVEL > 0 #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
#define DBG_INVARIANT_TYPE(TYPE) class DBG_##TYPE { const TYPE* mpT; void check() { mpT->dbg_assertInvariant(); } public: DBG_##TYPE(const TYPE* pT) : mpT(pT) { check(); } ~DBG_##TYPE() { check(); } } _DBG_##TYPE(this); #define DBG_INVARIANT_TYPE(TYPE) class DBG_##TYPE { const TYPE* mpT; void check() { mpT->dbg_assertInvariant(); } public: DBG_##TYPE(const TYPE* pT) : mpT(pT) { check(); } ~DBG_##TYPE() { check(); } } _DBG_##TYPE(this);
#define DBG_INVARIANT() DBG_INVARIANT_TYPE(Model) #define DBG_INVARIANT() DBG_INVARIANT_TYPE(Model)
...@@ -177,7 +177,7 @@ void Model::setExternalData( bool _bData ) ...@@ -177,7 +177,7 @@ void Model::setExternalData( bool _bData )
mbExternalData = _bData; mbExternalData = _bData;
} }
#if OSL_DEBUG_LEVEL > 0 #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
void Model::dbg_assertInvariant() const void Model::dbg_assertInvariant() const
{ {
assert(mxInstances && "no instances found"); assert(mxInstances && "no instances found");
......
...@@ -139,7 +139,7 @@ public: ...@@ -139,7 +139,7 @@ public:
void setExternalData( bool _bData ); void setExternalData( bool _bData );
#if OSL_DEBUG_LEVEL > 0 #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
void dbg_assertInvariant() const; void dbg_assertInvariant() const;
#endif #endif
......
...@@ -1457,13 +1457,13 @@ class RecursionCounter ...@@ -1457,13 +1457,13 @@ class RecursionCounter
{ {
ScRecursionHelper& rRec; ScRecursionHelper& rRec;
bool bStackedInIteration; bool bStackedInIteration;
#ifdef DBG_UTIL #if defined DBG_UTIL && !defined NDEBUG
const ScFormulaCell* cell; const ScFormulaCell* cell;
#endif #endif
public: public:
RecursionCounter( ScRecursionHelper& r, ScFormulaCell* p ) RecursionCounter( ScRecursionHelper& r, ScFormulaCell* p )
: rRec(r) : rRec(r)
#ifdef DBG_UTIL #if defined DBG_UTIL && !defined NDEBUG
, cell(p) , cell(p)
#endif #endif
{ {
...@@ -1477,7 +1477,7 @@ public: ...@@ -1477,7 +1477,7 @@ public:
rRec.DecRecursionCount(); rRec.DecRecursionCount();
if (bStackedInIteration) if (bStackedInIteration)
{ {
#ifdef DBG_UTIL #if defined DBG_UTIL && !defined NDEBUG
assert(rRec.GetRecursionInIterationStack().top() == cell); assert(rRec.GetRecursionInIterationStack().top() == cell);
#endif #endif
rRec.GetRecursionInIterationStack().pop(); rRec.GetRecursionInIterationStack().pop();
......
...@@ -58,7 +58,7 @@ void SwCache::Check() ...@@ -58,7 +58,7 @@ void SwCache::Check()
assert(pObj == m_pLast); assert(pObj == m_pLast);
} }
pObj = pObj->GetNext(); pObj = pObj->GetNext();
assert(pObj != pOldRealFirst); assert(pObj != pOldRealFirst); (void) pOldRealFirst;
} }
assert(bFirstFound); assert(bFirstFound);
SAL_WARN_IF( nCnt + m_aFreePositions.size() != size(), "sw.core", "Lost Chain." ); SAL_WARN_IF( nCnt + m_aFreePositions.size() != size(), "sw.core", "Lost Chain." );
......
...@@ -1573,7 +1573,7 @@ SwRect SwTextFrame::SmartTagScan(SwTextNode & rNode) ...@@ -1573,7 +1573,7 @@ SwRect SwTextFrame::SmartTagScan(SwTextNode & rNode)
void SwTextFrame::CollectAutoCmplWrds(SwTextNode & rNode, sal_Int32 nActPos) void SwTextFrame::CollectAutoCmplWrds(SwTextNode & rNode, sal_Int32 nActPos)
{ {
assert(sw::FrameContainsNode(*this, rNode.GetIndex())); assert(sw::FrameContainsNode(*this, rNode.GetIndex())); (void) this;
SwTextNode *const pNode(&rNode); SwTextNode *const pNode(&rNode);
if (!nActPos) if (!nActPos)
nActPos = COMPLETE_STRING; nActPos = COMPLETE_STRING;
......
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