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
50c8fe45
Commit
50c8fe45
authored
Nov 02, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Nov 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use paragraph ptrs in the WM_CHAR handler.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
356ad03f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
22 deletions
+24
-22
editor.c
dlls/riched20/editor.c
+24
-22
No files found.
dlls/riched20/editor.c
View file @
50c8fe45
...
...
@@ -897,13 +897,13 @@ void ME_RTFTblAttrHook(RTF_Info *info)
if
(
cellNum
>=
MAX_TABLE_CELLS
)
break
;
info
->
tableDef
->
cells
[
cellNum
].
rightBoundary
=
info
->
rtfParam
;
if
(
cellNum
<
MAX_TAB_STOPS
)
{
if
(
cellNum
<
MAX_TAB_STOPS
)
{
/* Tab stops were used to store cell positions before v4.1 but v4.1
* still seems to set the tabstops without using them. */
ME_DisplayItem
*
para
=
info
->
editor
->
pCursors
[
0
].
pPara
;
PARAFORMAT2
*
pFmt
=
&
para
->
member
.
para
.
fmt
;
pFmt
->
rgxTabs
[
cellNum
]
&=
~
0x00FFFFFF
;
pFmt
->
rgxTabs
[
cellNum
]
|=
0x00FFFFFF
&
info
->
rtfParam
;
PARAFORMAT2
*
fmt
=
&
info
->
editor
->
pCursors
[
0
].
pPara
->
member
.
para
.
fmt
;
fmt
->
rgxTabs
[
cellNum
]
&=
~
0x00FFFFFF
;
fmt
->
rgxTabs
[
cellNum
]
|=
0x00FFFFFF
&
info
->
rtfParam
;
}
info
->
tableDef
->
numCellsDefined
++
;
break
;
...
...
@@ -2795,7 +2795,7 @@ static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode,
if
((
unsigned
)
wstr
>=
' '
||
wstr
==
'\t'
)
{
ME_Cursor
cursor
=
editor
->
pCursors
[
0
];
ME_
DisplayItem
*
para
=
cursor
.
pP
ara
;
ME_
Paragraph
*
para
=
&
cursor
.
pPara
->
member
.
p
ara
;
int
from
,
to
;
BOOL
ctrl_is_down
=
GetKeyState
(
VK_CONTROL
)
&
0x8000
;
ME_GetSelectionOfs
(
editor
,
&
from
,
&
to
);
...
...
@@ -2803,38 +2803,40 @@ static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode,
/* v4.1 allows tabs to be inserted with ctrl key down */
!
(
ctrl_is_down
&&
!
editor
->
bEmulateVersion10
))
{
ME_DisplayItem
*
para
;
BOOL
selected_row
=
FALSE
;
para
=
cursor
.
pPara
;
if
(
ME_IsSelection
(
editor
)
&&
cursor
.
pRun
->
member
.
run
.
nCharOfs
+
cursor
.
nOffset
==
0
&&
to
==
ME_GetCursorOfs
(
&
editor
->
pCursors
[
0
])
&&
para
->
member
.
para
.
prev_para
->
type
==
diParagraph
)
to
==
ME_GetCursorOfs
(
&
editor
->
pCursors
[
0
])
&&
para_prev
(
para
))
{
para
=
para
->
member
.
para
.
prev_para
;
para
=
para
_prev
(
para
)
;
selected_row
=
TRUE
;
}
if
(
ME_IsInTable
(
para
))
if
(
para_in_table
(
para
))
{
table_handle_tab
(
editor
,
selected_row
);
ME_CommitUndo
(
editor
);
return
0
;
}
}
else
if
(
!
editor
->
bEmulateVersion10
)
{
/* v4.1 */
if
(
para
->
member
.
para
.
nFlags
&
MEPF_ROWEND
)
{
if
(
from
==
to
)
{
para
=
para
->
member
.
para
.
next_para
;
if
(
para
->
member
.
para
.
nFlags
&
MEPF_ROWSTART
)
para
=
para
->
member
.
para
.
next_para
;
editor
->
pCursors
[
0
].
pPara
=
para
;
editor
->
pCursors
[
0
].
pRun
=
ME_FindItemFwd
(
para
,
diRun
);
}
else
if
(
!
editor
->
bEmulateVersion10
)
/* v4.1 */
{
if
(
para
->
nFlags
&
MEPF_ROWEND
)
{
if
(
from
==
to
)
{
para
=
para_next
(
para
);
if
(
para
->
nFlags
&
MEPF_ROWSTART
)
para
=
para_next
(
para
);
editor
->
pCursors
[
0
].
pPara
=
para_get_di
(
para
);
editor
->
pCursors
[
0
].
pRun
=
run_get_di
(
para_first_run
(
para
)
);
editor
->
pCursors
[
0
].
nOffset
=
0
;
editor
->
pCursors
[
1
]
=
editor
->
pCursors
[
0
];
}
}
}
else
{
/* v1.0 - 3.0 */
if
(
ME_IsInTable
(
cursor
.
pRun
)
&&
}
else
/* v1.0 - 3.0 */
{
if
(
para_in_table
(
para
)
&&
cursor
.
pRun
->
member
.
run
.
nFlags
&
MERF_ENDPARA
&&
from
==
to
)
{
...
...
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