diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-24 12:22:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-25 08:29:03 +0200 |
commit | 834770170248695a4994f879fe627f6d044b2db8 (patch) | |
tree | ad31f95a08088768e29b428eec29370267152078 /sw | |
parent | dd06a8a2caf93707fbf29c7264cf41f8ec9d4c6d (diff) |
convert CursorMoveState to scoped enum
Change-Id: Ie5071ca1e663213da7c0db392be20957587517ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92870
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/crstate.hxx | 18 | ||||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 40 | ||||
-rw-r--r-- | sw/source/core/crsr/swcrsr.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docfly.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/frmedt/fecopy.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/frmedt/fefly1.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/layout/flycnt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/trvlfrm.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/text/frmcrsr.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/text/itrcrsr.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/view/vprint.cxx | 2 |
16 files changed, 64 insertions, 64 deletions
diff --git a/sw/inc/crstate.hxx b/sw/inc/crstate.hxx index fea6d265df31..c7a67428d2e6 100644 --- a/sw/inc/crstate.hxx +++ b/sw/inc/crstate.hxx @@ -118,14 +118,14 @@ struct SwSpecialPos }; // CursorTravelling-States (for GetModelPositionForViewPoint) -enum CursorMoveState +enum class CursorMoveState { - MV_NONE, ///< default - MV_UPDOWN, ///< Cursor Up/Down - MV_RIGHTMARGIN, ///< at right margin - MV_LEFTMARGIN, ///< at left margin - MV_SETONLYTEXT, ///< stay with the cursor inside text - MV_TBLSEL ///< not in repeated headlines + NONE, ///< default + UpDown, ///< Cursor Up/Down + RightMargin, ///< at right margin + LeftMargin, ///< at left margin + SetOnlyText, ///< stay with the cursor inside text + TableSel ///< not in repeated headlines }; // struct for later extensions @@ -163,7 +163,7 @@ struct SwCursorMoveState bool m_bInNumPortion; ///< point is in number portion #i23726# int m_nInNumPortionOffset; ///< distance from number portion's start - SwCursorMoveState( CursorMoveState eSt = MV_NONE ) : + SwCursorMoveState( CursorMoveState eSt = CursorMoveState::NONE ) : m_pFill( nullptr ), m_pSpecialPos( nullptr ), m_eState( eSt ), @@ -188,7 +188,7 @@ struct SwCursorMoveState SwCursorMoveState( SwFillCursorPos *pInitFill ) : m_pFill( pInitFill ), m_pSpecialPos( nullptr ), - m_eState( MV_SETONLYTEXT ), + m_eState( CursorMoveState::SetOnlyText ), m_nCursorBidiLevel( 0 ), m_bStop( false ), m_bRealHeight( false ), diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index be9b4e2d0f09..b05edef7ee4d 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3262,7 +3262,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell) Point aPoint; aPoint.setX(nSecondParaLeft + nSecondParaWidth / 2); aPoint.setY(nSecondParaTop + nSecondParaHeight - 100); - SwCursorMoveState aState(MV_NONE); + SwCursorMoveState aState(CursorMoveState::NONE); pLayout->GetModelPositionForViewPoint(&aPosition, aPoint, &aState); CPPUNIT_ASSERT_EQUAL(aCellStart.nNode.GetIndex() + 1, aPosition.nNode.GetIndex()); // Without the accompanying fix in place, this test would have failed: character position was 5, @@ -3734,7 +3734,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128399) SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SwPosition aPosition = *pWrtShell->GetCursor()->Start(); SwPosition aFirstRow(aPosition); - SwCursorMoveState aState(MV_NONE); + SwCursorMoveState aState(CursorMoveState::NONE); pLayout->GetModelPositionForViewPoint(&aPosition, aPoint, &aState); // Second row is +3: end node, start node and the first text node in the 2nd row. sal_uLong nExpected = aFirstRow.nNode.GetIndex() + 3; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 16ccab6ef876..014c515a81f0 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -515,7 +515,7 @@ bool SwCursorShell::UpDown( bool bUp, sal_uInt16 nCnt ) if( bRet ) { - m_eMvState = MV_UPDOWN; // status for Cursor travelling - GetModelPositionForViewPoint + m_eMvState = CursorMoveState::UpDown; // status for Cursor travelling - GetModelPositionForViewPoint if( !ActionPend() ) { CursorFlag eUpdateMode = SwCursorShell::SCROLLWIN; @@ -532,7 +532,7 @@ bool SwCursorShell::LRMargin( bool bLeft, bool bAPI) { SwCallLink aLk( *this ); // watch Cursor-Moves; call Link if needed SET_CURR_SHELL( this ); - m_eMvState = MV_LEFTMARGIN; // status for Cursor travelling - GetModelPositionForViewPoint + m_eMvState = CursorMoveState::LeftMargin; // status for Cursor travelling - GetModelPositionForViewPoint const bool bTableMode = IsTableMode(); SwShellCursor* pTmpCursor = getShellCursor( true ); @@ -763,8 +763,8 @@ int SwCursorShell::SetCursor( const Point &rLPt, bool bOnlyText, bool bBlock ) SwPosition aPos( *pCursor->GetPoint() ); Point aPt( rLPt ); Point & rCurrentCursorPt = pCursor->GetPtPos(); - SwCursorMoveState aTmpState( IsTableMode() ? MV_TBLSEL : - bOnlyText ? MV_SETONLYTEXT : MV_NONE ); + SwCursorMoveState aTmpState( IsTableMode() ? CursorMoveState::TableSel : + bOnlyText ? CursorMoveState::SetOnlyText : CursorMoveState::NONE ); aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable(); SwTextNode const*const pTextNd = sw::GetParaPropsNode(*GetLayout(), pCursor->GetPoint()->nNode); @@ -790,8 +790,8 @@ int SwCursorShell::SetCursor( const Point &rLPt, bool bOnlyText, bool bBlock ) pCursor->SetCursorBidiLevel( aTmpState.m_nCursorBidiLevel ); - if( MV_RIGHTMARGIN == aTmpState.m_eState ) - m_eMvState = MV_RIGHTMARGIN; + if( CursorMoveState::RightMargin == aTmpState.m_eState ) + m_eMvState = CursorMoveState::RightMargin; // is the new position in header or footer? SwFrame* pFrame = lcl_IsInHeaderFooter( aPos.nNode, aPt ); if( IsTableMode() && !pFrame && aPos.nNode.GetNode().StartOfSectionNode() == @@ -878,7 +878,7 @@ int SwCursorShell::SetCursor( const Point &rLPt, bool bOnlyText, bool bBlock ) { // there is no valid content -> hide cursor m_pVisibleCursor->Hide(); // always hide visible cursor - m_eMvState = MV_NONE; // status for Cursor travelling + m_eMvState = CursorMoveState::NONE; // status for Cursor travelling m_bAllProtect = true; if( GetDoc()->GetDocShell() ) { @@ -1000,7 +1000,7 @@ bool SwCursorShell::TestCurrPam( SwPosition aPtPos( *m_pCurrentCursor->GetPoint() ); Point aPt( rPt ); - SwCursorMoveState aTmpState( MV_NONE ); + SwCursorMoveState aTmpState( CursorMoveState::NONE ); aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable(); if ( !GetLayout()->GetModelPositionForViewPoint( &aPtPos, aPt, &aTmpState ) && bTstHit ) return false; @@ -1491,7 +1491,7 @@ void SwCursorShell::UpdateCursorPos() if( isInHiddenTextFrame(pShellCursor) ) { - SwCursorMoveState aTmpState( MV_NONE ); + SwCursorMoveState aTmpState( CursorMoveState::NONE ); aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable(); GetLayout()->GetModelPositionForViewPoint( pShellCursor->GetPoint(), pShellCursor->GetPtPos(), &aTmpState ); @@ -1694,7 +1694,7 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd ) } } - SwCursorMoveState aTmpState( MV_NONE ); + SwCursorMoveState aTmpState( CursorMoveState::NONE ); aTmpState.m_bRealHeight = true; { DisableCallbackAction a(*GetLayout()); @@ -1741,7 +1741,7 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd ) -m_aCharRect.Width() : m_aCharRect.Height()); m_pVisibleCursor->Show(); // show again } - m_eMvState = MV_NONE; // state for cursor travelling - GetModelPositionForViewPoint + m_eMvState = CursorMoveState::NONE; // state for cursor travelling - GetModelPositionForViewPoint if (Imp()->IsAccessible()) Imp()->InvalidateAccessibleCursorPosition( pTableFrame ); return; @@ -1782,7 +1782,7 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd ) bChgState = false; else { - m_eMvState = MV_NONE; // state for cursor travelling + m_eMvState = CursorMoveState::NONE; // state for cursor travelling m_bAllProtect = true; if( GetDoc()->GetDocShell() ) { @@ -1882,7 +1882,7 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd ) bChgState = false; else { - m_eMvState = MV_NONE; // state for cursor travelling + m_eMvState = CursorMoveState::NONE; // state for cursor travelling m_bAllProtect = true; if( GetDoc()->GetDocShell() ) { @@ -2012,7 +2012,7 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd ) } } - m_eMvState = MV_NONE; // state for cursor travelling - GetModelPositionForViewPoint + m_eMvState = CursorMoveState::NONE; // state for cursor travelling - GetModelPositionForViewPoint if (Imp()->IsAccessible()) Imp()->InvalidateAccessibleCursorPosition( pFrame ); @@ -2640,7 +2640,7 @@ bool SwCursorShell::SetVisibleCursor( const Point &rPt ) SET_CURR_SHELL( this ); Point aPt( rPt ); SwPosition aPos( *m_pCurrentCursor->GetPoint() ); - SwCursorMoveState aTmpState( MV_SETONLYTEXT ); + SwCursorMoveState aTmpState( CursorMoveState::SetOnlyText ); aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable(); aTmpState.m_bRealHeight = true; @@ -2921,7 +2921,7 @@ SwCursorShell::SwCursorShell( SwCursorShell& rShell, vcl::Window *pInitWin ) , m_nCurrentContent(0) , m_nCurrentNdTyp(SwNodeType::NONE) , m_nCursorMove( 0 ) - , m_eMvState( MV_NONE ) + , m_eMvState( CursorMoveState::NONE ) , m_eEnhancedTableSel(SwTable::SEARCH_NONE) , m_sMarkedListId() , m_nMarkedListLevel( 0 ) @@ -2958,7 +2958,7 @@ SwCursorShell::SwCursorShell( SwDoc& rDoc, vcl::Window *pInitWin, , m_nCurrentContent(0) , m_nCurrentNdTyp(SwNodeType::NONE) , m_nCursorMove( 0 ) - , m_eMvState( MV_NONE ) // state for crsr-travelling - GetModelPositionForViewPoint + , m_eMvState( CursorMoveState::NONE ) // state for crsr-travelling - GetModelPositionForViewPoint , m_eEnhancedTableSel(SwTable::SEARCH_NONE) , m_sMarkedListId() , m_nMarkedListLevel( 0 ) @@ -3263,7 +3263,7 @@ bool SwCursorShell::FindValidContentNode( bool bOnlyText ) // if cursor in hidden frame, always move it if (!pCNd || !pCNd->getLayoutFrame(GetLayout(), nullptr, nullptr)) { - SwCursorMoveState aTmpState( MV_NONE ); + SwCursorMoveState aTmpState( CursorMoveState::NONE ); aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable(); GetLayout()->GetModelPositionForViewPoint( m_pCurrentCursor->GetPoint(), m_pCurrentCursor->GetPtPos(), &aTmpState ); @@ -3380,7 +3380,7 @@ SvxFrameDirection SwCursorShell::GetTextDirection( const Point* pPt ) const Point aPt( pPt ? *pPt : m_pCurrentCursor->GetPtPos() ); if( pPt ) { - SwCursorMoveState aTmpState( MV_NONE ); + SwCursorMoveState aTmpState( CursorMoveState::NONE ); aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable(); GetLayout()->GetModelPositionForViewPoint( &aPos, aPt, &aTmpState ); @@ -3730,7 +3730,7 @@ void SwCursorShell::GetSmartTagRect( const Point& rPt, SwRect& rSelectRect ) SwPaM* pCursor = GetCursor(); SwPosition aPos( *pCursor->GetPoint() ); Point aPt( rPt ); - SwCursorMoveState eTmpState( MV_SETONLYTEXT ); + SwCursorMoveState eTmpState( CursorMoveState::SetOnlyText ); SwSpecialPos aSpecialPos; eTmpState.m_pSpecialPos = &aSpecialPos; SwTextNode *pNode; diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 08c914b8c67a..6067bfe414d4 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -2018,7 +2018,7 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt, DisableCallbackAction a(rLayout); std::pair<Point, bool> const tmp(aPt, true); pFrame = GetContentNode()->getLayoutFrame(&rLayout, GetPoint(), &tmp); - SwCursorMoveState eTmpState( MV_UPDOWN ); + SwCursorMoveState eTmpState( CursorMoveState::UpDown ); eTmpState.m_bSetInReadOnly = bInReadOnly; SwRect aTmpRect; pFrame->GetCharRect( aTmpRect, *GetPoint(), &eTmpState ); diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 35650f665ee0..c9d7661cc10f 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -238,7 +238,7 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell const * pViewShell) SwPaM* pCursor = m_pCursorShell->GetCursor(); SwPosition aPos(*pCursor->GetPoint()); Point aPt = aRect.Pos(); - SwCursorMoveState eTmpState(MV_SETONLYTEXT); + SwCursorMoveState eTmpState(CursorMoveState::SetOnlyText); SwTextNode *pNode = nullptr; if (m_pCursorShell->GetLayout()->GetModelPositionForViewPoint(&aPos, aPt, &eTmpState)) pNode = aPos.nNode.GetNode().GetTextNode(); diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 7328fe0b763e..ad65549c6fa1 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -807,7 +807,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, // Search the closest SwFlyFrame starting from the upper left corner. SwFrame *pTextFrame; { - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); SwPosition aPos( GetNodes() ); Point aPoint( aPt ); aPoint.setX(aPoint.getX() - 1); @@ -877,7 +877,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, { // We need to find a TextNode, because only there we can anchor a // content-bound DrawObject. - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); getIDocumentLayoutAccess().GetCurrentLayout()->GetModelPositionForViewPoint( &aPos, aPoint, &aState ); } else diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index d50f1aefbfde..a2a4adf3b249 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -898,7 +898,7 @@ uno::Reference< XSpellAlternatives > return nullptr; SwPaM* pCursor = GetCursor(); SwPosition aPos( *pCursor->GetPoint() ); - SwCursorMoveState eTmpState( MV_SETONLYTEXT ); + SwCursorMoveState eTmpState( CursorMoveState::SetOnlyText ); SwTextNode *pNode = nullptr; SwWrongList *pWrong = nullptr; if (pPt && GetLayout()->GetModelPositionForViewPoint( &aPos, *const_cast<Point*>(pPt), &eTmpState )) @@ -965,7 +965,7 @@ bool SwEditShell::GetGrammarCorrection( SwPaM* pCursor = GetCursor(); SwPosition aPos( *pCursor->GetPoint() ); - SwCursorMoveState eTmpState( MV_SETONLYTEXT ); + SwCursorMoveState eTmpState( CursorMoveState::SetOnlyText ); SwTextNode *pNode = nullptr; SwGrammarMarkUp *pWrong = nullptr; if (pPt && GetLayout()->GetModelPositionForViewPoint( &aPos, *const_cast<Point*>(pPt), &eTmpState )) diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 683f5ae08439..2522c039ce0d 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -338,7 +338,7 @@ bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, SwPosition aPos( *GetCursor()->GetPoint() ); Point aPt( rInsPt ); aPt -= rSttPt - pObj->GetSnapRect().TopLeft(); - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); GetLayout()->GetModelPositionForViewPoint( &aPos, aPt, &aState ); const SwNode *pNd; if( (pNd = &aPos.nNode.GetNode())->IsNoTextNode() ) @@ -485,7 +485,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, SwPosition aPos( *GetCursor()->GetPoint() ); Point aPt( rInsPt ); aPt -= rSttPt - pFly->getFrameArea().Pos(); - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); GetLayout()->GetModelPositionForViewPoint( &aPos, aPt, &aState ); const SwNode *pNd; if( (pNd = &aPos.nNode.GetNode())->IsNoTextNode() ) diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 8cec500dc329..4ad00716414c 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -139,7 +139,7 @@ static bool lcl_FindAnchorPos( { // textnode should be found, as only in those // a content bound frame can be anchored - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); aTmpPnt.setX(aTmpPnt.getX() - 1); // do not land in the fly! if( !pNewAnch->GetModelPositionForViewPoint( &aPos, aTmpPnt, &aState ) ) { @@ -172,7 +172,7 @@ static bool lcl_FindAnchorPos( { // starting from the upper-left corner of the Fly // search nearest SwFlyFrame - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); SwPosition aPos( rDoc.GetNodes() ); aTmpPnt.setX(aTmpPnt.getX() - 1); // do not land in the fly! rDoc.getIDocumentLayoutAccess().GetCurrentLayout()->GetModelPositionForViewPoint( &aPos, aTmpPnt, &aState ); @@ -350,7 +350,7 @@ const SwFrameFormat* SwFEShell::IsFlyInFly() SwFrame *pTextFrame; { - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); SwNodeIndex aSwNodeIndex( GetDoc()->GetNodes() ); SwPosition aPos( aSwNodeIndex ); Point aPoint( aTmpPos ); @@ -492,7 +492,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) // of the fly SwContentFrame *pTextFrame = nullptr; { - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); SwPosition aPos( GetDoc()->GetNodes().GetEndOfExtras() ); Point aTmpPnt( rAbsPos ); GetLayout()->GetModelPositionForViewPoint( &aPos, aTmpPnt, &aState ); @@ -942,7 +942,7 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj, // find anchor position SwPaM aPam( mxDoc->GetNodes() ); { - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); Point aTmpPt( rInsertPosition ); GetLayout()->GetModelPositionForViewPoint( aPam.GetPoint(), aTmpPt, &aState ); const SwFrame* pFrame = aPam.GetContentNode()->getLayoutFrame(GetLayout(), nullptr, nullptr); diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 66d7fd61a919..ac98cefd0c63 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1804,7 +1804,7 @@ bool SwFEShell::ImpEndCreate() if( dynamic_cast<const SdrUnoObj*>( &rSdrObj) != nullptr ) { SwPosition aPos( GetDoc()->GetNodes() ); - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); Point aPoint( aPt.getX(), aPt.getY() + rBound.GetHeight()/2 ); GetLayout()->GetModelPositionForViewPoint( &aPos, aPoint, &aState ); @@ -1849,7 +1849,7 @@ bool SwFEShell::ImpEndCreate() bool bBodyOnly = 0xFFFF == nIdent; bool bAtPage = false; const SwFrame* pPage = nullptr; - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); Point aPoint( aPt ); SwPosition aPos( GetDoc()->GetNodes() ); GetLayout()->GetModelPositionForViewPoint( &aPos, aPoint, &aState ); diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index 3ffd236a6559..71f6dff7748f 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -1334,7 +1334,7 @@ void SwFlyAtContentFrame::SetAbsPos( const Point &rNew ) if( IsAutoPos() && pCnt->IsTextFrame() ) { SwTextFrame const*const pTextFrame(static_cast<SwTextFrame const*>(pCnt)); - SwCursorMoveState eTmpState( MV_SETONLYTEXT ); + SwCursorMoveState eTmpState( CursorMoveState::SetOnlyText ); Point aPt( rNew ); if( pCnt->GetModelPositionForViewPoint( &pos, aPt, &eTmpState ) && FrameContainsNode(*pTextFrame, pos.nNode.GetIndex())) diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index f8a5a3b423e0..c7de73e4e0e7 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -479,7 +479,7 @@ bool SwCellFrame::GetModelPositionForViewPoint( SwPosition *pPos, Point &rPoint, GetFormat()->GetProtect().IsContentProtected() ) return false; - if ( pCMS && pCMS->m_eState == MV_TBLSEL ) + if ( pCMS && pCMS->m_eState == CursorMoveState::TableSel ) { const SwTabFrame *pTab = FindTabFrame(); if ( pTab->IsFollow() && pTab->IsInHeadline( *this ) ) @@ -550,7 +550,7 @@ bool SwFlyFrame::GetModelPositionForViewPoint( SwPosition *pPos, Point &rPoint, //If a Frame contains a graphic, but only text was requested, it basically //won't accept the Cursor. - if ( bInside && pCMS && pCMS->m_eState == MV_SETONLYTEXT && + if ( bInside && pCMS && pCMS->m_eState == CursorMoveState::SetOnlyText && (!Lower() || Lower()->IsNoTextFrame()) ) bInside = false; @@ -1323,7 +1323,7 @@ const SwContentFrame *SwLayoutFrame::GetContentPos( Point& rPoint, OSL_ENSURE( !bBodyOnly || pActual->IsInDocBody(), "Content not in Body." ); //Special case for selecting tables not in repeated TableHeadlines. - if ( pActual->IsInTab() && pCMS && pCMS->m_eState == MV_TBLSEL ) + if ( pActual->IsInTab() && pCMS && pCMS->m_eState == CursorMoveState::TableSel ) { const SwTabFrame *pTab = pActual->FindTabFrame(); if ( pTab->IsFollow() && pTab->IsInHeadline( *pActual ) ) @@ -1458,7 +1458,7 @@ void SwPageFrame::GetContentPosition( const Point &rPt, SwPosition &rPos ) const } else { - SwCursorMoveState aTmpState( MV_SETONLYTEXT ); + SwCursorMoveState aTmpState( CursorMoveState::SetOnlyText ); pAct->GetModelPositionForViewPoint( &rPos, aAct, &aTmpState ); } } @@ -2113,7 +2113,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) } } while( false ); - SwCursorMoveState aTmpState( MV_NONE ); + SwCursorMoveState aTmpState( CursorMoveState::NONE ); aTmpState.m_b2Lines = true; aTmpState.m_bNoScroll = true; aTmpState.m_nCursorBidiLevel = pStartFrame->IsRightToLeft() ? 1 : 0; diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index fe268232b1c1..9fd60520c325 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -53,7 +53,7 @@ using namespace ::com::sun::star; /* * - SurvivalKit: For how long do we get past the last char of the line. * - RightMargin abstains from adjusting position with -1 - * - GetCharRect returns a GetEndCharRect for MV_RIGHTMARGIN + * - GetCharRect returns a GetEndCharRect for CursorMoveState::RightMargin * - GetEndCharRect sets bRightMargin to true * - SwTextCursor::bRightMargin is set to false by CharCursorToLine */ @@ -190,7 +190,7 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, // needs to be formatted // Optimisation: reading ahead saves us a GetAdjFrameAtPos - const bool bRightMargin = pCMS && ( MV_RIGHTMARGIN == pCMS->m_eState ); + const bool bRightMargin = pCMS && ( CursorMoveState::RightMargin == pCMS->m_eState ); const bool bNoScroll = pCMS && pCMS->m_bNoScroll; SwTextFrame *pFrame = GetAdjFrameAtPos( const_cast<SwTextFrame*>(this), rPos, bRightMargin, bNoScroll ); @@ -425,7 +425,7 @@ bool SwTextFrame::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const SwTextSizeInfo aInf( pFrame ); SwTextCursor aLine( pFrame, &aInf ); - SwCursorMoveState aTmpState( MV_SETONLYTEXT ); + SwCursorMoveState aTmpState( CursorMoveState::SetOnlyText ); aTmpState.m_bRealHeight = true; aLine.GetCharRect( &rOrig, nOffset, &aTmpState, nMaxY ); if( aTmpState.m_aRealHeight.X() >= 0 ) @@ -603,8 +603,8 @@ bool SwTextFrame::GetModelPositionForViewPoint_(SwPosition* pPos, const Point& r TextFrameIndex nOffset = aLine.GetModelPositionForViewPoint(pPos, rPoint, bChgFrame, pCMS); - if( pCMS && pCMS->m_eState == MV_NONE && aLine.GetEnd() == nOffset ) - pCMS->m_eState = MV_RIGHTMARGIN; + if( pCMS && pCMS->m_eState == CursorMoveState::NONE && aLine.GetEnd() == nOffset ) + pCMS->m_eState = CursorMoveState::RightMargin; // pPos is a pure IN parameter and must not be evaluated. // pIter->GetModelPositionForViewPoint returns from a nesting with COMPLETE_STRING. @@ -661,7 +661,7 @@ bool SwTextFrame::GetModelPositionForViewPoint_(SwPosition* pPos, const Point& r bool SwTextFrame::GetModelPositionForViewPoint(SwPosition* pPos, Point& rPoint, SwCursorMoveState* pCMS, bool ) const { - const bool bChgFrame = !(pCMS && MV_UPDOWN == pCMS->m_eState); + const bool bChgFrame = !(pCMS && CursorMoveState::UpDown == pCMS->m_eState); return GetModelPositionForViewPoint_( pPos, rPoint, bChgFrame, pCMS ); } diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index f7c116d3ac91..acf24d67c597 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -1296,7 +1296,7 @@ TextFrameIndex SwTextCursor::GetModelPositionForViewPoint( SwPosition *pPos, con if( bRightOver ) x = nRightMargin; - const bool bRightAllowed = pCMS && ( pCMS->m_eState == MV_NONE ); + const bool bRightAllowed = pCMS && ( pCMS->m_eState == CursorMoveState::NONE ); // Until here everything in document coordinates. x -= nLeftMargin; @@ -1843,7 +1843,7 @@ bool SwTextFrame::FillSelection( SwSelectionList& rSelList, const SwRect& rRect } // Looking for the position of the left border of the rectangle // in this text line - SwCursorMoveState aState( MV_UPDOWN ); + SwCursorMoveState aState( CursorMoveState::UpDown ); if( GetModelPositionForViewPoint( &aPosL, aPoint, &aState ) ) { if( aRectFnSet.IsVert() ) diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 8bf844d4ba9f..b094b87653cf 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -686,7 +686,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) } else if ((aAnchor.GetAnchorId() != RndStdIds::FLY_AT_PAGE) && pDoc->getIDocumentLayoutAccess().GetCurrentLayout()) { - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); Point aTmp(convertMm100ToTwip(aMM100Pos.X), convertMm100ToTwip(aMM100Pos.Y)); pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetModelPositionForViewPoint( pPam->GetPoint(), aTmp, &aState ); aAnchor.SetAnchor( pPam->GetPoint() ); @@ -1265,7 +1265,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SwPaM aPam(pDoc->GetNodes().GetEndOfContent()); if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ) { - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); Point aTmp( pObj->GetSnapRect().TopLeft() ); pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetModelPositionForViewPoint( aPam.GetPoint(), aTmp, &aState ); } @@ -1286,7 +1286,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SwPaM aPam(pDoc->GetNodes().GetEndOfContent()); if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ) { - SwCursorMoveState aState( MV_SETONLYTEXT ); + SwCursorMoveState aState( CursorMoveState::SetOnlyText ); Point aTmp( pObj->GetSnapRect().TopLeft() ); pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetModelPositionForViewPoint( aPam.GetPoint(), aTmp, &aState ); } diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index be73000769d9..5dbf21b716d9 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -344,7 +344,7 @@ void SwViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt) if( pContentFrame ) { SwRect aCharRect; - SwCursorMoveState aTmpState( MV_NONE ); + SwCursorMoveState aTmpState( CursorMoveState::NONE ); pContentFrame->GetCharRect( aCharRect, *pShellTableCursor->Start(), &aTmpState ); aSelPoint = Point( aCharRect.Left(), aCharRect.Top() ); } |