Kaydet (Commit) 5feed389 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

More --enable-debug --disable-assert-always-abort fixes

...which <https://ci.libreoffice.org/job/lo_tb_random_config_linux/>
occasionally stumbles across

Change-Id: I2f28fda7522b2f6b009fc2b64766ec9e43c1ab67
Reviewed-on: https://gerrit.libreoffice.org/63067
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 1e8b61d3
......@@ -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<ParaPortion> 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<sal_Int32>(rAttribs.size())) ? rAttribs[nAttr].get() : nullptr;
}
#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
void CheckOrderedList(const CharAttribList::AttribsType& rAttribs);
#endif
class EditEngineItemPool : public SfxItemPool
{
......
......@@ -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;
......
......@@ -784,7 +784,7 @@ ParaPortion* ParaPortionList::SafeGetObject(sal_Int32 nPos)
return 0 <= nPos && nPos < static_cast<sal_Int32>(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<EditCharAttrib>(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<sal_Int32>(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<std::pair<sal_Int32, sal_uInt16>> zero_set;
......
......@@ -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;
......
......@@ -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
......
......@@ -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
......
......@@ -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");
......
......@@ -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 &&
......
......@@ -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 ?");
......
......@@ -1661,7 +1661,7 @@ SwAccessibleMap::~SwAccessibleMap()
static_cast<SwAccessibleDocumentBase *>(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();
......
......@@ -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)
......
......@@ -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
......
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