sw/inc/crsrsh.hxx | 6 +- sw/inc/node.hxx | 5 + sw/inc/swcrsr.hxx | 16 ++--- sw/qa/core/crsr/crsr.cxx | 4 - sw/qa/core/fields/fields.cxx | 2 sw/qa/core/text/text.cxx | 8 +- sw/qa/core/txtnode/txtnode.cxx | 2 sw/qa/core/unocore/unocore.cxx | 8 +- sw/qa/extras/layout/layout.cxx | 66 ++++++++++++------------ sw/qa/extras/layout/layout2.cxx | 2 sw/qa/extras/tiledrendering/tiledrendering.cxx | 44 ++++++++-------- sw/qa/extras/txtimport/txtimport.cxx | 2 sw/qa/extras/uiwriter/uiwriter.cxx | 22 ++++---- sw/qa/extras/uiwriter/uiwriter2.cxx | 66 ++++++++++++------------ sw/qa/extras/uiwriter/uiwriter3.cxx | 25 ++++----- sw/qa/extras/uiwriter/uiwriter4.cxx | 12 ++-- sw/qa/extras/uiwriter/uiwriter5.cxx | 38 ++++++------- sw/qa/extras/uiwriter/uiwriter6.cxx | 4 - sw/qa/extras/uiwriter/uiwriter7.cxx | 16 ++--- sw/qa/extras/unowriter/unowriter.cxx | 8 +- sw/qa/uibase/dochdl/dochdl.cxx | 6 +- sw/qa/uibase/fldui/fldui.cxx | 2 sw/qa/uibase/shells/shells.cxx | 6 +- sw/qa/uibase/uno/uno.cxx | 2 sw/source/core/crsr/crsrsh.cxx | 2 sw/source/core/crsr/pam.cxx | 12 ++-- sw/source/core/crsr/swcrsr.cxx | 8 +- sw/source/core/doc/docruby.cxx | 2 sw/source/core/docnode/node.cxx | 12 ++-- sw/source/core/edit/edattr.cxx | 2 sw/source/core/edit/editsh.cxx | 4 - sw/source/core/edit/edlingu.cxx | 4 - sw/source/core/inc/pamtyp.hxx | 7 +- sw/source/core/text/EnhancedPDFExportHelper.cxx | 8 +- sw/source/core/view/viewsh.cxx | 2 sw/source/ui/dbui/dbinsdlg.cxx | 2 sw/source/ui/fldui/fldedt.cxx | 2 sw/source/ui/misc/insfnote.cxx | 12 ++-- sw/source/uibase/app/appenv.cxx | 2 sw/source/uibase/docvw/AnnotationWin2.cxx | 2 sw/source/uibase/docvw/edtwin.cxx | 6 +- sw/source/uibase/fldui/fldmgr.cxx | 6 +- sw/source/uibase/inc/wrtsh.hxx | 4 - sw/source/uibase/index/toxmgr.cxx | 2 sw/source/uibase/lingu/hhcwrp.cxx | 6 +- sw/source/uibase/lingu/olmenu.cxx | 2 sw/source/uibase/shells/basesh.cxx | 2 sw/source/uibase/shells/textsh1.cxx | 2 sw/source/uibase/shells/txtcrsr.cxx | 4 - sw/source/uibase/uiview/viewling.cxx | 2 sw/source/uibase/uiview/viewport.cxx | 2 sw/source/uibase/uno/unotxvw.cxx | 4 - sw/source/uibase/utlui/content.cxx | 6 +- sw/source/uibase/utlui/unotools.cxx | 2 sw/source/uibase/wrtsh/delete.cxx | 20 +++---- sw/source/uibase/wrtsh/move.cxx | 4 - sw/source/uibase/wrtsh/select.cxx | 8 +- sw/source/uibase/wrtsh/wrtsh1.cxx | 10 +-- sw/source/uibase/wrtsh/wrtsh2.cxx | 2 sw/source/uibase/wrtsh/wrtsh4.cxx | 16 ++--- 60 files changed, 284 insertions(+), 281 deletions(-)
New commits: commit 4c38f51c727fac25fdeb15d78a24d9203fabac5c Author: Noel Grandin <[email protected]> AuthorDate: Tue Jul 26 18:19:07 2022 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Jul 26 22:42:16 2022 +0200 convert CRSR_SKIP_* to typed enum Change-Id: Ia5cb9915fc7ad3238f4386f5ed3e43efc4b74a32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137478 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index fb6e00106691..61c2b9f07611 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -254,7 +254,7 @@ private: const int nLevel ); // private method(s) accessed from public inline method(s) must be exported. - bool LeftRight( bool, sal_uInt16, sal_uInt16, bool ); + bool LeftRight( bool, sal_uInt16, SwCursorSkipMode, bool ); SAL_DLLPRIVATE bool UpDown( bool, sal_uInt16 ); SAL_DLLPRIVATE bool LRMargin( bool, bool bAPI = false ); SAL_DLLPRIVATE bool IsAtLRMargin( bool, bool bAPI = false ) const; @@ -352,9 +352,9 @@ public: // basic cursor travelling tools::Long GetUpDownX() const { return m_nUpDownX; } - bool Left( sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual = false ) + bool Left( sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual = false ) { return LeftRight( true, nCnt, nMode, bAllowVisual ); } - bool Right( sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual = false ) + bool Right( sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual = false ) { return LeftRight( false, nCnt, nMode, bAllowVisual ); } bool Up( sal_uInt16 nCnt = 1 ) { return UpDown( true, nCnt ); } bool Down( sal_uInt16 nCnt = 1 ) { return UpDown( false, nCnt ); } diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index 9dc0df197fc3..00c930bb73b5 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -71,6 +71,7 @@ class IDocumentListItems; class Point; enum class SvxFrameDirection; typedef std::vector<SwOLENode*> SwOLENodes; // docary.hxx +enum class SwCursorSkipMode; namespace drawinglayer::attribute { class SdrAllFillAttributesHelper; @@ -405,8 +406,8 @@ public: void MakeStartIndex( SwContentIndex * pIdx ) { pIdx->Assign( this, 0 ); } void MakeEndIndex( SwContentIndex * pIdx ) { pIdx->Assign( this, Len() ); } - bool GoNext(SwContentIndex *, sal_uInt16 nMode ) const; - bool GoPrevious(SwContentIndex *, sal_uInt16 nMode ) const; + bool GoNext(SwContentIndex *, SwCursorSkipMode nMode ) const; + bool GoPrevious(SwContentIndex *, SwCursorSkipMode nMode ) const; /// @see GetFrameOfModify SwContentFrame *getLayoutFrame( const SwRootFrame*, diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index f36e0167d5c3..c3d3f5d040e4 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -62,10 +62,10 @@ namespace o3tl { // the same, but in complex text cell skip over ligatures and char skip // into it. // These defines exist only to cut off the dependencies to I18N project. -const sal_uInt16 CRSR_SKIP_CHARS = 0; -const sal_uInt16 CRSR_SKIP_CELLS = 1; -const sal_uInt16 CRSR_SKIP_HIDDEN = 2; - +enum class SwCursorSkipMode { Chars = 0, Cells = 1, Hidden = 2 }; +namespace o3tl { + template<> struct typed_flags<SwCursorSkipMode> : is_typed_flags<SwCursorSkipMode, 0x3> {}; +} class SW_DLLPUBLIC SwCursor : public SwPaM { @@ -160,7 +160,7 @@ public: bool GoSentence(SentenceMoveType eMoveType, SwRootFrame const*pLayout = nullptr); void ExpandToSentenceBorders(SwRootFrame const* pLayout); - virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, + virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual, bool bSkipHidden, bool bInsertCursor, SwRootFrame const* pLayout, bool isFieldNames); bool UpDown(bool bUp, sal_uInt16 nCnt, Point const * pPt, tools::Long nUpDownX, SwRootFrame & rLayout); @@ -169,8 +169,8 @@ public: bool SttEndDoc( bool bSttDoc ); bool GoPrevNextCell( bool bNext, sal_uInt16 nCnt ); - bool Left( sal_uInt16 nCnt ) { return LeftRight(true, nCnt, CRSR_SKIP_CHARS, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr, false); } - bool Right( sal_uInt16 nCnt ) { return LeftRight(false, nCnt, CRSR_SKIP_CHARS, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr, false); } + bool Left( sal_uInt16 nCnt ) { return LeftRight(true, nCnt, SwCursorSkipMode::Chars, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr, false); } + bool Right( sal_uInt16 nCnt ) { return LeftRight(false, nCnt, SwCursorSkipMode::Chars, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr, false); } bool GoNextCell( sal_uInt16 nCnt = 1 ) { return GoPrevNextCell( true, nCnt ); } bool GoPrevCell( sal_uInt16 nCnt = 1 ) { return GoPrevNextCell( false, nCnt ); } virtual bool GotoTable( const OUString& rName ); @@ -269,7 +269,7 @@ public: SwTableCursor( SwTableCursor& ); virtual ~SwTableCursor() override; - virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, + virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bAllowVisual, bool bSkipHidden, bool bInsertCursor, SwRootFrame const*, bool) override; virtual bool GotoTable( const OUString& rName ) override; diff --git a/sw/qa/core/crsr/crsr.cxx b/sw/qa/core/crsr/crsr.cxx index 8f8d9963a285..4a1a4c2c8479 100644 --- a/sw/qa/core/crsr/crsr.cxx +++ b/sw/qa/core/crsr/crsr.cxx @@ -124,7 +124,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreCrsrTest, testContentControlLineBreak) SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->SttEndDoc(/*bStt=*/true); // Go after "t". - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:InsertPara", {}); // Then make sure that we only insert a line break, not a new paragraph: @@ -156,7 +156,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreCrsrTest, testContentControlReadOnly) // When entering the content control: SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->SttEndDoc(/*bStt=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); // Then make sure that the cursor is read-only: // Without the accompanying fix in place, this test would have failed, it was possible to type diff --git a/sw/qa/core/fields/fields.cxx b/sw/qa/core/fields/fields.cxx index 9df1baf12b2d..0c57584939b4 100644 --- a/sw/qa/core/fields/fields.cxx +++ b/sw/qa/core/fields/fields.cxx @@ -52,7 +52,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAuthorityTooltip) // Get the tooltip of the field. SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); SwPaM* pCursor = pWrtShell->GetCursor(); auto pField = dynamic_cast<SwAuthorityField*>( SwCursorShell::GetFieldAtCursor(pCursor, /*bIncludeInputFieldAtStart=*/true)); diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 67b3c6f8763f..f11c6da8ff5d 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -170,7 +170,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testLineWidth) sal_Int32 nOldLeft = pWrtShell->GetCharRect().Left(); // When moving the cursor to the right: - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); // Then make sure we move to the right by the image width: sal_Int32 nNewLeft = pWrtShell->GetCharRect().Left(); @@ -458,9 +458,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRedlineDelete) // When deleting content in the middle of the paragraph: pWrtShell->SttEndDoc(/*bStt=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, /*nCount=*/aBefore.getLength(), + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, /*nCount=*/aBefore.getLength(), /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, /*nCount=*/aDelete.getLength(), + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, /*nCount=*/aDelete.getLength(), /*bBasicCall=*/false); // Without the accompanying fix in place, this test would have crashed: pWrtShell->Delete(); @@ -512,7 +512,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf43100_CursorMoveToSpacesOverMargin) // Before this fix, the cursor stopped at the margin. for (int i = 0; i < 5; i++) { - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); sal_Int32 nNewCursorPos = pWrtShell->GetCharRect().Left(); CPPUNIT_ASSERT_GREATER(nLastCursorPos, nNewCursorPos); nLastCursorPos = nNewCursorPos; diff --git a/sw/qa/core/txtnode/txtnode.cxx b/sw/qa/core/txtnode/txtnode.cxx index bd9bcd66d6fc..b60e3d48b60e 100644 --- a/sw/qa/core/txtnode/txtnode.cxx +++ b/sw/qa/core/txtnode/txtnode.cxx @@ -196,7 +196,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testSplitNodeSuperscriptCopy) SwDoc* pDoc = createSwDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->Insert("1st"); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 2, /*bBasicCall=*/false); SfxItemSetFixed<RES_CHRATR_ESCAPEMENT, RES_CHRATR_ESCAPEMENT> aSet(pWrtShell->GetAttrPool()); SvxEscapementItem aItem(SvxEscapement::Superscript, RES_CHRATR_ESCAPEMENT); aSet.Put(aItem); diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx index a9381d014791..1068892af94b 100644 --- a/sw/qa/core/unocore/unocore.cxx +++ b/sw/qa/core/unocore/unocore.cxx @@ -53,7 +53,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testTdf119081) // Enter outer A1. pWrtShell->Down(/*bSelect=*/false, /*nCount=*/3); // Enter inner A1. - pWrtShell->Right(CRSR_SKIP_CELLS, /*bSelect=*/false, /*nCount=*/1, /*bBasicCall=*/false, + pWrtShell->Right(SwCursorSkipMode::Cells, /*bSelect=*/false, /*nCount=*/1, /*bBasicCall=*/false, /*bVisual=*/true); // Enter outer B1. pWrtShell->Down(/*bSelect=*/false, /*nCount=*/2); @@ -68,7 +68,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testTdf119081) xTextAppend->insertTextPortion("x", {}, xInsertPosition); // Verify that the string is indeed inserted. - pWrtShell->Left(CRSR_SKIP_CELLS, /*bSelect=*/true, /*nCount=*/1, /*bBasicCall=*/false, + pWrtShell->Left(SwCursorSkipMode::Cells, /*bSelect=*/true, /*nCount=*/1, /*bBasicCall=*/false, /*bVisual=*/true); CPPUNIT_ASSERT_EQUAL(OUString("x"), pWrtShell->GetCurrentShellCursor().GetText()); } @@ -715,8 +715,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testContentControlPlainText) // Now check if the char index range 2-4 is extended to 0-6 when we apply formatting: pWrtShell->SttEndDoc(/*bStt=*/true); // Select "es" from "<dummy>test<dummy>". - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 2, /*bBasicCall=*/false); SfxItemSetFixed<RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT> aSet(pWrtShell->GetAttrPool()); SvxWeightItem aItem(WEIGHT_BOLD, RES_CHRATR_WEIGHT); aSet.Put(aItem); diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index cd7e58e929ef..e63b5bd6af1d 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -306,7 +306,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody) svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_ANCHOR, RES_ANCHOR>); SwFormatAnchor anchor(RndStdIds::FLY_AT_CHAR); pWrtShell->StartOfSection(false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); anchor.SetAnchor(pWrtShell->GetCursor()->GetPoint()); flySet.Put(anchor); SwFormatFrameSize size(SwFrameSize::Minimum, 1000, 1000); @@ -323,13 +323,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody) dispatchCommand(mxComponent, ".uno:TrackChanges", {}); // delete redline inside fly - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 8, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 8, /*bBasicCall=*/false); pWrtShell->Delete(); pWrtShell->SttEndDoc(true); // note: SttDoc actually moves to start of fly? - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 7, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 7, /*bBasicCall=*/false); pWrtShell->Delete(); for (int i = 0; i < 2; ++i) @@ -778,7 +778,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader) svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_ANCHOR, RES_ANCHOR>); SwFormatAnchor anchor(RndStdIds::FLY_AT_CHAR); pWrtShell->StartOfSection(false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); anchor.SetAnchor(pWrtShell->GetCursor()->GetPoint()); flySet.Put(anchor); SwFormatFrameSize size(SwFrameSize::Minimum, 1000, 1000); @@ -795,13 +795,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader) dispatchCommand(mxComponent, ".uno:TrackChanges", {}); // delete redline inside fly - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 8, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 8, /*bBasicCall=*/false); pWrtShell->Delete(); pWrtShell->GotoHeaderText(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 7, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 7, /*bBasicCall=*/false); pWrtShell->Delete(); for (int i = 0; i < 2; ++i) @@ -1296,7 +1296,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote) pWrtShell->StartOfSection(false); CPPUNIT_ASSERT(pWrtShell->IsCursorInFootnote()); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); anchor.SetAnchor(pWrtShell->GetCursor()->GetPoint()); flySet.Put(anchor); // second fly is in second footnote that is not deleted @@ -1312,21 +1312,21 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote) dispatchCommand(mxComponent, ".uno:TrackChanges", {}); // delete redline inside fly - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 8, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 8, /*bBasicCall=*/false); pWrtShell->Delete(); // pWrtShell->GotoFlyAnchor(); // sigh... why, now we're in the body... pWrtShell->SttEndDoc(false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->GotoFootnoteText(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 7, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 7, /*bBasicCall=*/false); pWrtShell->Delete(); pWrtShell->EndSelect(); // ? // delete first footnote pWrtShell->SttEndDoc(true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); pWrtShell->Delete(); for (int i = 0; i < 2; ++i) @@ -1506,7 +1506,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote) // anchor to 2nd (deleted) paragraph pWrtShell->SttEndDoc(false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->GotoFootnoteText(); pWrtShell->Down(false, 1); anchor.SetType(RndStdIds::FLY_AT_CHAR); @@ -1687,7 +1687,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote) // anchor to 3rd paragraph pWrtShell->EndOfSection(); pWrtShell->SttEndDoc(false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->GotoFootnoteText(); pWrtShell->EndOfSection(); anchor.SetType(RndStdIds::FLY_AT_CHAR); @@ -2092,7 +2092,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys) SwFormatFrameSize size(SwFrameSize::Minimum, 1000, 1000); flySet.Put(size); // set a size, else we get 1 char per line... pWrtShell->StartOfSection(false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); SwFormatAnchor anchor1(RndStdIds::FLY_AT_CHAR); anchor1.SetAnchor(pWrtShell->GetCursor()->GetPoint()); flySet.Put(anchor1); @@ -2122,20 +2122,20 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys) dispatchCommand(mxComponent, ".uno:TrackChanges", {}); // delete redline inside fly2 - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 8, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 8, /*bBasicCall=*/false); pWrtShell->Delete(); // delete redline inside fly1 pWrtShell->GotoFly(pFly1->GetName(), FLYCNTTYPE_FRM, /*bSelFrame=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 7, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 7, /*bBasicCall=*/false); pWrtShell->Delete(); pWrtShell->ClearMark(); // otherwise it refuses to leave the fly... pWrtShell->SttEndDoc(true); // note: SttDoc actually moves to start of fly? - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 7, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 7, /*bBasicCall=*/false); pWrtShell->Delete(); for (int i = 0; i < 2; ++i) @@ -2711,7 +2711,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys) SwFormatFrameSize size(SwFrameSize::Minimum, 1000, 1000); flySet.Put(size); // set a size, else we get 1 char per line... pWrtShell->StartOfSection(false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); SwFormatAnchor anchor1(RndStdIds::FLY_AT_CHAR); anchor1.SetAnchor(pWrtShell->GetCursor()->GetPoint()); flySet.Put(anchor1); @@ -2741,20 +2741,20 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys) dispatchCommand(mxComponent, ".uno:TrackChanges", {}); // delete redline inside fly2 - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 8, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 8, /*bBasicCall=*/false); pWrtShell->Delete(); // delete redline inside fly1 pWrtShell->GotoFly(pFly1->GetName(), FLYCNTTYPE_FRM, /*bSelFrame=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 7, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 7, /*bBasicCall=*/false); pWrtShell->Delete(); pWrtShell->ClearMark(); // otherwise it refuses to leave the fly... pWrtShell->SttEndDoc(true); // note: SttDoc actually moves to start of fly? - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 7, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 7, /*bBasicCall=*/false); pWrtShell->Delete(); dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index d7875d3a6caa..88813154a323 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -763,7 +763,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf145225_RedlineMovingWithBadInsertio dispatchCommand(mxComponent, ".uno:GoToStartOfDoc", {}); dispatchCommand(mxComponent, ".uno:TrackChanges", {}); // positionate the cursor in the middle of the second list item - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 4, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 4, /*bBasicCall=*/false); pWrtShell->SplitNode(false); CPPUNIT_ASSERT_EQUAL(static_cast<SwRedlineTable::size_type>(1), pEditShell->GetRedlineCount()); diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 15fd2ab4e6c8..b6fc8133b0ed 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -316,7 +316,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPostKeyEvent) { SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); // Did we manage to go after the first character? CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pShellCursor->GetPoint()->nContent.GetIndex()); @@ -332,7 +332,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPostMouseEvent) { SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); // Did we manage to go after the first character? CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pShellCursor->GetPoint()->nContent.GetIndex()); @@ -351,7 +351,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSetTextSelection) SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); // Move the cursor into the second word. - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 5, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 5, /*bBasicCall=*/false); // Create a selection on the word. pWrtShell->SelWrd(); SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); @@ -379,7 +379,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetTextSelection) SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); // Move the cursor into the first word. - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); // Create a selection by on the word. pWrtShell->SelWrd(); @@ -410,7 +410,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetTextSelectionLineLimit) SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); // Move the cursor into the first word. - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); // Create a selection. pWrtShell->SelAll(); @@ -454,7 +454,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testResetSelection) SwXTextDocument* pXTextDocument = createDoc("shape.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); // Select one character. - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); // We have a text selection. CPPUNIT_ASSERT(pShellCursor->HasMark()); @@ -914,13 +914,13 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testMissingInvalidation) // First view: put the cursor into the first word. SfxLokHelper::setView(nView1); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); // Second view: select the first word. SfxLokHelper::setView(nView2); CPPUNIT_ASSERT(pXTextDocument->GetDocShell()->GetWrtShell() != pWrtShell); pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->SelWrd(); // Now delete the selected word and make sure both views are invalidated. @@ -957,7 +957,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testViewCursors) aView2.m_bViewSelectionSet = false; SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); // Move the cursor into the second word. - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 5, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 5, /*bBasicCall=*/false); // Create a selection on the word. pWrtShell->SelWrd(); Scheduler::ProcessEventsToIdle(); @@ -1584,7 +1584,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testTrackChangesCallback) CPPUNIT_ASSERT_EQUAL(1, m_nRedlineTableSizeChanged); CPPUNIT_ASSERT_EQUAL(-1, m_nTrackedChangeIndex); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); SfxItemSet aSet(pWrtShell->GetDoc()->GetAttrPool(), svl::Items<FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_ACCEPT_DIRECT>); SfxVoidItem aItem(FN_REDLINE_ACCEPT_DIRECT); aSet.Put(aItem); @@ -1614,7 +1614,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testRedlineUpdateCallback) // Turn off the change tracking mode, make some modification to left of the // redline so that its position changes xPropertySet->setPropertyValue("RecordChanges", uno::Any(false)); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->Insert("This text is left of the redline"); // Position of the redline has changed => Modify callback @@ -1625,7 +1625,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testRedlineUpdateCallback) CPPUNIT_ASSERT_EQUAL(3, m_nRedlineTableEntryModified); // Make changes to the right of the redline => no position change in redline - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 100/*Go enough right */, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 100/*Go enough right */, /*bBasicCall=*/false); pWrtShell->Insert("This text is right of the redline"); // No Modify callbacks @@ -1699,7 +1699,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testCreateViewTextSelection) // Create a text selection: SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); // Move the cursor into the second word. - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 5, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 5, /*bBasicCall=*/false); // Create a selection on the word. pWrtShell->SelWrd(); SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); @@ -2989,7 +2989,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButton) setupLibreOfficeKitViewCallback(pWrtShell->GetSfxViewShell()); // Move the cursor to trigger displaying of the field button. - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); CPPUNIT_ASSERT(m_aFormFieldButton.isEmpty()); // Do a tile rendering to trigger the button message with a valid text area @@ -3037,7 +3037,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButton) } // Move the cursor back so the button becomes hidden. - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); CPPUNIT_ASSERT(!m_aFormFieldButton.isEmpty()); { @@ -3062,7 +3062,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonEditing) setupLibreOfficeKitViewCallback(pWrtShell->GetSfxViewShell()); // Move the cursor to trigger displaying of the field button. - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); CPPUNIT_ASSERT(m_aFormFieldButton.isEmpty()); // Do a tile rendering to trigger the button message with a valid text area @@ -3119,7 +3119,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonNoSelectio setupLibreOfficeKitViewCallback(pWrtShell->GetSfxViewShell()); // Move the cursor to trigger displaying of the field button. - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); CPPUNIT_ASSERT(m_aFormFieldButton.isEmpty()); // Do a tile rendering to trigger the button message with a valid text area @@ -3205,7 +3205,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonNoItem) setupLibreOfficeKitViewCallback(pWrtShell->GetSfxViewShell()); // Move the cursor to trigger displaying of the field button. - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); CPPUNIT_ASSERT(m_aFormFieldButton.isEmpty()); // Do a tile rendering to trigger the button message with a valid text area @@ -3462,7 +3462,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testRedlinePortions) pView->SetRedlineAuthor("second"); pDocShell->SetView(pView); pWrtShell->SttEndDoc(/*bStt*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, /*nCount=*/9, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, /*nCount=*/9, /*bBasicCall=*/false); pDocShell->SetChangeRecording(true); pWrtShell->Delete(); @@ -3489,7 +3489,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testContentControl) m_aContentControl.clear(); // When entering that content control (chars 2-7 are the content control): - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, /*nCount=*/5, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, /*nCount=*/5, /*bBasicCall=*/false); // Then make sure that the callback is emitted: // Without the accompanying fix in place, this test would have failed, no callback was emitted. @@ -3553,7 +3553,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownContentControl) m_aContentControl.clear(); // When entering that content control: - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, /*nCount=*/1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, /*nCount=*/1, /*bBasicCall=*/false); // Then make sure that the callback is emitted: CPPUNIT_ASSERT(!m_aContentControl.isEmpty()); @@ -3680,7 +3680,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDateContentControl) m_aContentControl.clear(); // When entering that content control: - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, /*nCount=*/1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, /*nCount=*/1, /*bBasicCall=*/false); // Then make sure that the callback is emitted: CPPUNIT_ASSERT(!m_aContentControl.isEmpty()); diff --git a/sw/qa/extras/txtimport/txtimport.cxx b/sw/qa/extras/txtimport/txtimport.cxx index 4ae113320a88..2b388d9b6175 100644 --- a/sw/qa/extras/txtimport/txtimport.cxx +++ b/sw/qa/extras/txtimport/txtimport.cxx @@ -179,7 +179,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf115088) pWrtShell->SelAll(); dispatchCommand(mxComponent, ".uno:Cut", {}); pWrtShell->Insert("test"); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 4, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 4, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:PasteUnformatted", {}); uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); OUString aActual = xTextDocument->getText()->getString().copy(0, 2); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index d075eab58b22..0acd71a19121 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -443,8 +443,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf135978) IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags())); CPPUNIT_ASSERT(pWrtShell->GetLayout()->IsHideRedlines()); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 4, /*bBasicCall=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 6, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 4, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 6, /*bBasicCall=*/false); pWrtShell->Delete(); // now split @@ -563,7 +563,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testImportRTF) SwDoc* pDoc = createSwDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->Insert("foobar"); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 3, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 3, /*bBasicCall=*/false); // Insert the RTF at the cursor position. OString aData = "{\\rtf1 Hello world!\\par}"; @@ -584,8 +584,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testExportRTF) SwDoc* pDoc = createSwDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->Insert("aaabbbccc"); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 3, /*bBasicCall=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 3, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 3, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 3, /*bBasicCall=*/false); // Create the clipboard document. rtl::Reference<SwDoc> xClpDoc(new SwDoc()); @@ -808,7 +808,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testFdo74981) } // go to the begin of the paragraph and split this node - pWrtShell->Left(CRSR_SKIP_CHARS, false, 100, false); + pWrtShell->Left(SwCursorSkipMode::Chars, false, 100, false); pWrtShell->SplitNode(); { @@ -1007,7 +1007,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCommentedWord) SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "commented-word.odt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); // Move the cursor into the second word. - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 5, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 5, /*bBasicCall=*/false); // Select the word. pWrtShell->SelWrd(); @@ -1304,7 +1304,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf81226) SwDoc* const pDoc = createSwDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->Insert("before"); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 4, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 4, /*bBasicCall=*/false); pWrtShell->Down(false); pWrtShell->Insert("after"); @@ -1321,12 +1321,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf137532) pWrtShell->Insert("test"); //Select the word and change it to bold - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 4, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 4, /*bBasicCall=*/false); lcl_setWeight(pWrtShell, WEIGHT_BOLD); // Select first character and replace it - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); pWrtShell->Insert("x"); auto xText = getParagraph(1)->getText(); diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index aa5515b131a1..6836fb8d9f22 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -185,11 +185,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineMoveInsertInDelete) // first delete redline, logically containing the insert redline // (note: Word apparently allows similar things...) pWrtShell->SttEndDoc(true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); pWrtShell->Delete(); // the footnote // second delete redline, following the first one pWrtShell->EndOfSection(false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 3, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 3, /*bBasicCall=*/false); pWrtShell->Delete(); // "foo" // hiding used to copy the 2nd delete redline "foo", but not delete it @@ -220,12 +220,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineInHiddenSection) pWrtShell->SetRedlineFlags(mode); // delete paragraph "bar" - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 8, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 8, /*bBasicCall=*/false); pWrtShell->Delete(); pWrtShell->StartOfSection(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->EndOfSection(true); SwSectionData section(SectionType::Content, pWrtShell->GetUniqueSectionName()); @@ -285,7 +285,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineSplitContentNode) sw::UndoManager& rUndoManager = pDoc->GetUndoManager(); pWrtShell->CalcLayout(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 18, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 18, /*bBasicCall=*/false); pWrtShell->SplitNode(true); rUndoManager.Undo(); // crashed @@ -816,7 +816,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf131912) svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_ANCHOR, RES_ANCHOR>); SwFormatAnchor anchor(RndStdIds::FLY_AT_CHAR); pWrtShell->StartOfSection(false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); anchor.SetAnchor(pWrtShell->GetCursor()->GetPoint()); flySet.Put(anchor); SwFormatFrameSize size(SwFrameSize::Minimum, 1000, 1000); @@ -967,7 +967,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf140007) pWrtShell->SttEndDoc(true); pWrtShell->EndPara(false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); pWrtShell->Replace(" ", true); CPPUNIT_ASSERT_EQUAL(SwNodeOffset(12), pDoc->GetNodes().Count()); CPPUNIT_ASSERT_EQUAL(OUString("foo bar"), @@ -977,7 +977,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf140007) pWrtShell->SttEndDoc(true); pWrtShell->EndPara(false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); pWrtShell->Replace(" ", true); CPPUNIT_ASSERT_EQUAL(OUString("foo bar baz"), pDoc->GetNodes()[SwNodeOffset(9)]->GetTextNode()->GetText()); @@ -1050,7 +1050,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf139982) pWrtShell->Insert("helloo"); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); { SwFormatAnchor anchor(RndStdIds::FLY_AT_CHAR); anchor.SetAnchor(pWrtShell->GetCursor()->GetPoint()); @@ -1091,7 +1091,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf135976) pWrtShell->Insert("foobar"); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); SwFormatAnchor anchor(RndStdIds::FLY_AT_CHAR); anchor.SetAnchor(pWrtShell->GetCursor()->GetPoint()); SfxItemSet flySet(pDoc->GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR>); @@ -1116,7 +1116,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf135976) pWrtShell->UnSelectFrame(); pWrtShell->SttEndDoc(/*bStart=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->DelLeft(); pWrtShell->DelLeft(); @@ -1149,7 +1149,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf135976) // now again in the other direction: pWrtShell->SttEndDoc(/*bStart=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 3, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 3, /*bBasicCall=*/false); pWrtShell->DelRight(); pWrtShell->DelRight(); @@ -1326,7 +1326,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf54819) // remove first paragraph with paragraph break SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->EndPara(/*bSelect=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell); pTransfer->Cut(); @@ -1372,7 +1372,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf54819_keep_numbering_with_Undo) pWrtShell->Down(/*bSelect=*/false); pWrtShell->Down(/*bSelect=*/false); pWrtShell->EndPara(/*bSelect=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell); pTransfer->Cut(); @@ -1462,11 +1462,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119571_keep_numbering_with_Undo) pWrtShell->Down(/*bSelect=*/false); pWrtShell->Down(/*bSelect=*/false); pWrtShell->Down(/*bSelect=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 6, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 6, /*bBasicCall=*/false); pWrtShell->EndPara(/*bSelect=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 2, /*bBasicCall=*/false); pWrtShell->EndPara(/*bSelect=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell); pTransfer->Cut(); @@ -1564,11 +1564,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119571_keep_numbering_with_Reject) pWrtShell->Down(/*bSelect=*/false); pWrtShell->Down(/*bSelect=*/false); pWrtShell->Down(/*bSelect=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 6, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 6, /*bBasicCall=*/false); pWrtShell->EndPara(/*bSelect=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 2, /*bBasicCall=*/false); pWrtShell->EndPara(/*bSelect=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell); pTransfer->Cut(); @@ -1619,8 +1619,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf140077) pWrtShell->Insert("a"); pWrtShell->SplitNode(); pWrtShell->Insert("b"); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); // enable dispatchCommand(mxComponent, ".uno:TrackChanges", {}); @@ -1633,7 +1633,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf140077) pWrtShell->Delete(); pWrtShell->SttEndDoc(/*bStart=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:TrackChanges", {}); // crashed in layout @@ -1760,7 +1760,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf147414) IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags())); CPPUNIT_ASSERT(pWrtShell->GetLayout()->IsHideRedlines()); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); // backspace pWrtShell->DelLeft(); pWrtShell->AutoCorrect(corr, u' '); @@ -1910,7 +1910,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf126784_distributeSelectedColumns) sal_Int16 nOrigCol3Pos = aSeq[1].Position; //Select column 1 and 2 - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:DistributeColumns", {}); @@ -1987,9 +1987,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119571) // join paragraphs by removing the end of the first one with paragraph break SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->EndPara(/*bSelect=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell); pTransfer->Cut(); @@ -2019,7 +2019,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf144058) // join first and last but one paragraphs by removing the end of the first paragraph // with paragraph break, and by removing two tables of the selected range completely SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->Down(/*bSelect=*/true); pWrtShell->Down(/*bSelect=*/true); pWrtShell->Down(/*bSelect=*/true); @@ -2054,7 +2054,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119019) pWrtShell->Down(/*bSelect=*/false); pWrtShell->Down(/*bSelect=*/false); pWrtShell->EndPara(/*bSelect=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 7, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 7, /*bBasicCall=*/false); rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell); pTransfer->Cut(); @@ -2094,7 +2094,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf119824) pWrtShell->Down(/*bSelect=*/false); pWrtShell->Down(/*bSelect=*/false); pWrtShell->EndPara(/*bSelect=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 5, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 5, /*bBasicCall=*/false); rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell); pTransfer->Cut(); @@ -2765,7 +2765,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137503) // select and delete the first two paragraphs pWrtShell->EndPara(/*bSelect=*/true); pWrtShell->EndPara(/*bSelect=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:Delete", {}); CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("The")); @@ -3100,7 +3100,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testJoinParaChangesInMargin) // delete a character and the paragraph break at the end of the paragraph dispatchCommand(mxComponent, ".uno:GotoEndOfPara", {}); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:Delete", {}); dispatchCommand(mxComponent, ".uno:Delete", {}); CPPUNIT_ASSERT_EQUAL(OUString("Lorem ipsudolor sit amet."), getParagraph(1)->getString()); diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 57146fa98780..79f8b9cf27ea 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -438,7 +438,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf148868) CPPUNIT_ASSERT_EQUAL(1, getPages()); pWrtShell->EndPg(/*bSelect=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 5, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 5, /*bBasicCall=*/false); pWrtShell->Insert("X"); // Without the fix in place, this test would have failed with @@ -2622,7 +2622,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf141391) dispatchCommand(mxComponent, ".uno:SelectTable", {}); dispatchCommand(mxComponent, ".uno:Copy", {}); // remove the selection and positionate the cursor at beginning of A2 - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:Paste", {}); Scheduler::ProcessEventsToIdle(); @@ -2680,7 +2680,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf141391) // copy the 2-row table into the fist paragraph of cell "A2", // but not at paragraph start (changed behaviour) - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->Insert("and some text again in the first paragraph to be sure..."); dispatchCommand(mxComponent, ".uno:Paste", {}); Scheduler::ProcessEventsToIdle(); @@ -2712,7 +2712,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf148791) dispatchCommand(mxComponent, ".uno:SelectTable", {}); dispatchCommand(mxComponent, ".uno:Copy", {}); // remove the selection and positionate the cursor at beginning of A2 - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->Up(/*bSelect=*/false); dispatchCommand(mxComponent, ".uno:PasteRowsBefore", {}); Scheduler::ProcessEventsToIdle(); @@ -2746,7 +2746,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf148791) dispatchCommand(mxComponent, ".uno:SelectTable", {}); dispatchCommand(mxComponent, ".uno:Copy", {}); // remove the selection and positionate the cursor at beginning of A2 - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->Up(/*bSelect=*/false); pWrtShell->Up(/*bSelect=*/false); pWrtShell->Up(/*bSelect=*/false); @@ -2770,7 +2770,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf148791) dispatchCommand(mxComponent, ".uno:SelectTable", {}); dispatchCommand(mxComponent, ".uno:Copy", {}); // remove the selection and positionate the cursor at beginning of A2 - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); // skip 7 table rows plus 4 rows of the nested table for (int i = 0; i < 7 + 4; ++i) pWrtShell->Up(/*bSelect=*/false); @@ -2795,7 +2795,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf148791) dispatchCommand(mxComponent, ".uno:SelectTable", {}); dispatchCommand(mxComponent, ".uno:Copy", {}); // remove the selection and positionate the cursor at beginning of A2 - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); // skip 15 table rows plus 4 * 2 rows of the nested tables for (int i = 0; i < 15 + 4 * 2; ++i) pWrtShell->Up(/*bSelect=*/false); @@ -2880,7 +2880,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145584) pWrtSh->Insert("Hello World"); // Select 'World' - pWrtSh->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 5, /*bBasicCall=*/false); + pWrtSh->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 5, /*bBasicCall=*/false); // Save as PDF. uno::Sequence<beans::PropertyValue> aFilterData( @@ -2992,7 +2992,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf116315) CPPUNIT_ASSERT(pWrtSh); pWrtSh->Insert("This is a test"); - pWrtSh->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 4, /*bBasicCall=*/false); + pWrtSh->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 4, /*bBasicCall=*/false); SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); for (sal_Int32 i = 0; i < 5; ++i) @@ -3598,11 +3598,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf146573) // of the cell with the footnote dispatchCommand(mxComponent, ".uno:AcceptAllTrackedChanges", {}); Scheduler::ProcessEventsToIdle(); - pWrtShell->Right(CRSR_SKIP_CELLS, /*bSelect=*/false, /*nCount=*/1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Cells, /*bSelect=*/false, /*nCount=*/1, + /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:InsertFootnote", {}); dispatchCommand(mxComponent, ".uno:PageUp", {}); // leave footnote - pWrtShell->Left(CRSR_SKIP_CELLS, /*bSelect=*/false, /*nCount=*/1, /*bBasicCall=*/false); - pWrtShell->Left(CRSR_SKIP_CELLS, /*bSelect=*/true, /*nCount=*/1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Cells, /*bSelect=*/false, /*nCount=*/1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Cells, /*bSelect=*/true, /*nCount=*/1, /*bBasicCall=*/false); pWrtShell->Insert("100"); // trigger recalculation by leaving the cell diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx b/sw/qa/extras/uiwriter/uiwriter4.cxx index ae650c84f234..22fa2baadf1c 100644 --- a/sw/qa/extras/uiwriter/uiwriter4.cxx +++ b/sw/qa/extras/uiwriter/uiwriter4.cxx @@ -1482,7 +1482,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf104032) SwDoc aClipboard; SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->StartOfSection(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); pWrtShell->Copy(aClipboard); pWrtShell->EndOfSection(); pWrtShell->Paste(aClipboard); @@ -1594,7 +1594,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly) assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row", 4); // Move the cursor after the redline, and insert some text without change tracking - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->Insert("X"); // Accepting again: 4 rows (extra text keeps the deleted row) @@ -1647,7 +1647,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableRemoveHasTextChangesOnly2) pWrtShell->Down(/*bSelect=*/false); pWrtShell->Down(/*bSelect=*/false); pWrtShell->Down(/*bSelect=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); Scheduler::ProcessEventsToIdle(); dispatchCommand(mxComponent, ".uno:AcceptTrackedChange", {}); Scheduler::ProcessEventsToIdle(); @@ -1907,7 +1907,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf105625) pWrtShell->Down(/*bSelect=*/false); // Check selection across FORMTEXT field boundary - must be read-only pWrtShell->SttPara(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); CPPUNIT_ASSERT_EQUAL(true, pWrtShell->HasReadonlySel()); // Test deletion of whole field with single backspace // Previously it only removed right boundary of FORMTEXT, or failed removal at all @@ -1934,7 +1934,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf125151_protected) // The cursor moved inside of the FieldMark textbox. CPPUNIT_ASSERT_EQUAL_MESSAGE("Readonly 1", false, pWrtShell->HasReadonlySel()); // Move left to the start/definition of the textbox - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); CPPUNIT_ASSERT_EQUAL_MESSAGE("Readonly 2", true, pWrtShell->HasReadonlySel()); } @@ -1951,7 +1951,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf125151_protectedB) // The cursor starts inside of the FieldMark textbox. CPPUNIT_ASSERT_EQUAL_MESSAGE("Readonly 1", false, pWrtShell->HasReadonlySel()); // Move left to the start/definition of the textbox - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); CPPUNIT_ASSERT_EQUAL_MESSAGE("Readonly 2", true, pWrtShell->HasReadonlySel()); } diff --git a/sw/qa/extras/uiwriter/uiwriter5.cxx b/sw/qa/extras/uiwriter/uiwriter5.cxx index f8bbc0d52624..44b6473a7ef8 100644 --- a/sw/qa/extras/uiwriter/uiwriter5.cxx +++ b/sw/qa/extras/uiwriter/uiwriter5.cxx @@ -146,13 +146,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf138479) dispatchCommand(mxComponent, ".uno:ShowChangesInMargin", {}); // delete "r" in "Lorem" - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 3, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 3, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:Delete", {}); CPPUNIT_ASSERT_EQUAL(OUString("Loem"), getParagraph(1)->getString()); // delete "oe" in "Loem" - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 2, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:Delete", {}); CPPUNIT_ASSERT_EQUAL(OUString("Lm"), getParagraph(1)->getString()); @@ -318,7 +318,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf50447) } // remove bold formatting with change tracking - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 6, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 6, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:Bold", {}); xText = getParagraph(1)->getText(); @@ -362,7 +362,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143918) } // remove bold formatting with change tracking and after that, apply underline, too - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 6, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 6, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:Bold", {}); dispatchCommand(mxComponent, ".uno:Underline", {}); @@ -422,7 +422,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143938) IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags())); // apply italic with change tracking - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 6, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 6, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:Italic", {}); xText = getParagraph(1)->getText(); @@ -473,7 +473,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf143939) } // positionate the text cursor inside the first word - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); // remove bold formatting with change tracking without selection dispatchCommand(mxComponent, ".uno:Bold", {}); @@ -1053,9 +1053,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf125310) // paragraph join SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtShell->EndPara(/*bSelect=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell); pTransfer->Cut(); @@ -1140,7 +1140,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testImageComment) // Test document has "before<image>after", remove the content before the image. SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->SttEndDoc(/*bStart=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 6, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 6, /*bBasicCall=*/false); pWrtShell->Delete(); // Select the image. @@ -2793,7 +2793,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf93747) pWrtSh->Insert("Col1"); // Move the cursor to B1 - pWrtSh->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtSh->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtSh->Insert("Col2"); @@ -2812,10 +2812,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf93747) CPPUNIT_ASSERT_EQUAL(OUString("Col2"), xCellB1->getString()); // Select backwards B1 and A1 - pWrtSh->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 5, /*bBasicCall=*/false); + pWrtSh->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 5, /*bBasicCall=*/false); // Just select the whole B1 - pWrtSh->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtSh->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); uno::Sequence<beans::PropertyValue> aPropertyValues = comphelper::InitPropertySequence({ { "Style", uno::Any(OUString("Heading 1")) }, @@ -2835,7 +2835,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf93747) getProperty<OUString>(getParagraphOfText(1, xCellB1->getText()), "ParaStyleName")); // Now select A1 again - pWrtSh->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtSh->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:StyleApply", aPropertyValues); @@ -2884,7 +2884,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145151) pWrtSh->Insert("Col1"); // Move the cursor to B1 - pWrtSh->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtSh->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); pWrtSh->Insert("Col2"); @@ -2903,10 +2903,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145151) CPPUNIT_ASSERT_EQUAL(OUString("Col2"), xCellB1->getString()); // Select backwards B1 and A1 (select "2loC<cell>" which ends up selecting both cells) - pWrtSh->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 5, /*bBasicCall=*/false); + pWrtSh->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 5, /*bBasicCall=*/false); // Just select the whole B1 - pWrtSh->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtSh->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:DefaultNumbering", {}); Scheduler::ProcessEventsToIdle(); @@ -2931,7 +2931,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145151) // Now test removing numbering/bullets // Add A1 to the current B1 selection - pWrtSh->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtSh->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); // Toggle on bullet numbering dispatchCommand(mxComponent, ".uno:DefaultBullet", {}); @@ -2947,7 +2947,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf145151) CPPUNIT_ASSERT(sNumStyleA1 != sNumStyleB1); // therefore B1 changed from numbering to bullets // Just select cell B1 - pWrtSh->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtSh->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); // Toggle off bullet numbering dispatchCommand(mxComponent, ".uno:DefaultBullet", {}); diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index 6a341088d8e6..f3c2f5c7d67f 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -1792,8 +1792,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf130274) // "tset" may be replaced by the AutoCorrect in the test profile emulateTyping(*pXTextDocument, u"tset"); // select from left to right - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 4, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 4, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 4, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 4, /*bBasicCall=*/false); pWrtShell->SetRedlineFlags(pWrtShell->GetRedlineFlags() | RedlineFlags::On); // this would crash in AutoCorrect diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index fd63b94dcfb5..89a68b86e2bc 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -2002,7 +2002,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testUndoDelAsChar) CPPUNIT_ASSERT(rIDCO.InsertGraphicObject(*pShell->GetCursor(), grf, &frameSet, &grfSet)); CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_GRF)); pShell->SetMark(); - pShell->Left(1, CRSR_SKIP_CHARS); + pShell->Left(1, SwCursorSkipMode::Chars); rIDCO.DeleteAndJoin(*pShell->GetCursor()); CPPUNIT_ASSERT_EQUAL(size_t(0), pDoc->GetFlyCount(FLYCNTTYPE_GRF)); CPPUNIT_ASSERT(!pShell->GetCursor()->GetNode().GetTextNode()->HasHints()); @@ -2169,10 +2169,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf127635) Scheduler::ProcessEventsToIdle(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); //Select 'a' - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); // enable redlining dispatchCommand(mxComponent, ".uno:TrackChanges", {}); @@ -2206,12 +2206,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testDde) SwDoc* pDoc = createSwDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->Insert("asdf"); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 4, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 4, /*bBasicCall=*/false); uno::Sequence<beans::PropertyValue> aPropertyValues; dispatchCommand(mxComponent, ".uno:Copy", aPropertyValues); // Go before the selection and paste as a DDE link. - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); aPropertyValues = comphelper::InitPropertySequence( { { "SelectedFormat", uno::Any(static_cast<sal_uInt32>(SotClipboardFormatId::LINK)) } }); dispatchCommand(mxComponent, ".uno:ClipboardFormatItems", aPropertyValues); @@ -2427,8 +2427,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf138873) CPPUNIT_ASSERT_EQUAL(OUString("A B C"), getParagraph(1)->getString()); // Select B - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); pWrtShell->Insert("DDD"); @@ -2440,7 +2440,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf138873) CPPUNIT_ASSERT_EQUAL(OUString("A B C"), getParagraph(1)->getString()); // Select B and C - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 2, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 2, /*bBasicCall=*/false); dispatchCommand(mxComponent, ".uno:Copy", {}); Scheduler::ProcessEventsToIdle(); diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx index 8daa22949725..02b3002fd13c 100644 --- a/sw/qa/extras/unowriter/unowriter.cxx +++ b/sw/qa/extras/unowriter/unowriter.cxx @@ -863,8 +863,8 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testPasteListener) CPPUNIT_ASSERT(pTextDoc); SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 3, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 3, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 2, /*bBasicCall=*/false); rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell); pTransfer->Cut(); TransferableDataHelper aHelper(pTransfer); @@ -878,8 +878,8 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testPasteListener) CPPUNIT_ASSERT_EQUAL(OUString("ABCDEF"), xBodyText->getString()); // Paste again, this time overwriting "BC". - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 4, /*bBasicCall=*/false); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 2, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 4, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 2, /*bBasicCall=*/false); pListener->GetString().clear(); SwTransferable::Paste(*pWrtShell, aHelper); CPPUNIT_ASSERT_EQUAL(OUString("DE"), pListener->GetString()); diff --git a/sw/qa/uibase/dochdl/dochdl.cxx b/sw/qa/uibase/dochdl/dochdl.cxx index c882eab89ea9..579bc5d84058 100644 --- a/sw/qa/uibase/dochdl/dochdl.cxx +++ b/sw/qa/uibase/dochdl/dochdl.cxx @@ -31,7 +31,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseDochdlTest, testSelectPasteFormat) SwDocShell* pDocShell = pDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); pWrtShell->Insert2("x"); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell); pTransfer->Cut(); @@ -57,8 +57,8 @@ CPPUNIT_TEST_FIXTURE(SwUibaseDochdlTest, testComplexSelection) SwDocShell* pDocShell = pDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); pWrtShell->Insert2("abc"); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); SfxItemSet aSet(pWrtShell->GetView().GetPool(), svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>); // Bold, italic, underline. diff --git a/sw/qa/uibase/fldui/fldui.cxx b/sw/qa/uibase/fldui/fldui.cxx index 263195112a25..28f491e95f78 100644 --- a/sw/qa/uibase/fldui/fldui.cxx +++ b/sw/qa/uibase/fldui/fldui.cxx @@ -66,7 +66,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBiblioPageNumberUpdate) SwDocShell* pDocShell = pDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); pWrtShell->SttEndDoc(/*bStt=*/false); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); OUString aCoreFields[AUTH_FIELD_END]; aCoreFields[AUTH_FIELD_AUTHORITY_TYPE] = OUString::number(text::BibliographyDataType::WWW); aCoreFields[AUTH_FIELD_IDENTIFIER] = "AT"; diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx index 5a99b8e3c6bf..9efe5cef360d 100644 --- a/sw/qa/uibase/shells/shells.cxx +++ b/sw/qa/uibase/shells/shells.cxx @@ -180,7 +180,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testBibliographyUrlContextMenu) // When selecting the field and opening the context menu: SwDocShell* pDocShell = pDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); SfxDispatcher* pDispatcher = pDocShell->GetViewShell()->GetViewFrame()->GetDispatcher(); css::uno::Any aState; SfxItemState eState = pDispatcher->QueryState(SID_OPEN_HYPERLINK, aState); @@ -218,7 +218,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testBibliographyLocalCopyContextMenu) // When selecting the field and opening the context menu: SwDocShell* pDocShell = pDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 1, /*bBasicCall=*/false); SfxDispatcher* pDispatcher = pDocShell->GetViewShell()->GetViewFrame()->GetDispatcher(); css::uno::Any aState; SfxItemState eState = pDispatcher->QueryState(FN_OPEN_LOCAL_URL, aState); @@ -247,7 +247,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testContentControlPageBreak) xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->SttEndDoc(/*bStt=*/true); - pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); // When trying to insert a page break: dispatchCommand(mxComponent, ".uno:InsertPagebreak", {}); diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx index f4b337d8f9d2..16359e2dd7b9 100644 --- a/sw/qa/uibase/uno/uno.cxx +++ b/sw/qa/uibase/uno/uno.cxx @@ -62,7 +62,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testCreateTextRangeByPixelPosition) SwDocShell* pDocShell = pDoc->GetDocShell(); SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); pWrtShell->Insert2("AZ"); - pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); + pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, /*bBasicCall=*/false); Point aLogic = pWrtShell->GetCharRect().Center(); SwView* pView = pDocShell->GetView(); SwEditWin& rEditWin = pView->GetEditWin(); diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 9c46b041c047..64c923eadfe7 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -321,7 +321,7 @@ void SwCursorShell::EndCursorMove( const bool bIdleEnd ) #endif } -bool SwCursorShell::LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, +bool SwCursorShell::LeftRight( bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bVisualAllowed ) { if( IsTableMode() ) diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 74aec4248cab..838ca42e411f 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -305,14 +305,14 @@ bool CheckNodesRange( const SwNodeIndex& rStt, return false; // somewhere in between => error } -bool GoNext(SwNode* pNd, SwContentIndex * pIdx, sal_uInt16 nMode ) +bool GoNext(SwNode* pNd, SwContentIndex * pIdx, SwCursorSkipMode nMode ) { if( pNd->IsContentNode() ) return static_cast<SwContentNode*>(pNd)->GoNext( pIdx, nMode ); return false; } -bool GoPrevious( SwNode* pNd, SwContentIndex * pIdx, sal_uInt16 nMode ) +bool GoPrevious( SwNode* pNd, SwContentIndex * pIdx, SwCursorSkipMode nMode ) { if( pNd->IsContentNode() ) return static_cast<SwContentNode*>(pNd)->GoPrevious( pIdx, nMode ); @@ -1012,7 +1012,7 @@ bool GoInNode( SwPaM & rPam, SwMoveFnCollection const & fnMove ) bool GoInContent( SwPaM & rPam, SwMoveFnCollection const & fnMove ) { if( (*fnMove.fnNd)( &rPam.GetPoint()->nNode.GetNode(), - &rPam.GetPoint()->nContent, CRSR_SKIP_CHARS )) + &rPam.GetPoint()->nContent, SwCursorSkipMode::Chars )) return true; return GoInNode( rPam, fnMove ); } @@ -1020,7 +1020,7 @@ bool GoInContent( SwPaM & rPam, SwMoveFnCollection const & fnMove ) bool GoInContentCells( SwPaM & rPam, SwMoveFnCollection const & fnMove ) { if( (*fnMove.fnNd)( &rPam.GetPoint()->nNode.GetNode(), - &rPam.GetPoint()->nContent, CRSR_SKIP_CELLS )) + &rPam.GetPoint()->nContent, SwCursorSkipMode::Cells )) return true; return GoInNode( rPam, fnMove ); } @@ -1028,7 +1028,7 @@ bool GoInContentCells( SwPaM & rPam, SwMoveFnCollection const & fnMove ) bool GoInContentSkipHidden( SwPaM & rPam, SwMoveFnCollection const & fnMove ) { if( (*fnMove.fnNd)( &rPam.GetPoint()->nNode.GetNode(), - &rPam.GetPoint()->nContent, CRSR_SKIP_CHARS | CRSR_SKIP_HIDDEN ) ) + &rPam.GetPoint()->nContent, SwCursorSkipMode::Chars | SwCursorSkipMode::Hidden ) ) return true; return GoInNode( rPam, fnMove ); } @@ -1036,7 +1036,7 @@ bool GoInContentSkipHidden( SwPaM & rPam, SwMoveFnCollection const & fnMove ) bool GoInContentCellsSkipHidden( SwPaM & rPam, SwMoveFnCollection const & fnMove ) { if( (*fnMove.fnNd)( &rPam.GetPoint()->nNode.GetNode(), - &rPam.GetPoint()->nContent, CRSR_SKIP_CELLS | CRSR_SKIP_HIDDEN ) ) + &rPam.GetPoint()->nContent, SwCursorSkipMode::Cells | SwCursorSkipMode::Hidden ) ) return true; return GoInNode( rPam, fnMove ); } diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 528a9b89755f..b4a873449a83 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1670,7 +1670,7 @@ void SwCursor::ExpandToSentenceBorders(SwRootFrame const*const pLayout) } } -bool SwTableCursor::LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 /*nMode*/, +bool SwTableCursor::LeftRight( bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode /*nMode*/, bool /*bVisualAllowed*/, bool /*bSkipHidden*/, bool /*bInsertCursor*/, SwRootFrame const*, bool /*isFieldNames*/) { @@ -1736,7 +1736,7 @@ SwCursor::DoSetBidiLevelLeftRight( return pSttFrame; } -bool SwCursor::LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, +bool SwCursor::LeftRight( bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode, bool bVisualAllowed,bool bSkipHidden, bool bInsertCursor, SwRootFrame const*const pLayout, bool isFieldNames) { @@ -1751,9 +1751,9 @@ bool SwCursor::LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, SwGoInDoc fnGo; if ( bSkipHidden ) - fnGo = CRSR_SKIP_CELLS == nMode ? GoInContentCellsSkipHidden : GoInContentSkipHidden; + fnGo = SwCursorSkipMode::Cells == nMode ? GoInContentCellsSkipHidden : GoInContentSkipHidden; else - fnGo = CRSR_SKIP_CELLS == nMode ? GoInContentCells : GoInContent; + fnGo = SwCursorSkipMode::Cells == nMode ? GoInContentCells : GoInContent; SwTextFrame const* pFrame(nullptr); if (pLayout) diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx index 1a9f39c3aab7..e0296697b281 100644 --- a/sw/source/core/doc/docruby.cxx +++ b/sw/source/core/doc/docruby.cxx @@ -305,7 +305,7 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry ) nWordEnd = nEnd; } } - pTNd->GoNext( &pPos->nContent, CRSR_SKIP_CHARS ); + pTNd->GoNext( &pPos->nContent, SwCursorSkipMode::Chars ); nStart = pPos->nContent.GetIndex(); } diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 3bd176e3d219..a47df255be00 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1284,7 +1284,7 @@ SwFormatColl *SwContentNode::ChgFormatColl( SwFormatColl *pNewColl ) return pOldColl; } -bool SwContentNode::GoNext(SwContentIndex * pIdx, sal_uInt16 nMode ) const +bool SwContentNode::GoNext(SwContentIndex * pIdx, SwCursorSkipMode nMode ) const { bool bRet = true; if( pIdx->GetIndex() < Len() ) @@ -1297,7 +1297,7 @@ bool SwContentNode::GoNext(SwContentIndex * pIdx, sal_uInt16 nMode ) const sal_Int32 nPos = pIdx->GetIndex(); assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is()); sal_Int32 nDone = 0; - sal_uInt16 nItrMode = ( CRSR_SKIP_CELLS & nMode ) ? + sal_uInt16 nItrMode = ( SwCursorSkipMode::Cells & nMode ) ? CharacterIteratorMode::SKIPCELL : CharacterIteratorMode::SKIPCONTROLCHARACTER; nPos = g_pBreakIt->GetBreakIter()->nextCharacters( rTNd.GetText(), nPos, @@ -1305,7 +1305,7 @@ bool SwContentNode::GoNext(SwContentIndex * pIdx, sal_uInt16 nMode ) const nItrMode, 1, nDone ); // Check if nPos is inside hidden text range: - if ( CRSR_SKIP_HIDDEN & nMode ) + if ( SwCursorSkipMode::Hidden & nMode ) { sal_Int32 nHiddenStart; sal_Int32 nHiddenEnd; @@ -1325,7 +1325,7 @@ bool SwContentNode::GoNext(SwContentIndex * pIdx, sal_uInt16 nMode ) const return bRet; } -bool SwContentNode::GoPrevious(SwContentIndex * pIdx, sal_uInt16 nMode ) const +bool SwContentNode::GoPrevious(SwContentIndex * pIdx, SwCursorSkipMode nMode ) const { bool bRet = true; if( pIdx->GetIndex() > 0 ) @@ -1338,7 +1338,7 @@ bool SwContentNode::GoPrevious(SwContentIndex * pIdx, sal_uInt16 nMode ) const sal_Int32 nPos = pIdx->GetIndex(); assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is()); sal_Int32 nDone = 0; - sal_uInt16 nItrMode = ( CRSR_SKIP_CELLS & nMode ) ? + sal_uInt16 nItrMode = ( SwCursorSkipMode::Cells & nMode ) ? CharacterIteratorMode::SKIPCELL : CharacterIteratorMode::SKIPCONTROLCHARACTER; nPos = g_pBreakIt->GetBreakIter()->previousCharacters( rTNd.GetText(), nPos, @@ -1346,7 +1346,7 @@ bool SwContentNode::GoPrevious(SwContentIndex * pIdx, sal_uInt16 nMode ) const nItrMode, 1, nDone ); // Check if nPos is inside hidden text range: - if ( CRSR_SKIP_HIDDEN & nMode ) + if ( SwCursorSkipMode::Hidden & nMode ) { sal_Int32 nHiddenStart; sal_Int32 nHiddenEnd; diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 41a885c855ce..9818a621b049 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -684,7 +684,7 @@ SvtScriptType SwEditShell::GetScriptType() const if( nPos ) { SwContentIndex aIdx( pStt->nContent ); - if( pTNd->GoPrevious( &aIdx, CRSR_SKIP_CHARS ) ) + if( pTNd->GoPrevious( &aIdx, SwCursorSkipMode::Chars ) ) nPos = aIdx.GetIndex(); } diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 852202b8035d..adcc69ba4bce 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -1022,9 +1022,9 @@ void SwEditShell::SetExtTextInputData( const CommandExtTextInputData& rData ) { auto nOldPos = pCurrentCursor->GetPoint()->nContent.GetIndex(); if (bLeft) - Left(1, CRSR_SKIP_CHARS); + Left(1, SwCursorSkipMode::Chars); else - Right(1, CRSR_SKIP_CHARS); + Right(1, SwCursorSkipMode::Chars); auto nNewPos = pCurrentCursor->GetPoint()->nContent.GetIndex(); // expected success diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index e9465eed91d8..1c946b2d4592 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1617,7 +1617,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > const & xAl while(*pCursor->GetPoint() < aEnd) { // #125786 in table cell with fixed row height the cursor might not move forward - if(!GetSh()->Right(1, CRSR_SKIP_CELLS)) + if(!GetSh()->Right(1, SwCursorSkipMode::Cells)) break; bool bField = false; @@ -1672,7 +1672,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > const & xAl if(bField) { *pCursor->GetMark() = *pCursor->GetPoint(); - GetSh()->Right(1, CRSR_SKIP_CELLS); + GetSh()->Right(1, SwCursorSkipMode::Cells); CreatePortion(xAlt, pGrammarResult, true, false); aStart = *pCursor->End(); } diff --git a/sw/source/core/inc/pamtyp.hxx b/sw/source/core/inc/pamtyp.hxx index 636ce8c3b76b..e8ba4c3cda26 100644 --- a/sw/source/core/inc/pamtyp.hxx +++ b/sw/source/core/inc/pamtyp.hxx @@ -36,6 +36,7 @@ class SwNodeIndex; class SwContentNode; class SwContentIndex; class SvxSearchItem; +enum class SwCursorSkipMode; namespace i18nutil { struct SearchOptions2; @@ -50,13 +51,13 @@ void GoEndSection( SwPosition*); const SwTextAttr* GetFrwrdTextHint( const SwpHints&, size_t&, sal_Int32 ); const SwTextAttr* GetBkwrdTextHint( const SwpHints&, size_t&, sal_Int32 ); -bool GoNext(SwNode* pNd, SwContentIndex * pIdx, sal_uInt16 nMode ); -bool GoPrevious(SwNode* pNd, SwContentIndex * pIdx, sal_uInt16 nMode ); +bool GoNext(SwNode* pNd, SwContentIndex * pIdx, SwCursorSkipMode nMode ); +bool GoPrevious(SwNode* pNd, SwContentIndex * pIdx, SwCursorSkipMode nMode ); SwContentNode* GoNextNds( SwNodeIndex * pIdx, bool ); SwContentNode* GoPreviousNds( SwNodeIndex * pIdx, bool ); // type definitions of functions -typedef bool (*GoNd)( SwNode*, SwContentIndex*, sal_uInt16 ); +typedef bool (*GoNd)( SwNode*, SwContentIndex*, SwCursorSkipMode ); typedef SwContentNode* (*GoNds)( SwNodeIndex*, bool ); typedef void (*GoDoc)( SwPosition* ); typedef void (*GoSection)( SwPosition* ); diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 1e9e74e33736..c28042bf7bcd 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -1627,7 +1627,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() !mrSh.SelectHiddenRange() ) { // Select the hyperlink: - mrSh.SwCursorShell::Right( 1, CRSR_SKIP_CHARS ); + mrSh.SwCursorShell::Right( 1, SwCursorSkipMode::Chars ); if ( mrSh.SwCursorShell::SelectTextAttr( RES_TXTATR_INETFMT, true ) ) { // First, we create the destination, because there may be more @@ -1861,7 +1861,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() continue; // Select the field: mrSh.SwCursorShell::SetMark(); - mrSh.SwCursorShell::Right( 1, CRSR_SKIP_CHARS ); + mrSh.SwCursorShell::Right( 1, SwCursorSkipMode::Chars ); // Link Rectangles SwRects aTmp; @@ -1954,7 +1954,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() // Select the footnote: mrSh.SwCursorShell::SetMark(); - mrSh.SwCursorShell::Right( 1, CRSR_SKIP_CHARS ); + mrSh.SwCursorShell::Right( 1, SwCursorSkipMode::Chars ); // Link Rectangle SwRects aTmp; @@ -2227,7 +2227,7 @@ void SwEnhancedPDFExportHelper::ExportAuthorityEntryLinks() // Select the field. mrSh.SwCursorShell::SetMark(); - mrSh.SwCursorShell::Right(1, CRSR_SKIP_CHARS); + mrSh.SwCursorShell::Right(1, SwCursorSkipMode::Chars); // Create the links. for (const auto& rLinkRect : *mrSh.SwCursorShell::GetCursor_()) diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 057b69878e10..ac49662e9854 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2438,7 +2438,7 @@ void SwViewShell::ImplApplyViewOptions( const SwViewOption &rOpt ) || IsCursorInFieldmarkHidden(*pSh->GetCursor(), pSh->GetLayout()->GetFieldmarkMode())) { // move cursor out of field - pSh->Left(1, CRSR_SKIP_CHARS); + pSh->Left(1, SwCursorSkipMode::Chars); } } } diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 82839c6bf414..74fbcb1a6172 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1149,7 +1149,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, if( !rSh.IsEndPara() ) { rSh.SwEditShell::SplitNode(); - rSh.SwCursorShell::Left(1,CRSR_SKIP_CHARS); + rSh.SwCursorShell::Left(1,SwCursorSkipMode::Chars); } rSh.DoUndo( false ); diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index a3386f333398..2b1190a2f509 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -80,7 +80,7 @@ void SwFieldEditDlg::EnsureSelection(SwField *pCurField, SwFieldMgr &rMgr) //After this attempt it is possible that rMgr.GetCurField() != pCurField if //the field was in e.g. a zero height portion and so invisible in which //case it will be skipped over - pSh->Right(CRSR_SKIP_CHARS, true, 1, false ); + pSh->Right(SwCursorSkipMode::Chars, true, 1, false ); //So (fdo#50640) if it didn't work then reposition back to the original //location where the field was SwField *pRealCurField = rMgr.GetCurField(); diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index 5cdad12d3bf1..f468ae51c662 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -42,14 +42,14 @@ void SwInsFootNoteDlg::Apply() if (m_bEdit) { m_rSh.StartAction(); - m_rSh.Left(CRSR_SKIP_CHARS, false, 1, false ); + m_rSh.Left(SwCursorSkipMode::Chars, false, 1, false ); m_rSh.StartUndo( SwUndoId::START ); SwFormatFootnote aNote( m_xEndNoteBtn->get_active() ); aNote.SetNumStr( aStr ); if (m_rSh.SetCurFootnote( aNote ) && m_bExtCharAvailable) { - m_rSh.Right(CRSR_SKIP_CHARS, true, 1, false ); + m_rSh.Right(SwCursorSkipMode::Chars, true, 1, false ); SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet(m_rSh.GetAttrPool()); m_rSh.GetCurAttr(aSet); const SvxFontItem &rFont = aSet.Get( RES_CHRATR_FONT ); @@ -59,7 +59,7 @@ void SwInsFootNoteDlg::Apply() aSet.Put( aFont ); m_rSh.SetAttrSet( aSet, SetAttrMode::DONTEXPAND ); m_rSh.ResetSelect(nullptr, false); - m_rSh.Left(CRSR_SKIP_CHARS, false, 1, false ); + m_rSh.Left(SwCursorSkipMode::Chars, false, 1, false ); } m_rSh.EndUndo( SwUndoId::END ); m_rSh.EndAction(); @@ -199,7 +199,7 @@ void SwInsFootNoteDlg::Init() { sNumStr = aFootnoteNote.GetNumStr(); - m_rSh.Right(CRSR_SKIP_CHARS, true, 1, false ); + m_rSh.Right(SwCursorSkipMode::Chars, true, 1, false ); SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet(m_rSh.GetAttrPool()); m_rSh.GetCurAttr(aSet); const SvxFontItem &rFont = aSet.Get( RES_CHRATR_FONT ); @@ -209,7 +209,7 @@ void SwInsFootNoteDlg::Init() aFont.SetFamilyName(m_aFontName); aFont.SetCharSet(m_eCharSet); m_bExtCharAvailable = true; - m_rSh.Left( CRSR_SKIP_CHARS, false, 1, false ); ... etc. - the rest is truncated
