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
c8862864
Commit
c8862864
authored
Oct 23, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Oct 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use run and para ptrs in the cursor move lines function.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2c2020dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
32 deletions
+31
-32
caret.c
dlls/riched20/caret.c
+31
-32
No files found.
dlls/riched20/caret.c
View file @
c8862864
...
@@ -1241,13 +1241,17 @@ static void
...
@@ -1241,13 +1241,17 @@ static void
ME_MoveCursorLines
(
ME_TextEditor
*
editor
,
ME_Cursor
*
pCursor
,
int
nRelOfs
,
BOOL
extend
)
ME_MoveCursorLines
(
ME_TextEditor
*
editor
,
ME_Cursor
*
pCursor
,
int
nRelOfs
,
BOOL
extend
)
{
{
ME_DisplayItem
*
pRun
=
pCursor
->
pRun
;
ME_DisplayItem
*
pRun
=
pCursor
->
pRun
;
ME_
DisplayItem
*
pOldPara
=
pCursor
->
pP
ara
;
ME_
Paragraph
*
old_para
=
&
pCursor
->
pPara
->
member
.
para
,
*
new_p
ara
;
ME_DisplayItem
*
pItem
,
*
pNewPara
;
ME_DisplayItem
*
pItem
;
int
x
=
ME_GetXForArrow
(
editor
,
pCursor
);
int
x
=
ME_GetXForArrow
(
editor
,
pCursor
);
if
(
editor
->
bCaretAtEnd
&&
!
pCursor
->
nOffset
)
if
(
editor
->
bCaretAtEnd
&&
!
pCursor
->
nOffset
)
if
(
!
ME_PrevRun
(
&
pOldPara
,
&
pRun
,
TRUE
))
{
return
;
ME_Run
*
prev
=
run_prev_all_paras
(
&
pRun
->
member
.
run
);
if
(
!
prev
)
return
;
pRun
=
run_get_di
(
prev
);
old_para
=
prev
->
para
;
}
if
(
nRelOfs
==
-
1
)
if
(
nRelOfs
==
-
1
)
{
{
...
@@ -1262,25 +1266,23 @@ ME_MoveCursorLines(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs, BOOL
...
@@ -1262,25 +1266,23 @@ ME_MoveCursorLines(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs, BOOL
ME_SetCursorToStart
(
editor
,
pCursor
);
ME_SetCursorToStart
(
editor
,
pCursor
);
return
;
return
;
}
}
pNewPara
=
ME_GetParagraph
(
pItem
);
new_para
=
&
ME_GetParagraph
(
pItem
)
->
member
.
para
;
if
(
pOldPara
->
member
.
para
.
nFlags
&
MEPF_ROWEND
||
if
(
old_para
->
nFlags
&
MEPF_ROWEND
||
(
pOldPara
->
member
.
para
.
pCell
&&
(
para_cell
(
old_para
)
&&
para_cell
(
old_para
)
!=
para_cell
(
new_para
)))
pOldPara
->
member
.
para
.
pCell
!=
pNewPara
->
member
.
para
.
pCell
))
{
{
/* Brought out of a cell */
/* Brought out of a cell */
pNewPara
=
table_row_start
(
&
pOldPara
->
member
.
para
)
->
prev_para
;
new_para
=
para_prev
(
table_row_start
(
old_para
));
if
(
pNewPara
->
type
==
diTextStart
)
if
(
!
new_para
)
return
;
/* At the top, so don't go anywhere. */
return
;
/* At the top, so don't go anywhere. */
pItem
=
ME_FindItemFwd
(
para_get_di
(
new_para
),
diStartRow
);
pItem
=
ME_FindItemFwd
(
pNewPara
,
diStartRow
);
}
}
if
(
pNewPara
->
member
.
para
.
nFlags
&
MEPF_ROWEND
)
if
(
new_para
->
nFlags
&
MEPF_ROWEND
)
{
{
/* Brought into a table row */
/* Brought into a table row */
ME_Cell
*
cell
=
&
ME_FindItemBack
(
pNewPara
,
diCell
)
->
member
.
cell
;
ME_Cell
*
cell
=
table_row_end_cell
(
new_para
)
;
while
(
x
<
cell
->
pt
.
x
&&
cell
->
prev_cell
)
while
(
x
<
cell
->
pt
.
x
&&
cell
_prev
(
cell
)
)
cell
=
&
cell
->
prev_cell
->
member
.
cell
;
cell
=
cell_prev
(
cell
)
;
if
(
cell
->
next_cell
)
/* else - we are still at the end of the row */
if
(
cell
_next
(
cell
)
)
/* else - we are still at the end of the row */
pItem
=
ME_FindItemBack
(
cell
->
next_cell
,
diStartRow
);
pItem
=
ME_FindItemBack
(
cell_get_di
(
cell_next
(
cell
)
),
diStartRow
);
}
}
}
}
else
else
...
@@ -1293,25 +1295,22 @@ ME_MoveCursorLines(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs, BOOL
...
@@ -1293,25 +1295,22 @@ ME_MoveCursorLines(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs, BOOL
ME_SetCursorToEnd
(
editor
,
pCursor
,
TRUE
);
ME_SetCursorToEnd
(
editor
,
pCursor
,
TRUE
);
return
;
return
;
}
}
pNewPara
=
ME_GetParagraph
(
pItem
);
new_para
=
&
ME_GetParagraph
(
pItem
)
->
member
.
para
;
if
(
pOldPara
->
member
.
para
.
nFlags
&
MEPF_ROWSTART
||
if
(
old_para
->
nFlags
&
MEPF_ROWSTART
||
(
pOldPara
->
member
.
para
.
pCell
&&
(
para_cell
(
old_para
)
&&
para_cell
(
old_para
)
!=
para_cell
(
new_para
)))
pOldPara
->
member
.
para
.
pCell
!=
pNewPara
->
member
.
para
.
pCell
))
{
{
/* Brought out of a cell */
/* Brought out of a cell */
pNewPara
=
table_row_end
(
&
pOldPara
->
member
.
para
)
->
next_para
;
new_para
=
para_next
(
table_row_end
(
old_para
)
);
if
(
pNewPara
->
type
==
diTextEnd
)
if
(
!
para_next
(
new_para
))
return
;
/* At the bottom, so don't go anywhere. */
return
;
/* At the bottom, so don't go anywhere. */
pItem
=
ME_FindItemFwd
(
para_get_di
(
new_para
),
diStartRow
);
pItem
=
ME_FindItemFwd
(
pNewPara
,
diStartRow
);
}
}
if
(
pNewPara
->
member
.
para
.
nFlags
&
MEPF_ROWSTART
)
if
(
new_para
->
nFlags
&
MEPF_ROWSTART
)
{
{
/* Brought into a table row */
/* Brought into a table row */
ME_DisplayItem
*
cell
=
ME_FindItemFwd
(
pNewPara
,
diCell
);
ME_Cell
*
cell
=
table_row_first_cell
(
new_para
);
while
(
cell
->
member
.
cell
.
next_cell
&&
while
(
cell_next
(
cell
)
&&
x
>=
cell_next
(
cell
)
->
pt
.
x
)
x
>=
cell
->
member
.
cell
.
next_cell
->
member
.
cell
.
pt
.
x
)
cell
=
cell_next
(
cell
);
cell
=
cell
->
member
.
cell
.
next_cell
;
pItem
=
ME_FindItemFwd
(
cell_get_di
(
cell
),
diStartRow
);
pItem
=
ME_FindItemFwd
(
cell
,
diStartRow
);
}
}
}
}
if
(
!
pItem
)
if
(
!
pItem
)
...
...
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