ieframe: Moved travellog to its own struct.
This commit is contained in:
parent
a792a5b486
commit
15937c99eb
|
@ -331,33 +331,33 @@ static void update_travellog(DocHost *This)
|
||||||
{
|
{
|
||||||
travellog_entry_t *new_entry;
|
travellog_entry_t *new_entry;
|
||||||
|
|
||||||
if(!This->travellog) {
|
if(!This->travellog.log) {
|
||||||
This->travellog = heap_alloc(4 * sizeof(*This->travellog));
|
This->travellog.log = heap_alloc(4 * sizeof(*This->travellog.log));
|
||||||
if(!This->travellog)
|
if(!This->travellog.log)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
This->travellog_size = 4;
|
This->travellog.size = 4;
|
||||||
}else if(This->travellog_size < This->travellog_position+1) {
|
}else if(This->travellog.size < This->travellog.position+1) {
|
||||||
travellog_entry_t *new_travellog;
|
travellog_entry_t *new_travellog;
|
||||||
|
|
||||||
new_travellog = heap_realloc(This->travellog, This->travellog_size*2*sizeof(*This->travellog));
|
new_travellog = heap_realloc(This->travellog.log, This->travellog.size*2*sizeof(*This->travellog.log));
|
||||||
if(!new_travellog)
|
if(!new_travellog)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
This->travellog = new_travellog;
|
This->travellog.log = new_travellog;
|
||||||
This->travellog_size *= 2;
|
This->travellog.size *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(This->travellog_length > This->travellog_position)
|
while(This->travellog.length > This->travellog.position)
|
||||||
heap_free(This->travellog[--This->travellog_length].url);
|
heap_free(This->travellog.log[--This->travellog.length].url);
|
||||||
|
|
||||||
new_entry = This->travellog + This->travellog_position;
|
new_entry = This->travellog.log + This->travellog.position;
|
||||||
|
|
||||||
new_entry->url = heap_strdupW(This->url);
|
new_entry->url = heap_strdupW(This->url);
|
||||||
if(!new_entry->url)
|
if(!new_entry->url)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
This->travellog_position++;
|
This->travellog.position++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_doc_view_hwnd(DocHost *This)
|
void create_doc_view_hwnd(DocHost *This)
|
||||||
|
@ -994,9 +994,9 @@ void DocHost_Release(DocHost *This)
|
||||||
|
|
||||||
ConnectionPointContainer_Destroy(&This->cps);
|
ConnectionPointContainer_Destroy(&This->cps);
|
||||||
|
|
||||||
while(This->travellog_length)
|
while(This->travellog.length)
|
||||||
heap_free(This->travellog[--This->travellog_length].url);
|
heap_free(This->travellog.log[--This->travellog.length].url);
|
||||||
heap_free(This->travellog);
|
heap_free(This->travellog.log);
|
||||||
|
|
||||||
heap_free(This->url);
|
heap_free(This->url);
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,10 +153,12 @@ struct DocHost {
|
||||||
ShellBrowser *browser_service;
|
ShellBrowser *browser_service;
|
||||||
IShellUIHelper2 *shell_ui_helper;
|
IShellUIHelper2 *shell_ui_helper;
|
||||||
|
|
||||||
travellog_entry_t *travellog;
|
struct {
|
||||||
unsigned travellog_size;
|
travellog_entry_t *log;
|
||||||
unsigned travellog_length;
|
unsigned size;
|
||||||
unsigned travellog_position;
|
unsigned length;
|
||||||
|
unsigned position;
|
||||||
|
} travellog;
|
||||||
|
|
||||||
ConnectionPointContainer cps;
|
ConnectionPointContainer cps;
|
||||||
IEHTMLWindow html_window;
|
IEHTMLWindow html_window;
|
||||||
|
|
|
@ -1063,12 +1063,12 @@ HRESULT go_back(DocHost *This)
|
||||||
WCHAR *url;
|
WCHAR *url;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
if(!This->travellog_position) {
|
if(!This->travellog.position) {
|
||||||
WARN("No history available\n");
|
WARN("No history available\n");
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
url = This->travellog[--This->travellog_position].url;
|
url = This->travellog.log[--This->travellog.position].url;
|
||||||
|
|
||||||
if(This->doc_navigate) {
|
if(This->doc_navigate) {
|
||||||
hres = async_doc_navigate(This, url, NULL, NULL, 0, FALSE);
|
hres = async_doc_navigate(This, url, NULL, NULL, 0, FALSE);
|
||||||
|
|
Loading…
Reference in New Issue