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
132a35b8
Commit
132a35b8
authored
Mar 23, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Mar 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Don't release the dc when destroying the context.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
16a62fcd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
8 deletions
+20
-8
caret.c
dlls/riched20/caret.c
+3
-1
context.c
dlls/riched20/context.c
+0
-1
paint.c
dlls/riched20/paint.c
+0
-1
para.c
dlls/riched20/para.c
+3
-1
run.c
dlls/riched20/run.c
+6
-2
wrap.c
dlls/riched20/wrap.c
+4
-1
writer.c
dlls/riched20/writer.c
+4
-1
No files found.
dlls/riched20/caret.c
View file @
132a35b8
...
@@ -227,12 +227,13 @@ void cursor_coords( ME_TextEditor *editor, ME_Cursor *cursor,
...
@@ -227,12 +227,13 @@ void cursor_coords( ME_TextEditor *editor, ME_Cursor *cursor,
ME_Run
*
size_run
=
run
,
*
prev
;
ME_Run
*
size_run
=
run
,
*
prev
;
ME_Context
c
;
ME_Context
c
;
int
run_x
;
int
run_x
;
HDC
hdc
=
ITextHost_TxGetDC
(
editor
->
texthost
);
assert
(
~
para
->
nFlags
&
MEPF_REWRAP
);
assert
(
~
para
->
nFlags
&
MEPF_REWRAP
);
row
=
row_from_cursor
(
cursor
);
row
=
row_from_cursor
(
cursor
);
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
)
);
ME_InitContext
(
&
c
,
editor
,
hdc
);
if
(
!
cursor
->
nOffset
&&
(
prev
=
run_prev
(
run
)))
size_run
=
prev
;
if
(
!
cursor
->
nOffset
&&
(
prev
=
run_prev
(
run
)))
size_run
=
prev
;
...
@@ -243,6 +244,7 @@ void cursor_coords( ME_TextEditor *editor, ME_Cursor *cursor,
...
@@ -243,6 +244,7 @@ void cursor_coords( ME_TextEditor *editor, ME_Cursor *cursor,
*
y
=
c
.
rcView
.
top
+
para
->
pt
.
y
+
row
->
nBaseline
*
y
=
c
.
rcView
.
top
+
para
->
pt
.
y
+
row
->
nBaseline
+
run
->
pt
.
y
-
size_run
->
nAscent
-
editor
->
vert_si
.
nPos
;
+
run
->
pt
.
y
-
size_run
->
nAscent
-
editor
->
vert_si
.
nPos
;
ME_DestroyContext
(
&
c
);
ME_DestroyContext
(
&
c
);
ITextHost_TxReleaseDC
(
editor
->
texthost
,
hdc
);
return
;
return
;
}
}
...
...
dlls/riched20/context.c
View file @
132a35b8
...
@@ -44,5 +44,4 @@ void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC)
...
@@ -44,5 +44,4 @@ void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC)
void
ME_DestroyContext
(
ME_Context
*
c
)
void
ME_DestroyContext
(
ME_Context
*
c
)
{
{
select_style
(
c
,
NULL
);
select_style
(
c
,
NULL
);
if
(
c
->
hDC
)
ITextHost_TxReleaseDC
(
c
->
editor
->
texthost
,
c
->
hDC
);
}
}
dlls/riched20/paint.c
View file @
132a35b8
...
@@ -93,7 +93,6 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate)
...
@@ -93,7 +93,6 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate)
if
(
oldRgn
)
if
(
oldRgn
)
DeleteObject
(
oldRgn
);
DeleteObject
(
oldRgn
);
c
.
hDC
=
NULL
;
ME_DestroyContext
(
&
c
);
ME_DestroyContext
(
&
c
);
}
}
...
...
dlls/riched20/para.c
View file @
132a35b8
...
@@ -160,8 +160,9 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
...
@@ -160,8 +160,9 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
ME_Run
*
run
;
ME_Run
*
run
;
ME_Style
*
style
;
ME_Style
*
style
;
int
eol_len
;
int
eol_len
;
HDC
hdc
=
ITextHost_TxGetDC
(
editor
->
texthost
);
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
)
);
ME_InitContext
(
&
c
,
editor
,
hdc
);
hf
=
GetStockObject
(
SYSTEM_FONT
);
hf
=
GetStockObject
(
SYSTEM_FONT
);
assert
(
hf
);
assert
(
hf
);
...
@@ -221,6 +222,7 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
...
@@ -221,6 +222,7 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
wine_rb_init
(
&
editor
->
marked_paras
,
para_mark_compare
);
wine_rb_init
(
&
editor
->
marked_paras
,
para_mark_compare
);
para_mark_add
(
editor
,
para
);
para_mark_add
(
editor
,
para
);
ME_DestroyContext
(
&
c
);
ME_DestroyContext
(
&
c
);
ITextHost_TxReleaseDC
(
editor
->
texthost
,
hdc
);
}
}
static
void
para_mark_rewrap_paras
(
ME_TextEditor
*
editor
,
ME_Paragraph
*
first
,
const
ME_Paragraph
*
end
)
static
void
para_mark_rewrap_paras
(
ME_TextEditor
*
editor
,
ME_Paragraph
*
first
,
const
ME_Paragraph
*
end
)
...
...
dlls/riched20/run.c
View file @
132a35b8
...
@@ -571,10 +571,12 @@ int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run, BOOL closest, B
...
@@ -571,10 +571,12 @@ int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run, BOOL closest, B
{
{
ME_Context
c
;
ME_Context
c
;
int
ret
;
int
ret
;
HDC
hdc
=
ITextHost_TxGetDC
(
editor
->
texthost
);
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
)
);
ME_InitContext
(
&
c
,
editor
,
hdc
);
ret
=
ME_CharFromPointContext
(
&
c
,
cx
,
run
,
closest
,
visual_order
);
ret
=
ME_CharFromPointContext
(
&
c
,
cx
,
run
,
closest
,
visual_order
);
ME_DestroyContext
(
&
c
);
ME_DestroyContext
(
&
c
);
ITextHost_TxReleaseDC
(
editor
->
texthost
,
hdc
);
return
ret
;
return
ret
;
}
}
...
@@ -648,10 +650,12 @@ int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visu
...
@@ -648,10 +650,12 @@ int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visu
{
{
ME_Context
c
;
ME_Context
c
;
int
ret
;
int
ret
;
HDC
hdc
=
ITextHost_TxGetDC
(
editor
->
texthost
);
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
)
);
ME_InitContext
(
&
c
,
editor
,
hdc
);
ret
=
ME_PointFromCharContext
(
&
c
,
pRun
,
nOffset
,
visual_order
);
ret
=
ME_PointFromCharContext
(
&
c
,
pRun
,
nOffset
,
visual_order
);
ME_DestroyContext
(
&
c
);
ME_DestroyContext
(
&
c
);
ITextHost_TxReleaseDC
(
editor
->
texthost
,
hdc
);
return
ret
;
return
ret
;
}
}
...
...
dlls/riched20/wrap.c
View file @
132a35b8
...
@@ -1027,10 +1027,12 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
...
@@ -1027,10 +1027,12 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
ME_Context
c
;
ME_Context
c
;
int
totalWidth
=
editor
->
nTotalWidth
,
prev_width
;
int
totalWidth
=
editor
->
nTotalWidth
,
prev_width
;
struct
repaint_range
repaint
=
{
NULL
,
NULL
};
struct
repaint_range
repaint
=
{
NULL
,
NULL
};
HDC
hdc
;
if
(
!
editor
->
marked_paras
.
root
)
return
FALSE
;
if
(
!
editor
->
marked_paras
.
root
)
return
FALSE
;
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
));
hdc
=
ITextHost_TxGetDC
(
editor
->
texthost
);
ME_InitContext
(
&
c
,
editor
,
hdc
);
entry
=
wine_rb_head
(
editor
->
marked_paras
.
root
);
entry
=
wine_rb_head
(
editor
->
marked_paras
.
root
);
while
(
entry
)
while
(
entry
)
...
@@ -1085,6 +1087,7 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
...
@@ -1085,6 +1087,7 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor)
editor
->
nTotalWidth
=
totalWidth
;
editor
->
nTotalWidth
=
totalWidth
;
ME_DestroyContext
(
&
c
);
ME_DestroyContext
(
&
c
);
ITextHost_TxReleaseDC
(
editor
->
texthost
,
hdc
);
if
(
repaint
.
start
||
editor
->
nTotalLength
<
editor
->
nLastTotalLength
)
if
(
repaint
.
start
||
editor
->
nTotalLength
<
editor
->
nLastTotalLength
)
para_range_invalidate
(
editor
,
repaint
.
start
,
repaint
.
end
);
para_range_invalidate
(
editor
,
repaint
.
start
,
repaint
.
end
);
...
...
dlls/riched20/writer.c
View file @
132a35b8
...
@@ -939,11 +939,13 @@ static BOOL stream_out_graphics( ME_TextEditor *editor, ME_OutStream *stream,
...
@@ -939,11 +939,13 @@ static BOOL stream_out_graphics( ME_TextEditor *editor, ME_OutStream *stream,
UINT
size
;
UINT
size
;
SIZE
goal
,
pic
;
SIZE
goal
,
pic
;
ME_Context
c
;
ME_Context
c
;
HDC
hdc
;
hr
=
IOleObject_QueryInterface
(
run
->
reobj
->
obj
.
poleobj
,
&
IID_IDataObject
,
(
void
**
)
&
data
);
hr
=
IOleObject_QueryInterface
(
run
->
reobj
->
obj
.
poleobj
,
&
IID_IDataObject
,
(
void
**
)
&
data
);
if
(
FAILED
(
hr
))
return
FALSE
;
if
(
FAILED
(
hr
))
return
FALSE
;
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
)
);
hdc
=
ITextHost_TxGetDC
(
editor
->
texthost
);
ME_InitContext
(
&
c
,
editor
,
hdc
);
hr
=
IDataObject_QueryGetData
(
data
,
&
fmt
);
hr
=
IDataObject_QueryGetData
(
data
,
&
fmt
);
if
(
hr
!=
S_OK
)
goto
done
;
if
(
hr
!=
S_OK
)
goto
done
;
...
@@ -985,6 +987,7 @@ static BOOL stream_out_graphics( ME_TextEditor *editor, ME_OutStream *stream,
...
@@ -985,6 +987,7 @@ static BOOL stream_out_graphics( ME_TextEditor *editor, ME_OutStream *stream,
done:
done:
ME_DestroyContext
(
&
c
);
ME_DestroyContext
(
&
c
);
ITextHost_TxReleaseDC
(
editor
->
texthost
,
hdc
);
HeapFree
(
GetProcessHeap
(),
0
,
emf_bits
);
HeapFree
(
GetProcessHeap
(),
0
,
emf_bits
);
ReleaseStgMedium
(
&
med
);
ReleaseStgMedium
(
&
med
);
IDataObject_Release
(
data
);
IDataObject_Release
(
data
);
...
...
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