diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-02-07 14:27:52 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2017-02-12 23:00:59 +0000 |
commit | 608811c2cb507176530aad0e7e6da81335ecaf10 (patch) | |
tree | 5a91691da6c297623726433361cc967215c96723 /chart2 | |
parent | [API CHANGE] Add PopupRequest - a callback to open a pop-up win. in calc (diff) | |
download | core-608811c2cb507176530aad0e7e6da81335ecaf10.tar.gz core-608811c2cb507176530aad0e7e6da81335ecaf10.zip |
chart2: simplify and/or clean-up and c++11 features
Change-Id: I4550d04ae4bf6e45f24e34dfb2babc0fdef8ba5a
Reviewed-on: https://gerrit.libreoffice.org/34006
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/dialogs/DataBrowserModel.cxx | 12 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/TitleDialogData.cxx | 10 | ||||
-rw-r--r-- | chart2/source/inc/DisposeHelper.hxx | 34 |
3 files changed, 25 insertions, 31 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx index 83064a1ee56f..55bbefecbeb4 100644 --- a/chart2/source/controller/dialogs/DataBrowserModel.cxx +++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx @@ -958,16 +958,10 @@ void DataBrowserModel::addErrorBarRanges( if( xErrorLSequence.is()) aSequences.push_back( xErrorLSequence ); - for( ::std::vector< Reference< chart2::data::XLabeledDataSequence > >::const_iterator aIt( aSequences.begin()); - aIt != aSequences.end(); ++aIt ) + for (Reference<chart2::data::XLabeledDataSequence> const & rDataSequence : aSequences) { - m_aColumns.push_back( - tDataColumn( - xDataSeries, - lcl_getUIRoleName( *aIt ), - *aIt, - NUMBER, - nNumberFormatKey )); + m_aColumns.push_back(tDataColumn(xDataSeries, lcl_getUIRoleName(rDataSequence), + rDataSequence, NUMBER, nNumberFormatKey)); ++rInOutSequenceIndex; ++rInOutHeaderEnd; } diff --git a/chart2/source/controller/dialogs/TitleDialogData.cxx b/chart2/source/controller/dialogs/TitleDialogData.cxx index 8ab0a3623f97..892c9a46003d 100644 --- a/chart2/source/controller/dialogs/TitleDialogData.cxx +++ b/chart2/source/controller/dialogs/TitleDialogData.cxx @@ -33,11 +33,11 @@ TitleDialogData::TitleDialogData( ReferenceSizeProvider* pRefSizeProvider ) , aTextList(7) , apReferenceSizeProvider( pRefSizeProvider ) { - sal_Int32 nN = 0; - for(nN=7;nN--;) - aPossibilityList[nN]=true; - for(nN=7;nN--;) - aExistenceList[nN]=false; + for (sal_Int32 i = 0; i < 7; i++) + { + aPossibilityList[i] = true; + aExistenceList[i] = false; + } } void TitleDialogData::readFromModel( const uno::Reference< frame::XModel>& xChartModel ) diff --git a/chart2/source/inc/DisposeHelper.hxx b/chart2/source/inc/DisposeHelper.hxx index 72642a23121c..cd886c26a669 100644 --- a/chart2/source/inc/DisposeHelper.hxx +++ b/chart2/source/inc/DisposeHelper.hxx @@ -27,32 +27,32 @@ namespace chart namespace DisposeHelper { -template< class T > - void Dispose( const T & xIntf ) +template<class T> +void Dispose(const T & xInterface) { - css::uno::Reference< css::lang::XComponent > xComp( xIntf, css::uno::UNO_QUERY ); - if( xComp.is()) - xComp->dispose(); + css::uno::Reference<css::lang::XComponent> xComponent(xInterface, css::uno::UNO_QUERY); + if (xComponent.is()) + xComponent->dispose(); } -template< class Intf > - void DisposeAndClear( css::uno::Reference< Intf > & rIntf ) +template<class T> +void DisposeAndClear(css::uno::Reference<T> & rInterface) { - Dispose< css::uno::Reference< Intf > >( rIntf ); - rIntf.set( 0 ); + Dispose<css::uno::Reference<T>>(rInterface); + rInterface.set(nullptr); } -template< class Container > - void DisposeAllElements( Container & rContainer ) +template<class Container> +void DisposeAllElements(Container & rContainer) { - for( const auto& rElem : rContainer ) - Dispose< typename Container::value_type >( rElem ); + for (const auto & rElement : rContainer) + { + Dispose<typename Container::value_type>(rElement); + } } -} // namespace DisposeHelper -} // namespace chart +}} // namespace chart::DisposeHelper -// INCLUDED_CHART2_SOURCE_INC_DISPOSEHELPER_HXX -#endif +#endif // INCLUDED_CHART2_SOURCE_INC_DISPOSEHELPER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |