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
f235c48c
Commit
f235c48c
authored
Feb 22, 2010
by
Dylan Smith
Committed by
Alexandre Julliard
Feb 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Avoid unnecessary deletion of hdcSized.
parent
8f191113
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
print.c
programs/wordpad/print.c
+8
-4
No files found.
programs/wordpad/print.c
View file @
f235c48c
...
...
@@ -927,16 +927,20 @@ LRESULT CALLBACK ruler_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
static
void
draw_preview_page
(
HDC
hdc
,
HDC
*
hdcSized
,
FORMATRANGE
*
lpFr
,
float
ratio
,
int
bmNewWidth
,
int
bmNewHeight
,
int
bmWidth
,
int
bmHeight
)
{
HBITMAP
hBitmapScaled
=
CreateCompatibleBitmap
(
hdc
,
bmNewWidth
,
bmNewHeight
);
HBITMAP
oldbm
;
HPEN
hPen
,
oldPen
;
int
TopMargin
=
(
int
)((
float
)
twips_to_pixels
(
lpFr
->
rc
.
top
,
GetDeviceCaps
(
hdc
,
LOGPIXELSX
))
*
ratio
);
int
BottomMargin
=
(
int
)((
float
)
twips_to_pixels
(
lpFr
->
rc
.
bottom
,
GetDeviceCaps
(
hdc
,
LOGPIXELSX
))
*
ratio
);
int
LeftMargin
=
(
int
)((
float
)
twips_to_pixels
(
lpFr
->
rc
.
left
,
GetDeviceCaps
(
hdc
,
LOGPIXELSY
))
*
ratio
);
int
RightMargin
=
(
int
)((
float
)
twips_to_pixels
(
lpFr
->
rc
.
right
,
GetDeviceCaps
(
hdc
,
LOGPIXELSY
))
*
ratio
);
if
(
*
hdcSized
)
DeleteDC
(
*
hdcSized
);
*
hdcSized
=
CreateCompatibleDC
(
hdc
);
SelectObject
(
*
hdcSized
,
hBitmapScaled
);
if
(
*
hdcSized
)
{
oldbm
=
SelectObject
(
*
hdcSized
,
hBitmapScaled
);
DeleteObject
(
oldbm
);
}
else
{
*
hdcSized
=
CreateCompatibleDC
(
hdc
);
SelectObject
(
*
hdcSized
,
hBitmapScaled
);
}
StretchBlt
(
*
hdcSized
,
0
,
0
,
bmNewWidth
,
bmNewHeight
,
hdc
,
0
,
0
,
bmWidth
,
bmHeight
,
SRCCOPY
);
...
...
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