Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
06fb9c7f
Commit
06fb9c7f
authored
Mar 18, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Mar 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Handle EM_SETPASSWORDCHAR in the host.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b927bc8d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
25 deletions
+38
-25
editor.c
dlls/riched20/editor.c
+3
-13
editstr.h
dlls/riched20/editstr.h
+1
-1
paint.c
dlls/riched20/paint.c
+2
-2
run.c
dlls/riched20/run.c
+6
-6
txthost.c
dlls/riched20/txthost.c
+18
-2
txtsrv.c
dlls/riched20/txtsrv.c
+7
-0
wrap.c
dlls/riched20/wrap.c
+1
-1
No files found.
dlls/riched20/editor.c
View file @
06fb9c7f
...
...
@@ -2375,7 +2375,7 @@ static BOOL copy_or_cut( ME_TextEditor *editor, BOOL cut )
int
start_cursor
=
ME_GetSelectionOfs
(
editor
,
&
offs
,
&
count
);
ME_Cursor
*
sel_start
=
&
editor
->
pCursors
[
start_cursor
];
if
(
editor
->
cPasswordMask
)
return
FALSE
;
if
(
editor
->
password_char
)
return
FALSE
;
count
-=
offs
;
hr
=
editor_copy_or_cut
(
editor
,
cut
,
sel_start
,
count
,
NULL
);
...
...
@@ -3041,9 +3041,9 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
else
ed
->
selofs
=
0
;
ed
->
nSelectionType
=
stPosition
;
ed
->
cPasswordMask
=
0
;
ed
->
password_char
=
0
;
if
(
ed
->
props
&
TXTBIT_USEPASSWORD
)
ITextHost_TxGetPasswordChar
(
texthost
,
&
ed
->
cPasswordMask
);
ITextHost_TxGetPasswordChar
(
texthost
,
&
ed
->
password_char
);
ed
->
bWordWrap
=
(
ed
->
props
&
TXTBIT_WORDWRAP
)
&&
(
ed
->
props
&
TXTBIT_MULTILINE
);
...
...
@@ -4217,10 +4217,6 @@ LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam,
return
1
;
return
0
;
}
case
EM_GETPASSWORDCHAR
:
{
return
editor
->
cPasswordMask
;
}
case
EM_SETOLECALLBACK
:
if
(
editor
->
lpOleCallback
)
IRichEditOleCallback_Release
(
editor
->
lpOleCallback
);
...
...
@@ -4274,12 +4270,6 @@ LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam,
editor
->
mode
=
(
editor
->
mode
&
~
mask
)
|
changes
;
return
0
;
}
case
EM_SETPASSWORDCHAR
:
{
editor
->
cPasswordMask
=
wParam
;
ME_RewrapRepaint
(
editor
);
return
0
;
}
case
EM_SETTARGETDEVICE
:
if
(
wParam
==
0
)
{
...
...
dlls/riched20/editstr.h
View file @
06fb9c7f
...
...
@@ -416,7 +416,7 @@ typedef struct tagME_TextEditor
int
mode
;
BOOL
bHideSelection
;
BOOL
AutoURLDetect_bEnable
;
WCHAR
cPasswordMask
;
WCHAR
password_char
;
BOOL
bHaveFocus
;
/*for IME */
int
imeStartIndex
;
...
...
dlls/riched20/paint.c
View file @
06fb9c7f
...
...
@@ -333,9 +333,9 @@ static void draw_text( ME_Context *c, ME_Run *run, int x, int y, BOOL selected,
&&
!
(
CFE_AUTOBACKCOLOR
&
run
->
style
->
fmt
.
dwEffects
)
)
);
if
(
c
->
editor
->
cPasswordMask
)
if
(
c
->
editor
->
password_char
)
{
masked
=
ME_MakeStringR
(
c
->
editor
->
cPasswordMask
,
run
->
len
);
masked
=
ME_MakeStringR
(
c
->
editor
->
password_char
,
run
->
len
);
text
=
masked
->
szData
;
}
...
...
dlls/riched20/run.c
View file @
06fb9c7f
...
...
@@ -543,9 +543,9 @@ int ME_CharFromPointContext(ME_Context *c, int cx, ME_Run *run, BOOL closest, BO
return
closest
?
cp
+
trailing
:
cp
;
}
if
(
c
->
editor
->
cPasswordMask
)
if
(
c
->
editor
->
password_char
)
{
mask_text
=
ME_MakeStringR
(
c
->
editor
->
cPasswordMask
,
run
->
len
);
mask_text
=
ME_MakeStringR
(
c
->
editor
->
password_char
,
run
->
len
);
str
=
mask_text
->
szData
;
}
else
...
...
@@ -626,9 +626,9 @@ int ME_PointFromCharContext(ME_Context *c, ME_Run *pRun, int nOffset, BOOL visua
if
(
visual_order
&&
pRun
->
script_analysis
.
fRTL
)
x
=
pRun
->
nWidth
-
x
-
1
;
return
x
;
}
if
(
c
->
editor
->
cPasswordMask
)
if
(
c
->
editor
->
password_char
)
{
mask_text
=
ME_MakeStringR
(
c
->
editor
->
cPasswordMask
,
pRun
->
len
);
mask_text
=
ME_MakeStringR
(
c
->
editor
->
password_char
,
pRun
->
len
);
str
=
mask_text
->
szData
;
}
else
...
...
@@ -678,9 +678,9 @@ SIZE ME_GetRunSizeCommon(ME_Context *c, const ME_Paragraph *para, ME_Run *run, i
{
size
.
cx
=
run
->
nWidth
;
}
else
if
(
c
->
editor
->
cPasswordMask
)
else
if
(
c
->
editor
->
password_char
)
{
ME_String
*
szMasked
=
ME_MakeStringR
(
c
->
editor
->
cPasswordMask
,
nLen
);
ME_String
*
szMasked
=
ME_MakeStringR
(
c
->
editor
->
password_char
,
nLen
);
ME_GetTextExtent
(
c
,
szMasked
->
szData
,
nLen
,
run
->
style
,
&
size
);
ME_DestroyString
(
szMasked
);
}
...
...
dlls/riched20/txthost.c
View file @
06fb9c7f
...
...
@@ -50,6 +50,7 @@ struct host
DWORD
props
,
scrollbars
,
event_mask
;
RECT
client_rect
,
set_rect
;
COLORREF
back_colour
;
WCHAR
password_char
;
};
static
const
ITextHostVtbl
textHostVtbl
;
...
...
@@ -114,6 +115,7 @@ struct host *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10 )
SetRectEmpty
(
&
texthost
->
set_rect
);
GetClientRect
(
hwnd
,
&
texthost
->
client_rect
);
texthost
->
use_back_colour
=
0
;
texthost
->
password_char
=
(
texthost
->
props
&
TXTBIT_USEPASSWORD
)
?
'*'
:
0
;
return
texthost
;
}
...
...
@@ -381,8 +383,10 @@ DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetScrollBars( ITextHost *ifa
DEFINE_THISCALL_WRAPPER
(
ITextHostImpl_TxGetPasswordChar
,
8
)
DECLSPEC_HIDDEN
HRESULT
__thiscall
ITextHostImpl_TxGetPasswordChar
(
ITextHost
*
iface
,
WCHAR
*
c
)
{
*
c
=
'*'
;
return
S_OK
;
struct
host
*
host
=
impl_from_ITextHost
(
iface
);
*
c
=
host
->
password_char
;
return
*
c
?
S_OK
:
S_FALSE
;
}
DEFINE_THISCALL_WRAPPER
(
ITextHostImpl_TxGetAcceleratorPos
,
8
)
...
...
@@ -1058,6 +1062,10 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
else
hr
=
get_lineA
(
host
->
text_srv
,
wparam
,
lparam
,
&
res
);
break
;
case
EM_GETPASSWORDCHAR
:
ITextHost_TxGetPasswordChar
(
&
host
->
ITextHost_iface
,
(
WCHAR
*
)
&
res
);
break
;
case
EM_GETRECT
:
hr
=
ITextHost_TxGetClientRect
(
&
host
->
ITextHost_iface
,
(
RECT
*
)
lparam
);
break
;
...
...
@@ -1208,6 +1216,14 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
hr
=
set_options
(
host
,
wparam
,
lparam
,
&
res
);
break
;
case
EM_SETPASSWORDCHAR
:
if
(
wparam
==
host
->
password_char
)
break
;
host
->
password_char
=
wparam
;
if
(
wparam
)
host
->
props
|=
TXTBIT_USEPASSWORD
;
else
host
->
props
&=
~
TXTBIT_USEPASSWORD
;
ITextServices_OnTxPropertyBitsChange
(
host
->
text_srv
,
TXTBIT_USEPASSWORD
,
host
->
props
&
TXTBIT_USEPASSWORD
);
break
;
case
EM_SETREADONLY
:
{
DWORD
op
=
wparam
?
ECOOP_OR
:
ECOOP_AND
;
...
...
dlls/riched20/txtsrv.c
View file @
06fb9c7f
...
...
@@ -390,6 +390,13 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxPropertyBitsChange( ITextServic
if
(
SUCCEEDED
(
hr
))
repaint
=
TRUE
;
}
if
(
mask
&
TXTBIT_USEPASSWORD
)
{
if
(
bits
&
TXTBIT_USEPASSWORD
)
ITextHost_TxGetPasswordChar
(
services
->
host
,
&
services
->
editor
->
password_char
);
else
services
->
editor
->
password_char
=
0
;
repaint
=
TRUE
;
}
if
(
repaint
)
ME_RewrapRepaint
(
services
->
editor
);
return
S_OK
;
...
...
dlls/riched20/wrap.c
View file @
06fb9c7f
...
...
@@ -829,7 +829,7 @@ static void ME_WrapTextParagraph( ME_TextEditor *editor, ME_Context *c, ME_Parag
para_num_init
(
c
,
para
);
/* For now treating all non-password text as complex for better testing */
if
(
!
c
->
editor
->
cPasswordMask
/* &&
if
(
!
c
->
editor
->
password_char
/* &&
ScriptIsComplex( tp->member.para.text->szData, tp->member.para.text->nLen, SIC_COMPLEX ) == S_OK */
)
{
if
(
SUCCEEDED
(
itemize_para
(
c
,
para
)
))
...
...
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