Convert VclAlign to scoped enum

Change-Id: I03718cc63ec5c1260ebd599bddb1a787ca8f5788
Reviewed-on: https://gerrit.libreoffice.org/25603
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin 2016-05-29 12:52:29 +02:00
parent a6dacbe1d7
commit 06cb2df4db
5 changed files with 23 additions and 23 deletions

View File

@ -505,7 +505,7 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl(
vcl::Window* pWindow = VCLUnoHelper::GetWindow(xControl->getPeer());
pWindow->set_grid_top_attach(rLabel.get_grid_top_attach());
pWindow->set_grid_left_attach(rLabel.get_grid_left_attach()+1);
pWindow->set_valign(VCL_ALIGN_CENTER);
pWindow->set_valign(VclAlign::Center);
rLabel.set_mnemonic_widget(pWindow);
if (&rLabel == pTitleFT)
pWindow->set_grid_width(3);

View File

@ -99,12 +99,12 @@ inline bool operator !=(const ItalicMatrix& a, const ItalicMatrix& b)
return a.xx != b.xx || a.xy != b.xy || a.yx != b.yx || a.yy != b.yy;
}
enum VclAlign
enum class VclAlign
{
VCL_ALIGN_FILL,
VCL_ALIGN_START,
VCL_ALIGN_END,
VCL_ALIGN_CENTER
Fill,
Start,
End,
Center
};
enum class VclPackType

View File

@ -56,7 +56,7 @@ void VclContainer::setLayoutAllocation(vcl::Window &rChild, const Point &rAllocP
VclAlign eValign = rChild.get_valign();
//typical case
if (eHalign == VCL_ALIGN_FILL && eValign == VCL_ALIGN_FILL)
if (eHalign == VclAlign::Fill && eValign == VclAlign::Fill)
{
setLayoutPosSize(rChild, rAllocPos, rChildAlloc);
return;
@ -68,19 +68,19 @@ void VclContainer::setLayoutAllocation(vcl::Window &rChild, const Point &rAllocP
switch (eHalign)
{
case VCL_ALIGN_FILL:
case VclAlign::Fill:
break;
case VCL_ALIGN_START:
case VclAlign::Start:
if (aChildPreferredSize.Width() < rChildAlloc.Width())
aChildSize.Width() = aChildPreferredSize.Width();
break;
case VCL_ALIGN_END:
case VclAlign::End:
if (aChildPreferredSize.Width() < rChildAlloc.Width())
aChildSize.Width() = aChildPreferredSize.Width();
aChildPos.X() += rChildAlloc.Width();
aChildPos.X() -= aChildSize.Width();
break;
case VCL_ALIGN_CENTER:
case VclAlign::Center:
if (aChildPreferredSize.Width() < aChildSize.Width())
aChildSize.Width() = aChildPreferredSize.Width();
aChildPos.X() += (rChildAlloc.Width() - aChildSize.Width()) / 2;
@ -89,19 +89,19 @@ void VclContainer::setLayoutAllocation(vcl::Window &rChild, const Point &rAllocP
switch (eValign)
{
case VCL_ALIGN_FILL:
case VclAlign::Fill:
break;
case VCL_ALIGN_START:
case VclAlign::Start:
if (aChildPreferredSize.Height() < rChildAlloc.Height())
aChildSize.Height() = aChildPreferredSize.Height();
break;
case VCL_ALIGN_END:
case VclAlign::End:
if (aChildPreferredSize.Height() < rChildAlloc.Height())
aChildSize.Height() = aChildPreferredSize.Height();
aChildPos.Y() += rChildAlloc.Height();
aChildPos.Y() -= aChildSize.Height();
break;
case VCL_ALIGN_CENTER:
case VclAlign::Center:
if (aChildPreferredSize.Height() < aChildSize.Height())
aChildSize.Height() = aChildPreferredSize.Height();
aChildPos.Y() += (rChildAlloc.Height() - aChildSize.Height()) / 2;
@ -2171,7 +2171,7 @@ short MessageDialog::Execute()
}
m_pImage->set_grid_left_attach(0);
m_pImage->set_grid_top_attach(0);
m_pImage->set_valign(VCL_ALIGN_START);
m_pImage->set_valign(VclAlign::Start);
m_pImage->Show();
WinBits nWinStyle = WB_CLIPCHILDREN | WB_LEFT | WB_VCENTER | WB_NOLABEL | WB_NOTABSTOP;

View File

@ -638,8 +638,8 @@ WindowImpl::WindowImpl( WindowType nType )
mnDlgCtrlFlags = DialogControlFlags::NONE; // DialogControl-Flags
mnLockCount = 0; // LockCount
meAlwaysInputMode = AlwaysInputNone; // neither AlwaysEnableInput nor AlwaysDisableInput called
meHalign = VCL_ALIGN_FILL;
meValign = VCL_ALIGN_FILL;
meHalign = VclAlign::Fill;
meValign = VclAlign::Fill;
mePackType = VclPackType::Start;
mnPadding = 0;
mnGridHeight = 1;

View File

@ -1420,16 +1420,16 @@ namespace
{
VclAlign toAlign(const OString &rValue)
{
VclAlign eRet = VCL_ALIGN_FILL;
VclAlign eRet = VclAlign::Fill;
if (rValue == "fill")
eRet = VCL_ALIGN_FILL;
eRet = VclAlign::Fill;
else if (rValue == "start")
eRet = VCL_ALIGN_START;
eRet = VclAlign::Start;
else if (rValue == "end")
eRet = VCL_ALIGN_END;
eRet = VclAlign::End;
else if (rValue == "center")
eRet = VCL_ALIGN_CENTER;
eRet = VclAlign::Center;
return eRet;
}
}