From 9df2821e61979dab32390d5c64dd49bee868adbb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 18 Apr 2020 14:08:51 +0200 Subject: loplugin:flatten in chart2 Change-Id: Iadc4da6515a7d82e7a92b33d74d589b61fa2c64f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92480 Tested-by: Jenkins Reviewed-by: Noel Grandin --- chart2/source/controller/dialogs/res_DataLabel.cxx | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'chart2/source/controller/dialogs/res_DataLabel.cxx') diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx index 741325178b89..ca1918c170ee 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.cxx +++ b/chart2/source/controller/dialogs/res_DataLabel.cxx @@ -196,21 +196,21 @@ IMPL_LINK(DataLabelResources, NumberFormatDialogHdl, weld::Button&, rButton, voi NumberFormatDialog aDlg(m_pWindow, aNumberSet); if( bPercent ) aDlg.set_title(m_xFT_NumberFormatForPercent->get_label()); - if (aDlg.run() == RET_OK) + if (aDlg.run() != RET_OK) + return; + + const SfxItemSet* pResult = aDlg.GetOutputItemSet(); + if( pResult ) { - const SfxItemSet* pResult = aDlg.GetOutputItemSet(); - if( pResult ) - { - bool bOldSource = rUseSourceFormat; - sal_uLong nOldFormat = rnFormatKey; - bool bOldMixedState = rbMixedState || rbSourceMixedState; + bool bOldSource = rUseSourceFormat; + sal_uLong nOldFormat = rnFormatKey; + bool bOldMixedState = rbMixedState || rbSourceMixedState; - rbMixedState = !lcl_ReadNumberFormatFromItemSet( *pResult, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, rnFormatKey, rUseSourceFormat, rbSourceMixedState ); + rbMixedState = !lcl_ReadNumberFormatFromItemSet( *pResult, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, rnFormatKey, rUseSourceFormat, rbSourceMixedState ); - //todo this maybe can be removed when the numberformatter dialog does handle mixed state for source format correctly - if( bOldMixedState && bOldSource == rUseSourceFormat && nOldFormat == rnFormatKey ) - rbMixedState = rbSourceMixedState = true; - } + //todo this maybe can be removed when the numberformatter dialog does handle mixed state for source format correctly + if( bOldMixedState && bOldSource == rUseSourceFormat && nOldFormat == rnFormatKey ) + rbMixedState = rbSourceMixedState = true; } } -- cgit