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
03036f42
Commit
03036f42
authored
Jul 13, 2023
by
Jinoh Kang
Committed by
Alexandre Julliard
Jul 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Factor out device context acquisition from ME_MakeFirstParagraph.
This lets ME_MakeEditor() reuse the device context throughout the editor initialization process.
parent
94d61d1b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
editor.c
dlls/riched20/editor.c
+5
-1
editor.h
dlls/riched20/editor.h
+1
-1
para.c
dlls/riched20/para.c
+1
-3
No files found.
dlls/riched20/editor.c
View file @
03036f42
...
...
@@ -2931,6 +2931,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
int
i
;
LONG
selbarwidth
;
HRESULT
hr
;
HDC
hdc
;
ed
->
sizeWindow
.
cx
=
ed
->
sizeWindow
.
cy
=
0
;
if
(
ITextHost_QueryInterface
(
texthost
,
&
IID_ITextHost2
,
(
void
**
)
&
ed
->
texthost
)
==
S_OK
)
...
...
@@ -2957,7 +2958,10 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
ed
->
nZoomNumerator
=
ed
->
nZoomDenominator
=
0
;
ed
->
nAvailWidth
=
0
;
/* wrap to client area */
list_init
(
&
ed
->
style_list
);
ME_MakeFirstParagraph
(
ed
);
hdc
=
ITextHost_TxGetDC
(
ed
->
texthost
);
ME_MakeFirstParagraph
(
ed
,
hdc
);
ITextHost_TxReleaseDC
(
ed
->
texthost
,
hdc
);
/* The four cursors are for:
* 0 - The position where the caret is shown
* 1 - The anchored end of the selection (for normal selection)
...
...
dlls/riched20/editor.h
View file @
03036f42
...
...
@@ -209,7 +209,7 @@ void editor_get_selection_para_fmt( ME_TextEditor *editor, PARAFORMAT2 *fmt );
void
editor_mark_rewrap_all
(
ME_TextEditor
*
editor
);
void
editor_set_default_para_fmt
(
ME_TextEditor
*
editor
,
PARAFORMAT2
*
pFmt
);
BOOL
editor_set_selection_para_fmt
(
ME_TextEditor
*
editor
,
const
PARAFORMAT2
*
fmt
);
void
ME_MakeFirstParagraph
(
ME_TextEditor
*
editor
);
void
ME_MakeFirstParagraph
(
ME_TextEditor
*
editor
,
HDC
hdc
);
void
ME_DumpParaStyle
(
ME_Paragraph
*
s
);
void
ME_DumpParaStyleToBuf
(
const
PARAFORMAT2
*
pFmt
,
char
buf
[
2048
]);
int
get_total_width
(
ME_TextEditor
*
editor
);
...
...
dlls/riched20/para.c
View file @
03036f42
...
...
@@ -148,7 +148,7 @@ ME_Row *para_end_row( ME_Paragraph *para )
return
&
item
->
member
.
row
;
}
void
ME_MakeFirstParagraph
(
ME_TextEditor
*
editor
)
void
ME_MakeFirstParagraph
(
ME_TextEditor
*
editor
,
HDC
hdc
)
{
ME_Context
c
;
CHARFORMAT2W
cf
;
...
...
@@ -160,7 +160,6 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
ME_Run
*
run
;
ME_Style
*
style
;
int
eol_len
;
HDC
hdc
=
ITextHost_TxGetDC
(
editor
->
texthost
);
ME_InitContext
(
&
c
,
editor
,
hdc
);
...
...
@@ -223,7 +222,6 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
para_mark_add
(
editor
,
para
);
ME_DestroyContext
(
&
c
);
wrap_marked_paras_dc
(
editor
,
hdc
,
FALSE
);
ITextHost_TxReleaseDC
(
editor
->
texthost
,
hdc
);
}
static
void
para_mark_rewrap_paras
(
ME_TextEditor
*
editor
,
ME_Paragraph
*
first
,
const
ME_Paragraph
*
end
)
...
...
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