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
475b45d8
Commit
475b45d8
authored
Jan 01, 2008
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Don't recreate the DC all the time, but use uniformely a ME_Context…
richedit: Don't recreate the DC all the time, but use uniformely a ME_Context structure where needed.
parent
4cecb5dc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
13 deletions
+11
-13
editor.h
dlls/riched20/editor.h
+1
-1
run.c
dlls/riched20/run.c
+9
-11
wrap.c
dlls/riched20/wrap.c
+1
-1
No files found.
dlls/riched20/editor.h
View file @
475b45d8
...
...
@@ -150,7 +150,7 @@ ME_DisplayItem *ME_InsertRunAtCursor(ME_TextEditor *editor, ME_Cursor *cursor,
void
ME_CheckCharOffsets
(
ME_TextEditor
*
editor
);
void
ME_PropagateCharOffset
(
ME_DisplayItem
*
p
,
int
shift
);
void
ME_GetGraphicsSize
(
ME_TextEditor
*
editor
,
ME_Run
*
run
,
SIZE
*
pSize
);
int
ME_CharFromPoint
(
ME_
TextEditor
*
editor
,
int
cx
,
ME_Run
*
run
);
int
ME_CharFromPoint
(
ME_
Context
*
c
,
int
cx
,
ME_Run
*
run
);
/* this one accounts for 1/2 char tolerance */
int
ME_CharFromPointCursor
(
ME_TextEditor
*
editor
,
int
cx
,
ME_Run
*
run
);
int
ME_PointFromChar
(
ME_TextEditor
*
editor
,
ME_Run
*
pRun
,
int
nOffset
);
...
...
dlls/riched20/run.c
View file @
475b45d8
...
...
@@ -487,11 +487,10 @@ void ME_GetGraphicsSize(ME_TextEditor *editor, ME_Run *run, SIZE *pSize)
* pixel horizontal position. This version rounds left (ie. if the second
* character is at pixel position 8, then for cx=0..7 it returns 0).
*/
int
ME_CharFromPoint
(
ME_
TextEditor
*
editor
,
int
cx
,
ME_Run
*
run
)
int
ME_CharFromPoint
(
ME_
Context
*
c
,
int
cx
,
ME_Run
*
run
)
{
int
fit
=
0
;
HGDIOBJ
hOldFont
;
HDC
hDC
;
SIZE
sz
;
if
(
!
run
->
strText
->
nLen
)
return
0
;
...
...
@@ -505,29 +504,28 @@ int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run)
if
(
run
->
nFlags
&
MERF_GRAPHICS
)
{
SIZE
sz
;
ME_GetGraphicsSize
(
editor
,
run
,
&
sz
);
ME_GetGraphicsSize
(
c
->
editor
,
run
,
&
sz
);
if
(
cx
<
sz
.
cx
)
return
0
;
return
1
;
}
hDC
=
GetDC
(
editor
->
hWnd
);
hOldFont
=
ME_SelectStyleFont
(
editor
,
hDC
,
run
->
style
);
hOldFont
=
ME_SelectStyleFont
(
c
->
editor
,
c
->
hDC
,
run
->
style
);
if
(
editor
->
cPasswordMask
)
if
(
c
->
editor
->
cPasswordMask
)
{
ME_String
*
strMasked
=
ME_MakeStringR
(
editor
->
cPasswordMask
,
ME_StrVLen
(
run
->
strText
));
GetTextExtentExPointW
(
hDC
,
strMasked
->
szData
,
run
->
strText
->
nLen
,
ME_String
*
strMasked
=
ME_MakeStringR
(
c
->
editor
->
cPasswordMask
,
ME_StrVLen
(
run
->
strText
));
GetTextExtentExPointW
(
c
->
hDC
,
strMasked
->
szData
,
run
->
strText
->
nLen
,
cx
,
&
fit
,
NULL
,
&
sz
);
ME_DestroyString
(
strMasked
);
}
else
{
GetTextExtentExPointW
(
hDC
,
run
->
strText
->
szData
,
run
->
strText
->
nLen
,
GetTextExtentExPointW
(
c
->
hDC
,
run
->
strText
->
szData
,
run
->
strText
->
nLen
,
cx
,
&
fit
,
NULL
,
&
sz
);
}
ME_UnselectStyleFont
(
editor
,
hDC
,
run
->
style
,
hOldFont
);
ReleaseDC
(
editor
->
hWnd
,
hDC
);
ME_UnselectStyleFont
(
c
->
editor
,
c
->
hDC
,
run
->
style
,
hOldFont
);
return
fit
;
}
...
...
dlls/riched20/wrap.c
View file @
475b45d8
...
...
@@ -168,7 +168,7 @@ static ME_DisplayItem *ME_SplitByBacktracking(ME_WrapContext *wc, ME_DisplayItem
int
i
,
idesp
,
len
;
ME_Run
*
run
=
&
p
->
member
.
run
;
idesp
=
i
=
ME_CharFromPoint
(
wc
->
context
->
editor
,
loc
,
run
);
idesp
=
i
=
ME_CharFromPoint
(
wc
->
context
,
loc
,
run
);
len
=
ME_StrVLen
(
run
->
strText
);
assert
(
len
>
0
);
assert
(
i
<
len
);
...
...
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