summaryrefslogtreecommitdiffstats
path: root/chart2/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-01 16:12:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-01 21:41:12 +0200
commitd1ea4db02dac313a9836b26f05f00e9a34b25600 (patch)
tree29d7e7c1f4d67ebfc6675175952dd6c8f63cfc2f /chart2/source
parentloplugin:returnconstant in connectivity (diff)
downloadcore-d1ea4db02dac313a9836b26f05f00e9a34b25600.tar.gz
core-d1ea4db02dac313a9836b26f05f00e9a34b25600.zip
loplugin:returnconstant in chart2
Change-Id: If44096ccf8d176023a1b7b8ae722e04417e4c131 Reviewed-on: https://gerrit.libreoffice.org/58425 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertLegend.cxx3
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.cxx4
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.hxx2
-rw-r--r--chart2/source/controller/dialogs/res_ErrorBar.cxx4
-rw-r--r--chart2/source/controller/dialogs/res_Trendline.cxx4
-rw-r--r--chart2/source/controller/dialogs/res_Trendline.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_DataLabel.cxx3
-rw-r--r--chart2/source/controller/dialogs/tp_ErrorBars.cxx3
-rw-r--r--chart2/source/controller/dialogs/tp_Trendline.cxx3
-rw-r--r--chart2/source/controller/inc/dlg_InsertLegend.hxx2
-rw-r--r--chart2/source/controller/inc/res_ErrorBar.hxx2
-rw-r--r--chart2/source/controller/main/ChartController_Insert.cxx5
-rw-r--r--chart2/source/inc/LifeTime.hxx2
-rw-r--r--chart2/source/model/main/ChartModel.cxx7
-rw-r--r--chart2/source/tools/LifeTime.cxx4
-rw-r--r--chart2/source/view/axes/VPolarAngleAxis.cxx9
-rw-r--r--chart2/source/view/axes/VPolarAngleAxis.hxx2
17 files changed, 24 insertions, 37 deletions
diff --git a/chart2/source/controller/dialogs/dlg_InsertLegend.cxx b/chart2/source/controller/dialogs/dlg_InsertLegend.cxx
index a2b9531f078c..32acbeac5784 100644
--- a/chart2/source/controller/dialogs/dlg_InsertLegend.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertLegend.cxx
@@ -38,10 +38,9 @@ void SchLegendDlg::init( const uno::Reference< frame::XModel >& xChartModel )
m_xLegendPositionResources->writeToResources( xChartModel );
}
-bool SchLegendDlg::writeToModel( const uno::Reference< frame::XModel >& xChartModel ) const
+void SchLegendDlg::writeToModel( const uno::Reference< frame::XModel >& xChartModel ) const
{
m_xLegendPositionResources->writeToModel( xChartModel );
- return true;
}
} //namespace chart
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index fb3cc7783eb8..547f081e155c 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -266,7 +266,7 @@ void DataLabelResources::EnableControls()
m_pBxOrientation->Enable( bEnableRotation );
}
-bool DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const
+void DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const
{
if( m_pCBNumber->IsChecked() )
{
@@ -312,8 +312,6 @@ bool DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const
sal_Int32 nDegrees = m_pDC_Dial->GetRotation();
rOutAttrs->Put(SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) );
}
-
- return true;
}
void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx b/chart2/source/controller/dialogs/res_DataLabel.hxx
index 4d779de5e9d7..94dd92696871 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.hxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.hxx
@@ -37,7 +37,7 @@ public:
DataLabelResources( VclBuilderContainer* pWindow, vcl::Window* pParent, const SfxItemSet& rInAttrs );
~DataLabelResources();
- bool FillItemSet(SfxItemSet* rOutAttrs) const;
+ void FillItemSet(SfxItemSet* rOutAttrs) const;
void Reset(const SfxItemSet& rInAttrs);
void SetNumberFormatter( SvNumberFormatter* pFormatter );
diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx
index 15ce9829516a..c01cf63c7eeb 100644
--- a/chart2/source/controller/dialogs/res_ErrorBar.cxx
+++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx
@@ -602,7 +602,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
UpdateControlStates();
}
-bool ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const
+void ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const
{
if( m_bErrorKindUnique )
rOutAttrs.Put( SvxChartKindErrorItem( m_eErrorKind, SCHATTR_STAT_KIND_ERROR ));
@@ -656,8 +656,6 @@ bool ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const
}
rOutAttrs.Put( SfxBoolItem( SCHATTR_STAT_ERRORBAR_TYPE , m_eErrorBarType == ERROR_BAR_Y ));
-
- return true;
}
void ErrorBarResources::FillValueSets()
diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx
index 0d6805af6155..a28a9da7f311 100644
--- a/chart2/source/controller/dialogs/res_Trendline.cxx
+++ b/chart2/source/controller/dialogs/res_Trendline.cxx
@@ -262,7 +262,7 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
}
}
-bool TrendlineResources::FillItemSet(SfxItemSet* rOutAttrs) const
+void TrendlineResources::FillItemSet(SfxItemSet* rOutAttrs) const
{
if( m_bTrendLineUnique )
rOutAttrs->Put( SvxChartRegressItem( m_eTrendLineType, SCHATTR_REGRESSION_TYPE ));
@@ -305,8 +305,6 @@ bool TrendlineResources::FillItemSet(SfxItemSet* rOutAttrs) const
aValue = 0.0;
(void)m_pNumFormatter->IsNumberFormat(m_pFmtFld_InterceptValue->GetText(),nIndex,aValue);
rOutAttrs->Put(SvxDoubleItem( aValue, SCHATTR_REGRESSION_INTERCEPT_VALUE ) );
-
- return true;
}
void TrendlineResources::FillValueSets()
diff --git a/chart2/source/controller/dialogs/res_Trendline.hxx b/chart2/source/controller/dialogs/res_Trendline.hxx
index ffe35e738cd2..2829c3792abc 100644
--- a/chart2/source/controller/dialogs/res_Trendline.hxx
+++ b/chart2/source/controller/dialogs/res_Trendline.hxx
@@ -38,7 +38,7 @@ public:
~TrendlineResources();
void Reset(const SfxItemSet& rInAttrs);
- bool FillItemSet(SfxItemSet* rOutAttrs) const;
+ void FillItemSet(SfxItemSet* rOutAttrs) const;
void FillValueSets();
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.cxx b/chart2/source/controller/dialogs/tp_DataLabel.cxx
index 9d92ffa834cc..88365d9a5572 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_DataLabel.cxx
@@ -40,7 +40,8 @@ VclPtr<SfxTabPage> DataLabelsTabPage::Create(TabPageParent pWindow, const SfxIte
bool DataLabelsTabPage::FillItemSet(SfxItemSet* rOutAttrs)
{
- return m_aDataLabelResources.FillItemSet(rOutAttrs);
+ m_aDataLabelResources.FillItemSet(rOutAttrs);
+ return true;
}
void DataLabelsTabPage::Reset(const SfxItemSet* rInAttrs)
diff --git a/chart2/source/controller/dialogs/tp_ErrorBars.cxx b/chart2/source/controller/dialogs/tp_ErrorBars.cxx
index f2a8084e4711..540df87b209c 100644
--- a/chart2/source/controller/dialogs/tp_ErrorBars.cxx
+++ b/chart2/source/controller/dialogs/tp_ErrorBars.cxx
@@ -48,7 +48,8 @@ VclPtr<SfxTabPage> ErrorBarsTabPage::Create(
bool ErrorBarsTabPage::FillItemSet( SfxItemSet* rOutAttrs )
{
- return m_aErrorBarResources.FillItemSet( *rOutAttrs );
+ m_aErrorBarResources.FillItemSet( *rOutAttrs );
+ return true;
}
void ErrorBarsTabPage::Reset( const SfxItemSet* rInAttrs )
diff --git a/chart2/source/controller/dialogs/tp_Trendline.cxx b/chart2/source/controller/dialogs/tp_Trendline.cxx
index 8909c11257c2..dc316a8fa54a 100644
--- a/chart2/source/controller/dialogs/tp_Trendline.cxx
+++ b/chart2/source/controller/dialogs/tp_Trendline.cxx
@@ -38,7 +38,8 @@ VclPtr<SfxTabPage> TrendlineTabPage::Create(
bool TrendlineTabPage::FillItemSet( SfxItemSet* rOutAttrs )
{
- return m_aTrendlineResources.FillItemSet( rOutAttrs );
+ m_aTrendlineResources.FillItemSet( rOutAttrs );
+ return true;
}
void TrendlineTabPage::Reset( const SfxItemSet* rInAttrs )
diff --git a/chart2/source/controller/inc/dlg_InsertLegend.hxx b/chart2/source/controller/inc/dlg_InsertLegend.hxx
index e93e72b9218d..5376a48040e7 100644
--- a/chart2/source/controller/inc/dlg_InsertLegend.hxx
+++ b/chart2/source/controller/inc/dlg_InsertLegend.hxx
@@ -40,7 +40,7 @@ public:
SchLegendDlg( vcl::Window* pParent, const css::uno::Reference< css::uno::XComponentContext>& xCC );
void init( const css::uno::Reference< css::frame::XModel >& xChartModel );
- bool writeToModel( const css::uno::Reference< css::frame::XModel >& xChartModel ) const;
+ void writeToModel( const css::uno::Reference< css::frame::XModel >& xChartModel ) const;
};
} //namespace chart
diff --git a/chart2/source/controller/inc/res_ErrorBar.hxx b/chart2/source/controller/inc/res_ErrorBar.hxx
index 7df3664bd27e..548747ae37bb 100644
--- a/chart2/source/controller/inc/res_ErrorBar.hxx
+++ b/chart2/source/controller/inc/res_ErrorBar.hxx
@@ -54,7 +54,7 @@ public:
void SetChartDocumentForRangeChoosing(
const css::uno::Reference< css::chart2::XChartDocument > & xChartDocument );
void Reset(const SfxItemSet& rInAttrs);
- bool FillItemSet(SfxItemSet& rOutAttrs) const;
+ void FillItemSet(SfxItemSet& rOutAttrs) const;
void FillValueSets();
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 4062334cdeb4..d0fb2d10e323 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -228,9 +228,8 @@ void ChartController::executeDispatch_OpenLegendDialog()
{
// lock controllers till end of block
ControllerLockGuardUNO aCLGuard( getModel() );
- bool bChanged = aDlg->writeToModel( getModel() );
- if( bChanged )
- aUndoGuard.commit();
+ aDlg->writeToModel( getModel() );
+ aUndoGuard.commit();
}
}
catch(const uno::RuntimeException& e)
diff --git a/chart2/source/inc/LifeTime.hxx b/chart2/source/inc/LifeTime.hxx
index 013085d72d14..db6320299f1c 100644
--- a/chart2/source/inc/LifeTime.hxx
+++ b/chart2/source/inc/LifeTime.hxx
@@ -91,7 +91,7 @@ OOO_DLLPUBLIC_CHARTTOOLS bool impl_isDisposedOrClosed( bool bAssert=true )
/// @throws css::uno::Exception
OOO_DLLPUBLIC_CHARTTOOLS bool g_close_startTryClose(bool bDeliverOwnership);
/// @throws css::util::CloseVetoException
-OOO_DLLPUBLIC_CHARTTOOLS bool g_close_isNeedToCancelLongLastingCalls( bool bDeliverOwnership, css::util::CloseVetoException const & ex );
+OOO_DLLPUBLIC_CHARTTOOLS void g_close_isNeedToCancelLongLastingCalls( bool bDeliverOwnership, css::util::CloseVetoException const & ex );
OOO_DLLPUBLIC_CHARTTOOLS void g_close_endTryClose(bool bDeliverOwnership );
OOO_DLLPUBLIC_CHARTTOOLS void g_close_endTryClose_doClose();
/// @throws css::uno::RuntimeException
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 2560796e6c61..c69fea24182f 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -631,12 +631,7 @@ void SAL_CALL ChartModel::close( sal_Bool bDeliverOwnership )
"the model itself could not be closed",
static_cast< ::cppu::OWeakObject* >(this) );
- if( m_aLifeTimeManager.g_close_isNeedToCancelLongLastingCalls( bDeliverOwnership, aVetoException ) )
- {
- m_aLifeTimeManager.g_close_endTryClose( bDeliverOwnership );
- throw aVetoException;
- }
-
+ m_aLifeTimeManager.g_close_isNeedToCancelLongLastingCalls( bDeliverOwnership, aVetoException );
}
m_aLifeTimeManager.g_close_endTryClose_doClose();
diff --git a/chart2/source/tools/LifeTime.cxx b/chart2/source/tools/LifeTime.cxx
index 85349fe6bd2c..d153f63ad5fe 100644
--- a/chart2/source/tools/LifeTime.cxx
+++ b/chart2/source/tools/LifeTime.cxx
@@ -259,7 +259,7 @@ void CloseableLifeTimeManager::g_close_endTryClose(bool bDeliverOwnership )
impl_unregisterApiCall(false);
}
-bool CloseableLifeTimeManager::g_close_isNeedToCancelLongLastingCalls( bool bDeliverOwnership, util::CloseVetoException const & ex )
+void CloseableLifeTimeManager::g_close_isNeedToCancelLongLastingCalls( bool bDeliverOwnership, util::CloseVetoException const & ex )
{
//this method is called when no closelistener has had a veto during queryclosing
//the method returns false, if nothing stands against closing anymore
@@ -269,7 +269,7 @@ bool CloseableLifeTimeManager::g_close_isNeedToCancelLongLastingCalls( bool bDel
osl::Guard< osl::Mutex > aGuard( m_aAccessMutex );
//this count cannot grow after try of close has started, because we wait in all those methods for end of try closing
if( !m_nLongLastingCallCount )
- return false;
+ return;
impl_setOwnership( bDeliverOwnership, true );
diff --git a/chart2/source/view/axes/VPolarAngleAxis.cxx b/chart2/source/view/axes/VPolarAngleAxis.cxx
index 404db2e4c0b8..64ec7be67d6f 100644
--- a/chart2/source/view/axes/VPolarAngleAxis.cxx
+++ b/chart2/source/view/axes/VPolarAngleAxis.cxx
@@ -45,7 +45,7 @@ VPolarAngleAxis::~VPolarAngleAxis()
{
}
-bool VPolarAngleAxis::createTextShapes_ForAngleAxis(
+void VPolarAngleAxis::createTextShapes_ForAngleAxis(
const uno::Reference< drawing::XShapes >& xTarget
, EquidistantTickIter& rTickIter
, AxisLabelProperties const & rAxisLabelProperties
@@ -132,7 +132,6 @@ bool VPolarAngleAxis::createTextShapes_ForAngleAxis(
//if NO OVERLAP -> remove overlapping shapes
//@todo
}
- return true;
}
void VPolarAngleAxis::createMaximumLabels()
@@ -176,12 +175,10 @@ void VPolarAngleAxis::createLabels()
AxisLabelProperties aAxisLabelProperties( m_aAxisLabelProperties );
aAxisLabelProperties.bOverlapAllowed = true;
double const fLogicZ = 1.0;//as defined
- while( !createTextShapes_ForAngleAxis( m_xTextTarget, aTickIter
+ createTextShapes_ForAngleAxis( m_xTextTarget, aTickIter
, aAxisLabelProperties
, fLogicRadius, fLogicZ
- ) )
- {
- }
+ );
//no staggering for polar angle axis
}
diff --git a/chart2/source/view/axes/VPolarAngleAxis.hxx b/chart2/source/view/axes/VPolarAngleAxis.hxx
index 993a5ce5fef6..3ee9e7e15837 100644
--- a/chart2/source/view/axes/VPolarAngleAxis.hxx
+++ b/chart2/source/view/axes/VPolarAngleAxis.hxx
@@ -40,7 +40,7 @@ public:
virtual void createShapes() override;
private: //methods
- bool createTextShapes_ForAngleAxis(
+ void createTextShapes_ForAngleAxis(
const css::uno::Reference< css::drawing::XShapes >& xTarget
, EquidistantTickIter& rTickIter
, AxisLabelProperties const & rAxisLabelProperties