diff options
author | Noel Grandin <noel@peralex.com> | 2016-01-11 08:39:18 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-01-11 10:49:24 +0200 |
commit | 6fc3fd29a6d08ee85d3ed5a3bad5de754f568314 (patch) | |
tree | a76c62a18f860863d94652400688d64660b72ad0 | |
parent | bc80f951c14208eae6060fe2e6a941f9dd2d619c (diff) |
loplugin:unusedmethods unused return value in chart2
Change-Id: Ibd8ae8ade2a1037deac1e29ce1b867c2847a9dff
17 files changed, 15 insertions, 119 deletions
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx index 5b9545bc15f2..974119758335 100644 --- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx +++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx @@ -136,7 +136,7 @@ uno::Reference< drawing::XDrawPage > Chart2ModelContact::getDrawPage() return xResult; } -bool Chart2ModelContact::getExplicitValuesForAxis( +void Chart2ModelContact::getExplicitValuesForAxis( const Reference< XAxis > & xAxis, ExplicitScaleData & rOutExplicitScale, ExplicitIncrementData & rOutExplicitIncrement ) @@ -144,10 +144,9 @@ bool Chart2ModelContact::getExplicitValuesForAxis( ExplicitValueProvider* pProvider( getExplicitValueProvider() ); if( pProvider ) { - return pProvider->getExplicitValuesForAxis( + pProvider->getExplicitValuesForAxis( xAxis, rOutExplicitScale, rOutExplicitIncrement ); } - return false; } sal_Int32 Chart2ModelContact::getExplicitNumberFormatKeyForAxis( diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx index 56a0c2ded580..1491c79806a4 100644 --- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx +++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx @@ -70,7 +70,7 @@ public: /** get the current values calculated for an axis in the current view in case properties are 'auto'. */ - bool getExplicitValuesForAxis( + void getExplicitValuesForAxis( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis > & xAxis, ExplicitScaleData & rOutExplicitScale, diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx index 768d92367af1..7b60554698e4 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx @@ -332,7 +332,7 @@ uno::Reference< XChartTypeTemplate > ChartTypeDialogController::getCurrentTempla return xTemplate; } -bool ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParameter +void ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParameter , const uno::Reference< XChartDocument >& xChartModel ) { uno::Reference< lang::XMultiServiceFactory > xTemplateManager( xChartModel->getChartTypeManager(), uno::UNO_QUERY ); @@ -360,7 +360,6 @@ bool ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParame xDiaProp->setPropertyValue(CHART_UNONAME_SORT_BY_XVALUES, uno::makeAny(rParameter.bSortByXValues)); } } - return false; } void ChartTypeDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ ) { diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx index f3b80ffccc71..6999d504779f 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx @@ -118,7 +118,7 @@ public: virtual void adjustParameterToSubType( ChartTypeParameter& rParameter ); virtual void adjustParameterToMainType( ChartTypeParameter& rParameter ); OUString getServiceNameForParameter( const ChartTypeParameter& rParameter ) const; - bool commitToModel( const ChartTypeParameter& rParameter + void commitToModel( const ChartTypeParameter& rParameter , const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartModel ); ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartTypeTemplate > getCurrentTemplate( const ChartTypeParameter& rParameter diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index 8ab0d411b98a..8a933ad240a1 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -712,18 +712,14 @@ void DataBrowser::Resize() SetUpdateMode( bLastUpdateMode ); } -bool DataBrowser::SetReadOnly( bool bNewState ) +void DataBrowser::SetReadOnly( bool bNewState ) { - bool bResult = m_bIsReadOnly; - if( m_bIsReadOnly != bNewState ) { m_bIsReadOnly = bNewState; Invalidate(); DeactivateCell(); } - - return bResult; } void DataBrowser::SetClean() diff --git a/chart2/source/controller/dialogs/DataBrowser.hxx b/chart2/source/controller/dialogs/DataBrowser.hxx index febd028a67de..be6d2a84ade8 100644 --- a/chart2/source/controller/dialogs/DataBrowser.hxx +++ b/chart2/source/controller/dialogs/DataBrowser.hxx @@ -90,8 +90,7 @@ public: // Window virtual void Resize() override; - /// @return old state - bool SetReadOnly( bool bNewState ); + void SetReadOnly( bool bNewState ); bool IsReadOnly() const { return m_bIsReadOnly;} /// reset the dirty status, if changes have been saved diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index 9e3d0ae25a10..a6d8dcffd589 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -705,7 +705,7 @@ void DialogModel::startControllerLockTimer() m_aTimerTriggeredControllerLock.startTimer(); } -bool DialogModel::setData( +void DialogModel::setData( const Sequence< beans::PropertyValue > & rArguments ) { m_aTimerTriggeredControllerLock.startTimer(); @@ -716,7 +716,7 @@ bool DialogModel::setData( ! m_xTemplate.is() ) { OSL_FAIL( "Model objects missing" ); - return false; + return; } try @@ -746,10 +746,7 @@ bool DialogModel::setData( catch( const uno::Exception & ex ) { ASSERT_EXCEPTION( ex ); - return false; } - - return true; } void DialogModel::setTimeBasedRange( bool bTimeBased, sal_Int32 nStart, sal_Int32 nEnd) const diff --git a/chart2/source/controller/dialogs/DialogModel.hxx b/chart2/source/controller/dialogs/DialogModel.hxx index 773d257ff5e5..7f2013510953 100644 --- a/chart2/source/controller/dialogs/DialogModel.hxx +++ b/chart2/source/controller/dialogs/DialogModel.hxx @@ -148,7 +148,7 @@ public: bool allArgumentsForRectRangeDetected() const; - bool setData( const ::com::sun::star::uno::Sequence< + void setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > & rArguments ); void setTimeBasedRange( bool bTimeBased, sal_Int32 nStart, sal_Int32 nEnd) const; diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx index 2837307c6dbe..bbd04907378e 100644 --- a/chart2/source/controller/dialogs/res_ErrorBar.cxx +++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx @@ -719,7 +719,7 @@ void ErrorBarResources::disposingRangeSelection() m_apRangeSelectionHelper->stopRangeListening( false ); } -bool ErrorBarResources::isRangeFieldContentValid( Edit & rEdit ) +void ErrorBarResources::isRangeFieldContentValid( Edit & rEdit ) { OUString aRange( rEdit.GetText()); bool bIsValid = ( aRange.isEmpty() ) || @@ -736,8 +736,6 @@ bool ErrorBarResources::isRangeFieldContentValid( Edit & rEdit ) rEdit.SetControlBackground( RANGE_SELECTION_INVALID_RANGE_BACKGROUND_COLOR ); rEdit.SetControlForeground( RANGE_SELECTION_INVALID_RANGE_FOREGROUND_COLOR ); } - - return bIsValid; } } //namespace chart diff --git a/chart2/source/controller/inc/res_ErrorBar.hxx b/chart2/source/controller/inc/res_ErrorBar.hxx index 8105e92df53e..155b9f9410d6 100644 --- a/chart2/source/controller/inc/res_ErrorBar.hxx +++ b/chart2/source/controller/inc/res_ErrorBar.hxx @@ -131,7 +131,7 @@ private: DECL_LINK_TYPED( RangeChanged, Edit&, void ); void UpdateControlStates(); - bool isRangeFieldContentValid( Edit & rEdit ); + void isRangeFieldContentValid( Edit & rEdit ); }; } //namespace chart diff --git a/chart2/source/inc/CloneHelper.hxx b/chart2/source/inc/CloneHelper.hxx index 24e5f1c25611..6d1f44f130ed 100644 --- a/chart2/source/inc/CloneHelper.hxx +++ b/chart2/source/inc/CloneHelper.hxx @@ -47,25 +47,6 @@ template< class Interface > } }; -/// functor that clones a map element with a UNO-Reference as value -template< typename Key, class Interface > - struct CreateRefWithKeyClone : public ::std::unary_function< - ::std::pair< Key, Interface >, - ::std::pair< Key, Interface > > -{ - ::std::pair< Key, Interface > operator() ( - const ::std::pair< Key, Interface > & rOther ) - { - Interface xResult; - ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > - xCloneable( rOther.second, ::com::sun::star::uno::UNO_QUERY ); - if( xCloneable.is()) - xResult.set( xCloneable->createClone(), ::com::sun::star::uno::UNO_QUERY ); - - return ::std::make_pair< Key, Interface >( rOther.first, xResult ); - } -}; - /// clones a vector of UNO-References template< class Interface > void CloneRefVector( diff --git a/chart2/source/inc/CommonFunctors.hxx b/chart2/source/inc/CommonFunctors.hxx index 01e44d6e6f19..4599d0c47bad 100644 --- a/chart2/source/inc/CommonFunctors.hxx +++ b/chart2/source/inc/CommonFunctors.hxx @@ -134,46 +134,6 @@ struct OOO_DLLPUBLIC_CHARTTOOLS DoubleToOUString : public ::std::unary_function< } }; -/** can be used to find an element with a specific first element in e.g. a - vector of pairs (for searching keys in maps you will of course use map::find) - */ -template< typename First, typename Second > - class FirstOfPairEquals : public ::std::unary_function< ::std::pair< First, Second >, bool > -{ -public: - FirstOfPairEquals( const First & aVal ) - : m_aValueToCompareWith( aVal ) - {} - bool operator() ( const ::std::pair< First, Second > & rElem ) - { - return rElem.first == m_aValueToCompareWith; - } - -private: - First m_aValueToCompareWith; -}; - -/** can be used to find a certain value in a map - - ::std::find_if( aMap.begin(), aMap.end(), - SecondOfPairEquals< string, int >( 42 )); - */ -template< typename Key, typename Value > - class SecondOfPairEquals : public ::std::unary_function< ::std::pair< Key, Value >, bool > -{ -public: - SecondOfPairEquals( const Value & aVal ) - : m_aValueToCompareWith( aVal ) - {} - bool operator() ( const ::std::pair< Key, Value > & rMapElem ) - { - return rMapElem.second == m_aValueToCompareWith; - } - -private: - Value m_aValueToCompareWith; -}; - } // namespace CommonFunctors } // namespace chart diff --git a/chart2/source/inc/LifeTime.hxx b/chart2/source/inc/LifeTime.hxx index 83b6b2b9964c..6034027ed176 100644 --- a/chart2/source/inc/LifeTime.hxx +++ b/chart2/source/inc/LifeTime.hxx @@ -97,7 +97,7 @@ OOO_DLLPUBLIC_CHARTTOOLS bool g_close_isNeedToCancelLongLastingCalls( bool throw ( ::com::sun::star::util::CloseVetoException ); OOO_DLLPUBLIC_CHARTTOOLS void g_close_endTryClose(bool bDeliverOwnership, bool bMyVeto ); OOO_DLLPUBLIC_CHARTTOOLS void g_close_endTryClose_doClose(); -OOO_DLLPUBLIC_CHARTTOOLS bool g_addCloseListener( const ::com::sun::star::uno::Reference< +OOO_DLLPUBLIC_CHARTTOOLS void g_addCloseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener > & xListener ) throw(::com::sun::star::uno::RuntimeException); diff --git a/chart2/source/inc/PropertyHelper.hxx b/chart2/source/inc/PropertyHelper.hxx index 9d52c07a4022..5e82292d2762 100644 --- a/chart2/source/inc/PropertyHelper.hxx +++ b/chart2/source/inc/PropertyHelper.hxx @@ -152,33 +152,6 @@ struct OOO_DLLPUBLIC_CHARTTOOLS PropertyNameLess } }; -struct OOO_DLLPUBLIC_CHARTTOOLS PropertyLess : public ::std::binary_function< - ::com::sun::star::beans::Property, - ::com::sun::star::beans::Property, - bool > -{ - bool operator() ( const ::com::sun::star::beans::Property & rFirst, - const ::com::sun::star::beans::Property & rSecond ) - { - return ( rFirst.Name.compareTo( rSecond.Name ) < 0 ); - } -}; - -struct OOO_DLLPUBLIC_CHARTTOOLS PropertyValueNameEquals : public ::std::unary_function< ::com::sun::star::beans::PropertyValue, bool > -{ - explicit PropertyValueNameEquals( const OUString & rName ) : - m_aName( rName ) - {} - - bool operator() ( const ::com::sun::star::beans::PropertyValue & rPropValue ) - { - return rPropValue.Name.equals( m_aName ); - } - -private: - OUString m_aName; -}; - } // namespace chart // INCLUDED_CHART2_SOURCE_INC_PROPERTYHELPER_HXX diff --git a/chart2/source/inc/chartview/DrawModelWrapper.hxx b/chart2/source/inc/chartview/DrawModelWrapper.hxx index b3d218c233f7..2f43bd5938ff 100644 --- a/chart2/source/inc/chartview/DrawModelWrapper.hxx +++ b/chart2/source/inc/chartview/DrawModelWrapper.hxx @@ -68,7 +68,6 @@ public: OutputDevice* getReferenceDevice() const; SfxItemPool& GetItemPool(); - SAL_DLLPRIVATE const SfxItemPool& GetItemPool() const; SAL_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel() override; diff --git a/chart2/source/tools/LifeTime.cxx b/chart2/source/tools/LifeTime.cxx index bfc62eabad93..840692b0d533 100644 --- a/chart2/source/tools/LifeTime.cxx +++ b/chart2/source/tools/LifeTime.cxx @@ -373,18 +373,17 @@ void CloseableLifeTimeManager::impl_doClose() //mutex will be reacquired in destructor of aNegativeGuard } -bool CloseableLifeTimeManager::g_addCloseListener( const uno::Reference< util::XCloseListener > & xListener ) +void CloseableLifeTimeManager::g_addCloseListener( const uno::Reference< util::XCloseListener > & xListener ) throw(uno::RuntimeException) { osl::Guard< osl::Mutex > aGuard( m_aAccessMutex ); //Mutex needs to be acquired exactly ones; will be released inbetween if( !impl_canStartApiCall() ) - return false; + return; //mutex is acquired m_aListenerContainer.addInterface( cppu::UnoType<util::XCloseListener>::get(),xListener ); m_bOwnership = false; - return true; } bool CloseableLifeTimeManager::impl_canStartApiCall() diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx index aac0b9aa822c..6cc2a9dd4bf8 100644 --- a/chart2/source/view/main/DrawModelWrapper.cxx +++ b/chart2/source/view/main/DrawModelWrapper.cxx @@ -260,10 +260,6 @@ SfxItemPool& DrawModelWrapper::GetItemPool() { return this->SdrModel::GetItemPool(); } -const SfxItemPool& DrawModelWrapper::GetItemPool() const -{ - return this->SdrModel::GetItemPool(); -} XColorListRef DrawModelWrapper::GetColorList() const { return this->SdrModel::GetColorList(); |