diff --git a/apps/reader/tex_parser.cpp b/apps/reader/tex_parser.cpp index 2156c4e1c..173d88836 100644 --- a/apps/reader/tex_parser.cpp +++ b/apps/reader/tex_parser.cpp @@ -169,7 +169,7 @@ Layout TexParser::popCommand() { } m_hasError = true; - return LayoutHelper::String(m_text, strlen(m_text)); + return EmptyLayout::Builder(); } // Expressions @@ -207,4 +207,5 @@ Layout TexParser::popSymbolCommand(int SymbolIndex) { inline bool TexParser::isCommandEnded(char c) const { return !(c >= 'a' && c <= 'z') && !(c >= 'A' && c <= 'Z'); } + } \ No newline at end of file diff --git a/apps/reader/utility.cpp b/apps/reader/utility.cpp index 591267973..8ed4cd4f0 100644 --- a/apps/reader/utility.cpp +++ b/apps/reader/utility.cpp @@ -136,7 +136,7 @@ const char * StartOfPrintableWord(const char * word, const char * start) { const char * result = word; while (codePoint != '\n' && codePoint != ' ' && codePoint != '%' && codePoint != '$') { result = decoder.stringPosition(); - if (result >= start) { + if (result <= start) { break; } codePoint = decoder.previousCodePoint(); diff --git a/apps/reader/word_wrap_view.cpp b/apps/reader/word_wrap_view.cpp index f944f2c64..2bb53bff2 100644 --- a/apps/reader/word_wrap_view.cpp +++ b/apps/reader/word_wrap_view.cpp @@ -74,7 +74,7 @@ void WordWrapTextView::previousPage() { } else { if (*startOfWord == '\\' || *(startOfWord + 1) == '$') { - textSize = m_font->stringSizeUntil(startOfWord + 1, endOfWord); + textSize = m_font->stringSizeUntil(startOfWord + 1, endOfWord); } else { textSize = m_font->stringSizeUntil(startOfWord, endOfWord);