summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-10 10:19:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-13 08:17:42 +0200
commitba948e3827e4f1099652fe9fa16d1df3822e863b (patch)
tree0290b351e827604c62b041073ae2e3f8a2f9e8c2
parentcdbe81f2acb3ebe2e6d39c0cac1f66572d026211 (diff)
convert AnchorState to scoped enum
and drop unused AS_START enumerator Change-Id: I1ae8e75c6b99f0f923e5f3b020d66e57c81838f0
-rw-r--r--sw/source/uibase/docvw/AnchorOverlayObject.cxx14
-rw-r--r--sw/source/uibase/docvw/AnchorOverlayObject.hxx9
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx20
3 files changed, 20 insertions, 23 deletions
diff --git a/sw/source/uibase/docvw/AnchorOverlayObject.cxx b/sw/source/uibase/docvw/AnchorOverlayObject.cxx
index b92574c3036c..116cc1467d34 100644
--- a/sw/source/uibase/docvw/AnchorOverlayObject.cxx
+++ b/sw/source/uibase/docvw/AnchorOverlayObject.cxx
@@ -86,9 +86,8 @@ void AnchorPrimitive::create2DDecomposition(
drawinglayer::primitive2d::Primitive2DContainer& rContainer,
const drawinglayer::geometry::ViewInformation2D& /*rViewInformation*/) const
{
- if ( AS_TRI == maAnchorState ||
- AS_ALL == maAnchorState ||
- AS_START == maAnchorState )
+ if ( AnchorState::Tri == maAnchorState ||
+ AnchorState::All == maAnchorState )
{
// create triangle
const drawinglayer::primitive2d::Primitive2DReference aTriangle(
@@ -104,8 +103,7 @@ void AnchorPrimitive::create2DDecomposition(
getColor(),
mfDiscreteLineWidth * getDiscreteUnit());
- if ( AS_ALL == maAnchorState ||
- AS_START == maAnchorState )
+ if ( AnchorState::All == maAnchorState )
{
// create line start
if(getLineSolid())
@@ -140,8 +138,8 @@ void AnchorPrimitive::create2DDecomposition(
}
}
- if ( AS_ALL == maAnchorState ||
- AS_END == maAnchorState )
+ if ( AnchorState::All == maAnchorState ||
+ AnchorState::End == maAnchorState )
{
// LineTop has to be created, too, but uses no shadow, so add after
// the other parts are created
@@ -241,7 +239,7 @@ AnchorOverlayObject::AnchorOverlayObject( const basegfx::B2DPoint& rBasePos,
, maLine()
, maLineTop()
, mHeight(0)
- , mAnchorState(AS_ALL)
+ , mAnchorState(AnchorState::All)
, mbLineSolid(false)
{
}
diff --git a/sw/source/uibase/docvw/AnchorOverlayObject.hxx b/sw/source/uibase/docvw/AnchorOverlayObject.hxx
index 76caf55f3df0..55fecd467c78 100644
--- a/sw/source/uibase/docvw/AnchorOverlayObject.hxx
+++ b/sw/source/uibase/docvw/AnchorOverlayObject.hxx
@@ -30,12 +30,11 @@ class Point;
namespace sw { namespace sidebarwindows {
-enum AnchorState
+enum class AnchorState
{
- AS_ALL,
- AS_START,
- AS_END,
- AS_TRI
+ All,
+ End,
+ Tri
};
class AnchorOverlayObject: public sdr::overlay::OverlayObjectWithBasePosition
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 256a6a58a871..fa4b43548a7f 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -539,7 +539,7 @@ void SwSidebarWin::ShowAnchorOnly(const Point &aPoint)
{
mpAnchor->SetSixthPosition(basegfx::B2DPoint(aPoint.X(),aPoint.Y()));
mpAnchor->SetSeventhPosition(basegfx::B2DPoint(aPoint.X(),aPoint.Y()));
- mpAnchor->SetAnchorState(AS_ALL);
+ mpAnchor->SetAnchorState(AnchorState::All);
mpAnchor->setVisible(true);
}
if (mpShadow)
@@ -818,7 +818,7 @@ void SwSidebarWin::SetPosAndSize()
{
mpAnchor->SetHeight(mAnchorRect.Height());
mpAnchor->setVisible(true);
- mpAnchor->SetAnchorState(AS_TRI);
+ mpAnchor->SetAnchorState(AnchorState::Tri);
if (HasChildPathFocus())
{
mpAnchor->setLineSolid(true);
@@ -854,7 +854,7 @@ void SwSidebarWin::SetPosAndSize()
// #i111964#
if ( mpAnchor )
{
- mpAnchor->SetAnchorState(AS_END);
+ mpAnchor->SetAnchorState(AnchorState::End);
}
}
else
@@ -862,13 +862,13 @@ void SwSidebarWin::SetPosAndSize()
// #i111964#
if ( mpAnchor )
{
- mpAnchor->SetAnchorState(AS_ALL);
+ mpAnchor->SetAnchorState(AnchorState::All);
}
SwSidebarWin* pWin = GetTopReplyNote();
// #i111964#
if ( pWin && pWin->Anchor() )
{
- pWin->Anchor()->SetAnchorState(AS_END);
+ pWin->Anchor()->SetAnchorState(AnchorState::End);
}
}
}
@@ -1227,7 +1227,7 @@ void SwSidebarWin::HideNote()
if (mpAnchor)
{
if (mrMgr.IsShowAnchor())
- mpAnchor->SetAnchorState(AS_TRI);
+ mpAnchor->SetAnchorState(AnchorState::Tri);
else
mpAnchor->setVisible(false);
}
@@ -1509,12 +1509,12 @@ void SwSidebarWin::SetViewState(ViewState bViewState)
{
if (mpAnchor)
{
- mpAnchor->SetAnchorState(AS_ALL);
+ mpAnchor->SetAnchorState(AnchorState::All);
SwSidebarWin* pWin = GetTopReplyNote();
// #i111964#
if ( pWin && pWin->Anchor() )
{
- pWin->Anchor()->SetAnchorState(AS_END);
+ pWin->Anchor()->SetAnchorState(AnchorState::End);
}
mpAnchor->setLineSolid(true);
if ( mpTextRangeOverlay != nullptr )
@@ -1548,7 +1548,7 @@ void SwSidebarWin::SetViewState(ViewState bViewState)
{
// if there is no visible parent note, we want to see the complete anchor ??
//if (IsAnyStackParentVisible())
- mpAnchor->SetAnchorState(AS_END);
+ mpAnchor->SetAnchorState(AnchorState::End);
SwSidebarWin* pTopWinSelf = GetTopReplyNote();
SwSidebarWin* pTopWinActive = mrMgr.HasActiveSidebarWin()
? mrMgr.GetActiveSidebarWin()->GetTopReplyNote()
@@ -1565,7 +1565,7 @@ void SwSidebarWin::SetViewState(ViewState bViewState)
pTopWinSelf->TextRange()->HideSolidBorder();
}
}
- pTopWinSelf->Anchor()->SetAnchorState(AS_ALL);
+ pTopWinSelf->Anchor()->SetAnchorState(AnchorState::All);
}
}
mpAnchor->setLineSolid(false);