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
86ea91f4
Commit
86ea91f4
authored
Jan 07, 2014
by
Huw Davies
Committed by
Alexandre Julliard
Jan 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Correctly handle the cursor at the end of a run case.
parent
2429e8b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
9 deletions
+38
-9
run.c
dlls/riched20/run.c
+38
-9
No files found.
dlls/riched20/run.c
View file @
86ea91f4
...
...
@@ -310,23 +310,52 @@ ME_DisplayItem *
ME_InsertRunAtCursor
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
,
ME_Style
*
style
,
const
WCHAR
*
str
,
int
len
,
int
flags
)
{
ME_DisplayItem
*
pDI
;
ME_DisplayItem
*
pDI
,
*
insert_before
=
cursor
->
pRun
,
*
prev
;
if
(
cursor
->
nOffset
)
ME_SplitRunSimple
(
editor
,
cursor
);
{
if
(
cursor
->
nOffset
==
cursor
->
pRun
->
member
.
run
.
len
)
{
insert_before
=
ME_FindItemFwd
(
cursor
->
pRun
,
diRun
);
if
(
!
insert_before
)
insert_before
=
cursor
->
pRun
;
/* Always insert before the final eop run */
}
else
{
ME_SplitRunSimple
(
editor
,
cursor
);
insert_before
=
cursor
->
pRun
;
}
}
add_undo_delete_run
(
editor
,
cursor
->
pPara
->
member
.
para
.
nCharOfs
+
cursor
->
pRun
->
member
.
run
.
nCharOfs
,
len
);
add_undo_delete_run
(
editor
,
insert_before
->
member
.
run
.
para
->
nCharOfs
+
insert_before
->
member
.
run
.
nCharOfs
,
len
);
pDI
=
ME_MakeRun
(
style
,
flags
);
pDI
->
member
.
run
.
nCharOfs
=
cursor
->
pRun
->
member
.
run
.
nCharOfs
;
pDI
->
member
.
run
.
nCharOfs
=
insert_before
->
member
.
run
.
nCharOfs
;
pDI
->
member
.
run
.
len
=
len
;
pDI
->
member
.
run
.
para
=
cursor
->
pRun
->
member
.
run
.
para
;
pDI
->
member
.
run
.
para
=
insert_before
->
member
.
run
.
para
;
ME_InsertString
(
pDI
->
member
.
run
.
para
->
text
,
pDI
->
member
.
run
.
nCharOfs
,
str
,
len
);
ME_InsertBefore
(
cursor
->
pRun
,
pDI
);
ME_InsertBefore
(
insert_before
,
pDI
);
TRACE
(
"Shift length:%d
\n
"
,
len
);
ME_PropagateCharOffset
(
cursor
->
pRun
,
len
);
cursor
->
pPara
->
member
.
para
.
nFlags
|=
MEPF_REWRAP
;
ME_PropagateCharOffset
(
insert_before
,
len
);
insert_before
->
member
.
run
.
para
->
nFlags
|=
MEPF_REWRAP
;
/* Move any cursors that were at the end of the previous run to the end of the inserted run */
prev
=
ME_FindItemBack
(
pDI
,
diRun
);
if
(
prev
)
{
int
i
;
for
(
i
=
0
;
i
<
editor
->
nCursors
;
i
++
)
{
if
(
editor
->
pCursors
[
i
].
pRun
==
prev
&&
editor
->
pCursors
[
i
].
nOffset
==
prev
->
member
.
run
.
len
)
{
editor
->
pCursors
[
i
].
pRun
=
pDI
;
editor
->
pCursors
[
i
].
nOffset
=
len
;
}
}
}
return
pDI
;
}
...
...
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