diff --git a/editor/style.cpp b/editor/style.cpp index 45c61c6cf..8ffdd5ccf 100644 --- a/editor/style.cpp +++ b/editor/style.cpp @@ -24,10 +24,9 @@ #include #include #include -using namespace std; -string editor_style_url () +std::string editor_style_url () { return "editor/style"; } @@ -37,26 +36,24 @@ bool editor_style_acl (Webserver_Request& webserver_request) { if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ())) return true; - auto [ read, write ] = access_bible::any (webserver_request); + const auto [ read, write ] = access_bible::any (webserver_request); return read; } -string editor_style (Webserver_Request& webserver_request) +std::string editor_style (Webserver_Request& webserver_request) { if (webserver_request.query.count ("style")) { - string style = webserver_request.query["style"]; + const std::string style = webserver_request.query["style"]; Editor_Styles::recordUsage (webserver_request, style); - string action = Editor_Styles::getAction (webserver_request, style); + const std::string action = Editor_Styles::getAction (webserver_request, style); return style + "\n" + action; } - if (webserver_request.query.count ("all")) { return Editor_Styles::getAll (webserver_request); } - return Editor_Styles::getRecentlyUsed (webserver_request); } diff --git a/editor/styles.cpp b/editor/styles.cpp index c684f082f..e35f8fd83 100644 --- a/editor/styles.cpp +++ b/editor/styles.cpp @@ -94,11 +94,12 @@ std::string Editor_Styles::getAll (Webserver_Request& webserver_request) for (const auto& item : data) { const std::string& marker = item.first; std::string name = item.second; - name = translate (name); // Todo check this. + name = translate (name); Database_Styles_Item marker_data = webserver_request.database_styles()->getMarkerData (stylesheet, marker); std::string category = marker_data.category; category = styles_logic_category_text (category); const std::string line2 = marker + " " + name + " (" + category + ")"; + std::cout << line2 << std::endl; // Todo lines.push_back (""); }