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
03a93eb8
Commit
03a93eb8
authored
Aug 15, 2019
by
Huw Davies
Committed by
Alexandre Julliard
Aug 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Move handling of EM_SETCHARFORMAT to a helper function.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3de4515c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
40 deletions
+51
-40
editor.c
dlls/riched20/editor.c
+51
-40
No files found.
dlls/riched20/editor.c
View file @
03a93eb8
...
...
@@ -3532,6 +3532,56 @@ static LRESULT ME_WmCreate(ME_TextEditor *editor, LPARAM lParam, BOOL unicode)
return
0
;
}
static
LRESULT
handle_EM_SETCHARFORMAT
(
ME_TextEditor
*
editor
,
WPARAM
flags
,
const
CHARFORMAT2W
*
fmt_in
)
{
CHARFORMAT2W
fmt
;
BOOL
changed
=
TRUE
;
ME_Cursor
start
,
end
;
if
(
!
cfany_to_cf2w
(
&
fmt
,
fmt_in
))
return
0
;
if
(
flags
&
SCF_ALL
)
{
if
(
editor
->
mode
&
TM_PLAINTEXT
)
{
ME_SetDefaultCharFormat
(
editor
,
&
fmt
);
}
else
{
ME_SetCursorToStart
(
editor
,
&
start
);
ME_SetCharFormat
(
editor
,
&
start
,
NULL
,
&
fmt
);
editor
->
nModifyStep
=
1
;
}
}
else
if
(
flags
&
SCF_SELECTION
)
{
if
(
editor
->
mode
&
TM_PLAINTEXT
)
return
0
;
if
(
flags
&
SCF_WORD
)
{
end
=
editor
->
pCursors
[
0
];
ME_MoveCursorWords
(
editor
,
&
end
,
+
1
);
start
=
end
;
ME_MoveCursorWords
(
editor
,
&
start
,
-
1
);
ME_SetCharFormat
(
editor
,
&
start
,
&
end
,
&
fmt
);
}
changed
=
ME_IsSelection
(
editor
);
ME_SetSelectionCharFormat
(
editor
,
&
fmt
);
if
(
changed
)
editor
->
nModifyStep
=
1
;
}
else
/* SCF_DEFAULT */
{
ME_SetDefaultCharFormat
(
editor
,
&
fmt
);
}
ME_CommitUndo
(
editor
);
if
(
changed
)
{
ME_WrapMarkedParagraphs
(
editor
);
ME_UpdateScrollBar
(
editor
);
ME_Repaint
(
editor
);
}
return
1
;
}
#define UNSUPPORTED_MSG(e) \
case e: \
...
...
@@ -3933,46 +3983,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
case
EM_GETEVENTMASK
:
return
editor
->
nEventMask
;
case
EM_SETCHARFORMAT
:
{
CHARFORMAT2W
p
;
BOOL
bRepaint
=
TRUE
;
if
(
!
cfany_to_cf2w
(
&
p
,
(
CHARFORMAT2W
*
)
lParam
))
return
0
;
if
(
wParam
&
SCF_ALL
)
{
if
(
editor
->
mode
&
TM_PLAINTEXT
)
{
ME_SetDefaultCharFormat
(
editor
,
&
p
);
}
else
{
ME_Cursor
start
;
ME_SetCursorToStart
(
editor
,
&
start
);
ME_SetCharFormat
(
editor
,
&
start
,
NULL
,
&
p
);
editor
->
nModifyStep
=
1
;
}
}
else
if
(
wParam
&
SCF_SELECTION
)
{
if
(
editor
->
mode
&
TM_PLAINTEXT
)
return
0
;
if
(
wParam
&
SCF_WORD
)
{
ME_Cursor
start
;
ME_Cursor
end
=
editor
->
pCursors
[
0
];
ME_MoveCursorWords
(
editor
,
&
end
,
+
1
);
start
=
end
;
ME_MoveCursorWords
(
editor
,
&
start
,
-
1
);
ME_SetCharFormat
(
editor
,
&
start
,
&
end
,
&
p
);
}
bRepaint
=
ME_IsSelection
(
editor
);
ME_SetSelectionCharFormat
(
editor
,
&
p
);
if
(
bRepaint
)
editor
->
nModifyStep
=
1
;
}
else
{
/* SCF_DEFAULT */
ME_SetDefaultCharFormat
(
editor
,
&
p
);
}
ME_CommitUndo
(
editor
);
if
(
bRepaint
)
{
ME_WrapMarkedParagraphs
(
editor
);
ME_UpdateScrollBar
(
editor
);
ME_Repaint
(
editor
);
}
return
1
;
}
return
handle_EM_SETCHARFORMAT
(
editor
,
wParam
,
(
CHARFORMAT2W
*
)
lParam
);
case
EM_GETCHARFORMAT
:
{
CHARFORMAT2W
tmp
,
*
dst
=
(
CHARFORMAT2W
*
)
lParam
;
...
...
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