summaryrefslogtreecommitdiffstats
path: root/package
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 /package
parentSimplify writerfilter::dmapper::DomainMapper_Impl::appendGrabBag() (diff)
downloadcore-2554efabb6d7cd2ad9f7cfdddd0712c25cdca1cd.tar.gz
core-2554efabb6d7cd2ad9f7cfdddd0712c25cdca1cd.zip
use comphelper::containerToSequence
in chart2, we remove a local equivalent of the method Change-Id: I25129a3d1ea1dd724eb9cd38a57be37a78b3d100
Diffstat (limited to 'package')
-rw-r--r--package/source/manifest/ManifestReader.cxx8
-rw-r--r--package/source/zippackage/ZipPackage.cxx12
2 files changed, 4 insertions, 16 deletions
diff --git a/package/source/manifest/ManifestReader.cxx b/package/source/manifest/ManifestReader.cxx
index 485c45c58ffd..7ca27786d194 100644
--- a/package/source/manifest/ManifestReader.cxx
+++ b/package/source/manifest/ManifestReader.cxx
@@ -20,6 +20,7 @@
#include <ManifestReader.hxx>
#include <ManifestImport.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/sequence.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
@@ -59,12 +60,7 @@ Sequence< Sequence< PropertyValue > > SAL_CALL ManifestReader::readManifestSeque
aParserInput.sSystemId = "META-INF/manifest.xml";
xParser->setDocumentHandler ( xFilter );
xParser->parseStream( aParserInput );
- aManifestSequence.realloc ( aManVector.size() );
- Sequence < PropertyValue > * pSequence = aManifestSequence.getArray();
- ::std::vector < Sequence < PropertyValue > >::const_iterator aIter = aManVector.begin();
- ::std::vector < Sequence < PropertyValue > >::const_iterator aEnd = aManVector.end();
- while( aIter != aEnd )
- *pSequence++ = (*aIter++);
+ aManifestSequence = comphelper::containerToSequence(aManVector);
}
catch (SAXParseException& e)
{
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 1fe2cffbae9e..d19452d96a49 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -79,6 +79,7 @@
#include <comphelper/documentconstants.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/sequence.hxx>
using namespace std;
using namespace osl;
@@ -1017,16 +1018,7 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< uno::Seq
pEntry->nSize = pEntry->nCompressedSize = -1;
pEntry->nTime = ZipOutputStream::getCurrentDosTime();
- // Convert vector into a uno::Sequence
- uno::Sequence < uno::Sequence < PropertyValue > > aManifestSequence ( aManList.size() );
- sal_Int32 nInd = 0;
- for ( vector < uno::Sequence < PropertyValue > >::const_iterator aIter = aManList.begin(), aEnd = aManList.end();
- aIter != aEnd;
- ++aIter, ++nInd )
- {
- aManifestSequence[nInd] = ( *aIter );
- }
- xWriter->writeManifestSequence ( xManOutStream, aManifestSequence );
+ xWriter->writeManifestSequence ( xManOutStream, comphelper::containerToSequence(aManList) );
sal_Int32 nBufferLength = static_cast < sal_Int32 > ( pBuffer->getPosition() );
pBuffer->realloc( nBufferLength );