diff options
author | Robert Antoni Buj i Gelonch <robert.buj@gmail.com> | 2014-10-12 12:08:44 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-12 15:48:44 +0000 |
commit | 881c030fc1e69cffc99b2360c986f516e61f01ab (patch) | |
tree | 9b283a023ae821c2d9a01f22ad24819c5e5b4a7c /qadevOOo | |
parent | d1c1c4e4616555df4efb55ae6ba381c26888683d (diff) |
runner: Concatenating null strings in Java (JDK 1.5+)
JLS, Section 15.18.1.1:
If the reference is null, it is converted to the string "null".
http://docs.oracle.com/javase/specs/jls/se5.0/html/expressions.html#15.18.1.1
Change-Id: Idae09c02b24da38ec6f3475fd0af35ef48a2405b
Reviewed-on: https://gerrit.libreoffice.org/11930
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/runner/util/UITools.java | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/qadevOOo/runner/util/UITools.java b/qadevOOo/runner/util/UITools.java index 3f4701be4823..dfff8356910e 100644 --- a/qadevOOo/runner/util/UITools.java +++ b/qadevOOo/runner/util/UITools.java @@ -28,14 +28,15 @@ import com.sun.star.accessibility.XAccessibleContext; import com.sun.star.accessibility.XAccessibleEditableText; import com.sun.star.accessibility.XAccessibleText; import com.sun.star.accessibility.XAccessibleValue; + import com.sun.star.awt.XWindow; import com.sun.star.frame.XModel; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.XTextDocument; + import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; - /** * This class supports some functions to handle easily accessible objects */ @@ -69,7 +70,6 @@ public class UITools { return AccessibilityTools.getAccessibleObject(xWindow); } - private static String getString(XInterface xInt) { XAccessibleText oText = UnoRuntime.queryInterface(XAccessibleText.class, xInt); @@ -128,7 +128,6 @@ public class UITools { * @param buttonName is name name of the button to click * @throws java.lang.Exception if something fail */ - public void clickButton(String buttonName) throws java.lang.Exception { @@ -148,15 +147,12 @@ public class UITools { } } - - /** * Helper method: returns the entry manes of a List-Box * @param ListBoxName the name of the listbox * @return the listbox entry names * @throws java.lang.Exception if something fail */ - public String[] getListBoxItems(String ListBoxName) throws java.lang.Exception { @@ -209,7 +205,6 @@ public class UITools { return Items.toArray(ret); } - /** * set a value to a named check box * @param CheckBoxName the name of the check box @@ -236,8 +231,6 @@ public class UITools { } } - - /** * returns the message of a Basic-MessageBox * @return the message of a Basic-MessageBox @@ -246,30 +239,18 @@ public class UITools { public String getMsgBoxText() throws java.lang.Exception { - String cMessage = null; try{ XAccessibleContext xMessage =AccessibilityTools.getAccessibleObjectForRole(mXRoot, AccessibleRole.LABEL); XInterface xMessageInterface = UnoRuntime.queryInterface(XInterface.class, xMessage); - cMessage += (getString(xMessageInterface)); - - return cMessage; + return getString(xMessageInterface); } catch (Exception e) { throw new Exception("Could not get message from Basic-MessageBox:", e); } } - - - - - - - - - /** * Prints the accessible tree to the <CODE>logWriter</CODE> only if <CODE>debugIsActive</CODE> * is set to <CODE>true</CODE> @@ -280,4 +261,4 @@ public class UITools { AccessibilityTools.printAccessibleTree(log, mXRoot, debugIsActive); } -} +}
\ No newline at end of file |