oleaut32: use scale in DECtoBSTR conversions
Aric Stewart
aric at codeweavers.com
Fri Aug 19 09:38:29 CDT 2005
fix the fixme dealing with scale in DecToBstr conversions.
-------------- next part --------------
Index: dlls/oleaut32/vartype.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/vartype.c,v
retrieving revision 1.15
diff -u -r1.15 vartype.c
--- dlls/oleaut32/vartype.c 9 Aug 2005 10:34:21 -0000 1.15
+++ dlls/oleaut32/vartype.c 19 Aug 2005 14:38:01 -0000
@@ -5766,9 +5766,10 @@
if (!pbstrOut)
return E_INVALIDARG;
- if (!DEC_SCALE(pDecIn) && !DEC_HI32(pDecIn))
+ if (!DEC_HI32(pDecIn))
{
WCHAR szBuff[256], *szOut = szBuff + sizeof(szBuff)/sizeof(WCHAR) - 1;
+ INT scale = DEC_SCALE(pDecIn);
/* Create the basic number string */
*szOut-- = '\0';
@@ -5776,6 +5777,20 @@
if (DEC_SIGN(pDecIn))
dwFlags |= VAR_NEGATIVE;
+ /* modify for scale */
+ if (scale)
+ {
+ WCHAR* ptr;
+ ptr = &szOut[strlenW(szOut)+1];
+ while (ptr != &szOut[scale])
+ {
+ *(ptr+1) = *ptr;
+ ptr --;
+ }
+ *(ptr+1) = *ptr;
+ *ptr = '.';
+ }
+
*pbstrOut = VARIANT_MakeBstr(lcid, dwFlags, szOut);
TRACE("returning %s\n", debugstr_w(*pbstrOut));
return *pbstrOut ? S_OK : E_OUTOFMEMORY;
More information about the wine-patches
mailing list