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
e7b42dea
Commit
e7b42dea
authored
Mar 25, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Mar 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Implement TxGetNaturalSize().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
aae4fa9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
8 deletions
+37
-8
txtsrv.c
dlls/riched20/tests/txtsrv.c
+3
-3
txtsrv.c
dlls/riched20/txtsrv.c
+34
-5
No files found.
dlls/riched20/tests/txtsrv.c
View file @
e7b42dea
...
...
@@ -705,7 +705,7 @@ static void _check_txgetnaturalsize(HRESULT res, LONG width, LONG height, HDC hd
expected_width
=
expected_rect
.
right
-
expected_rect
.
left
;
expected_height
=
expected_rect
.
bottom
-
expected_rect
.
top
;
ok_
(
__FILE__
,
line
)(
res
==
S_OK
,
"ITextServices_TxGetNaturalSize failed: 0x%08x.
\n
"
,
res
);
ok_
(
__FILE__
,
line
)(
width
>=
expected_width
&&
width
<=
expected_width
+
1
,
todo_wine
ok_
(
__FILE__
,
line
)(
width
>=
expected_width
&&
width
<=
expected_width
+
1
,
"got wrong width: %d, expected: %d {+1}.
\n
"
,
width
,
expected_width
);
ok_
(
__FILE__
,
line
)(
height
==
expected_height
,
"got wrong height: %d, expected: %d.
\n
"
,
height
,
expected_height
);
...
...
@@ -717,7 +717,7 @@ static void test_TxGetNaturalSize(void)
ITextHost
*
host
;
HRESULT
result
;
SIZEL
extent
;
static
const
WCHAR
test_text
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'S'
,
'o'
,
'm'
,
'e'
,
'T'
,
'e'
,
'x'
,
't'
,
0
}
;
static
const
WCHAR
test_text
[]
=
L"TestSomeText"
;
LONG
width
,
height
;
HDC
hdcDraw
;
HWND
hwnd
;
...
...
@@ -752,7 +752,7 @@ static void test_TxGetNaturalSize(void)
height
=
0
;
result
=
ITextServices_TxGetNaturalSize
(
txtserv
,
DVASPECT_CONTENT
,
hdcDraw
,
NULL
,
NULL
,
TXTNS_FITTOCONTENT
,
&
extent
,
&
width
,
&
height
);
todo_wine
CHECK_TXGETNATURALSIZE
(
result
,
width
,
height
,
hdcDraw
,
rect
,
test_text
);
CHECK_TXGETNATURALSIZE
(
result
,
width
,
height
,
hdcDraw
,
rect
,
test_text
);
ReleaseDC
(
hwnd
,
hdcDraw
);
DestroyWindow
(
hwnd
);
...
...
dlls/riched20/txtsrv.c
View file @
e7b42dea
...
...
@@ -366,14 +366,43 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxGetBaseLinePos(ITextServices *ifa
}
DEFINE_THISCALL_WRAPPER
(
fnTextSrv_TxGetNaturalSize
,
36
)
DECLSPEC_HIDDEN
HRESULT
__thiscall
fnTextSrv_TxGetNaturalSize
(
ITextServices
*
iface
,
DWORD
dwAspect
,
HDC
hdcD
raw
,
HDC
hicTargetDev
,
DVTARGETDEVICE
*
ptd
,
DWORD
dwM
ode
,
const
SIZEL
*
psizelExtent
,
LONG
*
pwidth
,
LONG
*
pheight
)
DECLSPEC_HIDDEN
HRESULT
__thiscall
fnTextSrv_TxGetNaturalSize
(
ITextServices
*
iface
,
DWORD
aspect
,
HDC
d
raw
,
HDC
target
,
DVTARGETDEVICE
*
td
,
DWORD
m
ode
,
const
SIZEL
*
extent
,
LONG
*
width
,
LONG
*
height
)
{
struct
text_services
*
services
=
impl_from_ITextServices
(
iface
);
RECT
rect
;
HDC
dc
=
draw
;
BOOL
rewrap
=
FALSE
;
HRESULT
hr
;
FIXME
(
"%p: STUB
\n
"
,
services
);
return
E_NOTIMPL
;
TRACE
(
"%p: aspect %d, draw %p, target %p, td %p, mode %08x, extent %s, *width %d, *height %d
\n
"
,
services
,
aspect
,
draw
,
target
,
td
,
mode
,
wine_dbgstr_point
(
(
POINT
*
)
extent
),
*
width
,
*
height
);
if
(
aspect
!=
DVASPECT_CONTENT
||
target
||
td
||
mode
!=
TXTNS_FITTOCONTENT
)
FIXME
(
"Many arguments are ignored
\n
"
);
SetRect
(
&
rect
,
0
,
0
,
*
width
,
*
height
);
hr
=
update_client_rect
(
services
,
&
rect
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
hr
==
S_OK
)
rewrap
=
TRUE
;
if
(
!
dc
&&
services
->
editor
->
in_place_active
)
dc
=
ITextHost_TxGetDC
(
services
->
host
);
if
(
!
dc
)
return
E_FAIL
;
if
(
rewrap
)
{
editor_mark_rewrap_all
(
services
->
editor
);
wrap_marked_paras_dc
(
services
->
editor
,
dc
,
FALSE
);
}
*
width
=
services
->
editor
->
nTotalWidth
;
*
height
=
services
->
editor
->
nTotalLength
;
if
(
!
draw
)
ITextHost_TxReleaseDC
(
services
->
host
,
dc
);
return
S_OK
;
}
DEFINE_THISCALL_WRAPPER
(
fnTextSrv_TxGetDropTarget
,
8
)
...
...
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