summaryrefslogtreecommitdiff
path: root/odk/examples/java
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-11-02 09:47:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-11-02 12:00:24 +0100
commitcb982f14796aa4dc4362bc6fde74161afa11777b (patch)
tree58267840e3cc2a2d6e344337fe3d735063900711 /odk/examples/java
parenta71da3b7a80ca32b595a8ca0ea3da650b0af376c (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')
-rw-r--r--odk/examples/java/Drawing/SDraw.java3
-rw-r--r--odk/examples/java/NotesAccess/NotesAccess.java2
-rw-r--r--odk/examples/java/Spreadsheet/ChartTypeChange.java2
-rw-r--r--odk/examples/java/Spreadsheet/SCalc.java2
-rw-r--r--odk/examples/java/Text/HardFormatting.java2
-rw-r--r--odk/examples/java/Text/StyleCreation.java4
-rw-r--r--odk/examples/java/Text/TextDocumentStructure.java2
7 files changed, 8 insertions, 9 deletions
diff --git a/odk/examples/java/Drawing/SDraw.java b/odk/examples/java/Drawing/SDraw.java
index 5d2f9a52e941..a02d41ee01d9 100644
--- a/odk/examples/java/Drawing/SDraw.java
+++ b/odk/examples/java/Drawing/SDraw.java
@@ -221,8 +221,7 @@ public class SDraw {
size.Height = height;
size.Width = width;
position.X = (x+(i*40));
- position.Y =
- (new Float(y+(Math.sin((i*Math.PI)/180))*5000)).intValue();
+ position.Y = (int)(y+(Math.sin((i*Math.PI)/180))*5000);
xShape.setSize(size);
xShape.setPosition(position);
diff --git a/odk/examples/java/NotesAccess/NotesAccess.java b/odk/examples/java/NotesAccess/NotesAccess.java
index 0d0a0bb5ee60..8945a9e9984e 100644
--- a/odk/examples/java/NotesAccess/NotesAccess.java
+++ b/odk/examples/java/NotesAccess/NotesAccess.java
@@ -271,7 +271,7 @@ public class NotesAccess implements Runnable {
System.out.println( "Could not get Cell" );
}
if ( stringFlag.equals( "V" )) {
- xCell.setValue((new Float(stringValue)).floatValue());
+ xCell.setValue((Float.valueOf(stringValue)).floatValue());
}
else {
xCell.setFormula(stringValue);
diff --git a/odk/examples/java/Spreadsheet/ChartTypeChange.java b/odk/examples/java/Spreadsheet/ChartTypeChange.java
index d436b388925e..78f8b14bb417 100644
--- a/odk/examples/java/Spreadsheet/ChartTypeChange.java
+++ b/odk/examples/java/Spreadsheet/ChartTypeChange.java
@@ -336,7 +336,7 @@ public class ChartTypeChange {
System.out.println( "Could not get cell." );
}
if ( stringFlag.equals( "V" ) ) {
- xcell.setValue( ( new Float( stringValue ) ).floatValue() );
+ xcell.setValue( ( Float.valueOf( stringValue ) ).floatValue() );
}
else {
xcell.setFormula( stringValue );
diff --git a/odk/examples/java/Spreadsheet/SCalc.java b/odk/examples/java/Spreadsheet/SCalc.java
index 90c5ce00f41d..db1bee8a803a 100644
--- a/odk/examples/java/Spreadsheet/SCalc.java
+++ b/odk/examples/java/Spreadsheet/SCalc.java
@@ -374,7 +374,7 @@ public class SCalc {
}
if (flag.equals("V")) {
- xCell.setValue((new Float(theValue)).floatValue());
+ xCell.setValue((Float.valueOf(theValue)).floatValue());
} else {
xCell.setFormula(theValue);
}
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");
}