From 6f802b8bdd01ba749e25d3d84e0634cc4d2b3736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Mon, 7 Mar 2016 19:41:49 +0100 Subject: [PATCH] Use VARIANT primitive accessors in COMLateBindingObject#get*Property Closes #609 --- CHANGES.md | 1 + .../sun/jna/platform/win32/COM/COMLateBindingObject.java | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2b52c0bf95..fb99bbed37 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -43,6 +43,7 @@ Features * [#608](https://github.com/java-native-access/jna/pull/608): Mavenize the build process - change parent and native pom artifactId/name to differentiate in IDE and build tools. [@bhamail](https://github.com/bhamail) * [#613](https://github.com/java-native-access/jna/pull/613): Make Win32Exception extend LastErrorException [@lgoldstein](https://github.com/lgoldstein). * [#613](https://github.com/java-native-access/jna/pull/614): Added standard 'Kernel32Util#closeHandle' method that throws a Win32Exception if failed to close the handle [@lgoldstein](https://github.com/lgoldstein). +* [#618](https://github.com/java-native-access/jna/pull/618): Implement SAFEARRAY access and bugfix VARIANT - [@matthiasblaesing](https://github.com/matthiasblaesing). * [#616](https://github.com/java-native-access/jna/pull/616): Allow access to base interfaces (most important IDispatch) via ProxyObject and improve binding by allowing to use dispId for the call - [@matthiasblaesing](https://github.com/matthiasblaesing). Bug Fixes diff --git a/contrib/platform/src/com/sun/jna/platform/win32/COM/COMLateBindingObject.java b/contrib/platform/src/com/sun/jna/platform/win32/COM/COMLateBindingObject.java index c54c94d2f2..d837159030 100644 --- a/contrib/platform/src/com/sun/jna/platform/win32/COM/COMLateBindingObject.java +++ b/contrib/platform/src/com/sun/jna/platform/win32/COM/COMLateBindingObject.java @@ -149,7 +149,7 @@ protected boolean getBooleanProperty(String propertyName) { this.oleMethod(OleAuto.DISPATCH_PROPERTYGET, result, this.getIDispatch(), propertyName); - return (((VARIANT_BOOL) result.getValue()).intValue() != 0); + return result.booleanValue(); } /** @@ -179,7 +179,7 @@ protected int getIntProperty(String propertyName) { this.oleMethod(OleAuto.DISPATCH_PROPERTYGET, result, this.getIDispatch(), propertyName); - return ((LONG) result.getValue()).intValue(); + return result.intValue(); } /** @@ -194,7 +194,7 @@ protected short getShortProperty(String propertyName) { this.oleMethod(OleAuto.DISPATCH_PROPERTYGET, result, this.getIDispatch(), propertyName); - return ((SHORT) result.getValue()).shortValue(); + return result.shortValue(); } /** @@ -209,7 +209,7 @@ protected String getStringProperty(String propertyName) { this.oleMethod(OleAuto.DISPATCH_PROPERTYGET, result, this.getIDispatch(), propertyName); - return result.getValue().toString(); + return result.stringValue(); } /**