summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sd/qa/unit/data/bnc822347_EmptyBullet.odpbin0 -> 11589 bytes
-rw-r--r--sd/qa/unit/export-tests.cxx37
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
new file mode 100644
index 000000000000..73f7e02960aa
--- /dev/null
+++ b/sd/qa/unit/data/bnc822347_EmptyBullet.odp
Binary files differ
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();