Kaydet (Commit) 21907d64 authored tarafından Noel Grandin's avatar Noel Grandin

convert VclSizeGroupMode to scoped enum

Change-Id: Id731fb3d5f9eb5ddaa3af41b010bff340f1077ce
Reviewed-on: https://gerrit.libreoffice.org/32290Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 29fa6183
......@@ -569,12 +569,12 @@ public:
virtual void Command(const CommandEvent& rCEvt) override;
};
enum VclSizeGroupMode
enum class VclSizeGroupMode
{
VCL_SIZE_GROUP_NONE,
VCL_SIZE_GROUP_HORIZONTAL,
VCL_SIZE_GROUP_VERTICAL,
VCL_SIZE_GROUP_BOTH
NONE,
Horizontal,
Vertical,
Both
};
class VCL_DLLPUBLIC VclSizeGroup
......@@ -588,7 +588,7 @@ private:
public:
VclSizeGroup()
: m_bIgnoreHidden(false)
, m_eMode(VCL_SIZE_GROUP_HORIZONTAL)
, m_eMode(VclSizeGroupMode::Horizontal)
{
}
void insert(vcl::Window *pWindow)
......
......@@ -2135,15 +2135,15 @@ bool VclSizeGroup::set_property(const OString &rKey, const OString &rValue)
set_ignore_hidden(toBool(rValue));
else if (rKey == "mode")
{
VclSizeGroupMode eMode = VCL_SIZE_GROUP_HORIZONTAL;
VclSizeGroupMode eMode = VclSizeGroupMode::Horizontal;
if (rValue.equals("none"))
eMode = VCL_SIZE_GROUP_NONE;
eMode = VclSizeGroupMode::NONE;
else if (rValue.equals("horizontal"))
eMode = VCL_SIZE_GROUP_HORIZONTAL;
eMode = VclSizeGroupMode::Horizontal;
else if (rValue.equals("vertical"))
eMode = VCL_SIZE_GROUP_VERTICAL;
eMode = VclSizeGroupMode::Vertical;
else if (rValue.equals("both"))
eMode = VCL_SIZE_GROUP_BOTH;
eMode = VclSizeGroupMode::Both;
else
{
SAL_WARN("vcl.layout", "unknown size group mode" << rValue.getStr());
......
......@@ -1367,7 +1367,7 @@ void Window::queue_resize(StateChangedType eReason)
}
WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
if (pWindowImpl->m_xSizeGroup && pWindowImpl->m_xSizeGroup->get_mode() != VCL_SIZE_GROUP_NONE)
if (pWindowImpl->m_xSizeGroup && pWindowImpl->m_xSizeGroup->get_mode() != VclSizeGroupMode::NONE)
{
std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();
for (VclPtr<vcl::Window> const & pOther : rWindows)
......@@ -1665,7 +1665,7 @@ Size Window::get_preferred_size() const
if (pWindowImpl->m_xSizeGroup)
{
const VclSizeGroupMode eMode = pWindowImpl->m_xSizeGroup->get_mode();
if (eMode != VCL_SIZE_GROUP_NONE)
if (eMode != VclSizeGroupMode::NONE)
{
const bool bIgnoreInHidden = pWindowImpl->m_xSizeGroup->get_ignore_hidden();
const std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();
......@@ -1677,9 +1677,9 @@ Size Window::get_preferred_size() const
if (bIgnoreInHidden && !pOther->IsVisible())
continue;
Size aOtherSize = pOther->get_ungrouped_preferred_size();
if (eMode == VCL_SIZE_GROUP_BOTH || eMode == VCL_SIZE_GROUP_HORIZONTAL)
if (eMode == VclSizeGroupMode::Both || eMode == VclSizeGroupMode::Horizontal)
aRet.Width() = std::max(aRet.Width(), aOtherSize.Width());
if (eMode == VCL_SIZE_GROUP_BOTH || eMode == VCL_SIZE_GROUP_VERTICAL)
if (eMode == VclSizeGroupMode::Both || eMode == VclSizeGroupMode::Vertical)
aRet.Height() = std::max(aRet.Height(), aOtherSize.Height());
}
}
......@@ -1934,7 +1934,7 @@ void Window::add_to_size_group(const std::shared_ptr<VclSizeGroup>& xGroup)
//To-Do, multiple groups
pWindowImpl->m_xSizeGroup = xGroup;
pWindowImpl->m_xSizeGroup->insert(this);
if (VCL_SIZE_GROUP_NONE != pWindowImpl->m_xSizeGroup->get_mode())
if (VclSizeGroupMode::NONE != pWindowImpl->m_xSizeGroup->get_mode())
queue_resize();
}
......@@ -1944,7 +1944,7 @@ void Window::remove_from_all_size_groups()
//To-Do, multiple groups
if (pWindowImpl->m_xSizeGroup)
{
if (VCL_SIZE_GROUP_NONE != pWindowImpl->m_xSizeGroup->get_mode())
if (VclSizeGroupMode::NONE != pWindowImpl->m_xSizeGroup->get_mode())
queue_resize();
pWindowImpl->m_xSizeGroup->erase(this);
pWindowImpl->m_xSizeGroup.reset();
......
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