[Libreoffice-commits] core.git: sw/inc sw/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Nov 29 10:50:06 UTC 2016


 sw/inc/swcrsr.hxx                  |   28 +++++++++--------
 sw/inc/unocrsr.hxx                 |   16 ++++-----
 sw/source/core/crsr/crbm.cxx       |    4 +-
 sw/source/core/crsr/crsrsh.cxx     |   18 +++++------
 sw/source/core/crsr/crstrvl.cxx    |   24 +++++++-------
 sw/source/core/crsr/swcrsr.cxx     |   60 ++++++++++++++++++-------------------
 sw/source/core/crsr/trvlfnfl.cxx   |    8 ++--
 sw/source/core/crsr/trvltbl.cxx    |    4 +-
 sw/source/core/unocore/unocrsr.cxx |    4 +-
 9 files changed, 84 insertions(+), 82 deletions(-)

New commits:
commit 3c9c5214a331041f4d19275c707e29a6aff89fa6
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Nov 29 10:07:28 2016 +0200

    convert SwCursorSelOverFlags to o3tl::typed_flags
    
    Change-Id: I399db07f508e5aeba005c8c6746cf5adc42702d2
    Reviewed-on: https://gerrit.libreoffice.org/31350
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index 0f9ab9f..8426737 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -46,14 +46,16 @@ protected:
     ~SwFindParas() {}
 };
 
-typedef sal_uInt16 SwCursorSelOverFlags;
-namespace nsSwCursorSelOverFlags
+enum class SwCursorSelOverFlags : sal_uInt16
 {
-    const SwCursorSelOverFlags SELOVER_NONE                = 0x00;
-    const SwCursorSelOverFlags SELOVER_CHECKNODESSECTION   = 0x01;
-    const SwCursorSelOverFlags SELOVER_TOGGLE              = 0x02;
-    const SwCursorSelOverFlags SELOVER_ENABLEREVDIREKTION  = 0x04;
-    const SwCursorSelOverFlags SELOVER_CHANGEPOS           = 0x08;
+    NONE                = 0x00,
+    CheckNodeSection    = 0x01,
+    Toggle              = 0x02,
+    EnableRevDirection  = 0x04,
+    ChangePos           = 0x08
+};
+namespace o3tl {
+    template<> struct typed_flags<SwCursorSelOverFlags> : is_typed_flags<SwCursorSelOverFlags, 0x0f> {};
 }
 
 // define for cursor travelling normally in western text cells and chars do
@@ -89,7 +91,7 @@ protected:
     virtual const SwContentFrame* DoSetBidiLevelLeftRight(
         bool & io_rbLeft, bool bVisualAllowed, bool bInsertCursor);
     virtual void DoSetBidiLevelUpDown();
-    virtual bool IsSelOvrCheck(int eFlags);
+    virtual bool IsSelOvrCheck(SwCursorSelOverFlags eFlags);
 
 public:
     // single argument ctors shall be explicit.
@@ -191,10 +193,10 @@ public:
 
     // Is there a selection of content in table?
     // Return value indicates if cursor remains at its old position.
-    virtual bool IsSelOvr( int eFlags =
-                                ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
-                                  nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                                  nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ));
+    virtual bool IsSelOvr( SwCursorSelOverFlags eFlags =
+                                ( SwCursorSelOverFlags::CheckNodeSection |
+                                  SwCursorSelOverFlags::Toggle |
+                                  SwCursorSelOverFlags::ChangePos ));
     bool IsInProtectTable( bool bMove = false,
                                    bool bChgCursor = true );
     bool IsNoContent() const;
@@ -267,7 +269,7 @@ protected:
     bool m_bChanged : 1;
     bool m_bParked : 1;       // Table-cursor was parked.
 
-    virtual bool IsSelOvrCheck(int eFlags) override;
+    virtual bool IsSelOvrCheck(SwCursorSelOverFlags eFlags) override;
 
 public:
     SwTableCursor( const SwPosition &rPos );
diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx
index ac6b848..55a91cc 100644
--- a/sw/inc/unocrsr.hxx
+++ b/sw/inc/unocrsr.hxx
@@ -62,10 +62,10 @@ public:
 
     // Does a selection of content exist in table?
     // Return value indicates if the cursor remains at its old position.
