tdf#166436: check field stack is not empty
like other places do Change-Id: I6fcb2bd849b11b0f17f1b19193a24c8e1f4ee660 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184909 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
BIN
sw/qa/extras/ooxmlexport/data/tdf166436.docx
Normal file
BIN
sw/qa/extras/ooxmlexport/data/tdf166436.docx
Normal file
Binary file not shown.
@@ -292,6 +292,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138739, "tdf138739.docx")
|
||||
CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(getParagraph(5), 3), u"CharWeight"_ustr));
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Test, testTdf166436)
|
||||
{
|
||||
// Without the fix in place, this test would have crashed at import time
|
||||
loadAndReload("tdf166436.docx");
|
||||
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
|
||||
uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
|
||||
CPPUNIT_ASSERT(xFieldsAccess->hasElements());
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Test, testTdf123390)
|
||||
{
|
||||
loadAndReload("tdf123390.fodt");
|
||||
|
@@ -2741,7 +2741,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
|
||||
}
|
||||
}
|
||||
|
||||
else if ( pSectionContext )
|
||||
else if ( pSectionContext && m_pImpl->IsOpenField())
|
||||
{
|
||||
FieldContextPtr pContext = m_pImpl->GetTopFieldContext();
|
||||
rtl::Reference< SwXSection > xTOC = pContext->GetTOC();
|
||||
|
Reference in New Issue
Block a user