diff options
Diffstat (limited to 'sw/source/core/unocore/unoportenum.cxx')
-rw-r--r-- | sw/source/core/unocore/unoportenum.cxx | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 2506285ad866..85877cbdf81d 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -286,25 +286,27 @@ namespace ::sw::mark::AnnotationMark* const pAnnotationMark = dynamic_cast< ::sw::mark::AnnotationMark* >(ppMark->get()); - if ( pAnnotationMark == nullptr ) - { + if (!pAnnotationMark) continue; - } const SwPosition& rStartPos = pAnnotationMark->GetMarkStart(); - if ( rStartPos.nNode == nOwnNode ) + if (rStartPos.nNode != nOwnNode) + continue; + + const SwFormatField* pAnnotationFormatField = pAnnotationMark->GetAnnotationFormatField(); + if (!pAnnotationFormatField) { - const SwFormatField* pAnnotationFormatField = pAnnotationMark->GetAnnotationFormatField(); - assert(pAnnotationFormatField != nullptr); - rAnnotationStartArr.insert( - std::make_shared<SwAnnotationStartPortion_Impl>( - SwXTextField::CreateXTextField(&rDoc, - pAnnotationFormatField), - rStartPos)); + SAL_WARN("sw.core", "missing annotation format field"); + continue; } + + rAnnotationStartArr.insert( + std::make_shared<SwAnnotationStartPortion_Impl>( + SwXTextField::CreateXTextField(&rDoc, + pAnnotationFormatField), + rStartPos)); } } - } const uno::Sequence< sal_Int8 > & SwXTextPortionEnumeration::getUnoTunnelId() |