dev/null |binary sd/qa/unit/import-tests2.cxx | 55 ++++++++++++++++++++++++++++++++----------- 2 files changed, 41 insertions(+), 14 deletions(-)
New commits: commit 3f3ec465e14bf55a53bf795f07c1da7527d092aa Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Feb 25 16:49:24 2025 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Feb 25 20:10:52 2025 +0100 tdf#164640: improve unittest * Test more levels * Can be reproduced with a blank document After commit 3aa4d993063a3f871f8f509ba81274a356d0dda0 Author: Xisco Fauli <xiscofa...@libreoffice.org> Date: Tue Feb 25 13:49:12 2025 +0100 tdf#164640: sd_import_tests2: Add unittest Change-Id: I4135a757bc85fb8a3233f613263ea6b71f41efa5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182187 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/sd/qa/unit/data/odp/tdf164640.odp b/sd/qa/unit/data/odp/tdf164640.odp deleted file mode 100644 index 862a07b13806..000000000000 Binary files a/sd/qa/unit/data/odp/tdf164640.odp and /dev/null differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 535e75e82cf1..f6c30881cadc 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -628,7 +628,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf103477) CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf164640) { - createSdImpressDoc("odp/tdf164640.odp"); + createSdImpressDoc(); SdXImpressDocument* pXImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get()); CPPUNIT_ASSERT(pXImpressDocument); @@ -636,22 +636,49 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf164640) SdStyleSheetPool* const pPool(pDoc->GetSdStyleSheetPool()); - OUString aStyleName(SdResId(STR_PSEUDOSHEET_OUTLINE) + " 2"); - SfxStyleSheetBase* pStyleSheet = pPool->Find(aStyleName, SfxStyleFamily::Pseudo); - CPPUNIT_ASSERT(pStyleSheet); + for (sal_Int32 nLevel = 1; nLevel < 10; nLevel++) + { + OString aMsg = "Fails on level " + OString::number(nLevel); - const SvxNumBulletItem& rNumFmt = pStyleSheet->GetItemSet().Get(EE_PARA_NUMBULLET); - sal_UCS4 aBullet1 = rNumFmt.GetNumRule().GetLevel(0).GetBulletChar(); - CPPUNIT_ASSERT_EQUAL(sal_UCS4(0x25CF), aBullet1); + OUString aStyleName(SdResId(STR_PSEUDOSHEET_OUTLINE) + " " + OUString::number(nLevel)); + SfxStyleSheetBase* pStyleSheet = pPool->Find(aStyleName, SfxStyleFamily::Pseudo); + CPPUNIT_ASSERT(pStyleSheet); - sal_UCS4 aBullet2 = rNumFmt.GetNumRule().GetLevel(1).GetBulletChar(); - // Without the fix in place, this test would have failed with - // - Expected: 8211 - // - Actual : 9679 - CPPUNIT_ASSERT_EQUAL(sal_UCS4(0x2013), aBullet2); + const SvxNumBulletItem& rNumFmt = pStyleSheet->GetItemSet().Get(EE_PARA_NUMBULLET); + sal_UCS4 aBullet1 = rNumFmt.GetNumRule().GetLevel(0).GetBulletChar(); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_UCS4(0x25CF), aBullet1); + + sal_UCS4 aBullet2 = rNumFmt.GetNumRule().GetLevel(1).GetBulletChar(); + // Without the fix in place, this test would have failed with + // - Expected: 8211 + // - Actual : 9679 + // - Fails on level 2 + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_UCS4(0x2013), aBullet2); + + sal_UCS4 aBullet3 = rNumFmt.GetNumRule().GetLevel(2).GetBulletChar(); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_UCS4(0x25CF), aBullet3); - sal_UCS4 aBullet3 = rNumFmt.GetNumRule().GetLevel(2).GetBulletChar(); - CPPUNIT_ASSERT_EQUAL(sal_UCS4(0x25CF), aBullet3); + sal_UCS4 aBullet4 = rNumFmt.GetNumRule().GetLevel(3).GetBulletChar(); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_UCS4(0x2013), aBullet4); + + sal_UCS4 aBullet5 = rNumFmt.GetNumRule().GetLevel(4).GetBulletChar(); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_UCS4(0x25CF), aBullet5); + + sal_UCS4 aBullet6 = rNumFmt.GetNumRule().GetLevel(5).GetBulletChar(); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_UCS4(0x25CF), aBullet6); + + sal_UCS4 aBullet7 = rNumFmt.GetNumRule().GetLevel(6).GetBulletChar(); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_UCS4(0x25CF), aBullet7); + + sal_UCS4 aBullet8 = rNumFmt.GetNumRule().GetLevel(7).GetBulletChar(); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_UCS4(0x25CF), aBullet8); + + sal_UCS4 aBullet9 = rNumFmt.GetNumRule().GetLevel(8).GetBulletChar(); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_UCS4(0x25CF), aBullet9); + + sal_UCS4 aBullet10 = rNumFmt.GetNumRule().GetLevel(9).GetBulletChar(); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_UCS4(0x25CF), aBullet10); + } } CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf105150)