Commit Graph

262 Commits

Author SHA1 Message Date
David Kahurani a4ba88c0ff oleaut32: Do not skip the first decimal digit in VarParseNumFromStr().
Add more tests to probe what happens if the integral part is omitted.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52476
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-07 20:53:12 +01:00
Nikolay Sivov c0a131f9d9 oleaut32: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-14 11:04:19 +01:00
Nikolay Sivov 2651677d49 oleaut32: Do not use static variable for disp params.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 21:24:37 +02:00
Nikolay Sivov e4451427d8 oleaut32: Fix uninitialized variable access in VarXor() for earlier failure paths (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 21:24:29 +02:00
Nikolay Sivov b560dbaebc oleaut32: Fully initialize VARIANT structure in VariantInit().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-24 17:41:49 +02:00
Francois Gouget d07d4ef799 oleaut32: Allow longer regional settings values.
Only the first character matters but the extra ones should not prevent
it from being used.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Francois Gouget 2e302e8d8c oleaut32: Fix handling of hexadecimal/octal numbers in VarParseNumFromStr().
They are incompatible with decimal numbers and currencies.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Francois Gouget caf5ab5d65 oleaut32: Fix VarParseNumFromStr()'s handling of currency decimals.
They have no default, flag the value as a monetary amount, are
unaffected by the presence / absence of a currency symbol, and are
incompatible with hexadecimal / octal numbers.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 23:08:05 +02:00
Francois Gouget fc5e603cd3 oleaut32: Add support for longer currency symbols.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 23:08:02 +02:00
Francois Gouget 9e4524ffb0 oleaut32: Fix VarParseNumFromStr()'s handling of currency thousands separators.
They are have no default, are not allowed before the first digit, are
unaffected by the presence / absence of a currency symbol, can be mixed
with regular digit separators, are incompatible with hexadecimal and
octal numbers (as are regular digit separators), and mask trailing
spaces.
Also they don't match regular spaces when set to a non-breaking space.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-06 19:56:32 +02:00
Francois Gouget bf2e66cc3f oleaut32: The decimal point takes priority over the thousands separator.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-06 19:56:27 +02:00
Francois Gouget d8656b4767 oleaut32: Remove caching from VARIANT_GetLocalisedNumberChars().
GetLocaleInfoW() already caches the registry information and is fast
enough. This also avoids using out-of-date information after a
SetLocaleInfoW() call.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-05 20:43:28 +02:00
Francois Gouget c2aeb915f4 oleaut32: Fix VarParseNumFromStr()'s support for trailing thousands separator spaces.
If a trailing character is a thousands separator, VarParseNumFromStr()
only processes it if NUMPRS_THOUSANDS was specified; even if that
character is also a space and NUMPRS_TRAILING_WHITE was specified.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:15:12 +02:00
Francois Gouget de70f7289e oleaut32: VarParseNumFromStr() does not allow leading thousands separators.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:15:01 +02:00
Francois Gouget c50dff867d oleaut32: Setting sThousand to a non-breaking space also matches regular spaces.
As the test_VarParseNumFromStrMisc() tests show the converse is not
true.
Note also that the " 1 000" test was failing as expected because in
the French locale Wine was not recognizing regular spaces as thousands
separators. Now it does and Wine incorrectly allows them before the
first digit, just like it does for the English tests.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51450
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:14:59 +02:00
Francois Gouget e02a7e579c oleaut32: VarParseNumFromStr() accepts trailing currency symbols.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51450
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-20 18:47:27 +02:00
Francois Gouget 4e34e7513d oleaut32: Fix VarParseNumFromStr()'s support for two-character currencies.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51452
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-20 18:47:22 +02:00
Francois Gouget 7dc02dcd07 oleaut32: Update the SystemTimeToVariantTime() Y2K cutoff.
Old Windows versions used 29 as the Y2K cutoff, that is is they mapped
two digit years 00-29 to 2000-2029 and years 30-99 to 1930-1999.
But starting with Windows 10 1903 the cutoff is now 49 by default.
So update Wine to match the current Windows versions and adjust the
tests to work for both.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51453
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-20 13:19:49 +02:00
Francois Gouget 1e627d1187 oleaut32: Fix the Var*FromStr() prototypes.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:27:56 +02:00
Francois Gouget 6763ed84cf oleaut32: Fix a trace containing a null character.
printf("%c Hello\n", 0) works but not TRACE("%c Hello\n", 0) because the
string is formatted before printing.
Work around the issue with wine_dbgstr_w().

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-07 21:07:45 +02:00
Nikolay Sivov 25ec9d4c34 oleaut32: Fix VariantChangeType()/VariantChangeTypeEx() prototypes.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-01 10:13:04 +01:00
Nikolay Sivov a55f4f9fc4 oleaut32: Fix VariantCopy()/VariantCopyInd() prototypes.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-01 10:13:02 +01:00
Jacek Caban db77f53507 oleaut32: Fix checks for digit characters.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-12 23:04:35 +01:00
Alexandre Julliard aa4ac3ad6c oleaut32: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-17 09:41:13 +02:00
Alistair Leslie-Hughes 4a6f002d9a oleaut32: Add missing return value checks (Coverity).
CID 1442938:  Error handling issues  (CHECKED_RETURN)

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-04 22:02:05 +01:00
Alistair Leslie-Hughes 0c738d900a oleaut32: Support VT_DECIMAL in VarRound.
Based on a patch by Carlos Chiriboga Calderon.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26653
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-19 22:04:50 +01:00
Alex Henrie 1e8c62b020 oleaut32: Add DECLSPEC_HOTPATCH to functions patched by MS Word 2010.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45199
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-18 20:59:38 +02:00
Michael Stefaniuc a1e0a029b0 oleaut32: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-29 22:01:39 +02:00
Alexandre Julliard 756f781786 oleaut32: Fix check for DECIMAL variant in VarNumFromParseNum.
Reported by Gerald Pfeifer.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-08 16:45:56 +01:00
Piotr Caban 409bafcc73 oleaut32: Ignore underflows in VarR8FromStr.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-07 21:24:45 +01:00
Jacek Caban 840ab7cd1c oleaut32: Simplify VarCat implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-06-15 21:54:39 +02:00
Alistair Leslie-Hughes 538e46adea oleaut32: Improve support for IDispatch in VarCat.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-06-14 21:22:50 +02:00
Alistair Leslie-Hughes 1762f89ff2 oleaut32: Use VariantChangeTypeEx to convert to VT_BOOL.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-22 13:45:11 +02:00
Alistair Leslie-Hughes c260de0faa oleaut32: Remove dead code.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-18 16:17:28 +02:00
Nikolay Sivov 806ea12766 oleaut32: Fix return value when converting from NULL interface pointers.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-02 09:13:56 -05:00
Sebastian Lackner f2e48c2536 oleaut32: Set DebugInfo for static CRITICAL_SECTION structure.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-29 20:05:01 +09:00
Michael Stefaniuc 45839dccee oleaut32: Remove an always true if-subcondition (PVS-Studio).
Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-29 21:20:08 +09:00
Nikolay Sivov 7bb743cca6 oleaut32: Remove dead switch case VT_I1 entry for VarSub (Coverity). 2015-06-08 15:31:02 +09:00
Michael Stefaniuc 512a814efc oleaut32: Just stop instead of erroring out on 8 or 9 in octal numbers. 2015-01-20 11:11:13 +01:00
André Hentschel 099514e753 oleaut32: Remove unused code (Clang). 2014-12-02 10:31:33 +01:00
Piotr Caban fc6ec997e2 oleaut32: Add support for VAR_TIMEVALUEONLY and VAR_DATEVALUEONLY flags in VarDateFromUdateEx. 2014-08-19 14:49:44 +02:00
Nikolay Sivov 6d3ca3dde4 oleaut32: Remove duplicated expression (PVS-Studio). 2014-08-18 12:45:57 +02:00
Jacek Caban d2886a05f9 wine/debug.h: Added debugstr_variant and debugstr_vt aliases and removed all duplicated implementations. 2014-07-24 17:05:55 +02:00
Jacek Caban e18ef3cf4c wine/debug.h: Added wine_dbgstr_variant and wine_dbgstr_vt implementations. 2014-07-24 17:05:51 +02:00
Marcus Meissner d3d54dfd3c oleaut32: Avoid buffer overread (Coverity). 2014-06-17 09:06:19 +02:00
Jacek Caban 18a42e0211 oleaut32: Use debugstr_variant for dump_Variant implementation. 2014-05-24 11:02:30 +09:00
Jacek Caban 5614770c24 oleaut32: Rewrite debugstr_vt. 2014-05-24 11:02:20 +09:00
Jacek Caban 9677454f7d oleaut32: Use debugstr_variant in variant.c where appropriate. 2014-05-15 19:04:54 +02:00
Jacek Caban ed41fc1d9b oleaut32: Added debugstr_variant helper for better debug traces. 2014-05-14 17:35:24 +02:00
Piotr Caban d1469144e9 oleaut32: Handle VariantCopy errors in VariantChangeTypeEx. 2014-05-01 16:32:14 +02:00