From 58a373e683bed7c6876f9688cc085c4da6a47bb1 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Sun, 29 Jan 2023 19:36:13 +0100 Subject: [PATCH] [apps/reader] Fix reader crash when opening bookmark I just disabled color restoration, but I am still not understanding why it isn't working Fix #307 --- apps/reader/word_wrap_view.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/reader/word_wrap_view.cpp b/apps/reader/word_wrap_view.cpp index b02c4ed03..3585e9669 100644 --- a/apps/reader/word_wrap_view.cpp +++ b/apps/reader/word_wrap_view.cpp @@ -17,6 +17,7 @@ WordWrapTextView::WordWrapTextView(ReadBookController * readBookController) : m_length(0), m_isRichTextFile(false), // Value isn't important, it will change when the file is loaded m_lastPagesOffsetsIndex(0), + m_textColor(Palette::PrimaryText), m_readBookController(readBookController) { for (int i = 0; i < k_lastOffsetsBufferSize; i++) { @@ -618,7 +619,8 @@ BookSave WordWrapTextView::getBookSave() const { void WordWrapTextView::setBookSave(BookSave save) { m_pageOffset = save.offset; - m_textColor = save.color; + // TODO: Understand why the color save crash the calculator and fix it + // m_textColor = save.color; m_lastPagesOffsetsIndex = 0; for (int i = 0; i < k_lastOffsetsBufferSize; i++) {