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

loplugin:returnconstant in chart2

Change-Id: If44096ccf8d176023a1b7b8ae722e04417e4c131
Reviewed-on: https://gerrit.libreoffice.org/58425
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 4a779c4d
......@@ -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
......
......@@ -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)
......
......@@ -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 );
......
......@@ -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()
......
......@@ -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()
......
......@@ -38,7 +38,7 @@ public:
~TrendlineResources();
void Reset(const SfxItemSet& rInAttrs);
bool FillItemSet(SfxItemSet* rOutAttrs) const;
void FillItemSet(SfxItemSet* rOutAttrs) const;
void FillValueSets();
......
......@@ -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)
......
......@@ -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 )
......
......@@ -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 )
......
......@@ -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
......
......@@ -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();
......
......@@ -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)
......
......@@ -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
......
......@@ -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();
......
......@@ -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 );
......
......@@ -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
}
......
......@@ -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
......
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