summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-09-21 16:16:39 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-09-21 16:27:10 +0200
commitc0a709e9912de8adb6777b40197accf865c4f046 (patch)
tree7693e71a83493e6d48608ce61ffe6c2f1ac58521
parent7d860f6134654c2f46ceebb1ca1a792c143af795 (diff)
Avoid manual realloc()
Change-Id: I456a2d29daecf8dee14d109ca39a97c5bf461539
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx10
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx2
2 files changed, 5 insertions, 7 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 33d3134f73cc..a4b11f4d3fb7 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1888,9 +1888,9 @@ void DocxAttributeOutput::WriteCollectedRunProperties()
m_pSerializer->singleElementNS( XML_w, XML_lang, xAttrList );
}
- if (m_aTextEffectsGrabBag.getLength() > 0)
+ if (!m_aTextEffectsGrabBag.empty())
{
- for (sal_Int32 i=0; i < m_aTextEffectsGrabBag.getLength(); ++i)
+ for (size_t i = 0; i < m_aTextEffectsGrabBag.size(); ++i)
{
boost::optional<sal_Int32> aElementId = lclGetElementIdForName(m_aTextEffectsGrabBag[i].Name);
if(aElementId)
@@ -1900,7 +1900,7 @@ void DocxAttributeOutput::WriteCollectedRunProperties()
lclProcessRecursiveGrabBag(*aElementId, aGrabBagSeq, m_pSerializer);
}
}
- m_aTextEffectsGrabBag.realloc(0);
+ m_aTextEffectsGrabBag.clear();
}
}
@@ -8138,9 +8138,7 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem )
{
beans::PropertyValue aPropertyValue;
i->second >>= aPropertyValue;
- sal_Int32 aLength = m_aTextEffectsGrabBag.getLength();
- m_aTextEffectsGrabBag.realloc(m_aTextEffectsGrabBag.getLength() + 1);
- m_aTextEffectsGrabBag[aLength] = aPropertyValue;
+ m_aTextEffectsGrabBag.push_back(aPropertyValue);
}
else if (i->first == "SdtEndBefore")
{
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index f860f2d4d049..30faa7f7bba5 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -788,7 +788,7 @@ private:
std::map<OUString, std::vector<OString> > m_aSeqBookmarksNames;
/// GrabBag for text effexts like glow, shadow, ...
- css::uno::Sequence<css::beans::PropertyValue> m_aTextEffectsGrabBag;
+ std::vector<css::beans::PropertyValue> m_aTextEffectsGrabBag;
/// The current table helper
SwWriteTable *m_pTableWrt;