mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[reader] Fix a bug when going backward and a memory leak
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user