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
42b0c6ea
Commit
42b0c6ea
authored
Feb 14, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Feb 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Make it possible to perform point -> char conversion while holding a context.
parent
530c546a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
10 deletions
+24
-10
editor.h
dlls/riched20/editor.h
+1
-0
run.c
dlls/riched20/run.c
+23
-10
No files found.
dlls/riched20/editor.h
View file @
42b0c6ea
...
...
@@ -142,6 +142,7 @@ void ME_CheckCharOffsets(ME_TextEditor *editor) DECLSPEC_HIDDEN;
void
ME_PropagateCharOffset
(
ME_DisplayItem
*
p
,
int
shift
)
DECLSPEC_HIDDEN
;
/* this one accounts for 1/2 char tolerance */
int
ME_CharFromPointCursor
(
ME_TextEditor
*
editor
,
int
cx
,
ME_Run
*
run
)
DECLSPEC_HIDDEN
;
int
ME_PointFromCharContext
(
ME_Context
*
c
,
ME_Run
*
pRun
,
int
nOffset
)
DECLSPEC_HIDDEN
;
int
ME_PointFromChar
(
ME_TextEditor
*
editor
,
ME_Run
*
pRun
,
int
nOffset
)
DECLSPEC_HIDDEN
;
int
ME_CanJoinRuns
(
const
ME_Run
*
run1
,
const
ME_Run
*
run2
)
DECLSPEC_HIDDEN
;
void
ME_JoinRuns
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
p
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/run.c
View file @
42b0c6ea
...
...
@@ -487,44 +487,57 @@ static void ME_GetTextExtent(ME_Context *c, LPCWSTR szText, int nChars, ME_Style
}
/******************************************************************************
* ME_PointFromChar
* ME_PointFromChar
Context
*
* Returns a run-relative pixel position given a run-relative character
* position (character offset)
*/
int
ME_PointFromChar
(
ME_TextEditor
*
editor
,
ME_Run
*
pRun
,
int
nOffset
)
int
ME_PointFromChar
Context
(
ME_Context
*
c
,
ME_Run
*
pRun
,
int
nOffset
)
{
SIZE
size
;
ME_Context
c
;
ME_String
*
mask_text
=
NULL
;
WCHAR
*
str
;
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
));
if
(
pRun
->
nFlags
&
MERF_GRAPHICS
)
{
if
(
nOffset
)
ME_GetOLEObjectSize
(
&
c
,
pRun
,
&
size
);
ME_DestroyContext
(
&
c
);
ME_GetOLEObjectSize
(
c
,
pRun
,
&
size
);
return
nOffset
!=
0
;
}
else
if
(
pRun
->
nFlags
&
MERF_ENDPARA
)
{
nOffset
=
0
;
}
if
(
editor
->
cPasswordMask
)
if
(
c
->
editor
->
cPasswordMask
)
{
mask_text
=
ME_MakeStringR
(
editor
->
cPasswordMask
,
pRun
->
len
);
mask_text
=
ME_MakeStringR
(
c
->
editor
->
cPasswordMask
,
pRun
->
len
);
str
=
mask_text
->
szData
;
}
else
str
=
get_text
(
pRun
,
0
);
ME_GetTextExtent
(
&
c
,
str
,
nOffset
,
pRun
->
style
,
&
size
);
ME_DestroyContext
(
&
c
);
ME_GetTextExtent
(
c
,
str
,
nOffset
,
pRun
->
style
,
&
size
);
ME_DestroyString
(
mask_text
);
return
size
.
cx
;
}
/******************************************************************************
* ME_PointFromChar
*
* Calls ME_PointFromCharContext after first creating a context.
*/
int
ME_PointFromChar
(
ME_TextEditor
*
editor
,
ME_Run
*
pRun
,
int
nOffset
)
{
ME_Context
c
;
int
ret
;
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
));
ret
=
ME_PointFromCharContext
(
&
c
,
pRun
,
nOffset
);
ME_DestroyContext
(
&
c
);
return
ret
;
}
/******************************************************************************
* ME_GetRunSizeCommon
*
* Finds width, height, ascent and descent of a run, up to given character
...
...
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