review induced changes

This commit is contained in:
jpirnay
2026-04-24 14:25:11 +02:00
parent 9a72409826
commit 5068817549
2 changed files with 16 additions and 10 deletions
+7 -1
View File
@@ -84,7 +84,13 @@ RecentBook RecentBooksStore::getBookByPath(const std::string& path) const {
bool RecentBooksStore::setReaderOverrides(const std::string& path, const int8_t embeddedStyleOverride,
const int8_t imageRenderingOverride) {
return setReaderOverrides(path, embeddedStyleOverride, imageRenderingOverride, -1, -1);
auto it =
std::find_if(recentBooks.begin(), recentBooks.end(), [&](const RecentBook& book) { return book.path == path; });
if (it == recentBooks.end()) {
return false;
}
return setReaderOverrides(path, embeddedStyleOverride, imageRenderingOverride, it->fontFamilyOverride,
it->fontSizeOverride);
}
bool RecentBooksStore::setReaderOverrides(const std::string& path, const int8_t embeddedStyleOverride,