summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-11-08 09:28:59 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-11-08 14:34:10 +0100
commit5feed3891782fc158209e04ab7d6c639266bcf6e (patch)
tree533efe682d729182697006ca39f82b6e311fa89a /editeng
parent1e8b61d3ab6919aaae0faf2d4db43e3ec0348350 (diff)
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: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/inc/editdoc.hxx6
-rw-r--r--editeng/source/editeng/editdbg.cxx2
-rw-r--r--editeng/source/editeng/editdoc.cxx34
-rw-r--r--editeng/source/editeng/impedit2.cxx2
-rw-r--r--editeng/source/editeng/impedit4.cxx2
-rw-r--r--editeng/source/editeng/impedit5.cxx2
6 files changed, 26 insertions, 22 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<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
{
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<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;
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