qchar.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qchar.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8bool QChar::isPrint(uint ucs4) noexcept-
9{-
10 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 206544 times by 79 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAccessibility
  • tst_QApplication
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusInterface
  • tst_QDataWidgetMapper
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialogButtonBox
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontDialog
  • tst_QFormLayout
  • tst_QGraphicsItem
  • ...
)
0-206544
11 return
never executed: return false;
false;
never executed: return false;
0
12 const int test = (1 << (Other_Control)) |-
13 (1 << (Other_Format)) |-
14 (1 << (Other_Surrogate)) |-
15 (1 << (Other_PrivateUse)) |-
16 (1 << (Other_NotAssigned));-
17 return
executed 206544 times by 79 tests: return !((1 << (qGetProp(ucs4)->category)) & test);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAccessibility
  • tst_QApplication
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusInterface
  • tst_QDataWidgetMapper
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialogButtonBox
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontDialog
  • tst_QFormLayout
  • tst_QGraphicsItem
  • ...
!((1 << (qGetProp(ucs4)->category)) & test);
executed 206544 times by 79 tests: return !((1 << (qGetProp(ucs4)->category)) & test);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAccessibility
  • tst_QApplication
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusInterface
  • tst_QDataWidgetMapper
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialogButtonBox
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontDialog
  • tst_QFormLayout
  • tst_QGraphicsItem
  • ...
206544
18}-
19bool QChar::isSpace_helper(uint ucs4) noexcept-
20{-
21 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 315775 times by 44 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QChar
  • tst_QColorDialog
  • tst_QComplexText
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDatabase
  • tst_QFontMetrics
  • tst_QGlyphRun
  • tst_QHostInfo
  • tst_QImageReader
  • tst_QIntValidator
  • tst_QItemDelegate
  • tst_QLabel
  • tst_QLineEdit
  • tst_QListView
  • tst_QMdiArea
  • tst_QPlainTextEdit
  • tst_QRawFont
  • tst_QRegExp
  • tst_QSqlQuery
  • tst_QStackedLayout
  • tst_QStaticText
  • ...
)
0-315775
22 return
never executed: return false;
false;
never executed: return false;
0
23 const int test = (1 << (Separator_Space)) |-
24 (1 << (Separator_Line)) |-
25 (1 << (Separator_Paragraph));-
26 return
executed 315775 times by 44 tests: return (1 << (qGetProp(ucs4)->category)) & test;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QChar
  • tst_QColorDialog
  • tst_QComplexText
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDatabase
  • tst_QFontMetrics
  • tst_QGlyphRun
  • tst_QHostInfo
  • tst_QImageReader
  • tst_QIntValidator
  • tst_QItemDelegate
  • tst_QLabel
  • tst_QLineEdit
  • tst_QListView
  • tst_QMdiArea
  • tst_QPlainTextEdit
  • tst_QRawFont
  • tst_QRegExp
  • tst_QSqlQuery
  • tst_QStackedLayout
  • tst_QStaticText
  • ...
(1 << (qGetProp(ucs4)->category)) & test;
executed 315775 times by 44 tests: return (1 << (qGetProp(ucs4)->category)) & test;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QChar
  • tst_QColorDialog
  • tst_QComplexText
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDatabase
  • tst_QFontMetrics
  • tst_QGlyphRun
  • tst_QHostInfo
  • tst_QImageReader
  • tst_QIntValidator
  • tst_QItemDelegate
  • tst_QLabel
  • tst_QLineEdit
  • tst_QListView
  • tst_QMdiArea
  • tst_QPlainTextEdit
  • tst_QRawFont
  • tst_QRegExp
  • tst_QSqlQuery
  • tst_QStackedLayout
  • tst_QStaticText
  • ...
315775
27}-
28bool QChar::isMark(uint ucs4) noexcept-
29{-
30 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 16148 times by 3 tests
Evaluated by:
  • tst_QRegExp
  • tst_QString
  • tst_qmakelib
)
0-16148
31 return
never executed: return false;
false;
never executed: return false;
0
32 const int test = (1 << (Mark_NonSpacing)) |-
33 (1 << (Mark_SpacingCombining)) |-
34 (1 << (Mark_Enclosing));-
35 return
executed 16148 times by 3 tests: return (1 << (qGetProp(ucs4)->category)) & test;
Executed by:
  • tst_QRegExp
  • tst_QString
  • tst_qmakelib
(1 << (qGetProp(ucs4)->category)) & test;
executed 16148 times by 3 tests: return (1 << (qGetProp(ucs4)->category)) & test;
Executed by:
  • tst_QRegExp
  • tst_QString
  • tst_qmakelib
