summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-07-25 13:15:36 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2017-07-25 15:33:08 +0200
commit123ea883b0643894c928bd8edd4203bdc60cc054 (patch)
tree220aa067ac34bd672c55e2e49d8970615a43c438
parent0cbbdac4382a36dd8e2c602d239d394eff67c06b (diff)
OOXMLPropertySet: initialize variables on creation and cleanup
Change-Id: Iea92bdb4759ed9514674125325352d2fd2b372f8 Reviewed-on: https://gerrit.libreoffice.org/40400 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--writerfilter/source/ooxml/OOXMLPropertySet.cxx27
1 files changed, 7 insertions, 20 deletions
diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
index 118850144686..4947eef47475 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
@@ -75,9 +75,7 @@ writerfilter::Reference<Properties>::Pointer_t OOXMLProperty::getProps()
#ifdef DEBUG_WRITERFILTER
string OOXMLProperty::getName() const
{
- string sResult;
-
- sResult = (*QNameToString::Instance())(mId);
+ string sResult((*QNameToString::Instance())(mId));
if (sResult.length() == 0)
sResult = fastTokenToId(mId);
@@ -113,17 +111,14 @@ string OOXMLProperty::toString() const
void OOXMLProperty::resolve(writerfilter::Properties & rProperties)
{
- writerfilter::Properties * pProperties = nullptr;
- pProperties = &rProperties;
-
switch (meType)
{
case SPRM:
if (mId != 0x0)
- pProperties->sprm(*this);
+ rProperties.sprm(*this);
break;
case ATTRIBUTE:
- pProperties->attribute(mId, *getValue());
+ rProperties.attribute(mId, *getValue());
break;
}
}
@@ -250,9 +245,7 @@ int OOXMLBooleanValue::getInt() const
uno::Any OOXMLBooleanValue::getAny() const
{
- uno::Any aResult(mbValue);
-
- return aResult;
+ return uno::Any(mbValue);
}
#ifdef DEBUG_WRITERFILTER
@@ -282,9 +275,7 @@ OOXMLStringValue::~OOXMLStringValue()
uno::Any OOXMLStringValue::getAny() const
{
- uno::Any aAny(mStr);
-
- return aAny;
+ return uno::Any(mStr);
}
OUString OOXMLStringValue::getString() const
@@ -318,9 +309,7 @@ OOXMLInputStreamValue::~OOXMLInputStreamValue()
uno::Any OOXMLInputStreamValue::getAny() const
{
- uno::Any aAny(mxInputStream);
-
- return aAny;
+ return uno::Any(mxInputStream);
}
#ifdef DEBUG_WRITERFILTER
@@ -526,9 +515,7 @@ int OOXMLIntegerValue::getInt() const
uno::Any OOXMLIntegerValue::getAny() const
{
- uno::Any aResult(mnValue);
-
- return aResult;
+ return uno::Any(mnValue);
}
OOXMLValue * OOXMLIntegerValue::clone() const