diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-12-17 23:12:55 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-12-18 12:54:02 +0100 |
commit | fa90bbb79027c89a6178c21569157ca796b8fff4 (patch) | |
tree | 964fd8ce7c106bbc9bcd3297e98922697fae9612 /sc | |
parent | 742bcd2b2d23ae05bfcf356db69f79f33d20f53f (diff) |
sc: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: I32ab5eb985bd55d9194f3bff4739614cb6e93516
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 23 | ||||
-rw-r--r-- | sc/source/filter/inc/htmlpars.hxx | 6 |
2 files changed, 15 insertions, 14 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 5ecfeaa71f0c..36911c3282ea 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -103,7 +103,7 @@ void ScHTMLStyles::add(const char* pElemName, size_t nElemName, const char* pCla else { // Element name only. Add it to the element global. - insertProp(maElemGlobalProps, aElem, aProp, aValue); + insertProp(m_ElemGlobalProps, aElem, aProp, aValue); } } else @@ -113,7 +113,7 @@ void ScHTMLStyles::add(const char* pElemName, size_t nElemName, const char* pCla // Class name only. Add it to the global. OUString aClass(pClassName, nClassName, RTL_TEXTENCODING_UTF8); aClass = aClass.toAsciiLowerCase(); - insertProp(maGlobalProps, aClass, aProp, aValue); + insertProp(m_GlobalProps, aClass, aProp, aValue); } } } @@ -130,7 +130,7 @@ const OUString& ScHTMLStyles::getPropertyValue( NamePropsType::const_iterator itr2 = pClasses->find(rClass); if (itr2 != pClasses->end()) { - const PropsType* pProps = itr2->second; + const PropsType *const pProps = itr2->second.get(); PropsType::const_iterator itr3 = pProps->find(rPropName); if (itr3 != pProps->end()) return itr3->second; @@ -139,10 +139,10 @@ const OUString& ScHTMLStyles::getPropertyValue( } // Next, look into the class global storage. { - NamePropsType::const_iterator itr = maGlobalProps.find(rClass); - if (itr != maGlobalProps.end()) + auto const itr = m_GlobalProps.find(rClass); + if (itr != m_GlobalProps.end()) { - const PropsType* pProps = itr->second; + const PropsType *const pProps = itr->second.get(); PropsType::const_iterator itr2 = pProps->find(rPropName); if (itr2 != pProps->end()) return itr2->second; @@ -150,10 +150,10 @@ const OUString& ScHTMLStyles::getPropertyValue( } // As the last resort, look into the element global storage. { - NamePropsType::const_iterator itr = maElemGlobalProps.find(rClass); - if (itr != maElemGlobalProps.end()) + auto const itr = m_ElemGlobalProps.find(rClass); + if (itr != m_ElemGlobalProps.end()) { - const PropsType* pProps = itr->second; + const PropsType *const pProps = itr->second.get(); PropsType::const_iterator itr2 = pProps->find(rPropName); if (itr2 != pProps->end()) return itr2->second; @@ -172,7 +172,8 @@ void ScHTMLStyles::insertProp( { // new element std::unique_ptr<PropsType> p(new PropsType); - std::pair<NamePropsType::iterator, bool> r = o3tl::ptr_container::insert(rStore, aName, std::move(p)); + std::pair<NamePropsType::iterator, bool> r = + rStore.insert(std::make_pair(aName, std::move(p))); if (!r.second) // insertion failed. return; @@ -180,7 +181,7 @@ void ScHTMLStyles::insertProp( itr = r.first; } - PropsType* pProps = itr->second; + PropsType *const pProps = itr->second.get(); pProps->insert(PropsType::value_type(aProp, aValue)); } diff --git a/sc/source/filter/inc/htmlpars.hxx b/sc/source/filter/inc/htmlpars.hxx index 1e71c8bd89fe..305afda82978 100644 --- a/sc/source/filter/inc/htmlpars.hxx +++ b/sc/source/filter/inc/htmlpars.hxx @@ -49,11 +49,11 @@ class ScHTMLTable; class ScHTMLStyles { typedef std::unordered_map<OUString, OUString, OUStringHash> PropsType; - typedef ::boost::ptr_map<OUString, PropsType> NamePropsType; + typedef ::std::map<OUString, std::unique_ptr<PropsType>> NamePropsType; typedef ::boost::ptr_map<OUString, NamePropsType> ElemsType; - NamePropsType maGlobalProps; /// global properties (for a given class for all elements) - NamePropsType maElemGlobalProps; /// element global properties (no class specified) + NamePropsType m_GlobalProps; /// global properties (for a given class for all elements) + NamePropsType m_ElemGlobalProps; /// element global properties (no class specified) ElemsType maElemProps; /// element to class to properties (both element and class are given) const OUString maEmpty; /// just a persistent empty string. public: |