16148
36}-
37bool QChar::isPunct(uint ucs4) noexcept-
38{-
39 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
40 return
never executed: return false;
false;
never executed: return false;
0
41 const int test = (1 << (Punctuation_Connector)) |-
42 (1 << (Punctuation_Dash)) |-
43 (1 << (Punctuation_Open)) |-
44 (1 << (Punctuation_Close)) |-
45 (1 << (Punctuation_InitialQuote)) |-
46 (1 << (Punctuation_FinalQuote)) |-
47 (1 << (Punctuation_Other));-
48 return
never executed: return (1 << (qGetProp(ucs4)->category)) & test;
(1 << (qGetProp(ucs4)->category)) & test;
never executed: return (1 << (qGetProp(ucs4)->category)) & test;
0
49}-
50bool QChar::isSymbol(uint ucs4) noexcept-
51{-
52 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
53 return
never executed: return false;
false;
never executed: return false;
0
54 const int test = (1 << (Symbol_Math)) |-
55 (1 << (Symbol_Currency)) |-
56 (1 << (Symbol_Modifier)) |-
57 (1 << (Symbol_Other));-
58 return
never executed: return (1 << (qGetProp(ucs4)->category)) & test;
(1 << (qGetProp(ucs4)->category)) & test;
never executed: return (1 << (qGetProp(ucs4)->category)) & test;
0
59}-
60bool QChar::isLetter_helper(uint ucs4) noexcept-
61{-
62 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 128 times by 1 test
Evaluated by:
  • tst_QChar
)
0-128
63 return
never executed: return false;
false;
never executed: return false;
0
64 const int test = (1 << (Letter_Uppercase)) |-
65 (1 << (Letter_Lowercase)) |-
66 (1 << (Letter_Titlecase)) |-
67 (1 << (Letter_Modifier)) |-
68 (1 << (Letter_Other));-
69 return
executed 128 times by 1 test: return (1 << (qGetProp(ucs4)->category)) & test;
Executed by:
  • tst_QChar
(1 << (qGetProp(ucs4)->category)) & test;
executed 128 times by 1 test: return (1 << (qGetProp(ucs4)->category)) & test;
Executed by:
  • tst_QChar
128
70}-
71bool QChar::isNumber_helper(uint ucs4) noexcept-
72{-
73 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
74 return
never executed: return false;
false;
never executed: return false;
0
75 const int test = (1 << (Number_DecimalDigit)) |-
76 (1 << (Number_Letter)) |-
77 (1 << (Number_Other));-
78 return
never executed: return (1 << (qGetProp(ucs4)->category)) & test;
(1 << (qGetProp(ucs4)->category)) & test;
never executed: return (1 << (qGetProp(ucs4)->category)) & test;
0
79}-
80bool QChar::isLetterOrNumber_helper(uint ucs4) noexcept-
81{-
82 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 81818 times by 36 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QChar
  • tst_QColorDialog
  • tst_QComplexText
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDatabase
  • tst_QFontMetrics
  • tst_QGlyphRun
  • tst_QItemDelegate
  • tst_QLabel
  • tst_QLineEdit
  • tst_QListView
  • tst_QMdiArea
  • tst_QMessageBox
  • tst_QPlainTextEdit
  • tst_QRawFont
  • tst_QRegExp
  • tst_QSpinBox
  • tst_QStackedLayout
  • tst_QStaticText
  • tst_QTableView
  • ...
)
0-81818
83 return
never executed: return false;
false;
never executed: return false;
0
84 const int test = (1 << (Letter_Uppercase)) |-
85 (1 << (Letter_Lowercase)) |-
86 (1 << (Letter_Titlecase)) |-
87 (1 << (Letter_Modifier)) |-
88 (1 << (Letter_Other)) |-
89 (1 << (Number_DecimalDigit)) |-
90 (1 << (Number_Letter)) |-
91 (1 << (Number_Other));-
92 return
executed 81818 times by 36 tests: return (1 << (qGetProp(ucs4)->category)) & test;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QChar
  • tst_QColorDialog
  • tst_QComplexText
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDatabase
  • tst_QFontMetrics
  • tst_QGlyphRun
  • tst_QItemDelegate
  • tst_QLabel
  • tst_QLineEdit
  • tst_QListView
  • tst_QMdiArea
  • tst_QMessageBox
  • tst_QPlainTextEdit
  • tst_QRawFont
  • tst_QRegExp
  • tst_QSpinBox
  • tst_QStackedLayout
  • tst_QStaticText
  • tst_QTableView
  • ...
(1 << (qGetProp(ucs4)->category)) & test;
executed 81818 times by 36 tests: return (1 << (qGetProp(ucs4)->category)) & test;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QChar
  • tst_QColorDialog
  • tst_QComplexText
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDatabase
  • tst_QFontMetrics
  • tst_QGlyphRun
  • tst_QItemDelegate
  • tst_QLabel
  • tst_QLineEdit
  • tst_QListView
  • tst_QMdiArea
  • tst_QMessageBox
  • tst_QPlainTextEdit
  • tst_QRawFont
  • tst_QRegExp
  • tst_QSpinBox
  • tst_QStackedLayout
  • tst_QStaticText
  • tst_QTableView
  • ...
81818
93}-
94int QChar::digitValue(uint ucs4) noexcept-
95{-
96 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QChar
FALSEevaluated 5797012 times by 430 tests
Evaluated by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • ...
)
1-5797012
97 return
executed 1 time by 1 test: return -1;
Executed by:
  • tst_QChar
-1;
executed 1 time by 1 test: return -1;
Executed by:
  • tst_QChar
1
98 return
executed 5797012 times by 430 tests: return qGetProp(ucs4)->digitValue;
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • ...
qGetProp(ucs4)->digitValue;
executed 5797012 times by 430 tests: return qGetProp(ucs4)->digitValue;
Executed by:
  • tst_Collections
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • ...
5797012
99}-
100QChar::Category QChar::category(uint ucs4) noexcept-
101{-
102 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QChar
FALSEevaluated 9539049 times by 132 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • ...
)
1-9539049
103 return
executed 1 time by 1 test: return QChar::Other_NotAssigned;
Executed by:
  • tst_QChar
