Kaydet (Commit) 608811c2 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

chart2: simplify and/or clean-up and c++11 features

Change-Id: I4550d04ae4bf6e45f24e34dfb2babc0fdef8ba5a
Reviewed-on: https://gerrit.libreoffice.org/34006Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
Tested-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 8cc8ffdb
......@@ -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;
}
......
......@@ -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 )
......
......@@ -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: */
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