diff --git a/assets/page.cpp b/assets/page.cpp index 0993d3dd5..0d3fc9a0b 100644 --- a/assets/page.cpp +++ b/assets/page.cpp @@ -28,10 +28,9 @@ using namespace std; namespace assets_page { -string header (const string & title, void * webserver_request) +string header (const string & title, Webserver_Request& webserver_request) { - Webserver_Request * request = static_cast(webserver_request); - Assets_Header header = Assets_Header (title, *request); + Assets_Header header = Assets_Header (title, webserver_request); string page = header.run (); return page; } diff --git a/assets/page.h b/assets/page.h index c93e88710..54d06641c 100644 --- a/assets/page.h +++ b/assets/page.h @@ -21,9 +21,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include +class Webserver_Request; + namespace assets_page { -std::string header (const std::string & title, void * webserver_request); +std::string header (const std::string & title, Webserver_Request& webserver_request); std::string success (const std::string & message); std::string error (const std::string & message); std::string message (const std::string & message); diff --git a/bb/chapter.cpp b/bb/chapter.cpp index f319c78c3..8c9d10876 100644 --- a/bb/chapter.cpp +++ b/bb/chapter.cpp @@ -51,7 +51,7 @@ bool bible_chapter_acl (Webserver_Request& webserver_request) std::string bible_chapter (Webserver_Request& webserver_request) { - std::string page = assets_page::header (translate ("Chapter"), std::addressof(webserver_request)); + std::string page = assets_page::header (translate ("Chapter"), webserver_request); Assets_View view {}; diff --git a/checks/suppress.cpp b/checks/suppress.cpp index 618aa0f29..b501dc91d 100644 --- a/checks/suppress.cpp +++ b/checks/suppress.cpp @@ -52,7 +52,7 @@ string checks_suppress (Webserver_Request& webserver_request) string page {}; - page = assets_page::header (translate ("Suppressed checking results"), std::addressof(webserver_request)); + page = assets_page::header (translate ("Suppressed checking results"), webserver_request); Assets_View view {}; diff --git a/client/index.cpp b/client/index.cpp index c538c6dde..523efd9b1 100644 --- a/client/index.cpp +++ b/client/index.cpp @@ -215,7 +215,7 @@ std::string client_index (Webserver_Request& webserver_request) // Since the role of the user may change after a successful connection to the server, // the menu generation in the header should be postponed till when the actual role is known. - page = assets_page::header (translate ("Server"), std::addressof(webserver_request)); + page = assets_page::header (translate ("Server"), webserver_request); page += view.render ("client", "index"); diff --git a/index/listing.cpp b/index/listing.cpp index a325ab02a..8d8b05cda 100644 --- a/index/listing.cpp +++ b/index/listing.cpp @@ -69,7 +69,7 @@ bool index_listing_acl (Webserver_Request& webserver_request, string url) string index_listing (Webserver_Request& webserver_request, string url) { string page; - page = assets_page::header (translate ("Bibledit"), std::addressof(webserver_request)); + page = assets_page::header (translate ("Bibledit"), webserver_request); // No breadcrumbs because the user can arrive here from more than one place. Assets_View view; url = filter_url_urldecode (url); diff --git a/paratext/index.cpp b/paratext/index.cpp index 3745e5d58..87e5d6113 100644 --- a/paratext/index.cpp +++ b/paratext/index.cpp @@ -50,7 +50,7 @@ bool paratext_index_acl (Webserver_Request& webserver_request) string paratext_index (Webserver_Request& webserver_request) { string page; - page = assets_page::header (translate ("Paratext"), std::addressof(webserver_request)); + page = assets_page::header (translate ("Paratext"), webserver_request); Assets_View view; string success; string error;