diff options
Diffstat (limited to 'writerfilter/source/dmapper')
-rw-r--r-- | writerfilter/source/dmapper/MeasureHandler.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/dmapper/NumberingManager.cxx | 10 | ||||
-rw-r--r-- | writerfilter/source/dmapper/SdtHelper.cxx | 5 | ||||
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.cxx | 19 |
4 files changed, 7 insertions, 36 deletions
diff --git a/writerfilter/source/dmapper/MeasureHandler.cxx b/writerfilter/source/dmapper/MeasureHandler.cxx index 9b41676aca94..2d0a5fdbdebe 100644 --- a/writerfilter/source/dmapper/MeasureHandler.cxx +++ b/writerfilter/source/dmapper/MeasureHandler.cxx @@ -22,6 +22,7 @@ #include <ooxml/resourceids.hxx> #include <osl/diagnose.h> #include <com/sun/star/text/SizeType.hpp> +#include <comphelper/sequence.hxx> namespace writerfilter { namespace dmapper { @@ -133,13 +134,7 @@ beans::PropertyValue MeasureHandler::getInteropGrabBag() { beans::PropertyValue aRet; aRet.Name = m_aInteropGrabBagName; - - uno::Sequence<beans::PropertyValue> aSeq(m_aInteropGrabBag.size()); - beans::PropertyValue* pSeq = aSeq.getArray(); - for (std::vector<beans::PropertyValue>::iterator i = m_aInteropGrabBag.begin(); i != m_aInteropGrabBag.end(); ++i) - *pSeq++ = *i; - - aRet.Value = uno::makeAny(aSeq); + aRet.Value = uno::makeAny( comphelper::containerToSequence(m_aInteropGrabBag) ); return aRet; } diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index befce733f1a4..36f979bec396 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -224,15 +224,7 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetCharStyleProperties( ) rProperties.push_back(beans::PropertyValue(aValIter->Name, 0, aValIter->Value, beans::PropertyState_DIRECT_VALUE)); } - uno::Sequence< beans::PropertyValue > aRet( rProperties.size() ); - beans::PropertyValue* pValues = aRet.getArray(); - PropertyValueVector_t::const_iterator aIt = rProperties.begin(); - PropertyValueVector_t::const_iterator aEndIt = rProperties.end(); - for(sal_uInt32 nIndex = 0; aIt != aEndIt; ++aIt,++nIndex) - { - pValues[nIndex] = *aIt; - } - return aRet; + return comphelper::containerToSequence(rProperties); } uno::Sequence< beans::PropertyValue > ListLevel::GetLevelProperties( ) diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 2d0a240cdb45..b5eabb9dc0ae 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -80,10 +80,7 @@ void SdtHelper::createDropDownControl() uno::Reference<beans::XPropertySet> xPropertySet(xControlModel, uno::UNO_QUERY); xPropertySet->setPropertyValue("DefaultText", uno::makeAny(aDefaultText)); xPropertySet->setPropertyValue("Dropdown", uno::makeAny(sal_True)); - uno::Sequence<OUString> aItems(m_aDropDownItems.size()); - for (size_t i = 0; i < m_aDropDownItems.size(); ++i) - aItems[i] = m_aDropDownItems[i]; - xPropertySet->setPropertyValue("StringItemList", uno::makeAny(aItems)); + xPropertySet->setPropertyValue("StringItemList", uno::makeAny( comphelper::containerToSequence(m_aDropDownItems) )); createControlShape(lcl_getOptimalWidth(m_rDM_Impl.GetStyleSheetTable(), aDefaultText, m_aDropDownItems), xControlModel); m_aDropDownItems.clear(); diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 293064c51814..a0e5922b7f15 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -172,12 +172,7 @@ PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask, StyleSheetE beans::PropertyValues StyleSheetEntry::GetInteropGrabBagSeq() { - uno::Sequence<beans::PropertyValue> aSeq(m_aInteropGrabBag.size()); - beans::PropertyValue* pSeq = aSeq.getArray(); - for (std::vector<beans::PropertyValue>::iterator i = m_aInteropGrabBag.begin(); i != m_aInteropGrabBag.end(); ++i) - *pSeq++ = *i; - - return aSeq; + return comphelper::containerToSequence(m_aInteropGrabBag); } beans::PropertyValue StyleSheetEntry::GetInteropGrabBag() @@ -831,21 +826,13 @@ void StyleSheetTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties> if (!m_pImpl->m_pCurrentEntry->aLsdExceptions.empty()) { std::vector<beans::PropertyValue>& rLsdExceptions = m_pImpl->m_pCurrentEntry->aLsdExceptions; - uno::Sequence<beans::PropertyValue> aLsdExceptions(rLsdExceptions.size()); - beans::PropertyValue* pLsdExceptions = aLsdExceptions.getArray(); - for (std::vector<beans::PropertyValue>::iterator i = rLsdExceptions.begin(); i != rLsdExceptions.end(); ++i) - *pLsdExceptions++ = *i; - beans::PropertyValue aValue; aValue.Name = "lsdExceptions"; - aValue.Value = uno::makeAny(aLsdExceptions); + aValue.Value = uno::makeAny( comphelper::containerToSequence(rLsdExceptions) ); rLatentStyles.push_back(aValue); } - uno::Sequence<beans::PropertyValue> aLatentStyles(rLatentStyles.size()); - beans::PropertyValue* pLatentStyles = aLatentStyles.getArray(); - for (std::vector<beans::PropertyValue>::iterator i = rLatentStyles.begin(); i != rLatentStyles.end(); ++i) - *pLatentStyles++ = *i; + uno::Sequence<beans::PropertyValue> aLatentStyles( comphelper::containerToSequence(rLatentStyles) ); // We can put all latent style info directly to the document interop // grab bag, as we can be sure that only a single style entry has |