summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-10-30 05:35:42 +0100
committerMichael Stahl <mstahl@redhat.com>2013-11-03 04:21:22 -0600
commit148770af39a82f52a5d267e40941684791df4c66 (patch)
treea4ae4120de90f3e0317337a99670eea0c4966443
parentb33856e0a4104d716293cd05ea1915ca216fe33c (diff)
fdo#70674 adapt wizard code to incompatible Date/Time API change
Change-Id: I0338777bf46c10f6082c7eb3886883e92952eb99 Reviewed-on: https://gerrit.libreoffice.org/6482 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--wizards/com/sun/star/wizards/document/Control.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/wizards/com/sun/star/wizards/document/Control.java b/wizards/com/sun/star/wizards/document/Control.java
index cf5c9c0faf24..e8b78f1d32fb 100644
--- a/wizards/com/sun/star/wizards/document/Control.java
+++ b/wizards/com/sun/star/wizards/document/Control.java
@@ -34,6 +34,8 @@ import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.AnyConverter;
import com.sun.star.drawing.XShapes;
import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.util.Date;
+import com.sun.star.util.Time;
public class Control extends Shape
{
@@ -304,13 +306,22 @@ public class Control extends Shape
}
else if (getControlType() == FormHandler.SODATECONTROL)
{
- xPropertySet.setPropertyValue("Date", 4711); //TODO find a better date
+ Date d = new Date();
+ d.Day = 30;
+ d.Month = 12;
+ d.Year = 9999;
+ xPropertySet.setPropertyValue("Date", d);
aPreferredSize = getPeer().getPreferredSize();
xPropertySet.setPropertyValue("Date", com.sun.star.uno.Any.VOID);
}
else if (getControlType() == FormHandler.SOTIMECONTROL)
{
- xPropertySet.setPropertyValue("Time", 47114); //TODO find a better time
+ Time t = new Time();
+ t.NanoSeconds = 999999999;
+ t.Seconds = 59;
+ t.Minutes = 59;
+ t.Hours = 22;
+ xPropertySet.setPropertyValue("Time", t);
aPreferredSize = getPeer().getPreferredSize();
xPropertySet.setPropertyValue("Time", com.sun.star.uno.Any.VOID);
}