Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
fgas_linebreak.cpp
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "xfa/fgas/layout/fgas_linebreak.h"
8
9#include <array>
10#include <iterator>
11
12#include "core/fxcrt/check.h"
13#include "core/fxcrt/compiler_specific.h"
14#include "core/fxcrt/fx_unicode.h"
15
16namespace {
17
18#define FX_LBUN FX_LINEBREAKTYPE::kUNKNOWN
19#define FX_LBDB FX_LINEBREAKTYPE::kDIRECT_BRK
20#define FX_LBIB FX_LINEBREAKTYPE::kINDIRECT_BRK
21#define FX_LBCB FX_LINEBREAKTYPE::kCOM_INDIRECT_BRK
22#define FX_LBCP FX_LINEBREAKTYPE::kCOM_PROHIBITED_BRK
23#define FX_LBPB FX_LINEBREAKTYPE::kPROHIBITED_BRK
24#define FX_LBHS FX_LINEBREAKTYPE::kHANGUL_SPACE_BRK
25
26using LineBreakPairRow = std::array<const FX_LINEBREAKTYPE, 38>;
27constexpr std::array<const LineBreakPairRow, 38> kLineBreakPairTable = {{
218}};
219
220#undef FX_LBUN
221#undef FX_LBDB
222#undef FX_LBIB
223#undef FX_LBCB
224#undef FX_LBCP
225#undef FX_LBPB
226#undef FX_LBHS
227
228} // namespace
229
231 FX_BREAKPROPERTY next_char) {
232 const size_t row = static_cast<size_t>(curr_char);
233 const size_t col = static_cast<size_t>(next_char);
234 return kLineBreakPairTable[row][col];
235}
#define FX_LBDB
#define FX_LBCP
#define FX_LBPB
#define FX_LBUN
#define FX_LBCB
#define FX_LBIB
FX_LINEBREAKTYPE
FX_LINEBREAKTYPE GetLineBreakTypeFromPair(FX_BREAKPROPERTY curr_char, FX_BREAKPROPERTY next_char)