Kaydet (Commit) 7444355f authored tarafından Noel Grandin's avatar Noel Grandin

convert VclButtonBoxStyle to scoped enum

Change-Id: If3d02c9be54a509f85214acbf4a1e6cfd8955dc4
Reviewed-on: https://gerrit.libreoffice.org/32291Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 21907d64
...@@ -186,14 +186,14 @@ protected: ...@@ -186,14 +186,14 @@ protected:
} }
}; };
enum VclButtonBoxStyle enum class VclButtonBoxStyle
{ {
VCL_BUTTONBOX_DEFAULT_STYLE, Default,
VCL_BUTTONBOX_SPREAD, Spread,
VCL_BUTTONBOX_EDGE, Edge,
VCL_BUTTONBOX_START, Start,
VCL_BUTTONBOX_END, End,
VCL_BUTTONBOX_CENTER Center
}; };
class VCL_DLLPUBLIC VclButtonBox : public VclBox class VCL_DLLPUBLIC VclButtonBox : public VclBox
...@@ -201,7 +201,7 @@ class VCL_DLLPUBLIC VclButtonBox : public VclBox ...@@ -201,7 +201,7 @@ class VCL_DLLPUBLIC VclButtonBox : public VclBox
public: public:
VclButtonBox(vcl::Window *pParent) VclButtonBox(vcl::Window *pParent)
: VclBox(pParent, false, 0/*nSpacing*/) : VclBox(pParent, false, 0/*nSpacing*/)
, m_eLayoutStyle(VCL_BUTTONBOX_DEFAULT_STYLE) , m_eLayoutStyle(VclButtonBoxStyle::Default)
{ {
} }
virtual bool set_property(const OString &rKey, const OString &rValue) override; virtual bool set_property(const OString &rKey, const OString &rValue) override;
......
...@@ -595,7 +595,7 @@ VclButtonBox::Requisition VclButtonBox::calculatePrimarySecondaryRequisitions() ...@@ -595,7 +595,7 @@ VclButtonBox::Requisition VclButtonBox::calculatePrimarySecondaryRequisitions()
long nMainGroupSecondary = getSecondaryDimension(aMainGroupSize); long nMainGroupSecondary = getSecondaryDimension(aMainGroupSize);
long nSubGroupSecondary = getSecondaryDimension(aSubGroupSize); long nSubGroupSecondary = getSecondaryDimension(aSubGroupSize);
bool bIgnoreSecondaryPacking = (m_eLayoutStyle == VCL_BUTTONBOX_SPREAD || m_eLayoutStyle == VCL_BUTTONBOX_CENTER); bool bIgnoreSecondaryPacking = (m_eLayoutStyle == VclButtonBoxStyle::Spread || m_eLayoutStyle == VclButtonBoxStyle::Center);
std::vector<long> aMainGroupSizes; std::vector<long> aMainGroupSizes;
std::vector<bool> aMainGroupNonHomogeneous; std::vector<bool> aMainGroupNonHomogeneous;
...@@ -709,17 +709,17 @@ bool VclButtonBox::set_property(const OString &rKey, const OString &rValue) ...@@ -709,17 +709,17 @@ bool VclButtonBox::set_property(const OString &rKey, const OString &rValue)
{ {
if (rKey == "layout-style") if (rKey == "layout-style")
{ {
VclButtonBoxStyle eStyle = VCL_BUTTONBOX_DEFAULT_STYLE; VclButtonBoxStyle eStyle = VclButtonBoxStyle::Default;
if (rValue == "spread") if (rValue == "spread")
eStyle = VCL_BUTTONBOX_SPREAD; eStyle = VclButtonBoxStyle::Spread;
else if (rValue == "edge") else if (rValue == "edge")
eStyle = VCL_BUTTONBOX_EDGE; eStyle = VclButtonBoxStyle::Edge;
else if (rValue == "start") else if (rValue == "start")
eStyle = VCL_BUTTONBOX_START; eStyle = VclButtonBoxStyle::Start;
else if (rValue == "end") else if (rValue == "end")
eStyle = VCL_BUTTONBOX_END; eStyle = VclButtonBoxStyle::End;
else if (rValue == "center") else if (rValue == "center")
eStyle = VCL_BUTTONBOX_CENTER; eStyle = VclButtonBoxStyle::Center;
else else
{ {
SAL_WARN("vcl.layout", "unknown layout style " << rValue.getStr()); SAL_WARN("vcl.layout", "unknown layout style " << rValue.getStr());
...@@ -746,7 +746,7 @@ void VclButtonBox::setAllocation(const Size &rAllocation) ...@@ -746,7 +746,7 @@ void VclButtonBox::setAllocation(const Size &rAllocation)
//To-Do, other layout styles //To-Do, other layout styles
switch (m_eLayoutStyle) switch (m_eLayoutStyle)
{ {
case VCL_BUTTONBOX_START: case VclButtonBoxStyle::Start:
if (!aReq.m_aSubGroupDimensions.empty()) if (!aReq.m_aSubGroupDimensions.empty())
{ {
long nOtherPrimaryDimension = getPrimaryDimension( long nOtherPrimaryDimension = getPrimaryDimension(
...@@ -755,7 +755,7 @@ void VclButtonBox::setAllocation(const Size &rAllocation) ...@@ -755,7 +755,7 @@ void VclButtonBox::setAllocation(const Size &rAllocation)
nAllocPrimaryDimension - nOtherPrimaryDimension); nAllocPrimaryDimension - nOtherPrimaryDimension);
} }
break; break;
case VCL_BUTTONBOX_SPREAD: case VclButtonBoxStyle::Spread:
if (!aReq.m_aMainGroupDimensions.empty()) if (!aReq.m_aMainGroupDimensions.empty())
{ {
long nMainPrimaryDimension = getPrimaryDimension( long nMainPrimaryDimension = getPrimaryDimension(
...@@ -766,7 +766,7 @@ void VclButtonBox::setAllocation(const Size &rAllocation) ...@@ -766,7 +766,7 @@ void VclButtonBox::setAllocation(const Size &rAllocation)
setPrimaryCoordinate(aMainGroupPos, nSpacing); setPrimaryCoordinate(aMainGroupPos, nSpacing);
} }
break; break;
case VCL_BUTTONBOX_CENTER: case VclButtonBoxStyle::Center:
if (!aReq.m_aMainGroupDimensions.empty()) if (!aReq.m_aMainGroupDimensions.empty())
{ {
long nMainPrimaryDimension = getPrimaryDimension( long nMainPrimaryDimension = getPrimaryDimension(
...@@ -778,8 +778,8 @@ void VclButtonBox::setAllocation(const Size &rAllocation) ...@@ -778,8 +778,8 @@ void VclButtonBox::setAllocation(const Size &rAllocation)
default: default:
SAL_WARN("vcl.layout", "todo unimplemented layout style"); SAL_WARN("vcl.layout", "todo unimplemented layout style");
SAL_FALLTHROUGH; SAL_FALLTHROUGH;
case VCL_BUTTONBOX_DEFAULT_STYLE: case VclButtonBoxStyle::Default:
case VCL_BUTTONBOX_END: case VclButtonBoxStyle::End:
if (!aReq.m_aMainGroupDimensions.empty()) if (!aReq.m_aMainGroupDimensions.empty())
{ {
long nMainPrimaryDimension = getPrimaryDimension( long nMainPrimaryDimension = getPrimaryDimension(
...@@ -795,7 +795,7 @@ void VclButtonBox::setAllocation(const Size &rAllocation) ...@@ -795,7 +795,7 @@ void VclButtonBox::setAllocation(const Size &rAllocation)
std::vector<long>::const_iterator aPrimaryI = aReq.m_aMainGroupDimensions.begin(); std::vector<long>::const_iterator aPrimaryI = aReq.m_aMainGroupDimensions.begin();
std::vector<long>::const_iterator aSecondaryI = aReq.m_aSubGroupDimensions.begin(); std::vector<long>::const_iterator aSecondaryI = aReq.m_aSubGroupDimensions.begin();
bool bIgnoreSecondaryPacking = (m_eLayoutStyle == VCL_BUTTONBOX_SPREAD || m_eLayoutStyle == VCL_BUTTONBOX_CENTER); bool bIgnoreSecondaryPacking = (m_eLayoutStyle == VclButtonBoxStyle::Spread || m_eLayoutStyle == VclButtonBoxStyle::Center);
for (vcl::Window *pChild = GetWindow(GetWindowType::FirstChild); pChild; pChild = pChild->GetWindow(GetWindowType::Next)) for (vcl::Window *pChild = GetWindow(GetWindowType::FirstChild); pChild; pChild = pChild->GetWindow(GetWindowType::Next))
{ {
if (!pChild->IsVisible()) if (!pChild->IsVisible())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment