diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-13 10:08:31 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-13 10:24:10 +0200 |
commit | 34bcf9b498bccb5c924f4cec850ff15d88df6f07 (patch) | |
tree | 4d9604ec8c3b73639338ec45a0618b5daa5cf0ed /forms/qa/integration | |
parent | 347926e8e57c1825261daa46c1886aa2ebf9571b (diff) |
java: remove dead methods
found by UCDetector
Change-Id: I219caa8e680dba5a395541a778df6144841c4dde
Diffstat (limited to 'forms/qa/integration')
-rw-r--r-- | forms/qa/integration/forms/DocumentHelper.java | 21 | ||||
-rw-r--r-- | forms/qa/integration/forms/DocumentType.java | 17 | ||||
-rw-r--r-- | forms/qa/integration/forms/DocumentViewHelper.java | 30 | ||||
-rw-r--r-- | forms/qa/integration/forms/FormComponent.java | 18 | ||||
-rw-r--r-- | forms/qa/integration/forms/FormLayer.java | 41 |
5 files changed, 6 insertions, 121 deletions
diff --git a/forms/qa/integration/forms/DocumentHelper.java b/forms/qa/integration/forms/DocumentHelper.java index cbbb73d7385b..41e620593e65 100644 --- a/forms/qa/integration/forms/DocumentHelper.java +++ b/forms/qa/integration/forms/DocumentHelper.java @@ -108,11 +108,7 @@ public class DocumentHelper return blankDocument( orb, DocumentType.WRITER ); } - /* ------------------------------------------------------------------ */ - public static DocumentHelper blankXMLForm( XMultiServiceFactory orb ) throws com.sun.star.uno.Exception - { - return blankDocument( orb, DocumentType.XMLFORM ); - } + /* ------------------------------------------------------------------ */ public static DocumentHelper blankDocument( XMultiServiceFactory orb, DocumentType eType ) throws com.sun.star.uno.Exception @@ -260,22 +256,7 @@ public class DocumentHelper return createSubForm( xContainer, sInitialName ); } - /* ------------------------------------------------------------------ */ - /** retrieves the document model which a given form component belongs to - */ - static public DocumentHelper getDocumentForComponent( Object aFormComponent, XMultiServiceFactory orb ) - { - XChild xChild = UnoRuntime.queryInterface( XChild.class, aFormComponent ); - XModel xModel = null; - while ( ( null != xChild ) && ( null == xModel ) ) - { - XInterface xParent = (XInterface)xChild.getParent(); - xModel = UnoRuntime.queryInterface( XModel.class, xParent ); - xChild = UnoRuntime.queryInterface( XChild.class, xParent ); - } - return new DocumentHelper( orb, xModel ); - } /* ------------------------------------------------------------------ */ /** returns a URL which can be used to create a document of a certain type diff --git a/forms/qa/integration/forms/DocumentType.java b/forms/qa/integration/forms/DocumentType.java index 94e2fa4e54ae..105c31fc2614 100644 --- a/forms/qa/integration/forms/DocumentType.java +++ b/forms/qa/integration/forms/DocumentType.java @@ -26,10 +26,7 @@ public class DocumentType extends com.sun.star.uno.Enum super( value ); } - public static DocumentType getDefault() - { - return WRITER; - } + public static final DocumentType WRITER = new DocumentType(0); public static final DocumentType CALC = new DocumentType(1); @@ -37,16 +34,6 @@ public class DocumentType extends com.sun.star.uno.Enum public static final DocumentType XMLFORM = new DocumentType(3); public static final DocumentType UNKNOWN = new DocumentType(-1); - public static DocumentType fromInt(int value) - { - switch(value) - { - case 0: return WRITER; - case 1: return CALC; - case 2: return DRAWING; - case 3: return XMLFORM; - default: return UNKNOWN; - } - } + } diff --git a/forms/qa/integration/forms/DocumentViewHelper.java b/forms/qa/integration/forms/DocumentViewHelper.java index b2b06cad3990..4026ba3c9751 100644 --- a/forms/qa/integration/forms/DocumentViewHelper.java +++ b/forms/qa/integration/forms/DocumentViewHelper.java @@ -213,36 +213,6 @@ public class DocumentViewHelper xControlWindow.setFocus(); } - /* ------------------------------------------------------------------ */ - /** sets the focus to the first control - */ - protected void grabControlFocus( ) throws java.lang.Exception - { - // the forms container of our document - XIndexContainer xForms = dbfTools.queryIndexContainer( m_document.getFormComponentTreeRoot( ) ); - // the first form - XIndexContainer xForm = dbfTools.queryIndexContainer( xForms.getByIndex( 0 ) ); - // the first control model which is no FixedText (FixedText's can't have the focus) - for ( int i = 0; i<xForm.getCount(); ++i ) - { - XPropertySet xControlProps = dbfTools.queryPropertySet( xForm.getByIndex( i ) ); - if ( FormComponentType.FIXEDTEXT != ((Short)xControlProps.getPropertyValue( "ClassId" )).shortValue() ) - { - XControlModel xControlModel = UnoRuntime.queryInterface( - XControlModel.class, xControlProps ); - // set the focus to this control - grabControlFocus( xControlModel ); - // outta here - break; - } - } - - // Note that we simply took the first control model from the hierarchy. This does state nothing - // about the location of the respective control in the view. A control model is tied to a control - // shape, and the shapes are where the geometry information such as position and size is hung up. - // So you could easily have a document where the first control model is bound to a shape which - // has a greater ordinate than any other control model. - } } diff --git a/forms/qa/integration/forms/FormComponent.java b/forms/qa/integration/forms/FormComponent.java index 51f92a142aba..89b8f91b83c7 100644 --- a/forms/qa/integration/forms/FormComponent.java +++ b/forms/qa/integration/forms/FormComponent.java @@ -108,13 +108,7 @@ public class FormComponent return new String[]{}; } - /* ------------------------------------------------------------------ */ - public boolean hasByName( String name ) - { - if ( m_nameAccess != null ) - return m_nameAccess.hasByName( name ); - return false; - } + /* ------------------------------------------------------------------ */ public int getCount() @@ -150,15 +144,7 @@ public class FormComponent return new com.sun.star.uno.Type( String.class ); } - /* ------------------------------------------------------------------ */ - public boolean hasElements() - { - if ( m_indexAccess != null ) - return m_indexAccess.hasElements(); - else if ( m_nameAccess != null ) - return m_nameAccess.hasElements(); - return false; - } + /* ------------------------------------------------------------------ */ public FormComponent getParent() diff --git a/forms/qa/integration/forms/FormLayer.java b/forms/qa/integration/forms/FormLayer.java index 4c5ccbea5ba8..67c2c266696c 100644 --- a/forms/qa/integration/forms/FormLayer.java +++ b/forms/qa/integration/forms/FormLayer.java @@ -276,29 +276,7 @@ public class FormLayer return null; } - /* ------------------------------------------------------------------ */ - /** retrieves the radio button model with the given name and the given tag - * @param form - * the parent form of the radio button model to find - * @param name - * the name of the radio button - * @param tag - * the tag of the radio button - */ - public XPropertySet getRadioModelByTag( XPropertySet form, String name, String tag ) throws com.sun.star.uno.Exception, java.lang.Exception - { - XIndexAccess indexAccess = UnoRuntime.queryInterface( XIndexAccess.class, form ); - for ( int i=0; i<indexAccess.getCount(); ++i ) - { - XPropertySet control = dbfTools.queryPropertySet( indexAccess.getByIndex( i ) ); - - if ( ((String)control.getPropertyValue( "Name" )).equals( name ) ) - if ( ((String)control.getPropertyValue( "Tag" )).equals( tag ) ) - return control; - } - return null; - } /* ------------------------------------------------------------------ */ /** retrieves a control model with a given (integer) access path @@ -320,24 +298,7 @@ public class FormLayer return controlModel; } - /* ------------------------------------------------------------------ */ - /** retrieves a control model with a given (string) 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 = UnoRuntime.queryInterface( XPropertySet.class, - nameAcc.getByName( _accessPath[i] ) ); - nameAcc = UnoRuntime.queryInterface( XNameAccess.class, - controlModel ); - ++i; - } - return controlModel; - } + /* ------------------------------------------------------------------ */ /** simulates a user's text input into a control given by control model |