mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-05 15:17:37 +03:00
Add comments, improve readability
This commit is contained in:
parent
19d2bd0665
commit
90064cb2ff
@ -40,18 +40,18 @@ bool matches(const char* tag_name, const char* possible_tags[], const int possib
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// flush the contents of partWordBuffer to currentTextBlock
|
||||||
void ChapterHtmlSlimParser::flushPartWordBuffer() {
|
void ChapterHtmlSlimParser::flushPartWordBuffer() {
|
||||||
|
// determine font style
|
||||||
EpdFontFamily::Style fontStyle = EpdFontFamily::REGULAR;
|
EpdFontFamily::Style fontStyle = EpdFontFamily::REGULAR;
|
||||||
if (boldUntilDepth < depth) {
|
if (boldUntilDepth < depth && italicUntilDepth < depth) {
|
||||||
if (italicUntilDepth < depth) {
|
fontStyle = EpdFontFamily::BOLD_ITALIC;
|
||||||
fontStyle = EpdFontFamily::BOLD_ITALIC;
|
} else if (boldUntilDepth < depth) {
|
||||||
} else {
|
fontStyle = EpdFontFamily::BOLD;
|
||||||
fontStyle = EpdFontFamily::BOLD;
|
|
||||||
}
|
|
||||||
} else if (italicUntilDepth < depth) {
|
} else if (italicUntilDepth < depth) {
|
||||||
fontStyle = EpdFontFamily::ITALIC;
|
fontStyle = EpdFontFamily::ITALIC;
|
||||||
}
|
}
|
||||||
|
// flush the buffer
|
||||||
partWordBuffer[partWordBufferIndex] = '\0';
|
partWordBuffer[partWordBufferIndex] = '\0';
|
||||||
currentTextBlock->addWord(partWordBuffer, fontStyle);
|
currentTextBlock->addWord(partWordBuffer, fontStyle);
|
||||||
partWordBufferIndex = 0;
|
partWordBufferIndex = 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user