SF 1477793 obj2variant should accept dates on the Dispatch object
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
<b>Variants</b>
|
||||
<ul>
|
||||
<li>Static constnats are no longer released
|
||||
<li>obj2variant on Dispatch now supports passing a java.util.Date
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -20,6 +21,10 @@
|
||||
<td width="13%">1474474</td>
|
||||
<td width="87%">Static constants in the Variant class can no longer have SafeRelease() called on them.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="13%">1477793</td>
|
||||
<td width="87%">obj2variant should accept java.util.Date the same way the Variant constructor does</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="13%"> </td>
|
||||
<td width="87%"> </td>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
package com.jacob.com;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Object represents MS level dispatch object.
|
||||
@@ -328,6 +329,7 @@ public class Dispatch extends JacobObject
|
||||
|| objectToBeMadeIntoVariant instanceof Double
|
||||
|| objectToBeMadeIntoVariant instanceof Float
|
||||
|| objectToBeMadeIntoVariant instanceof SafeArray
|
||||
|| objectToBeMadeIntoVariant instanceof Date
|
||||
|| objectToBeMadeIntoVariant instanceof Dispatch)
|
||||
return new Variant(objectToBeMadeIntoVariant);
|
||||
|
||||
|
||||
28
unittest/com/jacob/com/DispatchTest.java
Normal file
28
unittest/com/jacob/com/DispatchTest.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.jacob.com;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Test some of the Dispatch utility methods
|
||||
* <code>-Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=true -Dcom.jacob.debug=false</code>
|
||||
* @author joe
|
||||
|
||||
* @author joe
|
||||
*
|
||||
*/
|
||||
public class DispatchTest {
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
Date testDate = new Date();
|
||||
Variant fromDate = Dispatch.obj2variant(testDate);
|
||||
Date returnedDate = fromDate.getJavaDate();
|
||||
System.out.println("test date is "+testDate);
|
||||
System.out.println("VariantDate is "+fromDate.getJavaDate());
|
||||
if (testDate.equals(returnedDate)){
|
||||
|
||||
} else {
|
||||
System.out.println("Could not call obj2variant(Date) and get it to work");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user