sw/source/filter/xml/xmlimp.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
New commits: commit 91ebb47f86d91f71c3e490976ee5560d18bfb3be Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Jan 21 20:52:31 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Jan 22 09:37:12 2024 +0100 ofz#66044 Timeout its not very interesting to find that long paragraphs are slow to render Change-Id: Ib849c937e288af2067243a17e90d828799062ee3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162352 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index ba7afc80ee8c..578ef0ee0bcb 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1843,6 +1843,24 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestPDFExportFODT(SvStream &rStream) uno::Reference<document::XFilter> xFODTFilter(xInterface, uno::UNO_QUERY_THROW); bool ret = xFODTFilter->filter(aArgs); + if (ret) + { + uno::Reference<text::XTextDocument> xTextDocument(xModel, uno::UNO_QUERY); + uno::Reference<text::XText> xText(xTextDocument->getText()); + uno::Reference<container::XEnumerationAccess> xParaAccess(xText, uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum(xParaAccess->createEnumeration()); + while (xParaEnum->hasMoreElements()) + { + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + // discourage very long paragraphs for fuzzing performance + if (xPara && xPara->getString().getLength() > 15000) + { + ret = false; + break; + } + } + } + if (ret) { css::uno::Reference<css::frame::XController2> xController(xModel->createDefaultViewController(xTargetFrame), UNO_SET_THROW);