diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-02 09:47:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-02 12:00:24 +0100 |
commit | cb982f14796aa4dc4362bc6fde74161afa11777b (patch) | |
tree | 58267840e3cc2a2d6e344337fe3d735063900711 /odk/examples/java/Text | |
parent | a71da3b7a80ca32b595a8ca0ea3da650b0af376c (diff) |
'new Float' is deprecated in Java
replace with Float.valueOf
Change-Id: Ib6408b24dac2953789d0ec67e73b8be8aefca252
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158784
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'odk/examples/java/Text')
-rw-r--r-- | odk/examples/java/Text/HardFormatting.java | 2 | ||||
-rw-r--r-- | odk/examples/java/Text/StyleCreation.java | 4 | ||||
-rw-r--r-- | odk/examples/java/Text/TextDocumentStructure.java | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/odk/examples/java/Text/HardFormatting.java b/odk/examples/java/Text/HardFormatting.java index 81a294c86320..2dcc7b084e36 100644 --- a/odk/examples/java/Text/HardFormatting.java +++ b/odk/examples/java/Text/HardFormatting.java @@ -119,7 +119,7 @@ public class HardFormatting { xPropertySet = UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class, xWordCursor); xPropertySet.setPropertyValue("CharWeight", - new Float(com.sun.star.awt.FontWeight.BOLD)); + Float.valueOf(com.sun.star.awt.FontWeight.BOLD)); xPropertySet.setPropertyValue("CharColor", Integer.valueOf( 255 ) ); System.out.println( diff --git a/odk/examples/java/Text/StyleCreation.java b/odk/examples/java/Text/StyleCreation.java index d5151eca7c29..5ad1c9498a26 100644 --- a/odk/examples/java/Text/StyleCreation.java +++ b/odk/examples/java/Text/StyleCreation.java @@ -93,11 +93,11 @@ public class StyleCreation { xPropertySet.setPropertyValue("CharFontName", "Helvetica" ); System.out.println( "set name of the font to 'Helvetica'" ); - xPropertySet.setPropertyValue("CharHeight", new Float( 36 ) ); + xPropertySet.setPropertyValue("CharHeight", Float.valueOf( 36 ) ); System.out.println( "Change the height of th font to 36" ); xPropertySet.setPropertyValue("CharWeight", - new Float( com.sun.star.awt.FontWeight.BOLD ) ); + Float.valueOf( com.sun.star.awt.FontWeight.BOLD ) ); System.out.println( "set the font attribute 'Bold'" ); xPropertySet.setPropertyValue("CharAutoKerning", Boolean.TRUE ); diff --git a/odk/examples/java/Text/TextDocumentStructure.java b/odk/examples/java/Text/TextDocumentStructure.java index 7f284556d3f5..a1043a44775f 100644 --- a/odk/examples/java/Text/TextDocumentStructure.java +++ b/odk/examples/java/Text/TextDocumentStructure.java @@ -186,7 +186,7 @@ public class TextDocumentStructure { UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class, xWordCursor ); xPropertySet.setPropertyValue("CharWeight", - new Float( com.sun.star.awt.FontWeight.BOLD )); + Float.valueOf( com.sun.star.awt.FontWeight.BOLD )); System.out.println("create example data"); } |