diff options
author | László Németh <nemeth@numbertext.org> | 2019-06-14 17:02:20 +0200 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2019-06-18 14:06:35 +0200 |
commit | 9eed8ef433ca13639a985434681e0439554702e5 (patch) | |
tree | 539704f7fb5bc7da5a7e7748cf03f1c677a141e6 /sw | |
parent | 3c1f6fc029ab8ff9129f2316a3d7c81bc7b69125 (diff) |
tdf#125916 DOCX import: fix outline numbering at tracked deletion
Now there is no extra header after import (fixed regression from the
commit 8acc15b5113c798ecdbeed91456a92e7b0c1334e "tdf#118699 DOCX import:
don't add numbering") and the actual outline numbering is stable during
the next export/import cycles (losing correct numbering is the original
bug of DOCX import with change tracking).
Change-Id: I49a78549c10c4ce0b97bb2d593059bf25c4d7aab
Reviewed-on: https://gerrit.libreoffice.org/74054
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit eeb9481304572cc404ea1da9f3dabff43d6d191c)
Reviewed-on: https://gerrit.libreoffice.org/74255
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/uiwriter/data2/tdf125916.docx | bin | 0 -> 40570 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter2.cxx | 17 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 2 |
3 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data2/tdf125916.docx b/sw/qa/extras/uiwriter/data2/tdf125916.docx Binary files differnew file mode 100644 index 000000000000..6e1350da9c4a --- /dev/null +++ b/sw/qa/extras/uiwriter/data2/tdf125916.docx diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 1be95f8a0ea5..b283af27b24c 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -1268,6 +1268,23 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf125881_redline_list_level) CPPUNIT_ASSERT_EQUAL(sal_Int16(1), getProperty<sal_Int16>(getParagraph(8), "NumberingLevel")); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf125916_redline_restart_numbering) +{ + load(DATA_DIRECTORY, "tdf125916.docx"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + IDocumentRedlineAccess& rIDRA(pDoc->getIDocumentRedlineAccess()); + rIDRA.AcceptAllRedline(true); + + // check unnecessary numbering + uno::Reference<beans::XPropertySet> xProps(getParagraph(3), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("first paragraph after the first deletion: erroneous numbering", + !xProps->getPropertyValue("NumberingRules").hasValue()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf125310) { load(DATA_DIRECTORY, "tdf125310.fodt"); diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 8548768793eb..5142be7c8d85 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -3046,6 +3046,8 @@ void DocumentRedlineManager::FinalizeImport() // tdf#118699 remove numbering of the first deleted list item const SwPaM aPam( *pStt, *pStt ); m_rDoc.DelNumRules( aPam ); + // tdf#125916 copy style + pDelNode->ChgFormatColl( pTextNode->GetTextColl() ); } else if ( pDelNode->GetNumRule() != pTextNode->GetNumRule() ) { |