diff --git a/docs/changelog.md b/docs/changelog.md index 7a9b2ae6..ae68f8d2 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -9,6 +9,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - **Add Comment keyboard improvements (2026-03-26)**: Improved ergonomics for the Add Comment dialog while keeping the QWERTY layout — added a punctuation row, widened Space/Backspace/Clear, and increased dialog height so the entry field doesn't overlap the keyboard. Changes are localized to the comment dialog. - Files modified: `zone/dialog_zone.cc` +- **Comment keyboard font (2026-04-01)**: Set the comment keyboard button font to DejaVu Serif 48 Bold (`FONT_TIMES_48B`) to improve legibility on high-resolution displays. + - Files modified: `zone/dialog_zone.cc` + - **Remove premade employees (2026-03-25)**: Default installation no longer auto-creates premade employee accounts such as `Manager`, `Server/Cashier`, or `Server`. The system still creates `Super User` and `Editor` (Developer) via the `UserDB` constructor; `Customer` is created on-demand for SelfOrder terminals. This change applies to new installs only and does not modify existing `employee.dat` files. - Files modified: `main/data/manager.cc` @@ -19,6 +22,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - MODIFIER - Files modified: `main/business/check.hh`, `main/business/check.cc`, `zone/order_zone.cc`, `zone/dialog_zone.cc` +- **GetTextDialog key initialization (2026-04-01)**: Initialize the `key[]` array to NULL in `GetTextDialog` constructors to avoid uninitialized pointer access that could lead to crashes; guard uses of `key[i]` accordingly. + - Files modified: `zone/dialog_zone.cc` + +- **OrderEntryZone oewindow index clamp (2026-04-01)**: Clamp `page->size - 1` to the valid range before indexing `settings->oewindow` to prevent out-of-bounds access and runtime errors. + - Files modified: `zone/order_zone.cc` + ## [v25.03.1] - 2025-12-26 ### Changed diff --git a/zone/dialog_zone.cc b/zone/dialog_zone.cc index c7258035..cb0ec744 100644 --- a/zone/dialog_zone.cc +++ b/zone/dialog_zone.cc @@ -993,12 +993,18 @@ GetTextDialog::GetTextDialog() genericChar str[2]; str[1] = '\0'; + /* Ensure all key pointers are initialized to NULL to avoid + reading uninitialized memory later. */ + for (i = 0; i < 37; ++i) + key[i] = NULL; + genericChar keys[] = "1234567890QWERTYUIOPASDFGHJKLZXCVBNM"; for (i = 0; i < (int)(sizeof(keys)-1); ++i) { str[0] = keys[i]; key[i] = Button(str, str); - key[i]->color = COLOR_DK_BLUE; + if (key[i]) + key[i]->color = COLOR_DK_BLUE; } cancelkey = Button(GlobalTranslate("Cancel"), "cancel"); @@ -1027,12 +1033,17 @@ GetTextDialog::GetTextDialog(const char* msg, const char* retmsg, int mlen) genericChar str[2]; str[1] = '\0'; + /* Initialize all key pointers to NULL first. */ + for (i = 0; i < 37; ++i) + key[i] = NULL; + genericChar keys[] = "1234567890QWERTYUIOPASDFGHJKLZXCVBNM"; for (i = 0; i < (int)(sizeof(keys)-1); ++i) { str[0] = keys[i]; key[i] = Button(str, str); - key[i]->color = COLOR_DK_BLUE; + if (key[i]) + key[i]->color = COLOR_DK_BLUE; } cancelkey = Button(GlobalTranslate("Cancel"), "cancel"); @@ -3450,6 +3461,23 @@ OrderCommentDialog::OrderCommentDialog(const char* msg, const char* retmsg, int punctkey[i]->color = COLOR_DK_BLUE; } } + + // Use a larger bold serif font for the comment keyboard buttons + { + int i; + int kfont = FONT_TIMES_48B; // DejaVu Serif 48 Bold + for (i = 0; i < 37; ++i) + if (key[i]) + key[i]->font = kfont; + for (i = 0; i < 12; ++i) + if (punctkey[i]) + punctkey[i]->font = kfont; + if (clearkey) clearkey->font = kfont; + if (spacekey) spacekey->font = kfont; + if (bskey) bskey->font = kfont; + if (enterkey) enterkey->font = kfont; + if (cancelkey) cancelkey->font = kfont; + } } RenderResult OrderCommentDialog::Render(Terminal *term, int update_flag) diff --git a/zone/order_zone.cc b/zone/order_zone.cc index 6b8f00c9..fad990a9 100644 --- a/zone/order_zone.cc +++ b/zone/order_zone.cc @@ -66,14 +66,18 @@ int OrderEntryZone::RenderInit(Terminal *term, int /*update_flag*/) FnTrace("OrderEntryZone::RenderInit()"); Settings *currSettings = term->GetSettings(); - // set size & position - int size = page->size - 1; - if (currSettings->oewindow[size].IsSet()) - { - x = currSettings->oewindow[size].x; - y = currSettings->oewindow[size].y; - w = currSettings->oewindow[size].w; - h = currSettings->oewindow[size].h; + // set size & position (clamp page size index to settings array bounds) + int size_idx = page->size - 1; + if (size_idx < 0) + size_idx = 0; + if (size_idx >= 4) + size_idx = 3; + if (currSettings->oewindow[size_idx].IsSet()) + { + x = currSettings->oewindow[size_idx].x; + y = currSettings->oewindow[size_idx].y; + w = currSettings->oewindow[size_idx].w; + h = currSettings->oewindow[size_idx].h; } Check *thisCheck = term->check;