diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-12 00:08:26 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-16 21:22:41 -0400 |
commit | 39b2de7545780d8897c9f28cbedfefd672cd53d7 (patch) | |
tree | 14a4dd58f4e9c8fc0b8f01560032bfaa79b023bc /forms | |
parent | bc01bc636d104b435ea5ad1dcc7cab85d6dc4b9a (diff) |
Code page should be the same for the same drawing page.
This removes O(n^2) from the process of querying the code pages for
form elements.
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/misc/InterfaceContainer.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index 9c25049affb8..e1608ec1d4d2 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -148,7 +148,15 @@ void OInterfaceContainer::impl_addVbEvents_nolck_nothrow( const sal_Int32 i_nIn if ( xElementAsForm.is() ) break; - ::rtl::OUString sCodeName( xNameQuery->getCodeNameForObject( xElement ) ); + rtl::OUString sCodeName; + { + Reference<XInterface> xThis = static_cast<XContainer*>(this); + sal_Int32 nPageIndex = xNameQuery->getPageIndexForObject(xThis); + if (nPageIndex >= 0) + sCodeName = xNameQuery->getCodeNameByIndex(nPageIndex); + else + sCodeName = xNameQuery->getCodeNameForObject(xElement); + } Reference< XPropertySet > xProps( xElement, UNO_QUERY_THROW ); ::rtl::OUString sServiceName; |