diff options
author | Robinson Tryon <qubit@runcibility.com> | 2015-11-25 06:03:10 -0500 |
---|---|---|
committer | Robinson Tryon <qubit@runcibility.com> | 2015-11-25 06:07:38 -0500 |
commit | 49c2b9808df8a6b197dec666dfc0cda6321a4306 (patch) | |
tree | 045ef4b9b8dfdb06bfbe18cdf773d59f57d5552d /sw/qa | |
parent | 5470a365f25e5052b4dd74f76aa2196f0d70934b (diff) |
bin/rename-sw-abbreviations.shlibreoffice-5-1-branch-point
This commit renames the most annoying abbreviations in Writer (and
partially in the shared code too).
Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/complex/writer/CheckBookmarks.java | 36 | ||||
-rw-r--r-- | sw/qa/complex/writer/testdocuments/TESTXMLID.odt | bin | 10879 -> 10881 bytes | |||
-rw-r--r-- | sw/qa/core/macros-test.cxx | 4 | ||||
-rw-r--r-- | sw/qa/core/test_ToxTextGenerator.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/inc/swmodeltestbase.hxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/odfimport/odfimport.cxx | 24 | ||||
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 50 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 436 |
8 files changed, 278 insertions, 278 deletions
diff --git a/sw/qa/complex/writer/CheckBookmarks.java b/sw/qa/complex/writer/CheckBookmarks.java index 9acb16aadbc6..a73af1a60cc5 100644 --- a/sw/qa/complex/writer/CheckBookmarks.java +++ b/sw/qa/complex/writer/CheckBookmarks.java @@ -153,35 +153,35 @@ public class CheckBookmarks { xText.createTextCursor(), "P" + nPara + "word" + nBookmark, "P" + nPara + "word" + nBookmark); - XTextCursor xWordCrsr = xText.createTextCursor(); - xWordCrsr.setString(" "); + XTextCursor xWordCursor = xText.createTextCursor(); + xWordCursor.setString(" "); } - XTextCursor xParaCrsr = xText.createTextCursor(); - XTextRange xParaCrsrAsRange = UnoRuntime.queryInterface( + XTextCursor xParaCursor = xText.createTextCursor(); + XTextRange xParaCursorAsRange = UnoRuntime.queryInterface( XTextRange.class, - xParaCrsr); - xText.insertControlCharacter(xParaCrsrAsRange, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false); + xParaCursor); + xText.insertControlCharacter(xParaCursorAsRange, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false); } } private void insertRandomParts(long seed) { java.util.Random rnd = new java.util.Random(seed); - XTextCursor xCrsr = m_xDoc.getText().createTextCursor(); + XTextCursor xCursor = m_xDoc.getText().createTextCursor(); for(int i=0; i<600; i++) { - xCrsr.goRight((short)rnd.nextInt(100), false); - xCrsr.setString(Long.toString(rnd.nextLong())); + xCursor.goRight((short)rnd.nextInt(100), false); + xCursor.setString(Long.toString(rnd.nextLong())); } } private void deleteRandomParts(long seed) { java.util.Random rnd = new java.util.Random(seed); - XTextCursor xCrsr = m_xDoc.getText().createTextCursor(); + XTextCursor xCursor = m_xDoc.getText().createTextCursor(); for(int i=0; i<600; i++) { - xCrsr.goRight((short)rnd.nextInt(100), false); - xCrsr.goRight((short)rnd.nextInt(20), true); - xCrsr.setString(""); + xCursor.goRight((short)rnd.nextInt(100), false); + xCursor.goRight((short)rnd.nextInt(20), true); + xCursor.setString(""); } } @@ -189,13 +189,13 @@ public class CheckBookmarks { { XText xText = m_xDoc.getText(); java.util.Random rnd = new java.util.Random(seed); - XTextCursor xCrsr = m_xDoc.getText().createTextCursor(); + XTextCursor xCursor = m_xDoc.getText().createTextCursor(); for(int i=0; i<30; i++) { - xCrsr.goRight((short)rnd.nextInt(300), false); - XTextRange xCrsrAsRange = UnoRuntime.queryInterface( + xCursor.goRight((short)rnd.nextInt(300), false); + XTextRange xCursorAsRange = UnoRuntime.queryInterface( XTextRange.class, - xCrsr); - xText.insertControlCharacter(xCrsrAsRange, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false); + xCursor); + xText.insertControlCharacter(xCursorAsRange, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false); } } diff --git a/sw/qa/complex/writer/testdocuments/TESTXMLID.odt b/sw/qa/complex/writer/testdocuments/TESTXMLID.odt Binary files differindex 063d392a489f..ba7ceabc2d89 100644 --- a/sw/qa/complex/writer/testdocuments/TESTXMLID.odt +++ b/sw/qa/complex/writer/testdocuments/TESTXMLID.odt diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 2223fd7e752f..6787d4f707bc 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -439,8 +439,8 @@ void SwMacrosTest::testFindReplace() CPPUNIT_ASSERT(pTextDoc); SwDoc *const pDoc = pTextDoc->GetDocShell()->GetDoc(); SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1); - // use a UnoCrsr so it will be corrected when deleting nodes - auto pPaM(pDoc->CreateUnoCrsr(SwPosition(aIdx))); + // use a UnoCursor so it will be corrected when deleting nodes + auto pPaM(pDoc->CreateUnoCursor(SwPosition(aIdx))); IDocumentContentOperations & rIDCO(pDoc->getIDocumentContentOperations()); rIDCO.InsertString(*pPaM, "foo"); diff --git a/sw/qa/core/test_ToxTextGenerator.cxx b/sw/qa/core/test_ToxTextGenerator.cxx index 2a565ee05a88..983f2ecfa8f4 100644 --- a/sw/qa/core/test_ToxTextGenerator.cxx +++ b/sw/qa/core/test_ToxTextGenerator.cxx @@ -108,7 +108,7 @@ class MockedToxTabStopTokenHandler : public ToxTabStopTokenHandler { public: virtual HandledTabStopToken HandleTabStopToken(const SwFormToken& aToken, const SwTextNode& targetNode, - const SwRootFrm *currentLayout) const override { + const SwRootFrame *currentLayout) const override { (void)(aToken); (void)(targetNode); (void)(currentLayout); // avoid unused warnings. return HandledTabStopToken(); } @@ -128,7 +128,7 @@ public: private: SwChapterField ObtainChapterField(SwChapterFieldType* chapterFieldType, const SwFormToken* chapterToken, - const SwContentFrm* contentFrame, const SwContentNode *contentNode) const override { + const SwContentFrame* contentFrame, const SwContentNode *contentNode) const override { // get rid of 'unused-parameters' warnings (void)(chapterFieldType);(void)(chapterToken);(void)(contentFrame);(void)(contentNode); return mChapterField; diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index 09b3a95a429a..8a51f82b97df 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -303,7 +303,7 @@ private: SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); - SwRootFrm* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); pLayout->dumpAsXml(pXmlWriter); // delete xml writer diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 64be393bf170..7aa34f374fea 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -459,20 +459,20 @@ DECLARE_ODFIMPORT_TEST(testFdo37606, "fdo37606.odt") SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); { pWrtShell->SelAll(); // Selects A1. - SwTextNode& rCellEnd = dynamic_cast<SwTextNode&>(pShellCrsr->End()->nNode.GetNode()); + SwTextNode& rCellEnd = dynamic_cast<SwTextNode&>(pShellCursor->End()->nNode.GetNode()); // fdo#72486 This was "Hello.", i.e. a single select-all selected the whole document, not just the cell only. CPPUNIT_ASSERT_EQUAL(OUString("A1"), rCellEnd.GetText()); pWrtShell->SelAll(); // Selects the whole table. pWrtShell->SelAll(); // Selects the whole document. - SwTextNode& rStart = dynamic_cast<SwTextNode&>(pShellCrsr->Start()->nNode.GetNode()); + SwTextNode& rStart = dynamic_cast<SwTextNode&>(pShellCursor->Start()->nNode.GetNode()); CPPUNIT_ASSERT_EQUAL(OUString("A1"), rStart.GetText()); - SwTextNode& rEnd = dynamic_cast<SwTextNode&>(pShellCrsr->End()->nNode.GetNode()); + SwTextNode& rEnd = dynamic_cast<SwTextNode&>(pShellCursor->End()->nNode.GetNode()); // This was "A1", i.e. Ctrl-A only selected the A1 cell of the table, not the whole document. CPPUNIT_ASSERT_EQUAL(OUString("Hello."), rEnd.GetText()); } @@ -480,11 +480,11 @@ DECLARE_ODFIMPORT_TEST(testFdo37606, "fdo37606.odt") { pWrtShell->SttEndDoc(false); // Go to the end of the doc. pWrtShell->SelAll(); // And now that we're outside of the table, try Ctrl-A again. - SwTextNode& rStart = dynamic_cast<SwTextNode&>(pShellCrsr->Start()->nNode.GetNode()); + SwTextNode& rStart = dynamic_cast<SwTextNode&>(pShellCursor->Start()->nNode.GetNode()); // This was "Hello", i.e. Ctrl-A did not select the starting table. CPPUNIT_ASSERT_EQUAL(OUString("A1"), rStart.GetText()); - SwTextNode& rEnd = dynamic_cast<SwTextNode&>(pShellCrsr->End()->nNode.GetNode()); + SwTextNode& rEnd = dynamic_cast<SwTextNode&>(pShellCursor->End()->nNode.GetNode()); CPPUNIT_ASSERT_EQUAL(OUString("Hello."), rEnd.GetText()); } @@ -534,16 +534,16 @@ DECLARE_ODFIMPORT_TEST(testFdo69862, "fdo69862.odt") SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); pWrtShell->SelAll(); // Selects A1. pWrtShell->SelAll(); // Selects the whole table. pWrtShell->SelAll(); // Selects the whole document. - SwTextNode& rStart = dynamic_cast<SwTextNode&>(pShellCrsr->Start()->nNode.GetNode()); + SwTextNode& rStart = dynamic_cast<SwTextNode&>(pShellCursor->Start()->nNode.GetNode()); // This was "Footnote.", as Ctrl-A also selected footnotes, but it should not. CPPUNIT_ASSERT_EQUAL(OUString("A1"), rStart.GetText()); - SwTextNode& rEnd = dynamic_cast<SwTextNode&>(pShellCrsr->End()->nNode.GetNode()); + SwTextNode& rEnd = dynamic_cast<SwTextNode&>(pShellCursor->End()->nNode.GetNode()); CPPUNIT_ASSERT_EQUAL(OUString("H" "\x01" "ello."), rEnd.GetText()); } @@ -553,16 +553,16 @@ DECLARE_ODFIMPORT_TEST(testFdo69979, "fdo69979.odt") SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); pWrtShell->SelAll(); // Selects A1. pWrtShell->SelAll(); // Selects the whole table. pWrtShell->SelAll(); // Selects the whole document. - SwTextNode& rStart = dynamic_cast<SwTextNode&>(pShellCrsr->Start()->nNode.GetNode()); + SwTextNode& rStart = dynamic_cast<SwTextNode&>(pShellCursor->Start()->nNode.GetNode()); // This was "", as Ctrl-A also selected headers, but it should not. CPPUNIT_ASSERT_EQUAL(OUString("A1"), rStart.GetText()); - SwTextNode& rEnd = dynamic_cast<SwTextNode&>(pShellCrsr->End()->nNode.GetNode()); + SwTextNode& rEnd = dynamic_cast<SwTextNode&>(pShellCursor->End()->nNode.GetNode()); CPPUNIT_ASSERT_EQUAL(OUString("Hello."), rEnd.GetText()); } diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 858e6a4332fc..a975fff35ade 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -168,14 +168,14 @@ void SwTiledRenderingTest::testPostKeyEvent() SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); // Did we manage to go after the first character? - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pShellCrsr->GetPoint()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pShellCursor->GetPoint()->nContent.GetIndex()); pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0); pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'x', 0); // Did we manage to insert the character after the first one? - CPPUNIT_ASSERT_EQUAL(OUString("Axaa bbb."), pShellCrsr->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); + CPPUNIT_ASSERT_EQUAL(OUString("Axaa bbb."), pShellCursor->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); } void SwTiledRenderingTest::testPostMouseEvent() @@ -183,16 +183,16 @@ void SwTiledRenderingTest::testPostMouseEvent() SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); // Did we manage to go after the first character? - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pShellCrsr->GetPoint()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pShellCursor->GetPoint()->nContent.GetIndex()); - Point aStart = pShellCrsr->GetSttPos(); + Point aStart = pShellCursor->GetSttPos(); aStart.setX(aStart.getX() - 1000); pXTextDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, aStart.getX(), aStart.getY(), 1); pXTextDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, aStart.getX(), aStart.getY(), 1); // The new cursor position must be before the first word. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), pShellCrsr->GetPoint()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), pShellCursor->GetPoint()->nContent.GetIndex()); } void SwTiledRenderingTest::testSetTextSelection() @@ -203,21 +203,21 @@ void SwTiledRenderingTest::testSetTextSelection() pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 5, /*bBasicCall=*/false); // Create a selection by on the word. pWrtShell->SelWrd(); - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); // Did we indeed manage to select the second word? - CPPUNIT_ASSERT_EQUAL(OUString("bbb"), pShellCrsr->GetText()); + CPPUNIT_ASSERT_EQUAL(OUString("bbb"), pShellCursor->GetText()); // Now use setTextSelection() to move the start of the selection 1000 twips left. - Point aStart = pShellCrsr->GetSttPos(); + Point aStart = pShellCursor->GetSttPos(); aStart.setX(aStart.getX() - 1000); pXTextDocument->setTextSelection(LOK_SETTEXTSELECTION_START, aStart.getX(), aStart.getY()); // The new selection must include the first word, too -- but not the ending dot. - CPPUNIT_ASSERT_EQUAL(OUString("Aaa bbb"), pShellCrsr->GetText()); + CPPUNIT_ASSERT_EQUAL(OUString("Aaa bbb"), pShellCursor->GetText()); // Next: test that LOK_SETTEXTSELECTION_RESET + LOK_SETTEXTSELECTION_END can be used to create a selection. pXTextDocument->setTextSelection(LOK_SETTEXTSELECTION_RESET, aStart.getX(), aStart.getY()); pXTextDocument->setTextSelection(LOK_SETTEXTSELECTION_END, aStart.getX() + 1000, aStart.getY()); - CPPUNIT_ASSERT_EQUAL(OUString("Aaa b"), pShellCrsr->GetText()); + CPPUNIT_ASSERT_EQUAL(OUString("Aaa b"), pShellCursor->GetText()); } void SwTiledRenderingTest::testGetTextSelection() @@ -283,25 +283,25 @@ void SwTiledRenderingTest::testResetSelection() SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); // Select one character. pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); // We have a text selection. - CPPUNIT_ASSERT(pShellCrsr->HasMark()); + CPPUNIT_ASSERT(pShellCursor->HasMark()); pXTextDocument->resetSelection(); // We no longer have a text selection. - CPPUNIT_ASSERT(!pShellCrsr->HasMark()); + CPPUNIT_ASSERT(!pShellCursor->HasMark()); SdrPage* pPage = pWrtShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); SdrObject* pObject = pPage->GetObj(0); Point aPoint = pObject->GetSnapRect().Center(); // Select the shape. - pWrtShell->EnterSelFrmMode(&aPoint); + pWrtShell->EnterSelFrameMode(&aPoint); // We have a graphic selection. - CPPUNIT_ASSERT(pWrtShell->IsSelFrmMode()); + CPPUNIT_ASSERT(pWrtShell->IsSelFrameMode()); pXTextDocument->resetSelection(); // We no longer have a graphic selection. - CPPUNIT_ASSERT(!pWrtShell->IsSelFrmMode()); + CPPUNIT_ASSERT(!pWrtShell->IsSelFrameMode()); } void lcl_search(bool bBackward) @@ -321,12 +321,12 @@ void SwTiledRenderingTest::testSearch() SwXTextDocument* pXTextDocument = createDoc("search.odt"); pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); - size_t nNode = pWrtShell->getShellCrsr(false)->Start()->nNode.GetNode().GetIndex(); + size_t nNode = pWrtShell->getShellCursor(false)->Start()->nNode.GetNode().GetIndex(); // First hit, in the second paragraph, before the shape. lcl_search(false); CPPUNIT_ASSERT(!pWrtShell->GetDrawView()->GetTextEditObject()); - size_t nActual = pWrtShell->getShellCrsr(false)->Start()->nNode.GetNode().GetIndex(); + size_t nActual = pWrtShell->getShellCursor(false)->Start()->nNode.GetNode().GetIndex(); CPPUNIT_ASSERT_EQUAL(nNode + 1, nActual); /// Make sure we get search result selection for normal find as well, not only find all. CPPUNIT_ASSERT(!m_aSearchResultSelection.empty()); @@ -342,7 +342,7 @@ void SwTiledRenderingTest::testSearch() // Last hit, in the last paragraph, after the shape. lcl_search(false); CPPUNIT_ASSERT(!pWrtShell->GetDrawView()->GetTextEditObject()); - nActual = pWrtShell->getShellCrsr(false)->Start()->nNode.GetNode().GetIndex(); + nActual = pWrtShell->getShellCursor(false)->Start()->nNode.GetNode().GetIndex(); CPPUNIT_ASSERT_EQUAL(nNode + 7, nActual); // Now change direction and make sure that the first 2 hits are in the shape, but not the 3rd one. @@ -352,7 +352,7 @@ void SwTiledRenderingTest::testSearch() CPPUNIT_ASSERT(pWrtShell->GetDrawView()->GetTextEditObject()); lcl_search(true); CPPUNIT_ASSERT(!pWrtShell->GetDrawView()->GetTextEditObject()); - nActual = pWrtShell->getShellCrsr(false)->Start()->nNode.GetNode().GetIndex(); + nActual = pWrtShell->getShellCursor(false)->Start()->nNode.GetNode().GetIndex(); CPPUNIT_ASSERT_EQUAL(nNode + 1, nActual); comphelper::LibreOfficeKit::setActive(false); @@ -364,9 +364,9 @@ void SwTiledRenderingTest::testSearchViewArea() SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); // Go to the second page, 1-based. pWrtShell->GotoPage(2, false); - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); // Get the ~top left corner of the second page. - Point aPoint = pShellCrsr->GetSttPos(); + Point aPoint = pShellCursor->GetSttPos(); // Go back to the first page, search while the cursor is there, but the // visible area is the second page. @@ -380,7 +380,7 @@ void SwTiledRenderingTest::testSearchViewArea() })); comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues); // This was just "Heading", i.e. SwView::SearchAndWrap() did not search from only the top of the second page. - CPPUNIT_ASSERT_EQUAL(OUString("Heading on second page"), pShellCrsr->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); + CPPUNIT_ASSERT_EQUAL(OUString("Heading on second page"), pShellCursor->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); } void SwTiledRenderingTest::testSearchTextFrame() diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 89378366b41d..c69f3306a048 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -392,7 +392,7 @@ void SwUiWriterTest::testTdf67238() sw::UndoManager& rUndoManager = pDoc->GetUndoManager(); //insert a 3X3 table in the newly created document SwInsertTableOptions TableOpt(tabopts::DEFAULT_BORDER, 0); - const SwTable& rTbl = pWrtShell->InsertTable(TableOpt, 3, 3); + const SwTable& rTable = pWrtShell->InsertTable(TableOpt, 3, 3); //checking for the rows and columns uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xTable->getRows()->getCount()); @@ -403,78 +403,78 @@ void SwUiWriterTest::testTdf67238() //making the table protected pWrtShell->ProtectCells(); //checking each cell's protection, it should be protected - CPPUNIT_ASSERT(((rTbl.GetTableBox("A1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("A2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("A3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("B1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("B2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("B3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("C1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("C2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("C3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("A1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("A2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("A3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("B1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("B2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("B3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("C1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("C2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("C3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); //undo the changes, make cells [un]protected rUndoManager.Undo(); //checking each cell's protection, it should be [un]protected - CPPUNIT_ASSERT(!((rTbl.GetTableBox("A1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("A2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("A3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("B1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("B2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("B3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("C1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("C2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("C3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("A1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("A2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("A3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("B1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("B2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("B3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("C1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("C2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("C3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); //redo the changes, make cells protected rUndoManager.Redo(); //checking each cell's protection, it should be protected - CPPUNIT_ASSERT(((rTbl.GetTableBox("A1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("A2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("A3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("B1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("B2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("B3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("C1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("C2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("C3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("A1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("A2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("A3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("B1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("B2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("B3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("C1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("C2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("C3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); //moving the cursor to the starting of the document pWrtShell->SttDoc(); //making the table [un]protected pWrtShell->SelTable(); pWrtShell->UnProtectCells(); //checking each cell's protection, it should be [un]protected - CPPUNIT_ASSERT(!((rTbl.GetTableBox("A1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("A2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("A3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("B1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("B2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("B3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("C1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("C2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("C3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("A1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("A2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("A3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("B1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("B2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("B3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("C1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("C2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("C3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); //undo the changes, make cells protected rUndoManager.Undo(); //checking each cell's protection, it should be protected - CPPUNIT_ASSERT(((rTbl.GetTableBox("A1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("A2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("A3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("B1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("B2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("B3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("C1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("C2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(((rTbl.GetTableBox("C3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("A1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("A2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("A3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("B1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("B2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("B3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("C1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("C2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(((rTable.GetTableBox("C3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); //redo the changes, make cells [un]protected rUndoManager.Redo(); //checking each cell's protection, it should be [un]protected - CPPUNIT_ASSERT(!((rTbl.GetTableBox("A1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("A2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("A3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("B1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("B2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("B3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("C1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("C2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); - CPPUNIT_ASSERT(!((rTbl.GetTableBox("C3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("A1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("A2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("A3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("B1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("B2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("B3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("C1"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("C2"))->GetFrameFormat()->GetProtect()).IsContentProtected()); + CPPUNIT_ASSERT(!((rTable.GetTableBox("C3"))->GetFrameFormat()->GetProtect()).IsContentProtected()); } void SwUiWriterTest::testFdo75110() @@ -499,8 +499,8 @@ void SwUiWriterTest::testFdo75898() pWrtShell->InsertRow(1, true); // Now check if the table has 3 lines. - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false); - SwTableNode* pTableNode = pShellCrsr->Start()->nNode.GetNode().FindTableNode(); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); + SwTableNode* pTableNode = pShellCursor->Start()->nNode.GetNode().FindTableNode(); // This was 1, when doing the same using the UI, Writer even crashed. CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pTableNode->GetTable().GetTabLines().size()); } @@ -535,8 +535,8 @@ void SwUiWriterTest::testFdo69893() pWrtShell->SelAll(); // A1 is empty -> selects the whole table. pWrtShell->SelAll(); // Selects the whole document. - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false); - SwTextNode& rEnd = dynamic_cast<SwTextNode&>(pShellCrsr->End()->nNode.GetNode()); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); + SwTextNode& rEnd = dynamic_cast<SwTextNode&>(pShellCursor->End()->nNode.GetNode()); // Selection did not include the para after table, this was "B1". CPPUNIT_ASSERT_EQUAL(OUString("Para after table."), rEnd.GetText()); } @@ -581,12 +581,12 @@ void SwUiWriterTest::testImportRTF() // Insert the RTF at the cursor position. OString aData = "{\\rtf1 Hello world!\\par}"; SvMemoryStream aStream(const_cast<sal_Char*>(aData.getStr()), aData.getLength(), StreamMode::READ); - SwReader aReader(aStream, OUString(), OUString(), *pWrtShell->GetCrsr()); + SwReader aReader(aStream, OUString(), OUString(), *pWrtShell->GetCursor()); Reader* pRTFReader = SwReaderWriter::GetReader(READER_WRITER_RTF); CPPUNIT_ASSERT(pRTFReader != nullptr); CPPUNIT_ASSERT_EQUAL(sal_uLong(0), aReader.Read(*pRTFReader)); - sal_uLong nIndex = pWrtShell->GetCrsr()->GetNode().GetIndex(); + sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); CPPUNIT_ASSERT_EQUAL(OUString("fooHello world!"), pDoc->GetNodes()[nIndex - 1]->GetTextNode()->GetText()); CPPUNIT_ASSERT_EQUAL(OUString("bar"), pDoc->GetNodes()[nIndex]->GetTextNode()->GetText()); } @@ -790,9 +790,9 @@ void SwUiWriterTest::testCommentedWord() pWrtShell->SelWrd(); // Make sure that not only the word, but its comment anchor is also selected. - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); // This was 9, only "word", not "word<anchor character>" was selected. - CPPUNIT_ASSERT_EQUAL(sal_Int32(10), pShellCrsr->End()->nContent.GetIndex()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(10), pShellCursor->End()->nContent.GetIndex()); // Test that getAnchor() points to "word", not to an empty string. uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); @@ -937,13 +937,13 @@ void SwUiWriterTest::testAutoCorr() //Normal AutoCorrect pWrtShell->Insert("tset"); pWrtShell->AutoCorrect(corr, cIns); - sal_uLong nIndex = pWrtShell->GetCrsr()->GetNode().GetIndex(); + sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); CPPUNIT_ASSERT_EQUAL(OUString("Test "), static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText()); //AutoCorrect with change style to bolt pWrtShell->Insert("Bolt"); pWrtShell->AutoCorrect(corr, cIns); - nIndex = pWrtShell->GetCrsr()->GetNode().GetIndex(); + nIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); const uno::Reference< text::XTextRange > xRun = getRun(getParagraph(1), 2); CPPUNIT_ASSERT_EQUAL(OUString("Bolt"), xRun->getString()); CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun, "CharFontName")); @@ -1475,35 +1475,35 @@ void SwUiWriterTest::testTextSearch() { // Create a new empty Writer document SwDoc* pDoc = createDoc(); - SwPaM* pCrsr = pDoc->GetEditShell()->GetCrsr(); + SwPaM* pCursor = pDoc->GetEditShell()->GetCursor(); IDocumentContentOperations & rIDCO(pDoc->getIDocumentContentOperations()); // Insert some text - rIDCO.InsertString(*pCrsr, "Hello World This is a test"); + rIDCO.InsertString(*pCursor, "Hello World This is a test"); // Use cursor to select part of text for (int i = 0; i < 10; i++) { - pCrsr->Move(fnMoveBackward); + pCursor->Move(fnMoveBackward); } - pCrsr->SetMark(); + pCursor->SetMark(); for(int i = 0; i < 4; i++) { - pCrsr->Move(fnMoveBackward); + pCursor->Move(fnMoveBackward); } //Checking that the proper selection is made - CPPUNIT_ASSERT_EQUAL(OUString("This"), pCrsr->GetText()); + CPPUNIT_ASSERT_EQUAL(OUString("This"), pCursor->GetText()); // Apply a "Bold" attribute to selection SvxWeightItem aWeightItem(WEIGHT_BOLD, RES_CHRATR_WEIGHT); - rIDCO.InsertPoolItem(*pCrsr, aWeightItem); + rIDCO.InsertPoolItem(*pCursor, aWeightItem); //making another selection of text for (int i = 0; i < 7; i++) { - pCrsr->Move(fnMoveBackward); + pCursor->Move(fnMoveBackward); } - pCrsr->SetMark(); + pCursor->SetMark(); for(int i = 0; i < 5; i++) { - pCrsr->Move(fnMoveBackward); + pCursor->Move(fnMoveBackward); } //Checking that the proper selection is made - CPPUNIT_ASSERT_EQUAL(OUString("Hello"), pCrsr->GetText()); + CPPUNIT_ASSERT_EQUAL(OUString("Hello"), pCursor->GetText()); // Apply a "Bold" attribute to selection - rIDCO.InsertPoolItem(*pCrsr, aWeightItem); + rIDCO.InsertPoolItem(*pCursor, aWeightItem); //Performing Search Operation and also covering the UNO coverage for setProperty uno::Reference<util::XSearchable> xSearch(mxComponent, uno::UNO_QUERY); uno::Reference<util::XSearchDescriptor> xSearchDes(xSearch->createSearchDescriptor(), uno::UNO_QUERY); @@ -1742,25 +1742,25 @@ void SwUiWriterTest::testTdf60967() { SwDoc* pDoc = createDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - SwPaM* pCrsr = pDoc->GetEditShell()->GetCrsr(); + SwPaM* pCursor = pDoc->GetEditShell()->GetCursor(); sw::UndoManager& rUndoManager = pDoc->GetUndoManager(); pWrtShell->ChangeHeaderOrFooter("Default Style", true, true, true); //Inserting table SwInsertTableOptions TableOpt(tabopts::DEFAULT_BORDER, 0); pWrtShell->InsertTable(TableOpt, 2, 2); //getting the cursor's position just after the table insert - SwPosition aPosAfterTable(*(pCrsr->GetPoint())); + SwPosition aPosAfterTable(*(pCursor->GetPoint())); //moving cursor to B2 (bottom right cell) - pCrsr->Move(fnMoveBackward); - SwPosition aPosInTable(*(pCrsr->GetPoint())); + pCursor->Move(fnMoveBackward); + SwPosition aPosInTable(*(pCursor->GetPoint())); //deleting paragraph following table with Ctrl+Shift+Del sal_Int32 val = pWrtShell->DelToEndOfSentence(); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), val); //getting the cursor's position just after the paragraph deletion - SwPosition aPosAfterDel(*(pCrsr->GetPoint())); + SwPosition aPosAfterDel(*(pCursor->GetPoint())); //moving cursor forward to check whether there is any node following the table, BTW there should not be any such node - pCrsr->Move(fnMoveForward); - SwPosition aPosMoveAfterDel(*(pCrsr->GetPoint())); + pCursor->Move(fnMoveForward); + SwPosition aPosMoveAfterDel(*(pCursor->GetPoint())); //checking the positions to verify that the paragraph is actually deleted CPPUNIT_ASSERT(aPosInTable == aPosAfterDel); CPPUNIT_ASSERT(aPosInTable == aPosMoveAfterDel); @@ -1768,12 +1768,12 @@ void SwUiWriterTest::testTdf60967() rUndoManager.Undo(); { //paragraph *text node* should be back - SwPosition aPosAfterUndo(*(pCrsr->GetPoint())); + SwPosition aPosAfterUndo(*(pCursor->GetPoint())); //after undo aPosAfterTable increases the node position by one, since this contains the position *text node* so aPosAfterUndo should be less than aPosAfterTable CPPUNIT_ASSERT(aPosAfterTable > aPosAfterUndo); //moving cursor forward to check whether there is any node following the paragraph, BTW there should not be any such node as paragraph node is the last one in header - pCrsr->Move(fnMoveForward); - SwPosition aPosMoveAfterUndo(*(pCrsr->GetPoint())); + pCursor->Move(fnMoveForward); + SwPosition aPosMoveAfterUndo(*(pCursor->GetPoint())); //checking positions to verify that paragraph node is the last one and we are paragraph node only CPPUNIT_ASSERT(aPosAfterTable > aPosMoveAfterUndo); CPPUNIT_ASSERT(aPosMoveAfterUndo == aPosAfterUndo); @@ -1781,12 +1781,12 @@ void SwUiWriterTest::testTdf60967() //Redo the changes rUndoManager.Redo(); //paragraph *text node* should not be there - SwPosition aPosAfterRedo(*(pCrsr->GetPoint())); + SwPosition aPosAfterRedo(*(pCursor->GetPoint())); //position should be exactly same as it was after deletion of *text node* CPPUNIT_ASSERT(aPosMoveAfterDel == aPosAfterRedo); //moving the cursor forward, but it should not actually move as there is no *text node* after the table due to this same position is expected after move as it was before move - pCrsr->Move(fnMoveForward); - SwPosition aPosAfterUndoMove(*(pCrsr->GetPoint())); + pCursor->Move(fnMoveForward); + SwPosition aPosAfterUndoMove(*(pCursor->GetPoint())); CPPUNIT_ASSERT(aPosAfterUndoMove == aPosAfterRedo); } @@ -1812,15 +1812,15 @@ void SwUiWriterTest::testSearchWithTransliterate() SearchOpt.transliterateFlags = css::i18n::TransliterationModulesExtra::IGNORE_DIACRITICS_CTL; //transliteration option set so that at least one of the search strings is not found sal_uLong case1 = pWrtShell->SearchPattern(SearchOpt,true,DOCPOS_START,DOCPOS_END); - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(true); - CPPUNIT_ASSERT_EQUAL(OUString(""),pShellCrsr->GetText()); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(true); + CPPUNIT_ASSERT_EQUAL(OUString(""),pShellCursor->GetText()); CPPUNIT_ASSERT_EQUAL(0,(int)case1); SearchOpt.searchString = "paragraph"; SearchOpt.transliterateFlags = css::i18n::TransliterationModulesExtra::IGNORE_KASHIDA_CTL; //transliteration option set so that all search strings are found sal_uLong case2 = pWrtShell->SearchPattern(SearchOpt,true,DOCPOS_START,DOCPOS_END); - pShellCrsr = pWrtShell->getShellCrsr(true); - CPPUNIT_ASSERT_EQUAL(OUString("paragraph"),pShellCrsr->GetText()); + pShellCursor = pWrtShell->getShellCursor(true); + CPPUNIT_ASSERT_EQUAL(OUString("paragraph"),pShellCursor->GetText()); CPPUNIT_ASSERT_EQUAL(1,(int)case2); } @@ -1838,7 +1838,7 @@ void SwUiWriterTest::testTdf77342() { SwDoc* pDoc = createDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - SwPaM* pCrsr = pDoc->GetEditShell()->GetCrsr(); + SwPaM* pCursor = pDoc->GetEditShell()->GetCursor(); //inserting first footnote pWrtShell->InsertFootnote(""); SwFieldType* pField = pWrtShell->GetFieldType(0, RES_GETREFFLD); @@ -1851,15 +1851,15 @@ void SwUiWriterTest::testTdf77342() //inserting second footnote pWrtShell->InsertFootnote(""); pWrtShell->SttDoc(); - pCrsr->Move(fnMoveForward); + pCursor->Move(fnMoveForward); //inserting reference field 2 SwGetRefField aField2(pRefType, OUString(""), REF_FOOTNOTE, sal_uInt16(1), REF_CONTENT); pWrtShell->Insert(aField2); //inserting third footnote pWrtShell->InsertFootnote(""); pWrtShell->SttDoc(); - pCrsr->Move(fnMoveForward); - pCrsr->Move(fnMoveForward); + pCursor->Move(fnMoveForward); + pCursor->Move(fnMoveForward); //inserting reference field 3 SwGetRefField aField3(pRefType, OUString(""), REF_FOOTNOTE, sal_uInt16(2), REF_CONTENT); pWrtShell->Insert(aField3); @@ -1873,37 +1873,37 @@ void SwUiWriterTest::testTdf77342() pClpDoc->getIDocumentFieldsAccess().LockExpFields(); //selecting reference field 2 and reference field 3 and footnote 1 and footnote 2 //selection is such that more than one and not all footnotes and ref fields are selected - pCrsr->Move(fnMoveBackward); - pCrsr->Move(fnMoveBackward); + pCursor->Move(fnMoveBackward); + pCursor->Move(fnMoveBackward); //start marking - pCrsr->SetMark(); - pCrsr->Move(fnMoveForward); - pCrsr->Move(fnMoveForward); - pCrsr->Move(fnMoveForward); + pCursor->SetMark(); + pCursor->Move(fnMoveForward); + pCursor->Move(fnMoveForward); + pCursor->Move(fnMoveForward); //copying the selection to clipboard pWrtShell->Copy(pClpDoc); //deleting selection mark after copy - pCrsr->DeleteMark(); + pCursor->DeleteMark(); //checking that the footnotes reference fields have same values after copy operation uno::Any aAny; sal_uInt16 aFormat; //reference field 1 pWrtShell->SttDoc(); - SwField* pRef1 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + SwField* pRef1 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pRef1->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pRef1->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(0)), aAny); //reference field 2 - pCrsr->Move(fnMoveForward); - SwField* pRef2 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + pCursor->Move(fnMoveForward); + SwField* pRef2 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pRef2->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pRef2->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(1)), aAny); //reference field 3 - pCrsr->Move(fnMoveForward); - SwField* pRef3 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + pCursor->Move(fnMoveForward); + SwField* pRef3 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pRef3->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pRef3->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); @@ -1915,67 +1915,67 @@ void SwUiWriterTest::testTdf77342() //checking the fields, both new and old, for proper values pWrtShell->SttDoc(); //old reference field 1 - SwField* pOldRef11 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + SwField* pOldRef11 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pOldRef11->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pOldRef11->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(0)), aAny); //old reference field 2 - pCrsr->Move(fnMoveForward); - SwField* pOldRef12 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + pCursor->Move(fnMoveForward); + SwField* pOldRef12 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pOldRef12->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pOldRef12->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(1)), aAny); //old reference field 3 - pCrsr->Move(fnMoveForward); - SwField* pOldRef13 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + pCursor->Move(fnMoveForward); + SwField* pOldRef13 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pOldRef13->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pOldRef13->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(2)), aAny); //old footnote 1 - pCrsr->Move(fnMoveForward); - SwTextNode* pTextNd1 = pCrsr->GetNode().GetTextNode(); - SwTextAttr* const pFootnote1 = pTextNd1->GetTextAttrForCharAt(pCrsr->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + pCursor->Move(fnMoveForward); + SwTextNode* pTextNd1 = pCursor->GetNode().GetTextNode(); + SwTextAttr* const pFootnote1 = pTextNd1->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote1(pFootnote1->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), rFootnote1.GetNumber()); SwTextFootnote* pTFNote1 = static_cast<SwTextFootnote*> (pFootnote1); CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), pTFNote1->GetSeqRefNo()); //old footnote 2 - pCrsr->Move(fnMoveForward); - SwTextNode* pTextNd2 = pCrsr->GetNode().GetTextNode(); - SwTextAttr* const pFootnote2 = pTextNd2->GetTextAttrForCharAt(pCrsr->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + pCursor->Move(fnMoveForward); + SwTextNode* pTextNd2 = pCursor->GetNode().GetTextNode(); + SwTextAttr* const pFootnote2 = pTextNd2->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote2(pFootnote2->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), rFootnote2.GetNumber()); SwTextFootnote* pTFNote2 = static_cast<SwTextFootnote*> (pFootnote2); CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pTFNote2->GetSeqRefNo()); //old footnote 3 - pCrsr->Move(fnMoveForward); - SwTextNode* pTextNd3 = pCrsr->GetNode().GetTextNode(); - SwTextAttr* const pFootnote3 = pTextNd3->GetTextAttrForCharAt(pCrsr->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + pCursor->Move(fnMoveForward); + SwTextNode* pTextNd3 = pCursor->GetNode().GetTextNode(); + SwTextAttr* const pFootnote3 = pTextNd3->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote3(pFootnote3->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), rFootnote3.GetNumber()); SwTextFootnote* pTFNote3 = static_cast<SwTextFootnote*> (pFootnote3); CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pTFNote3->GetSeqRefNo()); //new reference field 1 - pCrsr->Move(fnMoveForward); - SwField* pNewRef11 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + pCursor->Move(fnMoveForward); + SwField* pNewRef11 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pNewRef11->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pNewRef11->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(1)), aAny); //new reference field 2 - pCrsr->Move(fnMoveForward); - SwField* pNewRef12 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + pCursor->Move(fnMoveForward); + SwField* pNewRef12 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pNewRef12->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pNewRef12->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(3)), aAny); //new footnote 1 - pCrsr->Move(fnMoveForward); - SwTextNode* pTextNd4 = pCrsr->GetNode().GetTextNode(); - SwTextAttr* const pFootnote4 = pTextNd4->GetTextAttrForCharAt(pCrsr->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + pCursor->Move(fnMoveForward); + SwTextNode* pTextNd4 = pCursor->GetNode().GetTextNode(); + SwTextAttr* const pFootnote4 = pTextNd4->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote4(pFootnote4->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(4), rFootnote4.GetNumber()); SwTextFootnote* pTFNote4 = static_cast<SwTextFootnote*> (pFootnote4); @@ -1987,89 +1987,89 @@ void SwUiWriterTest::testTdf77342() //checking the fields, both new and old, for proper values pWrtShell->SttDoc(); //new reference field 1 - SwField* pNewRef21 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + SwField* pNewRef21 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pNewRef21->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pNewRef21->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(1)), aAny); //new reference field 2 - pCrsr->Move(fnMoveForward); - SwField* pNewRef22 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + pCursor->Move(fnMoveForward); + SwField* pNewRef22 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pNewRef22->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pNewRef22->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(4)), aAny); //new footnote 1 - pCrsr->Move(fnMoveForward); - SwTextNode* pTextNd11 = pCrsr->GetNode().GetTextNode(); - SwTextAttr* const pFootnote11 = pTextNd11->GetTextAttrForCharAt(pCrsr->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + pCursor->Move(fnMoveForward); + SwTextNode* pTextNd11 = pCursor->GetNode().GetTextNode(); + SwTextAttr* const pFootnote11 = pTextNd11->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote11(pFootnote11->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), rFootnote11.GetNumber()); SwTextFootnote* pTFNote11 = static_cast<SwTextFootnote*> (pFootnote11); CPPUNIT_ASSERT_EQUAL(sal_uInt16(4), pTFNote11->GetSeqRefNo()); //old reference field 1 - pCrsr->Move(fnMoveForward); - SwField* pOldRef21 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + pCursor->Move(fnMoveForward); + SwField* pOldRef21 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pOldRef21->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pOldRef21->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(0)), aAny); //old reference field 2 - pCrsr->Move(fnMoveForward); - SwField* pOldRef22 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + pCursor->Move(fnMoveForward); + SwField* pOldRef22 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pOldRef22->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pOldRef22->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(1)), aAny); //old reference field 3 - pCrsr->Move(fnMoveForward); - SwField* pOldRef23 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + pCursor->Move(fnMoveForward); + SwField* pOldRef23 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pOldRef23->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pOldRef23->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(2)), aAny); //old footnote 1 - pCrsr->Move(fnMoveForward); - SwTextNode* pTextNd12 = pCrsr->GetNode().GetTextNode(); - SwTextAttr* const pFootnote12 = pTextNd12->GetTextAttrForCharAt(pCrsr->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + pCursor->Move(fnMoveForward); + SwTextNode* pTextNd12 = pCursor->GetNode().GetTextNode(); + SwTextAttr* const pFootnote12 = pTextNd12->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote12(pFootnote12->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), rFootnote12.GetNumber()); SwTextFootnote* pTFNote12 = static_cast<SwTextFootnote*> (pFootnote12); CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), pTFNote12->GetSeqRefNo()); //old footnote 2 - pCrsr->Move(fnMoveForward); - SwTextNode* pTextNd13 = pCrsr->GetNode().GetTextNode(); - SwTextAttr* const pFootnote13 = pTextNd13->GetTextAttrForCharAt(pCrsr->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + pCursor->Move(fnMoveForward); + SwTextNode* pTextNd13 = pCursor->GetNode().GetTextNode(); + SwTextAttr* const pFootnote13 = pTextNd13->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote13(pFootnote13->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(3), rFootnote13.GetNumber()); SwTextFootnote* pTFNote13 = static_cast<SwTextFootnote*> (pFootnote13); CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pTFNote13->GetSeqRefNo()); //old footnote 3 - pCrsr->Move(fnMoveForward); - SwTextNode* pTextNd14 = pCrsr->GetNode().GetTextNode(); - SwTextAttr* const pFootnote14 = pTextNd14->GetTextAttrForCharAt(pCrsr->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + pCursor->Move(fnMoveForward); + SwTextNode* pTextNd14 = pCursor->GetNode().GetTextNode(); + SwTextAttr* const pFootnote14 = pTextNd14->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote14(pFootnote14->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(4), rFootnote14.GetNumber()); SwTextFootnote* pTFNote14 = static_cast<SwTextFootnote*> (pFootnote14); CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pTFNote14->GetSeqRefNo()); //old reference field 4 - pCrsr->Move(fnMoveForward); - SwField* pOldRef24 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + pCursor->Move(fnMoveForward); + SwField* pOldRef24 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pOldRef24->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pOldRef24->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(1)), aAny); //old reference field 5 - pCrsr->Move(fnMoveForward); - SwField* pOldRef25 = SwCrsrShell::GetFieldAtCrsr(pCrsr, true); + pCursor->Move(fnMoveForward); + SwField* pOldRef25 = SwCursorShell::GetFieldAtCursor(pCursor, true); aFormat = pOldRef25->GetFormat(); CPPUNIT_ASSERT_EQUAL(sal_uInt16(REF_CONTENT), aFormat); pOldRef25->QueryValue(aAny, sal_uInt16(FIELD_PROP_SHORT1)); CPPUNIT_ASSERT_EQUAL(uno::makeAny(sal_uInt16(3)), aAny); //old footnote 4 - pCrsr->Move(fnMoveForward); - SwTextNode* pTextNd15 = pCrsr->GetNode().GetTextNode(); - SwTextAttr* const pFootnote15 = pTextNd15->GetTextAttrForCharAt(pCrsr->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + pCursor->Move(fnMoveForward); + SwTextNode* pTextNd15 = pCursor->GetNode().GetTextNode(); + SwTextAttr* const pFootnote15 = pTextNd15->GetTextAttrForCharAt(pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); const SwFormatFootnote& rFootnote15(pFootnote15->GetFootnote()); CPPUNIT_ASSERT_EQUAL(sal_uInt16(5), rFootnote15.GetNumber()); SwTextFootnote* pTFNote15 = static_cast<SwTextFootnote*> (pFootnote15); @@ -2107,7 +2107,7 @@ void SwUiWriterTest::testTdf74363() const sal_Unicode cChar = ' '; pWrtShell->AutoCorrect(corr, cChar); //The word should be capitalized due to autocorrect - sal_uLong nIndex = pWrtShell->GetCrsr()->GetNode().GetIndex(); + sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); CPPUNIT_ASSERT_EQUAL(OUString("Testing "), static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex])->GetText()); } @@ -2286,7 +2286,7 @@ void SwUiWriterTest::testTdf90808() uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<text::XTextRange> xTextRange(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<text::XText> xText(xTextRange->getText(), uno::UNO_QUERY); - uno::Reference<text::XParagraphCursor> xCrsr(xText->createTextCursor(), uno::UNO_QUERY); + uno::Reference<text::XParagraphCursor> xCursor(xText->createTextCursor(), uno::UNO_QUERY); //inserting text into document so that the paragraph is not empty xText->setString("Hello World!"); uno::Reference<lang::XMultiServiceFactory> xFact(mxComponent, uno::UNO_QUERY); @@ -2295,49 +2295,49 @@ void SwUiWriterTest::testTdf90808() uno::Reference<container::XNamed> xHeadingName1(xHeadingBookmark1, uno::UNO_QUERY); xHeadingName1->setName("__RefHeading__1"); //moving cursor to the starting of paragraph - xCrsr->gotoStartOfParagraph(false); + xCursor->gotoStartOfParagraph(false); //inserting the bookmark in paragraph - xText->insertTextContent(xCrsr, xHeadingBookmark1, true); + xText->insertTextContent(xCursor, xHeadingBookmark1, true); //creating bookmark 2 uno::Reference<text::XTextContent> xHeadingBookmark2(xFact->createInstance("com.sun.star.text.Bookmark"), uno::UNO_QUERY); uno::Reference<container::XNamed> xHeadingName2(xHeadingBookmark2, uno::UNO_QUERY); xHeadingName2->setName("__RefHeading__2"); //inserting the bookmark in same paragraph, at the end //only one bookmark of this type is allowed in each paragraph an exception of com.sun.star.lang.IllegalArgumentException must be thrown when inserting the other bookmark in same paragraph - xCrsr->gotoEndOfParagraph(true); - CPPUNIT_ASSERT_THROW(xText->insertTextContent(xCrsr, xHeadingBookmark2, true), css::lang::IllegalArgumentException); + xCursor->gotoEndOfParagraph(true); + CPPUNIT_ASSERT_THROW(xText->insertTextContent(xCursor, xHeadingBookmark2, true), css::lang::IllegalArgumentException); //now testing for __RefNumPara__ //creating bookmark 1 uno::Reference<text::XTextContent> xNumBookmark1(xFact->createInstance("com.sun.star.text.Bookmark"), uno::UNO_QUERY); uno::Reference<container::XNamed> xNumName1(xNumBookmark1, uno::UNO_QUERY); xNumName1->setName("__RefNumPara__1"); //moving cursor to the starting of paragraph - xCrsr->gotoStartOfParagraph(false); + xCursor->gotoStartOfParagraph(false); //inserting the bookmark in paragraph - xText->insertTextContent(xCrsr, xNumBookmark1, true); + xText->insertTextContent(xCursor, xNumBookmark1, true); //creating bookmark 2 uno::Reference<text::XTextContent> xNumBookmark2(xFact->createInstance("com.sun.star.text.Bookmark"), uno::UNO_QUERY); uno::Reference<container::XNamed> xNumName2(xNumBookmark2, uno::UNO_QUERY); xNumName2->setName("__RefNumPara__2"); //inserting the bookmark in same paragraph, at the end //only one bookmark of this type is allowed in each paragraph an exception of com.sun.star.lang.IllegalArgumentException must be thrown when inserting the other bookmark in same paragraph - xCrsr->gotoEndOfParagraph(true); - CPPUNIT_ASSERT_THROW(xText->insertTextContent(xCrsr, xNumBookmark2, true), css::lang::IllegalArgumentException); + xCursor->gotoEndOfParagraph(true); + CPPUNIT_ASSERT_THROW(xText->insertTextContent(xCursor, xNumBookmark2, true), css::lang::IllegalArgumentException); } void SwUiWriterTest::testTdf75137() { SwDoc* pDoc = createDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(true); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(true); pWrtShell->InsertFootnote("This is first footnote"); - sal_uLong firstIndex = pShellCrsr->GetNode().GetIndex(); - pShellCrsr->GotoFootnoteAnchor(); + sal_uLong firstIndex = pShellCursor->GetNode().GetIndex(); + pShellCursor->GotoFootnoteAnchor(); pWrtShell->InsertFootnote("This is second footnote"); pWrtShell->Up(false); - sal_uLong secondIndex = pShellCrsr->GetNode().GetIndex(); + sal_uLong secondIndex = pShellCursor->GetNode().GetIndex(); pWrtShell->Down(false); - sal_uLong thirdIndex = pShellCrsr->GetNode().GetIndex(); + sal_uLong thirdIndex = pShellCursor->GetNode().GetIndex(); CPPUNIT_ASSERT_EQUAL(firstIndex, thirdIndex); CPPUNIT_ASSERT(firstIndex != secondIndex); } @@ -2349,34 +2349,34 @@ void SwUiWriterTest::testTdf83798() pWrtShell->GotoNextTOXBase(); const SwTOXBase* pTOXBase = pWrtShell->GetCurTOX(); pWrtShell->UpdateTableOf(*pTOXBase); - SwPaM* pCrsr = pDoc->GetEditShell()->GetCrsr(); - pCrsr->SetMark(); - pCrsr->Move(fnMoveForward, fnGoNode); - CPPUNIT_ASSERT_EQUAL(OUString("Table of Contents"), pCrsr->GetText()); - pCrsr->DeleteMark(); - pCrsr->SetMark(); - pCrsr->Move(fnMoveForward, fnGoContent); - CPPUNIT_ASSERT_EQUAL(OUString("1"), pCrsr->GetText()); - pCrsr->DeleteMark(); - pCrsr->Move(fnMoveForward, fnGoNode); - pCrsr->SetMark(); - pCrsr->Move(fnMoveForward, fnGoContent); - pCrsr->Move(fnMoveForward, fnGoContent); - pCrsr->Move(fnMoveForward, fnGoContent); - CPPUNIT_ASSERT_EQUAL(OUString("1.A"), pCrsr->GetText()); - pCrsr->DeleteMark(); - pCrsr->Move(fnMoveForward, fnGoNode); - pCrsr->SetMark(); - pCrsr->Move(fnMoveForward, fnGoContent); - CPPUNIT_ASSERT_EQUAL(OUString("2"), pCrsr->GetText()); - pCrsr->DeleteMark(); - pCrsr->Move(fnMoveForward, fnGoNode); - pCrsr->SetMark(); - pCrsr->Move(fnMoveForward, fnGoContent); - pCrsr->Move(fnMoveForward, fnGoContent); - pCrsr->Move(fnMoveForward, fnGoContent); - CPPUNIT_ASSERT_EQUAL(OUString("2.A"), pCrsr->GetText()); - pCrsr->DeleteMark(); + SwPaM* pCursor = pDoc->GetEditShell()->GetCursor(); + pCursor->SetMark(); + pCursor->Move(fnMoveForward, fnGoNode); + CPPUNIT_ASSERT_EQUAL(OUString("Table of Contents"), pCursor->GetText()); + pCursor->DeleteMark(); + pCursor->SetMark(); + pCursor->Move(fnMoveForward, fnGoContent); + CPPUNIT_ASSERT_EQUAL(OUString("1"), pCursor->GetText()); + pCursor->DeleteMark(); + pCursor->Move(fnMoveForward, fnGoNode); + pCursor->SetMark(); + pCursor->Move(fnMoveForward, fnGoContent); + pCursor->Move(fnMoveForward, fnGoContent); + pCursor->Move(fnMoveForward, fnGoContent); + CPPUNIT_ASSERT_EQUAL(OUString("1.A"), pCursor->GetText()); + pCursor->DeleteMark(); + pCursor->Move(fnMoveForward, fnGoNode); + pCursor->SetMark(); + pCursor->Move(fnMoveForward, fnGoContent); + CPPUNIT_ASSERT_EQUAL(OUString("2"), pCursor->GetText()); + pCursor->DeleteMark(); + pCursor->Move(fnMoveForward, fnGoNode); + pCursor->SetMark(); + pCursor->Move(fnMoveForward, fnGoContent); + pCursor->Move(fnMoveForward, fnGoContent); + pCursor->Move(fnMoveForward, fnGoContent); + CPPUNIT_ASSERT_EQUAL(OUString("2.A"), pCursor->GetText()); + pCursor->DeleteMark(); } void SwUiWriterTest::testTdf89714() @@ -2527,25 +2527,25 @@ void SwUiWriterTest::testUndoCharAttribute() { // Create a new empty Writer document SwDoc* pDoc = createDoc(); - SwPaM* pCrsr = pDoc->GetEditShell()->GetCrsr(); + SwPaM* pCursor = pDoc->GetEditShell()->GetCursor(); sw::UndoManager& rUndoManager = pDoc->GetUndoManager(); IDocumentContentOperations & rIDCO(pDoc->getIDocumentContentOperations()); // Insert some text - rIDCO.InsertString(*pCrsr, "This will be bolded"); + rIDCO.InsertString(*pCursor, "This will be bolded"); // Position of word 9876543210 // Use cursor to select part of text - pCrsr->SetMark(); + pCursor->SetMark(); for (int i = 0; i < 9; i++) { - pCrsr->Move(fnMoveBackward); + pCursor->Move(fnMoveBackward); } // Check that correct text was selected - CPPUNIT_ASSERT_EQUAL(OUString("be bolded"), pCrsr->GetText()); + CPPUNIT_ASSERT_EQUAL(OUString("be bolded"), pCursor->GetText()); // Apply a "Bold" attribute to selection SvxWeightItem aWeightItem(WEIGHT_BOLD, RES_CHRATR_WEIGHT); - rIDCO.InsertPoolItem(*pCrsr, aWeightItem); + rIDCO.InsertPoolItem(*pCursor, aWeightItem); SfxItemSet aSet( pDoc->GetAttrPool(), RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT); // Adds selected text's attributes to aSet - pCrsr->GetNode().GetTextNode()->GetAttr(aSet, 10, 19); + pCursor->GetNode().GetTextNode()->GetAttr(aSet, 10, 19); SfxPoolItem const * pPoolItem = aSet.GetItem(RES_CHRATR_WEIGHT); // Check that bold is active on the selection; checks if it's in aSet CPPUNIT_ASSERT_EQUAL((*pPoolItem == aWeightItem), true); @@ -2553,7 +2553,7 @@ void SwUiWriterTest::testUndoCharAttribute() rUndoManager.Undo(); // Check that bold is no longer active aSet.ClearItem(RES_CHRATR_WEIGHT); - pCrsr->GetNode().GetTextNode()->GetAttr(aSet, 10, 19); + pCursor->GetNode().GetTextNode()->GetAttr(aSet, 10, 19); pPoolItem = aSet.GetItem(RES_CHRATR_WEIGHT); CPPUNIT_ASSERT_EQUAL((*pPoolItem == aWeightItem), false); } @@ -2639,7 +2639,7 @@ void SwUiWriterTest::testUnoCursorPointer() SwDoc* const pDoc(pxDocDocument->GetDocShell()->GetDoc()); std::unique_ptr<SwNodeIndex> pIdx(new SwNodeIndex(pDoc->GetNodes().GetEndOfContent(), -1)); std::unique_ptr<SwPosition> pPos(new SwPosition(*pIdx)); - sw::UnoCursorPointer pCursor(pDoc->CreateUnoCrsr(*pPos)); + sw::UnoCursorPointer pCursor(pDoc->CreateUnoCursor(*pPos)); CPPUNIT_ASSERT(static_cast<bool>(pCursor)); pPos.reset(); // we need to kill the SwPosition before disposing pIdx.reset(); // we need to kill the SwNodeIndex before disposing @@ -2733,16 +2733,16 @@ void SwUiWriterTest::testUnicodeNotationToggle() uno::Sequence<beans::PropertyValue> aPropertyValues; pWrtShell->EndPara(); - sOriginalDocString = pWrtShell->GetCrsr()->GetNode().GetTextNode()->GetText(); + sOriginalDocString = pWrtShell->GetCursor()->GetNode().GetTextNode()->GetText(); CPPUNIT_ASSERT_EQUAL(OUString("uU+002b"), sOriginalDocString); lcl_dispatchCommand(mxComponent, ".uno:UnicodeNotationToggle", aPropertyValues); sExpectedString = "u+"; - sDocString = pWrtShell->GetCrsr()->GetNode().GetTextNode()->GetText(); + sDocString = pWrtShell->GetCursor()->GetNode().GetTextNode()->GetText(); CPPUNIT_ASSERT( sDocString.equals(sExpectedString) ); lcl_dispatchCommand(mxComponent, ".uno:UnicodeNotationToggle", aPropertyValues); - sDocString = pWrtShell->GetCrsr()->GetNode().GetTextNode()->GetText(); + sDocString = pWrtShell->GetCursor()->GetNode().GetTextNode()->GetText(); CPPUNIT_ASSERT( sDocString.equals(sOriginalDocString) ); } @@ -2790,7 +2790,7 @@ void SwUiWriterTest::testTdf88986() // Create the item set that is normally passed to the insert frame dialog. SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - SwFlyFrmAttrMgr aMgr(true, pWrtShell, FRMMGR_TYPE_TEXT); + SwFlyFrameAttrMgr aMgr(true, pWrtShell, FRMMGR_TYPE_TEXT); SfxItemSet aSet = aShell.CreateInsertFrameItemSet(aMgr); // This was missing along with the gradient and other tables. @@ -2810,8 +2810,8 @@ void SwUiWriterTest::testTdf87922() sal_Int32 nLength = rText.getLength(); SwDrawTextInfo aDrawTextInfo(pWrtShell, *pWrtShell->GetOut(), pScriptInfo, rText, nIndex, nLength); // Root -> page -> body -> text. - SwTextFrm* pTextFrm = static_cast<SwTextFrm*>(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()); - aDrawTextInfo.SetFrm(pTextFrm); + SwTextFrame* pTextFrame = static_cast<SwTextFrame*>(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()); + aDrawTextInfo.SetFrame(pTextFrame); // If no color background color is found, assume white. Color* pColor = sw::GetActiveRetoucheColor(); @@ -2878,7 +2878,7 @@ void SwUiWriterTest::testTdf92648() // and the text boxes haven't got zero height for (std::set<const SwFrameFormat*>::iterator it=aTextBoxes.begin(); it!=aTextBoxes.end(); ++it) { - SwFormatFrmSize aSize((*it)->GetFrmSize()); + SwFormatFrameSize aSize((*it)->GetFrameSize()); CPPUNIT_ASSERT(aSize.GetHeight() != 0); } } |