diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-08-28 13:04:32 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-08-28 13:50:48 +0200 |
commit | a870b029a072567cff06efb61fe915c621f178b4 (patch) | |
tree | 415c4f92e49bc163a057d5112f0e85a4b81fe4a3 /sd | |
parent | 3f1f2d71009776072078897293b6b222492c102f (diff) |
bnc#822347: Test for bullet character defined as '' - empty char.
Change-Id: Ie771a5e53f04c0cd307d24a8bfc3ab7bc9a3094a
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/bnc822347_EmptyBullet.odp | bin | 0 -> 11589 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 37 |
2 files changed, 37 insertions, 0 deletions
diff --git a/sd/qa/unit/data/bnc822347_EmptyBullet.odp b/sd/qa/unit/data/bnc822347_EmptyBullet.odp Binary files differnew file mode 100644 index 000000000000..73f7e02960aa --- /dev/null +++ b/sd/qa/unit/data/bnc822347_EmptyBullet.odp diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index fa29403123dd..0c856fd06d19 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -8,6 +8,7 @@ */ #include "sdmodeltestbase.hxx" +#include "Outliner.hxx" #include <svl/stritem.hxx> #include <editeng/editobj.hxx> @@ -21,8 +22,11 @@ #include <editeng/numitem.hxx> #include <editeng/lrspitem.hxx> #include <editeng/postitem.hxx> +#include <editeng/bulletitem.hxx> + #include <rsc/rscsfx.hxx> +#include <svx/svdoutl.hxx> #include <svx/svdotext.hxx> #include <svx/svdoashp.hxx> #include <svx/svdograf.hxx> @@ -64,6 +68,7 @@ public: void testN828390(); void testBnc880763(); void testBnc862510_5(); + void testBnc822347_EmptyBullet(); CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST(testN821567); @@ -76,6 +81,7 @@ public: CPPUNIT_TEST(testN828390); CPPUNIT_TEST(testBnc880763); CPPUNIT_TEST(testBnc862510_5); + CPPUNIT_TEST(testBnc822347_EmptyBullet); CPPUNIT_TEST_SUITE_END(); }; @@ -420,6 +426,37 @@ void SdFiltersTest::testBnc862510_5() xDocShRef->DoClose(); } +// In numbering a bullet could be defined as empty (no character). +// When exporting to OOXML make sure that the bullet is ignored and +// not written into the file. +void SdFiltersTest::testBnc822347_EmptyBullet() +{ + sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/bnc822347_EmptyBullet.odp"), ODP); + xDocShRef = saveAndReload(xDocShRef, PPTX); + + SdDrawDocument* pDoc = xDocShRef->GetDoc(); + SdrOutliner* pOutliner = pDoc->GetInternalOutliner(); + const SdrPage* pPage = pDoc->GetPage(1); + SdrObject* pObject = pPage->GetObj(0); + SdrTextObj* pTextObject = dynamic_cast<SdrTextObj*>(pObject); + CPPUNIT_ASSERT(pTextObject); + + OutlinerParaObject* pOutlinerParagraphObject = pTextObject->GetOutlinerParaObject(); + const EditTextObject& aEdit = pOutlinerParagraphObject->GetTextObject(); + + OUString sText = aEdit.GetText(0); + CPPUNIT_ASSERT_EQUAL(OUString("M3 Feature Test"), sText); + + pOutliner->SetText(*pOutlinerParagraphObject); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pOutliner->GetParagraphCount()); + + const sal_Int16 nDepth = pOutliner->GetDepth(0); + + CPPUNIT_ASSERT_EQUAL(sal_Int16(-1), nDepth); // depth >= 0 means that the paragraph has bullets enabled + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest); CPPUNIT_PLUGIN_IMPLEMENT(); |