diff options
author | Daniel Arato (NISZ) <arato.daniel@nisz.hu> | 2021-02-26 09:28:51 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-03-01 20:00:15 +0100 |
commit | bbafee3424fdc59d2f69204fefab8a318aeec0e1 (patch) | |
tree | 3e3bac865141dc50fefd5bc2acdc89207b0a6061 | |
parent | 2b20826a6a5d06a9e47c90918375a40465567716 (diff) |
tdf#140668 Crashfix: disregard w:textDirection tag outside frame
DomainMapper_Impl::SetFrameDirection had a false assumption that
a w:textDirection tag will only be encountered when the OOXML
parser is already inside a frame. This is not always the case.
Regression from commit af4e5ee0f93c1ff442d08caed5c875f2b2c1fd43
(tdf#97128 DOCX import: fix frame direction).
Change-Id: I39845599b0c7f502870e2de497df8cbdd4475594
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111594
Tested-by: Jenkins
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111754
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf140668.docx | bin | 0 -> 14629 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf140668.docx b/sw/qa/extras/ooxmlexport/data/tdf140668.docx Binary files differnew file mode 100644 index 000000000000..d7072187bb57 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf140668.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index 1a57488b67e7..e4b4ab0b0a83 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -39,6 +39,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138892_noNumbering, "tdf138892_noNumbering.docx" CPPUNIT_ASSERT_MESSAGE("Para3: <blank line>", getProperty<OUString>(getParagraph(3), "NumberingStyleName").isEmpty()); } +DECLARE_OOXMLEXPORT_TEST(testTdf140668, "tdf140668.docx") +{ + // Don't crash when document is opened + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf134619_numberingProps, "tdf134619_numberingProps.doc") { // Get the third paragraph's numbering style's 1st level's bullet size diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index afd55fe28a26..cd318ab054fa 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -966,8 +966,7 @@ public: m_bFrameDirectionSet = false; } void SetFrameDirection(sal_Int16 nDirection) { - if (!m_bFrameDirectionSet) { - assert(!m_aFrameDirectionQueue.empty()); + if (!m_bFrameDirectionSet && !m_aFrameDirectionQueue.empty()) { m_aFrameDirectionQueue.back() = nDirection; m_bFrameDirectionSet = true; } |