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
a02ad10f
Commit
a02ad10f
authored
Jun 20, 2012
by
Erich Hoover
Committed by
Alexandre Julliard
Jun 22, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hhctrl.ocx: Add support for the CHM code page.
parent
dc482dfe
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
11 deletions
+21
-11
chm.c
dlls/hhctrl.ocx/chm.c
+8
-0
content.c
dlls/hhctrl.ocx/content.c
+4
-4
help.c
dlls/hhctrl.ocx/help.c
+3
-3
hhctrl.h
dlls/hhctrl.ocx/hhctrl.h
+3
-1
index.c
dlls/hhctrl.ocx/index.c
+3
-3
No files found.
dlls/hhctrl.ocx/chm.c
View file @
a02ad10f
...
...
@@ -133,6 +133,13 @@ static BOOL ReadChmSystem(CHMInfo *chm)
heap_free
(
chm
->
defTitle
);
chm
->
defTitle
=
strdupnAtoW
(
buf
,
entry
.
len
);
break
;
case
0x4
:
/* TODO: Currently only the Locale ID is loaded from this field */
TRACE
(
"Locale is: %d
\n
"
,
*
(
LCID
*
)
&
buf
[
0
]);
if
(
!
GetLocaleInfoW
(
*
(
LCID
*
)
&
buf
[
0
],
LOCALE_IDEFAULTANSICODEPAGE
|
LOCALE_RETURN_NUMBER
,
(
WCHAR
*
)
&
chm
->
codePage
,
sizeof
(
chm
->
codePage
)
/
sizeof
(
WCHAR
)))
chm
->
codePage
=
CP_ACP
;
break
;
case
0x5
:
TRACE
(
"Default window is %s
\n
"
,
debugstr_an
(
buf
,
entry
.
len
));
break
;
...
...
@@ -416,6 +423,7 @@ CHMInfo *OpenCHM(LPCWSTR szFile)
if
(
!
(
ret
=
heap_alloc_zero
(
sizeof
(
CHMInfo
))))
return
NULL
;
ret
->
codePage
=
CP_ACP
;
if
(
!
(
ret
->
szFile
=
strdupW
(
szFile
)))
{
heap_free
(
ret
);
...
...
dlls/hhctrl.ocx/content.c
View file @
a02ad10f
...
...
@@ -50,7 +50,7 @@ static void free_content_item(ContentItem *item)
}
}
static
void
parse_obj_node_param
(
ContentItem
*
item
,
ContentItem
*
hhc_root
,
const
char
*
text
)
static
void
parse_obj_node_param
(
ContentItem
*
item
,
ContentItem
*
hhc_root
,
const
char
*
text
,
UINT
code_page
)
{
const
char
*
ptr
;
LPWSTR
*
param
,
merge
;
...
...
@@ -89,11 +89,11 @@ static void parse_obj_node_param(ContentItem *item, ContentItem *hhc_root, const
const
char
*
local
=
strstr
(
ptr
,
"::"
)
+
2
;
int
local_len
=
len
-
(
local
-
ptr
);
item
->
local
=
decode_html
(
local
,
local_len
);
item
->
local
=
decode_html
(
local
,
local_len
,
code_page
);
param
=
&
merge
;
}
*
param
=
decode_html
(
ptr
,
len
);
*
param
=
decode_html
(
ptr
,
len
,
code_page
);
if
(
param
==
&
merge
)
{
SetChmPath
(
&
item
->
merge
,
hhc_root
->
merge
.
chm_file
,
merge
);
...
...
@@ -151,7 +151,7 @@ static ContentItem *parse_sitemap_object(HHInfo *info, stream_t *stream, Content
if
(
!
strcasecmp
(
node_name
.
buf
,
"/object"
))
break
;
if
(
!
strcasecmp
(
node_name
.
buf
,
"param"
))
parse_obj_node_param
(
item
,
hhc_root
,
node
.
buf
);
parse_obj_node_param
(
item
,
hhc_root
,
node
.
buf
,
info
->
pCHMInfo
->
codePage
);
strbuf_zero
(
&
node
);
}
...
...
dlls/hhctrl.ocx/help.c
View file @
a02ad10f
...
...
@@ -1793,7 +1793,7 @@ static char find_html_symbol(const char *entity, int entity_len)
/*
* Decode a string containing HTML encoded characters into a unicode string.
*/
WCHAR
*
decode_html
(
const
char
*
html_fragment
,
int
html_fragment_len
)
WCHAR
*
decode_html
(
const
char
*
html_fragment
,
int
html_fragment_len
,
UINT
code_page
)
{
const
char
*
h
=
html_fragment
;
char
*
amp
,
*
sem
,
symbol
,
*
tmp
;
...
...
@@ -1850,9 +1850,9 @@ WCHAR *decode_html(const char *html_fragment, int html_fragment_len)
tmp_len
+=
len
;
tmp
[
tmp_len
++
]
=
0
;
/* NULL-terminate the string */
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
tmp
,
tmp_len
,
NULL
,
0
);
len
=
MultiByteToWideChar
(
code_page
,
0
,
tmp
,
tmp_len
,
NULL
,
0
);
unicode_text
=
heap_alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
tmp
,
tmp_len
,
unicode_text
,
len
);
MultiByteToWideChar
(
code_page
,
0
,
tmp
,
tmp_len
,
unicode_text
,
len
);
heap_free
(
tmp
);
return
unicode_text
;
}
dlls/hhctrl.ocx/hhctrl.h
View file @
a02ad10f
...
...
@@ -106,6 +106,8 @@ typedef struct CHMInfo
WCHAR
*
defTopic
;
WCHAR
*
defTitle
;
WCHAR
*
defToc
;
UINT
codePage
;
}
CHMInfo
;
#define TAB_CONTENTS 0
...
...
@@ -193,7 +195,7 @@ void ReleaseSearch(HHInfo *info) DECLSPEC_HIDDEN;
LPCWSTR
skip_schema
(
LPCWSTR
url
)
DECLSPEC_HIDDEN
;
WCHAR
*
decode_html
(
const
char
*
html_fragment
,
int
html_fragment_len
);
WCHAR
*
decode_html
(
const
char
*
html_fragment
,
int
html_fragment_len
,
UINT
code_page
);
/* memory allocation functions */
...
...
dlls/hhctrl.ocx/index.c
View file @
a02ad10f
...
...
@@ -62,7 +62,7 @@ static void fill_index_tree(HWND hwnd, IndexItem *item)
* sub-topic then there isn't really a sub-topic, the index will jump
* directly to the requested item.
*/
static
void
parse_index_obj_node_param
(
IndexItem
*
item
,
const
char
*
text
)
static
void
parse_index_obj_node_param
(
IndexItem
*
item
,
const
char
*
text
,
UINT
code_page
)
{
const
char
*
ptr
;
LPWSTR
*
param
;
...
...
@@ -109,7 +109,7 @@ static void parse_index_obj_node_param(IndexItem *item, const char *text)
return
;
}
*
param
=
decode_html
(
ptr
,
len
);
*
param
=
decode_html
(
ptr
,
len
,
code_page
);
}
/* Parse the object tag corresponding to a list item.
...
...
@@ -137,7 +137,7 @@ static IndexItem *parse_index_sitemap_object(HHInfo *info, stream_t *stream)
TRACE
(
"%s
\n
"
,
node
.
buf
);
if
(
!
strcasecmp
(
node_name
.
buf
,
"param"
))
{
parse_index_obj_node_param
(
item
,
node
.
buf
);
parse_index_obj_node_param
(
item
,
node
.
buf
,
info
->
pCHMInfo
->
codePage
);
}
else
if
(
!
strcasecmp
(
node_name
.
buf
,
"/object"
))
{
break
;
}
else
{
...
...
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