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
1797d212
Commit
1797d212
authored
Oct 14, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Oct 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use run ptrs in SetCharFormat().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bfac4379
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
16 deletions
+27
-16
editor.h
dlls/riched20/editor.h
+3
-2
run.c
dlls/riched20/run.c
+24
-14
No files found.
dlls/riched20/editor.h
View file @
1797d212
...
...
@@ -76,8 +76,6 @@ ME_DisplayItem *ME_MakeDI(ME_DIType type) DECLSPEC_HIDDEN;
void
ME_DestroyDisplayItem
(
ME_DisplayItem
*
item
)
DECLSPEC_HIDDEN
;
void
ME_DumpDocument
(
ME_TextBuffer
*
buffer
)
DECLSPEC_HIDDEN
;
void
destroy_para
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
item
)
DECLSPEC_HIDDEN
;
ME_Run
*
run_prev
(
ME_Run
*
run
)
DECLSPEC_HIDDEN
;
ME_Run
*
run_next
(
ME_Run
*
run
)
DECLSPEC_HIDDEN
;
/* string.c */
ME_String
*
ME_MakeStringN
(
LPCWSTR
szText
,
int
nMaxChars
)
DECLSPEC_HIDDEN
;
...
...
@@ -132,6 +130,9 @@ int ME_PointFromCharContext(ME_Context *c, ME_Run *pRun, int nOffset, BOOL visua
int
ME_PointFromChar
(
ME_TextEditor
*
editor
,
ME_Run
*
pRun
,
int
nOffset
,
BOOL
visual_order
)
DECLSPEC_HIDDEN
;
BOOL
ME_CanJoinRuns
(
const
ME_Run
*
run1
,
const
ME_Run
*
run2
)
DECLSPEC_HIDDEN
;
void
run_join
(
ME_TextEditor
*
editor
,
ME_Run
*
run
)
DECLSPEC_HIDDEN
;
ME_Run
*
run_next
(
ME_Run
*
run
)
DECLSPEC_HIDDEN
;
ME_Run
*
run_next_all_paras
(
ME_Run
*
run
)
DECLSPEC_HIDDEN
;
ME_Run
*
run_prev
(
ME_Run
*
run
)
DECLSPEC_HIDDEN
;
ME_Run
*
run_split
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
)
DECLSPEC_HIDDEN
;
void
ME_UpdateRunFlags
(
ME_TextEditor
*
editor
,
ME_Run
*
run
)
DECLSPEC_HIDDEN
;
SIZE
ME_GetRunSizeCommon
(
ME_Context
*
c
,
const
ME_Paragraph
*
para
,
ME_Run
*
run
,
int
nLen
,
...
...
dlls/riched20/run.c
View file @
1797d212
...
...
@@ -47,6 +47,16 @@ ME_Run *run_prev( ME_Run *run )
return
NULL
;
}
ME_Run
*
run_next_all_paras
(
ME_Run
*
run
)
{
ME_DisplayItem
*
item
=
run_get_di
(
run
),
*
dummy
=
para_get_di
(
run
->
para
);
if
(
ME_NextRun
(
&
dummy
,
&
item
,
TRUE
))
return
&
item
->
member
.
run
;
return
NULL
;
}
/******************************************************************************
* ME_CanJoinRuns
*
...
...
@@ -745,22 +755,22 @@ void ME_SetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt)
*
* If no text is selected, then nothing is done.
*/
void
ME_SetCharFormat
(
ME_TextEditor
*
editor
,
ME_Cursor
*
start
,
ME_Cursor
*
end
,
CHARFORMAT2W
*
pFmt
)
void
ME_SetCharFormat
(
ME_TextEditor
*
editor
,
ME_Cursor
*
start
,
ME_Cursor
*
end
,
CHARFORMAT2W
*
fmt
)
{
ME_
DisplayItem
*
run
,
*
start_run
=
start
->
pR
un
,
*
end_run
=
NULL
;
ME_
Run
*
run
,
*
start_run
=
&
start
->
pRun
->
member
.
r
un
,
*
end_run
=
NULL
;
if
(
end
&&
start
->
pRun
==
end
->
pRun
&&
start
->
nOffset
==
end
->
nOffset
)
return
;
if
(
start
->
nOffset
==
start
->
pRun
->
member
.
run
.
len
)
start_run
=
ME_FindItemFwd
(
start
->
pRun
,
diR
un
);
start_run
=
run_next_all_paras
(
&
start
->
pRun
->
member
.
r
un
);
else
if
(
start
->
nOffset
)
{
/* run_split() may or may not update the cursors, depending on whether they
* are selection cursors, but we need to make sure they are valid. */
int
split_offset
=
start
->
nOffset
;
ME_Run
*
split_run
=
run_split
(
editor
,
start
);
start_run
=
start
->
pR
un
;
start_run
=
&
start
->
pRun
->
member
.
r
un
;
if
(
end
&&
&
end
->
pRun
->
member
.
run
==
split_run
)
{
end
->
pRun
=
start
->
pRun
;
...
...
@@ -771,26 +781,26 @@ void ME_SetCharFormat(ME_TextEditor *editor, ME_Cursor *start, ME_Cursor *end, C
if
(
end
)
{
if
(
end
->
nOffset
==
end
->
pRun
->
member
.
run
.
len
)
end_run
=
ME_FindItemFwd
(
end
->
pRun
,
diR
un
);
end_run
=
run_next_all_paras
(
&
end
->
pRun
->
member
.
r
un
);
else
{
if
(
end
->
nOffset
)
run_split
(
editor
,
end
);
end_run
=
end
->
pR
un
;
end_run
=
&
end
->
pRun
->
member
.
r
un
;
}
}
for
(
run
=
start_run
;
run
!=
end_run
;
run
=
ME_FindItemFwd
(
run
,
diR
un
))
for
(
run
=
start_run
;
run
!=
end_run
;
run
=
run_next_all_paras
(
r
un
))
{
ME_Style
*
new_style
=
ME_ApplyStyle
(
editor
,
run
->
member
.
run
.
style
,
pFmt
);
ME_Paragraph
*
para
=
run
->
member
.
run
.
para
;
ME_Style
*
new_style
=
ME_ApplyStyle
(
editor
,
run
->
style
,
fmt
);
ME_Paragraph
*
para
=
run
->
para
;
add_undo_set_char_fmt
(
editor
,
run
->
member
.
run
.
para
->
nCharOfs
+
run
->
member
.
run
.
nCharOfs
,
run
->
member
.
run
.
len
,
&
run
->
member
.
run
.
style
->
fmt
);
ME_ReleaseStyle
(
run
->
member
.
run
.
style
);
run
->
member
.
run
.
style
=
new_style
;
add_undo_set_char_fmt
(
editor
,
para
->
nCharOfs
+
run
->
nCharOfs
,
run
->
len
,
&
run
->
style
->
fmt
);
ME_ReleaseStyle
(
run
->
style
);
run
->
style
=
new_style
;
/* The para numbering style depends on the eop style */
if
((
run
->
member
.
run
.
nFlags
&
MERF_ENDPARA
)
&&
para
->
para_num
.
style
)
if
((
run
->
nFlags
&
MERF_ENDPARA
)
&&
para
->
para_num
.
style
)
{
ME_ReleaseStyle
(
para
->
para_num
.
style
);
para
->
para_num
.
style
=
NULL
;
...
...
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