[Libreoffice-commits] core.git: chart2/source
Tomaž Vajngerl
tomaz.vajngerl at collabora.co.uk
Sun Feb 12 23:01:31 UTC 2017
chart2/source/controller/dialogs/DataBrowserModel.cxx | 12 +-----
chart2/source/controller/dialogs/TitleDialogData.cxx | 10 ++---
chart2/source/inc/DisposeHelper.hxx | 34 +++++++++---------
3 files changed, 25 insertions(+), 31 deletions(-)
New commits:
commit 608811c2cb507176530aad0e7e6da81335ecaf10
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Tue Feb 7 14:27:52 2017 +0100
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 at gmail.com>
Tested-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index 83064a1..55bbefe 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 8ab0a36..892c9a4 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 72642a2..cd886c2 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: */
More information about the Libreoffice-commits
mailing list