diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-26 13:35:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-26 18:02:19 +0100 |
commit | b624b13b3d5a8e573c7de8158cadc66b1982d157 (patch) | |
tree | 56948e6a5e8d7f5a7cbde6328a27f13ecd8a72bc /cui | |
parent | 8136620ff432bf17815bef1f88c7531edb839d23 (diff) |
loplugin:flatten
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/treeopt.cxx | 28 | ||||
-rw-r--r-- | cui/source/tabpages/tpbitmap.cxx | 24 |
2 files changed, 26 insertions, 26 deletions
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index e254153ad4cc..e7bf078bcae4 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -746,22 +746,22 @@ IMPL_LINK(OfaTreeOptionsDialog, ApplyHdl_Impl, weld::Button&, rButton, void) SelectHdl_Impl(); } - if (bNeedsRestart) + if (!bNeedsRestart) + return; + + SolarMutexGuard aGuard; + weld::Window* pParent; + if (!bOkPressed) + pParent = m_xDialog.get(); + else { - SolarMutexGuard aGuard; - weld::Window* pParent; - if (!bOkPressed) - pParent = m_xDialog.get(); - else - { - m_xDialog->hide(); - pParent = m_pParent; - } - bool bRestart = ::svtools::executeRestartDialog(comphelper::getProcessComponentContext(), - pParent, eRestartReason); - if (bRestart && !bOkPressed) - m_xDialog->response(RET_OK); + m_xDialog->hide(); + pParent = m_pParent; } + bool bRestart = ::svtools::executeRestartDialog(comphelper::getProcessComponentContext(), + pParent, eRestartReason); + if (bRestart && !bOkPressed) + m_xDialog->response(RET_OK); } void OfaTreeOptionsDialog::ApplyItemSets() diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 647bcaa105e3..f0a239775d13 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -563,21 +563,21 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl, SvxPresetListBox*, void) std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletebitmapdialog.ui")); std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelBitmapDialog")); - if (xQueryBox->run() == RET_YES) - { - sal_uInt16 nNextId = m_xBitmapLB->GetItemId(nPos + 1); - if (!nNextId) - nNextId = m_xBitmapLB->GetItemId(nPos - 1); + if (xQueryBox->run() != RET_YES) + return; - m_pBitmapList->Remove( static_cast<sal_uInt16>(nPos) ); - m_xBitmapLB->RemoveItem( nId ); + sal_uInt16 nNextId = m_xBitmapLB->GetItemId(nPos + 1); + if (!nNextId) + nNextId = m_xBitmapLB->GetItemId(nPos - 1); - m_xBitmapLB->SelectItem(nNextId); + m_pBitmapList->Remove( static_cast<sal_uInt16>(nPos) ); + m_xBitmapLB->RemoveItem( nId ); - m_aCtlBitmapPreview.Invalidate(); - ModifyBitmapHdl(m_xBitmapLB.get()); - *m_pnBitmapListState |= ChangeType::MODIFIED; - } + m_xBitmapLB->SelectItem(nNextId); + + m_aCtlBitmapPreview.Invalidate(); + ModifyBitmapHdl(m_xBitmapLB.get()); + *m_pnBitmapListState |= ChangeType::MODIFIED; } IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapSizeHdl, weld::MetricSpinButton&, void ) |