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
3fe15349
Commit
3fe15349
authored
Mar 04, 2023
by
Jinoh Kang
Committed by
Alexandre Julliard
Mar 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Implement ITextDocument::Freeze and ITextDocument::Unfreeze.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54617
parent
2027be7e
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
26 deletions
+22
-26
editor.c
dlls/riched20/editor.c
+1
-0
editstr.h
dlls/riched20/editstr.h
+1
-0
paint.c
dlls/riched20/paint.c
+2
-0
richole.c
dlls/riched20/richole.c
+11
-4
richole.c
dlls/riched20/tests/richole.c
+0
-16
txtsrv.c
dlls/riched20/tests/txtsrv.c
+0
-5
txthost.c
dlls/riched20/txthost.c
+5
-1
txtsrv.c
dlls/riched20/txtsrv.c
+2
-0
No files found.
dlls/riched20/editor.c
View file @
3fe15349
...
@@ -2994,6 +2994,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
...
@@ -2994,6 +2994,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
ed
->
mode
|=
(
ed
->
props
&
TXTBIT_RICHTEXT
)
?
TM_RICHTEXT
:
TM_PLAINTEXT
;
ed
->
mode
|=
(
ed
->
props
&
TXTBIT_RICHTEXT
)
?
TM_RICHTEXT
:
TM_PLAINTEXT
;
ed
->
AutoURLDetect_bEnable
=
FALSE
;
ed
->
AutoURLDetect_bEnable
=
FALSE
;
ed
->
bHaveFocus
=
FALSE
;
ed
->
bHaveFocus
=
FALSE
;
ed
->
freeze_count
=
0
;
ed
->
bMouseCaptured
=
FALSE
;
ed
->
bMouseCaptured
=
FALSE
;
ed
->
caret_hidden
=
FALSE
;
ed
->
caret_hidden
=
FALSE
;
ed
->
caret_height
=
0
;
ed
->
caret_height
=
0
;
...
...
dlls/riched20/editstr.h
View file @
3fe15349
...
@@ -429,6 +429,7 @@ typedef struct tagME_TextEditor
...
@@ -429,6 +429,7 @@ typedef struct tagME_TextEditor
BOOL
AutoURLDetect_bEnable
;
BOOL
AutoURLDetect_bEnable
;
WCHAR
password_char
;
WCHAR
password_char
;
BOOL
bHaveFocus
;
BOOL
bHaveFocus
;
DWORD
freeze_count
;
/*for IME */
/*for IME */
int
imeStartIndex
;
int
imeStartIndex
;
DWORD
selofs
;
/* The size of the selection bar on the left side of control */
DWORD
selofs
;
/* The size of the selection bar on the left side of control */
...
...
dlls/riched20/paint.c
View file @
3fe15349
...
@@ -123,6 +123,7 @@ void ME_Repaint(ME_TextEditor *editor)
...
@@ -123,6 +123,7 @@ void ME_Repaint(ME_TextEditor *editor)
ME_UpdateScrollBar
(
editor
);
ME_UpdateScrollBar
(
editor
);
FIXME
(
"ME_Repaint had to call ME_WrapMarkedParagraphs
\n
"
);
FIXME
(
"ME_Repaint had to call ME_WrapMarkedParagraphs
\n
"
);
}
}
if
(
!
editor
->
freeze_count
)
ITextHost_TxViewChange
(
editor
->
texthost
,
TRUE
);
ITextHost_TxViewChange
(
editor
->
texthost
,
TRUE
);
}
}
...
@@ -140,6 +141,7 @@ void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now)
...
@@ -140,6 +141,7 @@ void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now)
update_caret
(
editor
);
update_caret
(
editor
);
if
(
!
editor
->
freeze_count
)
ITextHost_TxViewChange
(
editor
->
texthost
,
update_now
);
ITextHost_TxViewChange
(
editor
->
texthost
,
update_now
);
ME_SendSelChange
(
editor
);
ME_SendSelChange
(
editor
);
...
...
dlls/riched20/richole.c
View file @
3fe15349
...
@@ -4217,15 +4217,22 @@ static HRESULT WINAPI ITextDocument2Old_fnSave(ITextDocument2Old *iface, VARIANT
...
@@ -4217,15 +4217,22 @@ static HRESULT WINAPI ITextDocument2Old_fnSave(ITextDocument2Old *iface, VARIANT
static
HRESULT
WINAPI
ITextDocument2Old_fnFreeze
(
ITextDocument2Old
*
iface
,
LONG
*
pCount
)
static
HRESULT
WINAPI
ITextDocument2Old_fnFreeze
(
ITextDocument2Old
*
iface
,
LONG
*
pCount
)
{
{
struct
text_services
*
services
=
impl_from_ITextDocument2Old
(
iface
);
struct
text_services
*
services
=
impl_from_ITextDocument2Old
(
iface
);
FIXME
(
"stub %p
\n
"
,
services
);
return
E_NOTIMPL
;
if
(
services
->
editor
->
freeze_count
<
LONG_MAX
)
services
->
editor
->
freeze_count
++
;
if
(
pCount
)
*
pCount
=
services
->
editor
->
freeze_count
;
return
services
->
editor
->
freeze_count
!=
0
?
S_OK
:
S_FALSE
;
}
}
static
HRESULT
WINAPI
ITextDocument2Old_fnUnfreeze
(
ITextDocument2Old
*
iface
,
LONG
*
pCount
)
static
HRESULT
WINAPI
ITextDocument2Old_fnUnfreeze
(
ITextDocument2Old
*
iface
,
LONG
*
pCount
)
{
{
struct
text_services
*
services
=
impl_from_ITextDocument2Old
(
iface
);
struct
text_services
*
services
=
impl_from_ITextDocument2Old
(
iface
);
FIXME
(
"stub %p
\n
"
,
services
);
return
E_NOTIMPL
;
if
(
services
->
editor
->
freeze_count
&&
!--
services
->
editor
->
freeze_count
)
ME_RewrapRepaint
(
services
->
editor
);
if
(
pCount
)
*
pCount
=
services
->
editor
->
freeze_count
;
return
services
->
editor
->
freeze_count
==
0
?
S_OK
:
S_FALSE
;
}
}
static
HRESULT
WINAPI
ITextDocument2Old_fnBeginEditCollection
(
ITextDocument2Old
*
iface
)
static
HRESULT
WINAPI
ITextDocument2Old_fnBeginEditCollection
(
ITextDocument2Old
*
iface
)
...
...
dlls/riched20/tests/richole.c
View file @
3fe15349
...
@@ -5518,9 +5518,7 @@ static void test_freeze(void)
...
@@ -5518,9 +5518,7 @@ static void test_freeze(void)
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
hr
=
ITextDocument_Freeze
(
doc
,
&
count
);
hr
=
ITextDocument_Freeze
(
doc
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"ITextDocument_Freeze returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ITextDocument_Freeze returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
count
==
1
,
"expected count to be %d, got %ld
\n
"
,
1
,
count
);
ok
(
count
==
1
,
"expected count to be %d, got %ld
\n
"
,
1
,
count
);
style2
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
style2
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
...
@@ -5528,54 +5526,40 @@ static void test_freeze(void)
...
@@ -5528,54 +5526,40 @@ static void test_freeze(void)
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
hr
=
ITextDocument_Freeze
(
doc
,
&
count
);
hr
=
ITextDocument_Freeze
(
doc
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"ITextDocument_Freeze returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ITextDocument_Freeze returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
count
==
2
,
"expected count to be %d, got %ld
\n
"
,
2
,
count
);
ok
(
count
==
2
,
"expected count to be %d, got %ld
\n
"
,
2
,
count
);
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
hr
=
ITextDocument_Unfreeze
(
doc
,
&
count
);
hr
=
ITextDocument_Unfreeze
(
doc
,
&
count
);
todo_wine
ok
(
hr
==
S_FALSE
,
"ITextDocument_Unfreeze returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"ITextDocument_Unfreeze returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
count
==
1
,
"expected count to be %d, got %ld
\n
"
,
1
,
count
);
ok
(
count
==
1
,
"expected count to be %d, got %ld
\n
"
,
1
,
count
);
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
hr
=
ITextDocument_Unfreeze
(
doc
,
&
count
);
hr
=
ITextDocument_Unfreeze
(
doc
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"ITextDocument_Unfreeze returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ITextDocument_Unfreeze returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
count
==
0
,
"expected count to be %d, got %ld
\n
"
,
0
,
count
);
ok
(
count
==
0
,
"expected count to be %d, got %ld
\n
"
,
0
,
count
);
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
hr
=
ITextDocument_Unfreeze
(
doc
,
&
count
);
hr
=
ITextDocument_Unfreeze
(
doc
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"ITextDocument_Unfreeze returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ITextDocument_Unfreeze returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
count
==
0
,
"expected count to be %d, got %ld
\n
"
,
0
,
count
);
ok
(
count
==
0
,
"expected count to be %d, got %ld
\n
"
,
0
,
count
);
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
hr
=
ITextDocument_Freeze
(
doc
,
&
count
);
hr
=
ITextDocument_Freeze
(
doc
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"ITextDocument_Freeze returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ITextDocument_Freeze returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
count
==
1
,
"expected count to be %d, got %ld
\n
"
,
1
,
count
);
ok
(
count
==
1
,
"expected count to be %d, got %ld
\n
"
,
1
,
count
);
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
hr
=
ITextDocument_Unfreeze
(
doc
,
&
count
);
hr
=
ITextDocument_Unfreeze
(
doc
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"ITextDocument_Unfreeze returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ITextDocument_Unfreeze returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
count
==
0
,
"expected count to be %d, got %ld
\n
"
,
0
,
count
);
ok
(
count
==
0
,
"expected count to be %d, got %ld
\n
"
,
0
,
count
);
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
hr
=
ITextDocument_Freeze
(
doc
,
NULL
);
hr
=
ITextDocument_Freeze
(
doc
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"ITextDocument_Freeze returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ITextDocument_Freeze returned %#lx
\n
"
,
hr
);
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
hr
=
ITextDocument_Unfreeze
(
doc
,
NULL
);
hr
=
ITextDocument_Unfreeze
(
doc
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"ITextDocument_Unfreeze returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ITextDocument_Unfreeze returned %#lx
\n
"
,
hr
);
release_interfaces
(
&
hwnd
,
&
reole
,
&
doc
,
&
selection
);
release_interfaces
(
&
hwnd
,
&
reole
,
&
doc
,
&
selection
);
...
...
dlls/riched20/tests/txtsrv.c
View file @
3fe15349
...
@@ -863,9 +863,7 @@ static void test_TxDraw(void)
...
@@ -863,9 +863,7 @@ static void test_TxDraw(void)
freeze_count
=
0xdeadbeef
;
freeze_count
=
0xdeadbeef
;
hr
=
ITextDocument_Freeze
(
txtdoc
,
&
freeze_count
);
hr
=
ITextDocument_Freeze
(
txtdoc
,
&
freeze_count
);
todo_wine
ok
(
hr
==
S_OK
,
"ITextDocument_Freeze returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ITextDocument_Freeze returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
freeze_count
==
1
,
"expected count to be %d, got %ld
\n
"
,
1
,
freeze_count
);
ok
(
freeze_count
==
1
,
"expected count to be %d, got %ld
\n
"
,
1
,
freeze_count
);
hr
=
ITextServices_TxDraw
(
txtserv
,
DVASPECT_CONTENT
,
0
,
NULL
,
NULL
,
hdc
,
NULL
,
(
RECTL
*
)
&
client
,
NULL
,
hr
=
ITextServices_TxDraw
(
txtserv
,
DVASPECT_CONTENT
,
0
,
NULL
,
NULL
,
hdc
,
NULL
,
(
RECTL
*
)
&
client
,
NULL
,
...
@@ -873,14 +871,11 @@ static void test_TxDraw(void)
...
@@ -873,14 +871,11 @@ static void test_TxDraw(void)
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
hr
=
ITextServices_TxDraw
(
txtserv
,
DVASPECT_CONTENT
,
0
,
NULL
,
NULL
,
hdc
,
NULL
,
(
RECTL
*
)
&
client
,
NULL
,
hr
=
ITextServices_TxDraw
(
txtserv
,
DVASPECT_CONTENT
,
0
,
NULL
,
NULL
,
hdc
,
NULL
,
(
RECTL
*
)
&
client
,
NULL
,
NULL
,
NULL
,
0
,
TXTVIEW_ACTIVE
);
NULL
,
NULL
,
0
,
TXTVIEW_ACTIVE
);
todo_wine
ok
(
hr
==
E_UNEXPECTED
,
"got %08lx
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got %08lx
\n
"
,
hr
);
freeze_count
=
0xdeadbeef
;
freeze_count
=
0xdeadbeef
;
hr
=
ITextDocument_Unfreeze
(
txtdoc
,
&
freeze_count
);
hr
=
ITextDocument_Unfreeze
(
txtdoc
,
&
freeze_count
);
todo_wine
ok
(
hr
==
S_OK
,
"ITextDocument_Unfreeze returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ITextDocument_Unfreeze returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
freeze_count
==
0
,
"expected count to be %d, got %ld
\n
"
,
0
,
freeze_count
);
ok
(
freeze_count
==
0
,
"expected count to be %d, got %ld
\n
"
,
0
,
freeze_count
);
hr
=
ITextServices_OnTxInPlaceDeactivate
(
txtserv
);
hr
=
ITextServices_OnTxInPlaceDeactivate
(
txtserv
);
...
...
dlls/riched20/txthost.c
View file @
3fe15349
...
@@ -1313,18 +1313,22 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
...
@@ -1313,18 +1313,22 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
RECT
rc
,
client
,
update
;
RECT
rc
,
client
,
update
;
PAINTSTRUCT
ps
;
PAINTSTRUCT
ps
;
HBRUSH
brush
,
old_brush
;
HBRUSH
brush
,
old_brush
;
LONG
view_id
;
ITextHost_TxGetClientRect
(
&
host
->
ITextHost_iface
,
&
client
);
ITextHost_TxGetClientRect
(
&
host
->
ITextHost_iface
,
&
client
);
if
(
msg
==
WM_PAINT
)
if
(
msg
==
WM_PAINT
)
{
{
/* TODO retrieve if the text document is frozen */
hdc
=
BeginPaint
(
hwnd
,
&
ps
);
hdc
=
BeginPaint
(
hwnd
,
&
ps
);
update
=
ps
.
rcPaint
;
update
=
ps
.
rcPaint
;
view_id
=
TXTVIEW_ACTIVE
;
}
}
else
else
{
{
hdc
=
(
HDC
)
wparam
;
hdc
=
(
HDC
)
wparam
;
update
=
client
;
update
=
client
;
view_id
=
TXTVIEW_INACTIVE
;
}
}
brush
=
CreateSolidBrush
(
ITextHost_TxGetSysColor
(
&
host
->
ITextHost_iface
,
COLOR_WINDOW
)
);
brush
=
CreateSolidBrush
(
ITextHost_TxGetSysColor
(
&
host
->
ITextHost_iface
,
COLOR_WINDOW
)
);
...
@@ -1361,7 +1365,7 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
...
@@ -1361,7 +1365,7 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
}
}
ITextServices_TxDraw
(
host
->
text_srv
,
DVASPECT_CONTENT
,
0
,
NULL
,
NULL
,
hdc
,
NULL
,
NULL
,
NULL
,
ITextServices_TxDraw
(
host
->
text_srv
,
DVASPECT_CONTENT
,
0
,
NULL
,
NULL
,
hdc
,
NULL
,
NULL
,
NULL
,
&
update
,
NULL
,
0
,
TXTVIEW_ACTIVE
);
&
update
,
NULL
,
0
,
view_id
);
SelectObject
(
hdc
,
old_brush
);
SelectObject
(
hdc
,
old_brush
);
DeleteObject
(
brush
);
DeleteObject
(
brush
);
if
(
msg
==
WM_PAINT
)
EndPaint
(
hwnd
,
&
ps
);
if
(
msg
==
WM_PAINT
)
EndPaint
(
hwnd
,
&
ps
);
...
...
dlls/riched20/txtsrv.c
View file @
3fe15349
...
@@ -168,6 +168,8 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxDraw( ITextServices *iface, DWORD
...
@@ -168,6 +168,8 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxDraw( ITextServices *iface, DWORD
if
(
aspect
!=
DVASPECT_CONTENT
||
aspect_info
||
td
||
target
||
mf_bounds
||
continue_fn
)
if
(
aspect
!=
DVASPECT_CONTENT
||
aspect_info
||
td
||
target
||
mf_bounds
||
continue_fn
)
FIXME
(
"Many arguments are ignored
\n
"
);
FIXME
(
"Many arguments are ignored
\n
"
);
if
(
view_id
==
TXTVIEW_ACTIVE
&&
services
->
editor
->
freeze_count
)
return
E_UNEXPECTED
;
hr
=
update_client_rect
(
services
,
(
RECT
*
)
bounds
);
hr
=
update_client_rect
(
services
,
(
RECT
*
)
bounds
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
FAILED
(
hr
))
return
hr
;
if
(
hr
==
S_OK
)
rewrap
=
TRUE
;
if
(
hr
==
S_OK
)
rewrap
=
TRUE
;
...
...
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