Skip to content

Commit

Permalink
Use VARIANT primitive accessors in COMLateBindingObject#get*Property
Browse files Browse the repository at this point in the history
Closes #609
  • Loading branch information
matthiasblaesing committed Mar 27, 2016
1 parent 56b1f33 commit 6f802b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down Expand Up @@ -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();
}

/**
Expand All @@ -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();
}

/**
Expand All @@ -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();
}

/**
Expand Down

0 comments on commit 6f802b8

Please sign in to comment.