summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-07-02 11:56:34 +0100
committerMichael Meeks <michael.meeks@collabora.com>2014-07-02 11:59:56 +0100
commit5d157ce0d77b7deb6f510eee01c6e211c9713ff3 (patch)
treec3d7dd92ec01f463bb8525b96cae48a982c6b83a
parent5a83b31acab390785505b84895359fa9fbc25ed9 (diff)
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
-rw-r--r--writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx7
-rw-r--r--writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx2
2 files changed, 5 insertions, 4 deletions
diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
index 2903554c43cb..c718a52ae3f6 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
@@ -402,8 +402,9 @@ bool OOXMLPropertySetImplCompare::operator()(const OOXMLProperty::Pointer_t x,
*/
OOXMLPropertySetImpl::OOXMLPropertySetImpl()
-: msType("OOXMLPropertySetImpl")
{
+ static OString aName("OOXMLPropertySetImpl");
+ maType = aName;
}
OOXMLPropertySetImpl::~OOXMLPropertySetImpl()
@@ -449,7 +450,7 @@ OOXMLPropertySetImpl::end() const
string OOXMLPropertySetImpl::getType() const
{
- return msType;
+ return string(maType.getStr());
}
void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty)
@@ -497,7 +498,7 @@ OOXMLPropertySet * OOXMLPropertySetImpl::clone() const
void OOXMLPropertySetImpl::setType(const string & rsType)
{
- msType = rsType;
+ maType = OString(rsType.c_str(), rsType.size());
}
#ifdef DEBUG_DOMAINMAPPER
diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx
index f2f3f548f813..e9ca21a423d1 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx
@@ -164,7 +164,7 @@ public:
typedef std::vector<OOXMLProperty::Pointer_t> OOXMLProperties_t;
private:
OOXMLProperties_t mProperties;
- std::string msType;
+ OString maType;
public:
OOXMLPropertySetImpl();
virtual ~OOXMLPropertySetImpl();