Commit Graph

175 Commits

Author SHA1 Message Date
Michael Stefaniuc 8ecefe9e93 Handle VT_DECIMAL in VarCmp(). 2005-10-28 10:08:31 +00:00
Michael Stefaniuc c64abfa374 Handle VT_CY in VarDiv(). 2005-10-26 12:05:39 +00:00
Alex Villacís Lasso 253f3bf5be Modify VarDiv() and VarSub() to use the existing VarDecSub() and
VarDecDiv() for DECIMAL.
2005-09-22 10:35:16 +00:00
Michael Stefaniuc 4d36546c07 - VarAdd, VarMul: I4 overflows to R8 and not I8 even if the result
would fit in I8. Fix tests.
- Document a brokeness in the handling of I8 numbers in
  VarNumFromParseNum. Fix tests.
2005-08-23 09:33:37 +00:00
Robert Shearman 27407fad35 Document active object and variant functions. 2005-07-05 11:02:19 +00:00
Robert Shearman cbc3af8ca5 - Conversions between variants types of the same size should ignore
overflows.
- Tests for this behaviour.
2005-06-29 20:15:32 +00:00
Michael Stefaniuc 8e81d45732 - VarCmp: handle comparision of VT_EMPTY with an integer
- small comment fix
2005-06-28 10:54:07 +00:00
Francois Gouget 6394a15314 Assorted spelling fixes. 2005-06-17 20:59:49 +00:00
Michael Stefaniuc 948dd66603 - Reimplement VarAdd, had missing functionality and wrong behaviour.
- Fix a typo in VarMul.
2005-05-29 20:00:31 +00:00
Michael Stefaniuc 0f64aaa807 Reimplement VarMul(). It can multiply now all variants that the native
(WinXP) function supports too.
2005-05-23 11:46:17 +00:00
Richard Cohen 97bc8f6dc7 - Remove unused macro.
- Check for VT_I8 before testing it.
- VarMod returns DISP_E_OVERFLOW not E_INVALIDARG.
2005-05-23 10:26:32 +00:00
Michael Stefaniuc 28faa92c7f Fix VariantChangeType: calls to VarDecFromCy and VarDecFromDisp had
source and destination swapped.
2005-05-23 09:50:50 +00:00
Daniel Remenak 4d7e99df93 Implemented VarIdiv. 2005-04-13 10:59:25 +00:00
Daniel Remenak 292b61f550 Return DISP_E_DIVBYZERO instead of crashing when asked to divide a
variant by zero.
2005-04-12 10:15:56 +00:00
Jon Griffiths 743fb99a9f Use variant macros instead of accessing the union directly. 2005-02-22 14:54:01 +00:00
Alex Villacís Lasso d0bdb3888b Initialize temporary variants before calling VariantChangeTypeEx. 2005-01-25 18:57:43 +00:00
Alex Villacís Lasso ed9a359402 When parsing an hex/oct integer value, copy value verbatim in VARIANT,
rather than a negated value. Add test case for this behavior.
2005-01-17 19:34:58 +00:00
Eric Pouech cf1d00bb08 Removed excessive statement (break after return or goto, not useful
break, not needed vars...)
2005-01-09 16:42:53 +00:00
Francois Gouget 6fb1a20020 Assorted spelling fixes. 2004-12-20 19:27:06 +00:00
Robert Shearman cd0970eb24 Make the DECIMAL_SETZERO macro take a DECIMAL instead of a DECIMAL* as
in the Microsoft headers and fix up the only caller.
2004-12-08 13:59:52 +00:00
Walt Ogburn f61786d444 VarParseNumFromStr: Keep zeros after decimal point, correctly keep
track of trailing zeros in a decimal number.
VarNumFromParseNum: Don't error on decimal expressions for zero.
2004-10-21 19:55:37 +00:00
Walt Ogburn 84c1f667ae Keep "trailing" zeros on whole number part of a decimal.
Add an example of this to tests.
2004-10-19 21:08:40 +00:00
Walt Ogburn d5cf83317e Allow exponents of zero (like "1.000E0") to parse
correctly. Previously, they caused DISP_E_TYPEMISMATCH.
2004-10-11 20:53:29 +00:00
Huw Davies 76c5590bfb Don't trash the dst variant if we can't do the type conversion.
Add a test for this.
2004-09-22 19:12:18 +00:00
Jacek Caban 3a2574e3cc Fix handling of VARIANT with VT_BYREF and null pointer in
VariantChangeTypeEx.
2004-08-25 00:38:59 +00:00
Alexandre Julliard 25e2a320a7 Don't define BEGIN_INTERFACE in unknwn.h. 2004-08-22 21:38:46 +00:00
Francois Gouget bf72af30d0 Modify widl to put the C COM macros inside an #ifdef COBJMACROS block
as is done in the Windows headers.
Add #define COBJMACROS where needed in Wine.
Fixes the compilation of the oleaut32/tests/olefont.c and
urlmon/tests/url.c conformance tests with the Windows headers.
2004-08-11 19:43:45 +00:00
Mike Hearn f349cbb72b Move variant code to its own debug channel. 2004-07-04 00:09:11 +00:00
Jon Griffiths 89450e7cbd Implement VarDateFromUdateEx. 2004-04-30 18:32:58 +00:00
Jon Griffiths befb3a9980 Implement VarOr.
Fixes for untested VarXor,VarAbs,VarNot input types.
2004-04-27 23:29:37 +00:00
Jon Griffiths 9b609135e1 Conversion from VT_UINT to VT_I4 ignores overflow. 2004-04-23 21:29:49 +00:00
Francois Gouget 0217bfdfed Assorted spelling fixes. 2004-04-12 22:08:23 +00:00
Jon Griffiths 743b75ab44 Implement VarXor and simplify VarEqv to use it. 2004-03-22 20:39:27 +00:00
Jon Griffiths 071e950344 Implement VarEqv. 2004-03-17 20:49:22 +00:00
Fabian Cenedese 5feedfdc73 Let VarParseNumFromStr and VarNumFromParseNum cope with hex and oct
strings. Needed from VB conversions such as CLng, CInt, CByte...
2004-03-16 19:15:04 +00:00
Patrik Stridvall 8f9b09e947 Fixed some issues found by winapi_check. 2004-02-27 21:32:54 +00:00
Fabian Cenedese 3d7034e79e VarRound implementation (without type DECIMAL yet) with test function. 2004-02-26 05:27:11 +00:00
Alexandre Julliard b65d13605c Fixed callers of GetLocaleInfoW to use the correct buffer size. 2004-02-25 01:35:01 +00:00
Fabian Cenedese 393ae7d204 Accept VT_BOOL mixed with another type as valid combination in
VarOr/VarAnd.
2004-02-17 20:25:41 +00:00
Chris Morgan 2d1bccd0c4 Implement VarMod().
Add a few trace outputs.
Fix VarNot() with VT_CY.
Fix VarParseNumFromStr() to work correctly with NUMPRS_HEX_OCT flag.
2004-02-06 05:23:29 +00:00
Jon Griffiths f4e7227541 Implemented VarInt, VarFix, VarNeg. 2004-01-13 23:16:04 +00:00
Marcus Meissner 2ac287e875 Copy BSTRs byte wise.
Added a testcase for byte wise copy of VT_BSTR variant with
VariantCopy().
2004-01-09 00:58:01 +00:00
Francois Gouget 640cc3f3e1 Assorted spelling fixes. 2004-01-06 22:08:33 +00:00
Jon Griffiths d95ee19dfd Use the SafeArray conversion functions when coercing arrays.
Simplify VariantChangeTypeEx.
Replace calls to dump_Variant() with TRACE's.
2003-12-15 21:10:53 +00:00
Marcus Meissner cf50f9a04e Implemented VarInt, VarPow.
Added R4 (float) support to VarAdd.
Added DATE support to VarSub.
2003-12-15 20:14:32 +00:00
Jon Griffiths 97fc6c3a06 Oops - VT_EMPTY->VT_RECORD is not allowed. 2003-12-11 05:25:59 +00:00
Jon Griffiths 7e40baadc1 Reimplement/document every low level variant function.
Implement DECIMAL, I8, UI8 types and other missing conversions.
VariantChangeType: Use LOCALE_USER_DEFAULT as per MSDN.
VariantChangeTypeEx: Support new types, pass proper flags.
VarNumFromParseNum: Support VT_DECIMAL as output.
2003-12-11 04:28:20 +00:00
Jon Griffiths 7e7ca4ac95 Implement conversions between dates and strings.
Remove the final cruft associated with the old date code
BPB's: Roll milliseconds correctly; LOCALE_NOUSEROVERRIDE for num
parsing.
Implement VarAbs and VarNot.
2003-12-09 00:05:31 +00:00
Jon Griffiths d537c955bc Implemented the variant formatting functions.
Bool->bstr makes a number str unless [ALPHA|LOCAL]BOOL is passed.
2003-11-25 01:49:31 +00:00
Jon Griffiths 136fa03fbf Implement the non-variant date conversions correctly, without going
through 'struct tm' first. Handle negative & 'rolling' dates too.
2003-11-14 21:01:36 +00:00
Gerald Pfeifer 5cc4b3ba16 Removed dead code in VarDateFromUI2(). 2003-11-09 01:21:04 +00:00
Francois Gouget f405629e8e Weekly spelling fixes. 2003-10-28 21:45:30 +00:00
Daniel Marmier 0348649853 Fixed warnings with gcc option "-Wwrite-strings". 2003-10-06 21:03:32 +00:00
Jon Griffiths 166e96d11f Add VarParseNumFromStr()/VarNumFromParseNum(), use them for
conversions.
VariantInit(): Only touch V_VT field.
VariantClear(): Support IRecordInfo, don't free null bstrs.
Add support for upcoming vtypes, remove dead code, docs.
2003-10-03 03:36:46 +00:00
ccfca3cbc4 Use SysAllocStringByteLen/SysStringByteLen to copy BSTR variants. 2003-09-16 01:03:34 +00:00
Mike McCormack 8d61c96d64 Create a propper stub for oleaut32.VarMod. 2003-09-08 18:37:22 +00:00
Alexandre Julliard e37c6e18d0 Fixed header dependencies to be fully compatible with the Windows
headers (with help from Dimitrie O. Paun).
2003-09-05 23:08:26 +00:00
Jon Griffiths 58422dc83c Add a bunch of missing stuff.
Use proper types for SafeArray/variant prototypes.
Change I1 functions to take signed chars
2003-07-18 22:52:58 +00:00
Francois Gouget 56aaea2f43 Spelling fixes. 2003-07-09 02:52:57 +00:00
Marcus Meissner 1ae1797505 VarAdd: Added VT_R8, VT_EMPTY, VT_NULL handling. 2003-06-24 19:36:58 +00:00
Marcus Meissner 615615b0c9 OleCreateFontIndirect(NULL,...) uses the OLE StdFont.
Added testcase for OleCreateFontIndirect(NULL).
Added VT_NULL -> VT_BOOL variant converter.
2003-06-24 19:21:20 +00:00
Francois Gouget c5f775a9c7 Typos/spelling fixes. 2003-06-18 03:30:39 +00:00
Stefan Leichter a42b0d1368 Partial implementaion of VarBstrFromDec. 2003-05-17 18:30:03 +00:00
Stefan Leichter 053b839179 Fixed DECIMAL_SETZERO
Removed a workaround for the former problem.
2003-05-16 20:13:50 +00:00
Stefan Leichter 9daabbc8d1 Added stub for VarBstrFromDec. 2003-05-15 22:58:48 +00:00
Stefan Leichter 39aab38006 Partial implementation of VarDecFromStr. 2003-05-15 04:15:25 +00:00
Adam Gundy 962b81d607 Handle coercing VT_DISPATCH into VT_PTR. 2003-03-06 22:42:28 +00:00
Marcus Meissner 7ba0c5f3aa VarAdd: set 'rc' correctly from BSTR addition. 2003-03-04 02:14:32 +00:00
Marcus Meissner b3be773afe Added R4 and R8 comparison to VarCmp.
Added I2 to VarFormat.
Added VarSub, VarDiv, VarMul for integer and float types.
2003-01-28 00:23:19 +00:00
Matthew Davison 60009b9a56 Removed calls to HEAP_strdupAtoW. 2003-01-23 23:07:38 +00:00
Francois Gouget 18e6bb81e3 Fix the case of floats in VarBstrFromR4, VarBstrFromR8 and
VarBstrFromCy.
We cannot check for equality of floats or doubles because of rounding
errors. Check equality to 14 digits for doubles.
Add more precision to the expected results so that they match actual
results.
Print floating values with more precision so we know what went wrong.
Specify the locale for all variant functions that depend on it.
Added return codes for Win95. Win95 returns dates with only two digits
for the year.
Uncommented more VariantCopyInd and VariantChangeTypeEx tests.
2003-01-13 18:30:18 +00:00
Marcus Meissner fe483aae1d Coerce VT_UNKNOWN <-> VT_DISPATCH, NULL is valid in these cases.
Drop VT_x -> VT_x coercions, they are handled before the switch()
already.
2003-01-11 20:58:58 +00:00
Dimitrie O. Paun 297f3d898d Define NONAMELESS{STRUCT,UNION} explicitly in the files that need them. 2003-01-07 20:36:20 +00:00
Ove Kaaven 40b94e5347 Avoid direct ICOM_CALL usage. 2003-01-05 01:06:04 +00:00
Marcus Meissner 48e583db52 Handle VT_ERROR->VT_I4/VT_R4 coercion.
VariantCopy does not need to check the return of VariantClear.
VariantCopyInd now copies VT_UNKNOWN and VT_DISPATCH too.
VarCmp handles VT_BOOL.
VarFormat handles VT_BSTR.
coerce_array fixed for VT_ARRAY|VT_UI1 -> VT_BSTR and VT_ARRAY|x ->
VT_SAFEARRAY cases.
VarCat tries to coerce types into VT_BSTR to do cat.
2003-01-02 23:11:56 +00:00
Marcus Meissner ef2f1b6ec5 VariantChangeTypeEx for VT_ARRAY | type style variants. 2002-12-23 02:03:10 +00:00
Andreas Mohr dc85dc0a1b Implemented VarOr(). 2002-12-16 22:08:48 +00:00
Jason Edmeades d197d40295 VarAdd support for integers. 2002-12-10 19:06:28 +00:00
Ove Kaaven 729dd8bf28 Added more types to wtypes.idl. 2002-12-03 21:42:17 +00:00
Jason Edmeades 0ba86d81fe Add support for VarAnd between integers. 2002-11-25 02:42:33 +00:00
Patrik Stridvall a3868218d0 Fixed some issues found by winapi_check. 2002-07-19 00:30:16 +00:00
Jason Edmeades 86d5a32de4 - VarFormat now supports VT_R8 and BYREF variant types.
- Add VarCyMulI4 support.
2002-07-08 19:36:24 +00:00
Jason Edmeades daec720709 Ensure VarBstrCat handles null parms as per windows and actually does
the concatenation even for null args.
2002-07-05 01:22:03 +00:00
Vincent Béron e35580f4c9 Fixed some various comparisons wrt signedness. 2002-06-21 22:25:17 +00:00
John K. Hohm 2b78ac039f Implemented SizeOfVariantData cases for VT_DISPATCH, VT_UNKNOWN, VT_CY. 2002-06-21 20:13:18 +00:00
Mike McCormack b7937afab9 Fixed ordinals to match the Windows values.
Added a couple of stubs.
2002-06-20 23:51:21 +00:00
Jason Edmeades 5b6a9ff537 - VarAnd, VarCmp (Strings only), VarNot implemented.
- VarParseNumFromStr/VarNumFromParseNum handle negative currency
  numbers.
