Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d39801be
Commit
d39801be
authored
Aug 29, 2012
by
Erich Hoover
Committed by
Alexandre Julliard
Aug 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hhctrl.ocx: Create a special structure for holding non-const unicode strings.
parent
1af16011
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
39 deletions
+47
-39
chm.c
dlls/hhctrl.ocx/chm.c
+13
-13
help.c
dlls/hhctrl.ocx/help.c
+16
-12
hhctrl.c
dlls/hhctrl.ocx/hhctrl.c
+2
-2
hhctrl.h
dlls/hhctrl.ocx/hhctrl.h
+16
-12
No files found.
dlls/hhctrl.ocx/chm.c
View file @
d39801be
...
...
@@ -283,16 +283,16 @@ void MergeChmProperties(HH_WINTYPEW *src, HHInfo *info)
* modified by the user. rcHTML and rcMinSize are not currently supported, so don't bother to copy them.
*/
dst
->
pszType
=
MergeChmString
(
src
->
pszType
,
&
info
->
pszType
);
dst
->
pszFile
=
MergeChmString
(
src
->
pszFile
,
&
info
->
pszFile
);
dst
->
pszToc
=
MergeChmString
(
src
->
pszToc
,
&
info
->
pszToc
);
dst
->
pszIndex
=
MergeChmString
(
src
->
pszIndex
,
&
info
->
pszIndex
);
dst
->
pszCaption
=
MergeChmString
(
src
->
pszCaption
,
&
info
->
pszCaption
);
dst
->
pszHome
=
MergeChmString
(
src
->
pszHome
,
&
info
->
pszHome
);
dst
->
pszJump1
=
MergeChmString
(
src
->
pszJump1
,
&
info
->
pszJump1
);
dst
->
pszJump2
=
MergeChmString
(
src
->
pszJump2
,
&
info
->
pszJump2
);
dst
->
pszUrlJump1
=
MergeChmString
(
src
->
pszUrlJump1
,
&
info
->
pszUrlJump1
);
dst
->
pszUrlJump2
=
MergeChmString
(
src
->
pszUrlJump2
,
&
info
->
pszUrlJump2
);
dst
->
pszType
=
MergeChmString
(
src
->
pszType
,
&
info
->
stringsW
.
pszType
);
dst
->
pszFile
=
MergeChmString
(
src
->
pszFile
,
&
info
->
stringsW
.
pszFile
);
dst
->
pszToc
=
MergeChmString
(
src
->
pszToc
,
&
info
->
stringsW
.
pszToc
);
dst
->
pszIndex
=
MergeChmString
(
src
->
pszIndex
,
&
info
->
stringsW
.
pszIndex
);
dst
->
pszCaption
=
MergeChmString
(
src
->
pszCaption
,
&
info
->
stringsW
.
pszCaption
);
dst
->
pszHome
=
MergeChmString
(
src
->
pszHome
,
&
info
->
stringsW
.
pszHome
);
dst
->
pszJump1
=
MergeChmString
(
src
->
pszJump1
,
&
info
->
stringsW
.
pszJump1
);
dst
->
pszJump2
=
MergeChmString
(
src
->
pszJump2
,
&
info
->
stringsW
.
pszJump2
);
dst
->
pszUrlJump1
=
MergeChmString
(
src
->
pszUrlJump1
,
&
info
->
stringsW
.
pszUrlJump1
);
dst
->
pszUrlJump2
=
MergeChmString
(
src
->
pszUrlJump2
,
&
info
->
stringsW
.
pszUrlJump2
);
/* FIXME: pszCustomTabs is a list of multiple zero-terminated strings so ReadString won't
* work in this case
...
...
@@ -381,11 +381,11 @@ BOOL LoadWinTypeFromCHM(HHInfo *info)
/* merge the new data with any pre-existing HH_WINTYPE structure */
MergeChmProperties
(
&
wintype
,
info
);
if
(
!
info
->
WinType
.
pszFile
)
info
->
WinType
.
pszFile
=
info
->
pszFile
=
strdupW
(
info
->
pCHMInfo
->
defTopic
?
info
->
pCHMInfo
->
defTopic
:
null
);
info
->
WinType
.
pszFile
=
info
->
stringsW
.
pszFile
=
strdupW
(
info
->
pCHMInfo
->
defTopic
?
info
->
pCHMInfo
->
defTopic
:
null
);
if
(
!
info
->
WinType
.
pszToc
)
info
->
WinType
.
pszToc
=
info
->
pszToc
=
FindHTMLHelpSetting
(
info
,
toc_extW
);
info
->
WinType
.
pszToc
=
info
->
stringsW
.
pszToc
=
FindHTMLHelpSetting
(
info
,
toc_extW
);
if
(
!
info
->
WinType
.
pszIndex
)
info
->
WinType
.
pszIndex
=
info
->
pszIndex
=
FindHTMLHelpSetting
(
info
,
index_extW
);
info
->
WinType
.
pszIndex
=
info
->
stringsW
.
pszIndex
=
FindHTMLHelpSetting
(
info
,
index_extW
);
heap_free
(
pszType
);
heap_free
(
pszFile
);
...
...
dlls/hhctrl.ocx/help.c
View file @
d39801be
...
...
@@ -278,7 +278,7 @@ static void DoSync(HHInfo *info)
}
/* If we're not currently viewing a page in the active .chm file, abort */
if
((
!
AppendFullPathURL
(
info
->
pszFile
,
buf
,
NULL
))
||
(
len
=
lstrlenW
(
buf
)
>
lstrlenW
(
url
)))
if
((
!
AppendFullPathURL
(
info
->
WinType
.
pszFile
,
buf
,
NULL
))
||
(
len
=
lstrlenW
(
buf
)
>
lstrlenW
(
url
)))
{
SysFreeString
(
url
);
return
;
...
...
@@ -1742,6 +1742,20 @@ static BOOL CreateViewer(HHInfo *pHHInfo)
return
TRUE
;
}
void
wintype_stringsW_free
(
struct
wintype_stringsW
*
stringsW
)
{
heap_free
(
stringsW
->
pszType
);
heap_free
(
stringsW
->
pszCaption
);
heap_free
(
stringsW
->
pszToc
);
heap_free
(
stringsW
->
pszIndex
);
heap_free
(
stringsW
->
pszFile
);
heap_free
(
stringsW
->
pszHome
);
heap_free
(
stringsW
->
pszJump1
);
heap_free
(
stringsW
->
pszJump2
);
heap_free
(
stringsW
->
pszUrlJump1
);
heap_free
(
stringsW
->
pszUrlJump2
);
}
void
ReleaseHelpViewer
(
HHInfo
*
info
)
{
TRACE
(
"(%p)
\n
"
,
info
);
...
...
@@ -1751,17 +1765,7 @@ void ReleaseHelpViewer(HHInfo *info)
list_remove
(
&
info
->
entry
);
/* Free allocated strings */
heap_free
(
info
->
pszType
);
heap_free
(
info
->
pszCaption
);
heap_free
(
info
->
pszToc
);
heap_free
(
info
->
pszIndex
);
heap_free
(
info
->
pszFile
);
heap_free
(
info
->
pszHome
);
heap_free
(
info
->
pszJump1
);
heap_free
(
info
->
pszJump2
);
heap_free
(
info
->
pszUrlJump1
);
heap_free
(
info
->
pszUrlJump2
);
wintype_stringsW_free
(
&
info
->
stringsW
);
if
(
info
->
pCHMInfo
)
CloseCHM
(
info
->
pCHMInfo
);
...
...
dlls/hhctrl.ocx/hhctrl.c
View file @
d39801be
...
...
@@ -191,8 +191,8 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
if
(
!
index
)
index
=
info
->
WinType
.
pszFile
;
if
(
!
info
->
pszType
)
info
->
WinType
.
pszType
=
info
->
pszType
=
window
;
if
(
!
info
->
WinType
.
pszType
)
info
->
WinType
.
pszType
=
info
->
stringsW
.
pszType
=
window
;
else
heap_free
(
window
);
...
...
dlls/hhctrl.ocx/hhctrl.h
View file @
d39801be
...
...
@@ -140,6 +140,20 @@ typedef struct {
HIMAGELIST
hImageList
;
}
ContentsTab
;
struct
wintype_stringsW
{
WCHAR
*
pszType
;
WCHAR
*
pszCaption
;
WCHAR
*
pszToc
;
WCHAR
*
pszIndex
;
WCHAR
*
pszFile
;
WCHAR
*
pszHome
;
WCHAR
*
pszJump1
;
WCHAR
*
pszJump2
;
WCHAR
*
pszUrlJump1
;
WCHAR
*
pszUrlJump2
;
WCHAR
*
pszCustomTabs
;
};
typedef
struct
{
IOleClientSite
*
client_site
;
IWebBrowser2
*
web_browser
;
...
...
@@ -147,17 +161,7 @@ typedef struct {
HH_WINTYPEW
WinType
;
LPWSTR
pszType
;
LPWSTR
pszCaption
;
LPWSTR
pszToc
;
LPWSTR
pszIndex
;
LPWSTR
pszFile
;
LPWSTR
pszHome
;
LPWSTR
pszJump1
;
LPWSTR
pszJump2
;
LPWSTR
pszUrlJump1
;
LPWSTR
pszUrlJump2
;
LPWSTR
pszCustomTabs
;
struct
wintype_stringsW
stringsW
;
struct
list
entry
;
CHMInfo
*
pCHMInfo
;
...
...
@@ -204,7 +208,7 @@ void InitSearch(HHInfo *info, const char *needle) DECLSPEC_HIDDEN;
void
ReleaseSearch
(
HHInfo
*
info
)
DECLSPEC_HIDDEN
;
LPCWSTR
skip_schema
(
LPCWSTR
url
)
DECLSPEC_HIDDEN
;
void
wintype_stringsW_free
(
struct
wintype_stringsW
*
stringsW
)
DECLSPEC_HIDDEN
;
WCHAR
*
decode_html
(
const
char
*
html_fragment
,
int
html_fragment_len
,
UINT
code_page
);
/* memory allocation functions */
...
...
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