diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/uiwriter/data2/tdf125881.docx | bin | 0 -> 34448 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter2.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 11 |
3 files changed, 23 insertions, 4 deletions
diff --git a/sw/qa/extras/uiwriter/data2/tdf125881.docx b/sw/qa/extras/uiwriter/data2/tdf125881.docx Binary files differnew file mode 100644 index 000000000000..569d048eefe3 --- /dev/null +++ b/sw/qa/extras/uiwriter/data2/tdf125881.docx diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index da1838597825..1be95f8a0ea5 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -1252,6 +1252,22 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf118699_redline_numbering) .is()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf125881_redline_list_level) +{ + load(DATA_DIRECTORY, "tdf125881.docx"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + // deleted paragraph gets the numbering of the next paragraph + uno::Reference<beans::XPropertySet> xProps(getParagraph(8), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("first paragraph after the first deletion: missing numbering", + xProps->getPropertyValue("NumberingRules").hasValue()); + + // check numbering level at deletion (1 instead of 0) + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), getProperty<sal_Int16>(getParagraph(8), "NumberingLevel")); +} + 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 94a361e14f37..8548768793eb 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -3029,7 +3029,7 @@ void DocumentRedlineManager::SetAutoFormatRedlineComment( const OUString* pText, void DocumentRedlineManager::FinalizeImport() { - // tdf#118699 fix numbering after deletion of numbered list items + // set correct numbering after deletion for( SwRedlineTable::size_type n = 0; n < mpRedlineTable->size(); ++n ) { SwRangeRedline* pRedl = (*mpRedlineTable)[ n ]; @@ -3040,19 +3040,22 @@ void DocumentRedlineManager::FinalizeImport() ? pRedl->GetMark() : pRedl->GetPoint(); SwTextNode* pDelNode = pStt->nNode.GetNode().GetTextNode(); SwTextNode* pTextNode = pEnd->nNode.GetNode().GetTextNode(); - // avoid of incorrect numbering after the deletion + if ( pDelNode->GetNumRule() && !pTextNode->GetNumRule() ) { - // remove numbering of the first deleted list item + // tdf#118699 remove numbering of the first deleted list item const SwPaM aPam( *pStt, *pStt ); m_rDoc.DelNumRules( aPam ); } else if ( pDelNode->GetNumRule() != pTextNode->GetNumRule() ) { - // copy numbering to the first deleted list item + // tdf#125319 copy numbering to the first deleted list item const SwPaM aPam( *pStt, *pStt ); SwNumRule *pRule = pTextNode->GetNumRule(); m_rDoc.SetNumRule( aPam, *pRule, false ); + + // tdf#125881 copy also numbering level + pDelNode->SetAttrListLevel( pTextNode->GetAttrListLevel() ); } } } |