diff options
author | Justin Luth <justin_luth@sil.org> | 2016-12-30 17:30:56 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-01-05 09:54:37 +0000 |
commit | 4b12246a6c2285a9d4fe20e665028b6f8a68b018 (patch) | |
tree | 0d580b9670a674cb124417e3f3dc8857ee286409 | |
parent | 82c9dbe2a015a16e8e3525daab77967a90858f14 (diff) |
tdf#49102 - remove list numbering from merged cells
The hidden cells in a vertical merge retained their
numbered list properties.
It is possible in LO's UI to create a table similar to this
by numbering the cells first, and then merging them.
So this behaviour also needs to be prevented in
a future patch.
Change-Id: I0c3ae50aada3fa03e624b1d4212b2776b7559036
Reviewed-on: https://gerrit.libreoffice.org/32512
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rwxr-xr-x | sw/qa/extras/ww8export/data/tdf49102_mergedCellNumbering.doc | bin | 0 -> 17408 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export2.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 15 |
3 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf49102_mergedCellNumbering.doc b/sw/qa/extras/ww8export/data/tdf49102_mergedCellNumbering.doc Binary files differnew file mode 100755 index 000000000000..747136d47daf --- /dev/null +++ b/sw/qa/extras/ww8export/data/tdf49102_mergedCellNumbering.doc diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index f2f5aa7cd991..6f72cd8d0d8e 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -33,6 +33,10 @@ DECLARE_WW8EXPORT_TEST(testTdf41542_borderlessPadding, "tdf41542_borderlessPaddi CPPUNIT_ASSERT_EQUAL( 3, getPages() ); } +DECLARE_WW8EXPORT_TEST(testTdf49102_mergedCellNumbering, "tdf49102_mergedCellNumbering.doc") +{ + CPPUNIT_ASSERT_EQUAL( OUString("2."), parseDump("/root/page/body/tab/row[4]/cell/txt/Special[@nType='POR_NUMBER']", "rText") ); +} DECLARE_WW8EXPORT_TEST(testTdf89377, "tdf89377_tableWithBreakBeforeParaStyle.doc") { diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 32290d9e7ded..bc1c24e38785 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -2592,6 +2592,21 @@ void WW8TabDesc::MergeCells() } } + // remove numbering from cells that will be disabled in the merge + if( rCell.bVertMerge && !rCell.bVertRestart ) + { + SwPaM aPam( *m_pTabBox->GetSttNd(), 0 ); + aPam.GetPoint()->nNode++; + SwTextNode* pNd = aPam.GetNode().GetTextNode(); + while( pNd ) + { + pNd->SetCountedInList( false ); + + aPam.GetPoint()->nNode++; + pNd = aPam.GetNode().GetTextNode(); + } + } + if (bMerge) { short nX1 = m_pActBand->nCenter[ i ]; |