QChar::Other_NotAssigned;
executed 1 time by 1 test: return QChar::Other_NotAssigned;
Executed by:
  • tst_QChar
1
104 return
executed 9539049 times by 132 tests: return (QChar::Category) qGetProp(ucs4)->category;
Executed by:
  • tst_Collections
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • ...
(QChar::Category) qGetProp(ucs4)->category;
executed 9539049 times by 132 tests: return (QChar::Category) qGetProp(ucs4)->category;
Executed by:
  • tst_Collections
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • ...
9539049
105}-
106QChar::Direction QChar::direction(uint ucs4) noexcept-
107{-
108 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 1879525 times by 104 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDatabase
  • ...
)
0-1879525
109 return
never executed: return QChar::DirL;
QChar::DirL;
never executed: return QChar::DirL;
0
110 return
executed 1879525 times by 104 tests: return (QChar::Direction) qGetProp(ucs4)->direction;
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDatabase
  • ...
(QChar::Direction) qGetProp(ucs4)->direction;
executed 1879525 times by 104 tests: return (QChar::Direction) qGetProp(ucs4)->direction;
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDatabase
  • ...
1879525
111}-
112QChar::JoiningType QChar::joiningType(uint ucs4) noexcept-
113{-
114 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 2169 times by 14 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QChar
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontMetrics
  • tst_QListView
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QWidget
  • tst_languageChange
)
0-2169
115 return
never executed: return QChar::Joining_None;
QChar::Joining_None;
never executed: return QChar::Joining_None;
0
116 return
executed 2169 times by 14 tests: return QChar::JoiningType(qGetProp(ucs4)->joining);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QChar
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontMetrics
  • tst_QListView
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QWidget
  • tst_languageChange
QChar::JoiningType(qGetProp(ucs4)->joining);
executed 2169 times by 14 tests: return QChar::JoiningType(qGetProp(ucs4)->joining);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QChar
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontMetrics
  • tst_QListView
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QWidget
  • tst_languageChange
2169
117}-
118QChar::Joining QChar::joining(uint ucs4) noexcept-
119{-
120 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
121 return
never executed: return QChar::OtherJoining;
QChar::OtherJoining;
never executed: return QChar::OtherJoining;
0
122 switch (qGetProp(ucs4)->joining) {-
123 case
never executed: case QChar::Joining_Causing:
QChar::Joining_Causing:
never executed: case QChar::Joining_Causing:
return
never executed: return QChar::Center;
QChar::Center;
never executed: return QChar::Center;
0
124 case
never executed: case QChar::Joining_Dual:
QChar::Joining_Dual:
never executed: case QChar::Joining_Dual:
return
never executed: return QChar::Dual;
QChar::Dual;
never executed: return QChar::Dual;
0
125 case
never executed: case QChar::Joining_Right:
QChar::Joining_Right:
never executed: case QChar::Joining_Right:
return
never executed: return QChar::Right;
QChar::Right;
never executed: return QChar::Right;
0
126 default
never executed: default:
:
never executed: default:
break;
never executed: break;
0
127 }-
128 return
never executed: return QChar::OtherJoining;
QChar::OtherJoining;
never executed: return QChar::OtherJoining;
0
129}-
130bool QChar::hasMirrored(uint ucs4) noexcept-
131{-
132 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QChar
)
0-4
133 return
never executed: return false;
false;
never executed: return false;
0
134 return
executed 4 times by 1 test: return qGetProp(ucs4)->mirrorDiff != 0;
Executed by:
  • tst_QChar
qGetProp(ucs4)->mirrorDiff != 0;
executed 4 times by 1 test: return qGetProp(ucs4)->mirrorDiff != 0;
Executed by:
  • tst_QChar
4
135}-
136uint QChar::mirroredChar(uint ucs4) noexcept-
137{-
138 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 129532 times by 12 tests
Evaluated by:
  • tst_QChar
  • tst_QComplexText
  • tst_QFontDatabase
  • tst_QGlyphRun
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QRawFont
  • tst_QTextEdit
  • tst_QTextLayout
  • tst_QTextScriptEngine
  • tst_QTreeWidget
)
0-129532
139 return
never executed: return ucs4;
ucs4;
never executed: return ucs4;
0
140 return
executed 129532 times by 12 tests: return ucs4 + qGetProp(ucs4)->mirrorDiff;
Executed by:
  • tst_QChar
  • tst_QComplexText
  • tst_QFontDatabase
  • tst_QGlyphRun
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QRawFont
  • tst_QTextEdit
  • tst_QTextLayout
  • tst_QTextScriptEngine
  • tst_QTreeWidget
ucs4 + qGetProp(ucs4)->mirrorDiff;
executed 129532 times by 12 tests: return ucs4 + qGetProp(ucs4)->mirrorDiff;
Executed by:
  • tst_QChar
  • tst_QComplexText
  • tst_QFontDatabase
  • tst_QGlyphRun
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QRawFont
  • tst_QTextEdit
  • tst_QTextLayout
  • tst_QTextScriptEngine
  • tst_QTreeWidget
