From 4bf04dea9afb30a9395e80b07a81d1908937ee8b Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 27 Aug 2021 14:38:18 +0200 Subject: tdf#128106 sw: copy bookmarks at start if whole node is copied The CrossRefHeadingBookmarks are always at index 0 so copy them if the selection also starts at index 0. This happens in SwDoc::SplitDoc() for the 2nd etc. chapter. Change-Id: I4765d497e65d3c8257f7eab59b8ba2088688967e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121147 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sw/qa/extras/uiwriter/uiwriter3.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sw/qa/extras') diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 64e3c8fb61cb..c283f3022803 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -2664,7 +2664,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf128106) CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_BOOKMARK), fields[1]->GetField()->GetSubType()); CPPUNIT_ASSERT( static_cast(fields[1]->GetField())->IsRefToHeadingCrossRefBookmark()); - // CPPUNIT_ASSERT_EQUAL(OUString("Chapter 2"), static_cast(fields[1]->GetField())->GetPar2()); + CPPUNIT_ASSERT_EQUAL(OUString("Chapter 2"), + static_cast(fields[1]->GetField())->GetPar2()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_BOOKMARK), fields[2]->GetField()->GetSubType()); CPPUNIT_ASSERT_EQUAL(OUString("Bookmarkchapter1"), static_cast(fields[2]->GetField())->GetSetRefName()); @@ -2683,7 +2684,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf128106) CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_BOOKMARK), fields[5]->GetField()->GetSubType()); CPPUNIT_ASSERT( static_cast(fields[5]->GetField())->IsRefToHeadingCrossRefBookmark()); - // CPPUNIT_ASSERT_EQUAL(OUString("Chapter 2"), static_cast(fields[5]->GetField())->GetPar2()); + CPPUNIT_ASSERT_EQUAL(OUString("Chapter 2"), + static_cast(fields[5]->GetField())->GetPar2()); tempDir.EnableKillingFile(); } -- cgit v1.2.3