diff options
author | Oliver Bolte <obo@openoffice.org> | 2007-03-09 12:19:11 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2007-03-09 12:19:11 +0000 |
commit | 83045a48a0b84182833c7020dd9775de4d60300b (patch) | |
tree | e7115665c6e615b046a72299db707ea4cb238b01 /forms/qa/integration | |
parent | eb19e9dca090cab48af176fb6772000f70b4067c (diff) |
INTEGRATION: CWS hb02 (1.4.164); FILE MERGED
2007/02/05 15:25:02 fs 1.4.164.1: +getControlModel(String[])
Diffstat (limited to 'forms/qa/integration')
-rw-r--r-- | forms/qa/integration/forms/FormLayer.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/forms/qa/integration/forms/FormLayer.java b/forms/qa/integration/forms/FormLayer.java index 2f2e7ac90fd5..c99dcd5eeb68 100644 --- a/forms/qa/integration/forms/FormLayer.java +++ b/forms/qa/integration/forms/FormLayer.java @@ -4,9 +4,9 @@ * * $RCSfile: FormLayer.java,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: rt $ $Date: 2005-09-08 22:29:13 $ + * last change: $Author: obo $ $Date: 2007-03-09 13:19:11 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -34,6 +34,9 @@ ************************************************************************/ package integration.forms; +import com.sun.star.container.NoSuchElementException; +import com.sun.star.container.XNameAccess; +import com.sun.star.lang.WrappedTargetException; import com.sun.star.uno.UnoRuntime; import com.sun.star.beans.XPropertySet; @@ -276,4 +279,23 @@ import integration.forms.DocumentHelper; } return null; } + + /* ------------------------------------------------------------------ */ + /** retrieves a control model with a given access path + */ + public XPropertySet getControlModel( String[] _accessPath ) throws com.sun.star.uno.Exception + { + XNameAccess nameAcc = m_document.getFormComponentTreeRoot(); + XPropertySet controlModel = null; + int i=0; + while ( ( nameAcc != null ) && ( i < _accessPath.length ) ) + { + controlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, + nameAcc.getByName( _accessPath[i] ) ); + nameAcc = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class, + controlModel ); + ++i; + } + return controlModel; + } } |