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
872a2ad0
Commit
872a2ad0
authored
Feb 05, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Feb 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Pass a character ptr and length to SplitParagraph.
parent
6af92365
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
23 deletions
+19
-23
caret.c
dlls/riched20/caret.c
+6
-7
editor.h
dlls/riched20/editor.h
+1
-1
para.c
dlls/riched20/para.c
+6
-4
table.c
dlls/riched20/table.c
+5
-8
undo.c
dlls/riched20/undo.c
+1
-3
No files found.
dlls/riched20/caret.c
View file @
872a2ad0
...
...
@@ -558,13 +558,12 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
WCHAR
space
=
' '
;
ME_InternalInsertTextFromCursor
(
editor
,
nCursor
,
&
space
,
1
,
style
,
0
);
}
else
{
ME_String
*
eol_
str
;
const
WCHAR
cr
=
'\r'
,
*
eol_str
=
str
;
if
(
!
editor
->
bEmulateVersion10
)
{
WCHAR
cr
=
'\r'
;
eol_str
=
ME_MakeStringN
(
&
cr
,
1
);
}
else
{
eol_str
=
ME_MakeStringN
(
str
,
eol_len
);
if
(
!
editor
->
bEmulateVersion10
)
{
eol_str
=
&
cr
;
eol_len
=
1
;
}
p
=
&
editor
->
pCursors
[
nCursor
];
...
...
@@ -572,7 +571,7 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
ME_SplitRunSimple
(
editor
,
p
);
tmp_style
=
ME_GetInsertStyle
(
editor
,
nCursor
);
/* ME_SplitParagraph increases style refcount */
tp
=
ME_SplitParagraph
(
editor
,
p
->
pRun
,
p
->
pRun
->
member
.
run
.
style
,
eol_str
,
0
);
tp
=
ME_SplitParagraph
(
editor
,
p
->
pRun
,
p
->
pRun
->
member
.
run
.
style
,
eol_str
,
eol_len
,
0
);
p
->
pRun
=
ME_FindItemFwd
(
tp
,
diRun
);
p
->
pPara
=
tp
;
end_run
=
ME_FindItemBack
(
tp
,
diRun
);
...
...
dlls/riched20/editor.h
View file @
872a2ad0
...
...
@@ -202,7 +202,7 @@ void ME_SendRequestResize(ME_TextEditor *editor, BOOL force) DECLSPEC_HIDDEN;
ME_DisplayItem
*
ME_GetParagraph
(
ME_DisplayItem
*
run
)
DECLSPEC_HIDDEN
;
void
ME_GetSelectionParas
(
ME_TextEditor
*
editor
,
ME_DisplayItem
**
para
,
ME_DisplayItem
**
para_end
)
DECLSPEC_HIDDEN
;
void
ME_MakeFirstParagraph
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
ME_DisplayItem
*
ME_SplitParagraph
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
rp
,
ME_Style
*
style
,
ME_String
*
eol_str
,
int
paraFlags
)
DECLSPEC_HIDDEN
;
ME_DisplayItem
*
ME_SplitParagraph
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
rp
,
ME_Style
*
style
,
const
WCHAR
*
eol_str
,
int
eol_len
,
int
paraFlags
)
DECLSPEC_HIDDEN
;
ME_DisplayItem
*
ME_JoinParagraphs
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
tp
,
BOOL
keepFirstParaFormat
)
DECLSPEC_HIDDEN
;
void
ME_DumpParaStyle
(
ME_Paragraph
*
s
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/para.c
View file @
872a2ad0
...
...
@@ -192,7 +192,7 @@ static BOOL ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const
/* split paragraph at the beginning of the run */
ME_DisplayItem
*
ME_SplitParagraph
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
run
,
ME_Style
*
style
,
ME_String
*
eol_str
,
ME_Style
*
style
,
const
WCHAR
*
eol_str
,
int
eol_len
,
int
paraFlags
)
{
ME_DisplayItem
*
next_para
=
NULL
;
...
...
@@ -202,6 +202,7 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run,
int
ofs
,
i
;
ME_DisplayItem
*
pp
;
int
run_flags
=
MERF_ENDPARA
;
ME_String
*
str
;
if
(
!
editor
->
bEmulateVersion10
)
{
/* v4.1 */
/* At most 1 of MEPF_CELL, MEPF_ROWSTART, or MEPF_ROWEND should be set. */
...
...
@@ -218,7 +219,8 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run,
run_para
=
ME_GetParagraph
(
run
);
assert
(
run_para
->
member
.
para
.
pFmt
->
cbSize
==
sizeof
(
PARAFORMAT2
));
end_run
=
ME_MakeRun
(
style
,
eol_str
,
run_flags
);
str
=
ME_MakeStringN
(
eol_str
,
eol_len
);
end_run
=
ME_MakeRun
(
style
,
str
,
run_flags
);
ofs
=
end_run
->
member
.
run
.
nCharOfs
=
run
->
member
.
run
.
nCharOfs
;
end_run
->
member
.
run
.
para
=
run
->
member
.
run
.
para
;
...
...
@@ -244,7 +246,7 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run,
pp
=
ME_FindItemFwd
(
pp
,
diRunOrParagraphOrEnd
);
}
new_para
->
member
.
para
.
nCharOfs
=
run_para
->
member
.
para
.
nCharOfs
+
ofs
;
new_para
->
member
.
para
.
nCharOfs
+=
eol_
str
->
nL
en
;
new_para
->
member
.
para
.
nCharOfs
+=
eol_
l
en
;
new_para
->
member
.
para
.
nFlags
=
MEPF_REWRAP
;
/* FIXME initialize format style and call ME_SetParaFormat blah blah */
...
...
@@ -311,7 +313,7 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run,
new_para
->
member
.
para
.
prev_para
->
member
.
para
.
nFlags
|=
MEPF_REWRAP
;
/* we've added the end run, so we need to modify nCharOfs in the next paragraphs */
ME_PropagateCharOffset
(
next_para
,
eol_
str
->
nL
en
);
ME_PropagateCharOffset
(
next_para
,
eol_
l
en
);
editor
->
nParagraphs
++
;
return
new_para
;
...
...
dlls/riched20/table.c
View file @
872a2ad0
...
...
@@ -58,7 +58,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit_lists);
static
ME_DisplayItem
*
ME_InsertEndParaFromCursor
(
ME_TextEditor
*
editor
,
int
nCursor
,
ME_String
*
eol_str
,
const
WCHAR
*
eol_str
,
int
eol_len
,
int
paraFlags
)
{
ME_Style
*
pStyle
=
ME_GetInsertStyle
(
editor
,
nCursor
);
...
...
@@ -67,7 +67,7 @@ static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor,
if
(
cursor
->
nOffset
)
ME_SplitRunSimple
(
editor
,
cursor
);
tp
=
ME_SplitParagraph
(
editor
,
cursor
->
pRun
,
pStyle
,
eol_str
,
paraFlags
);
tp
=
ME_SplitParagraph
(
editor
,
cursor
->
pRun
,
pStyle
,
eol_str
,
eol_len
,
paraFlags
);
ME_ReleaseStyle
(
pStyle
);
cursor
->
pPara
=
tp
;
cursor
->
pRun
=
ME_FindItemFwd
(
tp
,
diRun
);
...
...
@@ -78,8 +78,7 @@ ME_DisplayItem* ME_InsertTableRowStartFromCursor(ME_TextEditor *editor)
{
ME_DisplayItem
*
para
;
WCHAR
cr_lf
[]
=
{
'\r'
,
'\n'
,
0
};
ME_String
*
eol_str
=
ME_MakeStringN
(
cr_lf
,
2
);
para
=
ME_InsertEndParaFromCursor
(
editor
,
0
,
eol_str
,
MEPF_ROWSTART
);
para
=
ME_InsertEndParaFromCursor
(
editor
,
0
,
cr_lf
,
2
,
MEPF_ROWSTART
);
return
para
->
member
.
para
.
prev_para
;
}
...
...
@@ -122,8 +121,7 @@ ME_DisplayItem* ME_InsertTableCellFromCursor(ME_TextEditor *editor)
{
ME_DisplayItem
*
para
;
WCHAR
tab
=
'\t'
;
ME_String
*
eol_str
=
ME_MakeStringN
(
&
tab
,
1
);
para
=
ME_InsertEndParaFromCursor
(
editor
,
0
,
eol_str
,
MEPF_CELL
);
para
=
ME_InsertEndParaFromCursor
(
editor
,
0
,
&
tab
,
1
,
MEPF_CELL
);
return
para
;
}
...
...
@@ -131,8 +129,7 @@ ME_DisplayItem* ME_InsertTableRowEndFromCursor(ME_TextEditor *editor)
{
ME_DisplayItem
*
para
;
WCHAR
cr_lf
[]
=
{
'\r'
,
'\n'
,
0
};
ME_String
*
eol_str
=
ME_MakeStringN
(
cr_lf
,
2
);
para
=
ME_InsertEndParaFromCursor
(
editor
,
0
,
eol_str
,
MEPF_ROWEND
);
para
=
ME_InsertEndParaFromCursor
(
editor
,
0
,
cr_lf
,
2
,
MEPF_ROWEND
);
return
para
->
member
.
para
.
prev_para
;
}
...
...
dlls/riched20/undo.c
View file @
872a2ad0
...
...
@@ -394,9 +394,7 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, struct undo_item *undo)
this_para
->
member
.
para
.
nFlags
&=
~
MEPF_ROWSTART
;
}
new_para
=
ME_SplitParagraph
(
editor
,
tmp
.
pRun
,
tmp
.
pRun
->
member
.
run
.
style
,
undo
->
u
.
split_para
.
eol_str
,
paraFlags
);
/* ME_SplitParagraph owns eol_str */
undo
->
u
.
split_para
.
eol_str
=
NULL
;
undo
->
u
.
split_para
.
eol_str
->
szData
,
undo
->
u
.
split_para
.
eol_str
->
nLen
,
paraFlags
);
if
(
bFixRowStart
)
new_para
->
member
.
para
.
nFlags
|=
MEPF_ROWSTART
;
*
new_para
->
member
.
para
.
pFmt
=
undo
->
u
.
split_para
.
fmt
;
...
...
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