summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-01-13 17:18:10 +0100
committerMichael Stahl <mstahl@redhat.com>2016-01-13 17:53:13 +0100
commitd77d16dea9edcf5b4a91326ecc1a67bebfea6fc7 (patch)
treec761f6d86d93dc543087b6967809808c3d2e48f3 /sc/source
parent09943011f08fd4853c486376b8820eba1dcc9dbc (diff)
sc: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: I303b58ab25e0a5e369d7269cf30e8bd565e6e4c4
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/filter/excel/xichart.cxx21
-rw-r--r--sc/source/filter/inc/xichart.hxx7
2 files changed, 15 insertions, 13 deletions
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 1454df33f8a3..cf1738c504bf 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -75,7 +75,7 @@
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart2/data/LabeledDataSequence.hpp>
#include <o3tl/numeric.hxx>
-#include <o3tl/ptr_container.hxx>
+#include <o3tl/make_unique.hxx>
#include <sfx2/objsh.hxx>
#include <svx/svdpage.hxx>
#include <svx/unoapi.hxx>
@@ -1882,7 +1882,10 @@ void XclImpChSeries::AddChildSeries( const XclImpChSeries& rSeries )
these are properties of the parent series. This function adds the
settings of the passed series to this series. */
maTrendLines.insert( maTrendLines.end(), rSeries.maTrendLines.begin(), rSeries.maTrendLines.end() );
- maErrorBars.insert( rSeries.maErrorBars.begin(), rSeries.maErrorBars.end() );
+ for (auto const& it : rSeries.m_ErrorBars)
+ {
+ m_ErrorBars.insert(std::make_pair(it.first, o3tl::make_unique<XclImpChSerErrorBar>(*it.second)));
+ }
}
void XclImpChSeries::FinalizeDataFormats()
@@ -1916,9 +1919,9 @@ void XclImpChSeries::FinalizeDataFormats()
(*aLIt)->SetTrendlineName(mxTitleLink->GetString());
}
}
- for( XclImpChSerErrorBarMap::iterator aMIt = maErrorBars.begin(), aMEnd = maErrorBars.end(); aMIt != aMEnd; ++aMIt )
+ for (auto const& it : m_ErrorBars)
{
- aMIt->second->SetSeriesData( mxValueLink, mxSeriesFmt );
+ it.second->SetSeriesData( mxValueLink, mxSeriesFmt );
}
}
else if( XclImpChTypeGroup* pTypeGroup = GetChartData().GetTypeGroup( mnGroupIdx ).get() )
@@ -2134,7 +2137,7 @@ void XclImpChSeries::ReadChSerErrorBar( XclImpStream& rStrm )
unique_ptr<XclImpChSerErrorBar> pErrorBar(new XclImpChSerErrorBar(GetChRoot()));
pErrorBar->ReadChSerErrorBar(rStrm);
sal_uInt8 nBarType = pErrorBar->GetBarType();
- o3tl::ptr_container::insert(maErrorBars, nBarType, std::move(pErrorBar));
+ m_ErrorBars.insert(std::make_pair(nBarType, std::move(pErrorBar)));
}
XclImpChDataFormatRef XclImpChSeries::CreateDataFormat( sal_uInt16 nPointIdx, sal_uInt16 nFormatIdx )
@@ -2169,13 +2172,13 @@ void XclImpChSeries::ConvertTrendLines( Reference< XDataSeries > xDataSeries ) c
Reference< XPropertySet > XclImpChSeries::CreateErrorBar( sal_uInt8 nPosBarId, sal_uInt8 nNegBarId ) const
{
- XclImpChSerErrorBarMap::const_iterator itrPosBar = maErrorBars.find(nPosBarId);
- XclImpChSerErrorBarMap::const_iterator itrNegBar = maErrorBars.find(nNegBarId);
- XclImpChSerErrorBarMap::const_iterator itrEnd = maErrorBars.end();
+ XclImpChSerErrorBarMap::const_iterator itrPosBar = m_ErrorBars.find(nPosBarId);
+ XclImpChSerErrorBarMap::const_iterator itrNegBar = m_ErrorBars.find(nNegBarId);
+ XclImpChSerErrorBarMap::const_iterator itrEnd = m_ErrorBars.end();
if (itrPosBar == itrEnd || itrNegBar == itrEnd)
return Reference<XPropertySet>();
- return XclImpChSerErrorBar::CreateErrorBar(itrPosBar->second, itrNegBar->second);
+ return XclImpChSerErrorBar::CreateErrorBar(itrPosBar->second.get(), itrNegBar->second.get());
}
// Chart type groups ==========================================================
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index 61a81552ec4e..54d76be1c108 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -34,7 +34,6 @@
#include "xlstyle.hxx"
#include "xiescher.hxx"
#include "xistring.hxx"
-#include <boost/ptr_container/ptr_map.hpp>
namespace com { namespace sun { namespace star {
namespace awt
@@ -776,7 +775,7 @@ public:
/** Returns true, if the series is child of another series (e.g. trend line). */
inline bool HasParentSeries() const { return mnParentIdx != EXC_CHSERIES_INVALID; }
/** Returns true, if the series contains child series (e.g. trend lines). */
- inline bool HasChildSeries() const { return !maTrendLines.empty() || !maErrorBars.empty(); }
+ inline bool HasChildSeries() const { return !maTrendLines.empty() || !m_ErrorBars.empty(); }
/** Returns series title or an empty string, if the series does not contain a title. */
OUString GetTitle() const { return mxTitleLink ? mxTitleLink->GetString() : OUString(); }
@@ -820,7 +819,7 @@ private:
typedef ::std::map<sal_uInt16, XclImpChDataFormatRef> XclImpChDataFormatMap;
typedef ::std::map<sal_uInt16, XclImpChTextRef> XclImpChTextMap;
typedef ::std::list< XclImpChSerTrendLineRef > XclImpChSerTrendLineList;
- typedef ::boost::ptr_map<sal_uInt8, XclImpChSerErrorBar> XclImpChSerErrorBarMap;
+ typedef ::std::map<sal_uInt8, std::unique_ptr<XclImpChSerErrorBar>> XclImpChSerErrorBarMap;
XclChSeries maData; /// Contents of the CHSERIES record.
XclImpChSourceLinkRef mxValueLink; /// Link data for series values.
@@ -831,7 +830,7 @@ private:
XclImpChDataFormatMap maPointFmts; /// CHDATAFORMAT groups for data point formats.
XclImpChTextMap maLabels; /// Data point labels (CHTEXT groups).
XclImpChSerTrendLineList maTrendLines; /// Trend line settings (CHSERTRENDLINE records).
- XclImpChSerErrorBarMap maErrorBars; /// Error bar settings (CHSERERRORBAR records).
+ XclImpChSerErrorBarMap m_ErrorBars; /// Error bar settings (CHSERERRORBAR records).
sal_uInt16 mnGroupIdx; /// Chart type group (CHTYPEGROUP group) this series is assigned to.
sal_uInt16 mnSeriesIdx; /// 0-based series index.
sal_uInt16 mnParentIdx; /// 0-based index of parent series (trend lines and error bars).