diff options
Diffstat (limited to 'forms/qa/integration/forms')
-rw-r--r-- | forms/qa/integration/forms/FormLayer.java | 22 | ||||
-rw-r--r-- | forms/qa/integration/forms/FormPropertyBags.java | 2 |
2 files changed, 22 insertions, 2 deletions
diff --git a/forms/qa/integration/forms/FormLayer.java b/forms/qa/integration/forms/FormLayer.java index d67e28bcf412..032ca5e7331a 100644 --- a/forms/qa/integration/forms/FormLayer.java +++ b/forms/qa/integration/forms/FormLayer.java @@ -310,7 +310,27 @@ public class FormLayer } /* ------------------------------------------------------------------ */ - /** retrieves a control model with a given access path + /** retrieves a control model with a given (integer) access path + */ + public XPropertySet getControlModel( int[] _accessPath ) throws com.sun.star.uno.Exception + { + XIndexAccess indexAcc = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class, + m_document.getFormComponentTreeRoot() ); + XPropertySet controlModel = null; + int i=0; + while ( ( indexAcc != null ) && ( i < _accessPath.length ) ) + { + controlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, + indexAcc.getByIndex( _accessPath[i] ) ); + indexAcc = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class, + controlModel ); + ++i; + } + return controlModel; + } + + /* ------------------------------------------------------------------ */ + /** retrieves a control model with a given (string) access path */ public XPropertySet getControlModel( String[] _accessPath ) throws com.sun.star.uno.Exception { diff --git a/forms/qa/integration/forms/FormPropertyBags.java b/forms/qa/integration/forms/FormPropertyBags.java index 92aa2b8b6236..4adb04796030 100644 --- a/forms/qa/integration/forms/FormPropertyBags.java +++ b/forms/qa/integration/forms/FormPropertyBags.java @@ -180,7 +180,7 @@ public class FormPropertyBags extends complexlib.ComplexTestCase implements XPro m_document = DocumentHelper.loadDocument( m_orb, documentURL ); m_formLayer = new FormLayer( m_document ); - XPropertySet textFieldModel = m_formLayer.getControlModel( new String[] { "Standard", "TextBox" } ); + XPropertySet textFieldModel = m_formLayer.getControlModel( new int[] { 0, 0 } ); // all persistent properties should have the expected values assure( "persistent properties did not survive reload (1)!", ((String)textFieldModel.getPropertyValue( "SomeBoundText" )).equals( "ChangedBoundText" ) ); |