-    virtual bool IsSelOvr( int eFlags =
-                                ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
-                                  nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                                  nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )) override;
+    virtual bool IsSelOvr( SwCursorSelOverFlags eFlags =
+                                ( SwCursorSelOverFlags::CheckNodeSection |
+                                  SwCursorSelOverFlags::Toggle |
+                                  SwCursorSelOverFlags::ChangePos )) override;
 
     virtual bool IsReadOnlyAvailable() const override;
 
@@ -100,10 +100,10 @@ public:
 
     // Does a selection of content exist in table?
     // Return value indicates if the cursor remains at its old position.
-    virtual bool IsSelOvr( int eFlags =
-                                ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
-                                  nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                                  nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )) override;
+    virtual bool IsSelOvr( SwCursorSelOverFlags eFlags =
+                                ( SwCursorSelOverFlags::CheckNodeSection |
+                                  SwCursorSelOverFlags::Toggle |
+                                  SwCursorSelOverFlags::ChangePos )) override;
 
     void MakeBoxSels();
 
diff --git a/sw/source/core/crsr/crbm.cxx b/sw/source/core/crsr/crbm.cxx
index 946af35..11f405d 100644
--- a/sw/source/core/crsr/crbm.cxx
+++ b/sw/source/core/crsr/crbm.cxx
@@ -50,8 +50,8 @@ namespace
         /// returns true if the Cursor had been rolled back
         bool RollbackIfIllegal()
         {
-            if(m_pCursor->IsSelOvr(nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION
-                | nsSwCursorSelOverFlags::SELOVER_TOGGLE))
+            if(m_pCursor->IsSelOvr(SwCursorSelOverFlags::CheckNodeSection
+                | SwCursorSelOverFlags::Toggle))
             {
                 m_pCursor->DeleteMark();
                 m_pCursor->RestoreSavePos();
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 618b0e8..a6eeb6f 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -656,8 +656,8 @@ bool SwCursorShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage )
                             getLayoutFrame( GetLayout(), &rPt, m_pCurrentCursor->GetPoint(), false );
         if( pFrame && ( bRet = GetFrameInPage( pFrame, fnWhichPage,
                                            fnPosPage, m_pCurrentCursor )  ) &&
-            !m_pCurrentCursor->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                                 nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ))
+            !m_pCurrentCursor->IsSelOvr( SwCursorSelOverFlags::Toggle |
+                                 SwCursorSelOverFlags::ChangePos ))
             UpdateCursor();
         else
             bRet = false;
@@ -833,7 +833,7 @@ int SwCursorShell::SetCursor( const Point &rLPt, bool bOnlyText, bool bBlock )
         m_pCurrentCursor->SetInFrontOfLabel_( !bNewInFrontOfLabel );
     SetInFrontOfLabel( bNewInFrontOfLabel );
 
-    if( !pCursor->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
+    if( !pCursor->IsSelOvr( SwCursorSelOverFlags::ChangePos ) )
     {
         sal_uInt16 nFlag = SwCursorShell::SCROLLWIN | SwCursorShell::CHKRANGE;
         UpdateCursor( nFlag );
@@ -1096,8 +1096,8 @@ bool SwCursorShell::GotoPage( sal_uInt16 nPage )
     SwCallLink aLk( *this ); // watch Cursor-Moves; call Link if needed
     SwCursorSaveState aSaveState( *m_pCurrentCursor );
     bool bRet = GetLayout()->SetCurrPage( m_pCurrentCursor, nPage ) &&
-                    !m_pCurrentCursor->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                                         nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
+                    !m_pCurrentCursor->IsSelOvr( SwCursorSelOverFlags::Toggle |
+                                         SwCursorSelOverFlags::ChangePos );
     if( bRet )
         UpdateCursor(SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE|SwCursorShell::READONLY);
     return bRet;
@@ -2070,8 +2070,8 @@ bool SwCursorShell::Pop( bool bOldCursor )
         delete pOldStack;
 
         if( !m_pCurrentCursor->IsInProtectTable( true ) &&
-            !m_pCurrentCursor->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                                 nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
+            !m_pCurrentCursor->IsSelOvr( SwCursorSelOverFlags::Toggle |
+                                 SwCursorSelOverFlags::ChangePos ) )
             UpdateCursor(); // update current cursor
     }
     return true;
@@ -2108,8 +2108,8 @@ void SwCursorShell::Combine()
     m_pCursorStack->MoveTo(nullptr); // remove from ring
     m_pCursorStack = pTmp;
     if( !m_pCurrentCursor->IsInProtectTable( true ) &&
-        !m_pCurrentCursor->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                             nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
+        !m_pCurrentCursor->IsSelOvr( SwCursorSelOverFlags::Toggle |
+                             SwCursorSelOverFlags::ChangePos ) )
     {
         UpdateCursor(); // update current cursor
     }
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 6099b32..e171b23 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -96,8 +96,8 @@ void SwCursorShell::MoveCursorToNum()
         aPt.setX(pFrame->Frame().Left() + GetUpDownX());
     }
     pFrame->GetCursorOfst( m_pCurrentCursor->GetPoint(), aPt );
