summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-02 15:43:18 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-02 15:43:19 -0700
commitd19e912dd469e4bdad9f3020e1f6eb98f10f3470 (patch)
tree239cb568a80445f14a1ab9b63dcaaddcce67e1cc
parent12f3e4a58f05850b93af35619cb04f0231d86acc (diff)
downloadpdfium-d19e912dd469e4bdad9f3020e1f6eb98f10f3470.tar.xz
Remove FX_BOOL from xfa.
Review-Url: https://codereview.chromium.org/2467203003
-rw-r--r--xfa/fde/cfde_path.cpp18
-rw-r--r--xfa/fde/cfde_path.h14
-rw-r--r--xfa/fde/cfde_txtedtbuf.cpp34
-rw-r--r--xfa/fde/cfde_txtedtbuf.h6
-rw-r--r--xfa/fde/cfde_txtedtbufiter.cpp12
-rw-r--r--xfa/fde/cfde_txtedtbufiter.h4
-rw-r--r--xfa/fde/cfde_txtedtdorecord_deleterange.cpp14
-rw-r--r--xfa/fde/cfde_txtedtdorecord_deleterange.h8
-rw-r--r--xfa/fde/cfde_txtedtdorecord_insert.cpp12
-rw-r--r--xfa/fde/cfde_txtedtdorecord_insert.h4
-rw-r--r--xfa/fde/cfde_txtedtengine.cpp218
-rw-r--r--xfa/fde/cfde_txtedtengine.h60
-rw-r--r--xfa/fde/cfde_txtedtpage.cpp65
-rw-r--r--xfa/fde/cfde_txtedtpage.h8
-rw-r--r--xfa/fde/cfde_txtedtparag.cpp16
-rw-r--r--xfa/fde/cfde_txtedttextset.cpp4
-rw-r--r--xfa/fde/cfde_txtedttextset.h4
-rw-r--r--xfa/fde/cfx_chariter.cpp10
-rw-r--r--xfa/fde/cfx_chariter.h4
-rw-r--r--xfa/fde/cfx_wordbreak.cpp44
-rw-r--r--xfa/fde/cfx_wordbreak.h8
-rw-r--r--xfa/fde/css/cfde_cssrulecollection.cpp10
-rw-r--r--xfa/fde/css/fde_css.h8
-rw-r--r--xfa/fde/css/fde_csscache.h2
-rw-r--r--xfa/fde/css/fde_cssdatatable.cpp92
-rw-r--r--xfa/fde/css/fde_cssdatatable.h34
-rw-r--r--xfa/fde/css/fde_cssdeclaration.cpp189
-rw-r--r--xfa/fde/css/fde_cssdeclaration.h125
-rw-r--r--xfa/fde/css/fde_cssstyleselector.cpp136
-rw-r--r--xfa/fde/css/fde_cssstyleselector.h55
-rw-r--r--xfa/fde/css/fde_cssstylesheet.cpp31
-rw-r--r--xfa/fde/css/fde_cssstylesheet.h18
-rw-r--r--xfa/fde/css/fde_csssyntax.cpp75
-rw-r--r--xfa/fde/css/fde_csssyntax.h38
-rw-r--r--xfa/fde/fde_gedevice.cpp168
-rw-r--r--xfa/fde/fde_gedevice.h158
-rw-r--r--xfa/fde/fde_iterator.cpp12
-rw-r--r--xfa/fde/fde_iterator.h4
-rw-r--r--xfa/fde/fde_render.cpp20
-rw-r--r--xfa/fde/fde_render.h6
-rw-r--r--xfa/fde/fde_visualset.h4
-rw-r--r--xfa/fde/ifde_txtedtdorecord.h4
-rw-r--r--xfa/fde/ifde_txtedtengine.h2
-rw-r--r--xfa/fde/ifde_txtedtpage.h6
-rw-r--r--xfa/fde/ifx_chariter.h4
-rw-r--r--xfa/fde/tto/fde_textout.cpp102
-rw-r--r--xfa/fde/tto/fde_textout.h28
-rw-r--r--xfa/fde/xml/cfx_saxreader.cpp32
-rw-r--r--xfa/fde/xml/cfx_saxreader.h16
-rw-r--r--xfa/fde/xml/fde_xml.h2
-rw-r--r--xfa/fde/xml/fde_xml_imp.cpp103
-rw-r--r--xfa/fde/xml/fde_xml_imp.h48
-rw-r--r--xfa/fgas/crt/fgas_codepage.cpp4
-rw-r--r--xfa/fgas/crt/fgas_codepage.h2
-rw-r--r--xfa/fgas/crt/fgas_stream.cpp300
-rw-r--r--xfa/fgas/crt/fgas_stream.h8
-rw-r--r--xfa/fgas/crt/fgas_utils.cpp18
-rw-r--r--xfa/fgas/crt/fgas_utils.h30
-rw-r--r--xfa/fgas/font/fgas_font.h2
-rw-r--r--xfa/fgas/font/fgas_gefont.cpp114
-rw-r--r--xfa/fgas/font/fgas_gefont.h52
-rw-r--r--xfa/fgas/font/fgas_stdfontmgr.cpp62
-rw-r--r--xfa/fgas/font/fgas_stdfontmgr.h12
-rw-r--r--xfa/fgas/layout/fgas_rtfbreak.cpp152
-rw-r--r--xfa/fgas/layout/fgas_rtfbreak.h36
-rw-r--r--xfa/fgas/layout/fgas_textbreak.cpp201
-rw-r--r--xfa/fgas/layout/fgas_textbreak.h52
-rw-r--r--xfa/fgas/layout/fgas_unicode.h12
-rw-r--r--xfa/fgas/localization/fgas_datetime.cpp122
-rw-r--r--xfa/fgas/localization/fgas_datetime.h82
-rw-r--r--xfa/fgas/localization/fgas_locale.cpp855
-rw-r--r--xfa/fgas/localization/fgas_locale.h30
-rw-r--r--xfa/fgas/localization/fgas_localeimp.h86
-rw-r--r--xfa/fwl/core/cfwl_barcode.cpp16
-rw-r--r--xfa/fwl/core/cfwl_barcode.h20
-rw-r--r--xfa/fwl/core/cfwl_combobox.cpp74
-rw-r--r--xfa/fwl/core/cfwl_combobox.h42
-rw-r--r--xfa/fwl/core/cfwl_datetimepicker.cpp26
-rw-r--r--xfa/fwl/core/cfwl_datetimepicker.h26
-rw-r--r--xfa/fwl/core/cfwl_edit.cpp32
-rw-r--r--xfa/fwl/core/cfwl_edit.h32
-rw-r--r--xfa/fwl/core/cfwl_event.h2
-rw-r--r--xfa/fwl/core/cfwl_listbox.cpp24
-rw-r--r--xfa/fwl/core/cfwl_listbox.h15
-rw-r--r--xfa/fwl/core/cfwl_widget.cpp4
-rw-r--r--xfa/fwl/core/cfwl_widget.h4
-rw-r--r--xfa/fwl/core/cfwl_widgetmgr.cpp108
-rw-r--r--xfa/fwl/core/cfwl_widgetmgr.h30
-rw-r--r--xfa/fwl/core/cfx_barcode.cpp142
-rw-r--r--xfa/fwl/core/cfx_barcode.h52
-rw-r--r--xfa/fwl/core/fwl_noteimp.cpp173
-rw-r--r--xfa/fwl/core/fwl_noteimp.h54
-rw-r--r--xfa/fwl/core/ifwl_barcode.cpp10
-rw-r--r--xfa/fwl/core/ifwl_barcode.h8
-rw-r--r--xfa/fwl/core/ifwl_caret.cpp6
-rw-r--r--xfa/fwl/core/ifwl_caret.h4
-rw-r--r--xfa/fwl/core/ifwl_checkbox.cpp30
-rw-r--r--xfa/fwl/core/ifwl_checkbox.h6
-rw-r--r--xfa/fwl/core/ifwl_combobox.cpp168
-rw-r--r--xfa/fwl/core/ifwl_combobox.h62
-rw-r--r--xfa/fwl/core/ifwl_comboboxproxy.cpp32
-rw-r--r--xfa/fwl/core/ifwl_comboboxproxy.h8
-rw-r--r--xfa/fwl/core/ifwl_comboedit.cpp16
-rw-r--r--xfa/fwl/core/ifwl_comboedit.h4
-rw-r--r--xfa/fwl/core/ifwl_combolist.cpp46
-rw-r--r--xfa/fwl/core/ifwl_combolist.h6
-rw-r--r--xfa/fwl/core/ifwl_datetimecalendar.cpp10
-rw-r--r--xfa/fwl/core/ifwl_datetimecalendar.h2
-rw-r--r--xfa/fwl/core/ifwl_datetimeedit.cpp2
-rw-r--r--xfa/fwl/core/ifwl_datetimepicker.cpp91
-rw-r--r--xfa/fwl/core/ifwl_datetimepicker.h46
-rw-r--r--xfa/fwl/core/ifwl_edit.cpp317
-rw-r--r--xfa/fwl/core/ifwl_edit.h86
-rw-r--r--xfa/fwl/core/ifwl_form.cpp68
-rw-r--r--xfa/fwl/core/ifwl_form.h24
-rw-r--r--xfa/fwl/core/ifwl_formproxy.cpp4
-rw-r--r--xfa/fwl/core/ifwl_formproxy.h2
-rw-r--r--xfa/fwl/core/ifwl_listbox.cpp153
-rw-r--r--xfa/fwl/core/ifwl_listbox.h44
-rw-r--r--xfa/fwl/core/ifwl_monthcalendar.cpp119
-rw-r--r--xfa/fwl/core/ifwl_monthcalendar.h56
-rw-r--r--xfa/fwl/core/ifwl_picturebox.cpp16
-rw-r--r--xfa/fwl/core/ifwl_picturebox.h8
-rw-r--r--xfa/fwl/core/ifwl_pushbutton.cpp34
-rw-r--r--xfa/fwl/core/ifwl_pushbutton.h8
-rw-r--r--xfa/fwl/core/ifwl_scrollbar.cpp64
-rw-r--r--xfa/fwl/core/ifwl_scrollbar.h26
-rw-r--r--xfa/fwl/core/ifwl_spinbutton.cpp84
-rw-r--r--xfa/fwl/core/ifwl_spinbutton.h12
-rw-r--r--xfa/fwl/core/ifwl_tooltip.cpp14
-rw-r--r--xfa/fwl/core/ifwl_tooltip.h8
-rw-r--r--xfa/fwl/core/ifwl_widget.cpp108
-rw-r--r--xfa/fwl/core/ifwl_widget.h66
-rw-r--r--xfa/fwl/theme/cfwl_arrowdata.cpp2
-rw-r--r--xfa/fwl/theme/cfwl_arrowdata.h2
-rw-r--r--xfa/fwl/theme/cfwl_monthcalendartp.cpp8
-rw-r--r--xfa/fwl/theme/cfwl_scrollbartp.cpp18
-rw-r--r--xfa/fwl/theme/cfwl_scrollbartp.h10
-rw-r--r--xfa/fwl/theme/cfwl_widgettp.cpp20
-rw-r--r--xfa/fwl/theme/cfwl_widgettp.h10
-rw-r--r--xfa/fxbarcode/BC_TwoDimWriter.cpp2
-rw-r--r--xfa/fxbarcode/BC_TwoDimWriter.h4
-rw-r--r--xfa/fxbarcode/BC_Utils.cpp14
-rw-r--r--xfa/fxbarcode/BC_Writer.cpp24
-rw-r--r--xfa/fxbarcode/BC_Writer.h10
-rw-r--r--xfa/fxbarcode/cbc_codabar.cpp44
-rw-r--r--xfa/fxbarcode/cbc_codabar.h22
-rw-r--r--xfa/fxbarcode/cbc_code128.cpp34
-rw-r--r--xfa/fxbarcode/cbc_code128.h16
-rw-r--r--xfa/fxbarcode/cbc_code39.cpp38
-rw-r--r--xfa/fxbarcode/cbc_code39.h18
-rw-r--r--xfa/fxbarcode/cbc_codebase.cpp10
-rw-r--r--xfa/fxbarcode/cbc_codebase.h26
-rw-r--r--xfa/fxbarcode/cbc_datamatrix.cpp26
-rw-r--r--xfa/fxbarcode/cbc_datamatrix.h14
-rw-r--r--xfa/fxbarcode/cbc_ean13.cpp30
-rw-r--r--xfa/fxbarcode/cbc_ean13.h14
-rw-r--r--xfa/fxbarcode/cbc_ean8.cpp30
-rw-r--r--xfa/fxbarcode/cbc_ean8.h14
-rw-r--r--xfa/fxbarcode/cbc_onecode.cpp10
-rw-r--r--xfa/fxbarcode/cbc_onecode.h8
-rw-r--r--xfa/fxbarcode/cbc_pdf417i.cpp32
-rw-r--r--xfa/fxbarcode/cbc_pdf417i.h18
-rw-r--r--xfa/fxbarcode/cbc_qrcode.cpp34
-rw-r--r--xfa/fxbarcode/cbc_qrcode.h18
-rw-r--r--xfa/fxbarcode/cbc_upca.cpp30
-rw-r--r--xfa/fxbarcode/cbc_upca.h14
-rw-r--r--xfa/fxbarcode/common/BC_CommonBitArray.cpp18
-rw-r--r--xfa/fxbarcode/common/BC_CommonBitArray.h4
-rw-r--r--xfa/fxbarcode/common/BC_CommonBitMatrix.cpp2
-rw-r--r--xfa/fxbarcode/common/BC_CommonBitMatrix.h2
-rw-r--r--xfa/fxbarcode/common/BC_CommonByteArray.cpp2
-rw-r--r--xfa/fxbarcode/common/BC_CommonByteArray.h2
-rw-r--r--xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp2
-rw-r--r--xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h2
-rw-r--r--xfa/fxbarcode/datamatrix/BC_Base256Encoder.cpp2
-rw-r--r--xfa/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp2
-rw-r--r--xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp10
-rw-r--r--xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.h2
-rw-r--r--xfa/fxbarcode/datamatrix/BC_DefaultPlacement.cpp10
-rw-r--r--xfa/fxbarcode/datamatrix/BC_DefaultPlacement.h6
-rw-r--r--xfa/fxbarcode/datamatrix/BC_EdifactEncoder.cpp6
-rw-r--r--xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp2
-rw-r--r--xfa/fxbarcode/datamatrix/BC_EncoderContext.h2
-rw-r--r--xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp20
-rw-r--r--xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h16
-rw-r--r--xfa/fxbarcode/datamatrix/BC_SymbolInfo.cpp74
-rw-r--r--xfa/fxbarcode/datamatrix/BC_SymbolInfo.h14
-rw-r--r--xfa/fxbarcode/oned/BC_OneDimWriter.cpp25
-rw-r--r--xfa/fxbarcode/oned/BC_OneDimWriter.h18
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp48
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h14
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp24
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCode128Writer.h8
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp20
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCode39Writer.h8
-rw-r--r--xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp10
-rw-r--r--xfa/fxbarcode/oned/BC_OnedEAN13Writer.h4
-rw-r--r--xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp15
-rw-r--r--xfa/fxbarcode/oned/BC_OnedEAN8Writer.h6
-rw-r--r--xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp13
-rw-r--r--xfa/fxbarcode/oned/BC_OnedUPCAWriter.h4
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417.cpp10
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417.h6
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp2
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h2
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp4
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h4
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp16
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h12
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp16
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417Writer.h6
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRCodeWriter.cpp14
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRCodeWriter.h4
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRCoder.cpp2
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRCoder.h2
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp8
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp18
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRCoderMaskUtil.h10
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp7
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h4
-rw-r--r--xfa/fxbarcode/utils.h10
-rw-r--r--xfa/fxfa/app/cxfa_eventparam.cpp24
-rw-r--r--xfa/fxfa/app/xfa_checksum.cpp26
-rw-r--r--xfa/fxfa/app/xfa_ffapp.cpp8
-rw-r--r--xfa/fxfa/app/xfa_ffbarcode.cpp20
-rw-r--r--xfa/fxfa/app/xfa_ffbarcode.h6
-rw-r--r--xfa/fxfa/app/xfa_ffcheckbutton.cpp32
-rw-r--r--xfa/fxfa/app/xfa_ffcheckbutton.h12
-rw-r--r--xfa/fxfa/app/xfa_ffchoicelist.cpp122
-rw-r--r--xfa/fxfa/app/xfa_ffchoicelist.h66
-rw-r--r--xfa/fxfa/app/xfa_ffdoc.cpp41
-rw-r--r--xfa/fxfa/app/xfa_ffdochandler.cpp14
-rw-r--r--xfa/fxfa/app/xfa_ffdocview.cpp100
-rw-r--r--xfa/fxfa/app/xfa_fffield.cpp186
-rw-r--r--xfa/fxfa/app/xfa_fffield.h60
-rw-r--r--xfa/fxfa/app/xfa_ffimage.cpp6
-rw-r--r--xfa/fxfa/app/xfa_ffimage.h4
-rw-r--r--xfa/fxfa/app/xfa_ffimageedit.cpp28
-rw-r--r--xfa/fxfa/app/xfa_ffimageedit.h8
-rw-r--r--xfa/fxfa/app/xfa_ffnotify.cpp18
-rw-r--r--xfa/fxfa/app/xfa_ffnotify.h12
-rw-r--r--xfa/fxfa/app/xfa_ffpageview.cpp50
-rw-r--r--xfa/fxfa/app/xfa_ffpath.cpp4
-rw-r--r--xfa/fxfa/app/xfa_ffpushbutton.cpp8
-rw-r--r--xfa/fxfa/app/xfa_ffpushbutton.h4
-rw-r--r--xfa/fxfa/app/xfa_ffsignature.cpp96
-rw-r--r--xfa/fxfa/app/xfa_ffsignature.h36
-rw-r--r--xfa/fxfa/app/xfa_fftext.cpp42
-rw-r--r--xfa/fxfa/app/xfa_fftext.h10
-rw-r--r--xfa/fxfa/app/xfa_fftextedit.cpp192
-rw-r--r--xfa/fxfa/app/xfa_fftextedit.h106
-rw-r--r--xfa/fxfa/app/xfa_ffwidget.cpp368
-rw-r--r--xfa/fxfa/app/xfa_ffwidgetacc.cpp184
-rw-r--r--xfa/fxfa/app/xfa_ffwidgetacc.h12
-rw-r--r--xfa/fxfa/app/xfa_ffwidgethandler.cpp172
-rw-r--r--xfa/fxfa/app/xfa_fontmgr.cpp4
-rw-r--r--xfa/fxfa/app/xfa_fwladapter.cpp12
-rw-r--r--xfa/fxfa/app/xfa_fwladapter.h10
-rw-r--r--xfa/fxfa/app/xfa_textlayout.cpp267
-rw-r--r--xfa/fxfa/app/xfa_textlayout.h108
-rw-r--r--xfa/fxfa/cxfa_eventparam.h12
-rw-r--r--xfa/fxfa/fm2js/xfa_expression.cpp2
-rw-r--r--xfa/fxfa/fm2js/xfa_expression.h4
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jscontext.cpp346
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jscontext.h130
-rw-r--r--xfa/fxfa/fm2js/xfa_fmparse.cpp16
-rw-r--r--xfa/fxfa/fm2js/xfa_lexer.cpp48
-rw-r--r--xfa/fxfa/fm2js/xfa_lexer.h2
-rw-r--r--xfa/fxfa/fm2js/xfa_simpleexpression.cpp12
-rw-r--r--xfa/fxfa/fm2js/xfa_simpleexpression.h8
-rw-r--r--xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp2
-rw-r--r--xfa/fxfa/fxfa.h64
-rw-r--r--xfa/fxfa/fxfa_basic.h2
-rw-r--r--xfa/fxfa/fxfa_widget.h42
-rw-r--r--xfa/fxfa/parser/cscript_datawindow.cpp8
-rw-r--r--xfa/fxfa/parser/cscript_datawindow.h10
-rw-r--r--xfa/fxfa/parser/cscript_eventpseudomodel.cpp40
-rw-r--r--xfa/fxfa/parser/cscript_eventpseudomodel.h50
-rw-r--r--xfa/fxfa/parser/cscript_hostpseudomodel.cpp75
-rw-r--r--xfa/fxfa/parser/cscript_hostpseudomodel.h40
-rw-r--r--xfa/fxfa/parser/cscript_layoutpseudomodel.cpp28
-rw-r--r--xfa/fxfa/parser/cscript_layoutpseudomodel.h8
-rw-r--r--xfa/fxfa/parser/cscript_signaturepseudomodel.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_arraynodelist.cpp13
-rw-r--r--xfa/fxfa/parser/cxfa_attachnodelist.cpp7
-rw-r--r--xfa/fxfa/parser/cxfa_binditems.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_binditems.h2
-rw-r--r--xfa/fxfa/parser/cxfa_box.cpp26
-rw-r--r--xfa/fxfa/parser/cxfa_box.h10
-rw-r--r--xfa/fxfa/parser/cxfa_calculate.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_containerlayoutitem.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_contentlayoutitem.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_data.cpp12
-rw-r--r--xfa/fxfa/parser/cxfa_data.h8
-rw-r--r--xfa/fxfa/parser/cxfa_dataexporter.cpp82
-rw-r--r--xfa/fxfa/parser/cxfa_dataexporter.h18
-rw-r--r--xfa/fxfa/parser/cxfa_dataimporter.cpp14
-rw-r--r--xfa/fxfa/parser/cxfa_dataimporter.h2
-rw-r--r--xfa/fxfa/parser/cxfa_document.cpp18
-rw-r--r--xfa/fxfa/parser/cxfa_document.h14
-rw-r--r--xfa/fxfa/parser/cxfa_document_parser.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_exdata.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_exdata.h2
-rw-r--r--xfa/fxfa/parser/cxfa_fill.cpp12
-rw-r--r--xfa/fxfa/parser/cxfa_fill.h2
-rw-r--r--xfa/fxfa/parser/cxfa_font.cpp6
-rw-r--r--xfa/fxfa/parser/cxfa_font.h4
-rw-r--r--xfa/fxfa/parser/cxfa_image.cpp16
-rw-r--r--xfa/fxfa/parser/cxfa_image.h16
-rw-r--r--xfa/fxfa/parser/cxfa_layoutitem.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_layoutitem.h10
-rw-r--r--xfa/fxfa/parser/cxfa_layoutpagemgr.cpp347
-rw-r--r--xfa/fxfa/parser/cxfa_layoutpagemgr.h109
-rw-r--r--xfa/fxfa/parser/cxfa_layoutprocessor.cpp20
-rw-r--r--xfa/fxfa/parser/cxfa_layoutprocessor.h10
-rw-r--r--xfa/fxfa/parser/cxfa_line.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_line.h2
-rw-r--r--xfa/fxfa/parser/cxfa_margin.cpp9
-rw-r--r--xfa/fxfa/parser/cxfa_margin.h8
-rw-r--r--xfa/fxfa/parser/cxfa_measurement.cpp40
-rw-r--r--xfa/fxfa/parser/cxfa_measurement.h4
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp738
-rw-r--r--xfa/fxfa/parser/cxfa_nodehelper.cpp72
-rw-r--r--xfa/fxfa/parser/cxfa_nodehelper.h30
-rw-r--r--xfa/fxfa/parser/cxfa_nodelist.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_object.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_occur.cpp24
-rw-r--r--xfa/fxfa/parser/cxfa_occur.h2
-rw-r--r--xfa/fxfa/parser/cxfa_resolveprocessor.cpp46
-rw-r--r--xfa/fxfa/parser/cxfa_script.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_scriptcontext.cpp120
-rw-r--r--xfa/fxfa/parser/cxfa_scriptcontext.h41
-rw-r--r--xfa/fxfa/parser/cxfa_simple_parser.cpp116
-rw-r--r--xfa/fxfa/parser/cxfa_simple_parser.h6
-rw-r--r--xfa/fxfa/parser/cxfa_stroke.cpp20
-rw-r--r--xfa/fxfa/parser/cxfa_stroke.h4
-rw-r--r--xfa/fxfa/parser/cxfa_submit.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_submit.h2
-rw-r--r--xfa/fxfa/parser/cxfa_tooltip.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_tooltip.h2
-rw-r--r--xfa/fxfa/parser/cxfa_validate.cpp22
-rw-r--r--xfa/fxfa/parser/cxfa_validate.h8
-rw-r--r--xfa/fxfa/parser/cxfa_value.cpp8
-rw-r--r--xfa/fxfa/parser/cxfa_value.h2
-rw-r--r--xfa/fxfa/parser/cxfa_widetextread.cpp8
-rw-r--r--xfa/fxfa/parser/cxfa_widetextread.h8
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.cpp400
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.h139
-rw-r--r--xfa/fxfa/parser/cxfa_xml_parser.cpp4
-rw-r--r--xfa/fxfa/parser/xfa_document_datamerger_imp.cpp222
-rw-r--r--xfa/fxfa/parser/xfa_document_datamerger_imp.h2
-rw-r--r--xfa/fxfa/parser/xfa_layout_itemlayout.cpp504
-rw-r--r--xfa/fxfa/parser/xfa_layout_itemlayout.h84
-rw-r--r--xfa/fxfa/parser/xfa_locale.cpp28
-rw-r--r--xfa/fxfa/parser/xfa_locale.h20
-rw-r--r--xfa/fxfa/parser/xfa_localemgr.cpp4
-rw-r--r--xfa/fxfa/parser/xfa_localevalue.cpp263
-rw-r--r--xfa/fxfa/parser/xfa_localevalue.h96
-rw-r--r--xfa/fxfa/parser/xfa_object.h368
-rw-r--r--xfa/fxfa/parser/xfa_resolvenode_rs.h2
-rw-r--r--xfa/fxfa/parser/xfa_utils.cpp24
-rw-r--r--xfa/fxfa/parser/xfa_utils.h38
-rw-r--r--xfa/fxfa/xfa_checksum.h8
-rw-r--r--xfa/fxfa/xfa_ffapp.h2
-rw-r--r--xfa/fxfa/xfa_ffdoc.h10
-rw-r--r--xfa/fxfa/xfa_ffdochandler.h10
-rw-r--r--xfa/fxfa/xfa_ffdocview.h28
-rw-r--r--xfa/fxfa/xfa_ffpageview.h14
-rw-r--r--xfa/fxfa/xfa_ffwidget.h114
-rw-r--r--xfa/fxfa/xfa_ffwidgethandler.h78
-rw-r--r--xfa/fxfa/xfa_rendercontext.h6
-rw-r--r--xfa/fxgraphics/cfx_graphics.cpp40
-rw-r--r--xfa/fxgraphics/cfx_graphics.h19
-rw-r--r--xfa/fxgraphics/cfx_path.cpp8
-rw-r--r--xfa/fxgraphics/cfx_path.h2
-rw-r--r--xfa/fxgraphics/cfx_path_generator.cpp6
-rw-r--r--xfa/fxgraphics/cfx_shading.cpp8
-rw-r--r--xfa/fxgraphics/cfx_shading.h12
379 files changed, 8124 insertions, 8301 deletions
diff --git a/xfa/fde/cfde_path.cpp b/xfa/fde/cfde_path.cpp
index f18eab54d2..23aad50549 100644
--- a/xfa/fde/cfde_path.cpp
+++ b/xfa/fde/cfde_path.cpp
@@ -8,15 +8,15 @@
#include "xfa/fde/fde_object.h"
-FX_BOOL CFDE_Path::StartFigure() {
+bool CFDE_Path::StartFigure() {
return CloseFigure();
}
-FX_BOOL CFDE_Path::CloseFigure() {
+bool CFDE_Path::CloseFigure() {
FX_PATHPOINT* pPoint = GetLastPoint();
if (pPoint)
pPoint->m_Flag |= FXPT_CLOSEFIGURE;
- return TRUE;
+ return true;
}
FX_PATHPOINT* CFDE_Path::GetLastPoint(int32_t iCount) const {
@@ -29,9 +29,9 @@ FX_PATHPOINT* CFDE_Path::GetLastPoint(int32_t iCount) const {
return m_Path.GetPoints() + iPoints - iCount;
}
-FX_BOOL CFDE_Path::FigureClosed() const {
+bool CFDE_Path::FigureClosed() const {
FX_PATHPOINT* pPoint = GetLastPoint();
- return pPoint ? (pPoint->m_Flag & FXPT_CLOSEFIGURE) : TRUE;
+ return pPoint ? (pPoint->m_Flag & FXPT_CLOSEFIGURE) : true;
}
FX_PATHPOINT* CFDE_Path::AddPoints(int32_t iCount) {
@@ -72,7 +72,7 @@ void CFDE_Path::BezierTo(const CFX_PointF& p1,
p[2].m_Flag = FXPT_BEZIERTO;
}
-void CFDE_Path::ArcTo(FX_BOOL bStart,
+void CFDE_Path::ArcTo(bool bStart,
const CFX_RectF& rect,
FX_FLOAT startAngle,
FX_FLOAT endAngle) {
@@ -129,7 +129,7 @@ void CFDE_Path::AddBeziers(const CFX_PointsF& points) {
void CFDE_Path::GetCurveTangents(const CFX_PointsF& points,
CFX_PointsF& tangents,
- FX_BOOL bClosed,
+ bool bClosed,
FX_FLOAT fTension) const {
int32_t iCount = points.GetSize();
tangents.SetSize(iCount);
@@ -153,7 +153,7 @@ void CFDE_Path::GetCurveTangents(const CFX_PointsF& points,
}
void CFDE_Path::AddCurve(const CFX_PointsF& points,
- FX_BOOL bClosed,
+ bool bClosed,
FX_FLOAT fTension) {
int32_t iLast = points.GetUpperBound();
if (iLast < 1)
@@ -201,7 +201,7 @@ void CFDE_Path::AddLine(const CFX_PointF& pt1, const CFX_PointF& pt2) {
LineTo(pt2);
}
-void CFDE_Path::AddPath(const CFDE_Path* pSrc, FX_BOOL bConnect) {
+void CFDE_Path::AddPath(const CFDE_Path* pSrc, bool bConnect) {
if (!pSrc)
return;
diff --git a/xfa/fde/cfde_path.h b/xfa/fde/cfde_path.h
index 34619d45ef..b0359cd198 100644
--- a/xfa/fde/cfde_path.h
+++ b/xfa/fde/cfde_path.h
@@ -13,18 +13,18 @@
class CFDE_Path : public CFX_Target {
public:
- FX_BOOL StartFigure();
- FX_BOOL CloseFigure();
+ bool StartFigure();
+ bool CloseFigure();
void AddBezier(const CFX_PointsF& points);
void AddBeziers(const CFX_PointsF& points);
void AddCurve(const CFX_PointsF& points,
- FX_BOOL bClosed,
+ bool bClosed,
FX_FLOAT fTension = 0.5f);
void AddEllipse(const CFX_RectF& rect);
void AddLines(const CFX_PointsF& points);
void AddLine(const CFX_PointF& pt1, const CFX_PointF& pt2);
- void AddPath(const CFDE_Path* pSrc, FX_BOOL bConnect);
+ void AddPath(const CFDE_Path* pSrc, bool bConnect);
void AddPolygon(const CFX_PointsF& points);
void AddRectangle(const CFX_RectF& rect);
void GetBBox(CFX_RectF& bbox) const;
@@ -33,13 +33,13 @@ class CFDE_Path : public CFX_Target {
FX_FLOAT fMiterLimit) const;
FX_PATHPOINT* AddPoints(int32_t iCount);
FX_PATHPOINT* GetLastPoint(int32_t iCount = 1) const;
- FX_BOOL FigureClosed() const;
+ bool FigureClosed() const;
void MoveTo(FX_FLOAT fx, FX_FLOAT fy);
void LineTo(FX_FLOAT fx, FX_FLOAT fy);
void BezierTo(const CFX_PointF& p1,
const CFX_PointF& p2,
const CFX_PointF& p3);
- void ArcTo(FX_BOOL bStart,
+ void ArcTo(bool bStart,
const CFX_RectF& rect,
FX_FLOAT startAngle,
FX_FLOAT endAngle);
@@ -47,7 +47,7 @@ class CFDE_Path : public CFX_Target {
void LineTo(const CFX_PointF& p1) { LineTo(p1.x, p1.y); }
void GetCurveTangents(const CFX_PointsF& points,
CFX_PointsF& tangents,
- FX_BOOL bClosed,
+ bool bClosed,
FX_FLOAT fTension) const;
CFX_PathData m_Path;
};
diff --git a/xfa/fde/cfde_txtedtbuf.cpp b/xfa/fde/cfde_txtedtbuf.cpp
index 58f1822661..6d36eb3da2 100644
--- a/xfa/fde/cfde_txtedtbuf.cpp
+++ b/xfa/fde/cfde_txtedtbuf.cpp
@@ -16,12 +16,12 @@ const int kDefaultChunkCount = 2;
} // namespace
CFDE_TxtEdtBuf::CFDE_TxtEdtBuf()
- : m_nChunkSize(kDefaultChunkSize), m_nTotal(0), m_bChanged(FALSE) {
+ : m_nChunkSize(kDefaultChunkSize), m_nTotal(0), m_bChanged(false) {
ResetChunkBuffer(kDefaultChunkCount, m_nChunkSize);
}
CFDE_TxtEdtBuf::~CFDE_TxtEdtBuf() {
- Clear(TRUE);
+ Clear(true);
m_Chunks.RemoveAll();
}
@@ -35,7 +35,7 @@ int32_t CFDE_TxtEdtBuf::GetTextLength() const {
void CFDE_TxtEdtBuf::SetText(const CFX_WideString& wsText) {
ASSERT(!wsText.IsEmpty());
- Clear(FALSE);
+ Clear(false);
int32_t nTextLength = wsText.GetLength();
int32_t nNeedCount =
((nTextLength - 1) / m_nChunkSize + 1) - m_Chunks.GetSize();
@@ -62,7 +62,7 @@ void CFDE_TxtEdtBuf::SetText(const CFX_WideString& wsText) {
lpChunk->nUsed = nCopyedLength;
}
m_nTotal = nTextLength;
- m_bChanged = TRUE;
+ m_bChanged = true;
}
void CFDE_TxtEdtBuf::GetText(CFX_WideString& wsText) const {
@@ -165,7 +165,7 @@ void CFDE_TxtEdtBuf::Insert(int32_t nPos,
cp.nChunkIndex++;
}
m_nTotal += nLength;
- m_bChanged = TRUE;
+ m_bChanged = true;
}
void CFDE_TxtEdtBuf::Delete(int32_t nIndex, int32_t nLength) {
@@ -196,10 +196,10 @@ void CFDE_TxtEdtBuf::Delete(int32_t nIndex, int32_t nLength) {
nLength -= nDeleted;
cpEnd.nChunkIndex--;
}
- m_bChanged = TRUE;
+ m_bChanged = true;
}
-void CFDE_TxtEdtBuf::Clear(FX_BOOL bRelease) {
+void CFDE_TxtEdtBuf::Clear(bool bRelease) {
int32_t i = 0;
int32_t nCount = m_Chunks.GetSize();
if (bRelease) {
@@ -213,19 +213,19 @@ void CFDE_TxtEdtBuf::Clear(FX_BOOL bRelease) {
}
}
m_nTotal = 0;
- m_bChanged = TRUE;
+ m_bChanged = true;
}
-FX_BOOL CFDE_TxtEdtBuf::Optimize(IFX_Pause* pPause) {
- if (m_bChanged == FALSE) {
- return TRUE;
+bool CFDE_TxtEdtBuf::Optimize(IFX_Pause* pPause) {
+ if (m_bChanged == false) {
+ return true;
}
if (m_nTotal == 0) {
- return TRUE;
+ return true;
}
int32_t nCount = m_Chunks.GetSize();
if (nCount == 0) {
- return TRUE;
+ return true;
}
int32_t i = 0;
for (; i < nCount; i++) {
@@ -238,7 +238,7 @@ FX_BOOL CFDE_TxtEdtBuf::Optimize(IFX_Pause* pPause) {
}
}
if (pPause && pPause->NeedToPauseNow())
- return FALSE;
+ return false;
FDE_CHUNKHEADER* lpPreChunk = m_Chunks[0];
FDE_CHUNKHEADER* lpCurChunk = nullptr;
@@ -256,10 +256,10 @@ FX_BOOL CFDE_TxtEdtBuf::Optimize(IFX_Pause* pPause) {
lpPreChunk = lpCurChunk;
}
if (pPause && pPause->NeedToPauseNow())
- return FALSE;
+ return false;
}
- m_bChanged = FALSE;
- return TRUE;
+ m_bChanged = false;
+ return true;
}
void CFDE_TxtEdtBuf::ResetChunkBuffer(int32_t nDefChunkCount,
diff --git a/xfa/fde/cfde_txtedtbuf.h b/xfa/fde/cfde_txtedtbuf.h
index e1bc9259e4..f85dcb352a 100644
--- a/xfa/fde/cfde_txtedtbuf.h
+++ b/xfa/fde/cfde_txtedtbuf.h
@@ -31,9 +31,9 @@ class CFDE_TxtEdtBuf {
void Insert(int32_t nPos, const FX_WCHAR* lpText, int32_t nLength = 1);
void Delete(int32_t nIndex, int32_t nLength = 1);
- void Clear(FX_BOOL bRelease = TRUE);
+ void Clear(bool bRelease = true);
- FX_BOOL Optimize(IFX_Pause* pPause = nullptr);
+ bool Optimize(IFX_Pause* pPause = nullptr);
private:
friend class CFDE_TxtEdtBufIter;
@@ -55,7 +55,7 @@ class CFDE_TxtEdtBuf {
int32_t m_nChunkSize;
int32_t m_nTotal;
- FX_BOOL m_bChanged;
+ bool m_bChanged;
CFX_ArrayTemplate<FDE_CHUNKHEADER*> m_Chunks;
std::unique_ptr<IFX_MemoryAllocator> m_pAllocator;
};
diff --git a/xfa/fde/cfde_txtedtbufiter.cpp b/xfa/fde/cfde_txtedtbufiter.cpp
index c6d77a4523..e4544a3891 100644
--- a/xfa/fde/cfde_txtedtbufiter.cpp
+++ b/xfa/fde/cfde_txtedtbufiter.cpp
@@ -19,10 +19,10 @@ CFDE_TxtEdtBufIter::CFDE_TxtEdtBufIter(CFDE_TxtEdtBuf* pBuf, FX_WCHAR wcAlias)
CFDE_TxtEdtBufIter::~CFDE_TxtEdtBufIter() {}
-FX_BOOL CFDE_TxtEdtBufIter::Next(FX_BOOL bPrev) {
+bool CFDE_TxtEdtBufIter::Next(bool bPrev) {
if (bPrev) {
if (m_nIndex == 0) {
- return FALSE;
+ return false;
}
ASSERT(m_nCurChunk < m_pBuf->m_Chunks.GetSize());
CFDE_TxtEdtBuf::FDE_CHUNKHEADER* lpChunk = nullptr;
@@ -40,10 +40,10 @@ FX_BOOL CFDE_TxtEdtBufIter::Next(FX_BOOL bPrev) {
}
ASSERT(m_nCurChunk >= 0);
m_nIndex--;
- return TRUE;
+ return true;
} else {
if (m_nIndex >= (m_pBuf->m_nTotal - 1)) {
- return FALSE;
+ return false;
}
ASSERT(m_nCurChunk < m_pBuf->m_Chunks.GetSize());
CFDE_TxtEdtBuf::FDE_CHUNKHEADER* lpChunk = m_pBuf->m_Chunks[m_nCurChunk];
@@ -62,7 +62,7 @@ FX_BOOL CFDE_TxtEdtBufIter::Next(FX_BOOL bPrev) {
}
}
m_nIndex++;
- return TRUE;
+ return true;
}
}
@@ -86,7 +86,7 @@ FX_WCHAR CFDE_TxtEdtBufIter::GetChar() {
return m_Alias;
}
-FX_BOOL CFDE_TxtEdtBufIter::IsEOF(FX_BOOL bTail) const {
+bool CFDE_TxtEdtBufIter::IsEOF(bool bTail) const {
return bTail ? m_nIndex == (m_pBuf->GetTextLength() - 2) : m_nIndex == 0;
}
diff --git a/xfa/fde/cfde_txtedtbufiter.h b/xfa/fde/cfde_txtedtbufiter.h
index dacfb26918..4322708a2a 100644
--- a/xfa/fde/cfde_txtedtbufiter.h
+++ b/xfa/fde/cfde_txtedtbufiter.h
@@ -17,11 +17,11 @@ class CFDE_TxtEdtBufIter : public IFX_CharIter {
CFDE_TxtEdtBufIter(CFDE_TxtEdtBuf* pBuf, FX_WCHAR wcAlias = 0);
~CFDE_TxtEdtBufIter() override;
- FX_BOOL Next(FX_BOOL bPrev = FALSE) override;
+ bool Next(bool bPrev = false) override;
FX_WCHAR GetChar() override;
void SetAt(int32_t nIndex) override;
int32_t GetAt() const override;
- FX_BOOL IsEOF(FX_BOOL bTail = TRUE) const override;
+ bool IsEOF(bool bTail = true) const override;
IFX_CharIter* Clone() override;
private:
diff --git a/xfa/fde/cfde_txtedtdorecord_deleterange.cpp b/xfa/fde/cfde_txtedtdorecord_deleterange.cpp
index 33384b43ee..30459270b4 100644
--- a/xfa/fde/cfde_txtedtdorecord_deleterange.cpp
+++ b/xfa/fde/cfde_txtedtdorecord_deleterange.cpp
@@ -14,7 +14,7 @@ CFDE_TxtEdtDoRecord_DeleteRange::CFDE_TxtEdtDoRecord_DeleteRange(
int32_t nIndex,
int32_t nCaret,
const CFX_WideString& wsRange,
- FX_BOOL bSel)
+ bool bSel)
: m_pEngine(pEngine),
m_bSel(bSel),
m_nIndex(nIndex),
@@ -25,7 +25,7 @@ CFDE_TxtEdtDoRecord_DeleteRange::CFDE_TxtEdtDoRecord_DeleteRange(
CFDE_TxtEdtDoRecord_DeleteRange::~CFDE_TxtEdtDoRecord_DeleteRange() {}
-FX_BOOL CFDE_TxtEdtDoRecord_DeleteRange::Undo() const {
+bool CFDE_TxtEdtDoRecord_DeleteRange::Undo() const {
if (m_pEngine->IsSelect())
m_pEngine->ClearSelection();
@@ -37,11 +37,11 @@ FX_BOOL CFDE_TxtEdtDoRecord_DeleteRange::Undo() const {
m_pEngine->m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Insert;
m_pEngine->m_ChangeInfo.wsDelete = m_wsRange;
Param.pEventSink->On_TextChanged(m_pEngine, m_pEngine->m_ChangeInfo);
- m_pEngine->SetCaretPos(m_nCaret, TRUE);
- return TRUE;
+ m_pEngine->SetCaretPos(m_nCaret, true);
+ return true;
}
-FX_BOOL CFDE_TxtEdtDoRecord_DeleteRange::Redo() const {
+bool CFDE_TxtEdtDoRecord_DeleteRange::Redo() const {
m_pEngine->Inner_DeleteRange(m_nIndex, m_wsRange.GetLength());
if (m_bSel)
m_pEngine->RemoveSelRange(m_nIndex, m_wsRange.GetLength());
@@ -50,6 +50,6 @@ FX_BOOL CFDE_TxtEdtDoRecord_DeleteRange::Redo() const {
m_pEngine->m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Insert;
m_pEngine->m_ChangeInfo.wsDelete = m_wsRange;
Param.pEventSink->On_TextChanged(m_pEngine, m_pEngine->m_ChangeInfo);
- m_pEngine->SetCaretPos(m_nIndex, TRUE);
- return TRUE;
+ m_pEngine->SetCaretPos(m_nIndex, true);
+ return true;
}
diff --git a/xfa/fde/cfde_txtedtdorecord_deleterange.h b/xfa/fde/cfde_txtedtdorecord_deleterange.h
index 316e87f266..f7d7955940 100644
--- a/xfa/fde/cfde_txtedtdorecord_deleterange.h
+++ b/xfa/fde/cfde_txtedtdorecord_deleterange.h
@@ -19,15 +19,15 @@ class CFDE_TxtEdtDoRecord_DeleteRange : public IFDE_TxtEdtDoRecord {
int32_t nIndex,
int32_t nCaret,
const CFX_WideString& wsRange,
- FX_BOOL bSel = FALSE);
+ bool bSel = false);
~CFDE_TxtEdtDoRecord_DeleteRange() override;
- FX_BOOL Undo() const override;
- FX_BOOL Redo() const override;
+ bool Undo() const override;
+ bool Redo() const override;
private:
CFDE_TxtEdtEngine* m_pEngine;
- FX_BOOL m_bSel;
+ bool m_bSel;
int32_t m_nIndex;
int32_t m_nCaret;
CFX_WideString m_wsRange;
diff --git a/xfa/fde/cfde_txtedtdorecord_insert.cpp b/xfa/fde/cfde_txtedtdorecord_insert.cpp
index 55cfb95ba4..1fa3bbcf8f 100644
--- a/xfa/fde/cfde_txtedtdorecord_insert.cpp
+++ b/xfa/fde/cfde_txtedtdorecord_insert.cpp
@@ -23,7 +23,7 @@ CFDE_TxtEdtDoRecord_Insert::CFDE_TxtEdtDoRecord_Insert(
CFDE_TxtEdtDoRecord_Insert::~CFDE_TxtEdtDoRecord_Insert() {}
-FX_BOOL CFDE_TxtEdtDoRecord_Insert::Undo() const {
+bool CFDE_TxtEdtDoRecord_Insert::Undo() const {
if (m_pEngine->IsSelect())
m_pEngine->ClearSelection();
@@ -32,16 +32,16 @@ FX_BOOL CFDE_TxtEdtDoRecord_Insert::Undo() const {
m_pEngine->m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Delete;
m_pEngine->m_ChangeInfo.wsDelete = m_wsInsert;
Param.pEventSink->On_TextChanged(m_pEngine, m_pEngine->m_ChangeInfo);
- m_pEngine->SetCaretPos(m_nCaret, TRUE);
- return TRUE;
+ m_pEngine->SetCaretPos(m_nCaret, true);
+ return true;
}
-FX_BOOL CFDE_TxtEdtDoRecord_Insert::Redo() const {
+bool CFDE_TxtEdtDoRecord_Insert::Redo() const {
m_pEngine->Inner_Insert(m_nCaret, m_wsInsert.c_str(), m_wsInsert.GetLength());
FDE_TXTEDTPARAMS& Param = m_pEngine->m_Param;
m_pEngine->m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Insert;
m_pEngine->m_ChangeInfo.wsDelete = m_wsInsert;
Param.pEventSink->On_TextChanged(m_pEngine, m_pEngine->m_ChangeInfo);
- m_pEngine->SetCaretPos(m_nCaret, FALSE);
- return TRUE;
+ m_pEngine->SetCaretPos(m_nCaret, false);
+ return true;
}
diff --git a/xfa/fde/cfde_txtedtdorecord_insert.h b/xfa/fde/cfde_txtedtdorecord_insert.h
index 73493aa4fa..e80453e9e3 100644
--- a/xfa/fde/cfde_txtedtdorecord_insert.h
+++ b/xfa/fde/cfde_txtedtdorecord_insert.h
@@ -21,8 +21,8 @@ class CFDE_TxtEdtDoRecord_Insert : public IFDE_TxtEdtDoRecord {
int32_t nLength);
~CFDE_TxtEdtDoRecord_Insert() override;
- FX_BOOL Undo() const override;
- FX_BOOL Redo() const override;
+ bool Undo() const override;
+ bool Redo() const override;
private:
CFDE_TxtEdtEngine* m_pEngine;
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp
index 60ad6090a6..a4cfab2983 100644
--- a/xfa/fde/cfde_txtedtengine.cpp
+++ b/xfa/fde/cfde_txtedtengine.cpp
@@ -36,7 +36,7 @@ FDE_TXTEDTPARAMS::FDE_TXTEDTPARAMS()
dwFontColor(0xff000000),
fLineSpace(10.0f),
fTabWidth(36),
- bTabEquidistant(FALSE),
+ bTabEquidistant(false),
wDefChar(0xFEFF),
wLineBreakChar('\n'),
nCharRotation(0),
@@ -57,14 +57,14 @@ CFDE_TxtEdtEngine::CFDE_TxtEdtEngine()
m_nLayoutPos(0),
m_fCaretPosReserve(0.0),
m_nCaret(0),
- m_bBefore(TRUE),
+ m_bBefore(true),
m_nCaretPage(0),
m_dwFindFlags(0),
- m_bLock(FALSE),
+ m_bLock(false),
m_nLimit(0),
m_wcAliasChar(L'*'),
m_nFirstLineEnd(FDE_TXTEDIT_LINEEND_Auto),
- m_bAutoLineEnd(TRUE),
+ m_bAutoLineEnd(true),
m_wLineEnd(kUnicodeParagraphSeparator) {
FXSYS_memset(&m_rtCaret, 0, sizeof(CFX_RectF));
m_bAutoLineEnd = (m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto);
@@ -110,18 +110,18 @@ void CFDE_TxtEdtEngine::SetTextByStream(IFX_Stream* pStream) {
int32_t nIndex = 0;
if (pStream && pStream->GetLength()) {
int32_t nStreamLength = pStream->GetLength();
- FX_BOOL bValid = TRUE;
+ bool bValid = true;
if (m_nLimit > 0 && nStreamLength > m_nLimit) {
- bValid = FALSE;
+ bValid = false;
}
- FX_BOOL bPreIsCR = FALSE;
+ bool bPreIsCR = false;
if (bValid) {
uint8_t bom[4];
int32_t nPos = pStream->GetBOM(bom);
pStream->Seek(FX_STREAMSEEK_Begin, nPos);
int32_t nPlateSize = std::min(nStreamLength, m_pTxtBuf->GetChunkSize());
FX_WCHAR* lpwstr = FX_Alloc(FX_WCHAR, nPlateSize);
- FX_BOOL bEos = false;
+ bool bEos = false;
while (!bEos) {
int32_t nRead = pStream->ReadString(lpwstr, nPlateSize, bEos);
bPreIsCR = ReplaceParagEnd(lpwstr, nRead, bPreIsCR);
@@ -142,7 +142,7 @@ void CFDE_TxtEdtEngine::SetText(const CFX_WideString& wsText) {
CFX_WideString wsTemp;
FX_WCHAR* lpBuffer = wsTemp.GetBuffer(nLength);
FXSYS_memcpy(lpBuffer, wsText.c_str(), nLength * sizeof(FX_WCHAR));
- ReplaceParagEnd(lpBuffer, nLength, FALSE);
+ ReplaceParagEnd(lpBuffer, nLength, false);
wsTemp.ReleaseBuffer(nLength);
if (m_nLimit > 0 && nLength > m_nLimit) {
wsTemp.Delete(m_nLimit, nLength - m_nLimit);
@@ -185,7 +185,7 @@ int32_t CFDE_TxtEdtEngine::GetCaretPos() const {
return m_nCaret + (m_bBefore ? 0 : 1);
}
-int32_t CFDE_TxtEdtEngine::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) {
+int32_t CFDE_TxtEdtEngine::SetCaretPos(int32_t nIndex, bool bBefore) {
if (IsLocked()) {
return 0;
}
@@ -199,7 +199,7 @@ int32_t CFDE_TxtEdtEngine::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) {
GetCaretRect(m_rtCaret, m_nCaretPage, m_nCaret, m_bBefore);
if (!m_bBefore) {
m_nCaret++;
- m_bBefore = TRUE;
+ m_bBefore = true;
}
m_fCaretPosReserve = (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical)
? m_rtCaret.top
@@ -210,18 +210,18 @@ int32_t CFDE_TxtEdtEngine::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) {
}
int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
- FX_BOOL bShift,
- FX_BOOL bCtrl) {
+ bool bShift,
+ bool bCtrl) {
if (IsLocked()) {
return 0;
}
if (m_PagePtrArray.GetSize() <= m_nCaretPage) {
return 0;
}
- FX_BOOL bSelChange = FALSE;
+ bool bSelChange = false;
if (IsSelect()) {
ClearSelection();
- bSelChange = TRUE;
+ bSelChange = true;
}
if (bShift) {
if (m_nAnchorPos == -1) {
@@ -230,7 +230,7 @@ int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
} else {
m_nAnchorPos = -1;
}
- FX_BOOL bVertical = m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical;
+ bool bVertical = m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical;
switch (eMoveCaret) {
case MC_Left: {
if (bVertical) {
@@ -239,7 +239,7 @@ int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
UpdateCaretIndex(ptCaret);
}
} else {
- FX_BOOL bBefore = TRUE;
+ bool bBefore = true;
int32_t nIndex = MoveBackward(bBefore);
if (nIndex >= 0) {
UpdateCaretRect(nIndex, bBefore);
@@ -253,7 +253,7 @@ int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
UpdateCaretIndex(ptCaret);
}
} else {
- FX_BOOL bBefore = TRUE;
+ bool bBefore = true;
int32_t nIndex = MoveForward(bBefore);
if (nIndex >= 0) {
UpdateCaretRect(nIndex, bBefore);
@@ -262,7 +262,7 @@ int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
} break;
case MC_Up: {
if (bVertical) {
- FX_BOOL bBefore = TRUE;
+ bool bBefore = true;
int32_t nIndex = MoveBackward(bBefore);
if (nIndex >= 0) {
UpdateCaretRect(nIndex, bBefore);
@@ -276,7 +276,7 @@ int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
} break;
case MC_Down: {
if (bVertical) {
- FX_BOOL bBefore = TRUE;
+ bool bBefore = true;
int32_t nIndex = MoveForward(bBefore);
if (nIndex >= 0) {
UpdateCaretRect(nIndex, bBefore);
@@ -329,14 +329,14 @@ int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
}
void CFDE_TxtEdtEngine::Lock() {
- m_bLock = TRUE;
+ m_bLock = true;
}
void CFDE_TxtEdtEngine::Unlock() {
- m_bLock = FALSE;
+ m_bLock = false;
}
-FX_BOOL CFDE_TxtEdtEngine::IsLocked() const {
+bool CFDE_TxtEdtEngine::IsLocked() const {
return m_bLock;
}
@@ -349,9 +349,9 @@ int32_t CFDE_TxtEdtEngine::Insert(int32_t nStart,
CFX_WideString wsTemp;
FX_WCHAR* lpBuffer = wsTemp.GetBuffer(nLength);
FXSYS_memcpy(lpBuffer, lpText, nLength * sizeof(FX_WCHAR));
- ReplaceParagEnd(lpBuffer, nLength, FALSE);
+ ReplaceParagEnd(lpBuffer, nLength, false);
wsTemp.ReleaseBuffer(nLength);
- FX_BOOL bPart = FALSE;
+ bool bPart = false;
if (m_nLimit > 0) {
int32_t nTotalLength = GetTextBufLength();
int32_t nCount = m_SelRangePtrArr.GetSize();
@@ -365,7 +365,7 @@ int32_t CFDE_TxtEdtEngine::Insert(int32_t nStart,
}
if (nExpectLength > m_nLimit) {
nLength -= (nExpectLength - m_nLimit);
- bPart = TRUE;
+ bPart = true;
}
}
if ((m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Vert) ||
@@ -400,7 +400,7 @@ int32_t CFDE_TxtEdtEngine::Insert(int32_t nStart,
return FDE_TXTEDT_MODIFY_RET_F_Full;
}
if (nLength < nTemp) {
- bPart = TRUE;
+ bPart = true;
}
}
if (m_Param.dwMode & FDE_TEXTEDITMODE_Validate) {
@@ -425,17 +425,17 @@ int32_t CFDE_TxtEdtEngine::Insert(int32_t nStart,
nStart = m_nCaret;
nStart += nLength;
FX_WCHAR wChar = m_pTxtBuf->GetCharByIndex(nStart - 1);
- FX_BOOL bBefore = TRUE;
+ bool bBefore = true;
if (wChar != L'\n' && wChar != L'\r') {
nStart--;
- bBefore = FALSE;
+ bBefore = false;
}
SetCaretPos(nStart, bBefore);
m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo);
return bPart ? FDE_TXTEDT_MODIFY_RET_S_Part : FDE_TXTEDT_MODIFY_RET_S_Normal;
}
-int32_t CFDE_TxtEdtEngine::Delete(int32_t nStart, FX_BOOL bBackspace) {
+int32_t CFDE_TxtEdtEngine::Delete(int32_t nStart, bool bBackspace) {
if (IsLocked()) {
return FDE_TXTEDT_MODIFY_RET_F_Locked;
}
@@ -507,7 +507,7 @@ int32_t CFDE_TxtEdtEngine::DeleteRange(int32_t nStart, int32_t nCount) {
}
DeleteRange_DoRecord(nStart, nCount);
m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo);
- SetCaretPos(nStart, TRUE);
+ SetCaretPos(nStart, true);
return FDE_TXTEDT_MODIFY_RET_S_Normal;
}
@@ -543,10 +543,10 @@ int32_t CFDE_TxtEdtEngine::Replace(int32_t nStart,
m_ChangeInfo.wsInsert = CFX_WideString(wsReplace.c_str(), nTextLength);
nStart += nTextLength;
FX_WCHAR wChar = m_pTxtBuf->GetCharByIndex(nStart - 1);
- FX_BOOL bBefore = TRUE;
+ bool bBefore = true;
if (wChar != L'\n' && wChar != L'\r') {
nStart--;
- bBefore = FALSE;
+ bBefore = false;
}
SetCaretPos(nStart, bBefore);
m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0);
@@ -601,7 +601,7 @@ void CFDE_TxtEdtEngine::AddSelRange(int32_t nStart, int32_t nCount) {
return;
}
int32_t nEnd = nStart + nCount - 1;
- FX_BOOL bBegin = FALSE;
+ bool bBegin = false;
int32_t nRangeBgn = 0;
int32_t nRangeCnt = 0;
for (int32_t i = 0; i < nSize; i++) {
@@ -623,7 +623,7 @@ void CFDE_TxtEdtEngine::AddSelRange(int32_t nStart, int32_t nCount) {
break;
}
nRangeCnt = 1;
- bBegin = TRUE;
+ bBegin = true;
}
}
}
@@ -664,19 +664,19 @@ void CFDE_TxtEdtEngine::ClearSelection() {
m_Param.pEventSink->On_SelChanged(this);
}
-FX_BOOL CFDE_TxtEdtEngine::Redo(const IFDE_TxtEdtDoRecord* pDoRecord) {
+bool CFDE_TxtEdtEngine::Redo(const IFDE_TxtEdtDoRecord* pDoRecord) {
if (IsLocked())
- return FALSE;
+ return false;
if (m_Param.dwMode & FDE_TEXTEDITMODE_NoRedoUndo)
- return FALSE;
+ return false;
return pDoRecord->Redo();
}
-FX_BOOL CFDE_TxtEdtEngine::Undo(const IFDE_TxtEdtDoRecord* pDoRecord) {
+bool CFDE_TxtEdtEngine::Undo(const IFDE_TxtEdtDoRecord* pDoRecord) {
if (IsLocked())
- return FALSE;
+ return false;
if (m_Param.dwMode & FDE_TEXTEDITMODE_NoRedoUndo)
- return FALSE;
+ return false;
return pDoRecord->Undo();
}
@@ -719,7 +719,7 @@ void CFDE_TxtEdtEngine::EndLayout() {
Unlock();
}
-FX_BOOL CFDE_TxtEdtEngine::Optimize(IFX_Pause* pPause) {
+bool CFDE_TxtEdtEngine::Optimize(IFX_Pause* pPause) {
return m_pTxtBuf->Optimize(pPause);
}
@@ -848,7 +848,7 @@ void CFDE_TxtEdtEngine::Inner_Insert(int32_t nStart,
int32_t nTextStart = 0;
FX_WCHAR wCurChar = L' ';
const FX_WCHAR* lpPos = lpText;
- FX_BOOL bFirst = TRUE;
+ bool bFirst = true;
int32_t nParagIndex = ParagPos.nParagIndex;
for (i = 0; i < nLength; i++, lpPos++) {
wCurChar = *lpPos;
@@ -857,7 +857,7 @@ void CFDE_TxtEdtEngine::Inner_Insert(int32_t nStart,
pParag->SetTextLength(nLeavePart + (i - nTextStart + 1));
pParag->SetLineCount(-1);
nReserveCharStart += pParag->GetTextLength();
- bFirst = FALSE;
+ bFirst = false;
} else {
pParag = new CFDE_TxtEdtParag(this);
pParag->SetLineCount(-1);
@@ -872,7 +872,7 @@ void CFDE_TxtEdtEngine::Inner_Insert(int32_t nStart,
if (bFirst) {
pParag->IncrementTextLength(nLength);
pParag->SetLineCount(-1);
- bFirst = FALSE;
+ bFirst = false;
} else {
pParag = new CFDE_TxtEdtParag(this);
pParag->SetLineCount(-1);
@@ -903,12 +903,12 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(int32_t nStart, int32_t nCount) {
TextPos2ParagPos(nStart, ParagPosBgn);
TextPos2ParagPos(nEnd, ParagPosEnd);
CFDE_TxtEdtParag* pParag = m_ParagPtrArray[ParagPosEnd.nParagIndex];
- FX_BOOL bLastParag = FALSE;
+ bool bLastParag = false;
if (ParagPosEnd.nCharIndex == pParag->GetTextLength() - 1) {
if (ParagPosEnd.nParagIndex < m_ParagPtrArray.GetSize() - 1) {
ParagPosEnd.nParagIndex++;
} else {
- bLastParag = TRUE;
+ bLastParag = true;
}
}
int32_t nTotalLineCount = 0;
@@ -949,7 +949,7 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(int32_t nStart, int32_t nCount) {
void CFDE_TxtEdtEngine::DeleteRange_DoRecord(int32_t nStart,
int32_t nCount,
- FX_BOOL bSel) {
+ bool bSel) {
ASSERT(nStart >= 0);
if (nCount == -1) {
nCount = GetTextLength() - nStart;
@@ -973,7 +973,7 @@ void CFDE_TxtEdtEngine::ResetEngine() {
RemoveAllParags();
ClearSelection();
m_nCaret = 0;
- m_pTxtBuf->Clear(FALSE);
+ m_pTxtBuf->Clear(false);
m_nCaret = 0;
}
@@ -1146,18 +1146,18 @@ void CFDE_TxtEdtEngine::UpdateTxtBreak() {
m_pTextBreak->SetCharSpace(m_Param.fCharSpace);
}
-FX_BOOL CFDE_TxtEdtEngine::ReplaceParagEnd(FX_WCHAR*& lpText,
- int32_t& nLength,
- FX_BOOL bPreIsCR) {
+bool CFDE_TxtEdtEngine::ReplaceParagEnd(FX_WCHAR*& lpText,
+ int32_t& nLength,
+ bool bPreIsCR) {
for (int32_t i = 0; i < nLength; i++) {
FX_WCHAR wc = lpText[i];
switch (wc) {
case L'\r': {
lpText[i] = m_wLineEnd;
- bPreIsCR = TRUE;
+ bPreIsCR = true;
} break;
case L'\n': {
- if (bPreIsCR == TRUE) {
+ if (bPreIsCR == true) {
int32_t nNext = i + 1;
if (nNext < nLength) {
FXSYS_memmove(lpText + i, lpText + nNext,
@@ -1165,25 +1165,25 @@ FX_BOOL CFDE_TxtEdtEngine::ReplaceParagEnd(FX_WCHAR*& lpText,
}
i--;
nLength--;
- bPreIsCR = FALSE;
+ bPreIsCR = false;
if (m_bAutoLineEnd) {
m_nFirstLineEnd = FDE_TXTEDIT_LINEEND_CRLF;
- m_bAutoLineEnd = FALSE;
+ m_bAutoLineEnd = false;
}
} else {
lpText[i] = m_wLineEnd;
if (m_bAutoLineEnd) {
m_nFirstLineEnd = FDE_TXTEDIT_LINEEND_LF;
- m_bAutoLineEnd = FALSE;
+ m_bAutoLineEnd = false;
}
}
} break;
default: {
if (bPreIsCR && m_bAutoLineEnd) {
m_nFirstLineEnd = FDE_TXTEDIT_LINEEND_CR;
- m_bAutoLineEnd = FALSE;
+ m_bAutoLineEnd = false;
}
- bPreIsCR = FALSE;
+ bPreIsCR = false;
} break;
}
}
@@ -1303,7 +1303,7 @@ void CFDE_TxtEdtEngine::TextPos2ParagPos(int32_t nIndex,
ParagPos.nCharIndex = nIndex - m_ParagPtrArray[nMid]->GetStartIndex();
}
-int32_t CFDE_TxtEdtEngine::MoveForward(FX_BOOL& bBefore) {
+int32_t CFDE_TxtEdtEngine::MoveForward(bool& bBefore) {
if (m_nCaret == m_pTxtBuf->GetTextLength() - 1)
return -1;
@@ -1314,13 +1314,13 @@ int32_t CFDE_TxtEdtEngine::MoveForward(FX_BOOL& bBefore) {
nCaret++;
}
nCaret++;
- bBefore = TRUE;
+ bBefore = true;
return nCaret;
}
-int32_t CFDE_TxtEdtEngine::MoveBackward(FX_BOOL& bBefore) {
+int32_t CFDE_TxtEdtEngine::MoveBackward(bool& bBefore) {
if (m_nCaret == 0)
- return FALSE;
+ return false;
int32_t nCaret = m_nCaret;
if (nCaret > 2 && m_pTxtBuf->GetCharByIndex(nCaret - 1) == L'\n' &&
@@ -1328,26 +1328,26 @@ int32_t CFDE_TxtEdtEngine::MoveBackward(FX_BOOL& bBefore) {
nCaret--;
}
nCaret--;
- bBefore = TRUE;
+ bBefore = true;
return nCaret;
}
-FX_BOOL CFDE_TxtEdtEngine::MoveUp(CFX_PointF& ptCaret) {
+bool CFDE_TxtEdtEngine::MoveUp(CFX_PointF& ptCaret) {
IFDE_TxtEdtPage* pPage = GetPage(m_nCaretPage);
const CFX_RectF& rtContent = pPage->GetContentsBox();
if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical) {
ptCaret.x = m_rtCaret.left + m_rtCaret.width / 2 - m_Param.fLineSpace;
ptCaret.y = m_fCaretPosReserve;
- FX_BOOL bLineReserve =
+ bool bLineReserve =
!!(m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_LineReserve);
if (ptCaret.x < rtContent.left) {
if (bLineReserve) {
if (m_nCaretPage == CountPages() - 1) {
- return FALSE;
+ return false;
}
} else {
if (m_nCaretPage == 0) {
- return FALSE;
+ return false;
}
}
if (bLineReserve) {
@@ -1364,7 +1364,7 @@ FX_BOOL CFDE_TxtEdtEngine::MoveUp(CFX_PointF& ptCaret) {
ptCaret.y = m_rtCaret.top + m_rtCaret.height / 2 - m_Param.fLineSpace;
if (ptCaret.y < rtContent.top) {
if (m_nCaretPage == 0) {
- return FALSE;
+ return false;
}
ptCaret.y -= rtContent.top;
m_nCaretPage--;
@@ -1372,25 +1372,25 @@ FX_BOOL CFDE_TxtEdtEngine::MoveUp(CFX_PointF& ptCaret) {
ptCaret.y += pCurPage->GetContentsBox().bottom();
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_TxtEdtEngine::MoveDown(CFX_PointF& ptCaret) {
+bool CFDE_TxtEdtEngine::MoveDown(CFX_PointF& ptCaret) {
IFDE_TxtEdtPage* pPage = GetPage(m_nCaretPage);
const CFX_RectF& rtContent = pPage->GetContentsBox();
if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical) {
ptCaret.x = m_rtCaret.left + m_rtCaret.width / 2 + m_Param.fLineSpace;
ptCaret.y = m_fCaretPosReserve;
if (ptCaret.x >= rtContent.right()) {
- FX_BOOL bLineReserve =
+ bool bLineReserve =
!!(m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_LineReserve);
if (bLineReserve) {
if (m_nCaretPage == 0) {
- return FALSE;
+ return false;
}
} else {
if (m_nCaretPage == CountPages() - 1) {
- return FALSE;
+ return false;
}
}
if (bLineReserve) {
@@ -1407,7 +1407,7 @@ FX_BOOL CFDE_TxtEdtEngine::MoveDown(CFX_PointF& ptCaret) {
ptCaret.y = m_rtCaret.top + m_rtCaret.height / 2 + m_Param.fLineSpace;
if (ptCaret.y >= rtContent.bottom()) {
if (m_nCaretPage == CountPages() - 1) {
- return FALSE;
+ return false;
}
ptCaret.y -= rtContent.bottom();
m_nCaretPage++;
@@ -1415,10 +1415,10 @@ FX_BOOL CFDE_TxtEdtEngine::MoveDown(CFX_PointF& ptCaret) {
ptCaret.y += pCurPage->GetContentsBox().top;
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_TxtEdtEngine::MoveLineStart() {
+bool CFDE_TxtEdtEngine::MoveLineStart() {
int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
FDE_TXTEDTPARAGPOS ParagPos;
TextPos2ParagPos(nIndex, ParagPos);
@@ -1434,12 +1434,12 @@ FX_BOOL CFDE_TxtEdtEngine::MoveLineStart() {
break;
}
}
- UpdateCaretRect(nStart, TRUE);
+ UpdateCaretRect(nStart, true);
pParag->UnloadParag();
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_TxtEdtEngine::MoveLineEnd() {
+bool CFDE_TxtEdtEngine::MoveLineEnd() {
int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
FDE_TXTEDTPARAGPOS ParagPos;
TextPos2ParagPos(nIndex, ParagPos);
@@ -1458,12 +1458,12 @@ FX_BOOL CFDE_TxtEdtEngine::MoveLineEnd() {
nIndex = nStart + nCount - 1;
ASSERT(nIndex <= GetTextBufLength());
FX_WCHAR wChar = m_pTxtBuf->GetCharByIndex(nIndex);
- FX_BOOL bBefore = FALSE;
+ bool bBefore = false;
if (nIndex <= GetTextBufLength()) {
if (wChar == L'\r') {
- bBefore = TRUE;
+ bBefore = true;
} else if (wChar == L'\n' && nIndex > nStart) {
- bBefore = TRUE;
+ bBefore = true;
nIndex--;
wChar = m_pTxtBuf->GetCharByIndex(nIndex);
if (wChar != L'\r') {
@@ -1473,19 +1473,19 @@ FX_BOOL CFDE_TxtEdtEngine::MoveLineEnd() {
}
UpdateCaretRect(nIndex, bBefore);
pParag->UnloadParag();
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_TxtEdtEngine::MoveParagStart() {
+bool CFDE_TxtEdtEngine::MoveParagStart() {
int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
FDE_TXTEDTPARAGPOS ParagPos;
TextPos2ParagPos(nIndex, ParagPos);
CFDE_TxtEdtParag* pParag = m_ParagPtrArray[ParagPos.nParagIndex];
- UpdateCaretRect(pParag->GetStartIndex(), TRUE);
- return TRUE;
+ UpdateCaretRect(pParag->GetStartIndex(), true);
+ return true;
}
-FX_BOOL CFDE_TxtEdtEngine::MoveParagEnd() {
+bool CFDE_TxtEdtEngine::MoveParagEnd() {
int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1;
FDE_TXTEDTPARAGPOS ParagPos;
TextPos2ParagPos(nIndex, ParagPos);
@@ -1499,21 +1499,21 @@ FX_BOOL CFDE_TxtEdtEngine::MoveParagEnd() {
nIndex++;
}
}
- UpdateCaretRect(nIndex, TRUE);
- return TRUE;
+ UpdateCaretRect(nIndex, true);
+ return true;
}
-FX_BOOL CFDE_TxtEdtEngine::MoveHome() {
- UpdateCaretRect(0, TRUE);
- return TRUE;
+bool CFDE_TxtEdtEngine::MoveHome() {
+ UpdateCaretRect(0, true);
+ return true;
}
-FX_BOOL CFDE_TxtEdtEngine::MoveEnd() {
- UpdateCaretRect(GetTextBufLength(), TRUE);
- return TRUE;
+bool CFDE_TxtEdtEngine::MoveEnd() {
+ UpdateCaretRect(GetTextBufLength(), true);
+ return true;
}
-FX_BOOL CFDE_TxtEdtEngine::IsFitArea(CFX_WideString& wsText) {
+bool CFDE_TxtEdtEngine::IsFitArea(CFX_WideString& wsText) {
std::unique_ptr<CFDE_TextOut> pTextOut(new CFDE_TextOut);
pTextOut->SetLineSpace(m_Param.fLineSpace);
pTextOut->SetFont(m_Param.pFont);
@@ -1536,23 +1536,23 @@ FX_BOOL CFDE_TxtEdtEngine::IsFitArea(CFX_WideString& wsText) {
wsText.Delete(wsText.GetLength() - 1);
if ((m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Horz) &&
(rcText.width > m_Param.fPlateWidth)) {
- return FALSE;
+ return false;
}
if ((m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Vert) &&
(rcText.height > m_Param.fLineSpace * m_Param.nLineCount)) {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-void CFDE_TxtEdtEngine::UpdateCaretRect(int32_t nIndex, FX_BOOL bBefore) {
+void CFDE_TxtEdtEngine::UpdateCaretRect(int32_t nIndex, bool bBefore) {
MovePage2Char(nIndex);
GetCaretRect(m_rtCaret, m_nCaretPage, nIndex, bBefore);
m_nCaret = nIndex;
m_bBefore = bBefore;
if (!m_bBefore) {
m_nCaret++;
- m_bBefore = TRUE;
+ m_bBefore = true;
}
m_fCaretPosReserve = (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical)
? m_rtCaret.top
@@ -1563,14 +1563,14 @@ void CFDE_TxtEdtEngine::UpdateCaretRect(int32_t nIndex, FX_BOOL bBefore) {
void CFDE_TxtEdtEngine::GetCaretRect(CFX_RectF& rtCaret,
int32_t nPageIndex,
int32_t nCaret,
- FX_BOOL bBefore) {
+ bool bBefore) {
IFDE_TxtEdtPage* pPage = m_PagePtrArray[m_nCaretPage];
m_Param.pEventSink->On_PageLoad(this, m_nCaretPage, 0);
- FX_BOOL bCombText = !!(m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_CombText);
+ bool bCombText = !!(m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_CombText);
int32_t nIndexInpage = nCaret - pPage->GetCharStart();
if (bBefore && bCombText && nIndexInpage > 0) {
nIndexInpage--;
- bBefore = FALSE;
+ bBefore = false;
}
int32_t nBIDILevel = pPage->GetCharRect(nIndexInpage, rtCaret, bCombText);
if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical) {
@@ -1602,13 +1602,13 @@ void CFDE_TxtEdtEngine::UpdateCaretIndex(const CFX_PointF& ptCaret) {
GetCaretRect(m_rtCaret, m_nCaretPage, m_nCaret, m_bBefore);
if (!m_bBefore) {
m_nCaret++;
- m_bBefore = TRUE;
+ m_bBefore = true;
}
m_Param.pEventSink->On_CaretChanged(this, m_nCaretPage);
m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0);
}
-FX_BOOL CFDE_TxtEdtEngine::IsSelect() {
+bool CFDE_TxtEdtEngine::IsSelect() {
return m_SelRangePtrArr.GetSize() > 0;
}
@@ -1620,12 +1620,12 @@ void CFDE_TxtEdtEngine::DeleteSelect() {
int32_t nSelCount = GetSelRange(--nCountRange, nSelStart);
delete m_SelRangePtrArr[nCountRange];
m_SelRangePtrArr.RemoveAt(nCountRange);
- DeleteRange_DoRecord(nSelStart, nSelCount, TRUE);
+ DeleteRange_DoRecord(nSelStart, nSelCount, true);
}
ClearSelection();
m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo);
m_Param.pEventSink->On_SelChanged(this);
- SetCaretPos(nSelStart, TRUE);
+ SetCaretPos(nSelStart, true);
return;
}
}
diff --git a/xfa/fde/cfde_txtedtengine.h b/xfa/fde/cfde_txtedtengine.h
index 974913936f..8f0e855f52 100644
--- a/xfa/fde/cfde_txtedtengine.h
+++ b/xfa/fde/cfde_txtedtengine.h
@@ -36,16 +36,16 @@ class CFDE_TxtEdtEngine {
int32_t GetCaretRect(CFX_RectF& rtCaret) const;
int32_t GetCaretPos() const;
- int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore);
+ int32_t SetCaretPos(int32_t nIndex, bool bBefore);
int32_t MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
- FX_BOOL bShift = FALSE,
- FX_BOOL bCtrl = FALSE);
+ bool bShift = false,
+ bool bCtrl = false);
void Lock();
void Unlock();
- FX_BOOL IsLocked() const;
+ bool IsLocked() const;
int32_t Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLength);
- int32_t Delete(int32_t nStart, FX_BOOL bBackspace = FALSE);
+ int32_t Delete(int32_t nStart, bool bBackspace = false);
int32_t DeleteRange(int32_t nStart, int32_t nCount = -1);
int32_t Replace(int32_t nStart,
int32_t nLength,
@@ -61,14 +61,14 @@ class CFDE_TxtEdtEngine {
int32_t GetSelRange(int32_t nIndex, int32_t& nStart);
void ClearSelection();
- FX_BOOL Redo(const IFDE_TxtEdtDoRecord* pRecord);
- FX_BOOL Undo(const IFDE_TxtEdtDoRecord* pRecord);
+ bool Redo(const IFDE_TxtEdtDoRecord* pRecord);
+ bool Undo(const IFDE_TxtEdtDoRecord* pRecord);
int32_t StartLayout();
int32_t DoLayout(IFX_Pause* pPause);
void EndLayout();
- FX_BOOL Optimize(IFX_Pause* pPause = nullptr);
+ bool Optimize(IFX_Pause* pPause = nullptr);
int32_t CountParags() const;
CFDE_TxtEdtParag* GetParag(int32_t nParagIndex) const;
IFX_CharIter* CreateCharIter();
@@ -114,9 +114,7 @@ class CFDE_TxtEdtEngine {
int32_t nLength);
void Inner_DeleteRange(int32_t nStart, int32_t nCount = -1);
- void DeleteRange_DoRecord(int32_t nStart,
- int32_t nCount,
- FX_BOOL bSel = FALSE);
+ void DeleteRange_DoRecord(int32_t nStart, int32_t nCount, bool bSel = false);
void ResetEngine();
void RebuildParagraphs();
void RemoveAllParags();
@@ -125,31 +123,31 @@ class CFDE_TxtEdtEngine {
void UpdatePages();
void UpdateTxtBreak();
- FX_BOOL ReplaceParagEnd(FX_WCHAR*& lpText,
- int32_t& nLength,
- FX_BOOL bPreIsCR = FALSE);
+ bool ReplaceParagEnd(FX_WCHAR*& lpText,
+ int32_t& nLength,
+ bool bPreIsCR = false);
void RecoverParagEnd(CFX_WideString& wsText);
int32_t MovePage2Char(int32_t nIndex);
void TextPos2ParagPos(int32_t nIndex, FDE_TXTEDTPARAGPOS& ParagPos) const;
- int32_t MoveForward(FX_BOOL& bBefore);
- int32_t MoveBackward(FX_BOOL& bBefore);
- FX_BOOL MoveUp(CFX_PointF& ptCaret);
- FX_BOOL MoveDown(CFX_PointF& ptCaret);
- FX_BOOL MoveLineStart();
- FX_BOOL MoveLineEnd();
- FX_BOOL MoveParagStart();
- FX_BOOL MoveParagEnd();
- FX_BOOL MoveHome();
- FX_BOOL MoveEnd();
- FX_BOOL IsFitArea(CFX_WideString& wsText);
- void UpdateCaretRect(int32_t nIndex, FX_BOOL bBefore = TRUE);
+ int32_t MoveForward(bool& bBefore);
+ int32_t MoveBackward(bool& bBefore);
+ bool MoveUp(CFX_PointF& ptCaret);
+ bool MoveDown(CFX_PointF& ptCaret);
+ bool MoveLineStart();
+ bool MoveLineEnd();
+ bool MoveParagStart();
+ bool MoveParagEnd();
+ bool MoveHome();
+ bool MoveEnd();
+ bool IsFitArea(CFX_WideString& wsText);
+ void UpdateCaretRect(int32_t nIndex, bool bBefore = true);
void GetCaretRect(CFX_RectF& rtCaret,
int32_t nPageIndex,
int32_t nCaret,
- FX_BOOL bBefore = TRUE);
+ bool bBefore = true);
void UpdateCaretIndex(const CFX_PointF& ptCaret);
- FX_BOOL IsSelect();
+ bool IsSelect();
void DeleteSelect();
std::unique_ptr<CFDE_TxtEdtBuf> m_pTxtBuf;
@@ -164,15 +162,15 @@ class CFDE_TxtEdtEngine {
int32_t m_nLayoutPos;
FX_FLOAT m_fCaretPosReserve;
int32_t m_nCaret;
- FX_BOOL m_bBefore;
+ bool m_bBefore;
int32_t m_nCaretPage;
CFX_RectF m_rtCaret;
uint32_t m_dwFindFlags;
- FX_BOOL m_bLock;
+ bool m_bLock;
int32_t m_nLimit;
FX_WCHAR m_wcAliasChar;
int32_t m_nFirstLineEnd;
- FX_BOOL m_bAutoLineEnd;
+ bool m_bAutoLineEnd;
FX_WCHAR m_wLineEnd;
FDE_TXTEDT_TEXTCHANGE_INFO m_ChangeInfo;
};
diff --git a/xfa/fde/cfde_txtedtpage.cpp b/xfa/fde/cfde_txtedtpage.cpp
index 9f0d29f63d..0abb1d69f3 100644
--- a/xfa/fde/cfde_txtedtpage.cpp
+++ b/xfa/fde/cfde_txtedtpage.cpp
@@ -37,7 +37,7 @@ CFDE_TxtEdtPage::CFDE_TxtEdtPage(CFDE_TxtEdtEngine* pEngine, int32_t nPageIndex)
m_nPageStart(-1),
m_nCharCount(0),
m_nPageIndex(nPageIndex),
- m_bLoaded(FALSE) {
+ m_bLoaded(false) {
FXSYS_memset(&m_rtPage, 0, sizeof(CFX_RectF));
FXSYS_memset(&m_rtPageMargin, 0, sizeof(CFX_RectF));
FXSYS_memset(&m_rtPageContents, 0, sizeof(CFX_RectF));
@@ -45,7 +45,7 @@ CFDE_TxtEdtPage::CFDE_TxtEdtPage(CFDE_TxtEdtEngine* pEngine, int32_t nPageIndex)
}
CFDE_TxtEdtPage::~CFDE_TxtEdtPage() {
- m_PieceMassArr.RemoveAll(TRUE);
+ m_PieceMassArr.RemoveAll(true);
}
CFDE_TxtEdtEngine* CFDE_TxtEdtPage::GetEngine() const {
@@ -60,7 +60,7 @@ void CFDE_TxtEdtPage::GetRect(FDE_TEXTEDITPIECE* hVisualObj, CFX_RectF& rt) {}
int32_t CFDE_TxtEdtPage::GetCharRect(int32_t nIndex,
CFX_RectF& rect,
- FX_BOOL bBBox) const {
+ bool bBBox) const {
ASSERT(m_nRefCount > 0);
ASSERT(nIndex >= 0 && nIndex < m_nCharCount);
if (m_nRefCount < 1) {
@@ -81,17 +81,16 @@ int32_t CFDE_TxtEdtPage::GetCharRect(int32_t nIndex,
return 0;
}
-int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint,
- FX_BOOL& bBefore) {
- FX_BOOL bVertical = m_pEditEngine->GetEditParams()->dwLayoutStyles &
- FDE_TEXTEDITLAYOUT_DocVertical;
+int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint, bool& bBefore) {
+ bool bVertical = m_pEditEngine->GetEditParams()->dwLayoutStyles &
+ FDE_TEXTEDITLAYOUT_DocVertical;
CFX_PointF ptF = fPoint;
NormalizePt2Rect(ptF, m_rtPageContents, kTolerance);
int32_t nCount = m_PieceMassArr.GetSize();
CFX_RectF rtLine;
int32_t nBgn = 0;
int32_t nEnd = 0;
- FX_BOOL bInLine = FALSE;
+ bool bInLine = false;
int32_t i = 0;
for (i = 0; i < nCount; i++) {
const FDE_TEXTEDITPIECE* pPiece = m_PieceMassArr.GetPtrAt(i);
@@ -101,7 +100,7 @@ int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint,
pPiece->rtPiece.bottom() > ptF.y))) {
nBgn = nEnd = i;
rtLine = pPiece->rtPiece;
- bInLine = TRUE;
+ bInLine = true;
} else if (bInLine) {
if (bVertical ? (!(pPiece->rtPiece.left <= ptF.x &&
pPiece->rtPiece.right() > ptF.x))
@@ -122,13 +121,13 @@ int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint,
nCaret = m_nPageStart + pPiece->nStart;
if (pPiece->rtPiece.Contains(ptF)) {
CFX_RectFArray rectArr;
- m_pTextSet->GetCharRects(pPiece, rectArr, FALSE);
+ m_pTextSet->GetCharRects(pPiece, rectArr, false);
int32_t nRtCount = rectArr.GetSize();
for (int32_t j = 0; j < nRtCount; j++) {
if (rectArr[j].Contains(ptF)) {
nCaret = m_nPageStart + pPiece->nStart + j;
if (nCaret >= m_pEditEngine->GetTextBufLength()) {
- bBefore = TRUE;
+ bBefore = true;
return m_pEditEngine->GetTextBufLength();
}
FX_WCHAR wChar = m_pEditEngine->GetTextBuf()->GetCharByIndex(nCaret);
@@ -139,7 +138,7 @@ int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint,
nCaret--;
}
}
- bBefore = TRUE;
+ bBefore = true;
return nCaret;
}
if (bVertical
@@ -154,7 +153,7 @@ int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint,
}
}
}
- bBefore = TRUE;
+ bBefore = true;
return nCaret;
}
@@ -181,7 +180,7 @@ int32_t CFDE_TxtEdtPage::GetDisplayPos(const CFX_RectF& rtClip,
if (!rtClip.IntersectWith(rtObj)) {
continue;
}
- int32_t nCount = m_pTextSet->GetDisplayPos(pPiece, pos, FALSE);
+ int32_t nCount = m_pTextSet->GetDisplayPos(pPiece, pos, false);
nCharPosCount += nCount;
pos += nCount;
}
@@ -199,31 +198,31 @@ void CFDE_TxtEdtPage::CalcRangeRectArray(int32_t nStart,
CFX_RectFArray& RectFArr) const {
int32_t nPieceCount = m_PieceMassArr.GetSize();
int32_t nEnd = nStart + nCount - 1;
- FX_BOOL bInRange = FALSE;
+ bool bInRange = false;
for (int32_t i = 0; i < nPieceCount; i++) {
FDE_TEXTEDITPIECE* piece = m_PieceMassArr.GetPtrAt(i);
if (!bInRange) {
if (nStart >= piece->nStart && nStart < (piece->nStart + piece->nCount)) {
int32_t nRangeEnd = piece->nCount - 1;
- FX_BOOL bEnd = FALSE;
+ bool bEnd = false;
if (nEnd >= piece->nStart && nEnd < (piece->nStart + piece->nCount)) {
nRangeEnd = nEnd - piece->nStart;
- bEnd = TRUE;
+ bEnd = true;
}
CFX_RectFArray rcArr;
- m_pTextSet->GetCharRects(piece, rcArr, FALSE);
+ m_pTextSet->GetCharRects(piece, rcArr, false);
CFX_RectF rectPiece = rcArr[nStart - piece->nStart];
rectPiece.Union(rcArr[nRangeEnd]);
RectFArr.Add(rectPiece);
if (bEnd) {
return;
}
- bInRange = TRUE;
+ bInRange = true;
}
} else {
if (nEnd >= piece->nStart && nEnd < (piece->nStart + piece->nCount)) {
CFX_RectFArray rcArr;
- m_pTextSet->GetCharRects(piece, rcArr, FALSE);
+ m_pTextSet->GetCharRects(piece, rcArr, false);
CFX_RectF rectPiece = rcArr[0];
rectPiece.Union(rcArr[nEnd - piece->nStart]);
RectFArr.Add(rectPiece);
@@ -239,7 +238,7 @@ int32_t CFDE_TxtEdtPage::SelectWord(const CFX_PointF& fPoint, int32_t& nCount) {
return -1;
}
CFDE_TxtEdtBuf* pBuf = m_pEditEngine->GetTextBuf();
- FX_BOOL bBefore;
+ bool bBefore;
int32_t nIndex = GetCharIndex(fPoint, bBefore);
if (nIndex == m_pEditEngine->GetTextBufLength()) {
nIndex = m_pEditEngine->GetTextBufLength() - 1;
@@ -254,7 +253,7 @@ int32_t CFDE_TxtEdtPage::SelectWord(const CFX_PointF& fPoint, int32_t& nCount) {
return pIter->GetWordPos();
}
-FX_BOOL CFDE_TxtEdtPage::IsLoaded(const CFX_RectF* pClipBox) {
+bool CFDE_TxtEdtPage::IsLoaded(const CFX_RectF* pClipBox) {
return m_bLoaded;
}
@@ -293,8 +292,8 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox,
m_pEndParag->LoadParag();
m_pEndParag->GetLineRange(nEndLine - nEndLineInParag, nPageEnd, nTemp);
nPageEnd += (nTemp - 1);
- FX_BOOL bVertial = pParams->dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical;
- FX_BOOL bLineReserve =
+ bool bVertial = pParams->dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical;
+ bool bLineReserve =
!!(pParams->dwLayoutStyles & FDE_TEXTEDITLAYOUT_LineReserve);
FX_FLOAT fLineStart =
bVertial
@@ -306,7 +305,7 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox,
if (!m_pTextSet)
m_pTextSet.reset(new CFDE_TxtEdtTextSet(this));
- m_PieceMassArr.RemoveAll(TRUE);
+ m_PieceMassArr.RemoveAll(true);
uint32_t dwBreakStatus = FX_TXTBREAK_None;
int32_t nPieceStart = 0;
@@ -315,12 +314,12 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox,
pBreak->ClearBreakPieces();
m_nPageStart = nPageStart;
m_nCharCount = nPageEnd - nPageStart + 1;
- FX_BOOL bReload = FALSE;
+ bool bReload = false;
FX_FLOAT fDefCharWidth = 0;
std::unique_ptr<IFX_CharIter> pIter(m_pIter->Clone());
pIter->SetAt(nPageStart);
m_pIter->SetAt(nPageStart);
- FX_BOOL bFirstPiece = TRUE;
+ bool bFirstPiece = true;
do {
if (bReload) {
dwBreakStatus = pBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
@@ -381,7 +380,7 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox,
}
if (bFirstPiece) {
m_rtPageContents = TxtEdtPiece.rtPiece;
- bFirstPiece = FALSE;
+ bFirstPiece = false;
} else {
m_rtPageContents.Union(TxtEdtPiece.rtPiece);
}
@@ -396,10 +395,10 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox,
pBreak->ClearBreakPieces();
}
if (pIter->GetAt() == nPageEnd && dwBreakStatus == FX_TXTBREAK_LineBreak) {
- bReload = TRUE;
- pIter->Next(TRUE);
+ bReload = true;
+ pIter->Next(true);
}
- } while (pIter->Next(FALSE) && (pIter->GetAt() <= nPageEnd));
+ } while (pIter->Next(false) && (pIter->GetAt() <= nPageEnd));
if (m_rtPageContents.left != 0) {
FX_FLOAT fDelta = 0.0f;
if (m_rtPageContents.width < pParams->fPlateWidth) {
@@ -432,7 +431,7 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox,
pPiece->rtPiece.height = pParams->fFontSize;
}
m_nRefCount = 1;
- m_bLoaded = TRUE;
+ m_bLoaded = true;
return 0;
}
@@ -442,7 +441,7 @@ void CFDE_TxtEdtPage::UnloadPage(const CFX_RectF* pClipBox) {
if (m_nRefCount != 0)
return;
- m_PieceMassArr.RemoveAll(FALSE);
+ m_PieceMassArr.RemoveAll(false);
m_pTextSet.reset();
m_CharWidths.clear();
if (m_pBgnParag) {
diff --git a/xfa/fde/cfde_txtedtpage.h b/xfa/fde/cfde_txtedtpage.h
index 777f82929e..5cb4501afc 100644
--- a/xfa/fde/cfde_txtedtpage.h
+++ b/xfa/fde/cfde_txtedtpage.h
@@ -26,8 +26,8 @@ class CFDE_TxtEdtPage : public IFDE_TxtEdtPage {
CFDE_TxtEdtEngine* GetEngine() const override;
int32_t GetCharRect(int32_t nIndex,
CFX_RectF& rect,
- FX_BOOL bBBox = FALSE) const override;
- int32_t GetCharIndex(const CFX_PointF& fPoint, FX_BOOL& bBefore) override;
+ bool bBBox = false) const override;
+ int32_t GetCharIndex(const CFX_PointF& fPoint, bool& bBefore) override;
void CalcRangeRectArray(int32_t nStart,
int32_t nCount,
CFX_RectFArray& RectFArr) const override;
@@ -37,7 +37,7 @@ class CFDE_TxtEdtPage : public IFDE_TxtEdtPage {
int32_t GetDisplayPos(const CFX_RectF& rtClip,
FXTEXT_CHARPOS*& pCharPos,
CFX_RectF* pBBox) const override;
- FX_BOOL IsLoaded(const CFX_RectF* pClipBox) override;
+ bool IsLoaded(const CFX_RectF* pClipBox) override;
int32_t LoadPage(const CFX_RectF* pClipBox, IFX_Pause* pPause) override;
void UnloadPage(const CFX_RectF* pClipBox) override;
const CFX_RectF& GetContentsBox() override;
@@ -72,7 +72,7 @@ class CFDE_TxtEdtPage : public IFDE_TxtEdtPage {
int32_t m_nPageStart;
int32_t m_nCharCount;
int32_t m_nPageIndex;
- FX_BOOL m_bLoaded;
+ bool m_bLoaded;
CFX_RectF m_rtPage;
CFX_RectF m_rtPageMargin;
CFX_RectF m_rtPageContents;
diff --git a/xfa/fde/cfde_txtedtparag.cpp b/xfa/fde/cfde_txtedtparag.cpp
index 38f569d334..6e6a664ff2 100644
--- a/xfa/fde/cfde_txtedtparag.cpp
+++ b/xfa/fde/cfde_txtedtparag.cpp
@@ -44,7 +44,7 @@ void CFDE_TxtEdtParag::LoadParag() {
pIter->SetAt(m_nCharStart);
int32_t nEndIndex = m_nCharStart + m_nCharCount;
CFX_ArrayTemplate<int32_t> LineBaseArr;
- FX_BOOL bReload = FALSE;
+ bool bReload = false;
uint32_t dwBreakStatus = FX_TXTBREAK_None;
do {
if (bReload) {
@@ -69,10 +69,10 @@ void CFDE_TxtEdtParag::LoadParag() {
}
if ((pIter->GetAt() + 1 == nEndIndex) &&
(dwBreakStatus == FX_TXTBREAK_LineBreak)) {
- bReload = TRUE;
- pIter->Next(TRUE);
+ bReload = true;
+ pIter->Next(true);
}
- } while (pIter->Next(FALSE) && (pIter->GetAt() < nEndIndex));
+ } while (pIter->Next(false) && (pIter->GetAt() < nEndIndex));
pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
pTxtBreak->ClearBreakPieces();
int32_t nLineCount = LineBaseArr.GetSize();
@@ -110,7 +110,7 @@ void CFDE_TxtEdtParag::CalcLines() {
std::unique_ptr<IFX_CharIter> pIter(
new CFDE_TxtEdtBufIter(static_cast<CFDE_TxtEdtBuf*>(pTxtBuf)));
pIter->SetAt(m_nCharStart);
- FX_BOOL bReload = FALSE;
+ bool bReload = false;
do {
if (bReload) {
dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
@@ -128,10 +128,10 @@ void CFDE_TxtEdtParag::CalcLines() {
}
if ((pIter->GetAt() + 1 == nEndIndex) &&
(dwBreakStatus == FX_TXTBREAK_LineBreak)) {
- bReload = TRUE;
- pIter->Next(TRUE);
+ bReload = true;
+ pIter->Next(true);
}
- } while (pIter->Next(FALSE) && (pIter->GetAt() < nEndIndex));
+ } while (pIter->Next(false) && (pIter->GetAt() < nEndIndex));
pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
pTxtBreak->ClearBreakPieces();
m_nLineCount = nCount;
diff --git a/xfa/fde/cfde_txtedttextset.cpp b/xfa/fde/cfde_txtedttextset.cpp
index 9213d650f3..33da0c5a8f 100644
--- a/xfa/fde/cfde_txtedttextset.cpp
+++ b/xfa/fde/cfde_txtedttextset.cpp
@@ -46,7 +46,7 @@ FX_ARGB CFDE_TxtEdtTextSet::GetFontColor() {
int32_t CFDE_TxtEdtTextSet::GetDisplayPos(FDE_TEXTEDITPIECE* pPiece,
FXTEXT_CHARPOS* pCharPos,
- FX_BOOL bCharCode,
+ bool bCharCode,
CFX_WideString* pWSForms) {
if (!pPiece)
return 0;
@@ -76,7 +76,7 @@ int32_t CFDE_TxtEdtTextSet::GetDisplayPos(FDE_TEXTEDITPIECE* pPiece,
int32_t CFDE_TxtEdtTextSet::GetCharRects(const FDE_TEXTEDITPIECE* pPiece,
CFX_RectFArray& rtArray,
- FX_BOOL bBBox) {
+ bool bBBox) {
if (!pPiece)
return 0;
diff --git a/xfa/fde/cfde_txtedttextset.h b/xfa/fde/cfde_txtedttextset.h
index a2121659ba..14979dcf14 100644
--- a/xfa/fde/cfde_txtedttextset.h
+++ b/xfa/fde/cfde_txtedttextset.h
@@ -27,11 +27,11 @@ class CFDE_TxtEdtTextSet : public IFDE_TextSet {
FX_ARGB GetFontColor() override;
int32_t GetDisplayPos(FDE_TEXTEDITPIECE* pPiece,
FXTEXT_CHARPOS* pCharPos,
- FX_BOOL bCharCode = FALSE,
+ bool bCharCode = false,
CFX_WideString* pWSForms = nullptr) override;
int32_t GetCharRects(const FDE_TEXTEDITPIECE* pPiece,
CFX_RectFArray& rtArray,
- FX_BOOL bBBox) override;
+ bool bBBox) override;
private:
CFDE_TxtEdtPage* const m_pPage;
diff --git a/xfa/fde/cfx_chariter.cpp b/xfa/fde/cfx_chariter.cpp
index d51fb0868f..568ecd6cf0 100644
--- a/xfa/fde/cfx_chariter.cpp
+++ b/xfa/fde/cfx_chariter.cpp
@@ -13,17 +13,17 @@ CFX_CharIter::CFX_CharIter(const CFX_WideString& wsText)
CFX_CharIter::~CFX_CharIter() {}
-FX_BOOL CFX_CharIter::Next(FX_BOOL bPrev) {
+bool CFX_CharIter::Next(bool bPrev) {
if (bPrev) {
if (m_nIndex <= 0)
- return FALSE;
+ return false;
m_nIndex--;
} else {
if (m_nIndex + 1 >= m_wsText.GetLength())
- return FALSE;
+ return false;
m_nIndex++;
}
- return TRUE;
+ return true;
}
FX_WCHAR CFX_CharIter::GetChar() {
@@ -40,7 +40,7 @@ int32_t CFX_CharIter::GetAt() const {
return m_nIndex;
}
-FX_BOOL CFX_CharIter::IsEOF(FX_BOOL bTail) const {
+bool CFX_CharIter::IsEOF(bool bTail) const {
return bTail ? (m_nIndex + 1 == m_wsText.GetLength()) : (m_nIndex == 0);
}
diff --git a/xfa/fde/cfx_chariter.h b/xfa/fde/cfx_chariter.h
index 004da3c279..d122af21f1 100644
--- a/xfa/fde/cfx_chariter.h
+++ b/xfa/fde/cfx_chariter.h
@@ -16,11 +16,11 @@ class CFX_CharIter : public IFX_CharIter {
explicit CFX_CharIter(const CFX_WideString& wsText);
~CFX_CharIter() override;
- FX_BOOL Next(FX_BOOL bPrev = FALSE) override;
+ bool Next(bool bPrev = false) override;
FX_WCHAR GetChar() override;
void SetAt(int32_t nIndex) override;
int32_t GetAt() const override;
- FX_BOOL IsEOF(FX_BOOL bTail = TRUE) const override;
+ bool IsEOF(bool bTail = true) const override;
IFX_CharIter* Clone() override;
private:
diff --git a/xfa/fde/cfx_wordbreak.cpp b/xfa/fde/cfx_wordbreak.cpp
index a9aa75b622..04fc32f550 100644
--- a/xfa/fde/cfx_wordbreak.cpp
+++ b/xfa/fde/cfx_wordbreak.cpp
@@ -2789,35 +2789,35 @@ void CFX_WordBreak::Attach(const CFX_WideString& wsText) {
m_pCurIter.reset(new CFX_CharIter(wsText));
}
-FX_BOOL CFX_WordBreak::Next(FX_BOOL bPrev) {
+bool CFX_WordBreak::Next(bool bPrev) {
std::unique_ptr<IFX_CharIter> pIter(
(bPrev ? m_pPreIter : m_pCurIter)->Clone());
if (pIter->IsEOF(!bPrev))
- return FALSE;
+ return false;
pIter->Next(bPrev);
- if (!FindNextBreakPos(pIter.get(), bPrev, TRUE))
- return FALSE;
+ if (!FindNextBreakPos(pIter.get(), bPrev, true))
+ return false;
if (bPrev) {
m_pCurIter = std::move(m_pPreIter);
- m_pCurIter->Next(TRUE);
+ m_pCurIter->Next(true);
m_pPreIter = std::move(pIter);
} else {
m_pPreIter = std::move(m_pCurIter);
m_pPreIter->Next();
m_pCurIter = std::move(pIter);
}
- return TRUE;
+ return true;
}
void CFX_WordBreak::SetAt(int32_t nIndex) {
m_pPreIter.reset();
m_pCurIter->SetAt(nIndex);
- FindNextBreakPos(m_pCurIter.get(), TRUE, FALSE);
+ FindNextBreakPos(m_pCurIter.get(), true, false);
m_pPreIter = std::move(m_pCurIter);
m_pCurIter.reset(m_pPreIter->Clone());
- FindNextBreakPos(m_pCurIter.get(), FALSE, FALSE);
+ FindNextBreakPos(m_pCurIter.get(), false, false);
}
int32_t CFX_WordBreak::GetWordPos() const {
@@ -2844,18 +2844,18 @@ void CFX_WordBreak::GetWord(CFX_WideString& wsWord) const {
wsWord.ReleaseBuffer(nWordLength);
}
-FX_BOOL CFX_WordBreak::IsEOF(FX_BOOL bTail) const {
+bool CFX_WordBreak::IsEOF(bool bTail) const {
return m_pCurIter->IsEOF(bTail);
}
-FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter* pIter,
- FX_BOOL bPrev,
- FX_BOOL bFromNext) {
+bool CFX_WordBreak::FindNextBreakPos(IFX_CharIter* pIter,
+ bool bPrev,
+ bool bFromNext) {
FX_WordBreakProp ePreType = FX_WordBreakProp_None;
FX_WordBreakProp eCurType = FX_WordBreakProp_None;
FX_WordBreakProp eNextType = FX_WordBreakProp_None;
if (pIter->IsEOF(!bPrev)) {
- return TRUE;
+ return true;
}
if (!(bFromNext || pIter->IsEOF(bPrev))) {
pIter->Next(!bPrev);
@@ -2863,7 +2863,7 @@ FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter* pIter,
pIter->Next(bPrev);
}
eCurType = GetWordBreakProperty(pIter->GetChar());
- FX_BOOL bFirst = TRUE;
+ bool bFirst = true;
do {
pIter->Next(bPrev);
eNextType = GetWordBreakProperty(pIter->GetChar());
@@ -2872,7 +2872,7 @@ FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter* pIter,
if (wBreak) {
if (pIter->IsEOF(!bPrev)) {
pIter->Next(!bPrev);
- return TRUE;
+ return true;
}
if (bFirst) {
int32_t nFlags = 0;
@@ -2896,12 +2896,12 @@ FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter* pIter,
if (!((nFlags == 1 && ePreType == FX_WordBreakProp_ALetter) ||
(nFlags == 2 && ePreType == FX_WordBreakProp_Numberic))) {
pIter->Next(!bPrev);
- return TRUE;
+ return true;
}
pIter->Next(bPrev);
- wBreak = FALSE;
+ wBreak = false;
}
- bFirst = FALSE;
+ bFirst = false;
}
if (wBreak) {
int32_t nFlags = 0;
@@ -2922,7 +2922,7 @@ FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter* pIter,
}
if (nFlags <= 0) {
pIter->Next(!bPrev);
- return TRUE;
+ return true;
}
ASSERT(nFlags <= 2);
pIter->Next(bPrev);
@@ -2931,13 +2931,13 @@ FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter* pIter,
(nFlags == 2 && eNextType == FX_WordBreakProp_Numberic))) {
pIter->Next(!bPrev);
pIter->Next(!bPrev);
- return TRUE;
+ return true;
}
}
}
ePreType = eCurType;
eCurType = eNextType;
- bFirst = FALSE;
+ bFirst = false;
} while (!pIter->IsEOF(!bPrev));
- return TRUE;
+ return true;
}
diff --git a/xfa/fde/cfx_wordbreak.h b/xfa/fde/cfx_wordbreak.h
index 14cf7304cd..9df6eda1f5 100644
--- a/xfa/fde/cfx_wordbreak.h
+++ b/xfa/fde/cfx_wordbreak.h
@@ -21,17 +21,15 @@ class CFX_WordBreak {
void Attach(IFX_CharIter* pIter);
void Attach(const CFX_WideString& wsText);
- FX_BOOL Next(FX_BOOL bPrev);
+ bool Next(bool bPrev);
void SetAt(int32_t nIndex);
int32_t GetWordPos() const;
int32_t GetWordLength() const;
void GetWord(CFX_WideString& wsWord) const;
- FX_BOOL IsEOF(FX_BOOL bTail) const;
+ bool IsEOF(bool bTail) const;
protected:
- FX_BOOL FindNextBreakPos(IFX_CharIter* pIter,
- FX_BOOL bPrev,
- FX_BOOL bFromNext = TRUE);
+ bool FindNextBreakPos(IFX_CharIter* pIter, bool bPrev, bool bFromNext = true);
private:
std::unique_ptr<IFX_CharIter> m_pPreIter;
diff --git a/xfa/fde/css/cfde_cssrulecollection.cpp b/xfa/fde/css/cfde_cssrulecollection.cpp
index 95f94cbff3..70cc655a56 100644
--- a/xfa/fde/css/cfde_cssrulecollection.cpp
+++ b/xfa/fde/css/cfde_cssrulecollection.cpp
@@ -92,7 +92,7 @@ void CFDE_CSSRuleCollection::AddRulesFrom(IFDE_CSSStyleSheet* pStyleSheet,
AddRuleTo(m_pUniversalRules, NewRuleData(pSelector, pDeclaration));
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
}
@@ -126,16 +126,16 @@ void CFDE_CSSRuleCollection::AddRuleTo(CFX_MapPtrToPtr& map,
}
}
-FX_BOOL CFDE_CSSRuleCollection::AddRuleTo(FDE_CSSRuleData*& pList,
- FDE_CSSRuleData* pData) {
+bool CFDE_CSSRuleCollection::AddRuleTo(FDE_CSSRuleData*& pList,
+ FDE_CSSRuleData* pData) {
if (pList) {
pData->pNext = pList->pNext;
pList->pNext = pData;
- return FALSE;
+ return false;
}
pList = pData;
- return TRUE;
+ return true;
}
FDE_CSSRuleData* CFDE_CSSRuleCollection::NewRuleData(
diff --git a/xfa/fde/css/fde_css.h b/xfa/fde/css/fde_css.h
index 5b033cf014..1ee037537c 100644
--- a/xfa/fde/css/fde_css.h
+++ b/xfa/fde/css/fde_css.h
@@ -760,7 +760,7 @@ class IFDE_CSSStyleSheet : public IFX_Retainable {
int32_t iBufSize,
uint16_t wCodePage,
uint32_t dwMediaList = FDE_CSSMEDIATYPE_ALL);
- virtual FX_BOOL GetUrl(CFX_WideString& szUrl) = 0;
+ virtual bool GetUrl(CFX_WideString& szUrl) = 0;
virtual uint32_t GetMediaList() const = 0;
virtual uint16_t GetCodePage() const = 0;
@@ -783,7 +783,7 @@ struct FDE_CSSLENGTH {
return (FDE_CSSLENGTHUNIT)(m_iData & FDE_CSSUNITMASK);
}
FX_FLOAT GetValue() const { return (m_iData >> FDE_CSSUNITBITS) / 1024.0f; }
- FX_BOOL NonZero() const { return (m_iData >> FDE_CSSUNITBITS) != 0; }
+ bool NonZero() const { return (m_iData >> FDE_CSSUNITBITS) != 0; }
private:
intptr_t m_iData;
@@ -897,8 +897,8 @@ class IFDE_CSSComputedStyle : public IFX_Retainable {
virtual IFDE_CSSBoundaryStyle* GetBoundaryStyles() = 0;
virtual IFDE_CSSPositionStyle* GetPositionStyles() = 0;
virtual IFDE_CSSParagraphStyle* GetParagraphStyles() = 0;
- virtual FX_BOOL GetCustomStyle(const CFX_WideStringC& wsName,
- CFX_WideString& wsValue) const = 0;
+ virtual bool GetCustomStyle(const CFX_WideStringC& wsName,
+ CFX_WideString& wsValue) const = 0;
};
#endif // XFA_FDE_CSS_FDE_CSS_H_
diff --git a/xfa/fde/css/fde_csscache.h b/xfa/fde/css/fde_csscache.h
index 8f4f2a78c7..10f4d9e0fa 100644
--- a/xfa/fde/css/fde_csscache.h
+++ b/xfa/fde/css/fde_csscache.h
@@ -58,7 +58,7 @@ class CFDE_CSSAccelerator : public CFX_Target {
void OnEnterTag(CXFA_CSSTagProvider* pTag);
void OnLeaveTag(CXFA_CSSTagProvider* pTag);
- void Clear() { m_Stack.RemoveAll(FALSE); }
+ void Clear() { m_Stack.RemoveAll(false); }
FDE_CSSTagCache* GetTopElement() const { return m_Stack.GetTopElement(); }
diff --git a/xfa/fde/css/fde_cssdatatable.cpp b/xfa/fde/css/fde_cssdatatable.cpp
index 955fe9e747..d2f81833e3 100644
--- a/xfa/fde/css/fde_cssdatatable.cpp
+++ b/xfa/fde/css/fde_cssdatatable.cpp
@@ -17,25 +17,25 @@ uint8_t Hex2Dec(uint8_t hexHigh, uint8_t hexLow) {
} // namespace
-FX_BOOL FDE_CSSLengthToFloat(const FDE_CSSLENGTH& len,
- FX_FLOAT fPercentBase,
- FX_FLOAT& fResult) {
+bool FDE_CSSLengthToFloat(const FDE_CSSLENGTH& len,
+ FX_FLOAT fPercentBase,
+ FX_FLOAT& fResult) {
switch (len.GetUnit()) {
case FDE_CSSLENGTHUNIT_Point:
fResult = len.GetValue();
- return TRUE;
+ return true;
case FDE_CSSLENGTHUNIT_Percent:
fResult = len.GetValue() * fPercentBase;
- return TRUE;
+ return true;
default:
- return FALSE;
+ return false;
}
}
CFX_FloatRect FDE_CSSBoundaryToRect(IFDE_CSSBoundaryStyle* pBoundStyle,
FX_FLOAT fContainerWidth,
- FX_BOOL bPadding,
- FX_BOOL bBorder,
- FX_BOOL bMargin) {
+ bool bPadding,
+ bool bBorder,
+ bool bMargin) {
FX_FLOAT fResult;
const FDE_CSSRECT* pRect;
CFX_FloatRect rect(0, 0, 0, 0);
@@ -672,15 +672,15 @@ FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(const CFX_WideStringC& wsName) {
return nullptr;
}
-FX_BOOL FDE_ParseCSSNumber(const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_FLOAT& fValue,
- FDE_CSSPRIMITIVETYPE& eUnit) {
+bool FDE_ParseCSSNumber(const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ FX_FLOAT& fValue,
+ FDE_CSSPRIMITIVETYPE& eUnit) {
ASSERT(pszValue && iValueLen > 0);
int32_t iUsedLen = 0;
fValue = FXSYS_wcstof(pszValue, iValueLen, &iUsedLen);
if (iUsedLen <= 0)
- return FALSE;
+ return false;
iValueLen -= iUsedLen;
pszValue += iUsedLen;
@@ -693,13 +693,13 @@ FX_BOOL FDE_ParseCSSNumber(const FX_WCHAR* pszValue,
if (pUnit)
eUnit = (FDE_CSSPRIMITIVETYPE)pUnit->wValue;
}
- return TRUE;
+ return true;
}
-FX_BOOL FDE_ParseCSSString(const FX_WCHAR* pszValue,
- int32_t iValueLen,
- int32_t& iOffset,
- int32_t& iLength) {
+bool FDE_ParseCSSString(const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ int32_t& iOffset,
+ int32_t& iLength) {
ASSERT(pszValue && iValueLen > 0);
iOffset = 0;
iLength = iValueLen;
@@ -712,25 +712,25 @@ FX_BOOL FDE_ParseCSSString(const FX_WCHAR* pszValue,
return iValueLen > 0;
}
-FX_BOOL FDE_ParseCSSURI(const FX_WCHAR* pszValue,
- int32_t iValueLen,
- int32_t& iOffset,
- int32_t& iLength) {
+bool FDE_ParseCSSURI(const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ int32_t& iOffset,
+ int32_t& iLength) {
ASSERT(pszValue && iValueLen > 0);
if (iValueLen < 6 || pszValue[iValueLen - 1] != ')' ||
FXSYS_wcsnicmp(L"url(", pszValue, 4)) {
- return FALSE;
+ return false;
}
if (FDE_ParseCSSString(pszValue + 4, iValueLen - 5, iOffset, iLength)) {
iOffset += 4;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL FDE_ParseCSSColor(const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_ARGB& dwColor) {
+bool FDE_ParseCSSColor(const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ FX_ARGB& dwColor) {
ASSERT(pszValue && iValueLen > 0);
if (*pszValue == '#') {
@@ -740,23 +740,23 @@ FX_BOOL FDE_ParseCSSColor(const FX_WCHAR* pszValue,
uint8_t green = Hex2Dec((uint8_t)pszValue[2], (uint8_t)pszValue[2]);
uint8_t blue = Hex2Dec((uint8_t)pszValue[3], (uint8_t)pszValue[3]);
dwColor = ArgbEncode(255, red, green, blue);
- return TRUE;
+ return true;
}
case 7: {
uint8_t red = Hex2Dec((uint8_t)pszValue[1], (uint8_t)pszValue[2]);
uint8_t green = Hex2Dec((uint8_t)pszValue[3], (uint8_t)pszValue[4]);
uint8_t blue = Hex2Dec((uint8_t)pszValue[5], (uint8_t)pszValue[6]);
dwColor = ArgbEncode(255, red, green, blue);
- return TRUE;
+ return true;
}
default:
- return FALSE;
+ return false;
}
}
if (iValueLen >= 10) {
if (pszValue[iValueLen - 1] != ')' || FXSYS_wcsnicmp(L"rgb(", pszValue, 4))
- return FALSE;
+ return false;
uint8_t rgb[3] = {0};
FX_FLOAT fValue;
@@ -764,27 +764,27 @@ FX_BOOL FDE_ParseCSSColor(const FX_WCHAR* pszValue,
CFDE_CSSValueListParser list(pszValue + 4, iValueLen - 5, ',');
for (int32_t i = 0; i < 3; ++i) {
if (!list.NextValue(eType, pszValue, iValueLen))
- return FALSE;
+ return false;
if (eType != FDE_CSSPRIMITIVETYPE_Number)
- return FALSE;
+ return false;
if (!FDE_ParseCSSNumber(pszValue, iValueLen, fValue, eType))
- return FALSE;
+ return false;
rgb[i] = eType == FDE_CSSPRIMITIVETYPE_Percent
? FXSYS_round(fValue * 2.55f)
: FXSYS_round(fValue);
}
dwColor = ArgbEncode(255, rgb[0], rgb[1], rgb[2]);
- return TRUE;
+ return true;
}
FDE_LPCCSSCOLORTABLE pColor =
FDE_GetCSSColorByName(CFX_WideStringC(pszValue, iValueLen));
if (!pColor)
- return FALSE;
+ return false;
dwColor = pColor->dwValue;
- return TRUE;
+ return true;
}
CFDE_CSSValueList::CFDE_CSSValueList(IFX_MemoryAllocator* pStaticStore,
@@ -802,14 +802,14 @@ int32_t CFDE_CSSValueList::CountValues() const {
IFDE_CSSValue* CFDE_CSSValueList::GetValue(int32_t index) const {
return m_ppList[index];
}
-FX_BOOL CFDE_CSSValueListParser::NextValue(FDE_CSSPRIMITIVETYPE& eType,
- const FX_WCHAR*& pStart,
- int32_t& iLength) {
+bool CFDE_CSSValueListParser::NextValue(FDE_CSSPRIMITIVETYPE& eType,
+ const FX_WCHAR*& pStart,
+ int32_t& iLength) {
while (m_pCur < m_pEnd && (*m_pCur <= ' ' || *m_pCur == m_Separator)) {
++m_pCur;
}
if (m_pCur >= m_pEnd) {
- return FALSE;
+ return false;
}
eType = FDE_CSSPRIMITIVETYPE_Unknown;
pStart = m_pCur;
@@ -853,14 +853,14 @@ FX_BOOL CFDE_CSSValueListParser::NextValue(FDE_CSSPRIMITIVETYPE& eType,
eType = FDE_CSSPRIMITIVETYPE_RGB;
}
} else {
- iLength = SkipTo(m_Separator, TRUE, TRUE);
+ iLength = SkipTo(m_Separator, true, true);
eType = FDE_CSSPRIMITIVETYPE_String;
}
return m_pCur <= m_pEnd && iLength > 0;
}
int32_t CFDE_CSSValueListParser::SkipTo(FX_WCHAR wch,
- FX_BOOL bWSSeparator,
- FX_BOOL bBrContinue) {
+ bool bWSSeparator,
+ bool bBrContinue) {
const FX_WCHAR* pStart = m_pCur;
if (!bBrContinue) {
if (bWSSeparator) {
diff --git a/xfa/fde/css/fde_cssdatatable.h b/xfa/fde/css/fde_cssdatatable.h
index 62eff3f014..660895cdb0 100644
--- a/xfa/fde/css/fde_cssdatatable.h
+++ b/xfa/fde/css/fde_cssdatatable.h
@@ -81,15 +81,15 @@ class CFDE_CSSValueListParser : public CFX_Target {
: m_Separator(separator), m_pCur(psz), m_pEnd(psz + iLen) {
ASSERT(psz && iLen > 0);
}
- FX_BOOL NextValue(FDE_CSSPRIMITIVETYPE& eType,
- const FX_WCHAR*& pStart,
- int32_t& iLength);
+ bool NextValue(FDE_CSSPRIMITIVETYPE& eType,
+ const FX_WCHAR*& pStart,
+ int32_t& iLength);
FX_WCHAR m_Separator;
protected:
int32_t SkipTo(FX_WCHAR wch,
- FX_BOOL bWSSeparator = FALSE,
- FX_BOOL bBrContinue = FALSE);
+ bool bWSSeparator = false,
+ bool bBrContinue = false);
const FX_WCHAR* m_pCur;
const FX_WCHAR* m_pEnd;
@@ -155,20 +155,20 @@ struct FDE_CSSPERSUDOTABLE {
typedef FDE_CSSPERSUDOTABLE const* FDE_LPCCSSPERSUDOTABLE;
FDE_LPCCSSPERSUDOTABLE FDE_GetCSSPersudoByEnum(FDE_CSSPERSUDO ePersudo);
-FX_BOOL FDE_ParseCSSNumber(const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_FLOAT& fValue,
- FDE_CSSPRIMITIVETYPE& eUnit);
-FX_BOOL FDE_ParseCSSString(const FX_WCHAR* pszValue,
- int32_t iValueLen,
- int32_t& iOffset,
- int32_t& iLength);
-FX_BOOL FDE_ParseCSSColor(const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_ARGB& dwColor);
-FX_BOOL FDE_ParseCSSURI(const FX_WCHAR* pszValue,
+bool FDE_ParseCSSNumber(const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ FX_FLOAT& fValue,
+ FDE_CSSPRIMITIVETYPE& eUnit);
+bool FDE_ParseCSSString(const FX_WCHAR* pszValue,
int32_t iValueLen,
int32_t& iOffset,
int32_t& iLength);
+bool FDE_ParseCSSColor(const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ FX_ARGB& dwColor);
+bool FDE_ParseCSSURI(const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ int32_t& iOffset,
+ int32_t& iLength);
#endif // XFA_FDE_CSS_FDE_CSSDATATABLE_H_
diff --git a/xfa/fde/css/fde_cssdeclaration.cpp b/xfa/fde/css/fde_cssdeclaration.cpp
index 3ce6ebabd6..2196d6bd91 100644
--- a/xfa/fde/css/fde_cssdeclaration.cpp
+++ b/xfa/fde/css/fde_cssdeclaration.cpp
@@ -9,7 +9,7 @@
#include "core/fxcrt/fx_ext.h"
IFDE_CSSValue* CFDE_CSSDeclaration::GetProperty(FDE_CSSPROPERTY eProperty,
- FX_BOOL& bImportant) const {
+ bool& bImportant) const {
for (const FDE_CSSPropertyHolder* pHolder = m_pFirstProperty; pHolder;
pHolder = pHolder->pNext) {
if (pHolder->eProperty == eProperty) {
@@ -25,7 +25,7 @@ FX_POSITION CFDE_CSSDeclaration::GetStartPosition() const {
void CFDE_CSSDeclaration::GetNextProperty(FX_POSITION& pos,
FDE_CSSPROPERTY& eProperty,
IFDE_CSSValue*& pValue,
- FX_BOOL& bImportant) const {
+ bool& bImportant) const {
const FDE_CSSPropertyHolder* pHolder = (const FDE_CSSPropertyHolder*)pos;
bImportant = pHolder->bImportant;
eProperty = (FDE_CSSPROPERTY)pHolder->eProperty;
@@ -86,7 +86,7 @@ inline IFDE_CSSPrimitiveValue* CFDE_CSSDeclaration::NewEnumValue(
void CFDE_CSSDeclaration::AddPropertyHolder(IFX_MemoryAllocator* pStaticStore,
FDE_CSSPROPERTY eProperty,
IFDE_CSSValue* pValue,
- FX_BOOL bImportant) {
+ bool bImportant) {
FDE_CSSPropertyHolder* pHolder =
FXTARGET_NewWith(pStaticStore) FDE_CSSPropertyHolder;
pHolder->bImportant = bImportant;
@@ -99,17 +99,17 @@ void CFDE_CSSDeclaration::AddPropertyHolder(IFX_MemoryAllocator* pStaticStore,
m_pFirstProperty = pHolder;
m_pLastProperty = pHolder;
}
-FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen) {
+bool CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen) {
ASSERT(iValueLen > 0);
- FX_BOOL bImportant = FALSE;
+ bool bImportant = false;
if (iValueLen >= 10 && pszValue[iValueLen - 10] == '!' &&
FXSYS_wcsnicmp(L"important", pszValue + iValueLen - 9, 9) == 0) {
if ((iValueLen -= 10) == 0) {
- return FALSE;
+ return false;
}
- bImportant = TRUE;
+ bImportant = true;
}
const uint32_t dwType = pArgs->pProperty->dwType;
switch (dwType & 0x0F) {
@@ -152,10 +152,10 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
if (pCSSValue) {
AddPropertyHolder(pArgs->pStaticStore, pArgs->pProperty->eName,
pCSSValue, bImportant);
- return TRUE;
+ return true;
}
if (FDE_IsOnlyValue(dwType, g_ValueGuessOrder[i])) {
- return FALSE;
+ return false;
}
}
} break;
@@ -189,7 +189,7 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
FDE_CSSPROPERTY_BorderBottomColor,
FDE_CSSPROPERTY_BorderBottomStyle,
FDE_CSSPROPERTY_BorderBottomWidth);
- return TRUE;
+ return true;
}
break;
case FDE_CSSPROPERTY_BorderLeft:
@@ -199,7 +199,7 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
FDE_CSSPROPERTY_BorderLeftColor,
FDE_CSSPROPERTY_BorderLeftStyle,
FDE_CSSPROPERTY_BorderLeftWidth);
- return TRUE;
+ return true;
}
break;
case FDE_CSSPROPERTY_BorderTop:
@@ -209,7 +209,7 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
FDE_CSSPROPERTY_BorderTopColor,
FDE_CSSPROPERTY_BorderTopStyle,
FDE_CSSPROPERTY_BorderTopWidth);
- return TRUE;
+ return true;
}
break;
case FDE_CSSPROPERTY_BorderRight:
@@ -219,7 +219,7 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
FDE_CSSPROPERTY_BorderRightColor,
FDE_CSSPROPERTY_BorderRightStyle,
FDE_CSSPROPERTY_BorderRightWidth);
- return TRUE;
+ return true;
}
break;
case FDE_CSSPROPERTY_BorderBottom:
@@ -229,7 +229,7 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
FDE_CSSPROPERTY_BorderBottomColor,
FDE_CSSPROPERTY_BorderBottomStyle,
FDE_CSSPROPERTY_BorderBottomWidth);
- return TRUE;
+ return true;
}
break;
case FDE_CSSPROPERTY_Overflow:
@@ -252,16 +252,16 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
return ParseValueListProperty(pArgs, pszValue, iValueLen, bImportant);
}
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
- return FALSE;
+ return false;
}
-FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszName,
- int32_t iNameLen,
- const FX_WCHAR* pszValue,
- int32_t iValueLen) {
+bool CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszName,
+ int32_t iNameLen,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen) {
FDE_CSSCustomProperty* pProperty =
FXTARGET_NewWith(pArgs->pStaticStore) FDE_CSSCustomProperty;
pProperty->pwsName = CopyToLocal(pArgs, pszName, iNameLen);
@@ -272,7 +272,7 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
else
m_pFirstCustom = pProperty;
m_pLastCustom = pProperty;
- return TRUE;
+ return true;
}
IFDE_CSSValue* CFDE_CSSDeclaration::ParseNumber(
const FDE_CSSPROPERTYARGS* pArgs,
@@ -401,11 +401,10 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseFunction(
return FXTARGET_NewWith(pArgs->pStaticStore)
CFDE_CSSPrimitiveValue(pFunction);
}
-FX_BOOL CFDE_CSSDeclaration::ParseContentProperty(
- const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant) {
+bool CFDE_CSSDeclaration::ParseContentProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant) {
IFX_MemoryAllocator* pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
FDE_CSSPRIMITIVETYPE eType;
@@ -417,7 +416,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseContentProperty(
eType, CopyToLocal(pArgs, pszValue, iValueLen)));
break;
case FDE_CSSPRIMITIVETYPE_Number:
- return FALSE;
+ return false;
case FDE_CSSPRIMITIVETYPE_String: {
const FDE_CSSPROPERTYVALUETABLE* pValue =
FDE_GetCSSPropertyValueByName(CFX_WideStringC(pszValue, iValueLen));
@@ -428,7 +427,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseContentProperty(
if (list.GetSize() == 0) {
list.Add(NewEnumValue(pStaticStore, pValue->eName));
} else {
- return FALSE;
+ return false;
}
} break;
case FDE_CSSPROPERTYVALUE_OpenQuote:
@@ -438,7 +437,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseContentProperty(
list.Add(NewEnumValue(pStaticStore, pValue->eName));
break;
default:
- return FALSE;
+ return false;
}
continue;
}
@@ -451,25 +450,24 @@ FX_BOOL CFDE_CSSDeclaration::ParseContentProperty(
eType, CopyToLocal(pArgs, pszValue, iValueLen)));
} break;
case FDE_CSSPRIMITIVETYPE_RGB:
- return FALSE;
+ return false;
default:
break;
}
}
if (list.GetSize() == 0) {
- return FALSE;
+ return false;
}
AddPropertyHolder(pStaticStore, pArgs->pProperty->eName,
FXTARGET_NewWith(pStaticStore)
CFDE_CSSValueList(pStaticStore, list),
bImportant);
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_CSSDeclaration::ParseCounterProperty(
- const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant) {
+bool CFDE_CSSDeclaration::ParseCounterProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant) {
IFX_MemoryAllocator* pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
CFDE_CSSValueArray list;
@@ -486,7 +484,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseCounterProperty(
CFDE_CSSValueList(pStaticStore, list));
list.RemoveAll();
} else {
- return FALSE;
+ return false;
}
}
} break;
@@ -513,19 +511,19 @@ FX_BOOL CFDE_CSSDeclaration::ParseCounterProperty(
CFDE_CSSValueList(pStaticStore, list));
}
if (listFull.GetSize() == 0) {
- return FALSE;
+ return false;
}
AddPropertyHolder(pStaticStore, pArgs->pProperty->eName,
FXTARGET_NewWith(pStaticStore)
CFDE_CSSValueList(pStaticStore, listFull),
bImportant);
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_CSSDeclaration::ParseValueListProperty(
+bool CFDE_CSSDeclaration::ParseValueListProperty(
const FDE_CSSPROPERTYARGS* pArgs,
const FX_WCHAR* pszValue,
int32_t iValueLen,
- FX_BOOL bImportant) {
+ bool bImportant) {
IFX_MemoryAllocator* pStaticStore = pArgs->pStaticStore;
FX_WCHAR separator =
(pArgs->pProperty->eName == FDE_CSSPROPERTY_FontFamily) ? ',' : ' ';
@@ -581,7 +579,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseValueListProperty(
}
}
if (list.GetSize() == 0) {
- return FALSE;
+ return false;
}
switch (pArgs->pProperty->eName) {
case FDE_CSSPROPERTY_BorderColor:
@@ -614,50 +612,49 @@ FX_BOOL CFDE_CSSDeclaration::ParseValueListProperty(
FXTARGET_NewWith(pStaticStore) CFDE_CSSValueList(pStaticStore, list);
AddPropertyHolder(pStaticStore, pArgs->pProperty->eName, pList,
bImportant);
- return TRUE;
+ return true;
} break;
}
- return FALSE;
+ return false;
}
-FX_BOOL CFDE_CSSDeclaration::Add4ValuesProperty(
- IFX_MemoryAllocator* pStaticStore,
- const CFDE_CSSValueArray& list,
- FX_BOOL bImportant,
- FDE_CSSPROPERTY eLeft,
- FDE_CSSPROPERTY eTop,
- FDE_CSSPROPERTY eRight,
- FDE_CSSPROPERTY eBottom) {
+bool CFDE_CSSDeclaration::Add4ValuesProperty(IFX_MemoryAllocator* pStaticStore,
+ const CFDE_CSSValueArray& list,
+ bool bImportant,
+ FDE_CSSPROPERTY eLeft,
+ FDE_CSSPROPERTY eTop,
+ FDE_CSSPROPERTY eRight,
+ FDE_CSSPROPERTY eBottom) {
switch (list.GetSize()) {
case 1:
AddPropertyHolder(pStaticStore, eLeft, list[0], bImportant);
AddPropertyHolder(pStaticStore, eTop, list[0], bImportant);
AddPropertyHolder(pStaticStore, eRight, list[0], bImportant);
AddPropertyHolder(pStaticStore, eBottom, list[0], bImportant);
- return TRUE;
+ return true;
case 2:
AddPropertyHolder(pStaticStore, eLeft, list[1], bImportant);
AddPropertyHolder(pStaticStore, eTop, list[0], bImportant);
AddPropertyHolder(pStaticStore, eRight, list[1], bImportant);
AddPropertyHolder(pStaticStore, eBottom, list[0], bImportant);
- return TRUE;
+ return true;
case 3:
AddPropertyHolder(pStaticStore, eLeft, list[1], bImportant);
AddPropertyHolder(pStaticStore, eTop, list[0], bImportant);
AddPropertyHolder(pStaticStore, eRight, list[1], bImportant);
AddPropertyHolder(pStaticStore, eBottom, list[2], bImportant);
- return TRUE;
+ return true;
case 4:
AddPropertyHolder(pStaticStore, eLeft, list[3], bImportant);
AddPropertyHolder(pStaticStore, eTop, list[0], bImportant);
AddPropertyHolder(pStaticStore, eRight, list[1], bImportant);
AddPropertyHolder(pStaticStore, eBottom, list[2], bImportant);
- return TRUE;
+ return true;
default:
break;
}
- return FALSE;
+ return false;
}
-FX_BOOL CFDE_CSSDeclaration::ParseBorderPropoerty(
+bool CFDE_CSSDeclaration::ParseBorderPropoerty(
IFX_MemoryAllocator* pStaticStore,
const FX_WCHAR* pszValue,
int32_t iValueLen,
@@ -741,13 +738,13 @@ FX_BOOL CFDE_CSSDeclaration::ParseBorderPropoerty(
pStyle = NewEnumValue(pStaticStore, FDE_CSSPROPERTYVALUE_None);
if (!pWidth)
pWidth = NewNumberValue(pStaticStore, FDE_CSSPRIMITIVETYPE_Number, 0.0f);
- return TRUE;
+ return true;
}
void CFDE_CSSDeclaration::AddBorderProperty(IFX_MemoryAllocator* pStaticStore,
IFDE_CSSValue* pColor,
IFDE_CSSValue* pStyle,
IFDE_CSSValue* pWidth,
- FX_BOOL bImportant,
+ bool bImportant,
FDE_CSSPROPERTY eColor,
FDE_CSSPROPERTY eStyle,
FDE_CSSPROPERTY eWidth) {
@@ -755,11 +752,11 @@ void CFDE_CSSDeclaration::AddBorderProperty(IFX_MemoryAllocator* pStaticStore,
AddPropertyHolder(pStaticStore, eWidth, pWidth, bImportant);
AddPropertyHolder(pStaticStore, eColor, pColor, bImportant);
}
-FX_BOOL CFDE_CSSDeclaration::ParseListStyleProperty(
+bool CFDE_CSSDeclaration::ParseListStyleProperty(
const FDE_CSSPROPERTYARGS* pArgs,
const FX_WCHAR* pszValue,
int32_t iValueLen,
- FX_BOOL bImportant) {
+ bool bImportant) {
IFX_MemoryAllocator* pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
IFDE_CSSPrimitiveValue* pType = nullptr;
@@ -829,13 +826,13 @@ FX_BOOL CFDE_CSSDeclaration::ParseListStyleProperty(
bImportant);
AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_ListStyleType, pType,
bImportant);
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_CSSDeclaration::ParseBackgroundProperty(
+bool CFDE_CSSDeclaration::ParseBackgroundProperty(
const FDE_CSSPROPERTYARGS* pArgs,
const FX_WCHAR* pszValue,
int32_t iValueLen,
- FX_BOOL bImportant) {
+ bool bImportant) {
IFX_MemoryAllocator* pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
IFDE_CSSPrimitiveValue* pColor = nullptr;
@@ -966,12 +963,12 @@ FX_BOOL CFDE_CSSDeclaration::ParseBackgroundProperty(
bImportant);
AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_BackgroundAttachment,
pAttachment, bImportant);
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_CSSDeclaration::ParseFontProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant) {
+bool CFDE_CSSDeclaration::ParseFontProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant) {
IFX_MemoryAllocator* pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, '/');
IFDE_CSSPrimitiveValue* pStyle = nullptr;
@@ -1096,13 +1093,13 @@ FX_BOOL CFDE_CSSDeclaration::ParseFontProperty(const FDE_CSSPROPERTYARGS* pArgs,
AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_FontFamily, pList,
bImportant);
}
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_CSSDeclaration::ParseColumnRuleProperty(
+bool CFDE_CSSDeclaration::ParseColumnRuleProperty(
const FDE_CSSPROPERTYARGS* pArgs,
const FX_WCHAR* pszValue,
int32_t iValueLen,
- FX_BOOL bImportant) {
+ bool bImportant) {
IFX_MemoryAllocator* pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
IFDE_CSSPrimitiveValue* pColumnRuleWidth = nullptr;
@@ -1172,7 +1169,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseColumnRuleProperty(
}
}
if (!pColumnRuleColor && !pColumnRuleStyle && !pColumnRuleWidth)
- return FALSE;
+ return false;
if (!pColumnRuleStyle)
pColumnRuleStyle = NewEnumValue(pStaticStore, FDE_CSSPROPERTYVALUE_None);
@@ -1188,13 +1185,12 @@ FX_BOOL CFDE_CSSDeclaration::ParseColumnRuleProperty(
pColumnRuleWidth, bImportant);
AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_ColumnRuleColor,
pColumnRuleColor, bImportant);
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_CSSDeclaration::ParseTextEmphasisProperty(
- FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant) {
+bool CFDE_CSSDeclaration::ParseTextEmphasisProperty(FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant) {
IFX_MemoryAllocator* pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
CFDE_CSSValueArray arrEmphasisStyle;
@@ -1241,13 +1237,12 @@ FX_BOOL CFDE_CSSDeclaration::ParseTextEmphasisProperty(
AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_TextEmphasisColor,
pEmphasisColor, bImportant);
}
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_CSSDeclaration::ParseColumnsProperty(
- const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant) {
+bool CFDE_CSSDeclaration::ParseColumnsProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant) {
IFX_MemoryAllocator* pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
IFDE_CSSPrimitiveValue* pColumnWidth = nullptr;
@@ -1282,7 +1277,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseColumnsProperty(
}
}
if (!pColumnWidth && !pColumnCount)
- return FALSE;
+ return false;
if (!pColumnWidth)
pColumnWidth = NewEnumValue(pStaticStore, FDE_CSSPROPERTYVALUE_Auto);
@@ -1293,13 +1288,13 @@ FX_BOOL CFDE_CSSDeclaration::ParseColumnsProperty(
bImportant);
AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_ColumnCount, pColumnCount,
bImportant);
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_CSSDeclaration::ParseOverflowProperty(
+bool CFDE_CSSDeclaration::ParseOverflowProperty(
const FDE_CSSPROPERTYARGS* pArgs,
const FX_WCHAR* pszValue,
int32_t iValueLen,
- FX_BOOL bImportant) {
+ bool bImportant) {
IFX_MemoryAllocator* pStaticStore = pArgs->pStaticStore;
CFDE_CSSValueListParser parser(pszValue, iValueLen, ' ');
IFDE_CSSPrimitiveValue* pOverflowX = nullptr;
@@ -1318,7 +1313,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseOverflowProperty(
case FDE_CSSOVERFLOW_NoDisplay:
case FDE_CSSOVERFLOW_NoContent:
if (pOverflowX && pOverflowY)
- return FALSE;
+ return false;
if (!pOverflowX) {
pOverflowX = NewEnumValue(pStaticStore, pValue->eName);
} else if (!pOverflowY) {
@@ -1332,7 +1327,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseOverflowProperty(
}
}
if (!pOverflowX && !pOverflowY)
- return FALSE;
+ return false;
if (!pOverflowY)
pOverflowY = NewEnumValue(pStaticStore, pOverflowX->GetEnum());
@@ -1341,5 +1336,5 @@ FX_BOOL CFDE_CSSDeclaration::ParseOverflowProperty(
bImportant);
AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_OverflowY, pOverflowY,
bImportant);
- return TRUE;
+ return true;
}
diff --git a/xfa/fde/css/fde_cssdeclaration.h b/xfa/fde/css/fde_cssdeclaration.h
index 3598429e3a..f03b0c616a 100644
--- a/xfa/fde/css/fde_cssdeclaration.h
+++ b/xfa/fde/css/fde_cssdeclaration.h
@@ -14,7 +14,7 @@
class FDE_CSSPropertyHolder : public CFX_Target {
public:
int16_t eProperty;
- FX_BOOL bImportant;
+ bool bImportant;
IFDE_CSSValue* pValue;
FDE_CSSPropertyHolder* pNext;
};
@@ -40,88 +40,87 @@ class CFDE_CSSDeclaration : public CFX_Target {
m_pFirstCustom(nullptr),
m_pLastCustom(nullptr) {}
- IFDE_CSSValue* GetProperty(FDE_CSSPROPERTY eProperty,
- FX_BOOL& bImportant) const;
+ IFDE_CSSValue* GetProperty(FDE_CSSPROPERTY eProperty, bool& bImportant) const;
FX_POSITION GetStartPosition() const;
void GetNextProperty(FX_POSITION& pos,
FDE_CSSPROPERTY& eProperty,
IFDE_CSSValue*& pValue,
- FX_BOOL& bImportant) const;
+ bool& bImportant) const;
FX_POSITION GetStartCustom() const;
void GetNextCustom(FX_POSITION& pos,
CFX_WideString& wsName,
CFX_WideString& wsValue) const;
- FX_BOOL AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen);
- FX_BOOL AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszName,
- int32_t iNameLen,
- const FX_WCHAR* pszValue,
- int32_t iValueLen);
+ bool AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen);
+ bool AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszName,
+ int32_t iNameLen,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen);
protected:
- FX_BOOL ParseTextEmphasisProperty(FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant);
- FX_BOOL ParseColumnsProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant);
- FX_BOOL ParseColumnRuleProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant);
- FX_BOOL ParseOverflowProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant);
- FX_BOOL ParseFontProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant);
- FX_BOOL ParseBackgroundProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant);
- FX_BOOL ParseListStyleProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ bool ParseTextEmphasisProperty(FDE_CSSPROPERTYARGS* pArgs,
const FX_WCHAR* pszValue,
int32_t iValueLen,
- FX_BOOL bImportant);
- FX_BOOL ParseBorderPropoerty(IFX_MemoryAllocator* pStaticStore,
+ bool bImportant);
+ bool ParseColumnsProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant);
+ bool ParseColumnRuleProperty(const FDE_CSSPROPERTYARGS* pArgs,
const FX_WCHAR* pszValue,
int32_t iValueLen,
- IFDE_CSSValue*& pColor,
- IFDE_CSSValue*& pStyle,
- IFDE_CSSValue*& pWidth) const;
+ bool bImportant);
+ bool ParseOverflowProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant);
+ bool ParseFontProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant);
+ bool ParseBackgroundProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant);
+ bool ParseListStyleProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant);
+ bool ParseBorderPropoerty(IFX_MemoryAllocator* pStaticStore,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ IFDE_CSSValue*& pColor,
+ IFDE_CSSValue*& pStyle,
+ IFDE_CSSValue*& pWidth) const;
void AddBorderProperty(IFX_MemoryAllocator* pStaticStore,
IFDE_CSSValue* pColor,
IFDE_CSSValue* pStyle,
IFDE_CSSValue* pWidth,
- FX_BOOL bImportant,
+ bool bImportant,
FDE_CSSPROPERTY eColor,
FDE_CSSPROPERTY eStyle,
FDE_CSSPROPERTY eWidth);
- FX_BOOL ParseContentProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant);
- FX_BOOL ParseCounterProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant);
- FX_BOOL ParseValueListProperty(const FDE_CSSPROPERTYARGS* pArgs,
- const FX_WCHAR* pszValue,
- int32_t iValueLen,
- FX_BOOL bImportant);
- FX_BOOL Add4ValuesProperty(IFX_MemoryAllocator* pStaticStore,
- const CFDE_CSSValueArray& list,
- FX_BOOL bImportant,
- FDE_CSSPROPERTY eLeft,
- FDE_CSSPROPERTY eTop,
- FDE_CSSPROPERTY eRight,
- FDE_CSSPROPERTY eBottom);
+ bool ParseContentProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant);
+ bool ParseCounterProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant);
+ bool ParseValueListProperty(const FDE_CSSPROPERTYARGS* pArgs,
+ const FX_WCHAR* pszValue,
+ int32_t iValueLen,
+ bool bImportant);
+ bool Add4ValuesProperty(IFX_MemoryAllocator* pStaticStore,
+ const CFDE_CSSValueArray& list,
+ bool bImportant,
+ FDE_CSSPROPERTY eLeft,
+ FDE_CSSPROPERTY eTop,
+ FDE_CSSPROPERTY eRight,
+ FDE_CSSPROPERTY eBottom);
IFDE_CSSValue* ParseNumber(const FDE_CSSPROPERTYARGS* pArgs,
const FX_WCHAR* pszValue,
int32_t iValueLen);
@@ -146,7 +145,7 @@ class CFDE_CSSDeclaration : public CFX_Target {
void AddPropertyHolder(IFX_MemoryAllocator* pStaticStore,
FDE_CSSPROPERTY eProperty,
IFDE_CSSValue* pValue,
- FX_BOOL bImportant);
+ bool bImportant);
IFDE_CSSPrimitiveValue* NewNumberValue(IFX_MemoryAllocator* pStaticStore,
FDE_CSSPRIMITIVETYPE eUnit,
FX_FLOAT fValue) const;
diff --git a/xfa/fde/css/fde_cssstyleselector.cpp b/xfa/fde/css/fde_cssstyleselector.cpp
index b68ace8dce..3eef4e4a4a 100644
--- a/xfa/fde/css/fde_cssstyleselector.cpp
+++ b/xfa/fde/css/fde_cssstyleselector.cpp
@@ -34,10 +34,10 @@ void CFDE_CSSCounterStyle::DoUpdateIndex(IFDE_CSSValueList* pList) {
int32_t iCount = pList->CountValues();
FX_FLOAT fDefValue = 1.0;
- FX_BOOL bDefIncrement = TRUE;
+ bool bDefIncrement = true;
if (pList == m_pCounterReset) {
fDefValue = 0.0;
- bDefIncrement = FALSE;
+ bDefIncrement = false;
}
for (int32_t i = 0; i < iCount; i++) {
IFDE_CSSValueList* pCounter =
@@ -56,20 +56,20 @@ void CFDE_CSSCounterStyle::DoUpdateIndex(IFDE_CSSValueList* pList) {
FDE_CSSCOUNTERDATA data;
data.m_pszIdent = pszIdentifier;
if (bDefIncrement) {
- data.m_bIncrement = TRUE;
+ data.m_bIncrement = true;
data.m_iIncVal = (int32_t)fValue;
} else {
data.m_iResetVal = (int32_t)fValue;
- data.m_bReset = TRUE;
+ data.m_bReset = true;
}
m_arrCounterData.Add(data);
} else {
FDE_CSSCOUNTERDATA& data = m_arrCounterData.ElementAt(iIndex);
if (bDefIncrement) {
- data.m_bIncrement = TRUE;
+ data.m_bIncrement = true;
data.m_iIncVal += (int32_t)fValue;
} else {
- data.m_bReset = TRUE;
+ data.m_bReset = true;
data.m_iResetVal = (int32_t)fValue;
}
}
@@ -77,7 +77,7 @@ void CFDE_CSSCounterStyle::DoUpdateIndex(IFDE_CSSValueList* pList) {
}
CFDE_CSSCounterStyle::CFDE_CSSCounterStyle()
- : m_pCounterInc(nullptr), m_pCounterReset(nullptr), m_bIndexDirty(FALSE) {}
+ : m_pCounterInc(nullptr), m_pCounterReset(nullptr), m_bIndexDirty(false) {}
CFDE_CSSCounterStyle::~CFDE_CSSCounterStyle() {}
@@ -88,7 +88,7 @@ void CFDE_CSSCounterStyle::UpdateIndex() {
m_arrCounterData.RemoveAll();
DoUpdateIndex(m_pCounterInc);
DoUpdateIndex(m_pCounterReset);
- m_bIndexDirty = FALSE;
+ m_bIndexDirty = false;
}
FDE_CSSRuleData::FDE_CSSRuleData(CFDE_CSSSelector* pSel,
@@ -148,17 +148,17 @@ IFDE_CSSComputedStyle* CFDE_CSSStyleSelector::CreateComputedStyle(
return pStyle;
}
-FX_BOOL CFDE_CSSStyleSelector::SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType,
- IFDE_CSSStyleSheet* pSheet) {
+bool CFDE_CSSStyleSelector::SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType,
+ IFDE_CSSStyleSheet* pSheet) {
ASSERT(eType < FDE_CSSSTYLESHEETGROUP_MAX);
CFDE_CSSStyleSheetArray& dest = m_SheetGroups[eType];
dest.RemoveAt(0, dest.GetSize());
if (pSheet)
dest.Add(pSheet);
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_CSSStyleSelector::SetStyleSheets(
+bool CFDE_CSSStyleSelector::SetStyleSheets(
FDE_CSSSTYLESHEETGROUP eType,
const CFDE_CSSStyleSheetArray* pArray) {
ASSERT(eType < FDE_CSSSTYLESHEETGROUP_MAX);
@@ -167,7 +167,7 @@ FX_BOOL CFDE_CSSStyleSelector::SetStyleSheets(
dest.Copy(*pArray);
else
dest.RemoveAt(0, dest.GetSize());
- return TRUE;
+ return true;
}
void CFDE_CSSStyleSelector::SetStylePriority(
@@ -247,9 +247,9 @@ void CFDE_CSSStyleSelector::MatchRules(FDE_CSSTagCache* pCache,
}
}
-FX_BOOL CFDE_CSSStyleSelector::MatchSelector(FDE_CSSTagCache* pCache,
- CFDE_CSSSelector* pSel,
- FDE_CSSPERSUDO ePersudoType) {
+bool CFDE_CSSStyleSelector::MatchSelector(FDE_CSSTagCache* pCache,
+ CFDE_CSSSelector* pSel,
+ FDE_CSSPERSUDO ePersudoType) {
uint32_t dwHash;
while (pSel && pCache) {
switch (pSel->GetType()) {
@@ -260,36 +260,36 @@ FX_BOOL CFDE_CSSStyleSelector::MatchSelector(FDE_CSSTagCache* pCache,
continue;
}
if (MatchSelector(pCache, pSel->GetNextSelector(), ePersudoType)) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
case FDE_CSSSELECTORTYPE_ID:
dwHash = pCache->HashID();
if (dwHash != pSel->GetNameHash()) {
- return FALSE;
+ return false;
}
break;
case FDE_CSSSELECTORTYPE_Class:
dwHash = pCache->HashClass();
if (dwHash != pSel->GetNameHash()) {
- return FALSE;
+ return false;
}
break;
case FDE_CSSSELECTORTYPE_Element:
dwHash = pSel->GetNameHash();
if (dwHash != FDE_CSSUNIVERSALHASH && dwHash != pCache->HashTag()) {
- return FALSE;
+ return false;
}
break;
case FDE_CSSSELECTORTYPE_Persudo:
dwHash = FDE_GetCSSPersudoByEnum(ePersudoType)->dwHash;
if (dwHash != pSel->GetNameHash()) {
- return FALSE;
+ return false;
}
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
pSel = pSel->GetNextSelector();
@@ -344,9 +344,9 @@ void CFDE_CSSStyleSelector::ComputeStyle(
FXSYS_memcpy(ppInline, ppDeclArray,
iDeclCount * sizeof(CFDE_CSSDeclaration*));
ppInline[iDeclCount++] = pDecl;
- ApplyDeclarations(TRUE, const_cast<const CFDE_CSSDeclaration**>(ppInline),
+ ApplyDeclarations(true, const_cast<const CFDE_CSSDeclaration**>(ppInline),
iDeclCount, pDestStyle);
- ApplyDeclarations(FALSE,
+ ApplyDeclarations(false,
const_cast<const CFDE_CSSDeclaration**>(ppInline),
iDeclCount, pDestStyle);
return;
@@ -356,20 +356,20 @@ void CFDE_CSSStyleSelector::ComputeStyle(
if (iDeclCount > 0) {
ASSERT(ppDeclArray);
- ApplyDeclarations(TRUE, ppDeclArray, iDeclCount, pDestStyle);
- ApplyDeclarations(FALSE, ppDeclArray, iDeclCount, pDestStyle);
+ ApplyDeclarations(true, ppDeclArray, iDeclCount, pDestStyle);
+ ApplyDeclarations(false, ppDeclArray, iDeclCount, pDestStyle);
}
}
void CFDE_CSSStyleSelector::ApplyDeclarations(
- FX_BOOL bPriority,
+ bool bPriority,
const CFDE_CSSDeclaration** ppDeclArray,
int32_t iDeclCount,
IFDE_CSSComputedStyle* pDestStyle) {
CFDE_CSSComputedStyle* pComputedStyle =
static_cast<CFDE_CSSComputedStyle*>(pDestStyle);
IFDE_CSSValue* pVal;
- FX_BOOL bImportant;
+ bool bImportant;
int32_t i;
if (bPriority) {
IFDE_CSSValue* pLastest = nullptr;
@@ -434,7 +434,7 @@ void CFDE_CSSStyleSelector::AppendInlineStyle(CFDE_CSSDeclaration* pDecl,
int32_t iLen) {
ASSERT(pDecl && psz && iLen > 0);
std::unique_ptr<CFDE_CSSSyntaxParser> pSyntax(new CFDE_CSSSyntaxParser);
- if (!pSyntax->Init(psz, iLen, 32, TRUE))
+ if (!pSyntax->Init(psz, iLen, 32, true))
return;
int32_t iLen2 = 0;
@@ -770,17 +770,17 @@ void CFDE_CSSStyleSelector::ApplyProperty(
switch (pPrimitive->GetEnum()) {
case FDE_CSSPROPERTYVALUE_Transparent:
FDE_CSSINHERITS.m_dwTextEmphasisColor = 0;
- FDE_CSSINHERITS.m_bTextEmphasisColorCurrent = FALSE;
+ FDE_CSSINHERITS.m_bTextEmphasisColorCurrent = false;
break;
case FDE_CSSPROPERTYVALUE_Currentcolor:
- FDE_CSSINHERITS.m_bTextEmphasisColorCurrent = TRUE;
+ FDE_CSSINHERITS.m_bTextEmphasisColorCurrent = true;
break;
default:
break;
}
} else if (eType == FDE_CSSPRIMITIVETYPE_RGB) {
FDE_CSSINHERITS.m_dwTextEmphasisColor = pPrimitive->GetRGBColor();
- FDE_CSSINHERITS.m_bTextEmphasisColorCurrent = FALSE;
+ FDE_CSSINHERITS.m_bTextEmphasisColorCurrent = false;
}
break;
case FDE_CSSPROPERTY_PageBreakBefore:
@@ -831,7 +831,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(
case FDE_CSSPROPERTY_ColumnRuleColor:
if (eType == FDE_CSSPRIMITIVETYPE_RGB) {
FDE_CSSNONINHERITS.m_dwColumnRuleColor = pPrimitive->GetRGBColor();
- FDE_CSSNONINHERITS.m_bColumnRuleColorSame = FALSE;
+ FDE_CSSNONINHERITS.m_bColumnRuleColorSame = false;
}
break;
case FDE_CSSPROPERTY_ColumnRuleStyle:
@@ -960,12 +960,12 @@ void CFDE_CSSStyleSelector::ApplyProperty(
switch (pVal->GetEnum()) {
case FDE_CSSPROPERTYVALUE_None: {
FDE_CSSNONINHERITS.m_eTextCombine = FDE_CSSTEXTCOMBINE_None;
- FDE_CSSNONINHERITS.m_bHasTextCombineNumber = FALSE;
+ FDE_CSSNONINHERITS.m_bHasTextCombineNumber = false;
} break;
case FDE_CSSPROPERTYVALUE_Horizontal: {
FDE_CSSNONINHERITS.m_eTextCombine =
FDE_CSSTEXTCOMBINE_Horizontal;
- FDE_CSSNONINHERITS.m_bHasTextCombineNumber = FALSE;
+ FDE_CSSNONINHERITS.m_bHasTextCombineNumber = false;
} break;
default:
break;
@@ -1011,7 +1011,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(
}
}
} else {
- ASSERT(FALSE);
+ ASSERT(false);
}
}
@@ -1107,45 +1107,43 @@ FDE_CSSRUBYALIGN CFDE_CSSStyleSelector::ToRubyAlign(
}
}
-FX_BOOL CFDE_CSSStyleSelector::ToTextEmphasisMark(
- FDE_CSSPROPERTYVALUE eValue,
- FDE_CSSTEXTEMPHASISMARK& eMark) {
+bool CFDE_CSSStyleSelector::ToTextEmphasisMark(FDE_CSSPROPERTYVALUE eValue,
+ FDE_CSSTEXTEMPHASISMARK& eMark) {
switch (eValue) {
case FDE_CSSPROPERTYVALUE_None:
eMark = FDE_CSSTEXTEMPHASISMARK_None;
- return TRUE;
+ return true;
case FDE_CSSPROPERTYVALUE_Dot:
eMark = FDE_CSSTEXTEMPHASISMARK_Dot;
- return TRUE;
+ return true;
case FDE_CSSPROPERTYVALUE_Circle:
eMark = FDE_CSSTEXTEMPHASISMARK_Circle;
- return TRUE;
+ return true;
case FDE_CSSPROPERTYVALUE_DoubleCircle:
eMark = FDE_CSSTEXTEMPHASISMARK_DoubleCircle;
- return TRUE;
+ return true;
case FDE_CSSPROPERTYVALUE_Triangle:
eMark = FDE_CSSTEXTEMPHASISMARK_Triangle;
- return TRUE;
+ return true;
case FDE_CSSPROPERTYVALUE_Sesame:
eMark = FDE_CSSTEXTEMPHASISMARK_Sesame;
- return TRUE;
+ return true;
default:
- return FALSE;
+ return false;
}
}
-FX_BOOL CFDE_CSSStyleSelector::ToTextEmphasisFill(
- FDE_CSSPROPERTYVALUE eValue,
- FDE_CSSTEXTEMPHASISFILL& eFill) {
+bool CFDE_CSSStyleSelector::ToTextEmphasisFill(FDE_CSSPROPERTYVALUE eValue,
+ FDE_CSSTEXTEMPHASISFILL& eFill) {
switch (eValue) {
case FDE_CSSPROPERTYVALUE_Filled:
eFill = FDE_CSSTEXTEMPHASISFILL_Filled;
- return TRUE;
+ return true;
case FDE_CSSPROPERTYVALUE_Open:
eFill = FDE_CSSTEXTEMPHASISFILL_Open;
- return TRUE;
+ return true;
default:
- return FALSE;
+ return false;
}
}
@@ -1482,7 +1480,7 @@ FDE_CSSBORDERSTYLE CFDE_CSSStyleSelector::ToBorderStyle(
}
}
-FX_BOOL CFDE_CSSStyleSelector::SetLengthWithPercent(
+bool CFDE_CSSStyleSelector::SetLengthWithPercent(
FDE_CSSLENGTH& width,
FDE_CSSPRIMITIVETYPE eType,
IFDE_CSSPrimitiveValue* pPrimitive,
@@ -1499,24 +1497,24 @@ FX_BOOL CFDE_CSSStyleSelector::SetLengthWithPercent(
switch (pPrimitive->GetEnum()) {
case FDE_CSSPROPERTYVALUE_Auto:
width.Set(FDE_CSSLENGTHUNIT_Auto);
- return TRUE;
+ return true;
case FDE_CSSPROPERTYVALUE_None:
width.Set(FDE_CSSLENGTHUNIT_None);
- return TRUE;
+ return true;
case FDE_CSSPROPERTYVALUE_Thin:
width.Set(FDE_CSSLENGTHUNIT_Point, 2);
- return TRUE;
+ return true;
case FDE_CSSPROPERTYVALUE_Medium:
width.Set(FDE_CSSLENGTHUNIT_Point, 3);
- return TRUE;
+ return true;
case FDE_CSSPROPERTYVALUE_Thick:
width.Set(FDE_CSSLENGTHUNIT_Point, 4);
- return TRUE;
+ return true;
default:
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
FX_FLOAT CFDE_CSSStyleSelector::ToFontSize(FDE_CSSPROPERTYVALUE eValue,
@@ -1749,15 +1747,15 @@ IFDE_CSSParagraphStyle* CFDE_CSSComputedStyle::GetParagraphStyles() {
return static_cast<IFDE_CSSParagraphStyle*>(this);
}
-FX_BOOL CFDE_CSSComputedStyle::GetCustomStyle(const CFX_WideStringC& wsName,
- CFX_WideString& wsValue) const {
+bool CFDE_CSSComputedStyle::GetCustomStyle(const CFX_WideStringC& wsName,
+ CFX_WideString& wsValue) const {
for (int32_t i = m_CustomProperties.GetSize() - 2; i > -1; i -= 2) {
if (wsName == m_CustomProperties[i]) {
wsValue = m_CustomProperties[i + 1];
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
int32_t CFDE_CSSComputedStyle::CountFontFamilies() const {
@@ -1829,12 +1827,12 @@ const FDE_CSSRECT* CFDE_CSSComputedStyle::GetPaddingWidth() const {
void CFDE_CSSComputedStyle::SetMarginWidth(const FDE_CSSRECT& rect) {
m_NonInheritedData.m_MarginWidth = rect;
- m_NonInheritedData.m_bHasMargin = TRUE;
+ m_NonInheritedData.m_bHasMargin = true;
}
void CFDE_CSSComputedStyle::SetPaddingWidth(const FDE_CSSRECT& rect) {
m_NonInheritedData.m_PaddingWidth = rect;
- m_NonInheritedData.m_bHasPadding = TRUE;
+ m_NonInheritedData.m_bHasPadding = true;
}
FDE_CSSDISPLAY CFDE_CSSComputedStyle::GetDisplay() const {
@@ -1915,7 +1913,7 @@ void CFDE_CSSInheritedData::Reset() {
m_wFontWeight = 400;
m_dwFontColor = 0xFF000000;
m_iWidows = 2;
- m_bTextEmphasisColorCurrent = TRUE;
+ m_bTextEmphasisColorCurrent = true;
m_iOrphans = 2;
}
@@ -1934,7 +1932,7 @@ void CFDE_CSSNonInheritedData::Reset() {
m_fVerticalAlign = 0.0f;
m_ColumnCount.Set(FDE_CSSLENGTHUNIT_Auto);
m_ColumnGap.Set(FDE_CSSLENGTHUNIT_Normal);
- m_bColumnRuleColorSame = TRUE;
+ m_bColumnRuleColorSame = true;
m_ColumnWidth.Set(FDE_CSSLENGTHUNIT_Auto);
m_ColumnRuleWidth.Set(FDE_CSSLENGTHUNIT_Auto);
m_eTextCombine = FDE_CSSTEXTCOMBINE_None;
diff --git a/xfa/fde/css/fde_cssstyleselector.h b/xfa/fde/css/fde_cssstyleselector.h
index ba2037677e..d72c9bf0cd 100644
--- a/xfa/fde/css/fde_cssstyleselector.h
+++ b/xfa/fde/css/fde_cssstyleselector.h
@@ -75,7 +75,7 @@ class CFDE_CSSRuleCollection : public CFX_Target {
uint32_t dwKey,
CFDE_CSSSelector* pSel,
CFDE_CSSDeclaration* pDecl);
- FX_BOOL AddRuleTo(FDE_CSSRuleData*& pList, FDE_CSSRuleData* pData);
+ bool AddRuleTo(FDE_CSSRuleData*& pList, FDE_CSSRuleData* pData);
FDE_CSSRuleData* NewRuleData(CFDE_CSSSelector* pSel,
CFDE_CSSDeclaration* pDecl);
CFX_MapPtrToPtr m_IDRules;
@@ -93,10 +93,9 @@ class CFDE_CSSStyleSelector : public CFX_Target {
void SetDefFontSize(FX_FLOAT fFontSize);
- FX_BOOL SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType,
- IFDE_CSSStyleSheet* pSheet);
- FX_BOOL SetStyleSheets(FDE_CSSSTYLESHEETGROUP eType,
- const CFDE_CSSStyleSheetArray* pArray);
+ bool SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType, IFDE_CSSStyleSheet* pSheet);
+ bool SetStyleSheets(FDE_CSSSTYLESHEETGROUP eType,
+ const CFDE_CSSStyleSheetArray* pArray);
void SetStylePriority(FDE_CSSSTYLESHEETGROUP eType,
FDE_CSSSTYLESHEETPRIORITY ePriority);
void UpdateStyleIndex(uint32_t dwMediaList);
@@ -116,13 +115,13 @@ class CFDE_CSSStyleSelector : public CFX_Target {
void MatchRules(FDE_CSSTagCache* pCache,
FDE_CSSRuleData* pList,
FDE_CSSPERSUDO ePersudoType);
- FX_BOOL MatchSelector(FDE_CSSTagCache* pCache,
- CFDE_CSSSelector* pSel,
- FDE_CSSPERSUDO ePersudoType);
+ bool MatchSelector(FDE_CSSTagCache* pCache,
+ CFDE_CSSSelector* pSel,
+ FDE_CSSPERSUDO ePersudoType);
void AppendInlineStyle(CFDE_CSSDeclaration* pDecl,
const FX_WCHAR* psz,
int32_t iLen);
- void ApplyDeclarations(FX_BOOL bPriority,
+ void ApplyDeclarations(bool bPriority,
const CFDE_CSSDeclaration** ppDeclArray,
int32_t iDeclCount,
IFDE_CSSComputedStyle* pDestStyle);
@@ -133,10 +132,10 @@ class CFDE_CSSStyleSelector : public CFX_Target {
FX_FLOAT ApplyNumber(FDE_CSSPRIMITIVETYPE eUnit,
FX_FLOAT fValue,
FX_FLOAT fPercentBase);
- FX_BOOL SetLengthWithPercent(FDE_CSSLENGTH& width,
- FDE_CSSPRIMITIVETYPE eType,
- IFDE_CSSPrimitiveValue* pPrimitive,
- FX_FLOAT fFontSize);
+ bool SetLengthWithPercent(FDE_CSSLENGTH& width,
+ FDE_CSSPRIMITIVETYPE eType,
+ IFDE_CSSPrimitiveValue* pPrimitive,
+ FX_FLOAT fFontSize);
FX_FLOAT ToFontSize(FDE_CSSPROPERTYVALUE eValue, FX_FLOAT fCurFontSize);
FDE_CSSDISPLAY ToDisplay(FDE_CSSPROPERTYVALUE eValue);
FDE_CSSTEXTALIGN ToTextAlign(FDE_CSSPROPERTYVALUE eValue);
@@ -159,10 +158,10 @@ class CFDE_CSSStyleSelector : public CFX_Target {
FDE_CSSOVERFLOW ToOverflow(FDE_CSSPROPERTYVALUE eValue);
FDE_CSSLINEBREAK ToLineBreak(FDE_CSSPROPERTYVALUE eValue);
FDE_CSSTEXTCOMBINE ToTextCombine(FDE_CSSPROPERTYVALUE eValue);
- FX_BOOL ToTextEmphasisMark(FDE_CSSPROPERTYVALUE eValue,
- FDE_CSSTEXTEMPHASISMARK& eMark);
- FX_BOOL ToTextEmphasisFill(FDE_CSSPROPERTYVALUE eValue,
- FDE_CSSTEXTEMPHASISFILL& eFill);
+ bool ToTextEmphasisMark(FDE_CSSPROPERTYVALUE eValue,
+ FDE_CSSTEXTEMPHASISMARK& eMark);
+ bool ToTextEmphasisFill(FDE_CSSPROPERTYVALUE eValue,
+ FDE_CSSTEXTEMPHASISFILL& eFill);
FDE_CSSCURSOR ToCursor(FDE_CSSPROPERTYVALUE eValue);
FDE_CSSPOSITION ToPosition(FDE_CSSPROPERTYVALUE eValue);
FDE_CSSCAPTIONSIDE ToCaptionSide(FDE_CSSPROPERTYVALUE eValue);
@@ -188,18 +187,18 @@ class CFDE_CSSStyleSelector : public CFX_Target {
struct FDE_CSSCOUNTERDATA {
public:
FDE_CSSCOUNTERDATA() { FXSYS_memset(this, 0, sizeof(FDE_CSSCOUNTERDATA)); }
- FX_BOOL GetCounterIncrement(int32_t& iValue) {
+ bool GetCounterIncrement(int32_t& iValue) {
iValue = m_iIncVal;
return m_bIncrement;
}
- FX_BOOL GetCounterReset(int32_t& iValue) {
+ bool GetCounterReset(int32_t& iValue) {
iValue = m_iResetVal;
return m_bReset;
}
const FX_WCHAR* m_pszIdent;
- FX_BOOL m_bIncrement;
- FX_BOOL m_bReset;
+ bool m_bIncrement;
+ bool m_bReset;
int32_t m_iIncVal;
int32_t m_iResetVal;
};
@@ -211,21 +210,21 @@ class CFDE_CSSCounterStyle {
void SetCounterIncrementList(IFDE_CSSValueList* pList) {
m_pCounterInc = pList;
- m_bIndexDirty = TRUE;
+ m_bIndexDirty = true;
}
void SetCounterResetList(IFDE_CSSValueList* pList) {
m_pCounterReset = pList;
- m_bIndexDirty = TRUE;
+ m_bIndexDirty = true;
}
int32_t CountCounters() {
UpdateIndex();
return m_arrCounterData.GetSize();
}
- FX_BOOL GetCounterIncrement(int32_t index, int32_t& iValue) {
+ bool GetCounterIncrement(int32_t index, int32_t& iValue) {
UpdateIndex();
return m_arrCounterData.ElementAt(index).GetCounterIncrement(iValue);
}
- FX_BOOL GetCounterReset(int32_t index, int32_t& iValue) {
+ bool GetCounterReset(int32_t index, int32_t& iValue) {
UpdateIndex();
return m_arrCounterData.ElementAt(index).GetCounterReset(iValue);
}
@@ -242,7 +241,7 @@ class CFDE_CSSCounterStyle {
IFDE_CSSValueList* m_pCounterInc;
IFDE_CSSValueList* m_pCounterReset;
CFX_ArrayTemplate<FDE_CSSCOUNTERDATA> m_arrCounterData;
- FX_BOOL m_bIndexDirty;
+ bool m_bIndexDirty;
};
class CFDE_CSSInheritedData {
@@ -367,8 +366,8 @@ class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle,
IFDE_CSSBoundaryStyle* GetBoundaryStyles() override;
IFDE_CSSPositionStyle* GetPositionStyles() override;
IFDE_CSSParagraphStyle* GetParagraphStyles() override;
- FX_BOOL GetCustomStyle(const CFX_WideStringC& wsName,
- CFX_WideString& wsValue) const override;
+ bool GetCustomStyle(const CFX_WideStringC& wsName,
+ CFX_WideString& wsValue) const override;
// IFDE_CSSFontStyle:
int32_t CountFontFamilies() const override;
diff --git a/xfa/fde/css/fde_cssstylesheet.cpp b/xfa/fde/css/fde_cssstylesheet.cpp
index bc94cc2f70..e376aca399 100644
--- a/xfa/fde/css/fde_cssstylesheet.cpp
+++ b/xfa/fde/css/fde_cssstylesheet.cpp
@@ -100,11 +100,11 @@ void CFDE_CSSStyleSheet::Reset() {
static_cast<CFDE_CSSFontFaceRule*>(pRule)->~CFDE_CSSFontFaceRule();
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
}
- m_RuleArray.RemoveAll(FALSE);
+ m_RuleArray.RemoveAll(false);
m_Selectors.RemoveAll();
m_StringCache.clear();
m_pAllocator.reset();
@@ -122,7 +122,7 @@ uint32_t CFDE_CSSStyleSheet::Release() {
return dwRefCount;
}
-FX_BOOL CFDE_CSSStyleSheet::GetUrl(CFX_WideString& szUrl) {
+bool CFDE_CSSStyleSheet::GetUrl(CFX_WideString& szUrl) {
szUrl = m_szUrl;
return szUrl.GetLength() > 0;
}
@@ -143,33 +143,32 @@ IFDE_CSSRule* CFDE_CSSStyleSheet::GetRule(int32_t index) {
return m_RuleArray.GetAt(index);
}
-FX_BOOL CFDE_CSSStyleSheet::LoadFromStream(const CFX_WideString& szUrl,
- IFX_Stream* pStream,
- uint16_t wCodePage) {
+bool CFDE_CSSStyleSheet::LoadFromStream(const CFX_WideString& szUrl,
+ IFX_Stream* pStream,
+ uint16_t wCodePage) {
std::unique_ptr<CFDE_CSSSyntaxParser> pSyntax(new CFDE_CSSSyntaxParser);
if (pStream->GetCodePage() != wCodePage)
pStream->SetCodePage(wCodePage);
- FX_BOOL bRet = pSyntax->Init(pStream, 4096) && LoadFromSyntax(pSyntax.get());
+ bool bRet = pSyntax->Init(pStream, 4096) && LoadFromSyntax(pSyntax.get());
m_wCodePage = wCodePage;
m_szUrl = szUrl;
return bRet;
}
-FX_BOOL CFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString& szUrl,
- const FX_WCHAR* pBuffer,
- int32_t iBufSize,
- uint16_t wCodePage) {
+bool CFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString& szUrl,
+ const FX_WCHAR* pBuffer,
+ int32_t iBufSize,
+ uint16_t wCodePage) {
ASSERT(pBuffer && iBufSize > 0);
std::unique_ptr<CFDE_CSSSyntaxParser> pSyntax(new CFDE_CSSSyntaxParser);
- FX_BOOL bRet =
- pSyntax->Init(pBuffer, iBufSize) && LoadFromSyntax(pSyntax.get());
+ bool bRet = pSyntax->Init(pBuffer, iBufSize) && LoadFromSyntax(pSyntax.get());
m_wCodePage = wCodePage;
m_szUrl = szUrl;
return bRet;
}
-FX_BOOL CFDE_CSSStyleSheet::LoadFromSyntax(CFDE_CSSSyntaxParser* pSyntax) {
+bool CFDE_CSSStyleSheet::LoadFromSyntax(CFDE_CSSSyntaxParser* pSyntax) {
Reset();
m_pAllocator = IFX_MemoryAllocator::Create(FX_ALLOCTYPE_Static, 1024, 0);
FDE_CSSSYNTAXSTATUS eStatus;
@@ -415,7 +414,7 @@ CFDE_CSSMediaRule::~CFDE_CSSMediaRule() {
((CFDE_CSSStyleRule*)pRule)->~CFDE_CSSStyleRule();
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
}
@@ -433,7 +432,7 @@ IFDE_CSSRule* CFDE_CSSMediaRule::GetRule(int32_t index) {
return m_RuleArray.GetAt(index);
}
-FX_BOOL FDE_IsCSSChar(FX_WCHAR wch) {
+bool FDE_IsCSSChar(FX_WCHAR wch) {
return (wch >= 'a' && wch <= 'z') || (wch >= 'A' && wch <= 'Z');
}
diff --git a/xfa/fde/css/fde_cssstylesheet.h b/xfa/fde/css/fde_cssstylesheet.h
index cd587ddcae..0fe63477d3 100644
--- a/xfa/fde/css/fde_cssstylesheet.h
+++ b/xfa/fde/css/fde_cssstylesheet.h
@@ -104,23 +104,23 @@ class CFDE_CSSStyleSheet : public IFDE_CSSStyleSheet, public CFX_Target {
uint32_t Release() override;
// IFDE_CSSStyleSheet:
- FX_BOOL GetUrl(CFX_WideString& szUrl) override;
+ bool GetUrl(CFX_WideString& szUrl) override;
uint32_t GetMediaList() const override;
uint16_t GetCodePage() const override;
int32_t CountRules() const override;
IFDE_CSSRule* GetRule(int32_t index) override;
- FX_BOOL LoadFromStream(const CFX_WideString& szUrl,
- IFX_Stream* pStream,
- uint16_t wCodePage);
- FX_BOOL LoadFromBuffer(const CFX_WideString& szUrl,
- const FX_WCHAR* pBuffer,
- int32_t iBufSize,
- uint16_t wCodePage);
+ bool LoadFromStream(const CFX_WideString& szUrl,
+ IFX_Stream* pStream,
+ uint16_t wCodePage);
+ bool LoadFromBuffer(const CFX_WideString& szUrl,
+ const FX_WCHAR* pBuffer,
+ int32_t iBufSize,
+ uint16_t wCodePage);
protected:
void Reset();
- FX_BOOL LoadFromSyntax(CFDE_CSSSyntaxParser* pSyntax);
+ bool LoadFromSyntax(CFDE_CSSSyntaxParser* pSyntax);
FDE_CSSSYNTAXSTATUS LoadStyleRule(
CFDE_CSSSyntaxParser* pSyntax,
CFX_MassArrayTemplate<IFDE_CSSRule*>& ruleArray);
diff --git a/xfa/fde/css/fde_csssyntax.cpp b/xfa/fde/css/fde_csssyntax.cpp
index c2b0265a6e..436a94b67b 100644
--- a/xfa/fde/css/fde_csssyntax.cpp
+++ b/xfa/fde/css/fde_csssyntax.cpp
@@ -33,33 +33,33 @@ CFDE_CSSSyntaxParser::~CFDE_CSSSyntaxParser() {
m_TextPlane.Reset();
}
-FX_BOOL CFDE_CSSSyntaxParser::Init(IFX_Stream* pStream,
- int32_t iCSSPlaneSize,
- int32_t iTextDataSize,
- FX_BOOL bOnlyDeclaration) {
+bool CFDE_CSSSyntaxParser::Init(IFX_Stream* pStream,
+ int32_t iCSSPlaneSize,
+ int32_t iTextDataSize,
+ bool bOnlyDeclaration) {
ASSERT(pStream && iCSSPlaneSize > 0 && iTextDataSize > 0);
Reset(bOnlyDeclaration);
if (!m_TextData.EstimateSize(iTextDataSize)) {
- return FALSE;
+ return false;
}
uint8_t bom[4];
m_pStream = pStream;
m_iStreamPos = m_pStream->GetBOM(bom);
m_iPlaneSize = iCSSPlaneSize;
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_CSSSyntaxParser::Init(const FX_WCHAR* pBuffer,
- int32_t iBufferSize,
- int32_t iTextDatSize,
- FX_BOOL bOnlyDeclaration) {
+bool CFDE_CSSSyntaxParser::Init(const FX_WCHAR* pBuffer,
+ int32_t iBufferSize,
+ int32_t iTextDatSize,
+ bool bOnlyDeclaration) {
ASSERT(pBuffer && iBufferSize > 0 && iTextDatSize > 0);
Reset(bOnlyDeclaration);
if (!m_TextData.EstimateSize(iTextDatSize)) {
- return FALSE;
+ return false;
}
return m_TextPlane.AttachBuffer(pBuffer, iBufferSize);
}
-void CFDE_CSSSyntaxParser::Reset(FX_BOOL bOnlyDeclaration) {
+void CFDE_CSSSyntaxParser::Reset(bool bOnlyDeclaration) {
m_TextPlane.Reset();
m_TextData.Reset();
m_pStream = nullptr;
@@ -81,7 +81,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSSyntaxParser::DoSyntaxParse() {
}
return m_eStatus = FDE_CSSSYNTAXSTATUS_EOS;
}
- FX_BOOL bEOS;
+ bool bEOS;
int32_t iLen = m_TextPlane.LoadFromStream(m_pStream, m_iStreamPos,
m_iPlaneSize, bEOS);
m_iStreamPos = m_pStream->GetPosition();
@@ -251,7 +251,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSSyntaxParser::DoSyntaxParse() {
return FDE_CSSSYNTAXSTATUS_MediaType;
}
} else {
- FX_BOOL bEnabled = IsImportEnabled();
+ bool bEnabled = IsImportEnabled();
m_TextPlane.MoveNext();
m_ModeStack.Pop();
SwitchMode(FDE_CSSSYNTAXMODE_RuleSet);
@@ -354,29 +354,29 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSSyntaxParser::DoSyntaxParse() {
m_TextPlane.MoveNext();
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
}
}
return m_eStatus;
}
-FX_BOOL CFDE_CSSSyntaxParser::IsImportEnabled() const {
+bool CFDE_CSSSyntaxParser::IsImportEnabled() const {
if ((m_dwCheck & FDE_CSSSYNTAXCHECK_AllowImport) == 0) {
- return FALSE;
+ return false;
}
if (m_ModeStack.GetSize() > 1) {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_CSSSyntaxParser::AppendChar(FX_WCHAR wch) {
+bool CFDE_CSSSyntaxParser::AppendChar(FX_WCHAR wch) {
m_TextPlane.MoveNext();
if (m_TextData.GetLength() > 0 || wch > ' ') {
m_TextData.AppendChar(wch);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
int32_t CFDE_CSSSyntaxParser::SaveTextData() {
m_iTextDatLen = m_TextData.TrimEnd();
@@ -393,21 +393,21 @@ int32_t CFDE_CSSSyntaxParser::SwitchToComment() {
SwitchMode(FDE_CSSSYNTAXMODE_Comment);
return iLength;
}
-FX_BOOL CFDE_CSSSyntaxParser::RestoreMode() {
+bool CFDE_CSSSyntaxParser::RestoreMode() {
FDE_CSSSYNTAXMODE* pMode = m_ModeStack.GetTopElement();
if (!pMode)
- return FALSE;
+ return false;
SwitchMode(*pMode);
m_ModeStack.Pop();
- return TRUE;
+ return true;
}
const FX_WCHAR* CFDE_CSSSyntaxParser::GetCurrentString(int32_t& iLength) const {
iLength = m_iTextDatLen;
return m_TextData.GetBuffer();
}
CFDE_CSSTextBuf::CFDE_CSSTextBuf()
- : m_bExtBuf(FALSE),
+ : m_bExtBuf(false),
m_pBuffer(nullptr),
m_iBufLen(0),
m_iDatLen(0),
@@ -422,26 +422,25 @@ void CFDE_CSSTextBuf::Reset() {
}
m_iDatPos = m_iDatLen = m_iBufLen;
}
-FX_BOOL CFDE_CSSTextBuf::AttachBuffer(const FX_WCHAR* pBuffer,
- int32_t iBufLen) {
+bool CFDE_CSSTextBuf::AttachBuffer(const FX_WCHAR* pBuffer, int32_t iBufLen) {
Reset();
m_pBuffer = const_cast<FX_WCHAR*>(pBuffer);
m_iDatLen = m_iBufLen = iBufLen;
- return m_bExtBuf = TRUE;
+ return m_bExtBuf = true;
}
-FX_BOOL CFDE_CSSTextBuf::EstimateSize(int32_t iAllocSize) {
+bool CFDE_CSSTextBuf::EstimateSize(int32_t iAllocSize) {
ASSERT(iAllocSize > 0);
Clear();
- m_bExtBuf = FALSE;
+ m_bExtBuf = false;
return ExpandBuf(iAllocSize);
}
int32_t CFDE_CSSTextBuf::LoadFromStream(IFX_Stream* pTxtStream,
int32_t iStreamOffset,
int32_t iMaxChars,
- FX_BOOL& bEOS) {
+ bool& bEOS) {
ASSERT(iStreamOffset >= 0 && iMaxChars > 0);
Clear();
- m_bExtBuf = FALSE;
+ m_bExtBuf = false;
if (!ExpandBuf(iMaxChars)) {
return 0;
}
@@ -451,23 +450,23 @@ int32_t CFDE_CSSTextBuf::LoadFromStream(IFX_Stream* pTxtStream,
m_iDatLen = pTxtStream->ReadString(m_pBuffer, iMaxChars, bEOS);
return m_iDatLen;
}
-FX_BOOL CFDE_CSSTextBuf::ExpandBuf(int32_t iDesiredSize) {
+bool CFDE_CSSTextBuf::ExpandBuf(int32_t iDesiredSize) {
if (m_bExtBuf) {
- return FALSE;
+ return false;
}
if (!m_pBuffer) {
m_pBuffer = FX_Alloc(FX_WCHAR, iDesiredSize);
} else if (m_iBufLen != iDesiredSize) {
m_pBuffer = FX_Realloc(FX_WCHAR, m_pBuffer, iDesiredSize);
} else {
- return TRUE;
+ return true;
}
if (!m_pBuffer) {
m_iBufLen = 0;
- return FALSE;
+ return false;
}
m_iBufLen = iDesiredSize;
- return TRUE;
+ return true;
}
void CFDE_CSSTextBuf::Subtract(int32_t iStart, int32_t iLength) {
ASSERT(iStart >= 0 && iLength > 0);
diff --git a/xfa/fde/css/fde_csssyntax.h b/xfa/fde/css/fde_csssyntax.h
index af1d444144..c2c80c5e67 100644
--- a/xfa/fde/css/fde_csssyntax.h
+++ b/xfa/fde/css/fde_csssyntax.h
@@ -16,12 +16,12 @@ class CFDE_CSSTextBuf : public CFX_Target {
CFDE_CSSTextBuf();
~CFDE_CSSTextBuf() override;
- FX_BOOL AttachBuffer(const FX_WCHAR* pBuffer, int32_t iBufLen);
- FX_BOOL EstimateSize(int32_t iAllocSize);
+ bool AttachBuffer(const FX_WCHAR* pBuffer, int32_t iBufLen);
+ bool EstimateSize(int32_t iAllocSize);
int32_t LoadFromStream(IFX_Stream* pTxtStream,
int32_t iStreamOffset,
int32_t iMaxChars,
- FX_BOOL& bEOS);
+ bool& bEOS);
bool AppendChar(FX_WCHAR wch) {
if (m_iDatLen >= m_iBufLen && !ExpandBuf(m_iBufLen * 2))
return false;
@@ -38,7 +38,7 @@ class CFDE_CSSTextBuf : public CFX_Target {
return --m_iDatLen;
}
void Subtract(int32_t iStart, int32_t iLength);
- FX_BOOL IsEOF() const { return m_iDatPos >= m_iDatLen; }
+ bool IsEOF() const { return m_iDatPos >= m_iDatLen; }
FX_WCHAR GetAt(int32_t index) const { return m_pBuffer[index]; }
FX_WCHAR GetChar() const { return m_pBuffer[m_iDatPos]; }
FX_WCHAR GetNextChar() const {
@@ -49,8 +49,8 @@ class CFDE_CSSTextBuf : public CFX_Target {
const FX_WCHAR* GetBuffer() const { return m_pBuffer; }
protected:
- FX_BOOL ExpandBuf(int32_t iDesiredSize);
- FX_BOOL m_bExtBuf;
+ bool ExpandBuf(int32_t iDesiredSize);
+ bool m_bExtBuf;
FX_WCHAR* m_pBuffer;
int32_t m_iBufLen;
int32_t m_iDatLen;
@@ -80,30 +80,30 @@ class CFDE_CSSSyntaxParser : public CFX_Target {
CFDE_CSSSyntaxParser();
~CFDE_CSSSyntaxParser() override;
- FX_BOOL Init(IFX_Stream* pStream,
- int32_t iCSSPlaneSize,
- int32_t iTextDataSize = 32,
- FX_BOOL bOnlyDeclaration = FALSE);
- FX_BOOL Init(const FX_WCHAR* pBuffer,
- int32_t iBufferSize,
- int32_t iTextDatSize = 32,
- FX_BOOL bOnlyDeclaration = FALSE);
+ bool Init(IFX_Stream* pStream,
+ int32_t iCSSPlaneSize,
+ int32_t iTextDataSize = 32,
+ bool bOnlyDeclaration = false);
+ bool Init(const FX_WCHAR* pBuffer,
+ int32_t iBufferSize,
+ int32_t iTextDatSize = 32,
+ bool bOnlyDeclaration = false);
FDE_CSSSYNTAXSTATUS DoSyntaxParse();
const FX_WCHAR* GetCurrentString(int32_t& iLength) const;
protected:
- void Reset(FX_BOOL bOnlyDeclaration);
+ void Reset(bool bOnlyDeclaration);
void SwitchMode(FDE_CSSSYNTAXMODE eMode);
int32_t SwitchToComment();
- FX_BOOL RestoreMode();
- FX_BOOL AppendChar(FX_WCHAR wch);
+ bool RestoreMode();
+ bool AppendChar(FX_WCHAR wch);
int32_t SaveTextData();
- FX_BOOL IsCharsetEnabled() const {
+ bool IsCharsetEnabled() const {
return (m_dwCheck & FDE_CSSSYNTAXCHECK_AllowCharset) != 0;
}
void DisableCharset() { m_dwCheck = FDE_CSSSYNTAXCHECK_AllowImport; }
- FX_BOOL IsImportEnabled() const;
+ bool IsImportEnabled() const;
void DisableImport() { m_dwCheck = 0; }
IFX_Stream* m_pStream;
diff --git a/xfa/fde/fde_gedevice.cpp b/xfa/fde/fde_gedevice.cpp
index 076e70dedf..314d17cdc1 100644
--- a/xfa/fde/fde_gedevice.cpp
+++ b/xfa/fde/fde_gedevice.cpp
@@ -18,10 +18,8 @@
#include "xfa/fgas/font/fgas_gefont.h"
CFDE_RenderDevice::CFDE_RenderDevice(CFX_RenderDevice* pDevice,
- FX_BOOL bOwnerDevice)
- : m_pDevice(pDevice),
- m_bOwnerDevice(bOwnerDevice),
- m_iCharCount(0) {
+ bool bOwnerDevice)
+ : m_pDevice(pDevice), m_bOwnerDevice(bOwnerDevice), m_iCharCount(0) {
ASSERT(pDevice);
FX_RECT rt = m_pDevice->GetClipBox();
@@ -48,7 +46,7 @@ void CFDE_RenderDevice::RestoreState() {
m_rtClip.Set((FX_FLOAT)rt.left, (FX_FLOAT)rt.top, (FX_FLOAT)rt.Width(),
(FX_FLOAT)rt.Height());
}
-FX_BOOL CFDE_RenderDevice::SetClipRect(const CFX_RectF& rtClip) {
+bool CFDE_RenderDevice::SetClipRect(const CFX_RectF& rtClip) {
m_rtClip = rtClip;
return m_pDevice->SetClip_Rect(FX_RECT((int32_t)FXSYS_floor(rtClip.left),
(int32_t)FXSYS_floor(rtClip.top),
@@ -58,8 +56,8 @@ FX_BOOL CFDE_RenderDevice::SetClipRect(const CFX_RectF& rtClip) {
const CFX_RectF& CFDE_RenderDevice::GetClipRect() {
return m_rtClip;
}
-FX_BOOL CFDE_RenderDevice::SetClipPath(const CFDE_Path* pClip) {
- return FALSE;
+bool CFDE_RenderDevice::SetClipPath(const CFDE_Path* pClip) {
+ return false;
}
CFDE_Path* CFDE_RenderDevice::GetClipPath() const {
return nullptr;
@@ -70,11 +68,11 @@ FX_FLOAT CFDE_RenderDevice::GetDpiX() const {
FX_FLOAT CFDE_RenderDevice::GetDpiY() const {
return 96;
}
-FX_BOOL CFDE_RenderDevice::DrawImage(CFX_DIBSource* pDib,
- const CFX_RectF* pSrcRect,
- const CFX_RectF& dstRect,
- const CFX_Matrix* pImgMatrix,
- const CFX_Matrix* pDevMatrix) {
+bool CFDE_RenderDevice::DrawImage(CFX_DIBSource* pDib,
+ const CFX_RectF* pSrcRect,
+ const CFX_RectF& dstRect,
+ const CFX_Matrix* pImgMatrix,
+ const CFX_Matrix* pDevMatrix) {
CFX_RectF srcRect;
if (pSrcRect) {
srcRect = *pSrcRect;
@@ -82,7 +80,7 @@ FX_BOOL CFDE_RenderDevice::DrawImage(CFX_DIBSource* pDib,
srcRect.Set(0, 0, (FX_FLOAT)pDib->GetWidth(), (FX_FLOAT)pDib->GetHeight());
}
if (srcRect.IsEmpty()) {
- return FALSE;
+ return false;
}
CFX_Matrix dib2fxdev;
if (pImgMatrix) {
@@ -105,12 +103,12 @@ FX_BOOL CFDE_RenderDevice::DrawImage(CFX_DIBSource* pDib,
m_pDevice->CancelDIBits(handle);
return !!handle;
}
-FX_BOOL CFDE_RenderDevice::DrawString(CFDE_Brush* pBrush,
- CFGAS_GEFont* pFont,
- const FXTEXT_CHARPOS* pCharPos,
- int32_t iCount,
- FX_FLOAT fFontSize,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::DrawString(CFDE_Brush* pBrush,
+ CFGAS_GEFont* pFont,
+ const FXTEXT_CHARPOS* pCharPos,
+ int32_t iCount,
+ FX_FLOAT fFontSize,
+ const CFX_Matrix* pMatrix) {
ASSERT(pBrush && pFont && pCharPos && iCount > 0);
CFX_Font* pFxFont = pFont->GetDevFont();
FX_ARGB argb = pBrush->GetColor();
@@ -173,7 +171,7 @@ FX_BOOL CFDE_RenderDevice::DrawString(CFDE_Brush* pBrush,
pFxFont = pCurFont->GetDevFont();
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
FxFont.SetFace(pFxFont->GetFace());
- FX_BOOL bRet = m_pDevice->DrawNormalText(
+ bool bRet = m_pDevice->DrawNormalText(
iCurCount, pCurCP, &FxFont, -fFontSize, (const CFX_Matrix*)pMatrix,
argb, FXTEXT_CLEARTYPE);
FxFont.SetFace(nullptr);
@@ -189,16 +187,16 @@ FX_BOOL CFDE_RenderDevice::DrawString(CFDE_Brush* pBrush,
FxFont.SetFace(nullptr);
#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_RenderDevice::DrawBezier(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_PointF& pt1,
- const CFX_PointF& pt2,
- const CFX_PointF& pt3,
- const CFX_PointF& pt4,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::DrawBezier(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFX_PointF& pt1,
+ const CFX_PointF& pt2,
+ const CFX_PointF& pt3,
+ const CFX_PointF& pt4,
+ const CFX_Matrix* pMatrix) {
CFX_PointsF points;
points.Add(pt1);
points.Add(pt2);
@@ -208,123 +206,123 @@ FX_BOOL CFDE_RenderDevice::DrawBezier(CFDE_Pen* pPen,
path.AddBezier(points);
return DrawPath(pPen, fPenWidth, &path, pMatrix);
}
-FX_BOOL CFDE_RenderDevice::DrawCurve(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_PointsF& points,
- FX_BOOL bClosed,
- FX_FLOAT fTension,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::DrawCurve(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFX_PointsF& points,
+ bool bClosed,
+ FX_FLOAT fTension,
+ const CFX_Matrix* pMatrix) {
CFDE_Path path;
path.AddCurve(points, bClosed, fTension);
return DrawPath(pPen, fPenWidth, &path, pMatrix);
}
-FX_BOOL CFDE_RenderDevice::DrawEllipse(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_RectF& rect,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::DrawEllipse(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFX_RectF& rect,
+ const CFX_Matrix* pMatrix) {
CFDE_Path path;
path.AddEllipse(rect);
return DrawPath(pPen, fPenWidth, &path, pMatrix);
}
-FX_BOOL CFDE_RenderDevice::DrawLines(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_PointsF& points,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::DrawLines(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFX_PointsF& points,
+ const CFX_Matrix* pMatrix) {
CFDE_Path path;
path.AddLines(points);
return DrawPath(pPen, fPenWidth, &path, pMatrix);
}
-FX_BOOL CFDE_RenderDevice::DrawLine(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_PointF& pt1,
- const CFX_PointF& pt2,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::DrawLine(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFX_PointF& pt1,
+ const CFX_PointF& pt2,
+ const CFX_Matrix* pMatrix) {
CFDE_Path path;
path.AddLine(pt1, pt2);
return DrawPath(pPen, fPenWidth, &path, pMatrix);
}
-FX_BOOL CFDE_RenderDevice::DrawPath(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFDE_Path* pPath,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::DrawPath(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFDE_Path* pPath,
+ const CFX_Matrix* pMatrix) {
CFDE_Path* pGePath = (CFDE_Path*)pPath;
if (!pGePath)
- return FALSE;
+ return false;
CFX_GraphStateData graphState;
if (!CreatePen(pPen, fPenWidth, graphState)) {
- return FALSE;
+ return false;
}
return m_pDevice->DrawPath(&pGePath->m_Path, (const CFX_Matrix*)pMatrix,
&graphState, 0, pPen->GetColor(), 0);
}
-FX_BOOL CFDE_RenderDevice::DrawPolygon(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_PointsF& points,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::DrawPolygon(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFX_PointsF& points,
+ const CFX_Matrix* pMatrix) {
CFDE_Path path;
path.AddPolygon(points);
return DrawPath(pPen, fPenWidth, &path, pMatrix);
}
-FX_BOOL CFDE_RenderDevice::DrawRectangle(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_RectF& rect,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::DrawRectangle(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFX_RectF& rect,
+ const CFX_Matrix* pMatrix) {
CFDE_Path path;
path.AddRectangle(rect);
return DrawPath(pPen, fPenWidth, &path, pMatrix);
}
-FX_BOOL CFDE_RenderDevice::FillClosedCurve(CFDE_Brush* pBrush,
- const CFX_PointsF& points,
- FX_FLOAT fTension,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::FillClosedCurve(CFDE_Brush* pBrush,
+ const CFX_PointsF& points,
+ FX_FLOAT fTension,
+ const CFX_Matrix* pMatrix) {
CFDE_Path path;
- path.AddCurve(points, TRUE, fTension);
+ path.AddCurve(points, true, fTension);
return FillPath(pBrush, &path, pMatrix);
}
-FX_BOOL CFDE_RenderDevice::FillEllipse(CFDE_Brush* pBrush,
- const CFX_RectF& rect,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::FillEllipse(CFDE_Brush* pBrush,
+ const CFX_RectF& rect,
+ const CFX_Matrix* pMatrix) {
CFDE_Path path;
path.AddEllipse(rect);
return FillPath(pBrush, &path, pMatrix);
}
-FX_BOOL CFDE_RenderDevice::FillPolygon(CFDE_Brush* pBrush,
- const CFX_PointsF& points,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::FillPolygon(CFDE_Brush* pBrush,
+ const CFX_PointsF& points,
+ const CFX_Matrix* pMatrix) {
CFDE_Path path;
path.AddPolygon(points);
return FillPath(pBrush, &path, pMatrix);
}
-FX_BOOL CFDE_RenderDevice::FillRectangle(CFDE_Brush* pBrush,
- const CFX_RectF& rect,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::FillRectangle(CFDE_Brush* pBrush,
+ const CFX_RectF& rect,
+ const CFX_Matrix* pMatrix) {
CFDE_Path path;
path.AddRectangle(rect);
return FillPath(pBrush, &path, pMatrix);
}
-FX_BOOL CFDE_RenderDevice::CreatePen(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- CFX_GraphStateData& graphState) {
+bool CFDE_RenderDevice::CreatePen(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ CFX_GraphStateData& graphState) {
if (!pPen)
- return FALSE;
+ return false;
graphState.m_LineCap = CFX_GraphStateData::LineCapButt;
graphState.m_LineJoin = CFX_GraphStateData::LineJoinMiter;
graphState.m_LineWidth = fPenWidth;
graphState.m_MiterLimit = 10;
graphState.m_DashPhase = 0;
- return TRUE;
+ return true;
}
-FX_BOOL CFDE_RenderDevice::FillPath(CFDE_Brush* pBrush,
- const CFDE_Path* pPath,
- const CFX_Matrix* pMatrix) {
+bool CFDE_RenderDevice::FillPath(CFDE_Brush* pBrush,
+ const CFDE_Path* pPath,
+ const CFX_Matrix* pMatrix) {
CFDE_Path* pGePath = (CFDE_Path*)pPath;
if (!pGePath)
- return FALSE;
+ return false;
if (!pBrush)
- return FALSE;
+ return false;
return m_pDevice->DrawPath(&pGePath->m_Path, pMatrix, nullptr,
pBrush->GetColor(), 0, FXFILL_WINDING);
}
diff --git a/xfa/fde/fde_gedevice.h b/xfa/fde/fde_gedevice.h
index d290f166a8..cb8e3fa42a 100644
--- a/xfa/fde/fde_gedevice.h
+++ b/xfa/fde/fde_gedevice.h
@@ -18,108 +18,108 @@ class CFX_GraphStateData;
class CFDE_RenderDevice : public CFX_Target {
public:
- CFDE_RenderDevice(CFX_RenderDevice* pDevice, FX_BOOL bOwnerDevice);
+ CFDE_RenderDevice(CFX_RenderDevice* pDevice, bool bOwnerDevice);
~CFDE_RenderDevice() override;
int32_t GetWidth() const;
int32_t GetHeight() const;
void SaveState();
void RestoreState();
- FX_BOOL SetClipPath(const CFDE_Path* pClip);
+ bool SetClipPath(const CFDE_Path* pClip);
CFDE_Path* GetClipPath() const;
- FX_BOOL SetClipRect(const CFX_RectF& rtClip);
+ bool SetClipRect(const CFX_RectF& rtClip);
const CFX_RectF& GetClipRect();
FX_FLOAT GetDpiX() const;
FX_FLOAT GetDpiY() const;
- FX_BOOL DrawImage(CFX_DIBSource* pDib,
- const CFX_RectF* pSrcRect,
- const CFX_RectF& dstRect,
- const CFX_Matrix* pImgMatrix = nullptr,
- const CFX_Matrix* pDevMatrix = nullptr);
- FX_BOOL DrawString(CFDE_Brush* pBrush,
- CFGAS_GEFont* pFont,
- const FXTEXT_CHARPOS* pCharPos,
- int32_t iCount,
- FX_FLOAT fFontSize,
- const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL DrawBezier(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_PointF& pt1,
- const CFX_PointF& pt2,
- const CFX_PointF& pt3,
- const CFX_PointF& pt4,
- const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL DrawCurve(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_PointsF& points,
- FX_BOOL bClosed,
- FX_FLOAT fTension = 0.5f,
- const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL DrawEllipse(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_RectF& rect,
- const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL DrawLines(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_PointsF& points,
- const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL DrawLine(CFDE_Pen* pPen,
+ bool DrawImage(CFX_DIBSource* pDib,
+ const CFX_RectF* pSrcRect,
+ const CFX_RectF& dstRect,
+ const CFX_Matrix* pImgMatrix = nullptr,
+ const CFX_Matrix* pDevMatrix = nullptr);
+ bool DrawString(CFDE_Brush* pBrush,
+ CFGAS_GEFont* pFont,
+ const FXTEXT_CHARPOS* pCharPos,
+ int32_t iCount,
+ FX_FLOAT fFontSize,
+ const CFX_Matrix* pMatrix = nullptr);
+ bool DrawBezier(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFX_PointF& pt1,
+ const CFX_PointF& pt2,
+ const CFX_PointF& pt3,
+ const CFX_PointF& pt4,
+ const CFX_Matrix* pMatrix = nullptr);
+ bool DrawCurve(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFX_PointsF& points,
+ bool bClosed,
+ FX_FLOAT fTension = 0.5f,
+ const CFX_Matrix* pMatrix = nullptr);
+ bool DrawEllipse(CFDE_Pen* pPen,
FX_FLOAT fPenWidth,
- const CFX_PointF& pt1,
- const CFX_PointF& pt2,
+ const CFX_RectF& rect,
const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL DrawPath(CFDE_Pen* pPen,
+ bool DrawLines(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFX_PointsF& points,
+ const CFX_Matrix* pMatrix = nullptr);
+ bool DrawLine(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFX_PointF& pt1,
+ const CFX_PointF& pt2,
+ const CFX_Matrix* pMatrix = nullptr);
+ bool DrawPath(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFDE_Path* pPath,
+ const CFX_Matrix* pMatrix = nullptr);
+ bool DrawPolygon(CFDE_Pen* pPen,
FX_FLOAT fPenWidth,
- const CFDE_Path* pPath,
+ const CFX_PointsF& points,
const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL DrawPolygon(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_PointsF& points,
- const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL DrawRectangle(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- const CFX_RectF& rect,
- const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL FillClosedCurve(CFDE_Brush* pBrush,
- const CFX_PointsF& points,
- FX_FLOAT fTension = 0.5f,
- const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL FillEllipse(CFDE_Brush* pBrush,
- const CFX_RectF& rect,
- const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL FillPath(CFDE_Brush* pBrush,
- const CFDE_Path* pPath,
+ bool DrawRectangle(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ const CFX_RectF& rect,
+ const CFX_Matrix* pMatrix = nullptr);
+ bool FillClosedCurve(CFDE_Brush* pBrush,
+ const CFX_PointsF& points,
+ FX_FLOAT fTension = 0.5f,
+ const CFX_Matrix* pMatrix = nullptr);
+ bool FillEllipse(CFDE_Brush* pBrush,
+ const CFX_RectF& rect,
+ const CFX_Matrix* pMatrix = nullptr);
+ bool FillPath(CFDE_Brush* pBrush,
+ const CFDE_Path* pPath,
+ const CFX_Matrix* pMatrix = nullptr);
+ bool FillPolygon(CFDE_Brush* pBrush,
+ const CFX_PointsF& points,
const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL FillPolygon(CFDE_Brush* pBrush,
- const CFX_PointsF& points,
- const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL FillRectangle(CFDE_Brush* pBrush,
- const CFX_RectF& rect,
- const CFX_Matrix* pMatrix = nullptr);
+ bool FillRectangle(CFDE_Brush* pBrush,
+ const CFX_RectF& rect,
+ const CFX_Matrix* pMatrix = nullptr);
- FX_BOOL DrawSolidString(CFDE_Brush* pBrush,
- CFGAS_GEFont* pFont,
- const FXTEXT_CHARPOS* pCharPos,
- int32_t iCount,
- FX_FLOAT fFontSize,
- const CFX_Matrix* pMatrix);
- FX_BOOL DrawStringPath(CFDE_Brush* pBrush,
- CFGAS_GEFont* pFont,
- const FXTEXT_CHARPOS* pCharPos,
- int32_t iCount,
- FX_FLOAT fFontSize,
- const CFX_Matrix* pMatrix);
+ bool DrawSolidString(CFDE_Brush* pBrush,
+ CFGAS_GEFont* pFont,
+ const FXTEXT_CHARPOS* pCharPos,
+ int32_t iCount,
+ FX_FLOAT fFontSize,
+ const CFX_Matrix* pMatrix);
+ bool DrawStringPath(CFDE_Brush* pBrush,
+ CFGAS_GEFont* pFont,
+ const FXTEXT_CHARPOS* pCharPos,
+ int32_t iCount,
+ FX_FLOAT fFontSize,
+ const CFX_Matrix* pMatrix);
protected:
- FX_BOOL CreatePen(CFDE_Pen* pPen,
- FX_FLOAT fPenWidth,
- CFX_GraphStateData& graphState);
+ bool CreatePen(CFDE_Pen* pPen,
+ FX_FLOAT fPenWidth,
+ CFX_GraphStateData& graphState);
CFX_RenderDevice* const m_pDevice;
CFX_RectF m_rtClip;
- FX_BOOL m_bOwnerDevice;
+ bool m_bOwnerDevice;
int32_t m_iCharCount;
};
diff --git a/xfa/fde/fde_iterator.cpp b/xfa/fde/fde_iterator.cpp
index a51b8ad90a..9ca02da6a0 100644
--- a/xfa/fde/fde_iterator.cpp
+++ b/xfa/fde/fde_iterator.cpp
@@ -12,26 +12,26 @@ CFDE_VisualSetIterator::CFDE_VisualSetIterator()
: m_dwFilter(0), m_CanvasStack(100) {}
CFDE_VisualSetIterator::~CFDE_VisualSetIterator() {
- m_CanvasStack.RemoveAll(FALSE);
+ m_CanvasStack.RemoveAll(false);
}
-FX_BOOL CFDE_VisualSetIterator::AttachCanvas(IFDE_CanvasSet* pCanvas) {
+bool CFDE_VisualSetIterator::AttachCanvas(IFDE_CanvasSet* pCanvas) {
ASSERT(pCanvas);
- m_CanvasStack.RemoveAll(FALSE);
+ m_CanvasStack.RemoveAll(false);
FDE_CANVASITEM canvas;
canvas.hCanvas = nullptr;
canvas.pCanvas = pCanvas;
canvas.hPos = pCanvas->GetFirstPosition();
if (!canvas.hPos)
- return FALSE;
+ return false;
return m_CanvasStack.Push(canvas) == 0;
}
-FX_BOOL CFDE_VisualSetIterator::FilterObjects(uint32_t dwObjects) {
+bool CFDE_VisualSetIterator::FilterObjects(uint32_t dwObjects) {
if (m_CanvasStack.GetSize() == 0)
- return FALSE;
+ return false;
while (m_CanvasStack.GetSize() > 1)
m_CanvasStack.Pop();
diff --git a/xfa/fde/fde_iterator.h b/xfa/fde/fde_iterator.h
index d162e24af3..444c92a191 100644
--- a/xfa/fde/fde_iterator.h
+++ b/xfa/fde/fde_iterator.h
@@ -22,8 +22,8 @@ class CFDE_VisualSetIterator : public CFX_Target {
CFDE_VisualSetIterator();
~CFDE_VisualSetIterator() override;
- FX_BOOL AttachCanvas(IFDE_CanvasSet* pCanvas);
- FX_BOOL FilterObjects(uint32_t dwObjects = 0xFFFFFFFF);
+ bool AttachCanvas(IFDE_CanvasSet* pCanvas);
+ bool FilterObjects(uint32_t dwObjects = 0xFFFFFFFF);
void Reset();
FDE_TEXTEDITPIECE* GetNext(IFDE_VisualSet*& pVisualSet,
diff --git a/xfa/fde/fde_render.cpp b/xfa/fde/fde_render.cpp
index f3189b0877..e1d46f55f9 100644
--- a/xfa/fde/fde_render.cpp
+++ b/xfa/fde/fde_render.cpp
@@ -24,15 +24,15 @@ CFDE_RenderContext::~CFDE_RenderContext() {
StopRender();
}
-FX_BOOL CFDE_RenderContext::StartRender(CFDE_RenderDevice* pRenderDevice,
- IFDE_CanvasSet* pCanvasSet,
- const CFX_Matrix& tmDoc2Device) {
+bool CFDE_RenderContext::StartRender(CFDE_RenderDevice* pRenderDevice,
+ IFDE_CanvasSet* pCanvasSet,
+ const CFX_Matrix& tmDoc2Device) {
if (m_pRenderDevice)
- return FALSE;
+ return false;
if (!pRenderDevice)
- return FALSE;
+ return false;
if (!pCanvasSet)
- return FALSE;
+ return false;
m_eStatus = FDE_RENDERSTATUS_Paused;
m_pRenderDevice = pRenderDevice;
@@ -63,7 +63,7 @@ FDE_RENDERSTATUS CFDE_RenderContext::DoRender(IFX_Pause* pPause) {
FDE_TEXTEDITPIECE* pPiece;
CFX_RectF rtObj;
int32_t iCount = 0;
- while (TRUE) {
+ while (true) {
pPiece = m_pIterator->GetNext(pVisualSet);
if (!pPiece || !pVisualSet) {
eStatus = FDE_RENDERSTATUS_Done;
@@ -80,7 +80,7 @@ FDE_RENDERSTATUS CFDE_RenderContext::DoRender(IFX_Pause* pPause) {
iCount += 5;
break;
case FDE_VISUALOBJ_Canvas:
- ASSERT(FALSE);
+ ASSERT(false);
break;
default:
break;
@@ -111,7 +111,7 @@ void CFDE_RenderContext::RenderText(IFDE_TextSet* pTextSet,
if (!pFont)
return;
- int32_t iCount = pTextSet->GetDisplayPos(pText, nullptr, FALSE);
+ int32_t iCount = pTextSet->GetDisplayPos(pText, nullptr, false);
if (iCount < 1)
return;
@@ -121,7 +121,7 @@ void CFDE_RenderContext::RenderText(IFDE_TextSet* pTextSet,
if (m_CharPos.size() < static_cast<size_t>(iCount))
m_CharPos.resize(iCount, FXTEXT_CHARPOS());
- iCount = pTextSet->GetDisplayPos(pText, m_CharPos.data(), FALSE);
+ iCount = pTextSet->GetDisplayPos(pText, m_CharPos.data(), false);
FX_FLOAT fFontSize = pTextSet->GetFontSize();
FX_ARGB dwColor = pTextSet->GetFontColor();
m_pBrush->SetColor(dwColor);
diff --git a/xfa/fde/fde_render.h b/xfa/fde/fde_render.h
index 45cceabac4..8bd09510a5 100644
--- a/xfa/fde/fde_render.h
+++ b/xfa/fde/fde_render.h
@@ -29,9 +29,9 @@ class CFDE_RenderContext : public CFX_Target {
CFDE_RenderContext();
~CFDE_RenderContext() override;
- FX_BOOL StartRender(CFDE_RenderDevice* pRenderDevice,
- IFDE_CanvasSet* pCanvasSet,
- const CFX_Matrix& tmDoc2Device);
+ bool StartRender(CFDE_RenderDevice* pRenderDevice,
+ IFDE_CanvasSet* pCanvasSet,
+ const CFX_Matrix& tmDoc2Device);
FDE_RENDERSTATUS GetStatus() const { return m_eStatus; }
FDE_RENDERSTATUS DoRender(IFX_Pause* pPause = nullptr);
void StopRender();
diff --git a/xfa/fde/fde_visualset.h b/xfa/fde/fde_visualset.h
index 103e7258ca..58ac4b99e4 100644
--- a/xfa/fde/fde_visualset.h
+++ b/xfa/fde/fde_visualset.h
@@ -53,11 +53,11 @@ class IFDE_TextSet : public IFDE_VisualSet {
virtual FX_ARGB GetFontColor() = 0;
virtual int32_t GetDisplayPos(FDE_TEXTEDITPIECE* hText,
FXTEXT_CHARPOS* pCharPos,
- FX_BOOL bCharCode = FALSE,
+ bool bCharCode = false,
CFX_WideString* pWSForms = nullptr) = 0;
virtual int32_t GetCharRects(const FDE_TEXTEDITPIECE* hText,
CFX_RectFArray& rtArray,
- FX_BOOL bbox) = 0;
+ bool bbox) = 0;
};
#endif // XFA_FDE_FDE_VISUALSET_H_
diff --git a/xfa/fde/ifde_txtedtdorecord.h b/xfa/fde/ifde_txtedtdorecord.h
index e36a59539a..b6a4100d99 100644
--- a/xfa/fde/ifde_txtedtdorecord.h
+++ b/xfa/fde/ifde_txtedtdorecord.h
@@ -13,8 +13,8 @@ class IFDE_TxtEdtDoRecord {
public:
virtual ~IFDE_TxtEdtDoRecord() {}
- virtual FX_BOOL Redo() const = 0;
- virtual FX_BOOL Undo() const = 0;
+ virtual bool Redo() const = 0;
+ virtual bool Undo() const = 0;
};
#endif // XFA_FDE_IFDE_TXTEDTDORECORD_H_
diff --git a/xfa/fde/ifde_txtedtengine.h b/xfa/fde/ifde_txtedtengine.h
index ff36deaa66..960edd36b7 100644
--- a/xfa/fde/ifde_txtedtengine.h
+++ b/xfa/fde/ifde_txtedtengine.h
@@ -95,7 +95,7 @@ struct FDE_TXTEDTPARAMS {
FX_ARGB dwFontColor;
FX_FLOAT fLineSpace;
FX_FLOAT fTabWidth;
- FX_BOOL bTabEquidistant;
+ bool bTabEquidistant;
FX_WCHAR wDefChar;
FX_WCHAR wLineBreakChar;
int32_t nCharRotation;
diff --git a/xfa/fde/ifde_txtedtpage.h b/xfa/fde/ifde_txtedtpage.h
index 3132727c5b..ecc7d1699e 100644
--- a/xfa/fde/ifde_txtedtpage.h
+++ b/xfa/fde/ifde_txtedtpage.h
@@ -20,8 +20,8 @@ class IFDE_TxtEdtPage : public IFDE_CanvasSet, public IFX_TxtAccess {
virtual CFDE_TxtEdtEngine* GetEngine() const = 0;
virtual int32_t GetCharRect(int32_t nIndex,
CFX_RectF& rect,
- FX_BOOL bBBox = FALSE) const = 0;
- virtual int32_t GetCharIndex(const CFX_PointF& fPoint, FX_BOOL& bBefore) = 0;
+ bool bBBox = false) const = 0;
+ virtual int32_t GetCharIndex(const CFX_PointF& fPoint, bool& bBefore) = 0;
virtual void CalcRangeRectArray(int32_t nStart,
int32_t nCount,
CFX_RectFArray& RectFArr) const = 0;
@@ -32,7 +32,7 @@ class IFDE_TxtEdtPage : public IFDE_CanvasSet, public IFX_TxtAccess {
virtual int32_t GetDisplayPos(const CFX_RectF& rtClip,
FXTEXT_CHARPOS*& pCharPos,
CFX_RectF* pBBox) const = 0;
- virtual FX_BOOL IsLoaded(const CFX_RectF* pClipBox) = 0;
+ virtual bool IsLoaded(const CFX_RectF* pClipBox) = 0;
virtual int32_t LoadPage(const CFX_RectF* pClipBox, IFX_Pause* pPause) = 0;
virtual void UnloadPage(const CFX_RectF* pClipBox) = 0;
virtual const CFX_RectF& GetContentsBox() = 0;
diff --git a/xfa/fde/ifx_chariter.h b/xfa/fde/ifx_chariter.h
index 6c3fa00107..c967efd4d6 100644
--- a/xfa/fde/ifx_chariter.h
+++ b/xfa/fde/ifx_chariter.h
@@ -13,11 +13,11 @@ class IFX_CharIter {
public:
virtual ~IFX_CharIter() {}
- virtual FX_BOOL Next(FX_BOOL bPrev = FALSE) = 0;
+ virtual bool Next(bool bPrev = false) = 0;
virtual FX_WCHAR GetChar() = 0;
virtual void SetAt(int32_t nIndex) = 0;
virtual int32_t GetAt() const = 0;
- virtual FX_BOOL IsEOF(FX_BOOL bTail = TRUE) const = 0;
+ virtual bool IsEOF(bool bTail = true) const = 0;
virtual IFX_CharIter* Clone() = 0;
};
diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp
index 3010fc7f78..68a68565d1 100644
--- a/xfa/fde/tto/fde_textout.cpp
+++ b/xfa/fde/tto/fde_textout.cpp
@@ -30,7 +30,7 @@ CFDE_TextOut::CFDE_TextOut()
m_TxtColor(0xFF000000),
m_dwStyles(0),
m_dwTxtBkStyles(0),
- m_bElliChanged(FALSE),
+ m_bElliChanged(false),
m_iEllipsisWidth(0),
m_ttoLines(5),
m_iCurLine(0),
@@ -42,7 +42,7 @@ CFDE_TextOut::CFDE_TextOut()
}
CFDE_TextOut::~CFDE_TextOut() {
- m_ttoLines.RemoveAll(FALSE);
+ m_ttoLines.RemoveAll(false);
}
void CFDE_TextOut::SetFont(CFGAS_GEFont* pFont) {
@@ -88,11 +88,11 @@ void CFDE_TextOut::SetStyles(uint32_t dwStyles) {
void CFDE_TextOut::SetTabWidth(FX_FLOAT fTabWidth) {
ASSERT(fTabWidth > 1.0f);
- m_pTxtBreak->SetTabWidth(fTabWidth, FALSE);
+ m_pTxtBreak->SetTabWidth(fTabWidth, false);
}
void CFDE_TextOut::SetEllipsisString(const CFX_WideString& wsEllipsis) {
- m_bElliChanged = TRUE;
+ m_bElliChanged = true;
m_wsEllipsis = wsEllipsis;
}
@@ -132,12 +132,12 @@ void CFDE_TextOut::SetDIBitmap(CFX_DIBitmap* pDIB) {
m_pRenderDevice.reset();
CFX_FxgeDevice* device = new CFX_FxgeDevice;
device->Attach(pDIB, false, nullptr, false);
- m_pRenderDevice.reset(new CFDE_RenderDevice(device, FALSE));
+ m_pRenderDevice.reset(new CFDE_RenderDevice(device, false));
}
void CFDE_TextOut::SetRenderDevice(CFX_RenderDevice* pDevice) {
ASSERT(pDevice);
- m_pRenderDevice.reset(new CFDE_RenderDevice(pDevice, FALSE));
+ m_pRenderDevice.reset(new CFDE_RenderDevice(pDevice, false));
}
void CFDE_TextOut::SetClipRect(const CFX_Rect& rtClip) {
@@ -240,8 +240,8 @@ void CFDE_TextOut::CalcTextSize(const FX_WCHAR* pwsStr,
SetLineWidth(rect);
m_iTotalLines = 0;
const FX_WCHAR* pStr = pwsStr;
- FX_BOOL bHotKey = !!(m_dwStyles & FDE_TTOSTYLE_HotKey);
- FX_BOOL bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
+ bool bHotKey = !!(m_dwStyles & FDE_TTOSTYLE_HotKey);
+ bool bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
FX_FLOAT fWidth = 0.0f;
FX_FLOAT fHeight = 0.0f;
FX_FLOAT fStartPos = bVertical ? rect.bottom() : rect.right();
@@ -314,16 +314,16 @@ void CFDE_TextOut::SetLineWidth(CFX_RectF& rect) {
}
}
-FX_BOOL CFDE_TextOut::RetrieveLineWidth(uint32_t dwBreakStatus,
- FX_FLOAT& fStartPos,
- FX_FLOAT& fWidth,
- FX_FLOAT& fHeight) {
+bool CFDE_TextOut::RetrieveLineWidth(uint32_t dwBreakStatus,
+ FX_FLOAT& fStartPos,
+ FX_FLOAT& fWidth,
+ FX_FLOAT& fHeight) {
if (dwBreakStatus <= FX_TXTBREAK_PieceBreak) {
- return FALSE;
+ return false;
}
FX_FLOAT fLineStep =
(m_fLineSpace > m_fFontSize) ? m_fLineSpace : m_fFontSize;
- FX_BOOL bLineWrap = !!(m_dwStyles & FDE_TTOSTYLE_LineWrap);
+ bool bLineWrap = !!(m_dwStyles & FDE_TTOSTYLE_LineWrap);
FX_FLOAT fLineWidth = 0.0f;
int32_t iCount = m_pTxtBreak->CountBreakPieces();
for (int32_t i = 0; i < iCount; i++) {
@@ -342,7 +342,7 @@ FX_BOOL CFDE_TextOut::RetrieveLineWidth(uint32_t dwBreakStatus,
fHeight += fLineStep;
}
m_iTotalLines++;
- return TRUE;
+ return true;
}
void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr,
@@ -419,7 +419,7 @@ void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr,
fLineWidth = rect.height;
}
m_pTxtBreak->SetLineWidth(fLineWidth);
- m_ttoLines.RemoveAll(TRUE);
+ m_ttoLines.RemoveAll(true);
m_wsText.clear();
LoadText(pwsStr, iLength, rect);
if (m_dwStyles & FDE_TTOSTYLE_Ellipsis) {
@@ -453,7 +453,7 @@ void CFDE_TextOut::LoadEllipsis() {
if (!m_bElliChanged) {
return;
}
- m_bElliChanged = FALSE;
+ m_bElliChanged = false;
m_iEllipsisWidth = 0;
int32_t iLength = m_wsEllipsis.GetLength();
if (iLength < 1) {
@@ -497,9 +497,9 @@ void CFDE_TextOut::LoadText(const FX_WCHAR* pwsStr,
FX_WCHAR* pStr = m_wsText.GetBuffer(iLength);
int32_t iTxtLength = iLength;
ExpandBuffer(iTxtLength, 0);
- FX_BOOL bHotKey = !!(m_dwStyles & FDE_TTOSTYLE_HotKey);
- FX_BOOL bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
- FX_BOOL bLineWrap = !!(m_dwStyles & FDE_TTOSTYLE_LineWrap);
+ bool bHotKey = !!(m_dwStyles & FDE_TTOSTYLE_HotKey);
+ bool bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
+ bool bLineWrap = !!(m_dwStyles & FDE_TTOSTYLE_LineWrap);
FX_FLOAT fLineStep =
(m_fLineSpace > m_fFontSize) ? m_fLineSpace : m_fFontSize;
FX_FLOAT fLineStop = bVertical ? rect.left : rect.bottom();
@@ -513,7 +513,7 @@ void CFDE_TextOut::LoadText(const FX_WCHAR* pwsStr,
int32_t iPieceWidths = 0;
uint32_t dwBreakStatus;
FX_WCHAR wch;
- FX_BOOL bRet = FALSE;
+ bool bRet = false;
while (iTxtLength-- > 0) {
wch = *pwsStr++;
if (bHotKey && wch == L'&' && *(pStr - 1) != L'&') {
@@ -525,8 +525,8 @@ void CFDE_TextOut::LoadText(const FX_WCHAR* pwsStr,
iChars++;
dwBreakStatus = m_pTxtBreak->AppendChar(wch);
if (dwBreakStatus > FX_TXTBREAK_PieceBreak) {
- FX_BOOL bEndofLine =
- RetriecePieces(dwBreakStatus, iStartChar, iPieceWidths, FALSE, rect);
+ bool bEndofLine =
+ RetriecePieces(dwBreakStatus, iStartChar, iPieceWidths, false, rect);
if (bEndofLine && (bLineWrap || (dwBreakStatus > FX_TXTBREAK_LineBreak &&
!bLineWrap))) {
iPieceWidths = 0;
@@ -540,36 +540,36 @@ void CFDE_TextOut::LoadText(const FX_WCHAR* pwsStr,
iCurLine--;
}
CFDE_TTOLine* pLine = m_ttoLines.GetPtrAt(iCurLine);
- pLine->m_bNewReload = TRUE;
- bRet = TRUE;
+ pLine->m_bNewReload = true;
+ bRet = true;
break;
}
}
}
dwBreakStatus = m_pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
if (dwBreakStatus > FX_TXTBREAK_PieceBreak && !bRet) {
- RetriecePieces(dwBreakStatus, iStartChar, iPieceWidths, FALSE, rect);
+ RetriecePieces(dwBreakStatus, iStartChar, iPieceWidths, false, rect);
}
m_pTxtBreak->ClearBreakPieces();
m_pTxtBreak->Reset();
m_wsText.ReleaseBuffer(iLength);
}
-FX_BOOL CFDE_TextOut::RetriecePieces(uint32_t dwBreakStatus,
- int32_t& iStartChar,
- int32_t& iPieceWidths,
- FX_BOOL bReload,
- const CFX_RectF& rect) {
- FX_BOOL bSingleLine = !!(m_dwStyles & FDE_TTOSTYLE_SingleLine);
- FX_BOOL bLineWrap = !!(m_dwStyles & FDE_TTOSTYLE_LineWrap);
- FX_BOOL bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
+bool CFDE_TextOut::RetriecePieces(uint32_t dwBreakStatus,
+ int32_t& iStartChar,
+ int32_t& iPieceWidths,
+ bool bReload,
+ const CFX_RectF& rect) {
+ bool bSingleLine = !!(m_dwStyles & FDE_TTOSTYLE_SingleLine);
+ bool bLineWrap = !!(m_dwStyles & FDE_TTOSTYLE_LineWrap);
+ bool bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
FX_FLOAT fLineStep =
(m_fLineSpace > m_fFontSize) ? m_fLineSpace : m_fFontSize;
if (bVertical) {
fLineStep = -fLineStep;
}
CFX_Char* pTC = nullptr;
- FX_BOOL bNeedReload = FALSE;
+ bool bNeedReload = false;
FX_FLOAT fLineWidth = bVertical ? rect.Height() : rect.Width();
int32_t iLineWidth = FXSYS_round(fLineWidth * 20000.0f);
int32_t iCount = m_pTxtBreak->CountBreakPieces();
@@ -584,7 +584,7 @@ FX_BOOL CFDE_TextOut::RetriecePieces(uint32_t dwBreakStatus,
int32_t iCurCharWidth = pTC->m_iCharWidth > 0 ? pTC->m_iCharWidth : 0;
if (bSingleLine || !bLineWrap) {
if (iLineWidth - iPieceWidths - iWidth < iCurCharWidth) {
- bNeedReload = TRUE;
+ bNeedReload = true;
break;
}
}
@@ -593,7 +593,7 @@ FX_BOOL CFDE_TextOut::RetriecePieces(uint32_t dwBreakStatus,
}
if (j == 0 && !bReload) {
CFDE_TTOLine* pLine = m_ttoLines.GetPtrAt(m_iCurLine);
- pLine->m_bNewReload = TRUE;
+ pLine->m_bNewReload = true;
} else if (j > 0) {
CFX_RectF rtPiece;
if (bVertical) {
@@ -621,14 +621,14 @@ FX_BOOL CFDE_TextOut::RetriecePieces(uint32_t dwBreakStatus,
iPieceWidths += iWidth;
}
m_pTxtBreak->ClearBreakPieces();
- FX_BOOL bRet = bSingleLine || bLineWrap || (!bLineWrap && bNeedReload) ||
- dwBreakStatus == FX_TXTBREAK_ParagraphBreak;
+ bool bRet = bSingleLine || bLineWrap || (!bLineWrap && bNeedReload) ||
+ dwBreakStatus == FX_TXTBREAK_ParagraphBreak;
return bRet;
}
void CFDE_TextOut::AppendPiece(const FDE_TTOPIECE& ttoPiece,
- FX_BOOL bNeedReload,
- FX_BOOL bEnd) {
+ bool bNeedReload,
+ bool bEnd) {
if (m_iCurLine >= m_ttoLines.GetSize()) {
CFDE_TTOLine ttoLine;
ttoLine.m_bNewReload = bNeedReload;
@@ -709,7 +709,7 @@ void CFDE_TextOut::Reload(const CFX_RectF& rect) {
void CFDE_TextOut::ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect) {
const FX_WCHAR* pwsStr = m_wsText.c_str();
- FX_BOOL bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
+ bool bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
int32_t iPieceWidths = 0;
FDE_TTOPIECE* pPiece = pLine->GetPtrAt(0);
int32_t iStartChar = pPiece->iStartChar;
@@ -725,7 +725,7 @@ void CFDE_TextOut::ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect) {
wch = *(pwsStr + iStar);
dwBreakStatus = m_pTxtBreak->AppendChar(wch);
if (dwBreakStatus > FX_TXTBREAK_PieceBreak) {
- RetriecePieces(dwBreakStatus, iStartChar, iPieceWidths, TRUE, rect);
+ RetriecePieces(dwBreakStatus, iStartChar, iPieceWidths, true, rect);
}
iStar++;
}
@@ -734,13 +734,13 @@ void CFDE_TextOut::ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect) {
}
dwBreakStatus = m_pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak);
if (dwBreakStatus > FX_TXTBREAK_PieceBreak) {
- RetriecePieces(dwBreakStatus, iStartChar, iPieceWidths, TRUE, rect);
+ RetriecePieces(dwBreakStatus, iStartChar, iPieceWidths, true, rect);
}
m_pTxtBreak->Reset();
}
void CFDE_TextOut::DoAlignment(const CFX_RectF& rect) {
- FX_BOOL bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
+ bool bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
FX_FLOAT fLineStopS = bVertical ? rect.right() : rect.bottom();
int32_t iLines = m_ttoLines.GetSize();
if (iLines < 1)
@@ -836,10 +836,10 @@ FX_TXTRUN CFDE_TextOut::ToTextRun(const FDE_TTOPIECE* pPiece) {
}
void CFDE_TextOut::DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen*& pPen) {
- FX_BOOL bUnderLine = !!(m_dwStyles & FDE_TTOSTYLE_Underline);
- FX_BOOL bStrikeOut = !!(m_dwStyles & FDE_TTOSTYLE_Strikeout);
- FX_BOOL bHotKey = !!(m_dwStyles & FDE_TTOSTYLE_HotKey);
- FX_BOOL bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
+ bool bUnderLine = !!(m_dwStyles & FDE_TTOSTYLE_Underline);
+ bool bStrikeOut = !!(m_dwStyles & FDE_TTOSTYLE_Strikeout);
+ bool bHotKey = !!(m_dwStyles & FDE_TTOSTYLE_HotKey);
+ bool bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
if (!bUnderLine && !bStrikeOut && !bHotKey)
return;
@@ -912,7 +912,7 @@ void CFDE_TextOut::DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen*& pPen) {
}
CFDE_TTOLine::CFDE_TTOLine()
- : m_bNewReload(FALSE), m_pieces(5), m_iPieceCount(0) {}
+ : m_bNewReload(false), m_pieces(5), m_iPieceCount(0) {}
CFDE_TTOLine::CFDE_TTOLine(const CFDE_TTOLine& ttoLine) : m_pieces(5) {
m_bNewReload = ttoLine.m_bNewReload;
@@ -948,6 +948,6 @@ void CFDE_TTOLine::RemoveLast(int32_t iCount) {
m_pieces.RemoveLast(iCount);
}
-void CFDE_TTOLine::RemoveAll(FX_BOOL bLeaveMemory) {
+void CFDE_TTOLine::RemoveAll(bool bLeaveMemory) {
m_pieces.RemoveAll(bLeaveMemory);
}
diff --git a/xfa/fde/tto/fde_textout.h b/xfa/fde/tto/fde_textout.h
index 341547185c..3aba000db1 100644
--- a/xfa/fde/tto/fde_textout.h
+++ b/xfa/fde/tto/fde_textout.h
@@ -65,9 +65,9 @@ class CFDE_TTOLine : public CFX_Target {
int32_t GetSize() const;
FDE_TTOPIECE* GetPtrAt(int32_t index);
void RemoveLast(int32_t iCount);
- void RemoveAll(FX_BOOL bLeaveMemory);
+ void RemoveAll(bool bLeaveMemory);
- FX_BOOL m_bNewReload;
+ bool m_bNewReload;
CFDE_TTOPieceArray m_pieces;
protected:
@@ -122,10 +122,10 @@ class CFDE_TextOut : public CFX_Target {
protected:
void CalcTextSize(const FX_WCHAR* pwsStr, int32_t iLength, CFX_RectF& rect);
- FX_BOOL RetrieveLineWidth(uint32_t dwBreakStatus,
- FX_FLOAT& fStartPos,
- FX_FLOAT& fWidth,
- FX_FLOAT& fHeight);
+ bool RetrieveLineWidth(uint32_t dwBreakStatus,
+ FX_FLOAT& fStartPos,
+ FX_FLOAT& fWidth,
+ FX_FLOAT& fHeight);
void SetLineWidth(CFX_RectF& rect);
void DrawText(const FX_WCHAR* pwsStr,
int32_t iLength,
@@ -138,14 +138,12 @@ class CFDE_TextOut : public CFX_Target {
void Reload(const CFX_RectF& rect);
void ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect);
- FX_BOOL RetriecePieces(uint32_t dwBreakStatus,
- int32_t& iStartChar,
- int32_t& iPieceWidths,
- FX_BOOL bReload,
- const CFX_RectF& rect);
- void AppendPiece(const FDE_TTOPIECE& ttoPiece,
- FX_BOOL bNeedReload,
- FX_BOOL bEnd);
+ bool RetriecePieces(uint32_t dwBreakStatus,
+ int32_t& iStartChar,
+ int32_t& iPieceWidths,
+ bool bReload,
+ const CFX_RectF& rect);
+ void AppendPiece(const FDE_TTOPIECE& ttoPiece, bool bNeedReload, bool bEnd);
void ReplaceWidthEllipsis();
void DoAlignment(const CFX_RectF& rect);
void OnDraw(const CFX_RectF& rtClip);
@@ -170,7 +168,7 @@ class CFDE_TextOut : public CFX_Target {
uint32_t m_dwStyles;
uint32_t m_dwTxtBkStyles;
CFX_WideString m_wsEllipsis;
- FX_BOOL m_bElliChanged;
+ bool m_bElliChanged;
int32_t m_iEllipsisWidth;
CFX_WideString m_wsText;
CFX_RectF m_rtClip;
diff --git a/xfa/fde/xml/cfx_saxreader.cpp b/xfa/fde/xml/cfx_saxreader.cpp
index 8f18451ea0..b4d48d2937 100644
--- a/xfa/fde/xml/cfx_saxreader.cpp
+++ b/xfa/fde/xml/cfx_saxreader.cpp
@@ -70,45 +70,45 @@ CFX_SAXFile::CFX_SAXFile()
m_pBuf(nullptr),
m_dwBufSize(0),
m_dwBufIndex(0) {}
-FX_BOOL CFX_SAXFile::StartFile(IFX_SeekableReadStream* pFile,
- uint32_t dwStart,
- uint32_t dwLen) {
+bool CFX_SAXFile::StartFile(IFX_SeekableReadStream* pFile,
+ uint32_t dwStart,
+ uint32_t dwLen) {
ASSERT(!m_pFile && pFile);
uint32_t dwSize = pFile->GetSize();
if (dwStart >= dwSize) {
- return FALSE;
+ return false;
}
if (dwLen == static_cast<uint32_t>(-1) || dwStart + dwLen > dwSize) {
dwLen = dwSize - dwStart;
}
if (dwLen == 0) {
- return FALSE;
+ return false;
}
m_dwBufSize = std::min(dwLen, kSaxFileBufSize);
m_pBuf = FX_Alloc(uint8_t, m_dwBufSize);
if (!pFile->ReadBlock(m_pBuf, dwStart, m_dwBufSize)) {
- return FALSE;
+ return false;
}
m_dwStart = dwStart;
m_dwEnd = dwStart + dwLen;
m_dwCur = dwStart;
m_pFile = pFile;
m_dwBufIndex = 0;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_SAXFile::ReadNextBlock() {
+bool CFX_SAXFile::ReadNextBlock() {
ASSERT(m_pFile);
uint32_t dwSize = m_dwEnd - m_dwCur;
if (dwSize == 0) {
- return FALSE;
+ return false;
}
m_dwBufSize = std::min(dwSize, kSaxFileBufSize);
if (!m_pFile->ReadBlock(m_pBuf, m_dwCur, m_dwBufSize)) {
- return FALSE;
+ return false;
}
m_dwBufIndex = 0;
- return TRUE;
+ return true;
}
void CFX_SAXFile::Reset() {
@@ -210,7 +210,7 @@ void CFX_SAXReader::ReallocNameBuffer() {
m_pszName = (uint8_t*)FX_Realloc(uint8_t, m_pszName, m_iNameSize);
}
-FX_BOOL CFX_SAXReader::SkipSpace(uint8_t ch) {
+bool CFX_SAXReader::SkipSpace(uint8_t ch) {
return (m_dwParseMode & CFX_SaxParseMode_NotSkipSpace) == 0 && ch < 0x21;
}
@@ -226,7 +226,7 @@ int32_t CFX_SAXReader::StartParse(IFX_SeekableReadStream* pFile,
m_iState = 0;
m_eMode = CFX_SaxMode::Text;
m_ePrevMode = CFX_SaxMode::Text;
- m_bCharData = FALSE;
+ m_bCharData = false;
m_dwDataOffset = 0;
m_dwParseMode = dwParseMode;
m_Stack.emplace(new CFX_SAXItem(++m_dwItemID));
@@ -637,11 +637,11 @@ void CFX_SAXReader::SkipNode() {
m_dwDataOffset += 7;
FXSYS_memmove(m_pszData, m_pszData + 7,
m_iDataLength * sizeof(uint8_t));
- m_bCharData = TRUE;
+ m_bCharData = true;
if (m_pHandler) {
NotifyData();
}
- m_bCharData = FALSE;
+ m_bCharData = false;
} else {
Pop();
}
@@ -728,7 +728,7 @@ void CFX_SAXReader::SkipCurrentNode() {
if (!pItem)
return;
- pItem->m_bSkip = TRUE;
+ pItem->m_bSkip = true;
}
void CFX_SAXReader::SetHandler(CXFA_SAXReaderHandler* pHandler) {
diff --git a/xfa/fde/xml/cfx_saxreader.h b/xfa/fde/xml/cfx_saxreader.h
index 10ba69f1f5..667813cf76 100644
--- a/xfa/fde/xml/cfx_saxreader.h
+++ b/xfa/fde/xml/cfx_saxreader.h
@@ -27,21 +27,21 @@ class CFX_SAXItem {
};
explicit CFX_SAXItem(uint32_t id)
- : m_pNode(nullptr), m_eNode(Type::Unknown), m_dwID(id), m_bSkip(FALSE) {}
+ : m_pNode(nullptr), m_eNode(Type::Unknown), m_dwID(id), m_bSkip(false) {}
CXFA_SAXContext* m_pNode;
Type m_eNode;
const uint32_t m_dwID;
- FX_BOOL m_bSkip;
+ bool m_bSkip;
};
class CFX_SAXFile {
public:
CFX_SAXFile();
- FX_BOOL StartFile(IFX_SeekableReadStream* pFile,
- uint32_t dwStart,
- uint32_t dwLen);
- FX_BOOL ReadNextBlock();
+ bool StartFile(IFX_SeekableReadStream* pFile,
+ uint32_t dwStart,
+ uint32_t dwLen);
+ bool ReadNextBlock();
void Reset();
IFX_SeekableReadStream* m_pFile;
uint32_t m_dwStart;
@@ -102,7 +102,7 @@ class CFX_SAXReader {
void Push();
void Pop();
CFX_SAXItem* GetCurrentItem() const;
- FX_BOOL SkipSpace(uint8_t ch);
+ bool SkipSpace(uint8_t ch);
void SkipNode();
void NotifyData();
void NotifyEnter();
@@ -122,7 +122,7 @@ class CFX_SAXReader {
uint32_t m_dwItemID;
CFX_SaxMode m_eMode;
CFX_SaxMode m_ePrevMode;
- FX_BOOL m_bCharData;
+ bool m_bCharData;
uint8_t m_CurByte;
uint32_t m_dwDataOffset;
CFX_ByteArray m_SkipStack;
diff --git a/xfa/fde/xml/fde_xml.h b/xfa/fde/xml/fde_xml.h
index 3be4020bbc..e773b30851 100644
--- a/xfa/fde/xml/fde_xml.h
+++ b/xfa/fde/xml/fde_xml.h
@@ -40,6 +40,6 @@ struct FDE_XMLNODE {
FDE_XMLNODETYPE eNodeType;
};
-FX_BOOL FDE_IsXMLValidChar(FX_WCHAR ch);
+bool FDE_IsXMLValidChar(FX_WCHAR ch);
#endif // XFA_FDE_XML_FDE_XML_H_
diff --git a/xfa/fde/xml/fde_xml_imp.cpp b/xfa/fde/xml/fde_xml_imp.cpp
index ea4fe97dac..cf145fdb65 100644
--- a/xfa/fde/xml/fde_xml_imp.cpp
+++ b/xfa/fde/xml/fde_xml_imp.cpp
@@ -42,7 +42,7 @@ const FDE_XMLNAMECHAR g_XMLNameChars[] = {
{0xF900, 0xFDCF, true}, {0xFDF0, 0xFFFD, true},
};
-bool FDE_IsXMLNameChar(FX_WCHAR ch, FX_BOOL bFirstChar) {
+bool FDE_IsXMLNameChar(FX_WCHAR ch, bool bFirstChar) {
int32_t iStart = 0;
int32_t iEnd = FX_ArraySize(g_XMLNameChars) - 1;
while (iStart <= iEnd) {
@@ -60,7 +60,7 @@ bool FDE_IsXMLNameChar(FX_WCHAR ch, FX_BOOL bFirstChar) {
} // namespace
-FX_BOOL FDE_IsXMLValidChar(FX_WCHAR ch) {
+bool FDE_IsXMLValidChar(FX_WCHAR ch) {
int32_t iStart = 0;
int32_t iEnd = FX_ArraySize(g_XMLValidCharRange) - 1;
while (iStart <= iEnd) {
@@ -70,10 +70,10 @@ FX_BOOL FDE_IsXMLValidChar(FX_WCHAR ch) {
} else if (ch > g_XMLValidCharRange[iMid][1]) {
iStart = iMid + 1;
} else {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
CFDE_XMLNode::CFDE_XMLNode()
@@ -141,7 +141,7 @@ int32_t CFDE_XMLNode::GetChildNodeIndex(CFDE_XMLNode* pNode) const {
CFDE_XMLNode* CFDE_XMLNode::GetPath(const FX_WCHAR* pPath,
int32_t iLength,
- FX_BOOL bQualifiedName) const {
+ bool bQualifiedName) const {
ASSERT(pPath);
if (iLength < 0) {
iLength = FXSYS_wcslen(pPath);
@@ -303,7 +303,7 @@ CFDE_XMLNode* CFDE_XMLNode::GetNodeItem(CFDE_XMLNode::NodeItem eItem) const {
while (pItem->m_pParent) {
pItem = pItem->m_pParent;
}
- while (TRUE) {
+ while (true) {
while (pItem->m_pNext)
pItem = pItem->m_pNext;
if (!pItem->m_pChild)
@@ -339,8 +339,8 @@ int32_t CFDE_XMLNode::GetNodeLevel() const {
return iLevel;
}
-FX_BOOL CFDE_XMLNode::InsertNodeItem(CFDE_XMLNode::NodeItem eItem,
- CFDE_XMLNode* pNode) {
+bool CFDE_XMLNode::InsertNodeItem(CFDE_XMLNode::NodeItem eItem,
+ CFDE_XMLNode* pNode) {
switch (eItem) {
case CFDE_XMLNode::NextSibling: {
pNode->m_pParent = m_pParent;
@@ -350,7 +350,7 @@ FX_BOOL CFDE_XMLNode::InsertNodeItem(CFDE_XMLNode::NodeItem eItem,
m_pNext->m_pPrior = pNode;
}
m_pNext = pNode;
- return TRUE;
+ return true;
}
case CFDE_XMLNode::PriorSibling: {
pNode->m_pParent = m_pParent;
@@ -362,10 +362,10 @@ FX_BOOL CFDE_XMLNode::InsertNodeItem(CFDE_XMLNode::NodeItem eItem,
m_pParent->m_pChild = pNode;
}
m_pPrior = pNode;
- return TRUE;
+ return true;
}
default:
- return FALSE;
+ return false;
}
}
@@ -390,7 +390,7 @@ CFDE_XMLNode* CFDE_XMLNode::RemoveNodeItem(CFDE_XMLNode::NodeItem eItem) {
return pNode;
}
-CFDE_XMLNode* CFDE_XMLNode::Clone(FX_BOOL bRecursive) {
+CFDE_XMLNode* CFDE_XMLNode::Clone(bool bRecursive) {
return nullptr;
}
@@ -509,11 +509,11 @@ void CFDE_XMLNode::CloneChildren(CFDE_XMLNode* pClone) {
return;
}
CFDE_XMLNode* pNext = m_pChild;
- CFDE_XMLNode* pCloneNext = pNext->Clone(TRUE);
+ CFDE_XMLNode* pCloneNext = pNext->Clone(true);
pClone->InsertChildNode(pCloneNext);
pNext = pNext->m_pNext;
while (pNext) {
- CFDE_XMLNode* pChild = pNext->Clone(TRUE);
+ CFDE_XMLNode* pChild = pNext->Clone(true);
pCloneNext->InsertNodeItem(CFDE_XMLNode::NextSibling, pChild);
pCloneNext = pChild;
pNext = pNext->m_pNext;
@@ -533,7 +533,7 @@ FDE_XMLNODETYPE CFDE_XMLInstruction::GetType() const {
return FDE_XMLNODE_Instruction;
}
-CFDE_XMLNode* CFDE_XMLInstruction::Clone(FX_BOOL bRecursive) {
+CFDE_XMLNode* CFDE_XMLInstruction::Clone(bool bRecursive) {
CFDE_XMLInstruction* pClone = new CFDE_XMLInstruction(m_wsTarget);
if (!pClone) {
return pClone;
@@ -550,30 +550,30 @@ int32_t CFDE_XMLInstruction::CountAttributes() const {
return m_Attributes.GetSize() / 2;
}
-FX_BOOL CFDE_XMLInstruction::GetAttribute(int32_t index,
- CFX_WideString& wsAttriName,
- CFX_WideString& wsAttriValue) const {
+bool CFDE_XMLInstruction::GetAttribute(int32_t index,
+ CFX_WideString& wsAttriName,
+ CFX_WideString& wsAttriValue) const {
int32_t iCount = m_Attributes.GetSize();
ASSERT(index > -1 && index < iCount / 2);
for (int32_t i = 0; i < iCount; i += 2) {
if (index == 0) {
wsAttriName = m_Attributes[i];
wsAttriValue = m_Attributes[i + 1];
- return TRUE;
+ return true;
}
index--;
}
- return FALSE;
+ return false;
}
-FX_BOOL CFDE_XMLInstruction::HasAttribute(const FX_WCHAR* pwsAttriName) const {
+bool CFDE_XMLInstruction::HasAttribute(const FX_WCHAR* pwsAttriName) const {
int32_t iCount = m_Attributes.GetSize();
for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void CFDE_XMLInstruction::GetString(const FX_WCHAR* pwsAttriName,
@@ -655,13 +655,12 @@ int32_t CFDE_XMLInstruction::CountData() const {
return m_TargetData.GetSize();
}
-FX_BOOL CFDE_XMLInstruction::GetData(int32_t index,
- CFX_WideString& wsData) const {
+bool CFDE_XMLInstruction::GetData(int32_t index, CFX_WideString& wsData) const {
if (index < 0 || index >= m_TargetData.GetSize()) {
- return FALSE;
+ return false;
}
wsData = m_TargetData[index];
- return TRUE;
+ return true;
}
void CFDE_XMLInstruction::AppendData(const CFX_WideString& wsData) {
@@ -691,7 +690,7 @@ FDE_XMLNODETYPE CFDE_XMLElement::GetType() const {
return FDE_XMLNODE_Element;
}
-CFDE_XMLNode* CFDE_XMLElement::Clone(FX_BOOL bRecursive) {
+CFDE_XMLNode* CFDE_XMLElement::Clone(bool bRecursive) {
CFDE_XMLElement* pClone = new CFDE_XMLElement(m_wsTag);
if (!pClone) {
return nullptr;
@@ -766,30 +765,30 @@ int32_t CFDE_XMLElement::CountAttributes() const {
return m_Attributes.GetSize() / 2;
}
-FX_BOOL CFDE_XMLElement::GetAttribute(int32_t index,
- CFX_WideString& wsAttriName,
- CFX_WideString& wsAttriValue) const {
+bool CFDE_XMLElement::GetAttribute(int32_t index,
+ CFX_WideString& wsAttriName,
+ CFX_WideString& wsAttriValue) const {
int32_t iCount = m_Attributes.GetSize();
ASSERT(index > -1 && index < iCount / 2);
for (int32_t i = 0; i < iCount; i += 2) {
if (index == 0) {
wsAttriName = m_Attributes[i];
wsAttriValue = m_Attributes[i + 1];
- return TRUE;
+ return true;
}
index--;
}
- return FALSE;
+ return false;
}
-FX_BOOL CFDE_XMLElement::HasAttribute(const FX_WCHAR* pwsAttriName) const {
+bool CFDE_XMLElement::HasAttribute(const FX_WCHAR* pwsAttriName) const {
int32_t iCount = m_Attributes.GetSize();
for (int32_t i = 0; i < iCount; i += 2) {
if (m_Attributes[i].Compare(pwsAttriName) == 0) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void CFDE_XMLElement::GetString(const FX_WCHAR* pwsAttriName,
@@ -904,7 +903,7 @@ FDE_XMLNODETYPE CFDE_XMLText::GetType() const {
return FDE_XMLNODE_Text;
}
-CFDE_XMLNode* CFDE_XMLText::Clone(FX_BOOL bRecursive) {
+CFDE_XMLNode* CFDE_XMLText::Clone(bool bRecursive) {
CFDE_XMLText* pClone = new CFDE_XMLText(m_wsText);
return pClone;
}
@@ -922,7 +921,7 @@ FDE_XMLNODETYPE CFDE_XMLCharData::GetType() const {
return FDE_XMLNODE_CharData;
}
-CFDE_XMLNode* CFDE_XMLCharData::Clone(FX_BOOL bRecursive) {
+CFDE_XMLNode* CFDE_XMLCharData::Clone(bool bRecursive) {
CFDE_XMLCharData* pClone = new CFDE_XMLCharData(m_wsCharData);
return pClone;
}
@@ -931,16 +930,16 @@ CFDE_XMLCharData::~CFDE_XMLCharData() {}
CFDE_XMLDoc::CFDE_XMLDoc()
: m_pRoot(nullptr), m_pSyntaxParser(nullptr), m_pXMLParser(nullptr) {
- Reset(TRUE);
+ Reset(true);
CFDE_XMLInstruction* pXML = new CFDE_XMLInstruction(L"xml");
m_pRoot->InsertChildNode(pXML);
}
CFDE_XMLDoc::~CFDE_XMLDoc() {
- Reset(FALSE);
+ Reset(false);
}
-void CFDE_XMLDoc::Reset(FX_BOOL bInitRoot) {
+void CFDE_XMLDoc::Reset(bool bInitRoot) {
m_iStatus = 0;
m_pStream = nullptr;
if (bInitRoot) {
@@ -968,11 +967,11 @@ void CFDE_XMLDoc::ReleaseParser() {
}
}
-FX_BOOL CFDE_XMLDoc::LoadXML(CFDE_XMLParser* pXMLParser) {
+bool CFDE_XMLDoc::LoadXML(CFDE_XMLParser* pXMLParser) {
if (!pXMLParser)
- return FALSE;
+ return false;
- Reset(TRUE);
+ Reset(true);
m_pXMLParser = pXMLParser;
return !!m_pXMLParser;
}
@@ -1097,7 +1096,7 @@ void CFDE_XMLDoc::SaveXMLNode(IFX_Stream* pXMLStream, CFDE_XMLNode* pINode) {
}
}
-void CFDE_XMLDoc::SaveXML(IFX_Stream* pXMLStream, FX_BOOL bSaveBOM) {
+void CFDE_XMLDoc::SaveXML(IFX_Stream* pXMLStream, bool bSaveBOM) {
if (!pXMLStream || pXMLStream == m_pStream) {
m_pStream->Seek(FX_STREAMSEEK_Begin, 0);
pXMLStream = m_pStream;
@@ -1150,14 +1149,14 @@ FX_WCHAR* CFDE_BlockBuffer::GetAvailableBlock(int32_t& iIndexInBlock) {
return m_BlockArray[iRealIndex / m_iAllocStep];
}
-FX_BOOL CFDE_BlockBuffer::InitBuffer(int32_t iBufferSize) {
+bool CFDE_BlockBuffer::InitBuffer(int32_t iBufferSize) {
ClearBuffer();
int32_t iNumOfBlock = (iBufferSize - 1) / m_iAllocStep + 1;
for (int32_t i = 0; i < iNumOfBlock; i++) {
m_BlockArray.Add(FX_Alloc(FX_WCHAR, m_iAllocStep));
}
m_iBufferSize = iNumOfBlock * m_iAllocStep;
- return TRUE;
+ return true;
}
void CFDE_BlockBuffer::SetTextChar(int32_t iIndex, FX_WCHAR ch) {
@@ -1183,12 +1182,12 @@ void CFDE_BlockBuffer::SetTextChar(int32_t iIndex, FX_WCHAR ch) {
}
}
-int32_t CFDE_BlockBuffer::DeleteTextChars(int32_t iCount, FX_BOOL bDirection) {
+int32_t CFDE_BlockBuffer::DeleteTextChars(int32_t iCount, bool bDirection) {
if (iCount <= 0) {
return m_iDataLength;
}
if (iCount >= m_iDataLength) {
- Reset(FALSE);
+ Reset(false);
return 0;
}
if (bDirection) {
@@ -1271,7 +1270,7 @@ CFDE_XMLSyntaxParser::CFDE_XMLSyntaxParser()
m_iParsedBytes(0),
m_pBuffer(nullptr),
m_iBufferChars(0),
- m_bEOS(FALSE),
+ m_bEOS(false),
m_pStart(nullptr),
m_pEnd(nullptr),
m_XMLNodeStack(16),
@@ -1328,7 +1327,7 @@ FDE_XmlSyntaxResult CFDE_XMLSyntaxParser::DoSyntaxParse() {
int32_t iPos;
FDE_XmlSyntaxResult syntaxParserResult = FDE_XmlSyntaxResult::None;
- while (TRUE) {
+ while (true) {
if (m_pStart >= m_pEnd) {
if (m_bEOS || m_iCurrentPos >= iStreamLength) {
m_syntaxParserResult = FDE_XmlSyntaxResult::EndOfString;
@@ -1906,7 +1905,7 @@ void CFDE_XMLSyntaxParser::ParseTextChar(FX_WCHAR character) {
}
}
}
- m_BlockBuffer.DeleteTextChars(m_iDataLength - m_iEntityStart, FALSE);
+ m_BlockBuffer.DeleteTextChars(m_iDataLength - m_iEntityStart, false);
m_pCurrentBlock = m_BlockBuffer.GetAvailableBlock(m_iIndexInBlock);
m_iEntityStart = -1;
} else {
diff --git a/xfa/fde/xml/fde_xml_imp.h b/xfa/fde/xml/fde_xml_imp.h
index 2ce95a0f41..1119ef2ff5 100644
--- a/xfa/fde/xml/fde_xml_imp.h
+++ b/xfa/fde/xml/fde_xml_imp.h
@@ -44,7 +44,7 @@ class CFDE_XMLNode : public CFX_Target {
virtual void Release();
virtual FDE_XMLNODETYPE GetType() const;
- virtual CFDE_XMLNode* Clone(FX_BOOL bRecursive);
+ virtual CFDE_XMLNode* Clone(bool bRecursive);
int32_t CountChildNodes() const;
CFDE_XMLNode* GetChildNode(int32_t index) const;
@@ -56,11 +56,11 @@ class CFDE_XMLNode : public CFX_Target {
CFDE_XMLNode* GetPath(const FX_WCHAR* pPath,
int32_t iLength = -1,
- FX_BOOL bQualifiedName = TRUE) const;
+ bool bQualifiedName = true) const;
int32_t GetNodeLevel() const;
CFDE_XMLNode* GetNodeItem(CFDE_XMLNode::NodeItem eItem) const;
- FX_BOOL InsertNodeItem(CFDE_XMLNode::NodeItem eItem, CFDE_XMLNode* pNode);
+ bool InsertNodeItem(CFDE_XMLNode::NodeItem eItem, CFDE_XMLNode* pNode);
CFDE_XMLNode* RemoveNodeItem(CFDE_XMLNode::NodeItem eItem);
void SaveXMLNode(IFX_Stream* pXMLStream);
@@ -79,14 +79,14 @@ class CFDE_XMLInstruction : public CFDE_XMLNode {
// CFDE_XMLNode
void Release() override;
FDE_XMLNODETYPE GetType() const override;
- CFDE_XMLNode* Clone(FX_BOOL bRecursive) override;
+ CFDE_XMLNode* Clone(bool bRecursive) override;
void GetTargetName(CFX_WideString& wsTarget) const { wsTarget = m_wsTarget; }
int32_t CountAttributes() const;
- FX_BOOL GetAttribute(int32_t index,
- CFX_WideString& wsAttriName,
- CFX_WideString& wsAttriValue) const;
- FX_BOOL HasAttribute(const FX_WCHAR* pwsAttriName) const;
+ bool GetAttribute(int32_t index,
+ CFX_WideString& wsAttriName,
+ CFX_WideString& wsAttriValue) const;
+ bool HasAttribute(const FX_WCHAR* pwsAttriName) const;
void GetString(const FX_WCHAR* pwsAttriName,
CFX_WideString& wsAttriValue,
const FX_WCHAR* pwsDefValue = nullptr) const;
@@ -98,7 +98,7 @@ class CFDE_XMLInstruction : public CFDE_XMLNode {
void SetFloat(const FX_WCHAR* pwsAttriName, FX_FLOAT fAttriValue);
void RemoveAttribute(const FX_WCHAR* pwsAttriName);
int32_t CountData() const;
- FX_BOOL GetData(int32_t index, CFX_WideString& wsData) const;
+ bool GetData(int32_t index, CFX_WideString& wsData) const;
void AppendData(const CFX_WideString& wsData);
void RemoveData(int32_t index);
@@ -115,7 +115,7 @@ class CFDE_XMLElement : public CFDE_XMLNode {
// CFDE_XMLNode
void Release() override;
FDE_XMLNODETYPE GetType() const override;
- CFDE_XMLNode* Clone(FX_BOOL bRecursive) override;
+ CFDE_XMLNode* Clone(bool bRecursive) override;
void GetTagName(CFX_WideString& wsTag) const;
void GetLocalTagName(CFX_WideString& wsTag) const;
@@ -124,10 +124,10 @@ class CFDE_XMLElement : public CFDE_XMLNode {
void GetNamespaceURI(CFX_WideString& wsNamespace) const;
int32_t CountAttributes() const;
- FX_BOOL GetAttribute(int32_t index,
- CFX_WideString& wsAttriName,
- CFX_WideString& wsAttriValue) const;
- FX_BOOL HasAttribute(const FX_WCHAR* pwsAttriName) const;
+ bool GetAttribute(int32_t index,
+ CFX_WideString& wsAttriName,
+ CFX_WideString& wsAttriValue) const;
+ bool HasAttribute(const FX_WCHAR* pwsAttriName) const;
void RemoveAttribute(const FX_WCHAR* pwsAttriName);
void GetString(const FX_WCHAR* pwsAttriName,
@@ -157,7 +157,7 @@ class CFDE_XMLText : public CFDE_XMLNode {
// CFDE_XMLNode
void Release() override;
FDE_XMLNODETYPE GetType() const override;
- CFDE_XMLNode* Clone(FX_BOOL bRecursive) override;
+ CFDE_XMLNode* Clone(bool bRecursive) override;
void GetText(CFX_WideString& wsText) const { wsText = m_wsText; }
void SetText(const CFX_WideString& wsText) { m_wsText = wsText; }
@@ -178,7 +178,7 @@ class CFDE_XMLCharData : public CFDE_XMLDeclaration {
void Release() override;
FDE_XMLNODETYPE GetType() const override;
- CFDE_XMLNode* Clone(FX_BOOL bRecursive) override;
+ CFDE_XMLNode* Clone(bool bRecursive) override;
void GetCharData(CFX_WideString& wsCharData) const {
wsCharData = m_wsCharData;
@@ -193,15 +193,15 @@ class CFDE_XMLDoc : public CFX_Target {
CFDE_XMLDoc();
~CFDE_XMLDoc() override;
- FX_BOOL LoadXML(CFDE_XMLParser* pXMLParser);
+ bool LoadXML(CFDE_XMLParser* pXMLParser);
int32_t DoLoad(IFX_Pause* pPause = nullptr);
void CloseXML();
CFDE_XMLNode* GetRoot() const { return m_pRoot; }
- void SaveXML(IFX_Stream* pXMLStream = nullptr, FX_BOOL bSaveBOM = TRUE);
+ void SaveXML(IFX_Stream* pXMLStream = nullptr, bool bSaveBOM = true);
void SaveXMLNode(IFX_Stream* pXMLStream, CFDE_XMLNode* pNode);
protected:
- void Reset(FX_BOOL bInitRoot);
+ void Reset(bool bInitRoot);
void ReleaseParser();
IFX_Stream* m_pStream;
@@ -224,20 +224,20 @@ class CFDE_BlockBuffer : public CFX_Target {
explicit CFDE_BlockBuffer(int32_t iAllocStep = 1024 * 1024);
~CFDE_BlockBuffer() override;
- FX_BOOL InitBuffer(int32_t iBufferSize = 1024 * 1024);
- FX_BOOL IsInitialized() { return m_iBufferSize / m_iAllocStep >= 1; }
+ bool InitBuffer(int32_t iBufferSize = 1024 * 1024);
+ bool IsInitialized() { return m_iBufferSize / m_iAllocStep >= 1; }
void ReleaseBuffer() { delete this; }
FX_WCHAR* GetAvailableBlock(int32_t& iIndexInBlock);
inline int32_t GetAllocStep() const { return m_iAllocStep; }
inline int32_t& GetDataLengthRef() { return m_iDataLength; }
- inline void Reset(FX_BOOL bReserveData = TRUE) {
+ inline void Reset(bool bReserveData = true) {
if (!bReserveData) {
m_iStartPosition = 0;
}
m_iDataLength = 0;
}
void SetTextChar(int32_t iIndex, FX_WCHAR ch);
- int32_t DeleteTextChars(int32_t iCount, FX_BOOL bDirection = TRUE);
+ int32_t DeleteTextChars(int32_t iCount, bool bDirection = true);
void GetTextData(CFX_WideString& wsTextData,
int32_t iStart = 0,
int32_t iLength = -1) const;
@@ -329,7 +329,7 @@ class CFDE_XMLSyntaxParser : public CFX_Target {
int32_t m_iParsedBytes;
FX_WCHAR* m_pBuffer;
int32_t m_iBufferChars;
- FX_BOOL m_bEOS;
+ bool m_bEOS;
FX_WCHAR* m_pStart;
FX_WCHAR* m_pEnd;
FDE_XMLNODE m_CurNode;
diff --git a/xfa/fgas/crt/fgas_codepage.cpp b/xfa/fgas/crt/fgas_codepage.cpp
index 86aeb7b983..36f87a36f3 100644
--- a/xfa/fgas/crt/fgas_codepage.cpp
+++ b/xfa/fgas/crt/fgas_codepage.cpp
@@ -380,7 +380,7 @@ int32_t FX_DecodeString(uint16_t wCodePage,
int32_t* pSrcLen,
FX_WCHAR* pDst,
int32_t* pDstLen,
- FX_BOOL bErrBreak) {
+ bool bErrBreak) {
if (wCodePage == FX_CODEPAGE_UTF8) {
return FX_UTF8Decode(pSrc, pSrcLen, pDst, pDstLen);
}
@@ -399,7 +399,7 @@ int32_t FX_UTF8Decode(const FX_CHAR* pSrc,
return 1;
}
int32_t iDstLen = *pDstLen;
- FX_BOOL bValidDst = (pDst && iDstLen > 0);
+ bool bValidDst = (pDst && iDstLen > 0);
uint32_t dwCode = 0;
int32_t iPending = 0;
int32_t iSrcNum = 0, iDstNum = 0;
diff --git a/xfa/fgas/crt/fgas_codepage.h b/xfa/fgas/crt/fgas_codepage.h
index 2beed27552..780c20e233 100644
--- a/xfa/fgas/crt/fgas_codepage.h
+++ b/xfa/fgas/crt/fgas_codepage.h
@@ -144,7 +144,7 @@ int32_t FX_DecodeString(uint16_t wCodePage,
int32_t* pSrcLen,
FX_WCHAR* pDst,
int32_t* pDstLen,
- FX_BOOL bErrBreak);
+ bool bErrBreak);
int32_t FX_UTF8Decode(const FX_CHAR* pSrc,
int32_t* pSrcLen,
FX_WCHAR* pDst,
diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/fgas_stream.cpp
index 6da4e9ed8c..c3850c00bb 100644
--- a/xfa/fgas/crt/fgas_stream.cpp
+++ b/xfa/fgas/crt/fgas_stream.cpp
@@ -25,15 +25,15 @@ class IFX_StreamImp {
virtual int32_t GetLength() const = 0;
virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0;
virtual int32_t GetPosition() = 0;
- virtual FX_BOOL IsEOF() const = 0;
+ virtual bool IsEOF() const = 0;
virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) = 0;
virtual int32_t ReadString(FX_WCHAR* pStr,
int32_t iMaxLength,
- FX_BOOL& bEOS) = 0;
+ bool& bEOS) = 0;
virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) = 0;
virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) = 0;
virtual void Flush() = 0;
- virtual FX_BOOL SetLength(int32_t iLength) = 0;
+ virtual bool SetLength(int32_t iLength) = 0;
protected:
IFX_StreamImp();
@@ -50,21 +50,19 @@ class CFX_FileStreamImp : public IFX_StreamImp {
CFX_FileStreamImp();
~CFX_FileStreamImp() override;
- FX_BOOL LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess);
+ bool LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess);
// IFX_StreamImp:
int32_t GetLength() const override;
int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override;
int32_t GetPosition() override;
- FX_BOOL IsEOF() const override;
+ bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS) override;
+ int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override;
int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override;
void Flush() override;
- FX_BOOL SetLength(int32_t iLength) override;
+ bool SetLength(int32_t iLength) override;
protected:
FXSYS_FILE* m_hFile;
@@ -76,21 +74,19 @@ class CFX_BufferStreamImp : public IFX_StreamImp {
CFX_BufferStreamImp();
~CFX_BufferStreamImp() override {}
- FX_BOOL LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess);
+ bool LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess);
// IFX_StreamImp:
int32_t GetLength() const override;
int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override;
int32_t GetPosition() override;
- FX_BOOL IsEOF() const override;
+ bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS) override;
+ int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override;
int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override;
void Flush() override {}
- FX_BOOL SetLength(int32_t iLength) override { return FALSE; }
+ bool SetLength(int32_t iLength) override { return false; }
protected:
uint8_t* m_pData;
@@ -104,17 +100,15 @@ class CFX_FileReadStreamImp : public IFX_StreamImp {
CFX_FileReadStreamImp();
~CFX_FileReadStreamImp() override {}
- FX_BOOL LoadFileRead(IFX_SeekableReadStream* pFileRead, uint32_t dwAccess);
+ bool LoadFileRead(IFX_SeekableReadStream* pFileRead, uint32_t dwAccess);
// IFX_StreamImp:
int32_t GetLength() const override;
int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override;
int32_t GetPosition() override { return m_iPosition; }
- FX_BOOL IsEOF() const override;
+ bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS) override;
+ int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override {
return 0;
}
@@ -122,7 +116,7 @@ class CFX_FileReadStreamImp : public IFX_StreamImp {
return 0;
}
void Flush() override {}
- FX_BOOL SetLength(int32_t iLength) override { return FALSE; }
+ bool SetLength(int32_t iLength) override { return false; }
protected:
IFX_SeekableReadStream* m_pFileRead;
@@ -135,20 +129,18 @@ class CFX_BufferReadStreamImp : public IFX_StreamImp {
CFX_BufferReadStreamImp();
~CFX_BufferReadStreamImp() override;
- FX_BOOL LoadBufferRead(IFX_BufferRead* pBufferRead,
- int32_t iFileSize,
- uint32_t dwAccess,
- FX_BOOL bReleaseBufferRead);
+ bool LoadBufferRead(IFX_BufferRead* pBufferRead,
+ int32_t iFileSize,
+ uint32_t dwAccess,
+ bool bReleaseBufferRead);
// IFX_StreamImp:
int32_t GetLength() const override;
int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override;
int32_t GetPosition() override { return m_iPosition; }
- FX_BOOL IsEOF() const override;
+ bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS) override;
+ int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override {
return 0;
}
@@ -156,11 +148,11 @@ class CFX_BufferReadStreamImp : public IFX_StreamImp {
return 0;
}
void Flush() override {}
- FX_BOOL SetLength(int32_t iLength) override { return FALSE; }
+ bool SetLength(int32_t iLength) override { return false; }
private:
IFX_BufferRead* m_pBufferRead;
- FX_BOOL m_bReleaseBufferRead;
+ bool m_bReleaseBufferRead;
int32_t m_iPosition;
int32_t m_iBufferSize;
};
@@ -170,23 +162,21 @@ class CFX_FileWriteStreamImp : public IFX_StreamImp {
CFX_FileWriteStreamImp();
~CFX_FileWriteStreamImp() override {}
- FX_BOOL LoadFileWrite(IFX_SeekableWriteStream* pFileWrite, uint32_t dwAccess);
+ bool LoadFileWrite(IFX_SeekableWriteStream* pFileWrite, uint32_t dwAccess);
// IFX_StreamImp:
int32_t GetLength() const override;
int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override;
int32_t GetPosition() override { return m_iPosition; }
- FX_BOOL IsEOF() const override;
+ bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override { return 0; }
- int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS) override {
+ int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override {
return 0;
}
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override;
int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override;
void Flush() override;
- FX_BOOL SetLength(int32_t iLength) override { return FALSE; }
+ bool SetLength(int32_t iLength) override { return false; }
protected:
IFX_SeekableWriteStream* m_pFileWrite;
@@ -206,14 +196,14 @@ class CFX_Stream : public IFX_Stream {
CFX_Stream();
~CFX_Stream() override;
- FX_BOOL LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess);
- FX_BOOL LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess);
- FX_BOOL LoadFileRead(IFX_SeekableReadStream* pFileRead, uint32_t dwAccess);
- FX_BOOL LoadFileWrite(IFX_SeekableWriteStream* pFileWrite, uint32_t dwAccess);
- FX_BOOL LoadBufferRead(IFX_BufferRead* pBufferRead,
- int32_t iFileSize,
- uint32_t dwAccess,
- FX_BOOL bReleaseBufferRead);
+ bool LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess);
+ bool LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess);
+ bool LoadFileRead(IFX_SeekableReadStream* pFileRead, uint32_t dwAccess);
+ bool LoadFileWrite(IFX_SeekableWriteStream* pFileWrite, uint32_t dwAccess);
+ bool LoadBufferRead(IFX_BufferRead* pBufferRead,
+ int32_t iFileSize,
+ uint32_t dwAccess,
+ bool bReleaseBufferRead);
// IFX_Stream
void Release() override;
@@ -222,15 +212,13 @@ class CFX_Stream : public IFX_Stream {
int32_t GetLength() const override;
int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override;
int32_t GetPosition() override;
- FX_BOOL IsEOF() const override;
+ bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS) override;
+ int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override;
int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override;
void Flush() override;
- FX_BOOL SetLength(int32_t iLength) override;
+ bool SetLength(int32_t iLength) override;
int32_t GetBOM(uint8_t bom[4]) const override;
uint16_t GetCodePage() const override;
uint16_t SetCodePage(uint16_t wCodePage) override;
@@ -251,7 +239,7 @@ class CFX_Stream : public IFX_Stream {
class CFX_TextStream : public IFX_Stream {
public:
- CFX_TextStream(IFX_Stream* pStream, FX_BOOL bDelStream);
+ CFX_TextStream(IFX_Stream* pStream, bool bDelStream);
~CFX_TextStream() override;
// IFX_Stream
@@ -261,15 +249,13 @@ class CFX_TextStream : public IFX_Stream {
int32_t GetLength() const override;
int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override;
int32_t GetPosition() override;
- FX_BOOL IsEOF() const override;
+ bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS) override;
+ int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override;
int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override;
void Flush() override;
- FX_BOOL SetLength(int32_t iLength) override;
+ bool SetLength(int32_t iLength) override;
int32_t GetBOM(uint8_t bom[4]) const override;
uint16_t GetCodePage() const override;
uint16_t SetCodePage(uint16_t wCodePage) override;
@@ -283,7 +269,7 @@ class CFX_TextStream : public IFX_Stream {
uint32_t m_dwBOM;
uint8_t* m_pBuf;
int32_t m_iBufSize;
- FX_BOOL m_bDelStream;
+ bool m_bDelStream;
IFX_Stream* m_pStreamImp;
int32_t m_iRefCount;
void InitStream();
@@ -317,7 +303,7 @@ int32_t FileLength(FXSYS_FILE* file) {
#endif
}
-FX_BOOL FileSetSize(FXSYS_FILE* file, int32_t size) {
+bool FileSetSize(FXSYS_FILE* file, int32_t size) {
ASSERT(file);
#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
return _chsize(_fileno(file), size) == 0;
@@ -325,11 +311,11 @@ FX_BOOL FileSetSize(FXSYS_FILE* file, int32_t size) {
HANDLE hFile = _fileno(file);
uint32_t dwPos = ::SetFilePointer(hFile, 0, 0, FILE_CURRENT);
::SetFilePointer(hFile, size, 0, FILE_BEGIN);
- FX_BOOL bRet = ::SetEndOfFile(hFile);
+ bool bRet = ::SetEndOfFile(hFile);
::SetFilePointer(hFile, (int32_t)dwPos, 0, FILE_BEGIN);
return bRet;
#else
- return FALSE;
+ return false;
#endif
}
@@ -344,7 +330,7 @@ IFX_Stream* IFX_Stream::CreateStream(IFX_SeekableReadStream* pFileRead,
return nullptr;
}
if (dwAccess & FX_STREAMACCESS_Text) {
- return new CFX_TextStream(pSR, TRUE);
+ return new CFX_TextStream(pSR, true);
}
return pSR;
}
@@ -358,7 +344,7 @@ IFX_Stream* IFX_Stream::CreateStream(IFX_SeekableWriteStream* pFileWrite,
return nullptr;
}
if (dwAccess & FX_STREAMACCESS_Text) {
- return new CFX_TextStream(pSR, TRUE);
+ return new CFX_TextStream(pSR, true);
}
return pSR;
}
@@ -373,7 +359,7 @@ IFX_Stream* IFX_Stream::CreateStream(uint8_t* pData,
return nullptr;
}
if (dwAccess & FX_STREAMACCESS_Text) {
- return new CFX_TextStream(pSR, TRUE);
+ return new CFX_TextStream(pSR, true);
}
return pSR;
}
@@ -387,8 +373,8 @@ CFX_FileStreamImp::~CFX_FileStreamImp() {
FXSYS_fclose(m_hFile);
}
-FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName,
- uint32_t dwAccess) {
+bool CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName,
+ uint32_t dwAccess) {
ASSERT(!m_hFile);
ASSERT(pszSrcFileName && FXSYS_wcslen(pszSrcFileName) > 0);
#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || \
@@ -415,13 +401,13 @@ FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName,
if (!m_hFile) {
m_hFile = FXSYS_wfopen(pszSrcFileName, L"r+b");
if (!m_hFile)
- return FALSE;
+ return false;
if (dwAccess & FX_STREAMACCESS_Truncate)
FileSetSize(m_hFile, 0);
}
} else {
- return FALSE;
+ return false;
}
}
#else
@@ -445,14 +431,14 @@ FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName,
if (!m_hFile) {
m_hFile = FXSYS_fopen(szFileName.c_str(), "r+b");
if (!m_hFile) {
- return FALSE;
+ return false;
}
if (dwAccess & FX_STREAMACCESS_Truncate) {
FileSetSize(m_hFile, 0);
}
}
} else {
- return FALSE;
+ return false;
}
}
#endif
@@ -463,7 +449,7 @@ FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName,
} else {
m_iLength = FileLength(m_hFile);
}
- return TRUE;
+ return true;
}
int32_t CFX_FileStreamImp::GetLength() const {
ASSERT(m_hFile);
@@ -478,7 +464,7 @@ int32_t CFX_FileStreamImp::GetPosition() {
ASSERT(m_hFile);
return FXSYS_ftell(m_hFile);
}
-FX_BOOL CFX_FileStreamImp::IsEOF() const {
+bool CFX_FileStreamImp::IsEOF() const {
ASSERT(m_hFile);
return FXSYS_ftell(m_hFile) >= m_iLength;
}
@@ -489,7 +475,7 @@ int32_t CFX_FileStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) {
}
int32_t CFX_FileStreamImp::ReadString(FX_WCHAR* pStr,
int32_t iMaxLength,
- FX_BOOL& bEOS) {
+ bool& bEOS) {
ASSERT(m_hFile);
ASSERT(pStr && iMaxLength > 0);
if (m_iLength <= 0) {
@@ -541,23 +527,23 @@ void CFX_FileStreamImp::Flush() {
ASSERT(m_hFile && (GetAccessModes() & FX_STREAMACCESS_Write) != 0);
FXSYS_fflush(m_hFile);
}
-FX_BOOL CFX_FileStreamImp::SetLength(int32_t iLength) {
+bool CFX_FileStreamImp::SetLength(int32_t iLength) {
ASSERT(m_hFile && (GetAccessModes() & FX_STREAMACCESS_Write) != 0);
- FX_BOOL bRet = FileSetSize(m_hFile, iLength);
+ bool bRet = FileSetSize(m_hFile, iLength);
m_iLength = FileLength(m_hFile);
return bRet;
}
CFX_FileReadStreamImp::CFX_FileReadStreamImp()
: m_pFileRead(nullptr), m_iPosition(0), m_iLength(0) {}
-FX_BOOL CFX_FileReadStreamImp::LoadFileRead(IFX_SeekableReadStream* pFileRead,
- uint32_t dwAccess) {
+bool CFX_FileReadStreamImp::LoadFileRead(IFX_SeekableReadStream* pFileRead,
+ uint32_t dwAccess) {
ASSERT(!m_pFileRead && pFileRead);
if (dwAccess & FX_STREAMACCESS_Write) {
- return FALSE;
+ return false;
}
m_pFileRead = pFileRead;
m_iLength = m_pFileRead->GetSize();
- return TRUE;
+ return true;
}
int32_t CFX_FileReadStreamImp::GetLength() const {
return m_iLength;
@@ -581,7 +567,7 @@ int32_t CFX_FileReadStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) {
}
return m_iPosition;
}
-FX_BOOL CFX_FileReadStreamImp::IsEOF() const {
+bool CFX_FileReadStreamImp::IsEOF() const {
return m_iPosition >= m_iLength;
}
int32_t CFX_FileReadStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) {
@@ -598,7 +584,7 @@ int32_t CFX_FileReadStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) {
}
int32_t CFX_FileReadStreamImp::ReadString(FX_WCHAR* pStr,
int32_t iMaxLength,
- FX_BOOL& bEOS) {
+ bool& bEOS) {
ASSERT(m_pFileRead);
ASSERT(pStr && iMaxLength > 0);
iMaxLength = ReadData((uint8_t*)pStr, iMaxLength * 2) / 2;
@@ -614,7 +600,7 @@ int32_t CFX_FileReadStreamImp::ReadString(FX_WCHAR* pStr,
}
CFX_BufferReadStreamImp::CFX_BufferReadStreamImp()
: m_pBufferRead(nullptr),
- m_bReleaseBufferRead(FALSE),
+ m_bReleaseBufferRead(false),
m_iPosition(0),
m_iBufferSize(0) {}
CFX_BufferReadStreamImp::~CFX_BufferReadStreamImp() {
@@ -622,29 +608,29 @@ CFX_BufferReadStreamImp::~CFX_BufferReadStreamImp() {
m_pBufferRead->Release();
}
}
-FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead* pBufferRead,
- int32_t iFileSize,
- uint32_t dwAccess,
- FX_BOOL bReleaseBufferRead) {
+bool CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead* pBufferRead,
+ int32_t iFileSize,
+ uint32_t dwAccess,
+ bool bReleaseBufferRead) {
ASSERT(!m_pBufferRead && pBufferRead);
if (dwAccess & FX_STREAMACCESS_Write) {
- return FALSE;
+ return false;
}
m_bReleaseBufferRead = bReleaseBufferRead;
m_pBufferRead = pBufferRead;
m_iBufferSize = iFileSize;
if (m_iBufferSize >= 0) {
- return TRUE;
+ return true;
}
- if (!m_pBufferRead->ReadNextBlock(TRUE)) {
- return FALSE;
+ if (!m_pBufferRead->ReadNextBlock(true)) {
+ return false;
}
m_iBufferSize = m_pBufferRead->GetBlockSize();
while (!m_pBufferRead->IsEOF()) {
- m_pBufferRead->ReadNextBlock(FALSE);
+ m_pBufferRead->ReadNextBlock(false);
m_iBufferSize += m_pBufferRead->GetBlockSize();
}
- return TRUE;
+ return true;
}
int32_t CFX_BufferReadStreamImp::GetLength() const {
return m_iBufferSize;
@@ -669,8 +655,8 @@ int32_t CFX_BufferReadStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) {
}
return m_iPosition;
}
-FX_BOOL CFX_BufferReadStreamImp::IsEOF() const {
- return m_pBufferRead ? m_pBufferRead->IsEOF() : TRUE;
+bool CFX_BufferReadStreamImp::IsEOF() const {
+ return m_pBufferRead ? m_pBufferRead->IsEOF() : true;
}
int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer,
int32_t iBufferSize) {
@@ -686,7 +672,7 @@ int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer,
uint32_t dwBlockOffset = m_pBufferRead->GetBlockOffset();
uint32_t dwBlockSize = m_pBufferRead->GetBlockSize();
if (m_iPosition < (int32_t)dwBlockOffset) {
- if (!m_pBufferRead->ReadNextBlock(TRUE)) {
+ if (!m_pBufferRead->ReadNextBlock(true)) {
return 0;
}
dwBlockOffset = m_pBufferRead->GetBlockOffset();
@@ -694,7 +680,7 @@ int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer,
}
while (m_iPosition < (int32_t)dwBlockOffset ||
m_iPosition >= (int32_t)(dwBlockOffset + dwBlockSize)) {
- if (m_pBufferRead->IsEOF() || !m_pBufferRead->ReadNextBlock(FALSE)) {
+ if (m_pBufferRead->IsEOF() || !m_pBufferRead->ReadNextBlock(false)) {
break;
}
dwBlockOffset = m_pBufferRead->GetBlockOffset();
@@ -712,7 +698,7 @@ int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer,
dwOffsetTmp = dwCopySize;
iBufferSize -= dwCopySize;
while (iBufferSize > 0) {
- if (!m_pBufferRead->ReadNextBlock(FALSE)) {
+ if (!m_pBufferRead->ReadNextBlock(false)) {
break;
}
dwBlockOffset = m_pBufferRead->GetBlockOffset();
@@ -728,7 +714,7 @@ int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer,
}
int32_t CFX_BufferReadStreamImp::ReadString(FX_WCHAR* pStr,
int32_t iMaxLength,
- FX_BOOL& bEOS) {
+ bool& bEOS) {
ASSERT(m_pBufferRead);
ASSERT(pStr && iMaxLength > 0);
iMaxLength = ReadData((uint8_t*)pStr, iMaxLength * 2) / 2;
@@ -744,18 +730,17 @@ int32_t CFX_BufferReadStreamImp::ReadString(FX_WCHAR* pStr,
}
CFX_FileWriteStreamImp::CFX_FileWriteStreamImp()
: m_pFileWrite(nullptr), m_iPosition(0) {}
-FX_BOOL CFX_FileWriteStreamImp::LoadFileWrite(
- IFX_SeekableWriteStream* pFileWrite,
- uint32_t dwAccess) {
+bool CFX_FileWriteStreamImp::LoadFileWrite(IFX_SeekableWriteStream* pFileWrite,
+ uint32_t dwAccess) {
ASSERT(!m_pFileWrite && pFileWrite);
if (dwAccess & FX_STREAMACCESS_Read) {
- return FALSE;
+ return false;
}
if (dwAccess & FX_STREAMACCESS_Append) {
m_iPosition = pFileWrite->GetSize();
}
m_pFileWrite = pFileWrite;
- return TRUE;
+ return true;
}
int32_t CFX_FileWriteStreamImp::GetLength() const {
if (!m_pFileWrite) {
@@ -783,7 +768,7 @@ int32_t CFX_FileWriteStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) {
}
return m_iPosition;
}
-FX_BOOL CFX_FileWriteStreamImp::IsEOF() const {
+bool CFX_FileWriteStreamImp::IsEOF() const {
return m_iPosition >= GetLength();
}
int32_t CFX_FileWriteStreamImp::WriteData(const uint8_t* pBuffer,
@@ -808,16 +793,16 @@ void CFX_FileWriteStreamImp::Flush() {
CFX_BufferStreamImp::CFX_BufferStreamImp()
: m_pData(nullptr), m_iTotalSize(0), m_iPosition(0), m_iLength(0) {}
-FX_BOOL CFX_BufferStreamImp::LoadBuffer(uint8_t* pData,
- int32_t iTotalSize,
- uint32_t dwAccess) {
+bool CFX_BufferStreamImp::LoadBuffer(uint8_t* pData,
+ int32_t iTotalSize,
+ uint32_t dwAccess) {
ASSERT(!m_pData && pData && iTotalSize > 0);
SetAccessModes(dwAccess);
m_pData = pData;
m_iTotalSize = iTotalSize;
m_iPosition = 0;
m_iLength = (dwAccess & FX_STREAMACCESS_Write) != 0 ? 0 : iTotalSize;
- return TRUE;
+ return true;
}
int32_t CFX_BufferStreamImp::GetLength() const {
ASSERT(m_pData);
@@ -844,7 +829,7 @@ int32_t CFX_BufferStreamImp::GetPosition() {
ASSERT(m_pData);
return m_iPosition;
}
-FX_BOOL CFX_BufferStreamImp::IsEOF() const {
+bool CFX_BufferStreamImp::IsEOF() const {
ASSERT(m_pData);
return m_iPosition >= m_iLength;
}
@@ -861,7 +846,7 @@ int32_t CFX_BufferStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) {
}
int32_t CFX_BufferStreamImp::ReadString(FX_WCHAR* pStr,
int32_t iMaxLength,
- FX_BOOL& bEOS) {
+ bool& bEOS) {
ASSERT(m_pData);
ASSERT(pStr && iMaxLength > 0);
int32_t iLen = std::min((m_iLength - m_iPosition) / 2, iMaxLength);
@@ -911,12 +896,12 @@ int32_t CFX_BufferStreamImp::WriteString(const FX_WCHAR* pStr,
// static
IFX_Stream* IFX_Stream::CreateTextStream(IFX_Stream* pBaseStream,
- FX_BOOL bDeleteOnRelease) {
+ bool bDeleteOnRelease) {
ASSERT(pBaseStream);
return new CFX_TextStream(pBaseStream, bDeleteOnRelease);
}
-CFX_TextStream::CFX_TextStream(IFX_Stream* pStream, FX_BOOL bDelStream)
+CFX_TextStream::CFX_TextStream(IFX_Stream* pStream, bool bDelStream)
: m_wCodePage(FX_CODEPAGE_DefANSI),
m_wBOMLength(0),
m_dwBOM(0),
@@ -1004,7 +989,7 @@ int32_t CFX_TextStream::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) {
int32_t CFX_TextStream::GetPosition() {
return m_pStreamImp->GetPosition();
}
-FX_BOOL CFX_TextStream::IsEOF() const {
+bool CFX_TextStream::IsEOF() const {
return m_pStreamImp->IsEOF();
}
int32_t CFX_TextStream::ReadData(uint8_t* pBuffer, int32_t iBufferSize) {
@@ -1016,7 +1001,7 @@ int32_t CFX_TextStream::WriteData(const uint8_t* pBuffer, int32_t iBufferSize) {
void CFX_TextStream::Flush() {
m_pStreamImp->Flush();
}
-FX_BOOL CFX_TextStream::SetLength(int32_t iLength) {
+bool CFX_TextStream::SetLength(int32_t iLength) {
return m_pStreamImp->SetLength(iLength);
}
uint16_t CFX_TextStream::GetCodePage() const {
@@ -1031,7 +1016,7 @@ IFX_Stream* CFX_TextStream::CreateSharedStream(uint32_t dwAccess,
return nullptr;
}
if (dwAccess & FX_STREAMACCESS_Text) {
- return new CFX_TextStream(pSR, TRUE);
+ return new CFX_TextStream(pSR, true);
}
return pSR;
}
@@ -1052,7 +1037,7 @@ uint16_t CFX_TextStream::SetCodePage(uint16_t wCodePage) {
}
int32_t CFX_TextStream::ReadString(FX_WCHAR* pStr,
int32_t iMaxLength,
- FX_BOOL& bEOS) {
+ bool& bEOS) {
ASSERT(pStr && iMaxLength > 0);
if (!m_pStreamImp) {
return -1;
@@ -1090,7 +1075,7 @@ int32_t CFX_TextStream::ReadString(FX_WCHAR* pStr,
iLen = m_pStreamImp->ReadData(m_pBuf, iBytes);
int32_t iSrc = iLen;
int32_t iDecode = FX_DecodeString(m_wCodePage, (const FX_CHAR*)m_pBuf,
- &iSrc, pStr, &iMaxLength, TRUE);
+ &iSrc, pStr, &iMaxLength, true);
m_pStreamImp->Seek(FX_STREAMSEEK_Current, iSrc - iLen);
if (iDecode < 1) {
return -1;
@@ -1134,103 +1119,102 @@ CFX_Stream::~CFX_Stream() {
delete m_pStreamImp;
}
-FX_BOOL CFX_Stream::LoadFile(const FX_WCHAR* pszSrcFileName,
- uint32_t dwAccess) {
+bool CFX_Stream::LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess) {
if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp)
- return FALSE;
+ return false;
if (!pszSrcFileName || FXSYS_wcslen(pszSrcFileName) < 1)
- return FALSE;
+ return false;
std::unique_ptr<CFX_FileStreamImp> pImp(new CFX_FileStreamImp());
if (!pImp->LoadFile(pszSrcFileName, dwAccess))
- return FALSE;
+ return false;
m_pStreamImp = pImp.release();
m_eStreamType = FX_STREAMTYPE_File;
m_dwAccess = dwAccess;
m_iLength = m_pStreamImp->GetLength();
- return TRUE;
+ return true;
}
-FX_BOOL CFX_Stream::LoadFileRead(IFX_SeekableReadStream* pFileRead,
- uint32_t dwAccess) {
+bool CFX_Stream::LoadFileRead(IFX_SeekableReadStream* pFileRead,
+ uint32_t dwAccess) {
if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp)
- return FALSE;
+ return false;
if (!pFileRead)
- return FALSE;
+ return false;
std::unique_ptr<CFX_FileReadStreamImp> pImp(new CFX_FileReadStreamImp());
if (!pImp->LoadFileRead(pFileRead, dwAccess))
- return FALSE;
+ return false;
m_pStreamImp = pImp.release();
m_eStreamType = FX_STREAMTYPE_File;
m_dwAccess = dwAccess;
m_iLength = m_pStreamImp->GetLength();
- return TRUE;
+ return true;
}
-FX_BOOL CFX_Stream::LoadFileWrite(IFX_SeekableWriteStream* pFileWrite,
- uint32_t dwAccess) {
+bool CFX_Stream::LoadFileWrite(IFX_SeekableWriteStream* pFileWrite,
+ uint32_t dwAccess) {
if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp)
- return FALSE;
+ return false;
if (!pFileWrite)
- return FALSE;
+ return false;
std::unique_ptr<CFX_FileWriteStreamImp> pImp(new CFX_FileWriteStreamImp());
if (!pImp->LoadFileWrite(pFileWrite, dwAccess))
- return FALSE;
+ return false;
m_pStreamImp = pImp.release();
m_eStreamType = FX_STREAMTYPE_File;
m_dwAccess = dwAccess;
m_iLength = m_pStreamImp->GetLength();
- return TRUE;
+ return true;
}
-FX_BOOL CFX_Stream::LoadBuffer(uint8_t* pData,
- int32_t iTotalSize,
- uint32_t dwAccess) {
+bool CFX_Stream::LoadBuffer(uint8_t* pData,
+ int32_t iTotalSize,
+ uint32_t dwAccess) {
if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp)
- return FALSE;
+ return false;
if (!pData || iTotalSize < 1)
- return FALSE;
+ return false;
std::unique_ptr<CFX_BufferStreamImp> pImp(new CFX_BufferStreamImp());
if (!pImp->LoadBuffer(pData, iTotalSize, dwAccess))
- return FALSE;
+ return false;
m_pStreamImp = pImp.release();
m_eStreamType = FX_STREAMTYPE_Buffer;
m_dwAccess = dwAccess;
m_iLength = m_pStreamImp->GetLength();
- return TRUE;
+ return true;
}
-FX_BOOL CFX_Stream::LoadBufferRead(IFX_BufferRead* pBufferRead,
- int32_t iFileSize,
- uint32_t dwAccess,
- FX_BOOL bReleaseBufferRead) {
+bool CFX_Stream::LoadBufferRead(IFX_BufferRead* pBufferRead,
+ int32_t iFileSize,
+ uint32_t dwAccess,
+ bool bReleaseBufferRead) {
if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp)
- return FALSE;
+ return false;
if (!pBufferRead)
- return FALSE;
+ return false;
std::unique_ptr<CFX_BufferReadStreamImp> pImp(new CFX_BufferReadStreamImp);
if (!pImp->LoadBufferRead(pBufferRead, iFileSize, dwAccess,
bReleaseBufferRead))
- return FALSE;
+ return false;
m_pStreamImp = pImp.release();
m_eStreamType = FX_STREAMTYPE_BufferRead;
m_dwAccess = dwAccess;
m_iLength = m_pStreamImp->GetLength();
- return TRUE;
+ return true;
}
void CFX_Stream::Release() {
@@ -1292,9 +1276,9 @@ int32_t CFX_Stream::GetPosition() {
}
return m_iPosition - m_iStart;
}
-FX_BOOL CFX_Stream::IsEOF() const {
+bool CFX_Stream::IsEOF() const {
if (!m_pStreamImp) {
- return TRUE;
+ return true;
}
if (m_eStreamType == FX_STREAMTYPE_File ||
m_eStreamType == FX_STREAMTYPE_Buffer) {
@@ -1318,9 +1302,7 @@ int32_t CFX_Stream::ReadData(uint8_t* pBuffer, int32_t iBufferSize) {
m_iPosition = m_pStreamImp->GetPosition();
return iLen;
}
-int32_t CFX_Stream::ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS) {
+int32_t CFX_Stream::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) {
ASSERT(pStr && iMaxLength > 0);
if (!m_pStreamImp) {
return -1;
@@ -1337,7 +1319,7 @@ int32_t CFX_Stream::ReadString(FX_WCHAR* pStr,
iLen = m_pStreamImp->ReadString(pStr, iLen, bEOS);
m_iPosition = m_pStreamImp->GetPosition();
if (iLen > 0 && m_iPosition >= iEnd) {
- bEOS = TRUE;
+ bEOS = true;
}
return iLen;
}
@@ -1403,12 +1385,12 @@ void CFX_Stream::Flush() {
}
m_pStreamImp->Flush();
}
-FX_BOOL CFX_Stream::SetLength(int32_t iLength) {
+bool CFX_Stream::SetLength(int32_t iLength) {
if (!m_pStreamImp) {
- return FALSE;
+ return false;
}
if ((m_dwAccess & FX_STREAMACCESS_Write) == 0) {
- return FALSE;
+ return false;
}
return m_pStreamImp->SetLength(iLength);
}
@@ -1465,7 +1447,7 @@ IFX_Stream* CFX_Stream::CreateSharedStream(uint32_t dwAccess,
pShared->m_iStart = iStart;
pShared->m_iLength = (dwAccess & FX_STREAMACCESS_Write) != 0 ? 0 : iLength;
if (dwAccess & FX_STREAMACCESS_Text) {
- return IFX_Stream::CreateTextStream(pShared, TRUE);
+ return IFX_Stream::CreateTextStream(pShared, true);
}
return pShared;
}
diff --git a/xfa/fgas/crt/fgas_stream.h b/xfa/fgas/crt/fgas_stream.h
index 34d684f9ca..674007e935 100644
--- a/xfa/fgas/crt/fgas_stream.h
+++ b/xfa/fgas/crt/fgas_stream.h
@@ -36,7 +36,7 @@ class IFX_Stream {
int32_t length,
uint32_t dwAccess);
static IFX_Stream* CreateTextStream(IFX_Stream* pBaseStream,
- FX_BOOL bDeleteOnRelease);
+ bool bDeleteOnRelease);
virtual ~IFX_Stream() {}
virtual void Release() = 0;
virtual IFX_Stream* Retain() = 0;
@@ -49,15 +49,15 @@ class IFX_Stream {
virtual int32_t GetLength() const = 0;
virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0;
virtual int32_t GetPosition() = 0;
- virtual FX_BOOL IsEOF() const = 0;
+ virtual bool IsEOF() const = 0;
virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) = 0;
virtual int32_t ReadString(FX_WCHAR* pStr,
int32_t iMaxLength,
- FX_BOOL& bEOS) = 0;
+ bool& bEOS) = 0;
virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) = 0;
virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) = 0;
virtual void Flush() = 0;
- virtual FX_BOOL SetLength(int32_t iLength) = 0;
+ virtual bool SetLength(int32_t iLength) = 0;
virtual int32_t GetBOM(uint8_t bom[4]) const = 0;
virtual uint16_t GetCodePage() const = 0;
virtual uint16_t SetCodePage(uint16_t wCodePage) = 0;
diff --git a/xfa/fgas/crt/fgas_utils.cpp b/xfa/fgas/crt/fgas_utils.cpp
index 150a65af19..0cdbf77d31 100644
--- a/xfa/fgas/crt/fgas_utils.cpp
+++ b/xfa/fgas/crt/fgas_utils.cpp
@@ -38,7 +38,7 @@ CFX_BaseArray::CFX_BaseArray(int32_t iGrowSize, int32_t iBlockSize) {
m_pData = new FX_BASEARRAYDATA(iGrowSize, iBlockSize);
}
CFX_BaseArray::~CFX_BaseArray() {
- RemoveAll(FALSE);
+ RemoveAll(false);
delete m_pData;
}
int32_t CFX_BaseArray::GetSize() const {
@@ -114,7 +114,7 @@ int32_t CFX_BaseArray::Copy(const CFX_BaseArray& src,
if (iCount < 1) {
return 0;
}
- RemoveAll(TRUE);
+ RemoveAll(true);
AddSpaceTo(iCount - 1);
FXSYS_memcpy(m_pData->pBuffer, src.m_pData->pBuffer + iStart * iBlockSize,
iCount * iBlockSize);
@@ -130,7 +130,7 @@ int32_t CFX_BaseArray::RemoveLast(int32_t iCount) {
}
return iCount;
}
-void CFX_BaseArray::RemoveAll(FX_BOOL bLeaveMemory) {
+void CFX_BaseArray::RemoveAll(bool bLeaveMemory) {
if (!bLeaveMemory) {
uint8_t*& pBuffer = m_pData->pBuffer;
if (pBuffer) {
@@ -153,7 +153,7 @@ CFX_BaseMassArrayImp::CFX_BaseMassArrayImp(int32_t iChunkSize,
m_pData->SetSize(16);
}
CFX_BaseMassArrayImp::~CFX_BaseMassArrayImp() {
- RemoveAll(FALSE);
+ RemoveAll(false);
delete m_pData;
}
uint8_t* CFX_BaseMassArrayImp::AddSpaceTo(int32_t index) {
@@ -163,7 +163,7 @@ uint8_t* CFX_BaseMassArrayImp::AddSpaceTo(int32_t index) {
pChunk = (uint8_t*)m_pData->GetAt(index / m_iChunkSize);
} else {
int32_t iMemSize = m_iChunkSize * m_iBlockSize;
- while (TRUE) {
+ while (true) {
if (index < m_iChunkCount * m_iChunkSize) {
pChunk = (uint8_t*)m_pData->GetAt(index / m_iChunkSize);
break;
@@ -218,7 +218,7 @@ int32_t CFX_BaseMassArrayImp::Copy(const CFX_BaseMassArrayImp& src,
if (iStart >= iCopied) {
return 0;
}
- RemoveAll(TRUE);
+ RemoveAll(true);
if (iCount < 0) {
iCount = iCopied;
}
@@ -289,7 +289,7 @@ int32_t CFX_BaseMassArrayImp::RemoveLast(int32_t iCount) {
}
return m_iBlockCount;
}
-void CFX_BaseMassArrayImp::RemoveAll(FX_BOOL bLeaveMemory) {
+void CFX_BaseMassArrayImp::RemoveAll(bool bLeaveMemory) {
if (bLeaveMemory) {
m_iBlockCount = 0;
return;
@@ -329,7 +329,7 @@ int32_t CFX_BaseMassArray::Copy(const CFX_BaseMassArray& src,
int32_t CFX_BaseMassArray::RemoveLast(int32_t iCount) {
return m_pData->RemoveLast(iCount);
}
-void CFX_BaseMassArray::RemoveAll(FX_BOOL bLeaveMemory) {
+void CFX_BaseMassArray::RemoveAll(bool bLeaveMemory) {
m_pData->RemoveAll(bLeaveMemory);
}
@@ -427,6 +427,6 @@ int32_t CFX_BaseStack::GetSize() const {
uint8_t* CFX_BaseStack::GetAt(int32_t index) const {
return m_pData->GetAt(index);
}
-void CFX_BaseStack::RemoveAll(FX_BOOL bLeaveMemory) {
+void CFX_BaseStack::RemoveAll(bool bLeaveMemory) {
m_pData->RemoveAll(bLeaveMemory);
}
diff --git a/xfa/fgas/crt/fgas_utils.h b/xfa/fgas/crt/fgas_utils.h
index c45f42405f..5565733c26 100644
--- a/xfa/fgas/crt/fgas_utils.h
+++ b/xfa/fgas/crt/fgas_utils.h
@@ -25,7 +25,7 @@ class CFX_BaseArray : public CFX_Target {
int32_t Append(const CFX_BaseArray& src, int32_t iStart, int32_t iCount);
int32_t Copy(const CFX_BaseArray& src, int32_t iStart, int32_t iCount);
int32_t RemoveLast(int32_t iCount);
- void RemoveAll(FX_BOOL bLeaveMemory);
+ void RemoveAll(bool bLeaveMemory);
FX_BASEARRAYDATA* m_pData;
};
@@ -74,9 +74,7 @@ class CFX_BaseArrayTemplate : public CFX_BaseArray {
int32_t RemoveLast(int32_t iCount) {
return CFX_BaseArray::RemoveLast(iCount);
}
- void RemoveAll(FX_BOOL bLeaveMemory) {
- CFX_BaseArray::RemoveAll(bLeaveMemory);
- }
+ void RemoveAll(bool bLeaveMemory) { CFX_BaseArray::RemoveAll(bLeaveMemory); }
};
class CFX_BaseMassArrayImp : public CFX_Target {
@@ -92,7 +90,7 @@ class CFX_BaseMassArrayImp : public CFX_Target {
int32_t iCount);
int32_t Copy(const CFX_BaseMassArrayImp& src, int32_t iStart, int32_t iCount);
int32_t RemoveLast(int32_t iCount);
- void RemoveAll(FX_BOOL bLeaveMemory);
+ void RemoveAll(bool bLeaveMemory);
int32_t m_iChunkSize;
int32_t m_iBlockSize;
@@ -118,7 +116,7 @@ class CFX_BaseMassArray : public CFX_Target {
int32_t Append(const CFX_BaseMassArray& src, int32_t iStart, int32_t iCount);
int32_t Copy(const CFX_BaseMassArray& src, int32_t iStart, int32_t iCount);
int32_t RemoveLast(int32_t iCount);
- void RemoveAll(FX_BOOL bLeaveMemory);
+ void RemoveAll(bool bLeaveMemory);
CFX_BaseMassArrayImp* m_pData;
};
@@ -165,7 +163,7 @@ class CFX_MassArrayTemplate : public CFX_BaseMassArray {
int32_t RemoveLast(int32_t iCount) {
return CFX_BaseMassArray::RemoveLast(iCount);
}
- void RemoveAll(FX_BOOL bLeaveMemory) {
+ void RemoveAll(bool bLeaveMemory) {
CFX_BaseMassArray::RemoveAll(bLeaveMemory);
}
};
@@ -175,7 +173,7 @@ class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray {
public:
CFX_ObjectMassArrayTemplate(int32_t iChunkSize)
: CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {}
- ~CFX_ObjectMassArrayTemplate() { RemoveAll(FALSE); }
+ ~CFX_ObjectMassArrayTemplate() { RemoveAll(false); }
int32_t GetSize() const { return CFX_BaseMassArray::GetSize(); }
int32_t Add(const baseType& element) {
@@ -225,7 +223,7 @@ class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray {
if (iEnd > iSize) {
iEnd = iSize;
}
- RemoveAll(TRUE);
+ RemoveAll(true);
for (int32_t i = iStart; i < iEnd; i++) {
Add(src.GetAt(i));
}
@@ -244,7 +242,7 @@ class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray {
}
return CFX_BaseMassArray::RemoveLast(iCount);
}
- void RemoveAll(FX_BOOL bLeaveMemory) {
+ void RemoveAll(bool bLeaveMemory) {
int32_t iSize = CFX_BaseMassArray::GetSize();
for (int32_t i = 0; i < iSize; i++) {
((baseType*)GetPtrAt(i))->~baseType();
@@ -293,7 +291,7 @@ class CFX_BaseStack : public CFX_Target {
uint8_t* GetTopElement() const;
int32_t GetSize() const;
uint8_t* GetAt(int32_t index) const;
- void RemoveAll(FX_BOOL bLeaveMemory);
+ void RemoveAll(bool bLeaveMemory);
CFX_BaseMassArrayImp* m_pData;
};
@@ -316,9 +314,7 @@ class CFX_StackTemplate : public CFX_BaseStack {
baseType* GetAt(int32_t index) const {
return (baseType*)CFX_BaseStack::GetAt(index);
}
- void RemoveAll(FX_BOOL bLeaveMemory) {
- CFX_BaseStack::RemoveAll(bLeaveMemory);
- }
+ void RemoveAll(bool bLeaveMemory) { CFX_BaseStack::RemoveAll(bLeaveMemory); }
};
template <class baseType>
@@ -326,7 +322,7 @@ class CFX_ObjectStackTemplate : public CFX_BaseStack {
public:
CFX_ObjectStackTemplate(int32_t iChunkSize)
: CFX_BaseStack(iChunkSize, sizeof(baseType)) {}
- ~CFX_ObjectStackTemplate() { RemoveAll(FALSE); }
+ ~CFX_ObjectStackTemplate() { RemoveAll(false); }
int32_t Push(const baseType& element) {
int32_t index = CFX_BaseStack::GetSize();
@@ -348,7 +344,7 @@ class CFX_ObjectStackTemplate : public CFX_BaseStack {
baseType* GetAt(int32_t index) const {
return (baseType*)CFX_BaseStack::GetAt(index);
}
- void RemoveAll(FX_BOOL bLeaveMemory) {
+ void RemoveAll(bool bLeaveMemory) {
int32_t iSize = CFX_BaseStack::GetSize();
for (int32_t i = 0; i < iSize; i++) {
((baseType*)CFX_BaseStack::GetAt(i))->~baseType();
@@ -370,7 +366,7 @@ class CFX_ObjectStackTemplate : public CFX_BaseStack {
if (iEnd > iSize) {
iEnd = iSize;
}
- RemoveAll(TRUE);
+ RemoveAll(true);
for (int32_t i = iStart; i < iEnd; i++) {
Push(*src.GetAt(i));
}
diff --git a/xfa/fgas/font/fgas_font.h b/xfa/fgas/font/fgas_font.h
index 07bfc1daea..dbc4ec2f3b 100644
--- a/xfa/fgas/font/fgas_font.h
+++ b/xfa/fgas/font/fgas_font.h
@@ -111,7 +111,7 @@ class IFGAS_FontMgr {
const FX_WCHAR* pszFontAlias = nullptr,
uint32_t dwFontStyles = 0,
uint16_t wCodePage = 0,
- FX_BOOL bSaveStream = FALSE) = 0;
+ bool bSaveStream = false) = 0;
virtual CFGAS_GEFont* LoadFont(CFGAS_GEFont* pSrcFont,
uint32_t dwFontStyles,
uint16_t wCodePage = 0xFFFF) = 0;
diff --git a/xfa/fgas/font/fgas_gefont.cpp b/xfa/fgas/font/fgas_gefont.cpp
index d83db63343..b78cfe516a 100644
--- a/xfa/fgas/font/fgas_gefont.cpp
+++ b/xfa/fgas/font/fgas_gefont.cpp
@@ -73,7 +73,7 @@ CFGAS_GEFont* CFGAS_GEFont::LoadFont(const uint8_t* pBuffer,
// static
CFGAS_GEFont* CFGAS_GEFont::LoadFont(IFX_Stream* pFontStream,
IFGAS_FontMgr* pFontMgr,
- FX_BOOL bSaveStream) {
+ bool bSaveStream) {
CFGAS_GEFont* pFont = new CFGAS_GEFont(pFontMgr);
if (!pFont->LoadFontInternal(pFontStream, bSaveStream)) {
pFont->Release();
@@ -86,7 +86,7 @@ CFGAS_GEFont* CFGAS_GEFont::LoadFont(IFX_Stream* pFontStream,
CFGAS_GEFont::CFGAS_GEFont(IFGAS_FontMgr* pFontMgr)
:
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
- m_bUseLogFontStyle(FALSE),
+ m_bUseLogFontStyle(false),
m_dwLogFontStyle(0),
#endif
m_pFont(nullptr),
@@ -100,7 +100,7 @@ CFGAS_GEFont::CFGAS_GEFont(IFGAS_FontMgr* pFontMgr)
CFGAS_GEFont::CFGAS_GEFont(CFGAS_GEFont* src, uint32_t dwFontStyles)
:
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
- m_bUseLogFontStyle(FALSE),
+ m_bUseLogFontStyle(false),
m_dwLogFontStyle(0),
#endif
m_pFont(nullptr),
@@ -156,11 +156,11 @@ CFGAS_GEFont* CFGAS_GEFont::Retain() {
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-FX_BOOL CFGAS_GEFont::LoadFontInternal(const FX_WCHAR* pszFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage) {
+bool CFGAS_GEFont::LoadFontInternal(const FX_WCHAR* pszFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage) {
if (m_pFont) {
- return FALSE;
+ return false;
}
CFX_ByteString csFontFamily;
if (pszFontFamily) {
@@ -198,64 +198,62 @@ FX_BOOL CFGAS_GEFont::LoadFontInternal(const FX_WCHAR* pszFontFamily,
} else if (dwFlags & FXFONT_ITALIC) {
csFontFamily += ",Italic";
}
- m_pFont->LoadSubst(csFontFamily, TRUE, dwFlags, iWeight, 0, wCodePage, false);
+ m_pFont->LoadSubst(csFontFamily, true, dwFlags, iWeight, 0, wCodePage, false);
if (!m_pFont->GetFace())
return false;
return InitFont();
}
-FX_BOOL CFGAS_GEFont::LoadFontInternal(const uint8_t* pBuffer, int32_t length) {
+bool CFGAS_GEFont::LoadFontInternal(const uint8_t* pBuffer, int32_t length) {
if (m_pFont)
- return FALSE;
+ return false;
m_pFont = new CFX_Font;
if (!m_pFont->LoadEmbedded(pBuffer, length))
- return FALSE;
+ return false;
return InitFont();
}
-FX_BOOL CFGAS_GEFont::LoadFontInternal(IFX_Stream* pFontStream,
- FX_BOOL bSaveStream) {
+bool CFGAS_GEFont::LoadFontInternal(IFX_Stream* pFontStream, bool bSaveStream) {
if (m_pFont || m_pFileRead || !pFontStream || pFontStream->GetLength() < 1)
- return FALSE;
+ return false;
if (bSaveStream)
m_pStream.reset(pFontStream);
- m_pFileRead.reset(FX_CreateFileRead(pFontStream, FALSE));
+ m_pFileRead.reset(FX_CreateFileRead(pFontStream, false));
m_pFont = new CFX_Font;
if (m_pFont->LoadFile(m_pFileRead.get()))
return InitFont();
m_pFileRead.reset();
- return FALSE;
+ return false;
}
#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-FX_BOOL CFGAS_GEFont::LoadFontInternal(CFX_Font* pExternalFont) {
+bool CFGAS_GEFont::LoadFontInternal(CFX_Font* pExternalFont) {
if (m_pFont || !pExternalFont)
- return FALSE;
+ return false;
m_pFont = pExternalFont;
m_bExternalFont = true;
return InitFont();
}
-FX_BOOL CFGAS_GEFont::LoadFontInternal(
- std::unique_ptr<CFX_Font> pInternalFont) {
+bool CFGAS_GEFont::LoadFontInternal(std::unique_ptr<CFX_Font> pInternalFont) {
if (m_pFont || !pInternalFont)
- return FALSE;
+ return false;
m_pFont = pInternalFont.release();
m_bExternalFont = false;
return InitFont();
}
-FX_BOOL CFGAS_GEFont::InitFont() {
+bool CFGAS_GEFont::InitFont() {
if (!m_pFont)
- return FALSE;
+ return false;
if (!m_pFontEncoding) {
m_pFontEncoding.reset(FX_CreateFontEncodingEx(m_pFont));
if (!m_pFontEncoding)
- return FALSE;
+ return false;
}
if (!m_pCharWidthMap)
m_pCharWidthMap.reset(new CFX_DiscreteArrayTemplate<uint16_t>(1024));
@@ -264,7 +262,7 @@ FX_BOOL CFGAS_GEFont::InitFont() {
if (!m_pBBoxMap)
m_pBBoxMap.reset(new CFX_MapPtrToPtr(16));
- return TRUE;
+ return true;
}
CFGAS_GEFont* CFGAS_GEFont::Derive(uint32_t dwFontStyles, uint16_t wCodePage) {
@@ -306,28 +304,28 @@ uint32_t CFGAS_GEFont::GetFontStyles() const {
return dwStyles;
}
-FX_BOOL CFGAS_GEFont::GetCharWidth(FX_WCHAR wUnicode,
- int32_t& iWidth,
- bool bCharCode) {
+bool CFGAS_GEFont::GetCharWidth(FX_WCHAR wUnicode,
+ int32_t& iWidth,
+ bool bCharCode) {
return GetCharWidthInternal(wUnicode, iWidth, true, bCharCode);
}
-FX_BOOL CFGAS_GEFont::GetCharWidthInternal(FX_WCHAR wUnicode,
- int32_t& iWidth,
- bool bRecursive,
- bool bCharCode) {
+bool CFGAS_GEFont::GetCharWidthInternal(FX_WCHAR wUnicode,
+ int32_t& iWidth,
+ bool bRecursive,
+ bool bCharCode) {
ASSERT(m_pCharWidthMap);
iWidth = m_pCharWidthMap->GetAt(wUnicode, 0);
if (iWidth == 65535)
- return FALSE;
+ return false;
if (iWidth > 0)
- return TRUE;
+ return true;
if (!m_pProvider ||
!m_pProvider->GetCharWidth(this, wUnicode, bCharCode, &iWidth)) {
CFGAS_GEFont* pFont = nullptr;
- int32_t iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
+ int32_t iGlyph = GetGlyphIndex(wUnicode, true, &pFont, bCharCode);
if (iGlyph != 0xFFFF && pFont) {
if (pFont == this) {
iWidth = m_pFont->GetGlyphWidth(iGlyph);
@@ -336,7 +334,7 @@ FX_BOOL CFGAS_GEFont::GetCharWidthInternal(FX_WCHAR wUnicode,
}
} else if (pFont->GetCharWidthInternal(wUnicode, iWidth, false,
bCharCode)) {
- return TRUE;
+ return true;
}
} else {
iWidth = -1;
@@ -346,22 +344,22 @@ FX_BOOL CFGAS_GEFont::GetCharWidthInternal(FX_WCHAR wUnicode,
return iWidth > 0;
}
-FX_BOOL CFGAS_GEFont::GetCharBBox(FX_WCHAR wUnicode,
- CFX_Rect& bbox,
- FX_BOOL bCharCode) {
- return GetCharBBoxInternal(wUnicode, bbox, TRUE, bCharCode);
+bool CFGAS_GEFont::GetCharBBox(FX_WCHAR wUnicode,
+ CFX_Rect& bbox,
+ bool bCharCode) {
+ return GetCharBBoxInternal(wUnicode, bbox, true, bCharCode);
}
-FX_BOOL CFGAS_GEFont::GetCharBBoxInternal(FX_WCHAR wUnicode,
- CFX_Rect& bbox,
- FX_BOOL bRecursive,
- FX_BOOL bCharCode) {
+bool CFGAS_GEFont::GetCharBBoxInternal(FX_WCHAR wUnicode,
+ CFX_Rect& bbox,
+ bool bRecursive,
+ bool bCharCode) {
ASSERT(m_pRectArray);
ASSERT(m_pBBoxMap);
void* pRect = nullptr;
if (!m_pBBoxMap->Lookup((void*)(uintptr_t)wUnicode, pRect)) {
CFGAS_GEFont* pFont = nullptr;
- int32_t iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
+ int32_t iGlyph = GetGlyphIndex(wUnicode, true, &pFont, bCharCode);
if (iGlyph != 0xFFFF && pFont) {
if (pFont == this) {
FX_RECT rtBBox;
@@ -372,20 +370,20 @@ FX_BOOL CFGAS_GEFont::GetCharBBoxInternal(FX_WCHAR wUnicode,
pRect = m_pRectArray->GetPtrAt(index);
m_pBBoxMap->SetAt((void*)(uintptr_t)wUnicode, pRect);
}
- } else if (pFont->GetCharBBoxInternal(wUnicode, bbox, FALSE, bCharCode)) {
- return TRUE;
+ } else if (pFont->GetCharBBoxInternal(wUnicode, bbox, false, bCharCode)) {
+ return true;
}
}
}
if (!pRect)
- return FALSE;
+ return false;
bbox = *static_cast<const CFX_Rect*>(pRect);
- return TRUE;
+ return true;
}
-FX_BOOL CFGAS_GEFont::GetBBox(CFX_Rect& bbox) {
+bool CFGAS_GEFont::GetBBox(CFX_Rect& bbox) {
FX_RECT rt(0, 0, 0, 0);
- FX_BOOL bRet = m_pFont->GetBBox(rt);
+ bool bRet = m_pFont->GetBBox(rt);
if (bRet) {
bbox.left = rt.left;
bbox.width = rt.Width();
@@ -400,13 +398,13 @@ int32_t CFGAS_GEFont::GetItalicAngle() const {
}
return m_pFont->GetSubstFont()->m_ItalicAngle;
}
-int32_t CFGAS_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode) {
- return GetGlyphIndex(wUnicode, TRUE, nullptr, bCharCode);
+int32_t CFGAS_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, bool bCharCode) {
+ return GetGlyphIndex(wUnicode, true, nullptr, bCharCode);
}
int32_t CFGAS_GEFont::GetGlyphIndex(FX_WCHAR wUnicode,
- FX_BOOL bRecursive,
+ bool bRecursive,
CFGAS_GEFont** ppFont,
- FX_BOOL bCharCode) {
+ bool bCharCode) {
ASSERT(m_pFontEncoding);
int32_t iGlyphIndex = m_pFontEncoding->GlyphFromCharCode(wUnicode);
if (iGlyphIndex > 0) {
@@ -426,7 +424,7 @@ int32_t CFGAS_GEFont::GetGlyphIndex(FX_WCHAR wUnicode,
auto it = m_FontMapper.find(wUnicode);
CFGAS_GEFont* pFont = it != m_FontMapper.end() ? it->second : nullptr;
if (pFont && pFont != this) {
- iGlyphIndex = pFont->GetGlyphIndex(wUnicode, FALSE, nullptr, bCharCode);
+ iGlyphIndex = pFont->GetGlyphIndex(wUnicode, false, nullptr, bCharCode);
if (iGlyphIndex != 0xFFFF) {
int32_t i = m_SubstFonts.Find(pFont);
if (i > -1) {
@@ -457,7 +455,7 @@ int32_t CFGAS_GEFont::GetGlyphIndex(FX_WCHAR wUnicode,
m_FontMapper[wUnicode] = pFont;
int32_t i = m_SubstFonts.GetSize();
m_SubstFonts.Add(pFont);
- iGlyphIndex = pFont->GetGlyphIndex(wUnicode, FALSE, nullptr, bCharCode);
+ iGlyphIndex = pFont->GetGlyphIndex(wUnicode, false, nullptr, bCharCode);
if (iGlyphIndex != 0xFFFF) {
iGlyphIndex |= ((i + 1) << 24);
if (ppFont)
@@ -484,7 +482,7 @@ void CFGAS_GEFont::Reset() {
m_pBBoxMap->RemoveAll();
}
if (m_pRectArray) {
- m_pRectArray->RemoveAll(FALSE);
+ m_pRectArray->RemoveAll(false);
}
}
CFGAS_GEFont* CFGAS_GEFont::GetSubstFont(int32_t iGlyphIndex) const {
diff --git a/xfa/fgas/font/fgas_gefont.h b/xfa/fgas/font/fgas_gefont.h
index 7245e836a1..4ce61f3989 100644
--- a/xfa/fgas/font/fgas_gefont.h
+++ b/xfa/fgas/font/fgas_gefont.h
@@ -34,7 +34,7 @@ class CFGAS_GEFont {
IFGAS_FontMgr* pFontMgr);
static CFGAS_GEFont* LoadFont(IFX_Stream* pFontStream,
IFGAS_FontMgr* pFontMgr,
- FX_BOOL bSaveStream);
+ bool bSaveStream);
#endif
~CFGAS_GEFont();
@@ -44,14 +44,12 @@ class CFGAS_GEFont {
CFGAS_GEFont* Derive(uint32_t dwFontStyles, uint16_t wCodePage = 0);
void GetFamilyName(CFX_WideString& wsFamily) const;
uint32_t GetFontStyles() const;
- FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t& iWidth, bool bCharCode);
- int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE);
+ bool GetCharWidth(FX_WCHAR wUnicode, int32_t& iWidth, bool bCharCode);
+ int32_t GetGlyphIndex(FX_WCHAR wUnicode, bool bCharCode = false);
int32_t GetAscent() const;
int32_t GetDescent() const;
- FX_BOOL GetCharBBox(FX_WCHAR wUnicode,
- CFX_Rect& bbox,
- FX_BOOL bCharCode = FALSE);
- FX_BOOL GetBBox(CFX_Rect& bbox);
+ bool GetCharBBox(FX_WCHAR wUnicode, CFX_Rect& bbox, bool bCharCode = false);
+ bool GetBBox(CFX_Rect& bbox);
int32_t GetItalicAngle() const;
void Reset();
CFGAS_GEFont* GetSubstFont(int32_t iGlyphIndex) const;
@@ -59,7 +57,7 @@ class CFGAS_GEFont {
void SetFontProvider(CXFA_PDFFontMgr* pProvider) { m_pProvider = pProvider; }
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
void SetLogicalFontStyle(uint32_t dwLogFontStyle) {
- m_bUseLogFontStyle = TRUE;
+ m_bUseLogFontStyle = true;
m_dwLogFontStyle = dwLogFontStyle;
}
#endif
@@ -69,30 +67,30 @@ class CFGAS_GEFont {
CFGAS_GEFont(CFGAS_GEFont* src, uint32_t dwFontStyles);
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- FX_BOOL LoadFontInternal(const FX_WCHAR* pszFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage);
- FX_BOOL LoadFontInternal(const uint8_t* pBuffer, int32_t length);
- FX_BOOL LoadFontInternal(IFX_Stream* pFontStream, FX_BOOL bSaveStream);
+ bool LoadFontInternal(const FX_WCHAR* pszFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage);
+ bool LoadFontInternal(const uint8_t* pBuffer, int32_t length);
+ bool LoadFontInternal(IFX_Stream* pFontStream, bool bSaveStream);
#endif
- FX_BOOL LoadFontInternal(CFX_Font* pExternalFont);
- FX_BOOL LoadFontInternal(std::unique_ptr<CFX_Font> pInternalFont);
- FX_BOOL InitFont();
- FX_BOOL GetCharBBoxInternal(FX_WCHAR wUnicode,
- CFX_Rect& bbox,
- FX_BOOL bRecursive,
- FX_BOOL bCharCode = FALSE);
- FX_BOOL GetCharWidthInternal(FX_WCHAR wUnicode,
- int32_t& iWidth,
- bool bRecursive,
- bool bCharCode);
+ bool LoadFontInternal(CFX_Font* pExternalFont);
+ bool LoadFontInternal(std::unique_ptr<CFX_Font> pInternalFont);
+ bool InitFont();
+ bool GetCharBBoxInternal(FX_WCHAR wUnicode,
+ CFX_Rect& bbox,
+ bool bRecursive,
+ bool bCharCode = false);
+ bool GetCharWidthInternal(FX_WCHAR wUnicode,
+ int32_t& iWidth,
+ bool bRecursive,
+ bool bCharCode);
int32_t GetGlyphIndex(FX_WCHAR wUnicode,
- FX_BOOL bRecursive,
+ bool bRecursive,
CFGAS_GEFont** ppFont,
- FX_BOOL bCharCode = FALSE);
+ bool bCharCode = false);
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
- FX_BOOL m_bUseLogFontStyle;
+ bool m_bUseLogFontStyle;
uint32_t m_dwLogFontStyle;
#endif
CFX_Font* m_pFont;
diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp
index 646eb94696..d4907bb919 100644
--- a/xfa/fgas/font/fgas_stdfontmgr.cpp
+++ b/xfa/fgas/font/fgas_stdfontmgr.cpp
@@ -37,7 +37,7 @@ CFGAS_StdFontMgrImp::CFGAS_StdFontMgrImp(FX_LPEnumAllFonts pEnumerator)
}
CFGAS_StdFontMgrImp::~CFGAS_StdFontMgrImp() {
- m_FontFaces.RemoveAll(FALSE);
+ m_FontFaces.RemoveAll(false);
m_CPFonts.RemoveAll();
m_FamilyFonts.RemoveAll();
m_UnicodeFonts.RemoveAll();
@@ -58,11 +58,11 @@ CFGAS_GEFont* CFGAS_StdFontMgrImp::GetDefFontByCodePage(
return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : nullptr;
}
FX_FONTDESCRIPTOR const* pFD =
- FindFont(pszFontFamily, dwFontStyles, TRUE, wCodePage);
+ FindFont(pszFontFamily, dwFontStyles, true, wCodePage);
if (!pFD)
- pFD = FindFont(nullptr, dwFontStyles, TRUE, wCodePage);
+ pFD = FindFont(nullptr, dwFontStyles, true, wCodePage);
if (!pFD)
- pFD = FindFont(nullptr, dwFontStyles, FALSE, wCodePage);
+ pFD = FindFont(nullptr, dwFontStyles, false, wCodePage);
if (!pFD)
return nullptr;
@@ -101,10 +101,10 @@ CFGAS_GEFont* CFGAS_StdFontMgrImp::GetDefFontByUnicode(
return pFont ? LoadFont(pFont, dwFontStyles, pRet->wCodePage) : nullptr;
FX_FONTDESCRIPTOR const* pFD =
- FindFont(pszFontFamily, dwFontStyles, FALSE, pRet->wCodePage,
+ FindFont(pszFontFamily, dwFontStyles, false, pRet->wCodePage,
pRet->wBitField, wUnicode);
if (!pFD && pszFontFamily) {
- pFD = FindFont(nullptr, dwFontStyles, FALSE, pRet->wCodePage,
+ pFD = FindFont(nullptr, dwFontStyles, false, pRet->wCodePage,
pRet->wBitField, wUnicode);
}
if (!pFD)
@@ -143,9 +143,9 @@ CFGAS_GEFont* CFGAS_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFontFamily,
return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : nullptr;
}
FX_FONTDESCRIPTOR const* pFD =
- FindFont(pszFontFamily, dwFontStyles, TRUE, wCodePage);
+ FindFont(pszFontFamily, dwFontStyles, true, wCodePage);
if (!pFD)
- pFD = FindFont(pszFontFamily, dwFontStyles, FALSE, wCodePage);
+ pFD = FindFont(pszFontFamily, dwFontStyles, false, wCodePage);
if (!pFD)
return nullptr;
@@ -186,7 +186,7 @@ CFGAS_GEFont* CFGAS_StdFontMgrImp::LoadFont(IFX_Stream* pFontStream,
const FX_WCHAR* pszFontAlias,
uint32_t dwFontStyles,
uint16_t wCodePage,
- FX_BOOL bSaveStream) {
+ bool bSaveStream) {
ASSERT(pFontStream && pFontStream->GetLength() > 0);
CFGAS_GEFont* pFont = nullptr;
if (m_StreamFonts.Lookup((void*)pFontStream, (void*&)pFont)) {
@@ -321,8 +321,7 @@ FX_FONTDESCRIPTOR const* FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams,
const CFX_FontDescriptors& fonts) {
FX_FONTDESCRIPTOR const* pBestFont = nullptr;
int32_t iBestSimilar = 0;
- FX_BOOL bMatchStyle =
- (pParams->dwMatchFlags & FX_FONTMATCHPARA_MacthStyle) > 0;
+ bool bMatchStyle = (pParams->dwMatchFlags & FX_FONTMATCHPARA_MacthStyle) > 0;
int32_t iCount = fonts.GetSize();
for (int32_t i = 0; i < iCount; ++i) {
FX_FONTDESCRIPTOR const* pFont = fonts.GetPtrAt(i);
@@ -597,15 +596,15 @@ CFGAS_FontMgrImp::~CFGAS_FontMgrImp() {
}
}
-FX_BOOL CFGAS_FontMgrImp::EnumFontsFromFontMapper() {
+bool CFGAS_FontMgrImp::EnumFontsFromFontMapper() {
CFX_FontMapper* pFontMapper =
CFX_GEModule::Get()->GetFontMgr()->GetBuiltinMapper();
if (!pFontMapper)
- return FALSE;
+ return false;
IFX_SystemFontInfo* pSystemFontInfo = pFontMapper->GetSystemFontInfo();
if (!pSystemFontInfo)
- return FALSE;
+ return false;
pSystemFontInfo->EnumFontList(pFontMapper);
for (int32_t i = 0; i < pFontMapper->GetFaceSize(); ++i) {
@@ -620,12 +619,12 @@ FX_BOOL CFGAS_FontMgrImp::EnumFontsFromFontMapper() {
pFontStream->Release();
}
if (m_InstalledFonts.GetSize() == 0)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
-FX_BOOL CFGAS_FontMgrImp::EnumFontsFromFiles() {
+bool CFGAS_FontMgrImp::EnumFontsFromFiles() {
CFX_GEModule::Get()->GetFontMgr()->InitFTLibrary();
FX_POSITION pos = m_pFontSource->GetStartPosition();
IFX_FileAccess* pFontSource = nullptr;
@@ -642,13 +641,13 @@ FX_BOOL CFGAS_FontMgrImp::EnumFontsFromFiles() {
pFontSource->Release();
}
if (m_InstalledFonts.GetSize() == 0)
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
-FX_BOOL CFGAS_FontMgrImp::EnumFonts() {
+bool CFGAS_FontMgrImp::EnumFonts() {
if (EnumFontsFromFontMapper())
- return TRUE;
+ return true;
return EnumFontsFromFiles();
}
@@ -781,39 +780,38 @@ CFGAS_GEFont* CFGAS_FontMgrImp::GetFontByUnicode(
return nullptr;
}
-FX_BOOL CFGAS_FontMgrImp::VerifyUnicode(CFX_FontDescriptor* pDesc,
- FX_WCHAR wcUnicode) {
+bool CFGAS_FontMgrImp::VerifyUnicode(CFX_FontDescriptor* pDesc,
+ FX_WCHAR wcUnicode) {
IFX_SeekableReadStream* pFileRead =
CreateFontStream(pDesc->m_wsFaceName.UTF8Encode());
if (!pFileRead)
- return FALSE;
+ return false;
FXFT_Face pFace = LoadFace(pFileRead, pDesc->m_nFaceIndex);
FT_Error retCharmap = FXFT_Select_Charmap(pFace, FXFT_ENCODING_UNICODE);
FT_Error retIndex = FXFT_Get_Char_Index(pFace, wcUnicode);
pFileRead->Release();
if (!pFace)
- return FALSE;
+ return false;
if (FXFT_Get_Face_External_Stream(pFace))
FXFT_Clear_Face_External_Stream(pFace);
FXFT_Done_Face(pFace);
return !retCharmap && retIndex;
}
-FX_BOOL CFGAS_FontMgrImp::VerifyUnicode(CFGAS_GEFont* pFont,
- FX_WCHAR wcUnicode) {
+bool CFGAS_FontMgrImp::VerifyUnicode(CFGAS_GEFont* pFont, FX_WCHAR wcUnicode) {
if (!pFont)
- return FALSE;
+ return false;
FXFT_Face pFace = pFont->GetDevFont()->GetFace();
FXFT_CharMap charmap = FXFT_Get_Face_Charmap(pFace);
if (FXFT_Select_Charmap(pFace, FXFT_ENCODING_UNICODE) != 0)
- return FALSE;
+ return false;
if (FXFT_Get_Char_Index(pFace, wcUnicode) == 0) {
FXFT_Set_Charmap(pFace, charmap);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
CFGAS_GEFont* CFGAS_FontMgrImp::GetFontByLanguage(
@@ -934,7 +932,7 @@ IFX_SeekableReadStream* CFGAS_FontMgrImp::CreateFontStream(
uint8_t* pBuffer = FX_Alloc(uint8_t, dwFileSize + 1);
dwFileSize = pSystemFontInfo->GetFontData(hFont, 0, pBuffer, dwFileSize);
- return FX_CreateMemoryStream(pBuffer, dwFileSize, TRUE);
+ return FX_CreateMemoryStream(pBuffer, dwFileSize, true);
}
IFX_SeekableReadStream* CFGAS_FontMgrImp::CreateFontStream(
diff --git a/xfa/fgas/font/fgas_stdfontmgr.h b/xfa/fgas/font/fgas_stdfontmgr.h
index fd7f9cd318..2c7a1a2fdd 100644
--- a/xfa/fgas/font/fgas_stdfontmgr.h
+++ b/xfa/fgas/font/fgas_stdfontmgr.h
@@ -52,7 +52,7 @@ class CFGAS_StdFontMgrImp : public IFGAS_FontMgr {
const FX_WCHAR* pszFontAlias = nullptr,
uint32_t dwFontStyles = 0,
uint16_t wCodePage = 0,
- FX_BOOL bSaveStream = FALSE) override;
+ bool bSaveStream = false) override;
CFGAS_GEFont* LoadFont(CFGAS_GEFont* pSrcFont,
uint32_t dwFontStyles,
uint16_t wCodePage = 0xFFFF) override;
@@ -178,9 +178,9 @@ class CFGAS_FontMgrImp : public IFGAS_FontMgr {
CFGAS_GEFont* LoadFont(const CFX_WideString& wsFaceName,
int32_t iFaceIndex,
int32_t* pFaceCount);
- FX_BOOL EnumFonts();
- FX_BOOL EnumFontsFromFontMapper();
- FX_BOOL EnumFontsFromFiles();
+ bool EnumFonts();
+ bool EnumFontsFromFontMapper();
+ bool EnumFontsFromFiles();
protected:
void RegisterFace(FXFT_Face pFace,
@@ -191,8 +191,8 @@ class CFGAS_FontMgrImp : public IFGAS_FontMgr {
std::vector<uint16_t> GetCharsets(FXFT_Face pFace) const;
void GetUSBCSB(FXFT_Face pFace, uint32_t* USB, uint32_t* CSB);
uint32_t GetFlags(FXFT_Face pFace);
- FX_BOOL VerifyUnicode(CFX_FontDescriptor* pDesc, FX_WCHAR wcUnicode);
- FX_BOOL VerifyUnicode(CFGAS_GEFont* pFont, FX_WCHAR wcUnicode);
+ bool VerifyUnicode(CFX_FontDescriptor* pDesc, FX_WCHAR wcUnicode);
+ bool VerifyUnicode(CFGAS_GEFont* pFont, FX_WCHAR wcUnicode);
int32_t IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2);
int32_t MatchFonts(CFX_FontDescriptorInfos& MatchedFonts,
uint16_t wCodePage,
diff --git a/xfa/fgas/layout/fgas_rtfbreak.cpp b/xfa/fgas/layout/fgas_rtfbreak.cpp
index dfe066f7f4..642fe73bc7 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.cpp
+++ b/xfa/fgas/layout/fgas_rtfbreak.cpp
@@ -28,7 +28,7 @@ CFX_RTFBreak::CFX_RTFBreak(uint32_t dwPolicies)
m_iFontSize(240),
m_iTabWidth(720000),
m_PositionedTabs(),
- m_bOrphanLine(FALSE),
+ m_bOrphanLine(false),
m_wDefChar(0xFEFF),
m_iDefChar(0),
m_wLineBreakChar(L'\n'),
@@ -38,9 +38,9 @@ CFX_RTFBreak::CFX_RTFBreak(uint32_t dwPolicies)
m_iCharRotation(0),
m_iRotation(0),
m_iCharSpace(0),
- m_bWordSpace(FALSE),
+ m_bWordSpace(false),
m_iWordSpace(0),
- m_bRTL(FALSE),
+ m_bRTL(false),
m_iAlignment(FX_RTFLINEALIGNMENT_Left),
m_pUserData(nullptr),
m_eCharType(FX_CHARTYPE_Unknown),
@@ -105,7 +105,7 @@ void CFX_RTFBreak::SetFont(CFGAS_GEFont* pFont) {
if (m_pFont) {
m_iFontHeight = m_iFontSize;
if (m_wDefChar != 0xFEFF) {
- m_pFont->GetCharWidth(m_wDefChar, m_iDefChar, FALSE);
+ m_pFont->GetCharWidth(m_wDefChar, m_iDefChar, false);
m_iDefChar *= m_iFontSize;
}
}
@@ -121,7 +121,7 @@ void CFX_RTFBreak::SetFontSize(FX_FLOAT fFontSize) {
if (m_pFont) {
m_iFontHeight = m_iFontSize;
if (m_wDefChar != 0xFEFF) {
- m_pFont->GetCharWidth(m_wDefChar, m_iDefChar, FALSE);
+ m_pFont->GetCharWidth(m_wDefChar, m_iDefChar, false);
m_iDefChar *= m_iFontSize;
}
}
@@ -149,7 +149,7 @@ void CFX_RTFBreak::AddPositionedTab(FX_FLOAT fTabPos) {
if (m_dwPolicies & FX_RTFBREAKPOLICY_OrphanPositionedTab) {
m_bOrphanLine = GetLastPositionedTab() >= iLineEnd;
} else {
- m_bOrphanLine = FALSE;
+ m_bOrphanLine = false;
}
}
void CFX_RTFBreak::SetPositionedTabs(const CFX_FloatArray& tabs) {
@@ -168,18 +168,18 @@ void CFX_RTFBreak::SetPositionedTabs(const CFX_FloatArray& tabs) {
if (m_dwPolicies & FX_RTFBREAKPOLICY_OrphanPositionedTab) {
m_bOrphanLine = GetLastPositionedTab() >= iLineEnd;
} else {
- m_bOrphanLine = FALSE;
+ m_bOrphanLine = false;
}
}
void CFX_RTFBreak::ClearPositionedTabs() {
m_PositionedTabs.RemoveAll();
- m_bOrphanLine = FALSE;
+ m_bOrphanLine = false;
}
void CFX_RTFBreak::SetDefaultChar(FX_WCHAR wch) {
m_wDefChar = wch;
m_iDefChar = 0;
if (m_wDefChar != 0xFEFF && m_pFont) {
- m_pFont->GetCharWidth(m_wDefChar, m_iDefChar, FALSE);
+ m_pFont->GetCharWidth(m_wDefChar, m_iDefChar, false);
if (m_iDefChar < 0) {
m_iDefChar = 0;
} else {
@@ -233,11 +233,11 @@ void CFX_RTFBreak::SetCharRotation(int32_t iCharRotation) {
void CFX_RTFBreak::SetCharSpace(FX_FLOAT fCharSpace) {
m_iCharSpace = FXSYS_round(fCharSpace * 20000.0f);
}
-void CFX_RTFBreak::SetWordSpace(FX_BOOL bDefault, FX_FLOAT fWordSpace) {
+void CFX_RTFBreak::SetWordSpace(bool bDefault, FX_FLOAT fWordSpace) {
m_bWordSpace = !bDefault;
m_iWordSpace = FXSYS_round(fWordSpace * 20000.0f);
}
-void CFX_RTFBreak::SetReadingOrder(FX_BOOL bRTL) {
+void CFX_RTFBreak::SetReadingOrder(bool bRTL) {
m_bRTL = bRTL;
}
void CFX_RTFBreak::SetAlignment(int32_t iAlignment) {
@@ -292,7 +292,7 @@ CFX_RTFChar* CFX_RTFBreak::GetLastChar(int32_t index) const {
}
return nullptr;
}
-CFX_RTFLine* CFX_RTFBreak::GetRTFLine(FX_BOOL bReady) const {
+CFX_RTFLine* CFX_RTFBreak::GetRTFLine(bool bReady) const {
if (bReady) {
if (m_iReady == 1) {
return (CFX_RTFLine*)&m_RTFLine1;
@@ -305,7 +305,7 @@ CFX_RTFLine* CFX_RTFBreak::GetRTFLine(FX_BOOL bReady) const {
ASSERT(m_pCurLine);
return m_pCurLine;
}
-CFX_RTFPieceArray* CFX_RTFBreak::GetRTFPieces(FX_BOOL bReady) const {
+CFX_RTFPieceArray* CFX_RTFBreak::GetRTFPieces(bool bReady) const {
CFX_RTFLine* pRTFLine = GetRTFLine(bReady);
return pRTFLine ? &pRTFLine->m_LinePieces : nullptr;
}
@@ -320,15 +320,15 @@ int32_t CFX_RTFBreak::GetLastPositionedTab() const {
}
return m_PositionedTabs[iCount - 1];
}
-FX_BOOL CFX_RTFBreak::GetPositionedTab(int32_t& iTabPos) const {
+bool CFX_RTFBreak::GetPositionedTab(int32_t& iTabPos) const {
int32_t iCount = m_PositionedTabs.GetSize();
for (int32_t i = 0; i < iCount; i++) {
if (m_PositionedTabs[i] > iTabPos) {
iTabPos = m_PositionedTabs[i];
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
typedef uint32_t (CFX_RTFBreak::*FX_RTFBreak_LPFAppendChar)(
CFX_RTFChar* pCurChar,
@@ -420,7 +420,7 @@ uint32_t CFX_RTFBreak::AppendChar_CharCode(FX_WCHAR wch) {
if (m_bVertical != FX_IsOdd(m_iRotation)) {
iCharWidth = 1000;
} else {
- if (!m_pFont->GetCharWidth(wch, iCharWidth, TRUE)) {
+ if (!m_pFont->GetCharWidth(wch, iCharWidth, true)) {
iCharWidth = m_iDefChar;
}
}
@@ -465,7 +465,7 @@ uint32_t CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar* pCurChar,
uint32_t CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar* pCurChar,
int32_t iRotation) {
if (m_dwLayoutStyles & FX_RTFLAYOUTSTYLE_ExpandTab) {
- FX_BOOL bBreak = FALSE;
+ bool bBreak = false;
if ((m_dwPolicies & FX_RTFBREAKPOLICY_TabBreak) != 0) {
bBreak = (m_pCurLine->GetLineEnd() > m_iBoundaryEnd + m_iTolerance);
}
@@ -518,7 +518,7 @@ uint32_t CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar* pCurChar,
int32_t& iLineWidth = m_pCurLine->m_iWidth;
int32_t iCharWidth = 0;
FX_WCHAR wForm;
- FX_BOOL bAlef = FALSE;
+ bool bAlef = false;
if (m_eCharType >= FX_CHARTYPE_ArabicAlef &&
m_eCharType <= FX_CHARTYPE_ArabicDistortion) {
pLastChar = GetLastChar(1);
@@ -625,7 +625,7 @@ uint32_t CFX_RTFBreak::EndBreak(uint32_t dwStatus) {
return dwStatus;
}
- CFX_RTFLine* pLastLine = GetRTFLine(TRUE);
+ CFX_RTFLine* pLastLine = GetRTFLine(true);
if (pLastLine) {
pCurPieces = &pLastLine->m_LinePieces;
iCount = pCurPieces->GetSize();
@@ -651,7 +651,7 @@ uint32_t CFX_RTFBreak::EndBreak(uint32_t dwStatus) {
m_iReady = (m_pCurLine == &m_RTFLine1) ? 1 : 2;
CFX_RTFLine* pNextLine =
(m_pCurLine == &m_RTFLine1) ? &m_RTFLine2 : &m_RTFLine1;
- FX_BOOL bAllChars = (m_iAlignment > FX_RTFLINEALIGNMENT_Right);
+ bool bAllChars = (m_iAlignment > FX_RTFLINEALIGNMENT_Right);
CFX_TPOArray tpos(100);
if (!EndBreak_SplitLine(pNextLine, bAllChars, dwStatus)) {
if (!m_bCharCode)
@@ -668,10 +668,10 @@ uint32_t CFX_RTFBreak::EndBreak(uint32_t dwStatus) {
return dwStatus;
}
-FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine* pNextLine,
- FX_BOOL bAllChars,
- uint32_t dwStatus) {
- FX_BOOL bDone = FALSE;
+bool CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine* pNextLine,
+ bool bAllChars,
+ uint32_t dwStatus) {
+ bool bDone = false;
if (!m_bSingleLine && !m_bOrphanLine &&
m_pCurLine->GetLineEnd() > m_iBoundaryEnd + m_iTolerance) {
CFX_RTFChar& tc = m_pCurLine->GetChar(m_pCurLine->CountChars() - 1);
@@ -679,7 +679,7 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine* pNextLine,
case FX_CHARTYPE_Tab:
if ((m_dwPolicies & FX_RTFBREAKPOLICY_TabBreak) != 0) {
SplitTextLine(m_pCurLine, pNextLine, !m_bPagination && bAllChars);
- bDone = TRUE;
+ bDone = true;
}
break;
case FX_CHARTYPE_Control:
@@ -687,12 +687,12 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine* pNextLine,
case FX_CHARTYPE_Space:
if ((m_dwPolicies & FX_RTFBREAKPOLICY_SpaceBreak) != 0) {
SplitTextLine(m_pCurLine, pNextLine, !m_bPagination && bAllChars);
- bDone = TRUE;
+ bDone = true;
}
break;
default:
SplitTextLine(m_pCurLine, pNextLine, !m_bPagination && bAllChars);
- bDone = TRUE;
+ bDone = true;
break;
}
}
@@ -702,7 +702,7 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine* pNextLine,
CFX_RTFPieceArray* pCurPieces = &m_pCurLine->m_LinePieces;
CFX_RTFPiece tp;
tp.m_pChars = &m_pCurLine->m_LineChars;
- FX_BOOL bNew = TRUE;
+ bool bNew = true;
uint32_t dwIdentity = (uint32_t)-1;
int32_t iLast = m_pCurLine->CountChars() - 1, j = 0;
for (int32_t i = 0; i <= iLast;) {
@@ -721,7 +721,7 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine* pNextLine,
tp.m_dwIdentity = dwIdentity;
tp.m_pUserData = pTC->m_pUserData;
j = i;
- bNew = FALSE;
+ bNew = false;
}
if (i == iLast || pTC->m_dwStatus != FX_RTFBREAK_None ||
pTC->m_dwIdentity != dwIdentity) {
@@ -733,19 +733,19 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine* pNextLine,
i++;
}
pCurPieces->Add(tp);
- bNew = TRUE;
+ bNew = true;
} else {
tp.m_iWidth += pTC->m_iCharWidth;
i++;
}
}
- return TRUE;
+ return true;
}
if (bAllChars && !bDone) {
int32_t iEndPos = m_pCurLine->GetLineEnd();
- GetBreakPos(m_pCurLine->m_LineChars, iEndPos, bAllChars, TRUE);
+ GetBreakPos(m_pCurLine->m_LineChars, iEndPos, bAllChars, true);
}
- return FALSE;
+ return false;
}
void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus) {
FX_TPO tpo;
@@ -754,8 +754,8 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus) {
int32_t i, j;
CFX_RTFCharArray& chars = m_pCurLine->m_LineChars;
int32_t iCount = m_pCurLine->CountChars();
- FX_BOOL bDone = (!m_bPagination && !m_bCharCode &&
- (m_pCurLine->m_iArabicChars > 0 || m_bRTL));
+ bool bDone = (!m_bPagination && !m_bCharCode &&
+ (m_pCurLine->m_iArabicChars > 0 || m_bRTL));
if (bDone) {
int32_t iBidiNum = 0;
for (i = 0; i < iCount; i++) {
@@ -844,12 +844,12 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus) {
}
}
void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray& tpos,
- FX_BOOL bAllChars,
+ bool bAllChars,
uint32_t dwStatus) {
CFX_RTFPieceArray* pCurPieces = &m_pCurLine->m_LinePieces;
int32_t iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth;
int32_t iCount = pCurPieces->GetSize();
- FX_BOOL bFind = FALSE;
+ bool bFind = false;
uint32_t dwCharType;
int32_t i, j;
FX_TPO tpo;
@@ -859,7 +859,7 @@ void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray& tpos,
if (!bFind) {
iNetWidth = ttp.GetEndPos();
}
- FX_BOOL bArabic = FX_IsOdd(ttp.m_iBidiLevel);
+ bool bArabic = FX_IsOdd(ttp.m_iBidiLevel);
j = bArabic ? 0 : ttp.m_iChars - 1;
while (j > -1 && j < ttp.m_iChars) {
const CFX_RTFChar& tc = ttp.GetChar(j);
@@ -877,7 +877,7 @@ void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray& tpos,
}
}
} else {
- bFind = TRUE;
+ bFind = true;
if (!bAllChars) {
break;
}
@@ -936,8 +936,8 @@ void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray& tpos,
int32_t CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray& tca,
int32_t& iEndPos,
- FX_BOOL bAllChars,
- FX_BOOL bOnlyBrk) {
+ bool bAllChars,
+ bool bOnlyBrk) {
int32_t iLength = tca.GetSize() - 1;
if (iLength < 1)
return iLength;
@@ -966,10 +966,10 @@ int32_t CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray& tca,
}
return iLength;
}
- FX_BOOL bSpaceBreak = (m_dwPolicies & FX_RTFBREAKPOLICY_SpaceBreak) != 0;
- FX_BOOL bTabBreak = (m_dwPolicies & FX_RTFBREAKPOLICY_TabBreak) != 0;
- FX_BOOL bNumberBreak = (m_dwPolicies & FX_RTFBREAKPOLICY_NumberBreak) != 0;
- FX_BOOL bInfixBreak = (m_dwPolicies & FX_RTFBREAKPOLICY_InfixBreak) != 0;
+ bool bSpaceBreak = (m_dwPolicies & FX_RTFBREAKPOLICY_SpaceBreak) != 0;
+ bool bTabBreak = (m_dwPolicies & FX_RTFBREAKPOLICY_TabBreak) != 0;
+ bool bNumberBreak = (m_dwPolicies & FX_RTFBREAKPOLICY_NumberBreak) != 0;
+ bool bInfixBreak = (m_dwPolicies & FX_RTFBREAKPOLICY_InfixBreak) != 0;
FX_LINEBREAKTYPE eType;
uint32_t nCodeProp, nCur, nNext;
CFX_RTFChar* pCur = pCharArray + iLength--;
@@ -986,7 +986,7 @@ int32_t CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray& tca,
pCur = pCharArray + iLength;
nCodeProp = pCur->m_dwCharProps;
nCur = nCodeProp & 0x003F;
- FX_BOOL bNeedBreak = FALSE;
+ bool bNeedBreak = false;
if (nCur == FX_CBP_SP) {
bNeedBreak = !bSpaceBreak;
if (nNext == FX_CBP_SP) {
@@ -1016,7 +1016,7 @@ int32_t CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray& tca,
}
if (!bOnlyBrk) {
iCharWidth = pCur->m_iCharWidth;
- FX_BOOL bBreak = FALSE;
+ bool bBreak = false;
if (nCur == FX_CBP_TB && bTabBreak) {
bBreak = iCharWidth > 0 && iEndPos - iCharWidth <= m_iBoundaryEnd;
} else {
@@ -1065,7 +1065,7 @@ int32_t CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray& tca,
void CFX_RTFBreak::SplitTextLine(CFX_RTFLine* pCurLine,
CFX_RTFLine* pNextLine,
- FX_BOOL bAllChars) {
+ bool bAllChars) {
ASSERT(pCurLine && pNextLine);
int32_t iCount = pCurLine->CountChars();
if (iCount < 2) {
@@ -1073,13 +1073,13 @@ void CFX_RTFBreak::SplitTextLine(CFX_RTFLine* pCurLine,
}
int32_t iEndPos = pCurLine->GetLineEnd();
CFX_RTFCharArray& curChars = pCurLine->m_LineChars;
- int32_t iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE);
+ int32_t iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, false);
if (iCharPos < 0) {
iCharPos = 0;
}
iCharPos++;
if (iCharPos >= iCount) {
- pNextLine->RemoveAll(TRUE);
+ pNextLine->RemoveAll(true);
CFX_Char* pTC = curChars.GetDataPtr(iCharPos - 1);
pTC->m_nBreakType = FX_LBT_UNKNOWN;
return;
@@ -1113,12 +1113,12 @@ void CFX_RTFBreak::SplitTextLine(CFX_RTFLine* pCurLine,
}
int32_t CFX_RTFBreak::CountBreakPieces() const {
- CFX_RTFPieceArray* pRTFPieces = GetRTFPieces(TRUE);
+ CFX_RTFPieceArray* pRTFPieces = GetRTFPieces(true);
return pRTFPieces ? pRTFPieces->GetSize() : 0;
}
const CFX_RTFPiece* CFX_RTFBreak::GetBreakPiece(int32_t index) const {
- CFX_RTFPieceArray* pRTFPieces = GetRTFPieces(TRUE);
+ CFX_RTFPieceArray* pRTFPieces = GetRTFPieces(true);
if (!pRTFPieces)
return nullptr;
@@ -1130,7 +1130,7 @@ const CFX_RTFPiece* CFX_RTFBreak::GetBreakPiece(int32_t index) const {
void CFX_RTFBreak::GetLineRect(CFX_RectF& rect) const {
rect.top = 0;
- CFX_RTFLine* pRTFLine = GetRTFLine(TRUE);
+ CFX_RTFLine* pRTFLine = GetRTFLine(true);
if (!pRTFLine) {
rect.left = ((FX_FLOAT)m_iBoundaryStart) / 20000.0f;
rect.width = rect.height = 0;
@@ -1160,20 +1160,20 @@ void CFX_RTFBreak::GetLineRect(CFX_RectF& rect) const {
rect.height = ((FX_FLOAT)iLineHeight) / 20.0f;
}
void CFX_RTFBreak::ClearBreakPieces() {
- CFX_RTFLine* pRTFLine = GetRTFLine(TRUE);
+ CFX_RTFLine* pRTFLine = GetRTFLine(true);
if (pRTFLine) {
- pRTFLine->RemoveAll(TRUE);
+ pRTFLine->RemoveAll(true);
}
m_iReady = 0;
}
void CFX_RTFBreak::Reset() {
m_eCharType = FX_CHARTYPE_Unknown;
- m_RTFLine1.RemoveAll(TRUE);
- m_RTFLine2.RemoveAll(TRUE);
+ m_RTFLine1.RemoveAll(true);
+ m_RTFLine2.RemoveAll(true);
}
int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
FXTEXT_CHARPOS* pCharPos,
- FX_BOOL bCharCode,
+ bool bCharCode,
CFX_WideString* pWSForms,
FX_AdjustCharDisplayPos pAdjustPos) const {
if (!pText || pText->iLength < 1) {
@@ -1186,7 +1186,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
CFGAS_GEFont* pFont = pText->pFont;
uint32_t dwStyles = pText->dwLayoutStyles;
CFX_RectF rtText(*pText->pRect);
- FX_BOOL bRTLPiece = FX_IsOdd(pText->iBidiLevel);
+ bool bRTLPiece = FX_IsOdd(pText->iBidiLevel);
FX_FLOAT fFontSize = pText->fFontSize;
int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
int32_t iAscent = pFont->GetAscent();
@@ -1195,10 +1195,10 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
FX_FLOAT fFontHeight = fFontSize;
FX_FLOAT fAscent = fFontHeight * (FX_FLOAT)iAscent / (FX_FLOAT)iMaxHeight;
FX_FLOAT fDescent = fFontHeight * (FX_FLOAT)iDescent / (FX_FLOAT)iMaxHeight;
- FX_BOOL bVerticalDoc = (dwStyles & FX_RTFLAYOUTSTYLE_VerticalLayout) != 0;
- FX_BOOL bVerticalChar = (dwStyles & FX_RTFLAYOUTSTYLE_VerticalChars) != 0;
- FX_BOOL bArabicNumber = (dwStyles & FX_RTFLAYOUTSTYLE_ArabicNumber) != 0;
- FX_BOOL bMBCSCode = (dwStyles & FX_RTFLAYOUTSTYLE_MBCSCode) != 0;
+ bool bVerticalDoc = (dwStyles & FX_RTFLAYOUTSTYLE_VerticalLayout) != 0;
+ bool bVerticalChar = (dwStyles & FX_RTFLAYOUTSTYLE_VerticalChars) != 0;
+ bool bArabicNumber = (dwStyles & FX_RTFLAYOUTSTYLE_ArabicNumber) != 0;
+ bool bMBCSCode = (dwStyles & FX_RTFLAYOUTSTYLE_MBCSCode) != 0;
int32_t iRotation = GetLineRotation(dwStyles) + pText->iCharRotation;
int32_t iCharRotation;
FX_WCHAR wch, wPrev = 0xFEFF, wNext, wForm;
@@ -1206,7 +1206,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
FX_FLOAT fX, fY, fCharWidth, fCharHeight;
int32_t iHorScale = pText->iHorizontalScale;
int32_t iVerScale = pText->iVerticalScale;
- FX_BOOL bEmptyChar;
+ bool bEmptyChar;
uint32_t dwProps, dwCharType;
fX = rtText.left;
fY = rtText.top;
@@ -1245,7 +1245,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
bEmptyChar = (dwCharType >= FX_CHARTYPE_Tab &&
dwCharType <= FX_CHARTYPE_Control);
} else {
- bEmptyChar = FALSE;
+ bEmptyChar = false;
}
if (!bEmptyChar) {
iCount++;
@@ -1312,7 +1312,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
}
if (!bEmptyChar) {
CFX_PointF ptOffset;
- FX_BOOL bAdjusted = FALSE;
+ bool bAdjusted = false;
if (pAdjustPos) {
bAdjusted = pAdjustPos(wForm, bMBCSCode, pFont, fFontSize,
bVerticalChar, ptOffset);
@@ -1336,7 +1336,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
}
}
if (!bEmptyChar) {
- pCharPos->m_bGlyphAdjust = TRUE;
+ pCharPos->m_bGlyphAdjust = true;
if (bVerticalDoc) {
if (iCharRotation == 0) {
pCharPos->m_AdjustMatrix[0] = -1;
@@ -1417,7 +1417,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
}
int32_t CFX_RTFBreak::GetCharRects(const FX_RTFTEXTOBJ* pText,
CFX_RectFArray& rtArray,
- FX_BOOL bCharBBox) const {
+ bool bCharBBox) const {
if (!pText || pText->iLength < 1) {
return 0;
}
@@ -1426,13 +1426,13 @@ int32_t CFX_RTFBreak::GetCharRects(const FX_RTFTEXTOBJ* pText,
int32_t* pWidths = pText->pWidths;
int32_t iLength = pText->iLength;
CFX_RectF rect(*pText->pRect);
- FX_BOOL bRTLPiece = FX_IsOdd(pText->iBidiLevel);
+ bool bRTLPiece = FX_IsOdd(pText->iBidiLevel);
FX_FLOAT fFontSize = pText->fFontSize;
int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
FX_FLOAT fScale = fFontSize / 1000.0f;
CFGAS_GEFont* pFont = pText->pFont;
if (!pFont) {
- bCharBBox = FALSE;
+ bCharBBox = false;
}
CFX_Rect bbox;
bbox.Set(0, 0, 0, 0);
@@ -1444,9 +1444,9 @@ int32_t CFX_RTFBreak::GetCharRects(const FX_RTFTEXTOBJ* pText,
rtArray.RemoveAll();
rtArray.SetSize(iLength);
uint32_t dwStyles = pText->dwLayoutStyles;
- FX_BOOL bVertical = (dwStyles & FX_RTFLAYOUTSTYLE_VerticalLayout) != 0;
- FX_BOOL bSingleLine = (dwStyles & FX_RTFLAYOUTSTYLE_SingleLine) != 0;
- FX_BOOL bCombText = (dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0;
+ bool bVertical = (dwStyles & FX_RTFLAYOUTSTYLE_VerticalLayout) != 0;
+ bool bSingleLine = (dwStyles & FX_RTFLAYOUTSTYLE_SingleLine) != 0;
+ bool bCombText = (dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0;
FX_WCHAR wch, wLineBreakChar = pText->wLineBreakChar;
int32_t iCharSize;
FX_FLOAT fCharSize, fStart;
@@ -1459,10 +1459,10 @@ int32_t CFX_RTFBreak::GetCharRects(const FX_RTFTEXTOBJ* pText,
wch = *pStr++;
iCharSize = *pWidths++;
fCharSize = (FX_FLOAT)iCharSize / 20000.0f;
- FX_BOOL bRet = (!bSingleLine && FX_IsCtrlCode(wch));
+ bool bRet = (!bSingleLine && FX_IsCtrlCode(wch));
if (!(wch == L'\v' || wch == L'\f' || wch == 0x2028 || wch == 0x2029 ||
(wLineBreakChar != 0xFEFF && wch == wLineBreakChar))) {
- bRet = FALSE;
+ bRet = false;
}
if (bRet) {
iCharSize = iFontSize * 500;
diff --git a/xfa/fgas/layout/fgas_rtfbreak.h b/xfa/fgas/layout/fgas_rtfbreak.h
index 3b8551b72c..d75bbc1d31 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.h
+++ b/xfa/fgas/layout/fgas_rtfbreak.h
@@ -188,7 +188,7 @@ class CFX_RTFLine {
return m_LinePieces.GetPtrAt(index);
}
int32_t GetLineEnd() const { return m_iStart + m_iWidth; }
- void RemoveAll(FX_BOOL bLeaveMemory = FALSE) {
+ void RemoveAll(bool bLeaveMemory = false) {
CFX_RTFChar* pChar;
int32_t iCount = m_LineChars.GetSize();
for (int32_t i = 0; i < iCount; i++) {
@@ -233,8 +233,8 @@ class CFX_RTFBreak {
void SetVerticalScale(int32_t iScale);
void SetCharRotation(int32_t iCharRotation);
void SetCharSpace(FX_FLOAT fCharSpace);
- void SetWordSpace(FX_BOOL bDefault, FX_FLOAT fWordSpace);
- void SetReadingOrder(FX_BOOL bRTL = FALSE);
+ void SetWordSpace(bool bDefault, FX_FLOAT fWordSpace);
+ void SetReadingOrder(bool bRTL = false);
void SetAlignment(int32_t iAlignment = FX_RTFLINEALIGNMENT_Left);
void SetUserData(IFX_Retainable* pUserData);
uint32_t AppendChar(FX_WCHAR wch);
@@ -246,12 +246,12 @@ class CFX_RTFBreak {
void Reset();
int32_t GetDisplayPos(const FX_RTFTEXTOBJ* pText,
FXTEXT_CHARPOS* pCharPos,
- FX_BOOL bCharCode = FALSE,
+ bool bCharCode = false,
CFX_WideString* pWSForms = nullptr,
FX_AdjustCharDisplayPos pAdjustPos = nullptr) const;
int32_t GetCharRects(const FX_RTFTEXTOBJ* pText,
CFX_RectFArray& rtArray,
- FX_BOOL bCharBBox = FALSE) const;
+ bool bCharBBox = false) const;
uint32_t AppendChar_CharCode(FX_WCHAR wch);
uint32_t AppendChar_Combination(CFX_RTFChar* pCurChar, int32_t iRotation);
uint32_t AppendChar_Tab(CFX_RTFChar* pCurChar, int32_t iRotation);
@@ -263,25 +263,25 @@ class CFX_RTFBreak {
int32_t GetLineRotation(uint32_t dwStyles) const;
void SetBreakStatus();
CFX_RTFChar* GetLastChar(int32_t index) const;
- CFX_RTFLine* GetRTFLine(FX_BOOL bReady) const;
- CFX_RTFPieceArray* GetRTFPieces(FX_BOOL bReady) const;
+ CFX_RTFLine* GetRTFLine(bool bReady) const;
+ CFX_RTFPieceArray* GetRTFPieces(bool bReady) const;
FX_CHARTYPE GetUnifiedCharType(FX_CHARTYPE chartype) const;
int32_t GetLastPositionedTab() const;
- FX_BOOL GetPositionedTab(int32_t& iTabPos) const;
+ bool GetPositionedTab(int32_t& iTabPos) const;
int32_t GetBreakPos(CFX_RTFCharArray& tca,
int32_t& iEndPos,
- FX_BOOL bAllChars = FALSE,
- FX_BOOL bOnlyBrk = FALSE);
+ bool bAllChars = false,
+ bool bOnlyBrk = false);
void SplitTextLine(CFX_RTFLine* pCurLine,
CFX_RTFLine* pNextLine,
- FX_BOOL bAllChars = FALSE);
- FX_BOOL EndBreak_SplitLine(CFX_RTFLine* pNextLine,
- FX_BOOL bAllChars,
- uint32_t dwStatus);
+ bool bAllChars = false);
+ bool EndBreak_SplitLine(CFX_RTFLine* pNextLine,
+ bool bAllChars,
+ uint32_t dwStatus);
void EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus);
void EndBreak_Alignment(CFX_TPOArray& tpos,
- FX_BOOL bAllChars,
+ bool bAllChars,
uint32_t dwStatus);
uint32_t m_dwPolicies;
@@ -297,7 +297,7 @@ class CFX_RTFBreak {
int32_t m_iFontSize;
int32_t m_iTabWidth;
CFX_Int32Array m_PositionedTabs;
- FX_BOOL m_bOrphanLine;
+ bool m_bOrphanLine;
FX_WCHAR m_wDefChar;
int32_t m_iDefChar;
FX_WCHAR m_wLineBreakChar;
@@ -307,9 +307,9 @@ class CFX_RTFBreak {
int32_t m_iCharRotation;
int32_t m_iRotation;
int32_t m_iCharSpace;
- FX_BOOL m_bWordSpace;
+ bool m_bWordSpace;
int32_t m_iWordSpace;
- FX_BOOL m_bRTL;
+ bool m_bRTL;
int32_t m_iAlignment;
IFX_Retainable* m_pUserData;
FX_CHARTYPE m_eCharType;
diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp
index d9a0e22e8b..4551809463 100644
--- a/xfa/fgas/layout/fgas_textbreak.cpp
+++ b/xfa/fgas/layout/fgas_textbreak.cpp
@@ -37,17 +37,17 @@ CFX_TxtBreak::CFX_TxtBreak(uint32_t dwPolicies)
: m_dwPolicies(dwPolicies),
m_iLineWidth(2000000),
m_dwLayoutStyles(0),
- m_bVertical(FALSE),
- m_bArabicContext(FALSE),
- m_bArabicShapes(FALSE),
- m_bRTL(FALSE),
- m_bSingleLine(FALSE),
- m_bCombText(FALSE),
+ m_bVertical(false),
+ m_bArabicContext(false),
+ m_bArabicShapes(false),
+ m_bRTL(false),
+ m_bSingleLine(false),
+ m_bCombText(false),
m_iArabicContext(1),
m_iCurArabicContext(1),
m_pFont(nullptr),
m_iFontSize(240),
- m_bEquidistant(TRUE),
+ m_bEquidistant(true),
m_iTabWidth(720000),
m_wDefChar(0xFEFF),
m_wParagBreakChar(L'\n'),
@@ -60,8 +60,8 @@ CFX_TxtBreak::CFX_TxtBreak(uint32_t dwPolicies)
m_iCombWidth(360000),
m_pUserData(nullptr),
m_eCharType(FX_CHARTYPE_Unknown),
- m_bArabicNumber(FALSE),
- m_bArabicComma(FALSE),
+ m_bArabicNumber(false),
+ m_bArabicComma(false),
m_pCurLine(nullptr),
m_iReady(0),
m_iTolerance(0),
@@ -122,7 +122,7 @@ void CFX_TxtBreak::SetFont(CFGAS_GEFont* pFont) {
m_pFont = pFont;
m_iDefChar = 0;
if (m_wDefChar != 0xFEFF && m_pFont) {
- m_pFont->GetCharWidth(m_wDefChar, m_iDefChar, FALSE);
+ m_pFont->GetCharWidth(m_wDefChar, m_iDefChar, false);
m_iDefChar *= m_iFontSize;
}
}
@@ -136,12 +136,12 @@ void CFX_TxtBreak::SetFontSize(FX_FLOAT fFontSize) {
m_iFontSize = iFontSize;
m_iDefChar = 0;
if (m_wDefChar != 0xFEFF && m_pFont) {
- m_pFont->GetCharWidth(m_wDefChar, m_iDefChar, FALSE);
+ m_pFont->GetCharWidth(m_wDefChar, m_iDefChar, false);
m_iDefChar *= m_iFontSize;
}
}
-void CFX_TxtBreak::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) {
+void CFX_TxtBreak::SetTabWidth(FX_FLOAT fTabWidth, bool bEquidistant) {
m_iTabWidth = FXSYS_round(fTabWidth * 20000.0f);
if (m_iTabWidth < FX_TXTBREAK_MinimumTabWidth) {
m_iTabWidth = FX_TXTBREAK_MinimumTabWidth;
@@ -153,7 +153,7 @@ void CFX_TxtBreak::SetDefaultChar(FX_WCHAR wch) {
m_wDefChar = wch;
m_iDefChar = 0;
if (m_wDefChar != 0xFEFF && m_pFont) {
- m_pFont->GetCharWidth(m_wDefChar, m_iDefChar, FALSE);
+ m_pFont->GetCharWidth(m_wDefChar, m_iDefChar, false);
if (m_iDefChar < 0) {
m_iDefChar = 0;
} else {
@@ -279,7 +279,7 @@ int32_t CFX_TxtBreak::GetLineRotation(uint32_t dwStyles) const {
return gs_FX_TxtLineRotations[(dwStyles & 0x0E) >> 1];
}
-CFX_TxtChar* CFX_TxtBreak::GetLastChar(int32_t index, FX_BOOL bOmitChar) const {
+CFX_TxtChar* CFX_TxtBreak::GetLastChar(int32_t index, bool bOmitChar) const {
CFX_TxtCharArray& ca = *m_pCurLine->m_pLineChars.get();
int32_t iCount = ca.GetSize();
if (index < 0 || index >= iCount) {
@@ -299,7 +299,7 @@ CFX_TxtChar* CFX_TxtBreak::GetLastChar(int32_t index, FX_BOOL bOmitChar) const {
return nullptr;
}
-CFX_TxtLine* CFX_TxtBreak::GetTxtLine(FX_BOOL bReady) const {
+CFX_TxtLine* CFX_TxtBreak::GetTxtLine(bool bReady) const {
if (!bReady)
return m_pCurLine;
if (m_iReady == 1)
@@ -309,7 +309,7 @@ CFX_TxtLine* CFX_TxtBreak::GetTxtLine(FX_BOOL bReady) const {
return nullptr;
}
-CFX_TxtPieceArray* CFX_TxtBreak::GetTxtPieces(FX_BOOL bReady) const {
+CFX_TxtPieceArray* CFX_TxtBreak::GetTxtPieces(bool bReady) const {
CFX_TxtLine* pTxtLine = GetTxtLine(bReady);
if (!pTxtLine) {
return nullptr;
@@ -331,7 +331,7 @@ void CFX_TxtBreak::ResetArabicContext() {
m_bArabicNumber = m_iArabicContext >= 1 && m_bArabicShapes;
} else {
if (m_bPagination) {
- m_bCurRTL = FALSE;
+ m_bCurRTL = false;
m_iCurAlignment = 0;
} else {
m_bCurRTL = m_bRTL;
@@ -368,7 +368,7 @@ void CFX_TxtBreak::AppendChar_PageLoad(CFX_TxtChar* pCurChar,
}
ResetArabicContext();
if (!m_bPagination) {
- CFX_TxtChar* pLastChar = GetLastChar(1, FALSE);
+ CFX_TxtChar* pLastChar = GetLastChar(1, false);
if (pLastChar && pLastChar->m_dwStatus < 1) {
pLastChar->m_dwStatus = FX_TXTBREAK_PieceBreak;
}
@@ -392,20 +392,20 @@ uint32_t CFX_TxtBreak::AppendChar_Combination(CFX_TxtChar* pCurChar,
} else {
wForm = wch;
if (!m_bPagination) {
- CFX_TxtChar* pLastChar = GetLastChar(0, FALSE);
+ CFX_TxtChar* pLastChar = GetLastChar(0, false);
if (pLastChar &&
(pLastChar->m_dwCharStyles & FX_TXTCHARSTYLE_ArabicShadda) == 0) {
- FX_BOOL bShadda = FALSE;
+ bool bShadda = false;
if (wch == 0x0651) {
FX_WCHAR wLast = pLastChar->m_wCharCode;
if (wLast >= 0x064C && wLast <= 0x0650) {
wForm = FX_GetArabicFromShaddaTable(wLast);
- bShadda = TRUE;
+ bShadda = true;
}
} else if (wch >= 0x064C && wch <= 0x0650) {
if (pLastChar->m_wCharCode == 0x0651) {
wForm = FX_GetArabicFromShaddaTable(wch);
- bShadda = TRUE;
+ bShadda = true;
}
}
if (bShadda) {
@@ -415,7 +415,7 @@ uint32_t CFX_TxtBreak::AppendChar_Combination(CFX_TxtChar* pCurChar,
}
}
}
- if (!m_pFont->GetCharWidth(wForm, iCharWidth, FALSE)) {
+ if (!m_pFont->GetCharWidth(wForm, iCharWidth, false)) {
iCharWidth = 0;
}
}
@@ -492,7 +492,7 @@ uint32_t CFX_TxtBreak::AppendChar_Arabic(CFX_TxtChar* pCurChar,
FX_WCHAR wForm;
int32_t iCharWidth = 0;
CFX_Char* pLastChar = nullptr;
- FX_BOOL bAlef = FALSE;
+ bool bAlef = false;
if (!m_bCombText && m_eCharType >= FX_CHARTYPE_ArabicAlef &&
m_eCharType <= FX_CHARTYPE_ArabicDistortion) {
pLastChar = GetLastChar(1);
@@ -512,7 +512,7 @@ uint32_t CFX_TxtBreak::AppendChar_Arabic(CFX_TxtChar* pCurChar,
if (m_bVertical != FX_IsOdd(iLastRotation)) {
iCharWidth = 1000;
} else {
- m_pFont->GetCharWidth(wForm, iCharWidth, FALSE);
+ m_pFont->GetCharWidth(wForm, iCharWidth, false);
}
if (wForm == 0xFEFF) {
iCharWidth = m_iDefChar;
@@ -533,7 +533,7 @@ uint32_t CFX_TxtBreak::AppendChar_Arabic(CFX_TxtChar* pCurChar,
if (m_bVertical != FX_IsOdd(iRotation)) {
iCharWidth = 1000;
} else {
- m_pFont->GetCharWidth(wForm, iCharWidth, FALSE);
+ m_pFont->GetCharWidth(wForm, iCharWidth, false);
}
if (wForm == 0xFEFF) {
iCharWidth = m_iDefChar;
@@ -577,7 +577,7 @@ uint32_t CFX_TxtBreak::AppendChar_Others(CFX_TxtChar* pCurChar,
} else {
if (m_bVertical != FX_IsOdd(iRotation)) {
iCharWidth = 1000;
- } else if (!m_pFont->GetCharWidth(wForm, iCharWidth, FALSE)) {
+ } else if (!m_pFont->GetCharWidth(wForm, iCharWidth, false)) {
iCharWidth = m_iDefChar;
}
iCharWidth *= m_iFontSize;
@@ -586,8 +586,8 @@ uint32_t CFX_TxtBreak::AppendChar_Others(CFX_TxtChar* pCurChar,
iCharWidth += m_iCharSpace;
pCurChar->m_iCharWidth = iCharWidth;
iLineWidth += iCharWidth;
- FX_BOOL bBreak = (chartype != FX_CHARTYPE_Space ||
- (m_dwPolicies & FX_TXTBREAKPOLICY_SpaceBreak) != 0);
+ bool bBreak = (chartype != FX_CHARTYPE_Space ||
+ (m_dwPolicies & FX_TXTBREAKPOLICY_SpaceBreak) != 0);
if (!m_bSingleLine && bBreak && iLineWidth > m_iLineWidth + m_iTolerance) {
return EndBreak(FX_TXTBREAK_LineBreak);
}
@@ -644,10 +644,10 @@ void CFX_TxtBreak::EndBreak_UpdateArabicShapes() {
}
int32_t& iLineWidth = m_pCurLine->m_iWidth;
CFX_Char* pCur = m_pCurLine->GetCharPtr(0);
- FX_BOOL bPrevNum = (pCur->m_dwCharStyles & FX_TXTCHARSTYLE_ArabicIndic) != 0;
+ bool bPrevNum = (pCur->m_dwCharStyles & FX_TXTCHARSTYLE_ArabicIndic) != 0;
pCur = m_pCurLine->GetCharPtr(1);
FX_WCHAR wch, wForm;
- FX_BOOL bNextNum;
+ bool bNextNum;
int32_t i = 1;
int32_t iCharWidth;
int32_t iRotation;
@@ -659,7 +659,7 @@ void CFX_TxtBreak::EndBreak_UpdateArabicShapes() {
bNextNum = (pNext->m_dwCharStyles & FX_TXTCHARSTYLE_ArabicIndic) != 0;
} else {
pNext = nullptr;
- bNextNum = FALSE;
+ bNextNum = false;
}
wch = pCur->m_wCharCode;
if (wch == L'.') {
@@ -675,7 +675,7 @@ void CFX_TxtBreak::EndBreak_UpdateArabicShapes() {
} else {
if (m_bVertical != FX_IsOdd(iRotation)) {
iCharWidth = 1000;
- } else if (!m_pFont->GetCharWidth(wForm, iCharWidth, FALSE)) {
+ } else if (!m_pFont->GetCharWidth(wForm, iCharWidth, false)) {
iCharWidth = m_iDefChar;
}
iCharWidth *= m_iFontSize;
@@ -690,11 +690,11 @@ void CFX_TxtBreak::EndBreak_UpdateArabicShapes() {
} while (i < iCount);
}
-FX_BOOL CFX_TxtBreak::EndBreak_SplitLine(CFX_TxtLine* pNextLine,
- FX_BOOL bAllChars,
- uint32_t dwStatus) {
+bool CFX_TxtBreak::EndBreak_SplitLine(CFX_TxtLine* pNextLine,
+ bool bAllChars,
+ uint32_t dwStatus) {
int32_t iCount = m_pCurLine->CountChars();
- FX_BOOL bDone = FALSE;
+ bool bDone = false;
CFX_Char* pTC;
if (!m_bSingleLine && m_pCurLine->m_iWidth > m_iLineWidth + m_iTolerance) {
pTC = m_pCurLine->GetCharPtr(iCount - 1);
@@ -705,12 +705,12 @@ FX_BOOL CFX_TxtBreak::EndBreak_SplitLine(CFX_TxtLine* pNextLine,
case FX_CHARTYPE_Space:
if ((m_dwPolicies & FX_TXTBREAKPOLICY_SpaceBreak) != 0) {
SplitTextLine(m_pCurLine, pNextLine, !m_bPagination && bAllChars);
- bDone = TRUE;
+ bDone = true;
}
break;
default:
SplitTextLine(m_pCurLine, pNextLine, !m_bPagination && bAllChars);
- bDone = TRUE;
+ bDone = true;
break;
}
}
@@ -732,13 +732,13 @@ FX_BOOL CFX_TxtBreak::EndBreak_SplitLine(CFX_TxtLine* pNextLine,
pCurPieces->Add(tp);
m_pCurLine = pNextLine;
m_eCharType = FX_CHARTYPE_Unknown;
- return TRUE;
+ return true;
}
if (bAllChars && !bDone) {
int32_t iEndPos = m_pCurLine->m_iWidth;
- GetBreakPos(*m_pCurLine->m_pLineChars.get(), iEndPos, bAllChars, TRUE);
+ GetBreakPos(*m_pCurLine->m_pLineChars.get(), iEndPos, bAllChars, true);
}
- return FALSE;
+ return false;
}
void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus) {
@@ -748,7 +748,7 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus) {
int32_t i, j;
CFX_TxtCharArray& chars = *m_pCurLine->m_pLineChars.get();
int32_t iCount = m_pCurLine->CountChars();
- FX_BOOL bDone = (m_pCurLine->m_iArabicChars > 0 || m_bCurRTL);
+ bool bDone = (m_pCurLine->m_iArabicChars > 0 || m_bCurRTL);
if (!m_bPagination && bDone) {
int32_t iBidiNum = 0;
for (i = 0; i < iCount; i++) {
@@ -851,12 +851,12 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus) {
}
void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray& tpos,
- FX_BOOL bAllChars,
+ bool bAllChars,
uint32_t dwStatus) {
int32_t iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth;
CFX_TxtPieceArray* pCurPieces = m_pCurLine->m_pLinePieces.get();
int32_t i, j, iCount = pCurPieces->GetSize();
- FX_BOOL bFind = FALSE;
+ bool bFind = false;
FX_TPO tpo;
CFX_TxtChar* pTC;
FX_CHARTYPE chartype;
@@ -866,7 +866,7 @@ void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray& tpos,
if (!bFind) {
iNetWidth = ttp.GetEndPos();
}
- FX_BOOL bArabic = FX_IsOdd(ttp.m_iBidiLevel);
+ bool bArabic = FX_IsOdd(ttp.m_iBidiLevel);
j = bArabic ? 0 : ttp.m_iChars - 1;
while (j > -1 && j < ttp.m_iChars) {
pTC = ttp.GetCharPtr(j);
@@ -883,7 +883,7 @@ void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray& tpos,
}
}
} else {
- bFind = TRUE;
+ bFind = true;
if (!bAllChars) {
break;
}
@@ -954,7 +954,7 @@ uint32_t CFX_TxtBreak::EndBreak(uint32_t dwStatus) {
}
return dwStatus;
} else {
- CFX_TxtLine* pLastLine = GetTxtLine(TRUE);
+ CFX_TxtLine* pLastLine = GetTxtLine(true);
if (pLastLine) {
pCurPieces = pLastLine->m_pLinePieces.get();
iCount = pCurPieces->GetSize();
@@ -984,7 +984,7 @@ uint32_t CFX_TxtBreak::EndBreak(uint32_t dwStatus) {
m_iReady = (m_pCurLine == m_pTxtLine1.get()) ? 1 : 2;
CFX_TxtLine* pNextLine =
(m_pCurLine == m_pTxtLine1.get()) ? m_pTxtLine2.get() : m_pTxtLine1.get();
- FX_BOOL bAllChars = (m_iCurAlignment > FX_TXTLINEALIGNMENT_Right);
+ bool bAllChars = (m_iCurAlignment > FX_TXTLINEALIGNMENT_Right);
CFX_TPOArray tpos(100);
CFX_Char* pTC;
if (m_bArabicShapes) {
@@ -999,7 +999,7 @@ uint32_t CFX_TxtBreak::EndBreak(uint32_t dwStatus) {
}
EndBreak_Ret:
m_pCurLine = pNextLine;
- pTC = GetLastChar(0, FALSE);
+ pTC = GetLastChar(0, false);
m_eCharType = pTC ? pTC->GetCharType() : FX_CHARTYPE_Unknown;
if (dwStatus == FX_TXTBREAK_ParagraphBreak) {
m_iArabicContext = m_iCurArabicContext = 1;
@@ -1010,8 +1010,8 @@ EndBreak_Ret:
int32_t CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray& ca,
int32_t& iEndPos,
- FX_BOOL bAllChars,
- FX_BOOL bOnlyBrk) {
+ bool bAllChars,
+ bool bOnlyBrk) {
int32_t iLength = ca.GetSize() - 1;
if (iLength < 1) {
return iLength;
@@ -1025,8 +1025,8 @@ int32_t CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray& ca,
iBreak = iLength;
iBreakPos = iEndPos;
}
- FX_BOOL bSpaceBreak = (m_dwPolicies & FX_TXTBREAKPOLICY_SpaceBreak) != 0;
- FX_BOOL bNumberBreak = (m_dwPolicies & FX_TXTBREAKPOLICY_NumberBreak) != 0;
+ bool bSpaceBreak = (m_dwPolicies & FX_TXTBREAKPOLICY_SpaceBreak) != 0;
+ bool bNumberBreak = (m_dwPolicies & FX_TXTBREAKPOLICY_NumberBreak) != 0;
FX_LINEBREAKTYPE eType;
uint32_t nCodeProp, nCur, nNext;
CFX_Char* pCur = ca.GetDataPtr(iLength--);
@@ -1107,7 +1107,7 @@ int32_t CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray& ca,
void CFX_TxtBreak::SplitTextLine(CFX_TxtLine* pCurLine,
CFX_TxtLine* pNextLine,
- FX_BOOL bAllChars) {
+ bool bAllChars) {
ASSERT(pCurLine && pNextLine);
int32_t iCount = pCurLine->CountChars();
if (iCount < 2) {
@@ -1115,13 +1115,13 @@ void CFX_TxtBreak::SplitTextLine(CFX_TxtLine* pCurLine,
}
int32_t iEndPos = pCurLine->m_iWidth;
CFX_TxtCharArray& curChars = *pCurLine->m_pLineChars.get();
- int32_t iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE);
+ int32_t iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, false);
if (iCharPos < 0) {
iCharPos = 0;
}
iCharPos++;
if (iCharPos >= iCount) {
- pNextLine->RemoveAll(TRUE);
+ pNextLine->RemoveAll(true);
CFX_Char* pTC = curChars.GetDataPtr(iCharPos - 1);
pTC->m_nBreakType = FX_LBT_UNKNOWN;
return;
@@ -1158,17 +1158,17 @@ void CFX_TxtBreak::SplitTextLine(CFX_TxtLine* pCurLine,
}
int32_t CFX_TxtBreak::CountBreakChars() const {
- CFX_TxtLine* pTxtLine = GetTxtLine(TRUE);
+ CFX_TxtLine* pTxtLine = GetTxtLine(true);
return pTxtLine ? pTxtLine->CountChars() : 0;
}
int32_t CFX_TxtBreak::CountBreakPieces() const {
- CFX_TxtPieceArray* pTxtPieces = GetTxtPieces(TRUE);
+ CFX_TxtPieceArray* pTxtPieces = GetTxtPieces(true);
return pTxtPieces ? pTxtPieces->GetSize() : 0;
}
const CFX_TxtPiece* CFX_TxtBreak::GetBreakPiece(int32_t index) const {
- CFX_TxtPieceArray* pTxtPieces = GetTxtPieces(TRUE);
+ CFX_TxtPieceArray* pTxtPieces = GetTxtPieces(true);
if (!pTxtPieces) {
return nullptr;
}
@@ -1179,9 +1179,9 @@ const CFX_TxtPiece* CFX_TxtBreak::GetBreakPiece(int32_t index) const {
}
void CFX_TxtBreak::ClearBreakPieces() {
- CFX_TxtLine* pTxtLine = GetTxtLine(TRUE);
+ CFX_TxtLine* pTxtLine = GetTxtLine(true);
if (pTxtLine) {
- pTxtLine->RemoveAll(TRUE);
+ pTxtLine->RemoveAll(true);
}
m_iReady = 0;
}
@@ -1190,8 +1190,8 @@ void CFX_TxtBreak::Reset() {
m_eCharType = FX_CHARTYPE_Unknown;
m_iArabicContext = m_iCurArabicContext = 1;
ResetArabicContext();
- m_pTxtLine1->RemoveAll(TRUE);
- m_pTxtLine2->RemoveAll(TRUE);
+ m_pTxtLine1->RemoveAll(true);
+ m_pTxtLine2->RemoveAll(true);
}
struct FX_FORMCHAR {
@@ -1202,7 +1202,7 @@ struct FX_FORMCHAR {
int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
FXTEXT_CHARPOS* pCharPos,
- FX_BOOL bCharCode,
+ bool bCharCode,
CFX_WideString* pWSForms,
FX_AdjustCharDisplayPos pAdjustPos) const {
if (!pTxtRun || pTxtRun->iLength < 1) {
@@ -1216,11 +1216,10 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
CFGAS_GEFont* pFont = pTxtRun->pFont;
uint32_t dwStyles = pTxtRun->dwStyles;
CFX_RectF rtText(*pTxtRun->pRect);
- FX_BOOL bRTLPiece =
- (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_OddBidiLevel) != 0;
- FX_BOOL bArabicNumber =
+ bool bRTLPiece = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_OddBidiLevel) != 0;
+ bool bArabicNumber =
(pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_ArabicNumber) != 0;
- FX_BOOL bArabicComma =
+ bool bArabicComma =
(pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_ArabicComma) != 0;
FX_FLOAT fFontSize = pTxtRun->fFontSize;
int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
@@ -1230,13 +1229,13 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
FX_FLOAT fFontHeight = fFontSize;
FX_FLOAT fAscent = fFontHeight * (FX_FLOAT)iAscent / (FX_FLOAT)iMaxHeight;
FX_FLOAT fDescent = fFontHeight * (FX_FLOAT)iDescent / (FX_FLOAT)iMaxHeight;
- FX_BOOL bVerticalDoc = (dwStyles & FX_TXTLAYOUTSTYLE_VerticalLayout) != 0;
- FX_BOOL bVerticalChar = (dwStyles & FX_TXTLAYOUTSTYLE_VerticalChars) != 0;
+ bool bVerticalDoc = (dwStyles & FX_TXTLAYOUTSTYLE_VerticalLayout) != 0;
+ bool bVerticalChar = (dwStyles & FX_TXTLAYOUTSTYLE_VerticalChars) != 0;
int32_t iRotation = GetLineRotation(dwStyles) + pTxtRun->iCharRotation;
FX_FLOAT fX, fY, fCharWidth, fCharHeight;
int32_t iHorScale = pTxtRun->iHorizontalScale;
int32_t iVerScale = pTxtRun->iVerticalScale;
- FX_BOOL bSkipSpace = pTxtRun->bSkipSpace;
+ bool bSkipSpace = pTxtRun->bSkipSpace;
FX_FORMCHAR formChars[3];
FX_FLOAT fYBase;
fX = rtText.left;
@@ -1257,8 +1256,8 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
FX_WCHAR wNext = 0xFEFF;
FX_WCHAR wForm = 0xFEFF;
FX_WCHAR wLast = 0xFEFF;
- FX_BOOL bShadda = FALSE;
- FX_BOOL bLam = FALSE;
+ bool bShadda = false;
+ bool bLam = false;
for (int32_t i = 0; i <= iLength; i++) {
int32_t iWidth;
FX_WCHAR wch;
@@ -1315,7 +1314,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
if (wch >= 0x064C && wch <= 0x0651) {
if (bShadda) {
wForm = 0xFEFF;
- bShadda = FALSE;
+ bShadda = false;
} else {
wNext = 0xFEFF;
if (pAccess) {
@@ -1331,17 +1330,17 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
if (wch == 0x0651) {
if (wNext >= 0x064C && wNext <= 0x0650) {
wForm = FX_GetArabicFromShaddaTable(wNext);
- bShadda = TRUE;
+ bShadda = true;
}
} else {
if (wNext == 0x0651) {
wForm = FX_GetArabicFromShaddaTable(wch);
- bShadda = TRUE;
+ bShadda = true;
}
}
}
} else {
- bShadda = FALSE;
+ bShadda = false;
}
} else if (chartype == FX_CHARTYPE_Numeric) {
wForm = wch;
@@ -1377,10 +1376,10 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
wForm = wch;
}
if (chartype != FX_CHARTYPE_Combination) {
- bShadda = FALSE;
+ bShadda = false;
}
if (chartype < FX_CHARTYPE_ArabicAlef) {
- bLam = FALSE;
+ bLam = false;
}
dwProps = FX_GetUnicodeProperties(wForm);
int32_t iCharRotation = iRotation;
@@ -1388,10 +1387,10 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
iCharRotation++;
}
iCharRotation %= 4;
- FX_BOOL bEmptyChar =
+ bool bEmptyChar =
(chartype >= FX_CHARTYPE_Tab && chartype <= FX_CHARTYPE_Control);
if (wForm == 0xFEFF) {
- bEmptyChar = TRUE;
+ bEmptyChar = true;
}
int32_t iForms = bLam ? 3 : 1;
iCount += (bEmptyChar && bSkipSpace) ? 0 : iForms;
@@ -1413,11 +1412,11 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
if (bLam) {
formChars[1].wForm = 0x0651;
iCharWidth = 0;
- pFont->GetCharWidth(0x0651, iCharWidth, FALSE);
+ pFont->GetCharWidth(0x0651, iCharWidth, false);
formChars[1].iWidth = iCharWidth;
formChars[2].wForm = 0x0670;
iCharWidth = 0;
- pFont->GetCharWidth(0x0670, iCharWidth, FALSE);
+ pFont->GetCharWidth(0x0670, iCharWidth, false);
formChars[2].iWidth = iCharWidth;
}
for (int32_t j = 0; j < iForms; j++) {
@@ -1430,7 +1429,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
}
if (!bEmptyChar || (bEmptyChar && !bSkipSpace)) {
pCharPos->m_GlyphIndex =
- bCharCode ? wch : pFont->GetGlyphIndex(wForm, FALSE);
+ bCharCode ? wch : pFont->GetGlyphIndex(wForm, false);
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
pCharPos->m_ExtGID = pCharPos->m_GlyphIndex;
#endif
@@ -1460,7 +1459,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
pCharPos->m_OriginY = fY;
if ((dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0) {
int32_t iFormWidth = iCharWidth;
- pFont->GetCharWidth(wForm, iFormWidth, FALSE);
+ pFont->GetCharWidth(wForm, iFormWidth, false);
FX_FLOAT fOffset = fFontSize * (iCharWidth - iFormWidth) / 2000.0f;
if (bVerticalDoc) {
pCharPos->m_OriginY += fOffset;
@@ -1471,7 +1470,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
if (chartype == FX_CHARTYPE_Combination) {
CFX_Rect rtBBox;
rtBBox.Reset();
- if (pFont->GetCharBBox(wForm, rtBBox, FALSE)) {
+ if (pFont->GetCharBBox(wForm, rtBBox, false)) {
pCharPos->m_OriginY =
fYBase + fFontSize -
fFontSize * (FX_FLOAT)rtBBox.height / (FX_FLOAT)iMaxHeight;
@@ -1482,14 +1481,14 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
FX_CHARTYPE_Combination) {
CFX_Rect rtBox;
rtBox.Reset();
- if (pFont->GetCharBBox(wLast, rtBox, FALSE)) {
+ if (pFont->GetCharBBox(wLast, rtBox, false)) {
pCharPos->m_OriginY -= fFontSize * rtBox.height / iMaxHeight;
}
}
}
}
CFX_PointF ptOffset;
- FX_BOOL bAdjusted = FALSE;
+ bool bAdjusted = false;
if (pAdjustPos) {
bAdjusted = pAdjustPos(wForm, bCharCode, pFont, fFontSize,
bVerticalChar, ptOffset);
@@ -1497,7 +1496,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
if (!bAdjusted && bVerticalChar && (dwProps & 0x00010000) != 0) {
CFX_Rect rtBBox;
rtBBox.Reset();
- if (pFont->GetCharBBox(wForm, rtBBox, FALSE)) {
+ if (pFont->GetCharBBox(wForm, rtBBox, false)) {
ptOffset.x = fFontSize * (850 - rtBBox.right()) / iMaxHeight;
ptOffset.y = fFontSize * (iAscent - rtBBox.top - 150) / iMaxHeight;
}
@@ -1513,7 +1512,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
}
}
if (!bEmptyChar || (bEmptyChar && !bSkipSpace)) {
- pCharPos->m_bGlyphAdjust = TRUE;
+ pCharPos->m_bGlyphAdjust = true;
if (bVerticalDoc) {
if (iCharRotation == 0) {
pCharPos->m_AdjustMatrix[0] = -1;
@@ -1592,7 +1591,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
int32_t CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun,
CFX_RectFArray& rtArray,
- FX_BOOL bCharBBox) const {
+ bool bCharBBox) const {
if (!pTxtRun || pTxtRun->iLength < 1) {
return 0;
}
@@ -1602,14 +1601,13 @@ int32_t CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun,
int32_t* pWidths = pTxtRun->pWidths;
int32_t iLength = pTxtRun->iLength;
CFX_RectF rect(*pTxtRun->pRect);
- FX_BOOL bRTLPiece =
- (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_OddBidiLevel) != 0;
+ bool bRTLPiece = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_OddBidiLevel) != 0;
FX_FLOAT fFontSize = pTxtRun->fFontSize;
int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
FX_FLOAT fScale = fFontSize / 1000.0f;
CFGAS_GEFont* pFont = pTxtRun->pFont;
if (!pFont) {
- bCharBBox = FALSE;
+ bCharBBox = false;
}
CFX_Rect bbox;
bbox.Set(0, 0, 0, 0);
@@ -1620,10 +1618,9 @@ int32_t CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun,
FX_FLOAT fHeight = FXSYS_fabs(bbox.height * fScale);
rtArray.RemoveAll();
rtArray.SetSize(iLength);
- FX_BOOL bVertical =
- (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_VerticalLayout) != 0;
- FX_BOOL bSingleLine = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_SingleLine) != 0;
- FX_BOOL bCombText = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0;
+ bool bVertical = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_VerticalLayout) != 0;
+ bool bSingleLine = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_SingleLine) != 0;
+ bool bCombText = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0;
FX_WCHAR wch, wLineBreakChar = pTxtRun->wLineBreakChar;
int32_t iCharSize;
FX_FLOAT fCharSize, fStart;
@@ -1641,10 +1638,10 @@ int32_t CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun,
iCharSize = *pWidths++;
}
fCharSize = (FX_FLOAT)iCharSize / 20000.0f;
- FX_BOOL bRet = (!bSingleLine && FX_IsCtrlCode(wch));
+ bool bRet = (!bSingleLine && FX_IsCtrlCode(wch));
if (!(wch == L'\v' || wch == L'\f' || wch == 0x2028 || wch == 0x2029 ||
(wLineBreakChar != 0xFEFF && wch == wLineBreakChar))) {
- bRet = FALSE;
+ bRet = false;
}
if (bRet) {
iCharSize = iFontSize * 500;
@@ -1716,7 +1713,7 @@ FX_TXTRUN::FX_TXTRUN()
dwCharStyles(0),
pRect(nullptr),
wLineBreakChar(L'\n'),
- bSkipSpace(TRUE) {}
+ bSkipSpace(true) {}
FX_TXTRUN::~FX_TXTRUN() {}
diff --git a/xfa/fgas/layout/fgas_textbreak.h b/xfa/fgas/layout/fgas_textbreak.h
index d8464ab0cb..4e9238f7bf 100644
--- a/xfa/fgas/layout/fgas_textbreak.h
+++ b/xfa/fgas/layout/fgas_textbreak.h
@@ -102,7 +102,7 @@ struct FX_TXTRUN {
uint32_t dwCharStyles;
const CFX_RectF* pRect;
FX_WCHAR wLineBreakChar;
- FX_BOOL bSkipSpace;
+ bool bSkipSpace;
};
class CFX_TxtPiece : public CFX_Target {
@@ -183,7 +183,7 @@ class CFX_TxtLine {
}
wsStr.ReleaseBuffer(iCount);
}
- void RemoveAll(FX_BOOL bLeaveMemory = FALSE) {
+ void RemoveAll(bool bLeaveMemory = false) {
m_pLineChars->RemoveAll();
m_pLinePieces->RemoveAll(bLeaveMemory);
m_iWidth = 0;
@@ -208,7 +208,7 @@ class CFX_TxtBreak {
void SetLayoutStyles(uint32_t dwLayoutStyles);
void SetFont(CFGAS_GEFont* pFont);
void SetFontSize(FX_FLOAT fFontSize);
- void SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant);
+ void SetTabWidth(FX_FLOAT fTabWidth, bool bEquidistant);
void SetDefaultChar(FX_WCHAR wch);
void SetParagraphBreakChar(FX_WCHAR wch);
void SetLineBreakTolerance(FX_FLOAT fTolerance);
@@ -230,12 +230,12 @@ class CFX_TxtBreak {
void Reset();
int32_t GetDisplayPos(const FX_TXTRUN* pTxtRun,
FXTEXT_CHARPOS* pCharPos,
- FX_BOOL bCharCode = FALSE,
+ bool bCharCode = false,
CFX_WideString* pWSForms = nullptr,
FX_AdjustCharDisplayPos pAdjustPos = nullptr) const;
int32_t GetCharRects(const FX_TXTRUN* pTxtRun,
CFX_RectFArray& rtArray,
- FX_BOOL bCharBBox = FALSE) const;
+ bool bCharBBox = false) const;
void AppendChar_PageLoad(CFX_TxtChar* pCurChar, uint32_t dwProps);
uint32_t AppendChar_Combination(CFX_TxtChar* pCurChar, int32_t iRotation);
uint32_t AppendChar_Tab(CFX_TxtChar* pCurChar, int32_t iRotation);
@@ -246,43 +246,43 @@ class CFX_TxtBreak {
private:
void SetBreakStatus();
int32_t GetLineRotation(uint32_t dwStyles) const;
- CFX_TxtChar* GetLastChar(int32_t index, FX_BOOL bOmitChar = TRUE) const;
- CFX_TxtLine* GetTxtLine(FX_BOOL bReady) const;
- CFX_TxtPieceArray* GetTxtPieces(FX_BOOL bReady) const;
+ CFX_TxtChar* GetLastChar(int32_t index, bool bOmitChar = true) const;
+ CFX_TxtLine* GetTxtLine(bool bReady) const;
+ CFX_TxtPieceArray* GetTxtPieces(bool bReady) const;
FX_CHARTYPE GetUnifiedCharType(FX_CHARTYPE dwType) const;
void ResetArabicContext();
void ResetContextCharStyles();
void EndBreak_UpdateArabicShapes();
- FX_BOOL EndBreak_SplitLine(CFX_TxtLine* pNextLine,
- FX_BOOL bAllChars,
- uint32_t dwStatus);
+ bool EndBreak_SplitLine(CFX_TxtLine* pNextLine,
+ bool bAllChars,
+ uint32_t dwStatus);
void EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus);
void EndBreak_Alignment(CFX_TPOArray& tpos,
- FX_BOOL bAllChars,
+ bool bAllChars,
uint32_t dwStatus);
int32_t GetBreakPos(CFX_TxtCharArray& ca,
int32_t& iEndPos,
- FX_BOOL bAllChars = FALSE,
- FX_BOOL bOnlyBrk = FALSE);
+ bool bAllChars = false,
+ bool bOnlyBrk = false);
void SplitTextLine(CFX_TxtLine* pCurLine,
CFX_TxtLine* pNextLine,
- FX_BOOL bAllChars = FALSE);
+ bool bAllChars = false);
uint32_t m_dwPolicies;
- FX_BOOL m_bPagination;
+ bool m_bPagination;
int32_t m_iLineWidth;
uint32_t m_dwLayoutStyles;
- FX_BOOL m_bVertical;
- FX_BOOL m_bArabicContext;
- FX_BOOL m_bArabicShapes;
- FX_BOOL m_bRTL;
- FX_BOOL m_bSingleLine;
- FX_BOOL m_bCombText;
+ bool m_bVertical;
+ bool m_bArabicContext;
+ bool m_bArabicShapes;
+ bool m_bRTL;
+ bool m_bSingleLine;
+ bool m_bCombText;
int32_t m_iArabicContext;
int32_t m_iCurArabicContext;
CFGAS_GEFont* m_pFont;
int32_t m_iFontSize;
- FX_BOOL m_bEquidistant;
+ bool m_bEquidistant;
int32_t m_iTabWidth;
FX_WCHAR m_wDefChar;
FX_WCHAR m_wParagBreakChar;
@@ -295,10 +295,10 @@ class CFX_TxtBreak {
int32_t m_iCombWidth;
void* m_pUserData;
FX_CHARTYPE m_eCharType;
- FX_BOOL m_bCurRTL;
+ bool m_bCurRTL;
int32_t m_iCurAlignment;
- FX_BOOL m_bArabicNumber;
- FX_BOOL m_bArabicComma;
+ bool m_bArabicNumber;
+ bool m_bArabicComma;
std::unique_ptr<CFX_TxtLine> m_pTxtLine1;
std::unique_ptr<CFX_TxtLine> m_pTxtLine2;
CFX_TxtLine* m_pCurLine;
diff --git a/xfa/fgas/layout/fgas_unicode.h b/xfa/fgas/layout/fgas_unicode.h
index 650943a72f..12614a1299 100644
--- a/xfa/fgas/layout/fgas_unicode.h
+++ b/xfa/fgas/layout/fgas_unicode.h
@@ -18,11 +18,11 @@ typedef CFX_MassArrayTemplate<FX_TPO> CFX_TPOArray;
void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray& tpos, int32_t iStart, int32_t iEnd);
-typedef FX_BOOL (*FX_AdjustCharDisplayPos)(FX_WCHAR wch,
- FX_BOOL bMBCSCode,
- CFGAS_GEFont* pFont,
- FX_FLOAT fFontSize,
- FX_BOOL bVertical,
- CFX_PointF& ptOffset);
+typedef bool (*FX_AdjustCharDisplayPos)(FX_WCHAR wch,
+ bool bMBCSCode,
+ CFGAS_GEFont* pFont,
+ FX_FLOAT fFontSize,
+ bool bVertical,
+ CFX_PointF& ptOffset);
#endif // XFA_FGAS_LAYOUT_FGAS_UNICODE_H_
diff --git a/xfa/fgas/localization/fgas_datetime.cpp b/xfa/fgas/localization/fgas_datetime.cpp
index 18e30fcb86..83000a4f20 100644
--- a/xfa/fgas/localization/fgas_datetime.cpp
+++ b/xfa/fgas/localization/fgas_datetime.cpp
@@ -30,7 +30,7 @@ const int64_t g_FXMillisecondsPerSecond = 1000;
const int64_t g_FXMillisecondsPerMinute = 60000;
const int64_t g_FXMillisecondsPerHour = 3600000;
const int64_t g_FXMillisecondsPerDay = 86400000;
-FX_BOOL FX_IsLeapYear(int32_t iYear) {
+bool FX_IsLeapYear(int32_t iYear) {
ASSERT(iYear != 0);
return ((iYear % 4) == 0 && (iYear % 100) != 0) || (iYear % 400) == 0;
}
@@ -55,7 +55,7 @@ static int32_t FX_DaysBeforeMonthInYear(int32_t iYear, uint8_t iMonth) {
static int64_t FX_DateToDays(int32_t iYear,
uint8_t iMonth,
uint8_t iDay,
- FX_BOOL bIncludeThisDay = FALSE) {
+ bool bIncludeThisDay = false) {
ASSERT(iYear != 0);
ASSERT(iMonth >= 1 && iMonth <= 12);
ASSERT(iDay >= 1 && iDay <= FX_DaysInMonth(iYear, iMonth));
@@ -76,7 +76,7 @@ static void FX_DaysToDate(int64_t iDays,
int32_t& iYear,
uint8_t& iMonth,
uint8_t& iDay) {
- FX_BOOL bBC = iDays < 0;
+ bool bBC = iDays < 0;
if (bBC) {
iDays = -iDays;
}
@@ -100,7 +100,7 @@ static void FX_DaysToDate(int64_t iDays,
iYear += (int32_t)(iDays / g_FXDaysPer4Years * 4);
iDays %= g_FXDaysPer4Years;
}
- while (TRUE) {
+ while (true) {
int32_t iYearDays = FX_DaysInYear(iYear);
if (iDays < iYearDays) {
if (bBC) {
@@ -112,7 +112,7 @@ static void FX_DaysToDate(int64_t iDays,
iYear++;
iDays -= iYearDays;
}
- while (TRUE) {
+ while (true) {
int32_t iMonthDays = FX_DaysInMonth(iYear, iMonth);
if (iDays < iMonthDays) {
break;
@@ -207,7 +207,7 @@ void CFX_Unitime::Set(int32_t year,
if (year > 0) {
m_iUnitime =
m_iUnitime +
- FX_DateToDays(year, month, day, FALSE) * g_FXMillisecondsPerDay;
+ FX_DateToDays(year, month, day, false) * g_FXMillisecondsPerDay;
}
}
void CFX_Unitime::Set(FX_UNITIME t) {
@@ -245,7 +245,7 @@ uint16_t CFX_Unitime::GetDayOfYear() const {
return FX_DaysBeforeMonthInYear(iYear, iMonth) + iDay;
}
int64_t CFX_Unitime::GetDayOfAD() const {
- FX_BOOL bBC = m_iUnitime < 0;
+ bool bBC = m_iUnitime < 0;
int64_t iDays = m_iUnitime / g_FXMillisecondsPerDay;
iDays += bBC ? -1 : 0;
if (bBC && (m_iUnitime % g_FXMillisecondsPerDay) == 0) {
@@ -281,7 +281,7 @@ uint16_t CFX_Unitime::GetMillisecond() const {
}
return (uint16_t)v;
}
-FX_BOOL CFX_Unitime::AddYears(int32_t iYears) {
+bool CFX_Unitime::AddYears(int32_t iYears) {
FX_UNITIME ut = m_iUnitime;
if (ut < 0) {
ut = -ut;
@@ -295,12 +295,12 @@ FX_BOOL CFX_Unitime::AddYears(int32_t iYears) {
iYear = iYears > 0 ? 1 : -1;
}
m_iUnitime =
- FX_DateToDays(iYear, iMonth, iDay, FALSE) * g_FXMillisecondsPerDay;
+ FX_DateToDays(iYear, iMonth, iDay, false) * g_FXMillisecondsPerDay;
m_iUnitime += (iYear < 0) ? -r : r;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_Unitime::AddMonths(int32_t iMonths) {
- FX_BOOL b = iMonths > 0;
+bool CFX_Unitime::AddMonths(int32_t iMonths) {
+ bool b = iMonths > 0;
FX_UNITIME ut = m_iUnitime;
if (ut < 0) {
ut = -ut;
@@ -319,38 +319,38 @@ FX_BOOL CFX_Unitime::AddMonths(int32_t iMonths) {
if (iYear == 0) {
iYear = b ? 1 : -1;
}
- m_iUnitime = FX_DateToDays(iYear, (uint8_t)iMonths, iDay, FALSE) *
+ m_iUnitime = FX_DateToDays(iYear, (uint8_t)iMonths, iDay, false) *
g_FXMillisecondsPerDay;
m_iUnitime += (iYear < 0) ? -r : r;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_Unitime::AddDays(int32_t iDays) {
+bool CFX_Unitime::AddDays(int32_t iDays) {
m_iUnitime += (int64_t)iDays * g_FXMillisecondsPerDay;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_Unitime::AddHours(int32_t iHours) {
+bool CFX_Unitime::AddHours(int32_t iHours) {
m_iUnitime += (int64_t)iHours * g_FXMillisecondsPerHour;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_Unitime::AddMinutes(int32_t iMinutes) {
+bool CFX_Unitime::AddMinutes(int32_t iMinutes) {
m_iUnitime += (int64_t)iMinutes * g_FXMillisecondsPerMinute;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_Unitime::AddSeconds(int32_t iSeconds) {
+bool CFX_Unitime::AddSeconds(int32_t iSeconds) {
m_iUnitime += ((int64_t)iSeconds) * g_FXMillisecondsPerSecond;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_Unitime::AddMilliseconds(int32_t iMilliseconds) {
+bool CFX_Unitime::AddMilliseconds(int32_t iMilliseconds) {
m_iUnitime += iMilliseconds;
- return TRUE;
-}
-FX_BOOL CFX_DateTime::Set(int32_t year,
- uint8_t month,
- uint8_t day,
- uint8_t hour,
- uint8_t minute,
- uint8_t second,
- uint16_t millisecond) {
+ return true;
+}
+bool CFX_DateTime::Set(int32_t year,
+ uint8_t month,
+ uint8_t day,
+ uint8_t hour,
+ uint8_t minute,
+ uint8_t second,
+ uint16_t millisecond) {
ASSERT(year != 0);
ASSERT(month >= 1 && month <= 12);
ASSERT(day >= 1 && day <= FX_DaysInMonth(year, month));
@@ -365,9 +365,9 @@ FX_BOOL CFX_DateTime::Set(int32_t year,
m_DateTime.Time.sTime.minute = minute;
m_DateTime.Time.sTime.second = second;
m_DateTime.Time.sTime.millisecond = millisecond;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_DateTime::FromUnitime(FX_UNITIME t) {
+bool CFX_DateTime::FromUnitime(FX_UNITIME t) {
CFX_Unitime ut(t);
FX_DaysToDate(ut.GetDayOfAD(), m_DateTime.Date.sDate.year,
m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day);
@@ -375,7 +375,7 @@ FX_BOOL CFX_DateTime::FromUnitime(FX_UNITIME t) {
m_DateTime.Time.sTime.minute = ut.GetMinute();
m_DateTime.Time.sTime.second = ut.GetSecond();
m_DateTime.Time.sTime.millisecond = ut.GetMillisecond();
- return TRUE;
+ return true;
}
FX_UNITIME CFX_DateTime::ToUnitime() const {
FX_UNITIME v =
@@ -384,7 +384,7 @@ FX_UNITIME CFX_DateTime::ToUnitime() const {
(int64_t)m_DateTime.Time.sTime.second * g_FXMillisecondsPerSecond +
m_DateTime.Time.sTime.millisecond;
v += FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month,
- m_DateTime.Date.sDate.day, FALSE) *
+ m_DateTime.Date.sDate.day, false) *
g_FXMillisecondsPerDay;
return v;
}
@@ -400,7 +400,7 @@ uint8_t CFX_DateTime::GetDay() const {
FX_WEEKDAY CFX_DateTime::GetDayOfWeek() const {
int32_t v = (int32_t)(FX_DateToDays(m_DateTime.Date.sDate.year,
m_DateTime.Date.sDate.month,
- m_DateTime.Date.sDate.day, TRUE) %
+ m_DateTime.Date.sDate.day, true) %
7);
if (v < 0) {
v += 7;
@@ -414,7 +414,7 @@ uint16_t CFX_DateTime::GetDayOfYear() const {
}
int64_t CFX_DateTime::GetDayOfAD() const {
return FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month,
- m_DateTime.Date.sDate.day, TRUE);
+ m_DateTime.Date.sDate.day, true);
}
uint8_t CFX_DateTime::GetHour() const {
return m_DateTime.Date.sDate.day;
@@ -428,9 +428,9 @@ uint8_t CFX_DateTime::GetSecond() const {
uint16_t CFX_DateTime::GetMillisecond() const {
return m_DateTime.Time.sTime.millisecond;
}
-FX_BOOL CFX_DateTime::AddYears(int32_t iYears) {
+bool CFX_DateTime::AddYears(int32_t iYears) {
if (iYears == 0) {
- return FALSE;
+ return false;
}
int32_t v = m_DateTime.Date.sDate.year + iYears;
if (v >= 0 && m_DateTime.Date.sDate.year < 0) {
@@ -439,13 +439,13 @@ FX_BOOL CFX_DateTime::AddYears(int32_t iYears) {
v--;
}
m_DateTime.Date.sDate.year = v;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_DateTime::AddMonths(int32_t iMonths) {
+bool CFX_DateTime::AddMonths(int32_t iMonths) {
if (iMonths == 0) {
- return FALSE;
+ return false;
}
- FX_BOOL b = iMonths > 0;
+ bool b = iMonths > 0;
iMonths += m_DateTime.Date.sDate.month;
while (iMonths < 1) {
m_DateTime.Date.sDate.year--;
@@ -465,15 +465,15 @@ FX_BOOL CFX_DateTime::AddMonths(int32_t iMonths) {
m_DateTime.Date.sDate.year = b ? 1 : -1;
}
m_DateTime.Date.sDate.month = (uint8_t)iMonths;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_DateTime::AddDays(int32_t iDays) {
+bool CFX_DateTime::AddDays(int32_t iDays) {
if (iDays == 0) {
- return FALSE;
+ return false;
}
int64_t v1 =
FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month,
- m_DateTime.Date.sDate.day, TRUE);
+ m_DateTime.Date.sDate.day, true);
int64_t v2 = v1 + iDays;
if (v2 <= 0 && v1 > 0) {
v2--;
@@ -482,11 +482,11 @@ FX_BOOL CFX_DateTime::AddDays(int32_t iDays) {
}
FX_DaysToDate(v2, m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month,
m_DateTime.Date.sDate.day);
- return TRUE;
+ return true;
}
-FX_BOOL CFX_DateTime::AddHours(int32_t iHours) {
+bool CFX_DateTime::AddHours(int32_t iHours) {
if (iHours == 0) {
- return FALSE;
+ return false;
}
iHours += m_DateTime.Date.sDate.day;
int32_t iDays = iHours / 24;
@@ -498,11 +498,11 @@ FX_BOOL CFX_DateTime::AddHours(int32_t iHours) {
if (iDays != 0) {
AddDays(iDays);
}
- return TRUE;
+ return true;
}
-FX_BOOL CFX_DateTime::AddMinutes(int32_t iMinutes) {
+bool CFX_DateTime::AddMinutes(int32_t iMinutes) {
if (iMinutes == 0) {
- return FALSE;
+ return false;
}
iMinutes += m_DateTime.Time.sTime.minute;
int32_t iHours = iMinutes / 60;
@@ -514,11 +514,11 @@ FX_BOOL CFX_DateTime::AddMinutes(int32_t iMinutes) {
if (iHours != 0) {
AddHours(iHours);
}
- return TRUE;
+ return true;
}
-FX_BOOL CFX_DateTime::AddSeconds(int32_t iSeconds) {
+bool CFX_DateTime::AddSeconds(int32_t iSeconds) {
if (iSeconds == 0) {
- return FALSE;
+ return false;
}
iSeconds += m_DateTime.Time.sTime.second;
int32_t iMinutes = iSeconds / 60;
@@ -530,11 +530,11 @@ FX_BOOL CFX_DateTime::AddSeconds(int32_t iSeconds) {
if (iMinutes != 0) {
AddMinutes(iMinutes);
}
- return TRUE;
+ return true;
}
-FX_BOOL CFX_DateTime::AddMilliseconds(int32_t iMilliseconds) {
+bool CFX_DateTime::AddMilliseconds(int32_t iMilliseconds) {
if (iMilliseconds == 0) {
- return FALSE;
+ return false;
}
iMilliseconds += m_DateTime.Time.sTime.millisecond;
int32_t iSeconds = (int32_t)(iMilliseconds / g_FXMillisecondsPerSecond);
@@ -546,5 +546,5 @@ FX_BOOL CFX_DateTime::AddMilliseconds(int32_t iMilliseconds) {
if (iSeconds != 0) {
AddSeconds(iSeconds);
}
- return TRUE;
+ return true;
}
diff --git a/xfa/fgas/localization/fgas_datetime.h b/xfa/fgas/localization/fgas_datetime.h
index 52d665a9c6..3383d45669 100644
--- a/xfa/fgas/localization/fgas_datetime.h
+++ b/xfa/fgas/localization/fgas_datetime.h
@@ -23,7 +23,7 @@ enum FX_WEEKDAY {
FX_Saturday,
};
-FX_BOOL FX_IsLeapYear(int32_t iYear);
+bool FX_IsLeapYear(int32_t iYear);
int32_t FX_DaysInYear(int32_t iYear);
uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth);
@@ -80,13 +80,13 @@ class CFX_Unitime {
uint8_t GetMinute() const;
uint8_t GetSecond() const;
uint16_t GetMillisecond() const;
- FX_BOOL AddYears(int32_t iYears);
- FX_BOOL AddMonths(int32_t iMonths);
- FX_BOOL AddDays(int32_t iDays);
- FX_BOOL AddHours(int32_t iHours);
- FX_BOOL AddMinutes(int32_t iMinutes);
- FX_BOOL AddSeconds(int32_t iSeconds);
- FX_BOOL AddMilliseconds(int32_t iMilliseconds);
+ bool AddYears(int32_t iYears);
+ bool AddMonths(int32_t iMonths);
+ bool AddDays(int32_t iDays);
+ bool AddHours(int32_t iHours);
+ bool AddMinutes(int32_t iMinutes);
+ bool AddSeconds(int32_t iSeconds);
+ bool AddMilliseconds(int32_t iMilliseconds);
friend CFX_Unitime operator+(const CFX_Unitime& t1, const CFX_Unitime& t2) {
return CFX_Unitime(t1.m_iUnitime + t2.m_iUnitime);
}
@@ -243,14 +243,14 @@ class CFX_DateTime {
FromUnitime(ToUnitime() - ((const CFX_DateTime&)dt).ToUnitime());
return *this;
}
- virtual FX_BOOL Set(int32_t year,
- uint8_t month,
- uint8_t day,
- uint8_t hour = 0,
- uint8_t minute = 0,
- uint8_t second = 0,
- uint16_t millisecond = 0);
- virtual FX_BOOL FromUnitime(FX_UNITIME t);
+ virtual bool Set(int32_t year,
+ uint8_t month,
+ uint8_t day,
+ uint8_t hour = 0,
+ uint8_t minute = 0,
+ uint8_t second = 0,
+ uint16_t millisecond = 0);
+ virtual bool FromUnitime(FX_UNITIME t);
virtual FX_UNITIME ToUnitime() const;
virtual int32_t GetYear() const;
virtual uint8_t GetMonth() const;
@@ -262,13 +262,13 @@ class CFX_DateTime {
virtual uint8_t GetMinute() const;
virtual uint8_t GetSecond() const;
virtual uint16_t GetMillisecond() const;
- virtual FX_BOOL AddYears(int32_t iYears);
- virtual FX_BOOL AddMonths(int32_t iMonths);
- virtual FX_BOOL AddDays(int32_t iDays);
- virtual FX_BOOL AddHours(int32_t iHours);
- virtual FX_BOOL AddMinutes(int32_t iMinutes);
- virtual FX_BOOL AddSeconds(int32_t iSeconds);
- virtual FX_BOOL AddMilliseconds(int32_t iMilliseconds);
+ virtual bool AddYears(int32_t iYears);
+ virtual bool AddMonths(int32_t iMonths);
+ virtual bool AddDays(int32_t iDays);
+ virtual bool AddHours(int32_t iHours);
+ virtual bool AddMinutes(int32_t iMinutes);
+ virtual bool AddSeconds(int32_t iSeconds);
+ virtual bool AddMilliseconds(int32_t iMilliseconds);
friend CFX_DateTime operator+(const CFX_DateTime& dt1,
const CFX_DateTime& dt2) {
CFX_DateTime dt;
@@ -305,66 +305,66 @@ class CFX_DateTime {
dt.FromUnitime(((const CFX_DateTime&)dt1).ToUnitime() - dt2.ToUnitime());
return dt;
}
- friend FX_BOOL operator==(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
+ friend bool operator==(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
return FXSYS_memcmp(static_cast<const FX_DATETIME*>(dt1),
static_cast<const FX_DATETIME*>(dt2),
sizeof(FX_DATETIME)) == 0;
}
- friend FX_BOOL operator==(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
+ friend bool operator==(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
return FXSYS_memcmp(static_cast<const FX_DATETIME*>(dt1), &dt2,
sizeof(FX_DATETIME)) == 0;
}
- friend FX_BOOL operator==(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
+ friend bool operator==(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
return FXSYS_memcmp(&dt1, static_cast<const FX_DATETIME*>(dt2),
sizeof(FX_DATETIME)) == 0;
}
- friend FX_BOOL operator!=(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
+ friend bool operator!=(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
return FXSYS_memcmp(static_cast<const FX_DATETIME*>(dt1),
static_cast<const FX_DATETIME*>(dt2),
sizeof(FX_DATETIME)) != 0;
}
- friend FX_BOOL operator!=(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
+ friend bool operator!=(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
return FXSYS_memcmp(static_cast<const FX_DATETIME*>(dt1), &dt2,
sizeof(FX_DATETIME)) != 0;
}
- friend FX_BOOL operator!=(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
+ friend bool operator!=(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
return FXSYS_memcmp(&dt1, static_cast<const FX_DATETIME*>(dt2),
sizeof(FX_DATETIME)) != 0;
}
- friend FX_BOOL operator>(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
+ friend bool operator>(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
return dt1.ToUnitime() > dt2.ToUnitime();
}
- friend FX_BOOL operator>(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
+ friend bool operator>(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
return dt1.ToUnitime() > ((const CFX_DateTime&)dt2).ToUnitime();
}
- friend FX_BOOL operator>(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
+ friend bool operator>(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
return ((const CFX_DateTime&)dt1).ToUnitime() > dt2.ToUnitime();
}
- friend FX_BOOL operator>=(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
+ friend bool operator>=(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
return dt1.ToUnitime() >= dt2.ToUnitime();
}
- friend FX_BOOL operator>=(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
+ friend bool operator>=(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
return dt1.ToUnitime() >= ((const CFX_DateTime&)dt2).ToUnitime();
}
- friend FX_BOOL operator>=(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
+ friend bool operator>=(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
return ((const CFX_DateTime&)dt1).ToUnitime() >= dt2.ToUnitime();
}
- friend FX_BOOL operator<(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
+ friend bool operator<(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
return dt1.ToUnitime() < dt2.ToUnitime();
}
- friend FX_BOOL operator<(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
+ friend bool operator<(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
return dt1.ToUnitime() < ((const CFX_DateTime&)dt2).ToUnitime();
}
- friend FX_BOOL operator<(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
+ friend bool operator<(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
return ((const CFX_DateTime&)dt1).ToUnitime() < dt2.ToUnitime();
}
- friend FX_BOOL operator<=(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
+ friend bool operator<=(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
return dt1.ToUnitime() <= dt2.ToUnitime();
}
- friend FX_BOOL operator<=(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
+ friend bool operator<=(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
return dt1.ToUnitime() <= ((const CFX_DateTime&)dt2).ToUnitime();
}
- friend FX_BOOL operator<=(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
+ friend bool operator<=(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
return ((const CFX_DateTime&)dt1).ToUnitime() <= dt2.ToUnitime();
}
diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp
index f8715fdf1c..da4acb2a81 100644
--- a/xfa/fgas/localization/fgas_locale.cpp
+++ b/xfa/fgas/localization/fgas_locale.cpp
@@ -99,21 +99,21 @@ class CFX_LCNumeric {
FX_FLOAT GetFloat() const;
double GetDouble() const;
CFX_WideString ToString() const;
- CFX_WideString ToString(int32_t nTreading, FX_BOOL bTrimTailZeros) const;
+ CFX_WideString ToString(int32_t nTreading, bool bTrimTailZeros) const;
int64_t m_Integral;
uint32_t m_Fractional;
int32_t m_Exponent;
};
-static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue,
- CFX_LCNumeric& lcnum) {
+static bool FX_WStringToNumeric(const CFX_WideString& wsValue,
+ CFX_LCNumeric& lcnum) {
lcnum.m_Integral = 0;
lcnum.m_Fractional = 0;
lcnum.m_Exponent = 0;
if (wsValue.IsEmpty())
- return FALSE;
+ return false;
const int32_t nIntegralMaxLen = 17;
int32_t cc = 0;
@@ -125,7 +125,7 @@ static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue,
cc++;
if (cc >= len)
- return FALSE;
+ return false;
if (str[cc] == '+') {
cc++;
@@ -141,7 +141,7 @@ static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue,
if (!FXSYS_isDecimalDigit(str[cc])) {
if ((str[cc] == 'E' || str[cc] == 'e'))
break;
- return FALSE;
+ return false;
}
if (nIntegralLen < nIntegralMaxLen) {
lcnum.m_Integral = lcnum.m_Integral * 10 + str[cc] - '0';
@@ -166,7 +166,7 @@ static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue,
if (!FXSYS_isDecimalDigit(str[cc])) {
if ((str[cc] == 'E' || str[cc] == 'e'))
break;
- return FALSE;
+ return false;
}
fraction += FXSYS_FractionalScale(scale, FXSYS_toDecimalDigit(str[cc]));
scale++;
@@ -186,13 +186,13 @@ static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue,
}
while (cc < len) {
if (FXSYS_isDecimalDigit(str[cc]))
- return FALSE;
+ return false;
lcnum.m_Exponent = lcnum.m_Exponent * 10 + str[cc] - '0';
cc++;
}
lcnum.m_Exponent = bExpSign ? -lcnum.m_Exponent : lcnum.m_Exponent;
}
- return TRUE;
+ return true;
}
CFX_LCNumeric::CFX_LCNumeric() {
@@ -242,11 +242,11 @@ double CFX_LCNumeric::GetDouble() const {
}
CFX_WideString CFX_LCNumeric::ToString() const {
- return ToString(8, TRUE);
+ return ToString(8, true);
}
CFX_WideString CFX_LCNumeric::ToString(int32_t nTreading,
- FX_BOOL bTrimTailZeros) const {
+ bool bTrimTailZeros) const {
CFX_WideString wsFormat;
wsFormat.Format(L"%%.%df", nTreading);
CFX_WideString wsResult;
@@ -258,7 +258,7 @@ CFX_WideString CFX_LCNumeric::ToString(int32_t nTreading,
return wsResult;
}
-CFX_FormatString::CFX_FormatString(IFX_LocaleMgr* pLocaleMgr, FX_BOOL bUseLCID)
+CFX_FormatString::CFX_FormatString(IFX_LocaleMgr* pLocaleMgr, bool bUseLCID)
: m_pLocaleMgr(pLocaleMgr), m_bUseLCID(bUseLCID) {}
CFX_FormatString::~CFX_FormatString() {}
void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString,
@@ -267,8 +267,8 @@ void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString,
const FX_WCHAR* pStr = wsFormatString.c_str();
const FX_WCHAR* pToken = pStr;
const FX_WCHAR* pEnd = pStr + iStrLen;
- FX_BOOL iQuote = FALSE;
- while (TRUE) {
+ bool iQuote = false;
+ while (true) {
if (pStr >= pEnd) {
CFX_WideString sub(pToken, pStr - pToken);
wsPatterns.Add(sub);
@@ -376,7 +376,7 @@ FX_LOCALECATEGORY CFX_FormatString::GetCategory(
int32_t ccf = 0;
int32_t iLenf = wsPattern.GetLength();
const FX_WCHAR* pStr = wsPattern.c_str();
- FX_BOOL bBraceOpen = FALSE;
+ bool bBraceOpen = false;
CFX_WideStringC wsConstChars(gs_wsConstChars);
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
@@ -384,7 +384,7 @@ FX_LOCALECATEGORY CFX_FormatString::GetCategory(
} else if (!bBraceOpen && wsConstChars.Find(pStr[ccf]) == -1) {
CFX_WideString wsCategory(pStr[ccf]);
ccf++;
- while (TRUE) {
+ while (true) {
if (ccf == iLenf) {
return eCategory;
}
@@ -392,7 +392,7 @@ FX_LOCALECATEGORY CFX_FormatString::GetCategory(
break;
}
if (pStr[ccf] == '{') {
- bBraceOpen = TRUE;
+ bBraceOpen = true;
break;
}
wsCategory += pStr[ccf];
@@ -421,7 +421,7 @@ FX_LOCALECATEGORY CFX_FormatString::GetCategory(
return FX_LOCALECATEGORY_Null;
}
} else if (pStr[ccf] == '}') {
- bBraceOpen = FALSE;
+ bBraceOpen = false;
}
ccf++;
}
@@ -464,7 +464,7 @@ IFX_Locale* CFX_FormatString::GetTextFormat(const CFX_WideString& wsPattern,
int32_t ccf = 0;
int32_t iLenf = wsPattern.GetLength();
const FX_WCHAR* pStr = wsPattern.c_str();
- FX_BOOL bBrackOpen = FALSE;
+ bool bBrackOpen = false;
CFX_WideStringC wsConstChars(gs_wsConstChars);
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
@@ -491,7 +491,7 @@ IFX_Locale* CFX_FormatString::GetTextFormat(const CFX_WideString& wsPattern,
}
pLocale = GetPatternLocale(wsLCID);
} else if (pStr[ccf] == '{') {
- bBrackOpen = TRUE;
+ bBrackOpen = true;
break;
}
ccf++;
@@ -521,8 +521,8 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern,
int32_t ccf = 0;
int32_t iLenf = wsPattern.GetLength();
const FX_WCHAR* pStr = wsPattern.c_str();
- FX_BOOL bFindDot = FALSE;
- FX_BOOL bBrackOpen = FALSE;
+ bool bFindDot = false;
+ bool bBrackOpen = false;
CFX_WideStringC wsConstChars(gs_wsConstChars);
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
@@ -538,7 +538,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern,
ccf++;
}
if (wsCategory != FX_WSTRC(L"num")) {
- bBrackOpen = TRUE;
+ bBrackOpen = true;
ccf = 0;
continue;
}
@@ -551,7 +551,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern,
}
pLocale = GetPatternLocale(wsLCID);
} else if (pStr[ccf] == '{') {
- bBrackOpen = TRUE;
+ bBrackOpen = true;
break;
} else if (pStr[ccf] == '.') {
CFX_WideString wsSubCategory;
@@ -578,7 +578,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern,
iDotIndex = wsSubCategory.Find('.');
if (iDotIndex > 0) {
iDotIndex += wsPurgePattern.GetLength();
- bFindDot = TRUE;
+ bFindDot = true;
dwStyle |= FX_NUMSTYLE_DotVorv;
}
wsPurgePattern += wsSubCategory;
@@ -600,7 +600,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern,
}
if (!bFindDot) {
if (pStr[ccf] == '.' || pStr[ccf] == 'V' || pStr[ccf] == 'v') {
- bFindDot = TRUE;
+ bFindDot = true;
iDotIndex = wsPurgePattern.GetLength() - 1;
dwStyle |= FX_NUMSTYLE_DotVorv;
}
@@ -615,9 +615,9 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern,
}
return pLocale;
}
-static FX_BOOL FX_GetNumericDotIndex(const CFX_WideString& wsNum,
- const CFX_WideString& wsDotSymbol,
- int32_t& iDotIndex) {
+static bool FX_GetNumericDotIndex(const CFX_WideString& wsNum,
+ const CFX_WideString& wsDotSymbol,
+ int32_t& iDotIndex) {
int32_t ccf = 0;
int32_t iLenf = wsNum.GetLength();
const FX_WCHAR* pStr = wsNum.c_str();
@@ -628,28 +628,28 @@ static FX_BOOL FX_GetNumericDotIndex(const CFX_WideString& wsNum,
} else if (ccf + iLenDot <= iLenf &&
!FXSYS_wcsncmp(pStr + ccf, wsDotSymbol.c_str(), iLenDot)) {
iDotIndex = ccf;
- return TRUE;
+ return true;
}
ccf++;
}
iDotIndex = wsNum.Find('.');
if (iDotIndex < 0) {
iDotIndex = iLenf;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CFX_FormatString::ParseText(const CFX_WideString& wsSrcText,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsValue) {
+bool CFX_FormatString::ParseText(const CFX_WideString& wsSrcText,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsValue) {
wsValue.clear();
if (wsSrcText.IsEmpty() || wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
CFX_WideString wsTextFormat;
GetTextFormat(wsPattern, FX_WSTRC(L"text"), wsTextFormat);
if (wsTextFormat.IsEmpty()) {
- return FALSE;
+ return false;
}
int32_t iText = 0, iPattern = 0;
const FX_WCHAR* pStrText = wsSrcText.c_str();
@@ -665,7 +665,7 @@ FX_BOOL CFX_FormatString::ParseText(const CFX_WideString& wsSrcText,
if (iText + iLiteralLen > iLenText ||
FXSYS_wcsncmp(pStrText + iText, wsLiteral.c_str(), iLiteralLen)) {
wsValue = wsSrcText;
- return FALSE;
+ return false;
}
iText += iLiteralLen;
iPattern++;
@@ -702,7 +702,7 @@ FX_BOOL CFX_FormatString::ParseText(const CFX_WideString& wsSrcText,
default:
if (pStrPattern[iPattern] != pStrText[iText]) {
wsValue = wsSrcText;
- return FALSE;
+ return false;
}
iPattern++;
iText++;
@@ -711,12 +711,12 @@ FX_BOOL CFX_FormatString::ParseText(const CFX_WideString& wsSrcText,
}
return iPattern == iLenPattern && iText == iLenText;
}
-FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
- const CFX_WideString& wsPattern,
- FX_FLOAT& fValue) {
+bool CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
+ const CFX_WideString& wsPattern,
+ FX_FLOAT& fValue) {
fValue = 0.0f;
if (wsSrcNum.IsEmpty() || wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
int32_t dot_index_f = -1;
uint32_t dwFormatStyle = 0;
@@ -724,7 +724,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
IFX_Locale* pLocale =
GetNumericFormat(wsPattern, dot_index_f, dwFormatStyle, wsNumFormat);
if (!pLocale || wsNumFormat.IsEmpty()) {
- return FALSE;
+ return false;
}
int32_t iExponent = 0;
CFX_WideString wsDotSymbol;
@@ -742,15 +742,15 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
int lenf = wsNumFormat.GetLength();
double dbRetValue = 0;
double coeff = 1;
- FX_BOOL bHavePercentSymbol = FALSE;
- FX_BOOL bNeg = FALSE;
- FX_BOOL bReverseParse = FALSE;
+ bool bHavePercentSymbol = false;
+ bool bNeg = false;
+ bool bReverseParse = false;
int32_t dot_index = 0;
if (!FX_GetNumericDotIndex(wsSrcNum, wsDotSymbol, dot_index) &&
(dwFormatStyle & FX_NUMSTYLE_DotVorv)) {
- bReverseParse = TRUE;
+ bReverseParse = true;
}
- bReverseParse = FALSE;
+ bReverseParse = false;
if (bReverseParse) {
ccf = lenf - 1;
cc = len - 1;
@@ -762,7 +762,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
cc -= iLiteralLen - 1;
if (cc < 0 ||
FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
- return FALSE;
+ return false;
}
cc--;
ccf--;
@@ -770,7 +770,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
}
case '9':
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
dbRetValue = dbRetValue * coeff + (str[cc] - '0') * 0.1;
coeff *= 0.1;
@@ -799,10 +799,10 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else {
cc -= iMinusLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
- return FALSE;
+ return false;
}
cc--;
- bNeg = TRUE;
+ bNeg = true;
}
ccf--;
break;
@@ -812,18 +812,18 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else {
cc -= iMinusLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
- return FALSE;
+ return false;
}
cc--;
- bNeg = TRUE;
+ bNeg = true;
}
ccf--;
break;
case 'E': {
if (cc >= dot_index) {
- return FALSE;
+ return false;
}
- FX_BOOL bExpSign = FALSE;
+ bool bExpSign = false;
while (cc >= 0) {
if (str[cc] == 'E' || str[cc] == 'e') {
break;
@@ -838,10 +838,10 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else if (cc - iMinusLen + 1 > 0 &&
!FXSYS_wcsncmp(str + (cc - iMinusLen + 1),
wsMinus.c_str(), iMinusLen)) {
- bExpSign = TRUE;
+ bExpSign = true;
cc -= iMinusLen;
} else {
- return FALSE;
+ return false;
}
}
cc--;
@@ -855,7 +855,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
int32_t iSymbolLen = wsSymbol.GetLength();
cc -= iSymbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSymbolLen)) {
- return FALSE;
+ return false;
}
cc--;
ccf--;
@@ -863,7 +863,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case 'r':
if (ccf - 1 >= 0 && strf[ccf - 1] == 'c') {
if (str[cc] == 'R' && cc - 1 >= 0 && str[cc - 1] == 'C') {
- bNeg = TRUE;
+ bNeg = true;
cc -= 2;
}
ccf -= 2;
@@ -876,7 +876,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
if (str[cc] == ' ') {
cc++;
} else if (str[cc] == 'R' && cc - 1 >= 0 && str[cc - 1] == 'C') {
- bNeg = TRUE;
+ bNeg = true;
cc -= 2;
}
ccf -= 2;
@@ -887,7 +887,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case 'b':
if (ccf - 1 >= 0 && strf[ccf - 1] == 'd') {
if (str[cc] == 'B' && cc - 1 >= 0 && str[cc - 1] == 'D') {
- bNeg = TRUE;
+ bNeg = true;
cc -= 2;
}
ccf -= 2;
@@ -900,7 +900,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
if (str[cc] == ' ') {
cc++;
} else if (str[cc] == 'B' && cc - 1 >= 0 && str[cc - 1] == 'D') {
- bNeg = TRUE;
+ bNeg = true;
cc -= 2;
}
ccf -= 2;
@@ -911,7 +911,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case '.':
case 'V':
case 'v':
- return FALSE;
+ return false;
case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
@@ -919,11 +919,11 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
cc -= iSysmbolLen - 1;
if (cc < 0 ||
FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSysmbolLen)) {
- return FALSE;
+ return false;
}
cc--;
ccf--;
- bHavePercentSymbol = TRUE;
+ bHavePercentSymbol = true;
} break;
case '8':
while (ccf < lenf && strf[ccf] == '8') {
@@ -950,25 +950,25 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} break;
case '(':
if (str[cc] == L'(') {
- bNeg = TRUE;
+ bNeg = true;
} else if (str[cc] != L' ') {
- return FALSE;
+ return false;
}
cc--;
ccf--;
break;
case ')':
if (str[cc] == L')') {
- bNeg = TRUE;
+ bNeg = true;
} else if (str[cc] != L' ') {
- return FALSE;
+ return false;
}
cc--;
ccf--;
break;
default:
if (strf[ccf] != str[cc]) {
- return FALSE;
+ return false;
}
cc--;
ccf--;
@@ -986,7 +986,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
int32_t iLiteralLen = wsLiteral.GetLength();
cc -= iLiteralLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
- return FALSE;
+ return false;
}
cc--;
ccf--;
@@ -994,7 +994,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
}
case '9':
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
dbRetValue = dbRetValue + (str[cc] - '0') * coeff;
coeff *= 10;
@@ -1027,10 +1027,10 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else {
cc -= iMinusLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
- return FALSE;
+ return false;
}
cc--;
- bNeg = TRUE;
+ bNeg = true;
}
ccf--;
break;
@@ -1040,18 +1040,18 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else {
cc -= iMinusLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
- return FALSE;
+ return false;
}
cc--;
- bNeg = TRUE;
+ bNeg = true;
}
ccf--;
break;
case 'E': {
if (cc >= dot_index) {
- return FALSE;
+ return false;
}
- FX_BOOL bExpSign = FALSE;
+ bool bExpSign = false;
while (cc >= 0) {
if (str[cc] == 'E' || str[cc] == 'e') {
break;
@@ -1066,10 +1066,10 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else if (cc - iMinusLen + 1 > 0 &&
!FXSYS_wcsncmp(str + (cc - iMinusLen + 1), wsMinus.c_str(),
iMinusLen)) {
- bExpSign = TRUE;
+ bExpSign = true;
cc -= iMinusLen;
} else {
- return FALSE;
+ return false;
}
}
cc--;
@@ -1082,7 +1082,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
int32_t iSymbolLen = wsSymbol.GetLength();
cc -= iSymbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSymbolLen)) {
- return FALSE;
+ return false;
}
cc--;
ccf--;
@@ -1090,7 +1090,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case 'r':
if (ccf - 1 >= 0 && strf[ccf - 1] == 'c') {
if (str[cc] == 'R' && cc - 1 >= 0 && str[cc - 1] == 'C') {
- bNeg = TRUE;
+ bNeg = true;
cc -= 2;
}
ccf -= 2;
@@ -1103,7 +1103,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
if (str[cc] == ' ') {
cc++;
} else if (str[cc] == 'R' && cc - 1 >= 0 && str[cc - 1] == 'C') {
- bNeg = TRUE;
+ bNeg = true;
cc -= 2;
}
ccf -= 2;
@@ -1114,7 +1114,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case 'b':
if (ccf - 1 >= 0 && strf[ccf - 1] == 'd') {
if (str[cc] == 'B' && cc - 1 >= 0 && str[cc - 1] == 'D') {
- bNeg = TRUE;
+ bNeg = true;
cc -= 2;
}
ccf -= 2;
@@ -1127,7 +1127,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
if (str[cc] == ' ') {
cc++;
} else if (str[cc] == 'B' && cc - 1 >= 0 && str[cc - 1] == 'D') {
- bNeg = TRUE;
+ bNeg = true;
cc -= 2;
}
ccf -= 2;
@@ -1138,21 +1138,21 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case '.':
case 'V':
case 'v':
- return FALSE;
+ return false;
case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
int32_t iSysmbolLen = wsSymbol.GetLength();
cc -= iSysmbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSysmbolLen)) {
- return FALSE;
+ return false;
}
cc--;
ccf--;
- bHavePercentSymbol = TRUE;
+ bHavePercentSymbol = true;
} break;
case '8':
- return FALSE;
+ return false;
case ',': {
if (cc >= 0) {
cc -= iGroupLen - 1;
@@ -1167,32 +1167,32 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} break;
case '(':
if (str[cc] == L'(') {
- bNeg = TRUE;
+ bNeg = true;
} else if (str[cc] != L' ') {
- return FALSE;
+ return false;
}
cc--;
ccf--;
break;
case ')':
if (str[cc] == L')') {
- bNeg = TRUE;
+ bNeg = true;
} else if (str[cc] != L' ') {
- return FALSE;
+ return false;
}
cc--;
ccf--;
break;
default:
if (strf[ccf] != str[cc]) {
- return FALSE;
+ return false;
}
cc--;
ccf--;
}
}
if (cc >= 0) {
- return FALSE;
+ return false;
}
if (!bReverseParse) {
ccf = dot_index_f + 1;
@@ -1205,7 +1205,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
int32_t iLiteralLen = wsLiteral.GetLength();
if (cc + iLiteralLen > len ||
FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
- return FALSE;
+ return false;
}
cc += iLiteralLen;
ccf++;
@@ -1213,7 +1213,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
}
case '9':
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
{
dbRetValue = dbRetValue + (str[cc] - '0') * coeff;
@@ -1248,9 +1248,9 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else {
if (cc + iMinusLen > len ||
FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
- return FALSE;
+ return false;
}
- bNeg = TRUE;
+ bNeg = true;
cc += iMinusLen;
}
ccf++;
@@ -1261,24 +1261,24 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else {
if (cc + iMinusLen > len ||
FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
- return FALSE;
+ return false;
}
- bNeg = TRUE;
+ bNeg = true;
cc += iMinusLen;
}
ccf++;
break;
case 'E': {
if (cc >= len || (str[cc] != 'E' && str[cc] != 'e')) {
- return FALSE;
+ return false;
}
- FX_BOOL bExpSign = FALSE;
+ bool bExpSign = false;
cc++;
if (cc < len) {
if (str[cc] == '+') {
cc++;
} else if (str[cc] == '-') {
- bExpSign = TRUE;
+ bExpSign = true;
cc++;
}
}
@@ -1299,7 +1299,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
int32_t iSymbolLen = wsSymbol.GetLength();
if (cc + iSymbolLen > len ||
FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSymbolLen)) {
- return FALSE;
+ return false;
}
cc += iSymbolLen;
ccf++;
@@ -1307,7 +1307,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case 'c':
if (ccf + 1 < lenf && strf[ccf + 1] == 'r') {
if (str[cc] == 'C' && cc + 1 < len && str[cc + 1] == 'R') {
- bNeg = TRUE;
+ bNeg = true;
cc += 2;
}
ccf += 2;
@@ -1318,7 +1318,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
if (str[cc] == ' ') {
cc++;
} else if (str[cc] == 'C' && cc + 1 < len && str[cc + 1] == 'R') {
- bNeg = TRUE;
+ bNeg = true;
cc += 2;
}
ccf += 2;
@@ -1327,7 +1327,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case 'd':
if (ccf + 1 < lenf && strf[ccf + 1] == 'b') {
if (str[cc] == 'D' && cc + 1 < len && str[cc + 1] == 'B') {
- bNeg = TRUE;
+ bNeg = true;
cc += 2;
}
ccf += 2;
@@ -1338,7 +1338,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
if (str[cc] == ' ') {
cc++;
} else if (str[cc] == 'D' && cc + 1 < len && str[cc + 1] == 'B') {
- bNeg = TRUE;
+ bNeg = true;
cc += 2;
}
ccf += 2;
@@ -1347,7 +1347,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case '.':
case 'V':
case 'v':
- return FALSE;
+ return false;
case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
@@ -1357,7 +1357,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
cc += iSysmbolLen;
}
ccf++;
- bHavePercentSymbol = TRUE;
+ bHavePercentSymbol = true;
} break;
case '8': {
while (ccf < lenf && strf[ccf] == '8') {
@@ -1378,32 +1378,32 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} break;
case '(':
if (str[cc] == L'(') {
- bNeg = TRUE;
+ bNeg = true;
} else if (str[cc] != L' ') {
- return FALSE;
+ return false;
}
cc++;
ccf++;
break;
case ')':
if (str[cc] == L')') {
- bNeg = TRUE;
+ bNeg = true;
} else if (str[cc] != L' ') {
- return FALSE;
+ return false;
}
cc++;
ccf++;
break;
default:
if (strf[ccf] != str[cc]) {
- return FALSE;
+ return false;
}
cc++;
ccf++;
}
}
if (cc != len) {
- return FALSE;
+ return false;
}
}
if (iExponent) {
@@ -1416,15 +1416,15 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
dbRetValue = -dbRetValue;
}
fValue = (FX_FLOAT)dbRetValue;
- return TRUE;
+ return true;
}
-FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsValue) {
+bool CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsValue) {
wsValue.clear();
if (wsSrcNum.IsEmpty() || wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
int32_t dot_index_f = -1;
uint32_t dwFormatStyle = 0;
@@ -1432,7 +1432,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
IFX_Locale* pLocale =
GetNumericFormat(wsPattern, dot_index_f, dwFormatStyle, wsNumFormat);
if (!pLocale || wsNumFormat.IsEmpty()) {
- return FALSE;
+ return false;
}
int32_t iExponent = 0;
CFX_WideString wsDotSymbol;
@@ -1448,15 +1448,15 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
int len = wsSrcNum.GetLength();
const FX_WCHAR* strf = wsNumFormat.c_str();
int lenf = wsNumFormat.GetLength();
- FX_BOOL bHavePercentSymbol = FALSE;
- FX_BOOL bNeg = FALSE;
- FX_BOOL bReverseParse = FALSE;
+ bool bHavePercentSymbol = false;
+ bool bNeg = false;
+ bool bReverseParse = false;
int32_t dot_index = 0;
if (!FX_GetNumericDotIndex(wsSrcNum, wsDotSymbol, dot_index) &&
(dwFormatStyle & FX_NUMSTYLE_DotVorv)) {
- bReverseParse = TRUE;
+ bReverseParse = true;
}
- bReverseParse = FALSE;
+ bReverseParse = false;
ccf = dot_index_f - 1;
cc = dot_index - 1;
while (ccf >= 0 && cc >= 0) {
@@ -1466,7 +1466,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
int32_t iLiteralLen = wsLiteral.GetLength();
cc -= iLiteralLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
- return FALSE;
+ return false;
}
cc--;
ccf--;
@@ -1474,7 +1474,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
}
case '9':
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
wsValue = str[cc] + wsValue;
cc--;
@@ -1504,10 +1504,10 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else {
cc -= iMinusLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
- return FALSE;
+ return false;
}
cc--;
- bNeg = TRUE;
+ bNeg = true;
}
ccf--;
break;
@@ -1517,18 +1517,18 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else {
cc -= iMinusLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
- return FALSE;
+ return false;
}
cc--;
- bNeg = TRUE;
+ bNeg = true;
}
ccf--;
break;
case 'E': {
if (cc >= dot_index) {
- return FALSE;
+ return false;
}
- FX_BOOL bExpSign = FALSE;
+ bool bExpSign = false;
while (cc >= 0) {
if (str[cc] == 'E' || str[cc] == 'e') {
break;
@@ -1543,10 +1543,10 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else if (cc - iMinusLen + 1 > 0 &&
!FXSYS_wcsncmp(str + (cc - iMinusLen + 1), wsMinus.c_str(),
iMinusLen)) {
- bExpSign = TRUE;
+ bExpSign = true;
cc -= iMinusLen;
} else {
- return FALSE;
+ return false;
}
}
cc--;
@@ -1559,7 +1559,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
int32_t iSymbolLen = wsSymbol.GetLength();
cc -= iSymbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSymbolLen)) {
- return FALSE;
+ return false;
}
cc--;
ccf--;
@@ -1567,7 +1567,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case 'r':
if (ccf - 1 >= 0 && strf[ccf - 1] == 'c') {
if (str[cc] == 'R' && cc - 1 >= 0 && str[cc - 1] == 'C') {
- bNeg = TRUE;
+ bNeg = true;
cc -= 2;
}
ccf -= 2;
@@ -1580,7 +1580,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
if (str[cc] == ' ') {
cc++;
} else if (str[cc] == 'R' && cc - 1 >= 0 && str[cc - 1] == 'C') {
- bNeg = TRUE;
+ bNeg = true;
cc -= 2;
}
ccf -= 2;
@@ -1591,7 +1591,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case 'b':
if (ccf - 1 >= 0 && strf[ccf - 1] == 'd') {
if (str[cc] == 'B' && cc - 1 >= 0 && str[cc - 1] == 'D') {
- bNeg = TRUE;
+ bNeg = true;
cc -= 2;
}
ccf -= 2;
@@ -1604,7 +1604,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
if (str[cc] == ' ') {
cc++;
} else if (str[cc] == 'B' && cc - 1 >= 0 && str[cc - 1] == 'D') {
- bNeg = TRUE;
+ bNeg = true;
cc -= 2;
}
ccf -= 2;
@@ -1615,21 +1615,21 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case '.':
case 'V':
case 'v':
- return FALSE;
+ return false;
case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
int32_t iSysmbolLen = wsSymbol.GetLength();
cc -= iSysmbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSysmbolLen)) {
- return FALSE;
+ return false;
}
cc--;
ccf--;
- bHavePercentSymbol = TRUE;
+ bHavePercentSymbol = true;
} break;
case '8':
- return FALSE;
+ return false;
case ',': {
if (cc >= 0) {
cc -= iGroupLen - 1;
@@ -1644,25 +1644,25 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} break;
case '(':
if (str[cc] == L'(') {
- bNeg = TRUE;
+ bNeg = true;
} else if (str[cc] != L' ') {
- return FALSE;
+ return false;
}
cc--;
ccf--;
break;
case ')':
if (str[cc] == L')') {
- bNeg = TRUE;
+ bNeg = true;
} else if (str[cc] != L' ') {
- return FALSE;
+ return false;
}
cc--;
ccf--;
break;
default:
if (strf[ccf] != str[cc]) {
- return FALSE;
+ return false;
}
cc--;
ccf--;
@@ -1670,11 +1670,11 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
}
if (cc >= 0) {
if (str[cc] == '-') {
- bNeg = TRUE;
+ bNeg = true;
cc--;
}
if (cc >= 0) {
- return FALSE;
+ return false;
}
}
if (dot_index < len && (dwFormatStyle & FX_NUMSTYLE_DotVorv)) {
@@ -1690,7 +1690,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
int32_t iLiteralLen = wsLiteral.GetLength();
if (cc + iLiteralLen > len ||
FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
- return FALSE;
+ return false;
}
cc += iLiteralLen;
ccf++;
@@ -1698,7 +1698,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
}
case '9':
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
{ wsValue += str[cc]; }
cc++;
@@ -1728,9 +1728,9 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else {
if (cc + iMinusLen > len ||
FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
- return FALSE;
+ return false;
}
- bNeg = TRUE;
+ bNeg = true;
cc += iMinusLen;
}
ccf++;
@@ -1741,24 +1741,24 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} else {
if (cc + iMinusLen > len ||
FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
- return FALSE;
+ return false;
}
- bNeg = TRUE;
+ bNeg = true;
cc += iMinusLen;
}
ccf++;
break;
case 'E': {
if (cc >= len || (str[cc] != 'E' && str[cc] != 'e')) {
- return FALSE;
+ return false;
}
- FX_BOOL bExpSign = FALSE;
+ bool bExpSign = false;
cc++;
if (cc < len) {
if (str[cc] == '+') {
cc++;
} else if (str[cc] == '-') {
- bExpSign = TRUE;
+ bExpSign = true;
cc++;
}
}
@@ -1779,7 +1779,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
int32_t iSymbolLen = wsSymbol.GetLength();
if (cc + iSymbolLen > len ||
FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSymbolLen)) {
- return FALSE;
+ return false;
}
cc += iSymbolLen;
ccf++;
@@ -1787,7 +1787,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case 'c':
if (ccf + 1 < lenf && strf[ccf + 1] == 'r') {
if (str[cc] == 'C' && cc + 1 < len && str[cc + 1] == 'R') {
- bNeg = TRUE;
+ bNeg = true;
cc += 2;
}
ccf += 2;
@@ -1798,7 +1798,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
if (str[cc] == ' ') {
cc++;
} else if (str[cc] == 'C' && cc + 1 < len && str[cc + 1] == 'R') {
- bNeg = TRUE;
+ bNeg = true;
cc += 2;
}
ccf += 2;
@@ -1807,7 +1807,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case 'd':
if (ccf + 1 < lenf && strf[ccf + 1] == 'b') {
if (str[cc] == 'D' && cc + 1 < len && str[cc + 1] == 'B') {
- bNeg = TRUE;
+ bNeg = true;
cc += 2;
}
ccf += 2;
@@ -1818,7 +1818,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
if (str[cc] == ' ') {
cc++;
} else if (str[cc] == 'D' && cc + 1 < len && str[cc + 1] == 'B') {
- bNeg = TRUE;
+ bNeg = true;
cc += 2;
}
ccf += 2;
@@ -1827,7 +1827,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
case '.':
case 'V':
case 'v':
- return FALSE;
+ return false;
case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
@@ -1837,7 +1837,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
cc += iSysmbolLen;
}
ccf++;
- bHavePercentSymbol = TRUE;
+ bHavePercentSymbol = true;
} break;
case '8': {
while (ccf < lenf && strf[ccf] == '8') {
@@ -1857,32 +1857,32 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
} break;
case '(':
if (str[cc] == L'(') {
- bNeg = TRUE;
+ bNeg = true;
} else if (str[cc] != L' ') {
- return FALSE;
+ return false;
}
cc++;
ccf++;
break;
case ')':
if (str[cc] == L')') {
- bNeg = TRUE;
+ bNeg = true;
} else if (str[cc] != L' ') {
- return FALSE;
+ return false;
}
cc++;
ccf++;
break;
default:
if (strf[ccf] != str[cc]) {
- return FALSE;
+ return false;
}
cc++;
ccf++;
}
}
if (cc != len) {
- return FALSE;
+ return false;
}
}
if (iExponent || bHavePercentSymbol) {
@@ -1898,7 +1898,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum,
if (bNeg) {
wsValue = L'-' + wsValue;
}
- return TRUE;
+ return true;
}
FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(
const CFX_WideString& wsPattern,
@@ -1912,7 +1912,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(
int32_t iLenf = wsPattern.GetLength();
const FX_WCHAR* pStr = wsPattern.c_str();
int32_t iFindCategory = 0;
- FX_BOOL bBraceOpen = FALSE;
+ bool bBraceOpen = false;
CFX_WideStringC wsConstChars(gs_wsConstChars);
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
@@ -1961,7 +1961,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(
}
pLocale = GetPatternLocale(wsLCID);
} else if (pStr[ccf] == '{') {
- bBraceOpen = TRUE;
+ bBraceOpen = true;
break;
} else if (pStr[ccf] == '.') {
CFX_WideString wsSubCategory;
@@ -2008,7 +2008,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(
ccf++;
}
} else if (pStr[ccf] == '}') {
- bBraceOpen = FALSE;
+ bBraceOpen = false;
if (!wsTempPattern.IsEmpty()) {
if (eCategory == FX_LOCALECATEGORY_Time) {
wsTimePattern = wsTempPattern;
@@ -2038,11 +2038,11 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(
}
return (FX_DATETIMETYPE)iFindCategory;
}
-static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
- const CFX_WideString& wsDatePattern,
- IFX_Locale* pLocale,
- CFX_Unitime& datetime,
- int32_t& cc) {
+static bool FX_ParseLocaleDate(const CFX_WideString& wsDate,
+ const CFX_WideString& wsDatePattern,
+ IFX_Locale* pLocale,
+ CFX_Unitime& datetime,
+ int32_t& cc) {
int32_t year = 1900;
int32_t month = 1;
int32_t day = 1;
@@ -2058,14 +2058,14 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
int32_t iLiteralLen = wsLiteral.GetLength();
if (cc + iLiteralLen > len ||
FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
- return FALSE;
+ return false;
}
cc += iLiteralLen;
ccf++;
continue;
} else if (wsDateSymbols.Find(strf[ccf]) == -1) {
if (strf[ccf] != str[cc])
- return FALSE;
+ return false;
cc++;
ccf++;
continue;
@@ -2079,7 +2079,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
uint32_t dwSymbol = (dwCharSymbol << 8) | (dwSymbolNum + '0');
if (dwSymbol == FXBSTR_ID(0, 0, 'D', '1')) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
day = str[cc++] - '0';
if (cc < len && FXSYS_isDecimalDigit(str[cc])) {
@@ -2087,7 +2087,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
}
} else if (dwSymbol == FXBSTR_ID(0, 0, 'D', '2')) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
day = str[cc++] - '0';
if (cc < len) {
@@ -2103,7 +2103,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
cc += 3;
} else if (dwSymbol == FXBSTR_ID(0, 0, 'M', '1')) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
month = str[cc++] - '0';
if (cc < len && FXSYS_isDecimalDigit(str[cc])) {
@@ -2111,7 +2111,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
}
} else if (dwSymbol == FXBSTR_ID(0, 0, 'M', '2')) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
month = str[cc++] - '0';
if (cc < len) {
@@ -2121,7 +2121,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
CFX_WideString wsMonthNameAbbr;
uint16_t i = 0;
for (; i < 12; i++) {
- pLocale->GetMonthName(i, wsMonthNameAbbr, TRUE);
+ pLocale->GetMonthName(i, wsMonthNameAbbr, true);
if (wsMonthNameAbbr.IsEmpty()) {
continue;
}
@@ -2138,7 +2138,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
CFX_WideString wsMonthName;
uint16_t i = 0;
for (; i < 12; i++) {
- pLocale->GetMonthName(i, wsMonthName, FALSE);
+ pLocale->GetMonthName(i, wsMonthName, false);
if (wsMonthName.IsEmpty()) {
continue;
}
@@ -2157,7 +2157,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
CFX_WideString wsDayNameAbbr;
uint16_t i = 0;
for (; i < 7; i++) {
- pLocale->GetDayName(i, wsDayNameAbbr, TRUE);
+ pLocale->GetDayName(i, wsDayNameAbbr, true);
if (wsDayNameAbbr.IsEmpty()) {
continue;
}
@@ -2173,7 +2173,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
CFX_WideString wsDayName;
int32_t i = 0;
for (; i < 7; i++) {
- pLocale->GetDayName(i, wsDayName, FALSE);
+ pLocale->GetDayName(i, wsDayName, false);
if (wsDayName == L"") {
continue;
}
@@ -2191,14 +2191,14 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
cc += 2;
} else if (dwSymbol == FXBSTR_ID(0, 0, 'Y', '2')) {
if (cc + 2 > len) {
- return FALSE;
+ return false;
}
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
year = str[cc++] - '0';
if (cc >= len || !FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
year = year * 10 + str[cc++] - '0';
if (year <= 29) {
@@ -2210,11 +2210,11 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
int i = 0;
year = 0;
if (cc + 4 > len) {
- return FALSE;
+ return false;
}
while (i < 4) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
year = year * 10 + str[cc] - '0';
cc++;
@@ -2227,7 +2227,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate,
}
}
if (cc < len) {
- return FALSE;
+ return false;
}
CFX_Unitime ut;
ut.Set(year, month, day);
@@ -2255,11 +2255,11 @@ static void FX_ResolveZone(uint8_t& wHour,
wHour = iMinuteDiff / 60;
wMinute = iMinuteDiff % 60;
}
-static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime,
- const CFX_WideString& wsTimePattern,
- IFX_Locale* pLocale,
- CFX_Unitime& datetime,
- int32_t& cc) {
+static bool FX_ParseLocaleTime(const CFX_WideString& wsTime,
+ const CFX_WideString& wsTimePattern,
+ IFX_Locale* pLocale,
+ CFX_Unitime& datetime,
+ int32_t& cc) {
uint8_t hour = 0;
uint8_t minute = 0;
uint8_t second = 0;
@@ -2269,8 +2269,8 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime,
int len = wsTime.GetLength();
const FX_WCHAR* strf = wsTimePattern.c_str();
int lenf = wsTimePattern.GetLength();
- FX_BOOL bHasA = FALSE;
- FX_BOOL bPM = FALSE;
+ bool bHasA = false;
+ bool bPM = false;
CFX_WideStringC wsTimeSymbols(gs_wsTimeSymbols);
while (cc < len && ccf < lenf) {
if (strf[ccf] == '\'') {
@@ -2278,14 +2278,14 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime,
int32_t iLiteralLen = wsLiteral.GetLength();
if (cc + iLiteralLen > len ||
FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
- return FALSE;
+ return false;
}
cc += iLiteralLen;
ccf++;
continue;
} else if (wsTimeSymbols.Find(strf[ccf]) == -1) {
if (strf[ccf] != str[cc])
- return FALSE;
+ return false;
cc++;
ccf++;
continue;
@@ -2302,7 +2302,7 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime,
dwSymbol == FXBSTR_ID(0, 0, 'h', '1') ||
dwSymbol == FXBSTR_ID(0, 0, 'K', '1')) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
hour = str[cc++] - '0';
if (cc < len && FXSYS_isDecimalDigit(str[cc])) {
@@ -2316,14 +2316,14 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime,
dwSymbol == FXBSTR_ID(0, 0, 'h', '2') ||
dwSymbol == FXBSTR_ID(0, 0, 'K', '2')) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
hour = str[cc++] - '0';
if (cc >= len) {
- return FALSE;
+ return false;
}
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
hour = hour * 10 + str[cc++] - '0';
if (dwSymbol == FXBSTR_ID(0, 0, 'K', '2') && hour == 24) {
@@ -2331,7 +2331,7 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime,
}
} else if (dwSymbol == FXBSTR_ID(0, 0, 'M', '1')) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
minute = str[cc++] - '0';
if (cc < len && FXSYS_isDecimalDigit(str[cc])) {
@@ -2339,19 +2339,19 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime,
}
} else if (dwSymbol == FXBSTR_ID(0, 0, 'M', '2')) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
minute = str[cc++] - '0';
if (cc >= len) {
- return FALSE;
+ return false;
}
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
minute = minute * 10 + str[cc++] - '0';
} else if (dwSymbol == FXBSTR_ID(0, 0, 'S', '1')) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
second = str[cc++] - '0';
if (cc < len && FXSYS_isDecimalDigit(str[cc])) {
@@ -2359,42 +2359,42 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime,
}
} else if (dwSymbol == FXBSTR_ID(0, 0, 'S', '2')) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
second = str[cc++] - '0';
if (cc >= len) {
- return FALSE;
+ return false;
}
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
second = second * 10 + str[cc++] - '0';
} else if (dwSymbol == FXBSTR_ID(0, 0, 'F', '3')) {
if (cc + 3 >= len) {
- return FALSE;
+ return false;
}
int i = 0;
while (i < 3) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
millisecond = millisecond * 10 + str[cc++] - '0';
i++;
}
} else if (dwSymbol == FXBSTR_ID(0, 0, 'A', '1')) {
CFX_WideString wsAM;
- pLocale->GetMeridiemName(wsAM, TRUE);
+ pLocale->GetMeridiemName(wsAM, true);
CFX_WideString wsPM;
- pLocale->GetMeridiemName(wsPM, FALSE);
+ pLocale->GetMeridiemName(wsPM, false);
if ((cc + wsAM.GetLength() <= len) &&
(CFX_WideStringC(str + cc, wsAM.GetLength()) == wsAM)) {
cc += wsAM.GetLength();
- bHasA = TRUE;
+ bHasA = true;
} else if ((cc + wsPM.GetLength() <= len) &&
(CFX_WideStringC(str + cc, wsPM.GetLength()) == wsPM)) {
cc += wsPM.GetLength();
- bHasA = TRUE;
- bPM = TRUE;
+ bHasA = true;
+ bPM = true;
}
} else if (dwSymbol == FXBSTR_ID(0, 0, 'Z', '1')) {
if (cc + 3 > len) {
@@ -2452,54 +2452,54 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime,
return !!cc;
}
-FX_BOOL CFX_FormatString::ParseDateTime(const CFX_WideString& wsSrcDateTime,
- const CFX_WideString& wsPattern,
- FX_DATETIMETYPE eDateTimeType,
- CFX_Unitime& dtValue) {
+bool CFX_FormatString::ParseDateTime(const CFX_WideString& wsSrcDateTime,
+ const CFX_WideString& wsPattern,
+ FX_DATETIMETYPE eDateTimeType,
+ CFX_Unitime& dtValue) {
dtValue.Set(0);
if (wsSrcDateTime.IsEmpty() || wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
CFX_WideString wsDatePattern, wsTimePattern;
IFX_Locale* pLocale = nullptr;
FX_DATETIMETYPE eCategory =
GetDateTimeFormat(wsPattern, pLocale, wsDatePattern, wsTimePattern);
if (!pLocale) {
- return FALSE;
+ return false;
}
if (eCategory == FX_DATETIMETYPE_Unknown) {
eCategory = eDateTimeType;
}
if (eCategory == FX_DATETIMETYPE_Unknown) {
- return FALSE;
+ return false;
}
if (eCategory == FX_DATETIMETYPE_TimeDate) {
int32_t iStart = 0;
if (!FX_ParseLocaleTime(wsSrcDateTime, wsTimePattern, pLocale, dtValue,
iStart)) {
- return FALSE;
+ return false;
}
if (!FX_ParseLocaleDate(wsSrcDateTime, wsDatePattern, pLocale, dtValue,
iStart)) {
- return FALSE;
+ return false;
}
} else {
int32_t iStart = 0;
if ((eCategory & FX_DATETIMETYPE_Date) &&
!FX_ParseLocaleDate(wsSrcDateTime, wsDatePattern, pLocale, dtValue,
iStart)) {
- return FALSE;
+ return false;
}
if ((eCategory & FX_DATETIMETYPE_Time) &&
!FX_ParseLocaleTime(wsSrcDateTime, wsTimePattern, pLocale, dtValue,
iStart)) {
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CFX_FormatString::ParseZero(const CFX_WideString& wsSrcText,
- const CFX_WideString& wsPattern) {
+bool CFX_FormatString::ParseZero(const CFX_WideString& wsSrcText,
+ const CFX_WideString& wsPattern) {
CFX_WideString wsTextFormat;
GetTextFormat(wsPattern, FX_WSTRC(L"zero"), wsTextFormat);
int32_t iText = 0, iPattern = 0;
@@ -2514,13 +2514,13 @@ FX_BOOL CFX_FormatString::ParseZero(const CFX_WideString& wsSrcText,
int32_t iLiteralLen = wsLiteral.GetLength();
if (iText + iLiteralLen > iLenText ||
FXSYS_wcsncmp(pStrText + iText, wsLiteral.c_str(), iLiteralLen)) {
- return FALSE;
+ return false;
}
iText += iLiteralLen;
iPattern++;
continue;
} else if (pStrPattern[iPattern] != pStrText[iText]) {
- return FALSE;
+ return false;
} else {
iText++;
iPattern++;
@@ -2528,8 +2528,8 @@ FX_BOOL CFX_FormatString::ParseZero(const CFX_WideString& wsSrcText,
}
return iPattern == iLenPattern && iText == iLenText;
}
-FX_BOOL CFX_FormatString::ParseNull(const CFX_WideString& wsSrcText,
- const CFX_WideString& wsPattern) {
+bool CFX_FormatString::ParseNull(const CFX_WideString& wsSrcText,
+ const CFX_WideString& wsPattern) {
CFX_WideString wsTextFormat;
GetTextFormat(wsPattern, FX_WSTRC(L"null"), wsTextFormat);
int32_t iText = 0, iPattern = 0;
@@ -2544,13 +2544,13 @@ FX_BOOL CFX_FormatString::ParseNull(const CFX_WideString& wsSrcText,
int32_t iLiteralLen = wsLiteral.GetLength();
if (iText + iLiteralLen > iLenText ||
FXSYS_wcsncmp(pStrText + iText, wsLiteral.c_str(), iLiteralLen)) {
- return FALSE;
+ return false;
}
iText += iLiteralLen;
iPattern++;
continue;
} else if (pStrPattern[iPattern] != pStrText[iText]) {
- return FALSE;
+ return false;
} else {
iText++;
iPattern++;
@@ -2558,15 +2558,15 @@ FX_BOOL CFX_FormatString::ParseNull(const CFX_WideString& wsSrcText,
}
return iPattern == iLenPattern && iText == iLenText;
}
-FX_BOOL CFX_FormatString::FormatText(const CFX_WideString& wsSrcText,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput) {
+bool CFX_FormatString::FormatText(const CFX_WideString& wsSrcText,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput) {
if (wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
int32_t iLenText = wsSrcText.GetLength();
if (iLenText == 0) {
- return FALSE;
+ return false;
}
CFX_WideString wsTextFormat;
GetTextFormat(wsPattern, FX_WSTRC(L"text"), wsTextFormat);
@@ -2583,14 +2583,14 @@ FX_BOOL CFX_FormatString::FormatText(const CFX_WideString& wsSrcText,
}
case 'A':
if (iText >= iLenText || !FXSYS_iswalpha(pStrText[iText])) {
- return FALSE;
+ return false;
}
wsOutput += pStrText[iText++];
iPattern++;
break;
case 'X':
if (iText >= iLenText) {
- return FALSE;
+ return false;
}
wsOutput += pStrText[iText++];
iPattern++;
@@ -2599,14 +2599,14 @@ FX_BOOL CFX_FormatString::FormatText(const CFX_WideString& wsSrcText,
case '0':
if (iText >= iLenText || (!FXSYS_isDecimalDigit(pStrText[iText]) &&
!FXSYS_iswalpha(pStrText[iText]))) {
- return FALSE;
+ return false;
}
wsOutput += pStrText[iText++];
iPattern++;
break;
case '9':
if (iText >= iLenText || !FXSYS_isDecimalDigit(pStrText[iText])) {
- return FALSE;
+ return false;
}
wsOutput += pStrText[iText++];
iPattern++;
@@ -2620,7 +2620,7 @@ FX_BOOL CFX_FormatString::FormatText(const CFX_WideString& wsSrcText,
}
static int32_t FX_GetNumTrailingLimit(const CFX_WideString& wsFormat,
int iDotPos,
- FX_BOOL& bTrimTailZeros) {
+ bool& bTrimTailZeros) {
if (iDotPos < 0) {
return 0;
}
@@ -2630,16 +2630,16 @@ static int32_t FX_GetNumTrailingLimit(const CFX_WideString& wsFormat,
FX_WCHAR wc = wsFormat[iDotPos];
if (wc == L'z' || wc == L'9' || wc == 'Z') {
iTreading++;
- bTrimTailZeros = (wc == L'9' ? FALSE : TRUE);
+ bTrimTailZeros = (wc == L'9' ? false : true);
}
}
return iTreading;
}
-FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput) {
+bool CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput) {
if (wsInputNum.IsEmpty() || wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
int32_t dot_index_f = -1;
uint32_t dwNumStyle = 0;
@@ -2647,7 +2647,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
IFX_Locale* pLocale =
GetNumericFormat(wsPattern, dot_index_f, dwNumStyle, wsNumFormat);
if (!pLocale || wsNumFormat.IsEmpty()) {
- return FALSE;
+ return false;
}
int32_t cc = 0, ccf = 0;
const FX_WCHAR* strf = wsNumFormat.c_str();
@@ -2700,7 +2700,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
}
}
}
- FX_BOOL bTrimTailZeros = FALSE;
+ bool bTrimTailZeros = false;
int32_t iTreading =
FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros);
int32_t scale = decimal.GetScale();
@@ -2714,12 +2714,12 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
}
CFX_WideString wsGroupSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Grouping, wsGroupSymbol);
- FX_BOOL bNeg = FALSE;
+ bool bNeg = false;
if (wsSrcNum[0] == '-') {
- bNeg = TRUE;
+ bNeg = true;
wsSrcNum.Delete(0, 1);
}
- FX_BOOL bAddNeg = FALSE;
+ bool bAddNeg = false;
const FX_WCHAR* str = wsSrcNum.c_str();
int len = wsSrcNum.GetLength();
int dot_index = wsSrcNum.Find('.');
@@ -2733,7 +2733,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
case '9':
if (cc >= 0) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
wsOutput = str[cc] + wsOutput;
cc--;
@@ -2745,7 +2745,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
case 'z':
if (cc >= 0) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
if (str[0] != '0') {
wsOutput = str[cc] + wsOutput;
@@ -2757,7 +2757,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
case 'Z':
if (cc >= 0) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
if (str[0] == '0') {
wsOutput = L' ' + wsOutput;
@@ -2775,7 +2775,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
CFX_WideString wsMinusSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinusSymbol);
wsOutput = wsMinusSymbol + wsOutput;
- bAddNeg = TRUE;
+ bAddNeg = true;
} else {
wsOutput = L' ' + wsOutput;
}
@@ -2786,7 +2786,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
CFX_WideString wsMinusSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinusSymbol);
wsOutput = wsMinusSymbol + wsOutput;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
ccf--;
break;
@@ -2810,7 +2810,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
wsOutput = L"CR" + wsOutput;
}
ccf -= 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case 'R':
@@ -2821,7 +2821,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
wsOutput = L" " + wsOutput;
}
ccf -= 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case 'b':
@@ -2830,7 +2830,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
wsOutput = L"db" + wsOutput;
}
ccf -= 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case 'B':
@@ -2841,7 +2841,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
wsOutput = L" " + wsOutput;
}
ccf -= 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case '%': {
@@ -2863,7 +2863,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
} else {
wsOutput = L" " + wsOutput;
}
- bAddNeg = TRUE;
+ bAddNeg = true;
ccf--;
break;
case ')':
@@ -2903,7 +2903,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinusymbol);
wsOutput = wsMinusymbol + wsOutput;
}
- return FALSE;
+ return false;
}
if (dot_index_f == wsNumFormat.GetLength()) {
if (!bAddNeg && bNeg) {
@@ -2911,7 +2911,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinusymbol);
wsOutput = wsMinusymbol + wsOutput;
}
- return TRUE;
+ return true;
}
CFX_WideString wsDotSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Decimal, wsDotSymbol);
@@ -2937,7 +2937,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
case '9':
if (cc < len) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
wsOutput += str[cc];
cc++;
@@ -2949,7 +2949,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
case 'z':
if (cc < len) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
wsOutput += str[cc];
cc++;
@@ -2959,7 +2959,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
case 'Z':
if (cc < len) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
wsOutput += str[cc];
cc++;
@@ -2988,7 +2988,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
wsOutput += L"CR";
}
ccf += 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case 'C':
@@ -2999,7 +2999,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
wsOutput += L" ";
}
ccf += 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case 'd':
@@ -3008,7 +3008,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
wsOutput += L"db";
}
ccf += 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case 'D':
@@ -3019,7 +3019,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
wsOutput += L" ";
}
ccf += 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case '%': {
@@ -3048,7 +3048,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
} else {
wsOutput += ' ';
}
- bAddNeg = TRUE;
+ bAddNeg = true;
ccf++;
break;
case ')':
@@ -3069,18 +3069,18 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
wsOutput =
wsMinusymbol + wsOutput[0] + wsOutput.Mid(1, wsOutput.GetLength() - 1);
}
- return TRUE;
+ return true;
}
-FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput) {
+bool CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput) {
int32_t dot_index_f = -1;
uint32_t dwNumStyle = 0;
CFX_WideString wsNumFormat;
IFX_Locale* pLocale =
GetNumericFormat(wsPattern, dot_index_f, dwNumStyle, wsNumFormat);
if (!pLocale || wsNumFormat.IsEmpty()) {
- return FALSE;
+ return false;
}
int32_t cc = 0, ccf = 0;
const FX_WCHAR* strf = wsNumFormat.c_str();
@@ -3131,21 +3131,21 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
if (dwNumStyle & (FX_NUMSTYLE_Percent | FX_NUMSTYLE_Exponent)) {
lcNum = CFX_LCNumeric(dbRetValue);
}
- FX_BOOL bTrimTailZeros = FALSE;
+ bool bTrimTailZeros = false;
int32_t iTreading =
FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros);
CFX_WideString wsNumeric = lcNum.ToString(iTreading, bTrimTailZeros);
if (wsNumeric.IsEmpty()) {
- return FALSE;
+ return false;
}
CFX_WideString wsGroupSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Grouping, wsGroupSymbol);
- FX_BOOL bNeg = FALSE;
+ bool bNeg = false;
if (wsNumeric[0] == '-') {
- bNeg = TRUE;
+ bNeg = true;
wsNumeric.Delete(0, 1);
}
- FX_BOOL bAddNeg = FALSE;
+ bool bAddNeg = false;
const FX_WCHAR* str = wsNumeric.c_str();
int len = wsNumeric.GetLength();
int dot_index = wsNumeric.Find('.');
@@ -3192,7 +3192,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
CFX_WideString wsMinusSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinusSymbol);
wsOutput = wsMinusSymbol + wsOutput;
- bAddNeg = TRUE;
+ bAddNeg = true;
} else {
wsOutput = L' ' + wsOutput;
}
@@ -3203,7 +3203,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
CFX_WideString wsMinusSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinusSymbol);
wsOutput = wsMinusSymbol + wsOutput;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
ccf--;
break;
@@ -3227,7 +3227,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
wsOutput = L"CR" + wsOutput;
}
ccf -= 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case 'R':
@@ -3238,7 +3238,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
wsOutput = L" " + wsOutput;
}
ccf -= 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case 'b':
@@ -3247,7 +3247,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
wsOutput = L"db" + wsOutput;
}
ccf -= 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case 'B':
@@ -3258,7 +3258,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
wsOutput = L" " + wsOutput;
}
ccf -= 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case '%': {
@@ -3280,7 +3280,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
} else {
wsOutput = L" " + wsOutput;
}
- bAddNeg = TRUE;
+ bAddNeg = true;
ccf--;
break;
case ')':
@@ -3320,7 +3320,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinusymbol);
wsOutput = wsMinusymbol + wsOutput;
}
- return FALSE;
+ return false;
}
if (dot_index_f == wsNumFormat.GetLength()) {
if (!bAddNeg && bNeg) {
@@ -3328,7 +3328,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinusymbol);
wsOutput = wsMinusymbol + wsOutput;
}
- return TRUE;
+ return true;
}
CFX_WideString wsDotSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Decimal, wsDotSymbol);
@@ -3396,7 +3396,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
wsOutput += L"CR";
}
ccf += 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case 'C':
@@ -3407,7 +3407,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
wsOutput += L" ";
}
ccf += 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case 'd':
@@ -3416,7 +3416,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
wsOutput += L"db";
}
ccf += 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case 'D':
@@ -3427,7 +3427,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
wsOutput += L" ";
}
ccf += 2;
- bAddNeg = TRUE;
+ bAddNeg = true;
}
break;
case '%': {
@@ -3456,7 +3456,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
} else {
wsOutput += ' ';
}
- bAddNeg = TRUE;
+ bAddNeg = true;
ccf++;
break;
case ')':
@@ -3477,27 +3477,26 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum,
wsOutput =
wsOutput[0] + wsMinusymbol + wsOutput.Mid(1, wsOutput.GetLength() - 1);
}
- return TRUE;
+ return true;
}
-FX_BOOL CFX_FormatString::FormatNum(const CFX_WideString& wsSrcNum,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput) {
+bool CFX_FormatString::FormatNum(const CFX_WideString& wsSrcNum,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput) {
if (wsSrcNum.IsEmpty() || wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
return FormatStrNum(wsSrcNum.AsStringC(), wsPattern, wsOutput);
}
-FX_BOOL CFX_FormatString::FormatNum(FX_FLOAT fNum,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput) {
+bool CFX_FormatString::FormatNum(FX_FLOAT fNum,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput) {
if (wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
CFX_LCNumeric lcNum(fNum);
return FormatLCNumeric(lcNum, wsPattern, wsOutput);
}
-FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate,
- CFX_Unitime& datetime) {
+bool FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime) {
int32_t year = 1900;
int32_t month = 1;
int32_t day = 1;
@@ -3506,17 +3505,17 @@ FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate,
const FX_WCHAR* str = wsDate.c_str();
int len = wsDate.GetLength();
if (len > 10) {
- return FALSE;
+ return false;
}
while (cc < len && cc < 4) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
wYear = wYear * 10 + str[cc++] - '0';
}
year = wYear;
if (cc < 4 || wYear < 1900) {
- return FALSE;
+ return false;
}
if (cc < len) {
if (str[cc] == '-') {
@@ -3526,13 +3525,13 @@ FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate,
uint8_t tmpM = 0;
while (cc < len && cc < cc_start + 2) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
tmpM = tmpM * 10 + str[cc++] - '0';
}
month = tmpM;
if (cc == cc_start + 1 || tmpM > 12 || tmpM < 1) {
- return FALSE;
+ return false;
}
if (cc < len) {
if (str[cc] == '-') {
@@ -3542,44 +3541,44 @@ FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate,
cc_start = cc;
while (cc < len && cc < cc_start + 2) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
tmpD = tmpD * 10 + str[cc++] - '0';
}
day = tmpD;
if (tmpD < 1) {
- return FALSE;
+ return false;
}
if ((tmpM == 1 || tmpM == 3 || tmpM == 5 || tmpM == 7 || tmpM == 8 ||
tmpM == 10 || tmpM == 12) &&
tmpD > 31) {
- return FALSE;
+ return false;
}
if ((tmpM == 4 || tmpM == 6 || tmpM == 9 || tmpM == 11) && tmpD > 30) {
- return FALSE;
+ return false;
}
- FX_BOOL iLeapYear;
+ bool iLeapYear;
if ((wYear % 4 == 0 && wYear % 100 != 0) || wYear % 400 == 0) {
- iLeapYear = TRUE;
+ iLeapYear = true;
} else {
- iLeapYear = FALSE;
+ iLeapYear = false;
}
if ((iLeapYear && tmpM == 2 && tmpD > 29) ||
(!iLeapYear && tmpM == 2 && tmpD > 28)) {
- return FALSE;
+ return false;
}
}
}
CFX_Unitime ut;
ut.Set(year, month, day);
datetime = datetime + ut;
- return TRUE;
+ return true;
}
-FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime,
- CFX_Unitime& datetime,
- IFX_Locale* pLocale) {
+bool FX_TimeFromCanonical(const CFX_WideStringC& wsTime,
+ CFX_Unitime& datetime,
+ IFX_Locale* pLocale) {
if (wsTime.GetLength() == 0) {
- return FALSE;
+ return false;
}
uint8_t hour = 0;
uint8_t minute = 0;
@@ -3590,12 +3589,12 @@ FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime,
int len = wsTime.GetLength();
while (cc < len && cc < 2) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
hour = hour * 10 + str[cc++] - '0';
}
if (cc < 2 || hour >= 24) {
- return FALSE;
+ return false;
}
if (cc < len) {
if (str[cc] == ':') {
@@ -3604,12 +3603,12 @@ FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime,
cc_start = cc;
while (cc < len && cc < cc_start + 2) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
minute = minute * 10 + str[cc++] - '0';
}
if (cc == cc_start + 1 || minute >= 60) {
- return FALSE;
+ return false;
}
if (cc < len) {
if (str[cc] == ':') {
@@ -3618,12 +3617,12 @@ FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime,
cc_start = cc;
while (cc < len && cc < cc_start + 2) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
second = second * 10 + str[cc++] - '0';
}
if (cc == cc_start + 1 || second >= 60) {
- return FALSE;
+ return false;
}
if (cc < len) {
if (str[cc] == '.') {
@@ -3631,12 +3630,12 @@ FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime,
cc_start = cc;
while (cc < len && cc < cc_start + 3) {
if (!FXSYS_isDecimalDigit(str[cc])) {
- return FALSE;
+ return false;
}
millisecond = millisecond * 10 + str[cc++] - '0';
}
if (cc < cc_start + 3)
- return FALSE;
+ return false;
}
if (cc < len) {
FX_TIMEZONE tzDiff;
@@ -3653,7 +3652,7 @@ FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime,
CFX_Unitime ut;
ut.Set(0, 0, 0, hour, minute, second, millisecond);
datetime = datetime + ut;
- return TRUE;
+ return true;
}
static uint16_t FX_GetSolarMonthDays(uint16_t year, uint16_t month) {
if (month % 2) {
@@ -3698,11 +3697,11 @@ static uint16_t FX_GetWeekOfYear(uint16_t year, uint16_t month, uint16_t day) {
}
return week_index;
}
-static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern,
- IFX_Locale* pLocale,
- const CFX_Unitime& datetime,
- CFX_WideString& wsResult) {
- FX_BOOL bRet = TRUE;
+static bool FX_DateFormat(const CFX_WideString& wsDatePattern,
+ IFX_Locale* pLocale,
+ const CFX_Unitime& datetime,
+ CFX_WideString& wsResult) {
+ bool bRet = true;
int32_t year = datetime.GetYear();
uint8_t month = datetime.GetMonth();
uint8_t day = datetime.GetDay();
@@ -3762,11 +3761,11 @@ static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern,
wsResult += wsMonth;
} else if (dwSymbol == FXBSTR_ID(0, 0, 'M', '3')) {
CFX_WideString wsTemp;
- pLocale->GetMonthName(month - 1, wsTemp, TRUE);
+ pLocale->GetMonthName(month - 1, wsTemp, true);
wsResult += wsTemp;
} else if (dwSymbol == FXBSTR_ID(0, 0, 'M', '4')) {
CFX_WideString wsTemp;
- pLocale->GetMonthName(month - 1, wsTemp, FALSE);
+ pLocale->GetMonthName(month - 1, wsTemp, false);
wsResult += wsTemp;
} else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '1')) {
uint16_t wWeekDay = FX_GetWeekDay(year, month, day);
@@ -3776,13 +3775,13 @@ static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern,
} else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '3')) {
uint16_t wWeekDay = FX_GetWeekDay(year, month, day);
CFX_WideString wsTemp;
- pLocale->GetDayName(wWeekDay, wsTemp, TRUE);
+ pLocale->GetDayName(wWeekDay, wsTemp, true);
wsResult += wsTemp;
} else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '4')) {
uint16_t wWeekDay = FX_GetWeekDay(year, month, day);
if (pLocale) {
CFX_WideString wsTemp;
- pLocale->GetDayName(wWeekDay, wsTemp, FALSE);
+ pLocale->GetDayName(wWeekDay, wsTemp, false);
wsResult += wsTemp;
}
} else if (dwSymbol == FXBSTR_ID(0, 0, 'e', '1')) {
@@ -3816,12 +3815,12 @@ static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern,
}
return bRet;
}
-static FX_BOOL FX_TimeFormat(const CFX_WideString& wsTimePattern,
- IFX_Locale* pLocale,
- const CFX_Unitime& datetime,
- CFX_WideString& wsResult) {
- FX_BOOL bGMT = FALSE;
- FX_BOOL bRet = TRUE;
+static bool FX_TimeFormat(const CFX_WideString& wsTimePattern,
+ IFX_Locale* pLocale,
+ const CFX_Unitime& datetime,
+ CFX_WideString& wsResult) {
+ bool bGMT = false;
+ bool bRet = true;
uint8_t hour = datetime.GetHour();
uint8_t minute = datetime.GetMinute();
uint8_t second = datetime.GetSecond();
@@ -3830,10 +3829,10 @@ static FX_BOOL FX_TimeFormat(const CFX_WideString& wsTimePattern,
const FX_WCHAR* strf = wsTimePattern.c_str();
int32_t lenf = wsTimePattern.GetLength();
uint16_t wHour = hour;
- FX_BOOL bPM = FALSE;
+ bool bPM = false;
if (wsTimePattern.Find('A') != -1) {
if (wHour >= 12) {
- bPM = TRUE;
+ bPM = true;
}
}
CFX_WideStringC wsTimeSymbols(gs_wsTimeSymbols);
@@ -3952,13 +3951,13 @@ static FX_BOOL FX_TimeFormat(const CFX_WideString& wsTimePattern,
}
return bRet;
}
-static FX_BOOL FX_FormatDateTime(const CFX_Unitime& dt,
- const CFX_WideString& wsDatePattern,
- const CFX_WideString& wsTimePattern,
- FX_BOOL bDateFirst,
- IFX_Locale* pLocale,
- CFX_WideString& wsOutput) {
- FX_BOOL bRet = TRUE;
+static bool FX_FormatDateTime(const CFX_Unitime& dt,
+ const CFX_WideString& wsDatePattern,
+ const CFX_WideString& wsTimePattern,
+ bool bDateFirst,
+ IFX_Locale* pLocale,
+ CFX_WideString& wsOutput) {
+ bool bRet = true;
CFX_WideString wsDateOut, wsTimeOut;
if (!wsDatePattern.IsEmpty()) {
bRet &= FX_DateFormat(wsDatePattern, pLocale, dt, wsDateOut);
@@ -3969,18 +3968,18 @@ static FX_BOOL FX_FormatDateTime(const CFX_Unitime& dt,
wsOutput = bDateFirst ? wsDateOut + wsTimeOut : wsTimeOut + wsDateOut;
return bRet;
}
-FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput) {
+bool CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput) {
if (wsSrcDateTime.IsEmpty() || wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
CFX_WideString wsDatePattern, wsTimePattern;
IFX_Locale* pLocale = nullptr;
FX_DATETIMETYPE eCategory =
GetDateTimeFormat(wsPattern, pLocale, wsDatePattern, wsTimePattern);
if (!pLocale || eCategory == FX_DATETIMETYPE_Unknown) {
- return FALSE;
+ return false;
}
CFX_Unitime dt(0);
int32_t iT = wsSrcDateTime.Find(L"T");
@@ -4000,19 +3999,19 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime,
eCategory != FX_DATETIMETYPE_TimeDate, pLocale,
wsOutput);
}
-FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput,
- FX_DATETIMETYPE eDateTimeType) {
+bool CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput,
+ FX_DATETIMETYPE eDateTimeType) {
if (wsSrcDateTime.IsEmpty() || wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
CFX_WideString wsDatePattern, wsTimePattern;
IFX_Locale* pLocale = nullptr;
FX_DATETIMETYPE eCategory =
GetDateTimeFormat(wsPattern, pLocale, wsDatePattern, wsTimePattern);
if (!pLocale) {
- return FALSE;
+ return false;
}
if (eCategory == FX_DATETIMETYPE_Unknown) {
if (eDateTimeType == FX_DATETIMETYPE_Time) {
@@ -4022,18 +4021,18 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime,
eCategory = eDateTimeType;
}
if (eCategory == FX_DATETIMETYPE_Unknown) {
- return FALSE;
+ return false;
}
CFX_Unitime dt(0);
int32_t iT = wsSrcDateTime.Find(L"T");
if (iT < 0) {
if (eCategory == FX_DATETIMETYPE_Date &&
FX_DateFromCanonical(wsSrcDateTime, dt)) {
- return FX_FormatDateTime(dt, wsDatePattern, wsTimePattern, TRUE, pLocale,
+ return FX_FormatDateTime(dt, wsDatePattern, wsTimePattern, true, pLocale,
wsOutput);
} else if (eCategory == FX_DATETIMETYPE_Time &&
FX_TimeFromCanonical(wsSrcDateTime.AsStringC(), dt, pLocale)) {
- return FX_FormatDateTime(dt, wsDatePattern, wsTimePattern, TRUE, pLocale,
+ return FX_FormatDateTime(dt, wsDatePattern, wsTimePattern, true, pLocale,
wsOutput);
}
} else {
@@ -4041,7 +4040,7 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime,
CFX_WideStringC wsSrcTime(wsSrcDateTime.c_str() + iT + 1,
wsSrcDateTime.GetLength() - iT - 1);
if (wsSrcDate.IsEmpty() || wsSrcTime.IsEmpty()) {
- return FALSE;
+ return false;
}
if (FX_DateFromCanonical(wsSrcDate, dt) &&
FX_TimeFromCanonical(wsSrcTime, dt, pLocale)) {
@@ -4050,29 +4049,29 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime,
wsOutput);
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CFX_FormatString::FormatDateTime(const CFX_Unitime& dt,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput) {
+bool CFX_FormatString::FormatDateTime(const CFX_Unitime& dt,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput) {
if (wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
CFX_WideString wsDatePattern, wsTimePattern;
IFX_Locale* pLocale = nullptr;
FX_DATETIMETYPE eCategory =
GetDateTimeFormat(wsPattern, pLocale, wsDatePattern, wsTimePattern);
if (!pLocale) {
- return FALSE;
+ return false;
}
return FX_FormatDateTime(dt, wsPattern, wsTimePattern,
eCategory != FX_DATETIMETYPE_TimeDate, pLocale,
wsOutput);
}
-FX_BOOL CFX_FormatString::FormatZero(const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput) {
+bool CFX_FormatString::FormatZero(const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput) {
if (wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
CFX_WideString wsTextFormat;
GetTextFormat(wsPattern, FX_WSTRC(L"zero"), wsTextFormat);
@@ -4089,12 +4088,12 @@ FX_BOOL CFX_FormatString::FormatZero(const CFX_WideString& wsPattern,
continue;
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CFX_FormatString::FormatNull(const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput) {
+bool CFX_FormatString::FormatNull(const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput) {
if (wsPattern.IsEmpty()) {
- return FALSE;
+ return false;
}
CFX_WideString wsTextFormat;
GetTextFormat(wsPattern, FX_WSTRC(L"null"), wsTextFormat);
@@ -4111,7 +4110,7 @@ FX_BOOL CFX_FormatString::FormatNull(const CFX_WideString& wsPattern,
continue;
}
}
- return TRUE;
+ return true;
}
IFX_Locale* CFX_FormatString::GetPatternLocale(const CFX_WideString& wsLocale) {
return m_pLocaleMgr->GetLocaleByName(wsLocale);
@@ -4328,21 +4327,21 @@ static inline void fxmath_decimal_helper_raw_div(uint64_t a[],
c[i] = left[i];
}
}
-static inline FX_BOOL fxmath_decimal_helper_outofrange(uint64_t a[],
- uint8_t al,
- uint8_t goal) {
+static inline bool fxmath_decimal_helper_outofrange(uint64_t a[],
+ uint8_t al,
+ uint8_t goal) {
for (int i = goal; i < al; i++) {
if (a[i]) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
static inline void fxmath_decimal_helper_shrinkintorange(uint64_t a[],
uint8_t al,
uint8_t goal,
uint8_t& scale) {
- FX_BOOL bRoundUp = FALSE;
+ bool bRoundUp = false;
while (scale != 0 && (scale > FXMATH_DECIMAL_SCALELIMIT ||
fxmath_decimal_helper_outofrange(a, al, goal))) {
bRoundUp = fxmath_decimal_helper_div10_any(a, al) >= 5;
@@ -4384,7 +4383,7 @@ CFX_Decimal::CFX_Decimal(uint32_t val) {
CFX_Decimal::CFX_Decimal(uint32_t lo,
uint32_t mid,
uint32_t hi,
- FX_BOOL neg,
+ bool neg,
uint8_t scale) {
scale = (scale > FXMATH_DECIMAL_SCALELIMIT ? 0 : scale);
m_uLo = lo;
@@ -4431,8 +4430,8 @@ CFX_Decimal::CFX_Decimal(FX_FLOAT val, uint8_t scale) {
CFX_Decimal::CFX_Decimal(const CFX_WideStringC& strObj) {
const FX_WCHAR* str = strObj.c_str();
const FX_WCHAR* strBound = str + strObj.GetLength();
- FX_BOOL pointmet = 0;
- FX_BOOL negmet = 0;
+ bool pointmet = 0;
+ bool negmet = 0;
uint8_t scale = 0;
m_uHi = m_uMid = m_uLo = 0;
while (str != strBound && *str == ' ') {
@@ -4498,7 +4497,7 @@ CFX_Decimal::operator double() const {
double base =
((double)m_uHi) * pow * pow + ((double)m_uMid) * pow + ((double)m_uLo);
int8_t scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
- FX_BOOL bNeg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags);
+ bool bNeg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags);
return (bNeg ? -1 : 1) * base * ::pow(10.0, -scale);
}
void CFX_Decimal::SetScale(uint8_t newscale) {
@@ -4549,9 +4548,9 @@ void CFX_Decimal::SetNegate() {
m_uFlags ^= FXMATH_DECIMAL_NEGMASK;
}
}
-void CFX_Decimal::FloorOrCeil(FX_BOOL bFloor) {
+void CFX_Decimal::FloorOrCeil(bool bFloor) {
uint64_t nums[3] = {m_uLo, m_uMid, m_uHi};
- FX_BOOL bDataLoss = FALSE;
+ bool bDataLoss = false;
for (int i = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); i > 0; i--) {
bDataLoss = fxmath_decimal_helper_div10_any(nums, 3) || bDataLoss;
}
@@ -4566,10 +4565,10 @@ void CFX_Decimal::FloorOrCeil(FX_BOOL bFloor) {
FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero(), 0);
}
void CFX_Decimal::SetFloor() {
- FloorOrCeil(TRUE);
+ FloorOrCeil(true);
}
void CFX_Decimal::SetCeiling() {
- FloorOrCeil(FALSE);
+ FloorOrCeil(false);
}
void CFX_Decimal::SetTruncate() {
FloorOrCeil(!FXMATH_DECIMAL_FLAGS2NEG(m_uFlags));
@@ -4609,7 +4608,7 @@ int8_t CFX_Decimal::Compare(const CFX_Decimal& val) const {
return (FXMATH_DECIMAL_FLAGS2NEG(lhs.m_uFlags) ? -retVal : retVal);
}
CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val,
- FX_BOOL isAdding) const {
+ bool isAdding) const {
CFX_Decimal lhs = *this, rhs = val;
if (FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags) !=
FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags)) {
@@ -4665,8 +4664,8 @@ CFX_Decimal CFX_Decimal::Multiply(const CFX_Decimal& val) const {
b[3] = {val.m_uLo, val.m_uMid, val.m_uHi};
uint64_t c[6];
fxmath_decimal_helper_raw_mul(a, 3, b, 3, c, 6);
- FX_BOOL neg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) ^
- FXMATH_DECIMAL_FLAGS2NEG(val.m_uFlags);
+ bool neg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) ^
+ FXMATH_DECIMAL_FLAGS2NEG(val.m_uFlags);
uint8_t scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags) +
FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags);
fxmath_decimal_helper_shrinkintorange(c, 6, 3, scale);
@@ -4677,8 +4676,8 @@ CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const {
if (!val.IsNotZero()) {
return CFX_Decimal();
}
- FX_BOOL neg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) ^
- FXMATH_DECIMAL_FLAGS2NEG(val.m_uFlags);
+ bool neg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) ^
+ FXMATH_DECIMAL_FLAGS2NEG(val.m_uFlags);
uint64_t a[7] = {m_uLo, m_uMid, m_uHi},
b[3] = {val.m_uLo, val.m_uMid, val.m_uHi}, c[7] = {0};
uint8_t scale = 0;
@@ -4715,7 +4714,7 @@ CFX_Decimal CFX_Decimal::Modulus(const CFX_Decimal& val) const {
if (!rhs_abs.IsNotZero()) {
return *this;
}
- while (TRUE) {
+ while (true) {
CFX_Decimal lhs_abs = lhs;
lhs_abs.SetAbs();
if (lhs_abs < rhs_abs) {
@@ -4746,10 +4745,10 @@ bool CFX_Decimal::operator>(const CFX_Decimal& val) const {
return Compare(val) > 0;
}
CFX_Decimal CFX_Decimal::operator+(const CFX_Decimal& val) const {
- return AddOrMinus(val, TRUE);
+ return AddOrMinus(val, true);
}
CFX_Decimal CFX_Decimal::operator-(const CFX_Decimal& val) const {
- return AddOrMinus(val, FALSE);
+ return AddOrMinus(val, false);
}
CFX_Decimal CFX_Decimal::operator*(const CFX_Decimal& val) const {
return Multiply(val);
diff --git a/xfa/fgas/localization/fgas_locale.h b/xfa/fgas/localization/fgas_locale.h
index 5b4c7f8147..f9b84c5487 100644
--- a/xfa/fgas/localization/fgas_locale.h
+++ b/xfa/fgas/localization/fgas_locale.h
@@ -62,15 +62,14 @@ class IFX_Locale {
virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const = 0;
virtual void GetMonthName(int32_t nMonth,
CFX_WideString& wsMonthName,
- FX_BOOL bAbbr = TRUE) const = 0;
+ bool bAbbr = true) const = 0;
virtual void GetDayName(int32_t nWeek,
CFX_WideString& wsDayName,
- FX_BOOL bAbbr = TRUE) const = 0;
+ bool bAbbr = true) const = 0;
virtual void GetMeridiemName(CFX_WideString& wsMeridiemName,
- FX_BOOL bAM = TRUE) const = 0;
+ bool bAM = true) const = 0;
virtual void GetTimeZone(FX_TIMEZONE& tz) const = 0;
- virtual void GetEraName(CFX_WideString& wsEraName,
- FX_BOOL bAD = TRUE) const = 0;
+ virtual void GetEraName(CFX_WideString& wsEraName, bool bAD = true) const = 0;
virtual void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType,
CFX_WideString& wsPattern) const = 0;
virtual void GetTimePattern(FX_LOCALEDATETIMESUBCATEGORY eType,
@@ -91,11 +90,10 @@ class IFX_LocaleMgr {
virtual std::unique_ptr<IFX_Locale> GetLocale(uint16_t lcid) = 0;
};
-FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate,
- CFX_Unitime& datetime);
-FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime,
- CFX_Unitime& datetime,
- IFX_Locale* pLocale);
+bool FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime);
+bool FX_TimeFromCanonical(const CFX_WideStringC& wsTime,
+ CFX_Unitime& datetime,
+ IFX_Locale* pLocale);
class CFX_Decimal {
public:
CFX_Decimal();
@@ -128,16 +126,12 @@ class CFX_Decimal {
void SetTruncate();
protected:
- CFX_Decimal(uint32_t hi,
- uint32_t mid,
- uint32_t lo,
- FX_BOOL neg,
- uint8_t scale);
- inline FX_BOOL IsNotZero() const { return m_uHi || m_uMid || m_uLo; }
+ CFX_Decimal(uint32_t hi, uint32_t mid, uint32_t lo, bool neg, uint8_t scale);
+ inline bool IsNotZero() const { return m_uHi || m_uMid || m_uLo; }
inline int8_t Compare(const CFX_Decimal& val) const;
inline void Swap(CFX_Decimal& val);
- inline void FloorOrCeil(FX_BOOL bFloor);
- CFX_Decimal AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) const;
+ inline void FloorOrCeil(bool bFloor);
+ CFX_Decimal AddOrMinus(const CFX_Decimal& val, bool isAdding) const;
CFX_Decimal Multiply(const CFX_Decimal& val) const;
CFX_Decimal Divide(const CFX_Decimal& val) const;
CFX_Decimal Modulus(const CFX_Decimal& val) const;
diff --git a/xfa/fgas/localization/fgas_localeimp.h b/xfa/fgas/localization/fgas_localeimp.h
index 969fe6b625..66f1767c5c 100644
--- a/xfa/fgas/localization/fgas_localeimp.h
+++ b/xfa/fgas/localization/fgas_localeimp.h
@@ -13,7 +13,7 @@ class CFX_LCNumeric;
class CFX_FormatString {
public:
- CFX_FormatString(IFX_LocaleMgr* pLocaleMgr, FX_BOOL bUseLCID);
+ CFX_FormatString(IFX_LocaleMgr* pLocaleMgr, bool bUseLCID);
void Release() { delete this; }
@@ -22,44 +22,44 @@ class CFX_FormatString {
FX_LOCALECATEGORY GetCategory(const CFX_WideString& wsPattern);
uint16_t GetLCID(const CFX_WideString& wsPattern);
CFX_WideString GetLocaleName(const CFX_WideString& wsPattern);
- FX_BOOL ParseText(const CFX_WideString& wsSrcText,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsValue);
- FX_BOOL ParseNum(const CFX_WideString& wsSrcNum,
- const CFX_WideString& wsPattern,
- FX_FLOAT& fValue);
- FX_BOOL ParseNum(const CFX_WideString& wsSrcNum,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsValue);
- FX_BOOL ParseDateTime(const CFX_WideString& wsSrcDateTime,
- const CFX_WideString& wsPattern,
- FX_DATETIMETYPE eDateTimeType,
- CFX_Unitime& dtValue);
- FX_BOOL ParseZero(const CFX_WideString& wsSrcText,
- const CFX_WideString& wsPattern);
- FX_BOOL ParseNull(const CFX_WideString& wsSrcText,
- const CFX_WideString& wsPattern);
- FX_BOOL FormatText(const CFX_WideString& wsSrcText,
+ bool ParseText(const CFX_WideString& wsSrcText,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsValue);
+ bool ParseNum(const CFX_WideString& wsSrcNum,
+ const CFX_WideString& wsPattern,
+ FX_FLOAT& fValue);
+ bool ParseNum(const CFX_WideString& wsSrcNum,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsValue);
+ bool ParseDateTime(const CFX_WideString& wsSrcDateTime,
const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput);
- FX_BOOL FormatNum(const CFX_WideString& wsSrcNum,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput);
- FX_BOOL FormatNum(FX_FLOAT fNum,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput);
- FX_BOOL FormatDateTime(const CFX_WideString& wsSrcDateTime,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput);
- FX_BOOL FormatDateTime(const CFX_WideString& wsSrcDateTime,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput,
- FX_DATETIMETYPE eDateTimeType);
- FX_BOOL FormatDateTime(const CFX_Unitime& dt,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput);
- FX_BOOL FormatZero(const CFX_WideString& wsPattern, CFX_WideString& wsOutput);
- FX_BOOL FormatNull(const CFX_WideString& wsPattern, CFX_WideString& wsOutput);
+ FX_DATETIMETYPE eDateTimeType,
+ CFX_Unitime& dtValue);
+ bool ParseZero(const CFX_WideString& wsSrcText,
+ const CFX_WideString& wsPattern);
+ bool ParseNull(const CFX_WideString& wsSrcText,
+ const CFX_WideString& wsPattern);
+ bool FormatText(const CFX_WideString& wsSrcText,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput);
+ bool FormatNum(const CFX_WideString& wsSrcNum,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput);
+ bool FormatNum(FX_FLOAT fNum,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput);
+ bool FormatDateTime(const CFX_WideString& wsSrcDateTime,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput);
+ bool FormatDateTime(const CFX_WideString& wsSrcDateTime,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput,
+ FX_DATETIMETYPE eDateTimeType);
+ bool FormatDateTime(const CFX_Unitime& dt,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput);
+ bool FormatZero(const CFX_WideString& wsPattern, CFX_WideString& wsOutput);
+ bool FormatNull(const CFX_WideString& wsPattern, CFX_WideString& wsOutput);
protected:
~CFX_FormatString();
@@ -71,12 +71,12 @@ class CFX_FormatString {
int32_t& iDotIndex,
uint32_t& dwStyle,
CFX_WideString& wsPurgePattern);
- FX_BOOL FormatStrNum(const CFX_WideStringC& wsInputNum,
+ bool FormatStrNum(const CFX_WideStringC& wsInputNum,
+ const CFX_WideString& wsPattern,
+ CFX_WideString& wsOutput);
+ bool FormatLCNumeric(CFX_LCNumeric& lcNum,
const CFX_WideString& wsPattern,
CFX_WideString& wsOutput);
- FX_BOOL FormatLCNumeric(CFX_LCNumeric& lcNum,
- const CFX_WideString& wsPattern,
- CFX_WideString& wsOutput);
FX_DATETIMETYPE GetDateTimeFormat(const CFX_WideString& wsPattern,
IFX_Locale*& pLocale,
CFX_WideString& wsDatePattern,
@@ -84,7 +84,7 @@ class CFX_FormatString {
IFX_Locale* GetPatternLocale(const CFX_WideString& wsLocale);
IFX_LocaleMgr* m_pLocaleMgr;
- FX_BOOL m_bUseLCID;
+ bool m_bUseLCID;
};
#endif // XFA_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_
diff --git a/xfa/fwl/core/cfwl_barcode.cpp b/xfa/fwl/core/cfwl_barcode.cpp
index a23bd16df3..d738f68955 100644
--- a/xfa/fwl/core/cfwl_barcode.cpp
+++ b/xfa/fwl/core/cfwl_barcode.cpp
@@ -48,11 +48,11 @@ void CFWL_Barcode::SetDataLength(int32_t dataLength) {
m_barcodeData.m_nDataLength = dataLength;
ToBarcode(GetWidget())->SetLimit(dataLength);
}
-void CFWL_Barcode::SetCalChecksum(FX_BOOL calChecksum) {
+void CFWL_Barcode::SetCalChecksum(bool calChecksum) {
m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CALCHECKSUM;
m_barcodeData.m_bCalChecksum = calChecksum;
}
-void CFWL_Barcode::SetPrintChecksum(FX_BOOL printChecksum) {
+void CFWL_Barcode::SetPrintChecksum(bool printChecksum) {
m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_PRINTCHECKSUM;
m_barcodeData.m_bPrintChecksum = printChecksum;
}
@@ -80,7 +80,7 @@ void CFWL_Barcode::SetErrorCorrectionLevel(int32_t ecLevel) {
m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ECLEVEL;
m_barcodeData.m_nECLevel = ecLevel;
}
-void CFWL_Barcode::SetTruncated(FX_BOOL truncated) {
+void CFWL_Barcode::SetTruncated(bool truncated) {
m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TRUNCATED;
m_barcodeData.m_bTruncated = truncated;
}
@@ -93,8 +93,8 @@ void CFWL_Barcode::SetType(BC_TYPE type) {
ToBarcode(GetWidget())->SetType(type);
}
-FX_BOOL CFWL_Barcode::IsProtectedType() {
- return GetWidget() ? ToBarcode(GetWidget())->IsProtectedType() : FALSE;
+bool CFWL_Barcode::IsProtectedType() {
+ return GetWidget() ? ToBarcode(GetWidget())->IsProtectedType() : false;
}
CFWL_Barcode::CFWL_BarcodeDP::CFWL_BarcodeDP()
@@ -121,11 +121,11 @@ int32_t CFWL_Barcode::CFWL_BarcodeDP::GetDataLength() const {
return m_nDataLength;
}
-FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetCalChecksum() const {
+bool CFWL_Barcode::CFWL_BarcodeDP::GetCalChecksum() const {
return m_bCalChecksum;
}
-FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetPrintChecksum() const {
+bool CFWL_Barcode::CFWL_BarcodeDP::GetPrintChecksum() const {
return m_bPrintChecksum;
}
@@ -153,7 +153,7 @@ int32_t CFWL_Barcode::CFWL_BarcodeDP::GetErrorCorrectionLevel() const {
return m_nECLevel;
}
-FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetTruncated() const {
+bool CFWL_Barcode::CFWL_BarcodeDP::GetTruncated() const {
return m_bTruncated;
}
diff --git a/xfa/fwl/core/cfwl_barcode.h b/xfa/fwl/core/cfwl_barcode.h
index 06b52c2112..8df93ff628 100644
--- a/xfa/fwl/core/cfwl_barcode.h
+++ b/xfa/fwl/core/cfwl_barcode.h
@@ -22,21 +22,21 @@ class CFWL_Barcode : public CFWL_Edit {
void Initialize();
void SetType(BC_TYPE type);
- FX_BOOL IsProtectedType();
+ bool IsProtectedType();
void SetCharEncoding(BC_CHAR_ENCODING encoding);
void SetModuleHeight(int32_t height);
void SetModuleWidth(int32_t width);
void SetDataLength(int32_t dataLength);
- void SetCalChecksum(FX_BOOL calChecksum);
- void SetPrintChecksum(FX_BOOL printChecksum);
+ void SetCalChecksum(bool calChecksum);
+ void SetPrintChecksum(bool printChecksum);
void SetTextLocation(BC_TEXT_LOC location);
void SetWideNarrowRatio(int32_t ratio);
void SetStartChar(FX_CHAR startChar);
void SetEndChar(FX_CHAR endChar);
void SetVersion(int32_t version);
void SetErrorCorrectionLevel(int32_t ecLevel);
- void SetTruncated(FX_BOOL truncated);
+ void SetTruncated(bool truncated);
void ResetBarcodeAttributes();
protected:
@@ -53,30 +53,30 @@ class CFWL_Barcode : public CFWL_Edit {
int32_t GetModuleHeight() const override;
int32_t GetModuleWidth() const override;
int32_t GetDataLength() const override;
- FX_BOOL GetCalChecksum() const override;
- FX_BOOL GetPrintChecksum() const override;
+ bool GetCalChecksum() const override;
+ bool GetPrintChecksum() const override;
BC_TEXT_LOC GetTextLocation() const override;
int32_t GetWideNarrowRatio() const override;
FX_CHAR GetStartChar() const override;
FX_CHAR GetEndChar() const override;
int32_t GetVersion() const override;
int32_t GetErrorCorrectionLevel() const override;
- FX_BOOL GetTruncated() const override;
+ bool GetTruncated() const override;
uint32_t GetBarcodeAttributeMask() const override;
BC_CHAR_ENCODING m_eCharEncoding;
int32_t m_nModuleHeight;
int32_t m_nModuleWidth;
int32_t m_nDataLength;
- FX_BOOL m_bCalChecksum;
- FX_BOOL m_bPrintChecksum;
+ bool m_bCalChecksum;
+ bool m_bPrintChecksum;
BC_TEXT_LOC m_eTextLocation;
int32_t m_nWideNarrowRatio;
FX_CHAR m_cStartChar;
FX_CHAR m_cEndChar;
int32_t m_nVersion;
int32_t m_nECLevel;
- FX_BOOL m_bTruncated;
+ bool m_bTruncated;
uint32_t m_dwAttributeMask;
};
diff --git a/xfa/fwl/core/cfwl_combobox.cpp b/xfa/fwl/core/cfwl_combobox.cpp
index 3d45842872..e8dde06039 100644
--- a/xfa/fwl/core/cfwl_combobox.cpp
+++ b/xfa/fwl/core/cfwl_combobox.cpp
@@ -132,12 +132,12 @@ FWL_Error CFWL_ComboBox::EditDoClipboard(int32_t iCmd) {
: FWL_Error::Indefinite;
}
-FX_BOOL CFWL_ComboBox::EditRedo(const IFDE_TxtEdtDoRecord* pRecord) {
- return GetWidget() ? ToComboBox(GetWidget())->EditRedo(pRecord) : FALSE;
+bool CFWL_ComboBox::EditRedo(const IFDE_TxtEdtDoRecord* pRecord) {
+ return GetWidget() ? ToComboBox(GetWidget())->EditRedo(pRecord) : false;
}
-FX_BOOL CFWL_ComboBox::EditUndo(const IFDE_TxtEdtDoRecord* pRecord) {
- return GetWidget() ? ToComboBox(GetWidget())->EditUndo(pRecord) : FALSE;
+bool CFWL_ComboBox::EditUndo(const IFDE_TxtEdtDoRecord* pRecord) {
+ return GetWidget() ? ToComboBox(GetWidget())->EditUndo(pRecord) : false;
}
FWL_Error CFWL_ComboBox::SetMaxListHeight(FX_FLOAT fMaxHeight) {
@@ -164,64 +164,64 @@ FWL_Error CFWL_ComboBox::SetListTheme(IFWL_ThemeProvider* pTheme) {
return ToComboBox(GetWidget())->GetListBoxt()->SetThemeProvider(pTheme);
}
-FX_BOOL CFWL_ComboBox::AfterFocusShowDropList() {
+bool CFWL_ComboBox::AfterFocusShowDropList() {
return ToComboBox(GetWidget())->AfterFocusShowDropList();
}
-FWL_Error CFWL_ComboBox::OpenDropDownList(FX_BOOL bActivate) {
+FWL_Error CFWL_ComboBox::OpenDropDownList(bool bActivate) {
return ToComboBox(GetWidget())->OpenDropDownList(bActivate);
}
-FX_BOOL CFWL_ComboBox::EditCanUndo() {
- return GetWidget() ? ToComboBox(GetWidget())->EditCanUndo() : FALSE;
+bool CFWL_ComboBox::EditCanUndo() {
+ return GetWidget() ? ToComboBox(GetWidget())->EditCanUndo() : false;
}
-FX_BOOL CFWL_ComboBox::EditCanRedo() {
- return GetWidget() ? ToComboBox(GetWidget())->EditCanRedo() : FALSE;
+bool CFWL_ComboBox::EditCanRedo() {
+ return GetWidget() ? ToComboBox(GetWidget())->EditCanRedo() : false;
}
-FX_BOOL CFWL_ComboBox::EditUndo() {
- return GetWidget() ? ToComboBox(GetWidget())->EditUndo() : FALSE;
+bool CFWL_ComboBox::EditUndo() {
+ return GetWidget() ? ToComboBox(GetWidget())->EditUndo() : false;
}
-FX_BOOL CFWL_ComboBox::EditRedo() {
- return GetWidget() ? ToComboBox(GetWidget())->EditRedo() : FALSE;
+bool CFWL_ComboBox::EditRedo() {
+ return GetWidget() ? ToComboBox(GetWidget())->EditRedo() : false;
}
-FX_BOOL CFWL_ComboBox::EditCanCopy() {
- return GetWidget() ? ToComboBox(GetWidget())->EditCanCopy() : FALSE;
+bool CFWL_ComboBox::EditCanCopy() {
+ return GetWidget() ? ToComboBox(GetWidget())->EditCanCopy() : false;
}
-FX_BOOL CFWL_ComboBox::EditCanCut() {
- return GetWidget() ? ToComboBox(GetWidget())->EditCanCut() : FALSE;
+bool CFWL_ComboBox::EditCanCut() {
+ return GetWidget() ? ToComboBox(GetWidget())->EditCanCut() : false;
}
-FX_BOOL CFWL_ComboBox::EditCanSelectAll() {
- return GetWidget() ? ToComboBox(GetWidget())->EditCanSelectAll() : FALSE;
+bool CFWL_ComboBox::EditCanSelectAll() {
+ return GetWidget() ? ToComboBox(GetWidget())->EditCanSelectAll() : false;
}
-FX_BOOL CFWL_ComboBox::EditCopy(CFX_WideString& wsCopy) {
- return GetWidget() ? ToComboBox(GetWidget())->EditCopy(wsCopy) : FALSE;
+bool CFWL_ComboBox::EditCopy(CFX_WideString& wsCopy) {
+ return GetWidget() ? ToComboBox(GetWidget())->EditCopy(wsCopy) : false;
}
-FX_BOOL CFWL_ComboBox::EditCut(CFX_WideString& wsCut) {
- return GetWidget() ? ToComboBox(GetWidget())->EditCut(wsCut) : FALSE;
+bool CFWL_ComboBox::EditCut(CFX_WideString& wsCut) {
+ return GetWidget() ? ToComboBox(GetWidget())->EditCut(wsCut) : false;
}
-FX_BOOL CFWL_ComboBox::EditPaste(const CFX_WideString& wsPaste) {
- return GetWidget() ? ToComboBox(GetWidget())->EditPaste(wsPaste) : FALSE;
+bool CFWL_ComboBox::EditPaste(const CFX_WideString& wsPaste) {
+ return GetWidget() ? ToComboBox(GetWidget())->EditPaste(wsPaste) : false;
}
-FX_BOOL CFWL_ComboBox::EditSelectAll() {
- return GetWidget() ? ToComboBox(GetWidget())->EditSelectAll() : FALSE;
+bool CFWL_ComboBox::EditSelectAll() {
+ return GetWidget() ? ToComboBox(GetWidget())->EditSelectAll() : false;
}
-FX_BOOL CFWL_ComboBox::EditDelete() {
- return GetWidget() ? ToComboBox(GetWidget())->EditDelete() : FALSE;
+bool CFWL_ComboBox::EditDelete() {
+ return GetWidget() ? ToComboBox(GetWidget())->EditDelete() : false;
}
-FX_BOOL CFWL_ComboBox::EditDeSelect() {
- return GetWidget() ? ToComboBox(GetWidget())->EditDeSelect() : FALSE;
+bool CFWL_ComboBox::EditDeSelect() {
+ return GetWidget() ? ToComboBox(GetWidget())->EditDeSelect() : false;
}
FWL_Error CFWL_ComboBox::GetBBox(CFX_RectF& rect) {
@@ -273,14 +273,14 @@ int32_t CFWL_ComboBox::CFWL_ComboBoxDP::GetItemIndex(IFWL_Widget* pWidget,
return it != m_ItemArray.end() ? it - m_ItemArray.begin() : -1;
}
-FX_BOOL CFWL_ComboBox::CFWL_ComboBoxDP::SetItemIndex(IFWL_Widget* pWidget,
- IFWL_ListItem* pItem,
- int32_t nIndex) {
+bool CFWL_ComboBox::CFWL_ComboBoxDP::SetItemIndex(IFWL_Widget* pWidget,
+ IFWL_ListItem* pItem,
+ int32_t nIndex) {
if (nIndex < 0 || static_cast<size_t>(nIndex) >= m_ItemArray.size())
- return FALSE;
+ return false;
m_ItemArray[nIndex].reset(static_cast<CFWL_ComboBoxItem*>(pItem));
- return TRUE;
+ return true;
}
uint32_t CFWL_ComboBox::CFWL_ComboBoxDP::GetItemStyles(IFWL_Widget* pWidget,
diff --git a/xfa/fwl/core/cfwl_combobox.h b/xfa/fwl/core/cfwl_combobox.h
index 82f1165dae..9511a36f3d 100644
--- a/xfa/fwl/core/cfwl_combobox.h
+++ b/xfa/fwl/core/cfwl_combobox.h
@@ -43,28 +43,28 @@ class CFWL_ComboBox : public CFWL_Widget {
int32_t GetEditLimit();
FWL_Error SetEditLimit(int32_t nLimit);
FWL_Error EditDoClipboard(int32_t iCmd);
- FX_BOOL EditRedo(const IFDE_TxtEdtDoRecord* pRecord);
- FX_BOOL EditUndo(const IFDE_TxtEdtDoRecord* pRecord);
+ bool EditRedo(const IFDE_TxtEdtDoRecord* pRecord);
+ bool EditUndo(const IFDE_TxtEdtDoRecord* pRecord);
FWL_Error SetMaxListHeight(FX_FLOAT fMaxHeight);
FWL_Error SetItemData(int32_t iIndex, void* pData);
void* GetItemData(int32_t iIndex);
FWL_Error SetListTheme(IFWL_ThemeProvider* pTheme);
- FX_BOOL AfterFocusShowDropList();
- FWL_Error OpenDropDownList(FX_BOOL bActivate);
-
- FX_BOOL EditCanUndo();
- FX_BOOL EditCanRedo();
- FX_BOOL EditUndo();
- FX_BOOL EditRedo();
- FX_BOOL EditCanCopy();
- FX_BOOL EditCanCut();
- FX_BOOL EditCanSelectAll();
- FX_BOOL EditCopy(CFX_WideString& wsCopy);
- FX_BOOL EditCut(CFX_WideString& wsCut);
- FX_BOOL EditPaste(const CFX_WideString& wsPaste);
- FX_BOOL EditSelectAll();
- FX_BOOL EditDelete();
- FX_BOOL EditDeSelect();
+ bool AfterFocusShowDropList();
+ FWL_Error OpenDropDownList(bool bActivate);
+
+ bool EditCanUndo();
+ bool EditCanRedo();
+ bool EditUndo();
+ bool EditRedo();
+ bool EditCanCopy();
+ bool EditCanCut();
+ bool EditCanSelectAll();
+ bool EditCopy(CFX_WideString& wsCopy);
+ bool EditCut(CFX_WideString& wsCut);
+ bool EditPaste(const CFX_WideString& wsPaste);
+ bool EditSelectAll();
+ bool EditDelete();
+ bool EditDeSelect();
FWL_Error GetBBox(CFX_RectF& rect);
FWL_Error EditModifyStylesEx(uint32_t dwStylesExAdded,
uint32_t dwStylesExRemoved);
@@ -83,9 +83,9 @@ class CFWL_ComboBox : public CFWL_Widget {
int32_t CountItems(const IFWL_Widget* pWidget) override;
IFWL_ListItem* GetItem(const IFWL_Widget* pWidget, int32_t nIndex) override;
int32_t GetItemIndex(IFWL_Widget* pWidget, IFWL_ListItem* pItem) override;
- FX_BOOL SetItemIndex(IFWL_Widget* pWidget,
- IFWL_ListItem* pItem,
- int32_t nIndex) override;
+ bool SetItemIndex(IFWL_Widget* pWidget,
+ IFWL_ListItem* pItem,
+ int32_t nIndex) override;
uint32_t GetItemStyles(IFWL_Widget* pWidget, IFWL_ListItem* pItem) override;
FWL_Error GetItemText(IFWL_Widget* pWidget,
diff --git a/xfa/fwl/core/cfwl_datetimepicker.cpp b/xfa/fwl/core/cfwl_datetimepicker.cpp
index 973e06ea4b..8e377c2ca9 100644
--- a/xfa/fwl/core/cfwl_datetimepicker.cpp
+++ b/xfa/fwl/core/cfwl_datetimepicker.cpp
@@ -96,55 +96,55 @@ FWL_Error CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetToday(
return FWL_Error::Succeeded;
}
-FX_BOOL CFWL_DateTimePicker::CanUndo() {
+bool CFWL_DateTimePicker::CanUndo() {
return ToDateTimePicker(GetWidget())->CanUndo();
}
-FX_BOOL CFWL_DateTimePicker::CanRedo() {
+bool CFWL_DateTimePicker::CanRedo() {
return ToDateTimePicker(GetWidget())->CanRedo();
}
-FX_BOOL CFWL_DateTimePicker::Undo() {
+bool CFWL_DateTimePicker::Undo() {
return ToDateTimePicker(GetWidget())->Undo();
}
-FX_BOOL CFWL_DateTimePicker::Redo() {
+bool CFWL_DateTimePicker::Redo() {
return ToDateTimePicker(GetWidget())->Redo();
}
-FX_BOOL CFWL_DateTimePicker::CanCopy() {
+bool CFWL_DateTimePicker::CanCopy() {
return ToDateTimePicker(GetWidget())->CanCopy();
}
-FX_BOOL CFWL_DateTimePicker::CanCut() {
+bool CFWL_DateTimePicker::CanCut() {
return ToDateTimePicker(GetWidget())->CanCut();
}
-FX_BOOL CFWL_DateTimePicker::CanSelectAll() {
+bool CFWL_DateTimePicker::CanSelectAll() {
return ToDateTimePicker(GetWidget())->CanSelectAll();
}
-FX_BOOL CFWL_DateTimePicker::Copy(CFX_WideString& wsCopy) {
+bool CFWL_DateTimePicker::Copy(CFX_WideString& wsCopy) {
return ToDateTimePicker(GetWidget())->Copy(wsCopy);
}
-FX_BOOL CFWL_DateTimePicker::Cut(CFX_WideString& wsCut) {
+bool CFWL_DateTimePicker::Cut(CFX_WideString& wsCut) {
return ToDateTimePicker(GetWidget())->Copy(wsCut);
}
-FX_BOOL CFWL_DateTimePicker::Paste(const CFX_WideString& wsPaste) {
+bool CFWL_DateTimePicker::Paste(const CFX_WideString& wsPaste) {
return ToDateTimePicker(GetWidget())->Paste(wsPaste);
}
-FX_BOOL CFWL_DateTimePicker::SelectAll() {
+bool CFWL_DateTimePicker::SelectAll() {
return ToDateTimePicker(GetWidget())->SelectAll();
}
-FX_BOOL CFWL_DateTimePicker::Delete() {
+bool CFWL_DateTimePicker::Delete() {
return ToDateTimePicker(GetWidget())->Delete();
}
-FX_BOOL CFWL_DateTimePicker::DeSelect() {
+bool CFWL_DateTimePicker::DeSelect() {
return ToDateTimePicker(GetWidget())->DeSelect();
}
diff --git a/xfa/fwl/core/cfwl_datetimepicker.h b/xfa/fwl/core/cfwl_datetimepicker.h
index e189e969a0..327364ce6a 100644
--- a/xfa/fwl/core/cfwl_datetimepicker.h
+++ b/xfa/fwl/core/cfwl_datetimepicker.h
@@ -24,19 +24,19 @@ class CFWL_DateTimePicker : public CFWL_Widget {
int32_t GetSelRange(int32_t nIndex, int32_t& nStart);
FWL_Error GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
FWL_Error SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay);
- FX_BOOL CanUndo();
- FX_BOOL CanRedo();
- FX_BOOL Undo();
- FX_BOOL Redo();
- FX_BOOL CanCopy();
- FX_BOOL CanCut();
- FX_BOOL CanSelectAll();
- FX_BOOL Copy(CFX_WideString& wsCopy);
- FX_BOOL Cut(CFX_WideString& wsCut);
- FX_BOOL Paste(const CFX_WideString& wsPaste);
- FX_BOOL SelectAll();
- FX_BOOL Delete();
- FX_BOOL DeSelect();
+ bool CanUndo();
+ bool CanRedo();
+ bool Undo();
+ bool Redo();
+ bool CanCopy();
+ bool CanCut();
+ bool CanSelectAll();
+ bool Copy(CFX_WideString& wsCopy);
+ bool Cut(CFX_WideString& wsCut);
+ bool Paste(const CFX_WideString& wsPaste);
+ bool SelectAll();
+ bool Delete();
+ bool DeSelect();
FWL_Error GetBBox(CFX_RectF& rect);
FWL_Error SetEditLimit(int32_t nLimit);
FWL_Error ModifyEditStylesEx(uint32_t dwStylesExAdded,
diff --git a/xfa/fwl/core/cfwl_edit.cpp b/xfa/fwl/core/cfwl_edit.cpp
index 4b6769e2b1..3d19e57f29 100644
--- a/xfa/fwl/core/cfwl_edit.cpp
+++ b/xfa/fwl/core/cfwl_edit.cpp
@@ -68,7 +68,7 @@ int32_t CFWL_Edit::GetCaretPos() const {
return ToEdit(GetWidget())->GetCaretPos();
}
-int32_t CFWL_Edit::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) {
+int32_t CFWL_Edit::SetCaretPos(int32_t nIndex, bool bBefore) {
if (!GetWidget())
return -1;
return ToEdit(GetWidget())->SetCaretPos(nIndex, bBefore);
@@ -158,15 +158,15 @@ FWL_Error CFWL_Edit::DoClipboard(int32_t iCmd) {
return ToEdit(GetWidget())->DoClipboard(iCmd);
}
-FX_BOOL CFWL_Edit::Redo(const IFDE_TxtEdtDoRecord* pRecord) {
+bool CFWL_Edit::Redo(const IFDE_TxtEdtDoRecord* pRecord) {
return GetWidget() && ToEdit(GetWidget())->Redo(pRecord);
}
-FX_BOOL CFWL_Edit::Undo(const IFDE_TxtEdtDoRecord* pRecord) {
+bool CFWL_Edit::Undo(const IFDE_TxtEdtDoRecord* pRecord) {
return GetWidget() && ToEdit(GetWidget())->Undo(pRecord);
}
-FWL_Error CFWL_Edit::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) {
+FWL_Error CFWL_Edit::SetTabWidth(FX_FLOAT fTabWidth, bool bEquidistant) {
if (!GetWidget())
return FWL_Error::Indefinite;
return ToEdit(GetWidget())->SetTabWidth(fTabWidth, bEquidistant);
@@ -190,35 +190,35 @@ FWL_Error CFWL_Edit::SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize) {
return ToEdit(GetWidget())->SetFont(wsFont, fSize);
}
-FX_BOOL CFWL_Edit::CanUndo() {
+bool CFWL_Edit::CanUndo() {
return ToEdit(GetWidget())->CanUndo();
}
-FX_BOOL CFWL_Edit::CanRedo() {
+bool CFWL_Edit::CanRedo() {
return ToEdit(GetWidget())->CanRedo();
}
-FX_BOOL CFWL_Edit::Undo() {
+bool CFWL_Edit::Undo() {
return ToEdit(GetWidget())->Undo();
}
-FX_BOOL CFWL_Edit::Redo() {
+bool CFWL_Edit::Redo() {
return ToEdit(GetWidget())->Undo();
}
-FX_BOOL CFWL_Edit::Copy(CFX_WideString& wsCopy) {
+bool CFWL_Edit::Copy(CFX_WideString& wsCopy) {
return ToEdit(GetWidget())->Copy(wsCopy);
}
-FX_BOOL CFWL_Edit::Cut(CFX_WideString& wsCut) {
+bool CFWL_Edit::Cut(CFX_WideString& wsCut) {
return ToEdit(GetWidget())->Cut(wsCut);
}
-FX_BOOL CFWL_Edit::Paste(const CFX_WideString& wsPaste) {
+bool CFWL_Edit::Paste(const CFX_WideString& wsPaste) {
return ToEdit(GetWidget())->Paste(wsPaste);
}
-FX_BOOL CFWL_Edit::Delete() {
+bool CFWL_Edit::Delete() {
return ToEdit(GetWidget())->Delete();
}
@@ -226,12 +226,12 @@ void CFWL_Edit::SetScrollOffset(FX_FLOAT fScrollOffset) {
return ToEdit(GetWidget())->SetScrollOffset(fScrollOffset);
}
-FX_BOOL CFWL_Edit::GetSuggestWords(CFX_PointF pointf,
- std::vector<CFX_ByteString>& sSuggest) {
+bool CFWL_Edit::GetSuggestWords(CFX_PointF pointf,
+ std::vector<CFX_ByteString>& sSuggest) {
return ToEdit(GetWidget())->GetSuggestWords(pointf, sSuggest);
}
-FX_BOOL CFWL_Edit::ReplaceSpellCheckWord(CFX_PointF pointf,
- const CFX_ByteStringC& bsReplace) {
+bool CFWL_Edit::ReplaceSpellCheckWord(CFX_PointF pointf,
+ const CFX_ByteStringC& bsReplace) {
return ToEdit(GetWidget())->ReplaceSpellCheckWord(pointf, bsReplace);
}
diff --git a/xfa/fwl/core/cfwl_edit.h b/xfa/fwl/core/cfwl_edit.h
index c18420015f..8fc0a13776 100644
--- a/xfa/fwl/core/cfwl_edit.h
+++ b/xfa/fwl/core/cfwl_edit.h
@@ -29,7 +29,7 @@ class CFWL_Edit : public CFWL_Widget {
int32_t nCount = -1) const;
FWL_Error ClearText();
int32_t GetCaretPos() const;
- int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE);
+ int32_t SetCaretPos(int32_t nIndex, bool bBefore = true);
int32_t AddSelRange(int32_t nStart, int32_t nCount = -1);
int32_t CountSelRanges();
int32_t GetSelRange(int32_t nIndex, int32_t& nStart);
@@ -45,25 +45,25 @@ class CFWL_Edit : public CFWL_Widget {
int32_t nLen,
const CFX_WideStringC& wsReplace);
FWL_Error DoClipboard(int32_t iCmd);
- FX_BOOL Redo(const IFDE_TxtEdtDoRecord* pRecord);
- FX_BOOL Undo(const IFDE_TxtEdtDoRecord* pRecord);
- FWL_Error SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant);
+ bool Redo(const IFDE_TxtEdtDoRecord* pRecord);
+ bool Undo(const IFDE_TxtEdtDoRecord* pRecord);
+ FWL_Error SetTabWidth(FX_FLOAT fTabWidth, bool bEquidistant);
FWL_Error SetNumberRange(int32_t iMin, int32_t iMax);
FWL_Error SetBackColor(uint32_t dwColor);
FWL_Error SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize);
- FX_BOOL CanUndo();
- FX_BOOL CanRedo();
- FX_BOOL Undo();
- FX_BOOL Redo();
- FX_BOOL Copy(CFX_WideString& wsCopy);
- FX_BOOL Cut(CFX_WideString& wsCut);
- FX_BOOL Paste(const CFX_WideString& wsPaste);
- FX_BOOL Delete();
+ bool CanUndo();
+ bool CanRedo();
+ bool Undo();
+ bool Redo();
+ bool Copy(CFX_WideString& wsCopy);
+ bool Cut(CFX_WideString& wsCut);
+ bool Paste(const CFX_WideString& wsPaste);
+ bool Delete();
void SetScrollOffset(FX_FLOAT fScrollOffset);
- FX_BOOL GetSuggestWords(CFX_PointF pointf,
- std::vector<CFX_ByteString>& sSuggest);
- FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf,
- const CFX_ByteStringC& bsReplace);
+ bool GetSuggestWords(CFX_PointF pointf,
+ std::vector<CFX_ByteString>& sSuggest);
+ bool ReplaceSpellCheckWord(CFX_PointF pointf,
+ const CFX_ByteStringC& bsReplace);
};
#endif // XFA_FWL_CORE_CFWL_EDIT_H_
diff --git a/xfa/fwl/core/cfwl_event.h b/xfa/fwl/core/cfwl_event.h
index 2e1ed69145..f43ebb7cc9 100644
--- a/xfa/fwl/core/cfwl_event.h
+++ b/xfa/fwl/core/cfwl_event.h
@@ -139,7 +139,7 @@ FWL_EVENT_DEF(CFWL_EvtClick, CFWL_EventType::Click)
FWL_EVENT_DEF(CFWL_EvtScroll, CFWL_EventType::Scroll, uint32_t m_iScrollCode;
FX_FLOAT m_fPos;
- FX_BOOL * m_pRet;)
+ bool* m_pRet;)
FWL_EVENT_DEF(CFWL_EvtClose, CFWL_EventType::Close)
diff --git a/xfa/fwl/core/cfwl_listbox.cpp b/xfa/fwl/core/cfwl_listbox.cpp
index 800dd2e570..f7e167125d 100644
--- a/xfa/fwl/core/cfwl_listbox.cpp
+++ b/xfa/fwl/core/cfwl_listbox.cpp
@@ -38,7 +38,7 @@ FWL_Error CFWL_ListBox::AddDIBitmap(CFX_DIBitmap* pDIB, IFWL_ListItem* pItem) {
}
IFWL_ListItem* CFWL_ListBox::AddString(const CFX_WideStringC& wsAdd,
- FX_BOOL bSelect) {
+ bool bSelect) {
std::unique_ptr<CFWL_ListItem> pItem(new CFWL_ListItem);
pItem->m_dwStates = 0;
pItem->m_wsText = wsAdd;
@@ -47,11 +47,11 @@ IFWL_ListItem* CFWL_ListBox::AddString(const CFX_WideStringC& wsAdd,
return m_ListBoxDP.m_ItemArray.back().get();
}
-FX_BOOL CFWL_ListBox::DeleteString(IFWL_ListItem* pItem) {
+bool CFWL_ListBox::DeleteString(IFWL_ListItem* pItem) {
int32_t nIndex = m_ListBoxDP.GetItemIndex(GetWidget(), pItem);
if (nIndex < 0 ||
static_cast<size_t>(nIndex) >= m_ListBoxDP.m_ItemArray.size()) {
- return FALSE;
+ return false;
}
int32_t iCount = m_ListBoxDP.CountItems(m_pIface.get());
int32_t iSel = nIndex + 1;
@@ -67,7 +67,7 @@ FX_BOOL CFWL_ListBox::DeleteString(IFWL_ListItem* pItem) {
pSel->m_dwStates |= FWL_ITEMSTATE_LTB_Selected;
}
m_ListBoxDP.m_ItemArray.erase(m_ListBoxDP.m_ItemArray.begin() + nIndex);
- return TRUE;
+ return true;
}
void CFWL_ListBox::DeleteAll() {
@@ -92,7 +92,7 @@ int32_t CFWL_ListBox::GetSelIndex(int32_t nIndex) {
return ToListBox(GetWidget())->GetSelIndex(nIndex);
}
-FWL_Error CFWL_ListBox::SetSelItem(IFWL_ListItem* pItem, FX_BOOL bSelect) {
+FWL_Error CFWL_ListBox::SetSelItem(IFWL_ListItem* pItem, bool bSelect) {
if (!GetWidget())
return FWL_Error::Indefinite;
return ToListBox(GetWidget())->SetSelItem(pItem, bSelect);
@@ -105,7 +105,7 @@ FWL_Error CFWL_ListBox::GetItemText(IFWL_ListItem* pItem,
return ToListBox(GetWidget())->GetItemText(pItem, wsText);
}
-FWL_Error CFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert) {
+FWL_Error CFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, bool bVert) {
if (!GetWidget())
return FWL_Error::Indefinite;
return ToListBox(GetWidget())->GetScrollPos(fPos, bVert);
@@ -176,7 +176,7 @@ IFWL_ListItem* CFWL_ListBox::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) {
FX_FLOAT fPosX = 0;
FX_FLOAT fPosY = 0;
ToListBox(GetWidget())->GetScrollPos(fx);
- ToListBox(GetWidget())->GetScrollPos(fy, FALSE);
+ ToListBox(GetWidget())->GetScrollPos(fy, false);
int32_t nCount = m_ListBoxDP.CountItems(nullptr);
for (int32_t i = 0; i < nCount; i++) {
IFWL_ListItem* pItem = m_ListBoxDP.GetItem(nullptr, i);
@@ -232,13 +232,13 @@ int32_t CFWL_ListBox::CFWL_ListBoxDP::GetItemIndex(IFWL_Widget* pWidget,
return it != m_ItemArray.end() ? it - m_ItemArray.begin() : -1;
}
-FX_BOOL CFWL_ListBox::CFWL_ListBoxDP::SetItemIndex(IFWL_Widget* pWidget,
- IFWL_ListItem* pItem,
- int32_t nIndex) {
+bool CFWL_ListBox::CFWL_ListBoxDP::SetItemIndex(IFWL_Widget* pWidget,
+ IFWL_ListItem* pItem,
+ int32_t nIndex) {
if (nIndex < 0 || nIndex >= CountItems(pWidget))
- return FALSE;
+ return false;
m_ItemArray[nIndex].reset(static_cast<CFWL_ListItem*>(pItem));
- return TRUE;
+ return true;
}
uint32_t CFWL_ListBox::CFWL_ListBoxDP::GetItemStyles(IFWL_Widget* pWidget,
diff --git a/xfa/fwl/core/cfwl_listbox.h b/xfa/fwl/core/cfwl_listbox.h
index 42740fbfbc..cb77f90a63 100644
--- a/xfa/fwl/core/cfwl_listbox.h
+++ b/xfa/fwl/core/cfwl_listbox.h
@@ -25,16 +25,15 @@ class CFWL_ListBox : public CFWL_Widget {
void Initialize();
FWL_Error AddDIBitmap(CFX_DIBitmap* pDIB, IFWL_ListItem* pItem);
- IFWL_ListItem* AddString(const CFX_WideStringC& wsAdd,
- FX_BOOL bSelect = FALSE);
- FX_BOOL DeleteString(IFWL_ListItem* pItem);
+ IFWL_ListItem* AddString(const CFX_WideStringC& wsAdd, bool bSelect = false);
+ bool DeleteString(IFWL_ListItem* pItem);
void DeleteAll();
int32_t CountSelItems();
IFWL_ListItem* GetSelItem(int32_t nIndexSel);
int32_t GetSelIndex(int32_t nIndex);
- FWL_Error SetSelItem(IFWL_ListItem* pItem, FX_BOOL bSelect = TRUE);
+ FWL_Error SetSelItem(IFWL_ListItem* pItem, bool bSelect = true);
FWL_Error GetItemText(IFWL_ListItem* pItem, CFX_WideString& wsText);
- FWL_Error GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE);
+ FWL_Error GetScrollPos(FX_FLOAT& fPos, bool bVert = true);
FWL_Error SetItemHeight(FX_FLOAT fItemHeight);
IFWL_ListItem* GetFocusItem();
FWL_Error SetFocusItem(IFWL_ListItem* pItem);
@@ -61,9 +60,9 @@ class CFWL_ListBox : public CFWL_Widget {
int32_t CountItems(const IFWL_Widget* pWidget) override;
IFWL_ListItem* GetItem(const IFWL_Widget* pWidget, int32_t nIndex) override;
int32_t GetItemIndex(IFWL_Widget* pWidget, IFWL_ListItem* pItem) override;
- FX_BOOL SetItemIndex(IFWL_Widget* pWidget,
- IFWL_ListItem* pItem,
- int32_t nIndex) override;
+ bool SetItemIndex(IFWL_Widget* pWidget,
+ IFWL_ListItem* pItem,
+ int32_t nIndex) override;
uint32_t GetItemStyles(IFWL_Widget* pWidget, IFWL_ListItem* pItem) override;
FWL_Error GetItemText(IFWL_Widget* pWidget,
IFWL_ListItem* pItem,
diff --git a/xfa/fwl/core/cfwl_widget.cpp b/xfa/fwl/core/cfwl_widget.cpp
index db0d4ebb5e..074803776b 100644
--- a/xfa/fwl/core/cfwl_widget.cpp
+++ b/xfa/fwl/core/cfwl_widget.cpp
@@ -40,7 +40,7 @@ const IFWL_Widget* CFWL_Widget::GetWidget() const {
return m_pIface.get();
}
-FWL_Error CFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error CFWL_Widget::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (!m_pIface)
return FWL_Error::Indefinite;
return m_pIface->GetWidgetRect(rect, bAutoSize);
@@ -86,7 +86,7 @@ uint32_t CFWL_Widget::GetStates() {
return m_pIface ? m_pIface->GetStates() : 0;
}
-void CFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) {
+void CFWL_Widget::SetStates(uint32_t dwStates, bool bSet) {
if (m_pIface)
m_pIface->SetStates(dwStates, bSet);
}
diff --git a/xfa/fwl/core/cfwl_widget.h b/xfa/fwl/core/cfwl_widget.h
index 2921145f6a..0c590e2319 100644
--- a/xfa/fwl/core/cfwl_widget.h
+++ b/xfa/fwl/core/cfwl_widget.h
@@ -27,7 +27,7 @@ class CFWL_Widget {
IFWL_Widget* GetWidget();
const IFWL_Widget* GetWidget() const;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE);
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false);
FWL_Error SetWidgetRect(const CFX_RectF& rect);
FWL_Error GetGlobalRect(CFX_RectF& rect);
FWL_Error GetClientRect(CFX_RectF& rtClient);
@@ -38,7 +38,7 @@ class CFWL_Widget {
uint32_t dwStylesExRemoved);
uint32_t GetStates();
- void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE);
+ void SetStates(uint32_t dwStates, bool bSet = true);
void SetLayoutItem(void* pItem);
diff --git a/xfa/fwl/core/cfwl_widgetmgr.cpp b/xfa/fwl/core/cfwl_widgetmgr.cpp
index 37e31dc501..90dcd6e121 100644
--- a/xfa/fwl/core/cfwl_widgetmgr.cpp
+++ b/xfa/fwl/core/cfwl_widgetmgr.cpp
@@ -26,9 +26,9 @@ struct FWL_NEEDREPAINTHITDATA {
} // namespace
-FX_BOOL FWL_UseOffscreen(IFWL_Widget* pWidget) {
+bool FWL_UseOffscreen(IFWL_Widget* pWidget) {
#if (_FX_OS_ == _FX_MACOSX_)
- return FALSE;
+ return false;
#else
return !!(pWidget->GetStyles() & FWL_WGTSTYLE_Offscreen);
#endif
@@ -109,18 +109,18 @@ IFWL_Widget* CFWL_WidgetMgr::GetSystemFormWidget(IFWL_Widget* pWidget) const {
return nullptr;
}
-FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) {
+bool CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) {
CFWL_WidgetMgrItem* pItem = GetWidgetMgrItem(pWidget);
if (!pItem)
- return FALSE;
+ return false;
if (!pItem->pParent)
- return FALSE;
+ return false;
CFWL_WidgetMgrItem* pChild = pItem->pParent->pChild;
int32_t i = 0;
while (pChild) {
if (pChild == pItem) {
if (i == nIndex) {
- return TRUE;
+ return true;
}
if (pChild->pPrevious) {
pChild->pPrevious->pNext = pChild->pNext;
@@ -150,7 +150,7 @@ FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) {
pChild->pNext = pItem;
pItem->pPrevious = pChild;
pItem->pNext = nullptr;
- return TRUE;
+ return true;
}
i = 0;
while (i < nIndex && pChild->pNext) {
@@ -161,7 +161,7 @@ FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) {
pChild->pNext = pItem;
pItem->pPrevious = pChild;
pItem->pNext = nullptr;
- return TRUE;
+ return true;
}
if (pChild->pPrevious) {
pItem->pPrevious = pChild->pPrevious;
@@ -177,7 +177,7 @@ FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) {
pItem->pPrevious = nullptr;
pItem->pNext = nullptr;
}
- return TRUE;
+ return true;
}
FWL_Error CFWL_WidgetMgr::RepaintWidget(IFWL_Widget* pWidget,
const CFX_RectF* pRect) {
@@ -313,14 +313,14 @@ void CFWL_WidgetMgr::SetParent(IFWL_Widget* pParent, IFWL_Widget* pChild) {
SetWidgetIndex(pChild, -1);
}
-FX_BOOL CFWL_WidgetMgr::IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent) {
+bool CFWL_WidgetMgr::IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent) {
IFWL_Widget* pTemp = pChild;
do {
if (pTemp == pParent)
- return TRUE;
+ return true;
pTemp = GetParentWidget(pTemp);
} while (pTemp);
- return FALSE;
+ return false;
}
FWL_Error CFWL_WidgetMgr::SetWidgetRect_Native(IFWL_Widget* pWidget,
@@ -385,12 +385,12 @@ void CFWL_WidgetMgr::NotifySizeChanged(IFWL_Widget* pForm,
IFWL_Widget* CFWL_WidgetMgr::nextTab(IFWL_Widget* parent,
IFWL_Widget* focus,
- FX_BOOL& bFind) {
+ bool& bFind) {
CFWL_WidgetMgr* pMgr = parent->GetOwnerApp()->GetWidgetMgr();
IFWL_Widget* child = pMgr->GetFirstChildWidget(parent);
while (child) {
if (focus == child)
- bFind = TRUE;
+ bFind = true;
if ((child->GetStyles() & FWL_WGTSTYLE_TabStop) &&
(!focus || (focus != child && bFind))) {
@@ -415,7 +415,7 @@ int32_t CFWL_WidgetMgr::CountRadioButtonGroup(IFWL_Widget* pFirst) {
return iRet;
}
IFWL_Widget* CFWL_WidgetMgr::GetSiblingRadioButton(IFWL_Widget* pWidget,
- FX_BOOL bNext) {
+ bool bNext) {
return nullptr;
}
IFWL_Widget* CFWL_WidgetMgr::GetRadioButtonGroupHeader(
@@ -424,16 +424,16 @@ IFWL_Widget* CFWL_WidgetMgr::GetRadioButtonGroupHeader(
while (pNext) {
if (pNext->GetStyles() & FWL_WGTSTYLE_Group)
return pNext;
- pNext = GetSiblingRadioButton(pNext, FALSE);
+ pNext = GetSiblingRadioButton(pNext, false);
}
pNext = GetLastSiblingWidget(pRadioButton);
- while ((pNext = GetSiblingRadioButton(pNext, FALSE)) != nullptr &&
+ while ((pNext = GetSiblingRadioButton(pNext, false)) != nullptr &&
pNext != pRadioButton) {
if (pNext->GetStyles() & FWL_WGTSTYLE_Group)
return pNext;
}
pNext = GetFirstSiblingWidget(pRadioButton);
- return GetSiblingRadioButton(pNext, TRUE);
+ return GetSiblingRadioButton(pNext, true);
}
void CFWL_WidgetMgr::GetSameGroupRadioButton(
IFWL_Widget* pRadioButton,
@@ -445,7 +445,7 @@ void CFWL_WidgetMgr::GetSameGroupRadioButton(
int32_t iGroup = CountRadioButtonGroup(pFirst);
if (iGroup < 2) {
IFWL_Widget* pNext = pFirst;
- while ((pNext = GetSiblingRadioButton(pNext, TRUE)) != nullptr) {
+ while ((pNext = GetSiblingRadioButton(pNext, true)) != nullptr) {
group.Add(pNext);
}
return;
@@ -453,9 +453,9 @@ void CFWL_WidgetMgr::GetSameGroupRadioButton(
IFWL_Widget* pNext = GetRadioButtonGroupHeader(pRadioButton);
do {
group.Add(pNext);
- pNext = GetSiblingRadioButton(pNext, TRUE);
+ pNext = GetSiblingRadioButton(pNext, true);
if (!pNext)
- pNext = GetSiblingRadioButton(pFirst, TRUE);
+ pNext = GetSiblingRadioButton(pFirst, true);
} while (pNext && ((pNext->GetStyles() & FWL_WGTSTYLE_Group) == 0));
}
IFWL_Widget* CFWL_WidgetMgr::GetDefaultButton(IFWL_Widget* pParent) {
@@ -524,11 +524,11 @@ int32_t CFWL_WidgetMgr::TravelWidgetMgr(CFWL_WidgetMgrItem* pParent,
return iCount - 1;
}
-FX_BOOL CFWL_WidgetMgr::IsAbleNative(IFWL_Widget* pWidget) const {
+bool CFWL_WidgetMgr::IsAbleNative(IFWL_Widget* pWidget) const {
if (!pWidget)
- return FALSE;
+ return false;
if (!pWidget->IsInstance(FX_WSTRC(FWL_CLASS_Form))) {
- return FALSE;
+ return false;
}
uint32_t dwStyles = pWidget->GetStyles();
return ((dwStyles & FWL_WGTSTYLE_WindowTypeMask) ==
@@ -544,11 +544,11 @@ bool CFWL_WidgetMgr::IsFormDisabled() {
return !!(m_dwCapability & FWL_WGTMGR_DisableForm);
}
-FX_BOOL CFWL_WidgetMgr::GetAdapterPopupPos(IFWL_Widget* pWidget,
- FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
- const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup) {
+bool CFWL_WidgetMgr::GetAdapterPopupPos(IFWL_Widget* pWidget,
+ FX_FLOAT fMinHeight,
+ FX_FLOAT fMaxHeight,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup) {
CXFA_FWLAdapterWidgetMgr* pSDApapter = GetAdapterWidgetMgr();
return pSDApapter->GetPopupPos(pWidget, fMinHeight, fMaxHeight, rtAnchor,
rtPopup);
@@ -647,7 +647,7 @@ void CFWL_WidgetMgrDelegate::DrawChild(IFWL_Widget* parent,
if (!parent)
return;
- FX_BOOL bFormDisable = m_pWidgetMgr->IsFormDisabled();
+ bool bFormDisable = m_pWidgetMgr->IsFormDisabled();
IFWL_Widget* pNextChild = m_pWidgetMgr->GetFirstChildWidget(parent);
while (pNextChild) {
IFWL_Widget* child = pNextChild;
@@ -663,7 +663,7 @@ void CFWL_WidgetMgrDelegate::DrawChild(IFWL_Widget* parent,
CFX_Matrix widgetMatrix;
CFX_RectF clipBounds(rtWidget);
if (!bFormDisable)
- child->GetMatrix(widgetMatrix, TRUE);
+ child->GetMatrix(widgetMatrix, true);
if (pMatrix)
widgetMatrix.Concat(*pMatrix);
@@ -676,7 +676,7 @@ void CFWL_WidgetMgrDelegate::DrawChild(IFWL_Widget* parent,
pGraphics->SaveGraphState();
pGraphics->SetClipRect(clipBounds);
}
- widgetMatrix.Translate(rtWidget.left, rtWidget.top, TRUE);
+ widgetMatrix.Translate(rtWidget.left, rtWidget.top, true);
if (IFWL_WidgetDelegate* pDelegate = child->GetDelegate()) {
if (m_pWidgetMgr->IsFormDisabled() ||
@@ -730,31 +730,31 @@ void CFWL_WidgetMgrDelegate::DrawWidgetAfter(IFWL_Widget* pWidget,
pItem->iRedrawCounter = 0;
}
-FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget,
- CFX_Matrix* pMatrix,
- const CFX_RectF& rtDirty) {
+bool CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget,
+ CFX_Matrix* pMatrix,
+ const CFX_RectF& rtDirty) {
CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget);
if (pItem && pItem->iRedrawCounter > 0) {
pItem->iRedrawCounter = 0;
- return TRUE;
+ return true;
}
CFX_RectF rtWidget;
pWidget->GetWidgetRect(rtWidget);
rtWidget.left = rtWidget.top = 0;
pMatrix->TransformRect(rtWidget);
if (!rtWidget.IntersectWith(rtDirty))
- return FALSE;
+ return false;
IFWL_Widget* pChild =
pWidget->GetOwnerApp()->GetWidgetMgr()->GetFirstChildWidget(pWidget);
if (!pChild)
- return TRUE;
+ return true;
CFX_RectF rtChilds;
rtChilds.Empty();
- FX_BOOL bChildIntersectWithDirty = FALSE;
- FX_BOOL bOrginPtIntersectWidthChild = FALSE;
- FX_BOOL bOrginPtIntersectWidthDirty =
+ bool bChildIntersectWithDirty = false;
+ bool bOrginPtIntersectWidthChild = false;
+ bool bOrginPtIntersectWidthDirty =
rtDirty.Contains(rtWidget.left, rtWidget.top);
static FWL_NEEDREPAINTHITDATA hitPoint[kNeedRepaintHitPoints];
FXSYS_memset(hitPoint, 0, sizeof(hitPoint));
@@ -783,9 +783,9 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget,
if (r.IsEmpty())
continue;
if (r.Contains(rtDirty))
- return FALSE;
+ return false;
if (!bChildIntersectWithDirty && r.IntersectWith(rtDirty))
- bChildIntersectWithDirty = TRUE;
+ bChildIntersectWithDirty = true;
if (bOrginPtIntersectWidthDirty && !bOrginPtIntersectWidthChild)
bOrginPtIntersectWidthChild = rect.Contains(0, 0);
@@ -809,11 +809,11 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget,
} while (pChild);
if (!bChildIntersectWithDirty)
- return TRUE;
+ return true;
if (bOrginPtIntersectWidthDirty && !bOrginPtIntersectWidthChild)
- return TRUE;
+ return true;
if (rtChilds.IsEmpty())
- return TRUE;
+ return true;
int32_t repaintPoint = kNeedRepaintHitPoints;
for (int32_t i = 0; i < kNeedRepaintHitPoints; i++) {
@@ -821,18 +821,18 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget,
repaintPoint--;
}
if (repaintPoint > 0)
- return TRUE;
+ return true;
pMatrix->TransformRect(rtChilds);
if (rtChilds.Contains(rtDirty) || rtChilds.Contains(rtWidget))
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
-FX_BOOL CFWL_WidgetMgrDelegate::bUseOffscreenDirect(IFWL_Widget* pWidget) {
+bool CFWL_WidgetMgrDelegate::bUseOffscreenDirect(IFWL_Widget* pWidget) {
CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget);
if (!FWL_UseOffscreen(pWidget) || !(pItem->pOffscreen))
- return FALSE;
+ return false;
#if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_)
if (pItem->bOutsideChanged) {
@@ -841,9 +841,9 @@ FX_BOOL CFWL_WidgetMgrDelegate::bUseOffscreenDirect(IFWL_Widget* pWidget) {
CFX_RectF temp(m_pWidgetMgr->m_rtScreen);
temp.Deflate(50, 50);
if (!temp.Contains(r))
- return FALSE;
+ return false;
- pItem->bOutsideChanged = FALSE;
+ pItem->bOutsideChanged = false;
}
#endif
@@ -862,7 +862,7 @@ CFWL_WidgetMgrItem::CFWL_WidgetMgrItem(IFWL_Widget* widget)
iRedrawCounter(0)
#if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_)
,
- bOutsideChanged(FALSE)
+ bOutsideChanged(false)
#endif
{
}
diff --git a/xfa/fwl/core/cfwl_widgetmgr.h b/xfa/fwl/core/cfwl_widgetmgr.h
index 3c443cbfca..25c5735a98 100644
--- a/xfa/fwl/core/cfwl_widgetmgr.h
+++ b/xfa/fwl/core/cfwl_widgetmgr.h
@@ -40,7 +40,7 @@ class CFWL_WidgetMgrItem {
std::unique_ptr<CFX_Graphics> pOffscreen;
int32_t iRedrawCounter;
#if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_)
- FX_BOOL bOutsideChanged;
+ bool bOutsideChanged;
#endif
};
@@ -59,7 +59,7 @@ class CFWL_WidgetMgr {
IFWL_Widget* GetLastChildWidget(IFWL_Widget* pWidget) const;
IFWL_Widget* GetSystemFormWidget(IFWL_Widget* pWidget) const;
- FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex);
+ bool SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex);
FWL_Error RepaintWidget(IFWL_Widget* pWidget,
const CFX_RectF* pRect = nullptr);
@@ -70,13 +70,13 @@ class CFWL_WidgetMgr {
void RemoveWidget(IFWL_Widget* pWidget);
void SetOwner(IFWL_Widget* pOwner, IFWL_Widget* pOwned);
void SetParent(IFWL_Widget* pParent, IFWL_Widget* pChild);
- FX_BOOL IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent);
+ bool IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent);
FWL_Error SetWidgetRect_Native(IFWL_Widget* pWidget, const CFX_RectF& rect);
IFWL_Widget* GetWidgetAtPoint(IFWL_Widget* pParent, FX_FLOAT fx, FX_FLOAT fy);
void NotifySizeChanged(IFWL_Widget* pForm, FX_FLOAT fx, FX_FLOAT fy);
- IFWL_Widget* nextTab(IFWL_Widget* parent, IFWL_Widget* focus, FX_BOOL& bFind);
+ IFWL_Widget* nextTab(IFWL_Widget* parent, IFWL_Widget* focus, bool& bFind);
int32_t CountRadioButtonGroup(IFWL_Widget* pFirst);
- IFWL_Widget* GetSiblingRadioButton(IFWL_Widget* pWidget, FX_BOOL bNext);
+ IFWL_Widget* GetSiblingRadioButton(IFWL_Widget* pWidget, bool bNext);
IFWL_Widget* GetRadioButtonGroupHeader(IFWL_Widget* pRadioButton);
void GetSameGroupRadioButton(IFWL_Widget* pRadioButton,
CFX_ArrayTemplate<IFWL_Widget*>& group);
@@ -88,11 +88,11 @@ class CFWL_WidgetMgr {
CFWL_WidgetMgrItem* GetWidgetMgrItem(IFWL_Widget* pWidget) const;
bool IsThreadEnabled();
bool IsFormDisabled();
- FX_BOOL GetAdapterPopupPos(IFWL_Widget* pWidget,
- FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
- const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup);
+ bool GetAdapterPopupPos(IFWL_Widget* pWidget,
+ FX_FLOAT fMinHeight,
+ FX_FLOAT fMaxHeight,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup);
protected:
friend class CFWL_WidgetMgrDelegate;
@@ -101,7 +101,7 @@ class CFWL_WidgetMgr {
int32_t* pIndex,
CFWL_WidgetMgrItem* pItem,
IFWL_Widget** pWidget = nullptr);
- FX_BOOL IsAbleNative(IFWL_Widget* pWidget) const;
+ bool IsAbleNative(IFWL_Widget* pWidget) const;
uint32_t m_dwCapability;
std::unique_ptr<CFWL_WidgetMgrDelegate> m_pDelegate;
@@ -135,10 +135,10 @@ class CFWL_WidgetMgrDelegate {
CFX_Graphics* pGraphics,
CFX_RectF& rtClip,
const CFX_Matrix* pMatrix);
- FX_BOOL IsNeedRepaint(IFWL_Widget* pWidget,
- CFX_Matrix* pMatrix,
- const CFX_RectF& rtDirty);
- FX_BOOL bUseOffscreenDirect(IFWL_Widget* pWidget);
+ bool IsNeedRepaint(IFWL_Widget* pWidget,
+ CFX_Matrix* pMatrix,
+ const CFX_RectF& rtDirty);
+ bool bUseOffscreenDirect(IFWL_Widget* pWidget);
CFWL_WidgetMgr* m_pWidgetMgr;
};
diff --git a/xfa/fwl/core/cfx_barcode.cpp b/xfa/fwl/core/cfx_barcode.cpp
index f870833647..35a5f32e28 100644
--- a/xfa/fwl/core/cfx_barcode.cpp
+++ b/xfa/fwl/core/cfx_barcode.cpp
@@ -56,29 +56,29 @@ CFX_Barcode::CFX_Barcode() {}
CFX_Barcode::~CFX_Barcode() {}
-FX_BOOL CFX_Barcode::Create(BC_TYPE type) {
+bool CFX_Barcode::Create(BC_TYPE type) {
m_pBCEngine.reset(CreateBarCodeEngineObject(type));
return !!m_pBCEngine;
}
BC_TYPE CFX_Barcode::GetType() {
return m_pBCEngine ? m_pBCEngine->GetType() : BC_UNKNOWN;
}
-FX_BOOL CFX_Barcode::SetCharEncoding(BC_CHAR_ENCODING encoding) {
- return m_pBCEngine ? m_pBCEngine->SetCharEncoding(encoding) : FALSE;
+bool CFX_Barcode::SetCharEncoding(BC_CHAR_ENCODING encoding) {
+ return m_pBCEngine ? m_pBCEngine->SetCharEncoding(encoding) : false;
}
-FX_BOOL CFX_Barcode::SetModuleHeight(int32_t moduleHeight) {
- return m_pBCEngine ? m_pBCEngine->SetModuleHeight(moduleHeight) : FALSE;
+bool CFX_Barcode::SetModuleHeight(int32_t moduleHeight) {
+ return m_pBCEngine ? m_pBCEngine->SetModuleHeight(moduleHeight) : false;
}
-FX_BOOL CFX_Barcode::SetModuleWidth(int32_t moduleWidth) {
- return m_pBCEngine ? m_pBCEngine->SetModuleWidth(moduleWidth) : FALSE;
+bool CFX_Barcode::SetModuleWidth(int32_t moduleWidth) {
+ return m_pBCEngine ? m_pBCEngine->SetModuleWidth(moduleWidth) : false;
}
-FX_BOOL CFX_Barcode::SetHeight(int32_t height) {
- return m_pBCEngine ? m_pBCEngine->SetHeight(height) : FALSE;
+bool CFX_Barcode::SetHeight(int32_t height) {
+ return m_pBCEngine ? m_pBCEngine->SetHeight(height) : false;
}
-FX_BOOL CFX_Barcode::SetWidth(int32_t width) {
- return m_pBCEngine ? m_pBCEngine->SetWidth(width) : FALSE;
+bool CFX_Barcode::SetWidth(int32_t width) {
+ return m_pBCEngine ? m_pBCEngine->SetWidth(width) : false;
}
-FX_BOOL CFX_Barcode::CheckContentValidity(const CFX_WideStringC& contents) {
+bool CFX_Barcode::CheckContentValidity(const CFX_WideStringC& contents) {
switch (GetType()) {
case BC_CODE39:
case BC_CODABAR:
@@ -91,12 +91,12 @@ FX_BOOL CFX_Barcode::CheckContentValidity(const CFX_WideStringC& contents) {
return m_pBCEngine
? static_cast<CBC_OneCode*>(m_pBCEngine.get())
->CheckContentValidity(contents)
- : TRUE;
+ : true;
default:
- return TRUE;
+ return true;
}
}
-FX_BOOL CFX_Barcode::SetPrintChecksum(FX_BOOL checksum) {
+bool CFX_Barcode::SetPrintChecksum(bool checksum) {
switch (GetType()) {
case BC_CODE39:
case BC_CODABAR:
@@ -108,13 +108,13 @@ FX_BOOL CFX_Barcode::SetPrintChecksum(FX_BOOL checksum) {
case BC_UPCA:
return m_pBCEngine ? (static_cast<CBC_OneCode*>(m_pBCEngine.get())
->SetPrintChecksum(checksum),
- TRUE)
- : FALSE;
+ true)
+ : false;
default:
- return FALSE;
+ return false;
}
}
-FX_BOOL CFX_Barcode::SetDataLength(int32_t length) {
+bool CFX_Barcode::SetDataLength(int32_t length) {
switch (GetType()) {
case BC_CODE39:
case BC_CODABAR:
@@ -126,13 +126,13 @@ FX_BOOL CFX_Barcode::SetDataLength(int32_t length) {
case BC_UPCA:
return m_pBCEngine ? (static_cast<CBC_OneCode*>(m_pBCEngine.get())
->SetDataLength(length),
- TRUE)
- : FALSE;
+ true)
+ : false;
default:
- return FALSE;
+ return false;
}
}
-FX_BOOL CFX_Barcode::SetCalChecksum(FX_BOOL state) {
+bool CFX_Barcode::SetCalChecksum(bool state) {
switch (GetType()) {
case BC_CODE39:
case BC_CODABAR:
@@ -144,13 +144,13 @@ FX_BOOL CFX_Barcode::SetCalChecksum(FX_BOOL state) {
case BC_UPCA:
return m_pBCEngine ? (static_cast<CBC_OneCode*>(m_pBCEngine.get())
->SetCalChecksum(state),
- TRUE)
- : FALSE;
+ true)
+ : false;
default:
- return FALSE;
+ return false;
}
}
-FX_BOOL CFX_Barcode::SetFont(CFX_Font* pFont) {
+bool CFX_Barcode::SetFont(CFX_Font* pFont) {
switch (GetType()) {
case BC_CODE39:
case BC_CODABAR:
@@ -162,12 +162,12 @@ FX_BOOL CFX_Barcode::SetFont(CFX_Font* pFont) {
case BC_UPCA:
return m_pBCEngine
? static_cast<CBC_OneCode*>(m_pBCEngine.get())->SetFont(pFont)
- : FALSE;
+ : false;
default:
- return FALSE;
+ return false;
}
}
-FX_BOOL CFX_Barcode::SetFontSize(FX_FLOAT size) {
+bool CFX_Barcode::SetFontSize(FX_FLOAT size) {
switch (GetType()) {
case BC_CODE39:
case BC_CODABAR:
@@ -179,13 +179,13 @@ FX_BOOL CFX_Barcode::SetFontSize(FX_FLOAT size) {
case BC_UPCA:
return m_pBCEngine ? (static_cast<CBC_OneCode*>(m_pBCEngine.get())
->SetFontSize(size),
- TRUE)
- : FALSE;
+ true)
+ : false;
default:
- return FALSE;
+ return false;
}
}
-FX_BOOL CFX_Barcode::SetFontStyle(int32_t style) {
+bool CFX_Barcode::SetFontStyle(int32_t style) {
switch (GetType()) {
case BC_CODE39:
case BC_CODABAR:
@@ -197,13 +197,13 @@ FX_BOOL CFX_Barcode::SetFontStyle(int32_t style) {
case BC_UPCA:
return m_pBCEngine ? (static_cast<CBC_OneCode*>(m_pBCEngine.get())
->SetFontStyle(style),
- TRUE)
- : FALSE;
+ true)
+ : false;
default:
- return FALSE;
+ return false;
}
}
-FX_BOOL CFX_Barcode::SetFontColor(FX_ARGB color) {
+bool CFX_Barcode::SetFontColor(FX_ARGB color) {
switch (GetType()) {
case BC_CODE39:
case BC_CODABAR:
@@ -215,14 +215,14 @@ FX_BOOL CFX_Barcode::SetFontColor(FX_ARGB color) {
case BC_UPCA:
return m_pBCEngine ? (static_cast<CBC_OneCode*>(m_pBCEngine.get())
->SetFontColor(color),
- TRUE)
- : FALSE;
+ true)
+ : false;
default:
- return FALSE;
+ return false;
}
}
-FX_BOOL CFX_Barcode::SetTextLocation(BC_TEXT_LOC location) {
- typedef FX_BOOL (CBC_CodeBase::*memptrtype)(BC_TEXT_LOC);
+bool CFX_Barcode::SetTextLocation(BC_TEXT_LOC location) {
+ typedef bool (CBC_CodeBase::*memptrtype)(BC_TEXT_LOC);
memptrtype memptr = nullptr;
switch (GetType()) {
case BC_CODE39:
@@ -239,10 +239,10 @@ FX_BOOL CFX_Barcode::SetTextLocation(BC_TEXT_LOC location) {
default:
break;
}
- return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(location) : FALSE;
+ return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(location) : false;
}
-FX_BOOL CFX_Barcode::SetWideNarrowRatio(int32_t ratio) {
- typedef FX_BOOL (CBC_CodeBase::*memptrtype)(int32_t);
+bool CFX_Barcode::SetWideNarrowRatio(int32_t ratio) {
+ typedef bool (CBC_CodeBase::*memptrtype)(int32_t);
memptrtype memptr = nullptr;
switch (GetType()) {
case BC_CODE39:
@@ -254,10 +254,10 @@ FX_BOOL CFX_Barcode::SetWideNarrowRatio(int32_t ratio) {
default:
break;
}
- return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(ratio) : FALSE;
+ return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(ratio) : false;
}
-FX_BOOL CFX_Barcode::SetStartChar(FX_CHAR start) {
- typedef FX_BOOL (CBC_CodeBase::*memptrtype)(FX_CHAR);
+bool CFX_Barcode::SetStartChar(FX_CHAR start) {
+ typedef bool (CBC_CodeBase::*memptrtype)(FX_CHAR);
memptrtype memptr = nullptr;
switch (GetType()) {
case BC_CODABAR:
@@ -266,10 +266,10 @@ FX_BOOL CFX_Barcode::SetStartChar(FX_CHAR start) {
default:
break;
}
- return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(start) : FALSE;
+ return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(start) : false;
}
-FX_BOOL CFX_Barcode::SetEndChar(FX_CHAR end) {
- typedef FX_BOOL (CBC_CodeBase::*memptrtype)(FX_CHAR);
+bool CFX_Barcode::SetEndChar(FX_CHAR end) {
+ typedef bool (CBC_CodeBase::*memptrtype)(FX_CHAR);
memptrtype memptr = nullptr;
switch (GetType()) {
case BC_CODABAR:
@@ -278,10 +278,10 @@ FX_BOOL CFX_Barcode::SetEndChar(FX_CHAR end) {
default:
break;
}
- return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(end) : FALSE;
+ return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(end) : false;
}
-FX_BOOL CFX_Barcode::SetVersion(int32_t version) {
- typedef FX_BOOL (CBC_CodeBase::*memptrtype)(int32_t);
+bool CFX_Barcode::SetVersion(int32_t version) {
+ typedef bool (CBC_CodeBase::*memptrtype)(int32_t);
memptrtype memptr = nullptr;
switch (GetType()) {
case BC_QR_CODE:
@@ -290,10 +290,10 @@ FX_BOOL CFX_Barcode::SetVersion(int32_t version) {
default:
break;
}
- return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(version) : FALSE;
+ return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(version) : false;
}
-FX_BOOL CFX_Barcode::SetErrorCorrectionLevel(int32_t level) {
- typedef FX_BOOL (CBC_CodeBase::*memptrtype)(int32_t);
+bool CFX_Barcode::SetErrorCorrectionLevel(int32_t level) {
+ typedef bool (CBC_CodeBase::*memptrtype)(int32_t);
memptrtype memptr = nullptr;
switch (GetType()) {
case BC_QR_CODE:
@@ -303,12 +303,12 @@ FX_BOOL CFX_Barcode::SetErrorCorrectionLevel(int32_t level) {
memptr = (memptrtype)&CBC_PDF417I::SetErrorCorrectionLevel;
break;
default:
- return FALSE;
+ return false;
}
- return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(level) : FALSE;
+ return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(level) : false;
}
-FX_BOOL CFX_Barcode::SetTruncated(FX_BOOL truncated) {
- typedef void (CBC_CodeBase::*memptrtype)(FX_BOOL);
+bool CFX_Barcode::SetTruncated(bool truncated) {
+ typedef void (CBC_CodeBase::*memptrtype)(bool);
memptrtype memptr = nullptr;
switch (GetType()) {
case BC_PDF417:
@@ -317,22 +317,22 @@ FX_BOOL CFX_Barcode::SetTruncated(FX_BOOL truncated) {
default:
break;
}
- return m_pBCEngine && memptr ? ((m_pBCEngine.get()->*memptr)(truncated), TRUE)
- : FALSE;
+ return m_pBCEngine && memptr ? ((m_pBCEngine.get()->*memptr)(truncated), true)
+ : false;
}
-FX_BOOL CFX_Barcode::Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) {
+bool CFX_Barcode::Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) {
return m_pBCEngine && m_pBCEngine->Encode(contents, isDevice, e);
}
-FX_BOOL CFX_Barcode::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) {
+bool CFX_Barcode::RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) {
return m_pBCEngine && m_pBCEngine->RenderDevice(device, matrix, e);
}
-FX_BOOL CFX_Barcode::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
+bool CFX_Barcode::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
return m_pBCEngine && m_pBCEngine->RenderBitmap(pOutBitmap, e);
}
diff --git a/xfa/fwl/core/cfx_barcode.h b/xfa/fwl/core/cfx_barcode.h
index 8a6a10adc2..0a454e5599 100644
--- a/xfa/fwl/core/cfx_barcode.h
+++ b/xfa/fwl/core/cfx_barcode.h
@@ -25,33 +25,33 @@ class CFX_Barcode {
CFX_Barcode();
~CFX_Barcode();
- FX_BOOL Create(BC_TYPE type);
+ bool Create(BC_TYPE type);
BC_TYPE GetType();
- FX_BOOL Encode(const CFX_WideStringC& contents, FX_BOOL isDevice, int32_t& e);
- FX_BOOL RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e);
- FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e);
- FX_BOOL SetCharEncoding(BC_CHAR_ENCODING encoding);
- FX_BOOL SetModuleHeight(int32_t moduleHeight);
- FX_BOOL SetModuleWidth(int32_t moduleWidth);
- FX_BOOL SetHeight(int32_t height);
- FX_BOOL SetWidth(int32_t width);
- FX_BOOL CheckContentValidity(const CFX_WideStringC& contents);
- FX_BOOL SetPrintChecksum(FX_BOOL checksum);
- FX_BOOL SetDataLength(int32_t length);
- FX_BOOL SetCalChecksum(FX_BOOL state);
- FX_BOOL SetFont(CFX_Font* pFont);
- FX_BOOL SetFontSize(FX_FLOAT size);
- FX_BOOL SetFontStyle(int32_t style);
- FX_BOOL SetFontColor(FX_ARGB color);
- FX_BOOL SetTextLocation(BC_TEXT_LOC location);
- FX_BOOL SetWideNarrowRatio(int32_t ratio);
- FX_BOOL SetStartChar(FX_CHAR start);
- FX_BOOL SetEndChar(FX_CHAR end);
- FX_BOOL SetVersion(int32_t version);
- FX_BOOL SetErrorCorrectionLevel(int32_t level);
- FX_BOOL SetTruncated(FX_BOOL truncated);
+ bool Encode(const CFX_WideStringC& contents, bool isDevice, int32_t& e);
+ bool RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e);
+ bool RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e);
+ bool SetCharEncoding(BC_CHAR_ENCODING encoding);
+ bool SetModuleHeight(int32_t moduleHeight);
+ bool SetModuleWidth(int32_t moduleWidth);
+ bool SetHeight(int32_t height);
+ bool SetWidth(int32_t width);
+ bool CheckContentValidity(const CFX_WideStringC& contents);
+ bool SetPrintChecksum(bool checksum);
+ bool SetDataLength(int32_t length);
+ bool SetCalChecksum(bool state);
+ bool SetFont(CFX_Font* pFont);
+ bool SetFontSize(FX_FLOAT size);
+ bool SetFontStyle(int32_t style);
+ bool SetFontColor(FX_ARGB color);
+ bool SetTextLocation(BC_TEXT_LOC location);
+ bool SetWideNarrowRatio(int32_t ratio);
+ bool SetStartChar(FX_CHAR start);
+ bool SetEndChar(FX_CHAR end);
+ bool SetVersion(int32_t version);
+ bool SetErrorCorrectionLevel(int32_t level);
+ bool SetTruncated(bool truncated);
protected:
std::unique_ptr<CBC_CodeBase> m_pBCEngine;
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp
index 2c67f6e34a..86a1ca8e44 100644
--- a/xfa/fwl/core/fwl_noteimp.cpp
+++ b/xfa/fwl/core/fwl_noteimp.cpp
@@ -14,7 +14,7 @@
#include "xfa/fwl/core/ifwl_tooltip.h"
CFWL_NoteLoop::CFWL_NoteLoop(IFWL_Widget* pForm)
- : m_pForm(pForm), m_bContinueModal(TRUE) {}
+ : m_pForm(pForm), m_bContinueModal(true) {}
FWL_Error CFWL_NoteLoop::Idle(int32_t count) {
#if (_FX_OS_ == _FX_WIN32_DESKTOP_)
@@ -38,11 +38,11 @@ FWL_Error CFWL_NoteLoop::Idle(int32_t count) {
IFWL_Widget* CFWL_NoteLoop::GetForm() {
return m_pForm;
}
-FX_BOOL CFWL_NoteLoop::ContinueModal() {
+bool CFWL_NoteLoop::ContinueModal() {
return m_bContinueModal;
}
FWL_Error CFWL_NoteLoop::EndModalLoop() {
- m_bContinueModal = FALSE;
+ m_bContinueModal = false;
return FWL_Error::Succeeded;
}
@@ -71,7 +71,7 @@ CFWL_NoteDriver::CFWL_NoteDriver()
PushNoteLoop(m_pNoteLoop.get());
}
CFWL_NoteDriver::~CFWL_NoteDriver() {
- ClearInvalidEventTargets(TRUE);
+ ClearInvalidEventTargets(true);
}
void CFWL_NoteDriver::SendEvent(CFWL_Event* pNote) {
@@ -114,7 +114,7 @@ FWL_Error CFWL_NoteDriver::UnregisterEventTarget(IFWL_Widget* pListener) {
return FWL_Error::Succeeded;
}
-void CFWL_NoteDriver::ClearEventTargets(FX_BOOL bRemoveAll) {
+void CFWL_NoteDriver::ClearEventTargets(bool bRemoveAll) {
ClearInvalidEventTargets(bRemoveAll);
}
@@ -131,9 +131,9 @@ CFWL_NoteLoop* CFWL_NoteDriver::PopNoteLoop() {
m_noteLoopQueue.RemoveAt(pos - 1);
return p;
}
-FX_BOOL CFWL_NoteDriver::SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify) {
+bool CFWL_NoteDriver::SetFocus(IFWL_Widget* pFocus, bool bNotify) {
if (m_pFocus == pFocus) {
- return TRUE;
+ return true;
}
IFWL_Widget* pPrev = m_pFocus;
m_pFocus = pFocus;
@@ -163,7 +163,7 @@ FX_BOOL CFWL_NoteDriver::SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify) {
if (IFWL_WidgetDelegate* pDelegate = pFocus->GetDelegate())
pDelegate->OnProcessMessage(&ms);
}
- return TRUE;
+ return true;
}
FWL_Error CFWL_NoteDriver::Run() {
#if (_FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_WIN32_DESKTOP_ || \
@@ -190,7 +190,7 @@ IFWL_Widget* CFWL_NoteDriver::GetHover() {
void CFWL_NoteDriver::SetHover(IFWL_Widget* pHover) {
m_pHover = pHover;
}
-void CFWL_NoteDriver::SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet) {
+void CFWL_NoteDriver::SetGrab(IFWL_Widget* pGrab, bool bSet) {
m_pGrab = bSet ? pGrab : nullptr;
}
void CFWL_NoteDriver::NotifyTargetHide(IFWL_Widget* pNoteTarget) {
@@ -256,25 +256,25 @@ FWL_Error CFWL_NoteDriver::UnRegisterForm(IFWL_Widget* pForm) {
m_forms.RemoveAt(nIndex);
return FWL_Error::Succeeded;
}
-FX_BOOL CFWL_NoteDriver::QueueMessage(CFWL_Message* pMessage) {
+bool CFWL_NoteDriver::QueueMessage(CFWL_Message* pMessage) {
pMessage->Retain();
m_noteQueue.Add(pMessage);
- return TRUE;
+ return true;
}
-FX_BOOL CFWL_NoteDriver::UnqueueMessage(CFWL_NoteLoop* pNoteLoop) {
+bool CFWL_NoteDriver::UnqueueMessage(CFWL_NoteLoop* pNoteLoop) {
if (m_noteQueue.GetSize() < 1) {
- return FALSE;
+ return false;
}
CFWL_Message* pMessage = m_noteQueue[0];
m_noteQueue.RemoveAt(0);
if (!IsValidMessage(pMessage)) {
pMessage->Release();
- return TRUE;
+ return true;
}
ProcessMessage(pMessage);
pMessage->Release();
- return TRUE;
+ return true;
}
CFWL_NoteLoop* CFWL_NoteDriver::GetTopLoop() {
int32_t size = m_noteLoopQueue.GetSize();
@@ -286,25 +286,25 @@ int32_t CFWL_NoteDriver::CountLoop() {
return m_noteLoopQueue.GetSize();
}
-FX_BOOL CFWL_NoteDriver::ProcessMessage(CFWL_Message* pMessage) {
+bool CFWL_NoteDriver::ProcessMessage(CFWL_Message* pMessage) {
CFWL_WidgetMgr* pWidgetMgr =
pMessage->m_pDstTarget->GetOwnerApp()->GetWidgetMgr();
IFWL_Widget* pMessageForm = pWidgetMgr->IsFormDisabled()
? pMessage->m_pDstTarget
: GetMessageForm(pMessage->m_pDstTarget);
if (!pMessageForm)
- return FALSE;
+ return false;
if (DispatchMessage(pMessage, pMessageForm)) {
if (pMessage->GetClassID() == CFWL_MessageType::Mouse)
MouseSecondary(static_cast<CFWL_MsgMouse*>(pMessage));
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage,
- IFWL_Widget* pMessageForm) {
- FX_BOOL bRet = FALSE;
+bool CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage,
+ IFWL_Widget* pMessageForm) {
+ bool bRet = false;
switch (pMessage->GetClassID()) {
case CFWL_MessageType::Activate: {
bRet = DoActivate(static_cast<CFWL_MsgActivate*>(pMessage), pMessageForm);
@@ -341,7 +341,7 @@ FX_BOOL CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage,
break;
}
case CFWL_MessageType::Cursor: {
- bRet = TRUE;
+ bRet = true;
break;
}
case CFWL_MessageType::WindowMove: {
@@ -355,7 +355,7 @@ FX_BOOL CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage,
break;
}
default: {
- bRet = TRUE;
+ bRet = true;
break;
}
}
@@ -368,49 +368,49 @@ FX_BOOL CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage,
return bRet;
}
-FX_BOOL CFWL_NoteDriver::DoActivate(CFWL_MsgActivate* pMsg,
- IFWL_Widget* pMessageForm) {
+bool CFWL_NoteDriver::DoActivate(CFWL_MsgActivate* pMsg,
+ IFWL_Widget* pMessageForm) {
pMsg->m_pDstTarget = pMessageForm;
return !!(pMsg->m_pDstTarget->GetStates() & FWL_WGTSTATE_Deactivated);
}
-FX_BOOL CFWL_NoteDriver::DoDeactivate(CFWL_MsgDeactivate* pMsg,
- IFWL_Widget* pMessageForm) {
+bool CFWL_NoteDriver::DoDeactivate(CFWL_MsgDeactivate* pMsg,
+ IFWL_Widget* pMessageForm) {
int32_t iTrackLoop = m_noteLoopQueue.GetSize();
if (iTrackLoop <= 0)
- return FALSE;
+ return false;
if (iTrackLoop == 1) {
if (pMessageForm->IsInstance(FX_WSTRC(L"FWL_FORMPROXY"))) {
- return FALSE;
+ return false;
}
if (pMsg->m_pSrcTarget &&
pMsg->m_pSrcTarget->IsInstance(FX_WSTRC(L"FWL_FORMPROXY"))) {
- return FALSE;
+ return false;
}
if (pMsg->m_pSrcTarget &&
pMsg->m_pSrcTarget->GetClassID() == FWL_Type::ToolTip) {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
IFWL_Widget* pDst = pMsg->m_pDstTarget;
if (!pDst)
- return FALSE;
+ return false;
#if (_FX_OS_ == _FX_MACOSX_)
if (pDst == pMessageForm && pDst->IsInstance(L"FWL_FORMPROXY")) {
- return TRUE;
+ return true;
}
#endif
return pDst != pMessageForm &&
!pDst->IsInstance(FX_WSTRC(L"FWL_FORMPROXY")) &&
!pMessageForm->IsInstance(FX_WSTRC(L"FWL_FORMPROXY"));
}
-FX_BOOL CFWL_NoteDriver::DoSetFocus(CFWL_MsgSetFocus* pMsg,
- IFWL_Widget* pMessageForm) {
+bool CFWL_NoteDriver::DoSetFocus(CFWL_MsgSetFocus* pMsg,
+ IFWL_Widget* pMessageForm) {
CFWL_WidgetMgr* pWidgetMgr = pMessageForm->GetOwnerApp()->GetWidgetMgr();
if (pWidgetMgr->IsFormDisabled()) {
m_pFocus = pMsg->m_pDstTarget;
- return TRUE;
+ return true;
}
IFWL_Widget* pWidget = pMsg->m_pDstTarget;
if (pWidget) {
@@ -420,20 +420,20 @@ FX_BOOL CFWL_NoteDriver::DoSetFocus(CFWL_MsgSetFocus* pMsg,
pMsg->m_pDstTarget = pSubFocus;
if (m_pFocus != pMsg->m_pDstTarget) {
m_pFocus = pMsg->m_pDstTarget;
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CFWL_NoteDriver::DoKillFocus(CFWL_MsgKillFocus* pMsg,
- IFWL_Widget* pMessageForm) {
+bool CFWL_NoteDriver::DoKillFocus(CFWL_MsgKillFocus* pMsg,
+ IFWL_Widget* pMessageForm) {
CFWL_WidgetMgr* pWidgetMgr = pMessageForm->GetOwnerApp()->GetWidgetMgr();
if (pWidgetMgr->IsFormDisabled()) {
if (m_pFocus == pMsg->m_pDstTarget) {
m_pFocus = nullptr;
}
- return TRUE;
+ return true;
}
IFWL_Form* pForm = static_cast<IFWL_Form*>(pMsg->m_pDstTarget);
if (pForm) {
@@ -442,13 +442,13 @@ FX_BOOL CFWL_NoteDriver::DoKillFocus(CFWL_MsgKillFocus* pMsg,
pMsg->m_pDstTarget = pSubFocus;
if (m_pFocus == pMsg->m_pDstTarget) {
m_pFocus = nullptr;
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CFWL_NoteDriver::DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm) {
+bool CFWL_NoteDriver::DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm) {
#if (_FX_OS_ != _FX_MACOSX_)
if (pMsg->m_dwCmd == FWL_KeyCommand::KeyDown &&
pMsg->m_dwKeyCode == FWL_VKEY_Tab) {
@@ -459,19 +459,19 @@ FX_BOOL CFWL_NoteDriver::DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm) {
if (pWidgetMgr->GetSystemFormWidget(m_pFocus) != pForm)
pFocus = nullptr;
}
- FX_BOOL bFind = FALSE;
+ bool bFind = false;
IFWL_Widget* pNextTabStop = pWidgetMgr->nextTab(pForm, pFocus, bFind);
if (!pNextTabStop) {
- bFind = FALSE;
+ bFind = false;
pNextTabStop = pWidgetMgr->nextTab(pForm, nullptr, bFind);
}
if (pNextTabStop == pFocus) {
- return TRUE;
+ return true;
}
if (pNextTabStop) {
SetFocus(pNextTabStop);
}
- return TRUE;
+ return true;
}
#endif
if (!m_pFocus) {
@@ -481,16 +481,15 @@ FX_BOOL CFWL_NoteDriver::DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm) {
IFWL_Widget* defButton = pWidgetMgr->GetDefaultButton(pMessageForm);
if (defButton) {
pMsg->m_pDstTarget = defButton;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
pMsg->m_pDstTarget = m_pFocus;
- return TRUE;
+ return true;
}
-FX_BOOL CFWL_NoteDriver::DoMouse(CFWL_MsgMouse* pMsg,
- IFWL_Widget* pMessageForm) {
+bool CFWL_NoteDriver::DoMouse(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm) {
if (pMsg->m_dwCmd == FWL_MouseCommand::Leave ||
pMsg->m_dwCmd == FWL_MouseCommand::Hover ||
pMsg->m_dwCmd == FWL_MouseCommand::Enter) {
@@ -502,45 +501,45 @@ FX_BOOL CFWL_NoteDriver::DoMouse(CFWL_MsgMouse* pMsg,
if (!DoMouseEx(pMsg, pMessageForm)) {
pMsg->m_pDstTarget = pMessageForm;
}
- return TRUE;
+ return true;
}
-FX_BOOL CFWL_NoteDriver::DoWheel(CFWL_MsgMouseWheel* pMsg,
- IFWL_Widget* pMessageForm) {
+bool CFWL_NoteDriver::DoWheel(CFWL_MsgMouseWheel* pMsg,
+ IFWL_Widget* pMessageForm) {
CFWL_WidgetMgr* pWidgetMgr = pMessageForm->GetOwnerApp()->GetWidgetMgr();
if (!pWidgetMgr)
- return FALSE;
+ return false;
IFWL_Widget* pDst =
pWidgetMgr->GetWidgetAtPoint(pMessageForm, pMsg->m_fx, pMsg->m_fy);
if (!pDst)
- return FALSE;
+ return false;
pMessageForm->TransformTo(pDst, pMsg->m_fx, pMsg->m_fy);
pMsg->m_pDstTarget = pDst;
- return TRUE;
+ return true;
}
-FX_BOOL CFWL_NoteDriver::DoSize(CFWL_MsgSize* pMsg) {
+bool CFWL_NoteDriver::DoSize(CFWL_MsgSize* pMsg) {
CFWL_WidgetMgr* pWidgetMgr =
pMsg->m_pDstTarget->GetOwnerApp()->GetWidgetMgr();
if (!pWidgetMgr)
- return FALSE;
+ return false;
pWidgetMgr->NotifySizeChanged(pMsg->m_pDstTarget, (FX_FLOAT)pMsg->m_iWidth,
(FX_FLOAT)pMsg->m_iHeight);
- return TRUE;
+ return true;
}
-FX_BOOL CFWL_NoteDriver::DoWindowMove(CFWL_MsgWindowMove* pMsg,
- IFWL_Widget* pMessageForm) {
+bool CFWL_NoteDriver::DoWindowMove(CFWL_MsgWindowMove* pMsg,
+ IFWL_Widget* pMessageForm) {
return pMsg->m_pDstTarget == pMessageForm;
}
-FX_BOOL CFWL_NoteDriver::DoDragFiles(CFWL_MsgDropFiles* pMsg,
- IFWL_Widget* pMessageForm) {
+bool CFWL_NoteDriver::DoDragFiles(CFWL_MsgDropFiles* pMsg,
+ IFWL_Widget* pMessageForm) {
return pMsg->m_pDstTarget == pMessageForm;
}
-FX_BOOL CFWL_NoteDriver::DoMouseEx(CFWL_MsgMouse* pMsg,
- IFWL_Widget* pMessageForm) {
+bool CFWL_NoteDriver::DoMouseEx(CFWL_MsgMouse* pMsg,
+ IFWL_Widget* pMessageForm) {
CFWL_WidgetMgr* pWidgetMgr = pMessageForm->GetOwnerApp()->GetWidgetMgr();
if (!pWidgetMgr)
- return FALSE;
+ return false;
IFWL_Widget* pTarget = nullptr;
if (m_pGrab)
pTarget = m_pGrab;
@@ -554,9 +553,9 @@ FX_BOOL CFWL_NoteDriver::DoMouseEx(CFWL_MsgMouse* pMsg,
}
}
if (!pTarget)
- return FALSE;
+ return false;
pMsg->m_pDstTarget = pTarget;
- return TRUE;
+ return true;
}
void CFWL_NoteDriver::MouseSecondary(CFWL_MsgMouse* pMsg) {
IFWL_Widget* pTarget = pMsg->m_pDstTarget;
@@ -586,24 +585,24 @@ void CFWL_NoteDriver::MouseSecondary(CFWL_MsgMouse* pMsg) {
msHover.m_dwCmd = FWL_MouseCommand::Hover;
DispatchMessage(&msHover, nullptr);
}
-FX_BOOL CFWL_NoteDriver::IsValidMessage(CFWL_Message* pMessage) {
+bool CFWL_NoteDriver::IsValidMessage(CFWL_Message* pMessage) {
if (pMessage->GetClassID() == CFWL_MessageType::Post)
- return TRUE;
+ return true;
int32_t iCount = m_noteLoopQueue.GetSize();
for (int32_t i = 0; i < iCount; i++) {
CFWL_NoteLoop* pNoteLoop = static_cast<CFWL_NoteLoop*>(m_noteLoopQueue[i]);
IFWL_Widget* pForm = pNoteLoop->GetForm();
if (pForm && (pForm == pMessage->m_pDstTarget))
- return TRUE;
+ return true;
}
iCount = m_forms.GetSize();
for (int32_t j = 0; j < iCount; j++) {
IFWL_Form* pForm = static_cast<IFWL_Form*>(m_forms[j]);
if (pForm == pMessage->m_pDstTarget)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
IFWL_Widget* CFWL_NoteDriver::GetMessageForm(IFWL_Widget* pDstTarget) {
@@ -627,7 +626,7 @@ IFWL_Widget* CFWL_NoteDriver::GetMessageForm(IFWL_Widget* pDstTarget) {
return pMessageForm;
}
-void CFWL_NoteDriver::ClearInvalidEventTargets(FX_BOOL bRemoveAll) {
+void CFWL_NoteDriver::ClearInvalidEventTargets(bool bRemoveAll) {
auto it = m_eventTargets.begin();
while (it != m_eventTargets.end()) {
auto old = it++;
@@ -692,7 +691,7 @@ CFX_RectF CFWL_CoreToolTipDP::GetAnchor() {
CFWL_EventTarget::CFWL_EventTarget(CFWL_NoteDriver* pNoteDriver,
IFWL_Widget* pListener)
- : m_pListener(pListener), m_pNoteDriver(pNoteDriver), m_bInvalid(FALSE) {}
+ : m_pListener(pListener), m_pNoteDriver(pNoteDriver), m_bInvalid(false) {}
CFWL_EventTarget::~CFWL_EventTarget() {
m_eventSources.RemoveAll();
}
@@ -706,13 +705,13 @@ int32_t CFWL_EventTarget::SetEventSource(IFWL_Widget* pSource,
return 1;
}
-FX_BOOL CFWL_EventTarget::ProcessEvent(CFWL_Event* pEvent) {
+bool CFWL_EventTarget::ProcessEvent(CFWL_Event* pEvent) {
IFWL_WidgetDelegate* pDelegate = m_pListener->GetDelegate();
if (!pDelegate)
- return FALSE;
+ return false;
if (m_eventSources.GetCount() == 0) {
pDelegate->OnProcessEvent(pEvent);
- return TRUE;
+ return true;
}
FX_POSITION pos = m_eventSources.GetStartPosition();
while (pos) {
@@ -723,16 +722,16 @@ FX_BOOL CFWL_EventTarget::ProcessEvent(CFWL_Event* pEvent) {
pEvent->GetClassID() == CFWL_EventType::Idle) {
if (IsFilterEvent(pEvent, dwFilter)) {
pDelegate->OnProcessEvent(pEvent);
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CFWL_EventTarget::IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) {
+bool CFWL_EventTarget::IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) {
if (dwFilter == FWL_EVENT_ALL_MASK)
- return TRUE;
+ return true;
switch (pEvent->GetClassID()) {
case CFWL_EventType::Mouse:
diff --git a/xfa/fwl/core/fwl_noteimp.h b/xfa/fwl/core/fwl_noteimp.h
index db967fcc15..e9a738aa87 100644
--- a/xfa/fwl/core/fwl_noteimp.h
+++ b/xfa/fwl/core/fwl_noteimp.h
@@ -39,7 +39,7 @@ class CFWL_NoteLoop {
FWL_Error Idle(int32_t count);
IFWL_Widget* GetForm();
- FX_BOOL ContinueModal();
+ bool ContinueModal();
FWL_Error EndModalLoop();
FWL_Error SetMainForm(IFWL_Widget* pForm);
@@ -47,7 +47,7 @@ class CFWL_NoteLoop {
void GenerateCommondEvent(uint32_t dwCommand);
IFWL_Widget* m_pForm;
- FX_BOOL m_bContinueModal;
+ bool m_bContinueModal;
};
class CFWL_NoteDriver {
@@ -60,12 +60,12 @@ class CFWL_NoteDriver {
IFWL_Widget* pEventSource = nullptr,
uint32_t dwFilter = FWL_EVENT_ALL_MASK);
FWL_Error UnregisterEventTarget(IFWL_Widget* pListener);
- void ClearEventTargets(FX_BOOL bRemoveAll);
+ void ClearEventTargets(bool bRemoveAll);
FWL_Error PushNoteLoop(CFWL_NoteLoop* pNoteLoop);
CFWL_NoteLoop* PopNoteLoop();
IFWL_Widget* GetFocus();
- FX_BOOL SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify = FALSE);
- void SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet);
+ bool SetFocus(IFWL_Widget* pFocus, bool bNotify = false);
+ void SetGrab(IFWL_Widget* pGrab, bool bSet);
FWL_Error Run();
IFWL_Widget* GetHover();
@@ -74,29 +74,29 @@ class CFWL_NoteDriver {
void NotifyTargetDestroy(IFWL_Widget* pNoteTarget);
FWL_Error RegisterForm(IFWL_Widget* pForm);
FWL_Error UnRegisterForm(IFWL_Widget* pForm);
- FX_BOOL QueueMessage(CFWL_Message* pMessage);
- FX_BOOL UnqueueMessage(CFWL_NoteLoop* pNoteLoop);
+ bool QueueMessage(CFWL_Message* pMessage);
+ bool UnqueueMessage(CFWL_NoteLoop* pNoteLoop);
CFWL_NoteLoop* GetTopLoop();
int32_t CountLoop();
- FX_BOOL ProcessMessage(CFWL_Message* pMessage);
+ bool ProcessMessage(CFWL_Message* pMessage);
protected:
- FX_BOOL DispatchMessage(CFWL_Message* pMessage, IFWL_Widget* pMessageForm);
- FX_BOOL DoActivate(CFWL_MsgActivate* pMsg, IFWL_Widget* pMessageForm);
- FX_BOOL DoDeactivate(CFWL_MsgDeactivate* pMsg, IFWL_Widget* pMessageForm);
- FX_BOOL DoSetFocus(CFWL_MsgSetFocus* pMsg, IFWL_Widget* pMessageForm);
- FX_BOOL DoKillFocus(CFWL_MsgKillFocus* pMsg, IFWL_Widget* pMessageForm);
- FX_BOOL DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm);
- FX_BOOL DoMouse(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm);
- FX_BOOL DoWheel(CFWL_MsgMouseWheel* pMsg, IFWL_Widget* pMessageForm);
- FX_BOOL DoSize(CFWL_MsgSize* pMsg);
- FX_BOOL DoWindowMove(CFWL_MsgWindowMove* pMsg, IFWL_Widget* pMessageForm);
- FX_BOOL DoDragFiles(CFWL_MsgDropFiles* pMsg, IFWL_Widget* pMessageForm);
- FX_BOOL DoMouseEx(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm);
+ bool DispatchMessage(CFWL_Message* pMessage, IFWL_Widget* pMessageForm);
+ bool DoActivate(CFWL_MsgActivate* pMsg, IFWL_Widget* pMessageForm);
+ bool DoDeactivate(CFWL_MsgDeactivate* pMsg, IFWL_Widget* pMessageForm);
+ bool DoSetFocus(CFWL_MsgSetFocus* pMsg, IFWL_Widget* pMessageForm);
+ bool DoKillFocus(CFWL_MsgKillFocus* pMsg, IFWL_Widget* pMessageForm);
+ bool DoKey(CFWL_MsgKey* pMsg, IFWL_Widget* pMessageForm);
+ bool DoMouse(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm);
+ bool DoWheel(CFWL_MsgMouseWheel* pMsg, IFWL_Widget* pMessageForm);
+ bool DoSize(CFWL_MsgSize* pMsg);
+ bool DoWindowMove(CFWL_MsgWindowMove* pMsg, IFWL_Widget* pMessageForm);
+ bool DoDragFiles(CFWL_MsgDropFiles* pMsg, IFWL_Widget* pMessageForm);
+ bool DoMouseEx(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm);
void MouseSecondary(CFWL_MsgMouse* pMsg);
- FX_BOOL IsValidMessage(CFWL_Message* pMessage);
+ bool IsValidMessage(CFWL_Message* pMessage);
IFWL_Widget* GetMessageForm(IFWL_Widget* pDstTarget);
- void ClearInvalidEventTargets(FX_BOOL bRemoveAll);
+ void ClearInvalidEventTargets(bool bRemoveAll);
CFX_ArrayTemplate<IFWL_Widget*> m_forms;
CFX_ArrayTemplate<CFWL_Message*> m_noteQueue;
@@ -115,16 +115,16 @@ class CFWL_EventTarget {
int32_t SetEventSource(IFWL_Widget* pSource,
uint32_t dwFilter = FWL_EVENT_ALL_MASK);
- FX_BOOL ProcessEvent(CFWL_Event* pEvent);
- FX_BOOL IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter);
- FX_BOOL IsInvalid() { return m_bInvalid; }
- void FlagInvalid() { m_bInvalid = TRUE; }
+ bool ProcessEvent(CFWL_Event* pEvent);
+ bool IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter);
+ bool IsInvalid() { return m_bInvalid; }
+ void FlagInvalid() { m_bInvalid = true; }
protected:
CFX_MapPtrTemplate<void*, uint32_t> m_eventSources;
IFWL_Widget* m_pListener;
CFWL_NoteDriver* m_pNoteDriver;
- FX_BOOL m_bInvalid;
+ bool m_bInvalid;
};
class CFWL_ToolTipContainer final {
diff --git a/xfa/fwl/core/ifwl_barcode.cpp b/xfa/fwl/core/ifwl_barcode.cpp
index e708e7ed53..9495dd96b5 100644
--- a/xfa/fwl/core/ifwl_barcode.cpp
+++ b/xfa/fwl/core/ifwl_barcode.cpp
@@ -135,7 +135,7 @@ void IFWL_Barcode::GenerateBarcodeImageCache() {
m_pBarcodeEngine->SetTruncated(pData->GetTruncated());
}
int32_t errorCode = 0;
- m_dwStatus = m_pBarcodeEngine->Encode(wsText.AsStringC(), TRUE, errorCode)
+ m_dwStatus = m_pBarcodeEngine->Encode(wsText.AsStringC(), true, errorCode)
? XFA_BCS_EncodeSuccess
: 0;
}
@@ -162,16 +162,16 @@ FWL_Error IFWL_Barcode::SetText(const CFX_WideString& wsText) {
m_dwStatus = XFA_BCS_NeedUpdate;
return IFWL_Edit::SetText(wsText);
}
-FX_BOOL IFWL_Barcode::IsProtectedType() {
+bool IFWL_Barcode::IsProtectedType() {
if (!m_pBarcodeEngine) {
- return TRUE;
+ return true;
}
BC_TYPE tEngineType = m_pBarcodeEngine->GetType();
if (tEngineType == BC_QR_CODE || tEngineType == BC_PDF417 ||
tEngineType == BC_DATAMATRIX) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void IFWL_Barcode::OnProcessEvent(CFWL_Event* pEvent) {
diff --git a/xfa/fwl/core/ifwl_barcode.h b/xfa/fwl/core/ifwl_barcode.h
index 33cb442e50..36befa469b 100644
--- a/xfa/fwl/core/ifwl_barcode.h
+++ b/xfa/fwl/core/ifwl_barcode.h
@@ -43,15 +43,15 @@ class IFWL_BarcodeDP : public IFWL_EditDP {
virtual int32_t GetModuleHeight() const = 0;
virtual int32_t GetModuleWidth() const = 0;
virtual int32_t GetDataLength() const = 0;
- virtual FX_BOOL GetCalChecksum() const = 0;
- virtual FX_BOOL GetPrintChecksum() const = 0;
+ virtual bool GetCalChecksum() const = 0;
+ virtual bool GetPrintChecksum() const = 0;
virtual BC_TEXT_LOC GetTextLocation() const = 0;
virtual int32_t GetWideNarrowRatio() const = 0;
virtual FX_CHAR GetStartChar() const = 0;
virtual FX_CHAR GetEndChar() const = 0;
virtual int32_t GetVersion() const = 0;
virtual int32_t GetErrorCorrectionLevel() const = 0;
- virtual FX_BOOL GetTruncated() const = 0;
+ virtual bool GetTruncated() const = 0;
virtual uint32_t GetBarcodeAttributeMask() const = 0;
};
@@ -70,7 +70,7 @@ class IFWL_Barcode : public IFWL_Edit {
void OnProcessEvent(CFWL_Event* pEvent) override;
void SetType(BC_TYPE type);
- FX_BOOL IsProtectedType();
+ bool IsProtectedType();
protected:
void GenerateBarcodeImageCache();
diff --git a/xfa/fwl/core/ifwl_caret.cpp b/xfa/fwl/core/ifwl_caret.cpp
index 94b56e8cf9..4e9b7f64b5 100644
--- a/xfa/fwl/core/ifwl_caret.cpp
+++ b/xfa/fwl/core/ifwl_caret.cpp
@@ -20,7 +20,7 @@ IFWL_Caret::IFWL_Caret(const IFWL_App* app,
m_pTimer(new IFWL_Caret::Timer(this)),
m_pTimerInfo(nullptr),
m_dwElapse(400),
- m_bSetColor(FALSE) {
+ m_bSetColor(false) {
SetStates(FWL_STATE_CAT_HightLight);
}
@@ -48,7 +48,7 @@ FWL_Error IFWL_Caret::DrawWidget(CFX_Graphics* pGraphics,
return FWL_Error::Succeeded;
}
-void IFWL_Caret::ShowCaret(FX_BOOL bFlag) {
+void IFWL_Caret::ShowCaret(bool bFlag) {
if (m_pTimerInfo) {
m_pTimerInfo->StopTimer();
m_pTimerInfo = nullptr;
@@ -70,7 +70,7 @@ FWL_Error IFWL_Caret::SetFrequency(uint32_t elapse) {
}
FWL_Error IFWL_Caret::SetColor(CFX_Color crFill) {
- m_bSetColor = TRUE;
+ m_bSetColor = true;
m_crFill = crFill;
return FWL_Error::Succeeded;
}
diff --git a/xfa/fwl/core/ifwl_caret.h b/xfa/fwl/core/ifwl_caret.h
index 888e8ffbed..7d91d5760f 100644
--- a/xfa/fwl/core/ifwl_caret.h
+++ b/xfa/fwl/core/ifwl_caret.h
@@ -33,7 +33,7 @@ class IFWL_Caret : public IFWL_Widget {
void OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) override;
- void ShowCaret(FX_BOOL bFlag = TRUE);
+ void ShowCaret(bool bFlag = true);
FWL_Error GetFrequency(uint32_t& elapse);
FWL_Error SetFrequency(uint32_t elapse);
FWL_Error SetColor(CFX_Color crFill);
@@ -56,7 +56,7 @@ class IFWL_Caret : public IFWL_Widget {
IFWL_TimerInfo* m_pTimerInfo; // not owned.
uint32_t m_dwElapse;
CFX_Color m_crFill;
- FX_BOOL m_bSetColor;
+ bool m_bSetColor;
};
#endif // XFA_FWL_CORE_IFWL_CARET_H_
diff --git a/xfa/fwl/core/ifwl_checkbox.cpp b/xfa/fwl/core/ifwl_checkbox.cpp
index b4e6fd4ce1..f03b864717 100644
--- a/xfa/fwl/core/ifwl_checkbox.cpp
+++ b/xfa/fwl/core/ifwl_checkbox.cpp
@@ -30,7 +30,7 @@ IFWL_CheckBox::IFWL_CheckBox(const IFWL_App* app,
: IFWL_Widget(app, properties, nullptr),
m_dwTTOStyles(FDE_TTOSTYLE_SingleLine),
m_iTTOAlign(FDE_TTOALIGNMENT_Center),
- m_bBtnDown(FALSE) {
+ m_bBtnDown(false) {
m_rtClient.Reset();
m_rtBox.Reset();
m_rtCaption.Reset();
@@ -43,7 +43,7 @@ FWL_Type IFWL_CheckBox::GetClassID() const {
return FWL_Type::CheckBox;
}
-FWL_Error IFWL_CheckBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error IFWL_CheckBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
rect.Set(0, 0, 0, 0);
if (!m_pProperties->m_pThemeProvider)
@@ -68,7 +68,7 @@ FWL_Error IFWL_CheckBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
if (rect.height < fCheckBox) {
rect.height = fCheckBox;
}
- IFWL_Widget::GetWidgetRect(rect, TRUE);
+ IFWL_Widget::GetWidgetRect(rect, true);
} else {
rect = m_pProperties->m_rtWidget;
}
@@ -399,10 +399,10 @@ void IFWL_CheckBox::OnProcessMessage(CFWL_Message* pMessage) {
OnActivate(pMessage);
break;
case CFWL_MessageType::SetFocus:
- OnFocusChanged(pMessage, TRUE);
+ OnFocusChanged(pMessage, true);
break;
case CFWL_MessageType::KillFocus:
- OnFocusChanged(pMessage, FALSE);
+ OnFocusChanged(pMessage, false);
break;
case CFWL_MessageType::Mouse: {
CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
@@ -447,7 +447,7 @@ void IFWL_CheckBox::OnActivate(CFWL_Message* pMsg) {
Repaint(&(m_rtClient));
}
-void IFWL_CheckBox::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
+void IFWL_CheckBox::OnFocusChanged(CFWL_Message* pMsg, bool bSet) {
if (bSet)
m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
else
@@ -460,9 +460,9 @@ void IFWL_CheckBox::OnLButtonDown(CFWL_MsgMouse* pMsg) {
if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)
return;
if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0)
- SetFocus(TRUE);
+ SetFocus(true);
- m_bBtnDown = TRUE;
+ m_bBtnDown = true;
m_pProperties->m_dwStates &= ~FWL_STATE_CKB_Hovered;
m_pProperties->m_dwStates |= FWL_STATE_CKB_Pressed;
Repaint(&(m_rtClient));
@@ -472,7 +472,7 @@ void IFWL_CheckBox::OnLButtonUp(CFWL_MsgMouse* pMsg) {
if (!m_bBtnDown)
return;
- m_bBtnDown = FALSE;
+ m_bBtnDown = false;
if (!m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy))
return;
@@ -485,31 +485,31 @@ void IFWL_CheckBox::OnMouseMove(CFWL_MsgMouse* pMsg) {
if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)
return;
- FX_BOOL bRepaint = FALSE;
+ bool bRepaint = false;
if (m_bBtnDown) {
if (m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) {
if ((m_pProperties->m_dwStates & FWL_STATE_CKB_Pressed) == 0) {
- bRepaint = TRUE;
+ bRepaint = true;
m_pProperties->m_dwStates |= FWL_STATE_CKB_Pressed;
}
if ((m_pProperties->m_dwStates & FWL_STATE_CKB_Hovered)) {
- bRepaint = TRUE;
+ bRepaint = true;
m_pProperties->m_dwStates &= ~FWL_STATE_CKB_Hovered;
}
} else {
if (m_pProperties->m_dwStates & FWL_STATE_CKB_Pressed) {
- bRepaint = TRUE;
+ bRepaint = true;
m_pProperties->m_dwStates &= ~FWL_STATE_CKB_Pressed;
}
if ((m_pProperties->m_dwStates & FWL_STATE_CKB_Hovered) == 0) {
- bRepaint = TRUE;
+ bRepaint = true;
m_pProperties->m_dwStates |= FWL_STATE_CKB_Hovered;
}
}
} else {
if (m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) {
if ((m_pProperties->m_dwStates & FWL_STATE_CKB_Hovered) == 0) {
- bRepaint = TRUE;
+ bRepaint = true;
m_pProperties->m_dwStates |= FWL_STATE_CKB_Hovered;
}
}
diff --git a/xfa/fwl/core/ifwl_checkbox.h b/xfa/fwl/core/ifwl_checkbox.h
index 6222e4be79..c08d845d29 100644
--- a/xfa/fwl/core/ifwl_checkbox.h
+++ b/xfa/fwl/core/ifwl_checkbox.h
@@ -62,7 +62,7 @@ class IFWL_CheckBox : public IFWL_Widget {
// IFWL_Widget
FWL_Type GetClassID() const override;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
FWL_Error Update() override;
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr) override;
@@ -86,11 +86,11 @@ class IFWL_CheckBox : public IFWL_Widget {
CFX_RectF m_rtFocus;
uint32_t m_dwTTOStyles;
int32_t m_iTTOAlign;
- FX_BOOL m_bBtnDown;
+ bool m_bBtnDown;
private:
void OnActivate(CFWL_Message* pMsg);
- void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet);
+ void OnFocusChanged(CFWL_Message* pMsg, bool bSet);
void OnLButtonDown(CFWL_MsgMouse* pMsg);
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnMouseMove(CFWL_MsgMouse* pMsg);
diff --git a/xfa/fwl/core/ifwl_combobox.cpp b/xfa/fwl/core/ifwl_combobox.cpp
index 1721aee2a7..4be684abb9 100644
--- a/xfa/fwl/core/ifwl_combobox.cpp
+++ b/xfa/fwl/core/ifwl_combobox.cpp
@@ -26,11 +26,11 @@ IFWL_ComboBox::IFWL_ComboBox(const IFWL_App* app,
const CFWL_WidgetImpProperties& properties)
: IFWL_Widget(app, properties, nullptr),
m_pComboBoxProxy(nullptr),
- m_bLButtonDown(FALSE),
+ m_bLButtonDown(false),
m_iCurSel(-1),
m_iBtnState(CFWL_PartState_Normal),
m_fComboFormHandler(0),
- m_bNeedShowList(FALSE) {
+ m_bNeedShowList(false) {
m_rtClient.Reset();
m_rtBtn.Reset();
m_rtHandler.Reset();
@@ -66,12 +66,12 @@ FWL_Type IFWL_ComboBox::GetClassID() const {
return FWL_Type::ComboBox;
}
-FWL_Error IFWL_ComboBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error IFWL_ComboBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
rect.Reset();
- FX_BOOL bIsDropDown = IsDropDownStyle();
+ bool bIsDropDown = IsDropDownStyle();
if (bIsDropDown && m_pEdit) {
- m_pEdit->GetWidgetRect(rect, TRUE);
+ m_pEdit->GetWidgetRect(rect, true);
} else {
rect.width = 100;
rect.height = 16;
@@ -84,7 +84,7 @@ FWL_Error IFWL_ComboBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
if (!pFWidth)
return FWL_Error::Indefinite;
rect.Inflate(0, 0, *pFWidth, 0);
- IFWL_Widget::GetWidgetRect(rect, TRUE);
+ IFWL_Widget::GetWidgetRect(rect, true);
} else {
rect = m_pProperties->m_rtWidget;
}
@@ -104,7 +104,7 @@ FWL_Error IFWL_ComboBox::ModifyStylesEx(uint32_t dwStylesExAdded,
m_pEdit->SetOuter(this);
m_pEdit->SetParent(this);
} else if (bRemoveDropDown && m_pEdit) {
- m_pEdit->SetStates(FWL_WGTSTATE_Invisible, TRUE);
+ m_pEdit->SetStates(FWL_WGTSTATE_Invisible, true);
}
return IFWL_Widget::ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
}
@@ -117,7 +117,7 @@ FWL_Error IFWL_ComboBox::Update() {
return FWL_Error::Indefinite;
}
ReSetTheme();
- FX_BOOL bDropDown = IsDropDownStyle();
+ bool bDropDown = IsDropDownStyle();
if (bDropDown && m_pEdit) {
ReSetEditAlignment();
}
@@ -150,7 +150,7 @@ FWL_Error IFWL_ComboBox::DrawWidget(CFX_Graphics* pGraphics,
if (!m_pProperties->m_pThemeProvider)
return FWL_Error::Indefinite;
IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
- FX_BOOL bIsDropDown = IsDropDownStyle();
+ bool bIsDropDown = IsDropDownStyle();
if (HasBorder()) {
DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix);
}
@@ -242,8 +242,8 @@ int32_t IFWL_ComboBox::GetCurSel() {
FWL_Error IFWL_ComboBox::SetCurSel(int32_t iSel) {
int32_t iCount = m_pListBox->CountItems();
- FX_BOOL bClearSel = iSel < 0 || iSel >= iCount;
- FX_BOOL bDropDown = IsDropDownStyle();
+ bool bClearSel = iSel < 0 || iSel >= iCount;
+ bool bDropDown = IsDropDownStyle();
if (bDropDown && m_pEdit) {
if (bClearSel) {
m_pEdit->SetText(CFX_WideString());
@@ -261,8 +261,8 @@ FWL_Error IFWL_ComboBox::SetCurSel(int32_t iSel) {
return FWL_Error::Succeeded;
}
-void IFWL_ComboBox::SetStates(uint32_t dwStates, FX_BOOL bSet) {
- FX_BOOL bIsDropDown = IsDropDownStyle();
+void IFWL_ComboBox::SetStates(uint32_t dwStates, bool bSet) {
+ bool bIsDropDown = IsDropDownStyle();
if (bIsDropDown && m_pEdit)
m_pEdit->SetStates(dwStates, bSet);
if (m_pListBox)
@@ -329,11 +329,11 @@ FWL_Error IFWL_ComboBox::EditDoClipboard(int32_t iCmd) {
return m_pEdit->DoClipboard(iCmd);
}
-FX_BOOL IFWL_ComboBox::EditRedo(const IFDE_TxtEdtDoRecord* pRecord) {
+bool IFWL_ComboBox::EditRedo(const IFDE_TxtEdtDoRecord* pRecord) {
return m_pEdit && m_pEdit->Redo(pRecord);
}
-FX_BOOL IFWL_ComboBox::EditUndo(const IFDE_TxtEdtDoRecord* pRecord) {
+bool IFWL_ComboBox::EditUndo(const IFDE_TxtEdtDoRecord* pRecord) {
return m_pEdit && m_pEdit->Undo(pRecord);
}
@@ -341,75 +341,75 @@ IFWL_ListBox* IFWL_ComboBox::GetListBoxt() {
return m_pListBox.get();
}
-FX_BOOL IFWL_ComboBox::AfterFocusShowDropList() {
+bool IFWL_ComboBox::AfterFocusShowDropList() {
if (!m_bNeedShowList) {
- return FALSE;
+ return false;
}
if (m_pEdit) {
MatchEditText();
}
- ShowDropList(TRUE);
- m_bNeedShowList = FALSE;
- return TRUE;
+ ShowDropList(true);
+ m_bNeedShowList = false;
+ return true;
}
-FWL_Error IFWL_ComboBox::OpenDropDownList(FX_BOOL bActivate) {
+FWL_Error IFWL_ComboBox::OpenDropDownList(bool bActivate) {
ShowDropList(bActivate);
return FWL_Error::Succeeded;
}
-FX_BOOL IFWL_ComboBox::EditCanUndo() {
+bool IFWL_ComboBox::EditCanUndo() {
return m_pEdit->CanUndo();
}
-FX_BOOL IFWL_ComboBox::EditCanRedo() {
+bool IFWL_ComboBox::EditCanRedo() {
return m_pEdit->CanRedo();
}
-FX_BOOL IFWL_ComboBox::EditUndo() {
+bool IFWL_ComboBox::EditUndo() {
return m_pEdit->Undo();
}
-FX_BOOL IFWL_ComboBox::EditRedo() {
+bool IFWL_ComboBox::EditRedo() {
return m_pEdit->Redo();
}
-FX_BOOL IFWL_ComboBox::EditCanCopy() {
+bool IFWL_ComboBox::EditCanCopy() {
return m_pEdit->CountSelRanges() > 0;
}
-FX_BOOL IFWL_ComboBox::EditCanCut() {
+bool IFWL_ComboBox::EditCanCut() {
if (m_pEdit->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly) {
- return FALSE;
+ return false;
}
return m_pEdit->CountSelRanges() > 0;
}
-FX_BOOL IFWL_ComboBox::EditCanSelectAll() {
+bool IFWL_ComboBox::EditCanSelectAll() {
return m_pEdit->GetTextLength() > 0;
}
-FX_BOOL IFWL_ComboBox::EditCopy(CFX_WideString& wsCopy) {
+bool IFWL_ComboBox::EditCopy(CFX_WideString& wsCopy) {
return m_pEdit->Copy(wsCopy);
}
-FX_BOOL IFWL_ComboBox::EditCut(CFX_WideString& wsCut) {
+bool IFWL_ComboBox::EditCut(CFX_WideString& wsCut) {
return m_pEdit->Cut(wsCut);
}
-FX_BOOL IFWL_ComboBox::EditPaste(const CFX_WideString& wsPaste) {
+bool IFWL_ComboBox::EditPaste(const CFX_WideString& wsPaste) {
return m_pEdit->Paste(wsPaste);
}
-FX_BOOL IFWL_ComboBox::EditSelectAll() {
+bool IFWL_ComboBox::EditSelectAll() {
return m_pEdit->AddSelRange(0) == FWL_Error::Succeeded;
}
-FX_BOOL IFWL_ComboBox::EditDelete() {
+bool IFWL_ComboBox::EditDelete() {
return m_pEdit->ClearText() == FWL_Error::Succeeded;
}
-FX_BOOL IFWL_ComboBox::EditDeSelect() {
+bool IFWL_ComboBox::EditDeSelect() {
return m_pEdit->ClearSelections() == FWL_Error::Succeeded;
}
@@ -453,11 +453,11 @@ void IFWL_ComboBox::DrawStretchHandler(CFX_Graphics* pGraphics,
m_pProperties->m_pThemeProvider->DrawBackground(&param);
}
-void IFWL_ComboBox::ShowDropList(FX_BOOL bActivate) {
+void IFWL_ComboBox::ShowDropList(bool bActivate) {
if (m_pWidgetMgr->IsFormDisabled())
return DisForm_ShowDropList(bActivate);
- FX_BOOL bDropList = IsDropListShowed();
+ bool bDropList = IsDropListShowed();
if (bDropList == bActivate)
return;
if (!m_pComboBoxProxy)
@@ -470,7 +470,7 @@ void IFWL_ComboBox::ShowDropList(FX_BOOL bActivate) {
uint32_t dwStyleAdd = m_pProperties->m_dwStyleExes &
(FWL_STYLEEXT_CMB_Sort | FWL_STYLEEXT_CMB_OwnerDraw);
m_pListBox->ModifyStylesEx(dwStyleAdd, 0);
- m_pListBox->GetWidgetRect(m_rtList, TRUE);
+ m_pListBox->GetWidgetRect(m_rtList, true);
FX_FLOAT fHeight = GetListHeight();
if (fHeight > 0) {
if (m_rtList.height > GetListHeight()) {
@@ -511,26 +511,26 @@ void IFWL_ComboBox::ShowDropList(FX_BOOL bActivate) {
ev.m_pSrcTarget = this;
DispatchEvent(&ev);
m_fItemHeight = m_pListBox->m_fItemHeight;
- m_pListBox->SetFocus(TRUE);
+ m_pListBox->SetFocus(true);
m_pComboBoxProxy->DoModal();
- m_pListBox->SetFocus(FALSE);
+ m_pListBox->SetFocus(false);
} else {
m_pComboBoxProxy->EndDoModal();
CFWL_EvtCmbCloseUp ev;
ev.m_pSrcTarget = this;
DispatchEvent(&ev);
- m_bLButtonDown = FALSE;
- m_pListBox->m_bNotifyOwner = TRUE;
- SetFocus(TRUE);
+ m_bLButtonDown = false;
+ m_pListBox->m_bNotifyOwner = true;
+ SetFocus(true);
}
}
-FX_BOOL IFWL_ComboBox::IsDropListShowed() {
+bool IFWL_ComboBox::IsDropListShowed() {
return m_pComboBoxProxy &&
!(m_pComboBoxProxy->GetStates() & FWL_WGTSTATE_Invisible);
}
-FX_BOOL IFWL_ComboBox::IsDropDownStyle() const {
+bool IFWL_ComboBox::IsDropDownStyle() const {
return m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_DropDown;
}
@@ -572,7 +572,7 @@ void IFWL_ComboBox::Layout() {
FX_FLOAT fBtn = *pFWidth;
m_rtBtn.Set(m_rtClient.right() - fBtn, m_rtClient.top, fBtn,
m_rtClient.height);
- FX_BOOL bIsDropDown = IsDropDownStyle();
+ bool bIsDropDown = IsDropDownStyle();
if (bIsDropDown && m_pEdit) {
CFX_RectF rtEdit;
rtEdit.Set(m_rtClient.left, m_rtClient.top, m_rtClient.width - fBtn,
@@ -659,11 +659,11 @@ void IFWL_ComboBox::ReSetListItemAlignment() {
m_pListBox->ModifyStylesEx(dwAdd, FWL_STYLEEXT_CMB_ListItemAlignMask);
}
-void IFWL_ComboBox::ProcessSelChanged(FX_BOOL bLButtonUp) {
+void IFWL_ComboBox::ProcessSelChanged(bool bLButtonUp) {
IFWL_ComboBoxDP* pDatas =
static_cast<IFWL_ComboBoxDP*>(m_pProperties->m_pDataProvider);
m_iCurSel = pDatas->GetItemIndex(this, m_pListBox->GetSelItem(0));
- FX_BOOL bDropDown = IsDropDownStyle();
+ bool bDropDown = IsDropDownStyle();
if (bDropDown) {
IFWL_ComboBoxDP* pData =
static_cast<IFWL_ComboBoxDP*>(m_pProperties->m_pDataProvider);
@@ -727,8 +727,8 @@ void IFWL_ComboBox::DisForm_InitComboEdit() {
m_pEdit->SetOuter(this);
}
-void IFWL_ComboBox::DisForm_ShowDropList(FX_BOOL bActivate) {
- FX_BOOL bDropList = DisForm_IsDropListShowed();
+void IFWL_ComboBox::DisForm_ShowDropList(bool bActivate) {
+ bool bDropList = DisForm_IsDropListShowed();
if (bDropList == bActivate) {
return;
}
@@ -759,7 +759,7 @@ void IFWL_ComboBox::DisForm_ShowDropList(FX_BOOL bActivate) {
m_pListBox->SetWidgetRect(rtList);
m_pListBox->Update();
} else {
- SetFocus(TRUE);
+ SetFocus(true);
}
m_pListBox->SetStates(FWL_WGTSTATE_Invisible, !bActivate);
if (bActivate) {
@@ -773,7 +773,7 @@ void IFWL_ComboBox::DisForm_ShowDropList(FX_BOOL bActivate) {
Repaint(&rect);
}
-FX_BOOL IFWL_ComboBox::DisForm_IsDropListShowed() {
+bool IFWL_ComboBox::DisForm_IsDropListShowed() {
return !(m_pListBox->GetStates() & FWL_WGTSTATE_Invisible);
}
@@ -830,7 +830,7 @@ FWL_Error IFWL_ComboBox::DisForm_DrawWidget(CFX_Graphics* pGraphics,
if (pMatrix) {
mtOrg = *pMatrix;
}
- FX_BOOL bListShowed = m_pListBox && DisForm_IsDropListShowed();
+ bool bListShowed = m_pListBox && DisForm_IsDropListShowed();
pGraphics->SaveGraphState();
pGraphics->ConcatMatrix(&mtOrg);
if (!m_rtBtn.IsEmpty(0.1f)) {
@@ -892,7 +892,7 @@ void IFWL_ComboBox::DisForm_Layout() {
m_rtContent.Deflate(pUIMargin->left, pUIMargin->top, pUIMargin->width,
pUIMargin->height);
}
- FX_BOOL bIsDropDown = IsDropDownStyle();
+ bool bIsDropDown = IsDropDownStyle();
if (bIsDropDown && m_pEdit) {
CFX_RectF rtEdit;
rtEdit.Set(m_rtContent.left, m_rtContent.top, m_rtContent.width - fBtn,
@@ -922,10 +922,10 @@ void IFWL_ComboBox::OnProcessMessage(CFWL_Message* pMessage) {
switch (pMessage->GetClassID()) {
case CFWL_MessageType::SetFocus:
- OnFocusChanged(pMessage, TRUE);
+ OnFocusChanged(pMessage, true);
break;
case CFWL_MessageType::KillFocus:
- OnFocusChanged(pMessage, FALSE);
+ OnFocusChanged(pMessage, false);
break;
case CFWL_MessageType::Mouse: {
CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
@@ -992,10 +992,10 @@ void IFWL_ComboBox::OnDrawWidget(CFX_Graphics* pGraphics,
DrawWidget(pGraphics, pMatrix);
}
-void IFWL_ComboBox::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
+void IFWL_ComboBox::OnFocusChanged(CFWL_Message* pMsg, bool bSet) {
IFWL_Widget* pDstTarget = pMsg->m_pDstTarget;
IFWL_Widget* pSrcTarget = pMsg->m_pSrcTarget;
- FX_BOOL bDropDown = IsDropDownStyle();
+ bool bDropDown = IsDropDownStyle();
if (bSet) {
m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
if (bDropDown && pSrcTarget != m_pListBox.get()) {
@@ -1010,7 +1010,7 @@ void IFWL_ComboBox::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
if (bDropDown && pDstTarget != m_pListBox.get()) {
if (!m_pEdit)
return;
- m_pEdit->FlagFocus(FALSE);
+ m_pEdit->FlagFocus(false);
m_pEdit->ClearSelected();
} else {
Repaint(&m_rtClient);
@@ -1022,25 +1022,25 @@ void IFWL_ComboBox::OnLButtonDown(CFWL_MsgMouse* pMsg) {
if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)
return;
- FX_BOOL bDropDown = IsDropDownStyle();
+ bool bDropDown = IsDropDownStyle();
CFX_RectF& rtBtn = bDropDown ? m_rtBtn : m_rtClient;
- FX_BOOL bClickBtn = rtBtn.Contains(pMsg->m_fx, pMsg->m_fy);
+ bool bClickBtn = rtBtn.Contains(pMsg->m_fx, pMsg->m_fy);
if (!bClickBtn)
return;
if (bDropDown && m_pEdit)
MatchEditText();
- m_bLButtonDown = TRUE;
+ m_bLButtonDown = true;
m_iBtnState = CFWL_PartState_Pressed;
Repaint(&m_rtClient);
- ShowDropList(TRUE);
+ ShowDropList(true);
m_iBtnState = CFWL_PartState_Normal;
Repaint(&m_rtClient);
}
void IFWL_ComboBox::OnLButtonUp(CFWL_MsgMouse* pMsg) {
- m_bLButtonDown = FALSE;
+ m_bLButtonDown = false;
if (m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy))
m_iBtnState = CFWL_PartState_Hovered;
else
@@ -1092,9 +1092,9 @@ void IFWL_ComboBox::DoSubCtrlKey(CFWL_MsgKey* pMsg) {
if (iCount < 1)
return;
- FX_BOOL bMatchEqual = FALSE;
+ bool bMatchEqual = false;
int32_t iCurSel = m_iCurSel;
- FX_BOOL bDropDown = IsDropDownStyle();
+ bool bDropDown = IsDropDownStyle();
if (bDropDown && m_pEdit) {
CFX_WideString wsText;
m_pEdit->GetText(wsText);
@@ -1126,7 +1126,7 @@ void IFWL_ComboBox::DoSubCtrlKey(CFWL_MsgKey* pMsg) {
return;
}
- FX_BOOL bDropDown = IsDropDownStyle();
+ bool bDropDown = IsDropDownStyle();
if (bDropDown)
m_pEdit->GetDelegate()->OnProcessMessage(pMsg);
}
@@ -1135,20 +1135,20 @@ void IFWL_ComboBox::DisForm_OnProcessMessage(CFWL_Message* pMessage) {
if (!pMessage)
return;
- FX_BOOL backDefault = TRUE;
+ bool backDefault = true;
switch (pMessage->GetClassID()) {
case CFWL_MessageType::SetFocus: {
- backDefault = FALSE;
- DisForm_OnFocusChanged(pMessage, TRUE);
+ backDefault = false;
+ DisForm_OnFocusChanged(pMessage, true);
break;
}
case CFWL_MessageType::KillFocus: {
- backDefault = FALSE;
- DisForm_OnFocusChanged(pMessage, FALSE);
+ backDefault = false;
+ DisForm_OnFocusChanged(pMessage, false);
break;
}
case CFWL_MessageType::Mouse: {
- backDefault = FALSE;
+ backDefault = false;
CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
switch (pMsg->m_dwCmd) {
case FWL_MouseCommand::LeftButtonDown:
@@ -1163,16 +1163,16 @@ void IFWL_ComboBox::DisForm_OnProcessMessage(CFWL_Message* pMessage) {
break;
}
case CFWL_MessageType::Key: {
- backDefault = FALSE;
+ backDefault = false;
CFWL_MsgKey* pKey = static_cast<CFWL_MsgKey*>(pMessage);
if (pKey->m_dwCmd == FWL_KeyCommand::KeyUp)
break;
if (DisForm_IsDropListShowed() &&
pKey->m_dwCmd == FWL_KeyCommand::KeyDown) {
- FX_BOOL bListKey = pKey->m_dwKeyCode == FWL_VKEY_Up ||
- pKey->m_dwKeyCode == FWL_VKEY_Down ||
- pKey->m_dwKeyCode == FWL_VKEY_Return ||
- pKey->m_dwKeyCode == FWL_VKEY_Escape;
+ bool bListKey = pKey->m_dwKeyCode == FWL_VKEY_Up ||
+ pKey->m_dwKeyCode == FWL_VKEY_Down ||
+ pKey->m_dwKeyCode == FWL_VKEY_Return ||
+ pKey->m_dwKeyCode == FWL_VKEY_Escape;
if (bListKey) {
m_pListBox->GetDelegate()->OnProcessMessage(pMessage);
break;
@@ -1189,21 +1189,21 @@ void IFWL_ComboBox::DisForm_OnProcessMessage(CFWL_Message* pMessage) {
}
void IFWL_ComboBox::DisForm_OnLButtonDown(CFWL_MsgMouse* pMsg) {
- FX_BOOL bDropDown = DisForm_IsDropListShowed();
+ bool bDropDown = DisForm_IsDropListShowed();
CFX_RectF& rtBtn = bDropDown ? m_rtBtn : m_rtClient;
if (!rtBtn.Contains(pMsg->m_fx, pMsg->m_fy))
return;
if (DisForm_IsDropListShowed()) {
- DisForm_ShowDropList(FALSE);
+ DisForm_ShowDropList(false);
return;
}
if (m_pEdit)
MatchEditText();
- DisForm_ShowDropList(TRUE);
+ DisForm_ShowDropList(true);
}
-void IFWL_ComboBox::DisForm_OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
+void IFWL_ComboBox::DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet) {
if (bSet) {
m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
if ((m_pEdit->GetStates() & FWL_WGTSTATE_Focused) == 0) {
@@ -1214,7 +1214,7 @@ void IFWL_ComboBox::DisForm_OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
}
} else {
m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
- DisForm_ShowDropList(FALSE);
+ DisForm_ShowDropList(false);
CFWL_MsgKillFocus msg;
msg.m_pDstTarget = nullptr;
msg.m_pSrcTarget = m_pEdit.get();
@@ -1232,7 +1232,7 @@ void IFWL_ComboBox::DisForm_OnKey(CFWL_MsgKey* pMsg) {
if (iCount < 1)
return;
- FX_BOOL bMatchEqual = FALSE;
+ bool bMatchEqual = false;
int32_t iCurSel = m_iCurSel;
if (m_pEdit) {
CFX_WideString wsText;
diff --git a/xfa/fwl/core/ifwl_combobox.h b/xfa/fwl/core/ifwl_combobox.h
index cde99d8df1..7d11541e7f 100644
--- a/xfa/fwl/core/ifwl_combobox.h
+++ b/xfa/fwl/core/ifwl_combobox.h
@@ -59,7 +59,7 @@ FWL_EVENT_DEF(CFWL_EvtCmbEditChanged,
FWL_EVENT_DEF(CFWL_EvtCmbSelChanged,
CFWL_EventType::SelectChanged,
CFX_Int32Array iArraySels;
- FX_BOOL bLButtonUp;)
+ bool bLButtonUp;)
FWL_EVENT_DEF(CFWL_EvtCmbHoverChanged,
CFWL_EventType::HoverChanged,
@@ -85,10 +85,10 @@ class IFWL_ComboBox : public IFWL_Widget {
// IFWL_Widget
FWL_Type GetClassID() const override;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
FWL_Error ModifyStylesEx(uint32_t dwStylesExAdded,
uint32_t dwStylesExRemoved) override;
- void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE) override;
+ void SetStates(uint32_t dwStates, bool bSet = true) override;
FWL_Error Update() override;
FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override;
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
@@ -111,39 +111,39 @@ class IFWL_ComboBox : public IFWL_Widget {
int32_t GetEditLimit();
FWL_Error SetEditLimit(int32_t nLimit);
FWL_Error EditDoClipboard(int32_t iCmd);
- FX_BOOL EditRedo(const IFDE_TxtEdtDoRecord* pRecord);
- FX_BOOL EditUndo(const IFDE_TxtEdtDoRecord* pRecord);
+ bool EditRedo(const IFDE_TxtEdtDoRecord* pRecord);
+ bool EditUndo(const IFDE_TxtEdtDoRecord* pRecord);
IFWL_ListBox* GetListBoxt();
- FX_BOOL AfterFocusShowDropList();
- FWL_Error OpenDropDownList(FX_BOOL bActivate);
- FX_BOOL EditCanUndo();
- FX_BOOL EditCanRedo();
- FX_BOOL EditUndo();
- FX_BOOL EditRedo();
- FX_BOOL EditCanCopy();
- FX_BOOL EditCanCut();
- FX_BOOL EditCanSelectAll();
- FX_BOOL EditCopy(CFX_WideString& wsCopy);
- FX_BOOL EditCut(CFX_WideString& wsCut);
- FX_BOOL EditPaste(const CFX_WideString& wsPaste);
- FX_BOOL EditSelectAll();
- FX_BOOL EditDelete();
- FX_BOOL EditDeSelect();
+ bool AfterFocusShowDropList();
+ FWL_Error OpenDropDownList(bool bActivate);
+ bool EditCanUndo();
+ bool EditCanRedo();
+ bool EditUndo();
+ bool EditRedo();
+ bool EditCanCopy();
+ bool EditCanCut();
+ bool EditCanSelectAll();
+ bool EditCopy(CFX_WideString& wsCopy);
+ bool EditCut(CFX_WideString& wsCut);
+ bool EditPaste(const CFX_WideString& wsPaste);
+ bool EditSelectAll();
+ bool EditDelete();
+ bool EditDeSelect();
FWL_Error GetBBox(CFX_RectF& rect);
FWL_Error EditModifyStylesEx(uint32_t dwStylesExAdded,
uint32_t dwStylesExRemoved);
void DrawStretchHandler(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix);
- FX_BOOL IsDropListShowed();
- void ShowDropList(FX_BOOL bActivate);
+ bool IsDropListShowed();
+ void ShowDropList(bool bActivate);
IFWL_ComboEdit* GetComboEdit() const { return m_pEdit.get(); }
- void ProcessSelChanged(FX_BOOL bLButtonUp);
+ void ProcessSelChanged(bool bLButtonUp);
int32_t GetCurrentSelection() const { return m_iCurSel; }
protected:
FX_FLOAT GetListHeight();
- FX_BOOL IsDropDownStyle() const;
+ bool IsDropDownStyle() const;
void MatchEditText();
void SynchrEditText(int32_t iListItem);
void Layout();
@@ -153,8 +153,8 @@ class IFWL_ComboBox : public IFWL_Widget {
void InitProxyForm();
void DisForm_InitComboList();
void DisForm_InitComboEdit();
- void DisForm_ShowDropList(FX_BOOL bActivate);
- FX_BOOL DisForm_IsDropListShowed();
+ void DisForm_ShowDropList(bool bActivate);
+ bool DisForm_IsDropListShowed();
FWL_Error DisForm_ModifyStylesEx(uint32_t dwStylesExAdded,
uint32_t dwStylesExRemoved);
FWL_Error DisForm_Update();
@@ -173,16 +173,16 @@ class IFWL_ComboBox : public IFWL_Widget {
std::unique_ptr<IFWL_ComboEdit> m_pEdit;
std::unique_ptr<IFWL_ComboList> m_pListBox;
IFWL_ComboBoxProxy* m_pComboBoxProxy;
- FX_BOOL m_bLButtonDown;
- FX_BOOL m_bUpFormHandler;
+ bool m_bLButtonDown;
+ bool m_bUpFormHandler;
int32_t m_iCurSel;
int32_t m_iBtnState;
FX_FLOAT m_fComboFormHandler;
FX_FLOAT m_fItemHeight;
- FX_BOOL m_bNeedShowList;
+ bool m_bNeedShowList;
private:
- void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE);
+ void OnFocusChanged(CFWL_Message* pMsg, bool bSet = true);
void OnLButtonDown(CFWL_MsgMouse* pMsg);
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnMouseMove(CFWL_MsgMouse* pMsg);
@@ -191,7 +191,7 @@ class IFWL_ComboBox : public IFWL_Widget {
void DoSubCtrlKey(CFWL_MsgKey* pMsg);
void DisForm_OnProcessMessage(CFWL_Message* pMessage);
void DisForm_OnLButtonDown(CFWL_MsgMouse* pMsg);
- void DisForm_OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE);
+ void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet = true);
void DisForm_OnKey(CFWL_MsgKey* pMsg);
};
diff --git a/xfa/fwl/core/ifwl_comboboxproxy.cpp b/xfa/fwl/core/ifwl_comboboxproxy.cpp
index a0afcd1d72..0675a3b9ec 100644
--- a/xfa/fwl/core/ifwl_comboboxproxy.cpp
+++ b/xfa/fwl/core/ifwl_comboboxproxy.cpp
@@ -16,8 +16,8 @@ IFWL_ComboBoxProxy::IFWL_ComboBoxProxy(
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
: IFWL_FormProxy(app, properties, pOuter),
- m_bLButtonDown(FALSE),
- m_bLButtonUpSelf(FALSE),
+ m_bLButtonDown(false),
+ m_bLButtonUpSelf(false),
m_pComboBox(pComboBox) {}
IFWL_ComboBoxProxy::~IFWL_ComboBoxProxy() {}
@@ -47,10 +47,10 @@ void IFWL_ComboBoxProxy::OnProcessMessage(CFWL_Message* pMessage) {
OnDeactive(static_cast<CFWL_MsgDeactivate*>(pMessage));
break;
case CFWL_MessageType::KillFocus:
- OnFocusChanged(static_cast<CFWL_MsgKillFocus*>(pMessage), FALSE);
+ OnFocusChanged(static_cast<CFWL_MsgKillFocus*>(pMessage), false);
break;
case CFWL_MessageType::SetFocus:
- OnFocusChanged(static_cast<CFWL_MsgKillFocus*>(pMessage), TRUE);
+ OnFocusChanged(static_cast<CFWL_MsgKillFocus*>(pMessage), true);
break;
default:
break;
@@ -74,45 +74,45 @@ void IFWL_ComboBoxProxy::OnLButtonDown(CFWL_MsgMouse* pMsg) {
GetWidgetRect(rtWidget);
rtWidget.left = rtWidget.top = 0;
if (rtWidget.Contains(pMsg->m_fx, pMsg->m_fy)) {
- m_bLButtonDown = TRUE;
- pDriver->SetGrab(this, TRUE);
+ m_bLButtonDown = true;
+ pDriver->SetGrab(this, true);
} else {
- m_bLButtonDown = FALSE;
- pDriver->SetGrab(this, FALSE);
- m_pComboBox->ShowDropList(FALSE);
+ m_bLButtonDown = false;
+ pDriver->SetGrab(this, false);
+ m_pComboBox->ShowDropList(false);
}
}
void IFWL_ComboBoxProxy::OnLButtonUp(CFWL_MsgMouse* pMsg) {
- m_bLButtonDown = FALSE;
+ m_bLButtonDown = false;
const IFWL_App* pApp = GetOwnerApp();
if (!pApp)
return;
CFWL_NoteDriver* pDriver =
static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver());
- pDriver->SetGrab(this, FALSE);
+ pDriver->SetGrab(this, false);
if (m_bLButtonUpSelf) {
CFX_RectF rect;
GetWidgetRect(rect);
rect.left = rect.top = 0;
if (!rect.Contains(pMsg->m_fx, pMsg->m_fy) &&
m_pComboBox->IsDropListShowed()) {
- m_pComboBox->ShowDropList(FALSE);
+ m_pComboBox->ShowDropList(false);
}
} else {
- m_bLButtonUpSelf = TRUE;
+ m_bLButtonUpSelf = true;
}
}
void IFWL_ComboBoxProxy::OnDeactive(CFWL_MsgDeactivate* pMsg) {
- m_pComboBox->ShowDropList(FALSE);
+ m_pComboBox->ShowDropList(false);
}
-void IFWL_ComboBoxProxy::OnFocusChanged(CFWL_MsgKillFocus* pMsg, FX_BOOL bSet) {
+void IFWL_ComboBoxProxy::OnFocusChanged(CFWL_MsgKillFocus* pMsg, bool bSet) {
if (bSet)
return;
if (!pMsg->m_pSetFocus)
- m_pComboBox->ShowDropList(FALSE);
+ m_pComboBox->ShowDropList(false);
}
diff --git a/xfa/fwl/core/ifwl_comboboxproxy.h b/xfa/fwl/core/ifwl_comboboxproxy.h
index 1cf7a06ccb..7b5c929d36 100644
--- a/xfa/fwl/core/ifwl_comboboxproxy.h
+++ b/xfa/fwl/core/ifwl_comboboxproxy.h
@@ -24,16 +24,16 @@ class IFWL_ComboBoxProxy : public IFWL_FormProxy {
void OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) override;
- void Reset() { m_bLButtonUpSelf = FALSE; }
+ void Reset() { m_bLButtonUpSelf = false; }
private:
void OnLButtonDown(CFWL_MsgMouse* pMsg);
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnDeactive(CFWL_MsgDeactivate* pMsg);
- void OnFocusChanged(CFWL_MsgKillFocus* pMsg, FX_BOOL bSet);
+ void OnFocusChanged(CFWL_MsgKillFocus* pMsg, bool bSet);
- FX_BOOL m_bLButtonDown;
- FX_BOOL m_bLButtonUpSelf;
+ bool m_bLButtonDown;
+ bool m_bLButtonUpSelf;
IFWL_ComboBox* m_pComboBox;
};
diff --git a/xfa/fwl/core/ifwl_comboedit.cpp b/xfa/fwl/core/ifwl_comboedit.cpp
index ece35417ef..26106e14cf 100644
--- a/xfa/fwl/core/ifwl_comboedit.cpp
+++ b/xfa/fwl/core/ifwl_comboedit.cpp
@@ -22,7 +22,7 @@ void IFWL_ComboEdit::ClearSelected() {
}
void IFWL_ComboEdit::SetSelected() {
- FlagFocus(TRUE);
+ FlagFocus(true);
EndCaret();
AddSelRange(0);
}
@@ -31,16 +31,16 @@ void IFWL_ComboEdit::EndCaret() {
m_pEdtEngine->MoveCaretPos(MC_End);
}
-void IFWL_ComboEdit::FlagFocus(FX_BOOL bSet) {
+void IFWL_ComboEdit::FlagFocus(bool bSet) {
if (bSet) {
m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
} else {
m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
- ShowCaret(FALSE);
+ ShowCaret(false);
}
}
-void IFWL_ComboEdit::SetComboBoxFocus(FX_BOOL bSet) {
+void IFWL_ComboEdit::SetComboBoxFocus(bool bSet) {
m_pOuter->SetFocus(bSet);
}
@@ -48,16 +48,16 @@ void IFWL_ComboEdit::OnProcessMessage(CFWL_Message* pMessage) {
if (!pMessage)
return;
- FX_BOOL backDefault = TRUE;
+ bool backDefault = true;
switch (pMessage->GetClassID()) {
case CFWL_MessageType::SetFocus: {
m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
- backDefault = FALSE;
+ backDefault = false;
break;
}
case CFWL_MessageType::KillFocus: {
m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
- backDefault = FALSE;
+ backDefault = false;
break;
}
case CFWL_MessageType::Mouse: {
@@ -65,7 +65,7 @@ void IFWL_ComboEdit::OnProcessMessage(CFWL_Message* pMessage) {
if ((pMsg->m_dwCmd == FWL_MouseCommand::LeftButtonDown) &&
((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0)) {
SetSelected();
- SetComboBoxFocus(TRUE);
+ SetComboBoxFocus(true);
}
break;
}
diff --git a/xfa/fwl/core/ifwl_comboedit.h b/xfa/fwl/core/ifwl_comboedit.h
index 9c321d1cd4..59aa9956e9 100644
--- a/xfa/fwl/core/ifwl_comboedit.h
+++ b/xfa/fwl/core/ifwl_comboedit.h
@@ -25,10 +25,10 @@ class IFWL_ComboEdit : public IFWL_Edit {
void ClearSelected();
void SetSelected();
void EndCaret();
- void FlagFocus(FX_BOOL bSet);
+ void FlagFocus(bool bSet);
protected:
- void SetComboBoxFocus(FX_BOOL bSet);
+ void SetComboBoxFocus(bool bSet);
IFWL_ComboBox* m_pOuter;
};
diff --git a/xfa/fwl/core/ifwl_combolist.cpp b/xfa/fwl/core/ifwl_combolist.cpp
index 5a2ade96de..452cdff1e0 100644
--- a/xfa/fwl/core/ifwl_combolist.cpp
+++ b/xfa/fwl/core/ifwl_combolist.cpp
@@ -13,7 +13,7 @@
IFWL_ComboList::IFWL_ComboList(const IFWL_App* app,
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
- : IFWL_ListBox(app, properties, pOuter), m_bNotifyOwner(TRUE) {
+ : IFWL_ListBox(app, properties, pOuter), m_bNotifyOwner(true) {
ASSERT(pOuter);
}
@@ -52,14 +52,14 @@ void IFWL_ComboList::ChangeSelected(int32_t iSel) {
return;
} else if (iOld > -1) {
GetItemRect(iOld, rtInvalidate);
- SetSelItem(hOld, FALSE);
+ SetSelItem(hOld, false);
}
if (hItem) {
CFX_RectF rect;
GetItemRect(iSel, rect);
rtInvalidate.Union(rect);
IFWL_ListItem* hSel = pData->GetItem(this, iSel);
- SetSelItem(hSel, TRUE);
+ SetSelItem(hSel, true);
}
if (!rtInvalidate.IsEmpty()) {
Repaint(&rtInvalidate);
@@ -87,7 +87,7 @@ void IFWL_ComboList::ClientToOuter(FX_FLOAT& fx, FX_FLOAT& fy) {
pOwner->TransformTo(m_pOuter, fx, fy);
}
-void IFWL_ComboList::SetFocus(FX_BOOL bSet) {
+void IFWL_ComboList::SetFocus(bool bSet) {
IFWL_Widget::SetFocus(bSet);
}
@@ -96,13 +96,13 @@ void IFWL_ComboList::OnProcessMessage(CFWL_Message* pMessage) {
return;
CFWL_MessageType dwHashCode = pMessage->GetClassID();
- FX_BOOL backDefault = TRUE;
+ bool backDefault = true;
if (dwHashCode == CFWL_MessageType::SetFocus ||
dwHashCode == CFWL_MessageType::KillFocus) {
OnDropListFocusChanged(pMessage, dwHashCode == CFWL_MessageType::SetFocus);
} else if (dwHashCode == CFWL_MessageType::Mouse) {
CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
- if (IsShowScrollBar(TRUE) && m_pVertScrollBar) {
+ if (IsShowScrollBar(true) && m_pVertScrollBar) {
CFX_RectF rect;
m_pVertScrollBar->GetWidgetRect(rect);
if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) {
@@ -114,17 +114,17 @@ void IFWL_ComboList::OnProcessMessage(CFWL_Message* pMessage) {
}
switch (pMsg->m_dwCmd) {
case FWL_MouseCommand::Move: {
- backDefault = FALSE;
+ backDefault = false;
OnDropListMouseMove(pMsg);
break;
}
case FWL_MouseCommand::LeftButtonDown: {
- backDefault = FALSE;
+ backDefault = false;
OnDropListLButtonDown(pMsg);
break;
}
case FWL_MouseCommand::LeftButtonUp: {
- backDefault = FALSE;
+ backDefault = false;
OnDropListLButtonUp(pMsg);
break;
}
@@ -138,7 +138,7 @@ void IFWL_ComboList::OnProcessMessage(CFWL_Message* pMessage) {
IFWL_ListBox::OnProcessMessage(pMessage);
}
-void IFWL_ComboList::OnDropListFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
+void IFWL_ComboList::OnDropListFocusChanged(CFWL_Message* pMsg, bool bSet) {
if (bSet)
return;
@@ -146,16 +146,16 @@ void IFWL_ComboList::OnDropListFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
IFWL_ComboBox* pOuter = static_cast<IFWL_ComboBox*>(m_pOuter);
if (pKill->m_pSetFocus == m_pOuter ||
pKill->m_pSetFocus == pOuter->GetComboEdit()) {
- pOuter->ShowDropList(FALSE);
+ pOuter->ShowDropList(false);
}
}
int32_t IFWL_ComboList::OnDropListMouseMove(CFWL_MsgMouse* pMsg) {
if (m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) {
if (m_bNotifyOwner) {
- m_bNotifyOwner = FALSE;
+ m_bNotifyOwner = false;
}
- if (IsShowScrollBar(TRUE) && m_pVertScrollBar) {
+ if (IsShowScrollBar(true) && m_pVertScrollBar) {
CFX_RectF rect;
m_pVertScrollBar->GetWidgetRect(rect);
if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) {
@@ -188,7 +188,7 @@ int32_t IFWL_ComboList::OnDropListLButtonDown(CFWL_MsgMouse* pMsg) {
return 0;
IFWL_ComboBox* pOuter = static_cast<IFWL_ComboBox*>(m_pOuter);
- pOuter->ShowDropList(FALSE);
+ pOuter->ShowDropList(false);
return 1;
}
@@ -198,42 +198,42 @@ int32_t IFWL_ComboList::OnDropListLButtonUp(CFWL_MsgMouse* pMsg) {
ClientToOuter(pMsg->m_fx, pMsg->m_fy);
pOuter->GetDelegate()->OnProcessMessage(pMsg);
} else {
- if (IsShowScrollBar(TRUE) && m_pVertScrollBar) {
+ if (IsShowScrollBar(true) && m_pVertScrollBar) {
CFX_RectF rect;
m_pVertScrollBar->GetWidgetRect(rect);
if (rect.Contains(pMsg->m_fx, pMsg->m_fy)) {
return 1;
}
}
- pOuter->ShowDropList(FALSE);
+ pOuter->ShowDropList(false);
IFWL_ListItem* hItem = GetItemAtPoint(pMsg->m_fx, pMsg->m_fy);
if (hItem)
- pOuter->ProcessSelChanged(TRUE);
+ pOuter->ProcessSelChanged(true);
}
return 1;
}
int32_t IFWL_ComboList::OnDropListKey(CFWL_MsgKey* pKey) {
IFWL_ComboBox* pOuter = static_cast<IFWL_ComboBox*>(m_pOuter);
- FX_BOOL bPropagate = FALSE;
+ bool bPropagate = false;
if (pKey->m_dwCmd == FWL_KeyCommand::KeyDown) {
uint32_t dwKeyCode = pKey->m_dwKeyCode;
switch (dwKeyCode) {
case FWL_VKEY_Return:
case FWL_VKEY_Escape: {
- pOuter->ShowDropList(FALSE);
+ pOuter->ShowDropList(false);
return 1;
}
case FWL_VKEY_Up:
case FWL_VKEY_Down: {
OnDropListKeyDown(pKey);
- pOuter->ProcessSelChanged(FALSE);
+ pOuter->ProcessSelChanged(false);
return 1;
}
- default: { bPropagate = TRUE; }
+ default: { bPropagate = true; }
}
} else if (pKey->m_dwCmd == FWL_KeyCommand::Char) {
- bPropagate = TRUE;
+ bPropagate = true;
}
if (bPropagate) {
pKey->m_pDstTarget = m_pOuter;
@@ -259,7 +259,7 @@ void IFWL_ComboList::OnDropListKeyDown(CFWL_MsgKey* pKey) {
if (!hItem) {
break;
}
- SetSelection(hItem, hItem, TRUE);
+ SetSelection(hItem, hItem, true);
ScrollToVisible(hItem);
CFX_RectF rtInvalidate;
rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width,
diff --git a/xfa/fwl/core/ifwl_combolist.h b/xfa/fwl/core/ifwl_combolist.h
index a4e90f5b93..6da1640023 100644
--- a/xfa/fwl/core/ifwl_combolist.h
+++ b/xfa/fwl/core/ifwl_combolist.h
@@ -25,14 +25,14 @@ class IFWL_ComboList : public IFWL_ListBox {
int32_t CountItems();
void GetItemRect(int32_t nIndex, CFX_RectF& rtItem);
void ClientToOuter(FX_FLOAT& fx, FX_FLOAT& fy);
- void SetFocus(FX_BOOL bSet);
+ void SetFocus(bool bSet);
- FX_BOOL m_bNotifyOwner;
+ bool m_bNotifyOwner;
friend class IFWL_ComboBox;
private:
- void OnDropListFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet);
+ void OnDropListFocusChanged(CFWL_Message* pMsg, bool bSet);
int32_t OnDropListMouseMove(CFWL_MsgMouse* pMsg);
int32_t OnDropListLButtonDown(CFWL_MsgMouse* pMsg);
int32_t OnDropListLButtonUp(CFWL_MsgMouse* pMsg);
diff --git a/xfa/fwl/core/ifwl_datetimecalendar.cpp b/xfa/fwl/core/ifwl_datetimecalendar.cpp
index f521c56fb7..4e274fca7f 100644
--- a/xfa/fwl/core/ifwl_datetimecalendar.cpp
+++ b/xfa/fwl/core/ifwl_datetimecalendar.cpp
@@ -15,7 +15,7 @@ IFWL_DateTimeCalendar::IFWL_DateTimeCalendar(
const IFWL_App* app,
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
- : IFWL_MonthCalendar(app, properties, pOuter), m_bFlag(FALSE) {}
+ : IFWL_MonthCalendar(app, properties, pOuter), m_bFlag(false) {}
void IFWL_DateTimeCalendar::OnProcessMessage(CFWL_Message* pMessage) {
CFWL_MessageType dwCode = pMessage->GetClassID();
@@ -94,9 +94,9 @@ void IFWL_DateTimeCalendar::OnLButtonUpEx(CFWL_MsgMouse* pMsg) {
return;
pIPicker->ProcessSelChanged(m_iCurYear, m_iCurMonth, iCurSel);
- pIPicker->ShowMonthCalendar(FALSE);
+ pIPicker->ShowMonthCalendar(false);
} else if (m_bFlag && (!rt.Contains(pMsg->m_fx, pMsg->m_fy))) {
- pIPicker->ShowMonthCalendar(FALSE);
+ pIPicker->ShowMonthCalendar(false);
}
m_bFlag = 0;
}
@@ -105,7 +105,7 @@ void IFWL_DateTimeCalendar::OnMouseMoveEx(CFWL_MsgMouse* pMsg) {
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_MultiSelect)
return;
- FX_BOOL bRepaint = FALSE;
+ bool bRepaint = false;
CFX_RectF rtInvalidate;
rtInvalidate.Set(0, 0, 0, 0);
if (m_rtDates.Contains(pMsg->m_fx, pMsg->m_fy)) {
@@ -179,6 +179,6 @@ void IFWL_DateTimeCalendar::DisForm_OnLButtonUpEx(CFWL_MsgMouse* pMsg) {
IFWL_DateTimePicker* pDateTime =
static_cast<IFWL_DateTimePicker*>(m_pOuter);
pDateTime->ProcessSelChanged(m_iCurYear, m_iCurMonth, iCurSel);
- pDateTime->ShowMonthCalendar(FALSE);
+ pDateTime->ShowMonthCalendar(false);
}
}
diff --git a/xfa/fwl/core/ifwl_datetimecalendar.h b/xfa/fwl/core/ifwl_datetimecalendar.h
index 721bc27a73..07f0373e1e 100644
--- a/xfa/fwl/core/ifwl_datetimecalendar.h
+++ b/xfa/fwl/core/ifwl_datetimecalendar.h
@@ -25,7 +25,7 @@ class IFWL_DateTimeCalendar : public IFWL_MonthCalendar {
void DisForm_OnProcessMessage(CFWL_Message* pMessage);
void DisForm_OnLButtonUpEx(CFWL_MsgMouse* pMsg);
- FX_BOOL m_bFlag;
+ bool m_bFlag;
};
#endif // XFA_FWL_CORE_IFWL_DATETIMECALENDAR_H_
diff --git a/xfa/fwl/core/ifwl_datetimeedit.cpp b/xfa/fwl/core/ifwl_datetimeedit.cpp
index 906ba94e57..62675a3586 100644
--- a/xfa/fwl/core/ifwl_datetimeedit.cpp
+++ b/xfa/fwl/core/ifwl_datetimeedit.cpp
@@ -44,7 +44,7 @@ void IFWL_DateTimeEdit::DisForm_OnProcessMessage(CFWL_Message* pMessage) {
if (pDateTime->IsMonthCalendarShowed()) {
CFX_RectF rtInvalidate;
pDateTime->GetWidgetRect(rtInvalidate);
- pDateTime->ShowMonthCalendar(FALSE);
+ pDateTime->ShowMonthCalendar(false);
rtInvalidate.Offset(-rtInvalidate.left, -rtInvalidate.top);
pDateTime->Repaint(&rtInvalidate);
}
diff --git a/xfa/fwl/core/ifwl_datetimepicker.cpp b/xfa/fwl/core/ifwl_datetimepicker.cpp
index 90f85a08a7..5237326b9e 100644
--- a/xfa/fwl/core/ifwl_datetimepicker.cpp
+++ b/xfa/fwl/core/ifwl_datetimepicker.cpp
@@ -32,7 +32,7 @@ IFWL_DateTimePicker::IFWL_DateTimePicker(
m_iYear(-1),
m_iMonth(-1),
m_iDay(-1),
- m_bLBtnDown(FALSE) {
+ m_bLBtnDown(false) {
m_rtBtn.Set(0, 0, 0, 0);
m_pProperties->m_dwStyleExes = FWL_STYLEEXT_DTP_ShortDateFormat;
@@ -45,7 +45,7 @@ IFWL_DateTimePicker::IFWL_DateTimePicker(
m_pMonthCal.reset(new IFWL_DateTimeCalendar(m_pOwnerApp, propMonth, this));
CFX_RectF rtMonthCal;
- m_pMonthCal->GetWidgetRect(rtMonthCal, TRUE);
+ m_pMonthCal->GetWidgetRect(rtMonthCal, true);
rtMonthCal.Set(0, 0, rtMonthCal.width, rtMonthCal.height);
m_pMonthCal->SetWidgetRect(rtMonthCal);
CFWL_WidgetImpProperties propEdit;
@@ -65,14 +65,13 @@ FWL_Type IFWL_DateTimePicker::GetClassID() const {
return FWL_Type::DateTimePicker;
}
-FWL_Error IFWL_DateTimePicker::GetWidgetRect(CFX_RectF& rect,
- FX_BOOL bAutoSize) {
+FWL_Error IFWL_DateTimePicker::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (m_pWidgetMgr->IsFormDisabled()) {
return DisForm_GetWidgetRect(rect, bAutoSize);
}
if (bAutoSize) {
rect.Set(0, 0, kDateTimePickerWidth, kDateTimePickerHeight);
- IFWL_Widget::GetWidgetRect(rect, TRUE);
+ IFWL_Widget::GetWidgetRect(rect, true);
} else {
rect = m_pProperties->m_rtWidget;
}
@@ -114,7 +113,7 @@ FWL_Error IFWL_DateTimePicker::Update() {
m_MonthCalendarDP.m_iCurMonth, m_MonthCalendarDP.m_iCurDay);
}
CFX_RectF rtMonthCal;
- m_pMonthCal->GetWidgetRect(rtMonthCal, TRUE);
+ m_pMonthCal->GetWidgetRect(rtMonthCal, true);
CFX_RectF rtPopUp;
rtPopUp.Set(rtMonthCal.left, rtMonthCal.top + kDateTimePickerHeight,
rtMonthCal.width, rtMonthCal.height);
@@ -219,60 +218,60 @@ FWL_Error IFWL_DateTimePicker::GetEditText(CFX_WideString& wsText,
return FWL_Error::Indefinite;
}
-FX_BOOL IFWL_DateTimePicker::CanUndo() {
+bool IFWL_DateTimePicker::CanUndo() {
return m_pEdit->CanUndo();
}
-FX_BOOL IFWL_DateTimePicker::CanRedo() {
+bool IFWL_DateTimePicker::CanRedo() {
return m_pEdit->CanRedo();
}
-FX_BOOL IFWL_DateTimePicker::Undo() {
+bool IFWL_DateTimePicker::Undo() {
return m_pEdit->Undo();
}
-FX_BOOL IFWL_DateTimePicker::Redo() {
+bool IFWL_DateTimePicker::Redo() {
return m_pEdit->Redo();
}
-FX_BOOL IFWL_DateTimePicker::CanCopy() {
+bool IFWL_DateTimePicker::CanCopy() {
int32_t nCount = m_pEdit->CountSelRanges();
return nCount > 0;
}
-FX_BOOL IFWL_DateTimePicker::CanCut() {
+bool IFWL_DateTimePicker::CanCut() {
if (m_pEdit->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly) {
- return FALSE;
+ return false;
}
int32_t nCount = m_pEdit->CountSelRanges();
return nCount > 0;
}
-FX_BOOL IFWL_DateTimePicker::CanSelectAll() {
+bool IFWL_DateTimePicker::CanSelectAll() {
return m_pEdit->GetTextLength() > 0;
}
-FX_BOOL IFWL_DateTimePicker::Copy(CFX_WideString& wsCopy) {
+bool IFWL_DateTimePicker::Copy(CFX_WideString& wsCopy) {
return m_pEdit->Copy(wsCopy);
}
-FX_BOOL IFWL_DateTimePicker::Cut(CFX_WideString& wsCut) {
+bool IFWL_DateTimePicker::Cut(CFX_WideString& wsCut) {
return m_pEdit->Cut(wsCut);
}
-FX_BOOL IFWL_DateTimePicker::Paste(const CFX_WideString& wsPaste) {
+bool IFWL_DateTimePicker::Paste(const CFX_WideString& wsPaste) {
return m_pEdit->Paste(wsPaste);
}
-FX_BOOL IFWL_DateTimePicker::SelectAll() {
+bool IFWL_DateTimePicker::SelectAll() {
return m_pEdit->AddSelRange(0) == FWL_Error::Succeeded;
}
-FX_BOOL IFWL_DateTimePicker::Delete() {
+bool IFWL_DateTimePicker::Delete() {
return m_pEdit->ClearText() == FWL_Error::Succeeded;
}
-FX_BOOL IFWL_DateTimePicker::DeSelect() {
+bool IFWL_DateTimePicker::DeSelect() {
return m_pEdit->ClearSelections() == FWL_Error::Succeeded;
}
@@ -335,7 +334,7 @@ void IFWL_DateTimePicker::FormatDateString(int32_t iYear,
}
}
-void IFWL_DateTimePicker::ShowMonthCalendar(FX_BOOL bActivate) {
+void IFWL_DateTimePicker::ShowMonthCalendar(bool bActivate) {
if (m_pWidgetMgr->IsFormDisabled()) {
return DisForm_ShowMonthCalendar(bActivate);
}
@@ -363,12 +362,12 @@ void IFWL_DateTimePicker::ShowMonthCalendar(FX_BOOL bActivate) {
}
}
-FX_BOOL IFWL_DateTimePicker::IsMonthCalendarShowed() {
+bool IFWL_DateTimePicker::IsMonthCalendarShowed() {
if (m_pWidgetMgr->IsFormDisabled()) {
return DisForm_IsMonthCalendarShowed();
}
if (!m_pForm)
- return FALSE;
+ return false;
return !(m_pForm->GetStates() & FWL_WGTSTATE_Invisible);
}
@@ -470,7 +469,7 @@ void IFWL_DateTimePicker::DisForm_InitDateTimeCalendar() {
m_pMonthCal.reset(new IFWL_DateTimeCalendar(m_pOwnerApp, propMonth, this));
CFX_RectF rtMonthCal;
- m_pMonthCal->GetWidgetRect(rtMonthCal, TRUE);
+ m_pMonthCal->GetWidgetRect(rtMonthCal, true);
rtMonthCal.Set(0, 0, rtMonthCal.width, rtMonthCal.height);
m_pMonthCal->SetWidgetRect(rtMonthCal);
}
@@ -486,20 +485,20 @@ void IFWL_DateTimePicker::DisForm_InitDateTimeEdit() {
m_pEdit.reset(new IFWL_DateTimeEdit(m_pOwnerApp, propEdit, this));
}
-FX_BOOL IFWL_DateTimePicker::DisForm_IsMonthCalendarShowed() {
+bool IFWL_DateTimePicker::DisForm_IsMonthCalendarShowed() {
if (!m_pMonthCal)
- return FALSE;
+ return false;
return !(m_pMonthCal->GetStates() & FWL_WGTSTATE_Invisible);
}
-void IFWL_DateTimePicker::DisForm_ShowMonthCalendar(FX_BOOL bActivate) {
- FX_BOOL bShowed = IsMonthCalendarShowed();
+void IFWL_DateTimePicker::DisForm_ShowMonthCalendar(bool bActivate) {
+ bool bShowed = IsMonthCalendarShowed();
if (bShowed == bActivate) {
return;
}
if (bActivate) {
CFX_RectF rtMonthCal;
- m_pMonthCal->GetWidgetRect(rtMonthCal, TRUE);
+ m_pMonthCal->GetWidgetRect(rtMonthCal, true);
FX_FLOAT fPopupMin = rtMonthCal.height;
FX_FLOAT fPopupMax = rtMonthCal.height;
CFX_RectF rtAnchor(m_pProperties->m_rtWidget);
@@ -547,10 +546,10 @@ FWL_WidgetHit IFWL_DateTimePicker::DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) {
return FWL_WidgetHit::Unknown;
}
-FX_BOOL IFWL_DateTimePicker::DisForm_IsNeedShowButton() {
- FX_BOOL bFocus = m_pProperties->m_dwStates & FWL_WGTSTATE_Focused ||
- m_pMonthCal->GetStates() & FWL_WGTSTATE_Focused ||
- m_pEdit->GetStates() & FWL_WGTSTATE_Focused;
+bool IFWL_DateTimePicker::DisForm_IsNeedShowButton() {
+ bool bFocus = m_pProperties->m_dwStates & FWL_WGTSTATE_Focused ||
+ m_pMonthCal->GetStates() & FWL_WGTSTATE_Focused ||
+ m_pEdit->GetStates() & FWL_WGTSTATE_Focused;
return bFocus;
}
@@ -581,7 +580,7 @@ FWL_Error IFWL_DateTimePicker::DisForm_Update() {
m_fBtn = *pWidth;
CFX_RectF rtMonthCal;
- m_pMonthCal->GetWidgetRect(rtMonthCal, TRUE);
+ m_pMonthCal->GetWidgetRect(rtMonthCal, true);
CFX_RectF rtPopUp;
rtPopUp.Set(rtMonthCal.left, rtMonthCal.top + kDateTimePickerHeight,
rtMonthCal.width, rtMonthCal.height);
@@ -591,7 +590,7 @@ FWL_Error IFWL_DateTimePicker::DisForm_Update() {
}
FWL_Error IFWL_DateTimePicker::DisForm_GetWidgetRect(CFX_RectF& rect,
- FX_BOOL bAutoSize) {
+ bool bAutoSize) {
rect = m_pProperties->m_rtWidget;
if (DisForm_IsNeedShowButton()) {
rect.width += m_fBtn;
@@ -647,10 +646,10 @@ void IFWL_DateTimePicker::OnProcessMessage(CFWL_Message* pMessage) {
switch (pMessage->GetClassID()) {
case CFWL_MessageType::SetFocus:
- OnFocusChanged(pMessage, TRUE);
+ OnFocusChanged(pMessage, true);
break;
case CFWL_MessageType::KillFocus:
- OnFocusChanged(pMessage, FALSE);
+ OnFocusChanged(pMessage, false);
break;
case CFWL_MessageType::Mouse: {
CFWL_MsgMouse* pMouse = static_cast<CFWL_MsgMouse*>(pMessage);
@@ -691,7 +690,7 @@ void IFWL_DateTimePicker::OnDrawWidget(CFX_Graphics* pGraphics,
DrawWidget(pGraphics, pMatrix);
}
-void IFWL_DateTimePicker::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
+void IFWL_DateTimePicker::OnFocusChanged(CFWL_Message* pMsg, bool bSet) {
if (!pMsg)
return;
if (m_pWidgetMgr->IsFormDisabled())
@@ -705,7 +704,7 @@ void IFWL_DateTimePicker::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
Repaint(&m_rtClient);
}
if (pMsg->m_pSrcTarget == m_pMonthCal.get() && IsMonthCalendarShowed()) {
- ShowMonthCalendar(FALSE);
+ ShowMonthCalendar(false);
}
Repaint(&m_rtClient);
}
@@ -714,19 +713,19 @@ void IFWL_DateTimePicker::OnLButtonDown(CFWL_MsgMouse* pMsg) {
if (!pMsg)
return;
if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0)
- SetFocus(TRUE);
+ SetFocus(true);
if (m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) {
if (IsMonthCalendarShowed()) {
- ShowMonthCalendar(FALSE);
+ ShowMonthCalendar(false);
CFWL_Event_DtpCloseUp ev;
DispatchEvent(&ev);
} else {
if (!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_TimeFormat)) {
- ShowMonthCalendar(TRUE);
+ ShowMonthCalendar(true);
CFWL_Event_DtpDropDown ev;
DispatchEvent(&ev);
}
- m_bLBtnDown = TRUE;
+ m_bLBtnDown = true;
Repaint(&m_rtClient);
}
}
@@ -736,7 +735,7 @@ void IFWL_DateTimePicker::OnLButtonUp(CFWL_MsgMouse* pMsg) {
if (!pMsg)
return;
- m_bLBtnDown = FALSE;
+ m_bLBtnDown = false;
if (m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy))
m_iBtnState = CFWL_PartState_Hovered;
else
@@ -759,7 +758,7 @@ void IFWL_DateTimePicker::OnMouseLeave(CFWL_MsgMouse* pMsg) {
}
void IFWL_DateTimePicker::DisForm_OnFocusChanged(CFWL_Message* pMsg,
- FX_BOOL bSet) {
+ bool bSet) {
CFX_RectF rtInvalidate(m_rtBtn);
if (bSet) {
m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
@@ -774,7 +773,7 @@ void IFWL_DateTimePicker::DisForm_OnFocusChanged(CFWL_Message* pMsg,
m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
m_rtBtn.Set(0, 0, 0, 0);
if (DisForm_IsMonthCalendarShowed())
- ShowMonthCalendar(FALSE);
+ ShowMonthCalendar(false);
if (m_pEdit->GetStates() & FWL_WGTSTATE_Focused) {
pMsg->m_pSrcTarget = m_pEdit.get();
m_pEdit->GetDelegate()->OnProcessMessage(pMsg);
diff --git a/xfa/fwl/core/ifwl_datetimepicker.h b/xfa/fwl/core/ifwl_datetimepicker.h
index 04d2869c54..17eb7b851c 100644
--- a/xfa/fwl/core/ifwl_datetimepicker.h
+++ b/xfa/fwl/core/ifwl_datetimepicker.h
@@ -68,7 +68,7 @@ class IFWL_DateTimePicker : public IFWL_Widget {
// IFWL_Widget
FWL_Type GetClassID() const override;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
FWL_Error Update() override;
FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override;
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
@@ -87,27 +87,27 @@ class IFWL_DateTimePicker : public IFWL_Widget {
int32_t CountSelRanges();
int32_t GetSelRange(int32_t nIndex, int32_t& nStart);
- FX_BOOL CanUndo();
- FX_BOOL CanRedo();
- FX_BOOL Undo();
- FX_BOOL Redo();
- FX_BOOL CanCopy();
- FX_BOOL CanCut();
- FX_BOOL CanSelectAll();
- FX_BOOL Copy(CFX_WideString& wsCopy);
- FX_BOOL Cut(CFX_WideString& wsCut);
- FX_BOOL Paste(const CFX_WideString& wsPaste);
- FX_BOOL SelectAll();
- FX_BOOL Delete();
- FX_BOOL DeSelect();
+ bool CanUndo();
+ bool CanRedo();
+ bool Undo();
+ bool Redo();
+ bool CanCopy();
+ bool CanCut();
+ bool CanSelectAll();
+ bool Copy(CFX_WideString& wsCopy);
+ bool Cut(CFX_WideString& wsCut);
+ bool Paste(const CFX_WideString& wsPaste);
+ bool SelectAll();
+ bool Delete();
+ bool DeSelect();
FWL_Error GetBBox(CFX_RectF& rect);
FWL_Error SetEditLimit(int32_t nLimit);
FWL_Error ModifyEditStylesEx(uint32_t dwStylesExAdded,
uint32_t dwStylesExRemoved);
IFWL_DateTimeEdit* GetDataTimeEdit();
- FX_BOOL IsMonthCalendarShowed();
- void ShowMonthCalendar(FX_BOOL bActivate);
+ bool IsMonthCalendarShowed();
+ void ShowMonthCalendar(bool bActivate);
void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay);
IFWL_FormProxy* GetFormProxy() const { return m_pForm.get(); }
@@ -147,7 +147,7 @@ class IFWL_DateTimePicker : public IFWL_Widget {
int32_t m_iYear;
int32_t m_iMonth;
int32_t m_iDay;
- FX_BOOL m_bLBtnDown;
+ bool m_bLBtnDown;
std::unique_ptr<IFWL_DateTimeEdit> m_pEdit;
std::unique_ptr<IFWL_DateTimeCalendar> m_pMonthCal;
std::unique_ptr<IFWL_FormProxy> m_pForm;
@@ -158,22 +158,22 @@ class IFWL_DateTimePicker : public IFWL_Widget {
FWL_Error DisForm_Initialize();
void DisForm_InitDateTimeCalendar();
void DisForm_InitDateTimeEdit();
- FX_BOOL DisForm_IsMonthCalendarShowed();
- void DisForm_ShowMonthCalendar(FX_BOOL bActivate);
+ bool DisForm_IsMonthCalendarShowed();
+ void DisForm_ShowMonthCalendar(bool bActivate);
FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy);
- FX_BOOL DisForm_IsNeedShowButton();
+ bool DisForm_IsNeedShowButton();
FWL_Error DisForm_Update();
- FWL_Error DisForm_GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE);
+ FWL_Error DisForm_GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false);
FWL_Error DisForm_GetBBox(CFX_RectF& rect);
FWL_Error DisForm_DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr);
- void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet);
+ void OnFocusChanged(CFWL_Message* pMsg, bool bSet);
void OnLButtonDown(CFWL_MsgMouse* pMsg);
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnMouseMove(CFWL_MsgMouse* pMsg);
void OnMouseLeave(CFWL_MsgMouse* pMsg);
- void DisForm_OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet);
+ void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet);
};
#endif // XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_
diff --git a/xfa/fwl/core/ifwl_edit.cpp b/xfa/fwl/core/ifwl_edit.cpp
index 5222f37c45..111df72733 100644
--- a/xfa/fwl/core/ifwl_edit.cpp
+++ b/xfa/fwl/core/ifwl_edit.cpp
@@ -59,17 +59,17 @@ IFWL_Edit::IFWL_Edit(const IFWL_App* app,
m_fVAlignOffset(0.0f),
m_fScrollOffsetX(0.0f),
m_fScrollOffsetY(0.0f),
- m_bLButtonDown(FALSE),
+ m_bLButtonDown(false),
m_nSelStart(0),
m_nLimit(-1),
m_fSpaceAbove(0),
m_fSpaceBelow(0),
m_fFontSize(0),
- m_bSetRange(FALSE),
+ m_bSetRange(false),
m_iMin(-1),
m_iMax(0xFFFFFFF),
m_backColor(0),
- m_updateBackColor(FALSE),
+ m_updateBackColor(false),
m_iCurRecord(-1),
m_iMaxRecord(128) {
m_rtClient.Reset();
@@ -83,7 +83,7 @@ IFWL_Edit::IFWL_Edit(const IFWL_App* app,
IFWL_Edit::~IFWL_Edit() {
if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused)
- ShowCaret(FALSE);
+ ShowCaret(false);
ClearRecord();
}
@@ -92,7 +92,7 @@ FWL_Type IFWL_Edit::GetClassID() const {
return FWL_Type::Edit;
}
-FWL_Error IFWL_Edit::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error IFWL_Edit::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
rect.Set(0, 0, 0, 0);
if (m_pEdtEngine) {
@@ -106,17 +106,17 @@ FWL_Error IFWL_Edit::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
rect.Set(0, 0, sz.x, sz.y);
}
}
- IFWL_Widget::GetWidgetRect(rect, TRUE);
+ IFWL_Widget::GetWidgetRect(rect, true);
} else {
rect = m_pProperties->m_rtWidget;
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_OuterScrollbar) {
- if (IsShowScrollBar(TRUE)) {
+ if (IsShowScrollBar(true)) {
FX_FLOAT* pfWidth = static_cast<FX_FLOAT*>(
GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth));
rect.width += *pfWidth;
rect.width += kEditMargin;
}
- if (IsShowScrollBar(FALSE)) {
+ if (IsShowScrollBar(false)) {
FX_FLOAT* pfWidth = static_cast<FX_FLOAT*>(
GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth));
rect.height += *pfWidth;
@@ -127,10 +127,10 @@ FWL_Error IFWL_Edit::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
return FWL_Error::Succeeded;
}
-void IFWL_Edit::SetStates(uint32_t dwStates, FX_BOOL bSet) {
+void IFWL_Edit::SetStates(uint32_t dwStates, bool bSet) {
if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) ||
(m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)) {
- ShowCaret(FALSE);
+ ShowCaret(false);
}
IFWL_Widget::SetStates(dwStates, bSet);
}
@@ -158,13 +158,13 @@ FWL_Error IFWL_Edit::Update() {
FWL_WidgetHit IFWL_Edit::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_OuterScrollbar) {
- if (IsShowScrollBar(TRUE)) {
+ if (IsShowScrollBar(true)) {
CFX_RectF rect;
m_pVertScrollBar->GetWidgetRect(rect);
if (rect.Contains(fx, fy))
return FWL_WidgetHit::VScrollBar;
}
- if (IsShowScrollBar(FALSE)) {
+ if (IsShowScrollBar(false)) {
CFX_RectF rect;
m_pHorzScrollBar->GetWidgetRect(rect);
if (rect.Contains(fx, fy))
@@ -204,12 +204,12 @@ void IFWL_Edit::AddSpellCheckObj(CFX_Path& PathData,
int32_t IFWL_Edit::GetWordAtPoint(CFX_PointF pointf, int32_t& nCount) {
return 0;
}
-FX_BOOL IFWL_Edit::GetSuggestWords(CFX_PointF pointf,
- std::vector<CFX_ByteString>& sSuggest) {
+bool IFWL_Edit::GetSuggestWords(CFX_PointF pointf,
+ std::vector<CFX_ByteString>& sSuggest) {
int32_t nWordCount = 0;
int32_t nWordStart = GetWordAtPoint(pointf, nWordCount);
if (nWordCount < 1) {
- return FALSE;
+ return false;
}
CFX_WideString wsSpell;
GetText(wsSpell, nWordStart, nWordCount);
@@ -221,30 +221,30 @@ FX_BOOL IFWL_Edit::GetSuggestWords(CFX_PointF pointf,
sLatinWord += (FX_CHAR)wsSpell[i];
}
if (sLatinWord.IsEmpty()) {
- return FALSE;
+ return false;
}
CFWL_EvtEdtCheckWord checkWordEvent;
checkWordEvent.m_pSrcTarget = this;
checkWordEvent.bsWord = sLatinWord;
- checkWordEvent.bCheckWord = TRUE;
+ checkWordEvent.bCheckWord = true;
DispatchEvent(&checkWordEvent);
if (checkWordEvent.bCheckWord) {
- return FALSE;
+ return false;
}
CFWL_EvtEdtGetSuggestWords suggestWordsEvent;
suggestWordsEvent.m_pSrcTarget = this;
suggestWordsEvent.bsWord = sLatinWord;
suggestWordsEvent.bsArraySuggestWords = sSuggest;
- suggestWordsEvent.bSuggestWords = FALSE;
+ suggestWordsEvent.bSuggestWords = false;
DispatchEvent(&checkWordEvent);
return suggestWordsEvent.bSuggestWords;
}
-FX_BOOL IFWL_Edit::ReplaceSpellCheckWord(CFX_PointF pointf,
- const CFX_ByteStringC& bsReplace) {
+bool IFWL_Edit::ReplaceSpellCheckWord(CFX_PointF pointf,
+ const CFX_ByteStringC& bsReplace) {
int32_t nWordCount = 0;
int32_t nWordStart = GetWordAtPoint(pointf, nWordCount);
if (nWordCount < 1) {
- return FALSE;
+ return false;
}
CFX_WideString wsSpell;
GetText(wsSpell, nWordStart, nWordCount);
@@ -262,7 +262,7 @@ FX_BOOL IFWL_Edit::ReplaceSpellCheckWord(CFX_PointF pointf,
}
wsDest.ReleaseBuffer(nDestLen);
Replace(nWordStart, nWordCount, wsDest.AsStringC());
- return TRUE;
+ return true;
}
void IFWL_Edit::DrawSpellCheck(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) {
@@ -291,7 +291,7 @@ void IFWL_Edit::DrawSpellCheck(CFX_Graphics* pGraphics,
sLatinWord += (FX_CHAR)wsSpell[i];
} else {
checkWordEvent.bsWord = sLatinWord;
- checkWordEvent.bCheckWord = TRUE;
+ checkWordEvent.bCheckWord = true;
DispatchEvent(&checkWordEvent);
if (!sLatinWord.IsEmpty() && !checkWordEvent.bCheckWord) {
AddSpellCheckObj(pathSpell, nStart, sLatinWord.GetLength(), fOffSetX,
@@ -301,7 +301,7 @@ void IFWL_Edit::DrawSpellCheck(CFX_Graphics* pGraphics,
}
}
checkWordEvent.bsWord = sLatinWord;
- checkWordEvent.bCheckWord = TRUE;
+ checkWordEvent.bCheckWord = true;
DispatchEvent(&checkWordEvent);
if (!sLatinWord.IsEmpty() && !checkWordEvent.bCheckWord) {
AddSpellCheckObj(pathSpell, nStart, sLatinWord.GetLength(), fOffSetX,
@@ -401,7 +401,7 @@ int32_t IFWL_Edit::GetCaretPos() const {
return m_pEdtEngine->GetCaretPos();
}
-int32_t IFWL_Edit::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) {
+int32_t IFWL_Edit::SetCaretPos(int32_t nIndex, bool bBefore) {
if (!m_pEdtEngine)
return -1;
return m_pEdtEngine->SetCaretPos(nIndex, bBefore);
@@ -509,13 +509,13 @@ FWL_Error IFWL_Edit::DoClipboard(int32_t iCmd) {
return FWL_Error::Indefinite;
}
-FX_BOOL IFWL_Edit::Copy(CFX_WideString& wsCopy) {
+bool IFWL_Edit::Copy(CFX_WideString& wsCopy) {
if (!m_pEdtEngine)
- return FALSE;
+ return false;
int32_t nCount = m_pEdtEngine->CountSelRanges();
if (nCount == 0)
- return FALSE;
+ return false;
wsCopy.clear();
CFX_WideString wsTemp;
@@ -526,16 +526,16 @@ FX_BOOL IFWL_Edit::Copy(CFX_WideString& wsCopy) {
wsCopy += wsTemp;
wsTemp.clear();
}
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_Edit::Cut(CFX_WideString& wsCut) {
+bool IFWL_Edit::Cut(CFX_WideString& wsCut) {
if (!m_pEdtEngine)
- return FALSE;
+ return false;
int32_t nCount = m_pEdtEngine->CountSelRanges();
if (nCount == 0)
- return FALSE;
+ return false;
wsCut.clear();
CFX_WideString wsTemp;
@@ -547,72 +547,72 @@ FX_BOOL IFWL_Edit::Cut(CFX_WideString& wsCut) {
wsTemp.clear();
}
m_pEdtEngine->Delete(0);
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_Edit::Paste(const CFX_WideString& wsPaste) {
+bool IFWL_Edit::Paste(const CFX_WideString& wsPaste) {
if (!m_pEdtEngine)
- return FALSE;
+ return false;
int32_t nCaret = m_pEdtEngine->GetCaretPos();
int32_t iError =
m_pEdtEngine->Insert(nCaret, wsPaste.c_str(), wsPaste.GetLength());
if (iError < 0) {
ProcessInsertError(iError);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_Edit::Delete() {
+bool IFWL_Edit::Delete() {
if (!m_pEdtEngine)
- return FALSE;
+ return false;
int32_t nCount = m_pEdtEngine->CountSelRanges();
if (nCount < 1)
- return FALSE;
+ return false;
m_pEdtEngine->Delete(0);
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_Edit::Redo(const IFDE_TxtEdtDoRecord* pRecord) {
+bool IFWL_Edit::Redo(const IFDE_TxtEdtDoRecord* pRecord) {
if (!m_pEdtEngine)
- return FALSE;
+ return false;
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_NoRedoUndo)
- return TRUE;
+ return true;
return m_pEdtEngine->Redo(pRecord);
}
-FX_BOOL IFWL_Edit::Undo(const IFDE_TxtEdtDoRecord* pRecord) {
+bool IFWL_Edit::Undo(const IFDE_TxtEdtDoRecord* pRecord) {
if (!m_pEdtEngine)
- return FALSE;
+ return false;
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_NoRedoUndo)
- return TRUE;
+ return true;
return m_pEdtEngine->Undo(pRecord);
}
-FX_BOOL IFWL_Edit::Undo() {
+bool IFWL_Edit::Undo() {
if (!CanUndo())
- return FALSE;
+ return false;
return Undo(m_DoRecords[m_iCurRecord--].get());
}
-FX_BOOL IFWL_Edit::Redo() {
+bool IFWL_Edit::Redo() {
if (!CanRedo())
- return FALSE;
+ return false;
return Redo(m_DoRecords[++m_iCurRecord].get());
}
-FX_BOOL IFWL_Edit::CanUndo() {
+bool IFWL_Edit::CanUndo() {
return m_iCurRecord >= 0;
}
-FX_BOOL IFWL_Edit::CanRedo() {
+bool IFWL_Edit::CanRedo() {
return m_iCurRecord < pdfium::CollectionSize<int32_t>(m_DoRecords) - 1;
}
-FWL_Error IFWL_Edit::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) {
+FWL_Error IFWL_Edit::SetTabWidth(FX_FLOAT fTabWidth, bool bEquidistant) {
if (!m_pEdtEngine)
return FWL_Error::Indefinite;
@@ -630,28 +630,28 @@ FWL_Error IFWL_Edit::SetOuter(IFWL_Widget* pOuter) {
FWL_Error IFWL_Edit::SetNumberRange(int32_t iMin, int32_t iMax) {
m_iMin = iMin;
m_iMax = iMax;
- m_bSetRange = TRUE;
+ m_bSetRange = true;
return FWL_Error::Succeeded;
}
void IFWL_Edit::On_CaretChanged(CFDE_TxtEdtEngine* pEdit,
int32_t nPage,
- FX_BOOL bVisible) {
+ bool bVisible) {
if (m_rtEngine.IsEmpty())
return;
if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0)
return;
- FX_BOOL bRepaintContent = UpdateOffset();
+ bool bRepaintContent = UpdateOffset();
UpdateCaret();
CFX_RectF rtInvalid;
rtInvalid.Set(0, 0, 0, 0);
- FX_BOOL bRepaintScroll = FALSE;
+ bool bRepaintScroll = false;
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_MultiLine) {
IFWL_ScrollBar* pScroll = UpdateScroll();
if (pScroll) {
pScroll->GetWidgetRect(rtInvalid);
- bRepaintScroll = TRUE;
+ bRepaintScroll = true;
}
}
if (bRepaintContent || bRepaintScroll) {
@@ -681,8 +681,8 @@ void IFWL_Edit::On_TextChanged(CFDE_TxtEdtEngine* pEdit,
if (bHSelfAdaption || bVSelfAdaption) {
CFWL_EvtEdtPreSelfAdaption evt;
evt.m_pSrcTarget = this;
- evt.bHSelfAdaption = TRUE;
- evt.bVSelfAdaption = TRUE;
+ evt.bHSelfAdaption = true;
+ evt.bVSelfAdaption = true;
FX_FLOAT fWidth;
FX_FLOAT fHight;
fWidth = bHSelfAdaption ? fContentWidth : m_pProperties->m_rtWidget.width;
@@ -734,24 +734,24 @@ void IFWL_Edit::On_SelChanged(CFDE_TxtEdtEngine* pEdit) {
Repaint(&rtTemp);
}
-FX_BOOL IFWL_Edit::On_PageLoad(CFDE_TxtEdtEngine* pEdit,
- int32_t nPageIndex,
- int32_t nPurpose) {
+bool IFWL_Edit::On_PageLoad(CFDE_TxtEdtEngine* pEdit,
+ int32_t nPageIndex,
+ int32_t nPurpose) {
IFDE_TxtEdtPage* pPage = m_pEdtEngine->GetPage(nPageIndex);
if (!pPage)
- return FALSE;
+ return false;
pPage->LoadPage(nullptr, nullptr);
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_Edit::On_PageUnload(CFDE_TxtEdtEngine* pEdit,
- int32_t nPageIndex,
- int32_t nPurpose) {
+bool IFWL_Edit::On_PageUnload(CFDE_TxtEdtEngine* pEdit,
+ int32_t nPageIndex,
+ int32_t nPurpose) {
IFDE_TxtEdtPage* pPage = m_pEdtEngine->GetPage(nPageIndex);
if (!pPage)
- return FALSE;
+ return false;
pPage->UnloadPage(nullptr);
- return TRUE;
+ return true;
}
void IFWL_Edit::On_AddDoRecord(CFDE_TxtEdtEngine* pEdit,
@@ -759,8 +759,7 @@ void IFWL_Edit::On_AddDoRecord(CFDE_TxtEdtEngine* pEdit,
AddDoRecord(pRecord);
}
-FX_BOOL IFWL_Edit::On_Validate(CFDE_TxtEdtEngine* pEdit,
- CFX_WideString& wsText) {
+bool IFWL_Edit::On_Validate(CFDE_TxtEdtEngine* pEdit, CFX_WideString& wsText) {
IFWL_Widget* pDst = GetOuter();
if (!pDst) {
pDst = this;
@@ -769,14 +768,14 @@ FX_BOOL IFWL_Edit::On_Validate(CFDE_TxtEdtEngine* pEdit,
event.pDstWidget = pDst;
event.m_pSrcTarget = this;
event.wsInsert = wsText;
- event.bValidate = TRUE;
+ event.bValidate = true;
DispatchEvent(&event);
return event.bValidate;
}
FWL_Error IFWL_Edit::SetBackgroundColor(uint32_t color) {
m_backColor = color;
- m_updateBackColor = TRUE;
+ m_updateBackColor = true;
return FWL_Error::Succeeded;
}
@@ -808,7 +807,7 @@ void IFWL_Edit::DrawTextBk(CFX_Graphics* pGraphics,
param.m_matrix = *pMatrix;
param.m_rtPart = m_rtClient;
pTheme->DrawBackground(&param);
- if (!IsShowScrollBar(TRUE) || !IsShowScrollBar(FALSE)) {
+ if (!IsShowScrollBar(true) || !IsShowScrollBar(false)) {
return;
}
CFX_RectF rtScorll;
@@ -843,9 +842,8 @@ void IFWL_Edit::DrawContent(CFX_Graphics* pGraphics,
pMatrix->TransformRect(rtClip);
mt.Concat(*pMatrix);
}
- FX_BOOL bShowSel =
- (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_NoHideSel) ||
- (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused);
+ bool bShowSel = (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_NoHideSel) ||
+ (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused);
if (bShowSel) {
IFWL_Widget* pForm = m_pWidgetMgr->GetSystemFormWidget(this);
if (pForm) {
@@ -896,7 +894,7 @@ void IFWL_Edit::DrawContent(CFX_Graphics* pGraphics,
return;
std::unique_ptr<CFDE_RenderDevice> pRenderDevice(
- new CFDE_RenderDevice(pRenderDev, FALSE));
+ new CFDE_RenderDevice(pRenderDev, false));
std::unique_ptr<CFDE_RenderContext> pRenderContext(new CFDE_RenderContext);
pRenderDevice->SetClipRect(rtClip);
pRenderContext->StartRender(pRenderDevice.get(), pPage, mt);
@@ -1039,7 +1037,7 @@ void IFWL_Edit::UpdateEditParams() {
params.nLineCount = 1;
}
params.fTabWidth = params.fFontSize * 1;
- params.bTabEquidistant = TRUE;
+ params.bTabEquidistant = true;
params.wLineBreakChar = L'\n';
params.nCharRotation = 0;
params.pEventSink = this;
@@ -1062,7 +1060,7 @@ void IFWL_Edit::UpdateEditLayout() {
pPage->LoadPage(nullptr, nullptr);
}
-FX_BOOL IFWL_Edit::UpdateOffset() {
+bool IFWL_Edit::UpdateOffset() {
CFX_RectF rtCaret;
m_pEdtEngine->GetCaretRect(rtCaret);
FX_FLOAT fOffSetX = m_rtEngine.left - m_fScrollOffsetX;
@@ -1072,7 +1070,7 @@ FX_BOOL IFWL_Edit::UpdateOffset() {
if (rtEidt.Contains(rtCaret)) {
IFDE_TxtEdtPage* pPage = m_pEdtEngine->GetPage(0);
if (!pPage)
- return FALSE;
+ return false;
CFX_RectF rtFDE = pPage->GetContentsBox();
rtFDE.Offset(fOffSetX, fOffSetY);
@@ -1084,7 +1082,7 @@ FX_BOOL IFWL_Edit::UpdateOffset() {
m_fScrollOffsetY += rtFDE.bottom() - rtEidt.bottom();
m_fScrollOffsetY = std::max(m_fScrollOffsetY, 0.0f);
}
- return FALSE;
+ return false;
}
FX_FLOAT offsetX = 0.0;
@@ -1103,16 +1101,15 @@ FX_BOOL IFWL_Edit::UpdateOffset() {
m_fScrollOffsetY += offsetY;
if (m_fFontSize > m_rtEngine.height)
m_fScrollOffsetY = 0;
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_Edit::UpdateOffset(IFWL_ScrollBar* pScrollBar,
- FX_FLOAT fPosChanged) {
+bool IFWL_Edit::UpdateOffset(IFWL_ScrollBar* pScrollBar, FX_FLOAT fPosChanged) {
if (pScrollBar == m_pHorzScrollBar.get())
m_fScrollOffsetX += fPosChanged;
else
m_fScrollOffsetY += fPosChanged;
- return TRUE;
+ return true;
}
void IFWL_Edit::UpdateVAlignment() {
@@ -1169,19 +1166,19 @@ void IFWL_Edit::UpdateCaret() {
rtCaret.left = rtClient.right() - 1;
rtCaret.width = right - rtCaret.left;
}
- FX_BOOL bIntersect = !rtCaret.IsEmpty();
- FX_BOOL bShow = TRUE;
- FX_BOOL bShowWhole = FALSE;
+ bool bIntersect = !rtCaret.IsEmpty();
+ bool bShow = true;
+ bool bShowWhole = false;
if (!(m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) || !bIntersect) {
- bShow = FALSE;
+ bShow = false;
}
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_HSelfAdaption &&
temp.right() > m_rtEngine.right()) {
- bShowWhole = TRUE;
+ bShowWhole = true;
}
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_VSelfAdaption &&
temp.bottom() > m_rtEngine.bottom()) {
- bShowWhole = TRUE;
+ bShowWhole = true;
} else {
bShow = (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused && bIntersect);
}
@@ -1191,10 +1188,10 @@ void IFWL_Edit::UpdateCaret() {
ShowCaret(bShow, &rtCaret);
}
IFWL_ScrollBar* IFWL_Edit::UpdateScroll() {
- FX_BOOL bShowHorz =
+ bool bShowHorz =
m_pHorzScrollBar &&
((m_pHorzScrollBar->GetStates() & FWL_WGTSTATE_Invisible) == 0);
- FX_BOOL bShowVert =
+ bool bShowVert =
m_pVertScrollBar &&
((m_pVertScrollBar->GetStates() & FWL_WGTSTATE_Invisible) == 0);
if (!bShowHorz && !bShowVert) {
@@ -1223,14 +1220,14 @@ IFWL_ScrollBar* IFWL_Edit::UpdateScroll() {
m_pHorzScrollBar->SetTrackPos(fPos);
m_pHorzScrollBar->SetPageSize(rtScroll.width);
m_pHorzScrollBar->SetStepSize(rtScroll.width / 10);
- m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Disabled, FALSE);
+ m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Disabled, false);
m_pHorzScrollBar->UnlockUpdate();
m_pHorzScrollBar->Update();
pRepaint = m_pHorzScrollBar.get();
} else if ((m_pHorzScrollBar->GetStates() & FWL_WGTSTATE_Disabled) == 0) {
m_pHorzScrollBar->LockUpdate();
m_pHorzScrollBar->SetRange(0, -1);
- m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Disabled, TRUE);
+ m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Disabled, true);
m_pHorzScrollBar->UnlockUpdate();
m_pHorzScrollBar->Update();
pRepaint = m_pHorzScrollBar.get();
@@ -1258,14 +1255,14 @@ IFWL_ScrollBar* IFWL_Edit::UpdateScroll() {
m_pVertScrollBar->SetTrackPos(fPos);
m_pVertScrollBar->SetPageSize(rtScroll.height);
m_pVertScrollBar->SetStepSize(fStep);
- m_pVertScrollBar->SetStates(FWL_WGTSTATE_Disabled, FALSE);
+ m_pVertScrollBar->SetStates(FWL_WGTSTATE_Disabled, false);
m_pVertScrollBar->UnlockUpdate();
m_pVertScrollBar->Update();
pRepaint = m_pVertScrollBar.get();
} else if ((m_pVertScrollBar->GetStates() & FWL_WGTSTATE_Disabled) == 0) {
m_pVertScrollBar->LockUpdate();
m_pVertScrollBar->SetRange(0, -1);
- m_pVertScrollBar->SetStates(FWL_WGTSTATE_Disabled, TRUE);
+ m_pVertScrollBar->SetStates(FWL_WGTSTATE_Disabled, true);
m_pVertScrollBar->UnlockUpdate();
m_pVertScrollBar->Update();
pRepaint = m_pVertScrollBar.get();
@@ -1273,12 +1270,12 @@ IFWL_ScrollBar* IFWL_Edit::UpdateScroll() {
}
return pRepaint;
}
-FX_BOOL IFWL_Edit::IsShowScrollBar(FX_BOOL bVert) {
- FX_BOOL bShow =
+bool IFWL_Edit::IsShowScrollBar(bool bVert) {
+ bool bShow =
(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ShowScrollbarFocus)
? (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) ==
FWL_WGTSTATE_Focused
- : TRUE;
+ : true;
if (bVert) {
return bShow && (m_pProperties->m_dwStyles & FWL_WGTSTYLE_VScroll) &&
(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_MultiLine) &&
@@ -1287,12 +1284,12 @@ FX_BOOL IFWL_Edit::IsShowScrollBar(FX_BOOL bVert) {
return bShow && (m_pProperties->m_dwStyles & FWL_WGTSTYLE_HScroll) &&
(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_MultiLine);
}
-FX_BOOL IFWL_Edit::IsContentHeightOverflow() {
+bool IFWL_Edit::IsContentHeightOverflow() {
if (!m_pEdtEngine)
- return FALSE;
+ return false;
IFDE_TxtEdtPage* pPage = m_pEdtEngine->GetPage(0);
if (!pPage)
- return FALSE;
+ return false;
return pPage->GetContentsBox().height > m_rtEngine.height + 1.0f;
}
int32_t IFWL_Edit::AddDoRecord(IFDE_TxtEdtDoRecord* pRecord) {
@@ -1337,8 +1334,8 @@ void IFWL_Edit::Layout() {
pUIMargin->height);
}
}
- FX_BOOL bShowVertScrollbar = IsShowScrollBar(TRUE);
- FX_BOOL bShowHorzScrollbar = IsShowScrollBar(FALSE);
+ bool bShowVertScrollbar = IsShowScrollBar(true);
+ bool bShowHorzScrollbar = IsShowScrollBar(false);
if (bShowVertScrollbar) {
InitScrollBar();
CFX_RectF rtVertScr;
@@ -1354,13 +1351,13 @@ void IFWL_Edit::Layout() {
m_rtEngine.width -= fWidth;
}
m_pVertScrollBar->SetWidgetRect(rtVertScr);
- m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, FALSE);
+ m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, false);
m_pVertScrollBar->Update();
} else if (m_pVertScrollBar) {
- m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, TRUE);
+ m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, true);
}
if (bShowHorzScrollbar) {
- InitScrollBar(FALSE);
+ InitScrollBar(false);
CFX_RectF rtHoriScr;
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_OuterScrollbar) {
rtHoriScr.Set(m_rtClient.left, m_rtClient.bottom() + kEditMargin,
@@ -1374,10 +1371,10 @@ void IFWL_Edit::Layout() {
m_rtEngine.height -= fWidth;
}
m_pHorzScrollBar->SetWidgetRect(rtHoriScr);
- m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, FALSE);
+ m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, false);
m_pHorzScrollBar->Update();
} else if (m_pHorzScrollBar) {
- m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, TRUE);
+ m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, true);
}
}
void IFWL_Edit::LayoutScrollBar() {
@@ -1386,8 +1383,8 @@ void IFWL_Edit::LayoutScrollBar() {
return;
}
FX_FLOAT* pfWidth = nullptr;
- FX_BOOL bShowVertScrollbar = IsShowScrollBar(TRUE);
- FX_BOOL bShowHorzScrollbar = IsShowScrollBar(FALSE);
+ bool bShowVertScrollbar = IsShowScrollBar(true);
+ bool bShowHorzScrollbar = IsShowScrollBar(false);
if (bShowVertScrollbar) {
if (!m_pVertScrollBar) {
pfWidth = static_cast<FX_FLOAT*>(
@@ -1408,9 +1405,9 @@ void IFWL_Edit::LayoutScrollBar() {
m_pVertScrollBar->SetWidgetRect(rtVertScr);
m_pVertScrollBar->Update();
}
- m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, FALSE);
+ m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, false);
} else if (m_pVertScrollBar) {
- m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, TRUE);
+ m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, true);
}
if (bShowHorzScrollbar) {
if (!m_pHorzScrollBar) {
@@ -1419,7 +1416,7 @@ void IFWL_Edit::LayoutScrollBar() {
GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth));
}
FX_FLOAT fWidth = pfWidth ? *pfWidth : 0;
- InitScrollBar(FALSE);
+ InitScrollBar(false);
CFX_RectF rtHoriScr;
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_OuterScrollbar) {
rtHoriScr.Set(m_rtClient.left, m_rtClient.bottom() + kEditMargin,
@@ -1434,9 +1431,9 @@ void IFWL_Edit::LayoutScrollBar() {
m_pHorzScrollBar->SetWidgetRect(rtHoriScr);
m_pHorzScrollBar->Update();
}
- m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, FALSE);
+ m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, false);
} else if (m_pHorzScrollBar) {
- m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, TRUE);
+ m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, true);
}
if (bShowVertScrollbar || bShowHorzScrollbar) {
UpdateScroll();
@@ -1448,7 +1445,7 @@ void IFWL_Edit::DeviceToEngine(CFX_PointF& pt) {
pt.y += m_fScrollOffsetY - m_rtEngine.top - m_fVAlignOffset;
}
-void IFWL_Edit::InitScrollBar(FX_BOOL bVert) {
+void IFWL_Edit::InitScrollBar(bool bVert) {
if ((bVert && m_pVertScrollBar) || (!bVert && m_pHorzScrollBar)) {
return;
}
@@ -1470,18 +1467,18 @@ void IFWL_Edit::InitEngine() {
m_pEdtEngine.reset(new CFDE_TxtEdtEngine);
}
-FX_BOOL FWL_ShowCaret(IFWL_Widget* pWidget,
- FX_BOOL bVisible,
- const CFX_RectF* pRtAnchor) {
+bool FWL_ShowCaret(IFWL_Widget* pWidget,
+ bool bVisible,
+ const CFX_RectF* pRtAnchor) {
CXFA_FFWidget* pXFAWidget =
static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem());
if (!pXFAWidget)
- return FALSE;
+ return false;
IXFA_DocEnvironment* pDocEnvironment =
pXFAWidget->GetDoc()->GetDocEnvironment();
if (!pDocEnvironment)
- return FALSE;
+ return false;
if (bVisible) {
CFX_Matrix mt;
@@ -1489,13 +1486,13 @@ FX_BOOL FWL_ShowCaret(IFWL_Widget* pWidget,
CFX_RectF rt(*pRtAnchor);
mt.TransformRect(rt);
pDocEnvironment->DisplayCaret(pXFAWidget, bVisible, &rt);
- return TRUE;
+ return true;
}
pDocEnvironment->DisplayCaret(pXFAWidget, bVisible, pRtAnchor);
- return TRUE;
+ return true;
}
-void IFWL_Edit::ShowCaret(FX_BOOL bVisible, CFX_RectF* pRect) {
+void IFWL_Edit::ShowCaret(bool bVisible, CFX_RectF* pRect) {
if (m_pCaret) {
m_pCaret->ShowCaret(bVisible);
if (bVisible && !pRect->IsEmpty()) {
@@ -1519,40 +1516,40 @@ void IFWL_Edit::ShowCaret(FX_BOOL bVisible, CFX_RectF* pRect) {
FWL_ShowCaret(pOuter, bVisible, pRect);
}
}
-FX_BOOL IFWL_Edit::ValidateNumberChar(FX_WCHAR cNum) {
+bool IFWL_Edit::ValidateNumberChar(FX_WCHAR cNum) {
if (!m_pEdtEngine) {
- return FALSE;
+ return false;
}
if (!m_bSetRange) {
- return TRUE;
+ return true;
}
CFX_WideString wsOld, wsText;
m_pEdtEngine->GetText(wsText, 0);
if (wsText.IsEmpty()) {
if (cNum == L'0') {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
int32_t caretPos = m_pEdtEngine->GetCaretPos();
int32_t iSel = CountSelRanges();
if (iSel == 0) {
if (cNum == L'0' && caretPos == 0) {
- return FALSE;
+ return false;
}
int32_t nLen = wsText.GetLength();
CFX_WideString l = wsText.Mid(0, caretPos);
CFX_WideString r = wsText.Mid(caretPos, nLen - caretPos);
CFX_WideString wsNew = l + cNum + r;
if (wsNew.GetInteger() <= m_iMax) {
- return TRUE;
+ return true;
}
} else {
if (wsText.GetInteger() <= m_iMax) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void IFWL_Edit::InitCaret() {
if (!m_pCaret) {
@@ -1670,7 +1667,7 @@ void IFWL_Edit::DoDeactivate(CFWL_MsgDeactivate* pMsg) {
void IFWL_Edit::DoButtonDown(CFWL_MsgMouse* pMsg) {
if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0)
- SetFocus(TRUE);
+ SetFocus(true);
if (!m_pEdtEngine)
UpdateEditEngine();
@@ -1679,7 +1676,7 @@ void IFWL_Edit::DoButtonDown(CFWL_MsgMouse* pMsg) {
return;
CFX_PointF pt(pMsg->m_fx, pMsg->m_fy);
DeviceToEngine(pt);
- FX_BOOL bBefore = TRUE;
+ bool bBefore = true;
int32_t nIndex = pPage->GetCharIndex(pt, bBefore);
if (nIndex < 0)
nIndex = 0;
@@ -1687,7 +1684,7 @@ void IFWL_Edit::DoButtonDown(CFWL_MsgMouse* pMsg) {
m_pEdtEngine->SetCaretPos(nIndex, bBefore);
}
-void IFWL_Edit::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
+void IFWL_Edit::OnFocusChanged(CFWL_Message* pMsg, bool bSet) {
uint32_t dwStyleEx = GetStylesEx();
bool bRepaint = !!(dwStyleEx & FWL_STYLEEXT_EDT_InnerCaret);
if (bSet) {
@@ -1700,12 +1697,12 @@ void IFWL_Edit::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
UpdateCaret();
} else if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) {
m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
- ShowCaret(FALSE);
+ ShowCaret(false);
if (m_pEdtEngine && (dwStyleEx & FWL_STYLEEXT_EDT_NoHideSel) == 0) {
int32_t nSel = CountSelRanges();
if (nSel > 0) {
ClearSelections();
- bRepaint = TRUE;
+ bRepaint = true;
}
SetCaretPos(0);
UpdateOffset();
@@ -1725,15 +1722,15 @@ void IFWL_Edit::OnLButtonDown(CFWL_MsgMouse* pMsg) {
if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)
return;
- m_bLButtonDown = TRUE;
- SetGrab(TRUE);
+ m_bLButtonDown = true;
+ SetGrab(true);
DoButtonDown(pMsg);
int32_t nIndex = m_pEdtEngine->GetCaretPos();
- FX_BOOL bRepaint = FALSE;
+ bool bRepaint = false;
int32_t iCount = m_pEdtEngine->CountSelRanges();
if (iCount > 0) {
m_pEdtEngine->ClearSelection();
- bRepaint = TRUE;
+ bRepaint = true;
}
bool bShift = !!(pMsg->m_dwFlags & FWL_KEYFLAG_Shift);
@@ -1741,7 +1738,7 @@ void IFWL_Edit::OnLButtonDown(CFWL_MsgMouse* pMsg) {
int32_t iStart = std::min(m_nSelStart, nIndex);
int32_t iEnd = std::max(m_nSelStart, nIndex);
m_pEdtEngine->AddSelRange(iStart, iEnd - iStart);
- bRepaint = TRUE;
+ bRepaint = true;
} else {
m_nSelStart = nIndex;
}
@@ -1750,8 +1747,8 @@ void IFWL_Edit::OnLButtonDown(CFWL_MsgMouse* pMsg) {
}
void IFWL_Edit::OnLButtonUp(CFWL_MsgMouse* pMsg) {
- m_bLButtonDown = FALSE;
- SetGrab(FALSE);
+ m_bLButtonDown = false;
+ SetGrab(false);
}
void IFWL_Edit::OnButtonDblClk(CFWL_MsgMouse* pMsg) {
@@ -1770,7 +1767,7 @@ void IFWL_Edit::OnButtonDblClk(CFWL_MsgMouse* pMsg) {
return;
m_pEdtEngine->AddSelRange(nIndex, nCount);
- m_pEdtEngine->SetCaretPos(nIndex + nCount - 1, FALSE);
+ m_pEdtEngine->SetCaretPos(nIndex + nCount - 1, false);
Repaint(&m_rtEngine);
}
@@ -1786,7 +1783,7 @@ void IFWL_Edit::OnMouseMove(CFWL_MsgMouse* pMsg) {
CFX_PointF pt(pMsg->m_fx, pMsg->m_fy);
DeviceToEngine(pt);
- FX_BOOL bBefore = TRUE;
+ bool bBefore = true;
int32_t nIndex = pPage->GetCharIndex(pt, bBefore);
m_pEdtEngine->SetCaretPos(nIndex, bBefore);
nIndex = m_pEdtEngine->GetCaretPos();
@@ -1843,7 +1840,7 @@ void IFWL_Edit::OnKeyDown(CFWL_MsgKey* pMsg) {
}
int32_t nCaret = m_pEdtEngine->GetCaretPos();
#if (_FX_OS_ == _FX_MACOSX_)
- m_pEdtEngine->Delete(nCaret, TRUE);
+ m_pEdtEngine->Delete(nCaret, true);
#else
m_pEdtEngine->Delete(nCaret);
#endif
@@ -1893,7 +1890,7 @@ void IFWL_Edit::OnChar(CFWL_MsgKey* pMsg) {
int32_t nCaret = m_pEdtEngine->GetCaretPos();
switch (c) {
case FWL_VKEY_Back:
- m_pEdtEngine->Delete(nCaret, TRUE);
+ m_pEdtEngine->Delete(nCaret, true);
break;
case 0x0A:
break;
@@ -1937,9 +1934,9 @@ void IFWL_Edit::OnChar(CFWL_MsgKey* pMsg) {
ProcessInsertError(iError);
}
-FX_BOOL IFWL_Edit::OnScroll(IFWL_ScrollBar* pScrollBar,
- uint32_t dwCode,
- FX_FLOAT fPos) {
+bool IFWL_Edit::OnScroll(IFWL_ScrollBar* pScrollBar,
+ uint32_t dwCode,
+ FX_FLOAT fPos) {
CFX_SizeF fs;
pScrollBar->GetRange(fs.x, fs.y);
FX_FLOAT iCurPos = pScrollBar->GetPos();
@@ -1985,7 +1982,7 @@ FX_BOOL IFWL_Edit::OnScroll(IFWL_ScrollBar* pScrollBar,
case FWL_SCBCODE_TrackPos:
break;
case FWL_SCBCODE_EndScroll:
- return FALSE;
+ return false;
default:
break;
}
@@ -2002,5 +1999,5 @@ FX_BOOL IFWL_Edit::OnScroll(IFWL_ScrollBar* pScrollBar,
rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2);
Repaint(&rtInvalidate);
}
- return TRUE;
+ return true;
}
diff --git a/xfa/fwl/core/ifwl_edit.h b/xfa/fwl/core/ifwl_edit.h
index 9959e42ba5..c210ac20c5 100644
--- a/xfa/fwl/core/ifwl_edit.h
+++ b/xfa/fwl/core/ifwl_edit.h
@@ -70,24 +70,24 @@ FWL_EVENT_DEF(CFWL_EvtEdtTextFull, CFWL_EventType::TextFull)
FWL_EVENT_DEF(CFWL_EvtEdtPreSelfAdaption,
CFWL_EventType::PreSelfAdaption,
- FX_BOOL bHSelfAdaption;
- FX_BOOL bVSelfAdaption;
+ bool bHSelfAdaption;
+ bool bVSelfAdaption;
CFX_RectF rtAfterChange;)
FWL_EVENT_DEF(CFWL_EvtEdtValidate,
CFWL_EventType::Validate,
IFWL_Widget* pDstWidget;
CFX_WideString wsInsert;
- FX_BOOL bValidate;)
+ bool bValidate;)
FWL_EVENT_DEF(CFWL_EvtEdtCheckWord,
CFWL_EventType::CheckWord,
CFX_ByteString bsWord;
- FX_BOOL bCheckWord;)
+ bool bCheckWord;)
FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords,
CFWL_EventType::GetSuggestedWords,
- FX_BOOL bSuggestWords;
+ bool bSuggestWords;
CFX_ByteString bsWord;
std::vector<CFX_ByteString> bsArraySuggestWords;)
@@ -111,11 +111,11 @@ class IFWL_Edit : public IFWL_Widget {
// IFWL_Widget:
FWL_Type GetClassID() const override;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
FWL_Error SetWidgetRect(const CFX_RectF& rect) override;
FWL_Error Update() override;
FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override;
- void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE) override;
+ void SetStates(uint32_t dwStates, bool bSet = true) override;
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr) override;
FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override;
@@ -131,7 +131,7 @@ class IFWL_Edit : public IFWL_Widget {
int32_t nCount = -1) const;
virtual FWL_Error ClearText();
virtual int32_t GetCaretPos() const;
- virtual int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE);
+ virtual int32_t SetCaretPos(int32_t nIndex, bool bBefore = true);
virtual FWL_Error AddSelRange(int32_t nStart, int32_t nCount = -1);
virtual int32_t CountSelRanges();
virtual int32_t GetSelRange(int32_t nIndex, int32_t& nStart);
@@ -148,17 +148,17 @@ class IFWL_Edit : public IFWL_Widget {
int32_t nLen,
const CFX_WideStringC& wsReplace);
virtual FWL_Error DoClipboard(int32_t iCmd);
- virtual FX_BOOL Copy(CFX_WideString& wsCopy);
- virtual FX_BOOL Cut(CFX_WideString& wsCut);
- virtual FX_BOOL Paste(const CFX_WideString& wsPaste);
- virtual FX_BOOL Delete();
- virtual FX_BOOL Redo(const IFDE_TxtEdtDoRecord* pRecord);
- virtual FX_BOOL Undo(const IFDE_TxtEdtDoRecord* pRecord);
- virtual FX_BOOL Undo();
- virtual FX_BOOL Redo();
- virtual FX_BOOL CanUndo();
- virtual FX_BOOL CanRedo();
- virtual FWL_Error SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant);
+ virtual bool Copy(CFX_WideString& wsCopy);
+ virtual bool Cut(CFX_WideString& wsCut);
+ virtual bool Paste(const CFX_WideString& wsPaste);
+ virtual bool Delete();
+ virtual bool Redo(const IFDE_TxtEdtDoRecord* pRecord);
+ virtual bool Undo(const IFDE_TxtEdtDoRecord* pRecord);
+ virtual bool Undo();
+ virtual bool Redo();
+ virtual bool CanUndo();
+ virtual bool CanRedo();
+ virtual FWL_Error SetTabWidth(FX_FLOAT fTabWidth, bool bEquidistant);
virtual FWL_Error SetOuter(IFWL_Widget* pOuter);
virtual FWL_Error SetNumberRange(int32_t iMin, int32_t iMax);
virtual FWL_Error SetBackgroundColor(uint32_t color);
@@ -166,23 +166,23 @@ class IFWL_Edit : public IFWL_Widget {
void On_CaretChanged(CFDE_TxtEdtEngine* pEdit,
int32_t nPage,
- FX_BOOL bVisible = true);
+ bool bVisible = true);
void On_TextChanged(CFDE_TxtEdtEngine* pEdit,
FDE_TXTEDT_TEXTCHANGE_INFO& ChangeInfo);
void On_SelChanged(CFDE_TxtEdtEngine* pEdit);
- FX_BOOL On_PageLoad(CFDE_TxtEdtEngine* pEdit,
- int32_t nPageIndex,
- int32_t nPurpose);
- FX_BOOL On_PageUnload(CFDE_TxtEdtEngine* pEdit,
- int32_t nPageIndex,
- int32_t nPurpose);
+ bool On_PageLoad(CFDE_TxtEdtEngine* pEdit,
+ int32_t nPageIndex,
+ int32_t nPurpose);
+ bool On_PageUnload(CFDE_TxtEdtEngine* pEdit,
+ int32_t nPageIndex,
+ int32_t nPurpose);
void On_AddDoRecord(CFDE_TxtEdtEngine* pEdit, IFDE_TxtEdtDoRecord* pRecord);
- FX_BOOL On_Validate(CFDE_TxtEdtEngine* pEdit, CFX_WideString& wsText);
+ bool On_Validate(CFDE_TxtEdtEngine* pEdit, CFX_WideString& wsText);
void SetScrollOffset(FX_FLOAT fScrollOffset);
- FX_BOOL GetSuggestWords(CFX_PointF pointf,
- std::vector<CFX_ByteString>& sSuggest);
- FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf,
- const CFX_ByteStringC& bsReplace);
+ bool GetSuggestWords(CFX_PointF pointf,
+ std::vector<CFX_ByteString>& sSuggest);
+ bool ReplaceSpellCheckWord(CFX_PointF pointf,
+ const CFX_ByteStringC& bsReplace);
protected:
friend class CFWL_TxtEdtEventSink;
@@ -196,22 +196,22 @@ class IFWL_Edit : public IFWL_Widget {
void UpdateEditEngine();
void UpdateEditParams();
void UpdateEditLayout();
- FX_BOOL UpdateOffset();
- FX_BOOL UpdateOffset(IFWL_ScrollBar* pScrollBar, FX_FLOAT fPosChanged);
+ bool UpdateOffset();
+ bool UpdateOffset(IFWL_ScrollBar* pScrollBar, FX_FLOAT fPosChanged);
void UpdateVAlignment();
void UpdateCaret();
IFWL_ScrollBar* UpdateScroll();
void Layout();
void LayoutScrollBar();
void DeviceToEngine(CFX_PointF& pt);
- void InitScrollBar(FX_BOOL bVert = TRUE);
+ void InitScrollBar(bool bVert = true);
void InitEngine();
- virtual void ShowCaret(FX_BOOL bVisible, CFX_RectF* pRect = nullptr);
- FX_BOOL ValidateNumberChar(FX_WCHAR cNum);
+ virtual void ShowCaret(bool bVisible, CFX_RectF* pRect = nullptr);
+ bool ValidateNumberChar(FX_WCHAR cNum);
void InitCaret();
void ClearRecord();
- FX_BOOL IsShowScrollBar(FX_BOOL bVert);
- FX_BOOL IsContentHeightOverflow();
+ bool IsShowScrollBar(bool bVert);
+ bool IsContentHeightOverflow();
int32_t AddDoRecord(IFDE_TxtEdtDoRecord* pRecord);
void ProcessInsertError(int32_t iError);
@@ -231,14 +231,14 @@ class IFWL_Edit : public IFWL_Widget {
FX_FLOAT m_fScrollOffsetX;
FX_FLOAT m_fScrollOffsetY;
std::unique_ptr<CFDE_TxtEdtEngine> m_pEdtEngine;
- FX_BOOL m_bLButtonDown;
+ bool m_bLButtonDown;
int32_t m_nSelStart;
int32_t m_nLimit;
FX_FLOAT m_fSpaceAbove;
FX_FLOAT m_fSpaceBelow;
FX_FLOAT m_fFontSize;
FX_ARGB m_argbSel;
- FX_BOOL m_bSetRange;
+ bool m_bSetRange;
int32_t m_iMin;
int32_t m_iMax;
std::unique_ptr<IFWL_ScrollBar> m_pVertScrollBar;
@@ -246,7 +246,7 @@ class IFWL_Edit : public IFWL_Widget {
std::unique_ptr<IFWL_Caret> m_pCaret;
CFX_WideString m_wsCache;
uint32_t m_backColor;
- FX_BOOL m_updateBackColor;
+ bool m_updateBackColor;
CFX_WideString m_wsFont;
std::deque<std::unique_ptr<IFDE_TxtEdtDoRecord>> m_DoRecords;
int32_t m_iCurRecord;
@@ -256,14 +256,14 @@ class IFWL_Edit : public IFWL_Widget {
void DoActivate(CFWL_MsgActivate* pMsg);
void DoDeactivate(CFWL_MsgDeactivate* pMsg);
void DoButtonDown(CFWL_MsgMouse* pMsg);
- void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet);
+ void OnFocusChanged(CFWL_Message* pMsg, bool bSet);
void OnLButtonDown(CFWL_MsgMouse* pMsg);
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnButtonDblClk(CFWL_MsgMouse* pMsg);
void OnMouseMove(CFWL_MsgMouse* pMsg);
void OnKeyDown(CFWL_MsgKey* pMsg);
void OnChar(CFWL_MsgKey* pMsg);
- FX_BOOL OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos);
+ bool OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos);
};
#endif // XFA_FWL_CORE_IFWL_EDIT_H_
diff --git a/xfa/fwl/core/ifwl_form.cpp b/xfa/fwl/core/ifwl_form.cpp
index 60213549f7..ab6887fec8 100644
--- a/xfa/fwl/core/ifwl_form.cpp
+++ b/xfa/fwl/core/ifwl_form.cpp
@@ -51,15 +51,15 @@ IFWL_Form::IFWL_Form(const IFWL_App* app,
m_iCaptureBtn(-1),
m_iSysBox(0),
m_eResizeType(FORM_RESIZETYPE_None),
- m_bLButtonDown(FALSE),
+ m_bLButtonDown(false),
m_bMaximized(false),
- m_bSetMaximize(FALSE),
+ m_bSetMaximize(false),
m_bCustomizeLayout(false),
m_eFormSize(FWL_FORMSIZE_Manual),
- m_bDoModalFlag(FALSE),
+ m_bDoModalFlag(false),
m_pBigIcon(nullptr),
m_pSmallIcon(nullptr),
- m_bMouseIn(FALSE) {
+ m_bMouseIn(false) {
m_rtRelative.Reset();
m_rtCaption.Reset();
m_rtRestore.Reset();
@@ -80,18 +80,18 @@ FWL_Type IFWL_Form::GetClassID() const {
return FWL_Type::Form;
}
-FX_BOOL IFWL_Form::IsInstance(const CFX_WideStringC& wsClass) const {
+bool IFWL_Form::IsInstance(const CFX_WideStringC& wsClass) const {
if (wsClass == CFX_WideStringC(FWL_CLASS_Form))
- return TRUE;
+ return true;
return IFWL_Widget::IsInstance(wsClass);
}
-FWL_Error IFWL_Form::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error IFWL_Form::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
rect.Reset();
FX_FLOAT fCapHeight = GetCaptionHeight();
- FX_FLOAT fCXBorder = GetBorderSize(TRUE);
- FX_FLOAT fCYBorder = GetBorderSize(FALSE);
+ FX_FLOAT fCXBorder = GetBorderSize(true);
+ FX_FLOAT fCYBorder = GetBorderSize(false);
FX_FLOAT fEdge = GetEdgeWidth();
rect.height += fCapHeight + fCYBorder + fEdge + fEdge;
rect.width += fCXBorder + fCXBorder + fEdge + fEdge;
@@ -213,7 +213,7 @@ FWL_Error IFWL_Form::DrawWidget(CFX_Graphics* pGraphics,
if (!m_pProperties->m_pThemeProvider)
return FWL_Error::Indefinite;
IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
- FX_BOOL bInactive = !IsActive();
+ bool bInactive = !IsActive();
int32_t iState = bInactive ? CFWL_PartState_Inactive : CFWL_PartState_Normal;
if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_NoDrawClient) == 0) {
DrawBackground(pGraphics, pTheme);
@@ -297,7 +297,7 @@ FWL_Error IFWL_Form::DrawWidget(CFX_Graphics* pGraphics,
param.m_rtPart = m_pMinBox->m_rtBtn;
pTheme->DrawBackground(&param);
}
- m_bMouseIn = FALSE;
+ m_bMouseIn = false;
}
#else
{
@@ -345,8 +345,8 @@ IFWL_Widget* IFWL_Form::DoModal() {
m_pNoteLoop.reset(new CFWL_NoteLoop(this));
pDriver->PushNoteLoop(m_pNoteLoop.get());
- m_bDoModalFlag = TRUE;
- SetStates(FWL_WGTSTATE_Invisible, FALSE);
+ m_bDoModalFlag = true;
+ SetStates(FWL_WGTSTATE_Invisible, false);
pDriver->Run();
#if (_FX_OS_ == _FX_MACOSX_)
#else
@@ -363,7 +363,7 @@ IFWL_Widget* IFWL_Form::DoModal(uint32_t& dwCommandID) {
FWL_Error IFWL_Form::EndDoModal() {
if (!m_pNoteLoop)
return FWL_Error::Indefinite;
- m_bDoModalFlag = FALSE;
+ m_bDoModalFlag = false;
#if (_FX_OS_ == _FX_MACOSX_)
m_pNoteLoop->EndModalLoop();
const IFWL_App* pApp = GetOwnerApp();
@@ -376,10 +376,10 @@ FWL_Error IFWL_Form::EndDoModal() {
return FWL_Error::Indefinite;
pDriver->PopNoteLoop();
- SetStates(FWL_WGTSTATE_Invisible, TRUE);
+ SetStates(FWL_WGTSTATE_Invisible, true);
return FWL_Error::Succeeded;
#else
- SetStates(FWL_WGTSTATE_Invisible, TRUE);
+ SetStates(FWL_WGTSTATE_Invisible, true);
return m_pNoteLoop->EndModalLoop();
#endif
}
@@ -561,7 +561,7 @@ void IFWL_Form::DrawIconImage(CFX_Graphics* pGs,
param.m_pWidget = this;
param.m_iPart = CFWL_Part::Icon;
param.m_pGraphics = pGs;
- param.m_pImage = pData->GetIcon(this, FALSE);
+ param.m_pImage = pData->GetIcon(this, false);
param.m_rtPart = m_rtIcon;
if (pMatrix) {
param.m_matrix.Concat(*pMatrix);
@@ -572,7 +572,7 @@ void IFWL_Form::GetEdgeRect(CFX_RectF& rtEdge) {
rtEdge = m_rtRelative;
if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) {
FX_FLOAT fCX = GetBorderSize();
- FX_FLOAT fCY = GetBorderSize(FALSE);
+ FX_FLOAT fCY = GetBorderSize(false);
rtEdge.Deflate(fCX, m_rtCaption.Height(), fCX, fCY);
}
}
@@ -581,7 +581,7 @@ void IFWL_Form::SetWorkAreaRect() {
CFWL_WidgetMgr* pWidgetMgr = GetOwnerApp()->GetWidgetMgr();
if (!pWidgetMgr)
return;
- m_bSetMaximize = TRUE;
+ m_bSetMaximize = true;
Repaint(&m_rtRelative);
}
void IFWL_Form::SetCursor(FX_FLOAT fx, FX_FLOAT fy) {}
@@ -651,7 +651,7 @@ void IFWL_Form::ReSetSysBtn() {
IFWL_FormDP* pData =
static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider);
if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Icon &&
- pData->GetIcon(this, FALSE)) {
+ pData->GetIcon(this, false)) {
if (!m_bCustomizeLayout) {
m_rtIcon.Set(5, (m_rtCaption.height - m_fSmallIconSz) / 2, m_fSmallIconSz,
m_fSmallIconSz);
@@ -682,7 +682,7 @@ void IFWL_Form::UnRegisterForm() {
pDriver->UnRegisterForm(this);
}
-FX_BOOL IFWL_Form::IsDoModal() {
+bool IFWL_Form::IsDoModal() {
return m_bDoModalFlag;
}
void IFWL_Form::SetThemeData() {
@@ -691,10 +691,10 @@ void IFWL_Form::SetThemeData() {
m_fBigIconSz =
*static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::BigIcon));
}
-FX_BOOL IFWL_Form::HasIcon() {
+bool IFWL_Form::HasIcon() {
IFWL_FormDP* pData =
static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider);
- return !!pData->GetIcon(this, FALSE);
+ return !!pData->GetIcon(this, false);
}
void IFWL_Form::UpdateIcon() {
CFWL_WidgetMgr* pWidgetMgr = GetOwnerApp()->GetWidgetMgr();
@@ -702,8 +702,8 @@ void IFWL_Form::UpdateIcon() {
return;
IFWL_FormDP* pData =
static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider);
- CFX_DIBitmap* pBigIcon = pData->GetIcon(this, TRUE);
- CFX_DIBitmap* pSmallIcon = pData->GetIcon(this, FALSE);
+ CFX_DIBitmap* pBigIcon = pData->GetIcon(this, true);
+ CFX_DIBitmap* pSmallIcon = pData->GetIcon(this, false);
if (pBigIcon)
m_pBigIcon = pBigIcon;
if (pSmallIcon)
@@ -725,7 +725,7 @@ void IFWL_Form::DoWidthLimit(FX_FLOAT& fLeft,
FX_FLOAT fSpace,
FX_FLOAT fLimitMin,
FX_FLOAT fLimitMax,
- FX_BOOL bLeft) {
+ bool bLeft) {
FX_FLOAT fx = fCurX;
FX_FLOAT fy = 0;
TransformTo(nullptr, fx, fy);
@@ -750,7 +750,7 @@ void IFWL_Form::DoHeightLimit(FX_FLOAT& fTop,
FX_FLOAT fSpace,
FX_FLOAT fLimitMin,
FX_FLOAT fLimitMax,
- FX_BOOL bTop) {
+ bool bTop) {
FX_FLOAT fx = 0;
FX_FLOAT fy = fCurY;
TransformTo(nullptr, fx, fy);
@@ -861,7 +861,7 @@ void IFWL_Form::OnProcessMessage(CFWL_Message* pMessage) {
if (!m_bSetMaximize)
break;
- m_bSetMaximize = FALSE;
+ m_bSetMaximize = false;
CFWL_MsgSize* pMsg = static_cast<CFWL_MsgSize*>(pMessage);
m_pProperties->m_rtWidget.left = 0;
m_pProperties->m_rtWidget.top = 0;
@@ -888,8 +888,8 @@ void IFWL_Form::OnDrawWidget(CFX_Graphics* pGraphics,
}
void IFWL_Form::OnLButtonDown(CFWL_MsgMouse* pMsg) {
- SetGrab(TRUE);
- m_bLButtonDown = TRUE;
+ SetGrab(true);
+ m_bLButtonDown = true;
m_eResizeType = FORM_RESIZETYPE_None;
CFWL_SysBtn* pPressBtn = GetSysBtnAtPoint(pMsg->m_fx, pMsg->m_fy);
m_iCaptureBtn = GetSysBtnIndex(pPressBtn);
@@ -914,8 +914,8 @@ void IFWL_Form::OnLButtonDown(CFWL_MsgMouse* pMsg) {
}
void IFWL_Form::OnLButtonUp(CFWL_MsgMouse* pMsg) {
- SetGrab(FALSE);
- m_bLButtonDown = FALSE;
+ SetGrab(false);
+ m_bLButtonDown = false;
CFWL_SysBtn* pPointBtn = GetSysBtnAtPoint(pMsg->m_fx, pMsg->m_fy);
CFWL_SysBtn* pPressedBtn = GetSysBtnByIndex(m_iCaptureBtn);
if (!pPressedBtn || pPointBtn != pPressedBtn)
@@ -974,7 +974,7 @@ void IFWL_Form::OnMouseMove(CFWL_MsgMouse* pMsg) {
}
if (!rtInvalidate.IsEmpty() &&
rtInvalidate.Contains(pMsg->m_fx, pMsg->m_fy)) {
- m_bMouseIn = TRUE;
+ m_bMouseIn = true;
}
}
#else
@@ -1057,7 +1057,7 @@ void CFWL_SysBtn::SetHover() {
m_dwState |= FWL_SYSBUTTONSTATE_Hover;
}
-void CFWL_SysBtn::SetDisabled(FX_BOOL bDisabled) {
+void CFWL_SysBtn::SetDisabled(bool bDisabled) {
bDisabled ? m_dwState |= FWL_SYSBUTTONSTATE_Disabled
: m_dwState &= ~FWL_SYSBUTTONSTATE_Disabled;
}
diff --git a/xfa/fwl/core/ifwl_form.h b/xfa/fwl/core/ifwl_form.h
index 76634ab513..4936af6855 100644
--- a/xfa/fwl/core/ifwl_form.h
+++ b/xfa/fwl/core/ifwl_form.h
@@ -49,7 +49,7 @@ class CFWL_SysBtn {
void SetNormal();
void SetPressed();
void SetHover();
- void SetDisabled(FX_BOOL bDisabled);
+ void SetDisabled(bool bDisabled);
CFX_RectF m_rtBtn;
uint32_t m_dwState;
@@ -79,7 +79,7 @@ class CFWL_SysBtn;
class IFWL_FormDP : public IFWL_DataProvider {
public:
- virtual CFX_DIBitmap* GetIcon(IFWL_Widget* pWidget, FX_BOOL bBig) = 0;
+ virtual CFX_DIBitmap* GetIcon(IFWL_Widget* pWidget, bool bBig) = 0;
};
class IFWL_Form : public IFWL_Widget {
@@ -91,8 +91,8 @@ class IFWL_Form : public IFWL_Widget {
// IFWL_Widget
FWL_Type GetClassID() const override;
- FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const override;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
+ bool IsInstance(const CFX_WideStringC& wsClass) const override;
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
FWL_Error GetClientRect(CFX_RectF& rect) override;
FWL_Error Update() override;
FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override;
@@ -136,9 +136,9 @@ class IFWL_Form : public IFWL_Widget {
void ReSetSysBtn();
void RegisterForm();
void UnRegisterForm();
- FX_BOOL IsDoModal();
+ bool IsDoModal();
void SetThemeData();
- FX_BOOL HasIcon();
+ bool HasIcon();
void UpdateIcon();
void UpdateCaption();
void DoWidthLimit(FX_FLOAT& fLeft,
@@ -147,14 +147,14 @@ class IFWL_Form : public IFWL_Widget {
FX_FLOAT fSpace,
FX_FLOAT fLimitMin,
FX_FLOAT fLimitMax,
- FX_BOOL bLeft);
+ bool bLeft);
void DoHeightLimit(FX_FLOAT& fTop,
FX_FLOAT& fHeight,
FX_FLOAT fCurY,
FX_FLOAT fSpace,
FX_FLOAT fLimitMin,
FX_FLOAT fLimitMax,
- FX_BOOL bTop);
+ bool bTop);
CFX_RectF m_rtRestore;
CFX_RectF m_rtCaptionText;
@@ -173,17 +173,17 @@ class IFWL_Form : public IFWL_Widget {
int32_t m_iCaptureBtn;
int32_t m_iSysBox;
int32_t m_eResizeType;
- FX_BOOL m_bLButtonDown;
+ bool m_bLButtonDown;
bool m_bMaximized;
- FX_BOOL m_bSetMaximize;
+ bool m_bSetMaximize;
bool m_bCustomizeLayout;
FWL_FORMSIZE m_eFormSize;
- FX_BOOL m_bDoModalFlag;
+ bool m_bDoModalFlag;
FX_FLOAT m_fSmallIconSz;
FX_FLOAT m_fBigIconSz;
CFX_DIBitmap* m_pBigIcon;
CFX_DIBitmap* m_pSmallIcon;
- FX_BOOL m_bMouseIn;
+ bool m_bMouseIn;
private:
void OnLButtonDown(CFWL_MsgMouse* pMsg);
diff --git a/xfa/fwl/core/ifwl_formproxy.cpp b/xfa/fwl/core/ifwl_formproxy.cpp
index 30c25827d5..d06cf0b7a6 100644
--- a/xfa/fwl/core/ifwl_formproxy.cpp
+++ b/xfa/fwl/core/ifwl_formproxy.cpp
@@ -21,9 +21,9 @@ FWL_Type IFWL_FormProxy::GetClassID() const {
return FWL_Type::FormProxy;
}
-FX_BOOL IFWL_FormProxy::IsInstance(const CFX_WideStringC& wsClass) const {
+bool IFWL_FormProxy::IsInstance(const CFX_WideStringC& wsClass) const {
if (wsClass == CFX_WideStringC(FWL_CLASS_FormProxy)) {
- return TRUE;
+ return true;
}
return IFWL_Form::IsInstance(wsClass);
}
diff --git a/xfa/fwl/core/ifwl_formproxy.h b/xfa/fwl/core/ifwl_formproxy.h
index d28208b842..7bab976307 100644
--- a/xfa/fwl/core/ifwl_formproxy.h
+++ b/xfa/fwl/core/ifwl_formproxy.h
@@ -20,7 +20,7 @@ class IFWL_FormProxy : public IFWL_Form {
// IFWL_Widget
FWL_Type GetClassID() const override;
- FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const override;
+ bool IsInstance(const CFX_WideStringC& wsClass) const override;
FWL_Error Update() override;
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr) override;
diff --git a/xfa/fwl/core/ifwl_listbox.cpp b/xfa/fwl/core/ifwl_listbox.cpp
index 5d95c749d7..b462c8e34b 100644
--- a/xfa/fwl/core/ifwl_listbox.cpp
+++ b/xfa/fwl/core/ifwl_listbox.cpp
@@ -29,7 +29,7 @@ IFWL_ListBox::IFWL_ListBox(const IFWL_App* app,
m_iTTOAligns(0),
m_hAnchor(nullptr),
m_fScorllBarWidth(0),
- m_bLButtonDown(FALSE),
+ m_bLButtonDown(false),
m_pScrollBarTP(nullptr) {
m_rtClient.Reset();
m_rtConent.Reset();
@@ -42,15 +42,15 @@ FWL_Type IFWL_ListBox::GetClassID() const {
return FWL_Type::ListBox;
}
-FWL_Error IFWL_ListBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error IFWL_ListBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
rect.Set(0, 0, 0, 0);
if (!m_pProperties->m_pThemeProvider) {
m_pProperties->m_pThemeProvider = GetAvailableTheme();
}
- CFX_SizeF fs = CalcSize(TRUE);
+ CFX_SizeF fs = CalcSize(true);
rect.Set(0, 0, fs.x, fs.y);
- IFWL_Widget::GetWidgetRect(rect, TRUE);
+ IFWL_Widget::GetWidgetRect(rect, true);
} else {
rect = m_pProperties->m_rtWidget;
}
@@ -87,13 +87,13 @@ FWL_Error IFWL_ListBox::Update() {
}
FWL_WidgetHit IFWL_ListBox::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
- if (IsShowScrollBar(FALSE)) {
+ if (IsShowScrollBar(false)) {
CFX_RectF rect;
m_pHorzScrollBar->GetWidgetRect(rect);
if (rect.Contains(fx, fy))
return FWL_WidgetHit::HScrollBar;
}
- if (IsShowScrollBar(TRUE)) {
+ if (IsShowScrollBar(true)) {
CFX_RectF rect;
m_pVertScrollBar->GetWidgetRect(rect);
if (rect.Contains(fx, fy))
@@ -119,10 +119,10 @@ FWL_Error IFWL_ListBox::DrawWidget(CFX_Graphics* pGraphics,
DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix);
}
CFX_RectF rtClip(m_rtConent);
- if (IsShowScrollBar(FALSE)) {
+ if (IsShowScrollBar(false)) {
rtClip.height -= m_fScorllBarWidth;
}
- if (IsShowScrollBar(TRUE)) {
+ if (IsShowScrollBar(true)) {
rtClip.width -= m_fScorllBarWidth;
}
if (pMatrix) {
@@ -211,7 +211,7 @@ int32_t IFWL_ListBox::GetSelIndex(int32_t nIndex) {
return -1;
}
-FWL_Error IFWL_ListBox::SetSelItem(IFWL_ListItem* pItem, FX_BOOL bSelect) {
+FWL_Error IFWL_ListBox::SetSelItem(IFWL_ListItem* pItem, bool bSelect) {
if (!m_pProperties->m_pDataProvider)
return FWL_Error::Indefinite;
if (!pItem) {
@@ -243,8 +243,8 @@ FWL_Error IFWL_ListBox::GetItemText(IFWL_ListItem* pItem,
return FWL_Error::Succeeded;
}
-FWL_Error IFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert) {
- if ((bVert && IsShowScrollBar(TRUE)) || (!bVert && IsShowScrollBar(FALSE))) {
+FWL_Error IFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, bool bVert) {
+ if ((bVert && IsShowScrollBar(true)) || (!bVert && IsShowScrollBar(false))) {
IFWL_ScrollBar* pScrollBar =
bVert ? m_pVertScrollBar.get() : m_pHorzScrollBar.get();
fPos = pScrollBar->GetPos();
@@ -285,7 +285,7 @@ IFWL_ListItem* IFWL_ListBox::GetItem(IFWL_ListItem* pItem, uint32_t dwKeyCode) {
void IFWL_ListBox::SetSelection(IFWL_ListItem* hStart,
IFWL_ListItem* hEnd,
- FX_BOOL bSelected) {
+ bool bSelected) {
IFWL_ListBoxDP* pData =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
int32_t iStart = pData->GetItemIndex(this, hStart);
@@ -299,7 +299,7 @@ void IFWL_ListBox::SetSelection(IFWL_ListItem* hStart,
int32_t iCount = pData->CountItems(this);
for (int32_t i = 0; i < iCount; i++) {
IFWL_ListItem* pItem = pData->GetItem(this, i);
- SetSelectionDirect(pItem, FALSE);
+ SetSelectionDirect(pItem, false);
}
}
for (; iStart <= iEnd; iStart++) {
@@ -308,7 +308,7 @@ void IFWL_ListBox::SetSelection(IFWL_ListItem* hStart,
}
}
-void IFWL_ListBox::SetSelectionDirect(IFWL_ListItem* pItem, FX_BOOL bSelect) {
+void IFWL_ListBox::SetSelectionDirect(IFWL_ListItem* pItem, bool bSelect) {
IFWL_ListBoxDP* pData =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
uint32_t dwOldStyle = pData->GetItemStyles(this, pItem);
@@ -317,7 +317,7 @@ void IFWL_ListBox::SetSelectionDirect(IFWL_ListItem* pItem, FX_BOOL bSelect) {
pData->SetItemStyles(this, pItem, dwOldStyle);
}
-FX_BOOL IFWL_ListBox::IsItemSelected(IFWL_ListItem* pItem) {
+bool IFWL_ListBox::IsItemSelected(IFWL_ListItem* pItem) {
IFWL_ListBoxDP* pData =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
uint32_t dwState = pData->GetItemStyles(this, pItem);
@@ -325,8 +325,7 @@ FX_BOOL IFWL_ListBox::IsItemSelected(IFWL_ListItem* pItem) {
}
void IFWL_ListBox::ClearSelection() {
- FX_BOOL bMulti =
- m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection;
+ bool bMulti = m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection;
IFWL_ListBoxDP* pData =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
int32_t iCount = pData->CountItems(this);
@@ -335,15 +334,14 @@ void IFWL_ListBox::ClearSelection() {
uint32_t dwState = pData->GetItemStyles(this, pItem);
if (!(dwState & FWL_ITEMSTATE_LTB_Selected))
continue;
- SetSelectionDirect(pItem, FALSE);
+ SetSelectionDirect(pItem, false);
if (!bMulti)
return;
}
}
void IFWL_ListBox::SelectAll() {
- FX_BOOL bMulti =
- m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection;
+ bool bMulti = m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection;
if (!bMulti) {
return;
}
@@ -353,7 +351,7 @@ void IFWL_ListBox::SelectAll() {
if (iCount > 0) {
IFWL_ListItem* pItemStart = pData->GetItem(this, 0);
IFWL_ListItem* pItemEnd = pData->GetItem(this, iCount - 1);
- SetSelection(pItemStart, pItemEnd, FALSE);
+ SetSelection(pItemStart, pItemEnd, false);
}
}
@@ -418,67 +416,66 @@ IFWL_ListItem* IFWL_ListBox::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) {
return nullptr;
}
-FX_BOOL IFWL_ListBox::GetItemCheckRect(IFWL_ListItem* pItem,
- CFX_RectF& rtCheck) {
+bool IFWL_ListBox::GetItemCheckRect(IFWL_ListItem* pItem, CFX_RectF& rtCheck) {
if (!m_pProperties->m_pDataProvider)
- return FALSE;
+ return false;
if (!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_Check)) {
- return FALSE;
+ return false;
}
IFWL_ListBoxDP* pData =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
pData->GetItemCheckRect(this, pItem, rtCheck);
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_ListBox::GetItemChecked(IFWL_ListItem* pItem) {
+bool IFWL_ListBox::GetItemChecked(IFWL_ListItem* pItem) {
if (!m_pProperties->m_pDataProvider)
- return FALSE;
+ return false;
if (!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_Check)) {
- return FALSE;
+ return false;
}
IFWL_ListBoxDP* pData =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
return !!(pData->GetItemCheckState(this, pItem) & FWL_ITEMSTATE_LTB_Checked);
}
-FX_BOOL IFWL_ListBox::SetItemChecked(IFWL_ListItem* pItem, FX_BOOL bChecked) {
+bool IFWL_ListBox::SetItemChecked(IFWL_ListItem* pItem, bool bChecked) {
if (!m_pProperties->m_pDataProvider)
- return FALSE;
+ return false;
if (!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_Check)) {
- return FALSE;
+ return false;
}
IFWL_ListBoxDP* pData =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
pData->SetItemCheckState(this, pItem,
bChecked ? FWL_ITEMSTATE_LTB_Checked : 0);
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_ListBox::ScrollToVisible(IFWL_ListItem* pItem) {
+bool IFWL_ListBox::ScrollToVisible(IFWL_ListItem* pItem) {
if (!m_pVertScrollBar)
- return FALSE;
+ return false;
CFX_RectF rtItem;
IFWL_ListBoxDP* pData =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
pData->GetItemRect(this, pItem, rtItem);
- FX_BOOL bScroll = FALSE;
+ bool bScroll = false;
FX_FLOAT fPosY = m_pVertScrollBar->GetPos();
rtItem.Offset(0, -fPosY + m_rtConent.top);
if (rtItem.top < m_rtConent.top) {
fPosY += rtItem.top - m_rtConent.top;
- bScroll = TRUE;
+ bScroll = true;
} else if (rtItem.bottom() > m_rtConent.bottom()) {
fPosY += rtItem.bottom() - m_rtConent.bottom();
- bScroll = TRUE;
+ bScroll = true;
}
if (!bScroll) {
- return FALSE;
+ return false;
}
m_pVertScrollBar->SetPos(fPosY);
m_pVertScrollBar->SetTrackPos(fPosY);
Repaint(&m_rtClient);
- return TRUE;
+ return true;
}
void IFWL_ListBox::DrawBkground(CFX_Graphics* pGraphics,
@@ -495,7 +492,7 @@ void IFWL_ListBox::DrawBkground(CFX_Graphics* pGraphics,
param.m_pGraphics = pGraphics;
param.m_matrix.Concat(*pMatrix);
param.m_rtPart = m_rtClient;
- if (IsShowScrollBar(FALSE) && IsShowScrollBar(TRUE)) {
+ if (IsShowScrollBar(false) && IsShowScrollBar(true)) {
param.m_pData = &m_rtStatic;
}
if (!IsEnabled()) {
@@ -659,7 +656,7 @@ void IFWL_ListBox::DrawItem(CFX_Graphics* pGraphics,
}
}
-CFX_SizeF IFWL_ListBox::CalcSize(FX_BOOL bAutoSize) {
+CFX_SizeF IFWL_ListBox::CalcSize(bool bAutoSize) {
CFX_SizeF fs;
if (!m_pProperties->m_pThemeProvider)
return fs;
@@ -722,10 +719,10 @@ CFX_SizeF IFWL_ListBox::CalcSize(FX_BOOL bAutoSize) {
}
FX_FLOAT iWidth = m_rtClient.width - rtUIMargin.left - rtUIMargin.width;
FX_FLOAT iHeight = m_rtClient.height;
- FX_BOOL bShowVertScr =
+ bool bShowVertScr =
(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_ShowScrollBarAlaways) &&
(m_pProperties->m_dwStyles & FWL_WGTSTYLE_VScroll);
- FX_BOOL bShowHorzScr =
+ bool bShowHorzScr =
(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_ShowScrollBarAlaways) &&
(m_pProperties->m_dwStyles & FWL_WGTSTYLE_HScroll);
if (!bShowVertScr && m_pProperties->m_dwStyles & FWL_WGTSTYLE_VScroll &&
@@ -766,17 +763,17 @@ CFX_SizeF IFWL_ListBox::CalcSize(FX_BOOL bAutoSize) {
if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_ShowScrollBarFocus) ==
0 ||
(m_pProperties->m_dwStates & FWL_WGTSTATE_Focused)) {
- m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, FALSE);
+ m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, false);
}
m_pVertScrollBar->Update();
} else if (m_pVertScrollBar) {
m_pVertScrollBar->SetPos(0);
m_pVertScrollBar->SetTrackPos(0);
- m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, TRUE);
+ m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, true);
}
if (bShowHorzScr) {
if (!m_pHorzScrollBar) {
- InitScrollBar(FALSE);
+ InitScrollBar(false);
}
CFX_RectF rtScrollBar;
rtScrollBar.Set(m_rtClient.left, m_rtClient.bottom() - m_fScorllBarWidth,
@@ -801,13 +798,13 @@ CFX_SizeF IFWL_ListBox::CalcSize(FX_BOOL bAutoSize) {
if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_ShowScrollBarFocus) ==
0 ||
(m_pProperties->m_dwStates & FWL_WGTSTATE_Focused)) {
- m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, FALSE);
+ m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, false);
}
m_pHorzScrollBar->Update();
} else if (m_pHorzScrollBar) {
m_pHorzScrollBar->SetPos(0);
m_pHorzScrollBar->SetTrackPos(0);
- m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, TRUE);
+ m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, true);
}
if (bShowVertScr && bShowHorzScr) {
m_rtStatic.Set(m_rtClient.right() - m_fScorllBarWidth,
@@ -821,7 +818,7 @@ void IFWL_ListBox::GetItemSize(CFX_SizeF& size,
IFWL_ListItem* pItem,
FX_FLOAT fWidth,
FX_FLOAT fItemHeight,
- FX_BOOL bAutoSize) {
+ bool bAutoSize) {
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiColumn) {
} else {
if (!bAutoSize) {
@@ -872,7 +869,7 @@ FX_FLOAT IFWL_ListBox::GetItemHeigt() {
return *pfFont + 2 * kItemTextMargin;
}
-void IFWL_ListBox::InitScrollBar(FX_BOOL bVert) {
+void IFWL_ListBox::InitScrollBar(bool bVert) {
if ((bVert && m_pVertScrollBar) || (!bVert && m_pHorzScrollBar)) {
return;
}
@@ -885,11 +882,11 @@ void IFWL_ListBox::InitScrollBar(FX_BOOL bVert) {
->reset(new IFWL_ScrollBar(m_pOwnerApp, prop, this));
}
-FX_BOOL IFWL_ListBox::IsShowScrollBar(FX_BOOL bVert) {
+bool IFWL_ListBox::IsShowScrollBar(bool bVert) {
IFWL_ScrollBar* pScrollbar =
bVert ? m_pVertScrollBar.get() : m_pHorzScrollBar.get();
if (!pScrollbar || (pScrollbar->GetStates() & FWL_WGTSTATE_Invisible)) {
- return FALSE;
+ return false;
}
return !(m_pProperties->m_dwStyleExes &
FWL_STYLEEXT_LTB_ShowScrollBarFocus) ||
@@ -920,10 +917,10 @@ void IFWL_ListBox::OnProcessMessage(CFWL_Message* pMessage) {
CFWL_MessageType dwMsgCode = pMessage->GetClassID();
switch (dwMsgCode) {
case CFWL_MessageType::SetFocus:
- OnFocusChanged(pMessage, TRUE);
+ OnFocusChanged(pMessage, true);
break;
case CFWL_MessageType::KillFocus:
- OnFocusChanged(pMessage, FALSE);
+ OnFocusChanged(pMessage, false);
break;
case CFWL_MessageType::Mouse: {
CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
@@ -974,7 +971,7 @@ void IFWL_ListBox::OnDrawWidget(CFX_Graphics* pGraphics,
DrawWidget(pGraphics, pMatrix);
}
-void IFWL_ListBox::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
+void IFWL_ListBox::OnFocusChanged(CFWL_Message* pMsg, bool bSet) {
if (GetStylesEx() & FWL_STYLEEXT_LTB_ShowScrollBarFocus) {
if (m_pVertScrollBar)
m_pVertScrollBar->SetStates(FWL_WGTSTATE_Invisible, !bSet);
@@ -990,9 +987,9 @@ void IFWL_ListBox::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
}
void IFWL_ListBox::OnLButtonDown(CFWL_MsgMouse* pMsg) {
- m_bLButtonDown = TRUE;
+ m_bLButtonDown = true;
if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0)
- SetFocus(TRUE);
+ SetFocus(true);
IFWL_ListItem* pItem = GetItemAtPoint(pMsg->m_fx, pMsg->m_fy);
if (!pItem)
@@ -1000,26 +997,26 @@ void IFWL_ListBox::OnLButtonDown(CFWL_MsgMouse* pMsg) {
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection) {
if (pMsg->m_dwFlags & FWL_KEYFLAG_Ctrl) {
- FX_BOOL bSelected = IsItemSelected(pItem);
+ bool bSelected = IsItemSelected(pItem);
SetSelectionDirect(pItem, !bSelected);
m_hAnchor = pItem;
} else if (pMsg->m_dwFlags & FWL_KEYFLAG_Shift) {
if (m_hAnchor)
- SetSelection(m_hAnchor, pItem, TRUE);
+ SetSelection(m_hAnchor, pItem, true);
else
- SetSelectionDirect(pItem, TRUE);
+ SetSelectionDirect(pItem, true);
} else {
- SetSelection(pItem, pItem, TRUE);
+ SetSelection(pItem, pItem, true);
m_hAnchor = pItem;
}
} else {
- SetSelection(pItem, pItem, TRUE);
+ SetSelection(pItem, pItem, true);
}
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_Check) {
IFWL_ListItem* hSelectedItem = GetItemAtPoint(pMsg->m_fx, pMsg->m_fy);
CFX_RectF rtCheck;
GetItemCheckRect(hSelectedItem, rtCheck);
- FX_BOOL bChecked = GetItemChecked(pItem);
+ bool bChecked = GetItemChecked(pItem);
if (rtCheck.Contains(pMsg->m_fx, pMsg->m_fy)) {
SetItemChecked(pItem, !bChecked);
Update();
@@ -1027,7 +1024,7 @@ void IFWL_ListBox::OnLButtonDown(CFWL_MsgMouse* pMsg) {
}
SetFocusItem(pItem);
ScrollToVisible(pItem);
- SetGrab(TRUE);
+ SetGrab(true);
ProcessSelChanged();
Repaint(&m_rtClient);
}
@@ -1036,13 +1033,13 @@ void IFWL_ListBox::OnLButtonUp(CFWL_MsgMouse* pMsg) {
if (!m_bLButtonDown)
return;
- m_bLButtonDown = FALSE;
- SetGrab(FALSE);
+ m_bLButtonDown = false;
+ SetGrab(false);
DispatchSelChangedEv();
}
void IFWL_ListBox::OnMouseWheel(CFWL_MsgMouseWheel* pMsg) {
- if (IsShowScrollBar(TRUE))
+ if (IsShowScrollBar(true))
m_pVertScrollBar->GetDelegate()->OnProcessMessage(pMsg);
}
@@ -1068,7 +1065,7 @@ void IFWL_ListBox::OnKeyDown(CFWL_MsgKey* pMsg) {
}
}
-void IFWL_ListBox::OnVK(IFWL_ListItem* pItem, FX_BOOL bShift, FX_BOOL bCtrl) {
+void IFWL_ListBox::OnVK(IFWL_ListItem* pItem, bool bShift, bool bCtrl) {
if (!pItem)
return;
@@ -1076,15 +1073,15 @@ void IFWL_ListBox::OnVK(IFWL_ListItem* pItem, FX_BOOL bShift, FX_BOOL bCtrl) {
if (bCtrl) {
} else if (bShift) {
if (m_hAnchor)
- SetSelection(m_hAnchor, pItem, TRUE);
+ SetSelection(m_hAnchor, pItem, true);
else
- SetSelectionDirect(pItem, TRUE);
+ SetSelectionDirect(pItem, true);
} else {
- SetSelection(pItem, pItem, TRUE);
+ SetSelection(pItem, pItem, true);
m_hAnchor = pItem;
}
} else {
- SetSelection(pItem, pItem, TRUE);
+ SetSelection(pItem, pItem, true);
}
SetFocusItem(pItem);
@@ -1096,9 +1093,9 @@ void IFWL_ListBox::OnVK(IFWL_ListItem* pItem, FX_BOOL bShift, FX_BOOL bCtrl) {
Repaint(&rtInvalidate);
}
-FX_BOOL IFWL_ListBox::OnScroll(IFWL_ScrollBar* pScrollBar,
- uint32_t dwCode,
- FX_FLOAT fPos) {
+bool IFWL_ListBox::OnScroll(IFWL_ScrollBar* pScrollBar,
+ uint32_t dwCode,
+ FX_FLOAT fPos) {
CFX_SizeF fs;
pScrollBar->GetRange(fs.x, fs.y);
FX_FLOAT iCurPos = pScrollBar->GetPos();
@@ -1140,14 +1137,14 @@ FX_BOOL IFWL_ListBox::OnScroll(IFWL_ScrollBar* pScrollBar,
case FWL_SCBCODE_TrackPos:
break;
case FWL_SCBCODE_EndScroll:
- return FALSE;
+ return false;
}
if (iCurPos != fPos) {
pScrollBar->SetPos(fPos);
pScrollBar->SetTrackPos(fPos);
Repaint(&m_rtClient);
}
- return TRUE;
+ return true;
}
void IFWL_ListBox::DispatchSelChangedEv() {
diff --git a/xfa/fwl/core/ifwl_listbox.h b/xfa/fwl/core/ifwl_listbox.h
index 5d4f896e94..e16778f23e 100644
--- a/xfa/fwl/core/ifwl_listbox.h
+++ b/xfa/fwl/core/ifwl_listbox.h
@@ -56,9 +56,9 @@ class IFWL_ListBoxDP : public IFWL_DataProvider {
virtual IFWL_ListItem* GetItem(const IFWL_Widget* pWidget,
int32_t nIndex) = 0;
virtual int32_t GetItemIndex(IFWL_Widget* pWidget, IFWL_ListItem* pItem) = 0;
- virtual FX_BOOL SetItemIndex(IFWL_Widget* pWidget,
- IFWL_ListItem* pItem,
- int32_t nIndex) = 0;
+ virtual bool SetItemIndex(IFWL_Widget* pWidget,
+ IFWL_ListItem* pItem,
+ int32_t nIndex) = 0;
virtual uint32_t GetItemStyles(IFWL_Widget* pWidget,
IFWL_ListItem* pItem) = 0;
virtual FWL_Error GetItemText(IFWL_Widget* pWidget,
@@ -108,7 +108,7 @@ class IFWL_ListBox : public IFWL_Widget {
// IFWL_Widget
FWL_Type GetClassID() const override;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
FWL_Error Update() override;
FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override;
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
@@ -122,29 +122,27 @@ class IFWL_ListBox : public IFWL_Widget {
int32_t CountSelItems();
IFWL_ListItem* GetSelItem(int32_t nIndexSel);
int32_t GetSelIndex(int32_t nIndex);
- FWL_Error SetSelItem(IFWL_ListItem* hItem, FX_BOOL bSelect = TRUE);
+ FWL_Error SetSelItem(IFWL_ListItem* hItem, bool bSelect = true);
FWL_Error GetItemText(IFWL_ListItem* hItem, CFX_WideString& wsText);
- FWL_Error GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE);
+ FWL_Error GetScrollPos(FX_FLOAT& fPos, bool bVert = true);
FWL_Error* Sort(IFWL_ListBoxCompare* pCom);
protected:
friend class CFWL_ListBoxImpDelegate;
IFWL_ListItem* GetItem(IFWL_ListItem* hItem, uint32_t dwKeyCode);
- void SetSelection(IFWL_ListItem* hStart,
- IFWL_ListItem* hEnd,
- FX_BOOL bSelected);
- void SetSelectionDirect(IFWL_ListItem* hItem, FX_BOOL bSelect);
- FX_BOOL IsItemSelected(IFWL_ListItem* hItem);
+ void SetSelection(IFWL_ListItem* hStart, IFWL_ListItem* hEnd, bool bSelected);
+ void SetSelectionDirect(IFWL_ListItem* hItem, bool bSelect);
+ bool IsItemSelected(IFWL_ListItem* hItem);
void ClearSelection();
void SelectAll();
IFWL_ListItem* GetFocusedItem();
void SetFocusItem(IFWL_ListItem* hItem);
IFWL_ListItem* GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy);
- FX_BOOL GetItemCheckRect(IFWL_ListItem* hItem, CFX_RectF& rtCheck);
- FX_BOOL SetItemChecked(IFWL_ListItem* hItem, FX_BOOL bChecked);
- FX_BOOL GetItemChecked(IFWL_ListItem* hItem);
- FX_BOOL ScrollToVisible(IFWL_ListItem* hItem);
+ bool GetItemCheckRect(IFWL_ListItem* hItem, CFX_RectF& rtCheck);
+ bool SetItemChecked(IFWL_ListItem* hItem, bool bChecked);
+ bool GetItemChecked(IFWL_ListItem* hItem);
+ bool ScrollToVisible(IFWL_ListItem* hItem);
void DrawBkground(CFX_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme,
const CFX_Matrix* pMatrix = nullptr);
@@ -158,17 +156,17 @@ class IFWL_ListBox : public IFWL_Widget {
const CFX_RectF& rtItem,
const CFX_Matrix* pMatrix = nullptr);
void DrawStatic(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme);
- CFX_SizeF CalcSize(FX_BOOL bAutoSize = FALSE);
+ CFX_SizeF CalcSize(bool bAutoSize = false);
void GetItemSize(CFX_SizeF& size,
IFWL_ListItem* hItem,
FX_FLOAT fWidth,
FX_FLOAT fHeight,
- FX_BOOL bAutoSize = FALSE);
+ bool bAutoSize = false);
FX_FLOAT GetMaxTextWidth();
FX_FLOAT GetScrollWidth();
FX_FLOAT GetItemHeigt();
- void InitScrollBar(FX_BOOL bVert = TRUE);
- FX_BOOL IsShowScrollBar(FX_BOOL bVert);
+ void InitScrollBar(bool bVert = true);
+ bool IsShowScrollBar(bool bVert);
void ProcessSelChanged();
CFX_RectF m_rtClient;
@@ -181,17 +179,17 @@ class IFWL_ListBox : public IFWL_Widget {
IFWL_ListItem* m_hAnchor;
FX_FLOAT m_fItemHeight;
FX_FLOAT m_fScorllBarWidth;
- FX_BOOL m_bLButtonDown;
+ bool m_bLButtonDown;
IFWL_ThemeProvider* m_pScrollBarTP;
private:
- void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE);
+ void OnFocusChanged(CFWL_Message* pMsg, bool bSet = true);
void OnLButtonDown(CFWL_MsgMouse* pMsg);
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnMouseWheel(CFWL_MsgMouseWheel* pMsg);
void OnKeyDown(CFWL_MsgKey* pMsg);
- void OnVK(IFWL_ListItem* hItem, FX_BOOL bShift, FX_BOOL bCtrl);
- FX_BOOL OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos);
+ void OnVK(IFWL_ListItem* hItem, bool bShift, bool bCtrl);
+ bool OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos);
void DispatchSelChangedEv();
};
diff --git a/xfa/fwl/core/ifwl_monthcalendar.cpp b/xfa/fwl/core/ifwl_monthcalendar.cpp
index 4ac0d2b222..4190dbdefd 100644
--- a/xfa/fwl/core/ifwl_monthcalendar.cpp
+++ b/xfa/fwl/core/ifwl_monthcalendar.cpp
@@ -123,7 +123,7 @@ IFWL_MonthCalendar::IFWL_MonthCalendar(
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
: IFWL_Widget(app, properties, pOuter),
- m_bInit(FALSE),
+ m_bInit(false),
m_pDateTime(new CFX_DateTime),
m_iCurYear(2011),
m_iCurMonth(1),
@@ -157,12 +157,11 @@ FWL_Type IFWL_MonthCalendar::GetClassID() const {
return FWL_Type::MonthCalendar;
}
-FWL_Error IFWL_MonthCalendar::GetWidgetRect(CFX_RectF& rect,
- FX_BOOL bAutoSize) {
+FWL_Error IFWL_MonthCalendar::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
- CFX_SizeF fs = CalcSize(TRUE);
+ CFX_SizeF fs = CalcSize(true);
rect.Set(0, 0, fs.x, fs.y);
- IFWL_Widget::GetWidgetRect(rect, TRUE);
+ IFWL_Widget::GetWidgetRect(rect, true);
} else {
rect = m_pProperties->m_rtWidget;
}
@@ -223,22 +222,22 @@ int32_t IFWL_MonthCalendar::CountSelect() {
return m_arrSelDays.GetSize();
}
-FX_BOOL IFWL_MonthCalendar::GetSelect(int32_t& iYear,
- int32_t& iMonth,
- int32_t& iDay,
- int32_t nIndex) {
+bool IFWL_MonthCalendar::GetSelect(int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay,
+ int32_t nIndex) {
if (nIndex >= m_arrSelDays.GetSize()) {
- return FALSE;
+ return false;
}
iYear = m_iCurYear;
iMonth = m_iCurMonth;
iDay = m_arrSelDays[nIndex];
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_MonthCalendar::SetSelect(int32_t iYear,
- int32_t iMonth,
- int32_t iDay) {
+bool IFWL_MonthCalendar::SetSelect(int32_t iYear,
+ int32_t iMonth,
+ int32_t iDay) {
ChangeToMonth(iYear, iMonth);
return AddSelDay(iDay);
}
@@ -566,7 +565,7 @@ void IFWL_MonthCalendar::DrawTodayCircle(CFX_Graphics* pGraphics,
pTheme->DrawBackground(&params);
}
-CFX_SizeF IFWL_MonthCalendar::CalcSize(FX_BOOL bAutoSize) {
+CFX_SizeF IFWL_MonthCalendar::CalcSize(bool bAutoSize) {
if (!m_pProperties->m_pThemeProvider)
return CFX_SizeF();
@@ -686,7 +685,7 @@ void IFWL_MonthCalendar::LayOut() {
}
void IFWL_MonthCalendar::CalDateItem() {
- FX_BOOL bNewWeek = FALSE;
+ bool bNewWeek = false;
int32_t iWeekOfMonth = 0;
FX_FLOAT fLeft = m_rtDates.left;
FX_FLOAT fTop = m_rtDates.top;
@@ -695,7 +694,7 @@ void IFWL_MonthCalendar::CalDateItem() {
FWL_DATEINFO* pDateInfo = m_arrDates.GetAt(i);
if (bNewWeek) {
iWeekOfMonth++;
- bNewWeek = FALSE;
+ bNewWeek = false;
}
pDateInfo->rect.Set(
fLeft + pDateInfo->iDayOfWeek * (m_szCell.x + (MONTHCAL_HMARGIN * 2)),
@@ -706,7 +705,7 @@ void IFWL_MonthCalendar::CalDateItem() {
pDateInfo->rect.Offset(m_fWeekNumWid, 0);
}
if (pDateInfo->iDayOfWeek >= 6) {
- bNewWeek = TRUE;
+ bNewWeek = true;
}
}
}
@@ -781,39 +780,39 @@ int32_t IFWL_MonthCalendar::CalWeekNumber(int32_t iYear,
return 0;
}
-FX_BOOL IFWL_MonthCalendar::GetMinDate(int32_t& iYear,
- int32_t& iMonth,
- int32_t& iDay) {
+bool IFWL_MonthCalendar::GetMinDate(int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay) {
iYear = m_dtMin.iYear;
iMonth = m_dtMin.iMonth;
iDay = m_dtMin.iDay;
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_MonthCalendar::SetMinDate(int32_t iYear,
- int32_t iMonth,
- int32_t iDay) {
+bool IFWL_MonthCalendar::SetMinDate(int32_t iYear,
+ int32_t iMonth,
+ int32_t iDay) {
m_dtMin = DATE(iYear, iMonth, iDay);
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_MonthCalendar::GetMaxDate(int32_t& iYear,
- int32_t& iMonth,
- int32_t& iDay) {
+bool IFWL_MonthCalendar::GetMaxDate(int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay) {
iYear = m_dtMax.iYear;
iMonth = m_dtMax.iMonth;
iDay = m_dtMax.iDay;
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_MonthCalendar::SetMaxDate(int32_t iYear,
- int32_t iMonth,
- int32_t iDay) {
+bool IFWL_MonthCalendar::SetMaxDate(int32_t iYear,
+ int32_t iMonth,
+ int32_t iDay) {
m_dtMax = DATE(iYear, iMonth, iDay);
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_MonthCalendar::InitDate() {
+bool IFWL_MonthCalendar::InitDate() {
if (m_pProperties->m_pDataProvider) {
IFWL_MonthCalendarDP* pDateProv =
static_cast<IFWL_MonthCalendarDP*>(m_pProperties->m_pDataProvider);
@@ -833,7 +832,7 @@ FX_BOOL IFWL_MonthCalendar::InitDate() {
GetHeadText(m_iCurYear, m_iCurMonth, m_wsHead);
m_dtMin = DATE(1500, 12, 1);
m_dtMax = DATE(2200, 1, 1);
- return TRUE;
+ return true;
}
void IFWL_MonthCalendar::ClearDateItem() {
@@ -868,7 +867,7 @@ void IFWL_MonthCalendar::ReSetDateItem() {
}
}
-FX_BOOL IFWL_MonthCalendar::NextMonth() {
+bool IFWL_MonthCalendar::NextMonth() {
int32_t iYear = m_iCurYear, iMonth = m_iCurMonth;
if (iMonth >= 12) {
iMonth = 1;
@@ -878,14 +877,14 @@ FX_BOOL IFWL_MonthCalendar::NextMonth() {
}
DATE dt(m_iCurYear, m_iCurMonth, 1);
if (!(dt < m_dtMax)) {
- return FALSE;
+ return false;
}
m_iCurYear = iYear, m_iCurMonth = iMonth;
ChangeToMonth(m_iCurYear, m_iCurMonth);
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_MonthCalendar::PrevMonth() {
+bool IFWL_MonthCalendar::PrevMonth() {
int32_t iYear = m_iCurYear, iMonth = m_iCurMonth;
if (iMonth <= 1) {
iMonth = 12;
@@ -895,11 +894,11 @@ FX_BOOL IFWL_MonthCalendar::PrevMonth() {
}
DATE dt(m_iCurYear, m_iCurMonth, 1);
if (!(dt > m_dtMin)) {
- return FALSE;
+ return false;
}
m_iCurYear = iYear, m_iCurMonth = iMonth;
ChangeToMonth(m_iCurYear, m_iCurMonth);
- return TRUE;
+ return true;
}
void IFWL_MonthCalendar::ChangeToMonth(int32_t iYear, int32_t iMonth) {
@@ -912,9 +911,9 @@ void IFWL_MonthCalendar::ChangeToMonth(int32_t iYear, int32_t iMonth) {
GetHeadText(m_iCurYear, m_iCurMonth, m_wsHead);
}
-FX_BOOL IFWL_MonthCalendar::RemoveSelDay(int32_t iDay, FX_BOOL bAll) {
+bool IFWL_MonthCalendar::RemoveSelDay(int32_t iDay, bool bAll) {
if (iDay == -1 && !bAll) {
- return FALSE;
+ return false;
}
if (bAll) {
int32_t iCount = m_arrSelDays.GetSize();
@@ -930,7 +929,7 @@ FX_BOOL IFWL_MonthCalendar::RemoveSelDay(int32_t iDay, FX_BOOL bAll) {
} else {
int32_t index = m_arrSelDays.Find(iDay);
if (index == -1) {
- return FALSE;
+ return false;
}
int32_t iSelDay = m_arrSelDays.GetAt(iDay);
int32_t iDatesCount = m_arrDates.GetSize();
@@ -940,15 +939,15 @@ FX_BOOL IFWL_MonthCalendar::RemoveSelDay(int32_t iDay, FX_BOOL bAll) {
}
m_arrSelDays.RemoveAt(index);
}
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_MonthCalendar::AddSelDay(int32_t iDay) {
+bool IFWL_MonthCalendar::AddSelDay(int32_t iDay) {
ASSERT(iDay > 0);
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_MultiSelect) {
} else {
if (m_arrSelDays.Find(iDay) == -1) {
- RemoveSelDay(-1, TRUE);
+ RemoveSelDay(-1, true);
if (iDay <= m_arrDates.GetSize()) {
FWL_DATEINFO* pDateInfo = m_arrDates.GetAt(iDay - 1);
pDateInfo->dwStates |= FWL_ITEMSTATE_MCD_Selected;
@@ -956,10 +955,10 @@ FX_BOOL IFWL_MonthCalendar::AddSelDay(int32_t iDay) {
m_arrSelDays.Add(iDay);
}
}
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_MonthCalendar::JumpToToday() {
+bool IFWL_MonthCalendar::JumpToToday() {
if (m_iYear != m_iCurYear || m_iMonth != m_iCurMonth) {
m_iCurYear = m_iYear;
m_iCurMonth = m_iMonth;
@@ -970,7 +969,7 @@ FX_BOOL IFWL_MonthCalendar::JumpToToday() {
AddSelDay(m_iDay);
}
}
- return TRUE;
+ return true;
}
void IFWL_MonthCalendar::GetHeadText(int32_t iYear,
@@ -1002,15 +1001,15 @@ int32_t IFWL_MonthCalendar::GetDayAtPoint(FX_FLOAT x, FX_FLOAT y) {
return -1;
}
-FX_BOOL IFWL_MonthCalendar::GetDayRect(int32_t iDay, CFX_RectF& rtDay) {
+bool IFWL_MonthCalendar::GetDayRect(int32_t iDay, CFX_RectF& rtDay) {
if (iDay <= 0 || iDay > m_arrDates.GetSize()) {
- return FALSE;
+ return false;
}
FWL_DATEINFO* pDateInfo = m_arrDates[iDay - 1];
if (!pDateInfo)
- return FALSE;
+ return false;
rtDay = pDateInfo->rect;
- return TRUE;
+ return true;
}
void IFWL_MonthCalendar::OnProcessMessage(CFWL_Message* pMessage) {
@@ -1020,10 +1019,10 @@ void IFWL_MonthCalendar::OnProcessMessage(CFWL_Message* pMessage) {
CFWL_MessageType dwMsgCode = pMessage->GetClassID();
switch (dwMsgCode) {
case CFWL_MessageType::SetFocus:
- OnFocusChanged(pMessage, TRUE);
+ OnFocusChanged(pMessage, true);
break;
case CFWL_MessageType::KillFocus:
- OnFocusChanged(pMessage, FALSE);
+ OnFocusChanged(pMessage, false);
break;
case CFWL_MessageType::Key:
break;
@@ -1058,7 +1057,7 @@ void IFWL_MonthCalendar::OnDrawWidget(CFX_Graphics* pGraphics,
DrawWidget(pGraphics, pMatrix);
}
-void IFWL_MonthCalendar::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
+void IFWL_MonthCalendar::OnFocusChanged(CFWL_Message* pMsg, bool bSet) {
if (bSet)
m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
else
@@ -1089,7 +1088,7 @@ void IFWL_MonthCalendar::OnLButtonDown(CFWL_MsgMouse* pMsg) {
iOldSel = m_arrSelDays[0];
int32_t iCurSel = GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
- FX_BOOL bSelChanged = iCurSel > 0 && iCurSel != iOldSel;
+ bool bSelChanged = iCurSel > 0 && iCurSel != iOldSel;
if (bSelChanged) {
FWL_DATEINFO* lpDatesInfo = m_arrDates.GetAt(iCurSel - 1);
CFX_RectF rtInvalidate(lpDatesInfo->rect);
@@ -1132,7 +1131,7 @@ void IFWL_MonthCalendar::OnMouseMove(CFWL_MsgMouse* pMsg) {
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_MultiSelect)
return;
- FX_BOOL bRepaint = FALSE;
+ bool bRepaint = false;
CFX_RectF rtInvalidate;
rtInvalidate.Set(0, 0, 0, 0);
if (m_rtDates.Contains(pMsg->m_fx, pMsg->m_fy)) {
diff --git a/xfa/fwl/core/ifwl_monthcalendar.h b/xfa/fwl/core/ifwl_monthcalendar.h
index dfde3944a1..1017c8653e 100644
--- a/xfa/fwl/core/ifwl_monthcalendar.h
+++ b/xfa/fwl/core/ifwl_monthcalendar.h
@@ -58,7 +58,7 @@ class IFWL_MonthCalendar : public IFWL_Widget {
// FWL_WidgetImp
FWL_Type GetClassID() const override;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
FWL_Error Update() override;
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr) override;
@@ -67,40 +67,40 @@ class IFWL_MonthCalendar : public IFWL_Widget {
const CFX_Matrix* pMatrix) override;
int32_t CountSelect();
- FX_BOOL GetSelect(int32_t& iYear,
- int32_t& iMonth,
- int32_t& iDay,
- int32_t nIndex = 0);
- FX_BOOL SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay);
+ bool GetSelect(int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay,
+ int32_t nIndex = 0);
+ bool SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay);
protected:
struct DATE {
DATE() : iYear(0), iMonth(0), iDay(0) {}
DATE(int32_t year, int32_t month, int32_t day)
: iYear(year), iMonth(month), iDay(day) {}
- FX_BOOL operator<(const DATE& right) {
+ bool operator<(const DATE& right) {
if (iYear < right.iYear) {
- return TRUE;
+ return true;
} else if (iYear == right.iYear) {
if (iMonth < right.iMonth) {
- return TRUE;
+ return true;
} else if (iMonth == right.iMonth) {
return iDay < right.iDay;
}
}
- return FALSE;
+ return false;
}
- FX_BOOL operator>(const DATE& right) {
+ bool operator>(const DATE& right) {
if (iYear > right.iYear) {
- return TRUE;
+ return true;
} else if (iYear == right.iYear) {
if (iMonth > right.iMonth) {
- return TRUE;
+ return true;
} else if (iMonth == right.iMonth) {
return iDay > right.iDay;
}
}
- return FALSE;
+ return false;
}
int32_t iYear;
int32_t iMonth;
@@ -152,35 +152,35 @@ class IFWL_MonthCalendar : public IFWL_Widget {
void DrawTodayCircle(CFX_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme,
const CFX_Matrix* pMatrix);
- CFX_SizeF CalcSize(FX_BOOL bAutoSize = FALSE);
+ CFX_SizeF CalcSize(bool bAutoSize = false);
void LayOut();
void CalcHeadSize();
void CalcTodaySize();
void CalDateItem();
void GetCapValue();
int32_t CalWeekNumber(int32_t iYear, int32_t iMonth, int32_t iDay);
- FX_BOOL GetMinDate(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
- FX_BOOL SetMinDate(int32_t iYear, int32_t iMonth, int32_t iDay);
- FX_BOOL GetMaxDate(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
- FX_BOOL SetMaxDate(int32_t iYear, int32_t iMonth, int32_t iDay);
- FX_BOOL InitDate();
+ bool GetMinDate(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
+ bool SetMinDate(int32_t iYear, int32_t iMonth, int32_t iDay);
+ bool GetMaxDate(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
+ bool SetMaxDate(int32_t iYear, int32_t iMonth, int32_t iDay);
+ bool InitDate();
void ClearDateItem();
void ReSetDateItem();
- FX_BOOL NextMonth();
- FX_BOOL PrevMonth();
+ bool NextMonth();
+ bool PrevMonth();
void ChangeToMonth(int32_t iYear, int32_t iMonth);
- FX_BOOL RemoveSelDay(int32_t iDay, FX_BOOL bAll = FALSE);
- FX_BOOL AddSelDay(int32_t iDay);
- FX_BOOL JumpToToday();
+ bool RemoveSelDay(int32_t iDay, bool bAll = false);
+ bool AddSelDay(int32_t iDay);
+ bool JumpToToday();
void GetHeadText(int32_t iYear, int32_t iMonth, CFX_WideString& wsHead);
void GetTodayText(int32_t iYear,
int32_t iMonth,
int32_t iDay,
CFX_WideString& wsToday);
int32_t GetDayAtPoint(FX_FLOAT x, FX_FLOAT y);
- FX_BOOL GetDayRect(int32_t iDay, CFX_RectF& rtDay);
+ bool GetDayRect(int32_t iDay, CFX_RectF& rtDay);
- FX_BOOL m_bInit;
+ bool m_bInit;
CFX_RectF m_rtHead;
CFX_RectF m_rtWeek;
CFX_RectF m_rtLBtn;
@@ -241,7 +241,7 @@ class IFWL_MonthCalendar : public IFWL_Widget {
FX_FLOAT m_fMCHei;
private:
- void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet);
+ void OnFocusChanged(CFWL_Message* pMsg, bool bSet);
void OnLButtonDown(CFWL_MsgMouse* pMsg);
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnMouseMove(CFWL_MsgMouse* pMsg);
diff --git a/xfa/fwl/core/ifwl_picturebox.cpp b/xfa/fwl/core/ifwl_picturebox.cpp
index 6ab792c985..d820573f30 100644
--- a/xfa/fwl/core/ifwl_picturebox.cpp
+++ b/xfa/fwl/core/ifwl_picturebox.cpp
@@ -13,9 +13,9 @@
IFWL_PictureBox::IFWL_PictureBox(const IFWL_App* app,
const CFWL_WidgetImpProperties& properties)
: IFWL_Widget(app, properties, nullptr),
- m_bTop(FALSE),
- m_bVCenter(FALSE),
- m_bButton(FALSE) {
+ m_bTop(false),
+ m_bVCenter(false),
+ m_bButton(false) {
m_rtClient.Reset();
m_rtImage.Reset();
m_matrix.SetIdentity();
@@ -27,7 +27,7 @@ FWL_Type IFWL_PictureBox::GetClassID() const {
return FWL_Type::PictureBox;
}
-FWL_Error IFWL_PictureBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error IFWL_PictureBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
rect.Set(0, 0, 0, 0);
if (!m_pProperties->m_pDataProvider)
@@ -39,7 +39,7 @@ FWL_Error IFWL_PictureBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
rect.Set(0, 0, (FX_FLOAT)pBitmap->GetWidth(),
(FX_FLOAT)pBitmap->GetHeight());
}
- IFWL_Widget::GetWidgetRect(rect, TRUE);
+ IFWL_Widget::GetWidgetRect(rect, true);
} else {
rect = m_pProperties->m_rtWidget;
}
@@ -105,13 +105,13 @@ void IFWL_PictureBox::DrawBkground(CFX_Graphics* pGraphics,
bool IFWL_PictureBox::VStyle(uint32_t dwStyle) {
switch (dwStyle & FWL_STYLEEXT_PTB_VAlignMask) {
case FWL_STYLEEXT_PTB_Top:
- m_bTop = TRUE;
+ m_bTop = true;
return true;
case FWL_STYLEEXT_PTB_Vcenter:
- m_bVCenter = TRUE;
+ m_bVCenter = true;
return true;
case FWL_STYLEEXT_PTB_Bottom:
- m_bButton = TRUE;
+ m_bButton = true;
return true;
}
return false;
diff --git a/xfa/fwl/core/ifwl_picturebox.h b/xfa/fwl/core/ifwl_picturebox.h
index 05f094b25c..edd8e7efa5 100644
--- a/xfa/fwl/core/ifwl_picturebox.h
+++ b/xfa/fwl/core/ifwl_picturebox.h
@@ -49,7 +49,7 @@ class IFWL_PictureBox : public IFWL_Widget {
// IFWL_Widget
FWL_Type GetClassID() const override;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
FWL_Error Update() override;
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr) override;
@@ -65,9 +65,9 @@ class IFWL_PictureBox : public IFWL_Widget {
CFX_RectF m_rtClient;
CFX_RectF m_rtImage;
CFX_Matrix m_matrix;
- FX_BOOL m_bTop;
- FX_BOOL m_bVCenter;
- FX_BOOL m_bButton;
+ bool m_bTop;
+ bool m_bVCenter;
+ bool m_bButton;
};
#endif // XFA_FWL_CORE_IFWL_PICTUREBOX_H_
diff --git a/xfa/fwl/core/ifwl_pushbutton.cpp b/xfa/fwl/core/ifwl_pushbutton.cpp
index 8eab8d6eb7..f9f996ac2d 100644
--- a/xfa/fwl/core/ifwl_pushbutton.cpp
+++ b/xfa/fwl/core/ifwl_pushbutton.cpp
@@ -18,7 +18,7 @@
IFWL_PushButton::IFWL_PushButton(const IFWL_App* app,
const CFWL_WidgetImpProperties& properties)
: IFWL_Widget(app, properties, nullptr),
- m_bBtnDown(FALSE),
+ m_bBtnDown(false),
m_dwTTOStyles(FDE_TTOSTYLE_SingleLine),
m_iTTOAlign(FDE_TTOALIGNMENT_Center) {
m_rtClient.Set(0, 0, 0, 0);
@@ -31,7 +31,7 @@ FWL_Type IFWL_PushButton::GetClassID() const {
return FWL_Type::PushButton;
}
-FWL_Error IFWL_PushButton::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error IFWL_PushButton::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
rect.Set(0, 0, 0, 0);
if (!m_pProperties->m_pThemeProvider) {
@@ -51,14 +51,14 @@ FWL_Error IFWL_PushButton::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
FX_FLOAT* fcaption =
static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::Margin));
rect.Inflate(*fcaption, *fcaption);
- IFWL_Widget::GetWidgetRect(rect, TRUE);
+ IFWL_Widget::GetWidgetRect(rect, true);
} else {
rect = m_pProperties->m_rtWidget;
}
return FWL_Error::Succeeded;
}
-void IFWL_PushButton::SetStates(uint32_t dwStates, FX_BOOL bSet) {
+void IFWL_PushButton::SetStates(uint32_t dwStates, bool bSet) {
if ((dwStates & FWL_WGTSTATE_Disabled) && bSet) {
m_pProperties->m_dwStates = FWL_WGTSTATE_Disabled;
return;
@@ -388,10 +388,10 @@ void IFWL_PushButton::OnProcessMessage(CFWL_Message* pMessage) {
CFWL_MessageType dwMsgCode = pMessage->GetClassID();
switch (dwMsgCode) {
case CFWL_MessageType::SetFocus:
- OnFocusChanged(pMessage, TRUE);
+ OnFocusChanged(pMessage, true);
break;
case CFWL_MessageType::KillFocus:
- OnFocusChanged(pMessage, FALSE);
+ OnFocusChanged(pMessage, false);
break;
case CFWL_MessageType::Mouse: {
CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
@@ -430,7 +430,7 @@ void IFWL_PushButton::OnDrawWidget(CFX_Graphics* pGraphics,
DrawWidget(pGraphics, pMatrix);
}
-void IFWL_PushButton::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
+void IFWL_PushButton::OnFocusChanged(CFWL_Message* pMsg, bool bSet) {
if (bSet)
m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
else
@@ -441,16 +441,16 @@ void IFWL_PushButton::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
void IFWL_PushButton::OnLButtonDown(CFWL_MsgMouse* pMsg) {
if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0)
- SetFocus(TRUE);
+ SetFocus(true);
- m_bBtnDown = TRUE;
+ m_bBtnDown = true;
m_pProperties->m_dwStates |= FWL_STATE_PSB_Hovered;
m_pProperties->m_dwStates |= FWL_STATE_PSB_Pressed;
Repaint(&m_rtClient);
}
void IFWL_PushButton::OnLButtonUp(CFWL_MsgMouse* pMsg) {
- m_bBtnDown = FALSE;
+ m_bBtnDown = false;
if (m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) {
m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Pressed;
m_pProperties->m_dwStates |= FWL_STATE_PSB_Hovered;
@@ -467,25 +467,25 @@ void IFWL_PushButton::OnLButtonUp(CFWL_MsgMouse* pMsg) {
}
void IFWL_PushButton::OnMouseMove(CFWL_MsgMouse* pMsg) {
- FX_BOOL bRepaint = FALSE;
+ bool bRepaint = false;
if (m_bBtnDown) {
if (m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) {
if ((m_pProperties->m_dwStates & FWL_STATE_PSB_Pressed) == 0) {
m_pProperties->m_dwStates |= FWL_STATE_PSB_Pressed;
- bRepaint = TRUE;
+ bRepaint = true;
}
if (m_pProperties->m_dwStates & FWL_STATE_PSB_Hovered) {
m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Hovered;
- bRepaint = TRUE;
+ bRepaint = true;
}
} else {
if (m_pProperties->m_dwStates & FWL_STATE_PSB_Pressed) {
m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Pressed;
- bRepaint = TRUE;
+ bRepaint = true;
}
if ((m_pProperties->m_dwStates & FWL_STATE_PSB_Hovered) == 0) {
m_pProperties->m_dwStates |= FWL_STATE_PSB_Hovered;
- bRepaint = TRUE;
+ bRepaint = true;
}
}
} else {
@@ -493,7 +493,7 @@ void IFWL_PushButton::OnMouseMove(CFWL_MsgMouse* pMsg) {
return;
if ((m_pProperties->m_dwStates & FWL_STATE_PSB_Hovered) == 0) {
m_pProperties->m_dwStates |= FWL_STATE_PSB_Hovered;
- bRepaint = TRUE;
+ bRepaint = true;
}
}
if (bRepaint)
@@ -501,7 +501,7 @@ void IFWL_PushButton::OnMouseMove(CFWL_MsgMouse* pMsg) {
}
void IFWL_PushButton::OnMouseLeave(CFWL_MsgMouse* pMsg) {
- m_bBtnDown = FALSE;
+ m_bBtnDown = false;
m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Hovered;
m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Pressed;
Repaint(&m_rtClient);
diff --git a/xfa/fwl/core/ifwl_pushbutton.h b/xfa/fwl/core/ifwl_pushbutton.h
index 18b15ab846..422e597e06 100644
--- a/xfa/fwl/core/ifwl_pushbutton.h
+++ b/xfa/fwl/core/ifwl_pushbutton.h
@@ -45,8 +45,8 @@ class IFWL_PushButton : public IFWL_Widget {
// IFWL_Widget
FWL_Type GetClassID() const override;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
- void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE) override;
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
+ void SetStates(uint32_t dwStates, bool bSet = true) override;
FWL_Error Update() override;
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr) override;
@@ -66,12 +66,12 @@ class IFWL_PushButton : public IFWL_Widget {
CFX_RectF m_rtClient;
CFX_RectF m_rtCaption;
- FX_BOOL m_bBtnDown;
+ bool m_bBtnDown;
uint32_t m_dwTTOStyles;
int32_t m_iTTOAlign;
private:
- void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet);
+ void OnFocusChanged(CFWL_Message* pMsg, bool bSet);
void OnLButtonDown(CFWL_MsgMouse* pMsg);
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnMouseMove(CFWL_MsgMouse* pMsg);
diff --git a/xfa/fwl/core/ifwl_scrollbar.cpp b/xfa/fwl/core/ifwl_scrollbar.cpp
index 24f6b367a5..9369bd8ada 100644
--- a/xfa/fwl/core/ifwl_scrollbar.cpp
+++ b/xfa/fwl/core/ifwl_scrollbar.cpp
@@ -37,12 +37,12 @@ IFWL_ScrollBar::IFWL_ScrollBar(const IFWL_App* app,
m_cpTrackPointX(0),
m_cpTrackPointY(0),
m_iMouseWheel(0),
- m_bTrackMouseLeave(FALSE),
- m_bMouseHover(FALSE),
- m_bMouseDown(FALSE),
- m_bRepaintThumb(FALSE),
+ m_bTrackMouseLeave(false),
+ m_bMouseHover(false),
+ m_bMouseDown(false),
+ m_bRepaintThumb(false),
m_fButtonLen(0),
- m_bMinSize(FALSE),
+ m_bMinSize(false),
m_bCustomLayout(false),
m_fMinThumb(FWL_SCROLLBAR_MinThumb),
m_Timer(this) {
@@ -60,7 +60,7 @@ FWL_Type IFWL_ScrollBar::GetClassID() const {
return FWL_Type::ScrollBar;
}
-FWL_Error IFWL_ScrollBar::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error IFWL_ScrollBar::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
rect.Set(0, 0, 0, 0);
FX_FLOAT* pfMinWidth = static_cast<FX_FLOAT*>(
@@ -72,7 +72,7 @@ FWL_Error IFWL_ScrollBar::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
} else {
rect.Set(0, 0, (*pfMinWidth) * 3, (*pfMinWidth));
}
- IFWL_Widget::GetWidgetRect(rect, TRUE);
+ IFWL_Widget::GetWidgetRect(rect, true);
} else {
rect = m_pProperties->m_rtWidget;
}
@@ -103,15 +103,15 @@ FWL_Error IFWL_ScrollBar::DrawWidget(CFX_Graphics* pGraphics,
if (HasEdge()) {
DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix);
}
- DrawTrack(pGraphics, pTheme, TRUE, pMatrix);
- DrawTrack(pGraphics, pTheme, FALSE, pMatrix);
- DrawArrowBtn(pGraphics, pTheme, TRUE, pMatrix);
- DrawArrowBtn(pGraphics, pTheme, FALSE, pMatrix);
+ DrawTrack(pGraphics, pTheme, true, pMatrix);
+ DrawTrack(pGraphics, pTheme, false, pMatrix);
+ DrawArrowBtn(pGraphics, pTheme, true, pMatrix);
+ DrawArrowBtn(pGraphics, pTheme, false, pMatrix);
DrawThumb(pGraphics, pTheme, pMatrix);
return FWL_Error::Succeeded;
}
-inline FX_BOOL IFWL_ScrollBar::IsVertical() {
+inline bool IFWL_ScrollBar::IsVertical() {
return m_pProperties->m_dwStyleExes & FWL_STYLEEXT_SCB_Vert;
}
@@ -166,7 +166,7 @@ FWL_Error IFWL_ScrollBar::SetTrackPos(FX_FLOAT fTrackPos) {
return FWL_Error::Succeeded;
}
-FX_BOOL IFWL_ScrollBar::DoScroll(uint32_t dwCode, FX_FLOAT fPos) {
+bool IFWL_ScrollBar::DoScroll(uint32_t dwCode, FX_FLOAT fPos) {
switch (dwCode) {
case FWL_SCBCODE_Min:
case FWL_SCBCODE_Max:
@@ -180,7 +180,7 @@ FX_BOOL IFWL_ScrollBar::DoScroll(uint32_t dwCode, FX_FLOAT fPos) {
case FWL_SCBCODE_TrackPos:
case FWL_SCBCODE_EndScroll:
break;
- default: { return FALSE; }
+ default: { return false; }
}
return OnScroll(dwCode, fPos);
}
@@ -192,7 +192,7 @@ FWL_Error IFWL_ScrollBar::SetOuter(IFWL_Widget* pOuter) {
void IFWL_ScrollBar::DrawTrack(CFX_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme,
- FX_BOOL bLower,
+ bool bLower,
const CFX_Matrix* pMatrix) {
CFWL_ThemeBackground param;
param.m_pWidget = this;
@@ -208,7 +208,7 @@ void IFWL_ScrollBar::DrawTrack(CFX_Graphics* pGraphics,
void IFWL_ScrollBar::DrawArrowBtn(CFX_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme,
- FX_BOOL bMinBtn,
+ bool bMinBtn,
const CFX_Matrix* pMatrix) {
CFWL_ThemeBackground param;
param.m_pWidget = this;
@@ -260,9 +260,9 @@ void IFWL_ScrollBar::CalcButtonLen() {
FX_FLOAT fLength = IsVertical() ? m_rtClient.height : m_rtClient.width;
if (fLength < m_fButtonLen * 2) {
m_fButtonLen = fLength / 2;
- m_bMinSize = TRUE;
+ m_bMinSize = true;
} else {
- m_bMinSize = FALSE;
+ m_bMinSize = false;
}
}
@@ -394,7 +394,7 @@ void IFWL_ScrollBar::CalcMinTrackRect(CFX_RectF& rect) {
FX_FLOAT iy = (m_rtThumb.top + fBottom) / 2;
rect.left = m_rtClient.left;
rect.top = m_rtClient.top;
- FX_BOOL bVertical = IsVertical();
+ bool bVertical = IsVertical();
rect.width = bVertical ? m_rtClient.width : ix;
rect.height = bVertical ? iy : m_rtClient.height;
if (m_bCustomLayout) {
@@ -423,7 +423,7 @@ void IFWL_ScrollBar::CalcMaxTrackRect(CFX_RectF& rect) {
}
FX_FLOAT ix = (m_rtThumb.left + m_rtThumb.right()) / 2;
FX_FLOAT iy = (m_rtThumb.top + m_rtThumb.bottom()) / 2;
- FX_BOOL bVertical = IsVertical();
+ bool bVertical = IsVertical();
rect.left = bVertical ? m_rtClient.left : ix;
rect.top = bVertical ? iy : m_rtClient.top;
rect.width = bVertical ? m_rtClient.width : m_rtClient.right() - ix;
@@ -493,14 +493,14 @@ FX_FLOAT IFWL_ScrollBar::GetTrackPointPos(FX_FLOAT fx, FX_FLOAT fy) {
return fPos;
}
-void IFWL_ScrollBar::GetTrackRect(CFX_RectF& rect, FX_BOOL bLower) {
+void IFWL_ScrollBar::GetTrackRect(CFX_RectF& rect, bool bLower) {
bool bDisabled = !!(m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled);
if (bDisabled || m_bCustomLayout) {
rect = bLower ? m_rtMinTrack : m_rtMaxTrack;
} else {
FX_FLOAT fW = m_rtThumb.width / 2;
FX_FLOAT fH = m_rtThumb.height / 2;
- FX_BOOL bVert = IsVertical();
+ bool bVert = IsVertical();
if (bLower) {
if (bVert) {
FX_FLOAT fMinTrackHeight = m_rtMinTrack.height - fH - m_rtMinBtn.height;
@@ -531,14 +531,14 @@ void IFWL_ScrollBar::GetTrackRect(CFX_RectF& rect, FX_BOOL bLower) {
}
}
-FX_BOOL IFWL_ScrollBar::SendEvent() {
+bool IFWL_ScrollBar::SendEvent() {
if (m_iMinButtonState == CFWL_PartState_Pressed) {
DoScroll(FWL_SCBCODE_StepBackward, m_fTrackPos);
- return FALSE;
+ return false;
}
if (m_iMaxButtonState == CFWL_PartState_Pressed) {
DoScroll(FWL_SCBCODE_StepForward, m_fTrackPos);
- return FALSE;
+ return false;
}
if (m_iMinTrackState == CFWL_PartState_Pressed) {
DoScroll(FWL_SCBCODE_PageBackward, m_fTrackPos);
@@ -553,11 +553,11 @@ FX_BOOL IFWL_ScrollBar::SendEvent() {
m_iMouseWheel < 0 ? FWL_SCBCODE_StepForward : FWL_SCBCODE_StepBackward;
DoScroll(dwCode, m_fTrackPos);
}
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_ScrollBar::OnScroll(uint32_t dwCode, FX_FLOAT fPos) {
- FX_BOOL bRet = TRUE;
+bool IFWL_ScrollBar::OnScroll(uint32_t dwCode, FX_FLOAT fPos) {
+ bool bRet = true;
CFWL_EvtScroll ev;
ev.m_iScrollCode = dwCode;
ev.m_pSrcTarget = this;
@@ -606,8 +606,8 @@ void IFWL_ScrollBar::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
if (!IsEnabled())
return;
- m_bMouseDown = TRUE;
- SetGrab(TRUE);
+ m_bMouseDown = true;
+ SetGrab(true);
m_cpTrackPointX = fx;
m_cpTrackPointY = fy;
m_fLastTrackPos = m_fTrackPos;
@@ -628,13 +628,13 @@ void IFWL_ScrollBar::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
void IFWL_ScrollBar::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
m_pTimerInfo->StopTimer();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
DoMouseUp(0, m_rtMinBtn, m_iMinButtonState, fx, fy);
DoMouseUp(1, m_rtThumb, m_iThumbButtonState, fx, fy);
DoMouseUp(2, m_rtMaxBtn, m_iMaxButtonState, fx, fy);
DoMouseUp(3, m_rtMinTrack, m_iMinTrackState, fx, fy);
DoMouseUp(4, m_rtMaxTrack, m_iMaxTrackState, fx, fy);
- SetGrab(FALSE);
+ SetGrab(false);
}
void IFWL_ScrollBar::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
diff --git a/xfa/fwl/core/ifwl_scrollbar.h b/xfa/fwl/core/ifwl_scrollbar.h
index 1c107638ec..5c41fdd2a1 100644
--- a/xfa/fwl/core/ifwl_scrollbar.h
+++ b/xfa/fwl/core/ifwl_scrollbar.h
@@ -44,7 +44,7 @@ class IFWL_ScrollBar : public IFWL_Widget {
// IFWL_Widget
FWL_Type GetClassID() const override;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
FWL_Error Update() override;
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr) override;
@@ -52,7 +52,7 @@ class IFWL_ScrollBar : public IFWL_Widget {
void OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) override;
- FX_BOOL IsVertical();
+ bool IsVertical();
FWL_Error GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax);
FWL_Error SetRange(FX_FLOAT fMin, FX_FLOAT fMax);
FX_FLOAT GetPageSize();
@@ -63,7 +63,7 @@ class IFWL_ScrollBar : public IFWL_Widget {
FWL_Error SetPos(FX_FLOAT fPos);
FX_FLOAT GetTrackPos();
FWL_Error SetTrackPos(FX_FLOAT fTrackPos);
- FX_BOOL DoScroll(uint32_t dwCode, FX_FLOAT fPos = 0.0f);
+ bool DoScroll(uint32_t dwCode, FX_FLOAT fPos = 0.0f);
FWL_Error SetOuter(IFWL_Widget* pOuter);
protected:
@@ -79,11 +79,11 @@ class IFWL_ScrollBar : public IFWL_Widget {
IFWL_ScrollBar();
void DrawTrack(CFX_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme,
- FX_BOOL bLower = TRUE,
+ bool bLower = true,
const CFX_Matrix* pMatrix = nullptr);
void DrawArrowBtn(CFX_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme,
- FX_BOOL bMinBtn = TRUE,
+ bool bMinBtn = true,
const CFX_Matrix* pMatrix = nullptr);
void DrawThumb(CFX_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme,
@@ -96,9 +96,9 @@ class IFWL_ScrollBar : public IFWL_Widget {
void CalcMinTrackRect(CFX_RectF& rect);
void CalcMaxTrackRect(CFX_RectF& rect);
FX_FLOAT GetTrackPointPos(FX_FLOAT fx, FX_FLOAT fy);
- void GetTrackRect(CFX_RectF& rect, FX_BOOL bLower = TRUE);
- FX_BOOL SendEvent();
- FX_BOOL OnScroll(uint32_t dwCode, FX_FLOAT fPos);
+ void GetTrackRect(CFX_RectF& rect, bool bLower = true);
+ bool SendEvent();
+ bool OnScroll(uint32_t dwCode, FX_FLOAT fPos);
IFWL_TimerInfo* m_pTimerInfo;
FX_FLOAT m_fRangeMin;
@@ -116,12 +116,12 @@ class IFWL_ScrollBar : public IFWL_Widget {
FX_FLOAT m_cpTrackPointX;
FX_FLOAT m_cpTrackPointY;
int32_t m_iMouseWheel;
- FX_BOOL m_bTrackMouseLeave;
- FX_BOOL m_bMouseHover;
- FX_BOOL m_bMouseDown;
- FX_BOOL m_bRepaintThumb;
+ bool m_bTrackMouseLeave;
+ bool m_bMouseHover;
+ bool m_bMouseDown;
+ bool m_bRepaintThumb;
FX_FLOAT m_fButtonLen;
- FX_BOOL m_bMinSize;
+ bool m_bMinSize;
CFX_RectF m_rtClient;
CFX_RectF m_rtThumb;
CFX_RectF m_rtMinBtn;
diff --git a/xfa/fwl/core/ifwl_spinbutton.cpp b/xfa/fwl/core/ifwl_spinbutton.cpp
index 1ad5f0a969..16032345da 100644
--- a/xfa/fwl/core/ifwl_spinbutton.cpp
+++ b/xfa/fwl/core/ifwl_spinbutton.cpp
@@ -30,7 +30,7 @@ IFWL_SpinButton::IFWL_SpinButton(const IFWL_App* app,
m_dwUpState(CFWL_PartState_Normal),
m_dwDnState(CFWL_PartState_Normal),
m_iButtonIndex(0),
- m_bLButtonDwn(FALSE),
+ m_bLButtonDwn(false),
m_pTimerInfo(nullptr),
m_Timer(this) {
m_rtClient.Reset();
@@ -45,10 +45,10 @@ FWL_Type IFWL_SpinButton::GetClassID() const {
return FWL_Type::SpinButton;
}
-FWL_Error IFWL_SpinButton::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error IFWL_SpinButton::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
rect.Set(0, 0, kMinWidth, kMinHeight);
- IFWL_Widget::GetWidgetRect(rect, TRUE);
+ IFWL_Widget::GetWidgetRect(rect, true);
} else {
rect = m_pProperties->m_rtWidget;
}
@@ -112,7 +112,7 @@ FWL_Error IFWL_SpinButton::DrawWidget(CFX_Graphics* pGraphics,
return FWL_Error::Succeeded;
}
-FWL_Error IFWL_SpinButton::EnableButton(FX_BOOL bEnable, FX_BOOL bUp) {
+FWL_Error IFWL_SpinButton::EnableButton(bool bEnable, bool bUp) {
if (bUp)
m_dwUpState = bEnable ? CFWL_PartState_Normal : CFWL_PartState_Disabled;
else
@@ -121,7 +121,7 @@ FWL_Error IFWL_SpinButton::EnableButton(FX_BOOL bEnable, FX_BOOL bUp) {
return FWL_Error::Succeeded;
}
-FX_BOOL IFWL_SpinButton::IsButtonEnable(FX_BOOL bUp) {
+bool IFWL_SpinButton::IsButtonEnable(bool bUp) {
if (bUp)
return (m_dwUpState != CFWL_PartState_Disabled);
return (m_dwDnState != CFWL_PartState_Disabled);
@@ -164,11 +164,11 @@ void IFWL_SpinButton::OnProcessMessage(CFWL_Message* pMessage) {
CFWL_MessageType dwMsgCode = pMessage->GetClassID();
switch (dwMsgCode) {
case CFWL_MessageType::SetFocus: {
- OnFocusChanged(pMessage, TRUE);
+ OnFocusChanged(pMessage, true);
break;
}
case CFWL_MessageType::KillFocus: {
- OnFocusChanged(pMessage, FALSE);
+ OnFocusChanged(pMessage, false);
break;
}
case CFWL_MessageType::Mouse: {
@@ -208,7 +208,7 @@ void IFWL_SpinButton::OnDrawWidget(CFX_Graphics* pGraphics,
DrawWidget(pGraphics, pMatrix);
}
-void IFWL_SpinButton::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
+void IFWL_SpinButton::OnFocusChanged(CFWL_Message* pMsg, bool bSet) {
if (bSet)
m_pProperties->m_dwStates |= (FWL_WGTSTATE_Focused);
else
@@ -218,16 +218,16 @@ void IFWL_SpinButton::OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet) {
}
void IFWL_SpinButton::OnLButtonDown(CFWL_MsgMouse* pMsg) {
- m_bLButtonDwn = TRUE;
- SetGrab(TRUE);
- SetFocus(TRUE);
+ m_bLButtonDwn = true;
+ SetGrab(true);
+ SetFocus(true);
if (!m_pProperties->m_pDataProvider)
return;
- FX_BOOL bUpPress =
- (m_rtUpButton.Contains(pMsg->m_fx, pMsg->m_fy) && IsButtonEnable(TRUE));
- FX_BOOL bDnPress =
- (m_rtDnButton.Contains(pMsg->m_fx, pMsg->m_fy) && IsButtonEnable(FALSE));
+ bool bUpPress =
+ (m_rtUpButton.Contains(pMsg->m_fx, pMsg->m_fy) && IsButtonEnable(true));
+ bool bDnPress =
+ (m_rtDnButton.Contains(pMsg->m_fx, pMsg->m_fy) && IsButtonEnable(false));
if (!bUpPress && !bDnPress)
return;
if (bUpPress) {
@@ -250,22 +250,22 @@ void IFWL_SpinButton::OnLButtonUp(CFWL_MsgMouse* pMsg) {
if (m_pProperties->m_dwStates & CFWL_PartState_Disabled)
return;
- m_bLButtonDwn = FALSE;
- SetGrab(FALSE);
- SetFocus(FALSE);
+ m_bLButtonDwn = false;
+ SetGrab(false);
+ SetFocus(false);
if (m_pTimerInfo) {
m_pTimerInfo->StopTimer();
m_pTimerInfo = nullptr;
}
- FX_BOOL bRepaint = FALSE;
+ bool bRepaint = false;
CFX_RectF rtInvalidate;
- if (m_dwUpState == CFWL_PartState_Pressed && IsButtonEnable(TRUE)) {
+ if (m_dwUpState == CFWL_PartState_Pressed && IsButtonEnable(true)) {
m_dwUpState = CFWL_PartState_Normal;
- bRepaint = TRUE;
+ bRepaint = true;
rtInvalidate = m_rtUpButton;
- } else if (m_dwDnState == CFWL_PartState_Pressed && IsButtonEnable(FALSE)) {
+ } else if (m_dwDnState == CFWL_PartState_Pressed && IsButtonEnable(false)) {
m_dwDnState = CFWL_PartState_Normal;
- bRepaint = TRUE;
+ bRepaint = true;
rtInvalidate = m_rtDnButton;
}
if (bRepaint)
@@ -278,50 +278,50 @@ void IFWL_SpinButton::OnMouseMove(CFWL_MsgMouse* pMsg) {
if (m_bLButtonDwn)
return;
- FX_BOOL bRepaint = FALSE;
+ bool bRepaint = false;
CFX_RectF rtInvlidate;
rtInvlidate.Reset();
if (m_rtUpButton.Contains(pMsg->m_fx, pMsg->m_fy)) {
- if (IsButtonEnable(TRUE)) {
+ if (IsButtonEnable(true)) {
if (m_dwUpState == CFWL_PartState_Hovered) {
m_dwUpState = CFWL_PartState_Hovered;
- bRepaint = TRUE;
+ bRepaint = true;
rtInvlidate = m_rtUpButton;
}
- if (m_dwDnState != CFWL_PartState_Normal && IsButtonEnable(FALSE)) {
+ if (m_dwDnState != CFWL_PartState_Normal && IsButtonEnable(false)) {
m_dwDnState = CFWL_PartState_Normal;
if (bRepaint)
rtInvlidate.Union(m_rtDnButton);
else
rtInvlidate = m_rtDnButton;
- bRepaint = TRUE;
+ bRepaint = true;
}
}
- if (!IsButtonEnable(FALSE))
- EnableButton(FALSE, FALSE);
+ if (!IsButtonEnable(false))
+ EnableButton(false, false);
} else if (m_rtDnButton.Contains(pMsg->m_fx, pMsg->m_fy)) {
- if (IsButtonEnable(FALSE)) {
+ if (IsButtonEnable(false)) {
if (m_dwDnState != CFWL_PartState_Hovered) {
m_dwDnState = CFWL_PartState_Hovered;
- bRepaint = TRUE;
+ bRepaint = true;
rtInvlidate = m_rtDnButton;
}
- if (m_dwUpState != CFWL_PartState_Normal && IsButtonEnable(TRUE)) {
+ if (m_dwUpState != CFWL_PartState_Normal && IsButtonEnable(true)) {
m_dwUpState = CFWL_PartState_Normal;
if (bRepaint)
rtInvlidate.Union(m_rtUpButton);
else
rtInvlidate = m_rtUpButton;
- bRepaint = TRUE;
+ bRepaint = true;
}
}
} else if (m_dwUpState != CFWL_PartState_Normal ||
m_dwDnState != CFWL_PartState_Normal) {
if (m_dwUpState != CFWL_PartState_Normal) {
m_dwUpState = CFWL_PartState_Normal;
- bRepaint = TRUE;
+ bRepaint = true;
rtInvlidate = m_rtUpButton;
}
if (m_dwDnState != CFWL_PartState_Normal) {
@@ -331,7 +331,7 @@ void IFWL_SpinButton::OnMouseMove(CFWL_MsgMouse* pMsg) {
else
rtInvlidate = m_rtDnButton;
- bRepaint = TRUE;
+ bRepaint = true;
}
}
if (bRepaint)
@@ -341,9 +341,9 @@ void IFWL_SpinButton::OnMouseMove(CFWL_MsgMouse* pMsg) {
void IFWL_SpinButton::OnMouseLeave(CFWL_MsgMouse* pMsg) {
if (!pMsg)
return;
- if (m_dwUpState != CFWL_PartState_Normal && IsButtonEnable(TRUE))
+ if (m_dwUpState != CFWL_PartState_Normal && IsButtonEnable(true))
m_dwUpState = CFWL_PartState_Normal;
- if (m_dwDnState != CFWL_PartState_Normal && IsButtonEnable(FALSE))
+ if (m_dwDnState != CFWL_PartState_Normal && IsButtonEnable(false))
m_dwDnState = CFWL_PartState_Normal;
Repaint(&m_rtClient);
@@ -353,15 +353,15 @@ void IFWL_SpinButton::OnKeyDown(CFWL_MsgKey* pMsg) {
if (!m_pProperties->m_pDataProvider)
return;
- FX_BOOL bUp =
+ bool bUp =
pMsg->m_dwKeyCode == FWL_VKEY_Up || pMsg->m_dwKeyCode == FWL_VKEY_Left;
- FX_BOOL bDown =
+ bool bDown =
pMsg->m_dwKeyCode == FWL_VKEY_Down || pMsg->m_dwKeyCode == FWL_VKEY_Right;
if (!bUp && !bDown)
return;
- FX_BOOL bUpEnable = IsButtonEnable(TRUE);
- FX_BOOL bDownEnable = IsButtonEnable(FALSE);
+ bool bUpEnable = IsButtonEnable(true);
+ bool bDownEnable = IsButtonEnable(false);
if (!bUpEnable && !bDownEnable)
return;
diff --git a/xfa/fwl/core/ifwl_spinbutton.h b/xfa/fwl/core/ifwl_spinbutton.h
index 5a6b15628e..a388489a9b 100644
--- a/xfa/fwl/core/ifwl_spinbutton.h
+++ b/xfa/fwl/core/ifwl_spinbutton.h
@@ -17,7 +17,7 @@
class CFWL_MsgMouse;
class CFWL_WidgetImpProperties;
-FWL_EVENT_DEF(CFWL_EvtSpbClick, CFWL_EventType::Click, FX_BOOL m_bUp;)
+FWL_EVENT_DEF(CFWL_EvtSpbClick, CFWL_EventType::Click, bool m_bUp;)
class IFWL_SpinButton : public IFWL_Widget {
public:
@@ -27,7 +27,7 @@ class IFWL_SpinButton : public IFWL_Widget {
// IFWL_Widget
FWL_Type GetClassID() const override;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
FWL_Error Update() override;
FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override;
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
@@ -37,8 +37,8 @@ class IFWL_SpinButton : public IFWL_Widget {
void OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) override;
- FWL_Error EnableButton(FX_BOOL bEnable, FX_BOOL bUp = TRUE);
- FX_BOOL IsButtonEnable(FX_BOOL bUp = TRUE);
+ FWL_Error EnableButton(bool bEnable, bool bUp = true);
+ bool IsButtonEnable(bool bUp = true);
protected:
class Timer : public IFWL_Timer {
@@ -63,12 +63,12 @@ class IFWL_SpinButton : public IFWL_Widget {
uint32_t m_dwUpState;
uint32_t m_dwDnState;
int32_t m_iButtonIndex;
- FX_BOOL m_bLButtonDwn;
+ bool m_bLButtonDwn;
IFWL_TimerInfo* m_pTimerInfo;
IFWL_SpinButton::Timer m_Timer;
private:
- void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet);
+ void OnFocusChanged(CFWL_Message* pMsg, bool bSet);
void OnLButtonDown(CFWL_MsgMouse* pMsg);
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnMouseMove(CFWL_MsgMouse* pMsg);
diff --git a/xfa/fwl/core/ifwl_tooltip.cpp b/xfa/fwl/core/ifwl_tooltip.cpp
index 200cf7adab..2d518c5f83 100644
--- a/xfa/fwl/core/ifwl_tooltip.cpp
+++ b/xfa/fwl/core/ifwl_tooltip.cpp
@@ -20,7 +20,7 @@ IFWL_ToolTip::IFWL_ToolTip(const IFWL_App* app,
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
: IFWL_Form(app, properties, pOuter),
- m_bBtnDown(FALSE),
+ m_bBtnDown(false),
m_dwTTOStyles(FDE_TTOSTYLE_SingleLine),
m_iTTOAlign(FDE_TTOALIGNMENT_Center),
m_pTimerInfoShow(nullptr),
@@ -40,7 +40,7 @@ FWL_Type IFWL_ToolTip::GetClassID() const {
return FWL_Type::ToolTip;
}
-FWL_Error IFWL_ToolTip::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error IFWL_ToolTip::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
rect.Set(0, 0, 0, 0);
if (!m_pProperties->m_pThemeProvider) {
@@ -59,7 +59,7 @@ FWL_Error IFWL_ToolTip::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
rect.width += 25;
rect.height += 16;
}
- IFWL_Widget::GetWidgetRect(rect, TRUE);
+ IFWL_Widget::GetWidgetRect(rect, true);
} else {
rect = m_pProperties->m_rtWidget;
}
@@ -176,7 +176,7 @@ void IFWL_ToolTip::Show() {
}
void IFWL_ToolTip::Hide() {
- SetStates(FWL_WGTSTATE_Invisible, TRUE);
+ SetStates(FWL_WGTSTATE_Invisible, true);
if (m_pTimerInfoHide) {
m_pTimerInfoHide->StopTimer();
m_pTimerInfoHide = nullptr;
@@ -187,7 +187,7 @@ void IFWL_ToolTip::Hide() {
}
}
-void IFWL_ToolTip::SetStates(uint32_t dwStates, FX_BOOL bSet) {
+void IFWL_ToolTip::SetStates(uint32_t dwStates, bool bSet) {
if ((dwStates & FWL_WGTSTATE_Invisible) && !bSet) {
IFWL_ToolTipDP* pData =
static_cast<IFWL_ToolTipDP*>(m_pProperties->m_pDataProvider);
@@ -238,7 +238,7 @@ void IFWL_ToolTip::Timer::Run(IFWL_TimerInfo* pTimerInfo) {
if (pToolTip->m_pTimerInfoShow == pTimerInfo && pToolTip->m_pTimerInfoShow) {
if (pToolTip->GetStates() & FWL_WGTSTATE_Invisible) {
- pToolTip->SetStates(FWL_WGTSTATE_Invisible, FALSE);
+ pToolTip->SetStates(FWL_WGTSTATE_Invisible, false);
pToolTip->RefreshToolTipPos();
pToolTip->m_pTimerInfoShow->StopTimer();
pToolTip->m_pTimerInfoShow = nullptr;
@@ -246,7 +246,7 @@ void IFWL_ToolTip::Timer::Run(IFWL_TimerInfo* pTimerInfo) {
}
}
if (pToolTip->m_pTimerInfoHide == pTimerInfo && pToolTip->m_pTimerInfoHide) {
- pToolTip->SetStates(FWL_WGTSTATE_Invisible, TRUE);
+ pToolTip->SetStates(FWL_WGTSTATE_Invisible, true);
pToolTip->m_pTimerInfoHide->StopTimer();
pToolTip->m_pTimerInfoHide = nullptr;
}
diff --git a/xfa/fwl/core/ifwl_tooltip.h b/xfa/fwl/core/ifwl_tooltip.h
index 0293759165..c2ad663739 100644
--- a/xfa/fwl/core/ifwl_tooltip.h
+++ b/xfa/fwl/core/ifwl_tooltip.h
@@ -41,11 +41,11 @@ class IFWL_ToolTip : public IFWL_Form {
// IFWL_Widget
FWL_Type GetClassID() const override;
- FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
+ FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
FWL_Error Update() override;
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr) override;
- void SetStates(uint32_t dwStates, FX_BOOL bSet) override;
+ void SetStates(uint32_t dwStates, bool bSet) override;
FWL_Error GetClientRect(CFX_RectF& rect) override;
void OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) override;
@@ -75,7 +75,7 @@ class IFWL_ToolTip : public IFWL_Form {
CFX_RectF m_rtClient;
CFX_RectF m_rtCaption;
- FX_BOOL m_bBtnDown;
+ bool m_bBtnDown;
uint32_t m_dwTTOStyles;
int32_t m_iTTOAlign;
CFX_RectF m_rtAnchor;
@@ -85,7 +85,7 @@ class IFWL_ToolTip : public IFWL_Form {
IFWL_ToolTip::Timer m_TimerHide;
private:
- void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet);
+ void OnFocusChanged(CFWL_Message* pMsg, bool bSet);
void OnLButtonDown(CFWL_MsgMouse* pMsg);
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnMouseMove(CFWL_MsgMouse* pMsg);
diff --git a/xfa/fwl/core/ifwl_widget.cpp b/xfa/fwl/core/ifwl_widget.cpp
index f57d0a11c7..7bcdf18386 100644
--- a/xfa/fwl/core/ifwl_widget.cpp
+++ b/xfa/fwl/core/ifwl_widget.cpp
@@ -53,11 +53,11 @@ IFWL_Widget::~IFWL_Widget() {
m_pWidgetMgr->RemoveWidget(this);
}
-FX_BOOL IFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const {
- return FALSE;
+bool IFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const {
+ return false;
}
-FWL_Error IFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error IFWL_Widget::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
if (HasEdge()) {
FX_FLOAT fEdge = GetEdgeWidth();
@@ -176,7 +176,7 @@ static void NotifyHideChildWidget(CFWL_WidgetMgr* widgetMgr,
}
}
-void IFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) {
+void IFWL_Widget::SetStates(uint32_t dwStates, bool bSet) {
bSet ? (m_pProperties->m_dwStates |= dwStates)
: (m_pProperties->m_dwStates &= ~dwStates);
if (!(dwStates & FWL_WGTSTATE_Invisible) || !bSet)
@@ -254,7 +254,7 @@ FWL_Error IFWL_Widget::TransformTo(IFWL_Widget* pWidget,
GetWidgetRect(r);
fx += r.left;
fy += r.top;
- GetMatrix(m, TRUE);
+ GetMatrix(m, true);
m.TransformPoint(fx, fy);
}
IFWL_Widget* form1 = m_pWidgetMgr->GetSystemFormWidget(this);
@@ -279,7 +279,7 @@ FWL_Error IFWL_Widget::TransformTo(IFWL_Widget* pWidget,
}
parent = pWidget->GetParent();
if (parent) {
- pWidget->GetMatrix(m, TRUE);
+ pWidget->GetMatrix(m, true);
CFX_Matrix m1;
m1.SetIdentity();
m1.SetReverse(m);
@@ -295,7 +295,7 @@ FWL_Error IFWL_Widget::TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt) {
return TransformTo(pWidget, rt.left, rt.top);
}
-FWL_Error IFWL_Widget::GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal) {
+FWL_Error IFWL_Widget::GetMatrix(CFX_Matrix& matrix, bool bGlobal) {
if (!m_pProperties)
return FWL_Error::Indefinite;
if (bGlobal) {
@@ -311,12 +311,12 @@ FWL_Error IFWL_Widget::GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal) {
int32_t count = parents.GetSize();
for (int32_t i = count - 2; i >= 0; i--) {
parent = parents.GetAt(i);
- parent->GetMatrix(ctmOnParent, FALSE);
+ parent->GetMatrix(ctmOnParent, false);
parent->GetWidgetRect(rect);
- matrix.Concat(ctmOnParent, TRUE);
- matrix.Translate(rect.left, rect.top, TRUE);
+ matrix.Concat(ctmOnParent, true);
+ matrix.Translate(rect.left, rect.top, true);
}
- matrix.Concat(m_pProperties->m_ctmOnParent, TRUE);
+ matrix.Concat(m_pProperties->m_ctmOnParent, true);
parents.RemoveAll();
} else {
matrix = m_pProperties->m_ctmOnParent;
@@ -371,44 +371,44 @@ void IFWL_Widget::SetLayoutItem(void* pItem) {
void IFWL_Widget::SetAssociateWidget(CFWL_Widget* pAssociate) {
m_pAssociate = pAssociate;
}
-FX_BOOL IFWL_Widget::IsEnabled() const {
+bool IFWL_Widget::IsEnabled() const {
return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0;
}
-FX_BOOL IFWL_Widget::IsVisible() const {
+bool IFWL_Widget::IsVisible() const {
return (m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) == 0;
}
-FX_BOOL IFWL_Widget::IsActive() const {
+bool IFWL_Widget::IsActive() const {
return (m_pProperties->m_dwStates & FWL_WGTSTATE_Deactivated) == 0;
}
-FX_BOOL IFWL_Widget::IsOverLapper() const {
+bool IFWL_Widget::IsOverLapper() const {
return (m_pProperties->m_dwStyles & FWL_WGTSTYLE_WindowTypeMask) ==
FWL_WGTSTYLE_OverLapper;
}
-FX_BOOL IFWL_Widget::IsPopup() const {
+bool IFWL_Widget::IsPopup() const {
return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Popup);
}
-FX_BOOL IFWL_Widget::IsChild() const {
+bool IFWL_Widget::IsChild() const {
return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Child);
}
-FX_BOOL IFWL_Widget::IsLocked() const {
+bool IFWL_Widget::IsLocked() const {
return m_iLock > 0;
}
-FX_BOOL IFWL_Widget::IsOffscreen() const {
+bool IFWL_Widget::IsOffscreen() const {
return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Offscreen);
}
-FX_BOOL IFWL_Widget::HasBorder() const {
+bool IFWL_Widget::HasBorder() const {
return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border);
}
-FX_BOOL IFWL_Widget::HasEdge() const {
+bool IFWL_Widget::HasEdge() const {
return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_EdgeMask);
}
@@ -417,12 +417,12 @@ void IFWL_Widget::GetEdgeRect(CFX_RectF& rtEdge) {
rtEdge.left = rtEdge.top = 0;
if (HasBorder()) {
FX_FLOAT fCX = GetBorderSize();
- FX_FLOAT fCY = GetBorderSize(FALSE);
+ FX_FLOAT fCY = GetBorderSize(false);
rtEdge.Deflate(fCX, fCY);
}
}
-FX_FLOAT IFWL_Widget::GetBorderSize(FX_BOOL bCX) {
+FX_FLOAT IFWL_Widget::GetBorderSize(bool bCX) {
FX_FLOAT* pfBorder = static_cast<FX_FLOAT*>(GetThemeCapacity(
bCX ? CFWL_WidgetCapacity::CXBorder : CFWL_WidgetCapacity::CYBorder));
if (!pfBorder)
@@ -501,7 +501,7 @@ IFWL_Widget* IFWL_Widget::GetRootOuter() {
CFX_SizeF IFWL_Widget::CalcTextSize(const CFX_WideString& wsText,
IFWL_ThemeProvider* pTheme,
- FX_BOOL bMultiLine,
+ bool bMultiLine,
int32_t iLineWidth) {
if (!pTheme)
return CFX_SizeF();
@@ -535,7 +535,7 @@ void IFWL_Widget::CalcTextRect(const CFX_WideString& wsText,
pTheme->CalcTextRect(&calPart, rect);
}
-void IFWL_Widget::SetFocus(FX_BOOL bFocus) {
+void IFWL_Widget::SetFocus(bool bFocus) {
if (m_pWidgetMgr->IsFormDisabled())
return;
@@ -556,7 +556,7 @@ void IFWL_Widget::SetFocus(FX_BOOL bFocus) {
}
}
-void IFWL_Widget::SetGrab(FX_BOOL bSet) {
+void IFWL_Widget::SetGrab(bool bSet) {
const IFWL_App* pApp = GetOwnerApp();
if (!pApp)
return;
@@ -565,10 +565,10 @@ void IFWL_Widget::SetGrab(FX_BOOL bSet) {
pDriver->SetGrab(this, bSet);
}
-FX_BOOL IFWL_Widget::GetPopupPos(FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
- const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup) {
+bool IFWL_Widget::GetPopupPos(FX_FLOAT fMinHeight,
+ FX_FLOAT fMaxHeight,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup) {
if (GetClassID() == FWL_Type::ComboBox) {
if (m_pWidgetMgr->IsFormDisabled()) {
return m_pWidgetMgr->GetAdapterPopupPos(this, fMinHeight, fMaxHeight,
@@ -584,17 +584,17 @@ FX_BOOL IFWL_Widget::GetPopupPos(FX_FLOAT fMinHeight,
return GetPopupPosGeneral(fMinHeight, fMaxHeight, rtAnchor, rtPopup);
}
-FX_BOOL IFWL_Widget::GetPopupPosMenu(FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
- const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup) {
+bool IFWL_Widget::GetPopupPosMenu(FX_FLOAT fMinHeight,
+ FX_FLOAT fMaxHeight,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup) {
FX_FLOAT fx = 0;
FX_FLOAT fy = 0;
FX_FLOAT fScreenWidth = 0;
FX_FLOAT fScreenHeight = 0;
GetScreenSize(fScreenWidth, fScreenHeight);
if (GetStylesEx() & FWL_STYLEEXT_MNU_Vert) {
- FX_BOOL bLeft = m_pProperties->m_rtWidget.left < 0;
+ bool bLeft = m_pProperties->m_rtWidget.left < 0;
FX_FLOAT fRight = rtAnchor.right() + rtPopup.width;
TransformTo(nullptr, fx, fy);
if (fRight + fx > fScreenWidth || bLeft) {
@@ -616,13 +616,13 @@ FX_BOOL IFWL_Widget::GetPopupPosMenu(FX_FLOAT fMinHeight,
}
}
rtPopup.Offset(fx, fy);
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_Widget::GetPopupPosComboBox(FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
- const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup) {
+bool IFWL_Widget::GetPopupPosComboBox(FX_FLOAT fMinHeight,
+ FX_FLOAT fMaxHeight,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup) {
FX_FLOAT fx = 0;
FX_FLOAT fy = 0;
FX_FLOAT fScreenWidth = 0;
@@ -643,13 +643,13 @@ FX_BOOL IFWL_Widget::GetPopupPosComboBox(FX_FLOAT fMinHeight,
rtPopup.Set(rtAnchor.left, rtAnchor.bottom(), fWidth, fPopHeight);
}
rtPopup.Offset(fx, fy);
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_Widget::GetPopupPosGeneral(FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
- const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup) {
+bool IFWL_Widget::GetPopupPosGeneral(FX_FLOAT fMinHeight,
+ FX_FLOAT fMaxHeight,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup) {
FX_FLOAT fx = 0;
FX_FLOAT fy = 0;
FX_FLOAT fScreenWidth = 0;
@@ -664,11 +664,11 @@ FX_BOOL IFWL_Widget::GetPopupPosGeneral(FX_FLOAT fMinHeight,
rtPopup.height);
}
rtPopup.Offset(fx, fy);
- return TRUE;
+ return true;
}
-FX_BOOL IFWL_Widget::GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy) {
- return FALSE;
+bool IFWL_Widget::GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy) {
+ return false;
}
void IFWL_Widget::RegisterEventTarget(IFWL_Widget* pEventSource,
@@ -744,7 +744,7 @@ void IFWL_Widget::DrawBackground(CFX_Graphics* pGraphics,
param.m_iPart = iPartBk;
param.m_pGraphics = pGraphics;
if (pMatrix) {
- param.m_matrix.Concat(*pMatrix, TRUE);
+ param.m_matrix.Concat(*pMatrix, true);
}
param.m_rtPart = rtRelative;
pTheme->DrawBackground(&param);
@@ -761,7 +761,7 @@ void IFWL_Widget::DrawBorder(CFX_Graphics* pGraphics,
param.m_iPart = iPartBorder;
param.m_pGraphics = pGraphics;
if (pMatrix) {
- param.m_matrix.Concat(*pMatrix, TRUE);
+ param.m_matrix.Concat(*pMatrix, true);
}
param.m_rtPart = rtRelative;
pTheme->DrawBackground(&param);
@@ -778,7 +778,7 @@ void IFWL_Widget::DrawEdge(CFX_Graphics* pGraphics,
param.m_iPart = iPartEdge;
param.m_pGraphics = pGraphics;
if (pMatrix) {
- param.m_matrix.Concat(*pMatrix, TRUE);
+ param.m_matrix.Concat(*pMatrix, true);
}
param.m_rtPart = rtEdge;
pTheme->DrawBackground(&param);
@@ -818,14 +818,14 @@ CFX_SizeF IFWL_Widget::GetOffsetFromParent(IFWL_Widget* pParent) {
return szRet;
}
-FX_BOOL IFWL_Widget::IsParent(IFWL_Widget* pParent) {
+bool IFWL_Widget::IsParent(IFWL_Widget* pParent) {
IFWL_Widget* pUpWidget = GetParent();
while (pUpWidget) {
if (pUpWidget == pParent)
- return TRUE;
+ return true;
pUpWidget = pUpWidget->GetParent();
}
- return FALSE;
+ return false;
}
void IFWL_Widget::OnProcessMessage(CFWL_Message* pMessage) {
diff --git a/xfa/fwl/core/ifwl_widget.h b/xfa/fwl/core/ifwl_widget.h
index 0c8cef1adc..b5dc1f9391 100644
--- a/xfa/fwl/core/ifwl_widget.h
+++ b/xfa/fwl/core/ifwl_widget.h
@@ -67,9 +67,9 @@ class IFWL_Widget : public IFWL_WidgetDelegate {
~IFWL_Widget() override;
virtual FWL_Type GetClassID() const = 0;
- virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const;
+ virtual bool IsInstance(const CFX_WideStringC& wsClass) const;
- virtual FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE);
+ virtual FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false);
virtual FWL_Error GetGlobalRect(CFX_RectF& rect);
virtual FWL_Error SetWidgetRect(const CFX_RectF& rect);
virtual FWL_Error GetClientRect(CFX_RectF& rect);
@@ -90,7 +90,7 @@ class IFWL_Widget : public IFWL_WidgetDelegate {
uint32_t dwStylesExRemoved);
virtual uint32_t GetStates();
- virtual void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE);
+ virtual void SetStates(uint32_t dwStates, bool bSet = true);
virtual FWL_Error Update();
virtual FWL_Error LockUpdate();
@@ -103,7 +103,7 @@ class IFWL_Widget : public IFWL_WidgetDelegate {
FX_FLOAT& fy);
virtual FWL_Error TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt);
- virtual FWL_Error GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE);
+ virtual FWL_Error GetMatrix(CFX_Matrix& matrix, bool bGlobal = false);
virtual FWL_Error SetMatrix(const CFX_Matrix& matrix);
virtual FWL_Error DrawWidget(CFX_Graphics* pGraphics,
@@ -138,7 +138,7 @@ class IFWL_Widget : public IFWL_WidgetDelegate {
void SetAssociateWidget(CFWL_Widget* pAssociate);
- void SetFocus(FX_BOOL bFocus);
+ void SetFocus(bool bFocus);
void Repaint(const CFX_RectF* pRect = nullptr);
protected:
@@ -148,18 +148,18 @@ class IFWL_Widget : public IFWL_WidgetDelegate {
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter);
- FX_BOOL IsEnabled() const;
- FX_BOOL IsVisible() const;
- FX_BOOL IsActive() const;
- FX_BOOL IsOverLapper() const;
- FX_BOOL IsPopup() const;
- FX_BOOL IsChild() const;
- FX_BOOL IsLocked() const;
- FX_BOOL IsOffscreen() const;
- FX_BOOL HasBorder() const;
- FX_BOOL HasEdge() const;
+ bool IsEnabled() const;
+ bool IsVisible() const;
+ bool IsActive() const;
+ bool IsOverLapper() const;
+ bool IsPopup() const;
+ bool IsChild() const;
+ bool IsLocked() const;
+ bool IsOffscreen() const;
+ bool HasBorder() const;
+ bool HasEdge() const;
void GetEdgeRect(CFX_RectF& rtEdge);
- FX_FLOAT GetBorderSize(FX_BOOL bCX = TRUE);
+ FX_FLOAT GetBorderSize(bool bCX = true);
FX_FLOAT GetEdgeWidth();
void GetRelativeRect(CFX_RectF& rect);
void* GetThemeCapacity(CFWL_WidgetCapacity dwCapacity);
@@ -167,31 +167,31 @@ class IFWL_Widget : public IFWL_WidgetDelegate {
IFWL_Widget* GetRootOuter();
CFX_SizeF CalcTextSize(const CFX_WideString& wsText,
IFWL_ThemeProvider* pTheme,
- FX_BOOL bMultiLine = FALSE,
+ bool bMultiLine = false,
int32_t iLineWidth = -1);
void CalcTextRect(const CFX_WideString& wsText,
IFWL_ThemeProvider* pTheme,
uint32_t dwTTOStyles,
int32_t iTTOAlign,
CFX_RectF& rect);
- void SetGrab(FX_BOOL bSet);
- FX_BOOL GetPopupPos(FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
- const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup);
- FX_BOOL GetPopupPosMenu(FX_FLOAT fMinHeight,
+ void SetGrab(bool bSet);
+ bool GetPopupPos(FX_FLOAT fMinHeight,
+ FX_FLOAT fMaxHeight,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup);
+ bool GetPopupPosMenu(FX_FLOAT fMinHeight,
+ FX_FLOAT fMaxHeight,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup);
+ bool GetPopupPosComboBox(FX_FLOAT fMinHeight,
+ FX_FLOAT fMaxHeight,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup);
+ bool GetPopupPosGeneral(FX_FLOAT fMinHeight,
FX_FLOAT fMaxHeight,
const CFX_RectF& rtAnchor,
CFX_RectF& rtPopup);
- FX_BOOL GetPopupPosComboBox(FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
- const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup);
- FX_BOOL GetPopupPosGeneral(FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
- const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup);
- FX_BOOL GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy);
+ bool GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy);
void RegisterEventTarget(IFWL_Widget* pEventSource = nullptr,
uint32_t dwFilter = FWL_EVENT_ALL_MASK);
void UnregisterEventTarget();
@@ -211,7 +211,7 @@ class IFWL_Widget : public IFWL_WidgetDelegate {
const CFX_Matrix* pMatrix = nullptr);
void NotifyDriver();
- FX_BOOL IsParent(IFWL_Widget* pParent);
+ bool IsParent(IFWL_Widget* pParent);
const IFWL_App* const m_pOwnerApp;
CFWL_WidgetMgr* const m_pWidgetMgr;
diff --git a/xfa/fwl/theme/cfwl_arrowdata.cpp b/xfa/fwl/theme/cfwl_arrowdata.cpp
index 16580f7f9c..51af713cbb 100644
--- a/xfa/fwl/theme/cfwl_arrowdata.cpp
+++ b/xfa/fwl/theme/cfwl_arrowdata.cpp
@@ -20,7 +20,7 @@ CFWL_ArrowData* CFWL_ArrowData::GetInstance() {
return g_pInstance;
}
-FX_BOOL CFWL_ArrowData::HasInstance() {
+bool CFWL_ArrowData::HasInstance() {
return !!g_pInstance;
}
diff --git a/xfa/fwl/theme/cfwl_arrowdata.h b/xfa/fwl/theme/cfwl_arrowdata.h
index efec1b50b1..1bcdac15fb 100644
--- a/xfa/fwl/theme/cfwl_arrowdata.h
+++ b/xfa/fwl/theme/cfwl_arrowdata.h
@@ -22,7 +22,7 @@ class CFWL_ArrowData {
};
static CFWL_ArrowData* GetInstance();
- static FX_BOOL HasInstance();
+ static bool HasInstance();
static void DestroyInstance();
void SetColorData(uint32_t dwID);
diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.cpp b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
index b554483dcd..b50d492ade 100644
--- a/xfa/fwl/theme/cfwl_monthcalendartp.cpp
+++ b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
@@ -144,8 +144,8 @@ void CFWL_MonthCalendarTP::DrawText(CFWL_ThemeText* pParams) {
void* CFWL_MonthCalendarTP::GetCapacity(CFWL_ThemePart* pThemePart,
CFWL_WidgetCapacity dwCapacity) {
- FX_BOOL bDefPro = FALSE;
- FX_BOOL bDwordVal = FALSE;
+ bool bDefPro = false;
+ bool bDwordVal = false;
switch (dwCapacity) {
case CFWL_WidgetCapacity::HeaderWidth: {
m_fValue = kHeaderWidth;
@@ -164,7 +164,7 @@ void* CFWL_MonthCalendarTP::GetCapacity(CFWL_ThemePart* pThemePart,
break;
}
case CFWL_WidgetCapacity::HeaderBtnHMargin: {
- bDwordVal = TRUE;
+ bDwordVal = true;
m_dwValue = kButtonHorizontalMargin;
break;
}
@@ -341,7 +341,7 @@ void* CFWL_MonthCalendarTP::GetCapacity(CFWL_ThemePart* pThemePart,
return &wsResource;
}
default:
- bDefPro = TRUE;
+ bDefPro = true;
break;
}
if (!bDefPro) {
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.cpp b/xfa/fwl/theme/cfwl_scrollbartp.cpp
index faad11f2c3..5a1ae5cfb6 100644
--- a/xfa/fwl/theme/cfwl_scrollbartp.cpp
+++ b/xfa/fwl/theme/cfwl_scrollbartp.cpp
@@ -75,15 +75,15 @@ void CFWL_ScrollBarTP::DrawBackground(CFWL_ThemeBackground* pParams) {
break;
}
case CFWL_Part::Thumb: {
- DrawThumbBtn(pGraphics, pRect, bVert, eState, TRUE, &pParams->m_matrix);
+ DrawThumbBtn(pGraphics, pRect, bVert, eState, true, &pParams->m_matrix);
break;
}
case CFWL_Part::LowerTrack: {
- DrawTrack(pGraphics, pRect, bVert, eState, TRUE, &pParams->m_matrix);
+ DrawTrack(pGraphics, pRect, bVert, eState, true, &pParams->m_matrix);
break;
}
case CFWL_Part::UpperTrack: {
- DrawTrack(pGraphics, pRect, bVert, eState, FALSE, &pParams->m_matrix);
+ DrawTrack(pGraphics, pRect, bVert, eState, false, &pParams->m_matrix);
break;
}
default:
@@ -93,9 +93,9 @@ void CFWL_ScrollBarTP::DrawBackground(CFWL_ThemeBackground* pParams) {
void CFWL_ScrollBarTP::DrawThumbBtn(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
- FX_BOOL bVert,
+ bool bVert,
FWLTHEME_STATE eState,
- FX_BOOL bPawButton,
+ bool bPawButton,
CFX_Matrix* pMatrix) {
if (eState < FWLTHEME_STATE_Normal || eState > FWLTHEME_STATE_Disable)
return;
@@ -140,7 +140,7 @@ void CFWL_ScrollBarTP::DrawThumbBtn(CFX_Graphics* pGraphics,
void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
- FX_BOOL bVert,
+ bool bVert,
FWLTHEME_STATE eState,
CFX_Matrix* pMatrix) {
CFX_Path path;
@@ -216,9 +216,9 @@ void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics,
void CFWL_ScrollBarTP::DrawTrack(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
- FX_BOOL bVert,
+ bool bVert,
FWLTHEME_STATE eState,
- FX_BOOL bLowerTrack,
+ bool bLowerTrack,
CFX_Matrix* pMatrix) {
if (eState < FWLTHEME_STATE_Normal || eState > FWLTHEME_STATE_Disable)
return;
@@ -257,7 +257,7 @@ void CFWL_ScrollBarTP::DrawMaxMinBtn(CFX_Graphics* pGraphics,
CFX_Matrix* pMatrix) {
DrawTrack(pGraphics, pRect,
eDict == FWLTHEME_DIRECTION_Up || eDict == FWLTHEME_DIRECTION_Down,
- eState, TRUE, pMatrix);
+ eState, true, pMatrix);
CFX_RectF rtArrowBtn(*pRect);
rtArrowBtn.Deflate(1, 1, 1, 1);
DrawArrowBtn(pGraphics, &rtArrowBtn, eDict, eState, pMatrix);
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.h b/xfa/fwl/theme/cfwl_scrollbartp.h
index 6caf8f4917..128eeb4d76 100644
--- a/xfa/fwl/theme/cfwl_scrollbartp.h
+++ b/xfa/fwl/theme/cfwl_scrollbartp.h
@@ -35,15 +35,15 @@ class CFWL_ScrollBarTP : public CFWL_WidgetTP {
void DrawThumbBtn(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
- FX_BOOL bVert,
+ bool bVert,
FWLTHEME_STATE eState,
- FX_BOOL bPawButton = TRUE,
+ bool bPawButton = true,
CFX_Matrix* pMatrix = nullptr);
void DrawTrack(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
- FX_BOOL bVert,
+ bool bVert,
FWLTHEME_STATE eState,
- FX_BOOL bLowerTrack,
+ bool bLowerTrack,
CFX_Matrix* pMatrix = nullptr);
void DrawMaxMinBtn(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
@@ -52,7 +52,7 @@ class CFWL_ScrollBarTP : public CFWL_WidgetTP {
CFX_Matrix* pMatrix = nullptr);
void DrawPaw(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
- FX_BOOL bVert,
+ bool bVert,
FWLTHEME_STATE eState,
CFX_Matrix* pMatrix = nullptr);
void SetThemeData(uint32_t dwID);
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index f313511164..bbcbabbb54 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -37,7 +37,7 @@ const float kCYBorder = 1.0f;
} // namespace
bool CFWL_WidgetTP::IsValidWidget(IFWL_Widget* pWidget) {
- return FALSE;
+ return false;
}
uint32_t CFWL_WidgetTP::GetThemeID(IFWL_Widget* pWidget) {
@@ -418,7 +418,7 @@ void CFWL_WidgetTP::DrawAxialShading(CFX_Graphics* pGraphics,
CFX_PointF begPoint(fx1, fy1);
CFX_PointF endPoint(fx2, fy2);
- CFX_Shading shading(begPoint, endPoint, FALSE, FALSE, beginColor, endColor);
+ CFX_Shading shading(begPoint, endPoint, false, false, beginColor, endColor);
pGraphics->SaveGraphState();
CFX_Color color1(&shading);
pGraphics->SetFillColor(&color1);
@@ -496,7 +496,7 @@ void CFWL_WidgetTP::DrawArrow(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FWLTHEME_DIRECTION eDict,
FX_ARGB argbFill,
- FX_BOOL bPressed,
+ bool bPressed,
CFX_Matrix* pMatrix) {
CFX_RectF rtArrow(*pRect);
CFX_Path path;
@@ -552,7 +552,7 @@ void CFWL_WidgetTP::DrawArrow(CFX_Graphics* pGraphics,
FWLTHEME_DIRECTION eDict,
FX_ARGB argSign,
CFX_Matrix* pMatrix) {
- FX_BOOL bVert =
+ bool bVert =
(eDict == FWLTHEME_DIRECTION_Up || eDict == FWLTHEME_DIRECTION_Down);
FX_FLOAT fLeft =
(FX_FLOAT)(((pRect->width - (bVert ? 9 : 6)) / 2 + pRect->left) + 0.5);
@@ -649,16 +649,16 @@ CFWL_FontData::CFWL_FontData() : m_dwStyles(0), m_dwCodePage(0) {}
CFWL_FontData::~CFWL_FontData() {}
-FX_BOOL CFWL_FontData::Equal(const CFX_WideStringC& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage) {
+bool CFWL_FontData::Equal(const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage) {
return m_wsFamily == wsFontFamily && m_dwStyles == dwFontStyles &&
m_dwCodePage == wCodePage;
}
-FX_BOOL CFWL_FontData::LoadFont(const CFX_WideStringC& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t dwCodePage) {
+bool CFWL_FontData::LoadFont(const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t dwCodePage) {
m_wsFamily = wsFontFamily;
m_dwStyles = dwFontStyles;
m_dwCodePage = dwCodePage;
diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h
index 02f3981077..73625d05d8 100644
--- a/xfa/fwl/theme/cfwl_widgettp.h
+++ b/xfa/fwl/theme/cfwl_widgettp.h
@@ -196,7 +196,7 @@ class CFWL_WidgetTP {
const CFX_RectF* pRect,
FWLTHEME_DIRECTION eDict,
FX_ARGB argbFill,
- FX_BOOL bPressed,
+ bool bPressed,
CFX_Matrix* pMatrix = nullptr);
void DrawArrow(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
@@ -230,12 +230,12 @@ class CFWL_FontData {
CFWL_FontData();
virtual ~CFWL_FontData();
- FX_BOOL Equal(const CFX_WideStringC& wsFontFamily,
+ bool Equal(const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage);
+ bool LoadFont(const CFX_WideStringC& wsFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage);
- FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage);
CFGAS_GEFont* GetFont() const { return m_pFont.get(); }
protected:
diff --git a/xfa/fxbarcode/BC_TwoDimWriter.cpp b/xfa/fxbarcode/BC_TwoDimWriter.cpp
index 2ad60bbde3..83b7b3c081 100644
--- a/xfa/fxbarcode/BC_TwoDimWriter.cpp
+++ b/xfa/fxbarcode/BC_TwoDimWriter.cpp
@@ -14,7 +14,7 @@
#include "xfa/fxbarcode/BC_Writer.h"
#include "xfa/fxbarcode/common/BC_CommonBitMatrix.h"
-CBC_TwoDimWriter::CBC_TwoDimWriter() : m_iCorrectLevel(1), m_bFixedSize(TRUE) {}
+CBC_TwoDimWriter::CBC_TwoDimWriter() : m_iCorrectLevel(1), m_bFixedSize(true) {}
CBC_TwoDimWriter::~CBC_TwoDimWriter() {}
diff --git a/xfa/fxbarcode/BC_TwoDimWriter.h b/xfa/fxbarcode/BC_TwoDimWriter.h
index 76f176bfaf..ad4658b008 100644
--- a/xfa/fxbarcode/BC_TwoDimWriter.h
+++ b/xfa/fxbarcode/BC_TwoDimWriter.h
@@ -26,13 +26,13 @@ class CBC_TwoDimWriter : public CBC_Writer {
virtual void RenderBitmapResult(CFX_DIBitmap*& pOutBitmap, int32_t& e);
virtual void RenderDeviceResult(CFX_RenderDevice* device,
const CFX_Matrix* matrix);
- virtual FX_BOOL SetErrorCorrectionLevel(int32_t level) = 0;
+ virtual bool SetErrorCorrectionLevel(int32_t level) = 0;
int32_t GetErrorCorrectionLevel() const;
protected:
int32_t m_iCorrectLevel;
- FX_BOOL m_bFixedSize;
+ bool m_bFixedSize;
std::unique_ptr<CBC_CommonBitMatrix> m_output;
};
diff --git a/xfa/fxbarcode/BC_Utils.cpp b/xfa/fxbarcode/BC_Utils.cpp
index d750f9d6fe..807b04861d 100644
--- a/xfa/fxbarcode/BC_Utils.cpp
+++ b/xfa/fxbarcode/BC_Utils.cpp
@@ -7,19 +7,19 @@
#include "core/fxcrt/fx_basic.h"
#include "xfa/fxbarcode/utils.h"
-FX_BOOL BC_FX_ByteString_Replace(CFX_ByteString& dst,
- uint32_t first,
- uint32_t last,
- int32_t count,
- FX_CHAR c) {
+bool BC_FX_ByteString_Replace(CFX_ByteString& dst,
+ uint32_t first,
+ uint32_t last,
+ int32_t count,
+ FX_CHAR c) {
if (first > last || count <= 0) {
- return FALSE;
+ return false;
}
dst.Delete(first, last - first);
for (int32_t i = 0; i < count; i++) {
dst.Insert(0, c);
}
- return TRUE;
+ return true;
}
void BC_FX_ByteString_Append(CFX_ByteString& dst, int32_t count, FX_CHAR c) {
for (int32_t i = 0; i < count; i++) {
diff --git a/xfa/fxbarcode/BC_Writer.cpp b/xfa/fxbarcode/BC_Writer.cpp
index 835a2f0309..73163522cb 100644
--- a/xfa/fxbarcode/BC_Writer.cpp
+++ b/xfa/fxbarcode/BC_Writer.cpp
@@ -17,31 +17,31 @@ CBC_Writer::CBC_Writer() {
m_backgroundColor = 0xffffffff;
}
CBC_Writer::~CBC_Writer() {}
-FX_BOOL CBC_Writer::SetCharEncoding(int32_t encoding) {
+bool CBC_Writer::SetCharEncoding(int32_t encoding) {
m_CharEncoding = encoding;
- return TRUE;
+ return true;
}
-FX_BOOL CBC_Writer::SetModuleHeight(int32_t moduleHeight) {
+bool CBC_Writer::SetModuleHeight(int32_t moduleHeight) {
if (moduleHeight > 10 || moduleHeight < 1) {
- return FALSE;
+ return false;
}
m_ModuleHeight = moduleHeight;
- return TRUE;
+ return true;
}
-FX_BOOL CBC_Writer::SetModuleWidth(int32_t moduleWidth) {
+bool CBC_Writer::SetModuleWidth(int32_t moduleWidth) {
if (moduleWidth > 10 || moduleWidth < 1) {
- return FALSE;
+ return false;
}
m_ModuleWidth = moduleWidth;
- return TRUE;
+ return true;
}
-FX_BOOL CBC_Writer::SetHeight(int32_t height) {
+bool CBC_Writer::SetHeight(int32_t height) {
m_Height = height;
- return TRUE;
+ return true;
}
-FX_BOOL CBC_Writer::SetWidth(int32_t width) {
+bool CBC_Writer::SetWidth(int32_t width) {
m_Width = width;
- return TRUE;
+ return true;
}
void CBC_Writer::SetBackgroundColor(FX_ARGB backgroundColor) {
m_backgroundColor = backgroundColor;
diff --git a/xfa/fxbarcode/BC_Writer.h b/xfa/fxbarcode/BC_Writer.h
index 888db560ae..90ea06a397 100644
--- a/xfa/fxbarcode/BC_Writer.h
+++ b/xfa/fxbarcode/BC_Writer.h
@@ -15,11 +15,11 @@ class CBC_Writer {
public:
CBC_Writer();
virtual ~CBC_Writer();
- virtual FX_BOOL SetCharEncoding(int32_t encoding);
- virtual FX_BOOL SetModuleHeight(int32_t moduleHeight);
- virtual FX_BOOL SetModuleWidth(int32_t moduleWidth);
- virtual FX_BOOL SetHeight(int32_t height);
- virtual FX_BOOL SetWidth(int32_t width);
+ virtual bool SetCharEncoding(int32_t encoding);
+ virtual bool SetModuleHeight(int32_t moduleHeight);
+ virtual bool SetModuleWidth(int32_t moduleWidth);
+ virtual bool SetHeight(int32_t height);
+ virtual bool SetWidth(int32_t width);
virtual void SetBackgroundColor(FX_ARGB backgroundColor);
virtual void SetBarcodeColor(FX_ARGB foregroundColor);
diff --git a/xfa/fxbarcode/cbc_codabar.cpp b/xfa/fxbarcode/cbc_codabar.cpp
index 896342a245..e8e8cdc997 100644
--- a/xfa/fxbarcode/cbc_codabar.cpp
+++ b/xfa/fxbarcode/cbc_codabar.cpp
@@ -27,38 +27,38 @@ CBC_Codabar::CBC_Codabar() : CBC_OneCode(new CBC_OnedCodaBarWriter) {}
CBC_Codabar::~CBC_Codabar() {}
-FX_BOOL CBC_Codabar::SetStartChar(FX_CHAR start) {
+bool CBC_Codabar::SetStartChar(FX_CHAR start) {
if (!m_pBCWriter)
- return FALSE;
+ return false;
return static_cast<CBC_OnedCodaBarWriter*>(m_pBCWriter.get())
->SetStartChar(start);
}
-FX_BOOL CBC_Codabar::SetEndChar(FX_CHAR end) {
+bool CBC_Codabar::SetEndChar(FX_CHAR end) {
if (m_pBCWriter)
return static_cast<CBC_OnedCodaBarWriter*>(m_pBCWriter.get())
->SetEndChar(end);
- return FALSE;
+ return false;
}
-FX_BOOL CBC_Codabar::SetTextLocation(BC_TEXT_LOC location) {
+bool CBC_Codabar::SetTextLocation(BC_TEXT_LOC location) {
return static_cast<CBC_OnedCodaBarWriter*>(m_pBCWriter.get())
->SetTextLocation(location);
}
-FX_BOOL CBC_Codabar::SetWideNarrowRatio(int32_t ratio) {
+bool CBC_Codabar::SetWideNarrowRatio(int32_t ratio) {
if (m_pBCWriter)
return static_cast<CBC_OnedCodaBarWriter*>(m_pBCWriter.get())
->SetWideNarrowRatio(ratio);
- return FALSE;
+ return false;
}
-FX_BOOL CBC_Codabar::Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) {
+bool CBC_Codabar::Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) {
if (contents.IsEmpty()) {
e = BCExceptionNoContents;
- return FALSE;
+ return false;
}
BCFORMAT format = BCFORMAT_CODABAR;
int32_t outWidth = 0;
@@ -70,34 +70,34 @@ FX_BOOL CBC_Codabar::Encode(const CFX_WideStringC& contents,
m_renderContents = filtercontents;
uint8_t* data = static_cast<CBC_OnedCodaBarWriter*>(m_pBCWriter.get())
->Encode(byteString, format, outWidth, outHeight, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderResult(filtercontents.AsStringC(), data, outWidth, isDevice, e);
FX_Free(data);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_Codabar::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) {
+bool CBC_Codabar::RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) {
CFX_WideString renderCon =
static_cast<CBC_OnedCodaBarWriter*>(m_pBCWriter.get())
->encodedContents(m_renderContents.AsStringC());
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderDeviceResult(device, matrix, renderCon.AsStringC(), e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_Codabar::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
+bool CBC_Codabar::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
CFX_WideString renderCon =
static_cast<CBC_OnedCodaBarWriter*>(m_pBCWriter.get())
->encodedContents(m_renderContents.AsStringC());
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderBitmapResult(pOutBitmap, renderCon.AsStringC(), e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
BC_TYPE CBC_Codabar::GetType() {
diff --git a/xfa/fxbarcode/cbc_codabar.h b/xfa/fxbarcode/cbc_codabar.h
index 2a4ee79e68..28631a9cb5 100644
--- a/xfa/fxbarcode/cbc_codabar.h
+++ b/xfa/fxbarcode/cbc_codabar.h
@@ -18,19 +18,19 @@ class CBC_Codabar : public CBC_OneCode {
~CBC_Codabar() override;
// CBC_OneCode:
- FX_BOOL Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) override;
- FX_BOOL RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) override;
- FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
+ bool Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) override;
+ bool RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) override;
+ bool RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
BC_TYPE GetType() override;
- FX_BOOL SetStartChar(FX_CHAR start);
- FX_BOOL SetEndChar(FX_CHAR end);
- FX_BOOL SetTextLocation(BC_TEXT_LOC location);
- FX_BOOL SetWideNarrowRatio(int32_t ratio);
+ bool SetStartChar(FX_CHAR start);
+ bool SetEndChar(FX_CHAR end);
+ bool SetTextLocation(BC_TEXT_LOC location);
+ bool SetWideNarrowRatio(int32_t ratio);
private:
CFX_WideString m_renderContents;
diff --git a/xfa/fxbarcode/cbc_code128.cpp b/xfa/fxbarcode/cbc_code128.cpp
index 8615cd40df..99c3c21e0f 100644
--- a/xfa/fxbarcode/cbc_code128.cpp
+++ b/xfa/fxbarcode/cbc_code128.cpp
@@ -28,19 +28,19 @@ CBC_Code128::CBC_Code128(BC_TYPE type)
CBC_Code128::~CBC_Code128() {}
-FX_BOOL CBC_Code128::SetTextLocation(BC_TEXT_LOC location) {
+bool CBC_Code128::SetTextLocation(BC_TEXT_LOC location) {
if (m_pBCWriter)
return static_cast<CBC_OnedCode128Writer*>(m_pBCWriter.get())
->SetTextLocation(location);
- return FALSE;
+ return false;
}
-FX_BOOL CBC_Code128::Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) {
+bool CBC_Code128::Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) {
if (contents.IsEmpty()) {
e = BCExceptionNoContents;
- return FALSE;
+ return false;
}
BCFORMAT format = BCFORMAT_CODE_128;
int32_t outWidth = 0;
@@ -58,28 +58,28 @@ FX_BOOL CBC_Code128::Encode(const CFX_WideStringC& contents,
CFX_ByteString byteString = encodeContents.UTF8Encode();
uint8_t* data = static_cast<CBC_OnedCode128Writer*>(m_pBCWriter.get())
->Encode(byteString, format, outWidth, outHeight, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderResult(encodeContents.AsStringC(), data, outWidth, isDevice, e);
FX_Free(data);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_Code128::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) {
+bool CBC_Code128::RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) {
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderDeviceResult(device, matrix, m_renderContents.AsStringC(), e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_Code128::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
+bool CBC_Code128::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderBitmapResult(pOutBitmap, m_renderContents.AsStringC(), e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
BC_TYPE CBC_Code128::GetType() {
diff --git a/xfa/fxbarcode/cbc_code128.h b/xfa/fxbarcode/cbc_code128.h
index 4404f6c1e3..0dd9c84f68 100644
--- a/xfa/fxbarcode/cbc_code128.h
+++ b/xfa/fxbarcode/cbc_code128.h
@@ -18,16 +18,16 @@ class CBC_Code128 : public CBC_OneCode {
~CBC_Code128() override;
// CBC_OneCode:
- FX_BOOL Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) override;
- FX_BOOL RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) override;
- FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
+ bool Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) override;
+ bool RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) override;
+ bool RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
BC_TYPE GetType() override;
- FX_BOOL SetTextLocation(BC_TEXT_LOC loction);
+ bool SetTextLocation(BC_TEXT_LOC loction);
private:
CFX_WideString m_renderContents;
diff --git a/xfa/fxbarcode/cbc_code39.cpp b/xfa/fxbarcode/cbc_code39.cpp
index bbf4123d42..e90abb9d72 100644
--- a/xfa/fxbarcode/cbc_code39.cpp
+++ b/xfa/fxbarcode/cbc_code39.cpp
@@ -27,12 +27,12 @@ CBC_Code39::CBC_Code39() : CBC_OneCode(new CBC_OnedCode39Writer) {}
CBC_Code39::~CBC_Code39() {}
-FX_BOOL CBC_Code39::Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) {
+bool CBC_Code39::Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) {
if (contents.IsEmpty()) {
e = BCExceptionNoContents;
- return FALSE;
+ return false;
}
BCFORMAT format = BCFORMAT_CODE_39;
int32_t outWidth = 0;
@@ -47,50 +47,50 @@ FX_BOOL CBC_Code39::Encode(const CFX_WideStringC& contents,
CFX_ByteString byteString = filtercontents.UTF8Encode();
uint8_t* data = static_cast<CBC_OnedCode39Writer*>(m_pBCWriter.get())
->Encode(byteString, format, outWidth, outHeight, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderResult(renderContents.AsStringC(), data, outWidth, isDevice, e);
FX_Free(data);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_Code39::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) {
+bool CBC_Code39::RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) {
CFX_WideString renderCon =
static_cast<CBC_OnedCode39Writer*>(m_pBCWriter.get())
->encodedContents(m_renderContents.AsStringC(), e);
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderDeviceResult(device, matrix, renderCon.AsStringC(), e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_Code39::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
+bool CBC_Code39::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
CFX_WideString renderCon =
static_cast<CBC_OnedCode39Writer*>(m_pBCWriter.get())
->encodedContents(m_renderContents.AsStringC(), e);
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderBitmapResult(pOutBitmap, renderCon.AsStringC(), e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
BC_TYPE CBC_Code39::GetType() {
return BC_CODE39;
}
-FX_BOOL CBC_Code39::SetTextLocation(BC_TEXT_LOC location) {
+bool CBC_Code39::SetTextLocation(BC_TEXT_LOC location) {
if (m_pBCWriter)
return static_cast<CBC_OnedCode39Writer*>(m_pBCWriter.get())
->SetTextLocation(location);
- return FALSE;
+ return false;
}
-FX_BOOL CBC_Code39::SetWideNarrowRatio(int32_t ratio) {
+bool CBC_Code39::SetWideNarrowRatio(int32_t ratio) {
if (m_pBCWriter)
return static_cast<CBC_OnedCode39Writer*>(m_pBCWriter.get())
->SetWideNarrowRatio(ratio);
- return FALSE;
+ return false;
}
diff --git a/xfa/fxbarcode/cbc_code39.h b/xfa/fxbarcode/cbc_code39.h
index 42edf8e35f..7f5c627c6c 100644
--- a/xfa/fxbarcode/cbc_code39.h
+++ b/xfa/fxbarcode/cbc_code39.h
@@ -18,17 +18,17 @@ class CBC_Code39 : public CBC_OneCode {
~CBC_Code39() override;
// CBC_OneCode:
- FX_BOOL Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) override;
- FX_BOOL RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) override;
- FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
+ bool Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) override;
+ bool RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) override;
+ bool RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
BC_TYPE GetType() override;
- FX_BOOL SetTextLocation(BC_TEXT_LOC location);
- FX_BOOL SetWideNarrowRatio(int32_t ratio);
+ bool SetTextLocation(BC_TEXT_LOC location);
+ bool SetWideNarrowRatio(int32_t ratio);
private:
CFX_WideString m_renderContents;
diff --git a/xfa/fxbarcode/cbc_codebase.cpp b/xfa/fxbarcode/cbc_codebase.cpp
index c7d4f19118..5b4cb713bb 100644
--- a/xfa/fxbarcode/cbc_codebase.cpp
+++ b/xfa/fxbarcode/cbc_codebase.cpp
@@ -27,23 +27,23 @@ CBC_CodeBase::CBC_CodeBase(CBC_Writer* pWriter) : m_pBCWriter(pWriter) {}
CBC_CodeBase::~CBC_CodeBase() {}
-FX_BOOL CBC_CodeBase::SetCharEncoding(int32_t encoding) {
+bool CBC_CodeBase::SetCharEncoding(int32_t encoding) {
return m_pBCWriter && m_pBCWriter->SetCharEncoding(encoding);
}
-FX_BOOL CBC_CodeBase::SetModuleHeight(int32_t moduleHeight) {
+bool CBC_CodeBase::SetModuleHeight(int32_t moduleHeight) {
return m_pBCWriter && m_pBCWriter->SetModuleHeight(moduleHeight);
}
-FX_BOOL CBC_CodeBase::SetModuleWidth(int32_t moduleWidth) {
+bool CBC_CodeBase::SetModuleWidth(int32_t moduleWidth) {
return m_pBCWriter && m_pBCWriter->SetModuleWidth(moduleWidth);
}
-FX_BOOL CBC_CodeBase::SetHeight(int32_t height) {
+bool CBC_CodeBase::SetHeight(int32_t height) {
return m_pBCWriter && m_pBCWriter->SetHeight(height);
}
-FX_BOOL CBC_CodeBase::SetWidth(int32_t width) {
+bool CBC_CodeBase::SetWidth(int32_t width) {
return m_pBCWriter && m_pBCWriter->SetWidth(width);
}
diff --git a/xfa/fxbarcode/cbc_codebase.h b/xfa/fxbarcode/cbc_codebase.h
index 886095aaba..c28c08b7e7 100644
--- a/xfa/fxbarcode/cbc_codebase.h
+++ b/xfa/fxbarcode/cbc_codebase.h
@@ -24,19 +24,19 @@ class CBC_CodeBase {
virtual ~CBC_CodeBase();
virtual BC_TYPE GetType() = 0;
- virtual FX_BOOL Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) = 0;
- virtual FX_BOOL RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) = 0;
- virtual FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) = 0;
-
- FX_BOOL SetCharEncoding(int32_t encoding);
- FX_BOOL SetModuleHeight(int32_t moduleHeight);
- FX_BOOL SetModuleWidth(int32_t moduleWidth);
- FX_BOOL SetHeight(int32_t height);
- FX_BOOL SetWidth(int32_t width);
+ virtual bool Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) = 0;
+ virtual bool RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) = 0;
+ virtual bool RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) = 0;
+
+ bool SetCharEncoding(int32_t encoding);
+ bool SetModuleHeight(int32_t moduleHeight);
+ bool SetModuleWidth(int32_t moduleWidth);
+ bool SetHeight(int32_t height);
+ bool SetWidth(int32_t width);
void SetBackgroundColor(FX_ARGB backgroundColor);
void SetBarcodeColor(FX_ARGB foregroundColor);
diff --git a/xfa/fxbarcode/cbc_datamatrix.cpp b/xfa/fxbarcode/cbc_datamatrix.cpp
index 3c86743b9f..86ca75d04a 100644
--- a/xfa/fxbarcode/cbc_datamatrix.cpp
+++ b/xfa/fxbarcode/cbc_datamatrix.cpp
@@ -27,35 +27,35 @@ CBC_DataMatrix::CBC_DataMatrix() : CBC_CodeBase(new CBC_DataMatrixWriter) {}
CBC_DataMatrix::~CBC_DataMatrix() {}
-FX_BOOL CBC_DataMatrix::Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) {
+bool CBC_DataMatrix::Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) {
int32_t outWidth = 0;
int32_t outHeight = 0;
uint8_t* data =
static_cast<CBC_DataMatrixWriter*>(m_pBCWriter.get())
->Encode(CFX_WideString(contents), outWidth, outHeight, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
static_cast<CBC_TwoDimWriter*>(m_pBCWriter.get())
->RenderResult(data, outWidth, outHeight, e);
FX_Free(data);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_DataMatrix::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) {
+bool CBC_DataMatrix::RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) {
static_cast<CBC_TwoDimWriter*>(m_pBCWriter.get())
->RenderDeviceResult(device, matrix);
- return TRUE;
+ return true;
}
-FX_BOOL CBC_DataMatrix::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
+bool CBC_DataMatrix::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
static_cast<CBC_TwoDimWriter*>(m_pBCWriter.get())
->RenderBitmapResult(pOutBitmap, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
BC_TYPE CBC_DataMatrix::GetType() {
diff --git a/xfa/fxbarcode/cbc_datamatrix.h b/xfa/fxbarcode/cbc_datamatrix.h
index df2e5ad241..661b48d744 100644
--- a/xfa/fxbarcode/cbc_datamatrix.h
+++ b/xfa/fxbarcode/cbc_datamatrix.h
@@ -18,13 +18,13 @@ class CBC_DataMatrix : public CBC_CodeBase {
~CBC_DataMatrix() override;
// CBC_OneCode:
- FX_BOOL Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) override;
- FX_BOOL RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) override;
- FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
+ bool Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) override;
+ bool RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) override;
+ bool RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
BC_TYPE GetType() override;
};
diff --git a/xfa/fxbarcode/cbc_ean13.cpp b/xfa/fxbarcode/cbc_ean13.cpp
index 831f68ca8c..d696897165 100644
--- a/xfa/fxbarcode/cbc_ean13.cpp
+++ b/xfa/fxbarcode/cbc_ean13.cpp
@@ -48,12 +48,12 @@ CFX_WideString CBC_EAN13::Preprocess(const CFX_WideStringC& contents) {
return encodeContents;
}
-FX_BOOL CBC_EAN13::Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) {
+bool CBC_EAN13::Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) {
if (contents.IsEmpty()) {
e = BCExceptionNoContents;
- return FALSE;
+ return false;
}
BCFORMAT format = BCFORMAT_EAN_13;
int32_t outWidth = 0;
@@ -63,28 +63,28 @@ FX_BOOL CBC_EAN13::Encode(const CFX_WideStringC& contents,
m_renderContents = encodeContents;
uint8_t* data = static_cast<CBC_OnedEAN13Writer*>(m_pBCWriter.get())
->Encode(byteString, format, outWidth, outHeight, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderResult(encodeContents.AsStringC(), data, outWidth, isDevice, e);
FX_Free(data);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_EAN13::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) {
+bool CBC_EAN13::RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) {
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderDeviceResult(device, matrix, m_renderContents.AsStringC(), e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_EAN13::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
+bool CBC_EAN13::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderBitmapResult(pOutBitmap, m_renderContents.AsStringC(), e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
BC_TYPE CBC_EAN13::GetType() {
diff --git a/xfa/fxbarcode/cbc_ean13.h b/xfa/fxbarcode/cbc_ean13.h
index d42c2fdbc1..f0e7940a04 100644
--- a/xfa/fxbarcode/cbc_ean13.h
+++ b/xfa/fxbarcode/cbc_ean13.h
@@ -18,13 +18,13 @@ class CBC_EAN13 : public CBC_OneCode {
~CBC_EAN13() override;
// CBC_OneCode:
- FX_BOOL Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) override;
- FX_BOOL RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) override;
- FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
+ bool Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) override;
+ bool RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) override;
+ bool RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
BC_TYPE GetType() override;
private:
diff --git a/xfa/fxbarcode/cbc_ean8.cpp b/xfa/fxbarcode/cbc_ean8.cpp
index 4635c6b55d..2c1ce24b55 100644
--- a/xfa/fxbarcode/cbc_ean8.cpp
+++ b/xfa/fxbarcode/cbc_ean8.cpp
@@ -47,12 +47,12 @@ CFX_WideString CBC_EAN8::Preprocess(const CFX_WideStringC& contents) {
return encodeContents;
}
-FX_BOOL CBC_EAN8::Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) {
+bool CBC_EAN8::Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) {
if (contents.IsEmpty()) {
e = BCExceptionNoContents;
- return FALSE;
+ return false;
}
BCFORMAT format = BCFORMAT_EAN_8;
int32_t outWidth = 0;
@@ -62,28 +62,28 @@ FX_BOOL CBC_EAN8::Encode(const CFX_WideStringC& contents,
m_renderContents = encodeContents;
uint8_t* data = static_cast<CBC_OnedEAN8Writer*>(m_pBCWriter.get())
->Encode(byteString, format, outWidth, outHeight, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderResult(encodeContents.AsStringC(), data, outWidth, isDevice, e);
FX_Free(data);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_EAN8::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) {
+bool CBC_EAN8::RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) {
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderDeviceResult(device, matrix, m_renderContents.AsStringC(), e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_EAN8::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
+bool CBC_EAN8::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderBitmapResult(pOutBitmap, m_renderContents.AsStringC(), e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
BC_TYPE CBC_EAN8::GetType() {
diff --git a/xfa/fxbarcode/cbc_ean8.h b/xfa/fxbarcode/cbc_ean8.h
index ffd06e51d5..6a475cb795 100644
--- a/xfa/fxbarcode/cbc_ean8.h
+++ b/xfa/fxbarcode/cbc_ean8.h
@@ -18,13 +18,13 @@ class CBC_EAN8 : public CBC_OneCode {
~CBC_EAN8() override;
// CBC_OneCode:
- FX_BOOL Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) override;
- FX_BOOL RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) override;
- FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
+ bool Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) override;
+ bool RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) override;
+ bool RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
BC_TYPE GetType() override;
private:
diff --git a/xfa/fxbarcode/cbc_onecode.cpp b/xfa/fxbarcode/cbc_onecode.cpp
index 6fc68d88cd..55c2837bd4 100644
--- a/xfa/fxbarcode/cbc_onecode.cpp
+++ b/xfa/fxbarcode/cbc_onecode.cpp
@@ -27,7 +27,7 @@ CBC_OneCode::CBC_OneCode(CBC_Writer* pWriter) : CBC_CodeBase(pWriter) {}
CBC_OneCode::~CBC_OneCode() {}
-FX_BOOL CBC_OneCode::CheckContentValidity(const CFX_WideStringC& contents) {
+bool CBC_OneCode::CheckContentValidity(const CFX_WideStringC& contents) {
return m_pBCWriter &&
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->CheckContentValidity(contents);
@@ -40,7 +40,7 @@ CFX_WideString CBC_OneCode::FilterContents(const CFX_WideStringC& contents) {
->FilterContents(contents);
}
-void CBC_OneCode::SetPrintChecksum(FX_BOOL checksum) {
+void CBC_OneCode::SetPrintChecksum(bool checksum) {
if (m_pBCWriter)
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->SetPrintChecksum(checksum);
@@ -51,15 +51,15 @@ void CBC_OneCode::SetDataLength(int32_t length) {
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())->SetDataLength(length);
}
-void CBC_OneCode::SetCalChecksum(FX_BOOL calc) {
+void CBC_OneCode::SetCalChecksum(bool calc) {
if (m_pBCWriter)
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())->SetCalcChecksum(calc);
}
-FX_BOOL CBC_OneCode::SetFont(CFX_Font* cFont) {
+bool CBC_OneCode::SetFont(CFX_Font* cFont) {
if (m_pBCWriter)
return static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())->SetFont(cFont);
- return FALSE;
+ return false;
}
void CBC_OneCode::SetFontSize(FX_FLOAT size) {
diff --git a/xfa/fxbarcode/cbc_onecode.h b/xfa/fxbarcode/cbc_onecode.h
index f6c992bde1..e348b4ee2c 100644
--- a/xfa/fxbarcode/cbc_onecode.h
+++ b/xfa/fxbarcode/cbc_onecode.h
@@ -20,13 +20,13 @@ class CBC_OneCode : public CBC_CodeBase {
explicit CBC_OneCode(CBC_Writer* pWriter);
~CBC_OneCode() override;
- virtual FX_BOOL CheckContentValidity(const CFX_WideStringC& contents);
+ virtual bool CheckContentValidity(const CFX_WideStringC& contents);
virtual CFX_WideString FilterContents(const CFX_WideStringC& contents);
- virtual void SetPrintChecksum(FX_BOOL checksum);
+ virtual void SetPrintChecksum(bool checksum);
virtual void SetDataLength(int32_t length);
- virtual void SetCalChecksum(FX_BOOL calc);
- virtual FX_BOOL SetFont(CFX_Font* cFont);
+ virtual void SetCalChecksum(bool calc);
+ virtual bool SetFont(CFX_Font* cFont);
virtual void SetFontSize(FX_FLOAT size);
virtual void SetFontStyle(int32_t style);
virtual void SetFontColor(FX_ARGB color);
diff --git a/xfa/fxbarcode/cbc_pdf417i.cpp b/xfa/fxbarcode/cbc_pdf417i.cpp
index 2d9b9819a7..1e147d9448 100644
--- a/xfa/fxbarcode/cbc_pdf417i.cpp
+++ b/xfa/fxbarcode/cbc_pdf417i.cpp
@@ -27,45 +27,45 @@ CBC_PDF417I::CBC_PDF417I() : CBC_CodeBase(new CBC_PDF417Writer) {}
CBC_PDF417I::~CBC_PDF417I() {}
-FX_BOOL CBC_PDF417I::SetErrorCorrectionLevel(int32_t level) {
+bool CBC_PDF417I::SetErrorCorrectionLevel(int32_t level) {
static_cast<CBC_PDF417Writer*>(m_pBCWriter.get())
->SetErrorCorrectionLevel(level);
- return TRUE;
+ return true;
}
-void CBC_PDF417I::SetTruncated(FX_BOOL truncated) {
+void CBC_PDF417I::SetTruncated(bool truncated) {
static_cast<CBC_PDF417Writer*>(m_pBCWriter.get())->SetTruncated(truncated);
}
-FX_BOOL CBC_PDF417I::Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) {
+bool CBC_PDF417I::Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) {
int32_t outWidth = 0;
int32_t outHeight = 0;
uint8_t* data =
static_cast<CBC_PDF417Writer*>(m_pBCWriter.get())
->Encode(CFX_WideString(contents), outWidth, outHeight, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
static_cast<CBC_TwoDimWriter*>(m_pBCWriter.get())
->RenderResult(data, outWidth, outHeight, e);
FX_Free(data);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_PDF417I::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) {
+bool CBC_PDF417I::RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) {
static_cast<CBC_TwoDimWriter*>(m_pBCWriter.get())
->RenderDeviceResult(device, matrix);
- return TRUE;
+ return true;
}
-FX_BOOL CBC_PDF417I::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
+bool CBC_PDF417I::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
static_cast<CBC_TwoDimWriter*>(m_pBCWriter.get())
->RenderBitmapResult(pOutBitmap, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
BC_TYPE CBC_PDF417I::GetType() {
diff --git a/xfa/fxbarcode/cbc_pdf417i.h b/xfa/fxbarcode/cbc_pdf417i.h
index 6067282de8..70ea929820 100644
--- a/xfa/fxbarcode/cbc_pdf417i.h
+++ b/xfa/fxbarcode/cbc_pdf417i.h
@@ -18,17 +18,17 @@ class CBC_PDF417I : public CBC_CodeBase {
~CBC_PDF417I() override;
// CBC_CodeBase::
- FX_BOOL Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) override;
- FX_BOOL RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) override;
- FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
+ bool Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) override;
+ bool RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) override;
+ bool RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
BC_TYPE GetType() override;
- FX_BOOL SetErrorCorrectionLevel(int32_t level);
- void SetTruncated(FX_BOOL truncated);
+ bool SetErrorCorrectionLevel(int32_t level);
+ void SetTruncated(bool truncated);
};
#endif // XFA_FXBARCODE_CBC_PDF417I_H_
diff --git a/xfa/fxbarcode/cbc_qrcode.cpp b/xfa/fxbarcode/cbc_qrcode.cpp
index db3cad0dda..507b8f9ffe 100644
--- a/xfa/fxbarcode/cbc_qrcode.cpp
+++ b/xfa/fxbarcode/cbc_qrcode.cpp
@@ -27,51 +27,51 @@ CBC_QRCode::CBC_QRCode() : CBC_CodeBase(new CBC_QRCodeWriter) {}
CBC_QRCode::~CBC_QRCode() {}
-FX_BOOL CBC_QRCode::SetVersion(int32_t version) {
+bool CBC_QRCode::SetVersion(int32_t version) {
if (version < 0 || version > 40)
- return FALSE;
+ return false;
return m_pBCWriter &&
static_cast<CBC_QRCodeWriter*>(m_pBCWriter.get())->SetVersion(version);
}
-FX_BOOL CBC_QRCode::SetErrorCorrectionLevel(int32_t level) {
+bool CBC_QRCode::SetErrorCorrectionLevel(int32_t level) {
if (level < 0 || level > 3)
- return FALSE;
+ return false;
return m_pBCWriter &&
static_cast<CBC_TwoDimWriter*>(m_pBCWriter.get())
->SetErrorCorrectionLevel(level);
}
-FX_BOOL CBC_QRCode::Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) {
+bool CBC_QRCode::Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) {
int32_t outWidth = 0;
int32_t outHeight = 0;
CBC_QRCodeWriter* pWriter = static_cast<CBC_QRCodeWriter*>(m_pBCWriter.get());
uint8_t* data = pWriter->Encode(CFX_WideString(contents),
pWriter->GetErrorCorrectionLevel(), outWidth,
outHeight, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
pWriter->RenderResult(data, outWidth, outHeight, e);
FX_Free(data);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_QRCode::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) {
+bool CBC_QRCode::RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) {
static_cast<CBC_TwoDimWriter*>(m_pBCWriter.get())
->RenderDeviceResult(device, matrix);
- return TRUE;
+ return true;
}
-FX_BOOL CBC_QRCode::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
+bool CBC_QRCode::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
static_cast<CBC_TwoDimWriter*>(m_pBCWriter.get())
->RenderBitmapResult(pOutBitmap, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
BC_TYPE CBC_QRCode::GetType() {
diff --git a/xfa/fxbarcode/cbc_qrcode.h b/xfa/fxbarcode/cbc_qrcode.h
index e3b554b109..ac2d93d915 100644
--- a/xfa/fxbarcode/cbc_qrcode.h
+++ b/xfa/fxbarcode/cbc_qrcode.h
@@ -18,17 +18,17 @@ class CBC_QRCode : public CBC_CodeBase {
~CBC_QRCode() override;
// CBC_CodeBase:
- FX_BOOL Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) override;
- FX_BOOL RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) override;
- FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
+ bool Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) override;
+ bool RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) override;
+ bool RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
BC_TYPE GetType() override;
- FX_BOOL SetVersion(int32_t version);
- FX_BOOL SetErrorCorrectionLevel(int32_t level);
+ bool SetVersion(int32_t version);
+ bool SetErrorCorrectionLevel(int32_t level);
};
#endif // XFA_FXBARCODE_CBC_QRCODE_H_
diff --git a/xfa/fxbarcode/cbc_upca.cpp b/xfa/fxbarcode/cbc_upca.cpp
index 8ed3e08eb9..db8f722828 100644
--- a/xfa/fxbarcode/cbc_upca.cpp
+++ b/xfa/fxbarcode/cbc_upca.cpp
@@ -47,12 +47,12 @@ CFX_WideString CBC_UPCA::Preprocess(const CFX_WideStringC& contents) {
return encodeContents;
}
-FX_BOOL CBC_UPCA::Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) {
+bool CBC_UPCA::Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) {
if (contents.IsEmpty()) {
e = BCExceptionNoContents;
- return FALSE;
+ return false;
}
BCFORMAT format = BCFORMAT_UPC_A;
int32_t outWidth = 0;
@@ -66,28 +66,28 @@ FX_BOOL CBC_UPCA::Encode(const CFX_WideStringC& contents,
pWriter->Init();
uint8_t* data = pWriter->Encode(byteString, format, outWidth, outHeight, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
pWriter->RenderResult(encodeContents.AsStringC(), data, outWidth, isDevice,
e);
FX_Free(data);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_UPCA::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) {
+bool CBC_UPCA::RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) {
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderDeviceResult(device, matrix, m_renderContents.AsStringC(), e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
-FX_BOOL CBC_UPCA::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
+bool CBC_UPCA::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderBitmapResult(pOutBitmap, m_renderContents.AsStringC(), e);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
- return TRUE;
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
+ return true;
}
BC_TYPE CBC_UPCA::GetType() {
diff --git a/xfa/fxbarcode/cbc_upca.h b/xfa/fxbarcode/cbc_upca.h
index 11769f361e..bf90b922b5 100644
--- a/xfa/fxbarcode/cbc_upca.h
+++ b/xfa/fxbarcode/cbc_upca.h
@@ -18,13 +18,13 @@ class CBC_UPCA : public CBC_OneCode {
~CBC_UPCA() override;
// CBC_CodeBase
- FX_BOOL Encode(const CFX_WideStringC& contents,
- FX_BOOL isDevice,
- int32_t& e) override;
- FX_BOOL RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
- int32_t& e) override;
- FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
+ bool Encode(const CFX_WideStringC& contents,
+ bool isDevice,
+ int32_t& e) override;
+ bool RenderDevice(CFX_RenderDevice* device,
+ const CFX_Matrix* matrix,
+ int32_t& e) override;
+ bool RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
BC_TYPE GetType() override;
private:
diff --git a/xfa/fxbarcode/common/BC_CommonBitArray.cpp b/xfa/fxbarcode/common/BC_CommonBitArray.cpp
index b39e4acd88..722bbc501d 100644
--- a/xfa/fxbarcode/common/BC_CommonBitArray.cpp
+++ b/xfa/fxbarcode/common/BC_CommonBitArray.cpp
@@ -47,7 +47,7 @@ CFX_Int32Array& CBC_CommonBitArray::GetBits() {
int32_t CBC_CommonBitArray::GetSizeInBytes() {
return (m_size + 7) >> 3;
}
-FX_BOOL CBC_CommonBitArray::Get(int32_t i) {
+bool CBC_CommonBitArray::Get(int32_t i) {
return (m_bits[i >> 5] & (1 << (i & 0x1f))) != 0;
}
void CBC_CommonBitArray::Set(int32_t i) {
@@ -62,16 +62,16 @@ void CBC_CommonBitArray::SetBulk(int32_t i, int32_t newBits) {
void CBC_CommonBitArray::Clear() {
FXSYS_memset(&m_bits[0], 0x00, m_bits.GetSize() * sizeof(int32_t));
}
-FX_BOOL CBC_CommonBitArray::IsRange(int32_t start,
- int32_t end,
- FX_BOOL value,
- int32_t& e) {
+bool CBC_CommonBitArray::IsRange(int32_t start,
+ int32_t end,
+ bool value,
+ int32_t& e) {
if (end < start) {
e = BCExceptionEndLessThanStart;
- return FALSE;
+ return false;
}
if (end == start) {
- return TRUE;
+ return true;
}
end--;
int32_t firstInt = start >> 5;
@@ -90,10 +90,10 @@ FX_BOOL CBC_CommonBitArray::IsRange(int32_t start,
}
}
if ((m_bits[i] & mask) != (value ? mask : 0)) {
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
int32_t* CBC_CommonBitArray::GetBitArray() {
return &m_bits[0];
diff --git a/xfa/fxbarcode/common/BC_CommonBitArray.h b/xfa/fxbarcode/common/BC_CommonBitArray.h
index 6955d5b288..80a56d1b53 100644
--- a/xfa/fxbarcode/common/BC_CommonBitArray.h
+++ b/xfa/fxbarcode/common/BC_CommonBitArray.h
@@ -19,11 +19,11 @@ class CBC_CommonBitArray {
int32_t GetSize();
CFX_Int32Array& GetBits();
int32_t GetSizeInBytes();
- FX_BOOL Get(int32_t i);
+ bool Get(int32_t i);
void Set(int32_t i);
void Flip(int32_t i);
void SetBulk(int32_t i, int32_t newBits);
- FX_BOOL IsRange(int32_t start, int32_t end, FX_BOOL value, int32_t& e);
+ bool IsRange(int32_t start, int32_t end, bool value, int32_t& e);
int32_t* GetBitArray();
void Reverse();
void Clear();
diff --git a/xfa/fxbarcode/common/BC_CommonBitMatrix.cpp b/xfa/fxbarcode/common/BC_CommonBitMatrix.cpp
index e52f3dca04..b9b218c60f 100644
--- a/xfa/fxbarcode/common/BC_CommonBitMatrix.cpp
+++ b/xfa/fxbarcode/common/BC_CommonBitMatrix.cpp
@@ -49,7 +49,7 @@ void CBC_CommonBitMatrix::Init(int32_t width, int32_t height) {
CBC_CommonBitMatrix::~CBC_CommonBitMatrix() {
FX_Free(m_bits);
}
-FX_BOOL CBC_CommonBitMatrix::Get(int32_t x, int32_t y) {
+bool CBC_CommonBitMatrix::Get(int32_t x, int32_t y) {
int32_t offset = y * m_rowSize + (x >> 5);
if (offset >= m_rowSize * m_height || offset < 0) {
return false;
diff --git a/xfa/fxbarcode/common/BC_CommonBitMatrix.h b/xfa/fxbarcode/common/BC_CommonBitMatrix.h
index 98291f0130..ed1f684a37 100644
--- a/xfa/fxbarcode/common/BC_CommonBitMatrix.h
+++ b/xfa/fxbarcode/common/BC_CommonBitMatrix.h
@@ -19,7 +19,7 @@ class CBC_CommonBitMatrix {
virtual void Init(int32_t dimension);
virtual void Init(int32_t width, int32_t height);
- FX_BOOL Get(int32_t x, int32_t y);
+ bool Get(int32_t x, int32_t y);
void Set(int32_t x, int32_t y);
void Flip(int32_t x, int32_t y);
void Clear();
diff --git a/xfa/fxbarcode/common/BC_CommonByteArray.cpp b/xfa/fxbarcode/common/BC_CommonByteArray.cpp
index afa8ac6836..71fa85f0c4 100644
--- a/xfa/fxbarcode/common/BC_CommonByteArray.cpp
+++ b/xfa/fxbarcode/common/BC_CommonByteArray.cpp
@@ -53,7 +53,7 @@ void CBC_CommonByteArray::Set(int32_t index, int32_t value) {
int32_t CBC_CommonByteArray::Size() const {
return m_size;
}
-FX_BOOL CBC_CommonByteArray::IsEmpty() const {
+bool CBC_CommonByteArray::IsEmpty() const {
return m_size == 0;
}
void CBC_CommonByteArray::AppendByte(int32_t value) {
diff --git a/xfa/fxbarcode/common/BC_CommonByteArray.h b/xfa/fxbarcode/common/BC_CommonByteArray.h
index bdac6a6963..dd6ee581ef 100644
--- a/xfa/fxbarcode/common/BC_CommonByteArray.h
+++ b/xfa/fxbarcode/common/BC_CommonByteArray.h
@@ -20,7 +20,7 @@ class CBC_CommonByteArray {
int32_t At(int32_t index) const;
int32_t Size() const;
- FX_BOOL IsEmpty() const;
+ bool IsEmpty() const;
void Set(int32_t index, int32_t value);
void AppendByte(int32_t value);
void Reserve(int32_t capacity);
diff --git a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp
index 0e376ce1a8..60f1f1bbed 100644
--- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp
+++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp
@@ -70,7 +70,7 @@ CFX_Int32Array* CBC_ReedSolomonGF256Poly::GetCoefficients() {
int32_t CBC_ReedSolomonGF256Poly::GetDegree() {
return m_coefficients.GetSize() - 1;
}
-FX_BOOL CBC_ReedSolomonGF256Poly::IsZero() {
+bool CBC_ReedSolomonGF256Poly::IsZero() {
return m_coefficients[0] == 0;
}
int32_t CBC_ReedSolomonGF256Poly::GetCoefficients(int32_t degree) {
diff --git a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h
index 3e840f528b..3eff31b622 100644
--- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h
+++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h
@@ -23,7 +23,7 @@ class CBC_ReedSolomonGF256Poly final {
int32_t GetCoefficients(int32_t degree);
CFX_Int32Array* GetCoefficients();
int32_t GetDegree();
- FX_BOOL IsZero();
+ bool IsZero();
int32_t EvaluateAt(int32_t a);
CBC_ReedSolomonGF256Poly* AddOrSubtract(CBC_ReedSolomonGF256Poly* other,
int32_t& e);
diff --git a/xfa/fxbarcode/datamatrix/BC_Base256Encoder.cpp b/xfa/fxbarcode/datamatrix/BC_Base256Encoder.cpp
index 98e7848ce8..b8e427c7fc 100644
--- a/xfa/fxbarcode/datamatrix/BC_Base256Encoder.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_Base256Encoder.cpp
@@ -58,7 +58,7 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext& context, int32_t& e) {
if (e != BCExceptionNO) {
return;
}
- FX_BOOL mustPad = (context.m_symbolInfo->m_dataCapacity - currentSize) > 0;
+ bool mustPad = (context.m_symbolInfo->m_dataCapacity - currentSize) > 0;
if (context.hasMoreCharacters() || mustPad) {
if (dataCount <= 249) {
buffer.SetAt(0, (FX_WCHAR)dataCount);
diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp
index 16c253f062..e580bb583f 100644
--- a/xfa/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp
@@ -26,7 +26,7 @@
#include "xfa/fxbarcode/datamatrix/BC_SymbolShapeHint.h"
CBC_DataMatrixSymbolInfo144::CBC_DataMatrixSymbolInfo144()
- : CBC_SymbolInfo(FALSE, 1558, 620, 22, 22, 36) {
+ : CBC_SymbolInfo(false, 1558, 620, 22, 22, 36) {
m_rsBlockData = -1;
m_rsBlockError = 62;
}
diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp
index 6263b7fbe5..1fe8018631 100644
--- a/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp
@@ -44,9 +44,9 @@
CBC_DataMatrixWriter::CBC_DataMatrixWriter() {}
CBC_DataMatrixWriter::~CBC_DataMatrixWriter() {}
-FX_BOOL CBC_DataMatrixWriter::SetErrorCorrectionLevel(int32_t level) {
+bool CBC_DataMatrixWriter::SetErrorCorrectionLevel(int32_t level) {
m_iCorrectLevel = level;
- return TRUE;
+ return true;
}
uint8_t* CBC_DataMatrixWriter::Encode(const CFX_WideString& contents,
int32_t& outWidth,
@@ -65,7 +65,7 @@ uint8_t* CBC_DataMatrixWriter::Encode(const CFX_WideString& contents,
contents, ecLevel, shape, minSize, maxSize, e);
BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
CBC_SymbolInfo* symbolInfo = CBC_SymbolInfo::lookup(
- encoded.GetLength(), shape, minSize, maxSize, TRUE, e);
+ encoded.GetLength(), shape, minSize, maxSize, true, e);
BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
CFX_WideString codewords =
CBC_ErrorCorrection::encodeECC200(encoded, symbolInfo, e);
@@ -111,7 +111,7 @@ CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel(
matrixX = 0;
for (int32_t x = 0; x < symbolWidth; x++) {
if ((x % symbolInfo->m_matrixWidth) == 0) {
- matrix->Set(matrixX, matrixY, TRUE);
+ matrix->Set(matrixX, matrixY, true);
matrixX++;
}
matrix->Set(matrixX, matrixY, placement->getBit(x, y));
@@ -125,7 +125,7 @@ CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel(
if ((y % symbolInfo->m_matrixHeight) == symbolInfo->m_matrixHeight - 1) {
matrixX = 0;
for (int32_t x = 0; x < symbolInfo->getSymbolWidth(e); x++) {
- matrix->Set(matrixX, matrixY, TRUE);
+ matrix->Set(matrixX, matrixY, true);
matrixX++;
}
matrixY++;
diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.h b/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.h
index 1196e46352..af1417b588 100644
--- a/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.h
+++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.h
@@ -24,7 +24,7 @@ class CBC_DataMatrixWriter : public CBC_TwoDimWriter {
int32_t& e);
// CBC_TwoDimWriter
- FX_BOOL SetErrorCorrectionLevel(int32_t level) override;
+ bool SetErrorCorrectionLevel(int32_t level) override;
private:
static CBC_CommonByteMatrix* encodeLowLevel(CBC_DefaultPlacement* placement,
diff --git a/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.cpp b/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.cpp
index 830df224ca..bc0aa72b42 100644
--- a/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.cpp
@@ -46,13 +46,13 @@ int32_t CBC_DefaultPlacement::getNumcols() {
CFX_ByteArray& CBC_DefaultPlacement::getBits() {
return m_bits;
}
-FX_BOOL CBC_DefaultPlacement::getBit(int32_t col, int32_t row) {
+bool CBC_DefaultPlacement::getBit(int32_t col, int32_t row) {
return m_bits[row * m_numcols + col] == 1;
}
-void CBC_DefaultPlacement::setBit(int32_t col, int32_t row, FX_BOOL bit) {
+void CBC_DefaultPlacement::setBit(int32_t col, int32_t row, bool bit) {
m_bits[row * m_numcols + col] = bit ? (uint8_t)1 : (uint8_t)0;
}
-FX_BOOL CBC_DefaultPlacement::hasBit(int32_t col, int32_t row) {
+bool CBC_DefaultPlacement::hasBit(int32_t col, int32_t row) {
return m_bits[row * m_numcols + col] != 2;
}
void CBC_DefaultPlacement::place() {
@@ -92,8 +92,8 @@ void CBC_DefaultPlacement::place() {
col++;
} while ((row < m_numrows) || (col < m_numcols));
if (!hasBit(m_numcols - 1, m_numrows - 1)) {
- setBit(m_numcols - 1, m_numrows - 1, TRUE);
- setBit(m_numcols - 2, m_numrows - 2, TRUE);
+ setBit(m_numcols - 1, m_numrows - 1, true);
+ setBit(m_numcols - 2, m_numrows - 2, true);
}
}
void CBC_DefaultPlacement::module(int32_t row,
diff --git a/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.h b/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.h
index f9b44621b1..64d02886f7 100644
--- a/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.h
+++ b/xfa/fxbarcode/datamatrix/BC_DefaultPlacement.h
@@ -19,9 +19,9 @@ class CBC_DefaultPlacement {
int32_t getNumrows();
int32_t getNumcols();
CFX_ByteArray& getBits();
- FX_BOOL getBit(int32_t col, int32_t row);
- void setBit(int32_t col, int32_t row, FX_BOOL bit);
- FX_BOOL hasBit(int32_t col, int32_t row);
+ bool getBit(int32_t col, int32_t row);
+ void setBit(int32_t col, int32_t row, bool bit);
+ bool hasBit(int32_t col, int32_t row);
void place();
private:
diff --git a/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.cpp b/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.cpp
index e1d493a1ca..7db117d003 100644
--- a/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.cpp
@@ -89,8 +89,8 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext& context,
if (e != BCExceptionNO) {
return;
}
- FX_BOOL endOfSymbolReached = !context.hasMoreCharacters();
- FX_BOOL restInAscii = endOfSymbolReached && restChars <= 2;
+ bool endOfSymbolReached = !context.hasMoreCharacters();
+ bool restInAscii = endOfSymbolReached && restChars <= 2;
if (restChars <= 2) {
context.updateSymbolInfo(context.getCodewordCount() + restChars, e);
if (e != BCExceptionNO) {
@@ -99,7 +99,7 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext& context,
int32_t available =
context.m_symbolInfo->m_dataCapacity - context.getCodewordCount();
if (available >= 3) {
- restInAscii = FALSE;
+ restInAscii = false;
context.updateSymbolInfo(context.getCodewordCount() + encoded.GetLength(),
e);
if (e != BCExceptionNO) {
diff --git a/xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp b/xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp
index 6e395837d4..c395f3a914 100644
--- a/xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp
@@ -87,7 +87,7 @@ void CBC_EncoderContext::signalEncoderChange(int32_t encoding) {
void CBC_EncoderContext::resetEncoderSignal() {
m_newEncoding = -1;
}
-FX_BOOL CBC_EncoderContext::hasMoreCharacters() {
+bool CBC_EncoderContext::hasMoreCharacters() {
return m_pos < getTotalMessageCharCount();
}
int32_t CBC_EncoderContext::getRemainingCharacters() {
diff --git a/xfa/fxbarcode/datamatrix/BC_EncoderContext.h b/xfa/fxbarcode/datamatrix/BC_EncoderContext.h
index 0c1c8a6547..8d0ea5d7ed 100644
--- a/xfa/fxbarcode/datamatrix/BC_EncoderContext.h
+++ b/xfa/fxbarcode/datamatrix/BC_EncoderContext.h
@@ -30,7 +30,7 @@ class CBC_EncoderContext : public CBC_SymbolShapeHint {
int32_t getCodewordCount();
void signalEncoderChange(int32_t encoding);
void resetEncoderSignal();
- FX_BOOL hasMoreCharacters();
+ bool hasMoreCharacters();
int32_t getRemainingCharacters();
void updateSymbolInfo(int32_t& e);
void updateSymbolInfo(int32_t len, int32_t& e);
diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
index 7fcc039721..7d81c93418 100644
--- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
@@ -156,7 +156,7 @@ int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg,
charCounts[currentMode] = 0;
}
int32_t charsProcessed = 0;
- while (TRUE) {
+ while (true) {
if ((startpos + charsProcessed) == msg.GetLength()) {
int32_t min = std::numeric_limits<int32_t>::max();
CFX_ByteArray mins;
@@ -284,10 +284,10 @@ int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg,
}
}
}
-FX_BOOL CBC_HighLevelEncoder::isDigit(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isDigit(FX_WCHAR ch) {
return ch >= '0' && ch <= '9';
}
-FX_BOOL CBC_HighLevelEncoder::isExtendedASCII(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isExtendedASCII(FX_WCHAR ch) {
return ch >= 128 && ch <= 255;
}
int32_t CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg,
@@ -346,22 +346,22 @@ int32_t CBC_HighLevelEncoder::getMinimumCount(CFX_ByteArray& mins) {
}
return minCount;
}
-FX_BOOL CBC_HighLevelEncoder::isNativeC40(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isNativeC40(FX_WCHAR ch) {
return (ch == ' ') || (ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z');
}
-FX_BOOL CBC_HighLevelEncoder::isNativeText(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isNativeText(FX_WCHAR ch) {
return (ch == ' ') || (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z');
}
-FX_BOOL CBC_HighLevelEncoder::isNativeX12(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isNativeX12(FX_WCHAR ch) {
return isX12TermSep(ch) || (ch == ' ') || (ch >= '0' && ch <= '9') ||
(ch >= 'A' && ch <= 'Z');
}
-FX_BOOL CBC_HighLevelEncoder::isX12TermSep(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isX12TermSep(FX_WCHAR ch) {
return (ch == '\r') || (ch == '*') || (ch == '>');
}
-FX_BOOL CBC_HighLevelEncoder::isNativeEDIFACT(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isNativeEDIFACT(FX_WCHAR ch) {
return ch >= ' ' && ch <= '^';
}
-FX_BOOL CBC_HighLevelEncoder::isSpecialB256(FX_WCHAR ch) {
- return FALSE;
+bool CBC_HighLevelEncoder::isSpecialB256(FX_WCHAR ch) {
+ return false;
}
diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h
index 550b601e53..cf04c06619 100644
--- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h
+++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h
@@ -34,8 +34,8 @@ class CBC_HighLevelEncoder : public CBC_SymbolShapeHint {
static int32_t lookAheadTest(CFX_WideString msg,
int32_t startpos,
int32_t currentMode);
- static FX_BOOL isDigit(FX_WCHAR ch);
- static FX_BOOL isExtendedASCII(FX_WCHAR ch);
+ static bool isDigit(FX_WCHAR ch);
+ static bool isExtendedASCII(FX_WCHAR ch);
static int32_t determineConsecutiveDigitCount(CFX_WideString msg,
int32_t startpos);
static void illegalCharacter(FX_WCHAR c, int32_t& e);
@@ -66,12 +66,12 @@ class CBC_HighLevelEncoder : public CBC_SymbolShapeHint {
int32_t min,
CFX_ByteArray& mins);
static int32_t getMinimumCount(CFX_ByteArray& mins);
- static FX_BOOL isNativeC40(FX_WCHAR ch);
- static FX_BOOL isNativeText(FX_WCHAR ch);
- static FX_BOOL isNativeX12(FX_WCHAR ch);
- static FX_BOOL isX12TermSep(FX_WCHAR ch);
- static FX_BOOL isNativeEDIFACT(FX_WCHAR ch);
- static FX_BOOL isSpecialB256(FX_WCHAR ch);
+ static bool isNativeC40(FX_WCHAR ch);
+ static bool isNativeText(FX_WCHAR ch);
+ static bool isNativeX12(FX_WCHAR ch);
+ static bool isX12TermSep(FX_WCHAR ch);
+ static bool isNativeEDIFACT(FX_WCHAR ch);
+ static bool isSpecialB256(FX_WCHAR ch);
};
#endif // XFA_FXBARCODE_DATAMATRIX_BC_HIGHLEVELENCODER_H_
diff --git a/xfa/fxbarcode/datamatrix/BC_SymbolInfo.cpp b/xfa/fxbarcode/datamatrix/BC_SymbolInfo.cpp
index b6323041f9..77a809a511 100644
--- a/xfa/fxbarcode/datamatrix/BC_SymbolInfo.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_SymbolInfo.cpp
@@ -41,35 +41,35 @@ CBC_SymbolInfo* g_symbols[kSymbolsCount] = {
} // namespace
void CBC_SymbolInfo::Initialize() {
- g_symbols[0] = new CBC_SymbolInfo(FALSE, 3, 5, 8, 8, 1);
- g_symbols[1] = new CBC_SymbolInfo(FALSE, 5, 7, 10, 10, 1);
- g_symbols[2] = new CBC_SymbolInfo(TRUE, 5, 7, 16, 6, 1);
- g_symbols[3] = new CBC_SymbolInfo(FALSE, 8, 10, 12, 12, 1);
- g_symbols[4] = new CBC_SymbolInfo(TRUE, 10, 11, 14, 6, 2);
- g_symbols[5] = new CBC_SymbolInfo(FALSE, 12, 12, 14, 14, 1);
- g_symbols[6] = new CBC_SymbolInfo(TRUE, 16, 14, 24, 10, 1);
- g_symbols[7] = new CBC_SymbolInfo(FALSE, 18, 14, 16, 16, 1);
- g_symbols[8] = new CBC_SymbolInfo(FALSE, 22, 18, 18, 18, 1);
- g_symbols[9] = new CBC_SymbolInfo(TRUE, 22, 18, 16, 10, 2);
- g_symbols[10] = new CBC_SymbolInfo(FALSE, 30, 20, 20, 20, 1);
- g_symbols[11] = new CBC_SymbolInfo(TRUE, 32, 24, 16, 14, 2);
- g_symbols[12] = new CBC_SymbolInfo(FALSE, 36, 24, 22, 22, 1);
- g_symbols[13] = new CBC_SymbolInfo(FALSE, 44, 28, 24, 24, 1);
- g_symbols[14] = new CBC_SymbolInfo(TRUE, 49, 28, 22, 14, 2);
- g_symbols[15] = new CBC_SymbolInfo(FALSE, 62, 36, 14, 14, 4);
- g_symbols[16] = new CBC_SymbolInfo(FALSE, 86, 42, 16, 16, 4);
- g_symbols[17] = new CBC_SymbolInfo(FALSE, 114, 48, 18, 18, 4);
- g_symbols[18] = new CBC_SymbolInfo(FALSE, 144, 56, 20, 20, 4);
- g_symbols[19] = new CBC_SymbolInfo(FALSE, 174, 68, 22, 22, 4);
- g_symbols[20] = new CBC_SymbolInfo(FALSE, 204, 84, 24, 24, 4, 102, 42);
- g_symbols[21] = new CBC_SymbolInfo(FALSE, 280, 112, 14, 14, 16, 140, 56);
- g_symbols[22] = new CBC_SymbolInfo(FALSE, 368, 144, 16, 16, 16, 92, 36);
- g_symbols[23] = new CBC_SymbolInfo(FALSE, 456, 192, 18, 18, 16, 114, 48);
- g_symbols[24] = new CBC_SymbolInfo(FALSE, 576, 224, 20, 20, 16, 144, 56);
- g_symbols[25] = new CBC_SymbolInfo(FALSE, 696, 272, 22, 22, 16, 174, 68);
- g_symbols[26] = new CBC_SymbolInfo(FALSE, 816, 336, 24, 24, 16, 136, 56);
- g_symbols[27] = new CBC_SymbolInfo(FALSE, 1050, 408, 18, 18, 36, 175, 68);
- g_symbols[28] = new CBC_SymbolInfo(FALSE, 1304, 496, 20, 20, 36, 163, 62);
+ g_symbols[0] = new CBC_SymbolInfo(false, 3, 5, 8, 8, 1);
+ g_symbols[1] = new CBC_SymbolInfo(false, 5, 7, 10, 10, 1);
+ g_symbols[2] = new CBC_SymbolInfo(true, 5, 7, 16, 6, 1);
+ g_symbols[3] = new CBC_SymbolInfo(false, 8, 10, 12, 12, 1);
+ g_symbols[4] = new CBC_SymbolInfo(true, 10, 11, 14, 6, 2);
+ g_symbols[5] = new CBC_SymbolInfo(false, 12, 12, 14, 14, 1);
+ g_symbols[6] = new CBC_SymbolInfo(true, 16, 14, 24, 10, 1);
+ g_symbols[7] = new CBC_SymbolInfo(false, 18, 14, 16, 16, 1);
+ g_symbols[8] = new CBC_SymbolInfo(false, 22, 18, 18, 18, 1);
+ g_symbols[9] = new CBC_SymbolInfo(true, 22, 18, 16, 10, 2);
+ g_symbols[10] = new CBC_SymbolInfo(false, 30, 20, 20, 20, 1);
+ g_symbols[11] = new CBC_SymbolInfo(true, 32, 24, 16, 14, 2);
+ g_symbols[12] = new CBC_SymbolInfo(false, 36, 24, 22, 22, 1);
+ g_symbols[13] = new CBC_SymbolInfo(false, 44, 28, 24, 24, 1);
+ g_symbols[14] = new CBC_SymbolInfo(true, 49, 28, 22, 14, 2);
+ g_symbols[15] = new CBC_SymbolInfo(false, 62, 36, 14, 14, 4);
+ g_symbols[16] = new CBC_SymbolInfo(false, 86, 42, 16, 16, 4);
+ g_symbols[17] = new CBC_SymbolInfo(false, 114, 48, 18, 18, 4);
+ g_symbols[18] = new CBC_SymbolInfo(false, 144, 56, 20, 20, 4);
+ g_symbols[19] = new CBC_SymbolInfo(false, 174, 68, 22, 22, 4);
+ g_symbols[20] = new CBC_SymbolInfo(false, 204, 84, 24, 24, 4, 102, 42);
+ g_symbols[21] = new CBC_SymbolInfo(false, 280, 112, 14, 14, 16, 140, 56);
+ g_symbols[22] = new CBC_SymbolInfo(false, 368, 144, 16, 16, 16, 92, 36);
+ g_symbols[23] = new CBC_SymbolInfo(false, 456, 192, 18, 18, 16, 114, 48);
+ g_symbols[24] = new CBC_SymbolInfo(false, 576, 224, 20, 20, 16, 144, 56);
+ g_symbols[25] = new CBC_SymbolInfo(false, 696, 272, 22, 22, 16, 174, 68);
+ g_symbols[26] = new CBC_SymbolInfo(false, 816, 336, 24, 24, 16, 136, 56);
+ g_symbols[27] = new CBC_SymbolInfo(false, 1050, 408, 18, 18, 36, 175, 68);
+ g_symbols[28] = new CBC_SymbolInfo(false, 1304, 496, 20, 20, 36, 163, 62);
g_symbols[29] = new CBC_DataMatrixSymbolInfo144();
}
@@ -80,7 +80,7 @@ void CBC_SymbolInfo::Finalize() {
}
}
-CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular,
+CBC_SymbolInfo::CBC_SymbolInfo(bool rectangular,
int32_t dataCapacity,
int32_t errorCodewords,
int32_t matrixWidth,
@@ -95,7 +95,7 @@ CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular,
m_rsBlockData = dataCapacity;
m_rsBlockError = errorCodewords;
}
-CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular,
+CBC_SymbolInfo::CBC_SymbolInfo(bool rectangular,
int32_t dataCapacity,
int32_t errorCodewords,
int32_t matrixWidth,
@@ -115,23 +115,23 @@ CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular,
CBC_SymbolInfo::~CBC_SymbolInfo() {}
CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, int32_t& e) {
- return lookup(dataCodewords, FORCE_NONE, TRUE, e);
+ return lookup(dataCodewords, FORCE_NONE, true, e);
}
CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords,
SymbolShapeHint shape,
int32_t& e) {
- return lookup(dataCodewords, shape, TRUE, e);
+ return lookup(dataCodewords, shape, true, e);
}
CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords,
- FX_BOOL allowRectangular,
- FX_BOOL fail,
+ bool allowRectangular,
+ bool fail,
int32_t& e) {
SymbolShapeHint shape = allowRectangular ? FORCE_NONE : FORCE_SQUARE;
return lookup(dataCodewords, shape, fail, e);
}
CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords,
SymbolShapeHint shape,
- FX_BOOL fail,
+ bool fail,
int32_t& e) {
return lookup(dataCodewords, shape, nullptr, nullptr, fail, e);
}
@@ -139,7 +139,7 @@ CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords,
SymbolShapeHint shape,
CBC_Dimension* minSize,
CBC_Dimension* maxSize,
- FX_BOOL fail,
+ bool fail,
int32_t& e) {
for (size_t i = 0; i < kSymbolsCount; i++) {
CBC_SymbolInfo* symbol = g_symbols[i];
diff --git a/xfa/fxbarcode/datamatrix/BC_SymbolInfo.h b/xfa/fxbarcode/datamatrix/BC_SymbolInfo.h
index b5778d5a3a..d2730025db 100644
--- a/xfa/fxbarcode/datamatrix/BC_SymbolInfo.h
+++ b/xfa/fxbarcode/datamatrix/BC_SymbolInfo.h
@@ -15,7 +15,7 @@ class CBC_Dimension;
class CBC_SymbolInfo : public CBC_SymbolShapeHint {
public:
- CBC_SymbolInfo(FX_BOOL rectangular,
+ CBC_SymbolInfo(bool rectangular,
int32_t dataCapacity,
int32_t errorCodewords,
int32_t matrixWidth,
@@ -31,18 +31,18 @@ class CBC_SymbolInfo : public CBC_SymbolShapeHint {
SymbolShapeHint shape,
int32_t& e);
static CBC_SymbolInfo* lookup(int32_t dataCodewords,
- FX_BOOL allowRectangular,
- FX_BOOL fail,
+ bool allowRectangular,
+ bool fail,
int32_t& e);
static CBC_SymbolInfo* lookup(int32_t dataCodewords,
SymbolShapeHint shape,
- FX_BOOL fail,
+ bool fail,
int32_t& e);
static CBC_SymbolInfo* lookup(int32_t dataCodewords,
SymbolShapeHint shape,
CBC_Dimension* minSize,
CBC_Dimension* maxSize,
- FX_BOOL fail,
+ bool fail,
int32_t& e);
int32_t getHorizontalDataRegions(int32_t& e);
int32_t getVerticalDataRegions(int32_t& e);
@@ -63,7 +63,7 @@ class CBC_SymbolInfo : public CBC_SymbolShapeHint {
int32_t m_rsBlockError;
private:
- CBC_SymbolInfo(FX_BOOL rectangular,
+ CBC_SymbolInfo(bool rectangular,
int32_t dataCapacity,
int32_t errorCodewords,
int32_t matrixWidth,
@@ -72,7 +72,7 @@ class CBC_SymbolInfo : public CBC_SymbolShapeHint {
int32_t rsBlockData,
int32_t rsBlockError);
- FX_BOOL m_rectangular;
+ bool m_rectangular;
int32_t m_dataRegions;
};
diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
index cb145f52ed..0555ba65fd 100644
--- a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -36,21 +36,21 @@
CBC_OneDimWriter::CBC_OneDimWriter() {
m_locTextLoc = BC_TEXT_LOC_BELOWEMBED;
- m_bPrintChecksum = TRUE;
+ m_bPrintChecksum = true;
m_iDataLenth = 0;
- m_bCalcChecksum = FALSE;
+ m_bCalcChecksum = false;
m_pFont = nullptr;
m_fFontSize = 10;
m_iFontStyle = 0;
m_fontColor = 0xff000000;
m_iContentLen = 0;
- m_bLeftPadding = FALSE;
- m_bRightPadding = FALSE;
+ m_bLeftPadding = false;
+ m_bRightPadding = false;
}
CBC_OneDimWriter::~CBC_OneDimWriter() {}
-void CBC_OneDimWriter::SetPrintChecksum(FX_BOOL checksum) {
+void CBC_OneDimWriter::SetPrintChecksum(bool checksum) {
m_bPrintChecksum = checksum;
}
@@ -58,16 +58,16 @@ void CBC_OneDimWriter::SetDataLength(int32_t length) {
m_iDataLenth = length;
}
-void CBC_OneDimWriter::SetCalcChecksum(FX_BOOL state) {
+void CBC_OneDimWriter::SetCalcChecksum(bool state) {
m_bCalcChecksum = state;
}
-FX_BOOL CBC_OneDimWriter::SetFont(CFX_Font* cFont) {
+bool CBC_OneDimWriter::SetFont(CFX_Font* cFont) {
if (!cFont)
- return FALSE;
+ return false;
m_pFont = cFont;
- return TRUE;
+ return true;
}
void CBC_OneDimWriter::SetFontSize(FX_FLOAT size) {
@@ -387,7 +387,7 @@ void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
void CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
int32_t codeLength,
- FX_BOOL isDevice,
+ bool isDevice,
int32_t& e) {
if (codeLength < 1) {
BC_EXCEPTION_CHECK_ReturnVoid(e);
@@ -460,9 +460,8 @@ void CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents,
}
}
-FX_BOOL CBC_OneDimWriter::CheckContentValidity(
- const CFX_WideStringC& contents) {
- return TRUE;
+bool CBC_OneDimWriter::CheckContentValidity(const CFX_WideStringC& contents) {
+ return true;
}
CFX_WideString CBC_OneDimWriter::FilterContents(
diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.h b/xfa/fxbarcode/oned/BC_OneDimWriter.h
index 16d02e903d..e37d774341 100644
--- a/xfa/fxbarcode/oned/BC_OneDimWriter.h
+++ b/xfa/fxbarcode/oned/BC_OneDimWriter.h
@@ -40,7 +40,7 @@ class CBC_OneDimWriter : public CBC_Writer {
virtual void RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
int32_t codeLength,
- FX_BOOL isDevice,
+ bool isDevice,
int32_t& e);
virtual void RenderBitmapResult(CFX_DIBitmap*& pOutBitmap,
const CFX_WideStringC& contents,
@@ -49,16 +49,16 @@ class CBC_OneDimWriter : public CBC_Writer {
const CFX_Matrix* matrix,
const CFX_WideStringC& contents,
int32_t& e);
- virtual FX_BOOL CheckContentValidity(const CFX_WideStringC& contents);
+ virtual bool CheckContentValidity(const CFX_WideStringC& contents);
virtual CFX_WideString FilterContents(const CFX_WideStringC& contents);
virtual CFX_WideString RenderTextContents(const CFX_WideStringC& contents);
- virtual void SetPrintChecksum(FX_BOOL checksum);
+ virtual void SetPrintChecksum(bool checksum);
virtual void SetDataLength(int32_t length);
- virtual void SetCalcChecksum(FX_BOOL state);
+ virtual void SetCalcChecksum(bool state);
virtual void SetFontSize(FX_FLOAT size);
virtual void SetFontStyle(int32_t style);
virtual void SetFontColor(FX_ARGB color);
- FX_BOOL SetFont(CFX_Font* cFont);
+ bool SetFont(CFX_Font* cFont);
protected:
virtual void CalcTextInfo(const CFX_ByteString& text,
@@ -98,17 +98,17 @@ class CBC_OneDimWriter : public CBC_Writer {
FX_WCHAR Upper(FX_WCHAR ch);
- FX_BOOL m_bPrintChecksum;
+ bool m_bPrintChecksum;
int32_t m_iDataLenth;
- FX_BOOL m_bCalcChecksum;
+ bool m_bCalcChecksum;
CFX_Font* m_pFont;
FX_FLOAT m_fFontSize;
int32_t m_iFontStyle;
uint32_t m_fontColor;
BC_TEXT_LOC m_locTextLoc;
int32_t m_iContentLen;
- FX_BOOL m_bLeftPadding;
- FX_BOOL m_bRightPadding;
+ bool m_bLeftPadding;
+ bool m_bRightPadding;
std::unique_ptr<CBC_CommonBitMatrix> m_output;
int32_t m_barWidth;
int32_t m_multiple;
diff --git a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
index e25a6c0a5c..fb0d7dcd72 100644
--- a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
@@ -48,77 +48,77 @@ CBC_OnedCodaBarWriter::CBC_OnedCodaBarWriter() {
m_iWideNarrRatio = 2;
}
CBC_OnedCodaBarWriter::~CBC_OnedCodaBarWriter() {}
-FX_BOOL CBC_OnedCodaBarWriter::SetStartChar(FX_CHAR start) {
+bool CBC_OnedCodaBarWriter::SetStartChar(FX_CHAR start) {
for (size_t i = 0; i < FX_ArraySize(START_END_CHARS); ++i) {
if (START_END_CHARS[i] == start) {
m_chStart = start;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CBC_OnedCodaBarWriter::SetEndChar(FX_CHAR end) {
+bool CBC_OnedCodaBarWriter::SetEndChar(FX_CHAR end) {
for (size_t i = 0; i < FX_ArraySize(START_END_CHARS); ++i) {
if (START_END_CHARS[i] == end) {
m_chEnd = end;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void CBC_OnedCodaBarWriter::SetDataLength(int32_t length) {
m_iDataLenth = length + 2;
}
-FX_BOOL CBC_OnedCodaBarWriter::SetTextLocation(BC_TEXT_LOC location) {
+bool CBC_OnedCodaBarWriter::SetTextLocation(BC_TEXT_LOC location) {
if (location < BC_TEXT_LOC_NONE || location > BC_TEXT_LOC_BELOWEMBED) {
- return FALSE;
+ return false;
}
m_locTextLoc = location;
- return TRUE;
+ return true;
}
-FX_BOOL CBC_OnedCodaBarWriter::SetWideNarrowRatio(int32_t ratio) {
+bool CBC_OnedCodaBarWriter::SetWideNarrowRatio(int32_t ratio) {
if (ratio < 2 || ratio > 3) {
- return FALSE;
+ return false;
}
m_iWideNarrRatio = ratio;
- return TRUE;
+ return true;
}
-FX_BOOL CBC_OnedCodaBarWriter::FindChar(FX_WCHAR ch, FX_BOOL isContent) {
+bool CBC_OnedCodaBarWriter::FindChar(FX_WCHAR ch, bool isContent) {
if (isContent) {
for (size_t i = 0; i < FX_ArraySize(CONTENT_CHARS); ++i) {
if (ch == (FX_WCHAR)CONTENT_CHARS[i]) {
- return TRUE;
+ return true;
}
}
for (size_t j = 0; j < FX_ArraySize(START_END_CHARS); ++j) {
if (ch == (FX_WCHAR)START_END_CHARS[j]) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
} else {
for (size_t i = 0; i < FX_ArraySize(CONTENT_CHARS); ++i) {
if (ch == (FX_WCHAR)CONTENT_CHARS[i]) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
}
-FX_BOOL CBC_OnedCodaBarWriter::CheckContentValidity(
+bool CBC_OnedCodaBarWriter::CheckContentValidity(
const CFX_WideStringC& contents) {
FX_WCHAR ch;
int32_t index = 0;
for (index = 0; index < contents.GetLength(); index++) {
ch = contents.GetAt(index);
- if (FindChar(ch, FALSE)) {
+ if (FindChar(ch, false)) {
continue;
} else {
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
CFX_WideString CBC_OnedCodaBarWriter::FilterContents(
const CFX_WideStringC& contents) {
@@ -130,7 +130,7 @@ CFX_WideString CBC_OnedCodaBarWriter::FilterContents(
index++;
continue;
}
- if (FindChar(ch, TRUE)) {
+ if (FindChar(ch, true)) {
filtercontents += ch;
} else {
continue;
@@ -230,7 +230,7 @@ CFX_WideString CBC_OnedCodaBarWriter::encodedContents(
void CBC_OnedCodaBarWriter::RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
int32_t codeLength,
- FX_BOOL isDevice,
+ bool isDevice,
int32_t& e) {
CBC_OneDimWriter::RenderResult(encodedContents(contents).AsStringC(), code,
codeLength, isDevice, e);
diff --git a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h
index 417b2fe408..301c34a751 100644
--- a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h
+++ b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h
@@ -32,22 +32,22 @@ class CBC_OnedCodaBarWriter : public CBC_OneDimWriter {
int32_t& outHeight,
int32_t hints,
int32_t& e) override;
- FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override;
+ bool CheckContentValidity(const CFX_WideStringC& contents) override;
CFX_WideString FilterContents(const CFX_WideStringC& contents) override;
void SetDataLength(int32_t length) override;
virtual CFX_WideString encodedContents(const CFX_WideStringC& contents);
- virtual FX_BOOL SetStartChar(FX_CHAR start);
- virtual FX_BOOL SetEndChar(FX_CHAR end);
- virtual FX_BOOL SetTextLocation(BC_TEXT_LOC location);
- virtual FX_BOOL SetWideNarrowRatio(int32_t ratio);
- virtual FX_BOOL FindChar(FX_WCHAR ch, FX_BOOL isContent);
+ virtual bool SetStartChar(FX_CHAR start);
+ virtual bool SetEndChar(FX_CHAR end);
+ virtual bool SetTextLocation(BC_TEXT_LOC location);
+ virtual bool SetWideNarrowRatio(int32_t ratio);
+ virtual bool FindChar(FX_WCHAR ch, bool isContent);
private:
void RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
int32_t codeLength,
- FX_BOOL isDevice,
+ bool isDevice,
int32_t& e) override;
FX_CHAR m_chStart;
diff --git a/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp b/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp
index 109742e85f..ed2d2c1b24 100644
--- a/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp
@@ -80,22 +80,22 @@ CBC_OnedCode128Writer::~CBC_OnedCode128Writer() {}
BC_TYPE CBC_OnedCode128Writer::GetType() {
return m_codeFormat;
}
-FX_BOOL CBC_OnedCode128Writer::CheckContentValidity(
+bool CBC_OnedCode128Writer::CheckContentValidity(
const CFX_WideStringC& contents) {
- FX_BOOL ret = TRUE;
+ bool ret = true;
int32_t position = 0;
int32_t patternIndex = -1;
if (m_codeFormat == BC_CODE128_B || m_codeFormat == BC_CODE128_C) {
while (position < contents.GetLength()) {
patternIndex = (int32_t)contents.GetAt(position);
if (patternIndex < 32 || patternIndex > 126 || patternIndex == 34) {
- ret = FALSE;
+ ret = false;
break;
}
position++;
}
} else {
- ret = FALSE;
+ ret = false;
}
return ret;
}
@@ -135,12 +135,12 @@ CFX_WideString CBC_OnedCode128Writer::FilterContents(
}
return filtercontents;
}
-FX_BOOL CBC_OnedCode128Writer::SetTextLocation(BC_TEXT_LOC location) {
+bool CBC_OnedCode128Writer::SetTextLocation(BC_TEXT_LOC location) {
if (location < BC_TEXT_LOC_NONE || location > BC_TEXT_LOC_BELOWEMBED) {
- return FALSE;
+ return false;
}
m_locTextLoc = location;
- return TRUE;
+ return true;
}
uint8_t* CBC_OnedCode128Writer::Encode(const CFX_ByteString& contents,
BCFORMAT format,
@@ -166,16 +166,16 @@ uint8_t* CBC_OnedCode128Writer::Encode(const CFX_ByteString& contents,
BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
return ret;
}
-FX_BOOL CBC_OnedCode128Writer::IsDigits(const CFX_ByteString& contents,
- int32_t start,
- int32_t length) {
+bool CBC_OnedCode128Writer::IsDigits(const CFX_ByteString& contents,
+ int32_t start,
+ int32_t length) {
int32_t end = start + length;
for (int32_t i = start; i < end; i++) {
if (contents[i] < '0' || contents[i] > '9') {
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
uint8_t* CBC_OnedCode128Writer::Encode(const CFX_ByteString& contents,
diff --git a/xfa/fxbarcode/oned/BC_OnedCode128Writer.h b/xfa/fxbarcode/oned/BC_OnedCode128Writer.h
index 7c85af102d..60a2f03acc 100644
--- a/xfa/fxbarcode/oned/BC_OnedCode128Writer.h
+++ b/xfa/fxbarcode/oned/BC_OnedCode128Writer.h
@@ -33,17 +33,15 @@ class CBC_OnedCode128Writer : public CBC_OneDimWriter {
int32_t& outLength,
int32_t& e) override;
- FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override;
+ bool CheckContentValidity(const CFX_WideStringC& contents) override;
CFX_WideString FilterContents(const CFX_WideStringC& contents) override;
- FX_BOOL SetTextLocation(BC_TEXT_LOC location);
+ bool SetTextLocation(BC_TEXT_LOC location);
BC_TYPE GetType();
private:
- FX_BOOL IsDigits(const CFX_ByteString& contents,
- int32_t start,
- int32_t length);
+ bool IsDigits(const CFX_ByteString& contents, int32_t start, int32_t length);
int32_t Encode128B(const CFX_ByteString& contents,
CFX_ArrayTemplate<const int32_t*>* patterns);
int32_t Encode128C(const CFX_ByteString& contents,
diff --git a/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp b/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp
index 3edf87ba30..9d5fdda968 100644
--- a/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp
@@ -45,7 +45,7 @@ CBC_OnedCode39Writer::CBC_OnedCode39Writer() {
m_iWideNarrRatio = 3;
}
CBC_OnedCode39Writer::~CBC_OnedCode39Writer() {}
-FX_BOOL CBC_OnedCode39Writer::CheckContentValidity(
+bool CBC_OnedCode39Writer::CheckContentValidity(
const CFX_WideStringC& contents) {
for (int32_t i = 0; i < contents.GetLength(); i++) {
FX_WCHAR ch = contents.GetAt(i);
@@ -56,9 +56,9 @@ FX_BOOL CBC_OnedCode39Writer::CheckContentValidity(
ch == (FX_WCHAR)'%') {
continue;
}
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
CFX_WideString CBC_OnedCode39Writer::FilterContents(
@@ -110,19 +110,19 @@ CFX_WideString CBC_OnedCode39Writer::RenderTextContents(
return renderContents;
}
-FX_BOOL CBC_OnedCode39Writer::SetTextLocation(BC_TEXT_LOC location) {
+bool CBC_OnedCode39Writer::SetTextLocation(BC_TEXT_LOC location) {
if (location < BC_TEXT_LOC_NONE || location > BC_TEXT_LOC_BELOWEMBED) {
- return FALSE;
+ return false;
}
m_locTextLoc = location;
- return TRUE;
+ return true;
}
-FX_BOOL CBC_OnedCode39Writer::SetWideNarrowRatio(int32_t ratio) {
+bool CBC_OnedCode39Writer::SetWideNarrowRatio(int32_t ratio) {
if (ratio < 2 || ratio > 3) {
- return FALSE;
+ return false;
}
m_iWideNarrRatio = ratio;
- return TRUE;
+ return true;
}
uint8_t* CBC_OnedCode39Writer::Encode(const CFX_ByteString& contents,
BCFORMAT format,
@@ -272,7 +272,7 @@ CFX_WideString CBC_OnedCode39Writer::encodedContents(
void CBC_OnedCode39Writer::RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
int32_t codeLength,
- FX_BOOL isDevice,
+ bool isDevice,
int32_t& e) {
CFX_WideString encodedCon = encodedContents(contents, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
diff --git a/xfa/fxbarcode/oned/BC_OnedCode39Writer.h b/xfa/fxbarcode/oned/BC_OnedCode39Writer.h
index 711e1c0534..c8755a3e69 100644
--- a/xfa/fxbarcode/oned/BC_OnedCode39Writer.h
+++ b/xfa/fxbarcode/oned/BC_OnedCode39Writer.h
@@ -33,16 +33,16 @@ class CBC_OnedCode39Writer : public CBC_OneDimWriter {
void RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
int32_t codeLength,
- FX_BOOL isDevice,
+ bool isDevice,
int32_t& e) override;
- FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override;
+ bool CheckContentValidity(const CFX_WideStringC& contents) override;
CFX_WideString FilterContents(const CFX_WideStringC& contents) override;
CFX_WideString RenderTextContents(const CFX_WideStringC& contents) override;
virtual CFX_WideString encodedContents(const CFX_WideStringC& contents,
int32_t& e);
- virtual FX_BOOL SetTextLocation(BC_TEXT_LOC loction);
- virtual FX_BOOL SetWideNarrowRatio(int32_t ratio);
+ virtual bool SetTextLocation(BC_TEXT_LOC loction);
+ virtual bool SetWideNarrowRatio(int32_t ratio);
private:
void ToIntArray(int32_t a, int32_t* toReturn);
diff --git a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp
index 51f77b5082..71d9ac6505 100644
--- a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp
@@ -44,20 +44,20 @@ const int32_t L_AND_G_PATTERNS[20][4] = {
} // namespace
CBC_OnedEAN13Writer::CBC_OnedEAN13Writer() {
- m_bLeftPadding = TRUE;
+ m_bLeftPadding = true;
m_codeWidth = 3 + (7 * 6) + 5 + (7 * 6) + 3;
}
CBC_OnedEAN13Writer::~CBC_OnedEAN13Writer() {}
-FX_BOOL CBC_OnedEAN13Writer::CheckContentValidity(
+bool CBC_OnedEAN13Writer::CheckContentValidity(
const CFX_WideStringC& contents) {
for (int32_t i = 0; i < contents.GetLength(); i++) {
if (contents.GetAt(i) >= '0' && contents.GetAt(i) <= '9') {
continue;
} else {
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
CFX_WideString CBC_OnedEAN13Writer::FilterContents(
const CFX_WideStringC& contents) {
@@ -296,7 +296,7 @@ void CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents,
void CBC_OnedEAN13Writer::RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
int32_t codeLength,
- FX_BOOL isDevice,
+ bool isDevice,
int32_t& e) {
CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e);
}
diff --git a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.h b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.h
index f30a74fda0..5775f89046 100644
--- a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.h
+++ b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.h
@@ -37,9 +37,9 @@ class CBC_OnedEAN13Writer : public CBC_OneDimWriter {
void RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
int32_t codeLength,
- FX_BOOL isDevice,
+ bool isDevice,
int32_t& e) override;
- FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override;
+ bool CheckContentValidity(const CFX_WideStringC& contents) override;
CFX_WideString FilterContents(const CFX_WideStringC& contents) override;
int32_t CalcChecksum(const CFX_ByteString& contents);
diff --git a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp
index 2305b18a90..ad3ee6160f 100644
--- a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp
@@ -45,23 +45,22 @@ CBC_OnedEAN8Writer::~CBC_OnedEAN8Writer() {}
void CBC_OnedEAN8Writer::SetDataLength(int32_t length) {
m_iDataLenth = 8;
}
-FX_BOOL CBC_OnedEAN8Writer::SetTextLocation(BC_TEXT_LOC location) {
+bool CBC_OnedEAN8Writer::SetTextLocation(BC_TEXT_LOC location) {
if (location == BC_TEXT_LOC_BELOWEMBED) {
m_locTextLoc = location;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CBC_OnedEAN8Writer::CheckContentValidity(
- const CFX_WideStringC& contents) {
+bool CBC_OnedEAN8Writer::CheckContentValidity(const CFX_WideStringC& contents) {
for (int32_t i = 0; i < contents.GetLength(); i++) {
if (contents.GetAt(i) >= '0' && contents.GetAt(i) <= '9') {
continue;
} else {
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
CFX_WideString CBC_OnedEAN8Writer::FilterContents(
const CFX_WideStringC& contents) {
@@ -262,7 +261,7 @@ void CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents,
void CBC_OnedEAN8Writer::RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
int32_t codeLength,
- FX_BOOL isDevice,
+ bool isDevice,
int32_t& e) {
CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e);
}
diff --git a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.h b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.h
index 8517d8614a..844fc33afa 100644
--- a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.h
+++ b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.h
@@ -39,13 +39,13 @@ class CBC_OnedEAN8Writer : public CBC_OneDimWriter {
void RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
int32_t codeLength,
- FX_BOOL isDevice,
+ bool isDevice,
int32_t& e) override;
- FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override;
+ bool CheckContentValidity(const CFX_WideStringC& contents) override;
CFX_WideString FilterContents(const CFX_WideStringC& contents) override;
void SetDataLength(int32_t length) override;
- FX_BOOL SetTextLocation(BC_TEXT_LOC location);
+ bool SetTextLocation(BC_TEXT_LOC location);
int32_t CalcChecksum(const CFX_ByteString& contents);
protected:
diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
index e594bc7ee6..db1b67beef 100644
--- a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
@@ -28,8 +28,8 @@
#include "xfa/fxbarcode/oned/BC_OnedUPCAWriter.h"
CBC_OnedUPCAWriter::CBC_OnedUPCAWriter() {
- m_bLeftPadding = TRUE;
- m_bRightPadding = TRUE;
+ m_bLeftPadding = true;
+ m_bRightPadding = true;
}
void CBC_OnedUPCAWriter::Init() {
@@ -38,13 +38,12 @@ void CBC_OnedUPCAWriter::Init() {
CBC_OnedUPCAWriter::~CBC_OnedUPCAWriter() {}
-FX_BOOL CBC_OnedUPCAWriter::CheckContentValidity(
- const CFX_WideStringC& contents) {
+bool CBC_OnedUPCAWriter::CheckContentValidity(const CFX_WideStringC& contents) {
for (FX_STRSIZE i = 0; i < contents.GetLength(); ++i) {
if (contents.GetAt(i) < '0' || contents.GetAt(i) > '9')
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
CFX_WideString CBC_OnedUPCAWriter::FilterContents(
@@ -275,7 +274,7 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
void CBC_OnedUPCAWriter::RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
int32_t codeLength,
- FX_BOOL isDevice,
+ bool isDevice,
int32_t& e) {
CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e);
}
diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h
index 8575572820..6b786ce3b8 100644
--- a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h
+++ b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h
@@ -42,9 +42,9 @@ class CBC_OnedUPCAWriter : public CBC_OneDimWriter {
void RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
int32_t codeLength,
- FX_BOOL isDevice,
+ bool isDevice,
int32_t& e) override;
- FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override;
+ bool CheckContentValidity(const CFX_WideStringC& contents) override;
CFX_WideString FilterContents(const CFX_WideStringC& contents) override;
void Init();
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417.cpp b/xfa/fxbarcode/pdf417/BC_PDF417.cpp
index 843ee23364..9d827acff6 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417.cpp
@@ -381,9 +381,9 @@ const int32_t CBC_PDF417::CODEWORD_TABLE[][929] = {
0x10396, 0x107b6, 0x187d4, 0x187d2, 0x10794, 0x10fb4, 0x10792, 0x10fb2,
0x1c7ea}};
-CBC_PDF417::CBC_PDF417() : CBC_PDF417(FALSE) {}
+CBC_PDF417::CBC_PDF417() : CBC_PDF417(false) {}
-CBC_PDF417::CBC_PDF417(FX_BOOL compact)
+CBC_PDF417::CBC_PDF417(bool compact)
: m_compact(compact),
m_compaction(AUTO),
m_minCols(1),
@@ -451,7 +451,7 @@ void CBC_PDF417::setCompaction(Compaction compaction) {
m_compaction = compaction;
}
-void CBC_PDF417::setCompact(FX_BOOL compact) {
+void CBC_PDF417::setCompact(bool compact) {
m_compact = compact;
}
@@ -475,10 +475,10 @@ void CBC_PDF417::encodeChar(int32_t pattern,
int32_t len,
CBC_BarcodeRow* logic) {
int32_t map = 1 << (len - 1);
- FX_BOOL last = ((pattern & map) != 0);
+ bool last = ((pattern & map) != 0);
int32_t width = 0;
for (int32_t i = 0; i < len; i++) {
- FX_BOOL black = ((pattern & map) != 0);
+ bool black = ((pattern & map) != 0);
if (last == black) {
width++;
} else {
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417.h b/xfa/fxbarcode/pdf417/BC_PDF417.h
index c3a9f4c477..5f7c2d49b9 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417.h
+++ b/xfa/fxbarcode/pdf417/BC_PDF417.h
@@ -18,7 +18,7 @@ class CBC_BarcodeMatrix;
class CBC_PDF417 {
public:
CBC_PDF417();
- explicit CBC_PDF417(FX_BOOL compact);
+ explicit CBC_PDF417(bool compact);
virtual ~CBC_PDF417();
CBC_BarcodeMatrix* getBarcodeMatrix();
@@ -30,7 +30,7 @@ class CBC_PDF417 {
int32_t maxRows,
int32_t minRows);
void setCompaction(Compaction compaction);
- void setCompact(FX_BOOL compact);
+ void setCompact(bool compact);
private:
static const int32_t START_PATTERN = 0x1fea8;
@@ -56,7 +56,7 @@ class CBC_PDF417 {
int32_t& e);
std::unique_ptr<CBC_BarcodeMatrix> m_barcodeMatrix;
- FX_BOOL m_compact;
+ bool m_compact;
Compaction m_compaction;
int32_t m_minCols;
int32_t m_maxCols;
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp
index a9d1fedef0..f348d2c934 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp
@@ -44,7 +44,7 @@ CBC_BarcodeMatrix::~CBC_BarcodeMatrix() {
void CBC_BarcodeMatrix::set(int32_t x, int32_t y, uint8_t value) {
m_matrix[y]->set(x, value);
}
-void CBC_BarcodeMatrix::setMatrix(int32_t x, int32_t y, FX_BOOL black) {
+void CBC_BarcodeMatrix::setMatrix(int32_t x, int32_t y, bool black) {
set(x, y, (uint8_t)(black ? 1 : 0));
}
void CBC_BarcodeMatrix::startRow() {
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h
index 853b9eea98..0f6922233d 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h
+++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h
@@ -18,7 +18,7 @@ class CBC_BarcodeMatrix {
virtual ~CBC_BarcodeMatrix();
void set(int32_t x, int32_t y, uint8_t value);
- void setMatrix(int32_t x, int32_t y, FX_BOOL black);
+ void setMatrix(int32_t x, int32_t y, bool black);
void startRow();
CBC_BarcodeRow* getCurrentRow();
CFX_ByteArray& getMatrix();
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp
index 6f88b33877..b721ffc3ef 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp
@@ -33,10 +33,10 @@ CBC_BarcodeRow::~CBC_BarcodeRow() {
void CBC_BarcodeRow::set(int32_t x, uint8_t value) {
m_row.SetAt(x, value);
}
-void CBC_BarcodeRow::set(int32_t x, FX_BOOL black) {
+void CBC_BarcodeRow::set(int32_t x, bool black) {
m_row.SetAt(x, (uint8_t)(black ? 1 : 0));
}
-void CBC_BarcodeRow::addBar(FX_BOOL black, int32_t width) {
+void CBC_BarcodeRow::addBar(bool black, int32_t width) {
for (int32_t ii = 0; ii < width; ii++) {
set(m_currentLocation++, black);
}
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h
index 4325acc05f..802a49cb5e 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h
+++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h
@@ -15,8 +15,8 @@ class CBC_BarcodeRow {
virtual ~CBC_BarcodeRow();
void set(int32_t x, uint8_t value);
- void set(int32_t x, FX_BOOL black);
- void addBar(FX_BOOL black, int32_t width);
+ void set(int32_t x, bool black);
+ void addBar(bool black, int32_t width);
CFX_ByteArray& getRow();
CFX_ByteArray& getScaledRow(int32_t scale);
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
index 7617d526c1..fa0e9bc67d 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
@@ -155,7 +155,7 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg,
CFX_WideString tmp;
int32_t submode = initialSubmode;
int32_t idx = 0;
- while (TRUE) {
+ while (true) {
FX_WCHAR ch = msg.GetAt(startpos + idx);
switch (submode) {
case SUBMODE_ALPHA:
@@ -247,7 +247,7 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg,
FX_WCHAR h = 0;
int32_t len = tmp.GetLength();
for (int32_t i = 0; i < len; i++) {
- FX_BOOL odd = (i % 2) != 0;
+ bool odd = (i % 2) != 0;
if (odd) {
h = (FX_WCHAR)((h * 30) + tmp.GetAt(i));
sb += h;
@@ -320,22 +320,22 @@ void CBC_PDF417HighLevelEncoder::encodeNumeric(CFX_WideString msg,
idx += len;
}
}
-FX_BOOL CBC_PDF417HighLevelEncoder::isDigit(FX_WCHAR ch) {
+bool CBC_PDF417HighLevelEncoder::isDigit(FX_WCHAR ch) {
return ch >= '0' && ch <= '9';
}
-FX_BOOL CBC_PDF417HighLevelEncoder::isAlphaUpper(FX_WCHAR ch) {
+bool CBC_PDF417HighLevelEncoder::isAlphaUpper(FX_WCHAR ch) {
return ch == ' ' || (ch >= 'A' && ch <= 'Z');
}
-FX_BOOL CBC_PDF417HighLevelEncoder::isAlphaLower(FX_WCHAR ch) {
+bool CBC_PDF417HighLevelEncoder::isAlphaLower(FX_WCHAR ch) {
return ch == ' ' || (ch >= 'a' && ch <= 'z');
}
-FX_BOOL CBC_PDF417HighLevelEncoder::isMixed(FX_WCHAR ch) {
+bool CBC_PDF417HighLevelEncoder::isMixed(FX_WCHAR ch) {
return MIXED[ch] != -1;
}
-FX_BOOL CBC_PDF417HighLevelEncoder::isPunctuation(FX_WCHAR ch) {
+bool CBC_PDF417HighLevelEncoder::isPunctuation(FX_WCHAR ch) {
return PUNCTUATION[ch] != -1;
}
-FX_BOOL CBC_PDF417HighLevelEncoder::isText(FX_WCHAR ch) {
+bool CBC_PDF417HighLevelEncoder::isText(FX_WCHAR ch) {
return ch == '\t' || ch == '\n' || ch == '\r' || (ch >= 32 && ch <= 126);
}
int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveDigitCount(
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
index fb7664d4a3..39abe0f1df 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
+++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
@@ -48,12 +48,12 @@ class CBC_PDF417HighLevelEncoder {
int32_t startpos,
int32_t count,
CFX_WideString& sb);
- static FX_BOOL isDigit(FX_WCHAR ch);
- static FX_BOOL isAlphaUpper(FX_WCHAR ch);
- static FX_BOOL isAlphaLower(FX_WCHAR ch);
- static FX_BOOL isMixed(FX_WCHAR ch);
- static FX_BOOL isPunctuation(FX_WCHAR ch);
- static FX_BOOL isText(FX_WCHAR ch);
+ static bool isDigit(FX_WCHAR ch);
+ static bool isAlphaUpper(FX_WCHAR ch);
+ static bool isAlphaLower(FX_WCHAR ch);
+ static bool isMixed(FX_WCHAR ch);
+ static bool isPunctuation(FX_WCHAR ch);
+ static bool isText(FX_WCHAR ch);
static int32_t determineConsecutiveDigitCount(CFX_WideString msg,
int32_t startpos);
static int32_t determineConsecutiveTextCount(CFX_WideString msg,
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp b/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp
index 43cf09e549..4c9b5cb15c 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417Writer.cpp
@@ -29,19 +29,19 @@
#include "xfa/fxbarcode/pdf417/BC_PDF417Writer.h"
CBC_PDF417Writer::CBC_PDF417Writer() {
- m_bFixedSize = FALSE;
+ m_bFixedSize = false;
}
CBC_PDF417Writer::~CBC_PDF417Writer() {
- m_bTruncated = TRUE;
+ m_bTruncated = true;
}
-FX_BOOL CBC_PDF417Writer::SetErrorCorrectionLevel(int32_t level) {
+bool CBC_PDF417Writer::SetErrorCorrectionLevel(int32_t level) {
if (level < 0 || level > 8) {
- return FALSE;
+ return false;
}
m_iCorrectLevel = level;
- return TRUE;
+ return true;
}
-void CBC_PDF417Writer::SetTruncated(FX_BOOL truncated) {
+void CBC_PDF417Writer::SetTruncated(bool truncated) {
m_bTruncated = truncated;
}
uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString& contents,
@@ -70,10 +70,10 @@ uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString& contents,
int32_t height = outHeight;
outWidth = barcodeMatrix->getWidth();
outHeight = barcodeMatrix->getHeight();
- FX_BOOL rotated = FALSE;
+ bool rotated = false;
if ((height > width) ^ (outWidth < outHeight)) {
rotateArray(originalScale, outHeight, outWidth);
- rotated = TRUE;
+ rotated = true;
int32_t temp = outHeight;
outHeight = outWidth;
outWidth = temp;
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Writer.h b/xfa/fxbarcode/pdf417/BC_PDF417Writer.h
index 12b8e8baa9..178d251bfe 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417Writer.h
+++ b/xfa/fxbarcode/pdf417/BC_PDF417Writer.h
@@ -22,13 +22,13 @@ class CBC_PDF417Writer : public CBC_TwoDimWriter {
int32_t& e);
// CBC_TwoDimWriter
- FX_BOOL SetErrorCorrectionLevel(int32_t level) override;
+ bool SetErrorCorrectionLevel(int32_t level) override;
- void SetTruncated(FX_BOOL truncated);
+ void SetTruncated(bool truncated);
private:
void rotateArray(CFX_ByteArray& bitarray, int32_t width, int32_t height);
- FX_BOOL m_bTruncated;
+ bool m_bTruncated;
};
#endif // XFA_FXBARCODE_PDF417_BC_PDF417WRITER_H_
diff --git a/xfa/fxbarcode/qrcode/BC_QRCodeWriter.cpp b/xfa/fxbarcode/qrcode/BC_QRCodeWriter.cpp
index 01873f0f04..adb12f25b1 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCodeWriter.cpp
+++ b/xfa/fxbarcode/qrcode/BC_QRCodeWriter.cpp
@@ -31,7 +31,7 @@
#include "xfa/fxbarcode/qrcode/BC_QRCoderVersion.h"
CBC_QRCodeWriter::CBC_QRCodeWriter() {
- m_bFixedSize = TRUE;
+ m_bFixedSize = true;
m_iCorrectLevel = 1;
m_iVersion = 0;
}
@@ -48,20 +48,20 @@ void CBC_QRCodeWriter::ReleaseAll() {
CBC_QRCoderVersion::Destroy();
}
-FX_BOOL CBC_QRCodeWriter::SetVersion(int32_t version) {
+bool CBC_QRCodeWriter::SetVersion(int32_t version) {
if (version < 0 || version > 40) {
- return FALSE;
+ return false;
}
m_iVersion = version;
- return TRUE;
+ return true;
}
-FX_BOOL CBC_QRCodeWriter::SetErrorCorrectionLevel(int32_t level) {
+bool CBC_QRCodeWriter::SetErrorCorrectionLevel(int32_t level) {
if (level < 0 || level > 3) {
- return FALSE;
+ return false;
}
m_iCorrectLevel = level;
- return TRUE;
+ return true;
}
uint8_t* CBC_QRCodeWriter::Encode(const CFX_WideString& contents,
diff --git a/xfa/fxbarcode/qrcode/BC_QRCodeWriter.h b/xfa/fxbarcode/qrcode/BC_QRCodeWriter.h
index 6562107f10..5585fa55c1 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCodeWriter.h
+++ b/xfa/fxbarcode/qrcode/BC_QRCodeWriter.h
@@ -31,10 +31,10 @@ class CBC_QRCodeWriter : public CBC_TwoDimWriter {
int32_t& outWidth,
int32_t& outHeight,
int32_t& e);
- FX_BOOL SetVersion(int32_t version);
+ bool SetVersion(int32_t version);
// CBC_TwoDimWriter
- FX_BOOL SetErrorCorrectionLevel(int32_t level) override;
+ bool SetErrorCorrectionLevel(int32_t level) override;
static void ReleaseAll();
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoder.cpp b/xfa/fxbarcode/qrcode/BC_QRCoder.cpp
index 4c7956ed68..c47374935f 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCoder.cpp
+++ b/xfa/fxbarcode/qrcode/BC_QRCoder.cpp
@@ -90,7 +90,7 @@ int32_t CBC_QRCoder::At(int32_t x, int32_t y, int32_t& e) {
return value;
}
-FX_BOOL CBC_QRCoder::IsValid() {
+bool CBC_QRCoder::IsValid() {
return m_mode && m_ecLevel && m_version != -1 && m_matrixWidth != -1 &&
m_maskPattern != -1 && m_numTotalBytes != -1 && m_numDataBytes != -1 &&
m_numECBytes != -1 && m_numRSBlocks != -1 &&
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoder.h b/xfa/fxbarcode/qrcode/BC_QRCoder.h
index bbb37355f2..5e949920a7 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCoder.h
+++ b/xfa/fxbarcode/qrcode/BC_QRCoder.h
@@ -34,7 +34,7 @@ class CBC_QRCoder {
CBC_CommonByteMatrix* GetMatrix() const;
int32_t At(int32_t x, int32_t y, int32_t& e);
- FX_BOOL IsValid();
+ bool IsValid();
void SetMode(CBC_QRCoderMode* value);
void SetECLevel(CBC_QRCoderErrorCorrectionLevel* ecLevel);
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
index 209a9656a6..ddfbff2e3c 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
+++ b/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
@@ -635,13 +635,13 @@ CBC_QRCoderMode* CBC_QRCoderEncoder::ChooseMode(const CFX_ByteString& content,
if (encoding.Compare("SHIFT_JIS") == 0) {
return CBC_QRCoderMode::sKANJI;
}
- FX_BOOL hasNumeric = FALSE;
- FX_BOOL hasAlphaNumeric = FALSE;
+ bool hasNumeric = false;
+ bool hasAlphaNumeric = false;
for (int32_t i = 0; i < content.GetLength(); i++) {
if (isdigit((uint8_t)content[i])) {
- hasNumeric = TRUE;
+ hasNumeric = true;
} else if (GetAlphaNumericCode((uint8_t)content[i]) != -1) {
- hasAlphaNumeric = TRUE;
+ hasAlphaNumeric = true;
} else {
return CBC_QRCoderMode::sBYTE;
}
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp b/xfa/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp
index 4d845c4b07..8342b9b6db 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp
+++ b/xfa/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp
@@ -30,8 +30,8 @@ CBC_QRCoderMaskUtil::CBC_QRCoderMaskUtil() {}
CBC_QRCoderMaskUtil::~CBC_QRCoderMaskUtil() {}
int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1(
CBC_CommonByteMatrix* matrix) {
- return ApplyMaskPenaltyRule1Internal(matrix, TRUE) +
- ApplyMaskPenaltyRule1Internal(matrix, FALSE);
+ return ApplyMaskPenaltyRule1Internal(matrix, true) +
+ ApplyMaskPenaltyRule1Internal(matrix, false);
}
int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule2(
@@ -122,13 +122,13 @@ int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule4(
double darkRatio = (double)numDarkCells / numTotalCells;
return abs((int32_t)(darkRatio * 100 - 50) / 5) * 5 * 10;
}
-FX_BOOL CBC_QRCoderMaskUtil::GetDataMaskBit(int32_t maskPattern,
- int32_t x,
- int32_t y,
- int32_t& e) {
+bool CBC_QRCoderMaskUtil::GetDataMaskBit(int32_t maskPattern,
+ int32_t x,
+ int32_t y,
+ int32_t& e) {
if (!CBC_QRCoder::IsValidMaskPattern(maskPattern)) {
e = (BCExceptionInvalidateMaskPattern);
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
}
int32_t intermediate = 0, temp = 0;
switch (maskPattern) {
@@ -161,14 +161,14 @@ FX_BOOL CBC_QRCoderMaskUtil::GetDataMaskBit(int32_t maskPattern,
break;
default: {
e = BCExceptionInvalidateMaskPattern;
- BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
+ BC_EXCEPTION_CHECK_ReturnValue(e, false);
}
}
return intermediate == 0;
}
int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1Internal(
CBC_CommonByteMatrix* matrix,
- FX_BOOL isHorizontal) {
+ bool isHorizontal) {
int32_t penalty = 0;
int32_t numSameBitCells = 0;
int32_t prevBit = -1;
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderMaskUtil.h b/xfa/fxbarcode/qrcode/BC_QRCoderMaskUtil.h
index 35032a3aaf..9fbe073e7e 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCoderMaskUtil.h
+++ b/xfa/fxbarcode/qrcode/BC_QRCoderMaskUtil.h
@@ -11,17 +11,17 @@ class CBC_QRCoderMaskUtil {
public:
CBC_QRCoderMaskUtil();
virtual ~CBC_QRCoderMaskUtil();
- static FX_BOOL GetDataMaskBit(int32_t maskPattern,
- int32_t x,
- int32_t y,
- int32_t& e);
+ static bool GetDataMaskBit(int32_t maskPattern,
+ int32_t x,
+ int32_t y,
+ int32_t& e);
static int32_t ApplyMaskPenaltyRule1(CBC_CommonByteMatrix* matrix);
static int32_t ApplyMaskPenaltyRule2(CBC_CommonByteMatrix* matrix);
static int32_t ApplyMaskPenaltyRule3(CBC_CommonByteMatrix* matrix);
static int32_t ApplyMaskPenaltyRule4(CBC_CommonByteMatrix* matrix);
static int32_t ApplyMaskPenaltyRule1Internal(CBC_CommonByteMatrix* matrix,
- FX_BOOL isHorizontal);
+ bool isHorizontal);
};
#endif // XFA_FXBARCODE_QRCODE_BC_QRCODERMASKUTIL_H_
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp b/xfa/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp
index f5df04ee9c..ca44e01293 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp
+++ b/xfa/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp
@@ -211,8 +211,7 @@ void CBC_QRCoderMatrixUtil::EmbedDataBits(CBC_QRCoderBitVector* dataBits,
bit = 0;
}
if (maskPattern != -1) {
- FX_BOOL bol =
- CBC_QRCoderMaskUtil::GetDataMaskBit(maskPattern, xx, y, e);
+ bool bol = CBC_QRCoderMaskUtil::GetDataMaskBit(maskPattern, xx, y, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
if (bol) {
bit ^= 0x01;
@@ -285,10 +284,10 @@ void CBC_QRCoderMatrixUtil::MakeVersionInfoBits(int32_t version,
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
-FX_BOOL CBC_QRCoderMatrixUtil::IsEmpty(int32_t value) {
+bool CBC_QRCoderMatrixUtil::IsEmpty(int32_t value) {
return (uint8_t)value == 0xff;
}
-FX_BOOL CBC_QRCoderMatrixUtil::IsValidValue(int32_t value) {
+bool CBC_QRCoderMatrixUtil::IsValidValue(int32_t value) {
return ((uint8_t)value == 0xff || (uint8_t)value == 0x00 ||
(uint8_t)value == 0x01);
}
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h b/xfa/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h
index feb0bb491c..3ce4b7510b 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h
+++ b/xfa/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h
@@ -55,8 +55,8 @@ class CBC_QRCoderMatrixUtil {
static void MakeVersionInfoBits(int32_t version,
CBC_QRCoderBitVector* bits,
int32_t& e);
- static FX_BOOL IsEmpty(int32_t value);
- static FX_BOOL IsValidValue(int32_t value);
+ static bool IsEmpty(int32_t value);
+ static bool IsValidValue(int32_t value);
static void EmbedTimingPatterns(CBC_CommonByteMatrix* matrix, int32_t& e);
static void EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* matrix,
int32_t& e);
diff --git a/xfa/fxbarcode/utils.h b/xfa/fxbarcode/utils.h
index b4474501a7..9b5eae3ef1 100644
--- a/xfa/fxbarcode/utils.h
+++ b/xfa/fxbarcode/utils.h
@@ -10,11 +10,11 @@
#include "core/fxcrt/fx_basic.h"
typedef CFX_MapPtrTemplate<void*, int32_t> CFX_PtrToInt32;
-FX_BOOL BC_FX_ByteString_Replace(CFX_ByteString& dst,
- uint32_t first,
- uint32_t last,
- int32_t count,
- FX_CHAR c);
+bool BC_FX_ByteString_Replace(CFX_ByteString& dst,
+ uint32_t first,
+ uint32_t last,
+ int32_t count,
+ FX_CHAR c);
void BC_FX_ByteString_Append(CFX_ByteString& dst, int32_t count, FX_CHAR c);
void BC_FX_ByteString_Append(CFX_ByteString& dst, const CFX_ByteArray& ba);
diff --git a/xfa/fxfa/app/cxfa_eventparam.cpp b/xfa/fxfa/app/cxfa_eventparam.cpp
index 551f7f87d7..bcce7219bc 100644
--- a/xfa/fxfa/app/cxfa_eventparam.cpp
+++ b/xfa/fxfa/app/cxfa_eventparam.cpp
@@ -11,15 +11,15 @@
CXFA_EventParam::CXFA_EventParam()
: m_pTarget(nullptr),
m_eType(XFA_EVENT_Unknown),
- m_bCancelAction(FALSE),
+ m_bCancelAction(false),
m_iCommitKey(0),
- m_bKeyDown(FALSE),
- m_bModifier(FALSE),
- m_bReenter(FALSE),
+ m_bKeyDown(false),
+ m_bModifier(false),
+ m_bReenter(false),
m_iSelEnd(0),
m_iSelStart(0),
- m_bShift(FALSE),
- m_bIsFormReady(FALSE),
+ m_bShift(false),
+ m_bIsFormReady(false),
m_iValidateActivities(XFA_VALIDATE_preSubmit) {}
CXFA_EventParam::~CXFA_EventParam() {}
@@ -28,21 +28,21 @@ CXFA_EventParam::CXFA_EventParam(const CXFA_EventParam& other) = default;
void CXFA_EventParam::Reset() {
m_wsChange.clear();
- m_bCancelAction = FALSE;
+ m_bCancelAction = false;
m_iCommitKey = 0;
m_wsFullText.clear();
- m_bKeyDown = FALSE;
- m_bModifier = FALSE;
+ m_bKeyDown = false;
+ m_bModifier = false;
m_wsNewContentType.clear();
m_wsNewText.clear();
m_wsPrevContentType.clear();
m_wsPrevText.clear();
- m_bReenter = FALSE;
+ m_bReenter = false;
m_iSelEnd = 0;
m_iSelStart = 0;
- m_bShift = FALSE;
+ m_bShift = false;
m_wsSoapFaultCode.clear();
m_wsSoapFaultString.clear();
- m_bIsFormReady = FALSE;
+ m_bIsFormReady = false;
m_iValidateActivities = XFA_VALIDATE_preSubmit;
}
diff --git a/xfa/fxfa/app/xfa_checksum.cpp b/xfa/fxfa/app/xfa_checksum.cpp
index 351ae73a03..01035f8ea4 100644
--- a/xfa/fxfa/app/xfa_checksum.cpp
+++ b/xfa/fxfa/app/xfa_checksum.cpp
@@ -100,7 +100,7 @@ CXFA_SAXContext* CXFA_SAXReaderHandler::OnTagEnter(
const CFX_ByteStringC& bsTagName,
CFX_SAXItem::Type eType,
uint32_t dwStartPos) {
- UpdateChecksum(TRUE);
+ UpdateChecksum(true);
if (eType != CFX_SAXItem::Type::Tag &&
eType != CFX_SAXItem::Type::Instruction) {
return nullptr;
@@ -130,7 +130,7 @@ void CXFA_SAXReaderHandler::OnTagBreak(CXFA_SAXContext* pTag) {
return;
pTag->m_TextBuf << ">";
- UpdateChecksum(FALSE);
+ UpdateChecksum(false);
}
void CXFA_SAXReaderHandler::OnTagData(CXFA_SAXContext* pTag,
@@ -160,7 +160,7 @@ void CXFA_SAXReaderHandler::OnTagClose(CXFA_SAXContext* pTag,
else if (pTag->m_eNode == CFX_SAXItem::Type::Tag)
textBuf << "></" << pTag->m_bsTagName.AsStringC() << ">";
- UpdateChecksum(FALSE);
+ UpdateChecksum(false);
}
void CXFA_SAXReaderHandler::OnTagEnd(CXFA_SAXContext* pTag,
@@ -170,7 +170,7 @@ void CXFA_SAXReaderHandler::OnTagEnd(CXFA_SAXContext* pTag,
return;
pTag->m_TextBuf << "</" << bsTagName << ">";
- UpdateChecksum(FALSE);
+ UpdateChecksum(false);
}
void CXFA_SAXReaderHandler::OnTargetData(CXFA_SAXContext* pTag,
@@ -182,21 +182,21 @@ void CXFA_SAXReaderHandler::OnTargetData(CXFA_SAXContext* pTag,
if (eType == CFX_SAXItem::Type::Comment) {
m_SAXContext.m_TextBuf << "<!--" << bsData << "-->";
- UpdateChecksum(FALSE);
+ UpdateChecksum(false);
} else {
pTag->m_TextBuf << " " << bsData;
}
}
-void CXFA_SAXReaderHandler::UpdateChecksum(FX_BOOL bCheckSpace) {
+void CXFA_SAXReaderHandler::UpdateChecksum(bool bCheckSpace) {
int32_t iLength = m_SAXContext.m_TextBuf.GetLength();
if (iLength < 1) {
return;
}
uint8_t* pBuffer = m_SAXContext.m_TextBuf.GetBuffer();
- FX_BOOL bUpdata = TRUE;
+ bool bUpdata = true;
if (bCheckSpace) {
- bUpdata = FALSE;
+ bUpdata = false;
for (int32_t i = 0; i < iLength; i++) {
bUpdata = (pBuffer[i] > 0x20);
if (bUpdata) {
@@ -225,11 +225,11 @@ void CXFA_ChecksumContext::StartChecksum() {
m_pSAXReader = new CFX_SAXReader;
}
-FX_BOOL CXFA_ChecksumContext::UpdateChecksum(IFX_SeekableReadStream* pSrcFile,
- FX_FILESIZE offset,
- size_t size) {
+bool CXFA_ChecksumContext::UpdateChecksum(IFX_SeekableReadStream* pSrcFile,
+ FX_FILESIZE offset,
+ size_t size) {
if (!m_pSAXReader || !pSrcFile)
- return FALSE;
+ return false;
if (size < 1)
size = pSrcFile->GetSize();
@@ -240,7 +240,7 @@ FX_BOOL CXFA_ChecksumContext::UpdateChecksum(IFX_SeekableReadStream* pSrcFile,
CFX_SaxParseMode_NotSkipSpace | CFX_SaxParseMode_NotConvert_amp |
CFX_SaxParseMode_NotConvert_lt | CFX_SaxParseMode_NotConvert_gt |
CFX_SaxParseMode_NotConvert_sharp) < 0) {
- return FALSE;
+ return false;
}
return m_pSAXReader->ContinueParse(nullptr) > 99;
}
diff --git a/xfa/fxfa/app/xfa_ffapp.cpp b/xfa/fxfa/app/xfa_ffapp.cpp
index db97c6371a..c5dcad848c 100644
--- a/xfa/fxfa/app/xfa_ffapp.cpp
+++ b/xfa/fxfa/app/xfa_ffapp.cpp
@@ -89,9 +89,9 @@ CXFA_FFDocHandler* CXFA_FFApp::GetDocHandler() {
CXFA_FFDoc* CXFA_FFApp::CreateDoc(IXFA_DocEnvironment* pDocEnvironment,
IFX_SeekableReadStream* pStream,
- FX_BOOL bTakeOverFile) {
+ bool bTakeOverFile) {
std::unique_ptr<CXFA_FFDoc> pDoc(new CXFA_FFDoc(this, pDocEnvironment));
- FX_BOOL bSuccess = pDoc->OpenDoc(pStream, bTakeOverFile);
+ bool bSuccess = pDoc->OpenDoc(pStream, bTakeOverFile);
return bSuccess ? pDoc.release() : nullptr;
}
@@ -101,7 +101,7 @@ CXFA_FFDoc* CXFA_FFApp::CreateDoc(IXFA_DocEnvironment* pDocEnvironment,
return nullptr;
std::unique_ptr<CXFA_FFDoc> pDoc(new CXFA_FFDoc(this, pDocEnvironment));
- FX_BOOL bSuccess = pDoc->OpenDoc(pPDFDoc);
+ bool bSuccess = pDoc->OpenDoc(pPDFDoc);
return bSuccess ? pDoc.release() : nullptr;
}
@@ -149,5 +149,5 @@ IFWL_AdapterTimerMgr* CXFA_FFApp::GetTimerMgr() const {
}
void CXFA_FFApp::ClearEventTargets() {
- m_pFWLApp->GetNoteDriver()->ClearEventTargets(FALSE);
+ m_pFWLApp->GetNoteDriver()->ClearEventTargets(false);
}
diff --git a/xfa/fxfa/app/xfa_ffbarcode.cpp b/xfa/fxfa/app/xfa_ffbarcode.cpp
index 181b3be80c..a971e959ca 100644
--- a/xfa/fxfa/app/xfa_ffbarcode.cpp
+++ b/xfa/fxfa/app/xfa_ffbarcode.cpp
@@ -122,7 +122,7 @@ CXFA_FFBarcode::CXFA_FFBarcode(CXFA_FFPageView* pPageView,
CXFA_FFBarcode::~CXFA_FFBarcode() {}
-FX_BOOL CXFA_FFBarcode::LoadWidget() {
+bool CXFA_FFBarcode::LoadWidget() {
CFWL_Barcode* pFWLBarcode = new CFWL_Barcode(GetFWLApp());
pFWLBarcode->Initialize();
@@ -179,7 +179,7 @@ void CXFA_FFBarcode::UpdateWidgetProperty() {
CXFA_WidgetAcc* pAcc = GetDataAcc();
int32_t intVal;
FX_CHAR charVal;
- FX_BOOL boolVal;
+ bool boolVal;
FX_FLOAT floatVal;
if (pAcc->GetBarcodeAttribute_CharEncoding(intVal)) {
pBarCodeWidget->SetCharEncoding((BC_CHAR_ENCODING)intVal);
@@ -221,28 +221,24 @@ void CXFA_FFBarcode::UpdateWidgetProperty() {
pBarcodeTypeInfo->eName == XFA_BARCODETYPE_ean8 ||
pBarcodeTypeInfo->eName == XFA_BARCODETYPE_ean13 ||
pBarcodeTypeInfo->eName == XFA_BARCODETYPE_upcA) {
- pBarCodeWidget->SetPrintChecksum(TRUE);
+ pBarCodeWidget->SetPrintChecksum(true);
}
}
-FX_BOOL CXFA_FFBarcode::OnLButtonDown(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFBarcode::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget;
if (!pBarCodeWidget || pBarCodeWidget->IsProtectedType()) {
- return FALSE;
+ return false;
}
if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) {
- return FALSE;
+ return false;
}
return CXFA_FFTextEdit::OnLButtonDown(dwFlags, fx, fy);
}
-FX_BOOL CXFA_FFBarcode::OnRButtonDown(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFBarcode::OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget;
if (!pBarCodeWidget || pBarCodeWidget->IsProtectedType()) {
- return FALSE;
+ return false;
}
return CXFA_FFTextEdit::OnRButtonDown(dwFlags, fx, fy);
}
diff --git a/xfa/fxfa/app/xfa_ffbarcode.h b/xfa/fxfa/app/xfa_ffbarcode.h
index 5d0484a4bd..d2b5df3517 100644
--- a/xfa/fxfa/app/xfa_ffbarcode.h
+++ b/xfa/fxfa/app/xfa_ffbarcode.h
@@ -17,13 +17,13 @@ class CXFA_FFBarcode : public CXFA_FFTextEdit {
~CXFA_FFBarcode() override;
// CXFA_FFTextEdit
- FX_BOOL LoadWidget() override;
+ bool LoadWidget() override;
void RenderWidget(CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
uint32_t dwStatus) override;
void UpdateWidgetProperty() override;
- FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
};
enum XFA_BARCODETYPEENUM {
diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
index 9365ccf0a4..391d76ca49 100644
--- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
@@ -26,7 +26,7 @@ CXFA_FFCheckButton::CXFA_FFCheckButton(CXFA_FFPageView* pPageView,
CXFA_FFCheckButton::~CXFA_FFCheckButton() {}
-FX_BOOL CXFA_FFCheckButton::LoadWidget() {
+bool CXFA_FFCheckButton::LoadWidget() {
CFWL_CheckBox* pCheckBox = new CFWL_CheckBox(GetFWLApp());
pCheckBox->Initialize();
m_pNormalWidget = pCheckBox;
@@ -88,7 +88,7 @@ void CXFA_FFCheckButton::UpdateWidgetProperty() {
pCheckBox->ModifyStylesEx(
dwStyleEx, FWL_STYLEEXT_CKB_SignShapeMask | FWL_STYLEEXT_CKB_3State);
}
-FX_BOOL CXFA_FFCheckButton::PerformLayout() {
+bool CXFA_FFCheckButton::PerformLayout() {
CXFA_FFWidget::PerformLayout();
FX_FLOAT fCheckSize = m_pDataAcc->GetCheckButtonSize();
CXFA_Margin mgWidget = m_pDataAcc->GetMargin();
@@ -180,7 +180,7 @@ FX_BOOL CXFA_FFCheckButton::PerformLayout() {
if (m_pNormalWidget) {
m_pNormalWidget->Update();
}
- return TRUE;
+ return true;
}
void CXFA_FFCheckButton::CapLeftRightPlacement(CXFA_Margin mgCap) {
XFA_RectWidthoutMargin(m_rtCaption, mgCap);
@@ -241,13 +241,13 @@ void CXFA_FFCheckButton::RenderWidget(CFX_Graphics* pGS,
GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(),
pGS, &mt);
}
-FX_BOOL CXFA_FFCheckButton::OnLButtonUp(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFCheckButton::OnLButtonUp(uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
if (!m_pNormalWidget || !IsButtonDown())
- return FALSE;
+ return false;
- SetButtonDown(FALSE);
+ SetButtonDown(false);
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::LeftButtonUp;
ms.m_dwFlags = dwFlags;
@@ -256,7 +256,7 @@ FX_BOOL CXFA_FFCheckButton::OnLButtonUp(uint32_t dwFlags,
FWLToClient(ms.m_fx, ms.m_fy);
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
XFA_CHECKSTATE CXFA_FFCheckButton::FWLState2XFAState() {
@@ -268,32 +268,32 @@ XFA_CHECKSTATE CXFA_FFCheckButton::FWLState2XFAState() {
return XFA_CHECKSTATE_Off;
}
-FX_BOOL CXFA_FFCheckButton::CommitData() {
+bool CXFA_FFCheckButton::CommitData() {
XFA_CHECKSTATE eCheckState = FWLState2XFAState();
m_pDataAcc->SetCheckState(eCheckState, true);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFCheckButton::IsDataChanged() {
+bool CXFA_FFCheckButton::IsDataChanged() {
XFA_CHECKSTATE eCheckState = FWLState2XFAState();
return m_pDataAcc->GetCheckState() != eCheckState;
}
void CXFA_FFCheckButton::SetFWLCheckState(XFA_CHECKSTATE eCheckState) {
if (eCheckState == XFA_CHECKSTATE_Neutral) {
- m_pNormalWidget->SetStates(FWL_STATE_CKB_Neutral, TRUE);
+ m_pNormalWidget->SetStates(FWL_STATE_CKB_Neutral, true);
} else {
m_pNormalWidget->SetStates(FWL_STATE_CKB_Checked,
eCheckState == XFA_CHECKSTATE_On);
}
}
-FX_BOOL CXFA_FFCheckButton::UpdateFWLData() {
+bool CXFA_FFCheckButton::UpdateFWLData() {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
XFA_CHECKSTATE eState = m_pDataAcc->GetCheckState();
SetFWLCheckState(eState);
m_pNormalWidget->Update();
- return TRUE;
+ return true;
}
void CXFA_FFCheckButton::OnProcessMessage(CFWL_Message* pMessage) {
diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.h b/xfa/fxfa/app/xfa_ffcheckbutton.h
index 0c2cb755ac..dcd68935af 100644
--- a/xfa/fxfa/app/xfa_ffcheckbutton.h
+++ b/xfa/fxfa/app/xfa_ffcheckbutton.h
@@ -20,11 +20,11 @@ class CXFA_FFCheckButton : public CXFA_FFField {
CFX_Matrix* pMatrix,
uint32_t dwStatus) override;
- FX_BOOL LoadWidget() override;
- FX_BOOL PerformLayout() override;
- FX_BOOL UpdateFWLData() override;
+ bool LoadWidget() override;
+ bool PerformLayout() override;
+ bool UpdateFWLData() override;
void UpdateWidgetProperty() override;
- FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
void OnProcessMessage(CFWL_Message* pMessage) override;
void OnProcessEvent(CFWL_Event* pEvent) override;
void OnDrawWidget(CFX_Graphics* pGraphics,
@@ -33,8 +33,8 @@ class CXFA_FFCheckButton : public CXFA_FFField {
void SetFWLCheckState(XFA_CHECKSTATE eCheckState);
protected:
- FX_BOOL CommitData() override;
- FX_BOOL IsDataChanged() override;
+ bool CommitData() override;
+ bool IsDataChanged() override;
void CapLeftRightPlacement(CXFA_Margin mgCap);
void AddUIMargin(int32_t iCapPlacement);
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp
index 1575889815..7a20730410 100644
--- a/xfa/fxfa/app/xfa_ffchoicelist.cpp
+++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp
@@ -31,7 +31,7 @@ CXFA_FFListBox::~CXFA_FFListBox() {
}
}
-FX_BOOL CXFA_FFListBox::LoadWidget() {
+bool CXFA_FFListBox::LoadWidget() {
CFWL_ListBox* pListBox = new CFWL_ListBox(GetFWLApp());
pListBox->Initialize();
pListBox->ModifyStyles(FWL_WGTSTYLE_VScroll | FWL_WGTSTYLE_NoBackground,
@@ -48,7 +48,7 @@ FX_BOOL CXFA_FFListBox::LoadWidget() {
m_pNormalWidget->LockUpdate();
CFX_WideStringArray wsLabelArray;
- m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE);
+ m_pDataAcc->GetChoiceListItems(wsLabelArray, false);
int32_t iItems = wsLabelArray.GetSize();
for (int32_t i = 0; i < iItems; i++) {
pListBox->AddString(wsLabelArray[i].AsStringC());
@@ -64,44 +64,44 @@ FX_BOOL CXFA_FFListBox::LoadWidget() {
int32_t iSelCount = iSelArray.GetSize();
for (int32_t j = 0; j < iSelCount; j++) {
IFWL_ListItem* item = pListBox->GetItem(iSelArray[j]);
- pListBox->SetSelItem(item, TRUE);
+ pListBox->SetSelItem(item, true);
}
m_pNormalWidget->UnlockUpdate();
return CXFA_FFField::LoadWidget();
}
-FX_BOOL CXFA_FFListBox::OnKillFocus(CXFA_FFWidget* pNewFocus) {
+bool CXFA_FFListBox::OnKillFocus(CXFA_FFWidget* pNewFocus) {
if (!ProcessCommittedData())
UpdateFWLData();
CXFA_FFField::OnKillFocus(pNewFocus);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFListBox::CommitData() {
+bool CXFA_FFListBox::CommitData() {
CFWL_ListBox* pListBox = static_cast<CFWL_ListBox*>(m_pNormalWidget);
int32_t iSels = pListBox->CountSelItems();
CFX_Int32Array iSelArray;
for (int32_t i = 0; i < iSels; ++i)
iSelArray.Add(pListBox->GetSelIndex(i));
- m_pDataAcc->SetSelectedItems(iSelArray, true, FALSE, TRUE);
- return TRUE;
+ m_pDataAcc->SetSelectedItems(iSelArray, true, false, true);
+ return true;
}
-FX_BOOL CXFA_FFListBox::IsDataChanged() {
+bool CXFA_FFListBox::IsDataChanged() {
CFX_Int32Array iSelArray;
m_pDataAcc->GetSelectedItems(iSelArray);
int32_t iOldSels = iSelArray.GetSize();
CFWL_ListBox* pListBox = (CFWL_ListBox*)m_pNormalWidget;
int32_t iSels = pListBox->CountSelItems();
if (iOldSels != iSels)
- return TRUE;
+ return true;
for (int32_t i = 0; i < iSels; ++i) {
IFWL_ListItem* hlistItem = pListBox->GetItem(iSelArray[i]);
if (!(pListBox->GetItemStates(hlistItem) & FWL_ITEMSTATE_LTB_Selected))
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
uint32_t CXFA_FFListBox::GetAlignment() {
@@ -128,9 +128,9 @@ uint32_t CXFA_FFListBox::GetAlignment() {
}
return dwExtendedStyle;
}
-FX_BOOL CXFA_FFListBox::UpdateFWLData() {
+bool CXFA_FFListBox::UpdateFWLData() {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
CFWL_ListBox* pListBox = ((CFWL_ListBox*)m_pNormalWidget);
CFX_ArrayTemplate<IFWL_ListItem*> selItemArray;
@@ -141,12 +141,12 @@ FX_BOOL CXFA_FFListBox::UpdateFWLData() {
IFWL_ListItem* lpItemSel = pListBox->GetSelItem(iSelArray[j]);
selItemArray.Add(lpItemSel);
}
- pListBox->SetSelItem(pListBox->GetSelItem(-1), FALSE);
+ pListBox->SetSelItem(pListBox->GetSelItem(-1), false);
for (int32_t i = 0; i < iSelCount; i++) {
- ((CFWL_ListBox*)m_pNormalWidget)->SetSelItem(selItemArray[i], TRUE);
+ ((CFWL_ListBox*)m_pNormalWidget)->SetSelItem(selItemArray[i], true);
}
m_pNormalWidget->Update();
- return TRUE;
+ return true;
}
void CXFA_FFListBox::OnSelectChanged(IFWL_Widget* pWidget,
const CFX_Int32Array& arrSels) {
@@ -161,7 +161,7 @@ void CXFA_FFListBox::OnSelectChanged(IFWL_Widget* pWidget,
}
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam);
}
-void CXFA_FFListBox::SetItemState(int32_t nIndex, FX_BOOL bSelected) {
+void CXFA_FFListBox::SetItemState(int32_t nIndex, bool bSelected) {
IFWL_ListItem* item = ((CFWL_ListBox*)m_pNormalWidget)->GetSelItem(nIndex);
((CFWL_ListBox*)m_pNormalWidget)->SetSelItem(item, bSelected);
m_pNormalWidget->Update();
@@ -213,26 +213,26 @@ CXFA_FFComboBox::CXFA_FFComboBox(CXFA_FFPageView* pPageView,
CXFA_FFComboBox::~CXFA_FFComboBox() {}
-FX_BOOL CXFA_FFComboBox::GetBBox(CFX_RectF& rtBox,
- uint32_t dwStatus,
- FX_BOOL bDrawFocus) {
+bool CXFA_FFComboBox::GetBBox(CFX_RectF& rtBox,
+ uint32_t dwStatus,
+ bool bDrawFocus) {
if (bDrawFocus)
- return FALSE;
+ return false;
return CXFA_FFWidget::GetBBox(rtBox, dwStatus);
}
-FX_BOOL CXFA_FFComboBox::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
+bool CXFA_FFComboBox::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
CFX_RectF rtWidget;
((CFWL_ComboBox*)m_pNormalWidget)->GetBBox(rtWidget);
if (rtWidget.Contains(fx, fy)) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_FFComboBox::LoadWidget() {
+bool CXFA_FFComboBox::LoadWidget() {
CFWL_ComboBox* pComboBox = new CFWL_ComboBox(GetFWLApp());
pComboBox->Initialize();
m_pNormalWidget = (CFWL_Widget*)pComboBox;
@@ -247,7 +247,7 @@ FX_BOOL CXFA_FFComboBox::LoadWidget() {
m_pNormalWidget->LockUpdate();
CFX_WideStringArray wsLabelArray;
- m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE);
+ m_pDataAcc->GetChoiceListItems(wsLabelArray, false);
int32_t iItems = wsLabelArray.GetSize();
for (int32_t i = 0; i < iItems; i++) {
pComboBox->AddString(wsLabelArray[i].AsStringC());
@@ -291,30 +291,28 @@ void CXFA_FFComboBox::UpdateWidgetProperty() {
}
pComboBox->EditModifyStylesEx(dwEditStyles, 0xFFFFFFFF);
}
-FX_BOOL CXFA_FFComboBox::OnRButtonUp(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFComboBox::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
if (!CXFA_FFField::OnRButtonUp(dwFlags, fx, fy))
- return FALSE;
+ return false;
GetDoc()->GetDocEnvironment()->PopupMenu(this, CFX_PointF(fx, fy));
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFComboBox::OnKillFocus(CXFA_FFWidget* pNewWidget) {
- FX_BOOL flag = ProcessCommittedData();
+bool CXFA_FFComboBox::OnKillFocus(CXFA_FFWidget* pNewWidget) {
+ bool flag = ProcessCommittedData();
if (!flag) {
UpdateFWLData();
}
CXFA_FFField::OnKillFocus(pNewWidget);
- return TRUE;
+ return true;
}
void CXFA_FFComboBox::OpenDropDownList() {
- ((CFWL_ComboBox*)m_pNormalWidget)->OpenDropDownList(TRUE);
+ ((CFWL_ComboBox*)m_pNormalWidget)->OpenDropDownList(true);
}
-FX_BOOL CXFA_FFComboBox::CommitData() {
+bool CXFA_FFComboBox::CommitData() {
return m_pDataAcc->SetValue(m_wsNewValue, XFA_VALUEPICTURE_Raw);
}
-FX_BOOL CXFA_FFComboBox::IsDataChanged() {
+bool CXFA_FFComboBox::IsDataChanged() {
CFWL_ComboBox* pFWLcombobox = ((CFWL_ComboBox*)m_pNormalWidget);
CFX_WideString wsText;
pFWLcombobox->GetEditText(wsText);
@@ -323,16 +321,16 @@ FX_BOOL CXFA_FFComboBox::IsDataChanged() {
CFX_WideString wsSel;
pFWLcombobox->GetTextByIndex(iCursel, wsSel);
if (wsSel == wsText) {
- m_pDataAcc->GetChoiceListItem(wsText, iCursel, TRUE);
+ m_pDataAcc->GetChoiceListItem(wsText, iCursel, true);
}
}
CFX_WideString wsOldValue;
m_pDataAcc->GetValue(wsOldValue, XFA_VALUEPICTURE_Raw);
if (wsOldValue != wsText) {
m_wsNewValue = wsText;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CXFA_FFComboBox::FWLEventSelChange(CXFA_EventParam* pParam) {
pParam->m_eType = XFA_EVENT_Change;
@@ -379,9 +377,9 @@ uint32_t CXFA_FFComboBox::GetAlignment() {
}
return dwExtendedStyle;
}
-FX_BOOL CXFA_FFComboBox::UpdateFWLData() {
+bool CXFA_FFComboBox::UpdateFWLData() {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
CFX_Int32Array iSelArray;
m_pDataAcc->GetSelectedItems(iSelArray);
@@ -395,62 +393,62 @@ FX_BOOL CXFA_FFComboBox::UpdateFWLData() {
((CFWL_ComboBox*)m_pNormalWidget)->SetEditText(wsText);
}
m_pNormalWidget->Update();
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFComboBox::CanUndo() {
+bool CXFA_FFComboBox::CanUndo() {
return m_pDataAcc->IsChoiceListAllowTextEntry() &&
((CFWL_ComboBox*)m_pNormalWidget)->EditCanUndo();
}
-FX_BOOL CXFA_FFComboBox::CanRedo() {
+bool CXFA_FFComboBox::CanRedo() {
return m_pDataAcc->IsChoiceListAllowTextEntry() &&
((CFWL_ComboBox*)m_pNormalWidget)->EditCanRedo();
}
-FX_BOOL CXFA_FFComboBox::Undo() {
+bool CXFA_FFComboBox::Undo() {
return m_pDataAcc->IsChoiceListAllowTextEntry() &&
((CFWL_ComboBox*)m_pNormalWidget)->EditUndo();
}
-FX_BOOL CXFA_FFComboBox::Redo() {
+bool CXFA_FFComboBox::Redo() {
return m_pDataAcc->IsChoiceListAllowTextEntry() &&
((CFWL_ComboBox*)m_pNormalWidget)->EditRedo();
}
-FX_BOOL CXFA_FFComboBox::CanCopy() {
+bool CXFA_FFComboBox::CanCopy() {
return ((CFWL_ComboBox*)m_pNormalWidget)->EditCanCopy();
}
-FX_BOOL CXFA_FFComboBox::CanCut() {
+bool CXFA_FFComboBox::CanCut() {
if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) {
- return FALSE;
+ return false;
}
return m_pDataAcc->IsChoiceListAllowTextEntry() &&
((CFWL_ComboBox*)m_pNormalWidget)->EditCanCut();
}
-FX_BOOL CXFA_FFComboBox::CanPaste() {
+bool CXFA_FFComboBox::CanPaste() {
return m_pDataAcc->IsChoiceListAllowTextEntry() &&
(m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open);
}
-FX_BOOL CXFA_FFComboBox::CanSelectAll() {
+bool CXFA_FFComboBox::CanSelectAll() {
return ((CFWL_ComboBox*)m_pNormalWidget)->EditCanSelectAll();
}
-FX_BOOL CXFA_FFComboBox::Copy(CFX_WideString& wsCopy) {
+bool CXFA_FFComboBox::Copy(CFX_WideString& wsCopy) {
return ((CFWL_ComboBox*)m_pNormalWidget)->EditCopy(wsCopy);
}
-FX_BOOL CXFA_FFComboBox::Cut(CFX_WideString& wsCut) {
+bool CXFA_FFComboBox::Cut(CFX_WideString& wsCut) {
return m_pDataAcc->IsChoiceListAllowTextEntry() &&
((CFWL_ComboBox*)m_pNormalWidget)->EditCut(wsCut);
}
-FX_BOOL CXFA_FFComboBox::Paste(const CFX_WideString& wsPaste) {
+bool CXFA_FFComboBox::Paste(const CFX_WideString& wsPaste) {
return m_pDataAcc->IsChoiceListAllowTextEntry() &&
((CFWL_ComboBox*)m_pNormalWidget)->EditPaste(wsPaste);
}
-FX_BOOL CXFA_FFComboBox::SelectAll() {
+bool CXFA_FFComboBox::SelectAll() {
return ((CFWL_ComboBox*)m_pNormalWidget)->EditSelectAll();
}
-FX_BOOL CXFA_FFComboBox::Delete() {
+bool CXFA_FFComboBox::Delete() {
return ((CFWL_ComboBox*)m_pNormalWidget)->EditDelete();
}
-FX_BOOL CXFA_FFComboBox::DeSelect() {
+bool CXFA_FFComboBox::DeSelect() {
return ((CFWL_ComboBox*)m_pNormalWidget)->EditDeSelect();
}
-void CXFA_FFComboBox::SetItemState(int32_t nIndex, FX_BOOL bSelected) {
+void CXFA_FFComboBox::SetItemState(int32_t nIndex, bool bSelected) {
if (bSelected) {
((CFWL_ComboBox*)m_pNormalWidget)->SetCurSel(nIndex);
} else {
@@ -483,7 +481,7 @@ void CXFA_FFComboBox::OnTextChanged(IFWL_Widget* pWidget,
}
void CXFA_FFComboBox::OnSelectChanged(IFWL_Widget* pWidget,
const CFX_Int32Array& arrSels,
- FX_BOOL bLButtonUp) {
+ bool bLButtonUp) {
CXFA_EventParam eParam;
m_pDataAcc->GetValue(eParam.m_wsPrevText, XFA_VALUEPICTURE_Raw);
FWLEventSelChange(&eParam);
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.h b/xfa/fxfa/app/xfa_ffchoicelist.h
index 712959d56c..9ce6cccd11 100644
--- a/xfa/fxfa/app/xfa_ffchoicelist.h
+++ b/xfa/fxfa/app/xfa_ffchoicelist.h
@@ -16,22 +16,22 @@ class CXFA_FFListBox : public CXFA_FFField {
~CXFA_FFListBox() override;
// CXFA_FFField
- FX_BOOL LoadWidget() override;
- FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override;
+ bool LoadWidget() override;
+ bool OnKillFocus(CXFA_FFWidget* pNewWidget) override;
void OnProcessMessage(CFWL_Message* pMessage) override;
void OnProcessEvent(CFWL_Event* pEvent) override;
void OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr) override;
void OnSelectChanged(IFWL_Widget* pWidget, const CFX_Int32Array& arrSels);
- void SetItemState(int32_t nIndex, FX_BOOL bSelected);
+ void SetItemState(int32_t nIndex, bool bSelected);
void InsertItem(const CFX_WideStringC& wsLabel, int32_t nIndex = -1);
void DeleteItem(int32_t nIndex);
protected:
- FX_BOOL CommitData() override;
- FX_BOOL UpdateFWLData() override;
- FX_BOOL IsDataChanged() override;
+ bool CommitData() override;
+ bool UpdateFWLData() override;
+ bool IsDataChanged() override;
uint32_t GetAlignment();
@@ -44,28 +44,28 @@ class CXFA_FFComboBox : public CXFA_FFField {
~CXFA_FFComboBox() override;
// CXFA_FFField
- FX_BOOL GetBBox(CFX_RectF& rtBox,
- uint32_t dwStatus,
- FX_BOOL bDrawFocus = FALSE) override;
- FX_BOOL LoadWidget() override;
+ bool GetBBox(CFX_RectF& rtBox,
+ uint32_t dwStatus,
+ bool bDrawFocus = false) override;
+ bool LoadWidget() override;
void UpdateWidgetProperty() override;
- FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override;
- FX_BOOL CanUndo() override;
- FX_BOOL CanRedo() override;
- FX_BOOL Undo() override;
- FX_BOOL Redo() override;
-
- FX_BOOL CanCopy() override;
- FX_BOOL CanCut() override;
- FX_BOOL CanPaste() override;
- FX_BOOL CanSelectAll() override;
- FX_BOOL Copy(CFX_WideString& wsCopy) override;
- FX_BOOL Cut(CFX_WideString& wsCut) override;
- FX_BOOL Paste(const CFX_WideString& wsPaste) override;
- FX_BOOL SelectAll() override;
- FX_BOOL Delete() override;
- FX_BOOL DeSelect() override;
+ bool OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnKillFocus(CXFA_FFWidget* pNewWidget) override;
+ bool CanUndo() override;
+ bool CanRedo() override;
+ bool Undo() override;
+ bool Redo() override;
+
+ bool CanCopy() override;
+ bool CanCut() override;
+ bool CanPaste() override;
+ bool CanSelectAll() override;
+ bool Copy(CFX_WideString& wsCopy) override;
+ bool Cut(CFX_WideString& wsCut) override;
+ bool Paste(const CFX_WideString& wsPaste) override;
+ bool SelectAll() override;
+ bool Delete() override;
+ bool DeSelect() override;
// IFWL_WidgetDelegate
void OnProcessMessage(CFWL_Message* pMessage) override;
@@ -78,19 +78,19 @@ class CXFA_FFComboBox : public CXFA_FFField {
void OnTextChanged(IFWL_Widget* pWidget, const CFX_WideString& wsChanged);
void OnSelectChanged(IFWL_Widget* pWidget,
const CFX_Int32Array& arrSels,
- FX_BOOL bLButtonUp);
+ bool bLButtonUp);
void OnPreOpen(IFWL_Widget* pWidget);
void OnPostOpen(IFWL_Widget* pWidget);
- void SetItemState(int32_t nIndex, FX_BOOL bSelected);
+ void SetItemState(int32_t nIndex, bool bSelected);
void InsertItem(const CFX_WideStringC& wsLabel, int32_t nIndex = -1);
void DeleteItem(int32_t nIndex);
protected:
// CXFA_FFField
- FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL CommitData() override;
- FX_BOOL UpdateFWLData() override;
- FX_BOOL IsDataChanged() override;
+ bool PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override;
+ bool CommitData() override;
+ bool UpdateFWLData() override;
+ bool IsDataChanged() override;
uint32_t GetAlignment();
void FWLEventSelChange(CXFA_EventParam* pParam);
diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp
index cfb5e9fc47..5439b1fe47 100644
--- a/xfa/fxfa/app/xfa_ffdoc.cpp
+++ b/xfa/fxfa/app/xfa_ffdoc.cpp
@@ -155,7 +155,7 @@ CXFA_FFDoc::CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocEnvironment* pDocEnvironment)
m_pNotify(nullptr),
m_pPDFDoc(nullptr),
m_dwDocType(XFA_DOCTYPE_Static),
- m_bOwnStream(TRUE) {}
+ m_bOwnStream(true) {}
CXFA_FFDoc::~CXFA_FFDoc() {
CloseDoc();
@@ -172,9 +172,9 @@ int32_t CXFA_FFDoc::StartLoad() {
return iStatus;
}
-FX_BOOL XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement,
- uint8_t*& pByteBuffer,
- int32_t& iBufferSize) {
+bool XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement,
+ uint8_t*& pByteBuffer,
+ int32_t& iBufferSize) {
CFDE_XMLElement* pDocumentElement = nullptr;
for (CFDE_XMLNode* pXMLNode =
pPDFElement->GetNodeItem(CFDE_XMLNode::FirstChild);
@@ -190,7 +190,7 @@ FX_BOOL XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement,
}
}
if (!pDocumentElement) {
- return FALSE;
+ return false;
}
CFDE_XMLElement* pChunkElement = nullptr;
for (CFDE_XMLNode* pXMLNode =
@@ -207,7 +207,7 @@ FX_BOOL XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement,
}
}
if (!pChunkElement) {
- return FALSE;
+ return false;
}
CFX_WideString wsPDFContent;
pChunkElement->GetTextData(wsPDFContent);
@@ -216,7 +216,7 @@ FX_BOOL XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement,
pByteBuffer = FX_Alloc(uint8_t, iBufferSize + 1);
pByteBuffer[iBufferSize] = '0'; // FIXME: I bet this is wrong.
Base64DecodeW(wsPDFContent.c_str(), wsPDFContent.GetLength(), pByteBuffer);
- return TRUE;
+ return true;
}
void XFA_XPDPacket_MergeRootNode(CXFA_Node* pOriginRoot, CXFA_Node* pNewRoot) {
CXFA_Node* pChildNode = pNewRoot->GetNodeItem(XFA_NODEITEM_FirstChild);
@@ -290,27 +290,26 @@ CXFA_FFDocView* CXFA_FFDoc::GetDocView() {
return it != m_TypeToDocViewMap.end() ? it->second.get() : nullptr;
}
-FX_BOOL CXFA_FFDoc::OpenDoc(IFX_SeekableReadStream* pStream,
- FX_BOOL bTakeOverFile) {
+bool CXFA_FFDoc::OpenDoc(IFX_SeekableReadStream* pStream, bool bTakeOverFile) {
m_bOwnStream = bTakeOverFile;
m_pStream = pStream;
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) {
+bool CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) {
if (!pPDFDoc)
- return FALSE;
+ return false;
CPDF_Dictionary* pRoot = pPDFDoc->GetRoot();
if (!pRoot)
- return FALSE;
+ return false;
CPDF_Dictionary* pAcroForm = pRoot->GetDictFor("AcroForm");
if (!pAcroForm)
- return FALSE;
+ return false;
CPDF_Object* pElementXFA = pAcroForm->GetDirectObjectFor("XFA");
if (!pElementXFA)
- return FALSE;
+ return false;
std::vector<CPDF_Stream*> xfaStreams;
if (pElementXFA->IsArray()) {
@@ -323,7 +322,7 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) {
xfaStreams.push_back((CPDF_Stream*)pElementXFA);
}
if (xfaStreams.empty())
- return FALSE;
+ return false;
IFX_SeekableReadStream* pFileRead = new CXFA_FileRead(xfaStreams);
m_pPDFDoc = pPDFDoc;
@@ -332,11 +331,11 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) {
m_pStream = nullptr;
}
m_pStream = pFileRead;
- m_bOwnStream = TRUE;
- return TRUE;
+ m_bOwnStream = true;
+ return true;
}
-FX_BOOL CXFA_FFDoc::CloseDoc() {
+bool CXFA_FFDoc::CloseDoc() {
for (const auto& pair : m_TypeToDocViewMap)
pair.second->RunDocClose();
@@ -360,7 +359,7 @@ FX_BOOL CXFA_FFDoc::CloseDoc() {
m_HashToDibDpiMap.clear();
m_pApp->ClearEventTargets();
- return TRUE;
+ return true;
}
void CXFA_FFDoc::SetDocType(uint32_t dwType) {
m_dwDocType = dwType;
@@ -445,7 +444,7 @@ bool CXFA_FFDoc::SavePackage(XFA_HashCode code,
pFile, pNode, 0, bsChecksum.GetLength() ? bsChecksum.c_str() : nullptr);
}
-FX_BOOL CXFA_FFDoc::ImportData(IFX_SeekableReadStream* pStream, FX_BOOL bXDP) {
+bool CXFA_FFDoc::ImportData(IFX_SeekableReadStream* pStream, bool bXDP) {
std::unique_ptr<CXFA_DataImporter> importer(
new CXFA_DataImporter(m_pDocumentParser->GetDocument()));
return importer->ImportData(pStream);
diff --git a/xfa/fxfa/app/xfa_ffdochandler.cpp b/xfa/fxfa/app/xfa_ffdochandler.cpp
index fae72cb3a1..db73531ccc 100644
--- a/xfa/fxfa/app/xfa_ffdochandler.cpp
+++ b/xfa/fxfa/app/xfa_ffdochandler.cpp
@@ -41,18 +41,18 @@ XFA_ATTRIBUTEENUM CXFA_FFDocHandler::GetRestoreState(CXFA_FFDoc* hDoc) {
return pSubForm->GetEnum(XFA_ATTRIBUTE_RestoreState);
}
-FX_BOOL CXFA_FFDocHandler::RunDocScript(CXFA_FFDoc* hDoc,
- XFA_SCRIPTTYPE eScriptType,
- const CFX_WideStringC& wsScript,
- CFXJSE_Value* pRetValue,
- CFXJSE_Value* pThisValue) {
+bool CXFA_FFDocHandler::RunDocScript(CXFA_FFDoc* hDoc,
+ XFA_SCRIPTTYPE eScriptType,
+ const CFX_WideStringC& wsScript,
+ CFXJSE_Value* pRetValue,
+ CFXJSE_Value* pThisValue) {
CXFA_Document* pXFADoc = hDoc->GetXFADoc();
if (!pXFADoc)
- return FALSE;
+ return false;
CXFA_ScriptContext* pScriptContext = pXFADoc->GetScriptContext();
if (!pScriptContext)
- return FALSE;
+ return false;
return pScriptContext->RunScript(
(XFA_SCRIPTLANGTYPE)eScriptType, wsScript, pRetValue,
diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp
index f82cc5eafb..477bd54457 100644
--- a/xfa/fxfa/app/xfa_ffdocview.cpp
+++ b/xfa/fxfa/app/xfa_ffdocview.cpp
@@ -52,9 +52,9 @@ const XFA_ATTRIBUTEENUM gs_EventActivity[] = {
};
CXFA_FFDocView::CXFA_FFDocView(CXFA_FFDoc* pDoc)
- : m_bLayoutEvent(FALSE),
+ : m_bLayoutEvent(false),
m_pListFocusWidget(nullptr),
- m_bInLayoutStatus(FALSE),
+ m_bInLayoutStatus(false),
m_pDoc(pDoc),
m_pXFADocLayout(nullptr),
m_pFocusAcc(nullptr),
@@ -69,9 +69,9 @@ CXFA_FFDocView::~CXFA_FFDocView() {
void CXFA_FFDocView::InitLayout(CXFA_Node* pNode) {
RunBindItems();
- ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Initialize, FALSE, TRUE,
+ ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Initialize, false, true,
nullptr);
- ExecEventActivityByDeepFirst(pNode, XFA_EVENT_IndexChange, FALSE, TRUE,
+ ExecEventActivityByDeepFirst(pNode, XFA_EVENT_IndexChange, false, true,
nullptr);
}
int32_t CXFA_FFDocView::StartLayout(int32_t iStartPage) {
@@ -91,7 +91,7 @@ int32_t CXFA_FFDocView::StartLayout(int32_t iStartPage) {
InitLayout(pRootItem);
InitCalculate(pRootItem);
InitValidate(pRootItem);
- ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, TRUE, TRUE, nullptr);
+ ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, true, true, nullptr);
m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_Start;
return iStatus;
}
@@ -124,16 +124,16 @@ void CXFA_FFDocView::StopLayout() {
InitLayout(pPageSetNode);
InitCalculate(pPageSetNode);
InitValidate(pPageSetNode);
- ExecEventActivityByDeepFirst(pPageSetNode, XFA_EVENT_Ready, TRUE, TRUE,
+ ExecEventActivityByDeepFirst(pPageSetNode, XFA_EVENT_Ready, true, true,
nullptr);
- ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, FALSE, TRUE,
+ ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, false, true,
nullptr);
- ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_DocReady, FALSE, TRUE,
+ ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_DocReady, false, true,
nullptr);
RunCalculateWidgets();
RunValidate();
if (RunLayout()) {
- ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, FALSE, TRUE,
+ ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, false, true,
nullptr);
}
m_CalculateAccs.RemoveAll();
@@ -181,7 +181,7 @@ void CXFA_FFDocView::UpdateDocView() {
CXFA_Node* pNode = m_NewAddedNodes[i];
InitCalculate(pNode);
InitValidate(pNode);
- ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Ready, TRUE, TRUE, nullptr);
+ ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Ready, true, true, nullptr);
}
m_NewAddedNodes.RemoveAll();
RunSubformIndexChange();
@@ -191,7 +191,7 @@ void CXFA_FFDocView::UpdateDocView() {
if (RunLayout() && m_bLayoutEvent) {
RunEventLayoutReady();
}
- m_bLayoutEvent = FALSE;
+ m_bLayoutEvent = false;
m_CalculateAccs.RemoveAll();
RunInvalidate();
UnlockUpdate();
@@ -212,11 +212,11 @@ CXFA_FFPageView* CXFA_FFDocView::GetPageView(int32_t nIndex) {
CXFA_LayoutProcessor* CXFA_FFDocView::GetXFALayout() const {
return m_pDoc->GetXFADoc()->GetDocLayout();
}
-FX_BOOL CXFA_FFDocView::ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc) {
+bool CXFA_FFDocView::ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc) {
CXFA_Node* pNode = pWidgetAcc->GetNode();
XFA_Element eType = pNode->GetElementType();
if (eType != XFA_Element::Field && eType != XFA_Element::ExclGroup) {
- return FALSE;
+ return false;
}
pWidgetAcc->ResetData();
pWidgetAcc->UpdateUIDisplay();
@@ -224,11 +224,11 @@ FX_BOOL CXFA_FFDocView::ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc) {
AddValidateWidget(pWidgetAcc);
validate.GetNode()->SetFlag(XFA_NodeFlag_NeedsInitApp, false);
}
- return TRUE;
+ return true;
}
void CXFA_FFDocView::ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc) {
- m_bLayoutEvent = TRUE;
- FX_BOOL bChanged = FALSE;
+ m_bLayoutEvent = true;
+ bool bChanged = false;
CXFA_Node* pFormNode = nullptr;
if (pWidgetAcc) {
bChanged = ResetSingleWidgetAccData(pWidgetAcc);
@@ -279,7 +279,7 @@ int32_t CXFA_FFDocView::ProcessWidgetEvent(CXFA_EventParam* pParam,
wsValidateStr = pValidateNode->GetContent();
}
}
- FX_BOOL bValidate = FALSE;
+ bool bValidate = false;
switch (pParam->m_iValidateActivities) {
case XFA_VALIDATE_preSubmit:
bValidate = wsValidateStr.Find(L"preSubmit") != -1;
@@ -308,7 +308,7 @@ int32_t CXFA_FFDocView::ProcessWidgetEvent(CXFA_EventParam* pParam,
pNode = pRootItem->GetChild(0, XFA_Element::Subform);
}
ExecEventActivityByDeepFirst(pNode, pParam->m_eType, pParam->m_bIsFormReady,
- TRUE, nullptr);
+ true, nullptr);
return XFA_EVENTERROR_Success;
}
CXFA_FFWidgetHandler* CXFA_FFDocView::GetWidgetHandler() {
@@ -335,10 +335,10 @@ void CXFA_FFDocView::KillFocus() {
m_pFocusWidget = nullptr;
m_pOldFocusWidget = nullptr;
}
-FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) {
+bool CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) {
CXFA_FFWidget* pNewFocus = hWidget;
if (m_pOldFocusWidget == pNewFocus) {
- return FALSE;
+ return false;
}
CXFA_FFWidget* pOldFocus = m_pOldFocusWidget;
m_pOldFocusWidget = pNewFocus;
@@ -357,7 +357,7 @@ FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) {
}
}
if (m_pFocusWidget == m_pOldFocusWidget) {
- return FALSE;
+ return false;
}
pNewFocus = m_pOldFocusWidget;
if (m_pListFocusWidget && pNewFocus == m_pListFocusWidget) {
@@ -365,7 +365,7 @@ FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) {
m_pFocusWidget = nullptr;
m_pListFocusWidget = nullptr;
m_pOldFocusWidget = nullptr;
- return FALSE;
+ return false;
}
if (pNewFocus && (pNewFocus->GetStatus() & XFA_WidgetStatus_Visible)) {
if (!pNewFocus->IsLoaded()) {
@@ -376,7 +376,7 @@ FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) {
m_pFocusAcc = pNewFocus ? pNewFocus->GetDataAcc() : nullptr;
m_pFocusWidget = pNewFocus;
m_pOldFocusWidget = m_pFocusWidget;
- return TRUE;
+ return true;
}
CXFA_WidgetAcc* CXFA_FFDocView::GetFocusWidgetAcc() {
return m_pFocusAcc;
@@ -437,8 +437,8 @@ static int32_t XFA_ProcessEvent(CXFA_FFDocView* pDocView,
}
int32_t CXFA_FFDocView::ExecEventActivityByDeepFirst(CXFA_Node* pFormNode,
XFA_EVENTTYPE eEventType,
- FX_BOOL bIsFormReady,
- FX_BOOL bRecursive,
+ bool bIsFormReady,
+ bool bRecursive,
CXFA_Node* pExclude) {
int32_t iRet = XFA_EVENTERROR_NotExist;
if (pFormNode == pExclude) {
@@ -535,7 +535,7 @@ void CXFA_FFDocView::LockUpdate() {
void CXFA_FFDocView::UnlockUpdate() {
m_iLock--;
}
-FX_BOOL CXFA_FFDocView::IsUpdateLocked() {
+bool CXFA_FFDocView::IsUpdateLocked() {
return m_iLock > 0;
}
void CXFA_FFDocView::ClearInvalidateList() {
@@ -564,23 +564,23 @@ void CXFA_FFDocView::RunInvalidate() {
m_mapPageInvalidate.clear();
}
-FX_BOOL CXFA_FFDocView::RunLayout() {
+bool CXFA_FFDocView::RunLayout() {
LockUpdate();
- m_bInLayoutStatus = TRUE;
+ m_bInLayoutStatus = true;
if (!m_pXFADocLayout->IncrementLayout() &&
m_pXFADocLayout->StartLayout() < 100) {
m_pXFADocLayout->DoLayout();
UnlockUpdate();
- m_bInLayoutStatus = FALSE;
+ m_bInLayoutStatus = false;
m_pDoc->GetDocEnvironment()->PageViewEvent(nullptr,
XFA_PAGEVIEWEVENT_StopLayout);
- return TRUE;
+ return true;
}
- m_bInLayoutStatus = FALSE;
+ m_bInLayoutStatus = false;
m_pDoc->GetDocEnvironment()->PageViewEvent(nullptr,
XFA_PAGEVIEWEVENT_StopLayout);
UnlockUpdate();
- return FALSE;
+ return false;
}
void CXFA_FFDocView::RunSubformIndexChange() {
int32_t iSubforms = m_IndexChangedSubforms.GetSize();
@@ -612,7 +612,7 @@ void CXFA_FFDocView::RunDocClose() {
if (!pRootItem) {
return;
}
- ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_DocClose, FALSE, TRUE,
+ ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_DocClose, false, true,
nullptr);
}
void CXFA_FFDocView::DestroyDocView() {
@@ -623,7 +623,7 @@ void CXFA_FFDocView::DestroyDocView() {
m_BindItems.RemoveAll();
m_CalculateAccs.RemoveAll();
}
-FX_BOOL CXFA_FFDocView::IsStaticNotify() {
+bool CXFA_FFDocView::IsStaticNotify() {
return m_pDoc->GetDocType() == XFA_DOCTYPE_Static;
}
void CXFA_FFDocView::AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) {
@@ -690,22 +690,22 @@ void CXFA_FFDocView::AddValidateWidget(CXFA_WidgetAcc* pWidget) {
if (m_ValidateAccs.Find(pWidget) < 0)
m_ValidateAccs.Add(pWidget);
}
-FX_BOOL CXFA_FFDocView::InitCalculate(CXFA_Node* pNode) {
- ExecEventActivityByDeepFirst(pNode, XFA_EVENT_InitCalculate, FALSE, TRUE,
+bool CXFA_FFDocView::InitCalculate(CXFA_Node* pNode) {
+ ExecEventActivityByDeepFirst(pNode, XFA_EVENT_InitCalculate, false, true,
nullptr);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFDocView::InitValidate(CXFA_Node* pNode) {
+bool CXFA_FFDocView::InitValidate(CXFA_Node* pNode) {
if (!m_pDoc->GetDocEnvironment()->IsValidationsEnabled(m_pDoc)) {
- return FALSE;
+ return false;
}
- ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Validate, FALSE, TRUE, nullptr);
+ ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Validate, false, true, nullptr);
m_ValidateAccs.RemoveAll();
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFDocView::RunValidate() {
+bool CXFA_FFDocView::RunValidate() {
if (!m_pDoc->GetDocEnvironment()->IsValidationsEnabled(m_pDoc)) {
- return FALSE;
+ return false;
}
int32_t iCounts = m_ValidateAccs.GetSize();
for (int32_t i = 0; i < iCounts; i++) {
@@ -716,18 +716,18 @@ FX_BOOL CXFA_FFDocView::RunValidate() {
pAcc->ProcessValidate();
}
m_ValidateAccs.RemoveAll();
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFDocView::RunEventLayoutReady() {
+bool CXFA_FFDocView::RunEventLayoutReady() {
CXFA_Node* pRootItem =
ToNode(m_pDoc->GetXFADoc()->GetXFAObject(XFA_HASHCODE_Form));
if (!pRootItem) {
- return FALSE;
+ return false;
}
- ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, FALSE, TRUE,
+ ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, false, true,
nullptr);
RunLayout();
- return TRUE;
+ return true;
}
void CXFA_FFDocView::RunBindItems() {
for (int32_t i = 0; i < m_BindItems.GetSize(); i++) {
@@ -849,8 +849,8 @@ CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() {
return nullptr;
}
-FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) {
- return FALSE;
+bool CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) {
+ return false;
}
void CXFA_WidgetAccIterator::SkipTree() {
diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp
index b14df7ee15..073e99786a 100644
--- a/xfa/fxfa/app/xfa_fffield.cpp
+++ b/xfa/fxfa/app/xfa_fffield.cpp
@@ -30,9 +30,9 @@ CXFA_FFField::~CXFA_FFField() {
CXFA_FFField::UnloadWidget();
}
-FX_BOOL CXFA_FFField::GetBBox(CFX_RectF& rtBox,
- uint32_t dwStatus,
- FX_BOOL bDrawFocus) {
+bool CXFA_FFField::GetBBox(CFX_RectF& rtBox,
+ uint32_t dwStatus,
+ bool bDrawFocus) {
if (!bDrawFocus)
return CXFA_FFWidget::GetBBox(rtBox, dwStatus);
@@ -44,9 +44,9 @@ FX_BOOL CXFA_FFField::GetBBox(CFX_RectF& rtBox,
CFX_Matrix mt;
GetRotateMatrix(mt);
mt.TransformRect(rtBox);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CXFA_FFField::RenderWidget(CFX_Graphics* pGS,
@@ -64,7 +64,7 @@ void CXFA_FFField::RenderWidget(CFX_Graphics* pGS,
CXFA_Border borderUI = m_pDataAcc->GetUIBorder();
DrawBorder(pGS, borderUI, m_rtUI, &mtRotate);
RenderCaption(pGS, &mtRotate);
- DrawHighlight(pGS, &mtRotate, dwStatus, FALSE);
+ DrawHighlight(pGS, &mtRotate, dwStatus, false);
CFX_RectF rtWidget;
m_pNormalWidget->GetWidgetRect(rtWidget);
CFX_Matrix mt;
@@ -76,7 +76,7 @@ void CXFA_FFField::RenderWidget(CFX_Graphics* pGS,
void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
uint32_t dwStatus,
- FX_BOOL bEllipse) {
+ bool bEllipse) {
if (m_rtUI.IsEmpty() || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
return;
}
@@ -101,7 +101,7 @@ void CXFA_FFField::DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix) {
pGS->SetStrokeColor(&cr);
FX_FLOAT DashPattern[2] = {1, 1};
pGS->SetLineDash(0.0f, DashPattern, 2);
- pGS->SetLineWidth(0, FALSE);
+ pGS->SetLineWidth(0, false);
CFX_Path path;
path.Create();
path.AddRectangle(m_rtUI.left, m_rtUI.top, m_rtUI.width, m_rtUI.height);
@@ -113,14 +113,14 @@ void CXFA_FFField::SetFWLThemeProvider() {
m_pNormalWidget->GetWidget()->SetThemeProvider(GetApp()->GetFWLTheme());
}
}
-FX_BOOL CXFA_FFField::IsLoaded() {
+bool CXFA_FFField::IsLoaded() {
return m_pNormalWidget && CXFA_FFWidget::IsLoaded();
}
-FX_BOOL CXFA_FFField::LoadWidget() {
+bool CXFA_FFField::LoadWidget() {
SetFWLThemeProvider();
m_pDataAcc->LoadCaption();
PerformLayout();
- return TRUE;
+ return true;
}
void CXFA_FFField::UnloadWidget() {
delete m_pNormalWidget;
@@ -144,7 +144,7 @@ void CXFA_FFField::SetEditScrollOffset() {
((CFWL_Edit*)m_pNormalWidget)->SetScrollOffset(fScrollOffset);
}
}
-FX_BOOL CXFA_FFField::PerformLayout() {
+bool CXFA_FFField::PerformLayout() {
CXFA_FFWidget::PerformLayout();
CapPlacement();
LayoutCaption();
@@ -153,7 +153,7 @@ FX_BOOL CXFA_FFField::PerformLayout() {
if (m_pNormalWidget) {
m_pNormalWidget->Update();
}
- return TRUE;
+ return true;
}
void CXFA_FFField::CapPlacement() {
CFX_RectF rtWidget;
@@ -343,26 +343,26 @@ void CXFA_FFField::SetFWLRect() {
}
m_pNormalWidget->SetWidgetRect(rtUi);
}
-FX_BOOL CXFA_FFField::OnMouseEnter() {
+bool CXFA_FFField::OnMouseEnter() {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::Enter;
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
ms.m_pSrcTarget = nullptr;
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnMouseExit() {
+bool CXFA_FFField::OnMouseExit() {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::Leave;
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) {
if (!m_pNormalWidget) {
@@ -373,20 +373,18 @@ void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) {
fx -= rtWidget.left;
fy -= rtWidget.top;
}
-FX_BOOL CXFA_FFField::OnLButtonDown(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFField::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open ||
!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
- return FALSE;
+ return false;
}
if (!PtInActiveRect(fx, fy)) {
- return FALSE;
+ return false;
}
- SetButtonDown(TRUE);
+ SetButtonDown(true);
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown;
ms.m_dwFlags = dwFlags;
@@ -395,16 +393,16 @@ FX_BOOL CXFA_FFField::OnLButtonDown(uint32_t dwFlags,
FWLToClient(ms.m_fx, ms.m_fy);
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+bool CXFA_FFField::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
if (!IsButtonDown()) {
- return FALSE;
+ return false;
}
- SetButtonDown(FALSE);
+ SetButtonDown(false);
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::LeftButtonUp;
ms.m_dwFlags = dwFlags;
@@ -413,13 +411,11 @@ FX_BOOL CXFA_FFField::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
FWLToClient(ms.m_fx, ms.m_fy);
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnLButtonDblClk(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFField::OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::LeftButtonDblClk;
@@ -429,11 +425,11 @@ FX_BOOL CXFA_FFField::OnLButtonDblClk(uint32_t dwFlags,
FWLToClient(ms.m_fx, ms.m_fy);
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+bool CXFA_FFField::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::Move;
@@ -443,14 +439,14 @@ FX_BOOL CXFA_FFField::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
FWLToClient(ms.m_fx, ms.m_fy);
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnMouseWheel(uint32_t dwFlags,
- int16_t zDelta,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFField::OnMouseWheel(uint32_t dwFlags,
+ int16_t zDelta,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
CFWL_MsgMouseWheel ms;
ms.m_dwFlags = dwFlags;
@@ -461,22 +457,20 @@ FX_BOOL CXFA_FFField::OnMouseWheel(uint32_t dwFlags,
ms.m_fDeltaY = 0;
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnRButtonDown(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFField::OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open ||
!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
- return FALSE;
+ return false;
}
if (!PtInActiveRect(fx, fy)) {
- return FALSE;
+ return false;
}
- SetButtonDown(TRUE);
+ SetButtonDown(true);
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::RightButtonDown;
ms.m_dwFlags = dwFlags;
@@ -485,16 +479,16 @@ FX_BOOL CXFA_FFField::OnRButtonDown(uint32_t dwFlags,
FWLToClient(ms.m_fx, ms.m_fy);
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+bool CXFA_FFField::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
if (!IsButtonDown()) {
- return FALSE;
+ return false;
}
- SetButtonDown(FALSE);
+ SetButtonDown(false);
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::RightButtonUp;
ms.m_dwFlags = dwFlags;
@@ -503,13 +497,11 @@ FX_BOOL CXFA_FFField::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
FWLToClient(ms.m_fx, ms.m_fy);
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnRButtonDblClk(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFField::OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::RightButtonDblClk;
@@ -519,13 +511,13 @@ FX_BOOL CXFA_FFField::OnRButtonDblClk(uint32_t dwFlags,
FWLToClient(ms.m_fx, ms.m_fy);
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) {
+bool CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) {
CXFA_FFWidget::OnSetFocus(pOldWidget);
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
CFWL_MsgSetFocus ms;
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
@@ -533,9 +525,9 @@ FX_BOOL CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) {
TranslateFWLMessage(&ms);
m_dwStatus |= XFA_WidgetStatus_Focused;
AddInvalidateRect();
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) {
+bool CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) {
if (!m_pNormalWidget) {
return CXFA_FFWidget::OnKillFocus(pNewWidget);
}
@@ -546,11 +538,11 @@ FX_BOOL CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) {
m_dwStatus &= ~XFA_WidgetStatus_Focused;
AddInvalidateRect();
CXFA_FFWidget::OnKillFocus(pNewWidget);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) {
+bool CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) {
if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
- return FALSE;
+ return false;
}
CFWL_MsgKey ms;
ms.m_dwCmd = FWL_KeyCommand::KeyDown;
@@ -559,11 +551,11 @@ FX_BOOL CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) {
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
ms.m_pSrcTarget = nullptr;
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) {
+bool CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) {
if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
- return FALSE;
+ return false;
}
CFWL_MsgKey ms;
ms.m_dwCmd = FWL_KeyCommand::KeyUp;
@@ -572,20 +564,20 @@ FX_BOOL CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) {
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
ms.m_pSrcTarget = nullptr;
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) {
+bool CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) {
if (!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
- return FALSE;
+ return false;
}
if (dwChar == FWL_VKEY_Tab) {
- return TRUE;
+ return true;
}
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) {
- return FALSE;
+ return false;
}
CFWL_MsgKey ms;
ms.m_dwCmd = FWL_KeyCommand::Char;
@@ -594,7 +586,7 @@ FX_BOOL CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) {
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
ms.m_pSrcTarget = nullptr;
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
FWL_WidgetHit CXFA_FFField::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) {
if (m_pNormalWidget) {
@@ -611,19 +603,19 @@ FWL_WidgetHit CXFA_FFField::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) {
return FWL_WidgetHit::Titlebar;
return FWL_WidgetHit::Border;
}
-FX_BOOL CXFA_FFField::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) {
- return TRUE;
+bool CXFA_FFField::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) {
+ return true;
}
-FX_BOOL CXFA_FFField::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
+bool CXFA_FFField::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
CFX_RectF rtWidget;
m_pNormalWidget->GetWidgetRect(rtWidget);
if (rtWidget.Contains(fx, fy)) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CXFA_FFField::LayoutCaption() {
CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout();
@@ -660,22 +652,22 @@ void CXFA_FFField::RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix) {
pCapTextLayout->DrawString(pRenderDevice, mt, rtClip);
}
}
-FX_BOOL CXFA_FFField::ProcessCommittedData() {
+bool CXFA_FFField::ProcessCommittedData() {
if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) {
- return FALSE;
+ return false;
}
if (!IsDataChanged()) {
- return FALSE;
+ return false;
}
if (CalculateOverride() != 1) {
- return FALSE;
+ return false;
}
if (!CommitData()) {
- return FALSE;
+ return false;
}
m_pDocView->SetChangeMark();
m_pDocView->AddValidateWidget(m_pDataAcc);
- return TRUE;
+ return true;
}
int32_t CXFA_FFField::CalculateOverride() {
CXFA_WidgetAcc* pAcc = m_pDataAcc->GetExclGroup();
@@ -773,11 +765,11 @@ int32_t CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc) {
}
return 1;
}
-FX_BOOL CXFA_FFField::CommitData() {
- return FALSE;
+bool CXFA_FFField::CommitData() {
+ return false;
}
-FX_BOOL CXFA_FFField::IsDataChanged() {
- return FALSE;
+bool CXFA_FFField::IsDataChanged() {
+ return false;
}
void CXFA_FFField::TranslateFWLMessage(CFWL_Message* pMessage) {
GetApp()->GetWidgetMgrDelegate()->OnProcessMessageToForm(pMessage);
diff --git a/xfa/fxfa/app/xfa_fffield.h b/xfa/fxfa/app/xfa_fffield.h
index 8481018189..17d33da754 100644
--- a/xfa/fxfa/app/xfa_fffield.h
+++ b/xfa/fxfa/app/xfa_fffield.h
@@ -21,37 +21,37 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate {
~CXFA_FFField() override;
// CXFA_FFWidget
- FX_BOOL GetBBox(CFX_RectF& rtBox,
- uint32_t dwStatus,
- FX_BOOL bDrawFocus = FALSE) override;
+ bool GetBBox(CFX_RectF& rtBox,
+ uint32_t dwStatus,
+ bool bDrawFocus = false) override;
void RenderWidget(CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
uint32_t dwStatus) override;
- FX_BOOL IsLoaded() override;
- FX_BOOL LoadWidget() override;
+ bool IsLoaded() override;
+ bool LoadWidget() override;
void UnloadWidget() override;
- FX_BOOL PerformLayout() override;
- FX_BOOL OnMouseEnter() override;
- FX_BOOL OnMouseExit() override;
- FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnMouseWheel(uint32_t dwFlags,
- int16_t zDelta,
- FX_FLOAT fx,
- FX_FLOAT fy) override;
- FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool PerformLayout() override;
+ bool OnMouseEnter() override;
+ bool OnMouseExit() override;
+ bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnMouseWheel(uint32_t dwFlags,
+ int16_t zDelta,
+ FX_FLOAT fx,
+ FX_FLOAT fy) override;
+ bool OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget) override;
- FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override;
- FX_BOOL OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) override;
- FX_BOOL OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) override;
- FX_BOOL OnChar(uint32_t dwChar, uint32_t dwFlags) override;
+ bool OnSetFocus(CXFA_FFWidget* pOldWidget) override;
+ bool OnKillFocus(CXFA_FFWidget* pNewWidget) override;
+ bool OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) override;
+ bool OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) override;
+ bool OnChar(uint32_t dwChar, uint32_t dwFlags) override;
FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) override;
// IFWL_WidgetDelegate
void OnProcessMessage(CFWL_Message* pMessage) override;
@@ -63,7 +63,7 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate {
uint32_t UpdateUIProperty();
protected:
- FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override;
+ bool PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override;
virtual void SetFWLRect();
void SetFWLThemeProvider();
@@ -74,13 +74,13 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate {
int32_t CalculateOverride();
int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc);
- FX_BOOL ProcessCommittedData();
- virtual FX_BOOL CommitData();
- virtual FX_BOOL IsDataChanged();
+ bool ProcessCommittedData();
+ virtual bool CommitData();
+ virtual bool IsDataChanged();
void DrawHighlight(CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
uint32_t dwStatus,
- FX_BOOL bEllipse = FALSE);
+ bool bEllipse = false);
void DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix);
void TranslateFWLMessage(CFWL_Message* pMessage);
void CapPlacement();
diff --git a/xfa/fxfa/app/xfa_ffimage.cpp b/xfa/fxfa/app/xfa_ffimage.cpp
index bcd1d4a9ce..c387cc2690 100644
--- a/xfa/fxfa/app/xfa_ffimage.cpp
+++ b/xfa/fxfa/app/xfa_ffimage.cpp
@@ -17,12 +17,12 @@ CXFA_FFImage::CXFA_FFImage(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc)
CXFA_FFImage::~CXFA_FFImage() {
CXFA_FFImage::UnloadWidget();
}
-FX_BOOL CXFA_FFImage::IsLoaded() {
+bool CXFA_FFImage::IsLoaded() {
return !!GetDataAcc()->GetImageImage();
}
-FX_BOOL CXFA_FFImage::LoadWidget() {
+bool CXFA_FFImage::LoadWidget() {
if (GetDataAcc()->GetImageImage()) {
- return TRUE;
+ return true;
}
GetDataAcc()->LoadImageImage();
return CXFA_FFDraw::LoadWidget();
diff --git a/xfa/fxfa/app/xfa_ffimage.h b/xfa/fxfa/app/xfa_ffimage.h
index d0afc5b431..cc5320eb36 100644
--- a/xfa/fxfa/app/xfa_ffimage.h
+++ b/xfa/fxfa/app/xfa_ffimage.h
@@ -18,8 +18,8 @@ class CXFA_FFImage : public CXFA_FFDraw {
void RenderWidget(CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
uint32_t dwStatus) override;
- FX_BOOL IsLoaded() override;
- FX_BOOL LoadWidget() override;
+ bool IsLoaded() override;
+ bool LoadWidget() override;
void UnloadWidget() override;
};
diff --git a/xfa/fxfa/app/xfa_ffimageedit.cpp b/xfa/fxfa/app/xfa_ffimageedit.cpp
index 4b77ccf73d..216cf5b9bf 100644
--- a/xfa/fxfa/app/xfa_ffimageedit.cpp
+++ b/xfa/fxfa/app/xfa_ffimageedit.cpp
@@ -22,7 +22,7 @@ CXFA_FFImageEdit::CXFA_FFImageEdit(CXFA_FFPageView* pPageView,
CXFA_FFImageEdit::~CXFA_FFImageEdit() {
CXFA_FFImageEdit::UnloadWidget();
}
-FX_BOOL CXFA_FFImageEdit::LoadWidget() {
+bool CXFA_FFImageEdit::LoadWidget() {
CFWL_PictureBox* pPictureBox = new CFWL_PictureBox(GetFWLApp());
pPictureBox->Initialize();
m_pNormalWidget = pPictureBox;
@@ -37,10 +37,10 @@ FX_BOOL CXFA_FFImageEdit::LoadWidget() {
CXFA_FFField::LoadWidget();
if (m_pDataAcc->GetImageEditImage()) {
- return TRUE;
+ return true;
}
UpdateFWLData();
- return TRUE;
+ return true;
}
void CXFA_FFImageEdit::UnloadWidget() {
m_pDataAcc->SetImageEditImage(nullptr);
@@ -84,16 +84,16 @@ void CXFA_FFImageEdit::RenderWidget(CFX_Graphics* pGS,
}
}
-FX_BOOL CXFA_FFImageEdit::OnLButtonDown(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFImageEdit::OnLButtonDown(uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open)
- return FALSE;
+ return false;
if (!PtInActiveRect(fx, fy))
- return FALSE;
+ return false;
- SetButtonDown(TRUE);
+ SetButtonDown(true);
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown;
ms.m_dwFlags = dwFlags;
@@ -102,7 +102,7 @@ FX_BOOL CXFA_FFImageEdit::OnLButtonDown(uint32_t dwFlags,
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
FWLToClient(ms.m_fx, ms.m_fy);
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
void CXFA_FFImageEdit::SetFWLRect() {
@@ -116,13 +116,13 @@ void CXFA_FFImageEdit::SetFWLRect() {
rtUIMargin.height);
m_pNormalWidget->SetWidgetRect(rtImage);
}
-FX_BOOL CXFA_FFImageEdit::CommitData() {
- return TRUE;
+bool CXFA_FFImageEdit::CommitData() {
+ return true;
}
-FX_BOOL CXFA_FFImageEdit::UpdateFWLData() {
+bool CXFA_FFImageEdit::UpdateFWLData() {
m_pDataAcc->SetImageEditImage(nullptr);
m_pDataAcc->LoadImageEditImage();
- return TRUE;
+ return true;
}
void CXFA_FFImageEdit::OnProcessMessage(CFWL_Message* pMessage) {
diff --git a/xfa/fxfa/app/xfa_ffimageedit.h b/xfa/fxfa/app/xfa_ffimageedit.h
index c8f31e2fc4..b6f6ae1ffe 100644
--- a/xfa/fxfa/app/xfa_ffimageedit.h
+++ b/xfa/fxfa/app/xfa_ffimageedit.h
@@ -18,9 +18,9 @@ class CXFA_FFImageEdit : public CXFA_FFField {
void RenderWidget(CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
uint32_t dwStatus) override;
- FX_BOOL LoadWidget() override;
+ bool LoadWidget() override;
void UnloadWidget() override;
- FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
void OnProcessMessage(CFWL_Message* pMessage) override;
void OnProcessEvent(CFWL_Event* pEvent) override;
void OnDrawWidget(CFX_Graphics* pGraphics,
@@ -28,8 +28,8 @@ class CXFA_FFImageEdit : public CXFA_FFField {
protected:
void SetFWLRect() override;
- FX_BOOL UpdateFWLData() override;
- FX_BOOL CommitData() override;
+ bool UpdateFWLData() override;
+ bool CommitData() override;
IFWL_WidgetDelegate* m_pOldDelegate;
};
diff --git a/xfa/fxfa/app/xfa_ffnotify.cpp b/xfa/fxfa/app/xfa_ffnotify.cpp
index 2f3eac6e16..4e14ab0203 100644
--- a/xfa/fxfa/app/xfa_ffnotify.cpp
+++ b/xfa/fxfa/app/xfa_ffnotify.cpp
@@ -180,15 +180,15 @@ void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node* pItem,
pAcc->StartWidgetLayout(fCalcWidth, fCalcHeight);
}
-FX_BOOL CXFA_FFNotify::FindSplitPos(CXFA_Node* pItem,
- int32_t iBlockIndex,
- FX_FLOAT& fCalcHeightPos) {
+bool CXFA_FFNotify::FindSplitPos(CXFA_Node* pItem,
+ int32_t iBlockIndex,
+ FX_FLOAT& fCalcHeightPos) {
CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pItem->GetWidgetData());
return pAcc && pAcc->FindSplitPos(iBlockIndex, fCalcHeightPos);
}
-FX_BOOL CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) {
- FX_BOOL bRet = FALSE;
+bool CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) {
+ bool bRet = false;
CXFA_FFDocView* pDocView = m_pDoc->GetDocView();
if (!pDocView) {
return bRet;
@@ -211,8 +211,8 @@ FX_BOOL CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) {
}
int32_t CXFA_FFNotify::ExecEventByDeepFirst(CXFA_Node* pFormNode,
XFA_EVENTTYPE eEventType,
- FX_BOOL bIsFormReady,
- FX_BOOL bRecursive,
+ bool bIsFormReady,
+ bool bRecursive,
CXFA_WidgetAcc* pExclude) {
CXFA_FFDocView* pDocView = m_pDoc->GetDocView();
if (!pDocView) {
@@ -380,7 +380,7 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender,
}
XFA_Element eType = pParentNode->GetElementType();
- FX_BOOL bIsContainerNode = pParentNode->IsContainerNode();
+ bool bIsContainerNode = pParentNode->IsContainerNode();
CXFA_WidgetAcc* pWidgetAcc =
static_cast<CXFA_WidgetAcc*>(pWidgetNode->GetWidgetData());
if (!pWidgetAcc)
@@ -440,7 +440,7 @@ void CXFA_FFNotify::OnChildAdded(CXFA_Node* pSender) {
if (!pDocView) {
return;
}
- FX_BOOL bLayoutReady =
+ bool bLayoutReady =
!(pDocView->m_bInLayoutStatus) &&
(pDocView->GetLayoutStatus() == XFA_DOCVIEW_LAYOUTSTATUS_End);
if (bLayoutReady)
diff --git a/xfa/fxfa/app/xfa_ffnotify.h b/xfa/fxfa/app/xfa_ffnotify.h
index bc764e1533..d9530a895e 100644
--- a/xfa/fxfa/app/xfa_ffnotify.h
+++ b/xfa/fxfa/app/xfa_ffnotify.h
@@ -46,14 +46,14 @@ class CXFA_FFNotify {
void StartFieldDrawLayout(CXFA_Node* pItem,
FX_FLOAT& fCalcWidth,
FX_FLOAT& fCalcHeight);
- FX_BOOL FindSplitPos(CXFA_Node* pItem,
- int32_t iBlockIndex,
- FX_FLOAT& fCalcHeightPos);
- FX_BOOL RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem);
+ bool FindSplitPos(CXFA_Node* pItem,
+ int32_t iBlockIndex,
+ FX_FLOAT& fCalcHeightPos);
+ bool RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem);
int32_t ExecEventByDeepFirst(CXFA_Node* pFormNode,
XFA_EVENTTYPE eEventType,
- FX_BOOL bIsFormReady = FALSE,
- FX_BOOL bRecursive = TRUE,
+ bool bIsFormReady = false,
+ bool bRecursive = true,
CXFA_WidgetAcc* pExclude = nullptr);
void AddCalcValidate(CXFA_Node* pNode);
CXFA_FFDoc* GetHDOC();
diff --git a/xfa/fxfa/app/xfa_ffpageview.cpp b/xfa/fxfa/app/xfa_ffpageview.cpp
index 899a311d6c..5ef108693a 100644
--- a/xfa/fxfa/app/xfa_ffpageview.cpp
+++ b/xfa/fxfa/app/xfa_ffpageview.cpp
@@ -26,8 +26,8 @@ void GetPageMatrix(CFX_Matrix& pageMatrix,
int32_t iRotate,
uint32_t dwCoordinatesType) {
ASSERT(iRotate >= 0 && iRotate <= 3);
- FX_BOOL bFlipX = (dwCoordinatesType & 0x01) != 0;
- FX_BOOL bFlipY = (dwCoordinatesType & 0x02) != 0;
+ bool bFlipX = (dwCoordinatesType & 0x01) != 0;
+ bool bFlipY = (dwCoordinatesType & 0x02) != 0;
CFX_Matrix m;
m.Set((bFlipX ? -1.0f : 1.0f), 0, 0, (bFlipY ? -1.0f : 1.0f), 0, 0);
if (iRotate == 0 || iRotate == 2) {
@@ -71,8 +71,8 @@ void GetPageMatrix(CFX_Matrix& pageMatrix,
bool PageWidgetFilter(CXFA_FFWidget* pWidget,
uint32_t dwFilter,
- FX_BOOL bTraversal,
- FX_BOOL bIgnorerelevant) {
+ bool bTraversal,
+ bool bIgnorerelevant) {
CXFA_WidgetAcc* pWidgetAcc = pWidget->GetDataAcc();
if (!!(dwFilter & XFA_WidgetStatus_Focused) &&
@@ -194,13 +194,13 @@ CXFA_FFWidget* CXFA_FFPageWidgetIterator::GetCurrentWidget() {
CXFA_LayoutItem* pLayoutItem = m_sIterator.GetCurrent();
return pLayoutItem ? XFA_GetWidgetFromLayoutItem(pLayoutItem) : nullptr;
}
-FX_BOOL CXFA_FFPageWidgetIterator::SetCurrentWidget(CXFA_FFWidget* hWidget) {
+bool CXFA_FFPageWidgetIterator::SetCurrentWidget(CXFA_FFWidget* hWidget) {
return hWidget && m_sIterator.SetCurrent(hWidget);
}
CXFA_FFWidget* CXFA_FFPageWidgetIterator::GetWidget(
CXFA_LayoutItem* pLayoutItem) {
if (CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pLayoutItem)) {
- if (!PageWidgetFilter(pWidget, m_dwFilter, FALSE, m_bIgnorerelevant)) {
+ if (!PageWidgetFilter(pWidget, m_dwFilter, false, m_bIgnorerelevant)) {
return nullptr;
}
if (!pWidget->IsLoaded() &&
@@ -231,7 +231,7 @@ void CXFA_FFTabOrderPageWidgetIterator::Reset() {
CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToFirst() {
if (m_TabOrderWidgetArray.GetSize() > 0) {
for (int32_t i = 0; i < m_TabOrderWidgetArray.GetSize(); i++) {
- if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE,
+ if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, true,
m_bIgnorerelevant)) {
m_iCurWidget = i;
return m_TabOrderWidgetArray[m_iCurWidget];
@@ -243,7 +243,7 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToFirst() {
CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToLast() {
if (m_TabOrderWidgetArray.GetSize() > 0) {
for (int32_t i = m_TabOrderWidgetArray.GetSize() - 1; i >= 0; i--) {
- if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE,
+ if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, true,
m_bIgnorerelevant)) {
m_iCurWidget = i;
return m_TabOrderWidgetArray[m_iCurWidget];
@@ -254,7 +254,7 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToLast() {
}
CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToNext() {
for (int32_t i = m_iCurWidget + 1; i < m_TabOrderWidgetArray.GetSize(); i++) {
- if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE,
+ if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, true,
m_bIgnorerelevant)) {
m_iCurWidget = i;
return m_TabOrderWidgetArray[m_iCurWidget];
@@ -265,7 +265,7 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToNext() {
}
CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToPrevious() {
for (int32_t i = m_iCurWidget - 1; i >= 0; i--) {
- if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE,
+ if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, true,
m_bIgnorerelevant)) {
m_iCurWidget = i;
return m_TabOrderWidgetArray[m_iCurWidget];
@@ -280,14 +280,14 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetCurrentWidget() {
}
return nullptr;
}
-FX_BOOL CXFA_FFTabOrderPageWidgetIterator::SetCurrentWidget(
+bool CXFA_FFTabOrderPageWidgetIterator::SetCurrentWidget(
CXFA_FFWidget* hWidget) {
int32_t iWidgetIndex = m_TabOrderWidgetArray.Find(hWidget);
if (iWidgetIndex >= 0) {
m_iCurWidget = iWidgetIndex;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetTraverseWidget(
CXFA_FFWidget* pWidget) {
@@ -324,7 +324,7 @@ void CXFA_FFTabOrderPageWidgetIterator::CreateTabOrderWidgetArray() {
CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc();
if (pWidgetAcc->GetUIType() == XFA_Element::ExclGroup) {
int32_t iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget) + 1;
- while (TRUE) {
+ while (true) {
CXFA_FFWidget* pRadio =
SpaceOrderWidgetArray[(iWidgetIndex) % nWidgetCount];
if (pRadio->GetDataAcc()->GetExclGroup() != pWidgetAcc) {
@@ -362,14 +362,14 @@ void CXFA_FFTabOrderPageWidgetIterator::OrderContainer(
CXFA_LayoutItemIterator* sIterator,
CXFA_LayoutItem* pContainerItem,
CXFA_TabParam* pContainer,
- FX_BOOL& bCurrentItem,
- FX_BOOL& bContentArea,
- FX_BOOL bMarsterPage) {
+ bool& bCurrentItem,
+ bool& bContentArea,
+ bool bMarsterPage) {
CFX_ArrayTemplate<CXFA_TabParam*> tabParams;
CXFA_LayoutItem* pSearchItem = sIterator->MoveToNext();
while (pSearchItem) {
if (!pSearchItem->IsContentLayoutItem()) {
- bContentArea = TRUE;
+ bContentArea = true;
pSearchItem = sIterator->MoveToNext();
continue;
}
@@ -383,7 +383,7 @@ void CXFA_FFTabOrderPageWidgetIterator::OrderContainer(
continue;
}
if (pContainerItem && (pSearchItem->GetParent() != pContainerItem)) {
- bCurrentItem = TRUE;
+ bCurrentItem = true;
break;
}
CXFA_TabParam* pParam = new CXFA_TabParam;
@@ -396,7 +396,7 @@ void CXFA_FFTabOrderPageWidgetIterator::OrderContainer(
}
if (bCurrentItem) {
pSearchItem = sIterator->GetCurrent();
- bCurrentItem = FALSE;
+ bCurrentItem = false;
} else {
pSearchItem = sIterator->MoveToNext();
}
@@ -421,17 +421,17 @@ void CXFA_FFTabOrderPageWidgetIterator::CreateSpaceOrderWidgetArray(
CXFA_LayoutItemIterator sIterator;
sIterator.Init(m_pPageView);
CXFA_TabParam* pParam = new CXFA_TabParam;
- FX_BOOL bCurrentItem = FALSE;
- FX_BOOL bContentArea = FALSE;
+ bool bCurrentItem = false;
+ bool bContentArea = false;
OrderContainer(&sIterator, nullptr, pParam, bCurrentItem, bContentArea);
if (pParam->m_Children.GetSize() > 0) {
WidgetArray.Append(pParam->m_Children);
}
sIterator.Reset();
- bCurrentItem = FALSE;
- bContentArea = FALSE;
+ bCurrentItem = false;
+ bContentArea = false;
pParam->m_Children.RemoveAll();
- OrderContainer(&sIterator, nullptr, pParam, bCurrentItem, bContentArea, TRUE);
+ OrderContainer(&sIterator, nullptr, pParam, bCurrentItem, bContentArea, true);
if (pParam->m_Children.GetSize() > 0) {
WidgetArray.Append(pParam->m_Children);
}
diff --git a/xfa/fxfa/app/xfa_ffpath.cpp b/xfa/fxfa/app/xfa_ffpath.cpp
index 7ef13b63ff..c5c91a459c 100644
--- a/xfa/fxfa/app/xfa_ffpath.cpp
+++ b/xfa/fxfa/app/xfa_ffpath.cpp
@@ -63,7 +63,7 @@ void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS,
FX_ARGB lineColor = 0xFF000000;
int32_t iStrokeType = 0;
FX_FLOAT fLineWidth = 1.0f;
- FX_BOOL bSlope = lineObj.GetSlop();
+ bool bSlope = lineObj.GetSlop();
int32_t iCap = 0;
CXFA_Edge edge = lineObj.GetEdge();
if (edge) {
@@ -95,7 +95,7 @@ void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS,
}
CFX_Color color(lineColor);
pGS->SaveGraphState();
- pGS->SetLineWidth(fLineWidth, TRUE);
+ pGS->SetLineWidth(fLineWidth, true);
XFA_StrokeTypeSetLineDash(pGS, iStrokeType, iCap);
pGS->SetStrokeColor(&color);
pGS->SetLineCap(XFA_LineCapToFXGE(iCap));
diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp
index 2439eae78f..12fabb5a1e 100644
--- a/xfa/fxfa/app/xfa_ffpushbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp
@@ -50,7 +50,7 @@ void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS,
GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(),
pGS, &mt);
}
-FX_BOOL CXFA_FFPushButton::LoadWidget() {
+bool CXFA_FFPushButton::LoadWidget() {
ASSERT(!m_pNormalWidget);
CFWL_PushButton* pPushButton = new CFWL_PushButton(GetFWLApp());
pPushButton->Initialize();
@@ -99,7 +99,7 @@ void CXFA_FFPushButton::UnloadWidget() {
CXFA_FFField::UnloadWidget();
}
-FX_BOOL CXFA_FFPushButton::PerformLayout() {
+bool CXFA_FFPushButton::PerformLayout() {
CXFA_FFWidget::PerformLayout();
CFX_RectF rtWidget;
GetRectWithoutRotate(rtWidget);
@@ -117,7 +117,7 @@ FX_BOOL CXFA_FFPushButton::PerformLayout() {
if (m_pNormalWidget) {
m_pNormalWidget->Update();
}
- return TRUE;
+ return true;
}
FX_FLOAT CXFA_FFPushButton::GetLineWidth() {
CXFA_Border border = m_pDataAcc->GetBorder();
@@ -138,7 +138,7 @@ void CXFA_FFPushButton::LoadHighlightCaption() {
if (caption && caption.GetPresence() != XFA_ATTRIBUTEENUM_Hidden) {
{
CFX_WideString wsRollover;
- FX_BOOL bRichText;
+ bool bRichText;
if (m_pDataAcc->GetButtonRollover(wsRollover, bRichText)) {
if (!m_pRollProvider) {
m_pRollProvider =
diff --git a/xfa/fxfa/app/xfa_ffpushbutton.h b/xfa/fxfa/app/xfa_ffpushbutton.h
index e7c9bd7746..d5fe0b279f 100644
--- a/xfa/fxfa/app/xfa_ffpushbutton.h
+++ b/xfa/fxfa/app/xfa_ffpushbutton.h
@@ -25,9 +25,9 @@ class CXFA_FFPushButton : public CXFA_FFField {
void RenderWidget(CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
uint32_t dwStatus) override;
- FX_BOOL LoadWidget() override;
+ bool LoadWidget() override;
void UnloadWidget() override;
- FX_BOOL PerformLayout() override;
+ bool PerformLayout() override;
void UpdateWidgetProperty() override;
void OnProcessMessage(CFWL_Message* pMessage) override;
void OnProcessEvent(CFWL_Event* pEvent) override;
diff --git a/xfa/fxfa/app/xfa_ffsignature.cpp b/xfa/fxfa/app/xfa_ffsignature.cpp
index 3402d43fcb..7b8da0cea7 100644
--- a/xfa/fxfa/app/xfa_ffsignature.cpp
+++ b/xfa/fxfa/app/xfa_ffsignature.cpp
@@ -15,7 +15,7 @@ CXFA_FFSignature::CXFA_FFSignature(CXFA_FFPageView* pPageView,
CXFA_WidgetAcc* pDataAcc)
: CXFA_FFField(pPageView, pDataAcc) {}
CXFA_FFSignature::~CXFA_FFSignature() {}
-FX_BOOL CXFA_FFSignature::LoadWidget() {
+bool CXFA_FFSignature::LoadWidget() {
return CXFA_FFField::LoadWidget();
}
void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS,
@@ -33,64 +33,58 @@ void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS,
CXFA_Border borderUI = m_pDataAcc->GetUIBorder();
DrawBorder(pGS, borderUI, m_rtUI, &mtRotate);
RenderCaption(pGS, &mtRotate);
- DrawHighlight(pGS, &mtRotate, dwStatus, FALSE);
+ DrawHighlight(pGS, &mtRotate, dwStatus, false);
}
-FX_BOOL CXFA_FFSignature::OnMouseEnter() {
- return FALSE;
-}
-FX_BOOL CXFA_FFSignature::OnMouseExit() {
- return FALSE;
-}
-FX_BOOL CXFA_FFSignature::OnLButtonDown(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- return FALSE;
-}
-FX_BOOL CXFA_FFSignature::OnLButtonUp(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- return FALSE;
-}
-FX_BOOL CXFA_FFSignature::OnLButtonDblClk(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- return FALSE;
-}
-FX_BOOL CXFA_FFSignature::OnMouseMove(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- return FALSE;
-}
-FX_BOOL CXFA_FFSignature::OnMouseWheel(uint32_t dwFlags,
- int16_t zDelta,
+bool CXFA_FFSignature::OnMouseEnter() {
+ return false;
+}
+bool CXFA_FFSignature::OnMouseExit() {
+ return false;
+}
+bool CXFA_FFSignature::OnLButtonDown(uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
+ return false;
+}
+bool CXFA_FFSignature::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+ return false;
+}
+bool CXFA_FFSignature::OnLButtonDblClk(uint32_t dwFlags,
FX_FLOAT fx,
FX_FLOAT fy) {
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_FFSignature::OnRButtonDown(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- return FALSE;
+bool CXFA_FFSignature::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+ return false;
}
-FX_BOOL CXFA_FFSignature::OnRButtonUp(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- return FALSE;
+bool CXFA_FFSignature::OnMouseWheel(uint32_t dwFlags,
+ int16_t zDelta,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
+ return false;
}
-FX_BOOL CXFA_FFSignature::OnRButtonDblClk(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- return FALSE;
+bool CXFA_FFSignature::OnRButtonDown(uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
+ return false;
+}
+bool CXFA_FFSignature::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+ return false;
+}
+bool CXFA_FFSignature::OnRButtonDblClk(uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
+ return false;
}
-FX_BOOL CXFA_FFSignature::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) {
- return FALSE;
+bool CXFA_FFSignature::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) {
+ return false;
}
-FX_BOOL CXFA_FFSignature::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) {
- return FALSE;
+bool CXFA_FFSignature::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) {
+ return false;
}
-FX_BOOL CXFA_FFSignature::OnChar(uint32_t dwChar, uint32_t dwFlags) {
- return FALSE;
+bool CXFA_FFSignature::OnChar(uint32_t dwChar, uint32_t dwFlags) {
+ return false;
}
FWL_WidgetHit CXFA_FFSignature::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) {
if (m_pNormalWidget) {
@@ -107,6 +101,6 @@ FWL_WidgetHit CXFA_FFSignature::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) {
return FWL_WidgetHit::Titlebar;
return FWL_WidgetHit::Client;
}
-FX_BOOL CXFA_FFSignature::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) {
- return FALSE;
+bool CXFA_FFSignature::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) {
+ return false;
}
diff --git a/xfa/fxfa/app/xfa_ffsignature.h b/xfa/fxfa/app/xfa_ffsignature.h
index 3cfe9ab2c6..28053b758e 100644
--- a/xfa/fxfa/app/xfa_ffsignature.h
+++ b/xfa/fxfa/app/xfa_ffsignature.h
@@ -18,26 +18,26 @@ class CXFA_FFSignature final : public CXFA_FFField {
void RenderWidget(CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
uint32_t dwStatus) override;
- FX_BOOL LoadWidget() override;
- FX_BOOL OnMouseEnter() override;
- FX_BOOL OnMouseExit() override;
- FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnMouseWheel(uint32_t dwFlags,
- int16_t zDelta,
- FX_FLOAT fx,
- FX_FLOAT fy) override;
- FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool LoadWidget() override;
+ bool OnMouseEnter() override;
+ bool OnMouseExit() override;
+ bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnMouseWheel(uint32_t dwFlags,
+ int16_t zDelta,
+ FX_FLOAT fx,
+ FX_FLOAT fy) override;
+ bool OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) override;
- FX_BOOL OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) override;
- FX_BOOL OnChar(uint32_t dwChar, uint32_t dwFlags) override;
+ bool OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) override;
+ bool OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) override;
+ bool OnChar(uint32_t dwChar, uint32_t dwFlags) override;
FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) override;
};
#endif // XFA_FXFA_APP_XFA_FFSIGNATURE_H_
diff --git a/xfa/fxfa/app/xfa_fftext.cpp b/xfa/fxfa/app/xfa_fftext.cpp
index b8ad6716d0..c7e4f04d3c 100644
--- a/xfa/fxfa/app/xfa_fftext.cpp
+++ b/xfa/fxfa/app/xfa_fftext.cpp
@@ -62,23 +62,23 @@ void CXFA_FFText::RenderWidget(CFX_Graphics* pGS,
}
}
}
-FX_BOOL CXFA_FFText::IsLoaded() {
+bool CXFA_FFText::IsLoaded() {
CXFA_TextLayout* pTextLayout = m_pDataAcc->GetTextLayout();
return pTextLayout && !pTextLayout->m_bHasBlock;
}
-FX_BOOL CXFA_FFText::PerformLayout() {
+bool CXFA_FFText::PerformLayout() {
CXFA_FFDraw::PerformLayout();
CXFA_TextLayout* pTextLayout = m_pDataAcc->GetTextLayout();
if (!pTextLayout) {
- return FALSE;
+ return false;
}
if (!pTextLayout->m_bHasBlock) {
- return TRUE;
+ return true;
}
pTextLayout->m_Blocks.RemoveAll();
CXFA_LayoutItem* pItem = this;
if (!pItem->GetPrev() && !pItem->GetNext()) {
- return TRUE;
+ return true;
}
pItem = pItem->GetFirst();
while (pItem) {
@@ -98,46 +98,46 @@ FX_BOOL CXFA_FFText::PerformLayout() {
pTextLayout->ItemBlocks(rtText, pItem->GetIndex());
pItem = pItem->GetNext();
}
- pTextLayout->m_bHasBlock = FALSE;
- return TRUE;
+ pTextLayout->m_bHasBlock = false;
+ return true;
}
-FX_BOOL CXFA_FFText::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+bool CXFA_FFText::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
CFX_RectF rtBox;
GetRectWithoutRotate(rtBox);
if (!rtBox.Contains(fx, fy)) {
- return FALSE;
+ return false;
}
const FX_WCHAR* wsURLContent = GetLinkURLAtPoint(fx, fy);
if (!wsURLContent) {
- return FALSE;
+ return false;
}
- SetButtonDown(TRUE);
- return TRUE;
+ SetButtonDown(true);
+ return true;
}
-FX_BOOL CXFA_FFText::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+bool CXFA_FFText::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
CFX_RectF rtBox;
GetRectWithoutRotate(rtBox);
if (!rtBox.Contains(fx, fy)) {
- return FALSE;
+ return false;
}
const FX_WCHAR* wsURLContent = GetLinkURLAtPoint(fx, fy);
if (!wsURLContent) {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFText::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+bool CXFA_FFText::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
if (!IsButtonDown()) {
- return FALSE;
+ return false;
}
- SetButtonDown(FALSE);
+ SetButtonDown(false);
const FX_WCHAR* wsURLContent = GetLinkURLAtPoint(fx, fy);
if (!wsURLContent) {
- return FALSE;
+ return false;
}
CXFA_FFDoc* pDoc = GetDoc();
pDoc->GetDocEnvironment()->GotoURL(pDoc, wsURLContent);
- return TRUE;
+ return true;
}
FWL_WidgetHit CXFA_FFText::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) {
CFX_RectF rtBox;
diff --git a/xfa/fxfa/app/xfa_fftext.h b/xfa/fxfa/app/xfa_fftext.h
index 38e7676ac1..71f36e2769 100644
--- a/xfa/fxfa/app/xfa_fftext.h
+++ b/xfa/fxfa/app/xfa_fftext.h
@@ -15,15 +15,15 @@ class CXFA_FFText : public CXFA_FFDraw {
~CXFA_FFText() override;
// CXFA_FFWidget
- FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy) override;
void RenderWidget(CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
uint32_t dwStatus) override;
- FX_BOOL IsLoaded() override;
- FX_BOOL PerformLayout() override;
+ bool IsLoaded() override;
+ bool PerformLayout() override;
private:
const FX_WCHAR* GetLinkURLAtPoint(FX_FLOAT fx, FX_FLOAT fy);
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index ffbcac1e17..2b47ae2495 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -36,7 +36,7 @@ CXFA_FFTextEdit::~CXFA_FFTextEdit() {
}
}
-FX_BOOL CXFA_FFTextEdit::LoadWidget() {
+bool CXFA_FFTextEdit::LoadWidget() {
CFWL_Edit* pFWLEdit = new CFWL_Edit(GetFWLApp());
pFWLEdit->Initialize();
m_pNormalWidget = pFWLEdit;
@@ -100,18 +100,18 @@ void CXFA_FFTextEdit::UpdateWidgetProperty() {
m_pNormalWidget->ModifyStyles(dwStyle, 0xFFFFFFFF);
m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF);
}
-FX_BOOL CXFA_FFTextEdit::OnLButtonDown(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFTextEdit::OnLButtonDown(uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
if (!PtInActiveRect(fx, fy)) {
- return FALSE;
+ return false;
}
if (!IsFocused()) {
m_dwStatus |= XFA_WidgetStatus_Focused;
UpdateFWLData();
AddInvalidateRect();
}
- SetButtonDown(TRUE);
+ SetButtonDown(true);
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown;
ms.m_dwFlags = dwFlags;
@@ -120,23 +120,23 @@ FX_BOOL CXFA_FFTextEdit::OnLButtonDown(uint32_t dwFlags,
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
FWLToClient(ms.m_fx, ms.m_fy);
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFTextEdit::OnRButtonDown(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFTextEdit::OnRButtonDown(uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) {
- return FALSE;
+ return false;
}
if (!PtInActiveRect(fx, fy)) {
- return FALSE;
+ return false;
}
if (!IsFocused()) {
m_dwStatus |= XFA_WidgetStatus_Focused;
UpdateFWLData();
AddInvalidateRect();
}
- SetButtonDown(TRUE);
+ SetButtonDown(true);
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MouseCommand::RightButtonDown;
ms.m_dwFlags = dwFlags;
@@ -144,18 +144,16 @@ FX_BOOL CXFA_FFTextEdit::OnRButtonDown(uint32_t dwFlags,
ms.m_fy = fy;
FWLToClient(ms.m_fx, ms.m_fy);
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFTextEdit::OnRButtonUp(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFTextEdit::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
if (!CXFA_FFField::OnRButtonUp(dwFlags, fx, fy))
- return FALSE;
+ return false;
GetDoc()->GetDocEnvironment()->PopupMenu(this, CFX_PointF(fx, fy));
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFTextEdit::OnSetFocus(CXFA_FFWidget* pOldWidget) {
+bool CXFA_FFTextEdit::OnSetFocus(CXFA_FFWidget* pOldWidget) {
m_dwStatus &= ~XFA_WidgetStatus_TextEditValueChanged;
if (!IsFocused()) {
m_dwStatus |= XFA_WidgetStatus_Focused;
@@ -167,9 +165,9 @@ FX_BOOL CXFA_FFTextEdit::OnSetFocus(CXFA_FFWidget* pOldWidget) {
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
ms.m_pSrcTarget = nullptr;
TranslateFWLMessage(&ms);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFTextEdit::OnKillFocus(CXFA_FFWidget* pNewWidget) {
+bool CXFA_FFTextEdit::OnKillFocus(CXFA_FFWidget* pNewWidget) {
CFWL_MsgKillFocus ms;
ms.m_pDstTarget = m_pNormalWidget->GetWidget();
ms.m_pSrcTarget = nullptr;
@@ -181,17 +179,17 @@ FX_BOOL CXFA_FFTextEdit::OnKillFocus(CXFA_FFWidget* pNewWidget) {
AddInvalidateRect();
CXFA_FFWidget::OnKillFocus(pNewWidget);
m_dwStatus &= ~XFA_WidgetStatus_TextEditValueChanged;
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFTextEdit::CommitData() {
+bool CXFA_FFTextEdit::CommitData() {
CFX_WideString wsText;
((CFWL_Edit*)m_pNormalWidget)->GetText(wsText);
if (m_pDataAcc->SetValue(wsText, XFA_VALUEPICTURE_Edit)) {
m_pDataAcc->UpdateUIDisplay(this);
- return TRUE;
+ return true;
}
ValidateNumberField(wsText);
- return FALSE;
+ return false;
}
void CXFA_FFTextEdit::ValidateNumberField(const CFX_WideString& wsText) {
CXFA_WidgetAcc* pAcc = GetDataAcc();
@@ -210,7 +208,7 @@ void CXFA_FFTextEdit::ValidateNumberField(const CFX_WideString& wsText) {
}
}
}
-FX_BOOL CXFA_FFTextEdit::IsDataChanged() {
+bool CXFA_FFTextEdit::IsDataChanged() {
return (m_dwStatus & XFA_WidgetStatus_TextEditValueChanged) != 0;
}
uint32_t CXFA_FFTextEdit::GetAlignment() {
@@ -250,15 +248,15 @@ uint32_t CXFA_FFTextEdit::GetAlignment() {
}
return dwExtendedStyle;
}
-FX_BOOL CXFA_FFTextEdit::UpdateFWLData() {
+bool CXFA_FFTextEdit::UpdateFWLData() {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
XFA_VALUEPICTURE eType = XFA_VALUEPICTURE_Display;
if (IsFocused()) {
eType = XFA_VALUEPICTURE_Edit;
}
- FX_BOOL bUpdate = FALSE;
+ bool bUpdate = false;
if (m_pDataAcc->GetUIType() == XFA_Element::TextEdit &&
m_pDataAcc->GetNumberOfCells() < 0) {
XFA_Element elementType = XFA_Element::Unknown;
@@ -268,7 +266,7 @@ FX_BOOL CXFA_FFTextEdit::UpdateFWLData() {
}
if (((CFWL_Edit*)m_pNormalWidget)->GetLimit() != iMaxChars) {
((CFWL_Edit*)m_pNormalWidget)->SetLimit(iMaxChars);
- bUpdate = TRUE;
+ bUpdate = true;
}
}
if (m_pDataAcc->GetUIType() == XFA_Element::Barcode) {
@@ -276,7 +274,7 @@ FX_BOOL CXFA_FFTextEdit::UpdateFWLData() {
if (eType == XFA_VALUEPICTURE_Edit)
m_pDataAcc->GetBarcodeAttribute_DataLength(nDataLen);
static_cast<CFWL_Edit*>(m_pNormalWidget)->SetLimit(nDataLen);
- bUpdate = TRUE;
+ bUpdate = true;
}
CFX_WideString wsText;
m_pDataAcc->GetValue(wsText, eType);
@@ -284,76 +282,74 @@ FX_BOOL CXFA_FFTextEdit::UpdateFWLData() {
((CFWL_Edit*)m_pNormalWidget)->GetText(wsOldText);
if (wsText != wsOldText || (eType == XFA_VALUEPICTURE_Edit && bUpdate)) {
((CFWL_Edit*)m_pNormalWidget)->SetText(wsText);
- bUpdate = TRUE;
+ bUpdate = true;
}
if (bUpdate) {
m_pNormalWidget->Update();
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFTextEdit::CanUndo() {
+bool CXFA_FFTextEdit::CanUndo() {
return ((CFWL_Edit*)m_pNormalWidget)->CanUndo();
}
-FX_BOOL CXFA_FFTextEdit::CanRedo() {
+bool CXFA_FFTextEdit::CanRedo() {
return ((CFWL_Edit*)m_pNormalWidget)->CanRedo();
}
-FX_BOOL CXFA_FFTextEdit::Undo() {
+bool CXFA_FFTextEdit::Undo() {
return ((CFWL_Edit*)m_pNormalWidget)->Undo();
}
-FX_BOOL CXFA_FFTextEdit::Redo() {
+bool CXFA_FFTextEdit::Redo() {
return ((CFWL_Edit*)m_pNormalWidget)->Redo();
}
-FX_BOOL CXFA_FFTextEdit::CanCopy() {
+bool CXFA_FFTextEdit::CanCopy() {
int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges();
return nCount > 0;
}
-FX_BOOL CXFA_FFTextEdit::CanCut() {
+bool CXFA_FFTextEdit::CanCut() {
if (m_pNormalWidget->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly) {
- return FALSE;
+ return false;
}
int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges();
return nCount > 0;
}
-FX_BOOL CXFA_FFTextEdit::CanPaste() {
+bool CXFA_FFTextEdit::CanPaste() {
return m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open;
}
-FX_BOOL CXFA_FFTextEdit::CanSelectAll() {
+bool CXFA_FFTextEdit::CanSelectAll() {
return ((CFWL_Edit*)m_pNormalWidget)->GetTextLength() > 0;
}
-FX_BOOL CXFA_FFTextEdit::Copy(CFX_WideString& wsCopy) {
+bool CXFA_FFTextEdit::Copy(CFX_WideString& wsCopy) {
return ((CFWL_Edit*)m_pNormalWidget)->Copy(wsCopy);
}
-FX_BOOL CXFA_FFTextEdit::Cut(CFX_WideString& wsCut) {
+bool CXFA_FFTextEdit::Cut(CFX_WideString& wsCut) {
return ((CFWL_Edit*)m_pNormalWidget)->Cut(wsCut);
}
-FX_BOOL CXFA_FFTextEdit::Paste(const CFX_WideString& wsPaste) {
+bool CXFA_FFTextEdit::Paste(const CFX_WideString& wsPaste) {
return ((CFWL_Edit*)m_pNormalWidget)->Paste(wsPaste);
}
-FX_BOOL CXFA_FFTextEdit::SelectAll() {
+bool CXFA_FFTextEdit::SelectAll() {
int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->GetTextLength();
return ((CFWL_Edit*)m_pNormalWidget)->AddSelRange(0, nCount) >= 0;
}
-FX_BOOL CXFA_FFTextEdit::Delete() {
+bool CXFA_FFTextEdit::Delete() {
return ((CFWL_Edit*)m_pNormalWidget)->Delete();
}
-FX_BOOL CXFA_FFTextEdit::DeSelect() {
+bool CXFA_FFTextEdit::DeSelect() {
return ((CFWL_Edit*)m_pNormalWidget)->ClearSelections() ==
FWL_Error::Succeeded;
}
-FX_BOOL CXFA_FFTextEdit::GetSuggestWords(
- CFX_PointF pointf,
- std::vector<CFX_ByteString>& sSuggest) {
+bool CXFA_FFTextEdit::GetSuggestWords(CFX_PointF pointf,
+ std::vector<CFX_ByteString>& sSuggest) {
if (m_pDataAcc->GetUIType() != XFA_Element::TextEdit) {
- return FALSE;
+ return false;
}
FWLToClient(pointf.x, pointf.y);
return ((CFWL_Edit*)m_pNormalWidget)->GetSuggestWords(pointf, sSuggest);
}
-FX_BOOL CXFA_FFTextEdit::ReplaceSpellCheckWord(
- CFX_PointF pointf,
- const CFX_ByteStringC& bsReplace) {
+bool CXFA_FFTextEdit::ReplaceSpellCheckWord(CFX_PointF pointf,
+ const CFX_ByteStringC& bsReplace) {
if (m_pDataAcc->GetUIType() != XFA_Element::TextEdit) {
- return FALSE;
+ return false;
}
FWLToClient(pointf.x, pointf.y);
return ((CFWL_Edit*)m_pNormalWidget)
@@ -392,10 +388,10 @@ void CXFA_FFTextEdit::OnTextFull(IFWL_Widget* pWidget) {
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Full, &eParam);
}
-FX_BOOL CXFA_FFTextEdit::CheckWord(const CFX_ByteStringC& sWord) {
+bool CXFA_FFTextEdit::CheckWord(const CFX_ByteStringC& sWord) {
if (sWord.IsEmpty() || m_pDataAcc->GetUIType() != XFA_Element::TextEdit)
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
void CXFA_FFTextEdit::OnProcessMessage(CFWL_Message* pMessage) {
@@ -423,7 +419,7 @@ void CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) {
}
case CFWL_EventType::GetSuggestedWords: {
CFWL_EvtEdtGetSuggestWords* event = (CFWL_EvtEdtGetSuggestWords*)pEvent;
- event->bSuggestWords = FALSE;
+ event->bSuggestWords = false;
break;
}
default:
@@ -441,7 +437,7 @@ CXFA_FFNumericEdit::CXFA_FFNumericEdit(CXFA_FFPageView* pPageView,
CXFA_WidgetAcc* pDataAcc)
: CXFA_FFTextEdit(pPageView, pDataAcc) {}
CXFA_FFNumericEdit::~CXFA_FFNumericEdit() {}
-FX_BOOL CXFA_FFNumericEdit::LoadWidget() {
+bool CXFA_FFNumericEdit::LoadWidget() {
CFWL_Edit* pWidget = new CFWL_Edit(GetFWLApp());
pWidget->Initialize();
m_pNormalWidget = pWidget;
@@ -498,12 +494,12 @@ void CXFA_FFNumericEdit::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_FFTextEdit::OnProcessEvent(pEvent);
}
-FX_BOOL CXFA_FFNumericEdit::OnValidate(IFWL_Widget* pWidget,
- CFX_WideString& wsText) {
+bool CXFA_FFNumericEdit::OnValidate(IFWL_Widget* pWidget,
+ CFX_WideString& wsText) {
CFX_WideString wsPattern;
m_pDataAcc->GetPictureContent(wsPattern, XFA_VALUEPICTURE_Edit);
if (!wsPattern.IsEmpty()) {
- return TRUE;
+ return true;
}
int32_t iLeads = 0;
m_pDataAcc->GetLeadDigits(iLeads);
@@ -521,7 +517,7 @@ CXFA_FFPasswordEdit::CXFA_FFPasswordEdit(CXFA_FFPageView* pPageView,
CXFA_FFPasswordEdit::~CXFA_FFPasswordEdit() {}
-FX_BOOL CXFA_FFPasswordEdit::LoadWidget() {
+bool CXFA_FFPasswordEdit::LoadWidget() {
CFWL_Edit* pWidget = new CFWL_Edit(GetFWLApp());
pWidget->Initialize();
m_pNormalWidget = pWidget;
@@ -572,26 +568,26 @@ CXFA_FFDateTimeEdit::CXFA_FFDateTimeEdit(CXFA_FFPageView* pPageView,
CXFA_FFDateTimeEdit::~CXFA_FFDateTimeEdit() {}
-FX_BOOL CXFA_FFDateTimeEdit::GetBBox(CFX_RectF& rtBox,
- uint32_t dwStatus,
- FX_BOOL bDrawFocus) {
+bool CXFA_FFDateTimeEdit::GetBBox(CFX_RectF& rtBox,
+ uint32_t dwStatus,
+ bool bDrawFocus) {
if (bDrawFocus)
- return FALSE;
+ return false;
return CXFA_FFWidget::GetBBox(rtBox, dwStatus);
}
-FX_BOOL CXFA_FFDateTimeEdit::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
+bool CXFA_FFDateTimeEdit::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
CFX_RectF rtWidget;
((CFWL_DateTimePicker*)m_pNormalWidget)->GetBBox(rtWidget);
if (rtWidget.Contains(fx, fy)) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_FFDateTimeEdit::LoadWidget() {
+bool CXFA_FFDateTimeEdit::LoadWidget() {
CFWL_DateTimePicker* pWidget = new CFWL_DateTimePicker(GetFWLApp());
pWidget->Initialize();
m_pNormalWidget = pWidget;
@@ -687,18 +683,18 @@ uint32_t CXFA_FFDateTimeEdit::GetAlignment() {
}
return dwExtendedStyle;
}
-FX_BOOL CXFA_FFDateTimeEdit::CommitData() {
+bool CXFA_FFDateTimeEdit::CommitData() {
CFX_WideString wsText;
((CFWL_DateTimePicker*)m_pNormalWidget)->GetEditText(wsText);
if (m_pDataAcc->SetValue(wsText, XFA_VALUEPICTURE_Edit)) {
m_pDataAcc->UpdateUIDisplay(this);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_FFDateTimeEdit::UpdateFWLData() {
+bool CXFA_FFDateTimeEdit::UpdateFWLData() {
if (!m_pNormalWidget) {
- return FALSE;
+ return false;
}
XFA_VALUEPICTURE eType = XFA_VALUEPICTURE_Display;
if (IsFocused()) {
@@ -718,11 +714,11 @@ FX_BOOL CXFA_FFDateTimeEdit::UpdateFWLData() {
}
}
m_pNormalWidget->Update();
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFDateTimeEdit::IsDataChanged() {
+bool CXFA_FFDateTimeEdit::IsDataChanged() {
if (m_dwStatus & XFA_WidgetStatus_TextEditValueChanged) {
- return TRUE;
+ return true;
}
CFX_WideString wsText;
((CFWL_DateTimePicker*)m_pNormalWidget)->GetEditText(wsText);
@@ -730,49 +726,49 @@ FX_BOOL CXFA_FFDateTimeEdit::IsDataChanged() {
m_pDataAcc->GetValue(wsOldValue, XFA_VALUEPICTURE_Edit);
return wsOldValue != wsText;
}
-FX_BOOL CXFA_FFDateTimeEdit::CanUndo() {
+bool CXFA_FFDateTimeEdit::CanUndo() {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanUndo();
}
-FX_BOOL CXFA_FFDateTimeEdit::CanRedo() {
+bool CXFA_FFDateTimeEdit::CanRedo() {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanRedo();
}
-FX_BOOL CXFA_FFDateTimeEdit::Undo() {
+bool CXFA_FFDateTimeEdit::Undo() {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->Undo();
}
-FX_BOOL CXFA_FFDateTimeEdit::Redo() {
+bool CXFA_FFDateTimeEdit::Redo() {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->Redo();
}
-FX_BOOL CXFA_FFDateTimeEdit::CanCopy() {
+bool CXFA_FFDateTimeEdit::CanCopy() {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanCopy();
}
-FX_BOOL CXFA_FFDateTimeEdit::CanCut() {
+bool CXFA_FFDateTimeEdit::CanCut() {
if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) {
- return FALSE;
+ return false;
}
return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanCut();
}
-FX_BOOL CXFA_FFDateTimeEdit::CanPaste() {
+bool CXFA_FFDateTimeEdit::CanPaste() {
return m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open;
}
-FX_BOOL CXFA_FFDateTimeEdit::CanSelectAll() {
+bool CXFA_FFDateTimeEdit::CanSelectAll() {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanSelectAll();
}
-FX_BOOL CXFA_FFDateTimeEdit::Copy(CFX_WideString& wsCopy) {
+bool CXFA_FFDateTimeEdit::Copy(CFX_WideString& wsCopy) {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->Copy(wsCopy);
}
-FX_BOOL CXFA_FFDateTimeEdit::Cut(CFX_WideString& wsCut) {
+bool CXFA_FFDateTimeEdit::Cut(CFX_WideString& wsCut) {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->Cut(wsCut);
}
-FX_BOOL CXFA_FFDateTimeEdit::Paste(const CFX_WideString& wsPaste) {
+bool CXFA_FFDateTimeEdit::Paste(const CFX_WideString& wsPaste) {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->Paste(wsPaste);
}
-FX_BOOL CXFA_FFDateTimeEdit::SelectAll() {
+bool CXFA_FFDateTimeEdit::SelectAll() {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->SelectAll();
}
-FX_BOOL CXFA_FFDateTimeEdit::Delete() {
+bool CXFA_FFDateTimeEdit::Delete() {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->Delete();
}
-FX_BOOL CXFA_FFDateTimeEdit::DeSelect() {
+bool CXFA_FFDateTimeEdit::DeSelect() {
return ((CFWL_DateTimePicker*)m_pNormalWidget)->DeSelect();
}
void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget* pWidget,
diff --git a/xfa/fxfa/app/xfa_fftextedit.h b/xfa/fxfa/app/xfa_fftextedit.h
index 048008d700..917d6cf17e 100644
--- a/xfa/fxfa/app/xfa_fftextedit.h
+++ b/xfa/fxfa/app/xfa_fftextedit.h
@@ -17,31 +17,31 @@ class CXFA_FFTextEdit : public CXFA_FFField {
~CXFA_FFTextEdit() override;
// CXFA_FFField
- FX_BOOL LoadWidget() override;
+ bool LoadWidget() override;
void UpdateWidgetProperty() override;
- FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget) override;
- FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override;
- FX_BOOL CanUndo() override;
- FX_BOOL CanRedo() override;
- FX_BOOL Undo() override;
- FX_BOOL Redo() override;
- FX_BOOL CanCopy() override;
- FX_BOOL CanCut() override;
- FX_BOOL CanPaste() override;
- FX_BOOL CanSelectAll() override;
- FX_BOOL Copy(CFX_WideString& wsCopy) override;
- FX_BOOL Cut(CFX_WideString& wsCut) override;
- FX_BOOL Paste(const CFX_WideString& wsPaste) override;
- FX_BOOL SelectAll() override;
- FX_BOOL Delete() override;
- FX_BOOL DeSelect() override;
- FX_BOOL GetSuggestWords(CFX_PointF pointf,
- std::vector<CFX_ByteString>& sSuggest) override;
- FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf,
- const CFX_ByteStringC& bsReplace) override;
+ bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override;
+ bool OnSetFocus(CXFA_FFWidget* pOldWidget) override;
+ bool OnKillFocus(CXFA_FFWidget* pNewWidget) override;
+ bool CanUndo() override;
+ bool CanRedo() override;
+ bool Undo() override;
+ bool Redo() override;
+ bool CanCopy() override;
+ bool CanCut() override;
+ bool CanPaste() override;
+ bool CanSelectAll() override;
+ bool Copy(CFX_WideString& wsCopy) override;
+ bool Cut(CFX_WideString& wsCut) override;
+ bool Paste(const CFX_WideString& wsPaste) override;
+ bool SelectAll() override;
+ bool Delete() override;
+ bool DeSelect() override;
+ bool GetSuggestWords(CFX_PointF pointf,
+ std::vector<CFX_ByteString>& sSuggest) override;
+ bool ReplaceSpellCheckWord(CFX_PointF pointf,
+ const CFX_ByteStringC& bsReplace) override;
void OnProcessMessage(CFWL_Message* pMessage) override;
void OnProcessEvent(CFWL_Event* pEvent) override;
void OnDrawWidget(CFX_Graphics* pGraphics,
@@ -51,12 +51,12 @@ class CXFA_FFTextEdit : public CXFA_FFField {
const CFX_WideString& wsChanged,
const CFX_WideString& wsPrevText);
void OnTextFull(IFWL_Widget* pWidget);
- FX_BOOL CheckWord(const CFX_ByteStringC& sWord);
+ bool CheckWord(const CFX_ByteStringC& sWord);
protected:
- FX_BOOL CommitData() override;
- FX_BOOL UpdateFWLData() override;
- FX_BOOL IsDataChanged() override;
+ bool CommitData() override;
+ bool UpdateFWLData() override;
+ bool IsDataChanged() override;
uint32_t GetAlignment();
void ValidateNumberField(const CFX_WideString& wsText);
@@ -70,12 +70,12 @@ class CXFA_FFNumericEdit : public CXFA_FFTextEdit {
~CXFA_FFNumericEdit() override;
// CXFA_FFTextEdit
- FX_BOOL LoadWidget() override;
+ bool LoadWidget() override;
void UpdateWidgetProperty() override;
void OnProcessEvent(CFWL_Event* pEvent) override;
public:
- FX_BOOL OnValidate(IFWL_Widget* pWidget, CFX_WideString& wsText);
+ bool OnValidate(IFWL_Widget* pWidget, CFX_WideString& wsText);
};
class CXFA_FFPasswordEdit : public CXFA_FFTextEdit {
@@ -84,7 +84,7 @@ class CXFA_FFPasswordEdit : public CXFA_FFTextEdit {
~CXFA_FFPasswordEdit() override;
// CXFA_FFTextEdit
- FX_BOOL LoadWidget() override;
+ bool LoadWidget() override;
void UpdateWidgetProperty() override;
protected:
@@ -102,26 +102,26 @@ class CXFA_FFDateTimeEdit : public CXFA_FFTextEdit {
~CXFA_FFDateTimeEdit() override;
// CXFA_FFTextEdit
- FX_BOOL GetBBox(CFX_RectF& rtBox,
- uint32_t dwStatus,
- FX_BOOL bDrawFocus = FALSE) override;
- FX_BOOL LoadWidget() override;
+ bool GetBBox(CFX_RectF& rtBox,
+ uint32_t dwStatus,
+ bool bDrawFocus = false) override;
+ bool LoadWidget() override;
void UpdateWidgetProperty() override;
- FX_BOOL CanUndo() override;
- FX_BOOL CanRedo() override;
- FX_BOOL Undo() override;
- FX_BOOL Redo() override;
- FX_BOOL CanCopy() override;
- FX_BOOL CanCut() override;
- FX_BOOL CanPaste() override;
- FX_BOOL CanSelectAll() override;
- FX_BOOL Copy(CFX_WideString& wsCopy) override;
- FX_BOOL Cut(CFX_WideString& wsCut) override;
- FX_BOOL Paste(const CFX_WideString& wsPaste) override;
- FX_BOOL SelectAll() override;
- FX_BOOL Delete() override;
- FX_BOOL DeSelect() override;
+ bool CanUndo() override;
+ bool CanRedo() override;
+ bool Undo() override;
+ bool Redo() override;
+ bool CanCopy() override;
+ bool CanCut() override;
+ bool CanPaste() override;
+ bool CanSelectAll() override;
+ bool Copy(CFX_WideString& wsCopy) override;
+ bool Cut(CFX_WideString& wsCut) override;
+ bool Paste(const CFX_WideString& wsPaste) override;
+ bool SelectAll() override;
+ bool Delete() override;
+ bool DeSelect() override;
void OnProcessEvent(CFWL_Event* pEvent) override;
void OnSelectChanged(IFWL_Widget* pWidget,
@@ -130,10 +130,10 @@ class CXFA_FFDateTimeEdit : public CXFA_FFTextEdit {
int32_t iDay);
protected:
- FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override;
- FX_BOOL CommitData() override;
- FX_BOOL UpdateFWLData() override;
- FX_BOOL IsDataChanged() override;
+ bool PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override;
+ bool CommitData() override;
+ bool UpdateFWLData() override;
+ bool IsDataChanged() override;
uint32_t GetAlignment();
};
diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp
index a21fbcab62..89b3053b57 100644
--- a/xfa/fxfa/app/xfa_ffwidget.cpp
+++ b/xfa/fxfa/app/xfa_ffwidget.cpp
@@ -91,21 +91,21 @@ void CXFA_FFWidget::ModifyStatus(uint32_t dwAdded, uint32_t dwRemoved) {
m_dwStatus = (m_dwStatus & ~dwRemoved) | dwAdded;
}
-FX_BOOL CXFA_FFWidget::GetBBox(CFX_RectF& rtBox,
- uint32_t dwStatus,
- FX_BOOL bDrawFocus) {
+bool CXFA_FFWidget::GetBBox(CFX_RectF& rtBox,
+ uint32_t dwStatus,
+ bool bDrawFocus) {
if (bDrawFocus)
- return FALSE;
+ return false;
if (m_pPageView)
m_pPageView->GetPageViewRect(rtBox);
- return TRUE;
+ return true;
}
CXFA_WidgetAcc* CXFA_FFWidget::GetDataAcc() {
return m_pDataAcc;
}
-FX_BOOL CXFA_FFWidget::GetToolTip(CFX_WideString& wsToolTip) {
+bool CXFA_FFWidget::GetToolTip(CFX_WideString& wsToolTip) {
if (CXFA_Assist assist = m_pDataAcc->GetAssist()) {
if (CXFA_ToolTip toolTip = assist.GetToolTip()) {
return toolTip.GetTip(wsToolTip);
@@ -131,20 +131,20 @@ void CXFA_FFWidget::RenderWidget(CFX_Graphics* pGS,
DrawBorder(pGS, border, rtBorder, pMatrix);
}
}
-FX_BOOL CXFA_FFWidget::IsLoaded() {
+bool CXFA_FFWidget::IsLoaded() {
return !!m_pPageView;
}
-FX_BOOL CXFA_FFWidget::LoadWidget() {
+bool CXFA_FFWidget::LoadWidget() {
PerformLayout();
- return TRUE;
+ return true;
}
void CXFA_FFWidget::UnloadWidget() {}
-FX_BOOL CXFA_FFWidget::PerformLayout() {
+bool CXFA_FFWidget::PerformLayout() {
ReCacheWidgetRect();
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFWidget::UpdateFWLData() {
- return FALSE;
+bool CXFA_FFWidget::UpdateFWLData() {
+ return false;
}
void CXFA_FFWidget::UpdateWidgetProperty() {}
void CXFA_FFWidget::DrawBorder(CFX_Graphics* pGS,
@@ -176,62 +176,58 @@ void CXFA_FFWidget::AddInvalidateRect(const CFX_RectF* pRect) {
}
m_pDocView->AddInvalidateRect(m_pPageView, rtWidget);
}
-FX_BOOL CXFA_FFWidget::GetCaptionText(CFX_WideString& wsCap) {
+bool CXFA_FFWidget::GetCaptionText(CFX_WideString& wsCap) {
CXFA_TextLayout* pCapTextlayout = m_pDataAcc->GetCaptionTextLayout();
if (!pCapTextlayout) {
- return FALSE;
+ return false;
}
pCapTextlayout->GetText(wsCap);
- return TRUE;
+ return true;
}
bool CXFA_FFWidget::IsFocused() {
return !!(m_dwStatus & XFA_WidgetStatus_Focused);
}
-FX_BOOL CXFA_FFWidget::OnMouseEnter() {
- return FALSE;
+bool CXFA_FFWidget::OnMouseEnter() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::OnMouseExit() {
- return FALSE;
+bool CXFA_FFWidget::OnMouseExit() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::OnLButtonDown(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- return FALSE;
+bool CXFA_FFWidget::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
- return FALSE;
+bool CXFA_FFWidget::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::OnLButtonDblClk(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- return FALSE;
-}
-FX_BOOL CXFA_FFWidget::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
- return FALSE;
-}
-FX_BOOL CXFA_FFWidget::OnMouseWheel(uint32_t dwFlags,
- int16_t zDelta,
+bool CXFA_FFWidget::OnLButtonDblClk(uint32_t dwFlags,
FX_FLOAT fx,
FX_FLOAT fy) {
- return FALSE;
+ return false;
+}
+bool CXFA_FFWidget::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+ return false;
+}
+bool CXFA_FFWidget::OnMouseWheel(uint32_t dwFlags,
+ int16_t zDelta,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::OnRButtonDown(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- return FALSE;
+bool CXFA_FFWidget::OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
- return FALSE;
+bool CXFA_FFWidget::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::OnRButtonDblClk(uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- return FALSE;
+bool CXFA_FFWidget::OnRButtonDblClk(uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::OnSetFocus(CXFA_FFWidget* pOldWidget) {
+bool CXFA_FFWidget::OnSetFocus(CXFA_FFWidget* pOldWidget) {
CXFA_FFWidget* pParent = GetParent();
if (pParent && !pParent->IsAncestorOf(pOldWidget)) {
pParent->OnSetFocus(pOldWidget);
@@ -241,9 +237,9 @@ FX_BOOL CXFA_FFWidget::OnSetFocus(CXFA_FFWidget* pOldWidget) {
eParam.m_eType = XFA_EVENT_Enter;
eParam.m_pTarget = m_pDataAcc;
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Enter, &eParam);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFWidget::OnKillFocus(CXFA_FFWidget* pNewWidget) {
+bool CXFA_FFWidget::OnKillFocus(CXFA_FFWidget* pNewWidget) {
m_dwStatus &= ~XFA_WidgetStatus_Focused;
EventKillFocus();
if (pNewWidget) {
@@ -252,78 +248,78 @@ FX_BOOL CXFA_FFWidget::OnKillFocus(CXFA_FFWidget* pNewWidget) {
pParent->OnKillFocus(pNewWidget);
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFWidget::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) {
- return FALSE;
+bool CXFA_FFWidget::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) {
- return FALSE;
+bool CXFA_FFWidget::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::OnChar(uint32_t dwChar, uint32_t dwFlags) {
- return FALSE;
+bool CXFA_FFWidget::OnChar(uint32_t dwChar, uint32_t dwFlags) {
+ return false;
}
FWL_WidgetHit CXFA_FFWidget::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) {
return FWL_WidgetHit::Unknown;
}
-FX_BOOL CXFA_FFWidget::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) {
- return FALSE;
+bool CXFA_FFWidget::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::CanUndo() {
- return FALSE;
+bool CXFA_FFWidget::CanUndo() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::CanRedo() {
- return FALSE;
+bool CXFA_FFWidget::CanRedo() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::Undo() {
- return FALSE;
+bool CXFA_FFWidget::Undo() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::Redo() {
- return FALSE;
+bool CXFA_FFWidget::Redo() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::CanCopy() {
- return FALSE;
+bool CXFA_FFWidget::CanCopy() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::CanCut() {
- return FALSE;
+bool CXFA_FFWidget::CanCut() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::CanPaste() {
- return FALSE;
+bool CXFA_FFWidget::CanPaste() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::CanSelectAll() {
- return FALSE;
+bool CXFA_FFWidget::CanSelectAll() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::CanDelete() {
+bool CXFA_FFWidget::CanDelete() {
return CanCut();
}
-FX_BOOL CXFA_FFWidget::CanDeSelect() {
+bool CXFA_FFWidget::CanDeSelect() {
return CanCopy();
}
-FX_BOOL CXFA_FFWidget::Copy(CFX_WideString& wsCopy) {
- return FALSE;
+bool CXFA_FFWidget::Copy(CFX_WideString& wsCopy) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::Cut(CFX_WideString& wsCut) {
- return FALSE;
+bool CXFA_FFWidget::Cut(CFX_WideString& wsCut) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::Paste(const CFX_WideString& wsPaste) {
- return FALSE;
+bool CXFA_FFWidget::Paste(const CFX_WideString& wsPaste) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::SelectAll() {
- return FALSE;
+bool CXFA_FFWidget::SelectAll() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::Delete() {
- return FALSE;
+bool CXFA_FFWidget::Delete() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::DeSelect() {
- return FALSE;
+bool CXFA_FFWidget::DeSelect() {
+ return false;
}
-FX_BOOL CXFA_FFWidget::GetSuggestWords(CFX_PointF pointf,
- std::vector<CFX_ByteString>& sSuggest) {
- return FALSE;
+bool CXFA_FFWidget::GetSuggestWords(CFX_PointF pointf,
+ std::vector<CFX_ByteString>& sSuggest) {
+ return false;
}
-FX_BOOL CXFA_FFWidget::ReplaceSpellCheckWord(CFX_PointF pointf,
- const CFX_ByteStringC& bsReplace) {
- return FALSE;
+bool CXFA_FFWidget::ReplaceSpellCheckWord(CFX_PointF pointf,
+ const CFX_ByteStringC& bsReplace) {
+ return false;
}
void CXFA_FFWidget::Rotate2Normal(FX_FLOAT& fx, FX_FLOAT& fy) {
CFX_Matrix mt;
@@ -402,7 +398,7 @@ void CXFA_FFWidget::GetRotateMatrix(CFX_Matrix& mt) {
XFA_ATTRIBUTEENUM at = XFA_ATTRIBUTEENUM_TopLeft;
XFA_GetMatrix(mt, iRotate, at, rcWidget);
}
-FX_BOOL CXFA_FFWidget::IsLayoutRectEmpty() {
+bool CXFA_FFWidget::IsLayoutRectEmpty() {
CFX_RectF rtLayout;
GetRectWithoutRotate(rtLayout);
return rtLayout.width < 0.1f && rtLayout.height < 0.1f;
@@ -419,27 +415,27 @@ CXFA_FFWidget* CXFA_FFWidget::GetParent() {
}
return nullptr;
}
-FX_BOOL CXFA_FFWidget::IsAncestorOf(CXFA_FFWidget* pWidget) {
+bool CXFA_FFWidget::IsAncestorOf(CXFA_FFWidget* pWidget) {
if (!pWidget) {
- return FALSE;
+ return false;
}
CXFA_Node* pNode = m_pDataAcc->GetNode();
CXFA_Node* pChildNode = pWidget->GetDataAcc()->GetNode();
while (pChildNode) {
if (pChildNode == pNode) {
- return TRUE;
+ return true;
}
pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_Parent);
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_FFWidget::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
+bool CXFA_FFWidget::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
CFX_RectF rtWidget;
GetWidgetRect(rtWidget);
if (rtWidget.Contains(fx, fy)) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
CXFA_FFDocView* CXFA_FFWidget::GetDocView() {
return m_pDocView;
@@ -491,10 +487,10 @@ void CXFA_FFWidget::EventKillFocus() {
eParam.m_pTarget = m_pDataAcc;
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Exit, &eParam);
}
-FX_BOOL CXFA_FFWidget::IsButtonDown() {
+bool CXFA_FFWidget::IsButtonDown() {
return (m_dwStatus & XFA_WidgetStatus_ButtonDown) != 0;
}
-void CXFA_FFWidget::SetButtonDown(FX_BOOL bSet) {
+void CXFA_FFWidget::SetButtonDown(bool bSet) {
bSet ? m_dwStatus |= XFA_WidgetStatus_ButtonDown
: m_dwStatus &= ~XFA_WidgetStatus_ButtonDown;
}
@@ -560,17 +556,17 @@ class CXFA_ImageRenderer {
CXFA_ImageRenderer();
~CXFA_ImageRenderer();
- FX_BOOL Start(CFX_RenderDevice* pDevice,
- CFX_DIBSource* pDIBSource,
- FX_ARGB bitmap_argb,
- int bitmap_alpha,
- const CFX_Matrix* pImage2Device,
- uint32_t flags,
- int blendType = FXDIB_BLEND_NORMAL);
- FX_BOOL Continue(IFX_Pause* pPause);
+ bool Start(CFX_RenderDevice* pDevice,
+ CFX_DIBSource* pDIBSource,
+ FX_ARGB bitmap_argb,
+ int bitmap_alpha,
+ const CFX_Matrix* pImage2Device,
+ uint32_t flags,
+ int blendType = FXDIB_BLEND_NORMAL);
+ bool Continue(IFX_Pause* pPause);
protected:
- FX_BOOL StartDIBSource();
+ bool StartDIBSource();
void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
int left,
int top,
@@ -590,8 +586,8 @@ class CXFA_ImageRenderer {
std::unique_ptr<CFX_ImageTransformer> m_pTransformer;
void* m_DeviceHandle;
int32_t m_BlendType;
- FX_BOOL m_Result;
- FX_BOOL m_bPrint;
+ bool m_Result;
+ bool m_bPrint;
};
CXFA_ImageRenderer::CXFA_ImageRenderer()
@@ -603,21 +599,21 @@ CXFA_ImageRenderer::CXFA_ImageRenderer()
m_Flags(0),
m_DeviceHandle(nullptr),
m_BlendType(FXDIB_BLEND_NORMAL),
- m_Result(TRUE),
- m_bPrint(FALSE) {}
+ m_Result(true),
+ m_bPrint(false) {}
CXFA_ImageRenderer::~CXFA_ImageRenderer() {
if (m_DeviceHandle)
m_pDevice->CancelDIBits(m_DeviceHandle);
}
-FX_BOOL CXFA_ImageRenderer::Start(CFX_RenderDevice* pDevice,
- CFX_DIBSource* pDIBSource,
- FX_ARGB bitmap_argb,
- int bitmap_alpha,
- const CFX_Matrix* pImage2Device,
- uint32_t flags,
- int blendType) {
+bool CXFA_ImageRenderer::Start(CFX_RenderDevice* pDevice,
+ CFX_DIBSource* pDIBSource,
+ FX_ARGB bitmap_argb,
+ int bitmap_alpha,
+ const CFX_Matrix* pImage2Device,
+ uint32_t flags,
+ int blendType) {
m_pDevice = pDevice;
m_pDIBSource = pDIBSource;
m_FillArgb = bitmap_argb;
@@ -628,15 +624,15 @@ FX_BOOL CXFA_ImageRenderer::Start(CFX_RenderDevice* pDevice,
return StartDIBSource();
}
-FX_BOOL CXFA_ImageRenderer::StartDIBSource() {
+bool CXFA_ImageRenderer::StartDIBSource() {
if (m_pDevice->StartDIBitsWithBlend(m_pDIBSource, m_BitmapAlpha, m_FillArgb,
&m_ImageMatrix, m_Flags, m_DeviceHandle,
m_BlendType)) {
if (m_DeviceHandle) {
m_Status = 3;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
FX_RECT image_rect = image_rect_f.GetOuterRect();
@@ -645,8 +641,8 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() {
if ((FXSYS_fabs(m_ImageMatrix.b) >= 0.5f || m_ImageMatrix.a == 0) ||
(FXSYS_fabs(m_ImageMatrix.c) >= 0.5f || m_ImageMatrix.d == 0)) {
if (m_bPrint && !(m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
- m_Result = FALSE;
- return FALSE;
+ m_Result = false;
+ return false;
}
CFX_DIBSource* pDib = m_pDIBSource;
if (m_pDIBSource->HasAlpha() &&
@@ -654,8 +650,8 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() {
!(m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) {
m_pCloneConvert.reset(m_pDIBSource->CloneConvert(FXDIB_Rgb));
if (!m_pCloneConvert) {
- m_Result = FALSE;
- return FALSE;
+ m_Result = false;
+ return false;
}
pDib = m_pCloneConvert.get();
}
@@ -665,7 +661,7 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() {
m_pTransformer.reset(
new CFX_ImageTransformer(pDib, &m_ImageMatrix, m_Flags, &clip_box));
m_pTransformer->Start();
- return TRUE;
+ return true;
}
if (m_ImageMatrix.a < 0) {
dest_width = -dest_width;
@@ -680,7 +676,7 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() {
if (m_pDevice->StretchDIBitsWithFlagsAndBlend(
m_pDIBSource, dest_left, dest_top, dest_width, dest_height, m_Flags,
m_BlendType)) {
- return FALSE;
+ return false;
}
}
if (m_pDIBSource->IsAlphaMask()) {
@@ -690,12 +686,12 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() {
if (m_pDevice->StretchBitMaskWithFlags(m_pDIBSource, dest_left, dest_top,
dest_width, dest_height, m_FillArgb,
m_Flags)) {
- return FALSE;
+ return false;
}
}
if (m_bPrint && !(m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
- m_Result = FALSE;
- return TRUE;
+ m_Result = false;
+ return true;
}
FX_RECT clip_box = m_pDevice->GetClipBox();
FX_RECT dest_rect = clip_box;
@@ -707,19 +703,19 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() {
m_pDIBSource->StretchTo(dest_width, dest_height, m_Flags, &dest_clip));
if (pStretched) {
CompositeDIBitmap(pStretched.get(), dest_rect.left, dest_rect.top,
- m_FillArgb, m_BitmapAlpha, m_BlendType, FALSE);
+ m_FillArgb, m_BitmapAlpha, m_BlendType, false);
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_ImageRenderer::Continue(IFX_Pause* pPause) {
+bool CXFA_ImageRenderer::Continue(IFX_Pause* pPause) {
if (m_Status == 2) {
if (m_pTransformer->Continue(pPause))
- return TRUE;
+ return true;
std::unique_ptr<CFX_DIBitmap> pBitmap(m_pTransformer->DetachBitmap());
if (!pBitmap)
- return FALSE;
+ return false;
if (pBitmap->IsAlphaMask()) {
if (m_BitmapAlpha != 255)
@@ -734,12 +730,12 @@ FX_BOOL CXFA_ImageRenderer::Continue(IFX_Pause* pPause) {
pBitmap.get(), m_pTransformer->result().left,
m_pTransformer->result().top, m_BlendType);
}
- return FALSE;
+ return false;
}
if (m_Status == 3)
return m_pDevice->ContinueDIBits(m_DeviceHandle, pPause);
- return FALSE;
+ return false;
}
void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
@@ -773,8 +769,8 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
}
}
}
- FX_BOOL bBackAlphaRequired = blend_mode && bIsolated;
- FX_BOOL bGetBackGround =
+ bool bBackAlphaRequired = blend_mode && bIsolated;
+ bool bGetBackGround =
((m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT)) ||
(!(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT) &&
(m_pDevice->GetRenderCaps() & FXRC_GET_BITS) && !bBackAlphaRequired);
@@ -789,9 +785,9 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
top + pDIBitmap->GetHeight());
rect.Intersect(m_pDevice->GetClipBox());
CFX_DIBitmap* pClone = nullptr;
- FX_BOOL bClone = FALSE;
+ bool bClone = false;
if (m_pDevice->GetBackDrop() && m_pDevice->GetBitmap()) {
- bClone = TRUE;
+ bClone = true;
pClone = m_pDevice->GetBackDrop()->Clone(&rect);
CFX_DIBitmap* pForeBitmap = m_pDevice->GetBitmap();
pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(),
@@ -828,8 +824,8 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
return;
}
CXFA_ImageRenderer imageRender;
- FX_BOOL bRet = imageRender.Start(m_pDevice, pCloneConvert, m_FillArgb,
- m_BitmapAlpha, &m_ImageMatrix, m_Flags);
+ bool bRet = imageRender.Start(m_pDevice, pCloneConvert, m_FillArgb,
+ m_BitmapAlpha, &m_ImageMatrix, m_Flags);
while (bRet) {
bRet = imageRender.Continue(nullptr);
}
@@ -902,8 +898,8 @@ void XFA_DrawImage(CFX_Graphics* pGS,
mtImage.Concat(rtFit.width, 0, 0, rtFit.height, rtFit.left, rtFit.top);
mtImage.Concat(*pMatrix);
CXFA_ImageRenderer imageRender;
- FX_BOOL bRet = imageRender.Start(pRenderDevice, pDIBitmap, 0, 255, &mtImage,
- FXDIB_INTERPOL);
+ bool bRet = imageRender.Start(pRenderDevice, pDIBitmap, 0, 255, &mtImage,
+ FXDIB_INTERPOL);
while (bRet) {
bRet = imageRender.Continue(nullptr);
}
@@ -1046,7 +1042,7 @@ FXCODEC_IMAGE_TYPE XFA_GetImageType(const CFX_WideString& wsType) {
}
CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc* pDoc,
CXFA_Image* pImage,
- FX_BOOL& bNameImage,
+ bool& bNameImage,
int32_t& iImageXDpi,
int32_t& iImageYDpi) {
CFX_WideString wsHref;
@@ -1085,7 +1081,7 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc* pDoc,
CFX_DIBitmap* pBitmap =
pDoc->GetPDFNamedImage(wsURL.AsStringC(), iImageXDpi, iImageYDpi);
if (pBitmap) {
- bNameImage = TRUE;
+ bNameImage = true;
return pBitmap;
}
}
@@ -1095,7 +1091,7 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc* pDoc,
FX_Free(pImageBuffer);
return nullptr;
}
- bNameImage = FALSE;
+ bNameImage = false;
CFX_DIBitmap* pBitmap =
XFA_LoadImageFromBuffer(pImageFileRead, type, iImageXDpi, iImageYDpi);
FX_Free(pImageBuffer);
@@ -1175,7 +1171,7 @@ CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_SeekableReadStream* pImageFileRead,
delete pProgressiveDecoder;
return pBitmap;
}
-void XFA_RectWidthoutMargin(CFX_RectF& rt, const CXFA_Margin& mg, FX_BOOL bUI) {
+void XFA_RectWidthoutMargin(CFX_RectF& rt, const CXFA_Margin& mg, bool bUI) {
if (!mg) {
return;
}
@@ -1191,7 +1187,7 @@ CXFA_FFWidget* XFA_GetWidgetFromLayoutItem(CXFA_LayoutItem* pLayoutItem) {
return static_cast<CXFA_FFWidget*>(pLayoutItem);
return nullptr;
}
-FX_BOOL XFA_IsCreateWidget(XFA_Element eType) {
+bool XFA_IsCreateWidget(XFA_Element eType) {
return eType == XFA_Element::Field || eType == XFA_Element::Draw ||
eType == XFA_Element::Subform || eType == XFA_Element::ExclGroup;
}
@@ -1211,8 +1207,8 @@ static void XFA_BOX_GetPath_Arc(CXFA_Box box,
rtDraw.width = a + a;
rtDraw.height = b + b;
FX_FLOAT startAngle = 0, sweepAngle = 360;
- FX_BOOL bStart = box.GetStartAngle(startAngle);
- FX_BOOL bEnd = box.GetSweepAngle(sweepAngle);
+ bool bStart = box.GetStartAngle(startAngle);
+ bool bEnd = box.GetSweepAngle(sweepAngle);
if (!bStart && !bEnd) {
fillPath.AddEllipse(rtDraw);
return;
@@ -1227,18 +1223,18 @@ static void XFA_BOX_GetPath(CXFA_Box box,
CFX_RectF rtWidget,
CFX_Path& path,
int32_t nIndex,
- FX_BOOL bStart,
- FX_BOOL bCorner) {
+ bool bStart,
+ bool bCorner) {
ASSERT(nIndex >= 0 && nIndex < 8);
int32_t n = (nIndex & 1) ? nIndex - 1 : nIndex;
CXFA_Corner corner1(strokes[n].GetNode());
CXFA_Corner corner2(strokes[(n + 2) % 8].GetNode());
FX_FLOAT fRadius1 = bCorner ? corner1.GetRadius() : 0.0f;
FX_FLOAT fRadius2 = bCorner ? corner2.GetRadius() : 0.0f;
- FX_BOOL bInverted = corner1.IsInverted();
+ bool bInverted = corner1.IsInverted();
FX_FLOAT offsetY = 0.0f;
FX_FLOAT offsetX = 0.0f;
- FX_BOOL bRound = corner1.GetJoinType() == XFA_ATTRIBUTEENUM_Round;
+ bool bRound = corner1.GetJoinType() == XFA_ATTRIBUTEENUM_Round;
FX_FLOAT halfAfter = 0.0f;
FX_FLOAT halfBefore = 0.0f;
CXFA_Stroke stroke = strokes[nIndex];
@@ -1411,12 +1407,12 @@ static void XFA_BOX_GetFillPath(CXFA_Box box,
XFA_BOX_GetPath_Arc(box, rtWidget, fillPath, dwFlags);
return;
}
- FX_BOOL bSameStyles = TRUE;
+ bool bSameStyles = true;
CXFA_Stroke stroke1 = strokes[0];
for (int32_t i = 1; i < 8; i++) {
CXFA_Stroke stroke2 = strokes[i];
if (!stroke1.SameStyles(stroke2)) {
- bSameStyles = FALSE;
+ bSameStyles = false;
break;
}
stroke1 = stroke2;
@@ -1427,7 +1423,7 @@ static void XFA_BOX_GetFillPath(CXFA_Box box,
CXFA_Stroke stroke2 = strokes[i];
if (!stroke1.SameStyles(stroke2, XFA_STROKE_SAMESTYLE_NoPresence |
XFA_STROKE_SAMESTYLE_Corner)) {
- bSameStyles = FALSE;
+ bSameStyles = false;
break;
}
stroke1 = stroke2;
@@ -1435,10 +1431,10 @@ static void XFA_BOX_GetFillPath(CXFA_Box box,
if (bSameStyles) {
stroke1 = strokes[0];
if (stroke1.IsInverted()) {
- bSameStyles = FALSE;
+ bSameStyles = false;
}
if (stroke1.GetJoinType() != XFA_ATTRIBUTEENUM_Square) {
- bSameStyles = FALSE;
+ bSameStyles = false;
}
}
}
@@ -1460,8 +1456,8 @@ static void XFA_BOX_GetFillPath(CXFA_Box box,
CXFA_Corner corner2(strokes[(i + 2) % 8].GetNode());
FX_FLOAT fRadius1 = corner1.GetRadius();
FX_FLOAT fRadius2 = corner2.GetRadius();
- FX_BOOL bInverted = corner1.IsInverted();
- FX_BOOL bRound = corner1.GetJoinType() == XFA_ATTRIBUTEENUM_Round;
+ bool bInverted = corner1.IsInverted();
+ bool bRound = corner1.GetJoinType() == XFA_ATTRIBUTEENUM_Round;
if (bRound) {
sy = FX_PI / 2;
}
@@ -1560,7 +1556,7 @@ static void XFA_BOX_Fill_Radial(CXFA_Box box,
FXSYS_sqrt(rtFill.Width() * rtFill.Width() +
rtFill.Height() * rtFill.Height()) /
2,
- TRUE, TRUE, crStart, crEnd);
+ true, true, crStart, crEnd);
CFX_Color cr(&shading);
pGS->SetFillColor(&cr);
pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix);
@@ -1631,7 +1627,7 @@ static void XFA_BOX_Fill_Linear(CXFA_Box box,
default:
break;
}
- CFX_Shading shading(ptStart, ptEnd, FALSE, FALSE, crStart, crEnd);
+ CFX_Shading shading(ptStart, ptEnd, false, false, crStart, crEnd);
CFX_Color cr(&shading);
pGS->SetFillColor(&cr);
pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix);
@@ -1699,7 +1695,7 @@ static void XFA_BOX_StrokePath(CXFA_Stroke stroke,
if (stroke.IsCorner() && fThickness > 2 * stroke.GetRadius()) {
fThickness = 2 * stroke.GetRadius();
}
- pGS->SetLineWidth(fThickness, TRUE);
+ pGS->SetLineWidth(fThickness, true);
pGS->SetLineCap(CFX_GraphStateData::LineCapButt);
XFA_StrokeTypeSetLineDash(pGS, stroke.GetStrokeType(),
XFA_ATTRIBUTEENUM_Butt);
@@ -1717,7 +1713,7 @@ static void XFA_BOX_StrokeArc(CXFA_Box box,
if (!edge || !edge.IsVisible()) {
return;
}
- FX_BOOL bVisible = FALSE;
+ bool bVisible = false;
FX_FLOAT fThickness = 0;
int32_t i3DType = box.Get3DStyle(bVisible, fThickness);
if (i3DType) {
@@ -1880,7 +1876,7 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box,
CFX_Graphics* pGS,
CFX_RectF rtWidget,
CFX_Matrix* pMatrix) {
- FX_BOOL bVisible = FALSE;
+ bool bVisible = false;
FX_FLOAT fThickness = 0;
int32_t i3DType = box.Get3DStyle(bVisible, fThickness);
if (i3DType) {
@@ -1903,25 +1899,25 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box,
}
return;
}
- FX_BOOL bClose = FALSE;
- FX_BOOL bSameStyles = TRUE;
+ bool bClose = false;
+ bool bSameStyles = true;
CXFA_Stroke stroke1 = strokes[0];
for (int32_t i = 1; i < 8; i++) {
CXFA_Stroke stroke2 = strokes[i];
if (!stroke1.SameStyles(stroke2)) {
- bSameStyles = FALSE;
+ bSameStyles = false;
break;
}
stroke1 = stroke2;
}
if (bSameStyles) {
stroke1 = strokes[0];
- bClose = TRUE;
+ bClose = true;
for (int32_t i = 2; i < 8; i += 2) {
CXFA_Stroke stroke2 = strokes[i];
if (!stroke1.SameStyles(stroke2, XFA_STROKE_SAMESTYLE_NoPresence |
XFA_STROKE_SAMESTYLE_Corner)) {
- bSameStyles = FALSE;
+ bSameStyles = false;
break;
}
stroke1 = stroke2;
@@ -1929,25 +1925,25 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box,
if (bSameStyles) {
stroke1 = strokes[0];
if (stroke1.IsInverted()) {
- bSameStyles = FALSE;
+ bSameStyles = false;
}
if (stroke1.GetJoinType() != XFA_ATTRIBUTEENUM_Square) {
- bSameStyles = FALSE;
+ bSameStyles = false;
}
}
}
- FX_BOOL bStart = TRUE;
+ bool bStart = true;
CFX_Path path;
path.Create();
for (int32_t i = 0; i < 8; i++) {
CXFA_Stroke stroke = strokes[i];
if ((i % 1) == 0 && stroke.GetRadius() < 0) {
- FX_BOOL bEmpty = path.IsEmpty();
+ bool bEmpty = path.IsEmpty();
if (!bEmpty) {
XFA_BOX_StrokePath(stroke, &path, pGS, pMatrix);
path.Clear();
}
- bStart = TRUE;
+ bStart = true;
continue;
}
XFA_BOX_GetPath(box, strokes, rtWidget, path, i, bStart, !bSameStyles);
@@ -1958,7 +1954,7 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box,
path.Clear();
}
}
- FX_BOOL bEmpty = path.IsEmpty();
+ bool bEmpty = path.IsEmpty();
if (!bEmpty) {
if (bClose) {
path.Close();
diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
index a5cfafc5f7..64d76a6d2a 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
@@ -72,7 +72,7 @@ class CXFA_ImageLayoutData : public CXFA_WidgetLayoutData {
public:
CXFA_ImageLayoutData()
: m_pDIBitmap(nullptr),
- m_bNamedImage(FALSE),
+ m_bNamedImage(false),
m_iImageXDpi(0),
m_iImageYDpi(0) {}
@@ -81,17 +81,17 @@ class CXFA_ImageLayoutData : public CXFA_WidgetLayoutData {
delete m_pDIBitmap;
}
- FX_BOOL LoadImageData(CXFA_WidgetAcc* pAcc) {
+ bool LoadImageData(CXFA_WidgetAcc* pAcc) {
if (m_pDIBitmap)
- return TRUE;
+ return true;
CXFA_Value value = pAcc->GetFormValue();
if (!value)
- return FALSE;
+ return false;
CXFA_Image imageObj = value.GetImage();
if (!imageObj)
- return FALSE;
+ return false;
CXFA_FFDoc* pFFDoc = pAcc->GetDoc();
pAcc->SetImageImage(XFA_LoadImageData(pFFDoc, &imageObj, m_bNamedImage,
@@ -100,7 +100,7 @@ class CXFA_ImageLayoutData : public CXFA_WidgetLayoutData {
}
CFX_DIBitmap* m_pDIBitmap;
- FX_BOOL m_bNamedImage;
+ bool m_bNamedImage;
int32_t m_iImageXDpi;
int32_t m_iImageYDpi;
};
@@ -110,16 +110,16 @@ class CXFA_FieldLayoutData : public CXFA_WidgetLayoutData {
CXFA_FieldLayoutData() {}
~CXFA_FieldLayoutData() override {}
- FX_BOOL LoadCaption(CXFA_WidgetAcc* pAcc) {
+ bool LoadCaption(CXFA_WidgetAcc* pAcc) {
if (m_pCapTextLayout)
- return TRUE;
+ return true;
CXFA_Caption caption = pAcc->GetCaption();
if (!caption || caption.GetPresence() == XFA_ATTRIBUTEENUM_Hidden)
- return FALSE;
+ return false;
m_pCapTextProvider.reset(
new CXFA_TextProvider(pAcc, XFA_TEXTPROVIDERTYPE_Caption));
m_pCapTextLayout.reset(new CXFA_TextLayout(m_pCapTextProvider.get()));
- return TRUE;
+ return true;
}
std::unique_ptr<CXFA_TextLayout> m_pCapTextLayout;
@@ -136,7 +136,7 @@ class CXFA_ImageEditData : public CXFA_FieldLayoutData {
public:
CXFA_ImageEditData()
: m_pDIBitmap(nullptr),
- m_bNamedImage(FALSE),
+ m_bNamedImage(false),
m_iImageXDpi(0),
m_iImageYDpi(0) {}
@@ -145,13 +145,13 @@ class CXFA_ImageEditData : public CXFA_FieldLayoutData {
delete m_pDIBitmap;
}
- FX_BOOL LoadImageData(CXFA_WidgetAcc* pAcc) {
+ bool LoadImageData(CXFA_WidgetAcc* pAcc) {
if (m_pDIBitmap)
- return TRUE;
+ return true;
CXFA_Value value = pAcc->GetFormValue();
if (!value)
- return FALSE;
+ return false;
CXFA_Image imageObj = value.GetImage();
CXFA_FFDoc* pFFDoc = pAcc->GetDoc();
@@ -161,7 +161,7 @@ class CXFA_ImageEditData : public CXFA_FieldLayoutData {
}
CFX_DIBitmap* m_pDIBitmap;
- FX_BOOL m_bNamedImage;
+ bool m_bNamedImage;
int32_t m_iImageXDpi;
int32_t m_iImageYDpi;
};
@@ -173,7 +173,7 @@ CXFA_WidgetAcc::CXFA_WidgetAcc(CXFA_FFDocView* pDocView, CXFA_Node* pNode)
CXFA_WidgetAcc::~CXFA_WidgetAcc() {}
-FX_BOOL CXFA_WidgetAcc::GetName(CFX_WideString& wsName, int32_t iNameType) {
+bool CXFA_WidgetAcc::GetName(CFX_WideString& wsName, int32_t iNameType) {
if (iNameType == 0) {
m_pNode->TryCData(XFA_ATTRIBUTE_Name, wsName);
return !wsName.IsEmpty();
@@ -185,17 +185,17 @@ FX_BOOL CXFA_WidgetAcc::GetName(CFX_WideString& wsName, int32_t iNameType) {
wsName.Delete(0, wsPre.GetLength());
}
}
- return TRUE;
+ return true;
}
CXFA_Node* CXFA_WidgetAcc::GetDatasets() {
return m_pNode->GetBindData();
}
-FX_BOOL CXFA_WidgetAcc::ProcessValueChanged() {
+bool CXFA_WidgetAcc::ProcessValueChanged() {
m_pDocView->AddValidateWidget(this);
m_pDocView->AddCalculateWidgetAcc(this);
m_pDocView->RunCalculateWidgets();
m_pDocView->RunValidate();
- return TRUE;
+ return true;
}
void CXFA_WidgetAcc::ResetData() {
CFX_WideString wsValue;
@@ -262,7 +262,7 @@ void CXFA_WidgetAcc::SetImageEdit(const CFX_WideString& wsContentType,
}
CFX_WideString wsFormatValue(wsData);
GetFormatDataValue(wsData, wsFormatValue);
- m_pNode->SetContent(wsData, wsFormatValue, TRUE);
+ m_pNode->SetContent(wsData, wsFormatValue, true);
CXFA_Node* pBind = GetDatasets();
if (!pBind) {
image.SetTransferEncoding(XFA_ATTRIBUTEENUM_Base64);
@@ -369,7 +369,7 @@ int32_t CXFA_WidgetAcc::ProcessCalculate() {
void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate,
int32_t iRet,
CFXJSE_Value* pRetValue,
- FX_BOOL bVersionFlag) {
+ bool bVersionFlag) {
if (iRet == XFA_EVENTERROR_Success && pRetValue) {
if (pRetValue->IsBoolean() && !pRetValue->ToBoolean()) {
IXFA_AppProvider* pAppProvider = GetAppProvider();
@@ -385,7 +385,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate,
if (GetNode()->IsUserInteractive())
return;
if (wsScriptMsg.IsEmpty())
- GetValidateMessage(pAppProvider, wsScriptMsg, FALSE, bVersionFlag);
+ GetValidateMessage(pAppProvider, wsScriptMsg, false, bVersionFlag);
if (bVersionFlag) {
pAppProvider->MsgBox(wsScriptMsg, wsTitle, XFA_MBICON_Warning,
@@ -398,7 +398,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate,
}
} else {
if (wsScriptMsg.IsEmpty()) {
- GetValidateMessage(pAppProvider, wsScriptMsg, TRUE, bVersionFlag);
+ GetValidateMessage(pAppProvider, wsScriptMsg, true, bVersionFlag);
}
pAppProvider->MsgBox(wsScriptMsg, wsTitle, XFA_MBICON_Error, XFA_MB_OK);
}
@@ -406,7 +406,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate,
}
}
int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate,
- FX_BOOL bVersionFlag) {
+ bool bVersionFlag) {
CFX_WideString wsRawValue = GetRawValue();
if (!wsRawValue.IsEmpty()) {
CFX_WideString wsPicture;
@@ -431,7 +431,7 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate,
int32_t eFormatTest = validate.GetFormatTest();
if (eFormatTest == XFA_ATTRIBUTEENUM_Error) {
if (wsFormatMsg.IsEmpty()) {
- GetValidateMessage(pAppProvider, wsFormatMsg, TRUE, bVersionFlag);
+ GetValidateMessage(pAppProvider, wsFormatMsg, true, bVersionFlag);
}
pAppProvider->MsgBox(wsFormatMsg, wsTitle, XFA_MBICON_Error, XFA_MB_OK);
return XFA_EVENTERROR_Success;
@@ -439,7 +439,7 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate,
if (GetNode()->IsUserInteractive())
return XFA_EVENTERROR_NotExist;
if (wsFormatMsg.IsEmpty())
- GetValidateMessage(pAppProvider, wsFormatMsg, FALSE, bVersionFlag);
+ GetValidateMessage(pAppProvider, wsFormatMsg, false, bVersionFlag);
if (bVersionFlag) {
pAppProvider->MsgBox(wsFormatMsg, wsTitle, XFA_MBICON_Warning,
@@ -457,7 +457,7 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate,
}
int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate,
int32_t iFlags,
- FX_BOOL bVersionFlag) {
+ bool bVersionFlag) {
CFX_WideString wsValue;
GetValue(wsValue, XFA_VALUEPICTURE_Raw);
if (!wsValue.IsEmpty()) {
@@ -507,7 +507,7 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate,
}
case XFA_ATTRIBUTEENUM_Warning: {
if (GetNode()->IsUserInteractive())
- return TRUE;
+ return true;
if (wsNullMsg.IsEmpty()) {
GetValidateCaptionName(wsCaptionName, bVersionFlag);
@@ -529,7 +529,7 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate,
return XFA_EVENTERROR_Success;
}
void CXFA_WidgetAcc::GetValidateCaptionName(CFX_WideString& wsCaptionName,
- FX_BOOL bVersionFlag) {
+ bool bVersionFlag) {
if (!bVersionFlag) {
CXFA_Caption caption = GetCaption();
if (caption) {
@@ -548,8 +548,8 @@ void CXFA_WidgetAcc::GetValidateCaptionName(CFX_WideString& wsCaptionName,
}
void CXFA_WidgetAcc::GetValidateMessage(IXFA_AppProvider* pAppProvider,
CFX_WideString& wsMessage,
- FX_BOOL bError,
- FX_BOOL bVersionFlag) {
+ bool bError,
+ bool bVersionFlag) {
CFX_WideString wsCaptionName;
GetValidateCaptionName(wsCaptionName, bVersionFlag);
CFX_WideString wsError;
@@ -576,9 +576,8 @@ int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) {
if (!validate) {
return XFA_EVENTERROR_NotExist;
}
- FX_BOOL bInitDoc = validate.GetNode()->NeedsInitApp();
- FX_BOOL bStatus =
- m_pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End;
+ bool bInitDoc = validate.GetNode()->NeedsInitApp();
+ bool bStatus = m_pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End;
int32_t iFormat = 0;
CFXJSE_Value* pRetValue = nullptr;
int32_t iRet = XFA_EVENTERROR_NotExist;
@@ -593,9 +592,9 @@ int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) {
: &pRetValue);
}
XFA_VERSION version = GetDoc()->GetXFADoc()->GetCurVersionMode();
- FX_BOOL bVersionFlag = FALSE;
+ bool bVersionFlag = false;
if (version < XFA_VERSION_208) {
- bVersionFlag = TRUE;
+ bVersionFlag = true;
}
if (bInitDoc) {
validate.GetNode()->ClearFlag(XFA_NodeFlag_NeedsInitApp);
@@ -647,9 +646,9 @@ int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script,
std::unique_ptr<CFXJSE_Value> pTmpRetValue(
new CFXJSE_Value(pContext->GetRuntime()));
++m_nRecursionDepth;
- FX_BOOL bRet = pContext->RunScript((XFA_SCRIPTLANGTYPE)eScriptType,
- wsExpression.AsStringC(),
- pTmpRetValue.get(), m_pNode);
+ bool bRet = pContext->RunScript((XFA_SCRIPTLANGTYPE)eScriptType,
+ wsExpression.AsStringC(), pTmpRetValue.get(),
+ m_pNode);
--m_nRecursionDepth;
int32_t iRet = XFA_EVENTERROR_Error;
if (bRet) {
@@ -772,7 +771,7 @@ void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) {
}
}
}
-FX_BOOL CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF& size) {
+bool CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF& size) {
CFX_SizeF szCap;
CalcCaptionSize(szCap);
CFX_RectF rtUIMargin;
@@ -799,7 +798,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF& size) {
}
return CalculateWidgetAutoSize(size);
}
-FX_BOOL CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) {
+bool CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) {
CXFA_Margin mgWidget = GetMargin();
if (mgWidget) {
FX_FLOAT fLeftInset, fTopInset, fRightInset, fBottomInset;
@@ -837,7 +836,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) {
size.y = std::min(size.y, fMax);
}
}
- return TRUE;
+ return true;
}
void CXFA_WidgetAcc::CalculateTextContentSize(CFX_SizeF& size) {
FX_FLOAT fFontSize = GetFontSize();
@@ -871,12 +870,12 @@ void CXFA_WidgetAcc::CalculateTextContentSize(CFX_SizeF& size) {
layoutData->m_pTextOut->CalcLogicSize(wsText.c_str(), wsText.GetLength(),
size);
}
-FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) {
+bool CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) {
if (size.x > 0) {
CFX_SizeF szOrz = size;
CFX_SizeF szCap;
CalcCaptionSize(szCap);
- FX_BOOL bCapExit = szCap.x > 0.01 && szCap.y > 0.01;
+ bool bCapExit = szCap.x > 0.01 && szCap.y > 0.01;
int32_t iCapPlacement = XFA_ATTRIBUTEENUM_Unknown;
if (bCapExit) {
iCapPlacement = GetCaption().GetPlacementType();
@@ -923,16 +922,16 @@ FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) {
CalculateTextContentSize(size);
return CalculateFieldAutoSize(size);
}
-FX_BOOL CXFA_WidgetAcc::CalculateCheckButtonAutoSize(CFX_SizeF& size) {
+bool CXFA_WidgetAcc::CalculateCheckButtonAutoSize(CFX_SizeF& size) {
FX_FLOAT fCheckSize = GetCheckButtonSize();
size.x = size.y = fCheckSize;
return CalculateFieldAutoSize(size);
}
-FX_BOOL CXFA_WidgetAcc::CalculatePushButtonAutoSize(CFX_SizeF& size) {
+bool CXFA_WidgetAcc::CalculatePushButtonAutoSize(CFX_SizeF& size) {
CalcCaptionSize(size);
return CalculateWidgetAutoSize(size);
}
-FX_BOOL CXFA_WidgetAcc::CalculateImageAutoSize(CFX_SizeF& size) {
+bool CXFA_WidgetAcc::CalculateImageAutoSize(CFX_SizeF& size) {
if (!GetImageImage()) {
LoadImageImage();
}
@@ -963,7 +962,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateImageAutoSize(CFX_SizeF& size) {
}
return CalculateWidgetAutoSize(size);
}
-FX_BOOL CXFA_WidgetAcc::CalculateImageEditAutoSize(CFX_SizeF& size) {
+bool CXFA_WidgetAcc::CalculateImageEditAutoSize(CFX_SizeF& size) {
if (!GetImageEditImage()) {
LoadImageEditImage();
}
@@ -994,12 +993,12 @@ FX_BOOL CXFA_WidgetAcc::CalculateImageEditAutoSize(CFX_SizeF& size) {
}
return CalculateFieldAutoSize(size);
}
-FX_BOOL CXFA_WidgetAcc::LoadImageImage() {
+bool CXFA_WidgetAcc::LoadImageImage() {
InitLayoutData();
return static_cast<CXFA_ImageLayoutData*>(m_pLayoutData.get())
->LoadImageData(this);
}
-FX_BOOL CXFA_WidgetAcc::LoadImageEditImage() {
+bool CXFA_WidgetAcc::LoadImageEditImage() {
InitLayoutData();
return static_cast<CXFA_ImageEditData*>(m_pLayoutData.get())
->LoadImageData(this);
@@ -1016,7 +1015,7 @@ void CXFA_WidgetAcc::GetImageEditDpi(int32_t& iImageXDpi, int32_t& iImageYDpi) {
iImageXDpi = pData->m_iImageXDpi;
iImageYDpi = pData->m_iImageYDpi;
}
-FX_BOOL CXFA_WidgetAcc::CalculateTextAutoSize(CFX_SizeF& size) {
+bool CXFA_WidgetAcc::CalculateTextAutoSize(CFX_SizeF& size) {
LoadText();
CXFA_TextLayout* pTextLayout =
static_cast<CXFA_TextLayoutData*>(m_pLayoutData.get())->GetTextLayout();
@@ -1156,17 +1155,16 @@ void CXFA_WidgetAcc::CalculateAccWidthAndHeight(XFA_Element eUIType,
m_pLayoutData->m_fWidgetHeight = sz.y;
fCalcHeight = sz.y;
}
-FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex,
- FX_FLOAT& fCalcHeight) {
+bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight) {
XFA_Element eUIType = GetUIType();
if (eUIType == XFA_Element::Subform) {
- return FALSE;
+ return false;
}
if (eUIType != XFA_Element::Text && eUIType != XFA_Element::TextEdit &&
eUIType != XFA_Element::NumericEdit &&
eUIType != XFA_Element::PasswordEdit) {
fCalcHeight = 0;
- return TRUE;
+ return true;
}
FX_FLOAT fTopInset = 0;
FX_FLOAT fBottomInset = 0;
@@ -1198,10 +1196,10 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex,
fCalcHeight = fCalcHeight + fTopInset;
}
if (fabs(fHeight - fCalcHeight) < XFA_FLOAT_PERCISION) {
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
XFA_ATTRIBUTEENUM iCapPlacement = XFA_ATTRIBUTEENUM_Unknown;
FX_FLOAT fCapReserve = 0;
@@ -1214,12 +1212,12 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex,
if (iCapPlacement == XFA_ATTRIBUTEENUM_Top &&
fCalcHeight < fCapReserve + fTopInset) {
fCalcHeight = 0;
- return TRUE;
+ return true;
}
if (iCapPlacement == XFA_ATTRIBUTEENUM_Bottom &&
m_pLayoutData->m_fWidgetHeight - fCapReserve - fBottomInset) {
fCalcHeight = 0;
- return TRUE;
+ return true;
}
if (iCapPlacement != XFA_ATTRIBUTEENUM_Top) {
fCapReserve = 0;
@@ -1251,7 +1249,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex,
fHeight -= pFieldArray->GetAt(i + 2);
}
if (iLinesCount == 0) {
- return FALSE;
+ return false;
}
FX_FLOAT fLineHeight = GetLineHeight();
FX_FLOAT fFontSize = GetFontSize();
@@ -1293,33 +1291,33 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex,
pFieldArray->Add(fStartOffset);
}
XFA_VERSION version = GetDoc()->GetXFADoc()->GetCurVersionMode();
- FX_BOOL bCanSplitNoContent = FALSE;
+ bool bCanSplitNoContent = false;
XFA_ATTRIBUTEENUM eLayoutMode;
GetNode()
->GetNodeItem(XFA_NODEITEM_Parent)
- ->TryEnum(XFA_ATTRIBUTE_Layout, eLayoutMode, TRUE);
+ ->TryEnum(XFA_ATTRIBUTE_Layout, eLayoutMode, true);
if ((eLayoutMode == XFA_ATTRIBUTEENUM_Position ||
eLayoutMode == XFA_ATTRIBUTEENUM_Tb ||
eLayoutMode == XFA_ATTRIBUTEENUM_Row ||
eLayoutMode == XFA_ATTRIBUTEENUM_Table) &&
version > XFA_VERSION_208) {
- bCanSplitNoContent = TRUE;
+ bCanSplitNoContent = true;
}
if ((eLayoutMode == XFA_ATTRIBUTEENUM_Tb ||
eLayoutMode == XFA_ATTRIBUTEENUM_Row ||
eLayoutMode == XFA_ATTRIBUTEENUM_Table) &&
version <= XFA_VERSION_208) {
if (fStartOffset < fCalcHeight) {
- bCanSplitNoContent = TRUE;
+ bCanSplitNoContent = true;
} else {
fCalcHeight = 0;
- return TRUE;
+ return true;
}
}
if (bCanSplitNoContent) {
if ((fCalcHeight - fTopInset - fSpaceAbove < fLineHeight)) {
fCalcHeight = 0;
- return TRUE;
+ return true;
}
if (fStartOffset + XFA_FLOAT_PERCISION >= fCalcHeight) {
if (iFieldSplitCount / 3 == (iBlockIndex + 1)) {
@@ -1329,7 +1327,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex,
pFieldArray->Add(0);
pFieldArray->Add(fCalcHeight);
}
- return FALSE;
+ return false;
}
if (fCalcHeight - fStartOffset < fLineHeight) {
fCalcHeight = fStartOffset;
@@ -1340,7 +1338,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex,
pFieldArray->Add(0);
pFieldArray->Add(fCalcHeight);
}
- return TRUE;
+ return true;
}
FX_FLOAT fTextNum =
fCalcHeight + XFA_FLOAT_PERCISION - fCapReserve - fStartOffset;
@@ -1355,13 +1353,13 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex,
pFieldArray->Add((FX_FLOAT)iLinesCount);
pFieldArray->Add(fCalcHeight);
}
- return FALSE;
+ return false;
}
if (fHeight - fStartOffset - fTextHeight < fFontSize) {
iLineNum -= 1;
if (iLineNum == 0) {
fCalcHeight = 0;
- return TRUE;
+ return true;
}
} else {
iLineNum = (int32_t)(fTextNum / fLineHeight);
@@ -1378,14 +1376,14 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex,
pFieldArray->Add(fSplitHeight);
}
if (fabs(fSplitHeight - fCalcHeight) < XFA_FLOAT_PERCISION) {
- return FALSE;
+ return false;
}
fCalcHeight = fSplitHeight;
- return TRUE;
+ return true;
}
}
fCalcHeight = 0;
- return TRUE;
+ return true;
}
void CXFA_WidgetAcc::InitLayoutData() {
if (m_pLayoutData) {
@@ -1434,7 +1432,7 @@ void CXFA_WidgetAcc::StartTextLayout(FX_FLOAT& fCalcWidth,
}
if (fCalcWidth < 0 && fCalcHeight < 0) {
FX_FLOAT fMaxWidth = -1;
- FX_BOOL bRet = GetWidth(fMaxWidth);
+ bool bRet = GetWidth(fMaxWidth);
if (bRet) {
FX_FLOAT fWidth = GetWidthWithoutMargin(fMaxWidth);
pTextLayout->StartLayout(fWidth);
@@ -1456,7 +1454,7 @@ void CXFA_WidgetAcc::StartTextLayout(FX_FLOAT& fCalcWidth,
pTextLayout->DoLayout(0, fTextHeight, -1, fTextHeight);
fCalcHeight = m_pLayoutData->m_fWidgetHeight;
}
-FX_BOOL CXFA_WidgetAcc::LoadCaption() {
+bool CXFA_WidgetAcc::LoadCaption() {
InitLayoutData();
return static_cast<CXFA_FieldLayoutData*>(m_pLayoutData.get())
->LoadCaption(this);
@@ -1553,15 +1551,15 @@ FX_ARGB CXFA_WidgetAcc::GetTextColor() {
}
return 0xFF000000;
}
-CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) {
- bRichText = FALSE;
+CXFA_Node* CXFA_TextProvider::GetTextNode(bool& bRichText) {
+ bRichText = false;
if (m_pTextNode) {
if (m_pTextNode->GetElementType() == XFA_Element::ExData) {
CFX_WideString wsContentType;
m_pTextNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType,
- FALSE);
+ false);
if (wsContentType == FX_WSTRC(L"text/html")) {
- bRichText = TRUE;
+ bRichText = true;
}
}
return m_pTextNode;
@@ -1575,9 +1573,9 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) {
CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild);
if (pChildNode && pChildNode->GetElementType() == XFA_Element::ExData) {
CFX_WideString wsContentType;
- pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE);
+ pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, false);
if (wsContentType == FX_WSTRC(L"text/html")) {
- bRichText = TRUE;
+ bRichText = true;
}
}
return pChildNode;
@@ -1592,7 +1590,7 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) {
if (pXMLChild->GetType() == FDE_XMLNODE_Element) {
CFDE_XMLElement* pElement = static_cast<CFDE_XMLElement*>(pXMLChild);
if (XFA_RecognizeRichText(pElement)) {
- bRichText = TRUE;
+ bRichText = true;
}
}
}
@@ -1610,9 +1608,9 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) {
CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild);
if (pChildNode && pChildNode->GetElementType() == XFA_Element::ExData) {
CFX_WideString wsContentType;
- pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE);
+ pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, false);
if (wsContentType == FX_WSTRC(L"text/html")) {
- bRichText = TRUE;
+ bRichText = true;
}
}
return pChildNode;
@@ -1655,20 +1653,20 @@ CXFA_Font CXFA_TextProvider::GetFontNode() {
}
return m_pWidgetAcc->GetFont();
}
-FX_BOOL CXFA_TextProvider::IsCheckButtonAndAutoWidth() {
+bool CXFA_TextProvider::IsCheckButtonAndAutoWidth() {
XFA_Element eType = m_pWidgetAcc->GetUIType();
if (eType == XFA_Element::CheckButton) {
FX_FLOAT fWidth = 0;
return !m_pWidgetAcc->GetWidth(fWidth);
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_TextProvider::GetEmbbedObj(FX_BOOL bURI,
- FX_BOOL bRaw,
- const CFX_WideString& wsAttr,
- CFX_WideString& wsValue) {
+bool CXFA_TextProvider::GetEmbbedObj(bool bURI,
+ bool bRaw,
+ const CFX_WideString& wsAttr,
+ CFX_WideString& wsValue) {
if (m_eType != XFA_TEXTPROVIDERTYPE_Text) {
- return FALSE;
+ return false;
}
if (bURI) {
CXFA_Node* pWidgetNode = m_pWidgetAcc->GetNode();
@@ -1689,8 +1687,8 @@ FX_BOOL CXFA_TextProvider::GetEmbbedObj(FX_BOOL bURI,
}
if (pEmbAcc) {
pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.h b/xfa/fxfa/app/xfa_ffwidgetacc.h
index 9261d41ee7..092254b2d8 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.h
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.h
@@ -27,15 +27,15 @@ class CXFA_TextProvider {
}
~CXFA_TextProvider() {}
- CXFA_Node* GetTextNode(FX_BOOL& bRichText);
+ CXFA_Node* GetTextNode(bool& bRichText);
CXFA_Para GetParaNode();
CXFA_Font GetFontNode();
- FX_BOOL IsCheckButtonAndAutoWidth();
+ bool IsCheckButtonAndAutoWidth();
CXFA_FFDoc* GetDocNode() { return m_pWidgetAcc->GetDoc(); }
- FX_BOOL GetEmbbedObj(FX_BOOL bURI,
- FX_BOOL bRaw,
- const CFX_WideString& wsAttr,
- CFX_WideString& wsValue);
+ bool GetEmbbedObj(bool bURI,
+ bool bRaw,
+ const CFX_WideString& wsAttr,
+ CFX_WideString& wsValue);
protected:
CXFA_WidgetAcc* m_pWidgetAcc;
diff --git a/xfa/fxfa/app/xfa_ffwidgethandler.cpp b/xfa/fxfa/app/xfa_ffwidgethandler.cpp
index 854b1ac384..551d8f6595 100644
--- a/xfa/fxfa/app/xfa_ffwidgethandler.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgethandler.cpp
@@ -22,29 +22,29 @@ CXFA_FFWidgetHandler::CXFA_FFWidgetHandler(CXFA_FFDocView* pDocView)
CXFA_FFWidgetHandler::~CXFA_FFWidgetHandler() {}
-FX_BOOL CXFA_FFWidgetHandler::OnMouseEnter(CXFA_FFWidget* hWidget) {
+bool CXFA_FFWidgetHandler::OnMouseEnter(CXFA_FFWidget* hWidget) {
m_pDocView->LockUpdate();
- FX_BOOL bRet = hWidget->OnMouseEnter();
+ bool bRet = hWidget->OnMouseEnter();
m_pDocView->UnlockUpdate();
m_pDocView->UpdateDocView();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnMouseExit(CXFA_FFWidget* hWidget) {
+bool CXFA_FFWidgetHandler::OnMouseExit(CXFA_FFWidget* hWidget) {
m_pDocView->LockUpdate();
- FX_BOOL bRet = hWidget->OnMouseExit();
+ bool bRet = hWidget->OnMouseExit();
m_pDocView->UnlockUpdate();
m_pDocView->UpdateDocView();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnLButtonDown(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFWidgetHandler::OnLButtonDown(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
m_pDocView->LockUpdate();
hWidget->Rotate2Normal(fx, fy);
- FX_BOOL bRet = hWidget->OnLButtonDown(dwFlags, fx, fy);
+ bool bRet = hWidget->OnLButtonDown(dwFlags, fx, fy);
if (bRet && m_pDocView->SetFocus(hWidget)) {
m_pDocView->GetDoc()->GetDocEnvironment()->SetFocusWidget(
m_pDocView->GetDoc(), hWidget);
@@ -54,56 +54,56 @@ FX_BOOL CXFA_FFWidgetHandler::OnLButtonDown(CXFA_FFWidget* hWidget,
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnLButtonUp(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFWidgetHandler::OnLButtonUp(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
m_pDocView->LockUpdate();
hWidget->Rotate2Normal(fx, fy);
- m_pDocView->m_bLayoutEvent = TRUE;
- FX_BOOL bRet = hWidget->OnLButtonUp(dwFlags, fx, fy);
+ m_pDocView->m_bLayoutEvent = true;
+ bool bRet = hWidget->OnLButtonUp(dwFlags, fx, fy);
m_pDocView->UnlockUpdate();
m_pDocView->UpdateDocView();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnLButtonDblClk(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFWidgetHandler::OnLButtonDblClk(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
hWidget->Rotate2Normal(fx, fy);
- FX_BOOL bRet = hWidget->OnLButtonDblClk(dwFlags, fx, fy);
+ bool bRet = hWidget->OnLButtonDblClk(dwFlags, fx, fy);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnMouseMove(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFWidgetHandler::OnMouseMove(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
hWidget->Rotate2Normal(fx, fy);
- FX_BOOL bRet = hWidget->OnMouseMove(dwFlags, fx, fy);
+ bool bRet = hWidget->OnMouseMove(dwFlags, fx, fy);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnMouseWheel(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- int16_t zDelta,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFWidgetHandler::OnMouseWheel(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ int16_t zDelta,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
hWidget->Rotate2Normal(fx, fy);
- FX_BOOL bRet = hWidget->OnMouseWheel(dwFlags, zDelta, fx, fy);
+ bool bRet = hWidget->OnMouseWheel(dwFlags, zDelta, fx, fy);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnRButtonDown(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFWidgetHandler::OnRButtonDown(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
hWidget->Rotate2Normal(fx, fy);
- FX_BOOL bRet = hWidget->OnRButtonDown(dwFlags, fx, fy);
+ bool bRet = hWidget->OnRButtonDown(dwFlags, fx, fy);
if (bRet && m_pDocView->SetFocus(hWidget)) {
m_pDocView->GetDoc()->GetDocEnvironment()->SetFocusWidget(
m_pDocView->GetDoc(), hWidget);
@@ -112,47 +112,47 @@ FX_BOOL CXFA_FFWidgetHandler::OnRButtonDown(CXFA_FFWidget* hWidget,
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnRButtonUp(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFWidgetHandler::OnRButtonUp(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
hWidget->Rotate2Normal(fx, fy);
- FX_BOOL bRet = hWidget->OnRButtonUp(dwFlags, fx, fy);
+ bool bRet = hWidget->OnRButtonUp(dwFlags, fx, fy);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnRButtonDblClk(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFWidgetHandler::OnRButtonDblClk(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
hWidget->Rotate2Normal(fx, fy);
- FX_BOOL bRet = hWidget->OnRButtonDblClk(dwFlags, fx, fy);
+ bool bRet = hWidget->OnRButtonDblClk(dwFlags, fx, fy);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnKeyDown(CXFA_FFWidget* hWidget,
- uint32_t dwKeyCode,
- uint32_t dwFlags) {
- FX_BOOL bRet = hWidget->OnKeyDown(dwKeyCode, dwFlags);
+bool CXFA_FFWidgetHandler::OnKeyDown(CXFA_FFWidget* hWidget,
+ uint32_t dwKeyCode,
+ uint32_t dwFlags) {
+ bool bRet = hWidget->OnKeyDown(dwKeyCode, dwFlags);
m_pDocView->RunInvalidate();
m_pDocView->UpdateDocView();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnKeyUp(CXFA_FFWidget* hWidget,
- uint32_t dwKeyCode,
- uint32_t dwFlags) {
- FX_BOOL bRet = hWidget->OnKeyUp(dwKeyCode, dwFlags);
+bool CXFA_FFWidgetHandler::OnKeyUp(CXFA_FFWidget* hWidget,
+ uint32_t dwKeyCode,
+ uint32_t dwFlags) {
+ bool bRet = hWidget->OnKeyUp(dwKeyCode, dwFlags);
m_pDocView->RunInvalidate();
return bRet;
}
-FX_BOOL CXFA_FFWidgetHandler::OnChar(CXFA_FFWidget* hWidget,
- uint32_t dwChar,
- uint32_t dwFlags) {
- FX_BOOL bRet = hWidget->OnChar(dwChar, dwFlags);
+bool CXFA_FFWidgetHandler::OnChar(CXFA_FFWidget* hWidget,
+ uint32_t dwChar,
+ uint32_t dwFlags) {
+ bool bRet = hWidget->OnChar(dwChar, dwFlags);
m_pDocView->RunInvalidate();
return bRet;
}
@@ -167,9 +167,9 @@ FWL_WidgetHit CXFA_FFWidgetHandler::OnHitTest(CXFA_FFWidget* hWidget,
return hWidget->OnHitTest(fx, fy);
}
-FX_BOOL CXFA_FFWidgetHandler::OnSetCursor(CXFA_FFWidget* hWidget,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+bool CXFA_FFWidgetHandler::OnSetCursor(CXFA_FFWidget* hWidget,
+ FX_FLOAT fx,
+ FX_FLOAT fy) {
hWidget->Rotate2Normal(fx, fy);
return hWidget->OnSetCursor(fx, fy);
}
@@ -177,34 +177,34 @@ FX_BOOL CXFA_FFWidgetHandler::OnSetCursor(CXFA_FFWidget* hWidget,
void CXFA_FFWidgetHandler::RenderWidget(CXFA_FFWidget* hWidget,
CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
- FX_BOOL bHighlight) {
+ bool bHighlight) {
hWidget->RenderWidget(pGS, pMatrix,
bHighlight ? XFA_WidgetStatus_Highlight : 0);
}
-FX_BOOL CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc,
- XFA_EVENTTYPE eEventType) {
+bool CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc,
+ XFA_EVENTTYPE eEventType) {
if (!pWidgetAcc || eEventType == XFA_EVENT_Unknown)
- return FALSE;
+ return false;
if (pWidgetAcc->GetElementType() == XFA_Element::Draw)
- return FALSE;
+ return false;
switch (eEventType) {
case XFA_EVENT_Calculate: {
CXFA_Calculate calc = pWidgetAcc->GetCalculate();
if (!calc)
- return FALSE;
+ return false;
if (calc.GetScript())
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
case XFA_EVENT_Validate: {
CXFA_Validate val = pWidgetAcc->GetValidate();
if (!val)
- return FALSE;
+ return false;
if (val.GetScript())
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
default:
break;
@@ -324,22 +324,22 @@ CXFA_Node* CXFA_FFWidgetHandler::CreatePushButton(CXFA_Node* pParent,
CXFA_Node* pCaption = CreateCopyNode(XFA_Element::Caption, pField);
CXFA_Node* pValue = CreateCopyNode(XFA_Element::Value, pCaption);
CXFA_Node* pText = CreateCopyNode(XFA_Element::Text, pValue);
- pText->SetContent(L"Button", L"Button", FALSE);
+ pText->SetContent(L"Button", L"Button", false);
CXFA_Node* pPara = CreateCopyNode(XFA_Element::Para, pCaption);
- pPara->SetEnum(XFA_ATTRIBUTE_VAlign, XFA_ATTRIBUTEENUM_Middle, FALSE);
- pPara->SetEnum(XFA_ATTRIBUTE_HAlign, XFA_ATTRIBUTEENUM_Center, FALSE);
+ pPara->SetEnum(XFA_ATTRIBUTE_VAlign, XFA_ATTRIBUTEENUM_Middle, false);
+ pPara->SetEnum(XFA_ATTRIBUTE_HAlign, XFA_ATTRIBUTEENUM_Center, false);
CreateFontNode(pCaption);
CXFA_Node* pBorder = CreateCopyNode(XFA_Element::Border, pField);
- pBorder->SetEnum(XFA_ATTRIBUTE_Hand, XFA_ATTRIBUTEENUM_Right, FALSE);
+ pBorder->SetEnum(XFA_ATTRIBUTE_Hand, XFA_ATTRIBUTEENUM_Right, false);
CXFA_Node* pEdge = CreateCopyNode(XFA_Element::Edge, pBorder);
- pEdge->SetEnum(XFA_ATTRIBUTE_Stroke, XFA_ATTRIBUTEENUM_Raised, FALSE);
+ pEdge->SetEnum(XFA_ATTRIBUTE_Stroke, XFA_ATTRIBUTEENUM_Raised, false);
CXFA_Node* pFill = CreateCopyNode(XFA_Element::Fill, pBorder);
CXFA_Node* pColor = CreateCopyNode(XFA_Element::Color, pFill);
- pColor->SetCData(XFA_ATTRIBUTE_Value, L"212, 208, 200", FALSE);
+ pColor->SetCData(XFA_ATTRIBUTE_Value, L"212, 208, 200", false);
CXFA_Node* pBind = CreateCopyNode(XFA_Element::Bind, pField);
pBind->SetEnum(XFA_ATTRIBUTE_Match, XFA_ATTRIBUTEENUM_None);
@@ -419,7 +419,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreatePasswordEdit(CXFA_Node* pParent,
CXFA_Node* pBefore) const {
CXFA_Node* pField = CreateField(XFA_Element::PasswordEdit, pParent, pBefore);
CXFA_Node* pBind = CreateCopyNode(XFA_Element::Bind, pField);
- pBind->SetEnum(XFA_ATTRIBUTE_Match, XFA_ATTRIBUTEENUM_None, FALSE);
+ pBind->SetEnum(XFA_ATTRIBUTE_Match, XFA_ATTRIBUTEENUM_None, false);
return pField;
}
@@ -481,7 +481,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateFormItem(XFA_Element eElement,
CXFA_Node* pParent,
CXFA_Node* pBefore) const {
CXFA_Node* pTemplateParent = pParent ? pParent->GetTemplateNode() : nullptr;
- CXFA_Node* pNewFormItem = pTemplateParent->CloneTemplateToForm(FALSE);
+ CXFA_Node* pNewFormItem = pTemplateParent->CloneTemplateToForm(false);
if (pParent)
pParent->InsertChild(pNewFormItem, pBefore);
return pNewFormItem;
@@ -494,7 +494,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateCopyNode(XFA_Element eElement,
CXFA_Node* pNewNode =
CreateTemplateNode(eElement, pTemplateParent,
pBefore ? pBefore->GetTemplateNode() : nullptr)
- ->Clone(FALSE);
+ ->Clone(false);
if (pParent)
pParent->InsertChild(pNewNode, pBefore);
return pNewNode;
@@ -513,7 +513,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateTemplateNode(XFA_Element eElement,
CXFA_Node* CXFA_FFWidgetHandler::CreateFontNode(CXFA_Node* pParent) const {
CXFA_Node* pFont = CreateCopyNode(XFA_Element::Font, pParent);
- pFont->SetCData(XFA_ATTRIBUTE_Typeface, L"Myriad Pro", FALSE);
+ pFont->SetCData(XFA_ATTRIBUTE_Typeface, L"Myriad Pro", false);
return pFont;
}
@@ -523,16 +523,16 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateMarginNode(CXFA_Node* pParent,
CXFA_Node* pMargin = CreateCopyNode(XFA_Element::Margin, pParent);
if (dwFlags & 0x01)
pMargin->SetMeasure(XFA_ATTRIBUTE_LeftInset,
- CXFA_Measurement(fInsets[0], XFA_UNIT_Pt), FALSE);
+ CXFA_Measurement(fInsets[0], XFA_UNIT_Pt), false);
if (dwFlags & 0x02)
pMargin->SetMeasure(XFA_ATTRIBUTE_TopInset,
- CXFA_Measurement(fInsets[1], XFA_UNIT_Pt), FALSE);
+ CXFA_Measurement(fInsets[1], XFA_UNIT_Pt), false);
if (dwFlags & 0x04)
pMargin->SetMeasure(XFA_ATTRIBUTE_RightInset,
- CXFA_Measurement(fInsets[2], XFA_UNIT_Pt), FALSE);
+ CXFA_Measurement(fInsets[2], XFA_UNIT_Pt), false);
if (dwFlags & 0x08)
pMargin->SetMeasure(XFA_ATTRIBUTE_BottomInset,
- CXFA_Measurement(fInsets[3], XFA_UNIT_Pt), FALSE);
+ CXFA_Measurement(fInsets[3], XFA_UNIT_Pt), false);
return pMargin;
}
diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp
index 6e54c41408..589dcd42f2 100644
--- a/xfa/fxfa/app/xfa_fontmgr.cpp
+++ b/xfa/fxfa/app/xfa_fontmgr.cpp
@@ -2017,7 +2017,7 @@ CFGAS_GEFont* CXFA_FontMgr::GetFont(CXFA_FFDoc* hDoc,
CFGAS_GEFont* pFont = nullptr;
if (pMgr) {
pFont =
- pMgr->GetFont(wsEnglishName.AsStringC(), dwFontStyles, &pPDFFont, TRUE);
+ pMgr->GetFont(wsEnglishName.AsStringC(), dwFontStyles, &pPDFFont, true);
if (pFont)
return pFont;
}
@@ -2027,7 +2027,7 @@ CFGAS_GEFont* CXFA_FontMgr::GetFont(CXFA_FFDoc* hDoc,
if (!pFont && pMgr) {
pPDFFont = nullptr;
pFont = pMgr->GetFont(wsEnglishName.AsStringC(), dwFontStyles, &pPDFFont,
- FALSE);
+ false);
if (pFont)
return pFont;
}
diff --git a/xfa/fxfa/app/xfa_fwladapter.cpp b/xfa/fxfa/app/xfa_fwladapter.cpp
index 693dfaebf4..d827ad101f 100644
--- a/xfa/fxfa/app/xfa_fwladapter.cpp
+++ b/xfa/fxfa/app/xfa_fwladapter.cpp
@@ -27,11 +27,11 @@ FWL_Error CXFA_FWLAdapterWidgetMgr::RepaintWidget(IFWL_Widget* pWidget,
return FWL_Error::Succeeded;
}
-FX_BOOL CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget,
- FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
- const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup) {
+bool CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget,
+ FX_FLOAT fMinHeight,
+ FX_FLOAT fMaxHeight,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup) {
CXFA_FFWidget* pFFWidget =
static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem());
CFX_Matrix mt;
@@ -40,5 +40,5 @@ FX_BOOL CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget,
mt.TransformRect(rtRotateAnchor);
pFFWidget->GetDoc()->GetDocEnvironment()->GetPopupPos(
pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, rtPopup);
- return TRUE;
+ return true;
}
diff --git a/xfa/fxfa/app/xfa_fwladapter.h b/xfa/fxfa/app/xfa_fwladapter.h
index 0fbf0d9ee7..cb10399ae7 100644
--- a/xfa/fxfa/app/xfa_fwladapter.h
+++ b/xfa/fxfa/app/xfa_fwladapter.h
@@ -19,11 +19,11 @@ class CXFA_FWLAdapterWidgetMgr {
~CXFA_FWLAdapterWidgetMgr();
FWL_Error RepaintWidget(IFWL_Widget* pWidget, const CFX_RectF* pRect);
- FX_BOOL GetPopupPos(IFWL_Widget* pWidget,
- FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
- const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup);
+ bool GetPopupPos(IFWL_Widget* pWidget,
+ FX_FLOAT fMinHeight,
+ FX_FLOAT fMaxHeight,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup);
};
#endif // XFA_FXFA_APP_XFA_FWLADAPTER_H_
diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp
index 8a4aadb753..291cc5133a 100644
--- a/xfa/fxfa/app/xfa_textlayout.cpp
+++ b/xfa/fxfa/app/xfa_textlayout.cpp
@@ -23,7 +23,7 @@
#include "xfa/fxfa/xfa_fontmgr.h"
CXFA_CSSTagProvider::CXFA_CSSTagProvider()
- : m_bTagAvailable(FALSE), m_bContent(FALSE) {}
+ : m_bTagAvailable(false), m_bContent(false) {}
CXFA_CSSTagProvider::~CXFA_CSSTagProvider() {}
@@ -112,7 +112,7 @@ void CXFA_TextParser::InitCSSData(CXFA_TextProvider* pTextProvider) {
}
CXFA_LoaderContext::CXFA_LoaderContext()
- : m_bSaveLineHeight(FALSE),
+ : m_bSaveLineHeight(false),
m_fWidth(0),
m_fHeight(0),
m_fLastPos(0),
@@ -341,8 +341,8 @@ void CXFA_TextParser::ParseTagInfo(CFDE_XMLNode* pXMLNode,
tagProvider.SetAttribute(L"style", wsValue);
}
} else if (pXMLNode->GetType() == FDE_XMLNODE_Text) {
- tagProvider.m_bTagAvailable = TRUE;
- tagProvider.m_bContent = TRUE;
+ tagProvider.m_bTagAvailable = true;
+ tagProvider.m_bContent = true;
}
}
@@ -365,13 +365,13 @@ int32_t CXFA_TextParser::CountTabs(IFDE_CSSComputedStyle* pStyle) const {
return 0;
}
-FX_BOOL CXFA_TextParser::IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const {
+bool CXFA_TextParser::IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const {
CFX_WideString wsValue;
if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"xfa-spacerun"), wsValue)) {
wsValue.MakeLower();
return wsValue == FX_WSTRC(L"yes");
}
- return FALSE;
+ return false;
}
CFGAS_GEFont* CXFA_TextParser::GetFont(CXFA_TextProvider* pTextProvider,
IFDE_CSSComputedStyle* pStyle) const {
@@ -520,7 +520,7 @@ FX_FLOAT CXFA_TextParser::GetBaseline(CXFA_TextProvider* pTextProvider,
}
FX_FLOAT CXFA_TextParser::GetLineHeight(CXFA_TextProvider* pTextProvider,
IFDE_CSSComputedStyle* pStyle,
- FX_BOOL bFirst,
+ bool bFirst,
FX_FLOAT fVerScale) const {
FX_FLOAT fLineHeight = 0;
if (pStyle) {
@@ -541,20 +541,20 @@ FX_FLOAT CXFA_TextParser::GetLineHeight(CXFA_TextProvider* pTextProvider,
fLineHeight *= fVerScale;
return fLineHeight;
}
-FX_BOOL CXFA_TextParser::GetEmbbedObj(CXFA_TextProvider* pTextProvider,
- CFDE_XMLNode* pXMLNode,
- CFX_WideString& wsValue) {
+bool CXFA_TextParser::GetEmbbedObj(CXFA_TextProvider* pTextProvider,
+ CFDE_XMLNode* pXMLNode,
+ CFX_WideString& wsValue) {
wsValue.clear();
if (!pXMLNode) {
- return FALSE;
+ return false;
}
- FX_BOOL bRet = FALSE;
+ bool bRet = false;
if (pXMLNode->GetType() == FDE_XMLNODE_Element) {
CFDE_XMLElement* pElement = static_cast<CFDE_XMLElement*>(pXMLNode);
CFX_WideString wsAttr;
pElement->GetString(L"xfa:embed", wsAttr);
if (wsAttr.IsEmpty()) {
- return FALSE;
+ return false;
}
if (wsAttr.GetAt(0) == L'#') {
wsAttr.Delete(0);
@@ -566,9 +566,9 @@ FX_BOOL CXFA_TextParser::GetEmbbedObj(CXFA_TextProvider* pTextProvider,
} else {
ws.MakeLower();
}
- FX_BOOL bURI = (ws == FX_WSTRC(L"uri"));
+ bool bURI = (ws == FX_WSTRC(L"uri"));
if (!bURI && ws != FX_WSTRC(L"som")) {
- return FALSE;
+ return false;
}
ws.clear();
pElement->GetString(L"xfa:embedMode", ws);
@@ -577,9 +577,9 @@ FX_BOOL CXFA_TextParser::GetEmbbedObj(CXFA_TextProvider* pTextProvider,
} else {
ws.MakeLower();
}
- FX_BOOL bRaw = (ws == FX_WSTRC(L"raw"));
+ bool bRaw = (ws == FX_WSTRC(L"raw"));
if (!bRaw && ws != FX_WSTRC(L"formatted")) {
- return FALSE;
+ return false;
}
bRet = pTextProvider->GetEmbbedObj(bURI, bRaw, wsAttr, wsValue);
}
@@ -599,16 +599,15 @@ enum XFA_TABSTOPSSTATUS {
XFA_TABSTOPSSTATUS_Leader,
XFA_TABSTOPSSTATUS_Location,
};
-FX_BOOL CXFA_TextParser::GetTabstops(
- IFDE_CSSComputedStyle* pStyle,
- CXFA_TextTabstopsContext* pTabstopContext) {
+bool CXFA_TextParser::GetTabstops(IFDE_CSSComputedStyle* pStyle,
+ CXFA_TextTabstopsContext* pTabstopContext) {
if (!pStyle || !pTabstopContext) {
- return FALSE;
+ return false;
}
CFX_WideString wsValue;
if (!pStyle->GetCustomStyle(FX_WSTRC(L"xfa-tab-stops"), wsValue) &&
!pStyle->GetCustomStyle(FX_WSTRC(L"tab-stops"), wsValue)) {
- return FALSE;
+ return false;
}
int32_t iLength = wsValue.GetLength();
const FX_WCHAR* pTabStops = wsValue.c_str();
@@ -686,17 +685,17 @@ FX_BOOL CXFA_TextParser::GetTabstops(
FX_FLOAT fPos = ms.ToUnit(XFA_UNIT_Pt);
pTabstopContext->Append(dwHashCode, fPos);
}
- return TRUE;
+ return true;
}
CXFA_TextLayout::CXFA_TextLayout(CXFA_TextProvider* pTextProvider)
- : m_bHasBlock(FALSE),
+ : m_bHasBlock(false),
m_pTextProvider(pTextProvider),
m_pTextDataNode(nullptr),
- m_bRichText(FALSE),
+ m_bRichText(false),
m_iLines(0),
m_fMaxWidth(0),
- m_bBlockContinue(TRUE) {
+ m_bBlockContinue(true) {
ASSERT(m_pTextProvider);
}
@@ -763,7 +762,7 @@ CFDE_XMLNode* CXFA_TextLayout::GetXMLContainerNode() {
}
return pXMLContainer;
}
-CFX_RTFBreak* CXFA_TextLayout::CreateBreak(FX_BOOL bDefault) {
+CFX_RTFBreak* CXFA_TextLayout::CreateBreak(bool bDefault) {
uint32_t dwStyle = FX_RTFLAYOUTSTYLE_ExpandTab;
if (!bDefault) {
dwStyle |= FX_RTFLAYOUTSTYLE_Pagination;
@@ -929,10 +928,10 @@ FX_FLOAT CXFA_TextLayout::GetLayoutHeight() {
if (iCount == 0 && m_pLoader->m_fWidth > 0) {
CFX_SizeF szMax(m_pLoader->m_fWidth, m_pLoader->m_fHeight);
CFX_SizeF szDef;
- m_pLoader->m_bSaveLineHeight = TRUE;
+ m_pLoader->m_bSaveLineHeight = true;
m_pLoader->m_fLastPos = 0;
CalcSize(szMax, szMax, szDef);
- m_pLoader->m_bSaveLineHeight = FALSE;
+ m_pLoader->m_bSaveLineHeight = false;
return szDef.y;
}
FX_FLOAT fHeight = m_pLoader->m_fHeight;
@@ -959,20 +958,20 @@ FX_FLOAT CXFA_TextLayout::StartLayout(FX_FLOAT fWidth) {
if (fWidth < 0) {
CFX_SizeF szMax;
CFX_SizeF szDef;
- m_pLoader->m_bSaveLineHeight = TRUE;
+ m_pLoader->m_bSaveLineHeight = true;
m_pLoader->m_fLastPos = 0;
CalcSize(szMax, szMax, szDef);
- m_pLoader->m_bSaveLineHeight = FALSE;
+ m_pLoader->m_bSaveLineHeight = false;
fWidth = szDef.x;
}
return fWidth;
}
-FX_BOOL CXFA_TextLayout::DoLayout(int32_t iBlockIndex,
- FX_FLOAT& fCalcHeight,
- FX_FLOAT fContentAreaHeight,
- FX_FLOAT fTextHeight) {
+bool CXFA_TextLayout::DoLayout(int32_t iBlockIndex,
+ FX_FLOAT& fCalcHeight,
+ FX_FLOAT fContentAreaHeight,
+ FX_FLOAT fTextHeight) {
if (!m_pLoader) {
- return FALSE;
+ return false;
}
int32_t iBlockCount = m_Blocks.GetSize();
FX_FLOAT fHeight = fTextHeight;
@@ -981,9 +980,9 @@ FX_BOOL CXFA_TextLayout::DoLayout(int32_t iBlockIndex,
}
m_pLoader->m_fHeight = fHeight;
if (fContentAreaHeight < 0) {
- return FALSE;
+ return false;
}
- m_bHasBlock = TRUE;
+ m_bHasBlock = true;
if (iBlockCount == 0 && fHeight > 0) {
fHeight = fTextHeight - GetLayoutHeight();
if (fHeight > 0) {
@@ -1017,7 +1016,7 @@ FX_BOOL CXFA_TextLayout::DoLayout(int32_t iBlockIndex,
FX_FLOAT fLineHeight = m_pLoader->m_lineHeights.ElementAt(i);
if ((i == iLineIndex) && (fLineHeight - fContentAreaHeight > 0.001)) {
fCalcHeight = 0;
- return TRUE;
+ return true;
}
if (fLinePos + fLineHeight - fContentAreaHeight > 0.001) {
if (iBlockCount >= (iBlockIndex + 1) * 2) {
@@ -1038,65 +1037,65 @@ FX_BOOL CXFA_TextLayout::DoLayout(int32_t iBlockIndex,
m_pLoader->m_BlocksHeight.Add(fCalcHeight);
}
}
- return TRUE;
+ return true;
}
fCalcHeight = fLinePos;
- return TRUE;
+ return true;
}
fLinePos += fLineHeight;
}
- return FALSE;
+ return false;
}
int32_t CXFA_TextLayout::CountBlocks() const {
int32_t iCount = m_Blocks.GetSize() / 2;
return iCount > 0 ? iCount : 1;
}
-FX_BOOL CXFA_TextLayout::CalcSize(const CFX_SizeF& minSize,
- const CFX_SizeF& maxSize,
- CFX_SizeF& defaultSize) {
+bool CXFA_TextLayout::CalcSize(const CFX_SizeF& minSize,
+ const CFX_SizeF& maxSize,
+ CFX_SizeF& defaultSize) {
defaultSize.x = maxSize.x;
if (defaultSize.x < 1)
defaultSize.x = 0xFFFF;
- m_pBreak.reset(CreateBreak(FALSE));
+ m_pBreak.reset(CreateBreak(false));
FX_FLOAT fLinePos = 0;
m_iLines = 0;
m_fMaxWidth = 0;
- Loader(defaultSize, fLinePos, FALSE);
+ Loader(defaultSize, fLinePos, false);
if (fLinePos < 0.1f)
fLinePos = m_textParser.GetFontSize(m_pTextProvider, nullptr);
m_pTabstopContext.reset();
defaultSize = CFX_SizeF(m_fMaxWidth, fLinePos);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_TextLayout::Layout(const CFX_SizeF& size, FX_FLOAT* fHeight) {
+bool CXFA_TextLayout::Layout(const CFX_SizeF& size, FX_FLOAT* fHeight) {
if (size.x < 1)
- return FALSE;
+ return false;
Unload();
- m_pBreak.reset(CreateBreak(TRUE));
+ m_pBreak.reset(CreateBreak(true));
if (m_pLoader) {
m_pLoader->m_iTotalLines = -1;
m_pLoader->m_iChar = 0;
}
m_iLines = 0;
FX_FLOAT fLinePos = 0;
- Loader(size, fLinePos, TRUE);
+ Loader(size, fLinePos, true);
UpdateAlign(size.y, fLinePos);
m_pTabstopContext.reset();
if (fHeight)
*fHeight = fLinePos;
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) {
+bool CXFA_TextLayout::Layout(int32_t iBlock) {
if (!m_pLoader || iBlock < 0 || iBlock >= CountBlocks())
- return FALSE;
+ return false;
if (m_pLoader->m_fWidth < 1)
- return FALSE;
+ return false;
m_pLoader->m_iTotalLines = -1;
m_iLines = 0;
@@ -1107,10 +1106,10 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) {
int32_t iBlocksHeightCount = m_pLoader->m_BlocksHeight.GetSize();
iBlocksHeightCount /= 2;
if (iBlock < iBlocksHeightCount)
- return TRUE;
+ return true;
if (iBlock == iBlocksHeightCount) {
Unload();
- m_pBreak.reset(CreateBreak(TRUE));
+ m_pBreak.reset(CreateBreak(true));
fLinePos = m_pLoader->m_fStartLineOffset;
for (int32_t i = 0; i < iBlocksHeightCount; i++) {
fLinePos -= m_pLoader->m_BlocksHeight.ElementAt(i * 2 + 1);
@@ -1118,7 +1117,7 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) {
m_pLoader->m_iChar = 0;
if (iCount > 1)
m_pLoader->m_iTotalLines = m_Blocks.ElementAt(iBlock * 2 + 1);
- Loader(szText, fLinePos, TRUE);
+ Loader(szText, fLinePos, true);
if (iCount == 0 && m_pLoader->m_fStartLineOffset < 0.1f)
UpdateAlign(szText.y, fLinePos);
} else if (m_pTextDataNode) {
@@ -1129,16 +1128,16 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) {
if (m_bRichText) {
CFDE_XMLNode* pContainerNode = GetXMLContainerNode();
if (!pContainerNode) {
- return TRUE;
+ return true;
}
CFDE_XMLNode* pXMLNode = m_pLoader->m_pXMLNode;
if (!pXMLNode)
- return TRUE;
+ return true;
CFDE_XMLNode* pSaveXMLNode = m_pLoader->m_pXMLNode;
for (; pXMLNode;
pXMLNode = pXMLNode->GetNodeItem(CFDE_XMLNode::NextSibling)) {
if (!LoadRichText(pXMLNode, szText, fLinePos, m_pLoader->m_pParentStyle,
- TRUE)) {
+ true)) {
break;
}
}
@@ -1147,7 +1146,7 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) {
if (pXMLNode == pContainerNode)
break;
if (!LoadRichText(pXMLNode, szText, fLinePos, m_pLoader->m_pParentStyle,
- TRUE, nullptr, FALSE)) {
+ true, nullptr, false)) {
break;
}
pSaveXMLNode = pXMLNode;
@@ -1157,7 +1156,7 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) {
for (; pXMLNode;
pXMLNode = pXMLNode->GetNodeItem(CFDE_XMLNode::NextSibling)) {
if (!LoadRichText(pXMLNode, szText, fLinePos,
- m_pLoader->m_pParentStyle, TRUE)) {
+ m_pLoader->m_pParentStyle, true)) {
break;
}
}
@@ -1165,15 +1164,15 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) {
} else {
pNode = m_pLoader->m_pNode;
if (!pNode)
- return TRUE;
- LoadText(pNode, szText, fLinePos, TRUE);
+ return true;
+ LoadText(pNode, szText, fLinePos, true);
}
}
if (iBlock == iCount) {
m_pTabstopContext.reset();
m_pLoader.reset();
}
- return TRUE;
+ return true;
}
void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex) {
if (!m_pLoader) {
@@ -1183,7 +1182,7 @@ void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex) {
if (iCountHeight == 0) {
return;
}
- FX_BOOL bEndItem = TRUE;
+ bool bEndItem = true;
int32_t iBlockCount = m_Blocks.GetSize();
FX_FLOAT fLinePos = m_pLoader->m_fStartLineOffset;
int32_t iLineIndex = 0;
@@ -1206,7 +1205,7 @@ void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex) {
if (fLinePos + fLineHeight - rtText.height > 0.001) {
m_Blocks.Add(iLineIndex);
m_Blocks.Add(i - iLineIndex);
- bEndItem = FALSE;
+ bEndItem = false;
break;
}
fLinePos += fLineHeight;
@@ -1216,15 +1215,15 @@ void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex) {
m_Blocks.Add(i - iLineIndex);
}
}
-FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice,
- const CFX_Matrix& tmDoc2Device,
- const CFX_RectF& rtClip,
- int32_t iBlock) {
+bool CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice,
+ const CFX_Matrix& tmDoc2Device,
+ const CFX_RectF& rtClip,
+ int32_t iBlock) {
if (!pFxDevice)
- return FALSE;
+ return false;
std::unique_ptr<CFDE_RenderDevice> pDevice(
- new CFDE_RenderDevice(pFxDevice, FALSE));
+ new CFDE_RenderDevice(pFxDevice, false));
pDevice->SaveState();
pDevice->SetClipRect(rtClip);
@@ -1303,15 +1302,15 @@ void CXFA_TextLayout::UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom) {
}
}
}
-FX_BOOL CXFA_TextLayout::Loader(const CFX_SizeF& szText,
- FX_FLOAT& fLinePos,
- FX_BOOL bSavePieces) {
+bool CXFA_TextLayout::Loader(const CFX_SizeF& szText,
+ FX_FLOAT& fLinePos,
+ bool bSavePieces) {
if (!m_pAllocator) {
m_pAllocator = IFX_MemoryAllocator::Create(FX_ALLOCTYPE_Static, 256, 0);
}
GetTextDataNode();
if (!m_pTextDataNode)
- return TRUE;
+ return true;
if (m_bRichText) {
CFDE_XMLNode* pXMLContainer = GetXMLContainerNode();
@@ -1327,12 +1326,12 @@ FX_BOOL CXFA_TextLayout::Loader(const CFX_SizeF& szText,
} else {
LoadText(m_pTextDataNode, szText, fLinePos, bSavePieces);
}
- return TRUE;
+ return true;
}
void CXFA_TextLayout::LoadText(CXFA_Node* pNode,
const CFX_SizeF& szText,
FX_FLOAT& fLinePos,
- FX_BOOL bSavePieces) {
+ bool bSavePieces) {
InitBreak(szText.x);
CXFA_Para para = m_pTextProvider->GetParaNode();
FX_FLOAT fSpaceAbove = 0;
@@ -1353,57 +1352,57 @@ void CXFA_TextLayout::LoadText(CXFA_Node* pNode,
}
CFX_WideString wsText = pNode->GetContent();
wsText.TrimRight(L" ");
- FX_BOOL bRet = AppendChar(wsText, fLinePos, fSpaceAbove, bSavePieces);
+ bool bRet = AppendChar(wsText, fLinePos, fSpaceAbove, bSavePieces);
if (bRet && m_pLoader) {
m_pLoader->m_pNode = pNode;
} else {
EndBreak(FX_RTFBREAK_ParagraphBreak, fLinePos, bSavePieces);
}
}
-FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode,
- const CFX_SizeF& szText,
- FX_FLOAT& fLinePos,
- IFDE_CSSComputedStyle* pParentStyle,
- FX_BOOL bSavePieces,
- CXFA_LinkUserData* pLinkData,
- FX_BOOL bEndBreak,
- FX_BOOL bIsOl,
- int32_t iLiCount) {
+bool CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode,
+ const CFX_SizeF& szText,
+ FX_FLOAT& fLinePos,
+ IFDE_CSSComputedStyle* pParentStyle,
+ bool bSavePieces,
+ CXFA_LinkUserData* pLinkData,
+ bool bEndBreak,
+ bool bIsOl,
+ int32_t iLiCount) {
if (!pXMLNode) {
- return FALSE;
+ return false;
}
CXFA_TextParseContext* pContext =
m_textParser.GetParseContextFromMap(pXMLNode);
FDE_CSSDISPLAY eDisplay = FDE_CSSDISPLAY_None;
- FX_BOOL bContentNode = FALSE;
+ bool bContentNode = false;
FX_FLOAT fSpaceBelow = 0;
IFDE_CSSComputedStyle* pStyle = nullptr;
CFX_WideString wsName;
if (bEndBreak) {
- FX_BOOL bCurOl = FALSE;
- FX_BOOL bCurLi = FALSE;
+ bool bCurOl = false;
+ bool bCurLi = false;
CFDE_XMLElement* pElement = nullptr;
if (pContext) {
if (m_bBlockContinue ||
(m_pLoader && pXMLNode == m_pLoader->m_pXMLNode)) {
- m_bBlockContinue = TRUE;
+ m_bBlockContinue = true;
}
if (pXMLNode->GetType() == FDE_XMLNODE_Text) {
- bContentNode = TRUE;
+ bContentNode = true;
} else if (pXMLNode->GetType() == FDE_XMLNODE_Element) {
pElement = static_cast<CFDE_XMLElement*>(pXMLNode);
pElement->GetLocalTagName(wsName);
}
if (wsName == FX_WSTRC(L"ol")) {
- bIsOl = TRUE;
- bCurOl = TRUE;
+ bIsOl = true;
+ bCurOl = true;
}
- if (m_bBlockContinue || bContentNode == FALSE) {
+ if (m_bBlockContinue || bContentNode == false) {
eDisplay = pContext->GetDisplay();
if (eDisplay != FDE_CSSDISPLAY_Block &&
eDisplay != FDE_CSSDISPLAY_Inline &&
eDisplay != FDE_CSSDISPLAY_ListItem) {
- return TRUE;
+ return true;
}
pStyle = m_textParser.ComputeStyle(pXMLNode, pParentStyle);
InitBreak(bContentNode ? pParentStyle : pStyle, eDisplay, szText.x,
@@ -1434,7 +1433,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode,
}
int32_t iTabCount =
m_textParser.CountTabs(bContentNode ? pParentStyle : pStyle);
- FX_BOOL bSpaceRun =
+ bool bSpaceRun =
m_textParser.IsSpaceRun(bContentNode ? pParentStyle : pStyle);
CFX_WideString wsText;
if (bContentNode && iTabCount == 0) {
@@ -1442,7 +1441,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode,
} else if (wsName == FX_WSTRC(L"br")) {
wsText = L'\n';
} else if (wsName == FX_WSTRC(L"li")) {
- bCurLi = TRUE;
+ bCurLi = true;
if (bIsOl) {
wsText.Format(L"%d. ", iLiCount);
} else {
@@ -1499,14 +1498,14 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode,
}
if (pStyle)
pStyle->Release();
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
}
}
}
- FX_BOOL ret = TRUE;
+ bool ret = true;
for (CFDE_XMLNode* pChildNode =
pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild);
pChildNode;
@@ -1516,9 +1515,9 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode,
}
ret = LoadRichText(pChildNode, szText, fLinePos,
pContext ? pStyle : pParentStyle, bSavePieces,
- pLinkData, TRUE, bIsOl, iLiCount);
- if (ret == FALSE) {
- return FALSE;
+ pLinkData, true, bIsOl, iLiCount);
+ if (ret == false) {
+ return false;
}
}
if (m_pLoader) {
@@ -1561,18 +1560,18 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode,
pXMLNode->GetNodeItem(CFDE_XMLNode::NextSibling);
m_pLoader->m_pParentStyle = pParentStyle;
}
- return FALSE;
+ return false;
}
}
}
if (pStyle)
pStyle->Release();
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_TextLayout::AppendChar(const CFX_WideString& wsText,
- FX_FLOAT& fLinePos,
- FX_FLOAT fSpaceAbove,
- FX_BOOL bSavePieces) {
+bool CXFA_TextLayout::AppendChar(const CFX_WideString& wsText,
+ FX_FLOAT& fLinePos,
+ FX_FLOAT fSpaceAbove,
+ bool bSavePieces) {
uint32_t dwStatus = 0;
int32_t iChar = 0;
if (m_pLoader) {
@@ -1589,7 +1588,7 @@ FX_BOOL CXFA_TextLayout::AppendChar(const CFX_WideString& wsText,
if (IsEnd(bSavePieces)) {
if (m_pLoader)
m_pLoader->m_iChar = i;
- return TRUE;
+ return true;
}
if (dwStatus == FX_RTFBREAK_ParagraphBreak && m_bRichText) {
fLinePos += fSpaceAbove;
@@ -1599,16 +1598,16 @@ FX_BOOL CXFA_TextLayout::AppendChar(const CFX_WideString& wsText,
if (m_pLoader) {
m_pLoader->m_iChar = 0;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_TextLayout::IsEnd(FX_BOOL bSavePieces) {
+bool CXFA_TextLayout::IsEnd(bool bSavePieces) {
if (!bSavePieces) {
- return FALSE;
+ return false;
}
if (m_pLoader && m_pLoader->m_iTotalLines > 0) {
return m_iLines >= m_pLoader->m_iTotalLines;
}
- return FALSE;
+ return false;
}
void CXFA_TextLayout::ProcessText(CFX_WideString& wsText) {
int32_t iLen = wsText.GetLength();
@@ -1634,10 +1633,10 @@ void CXFA_TextLayout::ProcessText(CFX_WideString& wsText) {
}
void CXFA_TextLayout::EndBreak(uint32_t dwStatus,
FX_FLOAT& fLinePos,
- FX_BOOL bSavePieces) {
+ bool bSavePieces) {
dwStatus = m_pBreak->EndBreak(dwStatus);
if (dwStatus > FX_RTFBREAK_PieceBreak) {
- AppendTextLine(dwStatus, fLinePos, bSavePieces, TRUE);
+ AppendTextLine(dwStatus, fLinePos, bSavePieces, true);
}
}
void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle* pStyle,
@@ -1660,7 +1659,7 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle* pStyle,
}
if (iCount > 0) {
iTabstopsIndex++;
- m_pTabstopContext->m_bTabstops = TRUE;
+ m_pTabstopContext->m_bTabstops = true;
FX_FLOAT fRight = 0;
if (iPieces > 1) {
XFA_TextPiece* p = pPieceLine->m_textPieces.GetAt(iPieces - 2);
@@ -1690,7 +1689,7 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle* pStyle,
}
m_pTabstopContext->m_fLeft =
std::min(fLeft, m_pTabstopContext->m_fTabWidth);
- m_pTabstopContext->m_bTabstops = FALSE;
+ m_pTabstopContext->m_bTabstops = false;
m_pTabstopContext->m_fTabWidth = 0;
}
pPiece->rtPiece.left -= m_pTabstopContext->m_fLeft;
@@ -1698,8 +1697,8 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle* pStyle,
}
void CXFA_TextLayout::AppendTextLine(uint32_t dwStatus,
FX_FLOAT& fLinePos,
- FX_BOOL bSavePieces,
- FX_BOOL bEndBreak) {
+ bool bSavePieces,
+ bool bEndBreak) {
int32_t iPieces = m_pBreak->CountBreakPieces();
if (iPieces < 1) {
return;
@@ -1865,8 +1864,8 @@ void CXFA_TextLayout::RenderPath(CFDE_RenderDevice* pDevice,
FXTEXT_CHARPOS* pCharPos,
const CFX_Matrix& tmDoc2Device) {
XFA_TextPiece* pPiece = pPieceLine->m_textPieces.GetAt(iPiece);
- FX_BOOL bNoUnderline = pPiece->iUnderline < 1 || pPiece->iUnderline > 2;
- FX_BOOL bNoLineThrough = pPiece->iLineThrough < 1 || pPiece->iLineThrough > 2;
+ bool bNoUnderline = pPiece->iUnderline < 1 || pPiece->iUnderline > 2;
+ bool bNoLineThrough = pPiece->iLineThrough < 1 || pPiece->iLineThrough > 2;
if (bNoUnderline && bNoLineThrough) {
return;
}
@@ -1970,7 +1969,7 @@ void CXFA_TextLayout::RenderPath(CFDE_RenderDevice* pDevice,
int32_t CXFA_TextLayout::GetDisplayPos(const XFA_TextPiece* pPiece,
FXTEXT_CHARPOS* pCharPos,
- FX_BOOL bCharCode) {
+ bool bCharCode) {
if (!pPiece) {
return 0;
}
@@ -1980,10 +1979,10 @@ int32_t CXFA_TextLayout::GetDisplayPos(const XFA_TextPiece* pPiece,
}
return m_pBreak->GetDisplayPos(&tr, pCharPos, bCharCode);
}
-FX_BOOL CXFA_TextLayout::ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ& tr) {
+bool CXFA_TextLayout::ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ& tr) {
int32_t iLength = pPiece->iChars;
if (iLength < 1) {
- return FALSE;
+ return false;
}
tr.pStr = pPiece->pszText;
tr.pFont = pPiece->pFont;
@@ -1997,7 +1996,7 @@ FX_BOOL CXFA_TextLayout::ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ& tr) {
tr.iVerticalScale = pPiece->iVerScale;
tr.dwLayoutStyles = FX_RTFLAYOUTSTYLE_ExpandTab;
tr.iHorizontalScale = pPiece->iHorScale;
- return TRUE;
+ return true;
}
CXFA_LinkUserData::CXFA_LinkUserData(IFX_MemoryAllocator* pAllocator,
@@ -2069,7 +2068,7 @@ CXFA_PieceLine::~CXFA_PieceLine() {}
CXFA_TextTabstopsContext::CXFA_TextTabstopsContext()
: m_iTabCount(0),
m_iTabIndex(-1),
- m_bTabstops(FALSE),
+ m_bTabstops(false),
m_fTabWidth(0),
m_fLeft(0) {}
@@ -2098,7 +2097,7 @@ void CXFA_TextTabstopsContext::RemoveAll() {
void CXFA_TextTabstopsContext::Reset() {
m_iTabIndex = -1;
- m_bTabstops = FALSE;
+ m_bTabstops = false;
m_fTabWidth = 0;
m_fLeft = 0;
}
diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h
index 36bf87d6d9..b299f52904 100644
--- a/xfa/fxfa/app/xfa_textlayout.h
+++ b/xfa/fxfa/app/xfa_textlayout.h
@@ -44,8 +44,8 @@ class CXFA_CSSTagProvider {
m_Attributes.insert({wsAttr, wsValue});
}
- FX_BOOL m_bTagAvailable;
- FX_BOOL m_bContent;
+ bool m_bTagAvailable;
+ bool m_bContent;
protected:
CFX_WideString m_wsTagName;
@@ -83,14 +83,14 @@ class CXFA_TextParser {
IFDE_CSSComputedStyle* CreateRootStyle(CXFA_TextProvider* pTextProvider);
IFDE_CSSComputedStyle* ComputeStyle(CFDE_XMLNode* pXMLNode,
IFDE_CSSComputedStyle* pParentStyle);
- FX_BOOL IsParsed() const { return !!m_pAllocator; }
+ bool IsParsed() const { return !!m_pAllocator; }
int32_t GetVAlign(CXFA_TextProvider* pTextProvider) const;
FX_FLOAT GetTabInterval(IFDE_CSSComputedStyle* pStyle) const;
int32_t CountTabs(IFDE_CSSComputedStyle* pStyle) const;
- FX_BOOL IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const;
- FX_BOOL GetTabstops(IFDE_CSSComputedStyle* pStyle,
- CXFA_TextTabstopsContext* pTabstopContext);
+ bool IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const;
+ bool GetTabstops(IFDE_CSSComputedStyle* pStyle,
+ CXFA_TextTabstopsContext* pTabstopContext);
CFGAS_GEFont* GetFont(CXFA_TextProvider* pTextProvider,
IFDE_CSSComputedStyle* pStyle) const;
FX_FLOAT GetFontSize(CXFA_TextProvider* pTextProvider,
@@ -113,11 +113,11 @@ class CXFA_TextParser {
IFDE_CSSComputedStyle* pStyle) const;
FX_FLOAT GetLineHeight(CXFA_TextProvider* pTextProvider,
IFDE_CSSComputedStyle* pStyle,
- FX_BOOL bFirst,
+ bool bFirst,
FX_FLOAT fVerScale) const;
- FX_BOOL GetEmbbedObj(CXFA_TextProvider* pTextProvider,
- CFDE_XMLNode* pXMLNode,
- CFX_WideString& wsValue);
+ bool GetEmbbedObj(CXFA_TextProvider* pTextProvider,
+ CFDE_XMLNode* pXMLNode,
+ CFX_WideString& wsValue);
CXFA_TextParseContext* GetParseContextFromMap(CFDE_XMLNode* pXMLNode);
protected:
@@ -142,7 +142,7 @@ class CXFA_LoaderContext {
CXFA_LoaderContext();
~CXFA_LoaderContext();
- FX_BOOL m_bSaveLineHeight;
+ bool m_bSaveLineHeight;
FX_FLOAT m_fWidth;
FX_FLOAT m_fHeight;
FX_FLOAT m_fLastPos;
@@ -245,7 +245,7 @@ class CXFA_TextTabstopsContext {
CFX_ArrayTemplate<XFA_TABSTOPS> m_tabstops;
int32_t m_iTabCount;
int32_t m_iTabIndex;
- FX_BOOL m_bTabstops;
+ bool m_bTabstops;
FX_FLOAT m_fTabWidth;
FX_FLOAT m_fLeft;
};
@@ -258,63 +258,63 @@ class CXFA_TextLayout {
int32_t GetText(CFX_WideString& wsText);
FX_FLOAT GetLayoutHeight();
FX_FLOAT StartLayout(FX_FLOAT fWidth = -1);
- FX_BOOL DoLayout(int32_t iBlockIndex,
- FX_FLOAT& fCalcHeight,
- FX_FLOAT fContentAreaHeight = -1,
- FX_FLOAT fTextHeight = -1);
-
- FX_BOOL CalcSize(const CFX_SizeF& minSize,
- const CFX_SizeF& maxSize,
- CFX_SizeF& defaultSize);
- FX_BOOL Layout(const CFX_SizeF& size, FX_FLOAT* fHeight = nullptr);
+ bool DoLayout(int32_t iBlockIndex,
+ FX_FLOAT& fCalcHeight,
+ FX_FLOAT fContentAreaHeight = -1,
+ FX_FLOAT fTextHeight = -1);
+
+ bool CalcSize(const CFX_SizeF& minSize,
+ const CFX_SizeF& maxSize,
+ CFX_SizeF& defaultSize);
+ bool Layout(const CFX_SizeF& size, FX_FLOAT* fHeight = nullptr);
void ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex);
- FX_BOOL DrawString(CFX_RenderDevice* pFxDevice,
- const CFX_Matrix& tmDoc2Device,
- const CFX_RectF& rtClip,
- int32_t iBlock = 0);
- FX_BOOL IsLoaded() const { return m_pieceLines.GetSize() > 0; }
+ bool DrawString(CFX_RenderDevice* pFxDevice,
+ const CFX_Matrix& tmDoc2Device,
+ const CFX_RectF& rtClip,
+ int32_t iBlock = 0);
+ bool IsLoaded() const { return m_pieceLines.GetSize() > 0; }
void Unload();
const CXFA_PieceLineArray* GetPieceLines();
- FX_BOOL m_bHasBlock;
+ bool m_bHasBlock;
CFX_Int32Array m_Blocks;
private:
void GetTextDataNode();
CFDE_XMLNode* GetXMLContainerNode();
- CFX_RTFBreak* CreateBreak(FX_BOOL bDefault);
+ CFX_RTFBreak* CreateBreak(bool bDefault);
void InitBreak(FX_FLOAT fLineWidth);
void InitBreak(IFDE_CSSComputedStyle* pStyle,
FDE_CSSDISPLAY eDisplay,
FX_FLOAT fLineWidth,
CFDE_XMLNode* pXMLNode,
IFDE_CSSComputedStyle* pParentStyle = nullptr);
- FX_BOOL Loader(const CFX_SizeF& szText,
- FX_FLOAT& fLinePos,
- FX_BOOL bSavePieces = TRUE);
+ bool Loader(const CFX_SizeF& szText,
+ FX_FLOAT& fLinePos,
+ bool bSavePieces = true);
void LoadText(CXFA_Node* pNode,
const CFX_SizeF& szText,
FX_FLOAT& fLinePos,
- FX_BOOL bSavePieces);
- FX_BOOL LoadRichText(CFDE_XMLNode* pXMLNode,
- const CFX_SizeF& szText,
- FX_FLOAT& fLinePos,
- IFDE_CSSComputedStyle* pParentStyle,
- FX_BOOL bSavePieces,
- CXFA_LinkUserData* pLinkData = nullptr,
- FX_BOOL bEndBreak = TRUE,
- FX_BOOL bIsOl = FALSE,
- int32_t iLiCount = 0);
- FX_BOOL AppendChar(const CFX_WideString& wsText,
- FX_FLOAT& fLinePos,
- FX_FLOAT fSpaceAbove,
- FX_BOOL bSavePieces);
+ bool bSavePieces);
+ bool LoadRichText(CFDE_XMLNode* pXMLNode,
+ const CFX_SizeF& szText,
+ FX_FLOAT& fLinePos,
+ IFDE_CSSComputedStyle* pParentStyle,
+ bool bSavePieces,
+ CXFA_LinkUserData* pLinkData = nullptr,
+ bool bEndBreak = true,
+ bool bIsOl = false,
+ int32_t iLiCount = 0);
+ bool AppendChar(const CFX_WideString& wsText,
+ FX_FLOAT& fLinePos,
+ FX_FLOAT fSpaceAbove,
+ bool bSavePieces);
void AppendTextLine(uint32_t dwStatus,
FX_FLOAT& fLinePos,
- FX_BOOL bSavePieces,
- FX_BOOL bEndBreak = FALSE);
- void EndBreak(uint32_t dwStatus, FX_FLOAT& fLinePos, FX_BOOL bDefault);
- FX_BOOL IsEnd(FX_BOOL bSavePieces);
+ bool bSavePieces,
+ bool bEndBreak = false);
+ void EndBreak(uint32_t dwStatus, FX_FLOAT& fLinePos, bool bDefault);
+ bool IsEnd(bool bSavePieces);
void ProcessText(CFX_WideString& wsText);
void UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom);
void RenderString(CFDE_RenderDevice* pDevice,
@@ -331,15 +331,15 @@ class CXFA_TextLayout {
const CFX_Matrix& tmDoc2Device);
int32_t GetDisplayPos(const XFA_TextPiece* pPiece,
FXTEXT_CHARPOS* pCharPos,
- FX_BOOL bCharCode = FALSE);
- FX_BOOL ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ& tr);
+ bool bCharCode = false);
+ bool ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ& tr);
void DoTabstops(IFDE_CSSComputedStyle* pStyle, CXFA_PieceLine* pPieceLine);
- FX_BOOL Layout(int32_t iBlock);
+ bool Layout(int32_t iBlock);
int32_t CountBlocks() const;
CXFA_TextProvider* m_pTextProvider;
CXFA_Node* m_pTextDataNode;
- FX_BOOL m_bRichText;
+ bool m_bRichText;
std::unique_ptr<IFX_MemoryAllocator> m_pAllocator;
std::unique_ptr<CFX_RTFBreak> m_pBreak;
std::unique_ptr<CXFA_LoaderContext> m_pLoader;
@@ -348,7 +348,7 @@ class CXFA_TextLayout {
CXFA_TextParser m_textParser;
CXFA_PieceLineArray m_pieceLines;
std::unique_ptr<CXFA_TextTabstopsContext> m_pTabstopContext;
- FX_BOOL m_bBlockContinue;
+ bool m_bBlockContinue;
};
#endif // XFA_FXFA_APP_XFA_TEXTLAYOUT_H_
diff --git a/xfa/fxfa/cxfa_eventparam.h b/xfa/fxfa/cxfa_eventparam.h
index cc548f6e4d..3ba7a8b7f2 100644
--- a/xfa/fxfa/cxfa_eventparam.h
+++ b/xfa/fxfa/cxfa_eventparam.h
@@ -56,14 +56,14 @@ class CXFA_EventParam {
CXFA_WidgetAcc* m_pTarget;
XFA_EVENTTYPE m_eType;
CFX_WideString m_wsResult;
- FX_BOOL m_bCancelAction;
+ bool m_bCancelAction;
int32_t m_iCommitKey;
- FX_BOOL m_bKeyDown;
- FX_BOOL m_bModifier;
- FX_BOOL m_bReenter;
+ bool m_bKeyDown;
+ bool m_bModifier;
+ bool m_bReenter;
int32_t m_iSelEnd;
int32_t m_iSelStart;
- FX_BOOL m_bShift;
+ bool m_bShift;
CFX_WideString m_wsChange;
CFX_WideString m_wsFullText;
CFX_WideString m_wsNewContentType;
@@ -72,7 +72,7 @@ class CXFA_EventParam {
CFX_WideString m_wsPrevText;
CFX_WideString m_wsSoapFaultCode;
CFX_WideString m_wsSoapFaultString;
- FX_BOOL m_bIsFormReady;
+ bool m_bIsFormReady;
int32_t m_iValidateActivities;
};
diff --git a/xfa/fxfa/fm2js/xfa_expression.cpp b/xfa/fxfa/fm2js/xfa_expression.cpp
index 829bf7d74e..4271ae04e2 100644
--- a/xfa/fxfa/fm2js/xfa_expression.cpp
+++ b/xfa/fxfa/fm2js/xfa_expression.cpp
@@ -30,7 +30,7 @@ void CXFA_FMExpression::ToImpliedReturnJS(CFX_WideTextBuf& javascript) {}
CXFA_FMFunctionDefinition::CXFA_FMFunctionDefinition(
uint32_t line,
- FX_BOOL isGlobal,
+ bool isGlobal,
const CFX_WideStringC& wsName,
std::unique_ptr<CFX_WideStringCArray> pArguments,
CFX_ArrayTemplate<CXFA_FMExpression*>* pExpressions)
diff --git a/xfa/fxfa/fm2js/xfa_expression.h b/xfa/fxfa/fm2js/xfa_expression.h
index 88cebdf036..69337350bf 100644
--- a/xfa/fxfa/fm2js/xfa_expression.h
+++ b/xfa/fxfa/fm2js/xfa_expression.h
@@ -42,7 +42,7 @@ class CXFA_FMFunctionDefinition : public CXFA_FMExpression {
// Takes ownership of |pExpressions|.
CXFA_FMFunctionDefinition(
uint32_t line,
- FX_BOOL isGlobal,
+ bool isGlobal,
const CFX_WideStringC& wsName,
std::unique_ptr<CFX_WideStringCArray> pArguments,
CFX_ArrayTemplate<CXFA_FMExpression*>* pExpressions);
@@ -55,7 +55,7 @@ class CXFA_FMFunctionDefinition : public CXFA_FMExpression {
CFX_WideStringC m_wsName;
std::unique_ptr<CFX_WideStringCArray> m_pArguments;
CFX_ArrayTemplate<CXFA_FMExpression*>* m_pExpressions;
- FX_BOOL m_isGlobal;
+ bool m_isGlobal;
};
class CXFA_FMVarExpression : public CXFA_FMExpression {
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
index 8a7849f873..947ef7941e 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -377,8 +377,8 @@ void AlternateDateTimeSymbols(CFX_WideString& wsPattern,
const CFX_WideString& wsAltSymbols,
const uint8_t* pAltTable) {
int32_t nLength = wsPattern.GetLength();
- FX_BOOL bInConstRange = FALSE;
- FX_BOOL bEscape = FALSE;
+ bool bInConstRange = false;
+ bool bEscape = false;
int32_t i = 0;
while (i < nLength) {
FX_WCHAR wc = wsPattern[i];
@@ -399,7 +399,7 @@ void AlternateDateTimeSymbols(CFX_WideString& wsPattern,
wsPattern.SetAt(i, wsAltSymbols[nAlt]);
}
i++;
- bEscape = FALSE;
+ bEscape = false;
}
}
@@ -442,7 +442,7 @@ bool PatternStringType(const CFX_ByteStringC& szPattern,
const FX_WCHAR* pData = wsPattern.c_str();
int32_t iLength = wsPattern.GetLength();
int32_t iIndex = 0;
- FX_BOOL bSingleQuotation = FALSE;
+ bool bSingleQuotation = false;
FX_WCHAR patternChar;
while (iIndex < iLength) {
patternChar = pData[iIndex];
@@ -1233,7 +1233,7 @@ void CXFA_FM2JSContext::LocalDateFmt(CFXJSE_Value* pThis,
}
CFX_ByteString formatStr;
- GetLocalDateFormat(pThis, iStyle, szLocal.AsStringC(), formatStr, FALSE);
+ GetLocalDateFormat(pThis, iStyle, szLocal.AsStringC(), formatStr, false);
args.GetReturnValue()->SetString(formatStr.AsStringC());
}
@@ -1271,7 +1271,7 @@ void CXFA_FM2JSContext::LocalTimeFmt(CFXJSE_Value* pThis,
}
CFX_ByteString formatStr;
- GetLocalTimeFormat(pThis, iStyle, szLocal.AsStringC(), formatStr, FALSE);
+ GetLocalTimeFormat(pThis, iStyle, szLocal.AsStringC(), formatStr, false);
args.GetReturnValue()->SetString(formatStr.AsStringC());
}
@@ -1461,7 +1461,7 @@ void CXFA_FM2JSContext::Num2GMTime(CFXJSE_Value* pThis,
CFX_ByteString szGMTTimeString;
Num2AllTime(pThis, iTime, formatString.AsStringC(), localString.AsStringC(),
- TRUE, szGMTTimeString);
+ true, szGMTTimeString);
args.GetReturnValue()->SetString(szGMTTimeString.AsStringC());
}
@@ -1509,7 +1509,7 @@ void CXFA_FM2JSContext::Num2Time(CFXJSE_Value* pThis,
CFX_ByteString szLocalTimeString;
Num2AllTime(pThis, (int32_t)fTime, formatString.AsStringC(),
- localString.AsStringC(), FALSE, szLocalTimeString);
+ localString.AsStringC(), false, szLocalTimeString);
args.GetReturnValue()->SetString(szLocalTimeString.AsStringC());
}
@@ -1661,31 +1661,31 @@ void CXFA_FM2JSContext::TimeFmt(CFXJSE_Value* pThis,
}
// static
-FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(const FX_CHAR* pData,
- int32_t iLength,
- int32_t& iStyle,
- int32_t& iYear,
- int32_t& iMonth,
- int32_t& iDay) {
+bool CXFA_FM2JSContext::IsIsoDateFormat(const FX_CHAR* pData,
+ int32_t iLength,
+ int32_t& iStyle,
+ int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay) {
iYear = 0;
iMonth = 1;
iDay = 1;
if (iLength < 4)
- return FALSE;
+ return false;
FX_CHAR strYear[5];
strYear[4] = '\0';
for (int32_t i = 0; i < 4; ++i) {
if (pData[i] > '9' || pData[i] < '0')
- return FALSE;
+ return false;
strYear[i] = pData[i];
}
iYear = FXSYS_atoi(strYear);
iStyle = 0;
if (iLength == 4)
- return TRUE;
+ return true;
iStyle = pData[4] == '-' ? 1 : 0;
@@ -1694,60 +1694,60 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(const FX_CHAR* pData,
int32_t iPosOff = iStyle == 0 ? 4 : 5;
if ((pData[iPosOff] > '9' || pData[iPosOff] < '0') ||
(pData[iPosOff + 1] > '9' || pData[iPosOff + 1] < '0'))
- return FALSE;
+ return false;
strTemp[0] = pData[iPosOff];
strTemp[1] = pData[iPosOff + 1];
iMonth = FXSYS_atoi(strTemp);
if (iMonth > 12 || iMonth < 1)
- return FALSE;
+ return false;
if (iStyle == 0) {
iPosOff += 2;
if (iLength == 6)
- return TRUE;
+ return true;
} else {
iPosOff += 3;
if (iLength == 7)
- return TRUE;
+ return true;
}
if ((pData[iPosOff] > '9' || pData[iPosOff] < '0') ||
(pData[iPosOff + 1] > '9' || pData[iPosOff + 1] < '0'))
- return FALSE;
+ return false;
strTemp[0] = pData[iPosOff];
strTemp[1] = pData[iPosOff + 1];
iDay = FXSYS_atoi(strTemp);
if (iPosOff + 2 < iLength)
- return FALSE;
+ return false;
if ((!(iYear % 4) && (iYear % 100)) || !(iYear % 400)) {
if (iMonth == 2 && iDay > 29)
- return FALSE;
+ return false;
} else {
if (iMonth == 2 && iDay > 28)
- return FALSE;
+ return false;
}
if (iMonth != 2) {
if (iMonth < 8) {
if (iDay > (iMonth % 2 == 0 ? 30 : 31))
- return FALSE;
+ return false;
} else if (iDay > (iMonth % 2 == 0 ? 31 : 30)) {
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
// static
-FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(const FX_CHAR* pData,
- int32_t iLength,
- int32_t& iHour,
- int32_t& iMinute,
- int32_t& iSecond,
- int32_t& iMilliSecond,
- int32_t& iZoneHour,
- int32_t& iZoneMinute) {
+bool CXFA_FM2JSContext::IsIsoTimeFormat(const FX_CHAR* pData,
+ int32_t iLength,
+ int32_t& iHour,
+ int32_t& iMinute,
+ int32_t& iSecond,
+ int32_t& iMilliSecond,
+ int32_t& iZoneHour,
+ int32_t& iZoneMinute) {
iHour = 0;
iMinute = 0;
iSecond = 0;
@@ -1755,7 +1755,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(const FX_CHAR* pData,
iZoneHour = 0;
iZoneMinute = 0;
if (!pData)
- return FALSE;
+ return false;
FX_CHAR strTemp[3];
strTemp[2] = '\0';
@@ -1778,15 +1778,15 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(const FX_CHAR* pData,
break;
if (pData[iIndex] > '9' || pData[iIndex] < '0')
- return FALSE;
+ return false;
strTemp[0] = pData[iIndex];
if (pData[iIndex + 1] > '9' || pData[iIndex + 1] < '0')
- return FALSE;
+ return false;
strTemp[1] = pData[iIndex + 1];
if (FXSYS_atoi(strTemp) > 60)
- return FALSE;
+ return false;
if (pData[2] == ':') {
if (iPos == 0) {
@@ -1818,26 +1818,26 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(const FX_CHAR* pData,
FX_CHAR strSec[4];
strSec[3] = '\0';
if (pData[iIndex] > '9' || pData[iIndex] < '0')
- return FALSE;
+ return false;
strSec[0] = pData[iIndex];
if (pData[iIndex + 1] > '9' || pData[iIndex + 1] < '0')
- return FALSE;
+ return false;
strSec[1] = pData[iIndex + 1];
if (pData[iIndex + 2] > '9' || pData[iIndex + 2] < '0')
- return FALSE;
+ return false;
strSec[2] = pData[iIndex + 2];
iMilliSecond = FXSYS_atoi(strSec);
if (iMilliSecond > 100) {
iMilliSecond = 0;
- return FALSE;
+ return false;
}
iIndex += 3;
}
if (pData[iIndex] == 'z' || pData[iIndex] == 'Z')
- return TRUE;
+ return true;
int32_t iSign = 1;
if (pData[iIndex] == '+') {
@@ -1849,17 +1849,17 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(const FX_CHAR* pData,
iPos = 0;
while (iIndex < iLength) {
if (iIndex >= iLength)
- return FALSE;
+ return false;
if (pData[iIndex] > '9' || pData[iIndex] < '0')
- return FALSE;
+ return false;
strTemp[0] = pData[iIndex];
if (pData[iIndex + 1] > '9' || pData[iIndex + 1] < '0')
- return FALSE;
+ return false;
strTemp[1] = pData[iIndex + 1];
if (FXSYS_atoi(strTemp) > 60)
- return FALSE;
+ return false;
if (pData[2] == ':') {
if (iPos == 0) {
@@ -1880,24 +1880,24 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(const FX_CHAR* pData,
}
}
if (iIndex < iLength)
- return FALSE;
+ return false;
iZoneHour *= iSign;
- return TRUE;
+ return true;
}
// static
-FX_BOOL CXFA_FM2JSContext::IsIsoDateTimeFormat(const FX_CHAR* pData,
- int32_t iLength,
- int32_t& iYear,
- int32_t& iMonth,
- int32_t& iDay,
- int32_t& iHour,
- int32_t& iMinute,
- int32_t& iSecond,
- int32_t& iMillionSecond,
- int32_t& iZoneHour,
- int32_t& iZoneMinute) {
+bool CXFA_FM2JSContext::IsIsoDateTimeFormat(const FX_CHAR* pData,
+ int32_t iLength,
+ int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay,
+ int32_t& iHour,
+ int32_t& iMinute,
+ int32_t& iSecond,
+ int32_t& iMillionSecond,
+ int32_t& iZoneHour,
+ int32_t& iZoneMinute) {
iYear = 0;
iMonth = 0;
iDay = 0;
@@ -1905,45 +1905,45 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateTimeFormat(const FX_CHAR* pData,
iMinute = 0;
iSecond = 0;
if (!pData)
- return FALSE;
+ return false;
int32_t iIndex = 0;
while (pData[iIndex] != 'T' && pData[iIndex] != 't') {
if (iIndex >= iLength)
- return FALSE;
+ return false;
++iIndex;
}
if (iIndex != 8 && iIndex != 10)
- return FALSE;
+ return false;
int32_t iStyle = -1;
if (!IsIsoDateFormat(pData, iIndex, iStyle, iYear, iMonth, iDay))
- return FALSE;
+ return false;
if (pData[iIndex] != 'T' && pData[iIndex] != 't')
- return TRUE;
+ return true;
++iIndex;
if (((iLength - iIndex > 13) && (iLength - iIndex < 6)) &&
(iLength - iIndex != 15)) {
- return TRUE;
+ return true;
}
if (!IsIsoTimeFormat(pData + iIndex, iLength - iIndex, iHour, iMinute,
iSecond, iMillionSecond, iZoneHour, iZoneMinute)) {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
// static
-FX_BOOL CXFA_FM2JSContext::Local2IsoDate(CFXJSE_Value* pThis,
- const CFX_ByteStringC& szDate,
- const CFX_ByteStringC& szFormat,
- const CFX_ByteStringC& szLocale,
- CFX_ByteString& strIsoDate) {
+bool CXFA_FM2JSContext::Local2IsoDate(CFXJSE_Value* pThis,
+ const CFX_ByteStringC& szDate,
+ const CFX_ByteStringC& szFormat,
+ const CFX_ByteStringC& szLocale,
+ CFX_ByteString& strIsoDate) {
CXFA_Document* pDoc = ToJSContext(pThis, nullptr)->GetDocument();
if (!pDoc)
- return FALSE;
+ return false;
CXFA_LocaleMgr* pMgr = pDoc->GetLocalMgr();
IFX_Locale* pLocale = nullptr;
@@ -1957,7 +1957,7 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoDate(CFXJSE_Value* pThis,
pLocale = pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale));
}
if (!pLocale)
- return FALSE;
+ return false;
CFX_WideString wsFormat;
if (szFormat.IsEmpty())
@@ -1969,18 +1969,18 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoDate(CFXJSE_Value* pThis,
wsFormat, pLocale, pMgr);
CFX_Unitime dt = widgetValue.GetDate();
strIsoDate.Format("%4d-%02d-%02d", dt.GetYear(), dt.GetMonth(), dt.GetDay());
- return TRUE;
+ return true;
}
// static
-FX_BOOL CXFA_FM2JSContext::Local2IsoTime(CFXJSE_Value* pThis,
- const CFX_ByteStringC& szTime,
- const CFX_ByteStringC& szFormat,
- const CFX_ByteStringC& szLocale,
- CFX_ByteString& strIsoTime) {
+bool CXFA_FM2JSContext::Local2IsoTime(CFXJSE_Value* pThis,
+ const CFX_ByteStringC& szTime,
+ const CFX_ByteStringC& szFormat,
+ const CFX_ByteStringC& szLocale,
+ CFX_ByteString& strIsoTime) {
CXFA_Document* pDoc = ToJSContext(pThis, nullptr)->GetDocument();
if (!pDoc)
- return FALSE;
+ return false;
CXFA_LocaleMgr* pMgr = pDoc->GetLocalMgr();
IFX_Locale* pLocale = nullptr;
@@ -1994,7 +1994,7 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoTime(CFXJSE_Value* pThis,
pLocale = pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale));
}
if (!pLocale)
- return FALSE;
+ return false;
CFX_WideString wsFormat;
if (szFormat.IsEmpty())
@@ -2008,18 +2008,18 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoTime(CFXJSE_Value* pThis,
CFX_Unitime utime = widgetValue.GetTime();
strIsoTime.Format("%02d:%02d:%02d.%03d", utime.GetHour(), utime.GetMinute(),
utime.GetSecond(), utime.GetMillisecond());
- return TRUE;
+ return true;
}
// static
-FX_BOOL CXFA_FM2JSContext::IsoDate2Local(CFXJSE_Value* pThis,
- const CFX_ByteStringC& szDate,
- const CFX_ByteStringC& szFormat,
- const CFX_ByteStringC& szLocale,
- CFX_ByteString& strLocalDate) {
+bool CXFA_FM2JSContext::IsoDate2Local(CFXJSE_Value* pThis,
+ const CFX_ByteStringC& szDate,
+ const CFX_ByteStringC& szFormat,
+ const CFX_ByteStringC& szLocale,
+ CFX_ByteString& strLocalDate) {
CXFA_Document* pDoc = ToJSContext(pThis, nullptr)->GetDocument();
if (!pDoc)
- return FALSE;
+ return false;
CXFA_LocaleMgr* pMgr = pDoc->GetLocalMgr();
IFX_Locale* pLocale = nullptr;
@@ -2032,7 +2032,7 @@ FX_BOOL CXFA_FM2JSContext::IsoDate2Local(CFXJSE_Value* pThis,
pLocale = pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale));
}
if (!pLocale)
- return FALSE;
+ return false;
CFX_WideString wsFormat;
if (szFormat.IsEmpty())
@@ -2046,18 +2046,18 @@ FX_BOOL CXFA_FM2JSContext::IsoDate2Local(CFXJSE_Value* pThis,
widgetValue.FormatPatterns(wsRet, wsFormat, pLocale,
XFA_VALUEPICTURE_Display);
strLocalDate = FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength());
- return TRUE;
+ return true;
}
// static
-FX_BOOL CXFA_FM2JSContext::IsoTime2Local(CFXJSE_Value* pThis,
- const CFX_ByteStringC& szTime,
- const CFX_ByteStringC& szFormat,
- const CFX_ByteStringC& szLocale,
- CFX_ByteString& strLocalTime) {
+bool CXFA_FM2JSContext::IsoTime2Local(CFXJSE_Value* pThis,
+ const CFX_ByteStringC& szTime,
+ const CFX_ByteStringC& szFormat,
+ const CFX_ByteStringC& szLocale,
+ CFX_ByteString& strLocalTime) {
CXFA_Document* pDoc = ToJSContext(pThis, nullptr)->GetDocument();
if (!pDoc)
- return FALSE;
+ return false;
CXFA_LocaleMgr* pMgr = pDoc->GetLocalMgr();
IFX_Locale* pLocale = nullptr;
@@ -2070,7 +2070,7 @@ FX_BOOL CXFA_FM2JSContext::IsoTime2Local(CFXJSE_Value* pThis,
pLocale = pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale));
}
if (!pLocale)
- return FALSE;
+ return false;
CFX_WideString wsFormat;
if (szFormat.IsEmpty())
@@ -2085,18 +2085,18 @@ FX_BOOL CXFA_FM2JSContext::IsoTime2Local(CFXJSE_Value* pThis,
widgetValue.FormatPatterns(wsRet, wsFormat, pLocale,
XFA_VALUEPICTURE_Display);
strLocalTime = FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength());
- return TRUE;
+ return true;
}
// static
-FX_BOOL CXFA_FM2JSContext::GetGMTTime(CFXJSE_Value* pThis,
- const CFX_ByteStringC& szTime,
- const CFX_ByteStringC& szFormat,
- const CFX_ByteStringC& szLocale,
- CFX_ByteString& strGMTTime) {
+bool CXFA_FM2JSContext::GetGMTTime(CFXJSE_Value* pThis,
+ const CFX_ByteStringC& szTime,
+ const CFX_ByteStringC& szFormat,
+ const CFX_ByteStringC& szLocale,
+ CFX_ByteString& strGMTTime) {
CXFA_Document* pDoc = ToJSContext(pThis, nullptr)->GetDocument();
if (!pDoc)
- return FALSE;
+ return false;
CXFA_LocaleMgr* pMgr = pDoc->GetLocalMgr();
IFX_Locale* pLocale = nullptr;
@@ -2109,7 +2109,7 @@ FX_BOOL CXFA_FM2JSContext::GetGMTTime(CFXJSE_Value* pThis,
pLocale = pMgr->GetLocaleByName(CFX_WideString::FromUTF8(szLocale));
}
if (!pLocale)
- return FALSE;
+ return false;
CFX_WideString wsFormat;
if (szFormat.IsEmpty())
@@ -2124,7 +2124,7 @@ FX_BOOL CXFA_FM2JSContext::GetGMTTime(CFXJSE_Value* pThis,
widgetValue.FormatPatterns(wsRet, wsFormat, pLocale,
XFA_VALUEPICTURE_Display);
strGMTTime = FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength());
- return TRUE;
+ return true;
}
// static
@@ -2189,7 +2189,7 @@ void CXFA_FM2JSContext::GetLocalDateFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat,
- FX_BOOL bStandard) {
+ bool bStandard) {
FX_LOCALEDATETIMESUBCATEGORY strStyle;
switch (iStyle) {
case 1:
@@ -2240,7 +2240,7 @@ void CXFA_FM2JSContext::GetLocalTimeFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat,
- FX_BOOL bStandard) {
+ bool bStandard) {
FX_LOCALEDATETIMESUBCATEGORY strStyle;
switch (iStyle) {
case 1:
@@ -2291,7 +2291,7 @@ void CXFA_FM2JSContext::GetStandardDateFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat) {
- GetLocalDateFormat(pThis, iStyle, szLocalStr, strFormat, TRUE);
+ GetLocalDateFormat(pThis, iStyle, szLocalStr, strFormat, true);
}
// static
@@ -2299,7 +2299,7 @@ void CXFA_FM2JSContext::GetStandardTimeFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat) {
- GetLocalTimeFormat(pThis, iStyle, szLocalStr, strFormat, TRUE);
+ GetLocalTimeFormat(pThis, iStyle, szLocalStr, strFormat, true);
}
// static
@@ -2307,7 +2307,7 @@ void CXFA_FM2JSContext::Num2AllTime(CFXJSE_Value* pThis,
int32_t iTime,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
- FX_BOOL bGM,
+ bool bGM,
CFX_ByteString& strTime) {
int32_t iHour = 0;
int32_t iMin = 0;
@@ -2326,7 +2326,7 @@ void CXFA_FM2JSContext::Num2AllTime(CFXJSE_Value* pThis,
iSec += iZoneSec;
}
- FX_BOOL iRet = FALSE;
+ bool iRet = false;
CFX_ByteString strIsoTime;
strIsoTime.Format("%02d:%02d:%02d", iHour, iMin, iSec);
if (bGM) {
@@ -2796,8 +2796,8 @@ void CXFA_FM2JSContext::Choose(CFXJSE_Value* pThis,
return;
}
- FX_BOOL bFound = FALSE;
- FX_BOOL bStopCounterFlags = FALSE;
+ bool bFound = false;
+ bool bStopCounterFlags = false;
int32_t iArgIndex = 1;
int32_t iValueIndex = 0;
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
@@ -2808,7 +2808,7 @@ void CXFA_FM2JSContext::Choose(CFXJSE_Value* pThis,
argIndexValue->GetObjectProperty("length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger();
if (iLength > 3)
- bStopCounterFlags = TRUE;
+ bStopCounterFlags = true;
iValueIndex += (iLength - 2);
if (iValueIndex >= iIndex) {
@@ -2828,7 +2828,7 @@ void CXFA_FM2JSContext::Choose(CFXJSE_Value* pThis,
CFX_ByteString bsChoosed;
ValueToUTF8String(newPropertyValue.get(), bsChoosed);
args.GetReturnValue()->SetString(bsChoosed.AsStringC());
- bFound = TRUE;
+ bFound = true;
}
} else {
iValueIndex++;
@@ -2836,7 +2836,7 @@ void CXFA_FM2JSContext::Choose(CFXJSE_Value* pThis,
CFX_ByteString bsChoosed;
ValueToUTF8String(argIndexValue.get(), bsChoosed);
args.GetReturnValue()->SetString(bsChoosed.AsStringC());
- bFound = TRUE;
+ bFound = true;
}
}
iArgIndex++;
@@ -2889,14 +2889,14 @@ void CXFA_FM2JSContext::Oneof(CFXJSE_Value* pThis,
return;
}
- FX_BOOL bFlags = FALSE;
+ bool bFlags = false;
std::unique_ptr<CFXJSE_Value> argOne = GetSimpleValue(pThis, args, 0);
CFXJSE_Value** parametersValue = nullptr;
int32_t iCount = 0;
unfoldArgs(pThis, args, parametersValue, iCount, 1);
for (int32_t i = 0; i < iCount; i++) {
if (simpleValueCompare(pThis, argOne.get(), parametersValue[i])) {
- bFlags = TRUE;
+ bFlags = true;
break;
}
}
@@ -3360,13 +3360,13 @@ void CXFA_FM2JSContext::Concat(CFXJSE_Value* pThis,
}
CFX_ByteString resultString;
- FX_BOOL bAllNull = TRUE;
+ bool bAllNull = true;
for (int32_t i = 0; i < argc; i++) {
std::unique_ptr<CFXJSE_Value> value = GetSimpleValue(pThis, args, i);
if (ValueIsNull(pThis, value.get()))
continue;
- bAllNull = FALSE;
+ bAllNull = false;
CFX_ByteString valueStr;
ValueToUTF8String(value.get(), valueStr);
@@ -3933,8 +3933,8 @@ void CXFA_FM2JSContext::EncodeXML(const CFX_ByteStringC& szXMLString,
}
// static
-FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(const CFX_WideStringC& pData,
- uint32_t& iCode) {
+bool CXFA_FM2JSContext::HTMLSTR2Code(const CFX_WideStringC& pData,
+ uint32_t& iCode) {
uint32_t uHash = FX_HashCode_GetW(pData, false);
int32_t iStart = 0;
int32_t iEnd = FX_ArraySize(reservesForDecode) - 1;
@@ -3943,7 +3943,7 @@ FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(const CFX_WideStringC& pData,
XFA_FMHtmlHashedReserveCode htmlhashedreservecode = reservesForDecode[iMid];
if (uHash == htmlhashedreservecode.m_uHash) {
iCode = htmlhashedreservecode.m_uCode;
- return TRUE;
+ return true;
}
if (uHash < htmlhashedreservecode.m_uHash)
@@ -3951,12 +3951,12 @@ FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(const CFX_WideStringC& pData,
else
iStart = iMid + 1;
} while (iStart <= iEnd);
- return FALSE;
+ return false;
}
// static
-FX_BOOL CXFA_FM2JSContext::HTMLCode2STR(uint32_t iCode,
- CFX_WideString& wsHTMLReserve) {
+bool CXFA_FM2JSContext::HTMLCode2STR(uint32_t iCode,
+ CFX_WideString& wsHTMLReserve) {
int32_t iStart = 0;
int32_t iEnd = FX_ArraySize(reservesForEncode) - 1;
do {
@@ -3964,7 +3964,7 @@ FX_BOOL CXFA_FM2JSContext::HTMLCode2STR(uint32_t iCode,
XFA_FMHtmlReserveCode htmlreservecode = reservesForEncode[iMid];
if (iCode == htmlreservecode.m_uCode) {
wsHTMLReserve = htmlreservecode.m_htmlReserve;
- return TRUE;
+ return true;
}
if (iCode < htmlreservecode.m_uCode)
@@ -3972,7 +3972,7 @@ FX_BOOL CXFA_FM2JSContext::HTMLCode2STR(uint32_t iCode,
else
iStart = iMid + 1;
} while (iStart <= iEnd);
- return FALSE;
+ return false;
}
// static
@@ -5190,12 +5190,12 @@ void CXFA_FM2JSContext::notequality_operator(CFXJSE_Value* pThis,
}
// static
-FX_BOOL CXFA_FM2JSContext::fm_ref_equal(CFXJSE_Value* pThis,
- CFXJSE_Arguments& args) {
+bool CXFA_FM2JSContext::fm_ref_equal(CFXJSE_Value* pThis,
+ CFXJSE_Arguments& args) {
std::unique_ptr<CFXJSE_Value> argFirst = args.GetValue(0);
std::unique_ptr<CFXJSE_Value> argSecond = args.GetValue(1);
if (!argFirst->IsArray() || !argSecond->IsArray())
- return FALSE;
+ return false;
v8::Isolate* pIsolate = ToJSContext(pThis, nullptr)->GetScriptRuntime();
std::unique_ptr<CFXJSE_Value> firstFlagValue(new CFXJSE_Value(pIsolate));
@@ -5203,14 +5203,14 @@ FX_BOOL CXFA_FM2JSContext::fm_ref_equal(CFXJSE_Value* pThis,
argFirst->GetObjectPropertyByIdx(0, firstFlagValue.get());
argSecond->GetObjectPropertyByIdx(0, secondFlagValue.get());
if (firstFlagValue->ToInteger() != 3 || secondFlagValue->ToInteger() != 3)
- return FALSE;
+ return false;
std::unique_ptr<CFXJSE_Value> firstJSObject(new CFXJSE_Value(pIsolate));
std::unique_ptr<CFXJSE_Value> secondJSObject(new CFXJSE_Value(pIsolate));
argFirst->GetObjectPropertyByIdx(2, firstJSObject.get());
argSecond->GetObjectPropertyByIdx(2, secondJSObject.get());
if (firstJSObject->IsNull() || secondJSObject->IsNull())
- return FALSE;
+ return false;
return (firstJSObject->ToHostObject(nullptr) ==
secondJSObject->ToHostObject(nullptr));
@@ -5505,14 +5505,14 @@ void CXFA_FM2JSContext::dot_accessor(CFXJSE_Value* pThis,
iSizes[i] = 0;
std::unique_ptr<CFXJSE_Value> hJSObjValue(new CFXJSE_Value(pIsolate));
- FX_BOOL bAttribute = FALSE;
+ bool bAttribute = false;
int32_t iCounter = 0;
for (int32_t i = 2; i < iLength; i++) {
argAccessor->GetObjectPropertyByIdx(i, hJSObjValue.get());
XFA_RESOLVENODE_RS resoveNodeRS;
if (ResolveObjects(pThis, hJSObjValue.get(), szSomExp.AsStringC(),
- resoveNodeRS, TRUE, szName.IsEmpty()) > 0) {
+ resoveNodeRS, true, szName.IsEmpty()) > 0) {
ParseResolveResult(pThis, resoveNodeRS, hJSObjValue.get(),
hResolveValues[i - 2], iSizes[i - 2], bAttribute);
iCounter += iSizes[i - 2];
@@ -5570,12 +5570,12 @@ void CXFA_FM2JSContext::dot_accessor(CFXJSE_Value* pThis,
if (argAccessor->IsObject() ||
(argAccessor->IsNull() && bsAccessorName.IsEmpty())) {
iRet = ResolveObjects(pThis, argAccessor.get(), szSomExp.AsStringC(),
- resoveNodeRS, TRUE, szName.IsEmpty());
+ resoveNodeRS, true, szName.IsEmpty());
} else if (!argAccessor->IsObject() && !bsAccessorName.IsEmpty() &&
GetObjectForName(pThis, argAccessor.get(),
bsAccessorName.AsStringC())) {
iRet = ResolveObjects(pThis, argAccessor.get(), szSomExp.AsStringC(),
- resoveNodeRS, TRUE, szName.IsEmpty());
+ resoveNodeRS, true, szName.IsEmpty());
}
if (iRet < 1) {
CFX_WideString wsPropertyName =
@@ -5589,7 +5589,7 @@ void CXFA_FM2JSContext::dot_accessor(CFXJSE_Value* pThis,
CFXJSE_Value** hResolveValues;
int32_t iSize = 0;
- FX_BOOL bAttribute = FALSE;
+ bool bAttribute = false;
ParseResolveResult(pThis, resoveNodeRS, argAccessor.get(), hResolveValues,
iSize, bAttribute);
CFXJSE_Value** rgValues = FX_Alloc(CFXJSE_Value*, iSize + 2);
@@ -5649,12 +5649,12 @@ void CXFA_FM2JSContext::dotdot_accessor(CFXJSE_Value* pThis,
CFXJSE_Value*** hResolveValues = FX_Alloc(CFXJSE_Value**, iLength - 2);
int32_t* iSizes = FX_Alloc(int32_t, iLength - 2);
std::unique_ptr<CFXJSE_Value> hJSObjValue(new CFXJSE_Value(pIsolate));
- FX_BOOL bAttribute = FALSE;
+ bool bAttribute = false;
for (int32_t i = 2; i < iLength; i++) {
argAccessor->GetObjectPropertyByIdx(i, hJSObjValue.get());
XFA_RESOLVENODE_RS resoveNodeRS;
if (ResolveObjects(pThis, hJSObjValue.get(), szSomExp.AsStringC(),
- resoveNodeRS, FALSE) > 0) {
+ resoveNodeRS, false) > 0) {
ParseResolveResult(pThis, resoveNodeRS, hJSObjValue.get(),
hResolveValues[i - 2], iSizes[i - 2], bAttribute);
iCounter += iSizes[i - 2];
@@ -5708,12 +5708,12 @@ void CXFA_FM2JSContext::dotdot_accessor(CFXJSE_Value* pThis,
if (argAccessor->IsObject() ||
(argAccessor->IsNull() && bsAccessorName.IsEmpty())) {
iRet = ResolveObjects(pThis, argAccessor.get(), szSomExp.AsStringC(),
- resoveNodeRS, FALSE);
+ resoveNodeRS, false);
} else if (!argAccessor->IsObject() && !bsAccessorName.IsEmpty() &&
GetObjectForName(pThis, argAccessor.get(),
bsAccessorName.AsStringC())) {
iRet = ResolveObjects(pThis, argAccessor.get(), szSomExp.AsStringC(),
- resoveNodeRS, FALSE);
+ resoveNodeRS, false);
}
if (iRet < 1) {
CFX_WideString wsPropertyName =
@@ -5727,7 +5727,7 @@ void CXFA_FM2JSContext::dotdot_accessor(CFXJSE_Value* pThis,
CFXJSE_Value** hResolveValues;
int32_t iSize = 0;
- FX_BOOL bAttribute = FALSE;
+ bool bAttribute = false;
ParseResolveResult(pThis, resoveNodeRS, argAccessor.get(), hResolveValues,
iSize, bAttribute);
CFXJSE_Value** rgValues = FX_Alloc(CFXJSE_Value*, iSize + 2);
@@ -5792,7 +5792,7 @@ void CXFA_FM2JSContext::is_fm_object(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() != 1) {
- args.GetReturnValue()->SetBoolean(FALSE);
+ args.GetReturnValue()->SetBoolean(false);
return;
}
@@ -5805,7 +5805,7 @@ void CXFA_FM2JSContext::is_fm_array(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args) {
if (args.GetLength() != 1) {
- args.GetReturnValue()->SetBoolean(FALSE);
+ args.GetReturnValue()->SetBoolean(false);
return;
}
@@ -6017,18 +6017,18 @@ std::unique_ptr<CFXJSE_Value> CXFA_FM2JSContext::GetSimpleValue(
}
// static
-FX_BOOL CXFA_FM2JSContext::ValueIsNull(CFXJSE_Value* pThis, CFXJSE_Value* arg) {
+bool CXFA_FM2JSContext::ValueIsNull(CFXJSE_Value* pThis, CFXJSE_Value* arg) {
if (!arg || arg->IsNull())
- return TRUE;
+ return true;
if (!arg->IsArray() && !arg->IsObject())
- return FALSE;
+ return false;
v8::Isolate* pIsolate = ToJSContext(pThis, nullptr)->GetScriptRuntime();
if (arg->IsArray()) {
int32_t iLength = hvalue_get_array_length(pThis, arg);
if (iLength < 3)
- return TRUE;
+ return true;
std::unique_ptr<CFXJSE_Value> propertyValue(new CFXJSE_Value(pIsolate));
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate));
@@ -6064,11 +6064,11 @@ int32_t CXFA_FM2JSContext::hvalue_get_array_length(CFXJSE_Value* pThis,
}
// static
-FX_BOOL CXFA_FM2JSContext::simpleValueCompare(CFXJSE_Value* pThis,
- CFXJSE_Value* firstValue,
- CFXJSE_Value* secondValue) {
+bool CXFA_FM2JSContext::simpleValueCompare(CFXJSE_Value* pThis,
+ CFXJSE_Value* firstValue,
+ CFXJSE_Value* secondValue) {
if (!firstValue)
- return FALSE;
+ return false;
if (firstValue->IsString()) {
CFX_ByteString firstString, secondString;
@@ -6157,18 +6157,18 @@ void CXFA_FM2JSContext::GetObjectDefaultValue(CFXJSE_Value* pValue,
pDefaultValue->SetNull();
return;
}
- pNode->Script_Som_DefaultValue(pDefaultValue, FALSE, (XFA_ATTRIBUTE)-1);
+ pNode->Script_Som_DefaultValue(pDefaultValue, false, (XFA_ATTRIBUTE)-1);
}
// static
-FX_BOOL CXFA_FM2JSContext::SetObjectDefaultValue(CFXJSE_Value* pValue,
- CFXJSE_Value* hNewValue) {
+bool CXFA_FM2JSContext::SetObjectDefaultValue(CFXJSE_Value* pValue,
+ CFXJSE_Value* hNewValue) {
CXFA_Node* pNode = ToNode(CXFA_ScriptContext::ToObject(pValue, nullptr));
if (!pNode)
- return FALSE;
+ return false;
- pNode->Script_Som_DefaultValue(hNewValue, TRUE, (XFA_ATTRIBUTE)-1);
- return TRUE;
+ pNode->Script_Som_DefaultValue(hNewValue, true, (XFA_ATTRIBUTE)-1);
+ return true;
}
// static
@@ -6203,13 +6203,13 @@ void CXFA_FM2JSContext::GenerateSomExpression(const CFX_ByteStringC& szName,
}
// static
-FX_BOOL CXFA_FM2JSContext::GetObjectForName(
+bool CXFA_FM2JSContext::GetObjectForName(
CFXJSE_Value* pThis,
CFXJSE_Value* accessorValue,
const CFX_ByteStringC& szAccessorName) {
CXFA_Document* pDoc = ToJSContext(pThis, nullptr)->GetDocument();
if (!pDoc)
- return FALSE;
+ return false;
CXFA_ScriptContext* pScriptContext = pDoc->GetScriptContext();
XFA_RESOLVENODE_RS resoveNodeRS;
@@ -6222,9 +6222,9 @@ FX_BOOL CXFA_FM2JSContext::GetObjectForName(
if (iRet >= 1 && resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) {
accessorValue->Assign(
pScriptContext->GetJSValueFromMap(resoveNodeRS.nodes.GetAt(0)));
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
// static
@@ -6232,8 +6232,8 @@ int32_t CXFA_FM2JSContext::ResolveObjects(CFXJSE_Value* pThis,
CFXJSE_Value* pRefValue,
const CFX_ByteStringC& bsSomExp,
XFA_RESOLVENODE_RS& resoveNodeRS,
- FX_BOOL bdotAccessor,
- FX_BOOL bHasNoResolveName) {
+ bool bdotAccessor,
+ bool bHasNoResolveName) {
CXFA_Document* pDoc = ToJSContext(pThis, nullptr)->GetDocument();
if (!pDoc)
return -1;
@@ -6252,7 +6252,7 @@ int32_t CXFA_FM2JSContext::ResolveObjects(CFXJSE_Value* pThis,
if (bHasNoResolveName) {
CFX_WideString wsName;
if (CXFA_Node* pXFANode = pNode->AsNode())
- pXFANode->GetAttribute(XFA_ATTRIBUTE_Name, wsName, FALSE);
+ pXFANode->GetAttribute(XFA_ATTRIBUTE_Name, wsName, false);
if (wsName.IsEmpty())
wsName = FX_WSTRC(L"#") + pNode->GetClassName();
@@ -6280,14 +6280,14 @@ void CXFA_FM2JSContext::ParseResolveResult(
CFXJSE_Value* pParentValue,
CFXJSE_Value**& resultValues,
int32_t& iSize,
- FX_BOOL& bAttribute) {
+ bool& bAttribute) {
iSize = 0;
resultValues = nullptr;
CXFA_FM2JSContext* pContext = ToJSContext(pThis, nullptr);
v8::Isolate* pIsolate = pContext->GetScriptRuntime();
if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) {
- bAttribute = FALSE;
+ bAttribute = false;
iSize = resoveNodeRS.nodes.GetSize();
resultValues = FX_Alloc(CFXJSE_Value*, iSize);
for (int32_t i = 0; i < iSize; i++) {
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.h b/xfa/fxfa/fm2js/xfa_fm2jscontext.h
index 2a81c48382..0f56c6964c 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.h
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.h
@@ -88,67 +88,67 @@ class CXFA_FM2JSContext : public CFXJSE_HostObject {
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static FX_BOOL IsIsoDateFormat(const FX_CHAR* pData,
- int32_t iLength,
- int32_t& iStyle,
- int32_t& iYear,
- int32_t& iMonth,
- int32_t& iDay);
- static FX_BOOL IsIsoTimeFormat(const FX_CHAR* pData,
- int32_t iLength,
- int32_t& iHour,
- int32_t& iMinute,
- int32_t& iSecond,
- int32_t& iMilliSecond,
- int32_t& iZoneHour,
- int32_t& iZoneMinute);
- static FX_BOOL IsIsoDateTimeFormat(const FX_CHAR* pData,
- int32_t iLength,
- int32_t& iYear,
- int32_t& iMonth,
- int32_t& iDay,
- int32_t& iHour,
- int32_t& iMinute,
- int32_t& iSecond,
- int32_t& iMillionSecond,
- int32_t& iZoneHour,
- int32_t& iZoneMinute);
- static FX_BOOL Local2IsoDate(CFXJSE_Value* pThis,
- const CFX_ByteStringC& szDate,
- const CFX_ByteStringC& szFormat,
- const CFX_ByteStringC& szLocale,
- CFX_ByteString& strIsoDate);
- static FX_BOOL Local2IsoTime(CFXJSE_Value* pThis,
- const CFX_ByteStringC& szTime,
- const CFX_ByteStringC& szFormat,
- const CFX_ByteStringC& szLocale,
- CFX_ByteString& strIsoTime);
- static FX_BOOL IsoDate2Local(CFXJSE_Value* pThis,
- const CFX_ByteStringC& szDate,
- const CFX_ByteStringC& szFormat,
- const CFX_ByteStringC& szLocale,
- CFX_ByteString& strLocalDate);
- static FX_BOOL IsoTime2Local(CFXJSE_Value* pThis,
- const CFX_ByteStringC& szTime,
- const CFX_ByteStringC& szFormat,
- const CFX_ByteStringC& szLocale,
- CFX_ByteString& strLocalTime);
- static FX_BOOL GetGMTTime(CFXJSE_Value* pThis,
+ static bool IsIsoDateFormat(const FX_CHAR* pData,
+ int32_t iLength,
+ int32_t& iStyle,
+ int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay);
+ static bool IsIsoTimeFormat(const FX_CHAR* pData,
+ int32_t iLength,
+ int32_t& iHour,
+ int32_t& iMinute,
+ int32_t& iSecond,
+ int32_t& iMilliSecond,
+ int32_t& iZoneHour,
+ int32_t& iZoneMinute);
+ static bool IsIsoDateTimeFormat(const FX_CHAR* pData,
+ int32_t iLength,
+ int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay,
+ int32_t& iHour,
+ int32_t& iMinute,
+ int32_t& iSecond,
+ int32_t& iMillionSecond,
+ int32_t& iZoneHour,
+ int32_t& iZoneMinute);
+ static bool Local2IsoDate(CFXJSE_Value* pThis,
+ const CFX_ByteStringC& szDate,
+ const CFX_ByteStringC& szFormat,
+ const CFX_ByteStringC& szLocale,
+ CFX_ByteString& strIsoDate);
+ static bool Local2IsoTime(CFXJSE_Value* pThis,
+ const CFX_ByteStringC& szTime,
+ const CFX_ByteStringC& szFormat,
+ const CFX_ByteStringC& szLocale,
+ CFX_ByteString& strIsoTime);
+ static bool IsoDate2Local(CFXJSE_Value* pThis,
+ const CFX_ByteStringC& szDate,
+ const CFX_ByteStringC& szFormat,
+ const CFX_ByteStringC& szLocale,
+ CFX_ByteString& strLocalDate);
+ static bool IsoTime2Local(CFXJSE_Value* pThis,
const CFX_ByteStringC& szTime,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
- CFX_ByteString& strGMTTime);
+ CFX_ByteString& strLocalTime);
+ static bool GetGMTTime(CFXJSE_Value* pThis,
+ const CFX_ByteStringC& szTime,
+ const CFX_ByteStringC& szFormat,
+ const CFX_ByteStringC& szLocale,
+ CFX_ByteString& strGMTTime);
static int32_t DateString2Num(const CFX_ByteStringC& szDateString);
static void GetLocalDateFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat,
- FX_BOOL bStandard);
+ bool bStandard);
static void GetLocalTimeFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
CFX_ByteString& strFormat,
- FX_BOOL bStandard);
+ bool bStandard);
static void GetStandardDateFormat(CFXJSE_Value* pThis,
int32_t iStyle,
const CFX_ByteStringC& szLocalStr,
@@ -162,7 +162,7 @@ class CXFA_FM2JSContext : public CFXJSE_HostObject {
int32_t iTime,
const CFX_ByteStringC& szFormat,
const CFX_ByteStringC& szLocale,
- FX_BOOL bGM,
+ bool bGM,
CFX_ByteString& strTime);
static void GetLocalTimeZone(int32_t& iHour, int32_t& iMin, int32_t& iSec);
@@ -251,8 +251,8 @@ class CXFA_FM2JSContext : public CFXJSE_HostObject {
CFX_ByteTextBuf& szResultBuf);
static void EncodeXML(const CFX_ByteStringC& szXMLString,
CFX_ByteTextBuf& szResultBuf);
- static FX_BOOL HTMLSTR2Code(const CFX_WideStringC& pData, uint32_t& iCode);
- static FX_BOOL HTMLCode2STR(uint32_t iCode, CFX_WideString& wsHTMLReserve);
+ static bool HTMLSTR2Code(const CFX_WideStringC& pData, uint32_t& iCode);
+ static bool HTMLCode2STR(uint32_t iCode, CFX_WideString& wsHTMLReserve);
static void Format(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
@@ -331,7 +331,7 @@ class CXFA_FM2JSContext : public CFXJSE_HostObject {
static void notequality_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
- static FX_BOOL fm_ref_equal(CFXJSE_Value* pThis, CFXJSE_Arguments& args);
+ static bool fm_ref_equal(CFXJSE_Value* pThis, CFXJSE_Arguments& args);
static void less_operator(CFXJSE_Value* pThis,
const CFX_ByteStringC& szFuncName,
CFXJSE_Arguments& args);
@@ -395,9 +395,9 @@ class CXFA_FM2JSContext : public CFXJSE_HostObject {
static int32_t hvalue_get_array_length(CFXJSE_Value* pThis,
CFXJSE_Value* arg);
- static FX_BOOL simpleValueCompare(CFXJSE_Value* pThis,
- CFXJSE_Value* firstValue,
- CFXJSE_Value* secondValue);
+ static bool simpleValueCompare(CFXJSE_Value* pThis,
+ CFXJSE_Value* firstValue,
+ CFXJSE_Value* secondValue);
static void unfoldArgs(CFXJSE_Value* pThis,
CFXJSE_Arguments& args,
CFXJSE_Value**& resultValues,
@@ -405,33 +405,33 @@ class CXFA_FM2JSContext : public CFXJSE_HostObject {
int32_t iStart = 0);
static void GetObjectDefaultValue(CFXJSE_Value* pObjectValue,
CFXJSE_Value* pDefaultValue);
- static FX_BOOL SetObjectDefaultValue(CFXJSE_Value* pObjectValue,
- CFXJSE_Value* pNewValue);
+ static bool SetObjectDefaultValue(CFXJSE_Value* pObjectValue,
+ CFXJSE_Value* pNewValue);
static void GenerateSomExpression(const CFX_ByteStringC& szName,
int32_t iIndexFlags,
int32_t iIndexValue,
bool bIsStar,
CFX_ByteString& szSomExp);
- static FX_BOOL GetObjectForName(CFXJSE_Value* pThis,
- CFXJSE_Value* accessorValue,
- const CFX_ByteStringC& szAccessorName);
+ static bool GetObjectForName(CFXJSE_Value* pThis,
+ CFXJSE_Value* accessorValue,
+ const CFX_ByteStringC& szAccessorName);
static int32_t ResolveObjects(CFXJSE_Value* pThis,
CFXJSE_Value* pParentValue,
const CFX_ByteStringC& bsSomExp,
XFA_RESOLVENODE_RS& resoveNodeRS,
- FX_BOOL bdotAccessor = TRUE,
- FX_BOOL bHasNoResolveName = FALSE);
+ bool bdotAccessor = true,
+ bool bHasNoResolveName = false);
static void ParseResolveResult(CFXJSE_Value* pThis,
const XFA_RESOLVENODE_RS& resoveNodeRS,
CFXJSE_Value* pParentValue,
CFXJSE_Value**& resultValues,
int32_t& iSize,
- FX_BOOL& bAttribute);
+ bool& bAttribute);
static std::unique_ptr<CFXJSE_Value> GetSimpleValue(CFXJSE_Value* pThis,
CFXJSE_Arguments& args,
uint32_t index);
- static FX_BOOL ValueIsNull(CFXJSE_Value* pThis, CFXJSE_Value* pValue);
+ static bool ValueIsNull(CFXJSE_Value* pThis, CFXJSE_Value* pValue);
static int32_t ValueToInteger(CFXJSE_Value* pThis, CFXJSE_Value* pValue);
static FX_FLOAT ValueToFloat(CFXJSE_Value* pThis, CFXJSE_Value* pValue);
static FX_DOUBLE ValueToDouble(CFXJSE_Value* pThis, CFXJSE_Value* pValue);
diff --git a/xfa/fxfa/fm2js/xfa_fmparse.cpp b/xfa/fxfa/fm2js/xfa_fmparse.cpp
index 3223df64dc..530ca85325 100644
--- a/xfa/fxfa/fm2js/xfa_fmparse.cpp
+++ b/xfa/fxfa/fm2js/xfa_fmparse.cpp
@@ -573,7 +573,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression(
}
}
if (m_pErrorInfo->message.IsEmpty()) {
- e = new CXFA_FMCallExpression(line, e, pArray.release(), FALSE);
+ e = new CXFA_FMCallExpression(line, e, pArray.release(), false);
NextToken();
if (m_pToken->m_type != TOKlbracket) {
continue;
@@ -629,7 +629,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression(
CXFA_FMSimpleExpression* pIdentifier =
new CXFA_FMIdentifierExpression(tempLine, tempStr);
pExpCall = new CXFA_FMCallExpression(line, pIdentifier,
- pArray.release(), TRUE);
+ pArray.release(), true);
e = new CXFA_FMMethodCallExpression(line, pExpAccessor, pExpCall);
NextToken();
if (m_pToken->m_type != TOKlbracket) {
@@ -661,7 +661,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression(
s.release());
} else {
CXFA_FMSimpleExpression* s = new CXFA_FMIndexExpression(
- tempLine, ACCESSOR_NO_INDEX, nullptr, FALSE);
+ tempLine, ACCESSOR_NO_INDEX, nullptr, false);
e = new CXFA_FMDotAccessorExpression(line, e, TOKdot, tempStr, s);
continue;
}
@@ -688,7 +688,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression(
tempStr, s.release());
} else {
CXFA_FMSimpleExpression* s = new CXFA_FMIndexExpression(
- tempLine, ACCESSOR_NO_INDEX, nullptr, FALSE);
+ tempLine, ACCESSOR_NO_INDEX, nullptr, false);
e = new CXFA_FMDotDotAccessorExpression(line, e, TOKdotdot, tempStr,
s);
continue;
@@ -716,7 +716,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression(
tempStr, s.release());
} else {
CXFA_FMSimpleExpression* s = new CXFA_FMIndexExpression(
- tempLine, ACCESSOR_NO_INDEX, nullptr, FALSE);
+ tempLine, ACCESSOR_NO_INDEX, nullptr, false);
e = new CXFA_FMDotAccessorExpression(line, e, TOKdotscream, tempStr,
s);
continue;
@@ -730,7 +730,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression(
break;
case TOKdotstar: {
CXFA_FMSimpleExpression* s =
- new CXFA_FMIndexExpression(line, ACCESSOR_NO_INDEX, nullptr, FALSE);
+ new CXFA_FMIndexExpression(line, ACCESSOR_NO_INDEX, nullptr, false);
e = new CXFA_FMDotAccessorExpression(line, e, TOKdotstar,
FX_WSTRC(L"*"), s);
} break;
@@ -750,7 +750,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParseIndexExpression() {
XFA_FM_AccessorIndex accessorIndex = ACCESSOR_NO_RELATIVEINDEX;
if (m_pToken->m_type == TOKmul) {
pExp.reset(
- new CXFA_FMIndexExpression(line, accessorIndex, s.release(), TRUE));
+ new CXFA_FMIndexExpression(line, accessorIndex, s.release(), true));
NextToken();
if (m_pToken->m_type != TOKrbracket) {
CFX_WideString ws_TempString(m_pToken->m_wstring);
@@ -774,7 +774,7 @@ CXFA_FMSimpleExpression* CXFA_FMParse::ParseIndexExpression() {
XFA_FM_KeywordToString(TOKrparen), ws_TempString.c_str());
} else {
pExp.reset(
- new CXFA_FMIndexExpression(line, accessorIndex, s.release(), FALSE));
+ new CXFA_FMIndexExpression(line, accessorIndex, s.release(), false));
}
return pExp.release();
}
diff --git a/xfa/fxfa/fm2js/xfa_lexer.cpp b/xfa/fxfa/fm2js/xfa_lexer.cpp
index 2e8b6fed59..6e844bcdf0 100644
--- a/xfa/fxfa/fm2js/xfa_lexer.cpp
+++ b/xfa/fxfa/fm2js/xfa_lexer.cpp
@@ -20,36 +20,32 @@ struct XFA_FMDChar {
return p;
}
static uint16_t get(const FX_WCHAR* p) { return *p; }
- static FX_BOOL isWhiteSpace(const FX_WCHAR* p) {
+ static bool isWhiteSpace(const FX_WCHAR* p) {
return (*p) == 0x09 || (*p) == 0x0b || (*p) == 0x0c || (*p) == 0x20;
}
- static FX_BOOL isLineTerminator(const FX_WCHAR* p) {
+ static bool isLineTerminator(const FX_WCHAR* p) {
return *p == 0x0A || *p == 0x0D;
}
- static FX_BOOL isBinary(const FX_WCHAR* p) {
- return (*p) >= '0' && (*p) <= '1';
- }
- static FX_BOOL isOctal(const FX_WCHAR* p) {
- return (*p) >= '0' && (*p) <= '7';
- }
- static FX_BOOL isDigital(const FX_WCHAR* p) {
+ static bool isBinary(const FX_WCHAR* p) { return (*p) >= '0' && (*p) <= '1'; }
+ static bool isOctal(const FX_WCHAR* p) { return (*p) >= '0' && (*p) <= '7'; }
+ static bool isDigital(const FX_WCHAR* p) {
return (*p) >= '0' && (*p) <= '9';
}
- static FX_BOOL isHex(const FX_WCHAR* p) {
+ static bool isHex(const FX_WCHAR* p) {
return isDigital(p) || ((*p) >= 'a' && (*p) <= 'f') ||
((*p) >= 'A' && (*p) <= 'F');
}
- static FX_BOOL isAlpha(const FX_WCHAR* p) {
+ static bool isAlpha(const FX_WCHAR* p) {
return ((*p) <= 'z' && (*p) >= 'a') || ((*p) <= 'Z' && (*p) >= 'A');
}
- static FX_BOOL isAvalid(const FX_WCHAR* p, FX_BOOL flag = 0);
- static FX_BOOL string2number(const FX_WCHAR* s,
- FX_DOUBLE* pValue,
- const FX_WCHAR*& pEnd);
- static FX_BOOL isUnicodeAlpha(uint16_t ch);
+ static bool isAvalid(const FX_WCHAR* p, bool flag = 0);
+ static bool string2number(const FX_WCHAR* s,
+ FX_DOUBLE* pValue,
+ const FX_WCHAR*& pEnd);
+ static bool isUnicodeAlpha(uint16_t ch);
};
-inline FX_BOOL XFA_FMDChar::isAvalid(const FX_WCHAR* p, FX_BOOL flag) {
+inline bool XFA_FMDChar::isAvalid(const FX_WCHAR* p, bool flag) {
if (*p == 0) {
return 1;
}
@@ -65,24 +61,24 @@ inline FX_BOOL XFA_FMDChar::isAvalid(const FX_WCHAR* p, FX_BOOL flag) {
return 0;
}
-inline FX_BOOL XFA_FMDChar::string2number(const FX_WCHAR* s,
- FX_DOUBLE* pValue,
- const FX_WCHAR*& pEnd) {
+inline bool XFA_FMDChar::string2number(const FX_WCHAR* s,
+ FX_DOUBLE* pValue,
+ const FX_WCHAR*& pEnd) {
if (s) {
*pValue = wcstod((wchar_t*)s, (wchar_t**)&pEnd);
}
return 0;
}
-inline FX_BOOL XFA_FMDChar::isUnicodeAlpha(uint16_t ch) {
+inline bool XFA_FMDChar::isUnicodeAlpha(uint16_t ch) {
if (ch == 0 || ch == 0x0A || ch == 0x0D || ch == 0x09 || ch == 0x0B ||
ch == 0x0C || ch == 0x20 || ch == '.' || ch == ';' || ch == '"' ||
ch == '=' || ch == '<' || ch == '>' || ch == ',' || ch == '(' ||
ch == ')' || ch == ']' || ch == '[' || ch == '&' || ch == '|' ||
ch == '+' || ch == '-' || ch == '*' || ch == '/') {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
const XFA_FMKeyword keyWords[] = {
@@ -542,9 +538,9 @@ void CXFA_FMLexer::Error(const FX_WCHAR* msg, ...) {
va_end(ap);
}
-FX_BOOL CXFA_FMLexer::HasError() const {
+bool CXFA_FMLexer::HasError() const {
if (m_pErrorInfo->message.IsEmpty()) {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
diff --git a/xfa/fxfa/fm2js/xfa_lexer.h b/xfa/fxfa/fm2js/xfa_lexer.h
index 220a4d7630..9395c06814 100644
--- a/xfa/fxfa/fm2js/xfa_lexer.h
+++ b/xfa/fxfa/fm2js/xfa_lexer.h
@@ -122,7 +122,7 @@ class CXFA_FMLexer {
const FX_WCHAR* SavePos() { return m_ptr; }
void RestorePos(const FX_WCHAR* pPos) { m_ptr = pPos; }
void Error(const FX_WCHAR* msg, ...);
- FX_BOOL HasError() const;
+ bool HasError() const;
protected:
CXFA_FMToken* Scan();
diff --git a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp
index fdae9fc772..be02e51ec4 100644
--- a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp
+++ b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp
@@ -342,7 +342,7 @@ void CXFA_FMEqualityExpression::ToJavaScript(CFX_WideTextBuf& javascript) {
javascript << gs_lpStrExpFuncName[NOTEQUALITY];
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
javascript << FX_WSTRC(L"(");
@@ -378,7 +378,7 @@ void CXFA_FMRelationalExpression::ToJavaScript(CFX_WideTextBuf& javascript) {
javascript << gs_lpStrExpFuncName[GREATEREQUAL];
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
javascript << FX_WSTRC(L"(");
@@ -404,7 +404,7 @@ void CXFA_FMAdditiveExpression::ToJavaScript(CFX_WideTextBuf& javascript) {
javascript << gs_lpStrExpFuncName[MINUS];
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
javascript << FX_WSTRC(L"(");
@@ -431,7 +431,7 @@ void CXFA_FMMultiplicativeExpression::ToJavaScript(
javascript << gs_lpStrExpFuncName[DIVIDE];
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
javascript << FX_WSTRC(L"(");
@@ -478,7 +478,7 @@ CXFA_FMCallExpression::CXFA_FMCallExpression(
uint32_t line,
CXFA_FMSimpleExpression* pExp,
CFX_ArrayTemplate<CXFA_FMSimpleExpression*>* pArguments,
- FX_BOOL bIsSomMethod)
+ bool bIsSomMethod)
: CXFA_FMUnaryExpression(line, TOKcall, pExp),
m_bIsSomMethod(bIsSomMethod),
m_pArguments(pArguments) {}
@@ -666,7 +666,7 @@ CXFA_FMIndexExpression::CXFA_FMIndexExpression(
uint32_t line,
XFA_FM_AccessorIndex accessorIndex,
CXFA_FMSimpleExpression* pIndexExp,
- FX_BOOL bIsStarIndex)
+ bool bIsStarIndex)
: CXFA_FMUnaryExpression(line, TOKlbracket, pIndexExp),
m_accessorIndex(accessorIndex),
m_bIsStarIndex(bIsStarIndex) {}
diff --git a/xfa/fxfa/fm2js/xfa_simpleexpression.h b/xfa/fxfa/fm2js/xfa_simpleexpression.h
index f0f2f390d5..6c1e6257bd 100644
--- a/xfa/fxfa/fm2js/xfa_simpleexpression.h
+++ b/xfa/fxfa/fm2js/xfa_simpleexpression.h
@@ -231,7 +231,7 @@ class CXFA_FMCallExpression : public CXFA_FMUnaryExpression {
CXFA_FMCallExpression(uint32_t line,
CXFA_FMSimpleExpression* pExp,
CFX_ArrayTemplate<CXFA_FMSimpleExpression*>* pArguments,
- FX_BOOL bIsSomMethod);
+ bool bIsSomMethod);
~CXFA_FMCallExpression() override;
bool IsBuildInFunc(CFX_WideTextBuf* funcName);
@@ -239,7 +239,7 @@ class CXFA_FMCallExpression : public CXFA_FMUnaryExpression {
void ToJavaScript(CFX_WideTextBuf& javascript) override;
private:
- FX_BOOL m_bIsSomMethod;
+ bool m_bIsSomMethod;
CFX_ArrayTemplate<CXFA_FMSimpleExpression*>* m_pArguments;
};
@@ -262,13 +262,13 @@ class CXFA_FMIndexExpression : public CXFA_FMUnaryExpression {
CXFA_FMIndexExpression(uint32_t line,
XFA_FM_AccessorIndex accessorIndex,
CXFA_FMSimpleExpression* pIndexExp,
- FX_BOOL bIsStarIndex);
+ bool bIsStarIndex);
~CXFA_FMIndexExpression() override {}
void ToJavaScript(CFX_WideTextBuf& javascript) override;
private:
XFA_FM_AccessorIndex m_accessorIndex;
- FX_BOOL m_bIsStarIndex;
+ bool m_bIsStarIndex;
};
class CXFA_FMDotDotAccessorExpression : public CXFA_FMBinExpression {
diff --git a/xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp b/xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp
index 3c0a69c100..534fc18a6f 100644
--- a/xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp
+++ b/xfa/fxfa/fm2js/xfa_simpleexpression_unittest.cpp
@@ -19,7 +19,7 @@ TEST(FMCallExpression, more_than_32_arguments) {
for (size_t i = 0; i < 50; i++)
args->Add(new CXFA_FMSimpleExpression(0, TOKnan));
- CXFA_FMCallExpression callExp(0, exp.release(), args.release(), TRUE);
+ CXFA_FMCallExpression callExp(0, exp.release(), args.release(), true);
CFX_WideTextBuf js;
callExp.ToJavaScript(js);
diff --git a/xfa/fxfa/fxfa.h b/xfa/fxfa/fxfa.h
index 8abee52c36..d3ae838315 100644
--- a/xfa/fxfa/fxfa.h
+++ b/xfa/fxfa/fxfa.h
@@ -223,7 +223,7 @@ class IXFA_AppProvider {
virtual CFX_WideString Response(const CFX_WideString& wsQuestion,
const CFX_WideString& wsTitle = L"",
const CFX_WideString& wsDefaultAnswer = L"",
- FX_BOOL bMask = TRUE) = 0;
+ bool bMask = true) = 0;
/**
* Download something from somewhere.
@@ -245,14 +245,14 @@ class IXFA_AppProvider {
* @param[in] wsHeader any additional HTTP headers to be included in the
* post.
* @param[out] wsResponse decoded response from server.
- * @return TRUE Server permitted the post request, FALSE otherwise.
+ * @return true Server permitted the post request, false otherwise.
*/
- virtual FX_BOOL PostRequestURL(const CFX_WideString& wsURL,
- const CFX_WideString& wsData,
- const CFX_WideString& wsContentType,
- const CFX_WideString& wsEncode,
- const CFX_WideString& wsHeader,
- CFX_WideString& wsResponse) = 0;
+ virtual bool PostRequestURL(const CFX_WideString& wsURL,
+ const CFX_WideString& wsData,
+ const CFX_WideString& wsContentType,
+ const CFX_WideString& wsEncode,
+ const CFX_WideString& wsHeader,
+ CFX_WideString& wsResponse) = 0;
/**
* PUT data to the given url.
@@ -260,11 +260,11 @@ class IXFA_AppProvider {
* @param[in] wsData the data being uploaded.
* @param[in] wsEncode the encode of data including UTF-8, UTF-16,
* ISO8859-1, any recognized [IANA]character encoding
- * @return TRUE Server permitted the post request, FALSE otherwise.
+ * @return true Server permitted the post request, false otherwise.
*/
- virtual FX_BOOL PutRequestURL(const CFX_WideString& wsURL,
- const CFX_WideString& wsData,
- const CFX_WideString& wsEncode) = 0;
+ virtual bool PutRequestURL(const CFX_WideString& wsURL,
+ const CFX_WideString& wsData,
+ const CFX_WideString& wsEncode) = 0;
virtual void LoadString(int32_t iStringID, CFX_WideString& wsString) = 0;
virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0;
@@ -279,14 +279,14 @@ class IXFA_DocEnvironment {
const CFX_RectF& rt,
uint32_t dwFlags) = 0;
virtual void DisplayCaret(CXFA_FFWidget* hWidget,
- FX_BOOL bVisible,
+ bool bVisible,
const CFX_RectF* pRtAnchor) = 0;
- virtual FX_BOOL GetPopupPos(CXFA_FFWidget* hWidget,
- FX_FLOAT fMinPopup,
- FX_FLOAT fMaxPopup,
- const CFX_RectF& rtAnchor,
- CFX_RectF& rtPopup) = 0;
- virtual FX_BOOL PopupMenu(CXFA_FFWidget* hWidget, CFX_PointF ptPopup) = 0;
+ virtual bool GetPopupPos(CXFA_FFWidget* hWidget,
+ FX_FLOAT fMinPopup,
+ FX_FLOAT fMaxPopup,
+ const CFX_RectF& rtAnchor,
+ CFX_RectF& rtPopup) = 0;
+ virtual bool PopupMenu(CXFA_FFWidget* hWidget, CFX_PointF ptPopup) = 0;
virtual void PageViewEvent(CXFA_FFPageView* pPageView, uint32_t dwFlags) = 0;
virtual void WidgetPostAdd(CXFA_FFWidget* hWidget,
CXFA_WidgetAcc* pWidgetData) = 0;
@@ -296,16 +296,16 @@ class IXFA_DocEnvironment {
virtual int32_t CountPages(CXFA_FFDoc* hDoc) = 0;
virtual int32_t GetCurrentPage(CXFA_FFDoc* hDoc) = 0;
virtual void SetCurrentPage(CXFA_FFDoc* hDoc, int32_t iCurPage) = 0;
- virtual FX_BOOL IsCalculationsEnabled(CXFA_FFDoc* hDoc) = 0;
- virtual void SetCalculationsEnabled(CXFA_FFDoc* hDoc, FX_BOOL bEnabled) = 0;
+ virtual bool IsCalculationsEnabled(CXFA_FFDoc* hDoc) = 0;
+ virtual void SetCalculationsEnabled(CXFA_FFDoc* hDoc, bool bEnabled) = 0;
virtual void GetTitle(CXFA_FFDoc* hDoc, CFX_WideString& wsTitle) = 0;
virtual void SetTitle(CXFA_FFDoc* hDoc, const CFX_WideString& wsTitle) = 0;
virtual void ExportData(CXFA_FFDoc* hDoc,
const CFX_WideString& wsFilePath,
- FX_BOOL bXDP) = 0;
+ bool bXDP) = 0;
virtual void GotoURL(CXFA_FFDoc* hDoc, const CFX_WideString& bsURL) = 0;
- virtual FX_BOOL IsValidationsEnabled(CXFA_FFDoc* hDoc) = 0;
- virtual void SetValidationsEnabled(CXFA_FFDoc* hDoc, FX_BOOL bEnabled) = 0;
+ virtual bool IsValidationsEnabled(CXFA_FFDoc* hDoc) = 0;
+ virtual void SetValidationsEnabled(CXFA_FFDoc* hDoc, bool bEnabled) = 0;
virtual void SetFocusWidget(CXFA_FFDoc* hDoc, CXFA_FFWidget* hWidget) = 0;
virtual void Print(CXFA_FFDoc* hDoc,
int32_t nStartPage,
@@ -313,13 +313,13 @@ class IXFA_DocEnvironment {
uint32_t dwOptions) = 0;
virtual FX_ARGB GetHighlightColor(CXFA_FFDoc* hDoc) = 0;
- virtual FX_BOOL SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) = 0;
- virtual FX_BOOL GetGlobalProperty(CXFA_FFDoc* hDoc,
- const CFX_ByteStringC& szPropName,
- CFXJSE_Value* pValue) = 0;
- virtual FX_BOOL SetGlobalProperty(CXFA_FFDoc* hDoc,
- const CFX_ByteStringC& szPropName,
- CFXJSE_Value* pValue) = 0;
+ virtual bool SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) = 0;
+ virtual bool GetGlobalProperty(CXFA_FFDoc* hDoc,
+ const CFX_ByteStringC& szPropName,
+ CFXJSE_Value* pValue) = 0;
+ virtual bool SetGlobalProperty(CXFA_FFDoc* hDoc,
+ const CFX_ByteStringC& szPropName,
+ CFXJSE_Value* pValue) = 0;
virtual IFX_SeekableReadStream* OpenLinkedFile(
CXFA_FFDoc* hDoc,
const CFX_WideString& wsLink) = 0;
@@ -335,7 +335,7 @@ class IXFA_WidgetIterator {
virtual CXFA_FFWidget* MoveToNext() = 0;
virtual CXFA_FFWidget* MoveToPrevious() = 0;
virtual CXFA_FFWidget* GetCurrentWidget() = 0;
- virtual FX_BOOL SetCurrentWidget(CXFA_FFWidget* hWidget) = 0;
+ virtual bool SetCurrentWidget(CXFA_FFWidget* hWidget) = 0;
};
#endif // XFA_FXFA_FXFA_H_
diff --git a/xfa/fxfa/fxfa_basic.h b/xfa/fxfa/fxfa_basic.h
index 77b64fa6b9..d16f50fd90 100644
--- a/xfa/fxfa/fxfa_basic.h
+++ b/xfa/fxfa/fxfa_basic.h
@@ -1009,7 +1009,7 @@ struct XFA_METHODINFO {
};
typedef void (CXFA_Object::*XFA_ATTRIBUTE_CALLBACK)(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
enum XFA_SCRIPT_TYPE {
XFA_SCRIPT_Basic,
diff --git a/xfa/fxfa/fxfa_widget.h b/xfa/fxfa/fxfa_widget.h
index eaf7d3e3bd..6e68e841e9 100644
--- a/xfa/fxfa/fxfa_widget.h
+++ b/xfa/fxfa/fxfa_widget.h
@@ -33,8 +33,8 @@ class CXFA_WidgetAcc : public CXFA_WidgetData {
CXFA_WidgetAcc(CXFA_FFDocView* pDocView, CXFA_Node* pNode);
~CXFA_WidgetAcc();
- FX_BOOL GetName(CFX_WideString& wsName, int32_t iNameType = 0);
- FX_BOOL ProcessValueChanged();
+ bool GetName(CFX_WideString& wsName, int32_t iNameType = 0);
+ bool ProcessValueChanged();
void ResetData();
void SetImageEdit(const CFX_WideString& wsContentType,
@@ -57,11 +57,11 @@ class CXFA_WidgetAcc : public CXFA_WidgetData {
CXFA_FFWidget* GetNextWidget(CXFA_FFWidget* pWidget);
void StartWidgetLayout(FX_FLOAT& fCalcWidth, FX_FLOAT& fCalcHeight);
- FX_BOOL FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight);
- FX_BOOL LoadCaption();
+ bool FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight);
+ bool LoadCaption();
void LoadText();
- FX_BOOL LoadImageImage();
- FX_BOOL LoadImageEditImage();
+ bool LoadImageImage();
+ bool LoadImageEditImage();
void GetImageDpi(int32_t& iImageXDpi, int32_t& iImageYDpi);
void GetImageEditDpi(int32_t& iImageXDpi, int32_t& iImageYDpi);
CXFA_TextLayout* GetCaptionTextLayout();
@@ -83,27 +83,25 @@ class CXFA_WidgetAcc : public CXFA_WidgetData {
void ProcessScriptTestValidate(CXFA_Validate validate,
int32_t iRet,
CFXJSE_Value* pRetValue,
- FX_BOOL bVersionFlag);
- int32_t ProcessFormatTestValidate(CXFA_Validate validate,
- FX_BOOL bVersionFlag);
+ bool bVersionFlag);
+ int32_t ProcessFormatTestValidate(CXFA_Validate validate, bool bVersionFlag);
int32_t ProcessNullTestValidate(CXFA_Validate validate,
int32_t iFlags,
- FX_BOOL bVersionFlag);
- void GetValidateCaptionName(CFX_WideString& wsCaptionName,
- FX_BOOL bVersionFlag);
+ bool bVersionFlag);
+ void GetValidateCaptionName(CFX_WideString& wsCaptionName, bool bVersionFlag);
void GetValidateMessage(IXFA_AppProvider* pAppProvider,
CFX_WideString& wsMessage,
- FX_BOOL bError,
- FX_BOOL bVersionFlag);
+ bool bError,
+ bool bVersionFlag);
void CalcCaptionSize(CFX_SizeF& szCap);
- FX_BOOL CalculateFieldAutoSize(CFX_SizeF& size);
- FX_BOOL CalculateWidgetAutoSize(CFX_SizeF& size);
- FX_BOOL CalculateTextEditAutoSize(CFX_SizeF& size);
- FX_BOOL CalculateCheckButtonAutoSize(CFX_SizeF& size);
- FX_BOOL CalculatePushButtonAutoSize(CFX_SizeF& size);
- FX_BOOL CalculateImageEditAutoSize(CFX_SizeF& size);
- FX_BOOL CalculateImageAutoSize(CFX_SizeF& size);
- FX_BOOL CalculateTextAutoSize(CFX_SizeF& size);
+ bool CalculateFieldAutoSize(CFX_SizeF& size);
+ bool CalculateWidgetAutoSize(CFX_SizeF& size);
+ bool CalculateTextEditAutoSize(CFX_SizeF& size);
+ bool CalculateCheckButtonAutoSize(CFX_SizeF& size);
+ bool CalculatePushButtonAutoSize(CFX_SizeF& size);
+ bool CalculateImageEditAutoSize(CFX_SizeF& size);
+ bool CalculateImageAutoSize(CFX_SizeF& size);
+ bool CalculateTextAutoSize(CFX_SizeF& size);
FX_FLOAT CalculateWidgetAutoHeight(FX_FLOAT fHeightCalc);
FX_FLOAT CalculateWidgetAutoWidth(FX_FLOAT fWidthCalc);
FX_FLOAT GetWidthWithoutMargin(FX_FLOAT fWidthCalc);
diff --git a/xfa/fxfa/parser/cscript_datawindow.cpp b/xfa/fxfa/parser/cscript_datawindow.cpp
index 50ed398ec0..c0354a112c 100644
--- a/xfa/fxfa/parser/cscript_datawindow.cpp
+++ b/xfa/fxfa/parser/cscript_datawindow.cpp
@@ -29,17 +29,17 @@ void CScript_DataWindow::GotoRecord(CFXJSE_Arguments* pArguments) {}
void CScript_DataWindow::IsRecordGroup(CFXJSE_Arguments* pArguments) {}
void CScript_DataWindow::RecordsBefore(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CScript_DataWindow::CurrentRecordNumber(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CScript_DataWindow::RecordsAfter(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CScript_DataWindow::IsDefined(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
diff --git a/xfa/fxfa/parser/cscript_datawindow.h b/xfa/fxfa/parser/cscript_datawindow.h
index b2b35e9c59..e41b7fe17d 100644
--- a/xfa/fxfa/parser/cscript_datawindow.h
+++ b/xfa/fxfa/parser/cscript_datawindow.h
@@ -20,17 +20,15 @@ class CScript_DataWindow : public CXFA_Object {
void GotoRecord(CFXJSE_Arguments* pArguments);
void IsRecordGroup(CFXJSE_Arguments* pArguments);
void RecordsBefore(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void CurrentRecordNumber(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void RecordsAfter(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
- void IsDefined(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
+ void IsDefined(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
};
#endif // XFA_FXFA_PARSER_CSCRIPT_DATAWINDOW_H_
diff --git a/xfa/fxfa/parser/cscript_eventpseudomodel.cpp b/xfa/fxfa/parser/cscript_eventpseudomodel.cpp
index dd6142c47c..8a7d80b5d3 100644
--- a/xfa/fxfa/parser/cscript_eventpseudomodel.cpp
+++ b/xfa/fxfa/parser/cscript_eventpseudomodel.cpp
@@ -20,7 +20,7 @@ namespace {
void StringProperty(CFXJSE_Value* pValue,
CFX_WideString& wsValue,
- FX_BOOL bSetting) {
+ bool bSetting) {
if (bSetting) {
wsValue = pValue->ToWideString();
return;
@@ -28,7 +28,7 @@ void StringProperty(CFXJSE_Value* pValue,
pValue->SetString(FX_UTF8Encode(wsValue).AsStringC());
}
-void InterProperty(CFXJSE_Value* pValue, int32_t& iValue, FX_BOOL bSetting) {
+void InterProperty(CFXJSE_Value* pValue, int32_t& iValue, bool bSetting) {
if (bSetting) {
iValue = pValue->ToInteger();
return;
@@ -36,7 +36,7 @@ void InterProperty(CFXJSE_Value* pValue, int32_t& iValue, FX_BOOL bSetting) {
pValue->SetInteger(iValue);
}
-void BooleanProperty(CFXJSE_Value* pValue, FX_BOOL& bValue, FX_BOOL bSetting) {
+void BooleanProperty(CFXJSE_Value* pValue, bool& bValue, bool bSetting) {
if (bSetting) {
bValue = pValue->ToBoolean();
return;
@@ -56,7 +56,7 @@ CScript_EventPseudoModel::~CScript_EventPseudoModel() {}
void CScript_EventPseudoModel::Property(CFXJSE_Value* pValue,
XFA_Event dwFlag,
- FX_BOOL bSetting) {
+ bool bSetting) {
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext)
return;
@@ -121,82 +121,82 @@ void CScript_EventPseudoModel::Property(CFXJSE_Value* pValue,
}
}
void CScript_EventPseudoModel::Change(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::Change, bSetting);
}
void CScript_EventPseudoModel::CommitKey(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::CommitKey, bSetting);
}
void CScript_EventPseudoModel::FullText(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::FullText, bSetting);
}
void CScript_EventPseudoModel::KeyDown(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::Keydown, bSetting);
}
void CScript_EventPseudoModel::Modifier(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::Modifier, bSetting);
}
void CScript_EventPseudoModel::NewContentType(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::NewContentType, bSetting);
}
void CScript_EventPseudoModel::NewText(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::NewText, bSetting);
}
void CScript_EventPseudoModel::PrevContentType(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::PreviousContentType, bSetting);
}
void CScript_EventPseudoModel::PrevText(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::PreviousText, bSetting);
}
void CScript_EventPseudoModel::Reenter(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::Reenter, bSetting);
}
void CScript_EventPseudoModel::SelEnd(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::SelectionEnd, bSetting);
}
void CScript_EventPseudoModel::SelStart(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::SelectionStart, bSetting);
}
void CScript_EventPseudoModel::Shift(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::Shift, bSetting);
}
void CScript_EventPseudoModel::SoapFaultCode(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::SoapFaultCode, bSetting);
}
void CScript_EventPseudoModel::SoapFaultString(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::SoapFaultString, bSetting);
}
void CScript_EventPseudoModel::Target(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Property(pValue, XFA_Event::Target, bSetting);
}
diff --git a/xfa/fxfa/parser/cscript_eventpseudomodel.h b/xfa/fxfa/parser/cscript_eventpseudomodel.h
index c747ad2d19..6415287c8e 100644
--- a/xfa/fxfa/parser/cscript_eventpseudomodel.h
+++ b/xfa/fxfa/parser/cscript_eventpseudomodel.h
@@ -35,52 +35,36 @@ class CScript_EventPseudoModel : public CXFA_Object {
explicit CScript_EventPseudoModel(CXFA_Document* pDocument);
~CScript_EventPseudoModel() override;
- void Change(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute);
- void CommitKey(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
- void FullText(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
- void KeyDown(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
- void Modifier(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
+ void Change(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void CommitKey(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void FullText(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void KeyDown(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void Modifier(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
void NewContentType(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
- void NewText(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
+ void NewText(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
void PrevContentType(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
- void PrevText(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
- void Reenter(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
- void SelEnd(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute);
- void SelStart(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
- void Shift(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute);
+ void PrevText(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void Reenter(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void SelEnd(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void SelStart(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void Shift(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
void SoapFaultCode(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void SoapFaultString(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
- void Target(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute);
+ void Target(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
void Emit(CFXJSE_Arguments* pArguments);
void Reset(CFXJSE_Arguments* pArguments);
protected:
- void Property(CFXJSE_Value* pValue, XFA_Event dwFlag, FX_BOOL bSetting);
+ void Property(CFXJSE_Value* pValue, XFA_Event dwFlag, bool bSetting);
};
#endif // XFA_FXFA_PARSER_CSCRIPT_EVENTPSEUDOMODEL_H_
diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
index 89230c34e9..6140ad37d8 100644
--- a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
+++ b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp
@@ -41,7 +41,7 @@ void CScript_HostPseudoModel::LoadString(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::AppType(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify)
@@ -54,7 +54,7 @@ void CScript_HostPseudoModel::AppType(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::CalculationsEnabled(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -70,7 +70,7 @@ void CScript_HostPseudoModel::CalculationsEnabled(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::CurrentPage(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -85,7 +85,7 @@ void CScript_HostPseudoModel::CurrentPage(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::Language(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -101,7 +101,7 @@ void CScript_HostPseudoModel::Language(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::NumPages(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -116,7 +116,7 @@ void CScript_HostPseudoModel::NumPages(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::Platform(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -131,7 +131,7 @@ void CScript_HostPseudoModel::Platform(CFXJSE_Value* pValue,
pValue->SetString(FX_UTF8Encode(wsPlatform).AsStringC());
}
void CScript_HostPseudoModel::Title(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!m_pDocument->GetScriptContext()->IsRunAtClient()) {
return;
@@ -151,7 +151,7 @@ void CScript_HostPseudoModel::Title(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::ValidationsEnabled(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -163,12 +163,12 @@ void CScript_HostPseudoModel::ValidationsEnabled(CFXJSE_Value* pValue,
pValue->ToBoolean());
return;
}
- FX_BOOL bEnabled = pNotify->GetDocEnvironment()->IsValidationsEnabled(hDoc);
+ bool bEnabled = pNotify->GetDocEnvironment()->IsValidationsEnabled(hDoc);
pValue->SetBoolean(bEnabled);
}
void CScript_HostPseudoModel::Variation(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!m_pDocument->GetScriptContext()->IsRunAtClient())
return;
@@ -184,7 +184,7 @@ void CScript_HostPseudoModel::Variation(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::Version(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -198,7 +198,7 @@ void CScript_HostPseudoModel::Version(CFXJSE_Value* pValue,
}
void CScript_HostPseudoModel::Name(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -297,7 +297,7 @@ void CScript_HostPseudoModel::Response(CFXJSE_Arguments* pArguments) {
CFX_WideString wsQuestion;
CFX_WideString wsTitle;
CFX_WideString wsDefaultAnswer;
- FX_BOOL bMark = FALSE;
+ bool bMark = false;
if (iLength >= 1) {
CFX_ByteString bsQuestion = pArguments->GetUTF8String(0);
wsQuestion = CFX_WideString::FromUTF8(bsQuestion.AsStringC());
@@ -311,7 +311,7 @@ void CScript_HostPseudoModel::Response(CFXJSE_Arguments* pArguments) {
wsDefaultAnswer = CFX_WideString::FromUTF8(bsDefaultAnswer.AsStringC());
}
if (iLength >= 4) {
- bMark = pArguments->GetInt32(3) == 0 ? FALSE : TRUE;
+ bMark = pArguments->GetInt32(3) == 0 ? false : true;
}
CFX_WideString wsAnswer = pNotify->GetAppProvider()->Response(
wsQuestion, wsTitle, wsDefaultAnswer, bMark);
@@ -513,29 +513,28 @@ void CScript_HostPseudoModel::MessageBox(CFXJSE_Arguments* pArguments) {
if (pValue)
pValue->SetInteger(iValue);
}
-FX_BOOL CScript_HostPseudoModel::ValidateArgsForMsg(
- CFXJSE_Arguments* pArguments,
- int32_t iArgIndex,
- CFX_WideString& wsValue) {
+bool CScript_HostPseudoModel::ValidateArgsForMsg(CFXJSE_Arguments* pArguments,
+ int32_t iArgIndex,
+ CFX_WideString& wsValue) {
if (!pArguments || iArgIndex < 0) {
- return FALSE;
+ return false;
}
- FX_BOOL bIsJsType = FALSE;
+ bool bIsJsType = false;
if (m_pDocument->GetScriptContext()->GetType() ==
XFA_SCRIPTLANGTYPE_Javascript) {
- bIsJsType = TRUE;
+ bIsJsType = true;
}
std::unique_ptr<CFXJSE_Value> pValueArg(pArguments->GetValue(iArgIndex));
if (!pValueArg->IsString() && bIsJsType) {
ThrowException(XFA_IDS_ARGUMENT_MISMATCH);
- return FALSE;
+ return false;
}
if (pValueArg->IsNull()) {
wsValue = FX_WSTRC(L"");
} else {
wsValue = pValueArg->ToWideString();
}
- return TRUE;
+ return true;
}
void CScript_HostPseudoModel::DocumentCountInBatch(
CFXJSE_Arguments* pArguments) {
@@ -557,9 +556,9 @@ void CScript_HostPseudoModel::Print(CFXJSE_Arguments* pArguments) {
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
uint32_t dwOptions = 0;
- FX_BOOL bShowDialog = TRUE;
+ bool bShowDialog = true;
if (iLength >= 1) {
- bShowDialog = pArguments->GetInt32(0) == 0 ? FALSE : TRUE;
+ bShowDialog = pArguments->GetInt32(0) == 0 ? false : true;
}
if (bShowDialog) {
dwOptions |= XFA_PRINTOPT_ShowDialog;
@@ -572,38 +571,38 @@ void CScript_HostPseudoModel::Print(CFXJSE_Arguments* pArguments) {
if (iLength >= 3) {
nEndPage = pArguments->GetInt32(2);
}
- FX_BOOL bCanCancel = TRUE;
+ bool bCanCancel = true;
if (iLength >= 4) {
- bCanCancel = pArguments->GetInt32(3) == 0 ? FALSE : TRUE;
+ bCanCancel = pArguments->GetInt32(3) == 0 ? false : true;
}
if (bCanCancel) {
dwOptions |= XFA_PRINTOPT_CanCancel;
}
- FX_BOOL bShrinkPage = TRUE;
+ bool bShrinkPage = true;
if (iLength >= 5) {
- bShrinkPage = pArguments->GetInt32(4) == 0 ? FALSE : TRUE;
+ bShrinkPage = pArguments->GetInt32(4) == 0 ? false : true;
}
if (bShrinkPage) {
dwOptions |= XFA_PRINTOPT_ShrinkPage;
}
- FX_BOOL bAsImage = TRUE;
+ bool bAsImage = true;
if (iLength >= 6) {
- bAsImage = pArguments->GetInt32(5) == 0 ? FALSE : TRUE;
+ bAsImage = pArguments->GetInt32(5) == 0 ? false : true;
}
if (bAsImage) {
dwOptions |= XFA_PRINTOPT_AsImage;
}
- FX_BOOL bReverseOrder = TRUE;
+ bool bReverseOrder = true;
if (iLength >= 7) {
- bAsImage = pArguments->GetInt32(5) == 0 ? FALSE : TRUE;
+ bAsImage = pArguments->GetInt32(5) == 0 ? false : true;
}
- bReverseOrder = pArguments->GetInt32(6) == 0 ? FALSE : TRUE;
+ bReverseOrder = pArguments->GetInt32(6) == 0 ? false : true;
if (bReverseOrder) {
dwOptions |= XFA_PRINTOPT_ReverseOrder;
}
- FX_BOOL bPrintAnnot = TRUE;
+ bool bPrintAnnot = true;
if (iLength >= 8) {
- bPrintAnnot = pArguments->GetInt32(7) == 0 ? FALSE : TRUE;
+ bPrintAnnot = pArguments->GetInt32(7) == 0 ? false : true;
}
if (bPrintAnnot) {
dwOptions |= XFA_PRINTOPT_PrintAnnot;
@@ -632,13 +631,13 @@ void CScript_HostPseudoModel::ExportData(CFXJSE_Arguments* pArguments) {
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
CFX_WideString wsFilePath;
- FX_BOOL bXDP = TRUE;
+ bool bXDP = true;
if (iLength >= 1) {
CFX_ByteString bsFilePath = pArguments->GetUTF8String(0);
wsFilePath = CFX_WideString::FromUTF8(bsFilePath.AsStringC());
}
if (iLength >= 2) {
- bXDP = pArguments->GetInt32(1) == 0 ? FALSE : TRUE;
+ bXDP = pArguments->GetInt32(1) == 0 ? false : true;
}
pNotify->GetDocEnvironment()->ExportData(hDoc, wsFilePath, bXDP);
}
diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.h b/xfa/fxfa/parser/cscript_hostpseudomodel.h
index c2183ac9d7..76c910b801 100644
--- a/xfa/fxfa/parser/cscript_hostpseudomodel.h
+++ b/xfa/fxfa/parser/cscript_hostpseudomodel.h
@@ -16,35 +16,23 @@ class CScript_HostPseudoModel : public CXFA_Object {
explicit CScript_HostPseudoModel(CXFA_Document* pDocument);
~CScript_HostPseudoModel() override;
- void AppType(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
+ void AppType(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
void CalculationsEnabled(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void CurrentPage(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
- void Language(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
- void NumPages(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
- void Platform(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
- void Title(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute);
+ void Language(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void NumPages(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void Platform(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void Title(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
void ValidationsEnabled(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
- void Variation(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
- void Version(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
- XFA_ATTRIBUTE eAttribute);
- void Name(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute);
+ void Variation(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void Version(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
+ void Name(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
void GotoURL(CFXJSE_Arguments* pArguments);
void OpenList(CFXJSE_Arguments* pArguments);
void Response(CFXJSE_Arguments* pArguments);
@@ -66,9 +54,9 @@ class CScript_HostPseudoModel : public CXFA_Object {
void LoadString(CFXJSE_Value* pValue,
CXFA_FFNotify* pNotify,
uint32_t dwFlag);
- FX_BOOL ValidateArgsForMsg(CFXJSE_Arguments* pArguments,
- int32_t iArgIndex,
- CFX_WideString& wsValue);
+ bool ValidateArgsForMsg(CFXJSE_Arguments* pArguments,
+ int32_t iArgIndex,
+ CFX_WideString& wsValue);
};
#endif // XFA_FXFA_PARSER_CSCRIPT_HOSTPSEUDOMODEL_H_
diff --git a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp
index b6ee3672e6..a9c63666b3 100644
--- a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp
+++ b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp
@@ -32,7 +32,7 @@ CScript_LayoutPseudoModel::CScript_LayoutPseudoModel(CXFA_Document* pDocument)
CScript_LayoutPseudoModel::~CScript_LayoutPseudoModel() {}
void CScript_LayoutPseudoModel::Ready(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -105,7 +105,7 @@ void CScript_LayoutPseudoModel::HWXY(CFXJSE_Arguments* pArguments,
pValue->SetFloat(0);
return;
}
- pLayoutItem->GetRect(rtRect, TRUE);
+ pLayoutItem->GetRect(rtRect, true);
switch (layoutModel) {
case XFA_LAYOUTMODEL_H:
measure.Set(rtRect.height, XFA_UNIT_Pt);
@@ -144,7 +144,7 @@ void CScript_LayoutPseudoModel::Y(CFXJSE_Arguments* pArguments) {
}
void CScript_LayoutPseudoModel::NumberedPageCount(CFXJSE_Arguments* pArguments,
- FX_BOOL bNumbered) {
+ bool bNumbered) {
CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout();
if (!pDocLayout) {
return;
@@ -171,7 +171,7 @@ void CScript_LayoutPseudoModel::NumberedPageCount(CFXJSE_Arguments* pArguments,
}
void CScript_LayoutPseudoModel::PageCount(CFXJSE_Arguments* pArguments) {
- NumberedPageCount(pArguments, TRUE);
+ NumberedPageCount(pArguments, true);
}
void CScript_LayoutPseudoModel::PageSpan(CFXJSE_Arguments* pArguments) {
@@ -205,13 +205,13 @@ void CScript_LayoutPseudoModel::PageSpan(CFXJSE_Arguments* pArguments) {
}
void CScript_LayoutPseudoModel::Page(CFXJSE_Arguments* pArguments) {
- PageImp(pArguments, FALSE);
+ PageImp(pArguments, false);
}
void CScript_LayoutPseudoModel::GetObjArray(CXFA_LayoutProcessor* pDocLayout,
int32_t iPageNo,
const CFX_WideString& wsType,
- FX_BOOL bOnPageArea,
+ bool bOnPageArea,
CXFA_NodeArray& retArray) {
CXFA_ContainerLayoutItem* pLayoutPage = pDocLayout->GetPage(iPageNo);
if (!pLayoutPage) {
@@ -348,7 +348,7 @@ void CScript_LayoutPseudoModel::PageContent(CFXJSE_Arguments* pArguments) {
}
int32_t iIndex = 0;
CFX_WideString wsType;
- FX_BOOL bOnPageArea = FALSE;
+ bool bOnPageArea = false;
if (iLength >= 1) {
iIndex = pArguments->GetInt32(0);
}
@@ -357,7 +357,7 @@ void CScript_LayoutPseudoModel::PageContent(CFXJSE_Arguments* pArguments) {
wsType = CFX_WideString::FromUTF8(bsType.AsStringC());
}
if (iLength >= 3) {
- bOnPageArea = pArguments->GetInt32(2) == 0 ? FALSE : TRUE;
+ bOnPageArea = pArguments->GetInt32(2) == 0 ? false : true;
}
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -376,7 +376,7 @@ void CScript_LayoutPseudoModel::PageContent(CFXJSE_Arguments* pArguments) {
}
void CScript_LayoutPseudoModel::AbsPageCount(CFXJSE_Arguments* pArguments) {
- NumberedPageCount(pArguments, FALSE);
+ NumberedPageCount(pArguments, false);
}
void CScript_LayoutPseudoModel::AbsPageCountInBatch(
@@ -402,7 +402,7 @@ void CScript_LayoutPseudoModel::Relayout(CFXJSE_Arguments* pArguments) {
if (pContentRootNode) {
pLayoutProcessor->AddChangedContainer(pContentRootNode);
}
- pLayoutProcessor->SetForceReLayout(TRUE);
+ pLayoutProcessor->SetForceReLayout(true);
}
void CScript_LayoutPseudoModel::AbsPageSpan(CFXJSE_Arguments* pArguments) {
@@ -432,22 +432,22 @@ void CScript_LayoutPseudoModel::SheetInBatch(CFXJSE_Arguments* pArguments) {
}
void CScript_LayoutPseudoModel::Sheet(CFXJSE_Arguments* pArguments) {
- PageImp(pArguments, TRUE);
+ PageImp(pArguments, true);
}
void CScript_LayoutPseudoModel::RelayoutPageArea(CFXJSE_Arguments* pArguments) {
}
void CScript_LayoutPseudoModel::SheetCount(CFXJSE_Arguments* pArguments) {
- NumberedPageCount(pArguments, FALSE);
+ NumberedPageCount(pArguments, false);
}
void CScript_LayoutPseudoModel::AbsPage(CFXJSE_Arguments* pArguments) {
- PageImp(pArguments, TRUE);
+ PageImp(pArguments, true);
}
void CScript_LayoutPseudoModel::PageImp(CFXJSE_Arguments* pArguments,
- FX_BOOL bAbsPage) {
+ bool bAbsPage) {
int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
const FX_WCHAR* methodName;
diff --git a/xfa/fxfa/parser/cscript_layoutpseudomodel.h b/xfa/fxfa/parser/cscript_layoutpseudomodel.h
index d7661bcda9..ad64417bf3 100644
--- a/xfa/fxfa/parser/cscript_layoutpseudomodel.h
+++ b/xfa/fxfa/parser/cscript_layoutpseudomodel.h
@@ -24,14 +24,14 @@ class CScript_LayoutPseudoModel : public CXFA_Object {
explicit CScript_LayoutPseudoModel(CXFA_Document* pDocument);
~CScript_LayoutPseudoModel() override;
- void Ready(CFXJSE_Value* pValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute);
+ void Ready(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
void HWXY(CFXJSE_Arguments* pArguments, XFA_LAYOUTMODEL_HWXY layoutModel);
void H(CFXJSE_Arguments* pArguments);
void W(CFXJSE_Arguments* pArguments);
void X(CFXJSE_Arguments* pArguments);
void Y(CFXJSE_Arguments* pArguments);
- void NumberedPageCount(CFXJSE_Arguments* pArguments, FX_BOOL bNumbered);
+ void NumberedPageCount(CFXJSE_Arguments* pArguments, bool bNumbered);
void PageCount(CFXJSE_Arguments* pArguments);
void PageSpan(CFXJSE_Arguments* pArguments);
void Page(CFXJSE_Arguments* pArguments);
@@ -52,9 +52,9 @@ class CScript_LayoutPseudoModel : public CXFA_Object {
void GetObjArray(CXFA_LayoutProcessor* pDocLayout,
int32_t iPageNo,
const CFX_WideString& wsType,
- FX_BOOL bOnPageArea,
+ bool bOnPageArea,
CXFA_NodeArray& retArray);
- void PageImp(CFXJSE_Arguments* pArguments, FX_BOOL bAbsPage);
+ void PageImp(CFXJSE_Arguments* pArguments, bool bAbsPage);
};
#endif // XFA_FXFA_PARSER_CSCRIPT_LAYOUTPSEUDOMODEL_H_
diff --git a/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp b/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp
index 5a484ab12c..391f3be381 100644
--- a/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp
+++ b/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp
@@ -44,7 +44,7 @@ void CScript_SignaturePseudoModel::Sign(CFXJSE_Arguments* pArguments) {
CFXJSE_Value* pValue = pArguments->GetReturnValue();
if (pValue)
- pValue->SetBoolean(FALSE);
+ pValue->SetBoolean(false);
}
void CScript_SignaturePseudoModel::Enumerate(CFXJSE_Arguments* pArguments) {
@@ -64,5 +64,5 @@ void CScript_SignaturePseudoModel::Clear(CFXJSE_Arguments* pArguments) {
CFXJSE_Value* pValue = pArguments->GetReturnValue();
if (pValue)
- pValue->SetBoolean(FALSE);
+ pValue->SetBoolean(false);
}
diff --git a/xfa/fxfa/parser/cxfa_arraynodelist.cpp b/xfa/fxfa/parser/cxfa_arraynodelist.cpp
index 06aab400f1..8c9040a121 100644
--- a/xfa/fxfa/parser/cxfa_arraynodelist.cpp
+++ b/xfa/fxfa/parser/cxfa_arraynodelist.cpp
@@ -21,13 +21,12 @@ int32_t CXFA_ArrayNodeList::GetLength() {
return m_array.GetSize();
}
-FX_BOOL CXFA_ArrayNodeList::Append(CXFA_Node* pNode) {
+bool CXFA_ArrayNodeList::Append(CXFA_Node* pNode) {
m_array.Add(pNode);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_ArrayNodeList::Insert(CXFA_Node* pNewNode,
- CXFA_Node* pBeforeNode) {
+bool CXFA_ArrayNodeList::Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) {
if (!pBeforeNode) {
m_array.Add(pNewNode);
} else {
@@ -39,10 +38,10 @@ FX_BOOL CXFA_ArrayNodeList::Insert(CXFA_Node* pNewNode,
}
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_ArrayNodeList::Remove(CXFA_Node* pNode) {
+bool CXFA_ArrayNodeList::Remove(CXFA_Node* pNode) {
int32_t iSize = m_array.GetSize();
for (int32_t i = 0; i < iSize; ++i) {
if (m_array[i] == pNode) {
@@ -50,7 +49,7 @@ FX_BOOL CXFA_ArrayNodeList::Remove(CXFA_Node* pNode) {
break;
}
}
- return TRUE;
+ return true;
}
CXFA_Node* CXFA_ArrayNodeList::Item(int32_t iIndex) {
diff --git a/xfa/fxfa/parser/cxfa_attachnodelist.cpp b/xfa/fxfa/parser/cxfa_attachnodelist.cpp
index fb8d026698..c23b900af6 100644
--- a/xfa/fxfa/parser/cxfa_attachnodelist.cpp
+++ b/xfa/fxfa/parser/cxfa_attachnodelist.cpp
@@ -18,7 +18,7 @@ int32_t CXFA_AttachNodeList::GetLength() {
m_pAttachNode->GetElementType() == XFA_Element::Subform);
}
-FX_BOOL CXFA_AttachNodeList::Append(CXFA_Node* pNode) {
+bool CXFA_AttachNodeList::Append(CXFA_Node* pNode) {
CXFA_Node* pParent = pNode->GetNodeItem(XFA_NODEITEM_Parent);
if (pParent) {
pParent->RemoveChild(pNode);
@@ -26,8 +26,7 @@ FX_BOOL CXFA_AttachNodeList::Append(CXFA_Node* pNode) {
return m_pAttachNode->InsertChild(pNode);
}
-FX_BOOL CXFA_AttachNodeList::Insert(CXFA_Node* pNewNode,
- CXFA_Node* pBeforeNode) {
+bool CXFA_AttachNodeList::Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) {
CXFA_Node* pParent = pNewNode->GetNodeItem(XFA_NODEITEM_Parent);
if (pParent) {
pParent->RemoveChild(pNewNode);
@@ -35,7 +34,7 @@ FX_BOOL CXFA_AttachNodeList::Insert(CXFA_Node* pNewNode,
return m_pAttachNode->InsertChild(pNewNode, pBeforeNode);
}
-FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) {
+bool CXFA_AttachNodeList::Remove(CXFA_Node* pNode) {
return m_pAttachNode->RemoveChild(pNode);
}
diff --git a/xfa/fxfa/parser/cxfa_binditems.cpp b/xfa/fxfa/parser/cxfa_binditems.cpp
index fa691fe38b..fdb4f0c376 100644
--- a/xfa/fxfa/parser/cxfa_binditems.cpp
+++ b/xfa/fxfa/parser/cxfa_binditems.cpp
@@ -22,6 +22,6 @@ void CXFA_BindItems::GetRef(CFX_WideStringC& wsRef) {
m_pNode->TryCData(XFA_ATTRIBUTE_Ref, wsRef);
}
-FX_BOOL CXFA_BindItems::SetConnection(const CFX_WideString& wsConnection) {
+bool CXFA_BindItems::SetConnection(const CFX_WideString& wsConnection) {
return m_pNode->SetCData(XFA_ATTRIBUTE_Connection, wsConnection);
}
diff --git a/xfa/fxfa/parser/cxfa_binditems.h b/xfa/fxfa/parser/cxfa_binditems.h
index cb47cf02f1..191941a3fb 100644
--- a/xfa/fxfa/parser/cxfa_binditems.h
+++ b/xfa/fxfa/parser/cxfa_binditems.h
@@ -19,7 +19,7 @@ class CXFA_BindItems : public CXFA_Data {
void GetLabelRef(CFX_WideStringC& wsLabelRef);
void GetValueRef(CFX_WideStringC& wsValueRef);
void GetRef(CFX_WideStringC& wsRef);
- FX_BOOL SetConnection(const CFX_WideString& wsConnection);
+ bool SetConnection(const CFX_WideString& wsConnection);
};
#endif // XFA_FXFA_PARSER_CXFA_BINDITEMS_H_
diff --git a/xfa/fxfa/parser/cxfa_box.cpp b/xfa/fxfa/parser/cxfa_box.cpp
index 3204ab01db..9d9b4b47ad 100644
--- a/xfa/fxfa/parser/cxfa_box.cpp
+++ b/xfa/fxfa/parser/cxfa_box.cpp
@@ -14,7 +14,7 @@ namespace {
void GetStrokesInternal(CXFA_Node* pNode,
CXFA_StrokeArray& strokes,
- FX_BOOL bNull) {
+ bool bNull) {
strokes.RemoveAll();
if (!pNode)
return;
@@ -106,42 +106,42 @@ CXFA_Edge CXFA_Box::GetEdge(int32_t nIndex) const {
}
void CXFA_Box::GetStrokes(CXFA_StrokeArray& strokes) const {
- GetStrokesInternal(m_pNode, strokes, FALSE);
+ GetStrokesInternal(m_pNode, strokes, false);
}
-FX_BOOL CXFA_Box::IsCircular() const {
+bool CXFA_Box::IsCircular() const {
if (!m_pNode)
- return FALSE;
+ return false;
return m_pNode->GetBoolean(XFA_ATTRIBUTE_Circular);
}
-FX_BOOL CXFA_Box::GetStartAngle(FX_FLOAT& fStartAngle) const {
+bool CXFA_Box::GetStartAngle(FX_FLOAT& fStartAngle) const {
fStartAngle = 0;
if (!m_pNode)
- return FALSE;
+ return false;
CXFA_Measurement ms;
- FX_BOOL bRet = m_pNode->TryMeasure(XFA_ATTRIBUTE_StartAngle, ms, FALSE);
+ bool bRet = m_pNode->TryMeasure(XFA_ATTRIBUTE_StartAngle, ms, false);
if (bRet)
fStartAngle = ms.GetValue();
return bRet;
}
-FX_BOOL CXFA_Box::GetSweepAngle(FX_FLOAT& fSweepAngle) const {
+bool CXFA_Box::GetSweepAngle(FX_FLOAT& fSweepAngle) const {
fSweepAngle = 360;
if (!m_pNode)
- return FALSE;
+ return false;
CXFA_Measurement ms;
- FX_BOOL bRet = m_pNode->TryMeasure(XFA_ATTRIBUTE_SweepAngle, ms, FALSE);
+ bool bRet = m_pNode->TryMeasure(XFA_ATTRIBUTE_SweepAngle, ms, false);
if (bRet)
fSweepAngle = ms.GetValue();
return bRet;
}
-CXFA_Fill CXFA_Box::GetFill(FX_BOOL bModified) const {
+CXFA_Fill CXFA_Box::GetFill(bool bModified) const {
if (!m_pNode)
return CXFA_Fill(nullptr);
@@ -154,12 +154,12 @@ CXFA_Margin CXFA_Box::GetMargin() const {
: nullptr);
}
-int32_t CXFA_Box::Get3DStyle(FX_BOOL& bVisible, FX_FLOAT& fThickness) const {
+int32_t CXFA_Box::Get3DStyle(bool& bVisible, FX_FLOAT& fThickness) const {
if (IsArc())
return 0;
CXFA_StrokeArray strokes;
- GetStrokesInternal(m_pNode, strokes, TRUE);
+ GetStrokesInternal(m_pNode, strokes, true);
CXFA_Stroke stroke(nullptr);
int32_t iType = Style3D(strokes, stroke);
if (iType) {
diff --git a/xfa/fxfa/parser/cxfa_box.h b/xfa/fxfa/parser/cxfa_box.h
index 5cf141271d..014155ceb7 100644
--- a/xfa/fxfa/parser/cxfa_box.h
+++ b/xfa/fxfa/parser/cxfa_box.h
@@ -29,24 +29,24 @@ class CXFA_Box : public CXFA_Data {
int32_t CountEdges() const;
CXFA_Edge GetEdge(int32_t nIndex = 0) const;
void GetStrokes(CXFA_StrokeArray& strokes) const;
- FX_BOOL IsCircular() const;
- FX_BOOL GetStartAngle(FX_FLOAT& fStartAngle) const;
+ bool IsCircular() const;
+ bool GetStartAngle(FX_FLOAT& fStartAngle) const;
FX_FLOAT GetStartAngle() const {
FX_FLOAT fStartAngle;
GetStartAngle(fStartAngle);
return fStartAngle;
}
- FX_BOOL GetSweepAngle(FX_FLOAT& fSweepAngle) const;
+ bool GetSweepAngle(FX_FLOAT& fSweepAngle) const;
FX_FLOAT GetSweepAngle() const {
FX_FLOAT fSweepAngle;
GetSweepAngle(fSweepAngle);
return fSweepAngle;
}
- CXFA_Fill GetFill(FX_BOOL bModified = FALSE) const;
+ CXFA_Fill GetFill(bool bModified = false) const;
CXFA_Margin GetMargin() const;
- int32_t Get3DStyle(FX_BOOL& bVisible, FX_FLOAT& fThickness) const;
+ int32_t Get3DStyle(bool& bVisible, FX_FLOAT& fThickness) const;
};
#endif // XFA_FXFA_PARSER_CXFA_BOX_H_
diff --git a/xfa/fxfa/parser/cxfa_calculate.cpp b/xfa/fxfa/parser/cxfa_calculate.cpp
index 17379cb6c7..d7b1f71caa 100644
--- a/xfa/fxfa/parser/cxfa_calculate.cpp
+++ b/xfa/fxfa/parser/cxfa_calculate.cpp
@@ -13,7 +13,7 @@ CXFA_Calculate::CXFA_Calculate(CXFA_Node* pNode) : CXFA_Data(pNode) {}
int32_t CXFA_Calculate::GetOverride() {
XFA_ATTRIBUTEENUM eAtt = XFA_ATTRIBUTEENUM_Error;
- m_pNode->TryEnum(XFA_ATTRIBUTE_Override, eAtt, FALSE);
+ m_pNode->TryEnum(XFA_ATTRIBUTE_Override, eAtt, false);
return eAtt;
}
diff --git a/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp b/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp
index 646f8a45e5..dd759b699a 100644
--- a/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp
+++ b/xfa/fxfa/parser/cxfa_containerlayoutitem.cpp
@@ -11,7 +11,7 @@
#include "xfa/fxfa/parser/cxfa_measurement.h"
CXFA_ContainerLayoutItem::CXFA_ContainerLayoutItem(CXFA_Node* pNode)
- : CXFA_LayoutItem(pNode, FALSE), m_pOldSubform(nullptr) {}
+ : CXFA_LayoutItem(pNode, false), m_pOldSubform(nullptr) {}
CXFA_LayoutProcessor* CXFA_ContainerLayoutItem::GetLayout() const {
return m_pFormNode->GetDocument()->GetLayoutProcessor();
diff --git a/xfa/fxfa/parser/cxfa_contentlayoutitem.cpp b/xfa/fxfa/parser/cxfa_contentlayoutitem.cpp
index 7e9311fec9..a10a678279 100644
--- a/xfa/fxfa/parser/cxfa_contentlayoutitem.cpp
+++ b/xfa/fxfa/parser/cxfa_contentlayoutitem.cpp
@@ -7,7 +7,7 @@
#include "xfa/fxfa/parser/cxfa_contentlayoutitem.h"
CXFA_ContentLayoutItem::CXFA_ContentLayoutItem(CXFA_Node* pNode)
- : CXFA_LayoutItem(pNode, TRUE),
+ : CXFA_LayoutItem(pNode, true),
m_pPrev(nullptr),
m_pNext(nullptr),
m_dwStatus(0) {}
diff --git a/xfa/fxfa/parser/cxfa_data.cpp b/xfa/fxfa/parser/cxfa_data.cpp
index 5f059a7dfe..19f85088b8 100644
--- a/xfa/fxfa/parser/cxfa_data.cpp
+++ b/xfa/fxfa/parser/cxfa_data.cpp
@@ -65,18 +65,18 @@ XFA_Element CXFA_Data::GetElementType() const {
return m_pNode ? m_pNode->GetElementType() : XFA_Element::Unknown;
}
-FX_BOOL CXFA_Data::TryMeasure(XFA_ATTRIBUTE eAttr,
- FX_FLOAT& fValue,
- FX_BOOL bUseDefault) const {
+bool CXFA_Data::TryMeasure(XFA_ATTRIBUTE eAttr,
+ FX_FLOAT& fValue,
+ bool bUseDefault) const {
CXFA_Measurement ms;
if (m_pNode->TryMeasure(eAttr, ms, bUseDefault)) {
fValue = ms.ToUnit(XFA_UNIT_Pt);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_Data::SetMeasure(XFA_ATTRIBUTE eAttr, FX_FLOAT fValue) {
+bool CXFA_Data::SetMeasure(XFA_ATTRIBUTE eAttr, FX_FLOAT fValue) {
CXFA_Measurement ms(fValue, XFA_UNIT_Pt);
return m_pNode->SetMeasure(eAttr, ms);
}
diff --git a/xfa/fxfa/parser/cxfa_data.h b/xfa/fxfa/parser/cxfa_data.h
index 829c84cc9f..890486d5fa 100644
--- a/xfa/fxfa/parser/cxfa_data.h
+++ b/xfa/fxfa/parser/cxfa_data.h
@@ -24,10 +24,10 @@ class CXFA_Data {
XFA_Element GetElementType() const;
protected:
- FX_BOOL TryMeasure(XFA_ATTRIBUTE eAttr,
- FX_FLOAT& fValue,
- FX_BOOL bUseDefault = FALSE) const;
- FX_BOOL SetMeasure(XFA_ATTRIBUTE eAttr, FX_FLOAT fValue);
+ bool TryMeasure(XFA_ATTRIBUTE eAttr,
+ FX_FLOAT& fValue,
+ bool bUseDefault = false) const;
+ bool SetMeasure(XFA_ATTRIBUTE eAttr, FX_FLOAT fValue);
CXFA_Node* m_pNode;
};
diff --git a/xfa/fxfa/parser/cxfa_dataexporter.cpp b/xfa/fxfa/parser/cxfa_dataexporter.cpp
index de2d08bbc2..ad9693f98f 100644
--- a/xfa/fxfa/parser/cxfa_dataexporter.cpp
+++ b/xfa/fxfa/parser/cxfa_dataexporter.cpp
@@ -76,11 +76,11 @@ CFX_WideString ExportEncodeContent(const CFX_WideStringC& str) {
void SaveAttribute(CXFA_Node* pNode,
XFA_ATTRIBUTE eName,
const CFX_WideStringC& wsName,
- FX_BOOL bProto,
+ bool bProto,
CFX_WideString& wsOutput) {
CFX_WideString wsValue;
if ((!bProto && !pNode->HasAttribute((XFA_ATTRIBUTE)eName, bProto)) ||
- !pNode->GetAttribute((XFA_ATTRIBUTE)eName, wsValue, FALSE)) {
+ !pNode->GetAttribute((XFA_ATTRIBUTE)eName, wsValue, false)) {
return;
}
wsValue = ExportEncodeAttribute(wsValue);
@@ -91,8 +91,8 @@ void SaveAttribute(CXFA_Node* pNode,
wsOutput += FX_WSTRC(L"\"");
}
-FX_BOOL AttributeSaveInDataModel(CXFA_Node* pNode, XFA_ATTRIBUTE eAttribute) {
- FX_BOOL bSaveInDataModel = FALSE;
+bool AttributeSaveInDataModel(CXFA_Node* pNode, XFA_ATTRIBUTE eAttribute) {
+ bool bSaveInDataModel = false;
if (pNode->GetElementType() != XFA_Element::Image)
return bSaveInDataModel;
@@ -103,32 +103,32 @@ FX_BOOL AttributeSaveInDataModel(CXFA_Node* pNode, XFA_ATTRIBUTE eAttribute) {
CXFA_Node* pFieldNode = pValueNode->GetNodeItem(XFA_NODEITEM_Parent);
if (pFieldNode && pFieldNode->GetBindData() &&
eAttribute == XFA_ATTRIBUTE_Href) {
- bSaveInDataModel = TRUE;
+ bSaveInDataModel = true;
}
return bSaveInDataModel;
}
-FX_BOOL ContentNodeNeedtoExport(CXFA_Node* pContentNode) {
+bool ContentNodeNeedtoExport(CXFA_Node* pContentNode) {
CFX_WideString wsContent;
- if (!pContentNode->TryContent(wsContent, FALSE, FALSE))
- return FALSE;
+ if (!pContentNode->TryContent(wsContent, false, false))
+ return false;
ASSERT(pContentNode->IsContentNode());
CXFA_Node* pParentNode = pContentNode->GetNodeItem(XFA_NODEITEM_Parent);
if (!pParentNode || pParentNode->GetElementType() != XFA_Element::Value)
- return TRUE;
+ return true;
CXFA_Node* pGrandParentNode = pParentNode->GetNodeItem(XFA_NODEITEM_Parent);
if (!pGrandParentNode || !pGrandParentNode->IsContainerNode())
- return TRUE;
+ return true;
if (pGrandParentNode->GetBindData())
- return FALSE;
+ return false;
CXFA_WidgetData* pWidgetData = pGrandParentNode->GetWidgetData();
XFA_Element eUIType = pWidgetData->GetUIType();
if (eUIType == XFA_Element::PasswordEdit)
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
void RecognizeXFAVersionNumber(CXFA_Node* pTemplateRoot,
@@ -151,7 +151,7 @@ void RecognizeXFAVersionNumber(CXFA_Node* pTemplateRoot,
void RegenerateFormFile_Changed(CXFA_Node* pNode,
CFX_WideTextBuf& buf,
- FX_BOOL bSaveXML) {
+ bool bSaveXML) {
CFX_WideString wsAttrs;
int32_t iAttrs = 0;
const uint8_t* pAttrs =
@@ -185,7 +185,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
break;
CFX_WideString wsContentType;
- pNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE);
+ pNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, false);
if (pRawValueNode->GetElementType() == XFA_Element::SharpxHTML &&
wsContentType == FX_WSTRC(L"text/html")) {
CFDE_XMLNode* pExDataXML = pNode->GetXMLMappingNode();
@@ -197,7 +197,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
if (!pRichTextXML)
break;
- IFX_MemoryStream* pMemStream = FX_CreateMemoryStream(TRUE);
+ IFX_MemoryStream* pMemStream = FX_CreateMemoryStream(true);
IFX_Stream* pTempStream = IFX_Stream::CreateStream(
(IFX_SeekableWriteStream*)pMemStream, FX_STREAMACCESS_Text |
FX_STREAMACCESS_Write |
@@ -211,7 +211,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
} else if (pRawValueNode->GetElementType() == XFA_Element::Sharpxml &&
wsContentType == FX_WSTRC(L"text/xml")) {
CFX_WideString wsRawValue;
- pRawValueNode->GetAttribute(XFA_ATTRIBUTE_Value, wsRawValue, FALSE);
+ pRawValueNode->GetAttribute(XFA_ATTRIBUTE_Value, wsRawValue, false);
if (wsRawValue.IsEmpty())
break;
@@ -269,7 +269,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
if (!pTemplateNode ||
pTemplateNode->CountChildren(XFA_Element::Unknown) !=
pNode->CountChildren(XFA_Element::Unknown)) {
- bSaveXML = TRUE;
+ bSaveXML = true;
}
}
CFX_WideTextBuf newBuf;
@@ -283,7 +283,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
if (!bSaveXML && !wsChildren.IsEmpty() &&
pNode->GetElementType() == XFA_Element::Items) {
wsChildren.clear();
- bSaveXML = TRUE;
+ bSaveXML = true;
CXFA_Node* pChild = pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
while (pChild) {
RegenerateFormFile_Changed(pChild, newBuf, bSaveXML);
@@ -299,7 +299,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
pNode->HasAttribute(XFA_ATTRIBUTE_Name)) {
CFX_WideStringC wsElement = pNode->GetClassName();
CFX_WideString wsName;
- SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), TRUE, wsName);
+ SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), true, wsName);
buf << FX_WSTRC(L"<");
buf << wsElement;
buf << wsName;
@@ -318,7 +318,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode,
void RegenerateFormFile_Container(CXFA_Node* pNode,
IFX_Stream* pStream,
- FX_BOOL bSaveXML = FALSE) {
+ bool bSaveXML = false) {
XFA_Element eType = pNode->GetElementType();
if (eType == XFA_Element::Field || eType == XFA_Element::Draw ||
!pNode->IsContainerNode()) {
@@ -334,7 +334,7 @@ void RegenerateFormFile_Container(CXFA_Node* pNode,
pStream->WriteString(L"<", 1);
pStream->WriteString(wsElement.c_str(), wsElement.GetLength());
CFX_WideString wsOutput;
- SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), TRUE, wsOutput);
+ SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), true, wsOutput);
CFX_WideString wsAttrs;
int32_t iAttrs = 0;
const uint8_t* pAttrs =
@@ -346,7 +346,7 @@ void RegenerateFormFile_Container(CXFA_Node* pNode,
continue;
CFX_WideString wsAttr;
- SaveAttribute(pNode, pAttr->eName, pAttr->pName, FALSE, wsAttr);
+ SaveAttribute(pNode, pAttr->eName, pAttr->pName, false, wsAttr);
wsOutput += wsAttr;
}
@@ -373,7 +373,7 @@ void RegenerateFormFile_Container(CXFA_Node* pNode,
void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode,
IFX_Stream* pStream,
const FX_CHAR* pChecksum,
- FX_BOOL bSaveXML) {
+ bool bSaveXML) {
if (pNode->IsModelNode()) {
static const FX_WCHAR s_pwsTagName[] = L"<form";
static const FX_WCHAR s_pwsClose[] = L"</form\n>";
@@ -444,34 +444,34 @@ CXFA_DataExporter::CXFA_DataExporter(CXFA_Document* pDocument)
ASSERT(m_pDocument);
}
-FX_BOOL CXFA_DataExporter::Export(IFX_SeekableWriteStream* pWrite) {
+bool CXFA_DataExporter::Export(IFX_SeekableWriteStream* pWrite) {
return Export(pWrite, m_pDocument->GetRoot(), 0, nullptr);
}
-FX_BOOL CXFA_DataExporter::Export(IFX_SeekableWriteStream* pWrite,
- CXFA_Node* pNode,
- uint32_t dwFlag,
- const FX_CHAR* pChecksum) {
+bool CXFA_DataExporter::Export(IFX_SeekableWriteStream* pWrite,
+ CXFA_Node* pNode,
+ uint32_t dwFlag,
+ const FX_CHAR* pChecksum) {
if (!pWrite) {
ASSERT(false);
- return FALSE;
+ return false;
}
IFX_Stream* pStream = IFX_Stream::CreateStream(
pWrite,
FX_STREAMACCESS_Text | FX_STREAMACCESS_Write | FX_STREAMACCESS_Append);
if (!pStream)
- return FALSE;
+ return false;
pStream->SetCodePage(FX_CODEPAGE_UTF8);
- FX_BOOL bRet = Export(pStream, pNode, dwFlag, pChecksum);
+ bool bRet = Export(pStream, pNode, dwFlag, pChecksum);
pStream->Release();
return bRet;
}
-FX_BOOL CXFA_DataExporter::Export(IFX_Stream* pStream,
- CXFA_Node* pNode,
- uint32_t dwFlag,
- const FX_CHAR* pChecksum) {
+bool CXFA_DataExporter::Export(IFX_Stream* pStream,
+ CXFA_Node* pNode,
+ uint32_t dwFlag,
+ const FX_CHAR* pChecksum) {
CFDE_XMLDoc* pXMLDoc = m_pDocument->GetXMLDoc();
if (pNode->IsModelNode()) {
switch (pNode->GetPacketID()) {
@@ -491,7 +491,7 @@ FX_BOOL CXFA_DataExporter::Export(IFX_Stream* pStream,
CFDE_XMLElement* pElement =
static_cast<CFDE_XMLElement*>(pNode->GetXMLMappingNode());
if (!pElement || pElement->GetType() != FDE_XMLNODE_Element)
- return FALSE;
+ return false;
CXFA_Node* pDataNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
ASSERT(pDataNode);
@@ -508,13 +508,13 @@ FX_BOOL CXFA_DataExporter::Export(IFX_Stream* pStream,
CFDE_XMLElement* pElement =
static_cast<CFDE_XMLElement*>(pNode->GetXMLMappingNode());
if (!pElement || pElement->GetType() != FDE_XMLNODE_Element)
- return FALSE;
+ return false;
pXMLDoc->SaveXMLNode(pStream, pElement);
break;
}
}
- return TRUE;
+ return true;
}
CXFA_Node* pDataNode = pNode->GetNodeItem(XFA_NODEITEM_Parent);
@@ -530,12 +530,12 @@ FX_BOOL CXFA_DataExporter::Export(IFX_Stream* pStream,
CFDE_XMLElement* pElement =
static_cast<CFDE_XMLElement*>(pExportNode->GetXMLMappingNode());
if (!pElement || pElement->GetType() != FDE_XMLNODE_Element)
- return FALSE;
+ return false;
XFA_DataExporter_DealWithDataGroupNode(pExportNode);
pElement->SetString(L"xmlns:xfa", L"http://www.xfa.org/schema/xfa-data/1.0/");
pXMLDoc->SaveXMLNode(pStream, pElement);
pElement->RemoveAttribute(L"xmlns:xfa");
- return TRUE;
+ return true;
}
diff --git a/xfa/fxfa/parser/cxfa_dataexporter.h b/xfa/fxfa/parser/cxfa_dataexporter.h
index c1123d1fe9..41f32a2fad 100644
--- a/xfa/fxfa/parser/cxfa_dataexporter.h
+++ b/xfa/fxfa/parser/cxfa_dataexporter.h
@@ -18,17 +18,17 @@ class CXFA_DataExporter {
public:
explicit CXFA_DataExporter(CXFA_Document* pDocument);
- FX_BOOL Export(IFX_SeekableWriteStream* pWrite);
- FX_BOOL Export(IFX_SeekableWriteStream* pWrite,
- CXFA_Node* pNode,
- uint32_t dwFlag,
- const FX_CHAR* pChecksum);
+ bool Export(IFX_SeekableWriteStream* pWrite);
+ bool Export(IFX_SeekableWriteStream* pWrite,
+ CXFA_Node* pNode,
+ uint32_t dwFlag,
+ const FX_CHAR* pChecksum);
protected:
- FX_BOOL Export(IFX_Stream* pStream,
- CXFA_Node* pNode,
- uint32_t dwFlag,
- const FX_CHAR* pChecksum);
+ bool Export(IFX_Stream* pStream,
+ CXFA_Node* pNode,
+ uint32_t dwFlag,
+ const FX_CHAR* pChecksum);
CXFA_Document* const m_pDocument;
};
diff --git a/xfa/fxfa/parser/cxfa_dataimporter.cpp b/xfa/fxfa/parser/cxfa_dataimporter.cpp
index 62c6536393..c0c798dfe6 100644
--- a/xfa/fxfa/parser/cxfa_dataimporter.cpp
+++ b/xfa/fxfa/parser/cxfa_dataimporter.cpp
@@ -21,24 +21,24 @@ CXFA_DataImporter::CXFA_DataImporter(CXFA_Document* pDocument)
ASSERT(m_pDocument);
}
-FX_BOOL CXFA_DataImporter::ImportData(IFX_SeekableReadStream* pDataDocument) {
+bool CXFA_DataImporter::ImportData(IFX_SeekableReadStream* pDataDocument) {
std::unique_ptr<CXFA_SimpleParser> pDataDocumentParser(
new CXFA_SimpleParser(m_pDocument, false));
if (pDataDocumentParser->StartParse(pDataDocument, XFA_XDPPACKET_Datasets) !=
XFA_PARSESTATUS_Ready) {
- return FALSE;
+ return false;
}
if (pDataDocumentParser->DoParse(nullptr) < XFA_PARSESTATUS_Done)
- return FALSE;
+ return false;
CXFA_Node* pImportDataRoot = pDataDocumentParser->GetRootNode();
if (!pImportDataRoot)
- return FALSE;
+ return false;
CXFA_Node* pDataModel =
ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Datasets));
if (!pDataModel)
- return FALSE;
+ return false;
CXFA_Node* pDataNode = ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Data));
if (pDataNode)
@@ -57,6 +57,6 @@ FX_BOOL CXFA_DataImporter::ImportData(IFX_SeekableReadStream* pDataDocument) {
pParentXMLNode->RemoveChildNode(pXMLNode);
pDataModel->InsertChild(pImportDataRoot);
}
- m_pDocument->DoDataRemerge(FALSE);
- return TRUE;
+ m_pDocument->DoDataRemerge(false);
+ return true;
}
diff --git a/xfa/fxfa/parser/cxfa_dataimporter.h b/xfa/fxfa/parser/cxfa_dataimporter.h
index d01f24cb05..86e41a8130 100644
--- a/xfa/fxfa/parser/cxfa_dataimporter.h
+++ b/xfa/fxfa/parser/cxfa_dataimporter.h
@@ -16,7 +16,7 @@ class CXFA_DataImporter {
public:
explicit CXFA_DataImporter(CXFA_Document* pDocument);
- FX_BOOL ImportData(IFX_SeekableReadStream* pDataDocument);
+ bool ImportData(IFX_SeekableReadStream* pDataDocument);
protected:
CXFA_Document* const m_pDocument;
diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp
index a644c6a92e..cc5f74ae23 100644
--- a/xfa/fxfa/parser/cxfa_document.cpp
+++ b/xfa/fxfa/parser/cxfa_document.cpp
@@ -50,7 +50,7 @@ void MergeNodeRecurse(CXFA_Document* pDocument,
}
return;
}
- CXFA_Node* pNewNode = pProtoNode->Clone(TRUE);
+ CXFA_Node* pNewNode = pProtoNode->Clone(true);
pNewNode->SetTemplateNode(pProtoNode);
pDestNodeParent->InsertChild(pNewNode, nullptr);
}
@@ -234,7 +234,7 @@ void CXFA_Document::AddPurgeNode(CXFA_Node* pNode) {
m_PurgeNodes.insert(pNode);
}
-FX_BOOL CXFA_Document::RemovePurgeNode(CXFA_Node* pNode) {
+bool CXFA_Document::RemovePurgeNode(CXFA_Node* pNode) {
return !!m_PurgeNodes.erase(pNode);
}
@@ -245,29 +245,29 @@ void CXFA_Document::PurgeNodes() {
m_PurgeNodes.clear();
}
-void CXFA_Document::SetFlag(uint32_t dwFlag, FX_BOOL bOn) {
+void CXFA_Document::SetFlag(uint32_t dwFlag, bool bOn) {
if (bOn)
m_dwDocFlags |= dwFlag;
else
m_dwDocFlags &= ~dwFlag;
}
-FX_BOOL CXFA_Document::IsInteractive() {
+bool CXFA_Document::IsInteractive() {
if (m_dwDocFlags & XFA_DOCFLAG_HasInteractive)
return !!(m_dwDocFlags & XFA_DOCFLAG_Interactive);
CXFA_Node* pConfig = ToNode(GetXFAObject(XFA_HASHCODE_Config));
if (!pConfig)
- return FALSE;
+ return false;
CFX_WideString wsInteractive;
CXFA_Node* pPresent = pConfig->GetFirstChildByClass(XFA_Element::Present);
if (!pPresent)
- return FALSE;
+ return false;
CXFA_Node* pPDF = pPresent->GetFirstChildByClass(XFA_Element::Pdf);
if (!pPDF)
- return FALSE;
+ return false;
CXFA_Node* pFormFiller = pPDF->GetChild(0, XFA_Element::Interactive);
if (pFormFiller) {
@@ -275,10 +275,10 @@ FX_BOOL CXFA_Document::IsInteractive() {
if (pFormFiller->TryContent(wsInteractive) &&
wsInteractive == FX_WSTRC(L"1")) {
m_dwDocFlags |= XFA_DOCFLAG_Interactive;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
CXFA_LocaleMgr* CXFA_Document::GetLocalMgr() {
diff --git a/xfa/fxfa/parser/cxfa_document.h b/xfa/fxfa/parser/cxfa_document.h
index 919be5da2d..4fd2d79504 100644
--- a/xfa/fxfa/parser/cxfa_document.h
+++ b/xfa/fxfa/parser/cxfa_document.h
@@ -75,13 +75,13 @@ class CXFA_Document {
void SetRoot(CXFA_Node* pNewRoot);
void AddPurgeNode(CXFA_Node* pNode);
- FX_BOOL RemovePurgeNode(CXFA_Node* pNode);
+ bool RemovePurgeNode(CXFA_Node* pNode);
void PurgeNodes();
bool HasFlag(uint32_t dwFlag) { return (m_dwDocFlags & dwFlag) == dwFlag; }
- void SetFlag(uint32_t dwFlag, FX_BOOL bOn);
+ void SetFlag(uint32_t dwFlag, bool bOn);
- FX_BOOL IsInteractive();
+ bool IsInteractive();
XFA_VERSION GetCurVersionMode() { return m_eCurVersionMode; }
XFA_VERSION RecognizeXFAVersionNumber(CFX_WideString& wsTemplateNS);
@@ -90,13 +90,13 @@ class CXFA_Document {
void DoProtoMerge();
void DoDataMerge();
- void DoDataRemerge(FX_BOOL bDoDataMerge);
+ void DoDataRemerge(bool bDoDataMerge);
CXFA_Node* DataMerge_CopyContainer(CXFA_Node* pTemplateNode,
CXFA_Node* pFormNode,
CXFA_Node* pDataScope,
- FX_BOOL bOneInstance,
- FX_BOOL bDataMerge,
- FX_BOOL bUpLevel);
+ bool bOneInstance,
+ bool bDataMerge,
+ bool bUpLevel);
void DataMerge_UpdateBindingRelations(CXFA_Node* pFormUpdateRoot);
void ClearLayoutData();
diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp
index ea38b3eec9..fe3cb933aa 100644
--- a/xfa/fxfa/parser/cxfa_document_parser.cpp
+++ b/xfa/fxfa/parser/cxfa_document_parser.cpp
@@ -10,7 +10,7 @@
#include "xfa/fxfa/parser/cxfa_document.h"
CXFA_DocumentParser::CXFA_DocumentParser(CXFA_FFNotify* pNotify)
- : m_nodeParser(nullptr, TRUE), m_pNotify(pNotify) {}
+ : m_nodeParser(nullptr, true), m_pNotify(pNotify) {}
CXFA_DocumentParser::~CXFA_DocumentParser() {
}
diff --git a/xfa/fxfa/parser/cxfa_exdata.cpp b/xfa/fxfa/parser/cxfa_exdata.cpp
index 358cc3d611..bf1e930330 100644
--- a/xfa/fxfa/parser/cxfa_exdata.cpp
+++ b/xfa/fxfa/parser/cxfa_exdata.cpp
@@ -10,6 +10,6 @@
CXFA_ExData::CXFA_ExData(CXFA_Node* pNode) : CXFA_Data(pNode) {}
-FX_BOOL CXFA_ExData::SetContentType(const CFX_WideString& wsContentType) {
+bool CXFA_ExData::SetContentType(const CFX_WideString& wsContentType) {
return m_pNode->SetCData(XFA_ATTRIBUTE_ContentType, wsContentType);
}
diff --git a/xfa/fxfa/parser/cxfa_exdata.h b/xfa/fxfa/parser/cxfa_exdata.h
index c5eddbf14c..c92bacd3f2 100644
--- a/xfa/fxfa/parser/cxfa_exdata.h
+++ b/xfa/fxfa/parser/cxfa_exdata.h
@@ -16,7 +16,7 @@ class CXFA_ExData : public CXFA_Data {
public:
explicit CXFA_ExData(CXFA_Node* pNode);
- FX_BOOL SetContentType(const CFX_WideString& wsContentType);
+ bool SetContentType(const CFX_WideString& wsContentType);
};
#endif // XFA_FXFA_PARSER_CXFA_EXDATA_H_
diff --git a/xfa/fxfa/parser/cxfa_fill.cpp b/xfa/fxfa/parser/cxfa_fill.cpp
index 0c4a6f547d..63949c193d 100644
--- a/xfa/fxfa/parser/cxfa_fill.cpp
+++ b/xfa/fxfa/parser/cxfa_fill.cpp
@@ -25,10 +25,10 @@ void CXFA_Fill::SetColor(FX_ARGB color) {
pNode->SetCData(XFA_ATTRIBUTE_Value, wsColor);
}
-FX_ARGB CXFA_Fill::GetColor(FX_BOOL bText) {
+FX_ARGB CXFA_Fill::GetColor(bool bText) {
if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Color)) {
CFX_WideStringC wsColor;
- if (pNode->TryCData(XFA_ATTRIBUTE_Value, wsColor, FALSE))
+ if (pNode->TryCData(XFA_ATTRIBUTE_Value, wsColor, false))
return CXFA_Data::ToColor(wsColor);
}
if (bText)
@@ -52,7 +52,7 @@ int32_t CXFA_Fill::GetPattern(FX_ARGB& foreColor) {
CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Pattern);
if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) {
CFX_WideStringC wsColor;
- pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, FALSE);
+ pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, false);
foreColor = CXFA_Data::ToColor(wsColor);
} else {
foreColor = 0xFF000000;
@@ -66,7 +66,7 @@ int32_t CXFA_Fill::GetStipple(FX_ARGB& stippleColor) {
pNode->TryInteger(XFA_ATTRIBUTE_Rate, eAttr);
if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) {
CFX_WideStringC wsColor;
- pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, FALSE);
+ pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, false);
stippleColor = CXFA_Data::ToColor(wsColor);
} else {
stippleColor = 0xFF000000;
@@ -80,7 +80,7 @@ int32_t CXFA_Fill::GetLinear(FX_ARGB& endColor) {
pNode->TryEnum(XFA_ATTRIBUTE_Type, eAttr);
if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) {
CFX_WideStringC wsColor;
- pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, FALSE);
+ pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, false);
endColor = CXFA_Data::ToColor(wsColor);
} else {
endColor = 0xFF000000;
@@ -94,7 +94,7 @@ int32_t CXFA_Fill::GetRadial(FX_ARGB& endColor) {
pNode->TryEnum(XFA_ATTRIBUTE_Type, eAttr);
if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) {
CFX_WideStringC wsColor;
- pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, FALSE);
+ pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, false);
endColor = CXFA_Data::ToColor(wsColor);
} else {
endColor = 0xFF000000;
diff --git a/xfa/fxfa/parser/cxfa_fill.h b/xfa/fxfa/parser/cxfa_fill.h
index 2a5f673aa0..4b13565765 100644
--- a/xfa/fxfa/parser/cxfa_fill.h
+++ b/xfa/fxfa/parser/cxfa_fill.h
@@ -19,7 +19,7 @@ class CXFA_Fill : public CXFA_Data {
~CXFA_Fill();
int32_t GetPresence();
- FX_ARGB GetColor(FX_BOOL bText = FALSE);
+ FX_ARGB GetColor(bool bText = false);
XFA_Element GetFillType();
int32_t GetPattern(FX_ARGB& foreColor);
int32_t GetStipple(FX_ARGB& stippleColor);
diff --git a/xfa/fxfa/parser/cxfa_font.cpp b/xfa/fxfa/parser/cxfa_font.cpp
index 2dcb405141..cedfda6294 100644
--- a/xfa/fxfa/parser/cxfa_font.cpp
+++ b/xfa/fxfa/parser/cxfa_font.cpp
@@ -70,13 +70,13 @@ void CXFA_Font::GetTypeface(CFX_WideStringC& wsTypeFace) {
m_pNode->TryCData(XFA_ATTRIBUTE_Typeface, wsTypeFace);
}
-FX_BOOL CXFA_Font::IsBold() {
+bool CXFA_Font::IsBold() {
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Normal;
m_pNode->TryEnum(XFA_ATTRIBUTE_Weight, eAttr);
return eAttr == XFA_ATTRIBUTEENUM_Bold;
}
-FX_BOOL CXFA_Font::IsItalic() {
+bool CXFA_Font::IsItalic() {
XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Normal;
m_pNode->TryEnum(XFA_ATTRIBUTE_Posture, eAttr);
return eAttr == XFA_ATTRIBUTEENUM_Italic;
@@ -89,5 +89,5 @@ void CXFA_Font::SetColor(FX_ARGB color) {
FX_ARGB CXFA_Font::GetColor() {
CXFA_Fill fill(m_pNode->GetChild(0, XFA_Element::Fill));
- return fill ? fill.GetColor(TRUE) : 0xFF000000;
+ return fill ? fill.GetColor(true) : 0xFF000000;
}
diff --git a/xfa/fxfa/parser/cxfa_font.h b/xfa/fxfa/parser/cxfa_font.h
index 0151dfbe5f..0342f68b27 100644
--- a/xfa/fxfa/parser/cxfa_font.h
+++ b/xfa/fxfa/parser/cxfa_font.h
@@ -26,8 +26,8 @@ class CXFA_Font : public CXFA_Data {
FX_FLOAT GetFontSize();
void GetTypeface(CFX_WideStringC& wsTypeFace);
- FX_BOOL IsBold();
- FX_BOOL IsItalic();
+ bool IsBold();
+ bool IsItalic();
FX_ARGB GetColor();
void SetColor(FX_ARGB color);
diff --git a/xfa/fxfa/parser/cxfa_image.cpp b/xfa/fxfa/parser/cxfa_image.cpp
index bcc7466dce..8061018470 100644
--- a/xfa/fxfa/parser/cxfa_image.cpp
+++ b/xfa/fxfa/parser/cxfa_image.cpp
@@ -8,18 +8,18 @@
#include "xfa/fxfa/parser/xfa_object.h"
-CXFA_Image::CXFA_Image(CXFA_Node* pNode, FX_BOOL bDefValue)
+CXFA_Image::CXFA_Image(CXFA_Node* pNode, bool bDefValue)
: CXFA_Data(pNode), m_bDefValue(bDefValue) {}
int32_t CXFA_Image::GetAspect() {
return m_pNode->GetEnum(XFA_ATTRIBUTE_Aspect);
}
-FX_BOOL CXFA_Image::GetContentType(CFX_WideString& wsContentType) {
+bool CXFA_Image::GetContentType(CFX_WideString& wsContentType) {
return m_pNode->TryCData(XFA_ATTRIBUTE_ContentType, wsContentType);
}
-FX_BOOL CXFA_Image::GetHref(CFX_WideString& wsHref) {
+bool CXFA_Image::GetHref(CFX_WideString& wsHref) {
if (m_bDefValue)
return m_pNode->TryCData(XFA_ATTRIBUTE_Href, wsHref);
return m_pNode->GetAttribute(FX_WSTRC(L"href"), wsHref);
@@ -31,24 +31,24 @@ int32_t CXFA_Image::GetTransferEncoding() {
return XFA_ATTRIBUTEENUM_Base64;
}
-FX_BOOL CXFA_Image::GetContent(CFX_WideString& wsText) {
+bool CXFA_Image::GetContent(CFX_WideString& wsText) {
return m_pNode->TryContent(wsText);
}
-FX_BOOL CXFA_Image::SetContentType(const CFX_WideString& wsContentType) {
+bool CXFA_Image::SetContentType(const CFX_WideString& wsContentType) {
return m_pNode->SetCData(XFA_ATTRIBUTE_ContentType, wsContentType);
}
-FX_BOOL CXFA_Image::SetHref(const CFX_WideString& wsHref) {
+bool CXFA_Image::SetHref(const CFX_WideString& wsHref) {
if (m_bDefValue)
return m_pNode->SetCData(XFA_ATTRIBUTE_Href, wsHref);
return m_pNode->SetAttribute(XFA_ATTRIBUTE_Href, wsHref.AsStringC());
}
-FX_BOOL CXFA_Image::SetTransferEncoding(int32_t iTransferEncoding) {
+bool CXFA_Image::SetTransferEncoding(int32_t iTransferEncoding) {
if (m_bDefValue) {
return m_pNode->SetEnum(XFA_ATTRIBUTE_TransferEncoding,
(XFA_ATTRIBUTEENUM)iTransferEncoding);
}
- return TRUE;
+ return true;
}
diff --git a/xfa/fxfa/parser/cxfa_image.h b/xfa/fxfa/parser/cxfa_image.h
index 4b088c8f90..bf69897693 100644
--- a/xfa/fxfa/parser/cxfa_image.h
+++ b/xfa/fxfa/parser/cxfa_image.h
@@ -15,19 +15,19 @@ class CXFA_Node;
class CXFA_Image : public CXFA_Data {
public:
- CXFA_Image(CXFA_Node* pNode, FX_BOOL bDefValue);
+ CXFA_Image(CXFA_Node* pNode, bool bDefValue);
int32_t GetAspect();
- FX_BOOL GetContentType(CFX_WideString& wsContentType);
- FX_BOOL GetHref(CFX_WideString& wsHref);
+ bool GetContentType(CFX_WideString& wsContentType);
+ bool GetHref(CFX_WideString& wsHref);
int32_t GetTransferEncoding();
- FX_BOOL GetContent(CFX_WideString& wsText);
- FX_BOOL SetContentType(const CFX_WideString& wsContentType);
- FX_BOOL SetHref(const CFX_WideString& wsHref);
- FX_BOOL SetTransferEncoding(int32_t iTransferEncoding);
+ bool GetContent(CFX_WideString& wsText);
+ bool SetContentType(const CFX_WideString& wsContentType);
+ bool SetHref(const CFX_WideString& wsHref);
+ bool SetTransferEncoding(int32_t iTransferEncoding);
protected:
- FX_BOOL m_bDefValue;
+ bool m_bDefValue;
};
#endif // XFA_FXFA_PARSER_CXFA_IMAGE_H_
diff --git a/xfa/fxfa/parser/cxfa_layoutitem.cpp b/xfa/fxfa/parser/cxfa_layoutitem.cpp
index ebe33b650f..264fe4e1b6 100644
--- a/xfa/fxfa/parser/cxfa_layoutitem.cpp
+++ b/xfa/fxfa/parser/cxfa_layoutitem.cpp
@@ -32,7 +32,7 @@ void XFA_ReleaseLayoutItem(CXFA_LayoutItem* pLayoutItem) {
delete pLayoutItem;
}
-CXFA_LayoutItem::CXFA_LayoutItem(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem)
+CXFA_LayoutItem::CXFA_LayoutItem(CXFA_Node* pNode, bool bIsContentLayoutItem)
: m_pFormNode(pNode),
m_pParent(nullptr),
m_pNextSibling(nullptr),
diff --git a/xfa/fxfa/parser/cxfa_layoutitem.h b/xfa/fxfa/parser/cxfa_layoutitem.h
index bacb2b8682..5991cd6f3e 100644
--- a/xfa/fxfa/parser/cxfa_layoutitem.h
+++ b/xfa/fxfa/parser/cxfa_layoutitem.h
@@ -19,14 +19,14 @@ class CXFA_LayoutItem {
public:
virtual ~CXFA_LayoutItem();
- FX_BOOL IsContainerLayoutItem() const { return !m_bIsContentLayoutItem; }
- FX_BOOL IsContentLayoutItem() const { return m_bIsContentLayoutItem; }
+ bool IsContainerLayoutItem() const { return !m_bIsContentLayoutItem; }
+ bool IsContentLayoutItem() const { return m_bIsContentLayoutItem; }
CXFA_ContainerLayoutItem* AsContainerLayoutItem();
CXFA_ContentLayoutItem* AsContentLayoutItem();
CXFA_ContainerLayoutItem* GetPage() const;
CXFA_Node* GetFormNode() const;
- void GetRect(CFX_RectF& rtLayout, FX_BOOL bRelative = FALSE) const;
+ void GetRect(CFX_RectF& rtLayout, bool bRelative = false) const;
int32_t GetIndex() const;
int32_t GetCount() const;
CXFA_LayoutItem* GetParent() const;
@@ -48,9 +48,9 @@ class CXFA_LayoutItem {
CXFA_LayoutItem* m_pFirstChild;
protected:
- CXFA_LayoutItem(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem);
+ CXFA_LayoutItem(CXFA_Node* pNode, bool bIsContentLayoutItem);
- FX_BOOL m_bIsContentLayoutItem;
+ bool m_bIsContentLayoutItem;
};
#endif // XFA_FXFA_PARSER_CXFA_LAYOUTITEM_H_
diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
index 48a9c78ffe..1be6d27129 100644
--- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
+++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
@@ -85,9 +85,9 @@ void SyncContainer(CXFA_FFNotify* pNotify,
CXFA_LayoutProcessor* pDocLayout,
CXFA_LayoutItem* pContainerItem,
uint32_t dwRelevant,
- FX_BOOL bVisible,
+ bool bVisible,
int32_t nPageIndex) {
- FX_BOOL bVisibleItem = FALSE;
+ bool bVisibleItem = false;
uint32_t dwStatus = 0;
uint32_t dwRelevantContainer = 0;
if (bVisible) {
@@ -95,7 +95,7 @@ void SyncContainer(CXFA_FFNotify* pNotify,
pContainerItem->m_pFormNode->GetEnum(XFA_ATTRIBUTE_Presence);
if (eAttributeValue == XFA_ATTRIBUTEENUM_Visible ||
eAttributeValue == XFA_ATTRIBUTEENUM_Unknown) {
- bVisibleItem = TRUE;
+ bVisibleItem = true;
}
dwRelevantContainer = GetRelevant(pContainerItem->m_pFormNode, dwRelevant);
dwStatus =
@@ -131,7 +131,7 @@ void RemoveLayoutItem(CXFA_ContainerLayoutItem* pLayoutItem) {
}
CXFA_Node* ResolveBreakTarget(CXFA_Node* pPageSetRoot,
- FX_BOOL bNewExprStyle,
+ bool bNewExprStyle,
CFX_WideStringC& wsTargetExpr) {
CXFA_Document* pDocument = pPageSetRoot->GetDocument();
if (wsTargetExpr.IsEmpty())
@@ -141,7 +141,7 @@ CXFA_Node* ResolveBreakTarget(CXFA_Node* pPageSetRoot,
wsTargetAll.TrimLeft();
wsTargetAll.TrimRight();
int32_t iSpliteIndex = 0;
- FX_BOOL bTargetAllFind = TRUE;
+ bool bTargetAllFind = true;
while (iSpliteIndex != -1) {
CFX_WideString wsExpr;
int32_t iSpliteNextIndex = 0;
@@ -154,7 +154,7 @@ CXFA_Node* ResolveBreakTarget(CXFA_Node* pPageSetRoot,
if (wsExpr.IsEmpty())
return nullptr;
- bTargetAllFind = FALSE;
+ bTargetAllFind = false;
if (wsExpr.GetAt(0) == '#') {
CXFA_Node* pNode = pDocument->GetNodeByID(
ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Template)),
@@ -186,7 +186,7 @@ void SetLayoutGeneratedNodeFlag(CXFA_Node* pNode) {
pNode->ClearFlag(XFA_NodeFlag_UnusedNode);
}
-FX_BOOL CheckContentAreaNotUsed(
+bool CheckContentAreaNotUsed(
CXFA_ContainerLayoutItem* pPageAreaLayoutItem,
CXFA_Node* pContentArea,
CXFA_ContainerLayoutItem*& pContentAreaLayoutItem) {
@@ -198,12 +198,12 @@ FX_BOOL CheckContentAreaNotUsed(
if (pLayoutItem->m_pFormNode == pContentArea) {
if (!pLayoutItem->m_pFirstChild) {
pContentAreaLayoutItem = pLayoutItem;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
void SyncRemoveLayoutItem(CXFA_LayoutItem* pParentLayoutItem,
@@ -248,7 +248,7 @@ CXFA_LayoutPageMgr::CXFA_LayoutPageMgr(CXFA_LayoutProcessor* pLayoutProcessor)
m_nAvailPages(0),
m_nCurPageCount(0),
m_ePageSetMode(XFA_ATTRIBUTEENUM_OrderedOccurrence),
- m_bCreateOverFlowPage(FALSE) {}
+ m_bCreateOverFlowPage(false) {}
CXFA_LayoutPageMgr::~CXFA_LayoutPageMgr() {
ClearData();
@@ -260,11 +260,11 @@ CXFA_LayoutPageMgr::~CXFA_LayoutPageMgr() {
}
}
-FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) {
+bool CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) {
PrepareLayout();
CXFA_Node* pTemplateNode = pFormNode->GetTemplateNode();
if (!pTemplateNode)
- return FALSE;
+ return false;
m_pTemplatePageSetRoot = pTemplateNode->GetProperty(0, XFA_Element::PageSet);
ASSERT(m_pTemplatePageSetRoot);
@@ -294,11 +294,11 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) {
if (pPageArea->GetElementType() == XFA_Element::PageArea) {
iCount++;
if (pPageArea->GetFirstChildByClass(XFA_Element::ContentArea))
- return TRUE;
+ return true;
}
}
if (iCount > 0)
- return FALSE;
+ return false;
CXFA_Document* pDocument = pTemplateNode->GetDocument();
pPageArea = m_pTemplatePageSetRoot->GetChild(0, XFA_Element::PageArea);
@@ -306,7 +306,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) {
pPageArea = pDocument->CreateNode(m_pTemplatePageSetRoot->GetPacketID(),
XFA_Element::PageArea);
if (!pPageArea)
- return FALSE;
+ return false;
m_pTemplatePageSetRoot->InsertChild(pPageArea, nullptr);
pPageArea->SetFlag(XFA_NodeFlag_Initialized, true);
@@ -316,7 +316,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) {
pContentArea = pDocument->CreateNode(pPageArea->GetPacketID(),
XFA_Element::ContentArea);
if (!pContentArea)
- return FALSE;
+ return false;
pPageArea->InsertChild(pContentArea, nullptr);
pContentArea->SetFlag(XFA_NodeFlag_Initialized, true);
@@ -334,7 +334,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) {
pMedium =
pDocument->CreateNode(pPageArea->GetPacketID(), XFA_Element::Medium);
if (!pContentArea)
- return FALSE;
+ return false;
pPageArea->InsertChild(pMedium, nullptr);
pMedium->SetFlag(XFA_NodeFlag_Initialized, true);
@@ -343,11 +343,11 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) {
pMedium->SetMeasure(XFA_ATTRIBUTE_Long,
CXFA_Measurement(11.0f, XFA_UNIT_In));
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) {
- FX_BOOL bProBreakBefore = FALSE;
+bool CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) {
+ bool bProBreakBefore = false;
CXFA_Node* pBreakBeforeNode = nullptr;
while (pRootSubform) {
for (CXFA_Node* pBreakNode =
@@ -359,7 +359,7 @@ FX_BOOL CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) {
(eType == XFA_Element::Break &&
pBreakNode->GetEnum(XFA_ATTRIBUTE_Before) !=
XFA_ATTRIBUTEENUM_Auto)) {
- bProBreakBefore = TRUE;
+ bProBreakBefore = true;
pBreakBeforeNode = pBreakNode;
break;
}
@@ -367,7 +367,7 @@ FX_BOOL CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) {
if (bProBreakBefore)
break;
- bProBreakBefore = TRUE;
+ bProBreakBefore = true;
pRootSubform = pRootSubform->GetFirstChildByClass(XFA_Element::Subform);
while (pRootSubform &&
!XFA_ItemLayoutProcessor_IsTakingSpace(pRootSubform)) {
@@ -377,21 +377,21 @@ FX_BOOL CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) {
}
CXFA_Node *pLeader, *pTrailer;
if (pBreakBeforeNode &&
- ExecuteBreakBeforeOrAfter(pBreakBeforeNode, TRUE, pLeader, pTrailer)) {
+ ExecuteBreakBeforeOrAfter(pBreakBeforeNode, true, pLeader, pTrailer)) {
m_pCurrentContainerRecord = m_rgProposedContainerRecord.GetHeadPosition();
- return TRUE;
+ return true;
}
- return AppendNewPage(TRUE);
+ return AppendNewPage(true);
}
-FX_BOOL CXFA_LayoutPageMgr::AppendNewPage(FX_BOOL bFirstTemPage) {
+bool CXFA_LayoutPageMgr::AppendNewPage(bool bFirstTemPage) {
if (m_pCurrentContainerRecord !=
m_rgProposedContainerRecord.GetTailPosition()) {
- return TRUE;
+ return true;
}
CXFA_Node* pPageNode = GetNextAvailPageArea(nullptr);
if (!pPageNode)
- return FALSE;
+ return false;
if (bFirstTemPage && !m_pCurrentContainerRecord)
m_pCurrentContainerRecord = m_rgProposedContainerRecord.GetHeadPosition();
return !bFirstTemPage || m_pCurrentContainerRecord;
@@ -439,7 +439,7 @@ void CXFA_LayoutPageMgr::SubmitContentItem(
XFA_ItemLayoutProcessorResult eStatus) {
if (pContentLayoutItem) {
GetCurrentContainerRecord()->pCurContentArea->AddChild(pContentLayoutItem);
- m_bCreateOverFlowPage = FALSE;
+ m_bCreateOverFlowPage = false;
}
if (eStatus != XFA_ItemLayoutProcessorResult_Done) {
@@ -470,11 +470,11 @@ FX_FLOAT CXFA_LayoutPageMgr::GetAvailHeight() {
return XFA_LAYOUT_FLOAT_MAX;
}
-FX_BOOL XFA_LayoutPageMgr_RunBreakTestScript(CXFA_Node* pTestScript) {
+bool XFA_LayoutPageMgr_RunBreakTestScript(CXFA_Node* pTestScript) {
CFX_WideString wsExpression;
pTestScript->TryContent(wsExpression);
if (wsExpression.IsEmpty())
- return TRUE;
+ return true;
return pTestScript->GetDocument()->GetNotify()->RunScript(
pTestScript, pTestScript->GetNodeItem(XFA_NODEITEM_Parent,
XFA_ObjectType::ContainerNode));
@@ -482,7 +482,7 @@ FX_BOOL XFA_LayoutPageMgr_RunBreakTestScript(CXFA_Node* pTestScript) {
CXFA_ContainerRecord* CXFA_LayoutPageMgr::CreateContainerRecord(
CXFA_Node* pPageNode,
- FX_BOOL bCreateNew) {
+ bool bCreateNew) {
CXFA_ContainerRecord* pNewRecord = new CXFA_ContainerRecord();
if (m_pCurrentContainerRecord) {
if (!IsPageSetRootOrderedOccurrence() || !pPageNode) {
@@ -622,12 +622,12 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() {
if (!FindPageAreaFromPageSet_SimplexDuplex(
pPageSetLayoutItem->m_pFormNode, nullptr, nullptr, nullptr,
- TRUE, TRUE, nPageAreaCount == 1 ? XFA_ATTRIBUTEENUM_Only
+ true, true, nPageAreaCount == 1 ? XFA_ATTRIBUTEENUM_Only
: XFA_ATTRIBUTEENUM_Last) &&
(nPageAreaCount == 1 &&
!FindPageAreaFromPageSet_SimplexDuplex(
pPageSetLayoutItem->m_pFormNode, nullptr, nullptr, nullptr,
- TRUE, TRUE, XFA_ATTRIBUTEENUM_Last))) {
+ true, true, XFA_ATTRIBUTEENUM_Last))) {
break;
}
CXFA_Node* pNode = m_pCurPageArea;
@@ -647,7 +647,7 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() {
break;
}
}
- FX_BOOL bUsable = TRUE;
+ bool bUsable = true;
CFX_ArrayTemplate<FX_FLOAT> rgUsedHeights;
for (CXFA_LayoutItem* pChildLayoutItem =
pLastPageAreaLayoutItem->m_pFirstChild;
@@ -685,7 +685,7 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() {
pContentAreaNode->GetMeasure(XFA_ATTRIBUTE_H)
.ToUnit(XFA_UNIT_Pt) +
XFA_LAYOUT_FLOAT_PERCISION) {
- bUsable = FALSE;
+ bUsable = false;
break;
}
}
@@ -739,11 +739,11 @@ int32_t CXFA_LayoutPageMgr::GetPageIndex(
return m_PageArray.Find(const_cast<CXFA_ContainerLayoutItem*>(pPage));
}
-FX_BOOL CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType,
- XFA_ATTRIBUTEENUM eTargetType,
- CXFA_Node* pTarget,
- FX_BOOL bStartNew) {
- FX_BOOL bRet = FALSE;
+bool CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType,
+ XFA_ATTRIBUTEENUM eTargetType,
+ CXFA_Node* pTarget,
+ bool bStartNew) {
+ bool bRet = false;
switch (eTargetType) {
case XFA_ATTRIBUTEENUM_ContentArea:
if (pTarget && pTarget->GetElementType() != XFA_Element::ContentArea)
@@ -766,7 +766,7 @@ FX_BOOL CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType,
if (!pTarget || !m_pCurrentContainerRecord ||
pTarget != GetCurrentContainerRecord()->pCurPageArea->m_pFormNode ||
bStartNew) {
- CXFA_Node* pPageArea = GetNextAvailPageArea(pTarget, nullptr, TRUE);
+ CXFA_Node* pPageArea = GetNextAvailPageArea(pTarget, nullptr, true);
bRet = !!pPageArea;
}
break;
@@ -785,9 +785,9 @@ FX_BOOL CXFA_LayoutPageMgr::RunBreak(XFA_Element eBreakType,
return bRet;
}
-FX_BOOL CXFA_LayoutPageMgr::ExecuteBreakBeforeOrAfter(
+bool CXFA_LayoutPageMgr::ExecuteBreakBeforeOrAfter(
CXFA_Node* pCurNode,
- FX_BOOL bBefore,
+ bool bBefore,
CXFA_Node*& pBreakLeaderTemplate,
CXFA_Node*& pBreakTrailerTemplate) {
XFA_Element eType = pCurNode->GetElementType();
@@ -798,23 +798,23 @@ FX_BOOL CXFA_LayoutPageMgr::ExecuteBreakBeforeOrAfter(
CXFA_Node* pFormNode = pCurNode->GetNodeItem(
XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode);
CXFA_Node* pContainer = pFormNode->GetTemplateNode();
- FX_BOOL bStartNew = pCurNode->GetInteger(XFA_ATTRIBUTE_StartNew) != 0;
+ bool bStartNew = pCurNode->GetInteger(XFA_ATTRIBUTE_StartNew) != 0;
CXFA_Node* pScript = pCurNode->GetFirstChildByClass(XFA_Element::Script);
if (pScript && !XFA_LayoutPageMgr_RunBreakTestScript(pScript))
- return FALSE;
+ return false;
CFX_WideStringC wsTarget = pCurNode->GetCData(XFA_ATTRIBUTE_Target);
CXFA_Node* pTarget =
- ResolveBreakTarget(m_pTemplatePageSetRoot, TRUE, wsTarget);
+ ResolveBreakTarget(m_pTemplatePageSetRoot, true, wsTarget);
wsBreakTrailer = pCurNode->GetCData(XFA_ATTRIBUTE_Trailer);
wsBreakLeader = pCurNode->GetCData(XFA_ATTRIBUTE_Leader);
pBreakLeaderTemplate =
- ResolveBreakTarget(pContainer, TRUE, wsBreakLeader);
+ ResolveBreakTarget(pContainer, true, wsBreakLeader);
pBreakTrailerTemplate =
- ResolveBreakTarget(pContainer, TRUE, wsBreakTrailer);
+ ResolveBreakTarget(pContainer, true, wsBreakTrailer);
if (RunBreak(eType, pCurNode->GetEnum(XFA_ATTRIBUTE_TargetType), pTarget,
bStartNew)) {
- return TRUE;
+ return true;
}
if (m_rgProposedContainerRecord.GetCount() > 0 &&
m_pCurrentContainerRecord ==
@@ -833,36 +833,36 @@ FX_BOOL CXFA_LayoutPageMgr::ExecuteBreakBeforeOrAfter(
pParentNode->GetElementType() != XFA_Element::Form) {
break;
}
- return TRUE;
+ return true;
}
break;
}
case XFA_Element::Break: {
- FX_BOOL bStartNew = pCurNode->GetInteger(XFA_ATTRIBUTE_StartNew) != 0;
+ bool bStartNew = pCurNode->GetInteger(XFA_ATTRIBUTE_StartNew) != 0;
CFX_WideStringC wsTarget = pCurNode->GetCData(
bBefore ? XFA_ATTRIBUTE_BeforeTarget : XFA_ATTRIBUTE_AfterTarget);
CXFA_Node* pTarget =
- ResolveBreakTarget(m_pTemplatePageSetRoot, TRUE, wsTarget);
+ ResolveBreakTarget(m_pTemplatePageSetRoot, true, wsTarget);
if (RunBreak(bBefore ? XFA_Element::BreakBefore : XFA_Element::BreakAfter,
pCurNode->GetEnum(bBefore ? XFA_ATTRIBUTE_Before
: XFA_ATTRIBUTE_After),
pTarget, bStartNew)) {
- return TRUE;
+ return true;
}
break;
}
default:
break;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_LayoutPageMgr::ProcessBreakBeforeOrAfter(
+bool CXFA_LayoutPageMgr::ProcessBreakBeforeOrAfter(
CXFA_Node* pBreakNode,
- FX_BOOL bBefore,
+ bool bBefore,
CXFA_Node*& pBreakLeaderNode,
CXFA_Node*& pBreakTrailerNode,
- FX_BOOL& bCreatePage) {
+ bool& bCreatePage) {
CXFA_Node* pLeaderTemplate = nullptr;
CXFA_Node* pTrailerTemplate = nullptr;
CXFA_Node* pFormNode = pBreakNode->GetNodeItem(XFA_NODEITEM_Parent,
@@ -879,7 +879,7 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessBreakBeforeOrAfter(
pDataScope = XFA_DataMerge_FindDataScope(pFormNode);
pBreakLeaderNode = pDocument->DataMerge_CopyContainer(
- pLeaderTemplate, pFormNode, pDataScope, TRUE, TRUE, TRUE);
+ pLeaderTemplate, pFormNode, pDataScope, true, true, true);
pDocument->DataMerge_UpdateBindingRelations(pBreakLeaderNode);
SetLayoutGeneratedNodeFlag(pBreakLeaderNode);
}
@@ -888,18 +888,18 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessBreakBeforeOrAfter(
pDataScope = XFA_DataMerge_FindDataScope(pFormNode);
pBreakTrailerNode = pDocument->DataMerge_CopyContainer(
- pTrailerTemplate, pFormNode, pDataScope, TRUE, TRUE, TRUE);
+ pTrailerTemplate, pFormNode, pDataScope, true, true, true);
pDocument->DataMerge_UpdateBindingRelations(pBreakTrailerNode);
SetLayoutGeneratedNodeFlag(pBreakTrailerNode);
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_LayoutPageMgr::ProcessBookendLeaderOrTrailer(
+bool CXFA_LayoutPageMgr::ProcessBookendLeaderOrTrailer(
CXFA_Node* pBookendNode,
- FX_BOOL bLeader,
+ bool bLeader,
CXFA_Node*& pBookendAppendNode) {
CXFA_Node* pLeaderTemplate = nullptr;
CXFA_Node* pFormNode = pBookendNode->GetNodeItem(
@@ -912,19 +912,19 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessBookendLeaderOrTrailer(
pDataScope = XFA_DataMerge_FindDataScope(pFormNode);
pBookendAppendNode = pDocument->DataMerge_CopyContainer(
- pLeaderTemplate, pFormNode, pDataScope, TRUE, TRUE, TRUE);
+ pLeaderTemplate, pFormNode, pDataScope, true, true, true);
pDocument->DataMerge_UpdateBindingRelations(pBookendAppendNode);
SetLayoutGeneratedNodeFlag(pBookendAppendNode);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode,
CXFA_Node*& pLeaderTemplate,
CXFA_Node*& pTrailerTemplate,
- FX_BOOL bCreatePage) {
+ bool bCreatePage) {
CXFA_Node* pContainer =
pOverflowNode
->GetNodeItem(XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode)
@@ -941,17 +941,17 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode,
if (!wsOverflowTarget.IsEmpty() && bCreatePage &&
!m_bCreateOverFlowPage) {
CXFA_Node* pTarget =
- ResolveBreakTarget(m_pTemplatePageSetRoot, TRUE, wsOverflowTarget);
+ ResolveBreakTarget(m_pTemplatePageSetRoot, true, wsOverflowTarget);
if (pTarget) {
- m_bCreateOverFlowPage = TRUE;
+ m_bCreateOverFlowPage = true;
switch (pTarget->GetElementType()) {
case XFA_Element::PageArea:
RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_PageArea,
- pTarget, TRUE);
+ pTarget, true);
break;
case XFA_Element::ContentArea:
RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_ContentArea,
- pTarget, TRUE);
+ pTarget, true);
break;
default:
break;
@@ -960,9 +960,9 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode,
}
if (!bCreatePage) {
pLeaderTemplate =
- ResolveBreakTarget(pContainer, TRUE, wsOverflowLeader);
+ ResolveBreakTarget(pContainer, true, wsOverflowLeader);
pTrailerTemplate =
- ResolveBreakTarget(pContainer, TRUE, wsOverflowTrailer);
+ ResolveBreakTarget(pContainer, true, wsOverflowTrailer);
}
return pOverflowNode;
}
@@ -980,17 +980,17 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode,
pOverflowNode->TryCData(XFA_ATTRIBUTE_Target, wsOverflowTarget);
if (!wsOverflowTarget.IsEmpty() && bCreatePage && !m_bCreateOverFlowPage) {
CXFA_Node* pTarget =
- ResolveBreakTarget(m_pTemplatePageSetRoot, TRUE, wsOverflowTarget);
+ ResolveBreakTarget(m_pTemplatePageSetRoot, true, wsOverflowTarget);
if (pTarget) {
- m_bCreateOverFlowPage = TRUE;
+ m_bCreateOverFlowPage = true;
switch (pTarget->GetElementType()) {
case XFA_Element::PageArea:
RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_PageArea, pTarget,
- TRUE);
+ true);
break;
case XFA_Element::ContentArea:
RunBreak(XFA_Element::Overflow, XFA_ATTRIBUTEENUM_ContentArea,
- pTarget, TRUE);
+ pTarget, true);
break;
default:
break;
@@ -998,26 +998,26 @@ CXFA_Node* CXFA_LayoutPageMgr::BreakOverflow(CXFA_Node* pOverflowNode,
}
}
if (!bCreatePage) {
- pLeaderTemplate = ResolveBreakTarget(pContainer, TRUE, wsOverflowLeader);
- pTrailerTemplate = ResolveBreakTarget(pContainer, TRUE, wsOverflowTrailer);
+ pLeaderTemplate = ResolveBreakTarget(pContainer, true, wsOverflowLeader);
+ pTrailerTemplate = ResolveBreakTarget(pContainer, true, wsOverflowTrailer);
}
return pOverflowNode;
}
-FX_BOOL CXFA_LayoutPageMgr::ProcessOverflow(CXFA_Node* pFormNode,
- CXFA_Node*& pLeaderNode,
- CXFA_Node*& pTrailerNode,
- FX_BOOL bDataMerge,
- FX_BOOL bCreatePage) {
+bool CXFA_LayoutPageMgr::ProcessOverflow(CXFA_Node* pFormNode,
+ CXFA_Node*& pLeaderNode,
+ CXFA_Node*& pTrailerNode,
+ bool bDataMerge,
+ bool bCreatePage) {
if (!pFormNode)
- return FALSE;
+ return false;
CXFA_Node* pLeaderTemplate = nullptr;
CXFA_Node* pTrailerTemplate = nullptr;
- FX_BOOL bIsOverflowNode = FALSE;
+ bool bIsOverflowNode = false;
if (pFormNode->GetElementType() == XFA_Element::Overflow ||
pFormNode->GetElementType() == XFA_Element::Break) {
- bIsOverflowNode = TRUE;
+ bIsOverflowNode = true;
}
for (CXFA_Node* pCurNode =
bIsOverflowNode ? pFormNode
@@ -1035,7 +1035,7 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessOverflow(CXFA_Node* pFormNode,
pDataScope = XFA_DataMerge_FindDataScope(pFormNode);
pLeaderNode = pDocument->DataMerge_CopyContainer(
- pLeaderTemplate, pFormNode, pDataScope, TRUE, TRUE, TRUE);
+ pLeaderTemplate, pFormNode, pDataScope, true, true, true);
pDocument->DataMerge_UpdateBindingRelations(pLeaderNode);
SetLayoutGeneratedNodeFlag(pLeaderNode);
}
@@ -1044,22 +1044,22 @@ FX_BOOL CXFA_LayoutPageMgr::ProcessOverflow(CXFA_Node* pFormNode,
pDataScope = XFA_DataMerge_FindDataScope(pFormNode);
pTrailerNode = pDocument->DataMerge_CopyContainer(
- pTrailerTemplate, pFormNode, pDataScope, TRUE, TRUE, TRUE);
+ pTrailerTemplate, pFormNode, pDataScope, true, true, true);
pDocument->DataMerge_UpdateBindingRelations(pTrailerNode);
SetLayoutGeneratedNodeFlag(pTrailerNode);
}
- return TRUE;
+ return true;
}
if (bIsOverflowNode) {
break;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_LayoutPageMgr::ResolveBookendLeaderOrTrailer(
+bool CXFA_LayoutPageMgr::ResolveBookendLeaderOrTrailer(
CXFA_Node* pBookendNode,
- FX_BOOL bLeader,
+ bool bLeader,
CXFA_Node*& pBookendAppendTemplate) {
CFX_WideStringC wsBookendLeader;
CXFA_Node* pContainer =
@@ -1072,30 +1072,29 @@ FX_BOOL CXFA_LayoutPageMgr::ResolveBookendLeaderOrTrailer(
wsBookendLeader);
if (!wsBookendLeader.IsEmpty()) {
pBookendAppendTemplate =
- ResolveBreakTarget(pContainer, FALSE, wsBookendLeader);
- return TRUE;
+ ResolveBreakTarget(pContainer, false, wsBookendLeader);
+ return true;
}
- return FALSE;
+ return false;
} else if (pBookendNode->GetElementType() == XFA_Element::Bookend) {
pBookendNode->TryCData(
bLeader ? XFA_ATTRIBUTE_Leader : XFA_ATTRIBUTE_Trailer,
wsBookendLeader);
pBookendAppendTemplate =
- ResolveBreakTarget(pContainer, TRUE, wsBookendLeader);
- return TRUE;
+ ResolveBreakTarget(pContainer, true, wsBookendLeader);
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet(
- CXFA_Node* pPageSet,
- CXFA_Node* pStartChild,
- CXFA_Node* pTargetPageArea,
- CXFA_Node* pTargetContentArea,
- FX_BOOL bNewPage,
- FX_BOOL bQuery) {
+bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet(CXFA_Node* pPageSet,
+ CXFA_Node* pStartChild,
+ CXFA_Node* pTargetPageArea,
+ CXFA_Node* pTargetContentArea,
+ bool bNewPage,
+ bool bQuery) {
if (!pPageSet && !pStartChild)
- return FALSE;
+ return false;
if (IsPageSetRootOrderedOccurrence()) {
return FindPageAreaFromPageSet_Ordered(pPageSet, pStartChild,
@@ -1110,25 +1109,25 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet(
bQuery, ePreferredPosition);
}
-FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered(
+bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered(
CXFA_Node* pPageSet,
CXFA_Node* pStartChild,
CXFA_Node* pTargetPageArea,
CXFA_Node* pTargetContentArea,
- FX_BOOL bNewPage,
- FX_BOOL bQuery) {
+ bool bNewPage,
+ bool bQuery) {
int32_t iPageSetCount = 0;
if (!pStartChild && !bQuery) {
m_pPageSetMap.Lookup(pPageSet, iPageSetCount);
int32_t iMax = -1;
CXFA_Node* pOccurNode = pPageSet->GetFirstChildByClass(XFA_Element::Occur);
if (pOccurNode)
- pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE);
+ pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, false);
if (iMax >= 0 && iMax <= iPageSetCount)
- return FALSE;
+ return false;
}
- FX_BOOL bRes = FALSE;
+ bool bRes = false;
CXFA_Node* pCurrentNode =
pStartChild ? pStartChild->GetNodeItem(XFA_NODEITEM_NextSibling)
: pPageSet->GetNodeItem(XFA_NODEITEM_FirstChild);
@@ -1138,7 +1137,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered(
if ((pTargetPageArea == pCurrentNode || !pTargetPageArea)) {
if (!pCurrentNode->GetFirstChildByClass(XFA_Element::ContentArea)) {
if (pTargetPageArea == pCurrentNode) {
- CreateMinPageRecord(pCurrentNode, TRUE);
+ CreateMinPageRecord(pCurrentNode, true);
pTargetPageArea = nullptr;
}
continue;
@@ -1155,20 +1154,20 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered(
}
m_pCurPageArea = pCurrentNode;
m_nCurPageCount = 1;
- bRes = TRUE;
+ bRes = true;
break;
}
if (!bQuery)
- CreateMinPageRecord(pCurrentNode, FALSE);
+ CreateMinPageRecord(pCurrentNode, false);
} else if (pCurrentNode->GetElementType() == XFA_Element::PageSet) {
if (FindPageAreaFromPageSet_Ordered(pCurrentNode, nullptr,
pTargetPageArea, pTargetContentArea,
bNewPage, bQuery)) {
- bRes = TRUE;
+ bRes = true;
break;
}
if (!bQuery)
- CreateMinPageSetRecord(pCurrentNode, TRUE);
+ CreateMinPageSetRecord(pCurrentNode, true);
}
}
if (!pStartChild && bRes && !bQuery)
@@ -1176,13 +1175,13 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered(
return bRes;
}
-FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex(
+bool CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex(
CXFA_Node* pPageSet,
CXFA_Node* pStartChild,
CXFA_Node* pTargetPageArea,
CXFA_Node* pTargetContentArea,
- FX_BOOL bNewPage,
- FX_BOOL bQuery,
+ bool bNewPage,
+ bool bQuery,
XFA_ATTRIBUTEENUM ePreferredPosition) {
const XFA_ATTRIBUTEENUM eFallbackPosition = XFA_ATTRIBUTEENUM_Any;
CXFA_Node* pPreferredPageArea = nullptr;
@@ -1196,7 +1195,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex(
for (; pCurrentNode;
pCurrentNode = pCurrentNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pCurrentNode->GetElementType() == XFA_Element::PageArea) {
- if (!MatchPageAreaOddOrEven(pCurrentNode, FALSE))
+ if (!MatchPageAreaOddOrEven(pCurrentNode, false))
continue;
XFA_ATTRIBUTEENUM eCurPagePosition =
@@ -1215,7 +1214,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex(
AddContentAreaLayoutItem(pNewRecord, pCurrentNode->GetFirstChildByClass(
XFA_Element::ContentArea));
pPreferredPageArea = pCurrentNode;
- return FALSE;
+ return false;
}
if (ePreferredPosition == XFA_ATTRIBUTEENUM_Only) {
if (eCurPagePosition != ePreferredPosition)
@@ -1226,7 +1225,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex(
pPreferredPageArea = pCurrentNode;
break;
}
- return FALSE;
+ return false;
}
if ((pTargetPageArea == pCurrentNode || !pTargetPageArea)) {
if (!pCurrentNode->GetFirstChildByClass(XFA_Element::ContentArea)) {
@@ -1247,7 +1246,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex(
pFallbackPageArea = pCurrentNode;
}
} else if (pTargetPageArea &&
- !MatchPageAreaOddOrEven(pTargetPageArea, FALSE)) {
+ !MatchPageAreaOddOrEven(pTargetPageArea, false)) {
CXFA_ContainerRecord* pNewRecord = CreateContainerRecord();
AddPageAreaLayoutItem(pNewRecord, pCurrentNode);
AddContentAreaLayoutItem(pNewRecord, pCurrentNode->GetFirstChildByClass(
@@ -1269,7 +1268,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex(
pCurPageArea = pFallbackPageArea;
if (!pCurPageArea)
- return FALSE;
+ return false;
if (!bQuery) {
CXFA_ContainerRecord* pNewRecord = CreateContainerRecord();
@@ -1281,13 +1280,13 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_SimplexDuplex(
AddContentAreaLayoutItem(pNewRecord, pTargetContentArea);
}
m_pCurPageArea = pCurPageArea;
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_LayoutPageMgr::MatchPageAreaOddOrEven(CXFA_Node* pPageArea,
- FX_BOOL bLastMatch) {
+bool CXFA_LayoutPageMgr::MatchPageAreaOddOrEven(CXFA_Node* pPageArea,
+ bool bLastMatch) {
if (m_ePageSetMode != XFA_ATTRIBUTEENUM_DuplexPaginated)
- return TRUE;
+ return true;
XFA_ATTRIBUTEENUM eOddOrEven = XFA_ATTRIBUTEENUM_Any;
pPageArea->TryEnum(XFA_ATTRIBUTE_OddOrEven, eOddOrEven);
@@ -1300,14 +1299,14 @@ FX_BOOL CXFA_LayoutPageMgr::MatchPageAreaOddOrEven(CXFA_Node* pPageArea,
return eOddOrEven == XFA_ATTRIBUTEENUM_Odd ? iPageCount % 2 == 0
: iPageCount % 2 == 1;
}
- return TRUE;
+ return true;
}
CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea(
CXFA_Node* pTargetPageArea,
CXFA_Node* pTargetContentArea,
- FX_BOOL bNewPage,
- FX_BOOL bQuery) {
+ bool bNewPage,
+ bool bQuery) {
if (!m_pCurPageArea) {
FindPageAreaFromPageSet(m_pTemplatePageSetRoot, nullptr, pTargetPageArea,
pTargetContentArea, bNewPage, bQuery);
@@ -1324,7 +1323,7 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea(
CXFA_Node* pOccurNode =
m_pCurPageArea->GetFirstChildByClass(XFA_Element::Occur);
if (pOccurNode)
- pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE);
+ pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, false);
if ((iMax < 0 || m_nCurPageCount < iMax)) {
if (!bQuery) {
CXFA_ContainerRecord* pNewRecord =
@@ -1343,7 +1342,7 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea(
}
if (!bQuery && IsPageSetRootOrderedOccurrence())
- CreateMinPageRecord(m_pCurPageArea, FALSE, TRUE);
+ CreateMinPageRecord(m_pCurPageArea, false, true);
if (FindPageAreaFromPageSet(m_pCurPageArea->GetNodeItem(XFA_NODEITEM_Parent),
m_pCurPageArea, pTargetPageArea,
pTargetContentArea, bNewPage, bQuery)) {
@@ -1351,7 +1350,7 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea(
}
CXFA_Node* pPageSet = m_pCurPageArea->GetNodeItem(XFA_NODEITEM_Parent);
- while (TRUE) {
+ while (true) {
if (FindPageAreaFromPageSet(pPageSet, nullptr, pTargetPageArea,
pTargetContentArea, bNewPage, bQuery)) {
return m_pCurPageArea;
@@ -1370,36 +1369,36 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea(
return nullptr;
}
-FX_BOOL CXFA_LayoutPageMgr::GetNextContentArea(CXFA_Node* pContentArea) {
+bool CXFA_LayoutPageMgr::GetNextContentArea(CXFA_Node* pContentArea) {
CXFA_Node* pCurContentNode =
GetCurrentContainerRecord()->pCurContentArea->m_pFormNode;
if (!pContentArea) {
pContentArea =
pCurContentNode->GetNextSameClassSibling(XFA_Element::ContentArea);
if (!pContentArea)
- return FALSE;
+ return false;
} else {
if (pContentArea->GetNodeItem(XFA_NODEITEM_Parent) != m_pCurPageArea)
- return FALSE;
+ return false;
CXFA_ContainerLayoutItem* pContentAreaLayout = nullptr;
if (!CheckContentAreaNotUsed(GetCurrentContainerRecord()->pCurPageArea,
pContentArea, pContentAreaLayout)) {
- return FALSE;
+ return false;
}
if (pContentAreaLayout) {
if (pContentAreaLayout->m_pFormNode != pCurContentNode) {
CXFA_ContainerRecord* pNewRecord = CreateContainerRecord();
pNewRecord->pCurContentArea = pContentAreaLayout;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
}
CXFA_ContainerRecord* pNewRecord = CreateContainerRecord();
AddContentAreaLayoutItem(pNewRecord, pContentArea);
- return TRUE;
+ return true;
}
void CXFA_LayoutPageMgr::InitPageSetMap() {
@@ -1419,14 +1418,14 @@ void CXFA_LayoutPageMgr::InitPageSetMap() {
}
int32_t CXFA_LayoutPageMgr::CreateMinPageRecord(CXFA_Node* pPageArea,
- FX_BOOL bTargetPageArea,
- FX_BOOL bCreateLast) {
+ bool bTargetPageArea,
+ bool bCreateLast) {
if (!pPageArea)
return 0;
CXFA_Node* pOccurNode = pPageArea->GetFirstChildByClass(XFA_Element::Occur);
int32_t iMin = 0;
- if ((pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, FALSE)) ||
+ if ((pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, false)) ||
bTargetPageArea) {
CXFA_Node* pContentArea =
pPageArea->GetFirstChildByClass(XFA_Element::ContentArea);
@@ -1447,7 +1446,7 @@ int32_t CXFA_LayoutPageMgr::CreateMinPageRecord(CXFA_Node* pPageArea,
}
void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet,
- FX_BOOL bCreateAll) {
+ bool bCreateAll) {
if (!pPageSet)
return;
@@ -1459,7 +1458,7 @@ void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet,
CXFA_Node* pOccurNode = pPageSet->GetFirstChildByClass(XFA_Element::Occur);
int32_t iMin = 0;
- if (pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, FALSE)) {
+ if (pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, false)) {
if (iCurSetCount < iMin) {
for (int32_t i = 0; i < iMin - iCurSetCount; i++) {
for (CXFA_Node* pCurrentPageNode =
@@ -1467,10 +1466,10 @@ void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet,
pCurrentPageNode; pCurrentPageNode = pCurrentPageNode->GetNodeItem(
XFA_NODEITEM_NextSibling)) {
if (pCurrentPageNode->GetElementType() == XFA_Element::PageArea) {
- CreateMinPageRecord(pCurrentPageNode, FALSE);
+ CreateMinPageRecord(pCurrentPageNode, false);
} else if (pCurrentPageNode->GetElementType() ==
XFA_Element::PageSet) {
- CreateMinPageSetRecord(pCurrentPageNode, TRUE);
+ CreateMinPageSetRecord(pCurrentPageNode, true);
}
}
}
@@ -1488,17 +1487,17 @@ void CXFA_LayoutPageMgr::CreateNextMinRecord(CXFA_Node* pRecordNode) {
pCurrentNode;
pCurrentNode = pCurrentNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pCurrentNode->GetElementType() == XFA_Element::PageArea)
- CreateMinPageRecord(pCurrentNode, FALSE);
+ CreateMinPageRecord(pCurrentNode, false);
else if (pCurrentNode->GetElementType() == XFA_Element::PageSet)
- CreateMinPageSetRecord(pCurrentNode, TRUE);
+ CreateMinPageSetRecord(pCurrentNode, true);
}
}
void CXFA_LayoutPageMgr::ProcessLastPageSet() {
- CreateMinPageRecord(m_pCurPageArea, FALSE, TRUE);
+ CreateMinPageRecord(m_pCurPageArea, false, true);
CreateNextMinRecord(m_pCurPageArea);
CXFA_Node* pPageSet = m_pCurPageArea->GetNodeItem(XFA_NODEITEM_Parent);
- while (TRUE) {
+ while (true) {
CreateMinPageSetRecord(pPageSet);
if (pPageSet == m_pTemplatePageSetRoot)
break;
@@ -1508,11 +1507,11 @@ void CXFA_LayoutPageMgr::ProcessLastPageSet() {
}
}
-FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) {
+bool CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) {
CXFA_Node* pCurContentNode =
GetCurrentContainerRecord()->pCurContentArea->m_pFormNode;
if (!pCurContentNode)
- return FALSE;
+ return false;
pCurContentNode =
pCurContentNode->GetNextSameClassSibling(XFA_Element::ContentArea);
@@ -1525,13 +1524,13 @@ FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) {
CXFA_Node* pPageNode = GetCurrentContainerRecord()->pCurPageArea->m_pFormNode;
CXFA_Node* pOccurNode = pPageNode->GetFirstChildByClass(XFA_Element::Occur);
int32_t iMax = 0;
- if (pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE)) {
+ if (pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, false)) {
if (m_nCurPageCount == iMax) {
CXFA_Node* pSrcPage = m_pCurPageArea;
int32_t nSrcPageCount = m_nCurPageCount;
FX_POSITION psSrcRecord = m_rgProposedContainerRecord.GetTailPosition();
CXFA_Node* pNextPage =
- GetNextAvailPageArea(nullptr, nullptr, FALSE, TRUE);
+ GetNextAvailPageArea(nullptr, nullptr, false, true);
m_pCurPageArea = pSrcPage;
m_nCurPageCount = nSrcPageCount;
CXFA_ContainerRecord* pPrevRecord = static_cast<CXFA_ContainerRecord*>(
@@ -1552,10 +1551,10 @@ FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) {
FX_FLOAT fNextContentHeight =
pContentArea->GetMeasure(XFA_ATTRIBUTE_H).ToUnit(XFA_UNIT_Pt);
if (fNextContentHeight > fChildHeight)
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
}
@@ -1564,10 +1563,10 @@ FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) {
FX_FLOAT fNextContentHeight =
pContentArea->GetMeasure(XFA_ATTRIBUTE_H).ToUnit(XFA_UNIT_Pt);
if (fNextContentHeight < XFA_LAYOUT_FLOAT_PERCISION)
- return TRUE;
+ return true;
if (fNextContentHeight > fChildHeight)
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
void CXFA_LayoutPageMgr::ClearData() {
@@ -1590,7 +1589,7 @@ void CXFA_LayoutPageMgr::ClearRecordList() {
m_pCurrentContainerRecord = nullptr;
m_pCurPageArea = nullptr;
m_nCurPageCount = 0;
- m_bCreateOverFlowPage = FALSE;
+ m_bCreateOverFlowPage = false;
m_pPageSetMap.RemoveAll();
}
@@ -1711,7 +1710,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() {
if (pRootPageSetContainerItem->m_pFormNode->GetPacketID() ==
XFA_XDPPACKET_Template) {
pPendingPageSet =
- pRootPageSetContainerItem->m_pFormNode->CloneTemplateToForm(FALSE);
+ pRootPageSetContainerItem->m_pFormNode->CloneTemplateToForm(false);
} else {
pPendingPageSet = pRootPageSetContainerItem->m_pFormNode;
}
@@ -1733,14 +1732,14 @@ void CXFA_LayoutPageMgr::MergePageSetContents() {
case XFA_Element::PageSet: {
CXFA_Node* pParentNode = pContainerItem->m_pParent->m_pFormNode;
pContainerItem->m_pFormNode = XFA_NodeMerge_CloneOrMergeContainer(
- pDocument, pParentNode, pContainerItem->m_pFormNode, TRUE,
+ pDocument, pParentNode, pContainerItem->m_pFormNode, true,
nullptr);
break;
}
case XFA_Element::PageArea: {
CXFA_ContainerLayoutItem* pFormLayout = pContainerItem;
CXFA_Node* pParentNode = pContainerItem->m_pParent->m_pFormNode;
- FX_BOOL bIsExistForm = TRUE;
+ bool bIsExistForm = true;
for (int32_t iLevel = 0; iLevel < 3; iLevel++) {
pFormLayout = static_cast<CXFA_ContainerLayoutItem*>(
pFormLayout->m_pFirstChild);
@@ -1753,7 +1752,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() {
}
}
if (!pFormLayout) {
- bIsExistForm = FALSE;
+ bIsExistForm = false;
break;
}
}
@@ -1784,8 +1783,8 @@ void CXFA_LayoutPageMgr::MergePageSetContents() {
}
pContainerItem->m_pFormNode = pDocument->DataMerge_CopyContainer(
pContainerItem->m_pFormNode, pParentNode,
- ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Record)), TRUE, TRUE,
- TRUE);
+ ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Record)), true, true,
+ true);
break;
}
case XFA_Element::ContentArea: {
@@ -1919,7 +1918,7 @@ void CXFA_LayoutPageMgr::SyncLayoutData() {
pChildLayoutItem = iterator.MoveToNext();
continue;
}
- FX_BOOL bVisible =
+ bool bVisible =
(pContentItem->m_pFormNode->GetEnum(XFA_ATTRIBUTE_Presence) ==
XFA_ATTRIBUTEENUM_Visible);
uint32_t dwRelevantChild =
@@ -1982,7 +1981,7 @@ void CXFA_LayoutPageMgr::PrepareLayout() {
CXFA_Node* pNextPageSet =
pPageSetFormNode->GetNextSameClassSibling(XFA_Element::PageSet);
pPageSetFormNode->GetNodeItem(XFA_NODEITEM_Parent)
- ->RemoveChild(pPageSetFormNode, FALSE);
+ ->RemoveChild(pPageSetFormNode, false);
pRootLayoutItem->m_pFormNode->GetDocument()->m_pPendingPageSet.Add(
pPageSetFormNode);
pPageSetFormNode = pNextPageSet;
diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.h b/xfa/fxfa/parser/cxfa_layoutpagemgr.h
index 0184602de7..dcd798ea1a 100644
--- a/xfa/fxfa/parser/cxfa_layoutpagemgr.h
+++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.h
@@ -17,10 +17,10 @@ class CXFA_LayoutPageMgr {
CXFA_LayoutPageMgr(CXFA_LayoutProcessor* pLayoutProcessor);
~CXFA_LayoutPageMgr();
- FX_BOOL InitLayoutPage(CXFA_Node* pFormNode);
- FX_BOOL PrepareFirstPage(CXFA_Node* pRootSubform);
+ bool InitLayoutPage(CXFA_Node* pFormNode);
+ bool PrepareFirstPage(CXFA_Node* pRootSubform);
FX_FLOAT GetAvailHeight();
- FX_BOOL GetNextAvailContentHeight(FX_FLOAT fChildHeight);
+ bool GetNextAvailContentHeight(FX_FLOAT fChildHeight);
void SubmitContentItem(CXFA_ContentLayoutItem* pContentLayoutItem,
XFA_ItemLayoutProcessorResult eStatus);
void FinishPaginatedPageSets();
@@ -31,25 +31,25 @@ class CXFA_LayoutPageMgr {
inline CXFA_ContainerLayoutItem* GetRootLayoutItem() const {
return m_pPageSetLayoutItemRoot;
}
- FX_BOOL ProcessBreakBeforeOrAfter(CXFA_Node* pBreakNode,
- FX_BOOL bBefore,
- CXFA_Node*& pBreakLeaderNode,
- CXFA_Node*& pBreakTrailerNode,
- FX_BOOL& bCreatePage);
- FX_BOOL ProcessOverflow(CXFA_Node* pFormNode,
- CXFA_Node*& pLeaderNode,
- CXFA_Node*& pTrailerNode,
- FX_BOOL bDataMerge = FALSE,
- FX_BOOL bCreatePage = TRUE);
+ bool ProcessBreakBeforeOrAfter(CXFA_Node* pBreakNode,
+ bool bBefore,
+ CXFA_Node*& pBreakLeaderNode,
+ CXFA_Node*& pBreakTrailerNode,
+ bool& bCreatePage);
+ bool ProcessOverflow(CXFA_Node* pFormNode,
+ CXFA_Node*& pLeaderNode,
+ CXFA_Node*& pTrailerNode,
+ bool bDataMerge = false,
+ bool bCreatePage = true);
CXFA_Node* QueryOverflow(CXFA_Node* pFormNode,
CXFA_LayoutContext* pLayoutContext = nullptr);
- FX_BOOL ProcessBookendLeaderOrTrailer(CXFA_Node* pBookendNode,
- FX_BOOL bLeader,
- CXFA_Node*& pBookendAppendNode);
+ bool ProcessBookendLeaderOrTrailer(CXFA_Node* pBookendNode,
+ bool bLeader,
+ CXFA_Node*& pBookendAppendNode);
CXFA_LayoutItem* FindOrCreateLayoutItem(CXFA_Node* pFormNode);
protected:
- FX_BOOL AppendNewPage(FX_BOOL bFirstTemPage = FALSE);
+ bool AppendNewPage(bool bFirstTemPage = false);
void ReorderPendingLayoutRecordToTail(CXFA_ContainerRecord* pNewRecord,
CXFA_ContainerRecord* pPrevRecord);
void RemoveLayoutRecord(CXFA_ContainerRecord* pNewRecord,
@@ -62,62 +62,61 @@ class CXFA_LayoutPageMgr {
return result;
}
CXFA_ContainerRecord* CreateContainerRecord(CXFA_Node* pPageNode = nullptr,
- FX_BOOL bCreateNew = FALSE);
+ bool bCreateNew = false);
void AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord,
CXFA_Node* pNewPageArea);
void AddContentAreaLayoutItem(CXFA_ContainerRecord* pNewRecord,
CXFA_Node* pContentArea);
- FX_BOOL RunBreak(XFA_Element eBreakType,
- XFA_ATTRIBUTEENUM eTargetType,
- CXFA_Node* pTarget,
- FX_BOOL bStartNew);
+ bool RunBreak(XFA_Element eBreakType,
+ XFA_ATTRIBUTEENUM eTargetType,
+ CXFA_Node* pTarget,
+ bool bStartNew);
CXFA_Node* BreakOverflow(CXFA_Node* pOverflowNode,
CXFA_Node*& pLeaderTemplate,
CXFA_Node*& pTrailerTemplate,
- FX_BOOL bCreatePage = TRUE);
- FX_BOOL ResolveBookendLeaderOrTrailer(CXFA_Node* pBookendNode,
- FX_BOOL bLeader,
- CXFA_Node*& pBookendAppendTemplate);
- FX_BOOL ExecuteBreakBeforeOrAfter(CXFA_Node* pCurNode,
- FX_BOOL bBefore,
- CXFA_Node*& pBreakLeaderTemplate,
- CXFA_Node*& pBreakTrailerTemplate);
+ bool bCreatePage = true);
+ bool ResolveBookendLeaderOrTrailer(CXFA_Node* pBookendNode,
+ bool bLeader,
+ CXFA_Node*& pBookendAppendTemplate);
+ bool ExecuteBreakBeforeOrAfter(CXFA_Node* pCurNode,
+ bool bBefore,
+ CXFA_Node*& pBreakLeaderTemplate,
+ CXFA_Node*& pBreakTrailerTemplate);
int32_t CreateMinPageRecord(CXFA_Node* pPageArea,
- FX_BOOL bTargetPageArea,
- FX_BOOL bCreateLast = FALSE);
- void CreateMinPageSetRecord(CXFA_Node* pPageSet, FX_BOOL bCreateAll = FALSE);
+ bool bTargetPageArea,
+ bool bCreateLast = false);
+ void CreateMinPageSetRecord(CXFA_Node* pPageSet, bool bCreateAll = false);
void CreateNextMinRecord(CXFA_Node* pRecordNode);
- FX_BOOL FindPageAreaFromPageSet(CXFA_Node* pPageSet,
- CXFA_Node* pStartChild,
- CXFA_Node* pTargetPageArea = nullptr,
- CXFA_Node* pTargetContentArea = nullptr,
- FX_BOOL bNewPage = FALSE,
- FX_BOOL bQuery = FALSE);
- FX_BOOL FindPageAreaFromPageSet_Ordered(
- CXFA_Node* pPageSet,
- CXFA_Node* pStartChild,
- CXFA_Node* pTargetPageArea = nullptr,
- CXFA_Node* pTargetContentArea = nullptr,
- FX_BOOL bNewPage = FALSE,
- FX_BOOL bQuery = FALSE);
- FX_BOOL FindPageAreaFromPageSet_SimplexDuplex(
+ bool FindPageAreaFromPageSet(CXFA_Node* pPageSet,
+ CXFA_Node* pStartChild,
+ CXFA_Node* pTargetPageArea = nullptr,
+ CXFA_Node* pTargetContentArea = nullptr,
+ bool bNewPage = false,
+ bool bQuery = false);
+ bool FindPageAreaFromPageSet_Ordered(CXFA_Node* pPageSet,
+ CXFA_Node* pStartChild,
+ CXFA_Node* pTargetPageArea = nullptr,
+ CXFA_Node* pTargetContentArea = nullptr,
+ bool bNewPage = false,
+ bool bQuery = false);
+ bool FindPageAreaFromPageSet_SimplexDuplex(
CXFA_Node* pPageSet,
CXFA_Node* pStartChild,
CXFA_Node* pTargetPageArea = nullptr,
CXFA_Node* pTargetContentArea = nullptr,
- FX_BOOL bNewPage = FALSE,
- FX_BOOL bQuery = FALSE,
+ bool bNewPage = false,
+ bool bQuery = false,
XFA_ATTRIBUTEENUM ePreferredPosition = XFA_ATTRIBUTEENUM_First);
- FX_BOOL MatchPageAreaOddOrEven(CXFA_Node* pPageArea, FX_BOOL bLastMatch);
+ bool MatchPageAreaOddOrEven(CXFA_Node* pPageArea, bool bLastMatch);
CXFA_Node* GetNextAvailPageArea(CXFA_Node* pTargetPageArea,
CXFA_Node* pTargetContentArea = nullptr,
- FX_BOOL bNewPage = FALSE,
- FX_BOOL bQuery = FALSE);
- FX_BOOL GetNextContentArea(CXFA_Node* pTargetContentArea);
+ bool bNewPage = false,
+ bool bQuery = false);
+ bool GetNextContentArea(CXFA_Node* pTargetContentArea);
void InitPageSetMap();
void ProcessLastPageSet();
- inline FX_BOOL IsPageSetRootOrderedOccurrence() {
+ inline bool IsPageSetRootOrderedOccurrence() {
return m_ePageSetMode == XFA_ATTRIBUTEENUM_OrderedOccurrence;
}
void ClearData();
@@ -136,7 +135,7 @@ class CXFA_LayoutPageMgr {
int32_t m_nAvailPages;
int32_t m_nCurPageCount;
XFA_ATTRIBUTEENUM m_ePageSetMode;
- FX_BOOL m_bCreateOverFlowPage;
+ bool m_bCreateOverFlowPage;
CFX_MapPtrTemplate<CXFA_Node*, int32_t> m_pPageSetMap;
CFX_ArrayTemplate<CXFA_ContainerLayoutItem*> m_PageArray;
};
diff --git a/xfa/fxfa/parser/cxfa_layoutprocessor.cpp b/xfa/fxfa/parser/cxfa_layoutprocessor.cpp
index 1f3bc880eb..ad1c2a936a 100644
--- a/xfa/fxfa/parser/cxfa_layoutprocessor.cpp
+++ b/xfa/fxfa/parser/cxfa_layoutprocessor.cpp
@@ -33,7 +33,7 @@ CXFA_LayoutProcessor::CXFA_LayoutProcessor(CXFA_Document* pDocument)
m_pRootItemLayoutProcessor(nullptr),
m_pLayoutPageMgr(nullptr),
m_nProgressCounter(0),
- m_bNeeLayout(TRUE) {}
+ m_bNeeLayout(true) {}
CXFA_LayoutProcessor::~CXFA_LayoutProcessor() {
ClearLayoutData();
@@ -43,7 +43,7 @@ CXFA_Document* CXFA_LayoutProcessor::GetDocument() const {
return m_pDocument;
}
-int32_t CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart) {
+int32_t CXFA_LayoutProcessor::StartLayout(bool bForceRestart) {
if (!bForceRestart && !IsNeedLayout())
return 100;
@@ -82,7 +82,7 @@ int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause) {
do {
FX_FLOAT fAvailHeight = m_pLayoutPageMgr->GetAvailHeight();
eStatus =
- m_pRootItemLayoutProcessor->DoLayout(TRUE, fAvailHeight, fAvailHeight);
+ m_pRootItemLayoutProcessor->DoLayout(true, fAvailHeight, fAvailHeight);
if (eStatus != XFA_ItemLayoutProcessorResult_Done)
m_nProgressCounter++;
@@ -98,7 +98,7 @@ int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause) {
if (eStatus == XFA_ItemLayoutProcessorResult_Done) {
m_pLayoutPageMgr->FinishPaginatedPageSets();
m_pLayoutPageMgr->SyncLayoutData();
- m_bNeeLayout = FALSE;
+ m_bNeeLayout = false;
m_rgChangedContainers.RemoveAll();
}
return 100 * (eStatus == XFA_ItemLayoutProcessorResult_Done
@@ -107,9 +107,9 @@ int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause) {
m_nProgressCounter;
}
-FX_BOOL CXFA_LayoutProcessor::IncrementLayout() {
+bool CXFA_LayoutProcessor::IncrementLayout() {
if (m_bNeeLayout) {
- StartLayout(TRUE);
+ StartLayout(true);
return DoLayout(nullptr) == 100;
}
@@ -118,14 +118,14 @@ FX_BOOL CXFA_LayoutProcessor::IncrementLayout() {
CXFA_Node* pParentNode =
pNode->GetNodeItem(XFA_NODEITEM_Parent, XFA_ObjectType::ContainerNode);
if (!pParentNode)
- return FALSE;
+ return false;
if (!CXFA_ItemLayoutProcessor::IncrementRelayoutNode(this, pNode,
pParentNode)) {
- return FALSE;
+ return false;
}
}
m_rgChangedContainers.RemoveAll();
- return TRUE;
+ return true;
}
int32_t CXFA_LayoutProcessor::CountPages() const {
@@ -158,6 +158,6 @@ void CXFA_LayoutProcessor::ClearLayoutData() {
m_nProgressCounter = 0;
}
-FX_BOOL CXFA_LayoutProcessor::IsNeedLayout() {
+bool CXFA_LayoutProcessor::IsNeedLayout() {
return m_bNeeLayout || m_rgChangedContainers.GetSize() > 0;
}
diff --git a/xfa/fxfa/parser/cxfa_layoutprocessor.h b/xfa/fxfa/parser/cxfa_layoutprocessor.h
index 365c5f2965..d735b385bd 100644
--- a/xfa/fxfa/parser/cxfa_layoutprocessor.h
+++ b/xfa/fxfa/parser/cxfa_layoutprocessor.h
@@ -24,15 +24,15 @@ class CXFA_LayoutProcessor {
~CXFA_LayoutProcessor();
CXFA_Document* GetDocument() const;
- int32_t StartLayout(FX_BOOL bForceRestart = FALSE);
+ int32_t StartLayout(bool bForceRestart = false);
int32_t DoLayout(IFX_Pause* pPause = nullptr);
- FX_BOOL IncrementLayout();
+ bool IncrementLayout();
int32_t CountPages() const;
CXFA_ContainerLayoutItem* GetPage(int32_t index) const;
CXFA_LayoutItem* GetLayoutItem(CXFA_Node* pFormItem);
void AddChangedContainer(CXFA_Node* pContainer);
- void SetForceReLayout(FX_BOOL bForceRestart) { m_bNeeLayout = bForceRestart; }
+ void SetForceReLayout(bool bForceRestart) { m_bNeeLayout = bForceRestart; }
CXFA_ContainerLayoutItem* GetRootLayoutItem() const;
CXFA_ItemLayoutProcessor* GetRootRootItemLayoutProcessor() {
return m_pRootItemLayoutProcessor;
@@ -42,14 +42,14 @@ class CXFA_LayoutProcessor {
private:
void ClearLayoutData();
- FX_BOOL IsNeedLayout();
+ bool IsNeedLayout();
CXFA_Document* m_pDocument;
CXFA_ItemLayoutProcessor* m_pRootItemLayoutProcessor;
CXFA_LayoutPageMgr* m_pLayoutPageMgr;
CXFA_NodeArray m_rgChangedContainers;
uint32_t m_nProgressCounter;
- FX_BOOL m_bNeeLayout;
+ bool m_bNeeLayout;
};
#endif // XFA_FXFA_PARSER_CXFA_LAYOUTPROCESSOR_H_
diff --git a/xfa/fxfa/parser/cxfa_line.cpp b/xfa/fxfa/parser/cxfa_line.cpp
index b35aa4146d..f0d9a0bbfd 100644
--- a/xfa/fxfa/parser/cxfa_line.cpp
+++ b/xfa/fxfa/parser/cxfa_line.cpp
@@ -12,7 +12,7 @@ int32_t CXFA_Line::GetHand() {
return m_pNode->GetEnum(XFA_ATTRIBUTE_Hand);
}
-FX_BOOL CXFA_Line::GetSlop() {
+bool CXFA_Line::GetSlop() {
XFA_ATTRIBUTEENUM eSlop = m_pNode->GetEnum(XFA_ATTRIBUTE_Slope);
return eSlop == XFA_ATTRIBUTEENUM_Slash;
}
diff --git a/xfa/fxfa/parser/cxfa_line.h b/xfa/fxfa/parser/cxfa_line.h
index 1d91a5970b..bf180295da 100644
--- a/xfa/fxfa/parser/cxfa_line.h
+++ b/xfa/fxfa/parser/cxfa_line.h
@@ -18,7 +18,7 @@ class CXFA_Line : public CXFA_Data {
explicit CXFA_Line(CXFA_Node* pNode) : CXFA_Data(pNode) {}
int32_t GetHand();
- FX_BOOL GetSlop();
+ bool GetSlop();
CXFA_Edge GetEdge();
};
diff --git a/xfa/fxfa/parser/cxfa_margin.cpp b/xfa/fxfa/parser/cxfa_margin.cpp
index c3ced3df93..38f9626a88 100644
--- a/xfa/fxfa/parser/cxfa_margin.cpp
+++ b/xfa/fxfa/parser/cxfa_margin.cpp
@@ -10,23 +10,22 @@
CXFA_Margin::CXFA_Margin(CXFA_Node* pNode) : CXFA_Data(pNode) {}
-FX_BOOL CXFA_Margin::GetLeftInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const {
+bool CXFA_Margin::GetLeftInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const {
fInset = fDefInset;
return TryMeasure(XFA_ATTRIBUTE_LeftInset, fInset);
}
-FX_BOOL CXFA_Margin::GetTopInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const {
+bool CXFA_Margin::GetTopInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const {
fInset = fDefInset;
return TryMeasure(XFA_ATTRIBUTE_TopInset, fInset);
}
-FX_BOOL CXFA_Margin::GetRightInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const {
+bool CXFA_Margin::GetRightInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const {
fInset = fDefInset;
return TryMeasure(XFA_ATTRIBUTE_RightInset, fInset);
}
-FX_BOOL CXFA_Margin::GetBottomInset(FX_FLOAT& fInset,
- FX_FLOAT fDefInset) const {
+bool CXFA_Margin::GetBottomInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const {
fInset = fDefInset;
return TryMeasure(XFA_ATTRIBUTE_BottomInset, fInset);
}
diff --git a/xfa/fxfa/parser/cxfa_margin.h b/xfa/fxfa/parser/cxfa_margin.h
index 780f9b2b68..d1c1955194 100644
--- a/xfa/fxfa/parser/cxfa_margin.h
+++ b/xfa/fxfa/parser/cxfa_margin.h
@@ -16,10 +16,10 @@ class CXFA_Margin : public CXFA_Data {
public:
explicit CXFA_Margin(CXFA_Node* pNode);
- FX_BOOL GetLeftInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const;
- FX_BOOL GetTopInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const;
- FX_BOOL GetRightInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const;
- FX_BOOL GetBottomInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const;
+ bool GetLeftInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const;
+ bool GetTopInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const;
+ bool GetRightInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const;
+ bool GetBottomInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const;
};
#endif // XFA_FXFA_PARSER_CXFA_MARGIN_H_
diff --git a/xfa/fxfa/parser/cxfa_measurement.cpp b/xfa/fxfa/parser/cxfa_measurement.cpp
index cd34f8af25..b1843a8b49 100644
--- a/xfa/fxfa/parser/cxfa_measurement.cpp
+++ b/xfa/fxfa/parser/cxfa_measurement.cpp
@@ -34,43 +34,43 @@ void CXFA_Measurement::Set(const CFX_WideStringC& wsMeasure) {
Set(fValue, eUnit);
}
-FX_BOOL CXFA_Measurement::ToString(CFX_WideString& wsMeasure) const {
+bool CXFA_Measurement::ToString(CFX_WideString& wsMeasure) const {
switch (GetUnit()) {
case XFA_UNIT_Mm:
wsMeasure.Format(L"%.8gmm", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_Pt:
wsMeasure.Format(L"%.8gpt", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_In:
wsMeasure.Format(L"%.8gin", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_Cm:
wsMeasure.Format(L"%.8gcm", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_Mp:
wsMeasure.Format(L"%.8gmp", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_Pc:
wsMeasure.Format(L"%.8gpc", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_Em:
wsMeasure.Format(L"%.8gem", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_Percent:
wsMeasure.Format(L"%.8g%%", GetValue());
- return TRUE;
+ return true;
default:
wsMeasure.Format(L"%.8g", GetValue());
- return FALSE;
+ return false;
}
}
-FX_BOOL CXFA_Measurement::ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const {
+bool CXFA_Measurement::ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const {
fValue = GetValue();
XFA_UNIT eFrom = GetUnit();
if (eFrom == eUnit)
- return TRUE;
+ return true;
switch (eFrom) {
case XFA_UNIT_Pt:
@@ -92,29 +92,29 @@ FX_BOOL CXFA_Measurement::ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const {
break;
default:
fValue = 0;
- return FALSE;
+ return false;
}
switch (eUnit) {
case XFA_UNIT_Pt:
- return TRUE;
+ return true;
case XFA_UNIT_Mm:
fValue /= 72 / 2.54f / 10;
- return TRUE;
+ return true;
case XFA_UNIT_In:
fValue /= 72;
- return TRUE;
+ return true;
case XFA_UNIT_Cm:
fValue /= 72 / 2.54f;
- return TRUE;
+ return true;
case XFA_UNIT_Mp:
fValue /= 0.001f;
- return TRUE;
+ return true;
case XFA_UNIT_Pc:
fValue /= 12.0f;
- return TRUE;
+ return true;
default:
fValue = 0;
- return FALSE;
+ return false;
}
}
diff --git a/xfa/fxfa/parser/cxfa_measurement.h b/xfa/fxfa/parser/cxfa_measurement.h
index cf43f7625a..40f71a7fab 100644
--- a/xfa/fxfa/parser/cxfa_measurement.h
+++ b/xfa/fxfa/parser/cxfa_measurement.h
@@ -27,8 +27,8 @@ class CXFA_Measurement {
XFA_UNIT GetUnit() const { return m_eUnit; }
FX_FLOAT GetValue() const { return m_fValue; }
- FX_BOOL ToString(CFX_WideString& wsMeasure) const;
- FX_BOOL ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const;
+ bool ToString(CFX_WideString& wsMeasure) const;
+ bool ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const;
FX_FLOAT ToUnit(XFA_UNIT eUnit) const {
FX_FLOAT f;
return ToUnit(eUnit, f) ? f : 0;
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 402ab0e37e..1d0f4333f5 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -127,7 +127,7 @@ CXFA_NodeSetPair* NodeSetPairForNode(CXFA_Node* pNode,
void ReorderDataNodes(const CXFA_NodeSet& sSet1,
const CXFA_NodeSet& sSet2,
- FX_BOOL bInsertBefore) {
+ bool bInsertBefore) {
CXFA_NodeSetPairMapMap rgMap;
for (CXFA_Node* pNode : sSet1) {
CXFA_NodeSetPair* pNodeSetPair = NodeSetPairForNode(pNode, &rgMap);
@@ -218,7 +218,7 @@ void InsertItem(CXFA_Node* pInstMgrNode,
CXFA_Node* pNewInstance,
int32_t iPos,
int32_t iCount = -1,
- FX_BOOL bMoveDataBindingNodes = TRUE) {
+ bool bMoveDataBindingNodes = true) {
if (iCount < 0)
iCount = GetCount(pInstMgrNode);
if (iPos < 0)
@@ -256,7 +256,7 @@ void InsertItem(CXFA_Node* pInstMgrNode,
sAfter.insert(pDataNode);
}
- ReorderDataNodes(sNew, sAfter, FALSE);
+ ReorderDataNodes(sNew, sAfter, false);
}
} else {
CXFA_Node* pBeforeInstance = GetItem(pInstMgrNode, iPos);
@@ -287,14 +287,14 @@ void InsertItem(CXFA_Node* pInstMgrNode,
sBefore.insert(pDataNode);
}
- ReorderDataNodes(sNew, sBefore, TRUE);
+ ReorderDataNodes(sNew, sBefore, true);
}
}
}
void RemoveItem(CXFA_Node* pInstMgrNode,
CXFA_Node* pRemoveInstance,
- FX_BOOL bRemoveDataBinding = TRUE) {
+ bool bRemoveDataBinding = true) {
pInstMgrNode->GetNodeItem(XFA_NODEITEM_Parent)->RemoveChild(pRemoveInstance);
if (!bRemoveDataBinding)
return;
@@ -317,7 +317,7 @@ void RemoveItem(CXFA_Node* pInstMgrNode,
}
}
-CXFA_Node* CreateInstance(CXFA_Node* pInstMgrNode, FX_BOOL bDataMerge) {
+CXFA_Node* CreateInstance(CXFA_Node* pInstMgrNode, bool bDataMerge) {
CXFA_Document* pDocument = pInstMgrNode->GetDocument();
CXFA_Node* pTemplateNode = pInstMgrNode->GetTemplateNode();
CXFA_Node* pFormParent = pInstMgrNode->GetNodeItem(XFA_NODEITEM_Parent);
@@ -334,7 +334,7 @@ CXFA_Node* CreateInstance(CXFA_Node* pInstMgrNode, FX_BOOL bDataMerge) {
ASSERT(pDataScope);
}
CXFA_Node* pInstance = pDocument->DataMerge_CopyContainer(
- pTemplateNode, pFormParent, pDataScope, TRUE, bDataMerge, TRUE);
+ pTemplateNode, pFormParent, pDataScope, true, bDataMerge, true);
if (pInstance) {
pDocument->DataMerge_UpdateBindingRelations(pInstance);
pFormParent->RemoveChild(pInstance);
@@ -511,7 +511,7 @@ CXFA_Node::~CXFA_Node() {
m_pXMLNode->Release();
}
-CXFA_Node* CXFA_Node::Clone(FX_BOOL bRecursive) {
+CXFA_Node* CXFA_Node::Clone(bool bRecursive) {
CXFA_Node* pClone = m_pDocument->CreateNode(m_ePacket, m_elementType);
if (!pClone)
return nullptr;
@@ -522,7 +522,7 @@ CXFA_Node* CXFA_Node::Clone(FX_BOOL bRecursive) {
CFDE_XMLNode* pCloneXML = nullptr;
if (IsAttributeInXML()) {
CFX_WideString wsName;
- GetAttribute(XFA_ATTRIBUTE_Name, wsName, FALSE);
+ GetAttribute(XFA_ATTRIBUTE_Name, wsName, false);
CFDE_XMLElement* pCloneXMLElement = new CFDE_XMLElement(wsName);
CFX_WideStringC wsValue = GetCData(XFA_ATTRIBUTE_Value);
if (!wsValue.IsEmpty()) {
@@ -532,7 +532,7 @@ CXFA_Node* CXFA_Node::Clone(FX_BOOL bRecursive) {
pCloneXMLElement = nullptr;
pClone->SetEnum(XFA_ATTRIBUTE_Contains, XFA_ATTRIBUTEENUM_Unknown);
} else {
- pCloneXML = m_pXMLNode->Clone(FALSE);
+ pCloneXML = m_pXMLNode->Clone(false);
}
pClone->SetXMLMappingNode(pCloneXML);
pClone->SetFlag(XFA_NodeFlag_OwnXMLNode, false);
@@ -693,7 +693,7 @@ CXFA_Node* CXFA_Node::CreateSamePacketNode(XFA_Element eType,
return pNode;
}
-CXFA_Node* CXFA_Node::CloneTemplateToForm(FX_BOOL bRecursive) {
+CXFA_Node* CXFA_Node::CloneTemplateToForm(bool bRecursive) {
ASSERT(m_ePacket == XFA_XDPPACKET_Template);
CXFA_Node* pClone =
m_pDocument->CreateNode(XFA_XDPPACKET_Form, m_elementType);
@@ -796,7 +796,7 @@ int32_t CXFA_Node::RemoveBindItem(CXFA_Node* pFormNode) {
return pOldFormItem ? 1 : 0;
}
-FX_BOOL CXFA_Node::HasBindItem() {
+bool CXFA_Node::HasBindItem() {
return GetPacketID() == XFA_XDPPACKET_Datasets &&
GetObject(XFA_ATTRIBUTE_BindingNode);
}
@@ -869,34 +869,34 @@ CXFA_WidgetData* CXFA_Node::GetContainerWidgetData() {
: nullptr;
}
-FX_BOOL CXFA_Node::GetLocaleName(CFX_WideString& wsLocaleName) {
+bool CXFA_Node::GetLocaleName(CFX_WideString& wsLocaleName) {
CXFA_Node* pForm = GetDocument()->GetXFAObject(XFA_HASHCODE_Form)->AsNode();
CXFA_Node* pTopSubform = pForm->GetFirstChildByClass(XFA_Element::Subform);
ASSERT(pTopSubform);
CXFA_Node* pLocaleNode = this;
- FX_BOOL bLocale = FALSE;
+ bool bLocale = false;
do {
- bLocale = pLocaleNode->TryCData(XFA_ATTRIBUTE_Locale, wsLocaleName, FALSE);
+ bLocale = pLocaleNode->TryCData(XFA_ATTRIBUTE_Locale, wsLocaleName, false);
if (!bLocale) {
pLocaleNode = pLocaleNode->GetNodeItem(XFA_NODEITEM_Parent);
}
} while (pLocaleNode && pLocaleNode != pTopSubform && !bLocale);
if (bLocale)
- return TRUE;
+ return true;
CXFA_Node* pConfig = ToNode(GetDocument()->GetXFAObject(XFA_HASHCODE_Config));
wsLocaleName = GetDocument()->GetLocalMgr()->GetConfigLocaleName(pConfig);
if (!wsLocaleName.IsEmpty())
- return TRUE;
+ return true;
if (pTopSubform &&
- pTopSubform->TryCData(XFA_ATTRIBUTE_Locale, wsLocaleName, FALSE)) {
- return TRUE;
+ pTopSubform->TryCData(XFA_ATTRIBUTE_Locale, wsLocaleName, false)) {
+ return true;
}
IFX_Locale* pLocale = GetDocument()->GetLocalMgr()->GetDefLocale();
if (pLocale) {
wsLocaleName = pLocale->GetName();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() {
@@ -904,7 +904,7 @@ XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() {
XFA_ATTRIBUTEENUM eLayoutType = GetEnum(XFA_ATTRIBUTE_Layout);
if (pKeep) {
XFA_ATTRIBUTEENUM eIntact;
- if (pKeep->TryEnum(XFA_ATTRIBUTE_Intact, eIntact, FALSE)) {
+ if (pKeep->TryEnum(XFA_ATTRIBUTE_Intact, eIntact, false)) {
if (eIntact == XFA_ATTRIBUTEENUM_None &&
eLayoutType == XFA_ATTRIBUTEENUM_Row &&
m_pDocument->GetCurVersionMode() < XFA_VERSION_208) {
@@ -914,14 +914,14 @@ XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() {
pPreviewRow->GetEnum(XFA_ATTRIBUTE_Layout) ==
XFA_ATTRIBUTEENUM_Row) {
XFA_ATTRIBUTEENUM eValue;
- if (pKeep->TryEnum(XFA_ATTRIBUTE_Previous, eValue, FALSE) &&
+ if (pKeep->TryEnum(XFA_ATTRIBUTE_Previous, eValue, false) &&
(eValue == XFA_ATTRIBUTEENUM_ContentArea ||
eValue == XFA_ATTRIBUTEENUM_PageArea)) {
return XFA_ATTRIBUTEENUM_ContentArea;
}
CXFA_Node* pNode =
pPreviewRow->GetFirstChildByClass(XFA_Element::Keep);
- if (pNode && pNode->TryEnum(XFA_ATTRIBUTE_Next, eValue, FALSE) &&
+ if (pNode && pNode->TryEnum(XFA_ATTRIBUTE_Next, eValue, false) &&
(eValue == XFA_ATTRIBUTEENUM_ContentArea ||
eValue == XFA_ATTRIBUTEENUM_PageArea)) {
return XFA_ATTRIBUTEENUM_ContentArea;
@@ -962,7 +962,7 @@ XFA_ATTRIBUTEENUM CXFA_Node::GetIntact() {
XFA_VERSION version = m_pDocument->GetCurVersionMode();
if (eParLayout == XFA_ATTRIBUTEENUM_Tb && version < XFA_VERSION_208) {
CXFA_Measurement measureH;
- if (TryMeasure(XFA_ATTRIBUTE_H, measureH, FALSE))
+ if (TryMeasure(XFA_ATTRIBUTE_H, measureH, false))
return XFA_ATTRIBUTEENUM_ContentArea;
}
return XFA_ATTRIBUTEENUM_None;
@@ -1023,7 +1023,7 @@ void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) {
std::unique_ptr<CFXJSE_Value> pValue(
new CFXJSE_Value(pScriptContext->GetRuntime()));
(resoveNodeRS.nodes[0]->*(lpAttributeInfo->lpfnCallback))(
- pValue.get(), FALSE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
+ pValue.get(), false, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
pArguments->GetReturnValue()->Assign(pValue.get());
} else {
pArguments->GetReturnValue()->SetNull();
@@ -1084,7 +1084,7 @@ void CXFA_Node::Script_Som_ResolveNodeList(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_TreeClass_All(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -1098,7 +1098,7 @@ void CXFA_Node::Script_TreeClass_All(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_TreeClass_Nodes(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext();
if (!pScriptContext)
@@ -1117,7 +1117,7 @@ void CXFA_Node::Script_TreeClass_Nodes(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_TreeClass_ClassAll(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -1130,7 +1130,7 @@ void CXFA_Node::Script_TreeClass_ClassAll(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_TreeClass_Parent(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -1146,7 +1146,7 @@ void CXFA_Node::Script_TreeClass_Parent(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_TreeClass_Index(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting)
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -1155,7 +1155,7 @@ void CXFA_Node::Script_TreeClass_Index(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_TreeClass_ClassIndex(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting)
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -1164,7 +1164,7 @@ void CXFA_Node::Script_TreeClass_ClassIndex(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_TreeClass_SomExpression(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -1273,7 +1273,7 @@ void CXFA_Node::Script_NodeClass_IsPropertySpecified(
bParent = !!pArguments->GetInt32(1);
if (iLength >= 3)
iIndex = pArguments->GetInt32(2);
- FX_BOOL bHas = FALSE;
+ bool bHas = false;
const XFA_ATTRIBUTEINFO* pAttributeInfo =
XFA_GetAttributeByName(wsExpression.AsStringC());
CFX_WideString wsValue;
@@ -1325,7 +1325,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) {
XFA_RecognizeRichText(static_cast<CFDE_XMLElement*>(pXMLNode)))) {
bIgnoreRoot = false;
}
- CXFA_Node* pFakeRoot = Clone(FALSE);
+ CXFA_Node* pFakeRoot = Clone(false);
CFX_WideStringC wsContentType = GetCData(XFA_ATTRIBUTE_ContentType);
if (!wsContentType.IsEmpty()) {
pFakeRoot->SetCData(XFA_ATTRIBUTE_ContentType,
@@ -1334,7 +1334,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) {
CFDE_XMLNode* pFakeXMLRoot = pFakeRoot->GetXMLMappingNode();
if (!pFakeXMLRoot) {
CFDE_XMLNode* pThisXMLRoot = GetXMLMappingNode();
- pFakeXMLRoot = pThisXMLRoot ? pThisXMLRoot->Clone(FALSE) : nullptr;
+ pFakeXMLRoot = pThisXMLRoot ? pThisXMLRoot->Clone(false) : nullptr;
}
if (!pFakeXMLRoot)
pFakeXMLRoot = new CFDE_XMLElement(CFX_WideString(GetClassName()));
@@ -1386,7 +1386,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) {
pFakeXMLRoot = nullptr;
}
}
- MoveBufferMapData(pFakeRoot, this, XFA_CalcData, TRUE);
+ MoveBufferMapData(pFakeRoot, this, XFA_CalcData, true);
} else {
CXFA_Node* pChild = pFakeRoot->GetNodeItem(XFA_NODEITEM_FirstChild);
while (pChild) {
@@ -1441,7 +1441,7 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) {
XFA_DataExporter_DealWithDataGroupNode(this);
}
std::unique_ptr<IFX_MemoryStream, ReleaseDeleter<IFX_MemoryStream>>
- pMemoryStream(FX_CreateMemoryStream(TRUE));
+ pMemoryStream(FX_CreateMemoryStream(true));
std::unique_ptr<IFX_Stream, ReleaseDeleter<IFX_Stream>> pStream(
IFX_Stream::CreateStream(
static_cast<IFX_SeekableWriteStream*>(pMemoryStream.get()),
@@ -1454,7 +1454,7 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) {
pStream->SetCodePage(FX_CODEPAGE_UTF8);
pStream->WriteData(bsXMLHeader.raw_str(), bsXMLHeader.GetLength());
if (GetPacketID() == XFA_XDPPACKET_Form)
- XFA_DataExporter_RegenerateFormFile(this, pStream.get(), nullptr, TRUE);
+ XFA_DataExporter_RegenerateFormFile(this, pStream.get(), nullptr, true);
else
pElement->SaveXMLNode(pStream.get());
// TODO(weili): Check whether we need to save pretty print XML, pdfium:501.
@@ -1498,7 +1498,7 @@ void CXFA_Node::Script_NodeClass_SetElement(CFXJSE_Arguments* pArguments) {
}
void CXFA_Node::Script_NodeClass_Ns(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -1510,7 +1510,7 @@ void CXFA_Node::Script_NodeClass_Ns(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_NodeClass_Model(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -1521,7 +1521,7 @@ void CXFA_Node::Script_NodeClass_Model(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_NodeClass_IsContainer(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting)
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -1530,13 +1530,13 @@ void CXFA_Node::Script_NodeClass_IsContainer(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_NodeClass_IsNull(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
} else {
if (GetElementType() == XFA_Element::Subform) {
- pValue->SetBoolean(FALSE);
+ pValue->SetBoolean(false);
return;
}
CFX_WideString strValue;
@@ -1545,7 +1545,7 @@ void CXFA_Node::Script_NodeClass_IsNull(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_NodeClass_OneOfChild(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -1592,15 +1592,15 @@ void CXFA_Node::Script_ModelClass_IsCompatibleNS(CFXJSE_Arguments* pArguments) {
}
void CXFA_Node::Script_ModelClass_Context(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CXFA_Node::Script_ModelClass_AliasNode(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CXFA_Node::Script_Attribute_Integer(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
SetInteger(eAttribute, pValue->ToInteger(), true);
@@ -1610,7 +1610,7 @@ void CXFA_Node::Script_Attribute_Integer(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Attribute_IntegerRead(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
pValue->SetInteger(GetInteger(eAttribute));
@@ -1620,7 +1620,7 @@ void CXFA_Node::Script_Attribute_IntegerRead(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Attribute_BOOL(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
SetBoolean(eAttribute, pValue->ToBoolean(), true);
@@ -1630,7 +1630,7 @@ void CXFA_Node::Script_Attribute_BOOL(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Attribute_BOOLRead(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
pValue->SetString(GetBoolean(eAttribute) ? "1" : "0");
@@ -1641,7 +1641,7 @@ void CXFA_Node::Script_Attribute_BOOLRead(CFXJSE_Value* pValue,
void CXFA_Node::Script_Attribute_SendAttributeChangeMessage(
XFA_ATTRIBUTE eAttribute,
- FX_BOOL bScriptModify) {
+ bool bScriptModify) {
CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor();
if (!pLayoutPro)
return;
@@ -1793,7 +1793,7 @@ void CXFA_Node::Script_Attribute_SendAttributeChangeMessage(
}
void CXFA_Node::Script_Attribute_String(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
CFX_WideString wsValue = pValue->ToWideString();
@@ -1838,7 +1838,7 @@ void CXFA_Node::Script_Attribute_String(CFXJSE_Value* pValue,
RemoveChild(pHeadChild);
pHeadChild = pSibling;
}
- CXFA_Node* pProtoForm = pProtoNode->CloneTemplateToForm(TRUE);
+ CXFA_Node* pProtoForm = pProtoNode->CloneTemplateToForm(true);
pHeadChild = pProtoForm->GetNodeItem(XFA_NODEITEM_FirstChild);
while (pHeadChild) {
CXFA_Node* pSibling =
@@ -1860,7 +1860,7 @@ void CXFA_Node::Script_Attribute_String(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Attribute_StringRead(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
CFX_WideString wsValue;
@@ -1875,7 +1875,7 @@ void CXFA_Node::Script_Attribute_StringRead(CFXJSE_Value* pValue,
void CXFA_Node::Script_WsdlConnection_Execute(CFXJSE_Arguments* pArguments) {
int32_t argc = pArguments->GetLength();
if ((argc == 0) || (argc == 1)) {
- pArguments->GetReturnValue()->SetBoolean(FALSE);
+ pArguments->GetReturnValue()->SetBoolean(false);
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execute");
}
@@ -1890,29 +1890,29 @@ void CXFA_Node::Script_Delta_Restore(CFXJSE_Arguments* pArguments) {
}
void CXFA_Node::Script_Delta_CurrentValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CXFA_Node::Script_Delta_SavedValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CXFA_Node::Script_Delta_Target(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CXFA_Node::Script_Som_Message(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_SOM_MESSAGETYPE iMessageType) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
return;
}
- FX_BOOL bNew = FALSE;
+ bool bNew = false;
CXFA_Validate validate = pWidgetData->GetValidate();
if (!validate) {
- validate = pWidgetData->GetValidate(TRUE);
- bNew = TRUE;
+ validate = pWidgetData->GetValidate(true);
+ bNew = true;
}
if (bSetting) {
switch (iMessageType) {
@@ -1955,13 +1955,13 @@ void CXFA_Node::Script_Som_Message(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Som_ValidationMessage(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Script_Som_Message(pValue, bSetting, XFA_SOM_ValidationMessage);
}
void CXFA_Node::Script_Field_Length(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -1971,12 +1971,12 @@ void CXFA_Node::Script_Field_Length(CFXJSE_Value* pValue,
pValue->SetInteger(0);
return;
}
- pValue->SetInteger(pWidgetData->CountChoiceListItems(TRUE));
+ pValue->SetInteger(pWidgetData->CountChoiceListItems(true));
}
}
void CXFA_Node::Script_Som_DefaultValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
XFA_Element eType = GetElementType();
if (eType == XFA_Element::Field) {
@@ -2023,9 +2023,9 @@ void CXFA_Node::Script_Som_DefaultValue(CFXJSE_Value* pValue,
if (pContainerWidgetData) {
pContainerWidgetData->GetFormatDataValue(wsNewValue, wsFormatValue);
}
- SetScriptContent(wsNewValue, wsFormatValue, true, TRUE);
+ SetScriptContent(wsNewValue, wsFormatValue, true, true);
} else {
- CFX_WideString content = GetScriptContent(TRUE);
+ CFX_WideString content = GetScriptContent(true);
if (content.IsEmpty() && eType != XFA_Element::Text &&
eType != XFA_Element::SubmitUrl) {
pValue->SetNull();
@@ -2042,13 +2042,13 @@ void CXFA_Node::Script_Som_DefaultValue(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Som_DefaultValue_Read(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
return;
}
- CFX_WideString content = GetScriptContent(TRUE);
+ CFX_WideString content = GetScriptContent(true);
if (content.IsEmpty()) {
pValue->SetNull();
} else {
@@ -2058,7 +2058,7 @@ void CXFA_Node::Script_Som_DefaultValue_Read(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Boolean_Value(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
CFX_ByteString newValue;
@@ -2072,21 +2072,21 @@ void CXFA_Node::Script_Boolean_Value(CFXJSE_Value* pValue,
if (pContainerWidgetData) {
pContainerWidgetData->GetFormatDataValue(wsNewValue, wsFormatValue);
}
- SetScriptContent(wsNewValue, wsFormatValue, true, TRUE);
+ SetScriptContent(wsNewValue, wsFormatValue, true, true);
} else {
- CFX_WideString wsValue = GetScriptContent(TRUE);
+ CFX_WideString wsValue = GetScriptContent(true);
pValue->SetBoolean(wsValue == FX_WSTRC(L"1"));
}
}
void CXFA_Node::Script_Som_BorderColor(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
return;
}
- CXFA_Border border = pWidgetData->GetBorder(TRUE);
+ CXFA_Border border = pWidgetData->GetBorder(true);
int32_t iSize = border.CountEdges();
if (bSetting) {
int32_t r = 0;
@@ -2110,13 +2110,13 @@ void CXFA_Node::Script_Som_BorderColor(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Som_BorderWidth(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
return;
}
- CXFA_Border border = pWidgetData->GetBorder(TRUE);
+ CXFA_Border border = pWidgetData->GetBorder(true);
int32_t iSize = border.CountEdges();
CFX_WideString wsThickness;
if (bSetting) {
@@ -2135,14 +2135,14 @@ void CXFA_Node::Script_Som_BorderWidth(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Som_FillColor(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
return;
}
- CXFA_Border border = pWidgetData->GetBorder(TRUE);
- CXFA_Fill borderfill = border.GetFill(TRUE);
+ CXFA_Border border = pWidgetData->GetBorder(true);
+ CXFA_Fill borderfill = border.GetFill(true);
CXFA_Node* pNode = borderfill.GetNode();
if (!pNode) {
return;
@@ -2168,7 +2168,7 @@ void CXFA_Node::Script_Som_FillColor(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Som_DataNode(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
CXFA_Node* pDataNode = GetBindData();
@@ -2184,7 +2184,7 @@ void CXFA_Node::Script_Som_DataNode(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Draw_DefaultValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
if (pValue && pValue->IsString()) {
@@ -2194,11 +2194,11 @@ void CXFA_Node::Script_Draw_DefaultValue(CFXJSE_Value* pValue,
if (uiType == XFA_Element::Text) {
CFX_WideString wsNewValue = pValue->ToWideString();
CFX_WideString wsFormatValue(wsNewValue);
- SetScriptContent(wsNewValue, wsFormatValue, true, TRUE);
+ SetScriptContent(wsNewValue, wsFormatValue, true, true);
}
}
} else {
- CFX_WideString content = GetScriptContent(TRUE);
+ CFX_WideString content = GetScriptContent(true);
if (content.IsEmpty()) {
pValue->SetNull();
} else {
@@ -2209,7 +2209,7 @@ void CXFA_Node::Script_Draw_DefaultValue(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
@@ -2218,10 +2218,10 @@ void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue,
if (bSetting) {
if (pValue && pValue->IsNull()) {
pWidgetData->m_bPreNull = pWidgetData->m_bIsNull;
- pWidgetData->m_bIsNull = TRUE;
+ pWidgetData->m_bIsNull = true;
} else {
pWidgetData->m_bPreNull = pWidgetData->m_bIsNull;
- pWidgetData->m_bIsNull = FALSE;
+ pWidgetData->m_bIsNull = false;
}
CFX_WideString wsNewText;
if (!(pValue && (pValue->IsNull() || pValue->IsUndefined())))
@@ -2241,9 +2241,9 @@ void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue,
if (pContainerWidgetData) {
pContainerWidgetData->GetFormatDataValue(wsNewText, wsFormatText);
}
- SetScriptContent(wsNewText, wsFormatText, true, TRUE);
+ SetScriptContent(wsNewText, wsFormatText, true, true);
} else {
- CFX_WideString content = GetScriptContent(TRUE);
+ CFX_WideString content = GetScriptContent(true);
if (content.IsEmpty()) {
pValue->SetNull();
} else {
@@ -2262,7 +2262,7 @@ void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue,
} else if (pNode && pNode->GetElementType() == XFA_Element::Integer) {
pValue->SetInteger(FXSYS_wtoi(content.c_str()));
} else if (pNode && pNode->GetElementType() == XFA_Element::Boolean) {
- pValue->SetBoolean(FXSYS_wtoi(content.c_str()) == 0 ? FALSE : TRUE);
+ pValue->SetBoolean(FXSYS_wtoi(content.c_str()) == 0 ? false : true);
} else if (pNode && pNode->GetElementType() == XFA_Element::Float) {
CFX_Decimal decimal(content.AsStringC());
pValue->SetFloat((FX_FLOAT)(double)decimal);
@@ -2275,7 +2275,7 @@ void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Field_EditValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
@@ -2291,13 +2291,13 @@ void CXFA_Node::Script_Field_EditValue(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Som_FontColor(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
return;
}
- CXFA_Font font = pWidgetData->GetFont(TRUE);
+ CXFA_Font font = pWidgetData->GetFont(true);
CXFA_Node* pNode = font.GetNode();
if (!pNode) {
return;
@@ -2323,13 +2323,13 @@ void CXFA_Node::Script_Som_FontColor(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Field_FormatMessage(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Script_Som_Message(pValue, bSetting, XFA_SOM_FormatMessage);
}
void CXFA_Node::Script_Field_FormattedValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
@@ -2345,13 +2345,13 @@ void CXFA_Node::Script_Field_FormattedValue(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Som_Mandatory(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
return;
}
- CXFA_Validate validate = pWidgetData->GetValidate(TRUE);
+ CXFA_Validate validate = pWidgetData->GetValidate(true);
if (bSetting) {
validate.SetNullTest(pValue->ToWideString());
} else {
@@ -2366,13 +2366,13 @@ void CXFA_Node::Script_Som_Mandatory(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Som_MandatoryMessage(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
Script_Som_Message(pValue, bSetting, XFA_SOM_MandatoryMessage);
}
void CXFA_Node::Script_Field_ParentSubform(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -2382,7 +2382,7 @@ void CXFA_Node::Script_Field_ParentSubform(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Field_SelectedIndex(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
@@ -2394,7 +2394,7 @@ void CXFA_Node::Script_Field_SelectedIndex(CFXJSE_Value* pValue,
pWidgetData->ClearAllSelections();
return;
}
- pWidgetData->SetItemState(iIndex, TRUE, true, TRUE, TRUE);
+ pWidgetData->SetItemState(iIndex, true, true, true, true);
} else {
pValue->SetInteger(pWidgetData->GetSelectedItem());
}
@@ -2405,7 +2405,7 @@ void CXFA_Node::Script_Field_ClearItems(CFXJSE_Arguments* pArguments) {
if (!pWidgetData) {
return;
}
- pWidgetData->DeleteItem(-1, TRUE);
+ pWidgetData->DeleteItem(-1, true);
}
void CXFA_Node::Script_Field_ExecEvent(CFXJSE_Arguments* pArguments) {
@@ -2417,7 +2417,7 @@ void CXFA_Node::Script_Field_ExecEvent(CFXJSE_Arguments* pArguments) {
XFA_Element::Field);
if (eventString == "validate") {
pArguments->GetReturnValue()->SetBoolean(
- (iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE);
+ (iRet == XFA_EVENTERROR_Error) ? false : true);
}
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execEvent");
@@ -2431,7 +2431,7 @@ void CXFA_Node::Script_Field_ExecInitialize(CFXJSE_Arguments* pArguments) {
if (!pNotify) {
return;
}
- pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Initialize, FALSE, FALSE);
+ pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Initialize, false, false);
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execInitialize");
}
@@ -2448,7 +2448,7 @@ void CXFA_Node::Script_Field_DeleteItem(CFXJSE_Arguments* pArguments) {
return;
}
int32_t iIndex = pArguments->GetInt32(0);
- FX_BOOL bValue = pWidgetData->DeleteItem(iIndex, TRUE, TRUE);
+ bool bValue = pWidgetData->DeleteItem(iIndex, true, true);
CFXJSE_Value* pValue = pArguments->GetReturnValue();
if (pValue)
pValue->SetBoolean(bValue);
@@ -2471,7 +2471,7 @@ void CXFA_Node::Script_Field_GetSaveItem(CFXJSE_Arguments* pArguments) {
return;
}
CFX_WideString wsValue;
- FX_BOOL bHasItem = pWidgetData->GetChoiceListItem(wsValue, iIndex, TRUE);
+ bool bHasItem = pWidgetData->GetChoiceListItem(wsValue, iIndex, true);
if (bHasItem) {
pArguments->GetReturnValue()->SetString(
FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC());
@@ -2510,7 +2510,7 @@ void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments) {
return;
}
int32_t iIndex = pArguments->GetInt32(0);
- FX_BOOL bValue = pWidgetData->GetItemState(iIndex);
+ bool bValue = pWidgetData->GetItemState(iIndex);
CFXJSE_Value* pValue = pArguments->GetReturnValue();
if (pValue)
pValue->SetBoolean(bValue);
@@ -2523,7 +2523,7 @@ void CXFA_Node::Script_Field_ExecCalculate(CFXJSE_Arguments* pArguments) {
if (!pNotify) {
return;
}
- pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate, FALSE, FALSE);
+ pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate, false, false);
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execCalculate");
}
@@ -2548,7 +2548,7 @@ void CXFA_Node::Script_Field_GetDisplayItem(CFXJSE_Arguments* pArguments) {
return;
}
CFX_WideString wsValue;
- FX_BOOL bHasItem = pWidgetData->GetChoiceListItem(wsValue, iIndex, FALSE);
+ bool bHasItem = pWidgetData->GetChoiceListItem(wsValue, iIndex, false);
if (bHasItem) {
pArguments->GetReturnValue()->SetString(
FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC());
@@ -2569,10 +2569,10 @@ void CXFA_Node::Script_Field_SetItemState(CFXJSE_Arguments* pArguments) {
int32_t iIndex = pArguments->GetInt32(0);
if (pArguments->GetInt32(1) != 0) {
- pWidgetData->SetItemState(iIndex, TRUE, true, TRUE, TRUE);
+ pWidgetData->SetItemState(iIndex, true, true, true, true);
} else {
if (pWidgetData->GetItemState(iIndex))
- pWidgetData->SetItemState(iIndex, FALSE, true, TRUE, TRUE);
+ pWidgetData->SetItemState(iIndex, false, true, true, true);
}
}
@@ -2596,7 +2596,7 @@ void CXFA_Node::Script_Field_AddItem(CFXJSE_Arguments* pArguments) {
CFX_ByteString bsValue = pArguments->GetUTF8String(1);
wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC());
}
- pWidgetData->InsertItem(wsLabel, wsValue, -1, TRUE);
+ pWidgetData->InsertItem(wsLabel, wsValue, -1, true);
}
void CXFA_Node::Script_Field_ExecValidate(CFXJSE_Arguments* pArguments) {
@@ -2604,12 +2604,12 @@ void CXFA_Node::Script_Field_ExecValidate(CFXJSE_Arguments* pArguments) {
if (argc == 0) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
- pArguments->GetReturnValue()->SetBoolean(FALSE);
+ pArguments->GetReturnValue()->SetBoolean(false);
} else {
int32_t iRet =
- pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate, FALSE, FALSE);
+ pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate, false, false);
pArguments->GetReturnValue()->SetBoolean(
- (iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE);
+ (iRet == XFA_EVENTERROR_Error) ? false : true);
}
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate");
@@ -2617,7 +2617,7 @@ void CXFA_Node::Script_Field_ExecValidate(CFXJSE_Arguments* pArguments) {
}
void CXFA_Node::Script_ExclGroup_ErrorText(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
} else {
@@ -2626,7 +2626,7 @@ void CXFA_Node::Script_ExclGroup_ErrorText(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
@@ -2634,9 +2634,9 @@ void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue,
}
if (bSetting) {
pWidgetData->SetSelectedMemberByValue(pValue->ToWideString().AsStringC(),
- true, TRUE, TRUE);
+ true, true, true);
} else {
- CFX_WideString wsValue = GetScriptContent(TRUE);
+ CFX_WideString wsValue = GetScriptContent(true);
XFA_VERSION curVersion = GetDocument()->GetCurVersionMode();
if (wsValue.IsEmpty() && curVersion >= XFA_VERSION_300) {
pValue->SetNull();
@@ -2647,7 +2647,7 @@ void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_ExclGroup_Transient(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CXFA_Node::Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments) {
@@ -2723,11 +2723,11 @@ void CXFA_Node::Script_ExclGroup_ExecValidate(CFXJSE_Arguments* pArguments) {
if (argc == 0) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
- pArguments->GetReturnValue()->SetBoolean(FALSE);
+ pArguments->GetReturnValue()->SetBoolean(false);
} else {
int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate);
pArguments->GetReturnValue()->SetBoolean(
- (iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE);
+ (iRet == XFA_EVENTERROR_Error) ? false : true);
}
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate");
@@ -2735,7 +2735,7 @@ void CXFA_Node::Script_ExclGroup_ExecValidate(CFXJSE_Arguments* pArguments) {
}
void CXFA_Node::Script_Som_InstanceIndex(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
int32_t iTo = pValue->ToInteger();
@@ -2771,7 +2771,7 @@ void CXFA_Node::Script_Som_InstanceIndex(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Subform_InstanceManager(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
CFX_WideStringC wsName = GetCData(XFA_ATTRIBUTE_Name);
@@ -2799,10 +2799,10 @@ void CXFA_Node::Script_Subform_InstanceManager(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Subform_Locale(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
- SetCData(XFA_ATTRIBUTE_Locale, pValue->ToWideString(), true, TRUE);
+ SetCData(XFA_ATTRIBUTE_Locale, pValue->ToWideString(), true, true);
} else {
CFX_WideString wsLocaleName;
GetLocaleName(wsLocaleName);
@@ -2855,11 +2855,11 @@ void CXFA_Node::Script_Subform_ExecValidate(CFXJSE_Arguments* pArguments) {
if (argc == 0) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
- pArguments->GetReturnValue()->SetBoolean(FALSE);
+ pArguments->GetReturnValue()->SetBoolean(false);
} else {
int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate);
pArguments->GetReturnValue()->SetBoolean(
- (iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE);
+ (iRet == XFA_EVENTERROR_Error) ? false : true);
}
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate");
@@ -2891,7 +2891,7 @@ int32_t CXFA_Node::Subform_and_SubformSet_InstanceIndex() {
void CXFA_Node::Script_Template_FormNodes(CFXJSE_Arguments* pArguments) {
int32_t argc = pArguments->GetLength();
if (argc == 1) {
- pArguments->GetReturnValue()->SetBoolean(TRUE);
+ pArguments->GetReturnValue()->SetBoolean(true);
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"formNodes");
}
@@ -2900,7 +2900,7 @@ void CXFA_Node::Script_Template_FormNodes(CFXJSE_Arguments* pArguments) {
void CXFA_Node::Script_Template_Remerge(CFXJSE_Arguments* pArguments) {
int32_t argc = pArguments->GetLength();
if (argc == 0) {
- m_pDocument->DoDataRemerge(TRUE);
+ m_pDocument->DoDataRemerge(true);
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"remerge");
}
@@ -2911,9 +2911,9 @@ void CXFA_Node::Script_Template_ExecInitialize(CFXJSE_Arguments* pArguments) {
if (argc == 0) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
- pArguments->GetReturnValue()->SetBoolean(FALSE);
+ pArguments->GetReturnValue()->SetBoolean(false);
} else {
- pArguments->GetReturnValue()->SetBoolean(TRUE);
+ pArguments->GetReturnValue()->SetBoolean(true);
}
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execInitialize");
@@ -2966,7 +2966,7 @@ void CXFA_Node::Script_Template_CreateNode(CFXJSE_Arguments* pArguments) {
void CXFA_Node::Script_Template_Recalculate(CFXJSE_Arguments* pArguments) {
if (pArguments->GetLength() == 1) {
- pArguments->GetReturnValue()->SetBoolean(TRUE);
+ pArguments->GetReturnValue()->SetBoolean(true);
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"recalculate");
}
@@ -2977,9 +2977,9 @@ void CXFA_Node::Script_Template_ExecCalculate(CFXJSE_Arguments* pArguments) {
if (argc == 0) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
- pArguments->GetReturnValue()->SetBoolean(FALSE);
+ pArguments->GetReturnValue()->SetBoolean(false);
} else {
- pArguments->GetReturnValue()->SetBoolean(TRUE);
+ pArguments->GetReturnValue()->SetBoolean(true);
}
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execCalculate");
@@ -2991,9 +2991,9 @@ void CXFA_Node::Script_Template_ExecValidate(CFXJSE_Arguments* pArguments) {
if (argc == 0) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
- pArguments->GetReturnValue()->SetBoolean(FALSE);
+ pArguments->GetReturnValue()->SetBoolean(false);
} else {
- pArguments->GetReturnValue()->SetBoolean(TRUE);
+ pArguments->GetReturnValue()->SetBoolean(true);
}
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate");
@@ -3005,9 +3005,9 @@ void CXFA_Node::Script_Manifest_Evaluate(CFXJSE_Arguments* pArguments) {
if (argc == 0) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
if (!pWidgetData) {
- pArguments->GetReturnValue()->SetBoolean(FALSE);
+ pArguments->GetReturnValue()->SetBoolean(false);
} else {
- pArguments->GetReturnValue()->SetBoolean(TRUE);
+ pArguments->GetReturnValue()->SetBoolean(true);
}
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"evaluate");
@@ -3015,7 +3015,7 @@ void CXFA_Node::Script_Manifest_Evaluate(CFXJSE_Arguments* pArguments) {
}
void CXFA_Node::Script_InstanceManager_Max(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -3026,7 +3026,7 @@ void CXFA_Node::Script_InstanceManager_Max(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_InstanceManager_Min(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -3037,7 +3037,7 @@ void CXFA_Node::Script_InstanceManager_Min(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_InstanceManager_Count(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
int32_t iDesired = pValue->ToInteger();
@@ -3129,9 +3129,9 @@ void CXFA_Node::Script_InstanceManager_AddInstance(
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"addInstance");
return;
}
- FX_BOOL fFlags = TRUE;
+ bool fFlags = true;
if (argc == 1) {
- fFlags = pArguments->GetInt32(0) == 0 ? FALSE : TRUE;
+ fFlags = pArguments->GetInt32(0) == 0 ? false : true;
}
int32_t iCount = GetCount(this);
CXFA_Occur nodeOccur(GetOccurNode());
@@ -3141,7 +3141,7 @@ void CXFA_Node::Script_InstanceManager_AddInstance(
return;
}
CXFA_Node* pNewInstance = CreateInstance(this, fFlags);
- InsertItem(this, pNewInstance, iCount, iCount, FALSE);
+ InsertItem(this, pNewInstance, iCount, iCount, false);
pArguments->GetReturnValue()->Assign(
m_pDocument->GetScriptContext()->GetJSValueFromMap(pNewInstance));
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
@@ -3165,9 +3165,9 @@ void CXFA_Node::Script_InstanceManager_InsertInstance(
return;
}
int32_t iIndex = pArguments->GetInt32(0);
- FX_BOOL bBind = FALSE;
+ bool bBind = false;
if (argc == 2) {
- bBind = pArguments->GetInt32(1) == 0 ? FALSE : TRUE;
+ bBind = pArguments->GetInt32(1) == 0 ? false : true;
}
CXFA_Occur nodeOccur(GetOccurNode());
int32_t iCount = GetCount(this);
@@ -3181,7 +3181,7 @@ void CXFA_Node::Script_InstanceManager_InsertInstance(
return;
}
CXFA_Node* pNewInstance = CreateInstance(this, bBind);
- InsertItem(this, pNewInstance, iIndex, iCount, TRUE);
+ InsertItem(this, pNewInstance, iIndex, iCount, true);
pArguments->GetReturnValue()->Assign(
m_pDocument->GetScriptContext()->GetJSValueFromMap(pNewInstance));
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
@@ -3230,7 +3230,7 @@ int32_t CXFA_Node::InstanceManager_SetInstances(int32_t iDesired) {
continue;
}
if (pRemoveInstance->GetElementType() == XFA_Element::InstanceManager) {
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
if (pRemoveInstance->GetNameHash() == dInstanceNameHash) {
@@ -3240,8 +3240,8 @@ int32_t CXFA_Node::InstanceManager_SetInstances(int32_t iDesired) {
}
} else if (iDesired > iCount) {
while (iCount < iDesired) {
- CXFA_Node* pNewInstance = CreateInstance(this, TRUE);
- InsertItem(this, pNewInstance, iCount, iCount, FALSE);
+ CXFA_Node* pNewInstance = CreateInstance(this, true);
+ InsertItem(this, pNewInstance, iCount, iCount, false);
iCount++;
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
@@ -3268,8 +3268,8 @@ int32_t CXFA_Node::InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom) {
return 0;
}
CXFA_Node* pMoveInstance = GetItem(this, iFrom);
- RemoveItem(this, pMoveInstance, FALSE);
- InsertItem(this, pMoveInstance, iTo, iCount - 1, TRUE);
+ RemoveItem(this, pMoveInstance, false);
+ InsertItem(this, pMoveInstance, iTo, iCount - 1, true);
CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor();
if (pLayoutPro) {
pLayoutPro->AddChangedContainer(
@@ -3279,7 +3279,7 @@ int32_t CXFA_Node::InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom) {
}
void CXFA_Node::Script_Occur_Max(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_Occur occur(this);
if (bSetting) {
@@ -3291,7 +3291,7 @@ void CXFA_Node::Script_Occur_Max(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Occur_Min(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
CXFA_Occur occur(this);
if (bSetting) {
@@ -3332,7 +3332,7 @@ void CXFA_Node::Script_Form_FormNodes(CFXJSE_Arguments* pArguments) {
void CXFA_Node::Script_Form_Remerge(CFXJSE_Arguments* pArguments) {
int32_t argc = pArguments->GetLength();
if (argc == 0) {
- m_pDocument->DoDataRemerge(TRUE);
+ m_pDocument->DoDataRemerge(true);
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"remerge");
}
@@ -3368,7 +3368,7 @@ void CXFA_Node::Script_Form_Recalculate(CFXJSE_Arguments* pArguments) {
if (bScriptFlags) {
pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate);
pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate);
- pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Ready, TRUE);
+ pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Ready, true);
} else {
}
} else {
@@ -3394,11 +3394,11 @@ void CXFA_Node::Script_Form_ExecValidate(CFXJSE_Arguments* pArguments) {
if (argc == 0) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
- pArguments->GetReturnValue()->SetBoolean(FALSE);
+ pArguments->GetReturnValue()->SetBoolean(false);
} else {
int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate);
pArguments->GetReturnValue()->SetBoolean(
- (iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE);
+ (iRet == XFA_EVENTERROR_Error) ? false : true);
}
} else {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate");
@@ -3406,13 +3406,13 @@ void CXFA_Node::Script_Form_ExecValidate(CFXJSE_Arguments* pArguments) {
}
void CXFA_Node::Script_Form_Checksum(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
SetAttribute(XFA_ATTRIBUTE_Checksum, pValue->ToWideString().AsStringC());
} else {
CFX_WideString wsChecksum;
- GetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum, FALSE);
+ GetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum, false);
pValue->SetString(
FX_UTF8Encode(wsChecksum.c_str(), wsChecksum.GetLength()).AsStringC());
}
@@ -3473,7 +3473,7 @@ void CXFA_Node::Script_Packet_RemoveAttribute(CFXJSE_Arguments* pArguments) {
}
void CXFA_Node::Script_Packet_Content(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
CFDE_XMLNode* pXMLNode = GetXMLMappingNode();
@@ -3630,11 +3630,11 @@ void CXFA_Node::Script_Source_HasDataChanged(CFXJSE_Arguments* pArguments) {
}
void CXFA_Node::Script_Source_Db(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CXFA_Node::Script_Xfa_This(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
CXFA_Object* pThis = m_pDocument->GetScriptContext()->GetThisObject();
@@ -3644,19 +3644,19 @@ void CXFA_Node::Script_Xfa_This(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Handler_Version(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CXFA_Node::Script_SubmitFormat_Mode(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CXFA_Node::Script_Extras_Type(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
void CXFA_Node::Script_Script_Stateless(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
@@ -3666,20 +3666,20 @@ void CXFA_Node::Script_Script_Stateless(CFXJSE_Value* pValue,
}
void CXFA_Node::Script_Encrypt_Format(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {}
-FX_BOOL CXFA_Node::HasAttribute(XFA_ATTRIBUTE eAttr, FX_BOOL bCanInherit) {
+bool CXFA_Node::HasAttribute(XFA_ATTRIBUTE eAttr, bool bCanInherit) {
void* pKey = GetMapKey_Element(GetElementType(), eAttr);
return HasMapModuleKey(pKey, bCanInherit);
}
-FX_BOOL CXFA_Node::SetAttribute(XFA_ATTRIBUTE eAttr,
- const CFX_WideStringC& wsValue,
- bool bNotify) {
+bool CXFA_Node::SetAttribute(XFA_ATTRIBUTE eAttr,
+ const CFX_WideStringC& wsValue,
+ bool bNotify) {
const XFA_ATTRIBUTEINFO* pAttr = XFA_GetAttributeByID(eAttr);
if (!pAttr)
- return FALSE;
+ return false;
XFA_ATTRIBUTETYPE eType = pAttr->eType;
if (eType == XFA_ATTRIBUTETYPE_NOTSURE) {
@@ -3709,15 +3709,15 @@ FX_BOOL CXFA_Node::SetAttribute(XFA_ATTRIBUTE eAttr,
default:
break;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_Node::GetAttribute(XFA_ATTRIBUTE eAttr,
- CFX_WideString& wsValue,
- FX_BOOL bUseDefault) {
+bool CXFA_Node::GetAttribute(XFA_ATTRIBUTE eAttr,
+ CFX_WideString& wsValue,
+ bool bUseDefault) {
const XFA_ATTRIBUTEINFO* pAttr = XFA_GetAttributeByID(eAttr);
if (!pAttr) {
- return FALSE;
+ return false;
}
XFA_ATTRIBUTETYPE eType = pAttr->eType;
if (eType == XFA_ATTRIBUTETYPE_NOTSURE) {
@@ -3729,64 +3729,64 @@ FX_BOOL CXFA_Node::GetAttribute(XFA_ATTRIBUTE eAttr,
case XFA_ATTRIBUTETYPE_Enum: {
XFA_ATTRIBUTEENUM eValue;
if (!TryEnum(pAttr->eName, eValue, bUseDefault)) {
- return FALSE;
+ return false;
}
wsValue = GetAttributeEnumByID(eValue)->pName;
- return TRUE;
+ return true;
} break;
case XFA_ATTRIBUTETYPE_Cdata: {
CFX_WideStringC wsValueC;
if (!TryCData(pAttr->eName, wsValueC, bUseDefault)) {
- return FALSE;
+ return false;
}
wsValue = wsValueC;
- return TRUE;
+ return true;
} break;
case XFA_ATTRIBUTETYPE_Boolean: {
- FX_BOOL bValue;
+ bool bValue;
if (!TryBoolean(pAttr->eName, bValue, bUseDefault)) {
- return FALSE;
+ return false;
}
wsValue = bValue ? FX_WSTRC(L"1") : FX_WSTRC(L"0");
- return TRUE;
+ return true;
} break;
case XFA_ATTRIBUTETYPE_Integer: {
int32_t iValue;
if (!TryInteger(pAttr->eName, iValue, bUseDefault)) {
- return FALSE;
+ return false;
}
wsValue.Format(L"%d", iValue);
- return TRUE;
+ return true;
} break;
case XFA_ATTRIBUTETYPE_Measure: {
CXFA_Measurement mValue;
if (!TryMeasure(pAttr->eName, mValue, bUseDefault)) {
- return FALSE;
+ return false;
}
mValue.ToString(wsValue);
- return TRUE;
+ return true;
} break;
default:
break;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_Node::SetAttribute(const CFX_WideStringC& wsAttr,
- const CFX_WideStringC& wsValue,
- bool bNotify) {
+bool CXFA_Node::SetAttribute(const CFX_WideStringC& wsAttr,
+ const CFX_WideStringC& wsValue,
+ bool bNotify) {
const XFA_ATTRIBUTEINFO* pAttributeInfo = XFA_GetAttributeByName(wsValue);
if (pAttributeInfo) {
return SetAttribute(pAttributeInfo->eName, wsValue, bNotify);
}
void* pKey = GetMapKey_Custom(wsAttr);
SetMapModuleString(pKey, wsValue);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_Node::GetAttribute(const CFX_WideStringC& wsAttr,
- CFX_WideString& wsValue,
- FX_BOOL bUseDefault) {
+bool CXFA_Node::GetAttribute(const CFX_WideStringC& wsAttr,
+ CFX_WideString& wsValue,
+ bool bUseDefault) {
const XFA_ATTRIBUTEINFO* pAttributeInfo = XFA_GetAttributeByName(wsAttr);
if (pAttributeInfo) {
return GetAttribute(pAttributeInfo->eName, wsValue, bUseDefault);
@@ -3796,83 +3796,83 @@ FX_BOOL CXFA_Node::GetAttribute(const CFX_WideStringC& wsAttr,
if (GetMapModuleString(pKey, wsValueC)) {
wsValue = wsValueC;
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_Node::RemoveAttribute(const CFX_WideStringC& wsAttr) {
+bool CXFA_Node::RemoveAttribute(const CFX_WideStringC& wsAttr) {
void* pKey = GetMapKey_Custom(wsAttr);
RemoveMapModuleKey(pKey);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_Node::TryBoolean(XFA_ATTRIBUTE eAttr,
- FX_BOOL& bValue,
- FX_BOOL bUseDefault) {
+bool CXFA_Node::TryBoolean(XFA_ATTRIBUTE eAttr,
+ bool& bValue,
+ bool bUseDefault) {
void* pValue = nullptr;
if (!GetValue(eAttr, XFA_ATTRIBUTETYPE_Boolean, bUseDefault, pValue))
- return FALSE;
+ return false;
bValue = !!pValue;
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_Node::TryInteger(XFA_ATTRIBUTE eAttr,
- int32_t& iValue,
- FX_BOOL bUseDefault) {
+bool CXFA_Node::TryInteger(XFA_ATTRIBUTE eAttr,
+ int32_t& iValue,
+ bool bUseDefault) {
void* pValue = nullptr;
if (!GetValue(eAttr, XFA_ATTRIBUTETYPE_Integer, bUseDefault, pValue))
- return FALSE;
+ return false;
iValue = (int32_t)(uintptr_t)pValue;
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_Node::TryEnum(XFA_ATTRIBUTE eAttr,
- XFA_ATTRIBUTEENUM& eValue,
- FX_BOOL bUseDefault) {
+bool CXFA_Node::TryEnum(XFA_ATTRIBUTE eAttr,
+ XFA_ATTRIBUTEENUM& eValue,
+ bool bUseDefault) {
void* pValue = nullptr;
if (!GetValue(eAttr, XFA_ATTRIBUTETYPE_Enum, bUseDefault, pValue))
- return FALSE;
+ return false;
eValue = (XFA_ATTRIBUTEENUM)(uintptr_t)pValue;
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_Node::SetMeasure(XFA_ATTRIBUTE eAttr,
- CXFA_Measurement mValue,
- bool bNotify) {
+bool CXFA_Node::SetMeasure(XFA_ATTRIBUTE eAttr,
+ CXFA_Measurement mValue,
+ bool bNotify) {
void* pKey = GetMapKey_Element(GetElementType(), eAttr);
OnChanging(eAttr, bNotify);
SetMapModuleBuffer(pKey, &mValue, sizeof(CXFA_Measurement));
- OnChanged(eAttr, bNotify, FALSE);
- return TRUE;
+ OnChanged(eAttr, bNotify, false);
+ return true;
}
-FX_BOOL CXFA_Node::TryMeasure(XFA_ATTRIBUTE eAttr,
- CXFA_Measurement& mValue,
- FX_BOOL bUseDefault) const {
+bool CXFA_Node::TryMeasure(XFA_ATTRIBUTE eAttr,
+ CXFA_Measurement& mValue,
+ bool bUseDefault) const {
void* pKey = GetMapKey_Element(GetElementType(), eAttr);
void* pValue;
int32_t iBytes;
if (GetMapModuleBuffer(pKey, pValue, iBytes) && iBytes == sizeof(mValue)) {
FXSYS_memcpy(&mValue, pValue, sizeof(mValue));
- return TRUE;
+ return true;
}
if (bUseDefault &&
XFA_GetAttributeDefaultValue(pValue, GetElementType(), eAttr,
XFA_ATTRIBUTETYPE_Measure, m_ePacket)) {
FXSYS_memcpy(&mValue, pValue, sizeof(mValue));
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
CXFA_Measurement CXFA_Node::GetMeasure(XFA_ATTRIBUTE eAttr) const {
CXFA_Measurement mValue;
- return TryMeasure(eAttr, mValue, TRUE) ? mValue : CXFA_Measurement();
+ return TryMeasure(eAttr, mValue, true) ? mValue : CXFA_Measurement();
}
-FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr,
- const CFX_WideString& wsValue,
- bool bNotify,
- FX_BOOL bScriptModify) {
+bool CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr,
+ const CFX_WideString& wsValue,
+ bool bNotify,
+ bool bScriptModify) {
void* pKey = GetMapKey_Element(GetElementType(), eAttr);
OnChanging(eAttr, bNotify);
if (eAttr == XFA_ATTRIBUTE_Value) {
@@ -3887,13 +3887,13 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr,
if (!IsNeedSavingXMLNode() || eAttr == XFA_ATTRIBUTE_QualifiedName ||
eAttr == XFA_ATTRIBUTE_BindingNode) {
- return TRUE;
+ return true;
}
if (eAttr == XFA_ATTRIBUTE_Name &&
(m_elementType == XFA_Element::DataValue ||
m_elementType == XFA_Element::DataGroup)) {
- return TRUE;
+ return true;
}
if (eAttr == XFA_ATTRIBUTE_Value) {
@@ -3905,7 +3905,7 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr,
->SetString(CFX_WideString(GetCData(XFA_ATTRIBUTE_QualifiedName)),
wsValue);
} else {
- FX_BOOL bDeleteChildren = TRUE;
+ bool bDeleteChildren = true;
if (GetPacketID() == XFA_XDPPACKET_Datasets) {
for (CXFA_Node* pChildDataNode =
GetNodeItem(XFA_NODEITEM_FirstChild);
@@ -3913,7 +3913,7 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr,
XFA_NODEITEM_NextSibling)) {
CXFA_NodeArray formNodes;
if (pChildDataNode->GetBindItems(formNodes) > 0) {
- bDeleteChildren = FALSE;
+ bDeleteChildren = false;
break;
}
}
@@ -3930,7 +3930,7 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr,
default:
ASSERT(0);
}
- return TRUE;
+ return true;
}
const XFA_ATTRIBUTEINFO* pInfo = XFA_GetAttributeByID(eAttr);
@@ -3942,13 +3942,13 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr,
}
static_cast<CFDE_XMLElement*>(m_pXMLNode)->SetString(wsAttrName, wsValue);
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue,
- const CFX_WideString& wsXMLValue,
- bool bNotify,
- FX_BOOL bScriptModify) {
+bool CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue,
+ const CFX_WideString& wsXMLValue,
+ bool bNotify,
+ bool bScriptModify) {
void* pKey = GetMapKey_Element(GetElementType(), XFA_ATTRIBUTE_Value);
OnChanging(XFA_ATTRIBUTE_Value, bNotify);
CFX_WideString* pClone = new CFX_WideString(wsValue);
@@ -3963,7 +3963,7 @@ FX_BOOL CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue,
->SetString(CFX_WideString(GetCData(XFA_ATTRIBUTE_QualifiedName)),
wsXMLValue);
} else {
- FX_BOOL bDeleteChildren = TRUE;
+ bool bDeleteChildren = true;
if (GetPacketID() == XFA_XDPPACKET_Datasets) {
for (CXFA_Node* pChildDataNode =
GetNodeItem(XFA_NODEITEM_FirstChild);
@@ -3971,7 +3971,7 @@ FX_BOOL CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue,
XFA_NODEITEM_NextSibling)) {
CXFA_NodeArray formNodes;
if (pChildDataNode->GetBindItems(formNodes) > 0) {
- bDeleteChildren = FALSE;
+ bDeleteChildren = false;
break;
}
}
@@ -3989,88 +3989,88 @@ FX_BOOL CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue,
ASSERT(0);
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_Node::TryCData(XFA_ATTRIBUTE eAttr,
- CFX_WideString& wsValue,
- FX_BOOL bUseDefault,
- FX_BOOL bProto) {
+bool CXFA_Node::TryCData(XFA_ATTRIBUTE eAttr,
+ CFX_WideString& wsValue,
+ bool bUseDefault,
+ bool bProto) {
void* pKey = GetMapKey_Element(GetElementType(), eAttr);
if (eAttr == XFA_ATTRIBUTE_Value) {
CFX_WideString* pStr = (CFX_WideString*)GetUserData(pKey, bProto);
if (pStr) {
wsValue = *pStr;
- return TRUE;
+ return true;
}
} else {
CFX_WideStringC wsValueC;
if (GetMapModuleString(pKey, wsValueC)) {
wsValue = wsValueC;
- return TRUE;
+ return true;
}
}
if (!bUseDefault) {
- return FALSE;
+ return false;
}
void* pValue = nullptr;
if (XFA_GetAttributeDefaultValue(pValue, GetElementType(), eAttr,
XFA_ATTRIBUTETYPE_Cdata, m_ePacket)) {
wsValue = (const FX_WCHAR*)pValue;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_Node::TryCData(XFA_ATTRIBUTE eAttr,
- CFX_WideStringC& wsValue,
- FX_BOOL bUseDefault,
- FX_BOOL bProto) {
+bool CXFA_Node::TryCData(XFA_ATTRIBUTE eAttr,
+ CFX_WideStringC& wsValue,
+ bool bUseDefault,
+ bool bProto) {
void* pKey = GetMapKey_Element(GetElementType(), eAttr);
if (eAttr == XFA_ATTRIBUTE_Value) {
CFX_WideString* pStr = (CFX_WideString*)GetUserData(pKey, bProto);
if (pStr) {
wsValue = pStr->AsStringC();
- return TRUE;
+ return true;
}
} else {
if (GetMapModuleString(pKey, wsValue)) {
- return TRUE;
+ return true;
}
}
if (!bUseDefault) {
- return FALSE;
+ return false;
}
void* pValue = nullptr;
if (XFA_GetAttributeDefaultValue(pValue, GetElementType(), eAttr,
XFA_ATTRIBUTETYPE_Cdata, m_ePacket)) {
wsValue = (CFX_WideStringC)(const FX_WCHAR*)pValue;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_Node::SetObject(XFA_ATTRIBUTE eAttr,
- void* pData,
- XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) {
+bool CXFA_Node::SetObject(XFA_ATTRIBUTE eAttr,
+ void* pData,
+ XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) {
void* pKey = GetMapKey_Element(GetElementType(), eAttr);
return SetUserData(pKey, pData, pCallbackInfo);
}
-FX_BOOL CXFA_Node::TryObject(XFA_ATTRIBUTE eAttr, void*& pData) {
+bool CXFA_Node::TryObject(XFA_ATTRIBUTE eAttr, void*& pData) {
void* pKey = GetMapKey_Element(GetElementType(), eAttr);
pData = GetUserData(pKey);
return !!pData;
}
-FX_BOOL CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr,
- XFA_ATTRIBUTETYPE eType,
- void* pValue,
- bool bNotify) {
+bool CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr,
+ XFA_ATTRIBUTETYPE eType,
+ void* pValue,
+ bool bNotify) {
void* pKey = GetMapKey_Element(GetElementType(), eAttr);
OnChanging(eAttr, bNotify);
SetMapModuleValue(pKey, pValue);
- OnChanged(eAttr, bNotify, FALSE);
+ OnChanged(eAttr, bNotify, false);
if (IsNeedSavingXMLNode()) {
ASSERT(m_pXMLNode->GetType() == FDE_XMLNODE_Element);
const XFA_ATTRIBUTEINFO* pInfo = XFA_GetAttributeByID(eAttr);
@@ -4096,45 +4096,45 @@ FX_BOOL CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr,
}
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_Node::GetValue(XFA_ATTRIBUTE eAttr,
- XFA_ATTRIBUTETYPE eType,
- FX_BOOL bUseDefault,
- void*& pValue) {
+bool CXFA_Node::GetValue(XFA_ATTRIBUTE eAttr,
+ XFA_ATTRIBUTETYPE eType,
+ bool bUseDefault,
+ void*& pValue) {
void* pKey = GetMapKey_Element(GetElementType(), eAttr);
if (GetMapModuleValue(pKey, pValue)) {
- return TRUE;
+ return true;
}
if (!bUseDefault) {
- return FALSE;
+ return false;
}
return XFA_GetAttributeDefaultValue(pValue, GetElementType(), eAttr, eType,
m_ePacket);
}
-FX_BOOL CXFA_Node::SetUserData(void* pKey,
- void* pData,
- XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) {
+bool CXFA_Node::SetUserData(void* pKey,
+ void* pData,
+ XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) {
SetMapModuleBuffer(pKey, &pData, sizeof(void*),
pCallbackInfo ? pCallbackInfo : &gs_XFADefaultFreeData);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_Node::TryUserData(void* pKey, void*& pData, FX_BOOL bProtoAlso) {
+bool CXFA_Node::TryUserData(void* pKey, void*& pData, bool bProtoAlso) {
int32_t iBytes = 0;
if (!GetMapModuleBuffer(pKey, pData, iBytes, bProtoAlso)) {
- return FALSE;
+ return false;
}
return iBytes == sizeof(void*) && FXSYS_memcpy(&pData, pData, iBytes);
}
-FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent,
- const CFX_WideString& wsXMLValue,
- bool bNotify,
- FX_BOOL bScriptModify,
- FX_BOOL bSyncData) {
+bool CXFA_Node::SetScriptContent(const CFX_WideString& wsContent,
+ const CFX_WideString& wsXMLValue,
+ bool bNotify,
+ bool bScriptModify,
+ bool bSyncData) {
CXFA_Node* pNode = nullptr;
CXFA_Node* pBindNode = nullptr;
switch (GetObjectType()) {
@@ -4145,7 +4145,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent,
ASSERT(pChildValue);
pChildValue->SetCData(XFA_ATTRIBUTE_ContentType, L"text/xml");
pChildValue->SetScriptContent(wsContent, wsContent, bNotify,
- bScriptModify, FALSE);
+ bScriptModify, false);
CXFA_Node* pBind = GetBindData();
if (bSyncData && pBind) {
CFX_WideStringArray wsSaveTextArray;
@@ -4200,7 +4200,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent,
pValueNode; pValueNode = pValueNode->GetNodeItem(
XFA_NODEITEM_NextSibling)) {
pValueNode->SetAttributeValue(wsSaveTextArray[i],
- wsSaveTextArray[i], FALSE);
+ wsSaveTextArray[i], false);
i++;
}
}
@@ -4209,7 +4209,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent,
for (int32_t i = 0; i < nodeArray.GetSize(); i++) {
if (nodeArray[i] != this) {
nodeArray[i]->SetScriptContent(wsContent, wsContent, bNotify,
- bScriptModify, FALSE);
+ bScriptModify, false);
}
}
}
@@ -4221,18 +4221,18 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent,
CXFA_Node* pChildValue = pValue->GetNodeItem(XFA_NODEITEM_FirstChild);
ASSERT(pChildValue);
pChildValue->SetScriptContent(wsContent, wsContent, bNotify,
- bScriptModify, FALSE);
+ bScriptModify, false);
}
pBindNode = GetBindData();
if (pBindNode && bSyncData) {
pBindNode->SetScriptContent(wsContent, wsXMLValue, bNotify,
- bScriptModify, FALSE);
+ bScriptModify, false);
CXFA_NodeArray nodeArray;
pBindNode->GetBindItems(nodeArray);
for (int32_t i = 0; i < nodeArray.GetSize(); i++) {
if (nodeArray[i] != this) {
nodeArray[i]->SetScriptContent(wsContent, wsContent, bNotify, true,
- FALSE);
+ false);
}
}
}
@@ -4242,7 +4242,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent,
case XFA_ObjectType::ContentNode: {
CFX_WideString wsContentType;
if (GetElementType() == XFA_Element::ExData) {
- GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE);
+ GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, false);
if (wsContentType == FX_WSTRC(L"text/html")) {
wsContentType = FX_WSTRC(L"");
SetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType.AsStringC());
@@ -4275,7 +4275,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent,
pBindNode = pParent->GetBindData();
if (pBindNode) {
pBindNode->SetScriptContent(wsContent, wsXMLValue, bNotify,
- bScriptModify, FALSE);
+ bScriptModify, false);
}
}
}
@@ -4295,24 +4295,24 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent,
pBindNode->GetBindItems(nodeArray);
for (int32_t i = 0; i < nodeArray.GetSize(); i++) {
nodeArray[i]->SetScriptContent(wsContent, wsContent, bNotify,
- bScriptModify, FALSE);
+ bScriptModify, false);
}
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_Node::SetContent(const CFX_WideString& wsContent,
- const CFX_WideString& wsXMLValue,
- bool bNotify,
- FX_BOOL bScriptModify,
- FX_BOOL bSyncData) {
+bool CXFA_Node::SetContent(const CFX_WideString& wsContent,
+ const CFX_WideString& wsXMLValue,
+ bool bNotify,
+ bool bScriptModify,
+ bool bSyncData) {
return SetScriptContent(wsContent, wsXMLValue, bNotify, bScriptModify,
bSyncData);
}
-CFX_WideString CXFA_Node::GetScriptContent(FX_BOOL bScriptModify) {
+CFX_WideString CXFA_Node::GetScriptContent(bool bScriptModify) {
CFX_WideString wsContent;
return TryContent(wsContent, bScriptModify) ? wsContent : CFX_WideString();
}
@@ -4321,9 +4321,9 @@ CFX_WideString CXFA_Node::GetContent() {
return GetScriptContent();
}
-FX_BOOL CXFA_Node::TryContent(CFX_WideString& wsContent,
- FX_BOOL bScriptModify,
- FX_BOOL bProto) {
+bool CXFA_Node::TryContent(CFX_WideString& wsContent,
+ bool bScriptModify,
+ bool bProto) {
CXFA_Node* pNode = nullptr;
switch (GetObjectType()) {
case XFA_ObjectType::ContainerNode:
@@ -4332,7 +4332,7 @@ FX_BOOL CXFA_Node::TryContent(CFX_WideString& wsContent,
} else {
CXFA_Node* pValue = GetChild(0, XFA_Element::Value);
if (!pValue) {
- return FALSE;
+ return false;
}
CXFA_Node* pChildValue = pValue->GetNodeItem(XFA_NODEITEM_FirstChild);
if (pChildValue && XFA_FieldIsMultiListBox(this)) {
@@ -4341,7 +4341,7 @@ FX_BOOL CXFA_Node::TryContent(CFX_WideString& wsContent,
}
return pChildValue
? pChildValue->TryContent(wsContent, bScriptModify, bProto)
- : FALSE;
+ : false;
}
break;
case XFA_ObjectType::ContentNode: {
@@ -4350,7 +4350,7 @@ FX_BOOL CXFA_Node::TryContent(CFX_WideString& wsContent,
XFA_Element element = XFA_Element::Sharptext;
if (GetElementType() == XFA_Element::ExData) {
CFX_WideString wsContentType;
- GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE);
+ GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, false);
if (wsContentType == FX_WSTRC(L"text/html")) {
element = XFA_Element::SharpxHTML;
} else if (wsContentType == FX_WSTRC(L"text/xml")) {
@@ -4379,9 +4379,9 @@ FX_BOOL CXFA_Node::TryContent(CFX_WideString& wsContent,
m_pDocument->GetScriptContext()->AddNodesOfRunScript(this);
}
}
- return TryCData(XFA_ATTRIBUTE_Value, wsContent, FALSE, bProto);
+ return TryCData(XFA_ATTRIBUTE_Value, wsContent, false, bProto);
}
- return FALSE;
+ return false;
}
CXFA_Node* CXFA_Node::GetModelNode() {
@@ -4409,22 +4409,22 @@ CXFA_Node* CXFA_Node::GetModelNode() {
}
}
-FX_BOOL CXFA_Node::TryNamespace(CFX_WideString& wsNamespace) {
+bool CXFA_Node::TryNamespace(CFX_WideString& wsNamespace) {
wsNamespace.clear();
if (IsModelNode() || GetElementType() == XFA_Element::Packet) {
CFDE_XMLNode* pXMLNode = GetXMLMappingNode();
if (!pXMLNode || pXMLNode->GetType() != FDE_XMLNODE_Element) {
- return FALSE;
+ return false;
}
static_cast<CFDE_XMLElement*>(pXMLNode)->GetNamespaceURI(wsNamespace);
- return TRUE;
+ return true;
} else if (GetPacketID() == XFA_XDPPACKET_Datasets) {
CFDE_XMLNode* pXMLNode = GetXMLMappingNode();
if (!pXMLNode) {
- return FALSE;
+ return false;
}
if (pXMLNode->GetType() != FDE_XMLNODE_Element) {
- return TRUE;
+ return true;
}
if (GetElementType() == XFA_Element::DataValue &&
GetEnum(XFA_ATTRIBUTE_Contains) == XFA_ATTRIBUTEENUM_MetaData) {
@@ -4433,7 +4433,7 @@ FX_BOOL CXFA_Node::TryNamespace(CFX_WideString& wsNamespace) {
GetCData(XFA_ATTRIBUTE_QualifiedName), wsNamespace);
}
static_cast<CFDE_XMLElement*>(pXMLNode)->GetNamespaceURI(wsNamespace);
- return TRUE;
+ return true;
} else {
CXFA_Node* pModelNode = GetModelNode();
return pModelNode->TryNamespace(wsNamespace);
@@ -4442,7 +4442,7 @@ FX_BOOL CXFA_Node::TryNamespace(CFX_WideString& wsNamespace) {
CXFA_Node* CXFA_Node::GetProperty(int32_t index,
XFA_Element eProperty,
- FX_BOOL bCreateProperty) {
+ bool bCreateProperty) {
XFA_Element eType = GetElementType();
uint32_t dwPacket = GetPacketID();
const XFA_PROPERTY* pProperty =
@@ -4485,7 +4485,7 @@ CXFA_Node* CXFA_Node::GetProperty(int32_t index,
return pNewNode;
}
-int32_t CXFA_Node::CountChildren(XFA_Element eType, FX_BOOL bOnlyChild) {
+int32_t CXFA_Node::CountChildren(XFA_Element eType, bool bOnlyChild) {
CXFA_Node* pNode = m_pChild;
int32_t iCount = 0;
for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
@@ -4505,7 +4505,7 @@ int32_t CXFA_Node::CountChildren(XFA_Element eType, FX_BOOL bOnlyChild) {
CXFA_Node* CXFA_Node::GetChild(int32_t index,
XFA_Element eType,
- FX_BOOL bOnlyChild) {
+ bool bOnlyChild) {
ASSERT(index > -1);
CXFA_Node* pNode = m_pChild;
int32_t iCount = 0;
@@ -4530,7 +4530,7 @@ CXFA_Node* CXFA_Node::GetChild(int32_t index,
int32_t CXFA_Node::InsertChild(int32_t index, CXFA_Node* pNode) {
ASSERT(!pNode->m_pNext);
pNode->m_pParent = this;
- FX_BOOL ret = m_pDocument->RemovePurgeNode(pNode);
+ bool ret = m_pDocument->RemovePurgeNode(pNode);
ASSERT(ret);
(void)ret; // Avoid unused variable warning.
@@ -4574,13 +4574,13 @@ int32_t CXFA_Node::InsertChild(int32_t index, CXFA_Node* pNode) {
return index;
}
-FX_BOOL CXFA_Node::InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode) {
+bool CXFA_Node::InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode) {
if (!pNode || pNode->m_pParent ||
(pBeforeNode && pBeforeNode->m_pParent != this)) {
ASSERT(false);
- return FALSE;
+ return false;
}
- FX_BOOL ret = m_pDocument->RemovePurgeNode(pNode);
+ bool ret = m_pDocument->RemovePurgeNode(pNode);
ASSERT(ret);
(void)ret; // Avoid unused variable warning.
@@ -4618,7 +4618,7 @@ FX_BOOL CXFA_Node::InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode) {
m_pXMLNode->InsertChildNode(pNode->m_pXMLNode, nIndex);
pNode->ClearFlag(XFA_NodeFlag_OwnXMLNode);
}
- return TRUE;
+ return true;
}
CXFA_Node* CXFA_Node::Deprecated_GetPrevSibling() {
@@ -4634,10 +4634,10 @@ CXFA_Node* CXFA_Node::Deprecated_GetPrevSibling() {
return nullptr;
}
-FX_BOOL CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) {
+bool CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) {
if (!pNode || pNode->m_pParent != this) {
- ASSERT(FALSE);
- return FALSE;
+ ASSERT(false);
+ return false;
}
if (m_pChild == pNode) {
m_pChild = pNode->m_pNext;
@@ -4671,7 +4671,7 @@ FX_BOOL CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) {
pXMLElement->RemoveAttribute(wsAttributeName.c_str());
}
CFX_WideString wsName;
- pNode->GetAttribute(XFA_ATTRIBUTE_Name, wsName, FALSE);
+ pNode->GetAttribute(XFA_ATTRIBUTE_Name, wsName, false);
CFDE_XMLElement* pNewXMLElement = new CFDE_XMLElement(wsName);
CFX_WideStringC wsValue = GetCData(XFA_ATTRIBUTE_Value);
if (!wsValue.IsEmpty()) {
@@ -4684,7 +4684,7 @@ FX_BOOL CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) {
}
pNode->SetFlag(XFA_NodeFlag_OwnXMLNode, false);
}
- return TRUE;
+ return true;
}
CXFA_Node* CXFA_Node::GetFirstChildByName(const CFX_WideStringC& wsName) const {
@@ -4814,7 +4814,7 @@ void CXFA_Node::ClearFlag(uint32_t dwFlag) {
m_uNodeFlags &= ~dwFlag;
}
-FX_BOOL CXFA_Node::IsAttributeInXML() {
+bool CXFA_Node::IsAttributeInXML() {
return GetEnum(XFA_ATTRIBUTE_Contains) == XFA_ATTRIBUTEENUM_MetaData;
}
@@ -4838,7 +4838,7 @@ void CXFA_Node::OnChanging(XFA_ATTRIBUTE eAttr, bool bNotify) {
void CXFA_Node::OnChanged(XFA_ATTRIBUTE eAttr,
bool bNotify,
- FX_BOOL bScriptModify) {
+ bool bScriptModify) {
if (bNotify && IsInitialized()) {
Script_Attribute_SendAttributeChangeMessage(eAttr, bScriptModify);
}
@@ -4859,11 +4859,11 @@ int32_t CXFA_Node::execSingleEventByName(const CFX_WideStringC& wsEventName,
iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType);
} else if (validFlags == 2) {
iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType,
- FALSE, FALSE);
+ false, false);
} else if (validFlags == 3) {
if (eType == XFA_Element::Subform) {
iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType,
- FALSE, FALSE);
+ false, false);
}
} else if (validFlags == 4) {
if (eType == XFA_Element::ExclGroup || eType == XFA_Element::Field) {
@@ -4871,15 +4871,15 @@ int32_t CXFA_Node::execSingleEventByName(const CFX_WideStringC& wsEventName,
if (pParentNode &&
pParentNode->GetElementType() == XFA_Element::ExclGroup) {
iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType,
- FALSE, FALSE);
+ false, false);
}
iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType,
- FALSE, FALSE);
+ false, false);
}
} else if (validFlags == 5) {
if (eType == XFA_Element::Field) {
iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType,
- FALSE, FALSE);
+ false, false);
}
} else if (validFlags == 6) {
CXFA_WidgetData* pWidgetData = GetWidgetData();
@@ -4887,7 +4887,7 @@ int32_t CXFA_Node::execSingleEventByName(const CFX_WideStringC& wsEventName,
CXFA_Node* pUINode = pWidgetData->GetUIChild();
if (pUINode->m_elementType == XFA_Element::Signature) {
iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType,
- FALSE, FALSE);
+ false, false);
}
}
} else if (validFlags == 7) {
@@ -4897,7 +4897,7 @@ int32_t CXFA_Node::execSingleEventByName(const CFX_WideStringC& wsEventName,
if ((pUINode->m_elementType == XFA_Element::ChoiceList) &&
(!pWidgetData->IsListBox())) {
iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType,
- FALSE, FALSE);
+ false, false);
}
}
}
@@ -4927,7 +4927,7 @@ CFDE_XMLNode* CXFA_Node::CreateXMLMappingNode() {
return m_pXMLNode;
}
-FX_BOOL CXFA_Node::IsNeedSavingXMLNode() {
+bool CXFA_Node::IsNeedSavingXMLNode() {
return m_pXMLNode && (GetPacketID() == XFA_XDPPACKET_Datasets ||
GetElementType() == XFA_Element::Xfa);
}
@@ -4947,18 +4947,18 @@ void CXFA_Node::SetMapModuleValue(void* pKey, void* pValue) {
pModule->m_ValueMap.SetAt(pKey, pValue);
}
-FX_BOOL CXFA_Node::GetMapModuleValue(void* pKey, void*& pValue) {
+bool CXFA_Node::GetMapModuleValue(void* pKey, void*& pValue) {
CXFA_Node* pNode = this;
while (pNode) {
XFA_MAPMODULEDATA* pModule = pNode->GetMapModuleData();
if (pModule && pModule->m_ValueMap.Lookup(pKey, pValue)) {
- return TRUE;
+ return true;
}
pNode = pNode->GetPacketID() != XFA_XDPPACKET_Datasets
? pNode->GetTemplateNode()
: nullptr;
}
- return FALSE;
+ return false;
}
void CXFA_Node::SetMapModuleString(void* pKey, const CFX_WideStringC& wsValue) {
@@ -4966,14 +4966,14 @@ void CXFA_Node::SetMapModuleString(void* pKey, const CFX_WideStringC& wsValue) {
wsValue.GetLength() * sizeof(FX_WCHAR));
}
-FX_BOOL CXFA_Node::GetMapModuleString(void* pKey, CFX_WideStringC& wsValue) {
+bool CXFA_Node::GetMapModuleString(void* pKey, CFX_WideStringC& wsValue) {
void* pValue;
int32_t iBytes;
if (!GetMapModuleBuffer(pKey, pValue, iBytes)) {
- return FALSE;
+ return false;
}
wsValue = CFX_WideStringC((const FX_WCHAR*)pValue, iBytes / sizeof(FX_WCHAR));
- return TRUE;
+ return true;
}
void CXFA_Node::SetMapModuleBuffer(
@@ -5003,10 +5003,10 @@ void CXFA_Node::SetMapModuleBuffer(
FXSYS_memcpy(pBuffer->GetData(), pValue, iBytes);
}
-FX_BOOL CXFA_Node::GetMapModuleBuffer(void* pKey,
- void*& pValue,
- int32_t& iBytes,
- FX_BOOL bProtoAlso) const {
+bool CXFA_Node::GetMapModuleBuffer(void* pKey,
+ void*& pValue,
+ int32_t& iBytes,
+ bool bProtoAlso) const {
XFA_MAPDATABLOCK* pBuffer = nullptr;
const CXFA_Node* pNode = this;
while (pNode) {
@@ -5019,14 +5019,14 @@ FX_BOOL CXFA_Node::GetMapModuleBuffer(void* pKey,
: nullptr;
}
if (!pBuffer) {
- return FALSE;
+ return false;
}
pValue = pBuffer->GetData();
iBytes = pBuffer->iBytes;
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_Node::HasMapModuleKey(void* pKey, FX_BOOL bProtoAlso) {
+bool CXFA_Node::HasMapModuleKey(void* pKey, bool bProtoAlso) {
CXFA_Node* pNode = this;
while (pNode) {
void* pVal;
@@ -5034,13 +5034,13 @@ FX_BOOL CXFA_Node::HasMapModuleKey(void* pKey, FX_BOOL bProtoAlso) {
if (pModule &&
(pModule->m_ValueMap.Lookup(pKey, pVal) ||
pModule->m_BufferMap.Lookup(pKey, (XFA_MAPDATABLOCK*&)pVal))) {
- return TRUE;
+ return true;
}
pNode = (bProtoAlso && pNode->GetPacketID() != XFA_XDPPACKET_Datasets)
? pNode->GetTemplateNode()
: nullptr;
}
- return FALSE;
+ return false;
}
void CXFA_Node::RemoveMapModuleKey(void* pKey) {
@@ -5077,7 +5077,7 @@ void CXFA_Node::RemoveMapModuleKey(void* pKey) {
}
}
-void CXFA_Node::MergeAllData(void* pDstModule, FX_BOOL bUseSrcAttr) {
+void CXFA_Node::MergeAllData(void* pDstModule, bool bUseSrcAttr) {
XFA_MAPMODULEDATA* pDstModuleData =
static_cast<CXFA_Node*>(pDstModule)->CreateMapModuleData();
XFA_MAPMODULEDATA* pSrcModuleData = GetMapModuleData();
@@ -5138,19 +5138,19 @@ void CXFA_Node::MoveBufferMapData(CXFA_Node* pDstModule, void* pKey) {
if (!pDstModule) {
return;
}
- FX_BOOL bNeedMove = TRUE;
+ bool bNeedMove = true;
if (!pKey) {
- bNeedMove = FALSE;
+ bNeedMove = false;
}
if (pDstModule->GetElementType() != GetElementType()) {
- bNeedMove = FALSE;
+ bNeedMove = false;
}
XFA_MAPMODULEDATA* pSrcModuleData = nullptr;
XFA_MAPMODULEDATA* pDstModuleData = nullptr;
if (bNeedMove) {
pSrcModuleData = GetMapModuleData();
if (!pSrcModuleData) {
- bNeedMove = FALSE;
+ bNeedMove = false;
}
pDstModuleData = pDstModule->CreateMapModuleData();
}
@@ -5164,20 +5164,20 @@ void CXFA_Node::MoveBufferMapData(CXFA_Node* pDstModule, void* pKey) {
}
}
if (pDstModule->IsNodeV()) {
- CFX_WideString wsValue = pDstModule->GetScriptContent(FALSE);
+ CFX_WideString wsValue = pDstModule->GetScriptContent(false);
CFX_WideString wsFormatValue(wsValue);
CXFA_WidgetData* pWidgetData = pDstModule->GetContainerWidgetData();
if (pWidgetData) {
pWidgetData->GetFormatDataValue(wsValue, wsFormatValue);
}
- pDstModule->SetScriptContent(wsValue, wsFormatValue, true, TRUE);
+ pDstModule->SetScriptContent(wsValue, wsFormatValue, true, true);
}
}
void CXFA_Node::MoveBufferMapData(CXFA_Node* pSrcModule,
CXFA_Node* pDstModule,
void* pKey,
- FX_BOOL bRecursive) {
+ bool bRecursive) {
if (!pSrcModule || !pDstModule || !pKey) {
return;
}
@@ -5187,7 +5187,7 @@ void CXFA_Node::MoveBufferMapData(CXFA_Node* pSrcModule,
for (; pSrcChild && pDstChild;
pSrcChild = pSrcChild->GetNodeItem(XFA_NODEITEM_NextSibling),
pDstChild = pDstChild->GetNodeItem(XFA_NODEITEM_NextSibling)) {
- MoveBufferMapData(pSrcChild, pDstChild, pKey, TRUE);
+ MoveBufferMapData(pSrcChild, pDstChild, pKey, true);
}
}
pSrcModule->MoveBufferMapData(pDstModule, pKey);
diff --git a/xfa/fxfa/parser/cxfa_nodehelper.cpp b/xfa/fxfa/parser/cxfa_nodehelper.cpp
index 27b8b038aa..18a9594da1 100644
--- a/xfa/fxfa/parser/cxfa_nodehelper.cpp
+++ b/xfa/fxfa/parser/cxfa_nodehelper.cpp
@@ -26,7 +26,7 @@ CXFA_NodeHelper::~CXFA_NodeHelper() {}
CXFA_Node* CXFA_NodeHelper::ResolveNodes_GetOneChild(CXFA_Node* parent,
const FX_WCHAR* pwsName,
- FX_BOOL bIsClassName) {
+ bool bIsClassName) {
if (!parent) {
return nullptr;
}
@@ -42,7 +42,7 @@ CXFA_Node* CXFA_NodeHelper::ResolveNodes_GetOneChild(CXFA_Node* parent,
int32_t CXFA_NodeHelper::CountSiblings(CXFA_Node* pNode,
XFA_LOGIC_TYPE eLogicType,
CXFA_NodeArray* pSiblings,
- FX_BOOL bIsClassName) {
+ bool bIsClassName) {
if (!pNode)
return 0;
CXFA_Node* parent = ResolveNodes_GetParent(pNode, XFA_LOGIC_NoTransparent);
@@ -68,7 +68,7 @@ int32_t CXFA_NodeHelper::CountSiblings(CXFA_Node* pNode,
int32_t CXFA_NodeHelper::NodeAcc_TraverseAnySiblings(CXFA_Node* parent,
uint32_t dNameHash,
CXFA_NodeArray* pSiblings,
- FX_BOOL bIsClassName) {
+ bool bIsClassName) {
if (!parent || !pSiblings) {
return 0;
}
@@ -129,8 +129,8 @@ int32_t CXFA_NodeHelper::NodeAcc_TraverseSiblings(CXFA_Node* parent,
uint32_t dNameHash,
CXFA_NodeArray* pSiblings,
XFA_LOGIC_TYPE eLogicType,
- FX_BOOL bIsClassName,
- FX_BOOL bIsFindProperty) {
+ bool bIsClassName,
+ bool bIsFindProperty) {
if (!parent || !pSiblings) {
return 0;
}
@@ -160,7 +160,7 @@ int32_t CXFA_NodeHelper::NodeAcc_TraverseSiblings(CXFA_Node* parent,
if (child->IsUnnamed() &&
child->GetElementType() == XFA_Element::PageSet) {
nCount += NodeAcc_TraverseSiblings(child, dNameHash, pSiblings,
- eLogicType, bIsClassName, FALSE);
+ eLogicType, bIsClassName, false);
}
}
if (nCount > 0) {
@@ -196,7 +196,7 @@ int32_t CXFA_NodeHelper::NodeAcc_TraverseSiblings(CXFA_Node* parent,
if (NodeIsTransparent(child) &&
child->GetElementType() != XFA_Element::PageSet) {
nCount += NodeAcc_TraverseSiblings(child, dNameHash, pSiblings,
- eLogicType, bIsClassName, FALSE);
+ eLogicType, bIsClassName, false);
}
}
return nCount;
@@ -212,7 +212,7 @@ CXFA_Node* CXFA_NodeHelper::ResolveNodes_GetParent(CXFA_Node* pNode,
}
CXFA_Node* parent;
CXFA_Node* node = pNode;
- while (TRUE) {
+ while (true) {
parent = ResolveNodes_GetParent(node);
if (!parent) {
break;
@@ -229,8 +229,8 @@ CXFA_Node* CXFA_NodeHelper::ResolveNodes_GetParent(CXFA_Node* pNode,
int32_t CXFA_NodeHelper::GetIndex(CXFA_Node* pNode,
XFA_LOGIC_TYPE eLogicType,
- FX_BOOL bIsProperty,
- FX_BOOL bIsClassIndex) {
+ bool bIsProperty,
+ bool bIsClassIndex) {
CXFA_Node* parent = ResolveNodes_GetParent(pNode, XFA_LOGIC_NoTransparent);
if (!parent) {
return 0;
@@ -259,16 +259,16 @@ int32_t CXFA_NodeHelper::GetIndex(CXFA_Node* pNode,
void CXFA_NodeHelper::GetNameExpression(CXFA_Node* refNode,
CFX_WideString& wsName,
- FX_BOOL bIsAllPath,
+ bool bIsAllPath,
XFA_LOGIC_TYPE eLogicType) {
wsName.clear();
if (bIsAllPath) {
- GetNameExpression(refNode, wsName, FALSE, eLogicType);
+ GetNameExpression(refNode, wsName, false, eLogicType);
CFX_WideString wsParent;
CXFA_Node* parent =
ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent);
while (parent) {
- GetNameExpression(parent, wsParent, FALSE, eLogicType);
+ GetNameExpression(parent, wsParent, false, eLogicType);
wsParent += L".";
wsParent += wsName;
wsName = wsParent;
@@ -278,40 +278,40 @@ void CXFA_NodeHelper::GetNameExpression(CXFA_Node* refNode,
}
CFX_WideString ws;
- FX_BOOL bIsProperty = NodeIsProperty(refNode);
+ bool bIsProperty = NodeIsProperty(refNode);
if (refNode->IsUnnamed() ||
(bIsProperty && refNode->GetElementType() != XFA_Element::PageSet)) {
ws = refNode->GetClassName();
wsName.Format(L"#%s[%d]", ws.c_str(),
- GetIndex(refNode, eLogicType, bIsProperty, TRUE));
+ GetIndex(refNode, eLogicType, bIsProperty, true));
return;
}
ws = refNode->GetCData(XFA_ATTRIBUTE_Name);
ws.Replace(L".", L"\\.");
wsName.Format(L"%s[%d]", ws.c_str(),
- GetIndex(refNode, eLogicType, bIsProperty, FALSE));
+ GetIndex(refNode, eLogicType, bIsProperty, false));
}
-FX_BOOL CXFA_NodeHelper::NodeIsTransparent(CXFA_Node* refNode) {
+bool CXFA_NodeHelper::NodeIsTransparent(CXFA_Node* refNode) {
if (!refNode) {
- return FALSE;
+ return false;
}
XFA_Element refNodeType = refNode->GetElementType();
if ((refNode->IsUnnamed() && refNode->IsContainerNode()) ||
refNodeType == XFA_Element::SubformSet ||
refNodeType == XFA_Element::Area || refNodeType == XFA_Element::Proto) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_NodeHelper::CreateNode_ForCondition(CFX_WideString& wsCondition) {
+bool CXFA_NodeHelper::CreateNode_ForCondition(CFX_WideString& wsCondition) {
int32_t iLen = wsCondition.GetLength();
CFX_WideString wsIndex(L"0");
- FX_BOOL bAll = FALSE;
+ bool bAll = false;
if (iLen == 0) {
m_iCreateFlag = XFA_RESOLVENODE_RSTYPE_CreateNodeOne;
- return FALSE;
+ return false;
}
if (wsCondition.GetAt(0) == '[') {
int32_t i = 1;
@@ -323,7 +323,7 @@ FX_BOOL CXFA_NodeHelper::CreateNode_ForCondition(CFX_WideString& wsCondition) {
if (ch == '+' || ch == '-') {
break;
} else if (ch == '*') {
- bAll = TRUE;
+ bAll = true;
break;
} else {
break;
@@ -338,28 +338,28 @@ FX_BOOL CXFA_NodeHelper::CreateNode_ForCondition(CFX_WideString& wsCondition) {
}
int32_t iIndex = wsIndex.GetInteger();
m_iCreateCount = iIndex;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_NodeHelper::ResolveNodes_CreateNode(
+bool CXFA_NodeHelper::ResolveNodes_CreateNode(
CFX_WideString wsName,
CFX_WideString wsCondition,
- FX_BOOL bLastNode,
+ bool bLastNode,
CXFA_ScriptContext* pScriptContext) {
if (!m_pCreateParent) {
- return FALSE;
+ return false;
}
- FX_BOOL bIsClassName = FALSE;
- FX_BOOL bResult = FALSE;
+ bool bIsClassName = false;
+ bool bResult = false;
if (wsName.GetAt(0) == '!') {
wsName = wsName.Right(wsName.GetLength() - 1);
m_pCreateParent = ToNode(
pScriptContext->GetDocument()->GetXFAObject(XFA_HASHCODE_Datasets));
}
if (wsName.GetAt(0) == '#') {
- bIsClassName = TRUE;
+ bIsClassName = true;
wsName = wsName.Right(wsName.GetLength() - 1);
}
if (m_iCreateCount == 0) {
@@ -368,7 +368,7 @@ FX_BOOL CXFA_NodeHelper::ResolveNodes_CreateNode(
if (bIsClassName) {
XFA_Element eType = XFA_GetElementTypeForName(wsName.AsStringC());
if (eType == XFA_Element::Unknown)
- return FALSE;
+ return false;
for (int32_t iIndex = 0; iIndex < m_iCreateCount; iIndex++) {
CXFA_Node* pNewNode = m_pCreateParent->CreateSamePacketNode(eType);
@@ -377,7 +377,7 @@ FX_BOOL CXFA_NodeHelper::ResolveNodes_CreateNode(
if (iIndex == m_iCreateCount - 1) {
m_pCreateParent = pNewNode;
}
- bResult = TRUE;
+ bResult = true;
}
}
} else {
@@ -394,7 +394,7 @@ FX_BOOL CXFA_NodeHelper::ResolveNodes_CreateNode(
if (iIndex == m_iCreateCount - 1) {
m_pCreateParent = pNewNode;
}
- bResult = TRUE;
+ bResult = true;
}
}
}
@@ -419,7 +419,7 @@ void CXFA_NodeHelper::SetCreateNodeType(CXFA_Node* refNode) {
}
}
-FX_BOOL CXFA_NodeHelper::NodeIsProperty(CXFA_Node* refNode) {
+bool CXFA_NodeHelper::NodeIsProperty(CXFA_Node* refNode) {
CXFA_Node* parent = ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent);
return parent && refNode &&
XFA_GetPropertyOfElement(parent->GetElementType(),
diff --git a/xfa/fxfa/parser/cxfa_nodehelper.h b/xfa/fxfa/parser/cxfa_nodehelper.h
index a913d5de04..5097feabac 100644
--- a/xfa/fxfa/parser/cxfa_nodehelper.h
+++ b/xfa/fxfa/parser/cxfa_nodehelper.h
@@ -24,7 +24,7 @@ class CXFA_NodeHelper {
CXFA_Node* ResolveNodes_GetOneChild(CXFA_Node* parent,
const FX_WCHAR* pwsName,
- FX_BOOL bIsClassName = FALSE);
+ bool bIsClassName = false);
CXFA_Node* ResolveNodes_GetParent(
CXFA_Node* pNode,
XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent);
@@ -33,32 +33,32 @@ class CXFA_NodeHelper {
uint32_t dNameHash,
CXFA_NodeArray* pSiblings,
XFA_LOGIC_TYPE eLogicType,
- FX_BOOL bIsClassName = FALSE,
- FX_BOOL bIsFindProperty = TRUE);
+ bool bIsClassName = false,
+ bool bIsFindProperty = true);
int32_t NodeAcc_TraverseAnySiblings(CXFA_Node* parent,
uint32_t dNameHash,
CXFA_NodeArray* pSiblings,
- FX_BOOL bIsClassName = FALSE);
+ bool bIsClassName = false);
int32_t CountSiblings(CXFA_Node* pNode,
XFA_LOGIC_TYPE eLogicType,
CXFA_NodeArray* pSiblings,
- FX_BOOL bIsClassName = FALSE);
+ bool bIsClassName = false);
int32_t GetIndex(CXFA_Node* pNode,
XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent,
- FX_BOOL bIsProperty = FALSE,
- FX_BOOL bIsClassIndex = FALSE);
+ bool bIsProperty = false,
+ bool bIsClassIndex = false);
void GetNameExpression(CXFA_Node* refNode,
CFX_WideString& wsName,
- FX_BOOL bIsAllPath,
+ bool bIsAllPath,
XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent);
- FX_BOOL NodeIsTransparent(CXFA_Node* refNode);
- FX_BOOL ResolveNodes_CreateNode(CFX_WideString wsName,
- CFX_WideString wsCondition,
- FX_BOOL bLastNode,
- CXFA_ScriptContext* pScriptContext);
- FX_BOOL CreateNode_ForCondition(CFX_WideString& wsCondition);
+ bool NodeIsTransparent(CXFA_Node* refNode);
+ bool ResolveNodes_CreateNode(CFX_WideString wsName,
+ CFX_WideString wsCondition,
+ bool bLastNode,
+ CXFA_ScriptContext* pScriptContext);
+ bool CreateNode_ForCondition(CFX_WideString& wsCondition);
void SetCreateNodeType(CXFA_Node* refNode);
- FX_BOOL NodeIsProperty(CXFA_Node* refNode);
+ bool NodeIsProperty(CXFA_Node* refNode);
public:
XFA_Element m_eLastCreateType;
diff --git a/xfa/fxfa/parser/cxfa_nodelist.cpp b/xfa/fxfa/parser/cxfa_nodelist.cpp
index df6cd408e4..9eb04c994f 100644
--- a/xfa/fxfa/parser/cxfa_nodelist.cpp
+++ b/xfa/fxfa/parser/cxfa_nodelist.cpp
@@ -108,7 +108,7 @@ void CXFA_NodeList::Script_TreelistClass_NamedItem(
}
void CXFA_NodeList::Script_ListClass_Length(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (!bSetting) {
pValue->SetInteger(GetLength());
diff --git a/xfa/fxfa/parser/cxfa_object.cpp b/xfa/fxfa/parser/cxfa_object.cpp
index 10e1b822e2..a31060241a 100644
--- a/xfa/fxfa/parser/cxfa_object.cpp
+++ b/xfa/fxfa/parser/cxfa_object.cpp
@@ -36,7 +36,7 @@ XFA_Element CXFA_Object::GetElementType() const {
}
void CXFA_Object::Script_ObjectClass_ClassName(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute) {
if (bSetting) {
ThrowException(XFA_IDS_INVAlID_PROP_SET);
diff --git a/xfa/fxfa/parser/cxfa_occur.cpp b/xfa/fxfa/parser/cxfa_occur.cpp
index 6d105abec6..a8994223f9 100644
--- a/xfa/fxfa/parser/cxfa_occur.cpp
+++ b/xfa/fxfa/parser/cxfa_occur.cpp
@@ -13,7 +13,7 @@ CXFA_Occur::CXFA_Occur(CXFA_Node* pNode) : CXFA_Data(pNode) {}
int32_t CXFA_Occur::GetMax() {
int32_t iMax = 1;
if (m_pNode) {
- if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, TRUE))
+ if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, true))
iMax = GetMin();
}
return iMax;
@@ -22,46 +22,46 @@ int32_t CXFA_Occur::GetMax() {
int32_t CXFA_Occur::GetMin() {
int32_t iMin = 1;
if (m_pNode) {
- if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, TRUE) || iMin < 0)
+ if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, true) || iMin < 0)
iMin = 1;
}
return iMin;
}
-FX_BOOL CXFA_Occur::GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit) {
+bool CXFA_Occur::GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit) {
if (!m_pNode)
- return FALSE;
- if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, FALSE) || iMin < 0)
+ return false;
+ if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, false) || iMin < 0)
iMin = 1;
- if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE)) {
+ if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, false)) {
if (iMin == 0)
iMax = 1;
else
iMax = iMin;
}
- if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Initial, iInit, FALSE) ||
+ if (!m_pNode->TryInteger(XFA_ATTRIBUTE_Initial, iInit, false) ||
iInit < iMin) {
iInit = iMin;
}
- return TRUE;
+ return true;
}
void CXFA_Occur::SetMax(int32_t iMax) {
iMax = (iMax != -1 && iMax < 1) ? 1 : iMax;
- m_pNode->SetInteger(XFA_ATTRIBUTE_Max, iMax, FALSE);
+ m_pNode->SetInteger(XFA_ATTRIBUTE_Max, iMax, false);
int32_t iMin = GetMin();
if (iMax != -1 && iMax < iMin) {
iMin = iMax;
- m_pNode->SetInteger(XFA_ATTRIBUTE_Min, iMin, FALSE);
+ m_pNode->SetInteger(XFA_ATTRIBUTE_Min, iMin, false);
}
}
void CXFA_Occur::SetMin(int32_t iMin) {
iMin = (iMin < 0) ? 1 : iMin;
- m_pNode->SetInteger(XFA_ATTRIBUTE_Min, iMin, FALSE);
+ m_pNode->SetInteger(XFA_ATTRIBUTE_Min, iMin, false);
int32_t iMax = GetMax();
if (iMax > 0 && iMax < iMin) {
iMax = iMin;
- m_pNode->SetInteger(XFA_ATTRIBUTE_Max, iMax, FALSE);
+ m_pNode->SetInteger(XFA_ATTRIBUTE_Max, iMax, false);
}
}
diff --git a/xfa/fxfa/parser/cxfa_occur.h b/xfa/fxfa/parser/cxfa_occur.h
index 58b44b9135..69db071a11 100644
--- a/xfa/fxfa/parser/cxfa_occur.h
+++ b/xfa/fxfa/parser/cxfa_occur.h
@@ -18,7 +18,7 @@ class CXFA_Occur : public CXFA_Data {
int32_t GetMax();
int32_t GetMin();
- FX_BOOL GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit);
+ bool GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit);
void SetMax(int32_t iMax);
void SetMin(int32_t iMin);
};
diff --git a/xfa/fxfa/parser/cxfa_resolveprocessor.cpp b/xfa/fxfa/parser/cxfa_resolveprocessor.cpp
index 823e884821..271e14be6c 100644
--- a/xfa/fxfa/parser/cxfa_resolveprocessor.cpp
+++ b/xfa/fxfa/parser/cxfa_resolveprocessor.cpp
@@ -81,9 +81,9 @@ int32_t CXFA_ResolveProcessor::ResolveAnyChild(CXFA_ResolveNodesData& rnd) {
CFX_WideString wsCondition = rnd.m_wsCondition;
CXFA_Node* findNode = nullptr;
CXFA_NodeArray siblings;
- FX_BOOL bClassName = FALSE;
+ bool bClassName = false;
if (wsName.GetAt(0) == '#') {
- bClassName = TRUE;
+ bClassName = true;
wsName = wsName.Right(wsName.GetLength() - 1);
}
findNode = m_pNodeHelper->ResolveNodes_GetOneChild(
@@ -266,7 +266,7 @@ int32_t CXFA_ResolveProcessor::ResolveNormal(CXFA_ResolveNodesData& rnd) {
}
}
if (dwStyles & XFA_RESOLVENODE_Children) {
- FX_BOOL bSetFlag = FALSE;
+ bool bSetFlag = false;
if (pPageSetNode && (dwStyles & XFA_RESOLVENODE_Properties)) {
children.Add(pPageSetNode);
}
@@ -283,7 +283,7 @@ int32_t CXFA_ResolveProcessor::ResolveNormal(CXFA_ResolveNodesData& rnd) {
child->GetElementType() != XFA_Element::PageSet) {
if (!bSetFlag) {
SetStylesForChild(dwStyles, rndFind);
- bSetFlag = TRUE;
+ bSetFlag = true;
}
rndFind.m_CurNode = child;
CFX_WideString wsSaveCondition = rndFind.m_wsCondition;
@@ -350,7 +350,7 @@ int32_t CXFA_ResolveProcessor::ResolveNormal(CXFA_ResolveNodesData& rnd) {
CXFA_Node* pInstanceManager =
curNode->AsNode()->GetInstanceMgrOfSubform();
if (pInstanceManager) {
- pProp = pInstanceManager->GetProperty(0, XFA_Element::Occur, TRUE);
+ pProp = pInstanceManager->GetProperty(0, XFA_Element::Occur, true);
}
} else {
XFA_Element eType = XFA_GetElementTypeForName(wsName.AsStringC());
@@ -417,15 +417,15 @@ int32_t CXFA_ResolveProcessor::ResolveNormal(CXFA_ResolveNodesData& rnd) {
const XFA_PROPERTY* pPropert = XFA_GetPropertyOfElement(
parentNode->GetElementType(), child->GetElementType(),
XFA_XDPPACKET_UNKNOWN);
- FX_BOOL bInnerSearch = FALSE;
+ bool bInnerSearch = false;
if (pPropert) {
if ((child->GetElementType() == XFA_Element::Variables ||
child->GetElementType() == XFA_Element::PageSet)) {
- bInnerSearch = TRUE;
+ bInnerSearch = true;
}
} else {
if (m_pNodeHelper->NodeIsTransparent(child)) {
- bInnerSearch = TRUE;
+ bInnerSearch = true;
}
}
if (bInnerSearch) {
@@ -524,7 +524,7 @@ int32_t CXFA_ResolveProcessor::GetFilter(const CFX_WideStringC& wsExpression,
int32_t nType = -1;
const FX_WCHAR* pSrc = wsExpression.c_str();
FX_WCHAR wPrev = 0, wCur;
- FX_BOOL bIsCondition = FALSE;
+ bool bIsCondition = false;
while (nStart < iLength) {
wCur = pSrc[nStart++];
if (wCur == '.') {
@@ -544,34 +544,34 @@ int32_t CXFA_ResolveProcessor::GetFilter(const CFX_WideStringC& wsExpression,
}
}
if (wCur == '[' || wCur == '(') {
- bIsCondition = TRUE;
+ bIsCondition = true;
} else if (wCur == '.' && nStart < iLength &&
(pSrc[nStart] == '[' || pSrc[nStart] == '(')) {
- bIsCondition = TRUE;
+ bIsCondition = true;
}
if (bIsCondition) {
pConditionBuf[nConditionCount++] = wCur;
} else {
pNameBuf[nNameCount++] = wCur;
}
- FX_BOOL bRecursive = TRUE;
+ bool bRecursive = true;
switch (nType) {
case 0:
if (wCur == ']') {
nType = ResolvePopStack(stack);
- bRecursive = FALSE;
+ bRecursive = false;
}
break;
case 1:
if (wCur == ')') {
nType = ResolvePopStack(stack);
- bRecursive = FALSE;
+ bRecursive = false;
}
break;
case 2:
if (wCur == '"') {
nType = ResolvePopStack(stack);
- bRecursive = FALSE;
+ bRecursive = false;
}
break;
}
@@ -612,8 +612,8 @@ void CXFA_ResolveProcessor::ConditionArray(int32_t iCurIndex,
CXFA_ResolveNodesData& rnd) {
CXFA_NodeArray& findNodes = (CXFA_NodeArray&)rnd.m_Nodes;
int32_t iLen = wsCondition.GetLength();
- FX_BOOL bRelative = FALSE;
- FX_BOOL bAll = FALSE;
+ bool bRelative = false;
+ bool bAll = false;
int32_t i = 1;
for (; i < iLen; ++i) {
FX_WCHAR ch = wsCondition[i];
@@ -621,10 +621,10 @@ void CXFA_ResolveProcessor::ConditionArray(int32_t iCurIndex,
continue;
}
if (ch == '+' || ch == '-') {
- bRelative = TRUE;
+ bRelative = true;
break;
} else if (ch == '*') {
- bAll = TRUE;
+ bAll = true;
break;
} else {
break;
@@ -694,7 +694,7 @@ void CXFA_ResolveProcessor::DoPredicateFilter(int32_t iCurIndex,
wsExpression = wsCondition.Mid(2, wsCondition.GetLength() - 3);
for (int32_t i = iFoundCount - 1; i >= 0; i--) {
CXFA_Object* node = findNodes[i];
- FX_BOOL bRet = FALSE;
+ bool bRet = false;
std::unique_ptr<CFXJSE_Value> pRetValue(
new CFXJSE_Value(rnd.m_pSC->GetRuntime()));
bRet = pContext->RunScript(eLangType, wsExpression.AsStringC(),
@@ -712,14 +712,14 @@ void CXFA_ResolveProcessor::FilterCondition(CXFA_ResolveNodesData& rnd,
int32_t iSize = array.GetSize();
if (iSize) {
CXFA_Node* curNode = array[iSize - 1];
- FX_BOOL bIsProperty = m_pNodeHelper->NodeIsProperty(curNode);
+ bool bIsProperty = m_pNodeHelper->NodeIsProperty(curNode);
if (curNode->IsUnnamed() ||
(bIsProperty && curNode->GetElementType() != XFA_Element::PageSet)) {
iCurrIndex = m_pNodeHelper->GetIndex(curNode, XFA_LOGIC_Transparent,
- bIsProperty, TRUE);
+ bIsProperty, true);
} else {
iCurrIndex = m_pNodeHelper->GetIndex(curNode, XFA_LOGIC_Transparent,
- bIsProperty, FALSE);
+ bIsProperty, false);
}
}
int32_t iFoundCount = findNodes.GetSize();
diff --git a/xfa/fxfa/parser/cxfa_script.cpp b/xfa/fxfa/parser/cxfa_script.cpp
index b99d8a3945..42911e0f12 100644
--- a/xfa/fxfa/parser/cxfa_script.cpp
+++ b/xfa/fxfa/parser/cxfa_script.cpp
@@ -12,7 +12,7 @@ CXFA_Script::CXFA_Script(CXFA_Node* pNode) : CXFA_Data(pNode) {}
XFA_SCRIPTTYPE CXFA_Script::GetContentType() {
CFX_WideStringC cData;
- if (m_pNode->TryCData(XFA_ATTRIBUTE_ContentType, cData, FALSE)) {
+ if (m_pNode->TryCData(XFA_ATTRIBUTE_ContentType, cData, false)) {
if (cData == FX_WSTRC(L"application/x-javascript"))
return XFA_SCRIPTTYPE_Javascript;
if (cData == FX_WSTRC(L"application/x-formcalc"))
diff --git a/xfa/fxfa/parser/cxfa_scriptcontext.cpp b/xfa/fxfa/parser/cxfa_scriptcontext.cpp
index af2f99a55c..80395149a3 100644
--- a/xfa/fxfa/parser/cxfa_scriptcontext.cpp
+++ b/xfa/fxfa/parser/cxfa_scriptcontext.cpp
@@ -142,10 +142,10 @@ void CXFA_ScriptContext::Initialize(v8::Isolate* pIsolate) {
DefineJsClass();
m_ResolveProcessor.reset(new CXFA_ResolveProcessor);
}
-FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType,
- const CFX_WideStringC& wsScript,
- CFXJSE_Value* hRetValue,
- CXFA_Object* pThisObject) {
+bool CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType,
+ const CFX_WideStringC& wsScript,
+ CFXJSE_Value* hRetValue,
+ CXFA_Object* pThisObject) {
CFX_ByteString btScript;
XFA_SCRIPTLANGTYPE eSaveType = m_eScriptType;
m_eScriptType = eScriptType;
@@ -160,7 +160,7 @@ FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType,
CXFA_FM2JSContext::Translate(wsScript, wsJavaScript, wsErrorInfo);
if (iFlags) {
hRetValue->SetUndefined();
- return FALSE;
+ return false;
}
btScript =
FX_UTF8Encode(wsJavaScript.GetBuffer(), wsJavaScript.GetLength());
@@ -170,8 +170,7 @@ FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType,
CXFA_Object* pOriginalObject = m_pThisObject;
m_pThisObject = pThisObject;
CFXJSE_Value* pValue = pThisObject ? GetJSValueFromMap(pThisObject) : nullptr;
- FX_BOOL bRet =
- m_JsContext->ExecuteScript(btScript.c_str(), hRetValue, pValue);
+ bool bRet = m_JsContext->ExecuteScript(btScript.c_str(), hRetValue, pValue);
m_pThisObject = pOriginalObject;
m_eScriptType = eSaveType;
return bRet;
@@ -191,7 +190,7 @@ void CXFA_ScriptContext::GlobalPropertySetter(CFXJSE_Value* pObject,
if (lpOrginalNode->IsVariablesThis())
pRefNode = ToNode(lpCurNode);
if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue,
- dwFlag, TRUE)) {
+ dwFlag, true)) {
return;
}
if (lpOrginalNode->IsVariablesThis()) {
@@ -207,11 +206,11 @@ void CXFA_ScriptContext::GlobalPropertySetter(CFXJSE_Value* pObject,
pNotify->GetDocEnvironment()->SetGlobalProperty(pNotify->GetHDOC(),
szPropName, pValue);
}
-FX_BOOL CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode,
- const CFX_WideStringC& propname,
- CFXJSE_Value* pValue,
- uint32_t dwFlag,
- FX_BOOL bSetting) {
+bool CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode,
+ const CFX_WideStringC& propname,
+ CFXJSE_Value* pValue,
+ uint32_t dwFlag,
+ bool bSetting) {
if (!refNode)
return false;
XFA_RESOLVENODE_RS resolveRs;
@@ -261,19 +260,19 @@ void CXFA_ScriptContext::GlobalPropertyGetter(CFXJSE_Value* pObject,
pRefNode = ToNode(lpCurNode);
}
if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue,
- dwFlag, FALSE)) {
+ dwFlag, false)) {
return;
}
dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
if (lpScriptContext->QueryNodeByFlag(pRefNode, wsPropName.AsStringC(), pValue,
- dwFlag, FALSE)) {
+ dwFlag, false)) {
return;
}
CXFA_Object* pScriptObject =
- lpScriptContext->GetVariablesThis(pOriginalObject, TRUE);
+ lpScriptContext->GetVariablesThis(pOriginalObject, true);
if (pScriptObject &&
lpScriptContext->QueryVariableValue(pScriptObject->AsNode(), szPropName,
- pValue, TRUE)) {
+ pValue, true)) {
return;
}
CXFA_FFNotify* pNotify = pDoc->GetNotify();
@@ -303,8 +302,8 @@ void CXFA_ScriptContext::NormalPropertyGetter(CFXJSE_Value* pOriginalValue,
}
uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties |
XFA_RESOLVENODE_Attributes;
- FX_BOOL bRet = lpScriptContext->QueryNodeByFlag(
- ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, FALSE);
+ bool bRet = lpScriptContext->QueryNodeByFlag(
+ ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, false);
if (bRet) {
return;
}
@@ -313,16 +312,16 @@ void CXFA_ScriptContext::NormalPropertyGetter(CFXJSE_Value* pOriginalValue,
!lpScriptContext->IsStrictScopeInJavaScript())) {
dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
bRet = lpScriptContext->QueryNodeByFlag(
- ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, FALSE);
+ ToNode(pObject), wsPropName.AsStringC(), pReturnValue, dwFlag, false);
}
if (bRet) {
return;
}
CXFA_Object* pScriptObject =
- lpScriptContext->GetVariablesThis(pOriginalObject, TRUE);
+ lpScriptContext->GetVariablesThis(pOriginalObject, true);
if (pScriptObject) {
bRet = lpScriptContext->QueryVariableValue(ToNode(pScriptObject),
- szPropName, pReturnValue, TRUE);
+ szPropName, pReturnValue, true);
}
if (!bRet) {
pReturnValue->SetUndefined();
@@ -343,7 +342,7 @@ void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue,
pObject->GetElementType(), wsPropName.AsStringC());
if (lpAttributeInfo) {
(pObject->*(lpAttributeInfo->lpfnCallback))(
- pReturnValue, TRUE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
+ pReturnValue, true, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
} else {
if (pObject->IsNode()) {
if (wsPropName.GetAt(0) == '#') {
@@ -364,23 +363,23 @@ void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue,
wsDefaultName.AsStringC());
if (lpAttrInfo) {
(pPropOrChild->*(lpAttrInfo->lpfnCallback))(
- pReturnValue, TRUE, (XFA_ATTRIBUTE)lpAttrInfo->eAttribute);
+ pReturnValue, true, (XFA_ATTRIBUTE)lpAttrInfo->eAttribute);
return;
}
}
}
CXFA_Object* pScriptObject =
- lpScriptContext->GetVariablesThis(pOriginalObject, TRUE);
+ lpScriptContext->GetVariablesThis(pOriginalObject, true);
if (pScriptObject) {
lpScriptContext->QueryVariableValue(ToNode(pScriptObject), szPropName,
- pReturnValue, FALSE);
+ pReturnValue, false);
}
}
}
int32_t CXFA_ScriptContext::NormalPropTypeGetter(
CFXJSE_Value* pOriginalValue,
const CFX_ByteStringC& szPropName,
- FX_BOOL bQueryIn) {
+ bool bQueryIn) {
CXFA_Object* pObject = ToObject(pOriginalValue, nullptr);
if (!pObject)
return FXJSE_ClassPropType_None;
@@ -402,7 +401,7 @@ int32_t CXFA_ScriptContext::NormalPropTypeGetter(
int32_t CXFA_ScriptContext::GlobalPropTypeGetter(
CFXJSE_Value* pOriginalValue,
const CFX_ByteStringC& szPropName,
- FX_BOOL bQueryIn) {
+ bool bQueryIn) {
CXFA_Object* pObject = ToObject(pOriginalValue, nullptr);
if (!pObject)
return FXJSE_ClassPropType_None;
@@ -435,7 +434,7 @@ void CXFA_ScriptContext::NormalMethodCall(CFXJSE_Value* pThis,
(pObject->*(lpMethodInfo->lpfnCallback))(&args);
}
-FX_BOOL CXFA_ScriptContext::IsStrictScopeInJavaScript() {
+bool CXFA_ScriptContext::IsStrictScopeInJavaScript() {
return m_pDocument->HasFlag(XFA_DOCFLAG_StrictScoping);
}
XFA_SCRIPTLANGTYPE CXFA_ScriptContext::GetType() {
@@ -462,7 +461,7 @@ CFXJSE_Context* CXFA_ScriptContext::CreateVariablesContext(
return pVariablesContext;
}
CXFA_Object* CXFA_ScriptContext::GetVariablesThis(CXFA_Object* pObject,
- FX_BOOL bScriptNode) {
+ bool bScriptNode) {
if (!pObject->IsVariablesThis())
return pObject;
@@ -470,27 +469,27 @@ CXFA_Object* CXFA_ScriptContext::GetVariablesThis(CXFA_Object* pObject,
return bScriptNode ? pProxy->GetScriptNode() : pProxy->GetThisNode();
}
-FX_BOOL CXFA_ScriptContext::RunVariablesScript(CXFA_Node* pScriptNode) {
+bool CXFA_ScriptContext::RunVariablesScript(CXFA_Node* pScriptNode) {
if (!pScriptNode)
- return FALSE;
+ return false;
if (pScriptNode->GetElementType() != XFA_Element::Script)
- return TRUE;
+ return true;
CXFA_Node* pParent = pScriptNode->GetNodeItem(XFA_NODEITEM_Parent);
if (!pParent || pParent->GetElementType() != XFA_Element::Variables)
- return FALSE;
+ return false;
if (m_mapVariableToContext.GetValueAt(pScriptNode))
- return TRUE;
+ return true;
CXFA_Node* pTextNode = pScriptNode->GetNodeItem(XFA_NODEITEM_FirstChild);
if (!pTextNode)
- return FALSE;
+ return false;
CFX_WideStringC wsScript;
if (!pTextNode->TryCData(XFA_ATTRIBUTE_Value, wsScript))
- return FALSE;
+ return false;
CFX_ByteString btScript =
FX_UTF8Encode(wsScript.c_str(), wsScript.GetLength());
@@ -500,37 +499,36 @@ FX_BOOL CXFA_ScriptContext::RunVariablesScript(CXFA_Node* pScriptNode) {
CreateVariablesContext(pScriptNode, pThisObject);
CXFA_Object* pOriginalObject = m_pThisObject;
m_pThisObject = pThisObject;
- FX_BOOL bRet =
+ bool bRet =
pVariablesContext->ExecuteScript(btScript.c_str(), hRetValue.get());
m_pThisObject = pOriginalObject;
return bRet;
}
-FX_BOOL CXFA_ScriptContext::QueryVariableValue(
- CXFA_Node* pScriptNode,
- const CFX_ByteStringC& szPropName,
- CFXJSE_Value* pValue,
- FX_BOOL bGetter) {
+bool CXFA_ScriptContext::QueryVariableValue(CXFA_Node* pScriptNode,
+ const CFX_ByteStringC& szPropName,
+ CFXJSE_Value* pValue,
+ bool bGetter) {
if (!pScriptNode || pScriptNode->GetElementType() != XFA_Element::Script)
- return FALSE;
+ return false;
CXFA_Node* variablesNode = pScriptNode->GetNodeItem(XFA_NODEITEM_Parent);
if (!variablesNode ||
variablesNode->GetElementType() != XFA_Element::Variables)
- return FALSE;
+ return false;
void* lpVariables = m_mapVariableToContext.GetValueAt(pScriptNode);
if (!lpVariables)
- return FALSE;
+ return false;
- FX_BOOL bRes = FALSE;
+ bool bRes = false;
CFXJSE_Context* pVariableContext = static_cast<CFXJSE_Context*>(lpVariables);
std::unique_ptr<CFXJSE_Value> pObject = pVariableContext->GetGlobalObject();
std::unique_ptr<CFXJSE_Value> hVariableValue(new CFXJSE_Value(m_pIsolate));
if (!bGetter) {
pObject->SetObjectOwnProperty(szPropName, pValue);
- bRes = TRUE;
- } else if (pObject->HasObjectOwnProperty(szPropName, FALSE)) {
+ bRes = true;
+ } else if (pObject->HasObjectOwnProperty(szPropName, false)) {
pObject->GetObjectProperty(szPropName, hVariableValue.get());
if (hVariableValue->IsFunction())
pValue->SetFunctionBind(hVariableValue.get(), pObject.get());
@@ -538,7 +536,7 @@ FX_BOOL CXFA_ScriptContext::QueryVariableValue(
pValue->Assign(hVariableValue.get());
else
hVariableValue.get()->Assign(pValue);
- bRes = TRUE;
+ bRes = true;
}
return bRes;
}
@@ -575,7 +573,7 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode,
(dwStyles & (XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings))) {
m_upObjectArray.Add(refNode->AsNode());
}
- FX_BOOL bNextCreate = FALSE;
+ bool bNextCreate = false;
if (dwStyles & XFA_RESOLVENODE_CreateNode) {
m_ResolveProcessor->GetNodeHelper()->SetCreateNodeType(bindNode);
}
@@ -589,7 +587,7 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode,
CXFA_ObjArray findNodes;
findNodes.Add(refNode ? refNode : m_pDocument->GetRoot());
int32_t nNodes = 0;
- while (TRUE) {
+ while (true) {
nNodes = findNodes.GetSize();
int32_t i = 0;
rndFind.m_dwStyles = dwStyles;
@@ -621,7 +619,7 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode,
}
}
if (bNextCreate) {
- FX_BOOL bCreate =
+ bool bCreate =
m_ResolveProcessor->GetNodeHelper()->ResolveNodes_CreateNode(
rndFind.m_wsName, rndFind.m_wsCondition,
nStart == wsExpression.GetLength(), this);
@@ -633,14 +631,14 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode,
}
CXFA_ObjArray retNodes;
while (i < nNodes) {
- FX_BOOL bDataBind = FALSE;
+ bool bDataBind = false;
if (((dwStyles & XFA_RESOLVENODE_Bind) ||
(dwStyles & XFA_RESOLVENODE_CreateNode)) &&
nNodes > 1) {
CXFA_ResolveNodesData rndBind;
m_ResolveProcessor->GetFilter(wsExpression, nStart, rndBind);
m_ResolveProcessor->SetIndexDataBind(rndBind.m_wsCondition, i, nNodes);
- bDataBind = TRUE;
+ bDataBind = true;
}
rndFind.m_CurNode = findNodes[i++];
rndFind.m_nLevel = nLevel;
@@ -653,7 +651,7 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode,
rndFind.m_pScriptAttribute && nStart < wsExpression.GetLength()) {
std::unique_ptr<CFXJSE_Value> pValue(new CFXJSE_Value(m_pIsolate));
(rndFind.m_Nodes[0]->*(rndFind.m_pScriptAttribute->lpfnCallback))(
- pValue.get(), FALSE,
+ pValue.get(), false,
(XFA_ATTRIBUTE)rndFind.m_pScriptAttribute->eAttribute);
rndFind.m_Nodes.SetAt(0, ToObject(pValue.get(), nullptr));
}
@@ -671,13 +669,13 @@ int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode,
nNodes = retNodes.GetSize();
if (nNodes < 1) {
if (dwStyles & XFA_RESOLVENODE_CreateNode) {
- bNextCreate = TRUE;
+ bNextCreate = true;
if (!m_ResolveProcessor->GetNodeHelper()->m_pCreateParent) {
m_ResolveProcessor->GetNodeHelper()->m_pCreateParent =
ToNode(rndFind.m_CurNode);
m_ResolveProcessor->GetNodeHelper()->m_iCreateCount = 1;
}
- FX_BOOL bCreate =
+ bool bCreate =
m_ResolveProcessor->GetNodeHelper()->ResolveNodes_CreateNode(
rndFind.m_wsName, rndFind.m_wsCondition,
nStart == wsExpression.GetLength(), this);
@@ -742,17 +740,17 @@ CFXJSE_Value* CXFA_ScriptContext::GetJSValueFromMap(CXFA_Object* pObject) {
int32_t CXFA_ScriptContext::GetIndexByName(CXFA_Node* refNode) {
CXFA_NodeHelper* lpNodeHelper = m_ResolveProcessor->GetNodeHelper();
return lpNodeHelper->GetIndex(refNode, XFA_LOGIC_Transparent,
- lpNodeHelper->NodeIsProperty(refNode), FALSE);
+ lpNodeHelper->NodeIsProperty(refNode), false);
}
int32_t CXFA_ScriptContext::GetIndexByClassName(CXFA_Node* refNode) {
CXFA_NodeHelper* lpNodeHelper = m_ResolveProcessor->GetNodeHelper();
return lpNodeHelper->GetIndex(refNode, XFA_LOGIC_Transparent,
- lpNodeHelper->NodeIsProperty(refNode), TRUE);
+ lpNodeHelper->NodeIsProperty(refNode), true);
}
void CXFA_ScriptContext::GetSomExpression(CXFA_Node* refNode,
CFX_WideString& wsExpression) {
CXFA_NodeHelper* lpNodeHelper = m_ResolveProcessor->GetNodeHelper();
- lpNodeHelper->GetNameExpression(refNode, wsExpression, TRUE,
+ lpNodeHelper->GetNameExpression(refNode, wsExpression, true,
XFA_LOGIC_Transparent);
}
void CXFA_ScriptContext::SetNodesOfRunScript(CXFA_NodeArray* pArray) {
diff --git a/xfa/fxfa/parser/cxfa_scriptcontext.h b/xfa/fxfa/parser/cxfa_scriptcontext.h
index 656c51a8c8..664e3315bf 100644
--- a/xfa/fxfa/parser/cxfa_scriptcontext.h
+++ b/xfa/fxfa/parser/cxfa_scriptcontext.h
@@ -29,10 +29,10 @@ class CXFA_ScriptContext {
void Initialize(v8::Isolate* pIsolate);
void SetEventParam(CXFA_EventParam param) { m_eventParam = param; }
CXFA_EventParam* GetEventParam() { return &m_eventParam; }
- FX_BOOL RunScript(XFA_SCRIPTLANGTYPE eScriptType,
- const CFX_WideStringC& wsScript,
- CFXJSE_Value* pRetValue,
- CXFA_Object* pThisObject = nullptr);
+ bool RunScript(XFA_SCRIPTLANGTYPE eScriptType,
+ const CFX_WideStringC& wsScript,
+ CFXJSE_Value* pRetValue,
+ CXFA_Object* pThisObject = nullptr);
int32_t ResolveObjects(CXFA_Object* refNode,
const CFX_WideStringC& wsExpression,
@@ -54,18 +54,18 @@ class CXFA_ScriptContext {
CFXJSE_Class* GetJseNormalClass();
void SetRunAtType(XFA_ATTRIBUTEENUM eRunAt) { m_eRunAtType = eRunAt; }
- FX_BOOL IsRunAtClient() { return m_eRunAtType != XFA_ATTRIBUTEENUM_Server; }
- FX_BOOL QueryNodeByFlag(CXFA_Node* refNode,
- const CFX_WideStringC& propname,
+ bool IsRunAtClient() { return m_eRunAtType != XFA_ATTRIBUTEENUM_Server; }
+ bool QueryNodeByFlag(CXFA_Node* refNode,
+ const CFX_WideStringC& propname,
+ CFXJSE_Value* pValue,
+ uint32_t dwFlag,
+ bool bSetting);
+ bool QueryVariableValue(CXFA_Node* pScriptNode,
+ const CFX_ByteStringC& szPropName,
CFXJSE_Value* pValue,
- uint32_t dwFlag,
- FX_BOOL bSetting);
- FX_BOOL QueryVariableValue(CXFA_Node* pScriptNode,
- const CFX_ByteStringC& szPropName,
- CFXJSE_Value* pValue,
- FX_BOOL bGetter);
- FX_BOOL QueryBuiltinValue(const CFX_ByteStringC& szPropName,
- CFXJSE_Value* pValue);
+ bool bGetter);
+ bool QueryBuiltinValue(const CFX_ByteStringC& szPropName,
+ CFXJSE_Value* pValue);
static void GlobalPropertyGetter(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
CFXJSE_Value* pValue);
@@ -83,14 +83,13 @@ class CXFA_ScriptContext {
CFXJSE_Arguments& args);
static int32_t NormalPropTypeGetter(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
- FX_BOOL bQueryIn);
+ bool bQueryIn);
static int32_t GlobalPropTypeGetter(CFXJSE_Value* pObject,
const CFX_ByteStringC& szPropName,
- FX_BOOL bQueryIn);
- FX_BOOL RunVariablesScript(CXFA_Node* pScriptNode);
- CXFA_Object* GetVariablesThis(CXFA_Object* pObject,
- FX_BOOL bScriptNode = FALSE);
- FX_BOOL IsStrictScopeInJavaScript();
+ bool bQueryIn);
+ bool RunVariablesScript(CXFA_Node* pScriptNode);
+ CXFA_Object* GetVariablesThis(CXFA_Object* pObject, bool bScriptNode = false);
+ bool IsStrictScopeInJavaScript();
XFA_SCRIPTLANGTYPE GetType();
CXFA_NodeArray& GetUpObjectArray() { return m_upObjectArray; }
CXFA_Document* GetDocument() const { return m_pDocument; }
diff --git a/xfa/fxfa/parser/cxfa_simple_parser.cpp b/xfa/fxfa/parser/cxfa_simple_parser.cpp
index 997094351e..4599b1c4fc 100644
--- a/xfa/fxfa/parser/cxfa_simple_parser.cpp
+++ b/xfa/fxfa/parser/cxfa_simple_parser.cpp
@@ -19,7 +19,7 @@
namespace {
CFDE_XMLNode* GetDocumentNode(CFDE_XMLDoc* pXMLDoc,
- FX_BOOL bVerifyWellFormness = FALSE) {
+ bool bVerifyWellFormness = false) {
if (!pXMLDoc)
return nullptr;
@@ -54,22 +54,22 @@ void GetElementTagNamespaceURI(CFDE_XMLElement* pElement,
}
}
-FX_BOOL MatchNodeName(CFDE_XMLNode* pNode,
- const CFX_WideStringC& wsLocalTagName,
- const CFX_WideStringC& wsNamespaceURIPrefix,
- uint32_t eMatchFlags = XFA_XDPPACKET_FLAGS_NOMATCH) {
+bool MatchNodeName(CFDE_XMLNode* pNode,
+ const CFX_WideStringC& wsLocalTagName,
+ const CFX_WideStringC& wsNamespaceURIPrefix,
+ uint32_t eMatchFlags = XFA_XDPPACKET_FLAGS_NOMATCH) {
if (!pNode || pNode->GetType() != FDE_XMLNODE_Element)
- return FALSE;
+ return false;
CFDE_XMLElement* pElement = reinterpret_cast<CFDE_XMLElement*>(pNode);
CFX_WideString wsNodeStr;
pElement->GetLocalTagName(wsNodeStr);
if (wsNodeStr != wsLocalTagName)
- return FALSE;
+ return false;
GetElementTagNamespaceURI(pElement, wsNodeStr);
if (eMatchFlags & XFA_XDPPACKET_FLAGS_NOMATCH)
- return TRUE;
+ return true;
if (eMatchFlags & XFA_XDPPACKET_FLAGS_PREFIXMATCH) {
return wsNodeStr.Left(wsNamespaceURIPrefix.GetLength()) ==
wsNamespaceURIPrefix;
@@ -77,22 +77,22 @@ FX_BOOL MatchNodeName(CFDE_XMLNode* pNode,
return wsNodeStr == wsNamespaceURIPrefix;
}
-FX_BOOL GetAttributeLocalName(const CFX_WideStringC& wsAttributeName,
- CFX_WideString& wsLocalAttrName) {
+bool GetAttributeLocalName(const CFX_WideStringC& wsAttributeName,
+ CFX_WideString& wsLocalAttrName) {
CFX_WideString wsAttrName(wsAttributeName);
FX_STRSIZE iFind = wsAttrName.Find(L':', 0);
if (iFind < 0) {
wsLocalAttrName = wsAttrName;
- return FALSE;
+ return false;
}
wsLocalAttrName = wsAttrName.Right(wsAttrName.GetLength() - iFind - 1);
- return TRUE;
+ return true;
}
-FX_BOOL ResolveAttribute(CFDE_XMLElement* pElement,
- const CFX_WideStringC& wsAttributeName,
- CFX_WideString& wsLocalAttrName,
- CFX_WideString& wsNamespaceURI) {
+bool ResolveAttribute(CFDE_XMLElement* pElement,
+ const CFX_WideStringC& wsAttributeName,
+ CFX_WideString& wsLocalAttrName,
+ CFX_WideString& wsNamespaceURI) {
CFX_WideString wsAttrName(wsAttributeName);
CFX_WideString wsNSPrefix;
if (GetAttributeLocalName(wsAttributeName, wsLocalAttrName)) {
@@ -101,23 +101,23 @@ FX_BOOL ResolveAttribute(CFDE_XMLElement* pElement,
}
if (wsLocalAttrName == FX_WSTRC(L"xmlns") ||
wsNSPrefix == FX_WSTRC(L"xmlns") || wsNSPrefix == FX_WSTRC(L"xml")) {
- return FALSE;
+ return false;
}
if (!XFA_FDEExtension_ResolveNamespaceQualifier(
pElement, wsNSPrefix.AsStringC(), wsNamespaceURI)) {
wsNamespaceURI.clear();
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL FindAttributeWithNS(CFDE_XMLElement* pElement,
- const CFX_WideStringC& wsLocalAttributeName,
- const CFX_WideStringC& wsNamespaceURIPrefix,
- CFX_WideString& wsValue,
- FX_BOOL bMatchNSAsPrefix = FALSE) {
+bool FindAttributeWithNS(CFDE_XMLElement* pElement,
+ const CFX_WideStringC& wsLocalAttributeName,
+ const CFX_WideStringC& wsNamespaceURIPrefix,
+ CFX_WideString& wsValue,
+ bool bMatchNSAsPrefix = false) {
if (!pElement)
- return FALSE;
+ return false;
CFX_WideString wsAttrName;
CFX_WideString wsAttrValue;
@@ -151,9 +151,9 @@ FX_BOOL FindAttributeWithNS(CFDE_XMLElement* pElement,
continue;
}
wsValue = wsAttrValue;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
CFDE_XMLNode* GetDataSetsFromXDP(CFDE_XMLNode* pXMLDocumentNode) {
@@ -184,7 +184,7 @@ CFDE_XMLNode* GetDataSetsFromXDP(CFDE_XMLNode* pXMLDocumentNode) {
return nullptr;
}
-FX_BOOL IsStringAllWhitespace(CFX_WideString wsText) {
+bool IsStringAllWhitespace(CFX_WideString wsText) {
wsText.TrimRight(L"\x20\x9\xD\xA");
return wsText.IsEmpty();
}
@@ -222,7 +222,7 @@ void ConvertXMLToPlainText(CFDE_XMLElement* pRootXMLNode,
break;
}
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
}
@@ -250,14 +250,14 @@ const XFA_PACKETINFO* GetPacketByName(const CFX_WideStringC& wsName) {
} // namespace
-FX_BOOL XFA_RecognizeRichText(CFDE_XMLElement* pRichTextXMLNode) {
+bool XFA_RecognizeRichText(CFDE_XMLElement* pRichTextXMLNode) {
if (pRichTextXMLNode) {
CFX_WideString wsNamespaceURI;
GetElementTagNamespaceURI(pRichTextXMLNode, wsNamespaceURI);
if (wsNamespaceURI == FX_WSTRC(L"http://www.w3.org/1999/xhtml"))
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
CXFA_SimpleParser::CXFA_SimpleParser(CXFA_Document* pFactory,
@@ -381,13 +381,13 @@ void CXFA_SimpleParser::ConstructXFANode(CXFA_Node* pXFANode,
}
m_pRootNode = pXFANode;
} else {
- m_pRootNode = DataLoader(pXFANode, pXMLNode, TRUE);
+ m_pRootNode = DataLoader(pXFANode, pXMLNode, true);
}
} else if (pXFANode->IsContentNode()) {
ParseContentNode(pXFANode, pXMLNode, ePacketID);
m_pRootNode = pXFANode;
} else {
- m_pRootNode = NormalLoader(pXFANode, pXMLNode, ePacketID, TRUE);
+ m_pRootNode = NormalLoader(pXFANode, pXMLNode, ePacketID, true);
}
}
@@ -399,19 +399,19 @@ CFDE_XMLDoc* CXFA_SimpleParser::GetXMLDoc() const {
return m_pXMLDoc.get();
}
-FX_BOOL XFA_FDEExtension_ResolveNamespaceQualifier(
+bool XFA_FDEExtension_ResolveNamespaceQualifier(
CFDE_XMLElement* pNode,
const CFX_WideStringC& wsQualifier,
CFX_WideString& wsNamespaceURI) {
if (!pNode)
- return FALSE;
+ return false;
CFDE_XMLNode* pFakeRoot = pNode->GetNodeItem(CFDE_XMLNode::Root);
CFX_WideString wsNSAttribute;
- FX_BOOL bRet = FALSE;
+ bool bRet = false;
if (wsQualifier.IsEmpty()) {
wsNSAttribute = FX_WSTRC(L"xmlns");
- bRet = TRUE;
+ bRet = true;
} else {
wsNSAttribute = FX_WSTRC(L"xmlns:") + wsQualifier;
}
@@ -422,7 +422,7 @@ FX_BOOL XFA_FDEExtension_ResolveNamespaceQualifier(
if (pNode->HasAttribute(wsNSAttribute.c_str())) {
pNode->GetString(wsNSAttribute.c_str(), wsNamespaceURI);
- return TRUE;
+ return true;
}
}
wsNamespaceURI.clear();
@@ -606,7 +606,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Config(
pNode->SetCData(XFA_ATTRIBUTE_Name,
XFA_GetPacketByIndex(XFA_PACKET_Config)->pName);
- if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, TRUE))
+ if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, true))
return nullptr;
pNode->SetXMLMappingNode(pXMLDocumentNode);
@@ -639,7 +639,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm(
pNode->GetDocument()->RecognizeXFAVersionNumber(wsNamespaceURI);
}
- if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, TRUE))
+ if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, true))
return nullptr;
}
} else if (ePacketID == XFA_XDPPACKET_Form) {
@@ -679,11 +679,11 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm(
pTemplateRoot
? pTemplateRoot->GetFirstChildByClass(XFA_Element::Subform)
: nullptr;
- FX_BOOL bUseAttribute = TRUE;
+ bool bUseAttribute = true;
if (pTemplateChosen &&
pTemplateChosen->GetEnum(XFA_ATTRIBUTE_RestoreState) !=
XFA_ATTRIBUTEENUM_Auto) {
- bUseAttribute = FALSE;
+ bUseAttribute = false;
}
if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, bUseAttribute))
return nullptr;
@@ -707,7 +707,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data(
pNode->SetCData(XFA_ATTRIBUTE_Name,
XFA_GetPacketByIndex(XFA_PACKET_Datasets)->pName);
- if (!DataLoader(pNode, pDatasetsXMLNode, FALSE))
+ if (!DataLoader(pNode, pDatasetsXMLNode, false))
return nullptr;
pNode->SetXMLMappingNode(pDatasetsXMLNode);
@@ -748,7 +748,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data(
CFX_WideString wsLocalName;
static_cast<CFDE_XMLElement*>(pDataXMLNode)->GetLocalTagName(wsLocalName);
pNode->SetCData(XFA_ATTRIBUTE_Name, wsLocalName);
- if (!DataLoader(pNode, pDataXMLNode, TRUE))
+ if (!DataLoader(pNode, pDataXMLNode, true))
return nullptr;
pNode->SetXMLMappingNode(pDataXMLNode);
@@ -775,7 +775,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_LocaleConnectionSourceSet(
pNode->SetCData(XFA_ATTRIBUTE_Name,
XFA_GetPacketByIndex(XFA_PACKET_LocaleSet)->pName);
- if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, TRUE))
+ if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, true))
return nullptr;
}
} else if (ePacketID == XFA_XDPPACKET_ConnectionSet) {
@@ -790,7 +790,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_LocaleConnectionSourceSet(
pNode->SetCData(XFA_ATTRIBUTE_Name,
XFA_GetPacketByIndex(XFA_PACKET_ConnectionSet)->pName);
- if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, TRUE))
+ if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, true))
return nullptr;
}
} else if (ePacketID == XFA_XDPPACKET_SourceSet) {
@@ -805,7 +805,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_LocaleConnectionSourceSet(
pNode->SetCData(XFA_ATTRIBUTE_Name,
XFA_GetPacketByIndex(XFA_PACKET_SourceSet)->pName);
- if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, TRUE))
+ if (!NormalLoader(pNode, pXMLDocumentNode, ePacketID, true))
return nullptr;
}
}
@@ -859,7 +859,7 @@ CXFA_Node* CXFA_SimpleParser::UserPacketLoader(CXFA_Node* pXFANode,
CXFA_Node* CXFA_SimpleParser::DataLoader(CXFA_Node* pXFANode,
CFDE_XMLNode* pXMLDoc,
- FX_BOOL bDoTransform) {
+ bool bDoTransform) {
ParseDataGroup(pXFANode, pXMLDoc, XFA_XDPPACKET_Datasets);
return pXFANode;
}
@@ -867,8 +867,8 @@ CXFA_Node* CXFA_SimpleParser::DataLoader(CXFA_Node* pXFANode,
CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode,
CFDE_XMLNode* pXMLDoc,
XFA_XDPPACKET ePacketID,
- FX_BOOL bUseAttribute) {
- FX_BOOL bOneOfPropertyFound = FALSE;
+ bool bUseAttribute) {
+ bool bOneOfPropertyFound = false;
for (CFDE_XMLNode* pXMLChild = pXMLDoc->GetNodeItem(CFDE_XMLNode::FirstChild);
pXMLChild;
pXMLChild = pXMLChild->GetNodeItem(CFDE_XMLNode::NextSibling)) {
@@ -889,7 +889,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode,
if (bOneOfPropertyFound)
break;
- bOneOfPropertyFound = TRUE;
+ bOneOfPropertyFound = true;
}
CXFA_Node* pXFAChild = m_pFactory->CreateNode(ePacketID, eType);
if (!pXFAChild)
@@ -897,7 +897,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode,
if (ePacketID == XFA_XDPPACKET_Config)
pXFAChild->SetAttribute(XFA_ATTRIBUTE_Name, wsTagName.AsStringC());
- FX_BOOL IsNeedValue = TRUE;
+ bool IsNeedValue = true;
for (int32_t i = 0, count = pXMLElement->CountAttributes(); i < count;
i++) {
CFX_WideString wsAttrQualifiedName;
@@ -907,7 +907,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode,
GetAttributeLocalName(wsAttrQualifiedName.AsStringC(), wsAttrName);
if (wsAttrName == FX_WSTRC(L"nil") &&
wsAttrValue == FX_WSTRC(L"true")) {
- IsNeedValue = FALSE;
+ IsNeedValue = false;
}
const XFA_ATTRIBUTEINFO* lpAttrInfo =
XFA_GetAttributeByName(wsAttrName.AsStringC());
@@ -1181,7 +1181,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode,
XFA_XDPPACKET ePacketID) {
CFX_WideTextBuf wsValueTextBuf;
CFX_WideTextBuf wsCurValueTextBuf;
- FX_BOOL bMarkAsCompound = FALSE;
+ bool bMarkAsCompound = false;
CFDE_XMLNode* pXMLCurValueNode = nullptr;
for (CFDE_XMLNode* pXMLChild =
pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild);
@@ -1213,7 +1213,7 @@ void CXFA_SimpleParser::ParseDataValue(CXFA_Node* pXFANode,
wsCurValueTextBuf << wsText;
} else {
- bMarkAsCompound = TRUE;
+ bMarkAsCompound = true;
if (pXMLCurValueNode) {
CFX_WideString wsCurValue = wsCurValueTextBuf.MakeString();
if (!wsCurValue.IsEmpty()) {
@@ -1288,7 +1288,7 @@ void CXFA_SimpleParser::ParseInstruction(CXFA_Node* pXFANode,
wsData.clear();
if (pXMLInstruction->GetData(1, wsData) &&
wsData == FX_WSTRC(L"v2.7-scripting:1")) {
- pXFANode->GetDocument()->SetFlag(XFA_DOCFLAG_Scripting, TRUE);
+ pXFANode->GetDocument()->SetFlag(XFA_DOCFLAG_Scripting, true);
}
}
} else if (wsTargetName == FX_WSTRC(L"acrobat")) {
@@ -1297,7 +1297,7 @@ void CXFA_SimpleParser::ParseInstruction(CXFA_Node* pXFANode,
wsData == FX_WSTRC(L"JavaScript")) {
if (pXMLInstruction->GetData(1, wsData) &&
wsData == FX_WSTRC(L"strictScoping")) {
- pXFANode->GetDocument()->SetFlag(XFA_DOCFLAG_StrictScoping, TRUE);
+ pXFANode->GetDocument()->SetFlag(XFA_DOCFLAG_StrictScoping, true);
}
}
}
diff --git a/xfa/fxfa/parser/cxfa_simple_parser.h b/xfa/fxfa/parser/cxfa_simple_parser.h
index 2b1e192e92..db6765f400 100644
--- a/xfa/fxfa/parser/cxfa_simple_parser.h
+++ b/xfa/fxfa/parser/cxfa_simple_parser.h
@@ -57,10 +57,10 @@ class CXFA_SimpleParser {
CXFA_Node* NormalLoader(CXFA_Node* pXFANode,
CFDE_XMLNode* pXMLDoc,
XFA_XDPPACKET ePacketID,
- FX_BOOL bUseAttribute);
+ bool bUseAttribute);
CXFA_Node* DataLoader(CXFA_Node* pXFANode,
CFDE_XMLNode* pXMLDoc,
- FX_BOOL bDoTransform);
+ bool bDoTransform);
CXFA_Node* UserPacketLoader(CXFA_Node* pXFANode, CFDE_XMLNode* pXMLDoc);
void ParseContentNode(CXFA_Node* pXFANode,
CFDE_XMLNode* pXMLNode,
@@ -82,7 +82,7 @@ class CXFA_SimpleParser {
CXFA_Document* m_pFactory;
CXFA_Node* m_pRootNode;
XFA_XDPPACKET m_ePacketID;
- FX_BOOL m_bDocumentParser;
+ bool m_bDocumentParser;
};
#endif // XFA_FXFA_PARSER_CXFA_SIMPLE_PARSER_H_
diff --git a/xfa/fxfa/parser/cxfa_stroke.cpp b/xfa/fxfa/parser/cxfa_stroke.cpp
index 77549f00ed..602f2f9f1f 100644
--- a/xfa/fxfa/parser/cxfa_stroke.cpp
+++ b/xfa/fxfa/parser/cxfa_stroke.cpp
@@ -76,8 +76,8 @@ int32_t CXFA_Stroke::GetJoinType() const {
: XFA_ATTRIBUTEENUM_Square;
}
-FX_BOOL CXFA_Stroke::IsInverted() const {
- return m_pNode ? m_pNode->GetBoolean(XFA_ATTRIBUTE_Inverted) : FALSE;
+bool CXFA_Stroke::IsInverted() const {
+ return m_pNode ? m_pNode->GetBoolean(XFA_ATTRIBUTE_Inverted) : false;
}
FX_FLOAT CXFA_Stroke::GetRadius() const {
@@ -85,22 +85,22 @@ FX_FLOAT CXFA_Stroke::GetRadius() const {
: 0;
}
-FX_BOOL CXFA_Stroke::SameStyles(CXFA_Stroke stroke, uint32_t dwFlags) const {
+bool CXFA_Stroke::SameStyles(CXFA_Stroke stroke, uint32_t dwFlags) const {
if (m_pNode == stroke.GetNode())
- return TRUE;
+ return true;
if (FXSYS_fabs(GetThickness() - stroke.GetThickness()) >= 0.01f)
- return FALSE;
+ return false;
if ((dwFlags & XFA_STROKE_SAMESTYLE_NoPresence) == 0 &&
IsVisible() != stroke.IsVisible()) {
- return FALSE;
+ return false;
}
if (GetStrokeType() != stroke.GetStrokeType())
- return FALSE;
+ return false;
if (GetColor() != stroke.GetColor())
- return FALSE;
+ return false;
if ((dwFlags & XFA_STROKE_SAMESTYLE_Corner) != 0 &&
FXSYS_fabs(GetRadius() - stroke.GetRadius()) >= 0.01f) {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
diff --git a/xfa/fxfa/parser/cxfa_stroke.h b/xfa/fxfa/parser/cxfa_stroke.h
index d42ece32c8..a3287d2855 100644
--- a/xfa/fxfa/parser/cxfa_stroke.h
+++ b/xfa/fxfa/parser/cxfa_stroke.h
@@ -35,9 +35,9 @@ class CXFA_Stroke : public CXFA_Data {
FX_ARGB GetColor() const;
void SetColor(FX_ARGB argb);
int32_t GetJoinType() const;
- FX_BOOL IsInverted() const;
+ bool IsInverted() const;
FX_FLOAT GetRadius() const;
- FX_BOOL SameStyles(CXFA_Stroke stroke, uint32_t dwFlags = 0) const;
+ bool SameStyles(CXFA_Stroke stroke, uint32_t dwFlags = 0) const;
};
typedef CFX_ArrayTemplate<CXFA_Stroke> CXFA_StrokeArray;
diff --git a/xfa/fxfa/parser/cxfa_submit.cpp b/xfa/fxfa/parser/cxfa_submit.cpp
index 2aa011b0e3..50bef1e811 100644
--- a/xfa/fxfa/parser/cxfa_submit.cpp
+++ b/xfa/fxfa/parser/cxfa_submit.cpp
@@ -10,7 +10,7 @@
CXFA_Submit::CXFA_Submit(CXFA_Node* pNode) : CXFA_Data(pNode) {}
-FX_BOOL CXFA_Submit::IsSubmitEmbedPDF() {
+bool CXFA_Submit::IsSubmitEmbedPDF() {
return m_pNode->GetBoolean(XFA_ATTRIBUTE_EmbedPDF);
}
diff --git a/xfa/fxfa/parser/cxfa_submit.h b/xfa/fxfa/parser/cxfa_submit.h
index 29cd1cff80..f10435e1f5 100644
--- a/xfa/fxfa/parser/cxfa_submit.h
+++ b/xfa/fxfa/parser/cxfa_submit.h
@@ -17,7 +17,7 @@ class CXFA_Submit : public CXFA_Data {
public:
explicit CXFA_Submit(CXFA_Node* pNode);
- FX_BOOL IsSubmitEmbedPDF();
+ bool IsSubmitEmbedPDF();
int32_t GetSubmitFormat();
void GetSubmitTarget(CFX_WideStringC& wsTarget);
void GetSubmitXDPContent(CFX_WideStringC& wsContent);
diff --git a/xfa/fxfa/parser/cxfa_tooltip.cpp b/xfa/fxfa/parser/cxfa_tooltip.cpp
index 079b365e46..afe0e224af 100644
--- a/xfa/fxfa/parser/cxfa_tooltip.cpp
+++ b/xfa/fxfa/parser/cxfa_tooltip.cpp
@@ -10,6 +10,6 @@
CXFA_ToolTip::CXFA_ToolTip(CXFA_Node* pNode) : CXFA_Data(pNode) {}
-FX_BOOL CXFA_ToolTip::GetTip(CFX_WideString& wsTip) {
+bool CXFA_ToolTip::GetTip(CFX_WideString& wsTip) {
return m_pNode->TryContent(wsTip);
}
diff --git a/xfa/fxfa/parser/cxfa_tooltip.h b/xfa/fxfa/parser/cxfa_tooltip.h
index 93ba2ba72c..433885d89c 100644
--- a/xfa/fxfa/parser/cxfa_tooltip.h
+++ b/xfa/fxfa/parser/cxfa_tooltip.h
@@ -16,7 +16,7 @@ class CXFA_ToolTip : public CXFA_Data {
public:
explicit CXFA_ToolTip(CXFA_Node* pNode);
- FX_BOOL GetTip(CFX_WideString& wsTip);
+ bool GetTip(CFX_WideString& wsTip);
};
#endif // XFA_FXFA_PARSER_CXFA_TOOLTIP_H_
diff --git a/xfa/fxfa/parser/cxfa_validate.cpp b/xfa/fxfa/parser/cxfa_validate.cpp
index 2309a07799..5706d96aaa 100644
--- a/xfa/fxfa/parser/cxfa_validate.cpp
+++ b/xfa/fxfa/parser/cxfa_validate.cpp
@@ -14,19 +14,19 @@ int32_t CXFA_Validate::GetFormatTest() {
return m_pNode->GetEnum(XFA_ATTRIBUTE_FormatTest);
}
-FX_BOOL CXFA_Validate::SetTestValue(int32_t iType,
- CFX_WideString& wsValue,
- XFA_ATTRIBUTEENUM eName) {
+bool CXFA_Validate::SetTestValue(int32_t iType,
+ CFX_WideString& wsValue,
+ XFA_ATTRIBUTEENUM eName) {
const XFA_ATTRIBUTEENUMINFO* pInfo =
XFA_GetAttributeEnumByName(wsValue.AsStringC());
if (pInfo)
eName = pInfo->eName;
- m_pNode->SetEnum((XFA_ATTRIBUTE)iType, eName, FALSE);
- return TRUE;
+ m_pNode->SetEnum((XFA_ATTRIBUTE)iType, eName, false);
+ return true;
}
-FX_BOOL CXFA_Validate::SetNullTest(CFX_WideString wsValue) {
+bool CXFA_Validate::SetNullTest(CFX_WideString wsValue) {
return SetTestValue(XFA_ATTRIBUTE_NullTest, wsValue,
XFA_ATTRIBUTEENUM_Disabled);
}
@@ -41,7 +41,7 @@ int32_t CXFA_Validate::GetScriptTest() {
void CXFA_Validate::GetMessageText(CFX_WideString& wsMessage,
const CFX_WideString& wsMessageType) {
- CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Message, FALSE);
+ CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Message, false);
if (!pNode)
return;
@@ -78,7 +78,7 @@ void CXFA_Validate::GetNullMessageText(CFX_WideString& wsMessage) {
void CXFA_Validate::SetMessageText(CFX_WideString& wsMessage,
const CFX_WideString& wsMessageType) {
- CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Message, TRUE);
+ CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Message, true);
if (!pNode)
return;
@@ -91,14 +91,14 @@ void CXFA_Validate::SetMessageText(CFX_WideString& wsMessage,
CFX_WideStringC wsName;
pItemNode->TryCData(XFA_ATTRIBUTE_Name, wsName);
if (wsName.IsEmpty() || wsName == wsMessageType) {
- pItemNode->SetContent(wsMessage, wsMessage, FALSE);
+ pItemNode->SetContent(wsMessage, wsMessage, false);
return;
}
}
CXFA_Node* pTextNode = pNode->CreateSamePacketNode(XFA_Element::Text);
pNode->InsertChild(pTextNode);
- pTextNode->SetCData(XFA_ATTRIBUTE_Name, wsMessageType, FALSE);
- pTextNode->SetContent(wsMessage, wsMessage, FALSE);
+ pTextNode->SetCData(XFA_ATTRIBUTE_Name, wsMessageType, false);
+ pTextNode->SetContent(wsMessage, wsMessage, false);
}
void CXFA_Validate::GetScriptMessageText(CFX_WideString& wsMessage) {
diff --git a/xfa/fxfa/parser/cxfa_validate.h b/xfa/fxfa/parser/cxfa_validate.h
index da9654a5a0..03bbaddf7b 100644
--- a/xfa/fxfa/parser/cxfa_validate.h
+++ b/xfa/fxfa/parser/cxfa_validate.h
@@ -20,7 +20,7 @@ class CXFA_Validate : public CXFA_Data {
int32_t GetFormatTest();
int32_t GetNullTest();
- FX_BOOL SetNullTest(CFX_WideString wsValue);
+ bool SetNullTest(CFX_WideString wsValue);
int32_t GetScriptTest();
void GetFormatMessageText(CFX_WideString& wsMessage);
void SetFormatMessageText(CFX_WideString wsMessage);
@@ -36,9 +36,9 @@ class CXFA_Validate : public CXFA_Data {
const CFX_WideString& wsMessageType);
void SetMessageText(CFX_WideString& wsMessage,
const CFX_WideString& wsMessageType);
- FX_BOOL SetTestValue(int32_t iType,
- CFX_WideString& wsValue,
- XFA_ATTRIBUTEENUM eName);
+ bool SetTestValue(int32_t iType,
+ CFX_WideString& wsValue,
+ XFA_ATTRIBUTEENUM eName);
};
#endif // XFA_FXFA_PARSER_CXFA_VALIDATE_H_
diff --git a/xfa/fxfa/parser/cxfa_value.cpp b/xfa/fxfa/parser/cxfa_value.cpp
index 70b1aba5ab..4d467aee2c 100644
--- a/xfa/fxfa/parser/cxfa_value.cpp
+++ b/xfa/fxfa/parser/cxfa_value.cpp
@@ -16,12 +16,12 @@ XFA_Element CXFA_Value::GetChildValueClassID() {
return XFA_Element::Unknown;
}
-FX_BOOL CXFA_Value::GetChildValueContent(CFX_WideString& wsContent) {
+bool CXFA_Value::GetChildValueContent(CFX_WideString& wsContent) {
if (!m_pNode)
- return FALSE;
+ return false;
if (CXFA_Node* pNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild))
return pNode->TryContent(wsContent);
- return FALSE;
+ return false;
}
CXFA_Arc CXFA_Value::GetArc() {
@@ -52,5 +52,5 @@ CXFA_ExData CXFA_Value::GetExData() {
CXFA_Image CXFA_Value::GetImage() {
return CXFA_Image(
m_pNode ? (m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild)) : nullptr,
- TRUE);
+ true);
}
diff --git a/xfa/fxfa/parser/cxfa_value.h b/xfa/fxfa/parser/cxfa_value.h
index c3a03950ec..225e1879da 100644
--- a/xfa/fxfa/parser/cxfa_value.h
+++ b/xfa/fxfa/parser/cxfa_value.h
@@ -23,7 +23,7 @@ class CXFA_Value : public CXFA_Data {
explicit CXFA_Value(CXFA_Node* pNode) : CXFA_Data(pNode) {}
XFA_Element GetChildValueClassID();
- FX_BOOL GetChildValueContent(CFX_WideString& wsContent);
+ bool GetChildValueContent(CFX_WideString& wsContent);
CXFA_Arc GetArc();
CXFA_Line GetLine();
CXFA_Rectangle GetRectangle();
diff --git a/xfa/fxfa/parser/cxfa_widetextread.cpp b/xfa/fxfa/parser/cxfa_widetextread.cpp
index 7c6487db6a..35d4dc1270 100644
--- a/xfa/fxfa/parser/cxfa_widetextread.cpp
+++ b/xfa/fxfa/parser/cxfa_widetextread.cpp
@@ -50,7 +50,7 @@ int32_t CXFA_WideTextRead::GetPosition() {
return m_iPosition * sizeof(FX_WCHAR);
}
-FX_BOOL CXFA_WideTextRead::IsEOF() const {
+bool CXFA_WideTextRead::IsEOF() const {
return m_iPosition >= m_wsBuffer.GetLength();
}
@@ -60,7 +60,7 @@ int32_t CXFA_WideTextRead::ReadData(uint8_t* pBuffer, int32_t iBufferSize) {
int32_t CXFA_WideTextRead::ReadString(FX_WCHAR* pStr,
int32_t iMaxLength,
- FX_BOOL& bEOS) {
+ bool& bEOS) {
iMaxLength = std::min(iMaxLength, m_wsBuffer.GetLength() - m_iPosition);
if (iMaxLength == 0)
return 0;
@@ -80,8 +80,8 @@ int32_t CXFA_WideTextRead::WriteString(const FX_WCHAR* pStr, int32_t iLength) {
return 0;
}
-FX_BOOL CXFA_WideTextRead::SetLength(int32_t iLength) {
- return FALSE;
+bool CXFA_WideTextRead::SetLength(int32_t iLength) {
+ return false;
}
int32_t CXFA_WideTextRead::GetBOM(uint8_t bom[4]) const {
diff --git a/xfa/fxfa/parser/cxfa_widetextread.h b/xfa/fxfa/parser/cxfa_widetextread.h
index 9ee2c4132e..e0f0eac358 100644
--- a/xfa/fxfa/parser/cxfa_widetextread.h
+++ b/xfa/fxfa/parser/cxfa_widetextread.h
@@ -20,15 +20,13 @@ class CXFA_WideTextRead : public IFX_Stream {
int32_t GetLength() const override;
int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override;
int32_t GetPosition() override;
- FX_BOOL IsEOF() const override;
+ bool IsEOF() const override;
int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override;
- int32_t ReadString(FX_WCHAR* pStr,
- int32_t iMaxLength,
- FX_BOOL& bEOS) override;
+ int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override;
int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override;
int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override;
void Flush() override {}
- FX_BOOL SetLength(int32_t iLength) override;
+ bool SetLength(int32_t iLength) override;
int32_t GetBOM(uint8_t bom[4]) const override;
uint16_t GetCodePage() const override;
uint16_t SetCodePage(uint16_t wCodePage) override;
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index f237ad0a00..c9523383dd 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -18,7 +18,7 @@
namespace {
FX_FLOAT GetEdgeThickness(const CXFA_StrokeArray& strokes,
- FX_BOOL b3DStyle,
+ bool b3DStyle,
int32_t nIndex) {
FX_FLOAT fThickness = 0;
@@ -31,20 +31,20 @@ FX_FLOAT GetEdgeThickness(const CXFA_StrokeArray& strokes,
return fThickness;
}
-FX_BOOL SplitDateTime(const CFX_WideString& wsDateTime,
- CFX_WideString& wsDate,
- CFX_WideString& wsTime) {
+bool SplitDateTime(const CFX_WideString& wsDateTime,
+ CFX_WideString& wsDate,
+ CFX_WideString& wsTime) {
wsDate = L"";
wsTime = L"";
if (wsDateTime.IsEmpty())
- return FALSE;
+ return false;
int nSplitIndex = -1;
nSplitIndex = wsDateTime.Find('T');
if (nSplitIndex < 0)
nSplitIndex = wsDateTime.Find(' ');
if (nSplitIndex < 0)
- return FALSE;
+ return false;
wsDate = wsDateTime.Left(nSplitIndex);
if (!wsDate.IsEmpty()) {
@@ -55,7 +55,7 @@ FX_BOOL SplitDateTime(const CFX_WideString& wsDateTime,
break;
}
if (i == iCount)
- return FALSE;
+ return false;
}
wsTime = wsDateTime.Right(wsDateTime.GetLength() - nSplitIndex - 1);
if (!wsTime.IsEmpty()) {
@@ -66,9 +66,9 @@ FX_BOOL SplitDateTime(const CFX_WideString& wsDateTime,
break;
}
if (i == iCount)
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) {
@@ -79,7 +79,7 @@ CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) {
eWidgetType = XFA_Element::Unknown;
XFA_Element eUIType = XFA_Element::Unknown;
- CXFA_Value defValue(pNode->GetProperty(0, XFA_Element::Value, TRUE));
+ CXFA_Value defValue(pNode->GetProperty(0, XFA_Element::Value, true));
XFA_Element eValueType = defValue.GetChildValueClassID();
switch (eValueType) {
case XFA_Element::Boolean:
@@ -115,7 +115,7 @@ CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) {
}
CXFA_Node* pUIChild = nullptr;
- CXFA_Node* pUI = pNode->GetProperty(0, XFA_Element::Ui, TRUE);
+ CXFA_Node* pUI = pNode->GetProperty(0, XFA_Element::Ui, true);
CXFA_Node* pChild = pUI->GetNodeItem(XFA_NODEITEM_FirstChild);
for (; pChild; pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling)) {
XFA_Element eChildType = pChild->GetElementType();
@@ -160,9 +160,9 @@ CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) {
if (!pUIChild) {
if (eUIType == XFA_Element::Unknown) {
eUIType = XFA_Element::TextEdit;
- defValue.GetNode()->GetProperty(0, XFA_Element::Text, TRUE);
+ defValue.GetNode()->GetProperty(0, XFA_Element::Text, true);
}
- return pUI->GetProperty(0, eUIType, TRUE);
+ return pUI->GetProperty(0, eUIType, true);
}
if (eUIType != XFA_Element::Unknown)
@@ -202,7 +202,7 @@ CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) {
eValueType = XFA_Element::Text;
break;
}
- defValue.GetNode()->GetProperty(0, eValueType, TRUE);
+ defValue.GetNode()->GetProperty(0, eValueType, true);
return pUIChild;
}
@@ -229,23 +229,23 @@ CFX_WideStringC GetAttributeDefaultValue_Cdata(XFA_Element eElement,
return nullptr;
}
-FX_BOOL GetAttributeDefaultValue_Boolean(XFA_Element eElement,
- XFA_ATTRIBUTE eAttribute,
- uint32_t dwPacket) {
+bool GetAttributeDefaultValue_Boolean(XFA_Element eElement,
+ XFA_ATTRIBUTE eAttribute,
+ uint32_t dwPacket) {
void* pValue;
if (XFA_GetAttributeDefaultValue(pValue, eElement, eAttribute,
XFA_ATTRIBUTETYPE_Boolean, dwPacket)) {
return !!pValue;
}
- return FALSE;
+ return false;
}
} // namespace
CXFA_WidgetData::CXFA_WidgetData(CXFA_Node* pNode)
: CXFA_Data(pNode),
- m_bIsNull(TRUE),
- m_bPreNull(TRUE),
+ m_bIsNull(true),
+ m_bPreNull(true),
m_pUiChildNode(nullptr),
m_eUIType(XFA_Element::Unknown) {}
@@ -265,7 +265,7 @@ CFX_WideString CXFA_WidgetData::GetRawValue() {
return m_pNode->GetContent();
}
-int32_t CXFA_WidgetData::GetAccess(FX_BOOL bTemplate) {
+int32_t CXFA_WidgetData::GetAccess(bool bTemplate) {
if (bTemplate) {
CXFA_Node* pNode = m_pNode->GetTemplateNode();
if (pNode)
@@ -286,7 +286,7 @@ int32_t CXFA_WidgetData::GetAccess(FX_BOOL bTemplate) {
int32_t CXFA_WidgetData::GetRotate() {
CXFA_Measurement ms;
- if (!m_pNode->TryMeasure(XFA_ATTRIBUTE_Rotate, ms, FALSE))
+ if (!m_pNode->TryMeasure(XFA_ATTRIBUTE_Rotate, ms, false))
return 0;
int32_t iRotate = FXSYS_round(ms.GetValue());
@@ -294,23 +294,23 @@ int32_t CXFA_WidgetData::GetRotate() {
return iRotate / 90 * 90;
}
-CXFA_Border CXFA_WidgetData::GetBorder(FX_BOOL bModified) {
+CXFA_Border CXFA_WidgetData::GetBorder(bool bModified) {
return CXFA_Border(m_pNode->GetProperty(0, XFA_Element::Border, bModified));
}
-CXFA_Caption CXFA_WidgetData::GetCaption(FX_BOOL bModified) {
+CXFA_Caption CXFA_WidgetData::GetCaption(bool bModified) {
return CXFA_Caption(m_pNode->GetProperty(0, XFA_Element::Caption, bModified));
}
-CXFA_Font CXFA_WidgetData::GetFont(FX_BOOL bModified) {
+CXFA_Font CXFA_WidgetData::GetFont(bool bModified) {
return CXFA_Font(m_pNode->GetProperty(0, XFA_Element::Font, bModified));
}
-CXFA_Margin CXFA_WidgetData::GetMargin(FX_BOOL bModified) {
+CXFA_Margin CXFA_WidgetData::GetMargin(bool bModified) {
return CXFA_Margin(m_pNode->GetProperty(0, XFA_Element::Margin, bModified));
}
-CXFA_Para CXFA_WidgetData::GetPara(FX_BOOL bModified) {
+CXFA_Para CXFA_WidgetData::GetPara(bool bModified) {
return CXFA_Para(m_pNode->GetProperty(0, XFA_Element::Para, bModified));
}
@@ -320,7 +320,7 @@ void CXFA_WidgetData::GetEventList(CXFA_NodeArray& events) {
int32_t CXFA_WidgetData::GetEventByActivity(int32_t iActivity,
CXFA_NodeArray& events,
- FX_BOOL bIsFormReady) {
+ bool bIsFormReady) {
CXFA_NodeArray allEvents;
GetEventList(allEvents);
int32_t iCount = allEvents.GetSize();
@@ -345,67 +345,67 @@ int32_t CXFA_WidgetData::GetEventByActivity(int32_t iActivity,
return events.GetSize();
}
-CXFA_Value CXFA_WidgetData::GetDefaultValue(FX_BOOL bModified) {
+CXFA_Value CXFA_WidgetData::GetDefaultValue(bool bModified) {
CXFA_Node* pTemNode = m_pNode->GetTemplateNode();
return CXFA_Value(
pTemNode ? pTemNode->GetProperty(0, XFA_Element::Value, bModified)
: nullptr);
}
-CXFA_Value CXFA_WidgetData::GetFormValue(FX_BOOL bModified) {
+CXFA_Value CXFA_WidgetData::GetFormValue(bool bModified) {
return CXFA_Value(m_pNode->GetProperty(0, XFA_Element::Value, bModified));
}
-CXFA_Calculate CXFA_WidgetData::GetCalculate(FX_BOOL bModified) {
+CXFA_Calculate CXFA_WidgetData::GetCalculate(bool bModified) {
return CXFA_Calculate(
m_pNode->GetProperty(0, XFA_Element::Calculate, bModified));
}
-CXFA_Validate CXFA_WidgetData::GetValidate(FX_BOOL bModified) {
+CXFA_Validate CXFA_WidgetData::GetValidate(bool bModified) {
return CXFA_Validate(
m_pNode->GetProperty(0, XFA_Element::Validate, bModified));
}
-CXFA_Bind CXFA_WidgetData::GetBind(FX_BOOL bModified) {
+CXFA_Bind CXFA_WidgetData::GetBind(bool bModified) {
return CXFA_Bind(m_pNode->GetProperty(0, XFA_Element::Bind, bModified));
}
-CXFA_Assist CXFA_WidgetData::GetAssist(FX_BOOL bModified) {
+CXFA_Assist CXFA_WidgetData::GetAssist(bool bModified) {
return CXFA_Assist(m_pNode->GetProperty(0, XFA_Element::Assist, bModified));
}
-FX_BOOL CXFA_WidgetData::GetWidth(FX_FLOAT& fWidth) {
+bool CXFA_WidgetData::GetWidth(FX_FLOAT& fWidth) {
return TryMeasure(XFA_ATTRIBUTE_W, fWidth);
}
-FX_BOOL CXFA_WidgetData::GetHeight(FX_FLOAT& fHeight) {
+bool CXFA_WidgetData::GetHeight(FX_FLOAT& fHeight) {
return TryMeasure(XFA_ATTRIBUTE_H, fHeight);
}
-FX_BOOL CXFA_WidgetData::GetMinWidth(FX_FLOAT& fMinWidth) {
+bool CXFA_WidgetData::GetMinWidth(FX_FLOAT& fMinWidth) {
return TryMeasure(XFA_ATTRIBUTE_MinW, fMinWidth);
}
-FX_BOOL CXFA_WidgetData::GetMinHeight(FX_FLOAT& fMinHeight) {
+bool CXFA_WidgetData::GetMinHeight(FX_FLOAT& fMinHeight) {
return TryMeasure(XFA_ATTRIBUTE_MinH, fMinHeight);
}
-FX_BOOL CXFA_WidgetData::GetMaxWidth(FX_FLOAT& fMaxWidth) {
+bool CXFA_WidgetData::GetMaxWidth(FX_FLOAT& fMaxWidth) {
return TryMeasure(XFA_ATTRIBUTE_MaxW, fMaxWidth);
}
-FX_BOOL CXFA_WidgetData::GetMaxHeight(FX_FLOAT& fMaxHeight) {
+bool CXFA_WidgetData::GetMaxHeight(FX_FLOAT& fMaxHeight) {
return TryMeasure(XFA_ATTRIBUTE_MaxH, fMaxHeight);
}
-CXFA_Border CXFA_WidgetData::GetUIBorder(FX_BOOL bModified) {
+CXFA_Border CXFA_WidgetData::GetUIBorder(bool bModified) {
CXFA_Node* pUIChild = GetUIChild();
return CXFA_Border(
pUIChild ? pUIChild->GetProperty(0, XFA_Element::Border, bModified)
: nullptr);
}
-CXFA_Margin CXFA_WidgetData::GetUIMargin(FX_BOOL bModified) {
+CXFA_Margin CXFA_WidgetData::GetUIMargin(bool bModified) {
CXFA_Node* pUIChild = GetUIChild();
return CXFA_Margin(
pUIChild ? pUIChild->GetProperty(0, XFA_Element::Margin, bModified)
@@ -423,12 +423,12 @@ void CXFA_WidgetData::GetUIMargin(CFX_RectF& rtUIMargin) {
return;
FX_FLOAT fLeftInset, fTopInset, fRightInset, fBottomInset;
- FX_BOOL bLeft = mgUI.GetLeftInset(fLeftInset);
- FX_BOOL bTop = mgUI.GetTopInset(fTopInset);
- FX_BOOL bRight = mgUI.GetRightInset(fRightInset);
- FX_BOOL bBottom = mgUI.GetBottomInset(fBottomInset);
+ bool bLeft = mgUI.GetLeftInset(fLeftInset);
+ bool bTop = mgUI.GetTopInset(fTopInset);
+ bool bRight = mgUI.GetRightInset(fRightInset);
+ bool bBottom = mgUI.GetBottomInset(fBottomInset);
if (border) {
- FX_BOOL bVisible = FALSE;
+ bool bVisible = false;
FX_FLOAT fThickness = 0;
border.Get3DStyle(bVisible, fThickness);
if (!bLeft || !bTop || !bRight || !bBottom) {
@@ -455,8 +455,8 @@ int32_t CXFA_WidgetData::GetButtonHighlight() {
XFA_Element::Button, XFA_ATTRIBUTE_Highlight, XFA_XDPPACKET_Form);
}
-FX_BOOL CXFA_WidgetData::GetButtonRollover(CFX_WideString& wsRollover,
- FX_BOOL& bRichText) {
+bool CXFA_WidgetData::GetButtonRollover(CFX_WideString& wsRollover,
+ bool& bRichText) {
if (CXFA_Node* pItems = m_pNode->GetChild(0, XFA_Element::Items)) {
CXFA_Node* pText = pItems->GetNodeItem(XFA_NODEITEM_FirstChild);
while (pText) {
@@ -470,11 +470,10 @@ FX_BOOL CXFA_WidgetData::GetButtonRollover(CFX_WideString& wsRollover,
pText = pText->GetNodeItem(XFA_NODEITEM_NextSibling);
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetButtonDown(CFX_WideString& wsDown,
- FX_BOOL& bRichText) {
+bool CXFA_WidgetData::GetButtonDown(CFX_WideString& wsDown, bool& bRichText) {
if (CXFA_Node* pItems = m_pNode->GetChild(0, XFA_Element::Items)) {
CXFA_Node* pText = pItems->GetNodeItem(XFA_NODEITEM_FirstChild);
while (pText) {
@@ -488,7 +487,7 @@ FX_BOOL CXFA_WidgetData::GetButtonDown(CFX_WideString& wsDown,
pText = pText->GetNodeItem(XFA_NODEITEM_NextSibling);
}
}
- return FALSE;
+ return false;
}
int32_t CXFA_WidgetData::GetCheckButtonShape() {
@@ -507,10 +506,10 @@ int32_t CXFA_WidgetData::GetCheckButtonMark() {
XFA_ATTRIBUTE_Mark, XFA_XDPPACKET_Form);
}
-FX_BOOL CXFA_WidgetData::IsRadioButton() {
+bool CXFA_WidgetData::IsRadioButton() {
if (CXFA_Node* pParent = m_pNode->GetNodeItem(XFA_NODEITEM_Parent))
return pParent->GetElementType() == XFA_Element::ExclGroup;
- return FALSE;
+ return false;
}
FX_FLOAT CXFA_WidgetData::GetCheckButtonSize() {
@@ -522,7 +521,7 @@ FX_FLOAT CXFA_WidgetData::GetCheckButtonSize() {
.ToUnit(XFA_UNIT_Pt);
}
-FX_BOOL CXFA_WidgetData::IsAllowNeutral() {
+bool CXFA_WidgetData::IsAllowNeutral() {
CXFA_Node* pUIChild = GetUIChild();
if (pUIChild)
return pUIChild->GetBoolean(XFA_ATTRIBUTE_AllowNeutral);
@@ -648,8 +647,8 @@ CXFA_Node* CXFA_WidgetData::SetSelectedMember(const CFX_WideStringC& wsName,
void CXFA_WidgetData::SetSelectedMemberByValue(const CFX_WideStringC& wsValue,
bool bNotify,
- FX_BOOL bScriptModify,
- FX_BOOL bSyncData) {
+ bool bScriptModify,
+ bool bSyncData) {
CFX_WideString wsExclGroup;
for (CXFA_Node* pNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); pNode;
pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
@@ -675,7 +674,7 @@ void CXFA_WidgetData::SetSelectedMemberByValue(const CFX_WideStringC& wsValue,
wsExclGroup = wsValue;
}
pNode->SetContent(wsChildValue, wsChildValue, bNotify, bScriptModify,
- FALSE);
+ false);
}
if (m_pNode) {
m_pNode->SetContent(wsExclGroup, wsExclGroup, bNotify, bScriptModify,
@@ -719,7 +718,7 @@ int32_t CXFA_WidgetData::GetChoiceListCommitOn() {
XFA_Element::ChoiceList, XFA_ATTRIBUTE_CommitOn, XFA_XDPPACKET_Form);
}
-FX_BOOL CXFA_WidgetData::IsChoiceListAllowTextEntry() {
+bool CXFA_WidgetData::IsChoiceListAllowTextEntry() {
CXFA_Node* pUIChild = GetUIChild();
if (pUIChild)
return pUIChild->GetBoolean(XFA_ATTRIBUTE_TextEntry);
@@ -735,13 +734,13 @@ int32_t CXFA_WidgetData::GetChoiceListOpen() {
XFA_ATTRIBUTE_Open, XFA_XDPPACKET_Form);
}
-FX_BOOL CXFA_WidgetData::IsListBox() {
+bool CXFA_WidgetData::IsListBox() {
int32_t iOpenMode = GetChoiceListOpen();
return (iOpenMode == XFA_ATTRIBUTEENUM_Always ||
iOpenMode == XFA_ATTRIBUTEENUM_MultiSelect);
}
-int32_t CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue) {
+int32_t CXFA_WidgetData::CountChoiceListItems(bool bSaveValue) {
CXFA_NodeArray pItems;
CXFA_Node* pItem = nullptr;
int32_t iCount = 0;
@@ -760,8 +759,8 @@ int32_t CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue) {
pItem = pItems[0];
if (iCount > 1) {
- FX_BOOL bItemOneHasSave = pItems[0]->GetBoolean(XFA_ATTRIBUTE_Save);
- FX_BOOL bItemTwoHasSave = pItems[1]->GetBoolean(XFA_ATTRIBUTE_Save);
+ bool bItemOneHasSave = pItems[0]->GetBoolean(XFA_ATTRIBUTE_Save);
+ bool bItemTwoHasSave = pItems[1]->GetBoolean(XFA_ATTRIBUTE_Save);
if (bItemOneHasSave != bItemTwoHasSave && bSaveValue == bItemTwoHasSave)
pItem = pItems[1];
}
@@ -769,9 +768,9 @@ int32_t CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue) {
return pItem->CountChildren(XFA_Element::Unknown);
}
-FX_BOOL CXFA_WidgetData::GetChoiceListItem(CFX_WideString& wsText,
- int32_t nIndex,
- FX_BOOL bSaveValue) {
+bool CXFA_WidgetData::GetChoiceListItem(CFX_WideString& wsText,
+ int32_t nIndex,
+ bool bSaveValue) {
wsText.clear();
CXFA_NodeArray pItemsArray;
CXFA_Node* pItems = nullptr;
@@ -787,12 +786,12 @@ FX_BOOL CXFA_WidgetData::GetChoiceListItem(CFX_WideString& wsText,
break;
}
if (iCount == 0)
- return FALSE;
+ return false;
pItems = pItemsArray[0];
if (iCount > 1) {
- FX_BOOL bItemOneHasSave = pItemsArray[0]->GetBoolean(XFA_ATTRIBUTE_Save);
- FX_BOOL bItemTwoHasSave = pItemsArray[1]->GetBoolean(XFA_ATTRIBUTE_Save);
+ bool bItemOneHasSave = pItemsArray[0]->GetBoolean(XFA_ATTRIBUTE_Save);
+ bool bItemTwoHasSave = pItemsArray[1]->GetBoolean(XFA_ATTRIBUTE_Save);
if (bItemOneHasSave != bItemTwoHasSave && bSaveValue == bItemTwoHasSave)
pItems = pItemsArray[1];
}
@@ -800,14 +799,14 @@ FX_BOOL CXFA_WidgetData::GetChoiceListItem(CFX_WideString& wsText,
CXFA_Node* pItem = pItems->GetChild(nIndex, XFA_Element::Unknown);
if (pItem) {
pItem->TryContent(wsText);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void CXFA_WidgetData::GetChoiceListItems(CFX_WideStringArray& wsTextArray,
- FX_BOOL bSaveValue) {
+ bool bSaveValue) {
CXFA_NodeArray pItems;
CXFA_Node* pItem = nullptr;
int32_t iCount = 0;
@@ -826,8 +825,8 @@ void CXFA_WidgetData::GetChoiceListItems(CFX_WideStringArray& wsTextArray,
pItem = pItems[0];
if (iCount > 1) {
- FX_BOOL bItemOneHasSave = pItems[0]->GetBoolean(XFA_ATTRIBUTE_Save);
- FX_BOOL bItemTwoHasSave = pItems[1]->GetBoolean(XFA_ATTRIBUTE_Save);
+ bool bItemOneHasSave = pItems[0]->GetBoolean(XFA_ATTRIBUTE_Save);
+ bool bItemTwoHasSave = pItems[1]->GetBoolean(XFA_ATTRIBUTE_Save);
if (bItemOneHasSave != bItemTwoHasSave && bSaveValue == bItemTwoHasSave)
pItem = pItems[1];
}
@@ -845,7 +844,7 @@ int32_t CXFA_WidgetData::CountSelectedItems() {
int32_t iSelected = 0;
CFX_WideStringArray wsSaveTextArray;
- GetChoiceListItems(wsSaveTextArray, TRUE);
+ GetChoiceListItems(wsSaveTextArray, true);
int32_t iValues = wsValueArray.GetSize();
for (int32_t i = 0; i < iValues; i++) {
int32_t iSaves = wsSaveTextArray.GetSize();
@@ -863,7 +862,7 @@ int32_t CXFA_WidgetData::GetSelectedItem(int32_t nIndex) {
CFX_WideStringArray wsValueArray;
GetSelectedItemsValue(wsValueArray);
CFX_WideStringArray wsSaveTextArray;
- GetChoiceListItems(wsSaveTextArray, TRUE);
+ GetChoiceListItems(wsSaveTextArray, true);
int32_t iSaves = wsSaveTextArray.GetSize();
for (int32_t j = 0; j < iSaves; j++) {
if (wsValueArray[nIndex] == wsSaveTextArray[j])
@@ -880,7 +879,7 @@ void CXFA_WidgetData::GetSelectedItems(CFX_Int32Array& iSelArray) {
return;
CFX_WideStringArray wsSaveTextArray;
- GetChoiceListItems(wsSaveTextArray, TRUE);
+ GetChoiceListItems(wsSaveTextArray, true);
int32_t iSaves = wsSaveTextArray.GetSize();
for (int32_t i = 0; i < iValues; i++) {
for (int32_t j = 0; j < iSaves; j++) {
@@ -917,35 +916,35 @@ void CXFA_WidgetData::GetSelectedItemsValue(
}
}
-FX_BOOL CXFA_WidgetData::GetItemState(int32_t nIndex) {
+bool CXFA_WidgetData::GetItemState(int32_t nIndex) {
if (nIndex < 0)
- return FALSE;
+ return false;
CFX_WideStringArray wsSaveTextArray;
- GetChoiceListItems(wsSaveTextArray, TRUE);
+ GetChoiceListItems(wsSaveTextArray, true);
if (wsSaveTextArray.GetSize() <= nIndex)
- return FALSE;
+ return false;
CFX_WideStringArray wsValueArray;
GetSelectedItemsValue(wsValueArray);
int32_t iValues = wsValueArray.GetSize();
for (int32_t j = 0; j < iValues; j++) {
if (wsValueArray[j] == wsSaveTextArray[nIndex])
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CXFA_WidgetData::SetItemState(int32_t nIndex,
- FX_BOOL bSelected,
+ bool bSelected,
bool bNotify,
- FX_BOOL bScriptModify,
- FX_BOOL bSyncData) {
+ bool bScriptModify,
+ bool bSyncData) {
if (nIndex < 0)
return;
CFX_WideStringArray wsSaveTextArray;
- GetChoiceListItems(wsSaveTextArray, TRUE);
+ GetChoiceListItems(wsSaveTextArray, true);
if (wsSaveTextArray.GetSize() <= nIndex)
return;
@@ -999,13 +998,13 @@ void CXFA_WidgetData::SetItemState(int32_t nIndex,
void CXFA_WidgetData::SetSelectedItems(CFX_Int32Array& iSelArray,
bool bNotify,
- FX_BOOL bScriptModify,
- FX_BOOL bSyncData) {
+ bool bScriptModify,
+ bool bSyncData) {
CFX_WideString wsValue;
int32_t iSize = iSelArray.GetSize();
if (iSize >= 1) {
CFX_WideStringArray wsSaveTextArray;
- GetChoiceListItems(wsSaveTextArray, TRUE);
+ GetChoiceListItems(wsSaveTextArray, true);
CFX_WideString wsItemValue;
for (int32_t i = 0; i < iSize; i++) {
wsItemValue = (iSize == 1)
@@ -1035,7 +1034,7 @@ void CXFA_WidgetData::ClearAllSelections() {
void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel,
const CFX_WideString& wsValue,
int32_t nIndex,
- FX_BOOL bNotify) {
+ bool bNotify) {
CFX_WideString wsNewValue(wsValue);
if (wsNewValue.IsEmpty())
wsNewValue = wsLabel;
@@ -1057,12 +1056,12 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel,
InsertListTextItem(pItems, wsLabel, nIndex);
CXFA_Node* pSaveItems = m_pNode->CreateSamePacketNode(XFA_Element::Items);
m_pNode->InsertChild(-1, pSaveItems);
- pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, TRUE);
+ pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, true);
InsertListTextItem(pSaveItems, wsNewValue, nIndex);
} else if (iCount > 1) {
for (int32_t i = 0; i < 2; i++) {
CXFA_Node* pNode = listitems[i];
- FX_BOOL bHasSave = pNode->GetBoolean(XFA_ATTRIBUTE_Save);
+ bool bHasSave = pNode->GetBoolean(XFA_ATTRIBUTE_Save);
if (bHasSave)
InsertListTextItem(pNode, wsNewValue, nIndex);
else
@@ -1070,11 +1069,11 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel,
}
} else {
CXFA_Node* pNode = listitems[0];
- pNode->SetBoolean(XFA_ATTRIBUTE_Save, FALSE);
+ pNode->SetBoolean(XFA_ATTRIBUTE_Save, false);
pNode->SetEnum(XFA_ATTRIBUTE_Presence, XFA_ATTRIBUTEENUM_Visible);
CXFA_Node* pSaveItems = m_pNode->CreateSamePacketNode(XFA_Element::Items);
m_pNode->InsertChild(-1, pSaveItems);
- pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, TRUE);
+ pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, true);
pSaveItems->SetEnum(XFA_ATTRIBUTE_Presence, XFA_ATTRIBUTEENUM_Hidden);
listitems.RemoveAll();
CXFA_Node* pListNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
@@ -1112,7 +1111,7 @@ void CXFA_WidgetData::GetItemLabel(const CFX_WideStringC& wsValue,
wsLabel = wsValue;
} else {
CXFA_Node* pLabelItems = listitems[0];
- FX_BOOL bSave = pLabelItems->GetBoolean(XFA_ATTRIBUTE_Save);
+ bool bSave = pLabelItems->GetBoolean(XFA_ATTRIBUTE_Save);
CXFA_Node* pSaveItems = nullptr;
if (bSave) {
pSaveItems = pLabelItems;
@@ -1158,7 +1157,7 @@ void CXFA_WidgetData::GetItemValue(const CFX_WideStringC& wsLabel,
wsValue = wsLabel;
} else {
CXFA_Node* pLabelItems = listitems[0];
- FX_BOOL bSave = pLabelItems->GetBoolean(XFA_ATTRIBUTE_Save);
+ bool bSave = pLabelItems->GetBoolean(XFA_ATTRIBUTE_Save);
CXFA_Node* pSaveItems = nullptr;
if (bSave) {
pSaveItems = pLabelItems;
@@ -1186,11 +1185,11 @@ void CXFA_WidgetData::GetItemValue(const CFX_WideStringC& wsLabel,
}
}
-FX_BOOL CXFA_WidgetData::DeleteItem(int32_t nIndex,
- FX_BOOL bNotify,
- FX_BOOL bScriptModify,
- FX_BOOL bSyncData) {
- FX_BOOL bSetValue = FALSE;
+bool CXFA_WidgetData::DeleteItem(int32_t nIndex,
+ bool bNotify,
+ bool bScriptModify,
+ bool bSyncData) {
+ bool bSetValue = false;
CXFA_Node* pItems = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
for (; pItems; pItems = pItems->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pItems->GetElementType() != XFA_Element::Items)
@@ -1202,8 +1201,8 @@ FX_BOOL CXFA_WidgetData::DeleteItem(int32_t nIndex,
}
} else {
if (!bSetValue && pItems->GetBoolean(XFA_ATTRIBUTE_Save)) {
- SetItemState(nIndex, FALSE, true, bScriptModify, bSyncData);
- bSetValue = TRUE;
+ SetItemState(nIndex, false, true, bScriptModify, bSyncData);
+ bSetValue = true;
}
int32_t i = 0;
CXFA_Node* pNode = pItems->GetNodeItem(XFA_NODEITEM_FirstChild);
@@ -1219,7 +1218,7 @@ FX_BOOL CXFA_WidgetData::DeleteItem(int32_t nIndex,
}
if (bNotify)
m_pNode->GetDocument()->GetNotify()->OnWidgetListItemRemoved(this, nIndex);
- return TRUE;
+ return true;
}
int32_t CXFA_WidgetData::GetHorizontalScrollPolicy() {
@@ -1244,33 +1243,33 @@ CFX_WideString CXFA_WidgetData::GetBarcodeType() {
: CFX_WideString();
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(int32_t& val) {
+bool CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(int32_t& val) {
CXFA_Node* pUIChild = GetUIChild();
CFX_WideString wsCharEncoding;
if (pUIChild->TryCData(XFA_ATTRIBUTE_CharEncoding, wsCharEncoding)) {
if (wsCharEncoding.CompareNoCase(L"UTF-16")) {
val = CHAR_ENCODING_UNICODE;
- return TRUE;
+ return true;
}
if (wsCharEncoding.CompareNoCase(L"UTF-8")) {
val = CHAR_ENCODING_UTF8;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_Checksum(FX_BOOL& val) {
+bool CXFA_WidgetData::GetBarcodeAttribute_Checksum(bool& val) {
CXFA_Node* pUIChild = GetUIChild();
XFA_ATTRIBUTEENUM eChecksum;
if (pUIChild->TryEnum(XFA_ATTRIBUTE_Checksum, eChecksum)) {
switch (eChecksum) {
case XFA_ATTRIBUTEENUM_None:
val = false;
- return TRUE;
+ return true;
case XFA_ATTRIBUTEENUM_Auto:
val = true;
- return TRUE;
+ return true;
case XFA_ATTRIBUTEENUM_1mod10:
break;
case XFA_ATTRIBUTEENUM_1mod10_1mod11:
@@ -1281,121 +1280,121 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_Checksum(FX_BOOL& val) {
break;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_DataLength(int32_t& val) {
+bool CXFA_WidgetData::GetBarcodeAttribute_DataLength(int32_t& val) {
CXFA_Node* pUIChild = GetUIChild();
CFX_WideString wsDataLength;
if (pUIChild->TryCData(XFA_ATTRIBUTE_DataLength, wsDataLength)) {
val = FXSYS_wtoi(wsDataLength.c_str());
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_StartChar(FX_CHAR& val) {
+bool CXFA_WidgetData::GetBarcodeAttribute_StartChar(FX_CHAR& val) {
CXFA_Node* pUIChild = GetUIChild();
CFX_WideStringC wsStartEndChar;
if (pUIChild->TryCData(XFA_ATTRIBUTE_StartChar, wsStartEndChar)) {
if (wsStartEndChar.GetLength()) {
val = (FX_CHAR)wsStartEndChar.GetAt(0);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_EndChar(FX_CHAR& val) {
+bool CXFA_WidgetData::GetBarcodeAttribute_EndChar(FX_CHAR& val) {
CXFA_Node* pUIChild = GetUIChild();
CFX_WideStringC wsStartEndChar;
if (pUIChild->TryCData(XFA_ATTRIBUTE_EndChar, wsStartEndChar)) {
if (wsStartEndChar.GetLength()) {
val = (FX_CHAR)wsStartEndChar.GetAt(0);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ECLevel(int32_t& val) {
+bool CXFA_WidgetData::GetBarcodeAttribute_ECLevel(int32_t& val) {
CXFA_Node* pUIChild = GetUIChild();
CFX_WideString wsECLevel;
if (pUIChild->TryCData(XFA_ATTRIBUTE_ErrorCorrectionLevel, wsECLevel)) {
val = FXSYS_wtoi(wsECLevel.c_str());
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ModuleWidth(int32_t& val) {
+bool CXFA_WidgetData::GetBarcodeAttribute_ModuleWidth(int32_t& val) {
CXFA_Node* pUIChild = GetUIChild();
CXFA_Measurement mModuleWidthHeight;
if (pUIChild->TryMeasure(XFA_ATTRIBUTE_ModuleWidth, mModuleWidthHeight)) {
val = (int32_t)mModuleWidthHeight.ToUnit(XFA_UNIT_Pt);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ModuleHeight(int32_t& val) {
+bool CXFA_WidgetData::GetBarcodeAttribute_ModuleHeight(int32_t& val) {
CXFA_Node* pUIChild = GetUIChild();
CXFA_Measurement mModuleWidthHeight;
if (pUIChild->TryMeasure(XFA_ATTRIBUTE_ModuleHeight, mModuleWidthHeight)) {
val = (int32_t)mModuleWidthHeight.ToUnit(XFA_UNIT_Pt);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_PrintChecksum(FX_BOOL& val) {
+bool CXFA_WidgetData::GetBarcodeAttribute_PrintChecksum(bool& val) {
CXFA_Node* pUIChild = GetUIChild();
- FX_BOOL bPrintCheckDigit;
+ bool bPrintCheckDigit;
if (pUIChild->TryBoolean(XFA_ATTRIBUTE_PrintCheckDigit, bPrintCheckDigit)) {
val = bPrintCheckDigit;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_TextLocation(int32_t& val) {
+bool CXFA_WidgetData::GetBarcodeAttribute_TextLocation(int32_t& val) {
CXFA_Node* pUIChild = GetUIChild();
XFA_ATTRIBUTEENUM eTextLocation;
if (pUIChild->TryEnum(XFA_ATTRIBUTE_TextLocation, eTextLocation)) {
switch (eTextLocation) {
case XFA_ATTRIBUTEENUM_None:
val = BC_TEXT_LOC_NONE;
- return TRUE;
+ return true;
case XFA_ATTRIBUTEENUM_Above:
val = BC_TEXT_LOC_ABOVE;
- return TRUE;
+ return true;
case XFA_ATTRIBUTEENUM_Below:
val = BC_TEXT_LOC_BELOW;
- return TRUE;
+ return true;
case XFA_ATTRIBUTEENUM_AboveEmbedded:
val = BC_TEXT_LOC_ABOVEEMBED;
- return TRUE;
+ return true;
case XFA_ATTRIBUTEENUM_BelowEmbedded:
val = BC_TEXT_LOC_BELOWEMBED;
- return TRUE;
+ return true;
default:
break;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_Truncate(FX_BOOL& val) {
+bool CXFA_WidgetData::GetBarcodeAttribute_Truncate(bool& val) {
CXFA_Node* pUIChild = GetUIChild();
- FX_BOOL bTruncate;
+ bool bTruncate;
if (pUIChild->TryBoolean(XFA_ATTRIBUTE_Truncate, bTruncate)) {
val = bTruncate;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val) {
+bool CXFA_WidgetData::GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val) {
CXFA_Node* pUIChild = GetUIChild();
CFX_WideString wsWideNarrowRatio;
if (pUIChild->TryCData(XFA_ATTRIBUTE_WideNarrowRatio, wsWideNarrowRatio)) {
@@ -1411,9 +1410,9 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val) {
fRatio = (FX_FLOAT)fA / fB;
}
val = fRatio;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CXFA_WidgetData::GetPasswordChar(CFX_WideString& wsPassWord) {
@@ -1427,7 +1426,7 @@ void CXFA_WidgetData::GetPasswordChar(CFX_WideString& wsPassWord) {
}
}
-FX_BOOL CXFA_WidgetData::IsMultiLine() {
+bool CXFA_WidgetData::IsMultiLine() {
CXFA_Node* pUIChild = GetUIChild();
if (pUIChild)
return pUIChild->GetBoolean(XFA_ATTRIBUTE_MultiLine);
@@ -1463,40 +1462,40 @@ int32_t CXFA_WidgetData::GetMaxChars(XFA_Element& eType) {
return 0;
}
-FX_BOOL CXFA_WidgetData::GetFracDigits(int32_t& iFracDigits) {
+bool CXFA_WidgetData::GetFracDigits(int32_t& iFracDigits) {
if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Value)) {
if (CXFA_Node* pChild = pNode->GetChild(0, XFA_Element::Decimal))
return pChild->TryInteger(XFA_ATTRIBUTE_FracDigits, iFracDigits);
}
iFracDigits = -1;
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetLeadDigits(int32_t& iLeadDigits) {
+bool CXFA_WidgetData::GetLeadDigits(int32_t& iLeadDigits) {
if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Value)) {
if (CXFA_Node* pChild = pNode->GetChild(0, XFA_Element::Decimal))
return pChild->TryInteger(XFA_ATTRIBUTE_LeadDigits, iLeadDigits);
}
iLeadDigits = -1;
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue,
- XFA_VALUEPICTURE eValueType) {
+bool CXFA_WidgetData::SetValue(const CFX_WideString& wsValue,
+ XFA_VALUEPICTURE eValueType) {
if (wsValue.IsEmpty()) {
SyncValue(wsValue, true);
- return TRUE;
+ return true;
}
m_bPreNull = m_bIsNull;
- m_bIsNull = FALSE;
+ m_bIsNull = false;
CFX_WideString wsNewText(wsValue);
CFX_WideString wsPicture;
GetPictureContent(wsPicture, eValueType);
- FX_BOOL bValidate = TRUE;
- FX_BOOL bSyncData = FALSE;
+ bool bValidate = true;
+ bool bSyncData = false;
CXFA_Node* pNode = GetUIChild();
if (!pNode)
- return TRUE;
+ return true;
XFA_Element eType = pNode->GetElementType();
if (!wsPicture.IsEmpty()) {
@@ -1516,7 +1515,7 @@ FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue,
GetFracDigits(iFracDigits);
wsNewText = NumericLimit(wsNewText, iLeadDigits, iFracDigits);
}
- bSyncData = TRUE;
+ bSyncData = true;
}
} else {
if (eType == XFA_Element::NumericEdit) {
@@ -1527,7 +1526,7 @@ FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue,
GetFracDigits(iFracDigits);
wsNewText = NumericLimit(wsNewText, iLeadDigits, iFracDigits);
}
- bSyncData = TRUE;
+ bSyncData = true;
}
}
if (eType != XFA_Element::NumericEdit || bSyncData)
@@ -1536,10 +1535,10 @@ FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue,
return bValidate;
}
-FX_BOOL CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture,
- XFA_VALUEPICTURE ePicture) {
+bool CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture,
+ XFA_VALUEPICTURE ePicture) {
if (ePicture == XFA_VALUEPICTURE_Raw)
- return FALSE;
+ return false;
CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(this);
switch (ePicture) {
@@ -1547,13 +1546,13 @@ FX_BOOL CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture,
if (CXFA_Node* pFormat = m_pNode->GetChild(0, XFA_Element::Format)) {
if (CXFA_Node* pPicture = pFormat->GetChild(0, XFA_Element::Picture)) {
if (pPicture->TryContent(wsPicture))
- return TRUE;
+ return true;
}
}
CFX_WideString wsDataPicture, wsTimePicture;
IFX_Locale* pLocale = GetLocal();
if (!pLocale)
- return FALSE;
+ return false;
uint32_t dwType = widgetValue.GetType();
switch (dwType) {
@@ -1578,7 +1577,7 @@ FX_BOOL CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture,
default:
break;
}
- return TRUE;
+ return true;
}
case XFA_VALUEPICTURE_Edit: {
@@ -1586,14 +1585,14 @@ FX_BOOL CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture,
if (pUI) {
if (CXFA_Node* pPicture = pUI->GetChild(0, XFA_Element::Picture)) {
if (pPicture->TryContent(wsPicture))
- return TRUE;
+ return true;
}
}
{
CFX_WideString wsDataPicture, wsTimePicture;
IFX_Locale* pLocale = GetLocal();
if (!pLocale) {
- return FALSE;
+ return false;
}
uint32_t dwType = widgetValue.GetType();
switch (dwType) {
@@ -1616,19 +1615,19 @@ FX_BOOL CXFA_WidgetData::GetPictureContent(CFX_WideString& wsPicture,
break;
}
}
- return TRUE;
+ return true;
}
case XFA_VALUEPICTURE_DataBind: {
if (CXFA_Bind bind = GetBind()) {
bind.GetPicture(wsPicture);
- return TRUE;
+ return true;
}
break;
}
default:
break;
}
- return FALSE;
+ return false;
}
IFX_Locale* CXFA_WidgetData::GetLocal() {
@@ -1643,8 +1642,8 @@ IFX_Locale* CXFA_WidgetData::GetLocal() {
return m_pNode->GetDocument()->GetLocalMgr()->GetLocaleByName(wsLocaleName);
}
-FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue,
- XFA_VALUEPICTURE eValueType) {
+bool CXFA_WidgetData::GetValue(CFX_WideString& wsValue,
+ XFA_VALUEPICTURE eValueType) {
wsValue = m_pNode->GetContent();
if (eValueType == XFA_VALUEPICTURE_Display)
@@ -1654,7 +1653,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue,
GetPictureContent(wsPicture, eValueType);
CXFA_Node* pNode = GetUIChild();
if (!pNode)
- return TRUE;
+ return true;
switch (GetUIChild()->GetElementType()) {
case XFA_Element::ChoiceList: {
@@ -1681,7 +1680,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue,
break;
}
if (wsPicture.IsEmpty())
- return TRUE;
+ return true;
if (IFX_Locale* pLocale = GetLocal()) {
CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(this);
@@ -1692,7 +1691,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue,
if (SplitDateTime(wsValue, wsDate, wsTime)) {
CXFA_LocaleValue date(XFA_VT_DATE, wsDate, pLocalMgr);
if (date.FormatPatterns(wsValue, wsPicture, pLocale, eValueType))
- return TRUE;
+ return true;
}
break;
}
@@ -1701,7 +1700,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue,
if (SplitDateTime(wsValue, wsDate, wsTime)) {
CXFA_LocaleValue time(XFA_VT_TIME, wsTime, pLocalMgr);
if (time.FormatPatterns(wsValue, wsPicture, pLocale, eValueType))
- return TRUE;
+ return true;
}
break;
}
@@ -1710,20 +1709,19 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue,
}
widgetValue.FormatPatterns(wsValue, wsPicture, pLocale, eValueType);
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_WidgetData::GetNormalizeDataValue(
- const CFX_WideString& wsValue,
- CFX_WideString& wsNormalizeValue) {
+bool CXFA_WidgetData::GetNormalizeDataValue(const CFX_WideString& wsValue,
+ CFX_WideString& wsNormalizeValue) {
wsNormalizeValue = wsValue;
if (wsValue.IsEmpty())
- return TRUE;
+ return true;
CFX_WideString wsPicture;
GetPictureContent(wsPicture, XFA_VALUEPICTURE_DataBind);
if (wsPicture.IsEmpty())
- return TRUE;
+ return true;
ASSERT(GetNode());
CXFA_LocaleMgr* pLocalMgr = GetNode()->GetDocument()->GetLocalMgr();
@@ -1733,31 +1731,31 @@ FX_BOOL CXFA_WidgetData::GetNormalizeDataValue(
widgetValue = CXFA_LocaleValue(widgetValue.GetType(), wsNormalizeValue,
wsPicture, pLocale, pLocalMgr);
wsNormalizeValue = widgetValue.GetValue();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_WidgetData::GetFormatDataValue(const CFX_WideString& wsValue,
- CFX_WideString& wsFormattedValue) {
+bool CXFA_WidgetData::GetFormatDataValue(const CFX_WideString& wsValue,
+ CFX_WideString& wsFormattedValue) {
wsFormattedValue = wsValue;
if (wsValue.IsEmpty())
- return TRUE;
+ return true;
CFX_WideString wsPicture;
GetPictureContent(wsPicture, XFA_VALUEPICTURE_DataBind);
if (wsPicture.IsEmpty())
- return TRUE;
+ return true;
if (IFX_Locale* pLocale = GetLocal()) {
ASSERT(GetNode());
CXFA_Node* pNodeValue = GetNode()->GetChild(0, XFA_Element::Value);
if (!pNodeValue)
- return FALSE;
+ return false;
CXFA_Node* pValueChild = pNodeValue->GetNodeItem(XFA_NODEITEM_FirstChild);
if (!pValueChild)
- return FALSE;
+ return false;
int32_t iVTType = XFA_VT_NULL;
switch (pValueChild->GetElementType()) {
@@ -1798,7 +1796,7 @@ FX_BOOL CXFA_WidgetData::GetFormatDataValue(const CFX_WideString& wsValue,
CXFA_LocaleValue date(XFA_VT_DATE, wsDate, pLocalMgr);
if (date.FormatPatterns(wsFormattedValue, wsPicture, pLocale,
XFA_VALUEPICTURE_DataBind)) {
- return TRUE;
+ return true;
}
}
break;
@@ -1809,7 +1807,7 @@ FX_BOOL CXFA_WidgetData::GetFormatDataValue(const CFX_WideString& wsValue,
CXFA_LocaleValue time(XFA_VT_TIME, wsTime, pLocalMgr);
if (time.FormatPatterns(wsFormattedValue, wsPicture, pLocale,
XFA_VALUEPICTURE_DataBind)) {
- return TRUE;
+ return true;
}
}
break;
@@ -1820,7 +1818,7 @@ FX_BOOL CXFA_WidgetData::GetFormatDataValue(const CFX_WideString& wsValue,
widgetValue.FormatPatterns(wsFormattedValue, wsPicture, pLocale,
XFA_VALUEPICTURE_DataBind);
}
- return FALSE;
+ return false;
}
void CXFA_WidgetData::NormalizeNumStr(const CFX_WideString& wsValue,
@@ -1850,9 +1848,9 @@ void CXFA_WidgetData::FormatNumStr(const CFX_WideString& wsValue,
CFX_WideString wsSrcNum = wsValue;
CFX_WideString wsGroupSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Grouping, wsGroupSymbol);
- FX_BOOL bNeg = FALSE;
+ bool bNeg = false;
if (wsSrcNum[0] == '-') {
- bNeg = TRUE;
+ bNeg = true;
wsSrcNum.Delete(0, 1);
}
int32_t len = wsSrcNum.GetLength();
@@ -1901,7 +1899,7 @@ void CXFA_WidgetData::InsertListTextItem(CXFA_Node* pItems,
int32_t nIndex) {
CXFA_Node* pText = pItems->CreateSamePacketNode(XFA_Element::Text);
pItems->InsertChild(nIndex, pText);
- pText->SetContent(wsText, wsText, FALSE, FALSE, FALSE);
+ pText->SetContent(wsText, wsText, false, false, false);
}
CFX_WideString CXFA_WidgetData::NumericLimit(const CFX_WideString& wsValue,
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.h b/xfa/fxfa/parser/cxfa_widgetdata.h
index ed217ada3d..5c030d6b52 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.h
+++ b/xfa/fxfa/parser/cxfa_widgetdata.h
@@ -44,40 +44,40 @@ class CXFA_WidgetData : public CXFA_Data {
CXFA_Node* GetUIChild();
XFA_Element GetUIType();
CFX_WideString GetRawValue();
- int32_t GetAccess(FX_BOOL bTemplate = FALSE);
+ int32_t GetAccess(bool bTemplate = false);
int32_t GetRotate();
- CXFA_Border GetBorder(FX_BOOL bModified = FALSE);
- CXFA_Caption GetCaption(FX_BOOL bModified = FALSE);
- CXFA_Font GetFont(FX_BOOL bModified = FALSE);
- CXFA_Margin GetMargin(FX_BOOL bModified = FALSE);
- CXFA_Para GetPara(FX_BOOL bModified = FALSE);
+ CXFA_Border GetBorder(bool bModified = false);
+ CXFA_Caption GetCaption(bool bModified = false);
+ CXFA_Font GetFont(bool bModified = false);
+ CXFA_Margin GetMargin(bool bModified = false);
+ CXFA_Para GetPara(bool bModified = false);
void GetEventList(CXFA_NodeArray& events);
int32_t GetEventByActivity(int32_t iActivity,
CXFA_NodeArray& events,
- FX_BOOL bIsFormReady = FALSE);
- CXFA_Value GetDefaultValue(FX_BOOL bModified = FALSE);
- CXFA_Value GetFormValue(FX_BOOL bModified = FALSE);
- CXFA_Calculate GetCalculate(FX_BOOL bModified = FALSE);
- CXFA_Validate GetValidate(FX_BOOL bModified = FALSE);
- CXFA_Bind GetBind(FX_BOOL bModified = FALSE);
- CXFA_Assist GetAssist(FX_BOOL bModified = FALSE);
- FX_BOOL GetWidth(FX_FLOAT& fWidth);
- FX_BOOL GetHeight(FX_FLOAT& fHeight);
- FX_BOOL GetMinWidth(FX_FLOAT& fMinWidth);
- FX_BOOL GetMinHeight(FX_FLOAT& fMinHeight);
- FX_BOOL GetMaxWidth(FX_FLOAT& fMaxWidth);
- FX_BOOL GetMaxHeight(FX_FLOAT& fMaxHeight);
- CXFA_Border GetUIBorder(FX_BOOL bModified = FALSE);
- CXFA_Margin GetUIMargin(FX_BOOL bModified = FALSE);
+ bool bIsFormReady = false);
+ CXFA_Value GetDefaultValue(bool bModified = false);
+ CXFA_Value GetFormValue(bool bModified = false);
+ CXFA_Calculate GetCalculate(bool bModified = false);
+ CXFA_Validate GetValidate(bool bModified = false);
+ CXFA_Bind GetBind(bool bModified = false);
+ CXFA_Assist GetAssist(bool bModified = false);
+ bool GetWidth(FX_FLOAT& fWidth);
+ bool GetHeight(FX_FLOAT& fHeight);
+ bool GetMinWidth(FX_FLOAT& fMinWidth);
+ bool GetMinHeight(FX_FLOAT& fMinHeight);
+ bool GetMaxWidth(FX_FLOAT& fMaxWidth);
+ bool GetMaxHeight(FX_FLOAT& fMaxHeight);
+ CXFA_Border GetUIBorder(bool bModified = false);
+ CXFA_Margin GetUIMargin(bool bModified = false);
void GetUIMargin(CFX_RectF& rtUIMargin);
int32_t GetButtonHighlight();
- FX_BOOL GetButtonRollover(CFX_WideString& wsRollover, FX_BOOL& bRichText);
- FX_BOOL GetButtonDown(CFX_WideString& wsDown, FX_BOOL& bRichText);
+ bool GetButtonRollover(CFX_WideString& wsRollover, bool& bRichText);
+ bool GetButtonDown(CFX_WideString& wsDown, bool& bRichText);
int32_t GetCheckButtonShape();
int32_t GetCheckButtonMark();
FX_FLOAT GetCheckButtonSize();
- FX_BOOL IsAllowNeutral();
- FX_BOOL IsRadioButton();
+ bool IsAllowNeutral();
+ bool IsRadioButton();
XFA_CHECKSTATE GetCheckState();
void SetCheckState(XFA_CHECKSTATE eCheckState, bool bNotify);
CXFA_Node* GetExclGroupNode();
@@ -85,83 +85,82 @@ class CXFA_WidgetData : public CXFA_Data {
CXFA_Node* SetSelectedMember(const CFX_WideStringC& wsName, bool bNotify);
void SetSelectedMemberByValue(const CFX_WideStringC& wsValue,
bool bNotify,
- FX_BOOL bScriptModify,
- FX_BOOL bSyncData);
+ bool bScriptModify,
+ bool bSyncData);
CXFA_Node* GetExclGroupFirstMember();
CXFA_Node* GetExclGroupNextMember(CXFA_Node* pNode);
int32_t GetChoiceListCommitOn();
- FX_BOOL IsChoiceListAllowTextEntry();
+ bool IsChoiceListAllowTextEntry();
int32_t GetChoiceListOpen();
- FX_BOOL IsListBox();
- int32_t CountChoiceListItems(FX_BOOL bSaveValue = FALSE);
- FX_BOOL GetChoiceListItem(CFX_WideString& wsText,
- int32_t nIndex,
- FX_BOOL bSaveValue = FALSE);
+ bool IsListBox();
+ int32_t CountChoiceListItems(bool bSaveValue = false);
+ bool GetChoiceListItem(CFX_WideString& wsText,
+ int32_t nIndex,
+ bool bSaveValue = false);
void GetChoiceListItems(CFX_WideStringArray& wsTextArray,
- FX_BOOL bSaveValue = FALSE);
+ bool bSaveValue = false);
int32_t CountSelectedItems();
int32_t GetSelectedItem(int32_t nIndex = 0);
void GetSelectedItems(CFX_Int32Array& iSelArray);
void GetSelectedItemsValue(CFX_WideStringArray& wsSelTextArray);
- FX_BOOL GetItemState(int32_t nIndex);
+ bool GetItemState(int32_t nIndex);
void SetItemState(int32_t nIndex,
- FX_BOOL bSelected,
+ bool bSelected,
bool bNotify,
- FX_BOOL bScriptModify,
- FX_BOOL bSyncData);
+ bool bScriptModify,
+ bool bSyncData);
void SetSelectedItems(CFX_Int32Array& iSelArray,
bool bNotify,
- FX_BOOL bScriptModify,
- FX_BOOL bSyncData);
+ bool bScriptModify,
+ bool bSyncData);
void ClearAllSelections();
void InsertItem(const CFX_WideString& wsLabel,
const CFX_WideString& wsValue,
int32_t nIndex = -1,
- FX_BOOL bNotify = FALSE);
+ bool bNotify = false);
void GetItemLabel(const CFX_WideStringC& wsValue, CFX_WideString& wsLabel);
void GetItemValue(const CFX_WideStringC& wsLabel, CFX_WideString& wsValue);
- FX_BOOL DeleteItem(int32_t nIndex,
- FX_BOOL bNotify = FALSE,
- FX_BOOL bScriptModify = FALSE,
- FX_BOOL bSyncData = TRUE);
+ bool DeleteItem(int32_t nIndex,
+ bool bNotify = false,
+ bool bScriptModify = false,
+ bool bSyncData = true);
int32_t GetHorizontalScrollPolicy();
int32_t GetNumberOfCells();
- FX_BOOL SetValue(const CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType);
- FX_BOOL GetPictureContent(CFX_WideString& wsPicture,
- XFA_VALUEPICTURE ePicture);
+ bool SetValue(const CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType);
+ bool GetPictureContent(CFX_WideString& wsPicture, XFA_VALUEPICTURE ePicture);
IFX_Locale* GetLocal();
- FX_BOOL GetValue(CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType);
- FX_BOOL GetNormalizeDataValue(const CFX_WideString& wsValue,
- CFX_WideString& wsNormalizeValue);
- FX_BOOL GetFormatDataValue(const CFX_WideString& wsValue,
- CFX_WideString& wsFormattedValue);
+ bool GetValue(CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType);
+ bool GetNormalizeDataValue(const CFX_WideString& wsValue,
+ CFX_WideString& wsNormalizeValue);
+ bool GetFormatDataValue(const CFX_WideString& wsValue,
+ CFX_WideString& wsFormattedValue);
void NormalizeNumStr(const CFX_WideString& wsValue, CFX_WideString& wsOutput);
CFX_WideString GetBarcodeType();
- FX_BOOL GetBarcodeAttribute_CharEncoding(int32_t& val);
- FX_BOOL GetBarcodeAttribute_Checksum(FX_BOOL& val);
- FX_BOOL GetBarcodeAttribute_DataLength(int32_t& val);
- FX_BOOL GetBarcodeAttribute_StartChar(FX_CHAR& val);
- FX_BOOL GetBarcodeAttribute_EndChar(FX_CHAR& val);
- FX_BOOL GetBarcodeAttribute_ECLevel(int32_t& val);
- FX_BOOL GetBarcodeAttribute_ModuleWidth(int32_t& val);
- FX_BOOL GetBarcodeAttribute_ModuleHeight(int32_t& val);
- FX_BOOL GetBarcodeAttribute_PrintChecksum(FX_BOOL& val);
- FX_BOOL GetBarcodeAttribute_TextLocation(int32_t& val);
- FX_BOOL GetBarcodeAttribute_Truncate(FX_BOOL& val);
- FX_BOOL GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val);
+ bool GetBarcodeAttribute_CharEncoding(int32_t& val);
+ bool GetBarcodeAttribute_Checksum(bool& val);
+ bool GetBarcodeAttribute_DataLength(int32_t& val);
+ bool GetBarcodeAttribute_StartChar(FX_CHAR& val);
+ bool GetBarcodeAttribute_EndChar(FX_CHAR& val);
+ bool GetBarcodeAttribute_ECLevel(int32_t& val);
+ bool GetBarcodeAttribute_ModuleWidth(int32_t& val);
+ bool GetBarcodeAttribute_ModuleHeight(int32_t& val);
+ bool GetBarcodeAttribute_PrintChecksum(bool& val);
+ bool GetBarcodeAttribute_TextLocation(int32_t& val);
+ bool GetBarcodeAttribute_Truncate(bool& val);
+ bool GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val);
void GetPasswordChar(CFX_WideString& wsPassWord);
- FX_BOOL IsMultiLine();
+ bool IsMultiLine();
int32_t GetVerticalScrollPolicy();
int32_t GetMaxChars(XFA_Element& eType);
- FX_BOOL GetFracDigits(int32_t& iFracDigits);
- FX_BOOL GetLeadDigits(int32_t& iLeadDigits);
+ bool GetFracDigits(int32_t& iFracDigits);
+ bool GetLeadDigits(int32_t& iLeadDigits);
CFX_WideString NumericLimit(const CFX_WideString& wsValue,
int32_t iLead,
int32_t iTread) const;
- FX_BOOL m_bIsNull;
- FX_BOOL m_bPreNull;
+ bool m_bIsNull;
+ bool m_bPreNull;
protected:
void SyncValue(const CFX_WideString& wsValue, bool bNotify);
diff --git a/xfa/fxfa/parser/cxfa_xml_parser.cpp b/xfa/fxfa/parser/cxfa_xml_parser.cpp
index 654a449a88..70e0d7cc9e 100644
--- a/xfa/fxfa/parser/cxfa_xml_parser.cpp
+++ b/xfa/fxfa/parser/cxfa_xml_parser.cpp
@@ -23,7 +23,7 @@ CXFA_XMLParser::CXFA_XMLParser(CFDE_XMLNode* pRoot, IFX_Stream* pStream)
}
CXFA_XMLParser::~CXFA_XMLParser() {
- m_NodeStack.RemoveAll(FALSE);
+ m_NodeStack.RemoveAll(false);
m_ws1.clear();
m_ws2.clear();
}
@@ -39,7 +39,7 @@ int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) {
return 100;
int32_t iCount = 0;
- while (TRUE) {
+ while (true) {
m_syntaxParserResult = m_pParser->DoSyntaxParse();
switch (m_syntaxParserResult) {
case FDE_XmlSyntaxResult::InstructionOpen:
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
index a0ff81405d..1fc9530e09 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -37,12 +37,12 @@ struct RecurseRecord {
CXFA_Node* pDataChild;
};
-FX_BOOL GetOccurInfo(CXFA_Node* pOccurNode,
- int32_t& iMin,
- int32_t& iMax,
- int32_t& iInit) {
+bool GetOccurInfo(CXFA_Node* pOccurNode,
+ int32_t& iMin,
+ int32_t& iMax,
+ int32_t& iInit) {
if (!pOccurNode)
- return FALSE;
+ return false;
CXFA_Occur occur(pOccurNode);
return occur.GetOccurInfo(iMin, iMax, iInit);
@@ -64,17 +64,16 @@ void FormValueNode_MatchNoneCreateChild(CXFA_Node* pFormNode) {
pWidgetData->GetUIType();
}
-FX_BOOL FormValueNode_SetChildContent(
- CXFA_Node* pValueNode,
- const CFX_WideString& wsContent,
- XFA_Element iType = XFA_Element::Unknown) {
+bool FormValueNode_SetChildContent(CXFA_Node* pValueNode,
+ const CFX_WideString& wsContent,
+ XFA_Element iType = XFA_Element::Unknown) {
if (!pValueNode)
- return FALSE;
+ return false;
ASSERT(pValueNode->GetPacketID() == XFA_XDPPACKET_Form);
CXFA_Node* pChildNode = FormValueNode_CreateChild(pValueNode, iType);
if (!pChildNode)
- return FALSE;
+ return false;
switch (pChildNode->GetObjectType()) {
case XFA_ObjectType::ContentNode: {
@@ -85,7 +84,7 @@ FX_BOOL FormValueNode_SetChildContent(
if (pChildNode->GetElementType() == XFA_Element::ExData) {
CFX_WideString wsContentType;
pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType,
- FALSE);
+ false);
if (wsContentType == FX_WSTRC(L"text/html"))
element = XFA_Element::SharpxHTML;
else if (wsContentType == FX_WSTRC(L"text/xml"))
@@ -104,15 +103,15 @@ FX_BOOL FormValueNode_SetChildContent(
break;
}
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
- return TRUE;
+ return true;
}
void CreateDataBinding(CXFA_Node* pFormNode,
CXFA_Node* pDataNode,
- FX_BOOL bDataToForm) {
+ bool bDataToForm) {
pFormNode->SetObject(XFA_ATTRIBUTE_BindingNode, pDataNode);
pDataNode->AddBindItem(pFormNode);
XFA_Element eType = pFormNode->GetElementType();
@@ -322,7 +321,7 @@ void CreateDataBinding(CXFA_Node* pFormNode,
break;
case XFA_Element::ExclGroup: {
pWidgetData->SetSelectedMemberByValue(wsNormalizeValue.AsStringC(), false,
- FALSE, FALSE);
+ false, false);
break;
}
case XFA_Element::DateTimeEdit:
@@ -368,7 +367,7 @@ void RegisterGlobalBinding(CXFA_Document* pDocument,
CXFA_Node* ScopeMatchGlobalBinding(CXFA_Node* pDataScope,
uint32_t dwNameHash,
XFA_Element eMatchDataNodeType,
- FX_BOOL bUpLevel) {
+ bool bUpLevel) {
for (CXFA_Node *pCurDataScope = pDataScope, *pLastDataScope = nullptr;
pCurDataScope && pCurDataScope->GetPacketID() == XFA_XDPPACKET_Datasets;
pLastDataScope = pCurDataScope,
@@ -391,7 +390,7 @@ CXFA_Node* ScopeMatchGlobalBinding(CXFA_Node* pDataScope,
pDataChild; pDataChild = pDataChild->GetNextSameClassSibling(
XFA_Element::DataGroup)) {
CXFA_Node* pDataNode = ScopeMatchGlobalBinding(pDataChild, dwNameHash,
- eMatchDataNodeType, FALSE);
+ eMatchDataNodeType, false);
if (pDataNode)
return pDataNode;
}
@@ -412,7 +411,7 @@ CXFA_Node* FindGlobalDataNode(CXFA_Document* pDocument,
CXFA_Node* pBounded = GetGlobalBinding(pDocument, dwNameHash);
if (!pBounded) {
pBounded =
- ScopeMatchGlobalBinding(pDataScope, dwNameHash, eMatchNodeType, TRUE);
+ ScopeMatchGlobalBinding(pDataScope, dwNameHash, eMatchNodeType, true);
if (pBounded)
RegisterGlobalBinding(pDocument, dwNameHash, pBounded);
}
@@ -451,8 +450,8 @@ CXFA_Node* FindDataRefDataNode(CXFA_Document* pDocument,
CXFA_Node* pDataScope,
XFA_Element eMatchNodeType,
CXFA_Node* pTemplateNode,
- FX_BOOL bForceBind,
- FX_BOOL bUpLevel) {
+ bool bForceBind,
+ bool bUpLevel) {
uint32_t dFlags = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_BindNew;
if (bUpLevel || wsRef != FX_WSTRC(L"name"))
dFlags |= (XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings);
@@ -474,18 +473,17 @@ CXFA_Node* FindDataRefDataNode(CXFA_Document* pDocument,
return nullptr;
}
-FX_BOOL NeedGenerateForm(CXFA_Node* pTemplateChild,
- FX_BOOL bUseInstanceManager) {
+bool NeedGenerateForm(CXFA_Node* pTemplateChild, bool bUseInstanceManager) {
XFA_Element eType = pTemplateChild->GetElementType();
if (eType == XFA_Element::Variables)
- return TRUE;
+ return true;
if (pTemplateChild->IsContainerNode())
- return FALSE;
+ return false;
if (eType == XFA_Element::Proto ||
(bUseInstanceManager && eType == XFA_Element::Occur)) {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
CXFA_Node* CloneOrMergeInstanceManager(CXFA_Document* pDocument,
@@ -541,17 +539,17 @@ CXFA_Node* FindMatchingDataNode(
CXFA_Document* pDocument,
CXFA_Node* pTemplateNode,
CXFA_Node* pDataScope,
- FX_BOOL& bAccessedDataDOM,
- FX_BOOL bForceBind,
+ bool& bAccessedDataDOM,
+ bool bForceBind,
CXFA_NodeIteratorTemplate<CXFA_Node,
CXFA_TraverseStrategy_XFAContainerNode>*
pIterator,
- FX_BOOL& bSelfMatch,
+ bool& bSelfMatch,
XFA_ATTRIBUTEENUM& eBindMatch,
- FX_BOOL bUpLevel) {
- FX_BOOL bOwnIterator = FALSE;
+ bool bUpLevel) {
+ bool bOwnIterator = false;
if (!pIterator) {
- bOwnIterator = TRUE;
+ bOwnIterator = true;
pIterator = new CXFA_NodeIteratorTemplate<
CXFA_Node, CXFA_TraverseStrategy_XFAContainerNode>(pTemplateNode);
}
@@ -596,7 +594,7 @@ CXFA_Node* FindMatchingDataNode(
pCurTemplateNode = pIterator->MoveToNext();
continue;
case XFA_ATTRIBUTEENUM_Global:
- bAccessedDataDOM = TRUE;
+ bAccessedDataDOM = true;
if (!bForceBind) {
pCurTemplateNode = pIterator->MoveToNext();
continue;
@@ -615,7 +613,7 @@ CXFA_Node* FindMatchingDataNode(
break;
}
case XFA_ATTRIBUTEENUM_Once: {
- bAccessedDataDOM = TRUE;
+ bAccessedDataDOM = true;
CXFA_Node* pOnceBindNode = FindOnceDataNode(
pDocument, pCurTemplateNode->GetCData(XFA_ATTRIBUTE_Name),
pDataScope, eMatchNodeType);
@@ -627,7 +625,7 @@ CXFA_Node* FindMatchingDataNode(
break;
}
case XFA_ATTRIBUTEENUM_DataRef: {
- bAccessedDataDOM = TRUE;
+ bAccessedDataDOM = true;
CXFA_Node* pDataRefBindNode = FindDataRefDataNode(
pDocument, pTemplateNodeBind->GetCData(XFA_ATTRIBUTE_Ref),
pDataScope, eMatchNodeType, pTemplateNode, bForceBind, bUpLevel);
@@ -645,7 +643,7 @@ CXFA_Node* FindMatchingDataNode(
break;
}
if (pCurTemplateNode == pTemplateNode && pResult)
- bSelfMatch = TRUE;
+ bSelfMatch = true;
break;
}
if (bOwnIterator)
@@ -655,7 +653,7 @@ CXFA_Node* FindMatchingDataNode(
void SortRecurseRecord(CFX_ArrayTemplate<RecurseRecord>& rgRecords,
CXFA_Node* pDataScope,
- FX_BOOL bChoiceMode) {
+ bool bChoiceMode) {
int32_t iCount = rgRecords.GetSize();
CFX_ArrayTemplate<RecurseRecord> rgResultRecord;
for (CXFA_Node* pChildNode = pDataScope->GetNodeItem(XFA_NODEITEM_FirstChild);
@@ -692,12 +690,12 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
CXFA_Node* pTemplateNode,
CXFA_Node* pFormParentNode,
CXFA_Node* pDataScope,
- FX_BOOL bOneInstance,
- FX_BOOL bDataMerge) {
+ bool bOneInstance,
+ bool bDataMerge) {
XFA_Element eType = pTemplateNode->GetElementType();
CXFA_Node* pOccurNode = nullptr;
CXFA_Node* pFirstInstance = nullptr;
- FX_BOOL bUseInstanceManager =
+ bool bUseInstanceManager =
pFormParentNode->GetElementType() != XFA_Element::Area;
CXFA_Node* pInstMgrNode = nullptr;
CXFA_NodeArray subformArray;
@@ -712,7 +710,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
pTemplateNode->GetFirstChildByClass(XFA_Element::Occur)) {
pOccurNode = pInstMgrNode ? XFA_NodeMerge_CloneOrMergeContainer(
pDocument, pInstMgrNode,
- pOccurTemplateNode, FALSE, nullptr)
+ pOccurTemplateNode, false, nullptr)
: pOccurTemplateNode;
} else if (pInstMgrNode) {
pOccurNode = pInstMgrNode->GetFirstChildByClass(XFA_Element::Occur);
@@ -723,7 +721,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
pInstMgrNode->SetFlag(XFA_NodeFlag_Initialized, true);
pSearchArray = &subformArray;
if (pFormParentNode->GetElementType() == XFA_Element::PageArea) {
- bOneInstance = TRUE;
+ bOneInstance = true;
if (subformArray.GetSize() < 1)
pSearchArray = nullptr;
} else if ((pTemplateNode->GetNameHash() == 0) &&
@@ -748,28 +746,28 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
if (bDataMerge) {
CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_XFAContainerNode>
sNodeIterator(pTemplateNode);
- FX_BOOL bAccessedDataDOM = FALSE;
+ bool bAccessedDataDOM = false;
if (eType == XFA_Element::SubformSet || eType == XFA_Element::Area) {
sNodeIterator.MoveToNext();
} else {
CFX_MapPtrTemplate<CXFA_Node*, CXFA_Node*> subformMapArray;
CXFA_NodeArray nodeArray;
for (; iMax < 0 || iCurRepeatIndex < iMax; iCurRepeatIndex++) {
- FX_BOOL bSelfMatch = FALSE;
+ bool bSelfMatch = false;
XFA_ATTRIBUTEENUM eBindMatch = XFA_ATTRIBUTEENUM_None;
CXFA_Node* pDataNode = FindMatchingDataNode(
- pDocument, pTemplateNode, pDataScope, bAccessedDataDOM, FALSE,
- &sNodeIterator, bSelfMatch, eBindMatch, TRUE);
+ pDocument, pTemplateNode, pDataScope, bAccessedDataDOM, false,
+ &sNodeIterator, bSelfMatch, eBindMatch, true);
if (!pDataNode || sNodeIterator.GetCurrent() != pTemplateNode)
break;
eParentBindMatch = eBindMatch;
CXFA_Node* pSubformNode = XFA_NodeMerge_CloneOrMergeContainer(
- pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray);
+ pDocument, pFormParentNode, pTemplateNode, false, pSearchArray);
if (!pFirstInstance)
pFirstInstance = pSubformNode;
- CreateDataBinding(pSubformNode, pDataNode, TRUE);
+ CreateDataBinding(pSubformNode, pDataNode, true);
ASSERT(pSubformNode);
subformMapArray.SetAt(pSubformNode, pDataNode);
nodeArray.Add(pSubformNode);
@@ -786,10 +784,10 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
XFA_NODEITEM_NextSibling)) {
if (NeedGenerateForm(pTemplateChild, bUseInstanceManager)) {
XFA_NodeMerge_CloneOrMergeContainer(pDocument, pSubform,
- pTemplateChild, TRUE, nullptr);
+ pTemplateChild, true, nullptr);
} else if (pTemplateChild->IsContainerNode()) {
pDocument->DataMerge_CopyContainer(pTemplateChild, pSubform,
- pDataNode, FALSE, TRUE, FALSE);
+ pDataNode, false, true, false);
}
}
}
@@ -797,11 +795,11 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
}
for (; iMax < 0 || iCurRepeatIndex < iMax; iCurRepeatIndex++) {
- FX_BOOL bSelfMatch = FALSE;
+ bool bSelfMatch = false;
XFA_ATTRIBUTEENUM eBindMatch = XFA_ATTRIBUTEENUM_None;
if (!FindMatchingDataNode(pDocument, pTemplateNode, pDataScope,
- bAccessedDataDOM, FALSE, &sNodeIterator,
- bSelfMatch, eBindMatch, TRUE)) {
+ bAccessedDataDOM, false, &sNodeIterator,
+ bSelfMatch, eBindMatch, true)) {
break;
}
if (eBindMatch == XFA_ATTRIBUTEENUM_DataRef &&
@@ -812,7 +810,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
if (eRelation == XFA_ATTRIBUTEENUM_Choice ||
eRelation == XFA_ATTRIBUTEENUM_Unordered) {
CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer(
- pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray);
+ pDocument, pFormParentNode, pTemplateNode, false, pSearchArray);
ASSERT(pSubformSetNode);
if (!pFirstInstance)
pFirstInstance = pSubformSetNode;
@@ -825,14 +823,14 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
XFA_NODEITEM_NextSibling)) {
if (NeedGenerateForm(pTemplateChild, bUseInstanceManager)) {
XFA_NodeMerge_CloneOrMergeContainer(pDocument, pSubformSetNode,
- pTemplateChild, TRUE, nullptr);
+ pTemplateChild, true, nullptr);
} else if (pTemplateChild->IsContainerNode()) {
- bSelfMatch = FALSE;
+ bSelfMatch = false;
eBindMatch = XFA_ATTRIBUTEENUM_None;
if (eRelation != XFA_ATTRIBUTEENUM_Ordered) {
CXFA_Node* pDataMatch = FindMatchingDataNode(
pDocument, pTemplateChild, pDataScope, bAccessedDataDOM,
- FALSE, nullptr, bSelfMatch, eBindMatch, TRUE);
+ false, nullptr, bSelfMatch, eBindMatch, true);
if (pDataMatch) {
RecurseRecord sNewRecord = {pTemplateChild, pDataMatch};
if (bSelfMatch)
@@ -851,27 +849,27 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
switch (eRelation) {
case XFA_ATTRIBUTEENUM_Choice: {
ASSERT(rgItemMatchList.GetSize());
- SortRecurseRecord(rgItemMatchList, pDataScope, TRUE);
+ SortRecurseRecord(rgItemMatchList, pDataScope, true);
pDocument->DataMerge_CopyContainer(
rgItemMatchList[0].pTemplateChild, pSubformSetNode, pDataScope,
- FALSE, TRUE, TRUE);
+ false, true, true);
break;
}
case XFA_ATTRIBUTEENUM_Unordered: {
if (rgItemMatchList.GetSize()) {
- SortRecurseRecord(rgItemMatchList, pDataScope, FALSE);
+ SortRecurseRecord(rgItemMatchList, pDataScope, false);
for (int32_t i = 0, count = rgItemMatchList.GetSize(); i < count;
i++) {
pDocument->DataMerge_CopyContainer(
rgItemMatchList[i].pTemplateChild, pSubformSetNode,
- pDataScope, FALSE, TRUE, TRUE);
+ pDataScope, false, true, true);
}
}
for (int32_t i = 0, count = rgItemUnmatchList.GetSize(); i < count;
i++) {
pDocument->DataMerge_CopyContainer(rgItemUnmatchList[i],
pSubformSetNode, pDataScope,
- FALSE, TRUE, TRUE);
+ false, true, true);
}
break;
}
@@ -880,7 +878,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
}
} else {
CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer(
- pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray);
+ pDocument, pFormParentNode, pTemplateNode, false, pSearchArray);
ASSERT(pSubformSetNode);
if (!pFirstInstance)
pFirstInstance = pSubformSetNode;
@@ -891,16 +889,16 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
XFA_NODEITEM_NextSibling)) {
if (NeedGenerateForm(pTemplateChild, bUseInstanceManager)) {
XFA_NodeMerge_CloneOrMergeContainer(pDocument, pSubformSetNode,
- pTemplateChild, TRUE, nullptr);
+ pTemplateChild, true, nullptr);
} else if (pTemplateChild->IsContainerNode()) {
pDocument->DataMerge_CopyContainer(pTemplateChild, pSubformSetNode,
- pDataScope, FALSE, TRUE, TRUE);
+ pDataScope, false, true, true);
}
}
}
}
- if (iCurRepeatIndex == 0 && bAccessedDataDOM == FALSE) {
+ if (iCurRepeatIndex == 0 && bAccessedDataDOM == false) {
int32_t iLimit = iMax;
if (pInstMgrNode && pTemplateNode->GetNameHash() == 0) {
iLimit = subformArray.GetSize();
@@ -921,7 +919,7 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
break;
}
CXFA_Node* pSubformNode = XFA_NodeMerge_CloneOrMergeContainer(
- pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray);
+ pDocument, pFormParentNode, pTemplateNode, false, pSearchArray);
ASSERT(pSubformNode);
if (!pFirstInstance)
pFirstInstance = pSubformNode;
@@ -932,10 +930,10 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
XFA_NODEITEM_NextSibling)) {
if (NeedGenerateForm(pTemplateChild, bUseInstanceManager)) {
XFA_NodeMerge_CloneOrMergeContainer(pDocument, pSubformNode,
- pTemplateChild, TRUE, nullptr);
+ pTemplateChild, true, nullptr);
} else if (pTemplateChild->IsContainerNode()) {
pDocument->DataMerge_CopyContainer(pTemplateChild, pSubformNode,
- pDataScope, FALSE, TRUE, TRUE);
+ pDataScope, false, true, true);
}
}
}
@@ -945,26 +943,26 @@ CXFA_Node* CopyContainer_SubformSet(CXFA_Document* pDocument,
int32_t iMinimalLimit = iCurRepeatIndex == 0 ? iInit : iMin;
for (; iCurRepeatIndex < iMinimalLimit; iCurRepeatIndex++) {
CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer(
- pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray);
+ pDocument, pFormParentNode, pTemplateNode, false, pSearchArray);
ASSERT(pSubformSetNode);
if (!pFirstInstance)
pFirstInstance = pSubformSetNode;
- FX_BOOL bFound = FALSE;
+ bool bFound = false;
for (CXFA_Node* pTemplateChild =
pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild);
pTemplateChild; pTemplateChild = pTemplateChild->GetNodeItem(
XFA_NODEITEM_NextSibling)) {
if (NeedGenerateForm(pTemplateChild, bUseInstanceManager)) {
XFA_NodeMerge_CloneOrMergeContainer(pDocument, pSubformSetNode,
- pTemplateChild, TRUE, nullptr);
+ pTemplateChild, true, nullptr);
} else if (pTemplateChild->IsContainerNode()) {
if (bFound && eRelation == XFA_ATTRIBUTEENUM_Choice)
continue;
pDocument->DataMerge_CopyContainer(pTemplateChild, pSubformSetNode,
- pDataScope, FALSE, bDataMerge, TRUE);
- bFound = TRUE;
+ pDataScope, false, bDataMerge, true);
+ bFound = true;
}
}
}
@@ -975,35 +973,35 @@ CXFA_Node* CopyContainer_Field(CXFA_Document* pDocument,
CXFA_Node* pTemplateNode,
CXFA_Node* pFormNode,
CXFA_Node* pDataScope,
- FX_BOOL bDataMerge,
- FX_BOOL bUpLevel) {
+ bool bDataMerge,
+ bool bUpLevel) {
CXFA_Node* pFieldNode = XFA_NodeMerge_CloneOrMergeContainer(
- pDocument, pFormNode, pTemplateNode, FALSE, nullptr);
+ pDocument, pFormNode, pTemplateNode, false, nullptr);
ASSERT(pFieldNode);
for (CXFA_Node* pTemplateChildNode =
pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild);
pTemplateChildNode; pTemplateChildNode = pTemplateChildNode->GetNodeItem(
XFA_NODEITEM_NextSibling)) {
- if (NeedGenerateForm(pTemplateChildNode, TRUE)) {
+ if (NeedGenerateForm(pTemplateChildNode, true)) {
XFA_NodeMerge_CloneOrMergeContainer(pDocument, pFieldNode,
- pTemplateChildNode, TRUE, nullptr);
+ pTemplateChildNode, true, nullptr);
} else if (pTemplateNode->GetElementType() == XFA_Element::ExclGroup &&
pTemplateChildNode->IsContainerNode()) {
if (pTemplateChildNode->GetElementType() == XFA_Element::Field) {
CopyContainer_Field(pDocument, pTemplateChildNode, pFieldNode, nullptr,
- FALSE, TRUE);
+ false, true);
}
}
}
if (bDataMerge) {
- FX_BOOL bAccessedDataDOM = FALSE;
- FX_BOOL bSelfMatch = FALSE;
+ bool bAccessedDataDOM = false;
+ bool bSelfMatch = false;
XFA_ATTRIBUTEENUM eBindMatch;
CXFA_Node* pDataNode = FindMatchingDataNode(
- pDocument, pTemplateNode, pDataScope, bAccessedDataDOM, TRUE, nullptr,
+ pDocument, pTemplateNode, pDataScope, bAccessedDataDOM, true, nullptr,
bSelfMatch, eBindMatch, bUpLevel);
if (pDataNode)
- CreateDataBinding(pFieldNode, pDataNode, TRUE);
+ CreateDataBinding(pFieldNode, pDataNode, true);
} else {
FormValueNode_MatchNoneCreateChild(pFieldNode);
}
@@ -1068,9 +1066,9 @@ CXFA_Node* MaybeCreateDataNode(CXFA_Document* pDocument,
void UpdateBindingRelations(CXFA_Document* pDocument,
CXFA_Node* pFormNode,
CXFA_Node* pDataScope,
- FX_BOOL bDataRef,
- FX_BOOL bParentDataRef) {
- FX_BOOL bMatchRef = TRUE;
+ bool bDataRef,
+ bool bParentDataRef) {
+ bool bMatchRef = true;
XFA_Element eType = pFormNode->GetElementType();
CXFA_Node* pDataNode = pFormNode->GetBindData();
if (eType == XFA_Element::Subform || eType == XFA_Element::ExclGroup ||
@@ -1101,7 +1099,7 @@ void UpdateBindingRelations(CXFA_Document* pDocument,
pDocument, pDataScope, eDataNodeType,
CFX_WideString(pFormNode->GetCData(XFA_ATTRIBUTE_Name)));
if (pDataNode)
- CreateDataBinding(pFormNode, pDataNode, FALSE);
+ CreateDataBinding(pFormNode, pDataNode, false);
}
if (!pDataNode)
FormValueNode_MatchNoneCreateChild(pFormNode);
@@ -1133,12 +1131,12 @@ void UpdateBindingRelations(CXFA_Document* pDocument,
pDocument, pRecordNode, eDataNodeType,
CFX_WideString(pFormNode->GetCData(XFA_ATTRIBUTE_Name)));
if (pDataNode) {
- CreateDataBinding(pFormNode, pDataNode, FALSE);
+ CreateDataBinding(pFormNode, pDataNode, false);
RegisterGlobalBinding(pDocument, pFormNode->GetNameHash(),
pDataNode);
}
} else {
- CreateDataBinding(pFormNode, pDataNode, TRUE);
+ CreateDataBinding(pFormNode, pDataNode, true);
}
}
if (!pDataNode)
@@ -1147,7 +1145,7 @@ void UpdateBindingRelations(CXFA_Document* pDocument,
break;
case XFA_ATTRIBUTEENUM_DataRef: {
bMatchRef = bDataRef;
- bParentDataRef = TRUE;
+ bParentDataRef = true;
if (!pDataNode && bDataRef) {
CFX_WideStringC wsRef =
pTemplateNodeBind->GetCData(XFA_ATTRIBUTE_Ref);
@@ -1249,7 +1247,7 @@ CXFA_Node* XFA_DataMerge_FindFormDOMInstance(CXFA_Document* pDocument,
CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument,
CXFA_Node* pFormParent,
CXFA_Node* pTemplateNode,
- FX_BOOL bRecursive,
+ bool bRecursive,
CXFA_NodeArray* pSubformArray) {
CXFA_Node* pExistingNode = nullptr;
if (!pSubformArray) {
@@ -1275,7 +1273,7 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument,
pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild);
pTemplateChild; pTemplateChild = pTemplateChild->GetNodeItem(
XFA_NODEITEM_NextSibling)) {
- if (NeedGenerateForm(pTemplateChild, TRUE)) {
+ if (NeedGenerateForm(pTemplateChild, true)) {
XFA_NodeMerge_CloneOrMergeContainer(
pDocument, pExistingNode, pTemplateChild, bRecursive, nullptr);
}
@@ -1285,15 +1283,15 @@ CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument,
return pExistingNode;
}
- CXFA_Node* pNewNode = pTemplateNode->CloneTemplateToForm(FALSE);
+ CXFA_Node* pNewNode = pTemplateNode->CloneTemplateToForm(false);
pFormParent->InsertChild(pNewNode, nullptr);
if (bRecursive) {
for (CXFA_Node* pTemplateChild =
pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild);
pTemplateChild; pTemplateChild = pTemplateChild->GetNodeItem(
XFA_NODEITEM_NextSibling)) {
- if (NeedGenerateForm(pTemplateChild, TRUE)) {
- CXFA_Node* pNewChild = pTemplateChild->CloneTemplateToForm(TRUE);
+ if (NeedGenerateForm(pTemplateChild, true)) {
+ CXFA_Node* pNewChild = pTemplateChild->CloneTemplateToForm(true);
pNewNode->InsertChild(pNewChild, nullptr);
}
}
@@ -1316,9 +1314,9 @@ CXFA_Node* XFA_DataMerge_FindDataScope(CXFA_Node* pParentFormNode) {
CXFA_Node* CXFA_Document::DataMerge_CopyContainer(CXFA_Node* pTemplateNode,
CXFA_Node* pFormNode,
CXFA_Node* pDataScope,
- FX_BOOL bOneInstance,
- FX_BOOL bDataMerge,
- FX_BOOL bUpLevel) {
+ bool bOneInstance,
+ bool bDataMerge,
+ bool bUpLevel) {
switch (pTemplateNode->GetElementType()) {
case XFA_Element::SubformSet:
case XFA_Element::Subform:
@@ -1336,7 +1334,7 @@ CXFA_Node* CXFA_Document::DataMerge_CopyContainer(CXFA_Node* pTemplateNode,
case XFA_Element::Variables:
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
return nullptr;
@@ -1349,8 +1347,8 @@ void CXFA_Document::DataMerge_UpdateBindingRelations(
if (!pDataScope)
return;
- UpdateBindingRelations(this, pFormUpdateRoot, pDataScope, FALSE, FALSE);
- UpdateBindingRelations(this, pFormUpdateRoot, pDataScope, TRUE, FALSE);
+ UpdateBindingRelations(this, pFormUpdateRoot, pDataScope, false, false);
+ UpdateBindingRelations(this, pFormUpdateRoot, pDataScope, true, false);
}
CXFA_Node* CXFA_Document::GetNotBindNode(CXFA_ObjArray& arrayNodes) {
@@ -1427,9 +1425,9 @@ void CXFA_Document::DoDataMerge() {
return;
CXFA_Node* pFormRoot = m_pRootNode->GetFirstChildByClass(XFA_Element::Form);
- FX_BOOL bEmptyForm = FALSE;
+ bool bEmptyForm = false;
if (!pFormRoot) {
- bEmptyForm = TRUE;
+ bEmptyForm = true;
pFormRoot = CreateNode(XFA_XDPPACKET_Form, XFA_Element::Form);
ASSERT(pFormRoot);
pFormRoot->SetCData(XFA_ATTRIBUTE_Name, L"form");
@@ -1444,7 +1442,7 @@ void CXFA_Document::DoDataMerge() {
}
CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer(
- this, pFormRoot, pTemplateChosen, FALSE, nullptr);
+ this, pFormRoot, pTemplateChosen, false, nullptr);
ASSERT(pSubformSetNode);
if (!pDataTopLevel) {
CFX_WideStringC wsFormName = pSubformSetNode->GetCData(XFA_ATTRIBUTE_Name);
@@ -1461,17 +1459,17 @@ void CXFA_Document::DoDataMerge() {
}
ASSERT(pDataTopLevel);
- CreateDataBinding(pSubformSetNode, pDataTopLevel, TRUE);
+ CreateDataBinding(pSubformSetNode, pDataTopLevel, true);
for (CXFA_Node* pTemplateChild =
pTemplateChosen->GetNodeItem(XFA_NODEITEM_FirstChild);
pTemplateChild;
pTemplateChild = pTemplateChild->GetNodeItem(XFA_NODEITEM_NextSibling)) {
- if (NeedGenerateForm(pTemplateChild, TRUE)) {
+ if (NeedGenerateForm(pTemplateChild, true)) {
XFA_NodeMerge_CloneOrMergeContainer(this, pSubformSetNode, pTemplateChild,
- TRUE, nullptr);
+ true, nullptr);
} else if (pTemplateChild->IsContainerNode()) {
DataMerge_CopyContainer(pTemplateChild, pSubformSetNode, pDataTopLevel,
- FALSE, TRUE, TRUE);
+ false, true, true);
}
}
if (pDDRoot)
@@ -1513,7 +1511,7 @@ void CXFA_Document::DoDataMerge() {
}
}
-void CXFA_Document::DoDataRemerge(FX_BOOL bDoDataMerge) {
+void CXFA_Document::DoDataRemerge(bool bDoDataMerge) {
CXFA_Node* pFormRoot = ToNode(GetXFAObject(XFA_HASHCODE_Form));
if (pFormRoot) {
while (CXFA_Node* pNode = pFormRoot->GetNodeItem(XFA_NODEITEM_FirstChild))
@@ -1525,5 +1523,5 @@ void CXFA_Document::DoDataRemerge(FX_BOOL bDoDataMerge) {
DoDataMerge();
CXFA_LayoutProcessor* pLayoutProcessor = GetLayoutProcessor();
- pLayoutProcessor->SetForceReLayout(TRUE);
+ pLayoutProcessor->SetForceReLayout(true);
}
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.h b/xfa/fxfa/parser/xfa_document_datamerger_imp.h
index f97a7b43b9..f9ea087731 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.h
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.h
@@ -12,7 +12,7 @@
CXFA_Node* XFA_NodeMerge_CloneOrMergeContainer(CXFA_Document* pDocument,
CXFA_Node* pFormParent,
CXFA_Node* pTemplateNode,
- FX_BOOL bRecursive,
+ bool bRecursive,
CXFA_NodeArray* pSubformArray);
CXFA_Node* XFA_DataMerge_FindDataScope(CXFA_Node* pParentFormNode);
CXFA_Node* XFA_DataMerge_FindFormDOMInstance(CXFA_Document* pDocument,
diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
index 1f2e1ea089..6926a99309 100644
--- a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
+++ b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
@@ -33,7 +33,7 @@ int32_t SeparateStringW(const FX_WCHAR* pStr,
const FX_WCHAR* pToken = pStr;
const FX_WCHAR* pEnd = pStr + iStrLen;
- while (TRUE) {
+ while (true) {
if (pStr >= pEnd || delimiter == *pStr) {
CFX_WideString sub(pToken, pStr - pToken);
pieces.Add(sub);
@@ -50,8 +50,8 @@ int32_t SeparateStringW(const FX_WCHAR* pStr,
CXFA_ItemLayoutProcessor::CXFA_ItemLayoutProcessor(CXFA_Node* pNode,
CXFA_LayoutPageMgr* pPageMgr)
- : m_bKeepBreakFinish(FALSE),
- m_bIsProcessKeep(FALSE),
+ : m_bKeepBreakFinish(false),
+ m_bIsProcessKeep(false),
m_pKeepHeadNode(nullptr),
m_pKeepTailNode(nullptr),
m_pFormNode(pNode),
@@ -62,13 +62,13 @@ CXFA_ItemLayoutProcessor::CXFA_ItemLayoutProcessor(CXFA_Node* pNode,
m_nCurChildNodeStage(XFA_ItemLayoutProcessorStages_None),
m_fUsedSize(0),
m_pPageMgr(pPageMgr),
- m_bBreakPending(TRUE),
+ m_bBreakPending(true),
m_fLastRowWidth(0),
m_fLastRowY(0),
m_fWidthLimite(0),
- m_bUseInheriated(FALSE),
+ m_bUseInheriated(false),
m_ePreProcessRs(XFA_ItemLayoutProcessorResult_Done),
- m_bHasAvailHeight(TRUE) {
+ m_bHasAvailHeight(true) {
ASSERT(m_pFormNode && (m_pFormNode->IsContainerNode() ||
m_pFormNode->GetElementType() == XFA_Element::Form));
m_pOldLayoutItem =
@@ -104,19 +104,19 @@ CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::CreateContentLayoutItem(
}
return pLayoutItem;
}
-FX_BOOL CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos(
+bool CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos(
CXFA_ContentLayoutItem* pLayoutItem,
FX_FLOAT fCurVerticalOffset,
FX_FLOAT& fProposedSplitPos,
- FX_BOOL& bAppChange,
- FX_BOOL bCalculateMargin) {
+ bool& bAppChange,
+ bool bCalculateMargin) {
CXFA_Node* pFormNode = pLayoutItem->m_pFormNode;
if (fProposedSplitPos > fCurVerticalOffset + XFA_LAYOUT_FLOAT_PERCISION &&
fProposedSplitPos <= fCurVerticalOffset + pLayoutItem->m_sSize.y -
XFA_LAYOUT_FLOAT_PERCISION) {
switch (pFormNode->GetIntact()) {
case XFA_ATTRIBUTEENUM_None: {
- FX_BOOL bAnyChanged = FALSE;
+ bool bAnyChanged = false;
CXFA_Document* pDocument = pFormNode->GetDocument();
CXFA_FFNotify* pNotify = pDocument->GetNotify();
FX_FLOAT fCurTopMargin = 0, fCurBottomMargin = 0;
@@ -128,20 +128,20 @@ FX_BOOL CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos(
fCurBottomMargin = pMarginNode->GetMeasure(XFA_ATTRIBUTE_BottomInset)
.ToUnit(XFA_UNIT_Pt);
}
- FX_BOOL bChanged = TRUE;
+ bool bChanged = true;
while (bChanged) {
- bChanged = FALSE;
+ bChanged = false;
{
FX_FLOAT fRelSplitPos = fProposedSplitPos - fCurVerticalOffset;
if (pNotify->FindSplitPos(pFormNode, pLayoutItem->GetIndex(),
fRelSplitPos)) {
- bAnyChanged = TRUE;
- bChanged = TRUE;
+ bAnyChanged = true;
+ bChanged = true;
fProposedSplitPos = fCurVerticalOffset + fRelSplitPos;
- bAppChange = TRUE;
+ bAppChange = true;
if (fProposedSplitPos <=
fCurVerticalOffset + XFA_LAYOUT_FLOAT_PERCISION) {
- return TRUE;
+ return true;
}
}
}
@@ -153,7 +153,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos(
(CXFA_ContentLayoutItem*)pChildItem->m_pNextSibling) {
FX_FLOAT fChildOffset =
fCurVerticalOffset + fCurTopMargin + pChildItem->m_sPos.y;
- FX_BOOL bChange = FALSE;
+ bool bChange = false;
if (FindLayoutItemSplitPos(pChildItem, fChildOffset, fRelSplitPos,
bChange, bCalculateMargin)) {
if (fRelSplitPos - fChildOffset < XFA_LAYOUT_FLOAT_PERCISION &&
@@ -162,11 +162,11 @@ FX_BOOL CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos(
} else {
fProposedSplitPos = fRelSplitPos + fCurBottomMargin;
}
- bAnyChanged = TRUE;
- bChanged = TRUE;
+ bAnyChanged = true;
+ bChanged = true;
if (fProposedSplitPos <=
fCurVerticalOffset + XFA_LAYOUT_FLOAT_PERCISION) {
- return TRUE;
+ return true;
}
if (bAnyChanged) {
break;
@@ -179,32 +179,31 @@ FX_BOOL CXFA_ItemLayoutProcessor::FindLayoutItemSplitPos(
case XFA_ATTRIBUTEENUM_ContentArea:
case XFA_ATTRIBUTEENUM_PageArea: {
fProposedSplitPos = fCurVerticalOffset;
- return TRUE;
+ return true;
}
default:
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
-static XFA_ATTRIBUTEENUM XFA_ItemLayoutProcessor_GetLayout(
- CXFA_Node* pFormNode,
- FX_BOOL& bRootForceTb) {
- bRootForceTb = FALSE;
+static XFA_ATTRIBUTEENUM XFA_ItemLayoutProcessor_GetLayout(CXFA_Node* pFormNode,
+ bool& bRootForceTb) {
+ bRootForceTb = false;
XFA_ATTRIBUTEENUM eLayoutMode;
- if (pFormNode->TryEnum(XFA_ATTRIBUTE_Layout, eLayoutMode, FALSE)) {
+ if (pFormNode->TryEnum(XFA_ATTRIBUTE_Layout, eLayoutMode, false)) {
return eLayoutMode;
}
CXFA_Node* pParentNode = pFormNode->GetNodeItem(XFA_NODEITEM_Parent);
if (pParentNode && pParentNode->GetElementType() == XFA_Element::Form) {
- bRootForceTb = TRUE;
+ bRootForceTb = true;
return XFA_ATTRIBUTEENUM_Tb;
}
return XFA_ATTRIBUTEENUM_Position;
}
-static FX_BOOL XFA_ExistContainerKeep(CXFA_Node* pCurNode, FX_BOOL bPreFind) {
+static bool XFA_ExistContainerKeep(CXFA_Node* pCurNode, bool bPreFind) {
if (!pCurNode || !XFA_ItemLayoutProcessor_IsTakingSpace(pCurNode)) {
- return FALSE;
+ return false;
}
XFA_NODEITEM eItemType = XFA_NODEITEM_PrevSibling;
if (!bPreFind) {
@@ -213,7 +212,7 @@ static FX_BOOL XFA_ExistContainerKeep(CXFA_Node* pCurNode, FX_BOOL bPreFind) {
CXFA_Node* pPreContainer =
pCurNode->GetNodeItem(eItemType, XFA_ObjectType::ContainerNode);
if (!pPreContainer) {
- return FALSE;
+ return false;
}
CXFA_Node* pKeep = pCurNode->GetFirstChildByClass(XFA_Element::Keep);
if (pKeep) {
@@ -222,40 +221,40 @@ static FX_BOOL XFA_ExistContainerKeep(CXFA_Node* pCurNode, FX_BOOL bPreFind) {
if (!bPreFind) {
eKeepType = XFA_ATTRIBUTE_Next;
}
- if (pKeep->TryEnum(eKeepType, ePrevious, FALSE)) {
+ if (pKeep->TryEnum(eKeepType, ePrevious, false)) {
if (ePrevious == XFA_ATTRIBUTEENUM_ContentArea ||
ePrevious == XFA_ATTRIBUTEENUM_PageArea) {
- return TRUE;
+ return true;
}
}
}
pKeep = pPreContainer->GetFirstChildByClass(XFA_Element::Keep);
if (!pKeep) {
- return FALSE;
+ return false;
}
XFA_ATTRIBUTEENUM eNext;
XFA_ATTRIBUTE eKeepType = XFA_ATTRIBUTE_Next;
if (!bPreFind) {
eKeepType = XFA_ATTRIBUTE_Previous;
}
- if (!pKeep->TryEnum(eKeepType, eNext, FALSE)) {
- return FALSE;
+ if (!pKeep->TryEnum(eKeepType, eNext, false)) {
+ return false;
}
if (eNext == XFA_ATTRIBUTEENUM_ContentArea ||
eNext == XFA_ATTRIBUTEENUM_PageArea) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
FX_FLOAT CXFA_ItemLayoutProcessor::FindSplitPos(FX_FLOAT fProposedSplitPos) {
ASSERT(m_pLayoutItem);
XFA_ATTRIBUTEENUM eLayout = m_pFormNode->GetEnum(XFA_ATTRIBUTE_Layout);
- FX_BOOL bCalculateMargin = TRUE;
+ bool bCalculateMargin = true;
if (eLayout == XFA_ATTRIBUTEENUM_Position) {
- bCalculateMargin = FALSE;
+ bCalculateMargin = false;
}
while (fProposedSplitPos > XFA_LAYOUT_FLOAT_PERCISION) {
- FX_BOOL bAppChange = FALSE;
+ bool bAppChange = false;
if (!FindLayoutItemSplitPos(m_pLayoutItem, 0, fProposedSplitPos, bAppChange,
bCalculateMargin)) {
break;
@@ -269,9 +268,9 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem(
FX_FLOAT fSplitPos) {
FX_FLOAT fCurTopMargin = 0, fCurBottomMargin = 0;
XFA_ATTRIBUTEENUM eLayout = m_pFormNode->GetEnum(XFA_ATTRIBUTE_Layout);
- FX_BOOL bCalculateMargin = TRUE;
+ bool bCalculateMargin = true;
if (eLayout == XFA_ATTRIBUTEENUM_Position) {
- bCalculateMargin = FALSE;
+ bCalculateMargin = false;
}
CXFA_Node* pMarginNode =
pLayoutItem->m_pFormNode->GetFirstChildByClass(XFA_Element::Margin);
@@ -325,7 +324,7 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem(
pChildItem->m_pNextSibling = nullptr;
if (fSplitPos <= fCurTopMargin + pChildItem->m_sPos.y + fCurBottomMargin +
XFA_LAYOUT_FLOAT_PERCISION) {
- if (!XFA_ExistContainerKeep(pChildItem->m_pFormNode, TRUE)) {
+ if (!XFA_ExistContainerKeep(pChildItem->m_pFormNode, true)) {
pChildItem->m_sPos.y -= fSplitPos - fCurBottomMargin;
pChildItem->m_sPos.y += lHeightForKeep;
pChildItem->m_sPos.y += fAddMarginHeight;
@@ -360,7 +359,7 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem(
fCurTopMargin + fCurBottomMargin + pChildItem->m_sPos.y +
pChildItem->m_sSize.y) {
pLayoutItem->AddChild(pChildItem);
- if (XFA_ExistContainerKeep(pChildItem->m_pFormNode, FALSE)) {
+ if (XFA_ExistContainerKeep(pChildItem->m_pFormNode, false)) {
keepLayoutItems.Add(pChildItem);
} else {
keepLayoutItems.RemoveAll();
@@ -393,7 +392,7 @@ CXFA_Node* CXFA_LayoutItem::GetFormNode() const {
return m_pFormNode;
}
-void CXFA_LayoutItem::GetRect(CFX_RectF& rtLayout, FX_BOOL bRelative) const {
+void CXFA_LayoutItem::GetRect(CFX_RectF& rtLayout, bool bRelative) const {
ASSERT(m_bIsContentLayoutItem);
const CXFA_ContentLayoutItem* pThis =
static_cast<const CXFA_ContentLayoutItem*>(this);
@@ -596,12 +595,12 @@ CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::ExtractLayoutItem() {
m_pOldLayoutItem = nullptr;
return pLayoutItem;
}
-static FX_BOOL XFA_ItemLayoutProcessor_FindBreakNode(
+static bool XFA_ItemLayoutProcessor_FindBreakNode(
CXFA_Node* pContainerNode,
CXFA_Node*& pCurActionNode,
XFA_ItemLayoutProcessorStages& nCurStage,
- FX_BOOL bBreakBefore) {
- FX_BOOL bFindRs = FALSE;
+ bool bBreakBefore) {
+ bool bFindRs = false;
for (CXFA_Node* pBreakNode = pContainerNode; pBreakNode;
pBreakNode = pBreakNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
XFA_ATTRIBUTE eAttributeType = XFA_ATTRIBUTE_Before;
@@ -613,14 +612,14 @@ static FX_BOOL XFA_ItemLayoutProcessor_FindBreakNode(
if (bBreakBefore) {
pCurActionNode = pBreakNode;
nCurStage = XFA_ItemLayoutProcessorStages_BreakBefore;
- bFindRs = TRUE;
+ bFindRs = true;
}
} break;
case XFA_Element::BreakAfter: {
if (!bBreakBefore) {
pCurActionNode = pBreakNode;
nCurStage = XFA_ItemLayoutProcessorStages_BreakAfter;
- bFindRs = TRUE;
+ bFindRs = true;
}
} break;
case XFA_Element::Break:
@@ -630,7 +629,7 @@ static FX_BOOL XFA_ItemLayoutProcessor_FindBreakNode(
if (!bBreakBefore) {
nCurStage = XFA_ItemLayoutProcessorStages_BreakAfter;
}
- bFindRs = TRUE;
+ bFindRs = true;
break;
}
default:
@@ -666,7 +665,7 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode(
CXFA_Node*& pCurActionNode,
XFA_ItemLayoutProcessorStages& nCurStage,
CXFA_Node* pParentContainer,
- FX_BOOL bUsePageBreak) {
+ bool bUsePageBreak) {
CXFA_Node* pEntireContainer = pParentContainer;
CXFA_Node* pChildContainer = XFA_LAYOUT_INVALIDNODE;
switch (nCurStage) {
@@ -688,7 +687,7 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode(
pChildContainer->GetNodeItem(XFA_NODEITEM_FirstChild);
if (!m_bKeepBreakFinish &&
XFA_ItemLayoutProcessor_FindBreakNode(pBreakAfterNode, pCurActionNode,
- nCurStage, FALSE)) {
+ nCurStage, false)) {
return;
}
goto CheckNextChildContainer;
@@ -721,7 +720,7 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode(
pCurActionNode->GetNodeItem(XFA_NODEITEM_NextSibling);
if (!m_bKeepBreakFinish &&
XFA_ItemLayoutProcessor_FindBreakNode(
- pBreakBeforeNode, pCurActionNode, nCurStage, TRUE)) {
+ pBreakBeforeNode, pCurActionNode, nCurStage, true)) {
return;
}
if (m_bIsProcessKeep) {
@@ -745,14 +744,14 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode(
pChildContainer->GetNodeItem(XFA_NODEITEM_FirstChild);
if (!m_bKeepBreakFinish &&
XFA_ItemLayoutProcessor_FindBreakNode(
- pBreakAfterNode, pCurActionNode, nCurStage, FALSE)) {
+ pBreakAfterNode, pCurActionNode, nCurStage, false)) {
return;
}
} else {
CXFA_Node* pBreakAfterNode =
pCurActionNode->GetNodeItem(XFA_NODEITEM_NextSibling);
if (XFA_ItemLayoutProcessor_FindBreakNode(
- pBreakAfterNode, pCurActionNode, nCurStage, FALSE)) {
+ pBreakAfterNode, pCurActionNode, nCurStage, false)) {
return;
}
}
@@ -777,7 +776,7 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode(
if (!pNextChildContainer) {
goto NoMoreChildContainer;
}
- FX_BOOL bLastKeep = FALSE;
+ bool bLastKeep = false;
if (ProcessKeepNodesForCheckNext(pCurActionNode, nCurStage,
pNextChildContainer, bLastKeep)) {
return;
@@ -785,7 +784,7 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode(
if (!m_bKeepBreakFinish && !bLastKeep &&
XFA_ItemLayoutProcessor_FindBreakNode(
pNextChildContainer->GetNodeItem(XFA_NODEITEM_FirstChild),
- pCurActionNode, nCurStage, TRUE)) {
+ pCurActionNode, nCurStage, true)) {
return;
}
pCurActionNode = pNextChildContainer;
@@ -821,20 +820,20 @@ void CXFA_ItemLayoutProcessor::XFA_ItemLayoutProcessor_GotoNextContainerNode(
nCurStage = XFA_ItemLayoutProcessorStages_Done;
}
}
-FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepNodesForCheckNext(
+bool CXFA_ItemLayoutProcessor::ProcessKeepNodesForCheckNext(
CXFA_Node*& pCurActionNode,
XFA_ItemLayoutProcessorStages& nCurStage,
CXFA_Node*& pNextContainer,
- FX_BOOL& bLastKeepNode) {
+ bool& bLastKeepNode) {
const bool bCanSplit = pNextContainer->GetIntact() == XFA_ATTRIBUTEENUM_None;
- FX_BOOL bNextKeep = FALSE;
- if (XFA_ExistContainerKeep(pNextContainer, FALSE)) {
- bNextKeep = TRUE;
+ bool bNextKeep = false;
+ if (XFA_ExistContainerKeep(pNextContainer, false)) {
+ bNextKeep = true;
}
if (bNextKeep && !bCanSplit) {
if (!m_bIsProcessKeep && !m_bKeepBreakFinish) {
m_pKeepHeadNode = pNextContainer;
- m_bIsProcessKeep = TRUE;
+ m_bIsProcessKeep = true;
}
} else {
if (m_bIsProcessKeep && m_pKeepHeadNode) {
@@ -842,46 +841,46 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepNodesForCheckNext(
if (!m_bKeepBreakFinish &&
XFA_ItemLayoutProcessor_FindBreakNode(
pNextContainer->GetNodeItem(XFA_NODEITEM_FirstChild),
- pCurActionNode, nCurStage, TRUE)) {
- return TRUE;
+ pCurActionNode, nCurStage, true)) {
+ return true;
} else {
pNextContainer = m_pKeepHeadNode;
- m_bKeepBreakFinish = TRUE;
+ m_bKeepBreakFinish = true;
m_pKeepHeadNode = nullptr;
m_pKeepTailNode = nullptr;
- m_bIsProcessKeep = FALSE;
+ m_bIsProcessKeep = false;
}
} else {
if (m_bKeepBreakFinish) {
- bLastKeepNode = TRUE;
+ bLastKeepNode = true;
}
- m_bKeepBreakFinish = FALSE;
+ m_bKeepBreakFinish = false;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepNodesForBreakBefore(
+bool CXFA_ItemLayoutProcessor::ProcessKeepNodesForBreakBefore(
CXFA_Node*& pCurActionNode,
XFA_ItemLayoutProcessorStages& nCurStage,
CXFA_Node* pContainerNode) {
if (m_pKeepTailNode == pContainerNode) {
pCurActionNode = m_pKeepHeadNode;
- m_bKeepBreakFinish = TRUE;
+ m_bKeepBreakFinish = true;
m_pKeepHeadNode = nullptr;
m_pKeepTailNode = nullptr;
- m_bIsProcessKeep = FALSE;
+ m_bIsProcessKeep = false;
nCurStage = XFA_ItemLayoutProcessorStages_Container;
- return TRUE;
+ return true;
}
CXFA_Node* pBreakAfterNode =
pContainerNode->GetNodeItem(XFA_NODEITEM_FirstChild);
if (XFA_ItemLayoutProcessor_FindBreakNode(pBreakAfterNode, pCurActionNode,
- nCurStage, FALSE)) {
- return TRUE;
+ nCurStage, false)) {
+ return true;
}
- return FALSE;
+ return false;
}
-FX_BOOL XFA_ItemLayoutProcessor_IsTakingSpace(CXFA_Node* pNode) {
+bool XFA_ItemLayoutProcessor_IsTakingSpace(CXFA_Node* pNode) {
XFA_ATTRIBUTEENUM ePresence = pNode->GetEnum(XFA_ATTRIBUTE_Presence);
return ePresence == XFA_ATTRIBUTEENUM_Visible ||
ePresence == XFA_ATTRIBUTEENUM_Invisible;
@@ -890,48 +889,48 @@ static inline void XFA_ItemLayoutProcessor_CalculateContainerSpecfiedSize(
CXFA_Node* pFormNode,
FX_FLOAT& fContainerWidth,
FX_FLOAT& fContainerHeight,
- FX_BOOL& bContainerWidthAutoSize,
- FX_BOOL& bContainerHeightAutoSize) {
+ bool& bContainerWidthAutoSize,
+ bool& bContainerHeightAutoSize) {
fContainerWidth = 0;
fContainerHeight = 0;
- bContainerWidthAutoSize = TRUE;
- bContainerHeightAutoSize = TRUE;
+ bContainerWidthAutoSize = true;
+ bContainerHeightAutoSize = true;
XFA_Element eType = pFormNode->GetElementType();
CXFA_Measurement mTmpValue;
if (bContainerWidthAutoSize &&
(eType == XFA_Element::Subform || eType == XFA_Element::ExclGroup) &&
- pFormNode->TryMeasure(XFA_ATTRIBUTE_W, mTmpValue, FALSE) &&
+ pFormNode->TryMeasure(XFA_ATTRIBUTE_W, mTmpValue, false) &&
mTmpValue.GetValue() > XFA_LAYOUT_FLOAT_PERCISION) {
fContainerWidth = mTmpValue.ToUnit(XFA_UNIT_Pt);
- bContainerWidthAutoSize = FALSE;
+ bContainerWidthAutoSize = false;
}
if (bContainerHeightAutoSize &&
(eType == XFA_Element::Subform || eType == XFA_Element::ExclGroup) &&
- pFormNode->TryMeasure(XFA_ATTRIBUTE_H, mTmpValue, FALSE) &&
+ pFormNode->TryMeasure(XFA_ATTRIBUTE_H, mTmpValue, false) &&
mTmpValue.GetValue() > XFA_LAYOUT_FLOAT_PERCISION) {
fContainerHeight = mTmpValue.ToUnit(XFA_UNIT_Pt);
- bContainerHeightAutoSize = FALSE;
+ bContainerHeightAutoSize = false;
}
if (bContainerWidthAutoSize && eType == XFA_Element::Subform &&
- pFormNode->TryMeasure(XFA_ATTRIBUTE_MaxW, mTmpValue, FALSE) &&
+ pFormNode->TryMeasure(XFA_ATTRIBUTE_MaxW, mTmpValue, false) &&
mTmpValue.GetValue() > XFA_LAYOUT_FLOAT_PERCISION) {
fContainerWidth = mTmpValue.ToUnit(XFA_UNIT_Pt);
- bContainerWidthAutoSize = FALSE;
+ bContainerWidthAutoSize = false;
}
if (bContainerHeightAutoSize && eType == XFA_Element::Subform &&
- pFormNode->TryMeasure(XFA_ATTRIBUTE_MaxH, mTmpValue, FALSE) &&
+ pFormNode->TryMeasure(XFA_ATTRIBUTE_MaxH, mTmpValue, false) &&
mTmpValue.GetValue() > XFA_LAYOUT_FLOAT_PERCISION) {
fContainerHeight = mTmpValue.ToUnit(XFA_UNIT_Pt);
- bContainerHeightAutoSize = FALSE;
+ bContainerHeightAutoSize = false;
}
}
static inline void
XFA_ItemLayoutProcessor_CalculateContainerComponentSizeFromContentSize(
CXFA_Node* pFormNode,
- FX_BOOL bContainerWidthAutoSize,
+ bool bContainerWidthAutoSize,
FX_FLOAT fContentCalculatedWidth,
FX_FLOAT& fContainerWidth,
- FX_BOOL bContainerHeightAutoSize,
+ bool bContainerHeightAutoSize,
FX_FLOAT fContentCalculatedHeight,
FX_FLOAT& fContainerHeight) {
CXFA_Node* pMarginNode = pFormNode->GetFirstChildByClass(XFA_Element::Margin);
@@ -939,10 +938,10 @@ XFA_ItemLayoutProcessor_CalculateContainerComponentSizeFromContentSize(
if (bContainerWidthAutoSize) {
fContainerWidth = fContentCalculatedWidth;
if (pMarginNode) {
- if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_LeftInset, mTmpValue, FALSE)) {
+ if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_LeftInset, mTmpValue, false)) {
fContainerWidth += mTmpValue.ToUnit(XFA_UNIT_Pt);
}
- if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_RightInset, mTmpValue, FALSE)) {
+ if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_RightInset, mTmpValue, false)) {
fContainerWidth += mTmpValue.ToUnit(XFA_UNIT_Pt);
}
}
@@ -950,11 +949,11 @@ XFA_ItemLayoutProcessor_CalculateContainerComponentSizeFromContentSize(
if (bContainerHeightAutoSize) {
fContainerHeight = fContentCalculatedHeight;
if (pMarginNode) {
- if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_TopInset, mTmpValue, FALSE)) {
+ if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_TopInset, mTmpValue, false)) {
fContainerHeight += mTmpValue.ToUnit(XFA_UNIT_Pt);
}
if (pMarginNode->TryMeasure(XFA_ATTRIBUTE_BottomInset, mTmpValue,
- FALSE)) {
+ false)) {
fContainerHeight += mTmpValue.ToUnit(XFA_UNIT_Pt);
}
}
@@ -1033,11 +1032,11 @@ void CXFA_ItemLayoutProcessor::CalculatePositionedContainerPos(
break;
}
}
-FX_BOOL CXFA_ItemLayoutProcessor::IncrementRelayoutNode(
+bool CXFA_ItemLayoutProcessor::IncrementRelayoutNode(
CXFA_LayoutProcessor* pLayoutProcessor,
CXFA_Node* pNode,
CXFA_Node* pParentNode) {
- return FALSE;
+ return false;
}
void CXFA_ItemLayoutProcessor::DoLayoutPageArea(
CXFA_ContainerLayoutItem* pPageAreaLayoutItem) {
@@ -1047,9 +1046,9 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea(
XFA_ItemLayoutProcessorStages_None;
CXFA_LayoutItem* pBeforeItem = nullptr;
for (XFA_ItemLayoutProcessor_GotoNextContainerNode(
- pCurChildNode, nCurChildNodeStage, pFormNode, FALSE);
+ pCurChildNode, nCurChildNodeStage, pFormNode, false);
pCurChildNode; XFA_ItemLayoutProcessor_GotoNextContainerNode(
- pCurChildNode, nCurChildNodeStage, pFormNode, FALSE)) {
+ pCurChildNode, nCurChildNodeStage, pFormNode, false)) {
if (nCurChildNodeStage != XFA_ItemLayoutProcessorStages_Container) {
continue;
}
@@ -1058,7 +1057,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPageArea(
}
CXFA_ItemLayoutProcessor* pProcessor =
new CXFA_ItemLayoutProcessor(pCurChildNode, nullptr);
- pProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX);
+ pProcessor->DoLayout(false, XFA_LAYOUT_FLOAT_MAX);
if (!pProcessor->HasLayoutItem()) {
delete pProcessor;
continue;
@@ -1105,10 +1104,10 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer(
return;
m_pLayoutItem = CreateContentLayoutItem(m_pFormNode);
- FX_BOOL bIgnoreXY = (m_pFormNode->GetEnum(XFA_ATTRIBUTE_Layout) !=
- XFA_ATTRIBUTEENUM_Position);
+ bool bIgnoreXY = (m_pFormNode->GetEnum(XFA_ATTRIBUTE_Layout) !=
+ XFA_ATTRIBUTEENUM_Position);
FX_FLOAT fContainerWidth = 0, fContainerHeight = 0;
- FX_BOOL bContainerWidthAutoSize = TRUE, bContainerHeightAutoSize = TRUE;
+ bool bContainerWidthAutoSize = true, bContainerHeightAutoSize = true;
XFA_ItemLayoutProcessor_CalculateContainerSpecfiedSize(
m_pFormNode, fContainerWidth, fContainerHeight, bContainerWidthAutoSize,
bContainerHeightAutoSize);
@@ -1117,11 +1116,11 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer(
fHiddenContentCalculatedHeight = 0;
if (m_pCurChildNode == XFA_LAYOUT_INVALIDNODE) {
XFA_ItemLayoutProcessor_GotoNextContainerNode(
- m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE);
+ m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, false);
}
int32_t iColIndex = 0;
for (; m_pCurChildNode; XFA_ItemLayoutProcessor_GotoNextContainerNode(
- m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE)) {
+ m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, false)) {
if (m_nCurChildNodeStage != XFA_ItemLayoutProcessorStages_Container) {
continue;
}
@@ -1135,7 +1134,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer(
if (iColSpan <=
pContext->m_prgSpecifiedColumnWidths->GetSize() - iColIndex) {
pContext->m_fCurColumnWidth = 0;
- pContext->m_bCurColumnWidthAvaiable = TRUE;
+ pContext->m_bCurColumnWidthAvaiable = true;
if (iColSpan == -1)
iColSpan = pContext->m_prgSpecifiedColumnWidths->GetSize();
for (int32_t i = 0; iColIndex + i < iColSpan; ++i) {
@@ -1143,11 +1142,11 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer(
pContext->m_prgSpecifiedColumnWidths->GetAt(iColIndex + i);
}
if (pContext->m_fCurColumnWidth == 0)
- pContext->m_bCurColumnWidthAvaiable = FALSE;
+ pContext->m_bCurColumnWidthAvaiable = false;
iColIndex += iColSpan >= 0 ? iColSpan : 0;
}
}
- pProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX,
+ pProcessor->DoLayout(false, XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX,
pContext);
if (!pProcessor->HasLayoutItem()) {
delete pProcessor;
@@ -1155,9 +1154,9 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer(
}
FX_FLOAT fWidth, fHeight;
pProcessor->GetCurrentComponentSize(fWidth, fHeight);
- FX_BOOL bChangeParentSize = FALSE;
+ bool bChangeParentSize = false;
if (XFA_ItemLayoutProcessor_IsTakingSpace(m_pCurChildNode)) {
- bChangeParentSize = TRUE;
+ bChangeParentSize = true;
}
FX_FLOAT fAbsoluteX = 0, fAbsoluteY = 0;
if (!bIgnoreXY) {
@@ -1233,7 +1232,7 @@ static inline void XFA_ItemLayoutProcessor_UpdateWidgetSize(
break;
}
default:
- ASSERT(FALSE);
+ ASSERT(false);
}
}
static inline void XFA_ItemLayoutProcessor_RelocateTableRowCells(
@@ -1241,7 +1240,7 @@ static inline void XFA_ItemLayoutProcessor_RelocateTableRowCells(
const CFX_ArrayTemplate<FX_FLOAT>& rgSpecifiedColumnWidths,
XFA_ATTRIBUTEENUM eLayout) {
FX_FLOAT fContainerWidth = 0, fContainerHeight = 0;
- FX_BOOL bContainerWidthAutoSize = TRUE, bContainerHeightAutoSize = TRUE;
+ bool bContainerWidthAutoSize = true, bContainerHeightAutoSize = true;
XFA_ItemLayoutProcessor_CalculateContainerSpecfiedSize(
pLayoutRow->m_pFormNode, fContainerWidth, fContainerHeight,
bContainerWidthAutoSize, bContainerHeightAutoSize);
@@ -1266,7 +1265,7 @@ static inline void XFA_ItemLayoutProcessor_RelocateTableRowCells(
FX_FLOAT fContentCalculatedWidth = 0, fContentCalculatedHeight = 0;
FX_FLOAT fCurrentColX = 0;
int32_t nCurrentColIdx = 0;
- FX_BOOL bMetWholeRowCell = FALSE;
+ bool bMetWholeRowCell = false;
for (CXFA_ContentLayoutItem* pLayoutChild =
(CXFA_ContentLayoutItem*)pLayoutRow->m_pFirstChild;
pLayoutChild;
@@ -1287,7 +1286,7 @@ static inline void XFA_ItemLayoutProcessor_RelocateTableRowCells(
pLayoutChild->m_sSize.y);
}
if (nOriginalColSpan == -1) {
- bMetWholeRowCell = TRUE;
+ bMetWholeRowCell = true;
}
pLayoutChild->m_sPos = CFX_PointF(fCurrentColX, 0);
pLayoutChild->m_sSize.x = fColSpanWidth;
@@ -1382,7 +1381,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) {
ASSERT(m_pCurChildNode == XFA_LAYOUT_INVALIDNODE);
m_pLayoutItem = CreateContentLayoutItem(m_pFormNode);
FX_FLOAT fContainerWidth = 0, fContainerHeight = 0;
- FX_BOOL bContainerWidthAutoSize = TRUE, bContainerHeightAutoSize = TRUE;
+ bool bContainerWidthAutoSize = true, bContainerHeightAutoSize = true;
XFA_ItemLayoutProcessor_CalculateContainerSpecfiedSize(
m_pFormNode, fContainerWidth, fContainerHeight, bContainerWidthAutoSize,
bContainerHeightAutoSize);
@@ -1424,18 +1423,18 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) {
iSpecifiedColumnCount > 0 ? &layoutContext : nullptr;
if (m_pCurChildNode == XFA_LAYOUT_INVALIDNODE) {
XFA_ItemLayoutProcessor_GotoNextContainerNode(
- m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE);
+ m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, false);
}
for (; m_pCurChildNode; XFA_ItemLayoutProcessor_GotoNextContainerNode(
- m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE)) {
- layoutContext.m_bCurColumnWidthAvaiable = FALSE;
+ m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, false)) {
+ layoutContext.m_bCurColumnWidthAvaiable = false;
layoutContext.m_fCurColumnWidth = 0;
if (m_nCurChildNodeStage != XFA_ItemLayoutProcessorStages_Container) {
continue;
}
CXFA_ItemLayoutProcessor* pProcessor =
new CXFA_ItemLayoutProcessor(m_pCurChildNode, m_pPageMgr);
- pProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX,
+ pProcessor->DoLayout(false, XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX,
pLayoutContext);
if (!pProcessor->HasLayoutItem()) {
delete pProcessor;
@@ -1476,10 +1475,10 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) {
}
iRowCount = rgRowItems.GetSize();
iColCount = 0;
- FX_BOOL bMoreColumns = TRUE;
+ bool bMoreColumns = true;
while (bMoreColumns) {
- bMoreColumns = FALSE;
- FX_BOOL bAutoCol = FALSE;
+ bMoreColumns = false;
+ bool bAutoCol = false;
for (int32_t i = 0; i < iRowCount; i++) {
while (rgRowItems[i] && (rgRowItemsSpan[i] <= 0 ||
!XFA_ItemLayoutProcessor_IsTakingSpace(
@@ -1501,7 +1500,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) {
if (!pCell) {
continue;
}
- bMoreColumns = TRUE;
+ bMoreColumns = true;
if (rgRowItemsSpan[i] == 1) {
if (iColCount >= iSpecifiedColumnCount) {
for (int32_t j = 0, c = iColCount + 1 -
@@ -1512,7 +1511,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) {
}
if (m_rgSpecifiedColumnWidths[iColCount] <
XFA_LAYOUT_FLOAT_PERCISION) {
- bAutoCol = TRUE;
+ bAutoCol = true;
}
if (bAutoCol &&
m_rgSpecifiedColumnWidths[iColCount] < rgRowItemsWidth[i]) {
@@ -1621,23 +1620,23 @@ static void XFA_ItemLayoutProcessor_UpdatePendedItemLayout(
break;
}
}
-FX_BOOL CXFA_ItemLayoutProcessor::IsAddNewRowForTrailer(
+bool CXFA_ItemLayoutProcessor::IsAddNewRowForTrailer(
CXFA_ContentLayoutItem* pTrailerItem) {
if (!pTrailerItem) {
- return FALSE;
+ return false;
}
FX_FLOAT fWidth = pTrailerItem->m_sSize.x;
XFA_ATTRIBUTEENUM eLayout = m_pFormNode->GetEnum(XFA_ATTRIBUTE_Layout);
if (eLayout != XFA_ATTRIBUTEENUM_Tb && m_fWidthLimite > fWidth) {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
static void XFA_ItemLayoutProcessor_AddTrailerBeforeSplit(
CXFA_ItemLayoutProcessor* pProcessor,
FX_FLOAT fSplitPos,
CXFA_ContentLayoutItem* pTrailerLayoutItem,
- FX_BOOL bUseInherited = FALSE) {
+ bool bUseInherited = false) {
if (!pTrailerLayoutItem) {
return;
}
@@ -1748,7 +1747,7 @@ static void XFA_ItemLayoutProcessor_AddLeaderAfterSplit(
static void XFA_ItemLayoutProcessor_AddPendingNode(
CXFA_ItemLayoutProcessor* pProcessor,
CXFA_Node* pPendingNode,
- FX_BOOL bBreakPending) {
+ bool bBreakPending) {
pProcessor->m_PendingNodes.push_back(pPendingNode);
pProcessor->m_bBreakPending = bBreakPending;
}
@@ -1769,7 +1768,7 @@ static FX_FLOAT XFA_ItemLayoutProcessor_InsertPendingItems(
new CXFA_ItemLayoutProcessor(pProcessor->m_PendingNodes.front(),
nullptr));
pProcessor->m_PendingNodes.pop_front();
- pPendingProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX);
+ pPendingProcessor->DoLayout(false, XFA_LAYOUT_FLOAT_MAX);
CXFA_ContentLayoutItem* pPendingLayoutItem =
pPendingProcessor->HasLayoutItem()
? pPendingProcessor->ExtractLayoutItem()
@@ -1801,7 +1800,7 @@ FX_FLOAT CXFA_ItemLayoutProcessor::InsertKeepLayoutItems() {
}
return fTotalHeight;
}
-FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepForSplite(
+bool CXFA_ItemLayoutProcessor::ProcessKeepForSplite(
CXFA_ItemLayoutProcessor* pParentProcessor,
CXFA_ItemLayoutProcessor* pChildProcessor,
XFA_ItemLayoutProcessorResult eRetValue,
@@ -1809,16 +1808,16 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepForSplite(
FX_FLOAT& fContentCurRowAvailWidth,
FX_FLOAT& fContentCurRowHeight,
FX_FLOAT& fContentCurRowY,
- FX_BOOL& bAddedItemInRow,
- FX_BOOL& bForceEndPage,
+ bool& bAddedItemInRow,
+ bool& bForceEndPage,
XFA_ItemLayoutProcessorResult& result) {
if (!pParentProcessor || !pChildProcessor) {
- return FALSE;
+ return false;
}
if (pParentProcessor->m_pCurChildNode->GetIntact() !=
XFA_ATTRIBUTEENUM_None ||
!pChildProcessor->m_bHasAvailHeight) {
- if (XFA_ExistContainerKeep(pParentProcessor->m_pCurChildNode, TRUE)) {
+ if (XFA_ExistContainerKeep(pParentProcessor->m_pCurChildNode, true)) {
FX_FLOAT fChildWidth, fChildHeight;
pChildProcessor->GetCurrentComponentSize(fChildWidth, fChildHeight);
CFX_ArrayTemplate<CXFA_ContentLayoutItem*> keepLayoutItems;
@@ -1831,29 +1830,29 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepForSplite(
fContentCurRowY -= pItem->m_sSize.y;
m_arrayKeepItems.Add(pItem);
}
- bAddedItemInRow = TRUE;
- bForceEndPage = TRUE;
+ bAddedItemInRow = true;
+ bForceEndPage = true;
result = XFA_ItemLayoutProcessorResult_PageFullBreak;
- return TRUE;
+ return true;
}
rgCurLineLayoutItem.Add(pChildProcessor->ExtractLayoutItem());
- bAddedItemInRow = TRUE;
+ bAddedItemInRow = true;
fContentCurRowAvailWidth -= fChildWidth;
if (fContentCurRowHeight < fChildHeight) {
fContentCurRowHeight = fChildHeight;
}
result = eRetValue;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
-FX_BOOL CXFA_ItemLayoutProcessor::JudgePutNextPage(
+bool CXFA_ItemLayoutProcessor::JudgePutNextPage(
CXFA_ContentLayoutItem* pParentLayoutItem,
FX_FLOAT fChildHeight,
CFX_ArrayTemplate<CXFA_ContentLayoutItem*>& pKeepItems) {
if (!pParentLayoutItem) {
- return FALSE;
+ return false;
}
FX_FLOAT fItemsHeight = 0;
for (CXFA_ContentLayoutItem* pChildLayoutItem =
@@ -1861,7 +1860,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::JudgePutNextPage(
pChildLayoutItem;
pChildLayoutItem =
(CXFA_ContentLayoutItem*)pChildLayoutItem->m_pNextSibling) {
- if (XFA_ExistContainerKeep(pChildLayoutItem->m_pFormNode, FALSE)) {
+ if (XFA_ExistContainerKeep(pChildLayoutItem->m_pFormNode, false)) {
pKeepItems.Add(pChildLayoutItem);
fItemsHeight += pChildLayoutItem->m_sSize.y;
} else {
@@ -1871,9 +1870,9 @@ FX_BOOL CXFA_ItemLayoutProcessor::JudgePutNextPage(
}
fItemsHeight += fChildHeight;
if (m_pPageMgr->GetNextAvailContentHeight(fItemsHeight)) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CXFA_ItemLayoutProcessor::ProcessUnUseBinds(CXFA_Node* pFormNode) {
if (!pFormNode) {
@@ -1920,24 +1919,24 @@ void CXFA_ItemLayoutProcessor::ProcessUnUseOverFlow(
static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
CXFA_ItemLayoutProcessor* pThis,
CXFA_ItemLayoutProcessor* pProcessor,
- FX_BOOL bContainerWidthAutoSize,
- FX_BOOL bContainerHeightAutoSize,
+ bool bContainerWidthAutoSize,
+ bool bContainerHeightAutoSize,
FX_FLOAT fContainerHeight,
XFA_ATTRIBUTEENUM eFlowStrategy,
uint8_t& uCurHAlignState,
CFX_ArrayTemplate<CXFA_ContentLayoutItem*> (&rgCurLineLayoutItems)[3],
- FX_BOOL bUseBreakControl,
+ bool bUseBreakControl,
FX_FLOAT fAvailHeight,
FX_FLOAT fRealHeight,
FX_FLOAT& fContentCurRowY,
FX_FLOAT& fContentWidthLimit,
FX_FLOAT& fContentCurRowAvailWidth,
FX_FLOAT& fContentCurRowHeight,
- FX_BOOL& bAddedItemInRow,
- FX_BOOL& bForceEndPage,
+ bool& bAddedItemInRow,
+ bool& bForceEndPage,
CXFA_LayoutContext* pLayoutContext = nullptr,
- FX_BOOL bNewRow = FALSE) {
- FX_BOOL bTakeSpace =
+ bool bNewRow = false) {
+ bool bTakeSpace =
XFA_ItemLayoutProcessor_IsTakingSpace(pProcessor->m_pFormNode);
uint8_t uHAlign = XFA_ItemLayoutProcessor_HAlignEnumToInt(
pThis->m_pCurChildNode->GetEnum(XFA_ATTRIBUTE_HAlign));
@@ -1949,23 +1948,23 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
return XFA_ItemLayoutProcessorResult_RowFullBreak;
}
uCurHAlignState = uHAlign;
- FX_BOOL bIsOwnSplite =
+ bool bIsOwnSplite =
pProcessor->m_pFormNode->GetIntact() == XFA_ATTRIBUTEENUM_None;
- FX_BOOL bUseRealHeight =
+ bool bUseRealHeight =
bTakeSpace && bContainerHeightAutoSize && bIsOwnSplite &&
pProcessor->m_pFormNode->GetNodeItem(XFA_NODEITEM_Parent)->GetIntact() ==
XFA_ATTRIBUTEENUM_None;
- FX_BOOL bIsTransHeight = bTakeSpace;
+ bool bIsTransHeight = bTakeSpace;
if (bIsTransHeight && !bIsOwnSplite) {
- FX_BOOL bRootForceTb = FALSE;
+ bool bRootForceTb = false;
XFA_ATTRIBUTEENUM eLayoutStrategy = XFA_ItemLayoutProcessor_GetLayout(
pProcessor->m_pFormNode, bRootForceTb);
if (eLayoutStrategy == XFA_ATTRIBUTEENUM_Lr_tb ||
eLayoutStrategy == XFA_ATTRIBUTEENUM_Rl_tb) {
- bIsTransHeight = FALSE;
+ bIsTransHeight = false;
}
}
- FX_BOOL bUseInherited = FALSE;
+ bool bUseInherited = false;
CXFA_LayoutContext layoutContext;
if (pThis->m_pPageMgr) {
CXFA_Node* pOverflowNode =
@@ -1980,7 +1979,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
if (!bNewRow ||
pProcessor->m_ePreProcessRs == XFA_ItemLayoutProcessorResult_Done) {
eRetValue = pProcessor->DoLayout(
- bTakeSpace ? bUseBreakControl : FALSE,
+ bTakeSpace ? bUseBreakControl : false,
bUseRealHeight ? fRealHeight - fContentCurRowY : XFA_LAYOUT_FLOAT_MAX,
bIsTransHeight ? fRealHeight - fContentCurRowY : XFA_LAYOUT_FLOAT_MAX,
pLayoutContext);
@@ -1989,7 +1988,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
eRetValue = pProcessor->m_ePreProcessRs;
pProcessor->m_ePreProcessRs = XFA_ItemLayoutProcessorResult_Done;
}
- if (pProcessor->HasLayoutItem() == FALSE) {
+ if (pProcessor->HasLayoutItem() == false) {
return eRetValue;
}
FX_FLOAT fChildWidth, fChildHeight;
@@ -2006,23 +2005,23 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
CXFA_Node* pOverflowTrailerNode = nullptr;
CXFA_Node* pFormNode = nullptr;
CXFA_ContentLayoutItem* pTrailerLayoutItem = nullptr;
- FX_BOOL bIsAddTrailerHeight = FALSE;
+ bool bIsAddTrailerHeight = false;
if (pThis->m_pPageMgr &&
pProcessor->m_pFormNode->GetIntact() == XFA_ATTRIBUTEENUM_None) {
pFormNode = pThis->m_pPageMgr->QueryOverflow(pProcessor->m_pFormNode);
if (!pFormNode && pLayoutContext &&
pLayoutContext->m_pOverflowProcessor) {
pFormNode = pLayoutContext->m_pOverflowNode;
- bUseInherited = TRUE;
+ bUseInherited = true;
}
if (pThis->m_pPageMgr->ProcessOverflow(pFormNode, pOverflowLeaderNode,
- pOverflowTrailerNode, FALSE,
- FALSE)) {
+ pOverflowTrailerNode, false,
+ false)) {
if (pProcessor->JudgeLeaderOrTrailerForOccur(pOverflowTrailerNode)) {
if (pOverflowTrailerNode) {
CXFA_ItemLayoutProcessor* pOverflowLeaderProcessor =
new CXFA_ItemLayoutProcessor(pOverflowTrailerNode, nullptr);
- pOverflowLeaderProcessor->DoLayout(FALSE, XFA_LAYOUT_FLOAT_MAX);
+ pOverflowLeaderProcessor->DoLayout(false, XFA_LAYOUT_FLOAT_MAX);
pTrailerLayoutItem =
pOverflowLeaderProcessor->HasLayoutItem()
? pOverflowLeaderProcessor->ExtractLayoutItem()
@@ -2039,7 +2038,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
if (bIsAddTrailerHeight) {
FX_FLOAT fTrailerHeight = pTrailerLayoutItem->m_sSize.y;
fChildHeight += fTrailerHeight;
- bIsAddTrailerHeight = TRUE;
+ bIsAddTrailerHeight = true;
}
}
}
@@ -2058,9 +2057,9 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
}
if (pProcessor->JudgeLeaderOrTrailerForOccur(pOverflowLeaderNode)) {
XFA_ItemLayoutProcessor_AddPendingNode(pProcessor,
- pOverflowLeaderNode, FALSE);
+ pOverflowLeaderNode, false);
}
- pProcessor->m_bUseInheriated = FALSE;
+ pProcessor->m_bUseInheriated = false;
} else {
if (bIsAddTrailerHeight) {
fChildHeight -= pTrailerLayoutItem->m_sSize.y;
@@ -2071,14 +2070,14 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
}
CXFA_ContentLayoutItem* pChildLayoutItem =
pProcessor->ExtractLayoutItem();
- if (XFA_ExistContainerKeep(pProcessor->m_pFormNode, FALSE) &&
+ if (XFA_ExistContainerKeep(pProcessor->m_pFormNode, false) &&
pProcessor->m_pFormNode->GetIntact() == XFA_ATTRIBUTEENUM_None) {
pThis->m_arrayKeepItems.Add(pChildLayoutItem);
} else {
pThis->m_arrayKeepItems.RemoveAll();
}
rgCurLineLayoutItems[uHAlign].Add(pChildLayoutItem);
- bAddedItemInRow = TRUE;
+ bAddedItemInRow = true;
if (bTakeSpace) {
fContentCurRowAvailWidth -= fChildWidth;
if (fContentCurRowHeight < fChildHeight) {
@@ -2095,9 +2094,9 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
}
if (pProcessor->JudgeLeaderOrTrailerForOccur(pOverflowLeaderNode)) {
XFA_ItemLayoutProcessor_AddPendingNode(
- pProcessor, pOverflowLeaderNode, FALSE);
+ pProcessor, pOverflowLeaderNode, false);
}
- pProcessor->m_bUseInheriated = FALSE;
+ pProcessor->m_bUseInheriated = false;
} else {
if (bIsAddTrailerHeight) {
fChildHeight -= pTrailerLayoutItem->m_sSize.y;
@@ -2108,7 +2107,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
}
}
rgCurLineLayoutItems[uHAlign].Add(pProcessor->ExtractLayoutItem());
- bAddedItemInRow = TRUE;
+ bAddedItemInRow = true;
fContentCurRowAvailWidth -= fChildWidth;
if (fContentCurRowHeight < fChildHeight) {
fContentCurRowHeight = fChildHeight;
@@ -2123,7 +2122,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
bAddedItemInRow, bForceEndPage, eResult)) {
return eResult;
}
- bForceEndPage = TRUE;
+ bForceEndPage = true;
FX_FLOAT fSplitPos =
pProcessor->FindSplitPos(fAvailHeight - fContentCurRowY);
if (fSplitPos > XFA_LAYOUT_FLOAT_PERCISION) {
@@ -2135,7 +2134,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
pOverflowTrailerNode,
pTrailerLayoutItem, pFormNode);
rgCurLineLayoutItems[uHAlign].Add(pProcessor->ExtractLayoutItem());
- bAddedItemInRow = TRUE;
+ bAddedItemInRow = true;
if (bTakeSpace) {
fContentCurRowAvailWidth -= fChildWidth;
if (fContentCurRowHeight < fChildHeight) {
@@ -2149,7 +2148,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
if (pThis->m_pPageMgr && !pProcessor->m_bUseInheriated &&
eRetValue != XFA_ItemLayoutProcessorResult_PageFullBreak) {
pThis->m_pPageMgr->ProcessOverflow(pFormNode, pTempLeaderNode,
- pTempTrailerNode, FALSE, TRUE);
+ pTempTrailerNode, false, true);
}
if (pTrailerLayoutItem && bIsAddTrailerHeight) {
XFA_ItemLayoutProcessor_AddTrailerBeforeSplit(
@@ -2161,7 +2160,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
pProcessor->ProcessUnUseOverFlow(pOverflowLeaderNode,
pOverflowTrailerNode,
pTrailerLayoutItem, pFormNode);
- pThis->m_bUseInheriated = TRUE;
+ pThis->m_bUseInheriated = true;
} else {
CXFA_LayoutItem* firstChild =
pProcessor->m_pLayoutItem->m_pFirstChild;
@@ -2173,14 +2172,14 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
} else {
if (pProcessor->JudgeLeaderOrTrailerForOccur(pOverflowLeaderNode)) {
XFA_ItemLayoutProcessor_AddPendingNode(
- pProcessor, pOverflowLeaderNode, FALSE);
+ pProcessor, pOverflowLeaderNode, false);
}
}
}
if (pProcessor->m_pLayoutItem->m_pNextSibling) {
pProcessor->GetCurrentComponentSize(fChildWidth, fChildHeight);
rgCurLineLayoutItems[uHAlign].Add(pProcessor->ExtractLayoutItem());
- bAddedItemInRow = TRUE;
+ bAddedItemInRow = true;
if (bTakeSpace) {
fContentCurRowAvailWidth -= fChildWidth;
if (fContentCurRowHeight < fChildHeight) {
@@ -2199,18 +2198,18 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
pFormNode = pLayoutContext->m_pOverflowProcessor->m_pFormNode;
}
pThis->m_pPageMgr->ProcessOverflow(pFormNode, pTempLeaderNode,
- pTempTrailerNode, FALSE, TRUE);
+ pTempTrailerNode, false, true);
}
if (bUseInherited) {
pProcessor->ProcessUnUseOverFlow(pOverflowLeaderNode,
pOverflowTrailerNode,
pTrailerLayoutItem, pFormNode);
- pThis->m_bUseInheriated = TRUE;
+ pThis->m_bUseInheriated = true;
}
return XFA_ItemLayoutProcessorResult_PageFullBreak;
}
rgCurLineLayoutItems[uHAlign].Add(pProcessor->ExtractLayoutItem());
- bAddedItemInRow = TRUE;
+ bAddedItemInRow = true;
if (bTakeSpace) {
fContentCurRowAvailWidth -= fChildWidth;
if (fContentCurRowHeight < fChildHeight) {
@@ -2218,7 +2217,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
}
}
if (eRetValue == XFA_ItemLayoutProcessorResult_Done) {
- bForceEndPage = FALSE;
+ bForceEndPage = false;
}
return eRetValue;
} else {
@@ -2228,8 +2227,8 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
eLayout == XFA_ATTRIBUTEENUM_Tb) {
if (pThis->m_pPageMgr) {
pThis->m_pPageMgr->ProcessOverflow(pFormNode, pOverflowLeaderNode,
- pOverflowTrailerNode, FALSE,
- TRUE);
+ pOverflowTrailerNode, false,
+ true);
}
if (pTrailerLayoutItem) {
XFA_ItemLayoutProcessor_AddTrailerBeforeSplit(pProcessor, fSplitPos,
@@ -2237,7 +2236,7 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
}
if (pProcessor->JudgeLeaderOrTrailerForOccur(pOverflowLeaderNode)) {
XFA_ItemLayoutProcessor_AddPendingNode(pProcessor,
- pOverflowLeaderNode, FALSE);
+ pOverflowLeaderNode, false);
}
} else {
if (eRetValue == XFA_ItemLayoutProcessorResult_Done) {
@@ -2246,14 +2245,14 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
}
if (pThis->m_pPageMgr) {
pThis->m_pPageMgr->ProcessOverflow(pFormNode, pOverflowLeaderNode,
- pOverflowTrailerNode, FALSE,
- TRUE);
+ pOverflowTrailerNode, false,
+ true);
}
if (bUseInherited) {
pProcessor->ProcessUnUseOverFlow(pOverflowLeaderNode,
pOverflowTrailerNode,
pTrailerLayoutItem, pFormNode);
- pThis->m_bUseInheriated = TRUE;
+ pThis->m_bUseInheriated = true;
}
}
}
@@ -2267,18 +2266,18 @@ static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(
}
XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
- FX_BOOL bUseBreakControl,
+ bool bUseBreakControl,
XFA_ATTRIBUTEENUM eFlowStrategy,
FX_FLOAT fHeightLimit,
FX_FLOAT fRealHeight,
CXFA_LayoutContext* pContext,
- FX_BOOL bRootForceTb) {
- m_bHasAvailHeight = TRUE;
+ bool bRootForceTb) {
+ m_bHasAvailHeight = true;
FX_FLOAT fContainerWidth = 0, fContainerHeight = 0;
- FX_BOOL bBreakDone = FALSE;
- FX_BOOL bContainerWidthAutoSize = TRUE, bContainerHeightAutoSize = TRUE;
- FX_BOOL bForceEndPage = FALSE;
- FX_BOOL bIsManualBreak = FALSE;
+ bool bBreakDone = false;
+ bool bContainerWidthAutoSize = true, bContainerHeightAutoSize = true;
+ bool bForceEndPage = false;
+ bool bIsManualBreak = false;
if (m_pCurChildPreprocessor) {
m_pCurChildPreprocessor->m_ePreProcessRs =
XFA_ItemLayoutProcessorResult_Done;
@@ -2287,7 +2286,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
m_pFormNode, fContainerWidth, fContainerHeight, bContainerWidthAutoSize,
bContainerHeightAutoSize);
if (pContext && pContext->m_bCurColumnWidthAvaiable) {
- bContainerWidthAutoSize = FALSE;
+ bContainerWidthAutoSize = false;
fContainerWidth = pContext->m_fCurColumnWidth;
}
if (!bContainerHeightAutoSize) {
@@ -2295,7 +2294,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
}
if (!bContainerHeightAutoSize) {
CXFA_Node* pParentNode = m_pFormNode->GetNodeItem(XFA_NODEITEM_Parent);
- FX_BOOL bFocrTb = FALSE;
+ bool bFocrTb = false;
if (pParentNode &&
XFA_ItemLayoutProcessor_GetLayout(pParentNode, bFocrTb) ==
XFA_ATTRIBUTEENUM_Row) {
@@ -2305,7 +2304,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
pChildContainer->GetNodeItem(XFA_NODEITEM_NextSibling,
XFA_ObjectType::ContainerNode)) {
fContainerHeight = 0;
- bContainerHeightAutoSize = TRUE;
+ bContainerHeightAutoSize = true;
}
}
}
@@ -2328,7 +2327,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
FX_FLOAT fContentCalculatedWidth = 0, fContentCalculatedHeight = 0;
FX_FLOAT fAvailHeight = fHeightLimit - fTopInset - fBottomInset;
if (fAvailHeight < 0) {
- m_bHasAvailHeight = FALSE;
+ m_bHasAvailHeight = false;
}
fRealHeight = fRealHeight - fTopInset - fBottomInset;
FX_FLOAT fContentCurRowY = 0;
@@ -2372,15 +2371,15 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
fContentCurRowY += InsertKeepLayoutItems();
if (m_nCurChildNodeStage == XFA_ItemLayoutProcessorStages_None) {
XFA_ItemLayoutProcessor_GotoNextContainerNode(
- m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, TRUE);
+ m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, true);
}
fContentCurRowY +=
XFA_ItemLayoutProcessor_InsertPendingItems(this, m_pFormNode);
if (m_pCurChildPreprocessor &&
m_nCurChildNodeStage == XFA_ItemLayoutProcessorStages_Container) {
- if (XFA_ExistContainerKeep(m_pCurChildPreprocessor->GetFormNode(), FALSE)) {
+ if (XFA_ExistContainerKeep(m_pCurChildPreprocessor->GetFormNode(), false)) {
m_pKeepHeadNode = m_pCurChildNode;
- m_bIsProcessKeep = TRUE;
+ m_bIsProcessKeep = true;
m_nCurChildNodeStage = XFA_ItemLayoutProcessorStages_Keep;
}
}
@@ -2446,7 +2445,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
}
while (m_pCurChildNode) {
CXFA_ItemLayoutProcessor* pProcessor = nullptr;
- FX_BOOL bAddedItemInRow = FALSE;
+ bool bAddedItemInRow = false;
fContentCurRowY +=
XFA_ItemLayoutProcessor_InsertPendingItems(this, m_pFormNode);
switch (m_nCurChildNodeStage) {
@@ -2462,29 +2461,29 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
}
CXFA_Node* pLeaderNode = nullptr;
CXFA_Node* pTrailerNode = nullptr;
- FX_BOOL bCreatePage = FALSE;
+ bool bCreatePage = false;
if (bUseBreakControl && m_pPageMgr &&
- m_pPageMgr->ProcessBreakBeforeOrAfter(m_pCurChildNode, TRUE,
+ m_pPageMgr->ProcessBreakBeforeOrAfter(m_pCurChildNode, true,
pLeaderNode, pTrailerNode,
bCreatePage) &&
m_pFormNode->GetElementType() != XFA_Element::Form &&
bCreatePage) {
if (JudgeLeaderOrTrailerForOccur(pLeaderNode)) {
- XFA_ItemLayoutProcessor_AddPendingNode(this, pLeaderNode, TRUE);
+ XFA_ItemLayoutProcessor_AddPendingNode(this, pLeaderNode, true);
}
if (JudgeLeaderOrTrailerForOccur(pTrailerNode)) {
if (m_pFormNode->GetNodeItem(XFA_NODEITEM_Parent)
->GetElementType() == XFA_Element::Form &&
!m_pLayoutItem) {
XFA_ItemLayoutProcessor_AddPendingNode(this, pTrailerNode,
- TRUE);
+ true);
} else {
std::unique_ptr<CXFA_ItemLayoutProcessor> pTempProcessor(
new CXFA_ItemLayoutProcessor(pTrailerNode, nullptr));
XFA_ItemLayoutProcessor_InsertFlowedItem(
this, pTempProcessor.get(), bContainerWidthAutoSize,
bContainerHeightAutoSize, fContainerHeight, eFlowStrategy,
- uCurHAlignState, rgCurLineLayoutItems, FALSE,
+ uCurHAlignState, rgCurLineLayoutItems, false,
XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX, fContentCurRowY,
fContentWidthLimit, fContentCurRowAvailWidth,
fContentCurRowHeight, bAddedItemInRow, bForceEndPage,
@@ -2492,18 +2491,18 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
}
}
XFA_ItemLayoutProcessor_GotoNextContainerNode(
- m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, TRUE);
- bForceEndPage = TRUE;
- bIsManualBreak = TRUE;
+ m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, true);
+ bForceEndPage = true;
+ bIsManualBreak = true;
goto SuspendAndCreateNewRow;
}
} break;
case XFA_ItemLayoutProcessorStages_BreakAfter: {
CXFA_Node* pLeaderNode = nullptr;
CXFA_Node* pTrailerNode = nullptr;
- FX_BOOL bCreatePage = FALSE;
+ bool bCreatePage = false;
if (bUseBreakControl && m_pPageMgr &&
- m_pPageMgr->ProcessBreakBeforeOrAfter(m_pCurChildNode, FALSE,
+ m_pPageMgr->ProcessBreakBeforeOrAfter(m_pCurChildNode, false,
pLeaderNode, pTrailerNode,
bCreatePage) &&
m_pFormNode->GetElementType() != XFA_Element::Form) {
@@ -2513,7 +2512,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
XFA_ItemLayoutProcessor_InsertFlowedItem(
this, pTempProcessor.get(), bContainerWidthAutoSize,
bContainerHeightAutoSize, fContainerHeight, eFlowStrategy,
- uCurHAlignState, rgCurLineLayoutItems, FALSE,
+ uCurHAlignState, rgCurLineLayoutItems, false,
XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX, fContentCurRowY,
fContentWidthLimit, fContentCurRowAvailWidth,
fContentCurRowHeight, bAddedItemInRow, bForceEndPage,
@@ -2532,7 +2531,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
XFA_ItemLayoutProcessor_InsertFlowedItem(
this, pTempProcessor.get(), bContainerWidthAutoSize,
bContainerHeightAutoSize, fContainerHeight, eFlowStrategy,
- uCurHAlignState, rgCurLineLayoutItems, FALSE,
+ uCurHAlignState, rgCurLineLayoutItems, false,
XFA_LAYOUT_FLOAT_MAX, XFA_LAYOUT_FLOAT_MAX, fContentCurRowY,
fContentWidthLimit, fContentCurRowAvailWidth,
fContentCurRowHeight, bAddedItemInRow, bForceEndPage,
@@ -2540,16 +2539,16 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
}
} else {
if (JudgeLeaderOrTrailerForOccur(pLeaderNode)) {
- XFA_ItemLayoutProcessor_AddPendingNode(this, pLeaderNode, TRUE);
+ XFA_ItemLayoutProcessor_AddPendingNode(this, pLeaderNode, true);
}
}
XFA_ItemLayoutProcessor_GotoNextContainerNode(
- m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, TRUE);
+ m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, true);
if (bCreatePage) {
- bForceEndPage = TRUE;
- bIsManualBreak = TRUE;
+ bForceEndPage = true;
+ bIsManualBreak = true;
if (m_nCurChildNodeStage == XFA_ItemLayoutProcessorStages_Done) {
- bBreakDone = TRUE;
+ bBreakDone = true;
}
}
goto SuspendAndCreateNewRow;
@@ -2562,7 +2561,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
m_pCurChildPreprocessor = nullptr;
} else if (m_pPageMgr &&
m_pPageMgr->ProcessBookendLeaderOrTrailer(
- m_pCurChildNode, TRUE, pLeaderNode)) {
+ m_pCurChildNode, true, pLeaderNode)) {
pProcessor = new CXFA_ItemLayoutProcessor(pLeaderNode, m_pPageMgr);
}
if (pProcessor) {
@@ -2588,7 +2587,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
m_pCurChildPreprocessor = nullptr;
} else if (m_pPageMgr &&
m_pPageMgr->ProcessBookendLeaderOrTrailer(
- m_pCurChildNode, FALSE, pTrailerNode)) {
+ m_pCurChildNode, false, pTrailerNode)) {
pProcessor = new CXFA_ItemLayoutProcessor(pTrailerNode, m_pPageMgr);
}
if (pProcessor) {
@@ -2614,15 +2613,15 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
}
if (fContentCurRowY >= fHeightLimit + XFA_LAYOUT_FLOAT_PERCISION &&
XFA_ItemLayoutProcessor_IsTakingSpace(m_pCurChildNode)) {
- bForceEndPage = TRUE;
+ bForceEndPage = true;
goto SuspendAndCreateNewRow;
}
if (m_pCurChildNode->IsContainerNode()) {
- FX_BOOL bNewRow = FALSE;
+ bool bNewRow = false;
if (m_pCurChildPreprocessor) {
pProcessor = m_pCurChildPreprocessor;
m_pCurChildPreprocessor = nullptr;
- bNewRow = TRUE;
+ bNewRow = true;
} else {
pProcessor =
new CXFA_ItemLayoutProcessor(m_pCurChildNode, m_pPageMgr);
@@ -2640,9 +2639,9 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
pContext, bNewRow);
switch (rs) {
case XFA_ItemLayoutProcessorResult_ManualBreak:
- bIsManualBreak = TRUE;
+ bIsManualBreak = true;
case XFA_ItemLayoutProcessorResult_PageFullBreak:
- bForceEndPage = TRUE;
+ bForceEndPage = true;
case XFA_ItemLayoutProcessorResult_RowFullBreak:
goto SuspendAndCreateNewRow;
case XFA_ItemLayoutProcessorResult_Done:
@@ -2660,7 +2659,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
break;
}
XFA_ItemLayoutProcessor_GotoNextContainerNode(
- m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, TRUE);
+ m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, true);
if (bAddedItemInRow && eFlowStrategy == XFA_ATTRIBUTEENUM_Tb) {
break;
} else {
@@ -2682,11 +2681,10 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
break;
}
}
- FX_BOOL bRetValue =
- m_nCurChildNodeStage == XFA_ItemLayoutProcessorStages_Done &&
- m_PendingNodes.empty();
+ bool bRetValue = m_nCurChildNodeStage == XFA_ItemLayoutProcessorStages_Done &&
+ m_PendingNodes.empty();
if (bBreakDone) {
- bRetValue = FALSE;
+ bRetValue = false;
}
XFA_ItemLayoutProcessor_CalculateContainerComponentSizeFromContentSize(
m_pFormNode, bContainerWidthAutoSize, fContentCalculatedWidth,
@@ -2713,17 +2711,17 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
: XFA_ItemLayoutProcessorResult_PageFullBreak);
}
-FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(
- CFX_ArrayTemplate<CXFA_ContentLayoutItem*>(&rgCurLineLayoutItems)[3],
+bool CXFA_ItemLayoutProcessor::CalculateRowChildPosition(
+ CFX_ArrayTemplate<CXFA_ContentLayoutItem*> (&rgCurLineLayoutItems)[3],
XFA_ATTRIBUTEENUM eFlowStrategy,
- FX_BOOL bContainerHeightAutoSize,
- FX_BOOL bContainerWidthAutoSize,
+ bool bContainerHeightAutoSize,
+ bool bContainerWidthAutoSize,
FX_FLOAT& fContentCalculatedWidth,
FX_FLOAT& fContentCalculatedHeight,
FX_FLOAT& fContentCurRowY,
FX_FLOAT fContentCurRowHeight,
FX_FLOAT fContentWidthLimit,
- FX_BOOL bRootForceTb) {
+ bool bRootForceTb) {
int32_t nGroupLengths[3] = {0, 0, 0};
FX_FLOAT fGroupWidths[3] = {0, 0, 0};
int32_t nTotalLength = 0;
@@ -2744,7 +2742,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(
fContentCalculatedHeight = fNewHeight;
}
}
- return FALSE;
+ return false;
}
if (!m_pLayoutItem) {
m_pLayoutItem = CreateContentLayoutItem(m_pFormNode);
@@ -2866,7 +2864,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(
fContentCalculatedHeight = fChildSuppliedHeight;
}
}
- return TRUE;
+ return true;
}
CXFA_Node* CXFA_ItemLayoutProcessor::GetSubformSetParent(
CXFA_Node* pSubformSet) {
@@ -2906,7 +2904,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutField() {
SetCurrentComponentSize(fWidth, fHeight);
}
XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayout(
- FX_BOOL bUseBreakControl,
+ bool bUseBreakControl,
FX_FLOAT fHeightLimit,
FX_FLOAT fRealHeight,
CXFA_LayoutContext* pContext) {
@@ -2915,7 +2913,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayout(
case XFA_Element::Area:
case XFA_Element::ExclGroup:
case XFA_Element::SubformSet: {
- FX_BOOL bRootForceTb = FALSE;
+ bool bRootForceTb = false;
CXFA_Node* pLayoutNode = GetSubformSetParent(m_pFormNode);
XFA_ATTRIBUTEENUM eLayoutStrategy =
XFA_ItemLayoutProcessor_GetLayout(pLayoutNode, bRootForceTb);
@@ -2971,10 +2969,10 @@ void CXFA_ItemLayoutProcessor::SetCurrentComponentSize(FX_FLOAT fWidth,
m_pLayoutItem->m_sSize = CFX_SizeF(fWidth, fHeight);
}
-FX_BOOL CXFA_ItemLayoutProcessor::JudgeLeaderOrTrailerForOccur(
+bool CXFA_ItemLayoutProcessor::JudgeLeaderOrTrailerForOccur(
CXFA_Node* pFormNode) {
if (!pFormNode)
- return FALSE;
+ return false;
CXFA_Node* pTemplate = pFormNode->GetTemplateNode();
if (!pTemplate)
@@ -2983,12 +2981,12 @@ FX_BOOL CXFA_ItemLayoutProcessor::JudgeLeaderOrTrailerForOccur(
CXFA_Occur NodeOccur(pTemplate->GetFirstChildByClass(XFA_Element::Occur));
int32_t iMax = NodeOccur.GetMax();
if (iMax < 0)
- return TRUE;
+ return true;
int32_t iCount = m_PendingNodesCount[pTemplate];
if (iCount >= iMax)
- return FALSE;
+ return false;
m_PendingNodesCount[pTemplate] = iCount + 1;
- return TRUE;
+ return true;
}
diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.h b/xfa/fxfa/parser/xfa_layout_itemlayout.h
index 6da09cb3f7..0d114a4d5c 100644
--- a/xfa/fxfa/parser/xfa_layout_itemlayout.h
+++ b/xfa/fxfa/parser/xfa_layout_itemlayout.h
@@ -49,13 +49,13 @@ class CXFA_LayoutContext {
CXFA_LayoutContext()
: m_prgSpecifiedColumnWidths(nullptr),
m_fCurColumnWidth(0),
- m_bCurColumnWidthAvaiable(FALSE),
+ m_bCurColumnWidthAvaiable(false),
m_pOverflowProcessor(nullptr),
m_pOverflowNode(nullptr) {}
~CXFA_LayoutContext() { m_pOverflowProcessor = nullptr; }
CFX_ArrayTemplate<FX_FLOAT>* m_prgSpecifiedColumnWidths;
FX_FLOAT m_fCurColumnWidth;
- FX_BOOL m_bCurColumnWidthAvaiable;
+ bool m_bCurColumnWidthAvaiable;
CXFA_ItemLayoutProcessor* m_pOverflowProcessor;
CXFA_Node* m_pOverflowNode;
};
@@ -66,7 +66,7 @@ class CXFA_ItemLayoutProcessor {
~CXFA_ItemLayoutProcessor();
XFA_ItemLayoutProcessorResult DoLayout(
- FX_BOOL bUseBreakControl,
+ bool bUseBreakControl,
FX_FLOAT fHeightLimit,
FX_FLOAT fRealHeight = XFA_LAYOUT_FLOAT_MAX,
CXFA_LayoutContext* pContext = nullptr);
@@ -79,32 +79,31 @@ class CXFA_ItemLayoutProcessor {
void SetCurrentComponentSize(FX_FLOAT fWidth, FX_FLOAT fHeight);
CXFA_Node* GetFormNode() { return m_pFormNode; }
- FX_BOOL HasLayoutItem() { return !!m_pLayoutItem; }
+ bool HasLayoutItem() { return !!m_pLayoutItem; }
CXFA_ContentLayoutItem* ExtractLayoutItem();
- static FX_BOOL IncrementRelayoutNode(CXFA_LayoutProcessor* pLayoutProcessor,
- CXFA_Node* pNode,
- CXFA_Node* pParentNode);
+ static bool IncrementRelayoutNode(CXFA_LayoutProcessor* pLayoutProcessor,
+ CXFA_Node* pNode,
+ CXFA_Node* pParentNode);
static void CalculatePositionedContainerPos(CXFA_Node* pNode,
FX_FLOAT fWidth,
FX_FLOAT fHeight,
FX_FLOAT& fAbsoluteX,
FX_FLOAT& fAbsoluteY);
- static FX_BOOL FindLayoutItemSplitPos(CXFA_ContentLayoutItem* pLayoutItem,
- FX_FLOAT fCurVerticalOffset,
- FX_FLOAT& fProposedSplitPos,
- FX_BOOL& bAppChange,
- FX_BOOL bCalculateMargin = TRUE);
+ static bool FindLayoutItemSplitPos(CXFA_ContentLayoutItem* pLayoutItem,
+ FX_FLOAT fCurVerticalOffset,
+ FX_FLOAT& fProposedSplitPos,
+ bool& bAppChange,
+ bool bCalculateMargin = true);
FX_FLOAT FindSplitPos(FX_FLOAT fProposedSplitPos);
void SplitLayoutItem(CXFA_ContentLayoutItem* pLayoutItem,
CXFA_ContentLayoutItem* pSecondParent,
FX_FLOAT fSplitPos);
void SplitLayoutItem(FX_FLOAT fSplitPos);
- FX_BOOL JudgePutNextPage(
- CXFA_ContentLayoutItem* pParentLayoutItem,
- FX_FLOAT fChildHeight,
- CFX_ArrayTemplate<CXFA_ContentLayoutItem*>& pKeepItems);
- FX_BOOL ProcessKeepForSplite(
+ bool JudgePutNextPage(CXFA_ContentLayoutItem* pParentLayoutItem,
+ FX_FLOAT fChildHeight,
+ CFX_ArrayTemplate<CXFA_ContentLayoutItem*>& pKeepItems);
+ bool ProcessKeepForSplite(
CXFA_ItemLayoutProcessor* pParentProcessor,
CXFA_ItemLayoutProcessor* pChildProcessor,
XFA_ItemLayoutProcessorResult eRetValue,
@@ -112,64 +111,63 @@ class CXFA_ItemLayoutProcessor {
FX_FLOAT& fContentCurRowAvailWidth,
FX_FLOAT& fContentCurRowHeight,
FX_FLOAT& fContentCurRowY,
- FX_BOOL& bAddedItemInRow,
- FX_BOOL& bForceEndPage,
+ bool& bAddedItemInRow,
+ bool& bForceEndPage,
XFA_ItemLayoutProcessorResult& result);
FX_FLOAT InsertKeepLayoutItems();
void DoLayoutPageArea(CXFA_ContainerLayoutItem* pPageAreaLayoutItem);
- FX_BOOL CalculateRowChildPosition(
- CFX_ArrayTemplate<CXFA_ContentLayoutItem*>(&rgCurLineLayoutItems)[3],
+ bool CalculateRowChildPosition(
+ CFX_ArrayTemplate<CXFA_ContentLayoutItem*> (&rgCurLineLayoutItems)[3],
XFA_ATTRIBUTEENUM eFlowStrategy,
- FX_BOOL bContainerHeightAutoSize,
- FX_BOOL bContainerWidthAutoSize,
+ bool bContainerHeightAutoSize,
+ bool bContainerWidthAutoSize,
FX_FLOAT& fContentCalculatedWidth,
FX_FLOAT& fContentCalculatedHeight,
FX_FLOAT& fContentCurRowY,
FX_FLOAT fContentCurRowHeight,
FX_FLOAT fContentWidthLimit,
- FX_BOOL bRootForceTb = FALSE);
+ bool bRootForceTb = false);
void ProcessUnUseOverFlow(CXFA_Node* pLeaderNode,
CXFA_Node* pTrailerNode,
CXFA_ContentLayoutItem* pTrailerItem,
CXFA_Node* pFormNode);
void ProcessUnUseBinds(CXFA_Node* pFormNode);
- FX_BOOL IsAddNewRowForTrailer(CXFA_ContentLayoutItem* pTrailerItem);
- FX_BOOL JudgeLeaderOrTrailerForOccur(CXFA_Node* pFormNode);
+ bool IsAddNewRowForTrailer(CXFA_ContentLayoutItem* pTrailerItem);
+ bool JudgeLeaderOrTrailerForOccur(CXFA_Node* pFormNode);
CXFA_ContentLayoutItem* CreateContentLayoutItem(CXFA_Node* pFormNode);
protected:
void DoLayoutPositionedContainer(CXFA_LayoutContext* pContext = nullptr);
void DoLayoutTableContainer(CXFA_Node* pLayoutNode);
XFA_ItemLayoutProcessorResult DoLayoutFlowedContainer(
- FX_BOOL bUseBreakControl,
+ bool bUseBreakControl,
XFA_ATTRIBUTEENUM eFlowStrategy,
FX_FLOAT fHeightLimit,
FX_FLOAT fRealHeight,
CXFA_LayoutContext* pContext = nullptr,
- FX_BOOL bRootForceTb = FALSE);
+ bool bRootForceTb = false);
void DoLayoutField();
void XFA_ItemLayoutProcessor_GotoNextContainerNode(
CXFA_Node*& pCurActionNode,
XFA_ItemLayoutProcessorStages& nCurStage,
CXFA_Node* pParentContainer,
- FX_BOOL bUsePageBreak);
+ bool bUsePageBreak);
- FX_BOOL ProcessKeepNodesForCheckNext(CXFA_Node*& pCurActionNode,
- XFA_ItemLayoutProcessorStages& nCurStage,
- CXFA_Node*& pNextContainer,
- FX_BOOL& bLastKeepNode);
+ bool ProcessKeepNodesForCheckNext(CXFA_Node*& pCurActionNode,
+ XFA_ItemLayoutProcessorStages& nCurStage,
+ CXFA_Node*& pNextContainer,
+ bool& bLastKeepNode);
- FX_BOOL ProcessKeepNodesForBreakBefore(
- CXFA_Node*& pCurActionNode,
- XFA_ItemLayoutProcessorStages& nCurStage,
- CXFA_Node* pContainerNode);
+ bool ProcessKeepNodesForBreakBefore(CXFA_Node*& pCurActionNode,
+ XFA_ItemLayoutProcessorStages& nCurStage,
+ CXFA_Node* pContainerNode);
CXFA_Node* GetSubformSetParent(CXFA_Node* pSubformSet);
public:
- FX_BOOL m_bKeepBreakFinish;
- FX_BOOL m_bIsProcessKeep;
+ bool m_bKeepBreakFinish;
+ bool m_bIsProcessKeep;
CXFA_Node* m_pKeepHeadNode;
CXFA_Node* m_pKeepTailNode;
CXFA_Node* m_pFormNode;
@@ -181,17 +179,17 @@ class CXFA_ItemLayoutProcessor {
FX_FLOAT m_fUsedSize;
CXFA_LayoutPageMgr* m_pPageMgr;
std::list<CXFA_Node*> m_PendingNodes;
- FX_BOOL m_bBreakPending;
+ bool m_bBreakPending;
CFX_ArrayTemplate<FX_FLOAT> m_rgSpecifiedColumnWidths;
CFX_ArrayTemplate<CXFA_ContentLayoutItem*> m_arrayKeepItems;
std::map<CXFA_Node*, int32_t> m_PendingNodesCount;
FX_FLOAT m_fLastRowWidth;
FX_FLOAT m_fLastRowY;
FX_FLOAT m_fWidthLimite;
- FX_BOOL m_bUseInheriated;
+ bool m_bUseInheriated;
XFA_ItemLayoutProcessorResult m_ePreProcessRs;
- FX_BOOL m_bHasAvailHeight;
+ bool m_bHasAvailHeight;
};
-FX_BOOL XFA_ItemLayoutProcessor_IsTakingSpace(CXFA_Node* pNode);
+bool XFA_ItemLayoutProcessor_IsTakingSpace(CXFA_Node* pNode);
#endif // XFA_FXFA_PARSER_XFA_LAYOUT_ITEMLAYOUT_H_
diff --git a/xfa/fxfa/parser/xfa_locale.cpp b/xfa/fxfa/parser/xfa_locale.cpp
index 5e8c7a208c..8c106209aa 100644
--- a/xfa/fxfa/parser/xfa_locale.cpp
+++ b/xfa/fxfa/parser/xfa_locale.cpp
@@ -88,32 +88,32 @@ void CXFA_XMLLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const {
void CXFA_XMLLocale::GetMonthName(int32_t nMonth,
CFX_WideString& wsMonthName,
- FX_BOOL bAbbr) const {
+ bool bAbbr) const {
wsMonthName = GetCalendarSymbol("month", nMonth, bAbbr);
}
void CXFA_XMLLocale::GetDayName(int32_t nWeek,
CFX_WideString& wsDayName,
- FX_BOOL bAbbr) const {
+ bool bAbbr) const {
wsDayName = GetCalendarSymbol("day", nWeek, bAbbr);
}
void CXFA_XMLLocale::GetMeridiemName(CFX_WideString& wsMeridiemName,
- FX_BOOL bAM) const {
- wsMeridiemName = GetCalendarSymbol("meridiem", bAM ? 0 : 1, FALSE);
+ bool bAM) const {
+ wsMeridiemName = GetCalendarSymbol("meridiem", bAM ? 0 : 1, false);
}
void CXFA_XMLLocale::GetTimeZone(FX_TIMEZONE& tz) const {
CXFA_TimeZoneProvider::Get()->GetTimeZone(tz);
}
-void CXFA_XMLLocale::GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD) const {
- wsEraName = GetCalendarSymbol("era", bAD ? 1 : 0, FALSE);
+void CXFA_XMLLocale::GetEraName(CFX_WideString& wsEraName, bool bAD) const {
+ wsEraName = GetCalendarSymbol("era", bAD ? 1 : 0, false);
}
CFX_WideString CXFA_XMLLocale::GetCalendarSymbol(const CFX_ByteStringC& symbol,
int index,
- FX_BOOL bAbbr) const {
+ bool bAbbr) const {
CFX_ByteString pstrSymbolNames = symbol + "Names";
CFX_WideString wsSymbolName = L"";
if (m_pLocaleData) {
@@ -272,28 +272,28 @@ void CXFA_NodeLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const {
void CXFA_NodeLocale::GetMonthName(int32_t nMonth,
CFX_WideString& wsMonthName,
- FX_BOOL bAbbr) const {
+ bool bAbbr) const {
wsMonthName = GetCalendarSymbol(XFA_Element::MonthNames, nMonth, bAbbr);
}
void CXFA_NodeLocale::GetDayName(int32_t nWeek,
CFX_WideString& wsDayName,
- FX_BOOL bAbbr) const {
+ bool bAbbr) const {
wsDayName = GetCalendarSymbol(XFA_Element::DayNames, nWeek, bAbbr);
}
void CXFA_NodeLocale::GetMeridiemName(CFX_WideString& wsMeridiemName,
- FX_BOOL bAM) const {
+ bool bAM) const {
wsMeridiemName =
- GetCalendarSymbol(XFA_Element::MeridiemNames, bAM ? 0 : 1, FALSE);
+ GetCalendarSymbol(XFA_Element::MeridiemNames, bAM ? 0 : 1, false);
}
void CXFA_NodeLocale::GetTimeZone(FX_TIMEZONE& tz) const {
CXFA_TimeZoneProvider::Get()->GetTimeZone(tz);
}
-void CXFA_NodeLocale::GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD) const {
- wsEraName = GetCalendarSymbol(XFA_Element::EraNames, bAD ? 1 : 0, FALSE);
+void CXFA_NodeLocale::GetEraName(CFX_WideString& wsEraName, bool bAD) const {
+ wsEraName = GetCalendarSymbol(XFA_Element::EraNames, bAD ? 1 : 0, false);
}
void CXFA_NodeLocale::GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType,
@@ -378,7 +378,7 @@ CFX_WideString CXFA_NodeLocale::GetSymbol(
CFX_WideString CXFA_NodeLocale::GetCalendarSymbol(XFA_Element eElement,
int index,
- FX_BOOL bAbbr) const {
+ bool bAbbr) const {
CXFA_Node* pCalendar =
m_pLocale ? m_pLocale->GetChild(0, XFA_Element::CalendarSymbols)
: nullptr;
diff --git a/xfa/fxfa/parser/xfa_locale.h b/xfa/fxfa/parser/xfa_locale.h
index 75104b456c..b9a3259ead 100644
--- a/xfa/fxfa/parser/xfa_locale.h
+++ b/xfa/fxfa/parser/xfa_locale.h
@@ -25,14 +25,14 @@ class CXFA_XMLLocale : public IFX_Locale {
void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const override;
void GetMonthName(int32_t nMonth,
CFX_WideString& wsMonthName,
- FX_BOOL bAbbr = TRUE) const override;
+ bool bAbbr = true) const override;
void GetDayName(int32_t nWeek,
CFX_WideString& wsDayName,
- FX_BOOL bAbbr = TRUE) const override;
+ bool bAbbr = true) const override;
void GetMeridiemName(CFX_WideString& wsMeridiemName,
- FX_BOOL bAM = TRUE) const override;
+ bool bAM = true) const override;
void GetTimeZone(FX_TIMEZONE& tz) const override;
- void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const override;
+ void GetEraName(CFX_WideString& wsEraName, bool bAD = true) const override;
void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType,
CFX_WideString& wsPattern) const override;
@@ -48,7 +48,7 @@ class CXFA_XMLLocale : public IFX_Locale {
CFX_WideString& wsPattern) const;
CFX_WideString GetCalendarSymbol(const CFX_ByteStringC& symbol,
int index,
- FX_BOOL bAbbr) const;
+ bool bAbbr) const;
private:
std::unique_ptr<CXML_Element> m_pLocaleData;
@@ -67,14 +67,14 @@ class CXFA_NodeLocale : public IFX_Locale {
void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const override;
void GetMonthName(int32_t nMonth,
CFX_WideString& wsMonthName,
- FX_BOOL bAbbr = TRUE) const override;
+ bool bAbbr = true) const override;
void GetDayName(int32_t nWeek,
CFX_WideString& wsDayName,
- FX_BOOL bAbbr = TRUE) const override;
+ bool bAbbr = true) const override;
void GetMeridiemName(CFX_WideString& wsMeridiemName,
- FX_BOOL bAM = TRUE) const override;
+ bool bAM = true) const override;
void GetTimeZone(FX_TIMEZONE& tz) const override;
- void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const override;
+ void GetEraName(CFX_WideString& wsEraName, bool bAD = true) const override;
void GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType,
CFX_WideString& wsPattern) const override;
@@ -90,7 +90,7 @@ class CXFA_NodeLocale : public IFX_Locale {
const CFX_WideStringC& symbol_type) const;
CFX_WideString GetCalendarSymbol(XFA_Element eElement,
int index,
- FX_BOOL bAbbr) const;
+ bool bAbbr) const;
CXFA_Node* const m_pLocale;
};
diff --git a/xfa/fxfa/parser/xfa_localemgr.cpp b/xfa/fxfa/parser/xfa_localemgr.cpp
index b7f0fbea59..74565a7ea0 100644
--- a/xfa/fxfa/parser/xfa_localemgr.cpp
+++ b/xfa/fxfa/parser/xfa_localemgr.cpp
@@ -1048,7 +1048,7 @@ static std::unique_ptr<IFX_Locale> XFA_GetLocaleFromBuffer(const uint8_t* pBuf,
std::unique_ptr<CXML_Element> pLocale;
uint8_t* pOut = nullptr;
uint32_t dwSize;
- pCodecMgr->GetFlateModule()->FlateOrLZWDecode(FALSE, pBuf, nBufLen, TRUE, 0,
+ pCodecMgr->GetFlateModule()->FlateOrLZWDecode(false, pBuf, nBufLen, true, 0,
0, 0, 0, 0, pOut, dwSize);
if (pOut) {
pLocale.reset(CXML_Element::Parse(pOut, dwSize));
@@ -1237,7 +1237,7 @@ CFX_WideStringC CXFA_LocaleMgr::GetConfigLocaleName(CXFA_Node* pConfig) {
pCommon ? pCommon->GetFirstChildByClass(XFA_Element::Locale)
: nullptr;
if (pLocale) {
- pLocale->TryCData(XFA_ATTRIBUTE_Value, m_wsConfigLocale, FALSE);
+ pLocale->TryCData(XFA_ATTRIBUTE_Value, m_wsConfigLocale, false);
}
}
m_dwLocaleFlags |= 0x01;
diff --git a/xfa/fxfa/parser/xfa_localevalue.cpp b/xfa/fxfa/parser/xfa_localevalue.cpp
index 27f3b0cf3f..b662121230 100644
--- a/xfa/fxfa/parser/xfa_localevalue.cpp
+++ b/xfa/fxfa/parser/xfa_localevalue.cpp
@@ -31,12 +31,12 @@ static const FX_DOUBLE fraction_scales[] = {0.1,
0.0000000000000001};
CXFA_LocaleValue::CXFA_LocaleValue() {
m_dwType = XFA_VT_NULL;
- m_bValid = TRUE;
+ m_bValid = true;
m_pLocaleMgr = nullptr;
}
CXFA_LocaleValue::CXFA_LocaleValue(const CXFA_LocaleValue& value) {
m_dwType = XFA_VT_NULL;
- m_bValid = TRUE;
+ m_bValid = true;
m_pLocaleMgr = nullptr;
*this = value;
}
@@ -60,7 +60,7 @@ CXFA_LocaleValue::CXFA_LocaleValue(uint32_t dwType,
IFX_Locale* pLocale,
CXFA_LocaleMgr* pLocaleMgr) {
m_pLocaleMgr = pLocaleMgr;
- m_bValid = TRUE;
+ m_bValid = true;
m_dwType = dwType;
m_bValid = ParsePatternValue(wsValue, wsFormat, pLocale);
}
@@ -93,10 +93,10 @@ static FX_LOCALECATEGORY XFA_ValugeCategory(FX_LOCALECATEGORY eCategory,
}
return eCategory;
}
-FX_BOOL CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue,
- const CFX_WideString& wsPattern,
- IFX_Locale* pLocale,
- CFX_WideString* pMatchFormat) {
+bool CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue,
+ const CFX_WideString& wsPattern,
+ IFX_Locale* pLocale,
+ CFX_WideString* pMatchFormat) {
CFX_WideString wsOutput;
IFX_Locale* locale = m_pLocaleMgr->GetDefLocale();
if (pLocale) {
@@ -104,11 +104,11 @@ FX_BOOL CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue,
}
CFX_FormatString* pFormat = nullptr;
if (m_pLocaleMgr)
- pFormat = new CFX_FormatString(m_pLocaleMgr, FALSE);
+ pFormat = new CFX_FormatString(m_pLocaleMgr, false);
CFX_WideStringArray wsPatterns;
pFormat->SplitFormatString(wsPattern, wsPatterns);
- FX_BOOL bRet = FALSE;
+ bool bRet = false;
int32_t iCount = wsPatterns.GetSize();
int32_t i = 0;
for (; i < iCount && !bRet; i++) {
@@ -177,7 +177,7 @@ FX_BOOL CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue,
break;
}
default:
- bRet = FALSE;
+ bRet = false;
break;
}
}
@@ -214,7 +214,7 @@ FX_FLOAT CXFA_LocaleValue::GetNum() const {
uint32_t dwFractional = 0;
int32_t nExponent = 0;
int cc = 0;
- FX_BOOL bNegative = FALSE, bExpSign = FALSE;
+ bool bNegative = false, bExpSign = false;
const FX_WCHAR* str = m_wsValue.c_str();
int len = m_wsValue.GetLength();
while (FXSYS_iswspace(str[cc]) && cc < len) {
@@ -226,7 +226,7 @@ FX_FLOAT CXFA_LocaleValue::GetNum() const {
if (str[0] == '+') {
cc++;
} else if (str[0] == '-') {
- bNegative = TRUE;
+ bNegative = true;
cc++;
}
int nIntegralLen = 0;
@@ -261,7 +261,7 @@ FX_FLOAT CXFA_LocaleValue::GetNum() const {
if (str[cc] == '+') {
cc++;
} else if (str[cc] == '-') {
- bExpSign = TRUE;
+ bExpSign = true;
cc++;
}
}
@@ -290,7 +290,7 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const {
uint32_t dwFractional = 0;
int32_t nExponent = 0;
int32_t cc = 0;
- FX_BOOL bNegative = FALSE, bExpSign = FALSE;
+ bool bNegative = false, bExpSign = false;
const FX_WCHAR* str = m_wsValue.c_str();
int len = m_wsValue.GetLength();
while (FXSYS_iswspace(str[cc]) && cc < len) {
@@ -302,7 +302,7 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const {
if (str[0] == '+') {
cc++;
} else if (str[0] == '-') {
- bNegative = TRUE;
+ bNegative = true;
cc++;
}
int32_t nIntegralLen = 0;
@@ -337,7 +337,7 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const {
if (str[cc] == '+') {
cc++;
} else if (str[cc] == '-') {
- bExpSign = TRUE;
+ bExpSign = true;
cc++;
}
}
@@ -390,40 +390,40 @@ CFX_Unitime CXFA_LocaleValue::GetDateTime() const {
}
return CFX_Unitime();
}
-FX_BOOL CXFA_LocaleValue::SetText(const CFX_WideString& wsText) {
+bool CXFA_LocaleValue::SetText(const CFX_WideString& wsText) {
m_dwType = XFA_VT_TEXT;
m_wsValue = wsText;
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_LocaleValue::SetText(const CFX_WideString& wsText,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale) {
+bool CXFA_LocaleValue::SetText(const CFX_WideString& wsText,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale) {
m_dwType = XFA_VT_TEXT;
return m_bValid = ParsePatternValue(wsText, wsFormat, pLocale);
}
-FX_BOOL CXFA_LocaleValue::SetNum(FX_FLOAT fNum) {
+bool CXFA_LocaleValue::SetNum(FX_FLOAT fNum) {
m_dwType = XFA_VT_FLOAT;
m_wsValue.Format(L"%.8g", (FX_DOUBLE)fNum);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_LocaleValue::SetNum(const CFX_WideString& wsNum,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale) {
+bool CXFA_LocaleValue::SetNum(const CFX_WideString& wsNum,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale) {
m_dwType = XFA_VT_FLOAT;
return m_bValid = ParsePatternValue(wsNum, wsFormat, pLocale);
}
-FX_BOOL CXFA_LocaleValue::SetDate(const CFX_Unitime& d) {
+bool CXFA_LocaleValue::SetDate(const CFX_Unitime& d) {
m_dwType = XFA_VT_DATE;
m_wsValue.Format(L"%04d-%02d-%02d", d.GetYear(), d.GetMonth(), d.GetDay());
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_LocaleValue::SetDate(const CFX_WideString& wsDate,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale) {
+bool CXFA_LocaleValue::SetDate(const CFX_WideString& wsDate,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale) {
m_dwType = XFA_VT_DATE;
return m_bValid = ParsePatternValue(wsDate, wsFormat, pLocale);
}
-FX_BOOL CXFA_LocaleValue::SetTime(const CFX_Unitime& t) {
+bool CXFA_LocaleValue::SetTime(const CFX_Unitime& t) {
m_dwType = XFA_VT_TIME;
m_wsValue.Format(L"%02d:%02d:%02d", t.GetHour(), t.GetMinute(),
t.GetSecond());
@@ -432,15 +432,15 @@ FX_BOOL CXFA_LocaleValue::SetTime(const CFX_Unitime& t) {
wsTemp.Format(L"%:03d", t.GetMillisecond());
m_wsValue += wsTemp;
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_LocaleValue::SetTime(const CFX_WideString& wsTime,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale) {
+bool CXFA_LocaleValue::SetTime(const CFX_WideString& wsTime,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale) {
m_dwType = XFA_VT_TIME;
return m_bValid = ParsePatternValue(wsTime, wsFormat, pLocale);
}
-FX_BOOL CXFA_LocaleValue::SetDateTime(const CFX_Unitime& dt) {
+bool CXFA_LocaleValue::SetDateTime(const CFX_Unitime& dt) {
m_dwType = XFA_VT_DATETIME;
m_wsValue.Format(L"%04d-%02d-%02dT%02d:%02d:%02d", dt.GetYear(),
dt.GetMonth(), dt.GetDay(), dt.GetHour(), dt.GetMinute(),
@@ -450,24 +450,24 @@ FX_BOOL CXFA_LocaleValue::SetDateTime(const CFX_Unitime& dt) {
wsTemp.Format(L"%:03d", dt.GetMillisecond());
m_wsValue += wsTemp;
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_LocaleValue::SetDateTime(const CFX_WideString& wsDateTime,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale) {
+bool CXFA_LocaleValue::SetDateTime(const CFX_WideString& wsDateTime,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale) {
m_dwType = XFA_VT_DATETIME;
return m_bValid = ParsePatternValue(wsDateTime, wsFormat, pLocale);
}
-FX_BOOL CXFA_LocaleValue::FormatPatterns(CFX_WideString& wsResult,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale,
- XFA_VALUEPICTURE eValueType) const {
+bool CXFA_LocaleValue::FormatPatterns(CFX_WideString& wsResult,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale,
+ XFA_VALUEPICTURE eValueType) const {
wsResult.clear();
- FX_BOOL bRet = FALSE;
+ bool bRet = false;
CFX_FormatString* pFormat = nullptr;
if (m_pLocaleMgr)
- pFormat = new CFX_FormatString(m_pLocaleMgr, FALSE);
+ pFormat = new CFX_FormatString(m_pLocaleMgr, false);
CFX_WideStringArray wsPatterns;
pFormat->SplitFormatString(wsFormat, wsPatterns);
@@ -481,21 +481,20 @@ FX_BOOL CXFA_LocaleValue::FormatPatterns(CFX_WideString& wsResult,
pFormat->Release();
return bRet;
}
-FX_BOOL CXFA_LocaleValue::FormatSinglePattern(
- CFX_WideString& wsResult,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale,
- XFA_VALUEPICTURE eValueType) const {
+bool CXFA_LocaleValue::FormatSinglePattern(CFX_WideString& wsResult,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale,
+ XFA_VALUEPICTURE eValueType) const {
IFX_Locale* locale = m_pLocaleMgr->GetDefLocale();
if (pLocale) {
m_pLocaleMgr->SetDefLocale(pLocale);
}
wsResult.clear();
- FX_BOOL bRet = FALSE;
+ bool bRet = false;
CFX_FormatString* pFormat = nullptr;
if (m_pLocaleMgr)
- pFormat = new CFX_FormatString(m_pLocaleMgr, FALSE);
+ pFormat = new CFX_FormatString(m_pLocaleMgr, false);
FX_LOCALECATEGORY eCategory = pFormat->GetCategory(wsFormat);
eCategory = XFA_ValugeCategory(eCategory, m_dwType);
@@ -530,7 +529,7 @@ FX_BOOL CXFA_LocaleValue::FormatSinglePattern(
break;
default:
wsResult = m_wsValue;
- bRet = TRUE;
+ bRet = true;
}
pFormat->Release();
if (!bRet && (eCategory != FX_LOCALECATEGORY_Num ||
@@ -542,13 +541,13 @@ FX_BOOL CXFA_LocaleValue::FormatSinglePattern(
}
return bRet;
}
-static FX_BOOL XFA_ValueSplitDateTime(const CFX_WideString& wsDateTime,
- CFX_WideString& wsDate,
- CFX_WideString& wsTime) {
+static bool XFA_ValueSplitDateTime(const CFX_WideString& wsDateTime,
+ CFX_WideString& wsDate,
+ CFX_WideString& wsTime) {
wsDate = L"";
wsTime = L"";
if (wsDateTime.IsEmpty()) {
- return FALSE;
+ return false;
}
int nSplitIndex = -1;
nSplitIndex = wsDateTime.Find('T');
@@ -556,58 +555,58 @@ static FX_BOOL XFA_ValueSplitDateTime(const CFX_WideString& wsDateTime,
nSplitIndex = wsDateTime.Find(' ');
}
if (nSplitIndex < 0) {
- return FALSE;
+ return false;
}
wsDate = wsDateTime.Left(nSplitIndex);
wsTime = wsDateTime.Right(wsDateTime.GetLength() - nSplitIndex - 1);
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_LocaleValue::ValidateCanonicalValue(const CFX_WideString& wsValue,
- uint32_t dwVType) {
+bool CXFA_LocaleValue::ValidateCanonicalValue(const CFX_WideString& wsValue,
+ uint32_t dwVType) {
if (wsValue.IsEmpty()) {
- return TRUE;
+ return true;
}
CFX_Unitime dt;
switch (dwVType) {
case XFA_VT_DATE: {
if (ValidateCanonicalDate(wsValue, dt)) {
- return TRUE;
+ return true;
}
CFX_WideString wsDate, wsTime;
if (XFA_ValueSplitDateTime(wsValue, wsDate, wsTime) &&
ValidateCanonicalDate(wsDate, dt)) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
case XFA_VT_TIME: {
if (ValidateCanonicalTime(wsValue)) {
- return TRUE;
+ return true;
}
CFX_WideString wsDate, wsTime;
if (XFA_ValueSplitDateTime(wsValue, wsDate, wsTime) &&
ValidateCanonicalTime(wsTime)) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
case XFA_VT_DATETIME: {
CFX_WideString wsDate, wsTime;
if (XFA_ValueSplitDateTime(wsValue, wsDate, wsTime) &&
ValidateCanonicalDate(wsDate, dt) && ValidateCanonicalTime(wsTime)) {
- return TRUE;
+ return true;
}
} break;
}
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_LocaleValue::ValidateCanonicalDate(const CFX_WideString& wsDate,
- CFX_Unitime& unDate) {
+bool CXFA_LocaleValue::ValidateCanonicalDate(const CFX_WideString& wsDate,
+ CFX_Unitime& unDate) {
const uint16_t LastDay[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const uint16_t wCountY = 4, wCountM = 2, wCountD = 2;
int nLen = wsDate.GetLength();
if (nLen < wCountY || nLen > wCountY + wCountM + wCountD + 2) {
- return FALSE;
+ return false;
}
const bool bSymbol = wsDate.Find(0x2D) != -1;
uint16_t wYear = 0;
@@ -617,79 +616,79 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalDate(const CFX_WideString& wsDate,
int nIndex = 0, nStart = 0;
while (pDate[nIndex] != '\0' && nIndex < wCountY) {
if (!FXSYS_isDecimalDigit(pDate[nIndex])) {
- return FALSE;
+ return false;
}
wYear = (pDate[nIndex] - '0') + wYear * 10;
nIndex++;
}
if (bSymbol) {
if (pDate[nIndex] != 0x2D) {
- return FALSE;
+ return false;
}
nIndex++;
}
nStart = nIndex;
while (pDate[nIndex] != '\0' && nIndex - nStart < wCountM && nIndex < nLen) {
if (!FXSYS_isDecimalDigit(pDate[nIndex])) {
- return FALSE;
+ return false;
}
wMonth = (pDate[nIndex] - '0') + wMonth * 10;
nIndex++;
}
if (bSymbol) {
if (pDate[nIndex] != 0x2D) {
- return FALSE;
+ return false;
}
nIndex++;
}
nStart = nIndex;
while (pDate[nIndex] != '\0' && nIndex - nStart < wCountD && nIndex < nLen) {
if (!FXSYS_isDecimalDigit(pDate[nIndex])) {
- return FALSE;
+ return false;
}
wDay = (pDate[nIndex] - '0') + wDay * 10;
nIndex++;
}
if (nIndex != nLen) {
- return FALSE;
+ return false;
}
if (wYear < 1900 || wYear > 2029) {
- return FALSE;
+ return false;
}
if (wMonth < 1 || wMonth > 12) {
if (wMonth == 0 && nLen == wCountY) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
if (wDay < 1) {
if (wDay == 0 && (nLen == wCountY + wCountM)) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
if (wMonth == 2) {
if (wYear % 400 == 0 || (wYear % 100 != 0 && wYear % 4 == 0)) {
if (wDay > 29) {
- return FALSE;
+ return false;
}
} else {
if (wDay > 28) {
- return FALSE;
+ return false;
}
}
} else if (wDay > LastDay[wMonth - 1]) {
- return FALSE;
+ return false;
}
CFX_Unitime ut;
ut.Set(wYear, static_cast<uint8_t>(wMonth), static_cast<uint8_t>(wDay));
unDate = unDate + ut;
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_LocaleValue::ValidateCanonicalTime(const CFX_WideString& wsTime) {
+bool CXFA_LocaleValue::ValidateCanonicalTime(const CFX_WideString& wsTime) {
int nLen = wsTime.GetLength();
if (nLen < 2)
- return FALSE;
+ return false;
const uint16_t wCountH = 2;
const uint16_t wCountM = 2;
const uint16_t wCountS = 2;
@@ -704,42 +703,42 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalTime(const CFX_WideString& wsTime) {
int nStart = 0;
while (nIndex - nStart < wCountH && pTime[nIndex]) {
if (!FXSYS_isDecimalDigit(pTime[nIndex]))
- return FALSE;
+ return false;
wHour = pTime[nIndex] - '0' + wHour * 10;
nIndex++;
}
if (bSymbol) {
if (nIndex < nLen && pTime[nIndex] != ':')
- return FALSE;
+ return false;
nIndex++;
}
nStart = nIndex;
while (nIndex - nStart < wCountM && nIndex < nLen && pTime[nIndex]) {
if (!FXSYS_isDecimalDigit(pTime[nIndex]))
- return FALSE;
+ return false;
wMinute = pTime[nIndex] - '0' + wMinute * 10;
nIndex++;
}
if (bSymbol) {
if (nIndex < nLen && pTime[nIndex] != ':')
- return FALSE;
+ return false;
nIndex++;
}
nStart = nIndex;
while (nIndex - nStart < wCountS && nIndex < nLen && pTime[nIndex]) {
if (!FXSYS_isDecimalDigit(pTime[nIndex]))
- return FALSE;
+ return false;
wSecond = pTime[nIndex] - '0' + wSecond * 10;
nIndex++;
}
if (wsTime.Find('.') > 0) {
if (pTime[nIndex] != '.')
- return FALSE;
+ return false;
nIndex++;
nStart = nIndex;
while (nIndex - nStart < wCountF && nIndex < nLen && pTime[nIndex]) {
if (!FXSYS_isDecimalDigit(pTime[nIndex]))
- return FALSE;
+ return false;
wFraction = pTime[nIndex] - '0' + wFraction * 10;
nIndex++;
}
@@ -754,34 +753,34 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalTime(const CFX_WideString& wsTime) {
nStart = nIndex;
while (nIndex - nStart < wCountH && nIndex < nLen && pTime[nIndex]) {
if (!FXSYS_isDecimalDigit(pTime[nIndex]))
- return FALSE;
+ return false;
nOffsetH = pTime[nIndex] - '0' + nOffsetH * 10;
nIndex++;
}
if (bSymbol) {
if (nIndex < nLen && pTime[nIndex] != ':')
- return FALSE;
+ return false;
nIndex++;
}
nStart = nIndex;
while (nIndex - nStart < wCountM && nIndex < nLen && pTime[nIndex]) {
if (!FXSYS_isDecimalDigit(pTime[nIndex]))
- return FALSE;
+ return false;
nOffsetM = pTime[nIndex] - '0' + nOffsetM * 10;
nIndex++;
}
if (nOffsetH > 12 || nOffsetM >= 60)
- return FALSE;
+ return false;
}
}
return nIndex == nLen && wHour < 24 && wMinute < 60 && wSecond < 60 &&
wFraction <= 999;
}
-FX_BOOL CXFA_LocaleValue::ValidateCanonicalDateTime(
+bool CXFA_LocaleValue::ValidateCanonicalDateTime(
const CFX_WideString& wsDateTime) {
CFX_WideString wsDate, wsTime;
if (wsDateTime.IsEmpty()) {
- return FALSE;
+ return false;
}
int nSplitIndex = -1;
nSplitIndex = wsDateTime.Find('T');
@@ -789,16 +788,16 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalDateTime(
nSplitIndex = wsDateTime.Find(' ');
}
if (nSplitIndex < 0) {
- return FALSE;
+ return false;
}
wsDate = wsDateTime.Left(nSplitIndex);
wsTime = wsDateTime.Right(wsDateTime.GetLength() - nSplitIndex - 1);
CFX_Unitime dt;
return ValidateCanonicalDate(wsDate, dt) && ValidateCanonicalTime(wsTime);
}
-FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue,
- const CFX_WideString& wsPattern,
- IFX_Locale* pLocale) {
+bool CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue,
+ const CFX_WideString& wsPattern,
+ IFX_Locale* pLocale) {
IFX_Locale* locale = m_pLocaleMgr->GetDefLocale();
if (pLocale) {
m_pLocaleMgr->SetDefLocale(pLocale);
@@ -806,11 +805,11 @@ FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue,
CFX_FormatString* pFormat = nullptr;
if (m_pLocaleMgr)
- pFormat = new CFX_FormatString(m_pLocaleMgr, FALSE);
+ pFormat = new CFX_FormatString(m_pLocaleMgr, false);
CFX_WideStringArray wsPatterns;
pFormat->SplitFormatString(wsPattern, wsPatterns);
- FX_BOOL bRet = FALSE;
+ bool bRet = false;
int32_t iCount = wsPatterns.GetSize();
for (int32_t i = 0; i < iCount && !bRet; i++) {
CFX_WideString wsFormat = wsPatterns[i];
@@ -872,7 +871,7 @@ FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue,
}
default:
m_wsValue = wsValue;
- bRet = TRUE;
+ bRet = true;
break;
}
}
@@ -888,7 +887,7 @@ FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue,
void CXFA_LocaleValue::GetNumbericFormat(CFX_WideString& wsFormat,
int32_t nIntLen,
int32_t nDecLen,
- FX_BOOL bSign) {
+ bool bSign) {
ASSERT(wsFormat.IsEmpty());
ASSERT(nIntLen >= -1 && nDecLen >= -1);
int32_t nTotalLen = (nIntLen >= 0 ? nIntLen : 2) + (bSign ? 1 : 0) +
@@ -921,12 +920,12 @@ void CXFA_LocaleValue::GetNumbericFormat(CFX_WideString& wsFormat,
}
wsFormat.ReleaseBuffer(nTotalLen);
}
-FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric,
- CFX_WideString& wsFormat,
- IFX_Locale* pLocale,
- int32_t* pos) {
+bool CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric,
+ CFX_WideString& wsFormat,
+ IFX_Locale* pLocale,
+ int32_t* pos) {
if (wsFormat.IsEmpty() || wsNumeric.IsEmpty()) {
- return TRUE;
+ return true;
}
const FX_WCHAR* pNum = wsNumeric.c_str();
const FX_WCHAR* pFmt = wsFormat.c_str();
@@ -939,27 +938,27 @@ FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric,
}
++nf;
}
- FX_BOOL bLimit = TRUE;
+ bool bLimit = true;
int32_t nCount = wsNumeric.GetLength();
int32_t nCountFmt = wsFormat.GetLength();
- while (n < nCount && (bLimit ? nf < nCountFmt : TRUE) &&
+ while (n < nCount && (bLimit ? nf < nCountFmt : true) &&
FXSYS_isDecimalDigit(c = pNum[n])) {
- if (bLimit == TRUE) {
+ if (bLimit == true) {
if ((cf = pFmt[nf]) == L'*') {
- bLimit = FALSE;
+ bLimit = false;
} else if (cf == L'z') {
nf++;
} else {
- return FALSE;
+ return false;
}
}
n++;
}
if (n == nCount) {
- return TRUE;
+ return true;
}
if (nf == nCountFmt) {
- return FALSE;
+ return false;
}
while (nf < nCountFmt && (cf = pFmt[nf]) != L'.') {
ASSERT(cf == L'z' || cf == L'*');
@@ -972,23 +971,23 @@ FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric,
wsDecimalSymbol = CFX_WideString(L'.');
}
if (pFmt[nf] != L'.') {
- return FALSE;
+ return false;
}
if (wsDecimalSymbol != CFX_WideStringC(c) && c != L'.') {
- return FALSE;
+ return false;
}
++nf;
++n;
- bLimit = TRUE;
- while (n < nCount && (bLimit ? nf < nCountFmt : TRUE) &&
+ bLimit = true;
+ while (n < nCount && (bLimit ? nf < nCountFmt : true) &&
FXSYS_isDecimalDigit(c = pNum[n])) {
- if (bLimit == TRUE) {
+ if (bLimit == true) {
if ((cf = pFmt[nf]) == L'*') {
- bLimit = FALSE;
+ bLimit = false;
} else if (cf == L'z') {
nf++;
} else {
- return FALSE;
+ return false;
}
}
n++;
diff --git a/xfa/fxfa/parser/xfa_localevalue.h b/xfa/fxfa/parser/xfa_localevalue.h
index f278c07105..dbc3513a3f 100644
--- a/xfa/fxfa/parser/xfa_localevalue.h
+++ b/xfa/fxfa/parser/xfa_localevalue.h
@@ -41,32 +41,30 @@ class CXFA_LocaleValue {
~CXFA_LocaleValue();
CXFA_LocaleValue& operator=(const CXFA_LocaleValue& value);
- FX_BOOL ValidateValue(const CFX_WideString& wsValue,
- const CFX_WideString& wsPattern,
- IFX_Locale* pLocale,
- CFX_WideString* pMatchFormat = nullptr);
- FX_BOOL FormatPatterns(CFX_WideString& wsResult,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale,
- XFA_VALUEPICTURE eValueType) const;
- FX_BOOL FormatSinglePattern(CFX_WideString& wsResult,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale,
- XFA_VALUEPICTURE eValueType) const;
- FX_BOOL ValidateCanonicalValue(const CFX_WideString& wsValue,
- uint32_t dwVType);
- FX_BOOL ValidateCanonicalDate(const CFX_WideString& wsDate,
- CFX_Unitime& unDate);
- FX_BOOL ValidateCanonicalTime(const CFX_WideString& wsTime);
- FX_BOOL ValidateCanonicalDateTime(const CFX_WideString& wsDateTime);
+ bool ValidateValue(const CFX_WideString& wsValue,
+ const CFX_WideString& wsPattern,
+ IFX_Locale* pLocale,
+ CFX_WideString* pMatchFormat = nullptr);
+ bool FormatPatterns(CFX_WideString& wsResult,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale,
+ XFA_VALUEPICTURE eValueType) const;
+ bool FormatSinglePattern(CFX_WideString& wsResult,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale,
+ XFA_VALUEPICTURE eValueType) const;
+ bool ValidateCanonicalValue(const CFX_WideString& wsValue, uint32_t dwVType);
+ bool ValidateCanonicalDate(const CFX_WideString& wsDate, CFX_Unitime& unDate);
+ bool ValidateCanonicalTime(const CFX_WideString& wsTime);
+ bool ValidateCanonicalDateTime(const CFX_WideString& wsDateTime);
void GetNumbericFormat(CFX_WideString& wsFormat,
int32_t nIntLen,
int32_t nDecLen,
- FX_BOOL bSign = TRUE);
- FX_BOOL ValidateNumericTemp(CFX_WideString& wsNumeric,
- CFX_WideString& wsFormat,
- IFX_Locale* pLocale = nullptr,
- int32_t* pos = nullptr);
+ bool bSign = true);
+ bool ValidateNumericTemp(CFX_WideString& wsNumeric,
+ CFX_WideString& wsFormat,
+ IFX_Locale* pLocale = nullptr,
+ int32_t* pos = nullptr);
CFX_WideString GetValue() const;
uint32_t GetType() const;
@@ -77,38 +75,38 @@ class CXFA_LocaleValue {
CFX_Unitime GetDate() const;
CFX_Unitime GetTime() const;
CFX_Unitime GetDateTime() const;
- FX_BOOL SetText(const CFX_WideString& wsText);
- FX_BOOL SetText(const CFX_WideString& wsText,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale);
- FX_BOOL SetNum(FX_FLOAT fNum);
- FX_BOOL SetNum(const CFX_WideString& wsNum,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale);
- FX_BOOL SetDate(const CFX_Unitime& d);
- FX_BOOL SetDate(const CFX_WideString& wsDate,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale);
- FX_BOOL SetTime(const CFX_Unitime& t);
- FX_BOOL SetTime(const CFX_WideString& wsTime,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale);
- FX_BOOL SetDateTime(const CFX_Unitime& dt);
- FX_BOOL SetDateTime(const CFX_WideString& wsDateTime,
- const CFX_WideString& wsFormat,
- IFX_Locale* pLocale);
+ bool SetText(const CFX_WideString& wsText);
+ bool SetText(const CFX_WideString& wsText,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale);
+ bool SetNum(FX_FLOAT fNum);
+ bool SetNum(const CFX_WideString& wsNum,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale);
+ bool SetDate(const CFX_Unitime& d);
+ bool SetDate(const CFX_WideString& wsDate,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale);
+ bool SetTime(const CFX_Unitime& t);
+ bool SetTime(const CFX_WideString& wsTime,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale);
+ bool SetDateTime(const CFX_Unitime& dt);
+ bool SetDateTime(const CFX_WideString& wsDateTime,
+ const CFX_WideString& wsFormat,
+ IFX_Locale* pLocale);
bool IsNull() const { return m_dwType == XFA_VT_NULL; }
- FX_BOOL IsEmpty() const { return m_wsValue.IsEmpty(); }
- FX_BOOL IsValid() const { return m_bValid; }
+ bool IsEmpty() const { return m_wsValue.IsEmpty(); }
+ bool IsValid() const { return m_bValid; }
protected:
- FX_BOOL ParsePatternValue(const CFX_WideString& wsValue,
- const CFX_WideString& wsPattern,
- IFX_Locale* pLocale);
+ bool ParsePatternValue(const CFX_WideString& wsValue,
+ const CFX_WideString& wsPattern,
+ IFX_Locale* pLocale);
CXFA_LocaleMgr* m_pLocaleMgr;
CFX_WideString m_wsValue;
uint32_t m_dwType;
- FX_BOOL m_bValid;
+ bool m_bValid;
};
#endif // XFA_FXFA_PARSER_XFA_LOCALEVALUE_H_
diff --git a/xfa/fxfa/parser/xfa_object.h b/xfa/fxfa/parser/xfa_object.h
index 5056f59d9c..c3686ac076 100644
--- a/xfa/fxfa/parser/xfa_object.h
+++ b/xfa/fxfa/parser/xfa_object.h
@@ -88,7 +88,7 @@ class CXFA_Object : public CFXJSE_HostObject {
CFX_WideStringC GetClassName() const;
uint32_t GetClassHashCode() const;
void Script_ObjectClass_ClassName(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void ThrowException(int32_t iStringID, ...);
@@ -168,137 +168,131 @@ class CXFA_Node : public CXFA_Object {
}
bool NeedsInitApp() const { return HasFlag(XFA_NodeFlag_NeedsInitApp); }
- FX_BOOL IsAttributeInXML();
+ bool IsAttributeInXML();
bool IsFormContainer() const {
return m_ePacket == XFA_XDPPACKET_Form && IsContainerNode();
}
void SetXMLMappingNode(CFDE_XMLNode* pXMLNode) { m_pXMLNode = pXMLNode; }
CFDE_XMLNode* GetXMLMappingNode() const { return m_pXMLNode; }
CFDE_XMLNode* CreateXMLMappingNode();
- FX_BOOL IsNeedSavingXMLNode();
+ bool IsNeedSavingXMLNode();
uint32_t GetNameHash() const { return m_dwNameHash; }
bool IsUnnamed() const { return m_dwNameHash == 0; }
CXFA_Node* GetModelNode();
void UpdateNameHash();
- FX_BOOL HasAttribute(XFA_ATTRIBUTE eAttr, FX_BOOL bCanInherit = FALSE);
- FX_BOOL SetAttribute(XFA_ATTRIBUTE eAttr,
- const CFX_WideStringC& wsValue,
- bool bNotify = false);
- FX_BOOL GetAttribute(XFA_ATTRIBUTE eAttr,
- CFX_WideString& wsValue,
- FX_BOOL bUseDefault = TRUE);
- FX_BOOL SetAttribute(const CFX_WideStringC& wsAttr,
- const CFX_WideStringC& wsValue,
- bool bNotify = false);
- FX_BOOL GetAttribute(const CFX_WideStringC& wsAttr,
- CFX_WideString& wsValue,
- FX_BOOL bUseDefault = TRUE);
- FX_BOOL RemoveAttribute(const CFX_WideStringC& wsAttr);
- FX_BOOL SetContent(const CFX_WideString& wsContent,
- const CFX_WideString& wsXMLValue,
- bool bNotify = false,
- FX_BOOL bScriptModify = FALSE,
- FX_BOOL bSyncData = TRUE);
- FX_BOOL TryContent(CFX_WideString& wsContent,
- FX_BOOL bScriptModify = FALSE,
- FX_BOOL bProto = TRUE);
+ bool HasAttribute(XFA_ATTRIBUTE eAttr, bool bCanInherit = false);
+ bool SetAttribute(XFA_ATTRIBUTE eAttr,
+ const CFX_WideStringC& wsValue,
+ bool bNotify = false);
+ bool GetAttribute(XFA_ATTRIBUTE eAttr,
+ CFX_WideString& wsValue,
+ bool bUseDefault = true);
+ bool SetAttribute(const CFX_WideStringC& wsAttr,
+ const CFX_WideStringC& wsValue,
+ bool bNotify = false);
+ bool GetAttribute(const CFX_WideStringC& wsAttr,
+ CFX_WideString& wsValue,
+ bool bUseDefault = true);
+ bool RemoveAttribute(const CFX_WideStringC& wsAttr);
+ bool SetContent(const CFX_WideString& wsContent,
+ const CFX_WideString& wsXMLValue,
+ bool bNotify = false,
+ bool bScriptModify = false,
+ bool bSyncData = true);
+ bool TryContent(CFX_WideString& wsContent,
+ bool bScriptModify = false,
+ bool bProto = true);
CFX_WideString GetContent();
- FX_BOOL TryNamespace(CFX_WideString& wsNamespace);
+ bool TryNamespace(CFX_WideString& wsNamespace);
- FX_BOOL SetBoolean(XFA_ATTRIBUTE eAttr,
- FX_BOOL bValue,
- bool bNotify = false) {
+ bool SetBoolean(XFA_ATTRIBUTE eAttr, bool bValue, bool bNotify = false) {
return SetValue(eAttr, XFA_ATTRIBUTETYPE_Boolean, (void*)(uintptr_t)bValue,
bNotify);
}
- FX_BOOL TryBoolean(XFA_ATTRIBUTE eAttr,
- FX_BOOL& bValue,
- FX_BOOL bUseDefault = TRUE);
- FX_BOOL GetBoolean(XFA_ATTRIBUTE eAttr) {
- FX_BOOL bValue;
- return TryBoolean(eAttr, bValue, TRUE) ? bValue : FALSE;
+ bool TryBoolean(XFA_ATTRIBUTE eAttr, bool& bValue, bool bUseDefault = true);
+ bool GetBoolean(XFA_ATTRIBUTE eAttr) {
+ bool bValue;
+ return TryBoolean(eAttr, bValue, true) ? bValue : false;
}
- FX_BOOL SetInteger(XFA_ATTRIBUTE eAttr,
- int32_t iValue,
- bool bNotify = false) {
+ bool SetInteger(XFA_ATTRIBUTE eAttr, int32_t iValue, bool bNotify = false) {
return SetValue(eAttr, XFA_ATTRIBUTETYPE_Integer, (void*)(uintptr_t)iValue,
bNotify);
}
- FX_BOOL TryInteger(XFA_ATTRIBUTE eAttr,
- int32_t& iValue,
- FX_BOOL bUseDefault = TRUE);
+ bool TryInteger(XFA_ATTRIBUTE eAttr,
+ int32_t& iValue,
+ bool bUseDefault = true);
int32_t GetInteger(XFA_ATTRIBUTE eAttr) {
int32_t iValue;
- return TryInteger(eAttr, iValue, TRUE) ? iValue : 0;
+ return TryInteger(eAttr, iValue, true) ? iValue : 0;
}
- FX_BOOL SetEnum(XFA_ATTRIBUTE eAttr,
- XFA_ATTRIBUTEENUM eValue,
- bool bNotify = false) {
+ bool SetEnum(XFA_ATTRIBUTE eAttr,
+ XFA_ATTRIBUTEENUM eValue,
+ bool bNotify = false) {
return SetValue(eAttr, XFA_ATTRIBUTETYPE_Enum, (void*)(uintptr_t)eValue,
bNotify);
}
- FX_BOOL TryEnum(XFA_ATTRIBUTE eAttr,
- XFA_ATTRIBUTEENUM& eValue,
- FX_BOOL bUseDefault = TRUE);
+ bool TryEnum(XFA_ATTRIBUTE eAttr,
+ XFA_ATTRIBUTEENUM& eValue,
+ bool bUseDefault = true);
XFA_ATTRIBUTEENUM GetEnum(XFA_ATTRIBUTE eAttr) {
XFA_ATTRIBUTEENUM eValue;
- return TryEnum(eAttr, eValue, TRUE) ? eValue : XFA_ATTRIBUTEENUM_Unknown;
+ return TryEnum(eAttr, eValue, true) ? eValue : XFA_ATTRIBUTEENUM_Unknown;
}
- FX_BOOL SetCData(XFA_ATTRIBUTE eAttr,
- const CFX_WideString& wsValue,
- bool bNotify = false,
- FX_BOOL bScriptModify = FALSE);
- FX_BOOL SetAttributeValue(const CFX_WideString& wsValue,
- const CFX_WideString& wsXMLValue,
- bool bNotify = false,
- FX_BOOL bScriptModify = FALSE);
- FX_BOOL TryCData(XFA_ATTRIBUTE eAttr,
- CFX_WideString& wsValue,
- FX_BOOL bUseDefault = TRUE,
- FX_BOOL bProto = TRUE);
- FX_BOOL TryCData(XFA_ATTRIBUTE eAttr,
- CFX_WideStringC& wsValue,
- FX_BOOL bUseDefault = TRUE,
- FX_BOOL bProto = TRUE);
+ bool SetCData(XFA_ATTRIBUTE eAttr,
+ const CFX_WideString& wsValue,
+ bool bNotify = false,
+ bool bScriptModify = false);
+ bool SetAttributeValue(const CFX_WideString& wsValue,
+ const CFX_WideString& wsXMLValue,
+ bool bNotify = false,
+ bool bScriptModify = false);
+ bool TryCData(XFA_ATTRIBUTE eAttr,
+ CFX_WideString& wsValue,
+ bool bUseDefault = true,
+ bool bProto = true);
+ bool TryCData(XFA_ATTRIBUTE eAttr,
+ CFX_WideStringC& wsValue,
+ bool bUseDefault = true,
+ bool bProto = true);
CFX_WideStringC GetCData(XFA_ATTRIBUTE eAttr) {
CFX_WideStringC wsValue;
return TryCData(eAttr, wsValue) ? wsValue : CFX_WideStringC();
}
- FX_BOOL SetMeasure(XFA_ATTRIBUTE eAttr,
- CXFA_Measurement mValue,
- bool bNotify = false);
- FX_BOOL TryMeasure(XFA_ATTRIBUTE eAttr,
- CXFA_Measurement& mValue,
- FX_BOOL bUseDefault = TRUE) const;
+ bool SetMeasure(XFA_ATTRIBUTE eAttr,
+ CXFA_Measurement mValue,
+ bool bNotify = false);
+ bool TryMeasure(XFA_ATTRIBUTE eAttr,
+ CXFA_Measurement& mValue,
+ bool bUseDefault = true) const;
CXFA_Measurement GetMeasure(XFA_ATTRIBUTE eAttr) const;
- FX_BOOL SetObject(XFA_ATTRIBUTE eAttr,
- void* pData,
- XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr);
- FX_BOOL TryObject(XFA_ATTRIBUTE eAttr, void*& pData);
+ bool SetObject(XFA_ATTRIBUTE eAttr,
+ void* pData,
+ XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr);
+ bool TryObject(XFA_ATTRIBUTE eAttr, void*& pData);
void* GetObject(XFA_ATTRIBUTE eAttr) {
void* pData;
return TryObject(eAttr, pData) ? pData : nullptr;
}
- FX_BOOL SetUserData(void* pKey,
- void* pData,
- XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr);
- FX_BOOL TryUserData(void* pKey, void*& pData, FX_BOOL bProtoAlso = FALSE);
- void* GetUserData(void* pKey, FX_BOOL bProtoAlso = FALSE) {
+ bool SetUserData(void* pKey,
+ void* pData,
+ XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr);
+ bool TryUserData(void* pKey, void*& pData, bool bProtoAlso = false);
+ void* GetUserData(void* pKey, bool bProtoAlso = false) {
void* pData;
return TryUserData(pKey, pData, bProtoAlso) ? pData : nullptr;
}
CXFA_Node* GetProperty(int32_t index,
XFA_Element eType,
- FX_BOOL bCreateProperty = TRUE);
- int32_t CountChildren(XFA_Element eType, FX_BOOL bOnlyChild = FALSE);
+ bool bCreateProperty = true);
+ int32_t CountChildren(XFA_Element eType, bool bOnlyChild = false);
CXFA_Node* GetChild(int32_t index,
XFA_Element eType,
- FX_BOOL bOnlyChild = FALSE);
+ bool bOnlyChild = false);
int32_t InsertChild(int32_t index, CXFA_Node* pNode);
- FX_BOOL InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode = nullptr);
- FX_BOOL RemoveChild(CXFA_Node* pNode, bool bNotify = true);
- CXFA_Node* Clone(FX_BOOL bRecursive);
+ bool InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode = nullptr);
+ bool RemoveChild(CXFA_Node* pNode, bool bNotify = true);
+ CXFA_Node* Clone(bool bRecursive);
CXFA_Node* GetNodeItem(XFA_NODEITEM eItem) const;
CXFA_Node* GetNodeItem(XFA_NODEITEM eItem, XFA_ObjectType eType) const;
int32_t GetNodeList(CXFA_NodeArray& nodes,
@@ -308,7 +302,7 @@ class CXFA_Node : public CXFA_Object {
int32_t iLevel = 1);
CXFA_Node* CreateSamePacketNode(XFA_Element eType,
uint32_t dwFlags = XFA_NodeFlag_Initialized);
- CXFA_Node* CloneTemplateToForm(FX_BOOL bRecursive);
+ CXFA_Node* CloneTemplateToForm(bool bRecursive);
CXFA_Node* GetTemplateNode() const;
void SetTemplateNode(CXFA_Node* pTemplateNode);
CXFA_Node* GetDataDescriptionNode();
@@ -317,10 +311,10 @@ class CXFA_Node : public CXFA_Object {
int32_t GetBindItems(CXFA_NodeArray& formItems);
int32_t AddBindItem(CXFA_Node* pFormNode);
int32_t RemoveBindItem(CXFA_Node* pFormNode);
- FX_BOOL HasBindItem();
+ bool HasBindItem();
CXFA_WidgetData* GetWidgetData();
CXFA_WidgetData* GetContainerWidgetData();
- FX_BOOL GetLocaleName(CFX_WideString& wsLocaleName);
+ bool GetLocaleName(CFX_WideString& wsLocaleName);
XFA_ATTRIBUTEENUM GetIntact();
CXFA_Node* GetFirstChildByName(const CFX_WideStringC& wsNodeName) const;
CXFA_Node* GetFirstChildByName(uint32_t dwNodeNameHash) const;
@@ -341,25 +335,25 @@ class CXFA_Node : public CXFA_Object {
uint32_t dwFlag,
CXFA_Node* refNode = nullptr);
void Script_TreeClass_All(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_TreeClass_Nodes(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_TreeClass_ClassAll(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_TreeClass_Parent(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_TreeClass_Index(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_TreeClass_ClassIndex(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_TreeClass_SomExpression(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_NodeClass_ApplyXSL(CFXJSE_Arguments* pArguments);
void Script_NodeClass_AssignNode(CFXJSE_Arguments* pArguments);
@@ -373,19 +367,19 @@ class CXFA_Node : public CXFA_Object {
void Script_NodeClass_SetAttribute(CFXJSE_Arguments* pArguments);
void Script_NodeClass_SetElement(CFXJSE_Arguments* pArguments);
void Script_NodeClass_Ns(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_NodeClass_Model(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_NodeClass_IsContainer(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_NodeClass_IsNull(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_NodeClass_OneOfChild(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_ContainerClass_GetDelta(CFXJSE_Arguments* pArguments);
void Script_ContainerClass_GetDeltas(CFXJSE_Arguments* pArguments);
@@ -393,104 +387,104 @@ class CXFA_Node : public CXFA_Object {
void Script_ModelClass_CreateNode(CFXJSE_Arguments* pArguments);
void Script_ModelClass_IsCompatibleNS(CFXJSE_Arguments* pArguments);
void Script_ModelClass_Context(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_ModelClass_AliasNode(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_WsdlConnection_Execute(CFXJSE_Arguments* pArguments);
void Script_Delta_Restore(CFXJSE_Arguments* pArguments);
void Script_Delta_CurrentValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Delta_SavedValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Delta_Target(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Attribute_SendAttributeChangeMessage(XFA_ATTRIBUTE eAttribute,
- FX_BOOL bScriptModify);
+ bool bScriptModify);
void Script_Attribute_Integer(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Attribute_IntegerRead(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Attribute_BOOL(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Attribute_BOOLRead(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Attribute_String(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Attribute_StringRead(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Som_ValidationMessage(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Field_Length(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Som_DefaultValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Som_DefaultValue_Read(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Boolean_Value(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Som_Message(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_SOM_MESSAGETYPE iMessageType);
void Script_Som_BorderColor(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Som_BorderWidth(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Som_FillColor(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Som_DataNode(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Som_FontColor(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Som_Mandatory(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Som_MandatoryMessage(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Som_InstanceIndex(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Draw_DefaultValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Field_DefaultValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Field_EditValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Field_FormatMessage(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Field_FormattedValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Field_ParentSubform(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Field_SelectedIndex(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Field_ClearItems(CFXJSE_Arguments* pArguments);
void Script_Field_ExecEvent(CFXJSE_Arguments* pArguments);
@@ -506,13 +500,13 @@ class CXFA_Node : public CXFA_Object {
void Script_Field_AddItem(CFXJSE_Arguments* pArguments);
void Script_Field_ExecValidate(CFXJSE_Arguments* pArguments);
void Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_ExclGroup_ErrorText(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_ExclGroup_Transient(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments);
void Script_ExclGroup_SelectedMember(CFXJSE_Arguments* pArguments);
@@ -520,10 +514,10 @@ class CXFA_Node : public CXFA_Object {
void Script_ExclGroup_ExecCalculate(CFXJSE_Arguments* pArguments);
void Script_ExclGroup_ExecValidate(CFXJSE_Arguments* pArguments);
void Script_Subform_InstanceManager(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Subform_Locale(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments);
void Script_Subform_ExecInitialize(CFXJSE_Arguments* pArguments);
@@ -541,13 +535,13 @@ class CXFA_Node : public CXFA_Object {
void Script_Template_ExecValidate(CFXJSE_Arguments* pArguments);
void Script_Manifest_Evaluate(CFXJSE_Arguments* pArguments);
void Script_InstanceManager_Count(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_InstanceManager_Max(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_InstanceManager_Min(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_InstanceManager_MoveInstance(CFXJSE_Arguments* pArguments);
void Script_InstanceManager_RemoveInstance(CFXJSE_Arguments* pArguments);
@@ -557,10 +551,10 @@ class CXFA_Node : public CXFA_Object {
int32_t InstanceManager_SetInstances(int32_t iCount);
int32_t InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom);
void Script_Occur_Max(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Occur_Min(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Desc_Metadata(CFXJSE_Arguments* pArguments);
void Script_Form_FormNodes(CFXJSE_Arguments* pArguments);
@@ -570,13 +564,13 @@ class CXFA_Node : public CXFA_Object {
void Script_Form_ExecCalculate(CFXJSE_Arguments* pArguments);
void Script_Form_ExecValidate(CFXJSE_Arguments* pArguments);
void Script_Form_Checksum(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments);
void Script_Packet_SetAttribute(CFXJSE_Arguments* pArguments);
void Script_Packet_RemoveAttribute(CFXJSE_Arguments* pArguments);
void Script_Packet_Content(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Source_Next(CFXJSE_Arguments* pArguments);
void Script_Source_CancelBatch(CFXJSE_Arguments* pArguments);
@@ -596,25 +590,25 @@ class CXFA_Node : public CXFA_Object {
void Script_Source_Last(CFXJSE_Arguments* pArguments);
void Script_Source_HasDataChanged(CFXJSE_Arguments* pArguments);
void Script_Source_Db(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Xfa_This(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Handler_Version(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_SubmitFormat_Mode(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Extras_Type(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Encrypt_Format(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
void Script_Script_Stateless(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
protected:
@@ -629,48 +623,48 @@ class CXFA_Node : public CXFA_Object {
bool HasFlag(XFA_NodeFlag dwFlag) const;
CXFA_Node* Deprecated_GetPrevSibling();
- FX_BOOL SetValue(XFA_ATTRIBUTE eAttr,
- XFA_ATTRIBUTETYPE eType,
- void* pValue,
- bool bNotify);
- FX_BOOL GetValue(XFA_ATTRIBUTE eAttr,
- XFA_ATTRIBUTETYPE eType,
- FX_BOOL bUseDefault,
- void*& pValue);
+ bool SetValue(XFA_ATTRIBUTE eAttr,
+ XFA_ATTRIBUTETYPE eType,
+ void* pValue,
+ bool bNotify);
+ bool GetValue(XFA_ATTRIBUTE eAttr,
+ XFA_ATTRIBUTETYPE eType,
+ bool bUseDefault,
+ void*& pValue);
void OnRemoved(bool bNotify);
void OnChanging(XFA_ATTRIBUTE eAttr, bool bNotify);
- void OnChanged(XFA_ATTRIBUTE eAttr, bool bNotify, FX_BOOL bScriptModify);
+ void OnChanged(XFA_ATTRIBUTE eAttr, bool bNotify, bool bScriptModify);
int32_t execSingleEventByName(const CFX_WideStringC& wsEventName,
XFA_Element eType);
- FX_BOOL SetScriptContent(const CFX_WideString& wsContent,
- const CFX_WideString& wsXMLValue,
- bool bNotify = true,
- FX_BOOL bScriptModify = FALSE,
- FX_BOOL bSyncData = TRUE);
- CFX_WideString GetScriptContent(FX_BOOL bScriptModify = FALSE);
+ bool SetScriptContent(const CFX_WideString& wsContent,
+ const CFX_WideString& wsXMLValue,
+ bool bNotify = true,
+ bool bScriptModify = false,
+ bool bSyncData = true);
+ CFX_WideString GetScriptContent(bool bScriptModify = false);
XFA_MAPMODULEDATA* CreateMapModuleData();
XFA_MAPMODULEDATA* GetMapModuleData() const;
void SetMapModuleValue(void* pKey, void* pValue);
- FX_BOOL GetMapModuleValue(void* pKey, void*& pValue);
+ bool GetMapModuleValue(void* pKey, void*& pValue);
void SetMapModuleString(void* pKey, const CFX_WideStringC& wsValue);
- FX_BOOL GetMapModuleString(void* pKey, CFX_WideStringC& wsValue);
+ bool GetMapModuleString(void* pKey, CFX_WideStringC& wsValue);
void SetMapModuleBuffer(
void* pKey,
void* pValue,
int32_t iBytes,
XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr);
- FX_BOOL GetMapModuleBuffer(void* pKey,
- void*& pValue,
- int32_t& iBytes,
- FX_BOOL bProtoAlso = TRUE) const;
- FX_BOOL HasMapModuleKey(void* pKey, FX_BOOL bProtoAlso = FALSE);
+ bool GetMapModuleBuffer(void* pKey,
+ void*& pValue,
+ int32_t& iBytes,
+ bool bProtoAlso = true) const;
+ bool HasMapModuleKey(void* pKey, bool bProtoAlso = false);
void RemoveMapModuleKey(void* pKey = nullptr);
- void MergeAllData(void* pDstModule, FX_BOOL bUseSrcAttr = TRUE);
+ void MergeAllData(void* pDstModule, bool bUseSrcAttr = true);
void MoveBufferMapData(CXFA_Node* pDstModule, void* pKey);
void MoveBufferMapData(CXFA_Node* pSrcModule,
CXFA_Node* pDstModule,
void* pKey,
- FX_BOOL bRecursive = FALSE);
+ bool bRecursive = false);
CXFA_Node* m_pNext;
CXFA_Node* m_pChild;
@@ -704,9 +698,9 @@ class CXFA_NodeList : public CXFA_Object {
CXFA_Node* NamedItem(const CFX_WideStringC& wsName);
virtual int32_t GetLength() = 0;
- virtual FX_BOOL Append(CXFA_Node* pNode) = 0;
- virtual FX_BOOL Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) = 0;
- virtual FX_BOOL Remove(CXFA_Node* pNode) = 0;
+ virtual bool Append(CXFA_Node* pNode) = 0;
+ virtual bool Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) = 0;
+ virtual bool Remove(CXFA_Node* pNode) = 0;
virtual CXFA_Node* Item(int32_t iIndex) = 0;
void Script_ListClass_Append(CFXJSE_Arguments* pArguments);
@@ -716,7 +710,7 @@ class CXFA_NodeList : public CXFA_Object {
void Script_TreelistClass_NamedItem(CFXJSE_Arguments* pArguments);
void Script_ListClass_Length(CFXJSE_Value* pValue,
- FX_BOOL bSetting,
+ bool bSetting,
XFA_ATTRIBUTE eAttribute);
};
@@ -727,9 +721,9 @@ class CXFA_ArrayNodeList : public CXFA_NodeList {
// From CXFA_NodeList.
int32_t GetLength() override;
- FX_BOOL Append(CXFA_Node* pNode) override;
- FX_BOOL Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) override;
- FX_BOOL Remove(CXFA_Node* pNode) override;
+ bool Append(CXFA_Node* pNode) override;
+ bool Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) override;
+ bool Remove(CXFA_Node* pNode) override;
CXFA_Node* Item(int32_t iIndex) override;
void SetArrayNodeList(const CXFA_NodeArray& srcArray);
@@ -744,9 +738,9 @@ class CXFA_AttachNodeList : public CXFA_NodeList {
// From CXFA_NodeList.
int32_t GetLength() override;
- FX_BOOL Append(CXFA_Node* pNode) override;
- FX_BOOL Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) override;
- FX_BOOL Remove(CXFA_Node* pNode) override;
+ bool Append(CXFA_Node* pNode) override;
+ bool Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) override;
+ bool Remove(CXFA_Node* pNode) override;
CXFA_Node* Item(int32_t iIndex) override;
protected:
diff --git a/xfa/fxfa/parser/xfa_resolvenode_rs.h b/xfa/fxfa/parser/xfa_resolvenode_rs.h
index 633d080876..2e7e297aea 100644
--- a/xfa/fxfa/parser/xfa_resolvenode_rs.h
+++ b/xfa/fxfa/parser/xfa_resolvenode_rs.h
@@ -47,7 +47,7 @@ struct XFA_RESOLVENODE_RS {
for (int32_t i = 0; i < nodes.GetSize(); i++) {
std::unique_ptr<CFXJSE_Value> pValue(new CFXJSE_Value(pIsolate));
(nodes[i]->*(pScriptAttribute->lpfnCallback))(
- pValue.get(), FALSE, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute);
+ pValue.get(), false, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute);
valueArray.Add(pValue.release());
}
}
diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp
index 3967784fe9..6f54c0e5fe 100644
--- a/xfa/fxfa/parser/xfa_utils.cpp
+++ b/xfa/fxfa/parser/xfa_utils.cpp
@@ -204,8 +204,8 @@ void XFA_GetPlainTextFromRichText(CFDE_XMLNode* pXMLNode,
}
}
-FX_BOOL XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode) {
- FX_BOOL bRet = FALSE;
+bool XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode) {
+ bool bRet = false;
if (!pFieldNode)
return bRet;
@@ -395,29 +395,29 @@ CXFA_Measurement XFA_GetAttributeDefaultValue_Measure(XFA_Element eElement,
return CXFA_Measurement();
}
-FX_BOOL XFA_GetAttributeDefaultValue(void*& pValue,
- XFA_Element eElement,
- XFA_ATTRIBUTE eAttribute,
- XFA_ATTRIBUTETYPE eType,
- uint32_t dwPacket) {
+bool XFA_GetAttributeDefaultValue(void*& pValue,
+ XFA_Element eElement,
+ XFA_ATTRIBUTE eAttribute,
+ XFA_ATTRIBUTETYPE eType,
+ uint32_t dwPacket) {
const XFA_ATTRIBUTEINFO* pInfo = XFA_GetAttributeByID(eAttribute);
if (!pInfo)
- return FALSE;
+ return false;
if (dwPacket && (dwPacket & pInfo->dwPackets) == 0)
- return FALSE;
+ return false;
if (pInfo->eType == eType) {
pValue = pInfo->pDefValue;
- return TRUE;
+ return true;
}
if (pInfo->eType == XFA_ATTRIBUTETYPE_NOTSURE) {
const XFA_NOTSUREATTRIBUTE* pAttr =
XFA_GetNotsureAttribute(eElement, eAttribute, eType);
if (pAttr) {
pValue = pAttr->pValue;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
const XFA_ATTRIBUTEINFO* XFA_GetAttributeByName(const CFX_WideStringC& wsName) {
diff --git a/xfa/fxfa/parser/xfa_utils.h b/xfa/fxfa/parser/xfa_utils.h
index 90168604eb..9a84fd6f67 100644
--- a/xfa/fxfa/parser/xfa_utils.h
+++ b/xfa/fxfa/parser/xfa_utils.h
@@ -18,7 +18,7 @@ class CXFA_LocaleValue;
class CXFA_Node;
class CXFA_WidgetData;
-FX_BOOL XFA_FDEExtension_ResolveNamespaceQualifier(
+bool XFA_FDEExtension_ResolveNamespaceQualifier(
CFDE_XMLElement* pNode,
const CFX_WideStringC& wsQualifier,
CFX_WideString& wsNamespaceURI);
@@ -32,24 +32,24 @@ class CXFA_NodeIteratorTemplate {
m_NodeStack.Push(pRootNode);
}
}
- FX_BOOL Init(NodeType* pRootNode) {
+ bool Init(NodeType* pRootNode) {
if (!pRootNode) {
- return FALSE;
+ return false;
}
m_pRoot = pRootNode;
- m_NodeStack.RemoveAll(FALSE);
+ m_NodeStack.RemoveAll(false);
m_NodeStack.Push(pRootNode);
- return TRUE;
+ return true;
}
- void Clear() { m_NodeStack.RemoveAll(FALSE); }
+ void Clear() { m_NodeStack.RemoveAll(false); }
void Reset() {
Clear();
if (m_pRoot) {
m_NodeStack.Push(m_pRoot);
}
}
- FX_BOOL SetCurrent(NodeType* pCurNode) {
- m_NodeStack.RemoveAll(FALSE);
+ bool SetCurrent(NodeType* pCurNode) {
+ m_NodeStack.RemoveAll(false);
if (pCurNode) {
CFX_StackTemplate<NodeType*> revStack(100);
NodeType* pNode;
@@ -58,7 +58,7 @@ class CXFA_NodeIteratorTemplate {
revStack.Push(pNode);
}
if (!pNode) {
- return FALSE;
+ return false;
}
revStack.Push(m_pRoot);
while (revStack.GetSize()) {
@@ -66,7 +66,7 @@ class CXFA_NodeIteratorTemplate {
revStack.Pop();
}
}
- return TRUE;
+ return true;
}
NodeType* GetCurrent() const {
return m_NodeStack.GetSize() ? *m_NodeStack.GetTopElement() : nullptr;
@@ -94,7 +94,7 @@ class CXFA_NodeIteratorTemplate {
}
m_NodeStack.Push(pPrevItem);
} else {
- m_NodeStack.RemoveAll(FALSE);
+ m_NodeStack.RemoveAll(false);
if (m_pRoot) {
m_NodeStack.Push(m_pRoot);
}
@@ -166,16 +166,16 @@ CXFA_LocaleValue XFA_GetLocaleValue(CXFA_WidgetData* pWidgetData);
FX_DOUBLE XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal);
int32_t XFA_MapRotation(int32_t nRotation);
-FX_BOOL XFA_RecognizeRichText(CFDE_XMLElement* pRichTextXMLNode);
+bool XFA_RecognizeRichText(CFDE_XMLElement* pRichTextXMLNode);
void XFA_GetPlainTextFromRichText(CFDE_XMLNode* pXMLNode,
CFX_WideString& wsPlainText);
-FX_BOOL XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode);
+bool XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode);
void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node* pDataNode);
void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode,
IFX_Stream* pStream,
const FX_CHAR* pChecksum = nullptr,
- FX_BOOL bSaveXML = FALSE);
+ bool bSaveXML = false);
const XFA_NOTSUREATTRIBUTE* XFA_GetNotsureAttribute(
XFA_Element eElement,
@@ -197,11 +197,11 @@ XFA_Element XFA_GetElementTypeForName(const CFX_WideStringC& wsName);
CXFA_Measurement XFA_GetAttributeDefaultValue_Measure(XFA_Element eElement,
XFA_ATTRIBUTE eAttribute,
uint32_t dwPacket);
-FX_BOOL XFA_GetAttributeDefaultValue(void*& pValue,
- XFA_Element eElement,
- XFA_ATTRIBUTE eAttribute,
- XFA_ATTRIBUTETYPE eType,
- uint32_t dwPacket);
+bool XFA_GetAttributeDefaultValue(void*& pValue,
+ XFA_Element eElement,
+ XFA_ATTRIBUTE eAttribute,
+ XFA_ATTRIBUTETYPE eType,
+ uint32_t dwPacket);
const XFA_ATTRIBUTEINFO* XFA_GetAttributeByName(const CFX_WideStringC& wsName);
const XFA_ATTRIBUTEINFO* XFA_GetAttributeByID(XFA_ATTRIBUTE eName);
const XFA_ATTRIBUTEENUMINFO* XFA_GetAttributeEnumByName(
diff --git a/xfa/fxfa/xfa_checksum.h b/xfa/fxfa/xfa_checksum.h
index 60312772a9..8f739151f4 100644
--- a/xfa/fxfa/xfa_checksum.h
+++ b/xfa/fxfa/xfa_checksum.h
@@ -49,7 +49,7 @@ class CXFA_SAXReaderHandler {
uint32_t dwStartPos);
protected:
- void UpdateChecksum(FX_BOOL bCheckSpace);
+ void UpdateChecksum(bool bCheckSpace);
CXFA_ChecksumContext* m_pContext;
CXFA_SAXContext m_SAXContext;
@@ -62,9 +62,9 @@ class CXFA_ChecksumContext {
void StartChecksum();
void Update(const CFX_ByteStringC& bsText);
- FX_BOOL UpdateChecksum(IFX_SeekableReadStream* pSrcFile,
- FX_FILESIZE offset = 0,
- size_t size = 0);
+ bool UpdateChecksum(IFX_SeekableReadStream* pSrcFile,
+ FX_FILESIZE offset = 0,
+ size_t size = 0);
void FinishChecksum();
CFX_ByteString GetChecksum() const;
diff --git a/xfa/fxfa/xfa_ffapp.h b/xfa/fxfa/xfa_ffapp.h
index 7d4893e827..359f8ffa3c 100644
--- a/xfa/fxfa/xfa_ffapp.h
+++ b/xfa/fxfa/xfa_ffapp.h
@@ -45,7 +45,7 @@ class CXFA_FFApp {
CXFA_FFDoc* CreateDoc(IXFA_DocEnvironment* pDocEnvironment,
IFX_SeekableReadStream* pStream,
- FX_BOOL bTakeOverFile);
+ bool bTakeOverFile);
CXFA_FFDoc* CreateDoc(IXFA_DocEnvironment* pDocEnvironment,
CPDF_Document* pPDFDoc);
void SetDefaultFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr);
diff --git a/xfa/fxfa/xfa_ffdoc.h b/xfa/fxfa/xfa_ffdoc.h
index 3976f1d5fd..a31f6d7e50 100644
--- a/xfa/fxfa/xfa_ffdoc.h
+++ b/xfa/fxfa/xfa_ffdoc.h
@@ -40,9 +40,9 @@ class CXFA_FFDoc {
CXFA_FFDocView* CreateDocView(uint32_t dwView = 0);
- FX_BOOL OpenDoc(IFX_SeekableReadStream* pStream, FX_BOOL bTakeOverFile);
- FX_BOOL OpenDoc(CPDF_Document* pPDFDoc);
- FX_BOOL CloseDoc();
+ bool OpenDoc(IFX_SeekableReadStream* pStream, bool bTakeOverFile);
+ bool OpenDoc(CPDF_Document* pPDFDoc);
+ bool CloseDoc();
CXFA_Document* GetXFADoc() { return m_pDocumentParser->GetDocument(); }
CXFA_FFApp* GetApp() { return m_pApp; }
@@ -56,7 +56,7 @@ class CXFA_FFDoc {
bool SavePackage(XFA_HashCode code,
IFX_SeekableWriteStream* pFile,
CXFA_ChecksumContext* pCSContext);
- FX_BOOL ImportData(IFX_SeekableReadStream* pStream, FX_BOOL bXDP = TRUE);
+ bool ImportData(IFX_SeekableReadStream* pStream, bool bXDP = true);
protected:
IXFA_DocEnvironment* const m_pDocEnvironment;
@@ -68,7 +68,7 @@ class CXFA_FFDoc {
std::map<uint32_t, FX_IMAGEDIB_AND_DPI> m_HashToDibDpiMap;
std::map<uint32_t, std::unique_ptr<CXFA_FFDocView>> m_TypeToDocViewMap;
uint32_t m_dwDocType;
- FX_BOOL m_bOwnStream;
+ bool m_bOwnStream;
};
#endif // XFA_FXFA_XFA_FFDOC_H_
diff --git a/xfa/fxfa/xfa_ffdochandler.h b/xfa/fxfa/xfa_ffdochandler.h
index 3ffdae729a..0e4f71786c 100644
--- a/xfa/fxfa/xfa_ffdochandler.h
+++ b/xfa/fxfa/xfa_ffdochandler.h
@@ -19,11 +19,11 @@ class CXFA_FFDocHandler {
CFXJSE_Value* GetXFAScriptObject(CXFA_FFDoc* hDoc);
XFA_ATTRIBUTEENUM GetRestoreState(CXFA_FFDoc* hDoc);
- FX_BOOL RunDocScript(CXFA_FFDoc* hDoc,
- XFA_SCRIPTTYPE eScriptType,
- const CFX_WideStringC& wsScript,
- CFXJSE_Value* pRetValue,
- CFXJSE_Value* pThisObject);
+ bool RunDocScript(CXFA_FFDoc* hDoc,
+ XFA_SCRIPTTYPE eScriptType,
+ const CFX_WideStringC& wsScript,
+ CFXJSE_Value* pRetValue,
+ CFXJSE_Value* pThisObject);
protected:
};
diff --git a/xfa/fxfa/xfa_ffdocview.h b/xfa/fxfa/xfa_ffdocview.h
index dcc2f469da..31e4df955f 100644
--- a/xfa/fxfa/xfa_ffdocview.h
+++ b/xfa/fxfa/xfa_ffdocview.h
@@ -57,7 +57,7 @@ class CXFA_FFDocView {
XFA_WIDGETORDER eOrder = XFA_WIDGETORDER_PreOrder);
CXFA_FFWidget* GetFocusWidget();
void KillFocus();
- FX_BOOL SetFocus(CXFA_FFWidget* hWidget);
+ bool SetFocus(CXFA_FFWidget* hWidget);
CXFA_FFWidget* GetWidgetByName(const CFX_WideString& wsName,
CXFA_FFWidget* pRefWidget);
CXFA_WidgetAcc* GetWidgetAccByName(const CFX_WideString& wsName,
@@ -66,7 +66,7 @@ class CXFA_FFDocView {
void OnPageEvent(CXFA_ContainerLayoutItem* pSender, uint32_t dwEvent);
void LockUpdate();
void UnlockUpdate();
- FX_BOOL IsUpdateLocked();
+ bool IsUpdateLocked();
void ClearInvalidateList();
void AddInvalidateRect(CXFA_FFWidget* pWidget, const CFX_RectF& rtInvalidate);
void AddInvalidateRect(CXFA_FFPageView* pPageView,
@@ -75,8 +75,8 @@ class CXFA_FFDocView {
void RunDocClose();
void DestroyDocView();
- FX_BOOL InitValidate(CXFA_Node* pNode);
- FX_BOOL RunValidate();
+ bool InitValidate(CXFA_Node* pNode);
+ bool RunValidate();
void SetChangeMark();
@@ -84,8 +84,8 @@ class CXFA_FFDocView {
void AddCalculateNodeNotify(CXFA_Node* pNodeChange);
void AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc);
int32_t RunCalculateWidgets();
- FX_BOOL IsStaticNotify();
- FX_BOOL RunLayout();
+ bool IsStaticNotify();
+ bool RunLayout();
void RunSubformIndexChange();
void AddNewFormNode(CXFA_Node* pNode);
void AddIndexChangedSubform(CXFA_Node* pNode);
@@ -94,22 +94,22 @@ class CXFA_FFDocView {
void DeleteLayoutItem(CXFA_FFWidget* pWidget);
int32_t ExecEventActivityByDeepFirst(CXFA_Node* pFormNode,
XFA_EVENTTYPE eEventType,
- FX_BOOL bIsFormReady,
- FX_BOOL bRecursive,
+ bool bIsFormReady,
+ bool bRecursive,
CXFA_Node* pExclude);
- FX_BOOL m_bLayoutEvent;
+ bool m_bLayoutEvent;
CFX_WideStringArray m_arrNullTestMsg;
CXFA_FFWidget* m_pListFocusWidget;
- FX_BOOL m_bInLayoutStatus;
+ bool m_bInLayoutStatus;
protected:
- FX_BOOL RunEventLayoutReady();
+ bool RunEventLayoutReady();
void RunBindItems();
- FX_BOOL InitCalculate(CXFA_Node* pNode);
+ bool InitCalculate(CXFA_Node* pNode);
void InitLayout(CXFA_Node* pNode);
void RunCalculateRecursive(int32_t& iIndex);
void ShowNullTestMsg();
- FX_BOOL ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc);
+ bool ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc);
CXFA_Node* GetRootSubform();
CXFA_FFDoc* const m_pDoc;
@@ -140,7 +140,7 @@ class CXFA_WidgetAccIterator {
CXFA_WidgetAcc* MoveToNext();
CXFA_WidgetAcc* MoveToPrevious();
CXFA_WidgetAcc* GetCurrentWidgetAcc();
- FX_BOOL SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget);
+ bool SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget);
void SkipTree();
protected:
diff --git a/xfa/fxfa/xfa_ffpageview.h b/xfa/fxfa/xfa_ffpageview.h
index cd0f68c080..c6bbe7dbe9 100644
--- a/xfa/fxfa/xfa_ffpageview.h
+++ b/xfa/fxfa/xfa_ffpageview.h
@@ -48,7 +48,7 @@ class CXFA_FFPageWidgetIterator : public IXFA_WidgetIterator {
CXFA_FFWidget* MoveToNext() override;
CXFA_FFWidget* MoveToPrevious() override;
CXFA_FFWidget* GetCurrentWidget() override;
- FX_BOOL SetCurrentWidget(CXFA_FFWidget* hWidget) override;
+ bool SetCurrentWidget(CXFA_FFWidget* hWidget) override;
protected:
CXFA_FFWidget* GetWidget(CXFA_LayoutItem* pLayoutItem);
@@ -56,7 +56,7 @@ class CXFA_FFPageWidgetIterator : public IXFA_WidgetIterator {
CXFA_FFPageView* m_pPageView;
CXFA_FFWidget* m_hCurWidget;
uint32_t m_dwFilter;
- FX_BOOL m_bIgnorerelevant;
+ bool m_bIgnorerelevant;
CXFA_LayoutItemIterator m_sIterator;
};
typedef CFX_ArrayTemplate<CXFA_FFWidget*> CXFA_WidgetArray;
@@ -82,7 +82,7 @@ class CXFA_FFTabOrderPageWidgetIterator : public IXFA_WidgetIterator {
CXFA_FFWidget* MoveToNext() override;
CXFA_FFWidget* MoveToPrevious() override;
CXFA_FFWidget* GetCurrentWidget() override;
- FX_BOOL SetCurrentWidget(CXFA_FFWidget* hWidget) override;
+ bool SetCurrentWidget(CXFA_FFWidget* hWidget) override;
protected:
CXFA_FFWidget* GetTraverseWidget(CXFA_FFWidget* pWidget);
@@ -94,15 +94,15 @@ class CXFA_FFTabOrderPageWidgetIterator : public IXFA_WidgetIterator {
void OrderContainer(CXFA_LayoutItemIterator* sIterator,
CXFA_LayoutItem* pContainerItem,
CXFA_TabParam* pContainer,
- FX_BOOL& bCurrentItem,
- FX_BOOL& bContentArea,
- FX_BOOL bMarsterPage = FALSE);
+ bool& bCurrentItem,
+ bool& bContentArea,
+ bool bMarsterPage = false);
CXFA_WidgetArray m_TabOrderWidgetArray;
CXFA_FFPageView* m_pPageView;
uint32_t m_dwFilter;
int32_t m_iCurWidget;
- FX_BOOL m_bIgnorerelevant;
+ bool m_bIgnorerelevant;
};
#endif // XFA_FXFA_XFA_FFPAGEVIEW_H_
diff --git a/xfa/fxfa/xfa_ffwidget.h b/xfa/fxfa/xfa_ffwidget.h
index c8c954d8b9..a2aaee2fe2 100644
--- a/xfa/fxfa/xfa_ffwidget.h
+++ b/xfa/fxfa/xfa_ffwidget.h
@@ -46,59 +46,59 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem {
CXFA_FFWidget(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);
~CXFA_FFWidget() override;
- virtual FX_BOOL GetBBox(CFX_RectF& rtBox,
- uint32_t dwStatus,
- FX_BOOL bDrawFocus = FALSE);
+ virtual bool GetBBox(CFX_RectF& rtBox,
+ uint32_t dwStatus,
+ bool bDrawFocus = false);
virtual void RenderWidget(CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
uint32_t dwStatus);
- virtual FX_BOOL IsLoaded();
- virtual FX_BOOL LoadWidget();
+ virtual bool IsLoaded();
+ virtual bool LoadWidget();
virtual void UnloadWidget();
- virtual FX_BOOL PerformLayout();
- virtual FX_BOOL UpdateFWLData();
+ virtual bool PerformLayout();
+ virtual bool UpdateFWLData();
virtual void UpdateWidgetProperty();
- virtual FX_BOOL OnMouseEnter();
- virtual FX_BOOL OnMouseExit();
- virtual FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnMouseWheel(uint32_t dwFlags,
- int16_t zDelta,
- FX_FLOAT fx,
- FX_FLOAT fy);
- virtual FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
-
- virtual FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget);
- virtual FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget);
- virtual FX_BOOL OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags);
- virtual FX_BOOL OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags);
- virtual FX_BOOL OnChar(uint32_t dwChar, uint32_t dwFlags);
+ virtual bool OnMouseEnter();
+ virtual bool OnMouseExit();
+ virtual bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual bool OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual bool OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual bool OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual bool OnMouseWheel(uint32_t dwFlags,
+ int16_t zDelta,
+ FX_FLOAT fx,
+ FX_FLOAT fy);
+ virtual bool OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual bool OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+ virtual bool OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
+
+ virtual bool OnSetFocus(CXFA_FFWidget* pOldWidget);
+ virtual bool OnKillFocus(CXFA_FFWidget* pNewWidget);
+ virtual bool OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags);
+ virtual bool OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags);
+ virtual bool OnChar(uint32_t dwChar, uint32_t dwFlags);
virtual FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy);
- virtual FX_BOOL CanUndo();
- virtual FX_BOOL CanRedo();
- virtual FX_BOOL Undo();
- virtual FX_BOOL Redo();
- virtual FX_BOOL CanCopy();
- virtual FX_BOOL CanCut();
- virtual FX_BOOL CanPaste();
- virtual FX_BOOL CanSelectAll();
- virtual FX_BOOL CanDelete();
- virtual FX_BOOL CanDeSelect();
- virtual FX_BOOL Copy(CFX_WideString& wsCopy);
- virtual FX_BOOL Cut(CFX_WideString& wsCut);
- virtual FX_BOOL Paste(const CFX_WideString& wsPaste);
- virtual FX_BOOL SelectAll();
- virtual FX_BOOL Delete();
- virtual FX_BOOL DeSelect();
- virtual FX_BOOL GetSuggestWords(CFX_PointF pointf,
- std::vector<CFX_ByteString>& sSuggest);
- virtual FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf,
- const CFX_ByteStringC& bsReplace);
+ virtual bool OnSetCursor(FX_FLOAT fx, FX_FLOAT fy);
+ virtual bool CanUndo();
+ virtual bool CanRedo();
+ virtual bool Undo();
+ virtual bool Redo();
+ virtual bool CanCopy();
+ virtual bool CanCut();
+ virtual bool CanPaste();
+ virtual bool CanSelectAll();
+ virtual bool CanDelete();
+ virtual bool CanDeSelect();
+ virtual bool Copy(CFX_WideString& wsCopy);
+ virtual bool Cut(CFX_WideString& wsCut);
+ virtual bool Paste(const CFX_WideString& wsPaste);
+ virtual bool SelectAll();
+ virtual bool Delete();
+ virtual bool DeSelect();
+ virtual bool GetSuggestWords(CFX_PointF pointf,
+ std::vector<CFX_ByteString>& sSuggest);
+ virtual bool ReplaceSpellCheckWord(CFX_PointF pointf,
+ const CFX_ByteStringC& bsReplace);
CXFA_FFPageView* GetPageView();
void SetPageView(CXFA_FFPageView* pPageView);
@@ -108,7 +108,7 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem {
void ModifyStatus(uint32_t dwAdded, uint32_t dwRemoved);
CXFA_WidgetAcc* GetDataAcc();
- FX_BOOL GetToolTip(CFX_WideString& wsToolTip);
+ bool GetToolTip(CFX_WideString& wsToolTip);
CXFA_FFDocView* GetDocView();
void SetDocView(CXFA_FFDocView* pDocView);
@@ -117,17 +117,17 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem {
IXFA_AppProvider* GetAppProvider();
void InvalidateWidget(const CFX_RectF* pRect = nullptr);
void AddInvalidateRect(const CFX_RectF* pRect = nullptr);
- FX_BOOL GetCaptionText(CFX_WideString& wsCap);
+ bool GetCaptionText(CFX_WideString& wsCap);
bool IsFocused();
void Rotate2Normal(FX_FLOAT& fx, FX_FLOAT& fy);
void GetRotateMatrix(CFX_Matrix& mt);
- FX_BOOL IsLayoutRectEmpty();
+ bool IsLayoutRectEmpty();
CXFA_FFWidget* GetParent();
- FX_BOOL IsAncestorOf(CXFA_FFWidget* pWidget);
+ bool IsAncestorOf(CXFA_FFWidget* pWidget);
const IFWL_App* GetFWLApp();
protected:
- virtual FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy);
+ virtual bool PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy);
void DrawBorder(CFX_Graphics* pGS,
CXFA_Box box,
@@ -139,8 +139,8 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem {
void GetRectWithoutRotate(CFX_RectF& rtWidget);
bool IsMatchVisibleStatus(uint32_t dwStatus);
void EventKillFocus();
- FX_BOOL IsButtonDown();
- void SetButtonDown(FX_BOOL bSet);
+ bool IsButtonDown();
+ void SetButtonDown(bool bSet);
CXFA_FFDocView* m_pDocView;
CXFA_FFPageView* m_pPageView;
@@ -163,7 +163,7 @@ void XFA_DrawImage(CFX_Graphics* pGS,
int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top);
CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc* pDoc,
CXFA_Image* pImage,
- FX_BOOL& bNameImage,
+ bool& bNameImage,
int32_t& iImageXDpi,
int32_t& iImageYDpi);
CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_SeekableReadStream* pImageFileRead,
@@ -174,9 +174,9 @@ FXCODEC_IMAGE_TYPE XFA_GetImageType(const CFX_WideString& wsType);
FX_CHAR* XFA_Base64Encode(const uint8_t* buf, int32_t buf_len);
void XFA_RectWidthoutMargin(CFX_RectF& rt,
const CXFA_Margin& mg,
- FX_BOOL bUI = FALSE);
+ bool bUI = false);
CXFA_FFWidget* XFA_GetWidgetFromLayoutItem(CXFA_LayoutItem* pLayoutItem);
-FX_BOOL XFA_IsCreateWidget(XFA_Element iType);
+bool XFA_IsCreateWidget(XFA_Element iType);
#define XFA_DRAWBOX_ForceRound 1
#define XFA_DRAWBOX_Lowered3D 2
void XFA_DrawBox(CXFA_Box box,
diff --git a/xfa/fxfa/xfa_ffwidgethandler.h b/xfa/fxfa/xfa_ffwidgethandler.h
index 720ec66f4c..ccb2f3d630 100644
--- a/xfa/fxfa/xfa_ffwidgethandler.h
+++ b/xfa/fxfa/xfa_ffwidgethandler.h
@@ -25,54 +25,52 @@ class CXFA_FFWidgetHandler {
XFA_WIDGETTYPE eType,
CXFA_FFWidget* hBefore = nullptr);
- FX_BOOL OnMouseEnter(CXFA_FFWidget* hWidget);
- FX_BOOL OnMouseExit(CXFA_FFWidget* hWidget);
- FX_BOOL OnLButtonDown(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy);
- FX_BOOL OnLButtonUp(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy);
- FX_BOOL OnLButtonDblClk(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy);
- FX_BOOL OnMouseMove(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy);
- FX_BOOL OnMouseWheel(CXFA_FFWidget* hWidget,
+ bool OnMouseEnter(CXFA_FFWidget* hWidget);
+ bool OnMouseExit(CXFA_FFWidget* hWidget);
+ bool OnLButtonDown(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy);
+ bool OnLButtonUp(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy);
+ bool OnLButtonDblClk(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy);
+ bool OnMouseMove(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy);
+ bool OnMouseWheel(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ int16_t zDelta,
+ FX_FLOAT fx,
+ FX_FLOAT fy);
+ bool OnRButtonDown(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy);
+ bool OnRButtonUp(CXFA_FFWidget* hWidget,
+ uint32_t dwFlags,
+ FX_FLOAT fx,
+ FX_FLOAT fy);
+ bool OnRButtonDblClk(CXFA_FFWidget* hWidget,
uint32_t dwFlags,
- int16_t zDelta,
FX_FLOAT fx,
FX_FLOAT fy);
- FX_BOOL OnRButtonDown(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy);
- FX_BOOL OnRButtonUp(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy);
- FX_BOOL OnRButtonDblClk(CXFA_FFWidget* hWidget,
- uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy);
- FX_BOOL OnKeyDown(CXFA_FFWidget* hWidget,
- uint32_t dwKeyCode,
- uint32_t dwFlags);
- FX_BOOL OnKeyUp(CXFA_FFWidget* hWidget, uint32_t dwKeyCode, uint32_t dwFlags);
- FX_BOOL OnChar(CXFA_FFWidget* hWidget, uint32_t dwChar, uint32_t dwFlags);
+ bool OnKeyDown(CXFA_FFWidget* hWidget, uint32_t dwKeyCode, uint32_t dwFlags);
+ bool OnKeyUp(CXFA_FFWidget* hWidget, uint32_t dwKeyCode, uint32_t dwFlags);
+ bool OnChar(CXFA_FFWidget* hWidget, uint32_t dwChar, uint32_t dwFlags);
FWL_WidgetHit OnHitTest(CXFA_FFWidget* hWidget, FX_FLOAT fx, FX_FLOAT fy);
- FX_BOOL OnSetCursor(CXFA_FFWidget* hWidget, FX_FLOAT fx, FX_FLOAT fy);
+ bool OnSetCursor(CXFA_FFWidget* hWidget, FX_FLOAT fx, FX_FLOAT fy);
void RenderWidget(CXFA_FFWidget* hWidget,
CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
- FX_BOOL bHighlight);
- FX_BOOL HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType);
+ bool bHighlight);
+ bool HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType);
int32_t ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam);
protected:
diff --git a/xfa/fxfa/xfa_rendercontext.h b/xfa/fxfa/xfa_rendercontext.h
index de2449eded..c424005b1e 100644
--- a/xfa/fxfa/xfa_rendercontext.h
+++ b/xfa/fxfa/xfa_rendercontext.h
@@ -13,10 +13,10 @@
class CXFA_RenderOptions {
public:
- CXFA_RenderOptions() : m_bPrint(FALSE), m_bHighlight(TRUE) {}
+ CXFA_RenderOptions() : m_bPrint(false), m_bHighlight(true) {}
- FX_BOOL m_bPrint;
- FX_BOOL m_bHighlight;
+ bool m_bPrint;
+ bool m_bHighlight;
};
class CXFA_RenderContext {
diff --git a/xfa/fxgraphics/cfx_graphics.cpp b/xfa/fxgraphics/cfx_graphics.cpp
index bc8b18ba36..824e7c68da 100644
--- a/xfa/fxgraphics/cfx_graphics.cpp
+++ b/xfa/fxgraphics/cfx_graphics.cpp
@@ -573,7 +573,7 @@ CFX_Graphics::CFX_Graphics()
: m_type(FX_CONTEXT_None), m_renderDevice(nullptr) {}
FWL_Error CFX_Graphics::Create(CFX_RenderDevice* renderDevice,
- FX_BOOL isAntialiasing) {
+ bool isAntialiasing) {
if (!renderDevice)
return FWL_Error::ParameterInvalid;
if (m_type != FX_CONTEXT_None)
@@ -590,8 +590,8 @@ FWL_Error CFX_Graphics::Create(CFX_RenderDevice* renderDevice,
FWL_Error CFX_Graphics::Create(int32_t width,
int32_t height,
FXDIB_Format format,
- FX_BOOL isNative,
- FX_BOOL isAntialiasing) {
+ bool isNative,
+ bool isAntialiasing) {
if (m_type != FX_CONTEXT_None)
return FWL_Error::PropertyInvalid;
@@ -612,7 +612,7 @@ FWL_Error CFX_Graphics::GetDeviceCap(const int32_t capID,
return FWL_Error::PropertyInvalid;
}
-FWL_Error CFX_Graphics::IsPrinterDevice(FX_BOOL& isPrinter) {
+FWL_Error CFX_Graphics::IsPrinterDevice(bool& isPrinter) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
isPrinter = m_renderDevice->GetDeviceClass() == FXDC_PRINTER;
return FWL_Error::Succeeded;
@@ -620,7 +620,7 @@ FWL_Error CFX_Graphics::IsPrinterDevice(FX_BOOL& isPrinter) {
return FWL_Error::PropertyInvalid;
}
-FWL_Error CFX_Graphics::EnableAntialiasing(FX_BOOL isAntialiasing) {
+FWL_Error CFX_Graphics::EnableAntialiasing(bool isAntialiasing) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.isAntialiasing = isAntialiasing;
return FWL_Error::Succeeded;
@@ -761,7 +761,7 @@ FWL_Error CFX_Graphics::GetLineWidth(FX_FLOAT& lineWidth) const {
return FWL_Error::PropertyInvalid;
}
-FWL_Error CFX_Graphics::SetLineWidth(FX_FLOAT lineWidth, FX_BOOL isActOnDash) {
+FWL_Error CFX_Graphics::SetLineWidth(FX_FLOAT lineWidth, bool isActOnDash) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.graphState.m_LineWidth = lineWidth;
m_info.isActOnDash = isActOnDash;
@@ -831,7 +831,7 @@ FWL_Error CFX_Graphics::ClipPath(CFX_Path* path,
if (!path)
return FWL_Error::ParameterInvalid;
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
- FX_BOOL result =
+ bool result =
m_renderDevice->SetClip_PathFill(path->GetPathData(), matrix, fillMode);
if (!result)
return FWL_Error::Indefinite;
@@ -956,7 +956,7 @@ FWL_Error CFX_Graphics::ShowText(const CFX_PointF& point,
void CFX_Graphics::CalcTextRect(CFX_RectF& rect,
const CFX_WideString& text,
- FX_BOOL isMultiline,
+ bool isMultiline,
CFX_Matrix* matrix) {
if (m_type != FX_CONTEXT_Device || !m_renderDevice)
return;
@@ -981,7 +981,7 @@ FWL_Error CFX_Graphics::Transfer(CFX_Graphics* graphics,
}
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
CFX_DIBitmap* bitmap = graphics->m_renderDevice->GetBitmap();
- FX_BOOL result = m_renderDevice->SetDIBits(bitmap, 0, 0);
+ bool result = m_renderDevice->SetDIBits(bitmap, 0, 0);
if (!result)
return FWL_Error::MethodNotSupported;
return FWL_Error::Succeeded;
@@ -1004,7 +1004,7 @@ FWL_Error CFX_Graphics::Transfer(CFX_Graphics* graphics,
}
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
CFX_DIBitmap bmp;
- FX_BOOL result =
+ bool result =
bmp.Create((int32_t)dstRect.width, (int32_t)dstRect.height,
graphics->m_renderDevice->GetBitmap()->GetFormat());
if (!result)
@@ -1170,7 +1170,7 @@ FWL_Error CFX_Graphics::RenderDeviceStrokePath(CFX_Path* path,
}
switch (m_info.strokeColor->m_type) {
case FX_COLOR_Solid: {
- FX_BOOL result =
+ bool result =
m_renderDevice->DrawPath(path->GetPathData(), &m, &m_info.graphState,
0x0, m_info.strokeColor->m_info.argb, 0);
if (!result)
@@ -1199,7 +1199,7 @@ FWL_Error CFX_Graphics::RenderDeviceFillPath(CFX_Path* path,
}
switch (m_info.fillColor->m_type) {
case FX_COLOR_Solid: {
- FX_BOOL result = m_renderDevice->DrawPath(
+ bool result = m_renderDevice->DrawPath(
path->GetPathData(), &m, &m_info.graphState,
m_info.fillColor->m_info.argb, 0x0, fillMode);
if (!result)
@@ -1229,7 +1229,7 @@ FWL_Error CFX_Graphics::RenderDeviceDrawImage(CFX_DIBSource* source,
point.x, point.y);
m2.Concat(m1);
int32_t left, top;
- std::unique_ptr<CFX_DIBitmap> bmp1(source->FlipImage(FALSE, TRUE));
+ std::unique_ptr<CFX_DIBitmap> bmp1(source->FlipImage(false, true));
std::unique_ptr<CFX_DIBitmap> bmp2(bmp1->TransformTo(&m2, left, top));
CFX_RectF r;
GetClipRect(r);
@@ -1262,7 +1262,7 @@ FWL_Error CFX_Graphics::RenderDeviceStretchImage(CFX_DIBSource* source,
m2.Set(rect.Width(), 0.0, 0.0, rect.Height(), rect.left, rect.top);
m2.Concat(m1);
int32_t left, top;
- std::unique_ptr<CFX_DIBitmap> bmp2(bmp1->FlipImage(FALSE, TRUE));
+ std::unique_ptr<CFX_DIBitmap> bmp2(bmp1->FlipImage(false, true));
std::unique_ptr<CFX_DIBitmap> bmp3(bmp2->TransformTo(&m2, left, top));
CFX_RectF r;
GetClipRect(r);
@@ -1292,7 +1292,7 @@ FWL_Error CFX_Graphics::RenderDeviceShowText(const CFX_PointF& point,
if (matrix) {
m.Concat(*matrix);
}
- FX_BOOL result = m_renderDevice->DrawNormalText(
+ bool result = m_renderDevice->DrawNormalText(
length, charPos, m_info.font, -m_info.fontSize * m_info.fontHScale, &m,
m_info.fillColor->m_info.argb, FXTEXT_CLEARTYPE);
if (!result)
@@ -1486,7 +1486,7 @@ FWL_Error CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource* source,
0);
m.Concat(*matrix);
int32_t left, top;
- std::unique_ptr<CFX_DIBitmap> bmp1(source->FlipImage(FALSE, TRUE));
+ std::unique_ptr<CFX_DIBitmap> bmp1(source->FlipImage(false, true));
std::unique_ptr<CFX_DIBitmap> bmp2(bmp1->TransformTo(&m, left, top));
m_renderDevice->SetDIBits(bmp2.get(), left, top);
}
@@ -1510,7 +1510,7 @@ FWL_Error CFX_Graphics::CalcTextInfo(const CFX_WideString& text,
charPos[0].m_GlyphIndex = encoding->GlyphFromCharCode(charCodes[0]);
charPos[0].m_FontCharWidth = FXSYS_round(
m_info.font->GetGlyphWidth(charPos[0].m_GlyphIndex) * m_info.fontHScale);
- charPos[0].m_bGlyphAdjust = TRUE;
+ charPos[0].m_bGlyphAdjust = true;
charPos[0].m_AdjustMatrix[0] = -1;
charPos[0].m_AdjustMatrix[1] = 0;
charPos[0].m_AdjustMatrix[2] = 0;
@@ -1525,7 +1525,7 @@ FWL_Error CFX_Graphics::CalcTextInfo(const CFX_WideString& text,
charPos[i].m_FontCharWidth =
FXSYS_round(m_info.font->GetGlyphWidth(charPos[i].m_GlyphIndex) *
m_info.fontHScale);
- charPos[i].m_bGlyphAdjust = TRUE;
+ charPos[i].m_bGlyphAdjust = true;
charPos[i].m_AdjustMatrix[0] = -1;
charPos[i].m_AdjustMatrix[1] = 0;
charPos[i].m_AdjustMatrix[2] = 0;
@@ -1539,9 +1539,9 @@ FWL_Error CFX_Graphics::CalcTextInfo(const CFX_WideString& text,
}
CFX_Graphics::TInfo::TInfo()
- : isAntialiasing(TRUE),
+ : isAntialiasing(true),
strokeAlignment(FX_STROKEALIGNMENT_Center),
- isActOnDash(FALSE),
+ isActOnDash(false),
strokeColor(nullptr),
fillColor(nullptr),
font(nullptr),
diff --git a/xfa/fxgraphics/cfx_graphics.h b/xfa/fxgraphics/cfx_graphics.h
index e79219d877..7d9fff3138 100644
--- a/xfa/fxgraphics/cfx_graphics.h
+++ b/xfa/fxgraphics/cfx_graphics.h
@@ -103,17 +103,16 @@ class CFX_Graphics {
CFX_Graphics();
virtual ~CFX_Graphics();
- FWL_Error Create(CFX_RenderDevice* renderDevice,
- FX_BOOL isAntialiasing = TRUE);
+ FWL_Error Create(CFX_RenderDevice* renderDevice, bool isAntialiasing = true);
FWL_Error Create(int32_t width,
int32_t height,
FXDIB_Format format,
- FX_BOOL isNative = TRUE,
- FX_BOOL isAntialiasing = TRUE);
+ bool isNative = true,
+ bool isAntialiasing = true);
FWL_Error GetDeviceCap(const int32_t capID, FX_DeviceCap& capVal);
- FWL_Error IsPrinterDevice(FX_BOOL& isPrinter);
- FWL_Error EnableAntialiasing(FX_BOOL isAntialiasing);
+ FWL_Error IsPrinterDevice(bool& isPrinter);
+ FWL_Error EnableAntialiasing(bool isAntialiasing);
FWL_Error SaveGraphState();
FWL_Error RestoreGraphState();
@@ -136,7 +135,7 @@ class CFX_Graphics {
FWL_Error SetLineDash(FX_DashStyle dashStyle);
FWL_Error SetLineJoin(CFX_GraphStateData::LineJoin lineJoin);
FWL_Error SetMiterLimit(FX_FLOAT miterLimit);
- FWL_Error SetLineWidth(FX_FLOAT lineWidth, FX_BOOL isActOnDash = FALSE);
+ FWL_Error SetLineWidth(FX_FLOAT lineWidth, bool isActOnDash = false);
FWL_Error SetStrokeAlignment(FX_StrokeAlignment strokeAlignment);
FWL_Error SetStrokeColor(CFX_Color* color);
FWL_Error SetFillColor(CFX_Color* color);
@@ -167,7 +166,7 @@ class CFX_Graphics {
CFX_Matrix* matrix = nullptr);
void CalcTextRect(CFX_RectF& rect,
const CFX_WideString& text,
- FX_BOOL isMultiline = FALSE,
+ bool isMultiline = false,
CFX_Matrix* matrix = nullptr);
FWL_Error Transfer(CFX_Graphics* graphics, const CFX_Matrix* matrix);
FWL_Error Transfer(CFX_Graphics* graphics,
@@ -190,10 +189,10 @@ class CFX_Graphics {
TInfo& operator=(const TInfo& other);
CFX_GraphStateData graphState;
- FX_BOOL isAntialiasing;
+ bool isAntialiasing;
FX_StrokeAlignment strokeAlignment;
CFX_Matrix CTM;
- FX_BOOL isActOnDash;
+ bool isActOnDash;
CFX_Color* strokeColor;
CFX_Color* fillColor;
CFX_Font* font;
diff --git a/xfa/fxgraphics/cfx_path.cpp b/xfa/fxgraphics/cfx_path.cpp
index e4fb727092..d02b7a8e48 100644
--- a/xfa/fxgraphics/cfx_path.cpp
+++ b/xfa/fxgraphics/cfx_path.cpp
@@ -162,12 +162,12 @@ FWL_Error CFX_Path::Clear() {
return FWL_Error::Succeeded;
}
-FX_BOOL CFX_Path::IsEmpty() const {
+bool CFX_Path::IsEmpty() const {
if (!m_generator)
- return FALSE;
+ return false;
if (m_generator->GetPathData()->GetPointCount() == 0)
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
CFX_PathData* CFX_Path::GetPathData() const {
diff --git a/xfa/fxgraphics/cfx_path.h b/xfa/fxgraphics/cfx_path.h
index 8a19d6481f..9171a91a00 100644
--- a/xfa/fxgraphics/cfx_path.h
+++ b/xfa/fxgraphics/cfx_path.h
@@ -70,7 +70,7 @@ class CFX_Path final {
FWL_Error AddSubpath(CFX_Path* path);
FWL_Error Clear();
- FX_BOOL IsEmpty() const;
+ bool IsEmpty() const;
CFX_PathData* GetPathData() const;
private:
diff --git a/xfa/fxgraphics/cfx_path_generator.cpp b/xfa/fxgraphics/cfx_path_generator.cpp
index b5843ed998..0122b1ce4d 100644
--- a/xfa/fxgraphics/cfx_path_generator.cpp
+++ b/xfa/fxgraphics/cfx_path_generator.cpp
@@ -161,7 +161,7 @@ void CFX_PathGenerator::AddArc(FX_FLOAT x,
x + (width * FXSYS_cos(start_angle)),
y + (height * FXSYS_sin(start_angle)), FXPT_MOVETO);
FX_FLOAT total_sweep = 0, local_sweep = 0, prev_sweep = 0;
- FX_BOOL done = FALSE;
+ bool done = false;
do {
if (sweep_angle < 0) {
prev_sweep = total_sweep;
@@ -169,7 +169,7 @@ void CFX_PathGenerator::AddArc(FX_FLOAT x,
total_sweep -= FX_PI / 2;
if (total_sweep <= sweep_angle + bezier_arc_angle_epsilon) {
local_sweep = sweep_angle - prev_sweep;
- done = TRUE;
+ done = true;
}
} else {
prev_sweep = total_sweep;
@@ -177,7 +177,7 @@ void CFX_PathGenerator::AddArc(FX_FLOAT x,
total_sweep += FX_PI / 2;
if (total_sweep >= sweep_angle - bezier_arc_angle_epsilon) {
local_sweep = sweep_angle - prev_sweep;
- done = TRUE;
+ done = true;
}
}
ArcTo(x, y, width, height, start_angle, local_sweep);
diff --git a/xfa/fxgraphics/cfx_shading.cpp b/xfa/fxgraphics/cfx_shading.cpp
index 8be8b03e26..07936302c9 100644
--- a/xfa/fxgraphics/cfx_shading.cpp
+++ b/xfa/fxgraphics/cfx_shading.cpp
@@ -8,8 +8,8 @@
CFX_Shading::CFX_Shading(const CFX_PointF& beginPoint,
const CFX_PointF& endPoint,
- FX_BOOL isExtendedBegin,
- FX_BOOL isExtendedEnd,
+ bool isExtendedBegin,
+ bool isExtendedEnd,
const FX_ARGB beginArgb,
const FX_ARGB endArgb)
: m_type(FX_SHADING_Axial),
@@ -28,8 +28,8 @@ CFX_Shading::CFX_Shading(const CFX_PointF& beginPoint,
const CFX_PointF& endPoint,
const FX_FLOAT beginRadius,
const FX_FLOAT endRadius,
- FX_BOOL isExtendedBegin,
- FX_BOOL isExtendedEnd,
+ bool isExtendedBegin,
+ bool isExtendedEnd,
const FX_ARGB beginArgb,
const FX_ARGB endArgb)
: m_type(FX_SHADING_Radial),
diff --git a/xfa/fxgraphics/cfx_shading.h b/xfa/fxgraphics/cfx_shading.h
index 2cc37cf0f6..4189581895 100644
--- a/xfa/fxgraphics/cfx_shading.h
+++ b/xfa/fxgraphics/cfx_shading.h
@@ -20,8 +20,8 @@ class CFX_Shading {
// Axial shading.
CFX_Shading(const CFX_PointF& beginPoint,
const CFX_PointF& endPoint,
- FX_BOOL isExtendedBegin,
- FX_BOOL isExtendedEnd,
+ bool isExtendedBegin,
+ bool isExtendedEnd,
const FX_ARGB beginArgb,
const FX_ARGB endArgb);
@@ -30,8 +30,8 @@ class CFX_Shading {
const CFX_PointF& endPoint,
const FX_FLOAT beginRadius,
const FX_FLOAT endRadius,
- FX_BOOL isExtendedBegin,
- FX_BOOL isExtendedEnd,
+ bool isExtendedBegin,
+ bool isExtendedEnd,
const FX_ARGB beginArgb,
const FX_ARGB endArgb);
virtual ~CFX_Shading();
@@ -46,8 +46,8 @@ class CFX_Shading {
const CFX_PointF m_endPoint;
const FX_FLOAT m_beginRadius;
const FX_FLOAT m_endRadius;
- const FX_BOOL m_isExtendedBegin;
- const FX_BOOL m_isExtendedEnd;
+ const bool m_isExtendedBegin;
+ const bool m_isExtendedEnd;
const FX_ARGB m_beginArgb;
const FX_ARGB m_endArgb;
FX_ARGB m_argbArray[FX_SHADING_Steps];