diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-05-03 09:45:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-04 20:32:30 +0200 |
commit | fadf6427a9cbf351727e1412d8079757a994085b (patch) | |
tree | 99c956ba2d4f8bdd9271a01316edcb17a5b23615 /editeng | |
parent | 8538f28377356a8abd1826c011b2e2cb33dacec2 (diff) |
convert EVAnchorMode enum to scoped enum
change values to match position in definition to their meaning
Change-Id: Ia96e0c7e0c70c847dea518ef871608516542d3cb
Reviewed-on: https://gerrit.libreoffice.org/37186
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editview.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 76 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 6 | ||||
-rw-r--r-- | editeng/source/outliner/outlvw.cxx | 4 |
4 files changed, 45 insertions, 45 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index c89573dc6e80..c1ebe72c3212 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -725,12 +725,12 @@ void EditView::SetInsertMode( bool bInsert ) pImpEditView->SetInsertMode( bInsert ); } -void EditView::SetAnchorMode( EVAnchorMode eMode ) +void EditView::SetAnchorMode( EEAnchorMode eMode ) { pImpEditView->SetAnchorMode( eMode ); } -EVAnchorMode EditView::GetAnchorMode() const +EEAnchorMode EditView::GetAnchorMode() const { return pImpEditView->GetAnchorMode(); } diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 382daf5c1a22..71c1471a8961 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -89,7 +89,7 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, vcl::Window* pWindo bReadOnly = false; bClickedInSelection = false; eSelectionMode = EE_SELMODE_TXTONLY; - eAnchorMode = ANCHOR_TOP_LEFT; + eAnchorMode = EEAnchorMode::TopLeft; nInvMore = 1; nTravelXPos = TRAVEL_X_DONTKNOW; nControl = EVControlBits::AUTOSCROLL | EVControlBits::ENABLEPASTE; @@ -691,23 +691,23 @@ void ImpEditView::RecalcOutputArea() aNewSz.Width() = pEditEngine->pImpEditEngine->GetPaperSize().Width(); switch ( eAnchorMode ) { - case ANCHOR_TOP_LEFT: - case ANCHOR_VCENTER_LEFT: - case ANCHOR_BOTTOM_LEFT: + case EEAnchorMode::TopLeft: + case EEAnchorMode::VCenterLeft: + case EEAnchorMode::BottomLeft: { aNewTopLeft.X() = aAnchorPoint.X(); } break; - case ANCHOR_TOP_HCENTER: - case ANCHOR_VCENTER_HCENTER: - case ANCHOR_BOTTOM_HCENTER: + case EEAnchorMode::TopHCenter: + case EEAnchorMode::VCenterHCenter: + case EEAnchorMode::BottomHCenter: { aNewTopLeft.X() = aAnchorPoint.X() - aNewSz.Width() / 2; } break; - case ANCHOR_TOP_RIGHT: - case ANCHOR_VCENTER_RIGHT: - case ANCHOR_BOTTOM_RIGHT: + case EEAnchorMode::TopRight: + case EEAnchorMode::VCenterRight: + case EEAnchorMode::BottomRight: { aNewTopLeft.X() = aAnchorPoint.X() - aNewSz.Width() - 1; } @@ -722,23 +722,23 @@ void ImpEditView::RecalcOutputArea() aNewSz.Height() = pEditEngine->pImpEditEngine->GetPaperSize().Height(); switch ( eAnchorMode ) { - case ANCHOR_TOP_LEFT: - case ANCHOR_TOP_HCENTER: - case ANCHOR_TOP_RIGHT: + case EEAnchorMode::TopLeft: + case EEAnchorMode::TopHCenter: + case EEAnchorMode::TopRight: { aNewTopLeft.Y() = aAnchorPoint.Y(); } break; - case ANCHOR_VCENTER_LEFT: - case ANCHOR_VCENTER_HCENTER: - case ANCHOR_VCENTER_RIGHT: + case EEAnchorMode::VCenterLeft: + case EEAnchorMode::VCenterHCenter: + case EEAnchorMode::VCenterRight: { aNewTopLeft.Y() = aAnchorPoint.Y() - aNewSz.Height() / 2; } break; - case ANCHOR_BOTTOM_LEFT: - case ANCHOR_BOTTOM_HCENTER: - case ANCHOR_BOTTOM_RIGHT: + case EEAnchorMode::BottomLeft: + case EEAnchorMode::BottomHCenter: + case EEAnchorMode::BottomRight: { aNewTopLeft.Y() = aAnchorPoint.Y() - aNewSz.Height() - 1; } @@ -748,7 +748,7 @@ void ImpEditView::RecalcOutputArea() ResetOutputArea( tools::Rectangle( aNewTopLeft, aNewSz ) ); } -void ImpEditView::SetAnchorMode( EVAnchorMode eMode ) +void ImpEditView::SetAnchorMode( EEAnchorMode eMode ) { eAnchorMode = eMode; CalcAnchorPoint(); @@ -761,23 +761,23 @@ void ImpEditView::CalcAnchorPoint() // X: switch ( eAnchorMode ) { - case ANCHOR_TOP_LEFT: - case ANCHOR_VCENTER_LEFT: - case ANCHOR_BOTTOM_LEFT: + case EEAnchorMode::TopLeft: + case EEAnchorMode::VCenterLeft: + case EEAnchorMode::BottomLeft: { aAnchorPoint.X() = aOutArea.Left(); } break; - case ANCHOR_TOP_HCENTER: - case ANCHOR_VCENTER_HCENTER: - case ANCHOR_BOTTOM_HCENTER: + case EEAnchorMode::TopHCenter: + case EEAnchorMode::VCenterHCenter: + case EEAnchorMode::BottomHCenter: { aAnchorPoint.X() = aOutArea.Left() + (aOutArea.GetWidth()-1) / 2; } break; - case ANCHOR_TOP_RIGHT: - case ANCHOR_VCENTER_RIGHT: - case ANCHOR_BOTTOM_RIGHT: + case EEAnchorMode::TopRight: + case EEAnchorMode::VCenterRight: + case EEAnchorMode::BottomRight: { aAnchorPoint.X() = aOutArea.Right(); } @@ -787,23 +787,23 @@ void ImpEditView::CalcAnchorPoint() // Y: switch ( eAnchorMode ) { - case ANCHOR_TOP_LEFT: - case ANCHOR_TOP_HCENTER: - case ANCHOR_TOP_RIGHT: + case EEAnchorMode::TopLeft: + case EEAnchorMode::TopHCenter: + case EEAnchorMode::TopRight: { aAnchorPoint.Y() = aOutArea.Top(); } break; - case ANCHOR_VCENTER_LEFT: - case ANCHOR_VCENTER_HCENTER: - case ANCHOR_VCENTER_RIGHT: + case EEAnchorMode::VCenterLeft: + case EEAnchorMode::VCenterHCenter: + case EEAnchorMode::VCenterRight: { aAnchorPoint.Y() = aOutArea.Top() + (aOutArea.GetHeight()-1) / 2; } break; - case ANCHOR_BOTTOM_LEFT: - case ANCHOR_BOTTOM_HCENTER: - case ANCHOR_BOTTOM_RIGHT: + case EEAnchorMode::BottomLeft: + case EEAnchorMode::BottomHCenter: + case EEAnchorMode::BottomRight: { aAnchorPoint.Y() = aOutArea.Bottom() - 1; } diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index c755ebb348b4..19333a665575 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -257,7 +257,7 @@ private: Point aVisDocStartPos; EESelectionMode eSelectionMode; EditSelection aEditSelection; - EVAnchorMode eAnchorMode; + EEAnchorMode eAnchorMode; protected: @@ -345,8 +345,8 @@ public: bool IsInSelection( const EditPaM& rPaM ); - void SetAnchorMode( EVAnchorMode eMode ); - EVAnchorMode GetAnchorMode() const { return eAnchorMode; } + void SetAnchorMode( EEAnchorMode eMode ); + EEAnchorMode GetAnchorMode() const { return eAnchorMode; } void CalcAnchorPoint(); void RecalcOutputArea(); diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 4f0775d72aca..455b04aa85b7 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -1320,12 +1320,12 @@ EVControlBits OutlinerView::GetControlWord() const return pEditView->GetControlWord(); } -void OutlinerView::SetAnchorMode( EVAnchorMode eMode ) +void OutlinerView::SetAnchorMode( EEAnchorMode eMode ) { pEditView->SetAnchorMode( eMode ); } -EVAnchorMode OutlinerView::GetAnchorMode() const +EEAnchorMode OutlinerView::GetAnchorMode() const { return pEditView->GetAnchorMode(); } |