Kaydet (Commit) 4bd0739b authored tarafından Varun Dhall's avatar Varun Dhall Kaydeden (comit) Michael Stahl

Added Test for tdf#94804 cross ref bookmarks created with wrong prefix

Change-Id: I9cc5a703ce613c3e0331da9b49fe660e31f64586
Signed-off-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 4033537b
......@@ -37,6 +37,8 @@
#include <unocrsr.hxx>
#include <unocrsrhelper.hxx>
#include <unotbl.hxx>
#include <IMark.hxx>
#include <IDocumentMarkAccess.hxx>
#include <pagedesc.hxx>
#include <postithelper.hxx>
#include <PostItMgr.hxx>
......@@ -166,6 +168,7 @@ public:
void testTextTableCellNames();
void testShapeAnchorUndo();
void testDde();
void testTdf94804();
void testTdf89954();
void testTdf89720();
void testTdf88986();
......@@ -246,6 +249,7 @@ public:
CPPUNIT_TEST(testTextTableCellNames);
CPPUNIT_TEST(testShapeAnchorUndo);
CPPUNIT_TEST(testDde);
CPPUNIT_TEST(testTdf94804);
CPPUNIT_TEST(testTdf89954);
CPPUNIT_TEST(testTdf89720);
CPPUNIT_TEST(testTdf88986);
......@@ -2723,6 +2727,27 @@ void SwUiWriterTest::testDde()
CPPUNIT_ASSERT(xField->getString().endsWith("asdf"));
}
void SwUiWriterTest::testTdf94804()
{
//create new writer document
SwDoc* pDoc = createDoc();
//get cursor for making bookmark at a particular location
SwPaM* pCrsr = pDoc->GetEditShell()->GetCursor();
IDocumentMarkAccess* pIDMAccess(pDoc->getIDocumentMarkAccess());
//make first bookmark, CROSSREF_HEADING, with *empty* name
sw::mark::IMark* pMark1(pIDMAccess->makeMark(*pCrsr, rtl::OUString(""), IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK));
//get the new(autogenerated) bookmark name
rtl::OUString bookmark1name = pMark1->GetName();
//match the bookmark name, it should be like "__RefHeading__**"
CPPUNIT_ASSERT(bookmark1name.match("__RefHeading__"));
//make second bookmark, CROSSREF_NUMITEM, with *empty* name
sw::mark::IMark* pMark2(pIDMAccess->makeMark(*pCrsr, rtl::OUString(""), IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK));
//get the new(autogenerated) bookmark name
rtl::OUString bookmark2name = pMark2->GetName();
//match the bookmark name, it should be like "__RefNumPara__**"
CPPUNIT_ASSERT(bookmark2name.match("__RefNumPara__"));
}
void SwUiWriterTest::testUnicodeNotationToggle()
{
SwDoc* pDoc = createDoc("unicodeAltX.odt");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment