sw/qa/extras/uiwriter/data2/tdf125916.docx |binary sw/qa/extras/uiwriter/uiwriter2.cxx | 17 +++++++++++++++++ sw/source/core/doc/DocumentRedlineManager.cxx | 2 ++ 3 files changed, 19 insertions(+)
New commits: commit 9eed8ef433ca13639a985434681e0439554702e5 Author: László Németh <nem...@numbertext.org> AuthorDate: Fri Jun 14 17:02:20 2019 +0200 Commit: Xisco Faulí <xiscofa...@libreoffice.org> CommitDate: Tue Jun 18 14:06:35 2019 +0200 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 <nem...@numbertext.org> Tested-by: László Németh <nem...@numbertext.org> (cherry picked from commit eeb9481304572cc404ea1da9f3dabff43d6d191c) Reviewed-on: https://gerrit.libreoffice.org/74255 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/uiwriter/data2/tdf125916.docx b/sw/qa/extras/uiwriter/data2/tdf125916.docx new file mode 100644 index 000000000000..6e1350da9c4a Binary files /dev/null and b/sw/qa/extras/uiwriter/data2/tdf125916.docx differ 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() ) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits