diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-13 01:20:31 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-16 21:22:44 -0400 |
commit | c8f40655eac948bb8b7c9387e7333160c0088f4f (patch) | |
tree | 0940fa43c94c794d9f9f6e7fa7dbaffcc132e524 /forms/source | |
parent | 80b1e662777100a7dfd80176a2b528880a838167 (diff) |
Keep the container and object separate methods.
ScVbaControl doesn't have any container instance to pass to the
old method.
Diffstat (limited to 'forms/source')
-rw-r--r-- | forms/source/misc/InterfaceContainer.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index e908d75472c1..af244143f69e 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -148,9 +148,12 @@ void OInterfaceContainer::impl_addVbEvents_nolck_nothrow( const sal_Int32 i_nIn if ( xElementAsForm.is() ) break; - rtl::OUString sCodeName; + // Try getting the code name from the container first (faster), + // then from the element if that fails (slower). Reference<XInterface> xThis = static_cast<XContainer*>(this); - sCodeName = xNameQuery->getCodeNameForObject(xThis, xElement); + rtl::OUString sCodeName = xNameQuery->getCodeNameForContainer(xThis); + if (sCodeName.isEmpty()) + sCodeName = xNameQuery->getCodeNameForObject(xElement); Reference< XPropertySet > xProps( xElement, UNO_QUERY_THROW ); ::rtl::OUString sServiceName; |