diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-27 09:02:02 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-27 09:02:54 +0100 |
commit | 25b6499d1f7638cf270da98b5bdfcfc7266283ce (patch) | |
tree | 6688d070f6247431986e6db69be599fa0cd42bd4 /writerfilter | |
parent | 328091014d2dadf9beea74a56cf7ee01e347eccc (diff) |
writerfilter: avoid manual realloc in StyleSheetTable
Change-Id: I4dfc27cb4567146a20a4de50a04831fcd6863935
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index f50b2e807274..6e8c51bbcf3d 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -854,13 +854,12 @@ void StyleSheetTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties> // grab bag, as we can be sure that only a single style entry has // latent style info. uno::Reference<beans::XPropertySet> xPropertySet(m_pImpl->m_xTextDocument, uno::UNO_QUERY); - uno::Sequence<beans::PropertyValue> aGrabBag; - xPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag; - sal_Int32 nLength = aGrabBag.getLength(); - aGrabBag.realloc(nLength + 1); - aGrabBag[nLength].Name = "latentStyles"; - aGrabBag[nLength].Value = uno::makeAny(aLatentStyles); - xPropertySet->setPropertyValue("InteropGrabBag", uno::makeAny(aGrabBag)); + auto aGrabBag = comphelper::sequenceToContainer< std::vector<beans::PropertyValue> >(xPropertySet->getPropertyValue("InteropGrabBag").get< uno::Sequence<beans::PropertyValue> >()); + beans::PropertyValue aValue; + aValue.Name = "latentStyles"; + aValue.Value = uno::makeAny(aLatentStyles); + aGrabBag.push_back(aValue); + xPropertySet->setPropertyValue("InteropGrabBag", uno::makeAny(comphelper::containerToSequence(aGrabBag))); } StyleSheetEntryPtr pEmptyEntry; |