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 <iterator>
10
11#include "core/fxcrt/fx_unicode.h"
12#include "third_party/base/check.h"
13
14namespace {
15
16#define FX_LBUN FX_LINEBREAKTYPE::kUNKNOWN
17#define FX_LBDB FX_LINEBREAKTYPE::kDIRECT_BRK
18#define FX_LBIB FX_LINEBREAKTYPE::kINDIRECT_BRK
19#define FX_LBCB FX_LINEBREAKTYPE::kCOM_INDIRECT_BRK
20#define FX_LBCP FX_LINEBREAKTYPE::kCOM_PROHIBITED_BRK
21#define FX_LBPB FX_LINEBREAKTYPE::kPROHIBITED_BRK
22#define FX_LBHS FX_LINEBREAKTYPE::kHANGUL_SPACE_BRK
23
24const FX_LINEBREAKTYPE kFX_LineBreak_PairTable[38][38] = {
215};
216
217#undef FX_LBUN
218#undef FX_LBDB
219#undef FX_LBIB
220#undef FX_LBCB
221#undef FX_LBCP
222#undef FX_LBPB
223#undef FX_LBHS
224
225} // namespace
226
228 FX_BREAKPROPERTY next_char) {
229 size_t row = static_cast<size_t>(curr_char);
230 size_t col = static_cast<size_t>(next_char);
231 DCHECK(row < std::size(kFX_LineBreak_PairTable));
232 DCHECK(col < std::size(kFX_LineBreak_PairTable[0]));
233 return kFX_LineBreak_PairTable[row][col];
234}
#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)