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
0b01b40a
Commit
0b01b40a
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: Return a run ptr from the run splitting function.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
90bb4fe3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
17 deletions
+19
-17
caret.c
dlls/riched20/caret.c
+4
-2
editor.h
dlls/riched20/editor.h
+1
-1
run.c
dlls/riched20/run.c
+8
-8
table.c
dlls/riched20/table.c
+2
-2
undo.c
dlls/riched20/undo.c
+2
-2
wrap.c
dlls/riched20/wrap.c
+2
-2
No files found.
dlls/riched20/caret.c
View file @
0b01b40a
...
...
@@ -607,7 +607,9 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
/* handle special \r\r\n sequence (richedit 2.x and higher only) */
WCHAR
space
=
' '
;
ME_InternalInsertTextFromCursor
(
editor
,
nCursor
,
&
space
,
1
,
style
,
0
);
}
else
{
}
else
{
const
WCHAR
cr
=
'\r'
,
*
eol_str
=
str
;
if
(
!
editor
->
bEmulateVersion10
)
...
...
@@ -625,7 +627,7 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
}
else
{
if
(
p
->
nOffset
)
ME_SplitRunSimple
(
editor
,
p
);
if
(
p
->
nOffset
)
run_split
(
editor
,
p
);
run
=
&
p
->
pRun
->
member
.
run
;
}
...
...
dlls/riched20/editor.h
View file @
0b01b40a
...
...
@@ -132,7 +132,7 @@ 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_
DisplayItem
*
ME_SplitRunSimple
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
)
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
,
int
startx
,
int
*
pAscent
,
int
*
pDescent
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/run.c
View file @
0b01b40a
...
...
@@ -268,12 +268,12 @@ void run_join( ME_TextEditor *editor, ME_Run *run )
}
/******************************************************************************
*
ME_SplitRunSimple
*
run_split
*
* Does the most basic job of splitting a run into two - it does not
* update the positions and extents.
*/
ME_
DisplayItem
*
ME_SplitRunSimple
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
)
ME_
Run
*
run_split
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
)
{
ME_Run
*
run
=
&
cursor
->
pRun
->
member
.
run
,
*
new_run
;
int
i
;
...
...
@@ -303,7 +303,7 @@ ME_DisplayItem *ME_SplitRunSimple( ME_TextEditor *editor, ME_Cursor *cursor )
}
}
para_mark_rewrap
(
editor
,
run
->
para
);
return
run
_get_di
(
run
)
;
return
run
;
}
/******************************************************************************
...
...
@@ -359,7 +359,7 @@ ME_InsertRunAtCursor(ME_TextEditor *editor, ME_Cursor *cursor, ME_Style *style,
}
else
{
ME_SplitRunSimple
(
editor
,
cursor
);
run_split
(
editor
,
cursor
);
insert_before
=
cursor
->
pRun
;
}
}
...
...
@@ -756,12 +756,12 @@ void ME_SetCharFormat(ME_TextEditor *editor, ME_Cursor *start, ME_Cursor *end, C
start_run
=
ME_FindItemFwd
(
start
->
pRun
,
diRun
);
else
if
(
start
->
nOffset
)
{
/*
SplitRunSimple
may or may not update the cursors, depending on whether they
/*
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_
DisplayItem
*
split_run
=
ME_SplitRunSimple
(
editor
,
start
);
ME_
Run
*
split_run
=
run_split
(
editor
,
start
);
start_run
=
start
->
pRun
;
if
(
end
&&
end
->
pR
un
==
split_run
)
if
(
end
&&
&
end
->
pRun
->
member
.
r
un
==
split_run
)
{
end
->
pRun
=
start
->
pRun
;
end
->
nOffset
-=
split_offset
;
...
...
@@ -774,7 +774,7 @@ void ME_SetCharFormat(ME_TextEditor *editor, ME_Cursor *start, ME_Cursor *end, C
end_run
=
ME_FindItemFwd
(
end
->
pRun
,
diRun
);
else
{
if
(
end
->
nOffset
)
ME_SplitRunSimple
(
editor
,
end
);
if
(
end
->
nOffset
)
run_split
(
editor
,
end
);
end_run
=
end
->
pRun
;
}
}
...
...
dlls/riched20/table.c
View file @
0b01b40a
...
...
@@ -66,8 +66,8 @@ static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor,
ME_Style
*
pStyle
=
ME_GetInsertStyle
(
editor
,
nCursor
);
ME_DisplayItem
*
tp
;
ME_Cursor
*
cursor
=
&
editor
->
pCursors
[
nCursor
];
if
(
cursor
->
nOffset
)
ME_SplitRunSimple
(
editor
,
cursor
);
if
(
cursor
->
nOffset
)
run_split
(
editor
,
cursor
);
tp
=
ME_SplitParagraph
(
editor
,
cursor
->
pRun
,
pStyle
,
eol_str
,
eol_len
,
paraFlags
);
ME_ReleaseStyle
(
pStyle
);
...
...
dlls/riched20/undo.c
View file @
0b01b40a
...
...
@@ -383,9 +383,9 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, struct undo_item *undo)
ME_DisplayItem
*
this_para
,
*
new_para
;
BOOL
bFixRowStart
;
int
paraFlags
=
undo
->
u
.
split_para
.
flags
&
(
MEPF_ROWSTART
|
MEPF_CELL
|
MEPF_ROWEND
);
ME_CursorFromCharOfs
(
editor
,
undo
->
u
.
split_para
.
pos
,
&
tmp
);
if
(
tmp
.
nOffset
)
ME_SplitRunSimple
(
editor
,
&
tmp
);
if
(
tmp
.
nOffset
)
run_split
(
editor
,
&
tmp
);
this_para
=
tmp
.
pPara
;
bFixRowStart
=
this_para
->
member
.
para
.
nFlags
&
MEPF_ROWSTART
;
if
(
bFixRowStart
)
...
...
dlls/riched20/wrap.c
View file @
0b01b40a
...
...
@@ -139,7 +139,7 @@ static ME_Run *split_run_extents( ME_WrapContext *wc, ME_Run *run, int nVChar )
TRACE
(
"Before split: %s(%d, %d)
\n
"
,
debugstr_run
(
run
),
run
->
pt
.
x
,
run
->
pt
.
y
);
ME_SplitRunSimple
(
editor
,
&
cursor
);
run_split
(
editor
,
&
cursor
);
run2
=
&
cursor
.
pRun
->
member
.
run
;
run2
->
script_analysis
=
run
->
script_analysis
;
...
...
@@ -776,7 +776,7 @@ static HRESULT itemize_para( ME_Context *c, ME_Paragraph *para )
if
(
run
->
nCharOfs
+
run
->
len
>
items
[
cur_item
+
1
].
iCharPos
)
{
ME_Cursor
cursor
=
{
para_get_di
(
para
),
run_get_di
(
run
),
items
[
cur_item
+
1
].
iCharPos
-
run
->
nCharOfs
};
ME_SplitRunSimple
(
c
->
editor
,
&
cursor
);
run_split
(
c
->
editor
,
&
cursor
);
}
}
...
...
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