summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-19 09:14:59 +0200
committerNoel Grandin <noel@peralex.com>2015-11-19 09:33:29 +0200
commit2554efabb6d7cd2ad9f7cfdddd0712c25cdca1cd (patch)
tree1b8fd3940910ffcd328e16a53e208c099f67ab21 /writerfilter
parentf7b5f477bfd942e0a1d8880c372635000d724dd7 (diff)
use comphelper::containerToSequence
in chart2, we remove a local equivalent of the method Change-Id: I25129a3d1ea1dd724eb9cd38a57be37a78b3d100
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/MeasureHandler.cxx9
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx10
-rw-r--r--writerfilter/source/dmapper/SdtHelper.cxx5
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx19
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