Kaydet (Commit) 25b6499d authored tarafından Miklos Vajna's avatar Miklos Vajna

writerfilter: avoid manual realloc in StyleSheetTable

Change-Id: I4dfc27cb4567146a20a4de50a04831fcd6863935
üst 32809101
...@@ -854,13 +854,12 @@ void StyleSheetTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties> ...@@ -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 // grab bag, as we can be sure that only a single style entry has
// latent style info. // latent style info.
uno::Reference<beans::XPropertySet> xPropertySet(m_pImpl->m_xTextDocument, uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(m_pImpl->m_xTextDocument, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aGrabBag; auto aGrabBag = comphelper::sequenceToContainer< std::vector<beans::PropertyValue> >(xPropertySet->getPropertyValue("InteropGrabBag").get< uno::Sequence<beans::PropertyValue> >());
xPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag; beans::PropertyValue aValue;
sal_Int32 nLength = aGrabBag.getLength(); aValue.Name = "latentStyles";
aGrabBag.realloc(nLength + 1); aValue.Value = uno::makeAny(aLatentStyles);
aGrabBag[nLength].Name = "latentStyles"; aGrabBag.push_back(aValue);
aGrabBag[nLength].Value = uno::makeAny(aLatentStyles); xPropertySet->setPropertyValue("InteropGrabBag", uno::makeAny(comphelper::containerToSequence(aGrabBag)));
xPropertySet->setPropertyValue("InteropGrabBag", uno::makeAny(aGrabBag));
} }
StyleSheetEntryPtr pEmptyEntry; StyleSheetEntryPtr pEmptyEntry;
......
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