Kaydet (Commit) 6f1e2513 authored tarafından Michael Stahl's avatar Michael Stahl

sc: replace boost::ptr_map with std::map<std::unique_ptr>

Change-Id: Id56046d135e7d1acdd7e705b5f0c40f71427c121
üst fa90bbb7
......@@ -20,7 +20,6 @@
#include <sal/config.h>
#include <comphelper/string.hxx>
#include <o3tl/ptr_container.hxx>
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
......@@ -83,19 +82,20 @@ void ScHTMLStyles::add(const char* pElemName, size_t nElemName, const char* pCla
if (pClassName)
{
// Both element and class names given.
ElemsType::iterator itrElem = maElemProps.find(aElem);
if (itrElem == maElemProps.end())
ElemsType::iterator itrElem = m_ElemProps.find(aElem);
if (itrElem == m_ElemProps.end())
{
// new element
std::unique_ptr<NamePropsType> p(new NamePropsType);
std::pair<ElemsType::iterator, bool> r = o3tl::ptr_container::insert(maElemProps, aElem, std::move(p));
std::pair<ElemsType::iterator, bool> r =
m_ElemProps.insert(std::make_pair(aElem, std::move(p)));
if (!r.second)
// insertion failed.
return;
itrElem = r.first;
}
NamePropsType* pClsProps = itrElem->second;
NamePropsType *const pClsProps = itrElem->second.get();
OUString aClass(pClassName, nClassName, RTL_TEXTENCODING_UTF8);
aClass = aClass.toAsciiLowerCase();
insertProp(*pClsProps, aClass, aProp, aValue);
......@@ -123,10 +123,10 @@ const OUString& ScHTMLStyles::getPropertyValue(
{
// First, look into the element-class storage.
{
ElemsType::const_iterator itr = maElemProps.find(rElem);
if (itr != maElemProps.end())
auto const itr = m_ElemProps.find(rElem);
if (itr != m_ElemProps.end())
{
const NamePropsType* pClasses = itr->second;
const NamePropsType *const pClasses = itr->second.get();
NamePropsType::const_iterator itr2 = pClasses->find(rClass);
if (itr2 != pClasses->end())
{
......
......@@ -27,7 +27,6 @@
#include <unordered_map>
#include <vector>
#include <o3tl/sorted_vector.hxx>
#include <boost/ptr_container/ptr_map.hpp>
#include "rangelst.hxx"
#include "eeparser.hxx"
......@@ -50,11 +49,11 @@ class ScHTMLStyles
{
typedef std::unordered_map<OUString, OUString, OUStringHash> PropsType;
typedef ::std::map<OUString, std::unique_ptr<PropsType>> NamePropsType;
typedef ::boost::ptr_map<OUString, NamePropsType> ElemsType;
typedef ::std::map<OUString, std::unique_ptr<NamePropsType>> ElemsType;
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)
ElemsType m_ElemProps; /// element to class to properties (both element and class are given)
const OUString maEmpty; /// just a persistent empty string.
public:
ScHTMLStyles();
......
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