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
75433bc3
Commit
75433bc3
authored
Oct 21, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Oct 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Pass a cursor ptr to the insert style retrieval function.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e69bb46c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
40 deletions
+24
-40
caret.c
dlls/riched20/caret.c
+3
-3
editor.c
dlls/riched20/editor.c
+3
-3
editor.h
dlls/riched20/editor.h
+1
-1
richole.c
dlls/riched20/richole.c
+1
-1
run.c
dlls/riched20/run.c
+1
-1
style.c
dlls/riched20/style.c
+14
-30
table.c
dlls/riched20/table.c
+1
-1
No files found.
dlls/riched20/caret.c
View file @
75433bc3
...
...
@@ -473,11 +473,11 @@ static struct re_object* create_re_object(const REOBJECT *reo)
void
ME_InsertOLEFromCursor
(
ME_TextEditor
*
editor
,
const
REOBJECT
*
reo
,
int
nCursor
)
{
ME_Style
*
style
=
ME_GetInsertStyle
(
editor
,
nCursor
);
ME_Run
*
run
,
*
prev
;
const
WCHAR
space
=
' '
;
struct
re_object
*
reobj_prev
=
NULL
;
ME_Cursor
*
cursor
=
editor
->
pCursors
+
nCursor
;
ME_Style
*
style
=
style_get_insert_style
(
editor
,
cursor
);
/* FIXME no no no */
if
(
ME_IsSelection
(
editor
))
...
...
@@ -508,9 +508,9 @@ void ME_InsertOLEFromCursor(ME_TextEditor *editor, const REOBJECT* reo, int nCur
void
ME_InsertEndRowFromCursor
(
ME_TextEditor
*
editor
,
int
nCursor
)
{
ME_Style
*
style
=
ME_GetInsertStyle
(
editor
,
nCursor
);
const
WCHAR
space
=
' '
;
ME_Cursor
*
cursor
=
editor
->
pCursors
+
nCursor
;
ME_Style
*
style
=
style_get_insert_style
(
editor
,
cursor
);
/* FIXME no no no */
if
(
ME_IsSelection
(
editor
))
...
...
@@ -1510,7 +1510,7 @@ void ME_DeleteSelection(ME_TextEditor *editor)
ME_Style
*
ME_GetSelectionInsertStyle
(
ME_TextEditor
*
editor
)
{
return
ME_GetInsertStyle
(
editor
,
0
);
return
style_get_insert_style
(
editor
,
editor
->
pCursors
);
}
void
ME_SendSelChange
(
ME_TextEditor
*
editor
)
...
...
dlls/riched20/editor.c
View file @
75433bc3
...
...
@@ -2596,7 +2596,7 @@ static BOOL handle_enter(ME_TextEditor *editor)
}
}
style
=
ME_GetInsertStyle
(
editor
,
0
);
style
=
style_get_insert_style
(
editor
,
editor
->
pCursors
);
/* Normally the new eop style is the insert style, however in a list it is copied from the existing
eop style (this prevents the list label style changing when the new eop is inserted).
...
...
@@ -2838,7 +2838,7 @@ static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode,
/* WM_CHAR is restricted to nTextLimit */
if
(
editor
->
nTextLimit
>
ME_GetTextLength
(
editor
)
-
(
to
-
from
))
{
ME_Style
*
style
=
ME_GetInsertStyle
(
editor
,
0
);
ME_Style
*
style
=
style_get_insert_style
(
editor
,
editor
->
pCursors
);
ME_ContinueCoalescingTransaction
(
editor
);
ME_InsertTextFromCursor
(
editor
,
0
,
&
wstr
,
1
,
style
);
ME_ReleaseStyle
(
style
);
...
...
@@ -4818,7 +4818,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
{
HIMC
hIMC
;
ME_Style
*
style
=
ME_GetInsertStyle
(
editor
,
0
);
ME_Style
*
style
=
style_get_insert_style
(
editor
,
editor
->
pCursors
);
hIMC
=
ITextHost_TxImmGetContext
(
editor
->
texthost
);
ME_DeleteSelection
(
editor
);
ME_SaveTempStyle
(
editor
,
style
);
...
...
dlls/riched20/editor.h
View file @
75433bc3
...
...
@@ -47,11 +47,11 @@ static inline const char *debugstr_run( const ME_Run *run )
}
/* style.c */
ME_Style
*
style_get_insert_style
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
)
DECLSPEC_HIDDEN
;
ME_Style
*
ME_MakeStyle
(
CHARFORMAT2W
*
style
)
DECLSPEC_HIDDEN
;
void
ME_AddRefStyle
(
ME_Style
*
item
)
DECLSPEC_HIDDEN
;
void
ME_DestroyStyle
(
ME_Style
*
item
)
DECLSPEC_HIDDEN
;
void
ME_ReleaseStyle
(
ME_Style
*
item
)
DECLSPEC_HIDDEN
;
ME_Style
*
ME_GetInsertStyle
(
ME_TextEditor
*
editor
,
int
nCursor
)
DECLSPEC_HIDDEN
;
ME_Style
*
ME_ApplyStyle
(
ME_TextEditor
*
ed
,
ME_Style
*
sSrc
,
CHARFORMAT2W
*
style
)
DECLSPEC_HIDDEN
;
void
select_style
(
ME_Context
*
c
,
ME_Style
*
s
)
DECLSPEC_HIDDEN
;
void
ME_InitCharFormat2W
(
CHARFORMAT2W
*
pFmt
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/richole.c
View file @
75433bc3
...
...
@@ -1697,7 +1697,7 @@ static HRESULT WINAPI ITextRange_fnSetText(ITextRange *me, BSTR str)
len
=
lstrlenW
(
str
);
cursor
=
editor
->
pCursors
[
0
];
cursor_from_char_ofs
(
editor
,
This
->
start
,
&
editor
->
pCursors
[
0
]
);
style
=
ME_GetInsertStyle
(
editor
,
0
);
style
=
style_get_insert_style
(
editor
,
editor
->
pCursors
);
ME_InsertTextFromCursor
(
editor
,
0
,
str
,
len
,
style
);
ME_ReleaseStyle
(
style
);
editor
->
pCursors
[
0
]
=
cursor
;
...
...
dlls/riched20/run.c
View file @
75433bc3
...
...
@@ -716,7 +716,7 @@ void ME_SetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt)
{
ME_Style
*
s
;
if
(
!
editor
->
pBuffer
->
pCharStyle
)
editor
->
pBuffer
->
pCharStyle
=
ME_GetInsertStyle
(
editor
,
0
);
editor
->
pBuffer
->
pCharStyle
=
style_get_insert_style
(
editor
,
editor
->
pCursors
);
s
=
ME_ApplyStyle
(
editor
,
editor
->
pBuffer
->
pCharStyle
,
pFmt
);
ME_ReleaseStyle
(
editor
->
pBuffer
->
pCharStyle
);
editor
->
pBuffer
->
pCharStyle
=
s
;
...
...
dlls/riched20/style.c
View file @
75433bc3
...
...
@@ -473,42 +473,26 @@ void ME_ReleaseStyle(ME_Style *s)
ME_DestroyStyle
(
s
);
}
ME_Style
*
ME_GetInsertStyle
(
ME_TextEditor
*
editor
,
int
nCursor
)
ME_Style
*
style_get_insert_style
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
)
{
if
(
ME_IsSelection
(
editor
))
{
ME_Style
*
style
;
ME_Cursor
*
from
,
*
to
;
ME_Run
*
prev
;
ME_GetSelection
(
editor
,
&
from
,
&
to
);
ME_AddRefStyle
(
from
->
pRun
->
member
.
run
.
style
);
return
from
->
pRun
->
member
.
run
.
style
;
}
if
(
editor
->
pBuffer
->
pCharStyle
)
{
ME_AddRefStyle
(
editor
->
pBuffer
->
pCharStyle
);
return
editor
->
pBuffer
->
pCharStyle
;
}
else
{
ME_Cursor
*
pCursor
=
&
editor
->
pCursors
[
nCursor
];
ME_DisplayItem
*
pRunItem
=
pCursor
->
pRun
;
ME_DisplayItem
*
pPrevItem
=
NULL
;
if
(
pCursor
->
nOffset
)
{
ME_Run
*
pRun
=
&
pRunItem
->
member
.
run
;
ME_AddRefStyle
(
pRun
->
style
);
return
pRun
->
style
;
}
pPrevItem
=
ME_FindItemBack
(
pRunItem
,
diRunOrParagraph
);
if
(
pPrevItem
->
type
==
diRun
)
if
(
ME_IsSelection
(
editor
))
{
ME_AddRefStyle
(
pPrevItem
->
member
.
run
.
style
);
return
pPrevItem
->
member
.
run
.
style
;
ME_GetSelection
(
editor
,
&
from
,
&
to
);
style
=
from
->
pRun
->
member
.
run
.
style
;
}
else
if
(
editor
->
pBuffer
->
pCharStyle
)
style
=
editor
->
pBuffer
->
pCharStyle
;
else
if
(
!
cursor
->
nOffset
&&
(
prev
=
run_prev
(
&
cursor
->
pRun
->
member
.
run
)))
style
=
prev
->
style
;
else
{
ME_AddRefStyle
(
pRunItem
->
member
.
run
.
style
);
return
pRunItem
->
member
.
run
.
style
;
}
}
style
=
cursor
->
pRun
->
member
.
run
.
style
;
ME_AddRefStyle
(
style
);
return
style
;
}
void
ME_SaveTempStyle
(
ME_TextEditor
*
editor
,
ME_Style
*
style
)
...
...
dlls/riched20/table.c
View file @
75433bc3
...
...
@@ -63,7 +63,7 @@ static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor,
const
WCHAR
*
eol_str
,
int
eol_len
,
int
paraFlags
)
{
ME_Style
*
pStyle
=
ME_GetInsertStyle
(
editor
,
nCursor
);
ME_Style
*
pStyle
=
style_get_insert_style
(
editor
,
editor
->
pCursors
+
nCursor
);
ME_Paragraph
*
para
;
ME_Cursor
*
cursor
=
&
editor
->
pCursors
[
nCursor
];
...
...
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