clang format fix

This commit is contained in:
Arthur Tazhitdinov 2026-01-07 02:14:57 +05:00
parent e46a271c12
commit 54669a8fd4
3 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,6 @@
#include "ParsedText.h" #include "ParsedText.h"
#include <GfxRenderer.h> #include <GfxRenderer.h>
#include "hyphenation/Hyphenator.h"
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
@ -10,6 +9,8 @@
#include <limits> #include <limits>
#include <vector> #include <vector>
#include "hyphenation/Hyphenator.h"
constexpr int MAX_COST = std::numeric_limits<int>::max(); constexpr int MAX_COST = std::numeric_limits<int>::max();
void ParsedText::addWord(std::string word, const EpdFontFamily::Style fontStyle) { void ParsedText::addWord(std::string word, const EpdFontFamily::Style fontStyle) {
@ -154,8 +155,7 @@ void ParsedText::applyParagraphIndent() {
words.front().insert(0, "\xe2\x80\x83"); words.front().insert(0, "\xe2\x80\x83");
} }
void ParsedText::ensureHyphenationFitsViewport(const GfxRenderer& renderer, const int fontId, void ParsedText::ensureHyphenationFitsViewport(const GfxRenderer& renderer, const int fontId, const int viewportWidth) {
const int viewportWidth) {
if (!hyphenationEnabled || viewportWidth <= 0) { if (!hyphenationEnabled || viewportWidth <= 0) {
return; return;
} }

View File

@ -22,7 +22,7 @@ class ParsedText {
void applyParagraphIndent(); void applyParagraphIndent();
void ensureHyphenationFitsViewport(const GfxRenderer& renderer, int fontId, int viewportWidth); void ensureHyphenationFitsViewport(const GfxRenderer& renderer, int fontId, int viewportWidth);
std::vector<std::string> hyphenateWordToFit(const std::string& word, const GfxRenderer& renderer, int fontId, std::vector<std::string> hyphenateWordToFit(const std::string& word, const GfxRenderer& renderer, int fontId,
EpdFontFamily::Style style, int viewportWidth) const; EpdFontFamily::Style style, int viewportWidth) const;
std::vector<size_t> computeHyphenatedLineBreaks(const GfxRenderer& renderer, int fontId, int pageWidth, std::vector<size_t> computeHyphenatedLineBreaks(const GfxRenderer& renderer, int fontId, int pageWidth,
int spaceWidth, std::vector<uint16_t>& wordWidths); int spaceWidth, std::vector<uint16_t>& wordWidths);
bool hyphenateWordAtIndex(size_t wordIndex, int availableWidth, const GfxRenderer& renderer, int fontId, bool hyphenateWordAtIndex(size_t wordIndex, int availableWidth, const GfxRenderer& renderer, int fontId,

View File

@ -179,7 +179,7 @@ bool Section::createSectionFile(const int fontId, const float lineCompression, c
viewportHeight, hyphenationEnabled); viewportHeight, hyphenationEnabled);
std::vector<uint32_t> lut = {}; std::vector<uint32_t> lut = {};
ChapterHtmlSlimParser visitor( ChapterHtmlSlimParser visitor(
tmpHtmlPath, renderer, fontId, lineCompression, extraParagraphSpacing, paragraphAlignment, viewportWidth, tmpHtmlPath, renderer, fontId, lineCompression, extraParagraphSpacing, paragraphAlignment, viewportWidth,
viewportHeight, hyphenationEnabled, viewportHeight, hyphenationEnabled,
[this, &lut](std::unique_ptr<Page> page) { lut.emplace_back(this->onPageComplete(std::move(page))); }, [this, &lut](std::unique_ptr<Page> page) { lut.emplace_back(this->onPageComplete(std::move(page))); },