From 9d3c2b18c4ad5229cfb931f81be75a5978f300cd Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 16 Oct 2014 22:23:46 +0100 Subject: [PATCH] Remove some bw derefs. --- riscos/window.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/riscos/window.c b/riscos/window.c index 3f29cf449..39217560f 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -3571,19 +3571,18 @@ void ro_gui_window_toolbar_click(void *data, { gui_save_type save_type; - if (g->bw->current_content == NULL) + if (!browser_window_has_content(g->bw)) break; - hlcache_handle *h = g->bw->current_content; - if (ro_gui_shift_pressed()) save_type = GUI_SAVE_LINK_URL; else save_type = GUI_SAVE_LINK_TEXT; ro_gui_drag_save_link(save_type, - nsurl_access(hlcache_handle_get_url(h)), - content_get_title(h), g); + nsurl_access( + browser_window_get_url(g->bw)), + browser_window_get_title(g->bw), g); } break; @@ -3687,14 +3686,14 @@ void ro_gui_window_toolbar_click(void *data, break; case TOOLBAR_BUTTON_UP: - if (g->bw != NULL && g->bw->current_content != NULL) - ro_gui_window_navigate_up(g->bw->window, - nsurl_access(hlcache_handle_get_url( - g->bw->current_content))); + if (g->bw != NULL && browser_window_has_content(g->bw)) + ro_gui_window_navigate_up(g, + nsurl_access(browser_window_get_url( + g->bw))); break; case TOOLBAR_BUTTON_UP_NEW: - if (g->bw && g->bw->current_content) { + if (g->bw && browser_window_has_content(g->bw)) { hlcache_handle *h = g->bw->current_content; nserror error; @@ -3713,7 +3712,7 @@ void ro_gui_window_toolbar_click(void *data, */ ro_gui_window_navigate_up(new_bw->window, nsurl_access(hlcache_handle_get_url(h))); - } + } } break;