summaryrefslogtreecommitdiffstats
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-02-06 17:42:52 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-02-09 06:14:57 +0000
commit153bf01280f32c7216bd872665ca81a90fb301fe (patch)
tree8a19532db6fd3458055a0845a55fc27030347f51 /comphelper
parenttdf#97662 - Try to preserve original compressed JPEGs harder. (diff)
downloadcore-153bf01280f32c7216bd872665ca81a90fb301fe.tar.gz
core-153bf01280f32c7216bd872665ca81a90fb301fe.zip
sequence->vector in PropertyMapImpl
Change-Id: Id42d6d739f402c725325816c506caa369267ec8e Reviewed-on: https://gerrit.libreoffice.org/22178 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/property/propertysetinfo.cxx32
1 files changed, 16 insertions, 16 deletions
diff --git a/comphelper/source/property/propertysetinfo.cxx b/comphelper/source/property/propertysetinfo.cxx
index a97b8abd0ae4..3073c295274f 100644
--- a/comphelper/source/property/propertysetinfo.cxx
+++ b/comphelper/source/property/propertysetinfo.cxx
@@ -19,6 +19,8 @@
#include <comphelper/propertysetinfo.hxx>
+#include <comphelper/sequence.hxx>
+#include <vector>
using namespace ::comphelper;
@@ -38,7 +40,7 @@ public:
void add(PropertyMapEntry const * pMap) throw();
void remove( const OUString& aName ) throw();
- Sequence< Property > getProperties() throw();
+ std::vector< Property > getProperties() throw();
const PropertyMap& getPropertyMap() const throw() { return maPropertyMap;}
@@ -47,7 +49,7 @@ public:
private:
PropertyMap maPropertyMap;
- Sequence< Property > maProperties;
+ std::vector< Property > maProperties;
};
}
@@ -68,8 +70,7 @@ void PropertyMapImpl::add(PropertyMapEntry const * pMap) throw()
maPropertyMap[pMap->maName] = pMap;
- if( maProperties.getLength() )
- maProperties.realloc( 0 );
+ maProperties.clear();
pMap = &pMap[1];
}
@@ -79,30 +80,29 @@ void PropertyMapImpl::remove( const OUString& aName ) throw()
{
maPropertyMap.erase( aName );
- if( maProperties.getLength() )
- maProperties.realloc( 0 );
+ maProperties.clear();
}
-Sequence< Property > PropertyMapImpl::getProperties() throw()
+std::vector< Property > PropertyMapImpl::getProperties() throw()
{
// maybe we have to generate the properties after
// a change in the property map or at first call
// to getProperties
- if( maProperties.getLength() != (sal_Int32)maPropertyMap.size() )
+ if( maProperties.size() != maPropertyMap.size() )
{
- maProperties = Sequence< Property >( maPropertyMap.size() );
- Property* pProperties = maProperties.getArray();
+ maProperties.resize( maPropertyMap.size() );
+ auto propIter = maProperties.begin();
for( const auto& rProperty : maPropertyMap )
{
PropertyMapEntry const * pEntry = rProperty.second;
- pProperties->Name = pEntry->maName;
- pProperties->Handle = pEntry->mnHandle;
- pProperties->Type = pEntry->maType;
- pProperties->Attributes = pEntry->mnAttributes;
+ propIter->Name = pEntry->maName;
+ propIter->Handle = pEntry->mnHandle;
+ propIter->Type = pEntry->maType;
+ propIter->Attributes = pEntry->mnAttributes;
- ++pProperties;
+ ++propIter;
}
}
@@ -175,7 +175,7 @@ void PropertySetInfo::remove( const OUString& aName ) throw()
Sequence< css::beans::Property > SAL_CALL PropertySetInfo::getProperties() throw(css::uno::RuntimeException, std::exception)
{
- return mpMap->getProperties();
+ return comphelper::containerToSequence(mpMap->getProperties());
}
Property SAL_CALL PropertySetInfo::getPropertyByName( const OUString& aName ) throw(css::beans::UnknownPropertyException, css::uno::RuntimeException, std::exception)