-    if ( !m_pCurrentCursor->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                                nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ))
+    if ( !m_pCurrentCursor->IsSelOvr( SwCursorSelOverFlags::Toggle |
+                                SwCursorSelOverFlags::ChangePos ))
     {
         UpdateCursor(SwCursorShell::UPDOWN |
                 SwCursorShell::SCROLLWIN | SwCursorShell::CHKRANGE |
@@ -774,8 +774,8 @@ bool SwCursorShell::MoveFieldType(
     SwCursorSaveState aSaveState( *pCursor );
 
     rFnd.GetPosOfContent( *pCursor->GetPoint() );
-    bool bRet = !m_pCurrentCursor->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
-                                     nsSwCursorSelOverFlags::SELOVER_TOGGLE );
+    bool bRet = !m_pCurrentCursor->IsSelOvr( SwCursorSelOverFlags::CheckNodeSection |
+                                     SwCursorSelOverFlags::Toggle );
     if( bRet )
         UpdateCursor(SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE|SwCursorShell::READONLY);
     return bRet;
@@ -1204,7 +1204,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
                             SwCallLink aLk( *this ); // watch Cursor-Moves
                             m_pCurrentCursor->DeleteMark();
                             *m_pCurrentCursor->GetPoint() = aPos;
-                            if( m_pCurrentCursor->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
+                            if( m_pCurrentCursor->IsSelOvr( SwCursorSelOverFlags::CheckNodeSection | SwCursorSelOverFlags::Toggle) )
                                 bRet = false;
                             else
                                 UpdateCursor();
@@ -1317,8 +1317,8 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
                             if( pCNd )
                             {
                                 m_pCurrentCursor->GetPoint()->nContent.Assign( pCNd, 0 );
-                                if( m_pCurrentCursor->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
-                                    nsSwCursorSelOverFlags::SELOVER_TOGGLE ))
+                                if( m_pCurrentCursor->IsSelOvr( SwCursorSelOverFlags::CheckNodeSection |
+                                    SwCursorSelOverFlags::Toggle ))
                                     bRet = false;
                                 else
                                     UpdateCursor();
@@ -1376,7 +1376,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
                             SwCursorSaveState aSaveState( *m_pCurrentCursor );
                             m_pCurrentCursor->DeleteMark();
                             *m_pCurrentCursor->GetPoint() = aPos;
-                            if( m_pCurrentCursor->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE ) )
+                            if( m_pCurrentCursor->IsSelOvr( SwCursorSelOverFlags::CheckNodeSection | SwCursorSelOverFlags::Toggle ) )
                                 bRet = false;
                             else
                                 UpdateCursor();
@@ -1421,8 +1421,8 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
                             SwCallLink aLk( *this ); // watch Cursor-Moves
                             m_pCurrentCursor->DeleteMark();
                             *m_pCurrentCursor->GetPoint() = aPos;
-                            if( m_pCurrentCursor->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
-                                nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
+                            if( m_pCurrentCursor->IsSelOvr( SwCursorSelOverFlags::CheckNodeSection |
+                                SwCursorSelOverFlags::Toggle) )
                                 bRet = false;
                             else
                                 UpdateCursor();
@@ -1528,8 +1528,8 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
                             SwCallLink aLk( *this ); // watch Cursor-Moves
                             SwCursorSaveState aSaveState( *m_pCurrentCursor );
                             *m_pCurrentCursor->GetPoint() = aPos;
-                            if( m_pCurrentCursor->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
-                                nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
+                            if( m_pCurrentCursor->IsSelOvr( SwCursorSelOverFlags::CheckNodeSection |
+                                SwCursorSelOverFlags::Toggle) )
                                 bRet = false;
                             else
                                 UpdateCursor();
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index fc7b75c..f2d4a64 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -188,17 +188,17 @@ bool SwCursor::IsNoContent() const
             GetDoc()->GetNodes().GetEndOfExtras().GetIndex();
 }
 
-bool SwCursor::IsSelOvrCheck(int)
+bool SwCursor::IsSelOvrCheck(SwCursorSelOverFlags)
 {
     return false;
 }
 
 // extracted from IsSelOvr()
-bool SwTableCursor::IsSelOvrCheck(int eFlags)
+bool SwTableCursor::IsSelOvrCheck(SwCursorSelOverFlags eFlags)
 {
     SwNodes& rNds = GetDoc()->GetNodes();
     // check sections of nodes array
-    if( (nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION & eFlags)
+    if( (SwCursorSelOverFlags::CheckNodeSection & eFlags)
         && HasMark() )
     {
         SwNodeIndex aOldPos( rNds, GetSavePos()->nNode );
@@ -223,7 +223,7 @@ namespace
     }
 }
 
-bool SwCursor::IsSelOvr( int eFlags )
+bool SwCursor::IsSelOvr( SwCursorSelOverFlags eFlags )
 {
     SwDoc* pDoc = GetDoc();
     SwNodes& rNds = pDoc->GetNodes();
@@ -247,7 +247,7 @@ bool SwCursor::IsSelOvr( int eFlags )
             ((bSkipOverHiddenSections && pSectNd->GetSection().IsHiddenFlag() ) ||
             (bSkipOverProtectSections && pSectNd->GetSection().IsProtectFlag() )))
         {
-            if( 0 == ( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags ) )
+            if( !( SwCursorSelOverFlags::ChangePos & eFlags ) )
             {
                 // then we're already done
                 RestoreSavePos();
@@ -261,7 +261,7 @@ bool SwCursor::IsSelOvr( int eFlags )
             SwContentNode* pCNd = bGoNxt
                 ? rNds.GoNextSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections)
                 : SwNodes::GoPrevSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections);
-            if( !pCNd && ( nsSwCursorSelOverFlags::SELOVER_ENABLEREVDIREKTION & eFlags ))
+            if( !pCNd && ( SwCursorSelOverFlags::EnableRevDirection & eFlags ))
             {
                 bGoNxt = !bGoNxt;
                 pCNd = bGoNxt ? rNds.GoNextSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections)
@@ -337,7 +337,7 @@ bool SwCursor::IsSelOvr( int eFlags )
     if( pNd->IsContentNode() && !dynamic_cast<SwUnoCursor*>(this) )
     {
         const SwContentFrame* pFrame = static_cast<const SwContentNode*>(pNd)->getLayoutFrame( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() );
-        if ( (nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags)   //allowed to change position if it's a bad one
+        if ( (SwCursorSelOverFlags::ChangePos & eFlags)   //allowed to change position if it's a bad one
             && pFrame && pFrame->IsValid() && !pFrame->Frame().Height()     //a bad zero height position
             && !InputFieldAtPos(GetPoint()) )                       //unless it's a (vertical) input field
         {
@@ -397,7 +397,7 @@ bool SwCursor::IsSelOvr( int eFlags )
     }
 
     // is the cursor allowed to be in a protected node?
-    if( 0 == ( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags ) && !IsAtValidPos() )
+    if( !( SwCursorSelOverFlags::ChangePos & eFlags ) && !IsAtValidPos() )
     {
         DeleteMark();
         RestoreSavePos();
@@ -432,11 +432,11 @@ bool SwCursor::IsSelOvr( int eFlags )
         if ( pInputFieldTextAttrAtPoint != pInputFieldTextAttrAtMark )
         {
             const sal_uLong nRefNodeIdx =
-                ( nsSwCursorSelOverFlags::SELOVER_TOGGLE & eFlags )
+                ( SwCursorSelOverFlags::Toggle & eFlags )
                 ? m_pSavePos->nNode
                 : GetMark()->nNode.GetIndex();
             const sal_Int32 nRefContentIdx =
-                ( nsSwCursorSelOverFlags::SELOVER_TOGGLE & eFlags )
+                ( SwCursorSelOverFlags::Toggle & eFlags )
                 ? m_pSavePos->nContent
                 : GetMark()->nContent.GetIndex();
             const bool bIsForwardSelection =
@@ -479,10 +479,10 @@ bool SwCursor::IsSelOvr( int eFlags )
 
     // Note: this cannot happen in TableMode
     // Only Point in Table then go behind/in front of table
-    if (nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags)
+    if (SwCursorSelOverFlags::ChangePos & eFlags)
     {
         bool bSelTop = GetPoint()->nNode.GetIndex() <
-            ((nsSwCursorSelOverFlags::SELOVER_TOGGLE & eFlags)
+            ((SwCursorSelOverFlags::Toggle & eFlags)
                  ? m_pSavePos->nNode : GetMark()->nNode.GetIndex());
 
         do { // loop for table after table
@@ -614,8 +614,8 @@ SetNextCursor:
                 GetPoint()->nContent.Assign( pTmpCNd, 0 );
                 return false;
             }
-            return IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                             nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
+            return IsSelOvr( SwCursorSelOverFlags::Toggle |
+                             SwCursorSelOverFlags::ChangePos );
         }
         // end of table, so go to next node
         ++aCellStt;
@@ -663,8 +663,8 @@ SetPrevCursor:
                 GetPoint()->nContent.Assign( pTmpCNd, 0 );
                 return false;
             }
-            return IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                             nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
+            return IsSelOvr( SwCursorSelOverFlags::Toggle |
+                             SwCursorSelOverFlags::ChangePos );
         }
         // at the beginning of a table, so go to next node
         --aCellStt;
@@ -1067,7 +1067,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
             *GetMark() = aMarkPos;
     }
 
-    if( nFound && SwCursor::IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE ) )
+    if( nFound && SwCursor::IsSelOvr( SwCursorSelOverFlags::Toggle ) )
         nFound = 0;
     return nFound;
 }
@@ -1733,8 +1733,8 @@ bool SwCursor::LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
     }
 
     return 0 == nCnt && !IsInProtectTable( true ) &&
-            !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                       nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
+            !IsSelOvr( SwCursorSelOverFlags::Toggle |
+                       SwCursorSelOverFlags::ChangePos );
 }
 
 // calculate cursor bidi level: extracted from UpDown()
@@ -1837,8 +1837,8 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt,
         }
 
         // iterate over whole number of items?
-        if( !nCnt && !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                                nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
+        if( !nCnt && !IsSelOvr( SwCursorSelOverFlags::Toggle |
+                                SwCursorSelOverFlags::ChangePos ) )
         {
             if( !pTableCursor )
             {
@@ -1862,7 +1862,7 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt,
                 }
                 pFrame->GetCursorOfst( GetPoint(), aPt, &eTmpState );
             }
-            bRet = !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
+            bRet = !IsSelOvr( SwCursorSelOverFlags::Toggle | SwCursorSelOverFlags::ChangePos );
         }
         else
             *GetPoint() = aOldPos;
@@ -1884,7 +1884,7 @@ bool SwCursor::LeftRightMargin( bool bLeft, bool bAPI )
     SwCursorSaveState aSave( *this );
     return pFrame
            && (bLeft ? pFrame->LeftMargin( this ) : pFrame->RightMargin( this, bAPI ) )
-           && !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
+           && !IsSelOvr( SwCursorSelOverFlags::Toggle | SwCursorSelOverFlags::ChangePos );
 }
 
 bool SwCursor::IsAtLeftRightMargin( bool bLeft, bool bAPI ) const
