Kaydet (Commit) 66068169 authored tarafından Noel Grandin's avatar Noel Grandin

uno::Sequence->std::vector, and fix method name

Change-Id: Ie8df504e2ff29897527128ca634211d4e50c8810
üst 591f1385
...@@ -715,27 +715,25 @@ namespace pcr ...@@ -715,27 +715,25 @@ namespace pcr
m_bEventsMapInitialized = true; m_bEventsMapInitialized = true;
try try
{ {
Sequence< Type > aListeners; std::vector< Type > aListeners;
impl_getCopmonentListenerTypes_nothrow( aListeners ); impl_getComponentListenerTypes_nothrow( aListeners );
sal_Int32 listenerCount = aListeners.getLength();
Property aCurrentProperty; Property aCurrentProperty;
OUString sListenerClassName; OUString sListenerClassName;
// loop through all listeners and all methods, and see which we can present at the UI // loop through all listeners and all methods, and see which we can present at the UI
const Type* pListeners = aListeners.getConstArray(); for ( const Type& rListener : aListeners )
for ( sal_Int32 listener = 0; listener < listenerCount; ++listener, ++pListeners )
{ {
aCurrentProperty = Property(); aCurrentProperty = Property();
// the programmatic name of the listener, to be used as "property" name // 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 ..." ); OSL_ENSURE( !sListenerClassName.isEmpty(), "EventHandler::getSupportedProperties: strange - no listener name ..." );
if ( sListenerClassName.isEmpty() ) if ( sListenerClassName.isEmpty() )
continue; continue;
// loop through all methods // loop through all methods
Sequence< OUString > aMethods( comphelper::getEventMethodsForType( *pListeners ) ); Sequence< OUString > aMethods( comphelper::getEventMethodsForType( rListener ) );
const OUString* pMethods = aMethods.getConstArray(); const OUString* pMethods = aMethods.getConstArray();
sal_uInt32 methodCount = aMethods.getLength(); sal_uInt32 methodCount = aMethods.getLength();
...@@ -969,9 +967,9 @@ namespace pcr ...@@ -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 try
{ {
// we use a set to avoid duplicates // we use a set to avoid duplicates
...@@ -991,8 +989,7 @@ namespace pcr ...@@ -991,8 +989,7 @@ namespace pcr
} }
// now that they're disambiguated, copy these types into our member // now that they're disambiguated, copy these types into our member
_out_rTypes.realloc( aListeners.size() ); std::copy(aListeners.begin(), aListeners.end(), std::back_inserter(_out_rTypes));
::std::copy( aListeners.begin(), aListeners.end(), _out_rTypes.getArray() );
} }
catch( const Exception& ) catch( const Exception& )
{ {
......
...@@ -175,8 +175,8 @@ namespace pcr ...@@ -175,8 +175,8 @@ namespace pcr
@param _out_rTypes @param _out_rTypes
Takes, upon successful return, the types of possible listeners at the introspectee Takes, upon successful return, the types of possible listeners at the introspectee
*/ */
void impl_getCopmonentListenerTypes_nothrow( void impl_getComponentListenerTypes_nothrow(
css::uno::Sequence< css::uno::Type >& _out_rTypes std::vector< css::uno::Type >& _out_rTypes
) const; ) const;
/** returns a secondary component to be used for event inspection /** returns a secondary component to be used for event inspection
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment