From 366fba93626a1ab2ae85f2fab41b94107f8fa5d7 Mon Sep 17 00:00:00 2001 From: Jonas Diemer Date: Mon, 29 Dec 2025 19:19:54 +0100 Subject: [PATCH] Go to the guide::text reference when book is first opened. --- lib/Epub/Epub/BookMetadataCache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Epub/Epub/BookMetadataCache.cpp b/lib/Epub/Epub/BookMetadataCache.cpp index eda86ab6..21600682 100644 --- a/lib/Epub/Epub/BookMetadataCache.cpp +++ b/lib/Epub/Epub/BookMetadataCache.cpp @@ -85,10 +85,10 @@ bool BookMetadataCache::buildBookBin(const std::string& epubPath, const BookMeta return false; } - constexpr uint32_t headerASize = + constexpr size_t headerASize = sizeof(BOOK_CACHE_VERSION) + /* LUT Offset */ sizeof(uint32_t) + sizeof(spineCount) + sizeof(tocCount); const uint32_t metadataSize = - metadata.title.size() + metadata.author.size() + metadata.coverItemHref.size() + sizeof(uint32_t) * 3; + metadata.title.size() + metadata.author.size() + metadata.coverItemHref.size() + metadata.textReferenceHref.size() + sizeof(uint32_t) * 4; const uint32_t lutSize = sizeof(uint32_t) * spineCount + sizeof(uint32_t) * tocCount; const uint32_t lutOffset = headerASize + metadataSize;