summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-30 19:22:15 +0100
committerAndras Timar <andras.timar@collabora.com>2016-08-15 10:25:45 +0200
commit8889345f04d82efafcc92f961901d4227d3067ee (patch)
treea7aefc21f34eed1e197a2eb18f0ff7d1907e4ff9
parentd7ceb72ff0b1ce94118d3c85cdc7641e461e44a6 (diff)
fftester: context stack check
(cherry picked from commit 2acc9d06291b3f271c2a88bb4995d52d2d8d2152) Change-Id: I4a135a9f9ac2f16f9dab096f5c234ff1d6e5e853 Reviewed-on: https://gerrit.libreoffice.org/27731 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit d795eb028160241bf47036a8d544320126b5e999)
-rw-r--r--writerfilter/qa/cppunittests/rtftok/data/fail/topcontext-1.rtfbin0 -> 458 bytes
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx7
2 files changed, 4 insertions, 3 deletions
diff --git a/writerfilter/qa/cppunittests/rtftok/data/fail/topcontext-1.rtf b/writerfilter/qa/cppunittests/rtftok/data/fail/topcontext-1.rtf
new file mode 100644
index 000000000000..7cdb94ab2c79
--- /dev/null
+++ b/writerfilter/qa/cppunittests/rtftok/data/fail/topcontext-1.rtf
Binary files differ
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index d39e6bb9d11b..bddedddd1420 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3228,14 +3228,15 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
// If the paragraph contains only the section properties and it has
// no runs, we should not create a paragraph for it in Writer, unless that would remove the whole section.
bool bRemove = !m_pImpl->GetParaChanged() && m_pImpl->GetParaSectpr() && !bSingleParagraph && !m_pImpl->GetIsDummyParaAddedForTableInSection();
- if (bRemove)
+ PropertyMapPtr xContext = bRemove ? m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH) : PropertyMapPtr();
+ if (xContext)
{
// tdf#97417 delete numbering of the paragraph
// it will be deleted anyway, and the numbering would be copied
// to the next paragraph in sw SplitNode and then be applied to
// every following paragraph
- m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH)->Erase(PROP_NUMBERING_RULES);
- m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH)->Erase(PROP_NUMBERING_LEVEL);
+ xContext->Erase(PROP_NUMBERING_RULES);
+ xContext->Erase(PROP_NUMBERING_LEVEL);
}
m_pImpl->SetParaSectpr(false);
m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH));