summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf129659.docxbin0 -> 18584 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport2.cxx5
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx15
3 files changed, 12 insertions, 8 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf129659.docx b/sw/qa/extras/ooxmlimport/data/tdf129659.docx
new file mode 100644
index 000000000000..38bd040d59bd
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf129659.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index 593947fd77ab..7ba2aae3d74a 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -536,6 +536,11 @@ DECLARE_OOXMLIMPORT_TEST(testTdf130214, "tdf130214.docx")
// Currently this file imports with errors because of tdf#126435; it must not segfault on load
}
+DECLARE_OOXMLIMPORT_TEST(testTdf129659, "tdf129659.docx")
+{
+ // don't crash on footnote with page break
+}
+
// tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 0da610f7ab53..d7545309ea99 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3168,8 +3168,7 @@ void DomainMapper::lcl_text(const sal_uInt8 * data_, size_t len)
}
}
- PropertyMapPtr pContext = m_pImpl->GetTopContext();
- if (pContext && !pContext->GetFootnote().is())
+ if (!m_pImpl->GetFootnoteContext())
{
if (m_pImpl->isBreakDeferred(PAGE_BREAK))
m_pImpl->GetTopContext()->Insert(PROP_BREAK_TYPE, uno::makeAny(style::BreakType_PAGE_BEFORE));
@@ -3178,7 +3177,8 @@ void DomainMapper::lcl_text(const sal_uInt8 * data_, size_t len)
m_pImpl->clearDeferredBreaks();
}
- if( pContext->GetFootnote().is() && m_pImpl->IsInCustomFootnote() )
+ PropertyMapPtr pContext = m_pImpl->GetTopContext();
+ if (pContext && pContext->GetFootnote().is() && m_pImpl->IsInCustomFootnote())
{
pContext->GetFootnote()->setLabel(sText);
//otherwise ignore sText
@@ -3404,7 +3404,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
const bool bSingleParagraph = m_pImpl->GetIsFirstParagraphInSection() && m_pImpl->GetIsLastParagraphInSection();
const bool bSingleParagraphAfterRedline = m_pImpl->GetIsFirstParagraphInSection(true) && m_pImpl->GetIsLastParagraphInSection();
PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH);
- if (pContext && !pContext->GetFootnote().is())
+ if (!m_pImpl->GetFootnoteContext())
{
if (m_pImpl->isBreakDeferred(PAGE_BREAK))
{
@@ -3464,9 +3464,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
}
else
{
-
- PropertyMapPtr pContext = m_pImpl->GetTopContext();
- if ( pContext && !pContext->GetFootnote().is() )
+ if (!m_pImpl->GetFootnoteContext())
{
if (m_pImpl->isBreakDeferred(PAGE_BREAK))
{
@@ -3495,7 +3493,8 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
m_pImpl->clearDeferredBreaks();
}
- if( pContext && pContext->GetFootnote().is() )
+ PropertyMapPtr pContext = m_pImpl->GetTopContext();
+ if (pContext && pContext->GetFootnote().is() && m_pImpl->IsInCustomFootnote())
{
pContext->GetFootnote()->setLabel( sText );
//otherwise ignore sText