#include "core/fpdfdoc/cpvt_section.h"
#include <algorithm>
#include <array>
#include "core/fpdfdoc/cpvt_variabletext.h"
#include "core/fpdfdoc/cpvt_wordinfo.h"
#include "core/fxcrt/check.h"
#include "core/fxcrt/stl_util.h"
namespace {
constexpr std::array<const uint8_t, 128> kSpecialChars = …;
bool IsLatin(uint16_t word) { … }
bool IsDigit(uint32_t word) { … }
bool IsCJK(uint32_t word) { … }
bool IsPunctuation(uint32_t word) { … }
bool IsConnectiveSymbol(uint32_t word) { … }
bool IsOpenStylePunctuation(uint32_t word) { … }
bool IsCurrencySymbol(uint16_t word) { … }
bool IsPrefixSymbol(uint16_t word) { … }
bool IsSpace(uint16_t word) { … }
bool NeedDivision(uint16_t prevWord, uint16_t curWord) { … }
}
CPVT_Section::Line::Line(const CPVT_LineInfo& lineinfo)
: … { … }
CPVT_Section::Line::~Line() = default;
CPVT_WordPlace CPVT_Section::Line::GetBeginWordPlace() const { … }
CPVT_WordPlace CPVT_Section::Line::GetEndWordPlace() const { … }
CPVT_WordPlace CPVT_Section::Line::GetPrevWordPlace(
const CPVT_WordPlace& place) const { … }
CPVT_WordPlace CPVT_Section::Line::GetNextWordPlace(
const CPVT_WordPlace& place) const { … }
CPVT_Section::CPVT_Section(CPVT_VariableText* pVT) : … { … }
CPVT_Section::~CPVT_Section() = default;
void CPVT_Section::ResetLinePlace() { … }
CPVT_WordPlace CPVT_Section::AddWord(const CPVT_WordPlace& place,
const CPVT_WordInfo& wordinfo) { … }
CPVT_WordPlace CPVT_Section::AddLine(const CPVT_LineInfo& lineinfo) { … }
CPVT_FloatRect CPVT_Section::Rearrange() { … }
CFX_SizeF CPVT_Section::GetSectionSize(float fFontSize) { … }
CPVT_WordPlace CPVT_Section::GetBeginWordPlace() const { … }
CPVT_WordPlace CPVT_Section::GetEndWordPlace() const { … }
CPVT_WordPlace CPVT_Section::GetPrevWordPlace(
const CPVT_WordPlace& place) const { … }
CPVT_WordPlace CPVT_Section::GetNextWordPlace(
const CPVT_WordPlace& place) const { … }
void CPVT_Section::UpdateWordPlace(CPVT_WordPlace& place) const { … }
CPVT_WordPlace CPVT_Section::SearchWordPlace(const CFX_PointF& point) const { … }
CPVT_WordPlace CPVT_Section::SearchWordPlace(
float fx,
const CPVT_WordPlace& lineplace) const { … }
CPVT_WordPlace CPVT_Section::SearchWordPlace(
float fx,
const CPVT_WordRange& range) const { … }
int32_t CPVT_Section::GetLineArraySize() const { … }
const CPVT_Section::Line* CPVT_Section::GetLineFromArray(int32_t index) const { … }
int32_t CPVT_Section::GetWordArraySize() const { … }
const CPVT_WordInfo* CPVT_Section::GetWordFromArray(int32_t index) const { … }
void CPVT_Section::EraseWordsFrom(int32_t index) { … }
CPVT_FloatRect CPVT_Section::RearrangeCharArray() const { … }
CPVT_FloatRect CPVT_Section::RearrangeTypeset() { … }
CPVT_FloatRect CPVT_Section::SplitLines(bool bTypeset, float fFontSize) { … }
CPVT_FloatRect CPVT_Section::OutputLines(const CPVT_FloatRect& rect) const { … }
void CPVT_Section::ClearLeftWords(int32_t nWordIndex) { … }
void CPVT_Section::ClearRightWords(int32_t nWordIndex) { … }
void CPVT_Section::ClearMidWords(int32_t nBeginIndex, int32_t nEndIndex) { … }
void CPVT_Section::ClearWords(const CPVT_WordRange& PlaceRange) { … }
void CPVT_Section::ClearWord(const CPVT_WordPlace& place) { … }