summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode/thints.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/txtnode/thints.cxx')
-rw-r--r--sw/source/core/txtnode/thints.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 5b363f2d9119..ba2889236f52 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1180,6 +1180,12 @@ void SwTextNode::DestroyAttr( SwTextAttr* pAttr )
SwTextField *const pTextField(static_txtattr_cast<SwTextField*>(pAttr));
SwFieldType* pFieldType = pAttr->GetFormatField().GetField()->GetTyp();
+ if (SwFieldIds::Dde != pFieldType->Which()
+ && !pTextField->GetpTextNode())
+ {
+ break; // was not yet inserted
+ }
+
//JP 06-08-95: DDE-fields are an exception
assert(SwFieldIds::Dde == pFieldType->Which() ||
this == pTextField->GetpTextNode());
@@ -1599,6 +1605,7 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, const SetAttrMode nMode )
if ( pAttr->End() == nullptr )
{
bInsertHint = false;
+ DestroyAttr(pAttr);
}
else
{
@@ -2971,6 +2978,7 @@ bool SwpHints::TryInsertHint(
if ( MAX_HINTS <= Count() ) // we're sorry, this flight is overbooked...
{
OSL_FAIL("hints array full :-(");
+ rNode.DestroyAttr(pHint);
return false;
}