include/o3tl/ptr_container.hxx | 61 ------------------------ sc/inc/pch/precompiled_sc.hxx | 1 sc/inc/pch/precompiled_scfilt.hxx | 1 sc/source/filter/excel/xechart.cxx | 12 +++- sc/source/filter/excel/xepivotxml.cxx | 14 +++-- sc/source/filter/excel/xichart.cxx | 55 +++++++++++---------- sc/source/filter/ftools/sharedformulagroups.cxx | 6 +- sc/source/filter/inc/sharedformulagroups.hxx | 10 ++- sc/source/filter/inc/xechart.hxx | 7 +- sc/source/filter/inc/xepivotxml.hxx | 7 +- sc/source/filter/inc/xichart.hxx | 23 ++++----- sc/source/ui/dbgui/filtdlg.cxx | 18 +++---- sc/source/ui/inc/filtdlg.hxx | 6 +- sc/source/ui/inc/gridwin.hxx | 1 14 files changed, 86 insertions(+), 136 deletions(-)
New commits: commit 7c24813fe911e908450e22ec14922952db72dce9 Author: Michael Stahl <mst...@redhat.com> Date: Wed Jan 13 17:38:00 2016 +0100 sc: remove last ptr_map includes Change-Id: Ia834a8e78160b1456f98aa5d01c470673b352d0b diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx index c899118..2be112c 100644 --- a/sc/inc/pch/precompiled_sc.hxx +++ b/sc/inc/pch/precompiled_sc.hxx @@ -66,7 +66,6 @@ #include <boost/optional.hpp> #include <boost/optional/optional.hpp> #include <boost/property_tree/json_parser.hpp> -#include <boost/ptr_container/ptr_map.hpp> #include <osl/conditn.h> #include <osl/conditn.hxx> #include <osl/diagnose.h> diff --git a/sc/inc/pch/precompiled_scfilt.hxx b/sc/inc/pch/precompiled_scfilt.hxx index 2f95d5e..8feccbb 100644 --- a/sc/inc/pch/precompiled_scfilt.hxx +++ b/sc/inc/pch/precompiled_scfilt.hxx @@ -52,7 +52,6 @@ #include <boost/checked_delete.hpp> #include <boost/noncopyable.hpp> #include <boost/optional/optional.hpp> -#include <boost/ptr_container/ptr_map.hpp> #include <osl/conditn.hxx> #include <osl/diagnose.h> #include <osl/endian.h> diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 4e0172e..728f3ed 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -28,7 +28,6 @@ #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> #include <basegfx/matrix/b2dhommatrix.hxx> -#include <boost/ptr_container/ptr_map.hpp> #include <vector> namespace editeng { commit 8a7d8790ff39feb81887852ff9b898b9c02dad50 Author: Michael Stahl <mst...@redhat.com> Date: Wed Jan 13 17:32:12 2016 +0100 sc: replace boost::ptr_map with std::map<std::unique_ptr> Change-Id: I2dbb399a5fb368b0c197c0cf48c0834a4cadde0c diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 50ee629..eda7507 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -39,6 +39,8 @@ #include <vcl/layout.hxx> #include <svl/sharedstringpool.hxx> +#include <o3tl/make_unique.hxx> + #include <limits> #define ERRORBOX(rid) ScopedVclPtrInstance<MessageDialog>::Create(this, ScGlobal::GetRscString(rid))->Execute() @@ -517,7 +519,7 @@ void ScFilterDlg::UpdateValueList( size_t nList ) SCCOL nColumn = theQueryData.nCol1 + static_cast<SCCOL>(nFieldSelPos) - 1; EntryList* pList = nullptr; - if (!maEntryLists.count(nColumn)) + if (!m_EntryLists.count(nColumn)) { size_t nOffset = GetSliderPos(); SCTAB nTab = nSrcTab; @@ -529,12 +531,12 @@ void ScFilterDlg::UpdateValueList( size_t nList ) // first without the first line std::pair<EntryListsMap::iterator, bool> r = - maEntryLists.insert(nColumn, new EntryList); + m_EntryLists.insert(std::make_pair(nColumn, o3tl::make_unique<EntryList>())); if (!r.second) // insertion failed. return; - pList = r.first->second; + pList = r.first->second.get(); pDoc->GetFilterEntriesArea( nColumn, nFirstRow+1, nLastRow, nTab, bCaseSens, pList->maList, maHasDates[nOffset+nList-1] ); @@ -571,7 +573,7 @@ void ScFilterDlg::UpdateValueList( size_t nList ) } } else - pList = &maEntryLists[nColumn]; + pList = m_EntryLists[nColumn].get(); OSL_ASSERT(pList); @@ -603,20 +605,20 @@ void ScFilterDlg::UpdateHdrInValueList( size_t nList ) return; SCCOL nColumn = theQueryData.nCol1 + static_cast<SCCOL>(nFieldSelPos) - 1; - if (!maEntryLists.count(nColumn)) + if (!m_EntryLists.count(nColumn)) { OSL_FAIL("Spalte noch nicht initialisiert"); return; } - size_t nPos = maEntryLists[nColumn].mnHeaderPos; + size_t const nPos = m_EntryLists[nColumn]->mnHeaderPos; if (nPos == INVALID_HEADER_POS) return; ComboBox* pValList = maValueEdArr[nList-1]; size_t nListPos = nPos + 2; // for "empty" and "non-empty" - const ScTypedStrData& rHdrEntry = maEntryLists[nColumn].maList[nPos]; + const ScTypedStrData& rHdrEntry = m_EntryLists[nColumn]->maList[nPos]; const OUString& aHdrStr = rHdrEntry.GetString(); bool bWasThere = aHdrStr.equals(pValList->GetEntry(nListPos)); @@ -1043,7 +1045,7 @@ IMPL_LINK_TYPED( ScFilterDlg, CheckBoxHdl, Button*, pBox, void ) if ( pBox == pBtnCase ) // Complete value list { - maEntryLists.clear(); + m_EntryLists.clear(); UpdateValueList( 1 ); // current text is recorded UpdateValueList( 2 ); UpdateValueList( 3 ); diff --git a/sc/source/ui/inc/filtdlg.hxx b/sc/source/ui/inc/filtdlg.hxx index a2e4014..ba3a95a 100644 --- a/sc/source/ui/inc/filtdlg.hxx +++ b/sc/source/ui/inc/filtdlg.hxx @@ -31,10 +31,10 @@ #include "queryparam.hxx" #include "typedstrdata.hxx" +#include <memory> #include <deque> #include <vector> #include <map> -#include <boost/ptr_container/ptr_map.hpp> #include <boost/noncopyable.hpp> class ScFilterOptionsMgr; @@ -50,7 +50,7 @@ class ScFilterDlg : public ScAnyRefDlg size_t mnHeaderPos; EntryList(); }; - typedef boost::ptr_map<SCCOL,EntryList> EntryListsMap; + typedef std::map<SCCOL, std::unique_ptr<EntryList>> EntryListsMap; public: ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent, const SfxItemSet& rArgSet ); @@ -130,7 +130,7 @@ private: std::deque<bool> maRefreshExceptQuery; bool bRefInputMode; - EntryListsMap maEntryLists; + EntryListsMap m_EntryLists; // Hack: RefInput control Timer* pTimer; commit 7984e90d5220f34935f2f04392cd923acdf81ec1 Author: Michael Stahl <mst...@redhat.com> Date: Wed Jan 13 17:23:20 2016 +0100 remove unused o3tl/ptr_container.hxx Change-Id: I8132958b979add35bdd7aea52ce8788f3cdcbe51 diff --git a/include/o3tl/ptr_container.hxx b/include/o3tl/ptr_container.hxx deleted file mode 100644 index e89e567..0000000 --- a/include/o3tl/ptr_container.hxx +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef INCLUDED_O3TL_PTR_CONTAINER_HXX -#define INCLUDED_O3TL_PTR_CONTAINER_HXX - -#include <sal/config.h> - -#include <memory> -#include <utility> - -// Some glue for using std::unique_ptr with the Boost Pointer Container Library: - -namespace o3tl { namespace ptr_container { - -template<typename C, typename T> inline std::pair<typename C::iterator, bool> -insert(C & container, std::unique_ptr<T> && element) { - std::pair<typename C::iterator, bool> r(container.insert(element.get())); - element.release(); - return r; -} - -template<typename C, typename T> inline std::pair<typename C::iterator, bool> -insert( - C & container, typename C::key_type const & key, - std::unique_ptr<T> && element) -{ - // At least Boost <= 1.56.0 boost::ptr_map_adaptor has odd key const-ness - // discrepancy between - // - // std::pair<iterator,bool> insert( key_type& k, T* x ) - // - // and - // - // template< class U > - // std::pair<iterator,bool> insert( const key_type& k, - // std::auto_ptr<U> x ) - std::pair<typename C::iterator, bool> r( - container.insert( - const_cast<typename C::key_type &>(key), element.get())); - element.release(); - return r; -} - -template<typename C, typename T> -inline void push_back(C & container, std::unique_ptr<T> && element) { - container.push_back(element.get()); - element.release(); -} - -} } - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 87adef1bde1d4b506951dff2a1228fecdcbdc936 Author: Michael Stahl <mst...@redhat.com> Date: Wed Jan 13 17:21:48 2016 +0100 sc: replace boost::ptr_map with std::map<std::unique_ptr> Change-Id: Ia051a8f0d20a6f718395e1420d7f409099607156 diff --git a/sc/source/filter/ftools/sharedformulagroups.cxx b/sc/source/filter/ftools/sharedformulagroups.cxx index 46ccb31..1efd8d0 100644 --- a/sc/source/filter/ftools/sharedformulagroups.cxx +++ b/sc/source/filter/ftools/sharedformulagroups.cxx @@ -13,13 +13,13 @@ namespace sc { void SharedFormulaGroups::set( size_t nSharedId, ScTokenArray* pArray ) { - maStore.insert(nSharedId, pArray); + m_Store.insert(std::make_pair(nSharedId, std::unique_ptr<ScTokenArray>(pArray))); } const ScTokenArray* SharedFormulaGroups::get( size_t nSharedId ) const { - StoreType::const_iterator it = maStore.find(nSharedId); - return it == maStore.end() ? nullptr : it->second; + StoreType::const_iterator const it = m_Store.find(nSharedId); + return it == m_Store.end() ? nullptr : it->second.get(); } } diff --git a/sc/source/filter/inc/sharedformulagroups.hxx b/sc/source/filter/inc/sharedformulagroups.hxx index 12100d5..33d903f 100644 --- a/sc/source/filter/inc/sharedformulagroups.hxx +++ b/sc/source/filter/inc/sharedformulagroups.hxx @@ -12,16 +12,18 @@ #include "tokenarray.hxx" -#include <boost/ptr_container/ptr_map.hpp> +#include <memory> +#include <map> namespace sc { class SharedFormulaGroups { - typedef boost::ptr_map<size_t, ScTokenArray> StoreType; - StoreType maStore; -public: +private: + typedef std::map<size_t, std::unique_ptr<ScTokenArray>> StoreType; + StoreType m_Store; +public: void set( size_t nSharedId, ScTokenArray* pArray ); const ScTokenArray* get( size_t nSharedId ) const; }; commit d77d16dea9edcf5b4a91326ecc1a67bebfea6fc7 Author: Michael Stahl <mst...@redhat.com> Date: Wed Jan 13 17:18:10 2016 +0100 sc: replace boost::ptr_map with std::map<std::unique_ptr> Change-Id: I303b58ab25e0a5e369d7269cf30e8bd565e6e4c4 diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 1454df3..cf1738c 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 61a8155..54d76be 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). commit 09943011f08fd4853c486376b8820eba1dcc9dbc Author: Michael Stahl <mst...@redhat.com> Date: Wed Jan 13 17:09:37 2016 +0100 sc: replace boost::ptr_map with std::map<std::unique_ptr> Change-Id: Ib97ddc8871774eb5faca35a8b4193599dc6f25ef diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 63a6395..1454df3 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -3854,7 +3854,7 @@ void XclImpChChart::ReadChDefaultText( XclImpStream& rStrm ) { unique_ptr<XclImpChText> pText(new XclImpChText(GetChRoot())); pText->ReadRecordGroup(rStrm); - o3tl::ptr_container::insert(maDefTexts, nTextId, std::move(pText)); + m_DefTexts.insert(std::make_pair(nTextId, std::move(pText))); } } @@ -3904,8 +3904,8 @@ const XclImpChText* XclImpChChart::GetDefaultText( XclChTextType eTextType ) con case EXC_CHTEXTTYPE_DATALABEL: nDefTextId = bBiff8 ? EXC_CHDEFTEXT_AXESSET : EXC_CHDEFTEXT_GLOBAL; break; } - XclImpChTextMap::const_iterator itr = maDefTexts.find(nDefTextId); - return itr == maDefTexts.end() ? nullptr : itr->second; + XclImpChTextMap::const_iterator const itr = m_DefTexts.find(nDefTextId); + return itr == m_DefTexts.end() ? nullptr : itr->second.get(); } bool XclImpChChart::IsManualPlotArea() const diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx index 6410aec..61a8155 100644 --- a/sc/source/filter/inc/xichart.hxx +++ b/sc/source/filter/inc/xichart.hxx @@ -1334,14 +1334,14 @@ private: private: typedef ::std::vector< XclImpChSeriesRef > XclImpChSeriesVec; typedef ::std::map<XclChDataPointPos, XclImpChDataFormatRef> XclImpChDataFormatMap; - typedef ::boost::ptr_map<sal_uInt16, XclImpChText> XclImpChTextMap; + typedef ::std::map<sal_uInt16, std::unique_ptr<XclImpChText>> XclImpChTextMap; XclChRectangle maRect; /// Position of the chart on the sheet (CHCHART record). XclImpChSeriesVec maSeries; /// List of series data (CHSERIES groups). XclImpChDataFormatMap maDataFmts; /// All series and point formats (CHDATAFORMAT groups). XclImpChFrameRef mxFrame; /// Chart frame format (CHFRAME group). XclChProperties maProps; /// Chart properties (CHPROPERTIES record). - XclImpChTextMap maDefTexts; /// Default text objects (CHDEFAULTTEXT groups). + XclImpChTextMap m_DefTexts; /// Default text objects (CHDEFAULTTEXT groups). XclImpChAxesSetRef mxPrimAxesSet; /// Primary axes set (CHAXESSET group). XclImpChAxesSetRef mxSecnAxesSet; /// Secondary axes set (CHAXESSET group). XclImpChTextRef mxTitle; /// Chart title (CHTEXT group). commit 3e53470184f0398429004e836fe6e9bdd08f2240 Author: Michael Stahl <mst...@redhat.com> Date: Wed Jan 13 17:07:11 2016 +0100 sc: replace boost::ptr_map with std::map Change-Id: I21fbba963e595377a0f6e9151e5510c660d8ca5f diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index c9e884d7..63a6395 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -2741,8 +2741,8 @@ bool XclImpChTypeGroup::HasConnectorLines() const // existence of connector lines (only in stacked bar charts) if ( !(maType.IsStacked() || maType.IsPercent()) || (maTypeInfo.meTypeCateg != EXC_CHTYPECATEG_BAR) ) return false; - XclImpChLineFormatMap::const_iterator xConLine = maChartLines.find( EXC_CHCHARTLINE_CONNECT ); - return ( xConLine != maChartLines.end() && xConLine->second->HasLine() ); + XclImpChLineFormatMap::const_iterator xConLine = m_ChartLines.find(EXC_CHCHARTLINE_CONNECT); + return (xConLine != m_ChartLines.end() && xConLine->second.HasLine()); } OUString XclImpChTypeGroup::GetSingleSeriesTitle() const @@ -2820,7 +2820,7 @@ void XclImpChTypeGroup::ReadChChartLine( XclImpStream& rStrm ) { XclImpChLineFormat xLineFmt; xLineFmt.ReadChLineFormat( rStrm ); - maChartLines[ nLineId ] = xLineFmt; + m_ChartLines[ nLineId ] = xLineFmt; } } @@ -2920,11 +2920,11 @@ void XclImpChTypeGroup::CreateStockSeries( Reference< XChartType > xChartType, s aTypeProp.SetBoolProperty( EXC_CHPROP_SHOWFIRST, HasDropBars() ); aTypeProp.SetBoolProperty( EXC_CHPROP_SHOWHIGHLOW, true ); // hi-lo line format - XclImpChLineFormatMap::const_iterator xHiLoLine = maChartLines.find( EXC_CHCHARTLINE_HILO ); - if ( xHiLoLine != maChartLines.end() ) + XclImpChLineFormatMap::const_iterator xHiLoLine = m_ChartLines.find( EXC_CHCHARTLINE_HILO ); + if (xHiLoLine != m_ChartLines.end()) { ScfPropertySet aSeriesProp( xDataSeries ); - xHiLoLine->second->Convert( GetChRoot(), aSeriesProp, EXC_CHOBJTYPE_HILOLINE ); + xHiLoLine->second.Convert( GetChRoot(), aSeriesProp, EXC_CHOBJTYPE_HILOLINE ); } // white dropbar format XclImpChDropBarMap::const_iterator itr = m_DropBars.find(EXC_CHDROPBAR_UP); diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx index b57ecbd..6410aec 100644 --- a/sc/source/filter/inc/xichart.hxx +++ b/sc/source/filter/inc/xichart.hxx @@ -1020,7 +1020,7 @@ private: void ReadChDataFormat( XclImpStream& rStrm ); /** Returns true, if the chart type group contains a hi-lo line format. */ - inline bool HasHiLoLine() const { return maChartLines.find( EXC_CHCHARTLINE_HILO ) != maChartLines.end(); } + inline bool HasHiLoLine() const { return m_ChartLines.find(EXC_CHCHARTLINE_HILO) != m_ChartLines.end(); } /** Returns true, if the chart type group contains drop bar formats. */ inline bool HasDropBars() const { return !m_DropBars.empty(); } @@ -1038,7 +1038,7 @@ private: private: typedef ::std::vector< XclImpChSeriesRef > XclImpChSeriesVec; typedef ::std::map<sal_uInt16, std::unique_ptr<XclImpChDropBar>> XclImpChDropBarMap; - typedef boost::ptr_map<sal_uInt16, XclImpChLineFormat> XclImpChLineFormatMap; + typedef ::std::map<sal_uInt16, XclImpChLineFormat> XclImpChLineFormatMap; typedef ::std::set< sal_uInt16 > UInt16Set; XclChTypeGroup maData; /// Contents of the CHTYPEGROUP record. @@ -1049,7 +1049,7 @@ private: XclImpChChart3dRef mxChart3d; /// 3D settings (CHCHART3D record). XclImpChLegendRef mxLegend; /// Chart legend (CHLEGEND group). XclImpChDropBarMap m_DropBars; /// Dropbars (CHDROPBAR group). - XclImpChLineFormatMap maChartLines; /// Global line formats (CHCHARTLINE group). + XclImpChLineFormatMap m_ChartLines; /// Global line formats (CHCHARTLINE group). XclImpChDataFormatRef mxGroupFmt; /// Default format for all series (CHDATAFORMAT group). UInt16Set maUnusedFormats; /// Contains unused format indexes for automatic colors. }; commit 14cb391feda461be087aafa090381cba54325d24 Author: Michael Stahl <mst...@redhat.com> Date: Wed Jan 13 17:03:00 2016 +0100 sc: replace boost::ptr_map with std::map<std::unique_ptr> Change-Id: Id503e8eb2404faaeb2486fa640d21db23e57e643 diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index be226cb..c9e884d7 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -2799,17 +2799,17 @@ Reference< XLabeledDataSequence > XclImpChTypeGroup::CreateCategSequence() const void XclImpChTypeGroup::ReadChDropBar( XclImpStream& rStrm ) { - if (maDropBars.find(EXC_CHDROPBAR_UP) == maDropBars.end()) + if (m_DropBars.find(EXC_CHDROPBAR_UP) == m_DropBars.end()) { unique_ptr<XclImpChDropBar> p(new XclImpChDropBar(EXC_CHDROPBAR_UP)); p->ReadRecordGroup(rStrm); - o3tl::ptr_container::insert(maDropBars, EXC_CHDROPBAR_UP, std::move(p)); + m_DropBars.insert(std::make_pair(EXC_CHDROPBAR_UP, std::move(p))); } - else if(maDropBars.find(EXC_CHDROPBAR_DOWN) == maDropBars.end()) + else if (m_DropBars.find(EXC_CHDROPBAR_DOWN) == m_DropBars.end()) { unique_ptr<XclImpChDropBar> p(new XclImpChDropBar(EXC_CHDROPBAR_DOWN)); p->ReadRecordGroup(rStrm); - o3tl::ptr_container::insert(maDropBars, EXC_CHDROPBAR_DOWN, std::move(p)); + m_DropBars.insert(std::make_pair(EXC_CHDROPBAR_DOWN, std::move(p))); } } @@ -2927,17 +2927,17 @@ void XclImpChTypeGroup::CreateStockSeries( Reference< XChartType > xChartType, s xHiLoLine->second->Convert( GetChRoot(), aSeriesProp, EXC_CHOBJTYPE_HILOLINE ); } // white dropbar format - XclImpChDropBarMap::const_iterator itr = maDropBars.find(EXC_CHDROPBAR_UP); + XclImpChDropBarMap::const_iterator itr = m_DropBars.find(EXC_CHDROPBAR_UP); Reference<XPropertySet> xWhitePropSet; - if (itr != maDropBars.end() && aTypeProp.GetProperty(xWhitePropSet, EXC_CHPROP_WHITEDAY)) + if (itr != m_DropBars.end() && aTypeProp.GetProperty(xWhitePropSet, EXC_CHPROP_WHITEDAY)) { ScfPropertySet aBarProp( xWhitePropSet ); itr->second->Convert(GetChRoot(), aBarProp); } // black dropbar format - itr = maDropBars.find(EXC_CHDROPBAR_DOWN); + itr = m_DropBars.find(EXC_CHDROPBAR_DOWN); Reference<XPropertySet> xBlackPropSet; - if (itr != maDropBars.end() && aTypeProp.GetProperty(xBlackPropSet, EXC_CHPROP_BLACKDAY)) + if (itr != m_DropBars.end() && aTypeProp.GetProperty(xBlackPropSet, EXC_CHPROP_BLACKDAY)) { ScfPropertySet aBarProp( xBlackPropSet ); itr->second->Convert(GetChRoot(), aBarProp); diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx index 2aa1ff81..b57ecbd 100644 --- a/sc/source/filter/inc/xichart.hxx +++ b/sc/source/filter/inc/xichart.hxx @@ -1022,7 +1022,7 @@ private: /** Returns true, if the chart type group contains a hi-lo line format. */ inline bool HasHiLoLine() const { return maChartLines.find( EXC_CHCHARTLINE_HILO ) != maChartLines.end(); } /** Returns true, if the chart type group contains drop bar formats. */ - inline bool HasDropBars() const { return !maDropBars.empty(); } + inline bool HasDropBars() const { return !m_DropBars.empty(); } /** Inserts the passed series into the chart type. Adds additional properties to the series. */ void InsertDataSeries( css::uno::Reference< css::chart2::XChartType > xChartType, @@ -1037,7 +1037,7 @@ private: private: typedef ::std::vector< XclImpChSeriesRef > XclImpChSeriesVec; - typedef boost::ptr_map<sal_uInt16, XclImpChDropBar> XclImpChDropBarMap; + typedef ::std::map<sal_uInt16, std::unique_ptr<XclImpChDropBar>> XclImpChDropBarMap; typedef boost::ptr_map<sal_uInt16, XclImpChLineFormat> XclImpChLineFormatMap; typedef ::std::set< sal_uInt16 > UInt16Set; @@ -1048,7 +1048,7 @@ private: XclImpChSeriesRef mxFirstSeries; /// First series in this chart type group (CHSERIES groups). XclImpChChart3dRef mxChart3d; /// 3D settings (CHCHART3D record). XclImpChLegendRef mxLegend; /// Chart legend (CHLEGEND group). - XclImpChDropBarMap maDropBars; /// Dropbars (CHDROPBAR group). + XclImpChDropBarMap m_DropBars; /// Dropbars (CHDROPBAR group). XclImpChLineFormatMap maChartLines; /// Global line formats (CHCHARTLINE group). XclImpChDataFormatRef mxGroupFmt; /// Default format for all series (CHDATAFORMAT group). UInt16Set maUnusedFormats; /// Contains unused format indexes for automatic colors. commit 1713124948122b44763d2241503f2daa1e207538 Author: Michael Stahl <mst...@redhat.com> Date: Wed Jan 13 16:58:45 2016 +0100 sc: replace boost::ptr_map with std::map<std::unique_ptr> Change-Id: Ie38b2150187129723a112f707428ebfc88546ab5 diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index eac9364..a4978a7 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -53,6 +53,8 @@ #include <com/sun/star/chart2/StackingDirection.hpp> #include <com/sun/star/chart2/TickmarkStyle.hpp> +#include <o3tl/make_unique.hxx> + #include <tools/gen.hxx> #include <vcl/outdev.hxx> #include <filter/msfilter/escherex.hxx> @@ -2471,7 +2473,7 @@ void XclExpChTypeGroup::ConvertSeries( if (bConnectBars && (maTypeInfo.meTypeCateg == EXC_CHTYPECATEG_BAR)) { sal_uInt16 nKey = EXC_CHCHARTLINE_CONNECT; - maChartLines.insert(nKey, new XclExpChLineFormat(GetChRoot())); + m_ChartLines.insert(std::make_pair(nKey, o3tl::make_unique<XclExpChLineFormat>(GetChRoot()))); } } else @@ -2523,8 +2525,10 @@ void XclExpChTypeGroup::WriteSubRecords( XclExpStream& rStrm ) lclSaveRecord( rStrm, mxLegend ); lclSaveRecord( rStrm, mxUpBar ); lclSaveRecord( rStrm, mxDownBar ); - for( XclExpChLineFormatMap::iterator aLIt = maChartLines.begin(), aLEnd = maChartLines.end(); aLIt != aLEnd; ++aLIt ) - lclSaveRecord( rStrm, aLIt->second, EXC_ID_CHCHARTLINE, aLIt->first ); + for (auto const& it : m_ChartLines) + { + lclSaveRecord( rStrm, it.second.get(), EXC_ID_CHCHARTLINE, it.first ); + } } sal_uInt16 XclExpChTypeGroup::GetFreeFormatIdx() const @@ -2564,7 +2568,7 @@ void XclExpChTypeGroup::CreateAllStockSeries( XclExpChLineFormatRef xLineFmt( new XclExpChLineFormat( GetChRoot() ) ); xLineFmt->Convert( GetChRoot(), aSeriesProp, EXC_CHOBJTYPE_HILOLINE ); sal_uInt16 nKey = EXC_CHCHARTLINE_HILO; - maChartLines.insert(nKey, new XclExpChLineFormat(GetChRoot())); + m_ChartLines.insert(std::make_pair(nKey, o3tl::make_unique<XclExpChLineFormat>(GetChRoot()))); } // dropbars if( bHasOpen && bHasClose ) diff --git a/sc/source/filter/inc/xechart.hxx b/sc/source/filter/inc/xechart.hxx index 3292a24..11423c0 100644 --- a/sc/source/filter/inc/xechart.hxx +++ b/sc/source/filter/inc/xechart.hxx @@ -26,8 +26,9 @@ #include "xlstyle.hxx" #include "xeroot.hxx" #include "xestring.hxx" -#include <boost/ptr_container/ptr_map.hpp> + #include <memory> +#include <map> class Size; class Rectangle; @@ -920,7 +921,7 @@ private: private: typedef XclExpRecordList< XclExpChSeries > XclExpChSeriesList; - typedef ::boost::ptr_map<sal_uInt16, XclExpChLineFormat> XclExpChLineFormatMap; + typedef ::std::map<sal_uInt16, std::unique_ptr<XclExpChLineFormat>> XclExpChLineFormatMap; XclChTypeGroup maData; /// Contents of the CHTYPEGROUP record. XclExpChType maType; /// Chart type (e.g. CHBAR, CHLINE, ...). @@ -930,7 +931,7 @@ private: XclExpChLegendRef mxLegend; /// Chart legend (CHLEGEND group). XclExpChDropBarRef mxUpBar; /// White dropbars (CHDROPBAR group). XclExpChDropBarRef mxDownBar; /// Black dropbars (CHDROPBAR group). - XclExpChLineFormatMap maChartLines; /// Global line formats (CHCHARTLINE group). + XclExpChLineFormatMap m_ChartLines; /// Global line formats (CHCHARTLINE group). }; typedef std::shared_ptr< XclExpChTypeGroup > XclExpChTypeGroupRef; commit 3071ff2693fc9cb4541b240f758997402d5eb9fc Author: Michael Stahl <mst...@redhat.com> Date: Wed Jan 13 16:52:08 2016 +0100 sc: replace boost::ptr_map with std::map<std::unique_ptr> Change-Id: I1be831515ee0c86242dcdbea9704febf6b3c5695 diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx index 23e010e..f655c2b 100644 --- a/sc/source/filter/excel/xepivotxml.cxx +++ b/sc/source/filter/excel/xepivotxml.cxx @@ -20,6 +20,8 @@ #include <com/sun/star/sheet/DataPilotOutputRangeType.hpp> #include <com/sun/star/sheet/GeneralFunction.hpp> +#include <o3tl/make_unique.hxx> + #include <vector> using namespace oox; @@ -343,16 +345,16 @@ void XclExpXmlPivotTableManager::Initialize() sal_Int32 nCacheId = itCache->second; SCTAB nTab = rDPObj.GetOutRange().aStart.Tab(); - TablesType::iterator it = maTables.find(nTab); - if (it == maTables.end()) + TablesType::iterator it = m_Tables.find(nTab); + if (it == m_Tables.end()) { // Insert a new instance for this sheet index. std::pair<TablesType::iterator, bool> r = - maTables.insert(nTab, new XclExpXmlPivotTables(GetRoot(), maCaches)); + m_Tables.insert(std::make_pair(nTab, o3tl::make_unique<XclExpXmlPivotTables>(GetRoot(), maCaches))); it = r.first; } - XclExpXmlPivotTables* p = it->second; + XclExpXmlPivotTables *const p = it->second.get(); p->AppendTable(&rDPObj, nCacheId, i+1); } @@ -366,8 +368,8 @@ XclExpXmlPivotCaches& XclExpXmlPivotTableManager::GetCaches() XclExpXmlPivotTables* XclExpXmlPivotTableManager::GetTablesBySheet( SCTAB nTab ) { - TablesType::iterator it = maTables.find(nTab); - return it == maTables.end() ? nullptr : it->second; + TablesType::iterator const it = m_Tables.find(nTab); + return it == m_Tables.end() ? nullptr : it->second.get(); } XclExpXmlPivotTables::Entry::Entry( const ScDPObject* pTable, sal_Int32 nCacheId, sal_Int32 nPivotId ) : diff --git a/sc/source/filter/inc/xepivotxml.hxx b/sc/source/filter/inc/xepivotxml.hxx index d04f5b7..ca1e4a5 100644 --- a/sc/source/filter/inc/xepivotxml.hxx +++ b/sc/source/filter/inc/xepivotxml.hxx @@ -13,7 +13,8 @@ #include <xerecord.hxx> #include <xeroot.hxx> -#include <boost/ptr_container/ptr_map.hpp> +#include <memory> +#include <map> #include <unordered_map> class ScDPCache; @@ -74,7 +75,7 @@ private: class XclExpXmlPivotTableManager : protected XclExpRoot { - typedef boost::ptr_map<SCTAB, XclExpXmlPivotTables> TablesType; + typedef std::map<SCTAB, std::unique_ptr<XclExpXmlPivotTables>> TablesType; typedef std::unordered_map<const ScDPObject*, sal_Int32> CacheIdMapType; public: XclExpXmlPivotTableManager( const XclExpRoot& rRoot ); @@ -86,7 +87,7 @@ public: private: XclExpXmlPivotCaches maCaches; - TablesType maTables; + TablesType m_Tables; CacheIdMapType maCacheIdMap; }; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits