From 65a2274dc762869a3992d410e9519a47786af457 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 29 Jul 2008 01:12:59 +0400 Subject: [PATCH] gdiplus: GdipSetStringFormatDigitSubstitution implemented. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/stringformat.c | 13 +++++++++++++ dlls/gdiplus/tests/stringformat.c | 13 +++++++++++++ include/gdiplusflat.h | 1 + 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index b121959055c..e3186a36db8 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -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) diff --git a/dlls/gdiplus/stringformat.c b/dlls/gdiplus/stringformat.c index 1ce6d0eb60c..4bd5bb3b606 100644 --- a/dlls/gdiplus/stringformat.c +++ b/dlls/gdiplus/stringformat.c @@ -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) { diff --git a/dlls/gdiplus/tests/stringformat.c b/dlls/gdiplus/tests/stringformat.c index 833684ef3cb..62372c98a12 100644 --- a/dlls/gdiplus/tests/stringformat.c +++ b/dlls/gdiplus/tests/stringformat.c @@ -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); } diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 723ec1d260c..ea4f200ea1c 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -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( -- 2.11.4.GIT