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
34a4f922
Commit
34a4f922
authored
Mar 16, 2008
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Assign equivalent structures instead of copying them.
parent
a64c22c8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
para.c
dlls/riched20/para.c
+6
-6
style.c
dlls/riched20/style.c
+3
-3
undo.c
dlls/riched20/undo.c
+4
-4
No files found.
dlls/riched20/para.c
View file @
34a4f922
...
...
@@ -68,8 +68,8 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
fmt
.
dwMask
=
PFM_ALIGNMENT
|
PFM_OFFSET
|
PFM_STARTINDENT
|
PFM_RIGHTINDENT
|
PFM_TABSTOPS
;
fmt
.
wAlignment
=
PFA_LEFT
;
CopyMemory
(
para
->
member
.
para
.
pFmt
,
&
fmt
,
sizeof
(
PARAFORMAT2
))
;
*
para
->
member
.
para
.
pFmt
=
fmt
;
style
=
ME_MakeStyle
(
&
cf
);
text
->
pDefaultStyle
=
style
;
...
...
@@ -148,7 +148,7 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME
new_para
->
member
.
para
.
nFlags
=
MEPF_REWRAP
;
/* FIXME copy flags (if applicable) */
/* FIXME initialize format style and call ME_SetParaFormat blah blah */
CopyMemory
(
new_para
->
member
.
para
.
pFmt
,
run_para
->
member
.
para
.
pFmt
,
sizeof
(
PARAFORMAT2
))
;
*
new_para
->
member
.
para
.
pFmt
=
*
run_para
->
member
.
para
.
pFmt
;
new_para
->
member
.
para
.
bTable
=
run_para
->
member
.
para
.
bTable
;
...
...
@@ -226,7 +226,7 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp)
{
undo
->
nStart
=
pNext
->
member
.
para
.
nCharOfs
-
end_len
;
assert
(
pNext
->
member
.
para
.
pFmt
->
cbSize
==
sizeof
(
PARAFORMAT2
));
CopyMemory
(
undo
->
di
.
member
.
para
.
pFmt
,
pNext
->
member
.
para
.
pFmt
,
sizeof
(
PARAFORMAT2
))
;
*
undo
->
di
.
member
.
para
.
pFmt
=
*
pNext
->
member
.
para
.
pFmt
;
}
shift
=
pNext
->
member
.
para
.
nCharOfs
-
tp
->
member
.
para
.
nCharOfs
-
end_len
;
...
...
@@ -352,7 +352,7 @@ void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const PARAFOR
assert
(
sizeof
(
*
para
->
member
.
para
.
pFmt
)
==
sizeof
(
PARAFORMAT2
));
ME_AddUndoItem
(
editor
,
diUndoSetParagraphFormat
,
para
);
CopyMemory
(
&
copy
,
para
->
member
.
para
.
pFmt
,
sizeof
(
PARAFORMAT2
))
;
copy
=
*
para
->
member
.
para
.
pFmt
;
#define COPY_FIELD(m, f) \
if (pFmt->dwMask & (m)) { \
...
...
@@ -447,7 +447,7 @@ void ME_GetParaFormat(ME_TextEditor *editor, const ME_DisplayItem *para, PARAFOR
{
if
(
pFmt
->
cbSize
>=
sizeof
(
PARAFORMAT2
))
{
CopyMemory
(
pFmt
,
para
->
member
.
para
.
pFmt
,
sizeof
(
PARAFORMAT2
))
;
*
pFmt
=
*
para
->
member
.
para
.
pFmt
;
return
;
}
CopyMemory
(
pFmt
,
para
->
member
.
para
.
pFmt
,
pFmt
->
cbSize
);
...
...
dlls/riched20/style.c
View file @
34a4f922
...
...
@@ -74,7 +74,7 @@ CHARFORMAT2W *ME_ToCF2W(CHARFORMAT2W *to, CHARFORMAT2W *from)
void
ME_CopyToCF2W
(
CHARFORMAT2W
*
to
,
CHARFORMAT2W
*
from
)
{
if
(
ME_ToCF2W
(
to
,
from
)
==
from
)
CopyMemory
(
to
,
from
,
sizeof
(
*
from
))
;
*
to
=
*
from
;
}
CHARFORMAT2W
*
ME_ToCFAny
(
CHARFORMAT2W
*
to
,
CHARFORMAT2W
*
from
)
...
...
@@ -154,7 +154,7 @@ ME_Style *ME_MakeStyle(CHARFORMAT2W *style) {
if
(
style
->
cbSize
<=
sizeof
(
CHARFORMAT2W
))
CopyMemory
(
&
s
->
fmt
,
style
,
style
->
cbSize
);
else
CopyMemory
(
&
s
->
fmt
,
style
,
sizeof
(
CHARFORMAT2W
))
;
s
->
fmt
=
*
style
;
s
->
fmt
.
cbSize
=
sizeof
(
CHARFORMAT2W
);
s
->
nSequence
=
-
2
;
...
...
@@ -229,7 +229,7 @@ void ME_CopyCharFormat(CHARFORMAT2W *pDest, const CHARFORMAT2W *pSrc)
/* using this with non-2W structs is forbidden */
assert
(
pSrc
->
cbSize
==
sizeof
(
CHARFORMAT2W
));
assert
(
pDest
->
cbSize
==
sizeof
(
CHARFORMAT2W
));
CopyMemory
(
pDest
,
pSrc
,
sizeof
(
CHARFORMAT2W
))
;
*
pDest
=
*
pSrc
;
}
static
void
ME_DumpStyleEffect
(
char
**
p
,
const
char
*
name
,
const
CHARFORMAT2W
*
fmt
,
int
mask
)
...
...
dlls/riched20/undo.c
View file @
34a4f922
...
...
@@ -62,13 +62,13 @@ ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_Disp
break
;
case
diUndoSetParagraphFormat
:
assert
(
pdi
);
CopyMemory
(
&
pItem
->
member
.
para
,
&
pdi
->
member
.
para
,
sizeof
(
ME_Paragraph
))
;
pItem
->
member
.
para
=
pdi
->
member
.
para
;
pItem
->
member
.
para
.
pFmt
=
ALLOC_OBJ
(
PARAFORMAT2
);
CopyMemory
(
pItem
->
member
.
para
.
pFmt
,
pdi
->
member
.
para
.
pFmt
,
sizeof
(
PARAFORMAT2
))
;
*
pItem
->
member
.
para
.
pFmt
=
*
pdi
->
member
.
para
.
pFmt
;
break
;
case
diUndoInsertRun
:
assert
(
pdi
);
CopyMemory
(
&
pItem
->
member
.
run
,
&
pdi
->
member
.
run
,
sizeof
(
ME_Run
))
;
pItem
->
member
.
run
=
pdi
->
member
.
run
;
pItem
->
member
.
run
.
strText
=
ME_StrDup
(
pItem
->
member
.
run
.
strText
);
ME_AddRefStyle
(
pItem
->
member
.
run
.
style
);
if
(
pdi
->
member
.
run
.
ole_obj
)
...
...
@@ -227,7 +227,7 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem)
tmp
.
pRun
=
ME_SplitRunSimple
(
editor
,
tmp
.
pRun
,
tmp
.
nOffset
);
new_para
=
ME_SplitParagraph
(
editor
,
tmp
.
pRun
,
tmp
.
pRun
->
member
.
run
.
style
);
assert
(
pItem
->
member
.
para
.
pFmt
->
cbSize
==
sizeof
(
PARAFORMAT2
));
CopyMemory
(
new_para
->
member
.
para
.
pFmt
,
pItem
->
member
.
para
.
pFmt
,
sizeof
(
PARAFORMAT2
))
;
*
new_para
->
member
.
para
.
pFmt
=
*
pItem
->
member
.
para
.
pFmt
;
break
;
}
default:
...
...
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