- More VarCmp support (Decimals and Dates).
- Date support for VB time only (0.0->1.0), corrected some date
  rounding and calculation errors around variant dates and the system
  time.
- Variant date support now round trips! (Date->Variant->Date) due to
  misuse of tm_mon (0..11 not 1..12).
- Better pre-1899 support for dates in the SYSTEMTIME format.
- VarBstrFromCy, VarCyFromStr implemented.
- VarFormat partial implementation (currency and date support).
- VarFormatFromTokens, VarTokenizeFormatString partial implementation
  as per w2k (dates only so far).
- Better debugging when dumping variants, and some additional trace
 points to help debugging.
- Fix to VarBstrCmp to handle null and empty string the same (as per
  w2k, different to msdn).
- Fix return from VarDateFromUdate.
- Correct definition of CY structure.
2002-06-20 23:07:55 +00:00
Vincent Béron 9a62491660 Removed trailing whitespace. 2002-05-31 23:06:46 +00:00
Vincent Béron 6a5ba8fba2 Fixed some more missing \n in traces. 2002-05-29 19:09:54 +00:00
Marcus Meissner e8d977011b Ported variant tests to the new testing framework. 2002-03-26 01:54:25 +00:00
Alexandre Julliard 0799c1a780 Added LGPL standard comment, and copyright notices where necessary.
Global replacement of debugtools.h by wine/debug.h.
2002-03-09 23:29:33 +00:00
Patrick Haller 0e3c9d454b Fix crash in VariantTimeToDosDateTime. 2002-02-19 18:23:09 +00:00
Marcus Meissner 0749fc2034 Implemented Local Server COM.
Implemented the Typelib based Marshaler.
2002-02-05 18:11:17 +00:00
Marcus Meissner a79dcc46eb VT_EMPTY can be coerced to VT_I4, value 0. 2002-02-04 18:31:53 +00:00
Bill Medland a51ff76b86 A couple of additions. 2002-01-29 02:44:44 +00:00
Ove Kaaven a0da66945f Fixed a looks-like-nobody-ever-tested-this-function kind of bug in
VariantCopyInd.
2002-01-02 21:44:30 +00:00
Francois Gouget 070e749cfb Don't prefix %p with 0x.
Various English fixes.
2001-11-06 21:01:32 +00:00
Ove Kaaven 54c8fee942 Implement coercion to VT_UNKNOWN from VT_DISPATCH. 2001-10-04 16:14:24 +00:00
Andreas Mohr 2718c895d1 Make OaBuildVersion() return the highest version value possible.
Some cleanups.
2001-10-02 18:28:31 +00:00
Ove Kaaven 9f6d5a068b Variants and safe arrays is now able to copy BSTR swith embedded null
characters. Safe arrays now handle BSTRs and variants.
2001-09-21 21:01:31 +00:00