diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-05 11:42:57 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-08 09:48:17 +0200 |
commit | 336f3b9153ff22d080530f3b4d733d1f7fd2f6bd (patch) | |
tree | a099cd9b56e7c8807ddb841f58d1bfc4a964981f /odk/examples/DevelopersGuide | |
parent | 2d700944b50dc9bcf030732cf1221426f55b3dd6 (diff) |
java: code some code to use non-deprecated constructors
Change-Id: I4194a3dfd361d1955cf5bb4fab915150eecfa21a
Diffstat (limited to 'odk/examples/DevelopersGuide')
-rw-r--r-- | odk/examples/DevelopersGuide/Charts/ChartHelper.java | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/odk/examples/DevelopersGuide/Charts/ChartHelper.java b/odk/examples/DevelopersGuide/Charts/ChartHelper.java index 977983ecbce7..2a75a94ef132 100644 --- a/odk/examples/DevelopersGuide/Charts/ChartHelper.java +++ b/odk/examples/DevelopersGuide/Charts/ChartHelper.java @@ -35,25 +35,27 @@ // __________ Imports __________ -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.Any; - -// factory for creating components -import com.sun.star.lang.XMultiServiceFactory; +// base graphics things +import com.sun.star.awt.Point; +import com.sun.star.awt.Size; import com.sun.star.beans.XPropertySet; - // application specific classes import com.sun.star.chart.XChartDocument; import com.sun.star.chart.XDiagram; -import com.sun.star.drawing.*; +import com.sun.star.drawing.XDrawPageSupplier; +import com.sun.star.drawing.XDrawPagesSupplier; +import com.sun.star.drawing.XShape; +import com.sun.star.drawing.XShapes; import com.sun.star.frame.XModel; -import com.sun.star.text.XTextDocument; +// factory for creating components +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.text.XText; import com.sun.star.text.XTextContent; import com.sun.star.text.XTextCursor; -import com.sun.star.text.XText; -// base graphics things -import com.sun.star.awt.Point; -import com.sun.star.awt.Size; +import com.sun.star.text.XTextDocument; +import com.sun.star.uno.Any; +import com.sun.star.uno.Type; +import com.sun.star.uno.UnoRuntime; // __________ Implementation __________ @@ -90,7 +92,7 @@ public class ChartHelper XPropertySet xPropSet = UnoRuntime.queryInterface( XPropertySet.class, xTextContent); - Any aAny = new Any(String.class, msChartClassID); + Any aAny = new Any(new Type(String.class), msChartClassID); xPropSet.setPropertyValue("CLSID", aAny ); XTextDocument xTextDoc = UnoRuntime.queryInterface(XTextDocument.class, @@ -106,15 +108,15 @@ public class ChartHelper XShape.class, xTextContent); xShape.setSize( aExtent ); - aAny = new Any(Short.class, + aAny = new Any(new Type(Short.class), new Short(com.sun.star.text.VertOrientation.NONE)); xPropSet.setPropertyValue("VertOrient", aAny ); - aAny = new Any(Short.class, + aAny = new Any(new Type(Short.class), new Short(com.sun.star.text.HoriOrientation.NONE)); xPropSet.setPropertyValue("HoriOrient", aAny ); - aAny = new Any(Integer.class, new Integer(aUpperLeft.Y)); + aAny = new Any(new Type(Integer.class), new Integer(aUpperLeft.Y)); xPropSet.setPropertyValue("VertOrientPosition", aAny ); - aAny = new Any(Integer.class, new Integer(aUpperLeft.X)); + aAny = new Any(new Type(Integer.class), new Integer(aUpperLeft.X)); xPropSet.setPropertyValue("HoriOrientPosition", aAny ); // retrieve the chart document as model of the OLE shape |