diff --git a/lib/Epub/Epub/Section.cpp b/lib/Epub/Epub/Section.cpp index 814ae5ef..12300d07 100644 --- a/lib/Epub/Epub/Section.cpp +++ b/lib/Epub/Epub/Section.cpp @@ -122,8 +122,9 @@ bool Section::clearCache() const { bool Section::createSectionFile(const int fontId, const float lineCompression, const bool extraParagraphSpacing, const uint8_t paragraphAlignment, const uint16_t viewportWidth, - const uint16_t viewportHeight, const std::function& progressSetupFn, - const std::function& progressFn, const bool hyphenationEnabled) { + const uint16_t viewportHeight, const bool hyphenationEnabled, + const std::function& progressSetupFn, + const std::function& progressFn) { constexpr uint32_t MIN_SIZE_FOR_PROGRESS = 50 * 1024; // 50KB const auto localPath = epub->getSpineItem(spineIndex).href; const auto tmpHtmlPath = epub->getCachePath() + "/.tmp_" + std::to_string(spineIndex) + ".html"; diff --git a/lib/Epub/Epub/Section.h b/lib/Epub/Epub/Section.h index cd7ad7a7..5b726141 100644 --- a/lib/Epub/Epub/Section.h +++ b/lib/Epub/Epub/Section.h @@ -32,8 +32,8 @@ class Section { uint16_t viewportWidth, uint16_t viewportHeight, bool hyphenationEnabled); bool clearCache() const; bool createSectionFile(int fontId, float lineCompression, bool extraParagraphSpacing, uint8_t paragraphAlignment, - uint16_t viewportWidth, uint16_t viewportHeight, + uint16_t viewportWidth, uint16_t viewportHeight, bool hyphenationEnabled, const std::function& progressSetupFn = nullptr, - const std::function& progressFn = nullptr, bool hyphenationEnabled = false); + const std::function& progressFn = nullptr); std::unique_ptr loadPageFromSectionFile(); }; diff --git a/lib/Epub/Epub/hyphenation/Hyphenator.cpp b/lib/Epub/Epub/hyphenation/Hyphenator.cpp index e53f6366..3436a90b 100644 --- a/lib/Epub/Epub/hyphenation/Hyphenator.cpp +++ b/lib/Epub/Epub/hyphenation/Hyphenator.cpp @@ -123,6 +123,4 @@ std::vector Hyphenator::breakOffsets(const std::string& w return breaks; } -void Hyphenator::setPreferredLanguage(const std::string& lang) { - cachedHyphenator_ = hyphenatorForLanguage(lang); -} +void Hyphenator::setPreferredLanguage(const std::string& lang) { cachedHyphenator_ = hyphenatorForLanguage(lang); } diff --git a/src/activities/reader/EpubReaderActivity.cpp b/src/activities/reader/EpubReaderActivity.cpp index 2abbb1f1..c6adbec5 100644 --- a/src/activities/reader/EpubReaderActivity.cpp +++ b/src/activities/reader/EpubReaderActivity.cpp @@ -313,7 +313,7 @@ void EpubReaderActivity::renderScreen() { if (!section->createSectionFile(SETTINGS.getReaderFontId(), SETTINGS.getReaderLineCompression(), SETTINGS.extraParagraphSpacing, SETTINGS.paragraphAlignment, viewportWidth, - viewportHeight, progressSetup, progressCallback, SETTINGS.hyphenationEnabled)) { + viewportHeight, SETTINGS.hyphenationEnabled, progressSetup, progressCallback)) { Serial.printf("[%lu] [ERS] Failed to persist page data to SD\n", millis()); section.reset(); return;