129532
141}-
142-
143-
144-
145enum {-
146 Hangul_SBase = 0xac00,-
147 Hangul_LBase = 0x1100,-
148 Hangul_VBase = 0x1161,-
149 Hangul_TBase = 0x11a7,-
150 Hangul_LCount = 19,-
151 Hangul_VCount = 21,-
152 Hangul_TCount = 28,-
153 Hangul_NCount = Hangul_VCount * Hangul_TCount,-
154 Hangul_SCount = Hangul_LCount * Hangul_NCount-
155};-
156-
157-
158static const unsigned short * decompositionHelper-
159 (uint ucs4, int *length, int *tag, unsigned short *buffer)-
160{-
161 if (ucs4 >= Hangul_SBase && ucs4 < Hangul_SBase + Hangul_SCount) {-
162-
163 const uint SIndex = ucs4 - Hangul_SBase;-
164 buffer[0] = Hangul_LBase + SIndex / Hangul_NCount;-
165 buffer[1] = Hangul_VBase + (SIndex % Hangul_NCount) / Hangul_TCount;-
166 buffer[2] = Hangul_TBase + SIndex % Hangul_TCount;-
167 *length = buffer[2] == Hangul_TBase ? 2 : 3;-
168 *tag = QChar::Canonical;-
169 return buffer;-
170 }-
171-
172 const unsigned short index = (ucs4 < 0x3400 ? (uc_decomposition_trie[uc_decomposition_trie[ucs4>>4] + (ucs4 & 0xf)]) : (ucs4 < 0x30000 ? uc_decomposition_trie[uc_decomposition_trie[((ucs4 - 0x3400)>>8) + 0x340] + (ucs4 & 0xff)] : 0xffff));-
173 if (index == 0xffff) {-
174 *length = 0;-
175 *tag = QChar::NoDecomposition;-
176 return 0;-
177 }-
178-
179 const unsigned short *decomposition = uc_decomposition_map+index;-
180 *tag = (*decomposition) & 0xff;-
181 *length = (*decomposition) >> 8;-
182 return decomposition+1;-
183}-
184-
185-
186-
187-
188-
189QString QChar::decomposition() const-
190{-
191 return QChar::decomposition(ucs);-
192}-
193-
194-
195-
196-
197-
198-
199QString QChar::decomposition(uint ucs4)-
200{-
201 unsigned short buffer[3];-
202 int length;-
203 int tag;-
204 const unsigned short *d = decompositionHelper(ucs4, &length, &tag, buffer);-
205 return QString(reinterpret_cast<const QChar *>(d), length);-
206}-
207QChar::Decomposition QChar::decompositionTag(uint ucs4) noexcept-
208{-
209 if (ucs4 >= Hangul_SBase
ucs4 >= Hangul_SBaseDescription
TRUEevaluated 22368 times by 1 test
Evaluated by:
  • tst_QChar
FALSEevaluated 1275746 times by 85 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFontMetrics
  • ...
&& ucs4 < Hangul_SBase + Hangul_SCount
ucs4 < Hangul_... Hangul_SCountDescription
TRUEevaluated 22344 times by 1 test
Evaluated by:
  • tst_QChar
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_QChar
)
24-1275746
210 return
executed 22344 times by 1 test: return QChar::Canonical;
Executed by:
  • tst_QChar
QChar::Canonical;
executed 22344 times by 1 test: return QChar::Canonical;
Executed by:
  • tst_QChar
22344
211 const unsigned short index = (ucs4 < 0x3400
ucs4 < 0x3400Description
TRUEevaluated 1275746 times by 85 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFontMetrics
  • ...
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_QChar
? (uc_decomposition_trie[uc_decomposition_trie[ucs4>>4] + (ucs4 & 0xf)]) : (ucs4 < 0x30000
ucs4 < 0x30000Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_QChar
FALSEnever evaluated
? uc_decomposition_trie[uc_decomposition_trie[((ucs4 - 0x3400)>>8) + 0x340] + (ucs4 & 0xff)] : 0xffff));
0-1275746
212 if (index == 0xffff
index == 0xffffDescription
TRUEevaluated 1220096 times by 85 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFontMetrics
  • ...
FALSEevaluated 55674 times by 7 tests
Evaluated by:
  • tst_QChar
  • tst_QDoubleSpinBox
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QPlainTextEdit
  • tst_QSpinBox
  • tst_QTextLayout
)
55674-1220096
213 return
executed 1220096 times by 85 tests: return QChar::NoDecomposition;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFontMetrics
  • ...
QChar::NoDecomposition;
executed 1220096 times by 85 tests: return QChar::NoDecomposition;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFontMetrics
  • ...
1220096
214 return
executed 55674 times by 7 tests: return (QChar::Decomposition)(uc_decomposition_map[index] & 0xff);
Executed by:
  • tst_QChar
  • tst_QDoubleSpinBox
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QPlainTextEdit
  • tst_QSpinBox
  • tst_QTextLayout
(QChar::Decomposition)(uc_decomposition_map[index] & 0xff);
executed 55674 times by 7 tests: return (QChar::Decomposition)(uc_decomposition_map[index] & 0xff);
Executed by:
  • tst_QChar
  • tst_QDoubleSpinBox
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QPlainTextEdit
  • tst_QSpinBox
  • tst_QTextLayout
55674
215}-
216unsigned char QChar::combiningClass(uint ucs4) noexcept-
217{-
218 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 5518214 times by 112 tests
Evaluated by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • ...
)
0-5518214
219 return
never executed: return 0;
0;
never executed: return 0;
0
220 return
executed 5518214 times by 112 tests: return (unsigned char) qGetProp(ucs4)->combiningClass;
Executed by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • ...
(unsigned char) qGetProp(ucs4)->combiningClass;
executed 5518214 times by 112 tests: return (unsigned char) qGetProp(ucs4)->combiningClass;
Executed by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • ...
5518214
221}-
222QChar::Script QChar::script(uint ucs4) noexcept-
223{-
224 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 2639 times by 62 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDatabase
  • tst_QFontDialog
  • tst_QFontMetrics
  • tst_QFormLayout
  • tst_QGraphicsItem
  • ...
)
0-2639
225 return
never executed: return QChar::Script_Unknown;
QChar::Script_Unknown;
never executed: return QChar::Script_Unknown;
0
226 return
executed 2639 times by 62 tests: return (QChar::Script) qGetProp(ucs4)->script;
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDatabase
  • tst_QFontDialog
  • tst_QFontMetrics
  • tst_QFormLayout
  • tst_QGraphicsItem
  • ...
