1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:47:45 +00:00

Revert "Userland: static vs non-static constexpr variables"

This reverts commit 800ea8ea96.

Booting the system no longer worked after these changes.
This commit is contained in:
Linus Groh 2021-05-21 10:30:21 +01:00
parent 68f76b9e37
commit d60ebbbba6
38 changed files with 184 additions and 192 deletions

View file

@ -9,7 +9,6 @@
#include "GlyphMapWidget.h"
#include "NewFontDialog.h"
#include <AK/StringBuilder.h>
#include <AK/StringView.h>
#include <AK/UnicodeUtils.h>
#include <Applications/FontEditor/FontEditorWindowGML.h>
#include <LibDesktop/Launcher.h>
@ -38,19 +37,19 @@
#include <LibGfx/TextDirection.h>
#include <stdlib.h>
static constexpr int s_pangram_count = 7;
static const char* pangrams[s_pangram_count] = {
"quick fox jumps nightly above wizard",
"five quacking zephyrs jolt my wax bed",
"pack my box with five dozen liquor jugs",
"quick brown fox jumps over the lazy dog",
"waxy and quivering jocks fumble the pizza",
"~#:[@_1%]*{$2.3}/4^(5'6\")-&|7+8!=<9,0\\>?;",
"byxfjärmat föl gick på duvshowen"
};
static RefPtr<GUI::Window> create_font_preview_window(FontEditorWidget& editor)
{
constexpr int pangram_count = 7;
constexpr StringView pangrams[pangram_count] = {
"quick fox jumps nightly above wizard",
"five quacking zephyrs jolt my wax bed",
"pack my box with five dozen liquor jugs",
"quick brown fox jumps over the lazy dog",
"waxy and quivering jocks fumble the pizza",
"~#:[@_1%]*{$2.3}/4^(5'6\")-&|7+8!=<9,0\\>?;",
"byxfjärmat föl gick på duvshowen"
};
auto window = GUI::Window::construct();
window->set_window_type(GUI::WindowType::ToolWindow);
window->set_title("Font preview");
@ -95,7 +94,7 @@ static RefPtr<GUI::Window> create_font_preview_window(FontEditorWidget& editor)
reload_button.set_fixed_width(22);
reload_button.on_click = [&] {
static int i = 1;
if (i >= pangram_count)
if (i >= s_pangram_count)
i = 0;
preview_textbox.set_text(pangrams[i]);
i++;