[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - writerfilter/qa writerfilter/source

Caolán McNamara caolanm at redhat.com
Sat Jul 30 21:31:55 UTC 2016


 writerfilter/qa/cppunittests/rtftok/data/fail/topcontext-1.rtf |binary
 writerfilter/source/dmapper/DomainMapper.cxx                   |    7 ++++---
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit d795eb028160241bf47036a8d544320126b5e999
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jul 30 19:22:15 2016 +0100

    fftester: context stack check
    
    (cherry picked from commit 2acc9d06291b3f271c2a88bb4995d52d2d8d2152)
    
    Change-Id: I4a135a9f9ac2f16f9dab096f5c234ff1d6e5e853
    Reviewed-on: https://gerrit.libreoffice.org/27731
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

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 0000000..7cdb94a
Binary files /dev/null and b/writerfilter/qa/cppunittests/rtftok/data/fail/topcontext-1.rtf differ
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index ef46300..d0ffaa8 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3185,14 +3185,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));


More information about the Libreoffice-commits mailing list