From 5feed3891782fc158209e04ab7d6c639266bcf6e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 8 Nov 2018 09:28:59 +0100 Subject: More --enable-debug --disable-assert-always-abort fixes ...which occasionally stumbles across Change-Id: I2f28fda7522b2f6b009fc2b64766ec9e43c1ab67 Reviewed-on: https://gerrit.libreoffice.org/63067 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- editeng/inc/editdoc.hxx | 6 ++++-- editeng/source/editeng/editdbg.cxx | 2 ++ editeng/source/editeng/editdoc.cxx | 34 +++++++++++++++++----------------- editeng/source/editeng/impedit2.cxx | 2 +- editeng/source/editeng/impedit4.cxx | 2 +- editeng/source/editeng/impedit5.cxx | 2 +- starmath/source/accessibility.cxx | 4 ++-- svx/source/dialog/charmap.cxx | 2 +- svx/source/form/formcontroller.cxx | 2 +- sw/source/core/access/accmap.cxx | 2 +- sw/source/core/layout/atrfrm.cxx | 2 +- sw/source/core/txtnode/ndtxt.cxx | 2 +- 12 files changed, 33 insertions(+), 29 deletions(-) diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx index 881fc474ae33..4e7efff897fa 100644 --- a/editeng/inc/editdoc.hxx +++ b/editeng/inc/editdoc.hxx @@ -229,7 +229,7 @@ public: void Remove(const EditCharAttrib* p); void Remove(sal_Int32 nPos); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG static void DbgCheckAttribs(CharAttribList const& rAttribs); #endif }; @@ -668,7 +668,7 @@ public: void Append(std::unique_ptr p); sal_Int32 Count() const; -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG // temporary: static void DbgCheck(ParaPortionList const&, EditDoc const& rDoc); #endif @@ -826,7 +826,9 @@ inline EditCharAttrib* GetAttrib(CharAttribList::AttribsType& rAttribs, sal_Int3 return (nAttr < static_cast(rAttribs.size())) ? rAttribs[nAttr].get() : nullptr; } +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG void CheckOrderedList(const CharAttribList::AttribsType& rAttribs); +#endif class EditEngineItemPool : public SfxItemPool { diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index 7daf8b965bf7..732f788ef677 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -500,7 +500,9 @@ bool ParaPortion::DbgCheckTextPortions(ParaPortion const& rPara) } return nXLen == rPara.pNode->Len(); } +#endif +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG void CheckOrderedList(const CharAttribList::AttribsType& rAttribs) { sal_Int32 nPrev = 0; diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 9ed29b0a752a..5881868ab5b4 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -784,7 +784,7 @@ ParaPortion* ParaPortionList::SafeGetObject(sal_Int32 nPos) return 0 <= nPos && nPos < static_cast(maPortions.size()) ? maPortions[nPos].get() : nullptr; } -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG void ParaPortionList::DbgCheck(ParaPortionList const& rParas, EditDoc const& rDoc) { @@ -1202,7 +1202,7 @@ void ContentNode::ExpandAttribs( sal_Int32 nIndex, sal_Int32 nNew, SfxItemPool& if ( !nNew ) return; -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(aCharAttribList); #endif @@ -1332,7 +1332,7 @@ void ContentNode::ExpandAttribs( sal_Int32 nIndex, sal_Int32 nNew, SfxItemPool& mpWrongList->TextInserted( nIndex, nNew, bSep ); } -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(aCharAttribList); #endif } @@ -1342,7 +1342,7 @@ void ContentNode::CollapseAttribs( sal_Int32 nIndex, sal_Int32 nDeleted, SfxItem if ( !nDeleted ) return; -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(aCharAttribList); #endif @@ -1426,7 +1426,7 @@ void ContentNode::CollapseAttribs( sal_Int32 nIndex, sal_Int32 nDeleted, SfxItem if (mpWrongList) mpWrongList->TextDeleted(nIndex, nDeleted); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(aCharAttribList); #endif } @@ -1435,7 +1435,7 @@ void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, { assert(pPrevNode); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(aCharAttribList); CharAttribList::DbgCheckAttribs(pPrevNode->aCharAttribList); #endif @@ -1484,7 +1484,7 @@ void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, pAttrib = GetAttrib(rPrevAttribs, nAttr); } -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(aCharAttribList); CharAttribList::DbgCheckAttribs(pPrevNode->aCharAttribList); #endif @@ -1496,7 +1496,7 @@ void ContentNode::AppendAttribs( ContentNode* pNextNode ) sal_Int32 nNewStart = maString.getLength(); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(aCharAttribList); CharAttribList::DbgCheckAttribs(pNextNode->aCharAttribList); #endif @@ -1554,7 +1554,7 @@ void ContentNode::AppendAttribs( ContentNode* pNextNode ) // For the Attributes that just moved over: rNextAttribs.clear(); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(aCharAttribList); CharAttribList::DbgCheckAttribs(pNextNode->aCharAttribList); #endif @@ -2395,7 +2395,7 @@ bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEn DBG_ASSERT( nStart <= nEnd, "Small miscalculations in InsertAttribInSelection" ); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(pNode->GetCharAttribs()); #endif @@ -2490,7 +2490,7 @@ bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEn SetModified(true); } -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(pNode->GetCharAttribs()); #endif @@ -2720,7 +2720,7 @@ void CharAttribList::InsertAttrib( EditCharAttrib* pAttrib ) const sal_Int32 nStart = pAttrib->GetStart(); // may be better for Comp.Opt. -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(*this); #endif @@ -2741,7 +2741,7 @@ void CharAttribList::InsertAttrib( EditCharAttrib* pAttrib ) if (bInsert) aAttribs.push_back(std::unique_ptr(pAttrib)); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(*this); #endif } @@ -2750,14 +2750,14 @@ void CharAttribList::ResortAttribs() { std::sort(aAttribs.begin(), aAttribs.end(), LessByStart()); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(*this); #endif } void CharAttribList::OptimizeRanges( SfxItemPool& rItemPool ) { -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(*this); #endif for (sal_Int32 i = 0; i < static_cast(aAttribs.size()); ++i) @@ -2782,7 +2782,7 @@ void CharAttribList::OptimizeRanges( SfxItemPool& rItemPool ) } } } -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(*this); #endif } @@ -2963,7 +2963,7 @@ void CharAttribList::DeleteEmptyAttribs( SfxItemPool& rItemPool ) bHasEmptyAttribs = false; } -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG void CharAttribList::DbgCheckAttribs(CharAttribList const& rAttribs) { std::set> zero_set; diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 639419eaf0f7..a0381437b29c 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2207,7 +2207,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n if ( pRecalc4 ) CalcHeight( pRecalc4 ); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG ParaPortionList::DbgCheck(GetParaPortions(), aEditDoc); #endif return aSelection; diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 68de66939b06..ab2d01aa225b 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1261,7 +1261,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject pPortion->MarkSelectionInvalid( nStartPos ); } -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(aPaM.GetNode()->GetCharAttribs()); #endif diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index e34edc9abf35..5e90c85ebb38 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -669,7 +669,7 @@ void ImpEditEngine::RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich, bool pAttr = GetAttrib(rAttrs, nAttr); } -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG CharAttribList::DbgCheckAttribs(pNode->GetCharAttribs()); #endif diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index cafaf43fa9a3..5e4993298a1e 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -232,7 +232,7 @@ awt::Size SAL_CALL SmGraphicAccessible::getSize() "mismatch of window parent and accessible parent" ); Size aSz( pWin->GetSizePixel() ); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG awt::Rectangle aRect( lcl_GetBounds( pWin ) ); Size aSz2( aRect.Width, aRect.Height ); assert(aSz == aSz2 && "mismatch in width" ); @@ -1603,7 +1603,7 @@ awt::Size SAL_CALL SmEditAccessible::getSize( ) "mismatch of window parent and accessible parent" ); Size aSz( pWin->GetSizePixel() ); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG awt::Rectangle aRect( lcl_GetBounds( pWin ) ); Size aSz2( aRect.Width, aRect.Height ); assert(aSz == aSz2 && "mismatch in width"); diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index aa36c3198926..1b78839c4f97 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -1773,7 +1773,7 @@ void SubsetMap::InitList() } -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG if (eBlock != UBLOCK_NO_BLOCK && eBlock != UBLOCK_INVALID_CODE && eBlock != UBLOCK_COUNT && diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 7552baf7bf7a..9d224871e8bc 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -1641,7 +1641,7 @@ void FormController::focusGained(const FocusEvent& e) ) { // check the old control if the content is ok -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG Reference< XBoundControl > xLockingTest(m_xCurrentControl, UNO_QUERY); bool bControlIsLocked = xLockingTest.is() && xLockingTest->getLock(); assert(!bControlIsLocked && "FormController::Gained: I'm modified and the current control is locked ? How this ?"); diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 7e70c1821719..a2df42b565a2 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1661,7 +1661,7 @@ SwAccessibleMap::~SwAccessibleMap() static_cast(xAcc.get()); pAcc->Dispose( true ); } -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG if( mpFrameMap ) { SwAccessibleContextMap_Impl::iterator aIter = mpFrameMap->begin(); diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index ea1980c31fd1..67dc38f2223d 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -3519,7 +3519,7 @@ bool IsFlyFrameFormatInHeader(const SwFrameFormat& rFormat) void CheckAnchoredFlyConsistency(SwDoc const& rDoc) { -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG SwNodes const& rNodes(rDoc.GetNodes()); sal_uLong const count(rNodes.Count()); for (sal_uLong i = 0; i != count; ++i) diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index b47fcac792e6..830f6630b744 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -256,7 +256,7 @@ SwTextNode::~SwTextNode() } // must be removed from outline nodes by now -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG SwOutlineNodes::size_type foo; assert(!GetNodes().GetOutLineNds().Seek_Entry(this, &foo)); #endif -- cgit v1.2.3