convert SvxDistributeHorizontal to scoped enum

Change-Id: I7f3592ac8ef90686954624f37394a6e8f047ca44
This commit is contained in:
Noel Grandin
2016-08-24 11:54:15 +02:00
parent b8d03c61db
commit fdaa46f065
5 changed files with 25 additions and 25 deletions

View File

@@ -929,7 +929,7 @@ AbstractSvxCaptionDialog* AbstractDialogFactory_Impl::CreateCaptionDialog(
AbstractSvxDistributeDialog* AbstractDialogFactory_Impl::CreateSvxDistributeDialog(const SfxItemSet& rAttr)
{
VclPtrInstance<SvxDistributeDialog> pDlg( nullptr, rAttr, SvxDistributeHorizontalNone, SvxDistributeVertical::NONE);
VclPtrInstance<SvxDistributeDialog> pDlg( nullptr, rAttr, SvxDistributeHorizontal::NONE, SvxDistributeVertical::NONE);
return new AbstractSvxDistributeDialog_Impl( pDlg );
}

View File

@@ -42,7 +42,7 @@ class SvxDistributePage : public SvxTabPage
public:
SvxDistributePage(vcl::Window* pWindow, const SfxItemSet& rInAttrs,
SvxDistributeHorizontal eHor = SvxDistributeHorizontalNone,
SvxDistributeHorizontal eHor = SvxDistributeHorizontal::NONE,
SvxDistributeVertical eVer = SvxDistributeVertical::NONE);
virtual ~SvxDistributePage();
virtual void dispose() override;
@@ -61,7 +61,7 @@ class SvxDistributeDialog : public SfxSingleTabDialog
public:
SvxDistributeDialog(vcl::Window* pParent, const SfxItemSet& rAttr,
SvxDistributeHorizontal eHor = SvxDistributeHorizontalNone,
SvxDistributeHorizontal eHor = SvxDistributeHorizontal::NONE,
SvxDistributeVertical eVer = SvxDistributeVertical::NONE);
virtual ~SvxDistributeDialog();
virtual void dispose() override;

View File

@@ -120,11 +120,11 @@ void SvxDistributePage::Reset(const SfxItemSet* )
switch(m_eDistributeHor)
{
case SvxDistributeHorizontalNone : m_pBtnHorNone->SetState(true); break;
case SvxDistributeHorizontalLeft : m_pBtnHorLeft->SetState(true); break;
case SvxDistributeHorizontalCenter : m_pBtnHorCenter->SetState(true); break;
case SvxDistributeHorizontalDistance : m_pBtnHorDistance->SetState(true); break;
case SvxDistributeHorizontalRight : m_pBtnHorRight->SetState(true); break;
case SvxDistributeHorizontal::NONE : m_pBtnHorNone->SetState(true); break;
case SvxDistributeHorizontal::Left : m_pBtnHorLeft->SetState(true); break;
case SvxDistributeHorizontal::Center : m_pBtnHorCenter->SetState(true); break;
case SvxDistributeHorizontal::Distance : m_pBtnHorDistance->SetState(true); break;
case SvxDistributeHorizontal::Right : m_pBtnHorRight->SetState(true); break;
}
m_pBtnVerNone->SetState(false);
@@ -151,17 +151,17 @@ void SvxDistributePage::Reset(const SfxItemSet* )
bool SvxDistributePage::FillItemSet( SfxItemSet* )
{
SvxDistributeHorizontal eDistributeHor(SvxDistributeHorizontalNone);
SvxDistributeHorizontal eDistributeHor(SvxDistributeHorizontal::NONE);
SvxDistributeVertical eDistributeVer(SvxDistributeVertical::NONE);
if(m_pBtnHorLeft->IsChecked())
eDistributeHor = SvxDistributeHorizontalLeft;
eDistributeHor = SvxDistributeHorizontal::Left;
else if(m_pBtnHorCenter->IsChecked())
eDistributeHor = SvxDistributeHorizontalCenter;
eDistributeHor = SvxDistributeHorizontal::Center;
else if(m_pBtnHorDistance->IsChecked())
eDistributeHor = SvxDistributeHorizontalDistance;
eDistributeHor = SvxDistributeHorizontal::Distance;
else if(m_pBtnHorRight->IsChecked())
eDistributeHor = SvxDistributeHorizontalRight;
eDistributeHor = SvxDistributeHorizontal::Right;
if(m_pBtnVerTop->IsChecked())
eDistributeVer = SvxDistributeVertical::Top;

View File

@@ -19,13 +19,13 @@
#ifndef INCLUDED_SVX_DSTRIBUT_ENUM_HXX
#define INCLUDED_SVX_DSTRIBUT_ENUM_HXX
enum SvxDistributeHorizontal
enum class SvxDistributeHorizontal
{
SvxDistributeHorizontalNone = 0,
SvxDistributeHorizontalLeft,
SvxDistributeHorizontalCenter,
SvxDistributeHorizontalDistance,
SvxDistributeHorizontalRight
NONE = 0,
Left,
Center,
Distance,
Right
};
enum class SvxDistributeVertical

View File

@@ -788,7 +788,7 @@ void SdrEditView::DistributeMarkedObjects()
if( bUndo )
BegUndo();
if(eHor != SvxDistributeHorizontalNone)
if(eHor != SvxDistributeHorizontal::NONE)
{
// build sorted entry list
nFullLength = 0L;
@@ -802,24 +802,24 @@ void SdrEditView::DistributeMarkedObjects()
switch(eHor)
{
case SvxDistributeHorizontalLeft:
case SvxDistributeHorizontal::Left:
{
pNew->mnPos = pNew->mpObj->GetSnapRect().Left();
break;
}
case SvxDistributeHorizontalCenter:
case SvxDistributeHorizontal::Center:
{
pNew->mnPos = (pNew->mpObj->GetSnapRect().Right() + pNew->mpObj->GetSnapRect().Left()) / 2;
break;
}
case SvxDistributeHorizontalDistance:
case SvxDistributeHorizontal::Distance:
{
pNew->mnLength = pNew->mpObj->GetSnapRect().GetWidth() + 1;
nFullLength += pNew->mnLength;
pNew->mnPos = (pNew->mpObj->GetSnapRect().Right() + pNew->mpObj->GetSnapRect().Left()) / 2;
break;
}
case SvxDistributeHorizontalRight:
case SvxDistributeHorizontal::Right:
{
pNew->mnPos = pNew->mpObj->GetSnapRect().Right();
break;
@@ -837,7 +837,7 @@ void SdrEditView::DistributeMarkedObjects()
aEntryList.push_back( pNew );
}
if(eHor == SvxDistributeHorizontalDistance)
if(eHor == SvxDistributeHorizontal::Distance)
{
// calculate room in-between
sal_Int32 nWidth = GetAllMarkedBoundRect().GetWidth() + 1;