Kaydet (Commit) 5d157ce0 authored tarafından Michael Meeks's avatar Michael Meeks

fdo#76260 - don't allocate and free std::strings on each element.

This debug code is quite expensive; 2.5% of document load time;
Avoid the pointless heap allocation, and punt the rest to fdo#80798.

Change-Id: I499b3cf48867d5ed0f2b33b9d12f1c128c993aae
üst 5a83b31a
...@@ -402,8 +402,9 @@ bool OOXMLPropertySetImplCompare::operator()(const OOXMLProperty::Pointer_t x, ...@@ -402,8 +402,9 @@ bool OOXMLPropertySetImplCompare::operator()(const OOXMLProperty::Pointer_t x,
*/ */
OOXMLPropertySetImpl::OOXMLPropertySetImpl() OOXMLPropertySetImpl::OOXMLPropertySetImpl()
: msType("OOXMLPropertySetImpl")
{ {
static OString aName("OOXMLPropertySetImpl");
maType = aName;
} }
OOXMLPropertySetImpl::~OOXMLPropertySetImpl() OOXMLPropertySetImpl::~OOXMLPropertySetImpl()
...@@ -449,7 +450,7 @@ OOXMLPropertySetImpl::end() const ...@@ -449,7 +450,7 @@ OOXMLPropertySetImpl::end() const
string OOXMLPropertySetImpl::getType() const string OOXMLPropertySetImpl::getType() const
{ {
return msType; return string(maType.getStr());
} }
void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty) void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty)
...@@ -497,7 +498,7 @@ OOXMLPropertySet * OOXMLPropertySetImpl::clone() const ...@@ -497,7 +498,7 @@ OOXMLPropertySet * OOXMLPropertySetImpl::clone() const
void OOXMLPropertySetImpl::setType(const string & rsType) void OOXMLPropertySetImpl::setType(const string & rsType)
{ {
msType = rsType; maType = OString(rsType.c_str(), rsType.size());
} }
#ifdef DEBUG_DOMAINMAPPER #ifdef DEBUG_DOMAINMAPPER
......
...@@ -164,7 +164,7 @@ public: ...@@ -164,7 +164,7 @@ public:
typedef std::vector<OOXMLProperty::Pointer_t> OOXMLProperties_t; typedef std::vector<OOXMLProperty::Pointer_t> OOXMLProperties_t;
private: private:
OOXMLProperties_t mProperties; OOXMLProperties_t mProperties;
std::string msType; OString maType;
public: public:
OOXMLPropertySetImpl(); OOXMLPropertySetImpl();
virtual ~OOXMLPropertySetImpl(); virtual ~OOXMLPropertySetImpl();
......
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