@@ -1913,9 +1913,9 @@ bool SwCursor::SttEndDoc( bool bStt )
     bool bRet = (!HasMark() || !IsNoContent() ) &&
                     Move( fnMove, GoInDoc ) &&
                     !IsInProtectTable( true ) &&
-                    !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                               nsSwCursorSelOverFlags::SELOVER_CHANGEPOS |
-                               nsSwCursorSelOverFlags::SELOVER_ENABLEREVDIREKTION );
+                    !IsSelOvr( SwCursorSelOverFlags::Toggle |
+                               SwCursorSelOverFlags::ChangePos |
+                               SwCursorSelOverFlags::EnableRevDirection );
     return bRet;
 }
 
@@ -2064,8 +2064,8 @@ bool SwCursor::MovePara(SwWhichPara fnWhichPara, SwMoveFnCollection const & fnPo
     SwCursorSaveState aSave( *this );
     return (*fnWhichPara)( *this, fnPosPara ) &&
             !IsInProtectTable( true ) &&
-            !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                       nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
+            !IsSelOvr( SwCursorSelOverFlags::Toggle |
+                       SwCursorSelOverFlags::ChangePos );
 }
 
 bool SwCursor::MoveSection( SwWhichSection fnWhichSect,
@@ -2074,8 +2074,8 @@ bool SwCursor::MoveSection( SwWhichSection fnWhichSect,
     SwCursorSaveState aSave( *this );
     return (*fnWhichSect)( *this, fnPosSect ) &&
             !IsInProtectTable( true ) &&
-            !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
-                       nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
+            !IsSelOvr( SwCursorSelOverFlags::Toggle |
+                       SwCursorSelOverFlags::ChangePos );
 }
 
 void SwCursor::RestoreSavePos()
diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx
index dc27eb3..28a7036 100644
--- a/sw/source/core/crsr/trvlfnfl.cxx
+++ b/sw/source/core/crsr/trvlfnfl.cxx
@@ -67,8 +67,8 @@ bool SwCursor::GotoFootnoteText()
         if( pCNd )
         {
             GetPoint()->nContent.Assign( pCNd, 0 );
-            bRet = !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
-                              nsSwCursorSelOverFlags::SELOVER_TOGGLE );
+            bRet = !IsSelOvr( SwCursorSelOverFlags::CheckNodeSection |
+                              SwCursorSelOverFlags::Toggle );
         }
     }
     return bRet;
@@ -140,8 +140,8 @@ bool SwCursor::GotoFootnoteAnchor()
                 GetPoint()->nNode = rTNd;
                 GetPoint()->nContent.Assign( &rTNd, pTextFootnote->GetStart() );
 
-                return !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
-                                  nsSwCursorSelOverFlags::SELOVER_TOGGLE );
+                return !IsSelOvr( SwCursorSelOverFlags::CheckNodeSection |
+                                  SwCursorSelOverFlags::Toggle );
             }
     }
     return false;
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index 9c8f174..62c2dc0 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -634,8 +634,8 @@ bool SwCursor::MoveTable( SwWhichTable fnWhichTable, SwMoveFnCollection const &
     {
         SwCursorSaveState aSaveState( *this );
         bRet = (*fnWhichTable)( *this, fnPosTable, IsReadOnlyAvailable() ) &&
-                !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
-                           nsSwCursorSelOverFlags::SELOVER_TOGGLE );
+                !IsSelOvr( SwCursorSelOverFlags::CheckNodeSection |
+                           SwCursorSelOverFlags::Toggle );
     }
     return bRet;
 }
diff --git a/sw/source/core/unocore/unocrsr.cxx b/sw/source/core/unocore/unocrsr.cxx
index 4b5c286..080a008 100644
--- a/sw/source/core/unocore/unocrsr.cxx
+++ b/sw/source/core/unocore/unocrsr.cxx
@@ -69,7 +69,7 @@ void SwUnoCursor::DoSetBidiLevelUpDown()
     return; // not for uno cursor
 }
 
-bool SwUnoCursor::IsSelOvr( int eFlags )
+bool SwUnoCursor::IsSelOvr( SwCursorSelOverFlags eFlags )
 {
     if (m_bRemainInSection)
     {
@@ -170,7 +170,7 @@ SwUnoTableCursor::~SwUnoTableCursor()
         delete m_aTableSel.GetNext();
 }
 
-bool SwUnoTableCursor::IsSelOvr( int eFlags )
+bool SwUnoTableCursor::IsSelOvr( SwCursorSelOverFlags eFlags )
 {
     bool bRet = SwUnoCursor::IsSelOvr( eFlags );
     if( !bRet )


More information about the Libreoffice-commits mailing list