diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-17 14:48:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-17 15:50:58 +0200 |
commit | 3e57aad962c9d24c535daff893db203314709cfc (patch) | |
tree | 5744fcaae69751cdd4174f5da6024ba656e77ccc /cui/source/options/optchart.cxx | |
parent | bb3ea0ae51bb943f7bb3dca80eee153f9c55c03e (diff) |
loplugin:flatten in cui
Change-Id: I0ea0784ab8c4542747da1e15fa7c60c60bccb602
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92423
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/options/optchart.cxx')
-rw-r--r-- | cui/source/options/optchart.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx index 4e322d0818a8..4ca091bb6c45 100644 --- a/cui/source/options/optchart.cxx +++ b/cui/source/options/optchart.cxx @@ -225,29 +225,29 @@ IMPL_LINK_NOARG( SvxDefaultColorOptPage, RemoveChartColor, weld::Button&, void ) if (nIndex == -1) return; - if( m_SvxChartColorTableUniquePtr ) - { - OSL_ENSURE(m_SvxChartColorTableUniquePtr->size() > 1, "don't delete the last chart color"); + if( !m_SvxChartColorTableUniquePtr ) + return; - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletechartcolordialog.ui")); - std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("QueryDeleteChartColorDialog")); + OSL_ENSURE(m_SvxChartColorTableUniquePtr->size() > 1, "don't delete the last chart color"); - if (RET_YES == xQuery->run()) - { - m_SvxChartColorTableUniquePtr->remove(nIndex); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletechartcolordialog.ui")); + std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("QueryDeleteChartColorDialog")); - FillBoxChartColorLB(); + if (RET_YES != xQuery->run()) + return; - m_xLbChartColors->grab_focus(); + m_SvxChartColorTableUniquePtr->remove(nIndex); - if (nIndex == m_xLbChartColors->n_children() && m_xLbChartColors->n_children() > 0) - m_xLbChartColors->select(m_SvxChartColorTableUniquePtr->size() - 1); - else if (m_xLbChartColors->n_children() > 0) - m_xLbChartColors->select( nIndex ); - else - m_xPBRemove->set_sensitive(true); - } - } + FillBoxChartColorLB(); + + m_xLbChartColors->grab_focus(); + + if (nIndex == m_xLbChartColors->n_children() && m_xLbChartColors->n_children() > 0) + m_xLbChartColors->select(m_SvxChartColorTableUniquePtr->size() - 1); + else if (m_xLbChartColors->n_children() > 0) + m_xLbChartColors->select( nIndex ); + else + m_xPBRemove->set_sensitive(true); } IMPL_LINK_NOARG( SvxDefaultColorOptPage, SelectPaletteLbHdl, weld::ComboBox&, void) |