diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-12 18:42:14 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-13 06:54:23 +0000 |
commit | edb6783c14a9303af000b54ce63f55967289a7a6 (patch) | |
tree | dfb843caf6019b7c9922c7122d3becea75832b17 /sw/source/uibase | |
parent | eadc132d5fa339b6fe5b2f8bb482ed30dbd23147 (diff) |
convert SW_TAB #defines to enum
Change-Id: I8f2c63dc381416af1eb74794a1bbc3417eb272d6
Reviewed-on: https://gerrit.libreoffice.org/11936
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/app/swmodul1.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 47 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin2.cxx | 27 |
3 files changed, 39 insertions, 37 deletions
diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx index aaa607cbf7a1..bf80bc0e9733 100644 --- a/sw/source/uibase/app/swmodul1.cxx +++ b/sw/source/uibase/app/swmodul1.cxx @@ -455,7 +455,7 @@ static void lcl_FillAuthorAttr( sal_uInt16 nAuthor, SfxItemSet &rSet, sizeof( aColArr[0] )) ] ); } - bool bBackGr = COL_NONE == rAttr.nColor; + bool bBackGr = COL_NONE_COLOR == rAttr.nColor; switch (rAttr.nItemId) { diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 95d2bf3d2f52..a8d3f61601a7 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -2986,24 +2986,24 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) m_aStartPos = rMEvt.GetPosPixel(); m_aRszMvHdlPt.X() = 0, m_aRszMvHdlPt.Y() = 0; - sal_uInt8 nMouseTabCol = 0; + SwTab nMouseTabCol = SwTab::COL_NONE; const bool bTmp = !rSh.IsDrawCreate() && !m_pApplyTempl && !rSh.IsInSelect() && rMEvt.GetClicks() == 1 && MOUSE_LEFT == rMEvt.GetButtons(); if ( bTmp && - 0 != (nMouseTabCol = rSh.WhichMouseTabCol( aDocPos ) ) && + SwTab::COL_NONE != (nMouseTabCol = rSh.WhichMouseTabCol( aDocPos ) ) && !rSh.IsObjSelectable( aDocPos ) ) { // Enhanced table selection - if ( SW_TABSEL_HORI <= nMouseTabCol && SW_TABCOLSEL_VERT >= nMouseTabCol ) + if ( SwTab::SEL_HORI <= nMouseTabCol && SwTab::COLSEL_VERT >= nMouseTabCol ) { rSh.EnterStdMode(); rSh.SelectTableRowCol( aDocPos ); - if( SW_TABSEL_HORI != nMouseTabCol && SW_TABSEL_HORI_RTL != nMouseTabCol) + if( SwTab::SEL_HORI != nMouseTabCol && SwTab::SEL_HORI_RTL != nMouseTabCol) { m_pRowColumnSelectionStart = new Point( aDocPos ); - m_bIsRowDrag = SW_TABROWSEL_HORI == nMouseTabCol|| - SW_TABROWSEL_HORI_RTL == nMouseTabCol || - SW_TABCOLSEL_VERT == nMouseTabCol; + m_bIsRowDrag = SwTab::ROWSEL_HORI == nMouseTabCol|| + SwTab::ROWSEL_HORI_RTL == nMouseTabCol || + SwTab::COLSEL_VERT == nMouseTabCol; m_bMBPressed = true; CaptureMouse(); } @@ -3013,7 +3013,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if ( !rSh.IsTableMode() ) { // comes from table columns out of the document. - if(SW_TABCOL_VERT == nMouseTabCol || SW_TABCOL_HORI == nMouseTabCol) + if(SwTab::COL_VERT == nMouseTabCol || SwTab::COL_HORI == nMouseTabCol) m_rView.SetTabColFromDoc( true ); else m_rView.SetTabRowFromDoc( true ); @@ -3023,7 +3023,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) SfxBindings& rBind = m_rView.GetViewFrame()->GetBindings(); rBind.Update(); if ( RulerColumnDrag( rMEvt, - (SW_TABCOL_VERT == nMouseTabCol || SW_TABROW_HORI == nMouseTabCol)) ) + (SwTab::COL_VERT == nMouseTabCol || SwTab::ROW_HORI == nMouseTabCol)) ) { m_rView.SetTabColFromDoc( false ); m_rView.SetTabRowFromDoc( false ); @@ -3858,10 +3858,10 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) } } - sal_uInt8 nMouseTabCol; + SwTab nMouseTabCol; if( !bIsDocReadOnly && bInsWin && !m_pApplyTempl && !rSh.IsInSelect() ) { - if ( SW_TABCOL_NONE != (nMouseTabCol = rSh.WhichMouseTabCol( aDocPt ) ) && + if ( SwTab::COL_NONE != (nMouseTabCol = rSh.WhichMouseTabCol( aDocPt ) ) && !rSh.IsObjSelectable( aDocPt ) ) { sal_uInt16 nPointer = USHRT_MAX; @@ -3869,35 +3869,36 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) switch ( nMouseTabCol ) { - case SW_TABCOL_VERT : - case SW_TABROW_HORI : + case SwTab::COL_VERT : + case SwTab::ROW_HORI : nPointer = POINTER_VSIZEBAR; bChkTblSel = true; break; - case SW_TABROW_VERT : - case SW_TABCOL_HORI : + case SwTab::ROW_VERT : + case SwTab::COL_HORI : nPointer = POINTER_HSIZEBAR; bChkTblSel = true; break; // Enhanced table selection - case SW_TABSEL_HORI : + case SwTab::SEL_HORI : nPointer = POINTER_TAB_SELECT_SE; break; - case SW_TABSEL_HORI_RTL : - case SW_TABSEL_VERT : + case SwTab::SEL_HORI_RTL : + case SwTab::SEL_VERT : nPointer = POINTER_TAB_SELECT_SW; break; - case SW_TABCOLSEL_HORI : - case SW_TABROWSEL_VERT : + case SwTab::COLSEL_HORI : + case SwTab::ROWSEL_VERT : nPointer = POINTER_TAB_SELECT_S; break; - case SW_TABROWSEL_HORI : + case SwTab::ROWSEL_HORI : nPointer = POINTER_TAB_SELECT_E; break; - case SW_TABROWSEL_HORI_RTL : - case SW_TABCOLSEL_VERT : + case SwTab::ROWSEL_HORI_RTL : + case SwTab::COLSEL_VERT : nPointer = POINTER_TAB_SELECT_W; break; + case SwTab::COL_NONE: break; // prevent compiler warning } if ( USHRT_MAX != nPointer && diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index 19989be4de5c..9b887b17da6c 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -389,33 +389,34 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) } if( bContinue ) { - sal_uInt8 nTabCols = rSh.WhichMouseTabCol(aPos); + SwTab nTabCols = rSh.WhichMouseTabCol(aPos); sal_uInt16 nTabRes = 0; switch(nTabCols) { - case SW_TABCOL_HORI: - case SW_TABCOL_VERT: + case SwTab::COL_HORI: + case SwTab::COL_VERT: nTabRes = STR_TABLE_COL_ADJUST; break; - case SW_TABROW_HORI: - case SW_TABROW_VERT: + case SwTab::ROW_HORI: + case SwTab::ROW_VERT: nTabRes = STR_TABLE_ROW_ADJUST; break; // #i32329# Enhanced table selection - case SW_TABSEL_HORI: - case SW_TABSEL_HORI_RTL: - case SW_TABSEL_VERT: + case SwTab::SEL_HORI: + case SwTab::SEL_HORI_RTL: + case SwTab::SEL_VERT: nTabRes = STR_TABLE_SELECT_ALL; break; - case SW_TABROWSEL_HORI: - case SW_TABROWSEL_HORI_RTL: - case SW_TABROWSEL_VERT: + case SwTab::ROWSEL_HORI: + case SwTab::ROWSEL_HORI_RTL: + case SwTab::ROWSEL_VERT: nTabRes = STR_TABLE_SELECT_ROW; break; - case SW_TABCOLSEL_HORI: - case SW_TABCOLSEL_VERT: + case SwTab::COLSEL_HORI: + case SwTab::COLSEL_VERT: nTabRes = STR_TABLE_SELECT_COL; break; + case SwTab::COL_NONE: break; // prevent compiler warning } if(nTabRes) { |