diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-11-09 20:55:59 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-11-09 21:12:07 +0100 |
commit | 003ba90531b6ee5c3b3225298a1490ed9a7048a4 (patch) | |
tree | f1a8ee5327ddb0e9169fefd4b07950ba996a47bf /sc | |
parent | e61465d25f5e52bf439db65ed7a641722637034a (diff) |
sc: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: I0cc3addefa436050259785ccf2ce540a84e9fcae
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmlimprt.cxx | 15 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.hxx | 9 |
2 files changed, 12 insertions, 12 deletions
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 62d128b53d67..ad11e91e3e4b 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -19,7 +19,6 @@ #include <sal/config.h> -#include <o3tl/ptr_container.hxx> #include <svl/zforlist.hxx> #include <sal/macros.h> @@ -2398,12 +2397,13 @@ bool ScXMLImport::GetValidation(const OUString& sName, ScMyImportValidation& aVa void ScXMLImport::AddNamedExpression(SCTAB nTab, ScMyNamedExpression* pNamedExp) { ::std::unique_ptr<ScMyNamedExpression> p(pNamedExp); - SheetNamedExpMap::iterator itr = maSheetNamedExpressions.find(nTab); - if (itr == maSheetNamedExpressions.end()) + SheetNamedExpMap::iterator itr = m_SheetNamedExpressions.find(nTab); + if (itr == m_SheetNamedExpressions.end()) { // No chain exists for this sheet. Create one. ::std::unique_ptr<ScMyNamedExpressions> pNew(new ScMyNamedExpressions); - ::std::pair<SheetNamedExpMap::iterator, bool> r = o3tl::ptr_container::insert(maSheetNamedExpressions, nTab, std::move(pNew)); + ::std::pair<SheetNamedExpMap::iterator, bool> r = + m_SheetNamedExpressions.insert(std::make_pair(nTab, std::move(pNew))); if (!r.second) // insertion failed. return; @@ -3157,15 +3157,14 @@ void ScXMLImport::SetSheetNamedRanges() if (!pDoc) return; - SheetNamedExpMap::const_iterator itr = maSheetNamedExpressions.begin(), itrEnd = maSheetNamedExpressions.end(); - for (; itr != itrEnd; ++itr) + for (auto const& itr : m_SheetNamedExpressions) { - SCTAB nTab = itr->first; + const SCTAB nTab = itr.first; ScRangeName* pRangeNames = pDoc->GetRangeName(nTab); if (!pRangeNames) continue; - const ScMyNamedExpressions& rNames = *itr->second; + const ScMyNamedExpressions& rNames = *itr.second; ::std::for_each(rNames.begin(), rNames.end(), RangeNameInserter(pDoc, *pRangeNames, *this)); } } diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index 4b562b864984..b87e82a3db4f 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -42,12 +42,13 @@ #include <com/sun/star/util/XNumberFormatTypes.hpp> #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp> +#include <boost/noncopyable.hpp> + #include <memory> #include <unordered_map> +#include <map> #include <vector> #include <list> -#include <boost/ptr_container/ptr_map.hpp> -#include <boost/noncopyable.hpp> class ScMyStyleNumberFormats; class XMLNumberFormatAttributesExportHelper; @@ -823,7 +824,7 @@ class ScXMLEditAttributeMap; class ScXMLImport: public SvXMLImport, boost::noncopyable { typedef std::unordered_map< OUString, sal_Int16, OUStringHash > CellTypeMap; - typedef ::boost::ptr_map<SCTAB, ScMyNamedExpressions> SheetNamedExpMap; + typedef ::std::map<SCTAB, std::unique_ptr<ScMyNamedExpressions>> SheetNamedExpMap; CellTypeMap aCellTypeMap; @@ -939,7 +940,7 @@ class ScXMLImport: public SvXMLImport, boost::noncopyable ScMyTables aTables; ScMyNamedExpressions* m_pMyNamedExpressions; - SheetNamedExpMap maSheetNamedExpressions; + SheetNamedExpMap m_SheetNamedExpressions; ScMyLabelRanges* pMyLabelRanges; ScMyImportValidations* pValidations; |