summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-05 09:42:05 +0000
committerMiklos Vajna <vmiklos@collabora.com>2021-11-05 13:58:02 +0100
commit848eb0ddecd4ef4c8da06624a5479efd3d73cf64 (patch)
tree8c0f70f83f91f47ba69d376278d0572df9f3a9ff /writerfilter/source
parent3032fc36eaca2840a9e42207b5e8e88e248a439d (diff)
crashtesting: downgrade assert on bookmark missing from input docx to a warning
The docx bugdoc is "generated by ComMA version 3.3.0" and has a pair of bookmarkEnd/bookmarkStart in a non-conformant order, like so... <w:bookmarkEnd w:id="23"/> ... <w:bookmarkStart w:id="23" w:name="_Toc483311613"/> both bookmarkStart and bookmarkEnd are mapped to the same DomainMapper_Impl::StartOrEndBookmark (without a distinction made between begin/end) which assumes the first time it's called for an id that it's a bookmark start, and the second time for an id that it's a bookmark end and that there will have been a w:name seen between the 1st and 2nd calls to be used as the name for the bookmark to use at the 2nd call. That there is no bookmark name is a problem in the input docx rather than the import logic so turn this assert into a warning $ wget https://bugs.documentfoundation.org/attachment.cgi?id=157489 -O tdf130241-1.docx $ ./instdir/program/soffice --headless --convert-to pdf ./tdf130241-1.docx https: //dev-builds.libreoffice.org/crashtest/b6ef68cdaa51ca5c9fdab40ade97f4a0f18da51b/backtraces/task815-core.backtrace.txt Change-Id: Id389d186ea825f515c2638a76c9bba00666e0686 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124734 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerfilter/source')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 9bc82dfb6c92..dcec98ed59e0 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -7099,7 +7099,7 @@ void DomainMapper_Impl::StartOrEndBookmark( const OUString& rId )
xCursor->goLeft( 1, false );
}
uno::Reference< container::XNamed > xBkmNamed( xBookmark, uno::UNO_QUERY_THROW );
- assert(!aBookmarkIter->second.m_sBookmarkName.isEmpty());
+ SAL_WARN_IF(aBookmarkIter->second.m_sBookmarkName.isEmpty(), "writerfilter.dmapper", "anonymous bookmark");
//todo: make sure the name is not used already!
xBkmNamed->setName( aBookmarkIter->second.m_sBookmarkName );
xTextAppend->insertTextContent( uno::Reference< text::XTextRange >( xCursor, uno::UNO_QUERY_THROW), xBookmark, !xCursor->isCollapsed() );