SF 3435567

Possibility to pass a NULL Dispatch pointer
Fix a memory leak (detected with Glowcode) in Variant.cpp/zeroVariant function
Variant.toString improvement to handle NULL cases
Adds the error code to the message when "an unknown COM error has occurred"
Added debug info to EventProxy advise registration failure message.
This commit is contained in:
clay_shooter
2011-12-11 16:57:28 +00:00
parent e5652e3b75
commit 1e69bb9acb
6 changed files with 61 additions and 5 deletions

View File

@@ -795,13 +795,17 @@ public class Variant extends JacobObject {
/**
*
* @return string contents of the variant.
* @return string contents of the variant, null if is of type null or empty
* @throws IllegalStateException
* if this variant is not of type String
*/
public String getString() {
if (getvt() == Variant.VariantString) {
return getVariantString();
} else if (getvt() == Variant.VariantEmpty) {
return null;
} else if (getvt() == Variant.VariantNull) {
return null;
} else {
throw new IllegalStateException(
"getString() only legal on Variants of type VariantString, not "