diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-06-01 11:28:49 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-06-01 13:27:21 +0200 |
commit | 2de53e222fa9126422ff69dde3c585349958d494 (patch) | |
tree | 3774e3c0808454c85c671c5fbc28e0cefb2eb635 /sw | |
parent | af1147f4a6fd18a44dcd9209abe5d91bb74840c5 (diff) |
CppunitTest_sw_tiledrendering: use CPPUNIT_TEST_FIXTURE()
Which changes the order of the tests in the suite, so testRedlineColors
runs later and the global list of redline authors now contains
unexpected entries, leading to an assertion failure.
Fix this by clearing the redline author list at the start of each test.
Change-Id: Ifffe079eb83cd3184c962ea2e69505bd518a52bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135229
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/swmodule.hxx | 1 | ||||
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 370 | ||||
-rw-r--r-- | sw/source/uibase/app/swmodul1.cxx | 5 |
3 files changed, 102 insertions, 274 deletions
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index 06cafc912baf..e3bc91614c08 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -198,6 +198,7 @@ public: // Redlining. std::size_t GetRedlineAuthor(); OUString const & GetRedlineAuthor(std::size_t nPos); + void ClearRedlineAuthors(); /// See SwXTextDocument::getTrackedChangeAuthors(). void GetRedlineAuthorInfo(tools::JsonWriter& rJsonWriter); std::size_t InsertRedlineAuthor(const OUString& rAuthor); diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index a9205c07841a..42f7f9e21889 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -68,6 +68,8 @@ #include <rootfrm.hxx> #include <fmtanchr.hxx> #include <textcontentcontrol.hxx> +#include <swmodule.hxx> +#include <swdll.hxx> constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/extras/tiledrendering/data/"; @@ -84,189 +86,8 @@ public: SwTiledRenderingTest(); virtual void setUp() override; virtual void tearDown() override; - void testRegisterCallback(); - void testPostKeyEvent(); - void testPostMouseEvent(); - void testSetTextSelection(); - void testGetTextSelection(); - void testGetTextSelectionLineLimit(); - void testSetGraphicSelection(); - void testResetSelection(); - void testInsertShape(); - void testSearch(); - void testSearchViewArea(); - void testSearchTextFrame(); - void testSearchTextFrameWrapAround(); - void testDocumentSizeChanged(); - void testSearchAll(); - void testSearchAllNotifications(); - void testPageDownInvalidation(); - void testPartHash(); - void testViewCursors(); - void testShapeViewCursors(); - void testMissingInvalidation(); - void testViewCursorVisibility(); - void testViewCursorCleanup(); - void testViewLock(); - void testTextEditViewInvalidations(); - void testUndoInvalidations(); - void testUndoLimiting(); - void testUndoReordering(); - void testUndoReorderingRedo(); - void testUndoReorderingMulti(); - void testUndoShapeLimiting(); - void testUndoDispatch(); - void testUndoRepairDispatch(); - void testShapeTextUndoShells(); - void testShapeTextUndoGroupShells(); - void testTrackChanges(); - void testTrackChangesCallback(); - void testRedlineUpdateCallback(); - void testSetViewGraphicSelection(); - void testCreateViewGraphicSelection(); - void testCreateViewTextSelection(); - void testRedlineColors(); - void testCommentEndTextEdit(); - void testCommentInsert(); - void testCursorPosition(); - void testPaintCallbacks(); - void testUndoRepairResult(); - void testRedoRepairResult(); - void testDisableUndoRepair(); - void testAllTrackedChanges(); - void testDocumentRepair(); - void testPageHeader(); - void testPageFooter(); - void testTdf115088(); - void testRedlineField(); - void testIMESupport(); - void testIMEFormattingAtEndOfParagraph(); - void testIMEFormattingAfterHeader(); - void testSplitNodeRedlineCallback(); - void testDeleteNodeRedlineCallback(); - void testVisCursorInvalidation(); - void testDeselectCustomShape(); - void testSemiTransparent(); - void testHighlightNumbering(); - void testHighlightNumbering_shd(); - void testPilcrowRedlining(); - void testClipText(); - void testAnchorTypes(); - void testLanguageStatus(); - void testRedlineNotificationDuringSave(); - void testHyperlink(); - void testFieldmark(); - void testDropDownFormFieldButton(); - void testDropDownFormFieldButtonEditing(); - void testDropDownFormFieldButtonNoSelection(); - void testDropDownFormFieldButtonNoItem(); - void testTablePaintInvalidate(); - void testSpellOnlineRenderParameter(); - void testExtTextInputReadOnly(); - void testBulletDeleteInvalidation(); - void testBulletNoNumInvalidation(); - void testBulletMultiDeleteInvalidation(); - void testCondCollCopy(); - void testMoveShapeHandle(); - void testRedlinePortions(); - void testContentControl(); - void testDropDownContentControl(); - void testPictureContentControl(); - void testDateContentControl(); - - CPPUNIT_TEST_SUITE(SwTiledRenderingTest); - CPPUNIT_TEST(testRegisterCallback); - CPPUNIT_TEST(testPostKeyEvent); - CPPUNIT_TEST(testPostMouseEvent); - CPPUNIT_TEST(testSetTextSelection); - CPPUNIT_TEST(testGetTextSelection); - CPPUNIT_TEST(testGetTextSelectionLineLimit); - CPPUNIT_TEST(testSetGraphicSelection); - CPPUNIT_TEST(testResetSelection); - CPPUNIT_TEST(testInsertShape); - CPPUNIT_TEST(testSearch); - CPPUNIT_TEST(testSearchViewArea); - CPPUNIT_TEST(testSearchTextFrame); - CPPUNIT_TEST(testSearchTextFrameWrapAround); - CPPUNIT_TEST(testDocumentSizeChanged); - CPPUNIT_TEST(testSearchAll); - CPPUNIT_TEST(testSearchAllNotifications); - CPPUNIT_TEST(testPageDownInvalidation); - CPPUNIT_TEST(testPartHash); - CPPUNIT_TEST(testViewCursors); - CPPUNIT_TEST(testShapeViewCursors); - CPPUNIT_TEST(testMissingInvalidation); - CPPUNIT_TEST(testViewCursorVisibility); - CPPUNIT_TEST(testViewCursorCleanup); - CPPUNIT_TEST(testViewLock); - CPPUNIT_TEST(testTextEditViewInvalidations); - CPPUNIT_TEST(testUndoInvalidations); - CPPUNIT_TEST(testUndoLimiting); - CPPUNIT_TEST(testUndoReordering); - CPPUNIT_TEST(testUndoReorderingRedo); - CPPUNIT_TEST(testUndoReorderingMulti); - CPPUNIT_TEST(testUndoShapeLimiting); - CPPUNIT_TEST(testUndoDispatch); - CPPUNIT_TEST(testUndoRepairDispatch); - CPPUNIT_TEST(testShapeTextUndoShells); - CPPUNIT_TEST(testShapeTextUndoGroupShells); - CPPUNIT_TEST(testTrackChanges); - CPPUNIT_TEST(testTrackChangesCallback); - CPPUNIT_TEST(testRedlineUpdateCallback); - CPPUNIT_TEST(testSetViewGraphicSelection); - CPPUNIT_TEST(testCreateViewGraphicSelection); - CPPUNIT_TEST(testCreateViewTextSelection); - CPPUNIT_TEST(testRedlineColors); - CPPUNIT_TEST(testCommentEndTextEdit); - CPPUNIT_TEST(testCommentInsert); - CPPUNIT_TEST(testCursorPosition); - CPPUNIT_TEST(testPaintCallbacks); - CPPUNIT_TEST(testUndoRepairResult); - CPPUNIT_TEST(testRedoRepairResult); - CPPUNIT_TEST(testDisableUndoRepair); - CPPUNIT_TEST(testAllTrackedChanges); - CPPUNIT_TEST(testDocumentRepair); - CPPUNIT_TEST(testPageHeader); - CPPUNIT_TEST(testPageFooter); - CPPUNIT_TEST(testTdf115088); - CPPUNIT_TEST(testRedlineField); - CPPUNIT_TEST(testIMESupport); - CPPUNIT_TEST(testIMEFormattingAtEndOfParagraph); - CPPUNIT_TEST(testIMEFormattingAfterHeader); - CPPUNIT_TEST(testSplitNodeRedlineCallback); - CPPUNIT_TEST(testDeleteNodeRedlineCallback); - CPPUNIT_TEST(testVisCursorInvalidation); - CPPUNIT_TEST(testDeselectCustomShape); - CPPUNIT_TEST(testSemiTransparent); - CPPUNIT_TEST(testHighlightNumbering); - CPPUNIT_TEST(testHighlightNumbering_shd); - CPPUNIT_TEST(testPilcrowRedlining); - CPPUNIT_TEST(testClipText); - CPPUNIT_TEST(testAnchorTypes); - CPPUNIT_TEST(testLanguageStatus); - CPPUNIT_TEST(testRedlineNotificationDuringSave); - CPPUNIT_TEST(testHyperlink); - CPPUNIT_TEST(testFieldmark); - CPPUNIT_TEST(testDropDownFormFieldButton); - CPPUNIT_TEST(testDropDownFormFieldButtonEditing); - CPPUNIT_TEST(testDropDownFormFieldButtonNoSelection); - CPPUNIT_TEST(testDropDownFormFieldButtonNoItem); - CPPUNIT_TEST(testTablePaintInvalidate); - CPPUNIT_TEST(testSpellOnlineRenderParameter); - CPPUNIT_TEST(testExtTextInputReadOnly); - CPPUNIT_TEST(testBulletDeleteInvalidation); - CPPUNIT_TEST(testBulletNoNumInvalidation); - CPPUNIT_TEST(testBulletMultiDeleteInvalidation); - CPPUNIT_TEST(testCondCollCopy); - CPPUNIT_TEST(testMoveShapeHandle); - CPPUNIT_TEST(testRedlinePortions); - CPPUNIT_TEST(testContentControl); - CPPUNIT_TEST(testDropDownContentControl); - CPPUNIT_TEST(testPictureContentControl); - CPPUNIT_TEST(testDateContentControl); - CPPUNIT_TEST_SUITE_END(); - -private: + +protected: SwXTextDocument* createDoc(const char* pName = nullptr); void setupLibreOfficeKitViewCallback(SfxViewShell* pViewShell); static void callback(int nType, const char* pPayload, void* pData); @@ -310,6 +131,9 @@ void SwTiledRenderingTest::setUp() { SwModelTestBase::setUp(); + SwGlobals::ensure(); + SW_MOD()->ClearRedlineAuthors(); + comphelper::LibreOfficeKit::setActive(true); } @@ -473,7 +297,7 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload) } -void SwTiledRenderingTest::testRegisterCallback() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testRegisterCallback) { SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -488,7 +312,7 @@ void SwTiledRenderingTest::testRegisterCallback() CPPUNIT_ASSERT(m_aInvalidation.Overlaps(aTopLeft)); } -void SwTiledRenderingTest::testPostKeyEvent() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPostKeyEvent) { SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -504,7 +328,7 @@ void SwTiledRenderingTest::testPostKeyEvent() CPPUNIT_ASSERT_EQUAL(OUString("Axaa bbb."), pShellCursor->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); } -void SwTiledRenderingTest::testPostMouseEvent() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPostMouseEvent) { SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -522,7 +346,7 @@ void SwTiledRenderingTest::testPostMouseEvent() CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), pShellCursor->GetPoint()->nContent.GetIndex()); } -void SwTiledRenderingTest::testSetTextSelection() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSetTextSelection) { SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -547,7 +371,7 @@ void SwTiledRenderingTest::testSetTextSelection() CPPUNIT_ASSERT_EQUAL(OUString("Aaa b"), pShellCursor->GetText()); } -void SwTiledRenderingTest::testGetTextSelection() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetTextSelection) { SwXTextDocument* pXTextDocument = createDoc("shape-with-text.fodt"); // No crash, just empty output for unexpected mime type. @@ -577,7 +401,7 @@ void SwTiledRenderingTest::testGetTextSelection() CPPUNIT_ASSERT_EQUAL(OString("Shape"), apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/plain;charset=utf-8")); } -void SwTiledRenderingTest::testGetTextSelectionLineLimit() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetTextSelectionLineLimit) { static OStringLiteral sOriginalText(u8"Estonian employs the Latin script as the basis for its alphabet, which adds the letters ä, ö, ü, and õ, plus the later additions š and ž. The letters c, q, w, x and y are limited to proper names of foreign origin, and f, z, š, and ž appear in loanwords and foreign names only. Ö and Ü are pronounced similarly to their equivalents in Swedish and German. Unlike in standard German but like Swedish (when followed by 'r') and Finnish, Ä is pronounced [æ], as in English mat. The vowels Ä, Ö and Ü are clearly separate phonemes and inherent in Estonian, although the letter shapes come from German. The letter õ denotes /ɤ/, unrounded /o/, or a close-mid back unrounded vowel. It is almost identical to the Bulgarian ъ /ɤ̞/ and the Vietnamese ơ, and is also used to transcribe the Russian ы."); static OStringLiteral sExpectedHtml(u8"Estonian employs the <a href=\"https://en.wikipedia.org/wiki/Latin_script\">Latin script</a> as the basis for <a href=\"https://en.wikipedia.org/wiki/Estonian_alphabet\">its alphabet</a>, which adds the letters <a href=\"https://en.wikipedia.org/wiki/%C3%84\"><i>ä</i></a>, <a href=\"https://en.wikipedia.org/wiki/%C3%96\"><i>ö</i></a>, <a href=\"https://en.wikipedia.org/wiki/%C3%9C\"><i>ü</i></a>, and <a href=\"https://en.wikipedia.org/wiki/%C3%95\"><i>õ</i></a>, plus the later additions <a href=\"https://en.wikipedia.org/wiki/%C5%A0\"><i>š</i></a> and <a href=\"https://en.wikipedia.org/wiki/%C5%BD\"><i>ž</i></a>. The letters <i>c</i>, <i>q</i>, <i>w</i>, <i>x</i> and <i>y</i> are limited to <a href=\"https://en.wikipedia.org/wiki/Proper_names\">proper names</a> of foreign origin, and <i>f</i>, <i>z</i>, <i>š</i>, and <i>ž</i> appear in loanwords and foreign names only. <i>Ö</i> and <i>Ü</i> are pronounced similarly to their equivalents in Swedish and German. Unlike in standard German but like Swedish (when followed by 'r') and Finnish, <i>Ä</i> is pronounced [æ], as in English <i>mat</i>. The vowels Ä, Ö and Ü are clearly separate <a href=\"https://en.wikipedia.org/wiki/Phonemes\">phonemes</a> and inherent in Estonian, although the letter shapes come from German. The letter <a href=\"https://en.wikipedia.org/wiki/%C3%95\"><i>õ</i></a> denotes /ɤ/, unrounded /o/, or a <a href=\"https://en.wikipedia.org/wiki/Close-mid_back_unrounded_vowel\">close-mid back unrounded vowel</a>. It is almost identical to the <a href=\"https://en.wikipedia.org/wiki/Bulgarian_language\">Bulgarian</a> <a href=\"https://en.wikipedia.org/wiki/%D0%AA\">ъ</a> /ɤ̞/ and the <a href=\"https://en.wikipedia.org/wiki/Vietnamese_language\">Vietnamese</a> <a href=\"https://en.wikipedia.org/wiki/%C6%A0\">ơ</a>, and is also used to transcribe the Russian <a href=\"https://en.wikipedia.org/wiki/%D0%AB\">ы</a>."); @@ -601,7 +425,7 @@ void SwTiledRenderingTest::testGetTextSelectionLineLimit() CPPUNIT_ASSERT(sHtmlText.match(sExpectedHtml, nStart)); } -void SwTiledRenderingTest::testSetGraphicSelection() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSetGraphicSelection) { SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -625,7 +449,7 @@ void SwTiledRenderingTest::testSetGraphicSelection() CPPUNIT_ASSERT_EQUAL(aShapeBefore.getHeight() + 1000, aShapeAfter.getHeight()); } -void SwTiledRenderingTest::testResetSelection() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testResetSelection) { SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -652,7 +476,7 @@ void SwTiledRenderingTest::testResetSelection() CPPUNIT_ASSERT(!pWrtShell->IsSelFrameMode()); } -void SwTiledRenderingTest::testInsertShape() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testInsertShape) { SwXTextDocument* pXTextDocument = createDoc("2-pages.odt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -681,7 +505,7 @@ static void lcl_search(bool bBackward) comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues); } -void SwTiledRenderingTest::testSearch() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSearch) { SwXTextDocument* pXTextDocument = createDoc("search.odt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -721,7 +545,7 @@ void SwTiledRenderingTest::testSearch() CPPUNIT_ASSERT_EQUAL(nNode + 1, nActual); } -void SwTiledRenderingTest::testSearchViewArea() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSearchViewArea) { SwXTextDocument* pXTextDocument = createDoc("search.odt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -746,7 +570,7 @@ void SwTiledRenderingTest::testSearchViewArea() CPPUNIT_ASSERT_EQUAL(OUString("Heading on second page"), pShellCursor->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); } -void SwTiledRenderingTest::testSearchTextFrame() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSearchTextFrame) { SwXTextDocument* pXTextDocument = createDoc("search.odt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -761,7 +585,7 @@ void SwTiledRenderingTest::testSearchTextFrame() CPPUNIT_ASSERT(!m_aTextSelection.isEmpty()); } -void SwTiledRenderingTest::testSearchTextFrameWrapAround() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSearchTextFrameWrapAround) { SwXTextDocument* pXTextDocument = createDoc("search.odt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -778,7 +602,7 @@ void SwTiledRenderingTest::testSearchTextFrameWrapAround() CPPUNIT_ASSERT(m_bFound); } -void SwTiledRenderingTest::testDocumentSizeChanged() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDocumentSizeChanged) { // Get the current document size. SwXTextDocument* pXTextDocument = createDoc("2-pages.odt"); @@ -795,7 +619,7 @@ void SwTiledRenderingTest::testDocumentSizeChanged() CPPUNIT_ASSERT(aSize.getHeight() > m_aDocumentSize.getHeight()); } -void SwTiledRenderingTest::testSearchAll() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSearchAll) { SwXTextDocument* pXTextDocument = createDoc("search.odt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -813,7 +637,7 @@ void SwTiledRenderingTest::testSearchAll() CPPUNIT_ASSERT_EQUAL(0, m_aSearchResultPart[0]); } -void SwTiledRenderingTest::testSearchAllNotifications() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSearchAllNotifications) { SwXTextDocument* pXTextDocument = createDoc("search.odt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -835,7 +659,7 @@ void SwTiledRenderingTest::testSearchAllNotifications() CPPUNIT_ASSERT(m_nSelectionAfterSearchResult > 0); } -void SwTiledRenderingTest::testPageDownInvalidation() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPageDownInvalidation) { SwXTextDocument* pXTextDocument = createDoc("pagedown-invalidation.odt"); uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence( @@ -851,7 +675,7 @@ void SwTiledRenderingTest::testPageDownInvalidation() CPPUNIT_ASSERT_EQUAL(0, m_nInvalidations); } -void SwTiledRenderingTest::testPartHash() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPartHash) { SwXTextDocument* pXTextDocument = createDoc("pagedown-invalidation.odt"); int nParts = pXTextDocument->getParts(); @@ -1077,7 +901,7 @@ namespace { } -void SwTiledRenderingTest::testMissingInvalidation() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testMissingInvalidation) { // Create two views. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -1110,7 +934,7 @@ void SwTiledRenderingTest::testMissingInvalidation() CPPUNIT_ASSERT(aView2.m_bTilesInvalidated); } -void SwTiledRenderingTest::testViewCursors() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testViewCursors) { SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); ViewCallback aView1; @@ -1148,7 +972,7 @@ void SwTiledRenderingTest::testViewCursors() CPPUNIT_ASSERT(!aView2.m_bViewSelectionSet); } -void SwTiledRenderingTest::testShapeViewCursors() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testShapeViewCursors) { // Load a document and create a view, so we have 2 ones. SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); @@ -1187,7 +1011,7 @@ void SwTiledRenderingTest::testShapeViewCursors() CPPUNIT_ASSERT_EQUAL(aLastViewCursor2, aView2.m_aViewCursor); } -void SwTiledRenderingTest::testViewCursorVisibility() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testViewCursorVisibility) { // Load a document that has a shape and create two views. SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); @@ -1211,7 +1035,7 @@ void SwTiledRenderingTest::testViewCursorVisibility() CPPUNIT_ASSERT(!aView1.m_bViewCursorVisible); } -void SwTiledRenderingTest::testViewCursorCleanup() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testViewCursorCleanup) { // Load a document that has a shape and create two views. SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); @@ -1241,7 +1065,7 @@ void SwTiledRenderingTest::testViewCursorCleanup() CPPUNIT_ASSERT(!aView1.m_bGraphicViewSelection); } -void SwTiledRenderingTest::testViewLock() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testViewLock) { // Load a document that has a shape and create two views. SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); @@ -1266,7 +1090,7 @@ void SwTiledRenderingTest::testViewLock() CPPUNIT_ASSERT(!aView1.m_bViewLock); } -void SwTiledRenderingTest::testTextEditViewInvalidations() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testTextEditViewInvalidations) { // Load a document that has a shape and create two views. SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); @@ -1296,7 +1120,7 @@ void SwTiledRenderingTest::testTextEditViewInvalidations() pWrtShell->EndTextEdit(); } -void SwTiledRenderingTest::testUndoInvalidations() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testUndoInvalidations) { // Load a document and create two views. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -1329,7 +1153,7 @@ void SwTiledRenderingTest::testUndoInvalidations() CPPUNIT_ASSERT(aView2.m_bTilesInvalidated); } -void SwTiledRenderingTest::testUndoLimiting() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testUndoLimiting) { // Load a document and create two views. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -1357,7 +1181,7 @@ void SwTiledRenderingTest::testUndoLimiting() SfxViewShell::Current()->setLibreOfficeKitViewCallback(nullptr); } -void SwTiledRenderingTest::testUndoReordering() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testUndoReordering) { // Create two views and a document of 2 paragraphs. SwXTextDocument* pXTextDocument = createDoc(); @@ -1402,7 +1226,7 @@ void SwTiledRenderingTest::testUndoReordering() SfxViewShell::Current()->setLibreOfficeKitViewCallback(nullptr); } -void SwTiledRenderingTest::testUndoReorderingRedo() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testUndoReorderingRedo) { // Create two views and a document of 2 paragraphs. SwXTextDocument* pXTextDocument = createDoc(); @@ -1456,7 +1280,7 @@ void SwTiledRenderingTest::testUndoReorderingRedo() SfxViewShell::Current()->setLibreOfficeKitViewCallback(nullptr); } -void SwTiledRenderingTest::testUndoReorderingMulti() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testUndoReorderingMulti) { // Create two views and a document of 2 paragraphs. SwXTextDocument* pXTextDocument = createDoc(); @@ -1506,7 +1330,7 @@ void SwTiledRenderingTest::testUndoReorderingMulti() SfxViewShell::Current()->setLibreOfficeKitViewCallback(nullptr); } -void SwTiledRenderingTest::testUndoShapeLimiting() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testUndoShapeLimiting) { // Load a document and create a view. SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); @@ -1543,7 +1367,7 @@ void SwTiledRenderingTest::testUndoShapeLimiting() SfxViewShell::Current()->setLibreOfficeKitViewCallback(nullptr); } -void SwTiledRenderingTest::testUndoDispatch() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testUndoDispatch) { // Load a document and create two views. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -1582,7 +1406,7 @@ void SwTiledRenderingTest::testUndoDispatch() SfxViewShell::Current()->setLibreOfficeKitViewCallback(nullptr); } -void SwTiledRenderingTest::testUndoRepairDispatch() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testUndoRepairDispatch) { // Load a document and create two views. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -1624,7 +1448,7 @@ void SwTiledRenderingTest::testUndoRepairDispatch() SfxViewShell::Current()->setLibreOfficeKitViewCallback(nullptr); } -void SwTiledRenderingTest::testShapeTextUndoShells() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testShapeTextUndoShells) { // Load a document and create a view. SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); @@ -1651,7 +1475,7 @@ void SwTiledRenderingTest::testShapeTextUndoShells() CPPUNIT_ASSERT_EQUAL(ViewShellId(nView1), rUndoManager.GetUndoAction()->GetViewShellId()); } -void SwTiledRenderingTest::testShapeTextUndoGroupShells() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testShapeTextUndoGroupShells) { // Load a document and create a view. SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); @@ -1709,7 +1533,7 @@ void SwTiledRenderingTest::testShapeTextUndoGroupShells() CPPUNIT_ASSERT(aView2.m_bViewLock); } -void SwTiledRenderingTest::testTrackChanges() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testTrackChanges) { // Load a document. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -1742,7 +1566,7 @@ void SwTiledRenderingTest::testTrackChanges() CPPUNIT_ASSERT_EQUAL(OUString("Aaa bbb."), pShellCursor->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); } -void SwTiledRenderingTest::testTrackChangesCallback() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testTrackChangesCallback) { // Load a document. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -1769,7 +1593,7 @@ void SwTiledRenderingTest::testTrackChangesCallback() CPPUNIT_ASSERT_EQUAL(0, m_nTrackedChangeIndex); } -void SwTiledRenderingTest::testRedlineUpdateCallback() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testRedlineUpdateCallback) { // Load a document. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -1808,7 +1632,7 @@ void SwTiledRenderingTest::testRedlineUpdateCallback() CPPUNIT_ASSERT_EQUAL(3, m_nRedlineTableEntryModified); } -void SwTiledRenderingTest::testSetViewGraphicSelection() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSetViewGraphicSelection) { // Load a document. SwXTextDocument* pXTextDocument = createDoc("frame.odt"); @@ -1833,7 +1657,7 @@ void SwTiledRenderingTest::testSetViewGraphicSelection() CPPUNIT_ASSERT(!pView->areMarkHandlesHidden()); } -void SwTiledRenderingTest::testCreateViewGraphicSelection() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testCreateViewGraphicSelection) { // Load a document. SwXTextDocument* pXTextDocument = createDoc("frame.odt"); @@ -1866,7 +1690,7 @@ void SwTiledRenderingTest::testCreateViewGraphicSelection() CPPUNIT_ASSERT(aView2.m_bGraphicViewSelection); } -void SwTiledRenderingTest::testCreateViewTextSelection() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testCreateViewTextSelection) { // Load a document. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -1891,7 +1715,7 @@ void SwTiledRenderingTest::testCreateViewTextSelection() CPPUNIT_ASSERT(!aView2.m_aViewSelection.isEmpty()); } -void SwTiledRenderingTest::testRedlineColors() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testRedlineColors) { // Load a document. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -1912,7 +1736,7 @@ void SwTiledRenderingTest::testRedlineColors() CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aTree.get_child("authors").size()); } -void SwTiledRenderingTest::testCommentEndTextEdit() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testCommentEndTextEdit) { // Create a document, type a character and remember the cursor position. SwXTextDocument* pXTextDocument = createDoc(); @@ -1949,7 +1773,7 @@ void SwTiledRenderingTest::testCommentEndTextEdit() CPPUNIT_ASSERT(aView1.m_bTilesInvalidated); } -void SwTiledRenderingTest::testCommentInsert() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testCommentInsert) { // Load a document with an as-char image in it. comphelper::LibreOfficeKit::setTiledAnnotations(false); @@ -1982,7 +1806,7 @@ void SwTiledRenderingTest::testCommentInsert() comphelper::LibreOfficeKit::setTiledAnnotations(true); } -void SwTiledRenderingTest::testCursorPosition() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testCursorPosition) { // Load a document and register a callback, should get an own cursor. SwXTextDocument* pXTextDocument = createDoc(); @@ -1999,7 +1823,7 @@ void SwTiledRenderingTest::testCursorPosition() CPPUNIT_ASSERT_EQUAL(aView1.m_aOwnCursor.toString(), aView1.m_aViewCursor.toString()); } -void SwTiledRenderingTest::testPaintCallbacks() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPaintCallbacks) { // Test that paintTile() never results in callbacks, which can cause a // paint <-> invalidate loop. @@ -2022,7 +1846,7 @@ void SwTiledRenderingTest::testPaintCallbacks() CPPUNIT_ASSERT(!aView1.m_bCalled); } -void SwTiledRenderingTest::testUndoRepairResult() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testUndoRepairResult) { // Load a document and create two views. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -2056,7 +1880,7 @@ void SwTiledRenderingTest::testUndoRepairResult() SfxViewShell::Current()->setLibreOfficeKitViewCallback(nullptr); } -void SwTiledRenderingTest::testRedoRepairResult() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testRedoRepairResult) { // Load a document and create two views. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -2114,7 +1938,7 @@ namespace { } -void SwTiledRenderingTest::testDisableUndoRepair() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDisableUndoRepair) { // Create two views. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -2173,7 +1997,7 @@ void SwTiledRenderingTest::testDisableUndoRepair() checkUndoRepairStates(pXTextDocument, pView1, pView2); } -void SwTiledRenderingTest::testAllTrackedChanges() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testAllTrackedChanges) { // Load a document. createDoc("dummy.fodt"); @@ -2247,7 +2071,7 @@ void SwTiledRenderingTest::testAllTrackedChanges() SfxViewShell::Current()->setLibreOfficeKitViewCallback(nullptr); } -void SwTiledRenderingTest::testDocumentRepair() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDocumentRepair) { // Create two views. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -2313,7 +2137,7 @@ namespace { } -void SwTiledRenderingTest::testPageHeader() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPageHeader) { createDoc("dummy.fodt"); SfxViewShell* pViewShell = SfxViewShell::Current(); @@ -2338,7 +2162,7 @@ void SwTiledRenderingTest::testPageHeader() checkPageHeaderOrFooter(pViewShell, FN_INSERT_PAGEHEADER, false); } -void SwTiledRenderingTest::testPageFooter() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPageFooter) { createDoc("dummy.fodt"); SfxViewShell* pViewShell = SfxViewShell::Current(); @@ -2363,7 +2187,7 @@ void SwTiledRenderingTest::testPageFooter() checkPageHeaderOrFooter(pViewShell, FN_INSERT_PAGEFOOTER, false); } -void SwTiledRenderingTest::testTdf115088() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testTdf115088) { // We have three lines in the test document and we try to copy the second and third line // To the beginning of the document @@ -2396,7 +2220,7 @@ void SwTiledRenderingTest::testTdf115088() comphelper::LibreOfficeKit::setActive(false); } -void SwTiledRenderingTest::testRedlineField() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testRedlineField) { // Load a document. SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -2417,7 +2241,7 @@ void SwTiledRenderingTest::testRedlineField() CPPUNIT_ASSERT(pRedline->GetDescr().indexOf(aDate.GetFieldName())!= -1); } -void SwTiledRenderingTest::testIMESupport() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testIMESupport) { SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); VclPtr<vcl::Window> pDocWindow = pXTextDocument->getDocWindow(); @@ -2447,7 +2271,7 @@ void SwTiledRenderingTest::testIMESupport() CPPUNIT_ASSERT_EQUAL(OUString(aInputs[aInputs.size() - 1] + "Aaa bbb."), pShellCursor->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); } -void SwTiledRenderingTest::testIMEFormattingAtEndOfParagraph() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testIMEFormattingAtEndOfParagraph) { comphelper::LibreOfficeKit::setActive(); SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -2552,7 +2376,7 @@ void SwTiledRenderingTest::testIMEFormattingAtEndOfParagraph() CPPUNIT_ASSERT_EQUAL(OUString("bab"), pShellCursor->GetPoint()->nNode.GetNode().GetTextNode()->GetText()); } -void SwTiledRenderingTest::testIMEFormattingAfterHeader() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testIMEFormattingAfterHeader) { comphelper::LibreOfficeKit::setActive(); SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); @@ -2620,7 +2444,7 @@ void SwTiledRenderingTest::testIMEFormattingAfterHeader() CPPUNIT_ASSERT_EQUAL(FontWeight::WEIGHT_NORMAL, pWeightItem2->GetWeight()); } -void SwTiledRenderingTest::testSplitNodeRedlineCallback() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSplitNodeRedlineCallback) { // Load a document. SwXTextDocument* pXTextDocument = createDoc("splitnode_redline_callback.fodt"); @@ -2678,7 +2502,7 @@ void SwTiledRenderingTest::testSplitNodeRedlineCallback() CPPUNIT_ASSERT_EQUAL(0, m_nRedlineTableEntryModified); } -void SwTiledRenderingTest::testDeleteNodeRedlineCallback() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDeleteNodeRedlineCallback) { // Load a document. SwXTextDocument* pXTextDocument = createDoc("removenode_redline_callback.fodt"); @@ -2737,7 +2561,7 @@ void SwTiledRenderingTest::testDeleteNodeRedlineCallback() } -void SwTiledRenderingTest::testVisCursorInvalidation() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testVisCursorInvalidation) { SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); ViewCallback aView1; @@ -2820,7 +2644,7 @@ void SwTiledRenderingTest::testVisCursorInvalidation() comphelper::LibreOfficeKit::setViewIdForVisCursorInvalidation(false); } -void SwTiledRenderingTest::testDeselectCustomShape() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDeselectCustomShape) { SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -2839,7 +2663,7 @@ void SwTiledRenderingTest::testDeselectCustomShape() CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pWrtShell->GetDrawView()->GetMarkedObjectList().GetMarkCount()); } -void SwTiledRenderingTest::testSemiTransparent() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSemiTransparent) { // Load a document where the top left tile contains a semi-transparent rectangle shape. SwXTextDocument* pXTextDocument = createDoc("semi-transparent.odt"); @@ -2868,7 +2692,7 @@ void SwTiledRenderingTest::testSemiTransparent() CPPUNIT_ASSERT_GREATEREQUAL(190, static_cast<int>(aColor.GetBlue())); } -void SwTiledRenderingTest::testHighlightNumbering() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testHighlightNumbering) { // Load a document where the top left tile contains a semi-transparent rectangle shape. SwXTextDocument* pXTextDocument = createDoc("tdf114799_highlight.docx"); @@ -2893,7 +2717,7 @@ void SwTiledRenderingTest::testHighlightNumbering() CPPUNIT_ASSERT_EQUAL(COL_YELLOW, aColor); } -void SwTiledRenderingTest::testHighlightNumbering_shd() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testHighlightNumbering_shd) { // Load a document where the top left tile contains a semi-transparent rectangle shape. SwXTextDocument* pXTextDocument = createDoc("tdf114799_shd.docx"); @@ -2918,7 +2742,7 @@ void SwTiledRenderingTest::testHighlightNumbering_shd() CPPUNIT_ASSERT_EQUAL(COL_WHITE, aColor); } -void SwTiledRenderingTest::testPilcrowRedlining() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPilcrowRedlining) { // Load a document where the top left tile contains // paragraph and line break symbols with redlining. @@ -2985,7 +2809,7 @@ void SwTiledRenderingTest::testPilcrowRedlining() comphelper::dispatchCommand(".uno:ControlCodes", {}); } -void SwTiledRenderingTest::testClipText() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testClipText) { // Load a document where the top left tile contains table text with // too small line height, but with top and bottom paragraph margins, @@ -3036,7 +2860,7 @@ void SwTiledRenderingTest::testClipText() #endif } -void SwTiledRenderingTest::testAnchorTypes() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testAnchorTypes) { SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); SwDoc* pDoc = pXTextDocument->GetDocShell()->GetDoc(); @@ -3052,7 +2876,7 @@ void SwTiledRenderingTest::testAnchorTypes() CPPUNIT_ASSERT(!aSet.HasItem(FN_TOOL_ANCHOR_PAGE)); } -void SwTiledRenderingTest::testLanguageStatus() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testLanguageStatus) { SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwView* pView = pXTextDocument->GetDocShell()->GetView(); @@ -3066,7 +2890,7 @@ void SwTiledRenderingTest::testLanguageStatus() CPPUNIT_ASSERT_EQUAL(OUString("English (USA);en-US"), aList[0]); } -void SwTiledRenderingTest::testRedlineNotificationDuringSave() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testRedlineNotificationDuringSave) { // Load a document with redlines which are hidden at a layout level. // It's an empty document, just settings.xml and content.xml are custom. @@ -3083,7 +2907,7 @@ void SwTiledRenderingTest::testRedlineNotificationDuringSave() xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); } -void SwTiledRenderingTest::testHyperlink() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testHyperlink) { comphelper::LibreOfficeKit::setViewIdForVisCursorInvalidation(true); SwXTextDocument* pXTextDocument = createDoc("hyperlink.odt"); @@ -3104,13 +2928,13 @@ void SwTiledRenderingTest::testHyperlink() CPPUNIT_ASSERT_EQUAL(OString("http://example.com/"), m_sHyperlinkLink); } -void SwTiledRenderingTest::testFieldmark() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testFieldmark) { // Without the accompanying fix in place, this crashed on load. createDoc("fieldmark.docx"); } -void SwTiledRenderingTest::testDropDownFormFieldButton() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButton) { SwXTextDocument* pXTextDocument = createDoc("drop_down_form_field.odt"); pXTextDocument->setClientVisibleArea(tools::Rectangle(0, 0, 10000, 4000)); @@ -3183,7 +3007,7 @@ void SwTiledRenderingTest::testDropDownFormFieldButton() } } -void SwTiledRenderingTest::testDropDownFormFieldButtonEditing() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonEditing) { SwXTextDocument* pXTextDocument = createDoc("drop_down_form_field2.odt"); pXTextDocument->setClientVisibleArea(tools::Rectangle(0, 0, 10000, 4000)); @@ -3240,7 +3064,7 @@ void SwTiledRenderingTest::testDropDownFormFieldButtonEditing() } } -void SwTiledRenderingTest::testDropDownFormFieldButtonNoSelection() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonNoSelection) { SwXTextDocument* pXTextDocument = createDoc("drop_down_form_field_noselection.odt"); pXTextDocument->setClientVisibleArea(tools::Rectangle(0, 0, 10000, 4000)); @@ -3293,7 +3117,7 @@ static void lcl_extractHandleParameters(std::string_view selection, sal_Int32& i y = handle0.get_child("point").get_child("y").get_value<int>(); } -void SwTiledRenderingTest::testMoveShapeHandle() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testMoveShapeHandle) { comphelper::LibreOfficeKit::setActive(); SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); @@ -3326,7 +3150,7 @@ void SwTiledRenderingTest::testMoveShapeHandle() } } -void SwTiledRenderingTest::testDropDownFormFieldButtonNoItem() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonNoItem) { SwXTextDocument* pXTextDocument = createDoc("drop_down_form_field_noitem.odt"); pXTextDocument->setClientVisibleArea(tools::Rectangle(0, 0, 10000, 4000)); @@ -3364,7 +3188,7 @@ void SwTiledRenderingTest::testDropDownFormFieldButtonNoItem() } } -void SwTiledRenderingTest::testTablePaintInvalidate() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testTablePaintInvalidate) { // Load a document with a table in it. SwXTextDocument* pXTextDocument = createDoc("table-paint-invalidate.odt"); @@ -3395,7 +3219,7 @@ void SwTiledRenderingTest::testTablePaintInvalidate() CPPUNIT_ASSERT_EQUAL(0, m_nInvalidations); } -void SwTiledRenderingTest::testSpellOnlineRenderParameter() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSpellOnlineRenderParameter) { SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -3410,7 +3234,7 @@ void SwTiledRenderingTest::testSpellOnlineRenderParameter() CPPUNIT_ASSERT_EQUAL(!bSet, pOpt->IsOnlineSpell()); } -void SwTiledRenderingTest::testExtTextInputReadOnly() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testExtTextInputReadOnly) { // Create a document with a protected section + a normal paragraph after it. SwXTextDocument* pXTextDocument = createDoc(); @@ -3450,7 +3274,7 @@ void SwTiledRenderingTest::testExtTextInputReadOnly() CPPUNIT_ASSERT_EQUAL(OUString("x"), getParagraph(2)->getString()); } -void SwTiledRenderingTest::testBulletDeleteInvalidation() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testBulletDeleteInvalidation) { // Given a document with 3 paragraphs: first 2 is bulleted, the last is not. SwXTextDocument* pXTextDocument = createDoc(); @@ -3482,7 +3306,7 @@ void SwTiledRenderingTest::testBulletDeleteInvalidation() CPPUNIT_ASSERT(!aFirstTextRect.Overlaps(m_aInvalidations)); } -void SwTiledRenderingTest::testBulletNoNumInvalidation() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testBulletNoNumInvalidation) { // Given a document with 3 paragraphs: all are bulleted. SwXTextDocument* pXTextDocument = createDoc(); @@ -3514,7 +3338,7 @@ void SwTiledRenderingTest::testBulletNoNumInvalidation() CPPUNIT_ASSERT(!aFirstTextRect.Overlaps(m_aInvalidations)); } -void SwTiledRenderingTest::testBulletMultiDeleteInvalidation() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testBulletMultiDeleteInvalidation) { // Given a document with 5 paragraphs: all are bulleted. SwXTextDocument* pXTextDocument = createDoc(); @@ -3550,7 +3374,7 @@ void SwTiledRenderingTest::testBulletMultiDeleteInvalidation() CPPUNIT_ASSERT(!aFirstTextRect.Overlaps(m_aInvalidations)); } -void SwTiledRenderingTest::testCondCollCopy() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testCondCollCopy) { // Given a document with a custom Text Body cond style: SwXTextDocument* pXTextDocument = createDoc("cond-coll-copy.odt"); @@ -3572,7 +3396,7 @@ void SwTiledRenderingTest::testCondCollCopy() xTransferable->getTransferData(aFlavor); } -void SwTiledRenderingTest::testRedlinePortions() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testRedlinePortions) { // Given a document with 3 portions: before insert redline (foo), the insert redline (ins) and after insert // redline (bar): @@ -3609,7 +3433,7 @@ void SwTiledRenderingTest::testRedlinePortions() assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[4]", "portion", " after"); } -void SwTiledRenderingTest::testContentControl() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testContentControl) { // Given a document with a content control: SwXTextDocument* pXTextDocument = createDoc("content-control.odt"); @@ -3645,7 +3469,7 @@ void SwTiledRenderingTest::testContentControl() CPPUNIT_ASSERT_EQUAL(OString("hide"), sAction); } -void SwTiledRenderingTest::testDropDownContentControl() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownContentControl) { // Given a document with a dropdown content control: SwXTextDocument* pXTextDocument = createDoc(); @@ -3720,7 +3544,7 @@ void SwTiledRenderingTest::testDropDownContentControl() CPPUNIT_ASSERT_EQUAL(OUString("green"), pTextNode->GetExpandText(pWrtShell->GetLayout())); } -void SwTiledRenderingTest::testPictureContentControl() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPictureContentControl) { // Given a document with a picture content control: SwXTextDocument* pXTextDocument = createDoc(); @@ -3786,7 +3610,7 @@ void SwTiledRenderingTest::testPictureContentControl() } -void SwTiledRenderingTest::testDateContentControl() +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDateContentControl) { // Given a document with a date content control: SwXTextDocument* pXTextDocument = createDoc(); @@ -3841,8 +3665,6 @@ void SwTiledRenderingTest::testDateContentControl() CPPUNIT_ASSERT_EQUAL(OUString("2022-05-30"), pTextNode->GetExpandText(pWrtShell->GetLayout())); } -CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest); - CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx index ccd6afcc4075..781c30a5e74a 100644 --- a/sw/source/uibase/app/swmodul1.cxx +++ b/sw/source/uibase/app/swmodul1.cxx @@ -424,6 +424,11 @@ OUString const & SwModule::GetRedlineAuthor(std::size_t nPos) return m_pAuthorNames[nPos]; } +void SwModule::ClearRedlineAuthors() +{ + m_pAuthorNames.clear(); +} + static Color lcl_GetAuthorColor(std::size_t nPos) { static const Color aColArr[] = |