diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2020-01-17 14:30:56 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2020-01-23 15:01:33 +0100 |
commit | 66ed51712bb323bba7d1a0b0d21b256e5f5f9ccf (patch) | |
tree | 42fe1df2126ceae345bd0af4bdeeca0227a9fa32 /sd/qa | |
parent | b53d83507fab90606606261b8593e05bdbb06fab (diff) |
tdf#128046: preserve list levels on paste
done in two steps:
1) bullet and numbering properties must be included in the property
list of SvxUnoText on import from ODF clipboard (SvxReadXML)
2) in ConnectParagraphs, don't merge para attributes if the paragraph
to be deleted is empty. Paragraph breaks are inserted before paste so
this would make the last list level of the pasted text take the properties
of the empty paragraph and thus lose its indentation
Also updated tdf#103083 unit test to be more specific and test that
bullet properties don't get lost after paste. Previously only count
of SfxItems was tested which is somehow fragile and fails bc paste
adds a paragraph style
Change-Id: Ia162adb7abf145a8217f21c7ebfe06b69731e2a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86983
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 1e40d9645627..2fe192f66de9 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -24,6 +24,7 @@ #include <editeng/editids.hrc> #include <editeng/editobj.hxx> #include <editeng/editview.hxx> +#include <editeng/numitem.hxx> #include <editeng/outliner.hxx> #include <editeng/fhgtitem.hxx> #include <editeng/outlobj.hxx> @@ -1428,8 +1429,9 @@ void SdTiledRenderingTest::testTdf103083() SdrOutliner* pOutliner = pView->GetTextEditOutliner(); CPPUNIT_ASSERT_EQUAL(OUString("No-Logo Content~LT~Gliederung 2"), pOutliner->GetStyleSheet(2)->GetName()); - const SfxItemSet& rParagraphItemSet1 = pTextObject->GetOutlinerParaObject()->GetTextObject().GetParaAttribs(2); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), rParagraphItemSet1.Count()); + const EditTextObject& aEdit = pTextObject->GetOutlinerParaObject()->GetTextObject(); + const SvxNumBulletItem* pNumFmt = aEdit.GetParaAttribs(2).GetItem(EE_PARA_NUMBULLET); + SvxNumberFormat aNumFmt(pNumFmt->GetNumRule()->GetLevel(2)); // cut contents of bullet item comphelper::dispatchCommand(".uno:Cut", uno::Sequence<beans::PropertyValue>()); @@ -1456,8 +1458,12 @@ void SdTiledRenderingTest::testTdf103083() CPPUNIT_ASSERT_EQUAL(OUString("No-Logo Content~LT~Gliederung 2"), pOutliner->GetStyleSheet(2)->GetName()); - const SfxItemSet& rParagraphItemSet2 = pTextObject->GetOutlinerParaObject()->GetTextObject().GetParaAttribs(2); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), rParagraphItemSet2.Count()); + const EditTextObject& aEdit2 = pTextObject->GetOutlinerParaObject()->GetTextObject(); + const SvxNumBulletItem* pNumFmt2 = aEdit2.GetParaAttribs(2).GetItem(EE_PARA_NUMBULLET); + SvxNumberFormat aNumFmt2(pNumFmt2->GetNumRule()->GetLevel(2)); + + bool bEqual(aNumFmt2 == aNumFmt); + CPPUNIT_ASSERT_MESSAGE("Bullet properties changed after paste", bEqual); } /** |