Commit 341f32a3 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus: Implemented GdipStringFormatGetGenericDefault with tests.

parent e3a0a180
......@@ -67,12 +67,19 @@ GpStatus WINGDIPAPI GdipDeleteStringFormat(GpStringFormat *format)
GpStatus WINGDIPAPI GdipStringFormatGetGenericDefault(GpStringFormat **format)
{
GpStatus stat;
if (!format)
return InvalidParameter;
FIXME("stub: %p\n", format);
stat = GdipCreateStringFormat(0, LANG_NEUTRAL, format);
if(stat != Ok)
return stat;
return NotImplemented;
(*format)->align = StringAlignmentNear;
(*format)->vertalign = StringAlignmentNear;
return Ok;
}
GpStatus WINGDIPAPI GdipGetStringFormatAlign(GpStringFormat *format,
......
......@@ -277,6 +277,47 @@ static void test_tabstops(void)
expect(Ok, stat);
}
static void test_getgenericdefault(void)
{
GpStringFormat *format;
GpStatus stat;
INT flags;
INT n;
StringAlignment align, valign;
StringTrimming trimming;
StringDigitSubstitute digitsub;
LANGID digitlang;
INT tabcount;
/* NULL arg */
stat = GdipStringFormatGetGenericDefault(NULL);
expect(InvalidParameter, stat);
stat = GdipStringFormatGetGenericDefault(&format);
expect(Ok, stat);
GdipGetStringFormatFlags(format, &flags);
GdipGetStringFormatAlign(format, &align);
GdipGetStringFormatLineAlign(format, &valign);
GdipGetStringFormatHotkeyPrefix(format, &n);
GdipGetStringFormatTrimming(format, &trimming);
GdipGetStringFormatDigitSubstitution(format, &digitlang, &digitsub);
GdipGetStringFormatTabStopCount(format, &tabcount);
expect(0, flags);
expect(HotkeyPrefixNone, n);
expect(StringAlignmentNear, align);
expect(StringAlignmentNear, align);
expect(StringTrimmingCharacter, trimming);
expect(StringDigitSubstituteUser, digitsub);
expect(LANG_NEUTRAL, digitlang);
expect(0, tabcount);
stat = GdipDeleteStringFormat(format);
expect(Ok, stat);
}
START_TEST(stringformat)
{
struct GdiplusStartupInput gdiplusStartupInput;
......@@ -294,6 +335,7 @@ START_TEST(stringformat)
test_digitsubstitution();
test_getgenerictypographic();
test_tabstops();
test_getgenericdefault();
GdiplusShutdown(gdiplusToken);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment