diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2024-03-25 16:01:48 +0300 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2024-07-24 21:47:26 +0200 |
commit | 99125ebab06f776cc8d44f063d6bed76d51996ff (patch) | |
tree | f7879488ba71f64708882ad19b0a2b40ecce71c3 | |
parent | 8f7a867609442a542dbeb1701e6a7dae4db359f1 (diff) |
tdf#160553: writerfilter: RTF import: fix problem with first table in sectioncib_contract49c-24.2.5.2.M1
Handles section properties between tables.
JUnit test included
Change-Id: I1db8b80749d18c0e73112e4fd1d13d6331aa7291
Change-Id: I8b00bfeb260af024f48ba8a3e6e6ac38e834b684
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170924
Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rwxr-xr-x | sw/qa/extras/rtfimport/data/tdf160553.rtf | 20 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 3 |
3 files changed, 30 insertions, 1 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf160553.rtf b/sw/qa/extras/rtfimport/data/tdf160553.rtf new file mode 100755 index 000000000000..2e7b26db4e70 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf160553.rtf @@ -0,0 +1,20 @@ +{\rtf1
+
+
+\trowd \cellx6096\cellx9356
+\intbl 1\cell
+\intbl 2\cell
+\trowd \cellx6096\cellx9356
+\row
+\pard HELLO\par
+
+\sect\sectd
+
+\trowd \cellx6096\cellx9356
+\intbl 1\cell
+\intbl 2\cell
+\trowd \cellx6096\cellx9356
+\row
+\pard
+
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 58a6857cffd2..4feef4bd113c 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1837,6 +1837,14 @@ CPPUNIT_TEST_FIXTURE(Test, test158044Tdf) CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, fillStyle); } } + +CPPUNIT_TEST_FIXTURE(Test, test160553Tdf) +{ + createSwDoc("tdf160553.rtf"); + // new section should create second page + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + // tests should only be added to rtfIMPORT *if* they fail round-tripping in rtfEXPORT CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index d2fcefced9aa..01e2f043390a 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3350,7 +3350,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) } break; case NS_ooxml::LN_tblEnd: - m_pImpl->m_StreamStateStack.top().nTableDepth--; + if (m_pImpl->m_StreamStateStack.top().nTableDepth > 0) + m_pImpl->m_StreamStateStack.top().nTableDepth--; break; case NS_ooxml::LN_tcStart: m_pImpl->m_nTableCellDepth++; |