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
c53b7723
Commit
c53b7723
authored
Oct 09, 2008
by
Andrey Turkin
Committed by
Alexandre Julliard
Oct 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Convert some ANSI calls to Unicode.
parent
566dcd78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
18 deletions
+7
-18
wordpad.c
programs/wordpad/wordpad.c
+7
-18
No files found.
programs/wordpad/wordpad.c
View file @
c53b7723
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include <math.h>
#include <math.h>
#include <errno.h>
#include <errno.h>
#include "wine/unicode.h"
#include "wordpad.h"
#include "wordpad.h"
#ifdef NONAMELESSUNION
#ifdef NONAMELESSUNION
...
@@ -1284,21 +1285,18 @@ static void append_current_units(LPWSTR buffer)
...
@@ -1284,21 +1285,18 @@ static void append_current_units(LPWSTR buffer)
static
void
number_with_units
(
LPWSTR
buffer
,
int
number
)
static
void
number_with_units
(
LPWSTR
buffer
,
int
number
)
{
{
float
converted
=
(
float
)
number
/
TWIPS_PER_CM
;
float
converted
=
(
float
)
number
/
TWIPS_PER_CM
;
char
string
[
MAX_STRING_LEN
]
;
static
const
WCHAR
fmt
[]
=
{
'%'
,
'.'
,
'2'
,
'f'
,
' '
,
'%'
,
's'
,
'\0'
}
;
sprintf
(
string
,
"%.2f "
,
converted
);
sprintfW
(
buffer
,
fmt
,
converted
,
units_cmW
);
lstrcatA
(
string
,
units_cmA
);
MultiByteToWideChar
(
CP_ACP
,
0
,
string
,
-
1
,
buffer
,
MAX_STRING_LEN
);
}
}
static
BOOL
get_comboexlist_selection
(
HWND
hComboEx
,
LPWSTR
wszBuffer
,
UINT
bufferLength
)
static
BOOL
get_comboexlist_selection
(
HWND
hComboEx
,
LPWSTR
wszBuffer
,
UINT
bufferLength
)
{
{
HANDLE
hHeap
;
COMBOBOXEXITEMW
cbItem
;
COMBOBOXEXITEM
cbItem
;
COMBOBOXINFO
cbInfo
;
COMBOBOXINFO
cbInfo
;
HWND
hCombo
,
hList
;
HWND
hCombo
,
hList
;
int
idx
,
result
;
int
idx
,
result
;
char
*
szBuffer
;
hCombo
=
(
HWND
)
SendMessage
(
hComboEx
,
CBEM_GETCOMBOCONTROL
,
0
,
0
);
hCombo
=
(
HWND
)
SendMessage
(
hComboEx
,
CBEM_GETCOMBOCONTROL
,
0
,
0
);
if
(
!
hCombo
)
if
(
!
hCombo
)
return
FALSE
;
return
FALSE
;
...
@@ -1311,22 +1309,13 @@ static BOOL get_comboexlist_selection(HWND hComboEx, LPWSTR wszBuffer, UINT buff
...
@@ -1311,22 +1309,13 @@ static BOOL get_comboexlist_selection(HWND hComboEx, LPWSTR wszBuffer, UINT buff
if
(
idx
<
0
)
if
(
idx
<
0
)
return
FALSE
;
return
FALSE
;
hHeap
=
GetProcessHeap
();
szBuffer
=
HeapAlloc
(
hHeap
,
HEAP_ZERO_MEMORY
,
bufferLength
);
ZeroMemory
(
&
cbItem
,
sizeof
(
cbItem
));
ZeroMemory
(
&
cbItem
,
sizeof
(
cbItem
));
cbItem
.
mask
=
CBEIF_TEXT
;
cbItem
.
mask
=
CBEIF_TEXT
;
cbItem
.
iItem
=
idx
;
cbItem
.
iItem
=
idx
;
cbItem
.
pszText
=
szBuffer
;
cbItem
.
pszText
=
w
szBuffer
;
cbItem
.
cchTextMax
=
bufferLength
-
1
;
cbItem
.
cchTextMax
=
bufferLength
-
1
;
result
=
SendMessage
(
hComboEx
,
CBEM_GETITEM
,
0
,
(
LPARAM
)
&
cbItem
);
result
=
SendMessageW
(
hComboEx
,
CBEM_GETITEM
,
0
,
(
LPARAM
)
&
cbItem
);
if
(
!
result
)
{
HeapFree
(
hHeap
,
0
,
szBuffer
);
return
FALSE
;
}
result
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szBuffer
,
-
1
,
wszBuffer
,
bufferLength
);
HeapFree
(
hHeap
,
0
,
szBuffer
);
return
result
!=
0
;
return
result
!=
0
;
}
}
...
...
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