summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-12-03 11:06:18 +0200
committerNoel Grandin <noel@peralex.com>2015-12-03 13:57:22 +0200
commit66068169220a9fc387e7002b69fc9e32b028cd8d (patch)
tree2370fccbf1c189b73cab92d16af6c998057b97b5 /extensions
parent591f138559d8de5de003e54f32bfecf12e17f0a6 (diff)
uno::Sequence->std::vector, and fix method name
Change-Id: Ie8df504e2ff29897527128ca634211d4e50c8810
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/propctrlr/eventhandler.cxx19
-rw-r--r--extensions/source/propctrlr/eventhandler.hxx4
2 files changed, 10 insertions, 13 deletions
diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx
index eea512450eed..7eac6defe14a 100644
--- a/extensions/source/propctrlr/eventhandler.cxx
+++ b/extensions/source/propctrlr/eventhandler.cxx
@@ -715,27 +715,25 @@ namespace pcr
m_bEventsMapInitialized = true;
try
{
- Sequence< Type > aListeners;
- impl_getCopmonentListenerTypes_nothrow( aListeners );
- sal_Int32 listenerCount = aListeners.getLength();
+ std::vector< Type > aListeners;
+ impl_getComponentListenerTypes_nothrow( aListeners );
Property aCurrentProperty;
OUString sListenerClassName;
// loop through all listeners and all methods, and see which we can present at the UI
- const Type* pListeners = aListeners.getConstArray();
- for ( sal_Int32 listener = 0; listener < listenerCount; ++listener, ++pListeners )
+ for ( const Type& rListener : aListeners )
{
aCurrentProperty = Property();
// the programmatic name of the listener, to be used as "property" name
- sListenerClassName = pListeners->getTypeName();
+ sListenerClassName = rListener.getTypeName();
OSL_ENSURE( !sListenerClassName.isEmpty(), "EventHandler::getSupportedProperties: strange - no listener name ..." );
if ( sListenerClassName.isEmpty() )
continue;
// loop through all methods
- Sequence< OUString > aMethods( comphelper::getEventMethodsForType( *pListeners ) );
+ Sequence< OUString > aMethods( comphelper::getEventMethodsForType( rListener ) );
const OUString* pMethods = aMethods.getConstArray();
sal_uInt32 methodCount = aMethods.getLength();
@@ -969,9 +967,9 @@ namespace pcr
}
}
- void EventHandler::impl_getCopmonentListenerTypes_nothrow( Sequence< Type >& _out_rTypes ) const
+ void EventHandler::impl_getComponentListenerTypes_nothrow( std::vector< Type >& _out_rTypes ) const
{
- _out_rTypes.realloc( 0 );
+ _out_rTypes.clear();
try
{
// we use a set to avoid duplicates
@@ -991,8 +989,7 @@ namespace pcr
}
// now that they're disambiguated, copy these types into our member
- _out_rTypes.realloc( aListeners.size() );
- ::std::copy( aListeners.begin(), aListeners.end(), _out_rTypes.getArray() );
+ std::copy(aListeners.begin(), aListeners.end(), std::back_inserter(_out_rTypes));
}
catch( const Exception& )
{
diff --git a/extensions/source/propctrlr/eventhandler.hxx b/extensions/source/propctrlr/eventhandler.hxx
index e730a99468d8..fb4e0befc9f9 100644
--- a/extensions/source/propctrlr/eventhandler.hxx
+++ b/extensions/source/propctrlr/eventhandler.hxx
@@ -175,8 +175,8 @@ namespace pcr
@param _out_rTypes
Takes, upon successful return, the types of possible listeners at the introspectee
*/
- void impl_getCopmonentListenerTypes_nothrow(
- css::uno::Sequence< css::uno::Type >& _out_rTypes
+ void impl_getComponentListenerTypes_nothrow(
+ std::vector< css::uno::Type >& _out_rTypes
) const;
/** returns a secondary component to be used for event inspection