gdiplus: GdipSetStringFormatDigitSubstitution implemented.

This commit is contained in:
Nikolay Sivov 2008-07-29 01:12:59 +04:00 committed by Alexandre Julliard
parent 9ed8a2b624
commit 65a2274dc7
4 changed files with 28 additions and 1 deletions

View File

@ -586,7 +586,7 @@
@ stdcall GdipSetSmoothingMode(ptr long)
@ stdcall GdipSetSolidFillColor(ptr ptr)
@ stdcall GdipSetStringFormatAlign(ptr long)
@ stub GdipSetStringFormatDigitSubstitution
@ stdcall GdipSetStringFormatDigitSubstitution(ptr long long)
@ stdcall GdipSetStringFormatFlags(ptr long)
@ stdcall GdipSetStringFormatHotkeyPrefix(ptr long)
@ stdcall GdipSetStringFormatLineAlign(ptr long)

View File

@ -159,6 +159,19 @@ GpStatus WINGDIPAPI GdipSetStringFormatAlign(GpStringFormat *format,
return Ok;
}
/*FIXME: digit substitution actually not implemented, get/set only */
GpStatus WINGDIPAPI GdipSetStringFormatDigitSubstitution(GpStringFormat *format,
LANGID language, StringDigitSubstitute substitute)
{
if(!format)
return InvalidParameter;
format->digitlang = language;
format->digitsub = substitute;
return Ok;
}
GpStatus WINGDIPAPI GdipSetStringFormatHotkeyPrefix(GpStringFormat *format,
INT hkpx)
{

View File

@ -96,6 +96,8 @@ static void test_digitsubstitution(void)
expect(InvalidParameter, stat);
stat = GdipGetStringFormatDigitSubstitution(NULL, &digitlang, &digitsub);
expect(InvalidParameter, stat);
stat = GdipSetStringFormatDigitSubstitution(NULL, LANG_NEUTRAL, StringDigitSubstituteNone);
expect(InvalidParameter, stat);
/* try to get both and one by one */
stat = GdipGetStringFormatDigitSubstitution(format, &digitlang, &digitsub);
@ -113,6 +115,17 @@ static void test_digitsubstitution(void)
expect(Ok, stat);
expect(LANG_NEUTRAL, digitlang);
/* set/get */
stat = GdipSetStringFormatDigitSubstitution(format, MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL),
StringDigitSubstituteUser);
expect(Ok, stat);
digitsub = StringDigitSubstituteNone;
digitlang = LANG_RUSSIAN;
stat = GdipGetStringFormatDigitSubstitution(format, &digitlang, &digitsub);
expect(Ok, stat);
expect(StringDigitSubstituteUser, digitsub);
expect(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL), digitlang);
stat = GdipDeleteStringFormat(format);
expect(Ok, stat);
}

View File

@ -445,6 +445,7 @@ GpStatus WINGDIPAPI GdipGetStringFormatMeasurableCharacterRangeCount(
GDIPCONST GpStringFormat*, INT*);
GpStatus WINGDIPAPI GdipGetStringFormatTrimming(GpStringFormat*,StringTrimming*);
GpStatus WINGDIPAPI GdipSetStringFormatAlign(GpStringFormat*,StringAlignment);
GpStatus WINGDIPAPI GdipSetStringFormatDigitSubstitution(GpStringFormat*,LANGID,StringDigitSubstitute);
GpStatus WINGDIPAPI GdipSetStringFormatHotkeyPrefix(GpStringFormat*,INT);
GpStatus WINGDIPAPI GdipSetStringFormatLineAlign(GpStringFormat*,StringAlignment);
GpStatus WINGDIPAPI GdipSetStringFormatMeasurableCharacterRanges(