(QChar::Script) qGetProp(ucs4)->script;
executed 2639 times by 62 tests: return (QChar::Script) qGetProp(ucs4)->script;
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDatabase
  • tst_QFontDialog
  • tst_QFontMetrics
  • tst_QFormLayout
  • tst_QGraphicsItem
  • ...
2639
227}-
228QChar::UnicodeVersion QChar::unicodeVersion(uint ucs4) noexcept-
229{-
230 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QChar
FALSEevaluated 609469 times by 6 tests
Evaluated by:
  • tst_QChar
  • tst_QDnsLookup
  • tst_QHostInfo
  • tst_QNetworkCookie
  • tst_QUrl
  • tst_QUrlInternal
)
1-609469
231 return
executed 1 time by 1 test: return QChar::Unicode_Unassigned;
Executed by:
  • tst_QChar
QChar::Unicode_Unassigned;
executed 1 time by 1 test: return QChar::Unicode_Unassigned;
Executed by:
  • tst_QChar
1
232 return
executed 609469 times by 6 tests: return (QChar::UnicodeVersion) qGetProp(ucs4)->unicodeVersion;
Executed by:
  • tst_QChar
  • tst_QDnsLookup
  • tst_QHostInfo
  • tst_QNetworkCookie
  • tst_QUrl
  • tst_QUrlInternal
(QChar::UnicodeVersion) qGetProp(ucs4)->unicodeVersion;
executed 609469 times by 6 tests: return (QChar::UnicodeVersion) qGetProp(ucs4)->unicodeVersion;
Executed by:
  • tst_QChar
  • tst_QDnsLookup
  • tst_QHostInfo
  • tst_QNetworkCookie
  • tst_QUrl
  • tst_QUrlInternal
609469
233}-
234-
235-
236-
237-
238QChar::UnicodeVersion QChar::currentUnicodeVersion() noexcept-
239{-
240 return
executed 565704 times by 4 tests: return QChar::Unicode_8_0;
Executed by:
  • tst_QChar
  • tst_QLabel
  • tst_QTextLayout
  • tst_QTextScriptEngine
QChar::Unicode_8_0;
executed 565704 times by 4 tests: return QChar::Unicode_8_0;
Executed by:
  • tst_QChar
  • tst_QLabel
  • tst_QTextLayout
  • tst_QTextScriptEngine
565704
241}-
242-
243-
244template <typename Traits, typename T>-
245__attribute__((const)) static inline T convertCase_helper(T uc) noexcept-
246{-
247 const QUnicodeTables::Properties *prop = qGetProp(uc);-
248-
249 if (__builtin_expect(!!(Traits::caseSpecial(prop)), false)
__builtin_expe...prop)), false)Description
TRUEevaluated 347 times by 5 tests
Evaluated by:
  • tst_QChar
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
FALSEevaluated 11269411 times by 226 tests
Evaluated by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QCollator
  • tst_QColor
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • ...
) {
347-11269411
250 const ushort *specialCase = specialCaseMap + Traits::caseDiff(prop);-
251-
252 return
executed 347 times by 5 tests: return *specialCase == 1 ? specialCase[1] : uc;
Executed by:
  • tst_QChar
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
*specialCase == 1 ? specialCase[1] : uc;
executed 347 times by 5 tests: return *specialCase == 1 ? specialCase[1] : uc;
Executed by:
  • tst_QChar
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QString
347
253 }-
254-
255 return
executed 11269411 times by 226 tests: return uc + Traits::caseDiff(prop);
Executed by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QCollator
  • tst_QColor
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • ...
uc + Traits::caseDiff(prop);
executed 11269411 times by 226 tests: return uc + Traits::caseDiff(prop);
Executed by:
  • tst_Collections
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QCollator
  • tst_QColor
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • ...
11269411
256}-
257uint QChar::toLower(uint ucs4) noexcept-
258{-
259 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 5516452 times by 94 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QChar
  • tst_QCollator
  • tst_QColor
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleValidator
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • ...
)
0-5516452
260 return
never executed: return ucs4;
ucs4;
never executed: return ucs4;
0
261 return
executed 5516452 times by 94 tests: return convertCase_helper<QUnicodeTables::LowercaseTraits>(ucs4);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QChar
  • tst_QCollator
  • tst_QColor
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleValidator
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • ...
convertCase_helper<QUnicodeTables::LowercaseTraits>(ucs4);
executed 5516452 times by 94 tests: return convertCase_helper<QUnicodeTables::LowercaseTraits>(ucs4);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QChar
  • tst_QCollator
  • tst_QColor
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleValidator
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • ...
5516452
262}-
263uint QChar::toUpper(uint ucs4) noexcept-
264{-
265 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 2026370 times by 187 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QCollator
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDate
  • ...
)
0-2026370
266 return
never executed: return ucs4;
ucs4;
never executed: return ucs4;
0
267 return
executed 2026370 times by 187 tests: return convertCase_helper<QUnicodeTables::UppercaseTraits>(ucs4);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QCollator
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDate
  • ...
convertCase_helper<QUnicodeTables::UppercaseTraits>(ucs4);
executed 2026370 times by 187 tests: return convertCase_helper<QUnicodeTables::UppercaseTraits>(ucs4);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QCollator
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDate
  • ...
2026370
268}-
269uint QChar::toTitleCase(uint ucs4) noexcept-
270{-
271 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 50 times by 2 tests
Evaluated by:
  • tst_QChar
  • tst_qmakelib
)
0-50
272 return
never executed: return ucs4;
ucs4;
never executed: return ucs4;
0
273 return
executed 50 times by 2 tests: return convertCase_helper<QUnicodeTables::TitlecaseTraits>(ucs4);
Executed by:
  • tst_QChar
  • tst_qmakelib
convertCase_helper<QUnicodeTables::TitlecaseTraits>(ucs4);
executed 50 times by 2 tests: return convertCase_helper<QUnicodeTables::TitlecaseTraits>(ucs4);
Executed by:
  • tst_QChar
  • tst_qmakelib
50
274}-
275-
276static inline uint foldCase(const ushort *ch, const ushort *start)-
277{-
278 uint ucs4 = *ch;-
279 if (QChar::isLowSurrogate(ucs4) && ch > start && QChar::isHighSurrogate(*(ch - 1)))-
280 ucs4 = QChar::surrogateToUcs4(*(ch - 1), ucs4);-
281 return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);-
282}-
283-
284static inline uint foldCase(uint ch, uint &last) noexcept-
285{-
286 uint ucs4 = ch;-
287 if (QChar::isLowSurrogate(ucs4)
QChar::isLowSurrogate(ucs4)Description
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_QString
  • tst_QStringRef
FALSEevaluated 3463562 times by 170 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
&& QChar::isHighSurrogate(last)
QChar::isHighSurrogate(last)Description
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_QString
  • tst_QStringRef
FALSEnever evaluated
)
0-3463562
288 ucs4 = QChar::surrogateToUcs4(last, ucs4);
executed 28 times by 2 tests: ucs4 = QChar::surrogateToUcs4(last, ucs4);
Executed by:
  • tst_QString
  • tst_QStringRef
28
289 last = ch;-
290 return
executed 3463590 times by 170 tests: return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
executed 3463590 times by 170 tests: return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
3463590
291}-
292-
293static inline ushort foldCase(ushort ch) noexcept-
294{-
295 return
executed 151362 times by 53 tests: return convertCase_helper<QUnicodeTables::CasefoldTraits>(ch);
Executed by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDateTime
  • tst_QDialog
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsView
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QLabel
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenu
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • ...
convertCase_helper<QUnicodeTables::CasefoldTraits>(ch);
executed 151362 times by 53 tests: return convertCase_helper<QUnicodeTables::CasefoldTraits>(ch);
Executed by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractPrintDialog
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QComboBox
  • tst_QCssParser
  • tst_QDateTime
  • tst_QDialog
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsView
  • tst_QGuiApplication
  • tst_QItemDelegate
  • tst_QLabel
  • tst_QMainWindow
  • tst_QMdiArea
  • tst_QMenu
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QOpenGlConfig
  • ...
151362
296}-
297uint QChar::toCaseFolded(uint ucs4) noexcept-
298{-
299 if (ucs4 > LastValidCodePoint
ucs4 > LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 65583 times by 2 tests
Evaluated by:
  • tst_QChar
  • tst_QString
)
0-65583
300 return
never executed: return ucs4;
ucs4;
never executed: return ucs4;
0
301 return
executed 65583 times by 2 tests: return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
Executed by:
  • tst_QChar
  • tst_QString
convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
executed 65583 times by 2 tests: return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
Executed by:
  • tst_QChar
  • tst_QString
65583
302}-
303QDataStream &operator<<(QDataStream &out, QChar chr)-
304{-
305 out << quint16(chr.unicode());-
306 return out;-
307}-
308QDataStream &operator>>(QDataStream &in, QChar &chr)-
309{-
310 quint16 u;-
311 in >> u;-
312 chr.unicode() = ushort(u);-
313 return in;-
314}-
315static void decomposeHelper(QString *str, bool canonical, QChar::UnicodeVersion version, int from)-
316{-
317 int length;-
318 int tag;-
319 unsigned short buffer[3];-
320-
321 QString &s = *str;-
322-
323 const unsigned short *utf16 = reinterpret_cast<unsigned short *>(s.data());-
324 const unsigned short *uc = utf16 + s.length();-
325 while (uc != utf16 + from) {-
326 uint ucs4 = *(--uc);-
327 if (QChar(ucs4).isLowSurrogate() && uc != utf16) {-
328 ushort high = *(uc - 1);-
329 if (QChar(high).isHighSurrogate()) {-
330 --uc;-
331 ucs4 = QChar::surrogateToUcs4(high, ucs4);-
332 }-
333 }-
334-
335 if (QChar::unicodeVersion(ucs4) > version)-
336 continue;-
337-
338 const unsigned short *d = decompositionHelper(ucs4, &length, &tag, buffer);-
339 if (!d || (canonical && tag != QChar::Canonical))-
340 continue;-
341-
342 int pos = uc - utf16;-
343 s.replace(pos, QChar::requiresSurrogates(ucs4) ? 2 : 1, reinterpret_cast<const QChar *>(d), length);-
344-
345 utf16 = reinterpret_cast<unsigned short *>(s.data());-
346 uc = utf16 + pos + length;-
347 }-
348}-
349-
350-
351struct UCS2Pair {-
352 ushort u1;-
353 ushort u2;-
354};-
355-
356inline bool operator<(const UCS2Pair &ligature1, const UCS2Pair &ligature2)-
357{ return ligature1.u1 < ligature2.u1; }-
358inline bool operator<(ushort u1, const UCS2Pair &ligature)-
359{ return u1 < ligature.u1; }-
360inline bool operator<(const UCS2Pair &ligature, ushort u1)-
361{ return ligature.u1 < u1; }-
362-
363struct UCS2SurrogatePair {-
364 UCS2Pair p1;-
365 UCS2Pair p2;-
366};-
367-
368inline bool operator<(const UCS2SurrogatePair &ligature1, const UCS2SurrogatePair &ligature2)-
369{ return QChar::surrogateToUcs4(ligature1.p1.u1, ligature1.p1.u2) < QChar::surrogateToUcs4(ligature2.p1.u1, ligature2.p1.u2); }-
370inline bool operator<(uint u1, const UCS2SurrogatePair &ligature)-
371{ return u1 < QChar::surrogateToUcs4(ligature.p1.u1, ligature.p1.u2); }-
372inline bool operator<(const UCS2SurrogatePair &ligature, uint u1)-
373{ return QChar::surrogateToUcs4(ligature.p1.u1, ligature.p1.u2) < u1; }-
374-
375static uint inline ligatureHelper(uint u1, uint u2)-
376{-
377 if (u1 >= Hangul_LBase && u1 <= Hangul_SBase + Hangul_SCount) {-
378-
379-
380 const uint LIndex = u1 - Hangul_LBase;-
381 if (LIndex < Hangul_LCount) {-
382 const uint VIndex = u2 - Hangul_VBase;-
383 if (VIndex < Hangul_VCount)-
384 return Hangul_SBase + (LIndex * Hangul_VCount + VIndex) * Hangul_TCount;-
385 }-
386-
387 const uint SIndex = u1 - Hangul_SBase;-
388 if (SIndex < Hangul_SCount && (SIndex % Hangul_TCount) == 0) {-
389 const uint TIndex = u2 - Hangul_TBase;-
390 if (TIndex <= Hangul_TCount)-
391 return u1 + TIndex;-
392 }-
393 }-
394-
395 const unsigned short index = (u2 < 0x3100 ? (uc_ligature_trie[uc_ligature_trie[u2>>5] + (u2 & 0x1f)]) : (u2 < 0x12000 ? uc_ligature_trie[uc_ligature_trie[((u2 - 0x3100)>>8) + 0x188] + (u2 & 0xff)] : 0xffff));-
396 if (index == 0xffff)-
397 return 0;-
398 const unsigned short *ligatures = uc_ligature_map+index;-
399 ushort length = *ligatures++;-
400 if (QChar::requiresSurrogates(u1)) {-
401 const UCS2SurrogatePair *data = reinterpret_cast<const UCS2SurrogatePair *>(ligatures);-
402 const UCS2SurrogatePair *r = std::lower_bound(data, data + length, u1);-
403 if (r != data + length && QChar::surrogateToUcs4(r->p1.u1, r->p1.u2) == u1)-
404 return QChar::surrogateToUcs4(r->p2.u1, r->p2.u2);-
405 } else {-
406 const UCS2Pair *data = reinterpret_cast<const UCS2Pair *>(ligatures);-
407 const UCS2Pair *r = std::lower_bound(data, data + length, ushort(u1));-
408 if (r != data + length && r->u1 == ushort(u1))-
409 return r->u2;-
410 }-
411-
412 return 0;-
413}-
414-
415static void composeHelper(QString *str, QChar::UnicodeVersion version, int from)-
416{-
417 QString &s = *str;-
418-
419 if (from < 0 || s.length() - from < 2)-
420 return;-
421-
422 uint stcode = 0;-
423 int starter = -1;-
424 int next = -1;-
425 int lastCombining = 255;-
426-
427 int pos = from;-
428 while (pos < s.length()) {-
429 int i = pos;-
430 uint uc = s.at(pos).unicode();-
431 if (QChar(uc).isHighSurrogate() && pos < s.length()-1) {-
432 ushort low = s.at(pos+1).unicode();-
433 if (QChar(low).isLowSurrogate()) {-
434 uc = QChar::surrogateToUcs4(uc, low);-
435 ++pos;-
436 }-
437 }-
438-
439 const QUnicodeTables::Properties *p = qGetProp(uc);-
440 if (p->unicodeVersion > version) {-
441 starter = -1;-
442 next = -1;-
443 lastCombining = 255;-
444 ++pos;-
445 continue;-
446 }-
447-
448 int combining = p->combiningClass;-
449 if ((i == next || combining > lastCombining) && starter >= from) {-
450-
451 uint ligature = ligatureHelper(stcode, uc);-
452 if (ligature) {-
453 stcode = ligature;-
454 QChar *d = s.data();-
455-
456 if (QChar::requiresSurrogates(ligature)) {-
457 d[starter] = QChar::highSurrogate(ligature);-
458 d[starter + 1] = QChar::lowSurrogate(ligature);-
459 s.remove(i, 2);-
460 } else {-
461 d[starter] = ligature;-
462 s.remove(i, 1);-
463 }-
464 continue;-
465 }-
466 }-
467 if (combining == 0) {-
468 starter = i;-
469 stcode = uc;-
470 next = pos + 1;-
471 }-
472 lastCombining = combining;-
473-
474 ++pos;-
475 }-
476}-
477-
478-
479static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, int from)-
480{-
481 QString &s = *str;-
482 const int l = s.length()-1;-
483-
484 uint u1, u2;-
485 ushort c1, c2;-
486-
487 int pos = from;-
488 while (pos < l) {-
489 int p2 = pos+1;-
490 u1 = s.at(pos).unicode();-
491 if (QChar(u1).isHighSurrogate()) {-
492 ushort low = s.at(p2).unicode();-
493 if (QChar(low).isLowSurrogate()) {-
494 u1 = QChar::surrogateToUcs4(u1, low);-
495 if (p2 >= l)-
496 break;-
497 ++p2;-
498 }-
499 }-
500 c1 = 0;-
501-
502 advance:-
503 u2 = s.at(p2).unicode();-
504 if (QChar(u2).isHighSurrogate() && p2 < l) {-
505 ushort low = s.at(p2+1).unicode();-
506 if (QChar(low).isLowSurrogate()) {-
507 u2 = QChar::surrogateToUcs4(u2, low);-
508 ++p2;-
509 }-
510 }-
511-
512 c2 = 0;-
513 {-
514 const QUnicodeTables::Properties *p = qGetProp(u2);-
515 if (p->unicodeVersion <= version)-
516 c2 = p->combiningClass;-
517 }-
518 if (c2 == 0) {-
519 pos = p2+1;-
520 continue;-
521 }-
522-
523 if (c1 == 0) {-
524 const QUnicodeTables::Properties *p = qGetProp(u1);-
525 if (p->unicodeVersion <= version)-
526 c1 = p->combiningClass;-
527 }-
528-
529 if (c1 > c2) {-
530 QChar *uc = s.data();-
531 int p = pos;-
532-
533 if (!QChar::requiresSurrogates(u2)) {-
534 uc[p++] = u2;-
535 } else {-
536 uc[p++] = QChar::highSurrogate(u2);-
537 uc[p++] = QChar::lowSurrogate(u2);-
538 }-
539 if (!QChar::requiresSurrogates(u1)) {-
540 uc[p++] = u1;-
541 } else {-
542 uc[p++] = QChar::highSurrogate(u1);-
543 uc[p++] = QChar::lowSurrogate(u1);-
544 }-
545 if (pos > 0)-
546 --pos;-
547 if (pos > 0 && s.at(pos).isLowSurrogate())-
548 --pos;-
549 } else {-
550 ++pos;-
551 if (QChar::requiresSurrogates(u1))-
552 ++pos;-
553-
554 u1 = u2;-
555 c1 = c2;-
556 p2 = pos + 1;-
557 if (QChar::requiresSurrogates(u1))-
558 ++p2;-
559 if (p2 > l)-
560 break;-
561-
562 goto advance;-
563 }-
564 }-
565}-
566-
567-
568-
569static bool normalizationQuickCheckHelper(QString *str, QString::NormalizationForm mode, int from, int *lastStable)-
570{-
571 static_assert(bool(QString::NormalizationForm_D == 0), "QString::NormalizationForm_D == 0");-
572 static_assert(bool(QString::NormalizationForm_C == 1), "QString::NormalizationForm_C == 1");-
573 static_assert(bool(QString::NormalizationForm_KD == 2), "QString::NormalizationForm_KD == 2");-
574 static_assert(bool(QString::NormalizationForm_KC == 3), "QString::NormalizationForm_KC == 3");-
575-
576 enum { NFQC_YES = 0, NFQC_NO = 1, NFQC_MAYBE = 3 };-
577-
578 const ushort *string = reinterpret_cast<const ushort *>(str->constData());-
579 int length = str->length();-
580-
581-
582 while (length > from && QChar::isHighSurrogate(string[length - 1]))-
583 --length;-
584-
585 uchar lastCombining = 0;-
586 for (int i = from; i < length; ++i) {-
587 int pos = i;-
588 uint uc = string[i];-
589 if (uc < 0x80) {-
590-
591 lastCombining = 0;-
592 *lastStable = pos;-
593 continue;-
594 }-
595-
596 if (QChar::isHighSurrogate(uc)) {-
597 ushort low = string[i + 1];-
598 if (!QChar::isLowSurrogate(low)) {-
599-
600 lastCombining = 0;-
601 *lastStable = pos;-
602 continue;-
603 }-
604 ++i;-
605 uc = QChar::surrogateToUcs4(uc, low);-
606 }-
607-
608 const QUnicodeTables::Properties *p = qGetProp(uc);-
609-
610 if (p->combiningClass < lastCombining && p->combiningClass > 0)-
611 return false;-
612-
613 const uchar check = (p->nfQuickCheck >> (mode << 1)) & 0x03;-
614 if (check != NFQC_YES)-
615 return false;-
616-
617 lastCombining = p->combiningClass;-
618 if (lastCombining == 0)-
619 *lastStable = pos;-
620 }-
621-
622 if (length != str->length())-
623 *lastStable = str->length() - 1;-
624-
625 return true;-
626}-
627-
628-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9