Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9f63f7d9
Commit
9f63f7d9
authored
Dec 22, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipGet/SetStringFormatMeasurableCharacterRanges.
parent
e2f7946b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
12 deletions
+46
-12
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+2
-0
stringformat.c
dlls/gdiplus/stringformat.c
+33
-8
stringformat.c
dlls/gdiplus/tests/stringformat.c
+11
-4
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
9f63f7d9
...
@@ -282,6 +282,8 @@ struct GpStringFormat{
...
@@ -282,6 +282,8 @@ struct GpStringFormat{
INT
tabcount
;
INT
tabcount
;
REAL
firsttab
;
REAL
firsttab
;
REAL
*
tabs
;
REAL
*
tabs
;
CharacterRange
*
character_ranges
;
INT
range_count
;
};
};
struct
GpFontCollection
{
struct
GpFontCollection
{
...
...
dlls/gdiplus/stringformat.c
View file @
9f63f7d9
...
@@ -48,6 +48,8 @@ GpStatus WINGDIPAPI GdipCreateStringFormat(INT attr, LANGID lang,
...
@@ -48,6 +48,8 @@ GpStatus WINGDIPAPI GdipCreateStringFormat(INT attr, LANGID lang,
(
*
format
)
->
digitlang
=
LANG_NEUTRAL
;
(
*
format
)
->
digitlang
=
LANG_NEUTRAL
;
(
*
format
)
->
trimming
=
StringTrimmingCharacter
;
(
*
format
)
->
trimming
=
StringTrimmingCharacter
;
(
*
format
)
->
digitsub
=
StringDigitSubstituteUser
;
(
*
format
)
->
digitsub
=
StringDigitSubstituteUser
;
(
*
format
)
->
character_ranges
=
NULL
;
(
*
format
)
->
range_count
=
0
;
/* tabstops */
/* tabstops */
(
*
format
)
->
tabcount
=
0
;
(
*
format
)
->
tabcount
=
0
;
(
*
format
)
->
firsttab
=
0
.
0
;
(
*
format
)
->
firsttab
=
0
.
0
;
...
@@ -61,6 +63,7 @@ GpStatus WINGDIPAPI GdipDeleteStringFormat(GpStringFormat *format)
...
@@ -61,6 +63,7 @@ GpStatus WINGDIPAPI GdipDeleteStringFormat(GpStringFormat *format)
if
(
!
format
)
if
(
!
format
)
return
InvalidParameter
;
return
InvalidParameter
;
GdipFree
(
format
->
character_ranges
);
GdipFree
(
format
->
tabs
);
GdipFree
(
format
->
tabs
);
GdipFree
(
format
);
GdipFree
(
format
);
...
@@ -141,14 +144,16 @@ GpStatus WINGDIPAPI GdipGetStringFormatLineAlign(GpStringFormat *format,
...
@@ -141,14 +144,16 @@ GpStatus WINGDIPAPI GdipGetStringFormatLineAlign(GpStringFormat *format,
}
}
GpStatus
WINGDIPAPI
GdipGetStringFormatMeasurableCharacterRangeCount
(
GpStatus
WINGDIPAPI
GdipGetStringFormatMeasurableCharacterRangeCount
(
GDIPCONST
GpStringFormat
*
format
,
INT
*
count
)
GDIPCONST
GpStringFormat
*
format
,
INT
*
count
)
{
{
if
(
!
(
format
&&
count
))
if
(
!
(
format
&&
count
))
return
InvalidParameter
;
return
InvalidParameter
;
FIXME
(
"stub:
%p %p
\n
"
,
format
,
count
);
TRACE
(
"
%p %p
\n
"
,
format
,
count
);
return
NotImplemented
;
*
count
=
format
->
range_count
;
return
Ok
;
}
}
GpStatus
WINGDIPAPI
GdipGetStringFormatTabStopCount
(
GDIPCONST
GpStringFormat
*
format
,
GpStatus
WINGDIPAPI
GdipGetStringFormatTabStopCount
(
GDIPCONST
GpStringFormat
*
format
,
...
@@ -242,15 +247,22 @@ GpStatus WINGDIPAPI GdipSetStringFormatLineAlign(GpStringFormat *format,
...
@@ -242,15 +247,22 @@ GpStatus WINGDIPAPI GdipSetStringFormatLineAlign(GpStringFormat *format,
return
Ok
;
return
Ok
;
}
}
GpStatus
WINGDIPAPI
GdipSetStringFormatMeasurableCharacterRanges
(
GpStringFormat
*
GpStatus
WINGDIPAPI
GdipSetStringFormatMeasurableCharacterRanges
(
format
,
INT
rangeCount
,
GDIPCONST
CharacterRange
*
ranges
)
GpStringFormat
*
format
,
INT
rangeCount
,
GDIPCONST
CharacterRange
*
ranges
)
{
{
if
(
!
(
format
&&
range
Count
&&
range
s
))
if
(
!
(
format
&&
ranges
))
return
InvalidParameter
;
return
InvalidParameter
;
FIXME
(
"stub: %p, %d, %p
\n
"
,
format
,
rangeCount
,
ranges
);
TRACE
(
"%p, %d, %p
\n
"
,
format
,
rangeCount
,
ranges
);
format
->
character_ranges
=
GdipAlloc
(
rangeCount
*
sizeof
(
CharacterRange
));
if
(
!
format
->
character_ranges
)
return
OutOfMemory
;
return
NotImplemented
;
memcpy
(
format
->
character_ranges
,
ranges
,
sizeof
(
CharacterRange
)
*
rangeCount
);
format
->
range_count
=
rangeCount
;
return
Ok
;
}
}
GpStatus
WINGDIPAPI
GdipSetStringFormatTabStops
(
GpStringFormat
*
format
,
REAL
firsttab
,
GpStatus
WINGDIPAPI
GdipSetStringFormatTabStops
(
GpStringFormat
*
format
,
REAL
firsttab
,
...
@@ -331,6 +343,19 @@ GpStatus WINGDIPAPI GdipCloneStringFormat(GDIPCONST GpStringFormat *format, GpSt
...
@@ -331,6 +343,19 @@ GpStatus WINGDIPAPI GdipCloneStringFormat(GDIPCONST GpStringFormat *format, GpSt
else
else
(
*
newFormat
)
->
tabs
=
NULL
;
(
*
newFormat
)
->
tabs
=
NULL
;
if
(
format
->
range_count
>
0
){
(
*
newFormat
)
->
character_ranges
=
GdipAlloc
(
sizeof
(
CharacterRange
)
*
format
->
range_count
);
if
(
!
(
*
newFormat
)
->
character_ranges
){
GdipFree
((
*
newFormat
)
->
tabs
);
GdipFree
(
*
newFormat
);
return
OutOfMemory
;
}
memcpy
((
*
newFormat
)
->
character_ranges
,
format
->
character_ranges
,
sizeof
(
CharacterRange
)
*
format
->
range_count
);
}
else
(
*
newFormat
)
->
character_ranges
=
NULL
;
TRACE
(
"%p %p
\n
"
,
format
,
newFormat
);
TRACE
(
"%p %p
\n
"
,
format
,
newFormat
);
return
Ok
;
return
Ok
;
...
...
dlls/gdiplus/tests/stringformat.c
View file @
9f63f7d9
...
@@ -29,7 +29,7 @@ static void test_constructor(void)
...
@@ -29,7 +29,7 @@ static void test_constructor(void)
{
{
GpStringFormat
*
format
;
GpStringFormat
*
format
;
GpStatus
stat
;
GpStatus
stat
;
INT
n
;
INT
n
,
count
;
StringAlignment
align
,
valign
;
StringAlignment
align
,
valign
;
StringTrimming
trimming
;
StringTrimming
trimming
;
StringDigitSubstitute
digitsub
;
StringDigitSubstitute
digitsub
;
...
@@ -43,6 +43,7 @@ static void test_constructor(void)
...
@@ -43,6 +43,7 @@ static void test_constructor(void)
GdipGetStringFormatHotkeyPrefix
(
format
,
&
n
);
GdipGetStringFormatHotkeyPrefix
(
format
,
&
n
);
GdipGetStringFormatTrimming
(
format
,
&
trimming
);
GdipGetStringFormatTrimming
(
format
,
&
trimming
);
GdipGetStringFormatDigitSubstitution
(
format
,
&
digitlang
,
&
digitsub
);
GdipGetStringFormatDigitSubstitution
(
format
,
&
digitlang
,
&
digitsub
);
GdipGetStringFormatMeasurableCharacterRangeCount
(
format
,
&
count
);
expect
(
HotkeyPrefixNone
,
n
);
expect
(
HotkeyPrefixNone
,
n
);
expect
(
StringAlignmentNear
,
align
);
expect
(
StringAlignmentNear
,
align
);
...
@@ -50,6 +51,7 @@ static void test_constructor(void)
...
@@ -50,6 +51,7 @@ static void test_constructor(void)
expect
(
StringTrimmingCharacter
,
trimming
);
expect
(
StringTrimmingCharacter
,
trimming
);
expect
(
StringDigitSubstituteUser
,
digitsub
);
expect
(
StringDigitSubstituteUser
,
digitsub
);
expect
(
LANG_NEUTRAL
,
digitlang
);
expect
(
LANG_NEUTRAL
,
digitlang
);
expect
(
0
,
count
);
stat
=
GdipDeleteStringFormat
(
format
);
stat
=
GdipDeleteStringFormat
(
format
);
expect
(
Ok
,
stat
);
expect
(
Ok
,
stat
);
...
@@ -64,14 +66,19 @@ static void test_characterrange(void)
...
@@ -64,14 +66,19 @@ static void test_characterrange(void)
stat
=
GdipCreateStringFormat
(
0
,
LANG_NEUTRAL
,
&
format
);
stat
=
GdipCreateStringFormat
(
0
,
LANG_NEUTRAL
,
&
format
);
expect
(
Ok
,
stat
);
expect
(
Ok
,
stat
);
todo_wine
stat
=
GdipSetStringFormatMeasurableCharacterRanges
(
NULL
,
3
,
ranges
);
{
expect
(
InvalidParameter
,
stat
);
stat
=
GdipSetStringFormatMeasurableCharacterRanges
(
format
,
0
,
ranges
);
expect
(
Ok
,
stat
);
stat
=
GdipSetStringFormatMeasurableCharacterRanges
(
format
,
3
,
NULL
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipSetStringFormatMeasurableCharacterRanges
(
format
,
3
,
ranges
);
stat
=
GdipSetStringFormatMeasurableCharacterRanges
(
format
,
3
,
ranges
);
expect
(
Ok
,
stat
);
expect
(
Ok
,
stat
);
stat
=
GdipGetStringFormatMeasurableCharacterRangeCount
(
format
,
&
count
);
stat
=
GdipGetStringFormatMeasurableCharacterRangeCount
(
format
,
&
count
);
expect
(
Ok
,
stat
);
expect
(
Ok
,
stat
);
if
(
stat
==
Ok
)
expect
(
3
,
count
);
if
(
stat
==
Ok
)
expect
(
3
,
count
);
}
stat
=
GdipDeleteStringFormat
(
format
);
stat
=
GdipDeleteStringFormat
(
format
);
expect
(
Ok
,
stat
);
expect
(
Ok
,
stat
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment