From bfa9a824a20f37c2dd7111012b46c929cf2ed8a0 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 9 Jun 2015 13:24:12 -0700 Subject: Merge to XFA: Use stdint.h types throughout PDFium. Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002 --- xfa/src/fdp/include/fde_brs.h | 18 +- xfa/src/fdp/include/fde_css.h | 64 +- xfa/src/fdp/include/fde_img.h | 30 +- xfa/src/fdp/include/fde_mem.h | 4 +- xfa/src/fdp/include/fde_pen.h | 20 +- xfa/src/fdp/include/fde_psr.h | 18 +- xfa/src/fdp/include/fde_rdr.h | 2 +- xfa/src/fdp/include/fde_rdv.h | 6 +- xfa/src/fdp/include/fde_tto.h | 28 +- xfa/src/fdp/include/fde_xml.h | 52 +- xfa/src/fdp/src/css/fde_csscache.h | 10 +- xfa/src/fdp/src/css/fde_cssdatatable.cpp | 64 +- xfa/src/fdp/src/css/fde_cssdatatable.h | 40 +- xfa/src/fdp/src/css/fde_cssdeclaration.cpp | 54 +- xfa/src/fdp/src/css/fde_cssdeclaration.h | 44 +- xfa/src/fdp/src/css/fde_cssstyleselector.cpp | 86 +-- xfa/src/fdp/src/css/fde_cssstyleselector.h | 70 +- xfa/src/fdp/src/css/fde_cssstylesheet.cpp | 32 +- xfa/src/fdp/src/css/fde_cssstylesheet.h | 22 +- xfa/src/fdp/src/css/fde_csssyntax.cpp | 30 +- xfa/src/fdp/src/css/fde_csssyntax.h | 38 +- xfa/src/fdp/src/fde/fde_devbasic.cpp | 2 +- xfa/src/fdp/src/fde/fde_devbasic.h | 8 +- xfa/src/fdp/src/fde/fde_gdidevice.cpp | 6 +- xfa/src/fdp/src/fde/fde_gdidevice.h | 6 +- xfa/src/fdp/src/fde/fde_gedevice.cpp | 48 +- xfa/src/fdp/src/fde/fde_gedevice.h | 14 +- xfa/src/fdp/src/fde/fde_geobject.cpp | 32 +- xfa/src/fdp/src/fde/fde_geobject.h | 4 +- xfa/src/fdp/src/fde/fde_object.cpp | 2 +- xfa/src/fdp/src/fde/fde_object.h | 54 +- xfa/src/fdp/src/fde/fde_render.cpp | 8 +- xfa/src/fdp/src/fde/fde_render.h | 2 +- xfa/src/fdp/src/tto/fde_textout.cpp | 172 ++--- xfa/src/fdp/src/tto/fde_textout.h | 80 +- xfa/src/fdp/src/xml/fde_xml.cpp | 232 +++--- xfa/src/fdp/src/xml/fde_xml.h | 108 +-- xfa/src/fee/include/fx_wordbreak.h | 6 +- xfa/src/fee/include/ifde_txtedtbuf.h | 14 +- xfa/src/fee/include/ifde_txtedtengine.h | 90 +-- xfa/src/fee/include/ifde_txtedtpage.h | 18 +- xfa/src/fee/src/fee/fde_txtedtblock.cpp | 196 ++--- xfa/src/fee/src/fee/fde_txtedtblock.h | 106 +-- xfa/src/fee/src/fee/fde_txtedtbuf.cpp | 92 +-- xfa/src/fee/src/fee/fde_txtedtbuf.h | 44 +- xfa/src/fee/src/fee/fde_txtedtengine.cpp | 630 ++++++++-------- xfa/src/fee/src/fee/fde_txtedtengine.h | 190 ++--- xfa/src/fee/src/fee/fde_txtedtpage.cpp | 124 ++-- xfa/src/fee/src/fee/fde_txtedtpage.h | 46 +- xfa/src/fee/src/fee/fde_txtedtparag.cpp | 42 +- xfa/src/fee/src/fee/fde_txtedtparag.h | 14 +- xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.cpp | 18 +- xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.h | 14 +- xfa/src/fee/src/fx_wordbreak/fx_wordbreakdata.cpp | 2 +- xfa/src/fgas/include/fx_alg.h | 14 +- xfa/src/fgas/include/fx_cpg.h | 62 +- xfa/src/fgas/include/fx_datetime.h | 112 +-- xfa/src/fgas/include/fx_fnt.h | 36 +- xfa/src/fgas/include/fx_lbk.h | 4 +- xfa/src/fgas/include/fx_locale.h | 30 +- xfa/src/fgas/include/fx_mem.h | 2 +- xfa/src/fgas/include/fx_rbk.h | 68 +- xfa/src/fgas/include/fx_sax.h | 4 +- xfa/src/fgas/include/fx_stm.h | 26 +- xfa/src/fgas/include/fx_sys.h | 30 +- xfa/src/fgas/include/fx_tbk.h | 66 +- xfa/src/fgas/include/fx_ucd.h | 2 +- xfa/src/fgas/include/fx_utl.h | 230 +++--- xfa/src/fgas/src/crt/fx_algorithm.cpp | 38 +- xfa/src/fgas/src/crt/fx_codepage.cpp | 26 +- xfa/src/fgas/src/crt/fx_cpmgr.cpp | 6 +- xfa/src/fgas/src/crt/fx_encode.cpp | 30 +- xfa/src/fgas/src/crt/fx_memory.cpp | 8 +- xfa/src/fgas/src/crt/fx_memory.h | 2 +- xfa/src/fgas/src/crt/fx_stream.cpp | 224 +++--- xfa/src/fgas/src/crt/fx_stream.h | 180 ++--- xfa/src/fgas/src/crt/fx_system.cpp | 28 +- xfa/src/fgas/src/crt/fx_utils.cpp | 146 ++-- xfa/src/fgas/src/crt/fx_utils.h | 22 +- xfa/src/fgas/src/font/fx_fontutils.cpp | 4 +- xfa/src/fgas/src/font/fx_gdifont.cpp | 66 +- xfa/src/fgas/src/font/fx_gdifont.h | 28 +- xfa/src/fgas/src/font/fx_gefont.cpp | 56 +- xfa/src/fgas/src/font/fx_gefont.h | 22 +- xfa/src/fgas/src/font/fx_stdfontmgr.cpp | 154 ++-- xfa/src/fgas/src/font/fx_stdfontmgr.h | 30 +- xfa/src/fgas/src/layout/fx_linebreak.cpp | 8 +- xfa/src/fgas/src/layout/fx_rtfbreak.cpp | 188 ++--- xfa/src/fgas/src/layout/fx_rtfbreak.h | 94 +-- xfa/src/fgas/src/layout/fx_textbreak.cpp | 172 ++--- xfa/src/fgas/src/layout/fx_textbreak.h | 88 +-- xfa/src/fgas/src/layout/fx_unicode.cpp | 12 +- xfa/src/fgas/src/layout/fx_unicode.h | 6 +- xfa/src/fgas/src/localization/fx_datetime.cpp | 216 +++--- xfa/src/fgas/src/localization/fx_locale.cpp | 552 +++++++------- xfa/src/fgas/src/localization/fx_localeimp.h | 6 +- xfa/src/fgas/src/localization/fx_localemgr.cpp | 10 +- xfa/src/fgas/src/xml/fx_sax_imp.cpp | 42 +- xfa/src/fgas/src/xml/fx_sax_imp.h | 34 +- xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp | 8 +- xfa/src/fwl/src/basewidget/fwl_caretimp.cpp | 4 +- xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp | 26 +- xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp | 88 +-- .../fwl/src/basewidget/fwl_datetimepickerimp.cpp | 52 +- xfa/src/fwl/src/basewidget/fwl_editimp.cpp | 204 +++--- xfa/src/fwl/src/basewidget/fwl_formproxyimp.cpp | 2 +- xfa/src/fwl/src/basewidget/fwl_listboximp.cpp | 100 +-- .../fwl/src/basewidget/fwl_monthcalendarimp.cpp | 112 +-- xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp | 6 +- xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp | 22 +- xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp | 6 +- xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp | 10 +- xfa/src/fwl/src/basewidget/fxmath_barcodeimp.cpp | 40 +- xfa/src/fwl/src/basewidget/include/fwl_caretimp.h | 4 +- .../fwl/src/basewidget/include/fwl_checkboximp.h | 8 +- .../fwl/src/basewidget/include/fwl_comboboximp.h | 50 +- .../src/basewidget/include/fwl_datetimepickerimp.h | 42 +- xfa/src/fwl/src/basewidget/include/fwl_editimp.h | 64 +- .../fwl/src/basewidget/include/fwl_formproxyimp.h | 2 +- .../fwl/src/basewidget/include/fwl_listboximp.h | 12 +- .../src/basewidget/include/fwl_monthcalendarimp.h | 68 +- .../fwl/src/basewidget/include/fwl_pushbuttonimp.h | 4 +- .../fwl/src/basewidget/include/fwl_scrollbarimp.h | 26 +- .../fwl/src/basewidget/include/fwl_spinbuttonimp.h | 6 +- .../src/basewidget/include/fwl_tooltipctrlimp.h | 6 +- .../fwl/src/basewidget/include/fxmath_barcodeimp.h | 30 +- xfa/src/fwl/src/core/fwl_appimp.cpp | 2 +- xfa/src/fwl/src/core/fwl_contentimp.cpp | 4 +- xfa/src/fwl/src/core/fwl_formimp.cpp | 12 +- xfa/src/fwl/src/core/fwl_gridimp.cpp | 166 ++--- xfa/src/fwl/src/core/fwl_noteimp.cpp | 70 +- xfa/src/fwl/src/core/fwl_sdadapterimp.cpp | 10 +- xfa/src/fwl/src/core/fwl_threadimp.cpp | 12 +- xfa/src/fwl/src/core/fwl_timerimp.cpp | 2 +- xfa/src/fwl/src/core/fwl_widgetimp.cpp | 18 +- xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp | 38 +- xfa/src/fwl/src/core/include/fwl_appimp.h | 2 +- xfa/src/fwl/src/core/include/fwl_contentimp.h | 2 +- xfa/src/fwl/src/core/include/fwl_formimp.h | 14 +- xfa/src/fwl/src/core/include/fwl_gridimp.h | 34 +- xfa/src/fwl/src/core/include/fwl_noteimp.h | 18 +- xfa/src/fwl/src/core/include/fwl_threadimp.h | 2 +- xfa/src/fwl/src/core/include/fwl_widgetimp.h | 14 +- xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h | 20 +- xfa/src/fwl/src/lightwidget/app.cpp | 2 +- xfa/src/fwl/src/lightwidget/checkbox.cpp | 4 +- xfa/src/fwl/src/lightwidget/combobox.cpp | 48 +- xfa/src/fwl/src/lightwidget/datetimepicker.cpp | 14 +- xfa/src/fwl/src/lightwidget/edit.cpp | 32 +- xfa/src/fwl/src/lightwidget/listbox.cpp | 42 +- xfa/src/fwl/src/lightwidget/picturebox.cpp | 12 +- xfa/src/fwl/src/lightwidget/theme.cpp | 24 +- xfa/src/fwl/src/lightwidget/tooltipctrl.cpp | 12 +- xfa/src/fwl/src/lightwidget/widget.cpp | 4 +- xfa/src/fwl/src/theme/checkboxtp.cpp | 10 +- xfa/src/fwl/src/theme/formtp.cpp | 22 +- xfa/src/fwl/src/theme/pushbuttontp.cpp | 4 +- xfa/src/fwl/src/theme/widgettp.cpp | 24 +- xfa/src/fxbarcode/BC_BarCode.cpp | 186 ++--- xfa/src/fxbarcode/BC_Binarizer.h | 4 +- xfa/src/fxbarcode/BC_BinaryBitmap.cpp | 10 +- xfa/src/fxbarcode/BC_BinaryBitmap.h | 10 +- .../fxbarcode/BC_BufferedImageLuminanceSource.cpp | 40 +- .../fxbarcode/BC_BufferedImageLuminanceSource.h | 14 +- xfa/src/fxbarcode/BC_DecoderResult.h | 12 +- xfa/src/fxbarcode/BC_Dimension.cpp | 8 +- xfa/src/fxbarcode/BC_Dimension.h | 12 +- xfa/src/fxbarcode/BC_Library.cpp | 2 +- xfa/src/fxbarcode/BC_LuminanceSource.cpp | 6 +- xfa/src/fxbarcode/BC_LuminanceSource.h | 14 +- xfa/src/fxbarcode/BC_Reader.h | 4 +- xfa/src/fxbarcode/BC_TwoDimWriter.cpp | 52 +- xfa/src/fxbarcode/BC_TwoDimWriter.h | 16 +- xfa/src/fxbarcode/BC_UtilCodingConvert.cpp | 6 +- xfa/src/fxbarcode/BC_UtilCodingConvert.h | 2 +- xfa/src/fxbarcode/BC_UtilRSS.cpp | 58 +- xfa/src/fxbarcode/BC_UtilRSS.h | 8 +- xfa/src/fxbarcode/BC_Utils.cpp | 14 +- xfa/src/fxbarcode/BC_Writer.cpp | 12 +- xfa/src/fxbarcode/BC_Writer.h | 26 +- xfa/src/fxbarcode/common/BC_CommonBitArray.cpp | 44 +- xfa/src/fxbarcode/common/BC_CommonBitArray.h | 20 +- xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp | 68 +- xfa/src/fxbarcode/common/BC_CommonBitMatrix.h | 38 +- xfa/src/fxbarcode/common/BC_CommonBitSource.cpp | 20 +- xfa/src/fxbarcode/common/BC_CommonBitSource.h | 10 +- xfa/src/fxbarcode/common/BC_CommonByteArray.cpp | 36 +- xfa/src/fxbarcode/common/BC_CommonByteArray.h | 24 +- xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp | 24 +- xfa/src/fxbarcode/common/BC_CommonByteMatrix.h | 22 +- .../fxbarcode/common/BC_CommonCharacterSetECI.cpp | 6 +- .../fxbarcode/common/BC_CommonCharacterSetECI.h | 8 +- .../fxbarcode/common/BC_CommonDecoderResult.cpp | 4 +- xfa/src/fxbarcode/common/BC_CommonDecoderResult.h | 4 +- xfa/src/fxbarcode/common/BC_CommonECI.cpp | 6 +- xfa/src/fxbarcode/common/BC_CommonECI.h | 8 +- .../common/BC_CommonPerspectiveTransform.cpp | 4 +- .../common/BC_GlobalHistogramBinarizer.cpp | 82 +-- .../fxbarcode/common/BC_GlobalHistogramBinarizer.h | 8 +- .../fxbarcode/common/BC_WhiteRectangleDetector.cpp | 50 +- .../fxbarcode/common/BC_WhiteRectangleDetector.h | 28 +- .../common/reedsolomon/BC_ReedSolomon.cpp | 20 +- .../fxbarcode/common/reedsolomon/BC_ReedSolomon.h | 4 +- .../common/reedsolomon/BC_ReedSolomonDecoder.cpp | 46 +- .../common/reedsolomon/BC_ReedSolomonDecoder.h | 8 +- .../common/reedsolomon/BC_ReedSolomonGF256.cpp | 20 +- .../common/reedsolomon/BC_ReedSolomonGF256.h | 18 +- .../common/reedsolomon/BC_ReedSolomonGF256Poly.cpp | 70 +- .../common/reedsolomon/BC_ReedSolomonGF256Poly.h | 22 +- xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp | 12 +- xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h | 6 +- xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp | 20 +- xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h | 6 +- xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp | 38 +- xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h | 12 +- .../datamatrix/BC_DataMatrixBitMatrixParser.cpp | 94 +-- .../datamatrix/BC_DataMatrixBitMatrixParser.h | 20 +- .../datamatrix/BC_DataMatrixDataBlock.cpp | 36 +- .../fxbarcode/datamatrix/BC_DataMatrixDataBlock.h | 8 +- .../BC_DataMatrixDecodedBitStreamParser.cpp | 94 +-- .../BC_DataMatrixDecodedBitStreamParser.h | 32 +- .../fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp | 24 +- .../fxbarcode/datamatrix/BC_DataMatrixDecoder.h | 4 +- .../fxbarcode/datamatrix/BC_DataMatrixDetector.cpp | 72 +- .../fxbarcode/datamatrix/BC_DataMatrixDetector.h | 24 +- .../fxbarcode/datamatrix/BC_DataMatrixReader.cpp | 4 +- xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h | 4 +- .../datamatrix/BC_DataMatrixSymbolInfo144.cpp | 4 +- .../datamatrix/BC_DataMatrixSymbolInfo144.h | 4 +- .../fxbarcode/datamatrix/BC_DataMatrixVersion.cpp | 38 +- .../fxbarcode/datamatrix/BC_DataMatrixVersion.h | 56 +- .../fxbarcode/datamatrix/BC_DataMatrixWriter.cpp | 28 +- xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h | 12 +- .../fxbarcode/datamatrix/BC_DefaultPlacement.cpp | 38 +- xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h | 28 +- xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp | 28 +- xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h | 10 +- xfa/src/fxbarcode/datamatrix/BC_Encoder.h | 4 +- xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp | 20 +- xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h | 22 +- .../fxbarcode/datamatrix/BC_ErrorCorrection.cpp | 48 +- xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h | 16 +- .../fxbarcode/datamatrix/BC_HighLevelEncoder.cpp | 66 +- xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h | 16 +- xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp | 44 +- xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h | 54 +- xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp | 6 +- xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h | 4 +- xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp | 16 +- xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h | 8 +- xfa/src/fxbarcode/oned/BC_OneDReader.cpp | 66 +- xfa/src/fxbarcode/oned/BC_OneDReader.h | 18 +- xfa/src/fxbarcode/oned/BC_OneDimReader.cpp | 70 +- xfa/src/fxbarcode/oned/BC_OneDimReader.h | 30 +- xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp | 104 +-- xfa/src/fxbarcode/oned/BC_OneDimWriter.h | 42 +- xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp | 60 +- xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h | 8 +- xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp | 48 +- xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.h | 14 +- xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp | 90 +-- xfa/src/fxbarcode/oned/BC_OnedCode128Reader.h | 38 +- xfa/src/fxbarcode/oned/BC_OnedCode128Writer.cpp | 92 +-- xfa/src/fxbarcode/oned/BC_OnedCode128Writer.h | 26 +- xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp | 84 +-- xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h | 14 +- xfa/src/fxbarcode/oned/BC_OnedCode39Writer.cpp | 72 +- xfa/src/fxbarcode/oned/BC_OnedCode39Writer.h | 18 +- xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.cpp | 26 +- xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h | 6 +- xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp | 62 +- xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.h | 18 +- xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.cpp | 24 +- xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.h | 2 +- xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp | 58 +- xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.h | 16 +- xfa/src/fxbarcode/oned/BC_OnedUPCAReader.cpp | 14 +- xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h | 12 +- xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp | 38 +- xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.h | 10 +- xfa/src/fxbarcode/pdf417/BC_PDF417.cpp | 66 +- xfa/src/fxbarcode/pdf417/BC_PDF417.h | 28 +- .../fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp | 30 +- xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h | 24 +- .../fxbarcode/pdf417/BC_PDF417BarcodeMetadata.cpp | 12 +- .../fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h | 22 +- xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp | 16 +- xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.h | 12 +- xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp | 14 +- xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.h | 4 +- xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp | 26 +- xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.h | 22 +- xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.cpp | 20 +- xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.h | 30 +- .../fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp | 44 +- .../fxbarcode/pdf417/BC_PDF417CodewordDecoder.h | 8 +- xfa/src/fxbarcode/pdf417/BC_PDF417Common.cpp | 40 +- xfa/src/fxbarcode/pdf417/BC_PDF417Common.h | 26 +- .../pdf417/BC_PDF417DecodedBitStreamParser.cpp | 74 +- .../pdf417/BC_PDF417DecodedBitStreamParser.h | 32 +- .../fxbarcode/pdf417/BC_PDF417DetectionResult.cpp | 70 +- .../fxbarcode/pdf417/BC_PDF417DetectionResult.h | 28 +- .../pdf417/BC_PDF417DetectionResultColumn.cpp | 22 +- .../pdf417/BC_PDF417DetectionResultColumn.h | 12 +- .../BC_PDF417DetectionResultRowIndicatorColumn.cpp | 58 +- .../BC_PDF417DetectionResultRowIndicatorColumn.h | 6 +- xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp | 114 +-- xfa/src/fxbarcode/pdf417/BC_PDF417Detector.h | 38 +- .../fxbarcode/pdf417/BC_PDF417DetectorResult.cpp | 4 +- xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.cpp | 10 +- xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.h | 18 +- .../pdf417/BC_PDF417ECErrorCorrection.cpp | 72 +- .../fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h | 10 +- xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp | 26 +- xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.h | 22 +- .../fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp | 82 +-- xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.h | 22 +- .../fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp | 24 +- .../fxbarcode/pdf417/BC_PDF417ErrorCorrection.h | 8 +- .../fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp | 116 +-- .../fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h | 40 +- xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp | 36 +- xfa/src/fxbarcode/pdf417/BC_PDF417Reader.h | 14 +- .../fxbarcode/pdf417/BC_PDF417ResultMetadata.cpp | 4 +- xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.h | 6 +- .../fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp | 176 ++--- .../fxbarcode/pdf417/BC_PDF417ScanningDecoder.h | 52 +- xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp | 40 +- xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h | 10 +- .../qrcode/BC_QRAlignmentPatternFinder.cpp | 50 +- .../fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h | 18 +- xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp | 60 +- xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h | 12 +- xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp | 8 +- xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h | 8 +- xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.cpp | 12 +- xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.h | 12 +- xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp | 36 +- xfa/src/fxbarcode/qrcode/BC_QRCoder.h | 48 +- xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp | 46 +- xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.h | 24 +- xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp | 38 +- xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h | 6 +- xfa/src/fxbarcode/qrcode/BC_QRCoderECB.cpp | 6 +- xfa/src/fxbarcode/qrcode/BC_QRCoderECB.h | 10 +- xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.cpp | 16 +- xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.h | 12 +- xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp | 254 +++---- xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h | 60 +- .../qrcode/BC_QRCoderErrorCorrectionLevel.cpp | 8 +- .../qrcode/BC_QRCoderErrorCorrectionLevel.h | 12 +- .../qrcode/BC_QRCoderFormatInformation.cpp | 30 +- .../fxbarcode/qrcode/BC_QRCoderFormatInformation.h | 18 +- xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp | 78 +- xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.h | 12 +- xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp | 158 ++-- xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h | 58 +- xfa/src/fxbarcode/qrcode/BC_QRCoderMode.cpp | 30 +- xfa/src/fxbarcode/qrcode/BC_QRCoderMode.h | 12 +- xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.cpp | 52 +- xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h | 22 +- xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp | 40 +- xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h | 8 +- xfa/src/fxbarcode/qrcode/BC_QRDataMask.cpp | 30 +- xfa/src/fxbarcode/qrcode/BC_QRDataMask.h | 8 +- .../qrcode/BC_QRDecodedBitStreamParser.cpp | 68 +- .../fxbarcode/qrcode/BC_QRDecodedBitStreamParser.h | 16 +- xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp | 96 +-- xfa/src/fxbarcode/qrcode/BC_QRDetector.h | 16 +- xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.cpp | 2 +- xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.cpp | 2 +- xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.h | 4 +- .../fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp | 94 +-- .../fxbarcode/qrcode/BC_QRFinderPatternFinder.h | 22 +- xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp | 28 +- xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h | 6 +- xfa/src/fxbarcode/utils.h | 6 +- xfa/src/fxfa/src/app/xfa_checksum.cpp | 10 +- xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp | 6 +- xfa/src/fxfa/src/app/xfa_ffConfigAcc.h | 4 +- xfa/src/fxfa/src/app/xfa_ffapp.cpp | 26 +- xfa/src/fxfa/src/app/xfa_ffbarcode.cpp | 16 +- xfa/src/fxfa/src/app/xfa_ffbarcode.h | 4 +- xfa/src/fxfa/src/app/xfa_ffcheckbutton.cpp | 16 +- xfa/src/fxfa/src/app/xfa_ffcheckbutton.h | 6 +- xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp | 58 +- xfa/src/fxfa/src/app/xfa_ffchoicelist.h | 16 +- xfa/src/fxfa/src/app/xfa_ffdoc.cpp | 34 +- xfa/src/fxfa/src/app/xfa_ffdoc.h | 10 +- xfa/src/fxfa/src/app/xfa_ffdochandler.cpp | 8 +- xfa/src/fxfa/src/app/xfa_ffdochandler.h | 8 +- xfa/src/fxfa/src/app/xfa_ffdocview.cpp | 78 +- xfa/src/fxfa/src/app/xfa_ffdocview.h | 22 +- xfa/src/fxfa/src/app/xfa_ffexclgroup.cpp | 2 +- xfa/src/fxfa/src/app/xfa_ffexclgroup.h | 2 +- xfa/src/fxfa/src/app/xfa_fffield.cpp | 18 +- xfa/src/fxfa/src/app/xfa_fffield.h | 14 +- xfa/src/fxfa/src/app/xfa_ffimage.cpp | 12 +- xfa/src/fxfa/src/app/xfa_ffimage.h | 2 +- xfa/src/fxfa/src/app/xfa_ffimageedit.cpp | 18 +- xfa/src/fxfa/src/app/xfa_ffimageedit.h | 4 +- xfa/src/fxfa/src/app/xfa_ffnotify.cpp | 28 +- xfa/src/fxfa/src/app/xfa_ffnotify.h | 6 +- xfa/src/fxfa/src/app/xfa_ffpageview.cpp | 30 +- xfa/src/fxfa/src/app/xfa_ffpageview.h | 8 +- xfa/src/fxfa/src/app/xfa_ffpath.cpp | 12 +- xfa/src/fxfa/src/app/xfa_ffpath.h | 8 +- xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp | 4 +- xfa/src/fxfa/src/app/xfa_ffpushbutton.h | 4 +- xfa/src/fxfa/src/app/xfa_ffsignature.cpp | 4 +- xfa/src/fxfa/src/app/xfa_ffsignature.h | 4 +- xfa/src/fxfa/src/app/xfa_fftext.cpp | 10 +- xfa/src/fxfa/src/app/xfa_fftext.h | 2 +- xfa/src/fxfa/src/app/xfa_fftextedit.cpp | 36 +- xfa/src/fxfa/src/app/xfa_fftextedit.h | 4 +- xfa/src/fxfa/src/app/xfa_ffwidget.cpp | 110 +-- xfa/src/fxfa/src/app/xfa_ffwidget.h | 20 +- xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp | 88 +-- xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp | 8 +- xfa/src/fxfa/src/app/xfa_ffwidgethandler.h | 6 +- xfa/src/fxfa/src/app/xfa_fontmgr.cpp | 34 +- xfa/src/fxfa/src/app/xfa_fontmgr.h | 2 +- xfa/src/fxfa/src/app/xfa_fwladapter.h | 2 +- xfa/src/fxfa/src/app/xfa_fwltheme.cpp | 4 +- xfa/src/fxfa/src/app/xfa_fwltheme.h | 2 +- xfa/src/fxfa/src/app/xfa_rendercontext.cpp | 6 +- xfa/src/fxfa/src/app/xfa_rendercontext.h | 4 +- xfa/src/fxfa/src/app/xfa_textlayout.cpp | 192 ++--- xfa/src/fxfa/src/app/xfa_textlayout.h | 64 +- xfa/src/fxfa/src/common/fxfa_localevalue.h | 4 +- xfa/src/fxfa/src/common/xfa_doclayout.h | 14 +- xfa/src/fxfa/src/common/xfa_document.h | 6 +- xfa/src/fxfa/src/common/xfa_fm2jsapi.h | 2 +- xfa/src/fxfa/src/common/xfa_object.h | 74 +- xfa/src/fxfa/src/common/xfa_parser.h | 6 +- xfa/src/fxfa/src/common/xfa_script.h | 18 +- xfa/src/fxfa/src/common/xfa_utils.h | 8 +- xfa/src/fxfa/src/fm2js/xfa_expression.cpp | 38 +- xfa/src/fxfa/src/fm2js/xfa_expression.h | 4 +- xfa/src/fxfa/src/fm2js/xfa_fm2jsapi.cpp | 4 +- xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp | 816 ++++++++++----------- xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.h | 42 +- xfa/src/fxfa/src/fm2js/xfa_fmparse.cpp | 24 +- xfa/src/fxfa/src/fm2js/xfa_fmparse.h | 2 +- xfa/src/fxfa/src/fm2js/xfa_lexer.cpp | 20 +- xfa/src/fxfa/src/fm2js/xfa_lexer.h | 2 +- xfa/src/fxfa/src/fm2js/xfa_program.cpp | 8 +- xfa/src/fxfa/src/fm2js/xfa_program.h | 6 +- xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp | 30 +- xfa/src/fxfa/src/fm2js/xfa_simpleexpression.h | 4 +- xfa/src/fxfa/src/parser/xfa_basic_data.cpp | 16 +- xfa/src/fxfa/src/parser/xfa_basic_imp.cpp | 130 ++-- xfa/src/fxfa/src/parser/xfa_basic_imp.h | 24 +- .../src/parser/xfa_document_datamerger_imp.cpp | 34 +- xfa/src/fxfa/src/parser/xfa_document_imp.cpp | 8 +- .../fxfa/src/parser/xfa_document_layout_imp.cpp | 10 +- xfa/src/fxfa/src/parser/xfa_document_layout_imp.h | 10 +- xfa/src/fxfa/src/parser/xfa_document_serialize.cpp | 20 +- xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp | 10 +- xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp | 86 +-- xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h | 2 +- xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp | 62 +- xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h | 14 +- xfa/src/fxfa/src/parser/xfa_locale.cpp | 12 +- xfa/src/fxfa/src/parser/xfa_locale.h | 8 +- xfa/src/fxfa/src/parser/xfa_localemgr.cpp | 52 +- xfa/src/fxfa/src/parser/xfa_localevalue.cpp | 46 +- xfa/src/fxfa/src/parser/xfa_object_imp.cpp | 470 ++++++------ xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp | 516 ++++++------- xfa/src/fxfa/src/parser/xfa_parser_imp.cpp | 38 +- xfa/src/fxfa/src/parser/xfa_parser_imp.h | 14 +- .../src/parser/xfa_script_eventpseudomodel.cpp | 2 +- .../fxfa/src/parser/xfa_script_hostpseudomodel.cpp | 62 +- .../fxfa/src/parser/xfa_script_hostpseudomodel.h | 2 +- xfa/src/fxfa/src/parser/xfa_script_imp.cpp | 36 +- xfa/src/fxfa/src/parser/xfa_script_imp.h | 10 +- .../src/parser/xfa_script_layoutpseudomodel.cpp | 42 +- .../fxfa/src/parser/xfa_script_layoutpseudomodel.h | 2 +- xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp | 40 +- xfa/src/fxfa/src/parser/xfa_script_nodehelper.h | 12 +- .../src/parser/xfa_script_resolveprocessor.cpp | 76 +- .../fxfa/src/parser/xfa_script_resolveprocessor.h | 34 +- .../src/parser/xfa_script_signaturepseudomodel.cpp | 10 +- xfa/src/fxfa/src/parser/xfa_utils_imp.cpp | 18 +- xfa/src/fxgraphics/src/fx_graphics.cpp | 156 ++-- xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp | 68 +- xfa/src/fxgraphics/src/fx_metafile_interpreter.h | 44 +- xfa/src/fxgraphics/src/pre.h | 6 +- xfa/src/fxjse/src/class.cpp | 22 +- xfa/src/fxjse/src/context.cpp | 6 +- xfa/src/fxjse/src/dynprop.cpp | 10 +- xfa/src/fxjse/src/runtime.cpp | 6 +- xfa/src/fxjse/src/value.cpp | 40 +- xfa/src/fxjse/src/value.h | 14 +- 494 files changed, 9712 insertions(+), 9712 deletions(-) (limited to 'xfa/src') diff --git a/xfa/src/fdp/include/fde_brs.h b/xfa/src/fdp/include/fde_brs.h index 04a4f48ad5..dacf31fd2a 100644 --- a/xfa/src/fdp/include/fde_brs.h +++ b/xfa/src/fdp/include/fde_brs.h @@ -33,9 +33,9 @@ typedef CFX_ArrayTemplate CFDE_GradientColors; class IFDE_Brush { public: - static IFDE_Brush* Create(FX_INT32 iType); + static IFDE_Brush* Create(int32_t iType); virtual void Release() = 0; - virtual FX_INT32 GetType() const = 0; + virtual int32_t GetType() const = 0; }; class IFDE_SolidBrush : public IFDE_Brush { @@ -112,16 +112,16 @@ class IFDE_HatchBrush : public IFDE_Brush public: virtual FX_ARGB GetColor(FX_BOOL bForegroundColor) const = 0; virtual void SetColor(FX_ARGB color, FX_BOOL bForegroundColor) = 0; - virtual FX_INT32 GetHatchStyle() const = 0; - virtual FX_BOOL SetHatchStyle(FX_INT32 iHatchStyle) = 0; + virtual int32_t GetHatchStyle() const = 0; + virtual FX_BOOL SetHatchStyle(int32_t iHatchStyle) = 0; }; class IFDE_TextureBrush : public IFDE_Brush { public: virtual IFDE_Image* GetImage() const = 0; virtual void SetImage(IFDE_Image *pImage, FX_BOOL bAutoRelease) = 0; - virtual FX_INT32 GetWrapMode() const = 0; - virtual void SetWrapMode(FX_INT32 iWrapMode) = 0; + virtual int32_t GetWrapMode() const = 0; + virtual void SetWrapMode(int32_t iWrapMode) = 0; }; #define FDE_LINEARGRADIENTMODE_Horizontal 0 #define FDE_LINEARGRADIENTMODE_Vertical 1 @@ -134,10 +134,10 @@ public: virtual void SetLinearPoints(const CFX_PointF &startingPoint, const CFX_PointF &endingPoint) = 0; virtual void GetLinearColors(FX_ARGB &startingColor, FX_ARGB &endingColor) const = 0; virtual void SetLinearColors(const FX_ARGB &startingColor, const FX_ARGB &endingColor) = 0; - virtual FX_INT32 CountGradientColors() const = 0; + virtual int32_t CountGradientColors() const = 0; virtual FX_BOOL GetGradientColors(CFDE_GradientColors &colors) const = 0; virtual FX_BOOL SetGradientColors(const CFDE_GradientColors &colors) = 0; - virtual FX_INT32 GetWrapMode() const = 0; - virtual void SetWrapMode(FX_INT32 iWrapMode) = 0; + virtual int32_t GetWrapMode() const = 0; + virtual void SetWrapMode(int32_t iWrapMode) = 0; }; #endif diff --git a/xfa/src/fdp/include/fde_css.h b/xfa/src/fdp/include/fde_css.h index 2870c8d27a..0c9b323954 100644 --- a/xfa/src/fdp/include/fde_css.h +++ b/xfa/src/fdp/include/fde_css.h @@ -242,11 +242,11 @@ public: virtual FDE_CSSPRIMITIVETYPE GetPrimitiveType() const = 0; virtual FX_ARGB GetRGBColor() const = 0; virtual FX_FLOAT GetFloat() const = 0; - virtual FX_LPCWSTR GetString(FX_INT32 &iLength) const = 0; + virtual FX_LPCWSTR GetString(int32_t &iLength) const = 0; virtual FDE_CSSPROPERTYVALUE GetEnum() const = 0; virtual FX_LPCWSTR GetFuncName() const = 0; - virtual FX_INT32 CountArgs() const = 0; - virtual IFDE_CSSValue* GetArgs(FX_INT32 index) const = 0; + virtual int32_t CountArgs() const = 0; + virtual IFDE_CSSValue* GetArgs(int32_t index) const = 0; }; class IFDE_CSSValueList : public IFDE_CSSValue { @@ -255,8 +255,8 @@ public: { return FDE_CSSVALUETYPE_List; } - virtual FX_INT32 CountValues() const = 0; - virtual IFDE_CSSValue* GetValue(FX_INT32 index) const = 0; + virtual int32_t CountValues() const = 0; + virtual IFDE_CSSValue* GetValue(int32_t index) const = 0; }; enum FDE_CSSPROPERTY { FDE_CSSPROPERTY_WritingMode, @@ -429,8 +429,8 @@ public: { return FDE_CSSRULETYPE_Style; } - virtual FX_INT32 CountSelectorLists() const = 0; - virtual IFDE_CSSSelector* GetSelectorList(FX_INT32 index) const = 0; + virtual int32_t CountSelectorLists() const = 0; + virtual IFDE_CSSSelector* GetSelectorList(int32_t index) const = 0; virtual IFDE_CSSDeclaration* GetDeclaration() const = 0; }; class IFDE_CSSMediaRule : public IFDE_CSSRule @@ -441,8 +441,8 @@ public: return FDE_CSSRULETYPE_Media; } virtual FX_DWORD GetMediaList() const = 0; - virtual FX_INT32 CountRules() const = 0; - virtual IFDE_CSSRule* GetRule(FX_INT32 index) = 0; + virtual int32_t CountRules() const = 0; + virtual IFDE_CSSRule* GetRule(int32_t index) = 0; }; class IFDE_CSSFontFaceRule : public IFDE_CSSRule { @@ -458,13 +458,13 @@ class IFDE_CSSStyleSheet : public IFX_Unknown public: static IFDE_CSSStyleSheet* LoadHTMLStandardStyleSheet(); static IFDE_CSSStyleSheet* LoadFromStream(const CFX_WideString &szUrl, IFX_Stream *pStream, FX_WORD wCodePage, FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL); - static IFDE_CSSStyleSheet* LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, FX_INT32 iBufSize, FX_WORD wCodePage, FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL); + static IFDE_CSSStyleSheet* LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, int32_t iBufSize, FX_WORD wCodePage, FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL); virtual FX_BOOL GetUrl(CFX_WideString &szUrl) = 0; virtual FX_DWORD GetMediaList() const = 0; virtual FX_WORD GetCodePage() const = 0; - virtual FX_INT32 CountRules() const = 0; - virtual IFDE_CSSRule* GetRule(FX_INT32 index) = 0; + virtual int32_t CountRules() const = 0; + virtual IFDE_CSSRule* GetRule(int32_t index) = 0; }; typedef CFX_ArrayTemplate CFDE_CSSStyleSheetArray; #define FDE_CSSUSERSTYLESHEET (FX_BSTRC("#USERSHEET")) @@ -474,7 +474,7 @@ class IFDE_CSSStyleSheetCache public: static IFDE_CSSStyleSheetCache* Create(); virtual void Release() = 0; - virtual void SetMaxItems(FX_INT32 iMaxCount = 5) = 0; + virtual void SetMaxItems(int32_t iMaxCount = 5) = 0; virtual void AddStyleSheet(FX_BSTR szKey, IFDE_CSSStyleSheet *pStyleSheet) = 0; virtual IFDE_CSSStyleSheet* GetStyleSheet(FX_BSTR szKey) const = 0; virtual void RemoveStyleSheet(FX_BSTR szKey) = 0; @@ -503,11 +503,11 @@ class IFDE_CSSSyntaxParser public: static IFDE_CSSSyntaxParser* Create(); virtual void Release() = 0; - virtual FX_BOOL Init(IFX_Stream *pStream, FX_INT32 iCSSPlaneSize, FX_INT32 iTextDataSize = 32, FX_BOOL bOnlyDeclaration = FALSE) = 0; - virtual FX_BOOL Init(FX_LPCWSTR pBuffer, FX_INT32 iBufferSize, FX_INT32 iTextDatSize = 32, FX_BOOL bOnlyDeclaration = FALSE) = 0; + virtual FX_BOOL Init(IFX_Stream *pStream, int32_t iCSSPlaneSize, int32_t iTextDataSize = 32, FX_BOOL bOnlyDeclaration = FALSE) = 0; + virtual FX_BOOL Init(FX_LPCWSTR pBuffer, int32_t iBufferSize, int32_t iTextDatSize = 32, FX_BOOL bOnlyDeclaration = FALSE) = 0; virtual FDE_CSSSYNTAXSTATUS DoSyntaxParse() = 0; - virtual FX_LPCWSTR GetCurrentString(FX_INT32 &iLength) const = 0; + virtual FX_LPCWSTR GetCurrentString(int32_t &iLength) const = 0; }; enum FDE_CSSLENGTHUNIT { FDE_CSSLENGTHUNIT_Auto, @@ -526,7 +526,7 @@ struct FDE_CSSLENGTH { } FDE_CSSLENGTH& Set(FDE_CSSLENGTHUNIT eUnit, FX_FLOAT fValue) { - m_iData = ((FX_INTPTR)(fValue * 1024.0f) << FDE_CSSUNITBITS) | eUnit; + m_iData = ((intptr_t)(fValue * 1024.0f) << FDE_CSSUNITBITS) | eUnit; return *this; } FDE_CSSLENGTHUNIT GetUnit() const @@ -542,7 +542,7 @@ struct FDE_CSSLENGTH { return (m_iData >> FDE_CSSUNITBITS) != 0; } private: - FX_INTPTR m_iData; + intptr_t m_iData; }; struct FDE_CSSPOINT { FDE_CSSPOINT& Set(FDE_CSSLENGTHUNIT eUnit) @@ -867,19 +867,19 @@ public: class IFDE_CSSGeneratedContentStyle { public: - virtual FX_INT32 CountCounters() = 0; - virtual FX_LPCWSTR GetCounterIdentifier(FX_INT32 index) = 0; - virtual FX_BOOL GetCounterReset(FX_INT32 index, FX_INT32 &iValue) = 0; - virtual FX_BOOL GetCounterIncrement(FX_INT32 index, FX_INT32 &iValue) = 0; + virtual int32_t CountCounters() = 0; + virtual FX_LPCWSTR GetCounterIdentifier(int32_t index) = 0; + virtual FX_BOOL GetCounterReset(int32_t index, int32_t &iValue) = 0; + virtual FX_BOOL GetCounterIncrement(int32_t index, int32_t &iValue) = 0; virtual IFDE_CSSValueList* GetContent() const = 0; - virtual FX_INT32 CountQuotes() const = 0; - virtual FX_LPCWSTR GetQuotes(FX_INT32 index) const = 0; + virtual int32_t CountQuotes() const = 0; + virtual FX_LPCWSTR GetQuotes(int32_t index) const = 0; }; class IFDE_CSSFontStyle { public: - virtual FX_INT32 CountFontFamilies() const = 0; - virtual FX_LPCWSTR GetFontFamily(FX_INT32 index) const = 0; + virtual int32_t CountFontFamilies() const = 0; + virtual FX_LPCWSTR GetFontFamily(int32_t index) const = 0; virtual FX_WORD GetFontWeight() const = 0; virtual FDE_CSSFONTVARIANT GetFontVariant() const = 0; virtual FDE_CSSFONTSTYLE GetFontStyle() const = 0; @@ -955,12 +955,12 @@ public: virtual const FDE_CSSLENGTH& GetWordSpacing() const = 0; virtual FDE_CSSWRITINGMODE GetWritingMode() const = 0; virtual FDE_CSSWORDBREAK GetWordBreak() const = 0; - virtual FX_INT32 GetWidows() const = 0; + virtual int32_t GetWidows() const = 0; virtual FX_ARGB GetTextEmphasisColor() const = 0; virtual FDE_CSSPAGEBREAK GetPageBreakBefore() const = 0; virtual FDE_CSSPAGEBREAK GetPageBreakAfter() const = 0; virtual FDE_CSSPAGEBREAK GetPageBreakInside() const = 0; - virtual FX_INT32 GetOrphans() const = 0; + virtual int32_t GetOrphans() const = 0; virtual FDE_CSSLINEBREAK GetLineBreak() const = 0; virtual FDE_CSSTEXTEMPHASISMARK GetTextEmphasisMark() const = 0; virtual FDE_CSSTEXTEMPHASISFILL GetTextEmphasisFill() const = 0; @@ -980,12 +980,12 @@ public: virtual void SetWordSpacing(const FDE_CSSLENGTH &wordSpacing) = 0; virtual void SetWritingMode(FDE_CSSWRITINGMODE eWritingMode) = 0; virtual void SetWordBreak(FDE_CSSWORDBREAK eWordBreak) = 0; - virtual void SetWidows(FX_INT32 iWidows) = 0; + virtual void SetWidows(int32_t iWidows) = 0; virtual void SetTextEmphasisColor(FX_ARGB dwTextEmphasisColor) = 0; virtual void SetPageBreakBefore(FDE_CSSPAGEBREAK ePageBreakBefore) = 0; virtual void SetPageBreakAfter(FDE_CSSPAGEBREAK ePageBreakAfter) = 0; virtual void SetPageBreakInside(FDE_CSSPAGEBREAK ePageBreakInside) = 0; - virtual void SetOrphans(FX_INT32 iOrphans) = 0; + virtual void SetOrphans(int32_t iOrphans) = 0; virtual void SetLineBreak(FDE_CSSLINEBREAK eLineBreak) = 0; }; class IFDE_CSSBackgroundStyle @@ -1076,7 +1076,7 @@ public: virtual void UpdateStyleIndex(FX_DWORD dwMediaList) = 0; virtual IFDE_CSSAccelerator* InitAccelerator() = 0; virtual IFDE_CSSComputedStyle* CreateComputedStyle(IFDE_CSSComputedStyle *pParentStyle) = 0; - virtual FX_INT32 MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE) = 0; - virtual void ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle) = 0; + virtual int32_t MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE) = 0; + virtual void ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle *pDestStyle) = 0; }; #endif diff --git a/xfa/src/fdp/include/fde_img.h b/xfa/src/fdp/include/fde_img.h index 808bc4c304..92ed9daac6 100644 --- a/xfa/src/fdp/include/fde_img.h +++ b/xfa/src/fdp/include/fde_img.h @@ -18,21 +18,21 @@ class IFDE_Image; class IFDE_Image { public: - static IFDE_Image* Create(IFX_Stream *pStream, FX_INT32 iFormat = FDE_IMAGEFORMAT_Unknown); + static IFDE_Image* Create(IFX_Stream *pStream, int32_t iFormat = FDE_IMAGEFORMAT_Unknown); virtual void Release() = 0; virtual FX_BOOL LoadImage() = 0; virtual void FreeImage() = 0; - virtual FX_INT32 CountFrames() const = 0; - virtual FX_BOOL LoadFrame(FX_INT32 index) = 0; + virtual int32_t CountFrames() const = 0; + virtual FX_BOOL LoadFrame(int32_t index) = 0; virtual CFX_DIBitmap* GetFrameImage() = 0; - virtual FX_INT32 GetImageFormat() const = 0; - virtual FX_INT32 GetImageWidth() const = 0; - virtual FX_INT32 GetImageHeight() const = 0; - virtual FX_INT32 GetDelayTime(FX_INT32 iFrameIndex) const = 0; - virtual FX_INT32 GetLoopCount() const = 0; - virtual FX_BOOL StartLoadImage(CFX_DIBitmap *pDIBitmap, FX_INT32 dibX, FX_INT32 dibY, FX_INT32 dibCX, FX_INT32 dibCY, - FX_INT32 imgX, FX_INT32 imgY, FX_INT32 imgCX, FX_INT32 imgCY, FX_INT32 iFrameIndex = 0) = 0; - virtual FX_INT32 DoLoadImage(IFX_Pause *pPause = NULL) = 0; + virtual int32_t GetImageFormat() const = 0; + virtual int32_t GetImageWidth() const = 0; + virtual int32_t GetImageHeight() const = 0; + virtual int32_t GetDelayTime(int32_t iFrameIndex) const = 0; + virtual int32_t GetLoopCount() const = 0; + virtual FX_BOOL StartLoadImage(CFX_DIBitmap *pDIBitmap, int32_t dibX, int32_t dibY, int32_t dibCX, int32_t dibCY, + int32_t imgX, int32_t imgY, int32_t imgCX, int32_t imgCY, int32_t iFrameIndex = 0) = 0; + virtual int32_t DoLoadImage(IFX_Pause *pPause = NULL) = 0; virtual void StopLoadImage() = 0; }; #define FDE_IMAGEFILTER_Unknown -1 @@ -45,11 +45,11 @@ public: #define FDE_IMAGEFILTER_Brightness 6 #define FDE_IMAGEFILTER_Contrast 7 typedef struct _FDE_IMAGEFILTERPARAMS : public CFX_Target { - FX_INT32 iFilterType; + int32_t iFilterType; } FDE_IMAGEFILTERPARAMS, * FDE_LPIMAGEFILTERPARAMS; typedef FDE_IMAGEFILTERPARAMS const * FDE_LPCIMAGEFILTERPARAMS; typedef struct _FDE_OPACITYPARAMS : public FDE_IMAGEFILTERPARAMS { - FX_INT32 iOpacity; + int32_t iOpacity; } FDE_OPACITYPARAMS, * FDE_LPOPACITYPARAMS; typedef FDE_OPACITYPARAMS const * FDE_LPCOPACITYPARAMS; typedef struct _FDE_BLACKWHITEPARAMS : public FDE_IMAGEFILTERPARAMS { @@ -66,11 +66,11 @@ typedef struct _FDE_MASKCOLORPARAMS : public FDE_IMAGEFILTERPARAMS { } FDE_MASKCOLORPARAMS, * FDE_LPMASKCOLORPARAMS; typedef FDE_MASKCOLORPARAMS const * FDE_LPCMASKCOLORPARAMS; typedef struct _FDE_BRIGHTNESSPARAMS : public FDE_IMAGEFILTERPARAMS { - FX_INT32 iBrightness; + int32_t iBrightness; } FDE_BRIGHTNESSPARAMS, * FDE_LPBRIGHTNESSPARAMS; typedef FDE_BRIGHTNESSPARAMS const * FDE_LPCBRIGHTNESSPARAMS; typedef struct _FDE_CONTRASTPARAMS : public FDE_IMAGEFILTERPARAMS { - FX_INT32 iContrast; + int32_t iContrast; } FDE_CONTRASTPARAMS, * FDE_LPCONTRASTPARAMS; typedef FDE_CONTRASTPARAMS const * FDE_LPCCONTRASTPARAMS; #endif diff --git a/xfa/src/fdp/include/fde_mem.h b/xfa/src/fdp/include/fde_mem.h index 516e67c945..a7eb40a9e2 100644 --- a/xfa/src/fdp/include/fde_mem.h +++ b/xfa/src/fdp/include/fde_mem.h @@ -9,8 +9,8 @@ #ifdef __cplusplus extern "C" { #endif -#define FDE_Alloc(size) FX_Alloc(FX_BYTE, size) -#define FDE_Realloc(ptr, newSize) FX_Realloc(FX_BYTE, ptr, newSize) +#define FDE_Alloc(size) FX_Alloc(uint8_t, size) +#define FDE_Realloc(ptr, newSize) FX_Realloc(uint8_t, ptr, newSize) #define FDE_Free(ptr) FX_Free(ptr) #define FDE_New FXTARGET_New #define FDE_Delete FXTARGET_Delete diff --git a/xfa/src/fdp/include/fde_pen.h b/xfa/src/fdp/include/fde_pen.h index 7730b6a964..074dc3c3e7 100644 --- a/xfa/src/fdp/include/fde_pen.h +++ b/xfa/src/fdp/include/fde_pen.h @@ -36,25 +36,25 @@ class IFDE_Pen public: static IFDE_Pen* Create(); virtual void Release() = 0; - virtual FX_INT32 GetType() const = 0; + virtual int32_t GetType() const = 0; virtual FX_ARGB GetColor() const = 0; virtual void SetColor(FX_ARGB color) = 0; virtual IFDE_Brush* GetBrush() const = 0; virtual void SetBrush(IFDE_Brush *pBrush, FX_BOOL bAutoRelease) = 0; - virtual FX_INT32 GetLineCap() const = 0; - virtual void SetLineCap(FX_INT32 iLineCap) = 0; - virtual FX_INT32 GetDashStyle() const = 0; - virtual void SetDashStyle(FX_INT32 iDashStyle) = 0; + virtual int32_t GetLineCap() const = 0; + virtual void SetLineCap(int32_t iLineCap) = 0; + virtual int32_t GetDashStyle() const = 0; + virtual void SetDashStyle(int32_t iDashStyle) = 0; virtual FX_FLOAT GetDashPhase() const = 0; virtual void SetDashPhase(FX_FLOAT fPhase) = 0; - virtual FX_INT32 CountDashArray() const = 0; - virtual FX_INT32 GetDashArray(CFX_FloatArray &dashArray) const = 0; + virtual int32_t CountDashArray() const = 0; + virtual int32_t GetDashArray(CFX_FloatArray &dashArray) const = 0; virtual void SetDashArray(const CFX_FloatArray &dashArray) = 0; - virtual FX_INT32 GetLineJoin() const = 0; - virtual void SetLineJoin(FX_INT32 iLineJoin) = 0; + virtual int32_t GetLineJoin() const = 0; + virtual void SetLineJoin(int32_t iLineJoin) = 0; virtual FX_FLOAT GetMiterLimit() const = 0; virtual void SetMiterLimit(FX_FLOAT fMiterLimit) = 0; - virtual FX_INT32 CountCompoundPatterns() const = 0; + virtual int32_t CountCompoundPatterns() const = 0; virtual FX_BOOL GetCompoundPatterns(CFDE_CompoundPatterns &compoundPatterns) const = 0; virtual FX_BOOL SetCompoundPatterns(const CFDE_CompoundPatterns &compoundPatterns) = 0; }; diff --git a/xfa/src/fdp/include/fde_psr.h b/xfa/src/fdp/include/fde_psr.h index 64070e6648..974f4cc879 100644 --- a/xfa/src/fdp/include/fde_psr.h +++ b/xfa/src/fdp/include/fde_psr.h @@ -35,12 +35,12 @@ public: class IFDE_TextSet : public IFDE_VisualSet { public: - virtual FX_INT32 GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText) = 0; + virtual int32_t GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText) = 0; virtual IFX_Font* GetFont(FDE_HVISUALOBJ hText) = 0; virtual FX_FLOAT GetFontSize(FDE_HVISUALOBJ hText) = 0; virtual FX_ARGB GetFontColor(FDE_HVISUALOBJ hText) = 0; - virtual FX_INT32 GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL) = 0; - virtual FX_INT32 GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray) = 0; + virtual int32_t GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL) = 0; + virtual int32_t GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray) = 0; }; class IFDE_ImageSet : public IFDE_VisualSet { @@ -58,8 +58,8 @@ class IFDE_PathSet : public IFDE_VisualSet { public: virtual IFDE_Path* GetPath(FDE_HVISUALOBJ hPath) = 0; - virtual FX_INT32 GetFillMode(FDE_HVISUALOBJ hPath) = 0; - virtual FX_INT32 GetRenderMode(FDE_HVISUALOBJ hPath) = 0; + virtual int32_t GetFillMode(FDE_HVISUALOBJ hPath) = 0; + virtual int32_t GetRenderMode(FDE_HVISUALOBJ hPath) = 0; virtual IFDE_Pen* GetPen(FDE_HVISUALOBJ hPath) = 0; virtual FX_FLOAT GetPenWidth(FDE_HVISUALOBJ hPath) = 0; virtual IFDE_Brush* GetBrush(FDE_HVISUALOBJ hPath) = 0; @@ -76,10 +76,10 @@ class IFDE_WidgetSet : public IFDE_VisualSet { public: virtual FDE_WIDGETOBJ GetWidgetType(FDE_HVISUALOBJ hWidget) = 0; - virtual FX_FLOAT GetFloat(FDE_HVISUALOBJ hWidget, FX_INT32 iParameter, FX_FLOAT fDefVal = 0.0f) = 0; - virtual FX_INT32 GetInteger(FDE_HVISUALOBJ hWidget, FX_INT32 iParameter, FX_INT32 iDefVal = 0) = 0; - virtual FX_BOOL GetString(FDE_HVISUALOBJ hWidget, FX_INT32 iParameter, CFX_WideString &wsValue) = 0; - virtual FX_BOOL GetRects(FDE_HVISUALOBJ hWidget, FX_INT32 iParameter, CFX_RectFArray &rects) = 0; + virtual FX_FLOAT GetFloat(FDE_HVISUALOBJ hWidget, int32_t iParameter, FX_FLOAT fDefVal = 0.0f) = 0; + virtual int32_t GetInteger(FDE_HVISUALOBJ hWidget, int32_t iParameter, int32_t iDefVal = 0) = 0; + virtual FX_BOOL GetString(FDE_HVISUALOBJ hWidget, int32_t iParameter, CFX_WideString &wsValue) = 0; + virtual FX_BOOL GetRects(FDE_HVISUALOBJ hWidget, int32_t iParameter, CFX_RectFArray &rects) = 0; }; class IFDE_VisualSetIterator { diff --git a/xfa/src/fdp/include/fde_rdr.h b/xfa/src/fdp/include/fde_rdr.h index 74c5d24516..cbae1c26fa 100644 --- a/xfa/src/fdp/include/fde_rdr.h +++ b/xfa/src/fdp/include/fde_rdr.h @@ -9,7 +9,7 @@ class IFDE_Page; class IFDE_RenderDevice; class IFDE_RenderContext; -void FDE_GetPageMatrix(CFX_Matrix &pageMatrix, const CFX_RectF &docPageRect, const CFX_Rect &devicePageRect, FX_INT32 iRotate, FX_DWORD dwCoordinatesType = 0); +void FDE_GetPageMatrix(CFX_Matrix &pageMatrix, const CFX_RectF &docPageRect, const CFX_Rect &devicePageRect, int32_t iRotate, FX_DWORD dwCoordinatesType = 0); enum FDE_RENDERSTATUS { FDE_RENDERSTATUS_Reset = 0, FDE_RENDERSTATUS_Paused , diff --git a/xfa/src/fdp/include/fde_rdv.h b/xfa/src/fdp/include/fde_rdv.h index ee1e922c48..eb79a81c9b 100644 --- a/xfa/src/fdp/include/fde_rdv.h +++ b/xfa/src/fdp/include/fde_rdv.h @@ -22,8 +22,8 @@ public: static IFDE_RenderDevice* Create(CFX_RenderDevice *pDevice); virtual void Release() = 0; - virtual FX_INT32 GetWidth() const = 0; - virtual FX_INT32 GetHeight() const = 0; + virtual int32_t GetWidth() const = 0; + virtual int32_t GetHeight() const = 0; virtual FDE_HDEVICESTATE SaveState() = 0; virtual void RestoreState(FDE_HDEVICESTATE hState) = 0; virtual FX_BOOL SetClipPath(const IFDE_Path *pClip) = 0; @@ -35,7 +35,7 @@ public: virtual FX_FLOAT GetDpiY() const = 0; virtual FX_BOOL DrawImage(CFX_DIBSource *pDib, const CFX_RectF *pSrcRect, const CFX_RectF &dstRect, const CFX_Matrix *pImgMatrix = NULL, const CFX_Matrix *pDevMatrix = NULL) = 0; - virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL) = 0; + virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL) = 0; virtual FX_BOOL DrawBezier(IFDE_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 = NULL) = 0; virtual FX_BOOL DrawCurve(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fTension = 0.5f, const CFX_Matrix *pMatrix = NULL) = 0; virtual FX_BOOL DrawEllipse(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_RectF &rect, const CFX_Matrix *pMatrix = NULL) = 0; diff --git a/xfa/src/fdp/include/fde_tto.h b/xfa/src/fdp/include/fde_tto.h index 25dead13ca..8b4d1d4787 100644 --- a/xfa/src/fdp/include/fde_tto.h +++ b/xfa/src/fdp/include/fde_tto.h @@ -43,7 +43,7 @@ public: virtual void SetTabWidth(FX_FLOAT fTabWidth) = 0; virtual void SetEllipsisString(const CFX_WideString &wsEllipsis) = 0; virtual void SetParagraphBreakChar(FX_WCHAR wch) = 0; - virtual void SetAlignment(FX_INT32 iAlignment) = 0; + virtual void SetAlignment(int32_t iAlignment) = 0; virtual void SetLineSpace(FX_FLOAT fLineSpace) = 0; virtual void SetDIBitmap(CFX_DIBitmap *pDIB) = 0; virtual void SetRenderDevice(CFX_RenderDevice *pDevice) = 0; @@ -51,19 +51,19 @@ public: virtual void SetClipRect(const CFX_RectF &rtClip) = 0; virtual void SetMatrix(const CFX_Matrix &matrix) = 0; virtual void SetLineBreakTolerance(FX_FLOAT fTolerance) = 0; - virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Size &size) = 0; - virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size) = 0; - virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Rect &rect) = 0; - virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect) = 0; - virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 x, FX_INT32 y) = 0; - virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y) = 0; - virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_Rect &rect) = 0; - virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect) = 0; + virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_Size &size) = 0; + virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_SizeF &size) = 0; + virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_Rect &rect) = 0; + virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect) = 0; + virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, int32_t x, int32_t y) = 0; + virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y) = 0; + virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_Rect &rect) = 0; + virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect) = 0; virtual void SetLogicClipRect(const CFX_RectF &rtClip) = 0; - virtual void CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size) = 0; - virtual void CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect) = 0; - virtual void DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y) = 0; - virtual void DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect) = 0; - virtual FX_INT32 GetTotalLines() = 0; + virtual void CalcLogicSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_SizeF &size) = 0; + virtual void CalcLogicSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect) = 0; + virtual void DrawLogicText(FX_LPCWSTR pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y) = 0; + virtual void DrawLogicText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect) = 0; + virtual int32_t GetTotalLines() = 0; }; #endif diff --git a/xfa/src/fdp/include/fde_xml.h b/xfa/src/fdp/include/fde_xml.h index b8b136b5aa..eddb9a1835 100644 --- a/xfa/src/fdp/include/fde_xml.h +++ b/xfa/src/fdp/include/fde_xml.h @@ -32,7 +32,7 @@ enum FDE_XMLNODETYPE { FDE_XMLNODE_CharData , }; typedef struct _FDE_XMLNODE { - FX_INT32 iNodeNum; + int32_t iNodeNum; FDE_XMLNODETYPE eNodeType; } FDE_XMLNODE, * FDE_LPXMLNODE; typedef FDE_XMLNODE const * FDE_LPCXMLNODE; @@ -48,16 +48,16 @@ class IFDE_XMLNode public: virtual void Release() = 0; virtual FDE_XMLNODETYPE GetType() const = 0; - virtual FX_INT32 CountChildNodes() const = 0; - virtual IFDE_XMLNode* GetChildNode(FX_INT32 index) const = 0; - virtual FX_INT32 GetChildNodeIndex(IFDE_XMLNode *pNode) const = 0; - virtual IFDE_XMLNode* GetPath(FX_LPCWSTR pPath, FX_INT32 iLength = -1, FX_BOOL bQualifiedName = TRUE) const = 0; - virtual FX_INT32 InsertChildNode(IFDE_XMLNode *pNode, FX_INT32 index = -1) = 0; + virtual int32_t CountChildNodes() const = 0; + virtual IFDE_XMLNode* GetChildNode(int32_t index) const = 0; + virtual int32_t GetChildNodeIndex(IFDE_XMLNode *pNode) const = 0; + virtual IFDE_XMLNode* GetPath(FX_LPCWSTR pPath, int32_t iLength = -1, FX_BOOL bQualifiedName = TRUE) const = 0; + virtual int32_t InsertChildNode(IFDE_XMLNode *pNode, int32_t index = -1) = 0; virtual void RemoveChildNode(IFDE_XMLNode *pNode) = 0; virtual void DeleteChildren() = 0; enum NodeItem {Root = 0, Parent, FirstSibling, PriorSibling, NextSibling, LastSibling, FirstNeighbor, PriorNeighbor, NextNeighbor, LastNeighbor, FirstChild, LastChild}; virtual IFDE_XMLNode* GetNodeItem(NodeItem eItem) const = 0; - virtual FX_INT32 GetNodeLevel() const = 0; + virtual int32_t GetNodeLevel() const = 0; virtual FX_BOOL InsertNodeItem(IFDE_XMLNode::NodeItem eItem, IFDE_XMLNode *pNode) = 0; virtual IFDE_XMLNode* RemoveNodeItem(IFDE_XMLNode::NodeItem eItem) = 0; virtual IFDE_XMLNode* Clone(FX_BOOL bRecursive) = 0; @@ -68,20 +68,20 @@ class IFDE_XMLInstruction : public IFDE_XMLNode public: static IFDE_XMLInstruction* Create(const CFX_WideString &wsTarget); virtual void GetTargetName(CFX_WideString &wsTarget) const = 0; - virtual FX_INT32 CountAttributes() const = 0; - virtual FX_BOOL GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const = 0; + virtual int32_t CountAttributes() const = 0; + virtual FX_BOOL GetAttribute(int32_t index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const = 0; virtual FX_BOOL HasAttribute(FX_LPCWSTR pwsAttriName) const = 0; virtual void GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue = NULL) const = 0; virtual void SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue) = 0; - virtual FX_INT32 GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue = 0) const = 0; - virtual void SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue) = 0; + virtual int32_t GetInteger(FX_LPCWSTR pwsAttriName, int32_t iDefValue = 0) const = 0; + virtual void SetInteger(FX_LPCWSTR pwsAttriName, int32_t iAttriValue) = 0; virtual FX_FLOAT GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue = 0) const = 0; virtual void SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue) = 0; virtual void RemoveAttribute(FX_LPCWSTR pwsAttriName) = 0; - virtual FX_INT32 CountData() const = 0; - virtual FX_BOOL GetData(FX_INT32 index, CFX_WideString &wsData) const = 0; + virtual int32_t CountData() const = 0; + virtual FX_BOOL GetData(int32_t index, CFX_WideString &wsData) const = 0; virtual void AppendData(const CFX_WideString &wsData) = 0; - virtual void RemoveData(FX_INT32 index) = 0; + virtual void RemoveData(int32_t index) = 0; }; class IFDE_XMLElement : public IFDE_XMLNode { @@ -91,13 +91,13 @@ public: virtual void GetLocalTagName(CFX_WideString &wsTag) const = 0; virtual void GetNamespacePrefix(CFX_WideString &wsPrefix) const = 0; virtual void GetNamespaceURI(CFX_WideString &wsNamespace) const = 0; - virtual FX_INT32 CountAttributes() const = 0; - virtual FX_BOOL GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const = 0; + virtual int32_t CountAttributes() const = 0; + virtual FX_BOOL GetAttribute(int32_t index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const = 0; virtual FX_BOOL HasAttribute(FX_LPCWSTR pwsAttriName) const = 0; virtual void GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue = NULL) const = 0; virtual void SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue) = 0; - virtual FX_INT32 GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue = 0) const = 0; - virtual void SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue) = 0; + virtual int32_t GetInteger(FX_LPCWSTR pwsAttriName, int32_t iDefValue = 0) const = 0; + virtual void SetInteger(FX_LPCWSTR pwsAttriName, int32_t iAttriValue) = 0; virtual FX_FLOAT GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue = 0) const = 0; virtual void SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue) = 0; virtual void RemoveAttribute(FX_LPCWSTR pwsAttriName) = 0; @@ -137,9 +137,9 @@ class IFDE_XMLDoc public: static IFDE_XMLDoc* Create(); virtual void Release() = 0; - virtual FX_BOOL LoadXML(IFX_Stream *pXMLStream, FX_INT32 iXMLPlaneSize = 8192, FX_INT32 iTextDataSize = 256, FDE_LPXMLREADERHANDLER pHandler = NULL) = 0; + virtual FX_BOOL LoadXML(IFX_Stream *pXMLStream, int32_t iXMLPlaneSize = 8192, int32_t iTextDataSize = 256, FDE_LPXMLREADERHANDLER pHandler = NULL) = 0; virtual FX_BOOL LoadXML(IFDE_XMLParser *pXMLParser) = 0; - virtual FX_INT32 DoLoad(IFX_Pause *pPause = NULL) = 0; + virtual int32_t DoLoad(IFX_Pause *pPause = NULL) = 0; virtual void CloseXML() = 0; virtual IFDE_XMLNode* GetRoot() const = 0; virtual void SaveXML(IFX_Stream *pXMLStream = NULL, FX_BOOL bSaveBOM = TRUE) = 0; @@ -149,7 +149,7 @@ class IFDE_XMLParser { public: virtual void Release() = 0; - virtual FX_INT32 DoParser(IFX_Pause *pPause) = 0; + virtual int32_t DoParser(IFX_Pause *pPause) = 0; }; #define FDE_XMLSYNTAXSTATUS_None 0x00 #define FDE_XMLSYNTAXSTATUS_InstructionOpen 0x01 @@ -171,13 +171,13 @@ class IFDE_XMLSyntaxParser public: static IFDE_XMLSyntaxParser* Create(); virtual void Release() = 0; - virtual void Init(IFX_Stream *pStream, FX_INT32 iXMLPlaneSize, FX_INT32 iTextDataSize = 256) = 0; + virtual void Init(IFX_Stream *pStream, int32_t iXMLPlaneSize, int32_t iTextDataSize = 256) = 0; virtual FX_DWORD DoSyntaxParse() = 0; - virtual FX_INT32 GetStatus() const = 0; - virtual FX_INT32 GetCurrentPos() const = 0; + virtual int32_t GetStatus() const = 0; + virtual int32_t GetCurrentPos() const = 0; virtual FX_FILESIZE GetCurrentBinaryPos() const = 0; - virtual FX_INT32 GetCurrentNodeNumber() const = 0; - virtual FX_INT32 GetLastNodeNumber() const = 0; + virtual int32_t GetCurrentNodeNumber() const = 0; + virtual int32_t GetLastNodeNumber() const = 0; virtual void GetTargetName(CFX_WideString &wsTarget) const = 0; virtual void GetTagName(CFX_WideString &wsTag) const = 0; virtual void GetAttributeName(CFX_WideString &wsAttriName) const = 0; diff --git a/xfa/src/fdp/src/css/fde_csscache.h b/xfa/src/fdp/src/css/fde_csscache.h index f4b8cffd57..82c0e4f7e0 100644 --- a/xfa/src/fdp/src/css/fde_csscache.h +++ b/xfa/src/fdp/src/css/fde_csscache.h @@ -22,7 +22,7 @@ public: FDE_Delete this; } - virtual void SetMaxItems(FX_INT32 iMaxCount = 5) + virtual void SetMaxItems(int32_t iMaxCount = 5) { FXSYS_assert(iMaxCount >= 3); m_iMaxItems = iMaxCount; @@ -35,7 +35,7 @@ protected: void RemoveLowestActivityItem(); CFX_MapByteStringToPtr m_Stylesheets; IFX_MEMAllocator *m_pFixedStore; - FX_INT32 m_iMaxItems; + int32_t m_iMaxItems; }; typedef struct _FDE_CSSTAGCACHE : public CFX_Target { public: @@ -57,11 +57,11 @@ public: { return dwTagHash; } - FX_INT32 CountHashClass() const + int32_t CountHashClass() const { return dwClassHashs.GetSize(); } - void SetClassIndex(FX_INT32 index) + void SetClassIndex(int32_t index) { iClassIndex = index; } @@ -74,7 +74,7 @@ protected: _FDE_CSSTAGCACHE *pParent; FX_DWORD dwIDHash; FX_DWORD dwTagHash; - FX_INT32 iClassIndex; + int32_t iClassIndex; CFDE_DWordArray dwClassHashs; } FDE_CSSTAGCACHE, * FDE_LPCSSTAGCACHE; typedef CFX_ObjectStackTemplate CFDE_CSSTagStack; diff --git a/xfa/src/fdp/src/css/fde_cssdatatable.cpp b/xfa/src/fdp/src/css/fde_cssdatatable.cpp index ad9f0772f9..7f42d10ad0 100644 --- a/xfa/src/fdp/src/css/fde_cssdatatable.cpp +++ b/xfa/src/fdp/src/css/fde_cssdatatable.cpp @@ -417,12 +417,12 @@ extern "C" { { return (ePersudo < FDE_CSSPERSUDO_NONE) ? (g_FDE_CSSPersudoType + ePersudo) : NULL; } - FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName(FX_LPCWSTR pszName, FX_INT32 iLength) + FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName(FX_LPCWSTR pszName, int32_t iLength) { FXSYS_assert(pszName != NULL && iLength > 0); FX_DWORD dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE); - FX_INT32 iEnd = FDE_CSSPROPERTY_MAX - 1; - FX_INT32 iMid, iStart = 0; + int32_t iEnd = FDE_CSSPROPERTY_MAX - 1; + int32_t iMid, iStart = 0; FX_DWORD dwMid; do { iMid = (iStart + iEnd) / 2; @@ -441,12 +441,12 @@ extern "C" { { return (eName < FDE_CSSPROPERTY_MAX) ? (g_FDE_CSSProperties + eName) : NULL; } - FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName(FX_LPCWSTR pszName, FX_INT32 iLength) + FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName(FX_LPCWSTR pszName, int32_t iLength) { FXSYS_assert(pszName != NULL && iLength > 0); FX_DWORD dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE); - FX_INT32 iEnd = FDE_CSSPROPERTYVALUE_MAX - 1; - FX_INT32 iMid, iStart = 0; + int32_t iEnd = FDE_CSSPROPERTYVALUE_MAX - 1; + int32_t iMid, iStart = 0; FX_DWORD dwMid; do { iMid = (iStart + iEnd) / 2; @@ -465,12 +465,12 @@ extern "C" { { return (eName < FDE_CSSPROPERTYVALUE_MAX) ? (g_FDE_CSSPropertyValues + eName) : NULL; } - FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(FX_LPCWSTR pszName, FX_INT32 iLength) + FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(FX_LPCWSTR pszName, int32_t iLength) { FXSYS_assert(pszName != NULL && iLength > 0); FX_WORD wHash = (FX_WORD)FX_HashCode_String_GetW(pszName, iLength, TRUE); - FX_INT32 iEnd = sizeof(g_FDE_CSSMediaTypes) / sizeof(FDE_CSSMEDIATYPETABLE) - 1; - FX_INT32 iMid, iStart = 0; + int32_t iEnd = sizeof(g_FDE_CSSMediaTypes) / sizeof(FDE_CSSMEDIATYPETABLE) - 1; + int32_t iMid, iStart = 0; FX_WORD uMid; do { iMid = (iStart + iEnd) / 2; @@ -485,12 +485,12 @@ extern "C" { } while (iStart <= iEnd); return NULL; } - FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(FX_LPCWSTR pszName, FX_INT32 iLength) + FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(FX_LPCWSTR pszName, int32_t iLength) { FXSYS_assert(pszName != NULL && iLength > 0); FX_WORD wHash = (FX_WORD)FX_HashCode_String_GetW(pszName, iLength, TRUE); - FX_INT32 iEnd = sizeof(g_FDE_CSSLengthUnits) / sizeof(FDE_CSSLENGTHUNITTABLE) - 1; - FX_INT32 iMid, iStart = 0; + int32_t iEnd = sizeof(g_FDE_CSSLengthUnits) / sizeof(FDE_CSSLENGTHUNITTABLE) - 1; + int32_t iMid, iStart = 0; FX_WORD wMid; do { iMid = (iStart + iEnd) / 2; @@ -505,12 +505,12 @@ extern "C" { } while (iStart <= iEnd); return NULL; } - FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(FX_LPCWSTR pszName, FX_INT32 iLength) + FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(FX_LPCWSTR pszName, int32_t iLength) { FXSYS_assert(pszName != NULL && iLength > 0); FX_DWORD dwHash = FX_HashCode_String_GetW(pszName, iLength, TRUE); - FX_INT32 iEnd = sizeof(g_FDE_CSSColors) / sizeof(FDE_CSSCOLORTABLE) - 1; - FX_INT32 iMid, iStart = 0; + int32_t iEnd = sizeof(g_FDE_CSSColors) / sizeof(FDE_CSSCOLORTABLE) - 1; + int32_t iMid, iStart = 0; FX_DWORD dwMid; do { iMid = (iStart + iEnd) / 2; @@ -525,10 +525,10 @@ extern "C" { } while (iStart <= iEnd); return NULL; } - FX_BOOL FDE_ParseCSSNumber(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_FLOAT &fValue, FDE_CSSPRIMITIVETYPE &eUnit) + FX_BOOL FDE_ParseCSSNumber(FX_LPCWSTR pszValue, int32_t iValueLen, FX_FLOAT &fValue, FDE_CSSPRIMITIVETYPE &eUnit) { FXSYS_assert(pszValue != NULL && iValueLen > 0); - FX_INT32 iUsedLen = 0; + int32_t iUsedLen = 0; fValue = FX_wcstof(pszValue, iValueLen, &iUsedLen); if (iUsedLen <= 0) { return FALSE; @@ -547,7 +547,7 @@ extern "C" { return TRUE; } - FX_BOOL FDE_ParseCSSString(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_INT32 &iOffset, FX_INT32 &iLength) + FX_BOOL FDE_ParseCSSString(FX_LPCWSTR pszValue, int32_t iValueLen, int32_t &iOffset, int32_t &iLength) { FXSYS_assert(pszValue != NULL && iValueLen > 0); iOffset = 0; @@ -561,7 +561,7 @@ extern "C" { return iValueLen > 0; } - FX_BOOL FDE_ParseCSSURI(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_INT32 &iOffset, FX_INT32 &iLength) + FX_BOOL FDE_ParseCSSURI(FX_LPCWSTR pszValue, int32_t iValueLen, int32_t &iOffset, int32_t &iLength) { FXSYS_assert(pszValue != NULL && iValueLen > 0); if (iValueLen < 6 || pszValue[iValueLen - 1] != ')' || FX_wcsnicmp(L"url(", pszValue, 4)) { @@ -574,22 +574,22 @@ extern "C" { return FALSE; } - FX_BOOL FDE_ParseCSSColor(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_ARGB &dwColor) + FX_BOOL FDE_ParseCSSColor(FX_LPCWSTR pszValue, int32_t iValueLen, FX_ARGB &dwColor) { FXSYS_assert(pszValue != NULL && iValueLen > 0); if (*pszValue == '#') { switch (iValueLen) { case 4: { - FX_BYTE red = FX_Hex2Dec((FX_BYTE)pszValue[1], (FX_BYTE)pszValue[1]); - FX_BYTE green = FX_Hex2Dec((FX_BYTE)pszValue[2], (FX_BYTE)pszValue[2]); - FX_BYTE blue = FX_Hex2Dec((FX_BYTE)pszValue[3], (FX_BYTE)pszValue[3]); + uint8_t red = FX_Hex2Dec((uint8_t)pszValue[1], (uint8_t)pszValue[1]); + uint8_t green = FX_Hex2Dec((uint8_t)pszValue[2], (uint8_t)pszValue[2]); + uint8_t blue = FX_Hex2Dec((uint8_t)pszValue[3], (uint8_t)pszValue[3]); dwColor = ArgbEncode(255, red, green, blue); } return TRUE; case 7: { - FX_BYTE red = FX_Hex2Dec((FX_BYTE)pszValue[1], (FX_BYTE)pszValue[2]); - FX_BYTE green = FX_Hex2Dec((FX_BYTE)pszValue[3], (FX_BYTE)pszValue[4]); - FX_BYTE blue = FX_Hex2Dec((FX_BYTE)pszValue[5], (FX_BYTE)pszValue[6]); + uint8_t red = FX_Hex2Dec((uint8_t)pszValue[1], (uint8_t)pszValue[2]); + uint8_t green = FX_Hex2Dec((uint8_t)pszValue[3], (uint8_t)pszValue[4]); + uint8_t blue = FX_Hex2Dec((uint8_t)pszValue[5], (uint8_t)pszValue[6]); dwColor = ArgbEncode(255, red, green, blue); } return TRUE; @@ -598,11 +598,11 @@ extern "C" { if (pszValue[iValueLen - 1] != ')' || FX_wcsnicmp(L"rgb(", pszValue, 4)) { return FALSE; } - FX_BYTE rgb[3] = {0}; + uint8_t rgb[3] = {0}; FX_FLOAT fValue; FDE_CSSPRIMITIVETYPE eType; CFDE_CSSValueListParser list(pszValue + 4, iValueLen - 5, ','); - for (FX_INT32 i = 0; i < 3; ++i) { + for (int32_t i = 0; i < 3; ++i) { if (!list.NextValue(eType, pszValue, iValueLen)) { return FALSE; } @@ -631,11 +631,11 @@ extern "C" { CFDE_CSSValueList::CFDE_CSSValueList(IFX_MEMAllocator *pStaticStore, const CFDE_CSSValueArray &list) { m_iCount = list.GetSize(); - FX_INT32 iByteCount = m_iCount * sizeof(IFDE_CSSValue*); + int32_t iByteCount = m_iCount * sizeof(IFDE_CSSValue*); m_ppList = (IFDE_CSSValue**)pStaticStore->Alloc(iByteCount); FXSYS_memcpy(m_ppList, list.GetData(), iByteCount); } -FX_BOOL CFDE_CSSValueListParser::NextValue(FDE_CSSPRIMITIVETYPE &eType, FX_LPCWSTR &pStart, FX_INT32 &iLength) +FX_BOOL CFDE_CSSValueListParser::NextValue(FDE_CSSPRIMITIVETYPE &eType, FX_LPCWSTR &pStart, int32_t &iLength) { while (m_pCur < m_pEnd && (*m_pCur <= ' ' || *m_pCur == m_Separator)) { ++m_pCur; @@ -689,7 +689,7 @@ FX_BOOL CFDE_CSSValueListParser::NextValue(FDE_CSSPRIMITIVETYPE &eType, FX_LPCWS } return m_pCur <= m_pEnd && iLength > 0; } -FX_INT32 CFDE_CSSValueListParser::SkipTo(FX_WCHAR wch, FX_BOOL bWSSeparator , FX_BOOL bBrContinue ) +int32_t CFDE_CSSValueListParser::SkipTo(FX_WCHAR wch, FX_BOOL bWSSeparator , FX_BOOL bBrContinue ) { FX_LPCWSTR pStart = m_pCur; if (!bBrContinue) { @@ -698,7 +698,7 @@ FX_INT32 CFDE_CSSValueListParser::SkipTo(FX_WCHAR wch, FX_BOOL bWSSeparator , FX else while (++m_pCur < m_pEnd && *m_pCur != wch) ; } else { - FX_INT32 iBracketCount = 0; + int32_t iBracketCount = 0; if (bWSSeparator) { while (m_pCur < m_pEnd && *m_pCur != wch && *m_pCur > ' ') { if (*m_pCur == '(') { diff --git a/xfa/src/fdp/src/css/fde_cssdatatable.h b/xfa/src/fdp/src/css/fde_cssdatatable.h index 0ebcccfab7..ef8e0fb04e 100644 --- a/xfa/src/fdp/src/css/fde_cssdatatable.h +++ b/xfa/src/fdp/src/css/fde_cssdatatable.h @@ -13,11 +13,11 @@ public: { FXSYS_assert(pArgList != NULL); } - FX_INT32 CountArgs() const + int32_t CountArgs() const { return m_pArgList->CountValues(); } - IFDE_CSSValue* GetArgs(FX_INT32 index) const + IFDE_CSSValue* GetArgs(int32_t index) const { return m_pArgList->GetValue(index); } @@ -61,7 +61,7 @@ public: FXSYS_assert(m_eType >= FDE_CSSPRIMITIVETYPE_Number && m_eType <= FDE_CSSPRIMITIVETYPE_PC); return m_fNumber; } - virtual FX_LPCWSTR GetString(FX_INT32 &iLength) const + virtual FX_LPCWSTR GetString(int32_t &iLength) const { FXSYS_assert(m_eType >= FDE_CSSPRIMITIVETYPE_String && m_eType <= FDE_CSSPRIMITIVETYPE_URI); iLength = FXSYS_wcslen(m_pString); @@ -77,12 +77,12 @@ public: FXSYS_assert(m_eType == FDE_CSSPRIMITIVETYPE_Function); return m_pFunction->GetFuncName(); } - virtual FX_INT32 CountArgs() const + virtual int32_t CountArgs() const { FXSYS_assert(m_eType == FDE_CSSPRIMITIVETYPE_Function); return m_pFunction->CountArgs(); } - virtual IFDE_CSSValue* GetArgs(FX_INT32 index) const + virtual IFDE_CSSValue* GetArgs(int32_t index) const { FXSYS_assert(m_eType == FDE_CSSPRIMITIVETYPE_Function); return m_pFunction->GetArgs(index); @@ -103,30 +103,30 @@ class CFDE_CSSValueList : public IFDE_CSSValueList, public CFX_Target { public: CFDE_CSSValueList(IFX_MEMAllocator *pStaticStore, const CFDE_CSSValueArray &list); - virtual FX_INT32 CountValues() const + virtual int32_t CountValues() const { return m_iCount; } - virtual IFDE_CSSValue* GetValue(FX_INT32 index) const + virtual IFDE_CSSValue* GetValue(int32_t index) const { return m_ppList[index]; } protected: IFDE_CSSValue **m_ppList; - FX_INT32 m_iCount; + int32_t m_iCount; }; class CFDE_CSSValueListParser : public CFX_Target { public: - CFDE_CSSValueListParser(FX_LPCWSTR psz, FX_INT32 iLen, FX_WCHAR separator) + CFDE_CSSValueListParser(FX_LPCWSTR psz, int32_t iLen, FX_WCHAR separator) : m_Separator(separator), m_pCur(psz), m_pEnd(psz + iLen) { FXSYS_assert(psz != NULL && iLen > 0); } - FX_BOOL NextValue(FDE_CSSPRIMITIVETYPE &eType, FX_LPCWSTR &pStart, FX_INT32 &iLength); + FX_BOOL NextValue(FDE_CSSPRIMITIVETYPE &eType, FX_LPCWSTR &pStart, int32_t &iLength); FX_WCHAR m_Separator; protected: - FX_INT32 SkipTo(FX_WCHAR wch, FX_BOOL bWSSeparator = FALSE, FX_BOOL bBrContinue = FALSE); + int32_t SkipTo(FX_WCHAR wch, FX_BOOL bWSSeparator = FALSE, FX_BOOL bBrContinue = FALSE); FX_LPCWSTR m_pCur; FX_LPCWSTR m_pEnd; }; @@ -148,7 +148,7 @@ extern "C" { }; typedef FDE_CSSPROPERTYTABLE const * FDE_LPCCSSPROPERTYTABLE; - FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName(FX_LPCWSTR pszName, FX_INT32 iLength); + FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName(FX_LPCWSTR pszName, int32_t iLength); FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByEnum(FDE_CSSPROPERTY eName); struct FDE_CSSPROPERTYVALUETABLE { FDE_CSSPROPERTYVALUE eName; @@ -157,26 +157,26 @@ extern "C" { }; typedef FDE_CSSPROPERTYVALUETABLE const * FDE_LPCCSSPROPERTYVALUETABLE; - FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName(FX_LPCWSTR pszName, FX_INT32 iLength); + FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName(FX_LPCWSTR pszName, int32_t iLength); FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByEnum(FDE_CSSPROPERTYVALUE eName); struct FDE_CSSMEDIATYPETABLE { FX_WORD wHash; FX_WORD wValue; }; typedef FDE_CSSMEDIATYPETABLE const * FDE_LPCCSSMEDIATYPETABLE; - FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(FX_LPCWSTR pszName, FX_INT32 iLength); + FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(FX_LPCWSTR pszName, int32_t iLength); struct FDE_CSSLENGTHUNITTABLE { FX_WORD wHash; FX_WORD wValue; }; typedef FDE_CSSLENGTHUNITTABLE const * FDE_LPCCSSLENGTHUNITTABLE; - FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(FX_LPCWSTR pszName, FX_INT32 iLength); + FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(FX_LPCWSTR pszName, int32_t iLength); struct FDE_CSSCOLORTABLE { FX_DWORD dwHash; FX_ARGB dwValue; }; typedef FDE_CSSCOLORTABLE const * FDE_LPCCSSCOLORTABLE; - FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(FX_LPCWSTR pszName, FX_INT32 iLength); + FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(FX_LPCWSTR pszName, int32_t iLength); struct FDE_CSSPERSUDOTABLE { FDE_CSSPERSUDO eName; FX_LPCWSTR pszName; @@ -185,10 +185,10 @@ extern "C" { typedef FDE_CSSPERSUDOTABLE const * FDE_LPCCSSPERSUDOTABLE; FDE_LPCCSSPERSUDOTABLE FDE_GetCSSPersudoByEnum(FDE_CSSPERSUDO ePersudo); - FX_BOOL FDE_ParseCSSNumber(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_FLOAT &fValue, FDE_CSSPRIMITIVETYPE &eUnit); - FX_BOOL FDE_ParseCSSString(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_INT32 &iOffset, FX_INT32 &iLength); - FX_BOOL FDE_ParseCSSColor(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_ARGB &dwColor); - FX_BOOL FDE_ParseCSSURI(FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_INT32 &iOffset, FX_INT32 &iLength); + FX_BOOL FDE_ParseCSSNumber(FX_LPCWSTR pszValue, int32_t iValueLen, FX_FLOAT &fValue, FDE_CSSPRIMITIVETYPE &eUnit); + FX_BOOL FDE_ParseCSSString(FX_LPCWSTR pszValue, int32_t iValueLen, int32_t &iOffset, int32_t &iLength); + FX_BOOL FDE_ParseCSSColor(FX_LPCWSTR pszValue, int32_t iValueLen, FX_ARGB &dwColor); + FX_BOOL FDE_ParseCSSURI(FX_LPCWSTR pszValue, int32_t iValueLen, int32_t &iOffset, int32_t &iLength); #ifdef _cplusplus }; #endif diff --git a/xfa/src/fdp/src/css/fde_cssdeclaration.cpp b/xfa/src/fdp/src/css/fde_cssdeclaration.cpp index 59f4a44879..9898708539 100644 --- a/xfa/src/fdp/src/css/fde_cssdeclaration.cpp +++ b/xfa/src/fdp/src/css/fde_cssdeclaration.cpp @@ -43,14 +43,14 @@ void CFDE_CSSDeclaration::GetNextCustom(FX_POSITION &pos, CFX_WideString &wsName wsValue = pProperty->pwsValue; pos = (FX_POSITION)pProperty->pNext; } -FX_LPCWSTR CFDE_CSSDeclaration::CopyToLocal(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen) +FX_LPCWSTR CFDE_CSSDeclaration::CopyToLocal(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen) { FXSYS_assert(iValueLen > 0); CFX_MapPtrToPtr *pCache = pArgs->pStringCache; FX_LPVOID pKey = NULL; if (pCache) { FX_LPVOID pszCached = NULL; - pKey = (FX_LPVOID)(FX_UINTPTR)FX_HashCode_String_GetW(pszValue, iValueLen, FALSE); + pKey = (FX_LPVOID)(uintptr_t)FX_HashCode_String_GetW(pszValue, iValueLen, FALSE); if (pCache->Lookup(pKey, pszCached)) { return (FX_LPCWSTR)pszCached; } @@ -92,7 +92,7 @@ void CFDE_CSSDeclaration::AddPropertyHolder(IFX_MEMAllocator *pStaticStore, FDE_ m_pLastProperty = pHolder; } } -FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen) +FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen) { FXSYS_assert(iValueLen > 0); FX_BOOL bImportant = FALSE; @@ -114,8 +114,8 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWST FDE_CSSVALUETYPE_MaybeFunction, FDE_CSSVALUETYPE_MaybeString, }; - static const FX_INT32 g_ValueGuessCount = sizeof(g_ValueGuessOrder) / sizeof(FX_DWORD); - for (FX_INT32 i = 0; i < g_ValueGuessCount; ++i) { + static const int32_t g_ValueGuessCount = sizeof(g_ValueGuessOrder) / sizeof(FX_DWORD); + for (int32_t i = 0; i < g_ValueGuessCount; ++i) { const FX_DWORD dwMatch = dwType & g_ValueGuessOrder[i]; if (dwMatch == 0) { continue; @@ -229,7 +229,7 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWST } return FALSE; } -FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszName, FX_INT32 iNameLen, FX_LPCWSTR pszValue, FX_INT32 iValueLen) +FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszName, int32_t iNameLen, FX_LPCWSTR pszValue, int32_t iValueLen) { FDE_LPCSSCUSTOMPROPERTY pProperty = FDE_NewWith(pArgs->pStaticStore) FDE_CSSCUSTOMPROPERTY; pProperty->pwsName = CopyToLocal(pArgs, pszName, iNameLen); @@ -243,7 +243,7 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWST } return TRUE; } -IFDE_CSSValue* CFDE_CSSDeclaration::ParseNumber(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen) +IFDE_CSSValue* CFDE_CSSDeclaration::ParseNumber(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen) { FX_FLOAT fValue; FDE_CSSPRIMITIVETYPE eUnit; @@ -252,12 +252,12 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseNumber(FDE_LPCCSSPROPERTYARGS pArgs, FX } return NewNumberValue(pArgs->pStaticStore, eUnit, fValue); } -IFDE_CSSValue* CFDE_CSSDeclaration::ParseEnum(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen) +IFDE_CSSValue* CFDE_CSSDeclaration::ParseEnum(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen) { FDE_LPCCSSPROPERTYVALUETABLE pValue = FDE_GetCSSPropertyValueByName(pszValue, iValueLen); return pValue ? NewEnumValue(pArgs->pStaticStore, pValue->eName) : NULL; } -IFDE_CSSValue* CFDE_CSSDeclaration::ParseColor(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen) +IFDE_CSSValue* CFDE_CSSDeclaration::ParseColor(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen) { FX_ARGB dwColor; if (!FDE_ParseCSSColor(pszValue, iValueLen, dwColor)) { @@ -265,9 +265,9 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseColor(FDE_LPCCSSPROPERTYARGS pArgs, FX_ } return FDE_NewWith(pArgs->pStaticStore) CFDE_CSSPrimitiveValue(dwColor); } -IFDE_CSSValue* CFDE_CSSDeclaration::ParseURI(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen) +IFDE_CSSValue* CFDE_CSSDeclaration::ParseURI(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen) { - FX_INT32 iOffset; + int32_t iOffset; if (!FDE_ParseCSSURI(pszValue, iValueLen, iOffset, iValueLen)) { return NULL; } @@ -277,9 +277,9 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseURI(FDE_LPCCSSPROPERTYARGS pArgs, FX_LP pszValue = CopyToLocal(pArgs, pszValue + iOffset, iValueLen); return pszValue ? FDE_NewWith(pArgs->pStaticStore) CFDE_CSSPrimitiveValue(FDE_CSSPRIMITIVETYPE_URI, pszValue) : NULL; } -IFDE_CSSValue* CFDE_CSSDeclaration::ParseString(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen) +IFDE_CSSValue* CFDE_CSSDeclaration::ParseString(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen) { - FX_INT32 iOffset; + int32_t iOffset; if (!FDE_ParseCSSString(pszValue, iValueLen, iOffset, iValueLen)) { return NULL; } @@ -289,12 +289,12 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseString(FDE_LPCCSSPROPERTYARGS pArgs, FX pszValue = CopyToLocal(pArgs, pszValue + iOffset, iValueLen); return pszValue ? FDE_NewWith(pArgs->pStaticStore) CFDE_CSSPrimitiveValue(FDE_CSSPRIMITIVETYPE_String, pszValue) : NULL; } -IFDE_CSSValue* CFDE_CSSDeclaration::ParseFunction(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen) +IFDE_CSSValue* CFDE_CSSDeclaration::ParseFunction(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen) { if (pszValue[iValueLen - 1] != ')') { return NULL; } - FX_INT32 iStartBracket = 0; + int32_t iStartBracket = 0; while (pszValue[iStartBracket] != '(') { if (iStartBracket < iValueLen) { iStartBracket++; @@ -343,7 +343,7 @@ IFDE_CSSValue* CFDE_CSSDeclaration::ParseFunction(FDE_LPCCSSPROPERTYARGS pArgs, CFDE_CSSFunction *pFunction = FDE_NewWith(pArgs->pStaticStore) CFDE_CSSFunction(pszFuncName, pArgumentList); return FDE_NewWith(pArgs->pStaticStore) CFDE_CSSPrimitiveValue(pFunction); } -FX_BOOL CFDE_CSSDeclaration::ParseContentProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant) +FX_BOOL CFDE_CSSDeclaration::ParseContentProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant) { IFX_MEMAllocator* pStaticStore = (IFX_MEMAllocator*)pArgs->pStaticStore; CFDE_CSSValueListParser parser(pszValue, iValueLen, ' '); @@ -400,7 +400,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseContentProperty(FDE_LPCCSSPROPERTYARGS pArgs, AddPropertyHolder(pStaticStore, pArgs->pProperty->eName, FDE_NewWith(pStaticStore) CFDE_CSSValueList(pStaticStore, list), bImportant); return TRUE; } -FX_BOOL CFDE_CSSDeclaration::ParseCounterProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant) +FX_BOOL CFDE_CSSDeclaration::ParseCounterProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant) { IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore; CFDE_CSSValueListParser parser(pszValue, iValueLen, ' '); @@ -447,7 +447,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseCounterProperty(FDE_LPCCSSPROPERTYARGS pArgs, AddPropertyHolder(pStaticStore, pArgs->pProperty->eName, FDE_NewWith(pStaticStore) CFDE_CSSValueList(pStaticStore, listFull), bImportant); return TRUE; } -FX_BOOL CFDE_CSSDeclaration::ParseValueListProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant) +FX_BOOL CFDE_CSSDeclaration::ParseValueListProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant) { IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore; FX_WCHAR separator = (pArgs->pProperty->eName == FDE_CSSPROPERTY_FontFamily) ? ',' : ' '; @@ -557,7 +557,7 @@ FX_BOOL CFDE_CSSDeclaration::Add4ValuesProperty(IFX_MEMAllocator *pStaticStore, } return FALSE; } -FX_BOOL CFDE_CSSDeclaration::ParseBorderPropoerty(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR pszValue, FX_INT32 iValueLen, IFDE_CSSValue *&pColor, IFDE_CSSValue *&pStyle, IFDE_CSSValue *&pWidth) const +FX_BOOL CFDE_CSSDeclaration::ParseBorderPropoerty(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR pszValue, int32_t iValueLen, IFDE_CSSValue *&pColor, IFDE_CSSValue *&pStyle, IFDE_CSSValue *&pWidth) const { pColor = pStyle = pWidth = NULL; CFDE_CSSValueListParser parser(pszValue, iValueLen, ' '); @@ -645,7 +645,7 @@ void CFDE_CSSDeclaration::AddBorderProperty(IFX_MEMAllocator *pStaticStore, IFDE AddPropertyHolder(pStaticStore, eWidth, pWidth, bImportant); AddPropertyHolder(pStaticStore, eColor, pColor, bImportant); } -FX_BOOL CFDE_CSSDeclaration::ParseListStyleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant) +FX_BOOL CFDE_CSSDeclaration::ParseListStyleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant) { IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore; CFDE_CSSValueListParser parser(pszValue, iValueLen, ' '); @@ -718,7 +718,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseListStyleProperty(FDE_LPCCSSPROPERTYARGS pArgs AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_ListStyleType, pType, bImportant); return TRUE; } -FX_BOOL CFDE_CSSDeclaration::ParseBackgroundProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant) +FX_BOOL CFDE_CSSDeclaration::ParseBackgroundProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant) { IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore; CFDE_CSSValueListParser parser(pszValue, iValueLen, ' '); @@ -844,7 +844,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseBackgroundProperty(FDE_LPCCSSPROPERTYARGS pArg AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_BackgroundAttachment, pAttachment, bImportant); return TRUE; } -FX_BOOL CFDE_CSSDeclaration::ParseFontProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant) +FX_BOOL CFDE_CSSDeclaration::ParseFontProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant) { IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore; CFDE_CSSValueListParser parser(pszValue, iValueLen, '/'); @@ -918,7 +918,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseFontProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_ break; } if (eType == FDE_CSSPRIMITIVETYPE_Number) { - switch ((FX_INT32)fValue) { + switch ((int32_t)fValue) { case 100: case 200: case 300: @@ -971,7 +971,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseFontProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_ } return TRUE; } -FX_BOOL CFDE_CSSDeclaration::ParseColumnRuleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant) +FX_BOOL CFDE_CSSDeclaration::ParseColumnRuleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant) { IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore; CFDE_CSSValueListParser parser(pszValue, iValueLen, ' '); @@ -1058,7 +1058,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseColumnRuleProperty(FDE_LPCCSSPROPERTYARGS pArg AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_ColumnRuleColor, pColumnRuleColor, bImportant); return TRUE; } -FX_BOOL CFDE_CSSDeclaration::ParseTextEmphasisProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant) +FX_BOOL CFDE_CSSDeclaration::ParseTextEmphasisProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant) { IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore; CFDE_CSSValueListParser parser(pszValue, iValueLen, ' '); @@ -1101,7 +1101,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseTextEmphasisProperty(FDE_LPCCSSPROPERTYARGS pA } return TRUE; } -FX_BOOL CFDE_CSSDeclaration::ParseColumnsProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant) +FX_BOOL CFDE_CSSDeclaration::ParseColumnsProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant) { IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore; CFDE_CSSValueListParser parser(pszValue, iValueLen, ' '); @@ -1150,7 +1150,7 @@ FX_BOOL CFDE_CSSDeclaration::ParseColumnsProperty(FDE_LPCCSSPROPERTYARGS pArgs, AddPropertyHolder(pStaticStore, FDE_CSSPROPERTY_ColumnCount, pColumnCount, bImportant); return TRUE; } -FX_BOOL CFDE_CSSDeclaration::ParseOverflowProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant) +FX_BOOL CFDE_CSSDeclaration::ParseOverflowProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant) { IFX_MEMAllocator *pStaticStore = pArgs->pStaticStore; CFDE_CSSValueListParser parser(pszValue, iValueLen, ' '); diff --git a/xfa/src/fdp/src/css/fde_cssdeclaration.h b/xfa/src/fdp/src/css/fde_cssdeclaration.h index ca0add9dea..91595d21d9 100644 --- a/xfa/src/fdp/src/css/fde_cssdeclaration.h +++ b/xfa/src/fdp/src/css/fde_cssdeclaration.h @@ -8,8 +8,8 @@ #define _FDE_CSSDECLARATION #include "fde_cssdatatable.h" typedef struct _FDE_CSSPROPERTYHOLDER : public CFX_Target { - FX_INT16 eProperty; - FX_INT16 bImportant; + int16_t eProperty; + int16_t bImportant; IFDE_CSSValue *pValue; _FDE_CSSPROPERTYHOLDER *pNext; } FDE_CSSPROPERTYHOLDER, *FDE_LPCSSPROPERTYHOLDER; @@ -33,32 +33,32 @@ public: virtual void GetNextProperty(FX_POSITION &pos, FDE_CSSPROPERTY &eProperty, IFDE_CSSValue *&pValue, FX_BOOL &bImportant) const; virtual FX_POSITION GetStartCustom() const; virtual void GetNextCustom(FX_POSITION &pos, CFX_WideString &wsName, CFX_WideString &wsValue) const; - FX_BOOL AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen); - FX_BOOL AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszName, FX_INT32 iNameLen, FX_LPCWSTR pszValue, FX_INT32 iValueLen); + FX_BOOL AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen); + FX_BOOL AddProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszName, int32_t iNameLen, FX_LPCWSTR pszValue, int32_t iValueLen); protected: - FX_BOOL ParseTextEmphasisProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant); - FX_BOOL ParseColumnsProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant); - FX_BOOL ParseColumnRuleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant); - FX_BOOL ParseOverflowProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant); - FX_BOOL ParseFontProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant); - FX_BOOL ParseBackgroundProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant); - FX_BOOL ParseListStyleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant); - FX_BOOL ParseBorderPropoerty(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR pszValue, FX_INT32 iValueLen, + FX_BOOL ParseTextEmphasisProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant); + FX_BOOL ParseColumnsProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant); + FX_BOOL ParseColumnRuleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant); + FX_BOOL ParseOverflowProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant); + FX_BOOL ParseFontProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant); + FX_BOOL ParseBackgroundProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant); + FX_BOOL ParseListStyleProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant); + FX_BOOL ParseBorderPropoerty(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR pszValue, int32_t iValueLen, IFDE_CSSValue *&pColor, IFDE_CSSValue *&pStyle, IFDE_CSSValue *&pWidth) const; void AddBorderProperty(IFX_MEMAllocator *pStaticStore, IFDE_CSSValue *pColor, IFDE_CSSValue *pStyle, IFDE_CSSValue *pWidth, FX_BOOL bImportant, FDE_CSSPROPERTY eColor, FDE_CSSPROPERTY eStyle, FDE_CSSPROPERTY eWidth); - FX_BOOL ParseContentProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant); - FX_BOOL ParseCounterProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant); - FX_BOOL ParseValueListProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen, FX_BOOL bImportant); + FX_BOOL ParseContentProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant); + FX_BOOL ParseCounterProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant); + FX_BOOL ParseValueListProperty(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen, FX_BOOL bImportant); FX_BOOL Add4ValuesProperty(IFX_MEMAllocator *pStaticStore, const CFDE_CSSValueArray &list, FX_BOOL bImportant, FDE_CSSPROPERTY eLeft, FDE_CSSPROPERTY eTop, FDE_CSSPROPERTY eRight, FDE_CSSPROPERTY eBottom); - IFDE_CSSValue* ParseNumber(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen); - IFDE_CSSValue* ParseEnum(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen); - IFDE_CSSValue* ParseColor(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen); - IFDE_CSSValue* ParseURI(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen); - IFDE_CSSValue* ParseString(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen); - IFDE_CSSValue* ParseFunction(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen); - FX_LPCWSTR CopyToLocal(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, FX_INT32 iValueLen); + IFDE_CSSValue* ParseNumber(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen); + IFDE_CSSValue* ParseEnum(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen); + IFDE_CSSValue* ParseColor(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen); + IFDE_CSSValue* ParseURI(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen); + IFDE_CSSValue* ParseString(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen); + IFDE_CSSValue* ParseFunction(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen); + FX_LPCWSTR CopyToLocal(FDE_LPCCSSPROPERTYARGS pArgs, FX_LPCWSTR pszValue, int32_t iValueLen); void AddPropertyHolder(IFX_MEMAllocator *pStaticStore, FDE_CSSPROPERTY eProperty, IFDE_CSSValue *pValue, FX_BOOL bImportant); IFDE_CSSPrimitiveValue* NewNumberValue(IFX_MEMAllocator *pStaticStore, FDE_CSSPRIMITIVETYPE eUnit, FX_FLOAT fValue) const; IFDE_CSSPrimitiveValue* NewEnumValue(IFX_MEMAllocator *pStaticStore, FDE_CSSPROPERTYVALUE eValue) const; diff --git a/xfa/src/fdp/src/css/fde_cssstyleselector.cpp b/xfa/src/fdp/src/css/fde_cssstyleselector.cpp index e21bfe007a..e4c8be6409 100644 --- a/xfa/src/fdp/src/css/fde_cssstyleselector.cpp +++ b/xfa/src/fdp/src/css/fde_cssstyleselector.cpp @@ -8,10 +8,10 @@ #include "fde_csscache.h" #include "fde_cssdeclaration.h" #include "fde_cssstyleselector.h" -FX_INT32 CFDE_CSSCounterStyle::FindIndex(FX_LPCWSTR pszIdentifier) +int32_t CFDE_CSSCounterStyle::FindIndex(FX_LPCWSTR pszIdentifier) { - FX_INT32 iCount = m_arrCounterData.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = m_arrCounterData.GetSize(); + for (int32_t i = 0; i < iCount; i++) { if (FXSYS_wcscmp(pszIdentifier, m_arrCounterData.ElementAt(i).m_pszIdent) == 0) { return i; } @@ -23,30 +23,30 @@ void CFDE_CSSCounterStyle::DoUpdateIndex(IFDE_CSSValueList *pList) if (pList == NULL) { return; } - FX_INT32 iCount = pList->CountValues(); + int32_t iCount = pList->CountValues(); FX_FLOAT fDefValue = 1.0; FX_BOOL bDefIncrement = TRUE; if (pList == m_pCounterReset) { fDefValue = 0.0; bDefIncrement = FALSE; } - for (FX_INT32 i = 0; i < iCount; i++) { + for (int32_t i = 0; i < iCount; i++) { IFDE_CSSValueList *pCounter = (IFDE_CSSValueList*)pList->GetValue(i); - FX_INT32 iLen; + int32_t iLen; FX_LPCWSTR pszIdentifier = ((IFDE_CSSPrimitiveValue*)(pCounter->GetValue(0)))->GetString(iLen); FX_FLOAT fValue = fDefValue; if (pCounter->CountValues() > 1) { fValue = ((IFDE_CSSPrimitiveValue*)(pCounter->GetValue(1)))->GetFloat(); } - FX_INT32 iIndex = FindIndex(pszIdentifier); + int32_t iIndex = FindIndex(pszIdentifier); if (iIndex == -1) { FDE_CSSCOUNTERDATA data; data.m_pszIdent = pszIdentifier; if (bDefIncrement) { data.m_bIncrement = TRUE; - data.m_iIncVal = (FX_INT32)fValue; + data.m_iIncVal = (int32_t)fValue; } else { - data.m_iResetVal = (FX_INT32)fValue; + data.m_iResetVal = (int32_t)fValue; data.m_bReset = TRUE; } m_arrCounterData.Add(data); @@ -54,10 +54,10 @@ void CFDE_CSSCounterStyle::DoUpdateIndex(IFDE_CSSValueList *pList) FDE_CSSCOUNTERDATA &data = m_arrCounterData.ElementAt(iIndex); if (bDefIncrement) { data.m_bIncrement = TRUE; - data.m_iIncVal += (FX_INT32)fValue; + data.m_iIncVal += (int32_t)fValue; } else { data.m_bReset = TRUE; - data.m_iResetVal = (FX_INT32)fValue; + data.m_iResetVal = (int32_t)fValue; } } } @@ -107,12 +107,12 @@ void CFDE_CSSRuleCollection::Clear() } void CFDE_CSSRuleCollection::AddRulesFrom(const CFDE_CSSStyleSheetArray &sheets, FX_DWORD dwMediaList, IFX_FontMgr *pFontMgr) { - FX_INT32 iSheets = sheets.GetSize(); - for (FX_INT32 i = 0; i < iSheets; ++i) { + int32_t iSheets = sheets.GetSize(); + for (int32_t i = 0; i < iSheets; ++i) { IFDE_CSSStyleSheet *pSheet = sheets.GetAt(i); if (FX_DWORD dwMatchMedia = pSheet->GetMediaList() & dwMediaList) { - FX_INT32 iRules = pSheet->CountRules(); - for (FX_INT32 j = 0; j < iRules; j++) { + int32_t iRules = pSheet->CountRules(); + for (int32_t j = 0; j < iRules; j++) { AddRulesFrom(pSheet, pSheet->GetRule(j), dwMatchMedia, pFontMgr); } } @@ -124,8 +124,8 @@ void CFDE_CSSRuleCollection::AddRulesFrom(IFDE_CSSStyleSheet *pStyleSheet, IFDE_ case FDE_CSSRULETYPE_Style: { IFDE_CSSStyleRule *pStyleRule = (IFDE_CSSStyleRule*)pRule; IFDE_CSSDeclaration *pDeclaration = pStyleRule->GetDeclaration(); - FX_INT32 iSelectors = pStyleRule->CountSelectorLists(); - for (FX_INT32 i = 0; i < iSelectors; ++i) { + int32_t iSelectors = pStyleRule->CountSelectorLists(); + for (int32_t i = 0; i < iSelectors; ++i) { IFDE_CSSSelector *pSelector = pStyleRule->GetSelectorList(i); if (pSelector->GetType() == FDE_CSSSELECTORTYPE_Persudo) { FDE_LPCSSRULEDATA pData = NewRuleData(pSelector, pDeclaration); @@ -163,8 +163,8 @@ void CFDE_CSSRuleCollection::AddRulesFrom(IFDE_CSSStyleSheet *pStyleSheet, IFDE_ case FDE_CSSRULETYPE_Media: { IFDE_CSSMediaRule *pMediaRule = (IFDE_CSSMediaRule*)pRule; if (pMediaRule->GetMediaList() & dwMediaList) { - FX_INT32 iRules = pMediaRule->CountRules(); - for (FX_INT32 i = 0; i < iRules; ++i) { + int32_t iRules = pMediaRule->CountRules(); + for (int32_t i = 0; i < iRules; ++i) { AddRulesFrom(pStyleSheet, pMediaRule->GetRule(i), dwMediaList, pFontMgr); } } @@ -176,7 +176,7 @@ void CFDE_CSSRuleCollection::AddRulesFrom(IFDE_CSSStyleSheet *pStyleSheet, IFDE_ } void CFDE_CSSRuleCollection::AddRuleTo(CFX_MapPtrToPtr &map, FX_DWORD dwKey, IFDE_CSSSelector *pSel, IFDE_CSSDeclaration *pDecl) { - FX_LPVOID pKey = (FX_LPVOID)(FX_UINTPTR)dwKey; + FX_LPVOID pKey = (FX_LPVOID)(uintptr_t)dwKey; FDE_LPCSSRULEDATA pData = NewRuleData(pSel, pDecl); FDE_LPCSSRULEDATA pList = NULL; if (!map.Lookup(pKey, (FX_LPVOID&)pList)) { @@ -292,7 +292,7 @@ void CFDE_CSSStyleSelector::UpdateStyleIndex(FX_DWORD dwMediaList) Reset(); m_pRuleDataStore = FX_CreateAllocator(FX_ALLOCTYPE_Static, 1024, 0); FXSYS_assert(m_pRuleDataStore != NULL); - for (FX_INT32 iGroup = 0; iGroup < FDE_CSSSTYLESHEETGROUP_MAX; ++iGroup) { + for (int32_t iGroup = 0; iGroup < FDE_CSSSTYLESHEETGROUP_MAX; ++iGroup) { CFDE_CSSRuleCollection &rules = m_RuleCollection[iGroup]; rules.m_pStaticStore = m_pRuleDataStore; rules.AddRulesFrom(m_SheetGroups[iGroup], dwMediaList, m_pFontMgr); @@ -300,7 +300,7 @@ void CFDE_CSSStyleSelector::UpdateStyleIndex(FX_DWORD dwMediaList) } void CFDE_CSSStyleSelector::Reset() { - for (FX_INT32 iGroup = 0; iGroup < FDE_CSSSTYLESHEETGROUP_MAX; ++iGroup) { + for (int32_t iGroup = 0; iGroup < FDE_CSSSTYLESHEETGROUP_MAX; ++iGroup) { m_RuleCollection[iGroup].Clear(); } if (m_pRuleDataStore != NULL) { @@ -308,13 +308,13 @@ void CFDE_CSSStyleSelector::Reset() m_pRuleDataStore = NULL; } } -FX_INT32 CFDE_CSSStyleSelector::MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType) +int32_t CFDE_CSSStyleSelector::MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType) { FXSYS_assert(m_pAccelerator != NULL && pTag != NULL); FDE_LPCSSTAGCACHE pCache = m_pAccelerator->GetTopElement(); FXSYS_assert(pCache != NULL && pCache->GetTag() == pTag); matchedDecls.RemoveAt(0, matchedDecls.GetSize()); - for (FX_INT32 ePriority = FDE_CSSSTYLESHEETPRIORITY_MAX - 1; ePriority >= 0; --ePriority) { + for (int32_t ePriority = FDE_CSSSTYLESHEETPRIORITY_MAX - 1; ePriority >= 0; --ePriority) { FDE_CSSSTYLESHEETGROUP eGroup = m_ePriorities[ePriority]; CFDE_CSSRuleCollection &rules = m_RuleCollection[eGroup]; if (rules.CountSelectors() == 0) { @@ -325,8 +325,8 @@ FX_INT32 CFDE_CSSStyleSelector::MatchDeclarations(IFDE_CSSTagProvider *pTag, CFD if (pCache->HashTag()) { MatchRules(pCache, rules.GetTagRuleData(pCache->HashTag()), ePersudoType); } - FX_INT32 iCount = pCache->CountHashClass(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = pCache->CountHashClass(); + for (int32_t i = 0; i < iCount; i++) { pCache->SetClassIndex(i); MatchRules(pCache, rules.GetClassRuleData(pCache->HashClass()), ePersudoType); } @@ -399,10 +399,10 @@ FX_BOOL CFDE_CSSStyleSelector::MatchSelector(FDE_LPCSSTAGCACHE pCache, IFDE_CSSS } void CFDE_CSSStyleSelector::SortRulesTo(CFDE_CSSDeclarationArray &matchDecls) { - for (FX_INT32 j = m_MatchedRules.GetUpperBound(); j >= 0; --j) { + for (int32_t j = m_MatchedRules.GetUpperBound(); j >= 0; --j) { FDE_LPCSSRULEDATA &pMin = m_MatchedRules.ElementAt(j); FX_DWORD dwMin = pMin->dwPriority; - for (FX_INT32 i = j - 1; i >= 0; --i) { + for (int32_t i = j - 1; i >= 0; --i) { FDE_LPCSSRULEDATA &pCur = m_MatchedRules.ElementAt(i); if (dwMin > pCur->dwPriority) { dwMin = pCur->dwPriority; @@ -414,7 +414,7 @@ void CFDE_CSSStyleSelector::SortRulesTo(CFDE_CSSDeclarationArray &matchDecls) matchDecls.Add(pMin->pDeclaration); } } -void CFDE_CSSStyleSelector::ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle) +void CFDE_CSSStyleSelector::ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle *pDestStyle) { CFDE_CSSComputedStyle *pComputedStyle = (CFDE_CSSComputedStyle*)pDestStyle; FXSYS_assert(pTag && iDeclCount >= 0 && pComputedStyle != NULL); @@ -464,12 +464,12 @@ void CFDE_CSSStyleSelector::ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_C ApplyDeclarations(FALSE, ppDeclArray, iDeclCount, pDestStyle); } } -void CFDE_CSSStyleSelector::ApplyDeclarations(FX_BOOL bPriority, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle) +void CFDE_CSSStyleSelector::ApplyDeclarations(FX_BOOL bPriority, const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle *pDestStyle) { CFDE_CSSComputedStyle *pComputedStyle = (CFDE_CSSComputedStyle*)pDestStyle; IFDE_CSSValue *pVal; FX_BOOL bImportant; - FX_INT32 i; + int32_t i; if (bPriority) { IFDE_CSSValue *pLastest = NULL, *pImportant = NULL; for (i = 0; i < iDeclCount; ++i) { @@ -525,7 +525,7 @@ void CFDE_CSSStyleSelector::ApplyDeclarations(FX_BOOL bPriority, const IFDE_CSSD } } } -void CFDE_CSSStyleSelector::AppendInlineStyle(CFDE_CSSDeclaration *pDecl, FX_LPCWSTR psz, FX_INT32 iLen) +void CFDE_CSSStyleSelector::AppendInlineStyle(CFDE_CSSDeclaration *pDecl, FX_LPCWSTR psz, int32_t iLen) { FXSYS_assert(pDecl != NULL && psz != NULL && iLen > 0); IFDE_CSSSyntaxParser *pSyntax = IFDE_CSSSyntaxParser::Create(); @@ -533,7 +533,7 @@ void CFDE_CSSStyleSelector::AppendInlineStyle(CFDE_CSSDeclaration *pDecl, FX_LPC return; } if (pSyntax->Init(psz, iLen, 32, TRUE)) { - FX_INT32 iLen; + int32_t iLen; FX_LPCWSTR psz; FDE_CSSPROPERTYARGS args; args.pStringCache = NULL; @@ -612,7 +612,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal if (eType == FDE_CSSPRIMITIVETYPE_Enum) { FDE_CSSINHERITS.m_wFontWeight = ToFontWeight(pPrimitive->GetEnum()); } else if (eType == FDE_CSSPRIMITIVETYPE_Number) { - FX_INT32 iValue = (FX_INT32)pPrimitive->GetFloat() / 100; + int32_t iValue = (int32_t)pPrimitive->GetFloat() / 100; if (iValue >= 1 && iValue <= 9) { FDE_CSSINHERITS.m_wFontWeight = iValue * 100; } @@ -807,12 +807,12 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal break; case FDE_CSSPROPERTY_Widows: if (eType == FDE_CSSPRIMITIVETYPE_Number) { - FDE_CSSINHERITS.m_iWidows = (FX_INT32)pPrimitive->GetFloat(); + FDE_CSSINHERITS.m_iWidows = (int32_t)pPrimitive->GetFloat(); } break; case FDE_CSSPROPERTY_Orphans: if (eType == FDE_CSSPRIMITIVETYPE_Number) { - FDE_CSSINHERITS.m_iOrphans = (FX_INT32)pPrimitive->GetFloat(); + FDE_CSSINHERITS.m_iOrphans = (int32_t)pPrimitive->GetFloat(); } break; case FDE_CSSPROPERTY_TextEmphasisColor: @@ -894,7 +894,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal if (eType == FDE_CSSPRIMITIVETYPE_Enum) { FDE_CSSNONINHERITS.m_pszBKGImage = NULL; } else if (eType == FDE_CSSPRIMITIVETYPE_URI) { - FX_INT32 iLength; + int32_t iLength; FDE_CSSNONINHERITS.m_pszBKGImage = pPrimitive->GetString(iLength); } break; @@ -919,7 +919,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal if (eType == FDE_CSSPRIMITIVETYPE_Enum) { FDE_CSSINHERITS.m_pszListStyleImage = NULL; } else if (eType == FDE_CSSPRIMITIVETYPE_URI) { - FX_INT32 iLength; + int32_t iLength; FDE_CSSINHERITS.m_pszListStyleImage = pPrimitive->GetString(iLength); } break; @@ -961,7 +961,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal } } else if (pValue->GetType() == FDE_CSSVALUETYPE_List) { IFDE_CSSValueList *pList = (IFDE_CSSValueList*)pValue; - FX_INT32 iCount = pList->CountValues(); + int32_t iCount = pList->CountValues(); if (iCount > 0) { switch (eProperty) { case FDE_CSSPROPERTY_FontFamily: @@ -991,7 +991,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal FDE_CSSINHERITS.m_pQuotes = pList; break; case FDE_CSSPROPERTY_TextCombine: { - for (FX_INT32 i = 0; i < pList->CountValues(); i++) { + for (int32_t i = 0; i < pList->CountValues(); i++) { IFDE_CSSPrimitiveValue *pVal = (IFDE_CSSPrimitiveValue*)pList->GetValue(i); switch (pVal->GetPrimitiveType()) { case FDE_CSSPRIMITIVETYPE_Enum: { @@ -1023,7 +1023,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal case FDE_CSSPROPERTY_TextEmphasisStyle: { FDE_CSSTEXTEMPHASISFILL eFill; FDE_CSSTEXTEMPHASISMARK eMark; - for (FX_INT32 i = 0; i < pList->CountValues(); i++) { + for (int32_t i = 0; i < pList->CountValues(); i++) { IFDE_CSSPrimitiveValue *pVal = (IFDE_CSSPrimitiveValue*)pList->GetValue(i); switch (pVal->GetPrimitiveType()) { case FDE_CSSPRIMITIVETYPE_Enum: { @@ -1037,7 +1037,7 @@ void CFDE_CSSStyleSelector::ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSVal break; case FDE_CSSPRIMITIVETYPE_String: { FDE_CSSINHERITS.m_eTextEmphasisMark = FDE_CSSTEXTEMPHASISMARK_Custom; - FX_INT32 iLen; + int32_t iLen; FDE_CSSINHERITS.m_pszTextEmphasisCustomMark = pVal->GetString(iLen); } break; @@ -1668,7 +1668,7 @@ FDE_CSSWHITESPACE CFDE_CSSStyleSelector::ToWhiteSpace(FDE_CSSPROPERTYVALUE eValu FX_DWORD CFDE_CSSStyleSelector::ToTextDecoration(IFDE_CSSValueList *pValue) { FX_DWORD dwDecoration = 0; - for (FX_INT32 i = pValue->CountValues() - 1; i >= 0; --i) { + for (int32_t i = pValue->CountValues() - 1; i >= 0; --i) { IFDE_CSSPrimitiveValue *pPrimitive = (IFDE_CSSPrimitiveValue*)pValue->GetValue(i); if (pPrimitive->GetPrimitiveType() == FDE_CSSPRIMITIVETYPE_Enum) { switch (pPrimitive->GetEnum()) { diff --git a/xfa/src/fdp/src/css/fde_cssstyleselector.h b/xfa/src/fdp/src/css/fde_cssstyleselector.h index 4100299664..803522bfb4 100644 --- a/xfa/src/fdp/src/css/fde_cssstyleselector.h +++ b/xfa/src/fdp/src/css/fde_cssstyleselector.h @@ -27,24 +27,24 @@ public: void AddRulesFrom(const CFDE_CSSStyleSheetArray &sheets, FX_DWORD dwMediaList, IFX_FontMgr *pFontMgr); void Clear(); - FX_INT32 CountSelectors() const + int32_t CountSelectors() const { return m_iSelectors; } FDE_LPCSSRULEDATA GetIDRuleData(FX_DWORD dwIDHash) { FX_LPVOID pData; - return m_IDRules.Lookup((FX_LPVOID)(FX_UINTPTR)dwIDHash, pData) ? (FDE_LPCSSRULEDATA)pData : NULL; + return m_IDRules.Lookup((FX_LPVOID)(uintptr_t)dwIDHash, pData) ? (FDE_LPCSSRULEDATA)pData : NULL; } FDE_LPCSSRULEDATA GetTagRuleData(FX_DWORD dwTagHasn) { FX_LPVOID pData; - return m_TagRules.Lookup((FX_LPVOID)(FX_UINTPTR)dwTagHasn, pData) ? (FDE_LPCSSRULEDATA)pData : NULL; + return m_TagRules.Lookup((FX_LPVOID)(uintptr_t)dwTagHasn, pData) ? (FDE_LPCSSRULEDATA)pData : NULL; } FDE_LPCSSRULEDATA GetClassRuleData(FX_DWORD dwIDHash) { FX_LPVOID pData; - return m_ClassRules.Lookup((FX_LPVOID)(FX_UINTPTR)dwIDHash, pData) ? (FDE_LPCSSRULEDATA)pData : NULL; + return m_ClassRules.Lookup((FX_LPVOID)(uintptr_t)dwIDHash, pData) ? (FDE_LPCSSRULEDATA)pData : NULL; } FDE_LPCSSRULEDATA GetUniversalRuleData() { @@ -65,7 +65,7 @@ protected: CFX_MapPtrToPtr m_ClassRules; FDE_LPCSSRULEDATA m_pUniversalRules; FDE_LPCSSRULEDATA m_pPersudoRules; - FX_INT32 m_iSelectors; + int32_t m_iSelectors; }; class CFDE_CSSAccelerator; class CFDE_CSSComputedStyle; @@ -88,15 +88,15 @@ public: virtual void UpdateStyleIndex(FX_DWORD dwMediaList); virtual IFDE_CSSAccelerator* InitAccelerator(); virtual IFDE_CSSComputedStyle* CreateComputedStyle(IFDE_CSSComputedStyle *pParentStyle); - virtual FX_INT32 MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE); - virtual void ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle); + virtual int32_t MatchDeclarations(IFDE_CSSTagProvider *pTag, CFDE_CSSDeclarationArray &matchedDecls, FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE); + virtual void ComputeStyle(IFDE_CSSTagProvider *pTag, const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle *pDestStyle); protected: void Reset(); void MatchRules(FDE_LPCSSTAGCACHE pCache, FDE_LPCSSRULEDATA pList, FDE_CSSPERSUDO ePersudoType); void SortRulesTo(CFDE_CSSDeclarationArray &matchDecls); FX_BOOL MatchSelector(FDE_LPCSSTAGCACHE pCache, IFDE_CSSSelector *pSel, FDE_CSSPERSUDO ePersudoType); - void AppendInlineStyle(CFDE_CSSDeclaration *pDecl, FX_LPCWSTR psz, FX_INT32 iLen); - void ApplyDeclarations(FX_BOOL bPriority, const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount, IFDE_CSSComputedStyle *pDestStyle); + void AppendInlineStyle(CFDE_CSSDeclaration *pDecl, FX_LPCWSTR psz, int32_t iLen); + void ApplyDeclarations(FX_BOOL bPriority, const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle *pDestStyle); void ApplyProperty(FDE_CSSPROPERTY eProperty, IFDE_CSSValue *pValue, CFDE_CSSComputedStyle *pComputedStyle); FX_FLOAT ApplyNumber(FDE_CSSPRIMITIVETYPE eUnit, FX_FLOAT fValue, FX_FLOAT fPercentBase); @@ -151,12 +151,12 @@ public: { FX_memset(this, 0, sizeof(_FDE_CSSCOUNTERDATA)); } - FX_BOOL GetCounterIncrement(FX_INT32 &iValue) + FX_BOOL GetCounterIncrement(int32_t &iValue) { iValue = m_iIncVal; return m_bIncrement; } - FX_BOOL GetCounterReset(FX_INT32 &iValue) + FX_BOOL GetCounterReset(int32_t &iValue) { iValue = m_iResetVal; return m_bReset; @@ -164,8 +164,8 @@ public: FX_LPCWSTR m_pszIdent; FX_BOOL m_bIncrement; FX_BOOL m_bReset; - FX_INT32 m_iIncVal; - FX_INT32 m_iResetVal; + int32_t m_iIncVal; + int32_t m_iResetVal; } FDE_CSSCOUNTERDATA, *FDE_LPCSSCOUNTERDATA; class CFDE_CSSCounterStyle { @@ -181,22 +181,22 @@ public: m_pCounterReset = pList; m_bIndexDirty = TRUE; } - FX_INT32 CountCounters() + int32_t CountCounters() { UpdateIndex(); return m_arrCounterData.GetSize(); } - FX_BOOL GetCounterIncrement(FX_INT32 index, FX_INT32 &iValue) + FX_BOOL GetCounterIncrement(int32_t index, int32_t &iValue) { UpdateIndex(); return m_arrCounterData.ElementAt(index).GetCounterIncrement(iValue); } - FX_BOOL GetCounterReset(FX_INT32 index, FX_INT32 &iValue) + FX_BOOL GetCounterReset(int32_t index, int32_t &iValue) { UpdateIndex(); return m_arrCounterData.ElementAt(index).GetCounterReset(iValue); } - FX_LPCWSTR GetCounterIdentifier(FX_INT32 index) + FX_LPCWSTR GetCounterIdentifier(int32_t index) { UpdateIndex(); return m_arrCounterData.ElementAt(index).m_pszIdent; @@ -204,7 +204,7 @@ public: protected: void UpdateIndex(); void DoUpdateIndex(IFDE_CSSValueList *pList); - FX_INT32 FindIndex(FX_LPCWSTR pszIdentifier); + int32_t FindIndex(FX_LPCWSTR pszIdentifier); IFDE_CSSValueList *m_pCounterInc; IFDE_CSSValueList *m_pCounterReset; CFX_ArrayTemplate m_arrCounterData; @@ -240,8 +240,8 @@ public: FX_ARGB m_dwFontColor; FX_ARGB m_dwTextEmphasisColor; FX_WORD m_wFontWeight; - FX_INT32 m_iWidows; - FX_INT32 m_iOrphans; + int32_t m_iWidows; + int32_t m_iOrphans; FX_LPCWSTR m_pszTextEmphasisCustomMark; FX_WORD m_eFontVariant : 1; FX_WORD m_eFontStyle : 1; @@ -413,7 +413,7 @@ public: } virtual FX_BOOL GetCustomStyle(FX_WSTR wsName, CFX_WideString &wsValue) const { - for (FX_INT32 i = m_CustomProperties.GetSize() - 2; i > -1; i -= 2) { + for (int32_t i = m_CustomProperties.GetSize() - 2; i > -1; i -= 2) { if (wsName == m_CustomProperties[i]) { wsValue = m_CustomProperties[i + 1]; return TRUE; @@ -445,19 +445,19 @@ public: { return (FDE_CSSCAPTIONSIDE)m_InheritedData.m_eCaptionSide; } - virtual FX_INT32 CountCounters() + virtual int32_t CountCounters() { return (m_NonInheritedData.m_pCounterStyle == NULL) ? 0 : m_NonInheritedData.m_pCounterStyle->CountCounters(); } - virtual FX_LPCWSTR GetCounterIdentifier(FX_INT32 index) + virtual FX_LPCWSTR GetCounterIdentifier(int32_t index) { return m_NonInheritedData.m_pCounterStyle->GetCounterIdentifier(index); } - virtual FX_BOOL GetCounterReset(FX_INT32 index, FX_INT32 &iValue) + virtual FX_BOOL GetCounterReset(int32_t index, int32_t &iValue) { return m_NonInheritedData.m_pCounterStyle->GetCounterReset(index, iValue); } - virtual FX_BOOL GetCounterIncrement(FX_INT32 index, FX_INT32 &iValue) + virtual FX_BOOL GetCounterIncrement(int32_t index, int32_t &iValue) { return m_NonInheritedData.m_pCounterStyle->GetCounterIncrement(index, iValue); } @@ -465,11 +465,11 @@ public: { return m_NonInheritedData.m_pContentList; } - virtual FX_INT32 CountQuotes() const + virtual int32_t CountQuotes() const { return m_InheritedData.m_pQuotes == NULL ? 0 : m_InheritedData.m_pQuotes->CountValues(); } - virtual FX_LPCWSTR GetQuotes(FX_INT32 index) const + virtual FX_LPCWSTR GetQuotes(int32_t index) const { FXSYS_assert(m_InheritedData.m_pQuotes != NULL && m_InheritedData.m_pQuotes->CountValues() > index); return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pQuotes->GetValue(index)))->GetString(index); @@ -522,11 +522,11 @@ public: { m_NonInheritedData.m_ColumnWidth = columnWidth; } - virtual FX_INT32 CountFontFamilies() const + virtual int32_t CountFontFamilies() const { return m_InheritedData.m_pFontFamily ? m_InheritedData.m_pFontFamily->CountValues() : 0; } - virtual FX_LPCWSTR GetFontFamily(FX_INT32 index) const + virtual FX_LPCWSTR GetFontFamily(int32_t index) const { return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pFontFamily->GetValue(index)))->GetString(index); } @@ -782,7 +782,7 @@ public: { return (FDE_CSSWORDBREAK)m_InheritedData.m_eWordBreak; } - virtual FX_INT32 GetWidows() const + virtual int32_t GetWidows() const { return m_InheritedData.m_iWidows; } @@ -802,7 +802,7 @@ public: { return (FDE_CSSPAGEBREAK)m_NonInheritedData.m_ePageBreakInside; } - virtual FX_INT32 GetOrphans() const + virtual int32_t GetOrphans() const { return m_InheritedData.m_iOrphans; } @@ -881,7 +881,7 @@ public: { m_InheritedData.m_eWordBreak = eWordBreak; } - virtual void SetWidows(FX_INT32 iWidows) + virtual void SetWidows(int32_t iWidows) { m_InheritedData.m_iWidows = iWidows; } @@ -901,7 +901,7 @@ public: { m_NonInheritedData.m_ePageBreakInside = ePageBreakInside; } - virtual void SetOrphans(FX_INT32 iOrphans) + virtual void SetOrphans(int32_t iOrphans) { m_InheritedData.m_iOrphans = iOrphans; } @@ -949,11 +949,11 @@ public: { return (FDE_CSSOVERFLOW)m_NonInheritedData.m_eOverflowY; } - virtual FX_INT32 CountCursorUrls() const + virtual int32_t CountCursorUrls() const { return m_InheritedData.m_pCursorUris == NULL ? 0 : m_InheritedData.m_pCursorUris->CountValues(); } - virtual FX_LPCWSTR GetCursorUrl(FX_INT32 index) const + virtual FX_LPCWSTR GetCursorUrl(int32_t index) const { FXSYS_assert(m_InheritedData.m_pCursorUris != NULL); return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pCursorUris->GetValue(index)))->GetString(index); diff --git a/xfa/src/fdp/src/css/fde_cssstylesheet.cpp b/xfa/src/fdp/src/css/fde_cssstylesheet.cpp index 1ffce6862e..006995a754 100644 --- a/xfa/src/fdp/src/css/fde_cssstylesheet.cpp +++ b/xfa/src/fdp/src/css/fde_cssstylesheet.cpp @@ -35,7 +35,7 @@ IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadFromStream(const CFX_WideString &szU } return pStyleSheet; } -IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, FX_INT32 iBufSize, FX_WORD wCodePage, FX_DWORD dwMediaList ) +IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, int32_t iBufSize, FX_WORD wCodePage, FX_DWORD dwMediaList ) { CFDE_CSSStyleSheet *pStyleSheet = FDE_New CFDE_CSSStyleSheet(dwMediaList); if (pStyleSheet == NULL) { @@ -61,7 +61,7 @@ CFDE_CSSStyleSheet::~CFDE_CSSStyleSheet() } void CFDE_CSSStyleSheet::Reset() { - for (FX_INT32 i = m_RuleArray.GetSize() - 1; i >= 0; --i) { + for (int32_t i = m_RuleArray.GetSize() - 1; i >= 0; --i) { IFDE_CSSRule *pRule = m_RuleArray.GetAt(i); switch (pRule->GetType()) { case FDE_CSSRULETYPE_Style: @@ -98,11 +98,11 @@ FX_DWORD CFDE_CSSStyleSheet::Release() } return dwRefCount; } -FX_INT32 CFDE_CSSStyleSheet::CountRules() const +int32_t CFDE_CSSStyleSheet::CountRules() const { return m_RuleArray.GetSize(); } -IFDE_CSSRule* CFDE_CSSStyleSheet::GetRule(FX_INT32 index) +IFDE_CSSRule* CFDE_CSSStyleSheet::GetRule(int32_t index) { return m_RuleArray.GetAt(index); } @@ -122,7 +122,7 @@ FX_BOOL CFDE_CSSStyleSheet::LoadFromStream(const CFX_WideString &szUrl, IFX_Stre m_szUrl = szUrl; return bRet; } -FX_BOOL CFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, FX_INT32 iBufSize, FX_WORD wCodePage) +FX_BOOL CFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, int32_t iBufSize, FX_WORD wCodePage) { FXSYS_assert(pBuffer != NULL && iBufSize > 0); IFDE_CSSSyntaxParser *pSyntax = IFDE_CSSSyntaxParser::Create(); @@ -175,7 +175,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::LoadMediaRule(IFDE_CSSSyntaxParser *pSyn for (;;) { switch (pSyntax->DoSyntaxParse()) { case FDE_CSSSYNTAXSTATUS_MediaType: { - FX_INT32 iLen; + int32_t iLen; FX_LPCWSTR psz = pSyntax->GetCurrentString(iLen); FDE_LPCCSSMEDIATYPETABLE pMediaType = FDE_GetCSSMediaTypeByName(psz, iLen); if (pMediaType != NULL) { @@ -210,7 +210,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::LoadStyleRule(IFDE_CSSSyntaxParser *pSyn m_Selectors.RemoveAt(0, m_Selectors.GetSize()); CFDE_CSSStyleRule *pStyleRule = NULL; FX_LPCWSTR pszValue = NULL; - FX_INT32 iValueLen = 0; + int32_t iValueLen = 0; FDE_CSSPROPERTYARGS propertyArgs; propertyArgs.pStaticStore = m_pAllocator; propertyArgs.pStringCache = &m_StringCache; @@ -270,7 +270,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::LoadFontFaceRule(IFDE_CSSSyntaxParser *p { CFDE_CSSFontFaceRule *pFontFaceRule = NULL; FX_LPCWSTR pszValue = NULL; - FX_INT32 iValueLen = 0; + int32_t iValueLen = 0; FDE_CSSPROPERTYARGS propertyArgs; propertyArgs.pStaticStore = m_pAllocator; propertyArgs.pStringCache = &m_StringCache; @@ -339,13 +339,13 @@ void CFDE_CSSStyleRule::SetSelector(IFX_MEMAllocator *pStaticStore, const CFDE_C FXSYS_assert(m_ppSelector == NULL); m_iSelectors = list.GetSize(); m_ppSelector = (IFDE_CSSSelector**)pStaticStore->Alloc(m_iSelectors * sizeof(IFDE_CSSSelector*)); - for (FX_INT32 i = 0; i < m_iSelectors; ++i) { + for (int32_t i = 0; i < m_iSelectors; ++i) { m_ppSelector[i] = list.GetAt(i); } } CFDE_CSSMediaRule::~CFDE_CSSMediaRule() { - for (FX_INT32 i = m_RuleArray.GetSize() - 1; i >= 0; --i) { + for (int32_t i = m_RuleArray.GetSize() - 1; i >= 0; --i) { IFDE_CSSRule *pRule = m_RuleArray.GetAt(i); switch (pRule->GetType()) { case FDE_CSSRULETYPE_Style: @@ -361,7 +361,7 @@ inline FX_BOOL FDE_IsCSSChar(FX_WCHAR wch) { return (wch >= 'a' && wch <= 'z') || (wch >= 'A' && wch <= 'Z'); } -FX_INT32 FDE_GetCSSPersudoLen(FX_LPCWSTR psz, FX_LPCWSTR pEnd) +int32_t FDE_GetCSSPersudoLen(FX_LPCWSTR psz, FX_LPCWSTR pEnd) { FXSYS_assert(*psz == ':'); FX_LPCWSTR pStart = psz; @@ -375,7 +375,7 @@ FX_INT32 FDE_GetCSSPersudoLen(FX_LPCWSTR psz, FX_LPCWSTR pEnd) } return psz - pStart; } -FX_INT32 FDE_GetCSSNameLen(FX_LPCWSTR psz, FX_LPCWSTR pEnd) +int32_t FDE_GetCSSNameLen(FX_LPCWSTR psz, FX_LPCWSTR pEnd) { FX_LPCWSTR pStart = psz; while (psz < pEnd) { @@ -390,7 +390,7 @@ FX_INT32 FDE_GetCSSNameLen(FX_LPCWSTR psz, FX_LPCWSTR pEnd) } return psz - pStart; } -IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR psz, FX_INT32 iLen) +IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR psz, int32_t iLen) { FXSYS_assert(pStaticStore != NULL && psz != NULL && iLen > 0); FX_LPCWSTR pStart = psz; @@ -420,7 +420,7 @@ IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator *pStaticStore, F pFirst = pLast = p; } FXSYS_assert(pLast != NULL); - FX_INT32 iNameLen = FDE_GetCSSNameLen(++psz, pEnd); + int32_t iNameLen = FDE_GetCSSNameLen(++psz, pEnd); if (iNameLen == 0) { return NULL; } @@ -434,7 +434,7 @@ IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator *pStaticStore, F pLast = p; psz += iNameLen; } else if (FDE_IsCSSChar(wch) || wch == '*') { - FX_INT32 iNameLen = wch == '*' ? 1 : FDE_GetCSSNameLen(psz, pEnd); + int32_t iNameLen = wch == '*' ? 1 : FDE_GetCSSNameLen(psz, pEnd); if (iNameLen == 0) { return NULL; } @@ -451,7 +451,7 @@ IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator *pStaticStore, F } psz += iNameLen; } else if (wch == ':') { - FX_INT32 iNameLen = FDE_GetCSSPersudoLen(psz, pEnd); + int32_t iNameLen = FDE_GetCSSPersudoLen(psz, pEnd); if (iNameLen == 0) { return NULL; } diff --git a/xfa/src/fdp/src/css/fde_cssstylesheet.h b/xfa/src/fdp/src/css/fde_cssstylesheet.h index 04251a0c6b..fea4176171 100644 --- a/xfa/src/fdp/src/css/fde_cssstylesheet.h +++ b/xfa/src/fdp/src/css/fde_cssstylesheet.h @@ -10,7 +10,7 @@ class CFDE_CSSSelector : public IFDE_CSSSelector, public CFX_Target { public: - CFDE_CSSSelector(FDE_CSSSELECTORTYPE eType, FX_LPCWSTR psz, FX_INT32 iLen, FX_BOOL bIgnoreCase) + CFDE_CSSSelector(FDE_CSSSELECTORTYPE eType, FX_LPCWSTR psz, int32_t iLen, FX_BOOL bIgnoreCase) : m_eType(eType), m_dwHash(FX_HashCode_String_GetW(psz, iLen, bIgnoreCase)), m_pNext(NULL) { } @@ -28,13 +28,13 @@ public: { return m_pNext; } - static IFDE_CSSSelector* FromString(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR psz, FX_INT32 iLen); + static IFDE_CSSSelector* FromString(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR psz, int32_t iLen); void SetNext(IFDE_CSSSelector *pNext) { m_pNext = pNext; } protected: - static CFDE_CSSSelector* ParseSelector(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR psz, FX_INT32 &iOff, FX_INT32 iLen, FDE_CSSSELECTORTYPE eType); + static CFDE_CSSSelector* ParseSelector(IFX_MEMAllocator *pStaticStore, FX_LPCWSTR psz, int32_t &iOff, int32_t iLen, FDE_CSSSELECTORTYPE eType); void SetType(FDE_CSSSELECTORTYPE eType) { m_eType = eType; @@ -48,11 +48,11 @@ class CFDE_CSSStyleRule : public IFDE_CSSStyleRule, public CFX_Target { public: CFDE_CSSStyleRule() : m_ppSelector(NULL), m_iSelectors(0) { } - virtual FX_INT32 CountSelectorLists() const + virtual int32_t CountSelectorLists() const { return m_iSelectors; } - virtual IFDE_CSSSelector* GetSelectorList(FX_INT32 index) const + virtual IFDE_CSSSelector* GetSelectorList(int32_t index) const { return m_ppSelector[index]; } @@ -69,7 +69,7 @@ public: protected: CFDE_CSSDeclaration m_Declaration; IFDE_CSSSelector **m_ppSelector; - FX_INT32 m_iSelectors; + int32_t m_iSelectors; }; class CFDE_CSSMediaRule : public IFDE_CSSMediaRule, public CFX_Target { @@ -82,11 +82,11 @@ public: return m_dwMediaList; } - virtual FX_INT32 CountRules() const + virtual int32_t CountRules() const { return m_RuleArray.GetSize(); } - virtual IFDE_CSSRule* GetRule(FX_INT32 index) + virtual IFDE_CSSRule* GetRule(int32_t index) { return m_RuleArray.GetAt(index); } @@ -138,10 +138,10 @@ public: { return m_wCodePage; } - virtual FX_INT32 CountRules() const; - virtual IFDE_CSSRule* GetRule(FX_INT32 index); + virtual int32_t CountRules() const; + virtual IFDE_CSSRule* GetRule(int32_t index); FX_BOOL LoadFromStream(const CFX_WideString &szUrl, IFX_Stream *pStream, FX_WORD wCodePage); - FX_BOOL LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, FX_INT32 iBufSize, FX_WORD wCodePage); + FX_BOOL LoadFromBuffer(const CFX_WideString &szUrl, FX_LPCWSTR pBuffer, int32_t iBufSize, FX_WORD wCodePage); protected: void Reset(); FX_BOOL LoadFromSyntax(IFDE_CSSSyntaxParser *pSyntax); diff --git a/xfa/src/fdp/src/css/fde_csssyntax.cpp b/xfa/src/fdp/src/css/fde_csssyntax.cpp index b7e5da9d6c..f1cb877b32 100644 --- a/xfa/src/fdp/src/css/fde_csssyntax.cpp +++ b/xfa/src/fdp/src/css/fde_csssyntax.cpp @@ -38,20 +38,20 @@ CFDE_CSSSyntaxParser::~CFDE_CSSSyntaxParser() m_TextData.Reset(); m_TextPlane.Reset(); } -FX_BOOL CFDE_CSSSyntaxParser::Init(IFX_Stream *pStream, FX_INT32 iCSSPlaneSize, FX_INT32 iTextDataSize , FX_BOOL bOnlyDeclaration ) +FX_BOOL CFDE_CSSSyntaxParser::Init(IFX_Stream *pStream, int32_t iCSSPlaneSize, int32_t iTextDataSize , FX_BOOL bOnlyDeclaration ) { FXSYS_assert(pStream != NULL && iCSSPlaneSize > 0 && iTextDataSize > 0); Reset(bOnlyDeclaration); if (!m_TextData.EstimateSize(iTextDataSize)) { return FALSE; } - FX_BYTE bom[4]; + uint8_t bom[4]; m_pStream = pStream; m_iStreamPos = m_pStream->GetBOM(bom); m_iPlaneSize = iCSSPlaneSize; return TRUE; } -FX_BOOL CFDE_CSSSyntaxParser::Init(FX_LPCWSTR pBuffer, FX_INT32 iBufferSize, FX_INT32 iTextDatSize , FX_BOOL bOnlyDeclaration ) +FX_BOOL CFDE_CSSSyntaxParser::Init(FX_LPCWSTR pBuffer, int32_t iBufferSize, int32_t iTextDatSize , FX_BOOL bOnlyDeclaration ) { FXSYS_assert(pBuffer != NULL && iBufferSize > 0 && iTextDatSize > 0); Reset(bOnlyDeclaration); @@ -83,7 +83,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSSyntaxParser::DoSyntaxParse() return m_eStatus = FDE_CSSSYNTAXSTATUS_EOS; } FX_BOOL bEOS; - FX_INT32 iLen = m_TextPlane.LoadFromStream(m_pStream, m_iStreamPos, m_iPlaneSize, bEOS); + int32_t iLen = m_TextPlane.LoadFromStream(m_pStream, m_iStreamPos, m_iPlaneSize, bEOS); m_iStreamPos = m_pStream->GetPosition(); if (iLen < 1) { if (m_eMode == FDE_CSSSYNTAXMODE_PropertyValue && m_TextData.GetLength() > 0) { @@ -280,7 +280,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSSyntaxParser::DoSyntaxParse() return m_eStatus = FDE_CSSSYNTAXSTATUS_Error; } if (wch <= ' ' || wch == ';') { - FX_INT32 iURIStart, iURILength = m_TextData.GetLength(); + int32_t iURIStart, iURILength = m_TextData.GetLength(); if (iURILength > 0 && FDE_ParseCSSURI(m_TextData.GetBuffer(), iURILength, iURIStart, iURILength)) { m_TextData.Subtract(iURIStart, iURILength); SwitchMode(FDE_CSSSYNTAXMODE_MediaType); @@ -298,7 +298,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSSyntaxParser::DoSyntaxParse() if (wch > ' ') { AppendChar(wch); } else { - FX_INT32 iLen = m_TextData.GetLength(); + int32_t iLen = m_TextData.GetLength(); FX_LPCWSTR psz = m_TextData.GetBuffer(); if (FXSYS_wcsncmp(L"charset", psz, iLen) == 0) { SwitchMode(FDE_CSSSYNTAXMODE_Charset); @@ -378,7 +378,7 @@ inline FX_BOOL CFDE_CSSSyntaxParser::AppendChar(FX_WCHAR wch) } return FALSE; } -inline FX_INT32 CFDE_CSSSyntaxParser::SaveTextData() +inline int32_t CFDE_CSSSyntaxParser::SaveTextData() { m_iTextDatLen = m_TextData.TrimEnd(); m_TextData.Clear(); @@ -389,9 +389,9 @@ inline void CFDE_CSSSyntaxParser::SwitchMode(FDE_CSSSYNTAXMODE eMode) m_eMode = eMode; SaveTextData(); } -inline FX_INT32 CFDE_CSSSyntaxParser::SwitchToComment() +inline int32_t CFDE_CSSSyntaxParser::SwitchToComment() { - FX_INT32 iLength = m_TextData.GetLength(); + int32_t iLength = m_TextData.GetLength(); m_ModeStack.Push(m_eMode); SwitchMode(FDE_CSSSYNTAXMODE_Comment); return iLength; @@ -406,7 +406,7 @@ inline FX_BOOL CFDE_CSSSyntaxParser::RestoreMode() m_ModeStack.Pop(); return TRUE; } -FX_LPCWSTR CFDE_CSSSyntaxParser::GetCurrentString(FX_INT32 &iLength) const +FX_LPCWSTR CFDE_CSSSyntaxParser::GetCurrentString(int32_t &iLength) const { iLength = m_iTextDatLen; return m_TextData.GetBuffer(); @@ -431,21 +431,21 @@ void CFDE_CSSTextBuf::Reset() } m_iDatPos = m_iDatLen = m_iBufLen; } -FX_BOOL CFDE_CSSTextBuf::AttachBuffer(FX_LPCWSTR pBuffer, FX_INT32 iBufLen) +FX_BOOL CFDE_CSSTextBuf::AttachBuffer(FX_LPCWSTR pBuffer, int32_t iBufLen) { Reset(); m_pBuffer = (FX_LPWSTR)pBuffer; m_iDatLen = m_iBufLen = iBufLen; return m_bExtBuf = TRUE; } -FX_BOOL CFDE_CSSTextBuf::EstimateSize(FX_INT32 iAllocSize) +FX_BOOL CFDE_CSSTextBuf::EstimateSize(int32_t iAllocSize) { FXSYS_assert(iAllocSize > 0); Clear(); m_bExtBuf = FALSE; return ExpandBuf(iAllocSize); } -FX_INT32 CFDE_CSSTextBuf::LoadFromStream(IFX_Stream *pTxtStream, FX_INT32 iStreamOffset, FX_INT32 iMaxChars, FX_BOOL &bEOS) +int32_t CFDE_CSSTextBuf::LoadFromStream(IFX_Stream *pTxtStream, int32_t iStreamOffset, int32_t iMaxChars, FX_BOOL &bEOS) { FXSYS_assert(iStreamOffset >= 0 && iMaxChars > 0); Clear(); @@ -461,7 +461,7 @@ FX_INT32 CFDE_CSSTextBuf::LoadFromStream(IFX_Stream *pTxtStream, FX_INT32 iStrea pTxtStream->Unlock(); return m_iDatLen; } -FX_BOOL CFDE_CSSTextBuf::ExpandBuf(FX_INT32 iDesiredSize) +FX_BOOL CFDE_CSSTextBuf::ExpandBuf(int32_t iDesiredSize) { if (m_bExtBuf) { return FALSE; @@ -480,7 +480,7 @@ FX_BOOL CFDE_CSSTextBuf::ExpandBuf(FX_INT32 iDesiredSize) return TRUE; } } -void CFDE_CSSTextBuf::Subtract(FX_INT32 iStart, FX_INT32 iLength) +void CFDE_CSSTextBuf::Subtract(int32_t iStart, int32_t iLength) { FXSYS_assert(iStart >= 0 && iLength > 0); if (iLength > m_iDatLen - iStart) { diff --git a/xfa/src/fdp/src/css/fde_csssyntax.h b/xfa/src/fdp/src/css/fde_csssyntax.h index c18e0f9717..4ab132d2c8 100644 --- a/xfa/src/fdp/src/css/fde_csssyntax.h +++ b/xfa/src/fdp/src/css/fde_csssyntax.h @@ -11,9 +11,9 @@ class CFDE_CSSTextBuf : public CFX_Target public: CFDE_CSSTextBuf(); ~CFDE_CSSTextBuf(); - FX_BOOL AttachBuffer(FX_LPCWSTR pBuffer, FX_INT32 iBufLen); - FX_BOOL EstimateSize(FX_INT32 iAllocSize); - FX_INT32 LoadFromStream(IFX_Stream *pTxtStream, FX_INT32 iStreamOffset, FX_INT32 iMaxChars, FX_BOOL &bEOS); + FX_BOOL AttachBuffer(FX_LPCWSTR pBuffer, int32_t iBufLen); + FX_BOOL EstimateSize(int32_t iAllocSize); + int32_t LoadFromStream(IFX_Stream *pTxtStream, int32_t iStreamOffset, int32_t iMaxChars, FX_BOOL &bEOS); FX_BOOL AppendChar(FX_WCHAR wch) { if (m_iDatLen >= m_iBufLen && !ExpandBuf(m_iBufLen * 2)) { @@ -26,7 +26,7 @@ public: m_iDatPos = m_iDatLen = 0; } void Reset(); - FX_INT32 TrimEnd() + int32_t TrimEnd() { while (m_iDatLen > 0 && m_pBuffer[m_iDatLen - 1] <= ' ') { --m_iDatLen; @@ -34,12 +34,12 @@ public: AppendChar(0); return --m_iDatLen; } - void Subtract(FX_INT32 iStart, FX_INT32 iLength); + void Subtract(int32_t iStart, int32_t iLength); FX_BOOL IsEOF() const { return m_iDatPos >= m_iDatLen; } - FX_WCHAR GetAt(FX_INT32 index) const + FX_WCHAR GetAt(int32_t index) const { return m_pBuffer[index]; } @@ -55,7 +55,7 @@ public: { m_iDatPos++; } - FX_INT32 GetLength() const + int32_t GetLength() const { return m_iDatLen; } @@ -64,12 +64,12 @@ public: return m_pBuffer; } protected: - FX_BOOL ExpandBuf(FX_INT32 iDesiredSize); + FX_BOOL ExpandBuf(int32_t iDesiredSize); FX_BOOL m_bExtBuf; FX_LPWSTR m_pBuffer; - FX_INT32 m_iBufLen; - FX_INT32 m_iDatLen; - FX_INT32 m_iDatPos; + int32_t m_iBufLen; + int32_t m_iDatLen; + int32_t m_iDatPos; }; #define FDE_CSSSYNTAXCHECK_AllowCharset 1 #define FDE_CSSSYNTAXCHECK_AllowImport 2 @@ -96,18 +96,18 @@ public: { FDE_Delete this; } - virtual FX_BOOL Init(IFX_Stream *pStream, FX_INT32 iCSSPlaneSize, FX_INT32 iTextDataSize = 32, FX_BOOL bOnlyDeclaration = FALSE); - virtual FX_BOOL Init(FX_LPCWSTR pBuffer, FX_INT32 iBufferSize, FX_INT32 iTextDatSize = 32, FX_BOOL bOnlyDeclaration = FALSE); + virtual FX_BOOL Init(IFX_Stream *pStream, int32_t iCSSPlaneSize, int32_t iTextDataSize = 32, FX_BOOL bOnlyDeclaration = FALSE); + virtual FX_BOOL Init(FX_LPCWSTR pBuffer, int32_t iBufferSize, int32_t iTextDatSize = 32, FX_BOOL bOnlyDeclaration = FALSE); virtual FDE_CSSSYNTAXSTATUS DoSyntaxParse(); - virtual FX_LPCWSTR GetCurrentString(FX_INT32 &iLength) const; + virtual FX_LPCWSTR GetCurrentString(int32_t &iLength) const; protected: void Reset(FX_BOOL bOnlyDeclaration); void SwitchMode(FDE_CSSSYNTAXMODE eMode); - FX_INT32 SwitchToComment(); + int32_t SwitchToComment(); FX_BOOL RestoreMode(); FX_BOOL AppendChar(FX_WCHAR wch); - FX_INT32 SaveTextData(); + int32_t SaveTextData(); FX_BOOL IsCharsetEnabled() const { return (m_dwCheck & FDE_CSSSYNTAXCHECK_AllowCharset) != 0; @@ -122,11 +122,11 @@ protected: m_dwCheck = 0; } IFX_Stream *m_pStream; - FX_INT32 m_iStreamPos; - FX_INT32 m_iPlaneSize; + int32_t m_iStreamPos; + int32_t m_iPlaneSize; CFDE_CSSTextBuf m_TextData; CFDE_CSSTextBuf m_TextPlane; - FX_INT32 m_iTextDatLen; + int32_t m_iTextDatLen; FX_DWORD m_dwCheck; FDE_CSSSYNTAXMODE m_eMode; FDE_CSSSYNTAXSTATUS m_eStatus; diff --git a/xfa/src/fdp/src/fde/fde_devbasic.cpp b/xfa/src/fdp/src/fde/fde_devbasic.cpp index 780f1188c8..f6e893ef2e 100644 --- a/xfa/src/fdp/src/fde/fde_devbasic.cpp +++ b/xfa/src/fdp/src/fde/fde_devbasic.cpp @@ -61,7 +61,7 @@ static const FDE_HATCHDATA gs_HatchBitmapData[FDE_HATCHSTYLE_Total] = { {16, 16, {0x82, 0x82, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x82, 0x82, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x82, 0x82, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x82, 0x82, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,}}, {16, 16, {0x10, 0x10, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}}, }; -FDE_LPCHATCHDATA FDE_DEVGetHatchData(FX_INT32 iHatchStyle) +FDE_LPCHATCHDATA FDE_DEVGetHatchData(int32_t iHatchStyle) { if (iHatchStyle < FDE_HATCHSTYLE_Min || iHatchStyle > FDE_HATCHSTYLE_Max) { return NULL; diff --git a/xfa/src/fdp/src/fde/fde_devbasic.h b/xfa/src/fdp/src/fde/fde_devbasic.h index 36d2471b2c..caf52a9327 100644 --- a/xfa/src/fdp/src/fde/fde_devbasic.h +++ b/xfa/src/fdp/src/fde/fde_devbasic.h @@ -7,10 +7,10 @@ #ifndef _FDE_DEVICE_BASIC_IMP #define _FDE_DEVICE_BASIC_IMP struct FDE_HATCHDATA { - FX_INT32 iWidth; - FX_INT32 iHeight; - FX_BYTE MaskBits[64]; + int32_t iWidth; + int32_t iHeight; + uint8_t MaskBits[64]; }; typedef FDE_HATCHDATA const * FDE_LPCHATCHDATA; -FDE_LPCHATCHDATA FDE_DEVGetHatchData(FX_INT32 iHatchStyle); +FDE_LPCHATCHDATA FDE_DEVGetHatchData(int32_t iHatchStyle); #endif diff --git a/xfa/src/fdp/src/fde/fde_gdidevice.cpp b/xfa/src/fdp/src/fde/fde_gdidevice.cpp index ad7f6cc9e5..7f773efd96 100644 --- a/xfa/src/fdp/src/fde/fde_gdidevice.cpp +++ b/xfa/src/fdp/src/fde/fde_gdidevice.cpp @@ -47,11 +47,11 @@ CFDE_GdiDevice::~CFDE_GdiDevice() FDE_Free(m_pGlyphBuf); } } -FX_INT32 CFDE_GdiDevice::GetWidth() const +int32_t CFDE_GdiDevice::GetWidth() const { return m_pBitmap->GetWidth(); } -FX_INT32 CFDE_GdiDevice::GetHeight() const +int32_t CFDE_GdiDevice::GetHeight() const { return m_pBitmap->GetHeight(); } @@ -144,7 +144,7 @@ FX_BOOL CFDE_GdiDevice::DrawImage(CFX_DIBSource *pDib, const CFX_RectF *pSrcRect CFDE_GdiImage img(&bmp); return DrawImage(&img, pSrcRect, dstRect, pImgMatrix, pDevMatrix); } -FX_BOOL CFDE_GdiDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix) +FX_BOOL CFDE_GdiDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix) { FXSYS_assert(pBrush != NULL && pFont != NULL && pCharPos != NULL); FX_ARGB argb = 0xFF000000; diff --git a/xfa/src/fdp/src/fde/fde_gdidevice.h b/xfa/src/fdp/src/fde/fde_gdidevice.h index c22ed2b4ba..86f7bac176 100644 --- a/xfa/src/fdp/src/fde/fde_gdidevice.h +++ b/xfa/src/fdp/src/fde/fde_gdidevice.h @@ -20,8 +20,8 @@ public: FDE_Delete this; } - virtual FX_INT32 GetWidth() const; - virtual FX_INT32 GetHeight() const; + virtual int32_t GetWidth() const; + virtual int32_t GetHeight() const; virtual FDE_HDEVICESTATE SaveState(); virtual void RestoreState(FDE_HDEVICESTATE hState); virtual FX_BOOL SetClipPath(const IFDE_Path *pClip); @@ -34,7 +34,7 @@ public: virtual FX_BOOL DrawImage(CFX_DIBSource *pDib, const CFX_RectF *pSrcRect, const CFX_RectF &dstRect, const CFX_Matrix *pImgMatrix = NULL, const CFX_Matrix *pDevMatrix = NULL); virtual FX_BOOL DrawImage(IFDE_Image *pImg, const CFX_RectF *pSrcRect, const CFX_RectF &dstRect, const CFX_Matrix *pImgMatrix = NULL, const CFX_Matrix *pDevMatrix = NULL); - virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL); + virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL); virtual FX_BOOL DrawArc(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_RectF &rect, FX_FLOAT startAngle, FX_FLOAT sweepAngle, const CFX_Matrix *pMatrix = NULL); virtual FX_BOOL DrawBezier(IFDE_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 = NULL); virtual FX_BOOL DrawCurve(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fTension = 0.5f, const CFX_Matrix *pMatrix = NULL); diff --git a/xfa/src/fdp/src/fde/fde_gedevice.cpp b/xfa/src/fdp/src/fde/fde_gedevice.cpp index 81d7ef5a0c..1ecbb1434b 100644 --- a/xfa/src/fdp/src/fde/fde_gedevice.cpp +++ b/xfa/src/fdp/src/fde/fde_gedevice.cpp @@ -12,7 +12,7 @@ #ifdef _cplusplus exten "C" { #endif - FX_BOOL FDE_GetStockHatchMask(FX_INT32 iHatchStyle, CFX_DIBitmap & hatchMask) + FX_BOOL FDE_GetStockHatchMask(int32_t iHatchStyle, CFX_DIBitmap & hatchMask) { FDE_LPCHATCHDATA pData = FDE_DEVGetHatchData(iHatchStyle); if (!pData) { @@ -63,11 +63,11 @@ CFDE_FxgeDevice::~CFDE_FxgeDevice() delete m_pDevice; } } -FX_INT32 CFDE_FxgeDevice::GetWidth() const +int32_t CFDE_FxgeDevice::GetWidth() const { return m_pDevice->GetWidth(); } -FX_INT32 CFDE_FxgeDevice::GetHeight() const +int32_t CFDE_FxgeDevice::GetHeight() const { return m_pDevice->GetHeight(); } @@ -85,8 +85,8 @@ void CFDE_FxgeDevice::RestoreState(FDE_HDEVICESTATE hState) FX_BOOL CFDE_FxgeDevice::SetClipRect(const CFX_RectF &rtClip) { m_rtClip = rtClip; - FX_RECT rt((FX_INT32)FXSYS_floor(rtClip.left), (FX_INT32)FXSYS_floor(rtClip.top), - (FX_INT32)FXSYS_ceil(rtClip.right()), (FX_INT32)FXSYS_ceil(rtClip.bottom())); + FX_RECT rt((int32_t)FXSYS_floor(rtClip.left), (int32_t)FXSYS_floor(rtClip.top), + (int32_t)FXSYS_ceil(rtClip.right()), (int32_t)FXSYS_ceil(rtClip.bottom())); return m_pDevice->SetClip_Rect(&rt); } const CFX_RectF& CFDE_FxgeDevice::GetClipRect() @@ -140,7 +140,7 @@ FX_BOOL CFDE_FxgeDevice::DrawImage(CFX_DIBSource *pDib, const CFX_RectF *pSrcRec m_pDevice->CancelDIBits(handle); return handle != NULL; } -FX_BOOL CFDE_FxgeDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix) +FX_BOOL CFDE_FxgeDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix) { FXSYS_assert(pBrush != NULL && pFont != NULL && pCharPos != NULL && iCount > 0); CFX_FontCache *pCache = CFX_GEModule::Get()->GetFontCache(); @@ -151,7 +151,7 @@ FX_BOOL CFDE_FxgeDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const F if ((pFont->GetFontStyles() & FX_FONTSTYLE_Italic) != 0 && !pFxFont->IsItalic()) { FXTEXT_CHARPOS *pCP = (FXTEXT_CHARPOS*)pCharPos; FX_FLOAT *pAM; - for (FX_INT32 i = 0; i < iCount; ++i) { + for (int32_t i = 0; i < iCount; ++i) { static const FX_FLOAT mc = 0.267949f; pAM = pCP->m_AdjustMatrix; pAM[2] = mc * pAM[0] + pAM[2]; @@ -163,7 +163,7 @@ FX_BOOL CFDE_FxgeDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const F IFX_Font *pCurFont = NULL; IFX_Font *pSTFont = NULL; FXTEXT_CHARPOS *pCurCP = NULL; - FX_INT32 iCurCount = 0; + int32_t iCurCount = 0; #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ FX_DWORD dwFontStyle = pFont->GetFontStyles(); CFX_Font FxFont; @@ -174,8 +174,8 @@ FX_BOOL CFDE_FxgeDevice::DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const F SubstFxFont.m_ItalicAngle = dwFontStyle & FX_FONTSTYLE_Italic ? -12 : 0; SubstFxFont.m_bItlicCJK = dwFontStyle & FX_FONTSTYLE_Italic ? TRUE : FALSE; #endif - for (FX_INT32 i = 0; i < iCount; ++i) { - pSTFont = pFont->GetSubstFont((FX_INT32)pCP->m_GlyphIndex); + for (int32_t i = 0; i < iCount; ++i) { + pSTFont = pFont->GetSubstFont((int32_t)pCP->m_GlyphIndex); pCP->m_GlyphIndex &= 0x00FFFFFF; pCP->m_bFontStyle = FALSE; if (pCurFont != pSTFont) { @@ -340,10 +340,10 @@ FX_BOOL CFDE_FxgeDevice::CreatePen(IFDE_Pen *pPen, FX_FLOAT fPenWidth, CFX_Graph pPen->GetDashArray(dashArray); break; } - FX_INT32 iDashCount = dashArray.GetSize(); + int32_t iDashCount = dashArray.GetSize(); if (iDashCount > 0) { graphState.SetDashCount(iDashCount); - for (FX_INT32 i = 0; i < iDashCount; ++i) { + for (int32_t i = 0; i < iDashCount; ++i) { graphState.m_DashArray[i] = dashArray[i] * fPenWidth; } } @@ -365,7 +365,7 @@ FX_BOOL CFDE_FxgeDevice::FillPath(IFDE_Brush *pBrush, const IFDE_Path *pPath, co if (pBrush == NULL) { return FALSE; } - FX_INT32 iType = pBrush->GetType(); + int32_t iType = pBrush->GetType(); if (iType < 0 || iType > FDE_BRUSHTYPE_MAX) { return FALSE; } @@ -381,7 +381,7 @@ FX_BOOL CFDE_FxgeDevice::FillHatchPath(IFDE_Brush *pBrush, const CFX_PathData *p { FXSYS_assert(pPath && pBrush && pBrush->GetType() == FDE_BRUSHTYPE_Hatch); IFDE_HatchBrush *pHatchBrush = (IFDE_HatchBrush*)pBrush; - FX_INT32 iStyle = pHatchBrush->GetHatchStyle(); + int32_t iStyle = pHatchBrush->GetHatchStyle(); if (iStyle < FDE_HATCHSTYLE_Min || iStyle > FDE_HATCHSTYLE_Max) { return FALSE; } @@ -401,8 +401,8 @@ FX_BOOL CFDE_FxgeDevice::FillHatchPath(IFDE_Brush *pBrush, const CFX_PathData *p m_pDevice->StartRendering(); m_pDevice->SetClip_PathFill(pPath, (const CFX_AffineMatrix*)pMatrix, FXFILL_WINDING); m_pDevice->FillRect(&rect, dwBackColor); - for (FX_INT32 j = rect.bottom; j < rect.top; j += mask.GetHeight()) - for (FX_INT32 i = rect.left; i < rect.right; i += mask.GetWidth()) { + for (int32_t j = rect.bottom; j < rect.top; j += mask.GetHeight()) + for (int32_t i = rect.left; i < rect.right; i += mask.GetWidth()) { m_pDevice->SetBitMask(&mask, i, j, dwForeColor); } m_pDevice->EndRendering(); @@ -430,7 +430,7 @@ FX_BOOL CFDE_FxgeDevice::FillTexturePath(IFDE_Brush *pBrush, const CFX_PathData pImage->StopLoadImage(); return WrapTexture(pTextureBrush->GetWrapMode(), &bmp, pPath, pMatrix); } -FX_BOOL CFDE_FxgeDevice::WrapTexture(FX_INT32 iWrapMode, const CFX_DIBitmap *pBitmap, const CFX_PathData *pPath, const CFX_Matrix *pMatrix) +FX_BOOL CFDE_FxgeDevice::WrapTexture(int32_t iWrapMode, const CFX_DIBitmap *pBitmap, const CFX_PathData *pPath, const CFX_Matrix *pMatrix) { CFX_FloatRect rectf = pPath->GetBoundingBox(); if (pMatrix) { @@ -457,12 +457,12 @@ FX_BOOL CFDE_FxgeDevice::WrapTexture(FX_INT32 iWrapMode, const CFX_DIBitmap *pBi pFlip[0][1] = bFlipX ? pBitmap->FlipImage(TRUE, FALSE) : pBitmap; pFlip[1][0] = bFlipY ? pBitmap->FlipImage(FALSE, TRUE) : pBitmap; pFlip[1][1] = (bFlipX || bFlipY) ? pBitmap->FlipImage(bFlipX, bFlipY) : pBitmap; - FX_INT32 iCounterY = 0; - for (FX_INT32 j = rect.top; j < rect.bottom; j += pBitmap->GetHeight()) { - FX_INT32 indexY = iCounterY++ % 2; - FX_INT32 iCounterX = 0; - for (FX_INT32 i = rect.left; i < rect.right; i += pBitmap->GetWidth()) { - FX_INT32 indexX = iCounterX++ % 2; + int32_t iCounterY = 0; + for (int32_t j = rect.top; j < rect.bottom; j += pBitmap->GetHeight()) { + int32_t indexY = iCounterY++ % 2; + int32_t iCounterX = 0; + for (int32_t i = rect.left; i < rect.right; i += pBitmap->GetWidth()) { + int32_t indexX = iCounterX++ % 2; m_pDevice->SetDIBits(pFlip[indexY][indexX], i, j); } } @@ -516,7 +516,7 @@ FX_BOOL CFDE_FxgeDevice::FillLinearGradientPath(IFDE_Brush *pBrush, const CFX_Pa CFX_FxgeDevice dev; dev.Attach(&bmp); pt1 = pt0; - FX_INT32 iSteps = FXSYS_round(FXSYS_ceil(fSteps)); + int32_t iSteps = FXSYS_round(FXSYS_ceil(fSteps)); while (--iSteps >= 0) { cr0 = ArgbEncode(FXSYS_round(a0), FXSYS_round(r0), FXSYS_round(g0), FXSYS_round(b0)); dev.DrawCosmeticLine(pt0.x, pt0.y, pt1.x, pt1.y, cr0); diff --git a/xfa/src/fdp/src/fde/fde_gedevice.h b/xfa/src/fdp/src/fde/fde_gedevice.h index 6290e53390..ab16cc7cae 100644 --- a/xfa/src/fdp/src/fde/fde_gedevice.h +++ b/xfa/src/fdp/src/fde/fde_gedevice.h @@ -17,8 +17,8 @@ public: FDE_Delete this; } - virtual FX_INT32 GetWidth() const; - virtual FX_INT32 GetHeight() const; + virtual int32_t GetWidth() const; + virtual int32_t GetHeight() const; virtual FDE_HDEVICESTATE SaveState(); virtual void RestoreState(FDE_HDEVICESTATE hState); virtual FX_BOOL SetClipPath(const IFDE_Path *pClip); @@ -30,7 +30,7 @@ public: virtual FX_FLOAT GetDpiY() const; virtual FX_BOOL DrawImage(CFX_DIBSource *pDib, const CFX_RectF *pSrcRect, const CFX_RectF &dstRect, const CFX_Matrix *pImgMatrix = NULL, const CFX_Matrix *pDevMatrix = NULL); - virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL); + virtual FX_BOOL DrawString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix = NULL); virtual FX_BOOL DrawBezier(IFDE_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 = NULL); virtual FX_BOOL DrawCurve(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fTension = 0.5f, const CFX_Matrix *pMatrix = NULL); virtual FX_BOOL DrawEllipse(IFDE_Pen *pPen, FX_FLOAT fPenWidth, const CFX_RectF &rect, const CFX_Matrix *pMatrix = NULL); @@ -48,16 +48,16 @@ public: FX_BOOL FillHatchPath(IFDE_Brush *pBrush, const CFX_PathData *pPath, const CFX_Matrix *pMatrix); FX_BOOL FillTexturePath(IFDE_Brush *pBrush, const CFX_PathData *pPath, const CFX_Matrix *pMatrix); FX_BOOL FillLinearGradientPath(IFDE_Brush *pBrush, const CFX_PathData *pPath, const CFX_Matrix *pMatrix); - FX_BOOL DrawSolidString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix); - FX_BOOL DrawStringPath(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, FX_INT32 iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix); + FX_BOOL DrawSolidString(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix); + FX_BOOL DrawStringPath(IFDE_Brush *pBrush, IFX_Font *pFont, const FXTEXT_CHARPOS *pCharPos, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix *pMatrix); protected: FX_BOOL CreatePen(IFDE_Pen *pPen, FX_FLOAT fPenWidth, CFX_GraphStateData &graphState); - FX_BOOL WrapTexture(FX_INT32 iWrapMode, const CFX_DIBitmap *pBitmap, const CFX_PathData *pPath, const CFX_Matrix *pMatrix); + FX_BOOL WrapTexture(int32_t iWrapMode, const CFX_DIBitmap *pBitmap, const CFX_PathData *pPath, const CFX_Matrix *pMatrix); CFX_RenderDevice *m_pDevice; CFX_RectF m_rtClip; FX_BOOL m_bOwnerDevice; FXTEXT_CHARPOS *m_pCharPos; - FX_INT32 m_iCharCount; + int32_t m_iCharCount; }; #endif #endif diff --git a/xfa/src/fdp/src/fde/fde_geobject.cpp b/xfa/src/fdp/src/fde/fde_geobject.cpp index 9f34cf3051..819563619e 100644 --- a/xfa/src/fdp/src/fde/fde_geobject.cpp +++ b/xfa/src/fdp/src/fde/fde_geobject.cpp @@ -24,12 +24,12 @@ FX_BOOL CFDE_Path::CloseFigure() } return TRUE; } -FX_PATHPOINT* CFDE_Path::GetLastPoint(FX_INT32 iCount ) const +FX_PATHPOINT* CFDE_Path::GetLastPoint(int32_t iCount ) const { if (iCount < 1) { return NULL; } - FX_INT32 iPoints = m_Path.GetPointCount(); + int32_t iPoints = m_Path.GetPointCount(); if (iCount > iPoints) { return NULL; } @@ -40,12 +40,12 @@ FX_BOOL CFDE_Path::FigureClosed() const FX_PATHPOINT *pPoint = GetLastPoint(); return pPoint ? (pPoint->m_Flag & FXPT_CLOSEFIGURE) : TRUE; } -FX_PATHPOINT* CFDE_Path::AddPoints(FX_INT32 iCount) +FX_PATHPOINT* CFDE_Path::AddPoints(int32_t iCount) { if (iCount < 1) { return NULL; } - FX_INT32 iPoints = m_Path.GetPointCount(); + int32_t iPoints = m_Path.GetPointCount(); m_Path.AddPointCount(iCount); return m_Path.GetPoints() + iPoints; } @@ -121,7 +121,7 @@ void CFDE_Path::AddBezier(const CFX_PointsF &points) } void CFDE_Path::AddBeziers(const CFX_PointsF &points) { - FX_INT32 iCount = points.GetSize(); + int32_t iCount = points.GetSize(); if (iCount < 4) { return; } @@ -134,7 +134,7 @@ void CFDE_Path::AddBeziers(const CFX_PointsF &points) } void CFDE_Path::GetCurveTangents(const CFX_PointsF &points, CFX_PointsF &tangents, FX_BOOL bClosed, FX_FLOAT fTension) const { - FX_INT32 iCount = points.GetSize(); + int32_t iCount = points.GetSize(); tangents.SetSize(iCount); if (iCount < 3) { return; @@ -142,9 +142,9 @@ void CFDE_Path::GetCurveTangents(const CFX_PointsF &points, CFX_PointsF &tangent FX_FLOAT fCoefficient = fTension / 3.0f; FX_LPCPOINTF pPoints = points.GetData(); FX_LPPOINTF pTangents = tangents.GetData(); - for (FX_INT32 i = 0; i < iCount; ++i) { - FX_INT32 r = i + 1; - FX_INT32 s = i - 1; + for (int32_t i = 0; i < iCount; ++i) { + int32_t r = i + 1; + int32_t s = i - 1; if (r >= iCount) { r = bClosed ? (r - iCount) : (iCount - 1); } @@ -157,7 +157,7 @@ void CFDE_Path::GetCurveTangents(const CFX_PointsF &points, CFX_PointsF &tangent } void CFDE_Path::AddCurve(const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fTension) { - FX_INT32 iLast = points.GetUpperBound(); + int32_t iLast = points.GetUpperBound(); if (iLast < 1) { return; } @@ -166,8 +166,8 @@ void CFDE_Path::AddCurve(const CFX_PointsF &points, FX_BOOL bClosed, FX_FLOAT fT FX_LPCPOINTF pPoints = points.GetData(); FX_LPPOINTF pTangents = tangents.GetData(); MoveTo(pPoints[0]); - for (FX_INT32 i = 0; i < iLast; ++i) { - FX_INT32 j = i + 1; + for (int32_t i = 0; i < iLast; ++i) { + int32_t j = i + 1; CFX_PointF p1; p1.Set(pPoints[i].x + pTangents[i].x, pPoints[i].y + pTangents[i].y); CFX_PointF p2; @@ -191,7 +191,7 @@ void CFDE_Path::AddEllipse(const CFX_RectF &rect) { FX_FLOAT fStartAngle = 0; FX_FLOAT fEndAngle = FX_PI / 2; - for (FX_INT32 i = 0; i < 4; ++i) { + for (int32_t i = 0; i < 4; ++i) { ArcTo(i == 0, rect, fStartAngle, fEndAngle); fStartAngle += FX_PI / 2; fEndAngle += FX_PI / 2; @@ -212,7 +212,7 @@ void CFDE_Path::AddPath(const IFDE_Path *pSrc, FX_BOOL bConnect) if (pPath == NULL) { return; } - FX_INT32 iCount = pPath->m_Path.GetPointCount(); + int32_t iCount = pPath->m_Path.GetPointCount(); if (iCount < 1) { return; } @@ -223,7 +223,7 @@ void CFDE_Path::AddPath(const IFDE_Path *pSrc, FX_BOOL bConnect) } void CFDE_Path::AddPolygon(const CFX_PointsF &points) { - FX_INT32 iCount = points.GetSize(); + int32_t iCount = points.GetSize(); if (iCount < 2) { return; } @@ -236,7 +236,7 @@ void CFDE_Path::AddPolygon(const CFX_PointsF &points) } void CFDE_Path::AddLines(const CFX_PointsF &points) { - FX_INT32 iCount = points.GetSize(); + int32_t iCount = points.GetSize(); if (iCount < 2) { return; } diff --git a/xfa/src/fdp/src/fde/fde_geobject.h b/xfa/src/fdp/src/fde/fde_geobject.h index 8552b6f7b8..3b1b22901d 100644 --- a/xfa/src/fdp/src/fde/fde_geobject.h +++ b/xfa/src/fdp/src/fde/fde_geobject.h @@ -31,8 +31,8 @@ public: virtual void AddRectangle(const CFX_RectF &rect); virtual void GetBBox(CFX_RectF &bbox) const; virtual void GetBBox(CFX_RectF &bbox, FX_FLOAT fLineWidth, FX_FLOAT fMiterLimit) const; - FX_PATHPOINT* AddPoints(FX_INT32 iCount); - FX_PATHPOINT* GetLastPoint(FX_INT32 iCount = 1) const; + FX_PATHPOINT* AddPoints(int32_t iCount); + FX_PATHPOINT* GetLastPoint(int32_t iCount = 1) const; FX_BOOL FigureClosed() const; void MoveTo(FX_FLOAT fx, FX_FLOAT fy); void LineTo(FX_FLOAT fx, FX_FLOAT fy); diff --git a/xfa/src/fdp/src/fde/fde_object.cpp b/xfa/src/fdp/src/fde/fde_object.cpp index d8a555a7bd..71a1b43991 100644 --- a/xfa/src/fdp/src/fde/fde_object.cpp +++ b/xfa/src/fdp/src/fde/fde_object.cpp @@ -10,7 +10,7 @@ IFDE_Pen* IFDE_Pen::Create() { return FDE_New CFDE_Pen(); } -IFDE_Brush* IFDE_Brush::Create(FX_INT32 iType) +IFDE_Brush* IFDE_Brush::Create(int32_t iType) { switch (iType) { case FDE_BRUSHTYPE_Solid: diff --git a/xfa/src/fdp/src/fde/fde_object.h b/xfa/src/fdp/src/fde/fde_object.h index 553d77fb21..190865f612 100644 --- a/xfa/src/fdp/src/fde/fde_object.h +++ b/xfa/src/fdp/src/fde/fde_object.h @@ -32,7 +32,7 @@ public: FDE_Delete this; } - virtual FX_INT32 GetType() const + virtual int32_t GetType() const { return m_pBrush ? m_pBrush->GetType() : FDE_PENTYPE_SolidColor; } @@ -57,19 +57,19 @@ public: m_Color = ((IFDE_SolidBrush*)m_pBrush)->GetColor(); } } - virtual FX_INT32 GetLineCap() const + virtual int32_t GetLineCap() const { return m_iLineCap; } - virtual void SetLineCap(FX_INT32 iLineCap) + virtual void SetLineCap(int32_t iLineCap) { m_iLineCap = iLineCap; } - virtual FX_INT32 GetDashStyle() const + virtual int32_t GetDashStyle() const { return m_iDashStyle; } - virtual void SetDashStyle(FX_INT32 iDashStyle) + virtual void SetDashStyle(int32_t iDashStyle) { m_iDashStyle = iDashStyle; } @@ -81,11 +81,11 @@ public: { m_fDashPhase = fPhase; } - virtual FX_INT32 CountDashArray() const + virtual int32_t CountDashArray() const { return m_DashArray.GetSize(); } - virtual FX_INT32 GetDashArray(CFX_FloatArray &dashArray) const + virtual int32_t GetDashArray(CFX_FloatArray &dashArray) const { dashArray.Copy(m_DashArray); return dashArray.GetSize(); @@ -94,11 +94,11 @@ public: { m_DashArray.Copy(dashArray); } - virtual FX_INT32 GetLineJoin() const + virtual int32_t GetLineJoin() const { return m_iLineJoin; } - virtual void SetLineJoin(FX_INT32 iLineJoin) + virtual void SetLineJoin(int32_t iLineJoin) { m_iLineJoin = iLineJoin; } @@ -110,7 +110,7 @@ public: { m_fMiterLimit = fMiterLimit; } - virtual FX_INT32 CountCompoundPatterns() const + virtual int32_t CountCompoundPatterns() const { return m_CompoundPatterns.GetSize(); } @@ -124,9 +124,9 @@ public: } FX_ARGB m_Color; - FX_INT32 m_iLineCap; - FX_INT32 m_iLineJoin; - FX_INT32 m_iDashStyle; + int32_t m_iLineCap; + int32_t m_iLineJoin; + int32_t m_iDashStyle; FX_FLOAT m_fDashPhase; FX_FLOAT m_fMiterLimit; FX_BOOL m_bAutoRelease; @@ -146,7 +146,7 @@ public: { FDE_Delete this; } - virtual FX_INT32 GetType() const + virtual int32_t GetType() const { return FDE_BRUSHTYPE_Solid; } @@ -202,7 +202,7 @@ public: { FDE_Delete this; } - virtual FX_INT32 GetType() const + virtual int32_t GetType() const { return FDE_BRUSHTYPE_Hatch; } @@ -247,16 +247,16 @@ public: } } - virtual FX_INT32 GetHatchStyle() const + virtual int32_t GetHatchStyle() const { return m_iStyle; }; - virtual FX_BOOL SetHatchStyle(FX_INT32 iHatchStyle) + virtual FX_BOOL SetHatchStyle(int32_t iHatchStyle) { m_iStyle = iHatchStyle; return m_iStyle >= FDE_HATCHSTYLE_Min && m_iStyle <= FDE_HATCHSTYLE_Max; } - FX_INT32 m_iStyle; + int32_t m_iStyle; FX_ARGB m_BackColor; FX_ARGB m_ForeColor; CFX_Matrix m_Matrix; @@ -276,7 +276,7 @@ public: { FDE_Delete this; } - virtual FX_INT32 GetType() const + virtual int32_t GetType() const { return FDE_BRUSHTYPE_Texture; } @@ -317,15 +317,15 @@ public: m_pImage = pImage; m_bAutoRelease = bAutoRelease; } - virtual FX_INT32 GetWrapMode() const + virtual int32_t GetWrapMode() const { return m_iWrap; } - virtual void SetWrapMode(FX_INT32 iWrapMode) + virtual void SetWrapMode(int32_t iWrapMode) { m_iWrap = iWrapMode; } - FX_INT32 m_iWrap; + int32_t m_iWrap; IFDE_Image *m_pImage; FX_BOOL m_bAutoRelease; CFX_Matrix m_Matrix; @@ -343,7 +343,7 @@ public: { FDE_Delete this; } - virtual FX_INT32 GetType() const + virtual int32_t GetType() const { return FDE_BRUSHTYPE_LinearGradient; } @@ -395,7 +395,7 @@ public: m_StartColor = startingColor; m_EndColor = endingColor; } - virtual FX_INT32 CountGradientColors() const + virtual int32_t CountGradientColors() const { return m_GradColors.GetSize(); } @@ -408,11 +408,11 @@ public: return m_GradColors.Copy(colors), TRUE; } - virtual FX_INT32 GetWrapMode() const + virtual int32_t GetWrapMode() const { return m_iWrapMode; } - virtual void SetWrapMode(FX_INT32 iWrapMode) + virtual void SetWrapMode(int32_t iWrapMode) { m_iWrapMode = iWrapMode; } @@ -421,7 +421,7 @@ public: FX_ARGB m_EndColor; FX_ARGB m_StartColor; CFDE_GradientColors m_GradColors; - FX_INT32 m_iWrapMode; + int32_t m_iWrapMode; CFX_Matrix m_Matrix; }; #endif diff --git a/xfa/src/fdp/src/fde/fde_render.cpp b/xfa/src/fdp/src/fde/fde_render.cpp index e8e9149e02..7feca48ab8 100644 --- a/xfa/src/fdp/src/fde/fde_render.cpp +++ b/xfa/src/fdp/src/fde/fde_render.cpp @@ -6,7 +6,7 @@ #include "../../../foxitlib.h" #include "fde_render.h" -void FDE_GetPageMatrix(CFX_Matrix &pageMatrix, const CFX_RectF &docPageRect, const CFX_Rect &devicePageRect, FX_INT32 iRotate, FX_DWORD dwCoordinatesType) +void FDE_GetPageMatrix(CFX_Matrix &pageMatrix, const CFX_RectF &docPageRect, const CFX_Rect &devicePageRect, int32_t iRotate, FX_DWORD dwCoordinatesType) { FXSYS_assert(iRotate >= 0 && iRotate <= 3); FX_BOOL bFlipX = (dwCoordinatesType & 0x01) != 0; @@ -108,7 +108,7 @@ FDE_RENDERSTATUS CFDE_RenderContext::DoRender(IFX_Pause *pPause) IFDE_VisualSet *pVisualSet; FDE_HVISUALOBJ hVisualObj; CFX_RectF rtObj; - FX_INT32 iCount = 0; + int32_t iCount = 0; while(TRUE) { hVisualObj = m_pIterator->GetNext(pVisualSet); if (hVisualObj == NULL || pVisualSet == NULL) { @@ -175,7 +175,7 @@ void CFDE_RenderContext::RenderText(IFDE_TextSet *pTextSet, FDE_HVISUALOBJ hText if (pFont == NULL) { return; } - FX_INT32 iCount = pTextSet->GetDisplayPos(hText, NULL, FALSE); + int32_t iCount = pTextSet->GetDisplayPos(hText, NULL, FALSE); if (iCount < 1) { return; } @@ -214,7 +214,7 @@ void CFDE_RenderContext::RenderPath(IFDE_PathSet *pPathSet, FDE_HVISUALOBJ hPath } FDE_HDEVICESTATE hState; FX_BOOL bClip = ApplyClip(pPathSet, hPath, hState); - FX_INT32 iRenderMode = pPathSet->GetRenderMode(hPath); + int32_t iRenderMode = pPathSet->GetRenderMode(hPath); if (iRenderMode & FDE_PATHRENDER_Stroke) { IFDE_Pen *pPen = pPathSet->GetPen(hPath); FX_FLOAT fWidth = pPathSet->GetPenWidth(hPath); diff --git a/xfa/src/fdp/src/fde/fde_render.h b/xfa/src/fdp/src/fde/fde_render.h index 909987a032..6bec3e070f 100644 --- a/xfa/src/fdp/src/fde/fde_render.h +++ b/xfa/src/fdp/src/fde/fde_render.h @@ -36,7 +36,7 @@ protected: IFDE_SolidBrush *m_pSolidBrush; CFX_Matrix m_Transform; FXTEXT_CHARPOS *m_pCharPos; - FX_INT32 m_iCharPosCount; + int32_t m_iCharPosCount; IFDE_VisualSetIterator *m_pIterator; }; #endif diff --git a/xfa/src/fdp/src/tto/fde_textout.cpp b/xfa/src/fdp/src/tto/fde_textout.cpp index e03620244f..fa45b3e4d0 100644 --- a/xfa/src/fdp/src/tto/fde_textout.cpp +++ b/xfa/src/fdp/src/tto/fde_textout.cpp @@ -116,7 +116,7 @@ void CFDE_TextOut::SetParagraphBreakChar(FX_WCHAR wch) m_wParagraphBkChar = wch; m_pTxtBreak->SetParagraphBreakChar(wch); } -void CFDE_TextOut::SetAlignment(FX_INT32 iAlignment) +void CFDE_TextOut::SetAlignment(int32_t iAlignment) { m_iAlignment = iAlignment; switch (m_iAlignment) { @@ -178,19 +178,19 @@ void CFDE_TextOut::SetLineBreakTolerance(FX_FLOAT fTolerance) m_fTolerance = fTolerance; m_pTxtBreak->SetLineBreakTolerance(m_fTolerance); } -FX_INT32 CFDE_TextOut::GetTotalLines() +int32_t CFDE_TextOut::GetTotalLines() { return m_iTotalLines; } -void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Size &size) +void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_Size &size) { CFX_RectF rtText; rtText.Set(0.0f, 0.0f, (FX_FLOAT)size.x, (FX_FLOAT)size.y); CalcSize(pwsStr, iLength, rtText); - size.x = (FX_INT32)rtText.Width(); - size.y = (FX_INT32)rtText.Height(); + size.x = (int32_t)rtText.Width(); + size.y = (int32_t)rtText.Height(); } -void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size) +void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_SizeF &size) { CFX_RectF rtText; rtText.Set(0.0f, 0.0f, size.x, size.y); @@ -198,14 +198,14 @@ void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size size.x = rtText.Width(); size.y = rtText.Height(); } -void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Rect &rect) +void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_Rect &rect) { CFX_RectF rtText; rtText.Set((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, (FX_FLOAT)rect.Width(), (FX_FLOAT)rect.Height()); CalcSize(pwsStr, iLength, rtText); - rect.Set((FX_INT32)rtText.left, (FX_INT32)rtText.top, (FX_INT32)rtText.Width(), (FX_INT32)rtText.Height()); + rect.Set((int32_t)rtText.left, (int32_t)rtText.top, (int32_t)rtText.Width(), (int32_t)rtText.Height()); } -void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect) +void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect) { if (pwsStr == NULL || iLength < 1) { rect.width = 0.0f; @@ -218,7 +218,7 @@ void CFDE_TextOut::CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect m_Matrix.TransformRect(rect); } } -void CFDE_TextOut::CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size) +void CFDE_TextOut::CalcLogicSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_SizeF &size) { CFX_RectF rtText; rtText.Set(0.0f, 0.0f, size.x, size.y); @@ -226,7 +226,7 @@ void CFDE_TextOut::CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF size.x = rtText.Width(); size.y = rtText.Height(); } -void CFDE_TextOut::CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect) +void CFDE_TextOut::CalcLogicSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect) { if (pwsStr == NULL || iLength < 1) { rect.width = 0.0f; @@ -235,7 +235,7 @@ void CFDE_TextOut::CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF CalcTextSize(pwsStr, iLength, rect); } } -void CFDE_TextOut::CalcTextSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect) +void CFDE_TextOut::CalcTextSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect) { FXSYS_assert(m_pFont != NULL && m_fFontSize >= 1.0f); SetLineWidth(rect); @@ -321,8 +321,8 @@ FX_BOOL CFDE_TextOut::RetrieveLineWidth(FX_DWORD dwBreakStatus, FX_FLOAT &fStart FX_FLOAT fLineStep = (m_fLineSpace > m_fFontSize) ? m_fLineSpace : m_fFontSize; FX_BOOL bLineWrap = (m_dwStyles & FDE_TTOSTYLE_LineWrap) ? TRUE : FALSE; FX_FLOAT fLineWidth = 0.0f; - FX_INT32 iCount = m_pTxtBreak->CountBreakPieces(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = m_pTxtBreak->CountBreakPieces(); + for (int32_t i = 0; i < iCount; i++) { const CFX_TxtPiece *pPiece = m_pTxtBreak->GetBreakPiece(i); fLineWidth += (FX_FLOAT)pPiece->m_iWidth / 20000.0f; fStartPos = FX_MIN(fStartPos, (FX_FLOAT)pPiece->m_iStartPos / 20000.0f); @@ -340,25 +340,25 @@ FX_BOOL CFDE_TextOut::RetrieveLineWidth(FX_DWORD dwBreakStatus, FX_FLOAT &fStart m_iTotalLines++; return TRUE; } -void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 x, FX_INT32 y) +void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, int32_t iLength, int32_t x, int32_t y) { CFX_RectF rtText; rtText.Set((FX_FLOAT)x, (FX_FLOAT)y, m_fFontSize * 1000.0f, m_fFontSize * 1000.0f); DrawText(pwsStr, iLength, rtText); } -void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y) +void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y) { CFX_RectF rtText; rtText.Set(x, y, m_fFontSize * 1000.0f, m_fFontSize * 1000.0f); DrawText(pwsStr, iLength, rtText); } -void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_Rect &rect) +void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_Rect &rect) { CFX_RectF rtText; rtText.Set((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, (FX_FLOAT)rect.width, (FX_FLOAT)rect.height); DrawText(pwsStr, iLength, rtText); } -void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect) +void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect) { CFX_RectF rtText; rtText.Set(rect.left, rect.top, rect.width, rect.height); @@ -367,20 +367,20 @@ void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF rm.TransformRect(rtText); DrawText(pwsStr, iLength, rtText, m_rtClip); } -void CFDE_TextOut::DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y) +void CFDE_TextOut::DrawLogicText(FX_LPCWSTR pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y) { CFX_RectF rtText; rtText.Set(x, y, m_fFontSize * 1000.0f, m_fFontSize * 1000.0f); DrawLogicText(pwsStr, iLength, rtText); } -void CFDE_TextOut::DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect) +void CFDE_TextOut::DrawLogicText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect) { CFX_RectF rtClip; rtClip.Set(m_rtLogicClip.left, m_rtLogicClip.top, m_rtLogicClip.width, m_rtLogicClip.height); m_Matrix.TransformRect(rtClip); DrawText(pwsStr, iLength, rect, rtClip); } -void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect, const CFX_RectF &rtClip) +void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect, const CFX_RectF &rtClip) { FXSYS_assert(m_pFont != NULL && m_fFontSize >= 1.0f); if (pwsStr == NULL || iLength < 1) { @@ -404,25 +404,25 @@ void CFDE_TextOut::DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF DoAlignment(rect); OnDraw(rtClip); } -void CFDE_TextOut::ExpandBuffer(FX_INT32 iSize, FX_INT32 iType) +void CFDE_TextOut::ExpandBuffer(int32_t iSize, int32_t iType) { switch (iType) { case 0: if (m_pCharWidths == NULL) { - m_pCharWidths = (FX_INT32*)FDE_Alloc(iSize * sizeof(FX_INT32)); + m_pCharWidths = (int32_t*)FDE_Alloc(iSize * sizeof(int32_t)); m_iChars = iSize; } else if (m_iChars < iSize) { - m_pCharWidths = (FX_INT32*)FDE_Realloc(m_pCharWidths, iSize * sizeof(FX_INT32)); + m_pCharWidths = (int32_t*)FDE_Realloc(m_pCharWidths, iSize * sizeof(int32_t)); m_iChars = iSize; } FXSYS_memset(m_pCharWidths, 0, iSize); break; case 1: if (m_pEllCharWidths == NULL) { - m_pEllCharWidths = (FX_INT32*)FDE_Alloc(iSize * sizeof(FX_INT32)); + m_pEllCharWidths = (int32_t*)FDE_Alloc(iSize * sizeof(int32_t)); m_iEllChars = iSize; } else if (m_iEllChars < iSize) { - m_pEllCharWidths = (FX_INT32*)FDE_Realloc(m_pEllCharWidths, iSize * sizeof(FX_INT32)); + m_pEllCharWidths = (int32_t*)FDE_Realloc(m_pEllCharWidths, iSize * sizeof(int32_t)); m_iEllChars = iSize; } FXSYS_memset(m_pEllCharWidths, 0, iSize); @@ -445,13 +445,13 @@ void CFDE_TextOut::LoadEllipsis() } m_bElliChanged = FALSE; m_iEllipsisWidth = 0; - FX_INT32 iLength = m_wsEllipsis.GetLength(); + int32_t iLength = m_wsEllipsis.GetLength(); if (iLength < 1) { return; } ExpandBuffer(iLength, 1); FX_LPCWSTR pStr = (FX_LPCWSTR)m_wsEllipsis; - FX_INT32 *pCharWidths = m_pEllCharWidths; + int32_t *pCharWidths = m_pEllCharWidths; FX_DWORD dwBreakStatus; FX_WCHAR wch; while (iLength-- > 0) { @@ -467,14 +467,14 @@ void CFDE_TextOut::LoadEllipsis() } m_pTxtBreak->Reset(); } -void CFDE_TextOut::RetrieveEllPieces(FX_INT32 *&pCharWidths) +void CFDE_TextOut::RetrieveEllPieces(int32_t *&pCharWidths) { - FX_INT32 iCount = m_pTxtBreak->CountBreakPieces(); + int32_t iCount = m_pTxtBreak->CountBreakPieces(); CFX_Char *pTC; - for (FX_INT32 i = 0; i < iCount; i++) { + for (int32_t i = 0; i < iCount; i++) { const CFX_TxtPiece *pPiece = m_pTxtBreak->GetBreakPiece(i); - FX_INT32 iPieceChars = pPiece->GetLength(); - for (FX_INT32 j = 0; j < iPieceChars; j++) { + int32_t iPieceChars = pPiece->GetLength(); + for (int32_t j = 0; j < iPieceChars; j++) { pTC = pPiece->GetCharPtr(j); if (pTC->m_iCharWidth <= 0) { *pCharWidths = 0; @@ -487,10 +487,10 @@ void CFDE_TextOut::RetrieveEllPieces(FX_INT32 *&pCharWidths) } m_pTxtBreak->ClearBreakPieces(); } -void CFDE_TextOut::LoadText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect) +void CFDE_TextOut::LoadText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect) { FX_LPWSTR pStr = m_wsText.GetBuffer(iLength); - FX_INT32 iTxtLength = iLength; + int32_t iTxtLength = iLength; ExpandBuffer(iTxtLength, 0); FX_BOOL bHotKey = (m_dwStyles & FDE_TTOSTYLE_HotKey) ? TRUE : FALSE; FX_BOOL bVertical = (m_dwStyles & FDE_TTOSTYLE_VerticalLayout) ? TRUE : FALSE; @@ -502,9 +502,9 @@ void CFDE_TextOut::LoadText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF fLineStep = -fLineStep; } m_hotKeys.RemoveAll(); - FX_INT32 iStartChar = 0; - FX_INT32 iChars = 0; - FX_INT32 iPieceWidths = 0; + int32_t iStartChar = 0; + int32_t iChars = 0; + int32_t iPieceWidths = 0; FX_DWORD dwBreakStatus; FX_WCHAR wch; FX_BOOL bRet = FALSE; @@ -527,7 +527,7 @@ void CFDE_TextOut::LoadText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF m_fLinePos += fLineStep; } if ((bVertical && m_fLinePos + fLineStep < fLineStop) || (!bVertical && m_fLinePos + fLineStep > fLineStop)) { - FX_INT32 iCurLine = m_iCurLine; + int32_t iCurLine = m_iCurLine; if (bEndofLine) { iCurLine--; } @@ -546,7 +546,7 @@ void CFDE_TextOut::LoadText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF m_pTxtBreak->Reset(); m_wsText.ReleaseBuffer(iLength); } -FX_BOOL CFDE_TextOut::RetriecePieces(FX_DWORD dwBreakStatus, FX_INT32 &iStartChar, FX_INT32 &iPieceWidths, FX_BOOL bReload, +FX_BOOL CFDE_TextOut::RetriecePieces(FX_DWORD dwBreakStatus, int32_t &iStartChar, int32_t &iPieceWidths, FX_BOOL bReload, const CFX_RectF &rect) { FX_BOOL bSingleLine = (m_dwStyles & FDE_TTOSTYLE_SingleLine) ? TRUE : FALSE; @@ -559,17 +559,17 @@ FX_BOOL CFDE_TextOut::RetriecePieces(FX_DWORD dwBreakStatus, FX_INT32 &iStartCha CFX_Char *pTC = NULL; FX_BOOL bNeedReload = FALSE; FX_FLOAT fLineWidth = bVertical ? rect.Height() : rect.Width(); - FX_INT32 iLineWidth = FXSYS_round(fLineWidth * 20000.0f); - FX_INT32 iCount = m_pTxtBreak->CountBreakPieces(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iLineWidth = FXSYS_round(fLineWidth * 20000.0f); + int32_t iCount = m_pTxtBreak->CountBreakPieces(); + for (int32_t i = 0; i < iCount; i++) { const CFX_TxtPiece *pPiece = m_pTxtBreak->GetBreakPiece(i); - FX_INT32 iPieceChars = pPiece->GetLength(); - FX_INT32 iChar = iStartChar; - FX_INT32 iWidth = 0; - FX_INT32 j = 0; + int32_t iPieceChars = pPiece->GetLength(); + int32_t iChar = iStartChar; + int32_t iWidth = 0; + int32_t j = 0; for (; j < iPieceChars; j++) { pTC = pPiece->GetCharPtr(j); - FX_INT32 iCurCharWidth = pTC->m_iCharWidth > 0 ? pTC->m_iCharWidth : 0; + int32_t iCurCharWidth = pTC->m_iCharWidth > 0 ? pTC->m_iCharWidth : 0; if (bSingleLine || !bLineWrap) { if (iLineWidth - iPieceWidths - iWidth < iCurCharWidth) { bNeedReload = TRUE; @@ -624,7 +624,7 @@ void CFDE_TextOut::AppendPiece(const FDE_TTOPIECE &ttoPiece, FX_BOOL bNeedReload pLine->m_bNewReload = bNeedReload; m_iCurPiece = pLine->AddPiece(m_iCurPiece, ttoPiece); if (bEnd) { - FX_INT32 iPieces = pLine->GetSize(); + int32_t iPieces = pLine->GetSize(); if (m_iCurPiece < iPieces) { pLine->RemoveLast(iPieces - m_iCurPiece - 1); } @@ -637,30 +637,30 @@ void CFDE_TextOut::AppendPiece(const FDE_TTOPIECE &ttoPiece, FX_BOOL bNeedReload void CFDE_TextOut::ReplaceWidthEllipsis() { LoadEllipsis(); - FX_INT32 iLength = m_wsEllipsis.GetLength(); + int32_t iLength = m_wsEllipsis.GetLength(); if (iLength < 1) { return; } - FX_INT32 iLines = m_ttoLines.GetSize(); - for (FX_INT32 i = 0; i < iLines; i++) { + int32_t iLines = m_ttoLines.GetSize(); + for (int32_t i = 0; i < iLines; i++) { CFDE_TTOLine *pLine = m_ttoLines.GetPtrAt(i); if (!pLine->m_bNewReload) { continue; } - FX_INT32 iEllipsisCharIndex = iLength - 1; - FX_INT32 iCharWidth = 0; - FX_INT32 iCharCount = 0; - FX_INT32 iPiece = pLine->GetSize(); + int32_t iEllipsisCharIndex = iLength - 1; + int32_t iCharWidth = 0; + int32_t iCharCount = 0; + int32_t iPiece = pLine->GetSize(); while (iPiece-- > 0) { FDE_LPTTOPIECE pPiece = pLine->GetPtrAt(iPiece); if (pPiece == NULL) { break; } - for (FX_INT32 j = pPiece->iChars - 1; j >= 0; j--) { + for (int32_t j = pPiece->iChars - 1; j >= 0; j--) { if (iEllipsisCharIndex < 0) { break; } - FX_INT32 index = pPiece->iStartChar + j; + int32_t index = pPiece->iStartChar + j; iCharWidth += m_pCharWidths[index]; iCharCount++; if (iCharCount <= iLength) { @@ -680,8 +680,8 @@ void CFDE_TextOut::ReplaceWidthEllipsis() } void CFDE_TextOut::Reload(const CFX_RectF &rect) { - FX_INT32 iCount = m_ttoLines.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = m_ttoLines.GetSize(); + for (int32_t i = 0; i < iCount; i++) { CFDE_TTOLine *pLine = m_ttoLines.GetPtrAt(i); if (pLine == NULL || !pLine->m_bNewReload) { continue; @@ -695,17 +695,17 @@ void CFDE_TextOut::ReloadLinePiece(CFDE_TTOLine *pLine, const CFX_RectF &rect) { FX_LPCWSTR pwsStr = (FX_LPCWSTR)m_wsText; FX_BOOL bVertical = (m_dwStyles & FDE_TTOSTYLE_VerticalLayout) ? TRUE : FALSE; - FX_INT32 iPieceWidths = 0; + int32_t iPieceWidths = 0; FDE_LPTTOPIECE pPiece = pLine->GetPtrAt(0); - FX_INT32 iStartChar = pPiece->iStartChar; + int32_t iStartChar = pPiece->iStartChar; m_fLinePos = bVertical ? pPiece->rtPiece.left : pPiece->rtPiece.top; - FX_INT32 iPieceCount = pLine->GetSize(); - FX_INT32 iPieceIndex = 0; + int32_t iPieceCount = pLine->GetSize(); + int32_t iPieceIndex = 0; FX_DWORD dwBreakStatus = 0; FX_WCHAR wch; while (iPieceIndex < iPieceCount) { - FX_INT32 iStar = iStartChar; - FX_INT32 iEnd = pPiece->iChars + iStar; + int32_t iStar = iStartChar; + int32_t iEnd = pPiece->iChars + iStar; while (iStar < iEnd) { wch = *(pwsStr + iStar); dwBreakStatus = m_pTxtBreak->AppendChar(wch); @@ -727,7 +727,7 @@ void CFDE_TextOut::DoAlignment(const CFX_RectF &rect) { FX_BOOL bVertical = (m_dwStyles & FDE_TTOSTYLE_VerticalLayout) ? TRUE : FALSE; FX_FLOAT fLineStopS = bVertical ? rect.right() : rect.bottom(); - FX_INT32 iLines = m_ttoLines.GetSize(); + int32_t iLines = m_ttoLines.GetSize(); if (iLines < 1) { return; } @@ -746,10 +746,10 @@ void CFDE_TextOut::DoAlignment(const CFX_RectF &rect) if (fInc < 1.0f) { return; } - for (FX_INT32 i = 0; i < iLines; i++) { + for (int32_t i = 0; i < iLines; i++) { CFDE_TTOLine *pLine = m_ttoLines.GetPtrAt(i); - FX_INT32 iPieces = pLine->GetSize(); - for (FX_INT32 j = 0; j < iPieces; j++) { + int32_t iPieces = pLine->GetSize(); + for (int32_t j = 0; j < iPieces; j++) { FDE_LPTTOPIECE pPiece = pLine->GetPtrAt(j); if (bVertical) { pPiece->rtPiece.left += fInc; @@ -764,7 +764,7 @@ void CFDE_TextOut::OnDraw(const CFX_RectF &rtClip) if (m_pRenderDevice == NULL) { return; } - FX_INT32 iLines = m_ttoLines.GetSize(); + int32_t iLines = m_ttoLines.GetSize(); if (iLines < 1) { return; } @@ -775,15 +775,15 @@ void CFDE_TextOut::OnDraw(const CFX_RectF &rtClip) if (rtClip.Width() > 0.0f && rtClip.Height() > 0.0f) { m_pRenderDevice->SetClipRect(rtClip); } - for (FX_INT32 i = 0; i < iLines; i++) { + for (int32_t i = 0; i < iLines; i++) { CFDE_TTOLine *pLine = m_ttoLines.GetPtrAt(i); - FX_INT32 iPieces = pLine->GetSize(); - for (FX_INT32 j = 0; j < iPieces; j++) { + int32_t iPieces = pLine->GetSize(); + for (int32_t j = 0; j < iPieces; j++) { FDE_LPTTOPIECE pPiece = pLine->GetPtrAt(j); if (pPiece == NULL) { continue; } - FX_INT32 iCount = GetDisplayPos(pPiece); + int32_t iCount = GetDisplayPos(pPiece); if (iCount > 0) { m_pRenderDevice->DrawString(pBrush, m_pFont, m_pCharPos, iCount, m_fFontSize, &m_Matrix); } @@ -798,14 +798,14 @@ void CFDE_TextOut::OnDraw(const CFX_RectF &rtClip) pPen->Release(); } } -FX_INT32 CFDE_TextOut::GetDisplayPos(FDE_LPTTOPIECE pPiece) +int32_t CFDE_TextOut::GetDisplayPos(FDE_LPTTOPIECE pPiece) { FX_TXTRUN tr; ToTextRun(pPiece, tr); ExpandBuffer(tr.iLength, 2); return m_pTxtBreak->GetDisplayPos(&tr, m_pCharPos); } -FX_INT32 CFDE_TextOut::GetCharRects(FDE_LPTTOPIECE pPiece) +int32_t CFDE_TextOut::GetCharRects(FDE_LPTTOPIECE pPiece) { FX_TXTRUN tr; ToTextRun(pPiece, tr); @@ -841,7 +841,7 @@ void CFDE_TextOut::DrawLine(const FDE_LPTTOPIECE pPiece, IFDE_Pen *&pPen) pPen->SetColor(m_TxtColor); } IFDE_Path *pPath = IFDE_Path::Create(); - FX_INT32 iLineCount = 0; + int32_t iLineCount = 0; CFX_RectF rtText = pPiece->rtPiece; CFX_PointF pt1, pt2; if (bUnderLine) { @@ -875,11 +875,11 @@ void CFDE_TextOut::DrawLine(const FDE_LPTTOPIECE pPiece, IFDE_Pen *&pPen) iLineCount++; } if (bHotKey) { - FX_INT32 iHotKeys = m_hotKeys.GetSize(); - FX_INT32 iCount = GetCharRects(pPiece); + int32_t iHotKeys = m_hotKeys.GetSize(); + int32_t iCount = GetCharRects(pPiece); if (iCount > 0) { - for (FX_INT32 i = 0; i < iHotKeys; i++) { - FX_INT32 iCharIndex = m_hotKeys.GetAt(i); + for (int32_t i = 0; i < iHotKeys; i++) { + int32_t iCharIndex = m_hotKeys.GetAt(i); if (iCharIndex >= pPiece->iStartChar && iCharIndex < pPiece->iStartChar + pPiece->iChars) { CFX_RectF rect = m_rectArray.GetAt(iCharIndex - pPiece->iStartChar); if (bVertical) { @@ -920,7 +920,7 @@ CFDE_TTOLine::CFDE_TTOLine(const CFDE_TTOLine &ttoLine) CFDE_TTOLine::~CFDE_TTOLine() { } -FX_INT32 CFDE_TTOLine::AddPiece(FX_INT32 index, const FDE_TTOPIECE &ttoPiece) +int32_t CFDE_TTOLine::AddPiece(int32_t index, const FDE_TTOPIECE &ttoPiece) { if (index >= m_iPieceCount) { index = m_pieces.Add(ttoPiece) + 1; @@ -931,18 +931,18 @@ FX_INT32 CFDE_TTOLine::AddPiece(FX_INT32 index, const FDE_TTOPIECE &ttoPiece) } return index; } -FX_INT32 CFDE_TTOLine::GetSize() const +int32_t CFDE_TTOLine::GetSize() const { return m_iPieceCount; } -FDE_LPTTOPIECE CFDE_TTOLine::GetPtrAt(FX_INT32 index) +FDE_LPTTOPIECE CFDE_TTOLine::GetPtrAt(int32_t index) { if (index >= m_iPieceCount) { return NULL; } return m_pieces.GetPtrAt(index); } -void CFDE_TTOLine::RemoveLast(FX_INT32 iCount) +void CFDE_TTOLine::RemoveLast(int32_t iCount) { m_pieces.RemoveLast(iCount); } diff --git a/xfa/src/fdp/src/tto/fde_textout.h b/xfa/src/fdp/src/tto/fde_textout.h index 116ad89d5d..38bc8ebcec 100644 --- a/xfa/src/fdp/src/tto/fde_textout.h +++ b/xfa/src/fdp/src/tto/fde_textout.h @@ -8,8 +8,8 @@ #define _FDE_TEXTOUT_IMP struct FDE_TTOPIECE { public: - FX_INT32 iStartChar; - FX_INT32 iChars; + int32_t iStartChar; + int32_t iChars; FX_DWORD dwCharStyles; CFX_RectF rtPiece; }; @@ -21,15 +21,15 @@ public: CFDE_TTOLine(); CFDE_TTOLine(const CFDE_TTOLine &ttoLine); ~CFDE_TTOLine(); - FX_INT32 AddPiece(FX_INT32 index, const FDE_TTOPIECE &ttoPiece); - FX_INT32 GetSize() const; - FDE_LPTTOPIECE GetPtrAt(FX_INT32 index); - void RemoveLast(FX_INT32 iCount); + int32_t AddPiece(int32_t index, const FDE_TTOPIECE &ttoPiece); + int32_t GetSize() const; + FDE_LPTTOPIECE GetPtrAt(int32_t index); + void RemoveLast(int32_t iCount); void RemoveAll(FX_BOOL bLeaveMemory); FX_BOOL m_bNewReload; CFDE_TTOPieceArray m_pieces; protected: - FX_INT32 m_iPieceCount; + int32_t m_iPieceCount; }; typedef CFX_ObjectMassArrayTemplate CFDE_TTOLineArray; class CFDE_TextOut : public IFDE_TextOut, public CFX_Target @@ -48,7 +48,7 @@ public: virtual void SetTabWidth(FX_FLOAT fTabWidth); virtual void SetEllipsisString(const CFX_WideString &wsEllipsis); virtual void SetParagraphBreakChar(FX_WCHAR wch); - virtual void SetAlignment(FX_INT32 iAlignment); + virtual void SetAlignment(int32_t iAlignment); virtual void SetLineSpace(FX_FLOAT fLineSpace); virtual void SetDIBitmap(CFX_DIBitmap *pDIB); virtual void SetRenderDevice(CFX_RenderDevice *pDevice); @@ -56,41 +56,41 @@ public: virtual void SetClipRect(const CFX_RectF &rtClip); virtual void SetMatrix(const CFX_Matrix &matrix); virtual void SetLineBreakTolerance(FX_FLOAT fTolerance); - virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Size &size); - virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size); - virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_Rect &rect); - virtual void CalcSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect); + virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_Size &size); + virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_SizeF &size); + virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_Rect &rect); + virtual void CalcSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect); - virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 x, FX_INT32 y); - virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y); - virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_Rect &rect); - virtual void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect); + virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, int32_t x, int32_t y); + virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y); + virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_Rect &rect); + virtual void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect); virtual void SetLogicClipRect(const CFX_RectF &rtClip); - virtual void CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_SizeF &size); - virtual void CalcLogicSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect); - virtual void DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_FLOAT x, FX_FLOAT y); - virtual void DrawLogicText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect); - virtual FX_INT32 GetTotalLines(); + virtual void CalcLogicSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_SizeF &size); + virtual void CalcLogicSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect); + virtual void DrawLogicText(FX_LPCWSTR pwsStr, int32_t iLength, FX_FLOAT x, FX_FLOAT y); + virtual void DrawLogicText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect); + virtual int32_t GetTotalLines(); protected: - void CalcTextSize(FX_LPCWSTR pwsStr, FX_INT32 iLength, CFX_RectF &rect); + void CalcTextSize(FX_LPCWSTR pwsStr, int32_t iLength, CFX_RectF &rect); FX_BOOL RetrieveLineWidth(FX_DWORD dwBreakStatus, FX_FLOAT &fStartPos, FX_FLOAT &fWidth, FX_FLOAT &fHeight); void SetLineWidth(CFX_RectF &rect); - void DrawText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect, const CFX_RectF &rtClip); - void LoadText(FX_LPCWSTR pwsStr, FX_INT32 iLength, const CFX_RectF &rect); + void DrawText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect, const CFX_RectF &rtClip); + void LoadText(FX_LPCWSTR pwsStr, int32_t iLength, const CFX_RectF &rect); void LoadEllipsis(); - void ExpandBuffer(FX_INT32 iSize, FX_INT32 iType); - void RetrieveEllPieces(FX_INT32 *&pCharWidths); + void ExpandBuffer(int32_t iSize, int32_t iType); + void RetrieveEllPieces(int32_t *&pCharWidths); void Reload(const CFX_RectF &rect); void ReloadLinePiece(CFDE_TTOLine *pLine, const CFX_RectF &rect); - FX_BOOL RetriecePieces(FX_DWORD dwBreakStatus, FX_INT32 &iStartChar, FX_INT32 &iPieceWidths, FX_BOOL bReload, const CFX_RectF &rect); + FX_BOOL RetriecePieces(FX_DWORD 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); void ReplaceWidthEllipsis(); void DoAlignment(const CFX_RectF &rect); void OnDraw(const CFX_RectF &rtClip); - FX_INT32 GetDisplayPos(FDE_LPTTOPIECE pPiece); - FX_INT32 GetCharRects(FDE_LPTTOPIECE pPiece); + int32_t GetDisplayPos(FDE_LPTTOPIECE pPiece); + int32_t GetCharRects(FDE_LPTTOPIECE pPiece); void ToTextRun(const FDE_LPTTOPIECE pPiece, FX_TXTRUN &tr); void DrawLine(const FDE_LPTTOPIECE pPiece, IFDE_Pen *&pPen); @@ -102,29 +102,29 @@ protected: FX_FLOAT m_fLinePos; FX_FLOAT m_fTolerance; - FX_INT32 m_iAlignment; - FX_INT32 m_iTxtBkAlignment; - FX_INT32 *m_pCharWidths; - FX_INT32 m_iChars; - FX_INT32 *m_pEllCharWidths; - FX_INT32 m_iEllChars; + int32_t m_iAlignment; + int32_t m_iTxtBkAlignment; + int32_t *m_pCharWidths; + int32_t m_iChars; + int32_t *m_pEllCharWidths; + int32_t m_iEllChars; FX_WCHAR m_wParagraphBkChar; FX_ARGB m_TxtColor; FX_DWORD m_dwStyles; FX_DWORD m_dwTxtBkStyles; CFX_WideString m_wsEllipsis; FX_BOOL m_bElliChanged; - FX_INT32 m_iEllipsisWidth; + int32_t m_iEllipsisWidth; CFX_WideString m_wsText; CFX_RectF m_rtClip; CFX_RectF m_rtLogicClip; CFX_Matrix m_Matrix; CFDE_TTOLineArray m_ttoLines; - FX_INT32 m_iCurLine; - FX_INT32 m_iCurPiece; - FX_INT32 m_iTotalLines; + int32_t m_iCurLine; + int32_t m_iCurPiece; + int32_t m_iTotalLines; FXTEXT_CHARPOS *m_pCharPos; - FX_INT32 m_iCharPosSize; + int32_t m_iCharPosSize; IFDE_RenderDevice *m_pRenderDevice; CFX_Int32Array m_hotKeys; CFX_RectFArray m_rectArray; diff --git a/xfa/src/fdp/src/xml/fde_xml.cpp b/xfa/src/fdp/src/xml/fde_xml.cpp index f228b69bb1..ab7906b1bc 100644 --- a/xfa/src/fdp/src/xml/fde_xml.cpp +++ b/xfa/src/fdp/src/xml/fde_xml.cpp @@ -13,7 +13,7 @@ extern "C" { static FX_WCHAR g_XMLValidCharRange[FDE_XMLVALIDCHARRANGENUM][2] = {{0x09, 0x09}, {0x0A, 0x0A}, {0x0D, 0x0D}, {0x20, 0xD7FF}, {0xE000, 0xFFFD}}; FX_BOOL FDE_IsXMLValidChar(FX_WCHAR ch) { - FX_INT32 iStart = 0, iEnd = FDE_XMLVALIDCHARRANGENUM - 1, iMid; + int32_t iStart = 0, iEnd = FDE_XMLVALIDCHARRANGENUM - 1, iMid; while (iStart <= iEnd) { iMid = (iStart + iEnd) / 2; if (ch < g_XMLValidCharRange[iMid][0]) { @@ -45,7 +45,7 @@ static FDE_XMLNAMECHAR g_XMLNameChars[FDE_XMLNAMECHARSNUM] = { }; FX_BOOL FDE_IsXMLNameChar(FX_WCHAR ch, FX_BOOL bFirstChar) { - FX_INT32 iStart = 0, iEnd = FDE_XMLNAMECHARSNUM - 1, iMid; + int32_t iStart = 0, iEnd = FDE_XMLNAMECHARSNUM - 1, iMid; while (iStart <= iEnd) { iMid = (iStart + iEnd) / 2; if (ch < g_XMLNameChars[iMid].wStart) { @@ -85,9 +85,9 @@ void CFDE_XMLNode::DeleteChildren() } m_pChild = NULL; } -FX_INT32 CFDE_XMLNode::CountChildNodes() const +int32_t CFDE_XMLNode::CountChildNodes() const { - FX_INT32 iCount = 0; + int32_t iCount = 0; CFDE_XMLNode *pChild = m_pChild; while (pChild != NULL) { iCount ++; @@ -95,7 +95,7 @@ FX_INT32 CFDE_XMLNode::CountChildNodes() const } return iCount; } -CFDE_XMLNode* CFDE_XMLNode::GetChildNode(FX_INT32 index) const +CFDE_XMLNode* CFDE_XMLNode::GetChildNode(int32_t index) const { CFDE_XMLNode *pChild = m_pChild; while (pChild != NULL) { @@ -107,9 +107,9 @@ CFDE_XMLNode* CFDE_XMLNode::GetChildNode(FX_INT32 index) const } return NULL; } -FX_INT32 CFDE_XMLNode::GetChildNodeIndex(CFDE_XMLNode *pNode) const +int32_t CFDE_XMLNode::GetChildNodeIndex(CFDE_XMLNode *pNode) const { - FX_INT32 index = 0; + int32_t index = 0; CFDE_XMLNode *pChild = m_pChild; while (pChild != NULL) { if (pChild == pNode) { @@ -120,7 +120,7 @@ FX_INT32 CFDE_XMLNode::GetChildNodeIndex(CFDE_XMLNode *pNode) const } return -1; } -CFDE_XMLNode* CFDE_XMLNode::GetPath(FX_LPCWSTR pPath, FX_INT32 iLength, FX_BOOL bQualifiedName) const +CFDE_XMLNode* CFDE_XMLNode::GetPath(FX_LPCWSTR pPath, int32_t iLength, FX_BOOL bQualifiedName) const { FXSYS_assert(pPath != NULL); if (iLength < 0) { @@ -177,7 +177,7 @@ CFDE_XMLNode* CFDE_XMLNode::GetPath(FX_LPCWSTR pPath, FX_INT32 iLength, FX_BOOL } return pFind->GetPath(pStart, iLength, bQualifiedName); } -FX_INT32 CFDE_XMLNode::InsertChildNode(CFDE_XMLNode *pNode, FX_INT32 index) +int32_t CFDE_XMLNode::InsertChildNode(CFDE_XMLNode *pNode, int32_t index) { FXSYS_assert(pNode != NULL); pNode->m_pParent = this; @@ -193,7 +193,7 @@ FX_INT32 CFDE_XMLNode::InsertChildNode(CFDE_XMLNode *pNode, FX_INT32 index) m_pChild = pNode; return 0; } - FX_INT32 iCount = 0; + int32_t iCount = 0; CFDE_XMLNode *pFind = m_pChild; while (++iCount != index && pFind->m_pNext != NULL) { pFind = pFind->m_pNext; @@ -320,9 +320,9 @@ CFDE_XMLNode* CFDE_XMLNode::GetNodeItem(IFDE_XMLNode::NodeItem eItem) const } return NULL; } -FX_INT32 CFDE_XMLNode::GetNodeLevel() const +int32_t CFDE_XMLNode::GetNodeLevel() const { - FX_INT32 iLevel = 0; + int32_t iLevel = 0; CFDE_XMLNode *pItem = (CFDE_XMLNode*)this; while ((pItem = pItem->m_pParent) != NULL) { iLevel ++; @@ -409,7 +409,7 @@ void CFDE_XMLNode::SaveXMLNode(IFX_Stream *pXMLStream) ws.Format(L"m_wsTarget); pXMLStream->WriteString(ws, ws.GetLength()); CFX_WideStringArray &attributes = pInstruction->m_Attributes; - FX_INT32 i, iCount = attributes.GetSize(); + int32_t i, iCount = attributes.GetSize(); CFX_WideString wsValue; for (i = 0; i < iCount; i += 2) { ws = L" "; @@ -444,9 +444,9 @@ void CFDE_XMLNode::SaveXMLNode(IFX_Stream *pXMLStream) ws += ((CFDE_XMLElement*)pNode)->m_wsTag; pXMLStream->WriteString(ws, ws.GetLength()); CFX_WideStringArray &attributes = ((CFDE_XMLElement*)pNode)->m_Attributes; - FX_INT32 iCount = attributes.GetSize(); + int32_t iCount = attributes.GetSize(); CFX_WideString wsValue; - for (FX_INT32 i = 0; i < iCount; i += 2) { + for (int32_t i = 0; i < iCount; i += 2) { ws = L" "; ws += attributes[i]; ws += L"=\""; @@ -542,15 +542,15 @@ CFDE_XMLNode* CFDE_XMLInstruction::Clone(FX_BOOL bRecursive) } return pClone; } -FX_INT32 CFDE_XMLInstruction::CountAttributes() const +int32_t CFDE_XMLInstruction::CountAttributes() const { return m_Attributes.GetSize() / 2; } -FX_BOOL CFDE_XMLInstruction::GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const +FX_BOOL CFDE_XMLInstruction::GetAttribute(int32_t index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const { - FX_INT32 iCount = m_Attributes.GetSize(); + int32_t iCount = m_Attributes.GetSize(); FXSYS_assert(index > -1 && index < iCount / 2); - for (FX_INT32 i = 0; i < iCount; i += 2) { + for (int32_t i = 0; i < iCount; i += 2) { if (index == 0) { wsAttriName = m_Attributes[i]; wsAttriValue = m_Attributes[i + 1]; @@ -562,8 +562,8 @@ FX_BOOL CFDE_XMLInstruction::GetAttribute(FX_INT32 index, CFX_WideString &wsAttr } FX_BOOL CFDE_XMLInstruction::HasAttribute(FX_LPCWSTR pwsAttriName) const { - FX_INT32 iCount = m_Attributes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i += 2) { + int32_t iCount = m_Attributes.GetSize(); + for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(pwsAttriName) == 0) { return TRUE; } @@ -572,8 +572,8 @@ FX_BOOL CFDE_XMLInstruction::HasAttribute(FX_LPCWSTR pwsAttriName) const } void CFDE_XMLInstruction::GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue) const { - FX_INT32 iCount = m_Attributes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i += 2) { + int32_t iCount = m_Attributes.GetSize(); + for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(pwsAttriName) == 0) { wsAttriValue = m_Attributes[i + 1]; return; @@ -584,8 +584,8 @@ void CFDE_XMLInstruction::GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsA void CFDE_XMLInstruction::SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue) { FXSYS_assert(wsAttriName.GetLength() > 0); - FX_INT32 iCount = m_Attributes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i += 2) { + int32_t iCount = m_Attributes.GetSize(); + for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(wsAttriName) == 0) { m_Attributes[i] = wsAttriName; m_Attributes[i + 1] = wsAttriValue; @@ -595,17 +595,17 @@ void CFDE_XMLInstruction::SetString(const CFX_WideString &wsAttriName, const CFX m_Attributes.Add(wsAttriName); m_Attributes.Add(wsAttriValue); } -FX_INT32 CFDE_XMLInstruction::GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue) const +int32_t CFDE_XMLInstruction::GetInteger(FX_LPCWSTR pwsAttriName, int32_t iDefValue) const { - FX_INT32 iCount = m_Attributes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i += 2) { + int32_t iCount = m_Attributes.GetSize(); + for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(pwsAttriName) == 0) { return FXSYS_wtoi((FX_LPCWSTR)m_Attributes[i + 1]); } } return iDefValue; } -void CFDE_XMLInstruction::SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue) +void CFDE_XMLInstruction::SetInteger(FX_LPCWSTR pwsAttriName, int32_t iAttriValue) { CFX_WideString wsValue; wsValue.Format(L"%d", iAttriValue); @@ -613,8 +613,8 @@ void CFDE_XMLInstruction::SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriVal } FX_FLOAT CFDE_XMLInstruction::GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue) const { - FX_INT32 iCount = m_Attributes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i += 2) { + int32_t iCount = m_Attributes.GetSize(); + for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(pwsAttriName) == 0) { return FX_wcstof((FX_LPCWSTR)m_Attributes[i + 1]); } @@ -629,8 +629,8 @@ void CFDE_XMLInstruction::SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue } void CFDE_XMLInstruction::RemoveAttribute(FX_LPCWSTR pwsAttriName) { - FX_INT32 iCount = m_Attributes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i += 2) { + int32_t iCount = m_Attributes.GetSize(); + for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(pwsAttriName) == 0) { m_Attributes.RemoveAt(i + 1); m_Attributes.RemoveAt(i); @@ -638,11 +638,11 @@ void CFDE_XMLInstruction::RemoveAttribute(FX_LPCWSTR pwsAttriName) } } } -FX_INT32 CFDE_XMLInstruction::CountData() const +int32_t CFDE_XMLInstruction::CountData() const { return m_TargetData.GetSize(); } -FX_BOOL CFDE_XMLInstruction::GetData(FX_INT32 index, CFX_WideString &wsData) const +FX_BOOL CFDE_XMLInstruction::GetData(int32_t index, CFX_WideString &wsData) const { if (index < 0 || index >= m_TargetData.GetSize()) { return FALSE; @@ -654,7 +654,7 @@ void CFDE_XMLInstruction::AppendData(const CFX_WideString &wsData) { m_TargetData.Add(wsData); } -void CFDE_XMLInstruction::RemoveData(FX_INT32 index) +void CFDE_XMLInstruction::RemoveData(int32_t index) { m_TargetData.RemoveAt(index); } @@ -744,15 +744,15 @@ void CFDE_XMLElement::GetNamespaceURI(CFX_WideString &wsNamespace) const break; } } -FX_INT32 CFDE_XMLElement::CountAttributes() const +int32_t CFDE_XMLElement::CountAttributes() const { return m_Attributes.GetSize() / 2; } -FX_BOOL CFDE_XMLElement::GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const +FX_BOOL CFDE_XMLElement::GetAttribute(int32_t index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const { - FX_INT32 iCount = m_Attributes.GetSize(); + int32_t iCount = m_Attributes.GetSize(); FXSYS_assert(index > -1 && index < iCount / 2); - for (FX_INT32 i = 0; i < iCount; i += 2) { + for (int32_t i = 0; i < iCount; i += 2) { if (index == 0) { wsAttriName = m_Attributes[i]; wsAttriValue = m_Attributes[i + 1]; @@ -764,8 +764,8 @@ FX_BOOL CFDE_XMLElement::GetAttribute(FX_INT32 index, CFX_WideString &wsAttriNam } FX_BOOL CFDE_XMLElement::HasAttribute(FX_LPCWSTR pwsAttriName) const { - FX_INT32 iCount = m_Attributes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i += 2) { + int32_t iCount = m_Attributes.GetSize(); + for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(pwsAttriName) == 0) { return TRUE; } @@ -774,8 +774,8 @@ FX_BOOL CFDE_XMLElement::HasAttribute(FX_LPCWSTR pwsAttriName) const } void CFDE_XMLElement::GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue) const { - FX_INT32 iCount = m_Attributes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i += 2) { + int32_t iCount = m_Attributes.GetSize(); + for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(pwsAttriName) == 0) { wsAttriValue = m_Attributes[i + 1]; return; @@ -786,8 +786,8 @@ void CFDE_XMLElement::GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttri void CFDE_XMLElement::SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue) { FXSYS_assert(wsAttriName.GetLength() > 0); - FX_INT32 iCount = m_Attributes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i += 2) { + int32_t iCount = m_Attributes.GetSize(); + for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(wsAttriName) == 0) { m_Attributes[i] = wsAttriName; m_Attributes[i + 1] = wsAttriValue; @@ -797,17 +797,17 @@ void CFDE_XMLElement::SetString(const CFX_WideString &wsAttriName, const CFX_Wid m_Attributes.Add(wsAttriName); m_Attributes.Add(wsAttriValue); } -FX_INT32 CFDE_XMLElement::GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue) const +int32_t CFDE_XMLElement::GetInteger(FX_LPCWSTR pwsAttriName, int32_t iDefValue) const { - FX_INT32 iCount = m_Attributes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i += 2) { + int32_t iCount = m_Attributes.GetSize(); + for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(pwsAttriName) == 0) { return FXSYS_wtoi((FX_LPCWSTR)m_Attributes[i + 1]); } } return iDefValue; } -void CFDE_XMLElement::SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue) +void CFDE_XMLElement::SetInteger(FX_LPCWSTR pwsAttriName, int32_t iAttriValue) { CFX_WideString wsValue; wsValue.Format(L"%d", iAttriValue); @@ -815,8 +815,8 @@ void CFDE_XMLElement::SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue) } FX_FLOAT CFDE_XMLElement::GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue) const { - FX_INT32 iCount = m_Attributes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i += 2) { + int32_t iCount = m_Attributes.GetSize(); + for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(pwsAttriName) == 0) { return FX_wcstof((FX_LPCWSTR)m_Attributes[i + 1]); } @@ -831,8 +831,8 @@ void CFDE_XMLElement::SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue) } void CFDE_XMLElement::RemoveAttribute(FX_LPCWSTR pwsAttriName) { - FX_INT32 iCount = m_Attributes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i += 2) { + int32_t iCount = m_Attributes.GetSize(); + for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(pwsAttriName) == 0) { m_Attributes.RemoveAt(i + 1); m_Attributes.RemoveAt(i); @@ -940,7 +940,7 @@ void CFDE_XMLDoc::ReleaseParser() m_pSyntaxParser = NULL; } } -FX_BOOL CFDE_XMLDoc::LoadXML(IFX_Stream *pXMLStream, FX_INT32 iXMLPlaneSize , FX_INT32 iTextDataSize , FDE_LPXMLREADERHANDLER pHandler ) +FX_BOOL CFDE_XMLDoc::LoadXML(IFX_Stream *pXMLStream, int32_t iXMLPlaneSize , int32_t iTextDataSize , FDE_LPXMLREADERHANDLER pHandler ) { if (pXMLStream == NULL) { return FALSE; @@ -988,7 +988,7 @@ FX_BOOL CFDE_XMLDoc::LoadXML(IFDE_XMLParser *pXMLParser) m_pXMLParser = pXMLParser; return m_pXMLParser != NULL; } -FX_INT32 CFDE_XMLDoc::DoLoad(IFX_Pause *pPause) +int32_t CFDE_XMLDoc::DoLoad(IFX_Pause *pPause) { if (m_iStatus >= 100) { return m_iStatus; @@ -1024,7 +1024,7 @@ void CFDE_XMLDoc::SaveXMLNode(IFX_Stream *pXMLStream, IFDE_XMLNode *pINode) ws.Format(L"m_wsTarget); pXMLStream->WriteString(ws, ws.GetLength()); CFX_WideStringArray &attributes = pInstruction->m_Attributes; - FX_INT32 i, iCount = attributes.GetSize(); + int32_t i, iCount = attributes.GetSize(); CFX_WideString wsValue; for (i = 0; i < iCount; i += 2) { ws = L" "; @@ -1059,9 +1059,9 @@ void CFDE_XMLDoc::SaveXMLNode(IFX_Stream *pXMLStream, IFDE_XMLNode *pINode) ws += ((CFDE_XMLElement*)pNode)->m_wsTag; pXMLStream->WriteString(ws, ws.GetLength()); CFX_WideStringArray &attributes = ((CFDE_XMLElement*)pNode)->m_Attributes; - FX_INT32 iCount = attributes.GetSize(); + int32_t iCount = attributes.GetSize(); CFX_WideString wsValue; - for (FX_INT32 i = 0; i < iCount; i += 2) { + for (int32_t i = 0; i < iCount; i += 2) { ws = L" "; ws += attributes[i]; ws += L"=\""; @@ -1138,7 +1138,7 @@ void CFDE_XMLDoc::SaveXML(IFX_Stream *pXMLStream, FX_BOOL bSaveBOM) pNode = pNode->m_pNext; } if (pXMLStream == m_pStream) { - FX_INT32 iPos = pXMLStream->GetPosition(); + int32_t iPos = pXMLStream->GetPosition(); pXMLStream->SetLength(iPos); } } @@ -1159,10 +1159,10 @@ CFDE_XMLDOMParser::~CFDE_XMLDOMParser() m_ws1.Empty(); m_ws2.Empty(); } -FX_INT32 CFDE_XMLDOMParser::DoParser(IFX_Pause *pPause) +int32_t CFDE_XMLDOMParser::DoParser(IFX_Pause *pPause) { FX_DWORD dwRet; - FX_INT32 iCount = 0; + int32_t iCount = 0; while (TRUE) { dwRet = m_pParser->DoSyntaxParse(); switch (dwRet) { @@ -1278,10 +1278,10 @@ CFDE_XMLSAXParser::~CFDE_XMLSAXParser() m_ws1.Empty(); m_ws2.Empty(); } -FX_INT32 CFDE_XMLSAXParser::DoParser(IFX_Pause *pPause) +int32_t CFDE_XMLSAXParser::DoParser(IFX_Pause *pPause) { FX_DWORD dwRet = 0; - FX_INT32 iCount = 0; + int32_t iCount = 0; while (TRUE) { dwRet = m_pParser->DoSyntaxParse(); switch (dwRet) { @@ -1379,7 +1379,7 @@ inline void CFDE_XMLSAXParser::Pop() m_pTagTop = m_TagStack.GetTopElement(); } #ifdef _FDE_BLOCK_BUFFER -CFDE_BlockBuffer::CFDE_BlockBuffer(FX_INT32 iAllocStep) +CFDE_BlockBuffer::CFDE_BlockBuffer(int32_t iAllocStep) : m_iAllocStep(iAllocStep), m_iStartPosition(0), m_iBufferSize(0), @@ -1390,14 +1390,14 @@ CFDE_BlockBuffer::~CFDE_BlockBuffer() { ClearBuffer(); } -FX_LPWSTR CFDE_BlockBuffer::GetAvailableBlock(FX_INT32& iIndexInBlock) +FX_LPWSTR CFDE_BlockBuffer::GetAvailableBlock(int32_t& iIndexInBlock) { iIndexInBlock = 0; - FX_INT32 iBlockNum = m_BlockArray.GetSize(); + int32_t iBlockNum = m_BlockArray.GetSize(); if (iBlockNum == 0) { return NULL; } - FX_INT32 iRealIndex = m_iStartPosition + m_iDataLength; + int32_t iRealIndex = m_iStartPosition + m_iDataLength; FX_LPWSTR pDataBlock = NULL; if(iRealIndex == m_iBufferSize) { FX_LPWSTR pBlock = (FX_LPWSTR)FDE_Alloc(m_iAllocStep * sizeof(FX_WCHAR)); @@ -1408,18 +1408,18 @@ FX_LPWSTR CFDE_BlockBuffer::GetAvailableBlock(FX_INT32& iIndexInBlock) iIndexInBlock = 0; pDataBlock = pBlock; } else { - FX_INT32 iBlockIndex = iRealIndex / m_iAllocStep; - FX_INT32 iInnerIndex = iRealIndex % m_iAllocStep; + int32_t iBlockIndex = iRealIndex / m_iAllocStep; + int32_t iInnerIndex = iRealIndex % m_iAllocStep; iIndexInBlock = iInnerIndex; pDataBlock = (FX_LPWSTR)m_BlockArray[iBlockIndex]; } return pDataBlock; } -FX_BOOL CFDE_BlockBuffer::InitBuffer(FX_INT32 iBufferSize) +FX_BOOL CFDE_BlockBuffer::InitBuffer(int32_t iBufferSize) { ClearBuffer(); - FX_INT32 iNumOfBlock = (iBufferSize - 1) / m_iAllocStep + 1; - for (FX_INT32 i = 0; i < iNumOfBlock; i++) { + int32_t iNumOfBlock = (iBufferSize - 1) / m_iAllocStep + 1; + for (int32_t i = 0; i < iNumOfBlock; i++) { FX_LPWSTR pBlockBuffer = (FX_LPWSTR)FDE_Alloc(m_iAllocStep * sizeof(FX_WCHAR)); if (pBlockBuffer == NULL) { ClearBuffer(); @@ -1430,17 +1430,17 @@ FX_BOOL CFDE_BlockBuffer::InitBuffer(FX_INT32 iBufferSize) m_iBufferSize = iNumOfBlock * m_iAllocStep; return TRUE; } -void CFDE_BlockBuffer::SetTextChar(FX_INT32 iIndex, FX_WCHAR ch) +void CFDE_BlockBuffer::SetTextChar(int32_t iIndex, FX_WCHAR ch) { if (iIndex < 0) { return; } - FX_INT32 iRealIndex = m_iStartPosition + iIndex; - FX_INT32 iBlockIndex = iRealIndex / m_iAllocStep; - FX_INT32 iInnerIndex = iRealIndex % m_iAllocStep; - FX_INT32 iBlockSize = m_BlockArray.GetSize(); + int32_t iRealIndex = m_iStartPosition + iIndex; + int32_t iBlockIndex = iRealIndex / m_iAllocStep; + int32_t iInnerIndex = iRealIndex % m_iAllocStep; + int32_t iBlockSize = m_BlockArray.GetSize(); if (iBlockIndex >= iBlockSize) { - FX_INT32 iNewBlocks = iBlockIndex - iBlockSize + 1; + int32_t iNewBlocks = iBlockIndex - iBlockSize + 1; do { FX_LPWSTR pBlock = (FX_LPWSTR)FDE_Alloc(m_iAllocStep * sizeof(FX_WCHAR)); if (!pBlock) { @@ -1456,7 +1456,7 @@ void CFDE_BlockBuffer::SetTextChar(FX_INT32 iIndex, FX_WCHAR ch) m_iDataLength = iIndex + 1; } } -FX_INT32 CFDE_BlockBuffer::DeleteTextChars(FX_INT32 iCount, FX_BOOL bDirection ) +int32_t CFDE_BlockBuffer::DeleteTextChars(int32_t iCount, FX_BOOL bDirection ) { if (iCount <= 0) { return m_iDataLength; @@ -1473,10 +1473,10 @@ FX_INT32 CFDE_BlockBuffer::DeleteTextChars(FX_INT32 iCount, FX_BOOL bDirection ) } return m_iDataLength; } -void CFDE_BlockBuffer::GetTextData(CFX_WideString& wsTextData, FX_INT32 iStart, FX_INT32 iLength) const +void CFDE_BlockBuffer::GetTextData(CFX_WideString& wsTextData, int32_t iStart, int32_t iLength) const { wsTextData.Empty(); - FX_INT32 iMaybeDataLength = m_iBufferSize - 1 - m_iStartPosition; + int32_t iMaybeDataLength = m_iBufferSize - 1 - m_iStartPosition; if (iStart < 0 || iStart > iMaybeDataLength) { return; } @@ -1490,16 +1490,16 @@ void CFDE_BlockBuffer::GetTextData(CFX_WideString& wsTextData, FX_INT32 iStart, if (!pBuf) { return; } - FX_INT32 iStartBlockIndex = 0; - FX_INT32 iStartInnerIndex = 0; + int32_t iStartBlockIndex = 0; + int32_t iStartInnerIndex = 0; TextDataIndex2BufIndex(iStart, iStartBlockIndex, iStartInnerIndex); - FX_INT32 iEndBlockIndex = 0; - FX_INT32 iEndInnerIndex = 0; + int32_t iEndBlockIndex = 0; + int32_t iEndInnerIndex = 0; TextDataIndex2BufIndex(iStart + iLength, iEndBlockIndex, iEndInnerIndex); - FX_INT32 iPointer = 0; - for (FX_INT32 i = iStartBlockIndex; i <= iEndBlockIndex; i++) { - FX_INT32 iBufferPointer = 0; - FX_INT32 iCopyLength = m_iAllocStep; + int32_t iPointer = 0; + for (int32_t i = iStartBlockIndex; i <= iEndBlockIndex; i++) { + int32_t iBufferPointer = 0; + int32_t iCopyLength = m_iAllocStep; if (i == iStartBlockIndex) { iCopyLength -= iStartInnerIndex; iBufferPointer = iStartInnerIndex; @@ -1513,18 +1513,18 @@ void CFDE_BlockBuffer::GetTextData(CFX_WideString& wsTextData, FX_INT32 iStart, } wsTextData.ReleaseBuffer(iLength); } -void CFDE_BlockBuffer::TextDataIndex2BufIndex(const FX_INT32 iIndex, FX_INT32& iBlockIndex, FX_INT32& iInnerIndex) const +void CFDE_BlockBuffer::TextDataIndex2BufIndex(const int32_t iIndex, int32_t& iBlockIndex, int32_t& iInnerIndex) const { FXSYS_assert(iIndex >= 0); - FX_INT32 iRealIndex = m_iStartPosition + iIndex; + int32_t iRealIndex = m_iStartPosition + iIndex; iBlockIndex = iRealIndex / m_iAllocStep; iInnerIndex = iRealIndex % m_iAllocStep; } void CFDE_BlockBuffer::ClearBuffer() { m_iBufferSize = 0; - FX_INT32 iSize = m_BlockArray.GetSize(); - for (FX_INT32 i = 0; i < iSize; i++) { + int32_t iSize = m_BlockArray.GetSize(); + for (int32_t i = 0; i < iSize; i++) { FDE_Free(m_BlockArray[i]); m_BlockArray[i] = NULL; } @@ -1565,15 +1565,15 @@ CFDE_XMLSyntaxParser::CFDE_XMLSyntaxParser() m_CurNode.iNodeNum = -1; m_CurNode.eNodeType = FDE_XMLNODE_Unknown; } -void CFDE_XMLSyntaxParser::Init(IFX_Stream *pStream, FX_INT32 iXMLPlaneSize, FX_INT32 iTextDataSize ) +void CFDE_XMLSyntaxParser::Init(IFX_Stream *pStream, int32_t iXMLPlaneSize, int32_t iTextDataSize ) { FXSYS_assert(m_pStream == NULL && m_pBuffer == NULL); FXSYS_assert(pStream != NULL && iXMLPlaneSize > 0); - FX_INT32 iStreamLength = pStream->GetLength(); + int32_t iStreamLength = pStream->GetLength(); FXSYS_assert(iStreamLength > 0); m_pStream = pStream; m_iXMLPlaneSize = FX_MIN(iXMLPlaneSize, iStreamLength); - FX_BYTE bom[4]; + uint8_t bom[4]; m_iCurrentPos = m_pStream->GetBOM(bom); FXSYS_assert(m_pBuffer == NULL); m_pBuffer = (FX_LPWSTR)FDE_Alloc(m_iXMLPlaneSize * sizeof(FX_WCHAR)); @@ -1590,8 +1590,8 @@ FX_DWORD CFDE_XMLSyntaxParser::DoSyntaxParse() return m_dwStatus; } FXSYS_assert(m_pStream != NULL && m_pBuffer != NULL && m_BlockBuffer.IsInitialized()); - FX_INT32 iStreamLength = m_pStream->GetLength(); - FX_INT32 iPos; + int32_t iStreamLength = m_pStream->GetLength(); + int32_t iPos; FX_WCHAR ch; FX_DWORD dwStatus = FDE_XMLSYNTAXSTATUS_None; while (TRUE) { @@ -2066,16 +2066,16 @@ CFDE_XMLSyntaxParser::CFDE_XMLSyntaxParser() m_CurNode.iNodeNum = -1; m_CurNode.eNodeType = FDE_XMLNODE_Unknown; } -void CFDE_XMLSyntaxParser::Init(IFX_Stream *pStream, FX_INT32 iXMLPlaneSize, FX_INT32 iTextDataSize ) +void CFDE_XMLSyntaxParser::Init(IFX_Stream *pStream, int32_t iXMLPlaneSize, int32_t iTextDataSize ) { FXSYS_assert(m_pStream == NULL && m_pBuffer == NULL); FXSYS_assert(pStream != NULL && iXMLPlaneSize > 0 && iTextDataSize > 0); - FX_INT32 iStreamLength = pStream->GetLength(); + int32_t iStreamLength = pStream->GetLength(); FXSYS_assert(iStreamLength > 0); m_pStream = pStream; m_iXMLPlaneSize = FX_MIN(iXMLPlaneSize, iStreamLength); m_iTextDataSize = iTextDataSize; - FX_BYTE bom[4]; + uint8_t bom[4]; m_iCurrentPos = m_pStream->GetBOM(bom); FXSYS_assert(m_pBuffer == NULL); m_pBuffer = (FX_LPWSTR)FDE_Alloc(m_iXMLPlaneSize * sizeof(FX_WCHAR)); @@ -2091,8 +2091,8 @@ FX_DWORD CFDE_XMLSyntaxParser::DoSyntaxParse() return m_dwStatus; } FXSYS_assert(m_pStream != NULL && m_pBuffer != NULL && m_pwsTextData != NULL); - FX_INT32 iStreamLength = m_pStream->GetLength(); - FX_INT32 iPos; + int32_t iStreamLength = m_pStream->GetLength(); + int32_t iPos; FX_WCHAR ch; FX_DWORD dwStatus = FDE_XMLSYNTAXSTATUS_None; while (TRUE) { @@ -2506,12 +2506,12 @@ CFDE_XMLSyntaxParser::~CFDE_XMLSyntaxParser() FDE_Free(m_pBuffer); } } -FX_INT32 CFDE_XMLSyntaxParser::GetStatus() const +int32_t CFDE_XMLSyntaxParser::GetStatus() const { if (m_pStream == NULL) { return -1; } - FX_INT32 iStreamLength = m_pStream->GetLength(); + int32_t iStreamLength = m_pStream->GetLength(); if (iStreamLength < 1) { return 100; } @@ -2523,10 +2523,10 @@ FX_INT32 CFDE_XMLSyntaxParser::GetStatus() const } return m_iParsedBytes * 100 / iStreamLength; } -static FX_INT32 FX_GetUTF8EncodeLength(FX_LPCWSTR pSrc, FX_INT32 iSrcLen) +static int32_t FX_GetUTF8EncodeLength(FX_LPCWSTR pSrc, int32_t iSrcLen) { FX_DWORD unicode = 0; - FX_INT32 iDstNum = 0; + int32_t iDstNum = 0; while (iSrcLen -- > 0) { unicode = *pSrc ++; int nbytes = 0; @@ -2552,8 +2552,8 @@ FX_FILESIZE CFDE_XMLSyntaxParser::GetCurrentBinaryPos() const if (m_pStream == NULL) { return 0; } - FX_INT32 nSrcLen = m_pStart - m_pBuffer; - FX_INT32 nDstLen = FX_GetUTF8EncodeLength(m_pBuffer, nSrcLen); + int32_t nSrcLen = m_pStart - m_pBuffer; + int32_t nDstLen = FX_GetUTF8EncodeLength(m_pBuffer, nSrcLen); return m_iParsedBytes + nDstLen; } #ifdef _FDE_BLOCK_BUFFER @@ -2570,13 +2570,13 @@ void CFDE_XMLSyntaxParser::ParseTextChar(FX_WCHAR ch) if (m_iEntityStart > -1 && ch == L';') { CFX_WideString csEntity; m_BlockBuffer.GetTextData(csEntity, m_iEntityStart + 1, (m_iDataLength - 1) - m_iEntityStart - 1); - FX_INT32 iLen = csEntity.GetLength(); + int32_t iLen = csEntity.GetLength(); if (iLen > 0) { if (csEntity[0] == L'#') { ch = 0; FX_WCHAR w; if (iLen > 1 && csEntity[1] == L'x') { - for (FX_INT32 i = 2; i < iLen; i ++) { + for (int32_t i = 2; i < iLen; i ++) { w = csEntity[i]; if (w >= L'0' && w <= L'9') { ch = (ch << 4) + w - L'0'; @@ -2589,7 +2589,7 @@ void CFDE_XMLSyntaxParser::ParseTextChar(FX_WCHAR ch) } } } else { - for (FX_INT32 i = 1; i < iLen; i ++) { + for (int32_t i = 1; i < iLen; i ++) { w = csEntity[i]; if (w < L'0' || w > L'9') { break; @@ -2639,13 +2639,13 @@ void CFDE_XMLSyntaxParser::ParseTextChar(FX_WCHAR ch) m_pwsTextData[m_iDataPos] = ch; if (m_iEntityStart > -1 && ch == L';') { CFX_WideString csEntity(m_pwsTextData + m_iEntityStart + 1, m_iDataPos - m_iEntityStart - 1); - FX_INT32 iLen = csEntity.GetLength(); + int32_t iLen = csEntity.GetLength(); if (iLen > 0) { if (csEntity[0] == L'#') { ch = 0; FX_WCHAR w; if (iLen > 1 && csEntity[1] == L'x') { - for (FX_INT32 i = 2; i < iLen; i ++) { + for (int32_t i = 2; i < iLen; i ++) { w = csEntity[i]; if (w >= L'0' && w <= L'9') { ch = (ch << 4) + w - L'0'; @@ -2658,7 +2658,7 @@ void CFDE_XMLSyntaxParser::ParseTextChar(FX_WCHAR ch) } } } else { - for (FX_INT32 i = 1; i < iLen; i ++) { + for (int32_t i = 1; i < iLen; i ++) { w = csEntity[i]; if (w < L'0' || w > L'9') { break; diff --git a/xfa/src/fdp/src/xml/fde_xml.h b/xfa/src/fdp/src/xml/fde_xml.h index edbf01584a..9353561264 100644 --- a/xfa/src/fdp/src/xml/fde_xml.h +++ b/xfa/src/fdp/src/xml/fde_xml.h @@ -31,15 +31,15 @@ public: { return FDE_XMLNODE_Unknown; } - virtual FX_INT32 CountChildNodes() const; - virtual CFDE_XMLNode* GetChildNode(FX_INT32 index) const; - virtual FX_INT32 GetChildNodeIndex(CFDE_XMLNode *pNode) const; - virtual CFDE_XMLNode* GetPath(FX_LPCWSTR pPath, FX_INT32 iLength = -1, FX_BOOL bQualifiedName = TRUE) const; - virtual FX_INT32 InsertChildNode(CFDE_XMLNode *pNode, FX_INT32 index = -1); + virtual int32_t CountChildNodes() const; + virtual CFDE_XMLNode* GetChildNode(int32_t index) const; + virtual int32_t GetChildNodeIndex(CFDE_XMLNode *pNode) const; + virtual CFDE_XMLNode* GetPath(FX_LPCWSTR pPath, int32_t iLength = -1, FX_BOOL bQualifiedName = TRUE) const; + virtual int32_t InsertChildNode(CFDE_XMLNode *pNode, int32_t index = -1); virtual void RemoveChildNode(CFDE_XMLNode *pNode); virtual void DeleteChildren(); virtual CFDE_XMLNode* GetNodeItem(IFDE_XMLNode::NodeItem eItem) const; - virtual FX_INT32 GetNodeLevel() const; + virtual int32_t GetNodeLevel() const; virtual FX_BOOL InsertNodeItem(IFDE_XMLNode::NodeItem eItem, CFDE_XMLNode *pNode); virtual CFDE_XMLNode* RemoveNodeItem(IFDE_XMLNode::NodeItem eItem); virtual CFDE_XMLNode* Clone(FX_BOOL bRecursive); @@ -69,20 +69,20 @@ public: { wsTarget = m_wsTarget; } - virtual FX_INT32 CountAttributes() const; - virtual FX_BOOL GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const; + virtual int32_t CountAttributes() const; + virtual FX_BOOL GetAttribute(int32_t index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const; virtual FX_BOOL HasAttribute(FX_LPCWSTR pwsAttriName) const; virtual void GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue = NULL) const; virtual void SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue); - virtual FX_INT32 GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue = 0) const; - virtual void SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue); + virtual int32_t GetInteger(FX_LPCWSTR pwsAttriName, int32_t iDefValue = 0) const; + virtual void SetInteger(FX_LPCWSTR pwsAttriName, int32_t iAttriValue); virtual FX_FLOAT GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue = 0) const; virtual void SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue); virtual void RemoveAttribute(FX_LPCWSTR pwsAttriName); - virtual FX_INT32 CountData() const; - virtual FX_BOOL GetData(FX_INT32 index, CFX_WideString &wsData) const; + virtual int32_t CountData() const; + virtual FX_BOOL GetData(int32_t index, CFX_WideString &wsData) const; virtual void AppendData(const CFX_WideString &wsData); - virtual void RemoveData(FX_INT32 index); + virtual void RemoveData(int32_t index); public: ~CFDE_XMLInstruction() {} CFX_WideString m_wsTarget; @@ -106,13 +106,13 @@ public: virtual void GetLocalTagName(CFX_WideString &wsTag) const; virtual void GetNamespacePrefix(CFX_WideString &wsPrefix) const; virtual void GetNamespaceURI(CFX_WideString &wsNamespace) const; - virtual FX_INT32 CountAttributes() const; - virtual FX_BOOL GetAttribute(FX_INT32 index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const; + virtual int32_t CountAttributes() const; + virtual FX_BOOL GetAttribute(int32_t index, CFX_WideString &wsAttriName, CFX_WideString &wsAttriValue) const; virtual FX_BOOL HasAttribute(FX_LPCWSTR pwsAttriName) const; virtual void GetString(FX_LPCWSTR pwsAttriName, CFX_WideString &wsAttriValue, FX_LPCWSTR pwsDefValue = NULL) const; virtual void SetString(const CFX_WideString &wsAttriName, const CFX_WideString &wsAttriValue); - virtual FX_INT32 GetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iDefValue = 0) const; - virtual void SetInteger(FX_LPCWSTR pwsAttriName, FX_INT32 iAttriValue); + virtual int32_t GetInteger(FX_LPCWSTR pwsAttriName, int32_t iDefValue = 0) const; + virtual void SetInteger(FX_LPCWSTR pwsAttriName, int32_t iAttriValue); virtual FX_FLOAT GetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fDefValue = 0) const; virtual void SetFloat(FX_LPCWSTR pwsAttriName, FX_FLOAT fAttriValue); virtual void RemoveAttribute(FX_LPCWSTR pwsAttriName); @@ -190,9 +190,9 @@ public: { FDE_Delete this; } - virtual FX_BOOL LoadXML(IFX_Stream *pXMLStream, FX_INT32 iXMLPlaneSize = 8192, FX_INT32 iTextDataSize = 256, FDE_LPXMLREADERHANDLER pHandler = NULL); + virtual FX_BOOL LoadXML(IFX_Stream *pXMLStream, int32_t iXMLPlaneSize = 8192, int32_t iTextDataSize = 256, FDE_LPXMLREADERHANDLER pHandler = NULL); virtual FX_BOOL LoadXML(IFDE_XMLParser *pXMLParser); - virtual FX_INT32 DoLoad(IFX_Pause *pPause = NULL); + virtual int32_t DoLoad(IFX_Pause *pPause = NULL); virtual void CloseXML(); virtual CFDE_XMLNode* GetRoot() const { @@ -202,7 +202,7 @@ public: virtual void SaveXMLNode(IFX_Stream *pXMLStream, IFDE_XMLNode *pNode); protected: IFX_Stream *m_pStream; - FX_INT32 m_iStatus; + int32_t m_iStatus; CFDE_XMLNode *m_pRoot; IFDE_XMLSyntaxParser *m_pSyntaxParser; IFDE_XMLParser *m_pXMLParser; @@ -220,7 +220,7 @@ public: { FDE_Delete this; } - virtual FX_INT32 DoParser(IFX_Pause *pPause); + virtual int32_t DoParser(IFX_Pause *pPause); private: CFDE_XMLNode *m_pRoot; IFDE_XMLSyntaxParser *m_pParser; @@ -249,7 +249,7 @@ public: { FDE_Delete this; } - virtual FX_INT32 DoParser(IFX_Pause *pPause); + virtual int32_t DoParser(IFX_Pause *pPause); private: void Push(const CFDE_XMLTAG &xmlTag); void Pop(); @@ -264,10 +264,10 @@ private: class CFDE_BlockBuffer : public CFX_Target { public: - CFDE_BlockBuffer(FX_INT32 iAllocStep = 1024 * 1024); + CFDE_BlockBuffer(int32_t iAllocStep = 1024 * 1024); ~CFDE_BlockBuffer(); - FX_BOOL InitBuffer(FX_INT32 iBufferSize = 1024 * 1024); + FX_BOOL InitBuffer(int32_t iBufferSize = 1024 * 1024); FX_BOOL IsInitialized() { return m_iBufferSize / m_iAllocStep >= 1; @@ -276,12 +276,12 @@ public: { FDE_Delete this; } - FX_LPWSTR GetAvailableBlock(FX_INT32& iIndexInBlock); - inline FX_INT32 GetAllocStep() const + FX_LPWSTR GetAvailableBlock(int32_t& iIndexInBlock); + inline int32_t GetAllocStep() const { return m_iAllocStep; } - inline FX_INT32& GetDataLengthRef() + inline int32_t& GetDataLengthRef() { return m_iDataLength; } @@ -292,18 +292,18 @@ public: } m_iDataLength = 0; } - void SetTextChar(FX_INT32 iIndex, FX_WCHAR ch); - FX_INT32 DeleteTextChars(FX_INT32 iCount, FX_BOOL bDirection = TRUE); - void GetTextData(CFX_WideString& wsTextData, FX_INT32 iStart = 0, FX_INT32 iLength = -1) const; + void SetTextChar(int32_t iIndex, FX_WCHAR ch); + int32_t DeleteTextChars(int32_t iCount, FX_BOOL bDirection = TRUE); + void GetTextData(CFX_WideString& wsTextData, int32_t iStart = 0, int32_t iLength = -1) const; protected: - inline void TextDataIndex2BufIndex(const FX_INT32 iIndex, FX_INT32& iBlockIndex, FX_INT32& iInnerIndex) const; + inline void TextDataIndex2BufIndex(const int32_t iIndex, int32_t& iBlockIndex, int32_t& iInnerIndex) const; void ClearBuffer(); CFX_PtrArray m_BlockArray; - FX_INT32 m_iDataLength; - FX_INT32 m_iBufferSize; - FX_INT32 m_iAllocStep; - FX_INT32 m_iStartPosition; + int32_t m_iDataLength; + int32_t m_iBufferSize; + int32_t m_iAllocStep; + int32_t m_iStartPosition; }; #endif #define FDE_XMLSYNTAXMODE_Text 0 @@ -334,19 +334,19 @@ public: { FDE_Delete this; } - virtual void Init(IFX_Stream *pStream, FX_INT32 iXMLPlaneSize, FX_INT32 iTextDataSize = 256); + virtual void Init(IFX_Stream *pStream, int32_t iXMLPlaneSize, int32_t iTextDataSize = 256); virtual FX_DWORD DoSyntaxParse(); - virtual FX_INT32 GetStatus() const; - virtual FX_INT32 GetCurrentPos() const + virtual int32_t GetStatus() const; + virtual int32_t GetCurrentPos() const { return m_iParsedChars + (m_pStart - m_pBuffer); } virtual FX_FILESIZE GetCurrentBinaryPos() const; - virtual FX_INT32 GetCurrentNodeNumber() const + virtual int32_t GetCurrentNodeNumber() const { return m_iCurrentNodeNum; } - virtual FX_INT32 GetLastNodeNumber() const + virtual int32_t GetLastNodeNumber() const { return m_iLastNodeNum; } @@ -403,14 +403,14 @@ public: #endif protected: IFX_Stream *m_pStream; - FX_INT32 m_iXMLPlaneSize; - FX_INT32 m_iCurrentPos; - FX_INT32 m_iCurrentNodeNum; - FX_INT32 m_iLastNodeNum; - FX_INT32 m_iParsedChars; - FX_INT32 m_iParsedBytes; + int32_t m_iXMLPlaneSize; + int32_t m_iCurrentPos; + int32_t m_iCurrentNodeNum; + int32_t m_iLastNodeNum; + int32_t m_iParsedChars; + int32_t m_iParsedBytes; FX_LPWSTR m_pBuffer; - FX_INT32 m_iBufferChars; + int32_t m_iBufferChars; FX_BOOL m_bEOS; FX_LPWSTR m_pStart; FX_LPWSTR m_pEnd; @@ -418,20 +418,20 @@ protected: CFDE_XMLNodeStack m_XMLNodeStack; #ifdef _FDE_BLOCK_BUFFER CFDE_BlockBuffer m_BlockBuffer; - FX_INT32 m_iAllocStep; - FX_INT32& m_iDataLength; + int32_t m_iAllocStep; + int32_t& m_iDataLength; FX_LPWSTR m_pCurrentBlock; - FX_INT32 m_iIndexInBlock; + int32_t m_iIndexInBlock; #else - FX_INT32 m_iTextDataSize; + int32_t m_iTextDataSize; FX_LPWSTR m_pwsTextData; - FX_INT32 m_iDataPos; + int32_t m_iDataPos; #endif - FX_INT32 m_iTextDataLength; + int32_t m_iTextDataLength; FX_DWORD m_dwStatus; FX_DWORD m_dwMode; FX_WCHAR m_wQuotationMark; - FX_INT32 m_iEntityStart; + int32_t m_iEntityStart; CFX_DWordStack m_SkipStack; FX_WCHAR m_SkipChar; inline void ParseTextChar(FX_WCHAR ch); diff --git a/xfa/src/fee/include/fx_wordbreak.h b/xfa/src/fee/include/fx_wordbreak.h index c91aca694a..275930a8b7 100644 --- a/xfa/src/fee/include/fx_wordbreak.h +++ b/xfa/src/fee/include/fx_wordbreak.h @@ -14,9 +14,9 @@ public: virtual void Attach(IFX_CharIter * pIter) = 0; virtual void Attach(const CFX_WideString & wsText) = 0; virtual FX_BOOL Next(FX_BOOL bPrev) = 0; - virtual void SetAt(FX_INT32 nIndex) = 0; - virtual FX_INT32 GetWordPos() const = 0; - virtual FX_INT32 GetWordLength() const = 0; + virtual void SetAt(int32_t nIndex) = 0; + virtual int32_t GetWordPos() const = 0; + virtual int32_t GetWordLength() const = 0; virtual void GetWord(CFX_WideString &wsWord) const = 0; virtual FX_BOOL IsEOF(FX_BOOL bTail = TRUE) const = 0; }; diff --git a/xfa/src/fee/include/ifde_txtedtbuf.h b/xfa/src/fee/include/ifde_txtedtbuf.h index 6cfc3ec977..921b17a518 100644 --- a/xfa/src/fee/include/ifde_txtedtbuf.h +++ b/xfa/src/fee/include/ifde_txtedtbuf.h @@ -13,16 +13,16 @@ class IFDE_TxtEdtBuf public: virtual void Release() = 0; - virtual FX_BOOL SetChunkSize(FX_INT32 nChunkSize) = 0; - virtual FX_INT32 GetChunkSize() const = 0; - virtual FX_INT32 GetTextLength() const = 0; + virtual FX_BOOL SetChunkSize(int32_t nChunkSize) = 0; + virtual int32_t GetChunkSize() const = 0; + virtual int32_t GetTextLength() const = 0; virtual void SetText(const CFX_WideString &wsText) = 0; virtual void GetText(CFX_WideString &wsText) const = 0; - virtual FX_WCHAR GetCharByIndex(FX_INT32 nIndex) const = 0; - virtual void GetRange(CFX_WideString &wsText, FX_INT32 nBegin, FX_INT32 nCount = - 1) const = 0; + virtual FX_WCHAR GetCharByIndex(int32_t nIndex) const = 0; + virtual void GetRange(CFX_WideString &wsText, int32_t nBegin, int32_t nCount = - 1) const = 0; - virtual void Insert(FX_INT32 nPos, FX_LPCWSTR lpText, FX_INT32 nLength = 1) = 0; - virtual void Delete(FX_INT32 nIndex, FX_INT32 nLength = 1) = 0; + virtual void Insert(int32_t nPos, FX_LPCWSTR lpText, int32_t nLength = 1) = 0; + virtual void Delete(int32_t nIndex, int32_t nLength = 1) = 0; virtual void Clear(FX_BOOL bRelease = TRUE) = 0; diff --git a/xfa/src/fee/include/ifde_txtedtengine.h b/xfa/src/fee/include/ifde_txtedtengine.h index 5c16696845..10f90881bd 100644 --- a/xfa/src/fee/include/ifde_txtedtengine.h +++ b/xfa/src/fee/include/ifde_txtedtengine.h @@ -104,7 +104,7 @@ struct _FDE_TXTEDTPARAMS { } FX_FLOAT fPlateWidth; FX_FLOAT fPlateHeight; - FX_INT32 nLineCount; + int32_t nLineCount; FX_DWORD dwLayoutStyles; FX_DWORD dwAlignment; FX_DWORD dwMode; @@ -116,9 +116,9 @@ struct _FDE_TXTEDTPARAMS { FX_BOOL bTabEquidistant; FX_WCHAR wDefChar; FX_WCHAR wLineBreakChar; - FX_INT32 nCharRotation; - FX_INT32 nLineEnd; - FX_INT32 nHorzScale; + int32_t nCharRotation; + int32_t nLineEnd; + int32_t nHorzScale; FX_FLOAT fCharSpace; IFDE_TxtEdtEventSink * pEventSink; }; @@ -130,7 +130,7 @@ enum FDE_TXTEDT_TEXTCHANGE_TYPE { FDE_TXTEDT_TEXTCHANGE_TYPE_Replace , }; struct _FDE_TXTEDT_TEXTCHANGE_INFO { - FX_INT32 nChangeType; + int32_t nChangeType; CFX_WideString wsInsert; CFX_WideString wsDelete; CFX_WideString wsPrevText; @@ -140,18 +140,18 @@ typedef _FDE_TXTEDT_TEXTCHANGE_INFO* FDE_LPTXTEDT_TEXTCHANGE_INFO; class IFDE_TxtEdtEventSink { public: - virtual void On_CaretChanged(IFDE_TxtEdtEngine * pEdit, FX_INT32 nPage, FX_BOOL bVisible = TRUE) = 0; + virtual void On_CaretChanged(IFDE_TxtEdtEngine * pEdit, int32_t nPage, FX_BOOL bVisible = TRUE) = 0; virtual void On_TextChanged(IFDE_TxtEdtEngine * pEdit, FDE_TXTEDT_TEXTCHANGE_INFO &ChangeInfo) = 0; virtual void On_PageCountChanged(IFDE_TxtEdtEngine * pEdit) = 0; virtual void On_SelChanged(IFDE_TxtEdtEngine * pEdit) = 0; - virtual FX_BOOL On_PageLoad(IFDE_TxtEdtEngine * pEdit, FX_INT32 nPageIndex, FX_INT32 nPurpose) = 0; - virtual FX_BOOL On_PageUnload(IFDE_TxtEdtEngine * pEdit, FX_INT32 nPageIndex, FX_INT32 nPurpose) = 0; - virtual FX_BOOL On_PageChange(IFDE_TxtEdtEngine * pEdit, FX_INT32 nPageIndex) = 0; + virtual FX_BOOL On_PageLoad(IFDE_TxtEdtEngine * pEdit, int32_t nPageIndex, int32_t nPurpose) = 0; + virtual FX_BOOL On_PageUnload(IFDE_TxtEdtEngine * pEdit, int32_t nPageIndex, int32_t nPurpose) = 0; + virtual FX_BOOL On_PageChange(IFDE_TxtEdtEngine * pEdit, int32_t nPageIndex) = 0; virtual void On_AddDoRecord(IFDE_TxtEdtEngine * pEdit, FX_BSTR bsDoRecord) = 0; - virtual FX_BOOL On_ValidateField(IFDE_TxtEdtEngine * pEdit, FX_INT32 nBlockIndex, FX_INT32 nFieldIndex, \ - const CFX_WideString &wsFieldText, FX_INT32 nCharIndex) = 0; - virtual FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine * pEdit, FX_INT32 nBlockIndex) = 0; - virtual FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine * pEdit, FX_INT32 nBlockIndex, CFX_WideString &wsBlockText) = 0; + virtual FX_BOOL On_ValidateField(IFDE_TxtEdtEngine * pEdit, int32_t nBlockIndex, int32_t nFieldIndex, \ + const CFX_WideString &wsFieldText, int32_t nCharIndex) = 0; + virtual FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine * pEdit, int32_t nBlockIndex) = 0; + virtual FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine * pEdit, int32_t nBlockIndex, CFX_WideString &wsBlockText) = 0; virtual FX_BOOL On_Validate(IFDE_TxtEdtEngine * pEdit, CFX_WideString &wsText) = 0; }; class IFX_CharIter @@ -160,8 +160,8 @@ public: virtual void Release() = 0; virtual FX_BOOL Next(FX_BOOL bPrev = FALSE) = 0; virtual FX_WCHAR GetChar() = 0; - virtual void SetAt(FX_INT32 nIndex) = 0; - virtual FX_INT32 GetAt() const = 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 IFX_CharIter * Clone() = 0; }; @@ -174,60 +174,60 @@ public: virtual void SetEditParams(const FDE_TXTEDTPARAMS ¶ms) = 0; virtual const FDE_TXTEDTPARAMS* GetEditParams() const = 0; - virtual FX_INT32 CountPages() const = 0; - virtual IFDE_TxtEdtPage* GetPage(FX_INT32 nIndex) = 0; - virtual FX_BOOL SetBufChunkSize(FX_INT32 nChunkSize) = 0; + virtual int32_t CountPages() const = 0; + virtual IFDE_TxtEdtPage* GetPage(int32_t nIndex) = 0; + virtual FX_BOOL SetBufChunkSize(int32_t nChunkSize) = 0; virtual void SetTextByStream(IFX_Stream * pStream) = 0; virtual void SetText(const CFX_WideString &wsText) = 0; - virtual FX_INT32 GetTextLength() const = 0; - virtual void GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount = -1) = 0; + virtual int32_t GetTextLength() const = 0; + virtual void GetText(CFX_WideString &wsText, int32_t nStart, int32_t nCount = -1) = 0; virtual void ClearText() = 0; - virtual FX_INT32 GetCaretRect(CFX_RectF &rtCaret) const = 0; - virtual FX_INT32 GetCaretPos() const = 0; - virtual FX_INT32 SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore = TRUE) = 0; - virtual FX_INT32 MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, FX_BOOL bShift = FALSE, FX_BOOL bCtrl = FALSE) = 0; + virtual int32_t GetCaretRect(CFX_RectF &rtCaret) const = 0; + virtual int32_t GetCaretPos() const = 0; + virtual int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE) = 0; + virtual int32_t MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, FX_BOOL bShift = FALSE, FX_BOOL bCtrl = FALSE) = 0; virtual void Lock() = 0; virtual void Unlock() = 0; virtual FX_BOOL IsLocked() const = 0; - virtual FX_INT32 Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength) = 0; - virtual FX_INT32 Delete(FX_INT32 nStart, FX_BOOL bBackspace = FALSE) = 0; - virtual FX_INT32 DeleteRange(FX_INT32 nStart, FX_INT32 nCount = -1) = 0; - virtual FX_INT32 Replace(FX_INT32 nStart, FX_INT32 nLength, const CFX_WideString &wsReplace) = 0; - virtual void SetLimit(FX_INT32 nLimit) = 0; + virtual int32_t Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength) = 0; + virtual int32_t Delete(int32_t nStart, FX_BOOL bBackspace = FALSE) = 0; + virtual int32_t DeleteRange(int32_t nStart, int32_t nCount = -1) = 0; + virtual int32_t Replace(int32_t nStart, int32_t nLength, const CFX_WideString &wsReplace) = 0; + virtual void SetLimit(int32_t nLimit) = 0; virtual void SetAliasChar(FX_WCHAR wAlias) = 0; - virtual void SetFormatBlock(FX_INT32 nIndex, const CFX_WideString &wsBlockFormat) = 0; - virtual FX_INT32 CountEditBlocks() const = 0; - virtual void GetEditBlockText(FX_INT32 nIndex, CFX_WideString &wsBlockText) const = 0; - virtual FX_INT32 CountEditFields(FX_INT32 nBlockIndex) const = 0; - virtual void GetEditFieldText(FX_INT32 nBlockIndex, FX_INT32 nFieldIndex, CFX_WideString &wsFieldText) const = 0; + virtual void SetFormatBlock(int32_t nIndex, const CFX_WideString &wsBlockFormat) = 0; + virtual int32_t CountEditBlocks() const = 0; + virtual void GetEditBlockText(int32_t nIndex, CFX_WideString &wsBlockText) const = 0; + virtual int32_t CountEditFields(int32_t nBlockIndex) const = 0; + virtual void GetEditFieldText(int32_t nBlockIndex, int32_t nFieldIndex, CFX_WideString &wsFieldText) const = 0; virtual void StartEdit() = 0; virtual void EndEdit() = 0; - virtual void AddSelRange(FX_INT32 nStart, FX_INT32 nCount = -1) = 0; - virtual FX_INT32 CountSelRanges() = 0; - virtual FX_INT32 GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart) = 0; + virtual void AddSelRange(int32_t nStart, int32_t nCount = -1) = 0; + virtual int32_t CountSelRanges() = 0; + virtual int32_t GetSelRange(int32_t nIndex, int32_t &nStart) = 0; virtual void ClearSelection() = 0; virtual FX_BOOL Redo(FX_BSTR bsRedo) = 0; virtual FX_BOOL Undo(FX_BSTR bsUndo) = 0; - virtual FX_INT32 StartLayout() = 0; - virtual FX_INT32 DoLayout(IFX_Pause *pPause) = 0; + virtual int32_t StartLayout() = 0; + virtual int32_t DoLayout(IFX_Pause *pPause) = 0; virtual void EndLayout() = 0; virtual FX_BOOL Optimize(IFX_Pause * pPause = NULL) = 0; - virtual FX_INT32 CountParags() const = 0; - virtual IFDE_TxtEdtParag* GetParag(FX_INT32 nParagIndex) const = 0; + virtual int32_t CountParags() const = 0; + virtual IFDE_TxtEdtParag* GetParag(int32_t nParagIndex) const = 0; virtual IFX_CharIter* CreateCharIter() = 0; }; class IFDE_TxtEdtParag { public: - virtual FX_INT32 GetTextLength() const = 0; - virtual FX_INT32 GetStartIndex() const = 0; - virtual FX_INT32 CountLines() const = 0; - virtual void GetLineRange(FX_INT32 nLineIndex, FX_INT32& nStart, FX_INT32& nCount) const = 0; + virtual int32_t GetTextLength() const = 0; + virtual int32_t GetStartIndex() const = 0; + virtual int32_t CountLines() const = 0; + virtual void GetLineRange(int32_t nLineIndex, int32_t& nStart, int32_t& nCount) const = 0; }; #endif diff --git a/xfa/src/fee/include/ifde_txtedtpage.h b/xfa/src/fee/include/ifde_txtedtpage.h index 7555434f5f..4e6c859793 100644 --- a/xfa/src/fee/include/ifde_txtedtpage.h +++ b/xfa/src/fee/include/ifde_txtedtpage.h @@ -11,21 +11,21 @@ class IFDE_TxtEdtPage; class IFDE_TxtEdtPage : public IFDE_CanvasSet, public IFX_TxtAccess { public: - static IFDE_TxtEdtPage * Create(IFDE_TxtEdtEngine * pEngine, FX_INT32 nIndex); + static IFDE_TxtEdtPage * Create(IFDE_TxtEdtEngine * pEngine, int32_t nIndex); virtual void Release() = 0; virtual IFDE_TxtEdtEngine * GetEngine() const = 0; - virtual FX_INT32 GetCharRect(FX_INT32 nIndex, CFX_RectF &rect, FX_BOOL bBBox = FALSE) const = 0; - virtual FX_INT32 GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefore) = 0; - virtual void CalcRangeRectArray(FX_INT32 nStart, FX_INT32 nCount, CFX_RectFArray &RectFArr) const = 0; - virtual FX_INT32 SelectWord (const CFX_PointF &fPoint, FX_INT32 &nCount) = 0; - virtual FX_INT32 GetCharStart() const = 0; - virtual FX_INT32 GetCharCount() 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; + virtual void CalcRangeRectArray(int32_t nStart, int32_t nCount, CFX_RectFArray &RectFArr) const = 0; + virtual int32_t SelectWord (const CFX_PointF &fPoint, int32_t &nCount) = 0; + virtual int32_t GetCharStart() const = 0; + virtual int32_t GetCharCount() const = 0; - virtual FX_INT32 GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS* &pCharPos, FX_LPRECTF pBBox = NULL) const = 0; + virtual int32_t GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS* &pCharPos, FX_LPRECTF pBBox = NULL) const = 0; virtual FX_BOOL IsLoaded(FX_LPCRECTF pClipBox = NULL) = 0; - virtual FX_INT32 LoadPage(FX_LPCRECTF pClipBox = NULL, IFX_Pause *pPause = NULL) = 0; + virtual int32_t LoadPage(FX_LPCRECTF pClipBox = NULL, IFX_Pause *pPause = NULL) = 0; virtual void UnloadPage(FX_LPCRECTF pClipBox = NULL) = 0; virtual const CFX_RectF& GetContentsBox() = 0; }; diff --git a/xfa/src/fee/src/fee/fde_txtedtblock.cpp b/xfa/src/fee/src/fee/fde_txtedtblock.cpp index 89515bdb00..2d71cd3a99 100644 --- a/xfa/src/fee/src/fee/fde_txtedtblock.cpp +++ b/xfa/src/fee/src/fee/fde_txtedtblock.cpp @@ -12,17 +12,17 @@ #define FDE_TXTEDT_ZEROWIDTHSPACE 0x200B #define FDE_TXTEDT_ISINTEGER(a) ((a) >= L'0' && (a) <= L'9') #define FDE_TXTEDT_ISSIGN(a) (((a) == L'-') || ((a) == L'+')) -CFDE_TxtEdtBlock::CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideString &wsBlock, FX_INT32 nPosition) +CFDE_TxtEdtBlock::CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideString &wsBlock, int32_t nPosition) : m_pEngine(pEngine) , m_nDisplayLength(0) , m_nIndex(0) , m_nPosition(nPosition) { FX_LPCWSTR lpBuf = FX_LPCWSTR(wsBlock); - FX_INT32 nCount = wsBlock.GetLength(); - FX_INT32 i = 0; + int32_t nCount = wsBlock.GetLength(); + int32_t i = 0; CFX_WideString wsFix; - FX_INT32 j = 0; + int32_t j = 0; while (i < nCount) { if (lpBuf[i] != L'%') { wsFix += lpBuf[i]; @@ -40,7 +40,7 @@ CFDE_TxtEdtBlock::CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideSt m_nDisplayLength += pField->GetDisplayLength(); wsFix.Empty(); } - FX_INT32 nPos = i - 1; + int32_t nPos = i - 1; while (lpBuf[i ++] != L')') ; i ++; @@ -66,8 +66,8 @@ CFDE_TxtEdtBlock::CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideSt } CFDE_TxtEdtBlock::~CFDE_TxtEdtBlock() { - FX_INT32 nCount = m_FieldArr.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = m_FieldArr.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { CFDE_TxtEdtField * pField = m_FieldArr[i]; pField->Release(); } @@ -75,19 +75,19 @@ CFDE_TxtEdtBlock::~CFDE_TxtEdtBlock() } void CFDE_TxtEdtBlock::GetDisplayText(CFX_WideString &wsDisplay) { - FX_INT32 nCount = m_FieldArr.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = m_FieldArr.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { CFDE_TxtEdtField * pField = m_FieldArr[i]; CFX_WideString wsTemp; pField->GetDisplayText(wsTemp); wsDisplay += wsTemp; } } -FX_INT32 CFDE_TxtEdtBlock::GetLength() const +int32_t CFDE_TxtEdtBlock::GetLength() const { - FX_INT32 nDisplayLength = 0; - FX_INT32 nCount = m_FieldArr.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nDisplayLength = 0; + int32_t nCount = m_FieldArr.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { CFDE_TxtEdtField * pField = m_FieldArr[i]; nDisplayLength += pField->GetDisplayLength(); } @@ -95,41 +95,41 @@ FX_INT32 CFDE_TxtEdtBlock::GetLength() const } void CFDE_TxtEdtBlock::GetBlockText(CFX_WideString &wsBlock) { - FX_INT32 nCount = m_FieldArr.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = m_FieldArr.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { CFDE_TxtEdtField * pField = m_FieldArr[i]; CFX_WideString wsTemp; pField->GetFieldText(wsTemp); wsBlock += wsTemp; } } -FX_INT32 CFDE_TxtEdtBlock::CountField() const +int32_t CFDE_TxtEdtBlock::CountField() const { return m_EditFieldArr.GetSize(); } -void CFDE_TxtEdtBlock::GetFieldText(FX_INT32 nIndex, CFX_WideString &wsField) +void CFDE_TxtEdtBlock::GetFieldText(int32_t nIndex, CFX_WideString &wsField) { CFDE_TxtEdtField * pField = m_EditFieldArr[nIndex]; pField->GetFieldText(wsField); } -FX_INT32 CFDE_TxtEdtBlock::GetFieldTextLength() const +int32_t CFDE_TxtEdtBlock::GetFieldTextLength() const { - FX_INT32 nTotalLength = 0; - FX_INT32 nCount = m_EditFieldArr.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nTotalLength = 0; + int32_t nCount = m_EditFieldArr.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { CFDE_TxtEdtField * pField = m_EditFieldArr[i]; nTotalLength = pField->GetFieldTextLength(); } return nTotalLength; } -FX_INT32 CFDE_TxtEdtBlock::GetPos() const +int32_t CFDE_TxtEdtBlock::GetPos() const { return m_nPosition; } void CFDE_TxtEdtBlock::GetRealText(CFX_WideString &wsText) const { - FX_INT32 nCount = m_FieldArr.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = m_FieldArr.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { CFDE_TxtEdtField * pField = m_FieldArr[i]; CFX_WideString wsTemp; pField->GetFieldText(wsTemp); @@ -138,15 +138,15 @@ void CFDE_TxtEdtBlock::GetRealText(CFX_WideString &wsText) const } void CFDE_TxtEdtBlock::Backup() { - FX_INT32 nCount = m_EditFieldArr.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = m_EditFieldArr.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { m_EditFieldArr[i]->Backup(); } } void CFDE_TxtEdtBlock::Restore() { - FX_INT32 nCount = m_EditFieldArr.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = m_EditFieldArr.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { m_EditFieldArr[i]->Restore(); } } @@ -156,8 +156,8 @@ CFDE_TxtEdtFieldFormatParser::CFDE_TxtEdtFieldFormatParser() CFDE_TxtEdtFieldFormatParser::~CFDE_TxtEdtFieldFormatParser() { FDE_LPTXTEDTFORMATITEM lpItem = NULL; - FX_INT32 nCount = m_ItemArr.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = m_ItemArr.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { lpItem = m_ItemArr[i]; delete lpItem; } @@ -167,9 +167,9 @@ FX_BOOL CFDE_TxtEdtFieldFormatParser::Parse(const CFX_WideString &wsFormat) { m_wsFormat = wsFormat; FX_LPCWSTR pBuf = FX_LPCWSTR(m_wsFormat); - FX_INT32 nCount = m_wsFormat.GetLength(); + int32_t nCount = m_wsFormat.GetLength(); nCount -= 2; - FX_INT32 i = 0; + int32_t i = 0; for (; i < nCount; i ++) { FX_WCHAR wChar = pBuf[i]; if (wChar == L'(') { @@ -199,11 +199,11 @@ FX_BOOL CFDE_TxtEdtFieldFormatParser::Parse(const CFX_WideString &wsFormat) } return TRUE; } -FX_INT32 CFDE_TxtEdtFieldFormatParser::CountItems() const +int32_t CFDE_TxtEdtFieldFormatParser::CountItems() const { return m_ItemArr.GetSize(); } -void CFDE_TxtEdtFieldFormatParser::GetItem(FX_INT32 nIndex, CFX_WideString &wsKey, CFX_WideString &wsValue) const +void CFDE_TxtEdtFieldFormatParser::GetItem(int32_t nIndex, CFX_WideString &wsKey, CFX_WideString &wsValue) const { FDE_LPTXTEDTFORMATITEM lpItem = m_ItemArr[nIndex]; FX_LPCWSTR lpSrcBuf = FX_LPCWSTR(m_wsFormat); @@ -214,7 +214,7 @@ void CFDE_TxtEdtFieldFormatParser::GetItem(FX_INT32 nIndex, CFX_WideString &wsKe FXSYS_memcpy(lpDstBuf, lpSrcBuf + lpItem->nValStart, lpItem->nValCount * sizeof(FX_WCHAR)); wsValue.ReleaseBuffer(lpItem->nValCount); } -CFDE_TxtEdtField * CFDE_TxtEdtField::Create(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock) +CFDE_TxtEdtField * CFDE_TxtEdtField::Create(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock) { if (wsField[0] != L'%' || (wsField[0] == L'%' && wsField[1] == L'%')) { return FX_NEW CFDE_TxtEdtField_Fixed(wsField, nIndex, pBlock); @@ -238,7 +238,7 @@ void CFDE_TxtEdtField::Release() { delete this; } -CFDE_TxtEdtField::CFDE_TxtEdtField(FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock) +CFDE_TxtEdtField::CFDE_TxtEdtField(int32_t nIndex, CFDE_TxtEdtBlock * pBlock) : m_nLength(-1) , m_wcFill(L' ') , m_bReserveSpace(FALSE) @@ -248,21 +248,21 @@ CFDE_TxtEdtField::CFDE_TxtEdtField(FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock) { FXSYS_assert(pBlock); } -FX_INT32 CFDE_TxtEdtField::Insert(FX_INT32 nIndex, const CFX_WideString &wsIns, - FX_INT32 &nCaret, FX_BOOL &bBefore) +int32_t CFDE_TxtEdtField::Insert(int32_t nIndex, const CFX_WideString &wsIns, + int32_t &nCaret, FX_BOOL &bBefore) { - FX_INT32 nFieldLength = m_wsField.GetLength(); - FX_INT32 nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE; + int32_t nFieldLength = m_wsField.GetLength(); + int32_t nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE; if (m_bReserveSpace && !m_bLeftAlignment) { nInnerIndex -= (m_nLength - nFieldLength); } FXSYS_assert(nInnerIndex >= 0 && nInnerIndex <= nFieldLength); CFX_WideString wsTemp = m_wsField; - FX_INT32 nInsLength = wsIns.GetLength(); - for (FX_INT32 i = 0; i < nInsLength; i ++, nInnerIndex ++) { + int32_t nInsLength = wsIns.GetLength(); + for (int32_t i = 0; i < nInsLength; i ++, nInnerIndex ++) { wsTemp.Insert(nInnerIndex, wsIns[i]); } - FX_INT32 nRet = Validate(wsTemp); + int32_t nRet = Validate(wsTemp); switch (nRet) { case FDE_FORMAT_FIELD_VALIDATE_F_FULL: return FDE_FORMAT_FIELD_INSERT_RET_F_FULL; @@ -277,11 +277,11 @@ FX_INT32 CFDE_TxtEdtField::Insert(FX_INT32 nIndex, const CFX_WideString &wsIns, bBefore = TRUE; return (nFieldLength + nInsLength < m_nLength) ? FDE_FORMAT_FIELD_INSERT_RET_S_NORMAL : FDE_FORMAT_FIELD_INSERT_RET_S_FULL; } -FX_INT32 CFDE_TxtEdtField::Delete(FX_INT32 nIndex, FX_INT32 nCount, - CFX_WideString &wsDel, FX_INT32 &nCaret, FX_BOOL &bBefore) +int32_t CFDE_TxtEdtField::Delete(int32_t nIndex, int32_t nCount, + CFX_WideString &wsDel, int32_t &nCaret, FX_BOOL &bBefore) { - FX_INT32 nFieldLength = m_wsField.GetLength(); - FX_INT32 nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE; + int32_t nFieldLength = m_wsField.GetLength(); + int32_t nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE; if (m_bReserveSpace && !m_bLeftAlignment) { nInnerIndex -= (m_nLength - nFieldLength); } @@ -290,7 +290,7 @@ FX_INT32 CFDE_TxtEdtField::Delete(FX_INT32 nIndex, FX_INT32 nCount, } CFX_WideString wsTemp = m_wsField; wsTemp.Delete(nInnerIndex, nCount); - FX_INT32 nRet = Validate(wsTemp); + int32_t nRet = Validate(wsTemp); switch (nRet) { case FDE_FORMAT_FIELD_VALIDATE_F_FULL: return FDE_FORMAT_FIELD_DELETE_RET_F_BOUNDARY; @@ -308,12 +308,12 @@ FX_INT32 CFDE_TxtEdtField::Delete(FX_INT32 nIndex, FX_INT32 nCount, bBefore = TRUE; return FDE_FORMAT_FIELD_DELETE_RET_S; } -FX_INT32 CFDE_TxtEdtField::Replace(FX_INT32 nIndex, FX_INT32 nCount, const CFX_WideString &wsIns, - CFX_WideString &wsDel, FX_INT32 &nCaret, FX_BOOL &bBefore) +int32_t CFDE_TxtEdtField::Replace(int32_t nIndex, int32_t nCount, const CFX_WideString &wsIns, + CFX_WideString &wsDel, int32_t &nCaret, FX_BOOL &bBefore) { - FX_INT32 nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE; - FX_INT32 nInsLength = wsIns.GetLength(); - FX_INT32 nFieldLength = m_wsField.GetLength(); + int32_t nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE; + int32_t nInsLength = wsIns.GetLength(); + int32_t nFieldLength = m_wsField.GetLength(); CFX_WideString wsTemp = m_wsField; if (m_bReserveSpace && !m_bLeftAlignment) { nInnerIndex -= (m_nLength - nFieldLength); @@ -323,11 +323,11 @@ FX_INT32 CFDE_TxtEdtField::Replace(FX_INT32 nIndex, FX_INT32 nCount, const CFX_W return FALSE; } wsTemp.Delete(nInnerIndex, nCount); - FX_INT32 nInnerIndexBK = nInnerIndex; - for (FX_INT32 i = 0; i < nInsLength; i ++, nInnerIndex ++) { + int32_t nInnerIndexBK = nInnerIndex; + for (int32_t i = 0; i < nInsLength; i ++, nInnerIndex ++) { wsTemp.Insert(nInnerIndex, wsIns[i]); } - FX_INT32 nRet = Validate(wsTemp); + int32_t nRet = Validate(wsTemp); switch(nRet) { case FDE_FORMAT_FIELD_VALIDATE_F_FULL: return FDE_FORMAT_FIELD_INSERT_RET_F_FULL; @@ -348,7 +348,7 @@ void CFDE_TxtEdtField::GetDisplayText(CFX_WideString &wsDisplay) { CFX_WideString wsField; GetNormalizedFieldText(wsField); - FX_INT32 nLength = wsField.GetLength() + FDE_FORMAT_EDIT_FIELD_HADERSIZE + FDE_FORMAT_EDIT_FIELD_TAILSIZE; + int32_t nLength = wsField.GetLength() + FDE_FORMAT_EDIT_FIELD_HADERSIZE + FDE_FORMAT_EDIT_FIELD_TAILSIZE; FX_LPWSTR lpBuffer = wsDisplay.GetBuffer(nLength); lpBuffer[0] = FDE_TXTEDT_FORMATBLOCK_BGN; lpBuffer[nLength - 1] = FDE_TXTEDT_FORMATBLOCK_END; @@ -357,7 +357,7 @@ void CFDE_TxtEdtField::GetDisplayText(CFX_WideString &wsDisplay) FXSYS_memcpy(lpBuffer + 3, FX_LPCWSTR(wsField), (nLength - 4) * sizeof(FX_WCHAR)); wsDisplay.ReleaseBuffer(nLength); } -FX_INT32 CFDE_TxtEdtField::GetDisplayLength() +int32_t CFDE_TxtEdtField::GetDisplayLength() { return (m_bReserveSpace ? m_nLength : m_wsField.GetLength()) + FDE_FORMAT_EDIT_FIELD_HADERSIZE + FDE_FORMAT_EDIT_FIELD_TAILSIZE; } @@ -365,17 +365,17 @@ void CFDE_TxtEdtField::GetFieldText(CFX_WideString &wsField) { wsField = m_wsField; } -FX_INT32 CFDE_TxtEdtField::GetFieldTextLength() const +int32_t CFDE_TxtEdtField::GetFieldTextLength() const { return m_wsField.GetLength(); } -FX_INT32 CFDE_TxtEdtField::GetRealIndex(FX_INT32 nIndex) const +int32_t CFDE_TxtEdtField::GetRealIndex(int32_t nIndex) const { - FX_INT32 nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE; + int32_t nInnerIndex = nIndex - FDE_FORMAT_EDIT_FIELD_HADERSIZE; if (nInnerIndex < 0) { return 0; } - FX_INT32 nFieldLength = m_wsField.GetLength(); + int32_t nFieldLength = m_wsField.GetLength(); if (m_bReserveSpace && !m_bLeftAlignment) { nInnerIndex -= (m_nLength - nFieldLength); } @@ -387,12 +387,12 @@ FX_INT32 CFDE_TxtEdtField::GetRealIndex(FX_INT32 nIndex) const } return nInnerIndex + 1; } -FX_INT32 CFDE_TxtEdtField::NormalizeCaretPos(FX_INT32 nIndex, FDE_FORMAT_CARET_DIRECTION eDirection ) const +int32_t CFDE_TxtEdtField::NormalizeCaretPos(int32_t nIndex, FDE_FORMAT_CARET_DIRECTION eDirection ) const { nIndex -= FDE_FORMAT_EDIT_FIELD_HADERSIZE; - FX_INT32 nLength = m_wsField.GetLength(); + int32_t nLength = m_wsField.GetLength(); if (m_bReserveSpace) { - FX_INT32 nFieldLength = m_wsField.GetLength(); + int32_t nFieldLength = m_wsField.GetLength(); if (m_bLeftAlignment) { if (nIndex > nFieldLength) { if (eDirection == FDE_FORMAT_CARET_FORWARD) { @@ -401,7 +401,7 @@ FX_INT32 CFDE_TxtEdtField::NormalizeCaretPos(FX_INT32 nIndex, FDE_FORMAT_CARET_D nIndex = nFieldLength; } } else { - FX_INT32 nReserveLength = m_nLength - nFieldLength; + int32_t nReserveLength = m_nLength - nFieldLength; if (nIndex < nReserveLength) { if (eDirection == FDE_FORMAT_CARET_BACKWARD) { return -2; @@ -412,7 +412,7 @@ FX_INT32 CFDE_TxtEdtField::NormalizeCaretPos(FX_INT32 nIndex, FDE_FORMAT_CARET_D } return nIndex + FDE_FORMAT_EDIT_FIELD_HADERSIZE; } -FX_BOOL CFDE_TxtEdtField::GetEditableRange(FX_INT32 &nBgn, FX_INT32 &nEnd) const +FX_BOOL CFDE_TxtEdtField::GetEditableRange(int32_t &nBgn, int32_t &nEnd) const { if (m_bReserveSpace && !m_bLeftAlignment) { nEnd = FDE_FORMAT_EDIT_FIELD_HADERSIZE + m_nLength; @@ -431,7 +431,7 @@ void CFDE_TxtEdtField::Restore() { m_wsField = m_wsBackup; } -FX_INT32 CFDE_TxtEdtField::Validate(const CFX_WideString & wsText) const +int32_t CFDE_TxtEdtField::Validate(const CFX_WideString & wsText) const { if (m_nLength < 0) { return FDE_FORMAT_FIELD_DELETE_RET_S; @@ -445,8 +445,8 @@ void CFDE_TxtEdtField::GetNormalizedFieldText(CFX_WideString &wsField) const return; } if (m_bReserveSpace) { - FX_INT32 nField = wsField.GetLength(); - FX_INT32 nFill = m_nLength - nField; + int32_t nField = wsField.GetLength(); + int32_t nFill = m_nLength - nField; if (m_bLeftAlignment) { while (nFill --) { wsField.Insert(nField++, m_wcFill); @@ -458,16 +458,16 @@ void CFDE_TxtEdtField::GetNormalizedFieldText(CFX_WideString &wsField) const } } } -CFDE_TxtEdtField_Integer::CFDE_TxtEdtField_Integer(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock) +CFDE_TxtEdtField_Integer::CFDE_TxtEdtField_Integer(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock) : m_bSign(FALSE) , CFDE_TxtEdtField(nIndex, pBlock) { CFDE_TxtEdtFieldFormatParser FormatParser; FormatParser.Parse(wsField); - FX_INT32 nCount = FormatParser.CountItems(); + int32_t nCount = FormatParser.CountItems(); CFX_WideString wskey; CFX_WideString wsVal; - for (FX_INT32 i = 0; i < nCount; i ++) { + for (int32_t i = 0; i < nCount; i ++) { FormatParser.GetItem(i, wskey, wsVal); if (wskey.Equal(L"Length")) { m_nLength = wsVal.GetInteger(); @@ -485,16 +485,16 @@ CFDE_TxtEdtField_Integer::CFDE_TxtEdtField_Integer(const CFX_WideString &wsField m_bReserveSpace = FALSE; } } -FX_INT32 CFDE_TxtEdtField_Integer::Validate(const CFX_WideString &wsText) const +int32_t CFDE_TxtEdtField_Integer::Validate(const CFX_WideString &wsText) const { - FX_INT32 i = 0; + int32_t i = 0; if (m_bSign) { FX_WCHAR wcTemp = wsText[0]; if (FDE_TXTEDT_ISSIGN(wcTemp)) { i ++; } } - FX_INT32 nLength = wsText.GetLength(); + int32_t nLength = wsText.GetLength(); if (m_nLength > 0) { if (nLength - i > (m_nLength - (m_bSign ? 1 : 0))) { return FDE_FORMAT_FIELD_VALIDATE_F_FULL; @@ -508,7 +508,7 @@ FX_INT32 CFDE_TxtEdtField_Integer::Validate(const CFX_WideString &wsText) const } return FDE_FORMAT_FIELD_VALIDATE_S; } -CFDE_TxtEdtField_Float::CFDE_TxtEdtField_Float(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock) +CFDE_TxtEdtField_Float::CFDE_TxtEdtField_Float(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock) : CFDE_TxtEdtField(nIndex, pBlock) , m_bSigned(FALSE) , m_nIntPartlength(-1) @@ -516,10 +516,10 @@ CFDE_TxtEdtField_Float::CFDE_TxtEdtField_Float(const CFX_WideString &wsField, FX { CFDE_TxtEdtFieldFormatParser FormatParser; FormatParser.Parse(wsField); - FX_INT32 nCount = FormatParser.CountItems(); + int32_t nCount = FormatParser.CountItems(); CFX_WideString wskey; CFX_WideString wsVal; - for (FX_INT32 i = 0; i < nCount; i ++) { + for (int32_t i = 0; i < nCount; i ++) { FormatParser.GetItem(i, wskey, wsVal); if (wskey.Equal(L"DecLength")) { m_nDecPartLength = wsVal.GetInteger(); @@ -542,22 +542,22 @@ CFDE_TxtEdtField_Float::CFDE_TxtEdtField_Float(const CFX_WideString &wsField, FX wsVal.Empty(); } } -FX_INT32 CFDE_TxtEdtField_Float::Validate(const CFX_WideString & wsText) const +int32_t CFDE_TxtEdtField_Float::Validate(const CFX_WideString & wsText) const { - FX_INT32 nLength = wsText.GetLength(); + int32_t nLength = wsText.GetLength(); if (m_nLength != -1 && (nLength > m_nLength)) { return FDE_FORMAT_FIELD_VALIDATE_F_FULL; } FX_LPCWSTR lpBuf = FX_LPCWSTR(wsText); - FX_INT32 i = 0; + int32_t i = 0; if (m_bSigned) { FX_WCHAR wcTemp = lpBuf[0]; if (FDE_TXTEDT_ISSIGN(wcTemp)) { i ++; } } - FX_INT32 nIntPart = 0; - FX_INT32 nPoint = 0; + int32_t nIntPart = 0; + int32_t nPoint = 0; for (; i < nLength; i ++) { FX_WCHAR wcTemp = lpBuf[i]; if (!FDE_TXTEDT_ISINTEGER(wcTemp)) { @@ -584,16 +584,16 @@ FX_INT32 CFDE_TxtEdtField_Float::Validate(const CFX_WideString & wsText) const } return FDE_FORMAT_FIELD_VALIDATE_S; } -CFDE_TxtEdtField_Password::CFDE_TxtEdtField_Password(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock) +CFDE_TxtEdtField_Password::CFDE_TxtEdtField_Password(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock) : CFDE_TxtEdtField(nIndex, pBlock) , m_wcAlias(L'*') { CFDE_TxtEdtFieldFormatParser FormatParser; FormatParser.Parse(wsField); - FX_INT32 nCount = FormatParser.CountItems(); + int32_t nCount = FormatParser.CountItems(); CFX_WideString wskey; CFX_WideString wsVal; - for (FX_INT32 i = 0; i < nCount; i ++) { + for (int32_t i = 0; i < nCount; i ++) { FormatParser.GetItem(i, wskey, wsVal); if (wskey.Equal(L"Length")) { m_nLength = wsVal.GetInteger(); @@ -611,14 +611,14 @@ CFDE_TxtEdtField_Password::CFDE_TxtEdtField_Password(const CFX_WideString &wsFie } void CFDE_TxtEdtField_Password::GetNormalizedFieldText(CFX_WideString &wsField) const { - FX_INT32 nFiledLength = m_wsField.GetLength(); - FX_INT32 nLength = m_bReserveSpace ? m_nLength : nFiledLength; + int32_t nFiledLength = m_wsField.GetLength(); + int32_t nLength = m_bReserveSpace ? m_nLength : nFiledLength; FX_LPWSTR lpBuf = wsField.GetBuffer(nLength); - FX_INT32 nSpaceLength = nLength - nFiledLength; - FX_INT32 nFirstPart = m_bLeftAlignment ? nFiledLength : nSpaceLength; + int32_t nSpaceLength = nLength - nFiledLength; + int32_t nFirstPart = m_bLeftAlignment ? nFiledLength : nSpaceLength; FX_WCHAR wFirstChar = m_bLeftAlignment ? m_wcAlias : L' '; FX_WCHAR wSecondChar = m_bLeftAlignment ? L' ' : m_wcAlias; - FX_INT32 i = 0; + int32_t i = 0; for (; i < nFirstPart; i ++) { lpBuf[i] = wFirstChar; } @@ -627,15 +627,15 @@ void CFDE_TxtEdtField_Password::GetNormalizedFieldText(CFX_WideString &wsField) } wsField.ReleaseBuffer(nLength); } -CFDE_TxtEdtField_String::CFDE_TxtEdtField_String(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock) +CFDE_TxtEdtField_String::CFDE_TxtEdtField_String(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock) : CFDE_TxtEdtField(nIndex, pBlock) { CFDE_TxtEdtFieldFormatParser FormatParser; FormatParser.Parse(wsField); - FX_INT32 nCount = FormatParser.CountItems(); + int32_t nCount = FormatParser.CountItems(); CFX_WideString wskey; CFX_WideString wsVal; - for (FX_INT32 i = 0; i < nCount; i ++) { + for (int32_t i = 0; i < nCount; i ++) { FormatParser.GetItem(i, wskey, wsVal); if (wskey.Equal(L"Length")) { m_nLength = wsVal.GetInteger(); @@ -646,7 +646,7 @@ CFDE_TxtEdtField_String::CFDE_TxtEdtField_String(const CFX_WideString &wsField, wsVal.Empty(); } } -CFDE_TxtEdtField_Fixed::CFDE_TxtEdtField_Fixed(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock) +CFDE_TxtEdtField_Fixed::CFDE_TxtEdtField_Fixed(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock) : CFDE_TxtEdtField(nIndex, pBlock) { m_wsField = wsField; @@ -654,7 +654,7 @@ CFDE_TxtEdtField_Fixed::CFDE_TxtEdtField_Fixed(const CFX_WideString &wsField, FX } void CFDE_TxtEdtField_Fixed::GetDisplayText(CFX_WideString &wsDisplay) { - FX_INT32 nLength = m_wsField.GetLength() + FDE_FORMAT_EDIT_FIELD_HADERSIZE + FDE_FORMAT_EDIT_FIELD_TAILSIZE; + int32_t nLength = m_wsField.GetLength() + FDE_FORMAT_EDIT_FIELD_HADERSIZE + FDE_FORMAT_EDIT_FIELD_TAILSIZE; FX_LPWSTR lpBuffer = wsDisplay.GetBuffer(nLength); lpBuffer[0] = FDE_TXTEDT_FORMATBLOCK_BGN; lpBuffer[nLength - 1] = FDE_TXTEDT_FORMATBLOCK_END; @@ -663,7 +663,7 @@ void CFDE_TxtEdtField_Fixed::GetDisplayText(CFX_WideString &wsDisplay) FXSYS_memcpy(lpBuffer + 3, FX_LPCWSTR(m_wsField), (nLength - 4) * sizeof(FX_WCHAR)); wsDisplay.ReleaseBuffer(nLength); } -FX_INT32 CFDE_TxtEdtField_Fixed::NormalizeCaretPos(FX_INT32 nIndex, FDE_FORMAT_CARET_DIRECTION eDirection ) const +int32_t CFDE_TxtEdtField_Fixed::NormalizeCaretPos(int32_t nIndex, FDE_FORMAT_CARET_DIRECTION eDirection ) const { FXSYS_assert(nIndex >= 0 && nIndex <= m_nLength); if (eDirection == FDE_FORMAT_CARET_MIDDLE) { diff --git a/xfa/src/fee/src/fee/fde_txtedtblock.h b/xfa/src/fee/src/fee/fde_txtedtblock.h index 9ae19ed61f..2805fbd35a 100644 --- a/xfa/src/fee/src/fee/fde_txtedtblock.h +++ b/xfa/src/fee/src/fee/fde_txtedtblock.h @@ -42,33 +42,33 @@ enum FDE_FORMAT_CARET_DIRECTION { class CFDE_TxtEdtBlock { public: - CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideString &wsBlock, FX_INT32 nPosition); + CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideString &wsBlock, int32_t nPosition); ~CFDE_TxtEdtBlock(); void GetDisplayText(CFX_WideString &wsDisplay); - FX_INT32 GetLength() const; + int32_t GetLength() const; void GetBlockText(CFX_WideString &wsBlock); - FX_INT32 CountField() const; - void GetFieldText(FX_INT32 nIndex, CFX_WideString &wsField); - FX_INT32 GetFieldTextLength() const; + int32_t CountField() const; + void GetFieldText(int32_t nIndex, CFX_WideString &wsField); + int32_t GetFieldTextLength() const; - FX_INT32 GetPos() const; + int32_t GetPos() const; void GetRealText(CFX_WideString &wsText) const; void Backup(); void Restore(); - void SetIndex(FX_INT32 nIndex) + void SetIndex(int32_t nIndex) { m_nIndex = nIndex; } - FX_INT32 GetIndex() const + int32_t GetIndex() const { return m_nIndex; } private: CFDE_TxtEdtEngine * m_pEngine; - FX_INT32 m_nDisplayLength; - FX_INT32 m_nIndex; + int32_t m_nDisplayLength; + int32_t m_nIndex; - FX_INT32 m_nPosition; + int32_t m_nPosition; CFX_ArrayTemplate m_FieldArr; CFX_ArrayTemplate m_EditFieldArr; }; @@ -78,14 +78,14 @@ public: CFDE_TxtEdtFieldFormatParser(); ~CFDE_TxtEdtFieldFormatParser(); FX_BOOL Parse(const CFX_WideString &wsFormat); - FX_INT32 CountItems() const; - void GetItem(FX_INT32 nIndex, CFX_WideString &wsKey, CFX_WideString &wsValue) const; + int32_t CountItems() const; + void GetItem(int32_t nIndex, CFX_WideString &wsKey, CFX_WideString &wsValue) const; private: typedef struct { - FX_INT32 nKeyStart; - FX_INT32 nKeyCount; - FX_INT32 nValStart; - FX_INT32 nValCount; + int32_t nKeyStart; + int32_t nKeyCount; + int32_t nValStart; + int32_t nValCount; } FDE_TXTEDTFORMATITEM, * FDE_LPTXTEDTFORMATITEM; CFX_WideString m_wsFormat; @@ -94,85 +94,85 @@ private: class CFDE_TxtEdtField { public: - static CFDE_TxtEdtField * Create(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock); + static CFDE_TxtEdtField * Create(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock); virtual void Release(); - virtual FX_INT32 Insert( FX_INT32 nIndex, const CFX_WideString &wsIns, - FX_INT32 &nCaret, FX_BOOL &bBefore); - virtual FX_INT32 Delete( FX_INT32 nIndex, FX_INT32 nCount, - CFX_WideString &wsDel, FX_INT32 &nCaret, + virtual int32_t Insert( int32_t nIndex, const CFX_WideString &wsIns, + int32_t &nCaret, FX_BOOL &bBefore); + virtual int32_t Delete( int32_t nIndex, int32_t nCount, + CFX_WideString &wsDel, int32_t &nCaret, FX_BOOL &bBefore); - virtual FX_INT32 Replace(FX_INT32 nIndex, FX_INT32 nCount, + virtual int32_t Replace(int32_t nIndex, int32_t nCount, const CFX_WideString &wsIns, CFX_WideString &wsDel, - FX_INT32 &nCaret, FX_BOOL &bBefore); + int32_t &nCaret, FX_BOOL &bBefore); virtual void GetDisplayText(CFX_WideString &wsDisplay); - virtual FX_INT32 GetDisplayLength(); + virtual int32_t GetDisplayLength(); virtual void GetFieldText(CFX_WideString &wsField); - virtual FX_INT32 GetFieldTextLength() const; - virtual FX_INT32 GetRealIndex(FX_INT32 nIndex) const; + virtual int32_t GetFieldTextLength() const; + virtual int32_t GetRealIndex(int32_t nIndex) const; - virtual FX_INT32 NormalizeCaretPos( FX_INT32 nIndex, + virtual int32_t NormalizeCaretPos( int32_t nIndex, FDE_FORMAT_CARET_DIRECTION eDirection = FDE_FORMAT_CARET_MIDDLE) const; - virtual FX_BOOL GetEditableRange(FX_INT32 &nBgn, FX_INT32 &nEnd) const; + virtual FX_BOOL GetEditableRange(int32_t &nBgn, int32_t &nEnd) const; virtual void Backup(); virtual void Restore(); virtual FX_BOOL IsFix() const { return FALSE; } - void SetIndex(FX_INT32 nIndex) + void SetIndex(int32_t nIndex) { m_nIndex = nIndex; } - FX_INT32 GetIndex() const + int32_t GetIndex() const { return m_nIndex; } - FX_INT32 GetBlockIndex() const + int32_t GetBlockIndex() const { return m_pBlock->GetIndex(); } protected: - CFDE_TxtEdtField(FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock); + CFDE_TxtEdtField(int32_t nIndex, CFDE_TxtEdtBlock * pBlock); virtual ~CFDE_TxtEdtField() {} - virtual FX_INT32 Validate(const CFX_WideString & wsText) const; + virtual int32_t Validate(const CFX_WideString & wsText) const; virtual void GetNormalizedFieldText(CFX_WideString &wsField) const; - FX_INT32 m_nLength; + int32_t m_nLength; CFX_WideString m_wsField; CFX_WideString m_wsBackup; FX_WCHAR m_wcFill; FX_BOOL m_bReserveSpace; FX_BOOL m_bLeftAlignment; - FX_INT32 m_nIndex; + int32_t m_nIndex; CFDE_TxtEdtBlock * m_pBlock; }; class CFDE_TxtEdtField_Integer : public CFDE_TxtEdtField { public: - CFDE_TxtEdtField_Integer(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock); + CFDE_TxtEdtField_Integer(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock); protected: virtual ~CFDE_TxtEdtField_Integer() {} - virtual FX_INT32 Validate(const CFX_WideString &wsText) const; + virtual int32_t Validate(const CFX_WideString &wsText) const; private: FX_BOOL m_bSign; }; class CFDE_TxtEdtField_Float : public CFDE_TxtEdtField { public: - CFDE_TxtEdtField_Float(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock); + CFDE_TxtEdtField_Float(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock); protected: virtual ~CFDE_TxtEdtField_Float() {} - virtual FX_INT32 Validate(const CFX_WideString & wsText) const; + virtual int32_t Validate(const CFX_WideString & wsText) const; private: FX_BOOL m_bSigned; - FX_INT32 m_nIntPartlength; - FX_INT32 m_nDecPartLength; + int32_t m_nIntPartlength; + int32_t m_nDecPartLength; }; class CFDE_TxtEdtField_Password : public CFDE_TxtEdtField { public: - CFDE_TxtEdtField_Password(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock); + CFDE_TxtEdtField_Password(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock); protected: virtual ~CFDE_TxtEdtField_Password() {} @@ -183,33 +183,33 @@ private: class CFDE_TxtEdtField_String : public CFDE_TxtEdtField { public: - CFDE_TxtEdtField_String(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock); + CFDE_TxtEdtField_String(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock); protected: virtual ~CFDE_TxtEdtField_String() {} }; class CFDE_TxtEdtField_Fixed : public CFDE_TxtEdtField { public: - CFDE_TxtEdtField_Fixed(const CFX_WideString &wsField, FX_INT32 nIndex, CFDE_TxtEdtBlock * pBlock); - virtual FX_INT32 Insert( FX_INT32 nIndex, const CFX_WideString &wsIns, - FX_INT32 &nCaret, FX_BOOL &bBefore) + CFDE_TxtEdtField_Fixed(const CFX_WideString &wsField, int32_t nIndex, CFDE_TxtEdtBlock * pBlock); + virtual int32_t Insert( int32_t nIndex, const CFX_WideString &wsIns, + int32_t &nCaret, FX_BOOL &bBefore) { return FALSE; } - virtual FX_INT32 Delete( FX_INT32 nIndex, FX_INT32 nCount, CFX_WideString &wsDel, - FX_INT32 &nCaret, FX_BOOL &bBefore) + virtual int32_t Delete( int32_t nIndex, int32_t nCount, CFX_WideString &wsDel, + int32_t &nCaret, FX_BOOL &bBefore) { return FALSE; } - virtual FX_INT32 Replace(FX_INT32 nIndex, FX_INT32 nCount, const CFX_WideString &wsIns, - CFX_WideString &wsDel, FX_INT32 &nCaret, FX_BOOL &bBefore) + virtual int32_t Replace(int32_t nIndex, int32_t nCount, const CFX_WideString &wsIns, + CFX_WideString &wsDel, int32_t &nCaret, FX_BOOL &bBefore) { return FALSE; } virtual void GetDisplayText(CFX_WideString &wsDisplay); - virtual FX_INT32 NormalizeCaretPos( FX_INT32 nIndex, + virtual int32_t NormalizeCaretPos( int32_t nIndex, FDE_FORMAT_CARET_DIRECTION eDirection ) const; - virtual FX_BOOL GetEditableRange(FX_INT32 &nBgn, FX_INT32 &nEnd) const + virtual FX_BOOL GetEditableRange(int32_t &nBgn, int32_t &nEnd) const { return FALSE; } diff --git a/xfa/src/fee/src/fee/fde_txtedtbuf.cpp b/xfa/src/fee/src/fee/fde_txtedtbuf.cpp index f2cb0c57f2..1b2c01d3da 100644 --- a/xfa/src/fee/src/fee/fde_txtedtbuf.cpp +++ b/xfa/src/fee/src/fee/fde_txtedtbuf.cpp @@ -70,7 +70,7 @@ FX_BOOL CFDE_TxtEdtBufIter::Next(FX_BOOL bPrev ) if (lpChunk->nUsed != (m_nCurIndex + 1)) { m_nCurIndex ++; } else { - FX_INT32 nEnd = m_pBuf->m_Chunks.GetSize() - 1; + int32_t nEnd = m_pBuf->m_Chunks.GetSize() - 1; while (m_nCurChunk < nEnd) { m_nCurChunk ++; CFDE_TxtEdtBuf::FDE_LPCHUNKHEADER lpChunkTemp = \ @@ -85,7 +85,7 @@ FX_BOOL CFDE_TxtEdtBufIter::Next(FX_BOOL bPrev ) return TRUE; } } -void CFDE_TxtEdtBufIter::SetAt(FX_INT32 nIndex) +void CFDE_TxtEdtBufIter::SetAt(int32_t nIndex) { FXSYS_assert(nIndex >= 0 && nIndex < m_pBuf->m_nTotal); CFDE_TxtEdtBuf::FDE_CHUNKPLACE cp; @@ -94,7 +94,7 @@ void CFDE_TxtEdtBufIter::SetAt(FX_INT32 nIndex) m_nCurChunk = cp.nChunkIndex; m_nCurIndex = cp.nCharIndex; } -FX_INT32 CFDE_TxtEdtBufIter::GetAt() const +int32_t CFDE_TxtEdtBufIter::GetAt() const { return m_nIndex; } @@ -143,7 +143,7 @@ IFX_CharIter * CFDE_TxtEdtBufIter::Clone() pIter->m_Alias = m_Alias; return pIter; } -CFDE_TxtEdtBuf::CFDE_TxtEdtBuf(FX_INT32 nDefChunkSize ) +CFDE_TxtEdtBuf::CFDE_TxtEdtBuf(int32_t nDefChunkSize ) : m_nChunkSize(nDefChunkSize) , m_nTotal(0) , m_bChanged(FALSE) @@ -162,17 +162,17 @@ CFDE_TxtEdtBuf::~CFDE_TxtEdtBuf() m_pAllocator->Release(); m_Chunks.RemoveAll(); } -FX_BOOL CFDE_TxtEdtBuf::SetChunkSize(FX_INT32 nChunkSize) +FX_BOOL CFDE_TxtEdtBuf::SetChunkSize(int32_t nChunkSize) { FXSYS_assert(nChunkSize); ResetChunkBuffer(FDE_DEFCHUNKCOUNT, nChunkSize); return TRUE; } -FX_INT32 CFDE_TxtEdtBuf::GetChunkSize() const +int32_t CFDE_TxtEdtBuf::GetChunkSize() const { return m_nChunkSize; } -FX_INT32 CFDE_TxtEdtBuf::GetTextLength() const +int32_t CFDE_TxtEdtBuf::GetTextLength() const { return m_nTotal; } @@ -180,19 +180,19 @@ void CFDE_TxtEdtBuf::SetText(const CFX_WideString &wsText) { FXSYS_assert(!wsText.IsEmpty()); Clear(FALSE); - FX_INT32 nTextLength = wsText.GetLength(); - FX_INT32 nNeedCount = ((nTextLength - 1) / m_nChunkSize + 1) - m_Chunks.GetSize(); - FX_INT32 i = 0; + int32_t nTextLength = wsText.GetLength(); + int32_t nNeedCount = ((nTextLength - 1) / m_nChunkSize + 1) - m_Chunks.GetSize(); + int32_t i = 0; for (i = 0; i < nNeedCount; i ++) { FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_pAllocator->Alloc(sizeof(FDE_CHUNKHEADER) + \ (m_nChunkSize - 1) * sizeof(FX_WCHAR)); lpChunk->nUsed = 0; m_Chunks.Add(lpChunk); } - FX_INT32 nTotalCount = m_Chunks.GetSize(); + int32_t nTotalCount = m_Chunks.GetSize(); FX_LPCWSTR lpSrcBuf = FX_LPCWSTR(wsText); - FX_INT32 nLeave = nTextLength; - FX_INT32 nCopyedLength = m_nChunkSize; + int32_t nLeave = nTextLength; + int32_t nCopyedLength = m_nChunkSize; for (i = 0; i < nTotalCount && nLeave > 0; i ++) { if (nLeave < nCopyedLength) { nCopyedLength = nLeave; @@ -210,13 +210,13 @@ void CFDE_TxtEdtBuf::GetText(CFX_WideString &wsText) const { GetRange(wsText, 0, m_nTotal); } -FX_WCHAR CFDE_TxtEdtBuf::GetCharByIndex(FX_INT32 nIndex) const +FX_WCHAR CFDE_TxtEdtBuf::GetCharByIndex(int32_t nIndex) const { FXSYS_assert(nIndex >= 0 && nIndex < GetTextLength()); FDE_LPCHUNKHEADER pChunkHeader = NULL; - FX_INT32 nTotal = 0; - FX_INT32 nCount = m_Chunks.GetSize(); - FX_INT32 i = 0; + int32_t nTotal = 0; + int32_t nCount = m_Chunks.GetSize(); + int32_t i = 0; for (i = 0; i < nCount; i ++) { pChunkHeader = (FDE_LPCHUNKHEADER)m_Chunks[i]; nTotal += pChunkHeader->nUsed; @@ -227,16 +227,16 @@ FX_WCHAR CFDE_TxtEdtBuf::GetCharByIndex(FX_INT32 nIndex) const FXSYS_assert(pChunkHeader); return pChunkHeader->wChars[pChunkHeader->nUsed - (nTotal - nIndex)]; } -void CFDE_TxtEdtBuf::GetRange(CFX_WideString &wsText, FX_INT32 nBegin, FX_INT32 nLength) const +void CFDE_TxtEdtBuf::GetRange(CFX_WideString &wsText, int32_t nBegin, int32_t nLength) const { FDE_CHUNKPLACE cp; Index2CP(nBegin, cp); - FX_INT32 nLeave = nLength; - FX_INT32 nCount = m_Chunks.GetSize(); + int32_t nLeave = nLength; + int32_t nCount = m_Chunks.GetSize(); FX_LPWSTR lpDstBuf = wsText.GetBuffer(nLength); - FX_INT32 nChunkIndex = cp.nChunkIndex; + int32_t nChunkIndex = cp.nChunkIndex; FDE_LPCHUNKHEADER lpChunkHeader = (FDE_LPCHUNKHEADER)m_Chunks[nChunkIndex]; - FX_INT32 nCopyLength = lpChunkHeader->nUsed - cp.nCharIndex; + int32_t nCopyLength = lpChunkHeader->nUsed - cp.nCharIndex; FX_LPWSTR lpSrcBuf = lpChunkHeader->wChars + cp.nCharIndex; while (nLeave > 0) { if (nLeave <= nCopyLength) { @@ -255,17 +255,17 @@ void CFDE_TxtEdtBuf::GetRange(CFX_WideString &wsText, FX_INT32 nBegin, FX_INT32 } wsText.ReleaseBuffer(); } -void CFDE_TxtEdtBuf::Insert(FX_INT32 nPos, FX_LPCWSTR lpText, FX_INT32 nLength ) +void CFDE_TxtEdtBuf::Insert(int32_t nPos, FX_LPCWSTR lpText, int32_t nLength ) { FXSYS_assert(nPos >= 0 && nPos <= m_nTotal); FDE_CHUNKPLACE cp; Index2CP(nPos, cp); - FX_INT32 nLengthTemp = nLength; + int32_t nLengthTemp = nLength; if (cp.nCharIndex != 0) { FDE_LPCHUNKHEADER lpNewChunk = (FDE_LPCHUNKHEADER)m_pAllocator->Alloc(sizeof(FDE_CHUNKHEADER) + \ (m_nChunkSize - 1) * sizeof(FX_WCHAR)); FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_Chunks[cp.nChunkIndex]; - FX_INT32 nCopy = lpChunk->nUsed - cp.nCharIndex; + int32_t nCopy = lpChunk->nUsed - cp.nCharIndex; FXSYS_memcpy(lpNewChunk->wChars, lpChunk->wChars + cp.nCharIndex, nCopy * sizeof(FX_WCHAR)); lpChunk->nUsed -= nCopy; cp.nChunkIndex ++; @@ -277,8 +277,8 @@ void CFDE_TxtEdtBuf::Insert(FX_INT32 nPos, FX_LPCWSTR lpText, FX_INT32 nLength ) FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_Chunks[cp.nChunkIndex - 1]; if (lpChunk->nUsed != m_nChunkSize) { cp.nChunkIndex --; - FX_INT32 nFree = m_nChunkSize - lpChunk->nUsed; - FX_INT32 nCopy = FX_MIN(nLengthTemp, nFree); + int32_t nFree = m_nChunkSize - lpChunk->nUsed; + int32_t nCopy = FX_MIN(nLengthTemp, nFree); FXSYS_memcpy(lpChunk->wChars + lpChunk->nUsed, lpText, nCopy * sizeof(FX_WCHAR)); lpText += nCopy; nLengthTemp -= nCopy; @@ -290,7 +290,7 @@ void CFDE_TxtEdtBuf::Insert(FX_INT32 nPos, FX_LPCWSTR lpText, FX_INT32 nLength ) FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_pAllocator->Alloc(sizeof(FDE_CHUNKHEADER) + \ (m_nChunkSize - 1) * sizeof(FX_WCHAR)); FXSYS_assert(lpChunk); - FX_INT32 nCopy = FX_MIN(nLengthTemp, m_nChunkSize); + int32_t nCopy = FX_MIN(nLengthTemp, m_nChunkSize); FXSYS_memcpy(lpChunk->wChars, lpText, nCopy * sizeof(FX_WCHAR)); lpText += nCopy; nLengthTemp -= nCopy; @@ -301,17 +301,17 @@ void CFDE_TxtEdtBuf::Insert(FX_INT32 nPos, FX_LPCWSTR lpText, FX_INT32 nLength ) m_nTotal += nLength; m_bChanged = TRUE; } -void CFDE_TxtEdtBuf::Delete(FX_INT32 nIndex, FX_INT32 nLength ) +void CFDE_TxtEdtBuf::Delete(int32_t nIndex, int32_t nLength ) { FXSYS_assert(nLength > 0 && nIndex >= 0 && nIndex + nLength <= m_nTotal); FDE_CHUNKPLACE cpEnd; Index2CP(nIndex + nLength - 1, cpEnd); m_nTotal -= nLength; FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_Chunks[cpEnd.nChunkIndex]; - FX_INT32 nFirstPart = cpEnd.nCharIndex + 1; - FX_INT32 nMovePart = lpChunk->nUsed - nFirstPart; + int32_t nFirstPart = cpEnd.nCharIndex + 1; + int32_t nMovePart = lpChunk->nUsed - nFirstPart; if (nMovePart != 0) { - FX_INT32 nDelete = FX_MIN(nFirstPart, nLength); + int32_t nDelete = FX_MIN(nFirstPart, nLength); FXSYS_memmove(lpChunk->wChars + nFirstPart - nDelete, \ lpChunk->wChars + nFirstPart, nMovePart * sizeof(FX_WCHAR)); lpChunk->nUsed -= nDelete; @@ -320,7 +320,7 @@ void CFDE_TxtEdtBuf::Delete(FX_INT32 nIndex, FX_INT32 nLength ) } while (nLength > 0) { lpChunk = (FDE_LPCHUNKHEADER)m_Chunks[cpEnd.nChunkIndex]; - FX_INT32 nDeleted = FX_MIN(lpChunk->nUsed, nLength); + int32_t nDeleted = FX_MIN(lpChunk->nUsed, nLength); lpChunk->nUsed -= nDeleted; if (lpChunk->nUsed == 0) { m_pAllocator->Free(lpChunk); @@ -334,8 +334,8 @@ void CFDE_TxtEdtBuf::Delete(FX_INT32 nIndex, FX_INT32 nLength ) } void CFDE_TxtEdtBuf::Clear(FX_BOOL bRelease ) { - FX_INT32 i = 0; - FX_INT32 nCount = m_Chunks.GetSize(); + int32_t i = 0; + int32_t nCount = m_Chunks.GetSize(); if (bRelease) { while (i < nCount) { m_pAllocator->Free(m_Chunks[i++]); @@ -357,11 +357,11 @@ FX_BOOL CFDE_TxtEdtBuf::Optimize(IFX_Pause * pPause ) if (m_nTotal == 0) { return TRUE; } - FX_INT32 nCount = m_Chunks.GetSize(); + int32_t nCount = m_Chunks.GetSize(); if (nCount == 0) { return TRUE; } - FX_INT32 i = 0; + int32_t i = 0; for ( ; i < nCount; i ++) { FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_Chunks[i]; if (lpChunk->nUsed == 0) { @@ -396,7 +396,7 @@ FX_BOOL CFDE_TxtEdtBuf::Optimize(IFX_Pause * pPause ) m_bChanged = FALSE; return TRUE; } -void CFDE_TxtEdtBuf::ResetChunkBuffer(FX_INT32 nDefChunkCount, FX_INT32 nChunkSize) +void CFDE_TxtEdtBuf::ResetChunkBuffer(int32_t nDefChunkCount, int32_t nChunkSize) { FXSYS_assert(nChunkSize); FXSYS_assert(nDefChunkCount); @@ -406,7 +406,7 @@ void CFDE_TxtEdtBuf::ResetChunkBuffer(FX_INT32 nDefChunkCount, FX_INT32 nChunkSi } m_Chunks.RemoveAll(); m_nChunkSize = nChunkSize; - FX_INT32 nChunkLength = sizeof(FDE_CHUNKHEADER) + (m_nChunkSize - 1) * sizeof(FX_WCHAR); + int32_t nChunkLength = sizeof(FDE_CHUNKHEADER) + (m_nChunkSize - 1) * sizeof(FX_WCHAR); m_pAllocator = FX_CreateAllocator(FX_ALLOCTYPE_Fixed, nDefChunkCount, nChunkLength); FXSYS_assert(m_pAllocator); FDE_LPCHUNKHEADER lpChunkHeader = (FDE_LPCHUNKHEADER)m_pAllocator->Alloc(nChunkLength); @@ -415,16 +415,16 @@ void CFDE_TxtEdtBuf::ResetChunkBuffer(FX_INT32 nDefChunkCount, FX_INT32 nChunkSi m_Chunks.Add(lpChunkHeader); m_nTotal = 0; } -FX_INT32 CFDE_TxtEdtBuf::CP2Index(const FDE_CHUNKPLACE & cp) const +int32_t CFDE_TxtEdtBuf::CP2Index(const FDE_CHUNKPLACE & cp) const { - FX_INT32 nTotal = cp.nCharIndex; - FX_INT32 i = 0; + int32_t nTotal = cp.nCharIndex; + int32_t i = 0; for (i = 0; i < cp.nChunkIndex; i ++) { nTotal += ((FDE_LPCHUNKHEADER)m_Chunks[i])->nUsed; } return nTotal; } -void CFDE_TxtEdtBuf::Index2CP(FX_INT32 nIndex, FDE_CHUNKPLACE & cp) const +void CFDE_TxtEdtBuf::Index2CP(int32_t nIndex, FDE_CHUNKPLACE & cp) const { FXSYS_assert(nIndex <= GetTextLength()); if (nIndex == m_nTotal) { @@ -432,9 +432,9 @@ void CFDE_TxtEdtBuf::Index2CP(FX_INT32 nIndex, FDE_CHUNKPLACE & cp) const cp.nCharIndex = ((FDE_LPCHUNKHEADER)m_Chunks[cp.nChunkIndex])->nUsed; return; } - FX_INT32 i = 0; - FX_INT32 nTotal = 0; - FX_INT32 nCount = m_Chunks.GetSize(); + int32_t i = 0; + int32_t nTotal = 0; + int32_t nCount = m_Chunks.GetSize(); for ( ; i < nCount; i ++) { nTotal += ((FDE_LPCHUNKHEADER)m_Chunks[i])->nUsed; if (nTotal > nIndex) { diff --git a/xfa/src/fee/src/fee/fde_txtedtbuf.h b/xfa/src/fee/src/fee/fde_txtedtbuf.h index 7a9100c833..9e54a0d2f3 100644 --- a/xfa/src/fee/src/fee/fde_txtedtbuf.h +++ b/xfa/src/fee/src/fee/fde_txtedtbuf.h @@ -21,21 +21,21 @@ public: virtual void Release(); virtual FX_BOOL Next(FX_BOOL bPrev = FALSE); virtual FX_WCHAR GetChar(); - virtual void SetAt(FX_INT32 nIndex); - virtual FX_INT32 GetAt() const; + virtual void SetAt(int32_t nIndex); + virtual int32_t GetAt() const; virtual FX_BOOL IsEOF(FX_BOOL bTail = TRUE) const; virtual IFX_CharIter * Clone(); protected: ~CFDE_TxtEdtBufIter(); private: CFDE_TxtEdtBuf* m_pBuf; - FX_INT32 m_nCurChunk; - FX_INT32 m_nCurIndex; - FX_INT32 m_nIndex; + int32_t m_nCurChunk; + int32_t m_nCurIndex; + int32_t m_nIndex; FX_BOOL m_bInField; #ifdef FDE_USEFORMATBLOCK FX_BOOL m_bForDisplay; - FX_INT32 m_nAliasCount; + int32_t m_nAliasCount; #endif FX_WCHAR m_Alias; }; @@ -43,32 +43,32 @@ class CFDE_TxtEdtBuf : public IFDE_TxtEdtBuf { friend class CFDE_TxtEdtBufIter; struct _FDE_CHUNKHEADER { - FX_INT32 nUsed; + int32_t nUsed; FX_WCHAR wChars[1]; }; typedef _FDE_CHUNKHEADER FDE_CHUNKHEADER; typedef _FDE_CHUNKHEADER* FDE_LPCHUNKHEADER; struct _FDE_CHUNKPLACE { - FX_INT32 nChunkIndex; - FX_INT32 nCharIndex; + int32_t nChunkIndex; + int32_t nCharIndex; }; typedef _FDE_CHUNKPLACE FDE_CHUNKPLACE; typedef _FDE_CHUNKPLACE* FDE_LPCHUNKPLACE; public: - CFDE_TxtEdtBuf(FX_INT32 nDefChunkSize = FDE_DEFCHUNKLENGTH); + CFDE_TxtEdtBuf(int32_t nDefChunkSize = FDE_DEFCHUNKLENGTH); virtual void Release(); - virtual FX_BOOL SetChunkSize(FX_INT32 nChunkSize); - virtual FX_INT32 GetChunkSize() const; - virtual FX_INT32 GetTextLength() const; + virtual FX_BOOL SetChunkSize(int32_t nChunkSize); + virtual int32_t GetChunkSize() const; + virtual int32_t GetTextLength() const; virtual void SetText(const CFX_WideString &wsText); virtual void GetText(CFX_WideString &wsText) const; - virtual FX_WCHAR GetCharByIndex(FX_INT32 nIndex) const; - virtual void GetRange(CFX_WideString &wsText, FX_INT32 nBegine, FX_INT32 nCount = -1) const; + virtual FX_WCHAR GetCharByIndex(int32_t nIndex) const; + virtual void GetRange(CFX_WideString &wsText, int32_t nBegine, int32_t nCount = -1) const; - virtual void Insert(FX_INT32 nPos, FX_LPCWSTR lpText, FX_INT32 nLength = 1); - virtual void Delete(FX_INT32 nIndex, FX_INT32 nLength = 1); + virtual void Insert(int32_t nPos, FX_LPCWSTR lpText, int32_t nLength = 1); + virtual void Delete(int32_t nIndex, int32_t nLength = 1); virtual void Clear(FX_BOOL bRelease = TRUE); virtual FX_BOOL Optimize(IFX_Pause * pPause = NULL); @@ -76,13 +76,13 @@ public: protected: virtual ~CFDE_TxtEdtBuf(); private: - void ResetChunkBuffer(FX_INT32 nDefChunkCount, FX_INT32 nChunkSize); - FX_INT32 CP2Index(const FDE_CHUNKPLACE & cp) const; - void Index2CP(FX_INT32 nIndex, FDE_CHUNKPLACE & cp) const; + void ResetChunkBuffer(int32_t nDefChunkCount, int32_t nChunkSize); + int32_t CP2Index(const FDE_CHUNKPLACE & cp) const; + void Index2CP(int32_t nIndex, FDE_CHUNKPLACE & cp) const; - FX_INT32 m_nChunkSize; + int32_t m_nChunkSize; - FX_INT32 m_nTotal; + int32_t m_nTotal; FX_BOOL m_bChanged; CFX_PtrArray m_Chunks; IFX_MEMAllocator * m_pAllocator; diff --git a/xfa/src/fee/src/fee/fde_txtedtengine.cpp b/xfa/src/fee/src/fee/fde_txtedtengine.cpp index 2dbd1384cb..78486835ac 100644 --- a/xfa/src/fee/src/fee/fde_txtedtengine.cpp +++ b/xfa/src/fee/src/fee/fde_txtedtengine.cpp @@ -67,9 +67,9 @@ CFDE_TxtEdtEngine::~CFDE_TxtEdtEngine() m_pTextBreak = NULL; } #ifdef FDE_USEFORMATBLOCK - FX_INT32 nBlockCount = m_BlockArray.GetSize(); + int32_t nBlockCount = m_BlockArray.GetSize(); if (nBlockCount > 0) { - FX_INT32 i = 0; + int32_t i = 0; for (; i < nBlockCount; i ++) { CFDE_TxtEdtBlock * pBlock = m_BlockArray[i]; delete pBlock; @@ -100,44 +100,44 @@ const FDE_TXTEDTPARAMS * CFDE_TxtEdtEngine::GetEditParams() const { return &m_Param; } -FX_INT32 CFDE_TxtEdtEngine::CountPages() const +int32_t CFDE_TxtEdtEngine::CountPages() const { if (m_nLineCount == 0) { return 0; } return ((m_nLineCount - 1) / m_nPageLineCount) + 1; } -IFDE_TxtEdtPage * CFDE_TxtEdtEngine::GetPage(FX_INT32 nIndex) +IFDE_TxtEdtPage * CFDE_TxtEdtEngine::GetPage(int32_t nIndex) { if (m_PagePtrArray.GetSize() <= nIndex) { return NULL; } return (IFDE_TxtEdtPage*)m_PagePtrArray[nIndex]; } -FX_BOOL CFDE_TxtEdtEngine::SetBufChunkSize(FX_INT32 nChunkSize) +FX_BOOL CFDE_TxtEdtEngine::SetBufChunkSize(int32_t nChunkSize) { return m_pTxtBuf->SetChunkSize(nChunkSize); } void CFDE_TxtEdtEngine::SetTextByStream(IFX_Stream *pStream) { ResetEngine(); - FX_INT32 nIndex = 0; + int32_t nIndex = 0; if (pStream != NULL && pStream->GetLength()) { - FX_INT32 nStreamLength = pStream->GetLength(); + int32_t nStreamLength = pStream->GetLength(); FX_BOOL bValid = TRUE; if (m_nLimit > 0 && nStreamLength > m_nLimit) { bValid = FALSE; } FX_BOOL bPreIsCR = FALSE; if (bValid) { - FX_BYTE bom[4]; - FX_INT32 nPos = pStream->GetBOM(bom); + uint8_t bom[4]; + int32_t nPos = pStream->GetBOM(bom); pStream->Seek(FX_STREAMSEEK_Begin, nPos); - FX_INT32 bEos = FALSE; - FX_INT32 nPlateSize = FX_MIN(nStreamLength, m_pTxtBuf->GetChunkSize()); + int32_t bEos = FALSE; + int32_t nPlateSize = FX_MIN(nStreamLength, m_pTxtBuf->GetChunkSize()); FX_LPWSTR lpwstr = (FX_LPWSTR)FDE_Alloc(nPlateSize * sizeof(FX_WCHAR)); FXSYS_assert(lpwstr); - FX_INT32 nRead = 0; + int32_t nRead = 0; while (!bEos) { nRead = pStream->ReadString(lpwstr, nPlateSize, bEos); bPreIsCR = ReplaceParagEnd(lpwstr, nRead, bPreIsCR); @@ -153,7 +153,7 @@ void CFDE_TxtEdtEngine::SetTextByStream(IFX_Stream *pStream) void CFDE_TxtEdtEngine::SetText(const CFX_WideString &wsText) { ResetEngine(); - FX_INT32 nLength = wsText.GetLength(); + int32_t nLength = wsText.GetLength(); if (nLength > 0) { CFX_WideString wsTemp; FX_LPWSTR lpBuffer = wsTemp.GetBuffer(nLength); @@ -169,18 +169,18 @@ void CFDE_TxtEdtEngine::SetText(const CFX_WideString &wsText) m_pTxtBuf->Insert(nLength, &m_wLineEnd, 1); RebuildParagraphs(); } -FX_INT32 CFDE_TxtEdtEngine::GetTextLength() const +int32_t CFDE_TxtEdtEngine::GetTextLength() const { return GetTextBufLength(); } -void CFDE_TxtEdtEngine::GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount ) +void CFDE_TxtEdtEngine::GetText(CFX_WideString &wsText, int32_t nStart, int32_t nCount ) { - FX_INT32 nTextBufLength = GetTextBufLength(); + int32_t nTextBufLength = GetTextBufLength(); if (nCount == -1) { nCount = nTextBufLength - nStart; } #ifdef FDE_USEFORMATBLOCK - FX_INT32 nBlockCount = m_BlockArray.GetSize(); + int32_t nBlockCount = m_BlockArray.GetSize(); if (nBlockCount == 0 || m_wsFixText.IsEmpty()) { m_pTxtBuf->GetRange(wsText, nStart, nCount); return; @@ -188,12 +188,12 @@ void CFDE_TxtEdtEngine::GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT3 CFX_WideString wsTemp; FX_LPCWSTR lpFixBuffer = FX_LPCWSTR(m_wsFixText); FX_LPWSTR lpBuffer = wsTemp.GetBuffer(nTextBufLength); - FX_INT32 nRealLength = 0; - FX_INT32 nPrePos = 0; - for (FX_INT32 i = 0; i < nBlockCount; i ++) { + int32_t nRealLength = 0; + int32_t nPrePos = 0; + for (int32_t i = 0; i < nBlockCount; i ++) { CFDE_TxtEdtBlock *pBlock = m_BlockArray[i]; - FX_INT32 nPos = pBlock->GetPos(); - FX_INT32 nCopyLength = nPos - nPrePos; + int32_t nPos = pBlock->GetPos(); + int32_t nCopyLength = nPos - nPrePos; FXSYS_memcpy(lpBuffer + nRealLength, lpFixBuffer + nPrePos, nCopyLength * sizeof(FX_WCHAR)); nRealLength += nCopyLength; nPrePos = nPos; @@ -203,15 +203,15 @@ void CFDE_TxtEdtEngine::GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT3 FXSYS_memcpy(lpBuffer + nRealLength, FX_LPCWSTR(wsBlock), nCopyLength * sizeof(FX_WCHAR)); nRealLength += nCopyLength; } - FX_INT32 nLeftLength = m_wsFixText.GetLength() - nPrePos; + int32_t nLeftLength = m_wsFixText.GetLength() - nPrePos; if (nLeftLength > 0) { FXSYS_memcpy(lpBuffer + nRealLength, lpFixBuffer + nPrePos, nLeftLength * sizeof(FX_WCHAR)); nRealLength += nLeftLength; } wsTemp.ReleaseBuffer(nRealLength); - FX_INT32 nRealBgn = GetRealIndex(nStart); - FX_INT32 nRealEnd = GetRealIndex(nStart + nCount - 1); - FX_INT32 nRealCount = nRealEnd - nRealBgn; + int32_t nRealBgn = GetRealIndex(nStart); + int32_t nRealEnd = GetRealIndex(nStart + nCount - 1); + int32_t nRealCount = nRealEnd - nRealBgn; FX_LPWSTR lpDestBuf = wsText.GetBuffer(nRealCount); FXSYS_memcpy(lpDestBuf, FX_LPCWSTR(wsTemp) + nRealBgn, nRealCount * sizeof(FX_WCHAR)); wsText.ReleaseBuffer(); @@ -225,19 +225,19 @@ void CFDE_TxtEdtEngine::ClearText() { DeleteRange(0, -1); } -FX_INT32 CFDE_TxtEdtEngine::GetCaretRect(CFX_RectF &rtCaret) const +int32_t CFDE_TxtEdtEngine::GetCaretRect(CFX_RectF &rtCaret) const { rtCaret = m_rtCaret; return m_nCaret; } -FX_INT32 CFDE_TxtEdtEngine::GetCaretPos() const +int32_t CFDE_TxtEdtEngine::GetCaretPos() const { if (IsLocked()) { return 0; } return m_nCaret + (m_bBefore ? 0 : 1); } -FX_INT32 CFDE_TxtEdtEngine::SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore) +int32_t CFDE_TxtEdtEngine::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) { if (IsLocked()) { return 0; @@ -265,7 +265,7 @@ FX_INT32 CFDE_TxtEdtEngine::SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore) m_nAnchorPos = -1; return m_nCaret; } -FX_INT32 CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, +int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, FX_BOOL bShift , FX_BOOL bCtrl ) { @@ -288,8 +288,8 @@ FX_INT32 CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, m_nAnchorPos = -1; } FX_BOOL bVertical = m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical; - FX_INT32 nCaret = m_nCaret; - FX_INT32 nCaretPage = m_nCaretPage; + int32_t nCaret = m_nCaret; + int32_t nCaretPage = m_nCaretPage; switch (eMoveCaret) { case MC_Left: { if (bVertical) { @@ -299,7 +299,7 @@ FX_INT32 CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, } } else { FX_BOOL bBefore = TRUE; - FX_INT32 nIndex = MoveBackward(bBefore); + int32_t nIndex = MoveBackward(bBefore); #ifdef FDE_USEFORMATBLOCK if (m_BlockArray.GetSize()) { nIndex = NormalizeCaretPos(nIndex, FDE_FORMAT_CARET_BACKWARD, bBefore); @@ -322,7 +322,7 @@ FX_INT32 CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, } } else { FX_BOOL bBefore = TRUE; - FX_INT32 nIndex = MoveForward(bBefore); + int32_t nIndex = MoveForward(bBefore); #ifdef FDE_USEFORMATBLOCK if (m_BlockArray.GetSize()) { if (nIndex == -1) { @@ -340,7 +340,7 @@ FX_INT32 CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, case MC_Up: { if (bVertical) { FX_BOOL bBefore = TRUE; - FX_INT32 nIndex = MoveBackward(bBefore); + int32_t nIndex = MoveBackward(bBefore); #ifdef FDE_USEFORMATBLOCK if (m_BlockArray.GetSize()) { nIndex = NormalizeCaretPos(nIndex, FDE_FORMAT_CARET_BACKWARD, bBefore); @@ -360,7 +360,7 @@ FX_INT32 CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, case MC_Down: { if (bVertical) { FX_BOOL bBefore = TRUE; - FX_INT32 nIndex = MoveForward(bBefore); + int32_t nIndex = MoveForward(bBefore); #ifdef FDE_USEFORMATBLOCK if (m_BlockArray.GetSize()) { nIndex = NormalizeCaretPos(nIndex, FDE_FORMAT_CARET_FORWARD, bBefore); @@ -427,29 +427,29 @@ FX_BOOL CFDE_TxtEdtEngine::IsLocked() const { return m_bLock; } -FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength) +int32_t CFDE_TxtEdtEngine::Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength) { if (IsLocked()) { return FDE_TXTEDT_MODIFY_RET_F_Locked; } #ifdef FDE_USEFORMATBLOCK - FX_INT32 nBlockCount = m_BlockArray.GetSize(); + int32_t nBlockCount = m_BlockArray.GetSize(); if (nBlockCount) { if (m_Param.dwMode & FDE_TEXTEDITMODE_FIELD_TAB && nLength == 1 && lpText[0] == L'\t') { return Move2NextEditableField(nStart) ? FDE_TXTEDT_MODIFY_RET_T_Tab : \ FDE_TXTEDT_MODIFY_RET_F_Tab; } - FX_INT32 nSelRangeCount = CountSelRanges(); + int32_t nSelRangeCount = CountSelRanges(); if (nSelRangeCount > 0) { if (nSelRangeCount > 1) { return FDE_TXTEDT_MODIFY_RET_F_Boundary; } - FX_INT32 nSelStart; - FX_INT32 nSelCount; + int32_t nSelStart; + int32_t nSelCount; nSelCount = GetSelRange(0, nSelStart); - FX_INT32 nSelEnd = nSelStart + nSelCount; - FX_INT32 nBgn = 0; - FX_INT32 nEnd = 0; + int32_t nSelEnd = nSelStart + nSelCount; + int32_t nBgn = 0; + int32_t nEnd = 0; CFDE_TxtEdtField * pField = NULL; FX_BOOL bInField = GetFieldBoundary(nSelStart, nBgn, nEnd, pField); if (nSelEnd > nEnd) { @@ -459,9 +459,9 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 pField->Backup(); FX_BOOL bBefore = FALSE; CFX_WideString wsDel; - FX_INT32 nCaret; - FX_INT32 nIndexInField = nSelStart - nBgn; - FX_INT32 nRet = pField->Replace(nSelStart - nBgn, nSelCount, CFX_WideStringC(lpText, nLength), wsDel, nCaret, bBefore); + int32_t nCaret; + int32_t nIndexInField = nSelStart - nBgn; + int32_t nRet = pField->Replace(nSelStart - nBgn, nSelCount, CFX_WideStringC(lpText, nLength), wsDel, nCaret, bBefore); switch(nRet) { case FDE_FORMAT_FIELD_INSERT_RET_F_FULL: pField->Restore(); @@ -489,7 +489,7 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 } } Replace(nBgn, nEnd - nBgn + 1, wsDisplay); - FX_INT32 nNewCaret = nBgn + nCaret; + int32_t nNewCaret = nBgn + nCaret; if (!(m_Param.dwMode & FDE_TEXTEDITMODE_NoRedoUndo)) { IFDE_TxtEdtDoRecord * pRecord = FX_NEW CFDE_TxtEdtDoRecord_FieldReplace(this, \ m_nCaret, nNewCaret, pField, nIndexInField, nBgn, wsDisplay.GetLength(), \ @@ -503,16 +503,16 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 return FDE_TXTEDT_MODIFY_RET_S_Normal; } } - FX_INT32 nBgn = 0; - FX_INT32 nEnd = 0; + int32_t nBgn = 0; + int32_t nEnd = 0; CFDE_TxtEdtField * pField = NULL; FX_BOOL bInField = GetFieldBoundary(m_nCaret, nBgn, nEnd, pField); - FX_INT32 nCaretInField = m_nCaret - nBgn; + int32_t nCaretInField = m_nCaret - nBgn; FX_BOOL bBefore = FALSE; if (bInField) { pField->Backup(); CFX_WideStringC wsIns(lpText, nLength); - FX_INT32 nRet = pField->Insert(nCaretInField, wsIns, nCaretInField, bBefore); + int32_t nRet = pField->Insert(nCaretInField, wsIns, nCaretInField, bBefore); FX_BOOL bFull = FALSE; switch (nRet) { case FDE_FORMAT_FIELD_INSERT_RET_S_NORMAL: @@ -554,7 +554,7 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord); pRecord->Release(); } - FX_INT32 nCaretPos = nBgn + nCaretInField; + int32_t nCaretPos = nBgn + nCaretInField; if (m_Param.dwMode & FDE_TEXTEDITMODE_FIELD_AUTO && bFull && nCaretPos == nEnd) { if (Move2NextEditableField(nEnd, TRUE, FALSE)) { return TRUE; @@ -574,14 +574,14 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 wsTemp.ReleaseBuffer(nLength); FX_BOOL bPart = FALSE; if (m_nLimit > 0) { - FX_INT32 nTotalLength = GetTextBufLength(); - FX_INT32 nDelLength = 0; - FX_INT32 nCount = m_SelRangePtrArr.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nTotalLength = GetTextBufLength(); + int32_t nDelLength = 0; + int32_t nCount = m_SelRangePtrArr.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { FDE_LPTXTEDTSELRANGE lpSelRange = m_SelRangePtrArr.GetAt(i); nTotalLength -= lpSelRange->nCount; } - FX_INT32 nExpectLength = nTotalLength + nLength; + int32_t nExpectLength = nTotalLength + nLength; if (nTotalLength == m_nLimit) { return FDE_TXTEDT_MODIFY_RET_F_Full; } @@ -591,14 +591,14 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 } } if ((m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Vert) || (m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Horz)) { - FX_INT32 nTemp = nLength; + int32_t nTemp = nLength; if (m_Param.dwMode & FDE_TEXTEDITMODE_Password) { CFX_WideString wsText; while (nLength > 0) { GetPreInsertText(wsText, m_nCaret, lpBuffer, nLength); - FX_INT32 nTotal = wsText.GetLength(); + int32_t nTotal = wsText.GetLength(); FX_LPWSTR lpBuf = wsText.GetBuffer(nTotal); - for (FX_INT32 i = 0; i < nTotal; i ++) { + for (int32_t i = 0; i < nTotal; i ++) { lpBuf[i] = m_wcAliasChar; } wsText.ReleaseBuffer(nTotal); @@ -657,7 +657,7 @@ FX_INT32 CFDE_TxtEdtEngine::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo); return bPart ? FDE_TXTEDT_MODIFY_RET_S_Part : FDE_TXTEDT_MODIFY_RET_S_Normal; } -FX_INT32 CFDE_TxtEdtEngine::Delete(FX_INT32 nStart, FX_BOOL bBackspace ) +int32_t CFDE_TxtEdtEngine::Delete(int32_t nStart, FX_BOOL bBackspace ) { if (IsLocked()) { return FDE_TXTEDT_MODIFY_RET_F_Locked; @@ -667,23 +667,23 @@ FX_INT32 CFDE_TxtEdtEngine::Delete(FX_INT32 nStart, FX_BOOL bBackspace ) return FDE_TXTEDT_MODIFY_RET_S_Normal; } #ifdef FDE_USEFORMATBLOCK - FX_INT32 nBlockCount = m_BlockArray.GetSize(); + int32_t nBlockCount = m_BlockArray.GetSize(); if (nBlockCount > 0) { if (bBackspace) { nStart --; } - FX_INT32 nCount = 1; - FX_INT32 nBgn = 0; - FX_INT32 nEnd = 0; + int32_t nCount = 1; + int32_t nBgn = 0; + int32_t nEnd = 0; CFDE_TxtEdtField * pField = NULL; FX_BOOL bInField = GetFieldBoundary(nStart, nBgn, nEnd, pField); - FX_INT32 nCaretInField = nStart - nBgn; + int32_t nCaretInField = nStart - nBgn; FX_BOOL bBefore = FALSE; if (bInField && !pField->IsFix()) { pField->Backup(); CFX_WideString wsDel; - FX_INT32 nCaret = 0; - FX_INT32 nRet = pField->Delete(nCaretInField, nCount, wsDel, nCaret, bBefore); + int32_t nCaret = 0; + int32_t nRet = pField->Delete(nCaretInField, nCount, wsDel, nCaret, bBefore); nCaret += nBgn; switch (nRet) { case FDE_FORMAT_FIELD_DELETE_RET_S: @@ -719,7 +719,7 @@ FX_INT32 CFDE_TxtEdtEngine::Delete(FX_INT32 nStart, FX_BOOL bBackspace ) return FDE_TXTEDT_MODIFY_RET_F_Boundary; } #endif - FX_INT32 nCount = 1; + int32_t nCount = 1; if (bBackspace) { if (nStart == 0) { return FDE_TXTEDT_MODIFY_RET_F_Boundary; @@ -762,7 +762,7 @@ FX_INT32 CFDE_TxtEdtEngine::Delete(FX_INT32 nStart, FX_BOOL bBackspace ) m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo); return FDE_TXTEDT_MODIFY_RET_S_Normal; } -FX_INT32 CFDE_TxtEdtEngine::DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) +int32_t CFDE_TxtEdtEngine::DeleteRange(int32_t nStart, int32_t nCount ) { if (IsLocked()) { return FDE_TXTEDT_MODIFY_RET_F_Locked; @@ -785,7 +785,7 @@ FX_INT32 CFDE_TxtEdtEngine::DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) SetCaretPos(nStart, TRUE); return FDE_TXTEDT_MODIFY_RET_S_Normal; } -FX_INT32 CFDE_TxtEdtEngine::Replace(FX_INT32 nStart, FX_INT32 nLength, const CFX_WideString &wsReplace) +int32_t CFDE_TxtEdtEngine::Replace(int32_t nStart, int32_t nLength, const CFX_WideString &wsReplace) { if (IsLocked()) { return FDE_TXTEDT_MODIFY_RET_F_Locked; @@ -808,7 +808,7 @@ FX_INT32 CFDE_TxtEdtEngine::Replace(FX_INT32 nStart, FX_INT32 nLength, const CFX if (nLength > 0) { Inner_DeleteRange(nStart, nLength); } - FX_INT32 nTextLength = wsReplace.GetLength(); + int32_t nTextLength = wsReplace.GetLength(); if (nTextLength > 0) { Inner_Insert(nStart, FX_LPCWSTR(wsReplace), nTextLength); } @@ -826,7 +826,7 @@ FX_INT32 CFDE_TxtEdtEngine::Replace(FX_INT32 nStart, FX_INT32 nLength, const CFX m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo); return FDE_TXTEDT_MODIFY_RET_S_Normal; } -void CFDE_TxtEdtEngine::SetLimit(FX_INT32 nLimit) +void CFDE_TxtEdtEngine::SetLimit(int32_t nLimit) { m_nLimit = nLimit; } @@ -834,7 +834,7 @@ void CFDE_TxtEdtEngine::SetAliasChar(FX_WCHAR wcAlias) { m_wcAliasChar = wcAlias; } -void CFDE_TxtEdtEngine::SetFormatBlock(FX_INT32 nIndex, const CFX_WideString &wsBlockFormat) +void CFDE_TxtEdtEngine::SetFormatBlock(int32_t nIndex, const CFX_WideString &wsBlockFormat) { #ifdef FDE_USEFORMATBLOCK if (m_nFixLength == -1) { @@ -843,9 +843,9 @@ void CFDE_TxtEdtEngine::SetFormatBlock(FX_INT32 nIndex, const CFX_WideString &ws GetText(m_wsFixText, 0, -1); } FX_BOOL bInBlock = FALSE; - FX_INT32 nCharIndex = 0; - FX_INT32 nBlockIndex = 0; - FX_INT32 nBlockPos = -1; + int32_t nCharIndex = 0; + int32_t nBlockIndex = 0; + int32_t nBlockPos = -1; FX_WCHAR wc; CFDE_TxtEdtBufIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf, FALSE); pIter->SetAt(0); @@ -881,7 +881,7 @@ void CFDE_TxtEdtEngine::SetFormatBlock(FX_INT32 nIndex, const CFX_WideString &ws } #endif } -FX_INT32 CFDE_TxtEdtEngine::CountEditBlocks() const +int32_t CFDE_TxtEdtEngine::CountEditBlocks() const { #ifdef FDE_USEFORMATBLOCK return m_BlockArray.GetSize(); @@ -889,14 +889,14 @@ FX_INT32 CFDE_TxtEdtEngine::CountEditBlocks() const return 0; #endif } -void CFDE_TxtEdtEngine::GetEditBlockText(FX_INT32 nIndex, CFX_WideString &wsBlockText) const +void CFDE_TxtEdtEngine::GetEditBlockText(int32_t nIndex, CFX_WideString &wsBlockText) const { #ifdef FDE_USEFORMATBLOCK CFDE_TxtEdtBlock * pBlock = m_BlockArray[nIndex]; pBlock->GetBlockText(wsBlockText); #endif } -FX_INT32 CFDE_TxtEdtEngine::CountEditFields(FX_INT32 nBlockIndex) const +int32_t CFDE_TxtEdtEngine::CountEditFields(int32_t nBlockIndex) const { #ifdef FDE_USEFORMATBLOCK CFDE_TxtEdtBlock * pBlock = m_BlockArray[nBlockIndex]; @@ -905,7 +905,7 @@ FX_INT32 CFDE_TxtEdtEngine::CountEditFields(FX_INT32 nBlockIndex) const return 0; #endif } -void CFDE_TxtEdtEngine::GetEditFieldText(FX_INT32 nBlockIndex, FX_INT32 nFieldIndex, CFX_WideString &wsFieldText) const +void CFDE_TxtEdtEngine::GetEditFieldText(int32_t nBlockIndex, int32_t nFieldIndex, CFX_WideString &wsFieldText) const { #ifdef FDE_USEFORMATBLOCK CFDE_TxtEdtBlock * pBlock = m_BlockArray[nBlockIndex]; @@ -922,11 +922,11 @@ void CFDE_TxtEdtEngine::EndEdit() #ifdef FDE_USEFORMATBLOCK #endif } -void CFDE_TxtEdtEngine::RemoveSelRange(FX_INT32 nStart, FX_INT32 nCount ) +void CFDE_TxtEdtEngine::RemoveSelRange(int32_t nStart, int32_t nCount ) { FDE_LPTXTEDTSELRANGE lpTemp = NULL; - FX_INT32 nRangeCount = m_SelRangePtrArr.GetSize(); - FX_INT32 i = 0; + int32_t nRangeCount = m_SelRangePtrArr.GetSize(); + int32_t i = 0; for (i = 0; i < nRangeCount; i ++) { lpTemp = m_SelRangePtrArr[i]; if (lpTemp->nStart == nStart && lpTemp->nCount == nCount) { @@ -937,12 +937,12 @@ void CFDE_TxtEdtEngine::RemoveSelRange(FX_INT32 nStart, FX_INT32 nCount ) } return; } -void CFDE_TxtEdtEngine::AddSelRange(FX_INT32 nStart, FX_INT32 nCount ) +void CFDE_TxtEdtEngine::AddSelRange(int32_t nStart, int32_t nCount ) { if (nCount == -1) { nCount = GetTextLength() - nStart; } - FX_INT32 nSize = m_SelRangePtrArr.GetSize(); + int32_t nSize = m_SelRangePtrArr.GetSize(); if (nSize <= 0) { FDE_LPTXTEDTSELRANGE lpSelRange = FX_NEW FDE_TXTEDTSELRANGE; lpSelRange->nStart = nStart; @@ -961,14 +961,14 @@ void CFDE_TxtEdtEngine::AddSelRange(FX_INT32 nStart, FX_INT32 nCount ) m_Param.pEventSink->On_SelChanged(this); return; } - FX_INT32 nEnd = nStart + nCount - 1; + int32_t nEnd = nStart + nCount - 1; FX_BOOL bBegin = FALSE; - FX_INT32 nRangeBgn = 0; - FX_INT32 nRangeCnt = 0; - for (FX_INT32 i = 0; i < nSize; i ++) { + int32_t nRangeBgn = 0; + int32_t nRangeCnt = 0; + for (int32_t i = 0; i < nSize; i ++) { lpTemp = m_SelRangePtrArr[i]; - FX_INT32 nTempBgn = lpTemp->nStart; - FX_INT32 nTempEnd = nTempBgn + lpTemp->nCount - 1; + int32_t nTempBgn = lpTemp->nStart; + int32_t nTempEnd = nTempBgn + lpTemp->nCount - 1; if (bBegin) { if (nEnd < nTempBgn) { break; @@ -1007,20 +1007,20 @@ void CFDE_TxtEdtEngine::AddSelRange(FX_INT32 nStart, FX_INT32 nCount ) m_Param.pEventSink->On_SelChanged(this); return; } -FX_INT32 CFDE_TxtEdtEngine::CountSelRanges() +int32_t CFDE_TxtEdtEngine::CountSelRanges() { return m_SelRangePtrArr.GetSize(); } -FX_INT32 CFDE_TxtEdtEngine::GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart) +int32_t CFDE_TxtEdtEngine::GetSelRange(int32_t nIndex, int32_t &nStart) { nStart = m_SelRangePtrArr[nIndex]->nStart; return m_SelRangePtrArr[nIndex]->nCount; } void CFDE_TxtEdtEngine::ClearSelection() { - FX_INT32 nCount = m_SelRangePtrArr.GetSize(); + int32_t nCount = m_SelRangePtrArr.GetSize(); FDE_LPTXTEDTSELRANGE lpRange = NULL; - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < nCount; i ++) { lpRange = m_SelRangePtrArr[i]; if (lpRange != NULL) { @@ -1067,7 +1067,7 @@ FX_BOOL CFDE_TxtEdtEngine::Undo(FX_BSTR bsUndo) pDoRecord->Release(); return bOK; } -FX_INT32 CFDE_TxtEdtEngine::StartLayout() +int32_t CFDE_TxtEdtEngine::StartLayout() { Lock(); RemoveAllPages(); @@ -1075,11 +1075,11 @@ FX_INT32 CFDE_TxtEdtEngine::StartLayout() m_nLineCount = 0; return 0; } -FX_INT32 CFDE_TxtEdtEngine::DoLayout(IFX_Pause * pPause) +int32_t CFDE_TxtEdtEngine::DoLayout(IFX_Pause * pPause) { - FX_INT32 nCount = m_ParagPtrArray.GetSize(); + int32_t nCount = m_ParagPtrArray.GetSize(); CFDE_TxtEdtParag * pParag = NULL; - FX_INT32 nLineCount = 0; + int32_t nLineCount = 0; for (; m_nLayoutPos < nCount; m_nLayoutPos ++) { pParag = m_ParagPtrArray[m_nLayoutPos]; pParag->CalcLines(); @@ -1095,11 +1095,11 @@ FX_INT32 CFDE_TxtEdtEngine::DoLayout(IFX_Pause * pPause) void CFDE_TxtEdtEngine::EndLayout() { UpdatePages(); - FX_INT32 nLength = GetTextLength(); + int32_t nLength = GetTextLength(); if (m_nCaret > nLength) { m_nCaret = nLength; } - FX_INT32 nIndex = m_nCaret; + int32_t nIndex = m_nCaret; if (!m_bBefore) { nIndex --; } @@ -1114,7 +1114,7 @@ IFDE_TxtEdtBuf * CFDE_TxtEdtEngine::GetTextBuf() const { return (IFDE_TxtEdtBuf*)m_pTxtBuf; } -FX_INT32 CFDE_TxtEdtEngine::GetTextBufLength() const +int32_t CFDE_TxtEdtEngine::GetTextBufLength() const { return m_pTxtBuf->GetTextLength() - 1; } @@ -1122,19 +1122,19 @@ IFX_TxtBreak * CFDE_TxtEdtEngine::GetTextBreak() const { return m_pTextBreak; } -FX_INT32 CFDE_TxtEdtEngine::GetLineCount() const +int32_t CFDE_TxtEdtEngine::GetLineCount() const { return m_nLineCount; } -FX_INT32 CFDE_TxtEdtEngine::GetPageLineCount() const +int32_t CFDE_TxtEdtEngine::GetPageLineCount() const { return m_nPageLineCount; } -FX_INT32 CFDE_TxtEdtEngine::CountParags() const +int32_t CFDE_TxtEdtEngine::CountParags() const { return m_ParagPtrArray.GetSize(); } -IFDE_TxtEdtParag* CFDE_TxtEdtEngine::GetParag(FX_INT32 nParagIndex) const +IFDE_TxtEdtParag* CFDE_TxtEdtEngine::GetParag(int32_t nParagIndex) const { return m_ParagPtrArray[nParagIndex]; } @@ -1145,13 +1145,13 @@ IFX_CharIter* CFDE_TxtEdtEngine::CreateCharIter() } return FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf); } -FX_INT32 CFDE_TxtEdtEngine::Line2Parag(FX_INT32 nStartParag, FX_INT32 nStartLineofParag, \ - FX_INT32 nLineIndex, FX_INT32 &nStartLine) const +int32_t CFDE_TxtEdtEngine::Line2Parag(int32_t nStartParag, int32_t nStartLineofParag, \ + int32_t nLineIndex, int32_t &nStartLine) const { - FX_INT32 nLineTotal = nStartLineofParag; - FX_INT32 nCount = m_ParagPtrArray.GetSize(); + int32_t nLineTotal = nStartLineofParag; + int32_t nCount = m_ParagPtrArray.GetSize(); CFDE_TxtEdtParag * pParag = NULL; - FX_INT32 i = nStartParag; + int32_t i = nStartParag; for (; i < nCount; i ++) { pParag = m_ParagPtrArray[i]; nLineTotal += pParag->m_nLineCount; @@ -1162,24 +1162,24 @@ FX_INT32 CFDE_TxtEdtEngine::Line2Parag(FX_INT32 nStartParag, FX_INT32 nStartLine nStartLine = nLineTotal - pParag->m_nLineCount; return i; } -void CFDE_TxtEdtEngine::GetPreDeleteText(CFX_WideString &wsText, FX_INT32 nIndex, FX_INT32 nLength) +void CFDE_TxtEdtEngine::GetPreDeleteText(CFX_WideString &wsText, int32_t nIndex, int32_t nLength) { GetText(wsText, 0, GetTextBufLength()); wsText.Delete(nIndex, nLength); } -void CFDE_TxtEdtEngine::GetPreInsertText(CFX_WideString &wsText, FX_INT32 nIndex, FX_LPCWSTR lpText, FX_INT32 nLength) +void CFDE_TxtEdtEngine::GetPreInsertText(CFX_WideString &wsText, int32_t nIndex, FX_LPCWSTR lpText, int32_t nLength) { GetText(wsText, 0, GetTextBufLength()); - FX_INT32 nSelIndex = 0; - FX_INT32 nSelLength = 0; - FX_INT32 nSelCount = CountSelRanges(); + int32_t nSelIndex = 0; + int32_t nSelLength = 0; + int32_t nSelCount = CountSelRanges(); while (nSelCount --) { nSelLength = GetSelRange(nSelCount, nSelIndex); wsText.Delete(nSelIndex, nSelLength); nIndex = nSelIndex; } CFX_WideString wsTemp; - FX_INT32 nOldLength = wsText.GetLength(); + int32_t nOldLength = wsText.GetLength(); FX_LPCWSTR pOldBuffer = FX_LPCWSTR(wsText); FX_LPWSTR lpBuffer = wsTemp.GetBuffer(nOldLength + nLength); FXSYS_memcpy(lpBuffer, pOldBuffer, (nIndex) * sizeof(FX_WCHAR)); @@ -1188,43 +1188,43 @@ void CFDE_TxtEdtEngine::GetPreInsertText(CFX_WideString &wsText, FX_INT32 nIndex wsTemp.ReleaseBuffer(nOldLength + nLength); wsText = wsTemp; } -void CFDE_TxtEdtEngine::GetPreReplaceText(CFX_WideString &wsText, FX_INT32 nIndex, FX_INT32 nOriginLength, FX_LPCWSTR lpText, FX_INT32 nLength) +void CFDE_TxtEdtEngine::GetPreReplaceText(CFX_WideString &wsText, int32_t nIndex, int32_t nOriginLength, FX_LPCWSTR lpText, int32_t nLength) { GetText(wsText, 0, GetTextBufLength()); - FX_INT32 nSelIndex = 0; - FX_INT32 nSelLength = 0; - FX_INT32 nSelCount = CountSelRanges(); + int32_t nSelIndex = 0; + int32_t nSelLength = 0; + int32_t nSelCount = CountSelRanges(); while (nSelCount --) { nSelLength = GetSelRange(nSelCount, nSelIndex); wsText.Delete(nSelIndex, nSelLength); } wsText.Delete(nIndex, nOriginLength); - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < nLength; i ++) { wsText.Insert(nIndex ++, lpText[i]); } } -void CFDE_TxtEdtEngine::Inner_Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength) +void CFDE_TxtEdtEngine::Inner_Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength) { FXSYS_assert(nLength > 0); FDE_TXTEDTPARAGPOS ParagPos; TextPos2ParagPos(nStart, ParagPos); m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0); - FX_INT32 nParagCount = m_ParagPtrArray.GetSize(); - FX_INT32 i = 0; + int32_t nParagCount = m_ParagPtrArray.GetSize(); + int32_t i = 0; for (i = ParagPos.nParagIndex + 1; i < nParagCount; i ++) { m_ParagPtrArray[i]->m_nCharStart += nLength; } CFDE_TxtEdtParag * pParag = m_ParagPtrArray[ParagPos.nParagIndex]; - FX_INT32 nReserveLineCount = pParag->m_nLineCount; - FX_INT32 nReserveCharStart = pParag->m_nCharStart; - FX_INT32 nLeavePart = ParagPos.nCharIndex; - FX_INT32 nCutPart = pParag->m_nCharCount - ParagPos.nCharIndex; - FX_INT32 nTextStart = 0; + int32_t nReserveLineCount = pParag->m_nLineCount; + int32_t nReserveCharStart = pParag->m_nCharStart; + int32_t nLeavePart = ParagPos.nCharIndex; + int32_t nCutPart = pParag->m_nCharCount - ParagPos.nCharIndex; + int32_t nTextStart = 0; FX_WCHAR wCurChar = L' '; FX_LPCWSTR lpPos = lpText; FX_BOOL bFirst = TRUE; - FX_INT32 nParagIndex = ParagPos.nParagIndex; + int32_t nParagIndex = ParagPos.nParagIndex; for (i = 0; i < nLength; i ++, lpPos ++) { wCurChar = *lpPos; if (wCurChar == m_wLineEnd) { @@ -1256,7 +1256,7 @@ void CFDE_TxtEdtEngine::Inner_Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT3 m_ParagPtrArray.InsertAt(++nParagIndex, pParag); } m_pTxtBuf->Insert(nStart, lpText, nLength); - FX_INT32 nTotalLineCount = 0; + int32_t nTotalLineCount = 0; for (i = ParagPos.nParagIndex; i <= nParagIndex; i ++) { pParag = m_ParagPtrArray[i]; pParag->CalcLines(); @@ -1267,26 +1267,26 @@ void CFDE_TxtEdtEngine::Inner_Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT3 UpdatePages(); } #ifdef FDE_USEFORMATBLOCK -void CFDE_TxtEdtEngine::RawInsert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength) +void CFDE_TxtEdtEngine::RawInsert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength) { FXSYS_assert(nLength > 0); FDE_TXTEDTPARAGPOS ParagPos; TextPos2ParagPos(nStart, ParagPos); - FX_INT32 nParagCount = m_ParagPtrArray.GetSize(); - FX_INT32 i = 0; + int32_t nParagCount = m_ParagPtrArray.GetSize(); + int32_t i = 0; for (i = ParagPos.nParagIndex + 1; i < nParagCount; i ++) { m_ParagPtrArray[i]->m_nCharStart += nLength; } CFDE_TxtEdtParag * pParag = m_ParagPtrArray[ParagPos.nParagIndex]; - FX_INT32 nReserveLineCount = pParag->m_nLineCount; - FX_INT32 nReserveCharStart = pParag->m_nCharStart; - FX_INT32 nLeavePart = ParagPos.nCharIndex; - FX_INT32 nCutPart = pParag->m_nCharCount - ParagPos.nCharIndex; - FX_INT32 nTextStart = 0; + int32_t nReserveLineCount = pParag->m_nLineCount; + int32_t nReserveCharStart = pParag->m_nCharStart; + int32_t nLeavePart = ParagPos.nCharIndex; + int32_t nCutPart = pParag->m_nCharCount - ParagPos.nCharIndex; + int32_t nTextStart = 0; FX_WCHAR wCurChar = L' '; FX_LPCWSTR lpPos = lpText; FX_BOOL bFirst = TRUE; - FX_INT32 nParagIndex = ParagPos.nParagIndex; + int32_t nParagIndex = ParagPos.nParagIndex; for (i = 0; i < nLength; i ++, lpPos ++) { wCurChar = *lpPos; if (wCurChar == m_wLineEnd) { @@ -1320,12 +1320,12 @@ void CFDE_TxtEdtEngine::RawInsert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 n m_pTxtBuf->Insert(nStart, lpText, nLength); } #endif -void CFDE_TxtEdtEngine::Inner_DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) +void CFDE_TxtEdtEngine::Inner_DeleteRange(int32_t nStart, int32_t nCount ) { if (nCount == -1) { nCount = m_pTxtBuf->GetTextLength() - nStart; } - FX_INT32 nEnd = nStart + nCount - 1; + int32_t nEnd = nStart + nCount - 1; FXSYS_assert(nStart >= 0 && nEnd < m_pTxtBuf->GetTextLength()); m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0); FDE_TXTEDTPARAGPOS ParagPosBgn, ParagPosEnd; @@ -1340,9 +1340,9 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) bLastParag = TRUE; } } - FX_INT32 nTotalLineCount = 0; - FX_INT32 nTotalCharCount = 0; - FX_INT32 i = 0; + int32_t nTotalLineCount = 0; + int32_t nTotalCharCount = 0; + int32_t i = 0; for (i = ParagPosBgn.nParagIndex; i <= ParagPosEnd.nParagIndex; i ++) { CFDE_TxtEdtParag * pParag = m_ParagPtrArray[i]; pParag->CalcLines(); @@ -1351,7 +1351,7 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) } m_pTxtBuf->Delete(nStart, nCount); CFDE_TxtEdtParag * pEndParag = m_ParagPtrArray[ParagPosEnd.nParagIndex]; - FX_INT32 nNextParagIndex = (ParagPosBgn.nCharIndex == 0 && bLastParag) ? ParagPosBgn.nParagIndex : \ + int32_t nNextParagIndex = (ParagPosBgn.nCharIndex == 0 && bLastParag) ? ParagPosBgn.nParagIndex : \ (ParagPosBgn.nParagIndex + 1); for (i = nNextParagIndex; i <= ParagPosEnd.nParagIndex; i ++) { CFDE_TxtEdtParag * pParag = m_ParagPtrArray[nNextParagIndex]; @@ -1364,19 +1364,19 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) pParag->CalcLines(); nTotalLineCount -= pParag->m_nLineCount; } - FX_INT32 nParagCount = m_ParagPtrArray.GetSize(); + int32_t nParagCount = m_ParagPtrArray.GetSize(); for (i = nNextParagIndex; i < nParagCount; i ++) { m_ParagPtrArray[i]->m_nCharStart -= nCount; } m_nLineCount -= nTotalLineCount; UpdatePages(); - FX_INT32 nPageCount = CountPages(); + int32_t nPageCount = CountPages(); if (m_nCaretPage >= nPageCount) { m_nCaretPage = nPageCount - 1; } m_Param.pEventSink->On_PageLoad(this, m_nCaretPage, 0); } -void CFDE_TxtEdtEngine::DeleteRange_DoRecord(FX_INT32 nStart, FX_INT32 nCount, FX_BOOL bSel ) +void CFDE_TxtEdtEngine::DeleteRange_DoRecord(int32_t nStart, int32_t nCount, FX_BOOL bSel ) { FXSYS_assert(nStart >= 0); if (nCount == -1) { @@ -1384,7 +1384,7 @@ void CFDE_TxtEdtEngine::DeleteRange_DoRecord(FX_INT32 nStart, FX_INT32 nCount, F } FXSYS_assert((nStart + nCount) <= m_pTxtBuf->GetTextLength()); #ifdef FDE_USEFORMATBLOCK - FX_INT32 nBlockCount = m_BlockArray.GetSize(); + int32_t nBlockCount = m_BlockArray.GetSize(); if (nBlockCount > 0) { } #endif @@ -1416,9 +1416,9 @@ void CFDE_TxtEdtEngine::RebuildParagraphs() RemoveAllParags(); FX_WCHAR wChar = L' '; FX_WCHAR wCharPre = L' '; - FX_INT32 nParagStart = 0; - FX_INT32 nCount = m_pTxtBuf->GetTextLength(); - FX_INT32 nIndex = 0; + int32_t nParagStart = 0; + int32_t nCount = m_pTxtBuf->GetTextLength(); + int32_t nIndex = 0; CFDE_TxtEdtParag * pParag = NULL; IFX_CharIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf); pIter->SetAt(0); @@ -1438,8 +1438,8 @@ void CFDE_TxtEdtEngine::RebuildParagraphs() } void CFDE_TxtEdtEngine::RemoveAllParags() { - FX_INT32 nCount = m_ParagPtrArray.GetSize(); - FX_INT32 i = 0; + int32_t nCount = m_ParagPtrArray.GetSize(); + int32_t i = 0; for (i = 0; i < nCount; i ++) { CFDE_TxtEdtParag * pParag = m_ParagPtrArray[i]; if (pParag) { @@ -1450,8 +1450,8 @@ void CFDE_TxtEdtEngine::RemoveAllParags() } void CFDE_TxtEdtEngine::RemoveAllPages() { - FX_INT32 nCount = m_PagePtrArray.GetSize(); - FX_INT32 i = 0; + int32_t nCount = m_PagePtrArray.GetSize(); + int32_t i = 0; for (i = 0; i < nCount; i ++) { IFDE_TxtEdtPage * pPage = m_PagePtrArray[i]; if (pPage) { @@ -1462,13 +1462,13 @@ void CFDE_TxtEdtEngine::RemoveAllPages() } void CFDE_TxtEdtEngine::UpdateParags() { - FX_INT32 nCount = m_ParagPtrArray.GetSize(); + int32_t nCount = m_ParagPtrArray.GetSize(); if (nCount == 0) { return; } CFDE_TxtEdtParag * pParag = NULL; - FX_INT32 nLineCount = 0; - FX_INT32 i = 0; + int32_t nLineCount = 0; + int32_t i = 0; for (i = 0; i < nCount; i ++) { pParag = m_ParagPtrArray[i]; if (pParag->m_nLineCount == -1) { @@ -1483,14 +1483,14 @@ void CFDE_TxtEdtEngine::UpdatePages() if (m_nLineCount == 0) { return; } - FX_INT32 nPageCount = (m_nLineCount - 1) / (m_nPageLineCount) + 1; - FX_INT32 nSize = m_PagePtrArray.GetSize(); + int32_t nPageCount = (m_nLineCount - 1) / (m_nPageLineCount) + 1; + int32_t nSize = m_PagePtrArray.GetSize(); if (nSize == nPageCount) { return; } if (nSize > nPageCount) { IFDE_TxtEdtPage * pPage = NULL; - FX_INT32 i = 0; + int32_t i = 0; for (i = nSize - 1; i >= nPageCount; i --) { pPage = m_PagePtrArray[i]; if (pPage) { @@ -1503,7 +1503,7 @@ void CFDE_TxtEdtEngine::UpdatePages() } if (nSize < nPageCount) { IFDE_TxtEdtPage * pPage = NULL; - FX_INT32 i = 0; + int32_t i = 0; for (i = nSize; i < nPageCount; i ++) { pPage = IFDE_TxtEdtPage::Create(this, i); m_PagePtrArray.Add(pPage); @@ -1605,9 +1605,9 @@ void CFDE_TxtEdtEngine::UpdateTxtBreak() m_pTextBreak->SetHorizontalScale(m_Param.nHorzScale); m_pTextBreak->SetCharSpace(m_Param.fCharSpace); } -FX_BOOL CFDE_TxtEdtEngine::ReplaceParagEnd(FX_LPWSTR &lpText, FX_INT32 &nLength, FX_BOOL bPreIsCR ) +FX_BOOL CFDE_TxtEdtEngine::ReplaceParagEnd(FX_LPWSTR &lpText, int32_t &nLength, FX_BOOL bPreIsCR ) { - for (FX_INT32 i = 0; i < nLength; i ++) { + for (int32_t i = 0; i < nLength; i ++) { FX_WCHAR wc = lpText[i]; switch(wc) { case L'\r': { @@ -1617,7 +1617,7 @@ FX_BOOL CFDE_TxtEdtEngine::ReplaceParagEnd(FX_LPWSTR &lpText, FX_INT32 &nLength, break; case L'\n': { if (bPreIsCR == TRUE) { - FX_INT32 nNext = i + 1; + int32_t nNext = i + 1; if (nNext < nLength) { FXSYS_memmove(lpText + i, lpText + nNext, (nLength - nNext) * sizeof(FX_WCHAR)); } @@ -1653,9 +1653,9 @@ void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString &wsText) { FX_WCHAR wc = (m_nFirstLineEnd == FDE_TXTEDIT_LINEEND_CR) ? L'\n' : L'\r'; if (m_nFirstLineEnd == FDE_TXTEDIT_LINEEND_CRLF) { - CFX_ArrayTemplate PosArr; - FX_INT32 nLength = wsText.GetLength(); - FX_INT32 i = 0; + CFX_ArrayTemplate PosArr; + int32_t nLength = wsText.GetLength(); + int32_t i = 0; FX_LPWSTR lpPos = (FX_LPWSTR)(FX_LPCWSTR)wsText; for (i = 0; i < nLength; i ++, lpPos ++) { if (*lpPos == m_wLineEnd) { @@ -1665,13 +1665,13 @@ void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString &wsText) } FX_LPCWSTR lpSrcBuf = FX_LPCWSTR(wsText); CFX_WideString wsTemp; - FX_INT32 nCount = PosArr.GetSize(); + int32_t nCount = PosArr.GetSize(); FX_LPWSTR lpDstBuf = wsTemp.GetBuffer(nLength + nCount); - FX_INT32 nDstPos = 0; - FX_INT32 nSrcPos = 0; + int32_t nDstPos = 0; + int32_t nSrcPos = 0; for (i = 0; i < nCount; i ++) { - FX_INT32 nPos = PosArr[i]; - FX_INT32 nCopyLen = nPos - nSrcPos + 1; + int32_t nPos = PosArr[i]; + int32_t nCopyLen = nPos - nSrcPos + 1; FXSYS_memcpy(lpDstBuf + nDstPos, lpSrcBuf + nSrcPos, nCopyLen * sizeof(FX_WCHAR)); nDstPos += nCopyLen; nSrcPos += nCopyLen; @@ -1684,24 +1684,24 @@ void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString &wsText) wsTemp.ReleaseBuffer(nLength + nCount); wsText = wsTemp; } else { - FX_INT32 nLength = wsText.GetLength(); + int32_t nLength = wsText.GetLength(); FX_LPWSTR lpBuf = (FX_LPWSTR)(FX_LPCWSTR)wsText; - for (FX_INT32 i = 0; i < nLength; i ++, lpBuf++) { + for (int32_t i = 0; i < nLength; i ++, lpBuf++) { if (*lpBuf == m_wLineEnd) { *lpBuf = wc; } } } } -FX_INT32 CFDE_TxtEdtEngine::MovePage2Char(FX_INT32 nIndex) +int32_t CFDE_TxtEdtEngine::MovePage2Char(int32_t nIndex) { FXSYS_assert(nIndex >= 0); FXSYS_assert(nIndex <= m_pTxtBuf->GetTextLength()); if (m_nCaretPage >= 0) { IFDE_TxtEdtPage* pPage = m_PagePtrArray[m_nCaretPage]; m_Param.pEventSink->On_PageLoad(this, m_nCaretPage, 0); - FX_INT32 nPageCharStart = pPage->GetCharStart(); - FX_INT32 nPageCharCount = pPage->GetCharCount(); + int32_t nPageCharStart = pPage->GetCharStart(); + int32_t nPageCharCount = pPage->GetCharCount(); if (nIndex >= nPageCharStart && nIndex < nPageCharStart + nPageCharCount) { m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0); return m_nCaretPage; @@ -1709,9 +1709,9 @@ FX_INT32 CFDE_TxtEdtEngine::MovePage2Char(FX_INT32 nIndex) m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0); } CFDE_TxtEdtParag * pParag = NULL; - FX_INT32 nLineCount = 0; - FX_INT32 nParagCount = m_ParagPtrArray.GetSize(); - FX_INT32 i = 0; + int32_t nLineCount = 0; + int32_t nParagCount = m_ParagPtrArray.GetSize(); + int32_t i = 0; for (i = 0; i < nParagCount; i ++) { pParag = m_ParagPtrArray[i]; if (pParag->m_nCharStart <= nIndex && nIndex < (pParag->m_nCharStart + pParag->m_nCharCount)) { @@ -1720,8 +1720,8 @@ FX_INT32 CFDE_TxtEdtEngine::MovePage2Char(FX_INT32 nIndex) nLineCount += pParag->m_nLineCount; } pParag->LoadParag(); - FX_INT32 nLineStart = -1; - FX_INT32 nLineCharCount = -1; + int32_t nLineStart = -1; + int32_t nLineCharCount = -1; for (i = 0; i < pParag->m_nLineCount; i ++) { pParag->GetLineRange(i, nLineStart, nLineCharCount); if (nLineStart <= nIndex && nIndex < (nLineStart + nLineCharCount)) { @@ -1735,13 +1735,13 @@ FX_INT32 CFDE_TxtEdtEngine::MovePage2Char(FX_INT32 nIndex) pParag->UnloadParag(); return m_nCaretPage; } -void CFDE_TxtEdtEngine::TextPos2ParagPos(FX_INT32 nIndex, FDE_TXTEDTPARAGPOS &ParagPos) const +void CFDE_TxtEdtEngine::TextPos2ParagPos(int32_t nIndex, FDE_TXTEDTPARAGPOS &ParagPos) const { FXSYS_assert(nIndex >= 0 && nIndex < m_pTxtBuf->GetTextLength()); - FX_INT32 nCount = m_ParagPtrArray.GetSize(); - FX_INT32 nBgn = 0; - FX_INT32 nMid = 0; - FX_INT32 nEnd = nCount - 1; + int32_t nCount = m_ParagPtrArray.GetSize(); + int32_t nBgn = 0; + int32_t nMid = 0; + int32_t nEnd = nCount - 1; while (nEnd > nBgn) { nMid = (nBgn + nEnd) / 2; CFDE_TxtEdtParag * pParag = m_ParagPtrArray[nMid]; @@ -1761,12 +1761,12 @@ void CFDE_TxtEdtEngine::TextPos2ParagPos(FX_INT32 nIndex, FDE_TXTEDTPARAGPOS &Pa ParagPos.nParagIndex = nMid; ParagPos.nCharIndex = nIndex - m_ParagPtrArray[nMid]->m_nCharStart; } -FX_INT32 CFDE_TxtEdtEngine::MoveForward(FX_BOOL &bBefore) +int32_t CFDE_TxtEdtEngine::MoveForward(FX_BOOL &bBefore) { if (m_nCaret == m_pTxtBuf->GetTextLength() - 1) { return -1; } - FX_INT32 nCaret = m_nCaret; + int32_t nCaret = m_nCaret; if ((nCaret + 1 < m_pTxtBuf->GetTextLength()) && (m_pTxtBuf->GetCharByIndex(nCaret) == L'\r') && \ (m_pTxtBuf->GetCharByIndex(nCaret + 1) == L'\n')) { nCaret ++; @@ -1775,12 +1775,12 @@ FX_INT32 CFDE_TxtEdtEngine::MoveForward(FX_BOOL &bBefore) bBefore = TRUE; return nCaret; } -FX_INT32 CFDE_TxtEdtEngine::MoveBackward(FX_BOOL &bBefore) +int32_t CFDE_TxtEdtEngine::MoveBackward(FX_BOOL &bBefore) { if (m_nCaret == 0) { return FALSE; } - FX_INT32 nCaret = m_nCaret; + int32_t nCaret = m_nCaret; if (nCaret > 2 && m_pTxtBuf->GetCharByIndex(nCaret - 1) == L'\n' && \ m_pTxtBuf->GetCharByIndex(nCaret - 2) == L'\r') { nCaret --; @@ -1879,15 +1879,15 @@ FX_BOOL CFDE_TxtEdtEngine::MoveDown(CFX_PointF &ptCaret) } FX_BOOL CFDE_TxtEdtEngine::MoveLineStart() { - FX_INT32 nIndex = m_bBefore ? m_nCaret : m_nCaret - 1; + int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1; FDE_TXTEDTPARAGPOS ParagPos; TextPos2ParagPos(nIndex, ParagPos); CFDE_TxtEdtParag * pParag = m_ParagPtrArray[ParagPos.nParagIndex]; pParag->LoadParag(); - FX_INT32 nLineCount = pParag->m_nLineCount; - FX_INT32 i = 0; - FX_INT32 nStart = 0; - FX_INT32 nCount = 0; + int32_t nLineCount = pParag->m_nLineCount; + int32_t i = 0; + int32_t nStart = 0; + int32_t nCount = 0; for (; i < nLineCount; i ++) { pParag->GetLineRange(i, nStart, nCount); if (nIndex >= nStart && nIndex < nStart + nCount) { @@ -1900,15 +1900,15 @@ FX_BOOL CFDE_TxtEdtEngine::MoveLineStart() } FX_BOOL CFDE_TxtEdtEngine::MoveLineEnd() { - FX_INT32 nIndex = m_bBefore ? m_nCaret : m_nCaret - 1; + int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1; FDE_TXTEDTPARAGPOS ParagPos; TextPos2ParagPos(nIndex, ParagPos); CFDE_TxtEdtParag * pParag = m_ParagPtrArray[ParagPos.nParagIndex]; pParag->LoadParag(); - FX_INT32 nLineCount = pParag->m_nLineCount; - FX_INT32 i = 0; - FX_INT32 nStart = 0; - FX_INT32 nCount = 0; + int32_t nLineCount = pParag->m_nLineCount; + int32_t i = 0; + int32_t nStart = 0; + int32_t nCount = 0; for (; i < nLineCount; i ++) { pParag->GetLineRange(i, nStart, nCount); if (nIndex >= nStart && nIndex < nStart + nCount) { @@ -1937,7 +1937,7 @@ FX_BOOL CFDE_TxtEdtEngine::MoveLineEnd() } FX_BOOL CFDE_TxtEdtEngine::MoveParagStart() { - FX_INT32 nIndex = m_bBefore ? m_nCaret : m_nCaret - 1; + int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1; FDE_TXTEDTPARAGPOS ParagPos; TextPos2ParagPos(nIndex, ParagPos); CFDE_TxtEdtParag * pParag = m_ParagPtrArray[ParagPos.nParagIndex]; @@ -1946,7 +1946,7 @@ FX_BOOL CFDE_TxtEdtEngine::MoveParagStart() } FX_BOOL CFDE_TxtEdtEngine::MoveParagEnd() { - FX_INT32 nIndex = m_bBefore ? m_nCaret : m_nCaret - 1; + int32_t nIndex = m_bBefore ? m_nCaret : m_nCaret - 1; FDE_TXTEDTPARAGPOS ParagPos; TextPos2ParagPos(nIndex, ParagPos); CFDE_TxtEdtParag * pParag = m_ParagPtrArray[ParagPos.nParagIndex]; @@ -1973,14 +1973,14 @@ FX_BOOL CFDE_TxtEdtEngine::MoveEnd() return TRUE; } #ifdef FDE_USEFORMATBLOCK -FX_INT32 CFDE_TxtEdtEngine::NormalizeCaretPos(FX_INT32 nIndex, FX_INT32 nFlags, FX_BOOL &bBefore) +int32_t CFDE_TxtEdtEngine::NormalizeCaretPos(int32_t nIndex, int32_t nFlags, FX_BOOL &bBefore) { bBefore = TRUE; - FX_INT32 nBgn = 0, nEnd = 0; - FX_INT32 nRecord = -1; + int32_t nBgn = 0, nEnd = 0; + int32_t nRecord = -1; CFDE_TxtEdtField * pField = NULL; FX_BOOL bRet = GetFieldBoundary(nIndex, nBgn, nEnd, pField); - FX_INT32 nDelta = 0; + int32_t nDelta = 0; if (bRet && !pField->IsFix()) { if (nIndex - nBgn < FDE_FORMAT_EDIT_FIELD_HADERSIZE) { if (nFlags == FDE_FORMAT_CARET_BACKWARD) { @@ -1991,18 +1991,18 @@ FX_INT32 CFDE_TxtEdtEngine::NormalizeCaretPos(FX_INT32 nIndex, FX_INT32 nFlags, } nIndex = nBgn + FDE_FORMAT_EDIT_FIELD_HADERSIZE; } - FX_INT32 nRet = pField->NormalizeCaretPos(nIndex - nBgn, (FDE_FORMAT_CARET_DIRECTION)nFlags); + int32_t nRet = pField->NormalizeCaretPos(nIndex - nBgn, (FDE_FORMAT_CARET_DIRECTION)nFlags); if (nRet >= 0) { return nRet + nBgn; } if (nRet == -2) { - FX_INT32 nEditablePosBgn = 0, nEditablePosEnd = 0; + int32_t nEditablePosBgn = 0, nEditablePosEnd = 0; pField->GetEditableRange(nEditablePosBgn, nEditablePosEnd); nRecord = nBgn + nEditablePosBgn; nFlags = FDE_FORMAT_CARET_BACKWARD; } else { FXSYS_assert(nRet == -1); - FX_INT32 nEditablePosBgn = 0, nEditablePosEnd = 0; + int32_t nEditablePosBgn = 0, nEditablePosEnd = 0; pField->GetEditableRange(nEditablePosBgn, nEditablePosEnd); nRecord = nBgn + nEditablePosEnd; nFlags = FDE_FORMAT_CARET_FORWARD; @@ -2025,7 +2025,7 @@ FX_INT32 CFDE_TxtEdtEngine::NormalizeCaretPos(FX_INT32 nIndex, FX_INT32 nFlags, } break; case FDE_FORMAT_CARET_MIDDLE: { - FX_INT32 nBgn1 = 0, nEnd1 = 0, nBgn2 = 0, nEnd2 = 0; + int32_t nBgn1 = 0, nEnd1 = 0, nBgn2 = 0, nEnd2 = 0; CFDE_TxtEdtField * pEditableField1 = NULL; CFDE_TxtEdtField * pEditableField2 = NULL; FX_BOOL bRet1 = FindEditableField(nIndex, nBgn1, nEnd1, pEditableField1, FALSE); @@ -2037,7 +2037,7 @@ FX_INT32 CFDE_TxtEdtEngine::NormalizeCaretPos(FX_INT32 nIndex, FX_INT32 nFlags, FXSYS_assert(bRet1); return pEditableField1->NormalizeCaretPos(nEnd1 - nBgn1, FDE_FORMAT_CARET_BACKWARD) + nBgn1; } else { - FX_INT32 nEditablePosBgn = 0, nEditablePosEnd = 0; + int32_t nEditablePosBgn = 0, nEditablePosEnd = 0; if (nIndex - nEnd1 < nBgn2 + nDelta - nIndex) { pEditableField1->GetEditableRange(nEditablePosBgn, nEditablePosEnd); return nEditablePosEnd + nBgn1; @@ -2066,7 +2066,7 @@ FX_INT32 CFDE_TxtEdtEngine::NormalizeCaretPos(FX_INT32 nIndex, FX_INT32 nFlags, return nIndex; } } -FX_BOOL CFDE_TxtEdtEngine::GetFieldBoundary(FX_INT32 nIndex, FX_INT32 &nBgn, FX_INT32 &nEnd, CFDE_TxtEdtField * &pField) +FX_BOOL CFDE_TxtEdtEngine::GetFieldBoundary(int32_t nIndex, int32_t &nBgn, int32_t &nEnd, CFDE_TxtEdtField * &pField) { CFDE_TxtEdtBufIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf, FALSE); pIter->SetAt(nIndex); @@ -2109,7 +2109,7 @@ FX_BOOL CFDE_TxtEdtEngine::GetFieldBoundary(FX_INT32 nIndex, FX_INT32 &nBgn, FX_ pIter->Release(); return FALSE; } -FX_BOOL CFDE_TxtEdtEngine::FindEditableField(FX_INT32 nIndex, FX_INT32 &nBgn, FX_INT32 &nEnd, CFDE_TxtEdtField * &pField, FX_BOOL bForward ) +FX_BOOL CFDE_TxtEdtEngine::FindEditableField(int32_t nIndex, int32_t &nBgn, int32_t &nEnd, CFDE_TxtEdtField * &pField, FX_BOOL bForward ) { FX_WCHAR wcFirst = FDE_TXTEDT_FORMATBLOCK_BGN; FX_WCHAR wcSecond = FDE_TXTEDT_FORMATBLOCK_END; @@ -2119,7 +2119,7 @@ FX_BOOL CFDE_TxtEdtEngine::FindEditableField(FX_INT32 nIndex, FX_INT32 &nBgn, FX } CFDE_TxtEdtBufIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf, FALSE); pIter->SetAt(nIndex); - FX_INT32 bFind = FALSE; + int32_t bFind = FALSE; do { FX_WCHAR wc = pIter->GetChar(); if (wc == wcFirst) { @@ -2143,7 +2143,7 @@ FX_BOOL CFDE_TxtEdtEngine::FindEditableField(FX_INT32 nIndex, FX_INT32 &nBgn, FX } while (pIter->Next(!bForward)); FXSYS_assert(bFind); if (!bForward) { - FX_INT32 nTemp = nBgn; + int32_t nTemp = nBgn; nBgn = nEnd; nEnd = nTemp; } @@ -2158,24 +2158,24 @@ FX_BOOL CFDE_TxtEdtEngine::FindEditableField(FX_INT32 nIndex, FX_INT32 &nBgn, FX } return FindEditableField((bForward ? nEnd : nBgn), nBgn, nEnd, pField, bForward); } -FX_BOOL CFDE_TxtEdtEngine::Move2NextEditableField(FX_INT32 nIndex, FX_BOOL bForward , FX_BOOL bSelect ) +FX_BOOL CFDE_TxtEdtEngine::Move2NextEditableField(int32_t nIndex, FX_BOOL bForward , FX_BOOL bSelect ) { if (m_SelRangePtrArr.GetSize() > 0) { ClearSelection(); m_Param.pEventSink->On_SelChanged(this); } - FX_INT32 nBgn = 0, nEnd = 0; + int32_t nBgn = 0, nEnd = 0; CFDE_TxtEdtField * pField = NULL; FX_BOOL bRet = FindEditableField(nIndex, nBgn, nEnd, pField, bForward); if (!bRet) { return FALSE; } - FX_INT32 nEditableBgn = 0, nEditableEnd = 0; + int32_t nEditableBgn = 0, nEditableEnd = 0; pField->GetEditableRange(nEditableBgn, nEditableEnd); nEditableBgn += nBgn; nEditableEnd += nBgn; if (bSelect) { - FX_INT32 nRangeCount = nEditableEnd - nEditableBgn; + int32_t nRangeCount = nEditableEnd - nEditableBgn; if (nRangeCount > 0) { AddSelRange(nEditableBgn, nEditableEnd - nEditableBgn); } @@ -2183,14 +2183,14 @@ FX_BOOL CFDE_TxtEdtEngine::Move2NextEditableField(FX_INT32 nIndex, FX_BOOL bForw SetCaretPos(nEditableEnd, TRUE); return TRUE; } -FX_INT32 CFDE_TxtEdtEngine::GetRealIndex(FX_INT32 nIndex) const +int32_t CFDE_TxtEdtEngine::GetRealIndex(int32_t nIndex) const { CFDE_TxtEdtBufIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)m_pTxtBuf, FALSE); pIter->SetAt(0); FX_BOOL bInField = FALSE; - FX_INT32 nFieldBgn = 0; - FX_INT32 nRealIndex = 0; - for (FX_INT32 i = 0; i <= nIndex; i ++) { + int32_t nFieldBgn = 0; + int32_t nRealIndex = 0; + for (int32_t i = 0; i <= nIndex; i ++) { FX_WCHAR wc = pIter->GetChar(); if (bInField) { if (wc == FDE_TXTEDT_FORMATBLOCK_END) { @@ -2221,7 +2221,7 @@ FX_INT32 CFDE_TxtEdtEngine::GetRealIndex(FX_INT32 nIndex) const CFDE_TxtEdtField * pField = (CFDE_TxtEdtField *)((dwCur << 16) | dwPre); pIter->Release(); if (pField->IsFix()) { - FX_INT32 nDelta = nIndex - nFieldBgn - FDE_FORMAT_EDIT_FIELD_HADERSIZE + 1; + int32_t nDelta = nIndex - nFieldBgn - FDE_FORMAT_EDIT_FIELD_HADERSIZE + 1; return nRealIndex + (nDelta > 0 ? nDelta : 0); } else { return nRealIndex + pField->GetRealIndex(nIndex - nFieldBgn); @@ -2260,7 +2260,7 @@ FX_BOOL CFDE_TxtEdtEngine::IsFitArea(CFX_WideString &wsText) } return TRUE; } -void CFDE_TxtEdtEngine::UpdateCaretRect(FX_INT32 nIndex, FX_BOOL bBefore) +void CFDE_TxtEdtEngine::UpdateCaretRect(int32_t nIndex, FX_BOOL bBefore) { MovePage2Char(nIndex); GetCaretRect(m_rtCaret, m_nCaretPage, nIndex, bBefore); @@ -2274,17 +2274,17 @@ void CFDE_TxtEdtEngine::UpdateCaretRect(FX_INT32 nIndex, FX_BOOL bBefore) m_rtCaret.top : m_rtCaret.left; m_Param.pEventSink->On_CaretChanged(this, m_nCaretPage, 0); } -void CFDE_TxtEdtEngine::GetCaretRect(CFX_RectF &rtCaret, FX_INT32 nPageIndex, FX_INT32 nCaret, FX_BOOL bBefore ) +void CFDE_TxtEdtEngine::GetCaretRect(CFX_RectF &rtCaret, int32_t nPageIndex, int32_t nCaret, FX_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; - FX_INT32 nIndexInpage = nCaret - pPage->GetCharStart(); + int32_t nIndexInpage = nCaret - pPage->GetCharStart(); if (bBefore && bCombText && nIndexInpage > 0) { nIndexInpage--; bBefore = FALSE; } - FX_INT32 nBIDILevel = pPage->GetCharRect(nIndexInpage, rtCaret, bCombText); + int32_t nBIDILevel = pPage->GetCharRect(nIndexInpage, rtCaret, bCombText); if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical) { if ((!FX_IsOdd(nBIDILevel) && !bBefore) || (FX_IsOdd(nBIDILevel) && bBefore)) { rtCaret.Offset(0, rtCaret.height - 1.0f); @@ -2323,31 +2323,31 @@ FX_BOOL CFDE_TxtEdtEngine::IsSelect() } void CFDE_TxtEdtEngine::DeleteSelect() { - FX_INT32 nCountRange = CountSelRanges(); + int32_t nCountRange = CountSelRanges(); if (nCountRange > 0) { #ifdef FDE_USEFORMATBLOCK - FX_INT32 nBlockCount = m_BlockArray.GetSize(); + int32_t nBlockCount = m_BlockArray.GetSize(); if (nBlockCount > 0) { if (nCountRange > 1) { return; } - FX_INT32 nSelStart; - FX_INT32 nSelCount; + int32_t nSelStart; + int32_t nSelCount; nSelCount = GetSelRange(0, nSelStart); - FX_INT32 nSelEnd = nSelStart + nSelCount; - FX_INT32 nBgn = 0; - FX_INT32 nEnd = 0; + int32_t nSelEnd = nSelStart + nSelCount; + int32_t nBgn = 0; + int32_t nEnd = 0; CFDE_TxtEdtField * pField = NULL; FX_BOOL bInField = GetFieldBoundary(nSelStart, nBgn, nEnd, pField); - FX_INT32 nCaretInField = nSelStart - nBgn; + int32_t nCaretInField = nSelStart - nBgn; FX_BOOL bBefore = FALSE; if (!bInField || pField->IsFix() || nSelEnd > nEnd) { return; } pField->Backup(); CFX_WideString wsDel; - FX_INT32 nCaret = 0; - FX_INT32 nRet = pField->Delete(nCaretInField, nSelCount, wsDel, nCaret, bBefore); + int32_t nCaret = 0; + int32_t nRet = pField->Delete(nCaretInField, nSelCount, wsDel, nCaret, bBefore); nCaret += nBgn; switch (nRet) { case FDE_FORMAT_FIELD_DELETE_RET_S: @@ -2380,8 +2380,8 @@ void CFDE_TxtEdtEngine::DeleteSelect() return; } #endif - FX_INT32 nSelStart; - FX_INT32 nSelCount; + int32_t nSelStart; + int32_t nSelCount; while (nCountRange > 0) { nSelCount = GetSelRange(--nCountRange, nSelStart); FDE_LPTXTEDTSELRANGE lpTemp = m_SelRangePtrArr[nCountRange]; @@ -2399,7 +2399,7 @@ void CFDE_TxtEdtEngine::DeleteSelect() IFDE_TxtEdtDoRecord * IFDE_TxtEdtDoRecord::Create(FX_BSTR bsDoRecord) { FX_LPCSTR lpBuf = bsDoRecord.GetCStr(); - FX_INT32 nType = *((FX_INT32*)lpBuf); + int32_t nType = *((int32_t*)lpBuf); switch(nType) { case FDE_TXTEDT_DORECORD_INS: return FX_NEW CFDE_TxtEdtDoRecord_Insert(bsDoRecord); @@ -2423,9 +2423,9 @@ CFDE_TxtEdtDoRecord_Insert::CFDE_TxtEdtDoRecord_Insert(FX_BSTR bsDoRecord) Deserialize(bsDoRecord); } CFDE_TxtEdtDoRecord_Insert::CFDE_TxtEdtDoRecord_Insert(CFDE_TxtEdtEngine * pEngine, - FX_INT32 nCaret, + int32_t nCaret, FX_LPCWSTR lpText, - FX_INT32 nLength) + int32_t nLength) : m_pEngine(pEngine) , m_nCaret(nCaret) { @@ -2467,11 +2467,11 @@ FX_BOOL CFDE_TxtEdtDoRecord_Insert::Redo() void CFDE_TxtEdtDoRecord_Insert::Serialize(CFX_ByteString &bsDoRecord) const { CFX_ArchiveSaver ArchiveSaver; - ArchiveSaver << FX_INT32(FDE_TXTEDT_DORECORD_INS); - ArchiveSaver << (FX_INT32)(FX_UINTPTR)m_pEngine; + ArchiveSaver << int32_t(FDE_TXTEDT_DORECORD_INS); + ArchiveSaver << (int32_t)(uintptr_t)m_pEngine; ArchiveSaver << m_nCaret; ArchiveSaver << m_wsInsert; - FX_INT32 nLength = ArchiveSaver.GetLength(); + int32_t nLength = ArchiveSaver.GetLength(); FX_LPCBYTE lpSrcBuf = ArchiveSaver.GetBuffer(); FX_LPSTR lpDstBuf = bsDoRecord.GetBuffer(nLength); FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength); @@ -2480,12 +2480,12 @@ void CFDE_TxtEdtDoRecord_Insert::Serialize(CFX_ByteString &bsDoRecord) const void CFDE_TxtEdtDoRecord_Insert::Deserialize(FX_BSTR bsDoRecord) { CFX_ArchiveLoader ArchiveLoader((FX_LPCBYTE)bsDoRecord.GetCStr(), bsDoRecord.GetLength()); - FX_INT32 nType = 0; + int32_t nType = 0; ArchiveLoader >> nType; FXSYS_assert(nType == FDE_TXTEDT_DORECORD_INS); - FX_INT32 nEngine = 0; + int32_t nEngine = 0; ArchiveLoader >> nEngine; - m_pEngine = (CFDE_TxtEdtEngine*)(FX_UINTPTR)nEngine; + m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine; ArchiveLoader >> m_nCaret; ArchiveLoader >> m_wsInsert; } @@ -2494,8 +2494,8 @@ CFDE_TxtEdtDoRecord_DeleteRange::CFDE_TxtEdtDoRecord_DeleteRange(FX_BSTR bsDoRec Deserialize(bsDoRecord); } CFDE_TxtEdtDoRecord_DeleteRange::CFDE_TxtEdtDoRecord_DeleteRange(CFDE_TxtEdtEngine * pEngine, - FX_INT32 nIndex, - FX_INT32 nCaret, + int32_t nIndex, + int32_t nCaret, const CFX_WideString &wsRange, FX_BOOL bSel) : m_pEngine(pEngine) @@ -2545,13 +2545,13 @@ FX_BOOL CFDE_TxtEdtDoRecord_DeleteRange::Redo() void CFDE_TxtEdtDoRecord_DeleteRange::Serialize(CFX_ByteString &bsDoRecord) const { CFX_ArchiveSaver ArchiveSaver; - ArchiveSaver << FX_INT32(FDE_TXTEDT_DORECORD_DEL); - ArchiveSaver << (FX_INT32)(FX_UINTPTR)m_pEngine; + ArchiveSaver << int32_t(FDE_TXTEDT_DORECORD_DEL); + ArchiveSaver << (int32_t)(uintptr_t)m_pEngine; ArchiveSaver << m_bSel; ArchiveSaver << m_nIndex; ArchiveSaver << m_nCaret; ArchiveSaver << m_wsRange; - FX_INT32 nLength = ArchiveSaver.GetLength(); + int32_t nLength = ArchiveSaver.GetLength(); FX_LPCBYTE lpSrcBuf = ArchiveSaver.GetBuffer(); FX_LPSTR lpDstBuf = bsDoRecord.GetBuffer(nLength); FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength); @@ -2560,12 +2560,12 @@ void CFDE_TxtEdtDoRecord_DeleteRange::Serialize(CFX_ByteString &bsDoRecord) cons void CFDE_TxtEdtDoRecord_DeleteRange::Deserialize(FX_BSTR bsDoRecord) { CFX_ArchiveLoader ArchiveLoader((FX_LPCBYTE)bsDoRecord.GetCStr(), bsDoRecord.GetLength()); - FX_INT32 nType = 0; + int32_t nType = 0; ArchiveLoader >> nType; FXSYS_assert(nType == FDE_TXTEDT_DORECORD_DEL); - FX_INT32 nEngine = 0; + int32_t nEngine = 0; ArchiveLoader >> nEngine; - m_pEngine = (CFDE_TxtEdtEngine*)(FX_UINTPTR)nEngine; + m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine; ArchiveLoader >> m_bSel; ArchiveLoader >> m_nIndex; ArchiveLoader >> m_nCaret; @@ -2577,12 +2577,12 @@ CFDE_TxtEdtDoRecord_FieldInsert::CFDE_TxtEdtDoRecord_FieldInsert(FX_BSTR bsDoRec Deserialize(bsDoRecord); } CFDE_TxtEdtDoRecord_FieldInsert::CFDE_TxtEdtDoRecord_FieldInsert(CFDE_TxtEdtEngine * pEngine, - FX_INT32 nCaret, + int32_t nCaret, CFDE_TxtEdtField * pField, - FX_INT32 nIndexInField, - FX_INT32 nFieldBgn, - FX_INT32 nOldFieldLength, - FX_INT32 nNewFieldLength, + int32_t nIndexInField, + int32_t nFieldBgn, + int32_t nOldFieldLength, + int32_t nNewFieldLength, const CFX_WideString &wsIns, FX_BOOL bSel ) : m_pEngine(pEngine) @@ -2608,9 +2608,9 @@ void CFDE_TxtEdtDoRecord_FieldInsert::Release() FX_BOOL CFDE_TxtEdtDoRecord_FieldInsert::Undo() { CFX_WideString wsDel; - FX_INT32 nCaret = 0; + int32_t nCaret = 0; FX_BOOL bBefore = FALSE; - FX_INT32 nRet = m_pField->Delete(m_nIndexInField, m_wsIns.GetLength(), wsDel, nCaret, bBefore); + int32_t nRet = m_pField->Delete(m_nIndexInField, m_wsIns.GetLength(), wsDel, nCaret, bBefore); FXSYS_assert(nRet != FDE_FORMAT_FIELD_DELETE_RET_F_INVALIDATE && nRet != FDE_FORMAT_FIELD_DELETE_RET_F_BOUNDARY); CFX_WideString wsDisplay; m_pField->GetDisplayText(wsDisplay); @@ -2620,9 +2620,9 @@ FX_BOOL CFDE_TxtEdtDoRecord_FieldInsert::Undo() } FX_BOOL CFDE_TxtEdtDoRecord_FieldInsert::Redo() { - FX_INT32 nCaret = 0; + int32_t nCaret = 0; FX_BOOL bBefore = FALSE; - FX_INT32 nRet = m_pField->Insert(m_nIndexInField, m_wsIns, nCaret, bBefore); + int32_t nRet = m_pField->Insert(m_nIndexInField, m_wsIns, nCaret, bBefore); FXSYS_assert(nRet != FDE_FORMAT_FIELD_INSERT_RET_F_FULL && nRet != FDE_FORMAT_FIELD_INSERT_RET_F_INVALIDATE); CFX_WideString wsDisplay; m_pField->GetDisplayText(wsDisplay); @@ -2633,17 +2633,17 @@ FX_BOOL CFDE_TxtEdtDoRecord_FieldInsert::Redo() void CFDE_TxtEdtDoRecord_FieldInsert::Serialize(CFX_ByteString &bsDoRecord) const { CFX_ArchiveSaver ArchiveSaver; - ArchiveSaver << FX_INT32(FDE_TXTEDT_DORECORD_FORMATINS); - ArchiveSaver << FX_INT32(m_pEngine); + ArchiveSaver << int32_t(FDE_TXTEDT_DORECORD_FORMATINS); + ArchiveSaver << int32_t(m_pEngine); ArchiveSaver << m_nCaret; - ArchiveSaver << FX_INT32(m_pField); + ArchiveSaver << int32_t(m_pField); ArchiveSaver << m_nIndexInField; ArchiveSaver << m_nFieldBgn; ArchiveSaver << m_nOldFieldLength; ArchiveSaver << m_nNewFieldLength; ArchiveSaver << m_wsIns; ArchiveSaver << m_bSel; - FX_INT32 nLength = ArchiveSaver.GetLength(); + int32_t nLength = ArchiveSaver.GetLength(); FX_LPCBYTE lpSrcBuf = ArchiveSaver.GetBuffer(); FX_LPSTR lpDstBuf = bsDoRecord.GetBuffer(nLength); FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength); @@ -2652,14 +2652,14 @@ void CFDE_TxtEdtDoRecord_FieldInsert::Serialize(CFX_ByteString &bsDoRecord) cons void CFDE_TxtEdtDoRecord_FieldInsert::Deserialize(FX_BSTR bsDoRecord) { CFX_ArchiveLoader ArchiveLoader((FX_LPCBYTE)bsDoRecord.GetCStr(), bsDoRecord.GetLength()); - FX_INT32 nType = 0; + int32_t nType = 0; ArchiveLoader >> nType; FXSYS_assert(nType == FDE_TXTEDT_DORECORD_FORMATINS); - FX_INT32 nEngine = 0; + int32_t nEngine = 0; ArchiveLoader >> nEngine; - m_pEngine = (CFDE_TxtEdtEngine*)(FX_UINTPTR)nEngine; + m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine; ArchiveLoader >> m_nCaret; - FX_INT32 nField = 0; + int32_t nField = 0; ArchiveLoader >> nField; m_pField = (CFDE_TxtEdtField*)nField; ArchiveLoader >> m_nIndexInField; @@ -2674,12 +2674,12 @@ CFDE_TxtEdtDoRecord_FieldDelete::CFDE_TxtEdtDoRecord_FieldDelete(FX_BSTR bsDoRec Deserialize(bsDoRecord); } CFDE_TxtEdtDoRecord_FieldDelete::CFDE_TxtEdtDoRecord_FieldDelete(CFDE_TxtEdtEngine * pEngine, - FX_INT32 nCaret, + int32_t nCaret, CFDE_TxtEdtField * pField, - FX_INT32 nIndexInField, - FX_INT32 nFieldBgn, - FX_INT32 nOldLength, - FX_INT32 nNewLength, + int32_t nIndexInField, + int32_t nFieldBgn, + int32_t nOldLength, + int32_t nNewLength, const CFX_WideString &wsDel, FX_BOOL bSel ) : m_pEngine(pEngine) @@ -2704,9 +2704,9 @@ void CFDE_TxtEdtDoRecord_FieldDelete::Release() } FX_BOOL CFDE_TxtEdtDoRecord_FieldDelete::Undo() { - FX_INT32 nCaret = 0; + int32_t nCaret = 0; FX_BOOL bBefore = FALSE; - FX_INT32 nRet = m_pField->Insert(m_nIndexInField, m_wsDel, nCaret, bBefore); + int32_t nRet = m_pField->Insert(m_nIndexInField, m_wsDel, nCaret, bBefore); FXSYS_assert(nRet != FDE_FORMAT_FIELD_INSERT_RET_F_FULL && nRet != FDE_FORMAT_FIELD_INSERT_RET_F_INVALIDATE); CFX_WideString wsDisplay; m_pField->GetDisplayText(wsDisplay); @@ -2716,10 +2716,10 @@ FX_BOOL CFDE_TxtEdtDoRecord_FieldDelete::Undo() } FX_BOOL CFDE_TxtEdtDoRecord_FieldDelete::Redo() { - FX_INT32 nCaret = 0; + int32_t nCaret = 0; FX_BOOL bBefore = 0; CFX_WideString wsDel; - FX_INT32 nRet = m_pField->Delete(m_nIndexInField, m_wsDel.GetLength(), wsDel, nCaret, bBefore); + int32_t nRet = m_pField->Delete(m_nIndexInField, m_wsDel.GetLength(), wsDel, nCaret, bBefore); FXSYS_assert(nRet != FDE_FORMAT_FIELD_DELETE_RET_F_INVALIDATE && nRet != FDE_FORMAT_FIELD_DELETE_RET_F_BOUNDARY); CFX_WideString wsDisplay; m_pField->GetDisplayText(wsDisplay); @@ -2730,17 +2730,17 @@ FX_BOOL CFDE_TxtEdtDoRecord_FieldDelete::Redo() void CFDE_TxtEdtDoRecord_FieldDelete::Serialize(CFX_ByteString &bsDoRecord) const { CFX_ArchiveSaver ArchiveSaver; - ArchiveSaver << FX_INT32(FDE_TXTEDT_DORECORD_FORMATDEL); - ArchiveSaver << FX_INT32(m_pEngine); + ArchiveSaver << int32_t(FDE_TXTEDT_DORECORD_FORMATDEL); + ArchiveSaver << int32_t(m_pEngine); ArchiveSaver << m_nCaret; - ArchiveSaver << FX_INT32(m_pField); + ArchiveSaver << int32_t(m_pField); ArchiveSaver << m_nIndexInField; ArchiveSaver << m_nFieldBgn; ArchiveSaver << m_nOldFieldLength; ArchiveSaver << m_nNewFieldLength; ArchiveSaver << m_wsDel; ArchiveSaver << m_bSel; - FX_INT32 nLength = ArchiveSaver.GetLength(); + int32_t nLength = ArchiveSaver.GetLength(); FX_LPCBYTE lpSrcBuf = ArchiveSaver.GetBuffer(); FX_LPSTR lpDstBuf = bsDoRecord.GetBuffer(nLength); FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength); @@ -2749,14 +2749,14 @@ void CFDE_TxtEdtDoRecord_FieldDelete::Serialize(CFX_ByteString &bsDoRecord) cons void CFDE_TxtEdtDoRecord_FieldDelete::Deserialize(FX_BSTR bsDoRecord) { CFX_ArchiveLoader ArchiveLoader((FX_LPCBYTE)bsDoRecord.GetCStr(), bsDoRecord.GetLength()); - FX_INT32 nType = 0; + int32_t nType = 0; ArchiveLoader >> nType; FXSYS_assert(nType == FDE_TXTEDT_DORECORD_FORMATDEL); - FX_INT32 nEngine = 0; + int32_t nEngine = 0; ArchiveLoader >> nEngine; - m_pEngine = (CFDE_TxtEdtEngine*)(FX_UINTPTR)nEngine; + m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine; ArchiveLoader >> m_nCaret; - FX_INT32 nField = 0; + int32_t nField = 0; ArchiveLoader >> nField; m_pField = (CFDE_TxtEdtField*)nField; ArchiveLoader >> m_nIndexInField; @@ -2771,12 +2771,12 @@ CFDE_TxtEdtDoRecord_FieldReplace::CFDE_TxtEdtDoRecord_FieldReplace(FX_BSTR bsDoR Deserialize(bsDoRecord); } CFDE_TxtEdtDoRecord_FieldReplace::CFDE_TxtEdtDoRecord_FieldReplace( CFDE_TxtEdtEngine * pEngine, - FX_INT32 nCaret, - FX_INT32 nNewCaret, + int32_t nCaret, + int32_t nNewCaret, CFDE_TxtEdtField * pField, - FX_INT32 nIndexInField, - FX_INT32 nFieldBgn, - FX_INT32 nFieldNewLength, + int32_t nIndexInField, + int32_t nFieldBgn, + int32_t nFieldNewLength, const CFX_WideString &wsDel, const CFX_WideString &wsIns, FX_BOOL bSel) @@ -2804,9 +2804,9 @@ void CFDE_TxtEdtDoRecord_FieldReplace::Release() FX_BOOL CFDE_TxtEdtDoRecord_FieldReplace::Undo() { CFX_WideString wsDel; - FX_INT32 nCaret = 0; + int32_t nCaret = 0; FX_BOOL bBefore = FALSE; - FX_INT32 nRet = m_pField->Replace(m_nIndexInField, m_wsIns.GetLength(), m_wsDel, wsDel, nCaret, bBefore); + int32_t nRet = m_pField->Replace(m_nIndexInField, m_wsIns.GetLength(), m_wsDel, wsDel, nCaret, bBefore); FXSYS_assert(nRet != FDE_FORMAT_FIELD_DELETE_RET_F_INVALIDATE && nRet != FDE_FORMAT_FIELD_DELETE_RET_F_BOUNDARY); CFX_WideString wsDisplay; m_pField->GetDisplayText(wsDisplay); @@ -2817,9 +2817,9 @@ FX_BOOL CFDE_TxtEdtDoRecord_FieldReplace::Undo() FX_BOOL CFDE_TxtEdtDoRecord_FieldReplace::Redo() { CFX_WideString wsDel; - FX_INT32 nCaret = 0; + int32_t nCaret = 0; FX_BOOL bBefore = FALSE; - FX_INT32 nRet = m_pField->Replace(m_nIndexInField, m_wsDel.GetLength(), m_wsIns, wsDel, nCaret, bBefore); + int32_t nRet = m_pField->Replace(m_nIndexInField, m_wsDel.GetLength(), m_wsIns, wsDel, nCaret, bBefore); FXSYS_assert(nRet != FDE_FORMAT_FIELD_DELETE_RET_F_INVALIDATE && nRet != FDE_FORMAT_FIELD_DELETE_RET_F_BOUNDARY); CFX_WideString wsDisplay; m_pField->GetDisplayText(wsDisplay); @@ -2830,18 +2830,18 @@ FX_BOOL CFDE_TxtEdtDoRecord_FieldReplace::Redo() void CFDE_TxtEdtDoRecord_FieldReplace::Serialize(CFX_ByteString &bsDoRecord) const { CFX_ArchiveSaver ArchiveSaver; - ArchiveSaver << FX_INT32(FDE_TXTEDT_DORECORD_FORMATREP); - ArchiveSaver << FX_INT32(m_pEngine); + ArchiveSaver << int32_t(FDE_TXTEDT_DORECORD_FORMATREP); + ArchiveSaver << int32_t(m_pEngine); ArchiveSaver << m_nCaret; ArchiveSaver << m_nNewCaret; - ArchiveSaver << FX_INT32(m_pField); + ArchiveSaver << int32_t(m_pField); ArchiveSaver << m_nIndexInField; ArchiveSaver << m_nFieldBgn; ArchiveSaver << m_nFieldNewLength; ArchiveSaver << m_wsDel; ArchiveSaver << m_wsIns; ArchiveSaver << m_bSel; - FX_INT32 nLength = ArchiveSaver.GetLength(); + int32_t nLength = ArchiveSaver.GetLength(); FX_LPCBYTE lpSrcBuf = ArchiveSaver.GetBuffer(); FX_LPSTR lpDstBuf = bsDoRecord.GetBuffer(nLength); FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength); @@ -2850,15 +2850,15 @@ void CFDE_TxtEdtDoRecord_FieldReplace::Serialize(CFX_ByteString &bsDoRecord) con void CFDE_TxtEdtDoRecord_FieldReplace::Deserialize(FX_BSTR bsDoRecord) { CFX_ArchiveLoader ArchiveLoader((FX_LPCBYTE)bsDoRecord.GetCStr(), bsDoRecord.GetLength()); - FX_INT32 nType = 0; + int32_t nType = 0; ArchiveLoader >> nType; FXSYS_assert(nType == FDE_TXTEDT_DORECORD_FORMATREP); - FX_INT32 nEngine = 0; + int32_t nEngine = 0; ArchiveLoader >> nEngine; - m_pEngine = (CFDE_TxtEdtEngine*)(FX_UINTPTR)nEngine; + m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine; ArchiveLoader >> m_nCaret; ArchiveLoader >> m_nNewCaret; - FX_INT32 nField = 0; + int32_t nField = 0; ArchiveLoader >> nField; m_pField = (CFDE_TxtEdtField*)nField; ArchiveLoader >> m_nIndexInField; diff --git a/xfa/src/fee/src/fee/fde_txtedtengine.h b/xfa/src/fee/src/fee/fde_txtedtengine.h index dec152c630..43a98fa7db 100644 --- a/xfa/src/fee/src/fee/fde_txtedtengine.h +++ b/xfa/src/fee/src/fee/fde_txtedtengine.h @@ -47,14 +47,14 @@ class CFDE_TxtEdtEngine : public IFDE_TxtEdtEngine friend class CFDE_TxtEdtBlock; #endif struct _FDE_TXTEDTSELRANGE { - FX_INT32 nStart; - FX_INT32 nCount; + int32_t nStart; + int32_t nCount; }; typedef _FDE_TXTEDTSELRANGE FDE_TXTEDTSELRANGE; typedef _FDE_TXTEDTSELRANGE * FDE_LPTXTEDTSELRANGE; struct _FDE_TXTEDTPARAGPOS { - FX_INT32 nParagIndex; - FX_INT32 nCharIndex; + int32_t nParagIndex; + int32_t nCharIndex; }; typedef _FDE_TXTEDTPARAGPOS FDE_TXTEDTPARAGPOS; typedef _FDE_TXTEDTPARAGPOS * FDE_LPTXTEDTPARAGPOS; @@ -65,65 +65,65 @@ public: virtual void SetEditParams(const FDE_TXTEDTPARAMS ¶ms); virtual const FDE_TXTEDTPARAMS* GetEditParams() const; - virtual FX_INT32 CountPages() const; - virtual IFDE_TxtEdtPage* GetPage(FX_INT32 nIndex); + virtual int32_t CountPages() const; + virtual IFDE_TxtEdtPage* GetPage(int32_t nIndex); - virtual FX_BOOL SetBufChunkSize(FX_INT32 nChunkSize); + virtual FX_BOOL SetBufChunkSize(int32_t nChunkSize); virtual void SetTextByStream(IFX_Stream *pStream); virtual void SetText(const CFX_WideString &wsText); - virtual FX_INT32 GetTextLength() const; - virtual void GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount = -1); + virtual int32_t GetTextLength() const; + virtual void GetText(CFX_WideString &wsText, int32_t nStart, int32_t nCount = -1); virtual void ClearText(); - virtual FX_INT32 GetCaretRect(CFX_RectF &rtCaret) const; - virtual FX_INT32 GetCaretPos() const; - virtual FX_INT32 SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore); - virtual FX_INT32 MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, FX_BOOL bShift = FALSE, FX_BOOL bCtrl = FALSE); + virtual int32_t GetCaretRect(CFX_RectF &rtCaret) const; + virtual int32_t GetCaretPos() const; + virtual int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore); + virtual int32_t MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, FX_BOOL bShift = FALSE, FX_BOOL bCtrl = FALSE); virtual void Lock(); virtual void Unlock(); virtual FX_BOOL IsLocked() const; - virtual FX_INT32 Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength); - virtual FX_INT32 Delete(FX_INT32 nStart, FX_BOOL bBackspace = FALSE); - virtual FX_INT32 DeleteRange(FX_INT32 nStart, FX_INT32 nCount = -1); - virtual FX_INT32 Replace(FX_INT32 nStart, FX_INT32 nLength, const CFX_WideString &wsReplace); + virtual int32_t Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength); + virtual int32_t Delete(int32_t nStart, FX_BOOL bBackspace = FALSE); + virtual int32_t DeleteRange(int32_t nStart, int32_t nCount = -1); + virtual int32_t Replace(int32_t nStart, int32_t nLength, const CFX_WideString &wsReplace); - virtual void SetLimit(FX_INT32 nLimit); + virtual void SetLimit(int32_t nLimit); virtual void SetAliasChar(FX_WCHAR wcAlias); - virtual void SetFormatBlock(FX_INT32 nIndex, const CFX_WideString &wsBlockFormat); - virtual FX_INT32 CountEditBlocks() const; - virtual void GetEditBlockText(FX_INT32 nIndex, CFX_WideString &wsBlockText) const; - virtual FX_INT32 CountEditFields(FX_INT32 nBlockIndex) const; - virtual void GetEditFieldText(FX_INT32 nBlockIndex, FX_INT32 nFieldIndex, CFX_WideString &wsFieldText) const; + virtual void SetFormatBlock(int32_t nIndex, const CFX_WideString &wsBlockFormat); + virtual int32_t CountEditBlocks() const; + virtual void GetEditBlockText(int32_t nIndex, CFX_WideString &wsBlockText) const; + virtual int32_t CountEditFields(int32_t nBlockIndex) const; + virtual void GetEditFieldText(int32_t nBlockIndex, int32_t nFieldIndex, CFX_WideString &wsFieldText) const; virtual void StartEdit(); virtual void EndEdit(); - void RemoveSelRange(FX_INT32 nStart, FX_INT32 nCount = -1); + void RemoveSelRange(int32_t nStart, int32_t nCount = -1); - virtual void AddSelRange(FX_INT32 nStart, FX_INT32 nCount = -1); - virtual FX_INT32 CountSelRanges(); - virtual FX_INT32 GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart); + virtual void AddSelRange(int32_t nStart, int32_t nCount = -1); + virtual int32_t CountSelRanges(); + virtual int32_t GetSelRange(int32_t nIndex, int32_t &nStart); virtual void ClearSelection(); virtual FX_BOOL Redo(FX_BSTR bsRedo); virtual FX_BOOL Undo(FX_BSTR bsUndo); - virtual FX_INT32 StartLayout(); - virtual FX_INT32 DoLayout(IFX_Pause *pPause); + virtual int32_t StartLayout(); + virtual int32_t DoLayout(IFX_Pause *pPause); virtual void EndLayout(); virtual FX_BOOL Optimize(IFX_Pause * pPause = NULL); - virtual FX_INT32 CountParags() const; - virtual IFDE_TxtEdtParag* GetParag(FX_INT32 nParagIndex) const; + virtual int32_t CountParags() const; + virtual IFDE_TxtEdtParag* GetParag(int32_t nParagIndex) const; virtual IFX_CharIter* CreateCharIter(); IFDE_TxtEdtBuf* GetTextBuf() const; - FX_INT32 GetTextBufLength() const; + int32_t GetTextBufLength() const; IFX_TxtBreak* GetTextBreak() const; - FX_INT32 GetLineCount() const; - FX_INT32 GetPageLineCount() const; + int32_t GetLineCount() const; + int32_t GetPageLineCount() const; - FX_INT32 Line2Parag(FX_INT32 nStartParag, FX_INT32 nStartLineofParag, - FX_INT32 nLineIndex, FX_INT32 &nStartLine) const; + int32_t Line2Parag(int32_t nStartParag, int32_t nStartLineofParag, + int32_t nLineIndex, int32_t &nStartLine) const; FX_WCHAR GetAliasChar() const { return m_wcAliasChar; @@ -132,16 +132,16 @@ public: protected: virtual ~CFDE_TxtEdtEngine(); private: - void Inner_Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength); + void Inner_Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength); #ifdef FDE_USEFORMATBLOCK - void RawInsert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLength); + void RawInsert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLength); #endif - void GetPreDeleteText(CFX_WideString &wsText, FX_INT32 nIndex, FX_INT32 nLength); - void GetPreInsertText(CFX_WideString &wsText, FX_INT32 nIndex, FX_LPCWSTR lpText, FX_INT32 nLength); - void GetPreReplaceText(CFX_WideString &wsText, FX_INT32 nIndex, FX_INT32 nOriginLength, FX_LPCWSTR lpText, FX_INT32 nLength); + void GetPreDeleteText(CFX_WideString &wsText, int32_t nIndex, int32_t nLength); + void GetPreInsertText(CFX_WideString &wsText, int32_t nIndex, FX_LPCWSTR lpText, int32_t nLength); + void GetPreReplaceText(CFX_WideString &wsText, int32_t nIndex, int32_t nOriginLength, FX_LPCWSTR lpText, int32_t nLength); - void Inner_DeleteRange(FX_INT32 nStart, FX_INT32 nCount = -1); - void DeleteRange_DoRecord(FX_INT32 nStart, FX_INT32 nCount, FX_BOOL bSel = FALSE); + void Inner_DeleteRange(int32_t nStart, int32_t nCount = -1); + void DeleteRange_DoRecord(int32_t nStart, int32_t nCount, FX_BOOL bSel = FALSE); void ResetEngine(); void RebuildParagraphs(); void RemoveAllParags(); @@ -150,12 +150,12 @@ private: void UpdatePages(); void UpdateTxtBreak(); - FX_BOOL ReplaceParagEnd(FX_LPWSTR &lpText, FX_INT32 &nLength, FX_BOOL bPreIsCR = FALSE); + FX_BOOL ReplaceParagEnd(FX_LPWSTR &lpText, int32_t &nLength, FX_BOOL bPreIsCR = FALSE); void RecoverParagEnd(CFX_WideString &wsText); - FX_INT32 MovePage2Char(FX_INT32 nIndex); - void TextPos2ParagPos(FX_INT32 nIndex, FDE_TXTEDTPARAGPOS &ParagPos) const; - FX_INT32 MoveForward(FX_BOOL &bBefore); - FX_INT32 MoveBackward(FX_BOOL &bBefore); + 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(); @@ -165,8 +165,8 @@ private: FX_BOOL MoveHome(); FX_BOOL MoveEnd(); FX_BOOL IsFitArea(CFX_WideString &wsText); - void UpdateCaretRect(FX_INT32 nIndex, FX_BOOL bBefore = TRUE); - void GetCaretRect(CFX_RectF &rtCaret, FX_INT32 nPageIndex, FX_INT32 nCaret, FX_BOOL bBefore = TRUE); + void UpdateCaretRect(int32_t nIndex, FX_BOOL bBefore = TRUE); + void GetCaretRect(CFX_RectF &rtCaret, int32_t nPageIndex, int32_t nCaret, FX_BOOL bBefore = TRUE); void UpdateCaretIndex(const CFX_PointF & ptCaret); FX_BOOL IsSelect(); @@ -177,21 +177,21 @@ private: CFX_ArrayTemplate m_PagePtrArray; CFX_ArrayTemplate m_ParagPtrArray; CFX_ArrayTemplate m_SelRangePtrArr; - FX_INT32 m_nPageLineCount; - FX_INT32 m_nLineCount; - FX_INT32 m_nAnchorPos; - FX_INT32 m_nLayoutPos; + int32_t m_nPageLineCount; + int32_t m_nLineCount; + int32_t m_nAnchorPos; + int32_t m_nLayoutPos; FX_FLOAT m_fCaretPosReserve; - FX_INT32 m_nCaret; + int32_t m_nCaret; FX_BOOL m_bBefore; - FX_INT32 m_nCaretPage; + int32_t m_nCaretPage; CFX_RectF m_rtCaret; FX_DWORD m_dwFindFlags; FX_BOOL m_bLock; - FX_INT32 m_nLimit; + int32_t m_nLimit; FX_WCHAR m_wcAliasChar; - FX_INT32 m_nFirstLineEnd; + int32_t m_nFirstLineEnd; FX_BOOL m_bAutoLineEnd; FX_WCHAR m_wLineEnd; @@ -202,9 +202,9 @@ class CFDE_TxtEdtDoRecord_Insert : public IFDE_TxtEdtDoRecord public: CFDE_TxtEdtDoRecord_Insert(FX_BSTR bsDoRecord); CFDE_TxtEdtDoRecord_Insert( CFDE_TxtEdtEngine * pEngine, - FX_INT32 nCaret, + int32_t nCaret, FX_LPCWSTR lpText, - FX_INT32 nLength); + int32_t nLength); virtual void Release(); virtual FX_BOOL Undo(); virtual FX_BOOL Redo(); @@ -214,7 +214,7 @@ protected: void Deserialize(FX_BSTR bsDoRecord); private: CFDE_TxtEdtEngine * m_pEngine; - FX_INT32 m_nCaret; + int32_t m_nCaret; CFX_WideString m_wsInsert; }; class CFDE_TxtEdtDoRecord_DeleteRange : public IFDE_TxtEdtDoRecord @@ -222,8 +222,8 @@ class CFDE_TxtEdtDoRecord_DeleteRange : public IFDE_TxtEdtDoRecord public: CFDE_TxtEdtDoRecord_DeleteRange(FX_BSTR bsDoRecord); CFDE_TxtEdtDoRecord_DeleteRange(CFDE_TxtEdtEngine * pEngine, - FX_INT32 nIndex, - FX_INT32 nCaret, + int32_t nIndex, + int32_t nCaret, const CFX_WideString &wsRange, FX_BOOL bSel = FALSE); virtual void Release(); @@ -236,8 +236,8 @@ protected: private: CFDE_TxtEdtEngine * m_pEngine; FX_BOOL m_bSel; - FX_INT32 m_nIndex; - FX_INT32 m_nCaret; + int32_t m_nIndex; + int32_t m_nCaret; CFX_WideString m_wsRange; }; #ifdef FDE_USEFORMATBLOCK @@ -246,12 +246,12 @@ class CFDE_TxtEdtDoRecord_FieldInsert : public IFDE_TxtEdtDoRecord public: CFDE_TxtEdtDoRecord_FieldInsert(FX_BSTR bsDoRecord); CFDE_TxtEdtDoRecord_FieldInsert(CFDE_TxtEdtEngine * pEngine, - FX_INT32 nCaret, + int32_t nCaret, CFDE_TxtEdtField * pField, - FX_INT32 nIndexInField, - FX_INT32 nFieldBgn, - FX_INT32 nOldFieldLength, - FX_INT32 nNewFieldLength, + int32_t nIndexInField, + int32_t nFieldBgn, + int32_t nOldFieldLength, + int32_t nNewFieldLength, const CFX_WideString &wsIns, FX_BOOL bSel = FALSE); virtual void Release(); @@ -264,12 +264,12 @@ protected: private: CFDE_TxtEdtEngine * m_pEngine; - FX_INT32 m_nCaret; + int32_t m_nCaret; CFDE_TxtEdtField * m_pField; - FX_INT32 m_nIndexInField; - FX_INT32 m_nFieldBgn; - FX_INT32 m_nOldFieldLength; - FX_INT32 m_nNewFieldLength; + int32_t m_nIndexInField; + int32_t m_nFieldBgn; + int32_t m_nOldFieldLength; + int32_t m_nNewFieldLength; CFX_WideString m_wsIns; FX_BOOL m_bSel; }; @@ -278,12 +278,12 @@ class CFDE_TxtEdtDoRecord_FieldDelete : public IFDE_TxtEdtDoRecord public: CFDE_TxtEdtDoRecord_FieldDelete(FX_BSTR bsDoRecord); CFDE_TxtEdtDoRecord_FieldDelete(CFDE_TxtEdtEngine * pEngine, - FX_INT32 nCaret, + int32_t nCaret, CFDE_TxtEdtField * pField, - FX_INT32 nIndexInField, - FX_INT32 nFieldBgn, - FX_INT32 nOldLength, - FX_INT32 nNewLength, + int32_t nIndexInField, + int32_t nFieldBgn, + int32_t nOldLength, + int32_t nNewLength, const CFX_WideString &wsDel, FX_BOOL bSel = FALSE); virtual void Release(); @@ -295,12 +295,12 @@ protected: void Deserialize(FX_BSTR bsDoRecord); private: CFDE_TxtEdtEngine * m_pEngine; - FX_INT32 m_nCaret; + int32_t m_nCaret; CFDE_TxtEdtField * m_pField; - FX_INT32 m_nIndexInField; - FX_INT32 m_nFieldBgn; - FX_INT32 m_nOldFieldLength; - FX_INT32 m_nNewFieldLength; + int32_t m_nIndexInField; + int32_t m_nFieldBgn; + int32_t m_nOldFieldLength; + int32_t m_nNewFieldLength; CFX_WideString m_wsDel; FX_BOOL m_bSel; }; @@ -309,12 +309,12 @@ class CFDE_TxtEdtDoRecord_FieldReplace : public IFDE_TxtEdtDoRecord public: CFDE_TxtEdtDoRecord_FieldReplace(FX_BSTR bsDoRecord); CFDE_TxtEdtDoRecord_FieldReplace( CFDE_TxtEdtEngine * pEngine, - FX_INT32 nCaret, - FX_INT32 nNewCaret, + int32_t nCaret, + int32_t nNewCaret, CFDE_TxtEdtField * pField, - FX_INT32 nIndexInField, - FX_INT32 nFieldBgn, - FX_INT32 nFieldNewLength, + int32_t nIndexInField, + int32_t nFieldBgn, + int32_t nFieldNewLength, const CFX_WideString &wsDel, const CFX_WideString &wsIns, FX_BOOL bSel); @@ -327,12 +327,12 @@ protected: void Deserialize(FX_BSTR bsDoRecord); private: CFDE_TxtEdtEngine * m_pEngine; - FX_INT32 m_nCaret; - FX_INT32 m_nNewCaret; + int32_t m_nCaret; + int32_t m_nNewCaret; CFDE_TxtEdtField * m_pField; - FX_INT32 m_nIndexInField; - FX_INT32 m_nFieldBgn; - FX_INT32 m_nFieldNewLength; + int32_t m_nIndexInField; + int32_t m_nFieldBgn; + int32_t m_nFieldNewLength; CFX_WideString m_wsDel; CFX_WideString m_wsIns; FX_BOOL m_bSel; diff --git a/xfa/src/fee/src/fee/fde_txtedtpage.cpp b/xfa/src/fee/src/fee/fde_txtedtpage.cpp index e0a94f81fa..30b4d1bf3e 100644 --- a/xfa/src/fee/src/fee/fde_txtedtpage.cpp +++ b/xfa/src/fee/src/fee/fde_txtedtpage.cpp @@ -14,7 +14,7 @@ #include "fde_txtedtparag.h" #include "fde_txtedtbuf.h" #define FDE_TXTEDT_TOLERANCE 0.1f -IFDE_TxtEdtPage * IFDE_TxtEdtPage::Create(IFDE_TxtEdtEngine * pEngine, FX_INT32 nIndex) +IFDE_TxtEdtPage * IFDE_TxtEdtPage::Create(IFDE_TxtEdtEngine * pEngine, int32_t nIndex) { return (IFDE_TxtEdtPage*)FX_NEW CFDE_TxtEdtPage(pEngine, nIndex); } @@ -46,11 +46,11 @@ FX_BOOL CFDE_TxtEdtTextSet::GetClip(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt) { return FALSE; } -FX_INT32 CFDE_TxtEdtTextSet::GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText) +int32_t CFDE_TxtEdtTextSet::GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText) { FDE_LPTEXTEDITPIECE pPiece = (FDE_LPTEXTEDITPIECE)hText; FX_LPWSTR pBuffer = wsText.GetBuffer(pPiece->nCount); - for (FX_INT32 i = 0; i < pPiece->nCount; i++) { + for (int32_t i = 0; i < pPiece->nCount; i++) { pBuffer[i] = m_pPage->GetChar((FX_LPVOID)hText, i); } wsText.ReleaseBuffer(pPiece->nCount); @@ -68,13 +68,13 @@ FX_ARGB CFDE_TxtEdtTextSet::GetFontColor(FDE_HVISUALOBJ hText) { return m_pPage->GetEngine()->GetEditParams()->dwFontColor; } -FX_INT32 CFDE_TxtEdtTextSet::GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms ) +int32_t CFDE_TxtEdtTextSet::GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms ) { if (hText == NULL) { return 0; } FDE_LPTEXTEDITPIECE pPiece = (FDE_LPTEXTEDITPIECE)hText; - FX_INT32 nLength = pPiece->nCount; + int32_t nLength = pPiece->nCount; if (nLength < 1) { return 0; } @@ -97,18 +97,18 @@ FX_INT32 CFDE_TxtEdtTextSet::GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS tr.wLineBreakChar = pTextParams->wLineBreakChar; return pBreak->GetDisplayPos(&tr, pCharPos, bCharCode, pWSForms); } -FX_INT32 CFDE_TxtEdtTextSet::GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray) +int32_t CFDE_TxtEdtTextSet::GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray) { return GetCharRects_Impl(hText, rtArray); } -FX_INT32 CFDE_TxtEdtTextSet::GetCharRects_Impl(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray, FX_BOOL bBBox ) +int32_t CFDE_TxtEdtTextSet::GetCharRects_Impl(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray, FX_BOOL bBBox ) { if (hText == NULL) { return 0; } FDE_LPTEXTEDITPIECE pPiece = (FDE_LPTEXTEDITPIECE)hText; CFDE_TxtEdtEngine * pEngine = (CFDE_TxtEdtEngine*)(m_pPage->GetEngine()); - FX_INT32 nLength = pPiece->nCount; + int32_t nLength = pPiece->nCount; if (nLength < 1) { return 0; } @@ -129,7 +129,7 @@ FX_INT32 CFDE_TxtEdtTextSet::GetCharRects_Impl(FDE_HVISUALOBJ hText, CFX_RectFAr tr.wLineBreakChar = pTextParams->wLineBreakChar; return pEngine->GetTextBreak()->GetCharRects(&tr, rtArray, bBBox); } -CFDE_TxtEdtPage::CFDE_TxtEdtPage(IFDE_TxtEdtEngine * pEngine, FX_INT32 nPageIndex) +CFDE_TxtEdtPage::CFDE_TxtEdtPage(IFDE_TxtEdtEngine * pEngine, int32_t nPageIndex) : m_pIter(NULL) , m_pTextSet(NULL) , m_nRefCount(0) @@ -192,15 +192,15 @@ FX_BOOL CFDE_TxtEdtPage::GetClip(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt) { return FALSE; } -FX_INT32 CFDE_TxtEdtPage::GetCharRect(FX_INT32 nIndex, CFX_RectF &rect, FX_BOOL bBBox ) const +int32_t CFDE_TxtEdtPage::GetCharRect(int32_t nIndex, CFX_RectF &rect, FX_BOOL bBBox ) const { FXSYS_assert(m_nRefCount > 0); FXSYS_assert(nIndex >= 0 && nIndex < m_nCharCount); if (m_nRefCount < 1) { return 0; } - FX_INT32 nCount = m_PieceMassArr.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = m_PieceMassArr.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { const FDE_LPTEXTEDITPIECE pPiece = m_PieceMassArr.GetPtrAt(i); if (nIndex >= pPiece->nStart && nIndex < (pPiece->nStart + pPiece->nCount)) { CFX_RectFArray rectArr; @@ -216,17 +216,17 @@ FX_INT32 CFDE_TxtEdtPage::GetCharRect(FX_INT32 nIndex, CFX_RectF &rect, FX_BOOL FXSYS_assert(0); return 0; } -FX_INT32 CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefore) +int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefore) { FX_BOOL bVertical = m_pEditEngine->GetEditParams()->dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical; CFX_PointF ptF = fPoint; NormalizePt2Rect(ptF, m_rtPageContents, FDE_TXTEDT_TOLERANCE); - FX_INT32 nCount = m_PieceMassArr.GetSize(); + int32_t nCount = m_PieceMassArr.GetSize(); CFX_RectF rtLine; - FX_INT32 nBgn = 0; - FX_INT32 nEnd = 0; + int32_t nBgn = 0; + int32_t nEnd = 0; FX_BOOL bInLine = FALSE; - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < nCount; i ++) { const FDE_LPTEXTEDITPIECE pPiece = m_PieceMassArr.GetPtrAt(i); if (!bInLine && (bVertical ? (pPiece->rtPiece.left <= ptF.x && pPiece->rtPiece.right() > ptF.x) \ @@ -245,7 +245,7 @@ FX_INT32 CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefor } } NormalizePt2Rect(ptF, rtLine, FDE_TXTEDT_TOLERANCE); - FX_INT32 nCaret = 0; + int32_t nCaret = 0; FDE_LPTEXTEDITPIECE pPiece = NULL; for (i = nBgn; i <= nEnd; i ++) { pPiece = m_PieceMassArr.GetPtrAt(i); @@ -253,8 +253,8 @@ FX_INT32 CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefor if (pPiece->rtPiece.Contains(ptF)) { CFX_RectFArray rectArr; m_pTextSet->GetCharRects((FDE_HVISUALOBJ)pPiece, rectArr); - FX_INT32 nRtCount = rectArr.GetSize(); - for (FX_INT32 j = 0; j < nRtCount; j ++) { + 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()) { @@ -285,34 +285,34 @@ FX_INT32 CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefor bBefore = TRUE; return nCaret; } -FX_INT32 CFDE_TxtEdtPage::GetCharStart() const +int32_t CFDE_TxtEdtPage::GetCharStart() const { return m_nPageStart; } -FX_INT32 CFDE_TxtEdtPage::GetCharCount() const +int32_t CFDE_TxtEdtPage::GetCharCount() const { return m_nCharCount; } -FX_INT32 CFDE_TxtEdtPage::GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS *&pCharPos, FX_LPRECTF pBBox ) const +int32_t CFDE_TxtEdtPage::GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS *&pCharPos, FX_LPRECTF pBBox ) const { pCharPos = (FXTEXT_CHARPOS*)FDE_Alloc(sizeof(FXTEXT_CHARPOS) * m_nCharCount); - FX_INT32 nCharPosCount = 0; + int32_t nCharPosCount = 0; FDE_HVISUALOBJ hVisualObj = NULL; - FX_INT32 nVisualObjCount = m_PieceMassArr.GetSize(); + int32_t nVisualObjCount = m_PieceMassArr.GetSize(); FXTEXT_CHARPOS* pos = pCharPos; CFX_RectF rtObj; - for (FX_INT32 i = 0; i < nVisualObjCount; i ++) { + for (int32_t i = 0; i < nVisualObjCount; i ++) { hVisualObj = (FDE_HVISUALOBJ)m_PieceMassArr.GetPtrAt(i); m_pTextSet->GetRect(hVisualObj, rtObj); if (!rtClip.IntersectWith(rtObj)) { continue; } - FX_INT32 nCount = m_pTextSet->GetDisplayPos(hVisualObj, pos, FALSE); + int32_t nCount = m_pTextSet->GetDisplayPos(hVisualObj, pos, FALSE); nCharPosCount += nCount; pos += nCount; } if ((nCharPosCount * 5) < (m_nCharCount << 2)) { - FX_INT32 nLength = sizeof(FXTEXT_CHARPOS) * nCharPosCount; + int32_t nLength = sizeof(FXTEXT_CHARPOS) * nCharPosCount; FXTEXT_CHARPOS * pTemp = (FXTEXT_CHARPOS*)FDE_Alloc(nLength); FXSYS_memcpy(pTemp, pCharPos, nLength); FDE_Free(pCharPos); @@ -320,16 +320,16 @@ FX_INT32 CFDE_TxtEdtPage::GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS } return nCharPosCount; } -void CFDE_TxtEdtPage::CalcRangeRectArray(FX_INT32 nStart, FX_INT32 nCount, CFX_RectFArray &RectFArr) const +void CFDE_TxtEdtPage::CalcRangeRectArray(int32_t nStart, int32_t nCount, CFX_RectFArray &RectFArr) const { - FX_INT32 nPieceCount = m_PieceMassArr.GetSize(); - FX_INT32 nEnd = nStart + nCount - 1; + int32_t nPieceCount = m_PieceMassArr.GetSize(); + int32_t nEnd = nStart + nCount - 1; FX_BOOL bInRange = FALSE; - for (FX_INT32 i = 0; i < nPieceCount; i ++) { + for (int32_t i = 0; i < nPieceCount; i ++) { FDE_LPTEXTEDITPIECE piece = m_PieceMassArr.GetPtrAt(i); if (!bInRange) { if (nStart >= piece->nStart && nStart < (piece->nStart + piece->nCount)) { - FX_INT32 nRangeEnd = piece->nCount - 1; + int32_t nRangeEnd = piece->nCount - 1; FX_BOOL bEnd = FALSE; if (nEnd >= piece->nStart && nEnd < (piece->nStart + piece->nCount)) { nRangeEnd = nEnd - piece->nStart; @@ -337,7 +337,7 @@ void CFDE_TxtEdtPage::CalcRangeRectArray(FX_INT32 nStart, FX_INT32 nCount, CFX_R } CFX_RectFArray rcArr; m_pTextSet->GetCharRects((FDE_HVISUALOBJ)piece, rcArr); - FX_INT32 nSize = rcArr.GetSize(); + int32_t nSize = rcArr.GetSize(); CFX_RectF rectPiece = rcArr[nStart - piece->nStart]; rectPiece.Union(rcArr[nRangeEnd]); RectFArr.Add(rectPiece); @@ -360,14 +360,14 @@ void CFDE_TxtEdtPage::CalcRangeRectArray(FX_INT32 nStart, FX_INT32 nCount, CFX_R } return; } -FX_INT32 CFDE_TxtEdtPage::SelectWord(const CFX_PointF &fPoint, FX_INT32 &nCount) +int32_t CFDE_TxtEdtPage::SelectWord(const CFX_PointF &fPoint, int32_t &nCount) { if (m_nRefCount < 0) { return - 1; } IFDE_TxtEdtBuf * pBuf = m_pEditEngine->GetTextBuf(); FX_BOOL bBefore; - FX_INT32 nIndex = GetCharIndex(fPoint, bBefore); + int32_t nIndex = GetCharIndex(fPoint, bBefore); if (nIndex == m_pEditEngine->GetTextBufLength()) { nIndex = m_pEditEngine->GetTextBufLength() - 1; } @@ -378,7 +378,7 @@ FX_INT32 CFDE_TxtEdtPage::SelectWord(const CFX_PointF &fPoint, FX_INT32 &nCount) pIter->Attach(FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)pBuf)); pIter->SetAt(nIndex); nCount = pIter->GetWordLength(); - FX_INT32 nRet = pIter->GetWordPos(); + int32_t nRet = pIter->GetWordPos(); pIter->Release(); return nRet; } @@ -386,7 +386,7 @@ FX_BOOL CFDE_TxtEdtPage::IsLoaded(FX_LPCRECTF pClipBox ) { return m_bLoaded; } -FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) +int32_t CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) { if (m_nRefCount > 0) { m_nRefCount ++; @@ -405,12 +405,12 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) IFX_TxtBreak * pBreak = m_pEditEngine->GetTextBreak(); pBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); pBreak->ClearBreakPieces(); - FX_INT32 nLineCount = m_pEditEngine->GetLineCount(); - FX_INT32 nPageLineCount = m_pEditEngine->GetPageLineCount(); - FX_INT32 nLength = pBuf->GetTextLength(); - FX_INT32 nStartLine = nPageLineCount * m_nPageIndex; - FX_INT32 nEndLine = FX_MIN((nStartLine + nPageLineCount - 1), (m_pEditEngine->GetLineCount() - 1)); - FX_INT32 nPageStart, nPageEnd, nTemp, nBgnParag, nStartLineInParag, nEndParag, nEndLineInParag; + int32_t nLineCount = m_pEditEngine->GetLineCount(); + int32_t nPageLineCount = m_pEditEngine->GetPageLineCount(); + int32_t nLength = pBuf->GetTextLength(); + int32_t nStartLine = nPageLineCount * m_nPageIndex; + int32_t nEndLine = FX_MIN((nStartLine + nPageLineCount - 1), (m_pEditEngine->GetLineCount() - 1)); + int32_t nPageStart, nPageEnd, nTemp, nBgnParag, nStartLineInParag, nEndParag, nEndLineInParag; nBgnParag = m_pEditEngine->Line2Parag(0, 0, nStartLine, nStartLineInParag); m_pBgnParag = (CFDE_TxtEdtParag*)m_pEditEngine->GetParag(nBgnParag); m_pBgnParag->LoadParag(); @@ -430,12 +430,12 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) } m_PieceMassArr.RemoveAll(TRUE); FX_DWORD dwBreakStatus = FX_TXTBREAK_None; - FX_INT32 nLineStart = nPageStart; - FX_INT32 nPieceStart = 0; + int32_t nLineStart = nPageStart; + int32_t nPieceStart = 0; if (m_pCharWidth != NULL) { delete [] m_pCharWidth; } - m_pCharWidth = new FX_INT32[nPageEnd - nPageStart + 1]; + m_pCharWidth = new int32_t[nPageEnd - nPageStart + 1]; pBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); pBreak->ClearBreakPieces(); m_nPageStart = nPageStart; @@ -445,7 +445,7 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) IFX_CharIter * pIter = m_pIter->Clone(); pIter->SetAt(nPageStart); m_pIter->SetAt(nPageStart); - FX_INT32 nTextEnd = m_pEditEngine->GetTextBufLength(); + int32_t nTextEnd = m_pEditEngine->GetTextBufLength(); FX_BOOL bFirstPiece = TRUE; do { if (bReload) { @@ -458,8 +458,8 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) dwBreakStatus = pBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); } if (dwBreakStatus > FX_TXTBREAK_PieceBreak) { - FX_INT32 nPieceCount = pBreak->CountBreakPieces(); - for (FX_INT32 j = 0; j < nPieceCount; j ++) { + int32_t nPieceCount = pBreak->CountBreakPieces(); + for (int32_t j = 0; j < nPieceCount; j ++) { const CFX_TxtPiece * pPiece = pBreak->GetBreakPiece(j); FDE_TEXTEDITPIECE TxtEdtPiece; FXSYS_memset(&TxtEdtPiece, 0, sizeof(FDE_TEXTEDITPIECE)); @@ -508,7 +508,7 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) } nPieceStart += TxtEdtPiece.nCount; m_PieceMassArr.Add(TxtEdtPiece); - for (FX_INT32 k = 0; k < TxtEdtPiece.nCount; k ++) { + for (int32_t k = 0; k < TxtEdtPiece.nCount; k ++) { CFX_Char* ptc = pPiece->GetCharPtr(k); m_pCharWidth[TxtEdtPiece.nStart + k] = ptc->m_iCharWidth; } @@ -528,8 +528,8 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) fDelta = pParams->fPlateWidth - m_rtPageContents.width; } else if (pParams->dwAlignment & FDE_TEXTEDITALIGN_Center) { if ((pParams->dwLayoutStyles & FDE_TEXTEDITLAYOUT_CombText) && m_nCharCount > 1) { - FX_INT32 nCount = m_nCharCount - 1; - FX_INT32 n = (m_pEditEngine->m_nLimit - nCount) / 2; + int32_t nCount = m_nCharCount - 1; + int32_t n = (m_pEditEngine->m_nLimit - nCount) / 2; fDelta = (m_rtPageContents.width / nCount) * n; } else { fDelta = (pParams->fPlateWidth - m_rtPageContents.width) / 2; @@ -537,8 +537,8 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) } } FX_FLOAT fOffset = m_rtPageContents.left - fDelta; - FX_INT32 nCount = m_PieceMassArr.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = m_PieceMassArr.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { FDE_LPTEXTEDITPIECE pPiece = m_PieceMassArr.GetPtrAt(i); pPiece->rtPiece.Offset(-fOffset, 0.0f); } @@ -546,7 +546,7 @@ FX_INT32 CFDE_TxtEdtPage::LoadPage(FX_LPCRECTF pClipBox , IFX_Pause *pPause ) } if (m_pEditEngine->GetEditParams()->dwLayoutStyles & FDE_TEXTEDITLAYOUT_LastLineHeight) { m_rtPageContents.height -= pParams->fLineSpace - pParams->fFontSize; - FX_INT32 nCount = m_PieceMassArr.GetSize(); + int32_t nCount = m_PieceMassArr.GetSize(); FDE_LPTEXTEDITPIECE pPiece = m_PieceMassArr.GetPtrAt(nCount - 1); pPiece->rtPiece.height = pParams->fFontSize; } @@ -601,12 +601,12 @@ FDE_HVISUALOBJ CFDE_TxtEdtPage::GetNext(FDE_HVISUALOBJ hCanvas, FX_POSITION &pos pos = NULL; return NULL; } - FX_INT32 nPos = (FX_INT32)(FX_UINTPTR)pos; + int32_t nPos = (int32_t)(uintptr_t)pos; pVisualSet = m_pTextSet; if (nPos + 1 > m_PieceMassArr.GetSize()) { pos = NULL; } else { - pos = (FX_POSITION)(FX_UINTPTR)(nPos + 1); + pos = (FX_POSITION)(uintptr_t)(nPos + 1); } return (FDE_HVISUALOBJ)(m_PieceMassArr.GetPtrAt(nPos - 1)); } @@ -614,9 +614,9 @@ FDE_HVISUALOBJ CFDE_TxtEdtPage::GetParentCanvas(FDE_HVISUALOBJ hCanvas, IFDE_Vis { return NULL; } -FX_WCHAR CFDE_TxtEdtPage::GetChar(FX_LPVOID pIdentity, FX_INT32 index) const +FX_WCHAR CFDE_TxtEdtPage::GetChar(FX_LPVOID pIdentity, int32_t index) const { - FX_INT32 nIndex = m_nPageStart + ((FDE_LPTEXTEDITPIECE)pIdentity)->nStart + index; + int32_t nIndex = m_nPageStart + ((FDE_LPTEXTEDITPIECE)pIdentity)->nStart + index; if (nIndex != m_pIter->GetAt()) { m_pIter->SetAt(nIndex); } @@ -624,9 +624,9 @@ FX_WCHAR CFDE_TxtEdtPage::GetChar(FX_LPVOID pIdentity, FX_INT32 index) const m_pIter->Next(); return wChar; } -FX_INT32 CFDE_TxtEdtPage::GetWidth(FX_LPVOID pIdentity, FX_INT32 index) const +int32_t CFDE_TxtEdtPage::GetWidth(FX_LPVOID pIdentity, int32_t index) const { - FX_INT32 nWidth = m_pCharWidth[((FDE_LPTEXTEDITPIECE)pIdentity)->nStart + index]; + int32_t nWidth = m_pCharWidth[((FDE_LPTEXTEDITPIECE)pIdentity)->nStart + index]; return nWidth; } void CFDE_TxtEdtPage::NormalizePt2Rect(CFX_PointF &ptF, const CFX_RectF &rtF, FX_FLOAT fTolerance) const diff --git a/xfa/src/fee/src/fee/fde_txtedtpage.h b/xfa/src/fee/src/fee/fde_txtedtpage.h index 7c0d0d1ae0..b2854d4afb 100644 --- a/xfa/src/fee/src/fee/fde_txtedtpage.h +++ b/xfa/src/fee/src/fee/fde_txtedtpage.h @@ -44,9 +44,9 @@ static FDE_TXTEDT_CHARTYPE FDE_GetEditSelCharType(FX_WCHAR wChar) } } typedef struct _FDE_TXTEDTPIECE { - FX_INT32 nStart; - FX_INT32 nCount; - FX_INT32 nBidiLevel; + int32_t nStart; + int32_t nCount; + int32_t nBidiLevel; CFX_RectF rtPiece; FX_DWORD dwCharStyles; } FDE_TEXTEDITPIECE, * FDE_LPTEXTEDITPIECE; @@ -62,13 +62,13 @@ public: virtual FX_BOOL GetMatrix(FDE_HVISUALOBJ hVisualObj, CFX_Matrix &matrix); virtual FX_BOOL GetRect(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt); virtual FX_BOOL GetClip(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt); - virtual FX_INT32 GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText); + virtual int32_t GetString(FDE_HVISUALOBJ hText, CFX_WideString &wsText); virtual IFX_Font* GetFont(FDE_HVISUALOBJ hText); virtual FX_FLOAT GetFontSize(FDE_HVISUALOBJ hText); virtual FX_ARGB GetFontColor(FDE_HVISUALOBJ hText); - virtual FX_INT32 GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL); - virtual FX_INT32 GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray); - virtual FX_INT32 GetCharRects_Impl(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray, FX_BOOL bBBox = FALSE); + virtual int32_t GetDisplayPos(FDE_HVISUALOBJ hText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL); + virtual int32_t GetCharRects(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray); + virtual int32_t GetCharRects_Impl(FDE_HVISUALOBJ hText, CFX_RectFArray &rtArray, FX_BOOL bBBox = FALSE); private: CFDE_TxtEdtPage * m_pPage; @@ -76,7 +76,7 @@ private: class CFDE_TxtEdtPage : public IFDE_TxtEdtPage { public: - CFDE_TxtEdtPage(IFDE_TxtEdtEngine * pEngine, FX_INT32 nLineIndex); + CFDE_TxtEdtPage(IFDE_TxtEdtEngine * pEngine, int32_t nLineIndex); virtual void Release(); virtual IFDE_TxtEdtEngine * GetEngine() const; @@ -86,24 +86,24 @@ public: virtual FX_BOOL GetMatrix(FDE_HVISUALOBJ hVisualObj, CFX_Matrix &matrix); virtual FX_BOOL GetRect(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt); virtual FX_BOOL GetClip(FDE_HVISUALOBJ hVisualObj, CFX_RectF &rt); - virtual FX_INT32 GetCharRect(FX_INT32 nIndex, CFX_RectF &rect, FX_BOOL bBBox = FALSE) const; - virtual FX_INT32 GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefore); - virtual FX_INT32 SelectWord(const CFX_PointF &fPoint, FX_INT32 &nCount); - virtual FX_INT32 GetCharStart() const; - virtual FX_INT32 GetCharCount() const; - virtual void CalcRangeRectArray(FX_INT32 nStart, FX_INT32 nCount, CFX_RectFArray &RectFArr) const; - virtual FX_INT32 GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS *&pCharPos, FX_LPRECTF pBBox) const; + virtual int32_t GetCharRect(int32_t nIndex, CFX_RectF &rect, FX_BOOL bBBox = FALSE) const; + virtual int32_t GetCharIndex(const CFX_PointF &fPoint, FX_BOOL &bBefore); + virtual int32_t SelectWord(const CFX_PointF &fPoint, int32_t &nCount); + virtual int32_t GetCharStart() const; + virtual int32_t GetCharCount() const; + virtual void CalcRangeRectArray(int32_t nStart, int32_t nCount, CFX_RectFArray &RectFArr) const; + virtual int32_t GetDisplayPos(const CFX_RectF &rtClip, FXTEXT_CHARPOS *&pCharPos, FX_LPRECTF pBBox) const; virtual FX_BOOL IsLoaded(FX_LPCRECTF pClipBox = NULL); - virtual FX_INT32 LoadPage(FX_LPCRECTF pClipBox = NULL, IFX_Pause *pPause = NULL); + virtual int32_t LoadPage(FX_LPCRECTF pClipBox = NULL, IFX_Pause *pPause = NULL); virtual void UnloadPage(FX_LPCRECTF pClipBox = NULL); virtual const CFX_RectF& GetContentsBox(); virtual FX_POSITION GetFirstPosition(FDE_HVISUALOBJ hCanvas); virtual FDE_HVISUALOBJ GetNext(FDE_HVISUALOBJ hCanvas, FX_POSITION &pos, IFDE_VisualSet *&pVisualSet); virtual FDE_HVISUALOBJ GetParentCanvas(FDE_HVISUALOBJ hCanvas, IFDE_VisualSet *&pVisualSet); - virtual FX_WCHAR GetChar(FX_LPVOID pIdentity, FX_INT32 index) const; - virtual FX_INT32 GetWidth(FX_LPVOID pIdentity, FX_INT32 index) const; + virtual FX_WCHAR GetChar(FX_LPVOID pIdentity, int32_t index) const; + virtual int32_t GetWidth(FX_LPVOID pIdentity, int32_t index) const; protected: virtual ~CFDE_TxtEdtPage(); private: @@ -115,16 +115,16 @@ private: CFDE_TxtEdtParag * m_pBgnParag; CFDE_TxtEdtParag * m_pEndParag; - FX_INT32 m_nRefCount; - FX_INT32 m_nPageStart; - FX_INT32 m_nCharCount; - FX_INT32 m_nPageIndex; + int32_t m_nRefCount; + int32_t m_nPageStart; + int32_t m_nCharCount; + int32_t m_nPageIndex; FX_BOOL m_bLoaded; FX_BOOL m_bLastPage; CFX_RectF m_rtPage; CFX_RectF m_rtPageMargin; CFX_RectF m_rtPageContents; CFX_RectF m_rtPageCanvas; - FX_INT32* m_pCharWidth; + int32_t* m_pCharWidth; }; #endif diff --git a/xfa/src/fee/src/fee/fde_txtedtparag.cpp b/xfa/src/fee/src/fee/fde_txtedtparag.cpp index 9887ddcd3c..ad9082c605 100644 --- a/xfa/src/fee/src/fee/fde_txtedtparag.cpp +++ b/xfa/src/fee/src/fee/fde_txtedtparag.cpp @@ -29,7 +29,7 @@ CFDE_TxtEdtParag::~CFDE_TxtEdtParag() void CFDE_TxtEdtParag::LoadParag() { if (m_lpData != NULL) { - ((FX_INT32*)m_lpData)[0]++; + ((int32_t*)m_lpData)[0]++; return; } IFX_TxtBreak * pTxtBreak = m_pEngine->GetTextBreak(); @@ -41,11 +41,11 @@ void CFDE_TxtEdtParag::LoadParag() } IFX_CharIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)pTxtBuf, wcAlias); pIter->SetAt(m_nCharStart); - FX_INT32 nEndIndex = m_nCharStart + m_nCharCount; - CFX_ArrayTemplate LineBaseArr; + int32_t nEndIndex = m_nCharStart + m_nCharCount; + CFX_ArrayTemplate LineBaseArr; FX_BOOL bReload = FALSE; FX_DWORD dwBreakStatus = FX_TXTBREAK_None; - FX_INT32 nTextEnd = m_pEngine->GetTextBufLength(); + int32_t nTextEnd = m_pEngine->GetTextBufLength(); do { if (bReload) { dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); @@ -57,9 +57,9 @@ void CFDE_TxtEdtParag::LoadParag() dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); } if (dwBreakStatus > FX_TXTBREAK_PieceBreak) { - FX_INT32 nCount = pTxtBreak->CountBreakPieces(); - FX_INT32 nTotal = 0; - for (FX_INT32 j = 0; j < nCount; j ++) { + int32_t nCount = pTxtBreak->CountBreakPieces(); + int32_t nTotal = 0; + for (int32_t j = 0; j < nCount; j ++) { const CFX_TxtPiece * Piece = pTxtBreak->GetBreakPiece(j); nTotal += Piece->GetLength(); } @@ -74,18 +74,18 @@ void CFDE_TxtEdtParag::LoadParag() pIter->Release(); pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); pTxtBreak->ClearBreakPieces(); - FX_INT32 nLineCount = LineBaseArr.GetSize(); + int32_t nLineCount = LineBaseArr.GetSize(); m_nLineCount = nLineCount; if (m_lpData == NULL) { - m_lpData = FX_Alloc(FX_INT32, nLineCount + 1); + m_lpData = FX_Alloc(int32_t, nLineCount + 1); } else { - m_lpData = FX_Realloc(FX_INT32, m_lpData, (nLineCount + 1)); + m_lpData = FX_Realloc(int32_t, m_lpData, (nLineCount + 1)); } - FX_INT32 * pIntArr = (FX_INT32*)m_lpData; + int32_t * pIntArr = (int32_t*)m_lpData; pIntArr[0] = 1; m_nLineCount = nLineCount; pIntArr ++; - for (FX_INT32 j = 0; j < nLineCount; j ++, pIntArr ++) { + for (int32_t j = 0; j < nLineCount; j ++, pIntArr ++) { *pIntArr = LineBaseArr[j]; } LineBaseArr.RemoveAll(); @@ -93,9 +93,9 @@ void CFDE_TxtEdtParag::LoadParag() void CFDE_TxtEdtParag::UnloadParag() { FXSYS_assert(m_lpData != NULL); - ((FX_INT32*)m_lpData)[0]--; - FXSYS_assert(((FX_INT32*)m_lpData)[0] >= 0); - if (((FX_INT32*)m_lpData)[0] == 0) { + ((int32_t*)m_lpData)[0]--; + FXSYS_assert(((int32_t*)m_lpData)[0] >= 0); + if (((int32_t*)m_lpData)[0] == 0) { FX_Free(m_lpData); m_lpData = NULL; } @@ -105,12 +105,12 @@ void CFDE_TxtEdtParag::CalcLines() IFX_TxtBreak * pTxtBreak = m_pEngine->GetTextBreak(); IFDE_TxtEdtBuf * pTxtBuf = m_pEngine->GetTextBuf(); IFX_CharIter * pIter = FX_NEW CFDE_TxtEdtBufIter((CFDE_TxtEdtBuf*)pTxtBuf); - FX_INT32 nCount = 0; + int32_t nCount = 0; FX_DWORD dwBreakStatus = FX_TXTBREAK_None; - FX_INT32 nEndIndex = m_nCharStart + m_nCharCount; + int32_t nEndIndex = m_nCharStart + m_nCharCount; pIter->SetAt(m_nCharStart); FX_BOOL bReload = FALSE; - FX_INT32 nTextEnd = m_pEngine->GetTextBufLength(); + int32_t nTextEnd = m_pEngine->GetTextBufLength(); do { if (bReload) { dwBreakStatus = pTxtBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); @@ -135,13 +135,13 @@ void CFDE_TxtEdtParag::CalcLines() pTxtBreak->ClearBreakPieces(); m_nLineCount = nCount; } -void CFDE_TxtEdtParag::GetLineRange(FX_INT32 nLineIndex, FX_INT32& nStart, FX_INT32& nCount) const +void CFDE_TxtEdtParag::GetLineRange(int32_t nLineIndex, int32_t& nStart, int32_t& nCount) const { - FX_INT32 * pLineBaseArr = (FX_INT32*)m_lpData; + int32_t * pLineBaseArr = (int32_t*)m_lpData; FXSYS_assert(nLineIndex < m_nLineCount); nStart = m_nCharStart; pLineBaseArr ++; - for (FX_INT32 i = 0; i < nLineIndex; i ++) { + for (int32_t i = 0; i < nLineIndex; i ++) { nStart += *pLineBaseArr; pLineBaseArr ++; } diff --git a/xfa/src/fee/src/fee/fde_txtedtparag.h b/xfa/src/fee/src/fee/fde_txtedtparag.h index 276654e2fa..aca5d8febc 100644 --- a/xfa/src/fee/src/fee/fde_txtedtparag.h +++ b/xfa/src/fee/src/fee/fde_txtedtparag.h @@ -13,25 +13,25 @@ class CFDE_TxtEdtParag : public IFDE_TxtEdtParag public: CFDE_TxtEdtParag(CFDE_TxtEdtEngine * pEngine); ~CFDE_TxtEdtParag(); - virtual FX_INT32 GetTextLength() const + virtual int32_t GetTextLength() const { return m_nCharCount; } - virtual FX_INT32 GetStartIndex() const + virtual int32_t GetStartIndex() const { return m_nCharStart; } - virtual FX_INT32 CountLines() const + virtual int32_t CountLines() const { return m_nLineCount; } - virtual void GetLineRange(FX_INT32 nLineIndex, FX_INT32& nStart, FX_INT32& nCount) const; + virtual void GetLineRange(int32_t nLineIndex, int32_t& nStart, int32_t& nCount) const; void LoadParag(); void UnloadParag(); void CalcLines(); - FX_INT32 m_nCharStart; - FX_INT32 m_nCharCount; - FX_INT32 m_nLineCount; + int32_t m_nCharStart; + int32_t m_nCharCount; + int32_t m_nLineCount; private: FX_LPVOID m_lpData; CFDE_TxtEdtEngine* m_pEngine; diff --git a/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.cpp b/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.cpp index 4847af9ed3..ff8dafcf0f 100644 --- a/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.cpp +++ b/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.cpp @@ -44,14 +44,14 @@ FX_WCHAR CFX_CharIter::GetChar() { return m_wsText.GetAt(m_nIndex); } -void CFX_CharIter::SetAt(FX_INT32 nIndex) +void CFX_CharIter::SetAt(int32_t nIndex) { if (nIndex < 0 || nIndex >= m_wsText.GetLength()) { return; } m_nIndex = nIndex; } -FX_INT32 CFX_CharIter::GetAt() const +int32_t CFX_CharIter::GetAt() const { return m_nIndex; } @@ -118,7 +118,7 @@ FX_BOOL CFX_WordBreak::Next(FX_BOOL bPrev) } return TRUE; } -void CFX_WordBreak::SetAt(FX_INT32 nIndex) +void CFX_WordBreak::SetAt(int32_t nIndex) { if (m_pPreIter) { m_pPreIter->Release(); @@ -130,23 +130,23 @@ void CFX_WordBreak::SetAt(FX_INT32 nIndex) m_pCurIter = m_pPreIter->Clone(); FindNextBreakPos(m_pCurIter, FALSE, FALSE); } -FX_INT32 CFX_WordBreak::GetWordPos() const +int32_t CFX_WordBreak::GetWordPos() const { return m_pPreIter->GetAt(); } -FX_INT32 CFX_WordBreak::GetWordLength() const +int32_t CFX_WordBreak::GetWordLength() const { return m_pCurIter->GetAt() - m_pPreIter->GetAt() + 1; } void CFX_WordBreak::GetWord(CFX_WideString &wsWord) const { - FX_INT32 nWordLength = GetWordLength(); + int32_t nWordLength = GetWordLength(); if (nWordLength <= 0) { return; } FX_LPWSTR lpBuf = wsWord.GetBuffer(nWordLength); IFX_CharIter * pTempIter = m_pPreIter->Clone(); - FX_INT32 i = 0; + int32_t i = 0; while (pTempIter->GetAt() <= m_pCurIter->GetAt()) { lpBuf[i++] = pTempIter->GetChar(); FX_BOOL bEnd = pTempIter->Next(); @@ -190,7 +190,7 @@ FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter * pIter, FX_BOOL bPrev, return TRUE; } if (bFirst) { - FX_INT32 nFlags = 0; + int32_t nFlags = 0; if (eCurType == FX_WordBreakProp_MidLetter) { if (eNextType == FX_WordBreakProp_ALetter) { nFlags = 1; @@ -219,7 +219,7 @@ FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter * pIter, FX_BOOL bPrev, bFirst = FALSE; } if (wBreak) { - FX_INT32 nFlags = 0; + int32_t nFlags = 0; if (eNextType == FX_WordBreakProp_MidLetter) { if (eCurType == FX_WordBreakProp_ALetter) { nFlags = 1; diff --git a/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.h b/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.h index d897fc5867..3954f01a44 100644 --- a/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.h +++ b/xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.h @@ -7,7 +7,7 @@ #ifndef _FX_WORDBREAK_IMPL_H #define _FX_WORDBREAK_IMPL_H extern const FX_WORD gs_FX_WordBreak_Table[16]; -extern const FX_BYTE gs_FX_WordBreak_CodePointProperties[(0xFFFF - 1) / 2 + 1]; +extern const uint8_t gs_FX_WordBreak_CodePointProperties[(0xFFFF - 1) / 2 + 1]; enum FX_WordBreakProp { FX_WordBreakProp_None = 0 , FX_WordBreakProp_CR , @@ -31,15 +31,15 @@ public: virtual void Release(); virtual FX_BOOL Next(FX_BOOL bPrev = FALSE); virtual FX_WCHAR GetChar(); - virtual void SetAt(FX_INT32 nIndex); - virtual FX_INT32 GetAt() const; + virtual void SetAt(int32_t nIndex); + virtual int32_t GetAt() const; virtual FX_BOOL IsEOF(FX_BOOL bTail = TRUE) const; virtual IFX_CharIter * Clone(); protected: ~CFX_CharIter(); private: const CFX_WideString &m_wsText; - FX_INT32 m_nIndex; + int32_t m_nIndex; }; class CFX_WordBreak : public IFX_WordBreak { @@ -49,9 +49,9 @@ public: virtual void Attach(IFX_CharIter * pIter); virtual void Attach(const CFX_WideString &wsText); virtual FX_BOOL Next(FX_BOOL bPrev); - virtual void SetAt(FX_INT32 nIndex); - virtual FX_INT32 GetWordPos() const; - virtual FX_INT32 GetWordLength() const; + virtual void SetAt(int32_t nIndex); + virtual int32_t GetWordPos() const; + virtual int32_t GetWordLength() const; virtual void GetWord(CFX_WideString &wsWord) const; virtual FX_BOOL IsEOF(FX_BOOL bTail ) const; protected: diff --git a/xfa/src/fee/src/fx_wordbreak/fx_wordbreakdata.cpp b/xfa/src/fee/src/fx_wordbreak/fx_wordbreakdata.cpp index 23e30479f4..957d2fcc5e 100644 --- a/xfa/src/fee/src/fx_wordbreak/fx_wordbreakdata.cpp +++ b/xfa/src/fee/src/fx_wordbreak/fx_wordbreakdata.cpp @@ -10,7 +10,7 @@ extern const FX_WORD gs_FX_WordBreak_Table[16] = { 0xFFFF, 0xFFF9, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xEFBB, 0xE77B, 0xFFFB, 0xFFFB, 0xFFFB, 0xE77B, 0xE73B, 0xFFFB, 0xFFFB, 0xFFFB, }; -extern const FX_BYTE gs_FX_WordBreak_CodePointProperties[(0xFFFF - 1) / 2 + 1] = { +extern const uint8_t gs_FX_WordBreak_CodePointProperties[(0xFFFF - 1) / 2 + 1] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x90, 0xA0, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0x89, 0x00, 0x00, 0x07, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x70, 0x00, 0x0C, diff --git a/xfa/src/fgas/include/fx_alg.h b/xfa/src/fgas/include/fx_alg.h index ed946641f2..0ee8508083 100644 --- a/xfa/src/fgas/include/fx_alg.h +++ b/xfa/src/fgas/include/fx_alg.h @@ -10,11 +10,11 @@ #ifdef __cplusplus extern "C" { #endif -FX_INT32 FX_Base64EncodeA(FX_LPCBYTE pSrc, FX_INT32 iSrcLen, FX_LPSTR pDst); -FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst); -FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst); -FX_BYTE FX_Hex2Dec(FX_BYTE hexHigh, FX_BYTE hexLow); -FX_INT32 FX_SeparateStringW(FX_LPCWSTR pStr, FX_INT32 iStrLen, FX_WCHAR delimiter, CFX_WideStringArray &pieces); +int32_t FX_Base64EncodeA(FX_LPCBYTE pSrc, int32_t iSrcLen, FX_LPSTR pDst); +int32_t FX_Base64DecodeA(FX_LPCSTR pSrc, int32_t iSrcLen, FX_LPBYTE pDst); +int32_t FX_Base64DecodeW(FX_LPCWSTR pSrc, int32_t iSrcLen, FX_LPBYTE pDst); +uint8_t FX_Hex2Dec(uint8_t hexHigh, uint8_t hexLow); +int32_t FX_SeparateStringW(FX_LPCWSTR pStr, int32_t iStrLen, FX_WCHAR delimiter, CFX_WideStringArray &pieces); #ifdef __cplusplus }; #endif @@ -22,13 +22,13 @@ template class CFX_DSPATemplate { public: - FX_INT32 Lookup(const baseType &find, const baseType *pArray, FX_INT32 iCount) + int32_t Lookup(const baseType &find, const baseType *pArray, int32_t iCount) { FXSYS_assert(pArray != NULL); if (iCount < 1) { return -1; } - FX_INT32 iStart = 0, iEnd = iCount - 1, iMid; + int32_t iStart = 0, iEnd = iCount - 1, iMid; do { iMid = (iStart + iEnd) / 2; const baseType &v = pArray[iMid]; diff --git a/xfa/src/fgas/include/fx_cpg.h b/xfa/src/fgas/include/fx_cpg.h index 43c6520152..2556426dbc 100644 --- a/xfa/src/fgas/include/fx_cpg.h +++ b/xfa/src/fgas/include/fx_cpg.h @@ -130,28 +130,28 @@ class IFX_CodePage; #define FX_CHARSET_MSWin_EasterEuropean 238 #define FX_CHARSET_US 254 #define FX_CHARSET_OEM 255 -FX_WORD FX_GetCodePageFromCharset(FX_BYTE charset); +FX_WORD FX_GetCodePageFromCharset(uint8_t charset); FX_WORD FX_GetCharsetFromCodePage(FX_WORD codepage); -FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, FX_INT32 iLength); -FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, FX_INT32 iLength); +FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, int32_t iLength); +FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, int32_t iLength); FX_WORD FX_GetDefCodePageByLanguage(FX_WORD wLanguage); -void FX_SwapByteOrder(FX_LPWSTR pStr, FX_INT32 iLength); -void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, FX_INT32 iLength); -void FX_UTF16ToWChar(FX_LPVOID pBuffer, FX_INT32 iLength); -void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, FX_INT32 iLength); -void FX_WCharToUTF16(FX_LPVOID pBuffer, FX_INT32 iLength); -void FX_WCharToUTF16Copy(FX_LPCWSTR pWChar, FX_WORD *pUTF16, FX_INT32 iLength); -FX_INT32 FX_DecodeString(FX_WORD wCodePage, FX_LPCSTR pSrc, FX_INT32 *pSrcLen, FX_LPWSTR pDst, FX_INT32 *pDstLen, FX_BOOL bErrBreak = FALSE); -FX_INT32 FX_UTF8Decode(FX_LPCSTR pSrc, FX_INT32 *pSrcLen, FX_LPWSTR pDst, FX_INT32 *pDstLen); +void FX_SwapByteOrder(FX_LPWSTR pStr, int32_t iLength); +void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, int32_t iLength); +void FX_UTF16ToWChar(FX_LPVOID pBuffer, int32_t iLength); +void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, int32_t iLength); +void FX_WCharToUTF16(FX_LPVOID pBuffer, int32_t iLength); +void FX_WCharToUTF16Copy(FX_LPCWSTR pWChar, FX_WORD *pUTF16, int32_t iLength); +int32_t FX_DecodeString(FX_WORD wCodePage, FX_LPCSTR pSrc, int32_t *pSrcLen, FX_LPWSTR pDst, int32_t *pDstLen, FX_BOOL bErrBreak = FALSE); +int32_t FX_UTF8Decode(FX_LPCSTR pSrc, int32_t *pSrcLen, FX_LPWSTR pDst, int32_t *pDstLen); enum FX_CODESYSTEM { FX_MBCS = 0, FX_SBCS , FX_DBCS , }; typedef struct _FX_CODEPAGE_HEADER { - FX_UINT16 uCPID; - FX_UINT8 uMinCharBytes; - FX_UINT8 uMaxCharBytes; + uint16_t uCPID; + uint8_t uMinCharBytes; + uint8_t uMaxCharBytes; FX_CODESYSTEM eCPType; FX_BOOL bHasLeadByte; FX_WCHAR wMinChar; @@ -166,13 +166,13 @@ typedef struct _FX_CODEPAGE_HEADER { #define FX_CPMAPTYPE_NoMapping 3 #define FX_CPMAPTYPE_Delta 4 typedef struct _FX_CPCU_MAPTABLE1 { - FX_UINT16 uMapType; - FX_UINT16 uUniocde; + uint16_t uMapType; + uint16_t uUniocde; } FX_CPCU_MAPTABLE1; typedef struct _FX_CPCU_MAPTABLE2 { - FX_UINT8 uTrailByte; - FX_UINT8 uMapType; - FX_UINT16 uOffset; + uint8_t uTrailByte; + uint8_t uMapType; + uint16_t uOffset; } FX_CPCU_MAPTABLE2; typedef struct _FX_CPCU_MAPINFO { FX_CPCU_MAPTABLE1 *pMapTable1; @@ -180,13 +180,13 @@ typedef struct _FX_CPCU_MAPINFO { FX_LPCBYTE pMapData; } FX_CPCU_MAPINFO; typedef struct _FX_CPUC_MAPTABLE { - FX_UINT16 uStartUnicode; - FX_UINT16 uEndUnicode; - FX_UINT16 uMapType; - FX_UINT16 uOffset; + uint16_t uStartUnicode; + uint16_t uEndUnicode; + uint16_t uMapType; + uint16_t uOffset; } FX_CPUC_MAPTABLE; typedef struct _FX_CPUC_MAPINFO { - FX_UINT32 uMapCount; + uint32_t uMapCount; FX_CPUC_MAPTABLE *pMapTable; FX_LPCBYTE pMapData; } FX_CPUC_MAPINFO; @@ -197,12 +197,12 @@ typedef struct _FX_CODEPAGE { } FX_CODEPAGE, * FX_LPCODEPAGE; typedef FX_CODEPAGE const * FX_LPCCODEPAGE; typedef struct _FX_STR2CPHASH { - FX_UINT32 uHash; - FX_UINT32 uCodePage; + uint32_t uHash; + uint32_t uCodePage; } FX_STR2CPHASH; typedef struct _FX_CHARSET_MAP { - FX_UINT16 charset; - FX_UINT16 codepage; + uint16_t charset; + uint16_t codepage; } FX_CHARSET_MAP; typedef struct _FX_LANG2CPMAP { FX_WORD wLanguage; @@ -216,9 +216,9 @@ public: virtual FX_WORD GetCodePageNumber() const = 0; virtual FX_CODESYSTEM GetCodeSystemType() const = 0; virtual FX_BOOL HasLeadByte() const = 0; - virtual FX_BOOL IsLeadByte(FX_BYTE byte) const = 0; - virtual FX_INT32 GetMinBytesPerChar() const = 0; - virtual FX_INT32 GetMaxBytesPerChar() const = 0; + virtual FX_BOOL IsLeadByte(uint8_t byte) const = 0; + virtual int32_t GetMinBytesPerChar() const = 0; + virtual int32_t GetMaxBytesPerChar() const = 0; virtual FX_WCHAR GetMinCharcode() const = 0; virtual FX_WCHAR GetMaxCharcode() const = 0; virtual FX_WCHAR GetDefCharcode() const = 0; diff --git a/xfa/src/fgas/include/fx_datetime.h b/xfa/src/fgas/include/fx_datetime.h index d18b899fc6..dcaf18398f 100644 --- a/xfa/src/fgas/include/fx_datetime.h +++ b/xfa/src/fgas/include/fx_datetime.h @@ -8,7 +8,7 @@ #define _FX_DATETIME_H_ class CFX_Unitime; class CFX_DateTime; -typedef FX_INT64 FX_UNITIME; +typedef int64_t FX_UNITIME; enum FX_WEEKDAY { FX_Sunday = 0, FX_Monday , @@ -18,9 +18,9 @@ enum FX_WEEKDAY { FX_Friday , FX_Saturday , }; -FX_BOOL FX_IsLeapYear(FX_INT32 iYear); -FX_INT32 FX_DaysInYear(FX_INT32 iYear); -FX_BYTE FX_DaysInMonth(FX_INT32 iYear, FX_BYTE iMonth); +FX_BOOL FX_IsLeapYear(int32_t iYear); +int32_t FX_DaysInYear(int32_t iYear); +uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth); class CFX_Unitime { public: @@ -84,25 +84,25 @@ public: } void Now(); void SetGMTime(); - void Set(FX_INT32 year, FX_BYTE month, FX_BYTE day, FX_BYTE hour = 0, FX_BYTE minute = 0, FX_BYTE second = 0, FX_WORD millisecond = 0); + void Set(int32_t year, uint8_t month, uint8_t day, uint8_t hour = 0, uint8_t minute = 0, uint8_t second = 0, FX_WORD millisecond = 0); void Set(FX_UNITIME t); - FX_INT32 GetYear() const; - FX_BYTE GetMonth() const; - FX_BYTE GetDay() const; + int32_t GetYear() const; + uint8_t GetMonth() const; + uint8_t GetDay() const; FX_WEEKDAY GetDayOfWeek() const; FX_WORD GetDayOfYear() const; - FX_INT64 GetDayOfAD() const; - FX_BYTE GetHour() const; - FX_BYTE GetMinute() const; - FX_BYTE GetSecond() const; + int64_t GetDayOfAD() const; + uint8_t GetHour() const; + uint8_t GetMinute() const; + uint8_t GetSecond() const; FX_WORD GetMillisecond() const; - FX_BOOL AddYears(FX_INT32 iYears); - FX_BOOL AddMonths(FX_INT32 iMonths); - FX_BOOL AddDays(FX_INT32 iDays); - FX_BOOL AddHours(FX_INT32 iHours); - FX_BOOL AddMinutes(FX_INT32 iMinutes); - FX_BOOL AddSeconds(FX_INT32 iSeconds); - FX_BOOL AddMilliseconds(FX_INT32 iMilliseconds); + 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); friend CFX_Unitime operator + (const CFX_Unitime &t1, const CFX_Unitime &t2) { return CFX_Unitime(t1.m_iUnitime + t2.m_iUnitime); @@ -206,37 +206,37 @@ private: #pragma pack(push, 1) #endif typedef struct _FX_DATE { - FX_INT32 year; - FX_BYTE month; - FX_BYTE day; + int32_t year; + uint8_t month; + uint8_t day; } FX_DATE, * FX_LPDATE; typedef FX_DATE const * FX_LPCDATE; typedef struct _FX_TIME { - FX_BYTE hour; - FX_BYTE minute; - FX_BYTE second; + uint8_t hour; + uint8_t minute; + uint8_t second; FX_WORD millisecond; } FX_TIME, * FX_LPTIME; typedef FX_TIME const * FX_LPCTIME; typedef struct _FX_TIMEZONE { - FX_INT8 tzHour; - FX_BYTE tzMinute; + int8_t tzHour; + uint8_t tzMinute; } FX_TIMEZONE, * FX_LPTIMEZONE; typedef FX_TIMEZONE const * FX_LPCTIMEZONE; typedef struct _FX_DATETIME { union { struct { - FX_INT32 year; - FX_BYTE month; - FX_BYTE day; + int32_t year; + uint8_t month; + uint8_t day; } sDate; FX_DATE aDate; } Date; union { struct { - FX_BYTE hour; - FX_BYTE minute; - FX_BYTE second; + uint8_t hour; + uint8_t minute; + uint8_t second; FX_WORD millisecond; } sTime; FX_TIME aTime; @@ -248,17 +248,17 @@ typedef struct _FX_DATETIMEZONE { struct { union { struct { - FX_INT32 year; - FX_BYTE month; - FX_BYTE day; + int32_t year; + uint8_t month; + uint8_t day; }; FX_DATE date; }; union { struct { - FX_BYTE hour; - FX_BYTE minute; - FX_BYTE second; + uint8_t hour; + uint8_t minute; + uint8_t second; FX_WORD millisecond; }; FX_TIME time; @@ -268,8 +268,8 @@ typedef struct _FX_DATETIMEZONE { }; union { struct { - FX_INT8 tzHour; - FX_BYTE tzMinute; + int8_t tzHour; + uint8_t tzMinute; }; FX_TIMEZONE tz; }; @@ -336,26 +336,26 @@ public: FromUnitime(ToUnitime() - ((const CFX_DateTime&)dt).ToUnitime()); return *this; } - virtual FX_BOOL Set(FX_INT32 year, FX_BYTE month, FX_BYTE day, FX_BYTE hour = 0, FX_BYTE minute = 0, FX_BYTE second = 0, FX_WORD millisecond = 0); + 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, FX_WORD millisecond = 0); virtual FX_BOOL FromUnitime(FX_UNITIME t); virtual FX_UNITIME ToUnitime() const; - virtual FX_INT32 GetYear() const; - virtual FX_BYTE GetMonth() const; - virtual FX_BYTE GetDay() const; + virtual int32_t GetYear() const; + virtual uint8_t GetMonth() const; + virtual uint8_t GetDay() const; virtual FX_WEEKDAY GetDayOfWeek() const; virtual FX_WORD GetDayOfYear() const; - virtual FX_INT64 GetDayOfAD() const; - virtual FX_BYTE GetHour() const; - virtual FX_BYTE GetMinute() const; - virtual FX_BYTE GetSecond() const; + virtual int64_t GetDayOfAD() const; + virtual uint8_t GetHour() const; + virtual uint8_t GetMinute() const; + virtual uint8_t GetSecond() const; virtual FX_WORD GetMillisecond() const; - virtual FX_BOOL AddYears(FX_INT32 iYears); - virtual FX_BOOL AddMonths(FX_INT32 iMonths); - virtual FX_BOOL AddDays(FX_INT32 iDays); - virtual FX_BOOL AddHours(FX_INT32 iHours); - virtual FX_BOOL AddMinutes(FX_INT32 iMinutes); - virtual FX_BOOL AddSeconds(FX_INT32 iSeconds); - virtual FX_BOOL AddMilliseconds(FX_INT32 iMilliseconds); + 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); friend CFX_DateTime operator + (const CFX_DateTime &dt1, const CFX_DateTime &dt2) { CFX_DateTime dt; diff --git a/xfa/src/fgas/include/fx_fnt.h b/xfa/src/fgas/include/fx_fnt.h index 491feaea37..85d6e3edff 100644 --- a/xfa/src/fgas/include/fx_fnt.h +++ b/xfa/src/fgas/include/fx_fnt.h @@ -40,13 +40,13 @@ class IFX_FontMgr; class IFX_FontProvider { public: - virtual FX_BOOL GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode = FALSE) = 0; + virtual FX_BOOL GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode = FALSE) = 0; }; class IFX_Font { public: static IFX_Font* LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage, IFX_FontMgr *pFontMgr); - static IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, IFX_FontMgr *pFontMgr); + static IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, IFX_FontMgr *pFontMgr); static IFX_Font* LoadFont(FX_LPCWSTR pszFileName, IFX_FontMgr *pFontMgr); static IFX_Font* LoadFont(IFX_Stream *pFontStream, IFX_FontMgr *pFontMgr, FX_BOOL bSaveStream = FALSE); static IFX_Font* LoadFont(CFX_Font *pExtFont, IFX_FontMgr *pFontMgr, FX_BOOL bTakeOver = FALSE); @@ -56,16 +56,16 @@ public: virtual void GetFamilyName(CFX_WideString &wsFamily) const = 0; virtual void GetPsName(CFX_WideString &wsName) const = 0; virtual FX_DWORD GetFontStyles() const = 0; - virtual FX_BYTE GetCharSet() const = 0; - virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode = FALSE) = 0; - virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE) = 0; - virtual FX_INT32 GetAscent() const = 0; - virtual FX_INT32 GetDescent() const = 0; + virtual uint8_t GetCharSet() const = 0; + virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode = FALSE) = 0; + virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE) = 0; + virtual int32_t GetAscent() const = 0; + virtual int32_t GetDescent() const = 0; virtual FX_BOOL GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bCharCode = FALSE) = 0; virtual FX_BOOL GetBBox(CFX_Rect &bbox) = 0; - virtual FX_INT32 GetItalicAngle() const = 0; + virtual int32_t GetItalicAngle() const = 0; virtual void Reset() = 0; - virtual IFX_Font* GetSubstFont(FX_INT32 iGlyphIndex) const = 0; + virtual IFX_Font* GetSubstFont(int32_t iGlyphIndex) const = 0; virtual void* GetDevFont() const = 0; virtual void SetFontProvider(IFX_FontProvider* pProvider) = 0; #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ @@ -89,7 +89,7 @@ typedef struct _FX_FONTSIGNATURE : public CFX_Target { typedef struct _FX_FONTDESCRIPTOR : public CFX_Target { FX_WCHAR wsFontFace[32]; FX_DWORD dwFontStyles; - FX_BYTE uCharSet; + uint8_t uCharSet; FX_FONTSIGNATURE FontSignature; } FX_FONTDESCRIPTOR, * FX_LPFONTDESCRIPTOR; typedef FX_FONTDESCRIPTOR const * FX_LPCFONTDESCRIPTOR; @@ -114,11 +114,11 @@ public: static IFX_FontMgr* Create(FX_LPEnumAllFonts pEnumerator, FX_LPMatchFont pMatcher = NULL, FX_LPVOID pUserData = NULL); virtual void Release() = 0; virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; - virtual IFX_Font* GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; + virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; virtual IFX_Font* LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF) = 0; - virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength) = 0; + virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength) = 0; virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName) = 0; virtual IFX_Font* LoadFont(IFX_Stream *pFontStream, FX_LPCWSTR pszFontAlias = NULL, FX_DWORD dwFontStyles = 0, FX_WORD wCodePage = 0, FX_BOOL bSaveStream = FALSE) = 0; virtual IFX_Font* LoadFont(IFX_Font *pSrcFont, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF) = 0; @@ -130,7 +130,7 @@ class IFX_FontMgrDelegate { public: virtual IFX_Font* GetDefFontByCodePage(IFX_FontMgr* pFontMgr, FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; - virtual IFX_Font* GetDefFontByCharset(IFX_FontMgr* pFontMgr, FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; + virtual IFX_Font* GetDefFontByCharset(IFX_FontMgr* pFontMgr, uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByUnicode(IFX_FontMgr* pFontMgr, FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByLanguage(IFX_FontMgr* pFontMgr, FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; }; @@ -148,7 +148,7 @@ public: static IFX_FontMgr* Create(IFX_FontSourceEnum* pFontEnum, IFX_FontMgrDelegate* pDelegate = NULL, FX_LPVOID pUserData = NULL); virtual void Release() = 0; virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; - virtual IFX_Font* GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; + virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; virtual IFX_Font* GetFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; @@ -156,12 +156,12 @@ public: { return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily); } - virtual IFX_Font* GetFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; + virtual IFX_Font* GetFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; virtual IFX_Font* GetFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; virtual IFX_Font* GetFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0; - virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, FX_INT32 iFaceIndex, FX_INT32* pFaceCount = NULL) = 0; - virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName, FX_INT32 iFaceIndex, FX_INT32* pFaceCount = NULL) = 0; - virtual IFX_Font* LoadFont(IFX_Stream *pFontStream, FX_INT32 iFaceIndex, FX_INT32* pFaceCount = NULL, FX_BOOL bSaveStream = FALSE) = 0; + virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, int32_t iFaceIndex, int32_t* pFaceCount = NULL) = 0; + virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName, int32_t iFaceIndex, int32_t* pFaceCount = NULL) = 0; + virtual IFX_Font* LoadFont(IFX_Stream *pFontStream, int32_t iFaceIndex, int32_t* pFaceCount = NULL, FX_BOOL bSaveStream = FALSE) = 0; virtual void ClearFontCache() = 0; virtual void RemoveFont(IFX_Font *pFont) = 0; diff --git a/xfa/src/fgas/include/fx_lbk.h b/xfa/src/fgas/include/fx_lbk.h index 3c7aa5d7dd..f161bb4355 100644 --- a/xfa/src/fgas/include/fx_lbk.h +++ b/xfa/src/fgas/include/fx_lbk.h @@ -22,6 +22,6 @@ enum FX_LINEBREAKTYPE { #define FX_LBCP FX_LBT_COM_PROHIBITED_BRK #define FX_LBPB FX_LBT_PROHIBITED_BRK #define FX_LBHS FX_LBT_HANGUL_SPACE_BRK -void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, FX_INT32 iLength); -void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_INT32 iLength, CFX_Int32MassArray &bp); +void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, int32_t iLength); +void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, int32_t iLength, CFX_Int32MassArray &bp); #endif diff --git a/xfa/src/fgas/include/fx_locale.h b/xfa/src/fgas/include/fx_locale.h index 25a6dda4e1..7f4cce5776 100644 --- a/xfa/src/fgas/include/fx_locale.h +++ b/xfa/src/fgas/include/fx_locale.h @@ -61,8 +61,8 @@ public: virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString& wsNumSymbol) const = 0; virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const = 0; - virtual void GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const = 0; - virtual void GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const = 0; + virtual void GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const = 0; + virtual void GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const = 0; virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, FX_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; @@ -112,11 +112,11 @@ class CFX_Decimal { public: CFX_Decimal(); - CFX_Decimal(FX_UINT32 val); - CFX_Decimal(FX_UINT64 val); - CFX_Decimal(FX_INT32 val); - CFX_Decimal(FX_INT64 val); - CFX_Decimal(FX_FLOAT val, FX_UINT8 scale = 3); + CFX_Decimal(uint32_t val); + CFX_Decimal(uint64_t val); + CFX_Decimal(int32_t val); + CFX_Decimal(int64_t val); + CFX_Decimal(FX_FLOAT val, uint8_t scale = 3); CFX_Decimal(FX_WSTR str); CFX_Decimal(FX_BSTR str); operator CFX_WideString() const; @@ -132,29 +132,29 @@ public: CFX_Decimal operator * (const CFX_Decimal& val) const; CFX_Decimal operator / (const CFX_Decimal& val) const; CFX_Decimal operator % (const CFX_Decimal& val) const; - void SetScale(FX_UINT8 newScale); - FX_UINT8 GetScale(); + void SetScale(uint8_t newScale); + uint8_t GetScale(); void SetAbs(); void SetNegate(); void SetFloor(); void SetCeiling(); void SetTruncate(); protected: - CFX_Decimal(FX_UINT32 hi, FX_UINT32 mid, FX_UINT32 lo, FX_BOOL neg, FX_UINT8 scale); + 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; } - inline FX_INT8 Compare (const CFX_Decimal& val) const; + 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; CFX_Decimal Multiply(const CFX_Decimal& val) const; CFX_Decimal Divide(const CFX_Decimal& val) const; CFX_Decimal Modulus(const CFX_Decimal& val) const; - FX_UINT32 m_uFlags; - FX_UINT32 m_uHi; - FX_UINT32 m_uLo; - FX_UINT32 m_uMid; + uint32_t m_uFlags; + uint32_t m_uHi; + uint32_t m_uLo; + uint32_t m_uMid; }; #endif diff --git a/xfa/src/fgas/include/fx_mem.h b/xfa/src/fgas/include/fx_mem.h index 18cd85e422..265c582884 100644 --- a/xfa/src/fgas/include/fx_mem.h +++ b/xfa/src/fgas/include/fx_mem.h @@ -31,7 +31,7 @@ class CFX_Target public: void* operator new(size_t size) { - return FX_Alloc(FX_BYTE, size); + return FX_Alloc(uint8_t, size); } void operator delete(void *p) { diff --git a/xfa/src/fgas/include/fx_rbk.h b/xfa/src/fgas/include/fx_rbk.h index 3053fc5e1b..cff63ee490 100644 --- a/xfa/src/fgas/include/fx_rbk.h +++ b/xfa/src/fgas/include/fx_rbk.h @@ -69,17 +69,17 @@ typedef struct _FX_RTFTEXTOBJ { iVerticalScale = 100; } FX_LPCWSTR pStr; - FX_INT32 *pWidths; - FX_INT32 iLength; + int32_t *pWidths; + int32_t iLength; IFX_Font *pFont; FX_FLOAT fFontSize; FX_DWORD dwLayoutStyles; - FX_INT32 iCharRotation; - FX_INT32 iBidiLevel; + int32_t iCharRotation; + int32_t iBidiLevel; FX_LPCRECTF pRect; FX_WCHAR wLineBreakChar; - FX_INT32 iHorizontalScale; - FX_INT32 iVerticalScale; + int32_t iHorizontalScale; + int32_t iVerticalScale; } FX_RTFTEXTOBJ, * FX_LPRTFTEXTOBJ; typedef FX_RTFTEXTOBJ const * FX_LPCRTFTEXTOBJ; class CFX_RTFPiece : public CFX_Target @@ -117,24 +117,24 @@ public: } m_iChars ++; } - FX_INT32 GetEndPos() const + int32_t GetEndPos() const { return m_iWidth < 0 ? m_iStartPos : m_iStartPos + m_iWidth; } - FX_INT32 GetLength() const + int32_t GetLength() const { return m_iChars; } - FX_INT32 GetEndChar() const + int32_t GetEndChar() const { return m_iStartChar + m_iChars; } - CFX_RTFChar& GetChar(FX_INT32 index) + CFX_RTFChar& GetChar(int32_t index) { FXSYS_assert(index > -1 && index < m_iChars && m_pChars != NULL); return *m_pChars->GetDataPtr(m_iStartChar + index); } - CFX_RTFChar* GetCharPtr(FX_INT32 index) const + CFX_RTFChar* GetCharPtr(int32_t index) const { FXSYS_assert(index > -1 && index < m_iChars && m_pChars != NULL); return m_pChars->GetDataPtr(m_iStartChar + index); @@ -142,9 +142,9 @@ public: void GetString (FX_LPWSTR pText) const { FXSYS_assert(pText != NULL); - FX_INT32 iEndChar = m_iStartChar + m_iChars; + int32_t iEndChar = m_iStartChar + m_iChars; CFX_RTFChar *pChar; - for (FX_INT32 i = m_iStartChar; i < iEndChar; i ++) { + for (int32_t i = m_iStartChar; i < iEndChar; i ++) { pChar = m_pChars->GetDataPtr(i); *pText ++ = (FX_WCHAR)pChar->m_wCharCode; } @@ -155,12 +155,12 @@ public: GetString(pText); wsText.ReleaseBuffer(m_iChars); } - void GetWidths(FX_INT32 *pWidths) const + void GetWidths(int32_t *pWidths) const { FXSYS_assert(pWidths != NULL); - FX_INT32 iEndChar = m_iStartChar + m_iChars; + int32_t iEndChar = m_iStartChar + m_iChars; CFX_RTFChar *pChar; - for (FX_INT32 i = m_iStartChar; i < iEndChar; i ++) { + for (int32_t i = m_iStartChar; i < iEndChar; i ++) { pChar = m_pChars->GetDataPtr(i); *pWidths ++ = pChar->m_iCharWidth; } @@ -180,16 +180,16 @@ public: m_iVerticalScale = 100; } FX_DWORD m_dwStatus; - FX_INT32 m_iStartPos; - FX_INT32 m_iWidth; - FX_INT32 m_iStartChar; - FX_INT32 m_iChars; - FX_INT32 m_iBidiLevel; - FX_INT32 m_iBidiPos; - FX_INT32 m_iFontSize; - FX_INT32 m_iFontHeight; - FX_INT32 m_iHorizontalScale; - FX_INT32 m_iVerticalScale; + int32_t m_iStartPos; + int32_t m_iWidth; + int32_t m_iStartChar; + int32_t m_iChars; + int32_t m_iBidiLevel; + int32_t m_iBidiPos; + int32_t m_iFontSize; + int32_t m_iFontHeight; + int32_t m_iHorizontalScale; + int32_t m_iVerticalScale; FX_DWORD m_dwLayoutStyles; FX_DWORD m_dwIdentity; CFX_RTFCharArray *m_pChars; @@ -214,22 +214,22 @@ public: virtual void SetDefaultChar(FX_WCHAR wch) = 0; virtual void SetLineBreakChar(FX_WCHAR wch) = 0; virtual void SetLineBreakTolerance(FX_FLOAT fTolerance) = 0; - virtual void SetHorizontalScale(FX_INT32 iScale) = 0; - virtual void SetVerticalScale(FX_INT32 iScale) = 0; - virtual void SetCharRotation(FX_INT32 iCharRotation) = 0; + virtual void SetHorizontalScale(int32_t iScale) = 0; + virtual void SetVerticalScale(int32_t iScale) = 0; + virtual void SetCharRotation(int32_t iCharRotation) = 0; virtual void SetCharSpace(FX_FLOAT fCharSpace) = 0; virtual void SetWordSpace(FX_BOOL bDefault, FX_FLOAT fWordSpace) = 0; virtual void SetReadingOrder(FX_BOOL bRTL = FALSE) = 0; - virtual void SetAlignment(FX_INT32 iAlignment = FX_RTFLINEALIGNMENT_Left) = 0; + virtual void SetAlignment(int32_t iAlignment = FX_RTFLINEALIGNMENT_Left) = 0; virtual void SetUserData(IFX_Unknown *pUserData) = 0; virtual FX_DWORD AppendChar(FX_WCHAR wch) = 0; virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_RTFBREAK_PieceBreak) = 0; - virtual FX_INT32 CountBreakPieces() const = 0; - virtual const CFX_RTFPiece* GetBreakPiece(FX_INT32 index) const = 0; + virtual int32_t CountBreakPieces() const = 0; + virtual const CFX_RTFPiece* GetBreakPiece(int32_t index) const = 0; virtual void GetLineRect(CFX_RectF &rect) const = 0; virtual void ClearBreakPieces() = 0; virtual void Reset() = 0; - virtual FX_INT32 GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const = 0; - virtual FX_INT32 GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const = 0; + virtual int32_t GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const = 0; + virtual int32_t GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const = 0; }; #endif diff --git a/xfa/src/fgas/include/fx_sax.h b/xfa/src/fgas/include/fx_sax.h index c0159f8c22..e45ca4e6d8 100644 --- a/xfa/src/fgas/include/fx_sax.h +++ b/xfa/src/fgas/include/fx_sax.h @@ -39,8 +39,8 @@ class IFX_SAXReader { public: virtual void Release() = 0; - virtual FX_INT32 StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0) = 0; - virtual FX_INT32 ContinueParse(IFX_Pause *pPause = NULL) = 0; + virtual int32_t StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0) = 0; + virtual int32_t ContinueParse(IFX_Pause *pPause = NULL) = 0; virtual void SkipCurrentNode() = 0; virtual void SetHandler(IFX_SAXReaderHandler *pHandler) = 0; }; diff --git a/xfa/src/fgas/include/fx_stm.h b/xfa/src/fgas/include/fx_stm.h index ae424dba2d..e6094d445c 100644 --- a/xfa/src/fgas/include/fx_stm.h +++ b/xfa/src/fgas/include/fx_stm.h @@ -11,7 +11,7 @@ IFX_FileRead* FX_CreateFileRead(IFX_Stream *pBaseStream, FX_BOOL bReleaseStream #ifdef FX_FILESIZE IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, FX_FILESIZE iFileSize = -1, FX_BOOL bReleaseStream = TRUE); #else -IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize = -1, FX_BOOL bReleaseStream = TRUE); +IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, int32_t iFileSize = -1, FX_BOOL bReleaseStream = TRUE); #endif IFX_FileWrite* FX_CreateFileWrite(IFX_Stream *pBaseStream, FX_BOOL bReleaseStream = FALSE); enum FX_STREAMACCESS { @@ -34,27 +34,27 @@ public: static IFX_Stream* CreateStream(IFX_FileRead *pFileRead, FX_DWORD dwAccess); static IFX_Stream* CreateStream(IFX_FileWrite *pFileWrite, FX_DWORD dwAccess); static IFX_Stream* CreateStream(FX_LPCWSTR pszFileName, FX_DWORD dwAccess); - static IFX_Stream* CreateStream(FX_LPBYTE pData, FX_INT32 length, FX_DWORD dwAccess); - static IFX_Stream* CreateStream(IFX_BufferRead *pBufferRead, FX_DWORD dwAccess, FX_INT32 iFileSize = -1, FX_BOOL bReleaseBufferRead = TRUE); + static IFX_Stream* CreateStream(FX_LPBYTE pData, int32_t length, FX_DWORD dwAccess); + static IFX_Stream* CreateStream(IFX_BufferRead *pBufferRead, FX_DWORD dwAccess, int32_t iFileSize = -1, FX_BOOL bReleaseBufferRead = TRUE); static IFX_Stream* CreateTextStream(IFX_Stream *pBaseStream, FX_BOOL bDeleteOnRelease); virtual void Release() = 0; virtual IFX_Stream* Retain() = 0; virtual FX_DWORD GetAccessModes() const = 0; - virtual FX_INT32 GetLength() const = 0; - virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) = 0; - virtual FX_INT32 GetPosition() = 0; + 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 FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) = 0; - virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL) = 0; - virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) = 0; - virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) = 0; + virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) = 0; + virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL) = 0; + virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) = 0; + virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength) = 0; virtual void Flush() = 0; - virtual FX_BOOL SetLength(FX_INT32 iLength) = 0; - virtual FX_INT32 GetBOM(FX_BYTE bom[4]) const = 0; + virtual FX_BOOL SetLength(int32_t iLength) = 0; + virtual int32_t GetBOM(uint8_t bom[4]) const = 0; virtual FX_WORD GetCodePage() const = 0; virtual FX_WORD SetCodePage(FX_WORD wCodePage) = 0; virtual void Lock() = 0; virtual void Unlock() = 0; - virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength) = 0; + virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength) = 0; }; #endif diff --git a/xfa/src/fgas/include/fx_sys.h b/xfa/src/fgas/include/fx_sys.h index c0b5c7445f..8e099bce05 100644 --- a/xfa/src/fgas/include/fx_sys.h +++ b/xfa/src/fgas/include/fx_sys.h @@ -11,10 +11,10 @@ extern "C" { #endif #define FX_RAD2DEG(r) ((r) * 180.0f / FX_PI) #define FX_DEG2RAD(a) ((a) * FX_PI / 180.0f) -typedef FX_INT8 * FX_LPINT8; -typedef FX_INT8 const * FX_LPCINT8; -typedef FX_INT32 * FX_LPINT32; -typedef FX_INT32 const * FX_LPCINT32; +typedef int8_t * FX_LPINT8; +typedef int8_t const * FX_LPCINT8; +typedef int32_t * FX_LPINT32; +typedef int32_t const * FX_LPCINT32; typedef long FX_LONG; typedef FX_LONG * FX_LPLONG; typedef FX_LONG const * FX_LPCLONG; @@ -24,30 +24,30 @@ typedef FX_DOUBLE * FX_LPDOUBLE; typedef FX_DOUBLE const * FX_LPCDOUBLE; FX_FLOAT FX_tan(FX_FLOAT a); FX_FLOAT FX_log(FX_FLOAT b, FX_FLOAT x); -FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL); -FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL); +FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL); +FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL); FX_LPWSTR FX_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count); -FX_INT32 FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count); -FX_INT32 FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count); -inline FX_BOOL FX_islower(FX_INT32 ch) +int32_t FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count); +int32_t FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count); +inline FX_BOOL FX_islower(int32_t ch) { return ch >= 'a' && ch <= 'z'; } -inline FX_BOOL FX_isupper(FX_INT32 ch) +inline FX_BOOL FX_isupper(int32_t ch) { return ch >= 'A' && ch <= 'Z'; } -inline FX_INT32 FX_tolower(FX_INT32 ch) +inline int32_t FX_tolower(int32_t ch) { return FX_isupper(ch) ? (ch + 0x20) : ch; } -inline FX_INT32 FX_toupper(FX_INT32 ch) +inline int32_t FX_toupper(int32_t ch) { return FX_islower(ch) ? (ch - 0x20) : ch; } -FX_INT32 FX_filelength(FXSYS_FILE *file); -FX_BOOL FX_fsetsize(FXSYS_FILE *file, FX_INT32 size); -void FX_memset(FX_LPVOID pBuf, FX_INT32 iValue, size_t size); +int32_t FX_filelength(FXSYS_FILE *file); +FX_BOOL FX_fsetsize(FXSYS_FILE *file, int32_t size); +void FX_memset(FX_LPVOID pBuf, int32_t iValue, size_t size); void FX_memcpy(FX_LPVOID pDst, FX_LPCVOID pSrc, size_t size); FX_BOOL FX_IsRelativePath(const CFX_WideStringC &wsPath); FX_BOOL FX_JoinPath(const CFX_WideStringC &wsBasePath, const CFX_WideStringC &wsRelativePath, CFX_WideString &wsAbsolutePath); diff --git a/xfa/src/fgas/include/fx_tbk.h b/xfa/src/fgas/include/fx_tbk.h index ab64d1dac0..69b42f1fd7 100644 --- a/xfa/src/fgas/include/fx_tbk.h +++ b/xfa/src/fgas/include/fx_tbk.h @@ -60,8 +60,8 @@ class IFX_TxtBreak; class IFX_TxtAccess { public: - virtual FX_WCHAR GetChar(FX_LPVOID pIdentity, FX_INT32 index) const = 0; - virtual FX_INT32 GetWidth(FX_LPVOID pIdentity, FX_INT32 index) const = 0; + virtual FX_WCHAR GetChar(FX_LPVOID pIdentity, int32_t index) const = 0; + virtual int32_t GetWidth(FX_LPVOID pIdentity, int32_t index) const = 0; }; typedef struct _FX_TXTRUN { _FX_TXTRUN() @@ -85,14 +85,14 @@ typedef struct _FX_TXTRUN { IFX_TxtAccess *pAccess; FX_LPVOID pIdentity; FX_LPCWSTR pStr; - FX_INT32 *pWidths; - FX_INT32 iLength; + int32_t *pWidths; + int32_t iLength; IFX_Font *pFont; FX_FLOAT fFontSize; FX_DWORD dwStyles; - FX_INT32 iHorizontalScale; - FX_INT32 iVerticalScale; - FX_INT32 iCharRotation; + int32_t iHorizontalScale; + int32_t iVerticalScale; + int32_t iCharRotation; FX_DWORD dwCharStyles; FX_LPCRECTF pRect; FX_WCHAR wLineBreakChar; @@ -116,19 +116,19 @@ public: , m_pUserData(NULL) { } - FX_INT32 GetEndPos() const + int32_t GetEndPos() const { return m_iWidth < 0 ? m_iStartPos : m_iStartPos + m_iWidth; } - FX_INT32 GetLength() const + int32_t GetLength() const { return m_iChars; } - FX_INT32 GetEndChar() const + int32_t GetEndChar() const { return m_iStartChar + m_iChars; } - CFX_TxtChar* GetCharPtr(FX_INT32 index) const + CFX_TxtChar* GetCharPtr(int32_t index) const { FXSYS_assert(index > -1 && index < m_iChars && m_pChars != NULL); return m_pChars->GetDataPtr(m_iStartChar + index); @@ -136,9 +136,9 @@ public: void GetString(FX_LPWSTR pText) const { FXSYS_assert(pText != NULL); - FX_INT32 iEndChar = m_iStartChar + m_iChars; + int32_t iEndChar = m_iStartChar + m_iChars; CFX_Char *pChar; - for (FX_INT32 i = m_iStartChar; i < iEndChar; i ++) { + for (int32_t i = m_iStartChar; i < iEndChar; i ++) { pChar = m_pChars->GetDataPtr(i); *pText ++ = (FX_WCHAR)pChar->m_wCharCode; } @@ -150,25 +150,25 @@ public: GetString(pText); wsText.ReleaseBuffer(m_iChars); } - void GetWidths(FX_INT32 *pWidths) const + void GetWidths(int32_t *pWidths) const { FXSYS_assert(pWidths != NULL); - FX_INT32 iEndChar = m_iStartChar + m_iChars; + int32_t iEndChar = m_iStartChar + m_iChars; CFX_Char *pChar; - for (FX_INT32 i = m_iStartChar; i < iEndChar; i ++) { + for (int32_t i = m_iStartChar; i < iEndChar; i ++) { pChar = m_pChars->GetDataPtr(i); *pWidths ++ = pChar->m_iCharWidth; } } FX_DWORD m_dwStatus; - FX_INT32 m_iStartPos; - FX_INT32 m_iWidth; - FX_INT32 m_iStartChar; - FX_INT32 m_iChars; - FX_INT32 m_iBidiLevel; - FX_INT32 m_iBidiPos; - FX_INT32 m_iHorizontalScale; - FX_INT32 m_iVerticalScale; + int32_t m_iStartPos; + int32_t m_iWidth; + int32_t m_iStartChar; + int32_t m_iChars; + int32_t m_iBidiLevel; + int32_t m_iBidiPos; + int32_t m_iHorizontalScale; + int32_t m_iVerticalScale; FX_DWORD m_dwCharStyles; CFX_TxtCharArray *m_pChars; FX_LPVOID m_pUserData; @@ -189,23 +189,23 @@ public: virtual void SetDefaultChar(FX_WCHAR wch) = 0; virtual void SetParagraphBreakChar(FX_WCHAR wch) = 0; virtual void SetLineBreakTolerance(FX_FLOAT fTolerance) = 0; - virtual void SetHorizontalScale(FX_INT32 iScale) = 0; - virtual void SetVerticalScale(FX_INT32 iScale) = 0; - virtual void SetCharRotation(FX_INT32 iCharRotation) = 0; + virtual void SetHorizontalScale(int32_t iScale) = 0; + virtual void SetVerticalScale(int32_t iScale) = 0; + virtual void SetCharRotation(int32_t iCharRotation) = 0; virtual void SetCharSpace(FX_FLOAT fCharSpace) = 0; - virtual void SetAlignment(FX_INT32 iAlignment) = 0; + virtual void SetAlignment(int32_t iAlignment) = 0; virtual FX_DWORD GetContextCharStyles() const = 0; virtual void SetContextCharStyles(FX_DWORD dwCharStyles) = 0; virtual void SetCombWidth(FX_FLOAT fCombWidth) = 0; virtual void SetUserData(FX_LPVOID pUserData) = 0; virtual FX_DWORD AppendChar(FX_WCHAR wch) = 0; virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_TXTBREAK_PieceBreak) = 0; - virtual FX_INT32 CountBreakChars() const = 0; - virtual FX_INT32 CountBreakPieces() const = 0; - virtual const CFX_TxtPiece* GetBreakPiece(FX_INT32 index) const = 0; + virtual int32_t CountBreakChars() const = 0; + virtual int32_t CountBreakPieces() const = 0; + virtual const CFX_TxtPiece* GetBreakPiece(int32_t index) const = 0; virtual void ClearBreakPieces() = 0; virtual void Reset() = 0; - virtual FX_INT32 GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const = 0; - virtual FX_INT32 GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const = 0; + virtual int32_t GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const = 0; + virtual int32_t GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const = 0; }; #endif diff --git a/xfa/src/fgas/include/fx_ucd.h b/xfa/src/fgas/include/fx_ucd.h index 715c8af4dd..7b5b6532a5 100644 --- a/xfa/src/fgas/include/fx_ucd.h +++ b/xfa/src/fgas/include/fx_ucd.h @@ -14,7 +14,7 @@ #define FX_JAPCHARPROPERTYEX_Bottom 0x30 typedef struct _FX_JAPCHARPROPERTYEX { FX_WCHAR wChar; - FX_BYTE uAlign; + uint8_t uAlign; } FX_JAPCHARPROPERTYEX, *FX_LPJAPCHARPROPERTYEX; typedef FX_JAPCHARPROPERTYEX const * FX_LPCJAPCHARPROPERTYEX; FX_LPCJAPCHARPROPERTYEX FX_GetJapCharPropertyEx(FX_WCHAR wch); diff --git a/xfa/src/fgas/include/fx_utl.h b/xfa/src/fgas/include/fx_utl.h index 850543786c..35b676f41e 100644 --- a/xfa/src/fgas/include/fx_utl.h +++ b/xfa/src/fgas/include/fx_utl.h @@ -34,16 +34,16 @@ private: class CFX_BaseArray : public CFX_Target { protected: - CFX_BaseArray(FX_INT32 iGrowSize, FX_INT32 iBlockSize); + CFX_BaseArray(int32_t iGrowSize, int32_t iBlockSize); ~CFX_BaseArray(); - FX_INT32 GetSize() const; - FX_INT32 GetBlockSize() const; - FX_LPBYTE AddSpaceTo(FX_INT32 index); - FX_LPBYTE GetAt(FX_INT32 index) const; + int32_t GetSize() const; + int32_t GetBlockSize() const; + FX_LPBYTE AddSpaceTo(int32_t index); + FX_LPBYTE GetAt(int32_t index) const; FX_LPBYTE GetBuffer() const; - FX_INT32 Append(const CFX_BaseArray &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1); - FX_INT32 Copy(const CFX_BaseArray &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1); - FX_INT32 RemoveLast(FX_INT32 iCount = -1); + int32_t Append(const CFX_BaseArray &src, int32_t iStart = 0, int32_t iCount = -1); + int32_t Copy(const CFX_BaseArray &src, int32_t iStart = 0, int32_t iCount = -1); + int32_t RemoveLast(int32_t iCount = -1); void RemoveAll(FX_BOOL bLeaveMemory = FALSE); FX_LPVOID m_pData; }; @@ -51,13 +51,13 @@ template class CFX_BaseArrayTemplate : public CFX_BaseArray { public: - CFX_BaseArrayTemplate(FX_INT32 iGrowSize = 100) : CFX_BaseArray(iGrowSize, sizeof(baseType)) {} - CFX_BaseArrayTemplate(FX_INT32 iGrowSize, FX_INT32 iBlockSize) : CFX_BaseArray(iGrowSize, iBlockSize) {} - FX_INT32 GetSize() const + CFX_BaseArrayTemplate(int32_t iGrowSize = 100) : CFX_BaseArray(iGrowSize, sizeof(baseType)) {} + CFX_BaseArrayTemplate(int32_t iGrowSize, int32_t iBlockSize) : CFX_BaseArray(iGrowSize, iBlockSize) {} + int32_t GetSize() const { return CFX_BaseArray::GetSize(); } - FX_INT32 GetBlockSize() const + int32_t GetBlockSize() const { return CFX_BaseArray::GetBlockSize(); } @@ -65,9 +65,9 @@ public: { return (baseType*)CFX_BaseArray::AddSpaceTo(CFX_BaseArray::GetSize()); } - FX_INT32 Add(const baseType &element) + int32_t Add(const baseType &element) { - FX_INT32 index = CFX_BaseArray::GetSize(); + int32_t index = CFX_BaseArray::GetSize(); *(baseType*)CFX_BaseArray::AddSpaceTo(index) = element; return index; } @@ -75,31 +75,31 @@ public: { return (baseType*)CFX_BaseArray::GetBuffer(); } - baseType& GetAt(FX_INT32 index) const + baseType& GetAt(int32_t index) const { return *(baseType*)CFX_BaseArray::GetAt(index); } - baseType* GetPtrAt(FX_INT32 index) const + baseType* GetPtrAt(int32_t index) const { return (baseType*)CFX_BaseArray::GetAt(index); } - void SetAt(FX_INT32 index, const baseType &element) + void SetAt(int32_t index, const baseType &element) { *(baseType*)CFX_BaseArray::GetAt(index) = element; } - void SetAtGrow(FX_INT32 index, const baseType &element) + void SetAtGrow(int32_t index, const baseType &element) { *(baseType*)CFX_BaseArray::AddSpaceTo(index) = element; } - FX_INT32 Append(const CFX_BaseArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1) + int32_t Append(const CFX_BaseArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1) { return CFX_BaseArray::Append(src, iStart, iCount); } - FX_INT32 Copy(const CFX_BaseArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1) + int32_t Copy(const CFX_BaseArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1) { return CFX_BaseArray::Copy(src, iStart, iCount); } - FX_INT32 RemoveLast(FX_INT32 iCount = -1) + int32_t RemoveLast(int32_t iCount = -1) { return CFX_BaseArray::RemoveLast(iCount); } @@ -115,41 +115,41 @@ template class CFX_ObjectBaseArrayTemplate : public CFX_BaseArray { public: - CFX_ObjectBaseArrayTemplate(FX_INT32 iGrowSize = 100) : CFX_BaseArray(iGrowSize, sizeof(baseType)) {} + CFX_ObjectBaseArrayTemplate(int32_t iGrowSize = 100) : CFX_BaseArray(iGrowSize, sizeof(baseType)) {} ~CFX_ObjectBaseArrayTemplate() { RemoveAll(FALSE); } - FX_INT32 GetSize() const + int32_t GetSize() const { return CFX_BaseArray::GetSize(); } - FX_INT32 GetBlockSize() const + int32_t GetBlockSize() const { return CFX_BaseArray::GetBlockSize(); } - FX_INT32 Add(const baseType &element) + int32_t Add(const baseType &element) { - FX_INT32 index = CFX_BaseArray::GetSize(); + int32_t index = CFX_BaseArray::GetSize(); baseType *p = (baseType*)CFX_BaseArray::AddSpaceTo(index); FXTARGET_New ((void*)p)baseType(element); return index; } - baseType& GetAt(FX_INT32 index) const + baseType& GetAt(int32_t index) const { return *(baseType*)CFX_BaseArray::GetAt(index); } - baseType* GetPtrAt(FX_INT32 index) const + baseType* GetPtrAt(int32_t index) const { return (baseType*)CFX_BaseArray::GetAt(index); } - FX_INT32 Append(const CFX_ObjectBaseArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1) + int32_t Append(const CFX_ObjectBaseArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1) { FXSYS_assert(GetBlockSize() == src.GetBlockSize()); if (iCount == 0) { return 0; } - FX_INT32 iSize = src.GetSize(); + int32_t iSize = src.GetSize(); FXSYS_assert(iStart > -1 && iStart < iSize); if (iCount < 0) { iCount = iSize; @@ -163,21 +163,21 @@ public: iSize = CFX_BaseArray::GetSize(); CFX_BaseArray::AddSpaceTo(iSize + iCount - 1); FX_LPBYTE *pStart = CFX_BaseArray::GetAt(iSize); - FX_INT32 iBlockSize = CFX_BaseArray::GetBlockSize(); + int32_t iBlockSize = CFX_BaseArray::GetBlockSize(); iSize = iStart + iCount; - for (FX_INT32 i = iStart; i < iSize; i ++) { + for (int32_t i = iStart; i < iSize; i ++) { FXTARGET_NewWith ((void*)pStart)baseType(src.GetAt(i)); pStart += iBlockSize; } return iCount; } - FX_INT32 Copy(const CFX_ObjectBaseArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1) + int32_t Copy(const CFX_ObjectBaseArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1) { FXSYS_assert(GetBlockSize() == src.GetBlockSize()); if (iCount == 0) { return 0; } - FX_INT32 iSize = src.GetSize(); + int32_t iSize = src.GetSize(); FXSYS_assert(iStart > -1 && iStart < iSize); if (iCount < 0) { iCount = iSize; @@ -191,32 +191,32 @@ public: RemoveAll(TRUE); CFX_BaseArray::AddSpaceTo(iCount - 1); FX_LPBYTE *pStart = CFX_BaseArray::GetAt(0); - FX_INT32 iBlockSize = CFX_BaseArray::GetBlockSize(); + int32_t iBlockSize = CFX_BaseArray::GetBlockSize(); iSize = iStart + iCount; - for (FX_INT32 i = iStart; i < iSize; i ++) { + for (int32_t i = iStart; i < iSize; i ++) { FXTARGET_New ((void*)pStart)baseType(src.GetAt(i)); pStart += iBlockSize; } return iCount; } - FX_INT32 RemoveLast(FX_INT32 iCount = -1) + int32_t RemoveLast(int32_t iCount = -1) { - FX_INT32 iSize = CFX_BaseArray::GetSize(); + int32_t iSize = CFX_BaseArray::GetSize(); if (iCount < 0 || iCount > iSize) { iCount = iSize; } if (iCount == 0) { return iSize; } - for (FX_INT32 i = iSize - iCount; i < iSize; i ++) { + for (int32_t i = iSize - iCount; i < iSize; i ++) { ((baseType*)GetPtrAt(i))->~baseType(); } return CFX_BaseArray::RemoveLast(iCount); } void RemoveAll(FX_BOOL bLeaveMemory = FALSE) { - FX_INT32 iSize = CFX_BaseArray::GetSize(); - for (FX_INT32 i = 0; i < iSize; i ++) { + int32_t iSize = CFX_BaseArray::GetSize(); + for (int32_t i = 0; i < iSize; i ++) { ((baseType*)GetPtrAt(i))->~baseType(); } CFX_BaseArray::RemoveAll(bLeaveMemory); @@ -225,14 +225,14 @@ public: class CFX_BaseMassArray : public CFX_Target { protected: - CFX_BaseMassArray(FX_INT32 iChunkSize, FX_INT32 iBlockSize); + CFX_BaseMassArray(int32_t iChunkSize, int32_t iBlockSize); ~CFX_BaseMassArray(); - FX_INT32 GetSize() const; - FX_LPBYTE AddSpaceTo(FX_INT32 index); - FX_LPBYTE GetAt(FX_INT32 index) const; - FX_INT32 Append(const CFX_BaseMassArray &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1); - FX_INT32 Copy(const CFX_BaseMassArray &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1); - FX_INT32 RemoveLast(FX_INT32 iCount = -1); + int32_t GetSize() const; + FX_LPBYTE AddSpaceTo(int32_t index); + FX_LPBYTE GetAt(int32_t index) const; + int32_t Append(const CFX_BaseMassArray &src, int32_t iStart = 0, int32_t iCount = -1); + int32_t Copy(const CFX_BaseMassArray &src, int32_t iStart = 0, int32_t iCount = -1); + int32_t RemoveLast(int32_t iCount = -1); void RemoveAll(FX_BOOL bLeaveMemory = FALSE); CFX_BaseMassArrayImp* m_pData; }; @@ -240,9 +240,9 @@ template class CFX_MassArrayTemplate : public CFX_BaseMassArray { public: - CFX_MassArrayTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {} - CFX_MassArrayTemplate(FX_INT32 iChunkSize, FX_INT32 iBlockSize) : CFX_BaseMassArray(iChunkSize, iBlockSize) {} - FX_INT32 GetSize() const + CFX_MassArrayTemplate(int32_t iChunkSize = 100) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {} + CFX_MassArrayTemplate(int32_t iChunkSize, int32_t iBlockSize) : CFX_BaseMassArray(iChunkSize, iBlockSize) {} + int32_t GetSize() const { return CFX_BaseMassArray::GetSize(); } @@ -250,37 +250,37 @@ public: { return (baseType*)CFX_BaseMassArray::AddSpaceTo(CFX_BaseMassArray::GetSize()); } - FX_INT32 Add(const baseType &element) + int32_t Add(const baseType &element) { - FX_INT32 index = CFX_BaseMassArray::GetSize(); + int32_t index = CFX_BaseMassArray::GetSize(); *(baseType*)CFX_BaseMassArray::AddSpaceTo(index) = element; return index; } - baseType& GetAt(FX_INT32 index) const + baseType& GetAt(int32_t index) const { return *(baseType*)CFX_BaseMassArray::GetAt(index); } - baseType* GetPtrAt(FX_INT32 index) const + baseType* GetPtrAt(int32_t index) const { return (baseType*)CFX_BaseMassArray::GetAt(index); } - void SetAt(FX_INT32 index, const baseType &element) + void SetAt(int32_t index, const baseType &element) { *(baseType*)CFX_BaseMassArray::GetAt(index) = element; } - void SetAtGrow(FX_INT32 index, const baseType &element) + void SetAtGrow(int32_t index, const baseType &element) { *(baseType*)CFX_BaseMassArray::AddSpaceTo(index) = element; } - FX_INT32 Append(const CFX_MassArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1) + int32_t Append(const CFX_MassArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1) { return CFX_BaseMassArray::Append(src, iStart, iCount); } - FX_INT32 Copy(const CFX_MassArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1) + int32_t Copy(const CFX_MassArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1) { return CFX_BaseMassArray::Copy(src, iStart, iCount); } - FX_INT32 RemoveLast(FX_INT32 iCount = -1) + int32_t RemoveLast(int32_t iCount = -1) { return CFX_BaseMassArray::RemoveLast(iCount); } @@ -290,7 +290,7 @@ public: } }; typedef CFX_MassArrayTemplate CFX_PtrMassArray; -typedef CFX_MassArrayTemplate CFX_Int32MassArray; +typedef CFX_MassArrayTemplate CFX_Int32MassArray; typedef CFX_MassArrayTemplate CFX_DWordMassArray; typedef CFX_MassArrayTemplate CFX_WordMassArray; typedef CFX_MassArrayTemplate CFX_RectMassArray; @@ -299,87 +299,87 @@ template class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray { public: - CFX_ObjectMassArrayTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {} + CFX_ObjectMassArrayTemplate(int32_t iChunkSize = 100) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {} ~CFX_ObjectMassArrayTemplate() { RemoveAll(FALSE); } - FX_INT32 GetSize() const + int32_t GetSize() const { return CFX_BaseMassArray::GetSize(); } - FX_INT32 Add(const baseType &element) + int32_t Add(const baseType &element) { - FX_INT32 index = CFX_BaseMassArray::GetSize(); + int32_t index = CFX_BaseMassArray::GetSize(); baseType *p = (baseType*)CFX_BaseMassArray::AddSpaceTo(index); FXTARGET_New ((void*)p)baseType(element); return index; } - baseType& GetAt(FX_INT32 index) const + baseType& GetAt(int32_t index) const { return *(baseType*)CFX_BaseMassArray::GetAt(index); } - baseType* GetPtrAt(FX_INT32 index) const + baseType* GetPtrAt(int32_t index) const { return (baseType*)CFX_BaseMassArray::GetAt(index); } - FX_INT32 Append(const CFX_ObjectMassArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1) + int32_t Append(const CFX_ObjectMassArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1) { if (iCount == 0) { return CFX_BaseMassArray::GetSize(); } - FX_INT32 iSize = src.GetSize(); + int32_t iSize = src.GetSize(); FXSYS_assert(iStart > -1 && iStart < iSize); if (iCount < 0) { iCount = iSize; } - FX_INT32 iEnd = iStart + iCount; + int32_t iEnd = iStart + iCount; if (iEnd > iSize) { iEnd = iSize; } - for (FX_INT32 i = iStart; i < iEnd; i ++) { + for (int32_t i = iStart; i < iEnd; i ++) { Add(src.GetAt(i)); } return CFX_BaseMassArray::GetSize(); } - FX_INT32 Copy(const CFX_ObjectMassArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1) + int32_t Copy(const CFX_ObjectMassArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1) { if (iCount == 0) { return CFX_BaseMassArray::GetSize(); } - FX_INT32 iSize = src.GetSize(); + int32_t iSize = src.GetSize(); FXSYS_assert(iStart > -1 && iStart < iSize); if (iCount < 0) { iCount = iSize; } - FX_INT32 iEnd = iStart + iCount; + int32_t iEnd = iStart + iCount; if (iEnd > iSize) { iEnd = iSize; } RemoveAll(TRUE); - for (FX_INT32 i = iStart; i < iEnd; i ++) { + for (int32_t i = iStart; i < iEnd; i ++) { Add(src.GetAt(i)); } return CFX_BaseMassArray::GetSize(); } - FX_INT32 RemoveLast(FX_INT32 iCount = -1) + int32_t RemoveLast(int32_t iCount = -1) { - FX_INT32 iSize = CFX_BaseMassArray::GetSize(); + int32_t iSize = CFX_BaseMassArray::GetSize(); if (iCount < 0 || iCount > iSize) { iCount = iSize; } if (iCount == 0) { return iSize; } - for (FX_INT32 i = iSize - iCount; i < iSize; i ++) { + for (int32_t i = iSize - iCount; i < iSize; i ++) { ((baseType*)GetPtrAt(i))->~baseType(); } return CFX_BaseMassArray::RemoveLast(iCount); } void RemoveAll(FX_BOOL bLeaveMemory = FALSE) { - FX_INT32 iSize = CFX_BaseMassArray::GetSize(); - for (FX_INT32 i = 0; i < iSize; i ++) { + int32_t iSize = CFX_BaseMassArray::GetSize(); + for (int32_t i = 0; i < iSize; i ++) { ((baseType*)GetPtrAt(i))->~baseType(); } CFX_BaseMassArray::RemoveAll(bLeaveMemory); @@ -388,10 +388,10 @@ public: class CFX_BaseDiscreteArray : public CFX_Target { protected: - CFX_BaseDiscreteArray(FX_INT32 iChunkSize, FX_INT32 iBlockSize); + CFX_BaseDiscreteArray(int32_t iChunkSize, int32_t iBlockSize); ~CFX_BaseDiscreteArray(); - FX_LPBYTE AddSpaceTo(FX_INT32 index); - FX_LPBYTE GetAt(FX_INT32 index) const; + FX_LPBYTE AddSpaceTo(int32_t index); + FX_LPBYTE GetAt(int32_t index) const; void RemoveAll(); FX_LPVOID m_pData; }; @@ -399,17 +399,17 @@ template class CFX_DiscreteArrayTemplate : public CFX_BaseDiscreteArray { public: - CFX_DiscreteArrayTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseDiscreteArray(iChunkSize, sizeof(baseType)) {} - baseType& GetAt(FX_INT32 index, const baseType &defValue) const + CFX_DiscreteArrayTemplate(int32_t iChunkSize = 100) : CFX_BaseDiscreteArray(iChunkSize, sizeof(baseType)) {} + baseType& GetAt(int32_t index, const baseType &defValue) const { baseType *p = (baseType*)CFX_BaseDiscreteArray::GetAt(index); return p == NULL ? (baseType&)defValue : *p; } - baseType* GetPtrAt(FX_INT32 index) const + baseType* GetPtrAt(int32_t index) const { return (baseType*)CFX_BaseDiscreteArray::GetAt(index); } - void SetAtGrow(FX_INT32 index, const baseType &element) + void SetAtGrow(int32_t index, const baseType &element) { *(baseType*)CFX_BaseDiscreteArray::AddSpaceTo(index) = element; } @@ -424,13 +424,13 @@ typedef CFX_DiscreteArrayTemplate CFX_WordDiscreteArray; class CFX_BaseStack : public CFX_Target { protected: - CFX_BaseStack(FX_INT32 iChunkSize, FX_INT32 iBlockSize); + CFX_BaseStack(int32_t iChunkSize, int32_t iBlockSize); ~CFX_BaseStack(); FX_LPBYTE Push(); void Pop(); FX_LPBYTE GetTopElement() const; - FX_INT32 GetSize() const; - FX_LPBYTE GetAt(FX_INT32 index) const; + int32_t GetSize() const; + FX_LPBYTE GetAt(int32_t index) const; void RemoveAll(FX_BOOL bLeaveMemory = FALSE); CFX_BaseMassArrayImp* m_pData; }; @@ -438,10 +438,10 @@ template class CFX_StackTemplate : public CFX_BaseStack { public: - CFX_StackTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {} - FX_INT32 Push(const baseType &element) + CFX_StackTemplate(int32_t iChunkSize = 100) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {} + int32_t Push(const baseType &element) { - FX_INT32 index = CFX_BaseStack::GetSize(); + int32_t index = CFX_BaseStack::GetSize(); *(baseType*)CFX_BaseStack::Push() = element; return index; } @@ -453,11 +453,11 @@ public: { return (baseType*)CFX_BaseStack::GetTopElement(); } - FX_INT32 GetSize() const + int32_t GetSize() const { return CFX_BaseStack::GetSize(); } - baseType* GetAt(FX_INT32 index) const + baseType* GetAt(int32_t index) const { return (baseType*)CFX_BaseStack::GetAt(index); } @@ -469,19 +469,19 @@ public: typedef CFX_StackTemplate CFX_PtrStack; typedef CFX_StackTemplate CFX_DWordStack; typedef CFX_StackTemplate CFX_WordStack; -typedef CFX_StackTemplate CFX_Int32Stack; +typedef CFX_StackTemplate CFX_Int32Stack; template class CFX_ObjectStackTemplate : public CFX_BaseStack { public: - CFX_ObjectStackTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {} + CFX_ObjectStackTemplate(int32_t iChunkSize = 100) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {} ~CFX_ObjectStackTemplate() { RemoveAll(); } - FX_INT32 Push(const baseType &element) + int32_t Push(const baseType &element) { - FX_INT32 index = CFX_BaseStack::GetSize(); + int32_t index = CFX_BaseStack::GetSize(); baseType *p = (baseType*)CFX_BaseStack::Push(); FXTARGET_New ((void*)p)baseType(element); return index; @@ -498,38 +498,38 @@ public: { return (baseType*)CFX_BaseStack::GetTopElement(); } - FX_INT32 GetSize() const + int32_t GetSize() const { return CFX_BaseStack::GetSize(); } - baseType* GetAt(FX_INT32 index) const + baseType* GetAt(int32_t index) const { return (baseType*)CFX_BaseStack::GetAt(index); } void RemoveAll(FX_BOOL bLeaveMemory = FALSE) { - FX_INT32 iSize = CFX_BaseStack::GetSize(); - for (FX_INT32 i = 0; i < iSize; i ++) { + int32_t iSize = CFX_BaseStack::GetSize(); + for (int32_t i = 0; i < iSize; i ++) { ((baseType*)CFX_BaseStack::GetAt(i))->~baseType(); } CFX_BaseStack::RemoveAll(bLeaveMemory); } - FX_INT32 Copy(const CFX_ObjectStackTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1) + int32_t Copy(const CFX_ObjectStackTemplate &src, int32_t iStart = 0, int32_t iCount = -1) { if (iCount == 0) { return CFX_BaseStack::GetSize(); } - FX_INT32 iSize = src.GetSize(); + int32_t iSize = src.GetSize(); FXSYS_assert(iStart > -1 && iStart < iSize); if (iCount < 0) { iCount = iSize; } - FX_INT32 iEnd = iStart + iCount; + int32_t iEnd = iStart + iCount; if (iEnd > iSize) { iEnd = iSize; } RemoveAll(TRUE); - for (FX_INT32 i = iStart; i < iEnd; i ++) { + for (int32_t i = iStart; i < iEnd; i ++) { Push(*src.GetAt(i)); } return CFX_BaseStack::GetSize(); @@ -659,9 +659,9 @@ public: { m_pParentNode = pNode; } - FX_INT32 CountChildNodes() const + int32_t CountChildNodes() const { - FX_INT32 iCount = 0; + int32_t iCount = 0; CPLTreeNode *pNode = m_pChildNode; while (pNode) { iCount ++; @@ -669,9 +669,9 @@ public: } return iCount; } - CPLTreeNode* GetChildNode(FX_INT32 iIndex) const + CPLTreeNode* GetChildNode(int32_t iIndex) const { - FX_INT32 iCount = 0; + int32_t iCount = 0; CPLTreeNode *pNode = m_pChildNode; while (pNode) { if (iIndex == iCount) { @@ -682,9 +682,9 @@ public: } return NULL; } - FX_INT32 GetNodeIndex() const + int32_t GetNodeIndex() const { - FX_INT32 index = 0; + int32_t index = 0; CPLTreeNode *pNode = m_pPrevNode; while (pNode != NULL) { index ++; @@ -722,9 +722,9 @@ public: { m_pNextNode = pNode; } - FX_INT32 GetNodeLevel() const + int32_t GetNodeLevel() const { - FX_INT32 iLevel = 0; + int32_t iLevel = 0; CPLTreeNode *pNode = (CPLTreeNode*)this; while ((pNode = pNode->m_pParentNode) != NULL) { iLevel ++; diff --git a/xfa/src/fgas/src/crt/fx_algorithm.cpp b/xfa/src/fgas/src/crt/fx_algorithm.cpp index e2d77d1a0e..86a6095d45 100644 --- a/xfa/src/fgas/src/crt/fx_algorithm.cpp +++ b/xfa/src/fgas/src/crt/fx_algorithm.cpp @@ -29,7 +29,7 @@ typedef struct _FX_BASE64DATA { FX_DWORD data7 : 8; } FX_BASE64DATA, * FX_LPBASE64ENCODEDATA; typedef FX_BASE64DATA const * FX_LPCBASE64DATA; -static void FX_Base64EncodePiece(const FX_BASE64DATA &src, FX_INT32 iBytes, FX_CHAR dst[4]) +static void FX_Base64EncodePiece(const FX_BASE64DATA &src, int32_t iBytes, FX_CHAR dst[4]) { dst[0] = g_FXBase64EncoderMap[src.data2]; FX_DWORD b = src.data1 << 4; @@ -52,21 +52,21 @@ static void FX_Base64EncodePiece(const FX_BASE64DATA &src, FX_INT32 iBytes, FX_C dst[2] = dst[3] = '='; } } -FX_INT32 FX_Base64EncodeA(FX_LPCBYTE pSrc, FX_INT32 iSrcLen, FX_LPSTR pDst) +int32_t FX_Base64EncodeA(FX_LPCBYTE pSrc, int32_t iSrcLen, FX_LPSTR pDst) { FXSYS_assert(pSrc != NULL); if (iSrcLen < 1) { return 0; } if (pDst == NULL) { - FX_INT32 iDstLen = iSrcLen / 3 * 4; + int32_t iDstLen = iSrcLen / 3 * 4; if ((iSrcLen % 3) != 0) { iDstLen += 4; } return iDstLen; } FX_BASE64DATA srcData; - FX_INT32 iBytes = 3; + int32_t iBytes = 3; FX_LPSTR pDstEnd = pDst; while (iSrcLen > 0) { if (iSrcLen > 2) { @@ -88,7 +88,7 @@ FX_INT32 FX_Base64EncodeA(FX_LPCBYTE pSrc, FX_INT32 iSrcLen, FX_LPSTR pDst) } return pDstEnd - pDst; } -const static FX_BYTE g_FXBase64DecoderMap[256] = { +const static uint8_t g_FXBase64DecoderMap[256] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, @@ -122,23 +122,23 @@ const static FX_BYTE g_FXBase64DecoderMap[256] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; -static void FX_Base64DecodePiece(const FX_CHAR src[4], FX_INT32 iChars, FX_BASE64DATA &dst, FX_INT32 &iBytes) +static void FX_Base64DecodePiece(const FX_CHAR src[4], int32_t iChars, FX_BASE64DATA &dst, int32_t &iBytes) { FXSYS_assert(iChars > 0 && iChars < 5); iBytes = 1; - dst.data2 = g_FXBase64DecoderMap[(FX_BYTE)src[0]]; + dst.data2 = g_FXBase64DecoderMap[(uint8_t)src[0]]; if (iChars > 1) { - FX_BYTE b = g_FXBase64DecoderMap[(FX_BYTE)src[1]]; + uint8_t b = g_FXBase64DecoderMap[(uint8_t)src[1]]; dst.data1 = b >> 4; dst.data4 = b; if (iChars > 2) { iBytes = 2; - b = g_FXBase64DecoderMap[(FX_BYTE)src[2]]; + b = g_FXBase64DecoderMap[(uint8_t)src[2]]; dst.data3 = b >> 2; dst.data6 = b; if (iChars > 3) { iBytes = 3; - dst.data5 = g_FXBase64DecoderMap[(FX_BYTE)src[3]]; + dst.data5 = g_FXBase64DecoderMap[(uint8_t)src[3]]; } else { dst.data5 = 0; } @@ -149,7 +149,7 @@ static void FX_Base64DecodePiece(const FX_CHAR src[4], FX_INT32 iChars, FX_BASE6 dst.data1 = 0; } } -FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) +int32_t FX_Base64DecodeA(FX_LPCSTR pSrc, int32_t iSrcLen, FX_LPBYTE pDst) { FXSYS_assert(pSrc != NULL); if (iSrcLen < 1) { @@ -162,7 +162,7 @@ FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) return 0; } if (pDst == NULL) { - FX_INT32 iDstLen = iSrcLen / 4 * 3; + int32_t iDstLen = iSrcLen / 4 * 3; iSrcLen %= 4; if (iSrcLen == 1) { iDstLen += 1; @@ -175,7 +175,7 @@ FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) } FX_CHAR srcData[4]; FX_BASE64DATA dstData; - FX_INT32 iChars = 4, iBytes; + int32_t iChars = 4, iBytes; FX_LPBYTE pDstEnd = pDst; while (iSrcLen > 0) { if (iSrcLen > 3) { @@ -206,7 +206,7 @@ FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) } return pDstEnd - pDst; } -FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) +int32_t FX_Base64DecodeW(FX_LPCWSTR pSrc, int32_t iSrcLen, FX_LPBYTE pDst) { FXSYS_assert(pSrc != NULL); if (iSrcLen < 1) { @@ -219,7 +219,7 @@ FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) return 0; } if (pDst == NULL) { - FX_INT32 iDstLen = iSrcLen / 4 * 3; + int32_t iDstLen = iSrcLen / 4 * 3; iSrcLen %= 4; if (iSrcLen == 1) { iDstLen += 1; @@ -232,7 +232,7 @@ FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) } FX_CHAR srcData[4]; FX_BASE64DATA dstData; - FX_INT32 iChars = 4, iBytes; + int32_t iChars = 4, iBytes; FX_LPBYTE pDstEnd = pDst; while (iSrcLen > 0) { if (iSrcLen > 3) { @@ -265,7 +265,7 @@ FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) } return pDstEnd - pDst; } -const static FX_BYTE g_FXHex2DecMap[256] = { +const static uint8_t g_FXHex2DecMap[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -283,11 +283,11 @@ const static FX_BYTE g_FXHex2DecMap[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -FX_BYTE FX_Hex2Dec(FX_BYTE hexHigh, FX_BYTE hexLow) +uint8_t FX_Hex2Dec(uint8_t hexHigh, uint8_t hexLow) { return (g_FXHex2DecMap[hexHigh] << 4) + g_FXHex2DecMap[hexLow]; } -FX_INT32 FX_SeparateStringW(FX_LPCWSTR pStr, FX_INT32 iStrLen, FX_WCHAR delimiter, CFX_WideStringArray &pieces) +int32_t FX_SeparateStringW(FX_LPCWSTR pStr, int32_t iStrLen, FX_WCHAR delimiter, CFX_WideStringArray &pieces) { if (pStr == NULL) { return 0; diff --git a/xfa/src/fgas/src/crt/fx_codepage.cpp b/xfa/src/fgas/src/crt/fx_codepage.cpp index 798edc9776..239fa8874c 100644 --- a/xfa/src/fgas/src/crt/fx_codepage.cpp +++ b/xfa/src/fgas/src/crt/fx_codepage.cpp @@ -39,11 +39,11 @@ static const FX_CHARSET_MAP g_FXCharset2CodePageTable[] = { { 254, 437 }, { 255, 850 }, }; -FX_WORD FX_GetCodePageFromCharset(FX_BYTE charset) +FX_WORD FX_GetCodePageFromCharset(uint8_t charset) { - FX_INT32 iEnd = sizeof(g_FXCharset2CodePageTable) / sizeof(FX_CHARSET_MAP) - 1; + int32_t iEnd = sizeof(g_FXCharset2CodePageTable) / sizeof(FX_CHARSET_MAP) - 1; FXSYS_assert(iEnd >= 0); - FX_INT32 iStart = 0, iMid; + int32_t iStart = 0, iMid; do { iMid = (iStart + iEnd) / 2; const FX_CHARSET_MAP & cp = g_FXCharset2CodePageTable[iMid]; @@ -92,9 +92,9 @@ static const FX_CHARSET_MAP g_FXCodepage2CharsetTable[] = { }; FX_WORD FX_GetCharsetFromCodePage(FX_WORD codepage) { - FX_INT32 iEnd = sizeof(g_FXCodepage2CharsetTable) / sizeof(FX_CHARSET_MAP) - 1; + int32_t iEnd = sizeof(g_FXCodepage2CharsetTable) / sizeof(FX_CHARSET_MAP) - 1; FXSYS_assert(iEnd >= 0); - FX_INT32 iStart = 0, iMid; + int32_t iStart = 0, iMid; do { iMid = (iStart + iEnd) / 2; const FX_CHARSET_MAP & cp = g_FXCodepage2CharsetTable[iMid]; @@ -247,9 +247,9 @@ const FX_LANG2CPMAP g_FXLang2CodepageTable[] = { }; FX_WORD FX_GetDefCodePageByLanguage(FX_WORD wLanguage) { - FX_INT32 iEnd = sizeof(g_FXLang2CodepageTable) / sizeof(FX_LANG2CPMAP) - 1; + int32_t iEnd = sizeof(g_FXLang2CodepageTable) / sizeof(FX_LANG2CPMAP) - 1; FXSYS_assert(iEnd >= 0); - FX_INT32 iStart = 0, iMid; + int32_t iStart = 0, iMid; do { iMid = (iStart + iEnd) / 2; const FX_LANG2CPMAP &cp = g_FXLang2CodepageTable[iMid]; @@ -329,7 +329,7 @@ static const FX_STR2CPHASH g_FXCPHashTable[] = { { 0xf2a9730b, 0x3a8 }, { 0xf3d463c2, 0x3a4 }, { 0xf52a70a3, 0xc42e }, { 0xf5693147, 0x6fb3 }, { 0xf637e157, 0x478 }, { 0xfc213f3a, 0x2717 }, { 0xff654d14, 0x3b5 }, }; -FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, FX_INT32 iLength) +FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, int32_t iLength) { FXSYS_assert(pStr != NULL); if (iLength < 0) { @@ -338,9 +338,9 @@ FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, FX_INT32 iLength) if (iLength == 0) { return 0xFFFF; } - FX_UINT32 uHash = FX_HashCode_String_GetA(pStr, iLength, TRUE); - FX_INT32 iStart = 0, iMid; - FX_INT32 iEnd = sizeof(g_FXCPHashTable) / sizeof(FX_STR2CPHASH) - 1; + uint32_t uHash = FX_HashCode_String_GetA(pStr, iLength, TRUE); + int32_t iStart = 0, iMid; + int32_t iEnd = sizeof(g_FXCPHashTable) / sizeof(FX_STR2CPHASH) - 1; FXSYS_assert(iEnd >= 0); do { iMid = (iStart + iEnd) / 2; @@ -355,7 +355,7 @@ FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, FX_INT32 iLength) } while (iStart <= iEnd); return 0xFFFF; } -FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, FX_INT32 iLength) +FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, int32_t iLength) { if (iLength < 0) { iLength = FXSYS_wcslen(pStr); @@ -365,7 +365,7 @@ FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, FX_INT32 iLength) } CFX_ByteString csStr; FX_LPSTR pBuf = csStr.GetBuffer(iLength + 1); - for (FX_INT32 i = 0; i < iLength; ++i) { + for (int32_t i = 0; i < iLength; ++i) { *pBuf ++ = (FX_CHAR) * pStr ++; } csStr.ReleaseBuffer(iLength); diff --git a/xfa/src/fgas/src/crt/fx_cpmgr.cpp b/xfa/src/fgas/src/crt/fx_cpmgr.cpp index 7bb2aa4a8d..e57273d614 100644 --- a/xfa/src/fgas/src/crt/fx_cpmgr.cpp +++ b/xfa/src/fgas/src/crt/fx_cpmgr.cpp @@ -41,10 +41,10 @@ extern const FX_CPCU_MAPINFO g_CP1257_CUMap; extern const FX_CPCU_MAPINFO g_CP1258_CUMap; FX_LPCCODEPAGE FX_GetCodePage(FX_WORD wCodePage) { - FX_INT32 iEnd = sizeof(g_FXCodePageMgr) / sizeof(FX_CODEPAGE) - 1; + int32_t iEnd = sizeof(g_FXCodePageMgr) / sizeof(FX_CODEPAGE) - 1; FXSYS_assert(iEnd >= 0); - FX_INT32 iStart = 0, iMid; - FX_UINT16 uCPID; + int32_t iStart = 0, iMid; + uint16_t uCPID; do { iMid = (iStart + iEnd) / 2; const FX_CODEPAGE &cp = g_FXCodePageMgr[iMid]; diff --git a/xfa/src/fgas/src/crt/fx_encode.cpp b/xfa/src/fgas/src/crt/fx_encode.cpp index 892b5a9059..9de79e3649 100644 --- a/xfa/src/fgas/src/crt/fx_encode.cpp +++ b/xfa/src/fgas/src/crt/fx_encode.cpp @@ -6,7 +6,7 @@ #include "../fgas_base.h" #include "fx_codepage.h" -void FX_SwapByteOrder(FX_LPWSTR pStr, FX_INT32 iLength) +void FX_SwapByteOrder(FX_LPWSTR pStr, int32_t iLength) { FXSYS_assert(pStr != NULL); if (iLength < 0) { @@ -28,7 +28,7 @@ void FX_SwapByteOrder(FX_LPWSTR pStr, FX_INT32 iLength) } } } -void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, FX_INT32 iLength) +void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, int32_t iLength) { FXSYS_assert(pSrc != NULL && pDst != NULL); if (iLength < 0) { @@ -50,7 +50,7 @@ void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, FX_INT32 iLength) } } } -void FX_UTF16ToWChar(FX_LPVOID pBuffer, FX_INT32 iLength) +void FX_UTF16ToWChar(FX_LPVOID pBuffer, int32_t iLength) { FXSYS_assert(pBuffer != NULL && iLength > 0); if (sizeof(FX_WCHAR) == 2) { @@ -62,7 +62,7 @@ void FX_UTF16ToWChar(FX_LPVOID pBuffer, FX_INT32 iLength) pDst[iLength] = (FX_WCHAR)pSrc[iLength]; } } -void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, FX_INT32 iLength) +void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, int32_t iLength) { FXSYS_assert(pUTF16 != NULL && pWChar != NULL && iLength > 0); if (sizeof(FX_WCHAR) == 2) { @@ -73,7 +73,7 @@ void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, FX_INT32 iLeng } } } -void FX_WCharToUTF16(FX_LPVOID pBuffer, FX_INT32 iLength) +void FX_WCharToUTF16(FX_LPVOID pBuffer, int32_t iLength) { FXSYS_assert(pBuffer != NULL && iLength > 0); if (sizeof(FX_WCHAR) == 2) { @@ -85,7 +85,7 @@ void FX_WCharToUTF16(FX_LPVOID pBuffer, FX_INT32 iLength) *pDst++ = (FX_WORD) * pSrc++; } } -void FX_WCharToUTF16Copy(FX_LPCWSTR pWChar, FX_WORD *pUTF16, FX_INT32 iLength) +void FX_WCharToUTF16Copy(FX_LPCWSTR pWChar, FX_WORD *pUTF16, int32_t iLength) { FXSYS_assert(pWChar != NULL && pUTF16 != NULL && iLength > 0); if (sizeof(FX_WCHAR) == 2) { @@ -104,33 +104,33 @@ inline FX_WORD FX_WordFromBytes(FX_LPCBYTE pStr) { return (pStr[1] << 8 | pStr[0]); } -FX_INT32 FX_DecodeString(FX_WORD wCodePage, FX_LPCSTR pSrc, FX_INT32 *pSrcLen, FX_LPWSTR pDst, FX_INT32 *pDstLen, FX_BOOL bErrBreak) +int32_t FX_DecodeString(FX_WORD wCodePage, FX_LPCSTR pSrc, int32_t *pSrcLen, FX_LPWSTR pDst, int32_t *pDstLen, FX_BOOL bErrBreak) { if (wCodePage == FX_CODEPAGE_UTF8) { return FX_UTF8Decode(pSrc, pSrcLen, pDst, pDstLen); } return -1; } -FX_INT32 FX_UTF8Decode(FX_LPCSTR pSrc, FX_INT32 *pSrcLen, FX_LPWSTR pDst, FX_INT32 *pDstLen) +int32_t FX_UTF8Decode(FX_LPCSTR pSrc, int32_t *pSrcLen, FX_LPWSTR pDst, int32_t *pDstLen) { if (pSrcLen == NULL || pDstLen == NULL) { return -1; } - FX_INT32 iSrcLen = *pSrcLen; + int32_t iSrcLen = *pSrcLen; if (iSrcLen < 1) { *pSrcLen = *pDstLen = 0; return 1; } - FX_INT32 iDstLen = *pDstLen; + int32_t iDstLen = *pDstLen; FX_BOOL bValidDst = (pDst != NULL && iDstLen > 0); FX_DWORD dwCode = 0; - FX_INT32 iPending = 0; - FX_INT32 iSrcNum = 0, iDstNum = 0; - FX_INT32 k = 0; - FX_INT32 iIndex = 0; + int32_t iPending = 0; + int32_t iSrcNum = 0, iDstNum = 0; + int32_t k = 0; + int32_t iIndex = 0; k = 1; while (iIndex < iSrcLen) { - FX_BYTE byte = (FX_BYTE) * (pSrc + iIndex); + uint8_t byte = (uint8_t) * (pSrc + iIndex); if (byte < 0x80) { iPending = 0; k = 1; diff --git a/xfa/src/fgas/src/crt/fx_memory.cpp b/xfa/src/fgas/src/crt/fx_memory.cpp index 12d081a645..9645852cb7 100644 --- a/xfa/src/fgas/src/crt/fx_memory.cpp +++ b/xfa/src/fgas/src/crt/fx_memory.cpp @@ -45,7 +45,7 @@ CFX_StaticStore::~CFX_StaticStore() FX_LPSTATICSTORECHUNK CFX_StaticStore::AllocChunk(size_t size) { FXSYS_assert(size != 0); - register FX_LPSTATICSTORECHUNK pChunk = (FX_LPSTATICSTORECHUNK)FX_Alloc(FX_BYTE, sizeof(FX_STATICSTORECHUNK) + size); + register FX_LPSTATICSTORECHUNK pChunk = (FX_LPSTATICSTORECHUNK)FX_Alloc(uint8_t, sizeof(FX_STATICSTORECHUNK) + size); if (pChunk == NULL) { return NULL; } @@ -106,8 +106,8 @@ CFX_FixedStore::~CFX_FixedStore() } FX_LPFIXEDSTORECHUNK CFX_FixedStore::AllocChunk() { - FX_INT32 iTotalSize = sizeof(FX_FIXEDSTORECHUNK) + m_iDefChunkSize + m_iBlockSize * m_iDefChunkSize; - register FX_LPFIXEDSTORECHUNK pChunk = (FX_LPFIXEDSTORECHUNK)FX_Alloc(FX_BYTE, iTotalSize); + int32_t iTotalSize = sizeof(FX_FIXEDSTORECHUNK) + m_iDefChunkSize + m_iBlockSize * m_iDefChunkSize; + register FX_LPFIXEDSTORECHUNK pChunk = (FX_LPFIXEDSTORECHUNK)FX_Alloc(uint8_t, iTotalSize); if (pChunk == NULL) { return NULL; } @@ -206,7 +206,7 @@ CFX_DynamicStore::~CFX_DynamicStore() FX_LPDYNAMICSTORECHUNK CFX_DynamicStore::AllocChunk(size_t size) { FXSYS_assert(size != 0); - register FX_LPDYNAMICSTORECHUNK pChunk = (FX_LPDYNAMICSTORECHUNK)FX_Alloc(FX_BYTE, sizeof(FX_DYNAMICSTORECHUNK) + sizeof(FX_DYNAMICSTOREBLOCK) * 2 + size); + register FX_LPDYNAMICSTORECHUNK pChunk = (FX_LPDYNAMICSTORECHUNK)FX_Alloc(uint8_t, sizeof(FX_DYNAMICSTORECHUNK) + sizeof(FX_DYNAMICSTOREBLOCK) * 2 + size); if (pChunk == NULL) { return NULL; } diff --git a/xfa/src/fgas/src/crt/fx_memory.h b/xfa/src/fgas/src/crt/fx_memory.h index 9121c32c0f..fa58429107 100644 --- a/xfa/src/fgas/src/crt/fx_memory.h +++ b/xfa/src/fgas/src/crt/fx_memory.h @@ -21,7 +21,7 @@ public: } virtual void* Alloc(size_t size) { - return FX_Alloc(FX_BYTE, size); + return FX_Alloc(uint8_t, size); } virtual void Free(void *pBlock) { diff --git a/xfa/src/fgas/src/crt/fx_stream.cpp b/xfa/src/fgas/src/crt/fx_stream.cpp index fff3fe1e86..009cb41f5a 100644 --- a/xfa/src/fgas/src/crt/fx_stream.cpp +++ b/xfa/src/fgas/src/crt/fx_stream.cpp @@ -6,7 +6,7 @@ #include "../fgas_base.h" #include "fx_stream.h" -IFX_Stream* IFX_Stream::CreateStream(IFX_BufferRead *pBufferRead, FX_DWORD dwAccess, FX_INT32 iFileSize, FX_BOOL bReleaseBufferRead ) +IFX_Stream* IFX_Stream::CreateStream(IFX_BufferRead *pBufferRead, FX_DWORD dwAccess, int32_t iFileSize, FX_BOOL bReleaseBufferRead ) { CFX_Stream *pSR = FX_NEW CFX_Stream; if (!pSR) { @@ -86,7 +86,7 @@ IFX_Stream* IFX_Stream::CreateStream(FX_LPCWSTR pszFileName, FX_DWORD dwAccess) } return pSR; } -IFX_Stream* IFX_Stream::CreateStream(FX_LPBYTE pData, FX_INT32 length, FX_DWORD dwAccess) +IFX_Stream* IFX_Stream::CreateStream(FX_LPBYTE pData, int32_t length, FX_DWORD dwAccess) { CFX_Stream *pSR = FX_NEW CFX_Stream; if (pSR == NULL) { @@ -216,18 +216,18 @@ FX_BOOL CFX_FileStreamImp::LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwAccess } return TRUE; } -FX_INT32 CFX_FileStreamImp::GetLength() const +int32_t CFX_FileStreamImp::GetLength() const { FXSYS_assert(m_hFile != NULL); return m_iLength; } -FX_INT32 CFX_FileStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) +int32_t CFX_FileStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { FXSYS_assert(m_hFile != NULL); FXSYS_fseek(m_hFile, iOffset, eSeek); return FXSYS_ftell(m_hFile); } -FX_INT32 CFX_FileStreamImp::GetPosition() +int32_t CFX_FileStreamImp::GetPosition() { FXSYS_assert(m_hFile != NULL); return FXSYS_ftell(m_hFile); @@ -237,26 +237,26 @@ FX_BOOL CFX_FileStreamImp::IsEOF() const FXSYS_assert(m_hFile != NULL); return FXSYS_ftell(m_hFile) >= m_iLength; } -FX_INT32 CFX_FileStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) +int32_t CFX_FileStreamImp::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) { FXSYS_assert(m_hFile != NULL); FXSYS_assert(pBuffer != NULL && iBufferSize > 0); return FXSYS_fread(pBuffer, 1, iBufferSize, m_hFile); } -FX_INT32 CFX_FileStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS) +int32_t CFX_FileStreamImp::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS) { FXSYS_assert(m_hFile != NULL); FXSYS_assert(pStr != NULL && iMaxLength > 0); if (m_iLength <= 0) { return 0; } - FX_INT32 iPosition = FXSYS_ftell(m_hFile); - FX_INT32 iLen = FX_MIN((m_iLength - iPosition) / 2, iMaxLength); + int32_t iPosition = FXSYS_ftell(m_hFile); + int32_t iLen = FX_MIN((m_iLength - iPosition) / 2, iMaxLength); if (iLen <= 0) { return 0; } iLen = FXSYS_fread(pStr, 2, iLen, m_hFile); - FX_INT32 iCount = 0; + int32_t iCount = 0; while (*pStr != L'\0' && iCount < iLen) { pStr ++, iCount ++; } @@ -267,26 +267,26 @@ FX_INT32 CFX_FileStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_B bEOS = (iPosition >= m_iLength); return iCount; } -FX_INT32 CFX_FileStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) +int32_t CFX_FileStreamImp::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) { FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); FXSYS_assert(pBuffer != NULL && iBufferSize > 0); - FX_INT32 iRet = FXSYS_fwrite(pBuffer, 1, iBufferSize, m_hFile); + int32_t iRet = FXSYS_fwrite(pBuffer, 1, iBufferSize, m_hFile); if (iRet != 0) { - FX_INT32 iPos = FXSYS_ftell(m_hFile); + int32_t iPos = FXSYS_ftell(m_hFile); if (iPos > m_iLength) { m_iLength = iPos; } } return iRet; } -FX_INT32 CFX_FileStreamImp::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) +int32_t CFX_FileStreamImp::WriteString(FX_LPCWSTR pStr, int32_t iLength) { FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); FXSYS_assert(pStr != NULL && iLength > 0); - FX_INT32 iRet = FXSYS_fwrite(pStr, 2, iLength, m_hFile); + int32_t iRet = FXSYS_fwrite(pStr, 2, iLength, m_hFile); if (iRet != 0) { - FX_INT32 iPos = FXSYS_ftell(m_hFile); + int32_t iPos = FXSYS_ftell(m_hFile); if (iPos > m_iLength) { m_iLength = iPos; } @@ -298,7 +298,7 @@ void CFX_FileStreamImp::Flush() FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); FXSYS_fflush(m_hFile); } -FX_BOOL CFX_FileStreamImp::SetLength(FX_INT32 iLength) +FX_BOOL CFX_FileStreamImp::SetLength(int32_t iLength) { FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); FX_BOOL bRet = FX_fsetsize(m_hFile, iLength); @@ -321,11 +321,11 @@ FX_BOOL CFX_FileReadStreamImp::LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD dw m_iLength = m_pFileRead->GetSize(); return TRUE; } -FX_INT32 CFX_FileReadStreamImp::GetLength() const +int32_t CFX_FileReadStreamImp::GetLength() const { return m_iLength; } -FX_INT32 CFX_FileReadStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) +int32_t CFX_FileReadStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { switch (eSeek) { case FX_STREAMSEEK_Begin: @@ -349,7 +349,7 @@ FX_BOOL CFX_FileReadStreamImp::IsEOF() const { return m_iPosition >= m_iLength; } -FX_INT32 CFX_FileReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) +int32_t CFX_FileReadStreamImp::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) { FXSYS_assert(m_pFileRead != NULL); FXSYS_assert(pBuffer != NULL && iBufferSize > 0); @@ -362,7 +362,7 @@ FX_INT32 CFX_FileReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize } return 0; } -FX_INT32 CFX_FileReadStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS) +int32_t CFX_FileReadStreamImp::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS) { FXSYS_assert(m_pFileRead != NULL); FXSYS_assert(pStr != NULL && iMaxLength > 0); @@ -370,7 +370,7 @@ FX_INT32 CFX_FileReadStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, if (iMaxLength <= 0) { return 0; } - FX_INT32 i = 0; + int32_t i = 0; while (i < iMaxLength && pStr[i] != L'\0') { ++i; } @@ -390,7 +390,7 @@ CFX_BufferReadStreamImp::~CFX_BufferReadStreamImp() m_pBufferRead->Release(); } } -FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead) +FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead) { FXSYS_assert(m_pBufferRead == NULL && pBufferRead != NULL); if (dwAccess & FX_STREAMACCESS_Write) { @@ -412,13 +412,13 @@ FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead *pBufferRead, FX_ } return TRUE; } -FX_INT32 CFX_BufferReadStreamImp::GetLength() const +int32_t CFX_BufferReadStreamImp::GetLength() const { return m_iBufferSize; } -FX_INT32 CFX_BufferReadStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) +int32_t CFX_BufferReadStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { - FX_INT32 iLength = GetLength(); + int32_t iLength = GetLength(); switch (eSeek) { case FX_STREAMSEEK_Begin: m_iPosition = iOffset; @@ -441,11 +441,11 @@ FX_BOOL CFX_BufferReadStreamImp::IsEOF() const { return m_pBufferRead ? m_pBufferRead->IsEOF() : TRUE; } -FX_INT32 CFX_BufferReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) +int32_t CFX_BufferReadStreamImp::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) { FXSYS_assert(m_pBufferRead != NULL); FXSYS_assert(pBuffer != NULL && iBufferSize > 0); - FX_INT32 iLength = GetLength(); + int32_t iLength = GetLength(); if (m_iPosition >= iLength) { return 0; } @@ -454,26 +454,26 @@ FX_INT32 CFX_BufferReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSi } FX_DWORD dwBlockOffset = m_pBufferRead->GetBlockOffset(); FX_DWORD dwBlockSize = m_pBufferRead->GetBlockSize(); - if (m_iPosition < (FX_INT32)dwBlockOffset) { + if (m_iPosition < (int32_t)dwBlockOffset) { if (!m_pBufferRead->ReadNextBlock(TRUE)) { return 0; } dwBlockOffset = m_pBufferRead->GetBlockOffset(); dwBlockSize = m_pBufferRead->GetBlockSize(); } - while (m_iPosition < (FX_INT32)dwBlockOffset || m_iPosition >= (FX_INT32)(dwBlockOffset + dwBlockSize)) { + while (m_iPosition < (int32_t)dwBlockOffset || m_iPosition >= (int32_t)(dwBlockOffset + dwBlockSize)) { if (m_pBufferRead->IsEOF() || !m_pBufferRead->ReadNextBlock(FALSE)) { break; } dwBlockOffset = m_pBufferRead->GetBlockOffset(); dwBlockSize = m_pBufferRead->GetBlockSize(); } - if (m_iPosition < (FX_INT32)dwBlockOffset || m_iPosition >= (FX_INT32)(dwBlockOffset + dwBlockSize)) { + if (m_iPosition < (int32_t)dwBlockOffset || m_iPosition >= (int32_t)(dwBlockOffset + dwBlockSize)) { return 0; } FX_LPCBYTE pBufferTmp = m_pBufferRead->GetBlockBuffer(); FX_DWORD dwOffsetTmp = m_iPosition - dwBlockOffset; - FX_DWORD dwCopySize = FX_MIN(iBufferSize, (FX_INT32)(dwBlockSize - dwOffsetTmp)); + FX_DWORD dwCopySize = FX_MIN(iBufferSize, (int32_t)(dwBlockSize - dwOffsetTmp)); FXSYS_memcpy(pBuffer, pBufferTmp + dwOffsetTmp, dwCopySize); dwOffsetTmp = dwCopySize; iBufferSize -= dwCopySize; @@ -492,7 +492,7 @@ FX_INT32 CFX_BufferReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSi m_iPosition += dwOffsetTmp; return dwOffsetTmp; } -FX_INT32 CFX_BufferReadStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS) +int32_t CFX_BufferReadStreamImp::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS) { FXSYS_assert(m_pBufferRead != NULL); FXSYS_assert(pStr != NULL && iMaxLength > 0); @@ -500,7 +500,7 @@ FX_INT32 CFX_BufferReadStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength if (iMaxLength <= 0) { return 0; } - FX_INT32 i = 0; + int32_t i = 0; while (i < iMaxLength && pStr[i] != L'\0') { ++i; } @@ -524,16 +524,16 @@ FX_BOOL CFX_FileWriteStreamImp::LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWOR m_pFileWrite = pFileWrite; return TRUE; } -FX_INT32 CFX_FileWriteStreamImp::GetLength() const +int32_t CFX_FileWriteStreamImp::GetLength() const { if (!m_pFileWrite) { return 0; } - return (FX_INT32)m_pFileWrite->GetSize(); + return (int32_t)m_pFileWrite->GetSize(); } -FX_INT32 CFX_FileWriteStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) +int32_t CFX_FileWriteStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { - FX_INT32 iLength = GetLength(); + int32_t iLength = GetLength(); switch (eSeek) { case FX_STREAMSEEK_Begin: m_iPosition = iOffset; @@ -556,7 +556,7 @@ FX_BOOL CFX_FileWriteStreamImp::IsEOF() const { return m_iPosition >= GetLength(); } -FX_INT32 CFX_FileWriteStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) +int32_t CFX_FileWriteStreamImp::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) { if (!m_pFileWrite) { return 0; @@ -566,7 +566,7 @@ FX_INT32 CFX_FileWriteStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferS } return iBufferSize; } -FX_INT32 CFX_FileWriteStreamImp::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) +int32_t CFX_FileWriteStreamImp::WriteString(FX_LPCWSTR pStr, int32_t iLength) { return WriteData((FX_LPCBYTE)pStr, iLength * sizeof(FX_WCHAR)); } @@ -584,7 +584,7 @@ CFX_BufferStreamImp::CFX_BufferStreamImp() , m_iLength(0) { } -FX_BOOL CFX_BufferStreamImp::LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess) +FX_BOOL CFX_BufferStreamImp::LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess) { FXSYS_assert(m_pData == NULL); FXSYS_assert(pData != NULL && iTotalSize > 0); @@ -595,12 +595,12 @@ FX_BOOL CFX_BufferStreamImp::LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX m_iLength = (dwAccess & FX_STREAMACCESS_Write) != 0 ? 0 : iTotalSize; return TRUE; } -FX_INT32 CFX_BufferStreamImp::GetLength() const +int32_t CFX_BufferStreamImp::GetLength() const { FXSYS_assert(m_pData != NULL); return m_iLength; } -FX_INT32 CFX_BufferStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) +int32_t CFX_BufferStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { FXSYS_assert(m_pData != NULL); if (eSeek == FX_STREAMSEEK_Begin) { @@ -618,7 +618,7 @@ FX_INT32 CFX_BufferStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) } return m_iPosition; } -FX_INT32 CFX_BufferStreamImp::GetPosition() +int32_t CFX_BufferStreamImp::GetPosition() { FXSYS_assert(m_pData != NULL); return m_iPosition; @@ -628,11 +628,11 @@ FX_BOOL CFX_BufferStreamImp::IsEOF() const FXSYS_assert(m_pData != NULL); return m_iPosition >= m_iLength; } -FX_INT32 CFX_BufferStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) +int32_t CFX_BufferStreamImp::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) { FXSYS_assert(m_pData != NULL); FXSYS_assert(pBuffer != NULL && iBufferSize > 0); - FX_INT32 iLen = FX_MIN(m_iLength - m_iPosition, iBufferSize); + int32_t iLen = FX_MIN(m_iLength - m_iPosition, iBufferSize); if (iLen <= 0) { return 0; } @@ -640,16 +640,16 @@ FX_INT32 CFX_BufferStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) m_iPosition += iLen; return iLen; } -FX_INT32 CFX_BufferStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS) +int32_t CFX_BufferStreamImp::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS) { FXSYS_assert(m_pData != NULL); FXSYS_assert(pStr != NULL && iMaxLength > 0); - FX_INT32 iLen = FX_MIN((m_iLength - m_iPosition) / 2, iMaxLength); + int32_t iLen = FX_MIN((m_iLength - m_iPosition) / 2, iMaxLength); if (iLen <= 0) { return 0; } FX_LPCWSTR pSrc = (FX_LPCWSTR)(FX_LPSTR)(m_pData + m_iPosition); - FX_INT32 iCount = 0; + int32_t iCount = 0; while (*pSrc != L'\0' && iCount < iLen) { *pStr ++ = *pSrc ++, iCount ++; } @@ -657,11 +657,11 @@ FX_INT32 CFX_BufferStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX bEOS = (*pSrc == L'\0') || (m_iPosition >= m_iLength); return iCount; } -FX_INT32 CFX_BufferStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) +int32_t CFX_BufferStreamImp::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) { FXSYS_assert(m_pData != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); FXSYS_assert(pBuffer != NULL && iBufferSize > 0); - FX_INT32 iLen = FX_MIN(m_iTotalSize - m_iPosition, iBufferSize); + int32_t iLen = FX_MIN(m_iTotalSize - m_iPosition, iBufferSize); if (iLen <= 0) { return 0; } @@ -672,11 +672,11 @@ FX_INT32 CFX_BufferStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize } return iLen; } -FX_INT32 CFX_BufferStreamImp::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) +int32_t CFX_BufferStreamImp::WriteString(FX_LPCWSTR pStr, int32_t iLength) { FXSYS_assert(m_pData != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); FXSYS_assert(pStr != NULL && iLength > 0); - FX_INT32 iLen = FX_MIN((m_iTotalSize - m_iPosition) / 2, iLength); + int32_t iLen = FX_MIN((m_iTotalSize - m_iPosition) / 2, iLength); if (iLen <= 0) { return 0; } @@ -718,7 +718,7 @@ CFX_TextStream::~CFX_TextStream() } void CFX_TextStream::InitStream() { - FX_INT32 iPosition = m_pStreamImp->GetPosition(); + int32_t iPosition = m_pStreamImp->GetPosition(); m_pStreamImp->Seek(FX_STREAMSEEK_Begin, 0); m_pStreamImp->ReadData((FX_LPBYTE)&m_dwBOM, 3); #if _FX_ENDIAN_ == _FX_LITTLE_ENDIAN_ @@ -777,15 +777,15 @@ FX_DWORD CFX_TextStream::GetAccessModes() const { return m_pStreamImp->GetAccessModes() | FX_STREAMACCESS_Text; } -FX_INT32 CFX_TextStream::GetLength() const +int32_t CFX_TextStream::GetLength() const { return m_pStreamImp->GetLength(); } -FX_INT32 CFX_TextStream::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) +int32_t CFX_TextStream::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { return m_pStreamImp->Seek(eSeek, iOffset); } -FX_INT32 CFX_TextStream::GetPosition() +int32_t CFX_TextStream::GetPosition() { return m_pStreamImp->GetPosition(); } @@ -793,11 +793,11 @@ FX_BOOL CFX_TextStream::IsEOF() const { return m_pStreamImp->IsEOF(); } -FX_INT32 CFX_TextStream::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) +int32_t CFX_TextStream::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) { return m_pStreamImp->ReadData(pBuffer, iBufferSize); } -FX_INT32 CFX_TextStream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) +int32_t CFX_TextStream::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) { return m_pStreamImp->WriteData(pBuffer, iBufferSize); } @@ -805,7 +805,7 @@ void CFX_TextStream::Flush() { m_pStreamImp->Flush(); } -FX_BOOL CFX_TextStream::SetLength(FX_INT32 iLength) +FX_BOOL CFX_TextStream::SetLength(int32_t iLength) { return m_pStreamImp->SetLength(iLength); } @@ -813,7 +813,7 @@ FX_WORD CFX_TextStream::GetCodePage() const { return m_wCodePage; } -IFX_Stream* CFX_TextStream::CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength) +IFX_Stream* CFX_TextStream::CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength) { IFX_Stream *pSR = m_pStreamImp->CreateSharedStream(dwAccess, iOffset, iLength); if (pSR == NULL) { @@ -829,13 +829,13 @@ IFX_Stream* CFX_TextStream::CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffs } return pSR; } -FX_INT32 CFX_TextStream::GetBOM(FX_BYTE bom[4]) const +int32_t CFX_TextStream::GetBOM(uint8_t bom[4]) const { if (m_wBOMLength < 1) { return 0; } *(FX_DWORD*)bom = m_dwBOM; - return (FX_INT32)m_wBOMLength; + return (int32_t)m_wBOMLength; } FX_WORD CFX_TextStream::SetCodePage(FX_WORD wCodePage) { @@ -846,15 +846,15 @@ FX_WORD CFX_TextStream::SetCodePage(FX_WORD wCodePage) m_wCodePage = wCodePage; return v; } -FX_INT32 CFX_TextStream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize) +int32_t CFX_TextStream::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize) { FXSYS_assert(pStr != NULL && iMaxLength > 0); if (m_pStreamImp == NULL) { return -1; } - FX_INT32 iLen; + int32_t iLen; if (m_wCodePage == FX_CODEPAGE_UTF16LE || m_wCodePage == FX_CODEPAGE_UTF16BE) { - FX_INT32 iBytes = pByteSize == NULL ? iMaxLength * 2 : *pByteSize; + int32_t iBytes = pByteSize == NULL ? iMaxLength * 2 : *pByteSize; m_pStreamImp->Lock(); iLen = m_pStreamImp->ReadData((FX_LPBYTE)pStr, iBytes); m_pStreamImp->Unlock(); @@ -872,21 +872,21 @@ FX_INT32 CFX_TextStream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL } #endif } else { - FX_INT32 pos = m_pStreamImp->GetPosition(); - FX_INT32 iBytes = pByteSize == NULL ? iMaxLength : *pByteSize; + int32_t pos = m_pStreamImp->GetPosition(); + int32_t iBytes = pByteSize == NULL ? iMaxLength : *pByteSize; iBytes = FX_MIN(iBytes, m_pStreamImp->GetLength() - pos); if (iBytes > 0) { if (m_pBuf == NULL) { - m_pBuf = (FX_LPBYTE)FX_Alloc(FX_BYTE, iBytes); + m_pBuf = (FX_LPBYTE)FX_Alloc(uint8_t, iBytes); m_iBufSize = iBytes; } else if (iBytes > m_iBufSize) { - m_pBuf = (FX_LPBYTE)FX_Realloc(FX_BYTE, m_pBuf, iBytes); + m_pBuf = (FX_LPBYTE)FX_Realloc(uint8_t, m_pBuf, iBytes); m_iBufSize = iBytes; } m_pStreamImp->Lock(); iLen = m_pStreamImp->ReadData(m_pBuf, iBytes); - FX_INT32 iSrc = iLen; - FX_INT32 iDecode = FX_DecodeString(m_wCodePage, (FX_LPCSTR)m_pBuf, &iSrc, pStr, &iMaxLength, TRUE); + int32_t iSrc = iLen; + int32_t iDecode = FX_DecodeString(m_wCodePage, (FX_LPCSTR)m_pBuf, &iSrc, pStr, &iMaxLength, TRUE); m_pStreamImp->Seek(FX_STREAMSEEK_Current, iSrc - iLen); m_pStreamImp->Unlock(); if (iDecode < 1) { @@ -899,14 +899,14 @@ FX_INT32 CFX_TextStream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL bEOS = m_pStreamImp->IsEOF(); return iMaxLength; } -FX_INT32 CFX_TextStream::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) +int32_t CFX_TextStream::WriteString(FX_LPCWSTR pStr, int32_t iLength) { FXSYS_assert(pStr != NULL && iLength > 0); if ((m_pStreamImp->GetAccessModes() & FX_STREAMACCESS_Write) == 0) { return -1; } if (m_wCodePage == FX_CODEPAGE_UTF8) { - FX_INT32 len = iLength; + int32_t len = iLength; CFX_UTF8Encoder encoder; while (len -- > 0) { encoder.Input(*pStr ++); @@ -1004,7 +1004,7 @@ FX_BOOL CFX_Stream::LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWORD dwAccess) } return bRet; } -FX_BOOL CFX_Stream::LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess) +FX_BOOL CFX_Stream::LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess) { if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp != NULL) { return FALSE; @@ -1027,7 +1027,7 @@ FX_BOOL CFX_Stream::LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dw } return bRet; } -FX_BOOL CFX_Stream::LoadBufferRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead) +FX_BOOL CFX_Stream::LoadBufferRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead) { if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp != NULL) { return FALSE; @@ -1061,7 +1061,7 @@ IFX_Stream* CFX_Stream::Retain() m_iRefCount++; return this; } -FX_INT32 CFX_Stream::GetLength() const +int32_t CFX_Stream::GetLength() const { if (m_pStreamImp == NULL) { return -1; @@ -1071,7 +1071,7 @@ FX_INT32 CFX_Stream::GetLength() const } return m_iLength; } -FX_INT32 CFX_Stream::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) +int32_t CFX_Stream::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { if (m_pStreamImp == NULL) { return -1; @@ -1079,8 +1079,8 @@ FX_INT32 CFX_Stream::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) if (m_eStreamType == FX_STREAMTYPE_File || m_eStreamType == FX_STREAMTYPE_Buffer) { return m_iPosition = m_pStreamImp->Seek(eSeek, iOffset); } - FX_INT32 iEnd = m_iStart + m_iLength; - FX_INT32 iPosition = m_iStart + iOffset; + int32_t iEnd = m_iStart + m_iLength; + int32_t iPosition = m_iStart + iOffset; if (eSeek == FX_STREAMSEEK_Begin) { m_iPosition = iPosition; } else if (eSeek == FX_STREAMSEEK_Current) { @@ -1096,7 +1096,7 @@ FX_INT32 CFX_Stream::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) } return m_iPosition - m_iStart; } -FX_INT32 CFX_Stream::GetPosition() +int32_t CFX_Stream::GetPosition() { if (m_pStreamImp == NULL) { return -1; @@ -1116,13 +1116,13 @@ FX_BOOL CFX_Stream::IsEOF() const } return m_iPosition >= m_iStart + m_iLength; } -FX_INT32 CFX_Stream::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) +int32_t CFX_Stream::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) { FXSYS_assert(pBuffer != NULL && iBufferSize > 0); if (m_pStreamImp == NULL) { return -1; } - FX_INT32 iLen = FX_MIN(m_iStart + m_iLength - m_iPosition, iBufferSize); + int32_t iLen = FX_MIN(m_iStart + m_iLength - m_iPosition, iBufferSize); if (iLen <= 0) { return 0; } @@ -1135,14 +1135,14 @@ FX_INT32 CFX_Stream::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) m_pStreamImp->Unlock(); return iLen; } -FX_INT32 CFX_Stream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize) +int32_t CFX_Stream::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize) { FXSYS_assert(pStr != NULL && iMaxLength > 0); if (m_pStreamImp == NULL) { return -1; } - FX_INT32 iEnd = m_iStart + m_iLength; - FX_INT32 iLen = iEnd - m_iPosition; + int32_t iEnd = m_iStart + m_iLength; + int32_t iLen = iEnd - m_iPosition; if (pByteSize != NULL) { iLen = FX_MIN(iLen, *pByteSize); } @@ -1162,7 +1162,7 @@ FX_INT32 CFX_Stream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bE m_pStreamImp->Unlock(); return iLen; } -FX_INT32 CFX_Stream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) +int32_t CFX_Stream::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) { FXSYS_assert(pBuffer != NULL && iBufferSize > 0); if (m_pStreamImp == NULL) { @@ -1171,7 +1171,7 @@ FX_INT32 CFX_Stream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) if ((m_dwAccess & FX_STREAMACCESS_Write) == 0) { return -1; } - FX_INT32 iLen = iBufferSize; + int32_t iLen = iBufferSize; if (m_eStreamType == FX_STREAMTYPE_Stream) { iLen = FX_MIN(m_iStart + m_iTotalSize - m_iPosition, iBufferSize); if (iLen <= 0) { @@ -1179,7 +1179,7 @@ FX_INT32 CFX_Stream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) } } m_pStreamImp->Lock(); - FX_INT32 iEnd = m_iStart + m_iLength; + int32_t iEnd = m_iStart + m_iLength; if (m_pStreamImp->GetPosition() != m_iPosition) { m_pStreamImp->Seek(FX_STREAMSEEK_Begin, m_iPosition); } @@ -1191,7 +1191,7 @@ FX_INT32 CFX_Stream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) m_pStreamImp->Unlock(); return iLen; } -FX_INT32 CFX_Stream::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) +int32_t CFX_Stream::WriteString(FX_LPCWSTR pStr, int32_t iLength) { FXSYS_assert(pStr != NULL && iLength > 0); if (m_pStreamImp == NULL) { @@ -1200,7 +1200,7 @@ FX_INT32 CFX_Stream::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) if ((m_dwAccess & FX_STREAMACCESS_Write) == 0) { return -1; } - FX_INT32 iLen = iLength; + int32_t iLen = iLength; if (m_eStreamType == FX_STREAMTYPE_Stream) { iLen = FX_MIN((m_iStart + m_iTotalSize - m_iPosition) / 2, iLength); if (iLen <= 0) { @@ -1208,7 +1208,7 @@ FX_INT32 CFX_Stream::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) } } m_pStreamImp->Lock(); - FX_INT32 iEnd = m_iStart + m_iLength; + int32_t iEnd = m_iStart + m_iLength; if (m_pStreamImp->GetPosition() != m_iPosition) { m_pStreamImp->Seek(FX_STREAMSEEK_Begin, m_iPosition); } @@ -1230,7 +1230,7 @@ void CFX_Stream::Flush() } m_pStreamImp->Flush(); } -FX_BOOL CFX_Stream::SetLength(FX_INT32 iLength) +FX_BOOL CFX_Stream::SetLength(int32_t iLength) { if (m_pStreamImp == NULL) { return FALSE; @@ -1240,7 +1240,7 @@ FX_BOOL CFX_Stream::SetLength(FX_INT32 iLength) } return m_pStreamImp->SetLength(iLength); } -FX_INT32 CFX_Stream::GetBOM(FX_BYTE bom[4]) const +int32_t CFX_Stream::GetBOM(uint8_t bom[4]) const { if (m_pStreamImp == NULL) { return -1; @@ -1263,7 +1263,7 @@ FX_WORD CFX_Stream::SetCodePage(FX_WORD wCodePage) return FX_CODEPAGE_UTF16BE; #endif } -IFX_Stream* CFX_Stream::CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength) +IFX_Stream* CFX_Stream::CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength) { FXSYS_assert( iLength > 0); if (m_pStreamImp == NULL) { @@ -1275,12 +1275,12 @@ IFX_Stream* CFX_Stream::CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, if ((m_dwAccess & FX_STREAMACCESS_Write) == 0 && (dwAccess & FX_STREAMACCESS_Write) != 0) { return NULL; } - register FX_INT32 iStart = m_iStart + iOffset; - register FX_INT32 iTotal = m_iStart + m_iLength; + register int32_t iStart = m_iStart + iOffset; + register int32_t iTotal = m_iStart + m_iLength; if (iStart < m_iStart || iStart >= iTotal) { return NULL; } - register FX_INT32 iEnd = iStart + iLength; + register int32_t iEnd = iStart + iLength; if (iEnd < iStart || iEnd > iTotal) { return NULL; } @@ -1325,10 +1325,10 @@ FX_FILESIZE CFGAS_FileRead::GetSize() FX_BOOL CFGAS_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) { m_pStream->Lock(); - m_pStream->Seek(FX_STREAMSEEK_Begin, (FX_INT32)offset); - FX_INT32 iLen = m_pStream->ReadData((FX_LPBYTE)buffer, (FX_INT32)size); + m_pStream->Seek(FX_STREAMSEEK_Begin, (int32_t)offset); + int32_t iLen = m_pStream->ReadData((FX_LPBYTE)buffer, (int32_t)size); m_pStream->Unlock(); - return iLen == (FX_INT32)size; + return iLen == (int32_t)size; } #else CFGAS_FileRead::CFGAS_FileRead(IFX_Stream *pStream, FX_BOOL bReleaseStream) @@ -1350,10 +1350,10 @@ FX_DWORD CFGAS_FileRead::GetSize() FX_BOOL CFGAS_FileRead::ReadBlock(void* buffer, FX_DWORD offset, FX_DWORD size) { m_pStream->Lock(); - m_pStream->Seek(FX_STREAMSEEK_Begin, (FX_INT32)offset); - FX_INT32 iLen = m_pStream->ReadData((FX_LPBYTE)buffer, (FX_INT32)size); + m_pStream->Seek(FX_STREAMSEEK_Begin, (int32_t)offset); + int32_t iLen = m_pStream->ReadData((FX_LPBYTE)buffer, (int32_t)size); m_pStream->Unlock(); - return iLen == (FX_INT32)size; + return iLen == (int32_t)size; } #endif #ifdef FX_FILESIZE @@ -1447,14 +1447,14 @@ FX_BOOL CFX_BufferAccImp::ReadBlock(void* buffer, FX_FILESIZE offset, size_t siz return TRUE; } #else -IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_BOOL bReleaseStream) +IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_BOOL bReleaseStream) { if (!pBufferRead) { return NULL; } return FX_NEW CFX_BufferAccImp(pBufferRead, iFileSize, bReleaseStream); } -CFX_BufferAccImp::CFX_BufferAccImp(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_BOOL bReleaseStream) +CFX_BufferAccImp::CFX_BufferAccImp(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_BOOL bReleaseStream) : m_pBufferRead(pBufferRead) , m_bReleaseStream(bReleaseStream) , m_iBufSize(iFileSize) @@ -1566,15 +1566,15 @@ FX_BOOL CFGAS_FileWrite::Flush() } FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, size_t size) { - return m_pStream->WriteData((FX_LPCBYTE)pData, (FX_INT32)size) == (FX_INT32)size; + return m_pStream->WriteData((FX_LPCBYTE)pData, (int32_t)size) == (int32_t)size; } FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, FX_FILESIZE offset, size_t size) { m_pStream->Lock(); m_pStream->Seek(FX_STREAMSEEK_Begin, offset); - FX_INT32 iLen = m_pStream->WriteData((FX_LPBYTE)pData, (FX_INT32)size); + int32_t iLen = m_pStream->WriteData((FX_LPBYTE)pData, (int32_t)size); m_pStream->Unlock(); - return iLen == (FX_INT32)size; + return iLen == (int32_t)size; } #else CFGAS_FileWrite::CFGAS_FileWrite(IFX_Stream *pStream, FX_BOOL bReleaseStream) @@ -1600,14 +1600,14 @@ FX_DWORD CFGAS_FileWrite::Flush() } FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, FX_DWORD size) { - return m_pStream->WriteData((FX_LPCBYTE)pData, (FX_INT32)size) == (FX_INT32)size; + return m_pStream->WriteData((FX_LPCBYTE)pData, (int32_t)size) == (int32_t)size; } FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, FX_DWORD offset, FX_DWORD size) { m_pStream->Lock(); m_pStream->Seek(FX_STREAMSEEK_Begin, offset); - FX_INT32 iLen = m_pStream->WriteData((FX_LPBYTE)pData, (FX_INT32)size); + int32_t iLen = m_pStream->WriteData((FX_LPBYTE)pData, (int32_t)size); m_pStream->Unlock(); - return iLen == (FX_INT32)size; + return iLen == (int32_t)size; } #endif diff --git a/xfa/src/fgas/src/crt/fx_stream.h b/xfa/src/fgas/src/crt/fx_stream.h index 30cb98486e..2273ab1d9b 100644 --- a/xfa/src/fgas/src/crt/fx_stream.h +++ b/xfa/src/fgas/src/crt/fx_stream.h @@ -28,16 +28,16 @@ public: { return m_dwAccess; } - virtual FX_INT32 GetLength() const = 0; - virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) = 0; - virtual FX_INT32 GetPosition() = 0; + 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 FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) = 0; - virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS) = 0; - virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) = 0; - virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) = 0; + virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) = 0; + virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS) = 0; + virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) = 0; + virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength) = 0; virtual void Flush() = 0; - virtual FX_BOOL SetLength(FX_INT32 iLength) = 0; + virtual FX_BOOL SetLength(int32_t iLength) = 0; protected: CFX_StreamImp(); virtual ~CFX_StreamImp() {} @@ -49,44 +49,44 @@ public: CFX_FileStreamImp(); virtual ~CFX_FileStreamImp(); FX_BOOL LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwAccess); - virtual FX_INT32 GetLength() const; - virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); - virtual FX_INT32 GetPosition(); + virtual int32_t GetLength() const; + virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); + virtual int32_t GetPosition(); virtual FX_BOOL IsEOF() const; - virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize); - virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS); - virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize); - virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength); + virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize); + virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS); + virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize); + virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength); virtual void Flush(); - virtual FX_BOOL SetLength(FX_INT32 iLength); + virtual FX_BOOL SetLength(int32_t iLength); protected: FXSYS_FILE *m_hFile; - FX_INT32 m_iLength; + int32_t m_iLength; }; class CFX_BufferStreamImp : public CFX_StreamImp { public: CFX_BufferStreamImp(); virtual ~CFX_BufferStreamImp() {} - FX_BOOL LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess); - virtual FX_INT32 GetLength() const; - virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); - virtual FX_INT32 GetPosition(); + FX_BOOL LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess); + virtual int32_t GetLength() const; + virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); + virtual int32_t GetPosition(); virtual FX_BOOL IsEOF() const; - virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize); - virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS); - virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize); - virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength); + virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize); + virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS); + virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize); + virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength); virtual void Flush() {} - virtual FX_BOOL SetLength(FX_INT32 iLength) + virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; } protected: FX_LPBYTE m_pData; - FX_INT32 m_iTotalSize; - FX_INT32 m_iPosition; - FX_INT32 m_iLength; + int32_t m_iTotalSize; + int32_t m_iPosition; + int32_t m_iLength; }; class CFX_FileReadStreamImp : public CFX_StreamImp { @@ -94,69 +94,69 @@ public: CFX_FileReadStreamImp(); virtual ~CFX_FileReadStreamImp() {} FX_BOOL LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD dwAccess); - virtual FX_INT32 GetLength() const; - virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); - virtual FX_INT32 GetPosition() + virtual int32_t GetLength() const; + virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); + virtual int32_t GetPosition() { return m_iPosition; } virtual FX_BOOL IsEOF() const; - virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize); - virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS); - virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) + virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize); + virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS); + virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) { return 0; } - virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) + virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength) { return 0; } virtual void Flush() {} - virtual FX_BOOL SetLength(FX_INT32 iLength) + virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; } protected: IFX_FileRead *m_pFileRead; - FX_INT32 m_iPosition; - FX_INT32 m_iLength; + int32_t m_iPosition; + int32_t m_iLength; }; class CFX_BufferReadStreamImp : public CFX_StreamImp { public: CFX_BufferReadStreamImp(); ~CFX_BufferReadStreamImp(); - FX_BOOL LoadBufferRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead); + FX_BOOL LoadBufferRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead); - virtual FX_INT32 GetLength() const; - virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); - virtual FX_INT32 GetPosition() + virtual int32_t GetLength() const; + virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); + virtual int32_t GetPosition() { return m_iPosition; } virtual FX_BOOL IsEOF() const; - virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize); - virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS); - virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) + virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize); + virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS); + virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) { return 0; } - virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) + virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength) { return 0; } virtual void Flush() {} - virtual FX_BOOL SetLength(FX_INT32 iLength) + virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; } private: IFX_BufferRead *m_pBufferRead; FX_BOOL m_bReleaseBufferRead; - FX_INT32 m_iPosition; - FX_INT32 m_iBufferSize; + int32_t m_iPosition; + int32_t m_iBufferSize; }; class CFX_FileWriteStreamImp : public CFX_StreamImp { @@ -164,31 +164,31 @@ public: CFX_FileWriteStreamImp(); virtual ~CFX_FileWriteStreamImp() {} FX_BOOL LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWORD dwAccess); - virtual FX_INT32 GetLength() const; - virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); - virtual FX_INT32 GetPosition() + virtual int32_t GetLength() const; + virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); + virtual int32_t GetPosition() { return m_iPosition; } virtual FX_BOOL IsEOF() const; - virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) + virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) { return 0; } - virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS) + virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS) { return 0; } - virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize); - virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength); + virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize); + virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength); virtual void Flush(); - virtual FX_BOOL SetLength(FX_INT32 iLength) + virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; } protected: IFX_FileWrite *m_pFileWrite; - FX_INT32 m_iPosition; + int32_t m_iPosition; }; enum FX_STREAMTYPE { FX_SREAMTYPE_Unknown = 0, @@ -203,27 +203,27 @@ public: CFX_Stream(); ~CFX_Stream(); FX_BOOL LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwAccess); - FX_BOOL LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess); + FX_BOOL LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess); FX_BOOL LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD dwAccess); FX_BOOL LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWORD dwAccess); - FX_BOOL LoadBufferRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead); + FX_BOOL LoadBufferRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead); virtual void Release(); virtual IFX_Stream* Retain(); virtual FX_DWORD GetAccessModes() const { return m_dwAccess; } - virtual FX_INT32 GetLength() const; - virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); - virtual FX_INT32 GetPosition(); + virtual int32_t GetLength() const; + virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); + virtual int32_t GetPosition(); virtual FX_BOOL IsEOF() const; - virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize); - virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL); - virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize); - virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength); + virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize); + virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL); + virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize); + virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength); virtual void Flush(); - virtual FX_BOOL SetLength(FX_INT32 iLength); - virtual FX_INT32 GetBOM(FX_BYTE bom[4]) const; + virtual FX_BOOL SetLength(int32_t iLength); + virtual int32_t GetBOM(uint8_t bom[4]) const; virtual FX_WORD GetCodePage() const; virtual FX_WORD SetCodePage(FX_WORD wCodePage); virtual void Lock() @@ -234,16 +234,16 @@ public: { CFX_ThreadLock::Unlock(); } - virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength); + virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength); protected: FX_STREAMTYPE m_eStreamType; CFX_StreamImp *m_pStreamImp; FX_DWORD m_dwAccess; - FX_INT32 m_iTotalSize; - FX_INT32 m_iPosition; - FX_INT32 m_iStart; - FX_INT32 m_iLength; - FX_INT32 m_iRefCount; + int32_t m_iTotalSize; + int32_t m_iPosition; + int32_t m_iStart; + int32_t m_iLength; + int32_t m_iRefCount; }; class CFX_TextStream : public IFX_Stream, public CFX_ThreadLock { @@ -254,19 +254,19 @@ public: virtual IFX_Stream* Retain(); virtual FX_DWORD GetAccessModes() const; - virtual FX_INT32 GetLength() const; - virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); - virtual FX_INT32 GetPosition(); + virtual int32_t GetLength() const; + virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); + virtual int32_t GetPosition(); virtual FX_BOOL IsEOF() const; - virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize); - virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL); - virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize); - virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength); + virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize); + virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL); + virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize); + virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength); virtual void Flush(); - virtual FX_BOOL SetLength(FX_INT32 iLength); + virtual FX_BOOL SetLength(int32_t iLength); - virtual FX_INT32 GetBOM(FX_BYTE bom[4]) const; + virtual int32_t GetBOM(uint8_t bom[4]) const; virtual FX_WORD GetCodePage() const; virtual FX_WORD SetCodePage(FX_WORD wCodePage); @@ -279,16 +279,16 @@ public: CFX_ThreadLock::Unlock(); } - virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength); + virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength); protected: FX_WORD m_wCodePage; FX_WORD m_wBOMLength; FX_DWORD m_dwBOM; FX_LPBYTE m_pBuf; - FX_INT32 m_iBufSize; + int32_t m_iBufSize; FX_BOOL m_bDelStream; IFX_Stream *m_pStreamImp; - FX_INT32 m_iRefCount; + int32_t m_iRefCount; void InitStream(); }; #ifdef FX_FILESIZE @@ -347,7 +347,7 @@ protected: class CFX_BufferAccImp : public IFX_FileRead { public: - CFX_BufferAccImp(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_BOOL bReleaseStream); + CFX_BufferAccImp(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_BOOL bReleaseStream); virtual ~CFX_BufferAccImp(); virtual void Release() @@ -360,7 +360,7 @@ public: protected: IFX_BufferRead *m_pBufferRead; FX_BOOL m_bReleaseStream; - FX_INT32 m_iBufSize; + int32_t m_iBufSize; }; #endif #ifdef FX_FILESIZE diff --git a/xfa/src/fgas/src/crt/fx_system.cpp b/xfa/src/fgas/src/crt/fx_system.cpp index c8e4407a79..88f1631b7f 100644 --- a/xfa/src/fgas/src/crt/fx_system.cpp +++ b/xfa/src/fgas/src/crt/fx_system.cpp @@ -30,7 +30,7 @@ FX_LPWSTR FX_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count) } return dstStr; } -FX_INT32 FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count) +int32_t FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count) { FXSYS_assert(s1 != NULL && s2 != NULL && count > 0); FX_WCHAR wch1 = 0, wch2 = 0; @@ -43,7 +43,7 @@ FX_INT32 FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count) } return wch1 - wch2; } -FX_INT32 FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count) +int32_t FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count) { FXSYS_assert(s1 != NULL && s2 != NULL && count > 0); FX_CHAR ch1 = 0, ch2 = 0; @@ -56,20 +56,20 @@ FX_INT32 FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count) } return ch1 - ch2; } -FX_INT32 FX_filelength(FXSYS_FILE *file) +int32_t FX_filelength(FXSYS_FILE *file) { FXSYS_assert(file != NULL); #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ return _filelength(_fileno(file)); #else - FX_INT32 iPos = FXSYS_ftell(file); + int32_t iPos = FXSYS_ftell(file); FXSYS_fseek(file, 0, FXSYS_SEEK_END); - FX_INT32 iLen = FXSYS_ftell(file); + int32_t iLen = FXSYS_ftell(file); FXSYS_fseek(file, iPos, FXSYS_SEEK_SET); return iLen; #endif } -FX_BOOL FX_fsetsize(FXSYS_FILE *file, FX_INT32 size) +FX_BOOL FX_fsetsize(FXSYS_FILE *file, int32_t size) { FXSYS_assert(file != NULL); #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ @@ -79,13 +79,13 @@ FX_BOOL FX_fsetsize(FXSYS_FILE *file, FX_INT32 size) FX_DWORD dwPos = ::SetFilePointer(hFile, 0, 0, FILE_CURRENT); ::SetFilePointer(hFile, size, 0, FILE_BEGIN); FX_BOOL bRet = ::SetEndOfFile(hFile); - ::SetFilePointer(hFile, (FX_INT32)dwPos, 0, FILE_BEGIN); + ::SetFilePointer(hFile, (int32_t)dwPos, 0, FILE_BEGIN); return bRet; #else return FALSE; #endif } -FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength , FX_INT32 *pUsedLen ) +FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, int32_t iLength , int32_t *pUsedLen ) { FXSYS_assert(pcsStr != NULL); if (iLength < 0) { @@ -93,7 +93,7 @@ FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength , FX_INT32 *pUsedLen ) } return FX_wcstof(CFX_WideString::FromLocal(pcsStr, iLength), iLength, pUsedLen); } -FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength , FX_INT32 *pUsedLen ) +FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, int32_t iLength , int32_t *pUsedLen ) { FXSYS_assert(pwsStr != NULL); if (iLength < 0) { @@ -102,7 +102,7 @@ FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength , FX_INT32 *pUsedLen ) if (iLength == 0) { return 0.0f; } - FX_INT32 iUsedLen = 0; + int32_t iUsedLen = 0; FX_BOOL bNegtive = FALSE; switch (pwsStr[iUsedLen]) { case '-': @@ -138,7 +138,7 @@ FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength , FX_INT32 *pUsedLen ) } return bNegtive ? -fValue : fValue; } -void FX_memset(FX_LPVOID pBuf, FX_INT32 iValue, size_t size) +void FX_memset(FX_LPVOID pBuf, int32_t iValue, size_t size) { FXSYS_assert(pBuf != NULL && size > 0 && (size & 0x03) == 0); FXSYS_assert((((size_t)pBuf) & 0x03) == 0); @@ -161,11 +161,11 @@ void FX_memcpy(FX_LPVOID pDst, FX_LPCVOID pSrc, size_t size) } FX_BOOL FX_IsRelativePath(const CFX_WideStringC &wsUrl) { - FX_INT32 iUrlLen = wsUrl.GetLength(); + int32_t iUrlLen = wsUrl.GetLength(); if (iUrlLen == 0) { return TRUE; } - for (FX_INT32 i = FX_MIN(5, iUrlLen) - 1; i >= 0; --i) + for (int32_t i = FX_MIN(5, iUrlLen) - 1; i >= 0; --i) if (wsUrl.GetAt(i) == ':') { return FALSE; } @@ -190,7 +190,7 @@ FX_BOOL FX_JoinPath(const CFX_WideStringC &wsBasePath, const CFX_WideStringC &ws return wsAbsolutePath.GetLength() > 0; } } - FX_INT32 nBackCount = 0; + int32_t nBackCount = 0; for(;;) { if (pRelStart >= pRelEnd) { wsAbsolutePath = wsBasePath; diff --git a/xfa/src/fgas/src/crt/fx_utils.cpp b/xfa/src/fgas/src/crt/fx_utils.cpp index 6f8452237f..55d97f0ea6 100644 --- a/xfa/src/fgas/src/crt/fx_utils.cpp +++ b/xfa/src/fgas/src/crt/fx_utils.cpp @@ -20,14 +20,14 @@ void CFX_ThreadLock::Unlock() { } typedef struct _FX_BASEARRAYDATA : public CFX_Target { - FX_INT32 iGrowSize; - FX_INT32 iBlockSize; - FX_INT32 iTotalCount; - FX_INT32 iBlockCount; + int32_t iGrowSize; + int32_t iBlockSize; + int32_t iTotalCount; + int32_t iBlockCount; FX_LPBYTE pBuffer; } FX_BASEARRAYDATA, * FX_LPBASEARRAYDATA; typedef FX_BASEARRAYDATA const * FX_LPCBASEARRAYDATA; -CFX_BaseArray::CFX_BaseArray(FX_INT32 iGrowSize, FX_INT32 iBlockSize) +CFX_BaseArray::CFX_BaseArray(int32_t iGrowSize, int32_t iBlockSize) { FXSYS_assert(iGrowSize > 0 && iBlockSize > 0); m_pData = FXTARGET_New FX_BASEARRAYDATA; @@ -43,38 +43,38 @@ CFX_BaseArray::~CFX_BaseArray() } FXTARGET_Delete pData; } -FX_INT32 CFX_BaseArray::GetSize() const +int32_t CFX_BaseArray::GetSize() const { return ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount; } -FX_INT32 CFX_BaseArray::GetBlockSize() const +int32_t CFX_BaseArray::GetBlockSize() const { return ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize; } -FX_LPBYTE CFX_BaseArray::AddSpaceTo(FX_INT32 index) +FX_LPBYTE CFX_BaseArray::AddSpaceTo(int32_t index) { FXSYS_assert(index > -1); FX_LPBYTE &pBuffer = ((FX_LPBASEARRAYDATA)m_pData)->pBuffer; - FX_INT32 &iTotalCount = ((FX_LPBASEARRAYDATA)m_pData)->iTotalCount; - FX_INT32 iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize; + int32_t &iTotalCount = ((FX_LPBASEARRAYDATA)m_pData)->iTotalCount; + int32_t iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize; if (index >= iTotalCount) { - FX_INT32 iGrowSize = ((FX_LPBASEARRAYDATA)m_pData)->iGrowSize; + int32_t iGrowSize = ((FX_LPBASEARRAYDATA)m_pData)->iGrowSize; iTotalCount = (index / iGrowSize + 1) * iGrowSize; - FX_INT32 iNewSize = iTotalCount * iBlockSize; + int32_t iNewSize = iTotalCount * iBlockSize; if (pBuffer == NULL) { - pBuffer = (FX_LPBYTE)FX_Alloc(FX_BYTE, iNewSize); + pBuffer = (FX_LPBYTE)FX_Alloc(uint8_t, iNewSize); } else { - pBuffer = (FX_LPBYTE)FX_Realloc(FX_BYTE, pBuffer, iNewSize); + pBuffer = (FX_LPBYTE)FX_Realloc(uint8_t, pBuffer, iNewSize); } } FXSYS_assert(pBuffer != NULL); - FX_INT32 &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount; + int32_t &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount; if (index >= iBlockCount) { iBlockCount = index + 1; } return pBuffer + index * iBlockSize; } -FX_LPBYTE CFX_BaseArray::GetAt(FX_INT32 index) const +FX_LPBYTE CFX_BaseArray::GetAt(int32_t index) const { FXSYS_assert(index > -1 && index < ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount); return ((FX_LPBASEARRAYDATA)m_pData)->pBuffer + index * ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize; @@ -83,12 +83,12 @@ FX_LPBYTE CFX_BaseArray::GetBuffer() const { return ((FX_LPBASEARRAYDATA)m_pData)->pBuffer; } -FX_INT32 CFX_BaseArray::Append(const CFX_BaseArray &src, FX_INT32 iStart, FX_INT32 iCount) +int32_t CFX_BaseArray::Append(const CFX_BaseArray &src, int32_t iStart, int32_t iCount) { - FX_INT32 iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize; + int32_t iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize; FXSYS_assert(iBlockSize == ((FX_LPBASEARRAYDATA)src.m_pData)->iBlockSize); - FX_INT32 &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount; - FX_INT32 iAdded = src.GetSize(); + int32_t &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount; + int32_t iAdded = src.GetSize(); FXSYS_assert(iStart > -1 && iStart < iAdded); if (iCount < 0) { iCount = iAdded; @@ -104,11 +104,11 @@ FX_INT32 CFX_BaseArray::Append(const CFX_BaseArray &src, FX_INT32 iStart, FX_INT FX_memcpy(pDst, ((FX_LPBASEARRAYDATA)src.m_pData)->pBuffer + iStart * iBlockSize, iCount * iBlockSize); return iCount; } -FX_INT32 CFX_BaseArray::Copy(const CFX_BaseArray &src, FX_INT32 iStart, FX_INT32 iCount) +int32_t CFX_BaseArray::Copy(const CFX_BaseArray &src, int32_t iStart, int32_t iCount) { - FX_INT32 iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize; + int32_t iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize; FXSYS_assert(iBlockSize == ((FX_LPBASEARRAYDATA)src.m_pData)->iBlockSize); - FX_INT32 iCopied = src.GetSize(); + int32_t iCopied = src.GetSize(); FXSYS_assert(iStart > -1 && iStart < iCopied); if (iCount < 0) { iCount = iCopied; @@ -124,9 +124,9 @@ FX_INT32 CFX_BaseArray::Copy(const CFX_BaseArray &src, FX_INT32 iStart, FX_INT32 FX_memcpy(((FX_LPBASEARRAYDATA)m_pData)->pBuffer, ((FX_LPBASEARRAYDATA)src.m_pData)->pBuffer + iStart * iBlockSize, iCount * iBlockSize); return iCount; } -FX_INT32 CFX_BaseArray::RemoveLast(FX_INT32 iCount) +int32_t CFX_BaseArray::RemoveLast(int32_t iCount) { - FX_INT32 &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount; + int32_t &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount; if (iCount < 0 || iCount > iBlockCount) { iCount = iBlockCount; iBlockCount = 0; @@ -147,7 +147,7 @@ void CFX_BaseArray::RemoveAll(FX_BOOL bLeaveMemory) } ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount = 0; } -CFX_BaseMassArrayImp::CFX_BaseMassArrayImp(FX_INT32 iChunkSize, FX_INT32 iBlockSize) +CFX_BaseMassArrayImp::CFX_BaseMassArrayImp(int32_t iChunkSize, int32_t iBlockSize) : m_iChunkSize(iChunkSize) , m_iBlockSize(iBlockSize) , m_iChunkCount(0) @@ -162,20 +162,20 @@ CFX_BaseMassArrayImp::~CFX_BaseMassArrayImp() RemoveAll(); delete m_pData; } -FX_LPBYTE CFX_BaseMassArrayImp::AddSpaceTo(FX_INT32 index) +FX_LPBYTE CFX_BaseMassArrayImp::AddSpaceTo(int32_t index) { FXSYS_assert(index > -1); FX_LPBYTE pChunk; if (index < m_iBlockCount) { pChunk = (FX_LPBYTE)m_pData->GetAt(index / m_iChunkSize); } else { - FX_INT32 iMemSize = m_iChunkSize * m_iBlockSize; + int32_t iMemSize = m_iChunkSize * m_iBlockSize; while (TRUE) { if (index < m_iChunkCount * m_iChunkSize) { pChunk = (FX_LPBYTE)m_pData->GetAt(index / m_iChunkSize); break; } else { - pChunk = (FX_LPBYTE)FX_Alloc(FX_BYTE, iMemSize); + pChunk = (FX_LPBYTE)FX_Alloc(uint8_t, iMemSize); if (m_iChunkCount < m_pData->GetSize()) { m_pData->SetAt(m_iChunkCount, pChunk); } else { @@ -189,17 +189,17 @@ FX_LPBYTE CFX_BaseMassArrayImp::AddSpaceTo(FX_INT32 index) m_iBlockCount = index + 1; return pChunk + (index % m_iChunkSize) * m_iBlockSize; } -FX_LPBYTE CFX_BaseMassArrayImp::GetAt(FX_INT32 index) const +FX_LPBYTE CFX_BaseMassArrayImp::GetAt(int32_t index) const { FXSYS_assert(index > -1 && index < m_iBlockCount); FX_LPBYTE pChunk = (FX_LPBYTE)m_pData->GetAt(index / m_iChunkSize); FXSYS_assert(pChunk != NULL); return pChunk + (index % m_iChunkSize) * m_iBlockSize; } -FX_INT32 CFX_BaseMassArrayImp::Append(const CFX_BaseMassArrayImp &src, FX_INT32 iStart, FX_INT32 iCount) +int32_t CFX_BaseMassArrayImp::Append(const CFX_BaseMassArrayImp &src, int32_t iStart, int32_t iCount) { FXSYS_assert(m_iBlockSize == src.m_iBlockSize); - FX_INT32 iAdded = src.m_iBlockCount; + int32_t iAdded = src.m_iBlockCount; FXSYS_assert(iStart > -1 && iStart < iAdded); if (iCount < 0) { iCount = iAdded; @@ -210,16 +210,16 @@ FX_INT32 CFX_BaseMassArrayImp::Append(const CFX_BaseMassArrayImp &src, FX_INT32 if (iCount < 1) { return m_iBlockCount; } - FX_INT32 iBlockCount = m_iBlockCount; - FX_INT32 iTotal = m_iBlockCount + iCount; + int32_t iBlockCount = m_iBlockCount; + int32_t iTotal = m_iBlockCount + iCount; AddSpaceTo(iTotal - 1); Append(iBlockCount, src, iStart, iCount); return m_iBlockCount; } -FX_INT32 CFX_BaseMassArrayImp::Copy(const CFX_BaseMassArrayImp &src, FX_INT32 iStart, FX_INT32 iCount) +int32_t CFX_BaseMassArrayImp::Copy(const CFX_BaseMassArrayImp &src, int32_t iStart, int32_t iCount) { FXSYS_assert(m_iBlockSize == src.m_iBlockSize); - FX_INT32 iCopied = src.m_iBlockCount; + int32_t iCopied = src.m_iBlockCount; FXSYS_assert(iStart > -1); if (iStart >= iCopied) { return 0; @@ -240,20 +240,20 @@ FX_INT32 CFX_BaseMassArrayImp::Copy(const CFX_BaseMassArrayImp &src, FX_INT32 iS Append(0, src, iStart, iCount); return m_iBlockCount; } -void CFX_BaseMassArrayImp::Append(FX_INT32 iDstStart, const CFX_BaseMassArrayImp &src, FX_INT32 iSrcStart, FX_INT32 iSrcCount) +void CFX_BaseMassArrayImp::Append(int32_t iDstStart, const CFX_BaseMassArrayImp &src, int32_t iSrcStart, int32_t iSrcCount) { FXSYS_assert(iDstStart > -1 && m_iBlockSize == src.m_iBlockSize); - FX_INT32 iSrcTotal = src.m_iBlockCount; + int32_t iSrcTotal = src.m_iBlockCount; FXSYS_assert(iSrcTotal > 0 && m_iBlockCount >= iDstStart + iSrcCount); FXSYS_assert(iSrcStart > -1 && iSrcStart < iSrcTotal && iSrcCount > 0 && iSrcStart + iSrcCount <= iSrcTotal); - FX_INT32 iDstChunkIndex = iDstStart / m_iChunkSize; - FX_INT32 iSrcChunkIndex = iSrcStart / src.m_iChunkSize; + int32_t iDstChunkIndex = iDstStart / m_iChunkSize; + int32_t iSrcChunkIndex = iSrcStart / src.m_iChunkSize; FX_LPBYTE pDstChunk = (FX_LPBYTE)GetAt(iDstStart); FX_LPBYTE pSrcChunk = (FX_LPBYTE)src.GetAt(iSrcStart); - FX_INT32 iDstChunkSize = m_iChunkSize - (iDstStart % m_iChunkSize); - FX_INT32 iSrcChunkSize = src.m_iChunkSize - (iSrcStart % src.m_iChunkSize); - FX_INT32 iCopySize = FX_MIN(iSrcCount, FX_MIN(iSrcChunkSize, iDstChunkSize)); - FX_INT32 iCopyBytes = iCopySize * m_iBlockSize; + int32_t iDstChunkSize = m_iChunkSize - (iDstStart % m_iChunkSize); + int32_t iSrcChunkSize = src.m_iChunkSize - (iSrcStart % src.m_iChunkSize); + int32_t iCopySize = FX_MIN(iSrcCount, FX_MIN(iSrcChunkSize, iDstChunkSize)); + int32_t iCopyBytes = iCopySize * m_iBlockSize; while (iSrcCount > 0) { FXSYS_assert(pDstChunk != NULL && pSrcChunk != NULL); FXSYS_memcpy(pDstChunk, pSrcChunk, iCopyBytes); @@ -278,7 +278,7 @@ void CFX_BaseMassArrayImp::Append(FX_INT32 iDstStart, const CFX_BaseMassArrayImp iCopyBytes = iCopySize * m_iBlockSize; } } -FX_INT32 CFX_BaseMassArrayImp::RemoveLast(FX_INT32 iCount) +int32_t CFX_BaseMassArrayImp::RemoveLast(int32_t iCount) { if (iCount < 0 || iCount >= m_iBlockCount) { m_iBlockCount = 0; @@ -293,7 +293,7 @@ void CFX_BaseMassArrayImp::RemoveAll(FX_BOOL bLeaveMemory) m_iBlockCount = 0; return; } - for (FX_INT32 i = 0; i < m_iChunkCount; i ++) { + for (int32_t i = 0; i < m_iChunkCount; i ++) { FX_LPVOID p = m_pData->GetAt(i); if (p == NULL) { continue; @@ -304,7 +304,7 @@ void CFX_BaseMassArrayImp::RemoveAll(FX_BOOL bLeaveMemory) m_iChunkCount = 0; m_iBlockCount = 0; } -CFX_BaseMassArray::CFX_BaseMassArray(FX_INT32 iChunkSize, FX_INT32 iBlockSize) +CFX_BaseMassArray::CFX_BaseMassArray(int32_t iChunkSize, int32_t iBlockSize) { m_pData = FXTARGET_New CFX_BaseMassArrayImp(iChunkSize, iBlockSize); } @@ -312,27 +312,27 @@ CFX_BaseMassArray::~CFX_BaseMassArray() { FXTARGET_Delete m_pData; } -FX_INT32 CFX_BaseMassArray::GetSize() const +int32_t CFX_BaseMassArray::GetSize() const { return m_pData->m_iBlockCount; } -FX_LPBYTE CFX_BaseMassArray::AddSpaceTo(FX_INT32 index) +FX_LPBYTE CFX_BaseMassArray::AddSpaceTo(int32_t index) { return m_pData->AddSpaceTo(index); } -FX_LPBYTE CFX_BaseMassArray::GetAt(FX_INT32 index) const +FX_LPBYTE CFX_BaseMassArray::GetAt(int32_t index) const { return m_pData->GetAt(index); } -FX_INT32 CFX_BaseMassArray::Append(const CFX_BaseMassArray &src, FX_INT32 iStart, FX_INT32 iCount) +int32_t CFX_BaseMassArray::Append(const CFX_BaseMassArray &src, int32_t iStart, int32_t iCount) { return m_pData->Append(*(CFX_BaseMassArrayImp*)src.m_pData, iStart, iCount); } -FX_INT32 CFX_BaseMassArray::Copy(const CFX_BaseMassArray &src, FX_INT32 iStart, FX_INT32 iCount) +int32_t CFX_BaseMassArray::Copy(const CFX_BaseMassArray &src, int32_t iStart, int32_t iCount) { return m_pData->Copy(*(CFX_BaseMassArrayImp*)src.m_pData, iStart, iCount); } -FX_INT32 CFX_BaseMassArray::RemoveLast(FX_INT32 iCount) +int32_t CFX_BaseMassArray::RemoveLast(int32_t iCount) { return m_pData->RemoveLast(iCount); } @@ -341,13 +341,13 @@ void CFX_BaseMassArray::RemoveAll(FX_BOOL bLeaveMemory) m_pData->RemoveAll(bLeaveMemory); } typedef struct _FX_BASEDISCRETEARRAYDATA { - FX_INT32 iBlockSize; - FX_INT32 iChunkSize; - FX_INT32 iChunkCount; + int32_t iBlockSize; + int32_t iChunkSize; + int32_t iChunkCount; CFX_PtrArray ChunkBuffer; } FX_BASEDISCRETEARRAYDATA, * FX_LPBASEDISCRETEARRAYDATA; typedef FX_BASEDISCRETEARRAYDATA const * FX_LPCBASEDISCRETEARRAYDATA; -CFX_BaseDiscreteArray::CFX_BaseDiscreteArray(FX_INT32 iChunkSize, FX_INT32 iBlockSize) +CFX_BaseDiscreteArray::CFX_BaseDiscreteArray(int32_t iChunkSize, int32_t iBlockSize) { FXSYS_assert(iChunkSize > 0 && iBlockSize > 0); FX_LPBASEDISCRETEARRAYDATA pData; @@ -362,20 +362,20 @@ CFX_BaseDiscreteArray::~CFX_BaseDiscreteArray() RemoveAll(); delete (FX_LPBASEDISCRETEARRAYDATA)m_pData; } -FX_LPBYTE CFX_BaseDiscreteArray::AddSpaceTo(FX_INT32 index) +FX_LPBYTE CFX_BaseDiscreteArray::AddSpaceTo(int32_t index) { FXSYS_assert(index > -1); FX_LPBASEDISCRETEARRAYDATA pData = (FX_LPBASEDISCRETEARRAYDATA)m_pData; - FX_INT32 &iChunkCount = pData->iChunkCount; - FX_INT32 iChunkSize = pData->iChunkSize; + int32_t &iChunkCount = pData->iChunkCount; + int32_t iChunkSize = pData->iChunkSize; FX_LPBYTE pChunk = NULL; - FX_INT32 iChunk = index / iChunkSize; + int32_t iChunk = index / iChunkSize; if (iChunk < iChunkCount) { pChunk = (FX_LPBYTE)pData->ChunkBuffer.GetAt(iChunk); } if (pChunk == NULL) { - FX_INT32 iMemSize = iChunkSize * pData->iBlockSize; - pChunk = (FX_LPBYTE)FX_Alloc(FX_BYTE, iMemSize); + int32_t iMemSize = iChunkSize * pData->iBlockSize; + pChunk = (FX_LPBYTE)FX_Alloc(uint8_t, iMemSize); FXSYS_memset(pChunk, 0, iMemSize); pData->ChunkBuffer.SetAtGrow(iChunk, pChunk); if (iChunkCount <= iChunk) { @@ -384,12 +384,12 @@ FX_LPBYTE CFX_BaseDiscreteArray::AddSpaceTo(FX_INT32 index) } return pChunk + (index % iChunkSize) * pData->iBlockSize; } -FX_LPBYTE CFX_BaseDiscreteArray::GetAt(FX_INT32 index) const +FX_LPBYTE CFX_BaseDiscreteArray::GetAt(int32_t index) const { FXSYS_assert(index > -1); FX_LPBASEDISCRETEARRAYDATA pData = (FX_LPBASEDISCRETEARRAYDATA)m_pData; - FX_INT32 iChunkSize = pData->iChunkSize; - FX_INT32 iChunk = index / iChunkSize; + int32_t iChunkSize = pData->iChunkSize; + int32_t iChunk = index / iChunkSize; if (iChunk >= pData->iChunkCount) { return NULL; } @@ -403,8 +403,8 @@ void CFX_BaseDiscreteArray::RemoveAll() { FX_LPBASEDISCRETEARRAYDATA pData = (FX_LPBASEDISCRETEARRAYDATA)m_pData; CFX_PtrArray &ChunkBuffer = pData->ChunkBuffer; - FX_INT32 &iChunkCount = pData->iChunkCount; - for (FX_INT32 i = 0; i < iChunkCount; i++) { + int32_t &iChunkCount = pData->iChunkCount; + for (int32_t i = 0; i < iChunkCount; i++) { FX_LPVOID p = ChunkBuffer.GetAt(i); if (p == NULL) { continue; @@ -414,7 +414,7 @@ void CFX_BaseDiscreteArray::RemoveAll() ChunkBuffer.RemoveAll(); iChunkCount = 0; } -CFX_BaseStack::CFX_BaseStack(FX_INT32 iChunkSize, FX_INT32 iBlockSize) +CFX_BaseStack::CFX_BaseStack(int32_t iChunkSize, int32_t iBlockSize) { m_pData = FXTARGET_New CFX_BaseMassArrayImp(iChunkSize, iBlockSize); } @@ -428,7 +428,7 @@ FX_LPBYTE CFX_BaseStack::Push() } void CFX_BaseStack::Pop() { - FX_INT32 &iBlockCount = m_pData->m_iBlockCount; + int32_t &iBlockCount = m_pData->m_iBlockCount; if (iBlockCount < 1) { return; } @@ -436,17 +436,17 @@ void CFX_BaseStack::Pop() } FX_LPBYTE CFX_BaseStack::GetTopElement() const { - FX_INT32 iSize = m_pData->m_iBlockCount; + int32_t iSize = m_pData->m_iBlockCount; if (iSize < 1) { return NULL; } return m_pData->GetAt(iSize - 1); } -FX_INT32 CFX_BaseStack::GetSize() const +int32_t CFX_BaseStack::GetSize() const { return m_pData->m_iBlockCount; } -FX_LPBYTE CFX_BaseStack::GetAt(FX_INT32 index) const +FX_LPBYTE CFX_BaseStack::GetAt(int32_t index) const { return m_pData->GetAt(index); } diff --git a/xfa/src/fgas/src/crt/fx_utils.h b/xfa/src/fgas/src/crt/fx_utils.h index a073b80e57..92c2bcb198 100644 --- a/xfa/src/fgas/src/crt/fx_utils.h +++ b/xfa/src/fgas/src/crt/fx_utils.h @@ -9,24 +9,24 @@ class CFX_BaseMassArrayImp : public CFX_Target { public: - CFX_BaseMassArrayImp(FX_INT32 iChunkSize, FX_INT32 iBlockSize); + CFX_BaseMassArrayImp(int32_t iChunkSize, int32_t iBlockSize); ~CFX_BaseMassArrayImp(); FX_LPBYTE AddSpace() { return AddSpaceTo(m_iBlockCount); } - FX_LPBYTE AddSpaceTo(FX_INT32 index); - FX_LPBYTE GetAt(FX_INT32 index) const; - FX_INT32 Append(const CFX_BaseMassArrayImp &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1); - FX_INT32 Copy(const CFX_BaseMassArrayImp &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1); - FX_INT32 RemoveLast(FX_INT32 iCount = -1); + FX_LPBYTE AddSpaceTo(int32_t index); + FX_LPBYTE GetAt(int32_t index) const; + int32_t Append(const CFX_BaseMassArrayImp &src, int32_t iStart = 0, int32_t iCount = -1); + int32_t Copy(const CFX_BaseMassArrayImp &src, int32_t iStart = 0, int32_t iCount = -1); + int32_t RemoveLast(int32_t iCount = -1); void RemoveAll(FX_BOOL bLeaveMemory = FALSE); - FX_INT32 m_iChunkSize; - FX_INT32 m_iBlockSize; - FX_INT32 m_iChunkCount; - FX_INT32 m_iBlockCount; + int32_t m_iChunkSize; + int32_t m_iBlockSize; + int32_t m_iChunkCount; + int32_t m_iBlockCount; CFX_PtrArray *m_pData; protected: - void Append(FX_INT32 iDstStart, const CFX_BaseMassArrayImp &src, FX_INT32 iSrcStart = 0, FX_INT32 iSrcCount = -1); + void Append(int32_t iDstStart, const CFX_BaseMassArrayImp &src, int32_t iSrcStart = 0, int32_t iSrcCount = -1); }; #endif diff --git a/xfa/src/fgas/src/font/fx_fontutils.cpp b/xfa/src/fgas/src/font/fx_fontutils.cpp index b2a7028fb8..24e77c1c93 100644 --- a/xfa/src/fgas/src/font/fx_fontutils.cpp +++ b/xfa/src/fgas/src/font/fx_fontutils.cpp @@ -218,9 +218,9 @@ static const FGAS_FONTUSB g_FXGdiFontUSBTable[] = { }; FGAS_LPCFONTUSB FGAS_GetUnicodeBitField(FX_WCHAR wUnicode) { - FX_INT32 iEnd = sizeof(g_FXGdiFontUSBTable) / sizeof(FGAS_FONTUSB) - 1; + int32_t iEnd = sizeof(g_FXGdiFontUSBTable) / sizeof(FGAS_FONTUSB) - 1; FXSYS_assert(iEnd >= 0); - FX_INT32 iStart = 0, iMid; + int32_t iStart = 0, iMid; do { iMid = (iStart + iEnd) / 2; const FGAS_FONTUSB &usb = g_FXGdiFontUSBTable[iMid]; diff --git a/xfa/src/fgas/src/font/fx_gdifont.cpp b/xfa/src/fgas/src/font/fx_gdifont.cpp index e9ab665b5a..437a25c7e4 100644 --- a/xfa/src/fgas/src/font/fx_gdifont.cpp +++ b/xfa/src/fgas/src/font/fx_gdifont.cpp @@ -16,7 +16,7 @@ CFX_GdiFontCache::CFX_GdiFontCache() CFX_GdiFontCache::~CFX_GdiFontCache() { FX_POSITION pos = m_GlyphMap.GetStartPosition(); - FX_INT32 iGlyph; + int32_t iGlyph; FX_LPGDIGOCACHE pGlyph; while (pos != NULL) { pGlyph = NULL; @@ -53,7 +53,7 @@ IFX_Font* IFX_Font::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX } return pFont; } -IFX_Font* IFX_Font::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, IFX_FontMgr *pFontMgr) +IFX_Font* IFX_Font::LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, IFX_FontMgr *pFontMgr) { CFX_GdiFont *pFont = FX_NEW CFX_GdiFont(pFontMgr); if (!pFont->LoadFont(pBuffer, iLength)) { @@ -107,8 +107,8 @@ CFX_GdiFont::CFX_GdiFont(IFX_FontMgr *pFontMgr) } CFX_GdiFont::~CFX_GdiFont() { - FX_INT32 iCount = m_SubstFonts.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_SubstFonts.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { IFX_Font *pFont = (IFX_Font*)m_SubstFonts[i]; pFont->Release(); } @@ -131,8 +131,8 @@ CFX_GdiFont::~CFX_GdiFont() } void CFX_GdiFont::ClearCache() { - FX_INT32 iCount = m_SubstFonts.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_SubstFonts.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { IFX_Font *pFont = (IFX_Font*)m_SubstFonts[i]; ((CFX_GdiFont*)pFont)->ClearCache(); } @@ -181,7 +181,7 @@ FX_BOOL CFX_GdiFont::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, F lf.lfCharSet = SYMBOL_CHARSET; } else { FX_WORD wCharSet = FX_GetCharsetFromCodePage(wCodePage); - lf.lfCharSet = wCharSet != 0xFFFF ? (FX_BYTE)wCharSet : DEFAULT_CHARSET; + lf.lfCharSet = wCharSet != 0xFFFF ? (uint8_t)wCharSet : DEFAULT_CHARSET; } if (pszFontFamily == NULL) { lf.lfFaceName[0] = L'\0'; @@ -190,7 +190,7 @@ FX_BOOL CFX_GdiFont::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, F } return LoadFont(lf); } -FX_BOOL CFX_GdiFont::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength) +FX_BOOL CFX_GdiFont::LoadFont(FX_LPCBYTE pBuffer, int32_t iLength) { FXSYS_assert(m_hFont == NULL && pBuffer != NULL && iLength > 0); Gdiplus::PrivateFontCollection pfc; @@ -247,7 +247,7 @@ FX_BOOL CFX_GdiFont::LoadFont(FX_LPCWSTR pszFileName) FX_BOOL CFX_GdiFont::LoadFont(IFX_Stream *pFontStream) { FXSYS_assert(m_hFont == NULL && pFontStream != NULL); - FX_INT32 iLength = pFontStream->GetLength(); + int32_t iLength = pFontStream->GetLength(); if (iLength < 1) { return FALSE; } @@ -272,9 +272,9 @@ FX_BOOL CFX_GdiFont::LoadFont(const LOGFONTW &lf) ::GetOutlineTextMetricsW(m_hDC, sizeof(m_OutlineTM), &m_OutlineTM); return TRUE; } -FX_INT32 CFX_GdiFont::GetFontFamilies(Gdiplus::FontCollection &fc) +int32_t CFX_GdiFont::GetFontFamilies(Gdiplus::FontCollection &fc) { - FX_INT32 iCount = fc.GetFamilyCount(); + int32_t iCount = fc.GetFamilyCount(); if (iCount < 1) { return iCount; } @@ -282,9 +282,9 @@ FX_INT32 CFX_GdiFont::GetFontFamilies(Gdiplus::FontCollection &fc) if (pFontFamilies == NULL) { return -1; } - FX_INT32 iFind = 0; + int32_t iFind = 0; fc.GetFamilies(iCount, pFontFamilies, &iFind); - for (FX_INT32 i = 0; i < iCount; i ++) { + for (int32_t i = 0; i < iCount; i ++) { CFX_WideString wsFamilyName; FX_LPWSTR pName = wsFamilyName.GetBuffer(LF_FACESIZE); pFontFamilies[i].GetFamilyName(pName); @@ -306,12 +306,12 @@ void CFX_GdiFont::GetFamilyName(CFX_WideString &wsFamily) const FXSYS_assert(m_hFont != NULL); wsFamily = m_LogFont.lfFaceName; } -FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode) +FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode) { - iWidth = (FX_INT32)(FX_SHORT)m_WidthCache.GetAt(wUnicode, 0); + iWidth = (int32_t)(int16_t)m_WidthCache.GetAt(wUnicode, 0); if (iWidth == 0 || iWidth == -1) { IFX_Font *pFont = NULL; - FX_INT32 iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode); + int32_t iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode); if (iGlyph != 0xFFFF && pFont != NULL) { if (pFont == (IFX_Font*)this) { if (!::GetCharWidthI(m_hDC, iGlyph, 1, NULL, &iWidth)) { @@ -324,18 +324,18 @@ FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL b iWidth = -1; } Lock(); - m_WidthCache.SetAtGrow(wUnicode, (FX_SHORT)iWidth); + m_WidthCache.SetAtGrow(wUnicode, (int16_t)iWidth); Unlock(); } return iWidth > 0; } -FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode) +FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode) { return GetCharWidth(wUnicode, iWidth, TRUE, bCharCode); } -FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode) +int32_t CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode) { - FX_INT32 iGlyph = 0XFFFF; + int32_t iGlyph = 0XFFFF; if (::GetGlyphIndicesW(m_hDC, &wUnicode, 1, (LPWORD)&iGlyph, GGI_MARK_NONEXISTING_GLYPHS) != GDI_ERROR && iGlyph != 0xFFFF) { if (ppFont != NULL) { *ppFont = (IFX_Font*)this; @@ -355,7 +355,7 @@ FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_F if (pFont != NULL && pFont != (IFX_Font*)this) { iGlyph = ((CFX_GdiFont*)pFont)->GetGlyphIndex(wUnicode, FALSE, NULL, bCharCode); if (iGlyph != 0xFFFF) { - FX_INT32 i = m_SubstFonts.Find(pFont); + int32_t i = m_SubstFonts.Find(pFont); if (i > -1) { iGlyph |= ((i + 1) << 24); if (ppFont != NULL) { @@ -373,7 +373,7 @@ FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_F return 0xFFFF; } m_FontMapper.SetAt((void*)wBitField, (void*)pFont); - FX_INT32 i = m_SubstFonts.GetSize(); + int32_t i = m_SubstFonts.GetSize(); m_SubstFonts.Add(pFont); iGlyph = ((CFX_GdiFont*)pFont)->GetGlyphIndex(wUnicode, FALSE, NULL, bCharCode); if (iGlyph != 0xFFFF) { @@ -387,21 +387,21 @@ FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_F } return 0xFFFF; } -FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode) +int32_t CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode) { return GetGlyphIndex(wUnicode, TRUE, NULL, bCharCode); } -FX_INT32 CFX_GdiFont::GetAscent() const +int32_t CFX_GdiFont::GetAscent() const { return m_OutlineTM.otmAscent; } -FX_INT32 CFX_GdiFont::GetDescent() const +int32_t CFX_GdiFont::GetDescent() const { return m_OutlineTM.otmDescent; } FX_BOOL CFX_GdiFont::GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bCharCode) { - FX_INT32 iGlyphIndex = GetGlyphIndex(wUnicode, bCharCode); + int32_t iGlyphIndex = GetGlyphIndex(wUnicode, bCharCode); if (iGlyphIndex == 0xFFFF) { return FALSE; } @@ -429,7 +429,7 @@ FX_BOOL CFX_GdiFont::GetBBox(CFX_Rect &bbox) bbox.height = m_OutlineTM.otmrcFontBox.bottom - m_OutlineTM.otmrcFontBox.top; return TRUE; } -FX_INT32 CFX_GdiFont::GetItalicAngle() const +int32_t CFX_GdiFont::GetItalicAngle() const { return m_OutlineTM.otmItalicAngle / 10; } @@ -440,9 +440,9 @@ void CFX_GdiFont::Reset() ClearCache(); Unlock(); } -IFX_Font* CFX_GdiFont::GetSubstFont(FX_INT32 iGlyphIndex) const +IFX_Font* CFX_GdiFont::GetSubstFont(int32_t iGlyphIndex) const { - FX_INT32 iHigher = (iGlyphIndex & 0x7F000000) >> 24; + int32_t iHigher = (iGlyphIndex & 0x7F000000) >> 24; if (iHigher == 0) { return (IFX_Font*)this; } @@ -451,7 +451,7 @@ IFX_Font* CFX_GdiFont::GetSubstFont(FX_INT32 iGlyphIndex) const } return (IFX_Font*)m_SubstFonts[iHigher - 1]; } -FX_DWORD CFX_GdiFont::GetGlyphDIBits(FX_INT32 iGlyphIndex, FX_ARGB argb, const MAT2 *pMatrix, GLYPHMETRICS &gm, FX_LPVOID pBuffer, FX_DWORD bufSize) +FX_DWORD CFX_GdiFont::GetGlyphDIBits(int32_t iGlyphIndex, FX_ARGB argb, const MAT2 *pMatrix, GLYPHMETRICS &gm, FX_LPVOID pBuffer, FX_DWORD bufSize) { static const UINT uFormat = GGO_GLYPH_INDEX | GGO_GRAY8_BITMAP; IFX_Font *pFont = GetSubstFont(iGlyphIndex); @@ -511,11 +511,11 @@ FX_DWORD CFX_GdiFont::GetMAT2HashCode(const FIXED *pFixed) } return ((dwHash1 & 0x0000FFFF) << 16) | (dwHash2 & 0x0000FFFF); } -void CFX_GdiFont::CreateGlyphBitmap(FX_INT32 iWidth, FX_INT32 iHeight, FX_LPBYTE pOutline, FX_LPDWORD pDIB, FX_ARGB argb) +void CFX_GdiFont::CreateGlyphBitmap(int32_t iWidth, int32_t iHeight, FX_LPBYTE pOutline, FX_LPDWORD pDIB, FX_ARGB argb) { - FX_INT32 padding = ((iWidth + 3) / 4) * 4 - iWidth; + int32_t padding = ((iWidth + 3) / 4) * 4 - iWidth; FX_DWORD alpha; - FX_INT32 i, j; + int32_t i, j; for (j = iHeight - 1; j >= 0; --j) { for (i = iWidth - 1; i >= 0; --i) { if ((alpha = *pOutline++) == 0) { diff --git a/xfa/src/fgas/src/font/fx_gdifont.h b/xfa/src/fgas/src/font/fx_gdifont.h index 3c159f5057..b9143602e6 100644 --- a/xfa/src/fgas/src/font/fx_gdifont.h +++ b/xfa/src/fgas/src/font/fx_gdifont.h @@ -31,7 +31,7 @@ public: virtual void Release(); virtual IFX_Font* Retain(); FX_BOOL LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage); - FX_BOOL LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength); + FX_BOOL LoadFont(FX_LPCBYTE pBuffer, int32_t iLength); FX_BOOL LoadFont(FX_LPCWSTR pszFileName); FX_BOOL LoadFont(IFX_Stream *pFontStream); FX_BOOL LoadFont(const LOGFONTW &lf); @@ -44,23 +44,23 @@ public: { return m_dwStyles; } - virtual FX_BYTE GetCharSet() const + virtual uint8_t GetCharSet() const { return m_LogFont.lfCharSet; } - virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode = FALSE); - virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE); - virtual FX_INT32 GetAscent() const; - virtual FX_INT32 GetDescent() const; + virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode = FALSE); + virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE); + virtual int32_t GetAscent() const; + virtual int32_t GetDescent() const; virtual FX_BOOL GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bCharCode = FALSE); virtual FX_BOOL GetBBox(CFX_Rect &bbox); - virtual FX_INT32 GetItalicAngle() const; + virtual int32_t GetItalicAngle() const; virtual void Reset(); - FX_DWORD GetGlyphDIBits(FX_INT32 iGlyphIndex, FX_ARGB argb, const MAT2 *pMatrix, GLYPHMETRICS &gm, FX_LPVOID pBuffer, FX_DWORD bufSize); + FX_DWORD GetGlyphDIBits(int32_t iGlyphIndex, FX_ARGB argb, const MAT2 *pMatrix, GLYPHMETRICS &gm, FX_LPVOID pBuffer, FX_DWORD bufSize); FX_DWORD GetHashCode() const; protected: IFX_FontMgr *m_pFontMgr; - FX_INT32 m_iRefCount; + int32_t m_iRefCount; CFX_WordDiscreteArray m_WidthCache; OUTLINETEXTMETRICW m_OutlineTM; HGDIOBJ m_hOldFont; @@ -75,13 +75,13 @@ protected: CFX_MapPtrToPtr m_FontMapper; CFX_MapPtrToPtr m_FontCache; void ClearCache(); - FX_INT32 GetFontFamilies(Gdiplus::FontCollection &fc); + int32_t GetFontFamilies(Gdiplus::FontCollection &fc); void RetrieveFontStyles(); - IFX_Font* GetSubstFont(FX_INT32 iGlyphIndex) const; - FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE); - FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode = FALSE); + IFX_Font* GetSubstFont(int32_t iGlyphIndex) const; + FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE); + int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode = FALSE); FX_DWORD GetMAT2HashCode(const FIXED *pFixed); - void CreateGlyphBitmap(FX_INT32 iWidth, FX_INT32 iHeight, FX_LPBYTE pOutline, FX_LPDWORD pDIB, FX_ARGB argb); + void CreateGlyphBitmap(int32_t iWidth, int32_t iHeight, FX_LPBYTE pOutline, FX_LPDWORD pDIB, FX_ARGB argb); friend class CFX_GdiFontMgr; }; #endif diff --git a/xfa/src/fgas/src/font/fx_gefont.cpp b/xfa/src/fgas/src/font/fx_gefont.cpp index f952bc730e..a67b7b47bb 100644 --- a/xfa/src/fgas/src/font/fx_gefont.cpp +++ b/xfa/src/fgas/src/font/fx_gefont.cpp @@ -24,7 +24,7 @@ IFX_Font* IFX_Font::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX return pFont; #endif } -IFX_Font* IFX_Font::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, IFX_FontMgr *pFontMgr) +IFX_Font* IFX_Font::LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, IFX_FontMgr *pFontMgr) { #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ if (NULL != pFontMgr) { @@ -138,8 +138,8 @@ CFX_GEFont::CFX_GEFont(const CFX_GEFont &src, FX_DWORD dwFontStyles) } CFX_GEFont::~CFX_GEFont() { - FX_INT32 iCount = m_SubstFonts.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_SubstFonts.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { IFX_Font *pFont = (IFX_Font*)m_SubstFonts[i]; pFont->Release(); } @@ -213,7 +213,7 @@ FX_BOOL CFX_GEFont::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX if (dwFontStyles & FX_FONTSTYLE_ExactMatch) { dwFlags |= FXFONT_EXACTMATCH; } - FX_INT32 iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL; + int32_t iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL; FX_WORD wCharSet = FX_GetCharsetFromCodePage(wCodePage); if (wCharSet == 0xFFFF) { wCharSet = FXSYS_GetACP(); @@ -235,7 +235,7 @@ FX_BOOL CFX_GEFont::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX Unlock(); return bRet; } -FX_BOOL CFX_GEFont::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 length) +FX_BOOL CFX_GEFont::LoadFont(FX_LPCBYTE pBuffer, int32_t length) { if (m_pFont != NULL) { return FALSE; @@ -355,11 +355,11 @@ IFX_Font* CFX_GEFont::Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage ) } return FX_NEW CFX_GEFont(*this, dwFontStyles); } -FX_BYTE CFX_GEFont::GetCharSet() const +uint8_t CFX_GEFont::GetCharSet() const { FXSYS_assert(m_pFont != NULL); if (m_wCharSet != 0xFFFF) { - return (FX_BYTE)m_wCharSet; + return (uint8_t)m_wCharSet; } if (m_pFont->m_pSubstFont == NULL) { return FX_CHARSET_Default; @@ -405,18 +405,18 @@ FX_DWORD CFX_GEFont::GetFontStyles() const } return dwStyles; } -FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode) +FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode) { return GetCharWidth(wUnicode, iWidth, TRUE, bCharCode); } -FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode) +FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode) { FXSYS_assert (m_pCharWidthMap != NULL); iWidth = m_pCharWidthMap->GetAt(wUnicode, 0); if (iWidth < 1) { if (!m_pProvider || !m_pProvider->GetCharWidth(this, wUnicode, iWidth, bCharCode)) { IFX_Font *pFont = NULL; - FX_INT32 iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode); + int32_t iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode); if (iGlyph != 0xFFFF && pFont != NULL) { if (pFont == (IFX_Font*)this) { iWidth = m_pFont->GetGlyphWidth(iGlyph); @@ -431,7 +431,7 @@ FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bR } } Lock(); - m_pCharWidthMap->SetAtGrow(wUnicode, (FX_SHORT)iWidth); + m_pCharWidthMap->SetAtGrow(wUnicode, (int16_t)iWidth); Unlock(); } else if (iWidth == 65535) { iWidth = -1; @@ -447,9 +447,9 @@ FX_BOOL CFX_GEFont::GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bRecu FXSYS_assert(m_pRectArray != NULL); FXSYS_assert(m_pBBoxMap != NULL); FX_LPVOID pRect = NULL; - if (!m_pBBoxMap->Lookup((void*)(FX_UINTPTR)wUnicode, pRect)) { + if (!m_pBBoxMap->Lookup((void*)(uintptr_t)wUnicode, pRect)) { IFX_Font *pFont = NULL; - FX_INT32 iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode); + int32_t iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode); if (iGlyph != 0xFFFF && pFont != NULL) { if (pFont == (IFX_Font*)this) { FX_RECT rtBBox; @@ -457,9 +457,9 @@ FX_BOOL CFX_GEFont::GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bRecu Lock(); CFX_Rect rt; rt.Set(rtBBox.left, rtBBox.top, rtBBox.Width(), rtBBox.Height()); - FX_INT32 index = m_pRectArray->Add(rt); + int32_t index = m_pRectArray->Add(rt); pRect = m_pRectArray->GetPtrAt(index); - m_pBBoxMap->SetAt((void*)(FX_UINTPTR)wUnicode, pRect); + m_pBBoxMap->SetAt((void*)(uintptr_t)wUnicode, pRect); Unlock(); } } else if (((CFX_GEFont*)pFont)->GetCharBBox(wUnicode, bbox, FALSE, bCharCode)) { @@ -485,21 +485,21 @@ FX_BOOL CFX_GEFont::GetBBox(CFX_Rect &bbox) } return bRet; } -FX_INT32 CFX_GEFont::GetItalicAngle() const +int32_t CFX_GEFont::GetItalicAngle() const { if (m_pFont->m_pSubstFont == NULL) { return 0; } return m_pFont->m_pSubstFont->m_ItalicAngle; } -FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode) +int32_t CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode) { return GetGlyphIndex(wUnicode, TRUE, NULL, bCharCode); } -FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode) +int32_t CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode) { FXSYS_assert (m_pFontEncoding != NULL); - FX_INT32 iGlyphIndex = m_pFontEncoding->GlyphFromCharCode(wUnicode); + int32_t iGlyphIndex = m_pFontEncoding->GlyphFromCharCode(wUnicode); if (iGlyphIndex > 0) { if (ppFont != NULL) { *ppFont = (IFX_Font*)this; @@ -515,11 +515,11 @@ FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Fo return 0xFFFF; } IFX_Font *pFont = NULL; - m_FontMapper.Lookup((void*)(FX_UINTPTR)wUnicode, (void*&)pFont); + m_FontMapper.Lookup((void*)(uintptr_t)wUnicode, (void*&)pFont); if (pFont != NULL && pFont != (IFX_Font*)this) { iGlyphIndex = ((CFX_GEFont*)pFont)->GetGlyphIndex(wUnicode, FALSE, NULL, bCharCode); if (iGlyphIndex != 0xFFFF) { - FX_INT32 i = m_SubstFonts.Find(pFont); + int32_t i = m_SubstFonts.Find(pFont); if (i > -1) { iGlyphIndex |= ((i + 1) << 24); if (ppFont != NULL) { @@ -545,8 +545,8 @@ FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Fo pFont->Release(); return 0xFFFF; } - m_FontMapper.SetAt((void*)(FX_UINTPTR)wUnicode, (void*)pFont); - FX_INT32 i = m_SubstFonts.GetSize(); + m_FontMapper.SetAt((void*)(uintptr_t)wUnicode, (void*)pFont); + int32_t i = m_SubstFonts.GetSize(); m_SubstFonts.Add(pFont); iGlyphIndex = ((CFX_GEFont*)pFont)->GetGlyphIndex(wUnicode, FALSE, NULL, bCharCode); if (iGlyphIndex != 0xFFFF) { @@ -560,19 +560,19 @@ FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Fo } return 0xFFFF; } -FX_INT32 CFX_GEFont::GetAscent() const +int32_t CFX_GEFont::GetAscent() const { return m_pFont->GetAscent(); } -FX_INT32 CFX_GEFont::GetDescent() const +int32_t CFX_GEFont::GetDescent() const { return m_pFont->GetDescent(); } void CFX_GEFont::Reset() { Lock(); - FX_INT32 iCount = m_SubstFonts.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_SubstFonts.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { IFX_Font *pFont = (IFX_Font*)m_SubstFonts[i]; ((CFX_GEFont*)pFont)->Reset(); } @@ -587,7 +587,7 @@ void CFX_GEFont::Reset() } Unlock(); } -IFX_Font* CFX_GEFont::GetSubstFont(FX_INT32 iGlyphIndex) const +IFX_Font* CFX_GEFont::GetSubstFont(int32_t iGlyphIndex) const { iGlyphIndex = ((FX_DWORD)iGlyphIndex) >> 24; return iGlyphIndex == 0 ? (IFX_Font*)this : (IFX_Font*)m_SubstFonts[iGlyphIndex - 1]; diff --git a/xfa/src/fgas/src/font/fx_gefont.h b/xfa/src/fgas/src/font/fx_gefont.h index 585a04c638..e03fd8844e 100644 --- a/xfa/src/fgas/src/font/fx_gefont.h +++ b/xfa/src/fgas/src/font/fx_gefont.h @@ -20,7 +20,7 @@ public: virtual void Release(); virtual IFX_Font* Retain(); FX_BOOL LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage); - FX_BOOL LoadFont(FX_LPCBYTE pBuffer, FX_INT32 length); + FX_BOOL LoadFont(FX_LPCBYTE pBuffer, int32_t length); FX_BOOL LoadFont(FX_LPCWSTR pszFileName); FX_BOOL LoadFont(IFX_Stream *pFontStream, FX_BOOL bSaveStream); FX_BOOL LoadFont(CFX_Font *pExtFont, FX_BOOL bTakeOver = FALSE); @@ -28,16 +28,16 @@ public: virtual void GetFamilyName(CFX_WideString &wsFamily) const; virtual void GetPsName(CFX_WideString &wsName) const; virtual FX_DWORD GetFontStyles() const; - virtual FX_BYTE GetCharSet() const; - virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode = FALSE); - virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE); - virtual FX_INT32 GetAscent() const; - virtual FX_INT32 GetDescent() const; + virtual uint8_t GetCharSet() const; + virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode = FALSE); + virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE); + virtual int32_t GetAscent() const; + virtual int32_t GetDescent() const; virtual FX_BOOL GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bCharCode = FALSE); virtual FX_BOOL GetBBox(CFX_Rect &bbox); - virtual FX_INT32 GetItalicAngle() const; + virtual int32_t GetItalicAngle() const; virtual void Reset(); - virtual IFX_Font* GetSubstFont(FX_INT32 iGlyphIndex) const; + virtual IFX_Font* GetSubstFont(int32_t iGlyphIndex) const; virtual void* GetDevFont()const { return (void*)m_pFont; @@ -60,7 +60,7 @@ protected: #endif CFX_Font *m_pFont; IFX_FontMgr *m_pFontMgr; - FX_INT32 m_iRefCount; + int32_t m_iRefCount; FX_BOOL m_bExtFont; IFX_Stream *m_pStream; IFX_FileRead *m_pFileRead; @@ -74,8 +74,8 @@ protected: CFX_MapPtrToPtr m_FontMapper; void InitFont(); FX_BOOL GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE); - FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE); - FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode = FALSE); + FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE); + int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode = FALSE); }; #endif #endif diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp b/xfa/src/fgas/src/font/fx_stdfontmgr.cpp index 7f153b16d3..2f4ef2038f 100644 --- a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp +++ b/xfa/src/fgas/src/font/fx_stdfontmgr.cpp @@ -44,7 +44,7 @@ CFX_StdFontMgrImp::~CFX_StdFontMgrImp() m_FileFonts.RemoveAll(); m_StreamFonts.RemoveAll(); m_DeriveFonts.RemoveAll(); - for (FX_INT32 i = m_Fonts.GetUpperBound(); i >= 0; i--) { + for (int32_t i = m_Fonts.GetUpperBound(); i >= 0; i--) { IFX_Font *pFont = (IFX_Font*)m_Fonts[i]; if (pFont != NULL) { pFont->Release(); @@ -56,7 +56,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dw { FX_DWORD dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles); IFX_Font *pFont = NULL; - if (m_CPFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) { + if (m_CPFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) { return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : NULL; } FX_LPCFONTDESCRIPTOR pFD; @@ -69,14 +69,14 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dw pFont = IFX_Font::LoadFont(pFD->wsFontFace, dwFontStyles, wCodePage, this); if (pFont != NULL) { m_Fonts.Add(pFont); - m_CPFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + m_CPFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); dwHash = FGAS_GetFontFamilyHash(pFD->wsFontFace, dwFontStyles, wCodePage); - m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); return LoadFont(pFont, dwFontStyles, wCodePage); } return NULL; } -IFX_Font* CFX_StdFontMgrImp::GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily) +IFX_Font* CFX_StdFontMgrImp::GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily) { return GetDefFontByCodePage(FX_GetCodePageFromCharset(nCharset), dwFontStyles, pszFontFamily); } @@ -89,7 +89,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwF } FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontFamily, dwFontStyles, pRet->wBitField); IFX_Font *pFont = NULL; - if (m_UnicodeFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) { + if (m_UnicodeFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) { return pFont ? LoadFont(pFont, dwFontStyles, pRet->wCodePage) : NULL; } #ifdef _FX_USEGASFONTMGR_ @@ -109,7 +109,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwF if (pBuiltinMapper == NULL) { return NULL; } - FX_INT32 iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL; + int32_t iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL; int italic_angle = 0; FXFT_Face ftFace = pBuiltinMapper->FindSubstFontByUnicode(wUnicode, dwFontStyles, iWeight, italic_angle); if (ftFace == NULL) { @@ -129,11 +129,11 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwF #endif if (pFont != NULL) { m_Fonts.Add(pFont); - m_UnicodeFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + m_UnicodeFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles); - m_CPFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + m_CPFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); dwHash = FGAS_GetFontFamilyHash(pFontFace, dwFontStyles, wCodePage); - m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); return LoadFont(pFont, dwFontStyles, wCodePage); } return NULL; @@ -146,7 +146,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontS { FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontFamily, dwFontStyles, wCodePage); IFX_Font *pFont = NULL; - if (m_FamilyFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) { + if (m_FamilyFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) { return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : NULL; } FX_LPCFONTDESCRIPTOR pFD = NULL; @@ -161,14 +161,14 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontS pFont = IFX_Font::LoadFont(pFD->wsFontFace, dwFontStyles, wCodePage, this); if (pFont != NULL) { m_Fonts.Add(pFont); - m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles); - m_CPFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + m_CPFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); return LoadFont(pFont, dwFontStyles, wCodePage); } return NULL; } -IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength) +IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCBYTE pBuffer, int32_t iLength) { FXSYS_assert(pBuffer != NULL && iLength > 0); IFX_Font *pFont = NULL; @@ -190,7 +190,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCWSTR pszFileName) FXSYS_assert(pszFileName != NULL); FX_DWORD dwHash = FX_HashCode_String_GetW(pszFileName, -1); IFX_Font *pFont = NULL; - if (m_FileFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) { + if (m_FileFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) { if (pFont != NULL) { return pFont->Retain(); } @@ -198,7 +198,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCWSTR pszFileName) pFont = IFX_Font::LoadFont(pszFileName, NULL); if (pFont != NULL) { m_Fonts.Add(pFont); - m_FileFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + m_FileFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); return pFont->Retain(); } return NULL; @@ -211,7 +211,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream *pFontStream, FX_LPCWSTR pszFon if (pFont != NULL) { if (pszFontAlias != NULL) { FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontAlias, dwFontStyles, wCodePage); - m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); } return LoadFont(pFont, dwFontStyles, wCodePage); } @@ -222,7 +222,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream *pFontStream, FX_LPCWSTR pszFon m_StreamFonts.SetAt((void*)pFontStream, (void*)pFont); if (pszFontAlias != NULL) { FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontAlias, dwFontStyles, wCodePage); - m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); + m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); } return LoadFont(pFont, dwFontStyles, wCodePage); } @@ -234,19 +234,19 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Font *pSrcFont, FX_DWORD dwFontStyles, if (pSrcFont->GetFontStyles() == dwFontStyles) { return pSrcFont->Retain(); } - void* buffer[3] = {pSrcFont, (void*)(FX_UINTPTR)dwFontStyles, (void*)(FX_UINTPTR)wCodePage}; + void* buffer[3] = {pSrcFont, (void*)(uintptr_t)dwFontStyles, (void*)(uintptr_t)wCodePage}; FX_DWORD dwHash = FX_HashCode_String_GetA((FX_LPCSTR)buffer, 3 * sizeof(void*)); IFX_Font *pFont = NULL; if (m_DeriveFonts.GetCount() > 0) { - m_DeriveFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont); + m_DeriveFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont); if (pFont != NULL) { return pFont->Retain(); } } pFont = pSrcFont->Derive(dwFontStyles, wCodePage); if (pFont != NULL) { - m_DeriveFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont); - FX_INT32 index = m_Fonts.Find(pFont); + m_DeriveFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont); + int32_t index = m_Fonts.Find(pFont); if (index < 0) { m_Fonts.Add(pFont); pFont->Retain(); @@ -257,8 +257,8 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Font *pSrcFont, FX_DWORD dwFontStyles, } void CFX_StdFontMgrImp::ClearFontCache() { - FX_INT32 iCount = m_Fonts.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_Fonts.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { IFX_Font *pFont = (IFX_Font*)m_Fonts[i]; if (pFont != NULL) { pFont->Reset(); @@ -289,7 +289,7 @@ void CFX_StdFontMgrImp::RemoveFont(IFX_Font *pFont) RemoveFont(m_FileFonts, pFont); RemoveFont(m_StreamFonts, pFont); RemoveFont(m_DeriveFonts, pFont); - FX_INT32 iFind = m_Fonts.Find(pFont); + int32_t iFind = m_Fonts.Find(pFont); if (iFind > -1) { m_Fonts.RemoveAt(iFind, 1); } @@ -319,7 +319,7 @@ FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(FX_LPCWSTR pszFontFamily, FX_DW if (pDesc == NULL) { return NULL; } - for (FX_INT32 i = m_FontFaces.GetSize() - 1; i >= 0; i--) { + for (int32_t i = m_FontFaces.GetSize() - 1; i >= 0; i--) { FX_LPCFONTDESCRIPTOR pMatch = m_FontFaces.GetPtrAt(i); if (*pMatch == *pDesc) { return pMatch; @@ -333,10 +333,10 @@ FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(FX_LPCWSTR pszFontFamily, FX_DW FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, const CFX_FontDescriptors &fonts, FX_LPVOID pUserData) { FX_LPCFONTDESCRIPTOR pBestFont = NULL; - FX_INT32 iBestSimilar = 0; + int32_t iBestSimilar = 0; FX_BOOL bMatchStyle = (pParams->dwMatchFlags & FX_FONTMATCHPARA_MacthStyle) > 0; - FX_INT32 iCount = fonts.GetSize(); - for (FX_INT32 i = 0; i < iCount; ++i) { + int32_t iCount = fonts.GetSize(); + for (int32_t i = 0; i < iCount; ++i) { FX_LPCFONTDESCRIPTOR pFont = fonts.GetPtrAt(i); if ((pFont->dwFontStyles & FX_FONTSTYLE_BoldItalic) == FX_FONTSTYLE_BoldItalic) { continue; @@ -377,7 +377,7 @@ FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, const CFX_F return pFont; } } - FX_INT32 iSimilarValue = FX_GetSimilarValue(pFont, pParams->dwFontStyles); + int32_t iSimilarValue = FX_GetSimilarValue(pFont, pParams->dwFontStyles); if (iBestSimilar < iSimilarValue) { iBestSimilar = iSimilarValue; pBestFont = pFont; @@ -385,9 +385,9 @@ FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, const CFX_F } return iBestSimilar < 1 ? NULL : pBestFont; } -FX_INT32 FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles) +int32_t FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles) { - FX_INT32 iValue = 0; + int32_t iValue = 0; if ((dwFontStyles & FX_FONTSTYLE_Symbolic) == (pFont->dwFontStyles & FX_FONTSTYLE_Symbolic)) { iValue += 64; } @@ -412,7 +412,7 @@ FX_DWORD FX_GetGdiFontStyles(const LOGFONTW &lf) if ((lf.lfPitchAndFamily & 0x03) == FIXED_PITCH) { dwStyles |= FX_FONTSTYLE_FixedPitch; } - FX_BYTE nFamilies = lf.lfPitchAndFamily & 0xF0; + uint8_t nFamilies = lf.lfPitchAndFamily & 0xF0; if (nFamilies == FF_ROMAN) { dwStyles |= FX_FONTSTYLE_Serif; } @@ -424,7 +424,7 @@ FX_DWORD FX_GetGdiFontStyles(const LOGFONTW &lf) } return dwStyles; } -static FX_INT32 CALLBACK FX_GdiFontEnumProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, DWORD dwFontType, LPARAM lParam) +static int32_t CALLBACK FX_GdiFontEnumProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, DWORD dwFontType, LPARAM lParam) { if (dwFontType != TRUETYPE_FONTTYPE) { return 1; @@ -481,7 +481,7 @@ FX_LPCSTR g_FontFolders[] = { }; CFX_FontSourceEnum_File::CFX_FontSourceEnum_File() { - for (FX_INT32 i = 0; i < sizeof(g_FontFolders) / sizeof(FX_LPCSTR); i++) { + for (int32_t i = 0; i < sizeof(g_FontFolders) / sizeof(FX_LPCSTR); i++) { m_FolderPaths.Add(g_FontFolders[i]); } } @@ -601,13 +601,13 @@ FX_BOOL CFX_FontMgrImp::EnumFonts() pFontSource->Release(); continue; } - FX_INT32 nFaceCount = pFace->num_faces; + int32_t nFaceCount = pFace->num_faces; ReportFace(pFace, m_InstalledFonts, pFontSource); if (FXFT_Get_Face_External_Stream(pFace)) { FXFT_Clear_Face_External_Stream(pFace); } FXFT_Done_Face(pFace); - for (FX_INT32 i = 1; i < nFaceCount; i++) { + for (int32_t i = 1; i < nFaceCount; i++) { if (NULL == (pFace = LoadFace(pFontStream, i))) { continue; } @@ -624,7 +624,7 @@ FX_BOOL CFX_FontMgrImp::EnumFonts() } void CFX_FontMgrImp::Release() { - for (FX_INT32 i = 0; i < m_InstalledFonts.GetSize(); i++) { + for (int32_t i = 0; i < m_InstalledFonts.GetSize(); i++) { delete m_InstalledFonts[i]; } FX_POSITION pos = m_Hash2CandidateList.GetStartPosition(); @@ -677,7 +677,7 @@ IFX_Font* CFX_FontMgrImp::GetDefFontByCodePage( FX_WORD wCodePage, FX_DWORD dwFo { return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByCodePage(this, wCodePage, dwFontStyles, pszFontFamily); } -IFX_Font* CFX_FontMgrImp::GetDefFontByCharset( FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily ) +IFX_Font* CFX_FontMgrImp::GetDefFontByCharset( uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily ) { return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByCharset(this, nCharset, dwFontStyles, pszFontFamily); } @@ -729,7 +729,7 @@ IFX_Font* CFX_FontMgrImp::GetFontByCodePage( FX_WORD wCodePage, FX_DWORD dwFontS pFonts->Add(pFont); return pFont; } -IFX_Font* CFX_FontMgrImp::GetFontByCharset( FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily ) +IFX_Font* CFX_FontMgrImp::GetFontByCharset( uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily ) { return GetFontByCodePage(FX_GetCodePageFromCharset(nCharset), dwFontStyles, pszFontFamily); } @@ -756,7 +756,7 @@ IFX_Font* CFX_FontMgrImp::GetFontByUnicode( FX_WCHAR wUnicode, FX_DWORD dwFontSt return NULL; } if (0 != pFonts->GetSize()) { - for (FX_INT32 i = 0; i < pFonts->GetSize(); i++) { + for (int32_t i = 0; i < pFonts->GetSize(); i++) { if (VerifyUnicode(pFonts->GetAt(i), wUnicode)) { return pFonts->GetAt(i)->Retain(); } @@ -776,7 +776,7 @@ IFX_Font* CFX_FontMgrImp::GetFontByUnicode( FX_WCHAR wUnicode, FX_DWORD dwFontSt MatchFonts(*sortedFonts, wCodePage, dwFontStyles, CFX_WideString(pszFontFamily), wUnicode); m_Hash2CandidateList.SetAt(dwHash, sortedFonts); } - for (FX_INT32 i = 0; i < sortedFonts->GetSize(); i++) { + for (int32_t i = 0; i < sortedFonts->GetSize(); i++) { CFX_FontDescriptor* pDesc = sortedFonts->GetAt(i).pFont; if (VerifyUnicode(pDesc, wUnicode)) { pFont = LoadFont(pDesc->m_pFileAccess, pDesc->m_nFaceIndex, NULL); @@ -846,9 +846,9 @@ IFX_Font* CFX_FontMgrImp::GetFontByLanguage( FX_WORD wLanguage, FX_DWORD dwFontS { return GetFontByCodePage(FX_GetDefCodePageByLanguage(wLanguage), dwFontStyles, pszFontFamily); } -IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCBYTE pBuffer, FX_INT32 iLength, FX_INT32 iFaceIndex, FX_INT32* pFaceCount ) +IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCBYTE pBuffer, int32_t iLength, int32_t iFaceIndex, int32_t* pFaceCount ) { - FX_LPVOID Hash[2] = {(FX_LPVOID)(FX_UINTPTR)pBuffer, (FX_LPVOID)(FX_UINTPTR)iLength}; + FX_LPVOID Hash[2] = {(FX_LPVOID)(uintptr_t)pBuffer, (FX_LPVOID)(uintptr_t)iLength}; FX_DWORD dwHash = FX_HashCode_String_GetA((FX_LPCSTR)Hash, 2 * sizeof (FX_LPVOID)); IFX_FileAccess* pFontAccess = NULL; if (!m_Hash2FileAccess.Lookup(dwHash, pFontAccess)) { @@ -859,7 +859,7 @@ IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCBYTE pBuffer, FX_INT32 iLength, FX_INT return NULL; } } -IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCWSTR pszFileName, FX_INT32 iFaceIndex, FX_INT32* pFaceCount ) +IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCWSTR pszFileName, int32_t iFaceIndex, int32_t* pFaceCount ) { CFX_ByteString bsHash; bsHash += CFX_WideString(pszFileName).UTF8Encode(); @@ -875,9 +875,9 @@ IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCWSTR pszFileName, FX_INT32 iFaceIndex, return NULL; } } -IFX_Font* CFX_FontMgrImp::LoadFont( IFX_Stream* pFontStream, FX_INT32 iFaceIndex, FX_INT32* pFaceCount, FX_BOOL bSaveStream ) +IFX_Font* CFX_FontMgrImp::LoadFont( IFX_Stream* pFontStream, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bSaveStream ) { - FX_LPVOID Hash[1] = {(FX_LPVOID)(FX_UINTPTR)pFontStream}; + FX_LPVOID Hash[1] = {(FX_LPVOID)(uintptr_t)pFontStream}; FX_DWORD dwHash = FX_HashCode_String_GetA((FX_LPCSTR)Hash, 1 * sizeof (FX_LPVOID)); IFX_FileAccess* pFontAccess = NULL; if (!m_Hash2FileAccess.Lookup(dwHash, pFontAccess)) { @@ -888,13 +888,13 @@ IFX_Font* CFX_FontMgrImp::LoadFont( IFX_Stream* pFontStream, FX_INT32 iFaceIndex return NULL; } } -IFX_Font* CFX_FontMgrImp::LoadFont( IFX_FileAccess* pFontAccess, FX_INT32 iFaceIndex, FX_INT32* pFaceCount, FX_BOOL bWantCache ) +IFX_Font* CFX_FontMgrImp::LoadFont( IFX_FileAccess* pFontAccess, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bWantCache ) { FX_DWORD dwHash = 0; IFX_Font* pFont = NULL; if (bWantCache) { CFX_ByteString bsHash; - bsHash.Format("%d, %d", (FX_UINTPTR)pFontAccess, iFaceIndex); + bsHash.Format("%d, %d", (uintptr_t)pFontAccess, iFaceIndex); dwHash = FX_HashCode_String_GetA(bsHash, bsHash.GetLength()); if (m_FileAccess2IFXFont.Lookup(dwHash, pFont)) { if (NULL != pFont) { @@ -952,7 +952,7 @@ extern "C" { } }; -FXFT_Face CFX_FontMgrImp::LoadFace( IFX_FileRead* pFontStream, FX_INT32 iFaceIndex ) +FXFT_Face CFX_FontMgrImp::LoadFace( IFX_FileRead* pFontStream, int32_t iFaceIndex ) { FXFT_Library& library = CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary; FXFT_Open_Args ftArgs; @@ -991,17 +991,17 @@ BadRet: } return NULL; } -FX_INT32 CFX_FontMgrImp::MatchFonts( CFX_FontDescriptorInfos& MatchedFonts, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode ) +int32_t CFX_FontMgrImp::MatchFonts( CFX_FontDescriptorInfos& MatchedFonts, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode ) { MatchedFonts.RemoveAll(); CFX_WideString wsNormalizedFontName = FontName; NormalizeFontName(wsNormalizedFontName); - static const FX_INT32 nMax = 0xffff; + static const int32_t nMax = 0xffff; CFX_FontDescriptor* pFont = NULL; - FX_INT32 nCount = m_InstalledFonts.GetSize(); - for (FX_INT32 i = 0; i < nCount; i++) { + int32_t nCount = m_InstalledFonts.GetSize(); + for (int32_t i = 0; i < nCount; i++) { pFont = m_InstalledFonts[i]; - FX_INT32 nPenalty = CalcPenalty(pFont, wCodePage, dwFontStyles, wsNormalizedFontName, wcUnicode); + int32_t nPenalty = CalcPenalty(pFont, wCodePage, dwFontStyles, wsNormalizedFontName, wcUnicode); if (nPenalty >= 0xFFFF) { continue; } @@ -1092,7 +1092,7 @@ static const FX_BitCodePage g_Bit2CodePage[] = { }; FX_WORD FX_GetCodePageBit(FX_WORD wCodePage) { - for (FX_INT32 i = 0; i < sizeof(g_Bit2CodePage) / sizeof (FX_BitCodePage); i++) { + for (int32_t i = 0; i < sizeof(g_Bit2CodePage) / sizeof (FX_BitCodePage); i++) { if (g_Bit2CodePage[i].wCodePage == wCodePage) { return g_Bit2CodePage[i].wBit; } @@ -1107,12 +1107,12 @@ FX_WORD FX_GetUnicodeBit(FX_WCHAR wcUnicode) } return x->wBitField; } -FX_INT32 CFX_FontMgrImp::CalcPenalty( CFX_FontDescriptor* pInstalled, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode ) +int32_t CFX_FontMgrImp::CalcPenalty( CFX_FontDescriptor* pInstalled, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode ) { - FX_INT32 nPenalty = 30000; + int32_t nPenalty = 30000; if (0 != FontName.GetLength()) { if (FontName != pInstalled->m_wsFaceName) { - FX_INT32 i; + int32_t i; for (i = 0; i < pInstalled->m_wsFamilyNames.GetSize(); i++) { if (pInstalled->m_wsFamilyNames[i] == FontName) { break; @@ -1127,7 +1127,7 @@ FX_INT32 CFX_FontMgrImp::CalcPenalty( CFX_FontDescriptor* pInstalled, FX_WORD wC nPenalty -= 30000; } if (30000 == nPenalty && 0 == IsPartName(pInstalled->m_wsFaceName, FontName)) { - FX_INT32 i; + int32_t i; for (i = 0; i < pInstalled->m_wsFamilyNames.GetSize(); i++) { if (0 != IsPartName(pInstalled->m_wsFamilyNames[i], FontName)) { break; @@ -1236,7 +1236,7 @@ void CFX_FontMgrImp::RemoveFont( IFX_Font* pEFont ) CFX_ArrayTemplate* pFonts; m_Hash2Fonts.GetNextAssoc(pos, dwHash, pFonts); if (NULL != pFonts) { - for (FX_INT32 i = 0; i < pFonts->GetSize(); i++) { + for (int32_t i = 0; i < pFonts->GetSize(); i++) { if (pFonts->GetAt(i) == pEFont) { pFonts->SetAt(i, NULL); } @@ -1267,7 +1267,7 @@ void CFX_FontMgrImp::ReportFace( FXFT_Face pFace, CFX_FontDescriptors& Fonts, IF FT_ENC_TAG(dwTag, 'n', 'a', 'm', 'e'); unsigned int error = FXFT_Load_Sfnt_Table(pFace, dwTag, 0, NULL, &nLength); if (0 == error && 0 != nLength) { - pTable = FX_Alloc(FX_BYTE, nLength); + pTable = FX_Alloc(uint8_t, nLength); if (NULL != pTable) { error = FXFT_Load_Sfnt_Table(pFace, dwTag, 0, pTable, NULL); if (0 != error) { @@ -1285,7 +1285,7 @@ void CFX_FontMgrImp::ReportFace( FXFT_Face pFace, CFX_FontDescriptors& Fonts, IF pFont->m_nFaceIndex = pFace->face_index; pFont->m_pFileAccess = pFontAccess->Retain(); NormalizeFontName(pFont->m_wsFaceName); - for (FX_INT32 i = 0; i < pFont->m_wsFamilyNames.GetSize(); i++) { + for (int32_t i = 0; i < pFont->m_wsFamilyNames.GetSize(); i++) { NormalizeFontName(pFont->m_wsFamilyNames[i]); } Fonts.Add(pFont); @@ -1304,16 +1304,16 @@ FX_DWORD CFX_FontMgrImp::GetFlags(FXFT_Face pFace) flag |= FX_FONTSTYLE_Symbolic; } if (pOS2->panose[0] == 2) { - FX_BYTE uSerif = pOS2->panose[1]; + uint8_t uSerif = pOS2->panose[1]; if ((uSerif > 1 && uSerif < 10) || uSerif > 13) { flag |= FX_FONTSTYLE_Serif; } } return flag; } -#define GetUInt8(p) ((FX_UINT8)((p)[0])) -#define GetUInt16(p) ((FX_UINT16)((p)[0] << 8 | (p)[1])) -#define GetUInt32(p) ((FX_UINT32)((p)[0] << 24 | (p)[1] << 16 | (p)[2] << 8 | (p)[3])) +#define GetUInt8(p) ((uint8_t)((p)[0])) +#define GetUInt16(p) ((uint16_t)((p)[0] << 8 | (p)[1])) +#define GetUInt32(p) ((uint32_t)((p)[0] << 24 | (p)[1] << 16 | (p)[2] << 8 | (p)[3])) void CFX_FontMgrImp::GetNames(FX_LPCBYTE name_table, CFX_WideStringArray& Names) { if (NULL == name_table) { @@ -1323,25 +1323,25 @@ void CFX_FontMgrImp::GetNames(FX_LPCBYTE name_table, CFX_WideStringArray& Names) CFX_WideString wsFamily; FX_LPBYTE sp = lpTable + 2; FX_LPBYTE lpNameRecord = lpTable + 6; - FX_UINT16 nNameCount = GetUInt16(sp); + uint16_t nNameCount = GetUInt16(sp); FX_LPBYTE lpStr = lpTable + GetUInt16(sp + 2); - for (FX_UINT16 j = 0; j < nNameCount; j++) { - FX_UINT16 nNameID = GetUInt16(lpNameRecord + j * 12 + 6); + for (uint16_t j = 0; j < nNameCount; j++) { + uint16_t nNameID = GetUInt16(lpNameRecord + j * 12 + 6); if (nNameID != 1) { continue; } - FX_UINT16 nPlatformID = GetUInt16(lpNameRecord + j * 12 + 0); - FX_UINT16 nNameLength = GetUInt16(lpNameRecord + j * 12 + 8); - FX_UINT16 nNameOffset = GetUInt16(lpNameRecord + j * 12 + 10); + uint16_t nPlatformID = GetUInt16(lpNameRecord + j * 12 + 0); + uint16_t nNameLength = GetUInt16(lpNameRecord + j * 12 + 8); + uint16_t nNameOffset = GetUInt16(lpNameRecord + j * 12 + 10); wsFamily.Empty(); if (nPlatformID != 1) { - for (FX_UINT16 k = 0; k < nNameLength / 2; k++) { + for (uint16_t k = 0; k < nNameLength / 2; k++) { FX_WCHAR wcTemp = GetUInt16(lpStr + nNameOffset + k * 2); wsFamily += wcTemp; } Names.Add(wsFamily); } else { - for (FX_UINT16 k = 0; k < nNameLength; k++) { + for (uint16_t k = 0; k < nNameLength; k++) { FX_WCHAR wcTemp = GetUInt8(lpStr + nNameOffset + k); wsFamily += wcTemp; } @@ -1429,7 +1429,7 @@ FX_BIT2CHARSET g_FX_Bit2Charset4[16] = { {1 << 15 , FX_CHARSET_US }, }; #define CODEPAGERANGE_IMPLEMENT(n) \ - for (FX_INT32 i = 0; i < 16; i++)\ + for (int32_t i = 0; i < 16; i++)\ {\ if ((a##n & g_FX_Bit2Charset##n[i].wBit) != 0)\ {\ @@ -1480,7 +1480,7 @@ void CFX_FontMgrImp::NormalizeFontName( CFX_WideString& FontName ) FontName.Remove(' '); FontName.Remove('-'); } -FX_INT32 CFX_FontMgrImp::IsPartName( const CFX_WideString& Name1, const CFX_WideString& Name2 ) +int32_t CFX_FontMgrImp::IsPartName( const CFX_WideString& Name1, const CFX_WideString& Name2 ) { if (Name1.Find((FX_LPCWSTR)Name2) != -1) { return 1; diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.h b/xfa/src/fgas/src/font/fx_stdfontmgr.h index ba44233ad0..37b0b63da0 100644 --- a/xfa/src/fgas/src/font/fx_stdfontmgr.h +++ b/xfa/src/fgas/src/font/fx_stdfontmgr.h @@ -7,7 +7,7 @@ #ifndef _FX_FONTMGR_IMP #define _FX_FONTMGR_IMP #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ -FX_INT32 FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles); +int32_t FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles); FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, const CFX_FontDescriptors &fonts, FX_LPVOID pUserData); class CFX_StdFontMgrImp : public IFX_FontMgr { @@ -19,11 +19,11 @@ public: delete this; } virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); - virtual IFX_Font* GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); + virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); virtual IFX_Font* LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF); - virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength); + virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength); virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName); virtual IFX_Font* LoadFont(IFX_Stream *pFontStream, FX_LPCWSTR pszFontAlias = NULL, FX_DWORD dwFontStyles = 0, FX_WORD wCodePage = 0, FX_BOOL bSaveStream = FALSE); virtual IFX_Font* LoadFont(IFX_Font *pSrcFont, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF); @@ -66,7 +66,7 @@ public: } } IFX_FileAccess* m_pFileAccess; - FX_INT32 m_nFaceIndex; + int32_t m_nFaceIndex; CFX_WideString m_wsFaceName; CFX_WideStringArray m_wsFamilyNames; FX_DWORD m_dwFontStyles; @@ -77,7 +77,7 @@ typedef CFX_ArrayTemplate CFX_FontDescriptors; struct FX_FontDescriptorInfo { public: CFX_FontDescriptor* pFont; - FX_INT32 nPenalty; + int32_t nPenalty; FX_BOOL operator > (const FX_FontDescriptorInfo& x) { return this->nPenalty > x.nPenalty; @@ -133,16 +133,16 @@ public: CFX_FontMgrImp(IFX_FontSourceEnum* pFontEnum, IFX_FontMgrDelegate* pDelegate = NULL, FX_LPVOID pUserData = NULL); virtual void Release(); virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); - virtual IFX_Font* GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); + virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); virtual IFX_Font* GetFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); - virtual IFX_Font* GetFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); + virtual IFX_Font* GetFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); virtual IFX_Font* GetFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); virtual IFX_Font* GetFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL); - virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, FX_INT32 iFaceIndex, FX_INT32* pFaceCount); - virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName, FX_INT32 iFaceIndex, FX_INT32* pFaceCount); - virtual IFX_Font* LoadFont(IFX_Stream* pFontStream, FX_INT32 iFaceIndex, FX_INT32* pFaceCount, FX_BOOL bSaveStream = FALSE); + virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, int32_t iFaceIndex, int32_t* pFaceCount); + virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName, int32_t iFaceIndex, int32_t* pFaceCount); + virtual IFX_Font* LoadFont(IFX_Stream* pFontStream, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bSaveStream = FALSE); virtual void ClearFontCache(); virtual void RemoveFont(IFX_Font* pFont); FX_BOOL EnumFonts(); @@ -156,11 +156,11 @@ protected: FX_BOOL VerifyUnicode(CFX_FontDescriptor* pDesc, FX_WCHAR wcUnicode); FX_BOOL VerifyUnicode(IFX_Font* pFont, FX_WCHAR wcUnicode); void NormalizeFontName( CFX_WideString& FontName ); - FX_INT32 IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2); - FX_INT32 MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE); - FX_INT32 CalcPenalty(CFX_FontDescriptor* pInstalled, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE); - IFX_Font* LoadFont(IFX_FileAccess* pFontAccess, FX_INT32 iFaceIndex, FX_INT32* pFaceCount, FX_BOOL bWantCache = FALSE); - FXFT_Face LoadFace(IFX_FileRead* pFontStream, FX_INT32 iFaceIndex); + int32_t IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2); + int32_t MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE); + int32_t CalcPenalty(CFX_FontDescriptor* pInstalled, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE); + IFX_Font* LoadFont(IFX_FileAccess* pFontAccess, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bWantCache = FALSE); + FXFT_Face LoadFace(IFX_FileRead* pFontStream, int32_t iFaceIndex); CFX_HashFontDescsMap m_Hash2CandidateList; CFX_HashFontsMap m_Hash2Fonts; CFX_HashFileMap m_Hash2FileAccess; diff --git a/xfa/src/fgas/src/layout/fx_linebreak.cpp b/xfa/src/fgas/src/layout/fx_linebreak.cpp index 4662e1c122..dde8b8cc61 100644 --- a/xfa/src/fgas/src/layout/fx_linebreak.cpp +++ b/xfa/src/fgas/src/layout/fx_linebreak.cpp @@ -72,7 +72,7 @@ extern const FX_LINEBREAKTYPE gs_FX_LineBreak_PairTable[64][32] = { {FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN}, {FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN}, }; -void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, FX_INT32 iLength) +void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, int32_t iLength) { if (iLength < 2) { return; @@ -82,7 +82,7 @@ void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, FX wch = *pwsText ++; dwCur = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & 0x003F; iLength --; - for (FX_INT32 i = 0; i < iLength; i ++) { + for (int32_t i = 0; i < iLength; i ++) { wch = *pwsText ++; dwNext = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & 0x003F; if (dwNext == FX_CBP_SP) { @@ -94,7 +94,7 @@ void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, FX } pBrkType[iLength] = FX_LBT_INDIRECT_BRK; } -void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_INT32 iLength, CFX_Int32MassArray &bp) +void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, int32_t iLength, CFX_Int32MassArray &bp) { if (iLength < 2) { return; @@ -105,7 +105,7 @@ void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_INT32 iLength, CFX_Int32Mas wch = *pwsText ++; dwCur = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & 0x003F; iLength --; - for (FX_INT32 i = 0; i < iLength; i ++) { + for (int32_t i = 0; i < iLength; i ++) { wch = *pwsText ++; dwNext = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & 0x003F; if (dwNext == FX_CBP_SP) { diff --git a/xfa/src/fgas/src/layout/fx_rtfbreak.cpp b/xfa/src/fgas/src/layout/fx_rtfbreak.cpp index 24c64c453b..95c9118f90 100644 --- a/xfa/src/fgas/src/layout/fx_rtfbreak.cpp +++ b/xfa/src/fgas/src/layout/fx_rtfbreak.cpp @@ -76,7 +76,7 @@ void CFX_RTFBreak::SetLineWidth(FX_FLOAT fLineStart, FX_FLOAT fLineEnd) } void CFX_RTFBreak::SetLinePos(FX_FLOAT fLinePos) { - FX_INT32 iLinePos = FXSYS_round(fLinePos * 20000.0f); + int32_t iLinePos = FXSYS_round(fLinePos * 20000.0f); if (iLinePos > m_iLineEnd) { iLinePos = m_iLineEnd; } @@ -118,7 +118,7 @@ void CFX_RTFBreak::SetFont(IFX_Font *pFont) } void CFX_RTFBreak::SetFontSize(FX_FLOAT fFontSize) { - FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f); + int32_t iFontSize = FXSYS_round(fFontSize * 20.0f); if (m_iFontSize == iFontSize) { return; } @@ -139,16 +139,16 @@ void CFX_RTFBreak::SetTabWidth(FX_FLOAT fTabWidth) } void CFX_RTFBreak::AddPositionedTab(FX_FLOAT fTabPos) { - FX_INT32 iLineEnd = m_iLineEnd; - FX_INT32 iTabPos = FXSYS_round(fTabPos * 20000.0f) + m_iLineStart; + int32_t iLineEnd = m_iLineEnd; + int32_t iTabPos = FXSYS_round(fTabPos * 20000.0f) + m_iLineStart; if (iTabPos > iLineEnd) { iTabPos = iLineEnd; } if (m_PositionedTabs.Find(iTabPos, 0) > -1) { return; } - FX_INT32 iCount = m_PositionedTabs.GetSize(); - FX_INT32 iFind = 0; + int32_t iCount = m_PositionedTabs.GetSize(); + int32_t iFind = 0; for (; iFind < iCount; iFind ++) { if (m_PositionedTabs[iFind] > iTabPos) { break; @@ -164,11 +164,11 @@ void CFX_RTFBreak::AddPositionedTab(FX_FLOAT fTabPos) void CFX_RTFBreak::SetPositionedTabs(const CFX_FloatArray &tabs) { m_PositionedTabs.RemoveAll(); - FX_INT32 iCount = tabs.GetSize(); + int32_t iCount = tabs.GetSize(); m_PositionedTabs.SetSize(iCount); - FX_INT32 iLineEnd = m_iLineEnd; - FX_INT32 iTabPos; - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iLineEnd = m_iLineEnd; + int32_t iTabPos; + for (int32_t i = 0; i < iCount; i ++) { iTabPos = FXSYS_round(tabs[i] * 20000.0f) + m_iLineStart; if (iTabPos > iLineEnd) { iTabPos = iLineEnd; @@ -210,7 +210,7 @@ void CFX_RTFBreak::SetLineBreakTolerance(FX_FLOAT fTolerance) { m_iTolerance = FXSYS_round(fTolerance * 20000.0f); } -void CFX_RTFBreak::SetHorizontalScale(FX_INT32 iScale) +void CFX_RTFBreak::SetHorizontalScale(int32_t iScale) { if (iScale < 0) { iScale = 0; @@ -221,7 +221,7 @@ void CFX_RTFBreak::SetHorizontalScale(FX_INT32 iScale) SetBreakStatus(); m_iHorizontalScale = iScale; } -void CFX_RTFBreak::SetVerticalScale(FX_INT32 iScale) +void CFX_RTFBreak::SetVerticalScale(int32_t iScale) { if (iScale < 0) { iScale = 0; @@ -232,7 +232,7 @@ void CFX_RTFBreak::SetVerticalScale(FX_INT32 iScale) SetBreakStatus(); m_iVerticalScale = iScale; } -void CFX_RTFBreak::SetCharRotation(FX_INT32 iCharRotation) +void CFX_RTFBreak::SetCharRotation(int32_t iCharRotation) { if (iCharRotation < 0) { iCharRotation += (-iCharRotation / 4 + 1) * 4; @@ -260,7 +260,7 @@ void CFX_RTFBreak::SetReadingOrder(FX_BOOL bRTL) { m_bRTL = bRTL; } -void CFX_RTFBreak::SetAlignment(FX_INT32 iAlignment) +void CFX_RTFBreak::SetAlignment(int32_t iAlignment) { FXSYS_assert(iAlignment >= FX_RTFLINEALIGNMENT_Left && iAlignment <= FX_RTFLINEALIGNMENT_Distributed); m_iAlignment = iAlignment; @@ -279,15 +279,15 @@ void CFX_RTFBreak::SetUserData(IFX_Unknown *pUserData) m_pUserData->AddRef(); } } -static const FX_INT32 gs_FX_RTFLineRotations[8] = {0, 3, 1, 0, 2, 1, 3, 2}; -FX_INT32 CFX_RTFBreak::GetLineRotation(FX_DWORD dwStyles) const +static const int32_t gs_FX_RTFLineRotations[8] = {0, 3, 1, 0, 2, 1, 3, 2}; +int32_t CFX_RTFBreak::GetLineRotation(FX_DWORD dwStyles) const { return gs_FX_RTFLineRotations[(dwStyles & 0x0E) >> 1]; } void CFX_RTFBreak::SetBreakStatus() { m_dwIdentity ++; - FX_INT32 iCount = m_pCurLine->CountChars(); + int32_t iCount = m_pCurLine->CountChars(); if (iCount < 1) { return; } @@ -296,15 +296,15 @@ void CFX_RTFBreak::SetBreakStatus() tc.m_dwStatus = FX_RTFBREAK_PieceBreak; } } -CFX_RTFChar* CFX_RTFBreak::GetLastChar(FX_INT32 index) const +CFX_RTFChar* CFX_RTFBreak::GetLastChar(int32_t index) const { CFX_RTFCharArray &tca = m_pCurLine->m_LineChars; - FX_INT32 iCount = tca.GetSize(); + int32_t iCount = tca.GetSize(); if (index < 0 || index >= iCount) { return NULL; } CFX_RTFChar *pTC; - FX_INT32 iStart = iCount - 1; + int32_t iStart = iCount - 1; while (iStart > -1) { pTC = tca.GetDataPtr(iStart --); if (pTC->m_iCharWidth >= 0 || pTC->GetCharType() != FX_CHARTYPE_Combination) { @@ -341,18 +341,18 @@ inline FX_DWORD CFX_RTFBreak::GetUnifiedCharType(FX_DWORD dwType) const { return dwType >= FX_CHARTYPE_ArabicAlef ? FX_CHARTYPE_Arabic : dwType; } -FX_INT32 CFX_RTFBreak::GetLastPositionedTab() const +int32_t CFX_RTFBreak::GetLastPositionedTab() const { - FX_INT32 iCount = m_PositionedTabs.GetSize(); + int32_t iCount = m_PositionedTabs.GetSize(); if (iCount < 1) { return m_iLineStart; } return m_PositionedTabs[iCount - 1]; } -FX_BOOL CFX_RTFBreak::GetPositionedTab(FX_INT32 &iTabPos) const +FX_BOOL CFX_RTFBreak::GetPositionedTab(int32_t &iTabPos) const { - FX_INT32 iCount = m_PositionedTabs.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + 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; @@ -360,7 +360,7 @@ FX_BOOL CFX_RTFBreak::GetPositionedTab(FX_INT32 &iTabPos) const } return FALSE; } -typedef FX_DWORD (CFX_RTFBreak::*FX_RTFBreak_LPFAppendChar)(CFX_RTFChar *pCurChar, FX_INT32 iRotation); +typedef FX_DWORD (CFX_RTFBreak::*FX_RTFBreak_LPFAppendChar)(CFX_RTFChar *pCurChar, int32_t iRotation); static const FX_RTFBreak_LPFAppendChar g_FX_RTFBreak_lpfAppendChar[16] = { &CFX_RTFBreak::AppendChar_Others, &CFX_RTFBreak::AppendChar_Tab, @@ -410,14 +410,14 @@ FX_DWORD CFX_RTFBreak::AppendChar(FX_WCHAR wch) if (!m_bSingleLine && !m_bOrphanLine && m_dwCharType > 0 && m_pCurLine->GetLineEnd() > m_iLineEnd + m_iTolerance) { if (m_dwCharType != FX_CHARTYPE_Space || dwType != FX_CHARTYPE_Control) { dwRet1 = EndBreak(FX_RTFBREAK_LineBreak); - FX_INT32 iCount = m_pCurLine->CountChars(); + int32_t iCount = m_pCurLine->CountChars(); if (iCount > 0) { pCurChar = m_pCurLine->m_LineChars.GetDataPtr(iCount - 1); } } } } - FX_INT32 iRotation = m_iRotation; + int32_t iRotation = m_iRotation; if (m_bVertical && (dwProps & 0x8000) != 0) { iRotation = (iRotation + 1) % 4; } @@ -448,7 +448,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_CharCode(FX_WCHAR wch) m_pUserData->AddRef(); } pCurChar->m_pUserData = m_pUserData; - FX_INT32 iCharWidth = 0; + int32_t iCharWidth = 0; if (m_bVertical != FX_IsOdd(m_iRotation)) { iCharWidth = 1000; } else { @@ -467,9 +467,9 @@ FX_DWORD CFX_RTFBreak::AppendChar_CharCode(FX_WCHAR wch) } return FX_RTFBREAK_None; } -FX_DWORD CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar *pCurChar, FX_INT32 iRotation) +FX_DWORD CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar *pCurChar, int32_t iRotation) { - FX_INT32 iCharWidth = 0; + int32_t iCharWidth = 0; if (m_bVertical != FX_IsOdd(iRotation)) { iCharWidth = 1000; } else { @@ -491,15 +491,15 @@ FX_DWORD CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar *pCurChar, FX_INT32 iR } return FX_RTFBREAK_None; } -FX_DWORD CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar *pCurChar, FX_INT32 iRotation) +FX_DWORD CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar *pCurChar, int32_t iRotation) { if (m_dwLayoutStyles & FX_RTFLAYOUTSTYLE_ExpandTab) { FX_BOOL bBreak = FALSE; if ((m_dwPolicies & FX_RTFBREAKPOLICY_TabBreak) != 0) { bBreak = (m_pCurLine->GetLineEnd() > m_iLineEnd + m_iTolerance); } - FX_INT32 &iLineWidth = m_pCurLine->m_iWidth; - FX_INT32 iCharWidth = iLineWidth; + int32_t &iLineWidth = m_pCurLine->m_iWidth; + int32_t iCharWidth = iLineWidth; if (GetPositionedTab(iCharWidth)) { iCharWidth -= iLineWidth; } else { @@ -513,7 +513,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar *pCurChar, FX_INT32 iRotation) } return FX_RTFBREAK_None; } -FX_DWORD CFX_RTFBreak::AppendChar_Control(CFX_RTFChar *pCurChar, FX_INT32 iRotation) +FX_DWORD CFX_RTFBreak::AppendChar_Control(CFX_RTFChar *pCurChar, int32_t iRotation) { FX_DWORD dwRet2 = FX_RTFBREAK_None; if (!m_bSingleLine) { @@ -540,11 +540,11 @@ FX_DWORD CFX_RTFBreak::AppendChar_Control(CFX_RTFChar *pCurChar, FX_INT32 iRotat } return dwRet2; } -FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar *pCurChar, FX_INT32 iRotation) +FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar *pCurChar, int32_t iRotation) { CFX_RTFChar *pLastChar = NULL; - FX_INT32 &iLineWidth = m_pCurLine->m_iWidth; - FX_INT32 iCharWidth = 0; + int32_t &iLineWidth = m_pCurLine->m_iWidth; + int32_t iCharWidth = 0; FX_WCHAR wForm; FX_BOOL bAlef = FALSE; if (m_dwCharType >= FX_CHARTYPE_ArabicAlef && m_dwCharType <= FX_CHARTYPE_ArabicDistortion) { @@ -554,7 +554,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar *pCurChar, FX_INT32 iRotati CFX_RTFChar *pPrevChar = GetLastChar(2); wForm = m_pArabicChar->GetFormChar(pLastChar, pPrevChar, pCurChar); bAlef = (wForm == 0xFEFF && pLastChar->GetCharType() == FX_CHARTYPE_ArabicAlef); - FX_INT32 iLastRotation = pLastChar->m_nRotation + m_iLineRotation; + int32_t iLastRotation = pLastChar->m_nRotation + m_iLineRotation; if (m_bVertical && (pLastChar->m_dwCharProps & 0x8000) != 0) { iLastRotation ++; } @@ -592,7 +592,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar *pCurChar, FX_INT32 iRotati } return FX_RTFBREAK_None; } -FX_DWORD CFX_RTFBreak::AppendChar_Others(CFX_RTFChar *pCurChar, FX_INT32 iRotation) +FX_DWORD CFX_RTFBreak::AppendChar_Others(CFX_RTFChar *pCurChar, int32_t iRotation) { FX_DWORD dwType = (pCurChar->m_dwCharProps & FX_CHARTYPEBITSMASK); FX_WCHAR wForm; @@ -607,7 +607,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Others(CFX_RTFChar *pCurChar, FX_INT32 iRotati } else { wForm = pCurChar->m_wCharCode; } - FX_INT32 iCharWidth = 0; + int32_t iCharWidth = 0; if (m_bVertical != FX_IsOdd(iRotation)) { iCharWidth = 1000; } else { @@ -634,7 +634,7 @@ FX_DWORD CFX_RTFBreak::EndBreak(FX_DWORD dwStatus) FXSYS_assert(dwStatus >= FX_RTFBREAK_PieceBreak && dwStatus <= FX_RTFBREAK_PageBreak); m_dwIdentity ++; CFX_RTFPieceArray *pCurPieces = &m_pCurLine->m_LinePieces; - FX_INT32 iCount = pCurPieces->GetSize(); + int32_t iCount = pCurPieces->GetSize(); if (iCount > 0) { CFX_RTFPiece *pLastPiece = pCurPieces->GetPtrAt(-- iCount); if (dwStatus > FX_RTFBREAK_PieceBreak) { @@ -723,8 +723,8 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine *pNextLine, FX_BOOL bAllCha tp.m_pChars = &m_pCurLine->m_LineChars; FX_BOOL bNew = TRUE; FX_DWORD dwIdentity = (FX_DWORD) - 1; - FX_INT32 iLast = m_pCurLine->CountChars() - 1, j = 0; - for (FX_INT32 i = 0; i <= iLast;) { + int32_t iLast = m_pCurLine->CountChars() - 1, j = 0; + for (int32_t i = 0; i <= iLast;) { pTC = pCurChars + i; if (bNew) { tp.m_iStartChar = i; @@ -760,7 +760,7 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine *pNextLine, FX_BOOL bAllCha return TRUE; } if (bAllChars && !bDone) { - FX_INT32 iEndPos = m_pCurLine->GetLineEnd(); + int32_t iEndPos = m_pCurLine->GetLineEnd(); GetBreakPos(m_pCurLine->m_LineChars, iEndPos, bAllChars, TRUE); } return FALSE; @@ -770,12 +770,12 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) FX_TPO tpo; CFX_RTFPiece tp; CFX_RTFChar *pTC; - FX_INT32 i, j; + int32_t i, j; CFX_RTFCharArray &chars = m_pCurLine->m_LineChars; - FX_INT32 iCount = m_pCurLine->CountChars(); + int32_t iCount = m_pCurLine->CountChars(); FX_BOOL bDone = (!m_bPagination && !m_bCharCode && (m_pCurLine->m_iArabicChars > 0 || m_bRTL)); if (bDone) { - FX_INT32 iBidiNum = 0; + int32_t iBidiNum = 0; for (i = 0; i < iCount; i ++) { pTC = chars.GetDataPtr(i); pTC->m_iBidiPos = i; @@ -799,7 +799,7 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) tp.m_iStartPos = m_pCurLine->m_iStart; tp.m_pChars = &chars; CFX_RTFPieceArray *pCurPieces = &m_pCurLine->m_LinePieces; - FX_INT32 iBidiLevel = -1, iCharWidth; + int32_t iBidiLevel = -1, iCharWidth; FX_DWORD dwIdentity = (FX_DWORD) - 1; i = j = 0; while (i < iCount) { @@ -851,7 +851,7 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) if (!m_bCharCode) { j = tpos.GetSize() - 1; FX_TEXTLAYOUT_PieceSort(tpos, 0, j); - FX_INT32 iStartPos = m_pCurLine->m_iStart; + int32_t iStartPos = m_pCurLine->m_iStart; for (i = 0; i <= j; i ++) { tpo = tpos.GetAt(i); CFX_RTFPiece &ttp = pCurPieces->GetAt(tpo.index); @@ -863,11 +863,11 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_DWORD dwStatus) { CFX_RTFPieceArray *pCurPieces = &m_pCurLine->m_LinePieces; - FX_INT32 iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth; - FX_INT32 iCount = pCurPieces->GetSize(); + int32_t iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth; + int32_t iCount = pCurPieces->GetSize(); FX_BOOL bFind = FALSE; FX_DWORD dwCharType; - FX_INT32 i, j; + int32_t i, j; FX_TPO tpo; for (i = iCount - 1; i > -1; i --) { tpo = tpos.GetAt(i); @@ -904,11 +904,11 @@ void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ break; } } - FX_INT32 iOffset = m_iLineEnd - iNetWidth; - FX_INT32 iLowerAlignment = (m_iAlignment & FX_RTFLINEALIGNMENT_LowerMask); - FX_INT32 iHigherAlignment = (m_iAlignment & FX_RTFLINEALIGNMENT_HigherMask); + int32_t iOffset = m_iLineEnd - iNetWidth; + int32_t iLowerAlignment = (m_iAlignment & FX_RTFLINEALIGNMENT_LowerMask); + int32_t iHigherAlignment = (m_iAlignment & FX_RTFLINEALIGNMENT_HigherMask); if (iGapChars > 0 && (iHigherAlignment == FX_RTFLINEALIGNMENT_Distributed || (iHigherAlignment == FX_RTFLINEALIGNMENT_Justified && dwStatus != FX_RTFBREAK_ParagraphBreak))) { - FX_INT32 iStart = -1; + int32_t iStart = -1; for (i = 0; i < iCount; i ++) { tpo = tpos.GetAt(i); CFX_RTFPiece &ttp = pCurPieces->GetAt(tpo.index); @@ -917,7 +917,7 @@ void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ } else { ttp.m_iStartPos = iStart; } - FX_INT32 k; + int32_t k; for (j = 0; j < ttp.m_iChars; j ++) { CFX_RTFChar &tc = ttp.GetChar(j); if (tc.m_nBreakType != FX_LBT_DIRECT_BRK || tc.m_iCharWidth < 0) { @@ -946,13 +946,13 @@ void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ } } } -FX_INT32 CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_BOOL bAllChars, FX_BOOL bOnlyBrk) +int32_t CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, int32_t &iEndPos, FX_BOOL bAllChars, FX_BOOL bOnlyBrk) { - FX_INT32 iLength = tca.GetSize() - 1; + int32_t iLength = tca.GetSize() - 1; if (iLength < 1) { return iLength; } - FX_INT32 iBreak = -1, iBreakPos = -1, iIndirect = -1, iIndirectPos = -1, iLast = -1, iLastPos = -1; + int32_t iBreak = -1, iBreakPos = -1, iIndirect = -1, iIndirectPos = -1, iLast = -1, iLastPos = -1; if (m_bSingleLine || m_bOrphanLine || iEndPos <= m_iLineEnd) { if (!bAllChars || m_bCharCode) { return iLength; @@ -963,7 +963,7 @@ FX_INT32 CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_ CFX_RTFChar *pCharArray = tca.GetData(); if (m_bCharCode) { const CFX_RTFChar *pChar; - FX_INT32 iCharWidth; + int32_t iCharWidth; while (iLength > 0) { if (iEndPos <= m_iLineEnd) { break; @@ -988,7 +988,7 @@ FX_INT32 CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_ } nCodeProp = pCur->m_dwCharProps; nNext = nCodeProp & 0x003F; - FX_INT32 iCharWidth = pCur->m_iCharWidth; + int32_t iCharWidth = pCur->m_iCharWidth; if (iCharWidth > 0) { iEndPos -= iCharWidth; } @@ -1076,13 +1076,13 @@ FX_INT32 CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_ void CFX_RTFBreak::SplitTextLine(CFX_RTFLine *pCurLine, CFX_RTFLine *pNextLine, FX_BOOL bAllChars) { FXSYS_assert(pCurLine != NULL && pNextLine != NULL); - FX_INT32 iCount = pCurLine->CountChars(); + int32_t iCount = pCurLine->CountChars(); if (iCount < 2) { return; } - FX_INT32 iEndPos = pCurLine->GetLineEnd(); + int32_t iEndPos = pCurLine->GetLineEnd(); CFX_RTFCharArray &curChars = pCurLine->m_LineChars; - FX_INT32 iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE); + int32_t iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE); if (iCharPos < 0) { iCharPos = 0; } @@ -1107,7 +1107,7 @@ void CFX_RTFBreak::SplitTextLine(CFX_RTFLine *pCurLine, CFX_RTFLine *pNextLine, tc->m_nBreakType = FX_LBT_UNKNOWN; iCount = nextChars.GetSize(); CFX_RTFChar *pNextChars = nextChars.GetData(); - for (FX_INT32 i = 0; i < iCount; i ++) { + for (int32_t i = 0; i < iCount; i ++) { CFX_RTFChar* tc = pNextChars + i; if (tc->GetCharType() >= FX_CHARTYPE_ArabicAlef) { pCurLine->m_iArabicChars --; @@ -1120,7 +1120,7 @@ void CFX_RTFBreak::SplitTextLine(CFX_RTFLine *pCurLine, CFX_RTFLine *pNextLine, tc->m_dwStatus = 0; } } -FX_INT32 CFX_RTFBreak::CountBreakPieces() const +int32_t CFX_RTFBreak::CountBreakPieces() const { CFX_RTFPieceArray *pRTFPieces = GetRTFPieces(TRUE); if (pRTFPieces == NULL) { @@ -1128,7 +1128,7 @@ FX_INT32 CFX_RTFBreak::CountBreakPieces() const } return pRTFPieces->GetSize(); } -const CFX_RTFPiece* CFX_RTFBreak::GetBreakPiece(FX_INT32 index) const +const CFX_RTFPiece* CFX_RTFBreak::GetBreakPiece(int32_t index) const { CFX_RTFPieceArray *pRTFPieces = GetRTFPieces(TRUE); if (pRTFPieces == NULL) { @@ -1151,16 +1151,16 @@ void CFX_RTFBreak::GetLineRect(CFX_RectF &rect) const rect.left = ((FX_FLOAT)pRTFLine->m_iStart) / 20000.0f; rect.width = ((FX_FLOAT)pRTFLine->m_iWidth) / 20000.0f; CFX_RTFPieceArray &rtfPieces = pRTFLine->m_LinePieces; - FX_INT32 iCount = rtfPieces.GetSize(); + int32_t iCount = rtfPieces.GetSize(); if (iCount < 1) { rect.width = 0; return; } CFX_RTFPiece *pBreakPiece; - FX_INT32 iLineHeight = 0, iMax; - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iLineHeight = 0, iMax; + for (int32_t i = 0; i < iCount; i ++) { pBreakPiece = rtfPieces.GetPtrAt(i); - FX_INT32 iFontHeight = FXSYS_round(pBreakPiece->m_iFontHeight * pBreakPiece->m_iVerticalScale / 100.0f); + int32_t iFontHeight = FXSYS_round(pBreakPiece->m_iFontHeight * pBreakPiece->m_iVerticalScale / 100.0f); iMax = FX_MAX(pBreakPiece->m_iFontSize, iFontHeight); if (i == 0) { iLineHeight = iMax; @@ -1184,24 +1184,24 @@ void CFX_RTFBreak::Reset() m_RTFLine1.RemoveAll(TRUE); m_RTFLine2.RemoveAll(TRUE); } -FX_INT32 CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms , FX_AdjustCharDisplayPos pAdjustPos ) const +int32_t CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms , FX_AdjustCharDisplayPos pAdjustPos ) const { if (pText == NULL || pText->iLength < 1) { return 0; } FXSYS_assert(pText->pStr != NULL && pText->pWidths != NULL && pText->pFont != NULL && pText->pRect != NULL); FX_LPCWSTR pStr = pText->pStr; - FX_INT32 *pWidths = pText->pWidths; - FX_INT32 iLength = pText->iLength - 1; + int32_t *pWidths = pText->pWidths; + int32_t iLength = pText->iLength - 1; IFX_Font *pFont = pText->pFont; FX_DWORD dwStyles = pText->dwLayoutStyles; CFX_RectF rtText(*pText->pRect); FX_BOOL bRTLPiece = FX_IsOdd(pText->iBidiLevel); FX_FLOAT fFontSize = pText->fFontSize; - FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f); - FX_INT32 iAscent = pFont->GetAscent(); - FX_INT32 iDescent = pFont->GetDescent(); - FX_INT32 iMaxHeight = iAscent - iDescent; + int32_t iFontSize = FXSYS_round(fFontSize * 20.0f); + int32_t iAscent = pFont->GetAscent(); + int32_t iDescent = pFont->GetDescent(); + int32_t iMaxHeight = iAscent - iDescent; FX_FLOAT fFontHeight = fFontSize; FX_FLOAT fAscent = fFontHeight * (FX_FLOAT)iAscent / (FX_FLOAT)iMaxHeight; FX_FLOAT fDescent = fFontHeight * (FX_FLOAT)iDescent / (FX_FLOAT)iMaxHeight; @@ -1209,13 +1209,13 @@ FX_INT32 CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCh FX_BOOL bVerticalChar = (dwStyles & FX_RTFLAYOUTSTYLE_VerticalChars) != 0; FX_BOOL bArabicNumber = (dwStyles & FX_RTFLAYOUTSTYLE_ArabicNumber) != 0; FX_BOOL bMBCSCode = (dwStyles & FX_RTFLAYOUTSTYLE_MBCSCode) != 0; - FX_INT32 iRotation = GetLineRotation(dwStyles) + pText->iCharRotation; - FX_INT32 iCharRotation; + int32_t iRotation = GetLineRotation(dwStyles) + pText->iCharRotation; + int32_t iCharRotation; FX_WCHAR wch, wPrev = 0xFEFF, wNext, wForm; - FX_INT32 iWidth, iCharWidth, iCharHeight; + int32_t iWidth, iCharWidth, iCharHeight; FX_FLOAT fX, fY, fCharWidth, fCharHeight; - FX_INT32 iHorScale = pText->iHorizontalScale; - FX_INT32 iVerScale = pText->iVerticalScale; + int32_t iHorScale = pText->iHorizontalScale; + int32_t iVerScale = pText->iVerticalScale; FX_BOOL bEmptyChar; FX_DWORD dwProps, dwCharType; fX = rtText.left; @@ -1231,8 +1231,8 @@ FX_INT32 CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCh } fY += fAscent; } - FX_INT32 iCount = 0; - for (FX_INT32 i = 0; i <= iLength; i ++) { + int32_t iCount = 0; + for (int32_t i = 0; i <= iLength; i ++) { wch = *pStr ++; iWidth = *pWidths ++; if (!bMBCSCode) { @@ -1417,19 +1417,19 @@ FX_INT32 CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCh } return iCount; } -FX_INT32 CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox ) const +int32_t CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox ) const { if (pText == NULL || pText->iLength < 1) { return 0; } FXSYS_assert(pText->pStr != NULL && pText->pWidths != NULL && pText->pFont != NULL && pText->pRect != NULL); FX_LPCWSTR pStr = pText->pStr; - FX_INT32 *pWidths = pText->pWidths; - FX_INT32 iLength = pText->iLength; + int32_t *pWidths = pText->pWidths; + int32_t iLength = pText->iLength; CFX_RectF rect(*pText->pRect); FX_BOOL bRTLPiece = FX_IsOdd(pText->iBidiLevel); FX_FLOAT fFontSize = pText->fFontSize; - FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f); + int32_t iFontSize = FXSYS_round(fFontSize * 20.0f); FX_FLOAT fScale = fFontSize / 1000.0f; IFX_Font *pFont = pText->pFont; if (pFont == NULL) { @@ -1450,14 +1450,14 @@ FX_INT32 CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtAr FX_BOOL bSingleLine = (dwStyles & FX_RTFLAYOUTSTYLE_SingleLine) != 0; FX_BOOL bCombText = (dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0; FX_WCHAR wch, wLineBreakChar = pText->wLineBreakChar; - FX_INT32 iCharSize; + int32_t iCharSize; FX_FLOAT fCharSize, fStart; if (bVertical) { fStart = bRTLPiece ? rect.bottom() : rect.top; } else { fStart = bRTLPiece ? rect.right() : rect.left; } - for (FX_INT32 i = 0; i < iLength; i ++) { + for (int32_t i = 0; i < iLength; i ++) { wch = *pStr ++; iCharSize = *pWidths ++; fCharSize = (FX_FLOAT)iCharSize / 20000.0f; @@ -1489,7 +1489,7 @@ FX_INT32 CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtAr rect.width = fCharSize; } if (bCharBBox && !bRet) { - FX_INT32 iCharWidth = 1000; + int32_t iCharWidth = 1000; pFont->GetCharWidth(wch, iCharWidth); FX_FLOAT fRTLeft = 0, fCharWidth = 0; if (iCharWidth > 0) { diff --git a/xfa/src/fgas/src/layout/fx_rtfbreak.h b/xfa/src/fgas/src/layout/fx_rtfbreak.h index c8f69277da..394d433412 100644 --- a/xfa/src/fgas/src/layout/fx_rtfbreak.h +++ b/xfa/src/fgas/src/layout/fx_rtfbreak.h @@ -22,35 +22,35 @@ public: { RemoveAll(); } - FX_INT32 CountChars() const + int32_t CountChars() const { return m_LineChars.GetSize(); } - CFX_RTFChar& GetChar(FX_INT32 index) + CFX_RTFChar& GetChar(int32_t index) { FXSYS_assert(index > -1 && index < m_LineChars.GetSize()); return *m_LineChars.GetDataPtr(index); } - CFX_RTFChar* GetCharPtr(FX_INT32 index) + CFX_RTFChar* GetCharPtr(int32_t index) { FXSYS_assert(index > -1 && index < m_LineChars.GetSize()); return m_LineChars.GetDataPtr(index); } - FX_INT32 CountPieces() const + int32_t CountPieces() const { return m_LinePieces.GetSize(); } - CFX_RTFPiece& GetPiece(FX_INT32 index) const + CFX_RTFPiece& GetPiece(int32_t index) const { FXSYS_assert(index > -1 && index < m_LinePieces.GetSize()); return m_LinePieces.GetAt(index); } - CFX_RTFPiece* GetPiecePtr(FX_INT32 index) const + CFX_RTFPiece* GetPiecePtr(int32_t index) const { FXSYS_assert(index > -1 && index < m_LinePieces.GetSize()); return m_LinePieces.GetPtrAt(index); } - FX_INT32 GetLineEnd() const + int32_t GetLineEnd() const { return m_iStart + m_iWidth; } @@ -58,8 +58,8 @@ public: { CFX_RTFChar *pChar; IFX_Unknown *pUnknown; - FX_INT32 iCount = m_LineChars.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_LineChars.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { pChar = m_LineChars.GetDataPtr(i); if ((pUnknown = pChar->m_pUserData) != NULL) { pUnknown->Release(); @@ -73,10 +73,10 @@ public: } CFX_RTFCharArray m_LineChars; CFX_RTFPieceArray m_LinePieces; - FX_INT32 m_iStart; - FX_INT32 m_iWidth; - FX_INT32 m_iArabicChars; - FX_INT32 m_iMBCSChars; + int32_t m_iStart; + int32_t m_iWidth; + int32_t m_iArabicChars; + int32_t m_iMBCSChars; }; class CFX_RTFBreak : public IFX_RTFBreak { @@ -103,75 +103,75 @@ public: virtual void SetDefaultChar(FX_WCHAR wch); virtual void SetLineBreakChar(FX_WCHAR wch); virtual void SetLineBreakTolerance(FX_FLOAT fTolerance); - virtual void SetHorizontalScale(FX_INT32 iScale); - virtual void SetVerticalScale(FX_INT32 iScale); - virtual void SetCharRotation(FX_INT32 iCharRotation); + virtual void SetHorizontalScale(int32_t iScale); + virtual void SetVerticalScale(int32_t iScale); + virtual void SetCharRotation(int32_t iCharRotation); virtual void SetCharSpace(FX_FLOAT fCharSpace); virtual void SetWordSpace(FX_BOOL bDefault, FX_FLOAT fWordSpace); virtual void SetReadingOrder(FX_BOOL bRTL = FALSE); - virtual void SetAlignment(FX_INT32 iAlignment = FX_RTFLINEALIGNMENT_Left); + virtual void SetAlignment(int32_t iAlignment = FX_RTFLINEALIGNMENT_Left); virtual void SetUserData(IFX_Unknown *pUserData); virtual FX_DWORD AppendChar(FX_WCHAR wch); virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_RTFBREAK_PieceBreak); - virtual FX_INT32 CountBreakPieces() const; - virtual const CFX_RTFPiece* GetBreakPiece(FX_INT32 index) const; + virtual int32_t CountBreakPieces() const; + virtual const CFX_RTFPiece* GetBreakPiece(int32_t index) const; virtual void GetLineRect(CFX_RectF &rect) const; virtual void ClearBreakPieces(); virtual void Reset(); - virtual FX_INT32 GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const; - virtual FX_INT32 GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const; + virtual int32_t GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const; + virtual int32_t GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const; FX_DWORD AppendChar_CharCode(FX_WCHAR wch); - FX_DWORD AppendChar_Combination(CFX_RTFChar *pCurChar, FX_INT32 iRotation); - FX_DWORD AppendChar_Tab(CFX_RTFChar *pCurChar, FX_INT32 iRotation); - FX_DWORD AppendChar_Control(CFX_RTFChar *pCurChar, FX_INT32 iRotation); - FX_DWORD AppendChar_Arabic(CFX_RTFChar *pCurChar, FX_INT32 iRotation); - FX_DWORD AppendChar_Others(CFX_RTFChar *pCurChar, FX_INT32 iRotation); + FX_DWORD AppendChar_Combination(CFX_RTFChar *pCurChar, int32_t iRotation); + FX_DWORD AppendChar_Tab(CFX_RTFChar *pCurChar, int32_t iRotation); + FX_DWORD AppendChar_Control(CFX_RTFChar *pCurChar, int32_t iRotation); + FX_DWORD AppendChar_Arabic(CFX_RTFChar *pCurChar, int32_t iRotation); + FX_DWORD AppendChar_Others(CFX_RTFChar *pCurChar, int32_t iRotation); protected: FX_DWORD m_dwPolicies; IFX_ArabicChar *m_pArabicChar; - FX_INT32 m_iLineStart; - FX_INT32 m_iLineEnd; + int32_t m_iLineStart; + int32_t m_iLineEnd; FX_DWORD m_dwLayoutStyles; FX_BOOL m_bPagination; FX_BOOL m_bVertical; FX_BOOL m_bSingleLine; FX_BOOL m_bCharCode; IFX_Font *m_pFont; - FX_INT32 m_iFontHeight; - FX_INT32 m_iFontSize; - FX_INT32 m_iTabWidth; + int32_t m_iFontHeight; + int32_t m_iFontSize; + int32_t m_iTabWidth; CFX_Int32Array m_PositionedTabs; FX_BOOL m_bOrphanLine; FX_WCHAR m_wDefChar; - FX_INT32 m_iDefChar; + int32_t m_iDefChar; FX_WCHAR m_wLineBreakChar; - FX_INT32 m_iHorizontalScale; - FX_INT32 m_iVerticalScale; - FX_INT32 m_iLineRotation; - FX_INT32 m_iCharRotation; - FX_INT32 m_iRotation; - FX_INT32 m_iCharSpace; + int32_t m_iHorizontalScale; + int32_t m_iVerticalScale; + int32_t m_iLineRotation; + int32_t m_iCharRotation; + int32_t m_iRotation; + int32_t m_iCharSpace; FX_BOOL m_bWordSpace; - FX_INT32 m_iWordSpace; + int32_t m_iWordSpace; FX_BOOL m_bRTL; - FX_INT32 m_iAlignment; + int32_t m_iAlignment; IFX_Unknown *m_pUserData; FX_DWORD m_dwCharType; FX_DWORD m_dwIdentity; CFX_RTFLine m_RTFLine1; CFX_RTFLine m_RTFLine2; CFX_RTFLine *m_pCurLine; - FX_INT32 m_iReady; - FX_INT32 m_iTolerance; - FX_INT32 GetLineRotation(FX_DWORD dwStyles) const; + int32_t m_iReady; + int32_t m_iTolerance; + int32_t GetLineRotation(FX_DWORD dwStyles) const; void SetBreakStatus(); - CFX_RTFChar* GetLastChar(FX_INT32 index) const; + CFX_RTFChar* GetLastChar(int32_t index) const; CFX_RTFLine* GetRTFLine(FX_BOOL bReady) const; CFX_RTFPieceArray* GetRTFPieces(FX_BOOL bReady) const; FX_DWORD GetUnifiedCharType(FX_DWORD dwType) const; - FX_INT32 GetLastPositionedTab() const; - FX_BOOL GetPositionedTab(FX_INT32 &iTabPos) const; - FX_INT32 GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_BOOL bAllChars = FALSE, FX_BOOL bOnlyBrk = FALSE); + int32_t GetLastPositionedTab() const; + FX_BOOL GetPositionedTab(int32_t &iTabPos) const; + int32_t GetBreakPos(CFX_RTFCharArray &tca, int32_t &iEndPos, FX_BOOL bAllChars = FALSE, FX_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, FX_DWORD dwStatus); void EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus); diff --git a/xfa/src/fgas/src/layout/fx_textbreak.cpp b/xfa/src/fgas/src/layout/fx_textbreak.cpp index 0bb7b69585..80d56c7191 100644 --- a/xfa/src/fgas/src/layout/fx_textbreak.cpp +++ b/xfa/src/fgas/src/layout/fx_textbreak.cpp @@ -78,7 +78,7 @@ void CFX_TxtBreak::SetLineWidth(FX_FLOAT fLineWidth) } void CFX_TxtBreak::SetLinePos(FX_FLOAT fLinePos) { - FX_INT32 iLinePos = FXSYS_round(fLinePos * 20000.0f); + int32_t iLinePos = FXSYS_round(fLinePos * 20000.0f); if (iLinePos < 0) { iLinePos = 0; } @@ -120,7 +120,7 @@ void CFX_TxtBreak::SetFont(IFX_Font *pFont) } void CFX_TxtBreak::SetFontSize(FX_FLOAT fFontSize) { - FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f); + int32_t iFontSize = FXSYS_round(fFontSize * 20.0f); if (m_iFontSize == iFontSize) { return; } @@ -164,7 +164,7 @@ void CFX_TxtBreak::SetLineBreakTolerance(FX_FLOAT fTolerance) { m_iTolerance = FXSYS_round(fTolerance * 20000.0f); } -void CFX_TxtBreak::SetCharRotation(FX_INT32 iCharRotation) +void CFX_TxtBreak::SetCharRotation(int32_t iCharRotation) { if (iCharRotation < 0) { iCharRotation += (-iCharRotation / 4 + 1) * 4; @@ -179,7 +179,7 @@ void CFX_TxtBreak::SetCharRotation(FX_INT32 iCharRotation) m_iRotation = m_iLineRotation + m_iCharRotation; m_iRotation %= 4; } -void CFX_TxtBreak::SetAlignment(FX_INT32 iAlignment) +void CFX_TxtBreak::SetAlignment(int32_t iAlignment) { FXSYS_assert(iAlignment >= FX_TXTLINEALIGNMENT_Left && iAlignment <= FX_TXTLINEALIGNMENT_Distributed); m_iAlignment = iAlignment; @@ -229,7 +229,7 @@ void CFX_TxtBreak::SetBreakStatus() if (m_bPagination) { return; } - FX_INT32 iCount = m_pCurLine->CountChars(); + int32_t iCount = m_pCurLine->CountChars(); if (iCount < 1) { return; } @@ -238,7 +238,7 @@ void CFX_TxtBreak::SetBreakStatus() pTC->m_dwStatus = FX_TXTBREAK_PieceBreak; } } -void CFX_TxtBreak::SetHorizontalScale(FX_INT32 iScale) +void CFX_TxtBreak::SetHorizontalScale(int32_t iScale) { if (iScale < 0) { iScale = 0; @@ -249,7 +249,7 @@ void CFX_TxtBreak::SetHorizontalScale(FX_INT32 iScale) SetBreakStatus(); m_iHorScale = iScale; } -void CFX_TxtBreak::SetVerticalScale(FX_INT32 iScale) +void CFX_TxtBreak::SetVerticalScale(int32_t iScale) { if (iScale < 0) { iScale = 0; @@ -264,20 +264,20 @@ void CFX_TxtBreak::SetCharSpace(FX_FLOAT fCharSpace) { m_iCharSpace = FXSYS_round(fCharSpace * 20000.0f); } -static const FX_INT32 gs_FX_TxtLineRotations[8] = {0, 3, 1, 0, 2, 1, 3, 2}; -FX_INT32 CFX_TxtBreak::GetLineRotation(FX_DWORD dwStyles) const +static const int32_t gs_FX_TxtLineRotations[8] = {0, 3, 1, 0, 2, 1, 3, 2}; +int32_t CFX_TxtBreak::GetLineRotation(FX_DWORD dwStyles) const { return gs_FX_TxtLineRotations[(dwStyles & 0x0E) >> 1]; } -CFX_TxtChar* CFX_TxtBreak::GetLastChar(FX_INT32 index, FX_BOOL bOmitChar) const +CFX_TxtChar* CFX_TxtBreak::GetLastChar(int32_t index, FX_BOOL bOmitChar) const { CFX_TxtCharArray &ca = *m_pCurLine->m_pLineChars; - FX_INT32 iCount = ca.GetSize(); + int32_t iCount = ca.GetSize(); if (index < 0 || index >= iCount) { return NULL; } CFX_TxtChar *pTC; - FX_INT32 iStart = iCount - 1; + int32_t iStart = iCount - 1; while (iStart > -1) { pTC = ca.GetDataPtr(iStart --); if (bOmitChar && pTC->GetCharType() == FX_CHARTYPE_Combination) { @@ -346,8 +346,8 @@ void CFX_TxtBreak::AppendChar_PageLoad(CFX_Char *pCurChar, FX_DWORD dwProps) ((CFX_TxtChar*)pCurChar)->m_pUserData = m_pUserData; } if (m_bArabicContext || m_bArabicShapes) { - FX_INT32 iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS; - FX_INT32 iArabicContext = (iBidiCls == FX_BIDICLASS_R || iBidiCls == FX_BIDICLASS_AL) ? 2 : ((iBidiCls == FX_BIDICLASS_L || iBidiCls == FX_BIDICLASS_S) ? 0 : 1); + int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS; + int32_t iArabicContext = (iBidiCls == FX_BIDICLASS_R || iBidiCls == FX_BIDICLASS_AL) ? 2 : ((iBidiCls == FX_BIDICLASS_L || iBidiCls == FX_BIDICLASS_S) ? 0 : 1); if (iArabicContext != m_iArabicContext && iArabicContext != 1) { m_iArabicContext = iArabicContext; if (m_iCurArabicContext == 1) { @@ -364,12 +364,12 @@ void CFX_TxtBreak::AppendChar_PageLoad(CFX_Char *pCurChar, FX_DWORD dwProps) } pCurChar->m_dwCharStyles = m_dwContextCharStyles; } -FX_DWORD CFX_TxtBreak::AppendChar_Combination(CFX_Char *pCurChar, FX_INT32 iRotation) +FX_DWORD CFX_TxtBreak::AppendChar_Combination(CFX_Char *pCurChar, int32_t iRotation) { FXSYS_assert(pCurChar != NULL); FX_WCHAR wch = pCurChar->m_wCharCode; FX_WCHAR wForm; - FX_INT32 iCharWidth = 0; + int32_t iCharWidth = 0; CFX_Char *pLastChar; pCurChar->m_iCharWidth = -1; if (m_bCombText) { @@ -412,14 +412,14 @@ FX_DWORD CFX_TxtBreak::AppendChar_Combination(CFX_Char *pCurChar, FX_INT32 iRota pCurChar->m_iCharWidth = -iCharWidth; return FX_TXTBREAK_None; } -FX_DWORD CFX_TxtBreak::AppendChar_Tab(CFX_Char *pCurChar, FX_INT32 iRotation) +FX_DWORD CFX_TxtBreak::AppendChar_Tab(CFX_Char *pCurChar, int32_t iRotation) { m_dwCharType = FX_CHARTYPE_Tab; if ((m_dwLayoutStyles & FX_TXTLAYOUTSTYLE_ExpandTab) == 0) { return FX_TXTBREAK_None; } - FX_INT32 &iLineWidth = m_pCurLine->m_iWidth; - FX_INT32 iCharWidth; + int32_t &iLineWidth = m_pCurLine->m_iWidth; + int32_t iCharWidth; if (m_bCombText) { iCharWidth = m_iCombWidth; } else { @@ -440,7 +440,7 @@ FX_DWORD CFX_TxtBreak::AppendChar_Tab(CFX_Char *pCurChar, FX_INT32 iRotation) } return FX_TXTBREAK_None; } -FX_DWORD CFX_TxtBreak::AppendChar_Control(CFX_Char *pCurChar, FX_INT32 iRotation) +FX_DWORD CFX_TxtBreak::AppendChar_Control(CFX_Char *pCurChar, int32_t iRotation) { m_dwCharType = FX_CHARTYPE_Control; FX_DWORD dwRet = FX_TXTBREAK_None; @@ -469,12 +469,12 @@ FX_DWORD CFX_TxtBreak::AppendChar_Control(CFX_Char *pCurChar, FX_INT32 iRotation } return dwRet; } -FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char *pCurChar, FX_INT32 iRotation) +FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char *pCurChar, int32_t iRotation) { FX_DWORD dwType = (pCurChar->m_dwCharProps & FX_CHARTYPEBITSMASK); - FX_INT32 &iLineWidth = m_pCurLine->m_iWidth; + int32_t &iLineWidth = m_pCurLine->m_iWidth; FX_WCHAR wForm; - FX_INT32 iCharWidth = 0; + int32_t iCharWidth = 0; CFX_Char *pLastChar = NULL; FX_BOOL bAlef = FALSE; if (!m_bCombText && m_dwCharType >= FX_CHARTYPE_ArabicAlef && m_dwCharType <= FX_CHARTYPE_ArabicDistortion) { @@ -487,7 +487,7 @@ FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char *pCurChar, FX_INT32 iRotation) CFX_Char *pPrevChar = GetLastChar(2); wForm = m_pArabicChar->GetFormChar(pLastChar, pPrevChar, pCurChar); bAlef = (wForm == 0xFEFF && pLastChar->GetCharType() == FX_CHARTYPE_ArabicAlef); - FX_INT32 iLastRotation = pLastChar->m_nRotation + m_iLineRotation; + int32_t iLastRotation = pLastChar->m_nRotation + m_iLineRotation; if (m_bVertical && (pLastChar->m_dwCharProps & 0x8000) != 0) { iLastRotation ++; } @@ -530,12 +530,12 @@ FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char *pCurChar, FX_INT32 iRotation) } return FX_TXTBREAK_None; } -FX_DWORD CFX_TxtBreak::AppendChar_Others(CFX_Char *pCurChar, FX_INT32 iRotation) +FX_DWORD CFX_TxtBreak::AppendChar_Others(CFX_Char *pCurChar, int32_t iRotation) { FX_DWORD dwProps = pCurChar->m_dwCharProps; FX_DWORD dwType = (dwProps & FX_CHARTYPEBITSMASK); - FX_INT32 &iLineWidth = m_pCurLine->m_iWidth; - FX_INT32 iCharWidth = 0; + int32_t &iLineWidth = m_pCurLine->m_iWidth; + int32_t iCharWidth = 0; m_dwCharType = dwType; FX_WCHAR wch = pCurChar->m_wCharCode; FX_WCHAR wForm = wch; @@ -572,7 +572,7 @@ FX_DWORD CFX_TxtBreak::AppendChar_Others(CFX_Char *pCurChar, FX_INT32 iRotation) } return FX_TXTBREAK_None; } -typedef FX_DWORD (CFX_TxtBreak::*FX_TxtBreak_LPFAppendChar)(CFX_Char *pCurChar, FX_INT32 iRotation); +typedef FX_DWORD (CFX_TxtBreak::*FX_TxtBreak_LPFAppendChar)(CFX_Char *pCurChar, int32_t iRotation); static const FX_TxtBreak_LPFAppendChar g_FX_TxtBreak_lpfAppendChar[16] = { &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Tab, @@ -615,14 +615,14 @@ FX_DWORD CFX_TxtBreak::AppendChar(FX_WCHAR wch) if (m_dwCharType > 0 && m_pCurLine->m_iWidth > m_iLineWidth + m_iTolerance && !m_bSingleLine) { if (m_dwCharType != FX_CHARTYPE_Space || dwType != FX_CHARTYPE_Control) { dwRet1 = EndBreak(FX_TXTBREAK_LineBreak); - FX_INT32 iCount = m_pCurLine->CountChars(); + int32_t iCount = m_pCurLine->CountChars(); if (iCount > 0) { pCurChar = m_pCurLine->m_pLineChars->GetDataPtr(iCount - 1); } } } } - FX_INT32 iRotation = m_iRotation; + int32_t iRotation = m_iRotation; if (m_bVertical && (dwProps & 0x8000) != 0) { iRotation = (iRotation + 1) % 4; } @@ -632,18 +632,18 @@ FX_DWORD CFX_TxtBreak::AppendChar(FX_WCHAR wch) void CFX_TxtBreak::EndBreak_UpdateArabicShapes() { FXSYS_assert(m_bArabicShapes); - FX_INT32 iCount = m_pCurLine->CountChars(); + int32_t iCount = m_pCurLine->CountChars(); if (iCount < 2) { return; } - FX_INT32 &iLineWidth = m_pCurLine->m_iWidth; + int32_t &iLineWidth = m_pCurLine->m_iWidth; CFX_Char *pCur, *pNext; pCur = m_pCurLine->GetCharPtr(0); FX_BOOL bPrevNum = (pCur->m_dwCharStyles & FX_TXTCHARSTYLE_ArabicIndic) != 0; pCur = m_pCurLine->GetCharPtr(1); FX_WCHAR wch, wForm; FX_BOOL bNextNum; - FX_INT32 i = 1, iCharWidth, iRotation; + int32_t i = 1, iCharWidth, iRotation; do { i ++; if (i < iCount) { @@ -683,7 +683,7 @@ void CFX_TxtBreak::EndBreak_UpdateArabicShapes() } FX_BOOL CFX_TxtBreak::EndBreak_SplitLine(CFX_TxtLine *pNextLine, FX_BOOL bAllChars, FX_DWORD dwStatus) { - FX_INT32 iCount = m_pCurLine->CountChars(); + int32_t iCount = m_pCurLine->CountChars(); FX_BOOL bDone = FALSE; CFX_Char *pTC; if (!m_bSingleLine && m_pCurLine->m_iWidth > m_iLineWidth + m_iTolerance) { @@ -725,7 +725,7 @@ FX_BOOL CFX_TxtBreak::EndBreak_SplitLine(CFX_TxtLine *pNextLine, FX_BOOL bAllCha return TRUE; } if (bAllChars && !bDone) { - FX_INT32 iEndPos = m_pCurLine->m_iWidth; + int32_t iEndPos = m_pCurLine->m_iWidth; GetBreakPos(*m_pCurLine->m_pLineChars, iEndPos, bAllChars, TRUE); } return FALSE; @@ -735,12 +735,12 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) CFX_TxtPiece tp; FX_TPO tpo; CFX_TxtChar *pTC; - FX_INT32 i, j; + int32_t i, j; CFX_TxtCharArray &chars = *m_pCurLine->m_pLineChars; - FX_INT32 iCount = m_pCurLine->CountChars(); + int32_t iCount = m_pCurLine->CountChars(); FX_BOOL bDone = (m_pCurLine->m_iArabicChars > 0 || m_bCurRTL); if (!m_bPagination && bDone) { - FX_INT32 iBidiNum = 0; + int32_t iBidiNum = 0; for (i = 0; i < iCount; i ++) { pTC = chars.GetDataPtr(i); pTC->m_iBidiPos = i; @@ -758,7 +758,7 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) tp.m_dwStatus = FX_TXTBREAK_PieceBreak; tp.m_iStartPos = m_pCurLine->m_iStart; tp.m_pChars = m_pCurLine->m_pLineChars; - FX_INT32 iBidiLevel = -1, iCharWidth; + int32_t iBidiLevel = -1, iCharWidth; i = 0, j = -1; while (i < iCount) { pTC = chars.GetDataPtr(i); @@ -809,7 +809,7 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) if (j > -1) { if (j > 0) { FX_TEXTLAYOUT_PieceSort(tpos, 0, j); - FX_INT32 iStartPos = 0; + int32_t iStartPos = 0; for (i = 0; i <= j; i ++) { tpo = tpos.GetAt(i); CFX_TxtPiece &ttp = pCurPieces->GetAt(tpo.index); @@ -840,9 +840,9 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) } void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_DWORD dwStatus) { - FX_INT32 iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth; + int32_t iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth; CFX_TxtPieceArray *pCurPieces = m_pCurLine->m_pLinePieces; - FX_INT32 i, j, iCount = pCurPieces->GetSize(); + int32_t i, j, iCount = pCurPieces->GetSize(); FX_BOOL bFind = FALSE; FX_TPO tpo; CFX_TxtChar *pTC; @@ -882,11 +882,11 @@ void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ break; } } - FX_INT32 iOffset = m_iLineWidth - iNetWidth; - FX_INT32 iLowerAlignment = (m_iCurAlignment & FX_TXTLINEALIGNMENT_LowerMask); - FX_INT32 iHigherAlignment = (m_iCurAlignment & FX_TXTLINEALIGNMENT_HigherMask); + int32_t iOffset = m_iLineWidth - iNetWidth; + int32_t iLowerAlignment = (m_iCurAlignment & FX_TXTLINEALIGNMENT_LowerMask); + int32_t iHigherAlignment = (m_iCurAlignment & FX_TXTLINEALIGNMENT_HigherMask); if (iGapChars > 0 && (iHigherAlignment == FX_TXTLINEALIGNMENT_Distributed || (iHigherAlignment == FX_TXTLINEALIGNMENT_Justified && dwStatus != FX_TXTBREAK_ParagraphBreak))) { - FX_INT32 iStart = -1; + int32_t iStart = -1; for (i = 0; i < iCount; i ++) { tpo = tpos.GetAt(i); CFX_TxtPiece &ttp = pCurPieces->GetAt(tpo.index); @@ -895,7 +895,7 @@ void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ } else { ttp.m_iStartPos = iStart; } - FX_INT32 k; + int32_t k; for (j = 0; j < ttp.m_iChars; j ++) { pTC = ttp.GetCharPtr(j); if (pTC->m_nBreakType != FX_LBT_DIRECT_BRK || pTC->m_iCharWidth < 0) { @@ -928,7 +928,7 @@ FX_DWORD CFX_TxtBreak::EndBreak(FX_DWORD dwStatus) { FXSYS_assert(dwStatus >= FX_TXTBREAK_PieceBreak && dwStatus <= FX_TXTBREAK_PageBreak); CFX_TxtPieceArray *pCurPieces = m_pCurLine->m_pLinePieces; - FX_INT32 iCount = pCurPieces->GetSize(); + int32_t iCount = pCurPieces->GetSize(); if (iCount > 0) { CFX_TxtPiece *pLastPiece = pCurPieces->GetPtrAt(-- iCount); if (dwStatus > FX_TXTBREAK_PieceBreak) { @@ -990,13 +990,13 @@ EndBreak_Ret: } return dwStatus; } -FX_INT32 CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_BOOL bAllChars, FX_BOOL bOnlyBrk) +int32_t CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, int32_t &iEndPos, FX_BOOL bAllChars, FX_BOOL bOnlyBrk) { - FX_INT32 iLength = ca.GetSize() - 1; + int32_t iLength = ca.GetSize() - 1; if (iLength < 1) { return iLength; } - FX_INT32 iBreak = -1, iBreakPos = -1, iIndirect = -1, iIndirectPos = -1, iLast = -1, iLastPos = -1; + int32_t iBreak = -1, iBreakPos = -1, iIndirect = -1, iIndirectPos = -1, iLast = -1, iLastPos = -1; if (m_bSingleLine || iEndPos <= m_iLineWidth) { if (!bAllChars) { return iLength; @@ -1014,7 +1014,7 @@ FX_INT32 CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_B } nCodeProp = pCur->m_dwCharProps; nNext = nCodeProp & 0x003F; - FX_INT32 iCharWidth = pCur->m_iCharWidth; + int32_t iCharWidth = pCur->m_iCharWidth; if (iCharWidth > 0) { iEndPos -= iCharWidth; } @@ -1038,7 +1038,7 @@ FX_INT32 CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_B } } if (bAllChars) { - pCur->m_nBreakType = (FX_BYTE)eType; + pCur->m_nBreakType = (uint8_t)eType; } if (!bOnlyBrk) { if (m_bSingleLine || iEndPos <= m_iLineWidth || (nCur == FX_CBP_SP && !bSpaceBreak)) { @@ -1085,13 +1085,13 @@ FX_INT32 CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_B void CFX_TxtBreak::SplitTextLine(CFX_TxtLine *pCurLine, CFX_TxtLine *pNextLine, FX_BOOL bAllChars) { FXSYS_assert(pCurLine != NULL && pNextLine != NULL); - FX_INT32 iCount = pCurLine->CountChars(); + int32_t iCount = pCurLine->CountChars(); if (iCount < 2) { return; } - FX_INT32 iEndPos = pCurLine->m_iWidth; + int32_t iEndPos = pCurLine->m_iWidth; CFX_TxtCharArray &curChars = *pCurLine->m_pLineChars; - FX_INT32 iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE); + int32_t iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE); if (iCharPos < 0) { iCharPos = 0; } @@ -1113,8 +1113,8 @@ void CFX_TxtBreak::SplitTextLine(CFX_TxtLine *pCurLine, CFX_TxtLine *pNextLine, CFX_TxtChar *pTC = curChars.GetDataPtr(iCharPos - 1); pTC->m_nBreakType = FX_LBT_UNKNOWN; iCount = nextChars.GetSize(); - FX_INT32 iCharWidth, iWidth = 0; - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCharWidth, iWidth = 0; + for (int32_t i = 0; i < iCount; i ++) { pTC = nextChars.GetDataPtr(i); if (pTC->GetCharType() >= FX_CHARTYPE_ArabicAlef) { pCurLine->m_iArabicChars --; @@ -1131,12 +1131,12 @@ void CFX_TxtBreak::SplitTextLine(CFX_TxtLine *pCurLine, CFX_TxtLine *pNextLine, } pNextLine->m_iWidth = iWidth; } -FX_INT32 CFX_TxtBreak::CountBreakChars() const +int32_t CFX_TxtBreak::CountBreakChars() const { CFX_TxtLine *pTxtLine = GetTxtLine(TRUE); return pTxtLine == NULL ? 0 : pTxtLine->CountChars(); } -FX_INT32 CFX_TxtBreak::CountBreakPieces() const +int32_t CFX_TxtBreak::CountBreakPieces() const { CFX_TxtPieceArray *pTxtPieces = GetTxtPieces(TRUE); if (pTxtPieces == NULL) { @@ -1144,7 +1144,7 @@ FX_INT32 CFX_TxtBreak::CountBreakPieces() const } return pTxtPieces->GetSize(); } -const CFX_TxtPiece* CFX_TxtBreak::GetBreakPiece(FX_INT32 index) const +const CFX_TxtPiece* CFX_TxtBreak::GetBreakPiece(int32_t index) const { CFX_TxtPieceArray *pTxtPieces = GetTxtPieces(TRUE); if (pTxtPieces == NULL) { @@ -1174,10 +1174,10 @@ void CFX_TxtBreak::Reset() typedef struct _FX_FORMCHAR { FX_WORD wch; FX_WORD wForm; - FX_INT32 iWidth; + int32_t iWidth; } FX_FORMCHAR, * FX_LPFORMCHAR; typedef FX_FORMCHAR const * FX_LPCFORMCHAR; -FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms , FX_AdjustCharDisplayPos pAdjustPos ) const +int32_t CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms , FX_AdjustCharDisplayPos pAdjustPos ) const { if (pTxtRun == NULL || pTxtRun->iLength < 1) { return 0; @@ -1185,8 +1185,8 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar IFX_TxtAccess *pAccess = pTxtRun->pAccess; FX_LPVOID pIdentity = pTxtRun->pIdentity; FX_LPCWSTR pStr = pTxtRun->pStr; - FX_INT32 *pWidths = pTxtRun->pWidths; - FX_INT32 iLength = pTxtRun->iLength - 1; + int32_t *pWidths = pTxtRun->pWidths; + int32_t iLength = pTxtRun->iLength - 1; IFX_Font *pFont = pTxtRun->pFont; FX_DWORD dwStyles = pTxtRun->dwStyles; CFX_RectF rtText(*pTxtRun->pRect); @@ -1194,22 +1194,22 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar FX_BOOL bArabicNumber = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_ArabicNumber) != 0; FX_BOOL bArabicComma = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_ArabicComma) != 0; FX_FLOAT fFontSize = pTxtRun->fFontSize; - FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f); - FX_INT32 iAscent = pFont->GetAscent(); - FX_INT32 iDescent = pFont->GetDescent(); - FX_INT32 iMaxHeight = iAscent - iDescent; + int32_t iFontSize = FXSYS_round(fFontSize * 20.0f); + int32_t iAscent = pFont->GetAscent(); + int32_t iDescent = pFont->GetDescent(); + int32_t iMaxHeight = iAscent - iDescent; 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; - FX_INT32 iRotation = GetLineRotation(dwStyles) + pTxtRun->iCharRotation; - FX_INT32 iCharRotation; + int32_t iRotation = GetLineRotation(dwStyles) + pTxtRun->iCharRotation; + int32_t iCharRotation; FX_WCHAR wch, wPrev = 0xFEFF, wNext, wForm, wLast = 0xFEFF; - FX_INT32 iWidth, iCharWidth, iCharHeight; + int32_t iWidth, iCharWidth, iCharHeight; FX_FLOAT fX, fY, fCharWidth, fCharHeight; - FX_INT32 iHorScale = pTxtRun->iHorizontalScale; - FX_INT32 iVerScale = pTxtRun->iVerticalScale; + int32_t iHorScale = pTxtRun->iHorizontalScale; + int32_t iVerScale = pTxtRun->iVerticalScale; FX_BOOL bSkipSpace = pTxtRun->bSkipSpace; FX_BOOL bEmptyChar, bShadda = FALSE, bLam = FALSE; FX_DWORD dwProps, dwCharType; @@ -1227,8 +1227,8 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar fYBase = rtText.top + (rtText.height - fFontSize) / 2.0f; fY = fYBase + fAscent; } - FX_INT32 iCount = 0, iNext, iForms; - for (FX_INT32 i = 0; i <= iLength; i ++) { + int32_t iCount = 0, iNext, iForms; + for (int32_t i = 0; i <= iLength; i ++) { if (pAccess != NULL) { wch = pAccess->GetChar(pIdentity, i); iWidth = pAccess->GetWidth(pIdentity, i); @@ -1259,7 +1259,7 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar wNext = 0xFEFF; } } else { - FX_INT32 j = -1; + int32_t j = -1; do { j ++; if (i + j >= iLength) { @@ -1386,7 +1386,7 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar pFont->GetCharWidth(0x0670, iCharWidth, FALSE); formChars[2].iWidth = iCharWidth; } - for (FX_INT32 j = 0; j < iForms; j ++) { + for (int32_t j = 0; j < iForms; j ++) { wForm = (FX_WCHAR)formChars[j].wForm; iCharWidth = formChars[j].iWidth; if (j > 0) { @@ -1421,7 +1421,7 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar pCharPos->m_OriginX = fX; pCharPos->m_OriginY = fY; if ((dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0) { - FX_INT32 iFormWidth = iCharWidth; + int32_t iFormWidth = iCharWidth; pFont->GetCharWidth(wForm, iFormWidth, FALSE); FX_FLOAT fOffset = fFontSize * (iCharWidth - iFormWidth) / 2000.0f; if (bVerticalDoc) { @@ -1544,7 +1544,7 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar } return iCount; } -FX_INT32 CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox ) const +int32_t CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox ) const { if (pTxtRun == NULL || pTxtRun->iLength < 1) { return 0; @@ -1552,12 +1552,12 @@ FX_INT32 CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArra IFX_TxtAccess *pAccess = pTxtRun->pAccess; FX_LPVOID pIdentity = pTxtRun->pIdentity; FX_LPCWSTR pStr = pTxtRun->pStr; - FX_INT32 *pWidths = pTxtRun->pWidths; - FX_INT32 iLength = pTxtRun->iLength; + int32_t *pWidths = pTxtRun->pWidths; + int32_t iLength = pTxtRun->iLength; CFX_RectF rect(*pTxtRun->pRect); FX_BOOL bRTLPiece = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_OddBidiLevel) != 0; FX_FLOAT fFontSize = pTxtRun->fFontSize; - FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f); + int32_t iFontSize = FXSYS_round(fFontSize * 20.0f); FX_FLOAT fScale = fFontSize / 1000.0f; IFX_Font *pFont = pTxtRun->pFont; if (pFont == NULL) { @@ -1576,14 +1576,14 @@ FX_INT32 CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArra FX_BOOL bSingleLine = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_SingleLine) != 0; FX_BOOL bCombText = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0; FX_WCHAR wch, wLineBreakChar = pTxtRun->wLineBreakChar; - FX_INT32 iCharSize; + int32_t iCharSize; FX_FLOAT fCharSize, fStart; if (bVertical) { fStart = bRTLPiece ? rect.bottom() : rect.top; } else { fStart = bRTLPiece ? rect.right() : rect.left; } - for (FX_INT32 i = 0; i < iLength; i ++) { + for (int32_t i = 0; i < iLength; i ++) { if (pAccess != NULL) { wch = pAccess->GetChar(pIdentity, i); iCharSize = pAccess->GetWidth(pIdentity, i); @@ -1620,7 +1620,7 @@ FX_INT32 CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArra rect.width = fCharSize; } if (bCharBBox && !bRet) { - FX_INT32 iCharWidth = 1000; + int32_t iCharWidth = 1000; pFont->GetCharWidth(wch, iCharWidth); FX_FLOAT fRTLeft = 0, fCharWidth = 0; if (iCharWidth > 0) { diff --git a/xfa/src/fgas/src/layout/fx_textbreak.h b/xfa/src/fgas/src/layout/fx_textbreak.h index a80b16c1b3..c38fc0b1ba 100644 --- a/xfa/src/fgas/src/layout/fx_textbreak.h +++ b/xfa/src/fgas/src/layout/fx_textbreak.h @@ -11,7 +11,7 @@ class CFX_Txtbreak; class CFX_TxtLine { public: - CFX_TxtLine(FX_INT32 iBlockSize) : m_iStart(0) + CFX_TxtLine(int32_t iBlockSize) : m_iStart(0) , m_iWidth(0) , m_iArabicChars(0) { @@ -24,30 +24,30 @@ public: delete m_pLineChars; FXTARGET_Delete m_pLinePieces; } - FX_INT32 CountChars() const + int32_t CountChars() const { return m_pLineChars->GetSize(); } - CFX_TxtChar* GetCharPtr(FX_INT32 index) const + CFX_TxtChar* GetCharPtr(int32_t index) const { FXSYS_assert(index > -1 && index < m_pLineChars->GetSize()); return m_pLineChars->GetDataPtr(index); } - FX_INT32 CountPieces() const + int32_t CountPieces() const { return m_pLinePieces->GetSize(); } - CFX_TxtPiece* GetPiecePtr(FX_INT32 index) const + CFX_TxtPiece* GetPiecePtr(int32_t index) const { FXSYS_assert(index > -1 && index < m_pLinePieces->GetSize()); return m_pLinePieces->GetPtrAt(index); } void GetString(CFX_WideString &wsStr) const { - FX_INT32 iCount = m_pLineChars->GetSize(); + int32_t iCount = m_pLineChars->GetSize(); FX_LPWSTR pBuf = wsStr.GetBuffer(iCount); CFX_Char *pChar; - for (FX_INT32 i = 0; i < iCount; i ++) { + for (int32_t i = 0; i < iCount; i ++) { pChar = m_pLineChars->GetDataPtr(i); *pBuf ++ = (FX_WCHAR)pChar->m_wCharCode; } @@ -62,9 +62,9 @@ public: } CFX_TxtCharArray *m_pLineChars; CFX_TxtPieceArray *m_pLinePieces; - FX_INT32 m_iStart; - FX_INT32 m_iWidth; - FX_INT32 m_iArabicChars; + int32_t m_iStart; + int32_t m_iWidth; + int32_t m_iArabicChars; }; class CFX_TxtBreak : public IFX_TxtBreak { @@ -88,35 +88,35 @@ public: virtual void SetDefaultChar(FX_WCHAR wch); virtual void SetParagraphBreakChar(FX_WCHAR wch); virtual void SetLineBreakTolerance(FX_FLOAT fTolerance); - virtual void SetHorizontalScale(FX_INT32 iScale); - virtual void SetVerticalScale(FX_INT32 iScale); - virtual void SetCharRotation(FX_INT32 iCharRotation); + virtual void SetHorizontalScale(int32_t iScale); + virtual void SetVerticalScale(int32_t iScale); + virtual void SetCharRotation(int32_t iCharRotation); virtual void SetCharSpace(FX_FLOAT fCharSpace); - virtual void SetAlignment(FX_INT32 iAlignment); + virtual void SetAlignment(int32_t iAlignment); virtual FX_DWORD GetContextCharStyles() const; virtual void SetContextCharStyles(FX_DWORD dwCharStyles); virtual void SetCombWidth(FX_FLOAT fCombWidth); virtual void SetUserData(FX_LPVOID pUserData); virtual FX_DWORD AppendChar(FX_WCHAR wch); virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_TXTBREAK_PieceBreak); - virtual FX_INT32 CountBreakChars() const; - virtual FX_INT32 CountBreakPieces() const; - virtual const CFX_TxtPiece* GetBreakPiece(FX_INT32 index) const; + virtual int32_t CountBreakChars() const; + virtual int32_t CountBreakPieces() const; + virtual const CFX_TxtPiece* GetBreakPiece(int32_t index) const; virtual void ClearBreakPieces(); virtual void Reset(); - virtual FX_INT32 GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const; - virtual FX_INT32 GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const; + virtual int32_t GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const; + virtual int32_t GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const; void AppendChar_PageLoad(CFX_Char *pCurChar, FX_DWORD dwProps); - FX_DWORD AppendChar_Combination(CFX_Char *pCurChar, FX_INT32 iRotation); - FX_DWORD AppendChar_Tab(CFX_Char *pCurChar, FX_INT32 iRotation); - FX_DWORD AppendChar_Control(CFX_Char *pCurChar, FX_INT32 iRotation); - FX_DWORD AppendChar_Arabic(CFX_Char *pCurChar, FX_INT32 iRotation); - FX_DWORD AppendChar_Others(CFX_Char *pCurChar, FX_INT32 iRotation); + FX_DWORD AppendChar_Combination(CFX_Char *pCurChar, int32_t iRotation); + FX_DWORD AppendChar_Tab(CFX_Char *pCurChar, int32_t iRotation); + FX_DWORD AppendChar_Control(CFX_Char *pCurChar, int32_t iRotation); + FX_DWORD AppendChar_Arabic(CFX_Char *pCurChar, int32_t iRotation); + FX_DWORD AppendChar_Others(CFX_Char *pCurChar, int32_t iRotation); protected: FX_DWORD m_dwPolicies; FX_BOOL m_bPagination; IFX_ArabicChar *m_pArabicChar; - FX_INT32 m_iLineWidth; + int32_t m_iLineWidth; FX_DWORD m_dwLayoutStyles; FX_BOOL m_bVertical; FX_BOOL m_bArabicContext; @@ -124,38 +124,38 @@ protected: FX_BOOL m_bRTL; FX_BOOL m_bSingleLine; FX_BOOL m_bCombText; - FX_INT32 m_iArabicContext; - FX_INT32 m_iCurArabicContext; + int32_t m_iArabicContext; + int32_t m_iCurArabicContext; IFX_Font *m_pFont; - FX_INT32 m_iFontSize; + int32_t m_iFontSize; FX_BOOL m_bEquidistant; - FX_INT32 m_iTabWidth; + int32_t m_iTabWidth; FX_WCHAR m_wDefChar; FX_WCHAR m_wParagBreakChar; - FX_INT32 m_iDefChar; - FX_INT32 m_iLineRotation; - FX_INT32 m_iCharRotation; - FX_INT32 m_iRotation; - FX_INT32 m_iAlignment; + int32_t m_iDefChar; + int32_t m_iLineRotation; + int32_t m_iCharRotation; + int32_t m_iRotation; + int32_t m_iAlignment; FX_DWORD m_dwContextCharStyles; - FX_INT32 m_iCombWidth; + int32_t m_iCombWidth; FX_LPVOID m_pUserData; FX_DWORD m_dwCharType; FX_BOOL m_bCurRTL; - FX_INT32 m_iCurAlignment; + int32_t m_iCurAlignment; FX_BOOL m_bArabicNumber; FX_BOOL m_bArabicComma; CFX_TxtLine *m_pTxtLine1; CFX_TxtLine *m_pTxtLine2; CFX_TxtLine *m_pCurLine; - FX_INT32 m_iReady; - FX_INT32 m_iTolerance; - FX_INT32 m_iHorScale; - FX_INT32 m_iVerScale; - FX_INT32 m_iCharSpace; + int32_t m_iReady; + int32_t m_iTolerance; + int32_t m_iHorScale; + int32_t m_iVerScale; + int32_t m_iCharSpace; void SetBreakStatus(); - FX_INT32 GetLineRotation(FX_DWORD dwStyles) const; - CFX_TxtChar* GetLastChar(FX_INT32 index, FX_BOOL bOmitChar = TRUE) const; + int32_t GetLineRotation(FX_DWORD 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; FX_DWORD GetUnifiedCharType(FX_DWORD dwType) const; @@ -165,7 +165,7 @@ protected: FX_BOOL EndBreak_SplitLine(CFX_TxtLine *pNextLine, FX_BOOL bAllChars, FX_DWORD dwStatus); void EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus); void EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_DWORD dwStatus); - FX_INT32 GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_BOOL bAllChars = FALSE, FX_BOOL bOnlyBrk = FALSE); + int32_t GetBreakPos(CFX_TxtCharArray &ca, int32_t &iEndPos, FX_BOOL bAllChars = FALSE, FX_BOOL bOnlyBrk = FALSE); void SplitTextLine(CFX_TxtLine *pCurLine, CFX_TxtLine *pNextLine, FX_BOOL bAllChars = FALSE); }; #endif diff --git a/xfa/src/fgas/src/layout/fx_unicode.cpp b/xfa/src/fgas/src/layout/fx_unicode.cpp index def5d707f5..b93990551c 100644 --- a/xfa/src/fgas/src/layout/fx_unicode.cpp +++ b/xfa/src/fgas/src/layout/fx_unicode.cpp @@ -6,16 +6,16 @@ #include "../fgas_base.h" #include "fx_unicode.h" -void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray &tpos, FX_INT32 iStart, FX_INT32 iEnd) +void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray &tpos, int32_t iStart, int32_t iEnd) { FXSYS_assert(iStart > -1 && iStart < tpos.GetSize()); FXSYS_assert(iEnd > -1 && iEnd < tpos.GetSize()); if (iStart >= iEnd) { return; } - FX_INT32 i = iStart, j = iEnd; + int32_t i = iStart, j = iEnd; FX_TPO *pCur = tpos.GetPtrAt(iStart), *pSort; - FX_INT32 v = pCur->pos; + int32_t v = pCur->pos; while (i < j) { while (j > i) { pSort = tpos.GetPtrAt(j); @@ -95,10 +95,10 @@ static const FX_JAPCHARPROPERTYEX gs_FX_JapCharPropertysEx[] = { }; FX_LPCJAPCHARPROPERTYEX FX_GetJapCharPropertyEx(FX_WCHAR wch) { - FX_INT32 iStart = 0; - FX_INT32 iEnd = sizeof(gs_FX_JapCharPropertysEx) / sizeof(FX_JAPCHARPROPERTYEX); + int32_t iStart = 0; + int32_t iEnd = sizeof(gs_FX_JapCharPropertysEx) / sizeof(FX_JAPCHARPROPERTYEX); while (iStart <= iEnd) { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; FX_WCHAR wJapChar = gs_FX_JapCharPropertysEx[iMid].wChar; if (wch == wJapChar) { return gs_FX_JapCharPropertysEx + iMid; diff --git a/xfa/src/fgas/src/layout/fx_unicode.h b/xfa/src/fgas/src/layout/fx_unicode.h index 5eadb5506f..08f9528347 100644 --- a/xfa/src/fgas/src/layout/fx_unicode.h +++ b/xfa/src/fgas/src/layout/fx_unicode.h @@ -7,9 +7,9 @@ #ifndef _FGAS_UNICODE_IMP #define _FGAS_UNICODE_IMP typedef struct _FX_TPO { - FX_INT32 index; - FX_INT32 pos; + int32_t index; + int32_t pos; } FX_TPO; typedef CFX_MassArrayTemplate CFX_TPOArray; -void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray &tpos, FX_INT32 iStart, FX_INT32 iEnd); +void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray &tpos, int32_t iStart, int32_t iEnd); #endif diff --git a/xfa/src/fgas/src/localization/fx_datetime.cpp b/xfa/src/fgas/src/localization/fx_datetime.cpp index 7c2b3d3540..9a1da457d9 100644 --- a/xfa/src/fgas/src/localization/fx_datetime.cpp +++ b/xfa/src/fgas/src/localization/fx_datetime.cpp @@ -5,56 +5,56 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../fgas_base.h" -const FX_BYTE g_FXDaysPerMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; -const FX_BYTE g_FXDaysPerLeapMonth[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; -const FX_INT32 g_FXDaysBeforeMonth[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; -const FX_INT32 g_FXDaysBeforeLeapMonth[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335}; -const FX_INT32 g_FXDaysPerYear = 365; -const FX_INT32 g_FXDaysPerLeapYear = 366; -const FX_INT32 g_FXDaysPer4Years = 1461; -const FX_INT32 g_FXDaysPer100Years = 36524; -const FX_INT32 g_FXDaysPer400Years = 146097; -const FX_INT64 g_FXMillisecondsPerSecond = 1000; -const FX_INT64 g_FXMillisecondsPerMinute = 60000; -const FX_INT64 g_FXMillisecondsPerHour = 3600000; -const FX_INT64 g_FXMillisecondsPerDay = 86400000; +const uint8_t g_FXDaysPerMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; +const uint8_t g_FXDaysPerLeapMonth[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; +const int32_t g_FXDaysBeforeMonth[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; +const int32_t g_FXDaysBeforeLeapMonth[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335}; +const int32_t g_FXDaysPerYear = 365; +const int32_t g_FXDaysPerLeapYear = 366; +const int32_t g_FXDaysPer4Years = 1461; +const int32_t g_FXDaysPer100Years = 36524; +const int32_t g_FXDaysPer400Years = 146097; +const int64_t g_FXMillisecondsPerSecond = 1000; +const int64_t g_FXMillisecondsPerMinute = 60000; +const int64_t g_FXMillisecondsPerHour = 3600000; +const int64_t g_FXMillisecondsPerDay = 86400000; #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_ -const FX_INT64 g_FXMillisecondsPerYear = 0x0757B12C00; -const FX_INT64 g_FXMillisecondsPerLeapYear = 0x075CD78800; -const FX_INT64 g_FXMillisecondsPer4Years = 0x1D63EB0C00; -const FX_INT64 g_FXMillisecondsPer100Years = 0x02DEBCCDD000; -const FX_INT64 g_FXMillisecondsPer400Years = 0x0B7AF85D9C00; +const int64_t g_FXMillisecondsPerYear = 0x0757B12C00; +const int64_t g_FXMillisecondsPerLeapYear = 0x075CD78800; +const int64_t g_FXMillisecondsPer4Years = 0x1D63EB0C00; +const int64_t g_FXMillisecondsPer100Years = 0x02DEBCCDD000; +const int64_t g_FXMillisecondsPer400Years = 0x0B7AF85D9C00; #endif -FX_BOOL FX_IsLeapYear(FX_INT32 iYear) +FX_BOOL FX_IsLeapYear(int32_t iYear) { FXSYS_assert(iYear != 0); return ((iYear % 4) == 0 && (iYear % 100) != 0) || (iYear % 400) == 0; } -FX_INT32 FX_DaysInYear(FX_INT32 iYear) +int32_t FX_DaysInYear(int32_t iYear) { FXSYS_assert(iYear != 0); return FX_IsLeapYear(iYear) ? g_FXDaysPerLeapYear : g_FXDaysPerYear; } -FX_BYTE FX_DaysInMonth(FX_INT32 iYear, FX_BYTE iMonth) +uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth) { FXSYS_assert(iYear != 0); FXSYS_assert(iMonth >= 1 && iMonth <= 12); - const FX_BYTE *p = FX_IsLeapYear(iYear) ? g_FXDaysPerLeapMonth : g_FXDaysPerMonth; + const uint8_t *p = FX_IsLeapYear(iYear) ? g_FXDaysPerLeapMonth : g_FXDaysPerMonth; return p[iMonth - 1]; } -static FX_INT32 FX_DaysBeforeMonthInYear(FX_INT32 iYear, FX_BYTE iMonth) +static int32_t FX_DaysBeforeMonthInYear(int32_t iYear, uint8_t iMonth) { FXSYS_assert(iYear != 0); FXSYS_assert(iMonth >= 1 && iMonth <= 12); - const FX_INT32 *p = FX_IsLeapYear(iYear) ? g_FXDaysBeforeLeapMonth : g_FXDaysBeforeMonth; + const int32_t *p = FX_IsLeapYear(iYear) ? g_FXDaysBeforeLeapMonth : g_FXDaysBeforeMonth; return p[iMonth - 1]; } -static FX_INT64 FX_DateToDays(FX_INT32 iYear, FX_BYTE iMonth, FX_BYTE iDay, FX_BOOL bIncludeThisDay = FALSE) +static int64_t FX_DateToDays(int32_t iYear, uint8_t iMonth, uint8_t iDay, FX_BOOL bIncludeThisDay = FALSE) { FXSYS_assert(iYear != 0); FXSYS_assert(iMonth >= 1 && iMonth <= 12); FXSYS_assert(iDay >= 1 && iDay <= FX_DaysInMonth(iYear, iMonth)); - FX_INT64 iDays = FX_DaysBeforeMonthInYear(iYear, iMonth); + int64_t iDays = FX_DaysBeforeMonthInYear(iYear, iMonth); iDays += iDay; if (!bIncludeThisDay) { iDays --; @@ -65,9 +65,9 @@ static FX_INT64 FX_DateToDays(FX_INT32 iYear, FX_BYTE iMonth, FX_BYTE iDay, FX_B iDays -= FX_DaysInYear(iYear); iYear ++; } - return iDays + (FX_INT64)iYear * 365 + iYear / 4 - iYear / 100 + iYear / 400; + return iDays + (int64_t)iYear * 365 + iYear / 4 - iYear / 100 + iYear / 400; } -static void FX_DaysToDate(FX_INT64 iDays, FX_INT32 &iYear, FX_BYTE &iMonth, FX_BYTE &iDay) +static void FX_DaysToDate(int64_t iDays, int32_t &iYear, uint8_t &iMonth, uint8_t &iDay) { FX_BOOL bBC = iDays < 0; if (bBC) { @@ -77,7 +77,7 @@ static void FX_DaysToDate(FX_INT64 iDays, FX_INT32 &iYear, FX_BYTE &iMonth, FX_B iMonth = 1; iDay = 1; if (iDays >= g_FXDaysPer400Years) { - iYear += (FX_INT32)(iDays / g_FXDaysPer400Years * 400); + iYear += (int32_t)(iDays / g_FXDaysPer400Years * 400); iDays %= g_FXDaysPer400Years; } if (iDays >= g_FXDaysPer100Years) { @@ -85,16 +85,16 @@ static void FX_DaysToDate(FX_INT64 iDays, FX_INT32 &iYear, FX_BYTE &iMonth, FX_B iYear += 300; iDays -= g_FXDaysPer100Years * 3; } else { - iYear += (FX_INT32)(iDays / g_FXDaysPer100Years * 100); + iYear += (int32_t)(iDays / g_FXDaysPer100Years * 100); iDays %= g_FXDaysPer100Years; } } if (iDays >= g_FXDaysPer4Years) { - iYear += (FX_INT32)(iDays / g_FXDaysPer4Years * 4); + iYear += (int32_t)(iDays / g_FXDaysPer4Years * 4); iDays %= g_FXDaysPer4Years; } while (TRUE) { - FX_INT32 iYearDays = FX_DaysInYear(iYear); + int32_t iYearDays = FX_DaysInYear(iYear); if (iDays < iYearDays) { if (bBC) { iYear = -iYear; @@ -106,14 +106,14 @@ static void FX_DaysToDate(FX_INT64 iDays, FX_INT32 &iYear, FX_BYTE &iMonth, FX_B iDays -= iYearDays; } while (TRUE) { - FX_INT32 iMonthDays = FX_DaysInMonth(iYear, iMonth); + int32_t iMonthDays = FX_DaysInMonth(iYear, iMonth); if (iDays < iMonthDays) { break; } iMonth ++; iDays -= iMonthDays; } - iDay += (FX_BYTE)iDays; + iDay += (uint8_t)iDays; } #if _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_ || _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_ #include @@ -153,8 +153,8 @@ void CFX_Unitime::Now() utLocal.wSecond = st.tm_sec; utLocal.wMilliseconds = curTime.tv_usec / 1000; #endif - Set(utLocal.wYear, (FX_BYTE)utLocal.wMonth, (FX_BYTE)utLocal.wDay, - (FX_BYTE)utLocal.wHour, (FX_BYTE)utLocal.wMinute, (FX_BYTE)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds); + Set(utLocal.wYear, (uint8_t)utLocal.wMonth, (uint8_t)utLocal.wDay, + (uint8_t)utLocal.wHour, (uint8_t)utLocal.wMinute, (uint8_t)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds); } void CFX_Unitime::SetGMTime() { @@ -180,16 +180,16 @@ void CFX_Unitime::SetGMTime() utLocal.wSecond = st.tm_sec; utLocal.wMilliseconds = curTime.tv_usec / 1000; #endif - Set(utLocal.wYear, (FX_BYTE)utLocal.wMonth, (FX_BYTE)utLocal.wDay, - (FX_BYTE)utLocal.wHour, (FX_BYTE)utLocal.wMinute, (FX_BYTE)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds); + Set(utLocal.wYear, (uint8_t)utLocal.wMonth, (uint8_t)utLocal.wDay, + (uint8_t)utLocal.wHour, (uint8_t)utLocal.wMinute, (uint8_t)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds); } -void CFX_Unitime::Set(FX_INT32 year, FX_BYTE month, FX_BYTE day, FX_BYTE hour, FX_BYTE minute, FX_BYTE second, FX_WORD millisecond) +void CFX_Unitime::Set(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, FX_WORD millisecond) { FXSYS_assert(hour <= 23); FXSYS_assert(minute <= 59); FXSYS_assert(second <= 59); FXSYS_assert(millisecond <= 999); - m_iUnitime = (FX_INT64)hour * g_FXMillisecondsPerHour + (FX_INT64)minute * g_FXMillisecondsPerMinute + (FX_INT64)second * g_FXMillisecondsPerSecond + millisecond; + m_iUnitime = (int64_t)hour * g_FXMillisecondsPerHour + (int64_t)minute * g_FXMillisecondsPerMinute + (int64_t)second * g_FXMillisecondsPerSecond + millisecond; if (year > 0) { m_iUnitime = m_iUnitime + FX_DateToDays(year, month, day, FALSE) * g_FXMillisecondsPerDay; } @@ -198,30 +198,30 @@ void CFX_Unitime::Set(FX_UNITIME t) { m_iUnitime = t; } -FX_INT32 CFX_Unitime::GetYear() const +int32_t CFX_Unitime::GetYear() const { - FX_INT32 iYear; - FX_BYTE iMonth, iDay; + int32_t iYear; + uint8_t iMonth, iDay; FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay); return iYear; } -FX_BYTE CFX_Unitime::GetMonth() const +uint8_t CFX_Unitime::GetMonth() const { - FX_INT32 iYear; - FX_BYTE iMonth, iDay; + int32_t iYear; + uint8_t iMonth, iDay; FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay); return iMonth; } -FX_BYTE CFX_Unitime::GetDay() const +uint8_t CFX_Unitime::GetDay() const { - FX_INT32 iYear; - FX_BYTE iMonth, iDay; + int32_t iYear; + uint8_t iMonth, iDay; FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay); return iDay; } FX_WEEKDAY CFX_Unitime::GetDayOfWeek() const { - FX_INT32 v = (FX_INT32)((m_iUnitime / g_FXMillisecondsPerDay + 1) % 7); + int32_t v = (int32_t)((m_iUnitime / g_FXMillisecondsPerDay + 1) % 7); if (v < 0) { v += 7; } @@ -229,62 +229,62 @@ FX_WEEKDAY CFX_Unitime::GetDayOfWeek() const } FX_WORD CFX_Unitime::GetDayOfYear() const { - FX_INT32 iYear; - FX_BYTE iMonth, iDay; + int32_t iYear; + uint8_t iMonth, iDay; FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay); return FX_DaysBeforeMonthInYear(iYear, iMonth) + iDay; } -FX_INT64 CFX_Unitime::GetDayOfAD() const +int64_t CFX_Unitime::GetDayOfAD() const { FX_BOOL bBC = m_iUnitime < 0; - FX_INT64 iDays = m_iUnitime / g_FXMillisecondsPerDay; + int64_t iDays = m_iUnitime / g_FXMillisecondsPerDay; iDays += bBC ? -1 : 0; if (bBC && (m_iUnitime % g_FXMillisecondsPerDay) == 0) { iDays ++; } return iDays; } -FX_BYTE CFX_Unitime::GetHour() const +uint8_t CFX_Unitime::GetHour() const { - FX_INT32 v = (FX_INT32)(m_iUnitime % g_FXMillisecondsPerDay); + int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerDay); if (v < 0) { v += g_FXMillisecondsPerDay; } - return (FX_BYTE)(v / g_FXMillisecondsPerHour); + return (uint8_t)(v / g_FXMillisecondsPerHour); } -FX_BYTE CFX_Unitime::GetMinute() const +uint8_t CFX_Unitime::GetMinute() const { - FX_INT32 v = (FX_INT32)(m_iUnitime % g_FXMillisecondsPerHour); + int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerHour); if (v < 0) { v += g_FXMillisecondsPerHour; } - return (FX_BYTE)(v / g_FXMillisecondsPerMinute); + return (uint8_t)(v / g_FXMillisecondsPerMinute); } -FX_BYTE CFX_Unitime::GetSecond() const +uint8_t CFX_Unitime::GetSecond() const { - FX_INT32 v = (FX_INT32)(m_iUnitime % g_FXMillisecondsPerMinute); + int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerMinute); if (v < 0) { v += g_FXMillisecondsPerMinute; } - return (FX_BYTE)(v / g_FXMillisecondsPerSecond); + return (uint8_t)(v / g_FXMillisecondsPerSecond); } FX_WORD CFX_Unitime::GetMillisecond() const { - FX_INT32 v = (FX_INT32)(m_iUnitime % g_FXMillisecondsPerSecond); + int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerSecond); if (v < 0) { v += g_FXMillisecondsPerSecond; } return (FX_WORD)v; } -FX_BOOL CFX_Unitime::AddYears(FX_INT32 iYears) +FX_BOOL CFX_Unitime::AddYears(int32_t iYears) { FX_UNITIME ut = m_iUnitime; if (ut < 0) { ut = -ut; } FX_UNITIME r = ut % g_FXMillisecondsPerDay; - FX_INT32 iYear; - FX_BYTE iMonth, iDay; + int32_t iYear; + uint8_t iMonth, iDay; FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay); iYear += iYears; if (iYear == 0) { @@ -294,7 +294,7 @@ FX_BOOL CFX_Unitime::AddYears(FX_INT32 iYears) m_iUnitime += (iYear < 0) ? -r : r; return TRUE; } -FX_BOOL CFX_Unitime::AddMonths(FX_INT32 iMonths) +FX_BOOL CFX_Unitime::AddMonths(int32_t iMonths) { FX_BOOL b = iMonths > 0; FX_UNITIME ut = m_iUnitime; @@ -302,8 +302,8 @@ FX_BOOL CFX_Unitime::AddMonths(FX_INT32 iMonths) ut = -ut; } FX_UNITIME r = ut % g_FXMillisecondsPerDay; - FX_INT32 iYear; - FX_BYTE iMonth, iDay; + int32_t iYear; + uint8_t iMonth, iDay; FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay); iMonths += iMonth; while (iMonths < 1) { @@ -315,36 +315,36 @@ FX_BOOL CFX_Unitime::AddMonths(FX_INT32 iMonths) if (iYear == 0) { iYear = b ? 1 : -1; } - m_iUnitime = FX_DateToDays(iYear, (FX_BYTE)iMonths, iDay, FALSE) * g_FXMillisecondsPerDay; + m_iUnitime = FX_DateToDays(iYear, (uint8_t)iMonths, iDay, FALSE) * g_FXMillisecondsPerDay; m_iUnitime += (iYear < 0) ? -r : r; return TRUE; } -FX_BOOL CFX_Unitime::AddDays(FX_INT32 iDays) +FX_BOOL CFX_Unitime::AddDays(int32_t iDays) { - m_iUnitime += (FX_INT64)iDays * g_FXMillisecondsPerDay; + m_iUnitime += (int64_t)iDays * g_FXMillisecondsPerDay; return TRUE; } -FX_BOOL CFX_Unitime::AddHours(FX_INT32 iHours) +FX_BOOL CFX_Unitime::AddHours(int32_t iHours) { - m_iUnitime += (FX_INT64)iHours * g_FXMillisecondsPerHour; + m_iUnitime += (int64_t)iHours * g_FXMillisecondsPerHour; return TRUE; } -FX_BOOL CFX_Unitime::AddMinutes(FX_INT32 iMinutes) +FX_BOOL CFX_Unitime::AddMinutes(int32_t iMinutes) { - m_iUnitime += (FX_INT64)iMinutes * g_FXMillisecondsPerMinute; + m_iUnitime += (int64_t)iMinutes * g_FXMillisecondsPerMinute; return TRUE; } -FX_BOOL CFX_Unitime::AddSeconds(FX_INT32 iSeconds) +FX_BOOL CFX_Unitime::AddSeconds(int32_t iSeconds) { - m_iUnitime += ((FX_INT64)iSeconds) * g_FXMillisecondsPerSecond; + m_iUnitime += ((int64_t)iSeconds) * g_FXMillisecondsPerSecond; return TRUE; } -FX_BOOL CFX_Unitime::AddMilliseconds(FX_INT32 iMilliseconds) +FX_BOOL CFX_Unitime::AddMilliseconds(int32_t iMilliseconds) { m_iUnitime += iMilliseconds; return TRUE; } -FX_BOOL CFX_DateTime::Set(FX_INT32 year, FX_BYTE month, FX_BYTE day, FX_BYTE hour, FX_BYTE minute, FX_BYTE second, FX_WORD millisecond) +FX_BOOL CFX_DateTime::Set(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, FX_WORD millisecond) { ASSERT(year != 0); ASSERT(month >= 1 && month <= 12); @@ -374,25 +374,25 @@ FX_BOOL CFX_DateTime::FromUnitime(FX_UNITIME t) } FX_UNITIME CFX_DateTime::ToUnitime() const { - FX_UNITIME v = (FX_INT64)m_DateTime.Date.sDate.day * g_FXMillisecondsPerHour + (FX_INT64)m_DateTime.Time.sTime.minute * g_FXMillisecondsPerMinute + (FX_INT64)m_DateTime.Time.sTime.second * g_FXMillisecondsPerSecond + m_DateTime.Time.sTime.millisecond; + FX_UNITIME v = (int64_t)m_DateTime.Date.sDate.day * g_FXMillisecondsPerHour + (int64_t)m_DateTime.Time.sTime.minute * g_FXMillisecondsPerMinute + (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) * g_FXMillisecondsPerDay; return v; } -FX_INT32 CFX_DateTime::GetYear() const +int32_t CFX_DateTime::GetYear() const { return m_DateTime.Date.sDate.year; } -FX_BYTE CFX_DateTime::GetMonth() const +uint8_t CFX_DateTime::GetMonth() const { return m_DateTime.Date.sDate.month; } -FX_BYTE CFX_DateTime::GetDay() const +uint8_t CFX_DateTime::GetDay() const { return m_DateTime.Date.sDate.day; } FX_WEEKDAY CFX_DateTime::GetDayOfWeek() const { - FX_INT32 v = (FX_INT32)(FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE) % 7); + int32_t v = (int32_t)(FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE) % 7); if (v < 0) { v += 7; } @@ -402,19 +402,19 @@ FX_WORD CFX_DateTime::GetDayOfYear() const { return FX_DaysBeforeMonthInYear(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month) + m_DateTime.Date.sDate.day; } -FX_INT64 CFX_DateTime::GetDayOfAD() 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); } -FX_BYTE CFX_DateTime::GetHour() const +uint8_t CFX_DateTime::GetHour() const { return m_DateTime.Date.sDate.day; } -FX_BYTE CFX_DateTime::GetMinute() const +uint8_t CFX_DateTime::GetMinute() const { return m_DateTime.Time.sTime.minute; } -FX_BYTE CFX_DateTime::GetSecond() const +uint8_t CFX_DateTime::GetSecond() const { return m_DateTime.Time.sTime.second; } @@ -422,12 +422,12 @@ FX_WORD CFX_DateTime::GetMillisecond() const { return m_DateTime.Time.sTime.millisecond; } -FX_BOOL CFX_DateTime::AddYears(FX_INT32 iYears) +FX_BOOL CFX_DateTime::AddYears(int32_t iYears) { if (iYears == 0) { return FALSE; } - FX_INT32 v = m_DateTime.Date.sDate.year + iYears; + int32_t v = m_DateTime.Date.sDate.year + iYears; if (v >= 0 && m_DateTime.Date.sDate.year < 0) { v ++; } else if (v <= 0 && m_DateTime.Date.sDate.year > 0) { @@ -436,7 +436,7 @@ FX_BOOL CFX_DateTime::AddYears(FX_INT32 iYears) m_DateTime.Date.sDate.year = v; return TRUE; } -FX_BOOL CFX_DateTime::AddMonths(FX_INT32 iMonths) +FX_BOOL CFX_DateTime::AddMonths(int32_t iMonths) { if (iMonths == 0) { return FALSE; @@ -460,16 +460,16 @@ FX_BOOL CFX_DateTime::AddMonths(FX_INT32 iMonths) if (m_DateTime.Date.sDate.year == 0) { m_DateTime.Date.sDate.year = b ? 1 : -1; } - m_DateTime.Date.sDate.month = (FX_BYTE)iMonths; + m_DateTime.Date.sDate.month = (uint8_t)iMonths; return TRUE; } -FX_BOOL CFX_DateTime::AddDays(FX_INT32 iDays) +FX_BOOL CFX_DateTime::AddDays(int32_t iDays) { if (iDays == 0) { return FALSE; } - FX_INT64 v1 = FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE); - FX_INT64 v2 = v1 + iDays; + int64_t v1 = FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE); + int64_t v2 = v1 + iDays; if (v2 <= 0 && v1 > 0) { v2 --; } else if (v2 >= 0 && v1 < 0) { @@ -478,64 +478,64 @@ FX_BOOL CFX_DateTime::AddDays(FX_INT32 iDays) FX_DaysToDate(v2, m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day); return TRUE; } -FX_BOOL CFX_DateTime::AddHours(FX_INT32 iHours) +FX_BOOL CFX_DateTime::AddHours(int32_t iHours) { if (iHours == 0) { return FALSE; } iHours += m_DateTime.Date.sDate.day; - FX_INT32 iDays = iHours / 24; + int32_t iDays = iHours / 24; iHours %= 24; if (iHours < 0) { iDays --, iHours += 24; } - m_DateTime.Date.sDate.day = (FX_BYTE)iHours; + m_DateTime.Date.sDate.day = (uint8_t)iHours; if (iDays != 0) { AddDays(iDays); } return TRUE; } -FX_BOOL CFX_DateTime::AddMinutes(FX_INT32 iMinutes) +FX_BOOL CFX_DateTime::AddMinutes(int32_t iMinutes) { if (iMinutes == 0) { return FALSE; } iMinutes += m_DateTime.Time.sTime.minute; - FX_INT32 iHours = iMinutes / 60; + int32_t iHours = iMinutes / 60; iMinutes %= 60; if (iMinutes < 0) { iHours --, iMinutes += 60; } - m_DateTime.Time.sTime.minute = (FX_BYTE)iMinutes; + m_DateTime.Time.sTime.minute = (uint8_t)iMinutes; if (iHours != 0) { AddHours(iHours); } return TRUE; } -FX_BOOL CFX_DateTime::AddSeconds(FX_INT32 iSeconds) +FX_BOOL CFX_DateTime::AddSeconds(int32_t iSeconds) { if (iSeconds == 0) { return FALSE; } iSeconds += m_DateTime.Time.sTime.second; - FX_INT32 iMinutes = iSeconds / 60; + int32_t iMinutes = iSeconds / 60; iSeconds %= 60; if (iSeconds < 0) { iMinutes --, iSeconds += 60; } - m_DateTime.Time.sTime.second = (FX_BYTE)iSeconds; + m_DateTime.Time.sTime.second = (uint8_t)iSeconds; if (iMinutes != 0) { AddMinutes(iMinutes); } return TRUE; } -FX_BOOL CFX_DateTime::AddMilliseconds(FX_INT32 iMilliseconds) +FX_BOOL CFX_DateTime::AddMilliseconds(int32_t iMilliseconds) { if (iMilliseconds == 0) { return FALSE; } iMilliseconds += m_DateTime.Time.sTime.millisecond; - FX_INT32 iSeconds = (FX_INT32)(iMilliseconds / g_FXMillisecondsPerSecond); + int32_t iSeconds = (int32_t)(iMilliseconds / g_FXMillisecondsPerSecond); iMilliseconds %= g_FXMillisecondsPerSecond; if (iMilliseconds < 0) { iSeconds --, iMilliseconds += g_FXMillisecondsPerSecond; diff --git a/xfa/src/fgas/src/localization/fx_locale.cpp b/xfa/src/fgas/src/localization/fx_locale.cpp index 4998201871..4f046df119 100644 --- a/xfa/src/fgas/src/localization/fx_locale.cpp +++ b/xfa/src/fgas/src/localization/fx_locale.cpp @@ -14,9 +14,9 @@ #define FX_LOCALECATEGORY_ZeroHash 0x568cb500 #define FX_LOCALECATEGORY_NullHash 0x052931bb typedef struct _FX_LOCALESUBCATEGORYINFO { - FX_UINT32 uHash; + uint32_t uHash; FX_LPCWSTR pName; - FX_INT32 eSubCategory; + int32_t eSubCategory; } FX_LOCALESUBCATEGORYINFO, * FX_LPLOCALESUBCATEGORYINFO; typedef FX_LOCALESUBCATEGORYINFO const * FX_LPCLOCALESUBCATEGORYINFO; const static FX_LOCALESUBCATEGORYINFO g_FXLocaleDateTimeSubCatData[] = { @@ -26,18 +26,18 @@ const static FX_LOCALESUBCATEGORYINFO g_FXLocaleDateTimeSubCatData[] = { {0xcdce56b3, L"full", FX_LOCALEDATETIMESUBCATEGORY_Full}, {0xf6b4afb0, L"long", FX_LOCALEDATETIMESUBCATEGORY_Long}, }; -const static FX_INT32 g_iFXLocaleDateTimeSubCatCount = sizeof(g_FXLocaleDateTimeSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO); +const static int32_t g_iFXLocaleDateTimeSubCatCount = sizeof(g_FXLocaleDateTimeSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO); const static FX_LOCALESUBCATEGORYINFO g_FXLocaleNumSubCatData[] = { {0x46f95531, L"percent", FX_LOCALENUMPATTERN_Percent}, {0x4c4e8acb, L"currency", FX_LOCALENUMPATTERN_Currency}, {0x54034c2f, L"decimal", FX_LOCALENUMPATTERN_Decimal}, {0x7568e6ae, L"integer", FX_LOCALENUMPATTERN_Integer}, }; -const static FX_INT32 g_iFXLocaleNumSubCatCount = sizeof(g_FXLocaleNumSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO); +const static int32_t g_iFXLocaleNumSubCatCount = sizeof(g_FXLocaleNumSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO); typedef struct _FX_LOCALETIMEZONEINFO { FX_DWORD uHash; - FX_INT16 iHour; - FX_INT16 iMinute; + int16_t iHour; + int16_t iMinute; } FX_LOCALETIMEZONEINFO, * FX_LPLOCALETIMEZONEINFO; typedef FX_LOCALETIMEZONEINFO const * FX_LPCLOCALETIMEZONEINFO; const static FX_LOCALETIMEZONEINFO g_FXLocaleTimeZoneData[] = { @@ -46,7 +46,7 @@ const static FX_LOCALETIMEZONEINFO g_FXLocaleTimeZoneData[] = { {FXBSTR_ID(0, 'M', 'D', 'T'), -6, 0}, {FXBSTR_ID(0, 'M', 'S', 'T'), -7, 0}, {FXBSTR_ID(0, 'P', 'D', 'T'), -7, 0}, {FXBSTR_ID(0, 'P', 'S', 'T'), -8, 0}, }; -const static FX_INT32 g_iFXLocaleTimeZoneCount = sizeof(g_FXLocaleTimeZoneData) / sizeof(FX_LOCALETIMEZONEINFO); +const static int32_t g_iFXLocaleTimeZoneCount = sizeof(g_FXLocaleTimeZoneData) / sizeof(FX_LOCALETIMEZONEINFO); const static CFX_WideStringC gs_wsTextSymbols = FX_WSTRC(L"AXO09"); const static CFX_WideStringC gs_wsTimeSymbols = FX_WSTRC(L"hHkKMSFAzZ"); const static CFX_WideStringC gs_wsDateSymbols = FX_WSTRC(L"DJMEeGgYwW"); @@ -82,8 +82,8 @@ CFX_WideString CFX_Locale::GetName() static CFX_WideString FX_GetXMLContent(FX_BSTR bsSpace, CXML_Element* pxmlElement, FX_BSTR bsTag, FX_WSTR wsName) { CXML_Element* pDatePattern = NULL; - FX_INT32 nCount = pxmlElement->CountElements(bsSpace, bsTag); - FX_INT32 i = 0; + int32_t nCount = pxmlElement->CountElements(bsSpace, bsTag); + int32_t i = 0; for (; i < nCount; i++) { pDatePattern = pxmlElement->GetElement(bsSpace, bsTag, i); if (pDatePattern->GetAttrValue(FX_BSTRC("name")) == wsName) { @@ -120,7 +120,7 @@ void CFX_Locale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const } wsDtSymbol = pNumberSymbols->GetContent(0); } -static void FX_GetCalendarSymbol(CXML_Element* pXmlElement, const CFX_ByteString &symbol_type, FX_INT32 index, FX_BOOL bAbbr, CFX_WideString &wsName) +static void FX_GetCalendarSymbol(CXML_Element* pXmlElement, const CFX_ByteString &symbol_type, int32_t index, FX_BOOL bAbbr, CFX_WideString &wsName) { CFX_ByteString bsSpace; CFX_ByteString pstrSymbolNames = symbol_type + FX_BSTRC("Names"); @@ -142,14 +142,14 @@ static void FX_GetCalendarSymbol(CXML_Element* pXmlElement, const CFX_ByteString } } } -void CFX_Locale::GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const +void CFX_Locale::GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const { if (!m_pElement) { return; } FX_GetCalendarSymbol(m_pElement, "month", nMonth, bAbbr, wsMonthName); } -void CFX_Locale::GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const +void CFX_Locale::GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const { if (!m_pElement) { return; @@ -163,15 +163,15 @@ void CFX_Locale::GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM ) c } FX_GetCalendarSymbol(m_pElement, "meridiem", bAM ? 0 : 1, FALSE, wsMeridiemName); } -static FX_INT32 FX_ParseTimeZone(FX_LPCWSTR pStr, FX_INT32 iLen, FX_TIMEZONE& tz) +static int32_t FX_ParseTimeZone(FX_LPCWSTR pStr, int32_t iLen, FX_TIMEZONE& tz) { tz.tzHour = 0; tz.tzMinute = 0; if (iLen < 0) { return 0; } - FX_INT32 iStart = 1; - FX_INT32 iEnd = iStart + 2; + int32_t iStart = 1; + int32_t iEnd = iStart + 2; while (iStart < iLen && iStart < iEnd) { tz.tzHour = tz.tzHour * 10 + pStr[iStart++] - '0'; } @@ -255,12 +255,12 @@ static FX_BOOL FX_IsSpace(FX_WCHAR c) static const FX_FLOAT gs_fraction_scales[] = {0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f, 0.0000001f, 0.00000001f, 0.000000001f, 0.0000000001f, 0.00000000001f }; -static const FX_INT32 gs_fraction_count = sizeof(gs_fraction_scales) / sizeof(FX_FLOAT); +static const int32_t gs_fraction_count = sizeof(gs_fraction_scales) / sizeof(FX_FLOAT); class CFX_LCNumeric { public: CFX_LCNumeric(); - CFX_LCNumeric(FX_INT64 integral, FX_DWORD fractional = 0, FX_INT32 exponent = 0); + CFX_LCNumeric(int64_t integral, FX_DWORD fractional = 0, int32_t exponent = 0); CFX_LCNumeric(FX_FLOAT dbRetValue); CFX_LCNumeric(double dbvalue); CFX_LCNumeric(CFX_WideString& wsNumeric); @@ -268,19 +268,19 @@ public: FX_FLOAT GetFloat() const; double GetDouble() const; CFX_WideString ToString() const; - CFX_WideString ToString(FX_INT32 nTreading, FX_BOOL bTrimTailZeros) const; - FX_INT64 m_Integral; + CFX_WideString ToString(int32_t nTreading, FX_BOOL bTrimTailZeros) const; + int64_t m_Integral; FX_DWORD m_Fractional; #ifdef FX_NUM_DOUBLE CFX_WideString m_wsValue; #endif - FX_INT32 m_Exponent; + int32_t m_Exponent; }; static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue, CFX_LCNumeric& lcnum) { - FX_INT64 *pIntegral = &lcnum.m_Integral; + int64_t *pIntegral = &lcnum.m_Integral; FX_DWORD *pFractional = &lcnum.m_Fractional; - FX_INT32 *pExponent = &lcnum.m_Exponent; + int32_t *pExponent = &lcnum.m_Exponent; *pIntegral = 0; *pFractional = 0; *pExponent = 0; @@ -290,11 +290,11 @@ static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue, CFX_LCNumeric& if (wsValue.IsEmpty()) { return FALSE; } - const FX_INT32 nIntegralMaxLen = 17; - FX_INT32 cc = 0; + const int32_t nIntegralMaxLen = 17; + int32_t cc = 0; FX_BOOL bNegative = FALSE, bExpSign = FALSE; FX_LPCWSTR str = (FX_LPCWSTR)wsValue; - FX_INT32 len = wsValue.GetLength(); + int32_t len = wsValue.GetLength(); while (cc < len && FX_IsSpace(str[cc])) { cc++; } @@ -307,7 +307,7 @@ static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue, CFX_LCNumeric& bNegative = TRUE; cc++; } - FX_INT32 nIntegralLen = 0; + int32_t nIntegralLen = 0; while (cc < len) { if (str[cc] == '.') { break; @@ -384,7 +384,7 @@ CFX_LCNumeric::CFX_LCNumeric() m_Fractional = 0; m_Exponent = 0; } -CFX_LCNumeric::CFX_LCNumeric(FX_INT64 integral, FX_DWORD fractional , FX_INT32 exponent ) +CFX_LCNumeric::CFX_LCNumeric(int64_t integral, FX_DWORD fractional , int32_t exponent ) { m_Integral = integral; m_Fractional = fractional; @@ -392,13 +392,13 @@ CFX_LCNumeric::CFX_LCNumeric(FX_INT64 integral, FX_DWORD fractional , FX_INT32 e } CFX_LCNumeric::CFX_LCNumeric(FX_FLOAT dbRetValue) { - m_Integral = (FX_INT64)dbRetValue; + m_Integral = (int64_t)dbRetValue; m_Fractional = (FX_DWORD)(((dbRetValue > 0) ? (dbRetValue - m_Integral) : (m_Integral - dbRetValue)) * 4294967296); m_Exponent = 0; } CFX_LCNumeric::CFX_LCNumeric(double dbvalue) { - m_Integral = (FX_INT64)dbvalue; + m_Integral = (int64_t)dbvalue; m_Fractional = (FX_DWORD)(((dbvalue > 0) ? (dbvalue - m_Integral) : (m_Integral - dbvalue)) * 4294967296); m_Exponent = 0; } @@ -428,16 +428,16 @@ CFX_WideString CFX_LCNumeric::ToString() const { return ToString(8, TRUE); } -CFX_WideString CFX_LCNumeric::ToString(FX_INT32 nTreading, FX_BOOL bTrimTailZeros) const +CFX_WideString CFX_LCNumeric::ToString(int32_t nTreading, FX_BOOL bTrimTailZeros) const { #ifdef FX_NUM_DOUBLE CFX_WideString wsResult; if (!m_wsValue.IsEmpty()) { - const FX_INT32 nIntegralMaxLen = 17; - FX_INT32 cc = 0; + const int32_t nIntegralMaxLen = 17; + int32_t cc = 0; FX_BOOL bNegative = FALSE, bExpSign = FALSE; FX_LPCWSTR str = (FX_LPCWSTR)m_wsValue; - FX_INT32 len = m_wsValue.GetLength(); + int32_t len = m_wsValue.GetLength(); while (cc < len && FX_IsSpace(str[cc])) { cc++; } @@ -450,7 +450,7 @@ CFX_WideString CFX_LCNumeric::ToString(FX_INT32 nTreading, FX_BOOL bTrimTailZero bNegative = TRUE; cc++; } - FX_INT32 nIntegralLen = 0; + int32_t nIntegralLen = 0; while (cc < len) { if (str[cc] == '.') { break; @@ -497,8 +497,8 @@ CFX_WideString CFX_LCNumeric::ToString(FX_INT32 nTreading, FX_BOOL bTrimTailZero } } double dbValeu = GetDouble(); - FX_INT64 iInte = (FX_INT64)dbValeu; - wsResult.Format(L"%l", (FX_INT64)iInte); + int64_t iInte = (int64_t)dbValeu; + wsResult.Format(L"%l", (int64_t)iInte); if (m_Fractional) { CFX_WideString wsFormat; wsFormat.Format(L"%%.%dG", nTreading); @@ -539,7 +539,7 @@ CFX_FormatString::~CFX_FormatString() } void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString, CFX_WideStringArray& wsPatterns) { - FX_INT32 iStrLen = wsFormatString.GetLength(); + int32_t iStrLen = wsFormatString.GetLength(); FX_LPCWSTR pStr = (FX_LPCWSTR)wsFormatString; FX_LPCWSTR pToken = pStr; FX_LPCWSTR pEnd = pStr + iStrLen; @@ -559,14 +559,14 @@ void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString, C pStr ++; } } -static CFX_WideString FX_GetLiteralText(FX_LPCWSTR pStrPattern, FX_INT32 &iPattern, FX_INT32 iLenPattern) +static CFX_WideString FX_GetLiteralText(FX_LPCWSTR pStrPattern, int32_t &iPattern, int32_t iLenPattern) { CFX_WideString wsOutput; if (pStrPattern[iPattern] != '\'') { return wsOutput; } iPattern++; - FX_INT32 iQuote = 1; + int32_t iQuote = 1; while (iPattern < iLenPattern) { if (pStrPattern[iPattern] == '\'') { iQuote++; @@ -577,9 +577,9 @@ static CFX_WideString FX_GetLiteralText(FX_LPCWSTR pStrPattern, FX_INT32 &iPatte } iPattern++; } else if (pStrPattern[iPattern] == '\\' && (iPattern + 1 < iLenPattern) && pStrPattern[iPattern + 1] == 'u') { - FX_INT32 iKeyValue = 0; + int32_t iKeyValue = 0; iPattern += 2; - FX_INT32 i = 0; + int32_t i = 0; while (iPattern < iLenPattern && i++ < 4) { FX_WCHAR ch = pStrPattern[iPattern++]; if ((ch >= '0' && ch <= '9')) { @@ -599,14 +599,14 @@ static CFX_WideString FX_GetLiteralText(FX_LPCWSTR pStrPattern, FX_INT32 &iPatte } return wsOutput; } -static CFX_WideString FX_GetLiteralTextReverse(FX_LPCWSTR pStrPattern, FX_INT32 &iPattern) +static CFX_WideString FX_GetLiteralTextReverse(FX_LPCWSTR pStrPattern, int32_t &iPattern) { CFX_WideString wsOutput; if (pStrPattern[iPattern] != '\'') { return wsOutput; } iPattern--; - FX_INT32 iQuote = 1; + int32_t iQuote = 1; while (iPattern >= 0) { if (pStrPattern[iPattern] == '\'') { iQuote++; @@ -618,9 +618,9 @@ static CFX_WideString FX_GetLiteralTextReverse(FX_LPCWSTR pStrPattern, FX_INT32 iPattern--; } else if (pStrPattern[iPattern] == '\\' && pStrPattern[iPattern + 1] == 'u') { iPattern--; - FX_INT32 iKeyValue = 0; - FX_INT32 iLen = wsOutput.GetLength(); - FX_INT32 i = 1; + int32_t iKeyValue = 0; + int32_t iLen = wsOutput.GetLength(); + int32_t i = 1; for (; i < iLen && i < 5; i++) { FX_WCHAR ch = wsOutput[i]; if ((ch >= '0' && ch <= '9')) { @@ -644,8 +644,8 @@ static CFX_WideString FX_GetLiteralTextReverse(FX_LPCWSTR pStrPattern, FX_INT32 FX_LOCALECATEGORY CFX_FormatString::GetCategory(const CFX_WideString& wsPattern) { FX_LOCALECATEGORY eCategory = FX_LOCALECATEGORY_Unknown; - FX_INT32 ccf = 0; - FX_INT32 iLenf = wsPattern.GetLength(); + int32_t ccf = 0; + int32_t iLenf = wsPattern.GetLength(); FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern; FX_BOOL bBraceOpen = FALSE; while (ccf < iLenf) { @@ -711,8 +711,8 @@ FX_WORD CFX_FormatString::GetLCID(const CFX_WideString& wsPattern) } CFX_WideString CFX_FormatString::GetLocaleName(const CFX_WideString& wsPattern) { - FX_INT32 ccf = 0; - FX_INT32 iLenf = wsPattern.GetLength(); + int32_t ccf = 0; + int32_t iLenf = wsPattern.GetLength(); FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern; while (ccf < iLenf) { if (pStr[ccf] == '\'') { @@ -732,13 +732,13 @@ CFX_WideString CFX_FormatString::GetLocaleName(const CFX_WideString& wsPattern) IFX_Locale* CFX_FormatString::GetTextFormat(const CFX_WideString &wsPattern, FX_WSTR wsCategory, CFX_WideString& wsPurgePattern) { IFX_Locale* pLocale = NULL; - FX_INT32 ccf = 0; - FX_INT32 iLenf = wsPattern.GetLength(); + int32_t ccf = 0; + int32_t iLenf = wsPattern.GetLength(); FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern; FX_BOOL bBrackOpen = FALSE; while (ccf < iLenf) { if (pStr[ccf] == '\'') { - FX_INT32 iCurChar = ccf; + int32_t iCurChar = ccf; FX_GetLiteralText(pStr, ccf, iLenf); wsPurgePattern += CFX_WideStringC(pStr + iCurChar, ccf - iCurChar + 1); } else if (!bBrackOpen && FX_Local_Find(gs_wsConstChars, pStr[ccf]) < 0) { @@ -781,18 +781,18 @@ IFX_Locale* CFX_FormatString::GetTextFormat(const CFX_WideString &wsPattern, FX_ #define FX_NUMSTYLE_Percent 0x01 #define FX_NUMSTYLE_Exponent 0x02 #define FX_NUMSTYLE_DotVorv 0x04 -IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, FX_INT32& iDotIndex, FX_DWORD& dwStyle, CFX_WideString& wsPurgePattern) +IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, int32_t& iDotIndex, FX_DWORD& dwStyle, CFX_WideString& wsPurgePattern) { dwStyle = 0; IFX_Locale* pLocale = NULL; - FX_INT32 ccf = 0; - FX_INT32 iLenf = wsPattern.GetLength(); + int32_t ccf = 0; + int32_t iLenf = wsPattern.GetLength(); FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern; FX_BOOL bFindDot = FALSE; FX_BOOL bBrackOpen = FALSE; while (ccf < iLenf) { if (pStr[ccf] == '\'') { - FX_INT32 iCurChar = ccf; + int32_t iCurChar = ccf; FX_GetLiteralText(pStr, ccf, iLenf); wsPurgePattern += CFX_WideStringC(pStr + iCurChar, ccf - iCurChar + 1); } else if (!bBrackOpen && FX_Local_Find(gs_wsConstChars, pStr[ccf]) < 0) { @@ -826,7 +826,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, } FX_DWORD dwSubHash = FX_HashCode_String_GetW(wsSubCategory, wsSubCategory.GetLength()); FX_LOCALENUMSUBCATEGORY eSubCategory = FX_LOCALENUMPATTERN_Decimal; - for (FX_INT32 i = 0; i < g_iFXLocaleNumSubCatCount; i++) { + for (int32_t i = 0; i < g_iFXLocaleNumSubCatCount; i++) { if (g_FXLocaleNumSubCatData[i].uHash == dwSubHash) { eSubCategory = (FX_LOCALENUMSUBCATEGORY)g_FXLocaleNumSubCatData[i].eSubCategory; break; @@ -878,12 +878,12 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, } return pLocale; } -static FX_BOOL FX_GetNumericDotIndex(const CFX_WideString& wsNum, const CFX_WideString& wsDotSymbol, FX_INT32 &iDotIndex) +static FX_BOOL FX_GetNumericDotIndex(const CFX_WideString& wsNum, const CFX_WideString& wsDotSymbol, int32_t &iDotIndex) { - FX_INT32 ccf = 0; - FX_INT32 iLenf = wsNum.GetLength(); + int32_t ccf = 0; + int32_t iLenf = wsNum.GetLength(); FX_LPCWSTR pStr = (FX_LPCWSTR)wsNum; - FX_INT32 iLenDot = wsDotSymbol.GetLength(); + int32_t iLenDot = wsDotSymbol.GetLength(); while (ccf < iLenf) { if (pStr[ccf] == '\'') { FX_GetLiteralText(pStr, ccf, iLenf); @@ -911,16 +911,16 @@ FX_BOOL CFX_FormatString::ParseText(const CFX_WideString& wsSrcText, const CFX_W if (wsTextFormat.IsEmpty()) { return FALSE; } - FX_INT32 iText = 0, iPattern = 0; + int32_t iText = 0, iPattern = 0; FX_LPCWSTR pStrText = (FX_LPCWSTR)wsSrcText; - FX_INT32 iLenText = wsSrcText.GetLength(); + int32_t iLenText = wsSrcText.GetLength(); FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat; - FX_INT32 iLenPattern = wsTextFormat.GetLength(); + int32_t iLenPattern = wsTextFormat.GetLength(); while (iPattern < iLenPattern && iText < iLenText) { switch (pStrPattern[iPattern]) { case '\'': { CFX_WideString wsLiteral = FX_GetLiteralText(pStrPattern, iPattern, iLenPattern); - FX_INT32 iLiteralLen = wsLiteral.GetLength(); + int32_t iLiteralLen = wsLiteral.GetLength(); if (iText + iLiteralLen > iLenText || FXSYS_wcsncmp(pStrText + iText, (FX_LPCWSTR)wsLiteral, iLiteralLen)) { wsValue = wsSrcText; return FALSE; @@ -974,23 +974,23 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid if (wsSrcNum.IsEmpty() || wsPattern.IsEmpty()) { return FALSE; } - FX_INT32 dot_index_f = -1; + int32_t dot_index_f = -1; FX_DWORD dwFormatStyle = 0; CFX_WideString wsNumFormat; IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwFormatStyle, wsNumFormat); if (!pLocale || wsNumFormat.IsEmpty()) { return FALSE; } - FX_INT32 iExponent = 0; + int32_t iExponent = 0; CFX_WideString wsDotSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Decimal, wsDotSymbol); - FX_INT32 iDotLen = wsDotSymbol.GetLength(); + int32_t iDotLen = wsDotSymbol.GetLength(); CFX_WideString wsGroupSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Grouping, wsGroupSymbol); - FX_INT32 iGroupLen = wsGroupSymbol.GetLength(); + int32_t iGroupLen = wsGroupSymbol.GetLength(); CFX_WideString wsMinus; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinus); - FX_INT32 iMinusLen = wsMinus.GetLength(); + int32_t iMinusLen = wsMinus.GetLength(); int cc = 0, ccf = 0; FX_LPCWSTR str = (FX_LPCWSTR)wsSrcNum; int len = wsSrcNum.GetLength(); @@ -1001,7 +1001,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid FX_BOOL bHavePercentSymbol = FALSE; FX_BOOL bNeg = FALSE; FX_BOOL bReverseParse = FALSE; - FX_INT32 dot_index = 0; + int32_t dot_index = 0; if (!FX_GetNumericDotIndex(wsSrcNum, wsDotSymbol, dot_index) && (dwFormatStyle & FX_NUMSTYLE_DotVorv)) { bReverseParse = TRUE; } @@ -1013,7 +1013,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) { case '\'': { CFX_WideString wsLiteral = FX_GetLiteralTextReverse(strf, ccf); - FX_INT32 iLiteralLen = wsLiteral.GetLength(); + int32_t iLiteralLen = wsLiteral.GetLength(); cc -= iLiteralLen - 1; if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) { return FALSE; @@ -1104,7 +1104,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': { CFX_WideString wsSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol); - FX_INT32 iSymbolLen = wsSymbol.GetLength(); + int32_t iSymbolLen = wsSymbol.GetLength(); cc -= iSymbolLen - 1; if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) { return FALSE; @@ -1168,7 +1168,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': { CFX_WideString wsSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol); - FX_INT32 iSysmbolLen = wsSymbol.GetLength(); + int32_t iSysmbolLen = wsSymbol.GetLength(); cc -= iSysmbolLen - 1; if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) { return FALSE; @@ -1235,7 +1235,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) { case '\'': { CFX_WideString wsLiteral = FX_GetLiteralTextReverse(strf, ccf); - FX_INT32 iLiteralLen = wsLiteral.GetLength(); + int32_t iLiteralLen = wsLiteral.GetLength(); cc -= iLiteralLen - 1; if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) { return FALSE; @@ -1330,7 +1330,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': { CFX_WideString wsSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol); - FX_INT32 iSymbolLen = wsSymbol.GetLength(); + int32_t iSymbolLen = wsSymbol.GetLength(); cc -= iSymbolLen - 1; if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) { return FALSE; @@ -1394,7 +1394,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': { CFX_WideString wsSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol); - FX_INT32 iSysmbolLen = wsSymbol.GetLength(); + int32_t iSysmbolLen = wsSymbol.GetLength(); cc -= iSysmbolLen - 1; if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) { return FALSE; @@ -1455,7 +1455,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) { case '\'': { CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf); - FX_INT32 iLiteralLen = wsLiteral.GetLength(); + int32_t iLiteralLen = wsLiteral.GetLength(); if (cc + iLiteralLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) { return FALSE; } @@ -1546,7 +1546,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': { CFX_WideString wsSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol); - FX_INT32 iSymbolLen = wsSymbol.GetLength(); + int32_t iSymbolLen = wsSymbol.GetLength(); if (cc + iSymbolLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) { return FALSE; } @@ -1601,7 +1601,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': { CFX_WideString wsSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol); - FX_INT32 iSysmbolLen = wsSymbol.GetLength(); + int32_t iSysmbolLen = wsSymbol.GetLength(); if (cc + iSysmbolLen <= len && !FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) { cc += iSysmbolLen; } @@ -1671,12 +1671,12 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid } void FX_ParseNumString(const CFX_WideString& wsNum, CFX_WideString& wsResult) { - FX_INT32 iCount = wsNum.GetLength(); + int32_t iCount = wsNum.GetLength(); FX_LPCWSTR pStr = (FX_LPCWSTR)wsNum; FX_LPWSTR pDst = wsResult.GetBuffer(iCount); - FX_INT32 nIndex = 0; + int32_t nIndex = 0; FX_BOOL bMinus = FALSE; - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < iCount; i++) { FX_WCHAR wc = pStr[i]; if (wc == '.') { @@ -1703,7 +1703,7 @@ void FX_ParseNumString(const CFX_WideString& wsNum, CFX_WideString& wsResult) pDst = wsResult.GetBuffer(iCount + 1); pDst[nIndex++] = '0'; } - FX_INT32 j = 0; + int32_t j = 0; for (j = iCount - 1; j > i; j--) { FX_WCHAR wc = pStr[j]; if (wc != L'0' && wc != L' ') { @@ -1723,23 +1723,23 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid if (wsSrcNum.IsEmpty() || wsPattern.IsEmpty()) { return FALSE; } - FX_INT32 dot_index_f = -1; + int32_t dot_index_f = -1; FX_DWORD dwFormatStyle = 0; CFX_WideString wsNumFormat; IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwFormatStyle, wsNumFormat); if (!pLocale || wsNumFormat.IsEmpty()) { return FALSE; } - FX_INT32 iExponent = 0; + int32_t iExponent = 0; CFX_WideString wsDotSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Decimal, wsDotSymbol); - FX_INT32 iDotLen = wsDotSymbol.GetLength(); + int32_t iDotLen = wsDotSymbol.GetLength(); CFX_WideString wsGroupSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Grouping, wsGroupSymbol); - FX_INT32 iGroupLen = wsGroupSymbol.GetLength(); + int32_t iGroupLen = wsGroupSymbol.GetLength(); CFX_WideString wsMinus; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinus); - FX_INT32 iMinusLen = wsMinus.GetLength(); + int32_t iMinusLen = wsMinus.GetLength(); int cc = 0, ccf = 0; FX_LPCWSTR str = (FX_LPCWSTR)wsSrcNum; int len = wsSrcNum.GetLength(); @@ -1748,7 +1748,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid FX_BOOL bHavePercentSymbol = FALSE; FX_BOOL bNeg = FALSE; FX_BOOL bReverseParse = FALSE; - FX_INT32 dot_index = 0; + int32_t dot_index = 0; if (!FX_GetNumericDotIndex(wsSrcNum, wsDotSymbol, dot_index) && (dwFormatStyle & FX_NUMSTYLE_DotVorv)) { bReverseParse = TRUE; } @@ -1759,7 +1759,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) { case '\'': { CFX_WideString wsLiteral = FX_GetLiteralTextReverse(strf, ccf); - FX_INT32 iLiteralLen = wsLiteral.GetLength(); + int32_t iLiteralLen = wsLiteral.GetLength(); cc -= iLiteralLen - 1; if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) { return FALSE; @@ -1851,7 +1851,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': { CFX_WideString wsSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol); - FX_INT32 iSymbolLen = wsSymbol.GetLength(); + int32_t iSymbolLen = wsSymbol.GetLength(); cc -= iSymbolLen - 1; if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) { return FALSE; @@ -1915,7 +1915,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': { CFX_WideString wsSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol); - FX_INT32 iSysmbolLen = wsSymbol.GetLength(); + int32_t iSysmbolLen = wsSymbol.GetLength(); cc -= iSysmbolLen - 1; if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) { return FALSE; @@ -1984,7 +1984,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) { case '\'': { CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf); - FX_INT32 iLiteralLen = wsLiteral.GetLength(); + int32_t iLiteralLen = wsLiteral.GetLength(); if (cc + iLiteralLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) { return FALSE; } @@ -2072,7 +2072,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': { CFX_WideString wsSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol); - FX_INT32 iSymbolLen = wsSymbol.GetLength(); + int32_t iSymbolLen = wsSymbol.GetLength(); if (cc + iSymbolLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) { return FALSE; } @@ -2127,7 +2127,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': { CFX_WideString wsSymbol; pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol); - FX_INT32 iSysmbolLen = wsSymbol.GetLength(); + int32_t iSysmbolLen = wsSymbol.GetLength(); if (cc + iSysmbolLen <= len && !FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) { cc += iSysmbolLen; } @@ -2202,14 +2202,14 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(const CFX_WideString& wsPatt pLocale = NULL; CFX_WideString wsTempPattern; FX_LOCALECATEGORY eCategory = FX_LOCALECATEGORY_Unknown; - FX_INT32 ccf = 0; - FX_INT32 iLenf = wsPattern.GetLength(); + int32_t ccf = 0; + int32_t iLenf = wsPattern.GetLength(); FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern; - FX_INT32 iFindCategory = 0; + int32_t iFindCategory = 0; FX_BOOL bBraceOpen = FALSE; while (ccf < iLenf) { if (pStr[ccf] == '\'') { - FX_INT32 iCurChar = ccf; + int32_t iCurChar = ccf; FX_GetLiteralText(pStr, ccf, iLenf); wsTempPattern += CFX_WideStringC(pStr + iCurChar, ccf - iCurChar + 1); } else if (!bBraceOpen && iFindCategory != 3 && FX_Local_Find(gs_wsConstChars, pStr[ccf]) < 0) { @@ -2262,7 +2262,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(const CFX_WideString& wsPatt } FX_DWORD dwSubHash = FX_HashCode_String_GetW(wsSubCategory, wsSubCategory.GetLength()); FX_LOCALEDATETIMESUBCATEGORY eSubCategory = FX_LOCALEDATETIMESUBCATEGORY_Medium; - for (FX_INT32 i = 0; i < g_iFXLocaleDateTimeSubCatCount; i++) { + for (int32_t i = 0; i < g_iFXLocaleDateTimeSubCatCount; i++) { if (g_FXLocaleDateTimeSubCatData[i].uHash == dwSubHash) { eSubCategory = (FX_LOCALEDATETIMESUBCATEGORY)g_FXLocaleDateTimeSubCatData[i].eSubCategory; break; @@ -2325,20 +2325,20 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(const CFX_WideString& wsPatt } return (FX_DATETIMETYPE)iFindCategory; } -static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, const CFX_WideString& wsDatePattern, IFX_Locale* pLocale, CFX_Unitime &datetime, FX_INT32 &cc) +static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, const CFX_WideString& wsDatePattern, IFX_Locale* pLocale, CFX_Unitime &datetime, int32_t &cc) { - FX_INT32 year = 1900; - FX_INT32 month = 1; - FX_INT32 day = 1; - FX_INT32 ccf = 0; + int32_t year = 1900; + int32_t month = 1; + int32_t day = 1; + int32_t ccf = 0; FX_LPCWSTR str = (FX_LPCWSTR)wsDate; - FX_INT32 len = wsDate.GetLength(); + int32_t len = wsDate.GetLength(); FX_LPCWSTR strf = (FX_LPCWSTR)wsDatePattern; - FX_INT32 lenf = wsDatePattern.GetLength(); + int32_t lenf = wsDatePattern.GetLength(); while (cc < len && ccf < lenf) { if (strf[ccf] == '\'') { CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf); - FX_INT32 iLiteralLen = wsLiteral.GetLength(); + int32_t iLiteralLen = wsLiteral.GetLength(); if (cc + iLiteralLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) { return FALSE; } @@ -2451,7 +2451,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, const CFX_WideSt } } else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '4')) { CFX_WideString wsDayName; - FX_INT32 i = 0; + int32_t i = 0; for (; i < 7; i++) { pLocale->GetDayName(i, wsDayName, FALSE); if (wsDayName == L"") { @@ -2513,9 +2513,9 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, const CFX_WideSt datetime = datetime + ut; return cc; } -static void FX_ResolveZone(FX_BYTE& wHour, FX_BYTE& wMinute, FX_TIMEZONE tzDiff, IFX_Locale* pLocale) +static void FX_ResolveZone(uint8_t& wHour, uint8_t& wMinute, FX_TIMEZONE tzDiff, IFX_Locale* pLocale) { - FX_INT32 iMinuteDiff = wHour * 60 + wMinute; + int32_t iMinuteDiff = wHour * 60 + wMinute; FX_TIMEZONE tzLocale; pLocale->GetTimeZone(tzLocale); iMinuteDiff += tzLocale.tzHour * 60 + (tzLocale.tzHour < 0 ? -tzLocale.tzMinute : tzLocale.tzMinute); @@ -2529,13 +2529,13 @@ static void FX_ResolveZone(FX_BYTE& wHour, FX_BYTE& wMinute, FX_TIMEZONE tzDiff, 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, FX_INT32 &cc) +static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, const CFX_WideString& wsTimePattern, IFX_Locale* pLocale, CFX_Unitime &datetime, int32_t &cc) { - FX_BYTE hour = 0; - FX_BYTE minute = 0; - FX_BYTE second = 0; + uint8_t hour = 0; + uint8_t minute = 0; + uint8_t second = 0; FX_WORD millisecond = 0; - FX_INT32 ccf = 0; + int32_t ccf = 0; FX_LPCWSTR str = (FX_LPCWSTR)wsTime; int len = wsTime.GetLength(); FX_LPCWSTR strf = (FX_LPCWSTR)wsTimePattern; @@ -2545,7 +2545,7 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, const CFX_WideSt while (cc < len && ccf < lenf) { if (strf[ccf] == '\'') { CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf); - FX_INT32 iLiteralLen = wsLiteral.GetLength(); + int32_t iLiteralLen = wsLiteral.GetLength(); if (cc + iLiteralLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) { return FALSE; } @@ -2675,9 +2675,9 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, const CFX_WideSt FX_ResolveZone(hour, minute, tzDiff, pLocale); } else { FX_LPCLOCALETIMEZONEINFO pTimeZoneInfo = NULL; - FX_INT32 iStart = 0, iEnd = g_iFXLocaleTimeZoneCount - 1; + int32_t iStart = 0, iEnd = g_iFXLocaleTimeZoneCount - 1; do { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; FX_LPCLOCALETIMEZONEINFO pInfo = g_FXLocaleTimeZoneData + iMid; if (dwHash == pInfo->uHash) { pTimeZoneInfo = pInfo; @@ -2739,7 +2739,7 @@ FX_BOOL CFX_FormatString::ParseDateTime(const CFX_WideString& wsSrcDateTime, con return FALSE; } if (eCategory == FX_DATETIMETYPE_TimeDate) { - FX_INT32 iStart = 0; + int32_t iStart = 0; if (!FX_ParseLocaleTime(wsSrcDateTime, wsTimePattern, pLocale, dtValue, iStart)) { return FALSE; } @@ -2747,7 +2747,7 @@ FX_BOOL CFX_FormatString::ParseDateTime(const CFX_WideString& wsSrcDateTime, con return FALSE; } } else { - FX_INT32 iStart = 0; + int32_t iStart = 0; if ((eCategory & FX_DATETIMETYPE_Date) && !FX_ParseLocaleDate(wsSrcDateTime, wsDatePattern, pLocale, dtValue, iStart)) { return FALSE; } @@ -2761,15 +2761,15 @@ FX_BOOL CFX_FormatString::ParseZero(const CFX_WideString& wsSrcText, const CFX_W { CFX_WideString wsTextFormat; IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"zero"), wsTextFormat); - FX_INT32 iText = 0, iPattern = 0; + int32_t iText = 0, iPattern = 0; FX_LPCWSTR pStrText = (FX_LPCWSTR)wsSrcText; - FX_INT32 iLenText = wsSrcText.GetLength(); + int32_t iLenText = wsSrcText.GetLength(); FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat; - FX_INT32 iLenPattern = wsTextFormat.GetLength(); + int32_t iLenPattern = wsTextFormat.GetLength(); while (iPattern < iLenPattern && iText < iLenText) { if (pStrPattern[iPattern] == '\'') { CFX_WideString wsLiteral = FX_GetLiteralText(pStrPattern, iPattern, iLenPattern); - FX_INT32 iLiteralLen = wsLiteral.GetLength(); + int32_t iLiteralLen = wsLiteral.GetLength(); if (iText + iLiteralLen > iLenText || FXSYS_wcsncmp(pStrText + iText, (FX_LPCWSTR)wsLiteral, iLiteralLen)) { return FALSE; } @@ -2789,15 +2789,15 @@ FX_BOOL CFX_FormatString::ParseNull(const CFX_WideString& wsSrcText, const CFX_W { CFX_WideString wsTextFormat; IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"null"), wsTextFormat); - FX_INT32 iText = 0, iPattern = 0; + int32_t iText = 0, iPattern = 0; FX_LPCWSTR pStrText = (FX_LPCWSTR)wsSrcText; - FX_INT32 iLenText = wsSrcText.GetLength(); + int32_t iLenText = wsSrcText.GetLength(); FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat; - FX_INT32 iLenPattern = wsTextFormat.GetLength(); + int32_t iLenPattern = wsTextFormat.GetLength(); while (iPattern < iLenPattern && iText < iLenText) { if (pStrPattern[iPattern] == '\'') { CFX_WideString wsLiteral = FX_GetLiteralText(pStrPattern, iPattern, iLenPattern); - FX_INT32 iLiteralLen = wsLiteral.GetLength(); + int32_t iLiteralLen = wsLiteral.GetLength(); if (iText + iLiteralLen > iLenText || FXSYS_wcsncmp(pStrText + iText, (FX_LPCWSTR)wsLiteral, iLiteralLen)) { return FALSE; } @@ -2818,16 +2818,16 @@ FX_BOOL CFX_FormatString::FormatText(const CFX_WideString& wsSrcText, const CFX_ if (wsPattern.IsEmpty()) { return FALSE; } - FX_INT32 iLenText = wsSrcText.GetLength(); + int32_t iLenText = wsSrcText.GetLength(); if (iLenText == 0) { return FALSE; } CFX_WideString wsTextFormat; IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"text"), wsTextFormat); - FX_INT32 iText = 0, iPattern = 0; + int32_t iText = 0, iPattern = 0; FX_LPCWSTR pStrText = (FX_LPCWSTR)wsSrcText; FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat; - FX_INT32 iLenPattern = wsTextFormat.GetLength(); + int32_t iLenPattern = wsTextFormat.GetLength(); while (iPattern < iLenPattern) { switch (pStrPattern[iPattern]) { case '\'': { @@ -2871,13 +2871,13 @@ FX_BOOL CFX_FormatString::FormatText(const CFX_WideString& wsSrcText, const CFX_ } return iText == iLenText; } -static FX_INT32 FX_GetNumTrailingLimit(const CFX_WideString& wsFormat, int iDotPos, FX_BOOL &bTrimTailZeros) +static int32_t FX_GetNumTrailingLimit(const CFX_WideString& wsFormat, int iDotPos, FX_BOOL &bTrimTailZeros) { if (iDotPos < 0) { return 0; } - FX_INT32 iCount = wsFormat.GetLength(); - FX_INT32 iTreading = 0; + int32_t iCount = wsFormat.GetLength(); + int32_t iTreading = 0; for (iDotPos ++; iDotPos < iCount; iDotPos ++) { FX_WCHAR wc = wsFormat[iDotPos]; if (wc == L'z' || wc == L'9' || wc == 'Z') { @@ -2892,14 +2892,14 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& if (wsInputNum.IsEmpty() || wsPattern.IsEmpty()) { return FALSE; } - FX_INT32 dot_index_f = -1; + int32_t dot_index_f = -1; FX_DWORD dwNumStyle = 0; CFX_WideString wsNumFormat; IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwNumStyle, wsNumFormat); if (!pLocale || wsNumFormat.IsEmpty()) { return FALSE; } - FX_INT32 cc = 0, ccf = 0; + int32_t cc = 0, ccf = 0; FX_LPCWSTR strf = (FX_LPCWSTR)wsNumFormat; int lenf = wsNumFormat.GetLength(); CFX_WideString wsSrcNum = wsInputNum; @@ -2912,7 +2912,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& decimal = decimal * CFX_Decimal(100); wsSrcNum = decimal; } - FX_INT32 exponent = 0; + int32_t exponent = 0; if (dwNumStyle & FX_NUMSTYLE_Exponent) { int fixed_count = 0; while (ccf < dot_index_f) { @@ -2951,8 +2951,8 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& } } FX_BOOL bTrimTailZeros = FALSE; - FX_INT32 iTreading = FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros); - FX_INT32 scale = decimal.GetScale(); + int32_t iTreading = FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros); + int32_t scale = decimal.GetScale(); if (iTreading < scale) { decimal.SetScale(iTreading); wsSrcNum = decimal; @@ -3135,7 +3135,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& if (cc >= 0) { int nPos = dot_index % 3; wsOutput.Empty(); - for (FX_INT32 i = 0; i < dot_index; i++) { + for (int32_t i = 0; i < dot_index; i++) { if (i % 3 == nPos && i != 0) { wsOutput += wsGroupSymbol; } @@ -3322,14 +3322,14 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& } FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideString& wsPattern, CFX_WideString& wsOutput) { - FX_INT32 dot_index_f = -1; + int32_t dot_index_f = -1; FX_DWORD dwNumStyle = 0; CFX_WideString wsNumFormat; IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwNumStyle, wsNumFormat); if (!pLocale || wsNumFormat.IsEmpty()) { return FALSE; } - FX_INT32 cc = 0, ccf = 0; + int32_t cc = 0, ccf = 0; FX_LPCWSTR strf = (FX_LPCWSTR)wsNumFormat; int lenf = wsNumFormat.GetLength(); double dbOrgRaw = lcNum.GetDouble(); @@ -3337,7 +3337,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideSt if (dwNumStyle & FX_NUMSTYLE_Percent) { dbRetValue *= 100; } - FX_INT32 exponent = 0; + int32_t exponent = 0; if (dwNumStyle & FX_NUMSTYLE_Exponent) { int fixed_count = 0; while (ccf < dot_index_f) { @@ -3379,7 +3379,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideSt lcNum = CFX_LCNumeric(dbRetValue); } FX_BOOL bTrimTailZeros = FALSE; - FX_INT32 iTreading = FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros); + int32_t iTreading = FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros); CFX_WideString wsNumeric = lcNum.ToString(iTreading, bTrimTailZeros); if (wsNumeric.IsEmpty()) { return FALSE; @@ -3549,7 +3549,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideSt if (cc >= 0) { int nPos = dot_index % 3; wsOutput.Empty(); - for (FX_INT32 i = 0; i < dot_index; i++) { + for (int32_t i = 0; i < dot_index; i++) { if (i % 3 == nPos && i != 0) { wsOutput += wsGroupSymbol; } @@ -3742,9 +3742,9 @@ FX_BOOL CFX_FormatString::FormatNum(FX_FLOAT fNum, const CFX_WideString& wsPatte } FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime) { - FX_INT32 year = 1900; - FX_INT32 month = 1; - FX_INT32 day = 1; + int32_t year = 1900; + int32_t month = 1; + int32_t day = 1; FX_WORD wYear = 0; int cc_start = 0, cc = 0; FX_LPCWSTR str = (FX_LPCWSTR)wsDate; @@ -3767,7 +3767,7 @@ FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime cc++; } cc_start = cc; - FX_BYTE tmpM = 0; + uint8_t tmpM = 0; while (cc < len && cc < cc_start + 2) { if (!FX_IsDigit(str[cc])) { return FALSE; @@ -3782,7 +3782,7 @@ FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime if (str[cc] == '-') { cc++; } - FX_BYTE tmpD = 0; + uint8_t tmpD = 0; cc_start = cc; while (cc < len && cc < cc_start + 2) { if (!FX_IsDigit(str[cc])) { @@ -3821,9 +3821,9 @@ FX_BOOL FX_TimeFromCanonical(FX_WSTR wsTime, CFX_Unitime& datetime, IFX_Locale* if (wsTime.GetLength() == 0) { return FALSE; } - FX_BYTE hour = 0; - FX_BYTE minute = 0; - FX_BYTE second = 0; + uint8_t hour = 0; + uint8_t minute = 0; + uint8_t second = 0; FX_WORD millisecond = 0; int cc_start = 0, cc = cc_start; FX_LPCWSTR str = (FX_LPCWSTR)wsTime.GetPtr(); @@ -3945,12 +3945,12 @@ static FX_WORD FX_GetWeekOfYear(FX_WORD year, FX_WORD month, FX_WORD day) static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern, IFX_Locale *pLocale, const CFX_Unitime &datetime, CFX_WideString& wsResult) { FX_BOOL bRet = TRUE; - FX_INT32 year = datetime.GetYear(); - FX_BYTE month = datetime.GetMonth(); - FX_BYTE day = datetime.GetDay(); - FX_INT32 ccf = 0; + int32_t year = datetime.GetYear(); + uint8_t month = datetime.GetMonth(); + uint8_t day = datetime.GetDay(); + int32_t ccf = 0; FX_LPCWSTR strf = (FX_LPCWSTR)wsDatePattern; - FX_INT32 lenf = wsDatePattern.GetLength(); + int32_t lenf = wsDatePattern.GetLength(); while (ccf < lenf) { if (strf[ccf] == '\'') { wsResult += FX_GetLiteralText(strf, ccf, lenf); @@ -4061,13 +4061,13 @@ static FX_BOOL FX_TimeFormat(const CFX_WideString& wsTimePattern, IFX_Locale *pL { FX_BOOL bGMT = FALSE; FX_BOOL bRet = TRUE; - FX_BYTE hour = datetime.GetHour(); - FX_BYTE minute = datetime.GetMinute(); - FX_BYTE second = datetime.GetSecond(); + uint8_t hour = datetime.GetHour(); + uint8_t minute = datetime.GetMinute(); + uint8_t second = datetime.GetSecond(); FX_WORD millisecond = datetime.GetMillisecond(); - FX_INT32 ccf = 0; + int32_t ccf = 0; FX_LPCWSTR strf = (FX_LPCWSTR)wsTimePattern; - FX_INT32 lenf = wsTimePattern.GetLength(); + int32_t lenf = wsTimePattern.GetLength(); FX_WORD wHour = hour; FX_BOOL bPM = FALSE; if (wsTimePattern.Find('A') != -1) { @@ -4216,7 +4216,7 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime, co return FALSE; } CFX_Unitime dt(0); - FX_INT32 iT = wsSrcDateTime.Find(L"T"); + int32_t iT = wsSrcDateTime.Find(L"T"); if (iT < 0) { if (eCategory == FX_DATETIMETYPE_Date) { FX_DateFromCanonical(wsSrcDateTime, dt); @@ -4251,7 +4251,7 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime, co return FALSE; } CFX_Unitime dt(0); - FX_INT32 iT = wsSrcDateTime.Find(L"T"); + 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, wsOutput); @@ -4290,9 +4290,9 @@ FX_BOOL CFX_FormatString::FormatZero(const CFX_WideString& wsPattern, CFX_WideSt } CFX_WideString wsTextFormat; IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"zero"), wsTextFormat); - FX_INT32 iPattern = 0; + int32_t iPattern = 0; FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat; - FX_INT32 iLenPattern = wsTextFormat.GetLength(); + int32_t iLenPattern = wsTextFormat.GetLength(); while (iPattern < iLenPattern) { if (pStrPattern[iPattern] == '\'') { wsOutput += FX_GetLiteralText(pStrPattern, iPattern, iLenPattern); @@ -4312,9 +4312,9 @@ FX_BOOL CFX_FormatString::FormatNull(const CFX_WideString& wsPattern, CFX_WideSt } CFX_WideString wsTextFormat; IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"null"), wsTextFormat); - FX_INT32 iPattern = 0; + int32_t iPattern = 0; FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat; - FX_INT32 iLenPattern = wsTextFormat.GetLength(); + int32_t iLenPattern = wsTextFormat.GetLength(); while (iPattern < iLenPattern) { if (pStrPattern[iPattern] == '\'') { wsOutput += FX_GetLiteralText(pStrPattern, iPattern, iLenPattern); @@ -4338,12 +4338,12 @@ IFX_Locale* CFX_FormatString::GetPatternLocale(FX_WSTR wsLocale) #define FXMATH_DECIMAL_FORCEBOOL(x) (!(!(x))) #define FXMATH_DECIMAL_MAKEFLAGS(NEG, SCALE) (((SCALE) << 0x10) | ((NEG) ? FXMATH_DECIMAL_NEGMASK : 0)) #define FXMATH_DECIMAL_FLAGS2NEG(FLAGS) FXMATH_DECIMAL_FORCEBOOL((FLAGS) & FXMATH_DECIMAL_NEGMASK) -#define FXMATH_DECIMAL_FLAGS2SCALE(FLAGS) ((FX_UINT8)(((FLAGS) & ~FXMATH_DECIMAL_NEGMASK) >> 0x10)) +#define FXMATH_DECIMAL_FLAGS2SCALE(FLAGS) ((uint8_t)(((FLAGS) & ~FXMATH_DECIMAL_NEGMASK) >> 0x10)) #define FXMATH_DECIMAL_RSHIFT32BIT(x) ((x)>>0x10>>0x10) #define FXMATH_DECIMAL_LSHIFT32BIT(x) ((x)<<0x10<<0x10) -static inline FX_UINT8 fxmath_decimal_helper_div10(FX_UINT64& phi, FX_UINT64& pmid, FX_UINT64& plo) +static inline uint8_t fxmath_decimal_helper_div10(uint64_t& phi, uint64_t& pmid, uint64_t& plo) { - FX_UINT8 retVal; + uint8_t retVal; pmid += FXMATH_DECIMAL_LSHIFT32BIT(phi % 0xA); phi /= 0xA; plo += FXMATH_DECIMAL_LSHIFT32BIT(pmid % 0xA); @@ -4352,9 +4352,9 @@ static inline FX_UINT8 fxmath_decimal_helper_div10(FX_UINT64& phi, FX_UINT64& pm plo /= 0xA; return retVal; } -static inline FX_UINT8 fxmath_decimal_helper_div10_any(FX_UINT64 nums[], FX_UINT8 numcount) +static inline uint8_t fxmath_decimal_helper_div10_any(uint64_t nums[], uint8_t numcount) { - FX_UINT8 retVal = 0; + uint8_t retVal = 0; for(int i = numcount - 1; i > 0; i --) { nums[i - 1] += FXMATH_DECIMAL_LSHIFT32BIT(nums[i] % 0xA); nums[i] /= 0xA; @@ -4365,49 +4365,49 @@ static inline FX_UINT8 fxmath_decimal_helper_div10_any(FX_UINT64 nums[], FX_UINT } return retVal; } -static inline void fxmath_decimal_helper_mul10(FX_UINT64& phi, FX_UINT64& pmid, FX_UINT64& plo) +static inline void fxmath_decimal_helper_mul10(uint64_t& phi, uint64_t& pmid, uint64_t& plo) { plo *= 0xA; pmid = pmid * 0xA + FXMATH_DECIMAL_RSHIFT32BIT(plo); - plo = (FX_UINT32)plo; + plo = (uint32_t)plo; phi = phi * 0xA + FXMATH_DECIMAL_RSHIFT32BIT(pmid); - pmid = (FX_UINT32)pmid; + pmid = (uint32_t)pmid; } -static inline void fxmath_decimal_helper_mul10_any(FX_UINT64 nums[], FX_UINT8 numcount) +static inline void fxmath_decimal_helper_mul10_any(uint64_t nums[], uint8_t numcount) { nums[0] *= 0xA; for(int i = 1; i < numcount; i++) { nums[i] = nums[i] * 0xA + FXMATH_DECIMAL_RSHIFT32BIT (nums[i - 1]); - nums[i - 1] = (FX_UINT32)nums[i - 1]; + nums[i - 1] = (uint32_t)nums[i - 1]; } } -static inline void fxmath_decimal_helper_normalize(FX_UINT64& phi, FX_UINT64& pmid, FX_UINT64& plo) +static inline void fxmath_decimal_helper_normalize(uint64_t& phi, uint64_t& pmid, uint64_t& plo) { phi += FXMATH_DECIMAL_RSHIFT32BIT(pmid); - pmid = (FX_UINT32)pmid; + pmid = (uint32_t)pmid; pmid += FXMATH_DECIMAL_RSHIFT32BIT(plo); - plo = (FX_UINT32)plo; + plo = (uint32_t)plo; phi += FXMATH_DECIMAL_RSHIFT32BIT(pmid); - pmid = (FX_UINT32)pmid; + pmid = (uint32_t)pmid; } -static inline void fxmath_decimal_helper_normalize_any(FX_UINT64 nums[], FX_UINT8 len) +static inline void fxmath_decimal_helper_normalize_any(uint64_t nums[], uint8_t len) { { for(int i = len - 2; i > 0; i --) { nums[i + 1] += FXMATH_DECIMAL_RSHIFT32BIT(nums[i]); - nums[i] = (FX_UINT32)nums[i]; + nums[i] = (uint32_t)nums[i]; } } { for(int i = 0; i < len - 1; i ++) { nums[i + 1] += FXMATH_DECIMAL_RSHIFT32BIT(nums[i]); - nums[i] = (FX_UINT32)nums[i]; + nums[i] = (uint32_t)nums[i]; } } } -static inline FX_INT8 fxmath_decimal_helper_raw_compare(FX_UINT32 hi1, FX_UINT32 mid1, FX_UINT32 lo1, FX_UINT32 hi2, FX_UINT32 mid2, FX_UINT32 lo2) +static inline int8_t fxmath_decimal_helper_raw_compare(uint32_t hi1, uint32_t mid1, uint32_t lo1, uint32_t hi2, uint32_t mid2, uint32_t lo2) { - FX_INT8 retVal = 0; + int8_t retVal = 0; if (!retVal) { retVal += (hi1 > hi2 ? 1 : (hi1 < hi2 ? -1 : 0)); } @@ -4419,11 +4419,11 @@ static inline FX_INT8 fxmath_decimal_helper_raw_compare(FX_UINT32 hi1, FX_UINT32 } return retVal; } -static inline FX_INT8 fxmath_decimal_helper_raw_compare_any(FX_UINT64 a[], FX_UINT8 al, FX_UINT64 b[], FX_UINT8 bl) +static inline int8_t fxmath_decimal_helper_raw_compare_any(uint64_t a[], uint8_t al, uint64_t b[], uint8_t bl) { - FX_INT8 retVal = 0; + int8_t retVal = 0; for(int i = FX_MAX(al - 1, bl - 1); i >= 0; i --) { - FX_UINT64 l = (i >= al ? 0 : a[i]), r = (i >= bl ? 0 : b[i]); + uint64_t l = (i >= al ? 0 : a[i]), r = (i >= bl ? 0 : b[i]); retVal += (l > r ? 1 : (l < r ? -1 : 0)); if(retVal) { return retVal; @@ -4431,7 +4431,7 @@ static inline FX_INT8 fxmath_decimal_helper_raw_compare_any(FX_UINT64 a[], FX_UI } return retVal; } -static inline void fxmath_decimal_helper_dec_any(FX_UINT64 a[], FX_UINT8 al) +static inline void fxmath_decimal_helper_dec_any(uint64_t a[], uint8_t al) { for(int i = 0; i < al; i ++) { if(a[i]--) { @@ -4439,17 +4439,17 @@ static inline void fxmath_decimal_helper_dec_any(FX_UINT64 a[], FX_UINT8 al) } } } -static inline void fxmath_decimal_helper_inc_any(FX_UINT64 a[], FX_UINT8 al) +static inline void fxmath_decimal_helper_inc_any(uint64_t a[], uint8_t al) { for(int i = 0; i < al; i ++) { a[i]++; - if((FX_UINT32)a[i] == a[i]) { + if((uint32_t)a[i] == a[i]) { return; } a[i] = 0; } } -static inline void fxmath_decimal_helper_raw_mul(FX_UINT64 a[], FX_UINT8 al, FX_UINT64 b[], FX_UINT8 bl, FX_UINT64 c[], FX_UINT8 cl) +static inline void fxmath_decimal_helper_raw_mul(uint64_t a[], uint8_t al, uint64_t b[], uint8_t bl, uint64_t c[], uint8_t cl) { assert(al + bl <= cl); { @@ -4460,8 +4460,8 @@ static inline void fxmath_decimal_helper_raw_mul(FX_UINT64 a[], FX_UINT8 al, FX_ { for(int i = 0; i < al; i++) { for(int j = 0; j < bl; j++) { - FX_UINT64 m = (FX_UINT64)a[i] * b[j]; - c[i + j] += (FX_UINT32)m; + uint64_t m = (uint64_t)a[i] * b[j]; + c[i + j] += (uint32_t)m; c[i + j + 1] += FXMATH_DECIMAL_RSHIFT32BIT(m); } } @@ -4469,29 +4469,29 @@ static inline void fxmath_decimal_helper_raw_mul(FX_UINT64 a[], FX_UINT8 al, FX_ { for(int i = 0; i < cl - 1; i++) { c[i + 1] += FXMATH_DECIMAL_RSHIFT32BIT(c[i]); - c[i] = (FX_UINT32)c[i]; + c[i] = (uint32_t)c[i]; } } { for(int i = 0; i < cl; i++) { - c[i] = (FX_UINT32)c[i]; + c[i] = (uint32_t)c[i]; } } } -static inline void fxmath_decimal_helper_raw_div(FX_UINT64 a[], FX_UINT8 al, FX_UINT64 b[], FX_UINT8 bl, FX_UINT64 c[], FX_UINT8 cl) +static inline void fxmath_decimal_helper_raw_div(uint64_t a[], uint8_t al, uint64_t b[], uint8_t bl, uint64_t c[], uint8_t cl) { int i; for(i = 0; i < cl; i++) { c[i] = 0; } - FX_UINT64 left[16] = {0}, right[16] = {0}; + uint64_t left[16] = {0}, right[16] = {0}; left[0] = 0; for(i = 0; i < al; i++) { right[i] = a[i]; } - FX_UINT64 tmp[16]; + uint64_t tmp[16]; while(fxmath_decimal_helper_raw_compare_any(left, al, right, al) <= 0) { - FX_UINT64 cur[16]; + uint64_t cur[16]; for(i = 0; i < al; i++) { cur[i] = left[i] + right[i]; } @@ -4527,7 +4527,7 @@ static inline void fxmath_decimal_helper_raw_div(FX_UINT64 a[], FX_UINT8 al, FX_ c[i] = left[i]; } } -static inline FX_BOOL fxmath_decimal_helper_outofrange(FX_UINT64 a[], FX_UINT8 al, FX_UINT8 goal) +static inline FX_BOOL fxmath_decimal_helper_outofrange(uint64_t a[], uint8_t al, uint8_t goal) { for(int i = goal; i < al; i++) { if(a[i]) { @@ -4536,7 +4536,7 @@ static inline FX_BOOL fxmath_decimal_helper_outofrange(FX_UINT64 a[], FX_UINT8 a } return FALSE; } -static inline void fxmath_decimal_helper_shrinkintorange(FX_UINT64 a[], FX_UINT8 al, FX_UINT8 goal, FX_UINT8& scale) +static inline void fxmath_decimal_helper_shrinkintorange(uint64_t a[], uint8_t al, uint8_t goal, uint8_t& scale) { FX_BOOL bRoundUp = FALSE; while(scale != 0 && (scale > FXMATH_DECIMAL_SCALELIMIT || fxmath_decimal_helper_outofrange(a, al, goal))) { @@ -4548,10 +4548,10 @@ static inline void fxmath_decimal_helper_shrinkintorange(FX_UINT64 a[], FX_UINT8 fxmath_decimal_helper_inc_any(a, goal); } } -static inline void fxmath_decimal_helper_truncate(FX_UINT64& phi, FX_UINT64& pmid, FX_UINT64& plo, FX_UINT8& scale, FX_UINT8 minscale = 0) +static inline void fxmath_decimal_helper_truncate(uint64_t& phi, uint64_t& pmid, uint64_t& plo, uint8_t& scale, uint8_t minscale = 0) { while(scale > minscale) { - FX_UINT64 thi = phi, tmid = pmid, tlo = plo; + uint64_t thi = phi, tmid = pmid, tlo = plo; if(fxmath_decimal_helper_div10(thi, tmid, tlo) != 0) { break; } @@ -4563,20 +4563,20 @@ CFX_Decimal::CFX_Decimal() { m_uLo = m_uMid = m_uHi = m_uFlags = 0; } -CFX_Decimal::CFX_Decimal(FX_UINT64 val) +CFX_Decimal::CFX_Decimal(uint64_t val) { - m_uLo = (FX_UINT32)val; - m_uMid = (FX_UINT32)FXMATH_DECIMAL_RSHIFT32BIT(val); + m_uLo = (uint32_t)val; + m_uMid = (uint32_t)FXMATH_DECIMAL_RSHIFT32BIT(val); m_uHi = 0; m_uFlags = 0; } -CFX_Decimal::CFX_Decimal(FX_UINT32 val) +CFX_Decimal::CFX_Decimal(uint32_t val) { - m_uLo = (FX_UINT32)val; + m_uLo = (uint32_t)val; m_uMid = m_uHi = 0; m_uFlags = 0; } -CFX_Decimal::CFX_Decimal(FX_UINT32 lo, FX_UINT32 mid, FX_UINT32 hi, FX_BOOL neg, FX_UINT8 scale) +CFX_Decimal::CFX_Decimal(uint32_t lo, uint32_t mid, uint32_t hi, FX_BOOL neg, uint8_t scale) { scale = (scale > FXMATH_DECIMAL_SCALELIMIT ? 0 : scale); m_uLo = lo; @@ -4584,43 +4584,43 @@ CFX_Decimal::CFX_Decimal(FX_UINT32 lo, FX_UINT32 mid, FX_UINT32 hi, FX_BOOL neg, m_uHi = hi; m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(neg && IsNotZero(), scale); } -CFX_Decimal::CFX_Decimal(FX_INT32 val) +CFX_Decimal::CFX_Decimal(int32_t val) { if(val >= 0) { - *this = CFX_Decimal((FX_UINT32)val); + *this = CFX_Decimal((uint32_t)val); } else { - *this = CFX_Decimal((FX_UINT32) - val); + *this = CFX_Decimal((uint32_t) - val); SetNegate(); } } -CFX_Decimal::CFX_Decimal(FX_INT64 val) +CFX_Decimal::CFX_Decimal(int64_t val) { if(val >= 0) { - *this = CFX_Decimal((FX_UINT64)val); + *this = CFX_Decimal((uint64_t)val); } else { - *this = CFX_Decimal((FX_UINT64) - val); + *this = CFX_Decimal((uint64_t) - val); SetNegate(); } } -CFX_Decimal::CFX_Decimal(FX_FLOAT val, FX_UINT8 scale ) +CFX_Decimal::CFX_Decimal(FX_FLOAT val, uint8_t scale ) { FX_FLOAT newval = fabs(val); - FX_UINT64 phi, pmid, plo; - plo = (FX_UINT64)newval; - pmid = (FX_UINT64)(newval / 1e32); - phi = (FX_UINT64)(newval / 1e64); + uint64_t phi, pmid, plo; + plo = (uint64_t)newval; + pmid = (uint64_t)(newval / 1e32); + phi = (uint64_t)(newval / 1e64); newval = FXSYS_fmod(newval, 1.0f); - for(FX_UINT8 iter = 0; iter < scale; iter++) { + for(uint8_t iter = 0; iter < scale; iter++) { fxmath_decimal_helper_mul10(phi, pmid, plo); newval *= 10; - plo += (FX_UINT64)newval; + plo += (uint64_t)newval; newval = FXSYS_fmod(newval, 1.0f); } plo += FXSYS_round(newval); fxmath_decimal_helper_normalize(phi, pmid, plo); - m_uHi = (FX_UINT32)phi; - m_uMid = (FX_UINT32)pmid; - m_uLo = (FX_UINT32)plo; + m_uHi = (uint32_t)phi; + m_uMid = (uint32_t)pmid; + m_uLo = (uint32_t)plo; m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(val < 0 && IsNotZero(), scale); } CFX_Decimal::CFX_Decimal(FX_WSTR strObj) @@ -4629,7 +4629,7 @@ CFX_Decimal::CFX_Decimal(FX_WSTR strObj) FX_LPCWSTR strBound = str + strObj.GetLength(); FX_BOOL pointmet = 0; FX_BOOL negmet = 0; - FX_UINT8 scale = 0; + uint8_t scale = 0; m_uHi = m_uMid = m_uLo = 0; while (str != strBound && *str == ' ') { str++; @@ -4647,8 +4647,8 @@ CFX_Decimal::CFX_Decimal(FX_WSTR strObj) } pointmet = 1; } else { - m_uHi = m_uHi * 0xA + FXMATH_DECIMAL_RSHIFT32BIT((FX_UINT64)m_uMid * 0xA); - m_uMid = m_uMid * 0xA + FXMATH_DECIMAL_RSHIFT32BIT((FX_UINT64)m_uLo * 0xA); + m_uHi = m_uHi * 0xA + FXMATH_DECIMAL_RSHIFT32BIT((uint64_t)m_uMid * 0xA); + m_uMid = m_uMid * 0xA + FXMATH_DECIMAL_RSHIFT32BIT((uint64_t)m_uLo * 0xA); m_uLo = m_uLo * 0xA + (*str - '0'); if(pointmet) { scale++; @@ -4669,12 +4669,12 @@ CFX_Decimal::operator CFX_WideString() const { CFX_WideString retString; CFX_WideString tmpbuf; - FX_UINT64 phi = m_uHi, pmid = m_uMid, plo = m_uLo; + uint64_t phi = m_uHi, pmid = m_uMid, plo = m_uLo; while(phi || pmid || plo) { tmpbuf += fxmath_decimal_helper_div10(phi, pmid, plo) + '0'; } - FX_UINT8 outputlen = (FX_UINT8)tmpbuf.GetLength(); - FX_UINT8 scale = (FX_UINT8)FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); + uint8_t outputlen = (uint8_t)tmpbuf.GetLength(); + uint8_t scale = (uint8_t)FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); while (scale >= outputlen) { tmpbuf += '0'; outputlen++; @@ -4682,7 +4682,7 @@ CFX_Decimal::operator CFX_WideString() const if (FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero()) { retString += '-'; } - for (FX_UINT8 idx = 0; idx < outputlen; idx++) { + for (uint8_t idx = 0; idx < outputlen; idx++) { if (idx == (outputlen - scale) && scale != 0) { retString += '.'; } @@ -4694,27 +4694,27 @@ CFX_Decimal::operator double() const { double pow = (double)(1 << 16) * (1 << 16); double base = ((double)m_uHi) * pow * pow + ((double)m_uMid) * pow + ((double)m_uLo); - FX_INT8 scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); + int8_t scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); FX_BOOL bNeg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags); return (bNeg ? -1 : 1) * base * ::pow(10.0, -scale); } -void CFX_Decimal::SetScale(FX_UINT8 newscale) +void CFX_Decimal::SetScale(uint8_t newscale) { - FX_UINT8 oldscale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); + uint8_t oldscale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); if (newscale > oldscale) { - FX_UINT64 phi = m_uHi, pmid = m_uMid, plo = m_uLo; - for (FX_UINT8 iter = 0; iter < newscale - oldscale; iter++) { + uint64_t phi = m_uHi, pmid = m_uMid, plo = m_uLo; + for (uint8_t iter = 0; iter < newscale - oldscale; iter++) { fxmath_decimal_helper_mul10(phi, pmid, plo); } - m_uHi = (FX_UINT32)phi; - m_uMid = (FX_UINT32)pmid; - m_uLo = (FX_UINT32)plo; + m_uHi = (uint32_t)phi; + m_uMid = (uint32_t)pmid; + m_uLo = (uint32_t)plo; m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero(), newscale); } else if (newscale < oldscale) { - FX_UINT64 phi, pmid, plo; + uint64_t phi, pmid, plo; phi = 0, pmid = 0, plo = 5; { - for(FX_UINT8 iter = 0; iter < oldscale - newscale - 1; iter++) { + for(uint8_t iter = 0; iter < oldscale - newscale - 1; iter++) { fxmath_decimal_helper_mul10(phi, pmid, plo); } } @@ -4723,19 +4723,19 @@ void CFX_Decimal::SetScale(FX_UINT8 newscale) plo += m_uLo; fxmath_decimal_helper_normalize(phi, pmid, plo); { - for(FX_UINT8 iter = 0; iter < oldscale - newscale; iter++) { + for(uint8_t iter = 0; iter < oldscale - newscale; iter++) { fxmath_decimal_helper_div10(phi, pmid, plo); } } - m_uHi = (FX_UINT32)phi; - m_uMid = (FX_UINT32)pmid; - m_uLo = (FX_UINT32)plo; + m_uHi = (uint32_t)phi; + m_uMid = (uint32_t)pmid; + m_uLo = (uint32_t)plo; m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero(), newscale); } } -FX_UINT8 CFX_Decimal::GetScale() +uint8_t CFX_Decimal::GetScale() { - FX_UINT8 oldscale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); + uint8_t oldscale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); return oldscale; } void CFX_Decimal::SetAbs() @@ -4750,7 +4750,7 @@ void CFX_Decimal::SetNegate() } void CFX_Decimal::FloorOrCeil(FX_BOOL bFloor) { - FX_UINT64 nums[3] = {m_uLo, m_uMid, m_uHi}; + uint64_t nums[3] = {m_uLo, m_uMid, m_uHi}; FX_BOOL bDataLoss = FALSE; for(int i = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); i > 0; i --) { bDataLoss = fxmath_decimal_helper_div10_any(nums, 3) || bDataLoss; @@ -4758,9 +4758,9 @@ void CFX_Decimal::FloorOrCeil(FX_BOOL bFloor) if(bDataLoss && (bFloor ? FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) : !FXMATH_DECIMAL_FLAGS2NEG(m_uFlags))) { fxmath_decimal_helper_inc_any(nums, 3); } - m_uHi = (FX_UINT32)nums[2]; - m_uMid = (FX_UINT32)nums[1]; - m_uLo = (FX_UINT32)nums[0]; + m_uHi = (uint32_t)nums[2]; + m_uMid = (uint32_t)nums[1]; + m_uLo = (uint32_t)nums[0]; m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero(), 0); } void CFX_Decimal::SetFloor() @@ -4777,7 +4777,7 @@ void CFX_Decimal::SetTruncate() } void CFX_Decimal::Swap(CFX_Decimal& val) { - FX_UINT32 tmp; + uint32_t tmp; tmp = m_uHi; m_uHi = val.m_uHi; val.m_uHi = tmp; @@ -4791,12 +4791,12 @@ void CFX_Decimal::Swap(CFX_Decimal& val) m_uFlags = val.m_uFlags; val.m_uFlags = tmp; } -FX_INT8 CFX_Decimal::Compare (const CFX_Decimal& val) const +int8_t CFX_Decimal::Compare (const CFX_Decimal& val) const { CFX_Decimal lhs = *this, rhs = val; - FX_INT8 retVal = 0; + int8_t retVal = 0; if (FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags) != FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags)) { - FX_UINT8 scale = FX_MIN(FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags)); + uint8_t scale = FX_MIN(FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags)); lhs.SetScale(scale); rhs.SetScale(scale); } @@ -4811,7 +4811,7 @@ CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) co { CFX_Decimal lhs = *this, rhs = val; if (FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags) != FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags)) { - FX_UINT8 scale = FX_MAX(FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags)); + uint8_t scale = FX_MAX(FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags)); lhs.SetScale(scale); rhs.SetScale(scale); } @@ -4820,7 +4820,7 @@ CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) co } FX_BOOL doRawAdd = (FXMATH_DECIMAL_FLAGS2NEG(lhs.m_uFlags) == FXMATH_DECIMAL_FLAGS2NEG(rhs.m_uFlags)); if (doRawAdd) { - FX_UINT64 phi = lhs.m_uHi, pmid = lhs.m_uMid, plo = lhs.m_uLo; + uint64_t phi = lhs.m_uHi, pmid = lhs.m_uMid, plo = lhs.m_uLo; phi += rhs.m_uHi; pmid += rhs.m_uMid; plo += rhs.m_uLo; @@ -4829,9 +4829,9 @@ CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) co fxmath_decimal_helper_div10(phi, pmid, plo); lhs.m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(FXMATH_DECIMAL_FLAGS2NEG(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags) - 1); } - lhs.m_uHi = (FX_UINT32)phi; - lhs.m_uMid = (FX_UINT32)pmid; - lhs.m_uLo = (FX_UINT32)plo; + lhs.m_uHi = (uint32_t)phi; + lhs.m_uMid = (uint32_t)pmid; + lhs.m_uLo = (uint32_t)plo; return lhs; } else { if(fxmath_decimal_helper_raw_compare(lhs.m_uHi, lhs.m_uMid, lhs.m_uLo, rhs.m_uHi, rhs.m_uMid, rhs.m_uLo) < 0) { @@ -4854,13 +4854,13 @@ CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) co } CFX_Decimal CFX_Decimal::Multiply(const CFX_Decimal& val) const { - FX_UINT64 a[3] = {m_uLo, m_uMid, m_uHi}, b[3] = {val.m_uLo, val.m_uMid, val.m_uHi}; - FX_UINT64 c[6]; + uint64_t a[3] = {m_uLo, m_uMid, m_uHi}, 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); - FX_UINT8 scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags) + FXMATH_DECIMAL_FLAGS2SCALE(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); - return CFX_Decimal((FX_UINT32)c[0], (FX_UINT32)c[1], (FX_UINT32)c[2], neg, scale); + return CFX_Decimal((uint32_t)c[0], (uint32_t)c[1], (uint32_t)c[2], neg, scale); } CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const { @@ -4868,8 +4868,8 @@ CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const return CFX_Decimal(); } FX_BOOL neg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) ^ FXMATH_DECIMAL_FLAGS2NEG(val.m_uFlags); - FX_UINT64 a[7] = {m_uLo, m_uMid, m_uHi}, b[3] = {val.m_uLo, val.m_uMid, val.m_uHi}, c[7] = {0}; - FX_UINT8 scale = 0; + 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; if(FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags) < FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags)) { for(int i = FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags) - FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); i > 0; i--) { fxmath_decimal_helper_mul10_any(a, 7); @@ -4877,7 +4877,7 @@ CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const } else { scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags) - FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags); } - FX_UINT8 minscale = scale; + uint8_t minscale = scale; if(!IsNotZero()) { return CFX_Decimal(0, 0, 0, 0, minscale); } @@ -4890,7 +4890,7 @@ CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const fxmath_decimal_helper_raw_div(a, 6, b, 3, c, 7); fxmath_decimal_helper_shrinkintorange(c, 6, 3, scale); fxmath_decimal_helper_truncate(c[2], c[1], c[0], scale, minscale); - return CFX_Decimal((FX_UINT32)c[0], (FX_UINT32)c[1], (FX_UINT32)c[2], neg, scale); + return CFX_Decimal((uint32_t)c[0], (uint32_t)c[1], (uint32_t)c[2], neg, scale); } CFX_Decimal CFX_Decimal::Modulus(const CFX_Decimal& val) const { diff --git a/xfa/src/fgas/src/localization/fx_localeimp.h b/xfa/src/fgas/src/localization/fx_localeimp.h index c7d534d106..8dfec2e862 100644 --- a/xfa/src/fgas/src/localization/fx_localeimp.h +++ b/xfa/src/fgas/src/localization/fx_localeimp.h @@ -20,8 +20,8 @@ public: virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString& wsNumSymbol) const; virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const; - virtual void GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const; - virtual void GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const; + virtual void GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const; + virtual void GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const; virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM = TRUE) const; virtual void GetTimeZone(FX_TIMEZONE& tz) const; virtual void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const; @@ -63,7 +63,7 @@ public: protected: virtual ~CFX_FormatString(); IFX_Locale* GetTextFormat(const CFX_WideString &wsPattern, FX_WSTR wsCategory, CFX_WideString& wsPurgePattern); - IFX_Locale* GetNumericFormat(const CFX_WideString& wsPattern, FX_INT32& iDotIndex, FX_DWORD& dwStyle, CFX_WideString& wsPurgePattern); + IFX_Locale* GetNumericFormat(const CFX_WideString& wsPattern, int32_t& iDotIndex, FX_DWORD& dwStyle, CFX_WideString& wsPurgePattern); FX_BOOL FormatStrNum(FX_WSTR wsInputNum, 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, CFX_WideString &wsTimePattern); diff --git a/xfa/src/fgas/src/localization/fx_localemgr.cpp b/xfa/src/fgas/src/localization/fx_localemgr.cpp index 3b93f101a3..b3f0e80d7a 100644 --- a/xfa/src/fgas/src/localization/fx_localemgr.cpp +++ b/xfa/src/fgas/src/localization/fx_localemgr.cpp @@ -38,10 +38,10 @@ IFX_LocaleMgr* FX_LocaleMgr_Create(FX_LPCWSTR pszLocalPath, FX_WORD wDefaultLCID CFX_WideString wsLCID = pXmlLocale->GetAttrValue("", "lcid"); wchar_t* pEnd = NULL; FX_DWORD dwLCID = wcstol(wsLCID, &pEnd, 16); - if (pLocaleMgr->m_lcid2xml.GetValueAt((FX_LPVOID)(FX_UINTPTR)dwLCID)) { + if (pLocaleMgr->m_lcid2xml.GetValueAt((FX_LPVOID)(uintptr_t)dwLCID)) { delete pXmlLocale; } else { - pLocaleMgr->m_lcid2xml.SetAt((FX_LPVOID)(FX_UINTPTR)dwLCID, pXmlLocale); + pLocaleMgr->m_lcid2xml.SetAt((FX_LPVOID)(uintptr_t)dwLCID, pXmlLocale); } } else { delete pXmlLocale; @@ -84,12 +84,12 @@ IFX_Locale* CFX_LocaleMgr::GetDefLocale() } IFX_Locale* CFX_LocaleMgr::GetLocale(FX_WORD lcid) { - IFX_Locale* pLocale = (IFX_Locale*)m_lcid2locale.GetValueAt((FX_LPVOID)(FX_UINTPTR)lcid); + IFX_Locale* pLocale = (IFX_Locale*)m_lcid2locale.GetValueAt((FX_LPVOID)(uintptr_t)lcid); if (!pLocale) { - CXML_Element* pxml = (CXML_Element*)m_lcid2xml.GetValueAt((FX_LPVOID)(FX_UINTPTR)lcid); + CXML_Element* pxml = (CXML_Element*)m_lcid2xml.GetValueAt((FX_LPVOID)(uintptr_t)lcid); if (pxml) { pLocale = IFX_Locale::Create(pxml); - m_lcid2locale.SetAt((FX_LPVOID)(FX_UINTPTR)lcid, pLocale); + m_lcid2locale.SetAt((FX_LPVOID)(uintptr_t)lcid, pLocale); } } return pLocale; diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.cpp b/xfa/src/fgas/src/xml/fx_sax_imp.cpp index b41ee3fef4..fedf89f9f9 100644 --- a/xfa/src/fgas/src/xml/fx_sax_imp.cpp +++ b/xfa/src/fgas/src/xml/fx_sax_imp.cpp @@ -34,7 +34,7 @@ FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead *pFile, FX_DWORD dwStart, FX_DWORD d return FALSE; } m_dwBufSize = FX_MIN(dwLen, FX_SAXFILE_BUFSIZE); - m_pBuf = FX_Alloc(FX_BYTE, m_dwBufSize); + m_pBuf = FX_Alloc(uint8_t, m_dwBufSize); if (!m_pBuf) { return FALSE; } @@ -72,7 +72,7 @@ void CFX_SAXFile::Reset() } #define FX_SAXCHARTYPE_Normal 0 #define FX_SAXCHARTYPE_Space 1 -static FX_BYTE g_SAX_CharType[256] = { +static uint8_t g_SAX_CharType[256] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -102,8 +102,8 @@ CFX_SAXReader::CFX_SAXReader() , m_pCommentContext(NULL) , m_dwParseMode(0) { - m_pszData = (FX_LPBYTE)FX_Alloc(FX_BYTE, m_iDataSize); - m_pszName = (FX_LPBYTE)FX_Alloc(FX_BYTE, m_iNameSize); + m_pszData = (FX_LPBYTE)FX_Alloc(uint8_t, m_iDataSize); + m_pszName = (FX_LPBYTE)FX_Alloc(uint8_t, m_iNameSize); } CFX_SAXReader::~CFX_SAXReader() { @@ -159,12 +159,12 @@ inline void CFX_SAXReader::Pop() delete m_pCurItem; m_pCurItem = pPrev; } -inline void CFX_SAXReader::AppendData(FX_BYTE ch) +inline void CFX_SAXReader::AppendData(uint8_t ch) { ReallocDataBuffer(); m_pszData[m_iDataPos++] = ch; } -inline void CFX_SAXReader::AppendName(FX_BYTE ch) +inline void CFX_SAXReader::AppendName(uint8_t ch) { ReallocNameBuffer(); m_pszName[m_iDataPos++] = ch; @@ -179,7 +179,7 @@ void CFX_SAXReader::ReallocDataBuffer() } else { m_iDataSize += 1024 * 1024; } - m_pszData = (FX_LPBYTE)FX_Realloc(FX_BYTE, m_pszData, m_iDataSize); + m_pszData = (FX_LPBYTE)FX_Realloc(uint8_t, m_pszData, m_iDataSize); } void CFX_SAXReader::ReallocNameBuffer() { @@ -191,13 +191,13 @@ void CFX_SAXReader::ReallocNameBuffer() } else { m_iNameSize += 1024 * 1024; } - m_pszName = (FX_LPBYTE)FX_Realloc(FX_BYTE, m_pszName, m_iNameSize); + m_pszName = (FX_LPBYTE)FX_Realloc(uint8_t, m_pszName, m_iNameSize); } -inline FX_BOOL CFX_SAXReader::SkipSpace(FX_BYTE ch) +inline FX_BOOL CFX_SAXReader::SkipSpace(uint8_t ch) { return (m_dwParseMode & FX_SAXPARSEMODE_NotSkipSpace) == 0 && ch < 0x21; } -FX_INT32 CFX_SAXReader::StartParse(IFX_FileRead *pFile, FX_DWORD dwStart , FX_DWORD dwLen , FX_DWORD dwParseMode ) +int32_t CFX_SAXReader::StartParse(IFX_FileRead *pFile, FX_DWORD dwStart , FX_DWORD dwLen , FX_DWORD dwParseMode ) { m_iState = -1; Reset(); @@ -231,7 +231,7 @@ static const FX_SAXReader_LPFParse g_FX_SAXReader_LPFParse[FX_SAXMODE_MAX] = { &CFX_SAXReader::ParseTagEnd, &CFX_SAXReader::ParseTargetData, }; -FX_INT32 CFX_SAXReader::ContinueParse(IFX_Pause *pPause ) +int32_t CFX_SAXReader::ContinueParse(IFX_Pause *pPause ) { if (m_iState < 0 || m_iState > 99) { return m_iState; @@ -261,21 +261,21 @@ FX_INT32 CFX_SAXReader::ContinueParse(IFX_Pause *pPause ) } return m_iState; } -void CFX_SAXReader::ParseChar(FX_BYTE ch) +void CFX_SAXReader::ParseChar(uint8_t ch) { ReallocDataBuffer(); m_pszData[m_iDataPos] = ch; if (m_iEntityStart > -1 && ch == ';') { - FX_INT32 iSaveEntityStart = m_iEntityStart; + int32_t iSaveEntityStart = m_iEntityStart; CFX_ByteString csEntity(m_pszData + m_iEntityStart + 1, m_iDataPos - m_iEntityStart - 1); - FX_INT32 iLen = csEntity.GetLength(); + int32_t iLen = csEntity.GetLength(); if (iLen > 0) { if (csEntity[0] == '#') { if ((m_dwParseMode & FX_SAXPARSEMODE_NotConvert_sharp) == 0) { ch = 0; - FX_BYTE w; + uint8_t w; if (iLen > 1 && csEntity[1] == 'x') { - for (FX_INT32 i = 2; i < iLen; i ++) { + for (int32_t i = 2; i < iLen; i ++) { w = csEntity[i]; if (w >= '0' && w <= '9') { ch = (ch << 4) + w - '0'; @@ -288,7 +288,7 @@ void CFX_SAXReader::ParseChar(FX_BYTE ch) } } } else { - for (FX_INT32 i = 1; i < iLen; i ++) { + for (int32_t i = 1; i < iLen; i ++) { w = csEntity[i]; if (w < '0' || w > '9') { break; @@ -592,7 +592,7 @@ void CFX_SAXReader::ParseTargetData() } void CFX_SAXReader::SkipNode() { - FX_INT32 iLen = m_SkipStack.GetSize(); + int32_t iLen = m_SkipStack.GetSize(); if (m_SkipChar == '\'' || m_SkipChar == '\"') { if (m_CurByte != m_SkipChar) { return; @@ -633,12 +633,12 @@ void CFX_SAXReader::SkipNode() m_iDataLength = m_iDataPos; m_iDataPos = 0; if (m_iDataLength >= 9 - && FXSYS_memcmp(m_pszData, "[CDATA[", 7 * sizeof(FX_BYTE)) == 0 - && FXSYS_memcmp(m_pszData + m_iDataLength - 2, "]]", 2 * sizeof(FX_BYTE)) == 0) { + && FXSYS_memcmp(m_pszData, "[CDATA[", 7 * sizeof(uint8_t)) == 0 + && FXSYS_memcmp(m_pszData + m_iDataLength - 2, "]]", 2 * sizeof(uint8_t)) == 0) { Pop(); m_iDataLength -= 9; m_dwDataOffset += 7; - FXSYS_memmove(m_pszData , m_pszData + 7, m_iDataLength * sizeof(FX_BYTE)); + FXSYS_memmove(m_pszData , m_pszData + 7, m_iDataLength * sizeof(uint8_t)); m_bCharData = TRUE; if (m_pHandler) { NotifyData(); diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.h b/xfa/src/fgas/src/xml/fx_sax_imp.h index 444bcbdf8e..a2f7259235 100644 --- a/xfa/src/fgas/src/xml/fx_sax_imp.h +++ b/xfa/src/fgas/src/xml/fx_sax_imp.h @@ -63,8 +63,8 @@ public: , m_iTailCount(0) { } - FX_INT32 m_iHeaderCount; - FX_INT32 m_iTailCount; + int32_t m_iHeaderCount; + int32_t m_iTailCount; }; class CFX_SAXReader : public IFX_SAXReader { @@ -75,12 +75,12 @@ public: { delete this; } - virtual FX_INT32 StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0); - virtual FX_INT32 ContinueParse(IFX_Pause *pPause = NULL); + virtual int32_t StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0); + virtual int32_t ContinueParse(IFX_Pause *pPause = NULL); virtual void SkipCurrentNode(); virtual void SetHandler(IFX_SAXReaderHandler *pHandler); - void AppendData(FX_BYTE ch); - void AppendName(FX_BYTE ch); + void AppendData(uint8_t ch); + void AppendName(uint8_t ch); void ParseText(); void ParseNodeStart(); void ParseInstruction(); @@ -99,32 +99,32 @@ public: protected: CFX_SAXFile m_File; IFX_SAXReaderHandler* m_pHandler; - FX_INT32 m_iState; + int32_t m_iState; CFX_SAXItem* m_pRoot; CFX_SAXItem* m_pCurItem; FX_DWORD m_dwItemID; FX_SAXMODE m_eMode; FX_SAXMODE m_ePrevMode; FX_BOOL m_bCharData; - FX_BYTE m_CurByte; + uint8_t m_CurByte; FX_DWORD m_dwDataOffset; CFX_ByteArray m_SkipStack; - FX_BYTE m_SkipChar; + uint8_t m_SkipChar; FX_DWORD m_dwNodePos; FX_LPBYTE m_pszData; - FX_INT32 m_iDataSize; - FX_INT32 m_iDataLength; - FX_INT32 m_iEntityStart; - FX_INT32 m_iDataPos; + int32_t m_iDataSize; + int32_t m_iDataLength; + int32_t m_iEntityStart; + int32_t m_iDataPos; FX_LPBYTE m_pszName; - FX_INT32 m_iNameSize; - FX_INT32 m_iNameLength; + int32_t m_iNameSize; + int32_t m_iNameLength; FX_DWORD m_dwParseMode; CFX_SAXCommentContext *m_pCommentContext; void Reset(); void Push(); void Pop(); - FX_BOOL SkipSpace(FX_BYTE ch); + FX_BOOL SkipSpace(uint8_t ch); void SkipNode(); void NotifyData(); void NotifyEnter(); @@ -135,6 +135,6 @@ protected: void NotifyTargetData(); void ReallocDataBuffer(); void ReallocNameBuffer(); - void ParseChar(FX_BYTE ch); + void ParseChar(uint8_t ch); }; #endif diff --git a/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp b/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp index 8ac141a686..cc7ffd9f54 100644 --- a/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp @@ -113,7 +113,7 @@ FWL_ERR CFWL_BarcodeImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *p if (pMatrix) { mt.Concat(*pMatrix); } - FX_INT32 errorCode = 0; + int32_t errorCode = 0; _FWL_RETURN_VALUE_IF_FAIL(m_pBarcodeEngine->RenderDevice(pGraphics->GetRenderDevice(), pMatrix, errorCode), FWL_ERR_Indefinite); return FWL_ERR_Succeeded; } @@ -147,8 +147,8 @@ void CFWL_BarcodeImp::GenerateBarcodeImageCache() if(pFontColor) { m_pBarcodeEngine->SetFontColor(*pFontColor); } - m_pBarcodeEngine->SetHeight(FX_INT32(m_rtClient.height)); - m_pBarcodeEngine->SetWidth(FX_INT32(m_rtClient.width)); + m_pBarcodeEngine->SetHeight(int32_t(m_rtClient.height)); + m_pBarcodeEngine->SetWidth(int32_t(m_rtClient.width)); FX_DWORD dwAttributeMask = pData->GetBarcodeAttributeMask(); if (dwAttributeMask & FWL_BCDATTRIBUTE_CHARENCODING) { m_pBarcodeEngine->SetCharEncoding (pData->GetCharEncoding()); @@ -189,7 +189,7 @@ void CFWL_BarcodeImp::GenerateBarcodeImageCache() if (dwAttributeMask & FWL_BCDATTRIBUTE_TRUNCATED) { m_pBarcodeEngine->SetTruncated (pData->GetTruncated()); } - FX_INT32 errorCode = 0; + int32_t errorCode = 0; m_dwStatus = m_pBarcodeEngine->Encode(wsText, TRUE, errorCode) ? XFA_BCS_EncodeSuccess : 0; } void CFWL_BarcodeImp::CreateBarcodeEngine() diff --git a/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp b/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp index f8c7d09eb2..b0307e883f 100644 --- a/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_caretimp.cpp @@ -165,7 +165,7 @@ CFWL_CaretImp::CFWL_CaretTimer::CFWL_CaretTimer(CFWL_CaretImp *m_pCaret) { this->m_pCaret = m_pCaret; } -FX_INT32 CFWL_CaretImp::CFWL_CaretTimer::Run(FWL_HTIMER hTimer) +int32_t CFWL_CaretImp::CFWL_CaretTimer::Run(FWL_HTIMER hTimer) { if (m_pCaret->GetStates() & FWL_STATE_CAT_HightLight) { m_pCaret->SetStates(FWL_STATE_CAT_HightLight, FALSE); @@ -182,7 +182,7 @@ CFWL_CaretImpDelegate::CFWL_CaretImpDelegate(CFWL_CaretImp *pOwner) : m_pOwner(pOwner) { } -FX_INT32 CFWL_CaretImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_CaretImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { return 1; } diff --git a/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp index 89311b39f2..1ba0851bb6 100644 --- a/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp @@ -38,11 +38,11 @@ FWL_ERR IFWL_CheckBox::Initialize(const CFWL_WidgetImpProperties &properties, IF ((CFWL_CheckBoxImp*)m_pData)->SetInterface(this); return ((CFWL_CheckBoxImp*)m_pData)->Initialize(); } -FX_INT32 IFWL_CheckBox::GetCheckState() +int32_t IFWL_CheckBox::GetCheckState() { return ((CFWL_CheckBoxImp*)m_pData)->GetCheckState(); } -FWL_ERR IFWL_CheckBox::SetCheckState(FX_INT32 iCheck) +FWL_ERR IFWL_CheckBox::SetCheckState(int32_t iCheck) { return ((CFWL_CheckBoxImp*)m_pData)->SetCheckState(iCheck); } @@ -174,7 +174,7 @@ FWL_ERR CFWL_CheckBoxImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix * if (HasEdge()) { DrawEdge(pGraphics, FWL_PART_CKB_Edge, pTheme, pMatrix); } - FX_INT32 dwStates = GetPartStates(); + int32_t dwStates = GetPartStates(); { CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; @@ -197,7 +197,7 @@ FWL_ERR CFWL_CheckBoxImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix * { CFX_WideString wsCaption; m_pProperties->m_pDataProvider->GetCaption(m_pInterface, wsCaption); - FX_INT32 iLen = wsCaption.GetLength(); + int32_t iLen = wsCaption.GetLength(); _FWL_RETURN_VALUE_IF_FAIL(iLen > 0, FWL_ERR_Indefinite); CFWL_ThemeText textParam; textParam.m_pWidget = m_pInterface; @@ -215,7 +215,7 @@ FWL_ERR CFWL_CheckBoxImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix * } return FWL_ERR_Succeeded; } -FX_INT32 CFWL_CheckBoxImp::GetCheckState() +int32_t CFWL_CheckBoxImp::GetCheckState() { if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_3State) && ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == FWL_STATE_CKB_Neutral)) { @@ -226,7 +226,7 @@ FX_INT32 CFWL_CheckBoxImp::GetCheckState() } return 0; } -FWL_ERR CFWL_CheckBoxImp::SetCheckState(FX_INT32 iCheck) +FWL_ERR CFWL_CheckBoxImp::SetCheckState(int32_t iCheck) { m_pProperties->m_dwStates &= ~FWL_STATE_CKB_CheckMask; switch(iCheck) { @@ -251,8 +251,8 @@ FWL_ERR CFWL_CheckBoxImp::SetCheckState(FX_INT32 iCheck) } void CFWL_CheckBoxImp::Layout() { - FX_INT32 width = FX_INT32(m_pProperties->m_rtWidget.width + 0.5f); - FX_INT32 height = FX_INT32(m_pProperties->m_rtWidget.height + 0.5f); + int32_t width = int32_t(m_pProperties->m_rtWidget.width + 0.5f); + int32_t height = int32_t(m_pProperties->m_rtWidget.height + 0.5f); m_pProperties->m_rtWidget.width = (FX_FLOAT)width; m_pProperties->m_rtWidget.height = (FX_FLOAT)height; GetClientRect(m_rtClient); @@ -322,7 +322,7 @@ void CFWL_CheckBoxImp::Layout() } FX_DWORD CFWL_CheckBoxImp::GetPartStates() { - FX_INT32 dwStates = FWL_PARTSTATE_CKB_UnChecked; + int32_t dwStates = FWL_PARTSTATE_CKB_UnChecked; if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == FWL_STATE_CKB_Neutral) { dwStates = FWL_PARTSTATE_CKB_Neutral; } else if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == FWL_STATE_CKB_Checked) { @@ -406,8 +406,8 @@ void CFWL_CheckBoxImp::NextStates() CFX_PtrArray radioarr; pWidgetMgr->GetSameGroupRadioButton(m_pInterface, radioarr); IFWL_CheckBox *pCheckBox = NULL; - FX_INT32 iCount = radioarr.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = radioarr.GetSize(); + for (int32_t i = 0; i < iCount; i++) { pCheckBox = (IFWL_CheckBox *)radioarr[i]; if (pCheckBox != m_pInterface && pCheckBox->GetStates() & FWL_STATE_CKB_Checked) { pCheckBox->SetCheckState(0); @@ -449,11 +449,11 @@ CFWL_CheckBoxImpDelegate::CFWL_CheckBoxImpDelegate(CFWL_CheckBoxImp *pOwner) : m_pOwner(pOwner) { } -FX_INT32 CFWL_CheckBoxImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_CheckBoxImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); FX_DWORD dwMsgCode = pMessage->GetClassID(); - FX_INT32 iRet = 1; + int32_t iRet = 1; switch (dwMsgCode) { case FWL_MSGHASH_Activate: { OnActivate(pMessage); diff --git a/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp index 0200f92eaa..5658f87e13 100644 --- a/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_comboboximp.cpp @@ -45,11 +45,11 @@ FWL_ERR IFWL_ComboBox::Initialize(const CFWL_WidgetImpProperties &properties, IF ((CFWL_ComboBoxImp*)m_pData)->SetInterface(this); return ((CFWL_ComboBoxImp*)m_pData)->Initialize(); } -FX_INT32 IFWL_ComboBox::GetCurSel() +int32_t IFWL_ComboBox::GetCurSel() { return ((CFWL_ComboBoxImp*)m_pData)->GetCurSel(); } -FWL_ERR IFWL_ComboBox::SetCurSel(FX_INT32 iSel) +FWL_ERR IFWL_ComboBox::SetCurSel(int32_t iSel) { return ((CFWL_ComboBoxImp*)m_pData)->SetCurSel(iSel); } @@ -57,31 +57,31 @@ FWL_ERR IFWL_ComboBox::SetEditText(const CFX_WideString &wsText) { return ((CFWL_ComboBoxImp*)m_pData)->SetEditText(wsText); } -FX_INT32 IFWL_ComboBox::GetEditTextLength() const +int32_t IFWL_ComboBox::GetEditTextLength() const { return ((CFWL_ComboBoxImp*)m_pData)->GetEditTextLength(); } -FWL_ERR IFWL_ComboBox::GetEditText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount) const +FWL_ERR IFWL_ComboBox::GetEditText(CFX_WideString &wsText, int32_t nStart, int32_t nCount) const { return ((CFWL_ComboBoxImp*)m_pData)->GetEditText(wsText, nStart, nCount); } -FWL_ERR IFWL_ComboBox::SetEditSelRange(FX_INT32 nStart, FX_INT32 nCount) +FWL_ERR IFWL_ComboBox::SetEditSelRange(int32_t nStart, int32_t nCount) { return ((CFWL_ComboBoxImp*)m_pData)->SetEditSelRange(nStart, nCount); } -FX_INT32 IFWL_ComboBox::GetEditSelRange(FX_INT32 nIndex, FX_INT32 &nStart) +int32_t IFWL_ComboBox::GetEditSelRange(int32_t nIndex, int32_t &nStart) { return ((CFWL_ComboBoxImp*)m_pData)->GetEditSelRange(nIndex, nStart); } -FX_INT32 IFWL_ComboBox::GetEditLimit() +int32_t IFWL_ComboBox::GetEditLimit() { return ((CFWL_ComboBoxImp*)m_pData)->GetEditLimit(); } -FWL_ERR IFWL_ComboBox::SetEditLimit(FX_INT32 nLimit) +FWL_ERR IFWL_ComboBox::SetEditLimit(int32_t nLimit) { return ((CFWL_ComboBoxImp*)m_pData)->SetEditLimit(nLimit); } -FWL_ERR IFWL_ComboBox::EditDoClipboard(FX_INT32 iCmd) +FWL_ERR IFWL_ComboBox::EditDoClipboard(int32_t iCmd) { return ((CFWL_ComboBoxImp*)m_pData)->EditDoClipboard(iCmd); } @@ -185,7 +185,7 @@ CFWL_ComboEditDelegate::CFWL_ComboEditDelegate(CFWL_ComboEdit *pOwner) , m_pOwner(pOwner) { } -FX_INT32 CFWL_ComboEditDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_ComboEditDelegate::OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); FX_DWORD dwMsgCode = pMessage->GetClassID(); @@ -276,15 +276,15 @@ FWL_ERR CFWL_ComboList::Finalize() } return CFWL_ListBoxImp::Finalize(); } -FX_INT32 CFWL_ComboList::MatchItem(const CFX_WideString &wsMatch) +int32_t CFWL_ComboList::MatchItem(const CFX_WideString &wsMatch) { if (wsMatch.IsEmpty()) { return -1; } _FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pDataProvider, -1); IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 iCount = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < iCount; i ++) { FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); CFX_WideString wsText; pData->GetItemText(m_pInterface, hItem, wsText); @@ -295,7 +295,7 @@ FX_INT32 CFWL_ComboList::MatchItem(const CFX_WideString &wsMatch) } return -1; } -void CFWL_ComboList::ChangeSelected(FX_INT32 iSel) +void CFWL_ComboList::ChangeSelected(int32_t iSel) { _FWL_RETURN_IF_FAIL(m_pProperties->m_pDataProvider); IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; @@ -303,7 +303,7 @@ void CFWL_ComboList::ChangeSelected(FX_INT32 iSel) CFX_RectF rtInvalidate; rtInvalidate.Reset(); FWL_HLISTITEM hOld = GetSelItem(0); - FX_INT32 iOld = pData->GetItemIndex(m_pInterface, hOld); + int32_t iOld = pData->GetItemIndex(m_pInterface, hOld); if (iOld == iSel) { return; } else if (iOld > -1) { @@ -321,13 +321,13 @@ void CFWL_ComboList::ChangeSelected(FX_INT32 iSel) Repaint(&rtInvalidate); } } -FX_INT32 CFWL_ComboList::CountItems() +int32_t CFWL_ComboList::CountItems() { _FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pDataProvider, 0); IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; return pData->CountItems(m_pInterface); } -void CFWL_ComboList::GetItemRect(FX_INT32 nIndex, CFX_RectF &rtItem) +void CFWL_ComboList::GetItemRect(int32_t nIndex, CFX_RectF &rtItem) { IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, nIndex); @@ -349,7 +349,7 @@ CFWL_ComboListDelegate::CFWL_ComboListDelegate(CFWL_ComboList *pOwner) , m_pOwner(pOwner) { } -FX_INT32 CFWL_ComboListDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_ComboListDelegate::OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); FX_DWORD dwHashCode = pMessage->GetClassID(); @@ -407,7 +407,7 @@ void CFWL_ComboListDelegate::OnDropListFocusChanged(CFWL_Message *pMsg, FX_BOOL } } } -FX_INT32 CFWL_ComboListDelegate::OnDropListMouseMove(CFWL_MsgMouse *pMsg) +int32_t CFWL_ComboListDelegate::OnDropListMouseMove(CFWL_MsgMouse *pMsg) { if (m_pOwner->m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) { if (m_pOwner->m_bNotifyOwner) { @@ -424,7 +424,7 @@ FX_INT32 CFWL_ComboListDelegate::OnDropListMouseMove(CFWL_MsgMouse *pMsg) if (hItem) { _FWL_RETURN_VALUE_IF_FAIL(m_pOwner->m_pProperties->m_pDataProvider, 0); IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pOwner->m_pProperties->m_pDataProvider; - FX_INT32 iSel = pData->GetItemIndex(m_pOwner->m_pInterface, hItem); + int32_t iSel = pData->GetItemIndex(m_pOwner->m_pInterface, hItem); CFWL_EvtCmbHoverChanged event; event.m_pSrcTarget = m_pOwner->m_pOuter; event.m_iCurHover = iSel; @@ -438,7 +438,7 @@ FX_INT32 CFWL_ComboListDelegate::OnDropListMouseMove(CFWL_MsgMouse *pMsg) } return 1; } -FX_INT32 CFWL_ComboListDelegate::OnDropListLButtonDown(CFWL_MsgMouse *pMsg) +int32_t CFWL_ComboListDelegate::OnDropListLButtonDown(CFWL_MsgMouse *pMsg) { if (m_pOwner->m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) { return 0; @@ -447,7 +447,7 @@ FX_INT32 CFWL_ComboListDelegate::OnDropListLButtonDown(CFWL_MsgMouse *pMsg) pOuter->ShowDropList(FALSE); return 1; } -FX_INT32 CFWL_ComboListDelegate::OnDropListLButtonUp(CFWL_MsgMouse *pMsg) +int32_t CFWL_ComboListDelegate::OnDropListLButtonUp(CFWL_MsgMouse *pMsg) { CFWL_ComboBoxImp *pOuter = (CFWL_ComboBoxImp*)((IFWL_TargetData*)m_pOwner->m_pOuter)->GetData(); if (m_pOwner->m_bNotifyOwner) { @@ -469,7 +469,7 @@ FX_INT32 CFWL_ComboListDelegate::OnDropListLButtonUp(CFWL_MsgMouse *pMsg) } return 1; } -FX_INT32 CFWL_ComboListDelegate::OnDropListKey(CFWL_MsgKey *pKey) +int32_t CFWL_ComboListDelegate::OnDropListKey(CFWL_MsgKey *pKey) { CFWL_ComboBoxImp *pOuter = (CFWL_ComboBoxImp*)((IFWL_TargetData*)m_pOwner->m_pOuter)->GetData(); FX_BOOL bPropagate = FALSE; @@ -783,13 +783,13 @@ FWL_ERR CFWL_ComboBoxImp::SetThemeProvider(IFWL_ThemeProvider *pThemeProvider) } return FWL_ERR_Succeeded; } -FX_INT32 CFWL_ComboBoxImp::GetCurSel() +int32_t CFWL_ComboBoxImp::GetCurSel() { return m_iCurSel; } -FWL_ERR CFWL_ComboBoxImp::SetCurSel(FX_INT32 iSel) +FWL_ERR CFWL_ComboBoxImp::SetCurSel(int32_t iSel) { - FX_INT32 iCount = ((CFWL_ComboList*)((IFWL_TargetData*)m_pListBox)->GetData())->CountItems(); + int32_t iCount = ((CFWL_ComboList*)((IFWL_TargetData*)m_pListBox)->GetData())->CountItems(); FX_BOOL bClearSel = iSel < 0 || iSel >= iCount; FX_BOOL bDropDown = IsDropDownStyle(); if (bDropDown && m_pEdit) { @@ -824,12 +824,12 @@ FWL_ERR CFWL_ComboBoxImp::SetEditText(const CFX_WideString &wsText) m_pEdit->SetText(wsText); return m_pEdit->Update(); } -FX_INT32 CFWL_ComboBoxImp::GetEditTextLength() const +int32_t CFWL_ComboBoxImp::GetEditTextLength() const { _FWL_RETURN_VALUE_IF_FAIL(m_pEdit, -1); return m_pEdit->GetTextLength(); } -FWL_ERR CFWL_ComboBoxImp::GetEditText(CFX_WideString &wsText, FX_INT32 nStart , FX_INT32 nCount ) const +FWL_ERR CFWL_ComboBoxImp::GetEditText(CFX_WideString &wsText, int32_t nStart , int32_t nCount ) const { if (m_pEdit) { return m_pEdit->GetText(wsText, nStart, nCount); @@ -840,29 +840,29 @@ FWL_ERR CFWL_ComboBoxImp::GetEditText(CFX_WideString &wsText, FX_INT32 nStart , } return FWL_ERR_Indefinite; } -FWL_ERR CFWL_ComboBoxImp::SetEditSelRange(FX_INT32 nStart, FX_INT32 nCount ) +FWL_ERR CFWL_ComboBoxImp::SetEditSelRange(int32_t nStart, int32_t nCount ) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdit, FWL_ERR_Indefinite); ((CFWL_ComboEdit*)((IFWL_TargetData*)m_pEdit)->GetData())->ClearSelected(); m_pEdit->AddSelRange(nStart, nCount); return FWL_ERR_Succeeded; } -FX_INT32 CFWL_ComboBoxImp::GetEditSelRange(FX_INT32 nIndex, FX_INT32 &nStart) +int32_t CFWL_ComboBoxImp::GetEditSelRange(int32_t nIndex, int32_t &nStart) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdit, -1); return m_pEdit->GetSelRange(nIndex, nStart); } -FX_INT32 CFWL_ComboBoxImp::GetEditLimit() +int32_t CFWL_ComboBoxImp::GetEditLimit() { _FWL_RETURN_VALUE_IF_FAIL(m_pEdit, -1); return m_pEdit->GetLimit(); } -FWL_ERR CFWL_ComboBoxImp::SetEditLimit(FX_INT32 nLimit) +FWL_ERR CFWL_ComboBoxImp::SetEditLimit(int32_t nLimit) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdit, FWL_ERR_Indefinite); return m_pEdit->SetLimit(nLimit); } -FWL_ERR CFWL_ComboBoxImp::EditDoClipboard(FX_INT32 iCmd) +FWL_ERR CFWL_ComboBoxImp::EditDoClipboard(int32_t iCmd) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdit, FWL_ERR_Indefinite); return m_pEdit->DoClipboard(iCmd); @@ -1080,7 +1080,7 @@ void CFWL_ComboBoxImp::MatchEditText() { CFX_WideString wsText; m_pEdit->GetText(wsText); - FX_INT32 iMatch = ((CFWL_ComboList*)((IFWL_TargetData*)m_pListBox)->GetData())->MatchItem(wsText); + int32_t iMatch = ((CFWL_ComboList*)((IFWL_TargetData*)m_pListBox)->GetData())->MatchItem(wsText); if (iMatch != m_iCurSel) { ((CFWL_ComboList*)((IFWL_TargetData*)m_pListBox)->GetData())->ChangeSelected(iMatch); if (iMatch >= 0) { @@ -1091,7 +1091,7 @@ void CFWL_ComboBoxImp::MatchEditText() } m_iCurSel = iMatch; } -void CFWL_ComboBoxImp::SynchrEditText(FX_INT32 iListItem) +void CFWL_ComboBoxImp::SynchrEditText(int32_t iListItem) { CFX_WideString wsText; IFWL_ComboBoxDP *pData = (IFWL_ComboBoxDP *)m_pProperties->m_pDataProvider; @@ -1301,7 +1301,7 @@ void CFWL_ComboBoxImp::DisForm_ShowDropList(FX_BOOL bActivate) preEvent.m_pSrcTarget = m_pInterface; DispatchEvent(&preEvent); CFWL_ComboList* pComboList = (CFWL_ComboList*)(((IFWL_TargetData*)m_pListBox)->GetData()); - FX_INT32 iItems = pComboList->CountItems(); + int32_t iItems = pComboList->CountItems(); if (iItems < 1) { return; } @@ -1482,7 +1482,7 @@ CFWL_ComboBoxImpDelegate::CFWL_ComboBoxImpDelegate(CFWL_ComboBoxImp *pOwner) : m_pOwner(pOwner) { } -FX_INT32 CFWL_ComboBoxImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_ComboBoxImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) { return DisForm_OnProcessMessage(pMessage); @@ -1620,7 +1620,7 @@ void CFWL_ComboBoxImpDelegate::OnLButtonUp(CFWL_MsgMouse *pMsg) } void CFWL_ComboBoxImpDelegate::OnMouseMove(CFWL_MsgMouse *pMsg) { - FX_INT32 iOldState = m_pOwner->m_iBtnState; + int32_t iOldState = m_pOwner->m_iBtnState; if (m_pOwner->m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { m_pOwner->m_iBtnState = m_pOwner->m_bLButtonDown ? FWL_PARTSTATE_CMB_Pressed : FWL_PARTSTATE_CMB_Hovered; } else { @@ -1657,12 +1657,12 @@ void CFWL_ComboBoxImpDelegate::DoSubCtrlKey(CFWL_MsgKey *pMsg) FX_BOOL bUp = dwKeyCode == FWL_VKEY_Up; FX_BOOL bDown = dwKeyCode == FWL_VKEY_Down; if (bUp || bDown) { - FX_INT32 iCount = ((CFWL_ComboList*)((IFWL_TargetData*)m_pOwner->m_pListBox)->GetData())->CountItems(); + int32_t iCount = ((CFWL_ComboList*)((IFWL_TargetData*)m_pOwner->m_pListBox)->GetData())->CountItems(); if (iCount < 1) { return; } FX_BOOL bMatchEqual = FALSE; - FX_INT32 iCurSel = m_pOwner->m_iCurSel; + int32_t iCurSel = m_pOwner->m_iCurSel; FX_BOOL bDropDown = m_pOwner->IsDropDownStyle(); if (bDropDown && m_pOwner->m_pEdit) { CFX_WideString wsText; @@ -1702,7 +1702,7 @@ void CFWL_ComboBoxImpDelegate::DoSubCtrlKey(CFWL_MsgKey *pMsg) pDelegate->OnProcessMessage(pMsg); } } -FX_INT32 CFWL_ComboBoxImpDelegate::DisForm_OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_ComboBoxImpDelegate::DisForm_OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); FX_DWORD dwMsgCode = pMessage->GetClassID(); @@ -1810,12 +1810,12 @@ void CFWL_ComboBoxImpDelegate::DisForm_OnKey(CFWL_MsgKey *pMsg) FX_BOOL bDown = dwKeyCode == FWL_VKEY_Down; if (bUp || bDown) { CFWL_ComboList* pComboList = ((CFWL_ComboList*)((IFWL_TargetData*)(m_pOwner->m_pListBox))->GetData()); - FX_INT32 iCount = pComboList->CountItems(); + int32_t iCount = pComboList->CountItems(); if (iCount < 1) { return; } FX_BOOL bMatchEqual = FALSE; - FX_INT32 iCurSel = m_pOwner->m_iCurSel; + int32_t iCurSel = m_pOwner->m_iCurSel; if (m_pOwner->m_pEdit) { CFX_WideString wsText; m_pOwner->m_pEdit->GetText(wsText); @@ -1856,7 +1856,7 @@ CFWL_ComboProxyImpDelegate::CFWL_ComboProxyImpDelegate(IFWL_Form *pForm, CFWL_Co , m_fStartPos(0) { } -FX_INT32 CFWL_ComboProxyImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_ComboProxyImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); FX_DWORD dwMsgCode = pMessage->GetClassID(); diff --git a/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp b/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp index b3e3b45dae..c9f3367114 100644 --- a/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp @@ -62,19 +62,19 @@ FWL_ERR IFWL_DateTimePicker::Initialize(const CFWL_WidgetImpProperties &properti ((CFWL_DateTimePickerImp*)m_pData)->SetInterface(this); return ((CFWL_DateTimePickerImp*)m_pData)->Initialize(); } -FX_INT32 IFWL_DateTimePicker::CountSelRanges() +int32_t IFWL_DateTimePicker::CountSelRanges() { return ((CFWL_DateTimePickerImp*)m_pData)->GetDataTimeEdit()->CountSelRanges(); } -FX_INT32 IFWL_DateTimePicker::GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart) +int32_t IFWL_DateTimePicker::GetSelRange(int32_t nIndex, int32_t &nStart) { return ((CFWL_DateTimePickerImp*)m_pData)->GetDataTimeEdit()->GetSelRange(nIndex, nStart); } -FWL_ERR IFWL_DateTimePicker::GetCurSel(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay) +FWL_ERR IFWL_DateTimePicker::GetCurSel(int32_t &iYear, int32_t &iMonth, int32_t &iDay) { return ((CFWL_DateTimePickerImp*)m_pData)->GetCurSel(iYear, iMonth, iDay); } -FWL_ERR IFWL_DateTimePicker::SetCurSel(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) +FWL_ERR IFWL_DateTimePicker::SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay) { return ((CFWL_DateTimePickerImp*)m_pData)->SetCurSel(iYear, iMonth, iDay); } @@ -82,7 +82,7 @@ FWL_ERR IFWL_DateTimePicker::SetEditText(const CFX_WideString &wsText) { return ((CFWL_DateTimePickerImp*)m_pData)->SetEditText(wsText); } -FWL_ERR IFWL_DateTimePicker::GetEditText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount) const +FWL_ERR IFWL_DateTimePicker::GetEditText(CFX_WideString &wsText, int32_t nStart, int32_t nCount) const { return ((CFWL_DateTimePickerImp*)m_pData)->GetEditText(wsText, nStart, nCount); } @@ -142,7 +142,7 @@ FWL_ERR IFWL_DateTimePicker::GetBBox(CFX_RectF &rect) { return ((CFWL_DateTimePickerImp*)m_pData)->GetBBox(rect); } -FWL_ERR IFWL_DateTimePicker::SetEditLimit(FX_INT32 nLimit) +FWL_ERR IFWL_DateTimePicker::SetEditLimit(int32_t nLimit) { return ((CFWL_DateTimePickerImp*)m_pData)->SetEditLimit(nLimit); } @@ -173,7 +173,7 @@ CFWL_DateTimeEditDelegate::CFWL_DateTimeEditDelegate(CFWL_DateTimeEdit *pOwner) , m_pOwner(pOwner) { } -FX_INT32 CFWL_DateTimeEditDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_DateTimeEditDelegate::OnProcessMessage(CFWL_Message *pMessage) { if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) { return DisForm_OnProcessMessage(pMessage); @@ -186,7 +186,7 @@ FX_INT32 CFWL_DateTimeEditDelegate::OnProcessMessage(CFWL_Message *pMessage) } return 1; } -FX_INT32 CFWL_DateTimeEditDelegate::DisForm_OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_DateTimeEditDelegate::DisForm_OnProcessMessage(CFWL_Message *pMessage) { FX_DWORD dwHashCode = pMessage->GetClassID(); if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) { @@ -238,7 +238,7 @@ CFWL_DateTimeCalendarDelegate::CFWL_DateTimeCalendarDelegate(CFWL_DateTimeCalend { m_bFlag = FALSE; } -FX_INT32 CFWL_DateTimeCalendarDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_DateTimeCalendarDelegate::OnProcessMessage(CFWL_Message *pMessage) { FX_DWORD dwCode = pMessage->GetClassID(); if (dwCode == FWL_MSGHASH_SetFocus || dwCode == FWL_MSGHASH_KillFocus) { @@ -298,11 +298,11 @@ void CFWL_DateTimeCalendarDelegate::OnLButtonUpEx(CFWL_MsgMouse *pMsg) if (m_pOwner->m_rtToday.Contains(pMsg->m_fx, pMsg->m_fy)) { return; } - FX_INT32 iOldSel = 0; + int32_t iOldSel = 0; if (m_pOwner->m_arrSelDays.GetSize() > 0) { iOldSel = m_pOwner->m_arrSelDays[0]; } - FX_INT32 iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); + int32_t iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); CFX_RectF rt; IFWL_DateTimePicker *pIPicker = (IFWL_DateTimePicker *)m_pOwner->m_pOuter; CFWL_DateTimePickerImp *pPicker = (CFWL_DateTimePickerImp *)((IFWL_TargetData *)pIPicker)->GetData(); @@ -335,7 +335,7 @@ void CFWL_DateTimeCalendarDelegate::OnMouseMoveEx(CFWL_MsgMouse *pMsg) CFX_RectF rtInvalidate; rtInvalidate.Set(0, 0, 0, 0); if (m_pOwner->m_rtDates.Contains(pMsg->m_fx, pMsg->m_fy)) { - FX_INT32 iHover = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); + int32_t iHover = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); bRepaint = m_pOwner->m_iHovered != iHover; if (bRepaint) { if (m_pOwner->m_iHovered > 0) { @@ -366,7 +366,7 @@ void CFWL_DateTimeCalendarDelegate::OnMouseMoveEx(CFWL_MsgMouse *pMsg) m_pOwner->Repaint(&rtInvalidate); } } -FX_INT32 CFWL_DateTimeCalendarDelegate::DisForm_OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_DateTimeCalendarDelegate::DisForm_OnProcessMessage(CFWL_Message *pMessage) { if (pMessage->GetClassID() == FWL_MSGHASH_Mouse) { CFWL_MsgMouse *pMsg = (CFWL_MsgMouse*)pMessage; @@ -392,11 +392,11 @@ void CFWL_DateTimeCalendarDelegate::DisForm_OnLButtonUpEx(CFWL_MsgMouse *pMsg) if (m_pOwner->m_rtToday.Contains(pMsg->m_fx, pMsg->m_fy)) { return; } - FX_INT32 iOldSel = 0; + int32_t iOldSel = 0; if (m_pOwner->m_arrSelDays.GetSize() > 0) { iOldSel = m_pOwner->m_arrSelDays[0]; } - FX_INT32 iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); + int32_t iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); if (iCurSel > 0) { LPDATEINFO lpDatesInfo = (LPDATEINFO)m_pOwner->m_arrDates.GetAt(iCurSel - 1); CFX_RectF rtInvalidate(lpDatesInfo->rect); @@ -599,14 +599,14 @@ FWL_ERR CFWL_DateTimePickerImp::SetThemeProvider(IFWL_ThemeProvider *pTP) m_pMonthCal->SetThemeProvider(pTP); return FWL_ERR_Succeeded; } -FWL_ERR CFWL_DateTimePickerImp::GetCurSel(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay) +FWL_ERR CFWL_DateTimePickerImp::GetCurSel(int32_t &iYear, int32_t &iMonth, int32_t &iDay) { iYear = m_iYear; iMonth = m_iMonth; iDay = m_iDay; return FWL_ERR_Succeeded; } -FWL_ERR CFWL_DateTimePickerImp::SetCurSel(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) +FWL_ERR CFWL_DateTimePickerImp::SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay) { _FWL_RETURN_VALUE_IF_FAIL(iYear > 0 && iYear < 3000, FWL_ERR_Indefinite); _FWL_RETURN_VALUE_IF_FAIL(iMonth > 0 && iMonth < 13, FWL_ERR_Indefinite); @@ -620,14 +620,14 @@ FWL_ERR CFWL_DateTimePickerImp::SetCurSel(FX_INT32 iYear, FX_INT32 iMonth, FX_IN FWL_ERR CFWL_DateTimePickerImp::SetEditText(const CFX_WideString &wsText) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdit, FWL_ERR_Indefinite); - FX_INT32 iRet = m_pEdit->SetText(wsText); + int32_t iRet = m_pEdit->SetText(wsText); Repaint(&m_rtClient); CFWL_Event_DtpEditChanged ev; ev.m_wsText = wsText; DispatchEvent(&ev); return iRet; } -FWL_ERR CFWL_DateTimePickerImp::GetEditText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount) const +FWL_ERR CFWL_DateTimePickerImp::GetEditText(CFX_WideString &wsText, int32_t nStart, int32_t nCount) const { if (m_pEdit) { return m_pEdit->GetText(wsText, nStart, nCount); @@ -652,7 +652,7 @@ FX_BOOL CFWL_DateTimePickerImp::Redo() } FX_BOOL CFWL_DateTimePickerImp::CanCopy() { - FX_INT32 nCount = m_pEdit->CountSelRanges(); + int32_t nCount = m_pEdit->CountSelRanges(); return nCount > 0; } FX_BOOL CFWL_DateTimePickerImp::CanCut() @@ -660,7 +660,7 @@ FX_BOOL CFWL_DateTimePickerImp::CanCut() if (m_pEdit->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly) { return FALSE; } - FX_INT32 nCount = m_pEdit->CountSelRanges(); + int32_t nCount = m_pEdit->CountSelRanges(); return nCount > 0; } FX_BOOL CFWL_DateTimePickerImp::CanSelectAll() @@ -705,7 +705,7 @@ FWL_ERR CFWL_DateTimePickerImp::GetBBox(CFX_RectF &rect) } return FWL_ERR_Succeeded; } -FWL_ERR CFWL_DateTimePickerImp::SetEditLimit(FX_INT32 nLimit) +FWL_ERR CFWL_DateTimePickerImp::SetEditLimit(int32_t nLimit) { return m_pEdit->SetLimit(nLimit); } @@ -735,7 +735,7 @@ void CFWL_DateTimePickerImp::DrawDropDownButton(CFX_Graphics *pGraphics, IFWL_Th pTheme->DrawBackground(¶m); } } -void CFWL_DateTimePickerImp::FormatDateString(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay, CFX_WideString &wsText) +void CFWL_DateTimePickerImp::FormatDateString(int32_t iYear, int32_t iMonth, int32_t iDay, CFX_WideString &wsText) { if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_ShortDateFormat) == FWL_STYLEEXT_DTP_ShortDateFormat) { wsText.Format(FX_LPCWSTR(L"%d-%d-%d"), iYear, iMonth, iDay); @@ -823,7 +823,7 @@ void CFWL_DateTimePickerImp::ReSetEditAlignment() FWL_STYLEEXT_EDT_HAlignModeMask | FWL_STYLEEXT_EDT_VAlignMask); } -void CFWL_DateTimePickerImp::ProcessSelChanged(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) +void CFWL_DateTimePickerImp::ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay) { m_iYear = iYear; m_iMonth = iMonth; @@ -1054,11 +1054,11 @@ CFWL_DateTimePickerImpDelegate::CFWL_DateTimePickerImpDelegate(CFWL_DateTimePick : m_pOwner(pOwner) { } -FX_INT32 CFWL_DateTimePickerImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_DateTimePickerImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); FX_DWORD dwMsgCode = pMessage->GetClassID(); - FX_INT32 iRet = 1; + int32_t iRet = 1; switch (dwMsgCode) { case FWL_MSGHASH_SetFocus: case FWL_MSGHASH_KillFocus: { diff --git a/xfa/src/fwl/src/basewidget/fwl_editimp.cpp b/xfa/src/fwl/src/basewidget/fwl_editimp.cpp index c7bd922fc1..0afa1d5467 100644 --- a/xfa/src/fwl/src/basewidget/fwl_editimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_editimp.cpp @@ -45,11 +45,11 @@ FWL_ERR IFWL_Edit::SetText(const CFX_WideString &wsText) { return ((CFWL_EditImp*)m_pData)->SetText(wsText); } -FX_INT32 IFWL_Edit::GetTextLength() const +int32_t IFWL_Edit::GetTextLength() const { return ((CFWL_EditImp*)m_pData)->GetTextLength(); } -FWL_ERR IFWL_Edit::GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount) const +FWL_ERR IFWL_Edit::GetText(CFX_WideString &wsText, int32_t nStart, int32_t nCount) const { return ((CFWL_EditImp*)m_pData)->GetText(wsText, nStart, nCount); } @@ -57,23 +57,23 @@ FWL_ERR IFWL_Edit::ClearText() { return ((CFWL_EditImp*)m_pData)->ClearText(); } -FX_INT32 IFWL_Edit::GetCaretPos() const +int32_t IFWL_Edit::GetCaretPos() const { return ((CFWL_EditImp*)m_pData)->GetCaretPos(); } -FX_INT32 IFWL_Edit::SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore) +int32_t IFWL_Edit::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) { return ((CFWL_EditImp*)m_pData)->SetCaretPos(nIndex, bBefore); } -FWL_ERR IFWL_Edit::AddSelRange(FX_INT32 nStart, FX_INT32 nCount) +FWL_ERR IFWL_Edit::AddSelRange(int32_t nStart, int32_t nCount) { return ((CFWL_EditImp*)m_pData)->AddSelRange(nStart, nCount); } -FX_INT32 IFWL_Edit::CountSelRanges() +int32_t IFWL_Edit::CountSelRanges() { return ((CFWL_EditImp*)m_pData)->CountSelRanges(); } -FX_INT32 IFWL_Edit::GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart) +int32_t IFWL_Edit::GetSelRange(int32_t nIndex, int32_t &nStart) { return ((CFWL_EditImp*)m_pData)->GetSelRange(nIndex, nStart); } @@ -81,11 +81,11 @@ FWL_ERR IFWL_Edit::ClearSelections() { return ((CFWL_EditImp*)m_pData)->ClearSelections(); } -FX_INT32 IFWL_Edit::GetLimit() +int32_t IFWL_Edit::GetLimit() { return ((CFWL_EditImp*)m_pData)->GetLimit(); } -FWL_ERR IFWL_Edit::SetLimit(FX_INT32 nLimit) +FWL_ERR IFWL_Edit::SetLimit(int32_t nLimit) { return ((CFWL_EditImp*)m_pData)->SetLimit(nLimit); } @@ -97,7 +97,7 @@ FWL_ERR IFWL_Edit::SetFormatString(const CFX_WideString &wsFormat) { return ((CFWL_EditImp*)m_pData)->SetFormatString(wsFormat); } -FWL_ERR IFWL_Edit::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLen) +FWL_ERR IFWL_Edit::Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLen) { return ((CFWL_EditImp*)m_pData)->Insert(nStart, lpText, nLen); } @@ -105,7 +105,7 @@ FWL_ERR IFWL_Edit::DeleteSelections() { return ((CFWL_EditImp*)m_pData)->DeleteSelections(); } -FWL_ERR IFWL_Edit::DeleteRange(FX_INT32 nStart, FX_INT32 nCount) +FWL_ERR IFWL_Edit::DeleteRange(int32_t nStart, int32_t nCount) { return ((CFWL_EditImp*)m_pData)->DeleteRange(nStart, nCount); } @@ -113,11 +113,11 @@ FWL_ERR IFWL_Edit::ReplaceSelections(const CFX_WideStringC &wsReplace) { return ((CFWL_EditImp*)m_pData)->ReplaceSelections(wsReplace); } -FWL_ERR IFWL_Edit::Replace(FX_INT32 nStart, FX_INT32 nLen, const CFX_WideStringC &wsReplace) +FWL_ERR IFWL_Edit::Replace(int32_t nStart, int32_t nLen, const CFX_WideStringC &wsReplace) { return ((CFWL_EditImp*)m_pData)->Replace(nStart, nLen, wsReplace); } -FWL_ERR IFWL_Edit::DoClipboard(FX_INT32 iCmd) +FWL_ERR IFWL_Edit::DoClipboard(int32_t iCmd) { return ((CFWL_EditImp*)m_pData)->DoClipboard(iCmd); } @@ -169,7 +169,7 @@ FWL_ERR IFWL_Edit::SetOuter(IFWL_Widget *pOuter) { return ((CFWL_EditImp*)m_pData)->SetOuter(pOuter); } -FWL_ERR IFWL_Edit::SetNumberRange(FX_INT32 iMin, FX_INT32 iMax) +FWL_ERR IFWL_Edit::SetNumberRange(int32_t iMin, int32_t iMax) { return ((CFWL_EditImp*)m_pData)->SetNumberRange(iMin, iMax); } @@ -313,7 +313,7 @@ FWL_ERR CFWL_EditImp::GetWidgetRect(CFX_RectF &rect, FX_BOOL bAutoSize ) if (bAutoSize) { rect.Set(0, 0, 0, 0); if (m_pEdtEngine) { - FX_INT32 iTextLen = m_pEdtEngine->GetTextLength(); + int32_t iTextLen = m_pEdtEngine->GetTextLength(); if (iTextLen > 0) { CFX_WideString wsText; m_pEdtEngine->GetText(wsText, 0); @@ -398,12 +398,12 @@ static void AddSquigglyPath(CFX_Path& PathData, FX_FLOAT fStartX, FX_FLOAT fEndX { PathData.MoveTo(fStartX, fY); FX_FLOAT fx; - FX_INT32 i; + int32_t i; for (i = 1, fx = fStartX + fStep; fx < fEndX; fx += fStep, i++) { PathData.LineTo(fx, fY + (i & 1)*fStep); } } -void CFWL_EditImp::AddSpellCheckObj(CFX_Path& PathData, FX_INT32 nStart, FX_INT32 nCount, FX_FLOAT fOffSetX, FX_FLOAT fOffSetY) +void CFWL_EditImp::AddSpellCheckObj(CFX_Path& PathData, int32_t nStart, int32_t nCount, FX_FLOAT fOffSetX, FX_FLOAT fOffSetY) { FX_FLOAT fStartX = 0.0f; FX_FLOAT fEndX = 0.0f; @@ -424,14 +424,14 @@ void CFWL_EditImp::AddSpellCheckObj(CFX_Path& PathData, FX_INT32 nStart, FX_INT3 AddSquigglyPath(PathData, fStartX, fEndX, fY, fStep); } } -FX_INT32 CFWL_EditImp::GetWordAtPoint(CFX_PointF pointf, FX_INT32& nCount) +int32_t CFWL_EditImp::GetWordAtPoint(CFX_PointF pointf, int32_t& nCount) { return 0; } FX_BOOL CFWL_EditImp::GetSuggestWords(CFX_PointF pointf, CFX_ByteStringArray &sSuggest) { - FX_INT32 nWordCount = 0; - FX_INT32 nWordStart = GetWordAtPoint(pointf, nWordCount); + int32_t nWordCount = 0; + int32_t nWordStart = GetWordAtPoint(pointf, nWordCount); if (nWordCount < 1) { return FALSE; } @@ -465,8 +465,8 @@ FX_BOOL CFWL_EditImp::GetSuggestWords(CFX_PointF pointf, CFX_ByteStringArray &sS } FX_BOOL CFWL_EditImp::ReplaceSpellCheckWord(CFX_PointF pointf, FX_BSTR bsReplace) { - FX_INT32 nWordCount = 0; - FX_INT32 nWordStart = GetWordAtPoint(pointf, nWordCount); + int32_t nWordCount = 0; + int32_t nWordStart = GetWordAtPoint(pointf, nWordCount); if (nWordCount < 1) { return FALSE; } @@ -478,10 +478,10 @@ FX_BOOL CFWL_EditImp::ReplaceSpellCheckWord(CFX_PointF pointf, FX_BSTR bsReplace break; } } - FX_INT32 nDestLen = bsReplace.GetLength(); + int32_t nDestLen = bsReplace.GetLength(); CFX_WideString wsDest; FX_LPWSTR pBuffer = wsDest.GetBuffer(nDestLen); - for (FX_INT32 i = 0; i < nDestLen; i++) { + for (int32_t i = 0; i < nDestLen; i++) { pBuffer[i] = bsReplace[i]; } wsDest.ReleaseBuffer(nDestLen); @@ -502,12 +502,12 @@ void CFWL_EditImp::DrawSpellCheck(CFX_Graphics *pGraphics, const CFX_Matrix *pMa CFX_ByteString sLatinWord; CFX_Path pathSpell; pathSpell.Create(); - FX_INT32 nStart = 0; + int32_t nStart = 0; FX_FLOAT fOffSetX = m_rtEngine.left - m_fScrollOffsetX; FX_FLOAT fOffSetY = m_rtEngine.top - m_fScrollOffsetY + m_fVAlignOffset; CFX_WideString wsSpell; this->GetText(wsSpell); - FX_INT32 nContentLen = wsSpell.GetLength(); + int32_t nContentLen = wsSpell.GetLength(); for (int i = 0; i < nContentLen; i++) { if (FX_EDIT_ISLATINWORD(wsSpell[i])) { if (sLatinWord.IsEmpty()) { @@ -590,12 +590,12 @@ FWL_ERR CFWL_EditImp::SetText(const CFX_WideString &wsText) m_pEdtEngine->SetText(wsText); return FWL_ERR_Succeeded; } -FX_INT32 CFWL_EditImp::GetTextLength() const +int32_t CFWL_EditImp::GetTextLength() const { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, -1); return m_pEdtEngine->GetTextLength(); } -FWL_ERR CFWL_EditImp::GetText(CFX_WideString &wsText, FX_INT32 nStart , FX_INT32 nCount ) const +FWL_ERR CFWL_EditImp::GetText(CFX_WideString &wsText, int32_t nStart , int32_t nCount ) const { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded); m_pEdtEngine->GetText(wsText, nStart, nCount); @@ -607,29 +607,29 @@ FWL_ERR CFWL_EditImp::ClearText() m_pEdtEngine->ClearText(); return FWL_ERR_Succeeded; } -FX_INT32 CFWL_EditImp::GetCaretPos() const +int32_t CFWL_EditImp::GetCaretPos() const { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, -1); return m_pEdtEngine->GetCaretPos(); } -FX_INT32 CFWL_EditImp::SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore ) +int32_t CFWL_EditImp::SetCaretPos(int32_t nIndex, FX_BOOL bBefore ) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, -1); return m_pEdtEngine->SetCaretPos(nIndex, bBefore); } -FWL_ERR CFWL_EditImp::AddSelRange(FX_INT32 nStart, FX_INT32 nCount ) +FWL_ERR CFWL_EditImp::AddSelRange(int32_t nStart, int32_t nCount ) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded); m_pEdtEngine->AddSelRange(nStart, nCount); return FWL_ERR_Succeeded; } -FX_INT32 CFWL_EditImp::CountSelRanges() +int32_t CFWL_EditImp::CountSelRanges() { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, 0); return m_pEdtEngine->CountSelRanges(); return FWL_ERR_Succeeded; } -FX_INT32 CFWL_EditImp::GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart) +int32_t CFWL_EditImp::GetSelRange(int32_t nIndex, int32_t &nStart) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, -1); return m_pEdtEngine->GetSelRange(nIndex, nStart); @@ -640,11 +640,11 @@ FWL_ERR CFWL_EditImp::ClearSelections() m_pEdtEngine->ClearSelection(); return FWL_ERR_Succeeded; } -FX_INT32 CFWL_EditImp::GetLimit() +int32_t CFWL_EditImp::GetLimit() { return m_nLimit; } -FWL_ERR CFWL_EditImp::SetLimit(FX_INT32 nLimit) +FWL_ERR CFWL_EditImp::SetLimit(int32_t nLimit) { m_nLimit = nLimit; _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded); @@ -663,7 +663,7 @@ FWL_ERR CFWL_EditImp::SetFormatString(const CFX_WideString &wsFormat) m_pEdtEngine->SetFormatBlock(0, wsFormat); return FWL_ERR_Succeeded; } -FWL_ERR CFWL_EditImp::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLen) +FWL_ERR CFWL_EditImp::Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLen) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded); if ( (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ReadOnly) @@ -676,13 +676,13 @@ FWL_ERR CFWL_EditImp::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLen) FWL_ERR CFWL_EditImp::DeleteSelections() { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded); - FX_INT32 iCount = m_pEdtEngine->CountSelRanges(); + int32_t iCount = m_pEdtEngine->CountSelRanges(); if (iCount > 0) { m_pEdtEngine->Delete(-1); } return FWL_ERR_Succeeded; } -FWL_ERR CFWL_EditImp::DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) +FWL_ERR CFWL_EditImp::DeleteRange(int32_t nStart, int32_t nCount ) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded); m_pEdtEngine->DeleteRange(nStart, nCount); @@ -691,21 +691,21 @@ FWL_ERR CFWL_EditImp::DeleteRange(FX_INT32 nStart, FX_INT32 nCount ) FWL_ERR CFWL_EditImp::ReplaceSelections(const CFX_WideStringC &wsReplace) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded); - FX_INT32 iCount = m_pEdtEngine->CountSelRanges(); + int32_t iCount = m_pEdtEngine->CountSelRanges(); for (int i = 0; i < iCount; i ++) { - FX_INT32 nStart; - FX_INT32 nCount = m_pEdtEngine->GetSelRange(i, nStart); + int32_t nStart; + int32_t nCount = m_pEdtEngine->GetSelRange(i, nStart); m_pEdtEngine->Replace(nStart, nCount, wsReplace); } return FWL_ERR_Succeeded; } -FWL_ERR CFWL_EditImp::Replace(FX_INT32 nStart, FX_INT32 nLen, const CFX_WideStringC &wsReplace) +FWL_ERR CFWL_EditImp::Replace(int32_t nStart, int32_t nLen, const CFX_WideStringC &wsReplace) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded); m_pEdtEngine->Replace(nStart, nLen, wsReplace); return FWL_ERR_Succeeded; } -FWL_ERR CFWL_EditImp::DoClipboard(FX_INT32 iCmd) +FWL_ERR CFWL_EditImp::DoClipboard(int32_t iCmd) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FWL_ERR_Succeeded); if ( (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ReadOnly) @@ -719,8 +719,8 @@ FWL_ERR CFWL_EditImp::DoClipboard(FX_INT32 iCmd) CFX_WideString wsText; switch(iCmd) { case 1: { - FX_INT32 nStart; - FX_INT32 nCount = m_pEdtEngine->GetSelRange(0, nStart); + int32_t nStart; + int32_t nCount = m_pEdtEngine->GetSelRange(0, nStart); if (nCount < 1) { break; } @@ -729,8 +729,8 @@ FWL_ERR CFWL_EditImp::DoClipboard(FX_INT32 iCmd) break; } case 2: { - FX_INT32 nStart; - FX_INT32 nCount = m_pEdtEngine->GetSelRange(0, nStart); + int32_t nStart; + int32_t nCount = m_pEdtEngine->GetSelRange(0, nStart); if (nCount < 1) { break; } @@ -742,7 +742,7 @@ FWL_ERR CFWL_EditImp::DoClipboard(FX_INT32 iCmd) } case 3: { pClipBorder->GetStringData(wsText); - FX_INT32 iLen = wsText.GetLength(); + int32_t iLen = wsText.GetLength(); if (iLen < 0) { break; } @@ -753,7 +753,7 @@ FWL_ERR CFWL_EditImp::DoClipboard(FX_INT32 iCmd) iLen --; wsText = wsText.Left(iLen); } - FX_INT32 nPos = m_pEdtEngine->GetCaretPos(); + int32_t nPos = m_pEdtEngine->GetCaretPos(); m_pEdtEngine->Insert(nPos, wsText, iLen); break; } @@ -765,14 +765,14 @@ FWL_ERR CFWL_EditImp::DoClipboard(FX_INT32 iCmd) FX_BOOL CFWL_EditImp::Copy(CFX_WideString &wsCopy) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FALSE); - FX_INT32 nCount = m_pEdtEngine->CountSelRanges(); + int32_t nCount = m_pEdtEngine->CountSelRanges(); if (nCount == 0) { return FALSE; } wsCopy.Empty(); CFX_WideString wsTemp; - FX_INT32 nStart, nLength; - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nStart, nLength; + for (int32_t i = 0; i < nCount; i ++) { nLength = m_pEdtEngine->GetSelRange(i, nStart); m_pEdtEngine->GetText(wsTemp, nStart, nLength); wsCopy += wsTemp; @@ -783,14 +783,14 @@ FX_BOOL CFWL_EditImp::Copy(CFX_WideString &wsCopy) FX_BOOL CFWL_EditImp::Cut(CFX_WideString &wsCut) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FALSE); - FX_INT32 nCount = m_pEdtEngine->CountSelRanges(); + int32_t nCount = m_pEdtEngine->CountSelRanges(); if (nCount == 0) { return FALSE; } wsCut.Empty(); CFX_WideString wsTemp; - FX_INT32 nStart, nLength; - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nStart, nLength; + for (int32_t i = 0; i < nCount; i ++) { nLength = m_pEdtEngine->GetSelRange(i, nStart); m_pEdtEngine->GetText(wsTemp, nStart, nLength); wsCut += wsTemp; @@ -802,8 +802,8 @@ FX_BOOL CFWL_EditImp::Cut(CFX_WideString &wsCut) FX_BOOL CFWL_EditImp::Paste(const CFX_WideString &wsPaste) { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FALSE); - FX_INT32 nCaret = m_pEdtEngine->GetCaretPos(); - FX_INT32 iError = m_pEdtEngine->Insert(nCaret, FX_LPCWSTR(wsPaste), wsPaste.GetLength()); + int32_t nCaret = m_pEdtEngine->GetCaretPos(); + int32_t iError = m_pEdtEngine->Insert(nCaret, FX_LPCWSTR(wsPaste), wsPaste.GetLength()); if (iError < 0) { ProcessInsertError(iError); return FALSE; @@ -813,7 +813,7 @@ FX_BOOL CFWL_EditImp::Paste(const CFX_WideString &wsPaste) FX_BOOL CFWL_EditImp::Delete() { _FWL_RETURN_VALUE_IF_FAIL(m_pEdtEngine, FALSE); - FX_INT32 nCount = m_pEdtEngine->CountSelRanges(); + int32_t nCount = m_pEdtEngine->CountSelRanges(); if (nCount < 1) { return FALSE; } @@ -873,14 +873,14 @@ FWL_ERR CFWL_EditImp::SetOuter(IFWL_Widget *pOuter) m_pOuter = pOuter; return FWL_ERR_Succeeded; } -FWL_ERR CFWL_EditImp::SetNumberRange(FX_INT32 iMin, FX_INT32 iMax) +FWL_ERR CFWL_EditImp::SetNumberRange(int32_t iMin, int32_t iMax) { m_iMin = iMin; m_iMax = iMax; m_bSetRange = TRUE; return FWL_ERR_Succeeded; } -void CFWL_EditImp::On_CaretChanged(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPage, FX_BOOL bVisible ) +void CFWL_EditImp::On_CaretChanged(IFDE_TxtEdtEngine *pEdit, int32_t nPage, FX_BOOL bVisible ) { if (m_rtEngine.IsEmpty()) { return; @@ -973,7 +973,7 @@ void CFWL_EditImp::On_SelChanged(IFDE_TxtEdtEngine *pEdit) GetClientRect(rtTemp); Repaint(&rtTemp); } -FX_BOOL CFWL_EditImp::On_PageLoad(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPageIndex, FX_INT32 nPurpose) +FX_BOOL CFWL_EditImp::On_PageLoad(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex, int32_t nPurpose) { IFDE_TxtEdtEngine *pEdtEngine = m_pEdtEngine; IFDE_TxtEdtPage *pPage = pEdtEngine->GetPage(nPageIndex); @@ -981,7 +981,7 @@ FX_BOOL CFWL_EditImp::On_PageLoad(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPageIndex, pPage->LoadPage(); return TRUE; } -FX_BOOL CFWL_EditImp::On_PageUnload(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPageIndex, FX_INT32 nPurpose) +FX_BOOL CFWL_EditImp::On_PageUnload(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex, int32_t nPurpose) { IFDE_TxtEdtEngine *pEdtEngine = m_pEdtEngine; IFDE_TxtEdtPage *pPage = pEdtEngine->GetPage(nPageIndex); @@ -1001,16 +1001,16 @@ void CFWL_EditImp::On_AddDoRecord(IFDE_TxtEdtEngine *pEdit, FX_BSTR bsDoRecord) evt.m_wsDoRecord = bsDoRecord; m_pDelegate->OnProcessEvent(&evt); } -FX_BOOL CFWL_EditImp::On_ValidateField(IFDE_TxtEdtEngine *pEdit, FX_INT32 nBlockIndex, FX_INT32 nFieldIndex, \ - const CFX_WideString &wsFieldText, FX_INT32 nCharIndex) +FX_BOOL CFWL_EditImp::On_ValidateField(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex, int32_t nFieldIndex, \ + const CFX_WideString &wsFieldText, int32_t nCharIndex) { return TRUE; } -FX_BOOL CFWL_EditImp::On_ValidateBlock(IFDE_TxtEdtEngine *pEdit, FX_INT32 nBlockIndex) +FX_BOOL CFWL_EditImp::On_ValidateBlock(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex) { return TRUE; } -FX_BOOL CFWL_EditImp::On_GetBlockFormatText(IFDE_TxtEdtEngine *pEdit, FX_INT32 nBlockIndex, CFX_WideString &wsBlockText) +FX_BOOL CFWL_EditImp::On_GetBlockFormatText(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex, CFX_WideString &wsBlockText) { return FALSE; } @@ -1100,26 +1100,26 @@ void CFWL_EditImp::DrawContent(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pThe bShowSel = (pForm->GetStates() & FWL_WGTSTATE_Deactivated) != FWL_WGTSTATE_Deactivated; } } - FX_INT32 nSelCount = m_pEdtEngine->CountSelRanges(); + int32_t nSelCount = m_pEdtEngine->CountSelRanges(); if (bShowSel && nSelCount > 0) { - FX_INT32 nPageCharStart = pPage->GetCharStart(); - FX_INT32 nPageCharCount = pPage->GetCharCount(); - FX_INT32 nPageCharEnd = nPageCharStart + nPageCharCount - 1; - FX_INT32 nCharCount; - FX_INT32 nCharStart; + int32_t nPageCharStart = pPage->GetCharStart(); + int32_t nPageCharCount = pPage->GetCharCount(); + int32_t nPageCharEnd = nPageCharStart + nPageCharCount - 1; + int32_t nCharCount; + int32_t nCharStart; CFX_RectFArray rectArr; - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < nSelCount; i ++) { nCharCount = m_pEdtEngine->GetSelRange(i, nCharStart); - FX_INT32 nCharEnd = nCharStart + nCharCount - 1; + int32_t nCharEnd = nCharStart + nCharCount - 1; if (nCharEnd < nPageCharStart || nCharStart > nPageCharEnd) { continue; } - FX_INT32 nBgn = FX_MAX(nCharStart, nPageCharStart); - FX_INT32 nEnd = FX_MIN(nCharEnd, nPageCharEnd); + int32_t nBgn = FX_MAX(nCharStart, nPageCharStart); + int32_t nEnd = FX_MIN(nCharEnd, nPageCharEnd); pPage->CalcRangeRectArray(nBgn - nPageCharStart, nEnd - nBgn + 1, rectArr); } - FX_INT32 nCount = rectArr.GetSize(); + int32_t nCount = rectArr.GetSize(); CFX_Path path; path.Create(); for (i = 0; i < nCount; i ++) { @@ -1154,10 +1154,10 @@ void CFWL_EditImp::DrawContent(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pThe pGraphics->RestoreGraphState(); CFX_Path path; path.Create(); - FX_INT32 iLimit = m_nLimit > 0 ? m_nLimit : 1; + int32_t iLimit = m_nLimit > 0 ? m_nLimit : 1; FX_FLOAT fStep = m_rtEngine.width / iLimit; FX_FLOAT fLeft = m_rtEngine.left + 1; - for (FX_INT32 i = 1; i < iLimit; i++) { + for (int32_t i = 1; i < iLimit; i++) { fLeft += fStep; path.AddLine(fLeft, m_rtClient.top, fLeft, m_rtClient.bottom()); } @@ -1276,7 +1276,7 @@ void CFWL_EditImp::UpdateEditParams() _FWL_RETURN_IF_FAIL(pFont); params.pFont = pFont; params.fFontSize = m_fFontSize; - params.nLineCount = (FX_INT32)(params.fPlateHeight / params.fLineSpace); + params.nLineCount = (int32_t)(params.fPlateHeight / params.fLineSpace); if (params.nLineCount <= 0) { params.nLineCount = 1; } @@ -1533,16 +1533,16 @@ FX_BOOL CFWL_EditImp::IsContentHeightOverflow() _FWL_RETURN_VALUE_IF_FAIL(pPage, FALSE); return pPage->GetContentsBox().height > m_rtEngine.height + 1.0f; } -FX_INT32 CFWL_EditImp::AddDoRecord(FX_BSTR bsDoRecord) +int32_t CFWL_EditImp::AddDoRecord(FX_BSTR bsDoRecord) { - FX_INT32 nCount = m_RecordArr.GetSize(); + int32_t nCount = m_RecordArr.GetSize(); if (m_iCurRecord == nCount - 1) { if (nCount == m_iMaxRecord) { m_RecordArr.RemoveAt(0); m_iCurRecord --; } } else { - for (FX_INT32 i = nCount - 1; i > m_iCurRecord; i --) { + for (int32_t i = nCount - 1; i > m_iCurRecord; i --) { m_RecordArr.RemoveAt(i); } } @@ -1731,13 +1731,13 @@ FX_BOOL CFWL_EditImp::ValidateNumberChar(FX_WCHAR cNum) } return TRUE; } - FX_INT32 caretPos = m_pEdtEngine->GetCaretPos(); - FX_INT32 iSel = CountSelRanges(); + int32_t caretPos = m_pEdtEngine->GetCaretPos(); + int32_t iSel = CountSelRanges(); if (iSel == 0) { if (cNum == L'0' && caretPos == 0) { return FALSE; } - FX_INT32 nLen = wsText.GetLength(); + 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; @@ -1770,7 +1770,7 @@ void CFWL_EditImp::ClearRecord() m_iCurRecord = -1; m_RecordArr.RemoveAll(); } -void CFWL_EditImp::ProcessInsertError(FX_INT32 iError) +void CFWL_EditImp::ProcessInsertError(int32_t iError) { switch (iError) { case -2: { @@ -1787,11 +1787,11 @@ CFWL_EditImpDelegate::CFWL_EditImpDelegate(CFWL_EditImp *pOwner) : m_pOwner(pOwner) { } -FX_INT32 CFWL_EditImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_EditImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); FX_DWORD dwMsgCode = pMessage->GetClassID(); - FX_INT32 iRet = 1; + int32_t iRet = 1; switch (dwMsgCode) { case FWL_MSGHASH_Activate: { DoActivate((CFWL_MsgActivate*)pMessage); @@ -1895,7 +1895,7 @@ void CFWL_EditImpDelegate::DoButtonDown(CFWL_MsgMouse *pMsg) pt.Set(pMsg->m_fx, pMsg->m_fy); m_pOwner->DeviceToEngine(pt); FX_BOOL bBefore = TRUE; - FX_INT32 nIndex = pPage->GetCharIndex(pt, bBefore); + int32_t nIndex = pPage->GetCharIndex(pt, bBefore); if (nIndex < 0) { nIndex = 0; } @@ -1917,7 +1917,7 @@ void CFWL_EditImpDelegate::OnFocusChanged(CFWL_Message *pMsg, FX_BOOL bSet) m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; m_pOwner->ShowCaret(FALSE); if (m_pOwner->m_pEdtEngine && (dwStyleEx & FWL_STYLEEXT_EDT_NoHideSel) == 0) { - FX_INT32 nSel = m_pOwner->CountSelRanges(); + int32_t nSel = m_pOwner->CountSelRanges(); if (nSel > 0) { m_pOwner->ClearSelections(); bRepaint = TRUE; @@ -1946,17 +1946,17 @@ void CFWL_EditImpDelegate::OnLButtonDown(CFWL_MsgMouse *pMsg) m_pOwner->m_bLButtonDown = TRUE; m_pOwner->SetGrab(TRUE); DoButtonDown(pMsg); - FX_INT32 nIndex = m_pOwner->m_pEdtEngine->GetCaretPos(); + int32_t nIndex = m_pOwner->m_pEdtEngine->GetCaretPos(); FX_BOOL bRepaint = FALSE; - FX_INT32 iCount = m_pOwner->m_pEdtEngine->CountSelRanges(); + int32_t iCount = m_pOwner->m_pEdtEngine->CountSelRanges(); if (iCount > 0) { m_pOwner->m_pEdtEngine->ClearSelection(); bRepaint = TRUE; } FX_BOOL bShift = pMsg->m_dwFlags & FWL_KEYFLAG_Shift; if (bShift && m_pOwner->m_nSelStart != nIndex) { - FX_INT32 iStart = FX_MIN(m_pOwner->m_nSelStart, nIndex); - FX_INT32 iEnd = FX_MAX(m_pOwner->m_nSelStart, nIndex); + int32_t iStart = FX_MIN(m_pOwner->m_nSelStart, nIndex); + int32_t iEnd = FX_MAX(m_pOwner->m_nSelStart, nIndex); m_pOwner->m_pEdtEngine->AddSelRange(iStart, iEnd - iStart); bRepaint = TRUE; } else { @@ -1981,8 +1981,8 @@ void CFWL_EditImpDelegate::OnButtonDblClk(CFWL_MsgMouse *pMsg) CFX_PointF pt; pt.Set(pMsg->m_fx, pMsg->m_fy); m_pOwner->DeviceToEngine(pt); - FX_INT32 nCount = 0; - FX_INT32 nIndex = pPage->SelectWord(pt, nCount); + int32_t nCount = 0; + int32_t nIndex = pPage->SelectWord(pt, nCount); if (nIndex < 0) { return; } @@ -2003,12 +2003,12 @@ void CFWL_EditImpDelegate::OnMouseMove(CFWL_MsgMouse *pMsg) pt.Set(pMsg->m_fx, pMsg->m_fy); m_pOwner->DeviceToEngine(pt); FX_BOOL bBefore = TRUE; - FX_INT32 nIndex = pPage->GetCharIndex(pt, bBefore); + int32_t nIndex = pPage->GetCharIndex(pt, bBefore); m_pOwner->m_pEdtEngine->SetCaretPos(nIndex, bBefore); nIndex = m_pOwner->m_pEdtEngine->GetCaretPos(); m_pOwner->m_pEdtEngine->ClearSelection(); if (nIndex != m_pOwner->m_nSelStart) { - FX_INT32 nLen = m_pOwner->m_pEdtEngine->GetTextLength(); + int32_t nLen = m_pOwner->m_pEdtEngine->GetTextLength(); if (m_pOwner->m_nSelStart >= nLen) { m_pOwner->m_nSelStart = nLen; } @@ -2063,7 +2063,7 @@ void CFWL_EditImpDelegate::OnKeyDown(CFWL_MsgKey *pMsg) || (m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)) { break; } - FX_INT32 nCaret = m_pOwner->m_pEdtEngine->GetCaretPos(); + int32_t nCaret = m_pOwner->m_pEdtEngine->GetCaretPos(); #if (_FX_OS_==_FX_MACOSX_) m_pOwner->m_pEdtEngine->Delete(nCaret, TRUE); #else @@ -2111,9 +2111,9 @@ void CFWL_EditImpDelegate::OnChar(CFWL_MsgKey *pMsg) return; } _FWL_RETURN_IF_FAIL(m_pOwner->m_pEdtEngine); - FX_INT32 iError = 0; + int32_t iError = 0; FX_WCHAR c = (FX_WCHAR)pMsg->m_dwKeyCode; - FX_INT32 nCaret = m_pOwner->m_pEdtEngine->GetCaretPos(); + int32_t nCaret = m_pOwner->m_pEdtEngine->GetCaretPos(); switch (c) { case FWL_VKEY_Back: { m_pOwner->m_pEdtEngine->Delete(nCaret, TRUE); diff --git a/xfa/src/fwl/src/basewidget/fwl_formproxyimp.cpp b/xfa/src/fwl/src/basewidget/fwl_formproxyimp.cpp index ced1fbe6f9..66714fcec7 100644 --- a/xfa/src/fwl/src/basewidget/fwl_formproxyimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_formproxyimp.cpp @@ -64,7 +64,7 @@ CFWL_FormProxyImpDelegate::CFWL_FormProxyImpDelegate(CFWL_FormProxyImp *pOwner) : m_pOwner(pOwner) { } -FX_INT32 CFWL_FormProxyImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_FormProxyImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { IFWL_WidgetDelegate *pDelegate = m_pOwner->m_pOuter->SetDelegate(NULL); return pDelegate->OnProcessMessage(pMessage); diff --git a/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp index bafb964ee6..8453f43f4b 100644 --- a/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_listboximp.cpp @@ -38,15 +38,15 @@ FWL_ERR IFWL_ListBox::Initialize(const CFWL_WidgetImpProperties &properties, IFW ((CFWL_ListBoxImp*)m_pData)->SetInterface(this); return ((CFWL_ListBoxImp*)m_pData)->Initialize(); } -FX_INT32 IFWL_ListBox::CountSelItems() +int32_t IFWL_ListBox::CountSelItems() { return ((CFWL_ListBoxImp*)m_pData)->CountSelItems(); } -FWL_HLISTITEM IFWL_ListBox::GetSelItem(FX_INT32 nIndexSel) +FWL_HLISTITEM IFWL_ListBox::GetSelItem(int32_t nIndexSel) { return ((CFWL_ListBoxImp*)m_pData)->GetSelItem(nIndexSel); } -FX_INT32 IFWL_ListBox::GetSelIndex(FX_INT32 nIndex) +int32_t IFWL_ListBox::GetSelIndex(int32_t nIndex) { return ((CFWL_ListBoxImp*)m_pData)->GetSelIndex(nIndex); } @@ -244,13 +244,13 @@ FWL_ERR CFWL_ListBoxImp::SetThemeProvider(IFWL_ThemeProvider *pThemeProvider) m_pProperties->m_pThemeProvider = pThemeProvider; return FWL_ERR_Succeeded; } -FX_INT32 CFWL_ListBoxImp::CountSelItems() +int32_t CFWL_ListBoxImp::CountSelItems() { _FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pDataProvider, 0); - FX_INT32 iRet = 0; + int32_t iRet = 0; IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 iCount = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < iCount; i ++) { FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); if (!hItem) { continue; @@ -262,13 +262,13 @@ FX_INT32 CFWL_ListBoxImp::CountSelItems() } return iRet; } -FWL_HLISTITEM CFWL_ListBoxImp::GetSelItem(FX_INT32 nIndexSel) +FWL_HLISTITEM CFWL_ListBoxImp::GetSelItem(int32_t nIndexSel) { _FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pDataProvider, NULL); - FX_INT32 index = 0; + int32_t index = 0; IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 iCount = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < iCount; i ++) { FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); if (!hItem) { return NULL; @@ -284,13 +284,13 @@ FWL_HLISTITEM CFWL_ListBoxImp::GetSelItem(FX_INT32 nIndexSel) } return NULL; } -FX_INT32 CFWL_ListBoxImp::GetSelIndex(FX_INT32 nIndex) +int32_t CFWL_ListBoxImp::GetSelIndex(int32_t nIndex) { _FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pDataProvider, -1); - FX_INT32 index = 0; + int32_t index = 0; IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 iCount = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < iCount; i ++) { FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); if (!hItem) { return -1; @@ -346,9 +346,9 @@ FWL_ERR* CFWL_ListBoxImp::Sort(IFWL_ListBoxCompare *pCom) { FWL_HLISTITEM hTemp; IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 sz = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < sz - 1; i++) { - for (FX_INT32 j = i + 1; j < sz; j++) { + int32_t sz = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < sz - 1; i++) { + for (int32_t j = i + 1; j < sz; j++) { if (pCom->Compare(pData->GetItem(m_pInterface, i), pData->GetItem(m_pInterface, j)) > 0) { hTemp = pData->GetItem(m_pInterface, i); pData->SetItemIndex(m_pInterface, pData->GetItem(m_pInterface, j), i); @@ -371,14 +371,14 @@ FWL_HLISTITEM CFWL_ListBoxImp::GetItem(FWL_HLISTITEM hItem, FX_DWORD dwKeyCode) FX_BOOL bHome = dwKeyCode == FWL_VKEY_Home; FX_BOOL bEnd = dwKeyCode == FWL_VKEY_End; IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 iDstItem = -1; + int32_t iDstItem = -1; if (bUp || bDown) { - FX_INT32 index = pData->GetItemIndex(m_pInterface, hItem); + int32_t index = pData->GetItemIndex(m_pInterface, hItem); iDstItem = dwKeyCode == FWL_VKEY_Up ? index - 1 : index + 1; } else if (bHome) { iDstItem = 0; } else { - FX_INT32 iCount = pData->CountItems(m_pInterface); + int32_t iCount = pData->CountItems(m_pInterface); iDstItem = iCount - 1; } hRet = pData->GetItem(m_pInterface, iDstItem); @@ -392,16 +392,16 @@ FWL_HLISTITEM CFWL_ListBoxImp::GetItem(FWL_HLISTITEM hItem, FX_DWORD dwKeyCode) void CFWL_ListBoxImp::SetSelection(FWL_HLISTITEM hStart, FWL_HLISTITEM hEnd, FX_BOOL bSelected) { IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 iStart = pData->GetItemIndex(m_pInterface, hStart); - FX_INT32 iEnd = pData->GetItemIndex(m_pInterface, hEnd); + int32_t iStart = pData->GetItemIndex(m_pInterface, hStart); + int32_t iEnd = pData->GetItemIndex(m_pInterface, hEnd); if (iStart > iEnd) { - FX_INT32 iTemp = iStart; + int32_t iTemp = iStart; iStart = iEnd; iEnd = iTemp; } if (bSelected) { - FX_INT32 iCount = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < iCount; i++ ) { + int32_t iCount = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < iCount; i++ ) { FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); SetSelectionDirect(hItem, FALSE); } @@ -429,8 +429,8 @@ void CFWL_ListBoxImp::ClearSelection() { FX_BOOL bMulti = m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection; IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 iCount = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < iCount; i++ ) { + int32_t iCount = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < iCount; i++ ) { FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); FX_DWORD dwState = pData->GetItemStyles(m_pInterface, hItem); FX_BOOL bFindSel = dwState & FWL_ITEMSTATE_LTB_Selected; @@ -450,7 +450,7 @@ void CFWL_ListBoxImp::SelectAll() return; } IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 iCount = pData->CountItems(m_pInterface); + int32_t iCount = pData->CountItems(m_pInterface); if (iCount > 0) { FWL_HLISTITEM hItemStart = pData->GetItem(m_pInterface, 0); FWL_HLISTITEM hItemEnd = pData->GetItem(m_pInterface, iCount - 1); @@ -460,8 +460,8 @@ void CFWL_ListBoxImp::SelectAll() FWL_HLISTITEM CFWL_ListBoxImp::GetFocusedItem() { IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 iCount = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < iCount; i++) { FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); _FWL_RETURN_VALUE_IF_FAIL(hItem, NULL); if (pData->GetItemStyles(m_pInterface, hItem) & FWL_ITEMSTATE_LTB_Focused) { @@ -499,8 +499,8 @@ FWL_HLISTITEM CFWL_ListBoxImp::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) fPosY = m_pVertScrollBar->GetPos(); } IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 nCount = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < nCount; i ++) { FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); if (!hItem) { continue; @@ -610,8 +610,8 @@ void CFWL_ListBoxImp::DrawItems(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTh } FX_BOOL bMultiCol = m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiColumn; IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 iCount = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < iCount; i ++) { FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); if (!hItem) { continue; @@ -641,7 +641,7 @@ void CFWL_ListBoxImp::DrawItems(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTh } } } -void CFWL_ListBoxImp::DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, FWL_HLISTITEM hItem, FX_INT32 Index, const CFX_RectF &rtItem, const CFX_Matrix *pMatrix ) +void CFWL_ListBoxImp::DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, FWL_HLISTITEM hItem, int32_t Index, const CFX_RectF &rtItem, const CFX_Matrix *pMatrix ) { IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; FX_DWORD dwItemStyles = pData->GetItemStyles(m_pInterface, hItem); @@ -665,7 +665,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pThe param.m_pGraphics = pGraphics; param.m_matrix.Concat(*pMatrix); param.m_rtPart = rtItem; - param.m_dwData = (FX_DWORD)(FX_UINTPTR)(&itemData); + param.m_dwData = (FX_DWORD)(uintptr_t)(&itemData); CFX_RectF rtFocus(rtItem); param.m_pData = &rtFocus; if (m_pVertScrollBar && !m_pHorzScrollBar && (dwPartStates & FWL_PARTSTATE_LTB_Focused)) { @@ -688,7 +688,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pThe param.m_pGraphics = pGraphics; param.m_matrix.Concat(*pMatrix); param.m_rtPart = rtDIB; - param.m_dwData = (FX_DWORD)(FX_UINTPTR)(&itemData); + param.m_dwData = (FX_DWORD)(uintptr_t)(&itemData); param.m_pImage = pDib; pTheme->DrawBackground(¶m); } @@ -710,7 +710,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pThe } param.m_matrix.Concat(*pMatrix); param.m_rtPart = rtCheck; - param.m_dwData = (FX_DWORD)(FX_UINTPTR)(&itemData); + param.m_dwData = (FX_DWORD)(uintptr_t)(&itemData); pTheme->DrawBackground(¶m); } CFX_WideString wsText; @@ -733,7 +733,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pThe textParam.m_wsText = wsText; textParam.m_dwTTOStyles = m_dwTTOStyles; textParam.m_iTTOAlign = m_iTTOAligns; - textParam.m_dwData = (FX_DWORD)(FX_UINTPTR)(&itemData); + textParam.m_dwData = (FX_DWORD)(uintptr_t)(&itemData); pTheme->DrawText(&textParam); } } @@ -757,8 +757,8 @@ CFX_SizeF CFWL_ListBoxImp::CalcSize(FX_BOOL bAutoSize ) IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; if (!bAutoSize) { } - FX_INT32 iCount = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < iCount; i ++) { FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); CFWL_ThemePart itemPart; itemPart.m_pWidget = m_pInterface; @@ -795,8 +795,8 @@ CFX_SizeF CFWL_ListBoxImp::CalcSize(FX_BOOL bAutoSize ) if (bHasIcon) { fWidth += m_fItemHeight; } - FX_INT32 iCount = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < iCount; i ++) { FWL_HLISTITEM htem = pData->GetItem(m_pInterface, i); GetItemSize(fs, htem, fWidth, m_fItemHeight, bAutoSize); } @@ -917,8 +917,8 @@ FX_FLOAT CFWL_ListBoxImp::GetMaxTextWidth() { FX_FLOAT fRet = 0.0f; IFWL_ListBoxDP *pData = (IFWL_ListBoxDP*)m_pProperties->m_pDataProvider; - FX_INT32 iCount = pData->CountItems(m_pInterface); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = pData->CountItems(m_pInterface); + for (int32_t i = 0; i < iCount; i ++) { FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); if (!hItem) { continue; @@ -974,8 +974,8 @@ void CFWL_ListBoxImp::ProcessSelChanged() CFWL_EvtLtbSelChanged selEvent; selEvent.m_pSrcTarget = m_pInterface; CFX_Int32Array arrSels; - FX_INT32 iCount = CountSelItems(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = CountSelItems(); + for (int32_t i = 0; i < iCount; i ++) { FWL_HLISTITEM item = GetSelItem(i); if (item == NULL) { continue; @@ -988,14 +988,14 @@ CFWL_ListBoxImpDelegate::CFWL_ListBoxImpDelegate(CFWL_ListBoxImp *pOwner) : m_pOwner(pOwner) { } -FX_INT32 CFWL_ListBoxImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_ListBoxImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); if (!m_pOwner->IsEnabled()) { return 1; } FX_DWORD dwMsgCode = pMessage->GetClassID(); - FX_INT32 iRet = 1; + int32_t iRet = 1; switch (dwMsgCode) { case FWL_MSGHASH_SetFocus: case FWL_MSGHASH_KillFocus: { diff --git a/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp b/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp index 39085d6e85..aed47639b2 100644 --- a/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp @@ -44,15 +44,15 @@ FWL_ERR IFWL_MonthCalendar::Initialize(const CFWL_WidgetImpProperties &propertie ((CFWL_MonthCalendarImp*)m_pData)->SetInterface(this); return ((CFWL_MonthCalendarImp*)m_pData)->Initialize(); } -FX_INT32 IFWL_MonthCalendar::CountSelect() +int32_t IFWL_MonthCalendar::CountSelect() { return ((CFWL_MonthCalendarImp*)m_pData)->CountSelect(); } -FX_BOOL IFWL_MonthCalendar::GetSelect(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay, FX_INT32 nIndex) +FX_BOOL IFWL_MonthCalendar::GetSelect(int32_t &iYear, int32_t &iMonth, int32_t &iDay, int32_t nIndex) { return ((CFWL_MonthCalendarImp*)m_pData)->GetSelect(iYear, iMonth, iDay, nIndex); } -FX_BOOL IFWL_MonthCalendar::SetSelect(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) +FX_BOOL IFWL_MonthCalendar::SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay) { return ((CFWL_MonthCalendarImp*)m_pData)->SetSelect(iYear, iMonth, iDay); } @@ -204,11 +204,11 @@ FWL_ERR CFWL_MonthCalendarImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Mat } return FWL_ERR_Succeeded; } -FX_INT32 CFWL_MonthCalendarImp::CountSelect() +int32_t CFWL_MonthCalendarImp::CountSelect() { return m_arrSelDays.GetSize(); } -FX_BOOL CFWL_MonthCalendarImp::GetSelect(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay, FX_INT32 nIndex ) +FX_BOOL CFWL_MonthCalendarImp::GetSelect(int32_t &iYear, int32_t &iMonth, int32_t &iDay, int32_t nIndex ) { if (nIndex >= m_arrSelDays.GetSize()) { return FALSE; @@ -218,7 +218,7 @@ FX_BOOL CFWL_MonthCalendarImp::GetSelect(FX_INT32 &iYear, FX_INT32 &iMonth, FX_I iDay = m_arrSelDays[nIndex]; return TRUE; } -FX_BOOL CFWL_MonthCalendarImp::SetSelect(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) +FX_BOOL CFWL_MonthCalendarImp::SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay) { ChangeToMonth(iYear, iMonth); return AddSelDay(iDay); @@ -282,8 +282,8 @@ void CFWL_MonthCalendarImp::DrawCaption(CFX_Graphics *pGraphics, IFWL_ThemeProvi textParam.m_iPart = FWL_PART_MCD_Caption; textParam.m_dwStates = FWL_PARTSTATE_MCD_Normal; textParam.m_pGraphics = pGraphics; - FX_INT32 iYear; - FX_INT32 iMonth; + int32_t iYear; + int32_t iMonth; iYear = m_iCurYear; iMonth = m_iCurMonth; CFX_WideString wsCation; @@ -321,8 +321,8 @@ void CFWL_MonthCalendarImp::DrawDatesInBK(CFX_Graphics *pGraphics, IFWL_ThemePro if (pMatrix) { params.m_matrix.Concat(*pMatrix); } - FX_INT32 iCount = m_arrDates.GetSize(); - for (FX_INT32 j = 0; j < iCount; j ++) { + int32_t iCount = m_arrDates.GetSize(); + for (int32_t j = 0; j < iCount; j ++) { LPDATEINFO pDataInfo = (LPDATEINFO)m_arrDates.GetAt(j); if (pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Selected) { params.m_dwStates |= FWL_PARTSTATE_MCD_Selected; @@ -351,7 +351,7 @@ void CFWL_MonthCalendarImp::DrawWeek(CFX_Graphics *pGraphics, IFWL_ThemeProvider params.m_pGraphics = pGraphics; params.m_dwStates = FWL_PARTSTATE_MCD_Normal; params.m_iTTOAlign = FDE_TTOALIGNMENT_Center; - FX_INT32 iWeek; + int32_t iWeek; iWeek = m_pDateTime->GetDayOfWeek(); CFX_RectF rtDayOfWeek; const FX_WCHAR* pWeekDay[] = { @@ -361,7 +361,7 @@ void CFWL_MonthCalendarImp::DrawWeek(CFX_Graphics *pGraphics, IFWL_ThemeProvider if (pMatrix) { params.m_matrix.Concat(*pMatrix); } - for (FX_INT32 i = 0; i < 7; i++) { + for (int32_t i = 0; i < 7; i++) { rtDayOfWeek.Set(m_rtWeek.left + i * (m_szCell.x + MONTHCAL_HMARGIN * 2), m_rtWeek.top, m_szCell.x, @@ -388,13 +388,13 @@ void CFWL_MonthCalendarImp::DrawWeekNumber(CFX_Graphics *pGraphics, IFWL_ThemePr if (pMatrix) { params.m_matrix.Concat(*pMatrix); } - FX_INT32 iWeekNum = 0; - FX_INT32 iMonthNum = m_pDateTime->GetMonth(); - FX_INT32 iDayNum = FX_DaysInMonth(m_iCurYear, iMonthNum); - FX_INT32 iTemp = 0; + int32_t iWeekNum = 0; + int32_t iMonthNum = m_pDateTime->GetMonth(); + int32_t iDayNum = FX_DaysInMonth(m_iCurYear, iMonthNum); + int32_t iTemp = 0; FX_FLOAT fVStartPos = m_rtClient.top + m_fHeadHei + m_fHSepHei; FX_FLOAT fHStartPos = m_rtClient.left; - for (FX_INT32 i = 1; i <= iDayNum; i += 7) { + for (int32_t i = 1; i <= iDayNum; i += 7) { iTemp ++; iWeekNum = CalWeekNumber(m_iCurYear, iMonthNum, i); m_rtWeekNum.Set(fHStartPos, fVStartPos + m_fDateCellHei * iTemp, m_fWeekNumWid, m_fDateCellHei); @@ -453,8 +453,8 @@ void CFWL_MonthCalendarImp::DrawDatesIn(CFX_Graphics *pGraphics, IFWL_ThemeProvi if (pMatrix) { params.m_matrix.Concat(*pMatrix); } - FX_INT32 iCount = m_arrDates.GetSize(); - for (FX_INT32 j = 0; j < iCount; j ++) { + int32_t iCount = m_arrDates.GetSize(); + for (int32_t j = 0; j < iCount; j ++) { LPDATEINFO pDataInfo = (LPDATEINFO)m_arrDates.GetAt(j); params.m_wsText = pDataInfo->wsDay; params.m_rtPart = pDataInfo->rect; @@ -634,11 +634,11 @@ void CFWL_MonthCalendarImp::LayOut() void CFWL_MonthCalendarImp::CalDateItem() { FX_BOOL bNewWeek = FALSE; - FX_INT32 iWeekOfMonth = 0; + int32_t iWeekOfMonth = 0; FX_FLOAT fLeft = m_rtDates.left; FX_FLOAT fTop = m_rtDates.top; - FX_INT32 iCount = m_arrDates.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_arrDates.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { LPDATEINFO pDateInfo = (LPDATEINFO)m_arrDates.GetAt(i); if (bNewWeek) { iWeekOfMonth ++; @@ -694,30 +694,30 @@ void CFWL_MonthCalendarImp::GetCapValue() } m_fMCHei = *(FX_FLOAT*)pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEIGHT); } -FX_INT32 CFWL_MonthCalendarImp::CalWeekNumber(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) +int32_t CFWL_MonthCalendarImp::CalWeekNumber(int32_t iYear, int32_t iMonth, int32_t iDay) { return 0; } -FX_BOOL CFWL_MonthCalendarImp::GetMinDate(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay) +FX_BOOL CFWL_MonthCalendarImp::GetMinDate(int32_t &iYear, int32_t &iMonth, int32_t &iDay) { iYear = m_dtMin.iYear; iMonth = m_dtMin.iMonth; iDay = m_dtMin.iDay; return TRUE; } -FX_BOOL CFWL_MonthCalendarImp::SetMinDate(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) +FX_BOOL CFWL_MonthCalendarImp::SetMinDate(int32_t iYear, int32_t iMonth, int32_t iDay) { m_dtMin = DATE(iYear, iMonth, iDay); return TRUE; } -FX_BOOL CFWL_MonthCalendarImp::GetMaxDate(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay) +FX_BOOL CFWL_MonthCalendarImp::GetMaxDate(int32_t &iYear, int32_t &iMonth, int32_t &iDay) { iYear = m_dtMax.iYear; iMonth = m_dtMax.iMonth; iDay = m_dtMax.iDay; return TRUE; } -FX_BOOL CFWL_MonthCalendarImp::SetMaxDate(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) +FX_BOOL CFWL_MonthCalendarImp::SetMaxDate(int32_t iYear, int32_t iMonth, int32_t iDay) { m_dtMax = DATE(iYear, iMonth, iDay); return TRUE; @@ -748,8 +748,8 @@ FX_BOOL CFWL_MonthCalendarImp::InitDate() } void CFWL_MonthCalendarImp::ClearDateItem() { - FX_INT32 iCount = m_arrDates.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_arrDates.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { LPDATEINFO pData = (LPDATEINFO)m_arrDates.GetAt(i); delete pData; } @@ -758,9 +758,9 @@ void CFWL_MonthCalendarImp::ClearDateItem() void CFWL_MonthCalendarImp::ReSetDateItem() { m_pDateTime->Set(m_iCurYear, m_iCurMonth, 1); - FX_INT32 iDays = FX_DaysInMonth(m_iCurYear, m_iCurMonth); - FX_INT32 iDayOfWeek = m_pDateTime->GetDayOfWeek(); - for (FX_INT32 i = 0; i < iDays; i ++) { + int32_t iDays = FX_DaysInMonth(m_iCurYear, m_iCurMonth); + int32_t iDayOfWeek = m_pDateTime->GetDayOfWeek(); + for (int32_t i = 0; i < iDays; i ++) { if (iDayOfWeek >= 7) { iDayOfWeek = 0; } @@ -782,7 +782,7 @@ void CFWL_MonthCalendarImp::ReSetDateItem() } FX_BOOL CFWL_MonthCalendarImp::NextMonth() { - FX_INT32 iYear = m_iCurYear, iMonth = m_iCurMonth; + int32_t iYear = m_iCurYear, iMonth = m_iCurMonth; if (iMonth >= 12) { iMonth = 1; iYear++; @@ -799,7 +799,7 @@ FX_BOOL CFWL_MonthCalendarImp::NextMonth() } FX_BOOL CFWL_MonthCalendarImp::PrevMonth() { - FX_INT32 iYear = m_iCurYear, iMonth = m_iCurMonth; + int32_t iYear = m_iCurYear, iMonth = m_iCurMonth; if (iMonth <= 1) { iMonth = 12; iYear --; @@ -814,7 +814,7 @@ FX_BOOL CFWL_MonthCalendarImp::PrevMonth() ChangeToMonth(m_iCurYear, m_iCurMonth); return TRUE; } -void CFWL_MonthCalendarImp::ChangeToMonth(FX_INT32 iYear, FX_INT32 iMonth) +void CFWL_MonthCalendarImp::ChangeToMonth(int32_t iYear, int32_t iMonth) { m_iCurYear = iYear; m_iCurMonth = iMonth; @@ -824,16 +824,16 @@ void CFWL_MonthCalendarImp::ChangeToMonth(FX_INT32 iYear, FX_INT32 iMonth) CalDateItem(); GetHeadText(m_iCurYear, m_iCurMonth, m_wsHead); } -FX_BOOL CFWL_MonthCalendarImp::RemoveSelDay(FX_INT32 iDay, FX_BOOL bAll) +FX_BOOL CFWL_MonthCalendarImp::RemoveSelDay(int32_t iDay, FX_BOOL bAll) { if (iDay == -1 && !bAll) { return FALSE; } if (bAll) { - FX_INT32 iCount = m_arrSelDays.GetSize(); - FX_INT32 iDatesCount = m_arrDates.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { - FX_INT32 iSelDay = m_arrSelDays.GetAt(i); + int32_t iCount = m_arrSelDays.GetSize(); + int32_t iDatesCount = m_arrDates.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { + int32_t iSelDay = m_arrSelDays.GetAt(i); if (iSelDay <= iDatesCount) { LPDATEINFO pDateInfo = (LPDATEINFO)m_arrDates.GetAt(iSelDay - 1); pDateInfo->dwStates &= ~FWL_ITEMSTATE_MCD_Selected; @@ -841,12 +841,12 @@ FX_BOOL CFWL_MonthCalendarImp::RemoveSelDay(FX_INT32 iDay, FX_BOOL bAll) } m_arrSelDays.RemoveAll(); } else { - FX_INT32 index = m_arrSelDays.Find(iDay); + int32_t index = m_arrSelDays.Find(iDay); if (index == -1) { return FALSE; } - FX_INT32 iSelDay = m_arrSelDays.GetAt(iDay); - FX_INT32 iDatesCount = m_arrDates.GetSize(); + int32_t iSelDay = m_arrSelDays.GetAt(iDay); + int32_t iDatesCount = m_arrDates.GetSize(); if (iSelDay <= iDatesCount) { LPDATEINFO pDateInfo = (LPDATEINFO)m_arrDates.GetAt(iSelDay - 1); pDateInfo->dwStates &= ~FWL_ITEMSTATE_MCD_Selected; @@ -855,7 +855,7 @@ FX_BOOL CFWL_MonthCalendarImp::RemoveSelDay(FX_INT32 iDay, FX_BOOL bAll) } return TRUE; } -FX_BOOL CFWL_MonthCalendarImp::AddSelDay(FX_INT32 iDay) +FX_BOOL CFWL_MonthCalendarImp::AddSelDay(int32_t iDay) { FXSYS_assert(iDay > 0); if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_MultiSelect) { @@ -885,7 +885,7 @@ FX_BOOL CFWL_MonthCalendarImp::JumpToToday() } return TRUE; } -void CFWL_MonthCalendarImp::GetHeadText(FX_INT32 iYear, FX_INT32 iMonth, CFX_WideString &wsHead) +void CFWL_MonthCalendarImp::GetHeadText(int32_t iYear, int32_t iMonth, CFX_WideString &wsHead) { FXSYS_assert(iMonth > 0 && iMonth < 13); static FX_LPWSTR pMonth[] = { @@ -904,14 +904,14 @@ void CFWL_MonthCalendarImp::GetHeadText(FX_INT32 iYear, FX_INT32 iMonth, CFX_Wid }; wsHead.Format(FX_LPCWSTR(L"%s, %d"), pMonth[iMonth - 1], iYear); } -void CFWL_MonthCalendarImp::GetTodayText(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay, CFX_WideString &wsToday) +void CFWL_MonthCalendarImp::GetTodayText(int32_t iYear, int32_t iMonth, int32_t iDay, CFX_WideString &wsToday) { wsToday.Format(FX_LPCWSTR(L", %d/%d/%d"), iDay, iMonth, iYear); } -FX_INT32 CFWL_MonthCalendarImp::GetDayAtPoint(FX_FLOAT x, FX_FLOAT y) +int32_t CFWL_MonthCalendarImp::GetDayAtPoint(FX_FLOAT x, FX_FLOAT y) { - FX_INT32 iCount = m_arrDates.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = m_arrDates.GetSize(); + for (int32_t i = 0; i < iCount; i++) { LPDATEINFO pDateInfo = (LPDATEINFO)m_arrDates.GetAt(i); if (pDateInfo->rect.Contains(x, y)) { return ++i; @@ -919,7 +919,7 @@ FX_INT32 CFWL_MonthCalendarImp::GetDayAtPoint(FX_FLOAT x, FX_FLOAT y) } return -1; } -FX_BOOL CFWL_MonthCalendarImp::GetDayRect(FX_INT32 iDay, CFX_RectF &rtDay) +FX_BOOL CFWL_MonthCalendarImp::GetDayRect(int32_t iDay, CFX_RectF &rtDay) { if (iDay <= 0 || iDay > m_arrDates.GetSize()) { return FALSE; @@ -933,11 +933,11 @@ CFWL_MonthCalendarImpDelegate::CFWL_MonthCalendarImpDelegate(CFWL_MonthCalendarI : m_pOwner(pOwner) { } -FX_INT32 CFWL_MonthCalendarImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_MonthCalendarImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); FX_DWORD dwMsgCode = pMessage->GetClassID(); - FX_INT32 iRet = 1; + int32_t iRet = 1; switch (dwMsgCode) { case FWL_MSGHASH_SetFocus: case FWL_MSGHASH_KillFocus: { @@ -1016,13 +1016,13 @@ void CFWL_MonthCalendarImpDelegate::OnLButtonDown(CFWL_MsgMouse *pMsg) } else { if (m_pOwner->m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_MultiSelect) { } else { - FX_INT32 iOldSel = 0; + int32_t iOldSel = 0; if (m_pOwner->m_arrSelDays.GetSize() > 0) { iOldSel = m_pOwner->m_arrSelDays[0]; } else { return; } - FX_INT32 iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); + int32_t iCurSel = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); FX_BOOL bSelChanged = iCurSel > 0 && iCurSel != iOldSel; if (bSelChanged) { LPDATEINFO lpDatesInfo = (LPDATEINFO)m_pOwner->m_arrDates.GetAt(iCurSel - 1); @@ -1056,7 +1056,7 @@ void CFWL_MonthCalendarImpDelegate::OnLButtonUp(CFWL_MsgMouse *pMsg) m_pOwner->m_iRBtnPartStates = 0; m_pOwner->Repaint(&m_pOwner->m_rtRBtn); } else if (m_pOwner->m_rtDates.Contains(pMsg->m_fx, pMsg->m_fy)) { - FX_INT32 iDay = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); + int32_t iDay = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); if (iDay != -1) { m_pOwner->AddSelDay(iDay); } @@ -1071,7 +1071,7 @@ void CFWL_MonthCalendarImpDelegate::OnMouseMove(CFWL_MsgMouse *pMsg) CFX_RectF rtInvalidate; rtInvalidate.Set(0, 0, 0, 0); if (m_pOwner->m_rtDates.Contains(pMsg->m_fx, pMsg->m_fy)) { - FX_INT32 iHover = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); + int32_t iHover = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); bRepaint = m_pOwner->m_iHovered != iHover; if (bRepaint) { if (m_pOwner->m_iHovered > 0) { diff --git a/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp b/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp index b3228e41f2..364e497123 100644 --- a/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp @@ -92,7 +92,7 @@ FWL_ERR CFWL_PushButtonImp::GetWidgetRect(CFX_RectF &rect, FX_BOOL bAutoSize ) if (pData) { pData->GetCaption(m_pInterface, wsCaption); } - FX_INT32 iLen = wsCaption.GetLength(); + int32_t iLen = wsCaption.GetLength(); if (iLen > 0) { CFX_SizeF sz = CalcTextSize(wsCaption, m_pProperties->m_pThemeProvider); rect.Set(0, 0, sz.x, sz.y); @@ -382,13 +382,13 @@ CFWL_PushButtonImpDelegate::CFWL_PushButtonImpDelegate(CFWL_PushButtonImp *pOwne : m_pOwner(pOwner) { } -FX_INT32 CFWL_PushButtonImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_PushButtonImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); if (!m_pOwner->IsEnabled()) { return 1; } - FX_INT32 iRet = 1; + int32_t iRet = 1; FX_DWORD dwMsgCode = pMessage->GetClassID(); switch (dwMsgCode) { case FWL_MSGHASH_SetFocus: diff --git a/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp b/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp index 8162c9d9e8..7b3e43f6e5 100644 --- a/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp @@ -302,7 +302,7 @@ FX_BOOL CFWL_ScrollBarImp::DoScroll(FX_DWORD dwCode, FX_FLOAT fPos ) } return OnScroll(dwCode, fPos); } -FX_INT32 CFWL_ScrollBarImp::Run(FWL_HTIMER hTimer) +int32_t CFWL_ScrollBarImp::Run(FWL_HTIMER hTimer) { if (m_hTimer) { FWL_StopTimer(m_hTimer); @@ -693,10 +693,10 @@ CFWL_ScrollBarImpDelegate::CFWL_ScrollBarImpDelegate(CFWL_ScrollBarImp *pOwner) : m_pOwner(pOwner) { } -FX_INT32 CFWL_ScrollBarImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_ScrollBarImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); - FX_INT32 iRet = 1; + int32_t iRet = 1; FX_DWORD dwMsgCode = pMessage->GetClassID(); if (dwMsgCode == FWL_MSGHASH_Mouse) { CFWL_MsgMouse *pMsg = (CFWL_MsgMouse*)pMessage; @@ -794,11 +794,11 @@ void CFWL_ScrollBarImpDelegate::OnMouseLeave() } void CFWL_ScrollBarImpDelegate::OnMouseWheel(FX_FLOAT fx, FX_FLOAT fy, FX_DWORD dwFlags, FX_FLOAT fDeltaX, FX_FLOAT fDeltaY) { - m_pOwner->m_iMouseWheel = (FX_INT32)fDeltaX; + m_pOwner->m_iMouseWheel = (int32_t)fDeltaX; m_pOwner->SendEvent(); m_pOwner->m_iMouseWheel = 0; } -void CFWL_ScrollBarImpDelegate::DoMouseDown(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState, FX_FLOAT fx, FX_FLOAT fy) +void CFWL_ScrollBarImpDelegate::DoMouseDown(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState, FX_FLOAT fx, FX_FLOAT fy) { if (!rtItem.Contains(fx, fy)) { return; @@ -809,9 +809,9 @@ void CFWL_ScrollBarImpDelegate::DoMouseDown(FX_INT32 iItem, const CFX_RectF &rtI iState = FWL_PARTSTATE_SCB_Pressed; m_pOwner->Repaint(&rtItem); } -void CFWL_ScrollBarImpDelegate::DoMouseUp(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState, FX_FLOAT fx, FX_FLOAT fy) +void CFWL_ScrollBarImpDelegate::DoMouseUp(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState, FX_FLOAT fx, FX_FLOAT fy) { - FX_INT32 iNewState = rtItem.Contains(fx, fy) ? FWL_PARTSTATE_SCB_Hovered : FWL_PARTSTATE_SCB_Normal; + int32_t iNewState = rtItem.Contains(fx, fy) ? FWL_PARTSTATE_SCB_Hovered : FWL_PARTSTATE_SCB_Normal; if (iState == iNewState) { return; } @@ -819,10 +819,10 @@ void CFWL_ScrollBarImpDelegate::DoMouseUp(FX_INT32 iItem, const CFX_RectF &rtIte m_pOwner->Repaint(&rtItem); m_pOwner->OnScroll(FWL_SCBCODE_EndScroll, m_pOwner->m_fTrackPos); } -void CFWL_ScrollBarImpDelegate::DoMouseMove(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState, FX_FLOAT fx, FX_FLOAT fy) +void CFWL_ScrollBarImpDelegate::DoMouseMove(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState, FX_FLOAT fx, FX_FLOAT fy) { if (!m_pOwner->m_bMouseDown) { - FX_INT32 iNewState = rtItem.Contains(fx, fy) ? FWL_PARTSTATE_SCB_Hovered : FWL_PARTSTATE_SCB_Normal; + int32_t iNewState = rtItem.Contains(fx, fy) ? FWL_PARTSTATE_SCB_Hovered : FWL_PARTSTATE_SCB_Normal; if (iState == iNewState) { return; } @@ -834,7 +834,7 @@ void CFWL_ScrollBarImpDelegate::DoMouseMove(FX_INT32 iItem, const CFX_RectF &rtI m_pOwner->OnScroll(FWL_SCBCODE_TrackPos, fPos); } } -void CFWL_ScrollBarImpDelegate::DoMouseLeave(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState) +void CFWL_ScrollBarImpDelegate::DoMouseLeave(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState) { if (iState == FWL_PARTSTATE_SCB_Normal) { return; @@ -842,7 +842,7 @@ void CFWL_ScrollBarImpDelegate::DoMouseLeave(FX_INT32 iItem, const CFX_RectF &rt iState = FWL_PARTSTATE_SCB_Normal; m_pOwner->Repaint(&rtItem); } -void CFWL_ScrollBarImpDelegate::DoMouseHover(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState) +void CFWL_ScrollBarImpDelegate::DoMouseHover(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState) { if (iState == FWL_PARTSTATE_SCB_Hovered) { return; diff --git a/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp b/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp index f5f56955fa..c8be73228b 100644 --- a/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp @@ -165,7 +165,7 @@ FWL_ERR CFWL_SpinButtonImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix DrawDownButton(pGraphics, pTheme, pMatrix); return FWL_ERR_Succeeded; } -FX_INT32 CFWL_SpinButtonImp::Run(FWL_HTIMER hTimer) +int32_t CFWL_SpinButtonImp::Run(FWL_HTIMER hTimer) { if (m_hTimer) { CFWL_EvtSpbClick wmPosChanged; @@ -229,10 +229,10 @@ CFWL_SpinButtonImpDelegate::CFWL_SpinButtonImpDelegate(CFWL_SpinButtonImp *pOwne : m_pOwner(pOwner) { } -FX_INT32 CFWL_SpinButtonImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_SpinButtonImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); - FX_INT32 iRet = 1; + int32_t iRet = 1; FX_DWORD dwMsgCode = pMessage->GetClassID(); switch (dwMsgCode) { case FWL_MSGHASH_SetFocus: diff --git a/xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp b/xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp index 157d2fff73..920bcb73e1 100644 --- a/xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp +++ b/xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp @@ -124,7 +124,7 @@ FWL_ERR CFWL_ToolTipImp::GetWidgetRect(CFX_RectF &rect, FX_BOOL bAutoSize ) if (pData) { pData->GetCaption(m_pInterface, wsCaption); } - FX_INT32 iLen = wsCaption.GetLength(); + int32_t iLen = wsCaption.GetLength(); if (iLen > 0) { CFX_SizeF sz = CalcTextSize(wsCaption, m_pProperties->m_pThemeProvider); rect.Set(0, 0, sz.x, sz.y); @@ -240,7 +240,7 @@ FWL_ERR CFWL_ToolTipImp::SetAnchor(const CFX_RectF &rtAnchor) FWL_ERR CFWL_ToolTipImp::Show() { IFWL_ToolTipDP *pData = (IFWL_ToolTipDP*)m_pProperties->m_pDataProvider; - FX_INT32 nInitDelay = pData->GetInitialDelay(m_pInterface); + int32_t nInitDelay = pData->GetInitialDelay(m_pInterface); if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible)) { m_hTimerShow = FWL_StartTimer( &m_TimerShow, nInitDelay, FALSE); } @@ -263,7 +263,7 @@ FWL_ERR CFWL_ToolTipImp::SetStates(FX_DWORD dwStates, FX_BOOL bSet ) { if ( (dwStates & FWL_WGTSTATE_Invisible) && !bSet) { IFWL_ToolTipDP *pData = (IFWL_ToolTipDP*)m_pProperties->m_pDataProvider; - FX_INT32 nAutoPopDelay = pData->GetAutoPopDelay(m_pInterface); + int32_t nAutoPopDelay = pData->GetAutoPopDelay(m_pInterface); m_hTimerHide = FWL_StartTimer( &m_TimerHide, nAutoPopDelay, FALSE); } return CFWL_WidgetImp::SetStates(dwStates, bSet); @@ -301,7 +301,7 @@ CFWL_ToolTipImp::CFWL_ToolTipTimer::CFWL_ToolTipTimer(CFWL_ToolTipImp * pToolTip : m_pToolTip(pToolTip) { } -FX_INT32 CFWL_ToolTipImp::CFWL_ToolTipTimer::Run(FWL_HTIMER hTimer) +int32_t CFWL_ToolTipImp::CFWL_ToolTipTimer::Run(FWL_HTIMER hTimer) { if (m_pToolTip->m_hTimerShow == hTimer && m_pToolTip->m_hTimerShow) { if (m_pToolTip->GetStates() & FWL_WGTSTATE_Invisible) { @@ -324,7 +324,7 @@ CFWL_ToolTipImpDelegate::CFWL_ToolTipImpDelegate(CFWL_ToolTipImp *pOwner) : m_pOwner(pOwner) { } -FX_INT32 CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { return CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); } diff --git a/xfa/src/fwl/src/basewidget/fxmath_barcodeimp.cpp b/xfa/src/fwl/src/basewidget/fxmath_barcodeimp.cpp index c56932b4fa..7996a882f5 100644 --- a/xfa/src/fwl/src/basewidget/fxmath_barcodeimp.cpp +++ b/xfa/src/fwl/src/basewidget/fxmath_barcodeimp.cpp @@ -63,19 +63,19 @@ FX_BOOL CFX_Barcode::SetCharEncoding(BC_CHAR_ENCODING encoding) { return m_pBCEngine ? m_pBCEngine->SetCharEncoding(encoding) : FALSE; } -FX_BOOL CFX_Barcode::SetModuleHeight(FX_INT32 moduleHeight) +FX_BOOL CFX_Barcode::SetModuleHeight(int32_t moduleHeight) { return m_pBCEngine ? m_pBCEngine->SetModuleHeight(moduleHeight) : FALSE; } -FX_BOOL CFX_Barcode::SetModuleWidth(FX_INT32 moduleWidth) +FX_BOOL CFX_Barcode::SetModuleWidth(int32_t moduleWidth) { return m_pBCEngine ? m_pBCEngine->SetModuleWidth(moduleWidth) : FALSE; } -FX_BOOL CFX_Barcode::SetHeight(FX_INT32 height) +FX_BOOL CFX_Barcode::SetHeight(int32_t height) { return m_pBCEngine ? m_pBCEngine->SetHeight(height) : FALSE; } -FX_BOOL CFX_Barcode::SetWidth(FX_INT32 width) +FX_BOOL CFX_Barcode::SetWidth(int32_t width) { return m_pBCEngine ? m_pBCEngine->SetWidth(width) : FALSE; } @@ -113,7 +113,7 @@ FX_BOOL CFX_Barcode::SetPrintChecksum(FX_BOOL checksum) return FALSE; } } -FX_BOOL CFX_Barcode::SetDataLength(FX_INT32 length) +FX_BOOL CFX_Barcode::SetDataLength(int32_t length) { switch(GetType()) { case BC_CODE39: @@ -130,7 +130,7 @@ FX_BOOL CFX_Barcode::SetDataLength(FX_INT32 length) return FALSE; } } -FX_BOOL CFX_Barcode::SetCalChecksum(FX_INT32 state) +FX_BOOL CFX_Barcode::SetCalChecksum(int32_t state) { switch(GetType()) { case BC_CODE39: @@ -181,7 +181,7 @@ FX_BOOL CFX_Barcode::SetFontSize(FX_FLOAT size) return FALSE; } } -FX_BOOL CFX_Barcode::SetFontStyle(FX_INT32 style) +FX_BOOL CFX_Barcode::SetFontStyle(int32_t style) { switch(GetType()) { case BC_CODE39: @@ -237,9 +237,9 @@ FX_BOOL CFX_Barcode::SetTextLocation(BC_TEXT_LOC location) return m_pBCEngine && memptr ? (m_pBCEngine->*memptr)(location) : FALSE; } -FX_BOOL CFX_Barcode::SetWideNarrowRatio(FX_INT32 ratio) +FX_BOOL CFX_Barcode::SetWideNarrowRatio(int32_t ratio) { - typedef FX_BOOL (CBC_CodeBase::*memptrtype)(FX_INT32); + typedef FX_BOOL (CBC_CodeBase::*memptrtype)(int32_t); memptrtype memptr = NULL; switch(GetType()) { case BC_CODE39: @@ -282,9 +282,9 @@ FX_BOOL CFX_Barcode::SetEndChar(FX_CHAR end) return m_pBCEngine && memptr ? (m_pBCEngine->*memptr)(end) : FALSE; } -FX_BOOL CFX_Barcode::SetVersion(FX_INT32 version) +FX_BOOL CFX_Barcode::SetVersion(int32_t version) { - typedef FX_BOOL (CBC_CodeBase::*memptrtype)(FX_INT32); + typedef FX_BOOL (CBC_CodeBase::*memptrtype)(int32_t); memptrtype memptr = NULL; switch(GetType()) { case BC_QR_CODE: @@ -296,9 +296,9 @@ FX_BOOL CFX_Barcode::SetVersion(FX_INT32 version) return m_pBCEngine && memptr ? (m_pBCEngine->*memptr)(version) : FALSE; } -FX_BOOL CFX_Barcode::SetErrorCorrectionLevel(FX_INT32 level) +FX_BOOL CFX_Barcode::SetErrorCorrectionLevel(int32_t level) { - typedef FX_BOOL (CBC_CodeBase::*memptrtype)(FX_INT32); + typedef FX_BOOL (CBC_CodeBase::*memptrtype)(int32_t); memptrtype memptr = NULL; switch(GetType()) { case BC_QR_CODE: @@ -336,21 +336,21 @@ FX_BOOL CFX_Barcode::SetTruncated(FX_BOOL truncated) #ifndef BCExceptionUnSupportedBarcode #define BCExceptionUnSupportedBarcode 18 #endif -FX_BOOL CFX_Barcode::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) +FX_BOOL CFX_Barcode::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) { if(!m_pBCEngine) { return FALSE; } return m_pBCEngine->Encode(contents, isDevice, e); } -FX_BOOL CFX_Barcode::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) +FX_BOOL CFX_Barcode::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) { if (!m_pBCEngine) { return FALSE; } return m_pBCEngine->RenderDevice(device, matirx, e); } -FX_BOOL CFX_Barcode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) +FX_BOOL CFX_Barcode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) { if (!m_pBCEngine) { return FALSE; @@ -359,9 +359,9 @@ FX_BOOL CFX_Barcode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) } #define BC_TYPE_MIN BC_CODE39 #define BC_TYPE_MAX BC_DATAMATRIX -CFX_WideString CFX_Barcode::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 height, FX_INT32 &errorCode) +CFX_WideString CFX_Barcode::Decode(uint8_t* buf, int32_t width, int32_t height, int32_t &errorCode) { - for(BC_TYPE t = BC_TYPE_MIN; t <= BC_TYPE_MAX; t = (BC_TYPE)((FX_INT32)t + 1)) { + for(BC_TYPE t = BC_TYPE_MIN; t <= BC_TYPE_MAX; t = (BC_TYPE)((int32_t)t + 1)) { CBC_CodeBase* pTmpEngine = FX_Barcode_CreateBarCodeEngineObject(t); if(!pTmpEngine) { continue; @@ -374,9 +374,9 @@ CFX_WideString CFX_Barcode::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 height errorCode = BCExceptionUnSupportedBarcode; return CFX_WideString(); } -CFX_WideString CFX_Barcode::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &errorCode) +CFX_WideString CFX_Barcode::Decode(CFX_DIBitmap *pBitmap, int32_t &errorCode) { - for(BC_TYPE t = BC_TYPE_MIN; t <= BC_TYPE_MAX; t = (BC_TYPE)((FX_INT32)t + 1)) { + for(BC_TYPE t = BC_TYPE_MIN; t <= BC_TYPE_MAX; t = (BC_TYPE)((int32_t)t + 1)) { CBC_CodeBase* pTmpEngine = FX_Barcode_CreateBarCodeEngineObject(t); if(!pTmpEngine) { continue; diff --git a/xfa/src/fwl/src/basewidget/include/fwl_caretimp.h b/xfa/src/fwl/src/basewidget/include/fwl_caretimp.h index 673c720841..f4d090acb4 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_caretimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_caretimp.h @@ -37,7 +37,7 @@ protected: { public: CFWL_CaretTimer(CFWL_CaretImp *m_pCaret); - virtual FX_INT32 Run(FWL_HTIMER hTimer); + virtual int32_t Run(FWL_HTIMER hTimer); CFWL_CaretImp *m_pCaret; }; @@ -54,7 +54,7 @@ class CFWL_CaretImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_CaretImpDelegate(CFWL_CaretImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: diff --git a/xfa/src/fwl/src/basewidget/include/fwl_checkboximp.h b/xfa/src/fwl/src/basewidget/include/fwl_checkboximp.h index 0e538f32d6..490202dc9a 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_checkboximp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_checkboximp.h @@ -25,8 +25,8 @@ public: virtual FWL_ERR GetWidgetRect(CFX_RectF &rect, FX_BOOL bAutoSize = FALSE); virtual FWL_ERR Update(); virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); - virtual FX_INT32 GetCheckState(); - virtual FWL_ERR SetCheckState(FX_INT32 iCheck); + virtual int32_t GetCheckState(); + virtual FWL_ERR SetCheckState(int32_t iCheck); protected: void Layout(); FX_DWORD GetPartStates(); @@ -37,7 +37,7 @@ protected: CFX_RectF m_rtCaption; CFX_RectF m_rtFocus; FX_DWORD m_dwTTOStyles; - FX_INT32 m_iTTOAlign; + int32_t m_iTTOAlign; FX_BOOL m_bBtnDown; friend class CFWL_CheckBoxImpDelegate; }; @@ -45,7 +45,7 @@ class CFWL_CheckBoxImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_CheckBoxImpDelegate(CFWL_CheckBoxImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: void OnActivate(CFWL_Message *pMsg); diff --git a/xfa/src/fwl/src/basewidget/include/fwl_comboboximp.h b/xfa/src/fwl/src/basewidget/include/fwl_comboboximp.h index 250ef35e79..5046cdf47b 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_comboboximp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_comboboximp.h @@ -41,7 +41,7 @@ class CFWL_ComboEditDelegate : public CFWL_EditImpDelegate { public: CFWL_ComboEditDelegate(CFWL_ComboEdit *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); protected: CFWL_ComboEdit *m_pOwner; }; @@ -52,10 +52,10 @@ public: CFWL_ComboList(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter); virtual FWL_ERR Initialize(); virtual FWL_ERR Finalize(); - FX_INT32 MatchItem(const CFX_WideString &wsMatch); - void ChangeSelected(FX_INT32 iSel); - FX_INT32 CountItems(); - void GetItemRect(FX_INT32 nIndex, CFX_RectF &rtItem); + int32_t MatchItem(const CFX_WideString &wsMatch); + void ChangeSelected(int32_t iSel); + int32_t CountItems(); + void GetItemRect(int32_t nIndex, CFX_RectF &rtItem); void ClientToOuter(FX_FLOAT &fx, FX_FLOAT &fy); void SetFocus(FX_BOOL bSet); FX_BOOL m_bNotifyOwner; @@ -66,13 +66,13 @@ class CFWL_ComboListDelegate : public CFWL_ListBoxImpDelegate { public: CFWL_ComboListDelegate(CFWL_ComboList *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); protected: void OnDropListFocusChanged(CFWL_Message *pMsg, FX_BOOL bSet = TRUE); - FX_INT32 OnDropListMouseMove(CFWL_MsgMouse *pMsg); - FX_INT32 OnDropListLButtonDown(CFWL_MsgMouse *pMsg); - FX_INT32 OnDropListLButtonUp(CFWL_MsgMouse *pMsg); - FX_INT32 OnDropListKey(CFWL_MsgKey *pKey); + int32_t OnDropListMouseMove(CFWL_MsgMouse *pMsg); + int32_t OnDropListLButtonDown(CFWL_MsgMouse *pMsg); + int32_t OnDropListLButtonUp(CFWL_MsgMouse *pMsg); + int32_t OnDropListKey(CFWL_MsgKey *pKey); void OnDropListKeyDown(CFWL_MsgKey *pKey); CFWL_ComboList *m_pOwner; }; @@ -93,16 +93,16 @@ public: virtual FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy); virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider *pThemeProvider); - virtual FX_INT32 GetCurSel(); - virtual FWL_ERR SetCurSel(FX_INT32 iSel); + virtual int32_t GetCurSel(); + virtual FWL_ERR SetCurSel(int32_t iSel); virtual FWL_ERR SetEditText(const CFX_WideString &wsText); - virtual FX_INT32 GetEditTextLength() const; - virtual FWL_ERR GetEditText(CFX_WideString &wsText, FX_INT32 nStart = 0, FX_INT32 nCount = -1) const; - virtual FWL_ERR SetEditSelRange(FX_INT32 nStart, FX_INT32 nCount = -1); - virtual FX_INT32 GetEditSelRange(FX_INT32 nIndex, FX_INT32 &nStart); - virtual FX_INT32 GetEditLimit(); - virtual FWL_ERR SetEditLimit(FX_INT32 nLimit); - virtual FWL_ERR EditDoClipboard(FX_INT32 iCmd); + virtual int32_t GetEditTextLength() const; + virtual FWL_ERR GetEditText(CFX_WideString &wsText, int32_t nStart = 0, int32_t nCount = -1) const; + virtual FWL_ERR SetEditSelRange(int32_t nStart, int32_t nCount = -1); + virtual int32_t GetEditSelRange(int32_t nIndex, int32_t &nStart); + virtual int32_t GetEditLimit(); + virtual FWL_ERR SetEditLimit(int32_t nLimit); + virtual FWL_ERR EditDoClipboard(int32_t iCmd); virtual FX_BOOL EditRedo(FX_BSTR bsRecord); virtual FX_BOOL EditUndo(FX_BSTR bsRecord); virtual IFWL_ListBox* GetListBoxt(); @@ -130,7 +130,7 @@ protected: FX_BOOL IsDropListShowed(); FX_BOOL IsDropDownStyle() const; void MatchEditText(); - void SynchrEditText(FX_INT32 iListItem); + void SynchrEditText(int32_t iListItem); void Layout(); void ReSetTheme(); void ReSetEditAlignment(); @@ -161,8 +161,8 @@ protected: IFWL_Form *m_pForm; FX_BOOL m_bLButtonDown; FX_BOOL m_bUpFormHandler; - FX_INT32 m_iCurSel; - FX_INT32 m_iBtnState; + int32_t m_iCurSel; + int32_t m_iBtnState; FX_FLOAT m_fComboFormHandler; FX_FLOAT m_fItemHeight; FX_BOOL m_bNeedShowList; @@ -180,7 +180,7 @@ class CFWL_ComboBoxImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_ComboBoxImpDelegate(CFWL_ComboBoxImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); @@ -193,7 +193,7 @@ protected: void OnKey(CFWL_MsgKey *pMsg); void DoSubCtrlKey(CFWL_MsgKey *pMsg); protected: - FX_INT32 DisForm_OnProcessMessage(CFWL_Message *pMessage); + int32_t DisForm_OnProcessMessage(CFWL_Message *pMessage); void DisForm_OnLButtonDown(CFWL_MsgMouse *pMsg); void DisForm_OnFocusChanged(CFWL_Message *pMsg, FX_BOOL bSet = TRUE); void DisForm_OnKey(CFWL_MsgKey *pMsg); @@ -206,7 +206,7 @@ class CFWL_ComboProxyImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_ComboProxyImpDelegate(IFWL_Form *pForm, CFWL_ComboBoxImp *pComboBox); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); void Reset() { diff --git a/xfa/src/fwl/src/basewidget/include/fwl_datetimepickerimp.h b/xfa/src/fwl/src/basewidget/include/fwl_datetimepickerimp.h index cc8db6ada1..f07dcb5532 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_datetimepickerimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_datetimepickerimp.h @@ -48,9 +48,9 @@ class CFWL_DateTimeEditDelegate : public CFWL_EditImpDelegate { public: CFWL_DateTimeEditDelegate(CFWL_DateTimeEdit *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); private: - FX_INT32 DisForm_OnProcessMessage(CFWL_Message *pMessage); + int32_t DisForm_OnProcessMessage(CFWL_Message *pMessage); protected: CFWL_DateTimeEdit *m_pOwner; @@ -68,12 +68,12 @@ class CFWL_DateTimeCalendarDelegate : public CFWL_MonthCalendarImpDelegate { public: CFWL_DateTimeCalendarDelegate(CFWL_DateTimeCalendar *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); void OnLButtonDownEx(CFWL_MsgMouse *pMsg); void OnLButtonUpEx(CFWL_MsgMouse *pMsg); void OnMouseMoveEx(CFWL_MsgMouse *pMsg); private: - FX_INT32 DisForm_OnProcessMessage(CFWL_Message *pMessage); + int32_t DisForm_OnProcessMessage(CFWL_Message *pMessage); void DisForm_OnLButtonUpEx(CFWL_MsgMouse *pMsg); protected: CFWL_DateTimeCalendar *m_pOwner; @@ -94,10 +94,10 @@ public: virtual FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy); virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider *pTP); - virtual FWL_ERR GetCurSel(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay); - virtual FWL_ERR SetCurSel(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay); + virtual FWL_ERR GetCurSel(int32_t &iYear, int32_t &iMonth, int32_t &iDay); + virtual FWL_ERR SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); virtual FWL_ERR SetEditText(const CFX_WideString &wsText); - virtual FWL_ERR GetEditText(CFX_WideString &wsText, FX_INT32 nStart = 0, FX_INT32 nCount = -1) const; + virtual FWL_ERR GetEditText(CFX_WideString &wsText, int32_t nStart = 0, int32_t nCount = -1) const; public: virtual FX_BOOL CanUndo(); virtual FX_BOOL CanRedo(); @@ -113,18 +113,18 @@ public: virtual FX_BOOL Delete(); virtual FX_BOOL DeSelect(); virtual FWL_ERR GetBBox(CFX_RectF &rect); - virtual FWL_ERR SetEditLimit(FX_INT32 nLimit); + virtual FWL_ERR SetEditLimit(int32_t nLimit); virtual FWL_ERR ModifyEditStylesEx(FX_DWORD dwStylesExAdded, FX_DWORD dwStylesExRemoved); public: IFWL_DateTimeEdit* GetDataTimeEdit(); protected: void DrawDropDownButton(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix); - void FormatDateString(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay, CFX_WideString &wsText); + void FormatDateString(int32_t iYear, int32_t iMonth, int32_t iDay, CFX_WideString &wsText); void ShowMonthCalendar(FX_BOOL bActivate); FX_BOOL IsMonthCalendarShowed(); void ReSetEditAlignment(); void InitProxyForm(); - void ProcessSelChanged(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay); + void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay); private: FWL_ERR DisForm_Initialize(); void DisForm_InitDateTimeCalendar(); @@ -141,10 +141,10 @@ protected: CFX_RectF m_rtBtn; CFX_RectF m_rtClient; - FX_INT32 m_iBtnState; - FX_INT32 m_iYear; - FX_INT32 m_iMonth; - FX_INT32 m_iDay; + int32_t m_iBtnState; + int32_t m_iYear; + int32_t m_iMonth; + int32_t m_iDay; FX_BOOL m_bLBtnDown; IFWL_DateTimeEdit *m_pEdit; IFWL_DateTimeCalender *m_pMonthCal; @@ -163,21 +163,21 @@ protected: { return FWL_ERR_Succeeded; } - virtual FX_INT32 GetCurDay(IFWL_Widget *pWidget) + virtual int32_t GetCurDay(IFWL_Widget *pWidget) { return m_iCurDay; } - virtual FX_INT32 GetCurMonth(IFWL_Widget *pWidget) + virtual int32_t GetCurMonth(IFWL_Widget *pWidget) { return m_iCurMonth; } - virtual FX_INT32 GetCurYear(IFWL_Widget *pWidget) + virtual int32_t GetCurYear(IFWL_Widget *pWidget) { return m_iCurYear; } - FX_INT32 m_iCurDay; - FX_INT32 m_iCurYear; - FX_INT32 m_iCurMonth; + int32_t m_iCurDay; + int32_t m_iCurYear; + int32_t m_iCurMonth; }; CFWL_MonthCalendarImpDP m_MonthCalendarDP; @@ -190,7 +190,7 @@ class CFWL_DateTimePickerImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_DateTimePickerImpDelegate(CFWL_DateTimePickerImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: void OnFocusChanged(CFWL_Message *pMsg, FX_BOOL bSet = TRUE); diff --git a/xfa/src/fwl/src/basewidget/include/fwl_editimp.h b/xfa/src/fwl/src/basewidget/include/fwl_editimp.h index b5671e659c..db9e25fb5c 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_editimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_editimp.h @@ -32,25 +32,25 @@ public: virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider *pThemeProvider); virtual FWL_ERR SetText(const CFX_WideString &wsText); - virtual FX_INT32 GetTextLength() const; - virtual FWL_ERR GetText(CFX_WideString &wsText, FX_INT32 nStart = 0, FX_INT32 nCount = -1) const; + virtual int32_t GetTextLength() const; + virtual FWL_ERR GetText(CFX_WideString &wsText, int32_t nStart = 0, int32_t nCount = -1) const; virtual FWL_ERR ClearText(); - virtual FX_INT32 GetCaretPos() const; - virtual FX_INT32 SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore = TRUE); - virtual FWL_ERR AddSelRange(FX_INT32 nStart, FX_INT32 nCount = -1); - virtual FX_INT32 CountSelRanges(); - virtual FX_INT32 GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart); + virtual int32_t GetCaretPos() const; + virtual int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE); + virtual FWL_ERR AddSelRange(int32_t nStart, int32_t nCount = -1); + virtual int32_t CountSelRanges(); + virtual int32_t GetSelRange(int32_t nIndex, int32_t &nStart); virtual FWL_ERR ClearSelections(); - virtual FX_INT32 GetLimit(); - virtual FWL_ERR SetLimit(FX_INT32 nLimit); + virtual int32_t GetLimit(); + virtual FWL_ERR SetLimit(int32_t nLimit); virtual FWL_ERR SetAliasChar(FX_WCHAR wAlias); virtual FWL_ERR SetFormatString(const CFX_WideString &wsFormat); - virtual FWL_ERR Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLen); + virtual FWL_ERR Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLen); virtual FWL_ERR DeleteSelections(); - virtual FWL_ERR DeleteRange(FX_INT32 nStart, FX_INT32 nCount = -1); + virtual FWL_ERR DeleteRange(int32_t nStart, int32_t nCount = -1); virtual FWL_ERR ReplaceSelections(const CFX_WideStringC &wsReplace); - virtual FWL_ERR Replace(FX_INT32 nStart, FX_INT32 nLen, const CFX_WideStringC &wsReplace); - virtual FWL_ERR DoClipboard(FX_INT32 iCmd); + virtual FWL_ERR Replace(int32_t nStart, int32_t nLen, const CFX_WideStringC &wsReplace); + virtual FWL_ERR 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); @@ -63,22 +63,22 @@ public: virtual FX_BOOL CanRedo(); virtual FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); virtual FWL_ERR SetOuter(IFWL_Widget *pOuter); - virtual FWL_ERR SetNumberRange(FX_INT32 iMin, FX_INT32 iMax); - virtual void On_CaretChanged(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPage, FX_BOOL bVisible = TRUE); + virtual FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax); + virtual void On_CaretChanged(IFDE_TxtEdtEngine *pEdit, int32_t nPage, FX_BOOL bVisible = TRUE); virtual void On_TextChanged(IFDE_TxtEdtEngine * pEdit, FDE_TXTEDT_TEXTCHANGE_INFO &ChangeInfo); virtual void On_PageCountChanged(IFDE_TxtEdtEngine *pEdit) {} virtual void On_SelChanged(IFDE_TxtEdtEngine *pEdit); - virtual FX_BOOL On_PageLoad(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPageIndex, FX_INT32 nPurpose); - virtual FX_BOOL On_PageUnload(IFDE_TxtEdtEngine *pEdit, FX_INT32 nPageIndex, FX_INT32 nPurpose); + virtual FX_BOOL On_PageLoad(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex, int32_t nPurpose); + virtual FX_BOOL On_PageUnload(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex, int32_t nPurpose); virtual FX_BOOL On_PageChange(IFDE_TxtEdtEngine *pEdit, FX_BOOL bPageUp = TRUE) { return TRUE; } virtual void On_AddDoRecord(IFDE_TxtEdtEngine *pEdit, FX_BSTR bsDoRecord); - virtual FX_BOOL On_ValidateField(IFDE_TxtEdtEngine *pEdit, FX_INT32 nBlockIndex, FX_INT32 nFieldIndex, \ - const CFX_WideString &wsFieldText, FX_INT32 nCharIndex); - virtual FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine *pEdit, FX_INT32 nBlockIndex); - virtual FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine *pEdit, FX_INT32 nBlockIndex, CFX_WideString &wsBlockText); + virtual FX_BOOL On_ValidateField(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex, int32_t nFieldIndex, \ + const CFX_WideString &wsFieldText, int32_t nCharIndex); + virtual FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex); + virtual FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex, CFX_WideString &wsBlockText); virtual FX_BOOL On_Validate(IFDE_TxtEdtEngine * pEdit, CFX_WideString &wsText); virtual FWL_ERR SetBackgroundColor(FX_DWORD color); virtual FWL_ERR SetFont(const CFX_WideString &wsFont, FX_FLOAT fSize); @@ -107,12 +107,12 @@ protected: void ClearRecord(); FX_BOOL IsShowScrollBar(FX_BOOL bVert); FX_BOOL IsContentHeightOverflow(); - FX_INT32 AddDoRecord(FX_BSTR bsDoRecord); - void ProcessInsertError(FX_INT32 iError); + int32_t AddDoRecord(FX_BSTR bsDoRecord); + void ProcessInsertError(int32_t iError); void DrawSpellCheck(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); - void AddSpellCheckObj(CFX_Path& PathData, FX_INT32 nStart, FX_INT32 nCount, FX_FLOAT fOffSetX, FX_FLOAT fOffSetY); - FX_INT32 GetWordAtPoint(CFX_PointF pointf, FX_INT32& nCount); + void AddSpellCheckObj(CFX_Path& PathData, int32_t nStart, int32_t nCount, FX_FLOAT fOffSetX, FX_FLOAT fOffSetY); + int32_t GetWordAtPoint(CFX_PointF pointf, int32_t& nCount); CFX_RectF m_rtClient; CFX_RectF m_rtEngine; CFX_RectF m_rtStatic; @@ -121,15 +121,15 @@ protected: FX_FLOAT m_fScrollOffsetY; IFDE_TxtEdtEngine* m_pEdtEngine; FX_BOOL m_bLButtonDown; - FX_INT32 m_nSelStart; - FX_INT32 m_nLimit; + 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; - FX_INT32 m_iMin; - FX_INT32 m_iMax; + int32_t m_iMin; + int32_t m_iMax; IFWL_ScrollBar* m_pVertScrollBar; IFWL_ScrollBar* m_pHorzScrollBar; IFWL_Caret* m_pCaret; @@ -141,14 +141,14 @@ protected: FX_BOOL m_updateBackColor; CFX_WideString m_wsFont; CFX_ByteStringArray m_RecordArr; - FX_INT32 m_iCurRecord; - FX_INT32 m_iMaxRecord; + int32_t m_iCurRecord; + int32_t m_iMaxRecord; }; class CFWL_EditImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_EditImpDelegate(CFWL_EditImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: diff --git a/xfa/src/fwl/src/basewidget/include/fwl_formproxyimp.h b/xfa/src/fwl/src/basewidget/include/fwl_formproxyimp.h index def7eb9650..e582f8c0e6 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_formproxyimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_formproxyimp.h @@ -32,7 +32,7 @@ class CFWL_FormProxyImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_FormProxyImpDelegate(CFWL_FormProxyImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); protected: CFWL_FormProxyImp *m_pOwner; }; diff --git a/xfa/src/fwl/src/basewidget/include/fwl_listboximp.h b/xfa/src/fwl/src/basewidget/include/fwl_listboximp.h index 51d605885f..7cbb0b8cfd 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_listboximp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_listboximp.h @@ -28,9 +28,9 @@ public: virtual FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy); virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider *pThemeProvider); - virtual FX_INT32 CountSelItems(); - virtual FWL_HLISTITEM GetSelItem(FX_INT32 nIndexSel); - virtual FX_INT32 GetSelIndex(FX_INT32 nIndex); + virtual int32_t CountSelItems(); + virtual FWL_HLISTITEM GetSelItem(int32_t nIndexSel); + virtual int32_t GetSelIndex(int32_t nIndex); virtual FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE); virtual FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString &wsText); virtual FWL_ERR GetScrollPos(FX_FLOAT &fPos, FX_BOOL bVert = TRUE); @@ -51,7 +51,7 @@ protected: FX_BOOL ScrollToVisible(FWL_HLISTITEM hItem); void DrawBkground(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL); void DrawItems(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL); - void DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, FWL_HLISTITEM hItem, FX_INT32 Index, const CFX_RectF &rtItem, const CFX_Matrix *pMatrix = NULL); + void DrawItem(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, FWL_HLISTITEM hItem, int32_t Index, const CFX_RectF &rtItem, const CFX_Matrix *pMatrix = NULL); void DrawStatic(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme); CFX_SizeF CalcSize(FX_BOOL bAutoSize = FALSE); void GetItemSize(CFX_SizeF &size, FWL_HLISTITEM hItem, FX_FLOAT fWidth, FX_FLOAT fHeight, FX_BOOL bAutoSize = FALSE); @@ -69,7 +69,7 @@ protected: IFWL_ScrollBar* m_pHorzScrollBar; IFWL_ScrollBar* m_pVertScrollBar; FX_DWORD m_dwTTOStyles; - FX_INT32 m_iTTOAligns; + int32_t m_iTTOAligns; FWL_HLISTITEM m_hAnchor; FX_FLOAT m_fItemHeight; FX_FLOAT m_fScorllBarWidth; @@ -81,7 +81,7 @@ class CFWL_ListBoxImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_ListBoxImpDelegate(CFWL_ListBoxImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: diff --git a/xfa/src/fwl/src/basewidget/include/fwl_monthcalendarimp.h b/xfa/src/fwl/src/basewidget/include/fwl_monthcalendarimp.h index fc4da5864f..0cf2ed444a 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_monthcalendarimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_monthcalendarimp.h @@ -12,7 +12,7 @@ class CFWL_WidgetImpDelegate; class IFWL_Widget; class IFDE_DateTime; class CFDE_DateTime; -extern FX_BYTE FX_DaysInMonth(FX_INT32 iYear, FX_BYTE iMonth); +extern uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth); class CFWL_MonthCalendarImp; class CFWL_MonthCalendarImpDelegate; class CFWL_MonthCalendarImp : public CFWL_WidgetImp @@ -28,9 +28,9 @@ public: virtual FWL_ERR GetWidgetRect(CFX_RectF &rect, FX_BOOL bAutoSize = FALSE); virtual FWL_ERR Update(); virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); - virtual FX_INT32 CountSelect(); - virtual FX_BOOL GetSelect(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay, FX_INT32 nIndex = 0); - virtual FX_BOOL SetSelect(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay); + virtual int32_t CountSelect(); + virtual FX_BOOL GetSelect(int32_t &iYear, int32_t &iMonth, int32_t &iDay, int32_t nIndex = 0); + virtual FX_BOOL SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay); protected: void DrawBkground(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix); void DrawHeadBK(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix); @@ -53,25 +53,25 @@ protected: void CalcTodaySize(); void CalDateItem(); void GetCapValue(); - FX_INT32 CalWeekNumber(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay); + int32_t CalWeekNumber(int32_t iYear, int32_t iMonth, int32_t iDay); - FX_BOOL GetMinDate(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay); - FX_BOOL SetMinDate(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay); - FX_BOOL GetMaxDate(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay); - FX_BOOL SetMaxDate(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 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(); void ClearDateItem(); void ReSetDateItem(); FX_BOOL NextMonth(); FX_BOOL PrevMonth(); - void ChangeToMonth(FX_INT32 iYear, FX_INT32 iMonth); - FX_BOOL RemoveSelDay(FX_INT32 iDay, FX_BOOL bAll = FALSE); - FX_BOOL AddSelDay(FX_INT32 iDay); + 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(); - void GetHeadText(FX_INT32 iYear, FX_INT32 iMonth, CFX_WideString &wsHead); - void GetTodayText(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay, CFX_WideString &wsToday); - FX_INT32 GetDayAtPoint(FX_FLOAT x, FX_FLOAT y); - FX_BOOL GetDayRect(FX_INT32 iDay, CFX_RectF &rtDay); + 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); typedef struct _DATE { _DATE() { @@ -79,7 +79,7 @@ protected: iMonth = 0; iDay = 0; } - _DATE(FX_INT32 year, FX_INT32 month, FX_INT32 day) : iYear(year), iMonth(month), iDay(day) {} + _DATE(int32_t year, int32_t month, int32_t day) : iYear(year), iMonth(month), iDay(day) {} FX_BOOL operator < (const _DATE &right) { if (iYear < right.iYear) { @@ -106,9 +106,9 @@ protected: } return FALSE; } - FX_INT32 iYear; - FX_INT32 iMonth; - FX_INT32 iDay; + int32_t iYear; + int32_t iMonth; + int32_t iDay; } DATE, *LPDATE; FX_BOOL m_bInit; @@ -128,22 +128,22 @@ protected: CFX_WideString m_wsToday; CFX_DateTime *m_pDateTime; CFX_PtrArray m_arrDates; - FX_INT32 m_iCurYear; - FX_INT32 m_iCurMonth; - FX_INT32 m_iYear; - FX_INT32 m_iMonth; - FX_INT32 m_iDay; - FX_INT32 m_iHovered; - FX_INT32 m_iLBtnPartStates; - FX_INT32 m_iRBtnPartStates; + int32_t m_iCurYear; + int32_t m_iCurMonth; + int32_t m_iYear; + int32_t m_iMonth; + int32_t m_iDay; + int32_t m_iHovered; + int32_t m_iLBtnPartStates; + int32_t m_iRBtnPartStates; DATE m_dtMin; DATE m_dtMax; CFX_SizeF m_szHead; CFX_SizeF m_szCell; CFX_SizeF m_szToday; - typedef CFX_ArrayTemplate CFWL_Int32Array; + typedef CFX_ArrayTemplate CFWL_Int32Array; CFWL_Int32Array m_arrSelDays; - FX_INT32 m_iMaxSel; + int32_t m_iMaxSel; CFX_RectF m_rtClient; FX_FLOAT m_fHeadWid; FX_FLOAT m_fHeadHei; @@ -178,9 +178,9 @@ protected: friend class CFWL_MonthCalendarImpDelegate; }; typedef struct _DATEINFO { - _DATEINFO(FX_INT32 day, FX_INT32 dayofweek, FX_DWORD dwSt, CFX_RectF rc, CFX_WideString &wsday) : iDay(day), iDayOfWeek(dayofweek), dwStates(dwSt), rect(rc), wsDay(wsday) {} - FX_INT32 iDay; - FX_INT32 iDayOfWeek; + _DATEINFO(int32_t day, int32_t dayofweek, FX_DWORD dwSt, CFX_RectF rc, CFX_WideString &wsday) : iDay(day), iDayOfWeek(dayofweek), dwStates(dwSt), rect(rc), wsDay(wsday) {} + int32_t iDay; + int32_t iDayOfWeek; FX_DWORD dwStates; CFX_RectF rect; CFX_WideString wsDay; @@ -189,7 +189,7 @@ class CFWL_MonthCalendarImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_MonthCalendarImpDelegate(CFWL_MonthCalendarImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: void OnActivate(CFWL_Message *pMsg); diff --git a/xfa/src/fwl/src/basewidget/include/fwl_pushbuttonimp.h b/xfa/src/fwl/src/basewidget/include/fwl_pushbuttonimp.h index 1688da887c..5238884979 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_pushbuttonimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_pushbuttonimp.h @@ -35,14 +35,14 @@ protected: CFX_RectF m_rtCaption; FX_BOOL m_bBtnDown; FX_DWORD m_dwTTOStyles; - FX_INT32 m_iTTOAlign; + int32_t m_iTTOAlign; friend class CFWL_PushButtonImpDelegate; }; class CFWL_PushButtonImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_PushButtonImpDelegate(CFWL_PushButtonImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: diff --git a/xfa/src/fwl/src/basewidget/include/fwl_scrollbarimp.h b/xfa/src/fwl/src/basewidget/include/fwl_scrollbarimp.h index e4073b5fc7..9b8dc19efb 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_scrollbarimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_scrollbarimp.h @@ -40,7 +40,7 @@ public: virtual FWL_ERR SetTrackPos(FX_FLOAT fTrackPos); virtual FX_BOOL DoScroll(FX_DWORD dwCode, FX_FLOAT fPos = 0.0f); virtual FWL_ERR SetOuter(IFWL_Widget *pOuter); - virtual FX_INT32 Run(FWL_HTIMER hTimer); + virtual int32_t Run(FWL_HTIMER hTimer); protected: void DrawTrack(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, FX_BOOL bLower = TRUE, const CFX_Matrix *pMatrix = NULL); void DrawArrowBtn(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, FX_BOOL bMinBtn = TRUE, const CFX_Matrix *pMatrix = NULL); @@ -64,15 +64,15 @@ protected: FX_FLOAT m_fStepSize; FX_FLOAT m_fPos; FX_FLOAT m_fTrackPos; - FX_INT32 m_iMinButtonState; - FX_INT32 m_iMaxButtonState; - FX_INT32 m_iThumbButtonState; - FX_INT32 m_iMinTrackState; - FX_INT32 m_iMaxTrackState; + int32_t m_iMinButtonState; + int32_t m_iMaxButtonState; + int32_t m_iThumbButtonState; + int32_t m_iMinTrackState; + int32_t m_iMaxTrackState; FX_FLOAT m_fLastTrackPos; FX_FLOAT m_cpTrackPointX; FX_FLOAT m_cpTrackPointY; - FX_INT32 m_iMouseWheel; + int32_t m_iMouseWheel; FX_BOOL m_bTrackMouseLeave; FX_BOOL m_bMouseHover; FX_BOOL m_bMouseDown; @@ -94,7 +94,7 @@ class CFWL_ScrollBarImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_ScrollBarImpDelegate(CFWL_ScrollBarImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: void OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); @@ -102,11 +102,11 @@ protected: void OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); void OnMouseLeave(); void OnMouseWheel(FX_FLOAT fx, FX_FLOAT fy, FX_DWORD dwFlags, FX_FLOAT fDeltaX, FX_FLOAT fDeltaY); - void DoMouseDown(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState, FX_FLOAT fx, FX_FLOAT fy); - void DoMouseUp(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState, FX_FLOAT fx, FX_FLOAT fy); - void DoMouseMove(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState, FX_FLOAT fx, FX_FLOAT fy); - void DoMouseLeave(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState); - void DoMouseHover(FX_INT32 iItem, const CFX_RectF &rtItem, FX_INT32 &iState); + void DoMouseDown(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState, FX_FLOAT fx, FX_FLOAT fy); + void DoMouseUp(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState, FX_FLOAT fx, FX_FLOAT fy); + void DoMouseMove(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState, FX_FLOAT fx, FX_FLOAT fy); + void DoMouseLeave(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState); + void DoMouseHover(int32_t iItem, const CFX_RectF &rtItem, int32_t &iState); CFWL_ScrollBarImp *m_pOwner; }; diff --git a/xfa/src/fwl/src/basewidget/include/fwl_spinbuttonimp.h b/xfa/src/fwl/src/basewidget/include/fwl_spinbuttonimp.h index 2275a40f90..808903c1d0 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_spinbuttonimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_spinbuttonimp.h @@ -27,7 +27,7 @@ public: virtual FWL_ERR Update(); virtual FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy); virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); - virtual FX_INT32 Run(FWL_HTIMER hTimer); + virtual int32_t Run(FWL_HTIMER hTimer); FWL_ERR EnableButton(FX_BOOL bEnable, FX_BOOL bUp = TRUE); FX_BOOL IsButtonEnable(FX_BOOL bUp = TRUE); protected: @@ -38,7 +38,7 @@ protected: CFX_RectF m_rtDnButton; FX_DWORD m_dwUpState; FX_DWORD m_dwDnState; - FX_INT32 m_iButtonIndex; + int32_t m_iButtonIndex; FX_BOOL m_bLButtonDwn; FWL_HTIMER m_hTimer; friend class CFWL_SpinButtonImpDelegate; @@ -47,7 +47,7 @@ class CFWL_SpinButtonImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_SpinButtonImpDelegate(CFWL_SpinButtonImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: diff --git a/xfa/src/fwl/src/basewidget/include/fwl_tooltipctrlimp.h b/xfa/src/fwl/src/basewidget/include/fwl_tooltipctrlimp.h index 7317f3fe5b..6532ebab53 100644 --- a/xfa/src/fwl/src/basewidget/include/fwl_tooltipctrlimp.h +++ b/xfa/src/fwl/src/basewidget/include/fwl_tooltipctrlimp.h @@ -42,14 +42,14 @@ protected: CFWL_ToolTipTimer() {}; ~CFWL_ToolTipTimer() {}; CFWL_ToolTipTimer(CFWL_ToolTipImp * pToolTip); - virtual FX_INT32 Run(FWL_HTIMER hTimer); + virtual int32_t Run(FWL_HTIMER hTimer); CFWL_ToolTipImp *m_pToolTip; }; CFX_RectF m_rtClient; CFX_RectF m_rtCaption; FX_BOOL m_bBtnDown; FX_DWORD m_dwTTOStyles; - FX_INT32 m_iTTOAlign; + int32_t m_iTTOAlign; CFX_RectF m_rtAnchor; FWL_HTIMER m_hTimerShow; FWL_HTIMER m_hTimerHide; @@ -63,7 +63,7 @@ class CFWL_ToolTipImpDelegate : public CFWL_WidgetImpDelegate { public: CFWL_ToolTipImpDelegate(CFWL_ToolTipImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: diff --git a/xfa/src/fwl/src/basewidget/include/fxmath_barcodeimp.h b/xfa/src/fwl/src/basewidget/include/fxmath_barcodeimp.h index 8fe41b762c..0c4e38dd9e 100644 --- a/xfa/src/fwl/src/basewidget/include/fxmath_barcodeimp.h +++ b/xfa/src/fwl/src/basewidget/include/fxmath_barcodeimp.h @@ -14,30 +14,30 @@ public: FX_BOOL Crreate(BC_TYPE type); virtual void Release(); virtual BC_TYPE GetType(); - virtual FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e); - virtual FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e); - virtual FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e); - virtual CFX_WideString Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 height, FX_INT32 &errorCode); - virtual CFX_WideString Decode(CFX_DIBitmap *pBitmap, FX_INT32 &errorCode); + virtual FX_BOOL Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e); + virtual FX_BOOL RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e); + virtual FX_BOOL RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e); + virtual CFX_WideString Decode(uint8_t* buf, int32_t width, int32_t height, int32_t &errorCode); + virtual CFX_WideString Decode(CFX_DIBitmap *pBitmap, int32_t &errorCode); virtual FX_BOOL SetCharEncoding(BC_CHAR_ENCODING encoding); - virtual FX_BOOL SetModuleHeight(FX_INT32 moduleHeight); - virtual FX_BOOL SetModuleWidth(FX_INT32 moduleWidth); - virtual FX_BOOL SetHeight(FX_INT32 height); - virtual FX_BOOL SetWidth(FX_INT32 width); + 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 FX_BOOL CheckContentValidity(FX_WSTR contents); virtual FX_BOOL SetPrintChecksum(FX_BOOL checksum); - virtual FX_BOOL SetDataLength(FX_INT32 length); - virtual FX_BOOL SetCalChecksum(FX_INT32 state); + virtual FX_BOOL SetDataLength(int32_t length); + virtual FX_BOOL SetCalChecksum(int32_t state); virtual FX_BOOL SetFont(CFX_Font* pFont); virtual FX_BOOL SetFontSize(FX_FLOAT size); - virtual FX_BOOL SetFontStyle(FX_INT32 style); + virtual FX_BOOL SetFontStyle(int32_t style); virtual FX_BOOL SetFontColor(FX_ARGB color); virtual FX_BOOL SetTextLocation(BC_TEXT_LOC location); - virtual FX_BOOL SetWideNarrowRatio(FX_INT32 ratio); + virtual FX_BOOL SetWideNarrowRatio(int32_t ratio); virtual FX_BOOL SetStartChar(FX_CHAR start); virtual FX_BOOL SetEndChar(FX_CHAR end); - virtual FX_BOOL SetVersion(FX_INT32 version); - virtual FX_BOOL SetErrorCorrectionLevel(FX_INT32 level); + virtual FX_BOOL SetVersion(int32_t version); + virtual FX_BOOL SetErrorCorrectionLevel(int32_t level); virtual FX_BOOL SetTruncated(FX_BOOL truncated); protected: CBC_CodeBase* m_pBCEngine; diff --git a/xfa/src/fwl/src/core/fwl_appimp.cpp b/xfa/src/fwl/src/core/fwl_appimp.cpp index e70d3f6a09..33d2fff886 100644 --- a/xfa/src/fwl/src/core/fwl_appimp.cpp +++ b/xfa/src/fwl/src/core/fwl_appimp.cpp @@ -70,7 +70,7 @@ FWL_ERR CFWL_AppImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) m_pThemeProvider = pThemeProvider; return FWL_ERR_Succeeded; } -FWL_ERR CFWL_AppImp::Exit(FX_INT32 iExitCode ) +FWL_ERR CFWL_AppImp::Exit(int32_t iExitCode ) { while (m_pNoteDriver->PopNoteLoop()); return m_pWidgetMgr->GetAdapterWidgetMgr()->Exit(0); diff --git a/xfa/src/fwl/src/core/fwl_contentimp.cpp b/xfa/src/fwl/src/core/fwl_contentimp.cpp index 3093aebf74..93c8c3b612 100644 --- a/xfa/src/fwl/src/core/fwl_contentimp.cpp +++ b/xfa/src/fwl/src/core/fwl_contentimp.cpp @@ -21,7 +21,7 @@ FWL_ERR IFWL_Content::Initialize() ((CFWL_ContentImp*)m_pData)->SetInterface(this); return ((CFWL_ContentImp*)m_pData)->Initialize(); } -FWL_ERR IFWL_Content::InsertWidget(IFWL_Widget *pChild, FX_INT32 nIndex ) +FWL_ERR IFWL_Content::InsertWidget(IFWL_Widget *pChild, int32_t nIndex ) { return ((CFWL_ContentImp*)m_pData)->InsertWidget(pChild, nIndex); } @@ -78,7 +78,7 @@ CFWL_ContentImp::CFWL_ContentImp(const CFWL_WidgetImpProperties &properties) CFWL_ContentImp::~CFWL_ContentImp() { } -FWL_ERR CFWL_ContentImp::InsertWidget(IFWL_Widget *pChild, FX_INT32 nIndex ) +FWL_ERR CFWL_ContentImp::InsertWidget(IFWL_Widget *pChild, int32_t nIndex ) { _FWL_RETURN_VALUE_IF_FAIL(pChild, FWL_ERR_Indefinite); pChild->SetParent(m_pInterface); diff --git a/xfa/src/fwl/src/core/fwl_formimp.cpp b/xfa/src/fwl/src/core/fwl_formimp.cpp index 2491999484..db78afa369 100644 --- a/xfa/src/fwl/src/core/fwl_formimp.cpp +++ b/xfa/src/fwl/src/core/fwl_formimp.cpp @@ -326,7 +326,7 @@ FWL_ERR CFWL_FormImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMat _FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pThemeProvider, FWL_ERR_Indefinite); IFWL_ThemeProvider *pTheme = m_pProperties->m_pThemeProvider; FX_BOOL bInactive = !IsActive(); - FX_INT32 iState = bInactive ? FWL_PARTSTATE_FRM_Inactive : FWL_PARTSTATE_FRM_Normal; + int32_t iState = bInactive ? FWL_PARTSTATE_FRM_Inactive : FWL_PARTSTATE_FRM_Normal; if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_NoDrawClient) == 0) { DrawBackground(pGraphics, pTheme); } @@ -599,7 +599,7 @@ CFWL_SysBtn* CFWL_FormImp::GetSysBtnByState(FX_DWORD dwState) } return NULL; } -CFWL_SysBtn* CFWL_FormImp::GetSysBtnByIndex(FX_INT32 nIndex) +CFWL_SysBtn* CFWL_FormImp::GetSysBtnByIndex(int32_t nIndex) { if (nIndex < 0) { return NULL; @@ -616,7 +616,7 @@ CFWL_SysBtn* CFWL_FormImp::GetSysBtnByIndex(FX_INT32 nIndex) } return (CFWL_SysBtn*) arrBtn[nIndex]; } -FX_INT32 CFWL_FormImp::GetSysBtnIndex(CFWL_SysBtn *pBtn) +int32_t CFWL_FormImp::GetSysBtnIndex(CFWL_SysBtn *pBtn) { CFX_PtrArray arrBtn; if (m_pMinBox) { @@ -989,12 +989,12 @@ CFWL_FormDelegate::CFWL_FormDelegate(CFWL_FormImp *pOwner) : m_pOwner(pOwner) { } -FX_INT32 CFWL_FormDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_FormDelegate::OnProcessMessage(CFWL_Message *pMessage) { #ifdef FWL_UseMacSystemBorder _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); FX_DWORD dwMsgCode = pMessage->GetClassID(); - FX_INT32 iRet = 1; + int32_t iRet = 1; switch (dwMsgCode) { case FWL_MSGHASH_Activate: { m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Deactivated; @@ -1011,7 +1011,7 @@ FX_INT32 CFWL_FormDelegate::OnProcessMessage(CFWL_Message *pMessage) #else _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); FX_DWORD dwMsgCode = pMessage->GetClassID(); - FX_INT32 iRet = 1; + int32_t iRet = 1; switch (dwMsgCode) { case FWL_MSGHASH_Activate: { m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Deactivated; diff --git a/xfa/src/fwl/src/core/fwl_gridimp.cpp b/xfa/src/fwl/src/core/fwl_gridimp.cpp index 18ade073a4..56eb655231 100644 --- a/xfa/src/fwl/src/core/fwl_gridimp.cpp +++ b/xfa/src/fwl/src/core/fwl_gridimp.cpp @@ -27,19 +27,19 @@ FWL_ERR IFWL_Grid::Initialize(CFWL_WidgetImpProperties &properties) ((CFWL_GridImp*)m_pData)->SetInterface(this); return ((CFWL_GridImp*)m_pData)->Initialize(); } -FWL_HGRIDCOLROW IFWL_Grid::InsertColRow(FX_BOOL bColumn, FX_INT32 nIndex ) +FWL_HGRIDCOLROW IFWL_Grid::InsertColRow(FX_BOOL bColumn, int32_t nIndex ) { return ((CFWL_GridImp*)m_pData)->InsertColRow(bColumn, nIndex); } -FX_INT32 IFWL_Grid::CountColRows(FX_BOOL bColumn) +int32_t IFWL_Grid::CountColRows(FX_BOOL bColumn) { return ((CFWL_GridImp*)m_pData)->CountColRows(bColumn); } -FWL_HGRIDCOLROW IFWL_Grid::GetColRow(FX_BOOL bColumn, FX_INT32 nIndex) +FWL_HGRIDCOLROW IFWL_Grid::GetColRow(FX_BOOL bColumn, int32_t nIndex) { return ((CFWL_GridImp*)m_pData)->GetColRow(bColumn, nIndex); } -FX_INT32 IFWL_Grid::GetIndex(FWL_HGRIDCOLROW hColRow) +int32_t IFWL_Grid::GetIndex(FWL_HGRIDCOLROW hColRow) { return ((CFWL_GridImp*)m_pData)->GetIndex(hColRow); } @@ -75,19 +75,19 @@ FX_BOOL IFWL_Grid::IsColumn(FWL_HGRIDCOLROW hColRow) { return ((CFWL_GridImp*)m_pData)->IsColumn(hColRow); } -FX_INT32 IFWL_Grid::GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn) +int32_t IFWL_Grid::GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn) { return ((CFWL_GridImp*)m_pData)->GetWidgetPos(pWidget, bColumn); } -FWL_ERR IFWL_Grid::SetWidgetPos(IFWL_Widget *pWidget, FX_INT32 iPos, FX_BOOL bColumn) +FWL_ERR IFWL_Grid::SetWidgetPos(IFWL_Widget *pWidget, int32_t iPos, FX_BOOL bColumn) { return ((CFWL_GridImp*)m_pData)->SetWidgetPos(pWidget, iPos, bColumn); } -FX_INT32 IFWL_Grid::GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn) +int32_t IFWL_Grid::GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn) { return ((CFWL_GridImp*)m_pData)->GetWidgetSpan(pWidget, bColumn); } -FWL_ERR IFWL_Grid::SetWidgetSpan(IFWL_Widget *pWidget, FX_INT32 iSpan, FX_BOOL bColumn) +FWL_ERR IFWL_Grid::SetWidgetSpan(IFWL_Widget *pWidget, int32_t iSpan, FX_BOOL bColumn) { return ((CFWL_GridImp*)m_pData)->SetWidgetSpan(pWidget, iSpan , bColumn); } @@ -163,13 +163,13 @@ CFWL_GridImp::CFWL_GridImp(const CFWL_WidgetImpProperties &properties) } CFWL_GridImp::~CFWL_GridImp() { - FX_INT32 iCount = m_Columns.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = m_Columns.GetSize(); + for (int32_t i = 0; i < iCount; i++) { delete (CFWL_GridColRow *) m_Columns[i]; } m_Columns.RemoveAll(); iCount = m_Rows.GetSize(); - for (FX_INT32 j = 0; j < iCount; j++) { + for (int32_t j = 0; j < iCount; j++) { delete (CFWL_GridColRow*) m_Rows[j]; } m_Rows.RemoveAll(); @@ -251,8 +251,8 @@ FWL_ERR CFWL_GridImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMat FX_BOOL bDrawLine = FALSE; CFX_Path path; path.Create(); - FX_INT32 iColumns = m_Columns.GetSize(); - for (FX_INT32 i = 1; i < iColumns; i++) { + int32_t iColumns = m_Columns.GetSize(); + for (int32_t i = 1; i < iColumns; i++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Columns[i]; if (!pColRow) { continue; @@ -265,8 +265,8 @@ FWL_ERR CFWL_GridImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMat pColRow->m_fActualPos, m_pProperties->m_rtWidget.height); } - FX_INT32 iRows = m_Rows.GetSize(); - for (FX_INT32 j = 1; j < iRows; j++) { + int32_t iRows = m_Rows.GetSize(); + for (int32_t j = 1; j < iRows; j++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Rows[j]; if (!pColRow) { continue; @@ -288,7 +288,7 @@ FWL_ERR CFWL_GridImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMat pGraphics->RestoreGraphState(); return FWL_ERR_Succeeded; } -FWL_ERR CFWL_GridImp::InsertWidget(IFWL_Widget *pChild, FX_INT32 nIndex ) +FWL_ERR CFWL_GridImp::InsertWidget(IFWL_Widget *pChild, int32_t nIndex ) { _FWL_RETURN_VALUE_IF_FAIL(pChild, FWL_ERR_Indefinite); CFWL_ContentImp::InsertWidget(pChild, nIndex); @@ -306,12 +306,12 @@ FWL_ERR CFWL_GridImp::RemoveWidget(IFWL_Widget* pWidget) if (CFWL_GridWidgetInfo *pInfo = (CFWL_GridWidgetInfo*)m_mapWidgetInfo.GetValueAt(pWidget)) { m_mapWidgetInfo.RemoveKey(pWidget); delete pInfo; - FX_INT32 nIndex = m_Widgets.Find(pWidget); + int32_t nIndex = m_Widgets.Find(pWidget); m_Widgets.RemoveAt(nIndex, 1); } return FWL_ERR_Succeeded; } -FWL_HGRIDCOLROW CFWL_GridImp::InsertColRow(FX_BOOL bColumn, FX_INT32 nIndex ) +FWL_HGRIDCOLROW CFWL_GridImp::InsertColRow(FX_BOOL bColumn, int32_t nIndex ) { if (bColumn) { if (nIndex < 0 || nIndex > m_Columns.GetSize()) { @@ -328,14 +328,14 @@ FWL_HGRIDCOLROW CFWL_GridImp::InsertColRow(FX_BOOL bColumn, FX_INT32 nIndex ) m_Rows.InsertAt(nIndex, pRow, 1); return (FWL_HGRIDCOLROW)pRow; } -FX_INT32 CFWL_GridImp::CountColRows(FX_BOOL bColumn) +int32_t CFWL_GridImp::CountColRows(FX_BOOL bColumn) { if (bColumn) { return m_Columns.GetSize(); } return m_Rows.GetSize(); } -FWL_HGRIDCOLROW CFWL_GridImp::GetColRow(FX_BOOL bColumn, FX_INT32 nIndex) +FWL_HGRIDCOLROW CFWL_GridImp::GetColRow(FX_BOOL bColumn, int32_t nIndex) { if (bColumn) { if (nIndex < 0 || nIndex >= m_Columns.GetSize()) { @@ -348,7 +348,7 @@ FWL_HGRIDCOLROW CFWL_GridImp::GetColRow(FX_BOOL bColumn, FX_INT32 nIndex) } return (FWL_HGRIDCOLROW)m_Rows[nIndex]; } -FX_INT32 CFWL_GridImp::GetIndex(FWL_HGRIDCOLROW hColRow) +int32_t CFWL_GridImp::GetIndex(FWL_HGRIDCOLROW hColRow) { if (IsColumn(hColRow)) { return m_Columns.Find(hColRow); @@ -402,7 +402,7 @@ FWL_ERR CFWL_GridImp::SetMaxSize(FWL_HGRIDCOLROW hColRow, FX_FLOAT fSize, FWL_GR } FX_BOOL CFWL_GridImp::DeleteColRow(FWL_HGRIDCOLROW hColRow) { - FX_INT32 nIndex = m_Columns.Find(hColRow); + int32_t nIndex = m_Columns.Find(hColRow); if (nIndex >= 0) { m_Columns.RemoveAt(nIndex); delete (CFWL_GridColRow*)hColRow; @@ -420,7 +420,7 @@ FX_BOOL CFWL_GridImp::IsColumn(FWL_HGRIDCOLROW hColRow) { return m_Columns.Find(hColRow) != -1; } -FX_INT32 CFWL_GridImp::GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn) +int32_t CFWL_GridImp::GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn) { CFWL_GridWidgetInfo *pInfo = (CFWL_GridWidgetInfo*)GetWidgetInfo(pWidget); if (pInfo) { @@ -428,7 +428,7 @@ FX_INT32 CFWL_GridImp::GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn) } return -1; } -FWL_ERR CFWL_GridImp::SetWidgetPos(IFWL_Widget *pWidget, FX_INT32 iPos, FX_BOOL bColumn) +FWL_ERR CFWL_GridImp::SetWidgetPos(IFWL_Widget *pWidget, int32_t iPos, FX_BOOL bColumn) { CFWL_GridWidgetInfo *pInfo = (CFWL_GridWidgetInfo*)GetWidgetInfo(pWidget); if (pInfo) { @@ -436,7 +436,7 @@ FWL_ERR CFWL_GridImp::SetWidgetPos(IFWL_Widget *pWidget, FX_INT32 iPos, FX_BOOL } return FWL_ERR_Succeeded; } -FX_INT32 CFWL_GridImp::GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn) +int32_t CFWL_GridImp::GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn) { CFWL_GridWidgetInfo *pInfo = (CFWL_GridWidgetInfo*)GetWidgetInfo(pWidget); if (pInfo) { @@ -444,7 +444,7 @@ FX_INT32 CFWL_GridImp::GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn) } return 0; } -FWL_ERR CFWL_GridImp::SetWidgetSpan(IFWL_Widget *pWidget, FX_INT32 iSpan, FX_BOOL bColumn) +FWL_ERR CFWL_GridImp::SetWidgetSpan(IFWL_Widget *pWidget, int32_t iSpan, FX_BOOL bColumn) { CFWL_GridWidgetInfo *pInfo = (CFWL_GridWidgetInfo*)GetWidgetInfo(pWidget); if (pInfo) { @@ -511,7 +511,7 @@ CFWL_GridWidgetInfo* CFWL_GridImp::GetWidgetInfo(IFWL_Widget* pWidget) { return (CFWL_GridWidgetInfo*)m_mapWidgetInfo.GetValueAt(pWidget); } -void CFWL_GridImp::ProcFixedColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn) +void CFWL_GridImp::ProcFixedColRow(CFWL_GridColRow *pColRow, int32_t nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn) { pColRow->m_fActualSize = fColRowSize; FX_POSITION ps = m_mapWidgetInfo.GetStartPosition(); @@ -530,7 +530,7 @@ void CFWL_GridImp::ProcFixedColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX } } } -void CFWL_GridImp::ProcAutoColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_BOOL bColumn) +void CFWL_GridImp::ProcAutoColRow(CFWL_GridColRow *pColRow, int32_t nIndex, FX_BOOL bColumn) { _FWL_RETURN_IF_FAIL(pColRow); FX_FLOAT fMaxSize = 0, fWidgetSize = 0; @@ -562,7 +562,7 @@ void CFWL_GridImp::ProcAutoColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_ } SetColRowActualSize(pColRow, fMaxSize); } -void CFWL_GridImp::ProcScaledColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn) +void CFWL_GridImp::ProcScaledColRow(CFWL_GridColRow *pColRow, int32_t nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn) { if (fColRowSize > 0) { ProcFixedColRow(pColRow, nIndex, fColRowSize, bColumn); @@ -655,7 +655,7 @@ FX_FLOAT CFWL_GridImp::ProcessColumns(FX_FLOAT fWidth) if (fWidth <= 0) { return ProcessUnCertainColumns(); } - FX_INT32 iColumns = m_Columns.GetSize(); + int32_t iColumns = m_Columns.GetSize(); if (iColumns < 1) { return fWidth; } @@ -664,7 +664,7 @@ FX_FLOAT CFWL_GridImp::ProcessColumns(FX_FLOAT fWidth) CFX_PtrArray autoColumns; CFX_PtrArray scaledColumns; FX_FLOAT fScaledColumnNum = 0; - for (FX_INT32 i = 0; i < iColumns; i++) { + for (int32_t i = 0; i < iColumns; i++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Columns[i]; if (!pColRow) { continue; @@ -698,9 +698,9 @@ FX_FLOAT CFWL_GridImp::ProcessColumns(FX_FLOAT fWidth) } CFX_PtrArray spanAutoColumns; FX_FLOAT fSpanSize = 0; - FX_INT32 iAutoColRows = 0; - FX_INT32 iScaledColRows = 0; - for (FX_INT32 i = 0; i < pInfo->m_iColumnSpan; i++) { + int32_t iAutoColRows = 0; + int32_t iScaledColRows = 0; + for (int32_t i = 0; i < pInfo->m_iColumnSpan; i++) { CFWL_GridColRow *pColumn = (CFWL_GridColRow*)GetColRow(TRUE, pInfo->m_iColumn + i); if (!pColumn) { break; @@ -724,8 +724,8 @@ FX_FLOAT CFWL_GridImp::ProcessColumns(FX_FLOAT fWidth) } } } - FX_INT32 iAutoCols = autoColumns.GetSize(); - for (FX_INT32 k = 0; k < iAutoCols; k++) { + int32_t iAutoCols = autoColumns.GetSize(); + for (int32_t k = 0; k < iAutoCols; k++) { fAutoWidth += ((CFWL_GridColRow*)autoColumns[k])->m_fActualSize; } FX_FLOAT fScaledWidth = fWidth - fFixedWidth - fAutoWidth; @@ -739,7 +739,7 @@ FX_FLOAT CFWL_GridImp::ProcessRows(FX_FLOAT fHeight) if (fHeight <= 0) { return ProcessUnCertainRows(); } - FX_INT32 iRows = m_Rows.GetSize(); + int32_t iRows = m_Rows.GetSize(); if (iRows < 1) { return fHeight; } @@ -748,7 +748,7 @@ FX_FLOAT CFWL_GridImp::ProcessRows(FX_FLOAT fHeight) CFX_PtrArray autoRows; CFX_PtrArray scaledRows; FX_FLOAT fScaledRowNum = 0; - for (FX_INT32 i = 0; i < iRows; i++) { + for (int32_t i = 0; i < iRows; i++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Rows[i]; if (!pColRow) { continue; @@ -783,9 +783,9 @@ FX_FLOAT CFWL_GridImp::ProcessRows(FX_FLOAT fHeight) } CFX_PtrArray spanAutoRows; FX_FLOAT fSpanSize = 0; - FX_INT32 iAutoColRows = 0; - FX_INT32 iScaledColRows = 0; - for (FX_INT32 i = 0; i < pInfo->m_iRowSpan; i++) { + int32_t iAutoColRows = 0; + int32_t iScaledColRows = 0; + for (int32_t i = 0; i < pInfo->m_iRowSpan; i++) { CFWL_GridColRow *pRow = (CFWL_GridColRow*)GetColRow(FALSE, pInfo->m_iRow + i); if (!pRow) { break; @@ -809,8 +809,8 @@ FX_FLOAT CFWL_GridImp::ProcessRows(FX_FLOAT fHeight) } } } - FX_INT32 iAutoRows = autoRows.GetSize(); - for (FX_INT32 k = 0; k < iAutoRows; k++) { + int32_t iAutoRows = autoRows.GetSize(); + for (int32_t k = 0; k < iAutoRows; k++) { fAutoHeigt += ((CFWL_GridColRow*)autoRows[k])->m_fActualSize; } FX_FLOAT fScaledHeight = fHeight - fFixedHeight - fAutoHeigt; @@ -821,7 +821,7 @@ FX_FLOAT CFWL_GridImp::ProcessRows(FX_FLOAT fHeight) } FX_FLOAT CFWL_GridImp::ProcessUnCertainColumns() { - FX_INT32 iColumns = m_Columns.GetSize(); + int32_t iColumns = m_Columns.GetSize(); if (iColumns < 1) { CFWL_GridColRow *pColRow = new CFWL_GridColRow; pColRow->m_Size.eUnit = FWL_GRIDUNIT_Auto; @@ -835,7 +835,7 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainColumns() CFX_PtrArray scaledColumns; FX_FLOAT fScaledColumnNum = 0; FX_FLOAT fScaledMaxPerWidth = 0; - for (FX_INT32 i = 0; i < iColumns; i++) { + for (int32_t i = 0; i < iColumns; i++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Columns[i]; if (!pColRow) { continue; @@ -867,7 +867,7 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainColumns() } } iColumns = scaledColumns.GetSize(); - for (FX_INT32 j = 0; j < iColumns; j++) { + for (int32_t j = 0; j < iColumns; j++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)scaledColumns[j]; if (!pColRow) { continue; @@ -886,9 +886,9 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainColumns() CFX_PtrArray spanScaledColumns; FX_FLOAT fSpanSize = 0; FX_FLOAT fScaledSum = 0; - FX_INT32 iAutoColRows = 0; - FX_INT32 iScaledColRows = 0; - for (FX_INT32 i = 0; i < pInfo->m_iColumnSpan; i++) { + int32_t iAutoColRows = 0; + int32_t iScaledColRows = 0; + for (int32_t i = 0; i < pInfo->m_iColumnSpan; i++) { CFWL_GridColRow *pColumn = (CFWL_GridColRow*)GetColRow(TRUE, pInfo->m_iColumn + i); if (!pColumn) { break; @@ -919,20 +919,20 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainColumns() } } FX_FLOAT fAutoWidth = 0; - FX_INT32 iAutoCols = autoColumns.GetSize(); - for (FX_INT32 m = 0; m < iAutoCols; m++) { + int32_t iAutoCols = autoColumns.GetSize(); + for (int32_t m = 0; m < iAutoCols; m++) { fAutoWidth += ((CFWL_GridColRow*)autoColumns[m])->m_fActualSize; } FX_FLOAT fScaledWidth = 0; iColumns = scaledColumns.GetSize(); - for (FX_INT32 n = 0; n < iColumns; n++) { + for (int32_t n = 0; n < iColumns; n++) { fScaledWidth += ((CFWL_GridColRow*)scaledColumns[n])->m_fActualSize; } return fFixedWidth + fAutoWidth + fScaledWidth; } FX_FLOAT CFWL_GridImp::ProcessUnCertainRows() { - FX_INT32 iRows = m_Rows.GetSize(); + int32_t iRows = m_Rows.GetSize(); if (iRows < 1) { CFWL_GridColRow *pColRow = new CFWL_GridColRow; pColRow->m_Size.eUnit = FWL_GRIDUNIT_Auto; @@ -946,7 +946,7 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainRows() CFX_PtrArray scaledRows; FX_FLOAT fScaledRowNum = 0; FX_FLOAT fScaledMaxPerHeight = 0; - for (FX_INT32 i = 0; i < iRows; i++) { + for (int32_t i = 0; i < iRows; i++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Rows[i]; if (!pColRow) { continue; @@ -978,7 +978,7 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainRows() } } iRows = scaledRows.GetSize(); - for (FX_INT32 j = 0; j < iRows; j++) { + for (int32_t j = 0; j < iRows; j++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)scaledRows[j]; if (!pColRow) { continue; @@ -997,9 +997,9 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainRows() CFX_PtrArray spanScaledRows; FX_FLOAT fSpanSize = 0; FX_FLOAT fScaledSum = 0; - FX_INT32 iAutoColRows = 0; - FX_INT32 iScaledColRows = 0; - for (FX_INT32 i = 0; i < pInfo->m_iRowSpan; i++) { + int32_t iAutoColRows = 0; + int32_t iScaledColRows = 0; + for (int32_t i = 0; i < pInfo->m_iRowSpan; i++) { CFWL_GridColRow *pRow = (CFWL_GridColRow*)GetColRow(FALSE, pInfo->m_iRow + i); if (!pRow) { break; @@ -1030,13 +1030,13 @@ FX_FLOAT CFWL_GridImp::ProcessUnCertainRows() } } FX_FLOAT fAutoHeigt = 0; - FX_INT32 iAutoRows = autoRows.GetSize(); - for (FX_INT32 m = 0; m < iAutoRows; m++) { + int32_t iAutoRows = autoRows.GetSize(); + for (int32_t m = 0; m < iAutoRows; m++) { fAutoHeigt += ((CFWL_GridColRow*)autoRows[m])->m_fActualSize; } FX_FLOAT fScaledHeight = 0; iRows = scaledRows.GetSize(); - for (FX_INT32 n = 0; n < iRows; n++) { + for (int32_t n = 0; n < iRows; n++) { fScaledHeight += ((CFWL_GridColRow*)scaledRows[n])->m_fActualSize; } return fFixedHeight + fAutoHeigt + fScaledHeight; @@ -1086,8 +1086,8 @@ FX_FLOAT CFWL_GridImp::SetWidgetActualHeight(CFWL_GridWidgetInfo* pInfo, FX_FLOA void CFWL_GridImp::SetAllWidgetsRect() { FX_FLOAT fStartLeft = 0; - FX_INT32 iColumns = m_Columns.GetSize(); - for (FX_INT32 i = 0; i < iColumns; i++) { + int32_t iColumns = m_Columns.GetSize(); + for (int32_t i = 0; i < iColumns; i++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Columns[i]; if (!pColRow) { continue; @@ -1096,8 +1096,8 @@ void CFWL_GridImp::SetAllWidgetsRect() fStartLeft += pColRow->m_fActualSize; } FX_FLOAT fStartTop = 0; - FX_INT32 iRows = m_Rows.GetSize(); - for (FX_INT32 j = 0; j < iRows; j++) { + int32_t iRows = m_Rows.GetSize(); + for (int32_t j = 0; j < iRows; j++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)m_Rows[j]; if (!pColRow) { continue; @@ -1125,7 +1125,7 @@ void CFWL_GridImp::SetAllWidgetsRect() } FX_FLOAT fColumnWidth = 0; if (iColumns > 0) { - for (FX_INT32 j = 0; j < pInfo->m_iColumnSpan; j++) { + for (int32_t j = 0; j < pInfo->m_iColumnSpan; j++) { CFWL_GridColRow *pCol = (CFWL_GridColRow*)GetColRow(TRUE, pInfo->m_iColumn + j); if (!pCol) { break; @@ -1137,7 +1137,7 @@ void CFWL_GridImp::SetAllWidgetsRect() } FX_FLOAT fRowHeight = 0; if (iRows > 0) { - for (FX_INT32 k = 0; k < pInfo->m_iRowSpan; k++) { + for (int32_t k = 0; k < pInfo->m_iRowSpan; k++) { CFWL_GridColRow *pR = (CFWL_GridColRow*)GetColRow(FALSE, pInfo->m_iRow + k); if (!pR) { break; @@ -1220,20 +1220,20 @@ FX_BOOL CFWL_GridImp::IsGrid(IFWL_Widget* pWidget) } void CFWL_GridImp::SetSpanAutoColRowSize(const CFX_PtrArray &spanAutos, FX_FLOAT fTotalSize) { - FX_INT32 iAutoColRows = spanAutos.GetSize(); + int32_t iAutoColRows = spanAutos.GetSize(); if (iAutoColRows < 1) { return; } CFX_PtrArray autoNoMinMaxs; FX_FLOAT fAutoPer = fTotalSize / iAutoColRows; - for (FX_INT32 j = 0; j < iAutoColRows; j++) { + for (int32_t j = 0; j < iAutoColRows; j++) { CFWL_GridColRow *pColumn = (CFWL_GridColRow*)spanAutos[j]; FX_FLOAT fOrgSize = pColumn->m_fActualSize; if (SetColRowActualSize(pColumn, pColumn->m_fActualSize + fAutoPer, TRUE)) { autoNoMinMaxs.Add(pColumn); } else { fTotalSize -= pColumn->m_fActualSize - fOrgSize; - FX_INT32 iNoMinMax = iAutoColRows - (j + 1 - autoNoMinMaxs.GetSize()); + int32_t iNoMinMax = iAutoColRows - (j + 1 - autoNoMinMaxs.GetSize()); if (iNoMinMax > 0 && fTotalSize > 0) { fAutoPer = fTotalSize / iNoMinMax; } else { @@ -1241,11 +1241,11 @@ void CFWL_GridImp::SetSpanAutoColRowSize(const CFX_PtrArray &spanAutos, FX_FLOAT } } } - FX_INT32 iNormals = autoNoMinMaxs.GetSize(); + int32_t iNormals = autoNoMinMaxs.GetSize(); if (fTotalSize > 0) { if (iNormals == iAutoColRows) { fAutoPer = fTotalSize / iNormals; - for (FX_INT32 k = 0; k < iNormals; k++) { + for (int32_t k = 0; k < iNormals; k++) { CFWL_GridColRow *pColumn = (CFWL_GridColRow*)autoNoMinMaxs[k]; pColumn->m_fActualSize += fAutoPer; } @@ -1257,20 +1257,20 @@ void CFWL_GridImp::SetSpanAutoColRowSize(const CFX_PtrArray &spanAutos, FX_FLOAT } void CFWL_GridImp::SetSpanScaledColRowSize(const CFX_PtrArray &spanScaleds, FX_FLOAT fTotalSize, FX_FLOAT fTotalScaledNum) { - FX_INT32 iScaledColRows = spanScaleds.GetSize(); + int32_t iScaledColRows = spanScaleds.GetSize(); if (iScaledColRows < 1) { return; } CFX_PtrArray autoNoMinMaxs; FX_FLOAT fPerSize = fTotalSize / fTotalScaledNum; - for (FX_INT32 i = 0; i < iScaledColRows; i++) { + for (int32_t i = 0; i < iScaledColRows; i++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)spanScaleds[i]; if (SetColRowActualSize(pColRow, pColRow->m_fActualSize + fPerSize * pColRow->m_Size.fLength, TRUE)) { autoNoMinMaxs.Add(pColRow); } else { fTotalSize -= pColRow->m_fActualSize; fTotalScaledNum -= pColRow->m_Size.fLength; - FX_INT32 iNoMinMax = iScaledColRows - (i + 1 - autoNoMinMaxs.GetSize()); + int32_t iNoMinMax = iScaledColRows - (i + 1 - autoNoMinMaxs.GetSize()); if (iNoMinMax > 0 && fTotalSize > 0) { fPerSize = fTotalSize / fTotalScaledNum; } else { @@ -1278,11 +1278,11 @@ void CFWL_GridImp::SetSpanScaledColRowSize(const CFX_PtrArray &spanScaleds, FX_F } } } - FX_INT32 iNormals = autoNoMinMaxs.GetSize(); + int32_t iNormals = autoNoMinMaxs.GetSize(); if (fTotalSize > 0) { if (iNormals == iScaledColRows) { fPerSize = fTotalSize / fTotalScaledNum; - for (FX_INT32 j = 0; j < iNormals; j++) { + for (int32_t j = 0; j < iNormals; j++) { CFWL_GridColRow *pColumn = (CFWL_GridColRow*)autoNoMinMaxs[j]; pColumn->m_fActualSize += fPerSize * pColumn->m_Size.fLength; } @@ -1294,13 +1294,13 @@ void CFWL_GridImp::SetSpanScaledColRowSize(const CFX_PtrArray &spanScaleds, FX_F } void CFWL_GridImp::SetScaledColRowsSize(const CFX_PtrArray &spanScaleds, FX_FLOAT fTotalSize, FX_FLOAT fTotalScaledNum) { - FX_INT32 iScaledColRows = spanScaleds.GetSize(); + int32_t iScaledColRows = spanScaleds.GetSize(); if (iScaledColRows < 1) { return; } CFX_PtrArray autoNoMinMaxs; FX_FLOAT fPerSize = fTotalSize / fTotalScaledNum; - for (FX_INT32 i = 0; i < iScaledColRows; i++) { + for (int32_t i = 0; i < iScaledColRows; i++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)spanScaleds[i]; if (!pColRow) { continue; @@ -1312,7 +1312,7 @@ void CFWL_GridImp::SetScaledColRowsSize(const CFX_PtrArray &spanScaleds, FX_FLOA } else { fTotalSize -= pColRow->m_fActualSize - fOrgSize; fTotalScaledNum -= pColRow->m_Size.fLength; - FX_INT32 iNoMinMax = iScaledColRows - (i + 1 - autoNoMinMaxs.GetSize()); + int32_t iNoMinMax = iScaledColRows - (i + 1 - autoNoMinMaxs.GetSize()); if (iNoMinMax > 0 && fTotalSize > 0) { fPerSize = fTotalSize / fTotalScaledNum; } else { @@ -1320,11 +1320,11 @@ void CFWL_GridImp::SetScaledColRowsSize(const CFX_PtrArray &spanScaleds, FX_FLOA } } } - FX_INT32 iNormals = autoNoMinMaxs.GetSize(); + int32_t iNormals = autoNoMinMaxs.GetSize(); if (fTotalSize > 0) { if (iNormals == iScaledColRows) { fPerSize = fTotalSize / fTotalScaledNum; - for (FX_INT32 i = 0; i < iNormals; i++) { + for (int32_t i = 0; i < iNormals; i++) { CFWL_GridColRow *pColRow = (CFWL_GridColRow*)autoNoMinMaxs[i]; if (!pColRow) { continue; @@ -1342,7 +1342,7 @@ CFWL_GridDelegate::CFWL_GridDelegate(CFWL_GridImp *pOwner) : m_pOwner(pOwner) { } -FX_INT32 CFWL_GridDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_GridDelegate::OnProcessMessage(CFWL_Message *pMessage) { if (pMessage->GetClassID() != FWL_MSGHASH_Mouse) { return 0; diff --git a/xfa/src/fwl/src/core/fwl_noteimp.cpp b/xfa/src/fwl/src/core/fwl_noteimp.cpp index 101516fcac..4a9c138d86 100644 --- a/xfa/src/fwl/src/core/fwl_noteimp.cpp +++ b/xfa/src/fwl/src/core/fwl_noteimp.cpp @@ -26,7 +26,7 @@ FX_BOOL CFWL_NoteLoop::PreProcessMessage(CFWL_Message *pMessage) } return TranslateAccelerator(pMessage); } -FWL_ERR CFWL_NoteLoop::Idle(FX_INT32 count) +FWL_ERR CFWL_NoteLoop::Idle(int32_t count) { #if (_FX_OS_==_FX_WIN32_DESKTOP_) if (count <= 0) @@ -123,7 +123,7 @@ CFWL_NoteDriver::~CFWL_NoteDriver() FX_BOOL CFWL_NoteDriver::SendNote(CFWL_Note *pNote) { if (pNote->IsEvent()) { - FX_INT32 iCount = m_eventTargets.GetCount(); + int32_t iCount = m_eventTargets.GetCount(); if (iCount < 1) { return TRUE; } @@ -169,29 +169,29 @@ FX_BOOL CFWL_NoteDriver::PostMessage(CFWL_Message *pMessage) #define FWL_NoteDriver_EventKey 1100 FWL_ERR CFWL_NoteDriver::RegisterEventTarget(IFWL_Widget *pListener, IFWL_Widget *pEventSource , FX_DWORD dwFilter ) { - FX_DWORD dwkey = (FX_DWORD)(FX_UINTPTR)pListener->GetPrivateData((FX_LPVOID)(FX_UINTPTR)FWL_NoteDriver_EventKey); + FX_DWORD dwkey = (FX_DWORD)(uintptr_t)pListener->GetPrivateData((FX_LPVOID)(uintptr_t)FWL_NoteDriver_EventKey); if (dwkey == 0) { FX_LPVOID random = FX_Random_MT_Start(0); dwkey = rand(); FX_Random_MT_Close(random); - pListener->SetPrivateData((FX_LPVOID)(FX_UINTPTR)FWL_NoteDriver_EventKey, (FX_LPVOID)(FX_UINTPTR)dwkey, NULL); + pListener->SetPrivateData((FX_LPVOID)(uintptr_t)FWL_NoteDriver_EventKey, (FX_LPVOID)(uintptr_t)dwkey, NULL); } CFWL_EventTarget *value = NULL; - if (!m_eventTargets.Lookup((void*)(FX_UINTPTR)dwkey, (FX_LPVOID&)value)) { + if (!m_eventTargets.Lookup((void*)(uintptr_t)dwkey, (FX_LPVOID&)value)) { value = FX_NEW CFWL_EventTarget(this, pListener); - m_eventTargets.SetAt((void*)(FX_UINTPTR)dwkey, value); + m_eventTargets.SetAt((void*)(uintptr_t)dwkey, value); } value->SetEventSource(pEventSource, dwFilter); return FWL_ERR_Succeeded; } FWL_ERR CFWL_NoteDriver::UnregisterEventTarget(IFWL_Widget *pListener) { - FX_DWORD dwkey = (FX_DWORD)(FX_UINTPTR)pListener->GetPrivateData((FX_LPVOID)(FX_UINTPTR)FWL_NoteDriver_EventKey); + FX_DWORD dwkey = (FX_DWORD)(uintptr_t)pListener->GetPrivateData((FX_LPVOID)(uintptr_t)FWL_NoteDriver_EventKey); if (dwkey == 0) { return FWL_ERR_Indefinite; } CFWL_EventTarget *value = NULL; - if (m_eventTargets.Lookup((void*)(FX_UINTPTR)dwkey, (FX_LPVOID&)value)) { + if (m_eventTargets.Lookup((void*)(uintptr_t)dwkey, (FX_LPVOID&)value)) { value->FlagInvalid(); } return FWL_ERR_Succeeded; @@ -200,11 +200,11 @@ void CFWL_NoteDriver::ClearEventTargets(FX_BOOL bRemoveAll) { ClearInvalidEventTargets(bRemoveAll); } -FX_INT32 CFWL_NoteDriver::GetQueueMaxSize() const +int32_t CFWL_NoteDriver::GetQueueMaxSize() const { return m_maxSize; } -FWL_ERR CFWL_NoteDriver::SetQueueMaxSize(const FX_INT32 size) +FWL_ERR CFWL_NoteDriver::SetQueueMaxSize(const int32_t size) { m_maxSize = size; return FWL_ERR_Succeeded; @@ -220,7 +220,7 @@ FWL_ERR CFWL_NoteDriver::PushNoteLoop(IFWL_NoteLoop *pNoteLoop) } IFWL_NoteLoop* CFWL_NoteDriver::PopNoteLoop() { - FX_INT32 pos = m_noteLoopQueue.GetSize(); + int32_t pos = m_noteLoopQueue.GetSize(); _FWL_RETURN_VALUE_IF_FAIL(pos > 0, NULL); IFWL_NoteLoop * p = (IFWL_NoteLoop *) m_noteLoopQueue.GetAt(pos - 1); m_noteLoopQueue.RemoveAt(pos - 1); @@ -282,7 +282,7 @@ FWL_ERR CFWL_NoteDriver::Run() } #elif (_FX_OS_==_FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_) FX_BOOL bIdle = TRUE; - FX_INT32 iIdleCount = 0; + int32_t iIdleCount = 0; CFWL_NoteLoop *pTopLoop = NULL; for (;;) { pTopLoop = GetTopLoop(); @@ -364,8 +364,8 @@ void CFWL_NoteDriver::NotifyTargetDestroy(IFWL_Widget *pNoteTarget) m_pGrab = NULL; } UnregisterEventTarget(pNoteTarget); - FX_INT32 count = m_forms.GetSize(); - for (FX_INT32 nIndex = 0; nIndex < count; nIndex ++) { + int32_t count = m_forms.GetSize(); + for (int32_t nIndex = 0; nIndex < count; nIndex ++) { CFWL_FormImp *pForm = (CFWL_FormImp*)m_forms[nIndex]; if (!pForm) { continue; @@ -398,7 +398,7 @@ FWL_ERR CFWL_NoteDriver::RegisterForm(CFWL_WidgetImp *pForm) FWL_ERR CFWL_NoteDriver::UnRegisterForm(CFWL_WidgetImp *pForm) { _FWL_RETURN_VALUE_IF_FAIL(pForm, FWL_ERR_Indefinite); - FX_INT32 nIndex = m_forms.Find(pForm); + int32_t nIndex = m_forms.Find(pForm); if (nIndex < 0) { return FWL_ERR_Indefinite; } @@ -434,11 +434,11 @@ FX_BOOL CFWL_NoteDriver::UnqueueMessage(CFWL_NoteLoop *pNoteLoop) } CFWL_NoteLoop* CFWL_NoteDriver::GetTopLoop() { - FX_INT32 size = m_noteLoopQueue.GetSize(); + int32_t size = m_noteLoopQueue.GetSize(); _FWL_RETURN_VALUE_IF_FAIL(size > 0, NULL); return (CFWL_NoteLoop*)m_noteLoopQueue[size - 1]; } -FX_INT32 CFWL_NoteDriver::CountLoop() +int32_t CFWL_NoteDriver::CountLoop() { return m_noteLoopQueue.GetSize(); } @@ -542,7 +542,7 @@ FX_BOOL CFWL_NoteDriver::DoDeactivate(CFWL_MsgDeactivate *pMsg, IFWL_Widget *pMe if (m_bFullScreen) { return FALSE; } - FX_INT32 iTrackLoop = m_noteLoopQueue.GetSize(); + int32_t iTrackLoop = m_noteLoopQueue.GetSize(); _FWL_RETURN_VALUE_IF_FAIL(iTrackLoop > 0, FALSE); if (iTrackLoop == 1) { if (pMessageForm->IsInstance(FX_WSTRC(L"FWL_FORMPROXY"))) { @@ -760,8 +760,8 @@ FX_BOOL CFWL_NoteDriver::IsValidMessage(CFWL_Message *pMessage) if (pMessage->GetClassID() == FWL_MSGHASH_Post) { return TRUE; } - FX_INT32 iCount = m_noteLoopQueue.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_noteLoopQueue.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { CFWL_NoteLoop *pNoteLoop = (CFWL_NoteLoop*)m_noteLoopQueue[i]; CFWL_WidgetImp *pForm = pNoteLoop->GetForm(); if (pForm && (pForm->GetInterface() == pMessage->m_pDstTarget)) { @@ -769,7 +769,7 @@ FX_BOOL CFWL_NoteDriver::IsValidMessage(CFWL_Message *pMessage) } } iCount = m_forms.GetSize(); - for (FX_INT32 j = 0; j < iCount; j ++) { + for (int32_t j = 0; j < iCount; j ++) { CFWL_FormImp *pForm = (CFWL_FormImp*)m_forms[j]; if (pForm->GetInterface() == pMessage->m_pDstTarget) { return TRUE; @@ -779,7 +779,7 @@ FX_BOOL CFWL_NoteDriver::IsValidMessage(CFWL_Message *pMessage) } IFWL_Widget* CFWL_NoteDriver::GetMessageForm(IFWL_Widget *pDstTarget) { - FX_INT32 iTrackLoop = m_noteLoopQueue.GetSize(); + int32_t iTrackLoop = m_noteLoopQueue.GetSize(); _FWL_RETURN_VALUE_IF_FAIL(iTrackLoop > 0, NULL); IFWL_Widget *pMessageForm = NULL; if (iTrackLoop > 1) { @@ -812,16 +812,16 @@ class CFWL_CoreToopTipDP : public IFWL_ToolTipDP { public: FWL_ERR GetCaption(IFWL_Widget *pWidget, CFX_WideString &wsCaption); - FX_INT32 GetInitialDelay(IFWL_Widget *pWidget); - FX_INT32 GetAutoPopDelay(IFWL_Widget *pWidget); + int32_t GetInitialDelay(IFWL_Widget *pWidget); + int32_t GetAutoPopDelay(IFWL_Widget *pWidget); CFX_DIBitmap* GetToolTipIcon(IFWL_Widget *pWidget); CFX_SizeF GetToolTipIconSize(IFWL_Widget *pWidget); CFX_RectF GetAnchor(); CFWL_CoreToopTipDP(); CFX_WideString m_wsCaption; - FX_INT32 m_nInitDelayTime; - FX_INT32 m_nAutoPopDelayTime; + int32_t m_nInitDelayTime; + int32_t m_nAutoPopDelayTime; CFX_RectF m_fAnchor; }; CFWL_CoreToopTipDP::CFWL_CoreToopTipDP() @@ -835,11 +835,11 @@ FWL_ERR CFWL_CoreToopTipDP::GetCaption(IFWL_Widget *pWidget, CFX_WideString &wsC wsCaption = m_wsCaption; return FWL_ERR_Succeeded; } -FX_INT32 CFWL_CoreToopTipDP::GetInitialDelay(IFWL_Widget *pWidget) +int32_t CFWL_CoreToopTipDP::GetInitialDelay(IFWL_Widget *pWidget) { return m_nInitDelayTime; } -FX_INT32 CFWL_CoreToopTipDP::GetAutoPopDelay(IFWL_Widget *pWidget) +int32_t CFWL_CoreToopTipDP::GetAutoPopDelay(IFWL_Widget *pWidget) { return m_nAutoPopDelayTime; } @@ -861,7 +861,7 @@ CFWL_EventTarget::~CFWL_EventTarget() { m_eventSources.RemoveAll(); } -FX_INT32 CFWL_EventTarget::SetEventSource(IFWL_Widget *pSource, FX_DWORD dwFilter) +int32_t CFWL_EventTarget::SetEventSource(IFWL_Widget *pSource, FX_DWORD dwFilter) { if (pSource) { m_eventSources.SetAt(pSource, dwFilter); @@ -997,8 +997,8 @@ FX_ERR CFWL_ToolTipContainer::RemoveToolTipTarget(IFWL_ToolTipTarget *pTarget) } FX_BOOL CFWL_ToolTipContainer::HasToolTip(IFWL_Widget *pWedget) { - FX_INT32 iCount = m_arrWidget.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = m_arrWidget.GetSize(); + for (int32_t i = 0; i < iCount; i++) { IFWL_ToolTipTarget *p = (IFWL_ToolTipTarget *)m_arrWidget[i]; if (p->GetWidget() == pWedget) { pCurTarget = p; @@ -1079,12 +1079,12 @@ IFWL_ToolTipTarget* CFWL_ToolTipContainer::GetCurrentToolTipTarget() { return pCurTarget; } -FX_ERR CFWL_ToolTipContainer::SetToolTipInitialDelay(FX_INT32 nDelayTime) +FX_ERR CFWL_ToolTipContainer::SetToolTipInitialDelay(int32_t nDelayTime) { m_ToolTipDp->m_nInitDelayTime = nDelayTime; return FWL_ERR_Succeeded; } -FX_ERR CFWL_ToolTipContainer::SetToolTipAutoPopDelay(FX_INT32 nDelayTime) +FX_ERR CFWL_ToolTipContainer::SetToolTipAutoPopDelay(int32_t nDelayTime) { m_ToolTipDp->m_nAutoPopDelayTime = nDelayTime; return FWL_ERR_Succeeded; @@ -1097,11 +1097,11 @@ FWL_ERR FWL_RemoveToolTipTarget(IFWL_ToolTipTarget *pTarget) { return CFWL_ToolTipContainer::getInstance()->RemoveToolTipTarget(pTarget); } -FWL_ERR FWL_SetToolTipInitialDelay(FX_INT32 nDelayTime) +FWL_ERR FWL_SetToolTipInitialDelay(int32_t nDelayTime) { return CFWL_ToolTipContainer::getInstance()->SetToolTipInitialDelay(nDelayTime); } -FWL_ERR FWL_SetToolTipAutoPopDelay(FX_INT32 nDelayTime) +FWL_ERR FWL_SetToolTipAutoPopDelay(int32_t nDelayTime) { return CFWL_ToolTipContainer::getInstance()->SetToolTipAutoPopDelay(nDelayTime); } diff --git a/xfa/src/fwl/src/core/fwl_sdadapterimp.cpp b/xfa/src/fwl/src/core/fwl_sdadapterimp.cpp index fae5a2a6db..25636ea582 100644 --- a/xfa/src/fwl/src/core/fwl_sdadapterimp.cpp +++ b/xfa/src/fwl/src/core/fwl_sdadapterimp.cpp @@ -63,7 +63,7 @@ FWL_ERR CFWL_SDAdapterWidgetMgr::RepaintWidget(IFWL_Widget *pWidget, const CFX_R { return FWL_ERR_Succeeded; } -FWL_ERR CFWL_SDAdapterWidgetMgr::Exit(FX_INT32 iExitCode) +FWL_ERR CFWL_SDAdapterWidgetMgr::Exit(int32_t iExitCode) { return FWL_ERR_Succeeded; } @@ -135,11 +135,11 @@ FWL_ERR CFWL_SDAdapterWidgetMgr::InitMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuD { return FWL_ERR_Succeeded; } -FWL_ERR CFWL_SDAdapterWidgetMgr::UpdateMenu(IFWL_Menu *pMenu, FX_LPCVOID hItem, FX_INT32 iType) +FWL_ERR CFWL_SDAdapterWidgetMgr::UpdateMenu(IFWL_Menu *pMenu, FX_LPCVOID hItem, int32_t iType) { return FWL_ERR_Succeeded; } -FX_INT32 CFWL_SDAdapterWidgetMgr::TrackPopupMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData) +int32_t CFWL_SDAdapterWidgetMgr::TrackPopupMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData) { return 0; } @@ -173,11 +173,11 @@ FWL_ERR CFWL_SDAdapterThreadMgr::Suspend(FWL_HTHREAD hThread) { return FWL_ERR_Succeeded; } -FWL_ERR CFWL_SDAdapterThreadMgr::Kill(FWL_HTHREAD hThread, FX_INT32 iExitCode) +FWL_ERR CFWL_SDAdapterThreadMgr::Kill(FWL_HTHREAD hThread, int32_t iExitCode) { return FWL_ERR_Succeeded; } -FWL_ERR CFWL_SDAdapterThreadMgr::Stop(FWL_HTHREAD hThread, FX_INT32 iExitCode) +FWL_ERR CFWL_SDAdapterThreadMgr::Stop(FWL_HTHREAD hThread, int32_t iExitCode) { return FWL_ERR_Succeeded; } diff --git a/xfa/src/fwl/src/core/fwl_threadimp.cpp b/xfa/src/fwl/src/core/fwl_threadimp.cpp index 66f4144c71..7d9609a9cd 100644 --- a/xfa/src/fwl/src/core/fwl_threadimp.cpp +++ b/xfa/src/fwl/src/core/fwl_threadimp.cpp @@ -35,7 +35,7 @@ FWL_ERR CFWL_Thread::Run(FWL_HTHREAD hThread) } CFWL_ControlThread * CFWL_NoteThread::_assistantThreadHandler = NULL; FWL_HTHREAD CFWL_NoteThread::_assistantThread = NULL; -FX_INT32 CFWL_NoteThread::_refCount = 0; +int32_t CFWL_NoteThread::_refCount = 0; IFWL_NoteThread* IFWL_NoteThread::Create() { return (IFWL_NoteThread*) FX_NEW CFWL_NoteThread; @@ -92,7 +92,7 @@ FWL_ERR FWL_SuspendThread(FWL_HTHREAD hThread) _FWL_RETURN_VALUE_IF_FAIL(ThreadMgr, FWL_ERR_Indefinite); return ThreadMgr->Suspend(hThread); } -FWL_ERR FWL_KillThread(FWL_HTHREAD hThread, FX_INT32 iExitCode) +FWL_ERR FWL_KillThread(FWL_HTHREAD hThread, int32_t iExitCode) { IFWL_AdapterNative * Native = FWL_GetAdapterNative(); _FWL_RETURN_VALUE_IF_FAIL(Native, FWL_ERR_Indefinite); @@ -100,7 +100,7 @@ FWL_ERR FWL_KillThread(FWL_HTHREAD hThread, FX_INT32 iExitCode) _FWL_RETURN_VALUE_IF_FAIL(ThreadMgr, FWL_ERR_Indefinite); return ThreadMgr->Kill(hThread, iExitCode); } -FWL_ERR FWL_StopThread(FWL_HTHREAD hThread, FX_INT32 iExitCode) +FWL_ERR FWL_StopThread(FWL_HTHREAD hThread, int32_t iExitCode) { IFWL_AdapterNative * Native = FWL_GetAdapterNative(); _FWL_RETURN_VALUE_IF_FAIL(Native, FWL_ERR_Indefinite); @@ -144,15 +144,15 @@ FWL_ERR FWL_WaitSemaphore(FWL_HSEMAPHORE hSemaphore) { return ((IFWL_AdapterSemaphore*)hSemaphore)->Wait(); } -FWL_ERR FWL_PostSemaphore(FWL_HSEMAPHORE hSemaphore, FX_INT32 down ) +FWL_ERR FWL_PostSemaphore(FWL_HSEMAPHORE hSemaphore, int32_t down ) { return ((IFWL_AdapterSemaphore*)hSemaphore)->Post(); } -FWL_ERR FWL_GetSemaphoreValue(FWL_HSEMAPHORE hSemaphore, FX_INT32 &value) +FWL_ERR FWL_GetSemaphoreValue(FWL_HSEMAPHORE hSemaphore, int32_t &value) { return ((IFWL_AdapterSemaphore*)hSemaphore)->Value((FX_DWORD &)value); } -FWL_ERR FWL_ResetSemaphore(FWL_HSEMAPHORE hSemaphore, FX_INT32 init) +FWL_ERR FWL_ResetSemaphore(FWL_HSEMAPHORE hSemaphore, int32_t init) { return ((IFWL_AdapterSemaphore*)hSemaphore)->Reset(init); } diff --git a/xfa/src/fwl/src/core/fwl_timerimp.cpp b/xfa/src/fwl/src/core/fwl_timerimp.cpp index e0300f4316..300ab5cefb 100644 --- a/xfa/src/fwl/src/core/fwl_timerimp.cpp +++ b/xfa/src/fwl/src/core/fwl_timerimp.cpp @@ -18,7 +18,7 @@ FWL_HTIMER FWL_StartTimer(IFWL_Timer *pTimer, FX_DWORD dwElapse, FX_BOOL bImmedi pAdapterTimerMgr->Start(pTimer, dwElapse, hTimer, bImmediately); return hTimer; } -FX_INT32 FWL_StopTimer(FWL_HTIMER hTimer) +int32_t FWL_StopTimer(FWL_HTIMER hTimer) { IFWL_AdapterNative *pAdapterNative = FWL_GetAdapterNative(); _FWL_RETURN_VALUE_IF_FAIL(pAdapterNative, FWL_ERR_Indefinite); diff --git a/xfa/src/fwl/src/core/fwl_widgetimp.cpp b/xfa/src/fwl/src/core/fwl_widgetimp.cpp index 61186a7ede..4659e6bc9e 100644 --- a/xfa/src/fwl/src/core/fwl_widgetimp.cpp +++ b/xfa/src/fwl/src/core/fwl_widgetimp.cpp @@ -450,8 +450,8 @@ FWL_ERR CFWL_WidgetImp::GetMatrix(CFX_Matrix &matrix, FX_BOOL bGlobal ) matrix.Reset(); CFX_Matrix ctmOnParent; CFX_RectF rect; - FX_INT32 count = parents.GetSize(); - for (FX_INT32 i = count - 2; i >= 0; i--) { + int32_t count = parents.GetSize(); + for (int32_t i = count - 2; i >= 0; i--) { parent = (IFWL_Widget *) parents.GetAt(i); parent->GetMatrix(ctmOnParent, FALSE); parent->GetWidgetRect(rect); @@ -708,7 +708,7 @@ CFWL_WidgetImp* CFWL_WidgetImp::GetSameAncestor(CFWL_WidgetImp *pWidget) arr2.Add(pAncestor); relation = pAncestor->IsPopup() ? FWL_WGTRELATION_Owner : FWL_WGTRELATION_Parent; } while ((pAncestor = (CFWL_WidgetImp*)m_pWidgetMgr->GetWidget(pAncestor->m_pInterface, relation)) != NULL); - for (FX_INT32 i = 0; i < arr1.GetSize(); i ++) { + for (int32_t i = 0; i < arr1.GetSize(); i ++) { FX_LPVOID pVoid = arr1[i]; if (arr2.Find(pVoid) < 0) { continue; @@ -755,7 +755,7 @@ FX_BOOL CFWL_WidgetImp::TransformFromOuter(FX_FLOAT &fx, FX_FLOAT &fy) #define FWL_WGT_CalcHeight 2048 #define FWL_WGT_CalcWidth 2048 #define FWL_WGT_CalcMultiLineDefWidth 120.0f -CFX_SizeF CFWL_WidgetImp::CalcTextSize(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_BOOL bMultiLine , FX_INT32 iLineWidth ) +CFX_SizeF CFWL_WidgetImp::CalcTextSize(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_BOOL bMultiLine , int32_t iLineWidth ) { CFX_SizeF sz; sz.Set(0, 0); @@ -775,7 +775,7 @@ CFX_SizeF CFWL_WidgetImp::CalcTextSize(const CFX_WideString &wsText, IFWL_ThemeP sz.y = rect.height; return sz; } -void CFWL_WidgetImp::CalcTextRect(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_DWORD dwTTOStyles, FX_INT32 iTTOAlign, CFX_RectF &rect) +void CFWL_WidgetImp::CalcTextRect(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_DWORD dwTTOStyles, int32_t iTTOAlign, CFX_RectF &rect) { CFWL_ThemeText calPart; calPart.m_pWidget = m_pInterface; @@ -955,7 +955,7 @@ void CFWL_WidgetImp::Repaint(const CFX_RectF *pRect ) m_pWidgetMgr->RepaintWidget(m_pInterface, &rect); } void CFWL_WidgetImp::DrawBackground(CFX_Graphics *pGraphics, - FX_INT32 iPartBk, + int32_t iPartBk, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix ) { @@ -972,7 +972,7 @@ void CFWL_WidgetImp::DrawBackground(CFX_Graphics *pGraphics, pTheme->DrawBackground(¶m); } void CFWL_WidgetImp::DrawBorder(CFX_Graphics *pGraphics, - FX_INT32 iPartBorder, + int32_t iPartBorder, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix ) { @@ -989,7 +989,7 @@ void CFWL_WidgetImp::DrawBorder(CFX_Graphics *pGraphics, pTheme->DrawBackground(¶m); } void CFWL_WidgetImp::DrawEdge(CFX_Graphics *pGraphics, - FX_INT32 iPartEdge, + int32_t iPartEdge, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix ) { @@ -1051,7 +1051,7 @@ FX_BOOL CFWL_WidgetImp::IsParent(IFWL_Widget *pParent) CFWL_WidgetImpDelegate::CFWL_WidgetImpDelegate() { } -FX_INT32 CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage->m_pDstTarget, 0); CFWL_WidgetImp *pWidget = (CFWL_WidgetImp*)((IFWL_TargetData*)pMessage->m_pDstTarget)->GetData(); diff --git a/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp b/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp index 283c328008..a1e1d45718 100644 --- a/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp +++ b/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp @@ -59,12 +59,12 @@ CFWL_WidgetMgr::~CFWL_WidgetMgr() m_pDelegate = NULL; } } -FX_INT32 CFWL_WidgetMgr::CountWidgets(IFWL_Widget *pParent ) +int32_t CFWL_WidgetMgr::CountWidgets(IFWL_Widget *pParent ) { CFWL_WidgetMgrItem *pParentItem = GetWidgetMgrItem(pParent); return TravelWidgetMgr(pParentItem, NULL, NULL); } -IFWL_Widget* CFWL_WidgetMgr::GetWidget(FX_INT32 nIndex, IFWL_Widget *pParent ) +IFWL_Widget* CFWL_WidgetMgr::GetWidget(int32_t nIndex, IFWL_Widget *pParent ) { CFWL_WidgetMgrItem *pParentItem = GetWidgetMgrItem(pParent); IFWL_Widget *pWidget = NULL; @@ -138,19 +138,19 @@ IFWL_Widget* CFWL_WidgetMgr::GetWidget(IFWL_Widget *pWidget, FWL_WGTRELATION eRe } return pRet; } -FX_INT32 CFWL_WidgetMgr::GetWidgetIndex(IFWL_Widget *pWidget) +int32_t CFWL_WidgetMgr::GetWidgetIndex(IFWL_Widget *pWidget) { CFWL_WidgetMgrItem *pItem = GetWidgetMgrItem(pWidget); _FWL_RETURN_VALUE_IF_FAIL(pItem, -1); return TravelWidgetMgr(pItem->pParent, NULL, pItem); } -FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget *pWidget, FX_INT32 nIndex) +FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget *pWidget, int32_t nIndex) { CFWL_WidgetMgrItem *pItem = GetWidgetMgrItem(pWidget); _FWL_RETURN_VALUE_IF_FAIL(pItem, FALSE); _FWL_RETURN_VALUE_IF_FAIL(pItem->pParent, FALSE); CFWL_WidgetMgrItem *pChild = pItem->pParent->pChild; - FX_INT32 i = 0; + int32_t i = 0; while (pChild) { if (pChild == pItem) { if (i == nIndex) { @@ -264,7 +264,7 @@ void CFWL_WidgetMgr::AddWidget(IFWL_Widget *pWidget) pItem->pParent = pParentItem; SetWidgetIndex(pWidget, -1); } -void CFWL_WidgetMgr::InsertWidget(IFWL_Widget *pParent, IFWL_Widget *pChild, FX_INT32 nIndex ) +void CFWL_WidgetMgr::InsertWidget(IFWL_Widget *pParent, IFWL_Widget *pChild, int32_t nIndex ) { CFWL_WidgetMgrItem *pParentItem = GetWidgetMgrItem(pParent); if (!pParentItem) { @@ -462,7 +462,7 @@ FX_BOOL CFWL_WidgetMgr::IsIdleMessage_Native() { return m_pAdapter->IsIdleMessage(); } -FWL_ERR CFWL_WidgetMgr::Exit_Native(FX_INT32 iExitCode) +FWL_ERR CFWL_WidgetMgr::Exit_Native(int32_t iExitCode) { return m_pAdapter->Exit(iExitCode); } @@ -527,9 +527,9 @@ IFWL_Widget* CFWL_WidgetMgr::nextTab(IFWL_Widget *parent, IFWL_Widget *focus, FX } return NULL; } -FX_INT32 CFWL_WidgetMgr::CountRadioButtonGroup(IFWL_Widget *pFirst) +int32_t CFWL_WidgetMgr::CountRadioButtonGroup(IFWL_Widget *pFirst) { - FX_INT32 iRet = 0; + int32_t iRet = 0; IFWL_Widget *pChild = pFirst; while (pChild) { if ((pChild->GetStyles() & FWL_WGTSTYLE_Group) && pChild->GetClassID() == 3811304691) { @@ -580,7 +580,7 @@ void CFWL_WidgetMgr::GetSameGroupRadioButton(IFWL_Widget *pRadioButton, CFX_PtrA if (!pFirst) { pFirst = pRadioButton; } - FX_INT32 iGroup = CountRadioButtonGroup(pFirst); + int32_t iGroup = CountRadioButtonGroup(pFirst); if (iGroup < 2) { if (pFirst->GetClassID() == 3811304691) { group.Add(pFirst); @@ -636,12 +636,12 @@ CFWL_WidgetMgrItem* CFWL_WidgetMgr::GetWidgetMgrItem(IFWL_Widget *pWidget) { return (CFWL_WidgetMgrItem*)m_mapWidgetItem.GetValueAt(pWidget); } -FX_INT32 CFWL_WidgetMgr::TravelWidgetMgr(CFWL_WidgetMgrItem *pParent, FX_INT32 *pIndex, CFWL_WidgetMgrItem *pItem, IFWL_Widget **pWidget ) +int32_t CFWL_WidgetMgr::TravelWidgetMgr(CFWL_WidgetMgrItem *pParent, int32_t *pIndex, CFWL_WidgetMgrItem *pItem, IFWL_Widget **pWidget ) { if (!pParent) { return 0; } - FX_INT32 iCount = 0; + int32_t iCount = 0; CFWL_WidgetMgrItem *pChild = pParent->pChild; while (pChild) { iCount ++; @@ -695,7 +695,7 @@ FWL_ERR CFWL_WidgetMgrDelegate::OnSetCapability(FX_DWORD dwCapability ) m_pWidgetMgr->m_dwCapability = dwCapability; return FWL_ERR_Succeeded; } -FX_INT32 CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message *pMessage) +int32_t CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message *pMessage) { _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); _FWL_RETURN_VALUE_IF_FAIL(pMessage->m_pDstTarget, 0); @@ -833,7 +833,7 @@ CFX_Graphics* CFWL_WidgetMgrDelegate::DrawWidgetBefore(IFWL_Widget *pWidget, CFX pItem->pOffscreen = FX_NEW CFX_Graphics; CFX_RectF rect; pWidget->GetWidgetRect(rect); - pItem->pOffscreen->Create((FX_INT32)rect.width, (FX_INT32)rect.height, FXDIB_Argb); + pItem->pOffscreen->Create((int32_t)rect.width, (int32_t)rect.height, FXDIB_Argb); } CFX_RectF rect; pGraphics->GetClipRect(rect); @@ -893,7 +893,7 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget *pWidget, CFX_Matrix * FX_BOOL bOrginPtIntersectWidthChild = FALSE; FX_BOOL bOrginPtIntersectWidthDirty = rtDirty.Contains(rtWidget.left, rtWidget.top); static FWL_NeedRepaintHitData hitPoint[FWL_NEEDREPAINTHIT_Point]; - static FX_INT32 iSize = sizeof(FWL_NeedRepaintHitData); + static int32_t iSize = sizeof(FWL_NeedRepaintHitData); FXSYS_memset(hitPoint, 0, iSize); FX_FLOAT fxPiece = rtWidget.width / FWL_NEEDREPAINTHIT_Piece; FX_FLOAT fyPiece = rtWidget.height / FWL_NEEDREPAINTHIT_Piece; @@ -928,7 +928,7 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget *pWidget, CFX_Matrix * } else if (!(pChild->GetStates() & FWL_WGTSTATE_Invisible)) { rtChilds.Union(rect); } - for (FX_INT32 i = 0; i < FWL_NEEDREPAINTHIT_Point; i ++) { + for (int32_t i = 0; i < FWL_NEEDREPAINTHIT_Point; i ++) { if (hitPoint[i].bNotContainByDirty || hitPoint[i].bNotNeedRepaint) { continue; } @@ -950,8 +950,8 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget *pWidget, CFX_Matrix * if (rtChilds.IsEmpty()) { return TRUE; } - FX_INT32 repaintPoint = FWL_NEEDREPAINTHIT_Point; - for (FX_INT32 i = 0; i < FWL_NEEDREPAINTHIT_Point; i ++) { + int32_t repaintPoint = FWL_NEEDREPAINTHIT_Point; + for (int32_t i = 0; i < FWL_NEEDREPAINTHIT_Point; i ++) { if (hitPoint[i].bNotNeedRepaint) { repaintPoint --; } @@ -1027,7 +1027,7 @@ FWL_ERR FWL_WidgetMgrSnapshot(IFWL_Widget *pWidget, const CFX_WideString *saveFi CFX_RectF r; pWidget->GetWidgetRect(r); CFX_Graphics gs; - gs.Create((FX_INT32)r.width, (FX_INT32)r.height, FXDIB_Argb); + gs.Create((int32_t)r.width, (int32_t)r.height, FXDIB_Argb); CFWL_WidgetMgr *widgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr(); CFWL_WidgetMgrDelegate *delegate = widgetMgr->GetDelegate(); delegate->OnDrawWidget(pWidget, &gs, pMatrix); diff --git a/xfa/src/fwl/src/core/include/fwl_appimp.h b/xfa/src/fwl/src/core/include/fwl_appimp.h index edc2089252..e0f1f5977a 100644 --- a/xfa/src/fwl/src/core/include/fwl_appimp.h +++ b/xfa/src/fwl/src/core/include/fwl_appimp.h @@ -23,7 +23,7 @@ public: virtual IFWL_AdapterNative* GetAdapterNative(); virtual IFWL_WidgetMgr* GetWidgetMgr(); virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); - virtual FWL_ERR Exit(FX_INT32 iExitCode = 0); + virtual FWL_ERR Exit(int32_t iExitCode = 0); IFWL_ThemeProvider* GetThemeProvider(); protected: CFWL_WidgetMgr *m_pWidgetMgr; diff --git a/xfa/src/fwl/src/core/include/fwl_contentimp.h b/xfa/src/fwl/src/core/include/fwl_contentimp.h index 0aaaf0e1b8..95a47a3796 100644 --- a/xfa/src/fwl/src/core/include/fwl_contentimp.h +++ b/xfa/src/fwl/src/core/include/fwl_contentimp.h @@ -15,7 +15,7 @@ public: CFWL_ContentImp(); CFWL_ContentImp(const CFWL_WidgetImpProperties &properties); virtual ~CFWL_ContentImp(); - virtual FWL_ERR InsertWidget(IFWL_Widget *pChild, FX_INT32 nIndex = -1); + virtual FWL_ERR InsertWidget(IFWL_Widget *pChild, int32_t nIndex = -1); virtual FWL_ERR RemoveWidget(IFWL_Widget *pWidget); virtual FWL_ERR RemoveAllWidgets(); virtual FWL_ERR GetMinSize(FX_FLOAT &fWidth, FX_FLOAT &fHeight); diff --git a/xfa/src/fwl/src/core/include/fwl_formimp.h b/xfa/src/fwl/src/core/include/fwl_formimp.h index b283c121e9..0cf9c9d25c 100644 --- a/xfa/src/fwl/src/core/include/fwl_formimp.h +++ b/xfa/src/fwl/src/core/include/fwl_formimp.h @@ -58,7 +58,7 @@ public: { bDisabled ? m_dwState |= FWL_SYSBUTTONSTATE_Disabled : m_dwState &= ~FWL_SYSBUTTONSTATE_Disabled; } - FX_INT32 GetPartState() + int32_t GetPartState() { return (IsDisabled() ? FWL_PARTSTATE_FRM_Disabled : (m_dwState + 1)); } @@ -116,8 +116,8 @@ protected: void CalcContentRect(CFX_RectF &rtContent); CFWL_SysBtn* GetSysBtnAtPoint(FX_FLOAT fx, FX_FLOAT fy); CFWL_SysBtn* GetSysBtnByState(FX_DWORD dwState); - CFWL_SysBtn* GetSysBtnByIndex(FX_INT32 nIndex); - FX_INT32 GetSysBtnIndex(CFWL_SysBtn *pBtn); + CFWL_SysBtn* GetSysBtnByIndex(int32_t nIndex); + int32_t GetSysBtnIndex(CFWL_SysBtn *pBtn); FX_FLOAT GetCaptionHeight(); void DrawCaptionText(CFX_Graphics *pGs, IFWL_ThemeProvider *pTheme, const CFX_Matrix* pMatrix = NULL); void DrawIconImage(CFX_Graphics *pGs, IFWL_ThemeProvider *pTheme, const CFX_Matrix* pMatrix = NULL); @@ -150,9 +150,9 @@ protected: RestoreInfo m_InfoStart; FX_FLOAT m_fCXBorder; FX_FLOAT m_fCYBorder; - FX_INT32 m_iCaptureBtn; - FX_INT32 m_iSysBox; - FX_INT32 m_eResizeType; + int32_t m_iCaptureBtn; + int32_t m_iSysBox; + int32_t m_eResizeType; FX_BOOL m_bLButtonDown; FX_BOOL m_bMaximized; FX_BOOL m_bSetMaximize; @@ -170,7 +170,7 @@ class CFWL_FormDelegate : public CFWL_WidgetImpDelegate { public: CFWL_FormDelegate(CFWL_FormImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: diff --git a/xfa/src/fwl/src/core/include/fwl_gridimp.h b/xfa/src/fwl/src/core/include/fwl_gridimp.h index 1bd7ada04b..82aeb7ecdc 100644 --- a/xfa/src/fwl/src/core/include/fwl_gridimp.h +++ b/xfa/src/fwl/src/core/include/fwl_gridimp.h @@ -71,10 +71,10 @@ public: m_Size[FWL_GRIDSIZE_MaxHeight].fLength = 0; m_Margin[0] = m_Margin[1] = m_Margin[2] = m_Margin[3] = 0; } - FX_INT32 m_iColumn; - FX_INT32 m_iColumnSpan; - FX_INT32 m_iRow; - FX_INT32 m_iRowSpan; + int32_t m_iColumn; + int32_t m_iColumnSpan; + int32_t m_iRow; + int32_t m_iRowSpan; CFWL_GridLength m_Size[6]; FX_DWORD m_dwMarginFlag; FX_FLOAT m_Margin[4]; @@ -96,12 +96,12 @@ public: virtual FWL_ERR Update(); virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); - virtual FWL_ERR InsertWidget(IFWL_Widget *pChild, FX_INT32 nIndex = -1); + virtual FWL_ERR InsertWidget(IFWL_Widget *pChild, int32_t nIndex = -1); virtual FWL_ERR RemoveWidget(IFWL_Widget *pWidget); - virtual FWL_HGRIDCOLROW InsertColRow(FX_BOOL bColumn, FX_INT32 nIndex = -1); - virtual FX_INT32 CountColRows(FX_BOOL bColumn); - virtual FWL_HGRIDCOLROW GetColRow(FX_BOOL bColumn, FX_INT32 nIndex); - virtual FX_INT32 GetIndex(FWL_HGRIDCOLROW hColRow); + virtual FWL_HGRIDCOLROW InsertColRow(FX_BOOL bColumn, int32_t nIndex = -1); + virtual int32_t CountColRows(FX_BOOL bColumn); + virtual FWL_HGRIDCOLROW GetColRow(FX_BOOL bColumn, int32_t nIndex); + virtual int32_t GetIndex(FWL_HGRIDCOLROW hColRow); virtual FX_FLOAT GetSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT &eUnit); virtual FWL_ERR SetSize(FWL_HGRIDCOLROW hColRow, FX_FLOAT fSize, FWL_GRIDUNIT eUnit); virtual FX_FLOAT GetMinSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT &eUnit); @@ -110,10 +110,10 @@ public: virtual FWL_ERR SetMaxSize(FWL_HGRIDCOLROW hColRow, FX_FLOAT fSize, FWL_GRIDUNIT eUnit); virtual FX_BOOL DeleteColRow(FWL_HGRIDCOLROW hColRow); virtual FX_BOOL IsColumn(FWL_HGRIDCOLROW hColRow); - virtual FX_INT32 GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn); - virtual FWL_ERR SetWidgetPos(IFWL_Widget *pWidget, FX_INT32 iPos, FX_BOOL bColumn); - virtual FX_INT32 GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn); - virtual FWL_ERR SetWidgetSpan(IFWL_Widget *pWidget, FX_INT32 iSpan, FX_BOOL bColumn); + virtual int32_t GetWidgetPos(IFWL_Widget *pWidget, FX_BOOL bColumn); + virtual FWL_ERR SetWidgetPos(IFWL_Widget *pWidget, int32_t iPos, FX_BOOL bColumn); + virtual int32_t GetWidgetSpan(IFWL_Widget *pWidget, FX_BOOL bColumn); + virtual FWL_ERR SetWidgetSpan(IFWL_Widget *pWidget, int32_t iSpan, FX_BOOL bColumn); virtual FX_FLOAT GetWidgetSize(IFWL_Widget *pWidget, FWL_GRIDSIZE eSize, FWL_GRIDUNIT &eUnit); virtual FWL_ERR SetWidgetSize(IFWL_Widget *pWidget, FWL_GRIDSIZE eSize, FX_FLOAT fSize, FWL_GRIDUNIT eUit); virtual FX_BOOL GetWidgetMargin(IFWL_Widget *pWidget, FWL_GRIDMARGIN eMargin, FX_FLOAT &fMargin); @@ -123,9 +123,9 @@ public: virtual FWL_ERR SetGridSize(FWL_GRIDSIZE eSize, FX_FLOAT fSize, FWL_GRIDUNIT eUit); protected: CFWL_GridWidgetInfo* GetWidgetInfo(IFWL_Widget* pWidget); - void ProcFixedColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn); - void ProcAutoColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_BOOL bColumn); - void ProcScaledColRow(CFWL_GridColRow *pColRow, FX_INT32 nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn); + void ProcFixedColRow(CFWL_GridColRow *pColRow, int32_t nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn); + void ProcAutoColRow(CFWL_GridColRow *pColRow, int32_t nIndex, FX_BOOL bColumn); + void ProcScaledColRow(CFWL_GridColRow *pColRow, int32_t nIndex, FX_FLOAT fColRowSize, FX_BOOL bColumn); void CalcWidgetWidth(IFWL_Widget *pWidget, CFWL_GridWidgetInfo *pInfo, FX_FLOAT fColunmWidth); void CalcWidgetHeigt(IFWL_Widget *pWidget, CFWL_GridWidgetInfo *pInfo, FX_FLOAT fRowHeigt); FX_FLOAT CalcAutoColumnWidgetWidth(IFWL_Widget *pWidget, CFWL_GridWidgetInfo* pInfo); @@ -153,7 +153,7 @@ class CFWL_GridDelegate : public CFWL_WidgetImpDelegate { public: CFWL_GridDelegate(CFWL_GridImp *pOwner); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: CFWL_GridImp *m_pOwner; diff --git a/xfa/src/fwl/src/core/include/fwl_noteimp.h b/xfa/src/fwl/src/core/include/fwl_noteimp.h index 08ab13d3e7..699840d27e 100644 --- a/xfa/src/fwl/src/core/include/fwl_noteimp.h +++ b/xfa/src/fwl/src/core/include/fwl_noteimp.h @@ -21,7 +21,7 @@ class CFWL_NoteLoop public: CFWL_NoteLoop(CFWL_WidgetImp *pForm = NULL); virtual FX_BOOL PreProcessMessage(CFWL_Message *pMessage); - virtual FWL_ERR Idle(FX_INT32 count); + virtual FWL_ERR Idle(int32_t count); CFWL_WidgetImp* GetForm(); FX_BOOL ContinueModal(); FWL_ERR EndModalLoop(); @@ -43,8 +43,8 @@ public: virtual FWL_ERR RegisterEventTarget(IFWL_Widget *pListener, IFWL_Widget *pEventSource = NULL, FX_DWORD dwFilter = FWL_EVENT_ALL_MASK); virtual FWL_ERR UnregisterEventTarget(IFWL_Widget *pListener); virtual void ClearEventTargets(FX_BOOL bRemoveAll); - virtual FX_INT32 GetQueueMaxSize() const; - virtual FWL_ERR SetQueueMaxSize(const FX_INT32 size); + virtual int32_t GetQueueMaxSize() const; + virtual FWL_ERR SetQueueMaxSize(const int32_t size); virtual IFWL_NoteThread* GetOwnerThread() const; virtual FWL_ERR PushNoteLoop(IFWL_NoteLoop *pNoteLoop); virtual IFWL_NoteLoop* PopNoteLoop(); @@ -62,7 +62,7 @@ public: FX_BOOL QueueMessage(CFWL_Message *pMessage); FX_BOOL UnqueueMessage(CFWL_NoteLoop *pNoteLoop); CFWL_NoteLoop* GetTopLoop(); - FX_INT32 CountLoop(); + int32_t CountLoop(); void SetHook(FWLMessageHookCallback callback, FX_LPVOID info); FX_BOOL ProcessMessage(CFWL_Message *pMessage); protected: @@ -86,8 +86,8 @@ protected: CFX_PtrArray m_noteQueue; CFX_PtrArray m_noteLoopQueue; CFX_MapPtrToPtr m_eventTargets; - FX_INT32 m_sendEventCalled; - FX_INT32 m_maxSize; + int32_t m_sendEventCalled; + int32_t m_maxSize; FX_BOOL m_bFullScreen; IFWL_Widget *m_pHover; IFWL_Widget *m_pFocus; @@ -107,7 +107,7 @@ public: { } ~CFWL_EventTarget(); - FX_INT32 SetEventSource(IFWL_Widget *pSource, FX_DWORD dwFilter = FWL_EVENT_ALL_MASK); + int32_t SetEventSource(IFWL_Widget *pSource, FX_DWORD dwFilter = FWL_EVENT_ALL_MASK); FX_BOOL ProcessEvent(CFWL_Event *pEvent); FX_BOOL IsFilterEvent(CFWL_Event *pEvent, FX_DWORD dwFilter); FX_BOOL IsInvalid() @@ -139,8 +139,8 @@ public: FX_BOOL ProcessEnter(CFWL_EvtMouse *pEvt, IFWL_Widget *pOwner); FX_BOOL ProcessLeave(CFWL_EvtMouse *pEvt); - FX_ERR SetToolTipInitialDelay(FX_INT32 iDelayTime); - FX_ERR SetToolTipAutoPopDelay(FX_INT32 iDelayTime); + FX_ERR SetToolTipInitialDelay(int32_t iDelayTime); + FX_ERR SetToolTipAutoPopDelay(int32_t iDelayTime); protected: CFWL_ToolTipContainer(); diff --git a/xfa/src/fwl/src/core/include/fwl_threadimp.h b/xfa/src/fwl/src/core/include/fwl_threadimp.h index e03e6c6e15..26acc54006 100644 --- a/xfa/src/fwl/src/core/include/fwl_threadimp.h +++ b/xfa/src/fwl/src/core/include/fwl_threadimp.h @@ -48,6 +48,6 @@ protected: FWL_HTHREAD m_hThread; static CFWL_ControlThread * _assistantThreadHandler; static FWL_HTHREAD _assistantThread; - static FX_INT32 _refCount; + static int32_t _refCount; }; #endif diff --git a/xfa/src/fwl/src/core/include/fwl_widgetimp.h b/xfa/src/fwl/src/core/include/fwl_widgetimp.h index 862bb53665..4d28722576 100644 --- a/xfa/src/fwl/src/core/include/fwl_widgetimp.h +++ b/xfa/src/fwl/src/core/include/fwl_widgetimp.h @@ -83,8 +83,8 @@ protected: CFX_SizeF GetOffsetFromAncestor(CFWL_WidgetImp *pAncestor); FX_BOOL TransformToOuter(FX_FLOAT &fx, FX_FLOAT &fy); FX_BOOL TransformFromOuter(FX_FLOAT &fx, FX_FLOAT &fy); - CFX_SizeF CalcTextSize(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_BOOL bMultiLine = FALSE, FX_INT32 iLineWidth = -1); - void CalcTextRect(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_DWORD dwTTOStyles, FX_INT32 iTTOAlign, CFX_RectF &rect); + CFX_SizeF CalcTextSize(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_BOOL bMultiLine = FALSE, int32_t iLineWidth = -1); + void CalcTextRect(const CFX_WideString &wsText, IFWL_ThemeProvider *pTheme, FX_DWORD dwTTOStyles, int32_t iTTOAlign, CFX_RectF &rect); void SetFocus(FX_BOOL bFocus); void SetGrab(FX_BOOL bSet); FX_BOOL GetPopupPos(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight, const CFX_RectF &rtAnchor, CFX_RectF &rtPopup); @@ -97,9 +97,9 @@ protected: void DispatchKeyEvent(CFWL_MsgKey *pNote); void DispatchEvent(CFWL_Event *pEvent); void Repaint(const CFX_RectF *pRect = NULL); - void DrawBackground(CFX_Graphics *pGraphics, FX_INT32 iPartBk, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL); - void DrawBorder(CFX_Graphics *pGraphics, FX_INT32 iPartBorder, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL); - void DrawEdge(CFX_Graphics *pGraphics, FX_INT32 iPartEdge, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL); + void DrawBackground(CFX_Graphics *pGraphics, int32_t iPartBk, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL); + void DrawBorder(CFX_Graphics *pGraphics, int32_t iPartBorder, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL); + void DrawEdge(CFX_Graphics *pGraphics, int32_t iPartEdge, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix = NULL); void NotifyDriver(); FX_BOOL IsParent(IFWL_Widget *pParent); @@ -111,7 +111,7 @@ protected: IFWL_WidgetDelegate *m_pCurDelegate; IFWL_Widget *m_pOuter; IFWL_Widget *m_pInterface; - FX_INT32 m_iLock; + int32_t m_iLock; friend class CFWL_WidgetImpDelegate; friend void FWL_SetWidgetRect(IFWL_Widget *widget, const CFX_RectF &rect); friend void FWL_SetWidgetStates(IFWL_Widget *widget, FX_DWORD dwStates); @@ -121,7 +121,7 @@ class CFWL_WidgetImpDelegate { public: CFWL_WidgetImpDelegate(); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); }; diff --git a/xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h b/xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h index 314021f9b6..f730f5b33d 100644 --- a/xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h +++ b/xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h @@ -44,7 +44,7 @@ public: CFWL_WidgetMgrItem *pNext; IFWL_Widget *pWidget; CFX_Graphics *pOffscreen; - FX_INT32 iRedrawCounter; + int32_t iRedrawCounter; #if (_FX_OS_==_FX_WIN32_DESKTOP_) || (_FX_OS_==_FX_WIN64_) FX_BOOL bOutsideChanged; #endif @@ -54,11 +54,11 @@ class CFWL_WidgetMgr public: CFWL_WidgetMgr(IFWL_AdapterNative *pAdapterNative); ~CFWL_WidgetMgr(); - virtual FX_INT32 CountWidgets(IFWL_Widget *pParent = NULL); - virtual IFWL_Widget* GetWidget(FX_INT32 nIndex, IFWL_Widget *pParent = NULL); + virtual int32_t CountWidgets(IFWL_Widget *pParent = NULL); + virtual IFWL_Widget* GetWidget(int32_t nIndex, IFWL_Widget *pParent = NULL); virtual IFWL_Widget* GetWidget(IFWL_Widget *pWidget, FWL_WGTRELATION eRelation); - virtual FX_INT32 GetWidgetIndex(IFWL_Widget *pWidget); - virtual FX_BOOL SetWidgetIndex(IFWL_Widget *pWidget, FX_INT32 nIndex); + virtual int32_t GetWidgetIndex(IFWL_Widget *pWidget); + virtual FX_BOOL SetWidgetIndex(IFWL_Widget *pWidget, int32_t nIndex); virtual FX_BOOL IsWidget(FX_LPVOID pObj); virtual FWL_ERR RepaintWidget(IFWL_Widget *pWidget, const CFX_RectF *pRect = NULL); virtual FX_DWORD GetCapability() @@ -66,7 +66,7 @@ public: return m_dwCapability; } void AddWidget(IFWL_Widget *pWidget); - void InsertWidget(IFWL_Widget *pParent, IFWL_Widget *pChild, FX_INT32 nIndex = -1); + void InsertWidget(IFWL_Widget *pParent, IFWL_Widget *pChild, int32_t nIndex = -1); void RemoveWidget(IFWL_Widget *pWidget); void SetOwner(IFWL_Widget *pOwner, IFWL_Widget *pOwned); void SetParent(IFWL_Widget *pParent, IFWL_Widget *pChild); @@ -87,12 +87,12 @@ public: FX_BOOL CheckMessage_Native(); FWL_ERR DispatchMessage_Native(); FX_BOOL IsIdleMessage_Native(); - FWL_ERR Exit_Native(FX_INT32 iExitCode); + FWL_ERR Exit_Native(int32_t iExitCode); FWL_ERR CreateWidgetWithNativeId_Native(IFWL_Widget *pWidget, void *vp); 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); - FX_INT32 CountRadioButtonGroup(IFWL_Widget *pFirst); + int32_t CountRadioButtonGroup(IFWL_Widget *pFirst); IFWL_Widget* GetSiblingRadioButton(IFWL_Widget *pWidget, FX_BOOL bNext); IFWL_Widget* GetRadioButtonGroupHeader(IFWL_Widget *pRadioButton); void GetSameGroupRadioButton(IFWL_Widget *pRadioButton, CFX_PtrArray &group); @@ -112,7 +112,7 @@ public: FX_BOOL IsFormDisabled(); FX_BOOL GetAdapterPopupPos(IFWL_Widget* pWidget, FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight, const CFX_RectF &rtAnchor, CFX_RectF &rtPopup); protected: - FX_INT32 TravelWidgetMgr(CFWL_WidgetMgrItem *pParent, FX_INT32 *pIndex, CFWL_WidgetMgrItem *pItem, IFWL_Widget **pWidget = NULL); + int32_t TravelWidgetMgr(CFWL_WidgetMgrItem *pParent, int32_t *pIndex, CFWL_WidgetMgrItem *pItem, IFWL_Widget **pWidget = NULL); FX_BOOL IsAbleNative(IFWL_Widget *pWidget); CFX_MapPtrToPtr m_mapWidgetItem; IFWL_AdapterWidgetMgr *m_pAdapter; @@ -128,7 +128,7 @@ class CFWL_WidgetMgrDelegate public: CFWL_WidgetMgrDelegate(CFWL_WidgetMgr *pWidgetMgr); virtual FWL_ERR OnSetCapability(FX_DWORD dwCapability = FWL_WGTMGR_DisableThread); - virtual FX_INT32 OnProcessMessageToForm(CFWL_Message *pMessage); + virtual int32_t OnProcessMessageToForm(CFWL_Message *pMessage); virtual FWL_ERR OnDrawWidget(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix ); protected: void DrawChild(IFWL_Widget *pParent, const CFX_RectF &rtClip, CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix ); diff --git a/xfa/src/fwl/src/lightwidget/app.cpp b/xfa/src/fwl/src/lightwidget/app.cpp index e89b6c86de..54327c8cbc 100644 --- a/xfa/src/fwl/src/lightwidget/app.cpp +++ b/xfa/src/fwl/src/lightwidget/app.cpp @@ -31,7 +31,7 @@ CFWL_Theme* CFWL_App::GetTheme() { return m_pThemeProvider; } -FWL_ERR CFWL_App::Exit(FX_INT32 iExitCode ) +FWL_ERR CFWL_App::Exit(int32_t iExitCode ) { _FWL_RETURN_VALUE_IF_FAIL(m_pAppImp, FWL_ERR_Indefinite); return m_pAppImp->Exit(iExitCode); diff --git a/xfa/src/fwl/src/lightwidget/checkbox.cpp b/xfa/src/fwl/src/lightwidget/checkbox.cpp index cb659fffa7..298aa41b4e 100644 --- a/xfa/src/fwl/src/lightwidget/checkbox.cpp +++ b/xfa/src/fwl/src/lightwidget/checkbox.cpp @@ -45,11 +45,11 @@ FWL_ERR CFWL_CheckBox::SetBoxSize(FX_FLOAT fHeight) m_checkboxData.m_fBoxHeight = fHeight; return FWL_ERR_Succeeded; } -FX_INT32 CFWL_CheckBox::GetCheckState() +int32_t CFWL_CheckBox::GetCheckState() { return ((IFWL_CheckBox*)m_pImp)->GetCheckState(); } -FWL_ERR CFWL_CheckBox::SetCheckState(FX_INT32 iCheck) +FWL_ERR CFWL_CheckBox::SetCheckState(int32_t iCheck) { return ((IFWL_CheckBox*)m_pImp)->SetCheckState(iCheck); } diff --git a/xfa/src/fwl/src/lightwidget/combobox.cpp b/xfa/src/fwl/src/lightwidget/combobox.cpp index 557dc2d2b5..c443dfbcb3 100644 --- a/xfa/src/fwl/src/lightwidget/combobox.cpp +++ b/xfa/src/fwl/src/lightwidget/combobox.cpp @@ -35,14 +35,14 @@ FWL_ERR CFWL_ComboBox::Initialize(const CFWL_WidgetProperties *pProperties ) } return ret; } -FX_INT32 CFWL_ComboBox::AddString(FX_WSTR wsText) +int32_t CFWL_ComboBox::AddString(FX_WSTR wsText) { CFWL_ComboBoxItem *pItem = FX_NEW CFWL_ComboBoxItem; pItem->m_wsText = wsText; pItem->m_dwStyles = 0; return m_comboBoxData.m_arrItem.Add(pItem); } -FX_INT32 CFWL_ComboBox::AddString(FX_WSTR wsText, CFX_DIBitmap *pIcon) +int32_t CFWL_ComboBox::AddString(FX_WSTR wsText, CFX_DIBitmap *pIcon) { CFWL_ComboBoxItem *pItem = FX_NEW CFWL_ComboBoxItem; pItem->m_wsText = wsText; @@ -50,32 +50,32 @@ FX_INT32 CFWL_ComboBox::AddString(FX_WSTR wsText, CFX_DIBitmap *pIcon) pItem->m_pDIB = pIcon; return m_comboBoxData.m_arrItem.Add(pItem); } -FX_INT32 CFWL_ComboBox::RemoveAt(FX_INT32 iIndex) +int32_t CFWL_ComboBox::RemoveAt(int32_t iIndex) { return m_comboBoxData.m_arrItem.RemoveAt(iIndex); } -FX_INT32 CFWL_ComboBox::RemoveAll() +int32_t CFWL_ComboBox::RemoveAll() { m_comboBoxData.m_arrItem.RemoveAll(); return 0; } -FX_INT32 CFWL_ComboBox::CountItems() +int32_t CFWL_ComboBox::CountItems() { return m_comboBoxData.CountItems(GetWidget()); } -FWL_ERR CFWL_ComboBox::GetTextByIndex(FX_INT32 iIndex, CFX_WideString &wsText) +FWL_ERR CFWL_ComboBox::GetTextByIndex(int32_t iIndex, CFX_WideString &wsText) { CFWL_ComboBoxItem *pItem = (CFWL_ComboBoxItem*)(m_comboBoxData.GetItem((IFWL_Widget *)this, iIndex)); _FWL_RETURN_VALUE_IF_FAIL(pItem, FWL_ERR_Indefinite); wsText = pItem->m_wsText; return FWL_ERR_Succeeded; } -FX_INT32 CFWL_ComboBox::GetCurSel() +int32_t CFWL_ComboBox::GetCurSel() { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, -1); return ((IFWL_ComboBox*)m_pImp)->GetCurSel(); } -FWL_ERR CFWL_ComboBox::SetCurSel(FX_INT32 iSel) +FWL_ERR CFWL_ComboBox::SetCurSel(int32_t iSel) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_ComboBox*)m_pImp)->SetCurSel(iSel); @@ -85,37 +85,37 @@ FWL_ERR CFWL_ComboBox::SetEditText(FX_WSTR wsText) _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_ComboBox*)m_pImp)->SetEditText(wsText); } -FX_INT32 CFWL_ComboBox::GetEditTextLength() const +int32_t CFWL_ComboBox::GetEditTextLength() const { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0); return ((IFWL_ComboBox*)m_pImp)->GetEditTextLength(); } -FWL_ERR CFWL_ComboBox::GetEditText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount) const +FWL_ERR CFWL_ComboBox::GetEditText(CFX_WideString &wsText, int32_t nStart, int32_t nCount) const { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_ComboBox*)m_pImp)->GetEditText(wsText, nStart, nCount); } -FWL_ERR CFWL_ComboBox::SetEditSelRange(FX_INT32 nStart, FX_INT32 nCount) +FWL_ERR CFWL_ComboBox::SetEditSelRange(int32_t nStart, int32_t nCount) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_ComboBox*)m_pImp)->SetEditSelRange(nStart, nCount); } -FX_INT32 CFWL_ComboBox::GetEditSelRange(FX_INT32 nIndex, FX_INT32 &nStart) +int32_t CFWL_ComboBox::GetEditSelRange(int32_t nIndex, int32_t &nStart) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0); return ((IFWL_ComboBox*)m_pImp)->GetEditSelRange(nIndex, nStart); } -FX_INT32 CFWL_ComboBox::GetEditLimit() +int32_t CFWL_ComboBox::GetEditLimit() { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0); return ((IFWL_ComboBox*)m_pImp)->GetEditLimit(); } -FWL_ERR CFWL_ComboBox::SetEditLimit(FX_INT32 nLimit) +FWL_ERR CFWL_ComboBox::SetEditLimit(int32_t nLimit) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_ComboBox*)m_pImp)->SetEditLimit(nLimit); } -FWL_ERR CFWL_ComboBox::EditDoClipboard(FX_INT32 iCmd) +FWL_ERR CFWL_ComboBox::EditDoClipboard(int32_t iCmd) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_ComboBox*)m_pImp)->EditDoClipboard(iCmd); @@ -135,14 +135,14 @@ FWL_ERR CFWL_ComboBox::SetMaxListHeight(FX_FLOAT fMaxHeight) m_comboBoxData.m_fMaxListHeight = fMaxHeight; return FWL_ERR_Succeeded; } -FWL_ERR CFWL_ComboBox::SetItemData(FX_INT32 iIndex, FX_LPVOID pData) +FWL_ERR CFWL_ComboBox::SetItemData(int32_t iIndex, FX_LPVOID pData) { CFWL_ComboBoxItem *pItem = (CFWL_ComboBoxItem*)(m_comboBoxData.GetItem((IFWL_Widget *)this, iIndex)); _FWL_RETURN_VALUE_IF_FAIL(pItem, FWL_ERR_Indefinite); pItem->m_pData = pData; return FWL_ERR_Succeeded; } -FX_LPVOID CFWL_ComboBox::GetItemData(FX_INT32 iIndex) +FX_LPVOID CFWL_ComboBox::GetItemData(int32_t iIndex) { CFWL_ComboBoxItem *pItem = (CFWL_ComboBoxItem*)(m_comboBoxData.GetItem((IFWL_Widget *)this, iIndex)); _FWL_RETURN_VALUE_IF_FAIL(pItem, NULL); @@ -249,8 +249,8 @@ CFWL_ComboBox::CFWL_ComboBoxDP::CFWL_ComboBoxDP() } CFWL_ComboBox::CFWL_ComboBoxDP::~CFWL_ComboBoxDP() { - FX_INT32 nCount = m_arrItem.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = m_arrItem.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { CFWL_ComboBoxItem *pItem = (CFWL_ComboBoxItem*)m_arrItem[i]; if (pItem) { delete pItem; @@ -258,23 +258,23 @@ CFWL_ComboBox::CFWL_ComboBoxDP::~CFWL_ComboBoxDP() } m_arrItem.RemoveAll(); } -FX_INT32 CFWL_ComboBox::CFWL_ComboBoxDP::CountItems(IFWL_Widget *pWidget) +int32_t CFWL_ComboBox::CFWL_ComboBoxDP::CountItems(IFWL_Widget *pWidget) { return m_arrItem.GetSize(); } -FWL_HLISTITEM CFWL_ComboBox::CFWL_ComboBoxDP::GetItem(IFWL_Widget *pWidget, FX_INT32 nIndex) +FWL_HLISTITEM CFWL_ComboBox::CFWL_ComboBoxDP::GetItem(IFWL_Widget *pWidget, int32_t nIndex) { - FX_INT32 iCount = m_arrItem.GetSize(); + int32_t iCount = m_arrItem.GetSize(); if (nIndex >= iCount || nIndex < 0) { return NULL; } return (FWL_HLISTITEM)m_arrItem[nIndex]; } -FX_INT32 CFWL_ComboBox::CFWL_ComboBoxDP::GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem) +int32_t CFWL_ComboBox::CFWL_ComboBoxDP::GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem) { return m_arrItem.Find(hItem); } -FX_BOOL CFWL_ComboBox::CFWL_ComboBoxDP::SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, FX_INT32 nIndex) +FX_BOOL CFWL_ComboBox::CFWL_ComboBoxDP::SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, int32_t nIndex) { return m_arrItem.SetAt(nIndex, hItem); } diff --git a/xfa/src/fwl/src/lightwidget/datetimepicker.cpp b/xfa/src/fwl/src/lightwidget/datetimepicker.cpp index 4a314c5079..5a18efe542 100644 --- a/xfa/src/fwl/src/lightwidget/datetimepicker.cpp +++ b/xfa/src/fwl/src/lightwidget/datetimepicker.cpp @@ -35,18 +35,18 @@ FWL_ERR CFWL_DateTimePicker::Initialize(const CFWL_WidgetProperties *pProperties } return ret; } -FWL_ERR CFWL_DateTimePicker::SetToday(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) +FWL_ERR CFWL_DateTimePicker::SetToday(int32_t iYear, int32_t iMonth, int32_t iDay) { m_DateTimePickerDP.m_iYear = iYear; m_DateTimePickerDP.m_iMonth = iMonth; m_DateTimePickerDP.m_iDay = iDay; return FWL_ERR_Succeeded; } -FX_INT32 CFWL_DateTimePicker::CountSelRanges() +int32_t CFWL_DateTimePicker::CountSelRanges() { return ((IFWL_DateTimePicker*)m_pImp)->CountSelRanges(); } -FX_INT32 CFWL_DateTimePicker::GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart) +int32_t CFWL_DateTimePicker::GetSelRange(int32_t nIndex, int32_t &nStart) { return ((IFWL_DateTimePicker*)m_pImp)->GetSelRange(nIndex, nStart); } @@ -58,11 +58,11 @@ FWL_ERR CFWL_DateTimePicker::SetEditText(FX_WSTR wsText) { return ((IFWL_DateTimePicker*)m_pImp)->SetEditText(wsText); } -FWL_ERR CFWL_DateTimePicker::GetCurSel(FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay) +FWL_ERR CFWL_DateTimePicker::GetCurSel(int32_t &iYear, int32_t &iMonth, int32_t &iDay) { return ((IFWL_DateTimePicker*)m_pImp)->GetCurSel(iYear, iMonth, iDay); } -FWL_ERR CFWL_DateTimePicker::SetCurSel(FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) +FWL_ERR CFWL_DateTimePicker::SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay) { return ((IFWL_DateTimePicker*)m_pImp)->SetCurSel(iYear, iMonth, iDay); } @@ -83,7 +83,7 @@ FWL_ERR CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetCaption(IFWL_Widget *pWid wsCaption = m_wsData; return FWL_ERR_Succeeded; } -FWL_ERR CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetToday(IFWL_Widget *pWidget, FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay) +FWL_ERR CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetToday(IFWL_Widget *pWidget, int32_t &iYear, int32_t &iMonth, int32_t &iDay) { iYear = m_iYear; iMonth = m_iMonth; @@ -146,7 +146,7 @@ FWL_ERR CFWL_DateTimePicker::GetBBox(CFX_RectF &rect) { return ((IFWL_DateTimePicker*)m_pImp)->GetBBox(rect); } -FWL_ERR CFWL_DateTimePicker::SetEditLimit(FX_INT32 nLimit) +FWL_ERR CFWL_DateTimePicker::SetEditLimit(int32_t nLimit) { return ((IFWL_DateTimePicker*)m_pImp)->SetEditLimit(nLimit); } diff --git a/xfa/src/fwl/src/lightwidget/edit.cpp b/xfa/src/fwl/src/lightwidget/edit.cpp index c87f83fac6..8bace71d74 100644 --- a/xfa/src/fwl/src/lightwidget/edit.cpp +++ b/xfa/src/fwl/src/lightwidget/edit.cpp @@ -39,12 +39,12 @@ FWL_ERR CFWL_Edit::SetText(const CFX_WideString &wsText) _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->SetText(wsText); } -FX_INT32 CFWL_Edit::GetTextLength() const +int32_t CFWL_Edit::GetTextLength() const { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0); return ((IFWL_Edit*)m_pImp)->GetTextLength(); } -FWL_ERR CFWL_Edit::GetText(CFX_WideString &wsText, FX_INT32 nStart, FX_INT32 nCount) const +FWL_ERR CFWL_Edit::GetText(CFX_WideString &wsText, int32_t nStart, int32_t nCount) const { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->GetText(wsText, nStart, nCount); @@ -54,22 +54,22 @@ FWL_ERR CFWL_Edit::ClearText() _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->ClearText(); } -FX_INT32 CFWL_Edit::GetCaretPos() const +int32_t CFWL_Edit::GetCaretPos() const { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, -1); return ((IFWL_Edit*)m_pImp)->GetCaretPos(); } -FX_INT32 CFWL_Edit::SetCaretPos(FX_INT32 nIndex, FX_BOOL bBefore) +int32_t CFWL_Edit::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, -1); return ((IFWL_Edit*)m_pImp)->SetCaretPos(nIndex, bBefore); } -FWL_ERR CFWL_Edit::AddSelRange(FX_INT32 nStart, FX_INT32 nCount) +FWL_ERR CFWL_Edit::AddSelRange(int32_t nStart, int32_t nCount) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); ((IFWL_Edit*)m_pImp)->AddSelRange(nStart, nCount); - FX_INT32 pos = 0; - FX_INT32 sum = ((IFWL_Edit*)m_pImp)->GetTextLength(); + int32_t pos = 0; + int32_t sum = ((IFWL_Edit*)m_pImp)->GetTextLength(); if (nCount == -1) { pos = sum; } else { @@ -77,12 +77,12 @@ FWL_ERR CFWL_Edit::AddSelRange(FX_INT32 nStart, FX_INT32 nCount) } return ((IFWL_Edit*)m_pImp)->SetCaretPos(pos); } -FX_INT32 CFWL_Edit::CountSelRanges() +int32_t CFWL_Edit::CountSelRanges() { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0); return ((IFWL_Edit*)m_pImp)->CountSelRanges(); } -FX_INT32 CFWL_Edit::GetSelRange(FX_INT32 nIndex, FX_INT32 &nStart) +int32_t CFWL_Edit::GetSelRange(int32_t nIndex, int32_t &nStart) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0); return ((IFWL_Edit*)m_pImp)->GetSelRange(nIndex, nStart); @@ -92,12 +92,12 @@ FWL_ERR CFWL_Edit::ClearSelections() _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->ClearSelections(); } -FX_INT32 CFWL_Edit::GetLimit() +int32_t CFWL_Edit::GetLimit() { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, -1); return ((IFWL_Edit*)m_pImp)->GetLimit(); } -FWL_ERR CFWL_Edit::SetLimit(FX_INT32 nLimit) +FWL_ERR CFWL_Edit::SetLimit(int32_t nLimit) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->SetLimit(nLimit); @@ -112,7 +112,7 @@ FWL_ERR CFWL_Edit::SetFormatString(const CFX_WideString &wsFormat) _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->SetFormatString(wsFormat); } -FWL_ERR CFWL_Edit::Insert(FX_INT32 nStart, FX_LPCWSTR lpText, FX_INT32 nLen) +FWL_ERR CFWL_Edit::Insert(int32_t nStart, FX_LPCWSTR lpText, int32_t nLen) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->Insert(nStart, lpText, nLen); @@ -122,7 +122,7 @@ FWL_ERR CFWL_Edit::DeleteSelections() _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->DeleteSelections(); } -FWL_ERR CFWL_Edit::DeleteRange(FX_INT32 nStart, FX_INT32 nCount) +FWL_ERR CFWL_Edit::DeleteRange(int32_t nStart, int32_t nCount) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->DeleteRange(nStart, nCount); @@ -132,12 +132,12 @@ FWL_ERR CFWL_Edit::ReplaceSelections(const CFX_WideStringC &wsReplace) _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->ReplaceSelections(wsReplace); } -FWL_ERR CFWL_Edit::Replace(FX_INT32 nStart, FX_INT32 nLen, const CFX_WideStringC &wsReplace) +FWL_ERR CFWL_Edit::Replace(int32_t nStart, int32_t nLen, const CFX_WideStringC &wsReplace) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->Replace(nStart, nLen, wsReplace); } -FWL_ERR CFWL_Edit::DoClipboard(FX_INT32 iCmd) +FWL_ERR CFWL_Edit::DoClipboard(int32_t iCmd) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->DoClipboard(iCmd); @@ -157,7 +157,7 @@ FWL_ERR CFWL_Edit::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) _FWL_RETURN_VALUE_IF_FAIL(m_pImp, FWL_ERR_Indefinite); return ((IFWL_Edit*)m_pImp)->SetTabWidth(fTabWidth, bEquidistant); } -FWL_ERR CFWL_Edit::SetNumberRange(FX_INT32 iMin, FX_INT32 iMax) +FWL_ERR CFWL_Edit::SetNumberRange(int32_t iMin, int32_t iMax) { if (iMin > iMax) { return FWL_ERR_Parameter_Invalid; diff --git a/xfa/src/fwl/src/lightwidget/listbox.cpp b/xfa/src/fwl/src/lightwidget/listbox.cpp index 7cc3878d3f..f3278df1f9 100644 --- a/xfa/src/fwl/src/lightwidget/listbox.cpp +++ b/xfa/src/fwl/src/lightwidget/listbox.cpp @@ -51,13 +51,13 @@ FWL_HLISTITEM CFWL_ListBox::AddString(FX_WSTR wsAdd, FX_BOOL bSelect) } FX_BOOL CFWL_ListBox::DeleteString(FWL_HLISTITEM hItem) { - FX_INT32 nIndex = m_ListBoxDP.GetItemIndex(GetWidget(), hItem); + int32_t nIndex = m_ListBoxDP.GetItemIndex(GetWidget(), hItem); if (nIndex < 0 || nIndex >= m_ListBoxDP.m_arrItem.GetSize()) { return FALSE; } CFWL_ListItem *pDelItem = (CFWL_ListItem*)m_ListBoxDP.GetItem((IFWL_ListBox*)this, nIndex); - FX_INT32 iCount = m_ListBoxDP.CountItems((IFWL_ListBox*)this); - FX_INT32 iSel = nIndex + 1; + int32_t iCount = m_ListBoxDP.CountItems((IFWL_ListBox*)this); + int32_t iSel = nIndex + 1; if (iSel >= iCount) { iSel = nIndex - 1; if (iSel < 0) { @@ -74,25 +74,25 @@ FX_BOOL CFWL_ListBox::DeleteString(FWL_HLISTITEM hItem) } FX_BOOL CFWL_ListBox::DeleteAll() { - FX_INT32 iCount = m_ListBoxDP.CountItems((IFWL_ListBox*)this); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_ListBoxDP.CountItems((IFWL_ListBox*)this); + for (int32_t i = 0; i < iCount; i ++) { CFWL_ListItem *pItem = (CFWL_ListItem*)m_ListBoxDP.GetItem((IFWL_ListBox*)this, i); delete pItem; } m_ListBoxDP.m_arrItem.RemoveAll(); return TRUE; } -FX_INT32 CFWL_ListBox::CountSelItems() +int32_t CFWL_ListBox::CountSelItems() { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0); return ((IFWL_ListBox*)m_pImp)->CountSelItems(); } -FWL_HLISTITEM CFWL_ListBox::GetSelItem(FX_INT32 nIndexSel) +FWL_HLISTITEM CFWL_ListBox::GetSelItem(int32_t nIndexSel) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, NULL); return ((IFWL_ListBox*)m_pImp)->GetSelItem(nIndexSel); } -FX_INT32 CFWL_ListBox::GetSelIndex(FX_INT32 nIndex) +int32_t CFWL_ListBox::GetSelIndex(int32_t nIndex) { _FWL_RETURN_VALUE_IF_FAIL(m_pImp, 0); return ((IFWL_ListBox*)m_pImp)->GetSelIndex(nIndex); @@ -119,7 +119,7 @@ FWL_ERR CFWL_ListBox::SetItemHeight(FX_FLOAT fItemHeight) } FWL_HLISTITEM CFWL_ListBox::GetFocusItem() { - for (FX_INT32 i = 0; i < m_ListBoxDP.m_arrItem.GetSize(); i++) { + for (int32_t i = 0; i < m_ListBoxDP.m_arrItem.GetSize(); i++) { CFWL_ListItem * hItem = (CFWL_ListItem *)(m_ListBoxDP.m_arrItem[i]); if (hItem->m_dwStates & FWL_ITEMSTATE_LTB_Focused) { return (FWL_HLISTITEM)hItem; @@ -129,7 +129,7 @@ FWL_HLISTITEM CFWL_ListBox::GetFocusItem() } FWL_ERR CFWL_ListBox::SetFocusItem(FWL_HLISTITEM hItem) { - FX_INT32 nIndex = m_ListBoxDP.GetItemIndex(GetWidget(), hItem); + int32_t nIndex = m_ListBoxDP.GetItemIndex(GetWidget(), hItem); ((CFWL_ListItem *)(m_ListBoxDP.m_arrItem[nIndex]))->m_dwStates |= FWL_ITEMSTATE_LTB_Focused; return FWL_ERR_Succeeded; } @@ -137,13 +137,13 @@ FWL_ERR* CFWL_ListBox::Sort(IFWL_ListBoxCompare *pCom) { return ((IFWL_ListBox*)m_pImp)->Sort(pCom); } -FX_INT32 CFWL_ListBox::CountItems() +int32_t CFWL_ListBox::CountItems() { return m_ListBoxDP.m_arrItem.GetSize(); } -FWL_HLISTITEM CFWL_ListBox::GetItem(FX_INT32 nIndex) +FWL_HLISTITEM CFWL_ListBox::GetItem(int32_t nIndex) { - FX_INT32 nCount = m_ListBoxDP.m_arrItem.GetSize(); + int32_t nCount = m_ListBoxDP.m_arrItem.GetSize(); if (nIndex > nCount - 1 && nIndex < 0) { return NULL; } @@ -186,8 +186,8 @@ FWL_HLISTITEM CFWL_ListBox::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) FX_FLOAT fPosY = 0; ((IFWL_ListBox*)m_pImp)->GetScrollPos(fx); ((IFWL_ListBox*)m_pImp)->GetScrollPos(fy, FALSE); - FX_INT32 nCount = m_ListBoxDP.CountItems(NULL); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = m_ListBoxDP.CountItems(NULL); + for (int32_t i = 0; i < nCount; i ++) { FWL_HLISTITEM hItem = m_ListBoxDP.GetItem(NULL, i); if (!hItem) { continue; @@ -218,8 +218,8 @@ CFWL_ListBox::CFWL_ListBoxDP::CFWL_ListBoxDP() } CFWL_ListBox::CFWL_ListBoxDP::~CFWL_ListBoxDP() { - FX_INT32 nCount = m_arrItem.GetSize(); - for (FX_INT32 i = 0; i < nCount; i ++) { + int32_t nCount = m_arrItem.GetSize(); + for (int32_t i = 0; i < nCount; i ++) { CFWL_ListItem *pItem = (CFWL_ListItem*)m_arrItem[i]; if (pItem != NULL) { delete pItem; @@ -232,11 +232,11 @@ FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::GetCaption(IFWL_Widget *pWidget, CFX_WideS wsCaption = m_wsData; return FWL_ERR_Succeeded; } -FX_INT32 CFWL_ListBox::CFWL_ListBoxDP::CountItems(IFWL_Widget *pWidget) +int32_t CFWL_ListBox::CFWL_ListBoxDP::CountItems(IFWL_Widget *pWidget) { return m_arrItem.GetSize(); } -FWL_HLISTITEM CFWL_ListBox::CFWL_ListBoxDP::GetItem(IFWL_Widget *pWidget, FX_INT32 nIndex) +FWL_HLISTITEM CFWL_ListBox::CFWL_ListBoxDP::GetItem(IFWL_Widget *pWidget, int32_t nIndex) { if (nIndex >= m_arrItem.GetSize() || nIndex < 0) { return NULL; @@ -244,11 +244,11 @@ FWL_HLISTITEM CFWL_ListBox::CFWL_ListBoxDP::GetItem(IFWL_Widget *pWidget, FX_INT return (FWL_HLISTITEM)m_arrItem[nIndex]; } } -FX_INT32 CFWL_ListBox::CFWL_ListBoxDP::GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem) +int32_t CFWL_ListBox::CFWL_ListBoxDP::GetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem) { return m_arrItem.Find(hItem); } -FX_BOOL CFWL_ListBox::CFWL_ListBoxDP::SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, FX_INT32 nIndex) +FX_BOOL CFWL_ListBox::CFWL_ListBoxDP::SetItemIndex(IFWL_Widget *pWidget, FWL_HLISTITEM hItem, int32_t nIndex) { return m_arrItem.SetAt(nIndex, hItem); } diff --git a/xfa/src/fwl/src/lightwidget/picturebox.cpp b/xfa/src/fwl/src/lightwidget/picturebox.cpp index e7d21de90e..619a473c21 100644 --- a/xfa/src/fwl/src/lightwidget/picturebox.cpp +++ b/xfa/src/fwl/src/lightwidget/picturebox.cpp @@ -53,20 +53,20 @@ FWL_ERR CFWL_PictureBox::SetRotation(FX_FLOAT fRotation) m_PictureBoxDP.m_fRotation = fRotation; return FWL_ERR_Succeeded; } -FX_INT32 CFWL_PictureBox::GetFlipMode() +int32_t CFWL_PictureBox::GetFlipMode() { return m_PictureBoxDP.GetFlipMode((IFWL_Widget*)this); } -FWL_ERR CFWL_PictureBox::SetFlipMode(FX_INT32 iFlipMode) +FWL_ERR CFWL_PictureBox::SetFlipMode(int32_t iFlipMode) { m_PictureBoxDP.m_iFlipMode = iFlipMode; return FWL_ERR_Succeeded; } -FX_INT32 CFWL_PictureBox::GetOpacity() +int32_t CFWL_PictureBox::GetOpacity() { return m_PictureBoxDP.GetOpacity((IFWL_Widget*)this); } -FWL_ERR CFWL_PictureBox::SetOpacity(FX_INT32 iOpacity) +FWL_ERR CFWL_PictureBox::SetOpacity(int32_t iOpacity) { m_PictureBoxDP.m_iOpacity = iOpacity; return FWL_ERR_Succeeded; @@ -120,7 +120,7 @@ CFX_DIBitmap* CFWL_PictureBox::CFWL_PictureBoxDP::GetInitialPicture(IFWL_Widget { return m_pBitmap; } -FX_INT32 CFWL_PictureBox::CFWL_PictureBoxDP::GetOpacity(IFWL_Widget *pWidget) +int32_t CFWL_PictureBox::CFWL_PictureBoxDP::GetOpacity(IFWL_Widget *pWidget) { return m_iOpacity; } @@ -138,7 +138,7 @@ FWL_ERR CFWL_PictureBox::CFWL_PictureBoxDP::GetMatrix(IFWL_Widget *pWidget, CFX_ matrix.Translate(m_fOffSetX, m_fOffSetY); return FWL_ERR_Succeeded; } -FX_INT32 CFWL_PictureBox::CFWL_PictureBoxDP::GetFlipMode(IFWL_Widget *pWidget) +int32_t CFWL_PictureBox::CFWL_PictureBoxDP::GetFlipMode(IFWL_Widget *pWidget) { return m_iFlipMode; } diff --git a/xfa/src/fwl/src/lightwidget/theme.cpp b/xfa/src/fwl/src/lightwidget/theme.cpp index a631b37f88..84925f562e 100644 --- a/xfa/src/fwl/src/lightwidget/theme.cpp +++ b/xfa/src/fwl/src/lightwidget/theme.cpp @@ -18,9 +18,9 @@ FX_DWORD CFWL_Theme::GetThemeID(IFWL_Widget *pWidget) } FX_DWORD CFWL_Theme::SetThemeID(IFWL_Widget *pWidget, FX_DWORD dwThemeID, FX_BOOL bChildren ) { - FX_INT32 iCount = m_arrThemes.GetSize(); + int32_t iCount = m_arrThemes.GetSize(); FX_DWORD dwID; - for (FX_INT32 i = 0; i < iCount; i ++) { + for (int32_t i = 0; i < iCount; i ++) { CFWL_WidgetTP *pTheme = (CFWL_WidgetTP*)m_arrThemes[i]; dwID = pTheme->GetThemeID(pWidget); pTheme->SetThemeID(pWidget, dwThemeID, FALSE); @@ -79,8 +79,8 @@ FX_BOOL CFWL_Theme::CalcTextRect(CFWL_ThemeText *pParams, CFX_RectF &rect) } FWL_ERR CFWL_Theme::Initialize() { - FX_INT32 iCount = m_arrThemes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_arrThemes.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { CFWL_WidgetTP *pTheme = (CFWL_WidgetTP*)m_arrThemes[i]; pTheme->Initialize(); } @@ -89,8 +89,8 @@ FWL_ERR CFWL_Theme::Initialize() } FWL_ERR CFWL_Theme::Finalize() { - FX_INT32 iCount = m_arrThemes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_arrThemes.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { CFWL_WidgetTP *pTheme = (CFWL_WidgetTP*)m_arrThemes[i]; pTheme->Finalize(); } @@ -126,8 +126,8 @@ CFWL_Theme::CFWL_Theme() } CFWL_Theme::~CFWL_Theme() { - FX_INT32 iCount = m_arrThemes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_arrThemes.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { CFWL_WidgetTP *pTheme = (CFWL_WidgetTP*)m_arrThemes[i]; delete pTheme; } @@ -135,8 +135,8 @@ CFWL_Theme::~CFWL_Theme() } FWL_ERR CFWL_Theme::SetFont(IFWL_Widget *pWidget, FX_LPCWSTR strFont, FX_FLOAT fFontSize, FX_ARGB rgbFont) { - FX_INT32 iCount = m_arrThemes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_arrThemes.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { CFWL_WidgetTP *pTheme = (CFWL_WidgetTP*)m_arrThemes[i]; pTheme->SetFont(pWidget, strFont, fFontSize, rgbFont); } @@ -144,8 +144,8 @@ FWL_ERR CFWL_Theme::SetFont(IFWL_Widget *pWidget, FX_LPCWSTR strFont, FX_FLOAT f } CFWL_WidgetTP* CFWL_Theme::GetTheme(IFWL_Widget* pWidget) { - FX_INT32 iCount = m_arrThemes.GetSize(); - for (FX_INT32 i = 0; i < iCount; i ++) { + int32_t iCount = m_arrThemes.GetSize(); + for (int32_t i = 0; i < iCount; i ++) { CFWL_WidgetTP *pTheme = (CFWL_WidgetTP*)m_arrThemes[i]; if (pTheme->IsValidWidget(pWidget)) { return pTheme; diff --git a/xfa/src/fwl/src/lightwidget/tooltipctrl.cpp b/xfa/src/fwl/src/lightwidget/tooltipctrl.cpp index 9397013c07..5fc3d5a4f3 100644 --- a/xfa/src/fwl/src/lightwidget/tooltipctrl.cpp +++ b/xfa/src/fwl/src/lightwidget/tooltipctrl.cpp @@ -51,20 +51,20 @@ FWL_ERR CFWL_ToolTip::SetCaption(FX_WSTR wsCaption) m_tooltipData.m_wsCaption = wsCaption; return FWL_ERR_Succeeded; } -FX_INT32 CFWL_ToolTip::GetInitialDelay() +int32_t CFWL_ToolTip::GetInitialDelay() { return m_tooltipData.m_nInitDelayTime; } -FX_INT32 CFWL_ToolTip::SetInitialDelay(FX_INT32 nDelayTime) +int32_t CFWL_ToolTip::SetInitialDelay(int32_t nDelayTime) { m_tooltipData.m_nInitDelayTime = nDelayTime; return FWL_ERR_Succeeded; } -FX_INT32 CFWL_ToolTip::GetAutoPopDelay() +int32_t CFWL_ToolTip::GetAutoPopDelay() { return m_tooltipData.m_nAutoPopDelayTime; } -FX_INT32 CFWL_ToolTip::SetAutoPopDelay(FX_INT32 nDelayTime) +int32_t CFWL_ToolTip::SetAutoPopDelay(int32_t nDelayTime) { m_tooltipData.m_nAutoPopDelayTime = nDelayTime; return FWL_ERR_Succeeded; @@ -119,11 +119,11 @@ FWL_ERR CFWL_ToolTip::CFWL_ToolTipDP::GetCaption(IFWL_Widget *pWidget, CFX_WideS wsCaption = m_wsCaption; return FWL_ERR_Succeeded; } -FX_INT32 CFWL_ToolTip::CFWL_ToolTipDP::GetInitialDelay(IFWL_Widget *pWidget) +int32_t CFWL_ToolTip::CFWL_ToolTipDP::GetInitialDelay(IFWL_Widget *pWidget) { return m_nInitDelayTime; } -FX_INT32 CFWL_ToolTip::CFWL_ToolTipDP::GetAutoPopDelay(IFWL_Widget *pWidget) +int32_t CFWL_ToolTip::CFWL_ToolTipDP::GetAutoPopDelay(IFWL_Widget *pWidget) { return m_nAutoPopDelayTime; } diff --git a/xfa/src/fwl/src/lightwidget/widget.cpp b/xfa/src/fwl/src/lightwidget/widget.cpp index f080d691bc..6171eecf31 100644 --- a/xfa/src/fwl/src/lightwidget/widget.cpp +++ b/xfa/src/fwl/src/lightwidget/widget.cpp @@ -302,7 +302,7 @@ void CFWL_Widget::DispatchEvent(CFWL_Event *pEvent) #define FWL_WGT_CalcHeight 2048 #define FWL_WGT_CalcWidth 2048 #define FWL_WGT_CalcMultiLineDefWidth 120.0f -CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString &wsText, FX_BOOL bMultiLine , FX_INT32 iLineWidth ) +CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString &wsText, FX_BOOL bMultiLine , int32_t iLineWidth ) { CFX_SizeF sz; sz.Set(0, 0); @@ -330,7 +330,7 @@ CFWL_WidgetDelegate::CFWL_WidgetDelegate() CFWL_WidgetDelegate::~CFWL_WidgetDelegate() { } -FX_INT32 CFWL_WidgetDelegate::OnProcessMessage(CFWL_Message *pMessage) +int32_t CFWL_WidgetDelegate::OnProcessMessage(CFWL_Message *pMessage) { return 1; } diff --git a/xfa/src/fwl/src/theme/checkboxtp.cpp b/xfa/src/fwl/src/theme/checkboxtp.cpp index 32e74e4a44..bba56e69ed 100644 --- a/xfa/src/fwl/src/theme/checkboxtp.cpp +++ b/xfa/src/fwl/src/theme/checkboxtp.cpp @@ -101,7 +101,7 @@ FWL_ERR CFWL_CheckBoxTP::Finalize() void CFWL_CheckBoxTP::DrawBoxBk(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_RectF *pRect, FX_DWORD dwStates, CFX_Matrix *pMatrix ) { dwStates &= 0x03; - FX_INT32 fillMode = FXFILL_WINDING; + int32_t fillMode = FXFILL_WINDING; FX_DWORD dwStyleEx = pWidget->GetStylesEx(); dwStyleEx &= FWL_STYLEEXT_CKB_ShapeMask; CFX_Path path; @@ -137,7 +137,7 @@ void CFWL_CheckBoxTP::DrawBoxBk(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, c path.AddEllipse(rtClip); } } - FX_INT32 iTheme = 1; + int32_t iTheme = 1; if ((dwStates & FWL_PARTSTATE_CKB_Mask1) == FWL_PARTSTATE_CKB_Hovered) { iTheme = 2; } else if ((dwStates & FWL_PARTSTATE_CKB_Mask1) == FWL_PARTSTATE_CKB_Pressed) { @@ -303,14 +303,14 @@ void CFWL_CheckBoxTP::DrawSignStar(CFX_Graphics *pGraphics, const CFX_RectF *pRt ptCenter.Set((pRtSign->left + pRtSign->right()) / 2.0f, (pRtSign->top + fBottom) / 2.0f); FX_FLOAT px[5], py[5]; FX_FLOAT fAngel = FX_PI / 10.0f; - for (FX_INT32 i = 0; i < 5; i++) { + for (int32_t i = 0; i < 5; i++) { px[i] = ptCenter.x + fRadius * (FX_FLOAT)cos(fAngel); py[i] = ptCenter.y + fRadius * (FX_FLOAT)sin(fAngel); fAngel += FX_PI * 2 / 5.0f; } path.MoveTo(px[0], py[0]); - FX_INT32 nNext = 0; - for (FX_INT32 j = 0; j < 5; j++) { + int32_t nNext = 0; + for (int32_t j = 0; j < 5; j++) { nNext += 2; if (nNext >= 5) { nNext -= 5; diff --git a/xfa/src/fwl/src/theme/formtp.cpp b/xfa/src/fwl/src/theme/formtp.cpp index 5a6633d3ea..ce12c15e78 100644 --- a/xfa/src/fwl/src/theme/formtp.cpp +++ b/xfa/src/fwl/src/theme/formtp.cpp @@ -71,7 +71,7 @@ FX_DWORD CFWL_FormTP::SetThemeID(IFWL_Widget *pWidget, FX_DWORD dwThemeID, FX_BO FX_BOOL CFWL_FormTP::DrawBackground(CFWL_ThemeBackground *pParams) { _FWL_RETURN_VALUE_IF_FAIL(pParams, FALSE); - FX_INT32 iActive = 0; + int32_t iActive = 0; if (pParams->m_dwStates & FWL_PARTSTATE_FRM_Inactive) { iActive = 1; } @@ -285,7 +285,7 @@ void CFWL_FormTP::CalCaption(IFWL_Widget *pWidget, CFX_RectF &rect) void CFWL_FormTP::CalIcon(IFWL_Widget *pWidget, CFX_RectF &rect) { } -void CFWL_FormTP::DrawFormBorder(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive) +void CFWL_FormTP::DrawFormBorder(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive) { CFX_RectF rt; rt.Set(pRect->left, pRect->top, 1, pRect->height); @@ -332,7 +332,7 @@ void CFWL_FormTP::DrawFormBorder(CFX_Graphics *pGraphics, const CFX_RectF *pRect m_rtDisBBorder.Set(pRect->left, pRect->bottom() - 4, pRect->width, 4); m_rtDisCaption.Set(pRect->left, pRect->top, pRect->width, 29); } -void CFWL_FormTP::DrawCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive) +void CFWL_FormTP::DrawCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive) { CFX_RectF rt; FX_FLOAT fBottom, fRight; @@ -368,10 +368,10 @@ void CFWL_FormTP::DrawCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, pGraphics->StretchImage(m_pDeactivebitmap, rect, pMatrix); } } -void CFWL_FormTP::DrawNarrowCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive) +void CFWL_FormTP::DrawNarrowCaption(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive) { } -void CFWL_FormTP::DrawCloseBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive) +void CFWL_FormTP::DrawCloseBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive) { FX_FLOAT fRight = pRect->right(); FX_FLOAT fBottom = pRect->bottom(); @@ -438,7 +438,7 @@ void CFWL_FormTP::DrawCloseBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, pGraphics->StrokePath(&path, pMatrix); pGraphics->RestoreGraphState(); } -void CFWL_FormTP::DrawMinMaxBoxCommon(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive) +void CFWL_FormTP::DrawMinMaxBoxCommon(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive) { pGraphics->SaveGraphState(); FX_FLOAT fRight = pRect->right(); @@ -489,14 +489,14 @@ void CFWL_FormTP::DrawMinMaxBoxCommon(CFX_Graphics *pGraphics, const CFX_RectF * m_pThemeData->clrNormalBtBKEnd[iActive][eState - 1], &path, FXFILL_WINDING, pMatrix); } -void CFWL_FormTP::DrawMinimizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive) +void CFWL_FormTP::DrawMinimizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive) { DrawMinMaxBoxCommon(pGraphics, pRect, eState, pMatrix); CFX_RectF rtMin; rtMin.Set(pRect->left + 5, pRect->top + 13, pRect->width - 14, pRect->height - 18); FillSoildRect(pGraphics, 0xFFFFFFFF, &rtMin, pMatrix); } -void CFWL_FormTP::DrawMaximizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, FX_BOOL bMax, CFX_Matrix *pMatrix, FX_INT32 iActive) +void CFWL_FormTP::DrawMaximizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRect, FWLTHEME_STATE eState, FX_BOOL bMax, CFX_Matrix *pMatrix, int32_t iActive) { DrawMinMaxBoxCommon(pGraphics, pRect, eState, pMatrix); FX_FLOAT fWidth = pRect->width; @@ -534,7 +534,7 @@ void CFWL_FormTP::DrawMaximizeBox(CFX_Graphics *pGraphics, const CFX_RectF *pRec pGraphics->RestoreGraphState(); } } -void CFWL_FormTP::DrawIconImage(CFX_Graphics *pGraphics, CFX_DIBitmap *pDIBitmap, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, FX_INT32 iActive) +void CFWL_FormTP::DrawIconImage(CFX_Graphics *pGraphics, CFX_DIBitmap *pDIBitmap, const CFX_RectF *pRect, FWLTHEME_STATE eState, CFX_Matrix *pMatrix, int32_t iActive) { pGraphics->StretchImage(pDIBitmap, *pRect, pMatrix); } @@ -739,8 +739,8 @@ void CFWL_FormTP::DeactiveForm() } void CFWL_FormTP::TransModeColor(FX_ARGB clrFore, FX_ARGB &clrBack) { - FX_INT32 iAlfaF, iRF, iGF, iBF; - FX_INT32 iAlfaB, iRB, iGB, iBB; + int32_t iAlfaF, iRF, iGF, iBF; + int32_t iAlfaB, iRB, iGB, iBB; ArgbDecode(clrFore, iAlfaF, iRF, iGF, iBF); ArgbDecode(clrBack, iAlfaB, iRB, iGB, iBB); clrBack = ArgbEncode(0xff, diff --git a/xfa/src/fwl/src/theme/pushbuttontp.cpp b/xfa/src/fwl/src/theme/pushbuttontp.cpp index 13c5eef567..8194b249be 100644 --- a/xfa/src/fwl/src/theme/pushbuttontp.cpp +++ b/xfa/src/fwl/src/theme/pushbuttontp.cpp @@ -63,7 +63,7 @@ FX_BOOL CFWL_PushButtonTP::DrawBackground(CFWL_ThemeBackground *pParams) PUSHBUTTON_SIZE_Corner, PUSHBUTTON_SIZE_Corner); fillPath.AddRectangle(rtInner.left, rtInner.top, rtInner.width, rtInner.height); - FX_INT32 iColor = GetColorID(pParams->m_dwStates); + int32_t iColor = GetColorID(pParams->m_dwStates); DrawAxialShading(pGraphics, rect.left + PUSHBUTTON_SIZE_Corner, rect.top, @@ -159,7 +159,7 @@ void CFWL_PushButtonTP::SetThemeData(FX_DWORD dwID) m_pThemeData->clrFill[4] = ArgbEncode(255, 245, 244, 234); } } -FX_INT32 CFWL_PushButtonTP::GetColorID(FX_DWORD dwStates) +int32_t CFWL_PushButtonTP::GetColorID(FX_DWORD dwStates) { return dwStates &= FWL_PARTSTATE_PSB_Mask; } diff --git a/xfa/src/fwl/src/theme/widgettp.cpp b/xfa/src/fwl/src/theme/widgettp.cpp index 5e186b74ab..aac6516799 100644 --- a/xfa/src/fwl/src/theme/widgettp.cpp +++ b/xfa/src/fwl/src/theme/widgettp.cpp @@ -57,7 +57,7 @@ FX_BOOL CFWL_WidgetTP::DrawText(CFWL_ThemeText *pParams) if (!m_pTextOut) { InitTTO(); } - FX_INT32 iLen = pParams->m_wsText.GetLength(); + int32_t iLen = pParams->m_wsText.GetLength(); _FWL_RETURN_VALUE_IF_FAIL(iLen > 0, FALSE) CFX_Graphics *pGraphics = pParams->m_pGraphics; m_pTextOut->SetRenderDevice(pGraphics->GetRenderDevice()); @@ -434,7 +434,7 @@ void CFWL_WidgetTP::FillSoildRect(CFX_Graphics *pGraphics, FX_ARGB fillColor, co pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); pGraphics->RestoreGraphState(); } -void CFWL_WidgetTP::DrawAxialShading(CFX_Graphics *pGraphics, FX_FLOAT fx1, FX_FLOAT fy1, FX_FLOAT fx2, FX_FLOAT fy2, FX_ARGB beginColor, FX_ARGB endColor, CFX_Path *path, FX_INT32 fillMode, CFX_Matrix *pMatrix ) +void CFWL_WidgetTP::DrawAxialShading(CFX_Graphics *pGraphics, FX_FLOAT fx1, FX_FLOAT fy1, FX_FLOAT fx2, FX_FLOAT fy2, FX_ARGB beginColor, FX_ARGB endColor, CFX_Path *path, int32_t fillMode, CFX_Matrix *pMatrix ) { _FWL_RETURN_IF_FAIL(pGraphics); _FWL_RETURN_IF_FAIL(path); @@ -636,14 +636,14 @@ void CFWL_WidgetTP::DrawArrowBtn(CFX_Graphics *pGraphics, const CFX_RectF *pRect CFWL_ArrowData::CColorData *pColorData = CFWL_ArrowData::GetInstance()->m_pColorData; DrawArrow(pGraphics, pRect, eDict, pColorData->clrSign[eState - 1], pMatrix); } -FWLCOLOR CFWL_WidgetTP::BlendColor(FWLCOLOR srcColor, FWLCOLOR renderColor, FX_BYTE scale) +FWLCOLOR CFWL_WidgetTP::BlendColor(FWLCOLOR srcColor, FWLCOLOR renderColor, uint8_t scale) { FWLCOLOR dstColor; - FX_BYTE n = 255 - scale; - dstColor.a = (FX_BYTE)(((FX_WORD)srcColor.a * n + (FX_WORD)renderColor.a * scale) >> 8); - dstColor.r = (FX_BYTE)(((FX_WORD)srcColor.r * n + (FX_WORD)renderColor.r * scale) >> 8); - dstColor.g = (FX_BYTE)(((FX_WORD)srcColor.g * n + (FX_WORD)renderColor.g * scale) >> 8); - dstColor.b = (FX_BYTE)(((FX_WORD)srcColor.b * n + (FX_WORD)renderColor.b * scale) >> 8); + uint8_t n = 255 - scale; + dstColor.a = (uint8_t)(((FX_WORD)srcColor.a * n + (FX_WORD)renderColor.a * scale) >> 8); + dstColor.r = (uint8_t)(((FX_WORD)srcColor.r * n + (FX_WORD)renderColor.r * scale) >> 8); + dstColor.g = (uint8_t)(((FX_WORD)srcColor.g * n + (FX_WORD)renderColor.g * scale) >> 8); + dstColor.b = (uint8_t)(((FX_WORD)srcColor.b * n + (FX_WORD)renderColor.b * scale) >> 8); return dstColor; } CFWL_ArrowData::CFWL_ArrowData() @@ -713,8 +713,8 @@ CFWL_FontManager::CFWL_FontManager() } CFWL_FontManager::~CFWL_FontManager() { - FX_INT32 count = m_arrFonts.GetSize(); - for (FX_INT32 i = 0; i < count; i ++) { + int32_t count = m_arrFonts.GetSize(); + for (int32_t i = 0; i < count; i ++) { CFWL_FontData *data = (CFWL_FontData*)m_arrFonts[i]; delete data; } @@ -722,8 +722,8 @@ CFWL_FontManager::~CFWL_FontManager() } IFX_Font* CFWL_FontManager::FindFont(FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage) { - FX_INT32 count = m_arrFonts.GetSize(); - for (FX_INT32 i = 0; i < count; i ++) { + int32_t count = m_arrFonts.GetSize(); + for (int32_t i = 0; i < count; i ++) { CFWL_FontData *data = (CFWL_FontData*)m_arrFonts[i]; if (data->Equal(wsFontFamily, dwFontStyles, wCodePage)) { return data->GetFont(); diff --git a/xfa/src/fxbarcode/BC_BarCode.cpp b/xfa/src/fxbarcode/BC_BarCode.cpp index 063f8b5d8d..d87a0ce045 100644 --- a/xfa/src/fxbarcode/BC_BarCode.cpp +++ b/xfa/src/fxbarcode/BC_BarCode.cpp @@ -86,35 +86,35 @@ CBC_CodeBase :: CBC_CodeBase() CBC_CodeBase :: ~CBC_CodeBase() { } -FX_BOOL CBC_CodeBase::SetCharEncoding(FX_INT32 encoding) +FX_BOOL CBC_CodeBase::SetCharEncoding(int32_t encoding) { if (m_pBCWriter) { return m_pBCWriter->SetCharEncoding(encoding); } return FALSE; } -FX_BOOL CBC_CodeBase::SetModuleHeight(FX_INT32 moduleHeight) +FX_BOOL CBC_CodeBase::SetModuleHeight(int32_t moduleHeight) { if (m_pBCWriter) { return m_pBCWriter->SetModuleHeight(moduleHeight); } return FALSE; } -FX_BOOL CBC_CodeBase::SetModuleWidth(FX_INT32 moduleWidth) +FX_BOOL CBC_CodeBase::SetModuleWidth(int32_t moduleWidth) { if (m_pBCWriter) { return m_pBCWriter->SetModuleWidth(moduleWidth); } return FALSE; } -FX_BOOL CBC_CodeBase::SetHeight(FX_INT32 height) +FX_BOOL CBC_CodeBase::SetHeight(int32_t height) { if (m_pBCWriter) { return m_pBCWriter->SetHeight(height); } return FALSE; } -FX_BOOL CBC_CodeBase::SetWidth(FX_INT32 width) +FX_BOOL CBC_CodeBase::SetWidth(int32_t width) { if (m_pBCWriter) { return m_pBCWriter->SetWidth(width); @@ -160,7 +160,7 @@ void CBC_OneCode::SetPrintChecksum(FX_BOOL checksum) ((CBC_OneDimWriter*)m_pBCWriter)->SetPrintChecksum(checksum); } } -void CBC_OneCode::SetDataLength(FX_INT32 length) +void CBC_OneCode::SetDataLength(int32_t length) { if (m_pBCWriter) { ((CBC_OneDimWriter*)m_pBCWriter)->SetDataLength(length); @@ -185,7 +185,7 @@ void CBC_OneCode::SetFontSize(FX_FLOAT size) ((CBC_OneDimWriter*)m_pBCWriter)->SetFontSize(size); } } -void CBC_OneCode::SetFontStyle(FX_INT32 style) +void CBC_OneCode::SetFontStyle(int32_t style) { if (m_pBCWriter) { ((CBC_OneDimWriter*)m_pBCWriter)->SetFontStyle(style); @@ -223,46 +223,46 @@ CBC_Code39::~CBC_Code39() m_pBCWriter = NULL; } } -FX_BOOL CBC_Code39::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) +FX_BOOL CBC_Code39::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) { if(contents.IsEmpty()) { e = BCExceptionNoContents; return FALSE; } BCFORMAT format = BCFORMAT_CODE_39; - FX_INT32 outWidth = 0; - FX_INT32 outHeight = 0; + int32_t outWidth = 0; + int32_t outHeight = 0; CFX_WideString filtercontents = ((CBC_OnedCode39Writer*)m_pBCWriter)->FilterContents(contents); CFX_WideString renderContents = ((CBC_OnedCode39Writer*)m_pBCWriter)->RenderTextContents(contents); m_renderContents = renderContents; CFX_ByteString byteString = filtercontents.UTF8Encode(); - FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); + uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(renderContents, data, outWidth, isDevice, e); FX_Free(data); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_Code39::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) +FX_BOOL CBC_Code39::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) { CFX_WideString renderCon = ((CBC_OnedCode39Writer*)m_pBCWriter)->encodedContents(m_renderContents, e); ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, renderCon, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_Code39::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) +FX_BOOL CBC_Code39::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) { CFX_WideString renderCon = ((CBC_OnedCode39Writer*)m_pBCWriter)->encodedContents(m_renderContents, e); ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, renderCon, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -CFX_WideString CBC_Code39::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) +CFX_WideString CBC_Code39::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e) { CFX_WideString str; return str; } -CFX_WideString CBC_Code39::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) +CFX_WideString CBC_Code39::Decode(CFX_DIBitmap *pBitmap, int32_t &e) { CBC_BufferedImageLuminanceSource source(pBitmap); CBC_GlobalHistogramBinarizer binarizer(&source); @@ -278,7 +278,7 @@ FX_BOOL CBC_Code39::SetTextLocation(BC_TEXT_LOC location) } return FALSE; } -FX_BOOL CBC_Code39::SetWideNarrowRatio(FX_INT32 ratio) +FX_BOOL CBC_Code39::SetWideNarrowRatio(int32_t ratio) { if (m_pBCWriter) { return ((CBC_OnedCode39Writer*)m_pBCWriter)->SetWideNarrowRatio(ratio); @@ -319,52 +319,52 @@ FX_BOOL CBC_Codabar::SetTextLocation(BC_TEXT_LOC location) { return ((CBC_OnedCodaBarWriter*) m_pBCWriter)->SetTextLocation(location); } -FX_BOOL CBC_Codabar::SetWideNarrowRatio(FX_INT32 ratio) +FX_BOOL CBC_Codabar::SetWideNarrowRatio(int32_t ratio) { if (m_pBCWriter) { return ((CBC_OnedCodaBarWriter*) m_pBCWriter)->SetWideNarrowRatio(ratio); } return FALSE; } -FX_BOOL CBC_Codabar::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) +FX_BOOL CBC_Codabar::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) { if(contents.IsEmpty()) { e = BCExceptionNoContents; return FALSE; } BCFORMAT format = BCFORMAT_CODABAR; - FX_INT32 outWidth = 0; - FX_INT32 outHeight = 0; + int32_t outWidth = 0; + int32_t outHeight = 0; CFX_WideString filtercontents = ((CBC_OneDimWriter*)m_pBCWriter)->FilterContents(contents); CFX_ByteString byteString = filtercontents.UTF8Encode(); m_renderContents = filtercontents; - FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); + uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(filtercontents, data, outWidth, isDevice, e); FX_Free(data); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_Codabar::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) +FX_BOOL CBC_Codabar::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) { CFX_WideString renderCon = ((CBC_OnedCodaBarWriter*)m_pBCWriter)->encodedContents(m_renderContents); ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, renderCon, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_Codabar::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) +FX_BOOL CBC_Codabar::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) { CFX_WideString renderCon = ((CBC_OnedCodaBarWriter*)m_pBCWriter)->encodedContents(m_renderContents); ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, renderCon, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -CFX_WideString CBC_Codabar::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) +CFX_WideString CBC_Codabar::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e) { CFX_WideString str; return str; } -CFX_WideString CBC_Codabar::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) +CFX_WideString CBC_Codabar::Decode(CFX_DIBitmap *pBitmap, int32_t &e) { CBC_BufferedImageLuminanceSource source(pBitmap); CBC_GlobalHistogramBinarizer binarizer(&source); @@ -396,15 +396,15 @@ FX_BOOL CBC_Code128::SetTextLocation(BC_TEXT_LOC location) } return FALSE; } -FX_BOOL CBC_Code128::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) +FX_BOOL CBC_Code128::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) { if(contents.IsEmpty()) { e = BCExceptionNoContents; return FALSE; } BCFORMAT format = BCFORMAT_CODE_128; - FX_INT32 outWidth = 0; - FX_INT32 outHeight = 0; + int32_t outWidth = 0; + int32_t outHeight = 0; CFX_WideString content = contents; if (contents.GetLength() % 2 && ((CBC_OnedCode128Writer *)m_pBCWriter)->GetType() == BC_CODE128_C) { content += '0'; @@ -412,31 +412,31 @@ FX_BOOL CBC_Code128::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) CFX_WideString encodeContents = ((CBC_OnedCode128Writer*)m_pBCWriter)->FilterContents(content); m_renderContents = encodeContents; CFX_ByteString byteString = encodeContents.UTF8Encode(); - FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); + uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidth, isDevice, e); FX_Free(data); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_Code128::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) +FX_BOOL CBC_Code128::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) { ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_renderContents, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_Code128::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) +FX_BOOL CBC_Code128::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) { ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderContents, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -CFX_WideString CBC_Code128::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) +CFX_WideString CBC_Code128::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e) { CFX_WideString str; return str; } -CFX_WideString CBC_Code128::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) +CFX_WideString CBC_Code128::Decode(CFX_DIBitmap *pBitmap, int32_t &e) { CBC_BufferedImageLuminanceSource source(pBitmap); CBC_GlobalHistogramBinarizer binarizer(&source); @@ -464,13 +464,13 @@ CBC_EAN8::~CBC_EAN8() CFX_WideString CBC_EAN8::Preprocess(FX_WSTR contents) { CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterContents(contents); - FX_INT32 length = encodeContents.GetLength(); + int32_t length = encodeContents.GetLength(); if (length <= 7) { - for (FX_INT32 i = 0; i < 7 - length; i++) { + for (int32_t i = 0; i < 7 - length; i++) { encodeContents = FX_WCHAR('0') + encodeContents; } CFX_ByteString byteString = encodeContents.UTF8Encode(); - FX_INT32 checksum = ((CBC_OnedEAN8Writer *)m_pBCWriter)->CalcChecksum(byteString); + int32_t checksum = ((CBC_OnedEAN8Writer *)m_pBCWriter)->CalcChecksum(byteString); encodeContents += FX_WCHAR(checksum - 0 + '0'); } if (length > 8) { @@ -478,43 +478,43 @@ CFX_WideString CBC_EAN8::Preprocess(FX_WSTR contents) } return encodeContents; } -FX_BOOL CBC_EAN8::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) +FX_BOOL CBC_EAN8::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) { if(contents.IsEmpty()) { e = BCExceptionNoContents; return FALSE; } BCFORMAT format = BCFORMAT_EAN_8; - FX_INT32 outWidth = 0; - FX_INT32 outHeight = 0; + int32_t outWidth = 0; + int32_t outHeight = 0; CFX_WideString encodeContents = Preprocess(contents); CFX_ByteString byteString = encodeContents.UTF8Encode(); m_renderContents = encodeContents; - FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); + uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidth, isDevice, e); FX_Free(data); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_EAN8::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) +FX_BOOL CBC_EAN8::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) { ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_renderContents, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_EAN8::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) +FX_BOOL CBC_EAN8::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) { ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderContents, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -CFX_WideString CBC_EAN8::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) +CFX_WideString CBC_EAN8::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e) { CFX_WideString str; return str; } -CFX_WideString CBC_EAN8::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) +CFX_WideString CBC_EAN8::Decode(CFX_DIBitmap *pBitmap, int32_t &e) { CBC_BufferedImageLuminanceSource source(pBitmap); CBC_GlobalHistogramBinarizer binarizer(&source); @@ -542,13 +542,13 @@ CBC_EAN13::~CBC_EAN13() CFX_WideString CBC_EAN13::Preprocess(FX_WSTR contents) { CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterContents(contents); - FX_INT32 length = encodeContents.GetLength(); + int32_t length = encodeContents.GetLength(); if (length <= 12) { - for (FX_INT32 i = 0; i < 12 - length; i++) { + for (int32_t i = 0; i < 12 - length; i++) { encodeContents = FX_WCHAR('0') + encodeContents; } CFX_ByteString byteString = encodeContents.UTF8Encode(); - FX_INT32 checksum = ((CBC_OnedEAN13Writer *)m_pBCWriter)->CalcChecksum(byteString); + int32_t checksum = ((CBC_OnedEAN13Writer *)m_pBCWriter)->CalcChecksum(byteString); byteString += checksum - 0 + '0'; encodeContents = byteString.UTF8Decode(); } @@ -557,43 +557,43 @@ CFX_WideString CBC_EAN13::Preprocess(FX_WSTR contents) } return encodeContents; } -FX_BOOL CBC_EAN13::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) +FX_BOOL CBC_EAN13::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) { if(contents.IsEmpty()) { e = BCExceptionNoContents; return FALSE; } BCFORMAT format = BCFORMAT_EAN_13; - FX_INT32 outWidth = 0; - FX_INT32 outHeight = 0; + int32_t outWidth = 0; + int32_t outHeight = 0; CFX_WideString encodeContents = Preprocess(contents); CFX_ByteString byteString = encodeContents.UTF8Encode(); m_renderContents = encodeContents; - FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); + uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidth, isDevice, e); FX_Free(data); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_EAN13::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) +FX_BOOL CBC_EAN13::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) { ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_renderContents, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_EAN13::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) +FX_BOOL CBC_EAN13::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) { ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderContents, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -CFX_WideString CBC_EAN13::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) +CFX_WideString CBC_EAN13::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e) { CFX_WideString str; return str; } -CFX_WideString CBC_EAN13::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) +CFX_WideString CBC_EAN13::Decode(CFX_DIBitmap *pBitmap, int32_t &e) { CBC_BufferedImageLuminanceSource source(pBitmap); CBC_GlobalHistogramBinarizer binarizer(&source); @@ -622,13 +622,13 @@ CBC_UPCA::~CBC_UPCA() CFX_WideString CBC_UPCA::Preprocess(FX_WSTR contents) { CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterContents(contents); - FX_INT32 length = encodeContents.GetLength(); + int32_t length = encodeContents.GetLength(); if (length <= 11) { - for (FX_INT32 i = 0; i < 11 - length; i++) { + for (int32_t i = 0; i < 11 - length; i++) { encodeContents = FX_WCHAR('0') + encodeContents; } CFX_ByteString byteString = encodeContents.UTF8Encode(); - FX_INT32 checksum = ((CBC_OnedUPCAWriter *)m_pBCWriter)->CalcChecksum(byteString); + int32_t checksum = ((CBC_OnedUPCAWriter *)m_pBCWriter)->CalcChecksum(byteString); byteString += checksum - 0 + '0'; encodeContents = byteString.UTF8Decode(); } @@ -637,44 +637,44 @@ CFX_WideString CBC_UPCA::Preprocess(FX_WSTR contents) } return encodeContents; } -FX_BOOL CBC_UPCA::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) +FX_BOOL CBC_UPCA::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) { if(contents.IsEmpty()) { e = BCExceptionNoContents; return FALSE; } BCFORMAT format = BCFORMAT_UPC_A; - FX_INT32 outWidth = 0; - FX_INT32 outHeight = 0; + int32_t outWidth = 0; + int32_t outHeight = 0; CFX_WideString encodeContents = Preprocess(contents); CFX_ByteString byteString = encodeContents.UTF8Encode(); m_renderContents = encodeContents; ((CBC_OnedUPCAWriter*)m_pBCWriter)->Init(); - FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); + uint8_t *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidth, isDevice, e); FX_Free(data); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_UPCA::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) +FX_BOOL CBC_UPCA::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) { ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_renderContents, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_UPCA::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) +FX_BOOL CBC_UPCA::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) { ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderContents, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -CFX_WideString CBC_UPCA::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) +CFX_WideString CBC_UPCA::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e) { CFX_WideString str; return str; } -CFX_WideString CBC_UPCA::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) +CFX_WideString CBC_UPCA::Decode(CFX_DIBitmap *pBitmap, int32_t &e) { CBC_BufferedImageLuminanceSource source(pBitmap); CBC_GlobalHistogramBinarizer binarizer(&source); @@ -700,7 +700,7 @@ CBC_QRCode ::~CBC_QRCode() m_pBCWriter = NULL; } } -FX_BOOL CBC_QRCode::SetVersion(FX_INT32 version) +FX_BOOL CBC_QRCode::SetVersion(int32_t version) { if (version < 0 || version > 40) { return FALSE; @@ -710,7 +710,7 @@ FX_BOOL CBC_QRCode::SetVersion(FX_INT32 version) } return((CBC_QRCodeWriter*)m_pBCWriter)->SetVersion(version); } -FX_BOOL CBC_QRCode::SetErrorCorrectionLevel (FX_INT32 level) +FX_BOOL CBC_QRCode::SetErrorCorrectionLevel (int32_t level) { if (level < 0 || level > 3) { return FALSE; @@ -720,34 +720,34 @@ FX_BOOL CBC_QRCode::SetErrorCorrectionLevel (FX_INT32 level) } return ((CBC_TwoDimWriter*)m_pBCWriter)->SetErrorCorrectionLevel(level); } -FX_BOOL CBC_QRCode::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) +FX_BOOL CBC_QRCode::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) { - FX_INT32 outWidth = 0; - FX_INT32 outHeight = 0; - FX_BYTE *data = ((CBC_QRCodeWriter*)m_pBCWriter)->Encode(contents, ((CBC_QRCodeWriter*)m_pBCWriter)->GetErrorCorrectionLevel(), outWidth, outHeight, e); + int32_t outWidth = 0; + int32_t outHeight = 0; + uint8_t *data = ((CBC_QRCodeWriter*)m_pBCWriter)->Encode(contents, ((CBC_QRCodeWriter*)m_pBCWriter)->GetErrorCorrectionLevel(), outWidth, outHeight, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e); FX_Free(data); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_QRCode::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) +FX_BOOL CBC_QRCode::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) { ((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx); return TRUE; } -FX_BOOL CBC_QRCode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) +FX_BOOL CBC_QRCode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) { ((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -CFX_WideString CBC_QRCode::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) +CFX_WideString CBC_QRCode::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e) { CFX_WideString str; return str; } -CFX_WideString CBC_QRCode::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) +CFX_WideString CBC_QRCode::Decode(CFX_DIBitmap *pBitmap, int32_t &e) { CBC_BufferedImageLuminanceSource source(pBitmap); CBC_GlobalHistogramBinarizer binarizer(&source); @@ -772,7 +772,7 @@ CBC_PDF417I::~CBC_PDF417I() m_pBCWriter = NULL; } } -FX_BOOL CBC_PDF417I::SetErrorCorrectionLevel (FX_INT32 level) +FX_BOOL CBC_PDF417I::SetErrorCorrectionLevel (int32_t level) { ((CBC_PDF417Writer*)m_pBCWriter)->SetErrorCorrectionLevel(level); return TRUE; @@ -781,35 +781,35 @@ void CBC_PDF417I::SetTruncated(FX_BOOL truncated) { ((CBC_PDF417Writer*)m_pBCWriter)->SetTruncated(truncated); } -FX_BOOL CBC_PDF417I::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) +FX_BOOL CBC_PDF417I::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) { BCFORMAT format = BCFORMAT_PDF_417; - FX_INT32 outWidth = 0; - FX_INT32 outHeight = 0; - FX_BYTE *data = ((CBC_PDF417Writer*)m_pBCWriter)->Encode(contents, outWidth, outHeight, e); + int32_t outWidth = 0; + int32_t outHeight = 0; + uint8_t *data = ((CBC_PDF417Writer*)m_pBCWriter)->Encode(contents, outWidth, outHeight, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e); FX_Free(data); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_PDF417I::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) +FX_BOOL CBC_PDF417I::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) { ((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx); return TRUE; } -FX_BOOL CBC_PDF417I::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) +FX_BOOL CBC_PDF417I::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) { ((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -CFX_WideString CBC_PDF417I::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) +CFX_WideString CBC_PDF417I::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e) { CFX_WideString str; return str; } -CFX_WideString CBC_PDF417I::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) +CFX_WideString CBC_PDF417I::Decode(CFX_DIBitmap *pBitmap, int32_t &e) { CBC_BufferedImageLuminanceSource source(pBitmap); CBC_GlobalHistogramBinarizer binarizer(&source); @@ -835,34 +835,34 @@ CBC_DataMatrix::~CBC_DataMatrix() m_pBCWriter = NULL; } } -FX_BOOL CBC_DataMatrix::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e) +FX_BOOL CBC_DataMatrix::Encode(FX_WSTR contents, FX_BOOL isDevice, int32_t &e) { - FX_INT32 outWidth = 0; - FX_INT32 outHeight = 0; - FX_BYTE *data = ((CBC_DataMatrixWriter *)m_pBCWriter)->Encode(contents, outWidth, outHeight, e); + int32_t outWidth = 0; + int32_t outHeight = 0; + uint8_t *data = ((CBC_DataMatrixWriter *)m_pBCWriter)->Encode(contents, outWidth, outHeight, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e); FX_Free(data); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -FX_BOOL CBC_DataMatrix::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e) +FX_BOOL CBC_DataMatrix::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, int32_t &e) { ((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx); return TRUE; } -FX_BOOL CBC_DataMatrix::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e) +FX_BOOL CBC_DataMatrix::RenderBitmap(CFX_DIBitmap *&pOutBitmap, int32_t &e) { ((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return TRUE; } -CFX_WideString CBC_DataMatrix::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e) +CFX_WideString CBC_DataMatrix::Decode(uint8_t* buf, int32_t width, int32_t hight, int32_t &e) { CFX_WideString str; return str; } -CFX_WideString CBC_DataMatrix::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e) +CFX_WideString CBC_DataMatrix::Decode(CFX_DIBitmap *pBitmap, int32_t &e) { CBC_BufferedImageLuminanceSource source(pBitmap); CBC_GlobalHistogramBinarizer binarizer(&source); diff --git a/xfa/src/fxbarcode/BC_Binarizer.h b/xfa/src/fxbarcode/BC_Binarizer.h index 730829aba1..241bc1da03 100644 --- a/xfa/src/fxbarcode/BC_Binarizer.h +++ b/xfa/src/fxbarcode/BC_Binarizer.h @@ -16,8 +16,8 @@ public: CBC_Binarizer(CBC_LuminanceSource *source); virtual ~CBC_Binarizer(); CBC_LuminanceSource *GetLuminanceSource(); - virtual CBC_CommonBitMatrix *GetBlackMatrix(FX_INT32 &e) = 0; - virtual CBC_CommonBitArray *GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e) = 0; + virtual CBC_CommonBitMatrix *GetBlackMatrix(int32_t &e) = 0; + virtual CBC_CommonBitArray *GetBlackRow(int32_t y, CBC_CommonBitArray *row, int32_t &e) = 0; private: CBC_LuminanceSource *m_source; }; diff --git a/xfa/src/fxbarcode/BC_BinaryBitmap.cpp b/xfa/src/fxbarcode/BC_BinaryBitmap.cpp index 90e1755cf4..f37b49c478 100644 --- a/xfa/src/fxbarcode/BC_BinaryBitmap.cpp +++ b/xfa/src/fxbarcode/BC_BinaryBitmap.cpp @@ -36,15 +36,15 @@ CBC_BinaryBitmap::~CBC_BinaryBitmap() } m_matrix = NULL; } -FX_INT32 CBC_BinaryBitmap::GetHeight() +int32_t CBC_BinaryBitmap::GetHeight() { return m_binarizer->GetLuminanceSource()->GetHeight(); } -FX_INT32 CBC_BinaryBitmap::GetWidth() +int32_t CBC_BinaryBitmap::GetWidth() { return m_binarizer->GetLuminanceSource()->GetWidth(); } -CBC_CommonBitMatrix *CBC_BinaryBitmap::GetMatrix(FX_INT32 &e) +CBC_CommonBitMatrix *CBC_BinaryBitmap::GetMatrix(int32_t &e) { if (m_matrix == NULL) { m_matrix = m_binarizer->GetBlackMatrix(e); @@ -60,13 +60,13 @@ FX_BOOL CBC_BinaryBitmap::IsRotateSupported() { return m_binarizer->GetLuminanceSource()->IsRotateSupported(); } -CBC_CommonBitArray *CBC_BinaryBitmap::GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e) +CBC_CommonBitArray *CBC_BinaryBitmap::GetBlackRow(int32_t y, CBC_CommonBitArray *row, int32_t &e) { CBC_CommonBitArray *temp = m_binarizer->GetBlackRow(y, row, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return temp; } -CBC_CommonBitMatrix *CBC_BinaryBitmap::GetBlackMatrix(FX_INT32 &e) +CBC_CommonBitMatrix *CBC_BinaryBitmap::GetBlackMatrix(int32_t &e) { if (m_matrix == NULL) { m_matrix = m_binarizer->GetBlackMatrix(e); diff --git a/xfa/src/fxbarcode/BC_BinaryBitmap.h b/xfa/src/fxbarcode/BC_BinaryBitmap.h index e555a2b42c..439e446354 100644 --- a/xfa/src/fxbarcode/BC_BinaryBitmap.h +++ b/xfa/src/fxbarcode/BC_BinaryBitmap.h @@ -15,11 +15,11 @@ class CBC_BinaryBitmap public: CBC_BinaryBitmap(CBC_Binarizer *binarizer); virtual ~CBC_BinaryBitmap(); - FX_INT32 GetWidth(); - FX_INT32 GetHeight(); - CBC_CommonBitMatrix * GetMatrix(FX_INT32 &e); - CBC_CommonBitArray * GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e); - CBC_CommonBitMatrix * GetBlackMatrix(FX_INT32 &e); + int32_t GetWidth(); + int32_t GetHeight(); + CBC_CommonBitMatrix * GetMatrix(int32_t &e); + CBC_CommonBitArray * GetBlackRow(int32_t y, CBC_CommonBitArray *row, int32_t &e); + CBC_CommonBitMatrix * GetBlackMatrix(int32_t &e); FX_BOOL IsCropSupported(); FX_BOOL IsRotateSupported(); private: diff --git a/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.cpp b/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.cpp index d385c456de..423d2c74aa 100644 --- a/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.cpp +++ b/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.cpp @@ -47,7 +47,7 @@ static CFX_DIBitmap* CreateDIBSource(IFX_FileRead* fileread) bitmap->Create(pImageCodec->GetWidth(), pImageCodec->GetHeight(), FXDIB_Argb); bitmap->Clear(FXARGB_MAKE(0xFF, 0xFF, 0xFF, 0xFF)); CBC_Pause pause; - FX_INT32 frames; + int32_t frames; status = pImageCodec->GetFrames(frames, &pause); while (status == FXCODEC_STATUS_FRAME_TOBECONTINUE) { status = pImageCodec->GetFrames(frames, &pause); @@ -105,7 +105,7 @@ CBC_BufferedImageLuminanceSource::CBC_BufferedImageLuminanceSource(const CFX_Wid m_top = 0; m_left = 0; } -void CBC_BufferedImageLuminanceSource::Init(FX_INT32 &e) +void CBC_BufferedImageLuminanceSource::Init(int32_t &e) { IFX_FileRead* fileread = FX_CreateFileRead(m_filename); m_pBitmap = CreateDIBSource(fileread); @@ -137,27 +137,27 @@ CBC_BufferedImageLuminanceSource::~CBC_BufferedImageLuminanceSource() delete m_pBitmap; m_pBitmap = NULL; } -CFX_ByteArray *CBC_BufferedImageLuminanceSource::GetRow(FX_INT32 y, CFX_ByteArray &row, FX_INT32 &e) +CFX_ByteArray *CBC_BufferedImageLuminanceSource::GetRow(int32_t y, CFX_ByteArray &row, int32_t &e) { if (y < 0 || y >= m_height) { e = BCExceptionRequestedRowIsOutSizeTheImage; return NULL; } - FX_INT32 width = m_width; + int32_t width = m_width; if(row.GetSize() == 0 || row.GetSize() < width) { row.SetSize(width); } if(m_rgbData.GetSize() == 0 || m_rgbData.GetSize() < width) { m_rgbData.SetSize(width); } - FX_INT32* rowLine = (FX_INT32*)m_pBitmap->GetScanline(y); - FX_INT32 x; + int32_t* rowLine = (int32_t*)m_pBitmap->GetScanline(y); + int32_t x; for (x = 0; x < width; x++) { - FX_INT32 pixel = rowLine[x]; - FX_INT32 luminance = (306 * ((pixel >> 16) & 0xFF) + + int32_t pixel = rowLine[x]; + int32_t luminance = (306 * ((pixel >> 16) & 0xFF) + 601 * ((pixel >> 8) & 0xFF) + 117 * (pixel & 0xFF)) >> 10; - row[x] = (FX_BYTE) luminance; + row[x] = (uint8_t) luminance; } return &row; } @@ -165,17 +165,17 @@ CFX_ByteArray *CBC_BufferedImageLuminanceSource::GetMatrix() { CFX_ByteArray *matirx = FX_NEW CFX_ByteArray(); matirx->SetSize(m_bytesPerLine * m_height); - FX_INT32 *rgb = (FX_INT32*)m_pBitmap->GetBuffer(); - FX_INT32 y; + int32_t *rgb = (int32_t*)m_pBitmap->GetBuffer(); + int32_t y; for(y = 0; y < m_height; y++) { - FX_INT32 offset = y * m_width; - FX_INT32 x; + int32_t offset = y * m_width; + int32_t x; for(x = 0; x < m_width; x++) { - FX_INT32 pixel = rgb[offset + x]; - FX_INT32 luminance = (306 * ((pixel >> 16) & 0xFF) + + int32_t pixel = rgb[offset + x]; + int32_t luminance = (306 * ((pixel >> 16) & 0xFF) + 601 * ((pixel >> 8) & 0xFF) + 117 * (pixel & 0xFF)) >> 10; - (*matirx)[offset + x] = (FX_BYTE) luminance; + (*matirx)[offset + x] = (uint8_t) luminance; } } return matirx; @@ -188,17 +188,17 @@ FX_BOOL CBC_BufferedImageLuminanceSource::IsRotateSupported() { return TRUE; } -CBC_LuminanceSource *CBC_BufferedImageLuminanceSource::Crop(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height) +CBC_LuminanceSource *CBC_BufferedImageLuminanceSource::Crop(int32_t left, int32_t top, int32_t width, int32_t height) { return NULL; } -CBC_LuminanceSource *CBC_BufferedImageLuminanceSource::RotateCounterClockwise(FX_INT32 &e) +CBC_LuminanceSource *CBC_BufferedImageLuminanceSource::RotateCounterClockwise(int32_t &e) { if (!IsRotateSupported()) { e = BCExceptionRotateNotSupported; return NULL; } - FX_INT32 sourceWidth = m_width; - FX_INT32 sourceHeight = m_height; + int32_t sourceWidth = m_width; + int32_t sourceHeight = m_height; return NULL; } diff --git a/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.h b/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.h index 4bff1756d5..11d51e3c1d 100644 --- a/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.h +++ b/xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.h @@ -14,18 +14,18 @@ public: CBC_BufferedImageLuminanceSource(const CFX_WideString &filename); CBC_BufferedImageLuminanceSource(CFX_DIBitmap *pBitmap); virtual ~CBC_BufferedImageLuminanceSource(); - CBC_LuminanceSource *RotateCounterClockwise(FX_INT32 &e); - CBC_LuminanceSource *Crop(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height); + CBC_LuminanceSource *RotateCounterClockwise(int32_t &e); + CBC_LuminanceSource *Crop(int32_t left, int32_t top, int32_t width, int32_t height); - CFX_ByteArray *GetRow(FX_INT32 y, CFX_ByteArray &row, FX_INT32 &e); + CFX_ByteArray *GetRow(int32_t y, CFX_ByteArray &row, int32_t &e); CFX_ByteArray *GetMatrix(); FX_BOOL IsCropSupported(); FX_BOOL IsRotateSupported(); - virtual void Init(FX_INT32 &e); + virtual void Init(int32_t &e); private: - FX_INT32 m_bytesPerLine; - FX_INT32 m_left; - FX_INT32 m_top; + int32_t m_bytesPerLine; + int32_t m_left; + int32_t m_top; CFX_Int32Array m_rgbData; CFX_DIBitmap *m_pBitmap; const CFX_WideString m_filename; diff --git a/xfa/src/fxbarcode/BC_DecoderResult.h b/xfa/src/fxbarcode/BC_DecoderResult.h index 9655d66383..1dcfb8ae5b 100644 --- a/xfa/src/fxbarcode/BC_DecoderResult.h +++ b/xfa/src/fxbarcode/BC_DecoderResult.h @@ -15,18 +15,18 @@ public: CFX_ByteArray* getRawBytes(); CFX_ByteString getText(); CFX_ByteString getECLevel(); - FX_INT32 getErrorsCorrected(); - void setErrorsCorrected(FX_INT32 errorsCorrected); - FX_INT32 getErasures(); - void setErasures(FX_INT32 erasures); + int32_t getErrorsCorrected(); + void setErrorsCorrected(int32_t errorsCorrected); + int32_t getErasures(); + void setErasures(int32_t erasures); void* getOther(); void setOther(void* other); private: CFX_ByteArray* m_rawBytes; CFX_ByteString m_text; CFX_ByteString m_ecLevel; - FX_INT32 m_errorsCorrected; - FX_INT32 m_erasures; + int32_t m_errorsCorrected; + int32_t m_erasures; void* m_other; }; #endif diff --git a/xfa/src/fxbarcode/BC_Dimension.cpp b/xfa/src/fxbarcode/BC_Dimension.cpp index 5662c6eba7..dcd39ae3f1 100644 --- a/xfa/src/fxbarcode/BC_Dimension.cpp +++ b/xfa/src/fxbarcode/BC_Dimension.cpp @@ -26,7 +26,7 @@ CBC_Dimension::CBC_Dimension() { } -CBC_Dimension::CBC_Dimension(FX_INT32 width, FX_INT32 height, FX_INT32 &e) +CBC_Dimension::CBC_Dimension(int32_t width, int32_t height, int32_t &e) { if (width < 0 || height < 0) { e = BCExceptionHeightAndWidthMustBeAtLeast1; @@ -37,15 +37,15 @@ CBC_Dimension::CBC_Dimension(FX_INT32 width, FX_INT32 height, FX_INT32 &e) CBC_Dimension::~CBC_Dimension() { } -FX_INT32 CBC_Dimension::getWidth() +int32_t CBC_Dimension::getWidth() { return m_width; } -FX_INT32 CBC_Dimension::getHeight() +int32_t CBC_Dimension::getHeight() { return m_height; } -FX_INT32 CBC_Dimension::hashCode() +int32_t CBC_Dimension::hashCode() { return m_width * 32713 + m_height; } diff --git a/xfa/src/fxbarcode/BC_Dimension.h b/xfa/src/fxbarcode/BC_Dimension.h index 42c87a6cb3..655d5e4ad3 100644 --- a/xfa/src/fxbarcode/BC_Dimension.h +++ b/xfa/src/fxbarcode/BC_Dimension.h @@ -11,14 +11,14 @@ class CBC_Dimension { public: CBC_Dimension(); - CBC_Dimension(FX_INT32 width, FX_INT32 height, FX_INT32 &e); + CBC_Dimension(int32_t width, int32_t height, int32_t &e); virtual ~CBC_Dimension(); - FX_INT32 getWidth(); - FX_INT32 getHeight(); - FX_INT32 hashCode(); + int32_t getWidth(); + int32_t getHeight(); + int32_t hashCode(); CFX_WideString toString(); private: - FX_INT32 m_width; - FX_INT32 m_height; + int32_t m_width; + int32_t m_height; }; #endif diff --git a/xfa/src/fxbarcode/BC_Library.cpp b/xfa/src/fxbarcode/BC_Library.cpp index e84eda6099..917a902456 100644 --- a/xfa/src/fxbarcode/BC_Library.cpp +++ b/xfa/src/fxbarcode/BC_Library.cpp @@ -97,7 +97,7 @@ void BC_Library_Init() CBC_SymbolInfo::Initialize(); CBC_ErrorCorrection::Initialize(); CBC_PDF417HighLevelEncoder::Initialize(); - FX_INT32 e = 0; + int32_t e = 0; CBC_PDF417ECModulusGF::Initialize(e); CBC_DecodedBitStreamPaser::Initialize(); CBC_PDF417CodewordDecoder::Initialize(); diff --git a/xfa/src/fxbarcode/BC_LuminanceSource.cpp b/xfa/src/fxbarcode/BC_LuminanceSource.cpp index e237454a83..b656389c5e 100644 --- a/xfa/src/fxbarcode/BC_LuminanceSource.cpp +++ b/xfa/src/fxbarcode/BC_LuminanceSource.cpp @@ -22,17 +22,17 @@ #include "barcode.h" #include "BC_LuminanceSource.h" -CBC_LuminanceSource::CBC_LuminanceSource(FX_INT32 width, FX_INT32 height): m_width(width), m_height(height) +CBC_LuminanceSource::CBC_LuminanceSource(int32_t width, int32_t height): m_width(width), m_height(height) { } CBC_LuminanceSource::~CBC_LuminanceSource() { } -FX_INT32 CBC_LuminanceSource::GetWidth() +int32_t CBC_LuminanceSource::GetWidth() { return m_width; } -FX_INT32 CBC_LuminanceSource::GetHeight() +int32_t CBC_LuminanceSource::GetHeight() { return m_height; } diff --git a/xfa/src/fxbarcode/BC_LuminanceSource.h b/xfa/src/fxbarcode/BC_LuminanceSource.h index 013f1b84f3..168868e421 100644 --- a/xfa/src/fxbarcode/BC_LuminanceSource.h +++ b/xfa/src/fxbarcode/BC_LuminanceSource.h @@ -10,12 +10,12 @@ class CBC_LuminanceSource; class CBC_LuminanceSource { public: - CBC_LuminanceSource(FX_INT32 width, FX_INT32 height); + CBC_LuminanceSource(int32_t width, int32_t height); virtual ~CBC_LuminanceSource(); - FX_INT32 GetWidth(); - FX_INT32 GetHeight(); + int32_t GetWidth(); + int32_t GetHeight(); - virtual CFX_ByteArray *GetRow(FX_INT32 y, CFX_ByteArray &row, FX_INT32 &e) = 0; + virtual CFX_ByteArray *GetRow(int32_t y, CFX_ByteArray &row, int32_t &e) = 0; virtual CFX_ByteArray *GetMatrix() = 0; virtual FX_BOOL IsCropSupported() { @@ -26,9 +26,9 @@ public: return FALSE; } - virtual CBC_LuminanceSource *RotateCounterClockwise(FX_INT32 &e) = 0; + virtual CBC_LuminanceSource *RotateCounterClockwise(int32_t &e) = 0; protected: - FX_INT32 m_width; - FX_INT32 m_height; + int32_t m_width; + int32_t m_height; }; #endif diff --git a/xfa/src/fxbarcode/BC_Reader.h b/xfa/src/fxbarcode/BC_Reader.h index 74c12b6e2c..0db699d357 100644 --- a/xfa/src/fxbarcode/BC_Reader.h +++ b/xfa/src/fxbarcode/BC_Reader.h @@ -13,7 +13,7 @@ class CBC_Reader public: CBC_Reader(); virtual ~CBC_Reader(); - virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e) = 0; - virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e) = 0; + virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e) = 0; + virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e) = 0; }; #endif diff --git a/xfa/src/fxbarcode/BC_TwoDimWriter.cpp b/xfa/src/fxbarcode/BC_TwoDimWriter.cpp index c0456cd104..7c261aa052 100644 --- a/xfa/src/fxbarcode/BC_TwoDimWriter.cpp +++ b/xfa/src/fxbarcode/BC_TwoDimWriter.cpp @@ -27,8 +27,8 @@ void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Ma CFX_PathData path; path.AppendRect(0, 0, (FX_FLOAT)m_Width, (FX_FLOAT)m_Height); device->DrawPath(&path, matrix, &stateData, m_backgroundColor, m_backgroundColor, FXFILL_ALTERNATE); - FX_INT32 leftPos = 0; - FX_INT32 topPos = 0; + int32_t leftPos = 0; + int32_t topPos = 0; if ( m_bFixedSize) { leftPos = (m_Width - m_output->GetWidth()) / 2; topPos = (m_Height - m_output->GetHeight()) / 2; @@ -39,8 +39,8 @@ void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Ma matriScale.Concat(*matrix); matri = matriScale; } - for (FX_INT32 x = 0; x < m_output->GetWidth(); x++) { - for (FX_INT32 y = 0; y < m_output->GetHeight(); y++) { + for (int32_t x = 0; x < m_output->GetWidth(); x++) { + for (int32_t y = 0; y < m_output->GetHeight(); y++) { CFX_PathData rect; rect.AppendRect((FX_FLOAT)leftPos + x, (FX_FLOAT)topPos + y, (FX_FLOAT)(leftPos + x + 1), (FX_FLOAT)(topPos + y + 1)); CFX_GraphStateData stateData; @@ -50,7 +50,7 @@ void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Ma } } } -void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_INT32& e) +void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, int32_t& e) { if (m_bFixedSize) { pOutBitmap = CreateDIBitmap(m_Width, m_Height); @@ -62,14 +62,14 @@ void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_INT32& e return; } pOutBitmap->Clear(m_backgroundColor); - FX_INT32 leftPos = 0; - FX_INT32 topPos = 0; + int32_t leftPos = 0; + int32_t topPos = 0; if ( m_bFixedSize) { leftPos = (m_Width - m_output->GetWidth()) / 2; topPos = (m_Height - m_output->GetHeight()) / 2; } - for (FX_INT32 x = 0; x < m_output->GetWidth(); x++) { - for (FX_INT32 y = 0; y < m_output->GetHeight(); y++) { + for (int32_t x = 0; x < m_output->GetWidth(); x++) { + for (int32_t y = 0; y < m_output->GetHeight(); y++) { if (m_output->Get(x, y)) { pOutBitmap->SetPixel(leftPos + x, topPos + y, m_barColor); } @@ -83,22 +83,22 @@ void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_INT32& e pOutBitmap = pStretchBitmap; } } -void CBC_TwoDimWriter::RenderResult(FX_BYTE *code, FX_INT32 codeWidth, FX_INT32 codeHeight, FX_INT32 &e) +void CBC_TwoDimWriter::RenderResult(uint8_t *code, int32_t codeWidth, int32_t codeHeight, int32_t &e) { - FX_INT32 inputWidth = codeWidth; - FX_INT32 inputHeight = codeHeight; - FX_INT32 tempWidth = inputWidth + (1 << 1); - FX_INT32 tempHeight = inputHeight + (1 << 1); + int32_t inputWidth = codeWidth; + int32_t inputHeight = codeHeight; + int32_t tempWidth = inputWidth + (1 << 1); + int32_t tempHeight = inputHeight + (1 << 1); FX_FLOAT moduleHSize = (FX_FLOAT)FX_MIN(m_ModuleWidth, m_ModuleHeight); if (moduleHSize > 8) { moduleHSize = 8; } else if (moduleHSize < 1) { moduleHSize = 1; } - FX_INT32 outputWidth = (FX_INT32)FX_MAX(tempWidth * moduleHSize, tempWidth); - FX_INT32 outputHeight = (FX_INT32)FX_MAX(tempHeight * moduleHSize, tempHeight); - FX_INT32 multiX = 1; - FX_INT32 multiY = 1; + int32_t outputWidth = (int32_t)FX_MAX(tempWidth * moduleHSize, tempWidth); + int32_t outputHeight = (int32_t)FX_MAX(tempHeight * moduleHSize, tempHeight); + int32_t multiX = 1; + int32_t multiY = 1; if (m_bFixedSize) { if (m_Width < outputWidth || m_Height < outputHeight) { e = BCExceptionBitmapSizeError; @@ -106,18 +106,18 @@ void CBC_TwoDimWriter::RenderResult(FX_BYTE *code, FX_INT32 codeWidth, FX_INT32 } } else { if (m_Width > outputWidth || m_Height > outputHeight) { - outputWidth = (FX_INT32)(outputWidth * ceil ( (FX_FLOAT)m_Width / (FX_FLOAT)outputWidth)); - outputHeight = (FX_INT32)(outputHeight * ceil ( (FX_FLOAT)m_Height / (FX_FLOAT)outputHeight)); + outputWidth = (int32_t)(outputWidth * ceil ( (FX_FLOAT)m_Width / (FX_FLOAT)outputWidth)); + outputHeight = (int32_t)(outputHeight * ceil ( (FX_FLOAT)m_Height / (FX_FLOAT)outputHeight)); } } - multiX = (FX_INT32)ceil((FX_FLOAT)outputWidth / (FX_FLOAT)tempWidth); - multiY = (FX_INT32)ceil((FX_FLOAT)outputHeight / (FX_FLOAT) tempHeight); + multiX = (int32_t)ceil((FX_FLOAT)outputWidth / (FX_FLOAT)tempWidth); + multiY = (int32_t)ceil((FX_FLOAT)outputHeight / (FX_FLOAT) tempHeight); if (m_bFixedSize) { multiX = FX_MIN(multiX, multiY); multiY = multiX; } - FX_INT32 leftPadding = (outputWidth - (inputWidth * multiX)) / 2; - FX_INT32 topPadding = (outputHeight - (inputHeight * multiY)) / 2; + int32_t leftPadding = (outputWidth - (inputWidth * multiX)) / 2; + int32_t topPadding = (outputHeight - (inputHeight * multiY)) / 2; if (leftPadding < 0) { leftPadding = 0; } @@ -126,8 +126,8 @@ void CBC_TwoDimWriter::RenderResult(FX_BYTE *code, FX_INT32 codeWidth, FX_INT32 } m_output = FX_NEW CBC_CommonBitMatrix; m_output->Init(outputWidth, outputHeight); - for (FX_INT32 inputY = 0, outputY = topPadding; (inputY < inputHeight) && (outputY < outputHeight - multiY); inputY++, outputY += multiY) { - for (FX_INT32 inputX = 0, outputX = leftPadding; (inputX < inputWidth) && (outputX < outputWidth - multiX); inputX++, outputX += multiX) { + for (int32_t inputY = 0, outputY = topPadding; (inputY < inputHeight) && (outputY < outputHeight - multiY); inputY++, outputY += multiY) { + for (int32_t inputX = 0, outputX = leftPadding; (inputX < inputWidth) && (outputX < outputWidth - multiX); inputX++, outputX += multiX) { if (code[inputX + inputY * inputWidth] == 1) { m_output->SetRegion(outputX, outputY, multiX, multiY, e); BC_EXCEPTION_CHECK_ReturnVoid(e); diff --git a/xfa/src/fxbarcode/BC_TwoDimWriter.h b/xfa/src/fxbarcode/BC_TwoDimWriter.h index 369d494c08..9ed2932c27 100644 --- a/xfa/src/fxbarcode/BC_TwoDimWriter.h +++ b/xfa/src/fxbarcode/BC_TwoDimWriter.h @@ -15,29 +15,29 @@ class CBC_TwoDimWriter : public CBC_Writer public: CBC_TwoDimWriter(); virtual ~CBC_TwoDimWriter(); - virtual FX_BYTE* Encode(const CFX_WideString& contents, FX_INT32 ecLevel, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) + virtual uint8_t* Encode(const CFX_WideString& contents, int32_t ecLevel, int32_t &outWidth, int32_t &outHeight, int32_t &e) { return NULL; }; - virtual FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) + virtual uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) { return NULL; }; - virtual FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) + virtual uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e) { return NULL; }; - virtual void RenderResult(FX_BYTE *code, FX_INT32 codeWidth, FX_INT32 codeHeight, FX_INT32 &e); - virtual void RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_INT32& e); + virtual void RenderResult(uint8_t *code, int32_t codeWidth, int32_t codeHeight, int32_t &e); + virtual void RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, int32_t& e); virtual void RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix); - virtual FX_BOOL SetErrorCorrectionLevel (FX_INT32 level) = 0; - virtual FX_INT32 GetErrorCorrectionLevel() + virtual FX_BOOL SetErrorCorrectionLevel (int32_t level) = 0; + virtual int32_t GetErrorCorrectionLevel() { return m_iCorrectLevel; }; protected: - FX_INT32 m_iCorrectLevel; + int32_t m_iCorrectLevel; FX_BOOL m_bFixedSize; CBC_CommonBitMatrix* m_output; }; diff --git a/xfa/src/fxbarcode/BC_UtilCodingConvert.cpp b/xfa/src/fxbarcode/BC_UtilCodingConvert.cpp index c6aa1f3eb7..440df7c889 100644 --- a/xfa/src/fxbarcode/BC_UtilCodingConvert.cpp +++ b/xfa/src/fxbarcode/BC_UtilCodingConvert.cpp @@ -25,20 +25,20 @@ void CBC_UtilCodingConvert::LocaleToUtf8(const CFX_ByteString &src, CFX_ByteArra { CFX_WideString unicode = CFX_WideString::FromLocal(src, src.GetLength()); CFX_ByteString utf8 = unicode.UTF8Encode(); - for (FX_INT32 i = 0; i < utf8.GetLength(); i ++) { + for (int32_t i = 0; i < utf8.GetLength(); i ++) { dst.Add(utf8[i]); } } void CBC_UtilCodingConvert::Utf8ToLocale(const CFX_ByteArray &src, CFX_ByteString &dst) { CFX_ByteString utf8; - for (FX_INT32 i = 0; i < src.GetSize(); i ++) { + for (int32_t i = 0; i < src.GetSize(); i ++) { utf8 += src[i]; } CFX_WideString unicode = CFX_WideString::FromUTF8(utf8, utf8.GetLength()); dst.ConvertFrom(unicode); } -void CBC_UtilCodingConvert::Utf8ToLocale(const FX_BYTE *src, FX_INT32 count, CFX_ByteString &dst) +void CBC_UtilCodingConvert::Utf8ToLocale(const uint8_t *src, int32_t count, CFX_ByteString &dst) { CFX_WideString unicode = CFX_WideString::FromUTF8((const char*)src, count); dst.ConvertFrom(unicode); diff --git a/xfa/src/fxbarcode/BC_UtilCodingConvert.h b/xfa/src/fxbarcode/BC_UtilCodingConvert.h index c5dc5a415e..175d32e4f6 100644 --- a/xfa/src/fxbarcode/BC_UtilCodingConvert.h +++ b/xfa/src/fxbarcode/BC_UtilCodingConvert.h @@ -16,7 +16,7 @@ public: static void LocaleToUtf8(const CFX_ByteString &source, CFX_ByteString &result); static void LocaleToUtf8(const CFX_ByteString &source, CFX_ByteArray &result); static void Utf8ToLocale(const CFX_ByteArray &source, CFX_ByteString &result); - static void Utf8ToLocale(const FX_BYTE *source, FX_INT32 count, CFX_ByteString &result); + static void Utf8ToLocale(const uint8_t *source, int32_t count, CFX_ByteString &result); static void UnicodeToUTF8(const CFX_WideString &source, CFX_ByteString &result); }; #endif diff --git a/xfa/src/fxbarcode/BC_UtilRSS.cpp b/xfa/src/fxbarcode/BC_UtilRSS.cpp index c65df34e13..8ebfb6d6f1 100644 --- a/xfa/src/fxbarcode/BC_UtilRSS.cpp +++ b/xfa/src/fxbarcode/BC_UtilRSS.cpp @@ -28,17 +28,17 @@ CBC_UtilRSS::CBC_UtilRSS() CBC_UtilRSS::~CBC_UtilRSS() { } -CFX_Int32Array *CBC_UtilRSS::GetRssWidths(FX_INT32 val, FX_INT32 n, FX_INT32 elements, FX_INT32 maxWidth, FX_BOOL noNarrow) +CFX_Int32Array *CBC_UtilRSS::GetRssWidths(int32_t val, int32_t n, int32_t elements, int32_t maxWidth, FX_BOOL noNarrow) { CFX_Int32Array *iTemp = FX_NEW CFX_Int32Array; iTemp->SetSize(elements); CBC_AutoPtr widths(iTemp); - FX_INT32 bar; - FX_INT32 narrowMask = 0; + int32_t bar; + int32_t narrowMask = 0; for (bar = 0; bar < elements - 1; bar++) { narrowMask |= (1 << bar); - FX_INT32 elmWidth = 1; - FX_INT32 subVal; + int32_t elmWidth = 1; + int32_t subVal; while (TRUE) { subVal = Combins(n - elmWidth - 1, elements - bar - 2); if (noNarrow && (narrowMask == 0) && @@ -46,8 +46,8 @@ CFX_Int32Array *CBC_UtilRSS::GetRssWidths(FX_INT32 val, FX_INT32 n, FX_INT32 ele subVal -= Combins(n - elmWidth - (elements - bar), elements - bar - 2); } if (elements - bar - 1 > 1) { - FX_INT32 lessVal = 0; - for (FX_INT32 mxwElement = n - elmWidth - (elements - bar - 2); + int32_t lessVal = 0; + for (int32_t mxwElement = n - elmWidth - (elements - bar - 2); mxwElement > maxWidth; mxwElement--) { lessVal += Combins(n - elmWidth - mxwElement - 1, elements - bar - 3); @@ -70,29 +70,29 @@ CFX_Int32Array *CBC_UtilRSS::GetRssWidths(FX_INT32 val, FX_INT32 n, FX_INT32 ele (*widths)[bar] = n; return widths.release(); } -FX_INT32 CBC_UtilRSS::GetRSSvalue(CFX_Int32Array &widths, FX_INT32 maxWidth, FX_BOOL noNarrow) +int32_t CBC_UtilRSS::GetRSSvalue(CFX_Int32Array &widths, int32_t maxWidth, FX_BOOL noNarrow) { - FX_INT32 elements = widths.GetSize(); - FX_INT32 n = 0; - for (FX_INT32 i = 0; i < elements; i++) { + int32_t elements = widths.GetSize(); + int32_t n = 0; + for (int32_t i = 0; i < elements; i++) { n += widths[i]; } - FX_INT32 val = 0; - FX_INT32 narrowMask = 0; - for (FX_INT32 bar = 0; bar < elements - 1; bar++) { - FX_INT32 elmWidth; + int32_t val = 0; + int32_t narrowMask = 0; + for (int32_t bar = 0; bar < elements - 1; bar++) { + int32_t elmWidth; for (elmWidth = 1, narrowMask |= (1 << bar); elmWidth < widths[bar]; elmWidth++, narrowMask &= ~(1 << bar)) { - FX_INT32 subVal = Combins(n - elmWidth - 1, elements - bar - 2); + int32_t subVal = Combins(n - elmWidth - 1, elements - bar - 2); if (noNarrow && (narrowMask == 0) && (n - elmWidth - (elements - bar - 1) >= elements - bar - 1)) { subVal -= Combins(n - elmWidth - (elements - bar), elements - bar - 2); } if (elements - bar - 1 > 1) { - FX_INT32 lessVal = 0; - for (FX_INT32 mxwElement = n - elmWidth - (elements - bar - 2); + int32_t lessVal = 0; + for (int32_t mxwElement = n - elmWidth - (elements - bar - 2); mxwElement > maxWidth; mxwElement--) { lessVal += Combins(n - elmWidth - mxwElement - 1, elements - bar - 3); @@ -107,10 +107,10 @@ FX_INT32 CBC_UtilRSS::GetRSSvalue(CFX_Int32Array &widths, FX_INT32 maxWidth, FX_ } return val; } -FX_INT32 CBC_UtilRSS::Combins(FX_INT32 n, FX_INT32 r) +int32_t CBC_UtilRSS::Combins(int32_t n, int32_t r) { - FX_INT32 maxDenom; - FX_INT32 minDenom; + int32_t maxDenom; + int32_t minDenom; if (n - r > r) { minDenom = r; maxDenom = n - r; @@ -118,9 +118,9 @@ FX_INT32 CBC_UtilRSS::Combins(FX_INT32 n, FX_INT32 r) minDenom = n - r; maxDenom = r; } - FX_INT32 val = 1; - FX_INT32 j = 1; - for (FX_INT32 i = n; i > maxDenom; i--) { + int32_t val = 1; + int32_t j = 1; + for (int32_t i = n; i > maxDenom; i--) { val *= i; if (j <= minDenom) { val /= j; @@ -133,15 +133,15 @@ FX_INT32 CBC_UtilRSS::Combins(FX_INT32 n, FX_INT32 r) } return val; } -CFX_Int32Array *CBC_UtilRSS::Elements(CFX_Int32Array &eDist, FX_INT32 N, FX_INT32 K) +CFX_Int32Array *CBC_UtilRSS::Elements(CFX_Int32Array &eDist, int32_t N, int32_t K) { CFX_Int32Array *widths = FX_NEW CFX_Int32Array; widths->SetSize(eDist.GetSize() + 2); - FX_INT32 twoK = K << 1; + int32_t twoK = K << 1; (*widths)[0] = 1; - FX_INT32 i; - FX_INT32 minEven = 10; - FX_INT32 barSum = 1; + int32_t i; + int32_t minEven = 10; + int32_t barSum = 1; for (i = 1; i < twoK - 2; i += 2) { (*widths)[i] = eDist[i - 1] - (*widths)[i - 1]; (*widths)[i + 1] = eDist[i] - (*widths)[i]; diff --git a/xfa/src/fxbarcode/BC_UtilRSS.h b/xfa/src/fxbarcode/BC_UtilRSS.h index 076e2f263d..3c63a51579 100644 --- a/xfa/src/fxbarcode/BC_UtilRSS.h +++ b/xfa/src/fxbarcode/BC_UtilRSS.h @@ -11,12 +11,12 @@ class CBC_UtilRSS { public: virtual ~CBC_UtilRSS(); - static FX_INT32 GetRSSvalue(CFX_Int32Array &widths, FX_INT32 maxWidth, FX_BOOL noNarrow); + static int32_t GetRSSvalue(CFX_Int32Array &widths, int32_t maxWidth, FX_BOOL noNarrow); protected: - static CFX_Int32Array *GetRssWidths(FX_INT32 val, FX_INT32 n, FX_INT32 elements, FX_INT32 maxWidth, FX_BOOL noNarrow); - static FX_INT32 Combins(FX_INT32 n, FX_INT32 r); - static CFX_Int32Array *Elements(CFX_Int32Array &eDist, FX_INT32 N, FX_INT32 K); + static CFX_Int32Array *GetRssWidths(int32_t val, int32_t n, int32_t elements, int32_t maxWidth, FX_BOOL noNarrow); + static int32_t Combins(int32_t n, int32_t r); + static CFX_Int32Array *Elements(CFX_Int32Array &eDist, int32_t N, int32_t K); private: CBC_UtilRSS(); }; diff --git a/xfa/src/fxbarcode/BC_Utils.cpp b/xfa/src/fxbarcode/BC_Utils.cpp index 3a04ebda2b..8ddbb51d49 100644 --- a/xfa/src/fxbarcode/BC_Utils.cpp +++ b/xfa/src/fxbarcode/BC_Utils.cpp @@ -5,36 +5,36 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "barcode.h" -FX_BOOL BC_FX_ByteString_Replace(CFX_ByteString &dst, FX_DWORD first, FX_DWORD last, FX_INT32 count, FX_CHAR c) +FX_BOOL BC_FX_ByteString_Replace(CFX_ByteString &dst, FX_DWORD first, FX_DWORD last, int32_t count, FX_CHAR c) { if (first > last || count <= 0) { return FALSE; } dst.Delete(first, last - first); - for (FX_INT32 i = 0; i < count; i ++) { + for (int32_t i = 0; i < count; i ++) { dst.Insert(0, c); } return TRUE; } -void BC_FX_ByteString_Append(CFX_ByteString &dst, FX_INT32 count, FX_CHAR c) +void BC_FX_ByteString_Append(CFX_ByteString &dst, int32_t count, FX_CHAR c) { - for (FX_INT32 i = 0; i < count; i ++) { + for (int32_t i = 0; i < count; i ++) { dst += c; } } void BC_FX_ByteString_Append(CFX_ByteString &dst, const CFX_ByteArray &ba) { - for (FX_INT32 i = 0; i < ba.GetSize(); i ++) { + for (int32_t i = 0; i < ba.GetSize(); i ++) { dst += ba[i]; } } void BC_FX_PtrArray_Sort(CFX_PtrArray &src, BC_PtrArrayCompareCallback fun) { - FX_INT32 nLength = src.GetSize(); + int32_t nLength = src.GetSize(); FX_BOOL changed = true; do { changed = false; - for (FX_INT32 i = 0; i < nLength - 1; i++) { + for (int32_t i = 0; i < nLength - 1; i++) { if ( fun(src[i + 1], src[i]) ) { void *temp = src[i]; src.SetAt(i, src[i + 1]); diff --git a/xfa/src/fxbarcode/BC_Writer.cpp b/xfa/src/fxbarcode/BC_Writer.cpp index 69276dd1f4..07dabb31ed 100644 --- a/xfa/src/fxbarcode/BC_Writer.cpp +++ b/xfa/src/fxbarcode/BC_Writer.cpp @@ -20,12 +20,12 @@ CBC_Writer::CBC_Writer() CBC_Writer::~CBC_Writer() { } -FX_BOOL CBC_Writer::SetCharEncoding(FX_INT32 encoding) +FX_BOOL CBC_Writer::SetCharEncoding(int32_t encoding) { m_CharEncoding = encoding; return TRUE; } -FX_BOOL CBC_Writer::SetModuleHeight(FX_INT32 moduleHeight) +FX_BOOL CBC_Writer::SetModuleHeight(int32_t moduleHeight) { if (moduleHeight > 10 || moduleHeight < 1) { return FALSE; @@ -33,7 +33,7 @@ FX_BOOL CBC_Writer::SetModuleHeight(FX_INT32 moduleHeight) m_ModuleHeight = moduleHeight; return TRUE; } -FX_BOOL CBC_Writer::SetModuleWidth(FX_INT32 moduleWidth) +FX_BOOL CBC_Writer::SetModuleWidth(int32_t moduleWidth) { if ( moduleWidth > 10 || moduleWidth < 1) { return FALSE; @@ -41,12 +41,12 @@ FX_BOOL CBC_Writer::SetModuleWidth(FX_INT32 moduleWidth) m_ModuleWidth = moduleWidth; return TRUE; } -FX_BOOL CBC_Writer::SetHeight(FX_INT32 height) +FX_BOOL CBC_Writer::SetHeight(int32_t height) { m_Height = height; return TRUE; } -FX_BOOL CBC_Writer::SetWidth(FX_INT32 width) +FX_BOOL CBC_Writer::SetWidth(int32_t width) { m_Width = width; return TRUE; @@ -59,7 +59,7 @@ void CBC_Writer::SetBarcodeColor(FX_ARGB foregroundColor) { m_barColor = foregroundColor; } -CFX_DIBitmap* CBC_Writer::CreateDIBitmap(FX_INT32 width, FX_INT32 height) +CFX_DIBitmap* CBC_Writer::CreateDIBitmap(int32_t width, int32_t height) { CFX_DIBitmap *pDIBitmap = NULL; pDIBitmap = FX_NEW CFX_DIBitmap; diff --git a/xfa/src/fxbarcode/BC_Writer.h b/xfa/src/fxbarcode/BC_Writer.h index d92dc9b2ea..3d226255c6 100644 --- a/xfa/src/fxbarcode/BC_Writer.h +++ b/xfa/src/fxbarcode/BC_Writer.h @@ -12,22 +12,22 @@ class CBC_Writer public: CBC_Writer(); virtual ~CBC_Writer(); - virtual FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) = 0; - virtual FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) = 0; - virtual FX_BOOL SetCharEncoding(FX_INT32 encoding); - virtual FX_BOOL SetModuleHeight(FX_INT32 moduleHeight); - virtual FX_BOOL SetModuleWidth(FX_INT32 moduleWidth); - virtual FX_BOOL SetHeight(FX_INT32 height); - virtual FX_BOOL SetWidth(FX_INT32 width); + virtual uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e) = 0; + virtual uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) = 0; + 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 void SetBackgroundColor(FX_ARGB backgroundColor); virtual void SetBarcodeColor(FX_ARGB foregroundColor); protected: - CFX_DIBitmap* CreateDIBitmap(FX_INT32 width, FX_INT32 height); - FX_INT32 m_CharEncoding; - FX_INT32 m_ModuleHeight; - FX_INT32 m_ModuleWidth; - FX_INT32 m_Height; - FX_INT32 m_Width; + CFX_DIBitmap* CreateDIBitmap(int32_t width, int32_t height); + int32_t m_CharEncoding; + int32_t m_ModuleHeight; + int32_t m_ModuleWidth; + int32_t m_Height; + int32_t m_Width; FXDIB_Format m_colorSpace; FX_ARGB m_barColor; FX_ARGB m_backgroundColor; diff --git a/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp b/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp index 6263affbe8..a73fd37148 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp @@ -32,7 +32,7 @@ CBC_CommonBitArray::CBC_CommonBitArray() m_bits.SetSize(1); m_size = 0; } -CBC_CommonBitArray::CBC_CommonBitArray(FX_INT32 size) +CBC_CommonBitArray::CBC_CommonBitArray(int32_t size) { m_bits.SetSize((size + 31) >> 5); m_size = size; @@ -41,7 +41,7 @@ CBC_CommonBitArray::~CBC_CommonBitArray() { m_size = 0; } -FX_INT32 CBC_CommonBitArray::GetSize() +int32_t CBC_CommonBitArray::GetSize() { return m_size; } @@ -49,31 +49,31 @@ CFX_Int32Array& CBC_CommonBitArray::GetBits() { return m_bits; } -FX_INT32 CBC_CommonBitArray::GetSizeInBytes() +int32_t CBC_CommonBitArray::GetSizeInBytes() { return (m_size + 7) >> 3; } -FX_BOOL CBC_CommonBitArray::Get(FX_INT32 i) +FX_BOOL CBC_CommonBitArray::Get(int32_t i) { return (m_bits[i >> 5] & (1 << (i & 0x1f))) != 0; } -void CBC_CommonBitArray::Set(FX_INT32 i) +void CBC_CommonBitArray::Set(int32_t i) { m_bits[i >> 5] |= 1 << (i & 0x1F); } -void CBC_CommonBitArray::Flip(FX_INT32 i) +void CBC_CommonBitArray::Flip(int32_t i) { m_bits[i >> 5] ^= 1 << (i & 0x1F); } -void CBC_CommonBitArray::SetBulk(FX_INT32 i, FX_INT32 newBits) +void CBC_CommonBitArray::SetBulk(int32_t i, int32_t newBits) { m_bits[i >> 5] = newBits; } void CBC_CommonBitArray::Clear() { - FXSYS_memset32(&m_bits[0], 0x00, m_bits.GetSize() * sizeof(FX_INT32)); + FXSYS_memset32(&m_bits[0], 0x00, m_bits.GetSize() * sizeof(int32_t)); } -FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, FX_INT32 &e) +FX_BOOL CBC_CommonBitArray::IsRange(int32_t start, int32_t end, FX_BOOL value, int32_t &e) { if (end < start) { e = BCExceptionEndLessThanStart; @@ -83,18 +83,18 @@ FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, return TRUE; } end--; - FX_INT32 firstInt = start >> 5; - FX_INT32 lastInt = end >> 5; - FX_INT32 i; + int32_t firstInt = start >> 5; + int32_t lastInt = end >> 5; + int32_t i; for (i = firstInt; i <= lastInt; i++) { - FX_INT32 firstBit = i > firstInt ? 0 : start & 0x1F; - FX_INT32 lastBit = i < lastInt ? 31 : end & 0x1F; - FX_INT32 mask; + int32_t firstBit = i > firstInt ? 0 : start & 0x1F; + int32_t lastBit = i < lastInt ? 31 : end & 0x1F; + int32_t mask; if (firstBit == 0 && lastBit == 31) { mask = -1; } else { mask = 0; - for (FX_INT32 j = firstBit; j <= lastBit; j++) { + for (int32_t j = firstBit; j <= lastBit; j++) { mask |= 1 << j; } } @@ -104,21 +104,21 @@ FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, } return TRUE; } -FX_INT32* CBC_CommonBitArray::GetBitArray() +int32_t* CBC_CommonBitArray::GetBitArray() { return &m_bits[0]; } void CBC_CommonBitArray::Reverse() { - FX_INT32* newBits = FX_Alloc(FX_INT32, m_bits.GetSize()); - FXSYS_memset32(newBits, 0x00, m_bits.GetSize() * sizeof(FX_INT32)); - FX_INT32 size = m_size; - FX_INT32 i; + int32_t* newBits = FX_Alloc(int32_t, m_bits.GetSize()); + FXSYS_memset32(newBits, 0x00, m_bits.GetSize() * sizeof(int32_t)); + int32_t size = m_size; + int32_t i; for (i = 0; i < size; i++) { if (Get(size - i - 1)) { newBits[i >> 5] |= 1 << (i & 0x1F); } } - FXSYS_memcpy32(&m_bits[0], newBits, m_bits.GetSize() * sizeof(FX_INT32)); + FXSYS_memcpy32(&m_bits[0], newBits, m_bits.GetSize() * sizeof(int32_t)); FX_Free(newBits); } diff --git a/xfa/src/fxbarcode/common/BC_CommonBitArray.h b/xfa/src/fxbarcode/common/BC_CommonBitArray.h index d1c8f6d528..32b94f4912 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitArray.h +++ b/xfa/src/fxbarcode/common/BC_CommonBitArray.h @@ -10,22 +10,22 @@ class CBC_CommonBitArray { public: CBC_CommonBitArray(CBC_CommonBitArray* array); - CBC_CommonBitArray(FX_INT32 size); + CBC_CommonBitArray(int32_t size); CBC_CommonBitArray(); virtual ~CBC_CommonBitArray(); - FX_INT32 GetSize(); + int32_t GetSize(); CFX_Int32Array& GetBits(); - FX_INT32 GetSizeInBytes(); - FX_BOOL Get(FX_INT32 i); - void Set(FX_INT32 i); - void Flip(FX_INT32 i); - void SetBulk(FX_INT32 i, FX_INT32 newBits); - FX_BOOL IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, FX_INT32 &e); - FX_INT32 *GetBitArray(); + int32_t GetSizeInBytes(); + FX_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); + int32_t *GetBitArray(); void Reverse(); void Clear(); private: - FX_INT32 m_size; + int32_t m_size; CFX_Int32Array m_bits; }; #endif diff --git a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp index df24d1dabb..135dd2ff28 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp @@ -30,23 +30,23 @@ CBC_CommonBitMatrix::CBC_CommonBitMatrix() m_rowSize = 0; m_bits = NULL; } -void CBC_CommonBitMatrix::Init(FX_INT32 dimension) +void CBC_CommonBitMatrix::Init(int32_t dimension) { m_width = dimension; m_height = dimension; - FX_INT32 rowSize = (m_height + 31) >> 5; + int32_t rowSize = (m_height + 31) >> 5; m_rowSize = rowSize; - m_bits = FX_Alloc(FX_INT32, m_rowSize * m_height); - FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(FX_INT32)); + m_bits = FX_Alloc(int32_t, m_rowSize * m_height); + FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(int32_t)); } -void CBC_CommonBitMatrix::Init(FX_INT32 width, FX_INT32 height) +void CBC_CommonBitMatrix::Init(int32_t width, int32_t height) { m_width = width; m_height = height; - FX_INT32 rowSize = (width + 31) >> 5; + int32_t rowSize = (width + 31) >> 5; m_rowSize = rowSize; - m_bits = FX_Alloc(FX_INT32, m_rowSize * m_height); - FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(FX_INT32)); + m_bits = FX_Alloc(int32_t, m_rowSize * m_height); + FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(int32_t)); } CBC_CommonBitMatrix::~CBC_CommonBitMatrix() { @@ -56,36 +56,36 @@ CBC_CommonBitMatrix::~CBC_CommonBitMatrix() m_bits = NULL; m_height = m_width = m_rowSize = 0; } -FX_BOOL CBC_CommonBitMatrix::Get(FX_INT32 x, FX_INT32 y) +FX_BOOL CBC_CommonBitMatrix::Get(int32_t x, int32_t y) { - FX_INT32 offset = y * m_rowSize + (x >> 5); + int32_t offset = y * m_rowSize + (x >> 5); if (offset >= m_rowSize * m_height || offset < 0) { return false; } return ((((FX_DWORD)m_bits[offset]) >> (x & 0x1f)) & 1) != 0; } -FX_INT32* CBC_CommonBitMatrix::GetBits() +int32_t* CBC_CommonBitMatrix::GetBits() { return m_bits; } -void CBC_CommonBitMatrix::Set(FX_INT32 x, FX_INT32 y) +void CBC_CommonBitMatrix::Set(int32_t x, int32_t y) { - FX_INT32 offset = y * m_rowSize + (x >> 5); + int32_t offset = y * m_rowSize + (x >> 5); if (offset >= m_rowSize * m_height || offset < 0) { return; } m_bits[offset] |= 1 << (x & 0x1f); } -void CBC_CommonBitMatrix::Flip(FX_INT32 x, FX_INT32 y) +void CBC_CommonBitMatrix::Flip(int32_t x, int32_t y) { - FX_INT32 offset = y * m_rowSize + (x >> 5); + int32_t offset = y * m_rowSize + (x >> 5); m_bits[offset] ^= 1 << (x & 0x1f); } void CBC_CommonBitMatrix::Clear() { - FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(FX_INT32)); + FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(int32_t)); } -void CBC_CommonBitMatrix::SetRegion(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height, FX_INT32 &e) +void CBC_CommonBitMatrix::SetRegion(int32_t left, int32_t top, int32_t width, int32_t height, int32_t &e) { if (top < 0 || left < 0) { e = BCExceptionLeftAndTopMustBeNonnegative; @@ -95,22 +95,22 @@ void CBC_CommonBitMatrix::SetRegion(FX_INT32 left, FX_INT32 top, FX_INT32 width, e = BCExceptionHeightAndWidthMustBeAtLeast1; return; } - FX_INT32 right = left + width; - FX_INT32 bottom = top + height; + int32_t right = left + width; + int32_t bottom = top + height; if (m_height < bottom || m_width < right) { e = BCExceptionRegionMustFitInsideMatrix; return; } - FX_INT32 y; + int32_t y; for (y = top; y < bottom; y++) { - FX_INT32 offset = y * m_rowSize; - FX_INT32 x; + int32_t offset = y * m_rowSize; + int32_t x; for (x = left; x < right; x++) { m_bits[offset + (x >> 5)] |= 1 << (x & 0x1f); } } } -CBC_CommonBitArray* CBC_CommonBitMatrix::GetRow(FX_INT32 y, CBC_CommonBitArray* row) +CBC_CommonBitArray* CBC_CommonBitMatrix::GetRow(int32_t y, CBC_CommonBitArray* row) { CBC_CommonBitArray* rowArray = NULL; if (row == NULL || row->GetSize() < m_width) { @@ -118,40 +118,40 @@ CBC_CommonBitArray* CBC_CommonBitMatrix::GetRow(FX_INT32 y, CBC_CommonBitArray* } else { rowArray = FX_NEW CBC_CommonBitArray(row); } - FX_INT32 offset = y * m_rowSize; - FX_INT32 x; + int32_t offset = y * m_rowSize; + int32_t x; for (x = 0; x < m_rowSize; x++) { rowArray->SetBulk(x << 5, m_bits[offset + x]); } return rowArray; } -void CBC_CommonBitMatrix::SetRow(FX_INT32 y, CBC_CommonBitArray* row) +void CBC_CommonBitMatrix::SetRow(int32_t y, CBC_CommonBitArray* row) { - FX_INT32 l = y * m_rowSize; - for (FX_INT32 i = 0; i < m_rowSize; i++) { + int32_t l = y * m_rowSize; + for (int32_t i = 0; i < m_rowSize; i++) { m_bits[l] = row->GetBitArray()[i]; l++; } } -void CBC_CommonBitMatrix::SetCol(FX_INT32 y, CBC_CommonBitArray* col) +void CBC_CommonBitMatrix::SetCol(int32_t y, CBC_CommonBitArray* col) { - for (FX_INT32 i = 0; i < col->GetBits().GetSize(); i++) { + for (int32_t i = 0; i < col->GetBits().GetSize(); i++) { m_bits[i * m_rowSize + y] = col->GetBitArray()[i]; } } -FX_INT32 CBC_CommonBitMatrix::GetWidth() +int32_t CBC_CommonBitMatrix::GetWidth() { return m_width; } -FX_INT32 CBC_CommonBitMatrix::GetHeight() +int32_t CBC_CommonBitMatrix::GetHeight() { return m_height; } -FX_INT32 CBC_CommonBitMatrix::GetRowSize() +int32_t CBC_CommonBitMatrix::GetRowSize() { return m_rowSize; } -FX_INT32 CBC_CommonBitMatrix::GetDimension(FX_INT32 &e) +int32_t CBC_CommonBitMatrix::GetDimension(int32_t &e) { if (m_width != m_height) { e = BCExceptionCanNotCallGetDimensionOnNonSquareMatrix; diff --git a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.h b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.h index 8641ef1f63..4c129fdb82 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitMatrix.h +++ b/xfa/src/fxbarcode/common/BC_CommonBitMatrix.h @@ -12,26 +12,26 @@ class CBC_CommonBitMatrix public: CBC_CommonBitMatrix(); virtual ~CBC_CommonBitMatrix(); - FX_BOOL Get(FX_INT32 x, FX_INT32 y); - void Set(FX_INT32 x, FX_INT32 y); - void Flip(FX_INT32 x, FX_INT32 y); + FX_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(); - void SetRegion(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height, FX_INT32 &e); - CBC_CommonBitArray* GetRow(FX_INT32 y, CBC_CommonBitArray* row); - void SetRow(FX_INT32 y, CBC_CommonBitArray* row); - CBC_CommonBitArray* GetCol(FX_INT32 y, CBC_CommonBitArray* row); - void SetCol(FX_INT32 y, CBC_CommonBitArray* col); - FX_INT32 GetWidth(); - FX_INT32 GetHeight(); - FX_INT32 GetRowSize(); - FX_INT32 GetDimension(FX_INT32 &e); - virtual void Init(FX_INT32 dimension); - virtual void Init(FX_INT32 width, FX_INT32 height); - FX_INT32* GetBits(); + void SetRegion(int32_t left, int32_t top, int32_t width, int32_t height, int32_t &e); + CBC_CommonBitArray* GetRow(int32_t y, CBC_CommonBitArray* row); + void SetRow(int32_t y, CBC_CommonBitArray* row); + CBC_CommonBitArray* GetCol(int32_t y, CBC_CommonBitArray* row); + void SetCol(int32_t y, CBC_CommonBitArray* col); + int32_t GetWidth(); + int32_t GetHeight(); + int32_t GetRowSize(); + int32_t GetDimension(int32_t &e); + virtual void Init(int32_t dimension); + virtual void Init(int32_t width, int32_t height); + int32_t* GetBits(); private: - FX_INT32 m_width; - FX_INT32 m_height; - FX_INT32 m_rowSize; - FX_INT32* m_bits; + int32_t m_width; + int32_t m_height; + int32_t m_rowSize; + int32_t* m_bits; }; #endif diff --git a/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp b/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp index b71848a60c..f32d634a5a 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp @@ -31,18 +31,18 @@ CBC_CommonBitSource::CBC_CommonBitSource(CFX_ByteArray* bytes) CBC_CommonBitSource::~CBC_CommonBitSource() { } -FX_INT32 CBC_CommonBitSource::ReadBits(FX_INT32 numBits, FX_INT32 &e) +int32_t CBC_CommonBitSource::ReadBits(int32_t numBits, int32_t &e) { if (numBits < 1 || numBits > 32) { e = BCExceptionIllegalArgument; return 0; } - FX_INT32 result = 0; + int32_t result = 0; if (m_bitOffset > 0) { - FX_INT32 bitsLeft = 8 - m_bitOffset; - FX_INT32 toRead = numBits < bitsLeft ? numBits : bitsLeft; - FX_INT32 bitsToNotRead = bitsLeft - toRead; - FX_INT32 mask = (0xff >> (8 - toRead)) << bitsToNotRead; + int32_t bitsLeft = 8 - m_bitOffset; + int32_t toRead = numBits < bitsLeft ? numBits : bitsLeft; + int32_t bitsToNotRead = bitsLeft - toRead; + int32_t mask = (0xff >> (8 - toRead)) << bitsToNotRead; result = (m_bytes[m_byteOffset] & mask) >> bitsToNotRead; numBits -= toRead; m_bitOffset += toRead; @@ -58,19 +58,19 @@ FX_INT32 CBC_CommonBitSource::ReadBits(FX_INT32 numBits, FX_INT32 &e) numBits -= 8; } if (numBits > 0) { - FX_INT32 bitsToNotRead = 8 - numBits; - FX_INT32 mask = (0xff >> bitsToNotRead) << bitsToNotRead; + int32_t bitsToNotRead = 8 - numBits; + int32_t mask = (0xff >> bitsToNotRead) << bitsToNotRead; result = (result << numBits) | ((m_bytes[m_byteOffset] & mask) >> bitsToNotRead); m_bitOffset += numBits; } } return result; } -FX_INT32 CBC_CommonBitSource::Available() +int32_t CBC_CommonBitSource::Available() { return 8 * (m_bytes.GetSize() - m_byteOffset) - m_bitOffset; } -FX_INT32 CBC_CommonBitSource::getByteOffset() +int32_t CBC_CommonBitSource::getByteOffset() { return m_byteOffset; } diff --git a/xfa/src/fxbarcode/common/BC_CommonBitSource.h b/xfa/src/fxbarcode/common/BC_CommonBitSource.h index f6a5985ae2..278b4b6a1c 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitSource.h +++ b/xfa/src/fxbarcode/common/BC_CommonBitSource.h @@ -11,12 +11,12 @@ class CBC_CommonBitSource public: CBC_CommonBitSource(CFX_ByteArray *bytes); virtual ~CBC_CommonBitSource(); - FX_INT32 ReadBits(FX_INT32 numBits, FX_INT32 &e); - FX_INT32 Available(); - FX_INT32 getByteOffset(); + int32_t ReadBits(int32_t numBits, int32_t &e); + int32_t Available(); + int32_t getByteOffset(); private: CFX_ByteArray m_bytes; - FX_INT32 m_byteOffset; - FX_INT32 m_bitOffset; + int32_t m_byteOffset; + int32_t m_bitOffset; }; #endif diff --git a/xfa/src/fxbarcode/common/BC_CommonByteArray.cpp b/xfa/src/fxbarcode/common/BC_CommonByteArray.cpp index 99e97d38d8..4b9667e406 100644 --- a/xfa/src/fxbarcode/common/BC_CommonByteArray.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonByteArray.cpp @@ -28,17 +28,17 @@ CBC_CommonByteArray::CBC_CommonByteArray() m_size = 0; m_index = 0; } -CBC_CommonByteArray::CBC_CommonByteArray(FX_INT32 size) +CBC_CommonByteArray::CBC_CommonByteArray(int32_t size) { m_size = size; - m_bytes = FX_Alloc(FX_BYTE, size); + m_bytes = FX_Alloc(uint8_t, size); FXSYS_memset32(m_bytes, 0, size); m_index = 0; } -CBC_CommonByteArray::CBC_CommonByteArray(FX_BYTE* byteArray, FX_INT32 size) +CBC_CommonByteArray::CBC_CommonByteArray(uint8_t* byteArray, int32_t size) { m_size = size; - m_bytes = FX_Alloc(FX_BYTE, size); + m_bytes = FX_Alloc(uint8_t, size); FXSYS_memcpy32(m_bytes, byteArray, size); m_index = size; } @@ -51,15 +51,15 @@ CBC_CommonByteArray::~CBC_CommonByteArray() m_index = 0; m_size = 0; } -FX_INT32 CBC_CommonByteArray::At(FX_INT32 index) +int32_t CBC_CommonByteArray::At(int32_t index) { return m_bytes[index] & 0xff; } -void CBC_CommonByteArray::Set(FX_INT32 index, FX_INT32 value) +void CBC_CommonByteArray::Set(int32_t index, int32_t value) { - m_bytes[index] = (FX_BYTE) value; + m_bytes[index] = (uint8_t) value; } -FX_INT32 CBC_CommonByteArray::Size() +int32_t CBC_CommonByteArray::Size() { return m_size; } @@ -67,19 +67,19 @@ FX_BOOL CBC_CommonByteArray::IsEmpty() { return m_size == 0; } -void CBC_CommonByteArray::AppendByte(FX_INT32 value) +void CBC_CommonByteArray::AppendByte(int32_t value) { if (m_size == 0 || m_index >= m_size) { - FX_INT32 newSize = FX_MAX(32, m_size << 1); + int32_t newSize = FX_MAX(32, m_size << 1); Reserve(newSize); } - m_bytes[m_index] = (FX_BYTE)value; + m_bytes[m_index] = (uint8_t)value; m_index++; } -void CBC_CommonByteArray::Reserve(FX_INT32 capacity) +void CBC_CommonByteArray::Reserve(int32_t capacity) { if (m_bytes == NULL || m_size < capacity) { - FX_BYTE *newArray = FX_Alloc(FX_BYTE, capacity); + uint8_t *newArray = FX_Alloc(uint8_t, capacity); FXSYS_memset32(newArray, 0, capacity); if (m_bytes != NULL) { FXSYS_memcpy32(newArray, m_bytes, m_size); @@ -89,24 +89,24 @@ void CBC_CommonByteArray::Reserve(FX_INT32 capacity) m_size = capacity; } } -void CBC_CommonByteArray::Set(FX_BYTE* source, FX_INT32 offset, FX_INT32 count) +void CBC_CommonByteArray::Set(uint8_t* source, int32_t offset, int32_t count) { if (m_bytes != NULL) { FX_Free( m_bytes ); } - m_bytes = FX_Alloc(FX_BYTE, count); + m_bytes = FX_Alloc(uint8_t, count); m_size = count; FXSYS_memcpy32(m_bytes, source + offset, count); m_index = count; } -void CBC_CommonByteArray::Set(CFX_ByteArray* source, FX_INT32 offset, FX_INT32 count) +void CBC_CommonByteArray::Set(CFX_ByteArray* source, int32_t offset, int32_t count) { if (m_bytes != NULL) { FX_Free( m_bytes ); } - m_bytes = FX_Alloc(FX_BYTE, count); + m_bytes = FX_Alloc(uint8_t, count); m_size = count; - FX_INT32 i; + int32_t i; for(i = 0; i < count; i++) { m_bytes[i] = source->operator [](i + offset); } diff --git a/xfa/src/fxbarcode/common/BC_CommonByteArray.h b/xfa/src/fxbarcode/common/BC_CommonByteArray.h index b9baf8a964..234b25db69 100644 --- a/xfa/src/fxbarcode/common/BC_CommonByteArray.h +++ b/xfa/src/fxbarcode/common/BC_CommonByteArray.h @@ -9,21 +9,21 @@ class CBC_CommonByteArray { private: - FX_INT32 m_size; - FX_INT32 m_index; - FX_BYTE* m_bytes; + int32_t m_size; + int32_t m_index; + uint8_t* m_bytes; public: CBC_CommonByteArray(); - CBC_CommonByteArray(FX_INT32 size); - CBC_CommonByteArray(FX_BYTE* byteArray, FX_INT32 size); + CBC_CommonByteArray(int32_t size); + CBC_CommonByteArray(uint8_t* byteArray, int32_t size); virtual ~CBC_CommonByteArray(); - FX_INT32 At(FX_INT32 index); - void Set(FX_INT32 index, FX_INT32 value); - FX_INT32 Size(); + int32_t At(int32_t index); + void Set(int32_t index, int32_t value); + int32_t Size(); FX_BOOL IsEmpty(); - void AppendByte(FX_INT32 value); - void Reserve(FX_INT32 capacity); - void Set(FX_BYTE* source, FX_INT32 offset, FX_INT32 count); - void Set(CFX_ByteArray* source, FX_INT32 offset, FX_INT32 count); + void AppendByte(int32_t value); + void Reserve(int32_t capacity); + void Set(uint8_t* source, int32_t offset, int32_t count); + void Set(CFX_ByteArray* source, int32_t offset, int32_t count); }; #endif diff --git a/xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp b/xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp index 27c8615bf9..da4741d11a 100644 --- a/xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp @@ -22,7 +22,7 @@ #include "../barcode.h" #include "BC_CommonByteMatrix.h" -CBC_CommonByteMatrix::CBC_CommonByteMatrix(FX_INT32 width, FX_INT32 height) +CBC_CommonByteMatrix::CBC_CommonByteMatrix(int32_t width, int32_t height) { m_height = height; m_width = width; @@ -30,7 +30,7 @@ CBC_CommonByteMatrix::CBC_CommonByteMatrix(FX_INT32 width, FX_INT32 height) } void CBC_CommonByteMatrix::Init() { - m_bytes = FX_Alloc(FX_BYTE, m_height * m_width); + m_bytes = FX_Alloc(uint8_t, m_height * m_width); FXSYS_memset8(m_bytes, 0xff, m_height * m_width); } CBC_CommonByteMatrix::~CBC_CommonByteMatrix() @@ -40,37 +40,37 @@ CBC_CommonByteMatrix::~CBC_CommonByteMatrix() m_bytes = NULL; } } -FX_INT32 CBC_CommonByteMatrix::GetHeight() +int32_t CBC_CommonByteMatrix::GetHeight() { return m_height; } -FX_INT32 CBC_CommonByteMatrix::GetWidth() +int32_t CBC_CommonByteMatrix::GetWidth() { return m_width; } -FX_BYTE CBC_CommonByteMatrix::Get(FX_INT32 x, FX_INT32 y) +uint8_t CBC_CommonByteMatrix::Get(int32_t x, int32_t y) { return m_bytes[y * m_width + x]; } -void CBC_CommonByteMatrix::Set(FX_INT32 x, FX_INT32 y, FX_INT32 value) +void CBC_CommonByteMatrix::Set(int32_t x, int32_t y, int32_t value) { - m_bytes[y * m_width + x] = (FX_BYTE)value; + m_bytes[y * m_width + x] = (uint8_t)value; } -void CBC_CommonByteMatrix::Set(FX_INT32 x, FX_INT32 y, FX_BYTE value) +void CBC_CommonByteMatrix::Set(int32_t x, int32_t y, uint8_t value) { m_bytes[y * m_width + x] = value; } -void CBC_CommonByteMatrix::clear(FX_BYTE value) +void CBC_CommonByteMatrix::clear(uint8_t value) { - FX_INT32 y; + int32_t y; for(y = 0; y < m_height; y++) { - FX_INT32 x; + int32_t x; for(x = 0; x < m_width; x++) { m_bytes[y * m_width + x] = value; } } } -FX_BYTE* CBC_CommonByteMatrix::GetArray() +uint8_t* CBC_CommonByteMatrix::GetArray() { return m_bytes; } diff --git a/xfa/src/fxbarcode/common/BC_CommonByteMatrix.h b/xfa/src/fxbarcode/common/BC_CommonByteMatrix.h index 55277660f3..f19e0038b6 100644 --- a/xfa/src/fxbarcode/common/BC_CommonByteMatrix.h +++ b/xfa/src/fxbarcode/common/BC_CommonByteMatrix.h @@ -9,20 +9,20 @@ class CBC_CommonByteMatrix { public: - CBC_CommonByteMatrix(FX_INT32 width, FX_INT32 height); + CBC_CommonByteMatrix(int32_t width, int32_t height); virtual ~CBC_CommonByteMatrix(); - FX_INT32 GetHeight(); - FX_INT32 GetWidth(); - FX_BYTE Get(FX_INT32 x, FX_INT32 y); - FX_BYTE* GetArray(); + int32_t GetHeight(); + int32_t GetWidth(); + uint8_t Get(int32_t x, int32_t y); + uint8_t* GetArray(); - void Set(FX_INT32 x, FX_INT32 y, FX_INT32 value); - void Set(FX_INT32 x, FX_INT32 y, FX_BYTE value); - void clear(FX_BYTE value); + void Set(int32_t x, int32_t y, int32_t value); + void Set(int32_t x, int32_t y, uint8_t value); + void clear(uint8_t value); virtual void Init(); private: - FX_BYTE *m_bytes; - FX_INT32 m_width; - FX_INT32 m_height; + uint8_t *m_bytes; + int32_t m_width; + int32_t m_height; }; #endif diff --git a/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp b/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp index 2909704796..36f8e10af1 100644 --- a/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp @@ -26,7 +26,7 @@ void CBC_CommonCharacterSetECI::initialize() { } -CBC_CommonCharacterSetECI::CBC_CommonCharacterSetECI(FX_INT32 value, CFX_ByteString encodingName): +CBC_CommonCharacterSetECI::CBC_CommonCharacterSetECI(int32_t value, CFX_ByteString encodingName): CBC_CommonECI(value), m_encodingName(encodingName) { } @@ -37,10 +37,10 @@ CFX_ByteString CBC_CommonCharacterSetECI::GetEncodingName() { return m_encodingName; } -void CBC_CommonCharacterSetECI::AddCharacterSet(FX_INT32 value, CFX_ByteString encodingName) +void CBC_CommonCharacterSetECI::AddCharacterSet(int32_t value, CFX_ByteString encodingName) { } -CBC_CommonCharacterSetECI* CBC_CommonCharacterSetECI::GetCharacterSetECIByValue(FX_INT32 value) +CBC_CommonCharacterSetECI* CBC_CommonCharacterSetECI::GetCharacterSetECIByValue(int32_t value) { return NULL; } diff --git a/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h b/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h index 1e9f9a433f..1c324796c8 100644 --- a/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h +++ b/xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h @@ -11,12 +11,12 @@ class CBC_CommonCharacterSetECI; class CBC_CommonCharacterSetECI : public CBC_CommonECI { public: - CBC_CommonCharacterSetECI(FX_INT32 value, CFX_ByteString encodingName); + CBC_CommonCharacterSetECI(int32_t value, CFX_ByteString encodingName); virtual ~CBC_CommonCharacterSetECI(); CFX_ByteString GetEncodingName(); - static void AddCharacterSet(FX_INT32 value, CFX_ByteString encodingName); - FX_INT32 GetValue(); - static CBC_CommonCharacterSetECI* GetCharacterSetECIByValue(FX_INT32 value); + static void AddCharacterSet(int32_t value, CFX_ByteString encodingName); + int32_t GetValue(); + static CBC_CommonCharacterSetECI* GetCharacterSetECIByValue(int32_t value); static CBC_CommonCharacterSetECI* GetCharacterSetECIByName(const CFX_ByteString& name); private: CFX_ByteString m_encodingName; diff --git a/xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp b/xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp index d0c55734db..e17a58db43 100644 --- a/xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp @@ -27,7 +27,7 @@ CBC_CommonDecoderResult::CBC_CommonDecoderResult() { } -void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e) +void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t &e) { if(text.IsEmpty()) { e = BCExceptionIllegalArgument; @@ -39,7 +39,7 @@ void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_Byte m_ecLevel = ecLevel; m_other = NULL; } -void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, FX_INT32 &e) +void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, int32_t &e) { if(text.IsEmpty()) { e = BCExceptionIllegalArgument; diff --git a/xfa/src/fxbarcode/common/BC_CommonDecoderResult.h b/xfa/src/fxbarcode/common/BC_CommonDecoderResult.h index 5f41afc774..e85317934a 100644 --- a/xfa/src/fxbarcode/common/BC_CommonDecoderResult.h +++ b/xfa/src/fxbarcode/common/BC_CommonDecoderResult.h @@ -17,8 +17,8 @@ public: const CFX_ByteString& GetText(); const CFX_Int32Array& GetByteSegments(); CBC_QRCoderErrorCorrectionLevel* GetECLevel(); - virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e); - virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, FX_INT32 &e); + virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t &e); + virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, int32_t &e); void setOther(CBC_PDF417ResultMetadata* other); private: CFX_ByteArray m_rawBytes; diff --git a/xfa/src/fxbarcode/common/BC_CommonECI.cpp b/xfa/src/fxbarcode/common/BC_CommonECI.cpp index 5aa64095f7..98e88b5dab 100644 --- a/xfa/src/fxbarcode/common/BC_CommonECI.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonECI.cpp @@ -23,18 +23,18 @@ #include "../barcode.h" #include "BC_CommonECI.h" #include "BC_CommonCharacterSetECI.h" -CBC_CommonECI::CBC_CommonECI(FX_INT32 value) +CBC_CommonECI::CBC_CommonECI(int32_t value) { m_value = value; } CBC_CommonECI::~CBC_CommonECI() { } -FX_INT32 CBC_CommonECI::GetValue() +int32_t CBC_CommonECI::GetValue() { return m_value; } -CBC_CommonECI* CBC_CommonECI::GetEICByValue(FX_INT32 value, FX_INT32 &e) +CBC_CommonECI* CBC_CommonECI::GetEICByValue(int32_t value, int32_t &e) { if(value < 0 || value > 999999) { e = BCExceptionBadECI; diff --git a/xfa/src/fxbarcode/common/BC_CommonECI.h b/xfa/src/fxbarcode/common/BC_CommonECI.h index 7a4ae6b8a6..503f15fef7 100644 --- a/xfa/src/fxbarcode/common/BC_CommonECI.h +++ b/xfa/src/fxbarcode/common/BC_CommonECI.h @@ -9,12 +9,12 @@ class CBC_CommonECI { public: - CBC_CommonECI(FX_INT32 value); + CBC_CommonECI(int32_t value); virtual ~CBC_CommonECI(); - FX_INT32 GetValue(); - static CBC_CommonECI* GetEICByValue(FX_INT32 value, FX_INT32 &e); + int32_t GetValue(); + static CBC_CommonECI* GetEICByValue(int32_t value, int32_t &e); private: - FX_INT32 m_value; + int32_t m_value; }; #endif diff --git a/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp b/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp index cb59d99cdf..7fbcac5bb2 100644 --- a/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp @@ -48,7 +48,7 @@ CBC_CommonPerspectiveTransform *CBC_CommonPerspectiveTransform::QuadrilateralToQ } void CBC_CommonPerspectiveTransform::TransformPoints(CFX_FloatArray *points) { - FX_INT32 max = points->GetSize(); + int32_t max = points->GetSize(); FX_FLOAT a11 = m_a11; FX_FLOAT a12 = m_a12; FX_FLOAT a13 = m_a13; @@ -58,7 +58,7 @@ void CBC_CommonPerspectiveTransform::TransformPoints(CFX_FloatArray *points) FX_FLOAT a31 = m_a31; FX_FLOAT a32 = m_a32; FX_FLOAT a33 = m_a33; - FX_INT32 i; + int32_t i; for (i = 0; i < max; i += 2) { FX_FLOAT x = (*points)[i]; FX_FLOAT y = (*points)[i + 1]; diff --git a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp index 7ef1671d98..5976d450d9 100644 --- a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp +++ b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp @@ -26,19 +26,19 @@ #include "BC_CommonBitMatrix.h" #include "BC_CommonBitArray.h" #include "BC_GlobalHistogramBinarizer.h" -const FX_INT32 LUMINANCE_BITS = 5; -const FX_INT32 LUMINANCE_SHIFT = 8 - LUMINANCE_BITS; -const FX_INT32 LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS; +const int32_t LUMINANCE_BITS = 5; +const int32_t LUMINANCE_SHIFT = 8 - LUMINANCE_BITS; +const int32_t LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS; CBC_GlobalHistogramBinarizer::CBC_GlobalHistogramBinarizer(CBC_LuminanceSource *source): CBC_Binarizer(source) { } CBC_GlobalHistogramBinarizer::~CBC_GlobalHistogramBinarizer() { } -CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e) +CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(int32_t y, CBC_CommonBitArray *row, int32_t &e) { CBC_LuminanceSource *source = GetLuminanceSource(); - FX_INT32 width = source->GetWidth(); + int32_t width = source->GetWidth(); CBC_AutoPtr result(FX_NEW CBC_CommonBitArray(width)); InitArrays(width); CFX_ByteArray *localLuminances = source->GetRow(y, m_luminance, e); @@ -47,20 +47,20 @@ CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(FX_INT32 y, CBC_Co } CFX_Int32Array localBuckets; localBuckets.Copy(m_buckets); - FX_INT32 x; + int32_t x; for (x = 0; x < width; x++) { - FX_INT32 pixel = (*localLuminances)[x] & 0xff; + int32_t pixel = (*localLuminances)[x] & 0xff; localBuckets[pixel >> LUMINANCE_SHIFT]++; } - FX_INT32 blackPoint = EstimateBlackPoint(localBuckets, e); + int32_t blackPoint = EstimateBlackPoint(localBuckets, e); if (e != BCExceptionNO) { return result.release(); } - FX_INT32 left = (*localLuminances)[0] & 0xff; - FX_INT32 center = (*localLuminances)[1] & 0xff; + int32_t left = (*localLuminances)[0] & 0xff; + int32_t center = (*localLuminances)[1] & 0xff; for (x = 1; x < width - 1; x++) { - FX_INT32 right = (*localLuminances)[x + 1] & 0xff; - FX_INT32 luminance = ((center << 2) - left - right) >> 1; + int32_t right = (*localLuminances)[x + 1] & 0xff; + int32_t luminance = ((center << 2) - left - right) >> 1; if (luminance < blackPoint) { result->Set(x); } @@ -69,36 +69,36 @@ CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(FX_INT32 y, CBC_Co } return result.release(); } -CBC_CommonBitMatrix *CBC_GlobalHistogramBinarizer::GetBlackMatrix(FX_INT32 &e) +CBC_CommonBitMatrix *CBC_GlobalHistogramBinarizer::GetBlackMatrix(int32_t &e) { CBC_LuminanceSource *source = GetLuminanceSource(); - FX_INT32 width = source->GetWidth(); - FX_INT32 height = source->GetHeight(); + int32_t width = source->GetWidth(); + int32_t height = source->GetHeight(); CBC_CommonBitMatrix *BitMatrixTemp = FX_NEW CBC_CommonBitMatrix(); BitMatrixTemp->Init(width, height); CBC_AutoPtr matrix(BitMatrixTemp); InitArrays(width); CFX_Int32Array localBuckets; localBuckets.Copy(m_buckets); - FX_INT32 y; + int32_t y; for (y = 1; y < 5; y++) { - FX_INT32 row = height * y / 5; + int32_t row = height * y / 5; CFX_ByteArray *localLuminances = source->GetRow(row, m_luminance, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 right = (width << 2) / 5; - FX_INT32 x; + int32_t right = (width << 2) / 5; + int32_t x; for (x = width / 5; x < right; x++) { - FX_INT32 pixel = (*localLuminances)[x] & 0xff; + int32_t pixel = (*localLuminances)[x] & 0xff; localBuckets[pixel >> LUMINANCE_SHIFT]++; } } - FX_INT32 blackPoint = EstimateBlackPoint(localBuckets, e); + int32_t blackPoint = EstimateBlackPoint(localBuckets, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_AutoPtr localLuminances(source->GetMatrix()); for (y = 0; y < height; y++) { - FX_INT32 offset = y * width; - for (FX_INT32 x = 0; x < width; x++) { - FX_INT32 pixel = (*localLuminances)[offset + x] & 0xff; + int32_t offset = y * width; + for (int32_t x = 0; x < width; x++) { + int32_t pixel = (*localLuminances)[offset + x] & 0xff; if (pixel < blackPoint) { matrix->Set(x, y); } @@ -106,7 +106,7 @@ CBC_CommonBitMatrix *CBC_GlobalHistogramBinarizer::GetBlackMatrix(FX_INT32 &e) } return matrix.release(); } -void CBC_GlobalHistogramBinarizer::InitArrays(FX_INT32 luminanceSize) +void CBC_GlobalHistogramBinarizer::InitArrays(int32_t luminanceSize) { if(m_luminance.GetSize() < luminanceSize) { m_luminance.SetSize(luminanceSize); @@ -114,19 +114,19 @@ void CBC_GlobalHistogramBinarizer::InitArrays(FX_INT32 luminanceSize) if(m_buckets.GetSize() <= 0) { m_buckets.SetSize(LUMINANCE_BUCKETS); } else { - FX_INT32 x; + int32_t x; for(x = 0; x < LUMINANCE_BUCKETS; x++) { m_buckets[x] = 0; } } } -FX_INT32 CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &buckets, FX_INT32 &e) +int32_t CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &buckets, int32_t &e) { - FX_INT32 numBuckets = buckets.GetSize(); - FX_INT32 maxBucketCount = 0; - FX_INT32 firstPeak = 0; - FX_INT32 firstPeakSize = 0; - FX_INT32 x; + int32_t numBuckets = buckets.GetSize(); + int32_t maxBucketCount = 0; + int32_t firstPeak = 0; + int32_t firstPeakSize = 0; + int32_t x; for (x = 0; x < numBuckets; x++) { if (buckets[x] > firstPeakSize) { firstPeak = x; @@ -136,18 +136,18 @@ FX_INT32 CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &bucket maxBucketCount = buckets[x]; } } - FX_INT32 secondPeak = 0; - FX_INT32 secondPeakScore = 0; + int32_t secondPeak = 0; + int32_t secondPeakScore = 0; for (x = 0; x < numBuckets; x++) { - FX_INT32 distanceToBiggest = x - firstPeak; - FX_INT32 score = buckets[x] * distanceToBiggest * distanceToBiggest; + int32_t distanceToBiggest = x - firstPeak; + int32_t score = buckets[x] * distanceToBiggest * distanceToBiggest; if (score > secondPeakScore) { secondPeak = x; secondPeakScore = score; } } if (firstPeak > secondPeak) { - FX_INT32 temp = firstPeak; + int32_t temp = firstPeak; firstPeak = secondPeak; secondPeak = temp; } @@ -155,11 +155,11 @@ FX_INT32 CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &bucket e = BCExceptionRead; return 0; } - FX_INT32 bestValley = secondPeak - 1; - FX_INT32 bestValleyScore = -1; + int32_t bestValley = secondPeak - 1; + int32_t bestValleyScore = -1; for (x = secondPeak - 1; x > firstPeak; x--) { - FX_INT32 fromFirst = x - firstPeak; - FX_INT32 score = fromFirst * fromFirst * (secondPeak - x) * (maxBucketCount - buckets[x]); + int32_t fromFirst = x - firstPeak; + int32_t score = fromFirst * fromFirst * (secondPeak - x) * (maxBucketCount - buckets[x]); if (score > bestValleyScore) { bestValley = x; bestValleyScore = score; diff --git a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h index ef084c075e..6c6d8ba188 100644 --- a/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h +++ b/xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h @@ -17,10 +17,10 @@ public: CBC_GlobalHistogramBinarizer(CBC_LuminanceSource *source); virtual ~CBC_GlobalHistogramBinarizer(); - void InitArrays(FX_INT32 luminanceSize); - CBC_CommonBitMatrix *GetBlackMatrix(FX_INT32 &e); - CBC_CommonBitArray *GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e); - static FX_INT32 EstimateBlackPoint(CFX_Int32Array &buckets, FX_INT32 &e); + void InitArrays(int32_t luminanceSize); + CBC_CommonBitMatrix *GetBlackMatrix(int32_t &e); + CBC_CommonBitArray *GetBlackRow(int32_t y, CBC_CommonBitArray *row, int32_t &e); + static int32_t EstimateBlackPoint(CFX_Int32Array &buckets, int32_t &e); private: CFX_ByteArray m_luminance; CFX_Int32Array m_buckets; diff --git a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp index 8bc93136ca..3d350996dd 100644 --- a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp +++ b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp @@ -24,8 +24,8 @@ #include "BC_WhiteRectangleDetector.h" #include "BC_CommonBitMatrix.h" #include "../BC_ResultPoint.h" -const FX_INT32 CBC_WhiteRectangleDetector::INIT_SIZE = 30; -const FX_INT32 CBC_WhiteRectangleDetector::CORR = 1; +const int32_t CBC_WhiteRectangleDetector::INIT_SIZE = 30; +const int32_t CBC_WhiteRectangleDetector::CORR = 1; CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image) { m_image = image; @@ -36,19 +36,19 @@ CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *imag m_upInit = (m_height - INIT_SIZE) >> 1; m_downInit = (m_height + INIT_SIZE) >> 1; } -void CBC_WhiteRectangleDetector::Init(FX_INT32 &e) +void CBC_WhiteRectangleDetector::Init(int32_t &e) { if (m_upInit < 0 || m_leftInit < 0 || m_downInit >= m_height || m_rightInit >= m_width) { e = BCExceptionNotFound; BC_EXCEPTION_CHECK_ReturnVoid(e); } } -CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, FX_INT32 initSize, FX_INT32 x, FX_INT32 y) +CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, int32_t initSize, int32_t x, int32_t y) { m_image = image; m_height = image->GetHeight(); m_width = image->GetWidth(); - FX_INT32 halfsize = initSize >> 1; + int32_t halfsize = initSize >> 1; m_leftInit = x - halfsize; m_rightInit = x + halfsize; m_upInit = y - halfsize; @@ -57,12 +57,12 @@ CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *imag CBC_WhiteRectangleDetector::~CBC_WhiteRectangleDetector() { } -CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e) +CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(int32_t &e) { - FX_INT32 left = m_leftInit; - FX_INT32 right = m_rightInit; - FX_INT32 up = m_upInit; - FX_INT32 down = m_downInit; + int32_t left = m_leftInit; + int32_t right = m_rightInit; + int32_t up = m_upInit; + int32_t down = m_downInit; FX_BOOL sizeExceeded = FALSE; FX_BOOL aBlackPointFoundOnBorder = TRUE; FX_BOOL atLeastOneBlackPointFoundOnBorder = FALSE; @@ -121,9 +121,9 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e) } } if (!sizeExceeded && atLeastOneBlackPointFoundOnBorder) { - FX_INT32 maxSize = right - left; + int32_t maxSize = right - left; CBC_AutoPtr z(NULL); - for (FX_INT32 i = 1; i < maxSize; i++) { + for (int32_t i = 1; i < maxSize; i++) { z = CBC_AutoPtr(GetBlackPointOnSegment((FX_FLOAT)left, (FX_FLOAT)(down - i), (FX_FLOAT)(left + i), (FX_FLOAT)(down)) ); if (z.get() != NULL) { break; @@ -134,7 +134,7 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } CBC_AutoPtr t(NULL); - for (FX_INT32 j = 1; j < maxSize; j++) { + for (int32_t j = 1; j < maxSize; j++) { t = CBC_AutoPtr(GetBlackPointOnSegment((FX_FLOAT)left, (FX_FLOAT)(up + j), (FX_FLOAT)(left + j), (FX_FLOAT)up)); if (t.get() != NULL) { break; @@ -145,7 +145,7 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } CBC_AutoPtr x(NULL); - for (FX_INT32 k = 1; k < maxSize; k++) { + for (int32_t k = 1; k < maxSize; k++) { x = CBC_AutoPtr(GetBlackPointOnSegment((FX_FLOAT)right, (FX_FLOAT)(up + k), (FX_FLOAT)(right - k), (FX_FLOAT)up)); if (x.get() != NULL) { break; @@ -156,7 +156,7 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } CBC_AutoPtr y(NULL); - for (FX_INT32 m = 1; m < maxSize; m++) { + for (int32_t m = 1; m < maxSize; m++) { y = CBC_AutoPtr(GetBlackPointOnSegment((FX_FLOAT)right, (FX_FLOAT)(down - m), (FX_FLOAT)(right - m), (FX_FLOAT) down)); if (y.get() != NULL) { break; @@ -173,25 +173,25 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e) } return NULL; } -FX_INT32 CBC_WhiteRectangleDetector::Round(FX_FLOAT d) +int32_t CBC_WhiteRectangleDetector::Round(FX_FLOAT d) { - return (FX_INT32) (d + 0.5f); + return (int32_t) (d + 0.5f); } CBC_ResultPoint *CBC_WhiteRectangleDetector::GetBlackPointOnSegment(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY) { - FX_INT32 dist = DistanceL2(aX, aY, bX, bY); + int32_t dist = DistanceL2(aX, aY, bX, bY); float xStep = (bX - aX) / dist; float yStep = (bY - aY) / dist; - for (FX_INT32 i = 0; i < dist; i++) { - FX_INT32 x = Round(aX + i * xStep); - FX_INT32 y = Round(aY + i * yStep); + for (int32_t i = 0; i < dist; i++) { + int32_t x = Round(aX + i * xStep); + int32_t y = Round(aY + i * yStep); if (m_image->Get(x, y)) { return FX_NEW CBC_ResultPoint((FX_FLOAT)x, (FX_FLOAT) y); } } return NULL; } -FX_INT32 CBC_WhiteRectangleDetector::DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY) +int32_t CBC_WhiteRectangleDetector::DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY) { float xDiff = aX - bX; float yDiff = aY - bY; @@ -225,16 +225,16 @@ CFX_PtrArray *CBC_WhiteRectangleDetector::CenterEdges(CBC_ResultPoint *y, CBC_Re return result; } } -FX_BOOL CBC_WhiteRectangleDetector::ContainsBlackPoint(FX_INT32 a, FX_INT32 b, FX_INT32 fixed, FX_BOOL horizontal) +FX_BOOL CBC_WhiteRectangleDetector::ContainsBlackPoint(int32_t a, int32_t b, int32_t fixed, FX_BOOL horizontal) { if (horizontal) { - for (FX_INT32 x = a; x <= b; x++) { + for (int32_t x = a; x <= b; x++) { if (m_image->Get(x, fixed)) { return TRUE; } } } else { - for (FX_INT32 y = a; y <= b; y++) { + for (int32_t y = a; y <= b; y++) { if (m_image->Get(fixed, y)) { return TRUE; } diff --git a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h index 40146d39de..c7607f9e56 100644 --- a/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h +++ b/xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h @@ -12,26 +12,26 @@ class CBC_WhiteRectangleDetector { public: CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image); - CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, FX_INT32 initSize, FX_INT32 x, FX_INT32 y); + CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, int32_t initSize, int32_t x, int32_t y); virtual ~CBC_WhiteRectangleDetector(); - CFX_PtrArray *Detect(FX_INT32 &e); - virtual void Init(FX_INT32 &e); + CFX_PtrArray *Detect(int32_t &e); + virtual void Init(int32_t &e); private: - FX_INT32 Round(float d); + int32_t Round(float d); CBC_ResultPoint *GetBlackPointOnSegment(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY); - FX_INT32 DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY); + int32_t DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY); CFX_PtrArray *CenterEdges(CBC_ResultPoint *y, CBC_ResultPoint *z, CBC_ResultPoint *x, CBC_ResultPoint *t); - FX_BOOL ContainsBlackPoint(FX_INT32 a, FX_INT32 b, FX_INT32 fixed, FX_BOOL horizontal); - const static FX_INT32 INIT_SIZE; - const static FX_INT32 CORR; + FX_BOOL ContainsBlackPoint(int32_t a, int32_t b, int32_t fixed, FX_BOOL horizontal); + const static int32_t INIT_SIZE; + const static int32_t CORR; CBC_CommonBitMatrix *m_image; - FX_INT32 m_height; - FX_INT32 m_width; - FX_INT32 m_leftInit; - FX_INT32 m_rightInit; - FX_INT32 m_downInit; - FX_INT32 m_upInit; + int32_t m_height; + int32_t m_width; + int32_t m_leftInit; + int32_t m_rightInit; + int32_t m_downInit; + int32_t m_upInit; }; #endif diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp index 1fc8b6685a..1ece2add2c 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp @@ -32,11 +32,11 @@ void CBC_ReedSolomonEncoder::Init() { m_cachedGenerators.Add(FX_NEW CBC_ReedSolomonGF256Poly(m_field, 1)); } -CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(FX_INT32 degree, FX_INT32 &e) +CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(int32_t degree, int32_t &e) { if(degree >= m_cachedGenerators.GetSize()) { CBC_ReedSolomonGF256Poly* lastGenerator = (CBC_ReedSolomonGF256Poly*)(m_cachedGenerators[m_cachedGenerators.GetSize() - 1]); - for(FX_INT32 d = m_cachedGenerators.GetSize(); d <= degree; d++) { + for(int32_t d = m_cachedGenerators.GetSize(); d <= degree; d++) { CFX_Int32Array temp; temp.Add(1); temp.Add(m_field->Exp(d - 1)); @@ -51,13 +51,13 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(FX_INT32 degree } return (CBC_ReedSolomonGF256Poly*)(m_cachedGenerators[degree]); } -void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, FX_INT32 &e) +void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, int32_t ecBytes, int32_t &e) { if(ecBytes == 0) { e = BCExceptionNoCorrectionBytes; BC_EXCEPTION_CHECK_ReturnVoid(e); } - FX_INT32 dataBytes = toEncode->GetSize() - ecBytes; + int32_t dataBytes = toEncode->GetSize() - ecBytes; if(dataBytes <= 0) { e = BCExceptionNoDataBytesProvided; BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -66,7 +66,7 @@ void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, BC_EXCEPTION_CHECK_ReturnVoid(e); CFX_Int32Array infoCoefficients; infoCoefficients.SetSize(dataBytes); - for(FX_INT32 x = 0; x < dataBytes; x++) { + for(int32_t x = 0; x < dataBytes; x++) { infoCoefficients[x] = toEncode->operator [](x); } CBC_ReedSolomonGF256Poly info; @@ -80,21 +80,21 @@ void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, CBC_AutoPtr temp(pa); CBC_ReedSolomonGF256Poly* remainder = (CBC_ReedSolomonGF256Poly*)(temp->operator [](1)); CFX_Int32Array* coefficients = remainder->GetCoefficients(); - FX_INT32 numZeroCoefficients = ecBytes - coefficients->GetSize(); - for(FX_INT32 i = 0; i < numZeroCoefficients; i++) { + int32_t numZeroCoefficients = ecBytes - coefficients->GetSize(); + for(int32_t i = 0; i < numZeroCoefficients; i++) { (*toEncode)[dataBytes + i] = 0; } - for(FX_INT32 y = 0; y < coefficients->GetSize(); y++) { + for(int32_t y = 0; y < coefficients->GetSize(); y++) { (*toEncode)[dataBytes + numZeroCoefficients + y] = coefficients->operator [](y); } - for (FX_INT32 k = 0; k < temp->GetSize(); k++) { + for (int32_t k = 0; k < temp->GetSize(); k++) { delete (CBC_ReedSolomonGF256Poly*)(*temp)[k]; } } CBC_ReedSolomonEncoder::~CBC_ReedSolomonEncoder() { - for (FX_INT32 i = 0; i < m_cachedGenerators.GetSize(); i++) { + for (int32_t i = 0; i < m_cachedGenerators.GetSize(); i++) { delete (CBC_ReedSolomonGF256Poly*)m_cachedGenerators[i]; } } diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h index 713f343d98..bc35ebed1f 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h @@ -13,12 +13,12 @@ class CBC_ReedSolomonEncoder private: CBC_ReedSolomonGF256* m_field; CFX_PtrArray m_cachedGenerators; - CBC_ReedSolomonGF256Poly* BuildGenerator(FX_INT32 degree, FX_INT32 &e); + CBC_ReedSolomonGF256Poly* BuildGenerator(int32_t degree, int32_t &e); public: CBC_ReedSolomonEncoder(CBC_ReedSolomonGF256 * field); virtual ~CBC_ReedSolomonEncoder(); - void Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, FX_INT32 &e); + void Encode(CFX_Int32Array *toEncode, int32_t ecBytes, int32_t &e); virtual void Init(); }; #endif diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp index 3cb5e7762f..f0e87b8e40 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp @@ -31,7 +31,7 @@ CBC_ReedSolomonDecoder::CBC_ReedSolomonDecoder(CBC_ReedSolomonGF256* field) CBC_ReedSolomonDecoder::~CBC_ReedSolomonDecoder() { } -void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_INT32 &e) +void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, int32_t twoS, int32_t &e) { CBC_ReedSolomonGF256Poly poly; poly.Init(m_field, received, e); @@ -40,8 +40,8 @@ void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_ syndromeCoefficients.SetSize(twoS); FX_BOOL dataMatrix = FALSE; FX_BOOL noError = TRUE; - for (FX_INT32 i = 0; i < twoS; i++) { - FX_INT32 eval = poly.EvaluateAt(m_field->Exp(dataMatrix ? i + 1 : i)); + for (int32_t i = 0; i < twoS; i++) { + int32_t eval = poly.EvaluateAt(m_field->Exp(dataMatrix ? i + 1 : i)); syndromeCoefficients[twoS - 1 - i] = eval; if (eval != 0) { noError = FALSE; @@ -67,8 +67,8 @@ void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_ CFX_Int32Array* ia2 = FindErrorMagnitudes(omega.get(), errorLocations.get(), dataMatrix, e); BC_EXCEPTION_CHECK_ReturnVoid(e); CBC_AutoPtr errorMagnitudes(ia2); - for (FX_INT32 k = 0; k < errorLocations->GetSize(); k++) { - FX_INT32 position = received->GetSize() - 1 - m_field->Log((*errorLocations)[k], e); + for (int32_t k = 0; k < errorLocations->GetSize(); k++) { + int32_t position = received->GetSize() - 1 - m_field->Log((*errorLocations)[k], e); BC_EXCEPTION_CHECK_ReturnVoid(e); if(position < 0) { e = BCExceptionBadErrorLocation; @@ -77,7 +77,7 @@ void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_ (*received)[position] = CBC_ReedSolomonGF256::AddOrSubtract((*received)[position], (*errorMagnitudes)[k]); } } -CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, FX_INT32 R, FX_INT32 &e) +CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, int32_t R, int32_t &e) { if (a->GetDegree() < b->GetDegree()) { CBC_ReedSolomonGF256Poly* temp = a; @@ -120,12 +120,12 @@ CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256 CBC_ReedSolomonGF256Poly* rsg8 = m_field->GetZero()->Clone(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_AutoPtr q(rsg8); - FX_INT32 denominatorLeadingTerm = rLast->GetCoefficients(rLast->GetDegree()); - FX_INT32 dltInverse = m_field->Inverse(denominatorLeadingTerm, e); + int32_t denominatorLeadingTerm = rLast->GetCoefficients(rLast->GetDegree()); + int32_t dltInverse = m_field->Inverse(denominatorLeadingTerm, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); while (r->GetDegree() >= rLast->GetDegree() && !(r->IsZero())) { - FX_INT32 degreeDiff = r->GetDegree() - rLast->GetDegree(); - FX_INT32 scale = m_field->Multiply(r->GetCoefficients(r->GetDegree()), dltInverse); + int32_t degreeDiff = r->GetDegree() - rLast->GetDegree(); + int32_t scale = m_field->Multiply(r->GetCoefficients(r->GetDegree()), dltInverse); CBC_ReedSolomonGF256Poly* rsgp1 = m_field->BuildMonomial(degreeDiff, scale, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_AutoPtr build(rsgp1); @@ -156,12 +156,12 @@ CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256 CBC_AutoPtr temp6(rsg12); t = temp6; } - FX_INT32 sigmaTildeAtZero = t->GetCoefficients(0); + int32_t sigmaTildeAtZero = t->GetCoefficients(0); if (sigmaTildeAtZero == 0) { e = BCExceptionIsZero; BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } - FX_INT32 inverse = m_field->Inverse(sigmaTildeAtZero, e); + int32_t inverse = m_field->Inverse(sigmaTildeAtZero, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_ReedSolomonGF256Poly* rsg13 = t->Multiply(inverse, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); @@ -174,9 +174,9 @@ CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256 temp->Add(omega.release()); return temp; } -CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, FX_INT32 &e) +CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, int32_t &e) { - FX_INT32 numErrors = errorLocator->GetDegree(); + int32_t numErrors = errorLocator->GetDegree(); if (numErrors == 1) { CBC_AutoPtr temp(FX_NEW CFX_Int32Array); temp->Add(errorLocator->GetCoefficients(1)); @@ -185,8 +185,8 @@ CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256P CFX_Int32Array *tempT = FX_NEW CFX_Int32Array; tempT->SetSize(numErrors); CBC_AutoPtr result(tempT); - FX_INT32 ie = 0; - for (FX_INT32 i = 1; i < 256 && ie < numErrors; i++) { + int32_t ie = 0; + for (int32_t i = 1; i < 256 && ie < numErrors; i++) { if(errorLocator->EvaluateAt(i) == 0) { (*result)[ie] = m_field->Inverse(i, ie); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); @@ -199,23 +199,23 @@ CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256P } return result.release(); } -CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, FX_INT32 &e) +CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, int32_t &e) { - FX_INT32 s = errorLocations->GetSize(); + int32_t s = errorLocations->GetSize(); CFX_Int32Array * temp = FX_NEW CFX_Int32Array; temp->SetSize(s); CBC_AutoPtr result(temp); - for (FX_INT32 i = 0; i < s; i++) { - FX_INT32 xiInverse = m_field->Inverse(errorLocations->operator [](i), e); + for (int32_t i = 0; i < s; i++) { + int32_t xiInverse = m_field->Inverse(errorLocations->operator [](i), e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 denominator = 1; - for(FX_INT32 j = 0; j < s; j++) { + int32_t denominator = 1; + for(int32_t j = 0; j < s; j++) { if(i != j) { denominator = m_field->Multiply(denominator, CBC_ReedSolomonGF256::AddOrSubtract(1, m_field->Multiply(errorLocations->operator [](j), xiInverse))); } } - FX_INT32 temp = m_field->Inverse(denominator, temp); + int32_t temp = m_field->Inverse(denominator, temp); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); (*result)[i] = m_field->Multiply(errorEvaluator->EvaluateAt(xiInverse), temp); diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h index db026edd01..edefd4a29a 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h @@ -15,9 +15,9 @@ private: public: CBC_ReedSolomonDecoder(CBC_ReedSolomonGF256 * field); virtual ~CBC_ReedSolomonDecoder(); - void Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_INT32 &e); - CFX_PtrArray* RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, FX_INT32 R, FX_INT32 &e); - CFX_Int32Array* FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, FX_INT32 &e); - CFX_Int32Array* FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, FX_INT32 &e); + void Decode(CFX_Int32Array* received, int32_t twoS, int32_t &e); + CFX_PtrArray* RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, int32_t R, int32_t &e); + CFX_Int32Array* FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, int32_t &e); + CFX_Int32Array* FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp index bb045ac24c..426ac2fbd8 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp @@ -43,17 +43,17 @@ void CBC_ReedSolomonGF256::Finalize() } DataMatrixField = NULL; } -CBC_ReedSolomonGF256::CBC_ReedSolomonGF256(FX_INT32 primitive) +CBC_ReedSolomonGF256::CBC_ReedSolomonGF256(int32_t primitive) { - FX_INT32 x = 1; - for(FX_INT32 j = 0; j < 256; j++) { + int32_t x = 1; + for(int32_t j = 0; j < 256; j++) { m_expTable[j] = x; x <<= 1; if(x >= 0x100) { x ^= primitive; } } - for(FX_INT32 i = 0; i < 255; i++) { + for(int32_t i = 0; i < 255; i++) { m_logTable[m_expTable[i]] = i; } m_logTable[0] = 0; @@ -82,7 +82,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::GetOne() { return m_one; } -CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::BuildMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e) +CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::BuildMonomial(int32_t degree, int32_t coefficient, int32_t &e) { if(degree < 0) { e = BCExceptionDegreeIsNegative; @@ -101,15 +101,15 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256::BuildMonomial(FX_INT32 degree, F BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return temp; } -FX_INT32 CBC_ReedSolomonGF256::AddOrSubtract(FX_INT32 a, FX_INT32 b) +int32_t CBC_ReedSolomonGF256::AddOrSubtract(int32_t a, int32_t b) { return a ^ b; } -FX_INT32 CBC_ReedSolomonGF256::Exp(FX_INT32 a) +int32_t CBC_ReedSolomonGF256::Exp(int32_t a) { return m_expTable[a]; } -FX_INT32 CBC_ReedSolomonGF256::Log(FX_INT32 a, FX_INT32 &e) +int32_t CBC_ReedSolomonGF256::Log(int32_t a, int32_t &e) { if(a == 0) { e = BCExceptionAIsZero; @@ -117,7 +117,7 @@ FX_INT32 CBC_ReedSolomonGF256::Log(FX_INT32 a, FX_INT32 &e) } return m_logTable[a]; } -FX_INT32 CBC_ReedSolomonGF256::Inverse(FX_INT32 a, FX_INT32 &e) +int32_t CBC_ReedSolomonGF256::Inverse(int32_t a, int32_t &e) { if(a == 0) { e = BCExceptionAIsZero; @@ -125,7 +125,7 @@ FX_INT32 CBC_ReedSolomonGF256::Inverse(FX_INT32 a, FX_INT32 &e) } return m_expTable[255 - m_logTable[a]]; } -FX_INT32 CBC_ReedSolomonGF256::Multiply(FX_INT32 a, FX_INT32 b) +int32_t CBC_ReedSolomonGF256::Multiply(int32_t a, int32_t b) { if(a == 0 || b == 0) { return 0; diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h index 40e7ffef28..141c3dab36 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h @@ -14,20 +14,20 @@ public: static void Finalize(); static CBC_ReedSolomonGF256 *QRCodeFild; static CBC_ReedSolomonGF256 *DataMatrixField; - CBC_ReedSolomonGF256(FX_INT32 primitive); + CBC_ReedSolomonGF256(int32_t primitive); virtual ~CBC_ReedSolomonGF256(); CBC_ReedSolomonGF256Poly* GetZero(); CBC_ReedSolomonGF256Poly* GetOne(); - CBC_ReedSolomonGF256Poly* BuildMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e); - static FX_INT32 AddOrSubtract(FX_INT32 a, FX_INT32 b); - FX_INT32 Exp(FX_INT32 a); - FX_INT32 Log(FX_INT32 a, FX_INT32 &e); - FX_INT32 Inverse(FX_INT32 a, FX_INT32 &e); - FX_INT32 Multiply(FX_INT32 a, FX_INT32 b); + CBC_ReedSolomonGF256Poly* BuildMonomial(int32_t degree, int32_t coefficient, int32_t &e); + static int32_t AddOrSubtract(int32_t a, int32_t b); + int32_t Exp(int32_t a); + int32_t Log(int32_t a, int32_t &e); + int32_t Inverse(int32_t a, int32_t &e); + int32_t Multiply(int32_t a, int32_t b); virtual void Init(); private: - FX_INT32 m_expTable[256]; - FX_INT32 m_logTable[256]; + int32_t m_expTable[256]; + int32_t m_logTable[256]; CBC_ReedSolomonGF256Poly *m_zero; CBC_ReedSolomonGF256Poly *m_one; }; diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp index 6476e4cf80..d59f619e25 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp @@ -23,7 +23,7 @@ #include "../../barcode.h" #include "BC_ReedSolomonGF256.h" #include "BC_ReedSolomonGF256Poly.h" -CBC_ReedSolomonGF256Poly::CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, FX_INT32 coefficients) +CBC_ReedSolomonGF256Poly::CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, int32_t coefficients) { if(field == NULL) { return; @@ -35,16 +35,16 @@ CBC_ReedSolomonGF256Poly::CBC_ReedSolomonGF256Poly() { m_field = NULL; } -void CBC_ReedSolomonGF256Poly::Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, FX_INT32 &e) +void CBC_ReedSolomonGF256Poly::Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, int32_t &e) { if(coefficients == NULL || coefficients->GetSize() == 0) { e = BCExceptionCoefficientsSizeIsNull; BC_EXCEPTION_CHECK_ReturnVoid(e); } m_field = field; - FX_INT32 coefficientsLength = coefficients->GetSize(); + int32_t coefficientsLength = coefficients->GetSize(); if((coefficientsLength > 1 && (*coefficients)[0] == 0)) { - FX_INT32 firstNonZero = 1; + int32_t firstNonZero = 1; while((firstNonZero < coefficientsLength) && ((*coefficients)[firstNonZero] == 0)) { firstNonZero++; } @@ -52,7 +52,7 @@ void CBC_ReedSolomonGF256Poly::Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* m_coefficients.Copy( *(m_field->GetZero()->GetCoefficients())); } else { m_coefficients.SetSize(coefficientsLength - firstNonZero); - for(FX_INT32 i = firstNonZero, j = 0; i < coefficientsLength; i++, j++) { + for(int32_t i = firstNonZero, j = 0; i < coefficientsLength; i++, j++) { m_coefficients[j] = coefficients->operator [](i); } } @@ -64,7 +64,7 @@ CFX_Int32Array* CBC_ReedSolomonGF256Poly::GetCoefficients() { return &m_coefficients; } -FX_INT32 CBC_ReedSolomonGF256Poly::GetDegree() +int32_t CBC_ReedSolomonGF256Poly::GetDegree() { return m_coefficients.GetSize() - 1; } @@ -72,39 +72,39 @@ FX_BOOL CBC_ReedSolomonGF256Poly::IsZero() { return m_coefficients[0] == 0; } -FX_INT32 CBC_ReedSolomonGF256Poly::GetCoefficients(FX_INT32 degree) +int32_t CBC_ReedSolomonGF256Poly::GetCoefficients(int32_t degree) { return m_coefficients[m_coefficients.GetSize() - 1 - degree]; } -FX_INT32 CBC_ReedSolomonGF256Poly::EvaluateAt(FX_INT32 a) +int32_t CBC_ReedSolomonGF256Poly::EvaluateAt(int32_t a) { if(a == 0) { return GetCoefficients(0); } - FX_INT32 size = m_coefficients.GetSize(); + int32_t size = m_coefficients.GetSize(); if(a == 1) { - FX_INT32 result = 0; - for(FX_INT32 i = 0; i < size; i++) { + int32_t result = 0; + for(int32_t i = 0; i < size; i++) { result = CBC_ReedSolomonGF256::AddOrSubtract(result, m_coefficients[i]); } return result; } - FX_INT32 result = m_coefficients[0]; - for(FX_INT32 j = 1; j < size; j++) { + int32_t result = m_coefficients[0]; + for(int32_t j = 1; j < size; j++) { result = CBC_ReedSolomonGF256::AddOrSubtract( m_field->Multiply(a, result), m_coefficients[j]); } return result; } -CBC_ReedSolomonGF256Poly *CBC_ReedSolomonGF256Poly::Clone(FX_INT32 &e) +CBC_ReedSolomonGF256Poly *CBC_ReedSolomonGF256Poly::Clone(int32_t &e) { CBC_ReedSolomonGF256Poly *temp = FX_NEW CBC_ReedSolomonGF256Poly(); temp->Init(m_field, &m_coefficients, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return temp; } -CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e) +CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(CBC_ReedSolomonGF256Poly* other, int32_t &e) { if(IsZero()) { return other->Clone(e); @@ -126,11 +126,11 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(CBC_ReedSolomo } CFX_Int32Array sumDiff; sumDiff.SetSize(largerCoefficients.GetSize() ); - FX_INT32 lengthDiff = largerCoefficients.GetSize() - smallerCoefficients.GetSize(); - for(FX_INT32 i = 0; i < lengthDiff; i++) { + int32_t lengthDiff = largerCoefficients.GetSize() - smallerCoefficients.GetSize(); + for(int32_t i = 0; i < lengthDiff; i++) { sumDiff[i] = largerCoefficients[i]; } - for(FX_INT32 j = lengthDiff; j < largerCoefficients.GetSize(); j++) { + for(int32_t j = lengthDiff; j < largerCoefficients.GetSize(); j++) { sumDiff[j] = (CBC_ReedSolomonGF256::AddOrSubtract(smallerCoefficients[j - lengthDiff], largerCoefficients[j])); } @@ -139,7 +139,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::AddOrSubtract(CBC_ReedSolomo BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return temp; } -CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e) +CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(CBC_ReedSolomonGF256Poly* other, int32_t &e) { if(IsZero() || other->IsZero()) { CBC_ReedSolomonGF256Poly *temp = m_field->GetZero()->Clone(e); @@ -148,15 +148,15 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(CBC_ReedSolomonGF25 } CFX_Int32Array aCoefficients ; aCoefficients.Copy(m_coefficients); - FX_INT32 aLength = m_coefficients.GetSize(); + int32_t aLength = m_coefficients.GetSize(); CFX_Int32Array bCoefficients; bCoefficients.Copy(*(other->GetCoefficients())); - FX_INT32 bLength = other->GetCoefficients()->GetSize(); + int32_t bLength = other->GetCoefficients()->GetSize(); CFX_Int32Array product; product.SetSize(aLength + bLength - 1); - for(FX_INT32 i = 0; i < aLength; i++) { - FX_INT32 aCoeff = m_coefficients[i]; - for(FX_INT32 j = 0; j < bLength; j++) { + for(int32_t i = 0; i < aLength; i++) { + int32_t aCoeff = m_coefficients[i]; + for(int32_t j = 0; j < bLength; j++) { product[i + j] = CBC_ReedSolomonGF256::AddOrSubtract( product[i + j], m_field->Multiply(aCoeff, other->GetCoefficients()->operator [](j))); @@ -167,7 +167,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(CBC_ReedSolomonGF25 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return temp; } -CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(FX_INT32 scalar, FX_INT32 &e) +CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(int32_t scalar, int32_t &e) { if(scalar == 0) { CBC_ReedSolomonGF256Poly *temp = m_field->GetZero()->Clone(e); @@ -178,10 +178,10 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(FX_INT32 scalar, FX return this->Clone(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } - FX_INT32 size = m_coefficients.GetSize(); + int32_t size = m_coefficients.GetSize(); CFX_Int32Array product; product.SetSize(size); - for(FX_INT32 i = 0; i < size; i++) { + for(int32_t i = 0; i < size; i++) { product[i] = m_field->Multiply(m_coefficients[i], scalar); } CBC_ReedSolomonGF256Poly *temp = FX_NEW CBC_ReedSolomonGF256Poly(); @@ -189,7 +189,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::Multiply(FX_INT32 scalar, FX BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return temp; } -CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e) +CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(int32_t degree, int32_t coefficient, int32_t &e) { if(degree < 0) { e = BCExceptionDegreeIsNegative; @@ -200,10 +200,10 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(FX_INT32 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return temp; } - FX_INT32 size = m_coefficients.GetSize(); + int32_t size = m_coefficients.GetSize(); CFX_Int32Array product; product.SetSize(size + degree); - for(FX_INT32 i = 0; i < size; i++) { + for(int32_t i = 0; i < size; i++) { product[i] = (m_field->Multiply(m_coefficients[i], coefficient)); } CBC_ReedSolomonGF256Poly *temp = FX_NEW CBC_ReedSolomonGF256Poly(); @@ -211,7 +211,7 @@ CBC_ReedSolomonGF256Poly* CBC_ReedSolomonGF256Poly::MultiplyByMonomial(FX_INT32 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return temp; } -CFX_PtrArray* CBC_ReedSolomonGF256Poly::Divide(CBC_ReedSolomonGF256Poly *other, FX_INT32 &e) +CFX_PtrArray* CBC_ReedSolomonGF256Poly::Divide(CBC_ReedSolomonGF256Poly *other, int32_t &e) { if(other->IsZero()) { e = BCExceptionDivideByZero; @@ -223,13 +223,13 @@ CFX_PtrArray* CBC_ReedSolomonGF256Poly::Divide(CBC_ReedSolomonGF256Poly *other, CBC_ReedSolomonGF256Poly* rsg2 = this->Clone(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_AutoPtr remainder(rsg2); - FX_INT32 denominatorLeadingTerm = other->GetCoefficients(other->GetDegree()); - FX_INT32 inverseDenominatorLeadingTeam = m_field->Inverse(denominatorLeadingTerm, e); + int32_t denominatorLeadingTerm = other->GetCoefficients(other->GetDegree()); + int32_t inverseDenominatorLeadingTeam = m_field->Inverse(denominatorLeadingTerm, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); FX_BOOL bFirst = TRUE; while(remainder->GetDegree() >= other->GetDegree() && !remainder->IsZero()) { - FX_INT32 degreeDifference = remainder->GetDegree() - other->GetDegree(); - FX_INT32 scale = m_field->Multiply(remainder->GetCoefficients((remainder->GetDegree())), + int32_t degreeDifference = remainder->GetDegree() - other->GetDegree(); + int32_t scale = m_field->Multiply(remainder->GetCoefficients((remainder->GetDegree())), inverseDenominatorLeadingTeam); CBC_ReedSolomonGF256Poly* rsg3 = other->MultiplyByMonomial(degreeDifference, scale, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); diff --git a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h index 5c9ae6cce6..d7f1508b40 100644 --- a/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h +++ b/xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h @@ -10,21 +10,21 @@ class CBC_ReedSolomonGF256; class CBC_ReedSolomonGF256Poly { public: - CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, FX_INT32 coefficients); + CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, int32_t coefficients); CBC_ReedSolomonGF256Poly(); virtual ~CBC_ReedSolomonGF256Poly(); - FX_INT32 GetCoefficients(FX_INT32 degree); + int32_t GetCoefficients(int32_t degree); CFX_Int32Array* GetCoefficients(); - FX_INT32 GetDegree(); + int32_t GetDegree(); FX_BOOL IsZero(); - FX_INT32 EvaluateAt(FX_INT32 a); - CBC_ReedSolomonGF256Poly* AddOrSubtract(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e); - CBC_ReedSolomonGF256Poly* Multiply(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e); - CBC_ReedSolomonGF256Poly* Multiply(FX_INT32 scalar, FX_INT32 &e); - CBC_ReedSolomonGF256Poly* MultiplyByMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e); - CFX_PtrArray* Divide(CBC_ReedSolomonGF256Poly *other, FX_INT32 &e); - CBC_ReedSolomonGF256Poly* Clone(FX_INT32 &e); - virtual void Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, FX_INT32 &e); + int32_t EvaluateAt(int32_t a); + CBC_ReedSolomonGF256Poly* AddOrSubtract(CBC_ReedSolomonGF256Poly* other, int32_t &e); + CBC_ReedSolomonGF256Poly* Multiply(CBC_ReedSolomonGF256Poly* other, int32_t &e); + CBC_ReedSolomonGF256Poly* Multiply(int32_t scalar, int32_t &e); + CBC_ReedSolomonGF256Poly* MultiplyByMonomial(int32_t degree, int32_t coefficient, int32_t &e); + CFX_PtrArray* Divide(CBC_ReedSolomonGF256Poly *other, int32_t &e); + CBC_ReedSolomonGF256Poly* Clone(int32_t &e); + virtual void Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, int32_t &e); private: CBC_ReedSolomonGF256* m_field; CFX_Int32Array m_coefficients; diff --git a/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp index bc29b7d6ce..df58f15212 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp @@ -34,13 +34,13 @@ CBC_ASCIIEncoder::CBC_ASCIIEncoder() CBC_ASCIIEncoder::~CBC_ASCIIEncoder() { } -FX_INT32 CBC_ASCIIEncoder::getEncodingMode() +int32_t CBC_ASCIIEncoder::getEncodingMode() { return ASCII_ENCODATION; } -void CBC_ASCIIEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) +void CBC_ASCIIEncoder::Encode(CBC_EncoderContext &context, int32_t &e) { - FX_INT32 n = CBC_HighLevelEncoder::determineConsecutiveDigitCount(context.m_msg, context.m_pos); + int32_t n = CBC_HighLevelEncoder::determineConsecutiveDigitCount(context.m_msg, context.m_pos); if (n >= 2) { FX_WCHAR code = encodeASCIIDigits(context.m_msg.GetAt(context.m_pos), context.m_msg.GetAt(context.m_pos + 1), e); if (e != BCExceptionNO) { @@ -50,7 +50,7 @@ void CBC_ASCIIEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) context.m_pos += 2; } else { FX_WCHAR c = context.getCurrentChar(); - FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); + int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); if (newMode != getEncodingMode()) { switch (newMode) { case BASE256_ENCODATION: @@ -87,10 +87,10 @@ void CBC_ASCIIEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) } } } -FX_WCHAR CBC_ASCIIEncoder::encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, FX_INT32 &e) +FX_WCHAR CBC_ASCIIEncoder::encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, int32_t &e) { if (CBC_HighLevelEncoder::isDigit(digit1) && CBC_HighLevelEncoder::isDigit(digit2)) { - FX_INT32 num = (digit1 - 48) * 10 + (digit2 - 48); + int32_t num = (digit1 - 48) * 10 + (digit2 - 48); FX_WCHAR a = (FX_WCHAR) (num + 130); return (FX_WCHAR) (num + 130); } diff --git a/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h b/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h index 9a48b8762f..3c05a41d7b 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h @@ -14,9 +14,9 @@ class CBC_ASCIIEncoder : public CBC_Encoder public: CBC_ASCIIEncoder(); virtual ~CBC_ASCIIEncoder(); - FX_INT32 getEncodingMode(); - void Encode(CBC_EncoderContext &context, FX_INT32 &e); + int32_t getEncodingMode(); + void Encode(CBC_EncoderContext &context, int32_t &e); private: - static FX_WCHAR encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, FX_INT32 &e); + static FX_WCHAR encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp index d896cf6445..7a68fcaef6 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp @@ -34,11 +34,11 @@ CBC_Base256Encoder::CBC_Base256Encoder() CBC_Base256Encoder::~CBC_Base256Encoder() { } -FX_INT32 CBC_Base256Encoder::getEncodingMode() +int32_t CBC_Base256Encoder::getEncodingMode() { return BASE256_ENCODATION; } -void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) +void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, int32_t &e) { CFX_WideString buffer; buffer += (FX_WCHAR)'\0'; @@ -46,13 +46,13 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) FX_WCHAR c = context.getCurrentChar(); buffer += c; context.m_pos++; - FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); + int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); if (newMode != getEncodingMode()) { context.signalEncoderChange(newMode); break; } } - FX_INT32 dataCount = buffer.GetLength() - 1; + int32_t dataCount = buffer.GetLength() - 1; FX_CHAR buf[128]; #if defined(_FX_WINAPI_PARTITION_APP_) memset(buf, 0, sizeof(FX_CHAR) * 128); @@ -61,8 +61,8 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) FXSYS_itoa(dataCount, buf, 10); #endif buffer.SetAt(0, FX_WCHAR(*buf) - '0'); - FX_INT32 lengthFieldSize = 1; - FX_INT32 currentSize = context.getCodewordCount() + dataCount + lengthFieldSize; + int32_t lengthFieldSize = 1; + int32_t currentSize = context.getCodewordCount() + dataCount + lengthFieldSize; context.updateSymbolInfo(currentSize, e); if (e != BCExceptionNO) { return; @@ -79,14 +79,14 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) return; } } - for (FX_INT32 i = 0, c = buffer.GetLength(); i < c; i++) { + for (int32_t i = 0, c = buffer.GetLength(); i < c; i++) { context.writeCodeword(randomize255State(buffer.GetAt(i), context.getCodewordCount() + 1)); } } -FX_WCHAR CBC_Base256Encoder::randomize255State(FX_WCHAR ch, FX_INT32 codewordPosition) +FX_WCHAR CBC_Base256Encoder::randomize255State(FX_WCHAR ch, int32_t codewordPosition) { - FX_INT32 pseudoRandom = ((149 * codewordPosition) % 255) + 1; - FX_INT32 tempVariable = ch + pseudoRandom; + int32_t pseudoRandom = ((149 * codewordPosition) % 255) + 1; + int32_t tempVariable = ch + pseudoRandom; if (tempVariable <= 255) { return (FX_WCHAR) tempVariable; } else { diff --git a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h index 96110b1d08..61e6c8085f 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h @@ -13,9 +13,9 @@ class CBC_Base256Encoder : public CBC_Encoder public: CBC_Base256Encoder(); virtual ~CBC_Base256Encoder(); - FX_INT32 getEncodingMode(); - void Encode(CBC_EncoderContext &context, FX_INT32 &e); + int32_t getEncodingMode(); + void Encode(CBC_EncoderContext &context, int32_t &e); private: - static FX_WCHAR randomize255State(FX_WCHAR ch, FX_INT32 codewordPosition); + static FX_WCHAR randomize255State(FX_WCHAR ch, int32_t codewordPosition); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp index 4c3b458afa..0afd018558 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp @@ -35,27 +35,27 @@ CBC_C40Encoder::CBC_C40Encoder() CBC_C40Encoder::~CBC_C40Encoder() { } -FX_INT32 CBC_C40Encoder::getEncodingMode() +int32_t CBC_C40Encoder::getEncodingMode() { return C40_ENCODATION; } -void CBC_C40Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) +void CBC_C40Encoder::Encode(CBC_EncoderContext &context, int32_t &e) { CFX_WideString buffer; while (context.hasMoreCharacters()) { FX_WCHAR c = context.getCurrentChar(); context.m_pos++; - FX_INT32 lastCharSize = encodeChar(c, buffer, e); + int32_t lastCharSize = encodeChar(c, buffer, e); if (e != BCExceptionNO) { return; } - FX_INT32 unwritten = (buffer.GetLength() / 3) * 2; - FX_INT32 curCodewordCount = context.getCodewordCount() + unwritten; + int32_t unwritten = (buffer.GetLength() / 3) * 2; + int32_t curCodewordCount = context.getCodewordCount() + unwritten; context.updateSymbolInfo(curCodewordCount, e); if (e != BCExceptionNO) { return; } - FX_INT32 available = context.m_symbolInfo->m_dataCapacity - curCodewordCount; + int32_t available = context.m_symbolInfo->m_dataCapacity - curCodewordCount; if (!context.hasMoreCharacters()) { CFX_WideString removed; if ((buffer.GetLength() % 3) == 2) { @@ -75,9 +75,9 @@ void CBC_C40Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) } break; } - FX_INT32 count = buffer.GetLength(); + int32_t count = buffer.GetLength(); if ((count % 3) == 0) { - FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); + int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); if (newMode != getEncodingMode()) { context.signalEncoderChange(newMode); break; @@ -91,16 +91,16 @@ void CBC_C40Encoder::writeNextTriplet(CBC_EncoderContext &context, CFX_WideStrin context.writeCodewords(encodeToCodewords(buffer, 0)); buffer.Delete(0, 3); } -void CBC_C40Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e) +void CBC_C40Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, int32_t &e) { - FX_INT32 unwritten = (buffer.GetLength() / 3) * 2; - FX_INT32 rest = buffer.GetLength() % 3; - FX_INT32 curCodewordCount = context.getCodewordCount() + unwritten; + int32_t unwritten = (buffer.GetLength() / 3) * 2; + int32_t rest = buffer.GetLength() % 3; + int32_t curCodewordCount = context.getCodewordCount() + unwritten; context.updateSymbolInfo(curCodewordCount, e); if (e != BCExceptionNO) { return; } - FX_INT32 available = context.m_symbolInfo->m_dataCapacity - curCodewordCount; + int32_t available = context.m_symbolInfo->m_dataCapacity - curCodewordCount; if (rest == 2) { buffer += (FX_WCHAR)'\0'; while (buffer.GetLength() >= 3) { @@ -130,7 +130,7 @@ void CBC_C40Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buff } context.signalEncoderChange(ASCII_ENCODATION); } -FX_INT32 CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) +int32_t CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e) { if (c == ' ') { sb += (FX_WCHAR)'\3'; @@ -164,7 +164,7 @@ FX_INT32 CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) } else if (c >= 80) { sb += (FX_WCHAR)'\1'; sb += (FX_WCHAR)0x001e; - FX_INT32 len = 2; + int32_t len = 2; len += encodeChar((c - 128), sb, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); return len; @@ -173,9 +173,9 @@ FX_INT32 CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) return 0; } } -FX_INT32 CBC_C40Encoder::backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, FX_INT32 lastCharSize, FX_INT32 &e) +int32_t CBC_C40Encoder::backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, int32_t lastCharSize, int32_t &e) { - FX_INT32 count = buffer.GetLength(); + int32_t count = buffer.GetLength(); buffer.Delete(count - lastCharSize, count); context.m_pos--; FX_WCHAR c = context.getCurrentChar(); @@ -184,12 +184,12 @@ FX_INT32 CBC_C40Encoder::backtrackOneCharacter(CBC_EncoderContext &context, CFX_ context.resetSymbolInfo(); return lastCharSize; } -CFX_WideString CBC_C40Encoder::encodeToCodewords(CFX_WideString sb, FX_INT32 startPos) +CFX_WideString CBC_C40Encoder::encodeToCodewords(CFX_WideString sb, int32_t startPos) { FX_WCHAR c1 = sb.GetAt(startPos); FX_WCHAR c2 = sb.GetAt(startPos + 1); FX_WCHAR c3 = sb.GetAt(startPos + 2); - FX_INT32 v = (1600 * c1) + (40 * c2) + c3 + 1; + int32_t v = (1600 * c1) + (40 * c2) + c3 + 1; FX_WCHAR cw1 = (FX_WCHAR) (v / 256); FX_WCHAR cw2 = (FX_WCHAR) (v % 256); CFX_WideString b1(cw1); diff --git a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h index 7f2d2f7e79..2ab7f4e29b 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h @@ -12,13 +12,13 @@ class CBC_C40Encoder : public CBC_Encoder public: CBC_C40Encoder(); virtual ~CBC_C40Encoder(); - virtual FX_INT32 getEncodingMode(); - virtual void Encode(CBC_EncoderContext &context, FX_INT32 &e); + virtual int32_t getEncodingMode(); + virtual void Encode(CBC_EncoderContext &context, int32_t &e); static void writeNextTriplet(CBC_EncoderContext &context, CFX_WideString &buffer); - virtual void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e); - virtual FX_INT32 encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e); + virtual void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, int32_t &e); + virtual int32_t encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e); private: - FX_INT32 backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, FX_INT32 lastCharSize, FX_INT32 &e); - static CFX_WideString encodeToCodewords(CFX_WideString sb, FX_INT32 startPos); + int32_t backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, int32_t lastCharSize, int32_t &e); + static CFX_WideString encodeToCodewords(CFX_WideString sb, int32_t startPos); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp index cfb676b0a7..4fb82f1034 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp @@ -30,9 +30,9 @@ CBC_DataMatrixBitMatrixParser::CBC_DataMatrixBitMatrixParser() m_version = NULL; m_readMappingMatrix = NULL; } -void CBC_DataMatrixBitMatrixParser::Init(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e) +void CBC_DataMatrixBitMatrixParser::Init(CBC_CommonBitMatrix *bitMatrix, int32_t &e) { - FX_INT32 dimension = bitMatrix->GetHeight(); + int32_t dimension = bitMatrix->GetHeight(); if (dimension < 8 || dimension > 144 || (dimension & 0x01) != 0) { e = BCExceptionFormatException; return; @@ -59,45 +59,45 @@ CBC_DataMatrixVersion *CBC_DataMatrixBitMatrixParser::GetVersion() { return m_version; } -CBC_DataMatrixVersion *CBC_DataMatrixBitMatrixParser::ReadVersion(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e) +CBC_DataMatrixVersion *CBC_DataMatrixBitMatrixParser::ReadVersion(CBC_CommonBitMatrix *bitMatrix, int32_t &e) { - FX_INT32 rows = bitMatrix->GetHeight(); - FX_INT32 columns = bitMatrix->GetWidth(); + int32_t rows = bitMatrix->GetHeight(); + int32_t columns = bitMatrix->GetWidth(); CBC_DataMatrixVersion *temp = CBC_DataMatrixVersion::GetVersionForDimensions(rows, columns, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return temp; } -CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(FX_INT32 &e) +CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(int32_t &e) { CBC_AutoPtr result(FX_NEW CFX_ByteArray()); result->SetSize(m_version->GetTotalCodewords()); - FX_INT32 resultOffset = 0; - FX_INT32 row = 4; - FX_INT32 column = 0; - FX_INT32 numRows = m_mappingBitMatrix->GetHeight(); - FX_INT32 numColumns = m_mappingBitMatrix->GetWidth(); + int32_t resultOffset = 0; + int32_t row = 4; + int32_t column = 0; + int32_t numRows = m_mappingBitMatrix->GetHeight(); + int32_t numColumns = m_mappingBitMatrix->GetWidth(); FX_BOOL corner1Read = FALSE; FX_BOOL corner2Read = FALSE; FX_BOOL corner3Read = FALSE; FX_BOOL corner4Read = FALSE; do { if ((row == numRows) && (column == 0) && !corner1Read) { - (*result)[resultOffset++] = (FX_BYTE) ReadCorner1(numRows, numColumns); + (*result)[resultOffset++] = (uint8_t) ReadCorner1(numRows, numColumns); row -= 2; column += 2; corner1Read = TRUE; } else if ((row == numRows - 2) && (column == 0) && ((numColumns & 0x03) != 0) && !corner2Read) { - (*result)[resultOffset++] = (FX_BYTE) ReadCorner2(numRows, numColumns); + (*result)[resultOffset++] = (uint8_t) ReadCorner2(numRows, numColumns); row -= 2; column += 2; corner2Read = TRUE; } else if ((row == numRows + 4) && (column == 2) && ((numColumns & 0x07) == 0) && !corner3Read) { - (*result)[resultOffset++] = (FX_BYTE) ReadCorner3(numRows, numColumns); + (*result)[resultOffset++] = (uint8_t) ReadCorner3(numRows, numColumns); row -= 2; column += 2; corner3Read = TRUE; } else if ((row == numRows - 2) && (column == 0) && ((numColumns & 0x07) == 4) && !corner4Read) { - (*result)[resultOffset++] = (FX_BYTE) ReadCorner4(numRows, numColumns); + (*result)[resultOffset++] = (uint8_t) ReadCorner4(numRows, numColumns); row -= 2; column += 2; corner4Read = TRUE; @@ -105,7 +105,7 @@ CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(FX_INT32 &e) do { if ((row < numRows) && (column >= 0) && !m_readMappingMatrix->Get(column, row)) { if (resultOffset < (*result).GetSize() ) { - (*result)[resultOffset++] = (FX_BYTE) ReadUtah(row, column, numRows, numColumns); + (*result)[resultOffset++] = (uint8_t) ReadUtah(row, column, numRows, numColumns); } } row -= 2; @@ -116,7 +116,7 @@ CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(FX_INT32 &e) do { if ((row >= 0) && (column < numColumns) && !m_readMappingMatrix->Get(column, row)) { if (resultOffset < (*result).GetSize() ) { - (*result)[resultOffset++] = (FX_BYTE) ReadUtah(row, column, numRows, numColumns); + (*result)[resultOffset++] = (uint8_t) ReadUtah(row, column, numRows, numColumns); } } row += 2; @@ -132,7 +132,7 @@ CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(FX_INT32 &e) } return result.release(); } -FX_BOOL CBC_DataMatrixBitMatrixParser::ReadModule(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns) +FX_BOOL CBC_DataMatrixBitMatrixParser::ReadModule(int32_t row, int32_t column, int32_t numRows, int32_t numColumns) { if (row < 0) { row += numRows; @@ -145,9 +145,9 @@ FX_BOOL CBC_DataMatrixBitMatrixParser::ReadModule(FX_INT32 row, FX_INT32 column, m_readMappingMatrix->Set(column, row); return m_mappingBitMatrix->Get(column, row); } -FX_INT32 CBC_DataMatrixBitMatrixParser::ReadUtah(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns) +int32_t CBC_DataMatrixBitMatrixParser::ReadUtah(int32_t row, int32_t column, int32_t numRows, int32_t numColumns) { - FX_INT32 currentByte = 0; + int32_t currentByte = 0; if (ReadModule(row - 2, column - 2, numRows, numColumns)) { currentByte |= 1; } @@ -181,9 +181,9 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadUtah(FX_INT32 row, FX_INT32 column, } return currentByte; } -FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner1(FX_INT32 numRows, FX_INT32 numColumns) +int32_t CBC_DataMatrixBitMatrixParser::ReadCorner1(int32_t numRows, int32_t numColumns) { - FX_INT32 currentByte = 0; + int32_t currentByte = 0; if (ReadModule(numRows - 1, 0, numRows, numColumns)) { currentByte |= 1; } @@ -217,9 +217,9 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner1(FX_INT32 numRows, FX_INT32 n } return currentByte; } -FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner2(FX_INT32 numRows, FX_INT32 numColumns) +int32_t CBC_DataMatrixBitMatrixParser::ReadCorner2(int32_t numRows, int32_t numColumns) { - FX_INT32 currentByte = 0; + int32_t currentByte = 0; if (ReadModule(numRows - 3, 0, numRows, numColumns)) { currentByte |= 1; } @@ -253,9 +253,9 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner2(FX_INT32 numRows, FX_INT32 n } return currentByte; } -FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner3(FX_INT32 numRows, FX_INT32 numColumns) +int32_t CBC_DataMatrixBitMatrixParser::ReadCorner3(int32_t numRows, int32_t numColumns) { - FX_INT32 currentByte = 0; + int32_t currentByte = 0; if (ReadModule(numRows - 1, 0, numRows, numColumns)) { currentByte |= 1; } @@ -289,9 +289,9 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner3(FX_INT32 numRows, FX_INT32 n } return currentByte; } -FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner4(FX_INT32 numRows, FX_INT32 numColumns) +int32_t CBC_DataMatrixBitMatrixParser::ReadCorner4(int32_t numRows, int32_t numColumns) { - FX_INT32 currentByte = 0; + int32_t currentByte = 0; if (ReadModule(numRows - 3, 0, numRows, numColumns)) { currentByte |= 1; } @@ -325,37 +325,37 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner4(FX_INT32 numRows, FX_INT32 n } return currentByte; } -CBC_CommonBitMatrix *CBC_DataMatrixBitMatrixParser::ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix , FX_INT32 &e) +CBC_CommonBitMatrix *CBC_DataMatrixBitMatrixParser::ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix , int32_t &e) { - FX_INT32 symbolSizeRows = m_version->GetSymbolSizeRows(); - FX_INT32 symbolSizeColumns = m_version->GetSymbolSizeColumns(); + int32_t symbolSizeRows = m_version->GetSymbolSizeRows(); + int32_t symbolSizeColumns = m_version->GetSymbolSizeColumns(); if (bitMatrix->GetHeight() != symbolSizeRows) { e = BCExceptionCanNotCallGetDimensionOnNonSquareMatrix; return NULL; } - FX_INT32 dataRegionSizeRows = m_version->GetDataRegionSizeRows(); - FX_INT32 dataRegionSizeColumns = m_version->GetDataRegionSizeColumns(); - FX_INT32 numDataRegionsRow = symbolSizeRows / dataRegionSizeRows; - FX_INT32 numDataRegionsColumn = symbolSizeColumns / dataRegionSizeColumns; - FX_INT32 sizeDataRegionRow = numDataRegionsRow * dataRegionSizeRows; - FX_INT32 sizeDataRegionColumn = numDataRegionsColumn * dataRegionSizeColumns; + int32_t dataRegionSizeRows = m_version->GetDataRegionSizeRows(); + int32_t dataRegionSizeColumns = m_version->GetDataRegionSizeColumns(); + int32_t numDataRegionsRow = symbolSizeRows / dataRegionSizeRows; + int32_t numDataRegionsColumn = symbolSizeColumns / dataRegionSizeColumns; + int32_t sizeDataRegionRow = numDataRegionsRow * dataRegionSizeRows; + int32_t sizeDataRegionColumn = numDataRegionsColumn * dataRegionSizeColumns; CBC_CommonBitMatrix *bitMatrixWithoutAlignment = FX_NEW CBC_CommonBitMatrix(); bitMatrixWithoutAlignment->Init(sizeDataRegionColumn, sizeDataRegionRow); - FX_INT32 dataRegionRow; + int32_t dataRegionRow; for (dataRegionRow = 0; dataRegionRow < numDataRegionsRow; ++dataRegionRow) { - FX_INT32 dataRegionRowOffset = dataRegionRow * dataRegionSizeRows; - FX_INT32 dataRegionColumn; + int32_t dataRegionRowOffset = dataRegionRow * dataRegionSizeRows; + int32_t dataRegionColumn; for (dataRegionColumn = 0; dataRegionColumn < numDataRegionsColumn; ++dataRegionColumn) { - FX_INT32 dataRegionColumnOffset = dataRegionColumn * dataRegionSizeColumns; - FX_INT32 i; + int32_t dataRegionColumnOffset = dataRegionColumn * dataRegionSizeColumns; + int32_t i; for (i = 0; i < dataRegionSizeRows; ++i) { - FX_INT32 readRowOffset = dataRegionRow * (dataRegionSizeRows + 2) + 1 + i; - FX_INT32 writeRowOffset = dataRegionRowOffset + i; - FX_INT32 j; + int32_t readRowOffset = dataRegionRow * (dataRegionSizeRows + 2) + 1 + i; + int32_t writeRowOffset = dataRegionRowOffset + i; + int32_t j; for (j = 0; j < dataRegionSizeColumns; ++j) { - FX_INT32 readColumnOffset = dataRegionColumn * (dataRegionSizeColumns + 2) + 1 + j; + int32_t readColumnOffset = dataRegionColumn * (dataRegionSizeColumns + 2) + 1 + j; if (bitMatrix->Get(readColumnOffset, readRowOffset)) { - FX_INT32 writeColumnOffset = dataRegionColumnOffset + j; + int32_t writeColumnOffset = dataRegionColumnOffset + j; bitMatrixWithoutAlignment->Set(writeColumnOffset, writeRowOffset); } } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h index 812aa6424f..da9fdc7db5 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h @@ -14,17 +14,17 @@ public: CBC_DataMatrixBitMatrixParser(); virtual ~CBC_DataMatrixBitMatrixParser(); CBC_DataMatrixVersion *GetVersion(); - CFX_ByteArray *ReadCodewords(FX_INT32 &e); - FX_BOOL ReadModule(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns); - FX_INT32 ReadUtah(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns); - FX_INT32 ReadCorner1(FX_INT32 numRows, FX_INT32 numColumns); - FX_INT32 ReadCorner2(FX_INT32 numRows, FX_INT32 numColumns); - FX_INT32 ReadCorner3(FX_INT32 numRows, FX_INT32 numColumns); - FX_INT32 ReadCorner4(FX_INT32 numRows, FX_INT32 numColumns); - CBC_CommonBitMatrix *ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e); - virtual void Init(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e); + CFX_ByteArray *ReadCodewords(int32_t &e); + FX_BOOL ReadModule(int32_t row, int32_t column, int32_t numRows, int32_t numColumns); + int32_t ReadUtah(int32_t row, int32_t column, int32_t numRows, int32_t numColumns); + int32_t ReadCorner1(int32_t numRows, int32_t numColumns); + int32_t ReadCorner2(int32_t numRows, int32_t numColumns); + int32_t ReadCorner3(int32_t numRows, int32_t numColumns); + int32_t ReadCorner4(int32_t numRows, int32_t numColumns); + CBC_CommonBitMatrix *ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix, int32_t &e); + virtual void Init(CBC_CommonBitMatrix *bitMatrix, int32_t &e); private: - static CBC_DataMatrixVersion* ReadVersion(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e); + static CBC_DataMatrixVersion* ReadVersion(CBC_CommonBitMatrix *bitMatrix, int32_t &e); CBC_CommonBitMatrix *m_mappingBitMatrix; CBC_CommonBitMatrix *m_readMappingMatrix; CBC_DataMatrixVersion *m_version; diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp index c884834fa9..fcf2804ef2 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp @@ -26,40 +26,40 @@ CBC_DataMatrixDataBlock::~CBC_DataMatrixDataBlock() { } -CBC_DataMatrixDataBlock::CBC_DataMatrixDataBlock(FX_INT32 numDataCodewords, CFX_ByteArray *codewords) +CBC_DataMatrixDataBlock::CBC_DataMatrixDataBlock(int32_t numDataCodewords, CFX_ByteArray *codewords) { m_codewords.Copy(*codewords); m_numDataCodewords = numDataCodewords; } -CFX_PtrArray *CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, FX_INT32 &e) +CFX_PtrArray *CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, int32_t &e) { ECBlocks *ecBlocks = version->GetECBlocks(); - FX_INT32 totalBlocks = 0; + int32_t totalBlocks = 0; const CFX_PtrArray &ecBlockArray = ecBlocks->GetECBlocks(); - FX_INT32 i; + int32_t i; for (i = 0; i < ecBlockArray.GetSize(); i++) { totalBlocks += ((ECB*)ecBlockArray[i])->GetCount(); } CBC_AutoPtrresult(FX_NEW CFX_PtrArray()); result->SetSize(totalBlocks); - FX_INT32 numResultBlocks = 0; - FX_INT32 j; + int32_t numResultBlocks = 0; + int32_t j; for (j = 0; j < ecBlockArray.GetSize(); j++) { for (i = 0; i < ((ECB*)ecBlockArray[j])->GetCount(); i++) { - FX_INT32 numDataCodewords = ((ECB*)ecBlockArray[j])->GetDataCodewords(); - FX_INT32 numBlockCodewords = ecBlocks->GetECCodewords() + numDataCodewords; + int32_t numDataCodewords = ((ECB*)ecBlockArray[j])->GetDataCodewords(); + int32_t numBlockCodewords = ecBlocks->GetECCodewords() + numDataCodewords; CFX_ByteArray codewords; codewords.SetSize(numBlockCodewords); (*result)[numResultBlocks++] = FX_NEW CBC_DataMatrixDataBlock(numDataCodewords, &codewords); codewords.SetSize(0); } } - FX_INT32 longerBlocksTotalCodewords = ((CBC_DataMatrixDataBlock*)(*result)[0])->GetCodewords()->GetSize(); - FX_INT32 longerBlocksNumDataCodewords = longerBlocksTotalCodewords - ecBlocks->GetECCodewords(); - FX_INT32 shorterBlocksNumDataCodewords = longerBlocksNumDataCodewords - 1; - FX_INT32 rawCodewordsOffset = 0; + int32_t longerBlocksTotalCodewords = ((CBC_DataMatrixDataBlock*)(*result)[0])->GetCodewords()->GetSize(); + int32_t longerBlocksNumDataCodewords = longerBlocksTotalCodewords - ecBlocks->GetECCodewords(); + int32_t shorterBlocksNumDataCodewords = longerBlocksNumDataCodewords - 1; + int32_t rawCodewordsOffset = 0; for (i = 0; i < shorterBlocksNumDataCodewords; i++) { - FX_INT32 j; + int32_t j; for (j = 0; j < numResultBlocks; j++) { if (rawCodewordsOffset < rawCodewords->GetSize()) { ((CBC_DataMatrixDataBlock*)(*result)[j])->GetCodewords()->operator [](i) = (*rawCodewords)[rawCodewordsOffset++]; @@ -67,17 +67,17 @@ CFX_PtrArray *CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords } } FX_BOOL specialVersion = version->GetVersionNumber() == 24; - FX_INT32 numLongerBlocks = specialVersion ? 8 : numResultBlocks; + int32_t numLongerBlocks = specialVersion ? 8 : numResultBlocks; for (j = 0; j < numLongerBlocks; j++) { if (rawCodewordsOffset < rawCodewords->GetSize()) { ((CBC_DataMatrixDataBlock*)(*result)[j])->GetCodewords()->operator [](longerBlocksNumDataCodewords - 1) = (*rawCodewords)[rawCodewordsOffset++]; } } - FX_INT32 max = ((CBC_DataMatrixDataBlock*)(*result)[0])->GetCodewords()->GetSize(); + int32_t max = ((CBC_DataMatrixDataBlock*)(*result)[0])->GetCodewords()->GetSize(); for (i = longerBlocksNumDataCodewords; i < max; i++) { - FX_INT32 j; + int32_t j; for (j = 0; j < numResultBlocks; j++) { - FX_INT32 iOffset = specialVersion && j > 7 ? i - 1 : i; + int32_t iOffset = specialVersion && j > 7 ? i - 1 : i; if (rawCodewordsOffset < rawCodewords->GetSize()) { ((CBC_DataMatrixDataBlock*)(*result)[j])->GetCodewords()->operator [](iOffset) = (*rawCodewords)[rawCodewordsOffset++]; } @@ -89,7 +89,7 @@ CFX_PtrArray *CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords } return result.release(); } -FX_INT32 CBC_DataMatrixDataBlock::GetNumDataCodewords() +int32_t CBC_DataMatrixDataBlock::GetNumDataCodewords() { return m_numDataCodewords; } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h index d0f4af036e..21be66549c 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h @@ -12,14 +12,14 @@ class CBC_DataMatrixDataBlock public: virtual ~CBC_DataMatrixDataBlock(); - FX_INT32 GetNumDataCodewords(); + int32_t GetNumDataCodewords(); CFX_ByteArray* GetCodewords(); - static CFX_PtrArray *GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, FX_INT32 &e); + static CFX_PtrArray *GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, int32_t &e); private: - FX_INT32 m_numDataCodewords; + int32_t m_numDataCodewords; CFX_ByteArray m_codewords; - CBC_DataMatrixDataBlock(FX_INT32 numDataCodewords, CFX_ByteArray *codewords); + CBC_DataMatrixDataBlock(int32_t numDataCodewords, CFX_ByteArray *codewords); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp index e934d9313d..07393c0fec 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp @@ -42,26 +42,26 @@ const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::TEXT_SHIFT3_SET_CHARS[] = { '\'', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', (FX_CHAR) 127 }; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::PAD_ENCODE = 0; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::ASCII_ENCODE = 1; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::C40_ENCODE = 2; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::TEXT_ENCODE = 3; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::ANSIX12_ENCODE = 4; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::EDIFACT_ENCODE = 5; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::BASE256_ENCODE = 6; +const int32_t CBC_DataMatrixDecodedBitStreamParser::PAD_ENCODE = 0; +const int32_t CBC_DataMatrixDecodedBitStreamParser::ASCII_ENCODE = 1; +const int32_t CBC_DataMatrixDecodedBitStreamParser::C40_ENCODE = 2; +const int32_t CBC_DataMatrixDecodedBitStreamParser::TEXT_ENCODE = 3; +const int32_t CBC_DataMatrixDecodedBitStreamParser::ANSIX12_ENCODE = 4; +const int32_t CBC_DataMatrixDecodedBitStreamParser::EDIFACT_ENCODE = 5; +const int32_t CBC_DataMatrixDecodedBitStreamParser::BASE256_ENCODE = 6; CBC_DataMatrixDecodedBitStreamParser::CBC_DataMatrixDecodedBitStreamParser() { } CBC_DataMatrixDecodedBitStreamParser::~CBC_DataMatrixDecodedBitStreamParser() { } -CBC_CommonDecoderResult *CBC_DataMatrixDecodedBitStreamParser::Decode(CFX_ByteArray &bytes, FX_INT32 &e) +CBC_CommonDecoderResult *CBC_DataMatrixDecodedBitStreamParser::Decode(CFX_ByteArray &bytes, int32_t &e) { CBC_CommonBitSource bits(&bytes); CFX_ByteString result; CFX_ByteString resultTrailer; CFX_Int32Array byteSegments; - FX_INT32 mode = ASCII_ENCODE; + int32_t mode = ASCII_ENCODE; do { if (mode == 1) { mode = DecodeAsciiSegment(&bits, result, resultTrailer, e); @@ -104,12 +104,12 @@ CBC_CommonDecoderResult *CBC_DataMatrixDecodedBitStreamParser::Decode(CFX_ByteAr BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return tempCp; } -FX_INT32 CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, FX_INT32 &e) +int32_t CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, int32_t &e) { FX_CHAR buffer[128]; FX_BOOL upperShift = FALSE; do { - FX_INT32 oneByte = bits->ReadBits(8, e); + int32_t oneByte = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); if (oneByte == 0) { e = BCExceptionFormatException; @@ -122,7 +122,7 @@ FX_INT32 CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(CBC_CommonBitS } else if (oneByte == 129) { return PAD_ENCODE; } else if (oneByte <= 229) { - FX_INT32 value = oneByte - 130; + int32_t value = oneByte - 130; #if defined(_FX_WINAPI_PARTITION_APP_) memset(buffer, 0, sizeof(FX_CHAR) * 128); _itoa_s(value, buffer, 128, 10); @@ -174,7 +174,7 @@ FX_INT32 CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(CBC_CommonBitS } while (bits->Available() > 0); return ASCII_ENCODE; } -void CBC_DataMatrixDecodedBitStreamParser::DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e) +void CBC_DataMatrixDecodedBitStreamParser::DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e) { FX_BOOL upperShift = FALSE; CFX_Int32Array cValues; @@ -183,18 +183,18 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeC40Segment(CBC_CommonBitSource if (bits->Available() == 8) { return; } - FX_INT32 firstByte = bits->ReadBits(8, e); + int32_t firstByte = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if (firstByte == 254) { return; } - FX_INT32 tempp = bits->ReadBits(8, e); + int32_t tempp = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); ParseTwoBytes(firstByte, tempp, cValues); - FX_INT32 shift = 0; - FX_INT32 i; + int32_t shift = 0; + int32_t i; for (i = 0; i < 3; i++) { - FX_INT32 cValue = cValues[i]; + int32_t cValue = cValues[i]; switch (shift) { case 0: if (cValue < 3) { @@ -258,26 +258,26 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeC40Segment(CBC_CommonBitSource } } while (bits->Available() > 0); } -void CBC_DataMatrixDecodedBitStreamParser::DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e) +void CBC_DataMatrixDecodedBitStreamParser::DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e) { FX_BOOL upperShift = FALSE; CFX_Int32Array cValues; cValues.SetSize(3); - FX_INT32 shift = 0; + int32_t shift = 0; do { if (bits->Available() == 8) { return; } - FX_INT32 firstByte = bits->ReadBits(8, e); + int32_t firstByte = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if (firstByte == 254) { return; } - FX_INT32 inTp = bits->ReadBits(8, e); + int32_t inTp = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); ParseTwoBytes(firstByte, inTp, cValues); - for (FX_INT32 i = 0; i < 3; i++) { - FX_INT32 cValue = cValues[i]; + for (int32_t i = 0; i < 3; i++) { + int32_t cValue = cValues[i]; switch (shift) { case 0: if (cValue < 3) { @@ -347,7 +347,7 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeTextSegment(CBC_CommonBitSource } } while (bits->Available() > 0); } -void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e) +void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e) { CFX_Int32Array cValues; cValues.SetSize(3); @@ -355,17 +355,17 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment(CBC_CommonBitSou if (bits->Available() == 8) { return; } - FX_INT32 firstByte = bits->ReadBits(8, e); + int32_t firstByte = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if (firstByte == 254) { return; } - FX_INT32 iTemp1 = bits->ReadBits(8, e); + int32_t iTemp1 = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); ParseTwoBytes(firstByte, iTemp1, cValues); - FX_INT32 i; + int32_t i; for (i = 0; i < 3; i++) { - FX_INT32 cValue = cValues[i]; + int32_t cValue = cValues[i]; if (cValue == 0) { BC_FX_ByteString_Append(result, 1, '\r'); } else if (cValue == 1) { @@ -385,17 +385,17 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment(CBC_CommonBitSou } } while (bits->Available() > 0); } -void CBC_DataMatrixDecodedBitStreamParser::ParseTwoBytes(FX_INT32 firstByte, FX_INT32 secondByte, CFX_Int32Array &result) +void CBC_DataMatrixDecodedBitStreamParser::ParseTwoBytes(int32_t firstByte, int32_t secondByte, CFX_Int32Array &result) { - FX_INT32 fullBitValue = (firstByte << 8) + secondByte - 1; - FX_INT32 temp = fullBitValue / 1600; + int32_t fullBitValue = (firstByte << 8) + secondByte - 1; + int32_t temp = fullBitValue / 1600; result[0] = temp; fullBitValue -= temp * 1600; temp = fullBitValue / 40; result[1] = temp; result[2] = fullBitValue - temp * 40; } -void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e) +void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e) { FX_CHAR buffer[128]; FX_BOOL unlatch = FALSE; @@ -403,9 +403,9 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(CBC_CommonBitSou if (bits->Available() <= 16) { return; } - FX_INT32 i; + int32_t i; for (i = 0; i < 4; i++) { - FX_INT32 edifactValue = bits->ReadBits(6, e); + int32_t edifactValue = bits->ReadBits(6, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if (edifactValue == 0x1F) { unlatch = TRUE; @@ -425,19 +425,19 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(CBC_CommonBitSou } } while (!unlatch && bits->Available() > 0); } -void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, FX_INT32 &e) +void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, int32_t &e) { - FX_INT32 codewordPosition = 1 + bits->getByteOffset(); - FX_INT32 iTmp = bits->ReadBits(8, e); + int32_t codewordPosition = 1 + bits->getByteOffset(); + int32_t iTmp = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 d1 = Unrandomize255State(iTmp, codewordPosition++); - FX_INT32 count; + int32_t d1 = Unrandomize255State(iTmp, codewordPosition++); + int32_t count; if (d1 == 0) { count = bits->Available() / 8; } else if (d1 < 250) { count = d1; } else { - FX_INT32 iTmp3 = bits->ReadBits(8, e); + int32_t iTmp3 = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); count = 250 * (d1 - 249) + Unrandomize255State(iTmp3, codewordPosition++); } @@ -447,14 +447,14 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(CBC_CommonBitSou } CFX_ByteArray *bytes = FX_NEW CFX_ByteArray(); bytes->SetSize(count); - FX_INT32 i; + int32_t i; for (i = 0; i < count; i++) { if (bits->Available() < 8) { e = BCExceptionFormatException; delete bytes; return; } - FX_INT32 iTemp5 = bits->ReadBits(8, e); + int32_t iTemp5 = bits->ReadBits(8, e); if (e != BCExceptionNO) { delete bytes; return; @@ -464,9 +464,9 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(CBC_CommonBitSou BC_FX_ByteString_Append(result, *bytes); delete bytes; } -FX_BYTE CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State(FX_INT32 randomizedBase256Codeword, FX_INT32 base256CodewordPosition) +uint8_t CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State(int32_t randomizedBase256Codeword, int32_t base256CodewordPosition) { - FX_INT32 pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1; - FX_INT32 tempVariable = randomizedBase256Codeword - pseudoRandomNumber; - return (FX_BYTE) (tempVariable >= 0 ? tempVariable : tempVariable + 256); + int32_t pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1; + int32_t tempVariable = randomizedBase256Codeword - pseudoRandomNumber; + return (uint8_t) (tempVariable >= 0 ? tempVariable : tempVariable + 256); } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h index 45db800176..4fa5407fb5 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h @@ -13,17 +13,17 @@ class CBC_DataMatrixDecodedBitStreamParser public: CBC_DataMatrixDecodedBitStreamParser(); virtual ~CBC_DataMatrixDecodedBitStreamParser(); - static CBC_CommonDecoderResult *Decode(CFX_ByteArray &bytes, FX_INT32 &e); + static CBC_CommonDecoderResult *Decode(CFX_ByteArray &bytes, int32_t &e); private: - static FX_INT32 DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, FX_INT32 &e); - static void DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e); - static void DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e); - static void DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e); - static void ParseTwoBytes(FX_INT32 firstByte, FX_INT32 secondByte, CFX_Int32Array &result); - static void DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e); - static void DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, FX_INT32 &e); - static FX_BYTE Unrandomize255State(FX_INT32 randomizedBase256Codeword, FX_INT32 base256CodewordPosition); + static int32_t DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, int32_t &e); + static void DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e); + static void DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e); + static void DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e); + static void ParseTwoBytes(int32_t firstByte, int32_t secondByte, CFX_Int32Array &result); + static void DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e); + static void DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, int32_t &e); + static uint8_t Unrandomize255State(int32_t randomizedBase256Codeword, int32_t base256CodewordPosition); const static FX_CHAR C40_BASIC_SET_CHARS[]; const static FX_CHAR C40_SHIFT2_SET_CHARS[]; @@ -31,12 +31,12 @@ private: const static FX_CHAR TEXT_BASIC_SET_CHARS[]; const static FX_CHAR TEXT_SHIFT3_SET_CHARS[]; - const static FX_INT32 PAD_ENCODE; - const static FX_INT32 ASCII_ENCODE; - const static FX_INT32 C40_ENCODE; - const static FX_INT32 TEXT_ENCODE; - const static FX_INT32 ANSIX12_ENCODE; - const static FX_INT32 EDIFACT_ENCODE; - const static FX_INT32 BASE256_ENCODE; + const static int32_t PAD_ENCODE; + const static int32_t ASCII_ENCODE; + const static int32_t C40_ENCODE; + const static int32_t TEXT_ENCODE; + const static int32_t ANSIX12_ENCODE; + const static int32_t EDIFACT_ENCODE; + const static int32_t BASE256_ENCODE; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp index e9eb32cf84..8dfdea81c1 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp @@ -44,7 +44,7 @@ CBC_DataMatrixDecoder::~CBC_DataMatrixDecoder() } m_rsDecoder = NULL; } -CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits, FX_INT32 &e) +CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits, int32_t &e) { CBC_DataMatrixBitMatrixParser parser; parser.Init(bits, e); @@ -55,9 +55,9 @@ CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits CBC_AutoPtr codewords(byteTemp); CFX_PtrArray *dataBlocks = CBC_DataMatrixDataBlock::GetDataBlocks(codewords.get(), version, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 dataBlocksCount = dataBlocks->GetSize(); - FX_INT32 totalBytes = 0; - FX_INT32 i, j; + int32_t dataBlocksCount = dataBlocks->GetSize(); + int32_t totalBytes = 0; + int32_t i, j; for (i = 0; i < dataBlocksCount; i++) { totalBytes += ((CBC_DataMatrixDataBlock*)(*dataBlocks)[i])->GetNumDataCodewords(); } @@ -65,17 +65,17 @@ CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits resultBytes.SetSize(totalBytes); for (j = 0; j < dataBlocksCount; j++) { CFX_ByteArray *codewordBytes = ((CBC_DataMatrixDataBlock*)(*dataBlocks)[j])->GetCodewords(); - FX_INT32 numDataCodewords = ((CBC_DataMatrixDataBlock*)(*dataBlocks)[j])->GetNumDataCodewords(); + int32_t numDataCodewords = ((CBC_DataMatrixDataBlock*)(*dataBlocks)[j])->GetNumDataCodewords(); CorrectErrors(*codewordBytes, numDataCodewords, e); if (e != BCExceptionNO) { - for(FX_INT32 i = 0; i < dataBlocks->GetSize(); i++) { + for(int32_t i = 0; i < dataBlocks->GetSize(); i++) { delete (CBC_DataMatrixDataBlock*)(*dataBlocks)[i]; } delete dataBlocks; dataBlocks = NULL; return NULL; } - FX_INT32 i; + int32_t i; for (i = 0; i < numDataCodewords; i++) { resultBytes[i * dataBlocksCount + j] = (*codewordBytes)[i]; } @@ -89,22 +89,22 @@ CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return resultR; } -void CBC_DataMatrixDecoder::CorrectErrors(CFX_ByteArray &codewordBytes, FX_INT32 numDataCodewords, FX_INT32 &e) +void CBC_DataMatrixDecoder::CorrectErrors(CFX_ByteArray &codewordBytes, int32_t numDataCodewords, int32_t &e) { - FX_INT32 numCodewords = codewordBytes.GetSize(); + int32_t numCodewords = codewordBytes.GetSize(); CFX_Int32Array codewordsInts; codewordsInts.SetSize(numCodewords); - FX_INT32 i; + int32_t i; for (i = 0; i < numCodewords; i++) { codewordsInts[i] = codewordBytes[i] & 0xFF; } - FX_INT32 numECCodewords = codewordBytes.GetSize() - numDataCodewords; + int32_t numECCodewords = codewordBytes.GetSize() - numDataCodewords; m_rsDecoder->Decode(&codewordsInts, numECCodewords, e); if (e != BCExceptionNO) { e = BCExceptionChecksumException; return ; } for (i = 0; i < numDataCodewords; i++) { - codewordBytes[i] = (FX_BYTE) codewordsInts[i]; + codewordBytes[i] = (uint8_t) codewordsInts[i]; } } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h index 1d6059379b..d4d2cc7bb9 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h @@ -14,10 +14,10 @@ class CBC_DataMatrixDecoder public: CBC_DataMatrixDecoder(); virtual ~CBC_DataMatrixDecoder(); - CBC_CommonDecoderResult *Decode(CBC_CommonBitMatrix *bits, FX_INT32 &e); + CBC_CommonDecoderResult *Decode(CBC_CommonBitMatrix *bits, int32_t &e); virtual void Init(); private: - void CorrectErrors(CFX_ByteArray &codewordBytes, FX_INT32 numDataCodewords, FX_INT32 &e); + void CorrectErrors(CFX_ByteArray &codewordBytes, int32_t numDataCodewords, int32_t &e); CBC_ReedSolomonDecoder *m_rsDecoder; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp index 12877c5c3a..bdcbc4c418 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp @@ -28,12 +28,12 @@ #include "../qrcode/BC_QRDetectorResult.h" #include "../qrcode/BC_QRGridSampler.h" #include "BC_DataMatrixDetector.h" -const FX_INT32 CBC_DataMatrixDetector::INTEGERS[5] = {0, 1, 2, 3, 4}; +const int32_t CBC_DataMatrixDetector::INTEGERS[5] = {0, 1, 2, 3, 4}; CBC_DataMatrixDetector::CBC_DataMatrixDetector(CBC_CommonBitMatrix *image): m_image(image), m_rectangleDetector(NULL) { } -void CBC_DataMatrixDetector::Init(FX_INT32 &e) +void CBC_DataMatrixDetector::Init(int32_t &e) { m_rectangleDetector = FX_NEW CBC_WhiteRectangleDetector(m_image); m_rectangleDetector->Init(e); @@ -50,7 +50,7 @@ inline FX_BOOL ResultPointsAndTransitionsComparator(FX_LPVOID a, FX_LPVOID b) { return ((CBC_ResultPointsAndTransitions *)b)->GetTransitions() > ((CBC_ResultPointsAndTransitions *)a)->GetTransitions(); } -CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) +CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(int32_t &e) { CFX_PtrArray* cornerPoints = m_rectangleDetector->Detect(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); @@ -70,7 +70,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) delete ( (CBC_ResultPointsAndTransitions *)transitions[3] ); CBC_ResultPointsAndTransitions *lSideOne = (CBC_ResultPointsAndTransitions*)transitions[0]; CBC_ResultPointsAndTransitions *lSideTwo = (CBC_ResultPointsAndTransitions*)transitions[1]; - CFX_MapPtrTemplate pointCount; + CFX_MapPtrTemplate pointCount; Increment(pointCount, lSideOne->GetFrom()); Increment(pointCount, lSideOne->GetTo()); Increment(pointCount, lSideTwo->GetFrom()); @@ -84,7 +84,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) FX_POSITION itBegin = pointCount.GetStartPosition(); while(itBegin != NULL) { CBC_ResultPoint *key = 0; - FX_INT32 value = 0; + int32_t value = 0; pointCount.GetNextAssoc(itBegin, key, value); if(value == 2) { bottomLeft = key; @@ -114,7 +114,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) bottomLeft = (CBC_ResultPoint*)corners[1]; CBC_ResultPoint *topLeft = (CBC_ResultPoint*)corners[2]; CBC_ResultPoint *topRight = NULL; - FX_INT32 value; + int32_t value; if (!pointCount.Lookup(pointA, value)) { topRight = pointA; } else if (!pointCount.Lookup(pointB, value)) { @@ -124,8 +124,8 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) } else { topRight = pointD; } - FX_INT32 dimensionTop = CBC_AutoPtr(TransitionsBetween(topLeft, topRight))->GetTransitions(); - FX_INT32 dimensionRight = CBC_AutoPtr(TransitionsBetween(bottomRight, topRight))->GetTransitions(); + int32_t dimensionTop = CBC_AutoPtr(TransitionsBetween(topLeft, topRight))->GetTransitions(); + int32_t dimensionRight = CBC_AutoPtr(TransitionsBetween(bottomRight, topRight))->GetTransitions(); if ((dimensionTop & 0x01) == 1) { dimensionTop++; } @@ -158,7 +158,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) correctedTopRight.get(), dimensionTop, dimensionRight, e)); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } else { - FX_INT32 dimension = FX_MIN(dimensionRight, dimensionTop); + int32_t dimension = FX_MIN(dimensionRight, dimensionTop); correctedTopRight = CBC_AutoPtr(CorrectTopRight(bottomLeft, bottomRight, topLeft, topRight, dimension)); if (correctedTopRight.get() == NULL) { @@ -167,7 +167,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) delete topRight; topRight = NULL; } - FX_INT32 dimensionCorrected = FX_MAX(CBC_AutoPtr(TransitionsBetween(topLeft, correctedTopRight.get()))->GetTransitions(), + int32_t dimensionCorrected = FX_MAX(CBC_AutoPtr(TransitionsBetween(topLeft, correctedTopRight.get()))->GetTransitions(), CBC_AutoPtr(TransitionsBetween(bottomRight, correctedTopRight.get()))->GetTransitions()); dimensionCorrected++; if ((dimensionCorrected & 0x01) == 1) { @@ -190,10 +190,10 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) result->Add(correctedTopRight.release()); return FX_NEW CBC_QRDetectorResult(bits.release(), result); } -CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, FX_INT32 dimensionTop, FX_INT32 dimensionRight) +CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, int32_t dimensionTop, int32_t dimensionRight) { FX_FLOAT corr = Distance(bottomLeft, bottomRight) / (FX_FLOAT)dimensionTop; - FX_INT32 norm = Distance(topLeft, topRight); + int32_t norm = Distance(topLeft, topRight); FX_FLOAT cos = (topRight->GetX() - topLeft->GetX()) / norm; FX_FLOAT sin = (topRight->GetY() - topLeft->GetY()) / norm; CBC_AutoPtr c1(FX_NEW CBC_ResultPoint(topRight->GetX() + corr * cos, topRight->GetY() + corr * sin)); @@ -210,19 +210,19 @@ CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRightRectangular(CBC_ResultPo } else if (!IsValid(c2.get())) { return c1.release(); } - FX_INT32 l1 = FXSYS_abs(dimensionTop - CBC_AutoPtr(TransitionsBetween(topLeft, c1.get()))->GetTransitions()) + + int32_t l1 = FXSYS_abs(dimensionTop - CBC_AutoPtr(TransitionsBetween(topLeft, c1.get()))->GetTransitions()) + FXSYS_abs(dimensionRight - CBC_AutoPtr(TransitionsBetween(bottomRight, c1.get()))->GetTransitions()); - FX_INT32 l2 = FXSYS_abs(dimensionTop - CBC_AutoPtr(TransitionsBetween(topLeft, c2.get()))->GetTransitions()) + + int32_t l2 = FXSYS_abs(dimensionTop - CBC_AutoPtr(TransitionsBetween(topLeft, c2.get()))->GetTransitions()) + FXSYS_abs(dimensionRight - CBC_AutoPtr(TransitionsBetween(bottomRight, c2.get()))->GetTransitions()); if (l1 <= l2) { return c1.release(); } return c2.release(); } -CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRight(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, FX_INT32 dimension) +CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRight(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, int32_t dimension) { FX_FLOAT corr = Distance(bottomLeft, bottomRight) / (FX_FLOAT) dimension; - FX_INT32 norm = Distance(topLeft, topRight); + int32_t norm = Distance(topLeft, topRight); FX_FLOAT cos = (topRight->GetX() - topLeft->GetX()) / norm; FX_FLOAT sin = (topRight->GetY() - topLeft->GetY()) / norm; CBC_AutoPtr c1(FX_NEW CBC_ResultPoint(topRight->GetX() + corr * cos, topRight->GetY() + corr * sin)); @@ -239,9 +239,9 @@ CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRight(CBC_ResultPoint *bottom } else if (!IsValid(c2.get())) { return c1.release(); } - FX_INT32 l1 = FXSYS_abs(CBC_AutoPtr(TransitionsBetween(topLeft, c1.get()))->GetTransitions() - + int32_t l1 = FXSYS_abs(CBC_AutoPtr(TransitionsBetween(topLeft, c1.get()))->GetTransitions() - CBC_AutoPtr(TransitionsBetween(bottomRight, c1.get()))->GetTransitions()); - FX_INT32 l2 = FXSYS_abs(CBC_AutoPtr(TransitionsBetween(topLeft, c2.get()))->GetTransitions() - + int32_t l2 = FXSYS_abs(CBC_AutoPtr(TransitionsBetween(topLeft, c2.get()))->GetTransitions() - CBC_AutoPtr(TransitionsBetween(bottomRight, c2.get()))->GetTransitions()); return l1 <= l2 ? c1.release() : c2.release(); } @@ -249,19 +249,19 @@ FX_BOOL CBC_DataMatrixDetector::IsValid(CBC_ResultPoint *p) { return p->GetX() >= 0 && p->GetX() < m_image->GetWidth() && p->GetY() > 0 && p->GetY() < m_image->GetHeight(); } -FX_INT32 CBC_DataMatrixDetector::Round(FX_FLOAT d) +int32_t CBC_DataMatrixDetector::Round(FX_FLOAT d) { - return (FX_INT32) (d + 0.5f); + return (int32_t) (d + 0.5f); } -FX_INT32 CBC_DataMatrixDetector::Distance(CBC_ResultPoint *a, CBC_ResultPoint *b) +int32_t CBC_DataMatrixDetector::Distance(CBC_ResultPoint *a, CBC_ResultPoint *b) { return Round((FX_FLOAT) sqrt((a->GetX() - b->GetX()) * (a->GetX() - b->GetX()) + (a->GetY() - b->GetY()) * (a->GetY() - b->GetY()))); } -void CBC_DataMatrixDetector::Increment(CFX_MapPtrTemplate &table, CBC_ResultPoint *key) +void CBC_DataMatrixDetector::Increment(CFX_MapPtrTemplate &table, CBC_ResultPoint *key) { - FX_INT32 value; + int32_t value; if(table.Lookup(key, value)) { table.SetAt(key, INTEGERS[value + 1]); } else { @@ -273,7 +273,7 @@ CBC_CommonBitMatrix *CBC_DataMatrixDetector::SampleGrid(CBC_CommonBitMatrix *ima CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topRight, - FX_INT32 dimensionX, FX_INT32 dimensionY, FX_INT32 &e) + int32_t dimensionX, int32_t dimensionY, int32_t &e) { CBC_QRGridSampler &sampler = CBC_QRGridSampler::GetInstance(); CBC_CommonBitMatrix* cbm = sampler.SampleGrid(image, @@ -300,27 +300,27 @@ CBC_CommonBitMatrix *CBC_DataMatrixDetector::SampleGrid(CBC_CommonBitMatrix *ima } CBC_ResultPointsAndTransitions *CBC_DataMatrixDetector::TransitionsBetween(CBC_ResultPoint *from, CBC_ResultPoint *to) { - FX_INT32 fromX = (FX_INT32) from->GetX(); - FX_INT32 fromY = (FX_INT32) from->GetY(); - FX_INT32 toX = (FX_INT32) to->GetX(); - FX_INT32 toY = (FX_INT32) to->GetY(); + int32_t fromX = (int32_t) from->GetX(); + int32_t fromY = (int32_t) from->GetY(); + int32_t toX = (int32_t) to->GetX(); + int32_t toY = (int32_t) to->GetY(); FX_BOOL steep = FXSYS_abs(toY - fromY) > FXSYS_abs(toX - fromX); if (steep) { - FX_INT32 temp = fromX; + int32_t temp = fromX; fromX = fromY; fromY = temp; temp = toX; toX = toY; toY = temp; } - FX_INT32 dx = FXSYS_abs(toX - fromX); - FX_INT32 dy = FXSYS_abs(toY - fromY); - FX_INT32 error = -dx >> 1; - FX_INT32 ystep = fromY < toY ? 1 : -1; - FX_INT32 xstep = fromX < toX ? 1 : -1; - FX_INT32 transitions = 0; + int32_t dx = FXSYS_abs(toX - fromX); + int32_t dy = FXSYS_abs(toY - fromY); + int32_t error = -dx >> 1; + int32_t ystep = fromY < toY ? 1 : -1; + int32_t xstep = fromX < toX ? 1 : -1; + int32_t transitions = 0; FX_BOOL inBlack = m_image->Get(steep ? fromY : fromX, steep ? fromX : fromY); - for (FX_INT32 x = fromX, y = fromY; x != toX; x += xstep) { + for (int32_t x = fromX, y = fromY; x != toX; x += xstep) { FX_BOOL isBlack = m_image->Get(steep ? y : x, steep ? x : y); if (isBlack != inBlack) { transitions++; diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h index a9e244c5f4..e36ef678cd 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h @@ -15,7 +15,7 @@ class ResultPointsAndTransitions; class CBC_ResultPointsAndTransitions { public: - CBC_ResultPointsAndTransitions(CBC_ResultPoint *from, CBC_ResultPoint *to, FX_INT32 transitions) + CBC_ResultPointsAndTransitions(CBC_ResultPoint *from, CBC_ResultPoint *to, int32_t transitions) { m_from = from; m_to = to; @@ -32,47 +32,47 @@ public: { return m_to; } - FX_INT32 GetTransitions() + int32_t GetTransitions() { return m_transitions; } private: CBC_ResultPoint *m_from; CBC_ResultPoint *m_to; - FX_INT32 m_transitions; + int32_t m_transitions; }; class CBC_DataMatrixDetector { public: CBC_DataMatrixDetector(CBC_CommonBitMatrix *image); virtual ~CBC_DataMatrixDetector(); - CBC_QRDetectorResult *Detect(FX_INT32 &e); + CBC_QRDetectorResult *Detect(int32_t &e); CBC_ResultPoint *CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, - FX_INT32 dimensionTop, FX_INT32 dimensionRight); + int32_t dimensionTop, int32_t dimensionRight); CBC_ResultPoint *CorrectTopRight(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, - FX_INT32 dimension); + int32_t dimension); CBC_CommonBitMatrix *SampleGrid(CBC_CommonBitMatrix *image, CBC_ResultPoint *topLeft, CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topRight, - FX_INT32 dimensionX, FX_INT32 dimensionY, FX_INT32 &e); + int32_t dimensionX, int32_t dimensionY, int32_t &e); CBC_ResultPointsAndTransitions *TransitionsBetween(CBC_ResultPoint *from, CBC_ResultPoint *to); FX_BOOL IsValid(CBC_ResultPoint *p); - FX_INT32 Distance(CBC_ResultPoint *a, CBC_ResultPoint *b); - void Increment(CFX_MapPtrTemplate &table, CBC_ResultPoint *key); - FX_INT32 Round(FX_FLOAT d); + int32_t Distance(CBC_ResultPoint *a, CBC_ResultPoint *b); + void Increment(CFX_MapPtrTemplate &table, CBC_ResultPoint *key); + int32_t Round(FX_FLOAT d); void OrderBestPatterns(CFX_PtrArray *patterns); - virtual void Init(FX_INT32 &e); + virtual void Init(int32_t &e); private: CBC_CommonBitMatrix *m_image; CBC_WhiteRectangleDetector *m_rectangleDetector; - const static FX_INT32 INTEGERS[5]; + const static int32_t INTEGERS[5]; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp index cf076cd313..1b9f55dc9f 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp @@ -44,7 +44,7 @@ CBC_DataMatrixReader::~CBC_DataMatrixReader() } m_decoder = NULL; } -CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e) { CBC_CommonBitMatrix *cdr = image->GetBlackMatrix(e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); @@ -59,7 +59,7 @@ CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hi CBC_AutoPtr decodeResult(ResultTemp); return decodeResult->GetText(); } -CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e) +CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, int32_t &e) { CFX_ByteString bs = Decode(image, 0, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h index 4301512d70..6ba17a89e3 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h @@ -15,8 +15,8 @@ class CBC_DataMatrixReader : public CBC_Reader public: CBC_DataMatrixReader(); virtual ~CBC_DataMatrixReader(); - CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e); - CFX_ByteString Decode(CBC_BinaryBitmap *image, int hints, FX_INT32 &e); + CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e); + CFX_ByteString Decode(CBC_BinaryBitmap *image, int hints, int32_t &e); virtual void Init(); private: diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp index 256117883d..dfe0e11f1c 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp @@ -33,11 +33,11 @@ CBC_DataMatrixSymbolInfo144::CBC_DataMatrixSymbolInfo144() : CBC_SymbolInfo(FALS CBC_DataMatrixSymbolInfo144::~CBC_DataMatrixSymbolInfo144() { } -FX_INT32 CBC_DataMatrixSymbolInfo144::getInterleavedBlockCount() +int32_t CBC_DataMatrixSymbolInfo144::getInterleavedBlockCount() { return 10; } -FX_INT32 CBC_DataMatrixSymbolInfo144getDataLengthForInterleavedBlock(FX_INT32 index) +int32_t CBC_DataMatrixSymbolInfo144getDataLengthForInterleavedBlock(int32_t index) { return (index <= 8) ? 156 : 155; } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h index e749b27d86..2c13551145 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h @@ -13,7 +13,7 @@ class CBC_DataMatrixSymbolInfo144 : public CBC_SymbolInfo public: CBC_DataMatrixSymbolInfo144(); virtual ~CBC_DataMatrixSymbolInfo144(); - FX_INT32 getInterleavedBlockCount(); - FX_INT32 getDataLengthForInterleavedBlock(FX_INT32 index); + int32_t getInterleavedBlockCount(); + int32_t getDataLengthForInterleavedBlock(int32_t index); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp index 1a4e59864e..bbbf4bdee5 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp @@ -29,17 +29,17 @@ void CBC_DataMatrixVersion::Initialize() } void CBC_DataMatrixVersion::Finalize() { - for (FX_INT32 i = 0; i < VERSIONS->GetSize(); i++) { + for (int32_t i = 0; i < VERSIONS->GetSize(); i++) { delete ( (CBC_DataMatrixVersion*)(VERSIONS->GetAt(i)) ); } VERSIONS->RemoveAll(); delete VERSIONS; } -CBC_DataMatrixVersion::CBC_DataMatrixVersion(FX_INT32 versionNumber, - FX_INT32 symbolSizeRows, - FX_INT32 symbolSizeColumns, - FX_INT32 dataRegionSizeRows, - FX_INT32 dataRegionSizeColumns, +CBC_DataMatrixVersion::CBC_DataMatrixVersion(int32_t versionNumber, + int32_t symbolSizeRows, + int32_t symbolSizeColumns, + int32_t dataRegionSizeRows, + int32_t dataRegionSizeColumns, ECBlocks *ecBlocks) { m_versionNumber = versionNumber; @@ -48,10 +48,10 @@ CBC_DataMatrixVersion::CBC_DataMatrixVersion(FX_INT32 versionNumber, m_dataRegionSizeRows = dataRegionSizeRows; m_dataRegionSizeColumns = dataRegionSizeColumns; m_ecBlocks = ecBlocks; - FX_INT32 total = 0; - FX_INT32 ecCodewords = ecBlocks->GetECCodewords(); + int32_t total = 0; + int32_t ecCodewords = ecBlocks->GetECCodewords(); const CFX_PtrArray &ecbArray = ecBlocks->GetECBlocks(); - for (FX_INT32 i = 0; i < ecbArray.GetSize(); i++) { + for (int32_t i = 0; i < ecbArray.GetSize(); i++) { total += ((ECB*)ecbArray[i])->GetCount() * (((ECB*)ecbArray[i])->GetDataCodewords() + ecCodewords); } m_totalCodewords = total; @@ -63,27 +63,27 @@ CBC_DataMatrixVersion::~CBC_DataMatrixVersion() } m_ecBlocks = NULL; } -FX_INT32 CBC_DataMatrixVersion::GetVersionNumber() +int32_t CBC_DataMatrixVersion::GetVersionNumber() { return m_versionNumber; } -FX_INT32 CBC_DataMatrixVersion::GetSymbolSizeRows() +int32_t CBC_DataMatrixVersion::GetSymbolSizeRows() { return m_symbolSizeRows; } -FX_INT32 CBC_DataMatrixVersion::GetSymbolSizeColumns() +int32_t CBC_DataMatrixVersion::GetSymbolSizeColumns() { return m_symbolSizeColumns; } -FX_INT32 CBC_DataMatrixVersion::GetDataRegionSizeRows() +int32_t CBC_DataMatrixVersion::GetDataRegionSizeRows() { return m_dataRegionSizeRows; } -FX_INT32 CBC_DataMatrixVersion::GetDataRegionSizeColumns() +int32_t CBC_DataMatrixVersion::GetDataRegionSizeColumns() { return m_dataRegionSizeColumns; } -FX_INT32 CBC_DataMatrixVersion::GetTotalCodewords() +int32_t CBC_DataMatrixVersion::GetTotalCodewords() { return m_totalCodewords; } @@ -93,12 +93,12 @@ ECBlocks *CBC_DataMatrixVersion::GetECBlocks() } void CBC_DataMatrixVersion::ReleaseAll() { - for (FX_INT32 i = 0; i < VERSIONS->GetSize(); i++) { + for (int32_t i = 0; i < VERSIONS->GetSize(); i++) { delete (CBC_DataMatrixVersion*)VERSIONS->GetAt(i); } VERSIONS->RemoveAll(); } -CBC_DataMatrixVersion *CBC_DataMatrixVersion::GetVersionForDimensions(FX_INT32 numRows, FX_INT32 numColumns, FX_INT32 &e) +CBC_DataMatrixVersion *CBC_DataMatrixVersion::GetVersionForDimensions(int32_t numRows, int32_t numColumns, int32_t &e) { if ((numRows & 0x01) != 0 || (numColumns & 0x01) != 0) { e = BCExceptionNotFound; @@ -136,8 +136,8 @@ CBC_DataMatrixVersion *CBC_DataMatrixVersion::GetVersionForDimensions(FX_INT32 n VERSIONS->Add(FX_NEW CBC_DataMatrixVersion(29, 16, 36, 14, 16, FX_NEW ECBlocks(24, FX_NEW ECB(1, 32)))); VERSIONS->Add(FX_NEW CBC_DataMatrixVersion(30, 16, 48, 14, 22, FX_NEW ECBlocks(28, FX_NEW ECB(1, 49)))); } - FX_INT32 numVersions = VERSIONS->GetSize(); - for (FX_INT32 i = 0; i < numVersions; ++i) { + int32_t numVersions = VERSIONS->GetSize(); + for (int32_t i = 0; i < numVersions; ++i) { if (((CBC_DataMatrixVersion*)((*VERSIONS)[i]))->m_symbolSizeRows == numRows && ((CBC_DataMatrixVersion*)((*VERSIONS)[i]))->m_symbolSizeColumns == numColumns) { return (CBC_DataMatrixVersion*)(*VERSIONS)[i]; } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h index 9661834bd8..90f6509f0f 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h @@ -11,35 +11,35 @@ class CBC_DataMatrixVersion; class ECB { public: - ECB(FX_INT32 count, FX_INT32 dataCodewords) + ECB(int32_t count, int32_t dataCodewords) { m_count = count; m_dataCodewords = dataCodewords; } - FX_INT32 GetCount() + int32_t GetCount() { return m_count; } - FX_INT32 GetDataCodewords() + int32_t GetDataCodewords() { return m_dataCodewords; } private: - FX_INT32 m_count; - FX_INT32 m_dataCodewords; + int32_t m_count; + int32_t m_dataCodewords; }; class ECBlocks { public: - ECBlocks(FX_INT32 ecCodewords, ECB *ecBlocks) + ECBlocks(int32_t ecCodewords, ECB *ecBlocks) { m_ecCodewords = ecCodewords; m_ecBlocks.Add(ecBlocks); } - ECBlocks(FX_INT32 ecCodewords, ECB *ecBlocks1, ECB *ecBlocks2) + ECBlocks(int32_t ecCodewords, ECB *ecBlocks1, ECB *ecBlocks2) { m_ecCodewords = ecCodewords; m_ecBlocks.Add(ecBlocks1); @@ -47,13 +47,13 @@ public: } ~ECBlocks() { - for(FX_INT32 i = 0; i < m_ecBlocks.GetSize(); i++) { + for(int32_t i = 0; i < m_ecBlocks.GetSize(); i++) { delete (ECB*)m_ecBlocks[i]; } m_ecBlocks.RemoveAll(); } - FX_INT32 GetECCodewords() + int32_t GetECCodewords() { return m_ecCodewords; } @@ -63,38 +63,38 @@ public: return m_ecBlocks; } private: - FX_INT32 m_ecCodewords; + int32_t m_ecCodewords; CFX_PtrArray m_ecBlocks; }; class CBC_DataMatrixVersion { public: - CBC_DataMatrixVersion(FX_INT32 versionNumber, - FX_INT32 symbolSizeRows, - FX_INT32 symbolSizeColumns, - FX_INT32 dataRegionSizeRows, - FX_INT32 dataRegionSizeColumns, + CBC_DataMatrixVersion(int32_t versionNumber, + int32_t symbolSizeRows, + int32_t symbolSizeColumns, + int32_t dataRegionSizeRows, + int32_t dataRegionSizeColumns, ECBlocks *ecBlocks); virtual ~CBC_DataMatrixVersion(); static void Initialize(); static void Finalize(); - FX_INT32 GetVersionNumber(); - FX_INT32 GetSymbolSizeRows(); - FX_INT32 GetSymbolSizeColumns(); - FX_INT32 GetDataRegionSizeRows(); - FX_INT32 GetDataRegionSizeColumns(); - FX_INT32 GetTotalCodewords(); + int32_t GetVersionNumber(); + int32_t GetSymbolSizeRows(); + int32_t GetSymbolSizeColumns(); + int32_t GetDataRegionSizeRows(); + int32_t GetDataRegionSizeColumns(); + int32_t GetTotalCodewords(); ECBlocks *GetECBlocks(); - static CBC_DataMatrixVersion *GetVersionForDimensions(FX_INT32 numRows, FX_INT32 numColumns, FX_INT32 &e); + static CBC_DataMatrixVersion *GetVersionForDimensions(int32_t numRows, int32_t numColumns, int32_t &e); static void ReleaseAll(); private: - FX_INT32 m_versionNumber; - FX_INT32 m_symbolSizeRows; - FX_INT32 m_symbolSizeColumns; - FX_INT32 m_dataRegionSizeRows; - FX_INT32 m_dataRegionSizeColumns; + int32_t m_versionNumber; + int32_t m_symbolSizeRows; + int32_t m_symbolSizeColumns; + int32_t m_dataRegionSizeRows; + int32_t m_dataRegionSizeColumns; ECBlocks *m_ecBlocks; - FX_INT32 m_totalCodewords; + int32_t m_totalCodewords; static CFX_PtrArray* VERSIONS; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp index 652758a635..4bccdd0bf8 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp @@ -49,12 +49,12 @@ CBC_DataMatrixWriter::CBC_DataMatrixWriter() CBC_DataMatrixWriter::~CBC_DataMatrixWriter() { } -FX_BOOL CBC_DataMatrixWriter::SetErrorCorrectionLevel (FX_INT32 level) +FX_BOOL CBC_DataMatrixWriter::SetErrorCorrectionLevel (int32_t level) { m_iCorrectLevel = level; return TRUE; } -FX_BYTE* CBC_DataMatrixWriter::Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t* CBC_DataMatrixWriter::Encode(const CFX_WideString &contents, int32_t &outWidth, int32_t &outHeight, int32_t &e) { if (outWidth < 0 || outHeight < 0) { e = BCExceptionHeightAndWidthMustBeAtLeast1; @@ -77,42 +77,42 @@ FX_BYTE* CBC_DataMatrixWriter::Encode(const CFX_WideString &contents, FX_INT32 & BC_EXCEPTION_CHECK_ReturnValue(e, NULL); outWidth = bytematrix->GetWidth(); outHeight = bytematrix->GetHeight(); - FX_BYTE* result = FX_Alloc(FX_BYTE, outWidth * outHeight); + uint8_t* result = FX_Alloc(uint8_t, outWidth * outHeight); FXSYS_memcpy32(result, bytematrix->GetArray(), outWidth * outHeight); delete bytematrix; delete placement; return result; } -FX_BYTE *CBC_DataMatrixWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t *CBC_DataMatrixWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e) { return NULL; } -FX_BYTE *CBC_DataMatrixWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) +uint8_t *CBC_DataMatrixWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) { return NULL; } -CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, FX_INT32 &e) +CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, int32_t &e) { - FX_INT32 symbolWidth = symbolInfo->getSymbolDataWidth(e); + int32_t symbolWidth = symbolInfo->getSymbolDataWidth(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 symbolHeight = symbolInfo->getSymbolDataHeight(e); + int32_t symbolHeight = symbolInfo->getSymbolDataHeight(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_CommonByteMatrix* matrix = FX_NEW CBC_CommonByteMatrix(symbolInfo->getSymbolWidth(e), symbolInfo->getSymbolHeight(e)); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); matrix->Init(); - FX_INT32 matrixY = 0; - for (FX_INT32 y = 0; y < symbolHeight; y++) { - FX_INT32 matrixX; + int32_t matrixY = 0; + for (int32_t y = 0; y < symbolHeight; y++) { + int32_t matrixX; if ((y % symbolInfo->m_matrixHeight) == 0) { matrixX = 0; - for (FX_INT32 x = 0; x < symbolInfo->getSymbolWidth(e); x++) { + for (int32_t x = 0; x < symbolInfo->getSymbolWidth(e); x++) { matrix->Set(matrixX, matrixY, (x % 2) == 0); matrixX++; } matrixY++; } matrixX = 0; - for (FX_INT32 x = 0; x < symbolWidth; x++) { + for (int32_t x = 0; x < symbolWidth; x++) { if ((x % symbolInfo->m_matrixWidth) == 0) { matrix->Set(matrixX, matrixY, TRUE); matrixX++; @@ -127,7 +127,7 @@ CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel(CBC_DefaultPlacement* matrixY++; if ((y % symbolInfo->m_matrixHeight) == symbolInfo->m_matrixHeight - 1) { matrixX = 0; - for (FX_INT32 x = 0; x < symbolInfo->getSymbolWidth(e); x++) { + for (int32_t x = 0; x < symbolInfo->getSymbolWidth(e); x++) { matrix->Set(matrixX, matrixY, TRUE); matrixX++; } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h index c8a6bdd823..241229b467 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h @@ -18,13 +18,13 @@ class CBC_DataMatrixWriter : public CBC_TwoDimWriter public: CBC_DataMatrixWriter(); virtual ~CBC_DataMatrixWriter(); - FX_BYTE* Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e); - FX_BOOL SetErrorCorrectionLevel (FX_INT32 level); + uint8_t* Encode(const CFX_WideString &contents, int32_t &outWidth, int32_t &outHeight, int32_t &e); + uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e); + uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e); + FX_BOOL SetErrorCorrectionLevel (int32_t level); private: - static CBC_CommonByteMatrix* encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, FX_INT32 &e); - FX_INT32 m_iCorrectLevel; + static CBC_CommonByteMatrix* encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, int32_t &e); + int32_t m_iCorrectLevel; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp index e6bab5a65e..57c6cc92d2 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp @@ -23,25 +23,25 @@ #include "../barcode.h" #include "BC_Encoder.h" #include "BC_DefaultPlacement.h" -CBC_DefaultPlacement::CBC_DefaultPlacement(CFX_WideString codewords, FX_INT32 numcols, FX_INT32 numrows) +CBC_DefaultPlacement::CBC_DefaultPlacement(CFX_WideString codewords, int32_t numcols, int32_t numrows) { m_codewords = codewords; m_numcols = numcols; m_numrows = numrows; m_bits.SetSize(numcols * numrows); - for (FX_INT32 i = 0; i < numcols * numrows; i++) { - m_bits[i] = (FX_BYTE) 2; + for (int32_t i = 0; i < numcols * numrows; i++) { + m_bits[i] = (uint8_t) 2; } } CBC_DefaultPlacement::~CBC_DefaultPlacement() { m_bits.RemoveAll(); } -FX_INT32 CBC_DefaultPlacement::getNumrows() +int32_t CBC_DefaultPlacement::getNumrows() { return m_numrows; } -FX_INT32 CBC_DefaultPlacement::getNumcols() +int32_t CBC_DefaultPlacement::getNumcols() { return m_numcols; } @@ -49,23 +49,23 @@ CFX_ByteArray& CBC_DefaultPlacement::getBits() { return m_bits; } -FX_BOOL CBC_DefaultPlacement::getBit(FX_INT32 col, FX_INT32 row) +FX_BOOL CBC_DefaultPlacement::getBit(int32_t col, int32_t row) { return m_bits[row * m_numcols + col] == 1; } -void CBC_DefaultPlacement::setBit(FX_INT32 col, FX_INT32 row, FX_BOOL bit) +void CBC_DefaultPlacement::setBit(int32_t col, int32_t row, FX_BOOL bit) { - m_bits[row * m_numcols + col] = bit ? (FX_BYTE) 1 : (FX_BYTE) 0; + m_bits[row * m_numcols + col] = bit ? (uint8_t) 1 : (uint8_t) 0; } -FX_BOOL CBC_DefaultPlacement::hasBit(FX_INT32 col, FX_INT32 row) +FX_BOOL CBC_DefaultPlacement::hasBit(int32_t col, int32_t row) { return m_bits[row * m_numcols + col] != 2; } void CBC_DefaultPlacement::place() { - FX_INT32 pos = 0; - FX_INT32 row = 4; - FX_INT32 col = 0; + int32_t pos = 0; + int32_t row = 4; + int32_t col = 0; do { if ((row == m_numrows) && (col == 0)) { corner1(pos++); @@ -103,7 +103,7 @@ void CBC_DefaultPlacement::place() setBit(m_numcols - 2, m_numrows - 2, TRUE); } } -void CBC_DefaultPlacement::module(FX_INT32 row, FX_INT32 col, FX_INT32 pos, FX_INT32 bit) +void CBC_DefaultPlacement::module(int32_t row, int32_t col, int32_t pos, int32_t bit) { if (row < 0) { row += m_numrows; @@ -113,11 +113,11 @@ void CBC_DefaultPlacement::module(FX_INT32 row, FX_INT32 col, FX_INT32 pos, FX_I col += m_numcols; row += 4 - ((m_numcols + 4) % 8); } - FX_INT32 v = m_codewords.GetAt(pos); + int32_t v = m_codewords.GetAt(pos); v &= 1 << (8 - bit); setBit(col, row, v != 0); } -void CBC_DefaultPlacement::utah(FX_INT32 row, FX_INT32 col, FX_INT32 pos) +void CBC_DefaultPlacement::utah(int32_t row, int32_t col, int32_t pos) { module(row - 2, col - 2, pos, 1); module(row - 2, col - 1, pos, 2); @@ -128,7 +128,7 @@ void CBC_DefaultPlacement::utah(FX_INT32 row, FX_INT32 col, FX_INT32 pos) module(row, col - 1, pos, 7); module(row, col, pos, 8); } -void CBC_DefaultPlacement::corner1(FX_INT32 pos) +void CBC_DefaultPlacement::corner1(int32_t pos) { module(m_numrows - 1, 0, pos, 1); module(m_numrows - 1, 1, pos, 2); @@ -139,7 +139,7 @@ void CBC_DefaultPlacement::corner1(FX_INT32 pos) module(2, m_numcols - 1, pos, 7); module(3, m_numcols - 1, pos, 8); } -void CBC_DefaultPlacement::corner2(FX_INT32 pos) +void CBC_DefaultPlacement::corner2(int32_t pos) { module(m_numrows - 3, 0, pos, 1); module(m_numrows - 2, 0, pos, 2); @@ -150,7 +150,7 @@ void CBC_DefaultPlacement::corner2(FX_INT32 pos) module(0, m_numcols - 1, pos, 7); module(1, m_numcols - 1, pos, 8); } -void CBC_DefaultPlacement::corner3(FX_INT32 pos) +void CBC_DefaultPlacement::corner3(int32_t pos) { module(m_numrows - 3, 0, pos, 1); module(m_numrows - 2, 0, pos, 2); @@ -161,7 +161,7 @@ void CBC_DefaultPlacement::corner3(FX_INT32 pos) module(2, m_numcols - 1, pos, 7); module(3, m_numcols - 1, pos, 8); } -void CBC_DefaultPlacement::corner4(FX_INT32 pos) +void CBC_DefaultPlacement::corner4(int32_t pos) { module(m_numrows - 1, 0, pos, 1); module(m_numrows - 1, m_numcols - 1, pos, 2); diff --git a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h index 2194e9f18a..dec26a6c70 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h @@ -9,26 +9,26 @@ class CBC_DefaultPlacement { public: - CBC_DefaultPlacement(CFX_WideString codewords, FX_INT32 numcols, FX_INT32 numrows); + CBC_DefaultPlacement(CFX_WideString codewords, int32_t numcols, int32_t numrows); virtual ~CBC_DefaultPlacement(); - FX_INT32 getNumrows(); - FX_INT32 getNumcols(); + int32_t getNumrows(); + int32_t getNumcols(); CFX_ByteArray& getBits(); - FX_BOOL getBit(FX_INT32 col, FX_INT32 row); - void setBit(FX_INT32 col, FX_INT32 row, FX_BOOL bit); - FX_BOOL hasBit(FX_INT32 col, FX_INT32 row); + 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); void place(); private: CFX_WideString m_codewords; - FX_INT32 m_numrows; - FX_INT32 m_numcols; + int32_t m_numrows; + int32_t m_numcols; CFX_ByteArray m_bits; - void module(FX_INT32 row, FX_INT32 col, FX_INT32 pos, FX_INT32 bit); - void utah(FX_INT32 row, FX_INT32 col, FX_INT32 pos); - void corner1(FX_INT32 pos); - void corner2(FX_INT32 pos); - void corner3(FX_INT32 pos); - void corner4(FX_INT32 pos); + void module(int32_t row, int32_t col, int32_t pos, int32_t bit); + void utah(int32_t row, int32_t col, int32_t pos); + void corner1(int32_t pos); + void corner2(int32_t pos); + void corner3(int32_t pos); + void corner4(int32_t pos); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp index d1e84af73e..8a0271f1a0 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp @@ -35,11 +35,11 @@ CBC_EdifactEncoder::CBC_EdifactEncoder() CBC_EdifactEncoder::~CBC_EdifactEncoder() { } -FX_INT32 CBC_EdifactEncoder::getEncodingMode() +int32_t CBC_EdifactEncoder::getEncodingMode() { return EDIFACT_ENCODATION; } -void CBC_EdifactEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) +void CBC_EdifactEncoder::Encode(CBC_EncoderContext &context, int32_t &e) { CFX_WideString buffer; while (context.hasMoreCharacters()) { @@ -49,14 +49,14 @@ void CBC_EdifactEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) return; } context.m_pos++; - FX_INT32 count = buffer.GetLength(); + int32_t count = buffer.GetLength(); if (count >= 4) { context.writeCodewords(encodeToCodewords(buffer, 0, e)); if (e != BCExceptionNO) { return; } buffer.Delete(0, 4); - FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); + int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); if (newMode != getEncodingMode()) { context.signalEncoderChange(ASCII_ENCODATION); break; @@ -66,9 +66,9 @@ void CBC_EdifactEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) buffer += (FX_WCHAR)31; handleEOD(context, buffer, e); } -void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, FX_INT32 &e) +void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, int32_t &e) { - FX_INT32 count = buffer.GetLength(); + int32_t count = buffer.GetLength(); if (count == 0) { return; } @@ -77,8 +77,8 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString b if (e != BCExceptionNO) { return; } - FX_INT32 available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount(); - FX_INT32 remaining = context.getRemainingCharacters(); + int32_t available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount(); + int32_t remaining = context.getRemainingCharacters(); if (remaining == 0 && available <= 2) { return; } @@ -87,7 +87,7 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString b e = BCExceptionIllegalStateCountMustNotExceed4; return; } - FX_INT32 restChars = count - 1; + int32_t restChars = count - 1; CFX_WideString encoded = encodeToCodewords(buffer, 0, e); if (e != BCExceptionNO) { return; @@ -99,7 +99,7 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString b if (e != BCExceptionNO) { return; } - FX_INT32 available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount(); + int32_t available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount(); if (available >= 3) { restInAscii = FALSE; context.updateSymbolInfo(context.getCodewordCount() + encoded.GetLength(), e); @@ -116,7 +116,7 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString b } context.signalEncoderChange(ASCII_ENCODATION); } -void CBC_EdifactEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) +void CBC_EdifactEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e) { if (c >= ' ' && c <= '?') { sb += c; @@ -126,9 +126,9 @@ void CBC_EdifactEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) CBC_HighLevelEncoder::illegalCharacter(c, e); } } -CFX_WideString CBC_EdifactEncoder::encodeToCodewords(CFX_WideString sb, FX_INT32 startPos, FX_INT32 &e) +CFX_WideString CBC_EdifactEncoder::encodeToCodewords(CFX_WideString sb, int32_t startPos, int32_t &e) { - FX_INT32 len = sb.GetLength() - startPos; + int32_t len = sb.GetLength() - startPos; if (len == 0) { e = BCExceptionNoContents; return (FX_LPWSTR)""; @@ -137,7 +137,7 @@ CFX_WideString CBC_EdifactEncoder::encodeToCodewords(CFX_WideString sb, FX_INT32 FX_WCHAR c2 = len >= 2 ? sb.GetAt(startPos + 1) : 0; FX_WCHAR c3 = len >= 3 ? sb.GetAt(startPos + 2) : 0; FX_WCHAR c4 = len >= 4 ? sb.GetAt(startPos + 3) : 0; - FX_INT32 v = (c1 << 18) + (c2 << 12) + (c3 << 6) + c4; + int32_t v = (c1 << 18) + (c2 << 12) + (c3 << 6) + c4; FX_WCHAR cw1 = (FX_WCHAR) ((v >> 16) & 255); FX_WCHAR cw2 = (FX_WCHAR) ((v >> 8) & 255); FX_WCHAR cw3 = (FX_WCHAR) (v & 255); diff --git a/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h b/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h index 7e2453a71d..6b102c689c 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h @@ -13,11 +13,11 @@ class CBC_EdifactEncoder : public CBC_Encoder public: CBC_EdifactEncoder(); virtual ~CBC_EdifactEncoder(); - FX_INT32 getEncodingMode(); - void Encode(CBC_EncoderContext &context, FX_INT32 &e); + int32_t getEncodingMode(); + void Encode(CBC_EncoderContext &context, int32_t &e); private: - static void handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, FX_INT32 &e); - static void encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e); - static CFX_WideString encodeToCodewords(CFX_WideString sb, FX_INT32 startPos, FX_INT32 &e); + static void handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, int32_t &e); + static void encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e); + static CFX_WideString encodeToCodewords(CFX_WideString sb, int32_t startPos, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_Encoder.h b/xfa/src/fxbarcode/datamatrix/BC_Encoder.h index 7d1a1b5b62..9a51af06e9 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_Encoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_Encoder.h @@ -12,7 +12,7 @@ class CBC_Encoder public: CBC_Encoder(); virtual ~CBC_Encoder(); - virtual FX_INT32 getEncodingMode() = 0; - virtual void Encode(CBC_EncoderContext &context, FX_INT32 &e) = 0; + virtual int32_t getEncodingMode() = 0; + virtual void Encode(CBC_EncoderContext &context, int32_t &e) = 0; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp b/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp index f65c9f29bc..066b4b2037 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp @@ -28,13 +28,13 @@ #include "BC_SymbolShapeHint.h" #include "BC_SymbolInfo.h" #include "BC_EncoderContext.h" -CBC_EncoderContext::CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e) +CBC_EncoderContext::CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, int32_t &e) { CFX_ByteString dststr; CBC_UtilCodingConvert::UnicodeToUTF8(msg, dststr); CFX_WideString sb; - FX_INT32 c = dststr.GetLength(); - for (FX_INT32 i = 0; i < c; i++) { + int32_t c = dststr.GetLength(); + for (int32_t i = 0; i < c; i++) { FX_WCHAR ch = (FX_WCHAR)(dststr.GetAt(i) & 0xff); if (ch == '?' && dststr.GetAt(i) != '?') { e = BCExceptionCharactersOutsideISO88591Encoding; @@ -66,7 +66,7 @@ CFX_WideString CBC_EncoderContext::getMessage() { return m_msg; } -void CBC_EncoderContext::setSkipAtEnd(FX_INT32 count) +void CBC_EncoderContext::setSkipAtEnd(int32_t count) { m_skipAtEnd = count; } @@ -86,11 +86,11 @@ void CBC_EncoderContext::writeCodeword(FX_WCHAR codeword) { m_codewords += codeword; } -FX_INT32 CBC_EncoderContext::getCodewordCount() +int32_t CBC_EncoderContext::getCodewordCount() { return m_codewords.GetLength(); } -void CBC_EncoderContext::signalEncoderChange(FX_INT32 encoding) +void CBC_EncoderContext::signalEncoderChange(int32_t encoding) { m_newEncoding = encoding; } @@ -102,15 +102,15 @@ FX_BOOL CBC_EncoderContext::hasMoreCharacters() { return m_pos < getTotalMessageCharCount(); } -FX_INT32 CBC_EncoderContext::getRemainingCharacters() +int32_t CBC_EncoderContext::getRemainingCharacters() { return getTotalMessageCharCount() - m_pos; } -void CBC_EncoderContext::updateSymbolInfo(FX_INT32 &e) +void CBC_EncoderContext::updateSymbolInfo(int32_t &e) { updateSymbolInfo(getCodewordCount(), e); } -void CBC_EncoderContext::updateSymbolInfo(FX_INT32 len, FX_INT32 &e) +void CBC_EncoderContext::updateSymbolInfo(int32_t len, int32_t &e) { if (m_symbolInfo == NULL || len > m_symbolInfo->m_dataCapacity) { m_symbolInfo = CBC_SymbolInfo::lookup(len, m_shape, m_minSize, m_maxSize, true, e); @@ -121,7 +121,7 @@ void CBC_EncoderContext::resetSymbolInfo() { m_shape = FORCE_NONE; } -FX_INT32 CBC_EncoderContext::getTotalMessageCharCount() +int32_t CBC_EncoderContext::getTotalMessageCharCount() { return m_msg.GetLength() - m_skipAtEnd; } diff --git a/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h b/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h index 0099dbc9f0..e2dd0b35bb 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h +++ b/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h @@ -13,36 +13,36 @@ class CBC_EncoderContext; class CBC_EncoderContext : public CBC_SymbolShapeHint { public: - CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e); + CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, int32_t &e); virtual ~CBC_EncoderContext(); void setSymbolShape(SymbolShapeHint shape); void setSizeConstraints(CBC_Dimension* minSize, CBC_Dimension* maxSize); CFX_WideString getMessage(); - void setSkipAtEnd(FX_INT32 count); + void setSkipAtEnd(int32_t count); FX_WCHAR getCurrentChar(); FX_WCHAR getCurrent(); void writeCodewords(CFX_WideString codewords); void writeCodeword(FX_WCHAR codeword); - FX_INT32 getCodewordCount(); - void signalEncoderChange(FX_INT32 encoding); + int32_t getCodewordCount(); + void signalEncoderChange(int32_t encoding); void resetEncoderSignal(); FX_BOOL hasMoreCharacters(); - FX_INT32 getRemainingCharacters(); - void updateSymbolInfo(FX_INT32 &e); - void updateSymbolInfo(FX_INT32 len, FX_INT32 &e); + int32_t getRemainingCharacters(); + void updateSymbolInfo(int32_t &e); + void updateSymbolInfo(int32_t len, int32_t &e); void resetSymbolInfo(); public: CFX_WideString m_msg; CFX_WideString m_codewords; - FX_INT32 m_pos; - FX_INT32 m_newEncoding; + int32_t m_pos; + int32_t m_newEncoding; CBC_SymbolInfo* m_symbolInfo; private: - FX_INT32 getTotalMessageCharCount(); + int32_t getTotalMessageCharCount(); private: SymbolShapeHint m_shape; CBC_Dimension* m_minSize; CBC_Dimension* m_maxSize; - FX_INT32 m_skipAtEnd; + int32_t m_skipAtEnd; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp b/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp index f346072499..e574742b54 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp @@ -25,8 +25,8 @@ #include "BC_SymbolShapeHint.h" #include "BC_SymbolInfo.h" #include "BC_ErrorCorrection.h" -FX_INT32 CBC_ErrorCorrection::FACTOR_SETS[] = {5, 7, 10, 11, 12, 14, 18, 20, 24, 28, 36, 42, 48, 56, 62, 68}; -FX_INT32 CBC_ErrorCorrection::FACTORS[][100] = { +int32_t CBC_ErrorCorrection::FACTOR_SETS[] = {5, 7, 10, 11, 12, 14, 18, 20, 24, 28, 36, 42, 48, 56, 62, 68}; +int32_t CBC_ErrorCorrection::FACTORS[][100] = { {228, 48, 15, 111, 62}, {23, 68, 144, 134, 240, 92, 254}, {28, 24, 185, 166, 223, 248, 116, 255, 110, 61}, @@ -78,13 +78,13 @@ FX_INT32 CBC_ErrorCorrection::FACTORS[][100] = { 96, 103, 82, 186 } }; -FX_INT32 CBC_ErrorCorrection::MODULO_VALUE = 0x12D; -FX_INT32 CBC_ErrorCorrection::LOG[256] = {0}; -FX_INT32 CBC_ErrorCorrection::ALOG[256] = {0}; +int32_t CBC_ErrorCorrection::MODULO_VALUE = 0x12D; +int32_t CBC_ErrorCorrection::LOG[256] = {0}; +int32_t CBC_ErrorCorrection::ALOG[256] = {0}; void CBC_ErrorCorrection::Initialize() { - FX_INT32 p = 1; - for (FX_INT32 i = 0; i < 255; i++) { + int32_t p = 1; + for (int32_t i = 0; i < 255; i++) { ALOG[i] = p; LOG[p] = i; p <<= 1; @@ -102,7 +102,7 @@ CBC_ErrorCorrection::CBC_ErrorCorrection() CBC_ErrorCorrection::~CBC_ErrorCorrection() { } -CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, FX_INT32 &e) +CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, int32_t &e) { if (codewords.GetLength() != symbolInfo->m_dataCapacity) { e = BCExceptionIllegalArgument; @@ -110,7 +110,7 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_S } CFX_WideString sb; sb += codewords; - FX_INT32 blockCount = symbolInfo->getInterleavedBlockCount(); + int32_t blockCount = symbolInfo->getInterleavedBlockCount(); if (blockCount == 1) { CFX_WideString ecc = createECCBlock(codewords, symbolInfo->m_errorCodewords, e); BC_EXCEPTION_CHECK_ReturnValue(e, (FX_LPWSTR)""); @@ -122,7 +122,7 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_S errorSizes.SetSize(blockCount); CFX_Int32Array startPos; startPos.SetSize(blockCount); - for (FX_INT32 i = 0; i < blockCount; i++) { + for (int32_t i = 0; i < blockCount; i++) { dataSizes[i] = symbolInfo->getDataLengthForInterleavedBlock(i + 1); errorSizes[i] = symbolInfo->getErrorLengthForInterleavedBlock(i + 1); startPos[i] = 0; @@ -130,29 +130,29 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_S startPos[i] = startPos[i - 1] + dataSizes[i]; } } - for (FX_INT32 block = 0; block < blockCount; block++) { + for (int32_t block = 0; block < blockCount; block++) { CFX_WideString temp; - for (FX_INT32 d = block; d < symbolInfo->m_dataCapacity; d += blockCount) { + for (int32_t d = block; d < symbolInfo->m_dataCapacity; d += blockCount) { temp += (FX_WCHAR)codewords.GetAt(d); } CFX_WideString ecc = createECCBlock(temp, errorSizes[block], e); BC_EXCEPTION_CHECK_ReturnValue(e, (FX_LPWSTR)""); - FX_INT32 pos = 0; - for (FX_INT32 l = block; l < errorSizes[block] * blockCount; l += blockCount) { + int32_t pos = 0; + for (int32_t l = block; l < errorSizes[block] * blockCount; l += blockCount) { sb.SetAt(symbolInfo->m_dataCapacity + l, ecc.GetAt(pos++)); } } } return sb; } -CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, FX_INT32 numECWords, FX_INT32 &e) +CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, int32_t numECWords, int32_t &e) { return createECCBlock(codewords, 0, codewords.GetLength(), numECWords, e); } -CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, FX_INT32 start, FX_INT32 len, FX_INT32 numECWords, FX_INT32 &e) +CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, int32_t start, int32_t len, int32_t numECWords, int32_t &e) { - FX_INT32 table = -1; - for (FX_INT32 i = 0; i < sizeof(FACTOR_SETS) / sizeof(FX_INT32); i++) { + int32_t table = -1; + for (int32_t i = 0; i < sizeof(FACTOR_SETS) / sizeof(int32_t); i++) { if (FACTOR_SETS[i] == numECWords) { table = i; break; @@ -164,14 +164,14 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, FX_ } FX_WORD* ecc = FX_Alloc(FX_WORD, numECWords); FXSYS_memset32(ecc, 0, numECWords * sizeof(FX_WORD)); - for (FX_INT32 l = start; l < start + len; l++) { - FX_BYTE A = (FX_BYTE)codewords.GetAt(l); + for (int32_t l = start; l < start + len; l++) { + uint8_t A = (uint8_t)codewords.GetAt(l); FX_WORD B = ecc[numECWords - 1]; FX_WORD m = ecc[numECWords - 1] ^ codewords.GetAt(l); - for (FX_INT32 k = numECWords - 1; k > 0; k--) { + for (int32_t k = numECWords - 1; k > 0; k--) { if (m != 0 && FACTORS[table][k] != 0) { - FX_INT32 a = LOG[FACTORS[table][k]]; - FX_INT32 b = ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255]; + int32_t a = LOG[FACTORS[table][k]]; + int32_t b = ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255]; FX_WORD c = ecc[k - 1]; FX_WORD D = (ecc[k - 1] ^ ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255]); ecc[k] = (FX_WORD ) (ecc[k - 1] ^ ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255]); @@ -186,7 +186,7 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, FX_ } } CFX_WideString strecc; - for (FX_INT32 j = 0; j < numECWords; j++) { + for (int32_t j = 0; j < numECWords; j++) { strecc += (FX_WCHAR)ecc[numECWords - j - 1]; } FX_Free(ecc); diff --git a/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h b/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h index 0bc71cdeb5..2ec7b27aaa 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h +++ b/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h @@ -14,15 +14,15 @@ public: virtual ~CBC_ErrorCorrection(); static void Initialize(); static void Finalize(); - static CFX_WideString encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, FX_INT32 &e); + static CFX_WideString encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, int32_t &e); private: - static FX_INT32 FACTOR_SETS[]; - static FX_INT32 FACTORS[][100]; - static FX_INT32 MODULO_VALUE; - static FX_INT32 LOG[256]; - static FX_INT32 ALOG[256]; + static int32_t FACTOR_SETS[]; + static int32_t FACTORS[][100]; + static int32_t MODULO_VALUE; + static int32_t LOG[256]; + static int32_t ALOG[256]; private: - static CFX_WideString createECCBlock(CFX_WideString codewords, FX_INT32 numECWords, FX_INT32 &e); - static CFX_WideString createECCBlock(CFX_WideString codewords, FX_INT32 start, FX_INT32 len, FX_INT32 numECWords, FX_INT32 &e); + static CFX_WideString createECCBlock(CFX_WideString codewords, int32_t numECWords, int32_t &e); + static CFX_WideString createECCBlock(CFX_WideString codewords, int32_t start, int32_t len, int32_t numECWords, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp index 5b46612d62..3866f45a5e 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp @@ -60,16 +60,16 @@ CFX_ByteArray& CBC_HighLevelEncoder::getBytesForMessage(CFX_WideString msg) { CFX_ByteString bytestr; CBC_UtilCodingConvert::UnicodeToUTF8(msg, bytestr); - for (FX_INT32 i = 0; i < bytestr.GetLength(); i++) { + for (int32_t i = 0; i < bytestr.GetLength(); i++) { m_bytearray.Add(bytestr.GetAt(i)); } return m_bytearray; } -CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e) +CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, int32_t &e) { return encodeHighLevel(msg, ecLevel, FORCE_NONE, NULL, NULL, e); } -CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_INT32 &e) +CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, int32_t &e) { CBC_EncoderContext context(msg, ecLevel, e); BC_EXCEPTION_CHECK_ReturnValue(e, (FX_LPWSTR)""); @@ -91,11 +91,11 @@ CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_Wi encoders.Add(FX_NEW CBC_X12Encoder()); encoders.Add(FX_NEW CBC_EdifactEncoder()); encoders.Add(FX_NEW CBC_Base256Encoder()); - FX_INT32 encodingMode = ASCII_ENCODATION; + int32_t encodingMode = ASCII_ENCODATION; while (context.hasMoreCharacters()) { ((CBC_Encoder*)encoders.GetAt(encodingMode))->Encode(context, e); if (e != BCExceptionNO) { - for (FX_INT32 i = 0; i < encoders.GetSize(); i++) { + for (int32_t i = 0; i < encoders.GetSize(); i++) { delete (CBC_Encoder*)encoders.GetAt(i); } encoders.RemoveAll(); @@ -106,16 +106,16 @@ CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_Wi context.resetEncoderSignal(); } } - FX_INT32 len = context.m_codewords.GetLength(); + int32_t len = context.m_codewords.GetLength(); context.updateSymbolInfo(e); if (e != BCExceptionNO) { - for (FX_INT32 i = 0; i < encoders.GetSize(); i++) { + for (int32_t i = 0; i < encoders.GetSize(); i++) { delete (CBC_Encoder*)encoders.GetAt(i); } encoders.RemoveAll(); return (FX_LPWSTR)""; } - FX_INT32 capacity = context.m_symbolInfo->m_dataCapacity; + int32_t capacity = context.m_symbolInfo->m_dataCapacity; if (len < capacity) { if (encodingMode != ASCII_ENCODATION && encodingMode != BASE256_ENCODATION) { context.writeCodeword(0x00fe); @@ -128,13 +128,13 @@ CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_Wi while (codewords.GetLength() < capacity) { codewords += (randomize253State(PAD, codewords.GetLength() + 1)); } - for (FX_INT32 i = 0; i < encoders.GetSize(); i++) { + for (int32_t i = 0; i < encoders.GetSize(); i++) { delete (CBC_Encoder*)encoders.GetAt(i); } encoders.RemoveAll(); return codewords; } -FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startpos, FX_INT32 currentMode) +int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, int32_t startpos, int32_t currentMode) { if (startpos >= msg.GetLength()) { return currentMode; @@ -156,7 +156,7 @@ FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startp charCounts.Add(2.25f); charCounts[currentMode] = 0; } - FX_INT32 charsProcessed = 0; + int32_t charsProcessed = 0; while (TRUE) { if ((startpos + charsProcessed) == msg.GetLength()) { FX_DWORD min = Integer_MAX_VALUE; @@ -165,7 +165,7 @@ FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startp CFX_Int32Array intCharCounts; intCharCounts.SetSize(6); min = findMinimums(charCounts, intCharCounts, min, mins); - FX_INT32 minCount = getMinimumCount(mins); + int32_t minCount = getMinimumCount(mins); if (intCharCounts[ASCII_ENCODATION] == min) { return ASCII_ENCODATION; } @@ -233,7 +233,7 @@ FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startp CFX_ByteArray mins; mins.SetSize(6); findMinimums(charCounts, intCharCounts, Integer_MAX_VALUE, mins); - FX_INT32 minCount = getMinimumCount(mins); + int32_t minCount = getMinimumCount(mins); if (intCharCounts[ASCII_ENCODATION] < intCharCounts[BASE256_ENCODATION] && intCharCounts[ASCII_ENCODATION] < intCharCounts[C40_ENCODATION] && intCharCounts[ASCII_ENCODATION] < intCharCounts[TEXT_ENCODATION] @@ -262,7 +262,7 @@ FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startp return C40_ENCODATION; } if (intCharCounts[C40_ENCODATION] == intCharCounts[X12_ENCODATION]) { - FX_INT32 p = startpos + charsProcessed + 1; + int32_t p = startpos + charsProcessed + 1; while (p < msg.GetLength()) { FX_WCHAR tc = msg.GetAt(p); if (isX12TermSep(tc)) { @@ -287,11 +287,11 @@ FX_BOOL CBC_HighLevelEncoder::isExtendedASCII(FX_WCHAR ch) { return ch >= 128 && ch <= 255; } -FX_INT32 CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos) +int32_t CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg, int32_t startpos) { - FX_INT32 count = 0; - FX_INT32 len = msg.GetLength(); - FX_INT32 idx = startpos; + int32_t count = 0; + int32_t len = msg.GetLength(); + int32_t idx = startpos; if (idx < len) { FX_WCHAR ch = msg.GetAt(idx); while (isDigit(ch) && idx < len) { @@ -304,28 +304,28 @@ FX_INT32 CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg } return count; } -void CBC_HighLevelEncoder::illegalCharacter(FX_WCHAR c, FX_INT32 &e) +void CBC_HighLevelEncoder::illegalCharacter(FX_WCHAR c, int32_t &e) { e = BCExceptionIllegalArgument; } -FX_WCHAR CBC_HighLevelEncoder::randomize253State(FX_WCHAR ch, FX_INT32 codewordPosition) +FX_WCHAR CBC_HighLevelEncoder::randomize253State(FX_WCHAR ch, int32_t codewordPosition) { - FX_INT32 pseudoRandom = ((149 * codewordPosition) % 253) + 1; - FX_INT32 tempVariable = ch + pseudoRandom; + int32_t pseudoRandom = ((149 * codewordPosition) % 253) + 1; + int32_t tempVariable = ch + pseudoRandom; return tempVariable <= 254 ? (FX_WCHAR) tempVariable : (FX_WCHAR) (tempVariable - 254); } -FX_INT32 CBC_HighLevelEncoder::findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, FX_INT32 min, CFX_ByteArray &mins) +int32_t CBC_HighLevelEncoder::findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, int32_t min, CFX_ByteArray &mins) { - for (FX_INT32 l = 0; l < mins.GetSize(); l++) { - mins[l] = (FX_BYTE)0; + for (int32_t l = 0; l < mins.GetSize(); l++) { + mins[l] = (uint8_t)0; } - for (FX_INT32 i = 0; i < 6; i++) { - intCharCounts[i] = (FX_INT32)ceil(charCounts[i]); - FX_INT32 current = intCharCounts[i]; + for (int32_t i = 0; i < 6; i++) { + intCharCounts[i] = (int32_t)ceil(charCounts[i]); + int32_t current = intCharCounts[i]; if (min > current) { min = current; - for (FX_INT32 j = 0; j < mins.GetSize(); j++) { - mins[j] = (FX_BYTE)0; + for (int32_t j = 0; j < mins.GetSize(); j++) { + mins[j] = (uint8_t)0; } } if (min == current) { @@ -334,10 +334,10 @@ FX_INT32 CBC_HighLevelEncoder::findMinimums(CFX_FloatArray &charCounts, CFX_Int3 } return min; } -FX_INT32 CBC_HighLevelEncoder::getMinimumCount(CFX_ByteArray &mins) +int32_t CBC_HighLevelEncoder::getMinimumCount(CFX_ByteArray &mins) { - FX_INT32 minCount = 0; - for (FX_INT32 i = 0; i < 6; i++) { + int32_t minCount = 0; + for (int32_t i = 0; i < 6; i++) { minCount += mins[i]; } return minCount; diff --git a/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h index 170ca9f8fa..c2bfdccb1b 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h @@ -20,13 +20,13 @@ public: CBC_HighLevelEncoder(); virtual ~CBC_HighLevelEncoder(); CFX_ByteArray& getBytesForMessage(CFX_WideString msg); - static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e); - static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_INT32 &e); - static FX_INT32 lookAheadTest(CFX_WideString msg, FX_INT32 startpos, FX_INT32 currentMode); + static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, int32_t &e); + static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, int32_t &e); + 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 FX_INT32 determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos); - static void illegalCharacter(FX_WCHAR c, FX_INT32 &e); + static int32_t determineConsecutiveDigitCount(CFX_WideString msg, int32_t startpos); + static void illegalCharacter(FX_WCHAR c, int32_t &e); public: static FX_WCHAR LATCH_TO_C40; @@ -46,9 +46,9 @@ private: static const wchar_t MACRO_TRAILER; CFX_ByteArray m_bytearray; private: - static FX_WCHAR randomize253State(FX_WCHAR ch, FX_INT32 codewordPosition); - static FX_INT32 findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, FX_INT32 min, CFX_ByteArray &mins); - static FX_INT32 getMinimumCount(CFX_ByteArray &mins); + static FX_WCHAR randomize253State(FX_WCHAR ch, int32_t codewordPosition); + static int32_t findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, 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); diff --git a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp index 415cbd6b3c..0044683a5c 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp @@ -62,19 +62,19 @@ void CBC_SymbolInfo::Initialize() m_PROD_SYMBOLS[27] = FX_NEW CBC_SymbolInfo(FALSE, 1050, 408, 18, 18, 36, 175, 68); m_PROD_SYMBOLS[28] = FX_NEW CBC_SymbolInfo(FALSE, 1304, 496, 20, 20, 36, 163, 62); m_PROD_SYMBOLS[29] = FX_NEW CBC_DataMatrixSymbolInfo144(); - for (FX_INT32 i = 0; i < SYMBOLS_COUNT; i++) { + for (int32_t i = 0; i < SYMBOLS_COUNT; i++) { m_symbols[i] = m_PROD_SYMBOLS[i]; } } void CBC_SymbolInfo::Finalize() { - for (FX_INT32 i = 0; i < SYMBOLS_COUNT; i++) { + for (int32_t i = 0; i < SYMBOLS_COUNT; i++) { delete m_PROD_SYMBOLS[i]; m_PROD_SYMBOLS[i] = NULL; m_symbols[i] = NULL; } } -CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords, FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions) +CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords, int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions) { m_rectangular = rectangular; m_dataCapacity = dataCapacity; @@ -85,8 +85,8 @@ CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_IN m_rsBlockData = dataCapacity; m_rsBlockError = errorCodewords; } -CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords, FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions, - FX_INT32 rsBlockData, FX_INT32 rsBlockError) +CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords, int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions, + int32_t rsBlockData, int32_t rsBlockError) { m_rectangular = rectangular; m_dataCapacity = dataCapacity; @@ -101,26 +101,26 @@ CBC_SymbolInfo::~CBC_SymbolInfo() { } -CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, FX_INT32 &e) +CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, int32_t &e) { return lookup(dataCodewords, FORCE_NONE, TRUE, e); } -CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_INT32 &e) +CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, SymbolShapeHint shape, int32_t &e) { return lookup(dataCodewords, shape, TRUE, e); } -CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, FX_INT32 &e) +CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, int32_t &e) { SymbolShapeHint shape = allowRectangular ? FORCE_NONE : FORCE_SQUARE; return lookup(dataCodewords, shape, fail, e); } -CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_BOOL fail, FX_INT32 &e) +CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, SymbolShapeHint shape, FX_BOOL fail, int32_t &e) { return lookup(dataCodewords, shape, NULL, NULL, fail, e); } -CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, FX_INT32 &e) +CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, int32_t &e) { - for (FX_INT32 i = 0; i < SYMBOLS_COUNT; i++) { + for (int32_t i = 0; i < SYMBOLS_COUNT; i++) { CBC_SymbolInfo* symbol = m_symbols[i]; if (shape == FORCE_SQUARE && symbol->m_rectangular) { continue; @@ -146,7 +146,7 @@ CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, SymbolShapeHint s } return NULL; } -FX_INT32 CBC_SymbolInfo::getHorizontalDataRegions(FX_INT32 &e) +int32_t CBC_SymbolInfo::getHorizontalDataRegions(int32_t &e) { switch (m_dataRegions) { case 1: @@ -164,7 +164,7 @@ FX_INT32 CBC_SymbolInfo::getHorizontalDataRegions(FX_INT32 &e) return 0; } } -FX_INT32 CBC_SymbolInfo::getVerticalDataRegions(FX_INT32 &e) +int32_t CBC_SymbolInfo::getVerticalDataRegions(int32_t &e) { switch (m_dataRegions) { case 1: @@ -182,39 +182,39 @@ FX_INT32 CBC_SymbolInfo::getVerticalDataRegions(FX_INT32 &e) return 0; } } -FX_INT32 CBC_SymbolInfo::getSymbolDataWidth(FX_INT32 &e) +int32_t CBC_SymbolInfo::getSymbolDataWidth(int32_t &e) { return getHorizontalDataRegions(e) * m_matrixWidth; } -FX_INT32 CBC_SymbolInfo::getSymbolDataHeight(FX_INT32 &e) +int32_t CBC_SymbolInfo::getSymbolDataHeight(int32_t &e) { return getVerticalDataRegions(e) * m_matrixHeight; } -FX_INT32 CBC_SymbolInfo::getSymbolWidth(FX_INT32 &e) +int32_t CBC_SymbolInfo::getSymbolWidth(int32_t &e) { return getSymbolDataWidth(e) + (getHorizontalDataRegions(e) * 2); } -FX_INT32 CBC_SymbolInfo::getSymbolHeight(FX_INT32 &e) +int32_t CBC_SymbolInfo::getSymbolHeight(int32_t &e) { return getSymbolDataHeight(e) + (getVerticalDataRegions(e) * 2); } -FX_INT32 CBC_SymbolInfo::getCodewordCount() +int32_t CBC_SymbolInfo::getCodewordCount() { return m_dataCapacity + m_errorCodewords; } -FX_INT32 CBC_SymbolInfo::getInterleavedBlockCount() +int32_t CBC_SymbolInfo::getInterleavedBlockCount() { return m_dataCapacity / m_rsBlockData; } -FX_INT32 CBC_SymbolInfo::getDataLengthForInterleavedBlock(FX_INT32 index) +int32_t CBC_SymbolInfo::getDataLengthForInterleavedBlock(int32_t index) { return m_rsBlockData; } -FX_INT32 CBC_SymbolInfo::getErrorLengthForInterleavedBlock(FX_INT32 index) +int32_t CBC_SymbolInfo::getErrorLengthForInterleavedBlock(int32_t index) { return m_rsBlockError; } -CFX_WideString CBC_SymbolInfo::toString(FX_INT32 &e) +CFX_WideString CBC_SymbolInfo::toString(int32_t &e) { CFX_WideString sb; sb += (FX_LPWSTR)(m_rectangular ? "Rectangular Symbol:" : "Square Symbol:"); diff --git a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h index 0450a28725..5ace547442 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h +++ b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h @@ -12,42 +12,42 @@ class CBC_SymbolInfo; class CBC_SymbolInfo : public CBC_SymbolShapeHint { public: - CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords, - FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions); + CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords, + int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions); virtual ~CBC_SymbolInfo(); static void Initialize(); static void Finalize(); static void overrideSymbolSet(CBC_SymbolInfo* override); - static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, FX_INT32 &e); - static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_INT32 &e); - static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, FX_INT32 &e); - static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_BOOL fail, FX_INT32 &e); - static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, FX_INT32 &e); - FX_INT32 getHorizontalDataRegions(FX_INT32 &e); - FX_INT32 getVerticalDataRegions(FX_INT32 &e); - FX_INT32 getSymbolDataWidth(FX_INT32 &e); - FX_INT32 getSymbolDataHeight(FX_INT32 &e); - FX_INT32 getSymbolWidth(FX_INT32 &e); - FX_INT32 getSymbolHeight(FX_INT32 &e); - FX_INT32 getCodewordCount(); - FX_INT32 getInterleavedBlockCount(); - FX_INT32 getDataLengthForInterleavedBlock(FX_INT32 index); - FX_INT32 getErrorLengthForInterleavedBlock(FX_INT32 index); - CFX_WideString toString(FX_INT32 &e); + static CBC_SymbolInfo* lookup(int32_t dataCodewords, int32_t &e); + static CBC_SymbolInfo* lookup(int32_t dataCodewords, SymbolShapeHint shape, int32_t &e); + static CBC_SymbolInfo* lookup(int32_t dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, int32_t &e); + static CBC_SymbolInfo* lookup(int32_t dataCodewords, SymbolShapeHint shape, FX_BOOL fail, int32_t &e); + static CBC_SymbolInfo* lookup(int32_t dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, int32_t &e); + int32_t getHorizontalDataRegions(int32_t &e); + int32_t getVerticalDataRegions(int32_t &e); + int32_t getSymbolDataWidth(int32_t &e); + int32_t getSymbolDataHeight(int32_t &e); + int32_t getSymbolWidth(int32_t &e); + int32_t getSymbolHeight(int32_t &e); + int32_t getCodewordCount(); + int32_t getInterleavedBlockCount(); + int32_t getDataLengthForInterleavedBlock(int32_t index); + int32_t getErrorLengthForInterleavedBlock(int32_t index); + CFX_WideString toString(int32_t &e); public: - FX_INT32 m_dataCapacity; - FX_INT32 m_errorCodewords; - FX_INT32 m_matrixWidth; - FX_INT32 m_matrixHeight; - FX_INT32 m_rsBlockData; - FX_INT32 m_rsBlockError; + int32_t m_dataCapacity; + int32_t m_errorCodewords; + int32_t m_matrixWidth; + int32_t m_matrixHeight; + int32_t m_rsBlockData; + int32_t m_rsBlockError; static CBC_SymbolInfo* m_PROD_SYMBOLS[30]; private: static CBC_SymbolInfo* m_symbols[30]; FX_BOOL m_rectangular; - FX_INT32 m_dataRegions; + int32_t m_dataRegions; private: - CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords, FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions, - FX_INT32 rsBlockData, FX_INT32 rsBlockError); + CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords, int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions, + int32_t rsBlockData, int32_t rsBlockError); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp index 45abec4d4a..afccce598f 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp @@ -36,11 +36,11 @@ CBC_TextEncoder::CBC_TextEncoder() CBC_TextEncoder::~CBC_TextEncoder() { } -FX_INT32 CBC_TextEncoder::getEncodingMode() +int32_t CBC_TextEncoder::getEncodingMode() { return TEXT_ENCODATION; } -FX_INT32 CBC_TextEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) +int32_t CBC_TextEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e) { if (c == ' ') { sb += (FX_WCHAR)'\3'; @@ -92,7 +92,7 @@ FX_INT32 CBC_TextEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e if (c >= 0x0080) { sb += (FX_WCHAR)'\1'; sb += (FX_WCHAR)0x001e; - FX_INT32 len = 2; + int32_t len = 2; len += encodeChar((FX_WCHAR) (c - 128), sb, e); BC_EXCEPTION_CHECK_ReturnValue(e, -1); return len; diff --git a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h index f1168679a6..7d46e92d5d 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h @@ -12,7 +12,7 @@ class CBC_TextEncoder : public CBC_C40Encoder public: CBC_TextEncoder(); virtual ~CBC_TextEncoder(); - FX_INT32 getEncodingMode(); - FX_INT32 encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e); + int32_t getEncodingMode(); + int32_t encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp index f6263f6777..7f56de7aed 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp @@ -36,11 +36,11 @@ CBC_X12Encoder::CBC_X12Encoder() CBC_X12Encoder::~CBC_X12Encoder() { } -FX_INT32 CBC_X12Encoder::getEncodingMode() +int32_t CBC_X12Encoder::getEncodingMode() { return X12_ENCODATION; } -void CBC_X12Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) +void CBC_X12Encoder::Encode(CBC_EncoderContext &context, int32_t &e) { CFX_WideString buffer; while (context.hasMoreCharacters()) { @@ -50,10 +50,10 @@ void CBC_X12Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) if (e != BCExceptionNO) { return; } - FX_INT32 count = buffer.GetLength(); + int32_t count = buffer.GetLength(); if ((count % 3) == 0) { writeNextTriplet(context, buffer); - FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); + int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); if (newMode != getEncodingMode()) { context.signalEncoderChange(newMode); break; @@ -62,14 +62,14 @@ void CBC_X12Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) } handleEOD(context, buffer, e); } -void CBC_X12Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e) +void CBC_X12Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, int32_t &e) { context.updateSymbolInfo(e); if (e != BCExceptionNO) { return; } - FX_INT32 available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount(); - FX_INT32 count = buffer.GetLength(); + int32_t available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount(); + int32_t count = buffer.GetLength(); if (count == 2) { context.writeCodeword(CBC_HighLevelEncoder::X12_UNLATCH); context.m_pos -= 2; @@ -82,7 +82,7 @@ void CBC_X12Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buff context.signalEncoderChange(ASCII_ENCODATION); } } -FX_INT32 CBC_X12Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) +int32_t CBC_X12Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e) { if (c == '\r') { sb += (FX_WCHAR)'\0'; diff --git a/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h b/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h index 21111bc5cc..210f07a5d9 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h @@ -13,9 +13,9 @@ class CBC_X12Encoder : public CBC_C40Encoder public: CBC_X12Encoder(); virtual ~CBC_X12Encoder(); - FX_INT32 getEncodingMode(); - void Encode(CBC_EncoderContext &context, FX_INT32 &e); - void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e); - FX_INT32 encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e); + int32_t getEncodingMode(); + void Encode(CBC_EncoderContext &context, int32_t &e); + void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, int32_t &e); + int32_t encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OneDReader.cpp b/xfa/src/fxbarcode/oned/BC_OneDReader.cpp index 1079c348d0..810b2c70c7 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDReader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OneDReader.cpp @@ -25,44 +25,44 @@ #include "../BC_BinaryBitmap.h" #include "../common/BC_CommonBitArray.h" #include "BC_OneDReader.h" -const FX_INT32 CBC_OneDReader::INTEGER_MATH_SHIFT = 8; -const FX_INT32 CBC_OneDReader::PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << 8; +const int32_t CBC_OneDReader::INTEGER_MATH_SHIFT = 8; +const int32_t CBC_OneDReader::PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << 8; CBC_OneDReader::CBC_OneDReader() { } CBC_OneDReader::~CBC_OneDReader() { } -CFX_ByteString CBC_OneDReader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e) +CFX_ByteString CBC_OneDReader::Decode(CBC_BinaryBitmap *image, int32_t &e) { CFX_ByteString strtemp = Decode(image, 0, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); return strtemp; } -CFX_ByteString CBC_OneDReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_OneDReader::Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e) { CFX_ByteString strtemp = DeDecode(image, hints, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); return strtemp; } -CFX_ByteString CBC_OneDReader::DeDecode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_OneDReader::DeDecode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e) { - FX_INT32 width = image->GetWidth(); - FX_INT32 height = image->GetHeight(); + int32_t width = image->GetWidth(); + int32_t height = image->GetHeight(); CBC_CommonBitArray *row = NULL; - FX_INT32 middle = height >> 1; + int32_t middle = height >> 1; FX_BOOL tryHarder = FALSE; - FX_INT32 rowStep = FX_MAX(1, height >> (tryHarder ? 8 : 5)); - FX_INT32 maxLines; + int32_t rowStep = FX_MAX(1, height >> (tryHarder ? 8 : 5)); + int32_t maxLines; if (tryHarder) { maxLines = height; } else { maxLines = 15; } - for (FX_INT32 x = 0; x < maxLines; x++) { - FX_INT32 rowStepsAboveOrBelow = (x + 1) >> 1; + for (int32_t x = 0; x < maxLines; x++) { + int32_t rowStepsAboveOrBelow = (x + 1) >> 1; FX_BOOL isAbove = (x & 0x01) == 0; - FX_INT32 rowNumber = middle + rowStep * (isAbove ? rowStepsAboveOrBelow : -rowStepsAboveOrBelow); + int32_t rowNumber = middle + rowStep * (isAbove ? rowStepsAboveOrBelow : -rowStepsAboveOrBelow); if (rowNumber < 0 || rowNumber >= height) { break; } @@ -75,7 +75,7 @@ CFX_ByteString CBC_OneDReader::DeDecode(CBC_BinaryBitmap *image, FX_INT32 hints, } continue; } - for (FX_INT32 attempt = 0; attempt < 2; attempt++) { + for (int32_t attempt = 0; attempt < 2; attempt++) { if (attempt == 1) { row->Reverse(); } @@ -98,20 +98,20 @@ CFX_ByteString CBC_OneDReader::DeDecode(CBC_BinaryBitmap *image, FX_INT32 hints, e = BCExceptionNotFound; return ""; } -void CBC_OneDReader::RecordPattern(CBC_CommonBitArray *row, FX_INT32 start, CFX_Int32Array *counters, FX_INT32 &e) +void CBC_OneDReader::RecordPattern(CBC_CommonBitArray *row, int32_t start, CFX_Int32Array *counters, int32_t &e) { - FX_INT32 numCounters = counters->GetSize(); - for (FX_INT32 i = 0; i < numCounters; i++) { + int32_t numCounters = counters->GetSize(); + for (int32_t i = 0; i < numCounters; i++) { (*counters)[i] = 0; } - FX_INT32 end = row->GetSize(); + int32_t end = row->GetSize(); if (start >= end) { e = BCExceptionNotFound; return; } FX_BOOL isWhite = !row->Get(start); - FX_INT32 counterPosition = 0; - FX_INT32 j = start; + int32_t counterPosition = 0; + int32_t j = start; while (j < end) { FX_BOOL pixel = row->Get(j); if (pixel ^ isWhite) { @@ -132,9 +132,9 @@ void CBC_OneDReader::RecordPattern(CBC_CommonBitArray *row, FX_INT32 start, CFX_ return; } } -void CBC_OneDReader::RecordPatternInReverse(CBC_CommonBitArray *row, FX_INT32 start, CFX_Int32Array *counters, FX_INT32 &e) +void CBC_OneDReader::RecordPatternInReverse(CBC_CommonBitArray *row, int32_t start, CFX_Int32Array *counters, int32_t &e) { - FX_INT32 numTransitionsLeft = counters->GetSize(); + int32_t numTransitionsLeft = counters->GetSize(); FX_BOOL last = row->Get(start); while (start > 0 && numTransitionsLeft >= 0) { if (row->Get(--start) != last) { @@ -149,12 +149,12 @@ void CBC_OneDReader::RecordPatternInReverse(CBC_CommonBitArray *row, FX_INT32 st RecordPattern(row, start + 1, counters, e); BC_EXCEPTION_CHECK_ReturnVoid(e); } -FX_INT32 CBC_OneDReader::PatternMatchVariance(CFX_Int32Array *counters, const FX_INT32 *pattern, FX_INT32 maxIndividualVariance) +int32_t CBC_OneDReader::PatternMatchVariance(CFX_Int32Array *counters, const int32_t *pattern, int32_t maxIndividualVariance) { - FX_INT32 numCounters = counters->GetSize(); - FX_INT32 total = 0; - FX_INT32 patternLength = 0; - for (FX_INT32 i = 0; i < numCounters; i++) { + int32_t numCounters = counters->GetSize(); + int32_t total = 0; + int32_t patternLength = 0; + for (int32_t i = 0; i < numCounters; i++) { total += (*counters)[i]; patternLength += pattern[i]; } @@ -162,13 +162,13 @@ FX_INT32 CBC_OneDReader::PatternMatchVariance(CFX_Int32Array *counters, const FX #undef max return FXSYS_IntMax; } - FX_INT32 unitBarWidth = (total << INTEGER_MATH_SHIFT) / patternLength; + int32_t unitBarWidth = (total << INTEGER_MATH_SHIFT) / patternLength; maxIndividualVariance = (maxIndividualVariance * unitBarWidth) >> INTEGER_MATH_SHIFT; - FX_INT32 totalVariance = 0; - for (FX_INT32 x = 0; x < numCounters; x++) { - FX_INT32 counter = (*counters)[x] << INTEGER_MATH_SHIFT; - FX_INT32 scaledPattern = pattern[x] * unitBarWidth; - FX_INT32 variance = counter > scaledPattern ? counter - scaledPattern : scaledPattern - counter; + int32_t totalVariance = 0; + for (int32_t x = 0; x < numCounters; x++) { + int32_t counter = (*counters)[x] << INTEGER_MATH_SHIFT; + int32_t scaledPattern = pattern[x] * unitBarWidth; + int32_t variance = counter > scaledPattern ? counter - scaledPattern : scaledPattern - counter; if (variance > maxIndividualVariance) { #undef max return FXSYS_IntMax; diff --git a/xfa/src/fxbarcode/oned/BC_OneDReader.h b/xfa/src/fxbarcode/oned/BC_OneDReader.h index 8645c9edf9..064f5edae0 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDReader.h +++ b/xfa/src/fxbarcode/oned/BC_OneDReader.h @@ -15,20 +15,20 @@ class CBC_OneDReader : public CBC_Reader public: CBC_OneDReader(); virtual ~CBC_OneDReader(); - virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e); - virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e); - virtual CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e) + virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e); + virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e); + virtual CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e) { return ""; } private: - CFX_ByteString DeDecode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e); + CFX_ByteString DeDecode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e); protected: - const static FX_INT32 INTEGER_MATH_SHIFT; - const static FX_INT32 PATTERN_MATCH_RESULT_SCALE_FACTOR; - void RecordPattern(CBC_CommonBitArray *row, FX_INT32 start, CFX_Int32Array *counters, FX_INT32 &e); - void RecordPatternInReverse(CBC_CommonBitArray *row, FX_INT32 start, CFX_Int32Array *counters, FX_INT32 &e); - FX_INT32 PatternMatchVariance(CFX_Int32Array *counters, const FX_INT32 *pattern, FX_INT32 maxIndividualVariance); + const static int32_t INTEGER_MATH_SHIFT; + const static int32_t PATTERN_MATCH_RESULT_SCALE_FACTOR; + void RecordPattern(CBC_CommonBitArray *row, int32_t start, CFX_Int32Array *counters, int32_t &e); + void RecordPatternInReverse(CBC_CommonBitArray *row, int32_t start, CFX_Int32Array *counters, int32_t &e); + int32_t PatternMatchVariance(CFX_Int32Array *counters, const int32_t *pattern, int32_t maxIndividualVariance); }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OneDimReader.cpp b/xfa/src/fxbarcode/oned/BC_OneDimReader.cpp index f1db94a6a1..a2dd7a1972 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDimReader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OneDimReader.cpp @@ -25,11 +25,11 @@ #include "../common/BC_CommonBitArray.h" #include "BC_OneDReader.h" #include "BC_OneDimReader.h" -const FX_INT32 CBC_OneDimReader::MAX_AVG_VARIANCE = (FX_INT32)(256 * 0.48f); -const FX_INT32 CBC_OneDimReader::MAX_INDIVIDUAL_VARIANCE = (FX_INT32)(256 * 0.7f); -const FX_INT32 CBC_OneDimReader::START_END_PATTERN[3] = {1, 1, 1}; -const FX_INT32 CBC_OneDimReader::MIDDLE_PATTERN[5] = {1, 1, 1, 1, 1}; -const FX_INT32 CBC_OneDimReader::L_PATTERNS[10][4] = { +const int32_t CBC_OneDimReader::MAX_AVG_VARIANCE = (int32_t)(256 * 0.48f); +const int32_t CBC_OneDimReader::MAX_INDIVIDUAL_VARIANCE = (int32_t)(256 * 0.7f); +const int32_t CBC_OneDimReader::START_END_PATTERN[3] = {1, 1, 1}; +const int32_t CBC_OneDimReader::MIDDLE_PATTERN[5] = {1, 1, 1, 1, 1}; +const int32_t CBC_OneDimReader::L_PATTERNS[10][4] = { {3, 2, 1, 1}, {2, 2, 2, 1}, {2, 1, 2, 2}, @@ -41,7 +41,7 @@ const FX_INT32 CBC_OneDimReader::L_PATTERNS[10][4] = { {1, 2, 1, 3}, {3, 1, 1, 2} }; -const FX_INT32 CBC_OneDimReader::L_AND_G_PATTERNS[20][4] = { +const int32_t CBC_OneDimReader::L_AND_G_PATTERNS[20][4] = { {3, 2, 1, 1}, {2, 2, 2, 1}, {2, 1, 2, 2}, @@ -69,7 +69,7 @@ CBC_OneDimReader::CBC_OneDimReader() CBC_OneDimReader::~CBC_OneDimReader() { } -CFX_Int32Array *CBC_OneDimReader::FindStartGuardPattern(CBC_CommonBitArray *row, FX_INT32 &e) +CFX_Int32Array *CBC_OneDimReader::FindStartGuardPattern(CBC_CommonBitArray *row, int32_t &e) { FX_BOOL foundStart = FALSE; CFX_Int32Array *startRange = NULL; @@ -78,7 +78,7 @@ CFX_Int32Array *CBC_OneDimReader::FindStartGuardPattern(CBC_CommonBitArray *row, startEndPattern[0] = START_END_PATTERN[0]; startEndPattern[1] = START_END_PATTERN[1]; startEndPattern[2] = START_END_PATTERN[2]; - FX_INT32 nextStart = 0; + int32_t nextStart = 0; while (!foundStart) { if(startRange != NULL) { delete startRange; @@ -86,12 +86,12 @@ CFX_Int32Array *CBC_OneDimReader::FindStartGuardPattern(CBC_CommonBitArray *row, } startRange = FindGuardPattern(row, nextStart, FALSE, &startEndPattern, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 start = (*startRange)[0]; + int32_t start = (*startRange)[0]; nextStart = (*startRange)[1]; if (start <= 1) { break; } - FX_INT32 quietStart = start - (nextStart - start); + int32_t quietStart = start - (nextStart - start); if (quietStart >= 0) { FX_BOOL booT = row->IsRange(quietStart, start, FALSE, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); @@ -100,7 +100,7 @@ CFX_Int32Array *CBC_OneDimReader::FindStartGuardPattern(CBC_CommonBitArray *row, } return startRange; } -CFX_ByteString CBC_OneDimReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_OneDimReader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e) { CFX_Int32Array* StartPattern = FindStartGuardPattern(row, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); @@ -109,10 +109,10 @@ CFX_ByteString CBC_OneDimReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArra BC_EXCEPTION_CHECK_ReturnValue(e, ""); return temp; } -CFX_ByteString CBC_OneDimReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_OneDimReader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, int32_t hints, int32_t &e) { CFX_ByteString result; - FX_INT32 endStart = DecodeMiddle(row, startGuardRange, result, e); + int32_t endStart = DecodeMiddle(row, startGuardRange, result, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); FX_BOOL b = CheckChecksum(result, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); @@ -122,21 +122,21 @@ CFX_ByteString CBC_OneDimReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArra } return result; } -FX_BOOL CBC_OneDimReader::CheckChecksum(CFX_ByteString &s, FX_INT32 &e) +FX_BOOL CBC_OneDimReader::CheckChecksum(CFX_ByteString &s, int32_t &e) { FX_BOOL temp = CheckStandardUPCEANChecksum(s, e); BC_EXCEPTION_CHECK_ReturnValue(e, FALSE); return temp; } -FX_BOOL CBC_OneDimReader::CheckStandardUPCEANChecksum(CFX_ByteString &s, FX_INT32 &e) +FX_BOOL CBC_OneDimReader::CheckStandardUPCEANChecksum(CFX_ByteString &s, int32_t &e) { - FX_INT32 length = s.GetLength(); + int32_t length = s.GetLength(); if (length == 0) { return FALSE; } - FX_INT32 sum = 0; - for (FX_INT32 i = length - 2; i >= 0; i -= 2) { - FX_INT32 digit = (FX_INT32) s[i] - (FX_INT32) '0'; + int32_t sum = 0; + for (int32_t i = length - 2; i >= 0; i -= 2) { + int32_t digit = (int32_t) s[i] - (int32_t) '0'; if (digit < 0 || digit > 9) { e = BCExceptionFormatException; return FALSE; @@ -144,8 +144,8 @@ FX_BOOL CBC_OneDimReader::CheckStandardUPCEANChecksum(CFX_ByteString &s, FX_INT3 sum += digit; } sum *= 3; - for (FX_INT32 j = length - 1; j >= 0; j -= 2) { - FX_INT32 digit = (FX_INT32) s[j] - (FX_INT32) '0'; + for (int32_t j = length - 1; j >= 0; j -= 2) { + int32_t digit = (int32_t) s[j] - (int32_t) '0'; if (digit < 0 || digit > 9) { e = BCExceptionFormatException; return FALSE; @@ -154,7 +154,7 @@ FX_BOOL CBC_OneDimReader::CheckStandardUPCEANChecksum(CFX_ByteString &s, FX_INT3 } return sum % 10 == 0; } -CFX_Int32Array *CBC_OneDimReader::DecodeEnd(CBC_CommonBitArray* row, FX_INT32 endStart, FX_INT32 &e) +CFX_Int32Array *CBC_OneDimReader::DecodeEnd(CBC_CommonBitArray* row, int32_t endStart, int32_t &e) { CFX_Int32Array startEndPattern; startEndPattern.Add(START_END_PATTERN[0]); @@ -164,12 +164,12 @@ CFX_Int32Array *CBC_OneDimReader::DecodeEnd(CBC_CommonBitArray* row, FX_INT32 en BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return FindGuard; } -CFX_Int32Array *CBC_OneDimReader::FindGuardPattern(CBC_CommonBitArray *row, FX_INT32 rowOffset, FX_BOOL whiteFirst, CFX_Int32Array *pattern, FX_INT32 &e) +CFX_Int32Array *CBC_OneDimReader::FindGuardPattern(CBC_CommonBitArray *row, int32_t rowOffset, FX_BOOL whiteFirst, CFX_Int32Array *pattern, int32_t &e) { - FX_INT32 patternLength = pattern->GetSize(); + int32_t patternLength = pattern->GetSize(); CFX_Int32Array counters; counters.SetSize(patternLength); - FX_INT32 width = row->GetSize(); + int32_t width = row->GetSize(); FX_BOOL isWhite = FALSE; while (rowOffset < width) { isWhite = !row->Get(rowOffset); @@ -178,9 +178,9 @@ CFX_Int32Array *CBC_OneDimReader::FindGuardPattern(CBC_CommonBitArray *row, FX_I } rowOffset++; } - FX_INT32 counterPosition = 0; - FX_INT32 patternStart = rowOffset; - for (FX_INT32 x = rowOffset; x < width; x++) { + int32_t counterPosition = 0; + int32_t patternStart = rowOffset; + for (int32_t x = rowOffset; x < width; x++) { FX_BOOL pixel = row->Get(x); if (pixel ^ isWhite) { counters[counterPosition]++; @@ -194,7 +194,7 @@ CFX_Int32Array *CBC_OneDimReader::FindGuardPattern(CBC_CommonBitArray *row, FX_I return result; } patternStart += counters[0] + counters[1]; - for (FX_INT32 y = 2; y < patternLength; y++) { + for (int32_t y = 2; y < patternLength; y++) { counters[y - 2] = counters[y]; } counters[patternLength - 2] = 0; @@ -211,15 +211,15 @@ CFX_Int32Array *CBC_OneDimReader::FindGuardPattern(CBC_CommonBitArray *row, FX_I BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return NULL; } -FX_INT32 CBC_OneDimReader::DecodeDigit(CBC_CommonBitArray *row, CFX_Int32Array *counters, FX_INT32 rowOffset, const FX_INT32* patterns, FX_INT32 patternLength, FX_INT32 &e) +int32_t CBC_OneDimReader::DecodeDigit(CBC_CommonBitArray *row, CFX_Int32Array *counters, int32_t rowOffset, const int32_t* patterns, int32_t patternLength, int32_t &e) { RecordPattern(row, rowOffset, counters, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); - FX_INT32 bestVariance = MAX_AVG_VARIANCE; - FX_INT32 bestMatch = -1; - FX_INT32 max = patternLength; - for (FX_INT32 i = 0; i < max; i++) { - FX_INT32 variance = PatternMatchVariance(counters, &patterns[i * 4], MAX_INDIVIDUAL_VARIANCE); + int32_t bestVariance = MAX_AVG_VARIANCE; + int32_t bestMatch = -1; + int32_t max = patternLength; + for (int32_t i = 0; i < max; i++) { + int32_t variance = PatternMatchVariance(counters, &patterns[i * 4], MAX_INDIVIDUAL_VARIANCE); if (variance < bestVariance) { bestVariance = variance; bestMatch = i; diff --git a/xfa/src/fxbarcode/oned/BC_OneDimReader.h b/xfa/src/fxbarcode/oned/BC_OneDimReader.h index bb10060ba3..2e644de841 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDimReader.h +++ b/xfa/src/fxbarcode/oned/BC_OneDimReader.h @@ -12,28 +12,28 @@ class CBC_OneDimReader; class CBC_OneDimReader : public CBC_OneDReader { private: - const static FX_INT32 MAX_AVG_VARIANCE; - const static FX_INT32 MAX_INDIVIDUAL_VARIANCE; + const static int32_t MAX_AVG_VARIANCE; + const static int32_t MAX_INDIVIDUAL_VARIANCE; - FX_BOOL CheckStandardUPCEANChecksum(CFX_ByteString &s, FX_INT32 &e); + FX_BOOL CheckStandardUPCEANChecksum(CFX_ByteString &s, int32_t &e); public: - const static FX_INT32 START_END_PATTERN[3]; - const static FX_INT32 MIDDLE_PATTERN[5]; - const static FX_INT32 L_PATTERNS[10][4]; - const static FX_INT32 L_AND_G_PATTERNS[20][4]; + const static int32_t START_END_PATTERN[3]; + const static int32_t MIDDLE_PATTERN[5]; + const static int32_t L_PATTERNS[10][4]; + const static int32_t L_AND_G_PATTERNS[20][4]; CBC_OneDimReader(); virtual ~CBC_OneDimReader(); - CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e); - CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, FX_INT32 hints, FX_INT32 &e); + CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e); + CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, int32_t hints, int32_t &e); protected: - CFX_Int32Array *FindStartGuardPattern(CBC_CommonBitArray *row, FX_INT32 &e); - virtual FX_BOOL CheckChecksum(CFX_ByteString &s, FX_INT32 &e); - CFX_Int32Array *FindGuardPattern(CBC_CommonBitArray *row, FX_INT32 rowOffset, FX_BOOL whiteFirst, CFX_Int32Array *pattern, FX_INT32 &e); - FX_INT32 DecodeDigit(CBC_CommonBitArray *row, CFX_Int32Array *counters, FX_INT32 rowOffset, const FX_INT32* patterns, FX_INT32 patternLength, FX_INT32 &e); - virtual FX_INT32 DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultResult, FX_INT32 &e) + CFX_Int32Array *FindStartGuardPattern(CBC_CommonBitArray *row, int32_t &e); + virtual FX_BOOL CheckChecksum(CFX_ByteString &s, int32_t &e); + CFX_Int32Array *FindGuardPattern(CBC_CommonBitArray *row, int32_t rowOffset, FX_BOOL whiteFirst, CFX_Int32Array *pattern, int32_t &e); + int32_t DecodeDigit(CBC_CommonBitArray *row, CFX_Int32Array *counters, int32_t rowOffset, const int32_t* patterns, int32_t patternLength, int32_t &e); + virtual int32_t DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultResult, int32_t &e) { return 0; } - virtual CFX_Int32Array *DecodeEnd(CBC_CommonBitArray *row, FX_INT32 endStart, FX_INT32 &e); + virtual CFX_Int32Array *DecodeEnd(CBC_CommonBitArray *row, int32_t endStart, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp b/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp index 25f3fa5f6c..a1554a8047 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp +++ b/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp @@ -50,11 +50,11 @@ void CBC_OneDimWriter::SetPrintChecksum(FX_BOOL checksum) { m_bPrintChecksum = checksum; } -void CBC_OneDimWriter::SetDataLength(FX_INT32 length) +void CBC_OneDimWriter::SetDataLength(int32_t length) { m_iDataLenth = length; } -void CBC_OneDimWriter::SetCalcChecksum(FX_INT32 state) +void CBC_OneDimWriter::SetCalcChecksum(int32_t state) { m_bCalcChecksum = state; } @@ -70,7 +70,7 @@ void CBC_OneDimWriter::SetFontSize(FX_FLOAT size) { m_fFontSize = size; } -void CBC_OneDimWriter::SetFontStyle(FX_INT32 style) +void CBC_OneDimWriter::SetFontStyle(int32_t style) { m_iFontStyle = style; } @@ -85,10 +85,10 @@ FX_WCHAR CBC_OneDimWriter::Upper(FX_WCHAR ch) } return ch; } -FX_BYTE* CBC_OneDimWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, - FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) +uint8_t* CBC_OneDimWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, + int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) { - FX_BYTE *ret = NULL; + uint8_t *ret = NULL; outHeight = 1; if (m_Width >= 20) { ret = Encode(contents, outWidth, e); @@ -98,23 +98,23 @@ FX_BYTE* CBC_OneDimWriter::Encode(const CFX_ByteString &contents, BCFORMAT forma BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -FX_BYTE *CBC_OneDimWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, - FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t *CBC_OneDimWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, + int32_t &outWidth, int32_t &outHeight, int32_t &e) { - FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0, e); + uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -FX_INT32 CBC_OneDimWriter::AppendPattern(FX_BYTE* target, FX_INT32 pos, const FX_INT32* pattern , FX_INT32 patternLength, FX_INT32 startColor, FX_INT32 &e) +int32_t CBC_OneDimWriter::AppendPattern(uint8_t* target, int32_t pos, const int32_t* pattern , int32_t patternLength, int32_t startColor, int32_t &e) { if (startColor != 0 && startColor != 1) { e = BCExceptionValueMustBeEither0or1; return 0; } - FX_BYTE color = (FX_BYTE) startColor; - FX_INT32 numAdded = 0; - for (FX_INT32 i = 0; i < patternLength; i++) { - for (FX_INT32 j = 0; j < pattern[i]; j++) { + uint8_t color = (uint8_t) startColor; + int32_t numAdded = 0; + for (int32_t i = 0; i < patternLength; i++) { + for (int32_t j = 0; j < pattern[i]; j++) { target[pos] = color; pos += 1; numAdded += 1; @@ -123,20 +123,20 @@ FX_INT32 CBC_OneDimWriter::AppendPattern(FX_BYTE* target, FX_INT32 pos, const FX } return numAdded; } -void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS *charPos, CFX_Font *cFont, FX_FLOAT geWidth, FX_INT32 fontSize, FX_FLOAT &charsLen) +void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS *charPos, CFX_Font *cFont, FX_FLOAT geWidth, int32_t fontSize, FX_FLOAT &charsLen) { #ifdef FXFM_ENCODING_NONE IFX_FontEncodingEx* encoding = FX_CreateFontEncodingEx(cFont); #else IFX_FontEncoding * encoding = FXGE_CreateUnicodeEncoding(cFont); #endif - FX_INT32 length = text.GetLength(); + int32_t length = text.GetLength(); FX_DWORD *pCharCode = FX_Alloc(FX_DWORD, text.GetLength()); FX_FLOAT charWidth = 0; - for (FX_INT32 j = 0; j < text.GetLength(); j++) { + for (int32_t j = 0; j < text.GetLength(); j++) { pCharCode[j] = encoding->CharCodeFromUnicode(text[j]); - FX_INT32 glyp_code = encoding->GlyphFromCharCode(pCharCode[j]); - FX_INT32 glyp_value = cFont->GetGlyphWidth(glyp_code); + int32_t glyp_code = encoding->GlyphFromCharCode(pCharCode[j]); + int32_t glyp_value = cFont->GetGlyphWidth(glyp_code); FX_FLOAT temp = (FX_FLOAT)((glyp_value) * fontSize / 1000.0); charWidth += temp; } @@ -157,7 +157,7 @@ void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS * charPos[0].m_ExtGID = charPos[0].m_GlyphIndex; #endif penX += (FX_FLOAT)(charPos[0].m_FontCharWidth) * (FX_FLOAT)fontSize / 1000.0f; - for (FX_INT32 i = 1; i < length; i++) { + for (int32_t i = 1; i < length; i++) { charPos[i].m_OriginX = penX + left; charPos[i].m_OriginY = penY + top; charPos[i].m_GlyphIndex = encoding->GlyphFromCharCode(pCharCode[i]); @@ -171,10 +171,10 @@ void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS * delete encoding; encoding = NULL; } -void CBC_OneDimWriter::ShowDeviceChars(CFX_RenderDevice *device, const CFX_Matrix* matrix, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, FX_INT32 barWidth) +void CBC_OneDimWriter::ShowDeviceChars(CFX_RenderDevice *device, const CFX_Matrix* matrix, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, int32_t barWidth) { - FX_INT32 iFontSize = (FX_INT32)fabs(m_fFontSize); - FX_INT32 iTextHeight = iFontSize + 1; + int32_t iFontSize = (int32_t)fabs(m_fFontSize); + int32_t iTextHeight = iFontSize + 1; CFX_FloatRect rect((FX_FLOAT)locX, (FX_FLOAT)locY, (FX_FLOAT)(locX + geWidth), (FX_FLOAT)(locY + iTextHeight)); if (geWidth != m_Width) { rect.right -= 1; @@ -194,10 +194,10 @@ void CBC_OneDimWriter::ShowDeviceChars(CFX_RenderDevice *device, const CFX_Matri (CFX_AffineMatrix *) &affine_matrix, m_fontColor, FXTEXT_CLEARTYPE); } -void CBC_OneDimWriter::ShowBitmapChars(CFX_DIBitmap *pOutBitmap, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, FX_INT32 barWidth) +void CBC_OneDimWriter::ShowBitmapChars(CFX_DIBitmap *pOutBitmap, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, int32_t barWidth) { - FX_INT32 iFontSize = (FX_INT32)fabs(m_fFontSize); - FX_INT32 iTextHeight = iFontSize + 1; + int32_t iFontSize = (int32_t)fabs(m_fFontSize); + int32_t iTextHeight = iFontSize + 1; CFX_FxgeDevice ge; ge.Create((int)geWidth, iTextHeight , m_colorSpace); FX_RECT geRect(0, 0, (int)geWidth, iTextHeight); @@ -214,7 +214,7 @@ void CBC_OneDimWriter::ShowBitmapChars(CFX_DIBitmap *pOutBitmap, const CFX_ByteS geBitmap.Attach(pOutBitmap); geBitmap.SetDIBits(ge.GetBitmap(), (int)locX, (int)locY); } -void CBC_OneDimWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice *device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e) +void CBC_OneDimWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice *device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e) { if (device == NULL && pOutBitmap == NULL) { e = BCExceptionIllegalArgument; @@ -225,7 +225,7 @@ void CBC_OneDimWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX return; } CFX_ByteString str = FX_UTF8Encode(contents); - FX_INT32 iLen = str.GetLength(); + int32_t iLen = str.GetLength(); FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, iLen); if (!pCharPos) { return; @@ -240,17 +240,17 @@ void CBC_OneDimWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX m_locTextLoc == BC_TEXT_LOC_BELOW ) { geWidth = (FX_FLOAT)barWidth; } - FX_INT32 iFontSize = (FX_INT32)fabs(m_fFontSize); - FX_INT32 iTextHeight = iFontSize + 1; + int32_t iFontSize = (int32_t)fabs(m_fFontSize); + int32_t iTextHeight = iFontSize + 1; CalcTextInfo(str, pCharPos, m_pFont, geWidth, iFontSize, charsLen); if (charsLen < 1) { return; } - FX_INT32 locX = 0; - FX_INT32 locY = 0; + int32_t locX = 0; + int32_t locY = 0; switch (m_locTextLoc) { case BC_TEXT_LOC_ABOVEEMBED: - locX = (FX_INT32)(barWidth - charsLen) / 2; + locX = (int32_t)(barWidth - charsLen) / 2; locY = 0; geWidth = charsLen; break; @@ -260,7 +260,7 @@ void CBC_OneDimWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX geWidth = (FX_FLOAT)barWidth; break; case BC_TEXT_LOC_BELOWEMBED: - locX = (FX_INT32)(barWidth - charsLen) / 2; + locX = (int32_t)(barWidth - charsLen) / 2; locY = m_Height - iTextHeight; geWidth = charsLen; break; @@ -278,7 +278,7 @@ void CBC_OneDimWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX } FX_Free(pCharPos); } -void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR contents, FX_INT32 &e) +void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR contents, int32_t &e) { if (m_output == NULL) { BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -289,14 +289,14 @@ void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR con e = BCExceptionFailToCreateBitmap; return; } - for (FX_INT32 x = 0; x < m_output->GetWidth(); x++) { - for (FX_INT32 y = 0; y < m_output->GetHeight(); y++) { + for (int32_t x = 0; x < m_output->GetWidth(); x++) { + for (int32_t y = 0; y < m_output->GetHeight(); y++) { if (m_output->Get(x, y)) { pOutBitmap->SetPixel(x, y, m_barColor); } } } - FX_INT32 i = 0; + int32_t i = 0; for (; i < contents.GetLength(); i++) if (contents.GetAt(i) != ' ') { break; @@ -311,7 +311,7 @@ void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR con } pOutBitmap = pStretchBitmap; } -void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_WSTR contents, FX_INT32 &e) +void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_WSTR contents, int32_t &e) { if (m_output == NULL) { BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -322,8 +322,8 @@ void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Ma device->DrawPath(&path, matrix, &stateData, m_backgroundColor, m_backgroundColor, FXFILL_ALTERNATE); CFX_Matrix matri(m_outputHScale, 0.0, 0.0, (FX_FLOAT)m_Height, 0.0, 0.0); matri.Concat(*matrix); - for (FX_INT32 x = 0; x < m_output->GetWidth(); x++) { - for (FX_INT32 y = 0; y < m_output->GetHeight(); y++) { + for (int32_t x = 0; x < m_output->GetWidth(); x++) { + for (int32_t y = 0; y < m_output->GetHeight(); y++) { CFX_PathData rect; rect.AppendRect((FX_FLOAT)x, (FX_FLOAT)y, (FX_FLOAT)(x + 1), (FX_FLOAT)(y + 1)); CFX_GraphStateData stateData; @@ -332,7 +332,7 @@ void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Ma } } } - FX_INT32 i = 0; + int32_t i = 0; for (; i < contents.GetLength(); i++) if (contents.GetAt(i) != ' ') { break; @@ -342,7 +342,7 @@ void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Ma BC_EXCEPTION_CHECK_ReturnVoid(e); } } -void CBC_OneDimWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e) +void CBC_OneDimWriter::RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e) { if (codeLength < 1) { BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -350,9 +350,9 @@ void CBC_OneDimWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 co if (m_ModuleHeight < 20.0) { m_ModuleHeight = 20; } - FX_INT32 codeOldLength = codeLength; - FX_INT32 leftPadding = 0; - FX_INT32 rightPadding = 0; + int32_t codeOldLength = codeLength; + int32_t leftPadding = 0; + int32_t rightPadding = 0; if (m_bLeftPadding) { leftPadding = 7; } @@ -377,9 +377,9 @@ void CBC_OneDimWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 co } m_multiple = 1; if (!isDevice) { - m_multiple = (FX_INT32)ceil(m_outputHScale * dataLengthScale); + m_multiple = (int32_t)ceil(m_outputHScale * dataLengthScale); } - FX_INT32 outputHeight = 1; + int32_t outputHeight = 1; if (!isDevice) { if (m_Height == 0) { outputHeight = FX_MAX(20, m_ModuleHeight); @@ -387,9 +387,9 @@ void CBC_OneDimWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 co outputHeight = m_Height; } } - FX_INT32 outputWidth = codeLength; + int32_t outputWidth = codeLength; if (!isDevice) { - outputWidth = (FX_INT32)(codeLength * m_multiple / dataLengthScale); + outputWidth = (int32_t)(codeLength * m_multiple / dataLengthScale); } m_barWidth = m_Width; if (!isDevice) { @@ -397,8 +397,8 @@ void CBC_OneDimWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 co } m_output = FX_NEW CBC_CommonBitMatrix; m_output->Init(outputWidth, outputHeight); - FX_INT32 outputX = leftPadding * m_multiple; - for (FX_INT32 inputX = 0; inputX < codeOldLength; inputX++) { + int32_t outputX = leftPadding * m_multiple; + for (int32_t inputX = 0; inputX < codeOldLength; inputX++) { if (code[inputX] == 1) { if (outputX >= outputWidth ) { break; diff --git a/xfa/src/fxbarcode/oned/BC_OneDimWriter.h b/xfa/src/fxbarcode/oned/BC_OneDimWriter.h index cd5d937aca..aeb19e0081 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDimWriter.h +++ b/xfa/src/fxbarcode/oned/BC_OneDimWriter.h @@ -14,17 +14,17 @@ class CBC_OneDimWriter : public CBC_Writer public: CBC_OneDimWriter(); virtual ~CBC_OneDimWriter(); - FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, - FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, - FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e); - virtual FX_BYTE *Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e) + uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, + int32_t &outWidth, int32_t &outHeight, int32_t &e); + uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, + int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e); + virtual uint8_t *Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e) { return NULL; }; - virtual void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e); - virtual void RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR contents, FX_INT32 &e); - virtual void RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_WSTR contents, FX_INT32 &e); + virtual void RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e); + virtual void RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR contents, int32_t &e); + virtual void RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_WSTR contents, int32_t &e); virtual FX_BOOL CheckContentValidity(FX_WSTR contents) { return TRUE; @@ -38,33 +38,33 @@ public: return CFX_WideString(); } virtual void SetPrintChecksum(FX_BOOL checksum); - virtual void SetDataLength(FX_INT32 length); - virtual void SetCalcChecksum(FX_INT32 state); + virtual void SetDataLength(int32_t length); + virtual void SetCalcChecksum(int32_t state); virtual void SetFontSize(FX_FLOAT size); - virtual void SetFontStyle(FX_INT32 style); + virtual void SetFontStyle(int32_t style); virtual void SetFontColor(FX_ARGB color); virtual FX_BOOL SetFont(CFX_Font * cFont); protected: FX_BOOL m_bPrintChecksum; - FX_INT32 m_iDataLenth; + int32_t m_iDataLenth; FX_BOOL m_bCalcChecksum; CFX_Font* m_pFont; FX_FLOAT m_fFontSize; - FX_INT32 m_iFontStyle; + int32_t m_iFontStyle; FX_DWORD m_fontColor; BC_TEXT_LOC m_locTextLoc; - FX_INT32 m_iContentLen; + int32_t m_iContentLen; FX_BOOL m_bLeftPadding; FX_BOOL m_bRightPadding; CBC_CommonBitMatrix* m_output; - FX_INT32 m_barWidth; - FX_INT32 m_multiple; + int32_t m_barWidth; + int32_t m_multiple; FX_FLOAT m_outputHScale; - void CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS *charPos, CFX_Font *cFont, FX_FLOAT geWidth, FX_INT32 fontSize, FX_FLOAT &charsLen); - virtual void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice *device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e); - virtual void ShowBitmapChars(CFX_DIBitmap *pOutBitmap, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, FX_INT32 barWidth); - virtual void ShowDeviceChars(CFX_RenderDevice *device, const CFX_Matrix* matrix, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, FX_INT32 barWidth); - FX_INT32 AppendPattern(FX_BYTE* target, FX_INT32 pos, const FX_INT32* pattern, FX_INT32 patternLength, FX_INT32 startColor, FX_INT32 &e); + void CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS *charPos, CFX_Font *cFont, FX_FLOAT geWidth, int32_t fontSize, FX_FLOAT &charsLen); + virtual void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice *device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e); + virtual void ShowBitmapChars(CFX_DIBitmap *pOutBitmap, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, int32_t barWidth); + virtual void ShowDeviceChars(CFX_RenderDevice *device, const CFX_Matrix* matrix, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, int32_t barWidth); + int32_t AppendPattern(uint8_t* target, int32_t pos, const int32_t* pattern, int32_t patternLength, int32_t startColor, int32_t &e); FX_WCHAR Upper(FX_WCHAR ch); }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp index 5d94d7ac06..ca115391ef 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp @@ -27,12 +27,12 @@ #include "../oned/BC_OnedCode39Reader.h" #include "../oned/BC_OnedCodaBarReader.h" FX_LPCSTR CBC_OnedCodaBarReader::ALPHABET_STRING = "0123456789-$:/.+ABCDTN"; -const FX_INT32 CBC_OnedCodaBarReader::CHARACTER_ENCODINGS[22] = { +const int32_t CBC_OnedCodaBarReader::CHARACTER_ENCODINGS[22] = { 0x003, 0x006, 0x009, 0x060, 0x012, 0x042, 0x021, 0x024, 0x030, 0x048, 0x00c, 0x018, 0x045, 0x051, 0x054, 0x015, 0x01A, 0x029, 0x00B, 0x00E, 0x01A, 0x029 }; -const FX_INT32 CBC_OnedCodaBarReader::minCharacterLength = 3; +const int32_t CBC_OnedCodaBarReader::minCharacterLength = 3; const FX_CHAR CBC_OnedCodaBarReader::STARTEND_ENCODING[8] = {'E', '*', 'A', 'B', 'C', 'D', 'T', 'N'}; CBC_OnedCodaBarReader::CBC_OnedCodaBarReader() { @@ -40,14 +40,14 @@ CBC_OnedCodaBarReader::CBC_OnedCodaBarReader() CBC_OnedCodaBarReader::~CBC_OnedCodaBarReader() { } -CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e) { CFX_Int32Array *int32Ptr = FindAsteriskPattern(row, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); CBC_AutoPtr start(int32Ptr); (*start)[1] = 0; - FX_INT32 nextStart = (*start)[1]; - FX_INT32 end = row->GetSize(); + int32_t nextStart = (*start)[1]; + int32_t end = row->GetSize(); while (nextStart < end && !row->Get(nextStart)) { nextStart++; } @@ -55,7 +55,7 @@ CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi CFX_Int32Array counters; counters.SetSize(7); FX_CHAR decodedChar; - FX_INT32 lastStart; + int32_t lastStart; do { RecordPattern(row, nextStart, &counters, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); @@ -66,18 +66,18 @@ CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi } result += decodedChar; lastStart = nextStart; - for (FX_INT32 i = 0; i < counters.GetSize(); i++) { + for (int32_t i = 0; i < counters.GetSize(); i++) { nextStart += counters[i]; } while (nextStart < end && !row->Get(nextStart)) { nextStart++; } } while (nextStart < end); - FX_INT32 lastPatternSize = 0; - for (FX_INT32 j = 0; j < counters.GetSize(); j++) { + int32_t lastPatternSize = 0; + for (int32_t j = 0; j < counters.GetSize(); j++) { lastPatternSize += counters[j]; } - FX_INT32 whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize; + int32_t whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize; if (nextStart != end && (whiteSpaceAfterEnd / 2 < lastPatternSize)) { e = BCExceptionNotFound; return ""; @@ -91,9 +91,9 @@ CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi e = BCExceptionNotFound; return ""; } - FX_INT32 len = result.GetLength(); + int32_t len = result.GetLength(); CFX_ByteString temp = result; - for (FX_INT32 k = 1; k < result.GetLength(); k++) { + for (int32_t k = 1; k < result.GetLength(); k++) { if (ArrayContains(STARTEND_ENCODING, result[k])) { if ((k + 1) != result.GetLength()) { result.Delete(1, k); @@ -102,7 +102,7 @@ CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi } } if (result.GetLength() < 5) { - FX_INT32 index = temp.Find(result.Mid(1, result.GetLength() - 1)); + int32_t index = temp.Find(result.Mid(1, result.GetLength() - 1)); if (index == len - (result.GetLength() - 1)) { e = BCExceptionNotFound; return ""; @@ -116,23 +116,23 @@ CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi } return result; } -CFX_Int32Array *CBC_OnedCodaBarReader::FindAsteriskPattern(CBC_CommonBitArray *row, FX_INT32 &e) +CFX_Int32Array *CBC_OnedCodaBarReader::FindAsteriskPattern(CBC_CommonBitArray *row, int32_t &e) { - FX_INT32 width = row->GetSize(); - FX_INT32 rowOffset = 0; + int32_t width = row->GetSize(); + int32_t rowOffset = 0; while (rowOffset < width) { if (row->Get(rowOffset)) { break; } rowOffset++; } - FX_INT32 counterPosition = 0; + int32_t counterPosition = 0; CFX_Int32Array counters; counters.SetSize(7); - FX_INT32 patternStart = rowOffset; + int32_t patternStart = rowOffset; FX_BOOL isWhite = FALSE; - FX_INT32 patternLength = counters.GetSize(); - for (FX_INT32 i = rowOffset; i < width; i++) { + int32_t patternLength = counters.GetSize(); + for (int32_t i = rowOffset; i < width; i++) { FX_BOOL pixel = row->Get(i); if (pixel ^ isWhite) { counters[counterPosition]++; @@ -150,7 +150,7 @@ CFX_Int32Array *CBC_OnedCodaBarReader::FindAsteriskPattern(CBC_CommonBitArray *r } } patternStart += counters[0] + counters[1]; - for (FX_INT32 y = 2; y < patternLength; y++) { + for (int32_t y = 2; y < patternLength; y++) { counters[y - 2] = counters[y]; } counters[patternLength - 2] = 0; @@ -168,7 +168,7 @@ CFX_Int32Array *CBC_OnedCodaBarReader::FindAsteriskPattern(CBC_CommonBitArray *r } FX_BOOL CBC_OnedCodaBarReader::ArrayContains(const FX_CHAR array[], FX_CHAR key) { - for(FX_INT32 i = 0; i < 8; i++) { + for(int32_t i = 0; i < 8; i++) { if(array[i] == key) { return TRUE; } @@ -177,26 +177,26 @@ FX_BOOL CBC_OnedCodaBarReader::ArrayContains(const FX_CHAR array[], FX_CHAR key) } FX_CHAR CBC_OnedCodaBarReader::ToNarrowWidePattern(CFX_Int32Array *counter) { - FX_INT32 numCounters = counter->GetSize(); + int32_t numCounters = counter->GetSize(); if (numCounters < 1) { return '!'; } - FX_INT32 averageCounter = 0; - FX_INT32 totalCounters = 0; - for (FX_INT32 i = 0; i < numCounters; i++) { + int32_t averageCounter = 0; + int32_t totalCounters = 0; + for (int32_t i = 0; i < numCounters; i++) { totalCounters += (*counter)[i]; } averageCounter = totalCounters / numCounters; - FX_INT32 pattern = 0; - FX_INT32 wideCounters = 0; - for (FX_INT32 j = 0; j < numCounters; j++) { + int32_t pattern = 0; + int32_t wideCounters = 0; + for (int32_t j = 0; j < numCounters; j++) { if ((*counter)[j] > averageCounter) { pattern |= 1 << (numCounters - 1 - j); wideCounters++; } } if ((wideCounters == 2) || (wideCounters == 3)) { - for (FX_INT32 k = 0; k < 22; k++) { + for (int32_t k = 0; k < 22; k++) { if (CHARACTER_ENCODINGS[k] == pattern) { return (ALPHABET_STRING)[k]; } diff --git a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h index 1d03491841..18aab8ba8d 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h @@ -14,16 +14,16 @@ class CBC_OnedCodaBarReader : public CBC_OneDReader public: CBC_OnedCodaBarReader(); virtual ~CBC_OnedCodaBarReader(); - CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e); - CFX_Int32Array *FindAsteriskPattern(CBC_CommonBitArray *row, FX_INT32 &e); + CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e); + CFX_Int32Array *FindAsteriskPattern(CBC_CommonBitArray *row, int32_t &e); FX_BOOL ArrayContains(const FX_CHAR array[], FX_CHAR key); FX_CHAR ToNarrowWidePattern(CFX_Int32Array *counter); static FX_LPCSTR ALPHABET_STRING; - const static FX_INT32 CHARACTER_ENCODINGS[22]; + const static int32_t CHARACTER_ENCODINGS[22]; - const static FX_INT32 minCharacterLength; + const static int32_t minCharacterLength; const static FX_CHAR STARTEND_ENCODING[8]; }; diff --git a/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp b/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp index 059d2d7df5..0049a54f7c 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp @@ -42,7 +42,7 @@ CBC_OnedCodaBarWriter::~CBC_OnedCodaBarWriter() } FX_BOOL CBC_OnedCodaBarWriter::SetStartChar(FX_CHAR start) { - for (FX_INT32 i = 0; i < sizeof(START_END_CHARS) / sizeof(FX_CHAR); i++) { + for (int32_t i = 0; i < sizeof(START_END_CHARS) / sizeof(FX_CHAR); i++) { if (START_END_CHARS[i] == start) { m_chStart = start; return TRUE; @@ -52,7 +52,7 @@ FX_BOOL CBC_OnedCodaBarWriter::SetStartChar(FX_CHAR start) } FX_BOOL CBC_OnedCodaBarWriter::SetEndChar(FX_CHAR end) { - for (FX_INT32 i = 0; i < sizeof(START_END_CHARS) / sizeof(FX_CHAR); i++) { + for (int32_t i = 0; i < sizeof(START_END_CHARS) / sizeof(FX_CHAR); i++) { if (START_END_CHARS[i] == end) { m_chEnd = end; return TRUE; @@ -60,7 +60,7 @@ FX_BOOL CBC_OnedCodaBarWriter::SetEndChar(FX_CHAR end) } return FALSE; } -void CBC_OnedCodaBarWriter::SetDataLength(FX_INT32 length) +void CBC_OnedCodaBarWriter::SetDataLength(int32_t length) { m_iDataLenth = length + 2; } @@ -72,7 +72,7 @@ FX_BOOL CBC_OnedCodaBarWriter::SetTextLocation(BC_TEXT_LOC location) m_locTextLoc = location; return TRUE; } -FX_BOOL CBC_OnedCodaBarWriter::SetWideNarrowRatio(FX_INT32 ratio) +FX_BOOL CBC_OnedCodaBarWriter::SetWideNarrowRatio(int32_t ratio) { if(ratio < 2 || ratio > 3) { return FALSE; @@ -83,19 +83,19 @@ FX_BOOL CBC_OnedCodaBarWriter::SetWideNarrowRatio(FX_INT32 ratio) FX_BOOL CBC_OnedCodaBarWriter::FindChar(FX_WCHAR ch, FX_BOOL isContent) { if(isContent) { - for(FX_INT32 i = 0 ; i < sizeof(CONTENT_CHARS) / sizeof(FX_CHAR) ; i++) { + for(int32_t i = 0 ; i < sizeof(CONTENT_CHARS) / sizeof(FX_CHAR) ; i++) { if(ch == (FX_WCHAR)CONTENT_CHARS[i]) { return TRUE; } } - for(FX_INT32 j = 0 ; j < sizeof(START_END_CHARS) / sizeof(FX_CHAR) ; j++) { + for(int32_t j = 0 ; j < sizeof(START_END_CHARS) / sizeof(FX_CHAR) ; j++) { if(ch == (FX_WCHAR)START_END_CHARS[j]) { return TRUE; } } return FALSE; } else { - for(FX_INT32 i = 0 ; i < sizeof(CONTENT_CHARS) / sizeof(FX_CHAR) ; i++) { + for(int32_t i = 0 ; i < sizeof(CONTENT_CHARS) / sizeof(FX_CHAR) ; i++) { if(ch == (FX_WCHAR)CONTENT_CHARS[i]) { return TRUE; } @@ -106,7 +106,7 @@ FX_BOOL CBC_OnedCodaBarWriter::FindChar(FX_WCHAR ch, FX_BOOL isContent) FX_BOOL CBC_OnedCodaBarWriter::CheckContentValidity(FX_WSTR contents) { FX_WCHAR ch; - FX_INT32 index = 0; + int32_t index = 0; for (index = 0; index < contents.GetLength(); index++) { ch = contents.GetAt(index); if (FindChar(ch, FALSE)) { @@ -121,7 +121,7 @@ CFX_WideString CBC_OnedCodaBarWriter::FilterContents(FX_WSTR contents) { CFX_WideString filtercontents; FX_WCHAR ch; - for (FX_INT32 index = 0; index < contents.GetLength(); index ++) { + for (int32_t index = 0; index < contents.GetLength(); index ++) { ch = contents.GetAt(index); if(ch > 175) { index++; @@ -135,31 +135,31 @@ CFX_WideString CBC_OnedCodaBarWriter::FilterContents(FX_WSTR contents) } return filtercontents; } -FX_BYTE *CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t *CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e) { - FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0 , e); + uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0 , e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -FX_BYTE *CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) +uint8_t *CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) { if(format != BCFORMAT_CODABAR) { e = BCExceptionOnlyEncodeCODEBAR; return NULL; } - FX_BYTE *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e); + uint8_t *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -FX_BYTE* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e) +uint8_t* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e) { CBC_OnedCodaBarReader CodaBarR; CFX_ByteString data = m_chStart + contents + m_chEnd; m_iContentLen = data.GetLength(); - FX_BYTE *result = FX_Alloc(FX_BYTE, m_iWideNarrRatio * 7 * data.GetLength()); + uint8_t *result = FX_Alloc(uint8_t, m_iWideNarrRatio * 7 * data.GetLength()); FX_CHAR ch; - FX_INT32 position = 0; - for (FX_INT32 index = 0; index < data.GetLength(); index++) { + int32_t position = 0; + for (int32_t index = 0; index < data.GetLength(); index++) { ch = data.GetAt(index); if (((ch >= 'a') && (ch <= 'z'))) { ch = ch - 32; @@ -180,17 +180,17 @@ FX_BYTE* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString &contents, FX_INT32 default: break; } - FX_INT32 code = 0; - FX_INT32 len = (FX_INT32)strlen(CodaBarR.ALPHABET_STRING); - for (FX_INT32 i = 0; i < len; i++) { + int32_t code = 0; + int32_t len = (int32_t)strlen(CodaBarR.ALPHABET_STRING); + for (int32_t i = 0; i < len; i++) { if (ch == CodaBarR.ALPHABET_STRING[i]) { code = CodaBarR.CHARACTER_ENCODINGS[i]; break; } } - FX_BYTE color = 1; - FX_INT32 counter = 0; - FX_INT32 bit = 0; + uint8_t color = 1; + int32_t counter = 0; + int32_t bit = 0; while (bit < 7) { result[position] = color; position++; @@ -216,7 +216,7 @@ CFX_WideString CBC_OnedCodaBarWriter::encodedContents(FX_WSTR contents) CFX_WideString strEnd(m_chEnd); return strStart + contents + strEnd; } -void CBC_OnedCodaBarWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e) +void CBC_OnedCodaBarWriter::RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e) { CBC_OneDimWriter::RenderResult(encodedContents(contents), code, codeLength, isDevice, e); } diff --git a/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.h b/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.h index b81839ca4a..c5c54b849f 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.h @@ -14,25 +14,25 @@ class CBC_OnedCodaBarWriter : public CBC_OneDimWriter public: CBC_OnedCodaBarWriter(); virtual ~CBC_OnedCodaBarWriter(); - FX_BYTE* Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e); - FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e); + uint8_t* Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e); + uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e); + uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e); CFX_WideString encodedContents(FX_WSTR contents); FX_BOOL CheckContentValidity(FX_WSTR contents); CFX_WideString FilterContents(FX_WSTR contents); FX_BOOL SetStartChar(FX_CHAR start); FX_BOOL SetEndChar(FX_CHAR end); - void SetDataLength(FX_INT32 length); + void SetDataLength(int32_t length); FX_BOOL SetTextLocation(BC_TEXT_LOC location); - FX_BOOL SetWideNarrowRatio(FX_INT32 ratio); + FX_BOOL SetWideNarrowRatio(int32_t ratio); FX_BOOL FindChar(FX_WCHAR ch, FX_BOOL isContent); private: - void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e); + void RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e); const static FX_CHAR START_END_CHARS[]; const static FX_CHAR CONTENT_CHARS[]; FX_CHAR m_chStart; FX_CHAR m_chEnd; - FX_INT32 m_iWideNarrRatio; + int32_t m_iWideNarrRatio; }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp b/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp index 9dd9f629cf..d1f453345b 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp @@ -25,7 +25,7 @@ #include "../common/BC_CommonBitArray.h" #include "BC_OneDReader.h" #include "BC_OnedCode128Reader.h" -const FX_INT32 CBC_OnedCode128Reader::CODE_PATTERNS[107][7] = { +const int32_t CBC_OnedCode128Reader::CODE_PATTERNS[107][7] = { {2, 1, 2, 2, 2, 2, 0}, {2, 2, 2, 1, 2, 2, 0}, {2, 2, 2, 2, 2, 1, 0}, @@ -134,53 +134,53 @@ const FX_INT32 CBC_OnedCode128Reader::CODE_PATTERNS[107][7] = { {2, 1, 1, 2, 3, 2, 0}, {2, 3, 3, 1, 1, 1, 2} }; -const FX_INT32 CBC_OnedCode128Reader::MAX_AVG_VARIANCE = (FX_INT32) (256 * 0.25f); -const FX_INT32 CBC_OnedCode128Reader::MAX_INDIVIDUAL_VARIANCE = (FX_INT32) (256 * 0.7f); -const FX_INT32 CBC_OnedCode128Reader::CODE_SHIFT = 98; -const FX_INT32 CBC_OnedCode128Reader::CODE_CODE_C = 99; -const FX_INT32 CBC_OnedCode128Reader::CODE_CODE_B = 100; -const FX_INT32 CBC_OnedCode128Reader::CODE_CODE_A = 101; -const FX_INT32 CBC_OnedCode128Reader::CODE_FNC_1 = 102; -const FX_INT32 CBC_OnedCode128Reader::CODE_FNC_2 = 97; -const FX_INT32 CBC_OnedCode128Reader::CODE_FNC_3 = 96; -const FX_INT32 CBC_OnedCode128Reader::CODE_FNC_4_A = 101; -const FX_INT32 CBC_OnedCode128Reader::CODE_FNC_4_B = 100; -const FX_INT32 CBC_OnedCode128Reader::CODE_START_A = 103; -const FX_INT32 CBC_OnedCode128Reader::CODE_START_B = 104; -const FX_INT32 CBC_OnedCode128Reader::CODE_START_C = 105; -const FX_INT32 CBC_OnedCode128Reader::CODE_STOP = 106; +const int32_t CBC_OnedCode128Reader::MAX_AVG_VARIANCE = (int32_t) (256 * 0.25f); +const int32_t CBC_OnedCode128Reader::MAX_INDIVIDUAL_VARIANCE = (int32_t) (256 * 0.7f); +const int32_t CBC_OnedCode128Reader::CODE_SHIFT = 98; +const int32_t CBC_OnedCode128Reader::CODE_CODE_C = 99; +const int32_t CBC_OnedCode128Reader::CODE_CODE_B = 100; +const int32_t CBC_OnedCode128Reader::CODE_CODE_A = 101; +const int32_t CBC_OnedCode128Reader::CODE_FNC_1 = 102; +const int32_t CBC_OnedCode128Reader::CODE_FNC_2 = 97; +const int32_t CBC_OnedCode128Reader::CODE_FNC_3 = 96; +const int32_t CBC_OnedCode128Reader::CODE_FNC_4_A = 101; +const int32_t CBC_OnedCode128Reader::CODE_FNC_4_B = 100; +const int32_t CBC_OnedCode128Reader::CODE_START_A = 103; +const int32_t CBC_OnedCode128Reader::CODE_START_B = 104; +const int32_t CBC_OnedCode128Reader::CODE_START_C = 105; +const int32_t CBC_OnedCode128Reader::CODE_STOP = 106; CBC_OnedCode128Reader::CBC_OnedCode128Reader() { } CBC_OnedCode128Reader::~CBC_OnedCode128Reader() { } -CFX_Int32Array *CBC_OnedCode128Reader::FindStartPattern(CBC_CommonBitArray *row, FX_INT32 &e) +CFX_Int32Array *CBC_OnedCode128Reader::FindStartPattern(CBC_CommonBitArray *row, int32_t &e) { - FX_INT32 width = row->GetSize(); - FX_INT32 rowOffset = 0; + int32_t width = row->GetSize(); + int32_t rowOffset = 0; while (rowOffset < width) { if (row->Get(rowOffset)) { break; } rowOffset++; } - FX_INT32 counterPosition = 0; + int32_t counterPosition = 0; CFX_Int32Array counters; counters.SetSize(6); - FX_INT32 patternStart = rowOffset; + int32_t patternStart = rowOffset; FX_BOOL isWhite = FALSE; - FX_INT32 patternLength = counters.GetSize(); - for (FX_INT32 i = rowOffset; i < width; i++) { + int32_t patternLength = counters.GetSize(); + for (int32_t i = rowOffset; i < width; i++) { FX_BOOL pixel = row->Get(i); if (pixel ^ isWhite) { counters[counterPosition]++; } else { if (counterPosition == patternLength - 1) { - FX_INT32 bestVariance = MAX_AVG_VARIANCE; - FX_INT32 bestMatch = -1; - for (FX_INT32 startCode = CODE_START_A; startCode <= CODE_START_C; startCode++) { - FX_INT32 variance = PatternMatchVariance(&counters, &CODE_PATTERNS[startCode][0], MAX_INDIVIDUAL_VARIANCE); + int32_t bestVariance = MAX_AVG_VARIANCE; + int32_t bestMatch = -1; + for (int32_t startCode = CODE_START_A; startCode <= CODE_START_C; startCode++) { + int32_t variance = PatternMatchVariance(&counters, &CODE_PATTERNS[startCode][0], MAX_INDIVIDUAL_VARIANCE); if (variance < bestVariance) { bestVariance = variance; bestMatch = startCode; @@ -199,7 +199,7 @@ CFX_Int32Array *CBC_OnedCode128Reader::FindStartPattern(CBC_CommonBitArray *row, } } patternStart += counters[0] + counters[1]; - for (FX_INT32 y = 2; y < patternLength; y++) { + for (int32_t y = 2; y < patternLength; y++) { counters[y - 2] = counters[y]; } counters[patternLength - 2] = 0; @@ -215,14 +215,14 @@ CFX_Int32Array *CBC_OnedCode128Reader::FindStartPattern(CBC_CommonBitArray *row, e = BCExceptionNotFound; return NULL; } -FX_INT32 CBC_OnedCode128Reader::DecodeCode(CBC_CommonBitArray *row, CFX_Int32Array *counters, FX_INT32 rowOffset, FX_INT32 &e) +int32_t CBC_OnedCode128Reader::DecodeCode(CBC_CommonBitArray *row, CFX_Int32Array *counters, int32_t rowOffset, int32_t &e) { RecordPattern(row, rowOffset, counters, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); - FX_INT32 bestVariance = MAX_AVG_VARIANCE; - FX_INT32 bestMatch = -1; - for (FX_INT32 d = 0; d < 107; d++) { - FX_INT32 variance = PatternMatchVariance(counters, &CODE_PATTERNS[d][0], MAX_INDIVIDUAL_VARIANCE); + int32_t bestVariance = MAX_AVG_VARIANCE; + int32_t bestMatch = -1; + for (int32_t d = 0; d < 107; d++) { + int32_t variance = PatternMatchVariance(counters, &CODE_PATTERNS[d][0], MAX_INDIVIDUAL_VARIANCE); if (variance < bestVariance) { bestVariance = variance; bestMatch = d; @@ -236,12 +236,12 @@ FX_INT32 CBC_OnedCode128Reader::DecodeCode(CBC_CommonBitArray *row, CFX_Int32Arr } return 0; } -CFX_ByteString CBC_OnedCode128Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_OnedCode128Reader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e) { CFX_Int32Array *startPatternInfo = FindStartPattern(row, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); - FX_INT32 startCode = (*startPatternInfo)[2]; - FX_INT32 codeSet; + int32_t startCode = (*startPatternInfo)[2]; + int32_t codeSet; switch (startCode) { case 103: codeSet = CODE_CODE_A; @@ -264,8 +264,8 @@ CFX_ByteString CBC_OnedCode128Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi FX_BOOL done = FALSE; FX_BOOL isNextShifted = FALSE; CFX_ByteString result; - FX_INT32 lastStart = (*startPatternInfo)[0]; - FX_INT32 nextStart = (*startPatternInfo)[1]; + int32_t lastStart = (*startPatternInfo)[0]; + int32_t nextStart = (*startPatternInfo)[1]; if(startPatternInfo != NULL) { startPatternInfo->RemoveAll(); delete startPatternInfo; @@ -273,10 +273,10 @@ CFX_ByteString CBC_OnedCode128Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi } CFX_Int32Array counters; counters.SetSize(6); - FX_INT32 lastCode = 0; - FX_INT32 code = 0; - FX_INT32 checksumTotal = startCode; - FX_INT32 multiplier = 0; + int32_t lastCode = 0; + int32_t code = 0; + int32_t checksumTotal = startCode; + int32_t multiplier = 0; FX_BOOL lastCharacterWasPrintable = TRUE; while (!done) { FX_BOOL unshift = isNextShifted; @@ -292,7 +292,7 @@ CFX_ByteString CBC_OnedCode128Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi checksumTotal += multiplier * code; } lastStart = nextStart; - for (FX_INT32 i = 0; i < counters.GetSize(); i++) { + for (int32_t i = 0; i < counters.GetSize(); i++) { nextStart += counters[i]; } switch (code) { @@ -399,7 +399,7 @@ CFX_ByteString CBC_OnedCode128Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi codeSet = codeSet == CODE_CODE_A ? CODE_CODE_B : CODE_CODE_A; } } - FX_INT32 width = row->GetSize(); + int32_t width = row->GetSize(); while (nextStart < width && row->Get(nextStart)) { nextStart++; } @@ -414,7 +414,7 @@ CFX_ByteString CBC_OnedCode128Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBi e = BCExceptionChecksumException; return ""; } - FX_INT32 resultLength = result.GetLength(); + int32_t resultLength = result.GetLength(); if (resultLength > 0 && lastCharacterWasPrintable) { if (codeSet == CODE_CODE_C) { result = result.Mid(0, result.GetLength() - 2); diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.h b/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.h index 94e1a6388b..558b111c22 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.h @@ -14,27 +14,27 @@ class CBC_OnedCode128Reader : public CBC_OneDReader public: CBC_OnedCode128Reader(); virtual ~CBC_OnedCode128Reader(); - virtual CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e); - const static FX_INT32 CODE_PATTERNS[107][7]; - const static FX_INT32 MAX_AVG_VARIANCE; - const static FX_INT32 MAX_INDIVIDUAL_VARIANCE; + virtual CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e); + const static int32_t CODE_PATTERNS[107][7]; + const static int32_t MAX_AVG_VARIANCE; + const static int32_t MAX_INDIVIDUAL_VARIANCE; - const static FX_INT32 CODE_SHIFT; - const static FX_INT32 CODE_CODE_C; - const static FX_INT32 CODE_CODE_B; - const static FX_INT32 CODE_CODE_A; - const static FX_INT32 CODE_FNC_1; - const static FX_INT32 CODE_FNC_2; - const static FX_INT32 CODE_FNC_3; - const static FX_INT32 CODE_FNC_4_A; - const static FX_INT32 CODE_FNC_4_B ; + const static int32_t CODE_SHIFT; + const static int32_t CODE_CODE_C; + const static int32_t CODE_CODE_B; + const static int32_t CODE_CODE_A; + const static int32_t CODE_FNC_1; + const static int32_t CODE_FNC_2; + const static int32_t CODE_FNC_3; + const static int32_t CODE_FNC_4_A; + const static int32_t CODE_FNC_4_B ; - const static FX_INT32 CODE_START_A; - const static FX_INT32 CODE_START_B; - const static FX_INT32 CODE_START_C; - const static FX_INT32 CODE_STOP; + const static int32_t CODE_START_A; + const static int32_t CODE_START_B; + const static int32_t CODE_START_C; + const static int32_t CODE_STOP; private: - CFX_Int32Array *FindStartPattern(CBC_CommonBitArray *row, FX_INT32 &e); - FX_INT32 DecodeCode(CBC_CommonBitArray *row, CFX_Int32Array *counters, FX_INT32 rowOffset, FX_INT32 &e); + CFX_Int32Array *FindStartPattern(CBC_CommonBitArray *row, int32_t &e); + int32_t DecodeCode(CBC_CommonBitArray *row, CFX_Int32Array *counters, int32_t rowOffset, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.cpp b/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.cpp index 6dd3cbe8a5..5f7b32caa4 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.cpp @@ -27,11 +27,11 @@ #include "BC_OneDimWriter.h" #include "BC_OnedCode128Reader.h" #include "BC_OnedCode128Writer.h" -const FX_INT32 CBC_OnedCode128Writer::CODE_CODE_B = 100; -const FX_INT32 CBC_OnedCode128Writer::CODE_CODE_C = 99; -const FX_INT32 CBC_OnedCode128Writer::CODE_START_B = 104; -const FX_INT32 CBC_OnedCode128Writer::CODE_START_C = 105; -const FX_INT32 CBC_OnedCode128Writer::CODE_STOP = 106; +const int32_t CBC_OnedCode128Writer::CODE_CODE_B = 100; +const int32_t CBC_OnedCode128Writer::CODE_CODE_C = 99; +const int32_t CBC_OnedCode128Writer::CODE_START_B = 104; +const int32_t CBC_OnedCode128Writer::CODE_START_C = 105; +const int32_t CBC_OnedCode128Writer::CODE_STOP = 106; CBC_OnedCode128Writer::CBC_OnedCode128Writer() { m_codeFormat = BC_CODE128_B; @@ -50,11 +50,11 @@ BC_TYPE CBC_OnedCode128Writer::GetType() FX_BOOL CBC_OnedCode128Writer::CheckContentValidity(FX_WSTR contents) { FX_BOOL ret = TRUE; - FX_INT32 position = 0; - FX_INT32 patternIndex = -1; + int32_t position = 0; + int32_t patternIndex = -1; if (m_codeFormat == BC_CODE128_B || m_codeFormat == BC_CODE128_C) { while (position < contents.GetLength()) { - patternIndex = (FX_INT32)contents.GetAt(position); + patternIndex = (int32_t)contents.GetAt(position); if (patternIndex >= 32 && patternIndex <= 126 && patternIndex != 34) { position++; continue; @@ -73,7 +73,7 @@ CFX_WideString CBC_OnedCode128Writer::FilterContents(FX_WSTR contents) { CFX_WideString filterChineseChar; FX_WCHAR ch; - for (FX_INT32 i = 0; i < contents.GetLength(); i++) { + for (int32_t i = 0; i < contents.GetLength(); i++) { ch = contents.GetAt(i); if(ch > 175) { i++; @@ -83,7 +83,7 @@ CFX_WideString CBC_OnedCode128Writer::FilterContents(FX_WSTR contents) } CFX_WideString filtercontents; if (m_codeFormat == BC_CODE128_B) { - for (FX_INT32 i = 0; i < filterChineseChar.GetLength(); i++) { + for (int32_t i = 0; i < filterChineseChar.GetLength(); i++) { ch = filterChineseChar.GetAt(i); if (ch >= 32 && ch <= 126) { filtercontents += ch; @@ -92,7 +92,7 @@ CFX_WideString CBC_OnedCode128Writer::FilterContents(FX_WSTR contents) } } } else if (m_codeFormat == BC_CODE128_C) { - for (FX_INT32 i = 0; i < filterChineseChar.GetLength(); i++) { + for (int32_t i = 0; i < filterChineseChar.GetLength(); i++) { ch = filterChineseChar.GetAt(i); if (ch >= 32 && ch <= 106) { filtercontents += ch; @@ -113,41 +113,41 @@ FX_BOOL CBC_OnedCode128Writer::SetTextLocation(BC_TEXT_LOC location) m_locTextLoc = location; return TRUE; } -FX_BYTE *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) +uint8_t *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) { if(format != BCFORMAT_CODE_128) { e = BCExceptionOnlyEncodeCODE_128; return NULL; } - FX_BYTE *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e); + uint8_t *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -FX_BYTE *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e) { - FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0, e); + uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -FX_BOOL CBC_OnedCode128Writer::IsDigits(const CFX_ByteString &contents, FX_INT32 start, FX_INT32 length) +FX_BOOL CBC_OnedCode128Writer::IsDigits(const CFX_ByteString &contents, int32_t start, int32_t length) { - FX_INT32 end = start + length; - for (FX_INT32 i = start; i < end; i++) { + int32_t end = start + length; + for (int32_t i = start; i < end; i++) { if (contents[i] < '0' || contents[i] > '9') { return FALSE; } } return TRUE; } -FX_BYTE *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e) +uint8_t *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e) { - FX_INT32 length = contents.GetLength(); + int32_t length = contents.GetLength(); if(contents.GetLength() < 1 || contents.GetLength() > 80) { e = BCExceptionContentsLengthShouldBetween1and80; return NULL; } CFX_PtrArray patterns; - FX_INT32 checkSum = 0; + int32_t checkSum = 0; if (m_codeFormat == BC_CODE128_B) { checkSum = Encode128B(contents, patterns); } else if (m_codeFormat == BC_CODE128_C) { @@ -157,21 +157,21 @@ FX_BYTE *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, FX_INT32 return NULL; } checkSum %= 103; - patterns.Add((FX_INT32*)CBC_OnedCode128Reader::CODE_PATTERNS[checkSum]); - patterns.Add((FX_INT32*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_STOP]); + patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[checkSum]); + patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_STOP]); m_iContentLen = contents.GetLength() + 3; - FX_INT32 codeWidth = 0; - for(FX_INT32 k = 0; k < patterns.GetSize(); k++) { - FX_INT32 *pattern = (FX_INT32*)patterns[k]; - for(FX_INT32 j = 0; j < 7; j++) { + int32_t codeWidth = 0; + for(int32_t k = 0; k < patterns.GetSize(); k++) { + int32_t *pattern = (int32_t*)patterns[k]; + for(int32_t j = 0; j < 7; j++) { codeWidth += pattern[j]; } } outLength = codeWidth; - FX_BYTE *result = FX_Alloc(FX_BYTE, outLength); - FX_INT32 pos = 0; - for(FX_INT32 j = 0; j < patterns.GetSize(); j++) { - FX_INT32* pattern = (FX_INT32*)patterns[j]; + uint8_t *result = FX_Alloc(uint8_t, outLength); + int32_t pos = 0; + for(int32_t j = 0; j < patterns.GetSize(); j++) { + int32_t* pattern = (int32_t*)patterns[j]; pos += AppendPattern(result, pos, pattern, 7, 1, e); if (e != BCExceptionNO) { FX_Free (result); @@ -180,18 +180,18 @@ FX_BYTE *CBC_OnedCode128Writer::Encode(const CFX_ByteString &contents, FX_INT32 } return result; } -FX_INT32 CBC_OnedCode128Writer::Encode128B(const CFX_ByteString &contents, CFX_PtrArray &patterns) +int32_t CBC_OnedCode128Writer::Encode128B(const CFX_ByteString &contents, CFX_PtrArray &patterns) { - FX_INT32 checkSum = 0; - FX_INT32 checkWeight = 1; - FX_INT32 position = 0; - patterns.Add((FX_INT32*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_START_B]); + int32_t checkSum = 0; + int32_t checkWeight = 1; + int32_t position = 0; + patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_START_B]); checkSum += CODE_START_B * checkWeight; while (position < contents.GetLength()) { - FX_INT32 patternIndex = 0; + int32_t patternIndex = 0; patternIndex = contents[position] - ' '; position += 1; - patterns.Add((FX_INT32*)CBC_OnedCode128Reader::CODE_PATTERNS[patternIndex]); + patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[patternIndex]); checkSum += patternIndex * checkWeight; if (position != 0) { checkWeight++; @@ -199,18 +199,18 @@ FX_INT32 CBC_OnedCode128Writer::Encode128B(const CFX_ByteString &contents, CFX_ } return checkSum; } -FX_INT32 CBC_OnedCode128Writer::Encode128C(const CFX_ByteString &contents, CFX_PtrArray &patterns) +int32_t CBC_OnedCode128Writer::Encode128C(const CFX_ByteString &contents, CFX_PtrArray &patterns) { - FX_INT32 checkSum = 0; - FX_INT32 checkWeight = 1; - FX_INT32 position = 0; - patterns.Add((FX_INT32*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_START_C]); + int32_t checkSum = 0; + int32_t checkWeight = 1; + int32_t position = 0; + patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_START_C]); checkSum += CODE_START_C * checkWeight; while (position < contents.GetLength()) { - FX_INT32 patternIndex = 0; + int32_t patternIndex = 0; FX_CHAR ch = contents.GetAt(position); if (ch < '0' || ch > '9') { - patternIndex = (FX_INT32)ch; + patternIndex = (int32_t)ch; position++; } else { patternIndex = FXSYS_atoi(contents.Mid(position, 2)); @@ -220,7 +220,7 @@ FX_INT32 CBC_OnedCode128Writer::Encode128C(const CFX_ByteString &contents, CFX_ position += 2; } } - patterns.Add((FX_INT32*)CBC_OnedCode128Reader::CODE_PATTERNS[patternIndex]); + patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[patternIndex]); checkSum += patternIndex * checkWeight; if (position != 0) { checkWeight++; diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.h b/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.h index daa48eca51..f27e2e9f09 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCode128Writer.h @@ -14,24 +14,24 @@ public: CBC_OnedCode128Writer(); CBC_OnedCode128Writer(BC_TYPE type); virtual ~CBC_OnedCode128Writer(); - FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, - FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e); - FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, - FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BYTE * Encode(const CFX_ByteString &contents, FX_INT32 &outLength , FX_INT32 &e); + uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, + int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e); + uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, + int32_t &outWidth, int32_t &outHeight, int32_t &e); + uint8_t * Encode(const CFX_ByteString &contents, int32_t &outLength , int32_t &e); FX_BOOL CheckContentValidity(FX_WSTR contents); CFX_WideString FilterContents(FX_WSTR contents); FX_BOOL SetTextLocation(BC_TEXT_LOC location); BC_TYPE GetType(); private: - FX_BOOL IsDigits(const CFX_ByteString &contents, FX_INT32 start, FX_INT32 length); - FX_INT32 Encode128B(const CFX_ByteString &contents, CFX_PtrArray &patterns); - FX_INT32 Encode128C(const CFX_ByteString &contents, CFX_PtrArray &patterns); + FX_BOOL IsDigits(const CFX_ByteString &contents, int32_t start, int32_t length); + int32_t Encode128B(const CFX_ByteString &contents, CFX_PtrArray &patterns); + int32_t Encode128C(const CFX_ByteString &contents, CFX_PtrArray &patterns); BC_TYPE m_codeFormat; - const static FX_INT32 CODE_START_B; - const static FX_INT32 CODE_START_C; - const static FX_INT32 CODE_CODE_B; - const static FX_INT32 CODE_CODE_C; - const static FX_INT32 CODE_STOP; + const static int32_t CODE_START_B; + const static int32_t CODE_START_C; + const static int32_t CODE_CODE_B; + const static int32_t CODE_CODE_C; + const static int32_t CODE_STOP; }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp b/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp index b19343943b..e5e6392c17 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp @@ -27,14 +27,14 @@ #include "BC_OnedCode39Reader.h" FX_LPCSTR CBC_OnedCode39Reader::ALPHABET_STRING = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%"; FX_LPCSTR CBC_OnedCode39Reader::CHECKSUM_STRING = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"; -const FX_INT32 CBC_OnedCode39Reader::CHARACTER_ENCODINGS[44] = { +const int32_t CBC_OnedCode39Reader::CHARACTER_ENCODINGS[44] = { 0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, 0x124, 0x064, 0x109, 0x049, 0x148, 0x019, 0x118, 0x058, 0x00D, 0x10C, 0x04C, 0x01C, 0x103, 0x043, 0x142, 0x013, 0x112, 0x052, 0x007, 0x106, 0x046, 0x016, 0x181, 0x0C1, 0x1C0, 0x091, 0x190, 0x0D0, 0x085, 0x184, 0x0C4, 0x094, 0x0A8, 0x0A2, 0x08A, 0x02A }; -const FX_INT32 CBC_OnedCode39Reader::ASTERISK_ENCODING = 0x094; +const int32_t CBC_OnedCode39Reader::ASTERISK_ENCODING = 0x094; CBC_OnedCode39Reader::CBC_OnedCode39Reader(): m_extendedMode(FALSE), m_usingCheckDigit(FALSE) { } @@ -51,16 +51,16 @@ CBC_OnedCode39Reader::CBC_OnedCode39Reader(FX_BOOL usingCheckDigit, FX_BOOL exte CBC_OnedCode39Reader::~CBC_OnedCode39Reader() { } -CFX_ByteString CBC_OnedCode39Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_OnedCode39Reader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e) { CFX_Int32Array *start = FindAsteriskPattern(row, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); - FX_INT32 nextStart = (*start)[1]; + int32_t nextStart = (*start)[1]; if(start != NULL) { delete start; start = NULL; } - FX_INT32 end = row->GetSize(); + int32_t end = row->GetSize(); while (nextStart < end && !row->Get(nextStart)) { nextStart++; } @@ -68,11 +68,11 @@ CFX_ByteString CBC_OnedCode39Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBit CFX_Int32Array counters; counters.SetSize(9); FX_CHAR decodedChar; - FX_INT32 lastStart; + int32_t lastStart; do { RecordPattern(row, nextStart, &counters, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); - FX_INT32 pattern = ToNarrowWidePattern(&counters); + int32_t pattern = ToNarrowWidePattern(&counters); if (pattern < 0) { e = BCExceptionNotFound; return ""; @@ -81,7 +81,7 @@ CFX_ByteString CBC_OnedCode39Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBit BC_EXCEPTION_CHECK_ReturnValue(e, ""); result += decodedChar; lastStart = nextStart; - for (FX_INT32 i = 0; i < counters.GetSize(); i++) { + for (int32_t i = 0; i < counters.GetSize(); i++) { nextStart += counters[i]; } while (nextStart < end && !row->Get(nextStart)) { @@ -89,17 +89,17 @@ CFX_ByteString CBC_OnedCode39Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBit } } while (decodedChar != '*'); result = result.Mid(0, result.GetLength() - 1); - FX_INT32 lastPatternSize = 0; - for (FX_INT32 j = 0; j < counters.GetSize(); j++) { + int32_t lastPatternSize = 0; + for (int32_t j = 0; j < counters.GetSize(); j++) { lastPatternSize += counters[j]; } - FX_INT32 whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize; + int32_t whiteSpaceAfterEnd = nextStart - lastStart - lastPatternSize; if(m_usingCheckDigit) { - FX_INT32 max = result.GetLength() - 1; - FX_INT32 total = 0; - FX_INT32 len = (FX_INT32)strlen(ALPHABET_STRING); - for (FX_INT32 k = 0; k < max; k++) { - for (FX_INT32 j = 0; j < len; j++) + int32_t max = result.GetLength() - 1; + int32_t total = 0; + int32_t len = (int32_t)strlen(ALPHABET_STRING); + for (int32_t k = 0; k < max; k++) { + for (int32_t j = 0; j < len; j++) if (ALPHABET_STRING[j] == result[k]) { total += j; } @@ -122,23 +122,23 @@ CFX_ByteString CBC_OnedCode39Reader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBit return result; } } -CFX_Int32Array *CBC_OnedCode39Reader::FindAsteriskPattern(CBC_CommonBitArray *row, FX_INT32 &e) +CFX_Int32Array *CBC_OnedCode39Reader::FindAsteriskPattern(CBC_CommonBitArray *row, int32_t &e) { - FX_INT32 width = row->GetSize(); - FX_INT32 rowOffset = 0; + int32_t width = row->GetSize(); + int32_t rowOffset = 0; while (rowOffset < width) { if (row->Get(rowOffset)) { break; } rowOffset++; } - FX_INT32 counterPosition = 0; + int32_t counterPosition = 0; CFX_Int32Array counters; counters.SetSize(9); - FX_INT32 patternStart = rowOffset; + int32_t patternStart = rowOffset; FX_BOOL isWhite = FALSE; - FX_INT32 patternLength = counters.GetSize(); - for (FX_INT32 i = rowOffset; i < width; i++) { + int32_t patternLength = counters.GetSize(); + for (int32_t i = rowOffset; i < width; i++) { FX_BOOL pixel = row->Get(i); if (pixel ^ isWhite) { counters[counterPosition]++; @@ -156,7 +156,7 @@ CFX_Int32Array *CBC_OnedCode39Reader::FindAsteriskPattern(CBC_CommonBitArray *ro } } patternStart += counters[0] + counters[1]; - for (FX_INT32 y = 2; y < patternLength; y++) { + for (int32_t y = 2; y < patternLength; y++) { counters[y - 2] = counters[y]; } counters[patternLength - 2] = 0; @@ -172,26 +172,26 @@ CFX_Int32Array *CBC_OnedCode39Reader::FindAsteriskPattern(CBC_CommonBitArray *ro e = BCExceptionNotFound; return NULL; } -FX_INT32 CBC_OnedCode39Reader::ToNarrowWidePattern(CFX_Int32Array *counters) +int32_t CBC_OnedCode39Reader::ToNarrowWidePattern(CFX_Int32Array *counters) { - FX_INT32 numCounters = counters->GetSize(); - FX_INT32 maxNarrowCounter = 0; - FX_INT32 wideCounters; + int32_t numCounters = counters->GetSize(); + int32_t maxNarrowCounter = 0; + int32_t wideCounters; do { #undef max - FX_INT32 minCounter = FXSYS_IntMax; - for (FX_INT32 i = 0; i < numCounters; i++) { - FX_INT32 counter = (*counters)[i]; + int32_t minCounter = FXSYS_IntMax; + for (int32_t i = 0; i < numCounters; i++) { + int32_t counter = (*counters)[i]; if (counter < minCounter && counter > maxNarrowCounter) { minCounter = counter; } } maxNarrowCounter = minCounter; wideCounters = 0; - FX_INT32 totalWideCountersWidth = 0; - FX_INT32 pattern = 0; - for (FX_INT32 j = 0; j < numCounters; j++) { - FX_INT32 counter = (*counters)[j]; + int32_t totalWideCountersWidth = 0; + int32_t pattern = 0; + for (int32_t j = 0; j < numCounters; j++) { + int32_t counter = (*counters)[j]; if ((*counters)[j] > maxNarrowCounter) { pattern |= 1 << (numCounters - 1 - j); wideCounters++; @@ -199,8 +199,8 @@ FX_INT32 CBC_OnedCode39Reader::ToNarrowWidePattern(CFX_Int32Array *counters) } } if (wideCounters == 3) { - for (FX_INT32 k = 0; k < numCounters && wideCounters > 0; k++) { - FX_INT32 counter = (*counters)[k]; + for (int32_t k = 0; k < numCounters && wideCounters > 0; k++) { + int32_t counter = (*counters)[k]; if ((*counters)[k] > maxNarrowCounter) { wideCounters--; if ((counter << 1) >= totalWideCountersWidth) { @@ -213,9 +213,9 @@ FX_INT32 CBC_OnedCode39Reader::ToNarrowWidePattern(CFX_Int32Array *counters) } while (wideCounters > 3); return -1; } -FX_CHAR CBC_OnedCode39Reader::PatternToChar(FX_INT32 pattern, FX_INT32 &e) +FX_CHAR CBC_OnedCode39Reader::PatternToChar(int32_t pattern, int32_t &e) { - for (FX_INT32 i = 0; i < 44; i++) { + for (int32_t i = 0; i < 44; i++) { if (CHARACTER_ENCODINGS[i] == pattern) { return (ALPHABET_STRING)[i]; } @@ -223,12 +223,12 @@ FX_CHAR CBC_OnedCode39Reader::PatternToChar(FX_INT32 pattern, FX_INT32 &e) e = BCExceptionNotFound; return 0; } -CFX_ByteString CBC_OnedCode39Reader::DecodeExtended(CFX_ByteString &encoded, FX_INT32 &e) +CFX_ByteString CBC_OnedCode39Reader::DecodeExtended(CFX_ByteString &encoded, int32_t &e) { - FX_INT32 length = encoded.GetLength(); + int32_t length = encoded.GetLength(); CFX_ByteString decoded; FX_CHAR c, next; - for(FX_INT32 i = 0; i < length; i++) { + for(int32_t i = 0; i < length; i++) { c = encoded[i]; if(c == '+' || c == '$' || c == '%' || c == '/') { next = encoded[i + 1]; diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h b/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h index 81fd6b79e9..3e7db70f95 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h @@ -14,19 +14,19 @@ class CBC_OnedCode39Reader : public CBC_OneDReader public: static FX_LPCSTR ALPHABET_STRING; static FX_LPCSTR CHECKSUM_STRING; - const static FX_INT32 CHARACTER_ENCODINGS[44]; - const static FX_INT32 ASTERISK_ENCODING; + const static int32_t CHARACTER_ENCODINGS[44]; + const static int32_t ASTERISK_ENCODING; CBC_OnedCode39Reader(); CBC_OnedCode39Reader(FX_BOOL usingCheckDigit); CBC_OnedCode39Reader(FX_BOOL usingCheckDigit, FX_BOOL extendedMode); virtual ~CBC_OnedCode39Reader(); - CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e); + CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e); private: FX_BOOL m_usingCheckDigit; FX_BOOL m_extendedMode; - CFX_Int32Array *FindAsteriskPattern(CBC_CommonBitArray *row, FX_INT32 &e); - FX_INT32 ToNarrowWidePattern(CFX_Int32Array *counters); - FX_CHAR PatternToChar(FX_INT32 pattern, FX_INT32 &e); - CFX_ByteString DecodeExtended(CFX_ByteString &encoded, FX_INT32 &e); + CFX_Int32Array *FindAsteriskPattern(CBC_CommonBitArray *row, int32_t &e); + int32_t ToNarrowWidePattern(CFX_Int32Array *counters); + FX_CHAR PatternToChar(int32_t pattern, int32_t &e); + CFX_ByteString DecodeExtended(CFX_ByteString &encoded, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.cpp b/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.cpp index d9c77460ac..8d06ecdfc2 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.cpp @@ -46,7 +46,7 @@ FX_BOOL CBC_OnedCode39Writer::CheckContentValidity(FX_WSTR contents) if (m_extendedMode) { return CheckExtendedContentValidity(contents); } - for(FX_INT32 i = 0; i < contents.GetLength(); i++) { + for(int32_t i = 0; i < contents.GetLength(); i++) { FX_WCHAR ch = contents.GetAt(i); if ((ch >= (FX_WCHAR)'0' && ch <= (FX_WCHAR)'9') || (ch >= (FX_WCHAR)'A' && ch <= (FX_WCHAR)'Z') || ch == (FX_WCHAR)'-' || ch == (FX_WCHAR)'.' || ch == (FX_WCHAR)' ' || ch == (FX_WCHAR)'*' @@ -59,7 +59,7 @@ FX_BOOL CBC_OnedCode39Writer::CheckContentValidity(FX_WSTR contents) } FX_BOOL CBC_OnedCode39Writer::CheckExtendedContentValidity(FX_WSTR contents) { - for(FX_INT32 i = 0; i < contents.GetLength(); i++) { + for(int32_t i = 0; i < contents.GetLength(); i++) { FX_WCHAR ch = contents.GetAt(i); if (ch > 127) { return FALSE; @@ -73,7 +73,7 @@ CFX_WideString CBC_OnedCode39Writer::FilterContents(FX_WSTR contents) return FilterExtendedContents(contents); } CFX_WideString filtercontents; - for(FX_INT32 i = 0; i < contents.GetLength(); i++) { + for(int32_t i = 0; i < contents.GetLength(); i++) { FX_WCHAR ch = contents.GetAt(i); if ( ch == (FX_WCHAR)'*' && (i == 0 || i == contents.GetLength() - 1) ) { continue; @@ -95,7 +95,7 @@ CFX_WideString CBC_OnedCode39Writer::FilterContents(FX_WSTR contents) CFX_WideString CBC_OnedCode39Writer::FilterExtendedContents(FX_WSTR contents) { CFX_WideString filtercontents; - for(FX_INT32 i = 0; i < contents.GetLength(); i++) { + for(int32_t i = 0; i < contents.GetLength(); i++) { FX_WCHAR ch = contents.GetAt(i); if ( ch == (FX_WCHAR)'*' && (i == 0 || i == contents.GetLength() - 1) ) { continue; @@ -155,7 +155,7 @@ CFX_WideString CBC_OnedCode39Writer::RenderTextContents(FX_WSTR contents) return RenderExtendedTextContents(contents); } CFX_WideString renderContents; - for(FX_INT32 i = 0; i < contents.GetLength(); i++) { + for(int32_t i = 0; i < contents.GetLength(); i++) { FX_WCHAR ch = contents.GetAt(i); if ( ch == (FX_WCHAR)'*' && (i == 0 || i == contents.GetLength() - 1) ) { continue; @@ -176,7 +176,7 @@ CFX_WideString CBC_OnedCode39Writer::RenderTextContents(FX_WSTR contents) CFX_WideString CBC_OnedCode39Writer::RenderExtendedTextContents(FX_WSTR contents) { CFX_WideString renderContents; - for(FX_INT32 i = 0; i < contents.GetLength(); i++) { + for(int32_t i = 0; i < contents.GetLength(); i++) { FX_WCHAR ch = contents.GetAt(i); if ( ch == (FX_WCHAR)'*' && (i == 0 || i == contents.GetLength() - 1) ) { continue; @@ -200,7 +200,7 @@ FX_BOOL CBC_OnedCode39Writer::SetTextLocation(BC_TEXT_LOC location) m_locTextLoc = location; return TRUE; } -FX_BOOL CBC_OnedCode39Writer::SetWideNarrowRatio(FX_INT32 ratio) +FX_BOOL CBC_OnedCode39Writer::SetWideNarrowRatio(int32_t ratio) { if ( ratio < 2 || ratio > 3) { return FALSE; @@ -208,39 +208,39 @@ FX_BOOL CBC_OnedCode39Writer::SetWideNarrowRatio(FX_INT32 ratio) m_iWideNarrRatio = ratio; return TRUE; } -FX_BYTE *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e) { - FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0 , e); + uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0 , e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -FX_BYTE *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) +uint8_t *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) { if(format != BCFORMAT_CODE_39) { e = BCExceptionOnlyEncodeCODE_39; return NULL; } - FX_BYTE *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e); + uint8_t *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -void CBC_OnedCode39Writer::ToIntArray(FX_INT32 a, FX_INT32 *toReturn) +void CBC_OnedCode39Writer::ToIntArray(int32_t a, int32_t *toReturn) { - for(FX_INT32 i = 0; i < 9; i++) { + for(int32_t i = 0; i < 9; i++) { toReturn[i] = (a & (1 << i) ) == 0 ? 1 : m_iWideNarrRatio; } } -FX_CHAR CBC_OnedCode39Writer::CalcCheckSum(const CFX_ByteString &contents, FX_INT32 &e) +FX_CHAR CBC_OnedCode39Writer::CalcCheckSum(const CFX_ByteString &contents, int32_t &e) { - FX_INT32 length = contents.GetLength(); + int32_t length = contents.GetLength(); if (length > 80) { e = BCExceptionContentsLengthShouldBetween1and80; return '*'; } - FX_INT32 checksum = 0; - FX_INT32 len = (FX_INT32)strlen(CBC_OnedCode39Reader::ALPHABET_STRING); - for(FX_INT32 i = 0; i < contents.GetLength(); i++) { - FX_INT32 j = 0; + int32_t checksum = 0; + int32_t len = (int32_t)strlen(CBC_OnedCode39Reader::ALPHABET_STRING); + for(int32_t i = 0; i < contents.GetLength(); i++) { + int32_t j = 0; for (; j < len; j++) { if (CBC_OnedCode39Reader::ALPHABET_STRING[j] == contents[i]) { if(contents[i] != '*') { @@ -259,48 +259,48 @@ FX_CHAR CBC_OnedCode39Writer::CalcCheckSum(const CFX_ByteString &contents, FX_IN checksum = checksum % 43; return CBC_OnedCode39Reader::CHECKSUM_STRING[checksum]; } -FX_BYTE *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, FX_INT32 &outlength , FX_INT32 &e) +uint8_t *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, int32_t &outlength , int32_t &e) { FX_CHAR checksum = CalcCheckSum(contents, e); if (checksum == '*') { return NULL; } - FX_INT32 widths[9] = {0}; - FX_INT32 wideStrideNum = 3; - FX_INT32 narrStrideNum = 9 - wideStrideNum; + int32_t widths[9] = {0}; + int32_t wideStrideNum = 3; + int32_t narrStrideNum = 9 - wideStrideNum; CFX_ByteString encodedContents = contents; if ( m_bCalcChecksum ) { encodedContents += checksum; } m_iContentLen = encodedContents.GetLength(); - FX_INT32 codeWidth = (wideStrideNum * m_iWideNarrRatio + narrStrideNum) * 2 + 1 + m_iContentLen; - FX_INT32 len = (FX_INT32)strlen(CBC_OnedCode39Reader::ALPHABET_STRING); - for (FX_INT32 j = 0; j < m_iContentLen; j++) { - for (FX_INT32 i = 0; i < len; i++) { + int32_t codeWidth = (wideStrideNum * m_iWideNarrRatio + narrStrideNum) * 2 + 1 + m_iContentLen; + int32_t len = (int32_t)strlen(CBC_OnedCode39Reader::ALPHABET_STRING); + for (int32_t j = 0; j < m_iContentLen; j++) { + for (int32_t i = 0; i < len; i++) { if (CBC_OnedCode39Reader::ALPHABET_STRING[i] == encodedContents[j]) { ToIntArray(CBC_OnedCode39Reader::CHARACTER_ENCODINGS[i], widths); - for(FX_INT32 k = 0; k < 9; k++) { + for(int32_t k = 0; k < 9; k++) { codeWidth += widths[k]; } } } } outlength = codeWidth; - FX_BYTE *result = FX_Alloc(FX_BYTE, codeWidth); + uint8_t *result = FX_Alloc(uint8_t, codeWidth); ToIntArray(CBC_OnedCode39Reader::CHARACTER_ENCODINGS[39], widths); - FX_INT32 pos = AppendPattern(result, 0, widths, 9, 1 , e); + int32_t pos = AppendPattern(result, 0, widths, 9, 1 , e); if (e != BCExceptionNO) { FX_Free (result); return NULL; } - FX_INT32 narrowWhite[] = {1}; + int32_t narrowWhite[] = {1}; pos += AppendPattern(result, pos, narrowWhite, 1, 0, e); if (e != BCExceptionNO) { FX_Free (result); return NULL; } - for(FX_INT32 l = m_iContentLen - 1; l >= 0; l--) { - for (FX_INT32 i = 0; i < len; i++) { + for(int32_t l = m_iContentLen - 1; l >= 0; l--) { + for (int32_t i = 0; i < len; i++) { if (CBC_OnedCode39Reader::ALPHABET_STRING[i] == encodedContents[l]) { ToIntArray(CBC_OnedCode39Reader::CHARACTER_ENCODINGS[i], widths); pos += AppendPattern(result, pos, widths, 9, 1, e); @@ -322,14 +322,14 @@ FX_BYTE *CBC_OnedCode39Writer::Encode(const CFX_ByteString &contents, FX_INT32 & FX_Free (result); return NULL; } - for (FX_INT32 i = 0; i < codeWidth / 2; i++) { + for (int32_t i = 0; i < codeWidth / 2; i++) { result[i] ^= result[codeWidth - 1 - i]; result[codeWidth - 1 - i] ^= result[i]; result[i] ^= result[codeWidth - 1 - i]; } return result; } -CFX_WideString CBC_OnedCode39Writer::encodedContents(FX_WSTR contents, FX_INT32 &e) +CFX_WideString CBC_OnedCode39Writer::encodedContents(FX_WSTR contents, int32_t &e) { CFX_WideString encodedContents = contents; if (m_bCalcChecksum && m_bPrintChecksum) { @@ -343,7 +343,7 @@ CFX_WideString CBC_OnedCode39Writer::encodedContents(FX_WSTR contents, FX_INT32 } return encodedContents; } -void CBC_OnedCode39Writer::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e) +void CBC_OnedCode39Writer::RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e) { CFX_WideString encodedCon = encodedContents(contents, e); BC_EXCEPTION_CHECK_ReturnVoid(e); diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.h b/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.h index b37d9d8e19..641d041809 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCode39Writer.h @@ -15,11 +15,11 @@ public: CBC_OnedCode39Writer(); CBC_OnedCode39Writer(FX_BOOL extendedMode); virtual ~CBC_OnedCode39Writer(); - FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e); - FX_BYTE *Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e); - void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e); - CFX_WideString encodedContents(FX_WSTR contents, FX_INT32 &e); + uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e); + uint8_t *Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e); + uint8_t *Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e); + void RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e); + CFX_WideString encodedContents(FX_WSTR contents, int32_t &e); FX_BOOL CheckContentValidity(FX_WSTR contents); FX_BOOL CheckExtendedContentValidity(FX_WSTR contents); CFX_WideString FilterContents(FX_WSTR contents); @@ -27,11 +27,11 @@ public: CFX_WideString RenderTextContents(FX_WSTR contents); CFX_WideString RenderExtendedTextContents(FX_WSTR contents); FX_BOOL SetTextLocation(BC_TEXT_LOC loction); - FX_BOOL SetWideNarrowRatio(FX_INT32 ratio); + FX_BOOL SetWideNarrowRatio(int32_t ratio); private: - void ToIntArray(FX_INT32 a, FX_INT32 *toReturn); - FX_CHAR CalcCheckSum(const CFX_ByteString &contents, FX_INT32 &e); - FX_INT32 m_iWideNarrRatio; + void ToIntArray(int32_t a, int32_t *toReturn); + FX_CHAR CalcCheckSum(const CFX_ByteString &contents, int32_t &e); + int32_t m_iWideNarrRatio; FX_BOOL m_extendedMode; }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.cpp b/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.cpp index ddce736bb8..288aace861 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.cpp @@ -26,7 +26,7 @@ #include "BC_OneDReader.h" #include "BC_OneDimReader.h" #include "BC_OnedEAN13Reader.h" -const FX_INT32 CBC_OnedEAN13Reader::FIRST_DIGIT_ENCODINGS[10] = { +const int32_t CBC_OnedEAN13Reader::FIRST_DIGIT_ENCODINGS[10] = { 0x00, 0x0B, 0x0D, 0xE, 0x13, 0x19, 0x1C, 0x15, 0x16, 0x1A }; CBC_OnedEAN13Reader::CBC_OnedEAN13Reader() @@ -35,9 +35,9 @@ CBC_OnedEAN13Reader::CBC_OnedEAN13Reader() CBC_OnedEAN13Reader::~CBC_OnedEAN13Reader() { } -void CBC_OnedEAN13Reader::DetermineFirstDigit(CFX_ByteString &result, FX_INT32 lgPatternFound, FX_INT32 &e) +void CBC_OnedEAN13Reader::DetermineFirstDigit(CFX_ByteString &result, int32_t lgPatternFound, int32_t &e) { - for (FX_INT32 d = 0; d < 10; d++) { + for (int32_t d = 0; d < 10; d++) { if (lgPatternFound == FIRST_DIGIT_ENCODINGS[d]) { result.Insert(0, (FX_CHAR) ('0' + d)); return; @@ -46,21 +46,21 @@ void CBC_OnedEAN13Reader::DetermineFirstDigit(CFX_ByteString &result, FX_INT32 l e = BCExceptionNotFound; BC_EXCEPTION_CHECK_ReturnVoid(e); } -FX_INT32 CBC_OnedEAN13Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, FX_INT32 &e) +int32_t CBC_OnedEAN13Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, int32_t &e) { CFX_Int32Array counters; counters.Add(0); counters.Add(0); counters.Add(0); counters.Add(0); - FX_INT32 end = row->GetSize(); - FX_INT32 rowOffset = (*startRange)[1]; - FX_INT32 lgPatternFound = 0; - for (FX_INT32 x = 0; x < 6 && rowOffset < end; x++) { - FX_INT32 bestMatch = DecodeDigit(row, &counters, rowOffset, &(CBC_OneDimReader::L_AND_G_PATTERNS[0][0]), 20, e); + int32_t end = row->GetSize(); + int32_t rowOffset = (*startRange)[1]; + int32_t lgPatternFound = 0; + for (int32_t x = 0; x < 6 && rowOffset < end; x++) { + int32_t bestMatch = DecodeDigit(row, &counters, rowOffset, &(CBC_OneDimReader::L_AND_G_PATTERNS[0][0]), 20, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); resultString += (FX_CHAR) ('0' + bestMatch % 10); - for (FX_INT32 i = 0; i < counters.GetSize(); i++) { + for (int32_t i = 0; i < counters.GetSize(); i++) { rowOffset += counters[i]; } if (bestMatch >= 10) { @@ -82,11 +82,11 @@ FX_INT32 CBC_OnedEAN13Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Arr delete middleRange; middleRange = NULL; } - for (FX_INT32 Y = 0; Y < 6 && rowOffset < end; Y++) { - FX_INT32 bestMatch = DecodeDigit(row, &counters, rowOffset, &(CBC_OneDimReader::L_PATTERNS[0][0]), 10, e); + for (int32_t Y = 0; Y < 6 && rowOffset < end; Y++) { + int32_t bestMatch = DecodeDigit(row, &counters, rowOffset, &(CBC_OneDimReader::L_PATTERNS[0][0]), 10, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); resultString += (FX_CHAR) ('0' + bestMatch); - for (FX_INT32 k = 0; k < counters.GetSize(); k++) { + for (int32_t k = 0; k < counters.GetSize(); k++) { rowOffset += counters[k]; } } diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h b/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h index 9afb9b6418..7c31fd4f20 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h @@ -12,13 +12,13 @@ class CBC_OnedEAN13Reader; class CBC_OnedEAN13Reader : public CBC_OneDimReader { public: - const static FX_INT32 FIRST_DIGIT_ENCODINGS[10]; + const static int32_t FIRST_DIGIT_ENCODINGS[10]; CBC_OnedEAN13Reader(); virtual ~CBC_OnedEAN13Reader(); private: - void DetermineFirstDigit(CFX_ByteString &result, FX_INT32 lgPatternFound, FX_INT32 &e); + void DetermineFirstDigit(CFX_ByteString &result, int32_t lgPatternFound, int32_t &e); protected: - FX_INT32 DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, FX_INT32 &e); + int32_t DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, int32_t &e); friend class CBC_OnedUPCAReader; }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp index 788cd8f7da..4b258a5a9f 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp @@ -42,7 +42,7 @@ CBC_OnedEAN13Writer::~CBC_OnedEAN13Writer() } FX_BOOL CBC_OnedEAN13Writer::CheckContentValidity(FX_WSTR contents) { - for (FX_INT32 i = 0; i < contents.GetLength(); i++) { + for (int32_t i = 0; i < contents.GetLength(); i++) { if (contents.GetAt(i) >= '0' && contents.GetAt(i) <= '9') { continue; } else { @@ -55,7 +55,7 @@ CFX_WideString CBC_OnedEAN13Writer::FilterContents(FX_WSTR contents) { CFX_WideString filtercontents; FX_WCHAR ch; - for (FX_INT32 i = 0; i < contents.GetLength(); i++) { + for (int32_t i = 0; i < contents.GetLength(); i++) { ch = contents.GetAt(i); if(ch > 175) { i++; @@ -67,12 +67,12 @@ CFX_WideString CBC_OnedEAN13Writer::FilterContents(FX_WSTR contents) } return filtercontents; } -FX_INT32 CBC_OnedEAN13Writer::CalcChecksum(const CFX_ByteString &contents) +int32_t CBC_OnedEAN13Writer::CalcChecksum(const CFX_ByteString &contents) { - FX_INT32 odd = 0; - FX_INT32 even = 0; - FX_INT32 j = 1; - for(FX_INT32 i = contents.GetLength() - 1; i >= 0; i--) { + int32_t odd = 0; + int32_t even = 0; + int32_t j = 1; + for(int32_t i = contents.GetLength() - 1; i >= 0; i--) { if(j % 2) { odd += FXSYS_atoi(contents.Mid(i, 1)); } else { @@ -80,45 +80,45 @@ FX_INT32 CBC_OnedEAN13Writer::CalcChecksum(const CFX_ByteString &contents) } j++; } - FX_INT32 checksum = (odd * 3 + even) % 10; + int32_t checksum = (odd * 3 + even) % 10; checksum = (10 - checksum) % 10; return (checksum); } -FX_BYTE *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e) { - FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0, e); + uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -FX_BYTE *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) +uint8_t *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) { if(format != BCFORMAT_EAN_13) { e = BCExceptionOnlyEncodeEAN_13; } - FX_BYTE *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e); + uint8_t *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -FX_BYTE *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e) +uint8_t *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e) { if (contents.GetLength() != 13) { e = BCExceptionDigitLengthShould13; return NULL; } m_iDataLenth = 13; - FX_INT32 firstDigit = FXSYS_atoi(contents.Mid(0, 1)); - FX_INT32 parities = CBC_OnedEAN13Reader::FIRST_DIGIT_ENCODINGS[firstDigit]; + int32_t firstDigit = FXSYS_atoi(contents.Mid(0, 1)); + int32_t parities = CBC_OnedEAN13Reader::FIRST_DIGIT_ENCODINGS[firstDigit]; outLength = m_codeWidth; - FX_BYTE *result = FX_Alloc(FX_BYTE, m_codeWidth); - FX_INT32 pos = 0; + uint8_t *result = FX_Alloc(uint8_t, m_codeWidth); + int32_t pos = 0; pos += AppendPattern(result, pos, CBC_OneDimReader::START_END_PATTERN, 3, 1, e); if (e != BCExceptionNO) { FX_Free (result); return NULL; } - FX_INT32 i = 0; + int32_t i = 0; for ( i = 1; i <= 6; i++) { - FX_INT32 digit = FXSYS_atoi(contents.Mid(i, 1)); + int32_t digit = FXSYS_atoi(contents.Mid(i, 1)); if ((parities >> (6 - i) & 1) == 1) { digit += 10; } @@ -134,7 +134,7 @@ FX_BYTE *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, FX_INT32 &o return NULL; } for (i = 7; i <= 12; i++) { - FX_INT32 digit = FXSYS_atoi(contents.Mid(i, 1)); + int32_t digit = FXSYS_atoi(contents.Mid(i, 1)); pos += AppendPattern(result, pos, CBC_OneDimReader::L_PATTERNS[digit], 4, 1, e); if (e != BCExceptionNO) { FX_Free (result); @@ -148,16 +148,16 @@ FX_BYTE *CBC_OnedEAN13Writer::Encode(const CFX_ByteString &contents, FX_INT32 &o } return result; } -void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e) +void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e) { if (device == NULL && pOutBitmap == NULL) { e = BCExceptionIllegalArgument; return; } - FX_INT32 leftPadding = 7 * multiple; - FX_INT32 leftPosition = 3 * multiple + leftPadding; + int32_t leftPadding = 7 * multiple; + int32_t leftPosition = 3 * multiple + leftPadding; CFX_ByteString str = FX_UTF8Encode(contents); - FX_INT32 iLen = str.GetLength(); + int32_t iLen = str.GetLength(); FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, iLen); if (!pCharPos) { return; @@ -167,10 +167,10 @@ void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, if (pOutBitmap != NULL) { geBitmap.Attach(pOutBitmap); } - FX_INT32 iFontSize = (FX_INT32)fabs(m_fFontSize); - FX_INT32 iTextHeight = iFontSize + 1; + int32_t iFontSize = (int32_t)fabs(m_fFontSize); + int32_t iTextHeight = iFontSize + 1; CFX_ByteString tempStr = str.Mid(1, 6); - FX_INT32 strWidth = multiple * 42; + int32_t strWidth = multiple * 42; if (pOutBitmap == NULL) { CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); CFX_FloatRect rect((FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight), (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height); @@ -184,7 +184,7 @@ void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, matr1.TransformRect(rect1); re = rect1.GetOutterRect(); device->FillRect(&re, m_backgroundColor); - FX_INT32 strWidth1 = multiple * 7; + int32_t strWidth1 = multiple * 7; CFX_Matrix matr2(m_outputHScale, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f); CFX_FloatRect rect2(0.0f, (FX_FLOAT)(m_Height - iTextHeight), (FX_FLOAT)strWidth1 - 0.5f, (FX_FLOAT)m_Height); matr2.Concat(*matrix); @@ -196,7 +196,7 @@ void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, FX_FLOAT charsWidth = 0; iLen = tempStr.GetLength(); if (pOutBitmap == NULL) { - strWidth = (FX_INT32)(strWidth * m_outputHScale); + strWidth = (int32_t)(strWidth * m_outputHScale); } CalcTextInfo(tempStr, pCharPos + 1, m_pFont, (FX_FLOAT)strWidth, iFontSize, blank); CFX_AffineMatrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize); @@ -258,7 +258,7 @@ void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, iLen = tempStr.GetLength(); strWidth = multiple * 7; if (pOutBitmap == NULL) { - strWidth = (FX_INT32)(strWidth * m_outputHScale); + strWidth = (int32_t)(strWidth * m_outputHScale); } CalcTextInfo(tempStr, pCharPos, m_pFont, (FX_FLOAT)strWidth, iFontSize, blank); if(pOutBitmap != NULL) { @@ -288,7 +288,7 @@ void CBC_OnedEAN13Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, } FX_Free(pCharPos); } -void CBC_OnedEAN13Writer::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e) +void CBC_OnedEAN13Writer::RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e) { CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e); } diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.h b/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.h index 2353cfda95..df9d635a4e 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.h +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.h @@ -11,21 +11,21 @@ class CBC_OnedEAN13Writer; class CBC_OnedEAN13Writer : public CBC_OneDimWriter { private: - FX_INT32 m_codeWidth; + int32_t m_codeWidth; public: CBC_OnedEAN13Writer(); virtual ~CBC_OnedEAN13Writer(); - FX_BYTE* Encode(const CFX_ByteString &contents, BCFORMAT format, - FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BYTE* Encode(const CFX_ByteString &contents, BCFORMAT format, - FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e); - FX_BYTE* Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e); - void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e); + uint8_t* Encode(const CFX_ByteString &contents, BCFORMAT format, + int32_t &outWidth, int32_t &outHeight, int32_t &e); + uint8_t* Encode(const CFX_ByteString &contents, BCFORMAT format, + int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e); + uint8_t* Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e); + void RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e); FX_BOOL CheckContentValidity(FX_WSTR contents); CFX_WideString FilterContents(FX_WSTR contents); - FX_INT32 CalcChecksum(const CFX_ByteString &contents); + int32_t CalcChecksum(const CFX_ByteString &contents); protected: - void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e); + void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.cpp b/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.cpp index 48e24681df..4b5de72939 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.cpp @@ -32,25 +32,25 @@ CBC_OnedEAN8Reader::CBC_OnedEAN8Reader() CBC_OnedEAN8Reader::~CBC_OnedEAN8Reader() { } -FX_INT32 CBC_OnedEAN8Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultResult, FX_INT32 &e) +int32_t CBC_OnedEAN8Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultResult, int32_t &e) { CFX_Int32Array counters; counters.Add(0); counters.Add(0); counters.Add(0); counters.Add(0); - FX_INT32 end = row->GetSize(); - FX_INT32 rowOffset = (*startRange)[1]; - FX_INT32 rowOffsetLeft = rowOffset; - for (FX_INT32 x = 0; x < 4 && rowOffset < end; x++) { - FX_INT32 bestMatch = DecodeDigit(row, &counters, rowOffset, &(CBC_OneDimReader::L_PATTERNS[0][0]), 10, e); + int32_t end = row->GetSize(); + int32_t rowOffset = (*startRange)[1]; + int32_t rowOffsetLeft = rowOffset; + for (int32_t x = 0; x < 4 && rowOffset < end; x++) { + int32_t bestMatch = DecodeDigit(row, &counters, rowOffset, &(CBC_OneDimReader::L_PATTERNS[0][0]), 10, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); resultResult += (FX_CHAR) ('0' + bestMatch); - for (FX_INT32 i = 0; i < counters.GetSize(); i++) { + for (int32_t i = 0; i < counters.GetSize(); i++) { rowOffset += counters[i]; } } - FX_INT32 RowOffsetLen = (rowOffset - rowOffsetLeft) / 4; + int32_t RowOffsetLen = (rowOffset - rowOffsetLeft) / 4; CFX_Int32Array result; result.Add(CBC_OneDimReader::MIDDLE_PATTERN[0]); result.Add(CBC_OneDimReader::MIDDLE_PATTERN[1]); @@ -59,7 +59,7 @@ FX_INT32 CBC_OnedEAN8Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Arra result.Add(CBC_OneDimReader::MIDDLE_PATTERN[4]); CFX_Int32Array *middleRange = FindGuardPattern(row, rowOffset, TRUE, &result, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); - FX_INT32 rowOffsetMid = rowOffset; + int32_t rowOffsetMid = rowOffset; rowOffset = (*middleRange)[1]; if((rowOffset - rowOffsetMid) > RowOffsetLen) { e = BCExceptionNotFound; @@ -69,11 +69,11 @@ FX_INT32 CBC_OnedEAN8Reader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Arra delete middleRange; middleRange = NULL; } - for (FX_INT32 y = 0; y < 4 && rowOffset < end; y++) { - FX_INT32 bestMatch = DecodeDigit(row, & counters, rowOffset, &(CBC_OneDimReader::L_PATTERNS[0][0]), 10, e); + for (int32_t y = 0; y < 4 && rowOffset < end; y++) { + int32_t bestMatch = DecodeDigit(row, & counters, rowOffset, &(CBC_OneDimReader::L_PATTERNS[0][0]), 10, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); resultResult += (FX_CHAR) ('0' + bestMatch); - for (FX_INT32 i = 0; i < counters.GetSize(); i++) { + for (int32_t i = 0; i < counters.GetSize(); i++) { rowOffset += counters[i]; } } diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.h b/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.h index a32bb63083..f2aa93c8ea 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.h @@ -15,6 +15,6 @@ public: CBC_OnedEAN8Reader(); virtual ~CBC_OnedEAN8Reader(); protected: - FX_INT32 DecodeMiddle(CBC_CommonBitArray*, CFX_Int32Array *startRange, CFX_ByteString &result, FX_INT32 &e); + int32_t DecodeMiddle(CBC_CommonBitArray*, CFX_Int32Array *startRange, CFX_ByteString &result, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp index 19f7f7cede..fdf791c686 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp @@ -40,7 +40,7 @@ CBC_OnedEAN8Writer::CBC_OnedEAN8Writer() CBC_OnedEAN8Writer::~CBC_OnedEAN8Writer() { } -void CBC_OnedEAN8Writer::SetDataLength(FX_INT32 length) +void CBC_OnedEAN8Writer::SetDataLength(int32_t length) { m_iDataLenth = 8; } @@ -54,7 +54,7 @@ FX_BOOL CBC_OnedEAN8Writer::SetTextLocation(BC_TEXT_LOC location) } FX_BOOL CBC_OnedEAN8Writer::CheckContentValidity(FX_WSTR contents) { - for (FX_INT32 i = 0; i < contents.GetLength(); i++) { + for (int32_t i = 0; i < contents.GetLength(); i++) { if (contents.GetAt(i) >= '0' && contents.GetAt(i) <= '9') { continue; } else { @@ -67,7 +67,7 @@ CFX_WideString CBC_OnedEAN8Writer::FilterContents(FX_WSTR contents) { CFX_WideString filtercontents; FX_WCHAR ch; - for (FX_INT32 i = 0; i < contents.GetLength(); i++) { + for (int32_t i = 0; i < contents.GetLength(); i++) { ch = contents.GetAt(i); if(ch > 175) { i++; @@ -79,12 +79,12 @@ CFX_WideString CBC_OnedEAN8Writer::FilterContents(FX_WSTR contents) } return filtercontents; } -FX_INT32 CBC_OnedEAN8Writer::CalcChecksum(const CFX_ByteString &contents) +int32_t CBC_OnedEAN8Writer::CalcChecksum(const CFX_ByteString &contents) { - FX_INT32 odd = 0; - FX_INT32 even = 0; - FX_INT32 j = 1; - for(FX_INT32 i = contents.GetLength() - 1; i >= 0; i--) { + int32_t odd = 0; + int32_t even = 0; + int32_t j = 1; + for(int32_t i = contents.GetLength() - 1; i >= 0; i--) { if(j % 2) { odd += FXSYS_atoi(contents.Mid(i, 1)); } else { @@ -92,44 +92,44 @@ FX_INT32 CBC_OnedEAN8Writer::CalcChecksum(const CFX_ByteString &contents) } j++; } - FX_INT32 checksum = (odd * 3 + even) % 10; + int32_t checksum = (odd * 3 + even) % 10; checksum = (10 - checksum) % 10; return (checksum); } -FX_BYTE *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight , FX_INT32 &e) +uint8_t *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight , int32_t &e) { - FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0, e); + uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -FX_BYTE *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, - FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints , FX_INT32 &e) +uint8_t *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, + int32_t &outWidth, int32_t &outHeight, int32_t hints , int32_t &e) { if (format != BCFORMAT_EAN_8) { e = BCExceptionOnlyEncodeEAN_8; return NULL; } - FX_BYTE *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e); + uint8_t *ret = CBC_OneDimWriter::Encode(contents, format, outWidth, outHeight, hints, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -FX_BYTE *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, FX_INT32 &outLength , FX_INT32 &e) +uint8_t *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, int32_t &outLength , int32_t &e) { if (contents.GetLength() != 8) { e = BCExceptionDigitLengthMustBe8; return NULL; } outLength = m_codeWidth; - FX_BYTE *result = FX_Alloc(FX_BYTE, m_codeWidth); - FX_INT32 pos = 0; + uint8_t *result = FX_Alloc(uint8_t, m_codeWidth); + int32_t pos = 0; pos += AppendPattern(result, pos, CBC_OneDimReader::START_END_PATTERN, 3, 1, e); if (e != BCExceptionNO) { FX_Free (result); return NULL; } - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i <= 3; i++) { - FX_INT32 digit = FXSYS_atoi(contents.Mid(i, 1)); + int32_t digit = FXSYS_atoi(contents.Mid(i, 1)); pos += AppendPattern(result, pos, CBC_OneDimReader::L_PATTERNS[digit], 4, 0, e); if (e != BCExceptionNO) { FX_Free (result); @@ -142,7 +142,7 @@ FX_BYTE *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, FX_INT32 &ou return NULL; } for (i = 4; i <= 7; i++) { - FX_INT32 digit = FXSYS_atoi(contents.Mid(i, 1)); + int32_t digit = FXSYS_atoi(contents.Mid(i, 1)); pos += AppendPattern(result, pos, CBC_OneDimReader::L_PATTERNS[digit], 4, 1, e); if (e != BCExceptionNO) { FX_Free (result); @@ -156,31 +156,31 @@ FX_BYTE *CBC_OnedEAN8Writer::Encode(const CFX_ByteString &contents, FX_INT32 &ou } return result; } -void CBC_OnedEAN8Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e) +void CBC_OnedEAN8Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e) { if (device == NULL && pOutBitmap == NULL) { e = BCExceptionIllegalArgument; return; } - FX_INT32 leftPosition = 3 * multiple; + int32_t leftPosition = 3 * multiple; CFX_ByteString str = FX_UTF8Encode(contents); - FX_INT32 iLength = str.GetLength(); + int32_t iLength = str.GetLength(); FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, iLength); if (!pCharPos) { return; } FXSYS_memset32(pCharPos, 0, sizeof(FXTEXT_CHARPOS) * iLength); CFX_ByteString tempStr = str.Mid(0, 4); - FX_INT32 iLen = tempStr.GetLength(); - FX_INT32 strWidth = 7 * multiple * 4; + int32_t iLen = tempStr.GetLength(); + int32_t strWidth = 7 * multiple * 4; FX_FLOAT blank = 0.0; CFX_FxgeDevice geBitmap; if (pOutBitmap != NULL) { geBitmap.Attach(pOutBitmap); } FX_FLOAT charsWidth = 0; - FX_INT32 iFontSize = (FX_INT32)fabs(m_fFontSize); - FX_INT32 iTextHeight = iFontSize + 1; + int32_t iFontSize = (int32_t)fabs(m_fFontSize); + int32_t iTextHeight = iFontSize + 1; if (pOutBitmap == NULL) { CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); CFX_FloatRect rect((FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight), (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height); @@ -196,7 +196,7 @@ void CBC_OnedEAN8Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, C device->FillRect(&re, m_backgroundColor); } if (pOutBitmap == NULL) { - strWidth = (FX_INT32)(strWidth * m_outputHScale); + strWidth = (int32_t)(strWidth * m_outputHScale); } CalcTextInfo(tempStr, pCharPos, m_pFont, (FX_FLOAT)strWidth, iFontSize, blank); CFX_AffineMatrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize); @@ -255,7 +255,7 @@ void CBC_OnedEAN8Writer::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, C } FX_Free(pCharPos); } -void CBC_OnedEAN8Writer::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e) +void CBC_OnedEAN8Writer::RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e) { CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e); } diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.h b/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.h index 2b55734538..f2e5cc2cbe 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.h +++ b/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.h @@ -12,21 +12,21 @@ class CBC_OnedEAN8Writer; class CBC_OnedEAN8Writer : public CBC_OneDimWriter { private: - FX_INT32 m_codeWidth; + int32_t m_codeWidth; public: CBC_OnedEAN8Writer(); virtual ~CBC_OnedEAN8Writer(); - FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight , FX_INT32 &e); - FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints , FX_INT32 &e); - FX_BYTE * Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e); - void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e); + uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight , int32_t &e); + uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints , int32_t &e); + uint8_t * Encode(const CFX_ByteString &contents, int32_t &outLength, int32_t &e); + void RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e); FX_BOOL CheckContentValidity(FX_WSTR contents); CFX_WideString FilterContents(FX_WSTR contents); - void SetDataLength(FX_INT32 length); + void SetDataLength(int32_t length); FX_BOOL SetTextLocation(BC_TEXT_LOC location); - FX_INT32 CalcChecksum(const CFX_ByteString &contents); + int32_t CalcChecksum(const CFX_ByteString &contents); protected: - void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e); + void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.cpp b/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.cpp index 44c26acf7e..0156ba4af7 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.cpp @@ -42,7 +42,7 @@ CBC_OnedUPCAReader::~CBC_OnedUPCAReader() } m_ean13Reader = NULL; } -CFX_ByteString CBC_OnedUPCAReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_OnedUPCAReader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e) { CFX_ByteString bytestring = m_ean13Reader->DecodeRow(rowNumber, row, hints, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); @@ -50,7 +50,7 @@ CFX_ByteString CBC_OnedUPCAReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitAr BC_EXCEPTION_CHECK_ReturnValue(e, ""); return temp; } -CFX_ByteString CBC_OnedUPCAReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_OnedUPCAReader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, int32_t hints, int32_t &e) { CFX_ByteString bytestring = m_ean13Reader->DecodeRow(rowNumber, row, startGuardRange, hints, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); @@ -58,7 +58,7 @@ CFX_ByteString CBC_OnedUPCAReader::DecodeRow(FX_INT32 rowNumber, CBC_CommonBitAr BC_EXCEPTION_CHECK_ReturnValue(e, ""); return temp; } -CFX_ByteString CBC_OnedUPCAReader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e) +CFX_ByteString CBC_OnedUPCAReader::Decode(CBC_BinaryBitmap *image, int32_t &e) { CFX_ByteString bytestring = m_ean13Reader->Decode(image, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); @@ -66,7 +66,7 @@ CFX_ByteString CBC_OnedUPCAReader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, ""); return temp; } -CFX_ByteString CBC_OnedUPCAReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_OnedUPCAReader::Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e) { CFX_ByteString bytestring = m_ean13Reader->Decode(image, hints, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); @@ -74,13 +74,13 @@ CFX_ByteString CBC_OnedUPCAReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hint BC_EXCEPTION_CHECK_ReturnValue(e, ""); return temp; } -FX_INT32 CBC_OnedUPCAReader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, FX_INT32 &e) +int32_t CBC_OnedUPCAReader::DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, int32_t &e) { - FX_INT32 temp = m_ean13Reader->DecodeMiddle(row, startRange, resultString, e); + int32_t temp = m_ean13Reader->DecodeMiddle(row, startRange, resultString, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); return temp; } -CFX_ByteString CBC_OnedUPCAReader::MaybeReturnResult(CFX_ByteString &result, FX_INT32 &e) +CFX_ByteString CBC_OnedUPCAReader::MaybeReturnResult(CFX_ByteString &result, int32_t &e) { if(result[0] == '0') { result.Delete(0); diff --git a/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h b/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h index 5df6c739ff..c1eccb57d1 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h @@ -18,13 +18,13 @@ private: public: CBC_OnedUPCAReader(); virtual ~CBC_OnedUPCAReader(); - CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e); - CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, FX_INT32 hints, FX_INT32 &e); - CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e); - CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e); + CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, int32_t hints, int32_t &e); + CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, int32_t hints, int32_t &e); + CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e); + CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e); virtual void Init(); protected: - FX_INT32 DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, FX_INT32 &e); - CFX_ByteString MaybeReturnResult(CFX_ByteString &result, FX_INT32 &e); + int32_t DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, int32_t &e); + CFX_ByteString MaybeReturnResult(CFX_ByteString &result, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp index 612c031c02..56324a8e1a 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp @@ -44,7 +44,7 @@ CBC_OnedUPCAWriter::~CBC_OnedUPCAWriter() } FX_BOOL CBC_OnedUPCAWriter::CheckContentValidity(FX_WSTR contents) { - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < contents.GetLength(); i++) { if (contents.GetAt(i) >= '0' && contents.GetAt(i) <= '9') { continue; @@ -58,7 +58,7 @@ CFX_WideString CBC_OnedUPCAWriter::FilterContents(FX_WSTR contents) { CFX_WideString filtercontents; FX_WCHAR ch; - for (FX_INT32 i = 0; i < contents.GetLength(); i++) { + for (int32_t i = 0; i < contents.GetLength(); i++) { ch = contents.GetAt(i); if(ch > 175) { i++; @@ -70,12 +70,12 @@ CFX_WideString CBC_OnedUPCAWriter::FilterContents(FX_WSTR contents) } return filtercontents; } -FX_INT32 CBC_OnedUPCAWriter::CalcChecksum(const CFX_ByteString &contents) +int32_t CBC_OnedUPCAWriter::CalcChecksum(const CFX_ByteString &contents) { - FX_INT32 odd = 0; - FX_INT32 even = 0; - FX_INT32 j = 1; - for(FX_INT32 i = contents.GetLength() - 1; i >= 0; i--) { + int32_t odd = 0; + int32_t even = 0; + int32_t j = 1; + for(int32_t i = contents.GetLength() - 1; i >= 0; i--) { if(j % 2) { odd += FXSYS_atoi(contents.Mid(i, 1)); } else { @@ -83,17 +83,17 @@ FX_INT32 CBC_OnedUPCAWriter::CalcChecksum(const CFX_ByteString &contents) } j++; } - FX_INT32 checksum = (odd * 3 + even) % 10; + int32_t checksum = (odd * 3 + even) % 10; checksum = (10 - checksum) % 10; return (checksum); } -FX_BYTE *CBC_OnedUPCAWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t *CBC_OnedUPCAWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e) { - FX_BYTE *ret = Encode(contents, format, outWidth, outHeight, 0, e); + uint8_t *ret = Encode(contents, format, outWidth, outHeight, 0, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -FX_BYTE *CBC_OnedUPCAWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) +uint8_t *CBC_OnedUPCAWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) { if (format != BCFORMAT_UPC_A) { e = BCExceptionOnlyEncodeUPC_A; @@ -101,20 +101,20 @@ FX_BYTE *CBC_OnedUPCAWriter::Encode(const CFX_ByteString &contents, BCFORMAT for } CFX_ByteString toEAN13String = '0' + contents; m_iDataLenth = 13; - FX_BYTE *ret = m_subWriter->Encode(toEAN13String, BCFORMAT_EAN_13, outWidth, outHeight, hints, e); + uint8_t *ret = m_subWriter->Encode(toEAN13String, BCFORMAT_EAN_13, outWidth, outHeight, hints, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return ret; } -void CBC_OnedUPCAWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e) +void CBC_OnedUPCAWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e) { if (device == NULL && pOutBitmap == NULL) { e = BCExceptionIllegalArgument; return; } - FX_INT32 leftPadding = 7 * multiple; - FX_INT32 leftPosition = 10 * multiple + leftPadding; + int32_t leftPadding = 7 * multiple; + int32_t leftPosition = 10 * multiple + leftPadding; CFX_ByteString str = FX_UTF8Encode(contents); - FX_INT32 iLen = str.GetLength(); + int32_t iLen = str.GetLength(); FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, iLen); if (!pCharPos) { return; @@ -129,8 +129,8 @@ void CBC_OnedUPCAWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, C } FX_FLOAT charsWidth = 0; iLen = tempStr.GetLength(); - FX_INT32 iFontSize = (FX_INT32)fabs(m_fFontSize); - FX_INT32 iTextHeight = iFontSize + 1; + int32_t iFontSize = (int32_t)fabs(m_fFontSize); + int32_t iTextHeight = iFontSize + 1; if (pOutBitmap == NULL) { CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); CFX_FloatRect rect((FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight), (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height); @@ -278,7 +278,7 @@ void CBC_OnedUPCAWriter::ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, C } FX_Free(pCharPos); } -void CBC_OnedUPCAWriter::RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e) +void CBC_OnedUPCAWriter::RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e) { CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e); } diff --git a/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.h b/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.h index 4174ceb36e..ff59f9b660 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.h +++ b/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.h @@ -17,15 +17,15 @@ public: CBC_OnedUPCAWriter(); virtual ~CBC_OnedUPCAWriter(); virtual void Init(); - FX_BYTE* Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BYTE* Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e); - void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e); + uint8_t* Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e); + uint8_t* Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e); + void RenderResult(FX_WSTR contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, int32_t &e); FX_BOOL CheckContentValidity(FX_WSTR contents); CFX_WideString FilterContents(FX_WSTR contents); - FX_INT32 CalcChecksum(const CFX_ByteString &contents); + int32_t CalcChecksum(const CFX_ByteString &contents); protected: - void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e); + void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417.cpp index 96d3a3b655..366b172863 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417.cpp @@ -27,9 +27,9 @@ #include "BC_PDF417ErrorCorrection.h" #include "BC_PDF417HighLevelEncoder.h" #include "BC_PDF417.h" -FX_INT32 CBC_PDF417::START_PATTERN = 0x1fea8; -FX_INT32 CBC_PDF417::STOP_PATTERN = 0x3fa29; -FX_INT32 CBC_PDF417::CODEWORD_TABLE[][1000] = { +int32_t CBC_PDF417::START_PATTERN = 0x1fea8; +int32_t CBC_PDF417::STOP_PATTERN = 0x3fa29; +int32_t CBC_PDF417::CODEWORD_TABLE[][1000] = { { 0x1d5c0, 0x1eaf0, 0x1f57c, 0x1d4e0, 0x1ea78, 0x1f53e, 0x1a8c0, 0x1d470, 0x1a860, 0x15040, 0x1a830, 0x15020, @@ -535,28 +535,28 @@ CBC_BarcodeMatrix* CBC_PDF417::getBarcodeMatrix() { return m_barcodeMatrix; } -void CBC_PDF417::generateBarcodeLogic(CFX_WideString msg, FX_INT32 errorCorrectionLevel, FX_INT32 &e) +void CBC_PDF417::generateBarcodeLogic(CFX_WideString msg, int32_t errorCorrectionLevel, int32_t &e) { - FX_INT32 errorCorrectionCodeWords = CBC_PDF417ErrorCorrection::getErrorCorrectionCodewordCount(errorCorrectionLevel, e); + int32_t errorCorrectionCodeWords = CBC_PDF417ErrorCorrection::getErrorCorrectionCodewordCount(errorCorrectionLevel, e); BC_EXCEPTION_CHECK_ReturnVoid(e); CFX_WideString highLevel = CBC_PDF417HighLevelEncoder::encodeHighLevel(msg, m_compaction, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 sourceCodeWords = highLevel.GetLength(); + int32_t sourceCodeWords = highLevel.GetLength(); CFX_Int32Array* dimension = determineDimensions(sourceCodeWords, errorCorrectionCodeWords, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 cols = dimension->GetAt(0); - FX_INT32 rows = dimension->GetAt(1); + int32_t cols = dimension->GetAt(0); + int32_t rows = dimension->GetAt(1); delete dimension; - FX_INT32 pad = getNumberOfPadCodewords(sourceCodeWords, errorCorrectionCodeWords, cols, rows); + int32_t pad = getNumberOfPadCodewords(sourceCodeWords, errorCorrectionCodeWords, cols, rows); if (sourceCodeWords + errorCorrectionCodeWords + 1 > 929) { e = BCExceptionEncodedMessageContainsTooManyCodeWords; return; } - FX_INT32 n = sourceCodeWords + pad + 1; + int32_t n = sourceCodeWords + pad + 1; CFX_WideString sb; sb += (FX_WCHAR) n; sb += highLevel; - for (FX_INT32 i = 0; i < pad; i++) { + for (int32_t i = 0; i < pad; i++) { sb += (FX_WCHAR) 900; } CFX_WideString dataCodewords(sb); @@ -566,7 +566,7 @@ void CBC_PDF417::generateBarcodeLogic(CFX_WideString msg, FX_INT32 errorCorrecti m_barcodeMatrix = FX_NEW CBC_BarcodeMatrix(rows, cols); encodeLowLevel(fullCodewords, cols, rows, errorCorrectionLevel, m_barcodeMatrix); } -void CBC_PDF417::setDimensions(FX_INT32 maxCols, FX_INT32 minCols, FX_INT32 maxRows, FX_INT32 minRows) +void CBC_PDF417::setDimensions(int32_t maxCols, int32_t minCols, int32_t maxRows, int32_t minRows) { m_maxCols = maxCols; m_minCols = minCols; @@ -581,25 +581,25 @@ void CBC_PDF417::setCompact(FX_BOOL compact) { m_compact = compact; } -FX_INT32 CBC_PDF417::calculateNumberOfRows(FX_INT32 m, FX_INT32 k, FX_INT32 c) +int32_t CBC_PDF417::calculateNumberOfRows(int32_t m, int32_t k, int32_t c) { - FX_INT32 r = ((m + 1 + k) / c) + 1; + int32_t r = ((m + 1 + k) / c) + 1; if (c * r >= (m + 1 + k + c)) { r--; } return r; } -FX_INT32 CBC_PDF417::getNumberOfPadCodewords(FX_INT32 m, FX_INT32 k, FX_INT32 c, FX_INT32 r) +int32_t CBC_PDF417::getNumberOfPadCodewords(int32_t m, int32_t k, int32_t c, int32_t r) { - FX_INT32 n = c * r - k; + int32_t n = c * r - k; return n > m + 1 ? n - m - 1 : 0; } -void CBC_PDF417::encodeChar(FX_INT32 pattern, FX_INT32 len, CBC_BarcodeRow* logic) +void CBC_PDF417::encodeChar(int32_t pattern, int32_t len, CBC_BarcodeRow* logic) { - FX_INT32 map = 1 << (len - 1); + int32_t map = 1 << (len - 1); FX_BOOL last = ((pattern & map) != 0); - FX_INT32 width = 0; - for (FX_INT32 i = 0; i < len; i++) { + int32_t width = 0; + for (int32_t i = 0; i < len; i++) { FX_BOOL black = ((pattern & map) != 0); if (last == black) { width++; @@ -612,16 +612,16 @@ void CBC_PDF417::encodeChar(FX_INT32 pattern, FX_INT32 len, CBC_BarcodeRow* logi } logic->addBar(last, width); } -void CBC_PDF417::encodeLowLevel(CFX_WideString fullCodewords, FX_INT32 c, FX_INT32 r, FX_INT32 errorCorrectionLevel, CBC_BarcodeMatrix* logic) +void CBC_PDF417::encodeLowLevel(CFX_WideString fullCodewords, int32_t c, int32_t r, int32_t errorCorrectionLevel, CBC_BarcodeMatrix* logic) { - FX_INT32 idx = 0; - for (FX_INT32 y = 0; y < r; y++) { - FX_INT32 cluster = y % 3; + int32_t idx = 0; + for (int32_t y = 0; y < r; y++) { + int32_t cluster = y % 3; logic->startRow(); - FX_INT32 a = START_PATTERN; + int32_t a = START_PATTERN; encodeChar(START_PATTERN, 17, logic->getCurrentRow()); - FX_INT32 left; - FX_INT32 right; + int32_t left; + int32_t right; if (cluster == 0) { left = (30 * (y / 3)) + ((r - 1) / 3); right = (30 * (y / 3)) + (c - 1); @@ -632,9 +632,9 @@ void CBC_PDF417::encodeLowLevel(CFX_WideString fullCodewords, FX_INT32 c, FX_INT left = (30 * (y / 3)) + (c - 1); right = (30 * (y / 3)) + (errorCorrectionLevel * 3) + ((r - 1) % 3); } - FX_INT32 pattern = CODEWORD_TABLE[cluster][left]; + int32_t pattern = CODEWORD_TABLE[cluster][left]; encodeChar(pattern, 17, logic->getCurrentRow()); - for (FX_INT32 x = 0; x < c; x++) { + for (int32_t x = 0; x < c; x++) { pattern = CODEWORD_TABLE[cluster][fullCodewords.GetAt(idx)]; encodeChar(pattern, 17, logic->getCurrentRow()); idx++; @@ -648,12 +648,12 @@ void CBC_PDF417::encodeLowLevel(CFX_WideString fullCodewords, FX_INT32 c, FX_INT } } } -CFX_Int32Array* CBC_PDF417::determineDimensions(FX_INT32 sourceCodeWords, FX_INT32 errorCorrectionCodeWords, FX_INT32 &e) +CFX_Int32Array* CBC_PDF417::determineDimensions(int32_t sourceCodeWords, int32_t errorCorrectionCodeWords, int32_t &e) { FX_FLOAT ratio = 0.0f; CFX_Int32Array* dimension = NULL; - for (FX_INT32 cols = m_minCols; cols <= m_maxCols; cols++) { - FX_INT32 rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, cols); + for (int32_t cols = m_minCols; cols <= m_maxCols; cols++) { + int32_t rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, cols); if (rows < m_minRows) { break; } @@ -673,7 +673,7 @@ CFX_Int32Array* CBC_PDF417::determineDimensions(FX_INT32 sourceCodeWords, FX_INT dimension->Add(rows); } if (dimension == NULL) { - FX_INT32 rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, m_minCols); + int32_t rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, m_minCols); if (rows < m_minRows) { dimension = FX_NEW CFX_Int32Array; dimension->Add(m_minCols); diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417.h b/xfa/src/fxbarcode/pdf417/BC_PDF417.h index 928afe80d2..21d902ef7a 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417.h @@ -16,29 +16,29 @@ public: CBC_PDF417(FX_BOOL compact); virtual ~CBC_PDF417(); CBC_BarcodeMatrix* getBarcodeMatrix(); - void generateBarcodeLogic(CFX_WideString msg, FX_INT32 errorCorrectionLevel, FX_INT32 &e); - void setDimensions(FX_INT32 maxCols, FX_INT32 minCols, FX_INT32 maxRows, FX_INT32 minRows); + void generateBarcodeLogic(CFX_WideString msg, int32_t errorCorrectionLevel, int32_t &e); + void setDimensions(int32_t maxCols, int32_t minCols, int32_t maxRows, int32_t minRows); void setCompaction(Compaction compaction); void setCompact(FX_BOOL compact); private: - static FX_INT32 START_PATTERN; - static FX_INT32 STOP_PATTERN; - static FX_INT32 CODEWORD_TABLE[][1000]; + static int32_t START_PATTERN; + static int32_t STOP_PATTERN; + static int32_t CODEWORD_TABLE[][1000]; static FX_FLOAT PREFERRED_RATIO; static FX_FLOAT DEFAULT_MODULE_WIDTH; static FX_FLOAT HEIGHT; CBC_BarcodeMatrix* m_barcodeMatrix; FX_BOOL m_compact; Compaction m_compaction; - FX_INT32 m_minCols; - FX_INT32 m_maxCols; - FX_INT32 m_maxRows; - FX_INT32 m_minRows; + int32_t m_minCols; + int32_t m_maxCols; + int32_t m_maxRows; + int32_t m_minRows; private: - static FX_INT32 calculateNumberOfRows(FX_INT32 m, FX_INT32 k, FX_INT32 c); - static FX_INT32 getNumberOfPadCodewords(FX_INT32 m, FX_INT32 k, FX_INT32 c, FX_INT32 r); - static void encodeChar(FX_INT32 pattern, FX_INT32 len, CBC_BarcodeRow* logic); - void encodeLowLevel(CFX_WideString fullCodewords, FX_INT32 c, FX_INT32 r, FX_INT32 errorCorrectionLevel, CBC_BarcodeMatrix* logic); - CFX_Int32Array* determineDimensions(FX_INT32 sourceCodeWords, FX_INT32 errorCorrectionCodeWords, FX_INT32 &e); + static int32_t calculateNumberOfRows(int32_t m, int32_t k, int32_t c); + static int32_t getNumberOfPadCodewords(int32_t m, int32_t k, int32_t c, int32_t r); + static void encodeChar(int32_t pattern, int32_t len, CBC_BarcodeRow* logic); + void encodeLowLevel(CFX_WideString fullCodewords, int32_t c, int32_t r, int32_t errorCorrectionLevel, CBC_BarcodeMatrix* logic); + CFX_Int32Array* determineDimensions(int32_t sourceCodeWords, int32_t errorCorrectionCodeWords, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp index e45562ba79..aa30e25d49 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp @@ -23,10 +23,10 @@ #include "../barcode.h" #include "BC_PDF417BarcodeRow.h" #include "BC_PDF417BarcodeMatrix.h" -CBC_BarcodeMatrix::CBC_BarcodeMatrix(FX_INT32 height, FX_INT32 width) +CBC_BarcodeMatrix::CBC_BarcodeMatrix(int32_t height, int32_t width) { m_matrix.SetSize(height + 2); - for (FX_INT32 i = 0, matrixLength = m_matrix.GetSize(); i < matrixLength; i++) { + for (int32_t i = 0, matrixLength = m_matrix.GetSize(); i < matrixLength; i++) { m_matrix[i] = FX_NEW CBC_BarcodeRow((width + 4) * 17 + 1); } m_width = width * 17; @@ -37,19 +37,19 @@ CBC_BarcodeMatrix::CBC_BarcodeMatrix(FX_INT32 height, FX_INT32 width) } CBC_BarcodeMatrix::~CBC_BarcodeMatrix() { - for (FX_INT32 i = 0; i < m_matrix.GetSize(); i++) { + for (int32_t i = 0; i < m_matrix.GetSize(); i++) { delete (CBC_BarcodeRow*)m_matrix.GetAt(i); } m_matrix.RemoveAll(); m_matrixOut.RemoveAll(); } -void CBC_BarcodeMatrix::set(FX_INT32 x, FX_INT32 y, FX_BYTE value) +void CBC_BarcodeMatrix::set(int32_t x, int32_t y, uint8_t value) { ((CBC_BarcodeRow*)m_matrix[y])->set(x, value); } -void CBC_BarcodeMatrix::setMatrix(FX_INT32 x, FX_INT32 y, FX_BOOL black) +void CBC_BarcodeMatrix::setMatrix(int32_t x, int32_t y, FX_BOOL black) { - set(x, y, (FX_BYTE) (black ? 1 : 0)); + set(x, y, (uint8_t) (black ? 1 : 0)); } void CBC_BarcodeMatrix::startRow() { @@ -59,11 +59,11 @@ CBC_BarcodeRow* CBC_BarcodeMatrix::getCurrentRow() { return (CBC_BarcodeRow*)m_matrix[m_currentRow]; } -FX_INT32 CBC_BarcodeMatrix::getWidth() +int32_t CBC_BarcodeMatrix::getWidth() { return m_outWidth; } -FX_INT32 CBC_BarcodeMatrix::getHeight() +int32_t CBC_BarcodeMatrix::getHeight() { return m_outHeight; } @@ -71,26 +71,26 @@ CFX_ByteArray& CBC_BarcodeMatrix::getMatrix() { return getScaledMatrix(1, 1); } -CFX_ByteArray& CBC_BarcodeMatrix::getScaledMatrix(FX_INT32 scale) +CFX_ByteArray& CBC_BarcodeMatrix::getScaledMatrix(int32_t scale) { return getScaledMatrix(scale, scale); } -CFX_ByteArray& CBC_BarcodeMatrix::getScaledMatrix(FX_INT32 xScale, FX_INT32 yScale) +CFX_ByteArray& CBC_BarcodeMatrix::getScaledMatrix(int32_t xScale, int32_t yScale) { - FX_INT32 yMax = m_height * yScale; + int32_t yMax = m_height * yScale; CFX_ByteArray bytearray; bytearray.Copy(((CBC_BarcodeRow*)m_matrix[0])->getScaledRow(xScale)); - FX_INT32 xMax = bytearray.GetSize(); + int32_t xMax = bytearray.GetSize(); m_matrixOut.SetSize(xMax * yMax); m_outWidth = xMax; m_outHeight = yMax; - FX_INT32 k = 0; - for (FX_INT32 i = 0; i < yMax; i++) { + int32_t k = 0; + for (int32_t i = 0; i < yMax; i++) { if (i != 0) { bytearray.Copy(((CBC_BarcodeRow*)m_matrix[i / yScale])->getScaledRow(xScale)); } k = i * xMax; - for (FX_INT32 l = 0; l < xMax; l++) { + for (int32_t l = 0; l < xMax; l++) { m_matrixOut[k + l] = bytearray.GetAt(l); } } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h index ce0681bfa8..f5f035dbca 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h @@ -11,24 +11,24 @@ class CBC_BarcodeMatrix { public: CBC_BarcodeMatrix(); - CBC_BarcodeMatrix(FX_INT32 height, FX_INT32 width); + CBC_BarcodeMatrix(int32_t height, int32_t width); virtual ~CBC_BarcodeMatrix(); - void set(FX_INT32 x, FX_INT32 y, FX_BYTE value); - void setMatrix(FX_INT32 x, FX_INT32 y, FX_BOOL black); + void set(int32_t x, int32_t y, uint8_t value); + void setMatrix(int32_t x, int32_t y, FX_BOOL black); void startRow(); CBC_BarcodeRow* getCurrentRow(); CFX_ByteArray& getMatrix(); - CFX_ByteArray& getScaledMatrix(FX_INT32 scale); - CFX_ByteArray& getScaledMatrix(FX_INT32 xScale, FX_INT32 yScale); - FX_INT32 getWidth(); - FX_INT32 getHeight(); + CFX_ByteArray& getScaledMatrix(int32_t scale); + CFX_ByteArray& getScaledMatrix(int32_t xScale, int32_t yScale); + int32_t getWidth(); + int32_t getHeight(); private: CFX_PtrArray m_matrix; CFX_ByteArray m_matrixOut; - FX_INT32 m_currentRow; - FX_INT32 m_height; - FX_INT32 m_width; - FX_INT32 m_outWidth; - FX_INT32 m_outHeight; + int32_t m_currentRow; + int32_t m_height; + int32_t m_width; + int32_t m_outWidth; + int32_t m_outHeight; }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.cpp index 456c0e6f2e..fc3f255ec0 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.cpp @@ -22,7 +22,7 @@ #include "../barcode.h" #include "BC_PDF417BarcodeMetadata.h" -CBC_BarcodeMetadata::CBC_BarcodeMetadata(FX_INT32 columnCount, FX_INT32 rowCountUpperPart, FX_INT32 rowCountLowerPart, FX_INT32 errorCorrectionLevel) +CBC_BarcodeMetadata::CBC_BarcodeMetadata(int32_t columnCount, int32_t rowCountUpperPart, int32_t rowCountLowerPart, int32_t errorCorrectionLevel) { m_columnCount = columnCount; m_rowCountUpperPart = rowCountUpperPart; @@ -33,23 +33,23 @@ CBC_BarcodeMetadata::CBC_BarcodeMetadata(FX_INT32 columnCount, FX_INT32 rowCount CBC_BarcodeMetadata::~CBC_BarcodeMetadata() { } -FX_INT32 CBC_BarcodeMetadata::getColumnCount() +int32_t CBC_BarcodeMetadata::getColumnCount() { return m_columnCount; } -FX_INT32 CBC_BarcodeMetadata::getErrorCorrectionLevel() +int32_t CBC_BarcodeMetadata::getErrorCorrectionLevel() { return m_errorCorrectionLevel; } -FX_INT32 CBC_BarcodeMetadata::getRowCount() +int32_t CBC_BarcodeMetadata::getRowCount() { return m_rowCount; } -FX_INT32 CBC_BarcodeMetadata::getRowCountUpperPart() +int32_t CBC_BarcodeMetadata::getRowCountUpperPart() { return m_rowCountUpperPart; } -FX_INT32 CBC_BarcodeMetadata::getRowCountLowerPart() +int32_t CBC_BarcodeMetadata::getRowCountLowerPart() { return m_rowCountLowerPart; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h index 6e2aa4d952..f25e37c1b4 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h @@ -10,18 +10,18 @@ class CBC_BarcodeMetadata; class CBC_BarcodeMetadata { public: - CBC_BarcodeMetadata(FX_INT32 columnCount, FX_INT32 rowCountUpperPart, FX_INT32 rowCountLowerPart, FX_INT32 errorCorrectionLevel); + CBC_BarcodeMetadata(int32_t columnCount, int32_t rowCountUpperPart, int32_t rowCountLowerPart, int32_t errorCorrectionLevel); virtual ~CBC_BarcodeMetadata(); - FX_INT32 getColumnCount(); - FX_INT32 getErrorCorrectionLevel(); - FX_INT32 getRowCount(); - FX_INT32 getRowCountUpperPart(); - FX_INT32 getRowCountLowerPart(); + int32_t getColumnCount(); + int32_t getErrorCorrectionLevel(); + int32_t getRowCount(); + int32_t getRowCountUpperPart(); + int32_t getRowCountLowerPart(); private: - FX_INT32 m_columnCount; - FX_INT32 m_errorCorrectionLevel; - FX_INT32 m_rowCountUpperPart; - FX_INT32 m_rowCountLowerPart; - FX_INT32 m_rowCount; + int32_t m_columnCount; + int32_t m_errorCorrectionLevel; + int32_t m_rowCountUpperPart; + int32_t m_rowCountLowerPart; + int32_t m_rowCount; }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp index 02bc0f5574..8918d32600 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp @@ -22,7 +22,7 @@ #include "../barcode.h" #include "BC_PDF417BarcodeRow.h" -CBC_BarcodeRow::CBC_BarcodeRow(FX_INT32 width) +CBC_BarcodeRow::CBC_BarcodeRow(int32_t width) { m_row.SetSize(width); m_currentLocation = 0; @@ -32,17 +32,17 @@ CBC_BarcodeRow::~CBC_BarcodeRow() m_output.RemoveAll(); m_row.RemoveAll(); } -void CBC_BarcodeRow::set(FX_INT32 x, FX_BYTE value) +void CBC_BarcodeRow::set(int32_t x, uint8_t value) { m_row.SetAt(x, value); } -void CBC_BarcodeRow::set(FX_INT32 x, FX_BOOL black) +void CBC_BarcodeRow::set(int32_t x, FX_BOOL black) { - m_row.SetAt(x, (FX_BYTE) (black ? 1 : 0)); + m_row.SetAt(x, (uint8_t) (black ? 1 : 0)); } -void CBC_BarcodeRow::addBar(FX_BOOL black, FX_INT32 width) +void CBC_BarcodeRow::addBar(FX_BOOL black, int32_t width) { - for (FX_INT32 ii = 0; ii < width; ii++) { + for (int32_t ii = 0; ii < width; ii++) { set(m_currentLocation++, black); } } @@ -50,10 +50,10 @@ CFX_ByteArray& CBC_BarcodeRow::getRow() { return m_row; } -CFX_ByteArray& CBC_BarcodeRow::getScaledRow(FX_INT32 scale) +CFX_ByteArray& CBC_BarcodeRow::getScaledRow(int32_t scale) { m_output.SetSize(m_row.GetSize() * scale); - for (FX_INT32 i = 0; i < m_output.GetSize(); i++) { + for (int32_t i = 0; i < m_output.GetSize(); i++) { m_output[i] = (m_row[i / scale]); } return m_output; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.h b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.h index c5520f6440..0fd1003477 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.h @@ -9,16 +9,16 @@ class CBC_BarcodeRow { public: - CBC_BarcodeRow(FX_INT32 width); + CBC_BarcodeRow(int32_t width); virtual ~CBC_BarcodeRow(); - void set(FX_INT32 x, FX_BYTE value); - void set(FX_INT32 x, FX_BOOL black); - void addBar(FX_BOOL black, FX_INT32 width); + void set(int32_t x, uint8_t value); + void set(int32_t x, FX_BOOL black); + void addBar(FX_BOOL black, int32_t width); CFX_ByteArray& getRow(); - CFX_ByteArray& getScaledRow(FX_INT32 scale); + CFX_ByteArray& getScaledRow(int32_t scale); private: CFX_ByteArray m_row; CFX_ByteArray m_output; - FX_INT32 m_currentLocation; + int32_t m_currentLocation; }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp index 446ef58a48..90fbea9897 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp @@ -29,10 +29,10 @@ CBC_BarcodeValue::CBC_BarcodeValue() CBC_BarcodeValue::~CBC_BarcodeValue() { } -void CBC_BarcodeValue::setValue(FX_INT32 value) +void CBC_BarcodeValue::setValue(int32_t value) { - FX_INT32 confidence = 0; - for (FX_INT32 i = 0; i < m_keys.GetSize(); i++) { + int32_t confidence = 0; + for (int32_t i = 0; i < m_keys.GetSize(); i++) { if (m_keys.GetAt(i) == value) { confidence = m_values.GetAt(i); m_values.SetAt(i, confidence + 1); @@ -45,9 +45,9 @@ void CBC_BarcodeValue::setValue(FX_INT32 value) } CFX_Int32Array* CBC_BarcodeValue::getValue() { - FX_INT32 maxConfidence = -1; + int32_t maxConfidence = -1; CFX_Int32Array* result = FX_NEW CFX_Int32Array; - for (FX_INT32 i = 0; i < m_keys.GetSize(); i++) { + for (int32_t i = 0; i < m_keys.GetSize(); i++) { if (m_values.GetAt(i) > maxConfidence) { maxConfidence = m_values.GetAt(i); result->RemoveAll(); @@ -58,9 +58,9 @@ CFX_Int32Array* CBC_BarcodeValue::getValue() } return result; } -FX_INT32 CBC_BarcodeValue::getConfidence(FX_INT32 value) +int32_t CBC_BarcodeValue::getConfidence(int32_t value) { - for (FX_INT32 i = 0; i < m_keys.GetSize(); i++) + for (int32_t i = 0; i < m_keys.GetSize(); i++) if (m_keys.GetAt(i) == value) { return m_values.GetAt(i); } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.h b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.h index 6922d410f0..7729e04a14 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.h @@ -11,9 +11,9 @@ class CBC_BarcodeValue public: CBC_BarcodeValue(); virtual ~CBC_BarcodeValue(); - void setValue(FX_INT32 value); + void setValue(int32_t value); CFX_Int32Array* getValue(); - FX_INT32 getConfidence(FX_INT32 value); + int32_t getConfidence(int32_t value); private: CFX_Int32Array m_keys; CFX_Int32Array m_values; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp index 55f4cb4510..fec4abcafa 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp @@ -24,7 +24,7 @@ #include "../BC_ResultPoint.h" #include "../common/BC_CommonBitMatrix.h" #include "BC_PDF417BoundingBox.h" -CBC_BoundingBox::CBC_BoundingBox(CBC_CommonBitMatrix* image, CBC_ResultPoint* topLeft, CBC_ResultPoint* bottomLeft, CBC_ResultPoint* topRight, CBC_ResultPoint* bottomRight, FX_INT32 &e) +CBC_BoundingBox::CBC_BoundingBox(CBC_CommonBitMatrix* image, CBC_ResultPoint* topLeft, CBC_ResultPoint* bottomLeft, CBC_ResultPoint* topRight, CBC_ResultPoint* bottomRight, int32_t &e) { if ((topLeft == NULL && topRight == NULL) || (bottomLeft == NULL && bottomRight == NULL) || @@ -53,7 +53,7 @@ CBC_BoundingBox::~CBC_BoundingBox() delete m_bottomRight; } } -CBC_BoundingBox* CBC_BoundingBox::merge(CBC_BoundingBox* leftBox, CBC_BoundingBox* rightBox, FX_INT32 &e) +CBC_BoundingBox* CBC_BoundingBox::merge(CBC_BoundingBox* leftBox, CBC_BoundingBox* rightBox, int32_t &e) { CBC_BoundingBox* boundingBox = NULL; if (leftBox == NULL) { @@ -68,7 +68,7 @@ CBC_BoundingBox* CBC_BoundingBox::merge(CBC_BoundingBox* leftBox, CBC_BoundingBo BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return boundingBox; } -CBC_BoundingBox* CBC_BoundingBox::addMissingRows(FX_INT32 missingStartRows, FX_INT32 missingEndRows, FX_BOOL isLeft, FX_INT32 &e) +CBC_BoundingBox* CBC_BoundingBox::addMissingRows(int32_t missingStartRows, int32_t missingEndRows, FX_BOOL isLeft, int32_t &e) { CBC_ResultPoint* newTopLeft = m_topLeft; CBC_ResultPoint* newBottomLeft = m_bottomLeft; @@ -78,7 +78,7 @@ CBC_BoundingBox* CBC_BoundingBox::addMissingRows(FX_INT32 missingStartRows, FX_I CBC_ResultPoint* newBottom = NULL; if (missingStartRows > 0) { CBC_ResultPoint* top = isLeft ? m_topLeft : m_topRight; - FX_INT32 newMinY = (FX_INT32) top->GetY() - missingStartRows; + int32_t newMinY = (int32_t) top->GetY() - missingStartRows; if (newMinY < 0) { newMinY = 0; } @@ -91,7 +91,7 @@ CBC_BoundingBox* CBC_BoundingBox::addMissingRows(FX_INT32 missingStartRows, FX_I } if (missingEndRows > 0) { CBC_ResultPoint* bottom = isLeft ? m_bottomLeft : m_bottomRight; - FX_INT32 newMaxY = (FX_INT32) bottom->GetY() + missingEndRows; + int32_t newMaxY = (int32_t) bottom->GetY() + missingEndRows; if (newMaxY >= m_image->GetHeight()) { newMaxY = m_image->GetHeight() - 1; } @@ -125,19 +125,19 @@ void CBC_BoundingBox::setBottomRight(CBC_ResultPoint bottomRight) m_bottomRight = FX_NEW CBC_ResultPoint(bottomRight.GetX(), bottomRight.GetY()); calculateMinMaxValues(); } -FX_INT32 CBC_BoundingBox::getMinX() +int32_t CBC_BoundingBox::getMinX() { return m_minX; } -FX_INT32 CBC_BoundingBox::getMaxX() +int32_t CBC_BoundingBox::getMaxX() { return m_maxX; } -FX_INT32 CBC_BoundingBox::getMinY() +int32_t CBC_BoundingBox::getMinY() { return m_minY; } -FX_INT32 CBC_BoundingBox::getMaxY() +int32_t CBC_BoundingBox::getMaxY() { return m_maxY; } @@ -187,8 +187,8 @@ void CBC_BoundingBox::calculateMinMaxValues() m_topRight = FX_NEW CBC_ResultPoint((FX_FLOAT)m_image->GetWidth() - 1, (FX_FLOAT)m_topLeft->GetY()); m_bottomRight = FX_NEW CBC_ResultPoint((FX_FLOAT)m_image->GetWidth() - 1, (FX_FLOAT)m_bottomLeft->GetY()); } - m_minX = (FX_INT32) (m_topLeft->GetX() < m_bottomLeft->GetX() ? m_topLeft->GetX() : m_bottomLeft->GetX()); - m_maxX = (FX_INT32) (m_topRight->GetX() > m_bottomRight->GetX() ? m_topRight->GetX() : m_bottomRight->GetX()); - m_minY = (FX_INT32) (m_topLeft->GetY() < m_topRight->GetY() ? m_topLeft->GetY() : m_topRight->GetY()); - m_maxY = (FX_INT32) (m_bottomLeft->GetY() > m_bottomRight->GetY() ? m_bottomLeft->GetY() : m_bottomRight->GetY()); + m_minX = (int32_t) (m_topLeft->GetX() < m_bottomLeft->GetX() ? m_topLeft->GetX() : m_bottomLeft->GetX()); + m_maxX = (int32_t) (m_topRight->GetX() > m_bottomRight->GetX() ? m_topRight->GetX() : m_bottomRight->GetX()); + m_minY = (int32_t) (m_topLeft->GetY() < m_topRight->GetY() ? m_topLeft->GetY() : m_topRight->GetY()); + m_maxY = (int32_t) (m_bottomLeft->GetY() > m_bottomRight->GetY() ? m_bottomLeft->GetY() : m_bottomRight->GetY()); } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.h b/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.h index 26bd1881c3..97d8406fd4 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.h @@ -11,17 +11,17 @@ class CBC_ResultPoint; class CBC_BoundingBox { public: - CBC_BoundingBox(CBC_CommonBitMatrix* image, CBC_ResultPoint* topLeft, CBC_ResultPoint* bottomLeft, CBC_ResultPoint* topRight, CBC_ResultPoint* bottomRight, FX_INT32 &e); + CBC_BoundingBox(CBC_CommonBitMatrix* image, CBC_ResultPoint* topLeft, CBC_ResultPoint* bottomLeft, CBC_ResultPoint* topRight, CBC_ResultPoint* bottomRight, int32_t &e); CBC_BoundingBox(CBC_BoundingBox* boundingBox); virtual ~CBC_BoundingBox(); - static CBC_BoundingBox* merge(CBC_BoundingBox* leftBox, CBC_BoundingBox* rightBox, FX_INT32 &e); - CBC_BoundingBox* addMissingRows(FX_INT32 missingStartRows, FX_INT32 missingEndRows, FX_BOOL isLeft, FX_INT32 &e); + static CBC_BoundingBox* merge(CBC_BoundingBox* leftBox, CBC_BoundingBox* rightBox, int32_t &e); + CBC_BoundingBox* addMissingRows(int32_t missingStartRows, int32_t missingEndRows, FX_BOOL isLeft, int32_t &e); void setTopRight(CBC_ResultPoint topRight); void setBottomRight(CBC_ResultPoint bottomRight); - FX_INT32 getMinX(); - FX_INT32 getMaxX(); - FX_INT32 getMinY(); - FX_INT32 getMaxY(); + int32_t getMinX(); + int32_t getMaxX(); + int32_t getMinY(); + int32_t getMaxY(); CBC_ResultPoint* getTopLeft(); CBC_ResultPoint* getTopRight(); CBC_ResultPoint* getBottomLeft(); @@ -32,10 +32,10 @@ private: CBC_ResultPoint* m_bottomLeft; CBC_ResultPoint* m_topRight; CBC_ResultPoint* m_bottomRight; - FX_INT32 m_minX; - FX_INT32 m_maxX; - FX_INT32 m_minY; - FX_INT32 m_maxY; + int32_t m_minX; + int32_t m_maxX; + int32_t m_minY; + int32_t m_maxY; void init(CBC_CommonBitMatrix* image, CBC_ResultPoint* topLeft, CBC_ResultPoint* bottomLeft, CBC_ResultPoint* topRight, CBC_ResultPoint* bottomRight); void calculateMinMaxValues(); }; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.cpp index 9ac65ab7bc..8449a7ed06 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.cpp @@ -22,8 +22,8 @@ #include "../barcode.h" #include "BC_PDF417Codeword.h" -FX_INT32 CBC_Codeword::BARCODE_ROW_UNKNOWN = -1; -CBC_Codeword::CBC_Codeword(FX_INT32 startX, FX_INT32 endX, FX_INT32 bucket, FX_INT32 cvalue) +int32_t CBC_Codeword::BARCODE_ROW_UNKNOWN = -1; +CBC_Codeword::CBC_Codeword(int32_t startX, int32_t endX, int32_t bucket, int32_t cvalue) { m_startX = startX; m_endX = endX; @@ -38,7 +38,7 @@ FX_BOOL CBC_Codeword::hasValidRowNumber() { return isValidRowNumber(m_rowNumber); } -FX_BOOL CBC_Codeword::isValidRowNumber(FX_INT32 rowNumber) +FX_BOOL CBC_Codeword::isValidRowNumber(int32_t rowNumber) { return m_rowNumber != BARCODE_ROW_UNKNOWN && m_bucket == (m_rowNumber % 3) * 3; } @@ -46,31 +46,31 @@ void CBC_Codeword::setRowNumberAsRowIndicatorColumn() { m_rowNumber = (m_value / 30) * 3 + m_bucket / 3; } -FX_INT32 CBC_Codeword::getWidth() +int32_t CBC_Codeword::getWidth() { return m_endX - m_startX; } -FX_INT32 CBC_Codeword::getStartX() +int32_t CBC_Codeword::getStartX() { return m_startX; } -FX_INT32 CBC_Codeword::getEndX() +int32_t CBC_Codeword::getEndX() { return m_endX; } -FX_INT32 CBC_Codeword::getBucket() +int32_t CBC_Codeword::getBucket() { return m_bucket; } -FX_INT32 CBC_Codeword::getValue() +int32_t CBC_Codeword::getValue() { return m_value; } -FX_INT32 CBC_Codeword::getRowNumber() +int32_t CBC_Codeword::getRowNumber() { return m_rowNumber; } -void CBC_Codeword::setRowNumber(FX_INT32 rowNumber) +void CBC_Codeword::setRowNumber(int32_t rowNumber) { m_rowNumber = rowNumber; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.h b/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.h index ea0524cbf8..ef5e0aefc7 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.h @@ -9,25 +9,25 @@ class CBC_Codeword { public: - CBC_Codeword(FX_INT32 startX, FX_INT32 endX, FX_INT32 bucket, FX_INT32 value); + CBC_Codeword(int32_t startX, int32_t endX, int32_t bucket, int32_t value); virtual ~CBC_Codeword(); FX_BOOL hasValidRowNumber() ; - FX_BOOL isValidRowNumber(FX_INT32 rowNumber); + FX_BOOL isValidRowNumber(int32_t rowNumber); void setRowNumberAsRowIndicatorColumn(); - FX_INT32 getWidth(); - FX_INT32 getStartX(); - FX_INT32 getEndX(); - FX_INT32 getBucket(); - FX_INT32 getValue(); - FX_INT32 getRowNumber(); - void setRowNumber(FX_INT32 rowNumber); + int32_t getWidth(); + int32_t getStartX(); + int32_t getEndX(); + int32_t getBucket(); + int32_t getValue(); + int32_t getRowNumber(); + void setRowNumber(int32_t rowNumber); CFX_ByteString toString(); private: - static FX_INT32 BARCODE_ROW_UNKNOWN; - FX_INT32 m_startX; - FX_INT32 m_endX; - FX_INT32 m_bucket; - FX_INT32 m_value; - FX_INT32 m_rowNumber; + static int32_t BARCODE_ROW_UNKNOWN; + int32_t m_startX; + int32_t m_endX; + int32_t m_bucket; + int32_t m_value; + int32_t m_rowNumber; }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp index bf16bc25e0..822a47a4d4 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp @@ -34,10 +34,10 @@ CBC_PDF417CodewordDecoder::~CBC_PDF417CodewordDecoder() } void CBC_PDF417CodewordDecoder::Initialize() { - for (FX_INT32 i = 0; i < SYMBOL_TABLE_Length; i++) { - FX_INT32 currentSymbol = CBC_PDF417Common::SYMBOL_TABLE[i]; - FX_INT32 currentBit = currentSymbol & 0x1; - for (FX_INT32 j = 0; j < CBC_PDF417Common::BARS_IN_MODULE; j++) { + for (int32_t i = 0; i < SYMBOL_TABLE_Length; i++) { + int32_t currentSymbol = CBC_PDF417Common::SYMBOL_TABLE[i]; + int32_t currentBit = currentSymbol & 0x1; + for (int32_t j = 0; j < CBC_PDF417Common::BARS_IN_MODULE; j++) { FX_FLOAT size = 0.0f; while ((currentSymbol & 0x1) == currentBit) { size += 1.0f; @@ -51,10 +51,10 @@ void CBC_PDF417CodewordDecoder::Initialize() void CBC_PDF417CodewordDecoder::Finalize() { } -FX_INT32 CBC_PDF417CodewordDecoder::getDecodedValue(CFX_Int32Array& moduleBitCount) +int32_t CBC_PDF417CodewordDecoder::getDecodedValue(CFX_Int32Array& moduleBitCount) { CFX_Int32Array* array = sampleBitCounts(moduleBitCount); - FX_INT32 decodedValue = getDecodedCodewordValue(*array); + int32_t decodedValue = getDecodedCodewordValue(*array); delete array; if (decodedValue != -1) { return decodedValue; @@ -66,9 +66,9 @@ CFX_Int32Array* CBC_PDF417CodewordDecoder::sampleBitCounts(CFX_Int32Array& modul FX_FLOAT bitCountSum = (FX_FLOAT)CBC_PDF417Common::getBitCountSum(moduleBitCount); CFX_Int32Array* bitCount = FX_NEW CFX_Int32Array(); bitCount->SetSize(CBC_PDF417Common::BARS_IN_MODULE); - FX_INT32 bitCountIndex = 0; - FX_INT32 sumPreviousBits = 0; - for (FX_INT32 i = 0; i < CBC_PDF417Common::MODULES_IN_CODEWORD; i++) { + int32_t bitCountIndex = 0; + int32_t sumPreviousBits = 0; + for (int32_t i = 0; i < CBC_PDF417Common::MODULES_IN_CODEWORD; i++) { FX_FLOAT sampleIndex = bitCountSum / (2 * CBC_PDF417Common::MODULES_IN_CODEWORD) + (i * bitCountSum) / CBC_PDF417Common::MODULES_IN_CODEWORD; if (sumPreviousBits + moduleBitCount.GetAt(bitCountIndex) <= sampleIndex) { sumPreviousBits += moduleBitCount.GetAt(bitCountIndex); @@ -78,34 +78,34 @@ CFX_Int32Array* CBC_PDF417CodewordDecoder::sampleBitCounts(CFX_Int32Array& modul } return bitCount; } -FX_INT32 CBC_PDF417CodewordDecoder::getDecodedCodewordValue(CFX_Int32Array& moduleBitCount) +int32_t CBC_PDF417CodewordDecoder::getDecodedCodewordValue(CFX_Int32Array& moduleBitCount) { - FX_INT32 decodedValue = getBitValue(moduleBitCount); + int32_t decodedValue = getBitValue(moduleBitCount); return CBC_PDF417Common::getCodeword(decodedValue) == -1 ? -1 : decodedValue; } -FX_INT32 CBC_PDF417CodewordDecoder::getBitValue(CFX_Int32Array& moduleBitCount) +int32_t CBC_PDF417CodewordDecoder::getBitValue(CFX_Int32Array& moduleBitCount) { - FX_INT64 result = 0; - for (FX_INT32 i = 0; i < moduleBitCount.GetSize(); i++) { - for (FX_INT32 bit = 0; bit < moduleBitCount.GetAt(i); bit++) { + int64_t result = 0; + for (int32_t i = 0; i < moduleBitCount.GetSize(); i++) { + for (int32_t bit = 0; bit < moduleBitCount.GetAt(i); bit++) { result = (result << 1) | (i % 2 == 0 ? 1 : 0); } } - return (FX_INT32) result; + return (int32_t) result; } -FX_INT32 CBC_PDF417CodewordDecoder::getClosestDecodedValue(CFX_Int32Array& moduleBitCount) +int32_t CBC_PDF417CodewordDecoder::getClosestDecodedValue(CFX_Int32Array& moduleBitCount) { - FX_INT32 bitCountSum = CBC_PDF417Common::getBitCountSum(moduleBitCount); + int32_t bitCountSum = CBC_PDF417Common::getBitCountSum(moduleBitCount); CFX_FloatArray bitCountRatios; bitCountRatios.SetSize(CBC_PDF417Common::BARS_IN_MODULE); - for (FX_INT32 i = 0; i < bitCountRatios.GetSize(); i++) { + for (int32_t i = 0; i < bitCountRatios.GetSize(); i++) { bitCountRatios[i] = moduleBitCount.GetAt(i) / (FX_FLOAT) bitCountSum; } FX_FLOAT bestMatchError = (FX_FLOAT)Float_MAX_VALUE; - FX_INT32 bestMatch = -1; - for (FX_INT32 j = 0; j < SYMBOL_TABLE_Length; j++) { + int32_t bestMatch = -1; + for (int32_t j = 0; j < SYMBOL_TABLE_Length; j++) { FX_FLOAT error = 0.0f; - for (FX_INT32 k = 0; k < CBC_PDF417Common::BARS_IN_MODULE; k++) { + for (int32_t k = 0; k < CBC_PDF417Common::BARS_IN_MODULE; k++) { FX_FLOAT diff = RATIOS_TABLE[j][k] - bitCountRatios[k]; error += diff * diff; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h b/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h index f76d16d015..424d31b2ce 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h @@ -16,12 +16,12 @@ public: virtual ~CBC_PDF417CodewordDecoder(); static void Initialize(); static void Finalize(); - static FX_INT32 getDecodedValue(CFX_Int32Array& moduleBitCount); + static int32_t getDecodedValue(CFX_Int32Array& moduleBitCount); private: static FX_FLOAT RATIOS_TABLE[][8]; static CFX_Int32Array* sampleBitCounts(CFX_Int32Array& moduleBitCount); - static FX_INT32 getDecodedCodewordValue(CFX_Int32Array& moduleBitCount); - static FX_INT32 getBitValue(CFX_Int32Array& moduleBitCount); - static FX_INT32 getClosestDecodedValue(CFX_Int32Array& moduleBitCount); + static int32_t getDecodedCodewordValue(CFX_Int32Array& moduleBitCount); + static int32_t getBitValue(CFX_Int32Array& moduleBitCount); + static int32_t getClosestDecodedValue(CFX_Int32Array& moduleBitCount); }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Common.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Common.cpp index 1f192e63a7..758fed61fe 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Common.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Common.cpp @@ -22,16 +22,16 @@ #include "../barcode.h" #include "BC_PDF417Common.h" -FX_INT32 CBC_PDF417Common::NUMBER_OF_CODEWORDS = 929; -FX_INT32 CBC_PDF417Common::MAX_CODEWORDS_IN_BARCODE = NUMBER_OF_CODEWORDS - 1; -FX_INT32 CBC_PDF417Common::MIN_ROWS_IN_BARCODE = 3; -FX_INT32 CBC_PDF417Common::MAX_ROWS_IN_BARCODE = 90; -FX_INT32 CBC_PDF417Common::MAX_CODEWORDS_IN_ROW = 32; -FX_INT32 CBC_PDF417Common::MODULES_IN_CODEWORD = 17; -FX_INT32 CBC_PDF417Common::MODULES_IN_STOP_PATTERN = 18; -FX_INT32 CBC_PDF417Common::BARS_IN_MODULE = 8; +int32_t CBC_PDF417Common::NUMBER_OF_CODEWORDS = 929; +int32_t CBC_PDF417Common::MAX_CODEWORDS_IN_BARCODE = NUMBER_OF_CODEWORDS - 1; +int32_t CBC_PDF417Common::MIN_ROWS_IN_BARCODE = 3; +int32_t CBC_PDF417Common::MAX_ROWS_IN_BARCODE = 90; +int32_t CBC_PDF417Common::MAX_CODEWORDS_IN_ROW = 32; +int32_t CBC_PDF417Common::MODULES_IN_CODEWORD = 17; +int32_t CBC_PDF417Common::MODULES_IN_STOP_PATTERN = 18; +int32_t CBC_PDF417Common::BARS_IN_MODULE = 8; CFX_Int32Array* CBC_PDF417Common::EMPTY_INT_ARRAY = NULL; -FX_INT32 CBC_PDF417Common::SYMBOL_TABLE[] = { +int32_t CBC_PDF417Common::SYMBOL_TABLE[] = { 0x1025e, 0x1027a, 0x1029e, 0x102bc, 0x102f2, 0x102f4, 0x1032e, 0x1034e, 0x1035c, 0x10396, 0x103a6, 0x103ac, 0x10422, 0x10428, 0x10436, 0x10442, 0x10444, 0x10448, 0x10450, 0x1045e, 0x10466, 0x1046c, 0x1047a, 0x10482, 0x1049e, 0x104a0, 0x104bc, 0x104c6, 0x104d8, 0x104ee, 0x104f2, 0x104f4, 0x10504, 0x10508, 0x10510, 0x1051e, @@ -266,7 +266,7 @@ FX_INT32 CBC_PDF417Common::SYMBOL_TABLE[] = { 0x1fb3a, 0x1fb46, 0x1fb4c, 0x1fb58, 0x1fb6e, 0x1fb72, 0x1fb74, 0x1fb8a, 0x1fb92, 0x1fb94, 0x1fba2, 0x1fba4, 0x1fba8, 0x1fbb6, 0x1fbda }; -FX_INT32 CBC_PDF417Common::CODEWORD_TABLE[] = { +int32_t CBC_PDF417Common::CODEWORD_TABLE[] = { 2627, 1819, 2622, 2621, 1813, 1812, 2729, 2724, 2723, 2779, 2774, 2773, 902, 896, 908, 868, 865, 861, 859, 2511, 873, 871, 1780, 835, 2493, 825, 2491, 842, 837, 844, 1764, 1762, 811, 810, 809, 2483, 807, 2482, 806, 2480, 815, 814, 813, 812, 2484, 817, 816, 1745, 1744, 1742, 1746, 2655, 2637, 2635, 2626, 2625, 2623, 2628, 1820, 2752, @@ -414,30 +414,30 @@ CBC_PDF417Common::CBC_PDF417Common() CBC_PDF417Common::~CBC_PDF417Common() { } -FX_INT32 CBC_PDF417Common::getBitCountSum(CFX_Int32Array& moduleBitCount) +int32_t CBC_PDF417Common::getBitCountSum(CFX_Int32Array& moduleBitCount) { - FX_INT32 bitCountSum = 0; - for (FX_INT32 i = 0; i < moduleBitCount.GetSize(); i++) { - FX_INT32 count = moduleBitCount.GetAt(i); + int32_t bitCountSum = 0; + for (int32_t i = 0; i < moduleBitCount.GetSize(); i++) { + int32_t count = moduleBitCount.GetAt(i); bitCountSum += count; } return bitCountSum; } -FX_INT32 CBC_PDF417Common::getCodeword(FX_DWORD symbol) +int32_t CBC_PDF417Common::getCodeword(FX_DWORD symbol) { FX_DWORD sym = symbol & 0x3FFFF; - FX_INT32 i = findCodewordIndex(sym); + int32_t i = findCodewordIndex(sym); if (i == -1) { return -1; } return (CODEWORD_TABLE[i] - 1) % NUMBER_OF_CODEWORDS; } -FX_INT32 CBC_PDF417Common::findCodewordIndex(FX_DWORD symbol) +int32_t CBC_PDF417Common::findCodewordIndex(FX_DWORD symbol) { - FX_INT32 first = 0; - FX_INT32 upto = sizeof(SYMBOL_TABLE) / sizeof(SYMBOL_TABLE[0]); + int32_t first = 0; + int32_t upto = sizeof(SYMBOL_TABLE) / sizeof(SYMBOL_TABLE[0]); while (first < upto) { - FX_INT32 mid = ((FX_DWORD)(first + upto)) >> 1; + int32_t mid = ((FX_DWORD)(first + upto)) >> 1; if (symbol < (FX_DWORD)SYMBOL_TABLE[mid]) { upto = mid; } else if (symbol > (FX_DWORD)SYMBOL_TABLE[mid]) { diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Common.h b/xfa/src/fxbarcode/pdf417/BC_PDF417Common.h index 2d6258951e..a97d84b07a 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Common.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Common.h @@ -11,20 +11,20 @@ class CBC_PDF417Common public: CBC_PDF417Common(); virtual ~CBC_PDF417Common(); - static FX_INT32 getBitCountSum(CFX_Int32Array& moduleBitCount); - static FX_INT32 getCodeword(FX_DWORD symbol); - static FX_INT32 NUMBER_OF_CODEWORDS; - static FX_INT32 MAX_CODEWORDS_IN_BARCODE; - static FX_INT32 MIN_ROWS_IN_BARCODE; - static FX_INT32 MAX_ROWS_IN_BARCODE; - static FX_INT32 MAX_CODEWORDS_IN_ROW; - static FX_INT32 MODULES_IN_CODEWORD; - static FX_INT32 MODULES_IN_STOP_PATTERN; - static FX_INT32 BARS_IN_MODULE; - static FX_INT32 SYMBOL_TABLE[]; - static FX_INT32 CODEWORD_TABLE[]; + static int32_t getBitCountSum(CFX_Int32Array& moduleBitCount); + static int32_t getCodeword(FX_DWORD symbol); + static int32_t NUMBER_OF_CODEWORDS; + static int32_t MAX_CODEWORDS_IN_BARCODE; + static int32_t MIN_ROWS_IN_BARCODE; + static int32_t MAX_ROWS_IN_BARCODE; + static int32_t MAX_CODEWORDS_IN_ROW; + static int32_t MODULES_IN_CODEWORD; + static int32_t MODULES_IN_STOP_PATTERN; + static int32_t BARS_IN_MODULE; + static int32_t SYMBOL_TABLE[]; + static int32_t CODEWORD_TABLE[]; private: static CFX_Int32Array* EMPTY_INT_ARRAY; - static FX_INT32 findCodewordIndex(FX_DWORD symbol); + static int32_t findCodewordIndex(FX_DWORD symbol); }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp index ae26057c3e..281c78a8eb 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp @@ -36,15 +36,15 @@ #define MACRO_PDF417_TERMINATOR 922 #define MODE_SHIFT_TO_BYTE_COMPACTION_MODE 913 -FX_INT32 CBC_DecodedBitStreamPaser::MAX_NUMERIC_CODEWORDS = 15; -FX_INT32 CBC_DecodedBitStreamPaser::NUMBER_OF_SEQUENCE_CODEWORDS = 2; -FX_INT32 CBC_DecodedBitStreamPaser::PL = 25; -FX_INT32 CBC_DecodedBitStreamPaser::LL = 27; -FX_INT32 CBC_DecodedBitStreamPaser::AS = 27; -FX_INT32 CBC_DecodedBitStreamPaser::ML = 28; -FX_INT32 CBC_DecodedBitStreamPaser::AL = 28; -FX_INT32 CBC_DecodedBitStreamPaser::PS = 29; -FX_INT32 CBC_DecodedBitStreamPaser::PAL = 29; +int32_t CBC_DecodedBitStreamPaser::MAX_NUMERIC_CODEWORDS = 15; +int32_t CBC_DecodedBitStreamPaser::NUMBER_OF_SEQUENCE_CODEWORDS = 2; +int32_t CBC_DecodedBitStreamPaser::PL = 25; +int32_t CBC_DecodedBitStreamPaser::LL = 27; +int32_t CBC_DecodedBitStreamPaser::AS = 27; +int32_t CBC_DecodedBitStreamPaser::ML = 28; +int32_t CBC_DecodedBitStreamPaser::AL = 28; +int32_t CBC_DecodedBitStreamPaser::PS = 29; +int32_t CBC_DecodedBitStreamPaser::PAL = 29; FX_CHAR CBC_DecodedBitStreamPaser::PUNCT_CHARS[29] = { ';', '<', '>', '@', '[', '\\', '}', '_', '`', '~', '!', '\r', '\t', ',', ':', '\n', '-', '.', '$', '/', '"', '|', '*', @@ -67,11 +67,11 @@ CBC_DecodedBitStreamPaser::CBC_DecodedBitStreamPaser() CBC_DecodedBitStreamPaser::~CBC_DecodedBitStreamPaser() { } -CBC_CommonDecoderResult* CBC_DecodedBitStreamPaser::decode(CFX_Int32Array &codewords, CFX_ByteString ecLevel, FX_INT32 &e) +CBC_CommonDecoderResult* CBC_DecodedBitStreamPaser::decode(CFX_Int32Array &codewords, CFX_ByteString ecLevel, int32_t &e) { CFX_ByteString result; - FX_INT32 codeIndex = 1; - FX_INT32 code = codewords.GetAt(codeIndex); + int32_t codeIndex = 1; + int32_t code = codewords.GetAt(codeIndex); codeIndex++; CBC_PDF417ResultMetadata* resultMetadata = FX_NEW CBC_PDF417ResultMetadata; while (codeIndex < codewords[0]) { @@ -128,7 +128,7 @@ CBC_CommonDecoderResult* CBC_DecodedBitStreamPaser::decode(CFX_Int32Array &codew tempCd->setOther(resultMetadata); return tempCd; } -FX_INT32 CBC_DecodedBitStreamPaser::decodeMacroBlock(CFX_Int32Array &codewords, FX_INT32 codeIndex, CBC_PDF417ResultMetadata* resultMetadata, FX_INT32 &e) +int32_t CBC_DecodedBitStreamPaser::decodeMacroBlock(CFX_Int32Array &codewords, int32_t codeIndex, CBC_PDF417ResultMetadata* resultMetadata, int32_t &e) { if (codeIndex + NUMBER_OF_SEQUENCE_CODEWORDS > codewords[0]) { e = BCExceptionFormatInstance; @@ -136,7 +136,7 @@ FX_INT32 CBC_DecodedBitStreamPaser::decodeMacroBlock(CFX_Int32Array &codewords, } CFX_Int32Array segmentIndexArray; segmentIndexArray.SetSize(NUMBER_OF_SEQUENCE_CODEWORDS); - for (FX_INT32 i = 0; i < NUMBER_OF_SEQUENCE_CODEWORDS; i++, codeIndex++) { + for (int32_t i = 0; i < NUMBER_OF_SEQUENCE_CODEWORDS; i++, codeIndex++) { segmentIndexArray.SetAt(i, codewords[codeIndex]); } CFX_ByteString str = decodeBase900toBase10(segmentIndexArray, NUMBER_OF_SEQUENCE_CODEWORDS, e); @@ -149,10 +149,10 @@ FX_INT32 CBC_DecodedBitStreamPaser::decodeMacroBlock(CFX_Int32Array &codewords, codeIndex++; CFX_Int32Array additionalOptionCodeWords; additionalOptionCodeWords.SetSize(codewords[0] - codeIndex); - FX_INT32 additionalOptionCodeWordsIndex = 0; + int32_t additionalOptionCodeWordsIndex = 0; FX_BOOL end = FALSE; while ((codeIndex < codewords[0]) && !end) { - FX_INT32 code = codewords[codeIndex++]; + int32_t code = codewords[codeIndex++]; if (code < TEXT_COMPACTION_MODE_LATCH) { additionalOptionCodeWords[additionalOptionCodeWordsIndex++] = code; } else { @@ -178,16 +178,16 @@ FX_INT32 CBC_DecodedBitStreamPaser::decodeMacroBlock(CFX_Int32Array &codewords, } return codeIndex; } -FX_INT32 CBC_DecodedBitStreamPaser::textCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result) +int32_t CBC_DecodedBitStreamPaser::textCompaction(CFX_Int32Array &codewords, int32_t codeIndex, CFX_ByteString &result) { CFX_Int32Array textCompactionData; textCompactionData.SetSize((codewords[0] - codeIndex) << 1); CFX_Int32Array byteCompactionData; byteCompactionData.SetSize((codewords[0] - codeIndex) << 1); - FX_INT32 index = 0; + int32_t index = 0; FX_BOOL end = FALSE; while ((codeIndex < codewords[0]) && !end) { - FX_INT32 code = codewords[codeIndex++]; + int32_t code = codewords[codeIndex++]; if (code < TEXT_COMPACTION_MODE_LATCH) { textCompactionData[index] = code / 30; textCompactionData[index + 1] = code % 30; @@ -233,13 +233,13 @@ FX_INT32 CBC_DecodedBitStreamPaser::textCompaction(CFX_Int32Array &codewords, FX decodeTextCompaction(textCompactionData, byteCompactionData, index, result); return codeIndex; } -void CBC_DecodedBitStreamPaser::decodeTextCompaction(CFX_Int32Array &textCompactionData, CFX_Int32Array &byteCompactionData, FX_INT32 length, CFX_ByteString &result) +void CBC_DecodedBitStreamPaser::decodeTextCompaction(CFX_Int32Array &textCompactionData, CFX_Int32Array &byteCompactionData, int32_t length, CFX_ByteString &result) { Mode subMode = ALPHA; Mode priorToShiftMode = ALPHA; - FX_INT32 i = 0; + int32_t i = 0; while (i < length) { - FX_INT32 subModeCh = textCompactionData[i]; + int32_t subModeCh = textCompactionData[i]; FX_CHAR ch = 0; switch (subMode) { case ALPHA: @@ -351,16 +351,16 @@ void CBC_DecodedBitStreamPaser::decodeTextCompaction(CFX_Int32Array &textCompact i++; } } -FX_INT32 CBC_DecodedBitStreamPaser::byteCompaction(FX_INT32 mode, CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result) +int32_t CBC_DecodedBitStreamPaser::byteCompaction(int32_t mode, CFX_Int32Array &codewords, int32_t codeIndex, CFX_ByteString &result) { if (mode == BYTE_COMPACTION_MODE_LATCH) { - FX_INT32 count = 0; - FX_INT64 value = 0; + int32_t count = 0; + int64_t value = 0; FX_WORD* decodedData = FX_Alloc(FX_WORD, 6 * sizeof(FX_WORD)); CFX_Int32Array byteCompactedCodewords; byteCompactedCodewords.SetSize(6); FX_BOOL end = FALSE; - FX_INT32 nextCode = codewords[codeIndex++]; + int32_t nextCode = codewords[codeIndex++]; while ((codeIndex < codewords[0]) && !end) { byteCompactedCodewords[count++] = nextCode; value = 900 * value + nextCode; @@ -376,7 +376,7 @@ FX_INT32 CBC_DecodedBitStreamPaser::byteCompaction(FX_INT32 mode, CFX_Int32Array end = TRUE; } else { if ((count % 5 == 0) && (count > 0)) { - FX_INT32 j = 0; + int32_t j = 0; for (; j < 6; ++j) { decodedData[5 - j] = (FX_WORD) (value % 256); value >>= 8; @@ -392,15 +392,15 @@ FX_INT32 CBC_DecodedBitStreamPaser::byteCompaction(FX_INT32 mode, CFX_Int32Array if (codeIndex == codewords[0] && nextCode < TEXT_COMPACTION_MODE_LATCH) { byteCompactedCodewords[count++] = nextCode; } - for (FX_INT32 i = 0; i < count; i++) { + for (int32_t i = 0; i < count; i++) { result += (FX_CHAR)(FX_WORD) byteCompactedCodewords[i]; } } else if (mode == BYTE_COMPACTION_MODE_LATCH_6) { - FX_INT32 count = 0; - FX_INT64 value = 0; + int32_t count = 0; + int64_t value = 0; FX_BOOL end = FALSE; while (codeIndex < codewords[0] && !end) { - FX_INT32 code = codewords[codeIndex++]; + int32_t code = codewords[codeIndex++]; if (code < TEXT_COMPACTION_MODE_LATCH) { count++; value = 900 * value + code; @@ -418,7 +418,7 @@ FX_INT32 CBC_DecodedBitStreamPaser::byteCompaction(FX_INT32 mode, CFX_Int32Array } if ((count % 5 == 0) && (count > 0)) { FX_WORD* decodedData = FX_Alloc(FX_WORD, 6 * sizeof(FX_WORD)); - FX_INT32 j = 0; + int32_t j = 0; for (; j < 6; ++j) { decodedData[5 - j] = (FX_WORD) (value & 0xFF); value >>= 8; @@ -433,14 +433,14 @@ FX_INT32 CBC_DecodedBitStreamPaser::byteCompaction(FX_INT32 mode, CFX_Int32Array } return codeIndex; } -FX_INT32 CBC_DecodedBitStreamPaser::numericCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result, FX_INT32 &e) +int32_t CBC_DecodedBitStreamPaser::numericCompaction(CFX_Int32Array &codewords, int32_t codeIndex, CFX_ByteString &result, int32_t &e) { - FX_INT32 count = 0; + int32_t count = 0; FX_BOOL end = FALSE; CFX_Int32Array numericCodewords; numericCodewords.SetSize(MAX_NUMERIC_CODEWORDS); while (codeIndex < codewords[0] && !end) { - FX_INT32 code = codewords[codeIndex++]; + int32_t code = codewords[codeIndex++]; if (codeIndex == codewords[0]) { end = TRUE; } @@ -469,11 +469,11 @@ FX_INT32 CBC_DecodedBitStreamPaser::numericCompaction(CFX_Int32Array &codewords, } return codeIndex; } -CFX_ByteString CBC_DecodedBitStreamPaser::decodeBase900toBase10(CFX_Int32Array &codewords, FX_INT32 count, FX_INT32 &e) +CFX_ByteString CBC_DecodedBitStreamPaser::decodeBase900toBase10(CFX_Int32Array &codewords, int32_t count, int32_t &e) { BigInteger result = 0; BigInteger nineHundred(900); - for (FX_INT32 i = 0; i < count; i++) { + for (int32_t i = 0; i < count; i++) { result = result * nineHundred + BigInteger(codewords[i]); } CFX_ByteString resultString(bigIntegerToString(result).c_str()); diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h b/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h index 4c97bc3f24..20831b4ad8 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h @@ -15,7 +15,7 @@ public: virtual ~CBC_DecodedBitStreamPaser(); static void Initialize(); static void Finalize(); - static CBC_CommonDecoderResult* decode(CFX_Int32Array &codewords, CFX_ByteString ecLevel, FX_INT32 &e); + static CBC_CommonDecoderResult* decode(CFX_Int32Array &codewords, CFX_ByteString ecLevel, int32_t &e); private: enum Mode { @@ -26,22 +26,22 @@ private: ALPHA_SHIFT, PUNCT_SHIFT }; - static FX_INT32 MAX_NUMERIC_CODEWORDS; - static FX_INT32 PL; - static FX_INT32 LL; - static FX_INT32 AS; - static FX_INT32 ML; - static FX_INT32 AL; - static FX_INT32 PS; - static FX_INT32 PAL; + static int32_t MAX_NUMERIC_CODEWORDS; + static int32_t PL; + static int32_t LL; + static int32_t AS; + static int32_t ML; + static int32_t AL; + static int32_t PS; + static int32_t PAL; static FX_CHAR PUNCT_CHARS[29]; static FX_CHAR MIXED_CHARS[30]; - static FX_INT32 NUMBER_OF_SEQUENCE_CODEWORDS; - static FX_INT32 decodeMacroBlock(CFX_Int32Array &codewords, FX_INT32 codeIndex, CBC_PDF417ResultMetadata* resultMetadata, FX_INT32 &e); - static FX_INT32 textCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result); - static void decodeTextCompaction(CFX_Int32Array &textCompactionData, CFX_Int32Array &byteCompactionData, FX_INT32 length, CFX_ByteString &result); - static FX_INT32 byteCompaction(FX_INT32 mode, CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result); - static FX_INT32 numericCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result, FX_INT32 &e); - static CFX_ByteString decodeBase900toBase10(CFX_Int32Array &codewords, FX_INT32 count, FX_INT32 &e); + static int32_t NUMBER_OF_SEQUENCE_CODEWORDS; + static int32_t decodeMacroBlock(CFX_Int32Array &codewords, int32_t codeIndex, CBC_PDF417ResultMetadata* resultMetadata, int32_t &e); + static int32_t textCompaction(CFX_Int32Array &codewords, int32_t codeIndex, CFX_ByteString &result); + static void decodeTextCompaction(CFX_Int32Array &textCompactionData, CFX_Int32Array &byteCompactionData, int32_t length, CFX_ByteString &result); + static int32_t byteCompaction(int32_t mode, CFX_Int32Array &codewords, int32_t codeIndex, CFX_ByteString &result); + static int32_t numericCompaction(CFX_Int32Array &codewords, int32_t codeIndex, CFX_ByteString &result, int32_t &e); + static CFX_ByteString decodeBase900toBase10(CFX_Int32Array &codewords, int32_t count, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp index af316f7660..c4966942c6 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp @@ -28,14 +28,14 @@ #include "BC_PDF417Common.h" #include "BC_PDF417DetectionResultRowIndicatorColumn.h" #include "BC_PDF417DetectionResult.h" -FX_INT32 CBC_DetectionResult::ADJUST_ROW_NUMBER_SKIP = 2; +int32_t CBC_DetectionResult::ADJUST_ROW_NUMBER_SKIP = 2; CBC_DetectionResult::CBC_DetectionResult(CBC_BarcodeMetadata* barcodeMetadata, CBC_BoundingBox* boundingBox) { m_barcodeMetadata = barcodeMetadata; m_barcodeColumnCount = barcodeMetadata->getColumnCount(); m_boundingBox = boundingBox; m_detectionResultColumns.SetSize(m_barcodeColumnCount + 2); - for (FX_INT32 i = 0; i < m_barcodeColumnCount + 2; i++) { + for (int32_t i = 0; i < m_barcodeColumnCount + 2; i++) { m_detectionResultColumns[i] = NULL; } } @@ -49,8 +49,8 @@ CFX_PtrArray& CBC_DetectionResult::getDetectionResultColumns() { adjustIndicatorColumnRowNumbers((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(0)); adjustIndicatorColumnRowNumbers((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(m_barcodeColumnCount + 1)); - FX_INT32 unadjustedCodewordCount = CBC_PDF417Common::MAX_CODEWORDS_IN_BARCODE; - FX_INT32 previousUnadjustedCount; + int32_t unadjustedCodewordCount = CBC_PDF417Common::MAX_CODEWORDS_IN_BARCODE; + int32_t previousUnadjustedCount; do { previousUnadjustedCount = unadjustedCodewordCount; unadjustedCodewordCount = adjustRowNumbers(); @@ -65,11 +65,11 @@ CBC_BoundingBox* CBC_DetectionResult::getBoundingBox() { return m_boundingBox; } -void CBC_DetectionResult::setDetectionResultColumn(FX_INT32 barcodeColumn, CBC_DetectionResultColumn* detectionResultColumn) +void CBC_DetectionResult::setDetectionResultColumn(int32_t barcodeColumn, CBC_DetectionResultColumn* detectionResultColumn) { m_detectionResultColumns[barcodeColumn] = detectionResultColumn; } -CBC_DetectionResultColumn* CBC_DetectionResult::getDetectionResultColumn(FX_INT32 barcodeColumn) +CBC_DetectionResultColumn* CBC_DetectionResult::getDetectionResultColumn(int32_t barcodeColumn) { return (CBC_DetectionResultColumn*)m_detectionResultColumns[barcodeColumn]; } @@ -80,9 +80,9 @@ CFX_ByteString CBC_DetectionResult::toString() rowIndicatorColumn = (CBC_DetectionResultColumn*)m_detectionResultColumns[m_barcodeColumnCount + 1]; } CFX_ByteString result; - for (FX_INT32 codewordsRow = 0; codewordsRow < rowIndicatorColumn->getCodewords()->GetSize(); codewordsRow++) { + for (int32_t codewordsRow = 0; codewordsRow < rowIndicatorColumn->getCodewords()->GetSize(); codewordsRow++) { result += (FX_CHAR) codewordsRow; - for (FX_INT32 barcodeColumn = 0; barcodeColumn < m_barcodeColumnCount + 2; barcodeColumn++) { + for (int32_t barcodeColumn = 0; barcodeColumn < m_barcodeColumnCount + 2; barcodeColumn++) { if (m_detectionResultColumns[barcodeColumn] == NULL) { result += " | "; continue; @@ -104,15 +104,15 @@ void CBC_DetectionResult::adjustIndicatorColumnRowNumbers(CBC_DetectionResultCol ((CBC_DetectionResultRowIndicatorColumn*)detectionResultColumn)->adjustCompleteIndicatorColumnRowNumbers(*m_barcodeMetadata); } } -FX_INT32 CBC_DetectionResult::adjustRowNumbers() +int32_t CBC_DetectionResult::adjustRowNumbers() { - FX_INT32 unadjustedCount = adjustRowNumbersByRow(); + int32_t unadjustedCount = adjustRowNumbersByRow(); if (unadjustedCount == 0) { return 0; } - for (FX_INT32 barcodeColumn = 1; barcodeColumn < m_barcodeColumnCount + 1; barcodeColumn++) { + for (int32_t barcodeColumn = 1; barcodeColumn < m_barcodeColumnCount + 1; barcodeColumn++) { CFX_PtrArray* codewords = ((CBC_DetectionResultColumn*)m_detectionResultColumns[barcodeColumn])->getCodewords(); - for (FX_INT32 codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) { + for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) { if (codewords->GetAt(codewordsRow) == NULL) { continue; } @@ -123,24 +123,24 @@ FX_INT32 CBC_DetectionResult::adjustRowNumbers() } return unadjustedCount; } -FX_INT32 CBC_DetectionResult::adjustRowNumbersByRow() +int32_t CBC_DetectionResult::adjustRowNumbersByRow() { adjustRowNumbersFromBothRI(); - FX_INT32 unadjustedCount = adjustRowNumbersFromLRI(); + int32_t unadjustedCount = adjustRowNumbersFromLRI(); return unadjustedCount + adjustRowNumbersFromRRI(); } -FX_INT32 CBC_DetectionResult::adjustRowNumbersFromBothRI() +int32_t CBC_DetectionResult::adjustRowNumbersFromBothRI() { if (m_detectionResultColumns[0] == NULL || m_detectionResultColumns[m_barcodeColumnCount + 1] == NULL) { return 0; } CFX_PtrArray* LRIcodewords = ((CBC_DetectionResultColumn*)m_detectionResultColumns[0])->getCodewords(); CFX_PtrArray* RRIcodewords = ((CBC_DetectionResultColumn*)m_detectionResultColumns[m_barcodeColumnCount + 1])->getCodewords(); - for (FX_INT32 codewordsRow = 0; codewordsRow < LRIcodewords->GetSize(); codewordsRow++) { + for (int32_t codewordsRow = 0; codewordsRow < LRIcodewords->GetSize(); codewordsRow++) { if (LRIcodewords->GetAt(codewordsRow) != NULL && RRIcodewords->GetAt(codewordsRow) != NULL && ((CBC_Codeword*)LRIcodewords->GetAt(codewordsRow))->getRowNumber() == ((CBC_Codeword*)RRIcodewords->GetAt(codewordsRow))->getRowNumber()) { - for (FX_INT32 barcodeColumn = 1; barcodeColumn <= m_barcodeColumnCount; barcodeColumn++) { + for (int32_t barcodeColumn = 1; barcodeColumn <= m_barcodeColumnCount; barcodeColumn++) { CBC_Codeword* codeword = (CBC_Codeword*)((CBC_DetectionResultColumn*)m_detectionResultColumns[barcodeColumn])->getCodewords()->GetAt(codewordsRow); if (codeword == NULL) { continue; @@ -154,20 +154,20 @@ FX_INT32 CBC_DetectionResult::adjustRowNumbersFromBothRI() } return 0; } -FX_INT32 CBC_DetectionResult::adjustRowNumbersFromRRI() +int32_t CBC_DetectionResult::adjustRowNumbersFromRRI() { if (m_detectionResultColumns[m_barcodeColumnCount + 1] == NULL) { return 0; } - FX_INT32 unadjustedCount = 0; + int32_t unadjustedCount = 0; CFX_PtrArray* codewords = ((CBC_DetectionResultColumn*) m_detectionResultColumns.GetAt(m_barcodeColumnCount + 1))->getCodewords(); - for (FX_INT32 codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) { + for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) { if (codewords->GetAt(codewordsRow) == NULL) { continue; } - FX_INT32 rowIndicatorRowNumber = ((CBC_Codeword*)codewords->GetAt(codewordsRow))->getRowNumber(); - FX_INT32 invalidRowCounts = 0; - for (FX_INT32 barcodeColumn = m_barcodeColumnCount + 1; barcodeColumn > 0 && invalidRowCounts < ADJUST_ROW_NUMBER_SKIP; barcodeColumn--) { + int32_t rowIndicatorRowNumber = ((CBC_Codeword*)codewords->GetAt(codewordsRow))->getRowNumber(); + int32_t invalidRowCounts = 0; + for (int32_t barcodeColumn = m_barcodeColumnCount + 1; barcodeColumn > 0 && invalidRowCounts < ADJUST_ROW_NUMBER_SKIP; barcodeColumn--) { CBC_Codeword* codeword = (CBC_Codeword*)((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(barcodeColumn))->getCodewords()->GetAt(codewordsRow); if (codeword != NULL) { invalidRowCounts = adjustRowNumberIfValid(rowIndicatorRowNumber, invalidRowCounts, codeword); @@ -179,20 +179,20 @@ FX_INT32 CBC_DetectionResult::adjustRowNumbersFromRRI() } return unadjustedCount; } -FX_INT32 CBC_DetectionResult::adjustRowNumbersFromLRI() +int32_t CBC_DetectionResult::adjustRowNumbersFromLRI() { if (m_detectionResultColumns[0] == NULL) { return 0; } - FX_INT32 unadjustedCount = 0; + int32_t unadjustedCount = 0; CFX_PtrArray* codewords = ((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(0))->getCodewords(); - for (FX_INT32 codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) { + for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) { if (codewords->GetAt(codewordsRow) == NULL) { continue; } - FX_INT32 rowIndicatorRowNumber = ((CBC_Codeword*)codewords->GetAt(codewordsRow))->getRowNumber(); - FX_INT32 invalidRowCounts = 0; - for (FX_INT32 barcodeColumn = 1; barcodeColumn < m_barcodeColumnCount + 1 && invalidRowCounts < ADJUST_ROW_NUMBER_SKIP; barcodeColumn++) { + int32_t rowIndicatorRowNumber = ((CBC_Codeword*)codewords->GetAt(codewordsRow))->getRowNumber(); + int32_t invalidRowCounts = 0; + for (int32_t barcodeColumn = 1; barcodeColumn < m_barcodeColumnCount + 1 && invalidRowCounts < ADJUST_ROW_NUMBER_SKIP; barcodeColumn++) { CBC_Codeword* codeword = (CBC_Codeword*)((CBC_DetectionResultColumn*)m_detectionResultColumns[barcodeColumn])->getCodewords()->GetAt(codewordsRow); if (codeword != NULL) { invalidRowCounts = adjustRowNumberIfValid(rowIndicatorRowNumber, invalidRowCounts, codeword); @@ -204,7 +204,7 @@ FX_INT32 CBC_DetectionResult::adjustRowNumbersFromLRI() } return unadjustedCount; } -FX_INT32 CBC_DetectionResult::adjustRowNumberIfValid(FX_INT32 rowIndicatorRowNumber, FX_INT32 invalidRowCounts, CBC_Codeword* codeword) +int32_t CBC_DetectionResult::adjustRowNumberIfValid(int32_t rowIndicatorRowNumber, int32_t invalidRowCounts, CBC_Codeword* codeword) { if (codeword == NULL) { return invalidRowCounts; @@ -219,7 +219,7 @@ FX_INT32 CBC_DetectionResult::adjustRowNumberIfValid(FX_INT32 rowIndicatorRowNum } return invalidRowCounts; } -void CBC_DetectionResult::adjustRowNumbers(FX_INT32 barcodeColumn, FX_INT32 codewordsRow, CFX_PtrArray* codewords) +void CBC_DetectionResult::adjustRowNumbers(int32_t barcodeColumn, int32_t codewordsRow, CFX_PtrArray* codewords) { CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordsRow); CFX_PtrArray* previousColumnCodewords = ((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(barcodeColumn - 1))->getCodewords(); @@ -251,7 +251,7 @@ void CBC_DetectionResult::adjustRowNumbers(FX_INT32 barcodeColumn, FX_INT32 code otherCodewords[12] = previousColumnCodewords->GetAt(codewordsRow + 2); otherCodewords[13] = nextColumnCodewords->GetAt(codewordsRow + 2); } - for (FX_INT32 i = 0; i < otherCodewords.GetSize(); i++) { + for (int32_t i = 0; i < otherCodewords.GetSize(); i++) { CBC_Codeword* otherCodeword = (CBC_Codeword*)otherCodewords.GetAt(i); if (adjustRowNumber(codeword, otherCodeword)) { return; @@ -269,15 +269,15 @@ FX_BOOL CBC_DetectionResult::adjustRowNumber(CBC_Codeword* codeword, CBC_Codewor } return FALSE; } -FX_INT32 CBC_DetectionResult::getBarcodeColumnCount() +int32_t CBC_DetectionResult::getBarcodeColumnCount() { return m_barcodeColumnCount; } -FX_INT32 CBC_DetectionResult::getBarcodeRowCount() +int32_t CBC_DetectionResult::getBarcodeRowCount() { return m_barcodeMetadata->getRowCount(); } -FX_INT32 CBC_DetectionResult::getBarcodeECLevel() +int32_t CBC_DetectionResult::getBarcodeECLevel() { return m_barcodeMetadata->getErrorCorrectionLevel(); } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.h b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.h index 55a5a8f134..34da90082c 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.h @@ -18,28 +18,28 @@ public: CFX_PtrArray& getDetectionResultColumns(); void setBoundingBox(CBC_BoundingBox* boundingBox); CBC_BoundingBox* getBoundingBox(); - void setDetectionResultColumn(FX_INT32 barcodeColumn, CBC_DetectionResultColumn* detectionResultColumn); - CBC_DetectionResultColumn* getDetectionResultColumn(FX_INT32 barcodeColumn); + void setDetectionResultColumn(int32_t barcodeColumn, CBC_DetectionResultColumn* detectionResultColumn); + CBC_DetectionResultColumn* getDetectionResultColumn(int32_t barcodeColumn); CFX_ByteString toString(); - FX_INT32 getBarcodeColumnCount(); - FX_INT32 getBarcodeRowCount(); - FX_INT32 getBarcodeECLevel(); + int32_t getBarcodeColumnCount(); + int32_t getBarcodeRowCount(); + int32_t getBarcodeECLevel(); private: - static FX_INT32 ADJUST_ROW_NUMBER_SKIP; + static int32_t ADJUST_ROW_NUMBER_SKIP; CBC_BarcodeMetadata* m_barcodeMetadata; CFX_PtrArray m_detectionResultColumns; CBC_BoundingBox* m_boundingBox; - FX_INT32 m_barcodeColumnCount; + int32_t m_barcodeColumnCount; private: void adjustIndicatorColumnRowNumbers(CBC_DetectionResultColumn* detectionResultColumn); - FX_INT32 adjustRowNumbers(); - FX_INT32 adjustRowNumbersByRow(); - FX_INT32 adjustRowNumbersFromBothRI(); - FX_INT32 adjustRowNumbersFromRRI(); - FX_INT32 adjustRowNumbersFromLRI(); - static FX_INT32 adjustRowNumberIfValid(FX_INT32 rowIndicatorRowNumber, FX_INT32 invalidRowCounts, CBC_Codeword* codeword); - void adjustRowNumbers(FX_INT32 barcodeColumn, FX_INT32 codewordsRow, CFX_PtrArray* codewords); + int32_t adjustRowNumbers(); + int32_t adjustRowNumbersByRow(); + int32_t adjustRowNumbersFromBothRI(); + int32_t adjustRowNumbersFromRRI(); + int32_t adjustRowNumbersFromLRI(); + static int32_t adjustRowNumberIfValid(int32_t rowIndicatorRowNumber, int32_t invalidRowCounts, CBC_Codeword* codeword); + void adjustRowNumbers(int32_t barcodeColumn, int32_t codewordsRow, CFX_PtrArray* codewords); static FX_BOOL adjustRowNumber(CBC_Codeword* codeword, CBC_Codeword* otherCodeword); diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp index 6d949b7640..f4da542130 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp @@ -24,7 +24,7 @@ #include "BC_PDF417Codeword.h" #include "BC_PDF417BoundingBox.h" #include "BC_PDF417DetectionResultColumn.h" -FX_INT32 CBC_DetectionResultColumn::MAX_NEARBY_DISTANCE = 5; +int32_t CBC_DetectionResultColumn::MAX_NEARBY_DISTANCE = 5; CBC_DetectionResultColumn::CBC_DetectionResultColumn(CBC_BoundingBox* boundingBox) { m_boundingBox = boundingBox; @@ -33,20 +33,20 @@ CBC_DetectionResultColumn::CBC_DetectionResultColumn(CBC_BoundingBox* boundingBo } CBC_DetectionResultColumn::~CBC_DetectionResultColumn() { - for (FX_INT32 i = 0; i < m_codewords->GetSize(); i++) { + for (int32_t i = 0; i < m_codewords->GetSize(); i++) { delete (CBC_Codeword*)m_codewords->GetAt(i); } m_codewords->RemoveAll(); delete m_codewords; } -CBC_Codeword* CBC_DetectionResultColumn::getCodewordNearby(FX_INT32 imageRow) +CBC_Codeword* CBC_DetectionResultColumn::getCodewordNearby(int32_t imageRow) { CBC_Codeword* codeword = getCodeword(imageRow); if (codeword != NULL) { return codeword; } - for (FX_INT32 i = 1; i < MAX_NEARBY_DISTANCE; i++) { - FX_INT32 nearImageRow = imageRowToCodewordIndex(imageRow) - i; + for (int32_t i = 1; i < MAX_NEARBY_DISTANCE; i++) { + int32_t nearImageRow = imageRowToCodewordIndex(imageRow) - i; if (nearImageRow >= 0) { codeword = (CBC_Codeword*)m_codewords->GetAt(nearImageRow); if (codeword != NULL) { @@ -63,19 +63,19 @@ CBC_Codeword* CBC_DetectionResultColumn::getCodewordNearby(FX_INT32 imageRow) } return NULL; } -FX_INT32 CBC_DetectionResultColumn::imageRowToCodewordIndex(FX_INT32 imageRow) +int32_t CBC_DetectionResultColumn::imageRowToCodewordIndex(int32_t imageRow) { return imageRow - m_boundingBox->getMinY(); } -FX_INT32 CBC_DetectionResultColumn::codewordIndexToImageRow(FX_INT32 codewordIndex) +int32_t CBC_DetectionResultColumn::codewordIndexToImageRow(int32_t codewordIndex) { return m_boundingBox->getMinY() + codewordIndex; } -void CBC_DetectionResultColumn::setCodeword(FX_INT32 imageRow, CBC_Codeword* codeword) +void CBC_DetectionResultColumn::setCodeword(int32_t imageRow, CBC_Codeword* codeword) { m_codewords->SetAt(imageRowToCodewordIndex(imageRow), codeword); } -CBC_Codeword* CBC_DetectionResultColumn::getCodeword(FX_INT32 imageRow) +CBC_Codeword* CBC_DetectionResultColumn::getCodeword(int32_t imageRow) { return (CBC_Codeword*)m_codewords->GetAt(imageRowToCodewordIndex(imageRow)); } @@ -90,8 +90,8 @@ CFX_PtrArray* CBC_DetectionResultColumn::getCodewords() CFX_ByteString CBC_DetectionResultColumn::toString() { CFX_ByteString result; - FX_INT32 row = 0; - for (FX_INT32 i = 0; i < m_codewords->GetSize(); i++) { + int32_t row = 0; + for (int32_t i = 0; i < m_codewords->GetSize(); i++) { CBC_Codeword* codeword = (CBC_Codeword*)m_codewords->GetAt(i); if (codeword == NULL) { result += (FX_CHAR) row; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.h b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.h index 202272d2e9..9940998282 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.h @@ -13,11 +13,11 @@ class CBC_DetectionResultColumn public: CBC_DetectionResultColumn(CBC_BoundingBox* boundingBox); virtual ~CBC_DetectionResultColumn(); - CBC_Codeword* getCodewordNearby(FX_INT32 imageRow); - FX_INT32 imageRowToCodewordIndex(FX_INT32 imageRow); - FX_INT32 codewordIndexToImageRow(FX_INT32 codewordIndex); - void setCodeword(FX_INT32 imageRow, CBC_Codeword* codeword); - CBC_Codeword* getCodeword(FX_INT32 imageRow); + CBC_Codeword* getCodewordNearby(int32_t imageRow); + int32_t imageRowToCodewordIndex(int32_t imageRow); + int32_t codewordIndexToImageRow(int32_t codewordIndex); + void setCodeword(int32_t imageRow, CBC_Codeword* codeword); + CBC_Codeword* getCodeword(int32_t imageRow); CBC_BoundingBox* getBoundingBox(); CFX_PtrArray* getCodewords(); CFX_ByteString toString(); @@ -25,6 +25,6 @@ public: CBC_BoundingBox* m_boundingBox; CFX_PtrArray* m_codewords; private: - static FX_INT32 MAX_NEARBY_DISTANCE; + static int32_t MAX_NEARBY_DISTANCE; }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp index 89e46a74cd..12622c3dff 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp @@ -39,14 +39,14 @@ CBC_DetectionResultRowIndicatorColumn::~CBC_DetectionResultRowIndicatorColumn() } void CBC_DetectionResultRowIndicatorColumn::setRowNumbers() { - for (FX_INT32 i = 0; i < m_codewords->GetSize(); i++) { + for (int32_t i = 0; i < m_codewords->GetSize(); i++) { CBC_Codeword * codeword = (CBC_Codeword*)m_codewords->GetAt(i); if (codeword != NULL) { codeword->setRowNumberAsRowIndicatorColumn(); } } } -FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata) +int32_t CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata) { CFX_PtrArray* codewords = getCodewords(); setRowNumbers(); @@ -54,18 +54,18 @@ FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRow CBC_BoundingBox* boundingBox = getBoundingBox(); CBC_ResultPoint* top = m_isLeft ? boundingBox->getTopLeft() : boundingBox->getTopRight(); CBC_ResultPoint* bottom = m_isLeft ? boundingBox->getBottomLeft() : boundingBox->getBottomRight(); - FX_INT32 firstRow = imageRowToCodewordIndex((FX_INT32) top->GetY()); - FX_INT32 lastRow = imageRowToCodewordIndex((FX_INT32) bottom->GetY()); + int32_t firstRow = imageRowToCodewordIndex((int32_t) top->GetY()); + int32_t lastRow = imageRowToCodewordIndex((int32_t) bottom->GetY()); FX_FLOAT averageRowHeight = (lastRow - firstRow) / (FX_FLOAT) barcodeMetadata.getRowCount(); - FX_INT32 barcodeRow = -1; - FX_INT32 maxRowHeight = 1; - FX_INT32 currentRowHeight = 0; - for (FX_INT32 codewordsRow = firstRow; codewordsRow < lastRow; codewordsRow++) { + int32_t barcodeRow = -1; + int32_t maxRowHeight = 1; + int32_t currentRowHeight = 0; + for (int32_t codewordsRow = firstRow; codewordsRow < lastRow; codewordsRow++) { if (codewords->GetAt(codewordsRow) == NULL) { continue; } CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordsRow); - FX_INT32 rowDifference = codeword->getRowNumber() - barcodeRow; + int32_t rowDifference = codeword->getRowNumber() - barcodeRow; if (rowDifference == 0) { currentRowHeight++; } else if (rowDifference == 1) { @@ -79,14 +79,14 @@ FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRow } else if (rowDifference > codewordsRow) { codewords->SetAt(codewordsRow, NULL); } else { - FX_INT32 checkedRows; + int32_t checkedRows; if (maxRowHeight > 2) { checkedRows = (maxRowHeight - 2) * rowDifference; } else { checkedRows = rowDifference; } FX_BOOL closePreviousCodewordFound = checkedRows >= codewordsRow; - for (FX_INT32 i = 1; i <= checkedRows && !closePreviousCodewordFound; i++) { + for (int32_t i = 1; i <= checkedRows && !closePreviousCodewordFound; i++) { closePreviousCodewordFound = codewords->GetAt(codewordsRow - i) != NULL; } if (closePreviousCodewordFound) { @@ -97,9 +97,9 @@ FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRow } } } - return (FX_INT32) (averageRowHeight + 0.5); + return (int32_t) (averageRowHeight + 0.5); } -CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights(FX_INT32 &e) +CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights(int32_t &e) { CBC_BarcodeMetadata* barcodeMetadata = getBarcodeMetadata(); if (barcodeMetadata == NULL) { @@ -109,7 +109,7 @@ CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights(FX_INT32 &e adjustIncompleteIndicatorColumnRowNumbers(*barcodeMetadata); CFX_Int32Array* result = FX_NEW CFX_Int32Array; result->SetSize(barcodeMetadata->getRowCount()); - for (FX_INT32 i = 0; i < getCodewords()->GetSize(); i++) { + for (int32_t i = 0; i < getCodewords()->GetSize(); i++) { CBC_Codeword* codeword = (CBC_Codeword*)getCodewords()->GetAt(i); if (codeword != NULL) { result->SetAt(codeword->getRowNumber(), result->GetAt(codeword->getRowNumber()) + 1); @@ -117,25 +117,25 @@ CFX_Int32Array* CBC_DetectionResultRowIndicatorColumn::getRowHeights(FX_INT32 &e } return result; } -FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustIncompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata) +int32_t CBC_DetectionResultRowIndicatorColumn::adjustIncompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata) { CBC_BoundingBox* boundingBox = getBoundingBox(); CBC_ResultPoint* top = m_isLeft ? boundingBox->getTopLeft() : boundingBox->getTopRight(); CBC_ResultPoint* bottom = m_isLeft ? boundingBox->getBottomLeft() : boundingBox->getBottomRight(); - FX_INT32 firstRow = imageRowToCodewordIndex((FX_INT32) top->GetY()); - FX_INT32 lastRow = imageRowToCodewordIndex((FX_INT32) bottom->GetY()); + int32_t firstRow = imageRowToCodewordIndex((int32_t) top->GetY()); + int32_t lastRow = imageRowToCodewordIndex((int32_t) bottom->GetY()); FX_FLOAT averageRowHeight = (lastRow - firstRow) / (FX_FLOAT) barcodeMetadata.getRowCount(); CFX_PtrArray* codewords = getCodewords(); - FX_INT32 barcodeRow = -1; - FX_INT32 maxRowHeight = 1; - FX_INT32 currentRowHeight = 0; - for (FX_INT32 codewordsRow = firstRow; codewordsRow < lastRow; codewordsRow++) { + int32_t barcodeRow = -1; + int32_t maxRowHeight = 1; + int32_t currentRowHeight = 0; + for (int32_t codewordsRow = firstRow; codewordsRow < lastRow; codewordsRow++) { if (codewords->GetAt(codewordsRow) == NULL) { continue; } CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordsRow); codeword->setRowNumberAsRowIndicatorColumn(); - FX_INT32 rowDifference = codeword->getRowNumber() - barcodeRow; + int32_t rowDifference = codeword->getRowNumber() - barcodeRow; if (rowDifference == 0) { currentRowHeight++; } else if (rowDifference == 1) { @@ -149,7 +149,7 @@ FX_INT32 CBC_DetectionResultRowIndicatorColumn::adjustIncompleteIndicatorColumnR currentRowHeight = 1; } } - return (FX_INT32) (averageRowHeight + 0.5); + return (int32_t) (averageRowHeight + 0.5); } CBC_BarcodeMetadata* CBC_DetectionResultRowIndicatorColumn::getBarcodeMetadata() { @@ -158,14 +158,14 @@ CBC_BarcodeMetadata* CBC_DetectionResultRowIndicatorColumn::getBarcodeMetadata() CBC_BarcodeValue barcodeRowCountUpperPart; CBC_BarcodeValue barcodeRowCountLowerPart; CBC_BarcodeValue barcodeECLevel; - for (FX_INT32 i = 0; i < codewords->GetSize(); i++) { + for (int32_t i = 0; i < codewords->GetSize(); i++) { CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(i); if (codeword == NULL) { continue; } codeword->setRowNumberAsRowIndicatorColumn(); - FX_INT32 rowIndicatorValue = codeword->getValue() % 30; - FX_INT32 codewordRowNumber = codeword->getRowNumber(); + int32_t rowIndicatorValue = codeword->getValue() % 30; + int32_t codewordRowNumber = codeword->getRowNumber(); if (!m_isLeft) { codewordRowNumber += 2; } @@ -205,13 +205,13 @@ CFX_ByteString CBC_DetectionResultRowIndicatorColumn::toString() } void CBC_DetectionResultRowIndicatorColumn::removeIncorrectCodewords(CFX_PtrArray* codewords, CBC_BarcodeMetadata barcodeMetadata) { - for (FX_INT32 codewordRow = 0; codewordRow < codewords->GetSize(); codewordRow++) { + for (int32_t codewordRow = 0; codewordRow < codewords->GetSize(); codewordRow++) { CBC_Codeword* codeword = (CBC_Codeword*)codewords->GetAt(codewordRow); if (codeword == NULL) { continue; } - FX_INT32 rowIndicatorValue = codeword->getValue() % 30; - FX_INT32 codewordRowNumber = codeword->getRowNumber(); + int32_t rowIndicatorValue = codeword->getValue() % 30; + int32_t codewordRowNumber = codeword->getRowNumber(); if (codewordRowNumber > barcodeMetadata.getRowCount()) { codewords->SetAt(codewordRow, NULL); continue; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h index fbdd0f0ec4..f8092311c5 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h @@ -15,9 +15,9 @@ public: CBC_DetectionResultRowIndicatorColumn(CBC_BoundingBox* boundingBox, FX_BOOL isLeft); virtual ~CBC_DetectionResultRowIndicatorColumn(); void setRowNumbers(); - FX_INT32 adjustCompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata); - CFX_Int32Array* getRowHeights(FX_INT32 &e); - FX_INT32 adjustIncompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata); + int32_t adjustCompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata); + CFX_Int32Array* getRowHeights(int32_t &e); + int32_t adjustIncompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata); CBC_BarcodeMetadata* getBarcodeMetadata(); FX_BOOL isLeft(); CFX_ByteString toString(); diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp index 8d1a86ec92..726e0ec94f 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp @@ -28,26 +28,26 @@ #include "BC_PDF417DetectorResult.h" #include "BC_PDF417Detector.h" #define INTERGER_MAX 2147483647 -FX_INT32 CBC_Detector::INDEXES_START_PATTERN[] = {0, 4, 1, 5}; -FX_INT32 CBC_Detector::INDEXES_STOP_PATTERN[] = {6, 2, 7, 3}; -FX_INT32 CBC_Detector::INTEGER_MATH_SHIFT = 8; -FX_INT32 CBC_Detector::PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << INTEGER_MATH_SHIFT; -FX_INT32 CBC_Detector::MAX_AVG_VARIANCE = (FX_INT32) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.42f); -FX_INT32 CBC_Detector::MAX_INDIVIDUAL_VARIANCE = (FX_INT32) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.8f); -FX_INT32 CBC_Detector::START_PATTERN[] = {8, 1, 1, 1, 1, 1, 1, 3}; -FX_INT32 CBC_Detector::STOP_PATTERN[] = {7, 1, 1, 3, 1, 1, 1, 2, 1}; -FX_INT32 CBC_Detector::MAX_PIXEL_DRIFT = 3; -FX_INT32 CBC_Detector::MAX_PATTERN_DRIFT = 5; -FX_INT32 CBC_Detector::SKIPPED_ROW_COUNT_MAX = 25; -FX_INT32 CBC_Detector::ROW_STEP = 5; -FX_INT32 CBC_Detector::BARCODE_MIN_HEIGHT = 10; +int32_t CBC_Detector::INDEXES_START_PATTERN[] = {0, 4, 1, 5}; +int32_t CBC_Detector::INDEXES_STOP_PATTERN[] = {6, 2, 7, 3}; +int32_t CBC_Detector::INTEGER_MATH_SHIFT = 8; +int32_t CBC_Detector::PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << INTEGER_MATH_SHIFT; +int32_t CBC_Detector::MAX_AVG_VARIANCE = (int32_t) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.42f); +int32_t CBC_Detector::MAX_INDIVIDUAL_VARIANCE = (int32_t) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 0.8f); +int32_t CBC_Detector::START_PATTERN[] = {8, 1, 1, 1, 1, 1, 1, 3}; +int32_t CBC_Detector::STOP_PATTERN[] = {7, 1, 1, 3, 1, 1, 1, 2, 1}; +int32_t CBC_Detector::MAX_PIXEL_DRIFT = 3; +int32_t CBC_Detector::MAX_PATTERN_DRIFT = 5; +int32_t CBC_Detector::SKIPPED_ROW_COUNT_MAX = 25; +int32_t CBC_Detector::ROW_STEP = 5; +int32_t CBC_Detector::BARCODE_MIN_HEIGHT = 10; CBC_Detector::CBC_Detector() { } CBC_Detector::~CBC_Detector() { } -CBC_PDF417DetectorResult* CBC_Detector::detect(CBC_BinaryBitmap* image, FX_INT32 hints, FX_BOOL multiple, FX_INT32 &e) +CBC_PDF417DetectorResult* CBC_Detector::detect(CBC_BinaryBitmap* image, int32_t hints, FX_BOOL multiple, int32_t &e) { CBC_CommonBitMatrix* bitMatrix = image->GetBlackMatrix(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); @@ -65,12 +65,12 @@ CBC_PDF417DetectorResult* CBC_Detector::detect(CBC_BinaryBitmap* image, FX_INT32 } void CBC_Detector::rotate180(CBC_CommonBitMatrix* bitMatrix) { - FX_INT32 width = bitMatrix->GetWidth(); - FX_INT32 height = bitMatrix->GetHeight(); + int32_t width = bitMatrix->GetWidth(); + int32_t height = bitMatrix->GetHeight(); CBC_CommonBitArray* firstRowBitArray = FX_NEW CBC_CommonBitArray(width); CBC_CommonBitArray* secondRowBitArray = FX_NEW CBC_CommonBitArray(width); CBC_CommonBitArray* tmpBitArray = FX_NEW CBC_CommonBitArray(width); - for (FX_INT32 y = 0; y < (height + 1) >> 1; y++) { + for (int32_t y = 0; y < (height + 1) >> 1; y++) { CBC_CommonBitArray* temp = bitMatrix->GetRow(height - 1 - y, secondRowBitArray); CBC_CommonBitArray* tempfirstRow = firstRowBitArray; firstRowBitArray = bitMatrix->GetRow(y, tempfirstRow); @@ -91,8 +91,8 @@ CBC_CommonBitArray* CBC_Detector::mirror(CBC_CommonBitArray* input, CBC_CommonBi { CBC_CommonBitArray* array = FX_NEW CBC_CommonBitArray(result->GetSize()); array->Clear(); - FX_INT32 size = input->GetSize(); - for (FX_INT32 i = 0; i < size; i++) { + int32_t size = input->GetSize(); + for (int32_t i = 0; i < size; i++) { if (input->Get(i)) { array->Set(size - 1 - i); } @@ -102,8 +102,8 @@ CBC_CommonBitArray* CBC_Detector::mirror(CBC_CommonBitArray* input, CBC_CommonBi CFX_PtrArray* CBC_Detector::detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMatrix) { CFX_PtrArray* barcodeCoordinates = FX_NEW CFX_PtrArray; - FX_INT32 row = 0; - FX_INT32 column = 0; + int32_t row = 0; + int32_t column = 0; FX_BOOL foundBarcodeInRow = FALSE; while (row < bitMatrix->GetHeight()) { CFX_PtrArray* vertices = findVertices(bitMatrix, row, column); @@ -116,7 +116,7 @@ CFX_PtrArray* CBC_Detector::detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMat } foundBarcodeInRow = FALSE; column = 0; - for (FX_INT32 i = 0; i < barcodeCoordinates->GetSize(); i++) { + for (int32_t i = 0; i < barcodeCoordinates->GetSize(); i++) { CFX_PtrArray* barcodeCoordinate = (CFX_PtrArray*)barcodeCoordinates->GetAt(i); if (barcodeCoordinate->GetAt(1) != NULL) { row = row > ((CBC_ResultPoint*)barcodeCoordinate->GetAt(1))->GetY(); @@ -137,19 +137,19 @@ CFX_PtrArray* CBC_Detector::detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMat break; } if (vertices->GetAt(2) != NULL) { - column = (FX_INT32) ((CBC_ResultPoint*)vertices->GetAt(2))->GetX(); - row = (FX_INT32) ((CBC_ResultPoint*)vertices->GetAt(2))->GetY(); + column = (int32_t) ((CBC_ResultPoint*)vertices->GetAt(2))->GetX(); + row = (int32_t) ((CBC_ResultPoint*)vertices->GetAt(2))->GetY(); } else { - column = (FX_INT32) ((CBC_ResultPoint*)vertices->GetAt(4))->GetX(); - row = (FX_INT32) ((CBC_ResultPoint*)vertices->GetAt(4))->GetY(); + column = (int32_t) ((CBC_ResultPoint*)vertices->GetAt(4))->GetX(); + row = (int32_t) ((CBC_ResultPoint*)vertices->GetAt(4))->GetY(); } } return barcodeCoordinates; } -CFX_PtrArray* CBC_Detector::findVertices(CBC_CommonBitMatrix* matrix, FX_INT32 startRow, FX_INT32 startColumn) +CFX_PtrArray* CBC_Detector::findVertices(CBC_CommonBitMatrix* matrix, int32_t startRow, int32_t startColumn) { - FX_INT32 height = matrix->GetHeight(); - FX_INT32 width = matrix->GetWidth(); + int32_t height = matrix->GetHeight(); + int32_t width = matrix->GetWidth(); CFX_PtrArray* result = FX_NEW CFX_PtrArray; result->SetSize(8); CFX_PtrArray* startptr = findRowsWithPattern(matrix, height, width, startRow, startColumn, START_PATTERN, sizeof(START_PATTERN) / sizeof(START_PATTERN[0])); @@ -157,8 +157,8 @@ CFX_PtrArray* CBC_Detector::findVertices(CBC_CommonBitMatrix* matrix, FX_INT32 s startptr->RemoveAll(); delete startptr; if (result->GetAt(4) != NULL) { - startColumn = (FX_INT32) ((CBC_ResultPoint*)result->GetAt(4))->GetX(); - startRow = (FX_INT32) ((CBC_ResultPoint*)result->GetAt(4))->GetY(); + startColumn = (int32_t) ((CBC_ResultPoint*)result->GetAt(4))->GetX(); + startRow = (int32_t) ((CBC_ResultPoint*)result->GetAt(4))->GetY(); } CFX_PtrArray* stopptr = findRowsWithPattern(matrix, height, width, startRow, startColumn, STOP_PATTERN, sizeof(STOP_PATTERN) / sizeof(STOP_PATTERN[0])); copyToResult(result, stopptr, INDEXES_STOP_PATTERN, sizeof(INDEXES_STOP_PATTERN) / sizeof(INDEXES_STOP_PATTERN[0])); @@ -166,13 +166,13 @@ CFX_PtrArray* CBC_Detector::findVertices(CBC_CommonBitMatrix* matrix, FX_INT32 s delete stopptr; return result; } -void CBC_Detector::copyToResult(CFX_PtrArray *result, CFX_PtrArray* tmpResult, FX_INT32* destinationIndexes, FX_INT32 destinationLength) +void CBC_Detector::copyToResult(CFX_PtrArray *result, CFX_PtrArray* tmpResult, int32_t* destinationIndexes, int32_t destinationLength) { - for (FX_INT32 i = 0; i < destinationLength; i++) { + for (int32_t i = 0; i < destinationLength; i++) { result->SetAt(destinationIndexes[i], tmpResult->GetAt(i)); } } -CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, FX_INT32 height, FX_INT32 width, FX_INT32 startRow, FX_INT32 startColumn, FX_INT32* pattern, FX_INT32 patternLength) +CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, int32_t height, int32_t width, int32_t startRow, int32_t startColumn, int32_t* pattern, int32_t patternLength) { CFX_PtrArray* result = FX_NEW CFX_PtrArray; result->SetSize(4); @@ -199,12 +199,12 @@ CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, FX_ break; } } - FX_INT32 stopRow = startRow + 1; + int32_t stopRow = startRow + 1; if (found) { - FX_INT32 skippedRowCount = 0; + int32_t skippedRowCount = 0; CFX_Int32Array previousRowLoc; - previousRowLoc.Add((FX_INT32)((CBC_ResultPoint*)result->GetAt(0))->GetX()); - previousRowLoc.Add((FX_INT32)((CBC_ResultPoint*)result->GetAt(1))->GetX()); + previousRowLoc.Add((int32_t)((CBC_ResultPoint*)result->GetAt(0))->GetX()); + previousRowLoc.Add((int32_t)((CBC_ResultPoint*)result->GetAt(1))->GetX()); for (; stopRow < height; stopRow++) { CFX_Int32Array* loc = findGuardPattern(matrix, previousRowLoc[0], stopRow, width, FALSE, pattern, patternLength, counters); if (loc != NULL && @@ -227,26 +227,26 @@ CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix, FX_ result->SetAt(3, FX_NEW CBC_ResultPoint((FX_FLOAT)previousRowLoc.GetAt(1), (FX_FLOAT)stopRow)); } if (stopRow - startRow < BARCODE_MIN_HEIGHT) { - for (FX_INT32 i = 0; i < result->GetSize(); i++) { + for (int32_t i = 0; i < result->GetSize(); i++) { result->SetAt(i, NULL); } } return result; } -CFX_Int32Array* CBC_Detector::findGuardPattern(CBC_CommonBitMatrix* matrix, FX_INT32 column, FX_INT32 row, FX_INT32 width, FX_BOOL whiteFirst, FX_INT32* pattern, FX_INT32 patternLength, CFX_Int32Array &counters) +CFX_Int32Array* CBC_Detector::findGuardPattern(CBC_CommonBitMatrix* matrix, int32_t column, int32_t row, int32_t width, FX_BOOL whiteFirst, int32_t* pattern, int32_t patternLength, CFX_Int32Array &counters) { - for (FX_INT32 i = 0; i < counters.GetSize(); i++) { + for (int32_t i = 0; i < counters.GetSize(); i++) { counters.SetAt(i, 0); } FX_BOOL isWhite = whiteFirst; - FX_INT32 patternStart = column; - FX_INT32 pixelDrift = 0; + int32_t patternStart = column; + int32_t pixelDrift = 0; CFX_Int32Array* intarray = FX_NEW CFX_Int32Array; while (matrix->Get(patternStart, row) && patternStart > 0 && pixelDrift++ < MAX_PIXEL_DRIFT) { patternStart--; } - FX_INT32 x = patternStart; - FX_INT32 counterPosition = 0; + int32_t x = patternStart; + int32_t counterPosition = 0; for (; x < width; x++) { FX_BOOL pixel = matrix->Get(x, row); if (pixel ^ isWhite) { @@ -259,7 +259,7 @@ CFX_Int32Array* CBC_Detector::findGuardPattern(CBC_CommonBitMatrix* matrix, FX_I return intarray; } patternStart += counters[0] + counters[1]; - for (FX_INT32 l = 2, k = 0; l < patternLength; l++, k++) { + for (int32_t l = 2, k = 0; l < patternLength; l++, k++) { counters.SetAt(k, counters.GetAt(l)); } counters.SetAt(patternLength - 2, 0); @@ -282,25 +282,25 @@ CFX_Int32Array* CBC_Detector::findGuardPattern(CBC_CommonBitMatrix* matrix, FX_I delete intarray; return NULL; } -FX_INT32 CBC_Detector::patternMatchVariance(CFX_Int32Array &counters, FX_INT32* pattern, FX_INT32 maxIndividualVariance) +int32_t CBC_Detector::patternMatchVariance(CFX_Int32Array &counters, int32_t* pattern, int32_t maxIndividualVariance) { - FX_INT32 numCounters = counters.GetSize(); - FX_INT32 total = 0; - FX_INT32 patternLength = 0; - for (FX_INT32 i = 0; i < numCounters; i++) { + int32_t numCounters = counters.GetSize(); + int32_t total = 0; + int32_t patternLength = 0; + for (int32_t i = 0; i < numCounters; i++) { total += counters[i]; patternLength += pattern[i]; } if (total < patternLength) { return INTERGER_MAX; } - FX_INT32 unitBarWidth = (total << INTEGER_MATH_SHIFT) / patternLength; + int32_t unitBarWidth = (total << INTEGER_MATH_SHIFT) / patternLength; maxIndividualVariance = (maxIndividualVariance * unitBarWidth) >> INTEGER_MATH_SHIFT; - FX_INT32 totalVariance = 0; - for (FX_INT32 x = 0; x < numCounters; x++) { - FX_INT32 counter = counters[x] << INTEGER_MATH_SHIFT; - FX_INT32 scaledPattern = pattern[x] * unitBarWidth; - FX_INT32 variance = counter > scaledPattern ? counter - scaledPattern : scaledPattern - counter; + int32_t totalVariance = 0; + for (int32_t x = 0; x < numCounters; x++) { + int32_t counter = counters[x] << INTEGER_MATH_SHIFT; + int32_t scaledPattern = pattern[x] * unitBarWidth; + int32_t variance = counter > scaledPattern ? counter - scaledPattern : scaledPattern - counter; if (variance > maxIndividualVariance) { return INTERGER_MAX; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.h b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.h index c160779122..93d5ff82a2 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.h @@ -15,28 +15,28 @@ class CBC_Detector public: CBC_Detector(); virtual ~CBC_Detector(); - static CBC_PDF417DetectorResult* detect(CBC_BinaryBitmap* image, FX_INT32 hints, FX_BOOL multiple, FX_INT32 &e); + static CBC_PDF417DetectorResult* detect(CBC_BinaryBitmap* image, int32_t hints, FX_BOOL multiple, int32_t &e); static void rotate180(CBC_CommonBitMatrix* bitMatrix); static CBC_CommonBitArray* mirror(CBC_CommonBitArray* input, CBC_CommonBitArray* result); private: - static FX_INT32 INDEXES_START_PATTERN[]; - static FX_INT32 INDEXES_STOP_PATTERN[]; - static FX_INT32 INTEGER_MATH_SHIFT; - static FX_INT32 PATTERN_MATCH_RESULT_SCALE_FACTOR; - static FX_INT32 MAX_AVG_VARIANCE; - static FX_INT32 MAX_INDIVIDUAL_VARIANCE; - static FX_INT32 START_PATTERN[]; - static FX_INT32 STOP_PATTERN[]; - static FX_INT32 MAX_PIXEL_DRIFT; - static FX_INT32 MAX_PATTERN_DRIFT; - static FX_INT32 SKIPPED_ROW_COUNT_MAX; - static FX_INT32 ROW_STEP; - static FX_INT32 BARCODE_MIN_HEIGHT; + static int32_t INDEXES_START_PATTERN[]; + static int32_t INDEXES_STOP_PATTERN[]; + static int32_t INTEGER_MATH_SHIFT; + static int32_t PATTERN_MATCH_RESULT_SCALE_FACTOR; + static int32_t MAX_AVG_VARIANCE; + static int32_t MAX_INDIVIDUAL_VARIANCE; + static int32_t START_PATTERN[]; + static int32_t STOP_PATTERN[]; + static int32_t MAX_PIXEL_DRIFT; + static int32_t MAX_PATTERN_DRIFT; + static int32_t SKIPPED_ROW_COUNT_MAX; + static int32_t ROW_STEP; + static int32_t BARCODE_MIN_HEIGHT; static CFX_PtrArray* detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMatrix); - static CFX_PtrArray* findVertices(CBC_CommonBitMatrix* matrix, FX_INT32 startRow, FX_INT32 startColumn); - static void copyToResult(CFX_PtrArray* result, CFX_PtrArray* tmpResult, FX_INT32* destinationIndexes, FX_INT32 destinationLength); - static CFX_PtrArray* findRowsWithPattern(CBC_CommonBitMatrix* matrix, FX_INT32 height, FX_INT32 width, FX_INT32 startRow, FX_INT32 startColumn, FX_INT32* pattern, FX_INT32 patternLength); - static CFX_Int32Array* findGuardPattern(CBC_CommonBitMatrix* matrix, FX_INT32 column, FX_INT32 row, FX_INT32 width, FX_BOOL whiteFirst, FX_INT32* pattern, FX_INT32 patternLength, CFX_Int32Array &counters); - static FX_INT32 patternMatchVariance(CFX_Int32Array &counters, FX_INT32* pattern, FX_INT32 maxIndividualVariance); + static CFX_PtrArray* findVertices(CBC_CommonBitMatrix* matrix, int32_t startRow, int32_t startColumn); + static void copyToResult(CFX_PtrArray* result, CFX_PtrArray* tmpResult, int32_t* destinationIndexes, int32_t destinationLength); + static CFX_PtrArray* findRowsWithPattern(CBC_CommonBitMatrix* matrix, int32_t height, int32_t width, int32_t startRow, int32_t startColumn, int32_t* pattern, int32_t patternLength); + static CFX_Int32Array* findGuardPattern(CBC_CommonBitMatrix* matrix, int32_t column, int32_t row, int32_t width, FX_BOOL whiteFirst, int32_t* pattern, int32_t patternLength, CFX_Int32Array &counters); + static int32_t patternMatchVariance(CFX_Int32Array &counters, int32_t* pattern, int32_t maxIndividualVariance); }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp index e082290011..7f65e04294 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp @@ -31,9 +31,9 @@ CBC_PDF417DetectorResult::CBC_PDF417DetectorResult(CBC_CommonBitMatrix* bits, CF } CBC_PDF417DetectorResult::~CBC_PDF417DetectorResult() { - for (FX_INT32 i = 0; i < m_points->GetSize(); i++) { + for (int32_t i = 0; i < m_points->GetSize(); i++) { CFX_PtrArray* temp = (CFX_PtrArray*)m_points->GetAt(i); - for (FX_INT32 j = 0; j < temp->GetSize(); j++) { + for (int32_t j = 0; j < temp->GetSize(); j++) { delete (CBC_ResultPoint*)temp->GetAt(j); } temp->RemoveAll(); diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.cpp index 76d2e7bf88..189ed0831b 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.cpp @@ -23,7 +23,7 @@ #include "../barcode.h" #include "BC_PDF417Dimensions.h" -CBC_Dimensions::CBC_Dimensions(FX_INT32 minCols, FX_INT32 maxCols, FX_INT32 minRows, FX_INT32 maxRows) +CBC_Dimensions::CBC_Dimensions(int32_t minCols, int32_t maxCols, int32_t minRows, int32_t maxRows) { m_minCols = minCols; m_maxCols = maxCols; @@ -33,19 +33,19 @@ CBC_Dimensions::CBC_Dimensions(FX_INT32 minCols, FX_INT32 maxCols, FX_INT32 minR CBC_Dimensions::~CBC_Dimensions() { } -FX_INT32 CBC_Dimensions::getMinCols() +int32_t CBC_Dimensions::getMinCols() { return m_minCols; } -FX_INT32 CBC_Dimensions::getMaxCols() +int32_t CBC_Dimensions::getMaxCols() { return m_maxCols; } -FX_INT32 CBC_Dimensions::getMinRows() +int32_t CBC_Dimensions::getMinRows() { return m_minRows; } -FX_INT32 CBC_Dimensions::getMaxRows() +int32_t CBC_Dimensions::getMaxRows() { return m_maxRows; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.h b/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.h index b8e9763081..b75b998fe7 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.h @@ -9,16 +9,16 @@ class CBC_Dimensions { public: - CBC_Dimensions(FX_INT32 minCols, FX_INT32 maxCols, FX_INT32 minRows, FX_INT32 maxRows); + CBC_Dimensions(int32_t minCols, int32_t maxCols, int32_t minRows, int32_t maxRows); virtual ~CBC_Dimensions(); - FX_INT32 getMinCols(); - FX_INT32 getMaxCols(); - FX_INT32 getMinRows(); - FX_INT32 getMaxRows(); + int32_t getMinCols(); + int32_t getMaxCols(); + int32_t getMinRows(); + int32_t getMaxRows(); private: - FX_INT32 m_minCols; - FX_INT32 m_maxCols; - FX_INT32 m_minRows; - FX_INT32 m_maxRows; + int32_t m_minCols; + int32_t m_maxCols; + int32_t m_minRows; + int32_t m_maxRows; }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp index 23207ef959..d80a7f86ac 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp @@ -26,7 +26,7 @@ #include "BC_PDF417ECModulusGF.h" #include "BC_PDF417ECErrorCorrection.h" CBC_PDF417ECModulusGF* CBC_PDF417ECErrorCorrection::m_field = NULL; -void CBC_PDF417ECErrorCorrection::Initialize(FX_INT32 &e) +void CBC_PDF417ECErrorCorrection::Initialize(int32_t &e) { m_field = FX_NEW CBC_PDF417ECModulusGF(CBC_PDF417Common::NUMBER_OF_CODEWORDS, 3, e); } @@ -40,15 +40,15 @@ CBC_PDF417ECErrorCorrection::CBC_PDF417ECErrorCorrection() CBC_PDF417ECErrorCorrection::~CBC_PDF417ECErrorCorrection() { } -FX_INT32 CBC_PDF417ECErrorCorrection::decode(CFX_Int32Array &received, FX_INT32 numECCodewords, CFX_Int32Array &erasures, FX_INT32 &e) +int32_t CBC_PDF417ECErrorCorrection::decode(CFX_Int32Array &received, int32_t numECCodewords, CFX_Int32Array &erasures, int32_t &e) { CBC_PDF417ECModulusPoly poly(m_field, received, e); BC_EXCEPTION_CHECK_ReturnValue(e, -1); CFX_Int32Array S; S.SetSize(numECCodewords); FX_BOOL error = FALSE; - for (FX_INT32 l = numECCodewords; l > 0; l--) { - FX_INT32 eval = poly.evaluateAt(m_field->exp(l)); + for (int32_t l = numECCodewords; l > 0; l--) { + int32_t eval = poly.evaluateAt(m_field->exp(l)); S[numECCodewords - l] = eval; if (eval != 0) { error = TRUE; @@ -72,7 +72,7 @@ FX_INT32 CBC_PDF417ECErrorCorrection::decode(CFX_Int32Array &received, FX_INT32 CBC_PDF417ECModulusPoly* omega = (CBC_PDF417ECModulusPoly*)sigmaOmega->GetAt(1); CFX_Int32Array* errorLocations = findErrorLocations(sigma, e); if (e != BCExceptionNO) { - for (FX_INT32 i = 0; i < sigmaOmega->GetSize(); i++) { + for (int32_t i = 0; i < sigmaOmega->GetSize(); i++) { delete (CBC_PDF417ECModulusPoly*)sigmaOmega->GetAt(i); } sigmaOmega->RemoveAll(); @@ -82,22 +82,22 @@ FX_INT32 CBC_PDF417ECErrorCorrection::decode(CFX_Int32Array &received, FX_INT32 CFX_Int32Array* errorMagnitudes = findErrorMagnitudes(omega, sigma, *errorLocations, e); if (e != BCExceptionNO) { delete errorLocations; - for (FX_INT32 i = 0; i < sigmaOmega->GetSize(); i++) { + for (int32_t i = 0; i < sigmaOmega->GetSize(); i++) { delete (CBC_PDF417ECModulusPoly*)sigmaOmega->GetAt(i); } sigmaOmega->RemoveAll(); delete sigmaOmega; return -1; } - for (FX_INT32 i = 0; i < errorLocations->GetSize(); i++) { - FX_INT32 log = m_field->log(errorLocations->GetAt(i), e);; + for (int32_t i = 0; i < errorLocations->GetSize(); i++) { + int32_t log = m_field->log(errorLocations->GetAt(i), e);; BC_EXCEPTION_CHECK_ReturnValue(e, -1); - FX_INT32 position = received.GetSize() - 1 - log; + int32_t position = received.GetSize() - 1 - log; if (position < 0) { e = BCExceptionChecksumException; delete errorLocations; delete errorMagnitudes; - for (FX_INT32 j = 0; j < sigmaOmega->GetSize(); j++) { + for (int32_t j = 0; j < sigmaOmega->GetSize(); j++) { delete (CBC_PDF417ECModulusPoly*)sigmaOmega->GetAt(j); } sigmaOmega->RemoveAll(); @@ -106,17 +106,17 @@ FX_INT32 CBC_PDF417ECErrorCorrection::decode(CFX_Int32Array &received, FX_INT32 } received[position] = m_field->subtract(received[position], errorMagnitudes->GetAt(i)); } - FX_INT32 result = errorLocations->GetSize(); + int32_t result = errorLocations->GetSize(); delete errorLocations; delete errorMagnitudes; - for (FX_INT32 k = 0; k < sigmaOmega->GetSize(); k++) { + for (int32_t k = 0; k < sigmaOmega->GetSize(); k++) { delete (CBC_PDF417ECModulusPoly*)sigmaOmega->GetAt(k); } sigmaOmega->RemoveAll(); delete sigmaOmega; return result; } -CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECModulusPoly* a, CBC_PDF417ECModulusPoly* b, FX_INT32 R, FX_INT32 &e) +CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECModulusPoly* a, CBC_PDF417ECModulusPoly* b, int32_t R, int32_t &e) { if (a->getDegree() < b->getDegree()) { CBC_PDF417ECModulusPoly* temp = a; @@ -130,10 +130,10 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECMod CBC_PDF417ECModulusPoly* qtemp = NULL; CBC_PDF417ECModulusPoly* rtemp = NULL; CBC_PDF417ECModulusPoly* ttemp = NULL; - FX_INT32 i = 0; - FX_INT32 j = 0; - FX_INT32 m = 0; - FX_INT32 n = 0; + int32_t i = 0; + int32_t j = 0; + int32_t m = 0; + int32_t n = 0; while (r->getDegree() >= R / 2) { CBC_PDF417ECModulusPoly* rLastLast = rLast; CBC_PDF417ECModulusPoly* tLastLast = tLast; @@ -156,8 +156,8 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECMod } r = rLastLast; CBC_PDF417ECModulusPoly* q = m_field->getZero(); - FX_INT32 denominatorLeadingTerm = rLast->getCoefficient(rLast->getDegree()); - FX_INT32 dltInverse = m_field->inverse(denominatorLeadingTerm, e); + int32_t denominatorLeadingTerm = rLast->getCoefficient(rLast->getDegree()); + int32_t dltInverse = m_field->inverse(denominatorLeadingTerm, e); if (e != BCExceptionNO) { if (qtemp) { delete qtemp; @@ -171,8 +171,8 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECMod return NULL; } while (r->getDegree() >= rLast->getDegree() && !r->isZero()) { - FX_INT32 degreeDiff = r->getDegree() - rLast->getDegree(); - FX_INT32 scale = m_field->multiply(r->getCoefficient(r->getDegree()), dltInverse); + int32_t degreeDiff = r->getDegree() - rLast->getDegree(); + int32_t scale = m_field->multiply(r->getCoefficient(r->getDegree()), dltInverse); CBC_PDF417ECModulusPoly* buildmonomial = m_field->buildMonomial(degreeDiff, scale, e); if (e != BCExceptionNO) { if (qtemp) { @@ -273,8 +273,8 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECMod ttemp = t; j++; } - FX_INT32 aa = t->getCoefficient(1); - FX_INT32 sigmaTildeAtZero = t->getCoefficient(0); + int32_t aa = t->getCoefficient(1); + int32_t sigmaTildeAtZero = t->getCoefficient(0); if (sigmaTildeAtZero == 0) { e = BCExceptionChecksumException; if (rtemp) { @@ -285,7 +285,7 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECMod } return NULL; } - FX_INT32 inverse = m_field->inverse(sigmaTildeAtZero, e); + int32_t inverse = m_field->inverse(sigmaTildeAtZero, e); if (e != BCExceptionNO) { if (rtemp) { delete rtemp; @@ -315,13 +315,13 @@ CFX_PtrArray* CBC_PDF417ECErrorCorrection::runEuclideanAlgorithm(CBC_PDF417ECMod modulusPoly->Add(omega); return modulusPoly; } -CFX_Int32Array* CBC_PDF417ECErrorCorrection::findErrorLocations(CBC_PDF417ECModulusPoly* errorLocator, FX_INT32 &e) +CFX_Int32Array* CBC_PDF417ECErrorCorrection::findErrorLocations(CBC_PDF417ECModulusPoly* errorLocator, int32_t &e) { - FX_INT32 numErrors = errorLocator->getDegree(); + int32_t numErrors = errorLocator->getDegree(); CFX_Int32Array* result = FX_NEW CFX_Int32Array; result->SetSize(numErrors); - FX_INT32 ee = 0; - for (FX_INT32 i = 1; i < m_field->getSize() && ee < numErrors; i++) { + int32_t ee = 0; + for (int32_t i = 1; i < m_field->getSize() && ee < numErrors; i++) { if (errorLocator->evaluateAt(i) == 0) { result->SetAt(ee, m_field->inverse(i, e)); if (e != BCExceptionNO) { @@ -338,27 +338,27 @@ CFX_Int32Array* CBC_PDF417ECErrorCorrection::findErrorLocations(CBC_PDF417ECModu } return result; } -CFX_Int32Array* CBC_PDF417ECErrorCorrection::findErrorMagnitudes(CBC_PDF417ECModulusPoly* errorEvaluator, CBC_PDF417ECModulusPoly* errorLocator, CFX_Int32Array &errorLocations, FX_INT32 &e) +CFX_Int32Array* CBC_PDF417ECErrorCorrection::findErrorMagnitudes(CBC_PDF417ECModulusPoly* errorEvaluator, CBC_PDF417ECModulusPoly* errorLocator, CFX_Int32Array &errorLocations, int32_t &e) { - FX_INT32 errorLocatorDegree = errorLocator->getDegree(); + int32_t errorLocatorDegree = errorLocator->getDegree(); CFX_Int32Array formalDerivativeCoefficients; formalDerivativeCoefficients.SetSize(errorLocatorDegree); - for (FX_INT32 l = 1; l <= errorLocatorDegree; l++) { + for (int32_t l = 1; l <= errorLocatorDegree; l++) { formalDerivativeCoefficients[errorLocatorDegree - l] = m_field->multiply(l, errorLocator->getCoefficient(l)); } CBC_PDF417ECModulusPoly formalDerivative(m_field, formalDerivativeCoefficients, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 s = errorLocations.GetSize(); + int32_t s = errorLocations.GetSize(); CFX_Int32Array* result = FX_NEW CFX_Int32Array; result->SetSize(s); - for (FX_INT32 i = 0; i < s; i++) { - FX_INT32 xiInverse = m_field->inverse(errorLocations[i], e); + for (int32_t i = 0; i < s; i++) { + int32_t xiInverse = m_field->inverse(errorLocations[i], e); if (e != BCExceptionNO) { delete result; return NULL; } - FX_INT32 numerator = m_field->subtract(0, errorEvaluator->evaluateAt(xiInverse)); - FX_INT32 denominator = m_field->inverse(formalDerivative.evaluateAt(xiInverse), e); + int32_t numerator = m_field->subtract(0, errorEvaluator->evaluateAt(xiInverse)); + int32_t denominator = m_field->inverse(formalDerivative.evaluateAt(xiInverse), e); if (e != BCExceptionNO) { delete result; return NULL; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h b/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h index 0fca2e6c39..c8a2058298 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h @@ -13,13 +13,13 @@ class CBC_PDF417ECErrorCorrection public: CBC_PDF417ECErrorCorrection(); virtual ~CBC_PDF417ECErrorCorrection(); - static void Initialize(FX_INT32 &e); + static void Initialize(int32_t &e); static void Finalize(); - static FX_INT32 decode(CFX_Int32Array &received, FX_INT32 numECCodewords, CFX_Int32Array &erasures, FX_INT32 &e); + static int32_t decode(CFX_Int32Array &received, int32_t numECCodewords, CFX_Int32Array &erasures, int32_t &e); private: static CBC_PDF417ECModulusGF* m_field; - static CFX_PtrArray* runEuclideanAlgorithm(CBC_PDF417ECModulusPoly* a, CBC_PDF417ECModulusPoly* b, FX_INT32 R, FX_INT32 &e); - static CFX_Int32Array* findErrorLocations(CBC_PDF417ECModulusPoly* errorLocator, FX_INT32 &e); - static CFX_Int32Array* findErrorMagnitudes(CBC_PDF417ECModulusPoly* errorEvaluator, CBC_PDF417ECModulusPoly* errorLocator, CFX_Int32Array &errorLocations, FX_INT32 &e); + static CFX_PtrArray* runEuclideanAlgorithm(CBC_PDF417ECModulusPoly* a, CBC_PDF417ECModulusPoly* b, int32_t R, int32_t &e); + static CFX_Int32Array* findErrorLocations(CBC_PDF417ECModulusPoly* errorLocator, int32_t &e); + static CFX_Int32Array* findErrorMagnitudes(CBC_PDF417ECModulusPoly* errorEvaluator, CBC_PDF417ECModulusPoly* errorLocator, CFX_Int32Array &errorLocations, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp index 7619854bcb..1b41474bb3 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp @@ -25,7 +25,7 @@ #include "BC_PDF417ECModulusPoly.h" #include "BC_PDF417ECModulusGF.h" CBC_PDF417ECModulusGF* CBC_PDF417ECModulusGF::PDF417_GF = NULL; -void CBC_PDF417ECModulusGF::Initialize(FX_INT32 &e) +void CBC_PDF417ECModulusGF::Initialize(int32_t &e) { PDF417_GF = FX_NEW CBC_PDF417ECModulusGF(CBC_PDF417Common::NUMBER_OF_CODEWORDS, 3, e); } @@ -33,17 +33,17 @@ void CBC_PDF417ECModulusGF::Finalize() { delete PDF417_GF; } -CBC_PDF417ECModulusGF::CBC_PDF417ECModulusGF(FX_INT32 modulus, FX_INT32 generator, FX_INT32 &e) +CBC_PDF417ECModulusGF::CBC_PDF417ECModulusGF(int32_t modulus, int32_t generator, int32_t &e) { m_modulus = modulus; m_expTable.SetSize(modulus); m_logTable.SetSize(modulus); - FX_INT32 x = 1; - for (FX_INT32 i = 0; i < modulus; i++) { + int32_t x = 1; + for (int32_t i = 0; i < modulus; i++) { m_expTable[i] = x; x = (x * generator) % modulus; } - for (FX_INT32 j = 0; j < modulus - 1; j++) { + for (int32_t j = 0; j < modulus - 1; j++) { m_logTable[m_expTable[j]] = j; } CFX_Int32Array zero; @@ -66,7 +66,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusGF::getOne() { return m_one; } -CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusGF::buildMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e) +CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusGF::buildMonomial(int32_t degree, int32_t coefficient, int32_t &e) { if (degree < 0) { e = BCExceptionIllegalArgument; @@ -85,19 +85,19 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusGF::buildMonomial(FX_INT32 degree, F BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } -FX_INT32 CBC_PDF417ECModulusGF::add(FX_INT32 a, FX_INT32 b) +int32_t CBC_PDF417ECModulusGF::add(int32_t a, int32_t b) { return (a + b) % m_modulus; } -FX_INT32 CBC_PDF417ECModulusGF::subtract(FX_INT32 a, FX_INT32 b) +int32_t CBC_PDF417ECModulusGF::subtract(int32_t a, int32_t b) { return (m_modulus + a - b) % m_modulus; } -FX_INT32 CBC_PDF417ECModulusGF::exp(FX_INT32 a) +int32_t CBC_PDF417ECModulusGF::exp(int32_t a) { return m_expTable[a]; } -FX_INT32 CBC_PDF417ECModulusGF::log(FX_INT32 a, FX_INT32 &e) +int32_t CBC_PDF417ECModulusGF::log(int32_t a, int32_t &e) { if (a == 0) { e = BCExceptionIllegalArgument; @@ -105,7 +105,7 @@ FX_INT32 CBC_PDF417ECModulusGF::log(FX_INT32 a, FX_INT32 &e) } return m_logTable[a]; } -FX_INT32 CBC_PDF417ECModulusGF::inverse(FX_INT32 a, FX_INT32 &e) +int32_t CBC_PDF417ECModulusGF::inverse(int32_t a, int32_t &e) { if (a == 0) { e = BCExceptionIllegalArgument; @@ -113,14 +113,14 @@ FX_INT32 CBC_PDF417ECModulusGF::inverse(FX_INT32 a, FX_INT32 &e) } return m_expTable[m_modulus - m_logTable[a] - 1]; } -FX_INT32 CBC_PDF417ECModulusGF::multiply(FX_INT32 a, FX_INT32 b) +int32_t CBC_PDF417ECModulusGF::multiply(int32_t a, int32_t b) { if (a == 0 || b == 0) { return 0; } return m_expTable[(m_logTable[a] + m_logTable[b]) % (m_modulus - 1)]; } -FX_INT32 CBC_PDF417ECModulusGF::getSize() +int32_t CBC_PDF417ECModulusGF::getSize() { return m_modulus; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.h b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.h index fbb79e3586..ee19117242 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.h @@ -11,26 +11,26 @@ class CBC_PDF417Common; class CBC_PDF417ECModulusGF { public: - CBC_PDF417ECModulusGF(FX_INT32 modulus, FX_INT32 generator, FX_INT32 &e); + CBC_PDF417ECModulusGF(int32_t modulus, int32_t generator, int32_t &e); virtual ~CBC_PDF417ECModulusGF(); - static void Initialize(FX_INT32 &e); + static void Initialize(int32_t &e); static void Finalize(); CBC_PDF417ECModulusPoly* getZero(); CBC_PDF417ECModulusPoly* getOne(); - CBC_PDF417ECModulusPoly* buildMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e); - FX_INT32 add(FX_INT32 a, FX_INT32 b); - FX_INT32 subtract(FX_INT32 a, FX_INT32 b); - FX_INT32 exp(FX_INT32 a); - FX_INT32 log(FX_INT32 a, FX_INT32 &e); - FX_INT32 inverse(FX_INT32 a, FX_INT32 &e); - FX_INT32 multiply(FX_INT32 a, FX_INT32 b); - FX_INT32 getSize(); + CBC_PDF417ECModulusPoly* buildMonomial(int32_t degree, int32_t coefficient, int32_t &e); + int32_t add(int32_t a, int32_t b); + int32_t subtract(int32_t a, int32_t b); + int32_t exp(int32_t a); + int32_t log(int32_t a, int32_t &e); + int32_t inverse(int32_t a, int32_t &e); + int32_t multiply(int32_t a, int32_t b); + int32_t getSize(); static CBC_PDF417ECModulusGF* PDF417_GF; private: CFX_Int32Array m_expTable; CFX_Int32Array m_logTable; CBC_PDF417ECModulusPoly* m_zero; CBC_PDF417ECModulusPoly* m_one; - FX_INT32 m_modulus; + int32_t m_modulus; }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp index 39d3fd8056..686b2badca 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp @@ -24,15 +24,15 @@ #include "BC_PDF417Common.h" #include "BC_PDF417ECModulusGF.h" #include "BC_PDF417ECModulusPoly.h" -CBC_PDF417ECModulusPoly::CBC_PDF417ECModulusPoly(CBC_PDF417ECModulusGF* field, CFX_Int32Array &coefficients, FX_INT32 &e) +CBC_PDF417ECModulusPoly::CBC_PDF417ECModulusPoly(CBC_PDF417ECModulusGF* field, CFX_Int32Array &coefficients, int32_t &e) { if (coefficients.GetSize() == 0) { e = BCExceptionIllegalArgument; } m_field = field; - FX_INT32 coefficientsLength = coefficients.GetSize(); + int32_t coefficientsLength = coefficients.GetSize(); if (coefficientsLength > 1 && coefficients[0] == 0) { - FX_INT32 firstNonZero = 1; + int32_t firstNonZero = 1; while (firstNonZero < coefficientsLength && coefficients[firstNonZero] == 0) { firstNonZero++; } @@ -40,8 +40,8 @@ CBC_PDF417ECModulusPoly::CBC_PDF417ECModulusPoly(CBC_PDF417ECModulusGF* field, C m_coefficients = field->getZero()->m_coefficients; } else { m_coefficients.SetSize(coefficientsLength - firstNonZero); - FX_INT32 l = 0; - for (FX_INT32 i = firstNonZero; i < firstNonZero + m_coefficients.GetSize(); i++) { + int32_t l = 0; + for (int32_t i = firstNonZero; i < firstNonZero + m_coefficients.GetSize(); i++) { m_coefficients.SetAt(l, coefficients.GetAt(i)); l++; } @@ -61,7 +61,7 @@ CBC_PDF417ECModulusGF* CBC_PDF417ECModulusPoly::getField() { return m_field; } -FX_INT32 CBC_PDF417ECModulusPoly::getDegree() +int32_t CBC_PDF417ECModulusPoly::getDegree() { return m_coefficients.GetSize() - 1; } @@ -69,31 +69,31 @@ FX_BOOL CBC_PDF417ECModulusPoly::isZero() { return m_coefficients[0] == 0; } -FX_INT32 CBC_PDF417ECModulusPoly::getCoefficient(FX_INT32 degree) +int32_t CBC_PDF417ECModulusPoly::getCoefficient(int32_t degree) { return m_coefficients[m_coefficients.GetSize() - 1 - degree]; } -FX_INT32 CBC_PDF417ECModulusPoly::evaluateAt(FX_INT32 a) +int32_t CBC_PDF417ECModulusPoly::evaluateAt(int32_t a) { if (a == 0) { return getCoefficient(0); } - FX_INT32 size = m_coefficients.GetSize(); + int32_t size = m_coefficients.GetSize(); if (a == 1) { - FX_INT32 result = 0; - for (FX_INT32 l = 0; l < m_coefficients.GetSize(); l++) { - FX_INT32 coefficient = m_coefficients.GetAt(l); + int32_t result = 0; + for (int32_t l = 0; l < m_coefficients.GetSize(); l++) { + int32_t coefficient = m_coefficients.GetAt(l); result = m_field->add(result, coefficient); } return result; } - FX_INT32 result = m_coefficients[0]; - for (FX_INT32 i = 1; i < size; i++) { + int32_t result = m_coefficients[0]; + for (int32_t i = 1; i < size; i++) { result = m_field->add(m_field->multiply(a, result), m_coefficients[i]); } return result; } -CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::add(CBC_PDF417ECModulusPoly* other, FX_INT32 &e) +CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::add(CBC_PDF417ECModulusPoly* other, int32_t &e) { CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (isZero()) { @@ -118,18 +118,18 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::add(CBC_PDF417ECModulusPoly* o } CFX_Int32Array sumDiff; sumDiff.SetSize(largerCoefficients.GetSize()); - FX_INT32 lengthDiff = largerCoefficients.GetSize() - smallerCoefficients.GetSize(); - for (FX_INT32 l = 0; l < lengthDiff; l++) { + int32_t lengthDiff = largerCoefficients.GetSize() - smallerCoefficients.GetSize(); + for (int32_t l = 0; l < lengthDiff; l++) { sumDiff.SetAt(l, largerCoefficients.GetAt(l)); } - for (FX_INT32 i = lengthDiff; i < largerCoefficients.GetSize(); i++) { + for (int32_t i = lengthDiff; i < largerCoefficients.GetSize(); i++) { sumDiff[i] = m_field->add(smallerCoefficients[i - lengthDiff], largerCoefficients[i]); } modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, sumDiff, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } -CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::subtract(CBC_PDF417ECModulusPoly* other, FX_INT32 &e) +CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::subtract(CBC_PDF417ECModulusPoly* other, int32_t &e) { CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (other->isZero()) { @@ -144,7 +144,7 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::subtract(CBC_PDF417ECModulusPo BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } -CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(CBC_PDF417ECModulusPoly* other, FX_INT32 &e) +CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(CBC_PDF417ECModulusPoly* other, int32_t &e) { CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (isZero() || other->isZero()) { @@ -154,15 +154,15 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(CBC_PDF417ECModulusPo } CFX_Int32Array aCoefficients; aCoefficients.Copy(m_coefficients); - FX_INT32 aLength = aCoefficients.GetSize(); + int32_t aLength = aCoefficients.GetSize(); CFX_Int32Array bCoefficients; bCoefficients.Copy(other->m_coefficients); - FX_INT32 bLength = bCoefficients.GetSize(); + int32_t bLength = bCoefficients.GetSize(); CFX_Int32Array product; product.SetSize(aLength + bLength - 1); - for (FX_INT32 i = 0; i < aLength; i++) { - FX_INT32 aCoeff = aCoefficients[i]; - for (FX_INT32 j = 0; j < bLength; j++) { + for (int32_t i = 0; i < aLength; i++) { + int32_t aCoeff = aCoefficients[i]; + for (int32_t j = 0; j < bLength; j++) { product[i + j] = m_field->add(product[i + j], m_field->multiply(aCoeff, bCoefficients[j])); } } @@ -170,19 +170,19 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(CBC_PDF417ECModulusPo BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } -CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::negative(FX_INT32 &e) +CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::negative(int32_t &e) { - FX_INT32 size = m_coefficients.GetSize(); + int32_t size = m_coefficients.GetSize(); CFX_Int32Array negativeCoefficients; negativeCoefficients.SetSize(size); - for (FX_INT32 i = 0; i < size; i++) { + for (int32_t i = 0; i < size; i++) { negativeCoefficients[i] = m_field->subtract(0, m_coefficients[i]); } CBC_PDF417ECModulusPoly* modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, negativeCoefficients, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } -CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(FX_INT32 scalar, FX_INT32 &e) +CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(int32_t scalar, int32_t &e) { CBC_PDF417ECModulusPoly* modulusPoly = NULL; if (scalar == 0) { @@ -195,17 +195,17 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiply(FX_INT32 scalar, FX_I BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } - FX_INT32 size = m_coefficients.GetSize(); + int32_t size = m_coefficients.GetSize(); CFX_Int32Array product; product.SetSize(size); - for (FX_INT32 i = 0; i < size; i++) { + for (int32_t i = 0; i < size; i++) { product[i] = m_field->multiply(m_coefficients[i], scalar); } modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, product, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } -CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiplyByMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e) +CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiplyByMonomial(int32_t degree, int32_t coefficient, int32_t &e) { if (degree < 0) { e = BCExceptionIllegalArgument; @@ -217,17 +217,17 @@ CBC_PDF417ECModulusPoly* CBC_PDF417ECModulusPoly::multiplyByMonomial(FX_INT32 de BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } - FX_INT32 size = m_coefficients.GetSize(); + int32_t size = m_coefficients.GetSize(); CFX_Int32Array product; product.SetSize(size + degree); - for (FX_INT32 i = 0; i < size; i++) { + for (int32_t i = 0; i < size; i++) { product[i] = m_field->multiply(m_coefficients[i], coefficient); } modulusPoly = FX_NEW CBC_PDF417ECModulusPoly(m_field, product, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return modulusPoly; } -CFX_PtrArray* CBC_PDF417ECModulusPoly::divide(CBC_PDF417ECModulusPoly* other, FX_INT32 &e) +CFX_PtrArray* CBC_PDF417ECModulusPoly::divide(CBC_PDF417ECModulusPoly* other, int32_t &e) { if (other->isZero()) { e = BCExceptionDivideByZero; @@ -240,16 +240,16 @@ CFX_PtrArray* CBC_PDF417ECModulusPoly::divide(CBC_PDF417ECModulusPoly* other, FX delete quotient; return NULL; } - FX_INT32 denominatorLeadingTerm = other->getCoefficient(other->getDegree()); - FX_INT32 inverseDenominatorLeadingTerm = m_field->inverse(denominatorLeadingTerm, e); + int32_t denominatorLeadingTerm = other->getCoefficient(other->getDegree()); + int32_t inverseDenominatorLeadingTerm = m_field->inverse(denominatorLeadingTerm, e); if (e != BCExceptionNO) { delete quotient; delete remainder; return NULL; } while (remainder->getDegree() >= other->getDegree() && !remainder->isZero()) { - FX_INT32 degreeDifference = remainder->getDegree() - other->getDegree(); - FX_INT32 scale = m_field->multiply(remainder->getCoefficient(remainder->getDegree()), inverseDenominatorLeadingTerm); + int32_t degreeDifference = remainder->getDegree() - other->getDegree(); + int32_t scale = m_field->multiply(remainder->getCoefficient(remainder->getDegree()), inverseDenominatorLeadingTerm); CBC_PDF417ECModulusPoly* term = other->multiplyByMonomial(degreeDifference, scale, e); if (e != BCExceptionNO) { delete quotient; @@ -288,8 +288,8 @@ CFX_PtrArray* CBC_PDF417ECModulusPoly::divide(CBC_PDF417ECModulusPoly* other, FX CFX_ByteString CBC_PDF417ECModulusPoly::toString() { CFX_ByteString result; - for (FX_INT32 degree = getDegree(); degree >= 0; degree--) { - FX_INT32 coefficient = getCoefficient(degree); + for (int32_t degree = getDegree(); degree >= 0; degree--) { + int32_t coefficient = getCoefficient(degree); if (coefficient != 0) { if (coefficient < 0) { result += " - "; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.h b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.h index 172cc76cc8..72c8d3eb35 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.h @@ -10,21 +10,21 @@ class CBC_PDF417ECModulusGF; class CBC_PDF417ECModulusPoly { public: - CBC_PDF417ECModulusPoly(CBC_PDF417ECModulusGF* field, CFX_Int32Array &coefficients, FX_INT32 &e); + CBC_PDF417ECModulusPoly(CBC_PDF417ECModulusGF* field, CFX_Int32Array &coefficients, int32_t &e); virtual ~CBC_PDF417ECModulusPoly(); CFX_Int32Array& getCoefficients(); CBC_PDF417ECModulusGF* getField(); - FX_INT32 getDegree(); + int32_t getDegree(); FX_BOOL isZero(); - FX_INT32 getCoefficient(FX_INT32 degree); - FX_INT32 evaluateAt(FX_INT32 a); - CBC_PDF417ECModulusPoly* add(CBC_PDF417ECModulusPoly* other, FX_INT32 &e); - CBC_PDF417ECModulusPoly* subtract(CBC_PDF417ECModulusPoly* other, FX_INT32 &e); - CBC_PDF417ECModulusPoly* multiply(CBC_PDF417ECModulusPoly* other, FX_INT32 &e); - CBC_PDF417ECModulusPoly* negative(FX_INT32 &e); - CBC_PDF417ECModulusPoly* multiply(FX_INT32 scalar, FX_INT32 &e); - CBC_PDF417ECModulusPoly* multiplyByMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e); - CFX_PtrArray* divide(CBC_PDF417ECModulusPoly* other, FX_INT32 &e); + int32_t getCoefficient(int32_t degree); + int32_t evaluateAt(int32_t a); + CBC_PDF417ECModulusPoly* add(CBC_PDF417ECModulusPoly* other, int32_t &e); + CBC_PDF417ECModulusPoly* subtract(CBC_PDF417ECModulusPoly* other, int32_t &e); + CBC_PDF417ECModulusPoly* multiply(CBC_PDF417ECModulusPoly* other, int32_t &e); + CBC_PDF417ECModulusPoly* negative(int32_t &e); + CBC_PDF417ECModulusPoly* multiply(int32_t scalar, int32_t &e); + CBC_PDF417ECModulusPoly* multiplyByMonomial(int32_t degree, int32_t coefficient, int32_t &e); + CFX_PtrArray* divide(CBC_PDF417ECModulusPoly* other, int32_t &e); CFX_ByteString toString(); private: CBC_PDF417ECModulusGF* m_field; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp index cd1ea88046..9dd6f67575 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp @@ -22,7 +22,7 @@ #include "../barcode.h" #include "BC_PDF417ErrorCorrection.h" -FX_INT32 CBC_PDF417ErrorCorrection::EC_COEFFICIENTS[][2500] = { +int32_t CBC_PDF417ErrorCorrection::EC_COEFFICIENTS[][2500] = { {27, 917}, {522, 568, 723, 809}, {237, 308, 436, 284, 646, 653, 428, 379}, @@ -132,7 +132,7 @@ CBC_PDF417ErrorCorrection::CBC_PDF417ErrorCorrection() CBC_PDF417ErrorCorrection::~CBC_PDF417ErrorCorrection() { } -FX_INT32 CBC_PDF417ErrorCorrection::getErrorCorrectionCodewordCount(FX_INT32 errorCorrectionLevel, FX_INT32 &e) +int32_t CBC_PDF417ErrorCorrection::getErrorCorrectionCodewordCount(int32_t errorCorrectionLevel, int32_t &e) { if (errorCorrectionLevel < 0 || errorCorrectionLevel > 8) { e = BCExceptionErrorCorrectionLevelMustBeBetween0And8; @@ -140,7 +140,7 @@ FX_INT32 CBC_PDF417ErrorCorrection::getErrorCorrectionCodewordCount(FX_INT32 err } return 1 << (errorCorrectionLevel + 1); } -FX_INT32 CBC_PDF417ErrorCorrection::getRecommendedMinimumErrorCorrectionLevel(FX_INT32 n, FX_INT32 &e) +int32_t CBC_PDF417ErrorCorrection::getRecommendedMinimumErrorCorrectionLevel(int32_t n, int32_t &e) { if (n <= 0) { e = BCExceptionIllegalArgumentnMustBeAbove0; @@ -161,18 +161,18 @@ FX_INT32 CBC_PDF417ErrorCorrection::getRecommendedMinimumErrorCorrectionLevel(FX e = BCExceptionNoRecommendationPossible; return -1; } -CFX_WideString CBC_PDF417ErrorCorrection::generateErrorCorrection(CFX_WideString dataCodewords, FX_INT32 errorCorrectionLevel, FX_INT32 &e) +CFX_WideString CBC_PDF417ErrorCorrection::generateErrorCorrection(CFX_WideString dataCodewords, int32_t errorCorrectionLevel, int32_t &e) { - FX_INT32 k = getErrorCorrectionCodewordCount(errorCorrectionLevel, e); + int32_t k = getErrorCorrectionCodewordCount(errorCorrectionLevel, e); BC_EXCEPTION_CHECK_ReturnValue(e, (FX_WCHAR)' '); FX_WCHAR* ech = FX_Alloc(FX_WCHAR, k * sizeof(FX_WCHAR)); FXSYS_memset32(ech, 0, k * sizeof(FX_WCHAR)); - FX_INT32 sld = dataCodewords.GetLength(); - for (FX_INT32 i = 0; i < sld; i++) { - FX_INT32 t1 = (dataCodewords.GetAt(i) + ech[k - 1]) % 929; - FX_INT32 t2; - FX_INT32 t3; - for (FX_INT32 j = k - 1; j >= 1; j--) { + int32_t sld = dataCodewords.GetLength(); + for (int32_t i = 0; i < sld; i++) { + int32_t t1 = (dataCodewords.GetAt(i) + ech[k - 1]) % 929; + int32_t t2; + int32_t t3; + for (int32_t j = k - 1; j >= 1; j--) { t2 = (t1 * EC_COEFFICIENTS[errorCorrectionLevel][j]) % 929; t3 = 929 - t2; ech[j] = (FX_WCHAR) ((ech[j - 1] + t3) % 929); @@ -182,7 +182,7 @@ CFX_WideString CBC_PDF417ErrorCorrection::generateErrorCorrection(CFX_WideString ech[0] = (FX_WCHAR) (t3 % 929); } CFX_WideString sb; - for (FX_INT32 j = k - 1; j >= 0; j--) { + for (int32_t j = k - 1; j >= 0; j--) { if (ech[j] != 0) { ech[j] = (FX_WCHAR) (929 - ech[j]); } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h b/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h index 9af8b72f17..4e5dee0bb8 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h @@ -11,10 +11,10 @@ class CBC_PDF417ErrorCorrection public: CBC_PDF417ErrorCorrection(); virtual ~CBC_PDF417ErrorCorrection(); - static FX_INT32 getErrorCorrectionCodewordCount(FX_INT32 errorCorrectionLevel, FX_INT32 &e); - static FX_INT32 getRecommendedMinimumErrorCorrectionLevel(FX_INT32 n, FX_INT32 &e); - static CFX_WideString generateErrorCorrection(CFX_WideString dataCodewords, FX_INT32 errorCorrectionLevel, FX_INT32 &e); + static int32_t getErrorCorrectionCodewordCount(int32_t errorCorrectionLevel, int32_t &e); + static int32_t getRecommendedMinimumErrorCorrectionLevel(int32_t n, int32_t &e); + static CFX_WideString generateErrorCorrection(CFX_WideString dataCodewords, int32_t errorCorrectionLevel, int32_t &e); private: - static FX_INT32 EC_COEFFICIENTS[][2500]; + static int32_t EC_COEFFICIENTS[][2500]; }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp index 54bd0b6c6a..85c01d60b0 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp @@ -28,23 +28,23 @@ #define SUBMODE_ALPHA 0 #define SUBMODE_LOWER 1 #define SUBMODE_MIXED 2 -FX_INT32 CBC_PDF417HighLevelEncoder::TEXT_COMPACTION = 0; -FX_INT32 CBC_PDF417HighLevelEncoder::BYTE_COMPACTION = 1; -FX_INT32 CBC_PDF417HighLevelEncoder::NUMERIC_COMPACTION = 2; -FX_INT32 CBC_PDF417HighLevelEncoder::SUBMODE_PUNCTUATION = 3; -FX_INT32 CBC_PDF417HighLevelEncoder::LATCH_TO_TEXT = 900; -FX_INT32 CBC_PDF417HighLevelEncoder::LATCH_TO_BYTE_PADDED = 901; -FX_INT32 CBC_PDF417HighLevelEncoder::LATCH_TO_NUMERIC = 902; -FX_INT32 CBC_PDF417HighLevelEncoder::SHIFT_TO_BYTE = 913; -FX_INT32 CBC_PDF417HighLevelEncoder::LATCH_TO_BYTE = 924; -FX_BYTE CBC_PDF417HighLevelEncoder::TEXT_MIXED_RAW[] = {48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 38, 13, 9, 44, 58, +int32_t CBC_PDF417HighLevelEncoder::TEXT_COMPACTION = 0; +int32_t CBC_PDF417HighLevelEncoder::BYTE_COMPACTION = 1; +int32_t CBC_PDF417HighLevelEncoder::NUMERIC_COMPACTION = 2; +int32_t CBC_PDF417HighLevelEncoder::SUBMODE_PUNCTUATION = 3; +int32_t CBC_PDF417HighLevelEncoder::LATCH_TO_TEXT = 900; +int32_t CBC_PDF417HighLevelEncoder::LATCH_TO_BYTE_PADDED = 901; +int32_t CBC_PDF417HighLevelEncoder::LATCH_TO_NUMERIC = 902; +int32_t CBC_PDF417HighLevelEncoder::SHIFT_TO_BYTE = 913; +int32_t CBC_PDF417HighLevelEncoder::LATCH_TO_BYTE = 924; +uint8_t CBC_PDF417HighLevelEncoder::TEXT_MIXED_RAW[] = {48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 38, 13, 9, 44, 58, 35, 45, 46, 36, 47, 43, 37, 42, 61, 94, 0, 32, 0, 0, 0 }; -FX_BYTE CBC_PDF417HighLevelEncoder::TEXT_PUNCTUATION_RAW[] = {59, 60, 62, 64, 91, 92, 93, 95, 96, 126, 33, 13, 9, 44, 58, +uint8_t CBC_PDF417HighLevelEncoder::TEXT_PUNCTUATION_RAW[] = {59, 60, 62, 64, 91, 92, 93, 95, 96, 126, 33, 13, 9, 44, 58, 10, 45, 46, 36, 47, 34, 124, 42, 40, 41, 63, 123, 125, 39, 0 }; -FX_INT32 CBC_PDF417HighLevelEncoder::MIXED[128] = {0}; -FX_INT32 CBC_PDF417HighLevelEncoder::PUNCTUATION[128] = {0}; +int32_t CBC_PDF417HighLevelEncoder::MIXED[128] = {0}; +int32_t CBC_PDF417HighLevelEncoder::PUNCTUATION[128] = {0}; void CBC_PDF417HighLevelEncoder::Initialize() { Inverse(); @@ -52,13 +52,13 @@ void CBC_PDF417HighLevelEncoder::Initialize() void CBC_PDF417HighLevelEncoder::Finalize() { } -CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMsg, Compaction compaction, FX_INT32 &e) +CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMsg, Compaction compaction, int32_t &e) { CFX_ByteString bytes; CBC_UtilCodingConvert::UnicodeToUTF8(wideMsg, bytes); CFX_WideString msg; - FX_INT32 len = bytes.GetLength(); - for (FX_INT32 i = 0; i < len; i++) { + int32_t len = bytes.GetLength(); + for (int32_t i = 0; i < len; i++) { FX_WCHAR ch = (FX_WCHAR)(bytes.GetAt(i) & 0xff); if (ch == '?' && bytes.GetAt(i) != '?') { e = BCExceptionCharactersOutsideISO88591Encoding; @@ -67,13 +67,13 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMs msg += ch; } CFX_ByteArray byteArr; - for (FX_INT32 k = 0; k < bytes.GetLength(); k++) { + for (int32_t k = 0; k < bytes.GetLength(); k++) { byteArr.Add(bytes.GetAt(k)); } CFX_WideString sb; len = msg.GetLength(); - FX_INT32 p = 0; - FX_INT32 textSubMode = SUBMODE_ALPHA; + int32_t p = 0; + int32_t textSubMode = SUBMODE_ALPHA; if (compaction == TEXT) { encodeText(msg, p, len, sb, textSubMode); } else if (compaction == BYTES) { @@ -82,9 +82,9 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMs sb += (FX_WCHAR) LATCH_TO_NUMERIC; encodeNumeric(msg, p, len, sb); } else { - FX_INT32 encodingMode = LATCH_TO_TEXT; + int32_t encodingMode = LATCH_TO_TEXT; while (p < len) { - FX_INT32 n = determineConsecutiveDigitCount(msg, p); + int32_t n = determineConsecutiveDigitCount(msg, p); if (n >= 13) { sb += (FX_WCHAR) LATCH_TO_NUMERIC; encodingMode = NUMERIC_COMPACTION; @@ -92,7 +92,7 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMs encodeNumeric(msg, p, n, sb); p += n; } else { - FX_INT32 t = determineConsecutiveTextCount(msg, p); + int32_t t = determineConsecutiveTextCount(msg, p); if (t >= 5 || n == len) { if (encodingMode != TEXT_COMPACTION) { sb += (FX_WCHAR) LATCH_TO_TEXT; @@ -102,7 +102,7 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMs textSubMode = encodeText(msg, p, t, sb, textSubMode); p += t; } else { - FX_INT32 b = determineConsecutiveBinaryCount(msg, &byteArr, p, e); + int32_t b = determineConsecutiveBinaryCount(msg, &byteArr, p, e); BC_EXCEPTION_CHECK_ReturnValue(e, (FX_WCHAR)' '); if (b == 0) { b = 1; @@ -123,13 +123,13 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(CFX_WideString wideMs } void CBC_PDF417HighLevelEncoder::Inverse() { - FX_BYTE i = 0; - FX_INT32 l = 0; + uint8_t i = 0; + int32_t l = 0; for (l = 0; l < sizeof(MIXED) / sizeof(MIXED[0]); l++) { MIXED[l] = -1; } for (i = 0; i < sizeof(TEXT_MIXED_RAW) / sizeof(TEXT_MIXED_RAW[0]); i++) { - FX_BYTE b = TEXT_MIXED_RAW[i]; + uint8_t b = TEXT_MIXED_RAW[i]; if (b > 0) { MIXED[b] = i; } @@ -138,17 +138,17 @@ void CBC_PDF417HighLevelEncoder::Inverse() PUNCTUATION[l] = -1; } for (i = 0; i < sizeof(TEXT_PUNCTUATION_RAW) / sizeof(TEXT_PUNCTUATION_RAW[0]); i++) { - FX_BYTE b = TEXT_PUNCTUATION_RAW[i]; + uint8_t b = TEXT_PUNCTUATION_RAW[i]; if (b > 0) { PUNCTUATION[b] = i; } } } -FX_INT32 CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, FX_INT32 startpos, FX_INT32 count, CFX_WideString &sb, FX_INT32 initialSubmode) +int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, int32_t startpos, int32_t count, CFX_WideString &sb, int32_t initialSubmode) { CFX_WideString tmp; - FX_INT32 submode = initialSubmode; - FX_INT32 idx = 0; + int32_t submode = initialSubmode; + int32_t idx = 0; while (TRUE) { FX_WCHAR ch = msg.GetAt(startpos + idx); switch (submode) { @@ -201,7 +201,7 @@ FX_INT32 CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, FX_INT32 sta case SUBMODE_MIXED: if (isMixed(ch)) { FX_WCHAR a = MIXED[ch]; - FX_INT32 b = (FX_INT32)a; + int32_t b = (int32_t)a; tmp += MIXED[ch]; } else { if (isAlphaUpper(ch)) { @@ -241,8 +241,8 @@ FX_INT32 CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, FX_INT32 sta } } FX_WCHAR h = 0; - FX_INT32 len = tmp.GetLength(); - for (FX_INT32 i = 0; i < len; i++) { + int32_t len = tmp.GetLength(); + for (int32_t i = 0; i < len; i++) { FX_BOOL odd = (i % 2) != 0; if (odd) { h = (FX_WCHAR) ((h * 30) + tmp.GetAt(i)); @@ -256,18 +256,18 @@ FX_INT32 CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg, FX_INT32 sta } return submode; } -void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 count, FX_INT32 startmode, CFX_WideString &sb) +void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ByteArray* bytes, int32_t startpos, int32_t count, int32_t startmode, CFX_WideString &sb) { if (count == 1 && startmode == TEXT_COMPACTION) { sb += (FX_WCHAR) SHIFT_TO_BYTE; } - FX_INT32 idx = startpos; - FX_INT32 i = 0; + int32_t idx = startpos; + int32_t i = 0; if (count >= 6) { sb += (FX_WCHAR) LATCH_TO_BYTE; FX_WCHAR chars[5]; while ((startpos + count - idx) >= 6) { - FX_INT64 t = 0; + int64_t t = 0; for (i = 0; i < 6; i++) { t <<= 8; t += bytes->GetAt(idx + i) & 0xff; @@ -286,25 +286,25 @@ void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ByteArray* bytes, FX_INT32 sta sb += (FX_WCHAR) LATCH_TO_BYTE_PADDED; } for (i = idx; i < startpos + count; i++) { - FX_INT32 ch = bytes->GetAt(i) & 0xff; + int32_t ch = bytes->GetAt(i) & 0xff; sb += (FX_WCHAR) ch; } } -void CBC_PDF417HighLevelEncoder::encodeNumeric(CFX_WideString msg, FX_INT32 startpos, FX_INT32 count, CFX_WideString &sb) +void CBC_PDF417HighLevelEncoder::encodeNumeric(CFX_WideString msg, int32_t startpos, int32_t count, CFX_WideString &sb) { - FX_INT32 idx = 0; + int32_t idx = 0; BigInteger num900 = 900; while (idx < count) { CFX_WideString tmp; - FX_INT32 len = 44 < count - idx ? 44 : count - idx; + int32_t len = 44 < count - idx ? 44 : count - idx; CFX_ByteString part = ((FX_WCHAR)'1' + msg.Mid(startpos + idx, len)).UTF8Encode(); BigInteger bigint = stringToBigInteger(part.c_str()); do { - FX_INT32 c = (bigint % num900).toInt(); + int32_t c = (bigint % num900).toInt(); tmp += (FX_WCHAR)(c); bigint = bigint / num900; } while (!bigint.isZero()); - for (FX_INT32 i = tmp.GetLength() - 1; i >= 0; i--) { + for (int32_t i = tmp.GetLength() - 1; i >= 0; i--) { sb += tmp.GetAt(i); } idx += len; @@ -334,11 +334,11 @@ FX_BOOL CBC_PDF417HighLevelEncoder::isText(FX_WCHAR ch) { return ch == '\t' || ch == '\n' || ch == '\r' || (ch >= 32 && ch <= 126); } -FX_INT32 CBC_PDF417HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos) +int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg, int32_t startpos) { - FX_INT32 count = 0; - FX_INT32 len = msg.GetLength(); - FX_INT32 idx = startpos; + int32_t count = 0; + int32_t len = msg.GetLength(); + int32_t idx = startpos; if (idx < len) { FX_WCHAR ch = msg.GetAt(idx); while (isDigit(ch) && idx < len) { @@ -351,13 +351,13 @@ FX_INT32 CBC_PDF417HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideStri } return count; } -FX_INT32 CBC_PDF417HighLevelEncoder::determineConsecutiveTextCount(CFX_WideString msg, FX_INT32 startpos) +int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveTextCount(CFX_WideString msg, int32_t startpos) { - FX_INT32 len = msg.GetLength(); - FX_INT32 idx = startpos; + int32_t len = msg.GetLength(); + int32_t idx = startpos; while (idx < len) { FX_WCHAR ch = msg.GetAt(idx); - FX_INT32 numericCount = 0; + int32_t numericCount = 0; while (numericCount < 13 && isDigit(ch) && idx < len) { numericCount++; idx++; @@ -379,16 +379,16 @@ FX_INT32 CBC_PDF417HighLevelEncoder::determineConsecutiveTextCount(CFX_WideStrin } return idx - startpos; } -FX_INT32 CBC_PDF417HighLevelEncoder::determineConsecutiveBinaryCount(CFX_WideString msg, CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 &e) +int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveBinaryCount(CFX_WideString msg, CFX_ByteArray* bytes, int32_t startpos, int32_t &e) { - FX_INT32 len = msg.GetLength(); - FX_INT32 idx = startpos; + int32_t len = msg.GetLength(); + int32_t idx = startpos; while (idx < len) { FX_WCHAR ch = msg.GetAt(idx); - FX_INT32 numericCount = 0; + int32_t numericCount = 0; while (numericCount < 13 && isDigit(ch)) { numericCount++; - FX_INT32 i = idx + numericCount; + int32_t i = idx + numericCount; if (i >= len) { break; } @@ -397,10 +397,10 @@ FX_INT32 CBC_PDF417HighLevelEncoder::determineConsecutiveBinaryCount(CFX_WideStr if (numericCount >= 13) { return idx - startpos; } - FX_INT32 textCount = 0; + int32_t textCount = 0; while (textCount < 5 && isText(ch)) { textCount++; - FX_INT32 i = idx + textCount; + int32_t i = idx + textCount; if (i >= len) { break; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h b/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h index 7c8801cb21..177507c4f5 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h @@ -12,36 +12,36 @@ class CBC_PDF417HighLevelEncoder { public: - static CFX_WideString encodeHighLevel(CFX_WideString msg, Compaction compaction, FX_INT32 &e); + static CFX_WideString encodeHighLevel(CFX_WideString msg, Compaction compaction, int32_t &e); static void Inverse(); static void Initialize(); static void Finalize(); private: - static FX_INT32 TEXT_COMPACTION; - static FX_INT32 BYTE_COMPACTION; - static FX_INT32 NUMERIC_COMPACTION; - static FX_INT32 SUBMODE_PUNCTUATION; - static FX_INT32 LATCH_TO_TEXT; - static FX_INT32 LATCH_TO_BYTE_PADDED; - static FX_INT32 LATCH_TO_NUMERIC; - static FX_INT32 SHIFT_TO_BYTE; - static FX_INT32 LATCH_TO_BYTE; - static FX_BYTE TEXT_MIXED_RAW[]; - static FX_BYTE TEXT_PUNCTUATION_RAW[]; - static FX_INT32 MIXED[128]; - static FX_INT32 PUNCTUATION[128]; - static FX_INT32 encodeText(CFX_WideString msg, FX_INT32 startpos, FX_INT32 count, CFX_WideString &sb, FX_INT32 initialSubmode); - static void encodeBinary(CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 count, FX_INT32 startmode, CFX_WideString &sb); - static void encodeNumeric(CFX_WideString msg, FX_INT32 startpos, FX_INT32 count, CFX_WideString &sb); + static int32_t TEXT_COMPACTION; + static int32_t BYTE_COMPACTION; + static int32_t NUMERIC_COMPACTION; + static int32_t SUBMODE_PUNCTUATION; + static int32_t LATCH_TO_TEXT; + static int32_t LATCH_TO_BYTE_PADDED; + static int32_t LATCH_TO_NUMERIC; + static int32_t SHIFT_TO_BYTE; + static int32_t LATCH_TO_BYTE; + static uint8_t TEXT_MIXED_RAW[]; + static uint8_t TEXT_PUNCTUATION_RAW[]; + static int32_t MIXED[128]; + static int32_t PUNCTUATION[128]; + static int32_t encodeText(CFX_WideString msg, int32_t startpos, int32_t count, CFX_WideString &sb, int32_t initialSubmode); + static void encodeBinary(CFX_ByteArray* bytes, int32_t startpos, int32_t count, int32_t startmode, CFX_WideString &sb); + static void encodeNumeric(CFX_WideString msg, 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 FX_INT32 determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos); - static FX_INT32 determineConsecutiveTextCount(CFX_WideString msg, FX_INT32 startpos); - static FX_INT32 determineConsecutiveBinaryCount(CFX_WideString msg, CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 &e); + static int32_t determineConsecutiveDigitCount(CFX_WideString msg, int32_t startpos); + static int32_t determineConsecutiveTextCount(CFX_WideString msg, int32_t startpos); + static int32_t determineConsecutiveBinaryCount(CFX_WideString msg, CFX_ByteArray* bytes, int32_t startpos, int32_t &e); friend class PDF417HighLevelEncoder_EncodeNumeric_Test; friend class PDF417HighLevelEncoder_EncodeBinary_Test; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp index ed751cc4ba..a880317ee0 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp @@ -57,16 +57,16 @@ CBC_PDF417Reader::CBC_PDF417Reader() CBC_PDF417Reader::~CBC_PDF417Reader() { } -CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e) +CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, int32_t &e) { return Decode(image, 0, e); } -CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, FX_BOOL multiple, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, FX_BOOL multiple, int32_t hints, int32_t &e) { CFX_ByteString results; CBC_PDF417DetectorResult* detectorResult = CBC_Detector::detect(image, hints, multiple, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); - for (FX_INT32 i = 0; i < detectorResult->getPoints()->GetSize(); i++) { + for (int32_t i = 0; i < detectorResult->getPoints()->GetSize(); i++) { CFX_PtrArray* points = (CFX_PtrArray*)detectorResult->getPoints()->GetAt(i); CBC_CommonDecoderResult* ResultTemp = CBC_PDF417ScanningDecoder::decode(detectorResult->getBits(), (CBC_ResultPoint*)points->GetAt(4), (CBC_ResultPoint*)points->GetAt(5), (CBC_ResultPoint*)points->GetAt(6), (CBC_ResultPoint*)points->GetAt(7), getMinCodewordWidth(*points), getMaxCodewordWidth(*points), e); @@ -81,39 +81,39 @@ CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, FX_BOOL multipl delete detectorResult; return results; } -CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_PDF417Reader::Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e) { CFX_ByteString bs = Decode(image, FALSE, 0, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); return bs; } -FX_INT32 CBC_PDF417Reader::getMaxWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2) +int32_t CBC_PDF417Reader::getMaxWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2) { if (p1 == NULL || p2 == NULL) { return 0; } - return (FX_INT32) FXSYS_fabs(p1->GetX() - p2->GetX()); + return (int32_t) FXSYS_fabs(p1->GetX() - p2->GetX()); } -FX_INT32 CBC_PDF417Reader::getMinWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2) +int32_t CBC_PDF417Reader::getMinWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2) { if (p1 == NULL || p2 == NULL) { return Integer_MAX_VALUE; } - return (FX_INT32) FXSYS_fabs(p1->GetX() - p2->GetX()); + return (int32_t) FXSYS_fabs(p1->GetX() - p2->GetX()); } -FX_INT32 CBC_PDF417Reader::getMaxCodewordWidth(CFX_PtrArray& p) +int32_t CBC_PDF417Reader::getMaxCodewordWidth(CFX_PtrArray& p) { - FX_INT32 a = getMaxWidth((CBC_ResultPoint*)p.GetAt(6), (CBC_ResultPoint*)p.GetAt(2)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN; - FX_INT32 b = getMaxWidth((CBC_ResultPoint*)p.GetAt(7), (CBC_ResultPoint*)p.GetAt(3)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN; - FX_INT32 c = getMaxWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) < a ? getMaxWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) : a; - FX_INT32 d = getMaxWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) < b ? getMaxWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) : b; + int32_t a = getMaxWidth((CBC_ResultPoint*)p.GetAt(6), (CBC_ResultPoint*)p.GetAt(2)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN; + int32_t b = getMaxWidth((CBC_ResultPoint*)p.GetAt(7), (CBC_ResultPoint*)p.GetAt(3)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN; + int32_t c = getMaxWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) < a ? getMaxWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) : a; + int32_t d = getMaxWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) < b ? getMaxWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) : b; return c < d ? c : d; } -FX_INT32 CBC_PDF417Reader::getMinCodewordWidth(CFX_PtrArray& p) +int32_t CBC_PDF417Reader::getMinCodewordWidth(CFX_PtrArray& p) { - FX_INT32 a = getMinWidth((CBC_ResultPoint*)p.GetAt(6), (CBC_ResultPoint*)p.GetAt(2)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN; - FX_INT32 b = getMinWidth((CBC_ResultPoint*)p.GetAt(7), (CBC_ResultPoint*)p.GetAt(3)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN; - FX_INT32 c = getMinWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) < a ? getMinWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) : a; - FX_INT32 d = getMinWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) < b ? getMinWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) : b; + int32_t a = getMinWidth((CBC_ResultPoint*)p.GetAt(6), (CBC_ResultPoint*)p.GetAt(2)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN; + int32_t b = getMinWidth((CBC_ResultPoint*)p.GetAt(7), (CBC_ResultPoint*)p.GetAt(3)) * CBC_PDF417Common::MODULES_IN_CODEWORD / CBC_PDF417Common::MODULES_IN_STOP_PATTERN; + int32_t c = getMinWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) < a ? getMinWidth((CBC_ResultPoint*)p.GetAt(0), (CBC_ResultPoint*)p.GetAt(4)) : a; + int32_t d = getMinWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) < b ? getMinWidth((CBC_ResultPoint*)p.GetAt(1), (CBC_ResultPoint*)p.GetAt(5)) : b; return c < d ? c : d; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.h b/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.h index e6c0236cf7..031829d8e6 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Reader.h @@ -14,13 +14,13 @@ class CBC_PDF417Reader : public CBC_Reader public: CBC_PDF417Reader(); virtual ~CBC_PDF417Reader(); - CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e); - CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_BOOL multiple, FX_INT32 hints, FX_INT32 &e); - CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e); + CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e); + CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_BOOL multiple, int32_t hints, int32_t &e); + CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e); private: - static FX_INT32 getMaxWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2); - static FX_INT32 getMinWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2); - static FX_INT32 getMaxCodewordWidth(CFX_PtrArray& p); - static FX_INT32 getMinCodewordWidth(CFX_PtrArray& p); + static int32_t getMaxWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2); + static int32_t getMinWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2); + static int32_t getMaxCodewordWidth(CFX_PtrArray& p); + static int32_t getMinCodewordWidth(CFX_PtrArray& p); }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.cpp index 393ee2e75d..d99cefdb58 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.cpp @@ -28,11 +28,11 @@ CBC_PDF417ResultMetadata::CBC_PDF417ResultMetadata() CBC_PDF417ResultMetadata::~CBC_PDF417ResultMetadata() { } -FX_INT32 CBC_PDF417ResultMetadata::getSegmentIndex() +int32_t CBC_PDF417ResultMetadata::getSegmentIndex() { return m_segmentIndex; } -void CBC_PDF417ResultMetadata::setSegmentIndex(FX_INT32 segmentIndex) +void CBC_PDF417ResultMetadata::setSegmentIndex(int32_t segmentIndex) { m_segmentIndex = segmentIndex; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.h b/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.h index 7639c032ba..d635137e9d 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.h @@ -11,8 +11,8 @@ class CBC_PDF417ResultMetadata public: CBC_PDF417ResultMetadata(); virtual ~CBC_PDF417ResultMetadata(); - FX_INT32 getSegmentIndex(); - void setSegmentIndex(FX_INT32 segmentIndex); + int32_t getSegmentIndex(); + void setSegmentIndex(int32_t segmentIndex); CFX_ByteString getFileId(); void setFileId(CFX_ByteString fileId); CFX_Int32Array& getOptionalData(); @@ -20,7 +20,7 @@ public: FX_BOOL isLastSegment(); void setLastSegment(FX_BOOL lastSegment); private: - FX_INT32 m_segmentIndex; + int32_t m_segmentIndex; CFX_ByteString m_fileId; CFX_Int32Array m_optionalData; FX_BOOL m_lastSegment; diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp index 2b127ceb07..de43e65144 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp @@ -40,9 +40,9 @@ #include "BC_PDF417ECErrorCorrection.h" #include "BC_PDF417DecodedBitStreamParser.h" #include "BC_PDF417ScanningDecoder.h" -FX_INT32 CBC_PDF417ScanningDecoder::CODEWORD_SKEW_SIZE = 2; -FX_INT32 CBC_PDF417ScanningDecoder::MAX_ERRORS = 3; -FX_INT32 CBC_PDF417ScanningDecoder::MAX_EC_CODEWORDS = 512; +int32_t CBC_PDF417ScanningDecoder::CODEWORD_SKEW_SIZE = 2; +int32_t CBC_PDF417ScanningDecoder::MAX_ERRORS = 3; +int32_t CBC_PDF417ScanningDecoder::MAX_EC_CODEWORDS = 512; CBC_PDF417ECErrorCorrection* CBC_PDF417ScanningDecoder::errorCorrection = NULL; CBC_PDF417ScanningDecoder::CBC_PDF417ScanningDecoder() { @@ -59,14 +59,14 @@ void CBC_PDF417ScanningDecoder::Finalize() delete errorCorrection; } CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(CBC_CommonBitMatrix* image, CBC_ResultPoint* imageTopLeft, CBC_ResultPoint* imageBottomLeft, CBC_ResultPoint* imageTopRight, - CBC_ResultPoint* imageBottomRight, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth, FX_INT32 &e) + CBC_ResultPoint* imageBottomRight, int32_t minCodewordWidth, int32_t maxCodewordWidth, int32_t &e) { CBC_BoundingBox* boundingBox = FX_NEW CBC_BoundingBox(image, imageTopLeft, imageBottomLeft, imageTopRight, imageBottomRight, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn = NULL; CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn = NULL; CBC_DetectionResult* detectionResult = NULL; - for (FX_INT32 i = 0; i < 2; i++) { + for (int32_t i = 0; i < 2; i++) { if (imageTopLeft != NULL) { leftRowIndicatorColumn = getRowIndicatorColumn(image, boundingBox, *imageTopLeft, TRUE, minCodewordWidth, maxCodewordWidth); } @@ -89,12 +89,12 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(CBC_CommonBitMatrix* break; } } - FX_INT32 maxBarcodeColumn = detectionResult->getBarcodeColumnCount() + 1; + int32_t maxBarcodeColumn = detectionResult->getBarcodeColumnCount() + 1; detectionResult->setDetectionResultColumn(0, leftRowIndicatorColumn); detectionResult->setDetectionResultColumn(maxBarcodeColumn, rightRowIndicatorColumn); FX_BOOL leftToRight = leftRowIndicatorColumn != NULL; - for (FX_INT32 barcodeColumnCount = 1; barcodeColumnCount <= maxBarcodeColumn; barcodeColumnCount++) { - FX_INT32 barcodeColumn = leftToRight ? barcodeColumnCount : maxBarcodeColumn - barcodeColumnCount; + for (int32_t barcodeColumnCount = 1; barcodeColumnCount <= maxBarcodeColumn; barcodeColumnCount++) { + int32_t barcodeColumn = leftToRight ? barcodeColumnCount : maxBarcodeColumn - barcodeColumnCount; if (detectionResult->getDetectionResultColumn(barcodeColumn) != NULL) { continue; } @@ -105,9 +105,9 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(CBC_CommonBitMatrix* detectionResultColumn = FX_NEW CBC_DetectionResultColumn(boundingBox); } detectionResult->setDetectionResultColumn(barcodeColumn, detectionResultColumn); - FX_INT32 startColumn = -1; - FX_INT32 previousStartColumn = startColumn; - for (FX_INT32 imageRow = boundingBox->getMinY(); imageRow <= boundingBox->getMaxY(); imageRow++) { + int32_t startColumn = -1; + int32_t previousStartColumn = startColumn; + for (int32_t imageRow = boundingBox->getMinY(); imageRow <= boundingBox->getMaxY(); imageRow++) { startColumn = getStartColumn(detectionResult, barcodeColumn, imageRow, leftToRight); if (startColumn < 0 || startColumn > boundingBox->getMaxX()) { if (previousStartColumn == -1) { @@ -134,9 +134,9 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decode(CBC_CommonBitMatrix* CFX_ByteString CBC_PDF417ScanningDecoder::toString(CFX_PtrArray* barcodeMatrix) { CFX_ByteString result; - for (FX_INT32 row = 0; row < barcodeMatrix->GetSize(); row++) { + for (int32_t row = 0; row < barcodeMatrix->GetSize(); row++) { result += row; - FX_INT32 l = 0; + int32_t l = 0; for (; l < ((CFX_PtrArray*)barcodeMatrix->GetAt(row))->GetSize(); l++) { CBC_BarcodeValue* barcodeValue = (CBC_BarcodeValue*)((CFX_PtrArray*)barcodeMatrix->GetAt(row))->GetAt(l); if (barcodeValue->getValue()->GetSize() == 0) { @@ -149,7 +149,7 @@ CFX_ByteString CBC_PDF417ScanningDecoder::toString(CFX_PtrArray* barcodeMatrix) } return result; } -CBC_DetectionResult* CBC_PDF417ScanningDecoder::merge(CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn, CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn, FX_INT32 &e) +CBC_DetectionResult* CBC_PDF417ScanningDecoder::merge(CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn, CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn, int32_t &e) { if (leftRowIndicatorColumn == NULL && rightRowIndicatorColumn == NULL) { e = BCExceptionIllegalArgument; @@ -178,45 +178,45 @@ CBC_DetectionResult* CBC_PDF417ScanningDecoder::merge(CBC_DetectionResultRowIndi CBC_DetectionResult* detectionresult = FX_NEW CBC_DetectionResult(barcodeMetadata, boundingBox); return detectionresult; } -CBC_BoundingBox* CBC_PDF417ScanningDecoder::adjustBoundingBox(CBC_DetectionResultRowIndicatorColumn* rowIndicatorColumn, FX_INT32 &e) +CBC_BoundingBox* CBC_PDF417ScanningDecoder::adjustBoundingBox(CBC_DetectionResultRowIndicatorColumn* rowIndicatorColumn, int32_t &e) { if (rowIndicatorColumn == NULL) { return NULL; } CFX_Int32Array* rowHeights = rowIndicatorColumn->getRowHeights(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 maxRowHeight = getMax(*rowHeights); - FX_INT32 missingStartRows = 0; - for (FX_INT32 i = 0; i < rowHeights->GetSize(); i++) { - FX_INT32 rowHeight = rowHeights->GetAt(i); + int32_t maxRowHeight = getMax(*rowHeights); + int32_t missingStartRows = 0; + for (int32_t i = 0; i < rowHeights->GetSize(); i++) { + int32_t rowHeight = rowHeights->GetAt(i); missingStartRows += maxRowHeight - rowHeight; if (rowHeight > 0) { break; } } CFX_PtrArray* codewords = rowIndicatorColumn->getCodewords(); - for (FX_INT32 row = 0; missingStartRows > 0 && codewords->GetAt(row) == NULL; row++) { + for (int32_t row = 0; missingStartRows > 0 && codewords->GetAt(row) == NULL; row++) { missingStartRows--; } - FX_INT32 missingEndRows = 0; - for (FX_INT32 row1 = rowHeights->GetSize() - 1; row1 >= 0; row1--) { + int32_t missingEndRows = 0; + for (int32_t row1 = rowHeights->GetSize() - 1; row1 >= 0; row1--) { missingEndRows += maxRowHeight - rowHeights->GetAt(row1); if (rowHeights->GetAt(row1) > 0) { break; } } - for (FX_INT32 row2 = codewords->GetSize() - 1; missingEndRows > 0 && codewords->GetAt(row2) == NULL; row2--) { + for (int32_t row2 = codewords->GetSize() - 1; missingEndRows > 0 && codewords->GetAt(row2) == NULL; row2--) { missingEndRows--; } CBC_BoundingBox* boundingBox = rowIndicatorColumn->getBoundingBox()->addMissingRows(missingStartRows, missingEndRows, rowIndicatorColumn->isLeft(), e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return boundingBox; } -FX_INT32 CBC_PDF417ScanningDecoder::getMax(CFX_Int32Array& values) +int32_t CBC_PDF417ScanningDecoder::getMax(CFX_Int32Array& values) { - FX_INT32 maxValue = -1; - for (FX_INT32 i = 0; i < values.GetSize(); i++) { - FX_INT32 value = values.GetAt(i); + int32_t maxValue = -1; + for (int32_t i = 0; i < values.GetSize(); i++) { + int32_t value = values.GetAt(i); maxValue = maxValue > value ? maxValue : value; } return maxValue; @@ -243,13 +243,13 @@ CBC_BarcodeMetadata* CBC_PDF417ScanningDecoder::getBarcodeMetadata(CBC_Detection return leftBarcodeMetadata; } CBC_DetectionResultRowIndicatorColumn* CBC_PDF417ScanningDecoder::getRowIndicatorColumn(CBC_CommonBitMatrix* image, CBC_BoundingBox* boundingBox, CBC_ResultPoint startPoint, - FX_BOOL leftToRight, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth) + FX_BOOL leftToRight, int32_t minCodewordWidth, int32_t maxCodewordWidth) { CBC_DetectionResultRowIndicatorColumn* rowIndicatorColumn = FX_NEW CBC_DetectionResultRowIndicatorColumn(boundingBox, leftToRight); - for (FX_INT32 i = 0; i < 2; i++) { - FX_INT32 increment = i == 0 ? 1 : -1; - FX_INT32 startColumn = (FX_INT32) startPoint.GetX(); - for (FX_INT32 imageRow = (FX_INT32) startPoint.GetY(); imageRow <= boundingBox->getMaxY() && imageRow >= boundingBox->getMinY(); imageRow += increment) { + for (int32_t i = 0; i < 2; i++) { + int32_t increment = i == 0 ? 1 : -1; + int32_t startColumn = (int32_t) startPoint.GetX(); + for (int32_t imageRow = (int32_t) startPoint.GetY(); imageRow <= boundingBox->getMaxY() && imageRow >= boundingBox->getMinY(); imageRow += increment) { CBC_Codeword* codeword = detectCodeword(image, 0, image->GetWidth(), leftToRight, startColumn, imageRow, minCodewordWidth, maxCodewordWidth); if (codeword != NULL) { rowIndicatorColumn->setCodeword(imageRow, codeword); @@ -263,10 +263,10 @@ CBC_DetectionResultRowIndicatorColumn* CBC_PDF417ScanningDecoder::getRowIndicato } return rowIndicatorColumn; } -void CBC_PDF417ScanningDecoder::adjustCodewordCount(CBC_DetectionResult* detectionResult, CFX_PtrArray* barcodeMatrix, FX_INT32 &e) +void CBC_PDF417ScanningDecoder::adjustCodewordCount(CBC_DetectionResult* detectionResult, CFX_PtrArray* barcodeMatrix, int32_t &e) { CFX_Int32Array* numberOfCodewords = ((CBC_BarcodeValue*)((CFX_PtrArray*)barcodeMatrix->GetAt(0))->GetAt(1))->getValue(); - FX_INT32 calculatedNumberOfCodewords = detectionResult->getBarcodeColumnCount() * detectionResult->getBarcodeRowCount() - getNumberOfECCodeWords(detectionResult->getBarcodeECLevel()); + int32_t calculatedNumberOfCodewords = detectionResult->getBarcodeColumnCount() * detectionResult->getBarcodeRowCount() - getNumberOfECCodeWords(detectionResult->getBarcodeECLevel()); if (numberOfCodewords->GetSize() == 0) { if (calculatedNumberOfCodewords < 1 || calculatedNumberOfCodewords > CBC_PDF417Common::MAX_CODEWORDS_IN_BARCODE) { e = BCExceptiontNotFoundInstance; @@ -279,14 +279,14 @@ void CBC_PDF417ScanningDecoder::adjustCodewordCount(CBC_DetectionResult* detecti } delete numberOfCodewords; } -CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResult(CBC_DetectionResult* detectionResult, FX_INT32 &e) +CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResult(CBC_DetectionResult* detectionResult, int32_t &e) { CFX_PtrArray* barcodeMatrix = createBarcodeMatrix(detectionResult); adjustCodewordCount(detectionResult, barcodeMatrix, e); if (e != BCExceptionNO) { - for (FX_INT32 i = 0; i < barcodeMatrix->GetSize(); i++) { + for (int32_t i = 0; i < barcodeMatrix->GetSize(); i++) { CFX_PtrArray* temp = (CFX_PtrArray*)barcodeMatrix->GetAt(i); - for (FX_INT32 j = 0; j < temp->GetSize(); j++) { + for (int32_t j = 0; j < temp->GetSize(); j++) { delete (CBC_BarcodeValue*)temp->GetAt(j); } temp->RemoveAll(); @@ -301,10 +301,10 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResult(CBC_Dete codewords.SetSize(detectionResult->getBarcodeRowCount() * detectionResult->getBarcodeColumnCount()); CFX_PtrArray ambiguousIndexValuesList; CFX_Int32Array ambiguousIndexesList; - for (FX_INT32 row = 0; row < detectionResult->getBarcodeRowCount(); row++) { - for (FX_INT32 l = 0; l < detectionResult->getBarcodeColumnCount(); l++) { + for (int32_t row = 0; row < detectionResult->getBarcodeRowCount(); row++) { + for (int32_t l = 0; l < detectionResult->getBarcodeColumnCount(); l++) { CFX_Int32Array* values = ((CBC_BarcodeValue*)((CFX_PtrArray*)barcodeMatrix->GetAt(row))->GetAt(l + 1))->getValue(); - FX_INT32 codewordIndex = row * detectionResult->getBarcodeColumnCount() + l; + int32_t codewordIndex = row * detectionResult->getBarcodeColumnCount() + l; if (values->GetSize() == 0) { erasures.Add(codewordIndex); } else if (values->GetSize() == 1) { @@ -317,12 +317,12 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResult(CBC_Dete } CFX_PtrArray ambiguousIndexValues; ambiguousIndexValues.SetSize(ambiguousIndexValuesList.GetSize()); - for (FX_INT32 i = 0; i < ambiguousIndexValues.GetSize(); i++) { + for (int32_t i = 0; i < ambiguousIndexValues.GetSize(); i++) { ambiguousIndexValues.SetAt(i, ambiguousIndexValuesList.GetAt(i)); } - for (FX_INT32 l = 0; l < barcodeMatrix->GetSize(); l++) { + for (int32_t l = 0; l < barcodeMatrix->GetSize(); l++) { CFX_PtrArray* temp = (CFX_PtrArray*)barcodeMatrix->GetAt(l); - for (FX_INT32 j = 0; j < temp->GetSize(); j++) { + for (int32_t j = 0; j < temp->GetSize(); j++) { delete (CBC_BarcodeValue*)temp->GetAt(j); } temp->RemoveAll(); @@ -334,14 +334,14 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResult(CBC_Dete BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return decoderResult; } -CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResultFromAmbiguousValues(FX_INT32 ecLevel, CFX_Int32Array &codewords, CFX_Int32Array &erasureArray, CFX_Int32Array &ambiguousIndexes, - CFX_PtrArray& ambiguousIndexValues, FX_INT32 &e) +CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResultFromAmbiguousValues(int32_t ecLevel, CFX_Int32Array &codewords, CFX_Int32Array &erasureArray, CFX_Int32Array &ambiguousIndexes, + CFX_PtrArray& ambiguousIndexValues, int32_t &e) { CFX_Int32Array ambiguousIndexCount; ambiguousIndexCount.SetSize(ambiguousIndexes.GetSize()); - FX_INT32 tries = 100; + int32_t tries = 100; while (tries-- > 0) { - for (FX_INT32 l = 0; l < ambiguousIndexCount.GetSize(); l++) { + for (int32_t l = 0; l < ambiguousIndexCount.GetSize(); l++) { codewords[ambiguousIndexes[l]] = ((CFX_Int32Array*)ambiguousIndexValues.GetAt(l))->GetAt(ambiguousIndexCount[l]); } CBC_CommonDecoderResult* decoderResult = decodeCodewords(codewords, ecLevel, erasureArray, e); @@ -355,7 +355,7 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::createDecoderResultFromAmbig e = BCExceptionChecksumInstance; return NULL; } - for (FX_INT32 i = 0; i < ambiguousIndexCount.GetSize(); i++) { + for (int32_t i = 0; i < ambiguousIndexCount.GetSize(); i++) { if (ambiguousIndexCount[i] < ((CFX_Int32Array*)(ambiguousIndexValues.GetAt(i)))->GetSize() - 1) { ambiguousIndexCount[i]++; break; @@ -376,8 +376,8 @@ CFX_PtrArray* CBC_PDF417ScanningDecoder::createBarcodeMatrix(CBC_DetectionResult CFX_PtrArray* barcodeMatrix = FX_NEW CFX_PtrArray; barcodeMatrix->SetSize(detectionResult->getBarcodeRowCount()); CFX_PtrArray* temp = NULL; - FX_INT32 colume = 0; - for (FX_INT32 row = 0; row < barcodeMatrix->GetSize(); row++) { + int32_t colume = 0; + for (int32_t row = 0; row < barcodeMatrix->GetSize(); row++) { temp = FX_NEW CFX_PtrArray; temp->SetSize(detectionResult->getBarcodeColumnCount() + 2); for (colume = 0; colume < detectionResult->getBarcodeColumnCount() + 2; colume++) { @@ -386,14 +386,14 @@ CFX_PtrArray* CBC_PDF417ScanningDecoder::createBarcodeMatrix(CBC_DetectionResult barcodeMatrix->SetAt(row, temp); } colume = -1; - for (FX_INT32 i = 0; i < detectionResult->getDetectionResultColumns().GetSize(); i++) { + for (int32_t i = 0; i < detectionResult->getDetectionResultColumns().GetSize(); i++) { CBC_DetectionResultColumn* detectionResultColumn = (CBC_DetectionResultColumn*) detectionResult->getDetectionResultColumns().GetAt(i); colume++; if (detectionResultColumn == NULL) { continue; } CFX_PtrArray* temp = detectionResultColumn->getCodewords(); - for (FX_INT32 l = 0; l < temp->GetSize(); l++) { + for (int32_t l = 0; l < temp->GetSize(); l++) { CBC_Codeword* codeword = (CBC_Codeword*) temp->GetAt(l); if (codeword == NULL || codeword->getRowNumber() == -1) { continue; @@ -403,13 +403,13 @@ CFX_PtrArray* CBC_PDF417ScanningDecoder::createBarcodeMatrix(CBC_DetectionResult } return barcodeMatrix; } -FX_BOOL CBC_PDF417ScanningDecoder::isValidBarcodeColumn(CBC_DetectionResult* detectionResult, FX_INT32 barcodeColumn) +FX_BOOL CBC_PDF417ScanningDecoder::isValidBarcodeColumn(CBC_DetectionResult* detectionResult, int32_t barcodeColumn) { return barcodeColumn >= 0 && barcodeColumn <= detectionResult->getBarcodeColumnCount() + 1; } -FX_INT32 CBC_PDF417ScanningDecoder::getStartColumn(CBC_DetectionResult* detectionResult, FX_INT32 barcodeColumn, FX_INT32 imageRow, FX_BOOL leftToRight) +int32_t CBC_PDF417ScanningDecoder::getStartColumn(CBC_DetectionResult* detectionResult, int32_t barcodeColumn, int32_t imageRow, FX_BOOL leftToRight) { - FX_INT32 offset = leftToRight ? 1 : -1; + int32_t offset = leftToRight ? 1 : -1; CBC_Codeword* codeword = NULL; if (isValidBarcodeColumn(detectionResult, barcodeColumn - offset)) { codeword = detectionResult->getDetectionResultColumn(barcodeColumn - offset)->getCodeword(imageRow); @@ -427,10 +427,10 @@ FX_INT32 CBC_PDF417ScanningDecoder::getStartColumn(CBC_DetectionResult* detectio if (codeword != NULL) { return leftToRight ? codeword->getEndX() : codeword->getStartX(); } - FX_INT32 skippedColumns = 0; + int32_t skippedColumns = 0; while (isValidBarcodeColumn(detectionResult, barcodeColumn - offset)) { barcodeColumn -= offset; - for (FX_INT32 i = 0; i < detectionResult->getDetectionResultColumn(barcodeColumn)->getCodewords()->GetSize(); i++) { + for (int32_t i = 0; i < detectionResult->getDetectionResultColumn(barcodeColumn)->getCodewords()->GetSize(); i++) { CBC_Codeword* previousRowCodeword = (CBC_Codeword*) detectionResult->getDetectionResultColumn(barcodeColumn)->getCodewords()->GetAt(i); if (previousRowCodeword != NULL) { return (leftToRight ? previousRowCodeword->getEndX() : previousRowCodeword->getStartX()) + @@ -441,42 +441,42 @@ FX_INT32 CBC_PDF417ScanningDecoder::getStartColumn(CBC_DetectionResult* detectio } return leftToRight ? detectionResult->getBoundingBox()->getMinX() : detectionResult->getBoundingBox()->getMaxX(); } -CBC_Codeword* CBC_PDF417ScanningDecoder::detectCodeword(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 startColumn, - FX_INT32 imageRow, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth) +CBC_Codeword* CBC_PDF417ScanningDecoder::detectCodeword(CBC_CommonBitMatrix* image, int32_t minColumn, int32_t maxColumn, FX_BOOL leftToRight, int32_t startColumn, + int32_t imageRow, int32_t minCodewordWidth, int32_t maxCodewordWidth) { startColumn = adjustCodewordStartColumn(image, minColumn, maxColumn, leftToRight, startColumn, imageRow); CFX_Int32Array* moduleBitCount = getModuleBitCount(image, minColumn, maxColumn, leftToRight, startColumn, imageRow); if (moduleBitCount == NULL) { return NULL; } - FX_INT32 endColumn; - FX_INT32 codewordBitCount = CBC_PDF417Common::getBitCountSum(*moduleBitCount); + int32_t endColumn; + int32_t codewordBitCount = CBC_PDF417Common::getBitCountSum(*moduleBitCount); if (leftToRight) { endColumn = startColumn + codewordBitCount; } else { - for (FX_INT32 i = 0; i < moduleBitCount->GetSize() >> 1; i++) { - FX_INT32 tmpCount = moduleBitCount->GetAt(i); + for (int32_t i = 0; i < moduleBitCount->GetSize() >> 1; i++) { + int32_t tmpCount = moduleBitCount->GetAt(i); moduleBitCount->SetAt(i, moduleBitCount->GetAt(moduleBitCount->GetSize() - 1 - i)); moduleBitCount->SetAt(moduleBitCount->GetSize() - 1 - i, tmpCount); } endColumn = startColumn; startColumn = endColumn - codewordBitCount; } - FX_INT32 decodedValue = CBC_PDF417CodewordDecoder::getDecodedValue(*moduleBitCount); - FX_INT32 codeword = CBC_PDF417Common::getCodeword(decodedValue); + int32_t decodedValue = CBC_PDF417CodewordDecoder::getDecodedValue(*moduleBitCount); + int32_t codeword = CBC_PDF417Common::getCodeword(decodedValue); delete moduleBitCount; if (codeword == -1) { return NULL; } return FX_NEW CBC_Codeword(startColumn, endColumn, getCodewordBucketNumber(decodedValue), codeword); } -CFX_Int32Array* CBC_PDF417ScanningDecoder::getModuleBitCount(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 startColumn, FX_INT32 imageRow) +CFX_Int32Array* CBC_PDF417ScanningDecoder::getModuleBitCount(CBC_CommonBitMatrix* image, int32_t minColumn, int32_t maxColumn, FX_BOOL leftToRight, int32_t startColumn, int32_t imageRow) { - FX_INT32 imageColumn = startColumn; + int32_t imageColumn = startColumn; CFX_Int32Array* moduleBitCount = FX_NEW CFX_Int32Array; moduleBitCount->SetSize(8); - FX_INT32 moduleNumber = 0; - FX_INT32 increment = leftToRight ? 1 : -1; + int32_t moduleNumber = 0; + int32_t increment = leftToRight ? 1 : -1; FX_BOOL previousPixelValue = leftToRight; while (((leftToRight && imageColumn < maxColumn) || (!leftToRight && imageColumn >= minColumn)) && moduleNumber < moduleBitCount->GetSize()) { if (image->Get(imageColumn, imageRow) == previousPixelValue) { @@ -493,15 +493,15 @@ CFX_Int32Array* CBC_PDF417ScanningDecoder::getModuleBitCount(CBC_CommonBitMatrix delete moduleBitCount; return NULL; } -FX_INT32 CBC_PDF417ScanningDecoder::getNumberOfECCodeWords(FX_INT32 barcodeECLevel) +int32_t CBC_PDF417ScanningDecoder::getNumberOfECCodeWords(int32_t barcodeECLevel) { return 2 << barcodeECLevel; } -FX_INT32 CBC_PDF417ScanningDecoder::adjustCodewordStartColumn(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 codewordStartColumn, FX_INT32 imageRow) +int32_t CBC_PDF417ScanningDecoder::adjustCodewordStartColumn(CBC_CommonBitMatrix* image, int32_t minColumn, int32_t maxColumn, FX_BOOL leftToRight, int32_t codewordStartColumn, int32_t imageRow) { - FX_INT32 correctedStartColumn = codewordStartColumn; - FX_INT32 increment = leftToRight ? -1 : 1; - for (FX_INT32 i = 0; i < 2; i++) { + int32_t correctedStartColumn = codewordStartColumn; + int32_t increment = leftToRight ? -1 : 1; + for (int32_t i = 0; i < 2; i++) { FX_BOOL l = image->Get(correctedStartColumn, imageRow); while (((leftToRight && correctedStartColumn >= minColumn) || (!leftToRight && correctedStartColumn < maxColumn)) && leftToRight == image->Get(correctedStartColumn, imageRow)) { if (abs(codewordStartColumn - correctedStartColumn) > CODEWORD_SKEW_SIZE) { @@ -514,18 +514,18 @@ FX_INT32 CBC_PDF417ScanningDecoder::adjustCodewordStartColumn(CBC_CommonBitMatri } return correctedStartColumn; } -FX_BOOL CBC_PDF417ScanningDecoder::checkCodewordSkew(FX_INT32 codewordSize, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth) +FX_BOOL CBC_PDF417ScanningDecoder::checkCodewordSkew(int32_t codewordSize, int32_t minCodewordWidth, int32_t maxCodewordWidth) { return minCodewordWidth - CODEWORD_SKEW_SIZE <= codewordSize && codewordSize <= maxCodewordWidth + CODEWORD_SKEW_SIZE; } -CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decodeCodewords(CFX_Int32Array &codewords, FX_INT32 ecLevel, CFX_Int32Array &erasures, FX_INT32 &e) +CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decodeCodewords(CFX_Int32Array &codewords, int32_t ecLevel, CFX_Int32Array &erasures, int32_t &e) { if (codewords.GetSize() == 0) { e = BCExceptionFormatInstance; return NULL; } - FX_INT32 numECCodewords = 1 << (ecLevel + 1); - FX_INT32 correctedErrorsCount = correctErrors(codewords, erasures, numECCodewords, e); + int32_t numECCodewords = 1 << (ecLevel + 1); + int32_t correctedErrorsCount = correctErrors(codewords, erasures, numECCodewords, e); BC_EXCEPTION_CHECK_ReturnValue(e , NULL); verifyCodewordCount(codewords, numECCodewords, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); @@ -534,23 +534,23 @@ CBC_CommonDecoderResult* CBC_PDF417ScanningDecoder::decodeCodewords(CFX_Int32Arr BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return decoderResult; } -FX_INT32 CBC_PDF417ScanningDecoder::correctErrors(CFX_Int32Array &codewords, CFX_Int32Array &erasures, FX_INT32 numECCodewords, FX_INT32 &e) +int32_t CBC_PDF417ScanningDecoder::correctErrors(CFX_Int32Array &codewords, CFX_Int32Array &erasures, int32_t numECCodewords, int32_t &e) { if ((erasures.GetSize() != 0 && erasures.GetSize() > (numECCodewords / 2 + MAX_ERRORS)) || numECCodewords < 0 || numECCodewords > MAX_EC_CODEWORDS) { e = BCExceptionChecksumInstance; return -1; } - FX_INT32 result = CBC_PDF417ECErrorCorrection::decode(codewords, numECCodewords, erasures, e); + int32_t result = CBC_PDF417ECErrorCorrection::decode(codewords, numECCodewords, erasures, e); BC_EXCEPTION_CHECK_ReturnValue(e, -1); return result; } -void CBC_PDF417ScanningDecoder::verifyCodewordCount(CFX_Int32Array &codewords, FX_INT32 numECCodewords, FX_INT32 &e) +void CBC_PDF417ScanningDecoder::verifyCodewordCount(CFX_Int32Array &codewords, int32_t numECCodewords, int32_t &e) { if (codewords.GetSize() < 4) { e = BCExceptionFormatInstance; return; } - FX_INT32 numberOfCodewords = codewords.GetAt(0); + int32_t numberOfCodewords = codewords.GetAt(0); if (numberOfCodewords > codewords.GetSize()) { e = BCExceptionFormatInstance; return; @@ -564,12 +564,12 @@ void CBC_PDF417ScanningDecoder::verifyCodewordCount(CFX_Int32Array &codewords, F } } } -CFX_Int32Array* CBC_PDF417ScanningDecoder::getBitCountForCodeword(FX_INT32 codeword) +CFX_Int32Array* CBC_PDF417ScanningDecoder::getBitCountForCodeword(int32_t codeword) { CFX_Int32Array* result = FX_NEW CFX_Int32Array; result->SetSize(8); - FX_INT32 previousValue = 0; - FX_INT32 i = result->GetSize() - 1; + int32_t previousValue = 0; + int32_t i = result->GetSize() - 1; while (TRUE) { if ((codeword & 0x1) != previousValue) { previousValue = codeword & 0x1; @@ -583,14 +583,14 @@ CFX_Int32Array* CBC_PDF417ScanningDecoder::getBitCountForCodeword(FX_INT32 codew } return result; } -FX_INT32 CBC_PDF417ScanningDecoder::getCodewordBucketNumber(FX_INT32 codeword) +int32_t CBC_PDF417ScanningDecoder::getCodewordBucketNumber(int32_t codeword) { CFX_Int32Array* array = getBitCountForCodeword(codeword); - FX_INT32 result = getCodewordBucketNumber(*array); + int32_t result = getCodewordBucketNumber(*array); delete array; return result; } -FX_INT32 CBC_PDF417ScanningDecoder::getCodewordBucketNumber(CFX_Int32Array& moduleBitCount) +int32_t CBC_PDF417ScanningDecoder::getCodewordBucketNumber(CFX_Int32Array& moduleBitCount) { return (moduleBitCount.GetAt(0) - moduleBitCount.GetAt(2) + moduleBitCount.GetAt(4) - moduleBitCount.GetAt(6) + 9) % 9; } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h index 8cb5d2856c..1022288811 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h @@ -25,37 +25,37 @@ public: static void Initialize(); static void Finalize(); static CBC_CommonDecoderResult* decode(CBC_CommonBitMatrix* image, CBC_ResultPoint* imageTopLeft, CBC_ResultPoint* imageBottomLeft, CBC_ResultPoint* imageTopRight, - CBC_ResultPoint* imageBottomRight, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth, FX_INT32 &e); + CBC_ResultPoint* imageBottomRight, int32_t minCodewordWidth, int32_t maxCodewordWidth, int32_t &e); static CFX_ByteString toString(CFX_PtrArray* barcodeMatrix); private: - static FX_INT32 CODEWORD_SKEW_SIZE; - static FX_INT32 MAX_ERRORS; - static FX_INT32 MAX_EC_CODEWORDS; + static int32_t CODEWORD_SKEW_SIZE; + static int32_t MAX_ERRORS; + static int32_t MAX_EC_CODEWORDS; static CBC_PDF417ECErrorCorrection* errorCorrection; - static CBC_DetectionResult* merge(CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn, CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn, FX_INT32 &e); - static CBC_BoundingBox* adjustBoundingBox(CBC_DetectionResultRowIndicatorColumn* rowIndicatorColumn, FX_INT32 &e); - static FX_INT32 getMax(CFX_Int32Array& values); + static CBC_DetectionResult* merge(CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn, CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn, int32_t &e); + static CBC_BoundingBox* adjustBoundingBox(CBC_DetectionResultRowIndicatorColumn* rowIndicatorColumn, int32_t &e); + static int32_t getMax(CFX_Int32Array& values); static CBC_BarcodeMetadata* getBarcodeMetadata(CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn, CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn); static CBC_DetectionResultRowIndicatorColumn* getRowIndicatorColumn(CBC_CommonBitMatrix* image, CBC_BoundingBox* boundingBox, CBC_ResultPoint startPoint, - FX_BOOL leftToRight, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth); - static void adjustCodewordCount(CBC_DetectionResult* detectionResult, CFX_PtrArray* barcodeMatrix, FX_INT32 &e); - static CBC_CommonDecoderResult* createDecoderResult(CBC_DetectionResult* detectionResult, FX_INT32 &e); - static CBC_CommonDecoderResult* createDecoderResultFromAmbiguousValues(FX_INT32 ecLevel, CFX_Int32Array &codewords, CFX_Int32Array &erasureArray, CFX_Int32Array &ambiguousIndexes, - CFX_PtrArray& ambiguousIndexValues, FX_INT32 &e); + FX_BOOL leftToRight, int32_t minCodewordWidth, int32_t maxCodewordWidth); + static void adjustCodewordCount(CBC_DetectionResult* detectionResult, CFX_PtrArray* barcodeMatrix, int32_t &e); + static CBC_CommonDecoderResult* createDecoderResult(CBC_DetectionResult* detectionResult, int32_t &e); + static CBC_CommonDecoderResult* createDecoderResultFromAmbiguousValues(int32_t ecLevel, CFX_Int32Array &codewords, CFX_Int32Array &erasureArray, CFX_Int32Array &ambiguousIndexes, + CFX_PtrArray& ambiguousIndexValues, int32_t &e); static CFX_PtrArray* createBarcodeMatrix(CBC_DetectionResult* detectionResult); - static FX_BOOL isValidBarcodeColumn(CBC_DetectionResult* detectionResult, FX_INT32 barcodeColumn); - static FX_INT32 getStartColumn(CBC_DetectionResult* detectionResult, FX_INT32 barcodeColumn, FX_INT32 imageRow, FX_BOOL leftToRight); - static CBC_Codeword* detectCodeword(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 startColumn, - FX_INT32 imageRow, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth); - static CFX_Int32Array* getModuleBitCount(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 startColumn, FX_INT32 imageRow); - static FX_INT32 getNumberOfECCodeWords(FX_INT32 barcodeECLevel); - static FX_INT32 adjustCodewordStartColumn(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 codewordStartColumn, FX_INT32 imageRow); - static FX_BOOL checkCodewordSkew(FX_INT32 codewordSize, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth); - static CBC_CommonDecoderResult* decodeCodewords(CFX_Int32Array &codewords, FX_INT32 ecLevel, CFX_Int32Array &erasures, FX_INT32 &e); - static FX_INT32 correctErrors(CFX_Int32Array &codewords, CFX_Int32Array &erasures, FX_INT32 numECCodewords, FX_INT32 &e); - static void verifyCodewordCount(CFX_Int32Array &codewords, FX_INT32 numECCodewords, FX_INT32 &e); - static CFX_Int32Array* getBitCountForCodeword(FX_INT32 codeword); - static FX_INT32 getCodewordBucketNumber(FX_INT32 codeword); - static FX_INT32 getCodewordBucketNumber(CFX_Int32Array& moduleBitCount); + static FX_BOOL isValidBarcodeColumn(CBC_DetectionResult* detectionResult, int32_t barcodeColumn); + static int32_t getStartColumn(CBC_DetectionResult* detectionResult, int32_t barcodeColumn, int32_t imageRow, FX_BOOL leftToRight); + static CBC_Codeword* detectCodeword(CBC_CommonBitMatrix* image, int32_t minColumn, int32_t maxColumn, FX_BOOL leftToRight, int32_t startColumn, + int32_t imageRow, int32_t minCodewordWidth, int32_t maxCodewordWidth); + static CFX_Int32Array* getModuleBitCount(CBC_CommonBitMatrix* image, int32_t minColumn, int32_t maxColumn, FX_BOOL leftToRight, int32_t startColumn, int32_t imageRow); + static int32_t getNumberOfECCodeWords(int32_t barcodeECLevel); + static int32_t adjustCodewordStartColumn(CBC_CommonBitMatrix* image, int32_t minColumn, int32_t maxColumn, FX_BOOL leftToRight, int32_t codewordStartColumn, int32_t imageRow); + static FX_BOOL checkCodewordSkew(int32_t codewordSize, int32_t minCodewordWidth, int32_t maxCodewordWidth); + static CBC_CommonDecoderResult* decodeCodewords(CFX_Int32Array &codewords, int32_t ecLevel, CFX_Int32Array &erasures, int32_t &e); + static int32_t correctErrors(CFX_Int32Array &codewords, CFX_Int32Array &erasures, int32_t numECCodewords, int32_t &e); + static void verifyCodewordCount(CFX_Int32Array &codewords, int32_t numECCodewords, int32_t &e); + static CFX_Int32Array* getBitCountForCodeword(int32_t codeword); + static int32_t getCodewordBucketNumber(int32_t codeword); + static int32_t getCodewordBucketNumber(CFX_Int32Array& moduleBitCount); }; #endif diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp index 86951c91e9..5154b2e231 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp @@ -36,7 +36,7 @@ CBC_PDF417Writer::~CBC_PDF417Writer() { m_bTruncated = TRUE; } -FX_BOOL CBC_PDF417Writer:: SetErrorCorrectionLevel(FX_INT32 level) +FX_BOOL CBC_PDF417Writer:: SetErrorCorrectionLevel(int32_t level) { if (level < 0 || level > 8) { return FALSE; @@ -48,7 +48,7 @@ void CBC_PDF417Writer::SetTruncated(FX_BOOL truncated) { m_bTruncated = truncated; } -FX_BYTE* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e) { if ( format != BCFORMAT_PDF_417) { return NULL; @@ -56,15 +56,15 @@ FX_BYTE* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT forma CFX_WideString encodeContents = contents.UTF8Decode(); return Encode(encodeContents, outWidth, outHeight, e ); } -FX_BYTE* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) +uint8_t* CBC_PDF417Writer::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) { return NULL; } -FX_BYTE* CBC_PDF417Writer::Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t* CBC_PDF417Writer::Encode(const CFX_WideString &contents, int32_t &outWidth, int32_t &outHeight, int32_t &e) { CBC_PDF417 encoder; - FX_INT32 col = (m_Width / m_ModuleWidth - 69) / 17; - FX_INT32 row = m_Height / (m_ModuleWidth * 20); + int32_t col = (m_Width / m_ModuleWidth - 69) / 17; + int32_t row = m_Height / (m_ModuleWidth * 20); if (row >= 3 && row <= 90 && col >= 1 && col <= 30) { encoder.setDimensions(col, col, row, row); } else if (col >= 1 && col <= 30) { @@ -74,26 +74,26 @@ FX_BYTE* CBC_PDF417Writer::Encode(const CFX_WideString &contents, FX_INT32 &outW } encoder.generateBarcodeLogic(contents, m_iCorrectLevel, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 lineThickness = 2; - FX_INT32 aspectRatio = 4; + int32_t lineThickness = 2; + int32_t aspectRatio = 4; CBC_BarcodeMatrix* barcodeMatrix = encoder.getBarcodeMatrix(); CFX_ByteArray originalScale; originalScale.Copy(barcodeMatrix->getScaledMatrix(lineThickness, aspectRatio * lineThickness)); - FX_INT32 width = outWidth; - FX_INT32 height = outHeight; + int32_t width = outWidth; + int32_t height = outHeight; outWidth = barcodeMatrix->getWidth(); outHeight = barcodeMatrix->getHeight(); FX_BOOL rotated = FALSE; if ((height > width) ^ (outWidth < outHeight)) { rotateArray(originalScale, outHeight, outWidth); rotated = TRUE; - FX_INT32 temp = outHeight; + int32_t temp = outHeight; outHeight = outWidth; outWidth = temp; } - FX_INT32 scaleX = width / outWidth; - FX_INT32 scaleY = height / outHeight; - FX_INT32 scale; + int32_t scaleX = width / outWidth; + int32_t scaleY = height / outHeight; + int32_t scale; if (scaleX < scaleY) { scale = scaleX; } else { @@ -104,22 +104,22 @@ FX_BYTE* CBC_PDF417Writer::Encode(const CFX_WideString &contents, FX_INT32 &outW originalScale.Copy(barcodeMatrix->getScaledMatrix(scale * lineThickness, scale * aspectRatio * lineThickness)); if (rotated) { rotateArray(originalScale, outHeight, outWidth); - FX_INT32 temp = outHeight; + int32_t temp = outHeight; outHeight = outWidth; outWidth = temp; } } - FX_BYTE* result = (FX_BYTE*)FX_Alloc(FX_BYTE, outHeight * outWidth); + uint8_t* result = (uint8_t*)FX_Alloc(uint8_t, outHeight * outWidth); FXSYS_memcpy32(result, originalScale.GetData(), outHeight * outWidth); return result; } -void CBC_PDF417Writer::rotateArray(CFX_ByteArray& bitarray, FX_INT32 height, FX_INT32 width) +void CBC_PDF417Writer::rotateArray(CFX_ByteArray& bitarray, int32_t height, int32_t width) { CFX_ByteArray temp; temp.Copy(bitarray); - for (FX_INT32 ii = 0; ii < height; ii++) { - FX_INT32 inverseii = height - ii - 1; - for (FX_INT32 jj = 0; jj < width; jj++) { + for (int32_t ii = 0; ii < height; ii++) { + int32_t inverseii = height - ii - 1; + for (int32_t jj = 0; jj < width; jj++) { bitarray[jj * height + inverseii] = temp[ii * width + jj]; } } diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h b/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h index 5d974f9377..e44959f4ff 100644 --- a/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h +++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h @@ -13,14 +13,14 @@ class CBC_PDF417Writer : public CBC_TwoDimWriter public: CBC_PDF417Writer(); virtual ~CBC_PDF417Writer(); - FX_BYTE * Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); + uint8_t * Encode(const CFX_WideString &contents, int32_t &outWidth, int32_t &outHeight, int32_t &e); - FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e); - FX_BOOL SetErrorCorrectionLevel(FX_INT32 level); + uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e); + uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e); + FX_BOOL SetErrorCorrectionLevel(int32_t level); void SetTruncated(FX_BOOL truncated); private: - void rotateArray(CFX_ByteArray& bitarray, FX_INT32 width, FX_INT32 height); + void rotateArray(CFX_ByteArray& bitarray, int32_t width, int32_t height); FX_BOOL m_bTruncated; }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp index 669a0fbf7e..fa75cd8995 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp @@ -26,10 +26,10 @@ #include "BC_QRAlignmentPattern.h" #include "BC_QRAlignmentPatternFinder.h" CBC_QRAlignmentPatternFinder::CBC_QRAlignmentPatternFinder(CBC_CommonBitMatrix *image, - FX_INT32 startX, - FX_INT32 startY, - FX_INT32 width, - FX_INT32 height, + int32_t startX, + int32_t startY, + int32_t width, + int32_t height, FX_FLOAT moduleSize): m_image(image), m_startX(startX), m_startY(startY), @@ -42,29 +42,29 @@ CBC_QRAlignmentPatternFinder::CBC_QRAlignmentPatternFinder(CBC_CommonBitMatrix * } CBC_QRAlignmentPatternFinder::~CBC_QRAlignmentPatternFinder() { - for (FX_INT32 i = 0; i < m_possibleCenters.GetSize(); i++) { + for (int32_t i = 0; i < m_possibleCenters.GetSize(); i++) { delete (CBC_QRAlignmentPattern*)m_possibleCenters[i]; } m_possibleCenters.RemoveAll(); } -CBC_QRAlignmentPattern *CBC_QRAlignmentPatternFinder::Find(FX_INT32 &e) +CBC_QRAlignmentPattern *CBC_QRAlignmentPatternFinder::Find(int32_t &e) { - FX_INT32 startX = m_startX; - FX_INT32 height = m_height; - FX_INT32 maxJ = startX + m_width; - FX_INT32 middleI = m_startY + (height >> 1); + int32_t startX = m_startX; + int32_t height = m_height; + int32_t maxJ = startX + m_width; + int32_t middleI = m_startY + (height >> 1); CFX_Int32Array stateCount; stateCount.SetSize(3); - for (FX_INT32 iGen = 0; iGen < height; iGen++) { - FX_INT32 i = middleI + ((iGen & 0x01) == 0 ? ((iGen + 1) >> 1) : -((iGen + 1) >> 1)); + for (int32_t iGen = 0; iGen < height; iGen++) { + int32_t i = middleI + ((iGen & 0x01) == 0 ? ((iGen + 1) >> 1) : -((iGen + 1) >> 1)); stateCount[0] = 0; stateCount[1] = 0; stateCount[2] = 0; - FX_INT32 j = startX; + int32_t j = startX; while (j < maxJ && !m_image->Get(j, i)) { j++; } - FX_INT32 currentState = 0; + int32_t currentState = 0; while (j < maxJ) { if (m_image->Get(j, i)) { if (currentState == 1) { @@ -107,7 +107,7 @@ CBC_QRAlignmentPattern *CBC_QRAlignmentPatternFinder::Find(FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return NULL; } -FX_FLOAT CBC_QRAlignmentPatternFinder::CenterFromEnd(const CFX_Int32Array &stateCount, FX_INT32 end) +FX_FLOAT CBC_QRAlignmentPatternFinder::CenterFromEnd(const CFX_Int32Array &stateCount, int32_t end) { return (FX_FLOAT) (end - stateCount[2]) - stateCount[1] / 2.0f; } @@ -115,23 +115,23 @@ FX_BOOL CBC_QRAlignmentPatternFinder::FoundPatternCross(const CFX_Int32Array &st { FX_FLOAT moduleSize = m_moduleSize; FX_FLOAT maxVariance = moduleSize / 2.0f; - for (FX_INT32 i = 0; i < 3; i++) { + for (int32_t i = 0; i < 3; i++) { if (fabs(moduleSize - stateCount[i]) >= maxVariance) { return false; } } return TRUE; } -FX_FLOAT CBC_QRAlignmentPatternFinder::CrossCheckVertical(FX_INT32 startI, FX_INT32 centerJ, FX_INT32 maxCount, FX_INT32 originalStateCountTotal) +FX_FLOAT CBC_QRAlignmentPatternFinder::CrossCheckVertical(int32_t startI, int32_t centerJ, int32_t maxCount, int32_t originalStateCountTotal) { CBC_CommonBitMatrix *image = m_image; - FX_INT32 maxI = m_image->GetHeight(); + int32_t maxI = m_image->GetHeight(); CFX_Int32Array stateCount; stateCount.Copy(m_crossCheckStateCount); stateCount[0] = 0; stateCount[1] = 0; stateCount[2] = 0; - FX_INT32 i = startI; + int32_t i = startI; while (i >= 0 && m_image->Get(centerJ, i) && stateCount[1] <= maxCount) { stateCount[1]++; i--; @@ -161,21 +161,21 @@ FX_FLOAT CBC_QRAlignmentPatternFinder::CrossCheckVertical(FX_INT32 startI, FX_IN if (stateCount[2] > maxCount) { return FXSYS_nan(); } - FX_INT32 stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2]; + int32_t stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2]; if (5 * abs(stateCountTotal - originalStateCountTotal) >= originalStateCountTotal) { return FXSYS_nan(); } return FoundPatternCross(stateCount) ? CenterFromEnd(stateCount, i) : FXSYS_nan(); } -CBC_QRAlignmentPattern *CBC_QRAlignmentPatternFinder::HandlePossibleCenter(const CFX_Int32Array &stateCount, FX_INT32 i, FX_INT32 j) +CBC_QRAlignmentPattern *CBC_QRAlignmentPatternFinder::HandlePossibleCenter(const CFX_Int32Array &stateCount, int32_t i, int32_t j) { - FX_INT32 stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2]; + int32_t stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2]; FX_FLOAT centerJ = CenterFromEnd(stateCount, j); - FX_FLOAT centerI = CrossCheckVertical(i, (FX_INT32) centerJ, 2 * stateCount[1], stateCountTotal); + FX_FLOAT centerI = CrossCheckVertical(i, (int32_t) centerJ, 2 * stateCount[1], stateCountTotal); if (!FXSYS_isnan(centerI)) { FX_FLOAT estimatedModuleSize = (FX_FLOAT) (stateCount[0] + stateCount[1] + stateCount[2]) / 3.0f; - FX_INT32 max = m_possibleCenters.GetSize(); - for (FX_INT32 index = 0; index < max; index++) { + int32_t max = m_possibleCenters.GetSize(); + for (int32_t index = 0; index < max; index++) { CBC_QRAlignmentPattern *center = (CBC_QRAlignmentPattern *)(m_possibleCenters[index]); if (center->AboutEquals(estimatedModuleSize, centerI, centerJ)) { return FX_NEW CBC_QRAlignmentPattern(centerJ, centerI, estimatedModuleSize); diff --git a/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h b/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h index c1d224a8eb..b16517ede2 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h @@ -13,19 +13,19 @@ class CBC_QRAlignmentPatternFinder private: CBC_CommonBitMatrix *m_image; CFX_PtrArray m_possibleCenters; - FX_INT32 m_startX; - FX_INT32 m_startY; - FX_INT32 m_width; - FX_INT32 m_height; + int32_t m_startX; + int32_t m_startY; + int32_t m_width; + int32_t m_height; FX_FLOAT m_moduleSize; CFX_Int32Array m_crossCheckStateCount; public: - CBC_QRAlignmentPatternFinder(CBC_CommonBitMatrix *image, FX_INT32 startX, FX_INT32 startY, FX_INT32 width, FX_INT32 height, FX_FLOAT moduleSize); + CBC_QRAlignmentPatternFinder(CBC_CommonBitMatrix *image, int32_t startX, int32_t startY, int32_t width, int32_t height, FX_FLOAT moduleSize); virtual ~CBC_QRAlignmentPatternFinder(); FX_BOOL FoundPatternCross(const CFX_Int32Array &stateCount); - FX_FLOAT CrossCheckVertical(FX_INT32 startI, FX_INT32 startJ, FX_INT32 maxCount, FX_INT32 originalStateCountTotal); - CBC_QRAlignmentPattern* Find(FX_INT32 &e); - CBC_QRAlignmentPattern *HandlePossibleCenter(const CFX_Int32Array &stateCount, FX_INT32 i, FX_INT32 j); - static FX_FLOAT CenterFromEnd(const CFX_Int32Array &stateCount, FX_INT32 end); + FX_FLOAT CrossCheckVertical(int32_t startI, int32_t startJ, int32_t maxCount, int32_t originalStateCountTotal); + CBC_QRAlignmentPattern* Find(int32_t &e); + CBC_QRAlignmentPattern *HandlePossibleCenter(const CFX_Int32Array &stateCount, int32_t i, int32_t j); + static FX_FLOAT CenterFromEnd(const CFX_Int32Array &stateCount, int32_t end); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp index 7c85c58367..ba5662bb4e 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp @@ -29,7 +29,7 @@ CBC_QRBitMatrixParser::CBC_QRBitMatrixParser() { } -void CBC_QRBitMatrixParser::Init(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e) +void CBC_QRBitMatrixParser::Init(CBC_CommonBitMatrix *bitMatrix, int32_t &e) { m_dimension = bitMatrix->GetDimension(e); BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -50,34 +50,34 @@ CBC_QRBitMatrixParser::~CBC_QRBitMatrixParser() } m_version = NULL; } -CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(FX_INT32 &e) +CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(int32_t &e) { if(m_parsedFormatInfo != NULL) { return m_parsedFormatInfo; } - FX_INT32 formatInfoBits = 0; - FX_INT32 j; + int32_t formatInfoBits = 0; + int32_t j; for( j = 0; j < 6; j++) { formatInfoBits = CopyBit(8, j, formatInfoBits); } formatInfoBits = CopyBit(8, 7, formatInfoBits); formatInfoBits = CopyBit(8, 8, formatInfoBits); formatInfoBits = CopyBit(7, 8, formatInfoBits); - for(FX_INT32 i = 5; i >= 0; i--) { + for(int32_t i = 5; i >= 0; i--) { formatInfoBits = CopyBit(i, 8, formatInfoBits); } m_parsedFormatInfo = CBC_QRCoderFormatInformation::DecodeFormatInformation(formatInfoBits); if(m_parsedFormatInfo != NULL) { return m_parsedFormatInfo; } - FX_INT32 dimension = m_bitMatrix->GetDimension(e); + int32_t dimension = m_bitMatrix->GetDimension(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); formatInfoBits = 0; - FX_INT32 iMin = dimension - 8; + int32_t iMin = dimension - 8; for(j = dimension - 1; j >= iMin; j--) { formatInfoBits = CopyBit(j, 8, formatInfoBits); } - for(FX_INT32 k = dimension - 7; k < dimension; k++) { + for(int32_t k = dimension - 7; k < dimension; k++) { formatInfoBits = CopyBit(8, k , formatInfoBits); } m_parsedFormatInfo = CBC_QRCoderFormatInformation::DecodeFormatInformation(formatInfoBits); @@ -88,23 +88,23 @@ CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(FX_IN BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return NULL; } -CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(FX_INT32 &e) +CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(int32_t &e) { if(m_version != NULL) { return m_version; } - FX_INT32 dimension = m_bitMatrix->GetDimension(e); + int32_t dimension = m_bitMatrix->GetDimension(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 provisionVersion = (dimension - 17) >> 2; + int32_t provisionVersion = (dimension - 17) >> 2; if(provisionVersion <= 6) { CBC_QRCoderVersion* qrv = CBC_QRCoderVersion::GetVersionForNumber(provisionVersion, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return qrv; } - FX_INT32 versionBits = 0; - for (FX_INT32 i = 5; i >= 0; i--) { - FX_INT32 jMin = dimension - 11; - for (FX_INT32 j = dimension - 9; j >= jMin; j--) { + int32_t versionBits = 0; + for (int32_t i = 5; i >= 0; i--) { + int32_t jMin = dimension - 11; + for (int32_t j = dimension - 9; j >= jMin; j--) { versionBits = CopyBit(i, j, versionBits); } } @@ -114,9 +114,9 @@ CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(FX_INT32 &e) return m_version; } versionBits = 0; - for (FX_INT32 j = 5; j >= 0; j--) { - FX_INT32 iMin = dimension - 11; - for (FX_INT32 i = dimension - 9; i >= iMin; i--) { + for (int32_t j = 5; j >= 0; j--) { + int32_t iMin = dimension - 11; + for (int32_t i = dimension - 9; i >= iMin; i--) { versionBits = CopyBit(i, j, versionBits); } } @@ -129,19 +129,19 @@ CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return NULL; } -FX_INT32 CBC_QRBitMatrixParser::CopyBit(FX_INT32 i, FX_INT32 j, FX_INT32 versionBits) +int32_t CBC_QRBitMatrixParser::CopyBit(int32_t i, int32_t j, int32_t versionBits) { return m_bitMatrix->Get(j, i) ? (versionBits << 1) | 0x1 : versionBits << 1; } -CFX_ByteArray* CBC_QRBitMatrixParser::ReadCodewords(FX_INT32 &e) +CFX_ByteArray* CBC_QRBitMatrixParser::ReadCodewords(int32_t &e) { CBC_QRCoderFormatInformation *formatInfo = ReadFormatInformation(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL) CBC_QRCoderVersion *version = ReadVersion(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - CBC_QRDataMask *dataMask = CBC_QRDataMask::ForReference((FX_INT32)(formatInfo->GetDataMask()), e); + CBC_QRDataMask *dataMask = CBC_QRDataMask::ForReference((int32_t)(formatInfo->GetDataMask()), e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 dimension = m_bitMatrix->GetDimension(e); + int32_t dimension = m_bitMatrix->GetDimension(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); dataMask->UnmaskBitMatirx(m_bitMatrix, dimension); CBC_CommonBitMatrix* cbm = version->BuildFunctionPattern(e); @@ -151,16 +151,16 @@ CFX_ByteArray* CBC_QRBitMatrixParser::ReadCodewords(FX_INT32 &e) CFX_ByteArray * temp = FX_NEW CFX_ByteArray; temp->SetSize(version->GetTotalCodeWords()); CBC_AutoPtr result(temp); - FX_INT32 resultOffset = 0; - FX_INT32 currentByte = 0; - FX_INT32 bitsRead = 0; - for(FX_INT32 j = dimension - 1; j > 0; j -= 2) { + int32_t resultOffset = 0; + int32_t currentByte = 0; + int32_t bitsRead = 0; + for(int32_t j = dimension - 1; j > 0; j -= 2) { if(j == 6) { j--; } - for(FX_INT32 count = 0; count < dimension; count++) { - FX_INT32 i = readingUp ? dimension - 1 - count : count; - for(FX_INT32 col = 0; col < 2; col++) { + for(int32_t count = 0; count < dimension; count++) { + int32_t i = readingUp ? dimension - 1 - count : count; + for(int32_t col = 0; col < 2; col++) { if(!functionPattern->Get(j - col, i)) { bitsRead++; currentByte <<= 1; @@ -168,7 +168,7 @@ CFX_ByteArray* CBC_QRBitMatrixParser::ReadCodewords(FX_INT32 &e) currentByte |= 1; } if(bitsRead == 8) { - (*result)[resultOffset++] = (FX_BYTE) currentByte; + (*result)[resultOffset++] = (uint8_t) currentByte; bitsRead = 0; currentByte = 0; } diff --git a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h index 0189ba7c81..6f378fff95 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h @@ -17,14 +17,14 @@ private: CBC_CommonBitMatrix *m_tempBitMatrix; CBC_QRCoderVersion *m_version; CBC_QRCoderFormatInformation *m_parsedFormatInfo; - FX_INT32 m_dimension; + int32_t m_dimension; public: CBC_QRBitMatrixParser(); virtual ~CBC_QRBitMatrixParser(); - CBC_QRCoderFormatInformation *ReadFormatInformation(FX_INT32 &e); - CBC_QRCoderVersion *ReadVersion(FX_INT32 &e); - FX_INT32 CopyBit(FX_INT32 i, FX_INT32 j, FX_INT32 versionBits); - CFX_ByteArray *ReadCodewords(FX_INT32 &e); - virtual void Init(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e); + CBC_QRCoderFormatInformation *ReadFormatInformation(int32_t &e); + CBC_QRCoderVersion *ReadVersion(int32_t &e); + int32_t CopyBit(int32_t i, int32_t j, int32_t versionBits); + CFX_ByteArray *ReadCodewords(int32_t &e); + virtual void Init(CBC_CommonBitMatrix *bitMatrix, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp index f12c4e0ad3..ab28f3434d 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp @@ -55,7 +55,7 @@ CBC_QRCodeReader::~CBC_QRCodeReader() } m_decoder = NULL; } -CFX_ByteString CBC_QRCodeReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_QRCodeReader::Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e) { CBC_CommonBitMatrix *matrix = image->GetMatrix(e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); @@ -68,7 +68,7 @@ CFX_ByteString CBC_QRCodeReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, CBC_AutoPtr decodeResult(qdr2); return (decodeResult->GetText()); } -CFX_ByteString CBC_QRCodeReader::Decode(const CFX_WideString &filename, FX_INT32 hints, FX_INT32 byteModeDecode, FX_INT32 &e) +CFX_ByteString CBC_QRCodeReader::Decode(const CFX_WideString &filename, int32_t hints, int32_t byteModeDecode, int32_t &e) { CBC_BufferedImageLuminanceSource source(filename); source.Init(e); @@ -79,7 +79,7 @@ CFX_ByteString CBC_QRCodeReader::Decode(const CFX_WideString &filename, FX_INT32 BC_EXCEPTION_CHECK_ReturnValue(e, ""); return bs; } -CFX_ByteString CBC_QRCodeReader::Decode(CFX_DIBitmap *pBitmap, FX_INT32 hints, FX_INT32 byteModeDecode, FX_INT32 &e) +CFX_ByteString CBC_QRCodeReader::Decode(CFX_DIBitmap *pBitmap, int32_t hints, int32_t byteModeDecode, int32_t &e) { CBC_BufferedImageLuminanceSource source(pBitmap); CBC_GlobalHistogramBinarizer binarizer(&source); @@ -88,7 +88,7 @@ CFX_ByteString CBC_QRCodeReader::Decode(CFX_DIBitmap *pBitmap, FX_INT32 hints, F BC_EXCEPTION_CHECK_ReturnValue(e, ""); return bs; } -CFX_ByteString CBC_QRCodeReader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e) +CFX_ByteString CBC_QRCodeReader::Decode(CBC_BinaryBitmap *image, int32_t &e) { CFX_ByteString bs = Decode(image, 0, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h b/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h index 71a1ad3dd6..73b83d390e 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h @@ -25,11 +25,11 @@ private: public: CBC_QRCodeReader(); virtual ~CBC_QRCodeReader(); - CFX_ByteString Decode(CFX_DIBitmap *pBitmap, FX_INT32 hints, FX_INT32 byteModeDecode, FX_INT32 &e); - CFX_ByteString Decode(const CFX_WideString &filename, FX_INT32 hints, FX_INT32 byteModeDecode, FX_INT32 &e); + CFX_ByteString Decode(CFX_DIBitmap *pBitmap, int32_t hints, int32_t byteModeDecode, int32_t &e); + CFX_ByteString Decode(const CFX_WideString &filename, int32_t hints, int32_t byteModeDecode, int32_t &e); static void ReleaseAll(); - CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e); - CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e); + CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e); + CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e); virtual void Init(); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.cpp index ccc0220d6c..37d0277bec 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.cpp @@ -42,7 +42,7 @@ void CBC_QRCodeWriter::ReleaseAll() { CBC_QRCodeReader::ReleaseAll(); } -FX_BOOL CBC_QRCodeWriter::SetVersion(FX_INT32 version) +FX_BOOL CBC_QRCodeWriter::SetVersion(int32_t version) { if (version < 0 || version > 40) { return FALSE; @@ -50,7 +50,7 @@ FX_BOOL CBC_QRCodeWriter::SetVersion(FX_INT32 version) m_iVersion = version; return TRUE; } -FX_BOOL CBC_QRCodeWriter::SetErrorCorrectionLevel(FX_INT32 level) +FX_BOOL CBC_QRCodeWriter::SetErrorCorrectionLevel(int32_t level) { if (level < 0 || level > 3) { return FALSE; @@ -58,7 +58,7 @@ FX_BOOL CBC_QRCodeWriter::SetErrorCorrectionLevel(FX_INT32 level) m_iCorrectLevel = level; return TRUE; } -FX_BYTE* CBC_QRCodeWriter::Encode(const CFX_WideString& contents, FX_INT32 ecLevel, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t* CBC_QRCodeWriter::Encode(const CFX_WideString& contents, int32_t ecLevel, int32_t &outWidth, int32_t &outHeight, int32_t &e) { CBC_QRCoderErrorCorrectionLevel *ec = NULL; switch(ecLevel) { @@ -89,15 +89,15 @@ FX_BYTE* CBC_QRCodeWriter::Encode(const CFX_WideString& contents, FX_INT32 ecLev BC_EXCEPTION_CHECK_ReturnValue(e, NULL); outWidth = qr.GetMatrixWidth(); outHeight = qr.GetMatrixWidth(); - FX_BYTE* result = FX_Alloc(FX_BYTE, outWidth * outWidth); + uint8_t* result = FX_Alloc(uint8_t, outWidth * outWidth); FXSYS_memcpy32(result, qr.GetMatrix()->GetArray(), outWidth * outHeight); return result; } -FX_BYTE *CBC_QRCodeWriter::Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) +uint8_t *CBC_QRCodeWriter::Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) { return NULL; } -FX_BYTE* CBC_QRCodeWriter::Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t* CBC_QRCodeWriter::Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e) { return NULL; } diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.h b/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.h index bf0ca71996..7cfd978c47 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.h @@ -15,14 +15,14 @@ class CBC_QRCodeWriter : public CBC_TwoDimWriter public: CBC_QRCodeWriter(); virtual ~CBC_QRCodeWriter(); - FX_BYTE* Encode(const CFX_WideString& contents, FX_INT32 ecLevel, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e); - FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BOOL SetVersion(FX_INT32 version); - FX_BOOL SetErrorCorrectionLevel(FX_INT32 level); + uint8_t* Encode(const CFX_WideString& contents, int32_t ecLevel, int32_t &outWidth, int32_t &outHeight, int32_t &e); + uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e); + uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e); + FX_BOOL SetVersion(int32_t version); + FX_BOOL SetErrorCorrectionLevel(int32_t level); static void ReleaseAll(); private: - FX_INT32 m_iVersion; + int32_t m_iVersion; }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp index f650f83b48..1f642016e2 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp @@ -62,31 +62,31 @@ CBC_QRCoderErrorCorrectionLevel* CBC_QRCoder::GetECLevel() { return m_ecLevel; } -FX_INT32 CBC_QRCoder::GetVersion() +int32_t CBC_QRCoder::GetVersion() { return m_version; } -FX_INT32 CBC_QRCoder::GetMatrixWidth() +int32_t CBC_QRCoder::GetMatrixWidth() { return m_matrixWidth; } -FX_INT32 CBC_QRCoder::GetMaskPattern() +int32_t CBC_QRCoder::GetMaskPattern() { return m_maskPattern; } -FX_INT32 CBC_QRCoder::GetNumTotalBytes() +int32_t CBC_QRCoder::GetNumTotalBytes() { return m_numTotalBytes; } -FX_INT32 CBC_QRCoder::GetNumDataBytes() +int32_t CBC_QRCoder::GetNumDataBytes() { return m_numDataBytes; } -FX_INT32 CBC_QRCoder::GetNumECBytes() +int32_t CBC_QRCoder::GetNumECBytes() { return m_numECBytes; } -FX_INT32 CBC_QRCoder::GetNumRSBlocks() +int32_t CBC_QRCoder::GetNumRSBlocks() { return m_numRSBlocks; } @@ -94,9 +94,9 @@ CBC_CommonByteMatrix* CBC_QRCoder::GetMatrix() { return m_matrix; } -FX_INT32 CBC_QRCoder::At(FX_INT32 x, FX_INT32 y, FX_INT32 &e) +int32_t CBC_QRCoder::At(int32_t x, int32_t y, int32_t &e) { - FX_INT32 value = m_matrix->Get(x, y); + int32_t value = m_matrix->Get(x, y); if(!(value == 0 || value == 1)) { e = BCExceptionValueMustBeEither0or1; BC_EXCEPTION_CHECK_ReturnValue(e, 0); @@ -129,35 +129,35 @@ void CBC_QRCoder::SetECLevel(CBC_QRCoderErrorCorrectionLevel* ecLevel) { m_ecLevel = ecLevel; } -void CBC_QRCoder::SetVersion(FX_INT32 version) +void CBC_QRCoder::SetVersion(int32_t version) { m_version = version; } -void CBC_QRCoder::SetMatrixWidth(FX_INT32 width) +void CBC_QRCoder::SetMatrixWidth(int32_t width) { m_matrixWidth = width; } -void CBC_QRCoder::SetMaskPattern(FX_INT32 pattern) +void CBC_QRCoder::SetMaskPattern(int32_t pattern) { m_maskPattern = pattern; } -void CBC_QRCoder::SetNumDataBytes(FX_INT32 bytes) +void CBC_QRCoder::SetNumDataBytes(int32_t bytes) { m_numDataBytes = bytes; } -void CBC_QRCoder::SetNumTotalBytes(FX_INT32 value) +void CBC_QRCoder::SetNumTotalBytes(int32_t value) { m_numTotalBytes = value; } -void CBC_QRCoder::SetNumRSBlocks(FX_INT32 block) +void CBC_QRCoder::SetNumRSBlocks(int32_t block) { m_numRSBlocks = block; } -void CBC_QRCoder::SetNumECBytes(FX_INT32 value) +void CBC_QRCoder::SetNumECBytes(int32_t value) { m_numECBytes = value; } -FX_BOOL CBC_QRCoder::IsValidMaskPattern(FX_INT32 maskPattern) +FX_BOOL CBC_QRCoder::IsValidMaskPattern(int32_t maskPattern) { return maskPattern >= 0 && maskPattern < NUM_MASK_PATTERNS; } @@ -165,4 +165,4 @@ void CBC_QRCoder::SetMatrix(CBC_CommonByteMatrix* value) { m_matrix = value; } -const FX_INT32 CBC_QRCoder::NUM_MASK_PATTERNS = 8; +const int32_t CBC_QRCoder::NUM_MASK_PATTERNS = 8; diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoder.h b/xfa/src/fxbarcode/qrcode/BC_QRCoder.h index 3c24dc2bc9..72db2fe487 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoder.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoder.h @@ -15,41 +15,41 @@ class CBC_QRCoder private: CBC_QRCoderMode* m_mode; CBC_QRCoderErrorCorrectionLevel* m_ecLevel; - FX_INT32 m_version; - FX_INT32 m_matrixWidth; - FX_INT32 m_maskPattern; - FX_INT32 m_numTotalBytes; - FX_INT32 m_numDataBytes; - FX_INT32 m_numECBytes; - FX_INT32 m_numRSBlocks; + int32_t m_version; + int32_t m_matrixWidth; + int32_t m_maskPattern; + int32_t m_numTotalBytes; + int32_t m_numDataBytes; + int32_t m_numECBytes; + int32_t m_numRSBlocks; CBC_CommonByteMatrix* m_matrix; public: - const static FX_INT32 NUM_MASK_PATTERNS; + const static int32_t NUM_MASK_PATTERNS; CBC_QRCoder(); virtual ~CBC_QRCoder(); CBC_QRCoderMode* GetMode(); CBC_QRCoderErrorCorrectionLevel* GetECLevel(); - FX_INT32 GetVersion(); - FX_INT32 GetMatrixWidth(); - FX_INT32 GetMaskPattern(); - FX_INT32 GetNumTotalBytes(); - FX_INT32 GetNumDataBytes(); - FX_INT32 GetNumECBytes(); - FX_INT32 GetNumRSBlocks(); + int32_t GetVersion(); + int32_t GetMatrixWidth(); + int32_t GetMaskPattern(); + int32_t GetNumTotalBytes(); + int32_t GetNumDataBytes(); + int32_t GetNumECBytes(); + int32_t GetNumRSBlocks(); CBC_CommonByteMatrix* GetMatrix(); - FX_INT32 At(FX_INT32 x, FX_INT32 y, FX_INT32 &e); + int32_t At(int32_t x, int32_t y, int32_t &e); FX_BOOL IsValid(); void SetMode(CBC_QRCoderMode* value); void SetECLevel(CBC_QRCoderErrorCorrectionLevel* ecLevel); - void SetVersion(FX_INT32 version); - void SetMatrixWidth(FX_INT32 width); - void SetMaskPattern(FX_INT32 pattern); - void SetNumDataBytes(FX_INT32 bytes); - void SetNumTotalBytes(FX_INT32 value); - void SetNumECBytes(FX_INT32 value); - void SetNumRSBlocks(FX_INT32 block); + void SetVersion(int32_t version); + void SetMatrixWidth(int32_t width); + void SetMaskPattern(int32_t pattern); + void SetNumDataBytes(int32_t bytes); + void SetNumTotalBytes(int32_t value); + void SetNumECBytes(int32_t value); + void SetNumRSBlocks(int32_t block); void SetMatrix(CBC_CommonByteMatrix* value); - static FX_BOOL IsValidMaskPattern(FX_INT32 maskPattern); + static FX_BOOL IsValidMaskPattern(int32_t maskPattern); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp index b7a0a1c3a7..53a5e487a4 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp @@ -29,7 +29,7 @@ CBC_QRCoderBitVector::CBC_QRCoderBitVector() } void CBC_QRCoderBitVector::Init() { - m_array = FX_Alloc(FX_BYTE, m_size); + m_array = FX_Alloc(uint8_t, m_size); } CBC_QRCoderBitVector::~CBC_QRCoderBitVector() { @@ -47,32 +47,32 @@ void CBC_QRCoderBitVector::Clear() } m_sizeInBits = 0; m_size = 32; - m_array = FX_Alloc(FX_BYTE, m_size); + m_array = FX_Alloc(uint8_t, m_size); } -FX_INT32 CBC_QRCoderBitVector::At(FX_INT32 index, FX_INT32 &e) +int32_t CBC_QRCoderBitVector::At(int32_t index, int32_t &e) { if(index < 0 || index >= m_sizeInBits) { e = BCExceptionBadIndexException; BC_EXCEPTION_CHECK_ReturnValue(e, 0); } - FX_INT32 value = m_array[index >> 3] & 0xff; + int32_t value = m_array[index >> 3] & 0xff; return (value >> (7 - (index & 0x7))) & 1; } -FX_INT32 CBC_QRCoderBitVector::sizeInBytes() +int32_t CBC_QRCoderBitVector::sizeInBytes() { return (m_sizeInBits + 7) >> 3; } -FX_INT32 CBC_QRCoderBitVector::Size() +int32_t CBC_QRCoderBitVector::Size() { return m_sizeInBits; } -void CBC_QRCoderBitVector::AppendBit(FX_INT32 bit, FX_INT32 &e) +void CBC_QRCoderBitVector::AppendBit(int32_t bit, int32_t &e) { if(!(bit == 0 || bit == 1)) { e = BCExceptionBadValueException; BC_EXCEPTION_CHECK_ReturnVoid(e); } - FX_INT32 numBitsInLastByte = m_sizeInBits & 0x7; + int32_t numBitsInLastByte = m_sizeInBits & 0x7; if(numBitsInLastByte == 0) { AppendByte(0); m_sizeInBits -= 8; @@ -80,55 +80,55 @@ void CBC_QRCoderBitVector::AppendBit(FX_INT32 bit, FX_INT32 &e) m_array[m_sizeInBits >> 3] |= (bit << (7 - numBitsInLastByte)); ++m_sizeInBits; } -void CBC_QRCoderBitVector::AppendBits(FX_INT32 value, FX_INT32 numBits, FX_INT32 &e) +void CBC_QRCoderBitVector::AppendBits(int32_t value, int32_t numBits, int32_t &e) { if (numBits < 0 || numBits > 32) { e = BCExceptionBadNumBitsException; BC_EXCEPTION_CHECK_ReturnVoid(e); } - FX_INT32 numBitsLeft = numBits; + int32_t numBitsLeft = numBits; while (numBitsLeft > 0) { if ((m_sizeInBits & 0x7) == 0 && numBitsLeft >= 8) { - FX_INT32 newByte = (value >> (numBitsLeft - 8)) & 0xff; + int32_t newByte = (value >> (numBitsLeft - 8)) & 0xff; AppendByte(newByte); numBitsLeft -= 8; } else { - FX_INT32 bit = (value >> (numBitsLeft - 1)) & 1; + int32_t bit = (value >> (numBitsLeft - 1)) & 1; AppendBit(bit, e); BC_EXCEPTION_CHECK_ReturnVoid(e); --numBitsLeft; } } } -void CBC_QRCoderBitVector::AppendBitVector(CBC_QRCoderBitVector *bits, FX_INT32 &e) +void CBC_QRCoderBitVector::AppendBitVector(CBC_QRCoderBitVector *bits, int32_t &e) { - FX_INT32 size = bits->Size(); - for(FX_INT32 i = 0; i < size; i++) { - FX_INT32 num = bits->At(i, e); + int32_t size = bits->Size(); + for(int32_t i = 0; i < size; i++) { + int32_t num = bits->At(i, e); BC_EXCEPTION_CHECK_ReturnVoid(e); AppendBit(num, e); BC_EXCEPTION_CHECK_ReturnVoid(e) } } -void CBC_QRCoderBitVector::XOR(CBC_QRCoderBitVector *other, FX_INT32 &e) +void CBC_QRCoderBitVector::XOR(CBC_QRCoderBitVector *other, int32_t &e) { if(m_sizeInBits != other->Size()) { e = BCExceptioncanNotOperatexorOperator; BC_EXCEPTION_CHECK_ReturnVoid(e); } - FX_INT32 sizeInBytes = (m_sizeInBits + 7) >> 3; - for(FX_INT32 i = 0; i < sizeInBytes; ++i) { + int32_t sizeInBytes = (m_sizeInBits + 7) >> 3; + for(int32_t i = 0; i < sizeInBytes; ++i) { m_array[i] ^= (other->GetArray())[i]; } } -FX_BYTE* CBC_QRCoderBitVector::GetArray() +uint8_t* CBC_QRCoderBitVector::GetArray() { return m_array; } -void CBC_QRCoderBitVector::AppendByte(FX_INT32 value) +void CBC_QRCoderBitVector::AppendByte(int32_t value) { if((m_sizeInBits >> 3) == m_size) { - FX_BYTE* newArray = FX_Alloc(FX_BYTE, m_size << 1); + uint8_t* newArray = FX_Alloc(uint8_t, m_size << 1); FXSYS_memcpy32(newArray, m_array, m_size); if(m_array != NULL) { FX_Free(m_array); @@ -136,6 +136,6 @@ void CBC_QRCoderBitVector::AppendByte(FX_INT32 value) m_array = newArray; m_size = m_size << 1; } - m_array[m_sizeInBits >> 3] = (FX_BYTE) value; + m_array[m_sizeInBits >> 3] = (uint8_t) value; m_sizeInBits += 8; } diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.h index ae73fe8c88..49549ba0d2 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.h @@ -9,22 +9,22 @@ class CBC_QRCoderBitVector { private: - FX_INT32 m_sizeInBits; - FX_BYTE *m_array; - FX_INT32 m_size; + int32_t m_sizeInBits; + uint8_t *m_array; + int32_t m_size; - void AppendByte(FX_INT32 value); + void AppendByte(int32_t value); public: CBC_QRCoderBitVector(); virtual ~CBC_QRCoderBitVector(); - FX_INT32 At(FX_INT32 index, FX_INT32 &e); - FX_INT32 Size(); - FX_INT32 sizeInBytes(); - void AppendBit(FX_INT32 bit, FX_INT32 &e); - void AppendBits(FX_INT32 value, FX_INT32 numBits, FX_INT32 &e); - void AppendBitVector(CBC_QRCoderBitVector *bits, FX_INT32 &e); - void XOR(CBC_QRCoderBitVector *other, FX_INT32 &e); - FX_BYTE* GetArray(); + int32_t At(int32_t index, int32_t &e); + int32_t Size(); + int32_t sizeInBytes(); + void AppendBit(int32_t bit, int32_t &e); + void AppendBits(int32_t value, int32_t numBits, int32_t &e); + void AppendBitVector(CBC_QRCoderBitVector *bits, int32_t &e); + void XOR(CBC_QRCoderBitVector *other, int32_t &e); + uint8_t* GetArray(); void Clear(); virtual void Init(); }; diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp index 6f16db6ad8..e866873d24 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp @@ -47,12 +47,12 @@ CBC_QRCoderDecoder::~CBC_QRCoderDecoder() } m_rsDecoder = NULL; } -CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(FX_BOOL* image, FX_INT32 width, FX_INT32 height, FX_INT32 &e) +CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(FX_BOOL* image, int32_t width, int32_t height, int32_t &e) { CBC_CommonBitMatrix bits; bits.Init(width); - for(FX_INT32 i = 0; i < width; i++) { - for(FX_INT32 j = 0; j < height; j++) { + for(int32_t i = 0; i < width; i++) { + for(int32_t j = 0; j < height; j++) { if(image[i * width + j]) { bits.Set(j, i); } @@ -62,7 +62,7 @@ CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(FX_BOOL* image, FX_INT32 wid BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return cdr; } -CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(CBC_CommonBitMatrix* bits, FX_INT32 byteModeDecode, FX_INT32 &e) +CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(CBC_CommonBitMatrix* bits, int32_t byteModeDecode, int32_t &e) { CBC_QRBitMatrixParser parser; parser.Init(bits, e); @@ -77,19 +77,19 @@ CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(CBC_CommonBitMatrix* bits, F CBC_AutoPtr codewords(ba); CFX_PtrArray *dataBlocks = CBC_QRDataBlock::GetDataBlocks(codewords.get(), version, ecLevel, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 totalBytes = 0; - for (FX_INT32 i = 0; i < dataBlocks->GetSize(); i++) { + int32_t totalBytes = 0; + for (int32_t i = 0; i < dataBlocks->GetSize(); i++) { totalBytes += ((CBC_QRDataBlock*) ((*dataBlocks)[i]))->GetNumDataCodewords(); } CFX_ByteArray resultBytes; - FX_INT32 resultOffset = 0; - for (FX_INT32 j = 0; j < dataBlocks->GetSize(); j++) { + int32_t resultOffset = 0; + for (int32_t j = 0; j < dataBlocks->GetSize(); j++) { CBC_QRDataBlock *dataBlock = (CBC_QRDataBlock *)((*dataBlocks)[j]); CFX_ByteArray* codewordBytes = dataBlock->GetCodewords(); - FX_INT32 numDataCodewords = dataBlock->GetNumDataCodewords(); + int32_t numDataCodewords = dataBlock->GetNumDataCodewords(); CorrectErrors(codewordBytes, numDataCodewords, e); if (e != BCExceptionNO) { - for(FX_INT32 k = 0; k < dataBlocks->GetSize(); k++) { + for(int32_t k = 0; k < dataBlocks->GetSize(); k++) { delete (CBC_QRDataBlock*)(*dataBlocks)[k]; } dataBlocks->RemoveAll(); @@ -97,11 +97,11 @@ CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(CBC_CommonBitMatrix* bits, F dataBlocks = NULL; return NULL; } - for(FX_INT32 i = 0; i < numDataCodewords; i++) { + for(int32_t i = 0; i < numDataCodewords; i++) { resultBytes.Add((*codewordBytes)[i]); } } - for(FX_INT32 k = 0; k < dataBlocks->GetSize(); k++) { + for(int32_t k = 0; k < dataBlocks->GetSize(); k++) { delete (CBC_QRDataBlock*)(*dataBlocks)[k] ; } dataBlocks->RemoveAll(); @@ -111,18 +111,18 @@ CBC_CommonDecoderResult* CBC_QRCoderDecoder::Decode(CBC_CommonBitMatrix* bits, F BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return cdr; } -void CBC_QRCoderDecoder::CorrectErrors(CFX_ByteArray* codewordBytes, FX_INT32 numDataCodewords, FX_INT32 &e) +void CBC_QRCoderDecoder::CorrectErrors(CFX_ByteArray* codewordBytes, int32_t numDataCodewords, int32_t &e) { - FX_INT32 numCodewords = codewordBytes->GetSize(); + int32_t numCodewords = codewordBytes->GetSize(); CFX_Int32Array codewordsInts; codewordsInts.SetSize(numCodewords); - for(FX_INT32 i = 0; i < numCodewords; i++) { - codewordsInts[i] = (FX_INT32)((*codewordBytes)[i] & 0xff); + for(int32_t i = 0; i < numCodewords; i++) { + codewordsInts[i] = (int32_t)((*codewordBytes)[i] & 0xff); } - FX_INT32 numECCodewords = codewordBytes->GetSize() - numDataCodewords; + int32_t numECCodewords = codewordBytes->GetSize() - numDataCodewords; m_rsDecoder->Decode(&codewordsInts, numECCodewords, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - for(FX_INT32 k = 0; k < numDataCodewords; k++) { - (*codewordBytes)[k] = (FX_BYTE) codewordsInts[k]; + for(int32_t k = 0; k < numDataCodewords; k++) { + (*codewordBytes)[k] = (uint8_t) codewordsInts[k]; } } diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h index 00238544c3..7747c7ba5b 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h @@ -20,9 +20,9 @@ public: CBC_QRCoderDecoder(); virtual ~CBC_QRCoderDecoder(); - CBC_CommonDecoderResult* Decode(FX_BOOL* image, FX_INT32 width, FX_INT32 height, FX_INT32 &e); - CBC_CommonDecoderResult* Decode(CBC_CommonBitMatrix* bits, FX_INT32 byteModeDecode, FX_INT32 &e); - void CorrectErrors(CFX_ByteArray* codewordBytes, FX_INT32 numDataCodewords, FX_INT32 &e); + CBC_CommonDecoderResult* Decode(FX_BOOL* image, int32_t width, int32_t height, int32_t &e); + CBC_CommonDecoderResult* Decode(CBC_CommonBitMatrix* bits, int32_t byteModeDecode, int32_t &e); + void CorrectErrors(CFX_ByteArray* codewordBytes, int32_t numDataCodewords, int32_t &e); virtual void Init(); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.cpp index a475cecb37..7dfef9356d 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.cpp @@ -22,7 +22,7 @@ #include "../barcode.h" #include "BC_QRCoderECB.h" -CBC_QRCoderECB::CBC_QRCoderECB(FX_INT32 count, FX_INT32 dataCodeWords) +CBC_QRCoderECB::CBC_QRCoderECB(int32_t count, int32_t dataCodeWords) { m_dataCodeWords = dataCodeWords; m_count = count; @@ -30,11 +30,11 @@ CBC_QRCoderECB::CBC_QRCoderECB(FX_INT32 count, FX_INT32 dataCodeWords) CBC_QRCoderECB::~CBC_QRCoderECB() { } -FX_INT32 CBC_QRCoderECB::GetCount() +int32_t CBC_QRCoderECB::GetCount() { return m_count; } -FX_INT32 CBC_QRCoderECB::GetDataCodeWords() +int32_t CBC_QRCoderECB::GetDataCodeWords() { return m_dataCodeWords; } diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.h index e8c2d36999..5a9c25bd53 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderECB.h @@ -9,12 +9,12 @@ class CBC_QRCoderECB { private: - FX_INT32 m_count; - FX_INT32 m_dataCodeWords; + int32_t m_count; + int32_t m_dataCodeWords; public: - CBC_QRCoderECB(FX_INT32 count, FX_INT32 dataCodeWords); + CBC_QRCoderECB(int32_t count, int32_t dataCodeWords); virtual ~CBC_QRCoderECB(); - FX_INT32 GetCount(); - FX_INT32 GetDataCodeWords(); + int32_t GetCount(); + int32_t GetDataCodeWords(); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.cpp index 22485fe733..3c40cfd34b 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.cpp @@ -23,12 +23,12 @@ #include "../barcode.h" #include "BC_QRCoderECB.h" #include "BC_QRCoderECBlocks.h" -CBC_QRCoderECBlocks::CBC_QRCoderECBlocks(FX_INT32 ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks) +CBC_QRCoderECBlocks::CBC_QRCoderECBlocks(int32_t ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks) { m_ecCodeWordsPerBlock = ecCodeWordsPerBlock; m_ecBlocks.Add(ecBlocks); } -CBC_QRCoderECBlocks::CBC_QRCoderECBlocks(FX_INT32 ecCodeWordsPerBlock, +CBC_QRCoderECBlocks::CBC_QRCoderECBlocks(int32_t ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks1, CBC_QRCoderECB* ecBlocks2) { @@ -38,24 +38,24 @@ CBC_QRCoderECBlocks::CBC_QRCoderECBlocks(FX_INT32 ecCodeWordsPerBlock, } CBC_QRCoderECBlocks::~CBC_QRCoderECBlocks() { - for (FX_INT32 i = 0 ; i < m_ecBlocks.GetSize(); i++) { + for (int32_t i = 0 ; i < m_ecBlocks.GetSize(); i++) { delete ( (CBC_QRCoderECB*)(m_ecBlocks[i]) ) ; } m_ecBlocks.RemoveAll(); } -FX_INT32 CBC_QRCoderECBlocks::GetECCodeWordsPerBlock() +int32_t CBC_QRCoderECBlocks::GetECCodeWordsPerBlock() { return m_ecCodeWordsPerBlock; } -FX_INT32 CBC_QRCoderECBlocks::GetNumBlocks() +int32_t CBC_QRCoderECBlocks::GetNumBlocks() { - FX_INT32 total = 0; - for(FX_INT32 i = 0; i < m_ecBlocks.GetSize(); i++) { + int32_t total = 0; + for(int32_t i = 0; i < m_ecBlocks.GetSize(); i++) { total += ( (CBC_QRCoderECB*)(m_ecBlocks[i]) )->GetCount(); } return total; } -FX_INT32 CBC_QRCoderECBlocks::GetTotalECCodeWords() +int32_t CBC_QRCoderECBlocks::GetTotalECCodeWords() { return m_ecCodeWordsPerBlock * GetNumBlocks(); } diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.h index 7f229742ab..8a962e1627 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.h @@ -10,15 +10,15 @@ class CBC_QRCoderECB; class CBC_QRCoderECBlocks { private: - FX_INT32 m_ecCodeWordsPerBlock; + int32_t m_ecCodeWordsPerBlock; CFX_PtrArray m_ecBlocks; public: - CBC_QRCoderECBlocks(FX_INT32 ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks); - CBC_QRCoderECBlocks(FX_INT32 ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks1, CBC_QRCoderECB* ecBlocks2); + CBC_QRCoderECBlocks(int32_t ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks); + CBC_QRCoderECBlocks(int32_t ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks1, CBC_QRCoderECB* ecBlocks2); virtual ~CBC_QRCoderECBlocks(); - FX_INT32 GetECCodeWordsPerBlock(); - FX_INT32 GetNumBlocks(); - FX_INT32 GetTotalECCodeWords(); + int32_t GetECCodeWordsPerBlock(); + int32_t GetNumBlocks(); + int32_t GetTotalECCodeWords(); CFX_PtrArray* GetECBlocks(); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp index 3f6a644f0f..2ec490f109 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp @@ -36,7 +36,7 @@ #include "BC_QRCoderMaskUtil.h" #include "BC_QRCoderMatrixUtil.h" #include "BC_QRCoderBitVector.h" -const FX_INT32 CBC_QRCoderEncoder::m_alphaNumbericTable[] = { +const int32_t CBC_QRCoderEncoder::m_alphaNumbericTable[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, @@ -71,7 +71,7 @@ public: ~Make_Pair() {} }; void CBC_QRCoderEncoder::Encode(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, - CBC_QRCoder *qrCode, FX_INT32 &e, FX_INT32 versionSpecify) + CBC_QRCoder *qrCode, int32_t &e, int32_t versionSpecify) { if(versionSpecify == 0) { EncodeWithAutoVersion(content, ecLevel, qrCode, e); @@ -88,9 +88,9 @@ void CBC_QRCoderEncoder::AppendECI(CBC_QRCoderBitVector* bits) { } void CBC_QRCoderEncoder::AppendDataModeLenghInfo(CFX_PtrArray &splitResult, CBC_QRCoderBitVector &headerAndDataBits, - CBC_QRCoderMode *tempMode, CBC_QRCoder *qrCode, CFX_ByteString &encoding, FX_INT32 &e) + CBC_QRCoderMode *tempMode, CBC_QRCoder *qrCode, CFX_ByteString &encoding, int32_t &e) { - for(FX_INT32 i = 0; i < splitResult.GetSize(); i++) { + for(int32_t i = 0; i < splitResult.GetSize(); i++) { tempMode = ((Make_Pair*)splitResult[i])->m_mode; if(tempMode == CBC_QRCoderMode::sGBK) { AppendModeInfo(tempMode, &headerAndDataBits, e); @@ -130,9 +130,9 @@ void CBC_QRCoderEncoder::AppendDataModeLenghInfo(CFX_PtrArray &splitResult, CBC_ } void CBC_QRCoderEncoder::SplitString(const CFX_ByteString &content, CFX_PtrArray &result) { - FX_INT32 index = 0, flag = 0; - while((((FX_BYTE)content[index] >= 0xA1 && (FX_BYTE)content[index] <= 0xAA) || - ((FX_BYTE)content[index] >= 0xB0 && (FX_BYTE)content[index] <= 0xFA)) && (index < content.GetLength())) { + int32_t index = 0, flag = 0; + while((((uint8_t)content[index] >= 0xA1 && (uint8_t)content[index] <= 0xAA) || + ((uint8_t)content[index] >= 0xB0 && (uint8_t)content[index] <= 0xFA)) && (index < content.GetLength())) { index += 2; } if(index != flag) { @@ -142,14 +142,14 @@ void CBC_QRCoderEncoder::SplitString(const CFX_ByteString &content, CFX_PtrArray if(index >= content.GetLength()) { return; } - while(GetAlphaNumericCode((FX_BYTE)content[index]) == -1 - && !(((FX_BYTE)content[index] >= 0xA1 && (FX_BYTE)content[index] <= 0xAA) || - ((FX_BYTE)content[index] >= 0xB0 && (FX_BYTE)content[index] <= 0xFA)) + while(GetAlphaNumericCode((uint8_t)content[index]) == -1 + && !(((uint8_t)content[index] >= 0xA1 && (uint8_t)content[index] <= 0xAA) || + ((uint8_t)content[index] >= 0xB0 && (uint8_t)content[index] <= 0xFA)) && (index < content.GetLength())) { #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - if(IsDBCSLeadByte((FX_BYTE)content[index])) + if(IsDBCSLeadByte((uint8_t)content[index])) #else - if((FX_BYTE)content[index] > 127) + if((uint8_t)content[index] > 127) #endif { index += 2; @@ -164,7 +164,7 @@ void CBC_QRCoderEncoder::SplitString(const CFX_ByteString &content, CFX_PtrArray if(index >= content.GetLength()) { return; } - while(FXSYS_Isdigit((FX_BYTE)content[index]) && (index < content.GetLength())) { + while(FXSYS_Isdigit((uint8_t)content[index]) && (index < content.GetLength())) { index++; } if(index != flag) { @@ -174,7 +174,7 @@ void CBC_QRCoderEncoder::SplitString(const CFX_ByteString &content, CFX_PtrArray if(index >= content.GetLength()) { return; } - while(GetAlphaNumericCode((FX_BYTE)content[index]) != -1 && (index < content.GetLength())) { + while(GetAlphaNumericCode((uint8_t)content[index]) != -1 && (index < content.GetLength())) { index++; } if(index != flag) { @@ -186,7 +186,7 @@ void CBC_QRCoderEncoder::SplitString(const CFX_ByteString &content, CFX_PtrArray } SplitString(content.Mid(index, content.GetLength() - index), result); } -FX_INT32 CBC_QRCoderEncoder::GetSpanByVersion(CBC_QRCoderMode *modeFirst, CBC_QRCoderMode *modeSecond, FX_INT32 versionNum, FX_INT32 &e) +int32_t CBC_QRCoderEncoder::GetSpanByVersion(CBC_QRCoderMode *modeFirst, CBC_QRCoderMode *modeSecond, int32_t versionNum, int32_t &e) { if(versionNum == 0) { return 0; @@ -230,17 +230,17 @@ FX_INT32 CBC_QRCoderEncoder::GetSpanByVersion(CBC_QRCoderMode *modeFirst, CBC_QR } return -1; } -void CBC_QRCoderEncoder::MergeString(CFX_PtrArray &result, FX_INT32 versionNum, FX_INT32 &e) +void CBC_QRCoderEncoder::MergeString(CFX_PtrArray &result, int32_t versionNum, int32_t &e) { Make_Pair *first = NULL; Make_Pair *second = NULL; size_t mergeNum = 0; - FX_INT32 i; + int32_t i; for(i = 0; ((i < result.GetSize()) && (i + 1 < result.GetSize())); i++) { first = (Make_Pair*)result[i]; second = (Make_Pair*)result[i + 1]; if(first->m_mode == CBC_QRCoderMode::sALPHANUMERIC) { - FX_INT32 tmp = GetSpanByVersion(CBC_QRCoderMode::sALPHANUMERIC, CBC_QRCoderMode::sBYTE, versionNum, e); + int32_t tmp = GetSpanByVersion(CBC_QRCoderMode::sALPHANUMERIC, CBC_QRCoderMode::sBYTE, versionNum, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if((second->m_mode == CBC_QRCoderMode::sBYTE) && (first->m_string.GetLength() < tmp)) { @@ -260,7 +260,7 @@ void CBC_QRCoderEncoder::MergeString(CFX_PtrArray &result, FX_INT32 versionNum, mergeNum++; } } else if(first->m_mode == CBC_QRCoderMode::sNUMERIC) { - FX_INT32 tmp = GetSpanByVersion(CBC_QRCoderMode::sNUMERIC, CBC_QRCoderMode::sBYTE, versionNum, e); + int32_t tmp = GetSpanByVersion(CBC_QRCoderMode::sNUMERIC, CBC_QRCoderMode::sBYTE, versionNum, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if((second->m_mode == CBC_QRCoderMode::sBYTE) && (first->m_string.GetLength() < tmp)) { @@ -290,18 +290,18 @@ void CBC_QRCoderEncoder::MergeString(CFX_PtrArray &result, FX_INT32 versionNum, MergeString(result, versionNum, e); BC_EXCEPTION_CHECK_ReturnVoid(e); } -void CBC_QRCoderEncoder::InitQRCode(FX_INT32 numInputBytes, FX_INT32 versionNumber, - CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, FX_INT32 &e) +void CBC_QRCoderEncoder::InitQRCode(int32_t numInputBytes, int32_t versionNumber, + CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, int32_t &e) { qrCode->SetECLevel(ecLevel); qrCode->SetMode(mode); CBC_QRCoderVersion* version = CBC_QRCoderVersion::GetVersionForNumber(versionNumber, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 numBytes = version->GetTotalCodeWords(); + int32_t numBytes = version->GetTotalCodeWords(); CBC_QRCoderECBlocks* ecBlocks = version->GetECBlocksForLevel(ecLevel); - FX_INT32 numEcBytes = ecBlocks->GetTotalECCodeWords(); - FX_INT32 numRSBlocks = ecBlocks->GetNumBlocks(); - FX_INT32 numDataBytes = numBytes - numEcBytes; + int32_t numEcBytes = ecBlocks->GetTotalECCodeWords(); + int32_t numRSBlocks = ecBlocks->GetNumBlocks(); + int32_t numDataBytes = numBytes - numEcBytes; if(numDataBytes >= numInputBytes + 3) { qrCode->SetVersion(versionNumber); qrCode->SetNumTotalBytes(numBytes); @@ -315,7 +315,7 @@ void CBC_QRCoderEncoder::InitQRCode(FX_INT32 numInputBytes, FX_INT32 versionNumb BC_EXCEPTION_CHECK_ReturnVoid(e); } void CBC_QRCoderEncoder::EncodeWithSpecifyVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, - CBC_QRCoder *qrCode, FX_INT32 versionSpecify, FX_INT32 &e) + CBC_QRCoder *qrCode, int32_t versionSpecify, int32_t &e) { CFX_ByteString encoding = "utf8"; CBC_QRCoderMode *mode = CBC_QRCoderMode::sBYTE; @@ -326,22 +326,22 @@ void CBC_QRCoderEncoder::EncodeWithSpecifyVersion(const CFX_ByteString &content, MergeString(splitResult, versionSpecify, e); BC_EXCEPTION_CHECK_ReturnVoid(e) CBC_QRCoderMode *tempMode = NULL; - for(FX_INT32 i = 0; i < splitResult.GetSize(); i++) { + for(int32_t i = 0; i < splitResult.GetSize(); i++) { AppendBytes(((Make_Pair*)splitResult[i])->m_string, ((Make_Pair*)splitResult[i])->m_mode, &dataBits, encoding, e); if(e != BCExceptionNO) { - for(FX_INT32 y = 0; y < splitResult.GetSize(); y++) { + for(int32_t y = 0; y < splitResult.GetSize(); y++) { delete (Make_Pair*)splitResult[y]; } splitResult.RemoveAll(); return; } } - FX_INT32 numInputBytes = dataBits.sizeInBytes(); + int32_t numInputBytes = dataBits.sizeInBytes(); CBC_QRCoderBitVector headerAndDataBits; headerAndDataBits.Init(); InitQRCode(numInputBytes, versionSpecify, ecLevel, mode, qrCode, e); if(e != BCExceptionNO) { - for(FX_INT32 k = 0; k < splitResult.GetSize(); k++) { + for(int32_t k = 0; k < splitResult.GetSize(); k++) { delete (Make_Pair*)splitResult[k]; } splitResult.RemoveAll(); @@ -349,7 +349,7 @@ void CBC_QRCoderEncoder::EncodeWithSpecifyVersion(const CFX_ByteString &content, } AppendDataModeLenghInfo(splitResult, headerAndDataBits, tempMode, qrCode, encoding, e); if(e != BCExceptionNO) { - for(FX_INT32 k = 0; k < splitResult.GetSize(); k++) { + for(int32_t k = 0; k < splitResult.GetSize(); k++) { delete (Make_Pair*)splitResult[k]; } splitResult.RemoveAll(); @@ -358,13 +358,13 @@ void CBC_QRCoderEncoder::EncodeWithSpecifyVersion(const CFX_ByteString &content, numInputBytes = headerAndDataBits.sizeInBytes(); TerminateBits(qrCode->GetNumDataBytes(), &headerAndDataBits, e); if(e != BCExceptionNO) { - for(FX_INT32 k = 0; k < splitResult.GetSize(); k++) { + for(int32_t k = 0; k < splitResult.GetSize(); k++) { delete (Make_Pair*)splitResult[k]; } splitResult.RemoveAll(); return ; } - for(FX_INT32 j = 0; j < splitResult.GetSize(); j++) { + for(int32_t j = 0; j < splitResult.GetSize(); j++) { delete (Make_Pair*)splitResult[j]; } splitResult.RemoveAll(); @@ -376,7 +376,7 @@ void CBC_QRCoderEncoder::EncodeWithSpecifyVersion(const CFX_ByteString &content, CBC_CommonByteMatrix* pDecoder = FX_NEW CBC_CommonByteMatrix(qrCode->GetMatrixWidth(), qrCode->GetMatrixWidth()); pDecoder->Init(); CBC_AutoPtr matrix(pDecoder); - FX_INT32 maskPattern = ChooseMaskPattern(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), matrix.get(), e); + int32_t maskPattern = ChooseMaskPattern(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), matrix.get(), e); BC_EXCEPTION_CHECK_ReturnVoid(e); qrCode->SetMaskPattern(maskPattern); CBC_QRCoderMatrixUtil::BuildMatrix(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), qrCode->GetMaskPattern(), matrix.get(), e); @@ -387,7 +387,7 @@ void CBC_QRCoderEncoder::EncodeWithSpecifyVersion(const CFX_ByteString &content, BC_EXCEPTION_CHECK_ReturnVoid(e); } } -void CBC_QRCoderEncoder::EncodeWithAutoVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e) +void CBC_QRCoderEncoder::EncodeWithAutoVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e) { CFX_ByteString encoding = "utf8"; CBC_QRCoderMode *mode = CBC_QRCoderMode::sBYTE; @@ -398,23 +398,23 @@ void CBC_QRCoderEncoder::EncodeWithAutoVersion(const CFX_ByteString &content, CB MergeString(splitResult, 8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); CBC_QRCoderMode *tempMode = NULL; - for(FX_INT32 i = 0; i < splitResult.GetSize(); i++) { + for(int32_t i = 0; i < splitResult.GetSize(); i++) { AppendBytes(((Make_Pair*)splitResult[i])->m_string, ((Make_Pair*)splitResult[i])->m_mode, &dataBits, encoding, e); if(e != BCExceptionNO) { - for(FX_INT32 l = 0; l < splitResult.GetSize(); l++) { + for(int32_t l = 0; l < splitResult.GetSize(); l++) { delete (Make_Pair*)splitResult[l]; } splitResult.RemoveAll(); return; } } - FX_INT32 numInputBytes = dataBits.sizeInBytes(); + int32_t numInputBytes = dataBits.sizeInBytes(); InitQRCode(numInputBytes, ecLevel, mode, qrCode, e); BC_EXCEPTION_CHECK_ReturnVoid(e) CBC_QRCoderBitVector headerAndDataBits; headerAndDataBits.Init(); tempMode = NULL; - FX_INT32 versionNum = qrCode->GetVersion(); + int32_t versionNum = qrCode->GetVersion(); sign: AppendDataModeLenghInfo(splitResult, headerAndDataBits, tempMode, qrCode, encoding, e); if (e != BCExceptionNO) { @@ -427,7 +427,7 @@ sign: } catchException: if (e != BCExceptionNO) { - FX_INT32 e1 = BCExceptionNO; + int32_t e1 = BCExceptionNO; InitQRCode(numInputBytes, ecLevel, mode, qrCode, e1); if (e1 != BCExceptionNO) { e = e1; @@ -439,14 +439,14 @@ catchException: e = BCExceptionNO; goto sign; } else { - for (FX_INT32 j = 0; j < splitResult.GetSize(); j++) { + for (int32_t j = 0; j < splitResult.GetSize(); j++) { delete (Make_Pair*)splitResult[j]; } splitResult.RemoveAll(); return; } } - for (FX_INT32 k = 0; k < splitResult.GetSize(); k++) { + for (int32_t k = 0; k < splitResult.GetSize(); k++) { delete (Make_Pair*)splitResult[k]; } splitResult.RemoveAll(); @@ -458,7 +458,7 @@ catchException: CBC_CommonByteMatrix* pDecoder = FX_NEW CBC_CommonByteMatrix(qrCode->GetMatrixWidth(), qrCode->GetMatrixWidth()); pDecoder->Init(); CBC_AutoPtr matrix(pDecoder); - FX_INT32 maskPattern = ChooseMaskPattern(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), matrix.get(), e); + int32_t maskPattern = ChooseMaskPattern(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), matrix.get(), e); BC_EXCEPTION_CHECK_ReturnVoid(e); qrCode->SetMaskPattern(maskPattern); CBC_QRCoderMatrixUtil::BuildMatrix(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), qrCode->GetMaskPattern(), matrix.get(), e); @@ -469,7 +469,7 @@ catchException: BC_EXCEPTION_CHECK_ReturnVoid(e); } } -void CBC_QRCoderEncoder::Encode(const CFX_WideString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e) +void CBC_QRCoderEncoder::Encode(const CFX_WideString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e) { CFX_ByteString encoding = "utf8"; CFX_ByteString utf8Data; @@ -479,14 +479,14 @@ void CBC_QRCoderEncoder::Encode(const CFX_WideString &content, CBC_QRCoderErrorC dataBits.Init(); AppendBytes(utf8Data, mode, &dataBits, encoding, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 numInputBytes = dataBits.sizeInBytes(); + int32_t numInputBytes = dataBits.sizeInBytes(); InitQRCode(numInputBytes, ecLevel, mode, qrCode, e); BC_EXCEPTION_CHECK_ReturnVoid(e); CBC_QRCoderBitVector headerAndDataBits; headerAndDataBits.Init(); AppendModeInfo(mode, &headerAndDataBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 numLetters = mode == CBC_QRCoderMode::sBYTE ? dataBits.sizeInBytes() : content.GetLength(); + int32_t numLetters = mode == CBC_QRCoderMode::sBYTE ? dataBits.sizeInBytes() : content.GetLength(); AppendLengthInfo(numLetters, qrCode->GetVersion(), mode, &headerAndDataBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); headerAndDataBits.AppendBitVector(&dataBits, e); @@ -501,7 +501,7 @@ void CBC_QRCoderEncoder::Encode(const CFX_WideString &content, CBC_QRCoderErrorC CBC_CommonByteMatrix* pDecoder = FX_NEW CBC_CommonByteMatrix(qrCode->GetMatrixWidth(), qrCode->GetMatrixWidth()); pDecoder->Init(); CBC_AutoPtr matrix(pDecoder); - FX_INT32 maskPattern = ChooseMaskPattern(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), matrix.get(), e); + int32_t maskPattern = ChooseMaskPattern(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), matrix.get(), e); BC_EXCEPTION_CHECK_ReturnVoid(e); qrCode->SetMaskPattern(maskPattern); CBC_QRCoderMatrixUtil::BuildMatrix(&finalBits, qrCode->GetECLevel(), qrCode->GetVersion(), qrCode->GetMaskPattern(), matrix.get(), e); @@ -512,21 +512,21 @@ void CBC_QRCoderEncoder::Encode(const CFX_WideString &content, CBC_QRCoderErrorC BC_EXCEPTION_CHECK_ReturnVoid(e); } } -void CBC_QRCoderEncoder::TerminateBits(FX_INT32 numDataBytes, CBC_QRCoderBitVector* bits, FX_INT32 &e) +void CBC_QRCoderEncoder::TerminateBits(int32_t numDataBytes, CBC_QRCoderBitVector* bits, int32_t &e) { - FX_INT32 capacity = numDataBytes << 3; + int32_t capacity = numDataBytes << 3; if(bits->Size() > capacity) { e = BCExceptionDataTooMany; BC_EXCEPTION_CHECK_ReturnVoid(e); } - for (FX_INT32 i = 0; i < 4 && bits->Size() < capacity; ++i) { + for (int32_t i = 0; i < 4 && bits->Size() < capacity; ++i) { bits->AppendBit(0, e); BC_EXCEPTION_CHECK_ReturnVoid(e); } - FX_INT32 numBitsInLastByte = bits->Size() % 8; + int32_t numBitsInLastByte = bits->Size() % 8; if (numBitsInLastByte > 0) { - FX_INT32 numPaddingBits = 8 - numBitsInLastByte; - for (FX_INT32 j = 0; j < numPaddingBits; ++j) { + int32_t numPaddingBits = 8 - numBitsInLastByte; + for (int32_t j = 0; j < numPaddingBits; ++j) { bits->AppendBit(0, e); BC_EXCEPTION_CHECK_ReturnVoid(e) } @@ -535,8 +535,8 @@ void CBC_QRCoderEncoder::TerminateBits(FX_INT32 numDataBytes, CBC_QRCoderBitVect e = BCExceptionDigitLengthMustBe8; BC_EXCEPTION_CHECK_ReturnVoid(e); } - FX_INT32 numPaddingBytes = numDataBytes - bits->sizeInBytes(); - for (FX_INT32 k = 0; k < numPaddingBytes; ++k) { + int32_t numPaddingBytes = numDataBytes - bits->sizeInBytes(); + for (int32_t k = 0; k < numPaddingBytes; ++k) { if (k % 2 == 0) { bits->AppendBits(0xec, 8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -550,14 +550,14 @@ void CBC_QRCoderEncoder::TerminateBits(FX_INT32 numDataBytes, CBC_QRCoderBitVect BC_EXCEPTION_CHECK_ReturnVoid(e); } } -FX_INT32 CBC_QRCoderEncoder::ChooseMaskPattern(CBC_QRCoderBitVector* bits, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e) +int32_t CBC_QRCoderEncoder::ChooseMaskPattern(CBC_QRCoderBitVector* bits, CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e) { - FX_INT32 minPenalty = 65535; - FX_INT32 bestMaskPattern = -1; - for(FX_INT32 maskPattern = 0; maskPattern < CBC_QRCoder::NUM_MASK_PATTERNS; maskPattern++) { + int32_t minPenalty = 65535; + int32_t bestMaskPattern = -1; + for(int32_t maskPattern = 0; maskPattern < CBC_QRCoder::NUM_MASK_PATTERNS; maskPattern++) { CBC_QRCoderMatrixUtil::BuildMatrix(bits, ecLevel, version, maskPattern, matrix, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); - FX_INT32 penalty = CalculateMaskPenalty(matrix); + int32_t penalty = CalculateMaskPenalty(matrix); if(penalty < minPenalty) { minPenalty = penalty; bestMaskPattern = maskPattern; @@ -565,9 +565,9 @@ FX_INT32 CBC_QRCoderEncoder::ChooseMaskPattern(CBC_QRCoderBitVector* bits, CBC_Q } return bestMaskPattern; } -FX_INT32 CBC_QRCoderEncoder::CalculateMaskPenalty(CBC_CommonByteMatrix* matrix) +int32_t CBC_QRCoderEncoder::CalculateMaskPenalty(CBC_CommonByteMatrix* matrix) { - FX_INT32 penalty = 0; + int32_t penalty = 0; penalty += CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1(matrix); penalty += CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule2(matrix); penalty += CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule3(matrix); @@ -581,10 +581,10 @@ CBC_QRCoderMode *CBC_QRCoderEncoder::ChooseMode(const CFX_ByteString &content, C } FX_BOOL hasNumeric = FALSE; FX_BOOL hasAlphaNumeric = FALSE; - for(FX_INT32 i = 0; i < content.GetLength(); i++) { - if(isdigit((FX_BYTE)content[i])) { + for(int32_t i = 0; i < content.GetLength(); i++) { + if(isdigit((uint8_t)content[i])) { hasNumeric = TRUE; - } else if(GetAlphaNumericCode((FX_BYTE)content[i]) != -1) { + } else if(GetAlphaNumericCode((uint8_t)content[i]) != -1) { hasAlphaNumeric = TRUE; } else { return CBC_QRCoderMode::sBYTE; @@ -597,14 +597,14 @@ CBC_QRCoderMode *CBC_QRCoderEncoder::ChooseMode(const CFX_ByteString &content, C } return CBC_QRCoderMode::sBYTE; } -FX_INT32 CBC_QRCoderEncoder::GetAlphaNumericCode(FX_INT32 code) +int32_t CBC_QRCoderEncoder::GetAlphaNumericCode(int32_t code) { if(code < 96 && code >= 0) { return m_alphaNumbericTable[code]; } return -1; } -void CBC_QRCoderEncoder::AppendBytes(const CFX_ByteString &content, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, FX_INT32 &e) +void CBC_QRCoderEncoder::AppendBytes(const CFX_ByteString &content, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, int32_t &e) { if(mode == CBC_QRCoderMode::sNUMERIC) { AppendNumericBytes(content, bits, e); @@ -626,20 +626,20 @@ void CBC_QRCoderEncoder::AppendBytes(const CFX_ByteString &content, CBC_QRCoderM BC_EXCEPTION_CHECK_ReturnVoid(e); } } -void CBC_QRCoderEncoder::AppendNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e) +void CBC_QRCoderEncoder::AppendNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e) { - FX_INT32 length = content.GetLength(); - FX_INT32 i = 0; + int32_t length = content.GetLength(); + int32_t i = 0; while(i < length) { - FX_INT32 num1 = content[i] - '0'; + int32_t num1 = content[i] - '0'; if(i + 2 < length) { - FX_INT32 num2 = content[i + 1] - '0'; - FX_INT32 num3 = content[i + 2] - '0'; + int32_t num2 = content[i + 1] - '0'; + int32_t num3 = content[i + 2] - '0'; bits->AppendBits(num1 * 100 + num2 * 10 + num3, 10, e); BC_EXCEPTION_CHECK_ReturnVoid(e) i += 3; } else if(i + 1 < length) { - FX_INT32 num2 = content[i + 1] - '0'; + int32_t num2 = content[i + 1] - '0'; bits->AppendBits(num1 * 10 + num2, 7, e); BC_EXCEPTION_CHECK_ReturnVoid(e) i += 2; @@ -650,18 +650,18 @@ void CBC_QRCoderEncoder::AppendNumericBytes(const CFX_ByteString &content, CBC_Q } } } -void CBC_QRCoderEncoder::AppendAlphaNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e) +void CBC_QRCoderEncoder::AppendAlphaNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e) { - FX_INT32 length = content.GetLength(); - FX_INT32 i = 0; + int32_t length = content.GetLength(); + int32_t i = 0; while(i < length) { - FX_INT32 code1 = GetAlphaNumericCode(content[i]); + int32_t code1 = GetAlphaNumericCode(content[i]); if(code1 == -1) { e = BCExceptionInvalidateCharacter; BC_EXCEPTION_CHECK_ReturnVoid(e); } if(i + 1 < length) { - FX_INT32 code2 = GetAlphaNumericCode(content[i + 1]); + int32_t code2 = GetAlphaNumericCode(content[i + 1]); if(code2 == -1) { e = BCExceptionInvalidateCharacter; BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -676,12 +676,12 @@ void CBC_QRCoderEncoder::AppendAlphaNumericBytes(const CFX_ByteString &content, } } } -void CBC_QRCoderEncoder::AppendGBKBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e) +void CBC_QRCoderEncoder::AppendGBKBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e) { - FX_INT32 length = content.GetLength(); + int32_t length = content.GetLength(); FX_DWORD value = 0; - for(FX_INT32 i = 0; i < length; i += 2) { - value = (FX_DWORD)((FX_BYTE)content[i] << 8 | (FX_BYTE)content[i + 1]); + for(int32_t i = 0; i < length; i += 2) { + value = (FX_DWORD)((uint8_t)content[i] << 8 | (uint8_t)content[i + 1]); if(value <= 0xAAFE && value >= 0xA1A1) { value -= 0xA1A1; } else if(value <= 0xFAFE && value >= 0xB0A1) { @@ -695,26 +695,26 @@ void CBC_QRCoderEncoder::AppendGBKBytes(const CFX_ByteString &content, CBC_QRCod BC_EXCEPTION_CHECK_ReturnVoid(e); } } -void CBC_QRCoderEncoder::Append8BitBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, FX_INT32 &e) +void CBC_QRCoderEncoder::Append8BitBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, int32_t &e) { - for(FX_INT32 i = 0; i < content.GetLength(); i++) { + for(int32_t i = 0; i < content.GetLength(); i++) { bits->AppendBits(content[i], 8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); } } -void CBC_QRCoderEncoder::Append8BitBytes(CFX_ByteArray &bytes, CBC_QRCoderBitVector *bits, FX_INT32 &e) +void CBC_QRCoderEncoder::Append8BitBytes(CFX_ByteArray &bytes, CBC_QRCoderBitVector *bits, int32_t &e) { - for(FX_INT32 i = 0; i < bytes.GetSize(); i++) { + for(int32_t i = 0; i < bytes.GetSize(); i++) { bits->AppendBits(bytes[i], 8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); } } -void CBC_QRCoderEncoder::AppendKanjiBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e) +void CBC_QRCoderEncoder::AppendKanjiBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e) { CFX_ByteArray bytes; FX_DWORD value = 0, h = 0; - for(FX_INT32 i = 0; i < bytes.GetSize(); i += 2) { - value = (FX_DWORD)((FX_BYTE)(content[i] << 8) | (FX_BYTE)content[i + 1]); + for(int32_t i = 0; i < bytes.GetSize(); i += 2) { + value = (FX_DWORD)((uint8_t)(content[i] << 8) | (uint8_t)content[i + 1]); if(value <= 0x9ffc && value >= 0x8140) { value -= 0x8140; } else if(value <= 0xebbf && value >= 0xe040) { @@ -728,19 +728,19 @@ void CBC_QRCoderEncoder::AppendKanjiBytes(const CFX_ByteString &content, CBC_QRC BC_EXCEPTION_CHECK_ReturnVoid(e); } } -void CBC_QRCoderEncoder::InitQRCode(FX_INT32 numInputBytes, CBC_QRCoderErrorCorrectionLevel* ecLevel, - CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, FX_INT32 &e) +void CBC_QRCoderEncoder::InitQRCode(int32_t numInputBytes, CBC_QRCoderErrorCorrectionLevel* ecLevel, + CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, int32_t &e) { qrCode->SetECLevel(ecLevel); qrCode->SetMode(mode); - for(FX_INT32 versionNum = 1; versionNum <= 40; versionNum++) { + for(int32_t versionNum = 1; versionNum <= 40; versionNum++) { CBC_QRCoderVersion* version = CBC_QRCoderVersion::GetVersionForNumber(versionNum, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 numBytes = version->GetTotalCodeWords(); + int32_t numBytes = version->GetTotalCodeWords(); CBC_QRCoderECBlocks* ecBlocks = version->GetECBlocksForLevel(ecLevel); - FX_INT32 numEcBytes = ecBlocks->GetTotalECCodeWords(); - FX_INT32 numRSBlocks = ecBlocks->GetNumBlocks(); - FX_INT32 numDataBytes = numBytes - numEcBytes; + int32_t numEcBytes = ecBlocks->GetTotalECCodeWords(); + int32_t numRSBlocks = ecBlocks->GetNumBlocks(); + int32_t numDataBytes = numBytes - numEcBytes; if(numDataBytes >= numInputBytes + 3) { qrCode->SetVersion(versionNum); qrCode->SetNumTotalBytes(numBytes); @@ -754,7 +754,7 @@ void CBC_QRCoderEncoder::InitQRCode(FX_INT32 numInputBytes, CBC_QRCoderErrorCorr e = BCExceptionCannotFindBlockInfo; BC_EXCEPTION_CHECK_ReturnVoid(e); } -void CBC_QRCoderEncoder::AppendModeInfo(CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, FX_INT32 &e) +void CBC_QRCoderEncoder::AppendModeInfo(CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, int32_t &e) { bits->AppendBits(mode->GetBits(), 4, e); if(mode == CBC_QRCoderMode::sGBK) { @@ -762,11 +762,11 @@ void CBC_QRCoderEncoder::AppendModeInfo(CBC_QRCoderMode* mode, CBC_QRCoderBitVec BC_EXCEPTION_CHECK_ReturnVoid(e); } } -void CBC_QRCoderEncoder::AppendLengthInfo(FX_INT32 numLetters, FX_INT32 version, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, FX_INT32 &e) +void CBC_QRCoderEncoder::AppendLengthInfo(int32_t numLetters, int32_t version, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, int32_t &e) { CBC_QRCoderVersion* qcv = CBC_QRCoderVersion::GetVersionForNumber(version, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 numBits = mode->GetCharacterCountBits(qcv, e); + int32_t numBits = mode->GetCharacterCountBits(qcv, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if(numBits > ((1 << numBits) - 1)) { return; @@ -778,20 +778,20 @@ void CBC_QRCoderEncoder::AppendLengthInfo(FX_INT32 numLetters, FX_INT32 version, bits->AppendBits(numLetters, numBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); } -void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_INT32 numTotalBytes, FX_INT32 numDataBytes, FX_INT32 numRSBlocks, CBC_QRCoderBitVector* result, FX_INT32 &e) +void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits, int32_t numTotalBytes, int32_t numDataBytes, int32_t numRSBlocks, CBC_QRCoderBitVector* result, int32_t &e) { if(bits->sizeInBytes() != numDataBytes) { e = BCExceptionBitsBytesNotMatch; BC_EXCEPTION_CHECK_ReturnVoid(e); } - FX_INT32 dataBytesOffset = 0; - FX_INT32 maxNumDataBytes = 0; - FX_INT32 maxNumEcBytes = 0; + int32_t dataBytesOffset = 0; + int32_t maxNumDataBytes = 0; + int32_t maxNumEcBytes = 0; CFX_PtrArray blocks; - FX_INT32 i; + int32_t i; for(i = 0; i < numRSBlocks; i++) { - FX_INT32 numDataBytesInBlock; - FX_INT32 numEcBytesInBlosk; + int32_t numDataBytesInBlock; + int32_t numEcBytesInBlosk; GetNumDataBytesAndNumECBytesForBlockID(numTotalBytes, numDataBytes, numRSBlocks, i, numDataBytesInBlock, numEcBytesInBlosk); CBC_CommonByteArray* dataBytes = FX_NEW CBC_CommonByteArray; @@ -807,8 +807,8 @@ void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_IN e = BCExceptionBytesNotMatchOffset; BC_EXCEPTION_CHECK_ReturnVoid(e); } - for(FX_INT32 x = 0; x < maxNumDataBytes; x++) { - for(FX_INT32 j = 0; j < blocks.GetSize(); j++) { + for(int32_t x = 0; x < maxNumDataBytes; x++) { + for(int32_t j = 0; j < blocks.GetSize(); j++) { CBC_CommonByteArray* dataBytes = ((CBC_QRCoderBlockPair*)blocks[j])->GetDataBytes(); if(x < dataBytes->Size()) { result->AppendBits(dataBytes->At(x), 8, e); @@ -816,8 +816,8 @@ void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_IN } } } - for(FX_INT32 y = 0; y < maxNumEcBytes; y++) { - for(FX_INT32 l = 0; l < blocks.GetSize(); l++) { + for(int32_t y = 0; y < maxNumEcBytes; y++) { + for(int32_t l = 0; l < blocks.GetSize(); l++) { CBC_CommonByteArray* ecBytes = ((CBC_QRCoderBlockPair*)blocks[l])->GetErrorCorrectionBytes(); if(y < ecBytes->Size()) { result->AppendBits(ecBytes->At(y), 8, e); @@ -825,7 +825,7 @@ void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_IN } } } - for(FX_INT32 k = 0; k < blocks.GetSize(); k++) { + for(int32_t k = 0; k < blocks.GetSize(); k++) { delete (CBC_QRCoderBlockPair*)blocks[k]; } if(numTotalBytes != result->sizeInBytes()) { @@ -833,21 +833,21 @@ void CBC_QRCoderEncoder::InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_IN BC_EXCEPTION_CHECK_ReturnVoid(e); } } -void CBC_QRCoderEncoder::GetNumDataBytesAndNumECBytesForBlockID(FX_INT32 numTotalBytes, FX_INT32 numDataBytes, - FX_INT32 numRSBlocks, FX_INT32 blockID, - FX_INT32 &numDataBytesInBlock, FX_INT32& numECBytesInBlock) +void CBC_QRCoderEncoder::GetNumDataBytesAndNumECBytesForBlockID(int32_t numTotalBytes, int32_t numDataBytes, + int32_t numRSBlocks, int32_t blockID, + int32_t &numDataBytesInBlock, int32_t& numECBytesInBlock) { if(blockID >= numRSBlocks) { return; } - FX_INT32 numRsBlocksInGroup2 = numTotalBytes % numRSBlocks; - FX_INT32 numRsBlocksInGroup1 = numRSBlocks - numRsBlocksInGroup2; - FX_INT32 numTotalBytesInGroup1 = numTotalBytes / numRSBlocks; - FX_INT32 numTotalBytesInGroup2 = numTotalBytesInGroup1 + 1; - FX_INT32 numDataBytesInGroup1 = numDataBytes / numRSBlocks; - FX_INT32 numDataBytesInGroup2 = numDataBytesInGroup1 + 1; - FX_INT32 numEcBytesInGroup1 = numTotalBytesInGroup1 - numDataBytesInGroup1; - FX_INT32 numEcBytesInGroup2 = numTotalBytesInGroup2 - numDataBytesInGroup2; + int32_t numRsBlocksInGroup2 = numTotalBytes % numRSBlocks; + int32_t numRsBlocksInGroup1 = numRSBlocks - numRsBlocksInGroup2; + int32_t numTotalBytesInGroup1 = numTotalBytes / numRSBlocks; + int32_t numTotalBytesInGroup2 = numTotalBytesInGroup1 + 1; + int32_t numDataBytesInGroup1 = numDataBytes / numRSBlocks; + int32_t numDataBytesInGroup2 = numDataBytesInGroup1 + 1; + int32_t numEcBytesInGroup1 = numTotalBytesInGroup1 - numDataBytesInGroup1; + int32_t numEcBytesInGroup2 = numTotalBytesInGroup2 - numDataBytesInGroup2; if (blockID < numRsBlocksInGroup1) { numDataBytesInBlock = numDataBytesInGroup1; numECBytesInBlock = numEcBytesInGroup1; @@ -856,12 +856,12 @@ void CBC_QRCoderEncoder::GetNumDataBytesAndNumECBytesForBlockID(FX_INT32 numTota numECBytesInBlock = numEcBytesInGroup2; } } -CBC_CommonByteArray* CBC_QRCoderEncoder::GenerateECBytes(CBC_CommonByteArray* dataBytes, FX_INT32 numEcBytesInBlock, FX_INT32 &e) +CBC_CommonByteArray* CBC_QRCoderEncoder::GenerateECBytes(CBC_CommonByteArray* dataBytes, int32_t numEcBytesInBlock, int32_t &e) { - FX_INT32 numDataBytes = dataBytes->Size(); + int32_t numDataBytes = dataBytes->Size(); CFX_Int32Array toEncode; toEncode.SetSize(numDataBytes + numEcBytesInBlock); - for(FX_INT32 i = 0; i < numDataBytes; i++) { + for(int32_t i = 0; i < numDataBytes; i++) { toEncode[i] = (dataBytes->At(i)); } CBC_ReedSolomonEncoder encode(CBC_ReedSolomonGF256::QRCodeFild); @@ -869,7 +869,7 @@ CBC_CommonByteArray* CBC_QRCoderEncoder::GenerateECBytes(CBC_CommonByteArray* da encode.Encode(&toEncode, numEcBytesInBlock, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_CommonByteArray* ecBytes = FX_NEW CBC_CommonByteArray(numEcBytesInBlock); - for(FX_INT32 j = 0; j < numEcBytesInBlock; j++) { + for(int32_t j = 0; j < numEcBytesInBlock; j++) { ecBytes->Set(j, toEncode[numDataBytes + j]); } return ecBytes; diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h index f08d608fb8..303dbcb767 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h @@ -17,44 +17,44 @@ class CBC_QRCoderEncoder; class CBC_QRCoderEncoder { private: - const static FX_INT32 m_alphaNumbericTable[96]; + const static int32_t m_alphaNumbericTable[96]; public: CBC_QRCoderEncoder(); virtual ~CBC_QRCoderEncoder(); - static void Encode(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e, FX_INT32 versionSpecify = 0); - static void Encode(const CFX_WideString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e); + static void Encode(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e, int32_t versionSpecify = 0); + static void Encode(const CFX_WideString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e); static void EncodeWithSpecifyVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, - CBC_QRCoder *qrCode, FX_INT32 versionSpecify, FX_INT32 &e); - static void EncodeWithAutoVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e); + CBC_QRCoder *qrCode, int32_t versionSpecify, int32_t &e); + static void EncodeWithAutoVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e); static CBC_QRCoderMode* ChooseMode(const CFX_ByteString & content, CFX_ByteString encoding); - static FX_INT32 GetAlphaNumericCode(FX_INT32 code); + static int32_t GetAlphaNumericCode(int32_t code); static void AppendECI(CBC_QRCoderBitVector* bits); - static void AppendBytes(const CFX_ByteString &content, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, FX_INT32 &e); - static void AppendNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e); - static void AppendAlphaNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e); - static void Append8BitBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, FX_INT32 &e); - static void Append8BitBytes(CFX_ByteArray &bytes, CBC_QRCoderBitVector *bits, FX_INT32 &e); - static void AppendKanjiBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e); - static void AppendGBKBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e); - static void InitQRCode(FX_INT32 numInputBytes, FX_INT32 versionNumber, - CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, FX_INT32 &e); - static void InitQRCode(FX_INT32 numInputBytes, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, FX_INT32 &e); - static void AppendModeInfo(CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, FX_INT32 &e); - static void AppendLengthInfo(FX_INT32 numLetters, FX_INT32 version, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, FX_INT32 &e); + static void AppendBytes(const CFX_ByteString &content, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, int32_t &e); + static void AppendNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e); + static void AppendAlphaNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e); + static void Append8BitBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, int32_t &e); + static void Append8BitBytes(CFX_ByteArray &bytes, CBC_QRCoderBitVector *bits, int32_t &e); + static void AppendKanjiBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e); + static void AppendGBKBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e); + static void InitQRCode(int32_t numInputBytes, int32_t versionNumber, + CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, int32_t &e); + static void InitQRCode(int32_t numInputBytes, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, int32_t &e); + static void AppendModeInfo(CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, int32_t &e); + static void AppendLengthInfo(int32_t numLetters, int32_t version, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, int32_t &e); - static void InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_INT32 numTotalBytes, FX_INT32 numDataBytes, FX_INT32 numRSBlocks, CBC_QRCoderBitVector* result, FX_INT32 &e); - static void GetNumDataBytesAndNumECBytesForBlockID(FX_INT32 numTotalBytes, FX_INT32 numDataBytes, - FX_INT32 numRSBlocks, FX_INT32 blockID, - FX_INT32 &numDataBytesInBlock, FX_INT32& numECBytesInBlocks); - static CBC_CommonByteArray* GenerateECBytes(CBC_CommonByteArray* dataBytes, FX_INT32 numEcBytesInBlock, FX_INT32 &e); - static FX_INT32 ChooseMaskPattern(CBC_QRCoderBitVector* bits, CBC_QRCoderErrorCorrectionLevel* ecLevel, - FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e); - static FX_INT32 CalculateMaskPenalty(CBC_CommonByteMatrix* matrix); - static void TerminateBits(FX_INT32 numDataBytes, CBC_QRCoderBitVector* bits, FX_INT32 &e); - static FX_INT32 GetSpanByVersion(CBC_QRCoderMode *modeFirst, CBC_QRCoderMode *modeSecond, FX_INT32 versionNum, FX_INT32 &e); - static void MergeString(CFX_PtrArray &result, FX_INT32 versionNum, FX_INT32 &e); + static void InterleaveWithECBytes(CBC_QRCoderBitVector* bits, int32_t numTotalBytes, int32_t numDataBytes, int32_t numRSBlocks, CBC_QRCoderBitVector* result, int32_t &e); + static void GetNumDataBytesAndNumECBytesForBlockID(int32_t numTotalBytes, int32_t numDataBytes, + int32_t numRSBlocks, int32_t blockID, + int32_t &numDataBytesInBlock, int32_t& numECBytesInBlocks); + static CBC_CommonByteArray* GenerateECBytes(CBC_CommonByteArray* dataBytes, int32_t numEcBytesInBlock, int32_t &e); + static int32_t ChooseMaskPattern(CBC_QRCoderBitVector* bits, CBC_QRCoderErrorCorrectionLevel* ecLevel, + int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e); + static int32_t CalculateMaskPenalty(CBC_CommonByteMatrix* matrix); + static void TerminateBits(int32_t numDataBytes, CBC_QRCoderBitVector* bits, int32_t &e); + static int32_t GetSpanByVersion(CBC_QRCoderMode *modeFirst, CBC_QRCoderMode *modeSecond, int32_t versionNum, int32_t &e); + static void MergeString(CFX_PtrArray &result, int32_t versionNum, int32_t &e); static void SplitString(const CFX_ByteString &content, CFX_PtrArray &result); - static void AppendDataModeLenghInfo(CFX_PtrArray &splitResult, CBC_QRCoderBitVector &headerAndDataBits, CBC_QRCoderMode *tempMode, CBC_QRCoder *qrCode, CFX_ByteString &encoding, FX_INT32 &e); + static void AppendDataModeLenghInfo(CFX_PtrArray &splitResult, CBC_QRCoderBitVector &headerAndDataBits, CBC_QRCoderMode *tempMode, CBC_QRCoder *qrCode, CFX_ByteString &encoding, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp index f8aae491da..cccaf86da0 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp @@ -26,7 +26,7 @@ CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::L = NULL; CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::M = NULL; CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::Q = NULL; CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::H = NULL; -CBC_QRCoderErrorCorrectionLevel::CBC_QRCoderErrorCorrectionLevel(FX_INT32 ordinal, FX_INT32 bits, FX_CHAR* name) +CBC_QRCoderErrorCorrectionLevel::CBC_QRCoderErrorCorrectionLevel(int32_t ordinal, int32_t bits, FX_CHAR* name) { m_name += name; m_ordinal = ordinal; @@ -49,11 +49,11 @@ void CBC_QRCoderErrorCorrectionLevel::Finalize() delete Q; delete H; } -FX_INT32 CBC_QRCoderErrorCorrectionLevel::Ordinal() +int32_t CBC_QRCoderErrorCorrectionLevel::Ordinal() { return m_ordinal; } -FX_INT32 CBC_QRCoderErrorCorrectionLevel::GetBits() +int32_t CBC_QRCoderErrorCorrectionLevel::GetBits() { return m_bits; } @@ -61,7 +61,7 @@ CFX_ByteString CBC_QRCoderErrorCorrectionLevel::GetName() { return m_name; } -CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::ForBits(FX_INT32 bits) +CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::ForBits(int32_t bits) { switch(bits) { case 0x00: diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h index 907c20d1cc..e38abbcae9 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h @@ -9,10 +9,10 @@ class CBC_QRCoderErrorCorrectionLevel { private: - FX_INT32 m_ordinal; - FX_INT32 m_bits; + int32_t m_ordinal; + int32_t m_bits; CFX_ByteString m_name; - CBC_QRCoderErrorCorrectionLevel(FX_INT32 ordinal, FX_INT32 bits, FX_CHAR* name); + CBC_QRCoderErrorCorrectionLevel(int32_t ordinal, int32_t bits, FX_CHAR* name); CBC_QRCoderErrorCorrectionLevel(); public: static CBC_QRCoderErrorCorrectionLevel* L; @@ -22,10 +22,10 @@ public: virtual ~CBC_QRCoderErrorCorrectionLevel(); static void Initialize(); static void Finalize(); - FX_INT32 Ordinal(); - FX_INT32 GetBits(); + int32_t Ordinal(); + int32_t GetBits(); CFX_ByteString GetName(); static void Destroy(); - static CBC_QRCoderErrorCorrectionLevel* ForBits(FX_INT32 bits); + static CBC_QRCoderErrorCorrectionLevel* ForBits(int32_t bits); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.cpp index 5a205480ae..9c72140241 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.cpp @@ -23,8 +23,8 @@ #include "../barcode.h" #include "BC_QRCoderErrorCorrectionLevel.h" #include "BC_QRCoderFormatInformation.h" -const FX_INT32 CBC_QRCoderFormatInformation::FORMAT_INFO_MASK_QR = 0X5412; -const FX_INT32 CBC_QRCoderFormatInformation::FORMAT_INFO_DECODE_LOOKUP[32][2] = { +const int32_t CBC_QRCoderFormatInformation::FORMAT_INFO_MASK_QR = 0X5412; +const int32_t CBC_QRCoderFormatInformation::FORMAT_INFO_DECODE_LOOKUP[32][2] = { {0x5412, 0x00}, {0x5125, 0x01}, {0x5E7C, 0x02}, @@ -58,17 +58,17 @@ const FX_INT32 CBC_QRCoderFormatInformation::FORMAT_INFO_DECODE_LOOKUP[32][2] = {0x2EDA, 0x1E}, {0x2BED, 0x1F}, }; -const FX_INT32 CBC_QRCoderFormatInformation::BITS_SET_IN_HALF_BYTE[] = +const int32_t CBC_QRCoderFormatInformation::BITS_SET_IN_HALF_BYTE[] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; -CBC_QRCoderFormatInformation::CBC_QRCoderFormatInformation(FX_INT32 formatInfo) +CBC_QRCoderFormatInformation::CBC_QRCoderFormatInformation(int32_t formatInfo) { m_errorCorrectLevl = CBC_QRCoderErrorCorrectionLevel::ForBits((formatInfo >> 3) & 0x03); - m_dataMask = (FX_BYTE) (formatInfo & 0x07); + m_dataMask = (uint8_t) (formatInfo & 0x07); } CBC_QRCoderFormatInformation::~CBC_QRCoderFormatInformation() { } -FX_INT32 CBC_QRCoderFormatInformation::NumBitsDiffering(FX_INT32 a, FX_INT32 b) +int32_t CBC_QRCoderFormatInformation::NumBitsDiffering(int32_t a, int32_t b) { a ^= b; return BITS_SET_IN_HALF_BYTE[a & 0x0F] + @@ -80,7 +80,7 @@ FX_INT32 CBC_QRCoderFormatInformation::NumBitsDiffering(FX_INT32 a, FX_INT32 b) BITS_SET_IN_HALF_BYTE[(a >> 24) & 0x0F] + BITS_SET_IN_HALF_BYTE[(a >> 28) & 0x0F]; } -FX_BYTE CBC_QRCoderFormatInformation::GetDataMask() +uint8_t CBC_QRCoderFormatInformation::GetDataMask() { return m_dataMask; } @@ -88,7 +88,7 @@ CBC_QRCoderErrorCorrectionLevel *CBC_QRCoderFormatInformation::GetErrorCorrectio { return m_errorCorrectLevl; } -CBC_QRCoderFormatInformation* CBC_QRCoderFormatInformation::DecodeFormatInformation(FX_INT32 maskedFormatInfo) +CBC_QRCoderFormatInformation* CBC_QRCoderFormatInformation::DecodeFormatInformation(int32_t maskedFormatInfo) { CBC_QRCoderFormatInformation* formatInfo = DoDecodeFormatInformation(maskedFormatInfo); if(formatInfo != NULL) { @@ -96,17 +96,17 @@ CBC_QRCoderFormatInformation* CBC_QRCoderFormatInformation::DecodeFormatInformat } return DoDecodeFormatInformation(maskedFormatInfo ^ FORMAT_INFO_MASK_QR); } -CBC_QRCoderFormatInformation* CBC_QRCoderFormatInformation::DoDecodeFormatInformation(FX_INT32 maskedFormatInfo) +CBC_QRCoderFormatInformation* CBC_QRCoderFormatInformation::DoDecodeFormatInformation(int32_t maskedFormatInfo) { - FX_INT32 bestDifference = (FX_INT32)FXSYS_nan(); - FX_INT32 bestFormatInfo = 0; - for(FX_INT32 i = 0; i < 32; i++) { - FX_INT32 const* decodeInfo = &FORMAT_INFO_DECODE_LOOKUP[i][0]; - FX_INT32 targetInfo = decodeInfo[0]; + int32_t bestDifference = (int32_t)FXSYS_nan(); + int32_t bestFormatInfo = 0; + for(int32_t i = 0; i < 32; i++) { + int32_t const* decodeInfo = &FORMAT_INFO_DECODE_LOOKUP[i][0]; + int32_t targetInfo = decodeInfo[0]; if(targetInfo == maskedFormatInfo) { return FX_NEW CBC_QRCoderFormatInformation(decodeInfo[1]); } - FX_INT32 bitsDifference = NumBitsDiffering(maskedFormatInfo, targetInfo); + int32_t bitsDifference = NumBitsDiffering(maskedFormatInfo, targetInfo); if(bitsDifference < bestDifference) { bestFormatInfo = decodeInfo[1]; bestDifference = bitsDifference; diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.h index 49265e5033..5a0f15064c 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.h @@ -10,19 +10,19 @@ class CBC_QRCoderErrorCorrectionLevel; class CBC_QRCoderFormatInformation { private: - const static FX_INT32 FORMAT_INFO_MASK_QR; - const static FX_INT32 FORMAT_INFO_DECODE_LOOKUP[32][2]; - const static FX_INT32 BITS_SET_IN_HALF_BYTE[16]; + const static int32_t FORMAT_INFO_MASK_QR; + const static int32_t FORMAT_INFO_DECODE_LOOKUP[32][2]; + const static int32_t BITS_SET_IN_HALF_BYTE[16]; CBC_QRCoderErrorCorrectionLevel* m_errorCorrectLevl; - FX_BYTE m_dataMask; + uint8_t m_dataMask; public: - CBC_QRCoderFormatInformation(FX_INT32 formatInfo); + CBC_QRCoderFormatInformation(int32_t formatInfo); virtual ~CBC_QRCoderFormatInformation(); - FX_BYTE GetDataMask(); + uint8_t GetDataMask(); CBC_QRCoderErrorCorrectionLevel* GetErrorCorrectionLevel(); - static FX_INT32 NumBitsDiffering(FX_INT32 a, FX_INT32 b); - static CBC_QRCoderFormatInformation* DecodeFormatInformation(FX_INT32 maskedFormatInfo); - static CBC_QRCoderFormatInformation* DoDecodeFormatInformation(FX_INT32 maskedFormatInfo); + static int32_t NumBitsDiffering(int32_t a, int32_t b); + static CBC_QRCoderFormatInformation* DecodeFormatInformation(int32_t maskedFormatInfo); + static CBC_QRCoderFormatInformation* DoDecodeFormatInformation(int32_t maskedFormatInfo); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp index bc01eff442..f0e777c6eb 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp @@ -31,20 +31,20 @@ CBC_QRCoderMaskUtil::CBC_QRCoderMaskUtil() CBC_QRCoderMaskUtil::~CBC_QRCoderMaskUtil() { } -FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1(CBC_CommonByteMatrix* matrix) +int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1(CBC_CommonByteMatrix* matrix) { return ApplyMaskPenaltyRule1Internal(matrix, TRUE) + ApplyMaskPenaltyRule1Internal(matrix, FALSE); } -FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule2(CBC_CommonByteMatrix* matrix) +int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule2(CBC_CommonByteMatrix* matrix) { - FX_INT32 penalty = 0; - FX_BYTE* array = matrix->GetArray(); - FX_INT32 width = matrix->GetWidth(); - FX_INT32 height = matrix->GetHeight(); - for(FX_INT32 y = 0; y < height - 1; y++) { - for(FX_INT32 x = 0; x < width - 1; x++) { - FX_INT32 value = array[y * width + x]; + int32_t penalty = 0; + uint8_t* array = matrix->GetArray(); + int32_t width = matrix->GetWidth(); + int32_t height = matrix->GetHeight(); + for(int32_t y = 0; y < height - 1; y++) { + for(int32_t x = 0; x < width - 1; x++) { + int32_t value = array[y * width + x]; if(value == array[y * width + x + 1] && value == array[(y + 1) * width + x] && value == array[(y + 1) * width + x + 1]) { @@ -54,14 +54,14 @@ FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule2(CBC_CommonByteMatrix* matrix } return 3 * penalty; } -FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule3(CBC_CommonByteMatrix* matrix) +int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule3(CBC_CommonByteMatrix* matrix) { - FX_INT32 penalty = 0; - FX_BYTE* array = matrix->GetArray(); - FX_INT32 width = matrix->GetWidth(); - FX_INT32 height = matrix->GetHeight(); - for (FX_INT32 y = 0; y < height; ++y) { - for (FX_INT32 x = 0; x < width; ++x) { + int32_t penalty = 0; + uint8_t* array = matrix->GetArray(); + int32_t width = matrix->GetWidth(); + int32_t height = matrix->GetHeight(); + for (int32_t y = 0; y < height; ++y) { + for (int32_t x = 0; x < width; ++x) { if (x == 0 && ((y >= 0 && y <= 6) || (y >= height - 7 && y <= height - 1))) { continue; } @@ -118,30 +118,30 @@ FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule3(CBC_CommonByteMatrix* matrix } return penalty; } -FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule4(CBC_CommonByteMatrix* matrix) +int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule4(CBC_CommonByteMatrix* matrix) { - FX_INT32 numDarkCells = 0; - FX_BYTE* array = matrix->GetArray(); - FX_INT32 width = matrix->GetWidth(); - FX_INT32 height = matrix->GetHeight(); - for (FX_INT32 y = 0; y < height; ++y) { - for (FX_INT32 x = 0; x < width; ++x) { + int32_t numDarkCells = 0; + uint8_t* array = matrix->GetArray(); + int32_t width = matrix->GetWidth(); + int32_t height = matrix->GetHeight(); + for (int32_t y = 0; y < height; ++y) { + for (int32_t x = 0; x < width; ++x) { if (array[y * width + x] == 1) { numDarkCells += 1; } } } - FX_INT32 numTotalCells = matrix->GetHeight() * matrix->GetWidth(); + int32_t numTotalCells = matrix->GetHeight() * matrix->GetWidth(); double darkRatio = (double) numDarkCells / numTotalCells; - return abs( (FX_INT32) (darkRatio * 100 - 50) / 5 ) * 5 * 10; + return abs( (int32_t) (darkRatio * 100 - 50) / 5 ) * 5 * 10; } -FX_BOOL CBC_QRCoderMaskUtil::GetDataMaskBit(FX_INT32 maskPattern, FX_INT32 x, FX_INT32 y, FX_INT32 &e) +FX_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); } - FX_INT32 intermediate = 0, temp = 0; + int32_t intermediate = 0, temp = 0; switch(maskPattern) { case 0: intermediate = (y + x) & 0x1; @@ -177,19 +177,19 @@ FX_BOOL CBC_QRCoderMaskUtil::GetDataMaskBit(FX_INT32 maskPattern, FX_INT32 x, FX } return intermediate == 0; } -FX_INT32 CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1Internal(CBC_CommonByteMatrix* matrix, FX_BOOL isHorizontal) +int32_t CBC_QRCoderMaskUtil::ApplyMaskPenaltyRule1Internal(CBC_CommonByteMatrix* matrix, FX_BOOL isHorizontal) { - FX_INT32 penalty = 0; - FX_INT32 numSameBitCells = 0; - FX_INT32 prevBit = -1; - FX_INT32 width = matrix->GetWidth(); - FX_INT32 height = matrix->GetHeight(); - FX_INT32 iLimit = isHorizontal ? height : width; - FX_INT32 jLimit = isHorizontal ? width : height; - FX_BYTE* array = matrix->GetArray(); - for (FX_INT32 i = 0; i < iLimit; ++i) { - for (FX_INT32 j = 0; j < jLimit; ++j) { - FX_INT32 bit = isHorizontal ? array[i * width + j] : array[j * width + i]; + int32_t penalty = 0; + int32_t numSameBitCells = 0; + int32_t prevBit = -1; + int32_t width = matrix->GetWidth(); + int32_t height = matrix->GetHeight(); + int32_t iLimit = isHorizontal ? height : width; + int32_t jLimit = isHorizontal ? width : height; + uint8_t* array = matrix->GetArray(); + for (int32_t i = 0; i < iLimit; ++i) { + for (int32_t j = 0; j < jLimit; ++j) { + int32_t bit = isHorizontal ? array[i * width + j] : array[j * width + i]; if (bit == prevBit) { numSameBitCells += 1; if (numSameBitCells == 5) { diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.h index 13bb11691a..10ff964e97 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.h @@ -12,12 +12,12 @@ class CBC_QRCoderMaskUtil public: CBC_QRCoderMaskUtil(); virtual ~CBC_QRCoderMaskUtil(); - static FX_BOOL GetDataMaskBit(FX_INT32 maskPattern, FX_INT32 x, FX_INT32 y, FX_INT32 &e); + static FX_BOOL GetDataMaskBit(int32_t maskPattern, int32_t x, int32_t y, int32_t &e); - static FX_INT32 ApplyMaskPenaltyRule1(CBC_CommonByteMatrix* matrix); - static FX_INT32 ApplyMaskPenaltyRule2(CBC_CommonByteMatrix* matrix); - static FX_INT32 ApplyMaskPenaltyRule3(CBC_CommonByteMatrix* matrix); - static FX_INT32 ApplyMaskPenaltyRule4(CBC_CommonByteMatrix* matrix); - static FX_INT32 ApplyMaskPenaltyRule1Internal(CBC_CommonByteMatrix* matrix, FX_BOOL isHorizontal); + 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); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp index 4c2db5e34e..7caa6b5bab 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp @@ -27,7 +27,7 @@ #include "BC_QRCoderMaskUtil.h" #include "BC_QRCoderMatrixUtil.h" #include "BC_QRCoderBitVector.h" -const FX_INT32 CBC_QRCoderMatrixUtil::POSITION_DETECTION_PATTERN[7][7] = { +const int32_t CBC_QRCoderMatrixUtil::POSITION_DETECTION_PATTERN[7][7] = { 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, @@ -36,20 +36,20 @@ const FX_INT32 CBC_QRCoderMatrixUtil::POSITION_DETECTION_PATTERN[7][7] = { 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }; -const FX_INT32 CBC_QRCoderMatrixUtil::HORIZONTAL_SEPARATION_PATTERN[1][8] = { +const int32_t CBC_QRCoderMatrixUtil::HORIZONTAL_SEPARATION_PATTERN[1][8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -const FX_INT32 CBC_QRCoderMatrixUtil::VERTICAL_SEPARATION_PATTERN[7][1] = { +const int32_t CBC_QRCoderMatrixUtil::VERTICAL_SEPARATION_PATTERN[7][1] = { 0, 0, 0, 0, 0, 0, 0 }; -const FX_INT32 CBC_QRCoderMatrixUtil::POSITION_ADJUSTMENT_PATTERN[5][5] = { +const int32_t CBC_QRCoderMatrixUtil::POSITION_ADJUSTMENT_PATTERN[5][5] = { 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1 }; -const FX_INT32 CBC_QRCoderMatrixUtil::POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[40][7] = { +const int32_t CBC_QRCoderMatrixUtil::POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[40][7] = { { -1, -1, -1, -1, -1, -1, -1}, { 6, 18, -1, -1, -1, -1, -1}, { 6, 22, -1, -1, -1, -1, -1}, @@ -91,7 +91,7 @@ const FX_INT32 CBC_QRCoderMatrixUtil::POSITION_ADJUSTMENT_PATTERN_COORDINATE_TAB { 6, 26, 54, 82, 110, 138, 166}, { 6, 30, 58, 86, 114, 142, 170}, }; -const FX_INT32 CBC_QRCoderMatrixUtil::TYPE_INFO_COORDINATES[15][2] = { +const int32_t CBC_QRCoderMatrixUtil::TYPE_INFO_COORDINATES[15][2] = { {8, 0}, {8, 1}, {8, 2}, @@ -108,21 +108,21 @@ const FX_INT32 CBC_QRCoderMatrixUtil::TYPE_INFO_COORDINATES[15][2] = { {1, 8}, {0, 8}, }; -const FX_INT32 CBC_QRCoderMatrixUtil::VERSION_INFO_POLY = 0x1f25; -const FX_INT32 CBC_QRCoderMatrixUtil::TYPE_INFO_POLY = 0x0537; -const FX_INT32 CBC_QRCoderMatrixUtil::TYPE_INFO_MASK_PATTERN = 0x5412; -void CBC_QRCoderMatrixUtil::ClearMatrix(CBC_CommonByteMatrix* matrix, FX_INT32 &e) +const int32_t CBC_QRCoderMatrixUtil::VERSION_INFO_POLY = 0x1f25; +const int32_t CBC_QRCoderMatrixUtil::TYPE_INFO_POLY = 0x0537; +const int32_t CBC_QRCoderMatrixUtil::TYPE_INFO_MASK_PATTERN = 0x5412; +void CBC_QRCoderMatrixUtil::ClearMatrix(CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; BC_EXCEPTION_CHECK_ReturnVoid(e); } - matrix->clear((FX_BYTE) - 1); + matrix->clear((uint8_t) - 1); } void CBC_QRCoderMatrixUtil::BuildMatrix(CBC_QRCoderBitVector* dataBits, CBC_QRCoderErrorCorrectionLevel* ecLevel, - FX_INT32 version, FX_INT32 maskPattern, - CBC_CommonByteMatrix* matrix, FX_INT32 &e) + int32_t version, int32_t maskPattern, + CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; @@ -139,7 +139,7 @@ void CBC_QRCoderMatrixUtil::BuildMatrix(CBC_QRCoderBitVector* dataBits, EmbedDataBits(dataBits, maskPattern, matrix, e); BC_EXCEPTION_CHECK_ReturnVoid(e); } -void CBC_QRCoderMatrixUtil::EmbedBasicPatterns(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e) +void CBC_QRCoderMatrixUtil::EmbedBasicPatterns(int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; @@ -155,7 +155,7 @@ void CBC_QRCoderMatrixUtil::EmbedBasicPatterns(FX_INT32 version, CBC_CommonByteM BC_EXCEPTION_CHECK_ReturnVoid(e); } void CBC_QRCoderMatrixUtil::EmbedTypeInfo(CBC_QRCoderErrorCorrectionLevel* ecLevel, - FX_INT32 maskPattern, CBC_CommonByteMatrix *matrix, FX_INT32 &e) + int32_t maskPattern, CBC_CommonByteMatrix *matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; @@ -165,24 +165,24 @@ void CBC_QRCoderMatrixUtil::EmbedTypeInfo(CBC_QRCoderErrorCorrectionLevel* ecLev typeInfoBits.Init(); MakeTypeInfoBits(ecLevel, maskPattern, &typeInfoBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - for(FX_INT32 i = 0; i < typeInfoBits.Size(); i++) { - FX_INT32 bit = typeInfoBits.At(typeInfoBits.Size() - 1 - i, e); + for(int32_t i = 0; i < typeInfoBits.Size(); i++) { + int32_t bit = typeInfoBits.At(typeInfoBits.Size() - 1 - i, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 x1 = TYPE_INFO_COORDINATES[i][0]; - FX_INT32 y1 = TYPE_INFO_COORDINATES[i][1]; + int32_t x1 = TYPE_INFO_COORDINATES[i][0]; + int32_t y1 = TYPE_INFO_COORDINATES[i][1]; matrix->Set(x1, y1, bit); if(i < 8) { - FX_INT32 x2 = matrix->GetWidth() - i - 1; - FX_INT32 y2 = 8; + int32_t x2 = matrix->GetWidth() - i - 1; + int32_t y2 = 8; matrix->Set(x2, y2, bit); } else { - FX_INT32 x2 = 8; - FX_INT32 y2 = matrix->GetHeight() - 7 + (i - 8); + int32_t x2 = 8; + int32_t y2 = matrix->GetHeight() - 7 + (i - 8); matrix->Set(x2, y2, bit); } } } -void CBC_QRCoderMatrixUtil::MaybeEmbedVersionInfo(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e) +void CBC_QRCoderMatrixUtil::MaybeEmbedVersionInfo(int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; @@ -195,10 +195,10 @@ void CBC_QRCoderMatrixUtil::MaybeEmbedVersionInfo(FX_INT32 version, CBC_CommonBy versionInfoBits.Init(); MakeVersionInfoBits(version, &versionInfoBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 bitIndex = 6 * 3 - 1; - for(FX_INT32 i = 0; i < 6; i++) { - for(FX_INT32 j = 0; j < 3; j++) { - FX_INT32 bit = versionInfoBits.At(bitIndex, e); + int32_t bitIndex = 6 * 3 - 1; + for(int32_t i = 0; i < 6; i++) { + for(int32_t j = 0; j < 3; j++) { + int32_t bit = versionInfoBits.At(bitIndex, e); BC_EXCEPTION_CHECK_ReturnVoid(e); bitIndex--; matrix->Set(i, matrix->GetHeight() - 11 + j, bit); @@ -207,16 +207,16 @@ void CBC_QRCoderMatrixUtil::MaybeEmbedVersionInfo(FX_INT32 version, CBC_CommonBy } } void CBC_QRCoderMatrixUtil::EmbedDataBits(CBC_QRCoderBitVector* dataBits, - FX_INT32 maskPattern, CBC_CommonByteMatrix* matrix, FX_INT32 &e) + int32_t maskPattern, CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL || dataBits == NULL) { e = BCExceptionNullPointer; BC_EXCEPTION_CHECK_ReturnVoid(e); } - FX_INT32 bitIndex = 0; - FX_INT32 direction = -1; - FX_INT32 x = matrix->GetWidth() - 1; - FX_INT32 y = matrix->GetHeight() - 1; + int32_t bitIndex = 0; + int32_t direction = -1; + int32_t x = matrix->GetWidth() - 1; + int32_t y = matrix->GetHeight() - 1; while(x > 0) { if (x == 6) { x -= 1; @@ -226,12 +226,12 @@ void CBC_QRCoderMatrixUtil::EmbedDataBits(CBC_QRCoderBitVector* dataBits, y += direction; continue; } - for(FX_INT32 i = 0; i < 2; i++) { - FX_INT32 xx = x - i; + for(int32_t i = 0; i < 2; i++) { + int32_t xx = x - i; if(!IsEmpty(matrix->Get(xx, y))) { continue; } - FX_INT32 bit; + int32_t bit; if(bitIndex < dataBits->Size()) { bit = dataBits->At(bitIndex, e); BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -258,9 +258,9 @@ void CBC_QRCoderMatrixUtil::EmbedDataBits(CBC_QRCoderBitVector* dataBits, return; } } -FX_INT32 CBC_QRCoderMatrixUtil::CalculateBCHCode(FX_INT32 value, FX_INT32 poly) +int32_t CBC_QRCoderMatrixUtil::CalculateBCHCode(int32_t value, int32_t poly) { - FX_INT32 msbSetInPoly = FindMSBSet(poly); + int32_t msbSetInPoly = FindMSBSet(poly); value <<= msbSetInPoly - 1; while(FindMSBSet(value) >= msbSetInPoly) { value ^= poly << (FindMSBSet(value) - msbSetInPoly); @@ -268,7 +268,7 @@ FX_INT32 CBC_QRCoderMatrixUtil::CalculateBCHCode(FX_INT32 value, FX_INT32 poly) return value; } void CBC_QRCoderMatrixUtil::MakeTypeInfoBits(CBC_QRCoderErrorCorrectionLevel* ecLevel, - FX_INT32 maskPattern, CBC_QRCoderBitVector* bits, FX_INT32 &e) + int32_t maskPattern, CBC_QRCoderBitVector* bits, int32_t &e) { if(bits == NULL) { e = BCExceptionNullPointer; @@ -278,10 +278,10 @@ void CBC_QRCoderMatrixUtil::MakeTypeInfoBits(CBC_QRCoderErrorCorrectionLevel* ec e = BCExceptionBadMask; BC_EXCEPTION_CHECK_ReturnVoid(e); } - FX_INT32 typeInfo = (ecLevel->GetBits() << 3) | maskPattern; + int32_t typeInfo = (ecLevel->GetBits() << 3) | maskPattern; BC_EXCEPTION_CHECK_ReturnVoid(e); bits->AppendBits(typeInfo, 5, e); - FX_INT32 bchCode = CalculateBCHCode(typeInfo, TYPE_INFO_POLY); + int32_t bchCode = CalculateBCHCode(typeInfo, TYPE_INFO_POLY); BC_EXCEPTION_CHECK_ReturnVoid(e); bits->AppendBits(bchCode, 10, e); CBC_QRCoderBitVector maskBits; @@ -295,7 +295,7 @@ void CBC_QRCoderMatrixUtil::MakeTypeInfoBits(CBC_QRCoderErrorCorrectionLevel* ec BC_EXCEPTION_CHECK_ReturnVoid(e); } } -void CBC_QRCoderMatrixUtil::MakeVersionInfoBits(FX_INT32 version, CBC_QRCoderBitVector* bits, FX_INT32 &e) +void CBC_QRCoderMatrixUtil::MakeVersionInfoBits(int32_t version, CBC_QRCoderBitVector* bits, int32_t &e) { if(bits == NULL) { e = BCExceptionNullPointer; @@ -303,7 +303,7 @@ void CBC_QRCoderMatrixUtil::MakeVersionInfoBits(FX_INT32 version, CBC_QRCoderBit } bits->AppendBits(version, 6, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 bchCode = CalculateBCHCode(version, VERSION_INFO_POLY); + int32_t bchCode = CalculateBCHCode(version, VERSION_INFO_POLY); bits->AppendBits(bchCode, 12, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if(bits->Size() != 18) { @@ -311,22 +311,22 @@ void CBC_QRCoderMatrixUtil::MakeVersionInfoBits(FX_INT32 version, CBC_QRCoderBit BC_EXCEPTION_CHECK_ReturnVoid(e); } } -FX_BOOL CBC_QRCoderMatrixUtil::IsEmpty(FX_INT32 value) +FX_BOOL CBC_QRCoderMatrixUtil::IsEmpty(int32_t value) { - return (FX_BYTE)value == 0xff; + return (uint8_t)value == 0xff; } -FX_BOOL CBC_QRCoderMatrixUtil::IsValidValue(FX_INT32 value) +FX_BOOL CBC_QRCoderMatrixUtil::IsValidValue(int32_t value) { - return ((FX_BYTE)value == 0xff || (FX_BYTE)value == 0x00 || (FX_BYTE)value == 0x01); + return ((uint8_t)value == 0xff || (uint8_t)value == 0x00 || (uint8_t)value == 0x01); } -void CBC_QRCoderMatrixUtil::EmbedTimingPatterns(CBC_CommonByteMatrix* matrix, FX_INT32 &e) +void CBC_QRCoderMatrixUtil::EmbedTimingPatterns(CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; BC_EXCEPTION_CHECK_ReturnVoid(e); } - for(FX_INT32 i = 8; i < matrix->GetWidth() - 8; i++) { - FX_INT32 bit = (i + 1) % 2; + for(int32_t i = 8; i < matrix->GetWidth() - 8; i++) { + int32_t bit = (i + 1) % 2; if(!IsValidValue(matrix->Get(i, 6))) { e = BCExceptionInvalidateImageData; BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -343,7 +343,7 @@ void CBC_QRCoderMatrixUtil::EmbedTimingPatterns(CBC_CommonByteMatrix* matrix, FX } } } -void CBC_QRCoderMatrixUtil::EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* matrix, FX_INT32 &e) +void CBC_QRCoderMatrixUtil::EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; @@ -355,14 +355,14 @@ void CBC_QRCoderMatrixUtil::EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* } matrix->Set(8, matrix->GetHeight() - 8, 1); } -void CBC_QRCoderMatrixUtil::EmbedHorizontalSeparationPattern(FX_INT32 xStart, FX_INT32 yStart, - CBC_CommonByteMatrix* matrix, FX_INT32 &e) +void CBC_QRCoderMatrixUtil::EmbedHorizontalSeparationPattern(int32_t xStart, int32_t yStart, + CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; BC_EXCEPTION_CHECK_ReturnVoid(e); } - for(FX_INT32 x = 0; x < 8; x++) { + for(int32_t x = 0; x < 8; x++) { if(!IsEmpty(matrix->Get(xStart + x, yStart))) { e = BCExceptionInvalidateData; BC_EXCEPTION_CHECK_ReturnVoid(e) @@ -370,14 +370,14 @@ void CBC_QRCoderMatrixUtil::EmbedHorizontalSeparationPattern(FX_INT32 xStart, FX matrix->Set(xStart + x, yStart, HORIZONTAL_SEPARATION_PATTERN[0][x]); } } -void CBC_QRCoderMatrixUtil::EmbedVerticalSeparationPattern(FX_INT32 xStart, FX_INT32 yStart, - CBC_CommonByteMatrix* matrix, FX_INT32 &e) +void CBC_QRCoderMatrixUtil::EmbedVerticalSeparationPattern(int32_t xStart, int32_t yStart, + CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; BC_EXCEPTION_CHECK_ReturnVoid(e); } - for(FX_INT32 y = 0; y < 7; y++) { + for(int32_t y = 0; y < 7; y++) { if(!IsEmpty(matrix->Get(xStart, yStart + y))) { e = BCExceptionInvalidateData; BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -385,15 +385,15 @@ void CBC_QRCoderMatrixUtil::EmbedVerticalSeparationPattern(FX_INT32 xStart, FX_I matrix->Set(xStart, yStart + y, VERTICAL_SEPARATION_PATTERN[y][0]); } } -void CBC_QRCoderMatrixUtil::EmbedPositionAdjustmentPattern(FX_INT32 xStart, FX_INT32 yStart, - CBC_CommonByteMatrix* matrix, FX_INT32 &e) +void CBC_QRCoderMatrixUtil::EmbedPositionAdjustmentPattern(int32_t xStart, int32_t yStart, + CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; BC_EXCEPTION_CHECK_ReturnVoid(e); } - for(FX_INT32 y = 0; y < 5; y++) { - for(FX_INT32 x = 0; x < 5; x++) { + for(int32_t y = 0; y < 5; y++) { + for(int32_t x = 0; x < 5; x++) { if(!IsEmpty(matrix->Get(xStart + x, y + yStart))) { e = BCExceptionInvalidateData; BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -402,15 +402,15 @@ void CBC_QRCoderMatrixUtil::EmbedPositionAdjustmentPattern(FX_INT32 xStart, FX_I } } } -void CBC_QRCoderMatrixUtil::EmbedPositionDetectionPattern (FX_INT32 xStart, FX_INT32 yStart, - CBC_CommonByteMatrix* matrix, FX_INT32 &e) +void CBC_QRCoderMatrixUtil::EmbedPositionDetectionPattern (int32_t xStart, int32_t yStart, + CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; BC_EXCEPTION_CHECK_ReturnVoid(e); } - for(FX_INT32 y = 0; y < 7; y++) { - for(FX_INT32 x = 0; x < 7; x++) { + for(int32_t y = 0; y < 7; y++) { + for(int32_t x = 0; x < 7; x++) { if(!IsEmpty(matrix->Get(xStart + x, yStart + y))) { e = BCExceptionInvalidateData; BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -419,27 +419,27 @@ void CBC_QRCoderMatrixUtil::EmbedPositionDetectionPattern (FX_INT32 xStart, FX_I } } } -void CBC_QRCoderMatrixUtil::EmbedPositionDetectionPatternsAndSeparators(CBC_CommonByteMatrix* matrix, FX_INT32 &e) +void CBC_QRCoderMatrixUtil::EmbedPositionDetectionPatternsAndSeparators(CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; BC_EXCEPTION_CHECK_ReturnVoid(e); } - FX_INT32 pdpWidth = 7; + int32_t pdpWidth = 7; EmbedPositionDetectionPattern(0, 0, matrix, e); BC_EXCEPTION_CHECK_ReturnVoid(e); EmbedPositionDetectionPattern(matrix->GetWidth() - pdpWidth, 0, matrix, e); BC_EXCEPTION_CHECK_ReturnVoid(e); EmbedPositionDetectionPattern(0, matrix->GetWidth() - pdpWidth, matrix, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 hspWidth = 8; + int32_t hspWidth = 8; EmbedHorizontalSeparationPattern(0, hspWidth - 1, matrix, e); BC_EXCEPTION_CHECK_ReturnVoid(e); EmbedHorizontalSeparationPattern(matrix->GetWidth() - hspWidth, hspWidth - 1, matrix, e); BC_EXCEPTION_CHECK_ReturnVoid(e); EmbedHorizontalSeparationPattern(0, matrix->GetWidth() - hspWidth, matrix, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 vspSize = 7; + int32_t vspSize = 7; EmbedVerticalSeparationPattern(vspSize, 0, matrix, e); BC_EXCEPTION_CHECK_ReturnVoid(e); EmbedVerticalSeparationPattern(matrix->GetHeight() - vspSize - 1, 0, matrix, e); @@ -447,7 +447,7 @@ void CBC_QRCoderMatrixUtil::EmbedPositionDetectionPatternsAndSeparators(CBC_Comm EmbedVerticalSeparationPattern(vspSize, matrix->GetHeight() - vspSize, matrix, e); BC_EXCEPTION_CHECK_ReturnVoid(e); } -void CBC_QRCoderMatrixUtil::MaybeEmbedPositionAdjustmentPatterns(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e) +void CBC_QRCoderMatrixUtil::MaybeEmbedPositionAdjustmentPatterns(int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e) { if(matrix == NULL) { e = BCExceptionNullPointer; @@ -456,13 +456,13 @@ void CBC_QRCoderMatrixUtil::MaybeEmbedPositionAdjustmentPatterns(FX_INT32 versio if(version < 2) { return; } - FX_INT32 index = version - 1; - FX_INT32 const* coordinates = &(POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[index][0]); - FX_INT32 numCoordinate = 7; - for(FX_INT32 i = 0; i < numCoordinate; i++) { - for(FX_INT32 j = 0; j < numCoordinate; j++) { - FX_INT32 y = coordinates[i]; - FX_INT32 x = coordinates[j]; + int32_t index = version - 1; + int32_t const* coordinates = &(POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[index][0]); + int32_t numCoordinate = 7; + for(int32_t i = 0; i < numCoordinate; i++) { + for(int32_t j = 0; j < numCoordinate; j++) { + int32_t y = coordinates[i]; + int32_t x = coordinates[j]; if(x == -1 || y == -1) { continue; } @@ -473,9 +473,9 @@ void CBC_QRCoderMatrixUtil::MaybeEmbedPositionAdjustmentPatterns(FX_INT32 versio } } } -FX_INT32 CBC_QRCoderMatrixUtil::FindMSBSet(FX_INT32 value) +int32_t CBC_QRCoderMatrixUtil::FindMSBSet(int32_t value) { - FX_INT32 numDigits = 0; + int32_t numDigits = 0; while(value != 0) { value >>= 1; ++numDigits; diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h index ce1e65d4c2..5da32441fc 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h @@ -12,38 +12,38 @@ class CBC_QRCoderBitVector; class CBC_QRCoderMatrixUtil { private: - const static FX_INT32 POSITION_DETECTION_PATTERN[7][7]; - const static FX_INT32 VERTICAL_SEPARATION_PATTERN[7][1]; - const static FX_INT32 HORIZONTAL_SEPARATION_PATTERN[1][8]; - const static FX_INT32 POSITION_ADJUSTMENT_PATTERN[5][5]; - const static FX_INT32 POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[40][7]; - const static FX_INT32 TYPE_INFO_COORDINATES[15][2]; - const static FX_INT32 VERSION_INFO_POLY; - const static FX_INT32 TYPE_INFO_POLY; - const static FX_INT32 TYPE_INFO_MASK_PATTERN; + const static int32_t POSITION_DETECTION_PATTERN[7][7]; + const static int32_t VERTICAL_SEPARATION_PATTERN[7][1]; + const static int32_t HORIZONTAL_SEPARATION_PATTERN[1][8]; + const static int32_t POSITION_ADJUSTMENT_PATTERN[5][5]; + const static int32_t POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[40][7]; + const static int32_t TYPE_INFO_COORDINATES[15][2]; + const static int32_t VERSION_INFO_POLY; + const static int32_t TYPE_INFO_POLY; + const static int32_t TYPE_INFO_MASK_PATTERN; public: CBC_QRCoderMatrixUtil(); virtual ~CBC_QRCoderMatrixUtil(); - static void ClearMatrix(CBC_CommonByteMatrix* matrix, FX_INT32 &e); + static void ClearMatrix(CBC_CommonByteMatrix* matrix, int32_t &e); static void BuildMatrix(CBC_QRCoderBitVector* dataBits, CBC_QRCoderErrorCorrectionLevel* ecLevel, - FX_INT32 version, FX_INT32 maskPattern, CBC_CommonByteMatrix* matrix, FX_INT32 &e); - static void EmbedBasicPatterns(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e); - static void EmbedTypeInfo(CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 maskPattern, CBC_CommonByteMatrix *matrix, FX_INT32 &e); - static void EmbedDataBits(CBC_QRCoderBitVector* dataBits, FX_INT32 maskPattern, CBC_CommonByteMatrix* matrix, FX_INT32 &e); - static void MaybeEmbedVersionInfo(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e); - static FX_INT32 FindMSBSet(FX_INT32 value); - static FX_INT32 CalculateBCHCode(FX_INT32 code, FX_INT32 poly); - static void MakeTypeInfoBits(CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 maskPattern, CBC_QRCoderBitVector* bits, FX_INT32 &e); - static void MakeVersionInfoBits(FX_INT32 version, CBC_QRCoderBitVector* bits, FX_INT32 &e); - static FX_BOOL IsEmpty(FX_INT32 value); - static FX_BOOL IsValidValue(FX_INT32 value); - static void EmbedTimingPatterns(CBC_CommonByteMatrix* matrix, FX_INT32 &e); - static void EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* matrix, FX_INT32 &e); - static void EmbedHorizontalSeparationPattern(FX_INT32 xStart, FX_INT32 yStart, CBC_CommonByteMatrix* matrix, FX_INT32 &e); - static void EmbedVerticalSeparationPattern(FX_INT32 xStart, FX_INT32 yStart, CBC_CommonByteMatrix* matrix, FX_INT32 &e); - static void EmbedPositionAdjustmentPattern(FX_INT32 xStart, FX_INT32 yStart, CBC_CommonByteMatrix* matrix, FX_INT32 &e); - static void EmbedPositionDetectionPattern(FX_INT32 xStart, FX_INT32 yStart, CBC_CommonByteMatrix* matrix, FX_INT32 &e); - static void EmbedPositionDetectionPatternsAndSeparators(CBC_CommonByteMatrix* matrix, FX_INT32 &e); - static void MaybeEmbedPositionAdjustmentPatterns(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e); + int32_t version, int32_t maskPattern, CBC_CommonByteMatrix* matrix, int32_t &e); + static void EmbedBasicPatterns(int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e); + static void EmbedTypeInfo(CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t maskPattern, CBC_CommonByteMatrix *matrix, int32_t &e); + static void EmbedDataBits(CBC_QRCoderBitVector* dataBits, int32_t maskPattern, CBC_CommonByteMatrix* matrix, int32_t &e); + static void MaybeEmbedVersionInfo(int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e); + static int32_t FindMSBSet(int32_t value); + static int32_t CalculateBCHCode(int32_t code, int32_t poly); + static void MakeTypeInfoBits(CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t maskPattern, CBC_QRCoderBitVector* bits, int32_t &e); + 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 void EmbedTimingPatterns(CBC_CommonByteMatrix* matrix, int32_t &e); + static void EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* matrix, int32_t &e); + static void EmbedHorizontalSeparationPattern(int32_t xStart, int32_t yStart, CBC_CommonByteMatrix* matrix, int32_t &e); + static void EmbedVerticalSeparationPattern(int32_t xStart, int32_t yStart, CBC_CommonByteMatrix* matrix, int32_t &e); + static void EmbedPositionAdjustmentPattern(int32_t xStart, int32_t yStart, CBC_CommonByteMatrix* matrix, int32_t &e); + static void EmbedPositionDetectionPattern(int32_t xStart, int32_t yStart, CBC_CommonByteMatrix* matrix, int32_t &e); + static void EmbedPositionDetectionPatternsAndSeparators(CBC_CommonByteMatrix* matrix, int32_t &e); + static void MaybeEmbedPositionAdjustmentPatterns(int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.cpp index 00c7e47cb7..5bc2fe0623 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.cpp @@ -33,9 +33,9 @@ CBC_QRCoderMode* CBC_QRCoderMode::sTERMINATOR = NULL; CBC_QRCoderMode* CBC_QRCoderMode::sFNC1_FIRST_POSITION = NULL; CBC_QRCoderMode* CBC_QRCoderMode::sFNC1_SECOND_POSITION = NULL; CBC_QRCoderMode* CBC_QRCoderMode::sSTRUCTURED_APPEND = NULL; -CBC_QRCoderMode::CBC_QRCoderMode(FX_INT32 *characterCountBitsForVersions, - FX_INT32 x1, FX_INT32 x2, FX_INT32 x3, - FX_INT32 bits, CFX_ByteString name) +CBC_QRCoderMode::CBC_QRCoderMode(int32_t *characterCountBitsForVersions, + int32_t x1, int32_t x2, int32_t x3, + int32_t bits, CFX_ByteString name) { m_characterCountBitsForVersions = characterCountBitsForVersions; if (m_characterCountBitsForVersions != NULL) { @@ -54,16 +54,16 @@ CBC_QRCoderMode::~CBC_QRCoderMode() } void CBC_QRCoderMode::Initialize() { - sBYTE = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 8, 16, 16, 0x4, "BYTE"); - sALPHANUMERIC = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 9, 11, 13, 0x2, "ALPHANUMERIC"); + sBYTE = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 16, 16, 0x4, "BYTE"); + sALPHANUMERIC = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 9, 11, 13, 0x2, "ALPHANUMERIC"); sECI = FX_NEW CBC_QRCoderMode(NULL, 0, 0, 0, 0x7, "ECI"); - sKANJI = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 8, 10, 12, 0x8, "KANJI"); - sNUMERIC = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 10, 12, 14, 0x1, "NUMERIC"); - sGBK = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 8, 10, 12, 0x0D, "GBK"); - sTERMINATOR = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 0, 0, 0, 0x00, "TERMINATOR"); + sKANJI = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 10, 12, 0x8, "KANJI"); + sNUMERIC = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 10, 12, 14, 0x1, "NUMERIC"); + sGBK = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 8, 10, 12, 0x0D, "GBK"); + sTERMINATOR = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 0, 0, 0, 0x00, "TERMINATOR"); sFNC1_FIRST_POSITION = FX_NEW CBC_QRCoderMode(NULL, 0, 0, 0, 0x05, "FNC1_FIRST_POSITION"); sFNC1_SECOND_POSITION = FX_NEW CBC_QRCoderMode(NULL, 0, 0, 0, 0x09, "FNC1_SECOND_POSITION"); - sSTRUCTURED_APPEND = FX_NEW CBC_QRCoderMode(FX_Alloc(FX_INT32, 3), 0, 0, 0, 0x03, "STRUCTURED_APPEND"); + sSTRUCTURED_APPEND = FX_NEW CBC_QRCoderMode(FX_Alloc(int32_t, 3), 0, 0, 0, 0x03, "STRUCTURED_APPEND"); } void CBC_QRCoderMode::Finalize() { @@ -78,7 +78,7 @@ void CBC_QRCoderMode::Finalize() delete sFNC1_SECOND_POSITION; delete sSTRUCTURED_APPEND; } -CBC_QRCoderMode* CBC_QRCoderMode::ForBits(FX_INT32 bits, FX_INT32 &e) +CBC_QRCoderMode* CBC_QRCoderMode::ForBits(int32_t bits, int32_t &e) { switch (bits) { case 0x0: @@ -108,7 +108,7 @@ CBC_QRCoderMode* CBC_QRCoderMode::ForBits(FX_INT32 bits, FX_INT32 &e) } return NULL; } -FX_INT32 CBC_QRCoderMode::GetBits() +int32_t CBC_QRCoderMode::GetBits() { return m_bits; } @@ -116,14 +116,14 @@ CFX_ByteString CBC_QRCoderMode::GetName() { return m_name; } -FX_INT32 CBC_QRCoderMode::GetCharacterCountBits(CBC_QRCoderVersion* version, FX_INT32 &e) +int32_t CBC_QRCoderMode::GetCharacterCountBits(CBC_QRCoderVersion* version, int32_t &e) { if(m_characterCountBitsForVersions == NULL) { e = BCExceptionCharacterNotThisMode; BC_EXCEPTION_CHECK_ReturnValue(e, 0); } - FX_INT32 number = version->GetVersionNumber(); - FX_INT32 offset; + int32_t number = version->GetVersionNumber(); + int32_t offset; if(number <= 9) { offset = 0; } else if(number <= 26) { diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.h index fbd90871cf..472d3b1198 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderMode.h @@ -10,10 +10,10 @@ class CBC_QRCoderVersion; class CBC_QRCoderMode { private: - FX_INT32* m_characterCountBitsForVersions; - FX_INT32 m_bits; + int32_t* m_characterCountBitsForVersions; + int32_t m_bits; CFX_ByteString m_name; - CBC_QRCoderMode(FX_INT32 *characterCountBitsForVersions, FX_INT32 x1, FX_INT32 x2, FX_INT32 x3, FX_INT32 bits, CFX_ByteString name); + CBC_QRCoderMode(int32_t *characterCountBitsForVersions, int32_t x1, int32_t x2, int32_t x3, int32_t bits, CFX_ByteString name); CBC_QRCoderMode(); public: static CBC_QRCoderMode* sBYTE; @@ -30,9 +30,9 @@ public: static void Initialize(); static void Finalize(); - static CBC_QRCoderMode* ForBits(FX_INT32 bits, FX_INT32 &e); - FX_INT32 GetCharacterCountBits(CBC_QRCoderVersion* version, FX_INT32 &e); - FX_INT32 GetBits(); + static CBC_QRCoderMode* ForBits(int32_t bits, int32_t &e); + int32_t GetCharacterCountBits(CBC_QRCoderVersion* version, int32_t &e); + int32_t GetBits(); CFX_ByteString GetName(); static void Destroy(); }; diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.cpp index 9ff54f2a13..e0acf46fb9 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.cpp @@ -29,7 +29,7 @@ #include "BC_QRCoderBitVector.h" #include "BC_QRCoderECBlocks.h" #include "BC_QRCoderVersion.h" -const FX_INT32 CBC_QRCoderVersion::VERSION_DECODE_INFO[] = { +const int32_t CBC_QRCoderVersion::VERSION_DECODE_INFO[] = { 0x07C94, 0x085BC, 0x09A99, 0x0A4D3, 0x0BBF6, 0x0C762, 0x0D847, 0x0E60D, 0x0F928, 0x10B78, 0x1145D, 0x12A17, 0x13532, 0x149A6, 0x15683, @@ -45,13 +45,13 @@ void CBC_QRCoderVersion::Initialize() } void CBC_QRCoderVersion::Finalize() { - for(FX_INT32 i = 0 ; i < VERSION->GetSize(); i++) { + for(int32_t i = 0 ; i < VERSION->GetSize(); i++) { CBC_QRCoderVersion* v = (CBC_QRCoderVersion*)(VERSION->GetAt(i)); delete v; } delete VERSION; } -CBC_QRCoderVersion::CBC_QRCoderVersion(FX_INT32 versionNumber, +CBC_QRCoderVersion::CBC_QRCoderVersion(int32_t versionNumber, CBC_QRCoderECBlocks* ecBlocks1, CBC_QRCoderECBlocks* ecBlocks2, CBC_QRCoderECBlocks* ecBlocks3, @@ -62,10 +62,10 @@ CBC_QRCoderVersion::CBC_QRCoderVersion(FX_INT32 versionNumber, m_ecBlocks.Add(ecBlocks2); m_ecBlocks.Add(ecBlocks3); m_ecBlocks.Add(ecBlocks4); - FX_INT32 total = 0; - FX_INT32 ecCodeWords = ecBlocks1->GetECCodeWordsPerBlock(); + int32_t total = 0; + int32_t ecCodeWords = ecBlocks1->GetECCodeWordsPerBlock(); CFX_PtrArray* ecbArray = ecBlocks1->GetECBlocks(); - for(FX_INT32 i = 0; i < ecbArray->GetSize(); i++) { + for(int32_t i = 0; i < ecbArray->GetSize(); i++) { CBC_QRCoderECB* ecBlock = (CBC_QRCoderECB*)((*ecbArray)[i]); total += ecBlock->GetCount() * (ecBlock->GetDataCodeWords() + ecCodeWords); } @@ -334,15 +334,15 @@ CBC_QRCoderVersion::CBC_QRCoderVersion(FX_INT32 versionNumber, CBC_QRCoderVersion::~CBC_QRCoderVersion() { if(m_ecBlocks.GetSize() != 0) { - FX_INT32 itBeg = 0; - FX_INT32 itEnd = m_ecBlocks.GetSize(); + int32_t itBeg = 0; + int32_t itEnd = m_ecBlocks.GetSize(); while(itBeg != itEnd) { delete ( (CBC_QRCoderECBlocks*)(m_ecBlocks[itBeg]) ); itBeg++; } } } -FX_INT32 CBC_QRCoderVersion::GetVersionNumber() +int32_t CBC_QRCoderVersion::GetVersionNumber() { return m_versionNumber; } @@ -350,11 +350,11 @@ CFX_Int32Array* CBC_QRCoderVersion::GetAlignmentPatternCenters() { return &m_alignmentPatternCenters; } -FX_INT32 CBC_QRCoderVersion::GetTotalCodeWords() +int32_t CBC_QRCoderVersion::GetTotalCodeWords() { return m_totalCodeWords; } -FX_INT32 CBC_QRCoderVersion::GetDimensionForVersion() +int32_t CBC_QRCoderVersion::GetDimensionForVersion() { return 17 + 4 * m_versionNumber; } @@ -362,7 +362,7 @@ CBC_QRCoderECBlocks* CBC_QRCoderVersion::GetECBlocksForLevel(CBC_QRCoderErrorCor { return (CBC_QRCoderECBlocks*)m_ecBlocks[ecLevel->Ordinal()]; } -CBC_QRCoderVersion* CBC_QRCoderVersion::GetProvisionalVersionForDimension(FX_INT32 dimension, FX_INT32 &e) +CBC_QRCoderVersion* CBC_QRCoderVersion::GetProvisionalVersionForDimension(int32_t dimension, int32_t &e) { if((dimension % 4) != 1) { e = BCExceptionRead; @@ -372,18 +372,18 @@ CBC_QRCoderVersion* CBC_QRCoderVersion::GetProvisionalVersionForDimension(FX_INT BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return qcv; } -CBC_QRCoderVersion* CBC_QRCoderVersion::DecodeVersionInformation(FX_INT32 versionBits, FX_INT32 &e) +CBC_QRCoderVersion* CBC_QRCoderVersion::DecodeVersionInformation(int32_t versionBits, int32_t &e) { - FX_INT32 bestDifference = FXSYS_IntMax; - FX_INT32 bestVersion = 0; - for (FX_INT32 i = 0; i < 34; i++) { - FX_INT32 targetVersion = VERSION_DECODE_INFO[i]; + int32_t bestDifference = FXSYS_IntMax; + int32_t bestVersion = 0; + for (int32_t i = 0; i < 34; i++) { + int32_t targetVersion = VERSION_DECODE_INFO[i]; if(targetVersion == versionBits) { CBC_QRCoderVersion* qcv = GetVersionForNumber(i + 7, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return qcv; } - FX_INT32 bitsDifference = CBC_QRCoderFormatInformation::NumBitsDiffering(versionBits, targetVersion); + int32_t bitsDifference = CBC_QRCoderFormatInformation::NumBitsDiffering(versionBits, targetVersion); if(bitsDifference < bestDifference) { bestVersion = i + 7; bestDifference = bitsDifference; @@ -396,9 +396,9 @@ CBC_QRCoderVersion* CBC_QRCoderVersion::DecodeVersionInformation(FX_INT32 versio } return NULL; } -CBC_CommonBitMatrix* CBC_QRCoderVersion::BuildFunctionPattern(FX_INT32 &e) +CBC_CommonBitMatrix* CBC_QRCoderVersion::BuildFunctionPattern(int32_t &e) { - FX_INT32 dimension = GetDimensionForVersion(); + int32_t dimension = GetDimensionForVersion(); CBC_CommonBitMatrix* bitMatrix = FX_NEW CBC_CommonBitMatrix(); bitMatrix->Init(dimension); bitMatrix->SetRegion(0, 0 , 9, 9, e); @@ -407,10 +407,10 @@ CBC_CommonBitMatrix* CBC_QRCoderVersion::BuildFunctionPattern(FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL); bitMatrix->SetRegion(0, dimension - 8, 9, 8, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 max = m_alignmentPatternCenters.GetSize(); - for (FX_INT32 x = 0; x < max; x++) { - FX_INT32 i = m_alignmentPatternCenters[x] - 2; - for (FX_INT32 y = 0; y < max; y++) { + int32_t max = m_alignmentPatternCenters.GetSize(); + for (int32_t x = 0; x < max; x++) { + int32_t i = m_alignmentPatternCenters[x] - 2; + for (int32_t y = 0; y < max; y++) { if ((x == 0 && (y == 0 || y == max - 1)) || (x == max - 1 && y == 0)) { continue; } @@ -430,7 +430,7 @@ CBC_CommonBitMatrix* CBC_QRCoderVersion::BuildFunctionPattern(FX_INT32 &e) } return bitMatrix; } -CBC_QRCoderVersion* CBC_QRCoderVersion::GetVersionForNumber(FX_INT32 versionNumber, FX_INT32 &e) +CBC_QRCoderVersion* CBC_QRCoderVersion::GetVersionForNumber(int32_t versionNumber, int32_t &e) { if(VERSION->GetSize() == 0) { VERSION->Add(FX_NEW CBC_QRCoderVersion(1, @@ -770,7 +770,7 @@ CBC_QRCoderVersion* CBC_QRCoderVersion::GetVersionForNumber(FX_INT32 versionNumb } void CBC_QRCoderVersion::Destroy() { - FX_INT32 i; + int32_t i; for(i = 0; i < VERSION->GetSize(); i++) { delete ( (CBC_QRCoderVersion*)(*VERSION)[i] ); } diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h index 17d392121d..46a80c8d09 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h @@ -12,30 +12,30 @@ class CBC_QRCoderErrorCorrectionLevel; class CBC_QRCoderVersion { private: - const static FX_INT32 VERSION_DECODE_INFO[34]; + const static int32_t VERSION_DECODE_INFO[34]; static CFX_PtrArray *VERSION; - FX_INT32 m_versionNumber; - FX_INT32 m_totalCodeWords; + int32_t m_versionNumber; + int32_t m_totalCodeWords; CFX_Int32Array m_alignmentPatternCenters; CFX_PtrArray m_ecBlocks; CBC_QRCoderVersion(); - CBC_QRCoderVersion(FX_INT32 versionNumber, CBC_QRCoderECBlocks* ecBlocks1, CBC_QRCoderECBlocks* ecBlocks2, + CBC_QRCoderVersion(int32_t versionNumber, CBC_QRCoderECBlocks* ecBlocks1, CBC_QRCoderECBlocks* ecBlocks2, CBC_QRCoderECBlocks* ecBlocks3, CBC_QRCoderECBlocks* ecBlocks4); public: virtual ~CBC_QRCoderVersion(); static void Initialize(); static void Finalize(); - FX_INT32 GetVersionNumber(); - FX_INT32 GetTotalCodeWords(); - FX_INT32 GetDimensionForVersion(); - CBC_CommonBitMatrix *BuildFunctionPattern(FX_INT32 &e); + int32_t GetVersionNumber(); + int32_t GetTotalCodeWords(); + int32_t GetDimensionForVersion(); + CBC_CommonBitMatrix *BuildFunctionPattern(int32_t &e); CFX_Int32Array* GetAlignmentPatternCenters(); CBC_QRCoderECBlocks* GetECBlocksForLevel(CBC_QRCoderErrorCorrectionLevel *ecLevel); - static CBC_QRCoderVersion* GetVersionForNumber(FX_INT32 versionNumber, FX_INT32 &e); - static CBC_QRCoderVersion* GetProvisionalVersionForDimension(FX_INT32 dimension, FX_INT32 &e); - static CBC_QRCoderVersion* DecodeVersionInformation(FX_INT32 versionBits, FX_INT32 &e); + static CBC_QRCoderVersion* GetVersionForNumber(int32_t versionNumber, int32_t &e); + static CBC_QRCoderVersion* GetProvisionalVersionForDimension(int32_t dimension, int32_t &e); + static CBC_QRCoderVersion* DecodeVersionInformation(int32_t versionBits, int32_t &e); static void Destroy(); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp index 87c14deac9..2877d2f82b 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp @@ -25,7 +25,7 @@ #include "BC_QRCoderECB.h" #include "BC_QRDataBlock.h" #include "BC_QRCoderVersion.h" -CBC_QRDataBlock::CBC_QRDataBlock(FX_INT32 numDataCodewords, CFX_ByteArray *codewords) +CBC_QRDataBlock::CBC_QRDataBlock(int32_t numDataCodewords, CFX_ByteArray *codewords) : m_numDataCodewords(numDataCodewords) , m_codewords(codewords) { @@ -37,7 +37,7 @@ CBC_QRDataBlock::~CBC_QRDataBlock() m_codewords = NULL; } } -FX_INT32 CBC_QRDataBlock::GetNumDataCodewords() +int32_t CBC_QRDataBlock::GetNumDataCodewords() { return m_numDataCodewords; } @@ -45,47 +45,47 @@ CFX_ByteArray *CBC_QRDataBlock::GetCodewords() { return m_codewords; } -CFX_PtrArray *CBC_QRDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_QRCoderVersion *version, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e) +CFX_PtrArray *CBC_QRDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_QRCoderVersion *version, CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t &e) { if(rawCodewords->GetSize() != version->GetTotalCodeWords()) { e = BCExceptionIllegalArgument; BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } CBC_QRCoderECBlocks *ecBlocks = version->GetECBlocksForLevel(ecLevel); - FX_INT32 totalBlocks = 0; + int32_t totalBlocks = 0; CFX_PtrArray* ecBlockArray = ecBlocks->GetECBlocks(); - FX_INT32 i = 0; + int32_t i = 0; for(i = 0; i < ecBlockArray->GetSize(); i++) { totalBlocks += ((CBC_QRCoderECB*)(*ecBlockArray)[i])->GetCount(); } CFX_PtrArray *datablock = FX_NEW CFX_PtrArray(); datablock->SetSize(totalBlocks); CBC_AutoPtr result(datablock); - FX_INT32 numResultBlocks = 0; - for(FX_INT32 j = 0; j < ecBlockArray->GetSize(); j++) { + int32_t numResultBlocks = 0; + for(int32_t j = 0; j < ecBlockArray->GetSize(); j++) { CBC_QRCoderECB *ecBlock = (CBC_QRCoderECB*)(*ecBlockArray)[j]; - for(FX_INT32 k = 0; k < ecBlock->GetCount(); k++) { - FX_INT32 numDataCodewords = ecBlock->GetDataCodeWords(); - FX_INT32 numBlockCodewords = ecBlocks->GetECCodeWordsPerBlock() + numDataCodewords; + for(int32_t k = 0; k < ecBlock->GetCount(); k++) { + int32_t numDataCodewords = ecBlock->GetDataCodeWords(); + int32_t numBlockCodewords = ecBlocks->GetECCodeWordsPerBlock() + numDataCodewords; CFX_ByteArray *bytearray = FX_NEW CFX_ByteArray(); bytearray->SetSize(numBlockCodewords); (*result)[numResultBlocks++] = FX_NEW CBC_QRDataBlock(numDataCodewords, bytearray); } } - FX_INT32 shorterBlocksTotalCodewords = ((CBC_QRDataBlock*)(*result)[0])->m_codewords->GetSize(); - FX_INT32 longerBlocksStartAt = result->GetSize() - 1; + int32_t shorterBlocksTotalCodewords = ((CBC_QRDataBlock*)(*result)[0])->m_codewords->GetSize(); + int32_t longerBlocksStartAt = result->GetSize() - 1; while(longerBlocksStartAt >= 0) { - FX_INT32 numCodewords = ((CBC_QRDataBlock*)(*result)[longerBlocksStartAt])->m_codewords->GetSize(); + int32_t numCodewords = ((CBC_QRDataBlock*)(*result)[longerBlocksStartAt])->m_codewords->GetSize(); if(numCodewords == shorterBlocksTotalCodewords) { break; } longerBlocksStartAt--; } longerBlocksStartAt++; - FX_INT32 shorterBlocksNumDataCodewords = shorterBlocksTotalCodewords - ecBlocks->GetECCodeWordsPerBlock(); - FX_INT32 rawCodewordsOffset = 0; - FX_INT32 x = 0; - for(FX_INT32 k = 0; k < shorterBlocksNumDataCodewords; k++) { + int32_t shorterBlocksNumDataCodewords = shorterBlocksTotalCodewords - ecBlocks->GetECCodeWordsPerBlock(); + int32_t rawCodewordsOffset = 0; + int32_t x = 0; + for(int32_t k = 0; k < shorterBlocksNumDataCodewords; k++) { for(x = 0; x < numResultBlocks; x++) { (*(((CBC_QRDataBlock*)(*result)[x])->m_codewords))[k] = (*rawCodewords)[rawCodewordsOffset++]; } @@ -93,10 +93,10 @@ CFX_PtrArray *CBC_QRDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_QR for(x = longerBlocksStartAt; x < numResultBlocks; x++) { (*(((CBC_QRDataBlock*)(*result)[x])->m_codewords))[shorterBlocksNumDataCodewords] = (*rawCodewords)[rawCodewordsOffset++]; } - FX_INT32 max = ((CBC_QRDataBlock*)(*result)[0])->m_codewords->GetSize(); + int32_t max = ((CBC_QRDataBlock*)(*result)[0])->m_codewords->GetSize(); for(i = shorterBlocksNumDataCodewords; i < max; i++) { - for(FX_INT32 y = 0; y < numResultBlocks; y++) { - FX_INT32 iOffset = y < longerBlocksStartAt ? i : i + 1; + for(int32_t y = 0; y < numResultBlocks; y++) { + int32_t iOffset = y < longerBlocksStartAt ? i : i + 1; (*(((CBC_QRDataBlock*)(*result)[y])->m_codewords))[iOffset] = (*rawCodewords)[rawCodewordsOffset++]; } } diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h b/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h index d5697ff724..4502398e92 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h @@ -13,14 +13,14 @@ class CBC_QRCoderErrorCorrectionLevel; class CBC_QRDataBlock { private: - FX_INT32 m_numDataCodewords; + int32_t m_numDataCodewords; CFX_ByteArray *m_codewords; - CBC_QRDataBlock(FX_INT32 numDataCodewords, CFX_ByteArray *codewords); + CBC_QRDataBlock(int32_t numDataCodewords, CFX_ByteArray *codewords); public: virtual ~CBC_QRDataBlock(); - FX_INT32 GetNumDataCodewords(); + int32_t GetNumDataCodewords(); CFX_ByteArray* GetCodewords(); static CFX_PtrArray *GetDataBlocks(CFX_ByteArray* rawCodewords, - CBC_QRCoderVersion *version, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e); + CBC_QRCoderVersion *version, CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDataMask.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDataMask.cpp index fd81b20f1b..bfea8e2d4d 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDataMask.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRDataMask.cpp @@ -23,7 +23,7 @@ #include "../barcode.h" #include "../common/BC_CommonBitMatrix.h" #include "BC_QRDataMask.h" -static FX_INT32 N_DATA_MASKS = 0; +static int32_t N_DATA_MASKS = 0; CFX_PtrArray* CBC_QRDataMask::DATA_MASKS = NULL; void CBC_QRDataMask::Initialize() { @@ -37,7 +37,7 @@ void CBC_QRDataMask::Finalize() } void CBC_QRDataMask::Destroy() { - FX_INT32 i; + int32_t i; for(i = 0; i < N_DATA_MASKS; i++) { CBC_QRDataMask* p = (CBC_QRDataMask*)(*DATA_MASKS)[i]; if (p) { @@ -45,17 +45,17 @@ void CBC_QRDataMask::Destroy() } } } -void CBC_QRDataMask::UnmaskBitMatirx(CBC_CommonBitMatrix *bits, FX_INT32 dimension) +void CBC_QRDataMask::UnmaskBitMatirx(CBC_CommonBitMatrix *bits, int32_t dimension) { - for(FX_INT32 i = 0; i < dimension; i++) { - for(FX_INT32 j = 0; j < dimension; j++) { + for(int32_t i = 0; i < dimension; i++) { + for(int32_t j = 0; j < dimension; j++) { if(IsMasked(i, j)) { bits->Flip(j, i); } } } } -CBC_QRDataMask* CBC_QRDataMask::ForReference(FX_INT32 reference, FX_INT32 &e) +CBC_QRDataMask* CBC_QRDataMask::ForReference(int32_t reference, int32_t &e) { if(reference < 0 || reference > 7) { e = BCExceptionReferenceMustBeBetween0And7; @@ -66,7 +66,7 @@ CBC_QRDataMask* CBC_QRDataMask::ForReference(FX_INT32 reference, FX_INT32 &e) class DataMask000 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y) + FX_BOOL IsMasked(int32_t x, int32_t y) { return ((x + y) % 2) == 0; } @@ -74,7 +74,7 @@ public: class DataMask001 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y) + FX_BOOL IsMasked(int32_t x, int32_t y) { return (x % 2) == 0; } @@ -82,7 +82,7 @@ public: class DataMask010 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y) + FX_BOOL IsMasked(int32_t x, int32_t y) { return y % 3 == 0; } @@ -90,7 +90,7 @@ public: class DataMask011 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y) + FX_BOOL IsMasked(int32_t x, int32_t y) { return (x + y) % 3 == 0; } @@ -98,7 +98,7 @@ public: class DataMask100 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y) + FX_BOOL IsMasked(int32_t x, int32_t y) { return (((x >> 1) + (y / 3)) % 2) == 0; } @@ -106,7 +106,7 @@ public: class DataMask101 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y) + FX_BOOL IsMasked(int32_t x, int32_t y) { size_t temp = x * y; return (temp % 2) + (temp % 3) == 0; @@ -115,7 +115,7 @@ public: class DataMask110 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y) + FX_BOOL IsMasked(int32_t x, int32_t y) { size_t temp = x * y; return (((temp % 2) + (temp % 3)) % 2) == 0; @@ -124,12 +124,12 @@ public: class DataMask111 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(FX_INT32 x, FX_INT32 y) + FX_BOOL IsMasked(int32_t x, int32_t y) { return ((((x + y) % 2) + ((x * y) % 3)) % 2) == 0; } }; -FX_INT32 CBC_QRDataMask::BuildDataMasks() +int32_t CBC_QRDataMask::BuildDataMasks() { DATA_MASKS->Add(FX_NEW DataMask000); DATA_MASKS->Add(FX_NEW DataMask001); diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDataMask.h b/xfa/src/fxbarcode/qrcode/BC_QRDataMask.h index 221218f34a..79ae4901b6 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDataMask.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRDataMask.h @@ -15,10 +15,10 @@ public: virtual ~CBC_QRDataMask(); static void Initialize(); static void Finalize(); - virtual FX_BOOL IsMasked(FX_INT32 i, FX_INT32 j) = 0; - void UnmaskBitMatirx(CBC_CommonBitMatrix *bits, FX_INT32 dimension); - static CBC_QRDataMask* ForReference(FX_INT32 reference, FX_INT32 &e); - static FX_INT32 BuildDataMasks(); + virtual FX_BOOL IsMasked(int32_t i, int32_t j) = 0; + void UnmaskBitMatirx(CBC_CommonBitMatrix *bits, int32_t dimension); + static CBC_QRDataMask* ForReference(int32_t reference, int32_t &e); + static int32_t BuildDataMasks(); static void Destroy(); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.cpp index 0fe4d1b2b6..b521222f00 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.cpp @@ -42,7 +42,7 @@ CBC_QRDecodedBitStreamParser::~CBC_QRDecodedBitStreamParser() { } CBC_CommonDecoderResult* CBC_QRDecodedBitStreamParser::Decode(CFX_ByteArray *bytes, CBC_QRCoderVersion *version, - CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 byteModeDecode, FX_INT32 &e) + CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t byteModeDecode, int32_t &e) { CBC_CommonBitSource bits(bytes); CFX_ByteString result; @@ -54,7 +54,7 @@ CBC_CommonDecoderResult* CBC_QRDecodedBitStreamParser::Decode(CFX_ByteArray *byt if(bits.Available() < 4) { mode = CBC_QRCoderMode::sTERMINATOR; } else { - FX_INT32 iTemp1 = bits.ReadBits(4, e); + int32_t iTemp1 = bits.ReadBits(4, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); mode = CBC_QRCoderMode::ForBits(iTemp1, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); @@ -70,7 +70,7 @@ CBC_CommonDecoderResult* CBC_QRDecodedBitStreamParser::Decode(CFX_ByteArray *byt bits.ReadBits(16, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } else if(mode == CBC_QRCoderMode::sECI) { - FX_INT32 value = ParseECIValue(&bits, e); + int32_t value = ParseECIValue(&bits, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); currentCharacterSetECI = CBC_CommonCharacterSetECI::GetCharacterSetECIByValue(value); } else { @@ -78,9 +78,9 @@ CBC_CommonDecoderResult* CBC_QRDecodedBitStreamParser::Decode(CFX_ByteArray *byt bits.ReadBits(4, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } - FX_INT32 numBits = mode->GetCharacterCountBits(version, e); + int32_t numBits = mode->GetCharacterCountBits(version, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 count = bits.ReadBits(numBits, e); + int32_t count = bits.ReadBits(numBits, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); if(mode == CBC_QRCoderMode::sNUMERIC) { DecodeNumericSegment(&bits, result, count, e); @@ -109,46 +109,46 @@ CBC_CommonDecoderResult* CBC_QRDecodedBitStreamParser::Decode(CFX_ByteArray *byt BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return tempCd; } -void CBC_QRDecodedBitStreamParser::DecodeGBKSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e) +void CBC_QRDecodedBitStreamParser::DecodeGBKSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, int32_t &e) { CFX_ByteString buffer; - FX_INT32 offset = 0; + int32_t offset = 0; while (count > 0) { - FX_INT32 twoBytes = bits->ReadBits(13, e); + int32_t twoBytes = bits->ReadBits(13, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 assembledTwoBytes = ((twoBytes / 0x060) << 8) | (twoBytes % 0x060); + int32_t assembledTwoBytes = ((twoBytes / 0x060) << 8) | (twoBytes % 0x060); if (assembledTwoBytes <= 0x0095d) { assembledTwoBytes += 0x0a1a1; } else { assembledTwoBytes += 0x0a6a1; } - buffer += (FX_BYTE) (assembledTwoBytes >> 8); - buffer += (FX_BYTE) assembledTwoBytes; + buffer += (uint8_t) (assembledTwoBytes >> 8); + buffer += (uint8_t) assembledTwoBytes; count--; } CBC_UtilCodingConvert::LocaleToUtf8(buffer, result); } -void CBC_QRDecodedBitStreamParser::DecodeKanjiSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e) +void CBC_QRDecodedBitStreamParser::DecodeKanjiSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, int32_t &e) { CFX_ByteString buffer; while (count > 0) { - FX_INT32 twoBytes = bits->ReadBits(13, e); + int32_t twoBytes = bits->ReadBits(13, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 assembledTwoBytes = ((twoBytes / 0x0c0) << 8) | (twoBytes % 0x0c0); + int32_t assembledTwoBytes = ((twoBytes / 0x0c0) << 8) | (twoBytes % 0x0c0); if (assembledTwoBytes <= 0x01f00) { assembledTwoBytes += 0x08140; } else { assembledTwoBytes += 0x0c140; } - buffer += (FX_BYTE) (assembledTwoBytes >> 8); - buffer += (FX_BYTE) assembledTwoBytes; + buffer += (uint8_t) (assembledTwoBytes >> 8); + buffer += (uint8_t) assembledTwoBytes; count--; } CBC_UtilCodingConvert::LocaleToUtf8(buffer, result); } -void CBC_QRDecodedBitStreamParser::DecodeByteSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, +void CBC_QRDecodedBitStreamParser::DecodeByteSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, CBC_CommonCharacterSetECI *currentCharacterSetECI, - CFX_Int32Array *byteSegments, FX_INT32 byteModeDecode, FX_INT32 &e) + CFX_Int32Array *byteSegments, int32_t byteModeDecode, int32_t &e) { if(count < 0) { e = BCExceptionNotFound; @@ -158,10 +158,10 @@ void CBC_QRDecodedBitStreamParser::DecodeByteSegment(CBC_CommonBitSource* bits, e = BCExceptionRead; BC_EXCEPTION_CHECK_ReturnVoid(e); } - FX_BYTE *readBytes = FX_Alloc(FX_BYTE, count); + uint8_t *readBytes = FX_Alloc(uint8_t, count); FXSYS_memset32(readBytes, 0x00, count); - for(FX_INT32 i = 0; i < count; i++) { - readBytes[i] = (FX_BYTE) bits->ReadBits(8, e); + for(int32_t i = 0; i < count; i++) { + readBytes[i] = (uint8_t) bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); } CFX_ByteString bs(readBytes, count); @@ -169,23 +169,23 @@ void CBC_QRDecodedBitStreamParser::DecodeByteSegment(CBC_CommonBitSource* bits, FX_Free(readBytes); } void CBC_QRDecodedBitStreamParser::DecodeAlphanumericSegment(CBC_CommonBitSource* bits, - CFX_ByteString &result, FX_INT32 count, FX_BOOL fac1InEffect, FX_INT32 &e) + CFX_ByteString &result, int32_t count, FX_BOOL fac1InEffect, int32_t &e) { - FX_INT32 start = result.GetLength(); + int32_t start = result.GetLength(); while(count > 1) { - FX_INT32 nextTwoCharsBits = bits->ReadBits(11, e); + int32_t nextTwoCharsBits = bits->ReadBits(11, e); BC_EXCEPTION_CHECK_ReturnVoid(e); BC_FX_ByteString_Append(result, 1, ALPHANUMERIC_CHARS[nextTwoCharsBits / 45]); BC_FX_ByteString_Append(result, 1, ALPHANUMERIC_CHARS[nextTwoCharsBits % 45]); count -= 2; } if(count == 1) { - FX_INT32 itemp = bits->ReadBits(6, e); + int32_t itemp = bits->ReadBits(6, e); BC_EXCEPTION_CHECK_ReturnVoid(e); BC_FX_ByteString_Append(result, 1, ALPHANUMERIC_CHARS[itemp]); } if(fac1InEffect) { - for(FX_INT32 i = start; i < result.GetLength(); i++) { + for(int32_t i = start; i < result.GetLength(); i++) { if(result[i] == '%') { if((i < result.GetLength() - 1) && result[i + 1] == '%') { result.Delete(i + 1, 1); @@ -196,10 +196,10 @@ void CBC_QRDecodedBitStreamParser::DecodeAlphanumericSegment(CBC_CommonBitSource } } } -void CBC_QRDecodedBitStreamParser::DecodeNumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e) +void CBC_QRDecodedBitStreamParser::DecodeNumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, int32_t &e) { while(count >= 3) { - FX_INT32 threeDigitsBits = bits->ReadBits(10, e); + int32_t threeDigitsBits = bits->ReadBits(10, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if(threeDigitsBits >= 1000) { e = BCExceptionRead; @@ -211,7 +211,7 @@ void CBC_QRDecodedBitStreamParser::DecodeNumericSegment(CBC_CommonBitSource* bit count -= 3; } if(count == 2) { - FX_INT32 twoDigitBits = bits->ReadBits(7, e); + int32_t twoDigitBits = bits->ReadBits(7, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if(twoDigitBits >= 100) { e = BCExceptionRead; @@ -220,7 +220,7 @@ void CBC_QRDecodedBitStreamParser::DecodeNumericSegment(CBC_CommonBitSource* bit BC_FX_ByteString_Append(result, 1, ALPHANUMERIC_CHARS[twoDigitBits / 10]); BC_FX_ByteString_Append(result, 1, ALPHANUMERIC_CHARS[twoDigitBits % 10]); } else if(count == 1) { - FX_INT32 digitBits = bits->ReadBits(4, e); + int32_t digitBits = bits->ReadBits(4, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if(digitBits >= 10) { e = BCExceptionRead; @@ -233,18 +233,18 @@ const CFX_ByteString CBC_QRDecodedBitStreamParser::GuessEncoding(CFX_ByteArray * { return *UTF_8; } -FX_INT32 CBC_QRDecodedBitStreamParser::ParseECIValue(CBC_CommonBitSource* bits, FX_INT32 &e) +int32_t CBC_QRDecodedBitStreamParser::ParseECIValue(CBC_CommonBitSource* bits, int32_t &e) { - FX_INT32 firstByte = bits->ReadBits(8, e); + int32_t firstByte = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); if((firstByte & 0x80) == 0) { return firstByte & 0x7f; } else if((firstByte & 0xc0) == 0x80) { - FX_INT32 secondByte = bits->ReadBits(8, e); + int32_t secondByte = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); return ((firstByte & 0x3f) << 8) | secondByte; } else if((firstByte & 0xe0) == 0xc0) { - FX_INT32 secondThirdByte = bits->ReadBits(16, e); + int32_t secondThirdByte = bits->ReadBits(16, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); return ((firstByte & 0x1f) << 16) | secondThirdByte; } diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.h b/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.h index f4ac06b984..d607e72da8 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.h @@ -20,15 +20,15 @@ private: public: virtual ~CBC_QRDecodedBitStreamParser(); static CBC_CommonDecoderResult* Decode(CFX_ByteArray *bytes, CBC_QRCoderVersion *version, - CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 byteModeDecode, FX_INT32 &e); + CBC_QRCoderErrorCorrectionLevel* ecLevel, int32_t byteModeDecode, int32_t &e); static const CFX_ByteString GuessEncoding(CFX_ByteArray* bytes); - static FX_INT32 ParseECIValue(CBC_CommonBitSource* bits, FX_INT32 &e); - static void DecodeGBKSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e); - static void DecodeKanjiSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e); - static void DecodeNumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e); - static void DecodeAlphanumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_BOOL fac1InEffect, FX_INT32 &e); - static void DecodeByteSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, CBC_CommonCharacterSetECI *currentCharacterSetECI, - CFX_Int32Array *byteSegments, FX_INT32 byteModeDecode, FX_INT32 &e); + static int32_t ParseECIValue(CBC_CommonBitSource* bits, int32_t &e); + static void DecodeGBKSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, int32_t &e); + static void DecodeKanjiSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, int32_t &e); + static void DecodeNumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, int32_t &e); + static void DecodeAlphanumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, FX_BOOL fac1InEffect, int32_t &e); + static void DecodeByteSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, int32_t count, CBC_CommonCharacterSetECI *currentCharacterSetECI, + CFX_Int32Array *byteSegments, int32_t byteModeDecode, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp index 01d90832b9..0b75da7bec 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp @@ -37,7 +37,7 @@ CBC_QRDetector::CBC_QRDetector(CBC_CommonBitMatrix *image): m_image(image) CBC_QRDetector::~CBC_QRDetector() { } -CBC_QRDetectorResult *CBC_QRDetector::Detect(FX_INT32 hints, FX_INT32 &e) +CBC_QRDetectorResult *CBC_QRDetector::Detect(int32_t hints, int32_t &e) { CBC_QRFinderPatternFinder finder(m_image); CBC_QRFinderPatternInfo* qpi = finder.Find(hints, e); @@ -47,7 +47,7 @@ CBC_QRDetectorResult *CBC_QRDetector::Detect(FX_INT32 hints, FX_INT32 &e) BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return qdr; } -CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo(CBC_QRFinderPatternInfo *info, FX_INT32 &e) +CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo(CBC_QRFinderPatternInfo *info, int32_t &e) { CBC_AutoPtr topLeft(info->GetTopLeft()); CBC_AutoPtr topRight(info->GetTopRight()); @@ -57,21 +57,21 @@ CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo(CBC_QRFinderPatte e = BCExceptionRead; BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } - FX_INT32 dimension = ComputeDimension(topLeft.get(), topRight.get(), bottomLeft.get(), moduleSize, e); + int32_t dimension = ComputeDimension(topLeft.get(), topRight.get(), bottomLeft.get(), moduleSize, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_QRCoderVersion *provisionalVersion = CBC_QRCoderVersion::GetProvisionalVersionForDimension(dimension, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 modulesBetweenFPCenters = provisionalVersion->GetDimensionForVersion() - 7; + int32_t modulesBetweenFPCenters = provisionalVersion->GetDimensionForVersion() - 7; CBC_QRAlignmentPattern * alignmentPattern = NULL; if(provisionalVersion->GetAlignmentPatternCenters()->GetSize() > 0) { FX_FLOAT bottomRightX = topRight->GetX() - topLeft->GetX() + bottomLeft->GetX(); FX_FLOAT bottomRightY = topRight->GetY() - topLeft->GetY() + bottomLeft->GetY(); FX_FLOAT correctionToTopLeft = 1.0f - 3.0f / (FX_FLOAT) modulesBetweenFPCenters; FX_FLOAT xtemp = (topLeft->GetX() + correctionToTopLeft * (bottomRightX - topLeft->GetX())); - FX_INT32 estAlignmentX = (FX_INT32)xtemp ; + int32_t estAlignmentX = (int32_t)xtemp ; FX_FLOAT ytemp = (topLeft->GetY() + correctionToTopLeft * (bottomRightY - topLeft->GetY())); - FX_INT32 estAlignmentY = (FX_INT32)ytemp; - for(FX_INT32 i = 4; i <= 16; i <<= 1) { + int32_t estAlignmentY = (int32_t)ytemp; + for(int32_t i = 4; i <= 16; i <<= 1) { CBC_QRAlignmentPattern *temp = FindAlignmentInRegion(moduleSize, estAlignmentX, estAlignmentY, (FX_FLOAT) i, e); alignmentPattern = temp; break; @@ -94,7 +94,7 @@ CBC_QRDetectorResult* CBC_QRDetector::ProcessFinderPatternInfo(CBC_QRFinderPatte } CBC_CommonBitMatrix *CBC_QRDetector::SampleGrid(CBC_CommonBitMatrix *image, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, CBC_ResultPoint *bottomLeft, CBC_ResultPoint* alignmentPattern, - FX_INT32 dimension, FX_INT32 &e) + int32_t dimension, int32_t &e) { FX_FLOAT dimMinusThree = (FX_FLOAT) dimension - 3.5f; FX_FLOAT bottomRightX; @@ -132,12 +132,12 @@ CBC_CommonBitMatrix *CBC_QRDetector::SampleGrid(CBC_CommonBitMatrix *image, CBC_ BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return cbm; } -FX_INT32 CBC_QRDetector::ComputeDimension(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, - CBC_ResultPoint *bottomLeft, FX_FLOAT moduleSize, FX_INT32 &e) +int32_t CBC_QRDetector::ComputeDimension(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, + CBC_ResultPoint *bottomLeft, FX_FLOAT moduleSize, int32_t &e) { - FX_INT32 tltrCentersDimension = Round(CBC_QRFinderPatternFinder::Distance(topLeft, topRight) / moduleSize); - FX_INT32 tlblCentersDimension = Round(CBC_QRFinderPatternFinder::Distance(topLeft, bottomLeft) / moduleSize); - FX_INT32 dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7; + int32_t tltrCentersDimension = Round(CBC_QRFinderPatternFinder::Distance(topLeft, topRight) / moduleSize); + int32_t tlblCentersDimension = Round(CBC_QRFinderPatternFinder::Distance(topLeft, bottomLeft) / moduleSize); + int32_t dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7; switch(dimension & 0x03) { case 0: dimension++; @@ -158,14 +158,14 @@ FX_FLOAT CBC_QRDetector::CalculateModuleSize(CBC_ResultPoint *topLeft, CBC_Resul } FX_FLOAT CBC_QRDetector::CalculateModuleSizeOneWay(CBC_ResultPoint *pattern, CBC_ResultPoint *otherPattern) { - FX_FLOAT moduleSizeEst1 = SizeOfBlackWhiteBlackRunBothWays((FX_INT32) pattern->GetX(), - (FX_INT32) pattern->GetY(), - (FX_INT32) otherPattern->GetX(), - (FX_INT32) otherPattern->GetY()); - FX_FLOAT moduleSizeEst2 = SizeOfBlackWhiteBlackRunBothWays((FX_INT32) otherPattern->GetX(), - (FX_INT32) otherPattern->GetY(), - (FX_INT32) pattern->GetX(), - (FX_INT32) pattern->GetY()); + FX_FLOAT moduleSizeEst1 = SizeOfBlackWhiteBlackRunBothWays((int32_t) pattern->GetX(), + (int32_t) pattern->GetY(), + (int32_t) otherPattern->GetX(), + (int32_t) otherPattern->GetY()); + FX_FLOAT moduleSizeEst2 = SizeOfBlackWhiteBlackRunBothWays((int32_t) otherPattern->GetX(), + (int32_t) otherPattern->GetY(), + (int32_t) pattern->GetX(), + (int32_t) pattern->GetY()); if (FXSYS_isnan(moduleSizeEst1)) { return moduleSizeEst2; } @@ -174,20 +174,20 @@ FX_FLOAT CBC_QRDetector::CalculateModuleSizeOneWay(CBC_ResultPoint *pattern, CBC } return (moduleSizeEst1 + moduleSizeEst2) / 14.0f; } -FX_INT32 CBC_QRDetector::Round(FX_FLOAT d) +int32_t CBC_QRDetector::Round(FX_FLOAT d) { - return (FX_INT32)(d + 0.5f); + return (int32_t)(d + 0.5f); } -FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRunBothWays(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 toX, FX_INT32 toY) +FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRunBothWays(int32_t fromX, int32_t fromY, int32_t toX, int32_t toY) { FX_FLOAT result = SizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY); - FX_INT32 otherToX = fromX - (toX - fromX); + int32_t otherToX = fromX - (toX - fromX); if (otherToX < 0) { otherToX = -1; } else if (otherToX >= m_image->GetWidth()) { otherToX = m_image->GetWidth(); } - FX_INT32 otherToY = fromY - (toY - fromY); + int32_t otherToY = fromY - (toY - fromY); if (otherToY < 0) { otherToY = -1; } else if (otherToY >= m_image->GetHeight()) { @@ -196,26 +196,26 @@ FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRunBothWays(FX_INT32 fromX, FX_INT result += SizeOfBlackWhiteBlackRun(fromX, fromY, otherToX, otherToY); return result - 1.0f; } -FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRun(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 toX, FX_INT32 toY) +FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRun(int32_t fromX, int32_t fromY, int32_t toX, int32_t toY) { FX_BOOL steep = FXSYS_abs(toY - fromY) > FXSYS_abs(toX - fromX); if (steep) { - FX_INT32 temp = fromX; + int32_t temp = fromX; fromX = fromY; fromY = temp; temp = toX; toX = toY; toY = temp; } - FX_INT32 dx = FXSYS_abs(toX - fromX); - FX_INT32 dy = FXSYS_abs(toY - fromY); - FX_INT32 error = -dx >> 1; - FX_INT32 ystep = fromY < toY ? 1 : -1; - FX_INT32 xstep = fromX < toX ? 1 : -1; - FX_INT32 state = 0; - for (FX_INT32 x = fromX, y = fromY; x != toX; x += xstep) { - FX_INT32 realX = steep ? y : x; - FX_INT32 realY = steep ? x : y; + int32_t dx = FXSYS_abs(toX - fromX); + int32_t dy = FXSYS_abs(toY - fromY); + int32_t error = -dx >> 1; + int32_t ystep = fromY < toY ? 1 : -1; + int32_t xstep = fromX < toX ? 1 : -1; + int32_t state = 0; + for (int32_t x = fromX, y = fromY; x != toX; x += xstep) { + int32_t realX = steep ? y : x; + int32_t realY = steep ? x : y; if (state == 1) { if (m_image->Get(realX, realY)) { state++; @@ -226,8 +226,8 @@ FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRun(FX_INT32 fromX, FX_INT32 fromY } } if (state == 3) { - FX_INT32 diffX = x - fromX; - FX_INT32 diffY = y - fromY; + int32_t diffX = x - fromX; + int32_t diffY = y - fromY; return (FX_FLOAT) sqrt((double) (diffX * diffX + diffY * diffY)); } error += dy; @@ -236,22 +236,22 @@ FX_FLOAT CBC_QRDetector::SizeOfBlackWhiteBlackRun(FX_INT32 fromX, FX_INT32 fromY error -= dx; } } - FX_INT32 diffX = toX - fromX; - FX_INT32 diffY = toY - fromY; + int32_t diffX = toX - fromX; + int32_t diffY = toY - fromY; return (FX_FLOAT) sqrt((double) (diffX * diffX + diffY * diffY)); } -CBC_QRAlignmentPattern *CBC_QRDetector::FindAlignmentInRegion(FX_FLOAT overallEstModuleSize, FX_INT32 estAlignmentX, - FX_INT32 estAlignmentY, FX_FLOAT allowanceFactor, FX_INT32 &e) +CBC_QRAlignmentPattern *CBC_QRDetector::FindAlignmentInRegion(FX_FLOAT overallEstModuleSize, int32_t estAlignmentX, + int32_t estAlignmentY, FX_FLOAT allowanceFactor, int32_t &e) { - FX_INT32 allowance = (FX_INT32) (allowanceFactor * overallEstModuleSize); - FX_INT32 alignmentAreaLeftX = FX_MAX(0, estAlignmentX - allowance); - FX_INT32 alignmentAreaRightX = FX_MIN(m_image->GetWidth() - 1, estAlignmentX + allowance); + int32_t allowance = (int32_t) (allowanceFactor * overallEstModuleSize); + int32_t alignmentAreaLeftX = FX_MAX(0, estAlignmentX - allowance); + int32_t alignmentAreaRightX = FX_MIN(m_image->GetWidth() - 1, estAlignmentX + allowance); if (alignmentAreaRightX - alignmentAreaLeftX < overallEstModuleSize * 3) { e = BCExceptionRead; BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } - FX_INT32 alignmentAreaTopY = FX_MAX(0, estAlignmentY - allowance); - FX_INT32 alignmentAreaBottomY = FX_MIN(m_image->GetHeight() - 1, estAlignmentY + allowance); + int32_t alignmentAreaTopY = FX_MAX(0, estAlignmentY - allowance); + int32_t alignmentAreaBottomY = FX_MIN(m_image->GetHeight() - 1, estAlignmentY + allowance); CBC_QRAlignmentPatternFinder alignmentFinder(m_image, alignmentAreaLeftX, alignmentAreaTopY, diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDetector.h b/xfa/src/fxbarcode/qrcode/BC_QRDetector.h index 60c301cb7b..298ccf4d4c 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDetector.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRDetector.h @@ -26,16 +26,16 @@ public: virtual ~CBC_QRDetector(); CBC_CommonBitMatrix* GetImage(); - CBC_QRDetectorResult* Detect(FX_INT32 hints, FX_INT32 &e); - CBC_QRDetectorResult* ProcessFinderPatternInfo(CBC_QRFinderPatternInfo *info, FX_INT32 &e); + CBC_QRDetectorResult* Detect(int32_t hints, int32_t &e); + CBC_QRDetectorResult* ProcessFinderPatternInfo(CBC_QRFinderPatternInfo *info, int32_t &e); FX_FLOAT CalculateModuleSize(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, CBC_ResultPoint *bottomLeft); FX_FLOAT CalculateModuleSizeOneWay(CBC_ResultPoint *pattern, CBC_ResultPoint *otherPattern); - FX_FLOAT SizeOfBlackWhiteBlackRunBothWays(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 toX, FX_INT32 toY); - FX_FLOAT SizeOfBlackWhiteBlackRun(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 toX, FX_INT32 toY); - CBC_QRAlignmentPattern* FindAlignmentInRegion(FX_FLOAT overallEstModuleSize, FX_INT32 estAlignmentX, FX_INT32 estAlignmentY, FX_FLOAT allowanceFactor, FX_INT32 &e); - static FX_INT32 Round(FX_FLOAT d); - static FX_INT32 ComputeDimension(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, CBC_ResultPoint *bottomLeft, FX_FLOAT moduleSize, FX_INT32 &e); + FX_FLOAT SizeOfBlackWhiteBlackRunBothWays(int32_t fromX, int32_t fromY, int32_t toX, int32_t toY); + FX_FLOAT SizeOfBlackWhiteBlackRun(int32_t fromX, int32_t fromY, int32_t toX, int32_t toY); + CBC_QRAlignmentPattern* FindAlignmentInRegion(FX_FLOAT overallEstModuleSize, int32_t estAlignmentX, int32_t estAlignmentY, FX_FLOAT allowanceFactor, int32_t &e); + static int32_t Round(FX_FLOAT d); + static int32_t ComputeDimension(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, CBC_ResultPoint *bottomLeft, FX_FLOAT moduleSize, int32_t &e); static CBC_CommonBitMatrix* SampleGrid(CBC_CommonBitMatrix *image, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, - CBC_ResultPoint *bottomLeft, CBC_ResultPoint* alignmentPattern, FX_INT32 dimension, FX_INT32 &e); + CBC_ResultPoint *bottomLeft, CBC_ResultPoint* alignmentPattern, int32_t dimension, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.cpp b/xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.cpp index 369dc3a527..3734fab24d 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.cpp @@ -30,7 +30,7 @@ CBC_QRDetectorResult::CBC_QRDetectorResult(CBC_CommonBitMatrix *bits, CFX_PtrArr } CBC_QRDetectorResult::~CBC_QRDetectorResult() { - for(FX_INT32 i = 0; i < m_points->GetSize(); i++) { + for(int32_t i = 0; i < m_points->GetSize(); i++) { delete (CBC_ResultPoint*) (*m_points)[i]; } m_points->RemoveAll(); diff --git a/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.cpp b/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.cpp index 8d1385e99a..dc08fc1e77 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.cpp @@ -45,7 +45,7 @@ FX_FLOAT CBC_QRFinderPattern::GetEstimatedModuleSize() { return m_estimatedModuleSize; } -FX_INT32 CBC_QRFinderPattern::GetCount() +int32_t CBC_QRFinderPattern::GetCount() { return m_count; } diff --git a/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.h b/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.h index af88a727d9..919b0c1534 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.h @@ -12,12 +12,12 @@ class CBC_QRFinderPattern : public CBC_ResultPoint { private: FX_FLOAT m_estimatedModuleSize; - FX_INT32 m_count; + int32_t m_count; public: CBC_QRFinderPattern(FX_FLOAT x, FX_FLOAT posY, FX_FLOAT estimatedModuleSize); virtual ~CBC_QRFinderPattern(); - FX_INT32 GetCount(); + int32_t GetCount(); FX_FLOAT GetX(); FX_FLOAT GetY(); FX_FLOAT GetEstimatedModuleSize(); diff --git a/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp index da2d1231f8..975776db3f 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp @@ -26,10 +26,10 @@ #include "BC_QRFinderPatternFinder.h" #include "BC_FinderPatternInfo.h" #include "BC_QRFinderPattern.h" -const FX_INT32 CBC_QRFinderPatternFinder::CENTER_QUORUM = 2; -const FX_INT32 CBC_QRFinderPatternFinder::MIN_SKIP = 3; -const FX_INT32 CBC_QRFinderPatternFinder::MAX_MODULES = 57; -const FX_INT32 CBC_QRFinderPatternFinder::INTEGER_MATH_SHIFT = 8; +const int32_t CBC_QRFinderPatternFinder::CENTER_QUORUM = 2; +const int32_t CBC_QRFinderPatternFinder::MIN_SKIP = 3; +const int32_t CBC_QRFinderPatternFinder::MAX_MODULES = 57; +const int32_t CBC_QRFinderPatternFinder::INTEGER_MATH_SHIFT = 8; CBC_QRFinderPatternFinder::CBC_QRFinderPatternFinder(CBC_CommonBitMatrix* image) { m_image = image; @@ -38,7 +38,7 @@ CBC_QRFinderPatternFinder::CBC_QRFinderPatternFinder(CBC_CommonBitMatrix* image) } CBC_QRFinderPatternFinder::~CBC_QRFinderPatternFinder() { - for(FX_INT32 i = 0; i < m_possibleCenters.GetSize(); i++) { + for(int32_t i = 0; i < m_possibleCenters.GetSize(); i++) { delete (CBC_QRFinderPattern*)m_possibleCenters[i]; } m_possibleCenters.RemoveAll(); @@ -51,7 +51,7 @@ public: ClosestToAverageComparator(FX_FLOAT averageModuleSize) : m_averageModuleSize(averageModuleSize) { } - FX_INT32 operator()(FinderPattern *a, FinderPattern *b) + int32_t operator()(FinderPattern *a, FinderPattern *b) { FX_FLOAT dA = (FX_FLOAT)fabs(a->GetEstimatedModuleSize() - m_averageModuleSize); FX_FLOAT dB = (FX_FLOAT)fabs(b->GetEstimatedModuleSize() - m_averageModuleSize); @@ -61,7 +61,7 @@ public: class CenterComparator { public: - FX_INT32 operator()(FinderPattern *a, FinderPattern *b) + int32_t operator()(FinderPattern *a, FinderPattern *b) { return b->GetCount() - a->GetCount(); } @@ -83,25 +83,25 @@ CFX_PtrArray *CBC_QRFinderPatternFinder::GetPossibleCenters() { return &m_possibleCenters; } -CBC_QRFinderPatternInfo* CBC_QRFinderPatternFinder::Find(FX_INT32 hint, FX_INT32 &e) +CBC_QRFinderPatternInfo* CBC_QRFinderPatternFinder::Find(int32_t hint, int32_t &e) { - FX_INT32 maxI = m_image->GetHeight(); - FX_INT32 maxJ = m_image->GetWidth(); - FX_INT32 iSkip = (3 * maxI) / (4 * MAX_MODULES); + int32_t maxI = m_image->GetHeight(); + int32_t maxJ = m_image->GetWidth(); + int32_t iSkip = (3 * maxI) / (4 * MAX_MODULES); if(iSkip < MIN_SKIP || 0) { iSkip = MIN_SKIP; } FX_BOOL done = FALSE; CFX_Int32Array stateCount; stateCount.SetSize(5); - for(FX_INT32 i = iSkip - 1; i < maxI && !done; i += iSkip) { + for(int32_t i = iSkip - 1; i < maxI && !done; i += iSkip) { stateCount[0] = 0; stateCount[1] = 0; stateCount[2] = 0; stateCount[3] = 0; stateCount[4] = 0; - FX_INT32 currentState = 0; - for(FX_INT32 j = 0; j < maxJ; j++) { + int32_t currentState = 0; + for(int32_t j = 0; j < maxJ; j++) { if(m_image->Get(j, i)) { if((currentState & 1) == 1) { currentState++; @@ -117,7 +117,7 @@ CBC_QRFinderPatternInfo* CBC_QRFinderPatternFinder::Find(FX_INT32 hint, FX_INT32 if(m_hasSkipped) { done = HaveMultiplyConfirmedCenters(); } else { - FX_INT32 rowSkip = FindRowSkip(); + int32_t rowSkip = FindRowSkip(); if(rowSkip > stateCount[2]) { i += rowSkip - stateCount[2] - iSkip; j = maxJ - 1; @@ -202,15 +202,15 @@ FX_FLOAT CBC_QRFinderPatternFinder::Distance(CBC_ResultPoint* point1, CBC_Result FX_FLOAT dy = point1->GetY() - point2->GetY(); return (FX_FLOAT)FXSYS_sqrt(dx * dx + dy * dy); } -FX_FLOAT CBC_QRFinderPatternFinder::CenterFromEnd(const CFX_Int32Array &stateCount, FX_INT32 end) +FX_FLOAT CBC_QRFinderPatternFinder::CenterFromEnd(const CFX_Int32Array &stateCount, int32_t end) { return (FX_FLOAT)(end - stateCount[4] - stateCount[3]) - stateCount[2] / 2.0f; } FX_BOOL CBC_QRFinderPatternFinder::FoundPatternCross(const CFX_Int32Array &stateCount) { - FX_INT32 totalModuleSize = 0; - for (FX_INT32 i = 0; i < 5; i++) { - FX_INT32 count = stateCount[i]; + int32_t totalModuleSize = 0; + for (int32_t i = 0; i < 5; i++) { + int32_t count = stateCount[i]; if (count == 0) { return FALSE; } @@ -219,21 +219,21 @@ FX_BOOL CBC_QRFinderPatternFinder::FoundPatternCross(const CFX_Int32Array &state if (totalModuleSize < 7) { return FALSE; } - FX_INT32 moduleSize = (totalModuleSize << INTEGER_MATH_SHIFT) / 7; - FX_INT32 maxVariance = moduleSize / 2; + int32_t moduleSize = (totalModuleSize << INTEGER_MATH_SHIFT) / 7; + int32_t maxVariance = moduleSize / 2; return FXSYS_abs(moduleSize - (stateCount[0] << INTEGER_MATH_SHIFT)) < maxVariance && FXSYS_abs(moduleSize - (stateCount[1] << INTEGER_MATH_SHIFT)) < maxVariance && FXSYS_abs(3 * moduleSize - (stateCount[2] << INTEGER_MATH_SHIFT)) < 3 * maxVariance && FXSYS_abs(moduleSize - (stateCount[3] << INTEGER_MATH_SHIFT)) < maxVariance && FXSYS_abs(moduleSize - (stateCount[4] << INTEGER_MATH_SHIFT)) < maxVariance; } -FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckVertical(FX_INT32 startI, FX_INT32 centerJ, FX_INT32 maxCount, - FX_INT32 originalStateCountTotal) +FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckVertical(int32_t startI, int32_t centerJ, int32_t maxCount, + int32_t originalStateCountTotal) { CBC_CommonBitMatrix *image = m_image; - FX_INT32 maxI = image->GetHeight(); + int32_t maxI = image->GetHeight(); CFX_Int32Array &stateCount = GetCrossCheckStateCount(); - FX_INT32 i = startI; + int32_t i = startI; while(i >= 0 && image->Get(centerJ, i)) { stateCount[2]++; i--; @@ -277,18 +277,18 @@ FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckVertical(FX_INT32 startI, FX_INT32 if (stateCount[4] >= maxCount) { return FXSYS_nan(); } - FX_INT32 stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4]; + int32_t stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4]; if (5 * FXSYS_abs(stateCountTotal - originalStateCountTotal) >= originalStateCountTotal) { return FXSYS_nan(); } return FoundPatternCross(stateCount) ? CenterFromEnd(stateCount, i) : FXSYS_nan(); } -FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckHorizontal(FX_INT32 startJ, FX_INT32 centerI, FX_INT32 maxCount, FX_INT32 originalStateCountTotal) +FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckHorizontal(int32_t startJ, int32_t centerI, int32_t maxCount, int32_t originalStateCountTotal) { CBC_CommonBitMatrix *image = m_image; - FX_INT32 maxJ = image->GetWidth(); + int32_t maxJ = image->GetWidth(); CFX_Int32Array &stateCount = GetCrossCheckStateCount(); - FX_INT32 j = startJ; + int32_t j = startJ; while (j >= 0 && image->Get(j, centerI)) { stateCount[2]++; j--; @@ -332,7 +332,7 @@ FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckHorizontal(FX_INT32 startJ, FX_INT if (stateCount[4] >= maxCount) { return FXSYS_nan(); } - FX_INT32 stateCountTotal = stateCount[0] + stateCount[1] + + int32_t stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4]; if (5 * FXSYS_abs(stateCountTotal - originalStateCountTotal) >= originalStateCountTotal) { @@ -340,18 +340,18 @@ FX_FLOAT CBC_QRFinderPatternFinder::CrossCheckHorizontal(FX_INT32 startJ, FX_INT } return FoundPatternCross(stateCount) ? CenterFromEnd(stateCount, j) : FXSYS_nan(); } -FX_BOOL CBC_QRFinderPatternFinder::HandlePossibleCenter(const CFX_Int32Array &stateCount, FX_INT32 i, FX_INT32 j) +FX_BOOL CBC_QRFinderPatternFinder::HandlePossibleCenter(const CFX_Int32Array &stateCount, int32_t i, int32_t j) { - FX_INT32 stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4]; + int32_t stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4]; FX_FLOAT centerJ = CenterFromEnd(stateCount, j); - FX_FLOAT centerI = CrossCheckVertical(i, (FX_INT32) centerJ, stateCount[2], stateCountTotal); + FX_FLOAT centerI = CrossCheckVertical(i, (int32_t) centerJ, stateCount[2], stateCountTotal); if(!FXSYS_isnan(centerI)) { - centerJ = CrossCheckHorizontal((FX_INT32) centerJ, (FX_INT32) centerI, stateCount[2], stateCountTotal); + centerJ = CrossCheckHorizontal((int32_t) centerJ, (int32_t) centerI, stateCount[2], stateCountTotal); if(!FXSYS_isnan(centerJ)) { FX_FLOAT estimatedModuleSize = (FX_FLOAT) stateCountTotal / 7.0f; FX_BOOL found = FALSE; - FX_INT32 max = m_possibleCenters.GetSize(); - for(FX_INT32 index = 0; index < max; index++) { + int32_t max = m_possibleCenters.GetSize(); + for(int32_t index = 0; index < max; index++) { CBC_QRFinderPattern *center = (CBC_QRFinderPattern*)(m_possibleCenters[index]); if(center->AboutEquals(estimatedModuleSize, centerI, centerJ)) { center->IncrementCount(); @@ -367,21 +367,21 @@ FX_BOOL CBC_QRFinderPatternFinder::HandlePossibleCenter(const CFX_Int32Array &st } return FALSE; } -FX_INT32 CBC_QRFinderPatternFinder::FindRowSkip() +int32_t CBC_QRFinderPatternFinder::FindRowSkip() { - FX_INT32 max = m_possibleCenters.GetSize(); + int32_t max = m_possibleCenters.GetSize(); if (max <= 1) { return 0; } FinderPattern *firstConfirmedCenter = NULL; - for (FX_INT32 i = 0; i < max; i++) { + for (int32_t i = 0; i < max; i++) { CBC_QRFinderPattern *center = (CBC_QRFinderPattern*)m_possibleCenters[i]; if (center->GetCount() >= CENTER_QUORUM) { if (firstConfirmedCenter == NULL) { firstConfirmedCenter = center; } else { m_hasSkipped = TRUE; - return (FX_INT32) ((fabs(firstConfirmedCenter->GetX() - center->GetX()) - + return (int32_t) ((fabs(firstConfirmedCenter->GetX() - center->GetX()) - fabs(firstConfirmedCenter->GetY() - center->GetY())) / 2); } } @@ -390,10 +390,10 @@ FX_INT32 CBC_QRFinderPatternFinder::FindRowSkip() } FX_BOOL CBC_QRFinderPatternFinder::HaveMultiplyConfirmedCenters() { - FX_INT32 confirmedCount = 0; + int32_t confirmedCount = 0; FX_FLOAT totalModuleSize = 0.0f; - FX_INT32 max = m_possibleCenters.GetSize(); - FX_INT32 i; + int32_t max = m_possibleCenters.GetSize(); + int32_t i; for (i = 0; i < max; i++) { CBC_QRFinderPattern *pattern = (CBC_QRFinderPattern*)m_possibleCenters[i]; if (pattern->GetCount() >= CENTER_QUORUM) { @@ -416,9 +416,9 @@ inline FX_BOOL centerComparator(FX_LPVOID a, FX_LPVOID b) { return ((CBC_QRFinderPattern*)b)->GetCount() < ((CBC_QRFinderPattern*)a)->GetCount(); } -CFX_PtrArray *CBC_QRFinderPatternFinder::SelectBestpatterns(FX_INT32 &e) +CFX_PtrArray *CBC_QRFinderPatternFinder::SelectBestpatterns(int32_t &e) { - FX_INT32 startSize = m_possibleCenters.GetSize(); + int32_t startSize = m_possibleCenters.GetSize(); if(m_possibleCenters.GetSize() < 3) { e = BCExceptionRead; BC_EXCEPTION_CHECK_ReturnValue(e, NULL); @@ -426,11 +426,11 @@ CFX_PtrArray *CBC_QRFinderPatternFinder::SelectBestpatterns(FX_INT32 &e) FX_FLOAT average = 0.0f; if(startSize > 3) { FX_FLOAT totalModuleSize = 0.0f; - for(FX_INT32 i = 0; i < startSize; i++) { + for(int32_t i = 0; i < startSize; i++) { totalModuleSize += ((CBC_QRFinderPattern*)m_possibleCenters[i])->GetEstimatedModuleSize(); } average = totalModuleSize / (FX_FLOAT)startSize; - for(FX_INT32 j = 0; j < m_possibleCenters.GetSize() && m_possibleCenters.GetSize() > 3; j++) { + for(int32_t j = 0; j < m_possibleCenters.GetSize() && m_possibleCenters.GetSize() > 3; j++) { CBC_QRFinderPattern *pattern = (CBC_QRFinderPattern*)m_possibleCenters[j]; if(fabs(pattern->GetEstimatedModuleSize() - average) > 0.2f * average) { delete pattern; diff --git a/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.h b/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.h index d0fde46542..f24d22bed2 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.h @@ -14,10 +14,10 @@ class CBC_QRFinderPatternInfo; class CBC_QRFinderPatternFinder { private: - const static FX_INT32 CENTER_QUORUM; - const static FX_INT32 MIN_SKIP; - const static FX_INT32 MAX_MODULES; - const static FX_INT32 INTEGER_MATH_SHIFT; + const static int32_t CENTER_QUORUM; + const static int32_t MIN_SKIP; + const static int32_t MAX_MODULES; + const static int32_t INTEGER_MATH_SHIFT; FX_BOOL m_hasSkipped; CBC_CommonBitMatrix* m_image; CFX_Int32Array m_crossCheckStateCount; @@ -25,19 +25,19 @@ private: public: CBC_QRFinderPatternFinder(CBC_CommonBitMatrix *image); virtual ~CBC_QRFinderPatternFinder(); - FX_INT32 FindRowSkip(); + int32_t FindRowSkip(); CBC_CommonBitMatrix* GetImage(); - CBC_QRFinderPatternInfo* Find(FX_INT32 hint, FX_INT32 &e); + CBC_QRFinderPatternInfo* Find(int32_t hint, int32_t &e); CFX_Int32Array &GetCrossCheckStateCount(); CFX_PtrArray *GetPossibleCenters(); - CFX_PtrArray *SelectBestpatterns(FX_INT32 &e); + CFX_PtrArray *SelectBestpatterns(int32_t &e); - FX_BOOL HandlePossibleCenter(const CFX_Int32Array &stateCount, FX_INT32 i, FX_INT32 j); + FX_BOOL HandlePossibleCenter(const CFX_Int32Array &stateCount, int32_t i, int32_t j); FX_BOOL HaveMultiplyConfirmedCenters(); - FX_FLOAT CenterFromEnd(const CFX_Int32Array &stateCount, FX_INT32 end); - FX_FLOAT CrossCheckVertical(FX_INT32 startI, FX_INT32 centerJ, FX_INT32 maxCount, FX_INT32 originalStateCountTotal); - FX_FLOAT CrossCheckHorizontal(FX_INT32 startJ, FX_INT32 CenterI, FX_INT32 maxCOunt, FX_INT32 originalStateCountTotal); + FX_FLOAT CenterFromEnd(const CFX_Int32Array &stateCount, int32_t end); + FX_FLOAT CrossCheckVertical(int32_t startI, int32_t centerJ, int32_t maxCount, int32_t originalStateCountTotal); + FX_FLOAT CrossCheckHorizontal(int32_t startJ, int32_t CenterI, int32_t maxCOunt, int32_t originalStateCountTotal); static void OrderBestPatterns(CFX_PtrArray *patterns); static FX_BOOL FoundPatternCross(const CFX_Int32Array &stateCount); static FX_FLOAT Distance(CBC_ResultPoint* point1, CBC_ResultPoint* point2); diff --git a/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp b/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp index 8783078690..a5e478e1da 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp @@ -35,15 +35,15 @@ CBC_QRGridSampler &CBC_QRGridSampler::GetInstance() { return m_gridSampler; } -void CBC_QRGridSampler::CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_FloatArray *points, FX_INT32 &e) +void CBC_QRGridSampler::CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_FloatArray *points, int32_t &e) { - FX_INT32 width = image->GetWidth(); - FX_INT32 height = image->GetHeight(); + int32_t width = image->GetWidth(); + int32_t height = image->GetHeight(); FX_BOOL nudged = TRUE; - FX_INT32 offset; + int32_t offset; for (offset = 0; offset < points->GetSize() && nudged; offset += 2) { - FX_INT32 x = (FX_INT32) (*points)[offset]; - FX_INT32 y = (FX_INT32) (*points)[offset + 1]; + int32_t x = (int32_t) (*points)[offset]; + int32_t y = (int32_t) (*points)[offset + 1]; if (x < -1 || x > width || y < -1 || y > height) { e = BCExceptionRead; BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -66,8 +66,8 @@ void CBC_QRGridSampler::CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_Floa } nudged = TRUE; for (offset = (*points).GetSize() - 2; offset >= 0 && nudged; offset -= 2) { - FX_INT32 x = (FX_INT32) (*points)[offset]; - FX_INT32 y = (FX_INT32) (*points)[offset + 1]; + int32_t x = (int32_t) (*points)[offset]; + int32_t y = (int32_t) (*points)[offset + 1]; if (x < -1 || x > width || y < -1 || y > height) { e = BCExceptionRead; BC_EXCEPTION_CHECK_ReturnVoid(e); @@ -89,7 +89,7 @@ void CBC_QRGridSampler::CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_Floa } } } -CBC_CommonBitMatrix *CBC_QRGridSampler::SampleGrid(CBC_CommonBitMatrix *image, FX_INT32 dimensionX, FX_INT32 dimensionY, +CBC_CommonBitMatrix *CBC_QRGridSampler::SampleGrid(CBC_CommonBitMatrix *image, int32_t dimensionX, int32_t dimensionY, FX_FLOAT p1ToX, FX_FLOAT p1ToY, FX_FLOAT p2ToX, FX_FLOAT p2ToY, FX_FLOAT p3ToX, FX_FLOAT p3ToY, @@ -97,7 +97,7 @@ CBC_CommonBitMatrix *CBC_QRGridSampler::SampleGrid(CBC_CommonBitMatrix *image, F FX_FLOAT p1FromX, FX_FLOAT p1FromY, FX_FLOAT p2FromX, FX_FLOAT p2FromY, FX_FLOAT p3FromX, FX_FLOAT p3FromY, - FX_FLOAT p4FromX, FX_FLOAT p4FromY, FX_INT32 &e) + FX_FLOAT p4FromX, FX_FLOAT p4FromY, int32_t &e) { CBC_AutoPtr transform(CBC_CommonPerspectiveTransform::QuadrilateralToQuadrilateral( p1ToX, p1ToY, p2ToX, p2ToY, p3ToX, p3ToY, p4ToX, p4ToY, @@ -107,10 +107,10 @@ CBC_CommonBitMatrix *CBC_QRGridSampler::SampleGrid(CBC_CommonBitMatrix *image, F CBC_AutoPtr bits(tempBitM); CFX_FloatArray points; points.SetSize(dimensionX << 1); - for (FX_INT32 y = 0; y < dimensionY; y++) { - FX_INT32 max = points.GetSize(); + for (int32_t y = 0; y < dimensionY; y++) { + int32_t max = points.GetSize(); FX_FLOAT iValue = (FX_FLOAT) (y + 0.5f); - FX_INT32 x; + int32_t x; for (x = 0; x < max; x += 2) { points[x] = (FX_FLOAT) ((x >> 1) + 0.5f); points[x + 1] = iValue; @@ -119,7 +119,7 @@ CBC_CommonBitMatrix *CBC_QRGridSampler::SampleGrid(CBC_CommonBitMatrix *image, F CheckAndNudgePoints(image, &points, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); for (x = 0; x < max; x += 2) { - if (image->Get((FX_INT32) points[x], (FX_INT32) points[x + 1])) { + if (image->Get((int32_t) points[x], (int32_t) points[x + 1])) { bits->Set(x >> 1, y); } } diff --git a/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h b/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h index 0b8c7d3ab7..c7abf75f8d 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h +++ b/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h @@ -17,7 +17,7 @@ private: public: CBC_QRGridSampler(); virtual ~CBC_QRGridSampler(); - virtual CBC_CommonBitMatrix* SampleGrid(CBC_CommonBitMatrix *image, FX_INT32 dimensionX, FX_INT32 dimensionY, + virtual CBC_CommonBitMatrix* SampleGrid(CBC_CommonBitMatrix *image, int32_t dimensionX, int32_t dimensionY, FX_FLOAT p1ToX, FX_FLOAT p1ToY, FX_FLOAT p2ToX, FX_FLOAT p2ToY, FX_FLOAT p3ToX, FX_FLOAT p3ToY, @@ -25,9 +25,9 @@ public: FX_FLOAT p1FromX, FX_FLOAT p1FromY, FX_FLOAT p2FromX, FX_FLOAT p2FromY, FX_FLOAT p3FromX, FX_FLOAT p3FromY, - FX_FLOAT p4FromX, FX_FLOAT p4FromY, FX_INT32 &e); + FX_FLOAT p4FromX, FX_FLOAT p4FromY, int32_t &e); static CBC_QRGridSampler &GetInstance(); - static void CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_FloatArray *points, FX_INT32 &e); + static void CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_FloatArray *points, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/utils.h b/xfa/src/fxbarcode/utils.h index ecaadccef0..9639ba8504 100644 --- a/xfa/src/fxbarcode/utils.h +++ b/xfa/src/fxbarcode/utils.h @@ -6,9 +6,9 @@ #ifndef _BC_UTILS_H_ #define _BC_UTILS_H_ -typedef CFX_MapPtrTemplate CFX_PtrToInt32; -FX_BOOL BC_FX_ByteString_Replace(CFX_ByteString &dst, FX_DWORD first, FX_DWORD last, FX_INT32 count, FX_CHAR c); -void BC_FX_ByteString_Append(CFX_ByteString &dst, FX_INT32 count, FX_CHAR c); +typedef CFX_MapPtrTemplate CFX_PtrToInt32; +FX_BOOL BC_FX_ByteString_Replace(CFX_ByteString &dst, FX_DWORD first, FX_DWORD 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); typedef FX_BOOL (*BC_PtrArrayCompareCallback)(FX_LPVOID l, FX_LPVOID r); void BC_FX_PtrArray_Sort(CFX_PtrArray &src, BC_PtrArrayCompareCallback fun); diff --git a/xfa/src/fxfa/src/app/xfa_checksum.cpp b/xfa/src/fxfa/src/app/xfa_checksum.cpp index 0ed07bb579..9f4345f408 100644 --- a/xfa/src/fxfa/src/app/xfa_checksum.cpp +++ b/xfa/src/fxfa/src/app/xfa_checksum.cpp @@ -112,7 +112,7 @@ void CXFA_SAXReaderHandler::OnTargetData(FX_LPVOID pTag, FX_SAXNODE eType, FX_BS } void CXFA_SAXReaderHandler::UpdateChecksum(FX_BOOL bCheckSpace) { - FX_INT32 iLength = m_SAXContext.m_TextBuf.GetLength(); + int32_t iLength = m_SAXContext.m_TextBuf.GetLength(); if (iLength < 1) { return; } @@ -120,7 +120,7 @@ void CXFA_SAXReaderHandler::UpdateChecksum(FX_BOOL bCheckSpace) FX_BOOL bUpdata = TRUE; if (bCheckSpace) { bUpdata = FALSE; - for (FX_INT32 i = 0; i < iLength; i++) { + for (int32_t i = 0; i < iLength; i++) { bUpdata = (pBuffer[i] > 0x20); if (bUpdata) { break; @@ -148,7 +148,7 @@ CXFA_ChecksumContext::~CXFA_ChecksumContext() FX_BOOL CXFA_ChecksumContext::StartChecksum() { FinishChecksum(); - m_pByteContext = FX_Alloc(FX_BYTE, 128); + m_pByteContext = FX_Alloc(uint8_t, 128); FXSYS_assert(m_pByteContext != NULL); CRYPT_SHA1Start(m_pByteContext); m_bsChecksum.Empty(); @@ -180,10 +180,10 @@ void CXFA_ChecksumContext::FinishChecksum() m_pSAXReader = NULL; } if (m_pByteContext) { - FX_BYTE digest[20]; + uint8_t digest[20]; FXSYS_memset(digest, 0, 20); CRYPT_SHA1Finish(m_pByteContext, digest); - FX_INT32 nLen = FX_Base64EncodeA(digest, 20, NULL); + int32_t nLen = FX_Base64EncodeA(digest, 20, NULL); FX_LPSTR pBuffer = m_bsChecksum.GetBuffer(nLen); FX_Base64EncodeA(digest, 20, pBuffer); m_bsChecksum.ReleaseBuffer(nLen); diff --git a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp b/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp index de46a33b32..ad68812aa9 100644 --- a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp @@ -15,20 +15,20 @@ CXFA_FFConfigAcc::CXFA_FFConfigAcc(CXFA_Node *pNode) CXFA_FFConfigAcc::~CXFA_FFConfigAcc() { } -FX_INT32 CXFA_FFConfigAcc::CountChildren() +int32_t CXFA_FFConfigAcc::CountChildren() { GetPsMapNode(); if (m_pPsMapNode == NULL) { return 0; } - FX_INT32 iCount = 0; + int32_t iCount = 0; CXFA_Node* pNode = m_pPsMapNode->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { iCount++; } return iCount; } -FX_BOOL CXFA_FFConfigAcc::GetFontInfo(FX_INT32 index, CFX_WideString &wsFontFamily, CFX_WideString &wsPsName, FX_BOOL bBold, FX_BOOL bItalic) +FX_BOOL CXFA_FFConfigAcc::GetFontInfo(int32_t index, CFX_WideString &wsFontFamily, CFX_WideString &wsPsName, FX_BOOL bBold, FX_BOOL bItalic) { if (index < 0 || index >= CountChildren()) { return FALSE; diff --git a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.h b/xfa/src/fxfa/src/app/xfa_ffConfigAcc.h index 73237b9f01..5a21fd3a00 100644 --- a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.h +++ b/xfa/src/fxfa/src/app/xfa_ffConfigAcc.h @@ -11,8 +11,8 @@ class CXFA_FFConfigAcc public: CXFA_FFConfigAcc(CXFA_Node *pNode); ~CXFA_FFConfigAcc(); - FX_INT32 CountChildren(); - FX_BOOL GetFontInfo(FX_INT32 index, CFX_WideString &wsFontFamily, CFX_WideString &wsPsName, FX_BOOL bBold, FX_BOOL bItalic); + int32_t CountChildren(); + FX_BOOL GetFontInfo(int32_t index, CFX_WideString &wsFontFamily, CFX_WideString &wsPsName, FX_BOOL bBold, FX_BOOL bItalic); private: void GetPsMapNode(); CXFA_Node *m_pNode; diff --git a/xfa/src/fxfa/src/app/xfa_ffapp.cpp b/xfa/src/fxfa/src/app/xfa_ffapp.cpp index ea5136955b..2fc52722ef 100644 --- a/xfa/src/fxfa/src/app/xfa_ffapp.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffapp.cpp @@ -28,10 +28,10 @@ FX_FILESIZE CXFA_FileRead::GetSize() if (m_StreamSize.GetSize() > 0) { return m_dwSize; } - FX_INT32 iCount = m_Streams.GetSize(); + int32_t iCount = m_Streams.GetSize(); FX_DWORD iBufferSize = 4096; - FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, iBufferSize); - for (FX_INT32 i = 0; i < iCount; i++) { + FX_LPBYTE pBuf = FX_Alloc(uint8_t, iBufferSize); + for (int32_t i = 0; i < iCount; i++) { CPDF_StreamFilter* pStreamFilter = m_Streams[i]->GetStreamFilter(FALSE); FX_DWORD dwCurSize = 0; while (TRUE) { @@ -51,8 +51,8 @@ FX_FILESIZE CXFA_FileRead::GetSize() FX_BOOL CXFA_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) { FX_FILESIZE dwLen = 0; - FX_INT32 iCount = m_Streams.GetSize(); - FX_INT32 i = 0; + int32_t iCount = m_Streams.GetSize(); + int32_t i = 0; for (; i < iCount; i++) { dwLen += m_StreamSize[i]; if (dwLen > offset) { @@ -65,7 +65,7 @@ FX_BOOL CXFA_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) } CPDF_StreamFilter* pStreamFilter = m_Streams[i]->GetStreamFilter(FALSE); if ((offset -= dwLen) > 0) { - FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, offset); + FX_LPBYTE pBuf = FX_Alloc(uint8_t, offset); FX_DWORD dwRead = pStreamFilter->ReadBlock(pBuf, offset); FX_Free(pBuf); } @@ -76,7 +76,7 @@ FX_BOOL CXFA_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) return TRUE; } FX_DWORD dwReadSize = dwHadRead; - for (FX_INT32 iStart = i + 1; iStart < iCount; iStart++) { + for (int32_t iStart = i + 1; iStart < iCount; iStart++) { CPDF_StreamFilter* pStreamFilter = m_Streams[iStart]->GetStreamFilter(FALSE); FX_DWORD dwHadRead = pStreamFilter->ReadBlock(((FX_LPBYTE)buffer) + dwReadSize, size); delete pStreamFilter; @@ -90,8 +90,8 @@ FX_BOOL CXFA_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) } CXFA_FileRead2::CXFA_FileRead2(const CFX_ArrayTemplate &streams) { - FX_INT32 iCount = streams.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = streams.GetSize(); + for (int32_t i = 0; i < iCount; i++) { CPDF_StreamAcc &acc = m_Data.Add(); acc.LoadAllData(streams[i]); } @@ -99,8 +99,8 @@ CXFA_FileRead2::CXFA_FileRead2(const CFX_ArrayTemplate &streams) FX_FILESIZE CXFA_FileRead2::GetSize() { FX_DWORD dwSize = 0; - FX_INT32 iCount = m_Data.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = m_Data.GetSize(); + for (int32_t i = 0; i < iCount; i++) { CPDF_StreamAcc &acc = m_Data[i]; dwSize += acc.GetSize(); } @@ -108,8 +108,8 @@ FX_FILESIZE CXFA_FileRead2::GetSize() } FX_BOOL CXFA_FileRead2::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) { - FX_INT32 iCount = m_Data.GetSize(); - FX_INT32 index = 0; + int32_t iCount = m_Data.GetSize(); + int32_t index = 0; while (index < iCount) { CPDF_StreamAcc &acc = m_Data[index]; FX_FILESIZE dwSize = acc.GetSize(); diff --git a/xfa/src/fxfa/src/app/xfa_ffbarcode.cpp b/xfa/src/fxfa/src/app/xfa_ffbarcode.cpp index f87009daf3..39f11b5a32 100644 --- a/xfa/src/fxfa/src/app/xfa_ffbarcode.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffbarcode.cpp @@ -40,7 +40,7 @@ FX_BOOL CXFA_FFBarcode::LoadWidget() m_pNormalWidget->UnlockUpdate(); return CXFA_FFField::LoadWidget(); } -void CXFA_FFBarcode::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFBarcode::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; @@ -69,7 +69,7 @@ void CXFA_FFBarcode::UpdateWidgetProperty() XFA_LPCBARCODETYPEENUMINFO pBarcodeTypeInfo = XFA_GetBarcodeTypeByName(wsType); pBarCodeWidget->SetType(pBarcodeTypeInfo->eBCType); CXFA_WidgetAcc *pAcc = GetDataAcc(); - FX_INT32 intVal; + int32_t intVal; FX_CHAR charVal; FX_BOOL boolVal; FX_FLOAT floatVal; @@ -107,7 +107,7 @@ void CXFA_FFBarcode::UpdateWidgetProperty() pBarCodeWidget->SetTruncated(boolVal); } if (pAcc->GetBarcodeAttribute_WideNarrowRatio(floatVal)) { - pBarCodeWidget->SetWideNarrowRatio((FX_INT32)floatVal); + pBarCodeWidget->SetWideNarrowRatio((int32_t)floatVal); } if (pBarcodeTypeInfo->eName == XFA_BARCODETYPE_code3Of9 || pBarcodeTypeInfo->eName == XFA_BARCODETYPE_ean8 @@ -199,17 +199,17 @@ extern const XFA_BARCODETYPEENUMINFO g_XFABarCodeTypeEnumData[] = { {0xfaeaf37f, L"postUSStandard", XFA_BARCODETYPE_postUSStandard, BC_UNKNOWN}, {0xfb48155c, L"code3Of9", XFA_BARCODETYPE_code3Of9, BC_CODE39}, }; -extern const FX_INT32 g_iXFABarcodeTypeCount = sizeof(g_XFABarCodeTypeEnumData) / sizeof(XFA_BARCODETYPEENUMINFO); +extern const int32_t g_iXFABarcodeTypeCount = sizeof(g_XFABarCodeTypeEnumData) / sizeof(XFA_BARCODETYPEENUMINFO); static XFA_LPCBARCODETYPEENUMINFO XFA_GetBarcodeTypeByName(FX_WSTR wsName) { - FX_INT32 iLength = wsName.GetLength(); + int32_t iLength = wsName.GetLength(); if (iLength == 0) { return NULL; } - FX_UINT32 uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength, TRUE); - FX_INT32 iStart = 0, iEnd = g_iXFABarcodeTypeCount - 1; + uint32_t uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength, TRUE); + int32_t iStart = 0, iEnd = g_iXFABarcodeTypeCount - 1; do { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; XFA_LPCBARCODETYPEENUMINFO pInfo = g_XFABarCodeTypeEnumData + iMid; if (uHash == pInfo->uHash) { return pInfo; diff --git a/xfa/src/fxfa/src/app/xfa_ffbarcode.h b/xfa/src/fxfa/src/app/xfa_ffbarcode.h index 35b4212efa..d6589c090a 100644 --- a/xfa/src/fxfa/src/app/xfa_ffbarcode.h +++ b/xfa/src/fxfa/src/app/xfa_ffbarcode.h @@ -13,7 +13,7 @@ public: CXFA_FFBarcode(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); virtual ~CXFA_FFBarcode(); virtual FX_BOOL LoadWidget(); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); virtual void UpdateWidgetProperty(); virtual FX_BOOL OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); @@ -83,7 +83,7 @@ enum XFA_BARCODETYPEENUM { XFA_BARCODETYPE_upsMaxicode }; struct XFA_BARCODETYPEENUMINFO { - FX_UINT32 uHash; + uint32_t uHash; FX_LPCWSTR pName; XFA_BARCODETYPEENUM eName; BC_TYPE eBCType; diff --git a/xfa/src/fxfa/src/app/xfa_ffcheckbutton.cpp b/xfa/src/fxfa/src/app/xfa_ffcheckbutton.cpp index 6115d61bcd..3cb3628aca 100644 --- a/xfa/src/fxfa/src/app/xfa_ffcheckbutton.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffcheckbutton.cpp @@ -54,7 +54,7 @@ void CXFA_FFCheckButton::UpdateWidgetProperty() FX_FLOAT fSize = m_pDataAcc->GetCheckButtonSize(); pCheckBox->SetBoxSize(fSize); FX_DWORD dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCross; - FX_INT32 iCheckMark = m_pDataAcc->GetCheckButtonMark(); + int32_t iCheckMark = m_pDataAcc->GetCheckButtonMark(); switch(iCheckMark) { case XFA_ATTRIBUTEENUM_Check: dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCheck; @@ -74,7 +74,7 @@ void CXFA_FFCheckButton::UpdateWidgetProperty() dwStyleEx = FWL_STYLEEXT_CKB_SignShapeStar; break; default: { - FX_INT32 iShape = m_pDataAcc->GetCheckButtonShape(); + int32_t iShape = m_pDataAcc->GetCheckButtonShape(); if (iShape == XFA_ATTRIBUTEENUM_Round) { dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCircle; } @@ -96,7 +96,7 @@ FX_BOOL CXFA_FFCheckButton::LayoutWidget() if (mgWidget.IsExistInXML()) { XFA_RectWidthoutMargin(rtWidget, mgWidget); } - FX_INT32 iCapPlacement = -1; + int32_t iCapPlacement = -1; FX_FLOAT fCapReserve = 0; CXFA_Caption caption = m_pDataAcc->GetCaption(); if (caption.IsExistInXML() && caption.GetPresence()) { @@ -111,8 +111,8 @@ FX_BOOL CXFA_FFCheckButton::LayoutWidget() } } } - FX_INT32 iHorzAlign = XFA_ATTRIBUTEENUM_Left; - FX_INT32 iVertAlign = XFA_ATTRIBUTEENUM_Top; + int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left; + int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top; if (CXFA_Para para = m_pDataAcc->GetPara()) { iHorzAlign = para.GetHorizontalAlign(); iVertAlign = para.GetVerticalAlign(); @@ -194,7 +194,7 @@ void CXFA_FFCheckButton::CapLeftRightPlacement(CXFA_Margin mgCap) m_rtCaption.width = -m_rtCaption.width; } } -void CXFA_FFCheckButton::AddUIMargin(FX_INT32 iCapPlacement) +void CXFA_FFCheckButton::AddUIMargin(int32_t iCapPlacement) { CFX_RectF rtUIMargin; m_pDataAcc->GetUIMargin(rtUIMargin); @@ -217,7 +217,7 @@ void CXFA_FFCheckButton::AddUIMargin(FX_INT32 iCapPlacement) m_rtUI.height += 2 * (fTopAddBottom - m_rtUI.height); } } -void CXFA_FFCheckButton::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFCheckButton::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; @@ -296,7 +296,7 @@ FX_BOOL CXFA_FFCheckButton::UpdateFWLData() m_pNormalWidget->Update(); return TRUE; } -FX_INT32 CXFA_FFCheckButton::OnProcessMessage(CFWL_Message *pMessage) +int32_t CXFA_FFCheckButton::OnProcessMessage(CFWL_Message *pMessage) { return m_pOldDelegate->OnProcessMessage(pMessage); } diff --git a/xfa/src/fxfa/src/app/xfa_ffcheckbutton.h b/xfa/src/fxfa/src/app/xfa_ffcheckbutton.h index 5c32a6d966..a3abfb6891 100644 --- a/xfa/src/fxfa/src/app/xfa_ffcheckbutton.h +++ b/xfa/src/fxfa/src/app/xfa_ffcheckbutton.h @@ -12,7 +12,7 @@ class CXFA_FFCheckButton : public CXFA_FFField public: CXFA_FFCheckButton(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); virtual ~CXFA_FFCheckButton(); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); virtual FX_BOOL LoadWidget(); virtual FX_BOOL LayoutWidget(); @@ -20,7 +20,7 @@ public: virtual void UpdateWidgetProperty(); virtual FX_BOOL OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); void SetFWLCheckState(XFA_CHECKSTATE eCheckState); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); @@ -28,7 +28,7 @@ protected: virtual FX_BOOL CommitData(); virtual FX_BOOL IsDataChanged(); void CapLeftRightPlacement(CXFA_Margin mgCap); - void AddUIMargin(FX_INT32 iCapPlacement); + void AddUIMargin(int32_t iCapPlacement); XFA_CHECKSTATE FWLState2XFAState(); IFWL_WidgetDelegate* m_pOldDelegate; CFX_RectF m_rtCheckBox; diff --git a/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp b/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp index 81b7ccb76f..47685a28a7 100644 --- a/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp @@ -40,8 +40,8 @@ FX_BOOL CXFA_FFListBox::LoadWidget() m_pNormalWidget->LockUpdate(); CFX_WideStringArray wsLabelArray; m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE); - FX_INT32 iItems = wsLabelArray.GetSize(); - for (FX_INT32 i = 0; i < iItems; i++) { + int32_t iItems = wsLabelArray.GetSize(); + for (int32_t i = 0; i < iItems; i++) { pListBox->AddString(wsLabelArray[i]); } FX_DWORD dwExtendedStyle = FWL_STYLEEXT_LTB_ShowScrollBarFocus; @@ -52,8 +52,8 @@ FX_BOOL CXFA_FFListBox::LoadWidget() m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF); CFX_Int32Array iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); - FX_INT32 iSelCount = iSelArray.GetSize(); - for (FX_INT32 j = 0; j < iSelCount; j++) { + int32_t iSelCount = iSelArray.GetSize(); + for (int32_t j = 0; j < iSelCount; j++) { FWL_HLISTITEM item = pListBox->GetItem(iSelArray[j]); pListBox->SetSelItem(item, TRUE); } @@ -73,9 +73,9 @@ FX_BOOL CXFA_FFListBox::CommitData() { FXSYS_assert(m_pNormalWidget != NULL); CFWL_ListBox* pListBox = (CFWL_ListBox*)m_pNormalWidget; - FX_INT32 iSels = pListBox->CountSelItems(); + int32_t iSels = pListBox->CountSelItems(); CFX_Int32Array iSelArray; - for (FX_INT32 i = 0; i < iSels; i++) { + for (int32_t i = 0; i < iSels; i++) { iSelArray.Add(pListBox->GetSelIndex(i)); } m_pDataAcc->SetSelectdItems(iSelArray, TRUE); @@ -85,11 +85,11 @@ FX_BOOL CXFA_FFListBox::IsDataChanged() { CFX_Int32Array iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); - FX_INT32 iOldSels = iSelArray.GetSize(); + int32_t iOldSels = iSelArray.GetSize(); CFWL_ListBox* pListBox = (CFWL_ListBox*)m_pNormalWidget; - FX_INT32 iSels = pListBox->CountSelItems(); + int32_t iSels = pListBox->CountSelItems(); if (iOldSels == iSels) { - FX_INT32 iIndex = 0; + int32_t iIndex = 0; for (; iIndex < iSels; iIndex++) { FWL_HLISTITEM hlistItem = pListBox->GetItem(iSelArray[iIndex]); if(!(pListBox->GetItemStates(hlistItem) && FWL_ITEMSTATE_LTB_Selected)) { @@ -106,7 +106,7 @@ FX_DWORD CXFA_FFListBox::GetAlignment() { FX_DWORD dwExtendedStyle = 0; if (CXFA_Para para = m_pDataAcc->GetPara()) { - FX_INT32 iHorz = para.GetHorizontalAlign(); + int32_t iHorz = para.GetHorizontalAlign(); switch(iHorz) { case XFA_ATTRIBUTEENUM_Center: dwExtendedStyle |= FWL_STYLEEXT_LTB_CenterAlign; @@ -136,13 +136,13 @@ FX_BOOL CXFA_FFListBox::UpdateFWLData() CFX_ArrayTemplate selItemArray; CFX_Int32Array iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); - FX_INT32 iSelCount = iSelArray.GetSize(); - for (FX_INT32 j = 0; j < iSelCount; j++) { + int32_t iSelCount = iSelArray.GetSize(); + for (int32_t j = 0; j < iSelCount; j++) { FWL_HLISTITEM lpItemSel = pListBox->GetSelItem(iSelArray[j]); selItemArray.Add(lpItemSel); } pListBox->SetSelItem(pListBox->GetSelItem(-1), FALSE); - for(FX_INT32 i = 0; i < iSelCount; i++) { + for(int32_t i = 0; i < iSelCount; i++) { ((CFWL_ListBox*)m_pNormalWidget)->SetSelItem(selItemArray[i], TRUE); } m_pNormalWidget->Update(); @@ -155,27 +155,27 @@ void CXFA_FFListBox::OnSelectChanged(IFWL_Widget *pWidget, const CFX_Int32Array eParam.m_pTarget = m_pDataAcc; m_pDataAcc->GetValue(eParam.m_wsPrevText, XFA_VALUEPICTURE_Raw); CFWL_ListBox* pListBox = (CFWL_ListBox*)m_pNormalWidget; - FX_INT32 iSels = pListBox->CountSelItems(); + int32_t iSels = pListBox->CountSelItems(); if (iSels > 0) { pListBox->GetItemText(pListBox->GetSelItem(0), eParam.m_wsNewText); } m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam); } -void CXFA_FFListBox::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected) +void CXFA_FFListBox::SetItemState(int32_t nIndex, FX_BOOL bSelected) { FWL_HLISTITEM item = ((CFWL_ListBox*)m_pNormalWidget)->GetSelItem(nIndex); ((CFWL_ListBox*)m_pNormalWidget)->SetSelItem(item, bSelected); m_pNormalWidget->Update(); AddInvalidateRect(); } -void CXFA_FFListBox::InsertItem(FX_WSTR wsLabel, FX_INT32 nIndex ) +void CXFA_FFListBox::InsertItem(FX_WSTR wsLabel, int32_t nIndex ) { CFX_WideString wsTemp(wsLabel); ((CFWL_ListBox*)m_pNormalWidget)->AddString(wsTemp); m_pNormalWidget->Update(); AddInvalidateRect(); } -void CXFA_FFListBox::DeleteItem(FX_INT32 nIndex) +void CXFA_FFListBox::DeleteItem(int32_t nIndex) { if (nIndex < 0) { ((CFWL_ListBox*)m_pNormalWidget)->DeleteAll(); @@ -185,7 +185,7 @@ void CXFA_FFListBox::DeleteItem(FX_INT32 nIndex) m_pNormalWidget->Update(); AddInvalidateRect(); } -FX_INT32 CXFA_FFListBox::OnProcessMessage(CFWL_Message *pMessage) +int32_t CXFA_FFListBox::OnProcessMessage(CFWL_Message *pMessage) { return m_pOldDelegate->OnProcessMessage(pMessage); } @@ -260,13 +260,13 @@ FX_BOOL CXFA_FFComboBox::LoadWidget() m_pNormalWidget->LockUpdate(); CFX_WideStringArray wsLabelArray; m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE); - FX_INT32 iItems = wsLabelArray.GetSize(); - for (FX_INT32 i = 0; i < iItems; i++) { + int32_t iItems = wsLabelArray.GetSize(); + for (int32_t i = 0; i < iItems; i++) { pComboBox->AddString(wsLabelArray[i]); } CFX_Int32Array iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); - FX_INT32 iSelCount = iSelArray.GetSize(); + int32_t iSelCount = iSelArray.GetSize(); if (iSelCount > 0) { pComboBox->SetCurSel(iSelArray[0]); } else { @@ -334,7 +334,7 @@ FX_BOOL CXFA_FFComboBox::IsDataChanged() CFWL_ComboBox* pFWLcombobox = ((CFWL_ComboBox*)m_pNormalWidget); CFX_WideString wsText; pFWLcombobox->GetEditText(wsText); - FX_INT32 iCursel = pFWLcombobox->GetCurSel(); + int32_t iCursel = pFWLcombobox->GetCurSel(); if (iCursel >= 0) { CFX_WideString wsSel; pFWLcombobox->GetTextByIndex(iCursel, wsSel); @@ -362,7 +362,7 @@ FX_DWORD CXFA_FFComboBox::GetAlignment() { FX_DWORD dwExtendedStyle = 0; if (CXFA_Para para = m_pDataAcc->GetPara()) { - FX_INT32 iHorz = para.GetHorizontalAlign(); + int32_t iHorz = para.GetHorizontalAlign(); switch(iHorz) { case XFA_ATTRIBUTEENUM_Center: dwExtendedStyle |= FWL_STYLEEXT_CMB_EditHCenter | FWL_STYLEEXT_CMB_ListItemCenterAlign; @@ -380,7 +380,7 @@ FX_DWORD CXFA_FFComboBox::GetAlignment() dwExtendedStyle |= FWL_STYLEEXT_CMB_EditHNear | FWL_STYLEEXT_CMB_ListItemLeftAlign; break; } - FX_INT32 iVert = para.GetVerticalAlign(); + int32_t iVert = para.GetVerticalAlign(); switch(iVert) { case XFA_ATTRIBUTEENUM_Middle: dwExtendedStyle |= FWL_STYLEEXT_CMB_EditVCenter; @@ -402,7 +402,7 @@ FX_BOOL CXFA_FFComboBox::UpdateFWLData() } CFX_Int32Array iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); - FX_INT32 iSelCount = iSelArray.GetSize(); + int32_t iSelCount = iSelArray.GetSize(); if (iSelCount > 0) { ((CFWL_ComboBox*)m_pNormalWidget)->SetCurSel(iSelArray[0]); } else { @@ -473,7 +473,7 @@ FX_BOOL CXFA_FFComboBox::DeSelect() { return ((CFWL_ComboBox*)m_pNormalWidget)->EditDeSelect(); } -void CXFA_FFComboBox::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected) +void CXFA_FFComboBox::SetItemState(int32_t nIndex, FX_BOOL bSelected) { if (bSelected) { ((CFWL_ComboBox*)m_pNormalWidget)->SetCurSel(nIndex); @@ -483,13 +483,13 @@ void CXFA_FFComboBox::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected) m_pNormalWidget->Update(); AddInvalidateRect(); } -void CXFA_FFComboBox::InsertItem(FX_WSTR wsLabel, FX_INT32 nIndex ) +void CXFA_FFComboBox::InsertItem(FX_WSTR wsLabel, int32_t nIndex ) { ((CFWL_ComboBox*)m_pNormalWidget)->AddString(wsLabel); m_pNormalWidget->Update(); AddInvalidateRect(); } -void CXFA_FFComboBox::DeleteItem(FX_INT32 nIndex) +void CXFA_FFComboBox::DeleteItem(int32_t nIndex) { if (nIndex < 0) { ((CFWL_ComboBox*)m_pNormalWidget)->RemoveAll(); @@ -533,7 +533,7 @@ void CXFA_FFComboBox::OnAddDoRecord(IFWL_Widget *pWidget) { GetDoc()->GetDocProvider()->AddDoRecord(this); } -FX_INT32 CXFA_FFComboBox::OnProcessMessage(CFWL_Message *pMessage) +int32_t CXFA_FFComboBox::OnProcessMessage(CFWL_Message *pMessage) { return m_pOldDelegate->OnProcessMessage(pMessage); } diff --git a/xfa/src/fxfa/src/app/xfa_ffchoicelist.h b/xfa/src/fxfa/src/app/xfa_ffchoicelist.h index 72463ec513..c6ed12b668 100644 --- a/xfa/src/fxfa/src/app/xfa_ffchoicelist.h +++ b/xfa/src/fxfa/src/app/xfa_ffchoicelist.h @@ -20,10 +20,10 @@ protected: FX_DWORD GetAlignment(); public: void OnSelectChanged(IFWL_Widget *pWidget, const CFX_Int32Array &arrSels); - void SetItemState(FX_INT32 nIndex, FX_BOOL bSelected); - void InsertItem(FX_WSTR wsLabel, FX_INT32 nIndex = -1); - void DeleteItem(FX_INT32 nIndex); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + void SetItemState(int32_t nIndex, FX_BOOL bSelected); + void InsertItem(FX_WSTR wsLabel, int32_t nIndex = -1); + void DeleteItem(int32_t nIndex); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: @@ -70,10 +70,10 @@ public: void OnPreOpen(IFWL_Widget *pWidget); void OnPostOpen(IFWL_Widget *pWidget); void OnAddDoRecord(IFWL_Widget *pWidget); - void SetItemState(FX_INT32 nIndex, FX_BOOL bSelected); - void InsertItem(FX_WSTR wsLabel, FX_INT32 nIndex = -1); - void DeleteItem(FX_INT32 nIndex); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + void SetItemState(int32_t nIndex, FX_BOOL bSelected); + void InsertItem(FX_WSTR wsLabel, int32_t nIndex = -1); + void DeleteItem(int32_t nIndex); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: diff --git a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp index 4ca1007dab..10ed9d85bc 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp @@ -31,15 +31,15 @@ FX_DWORD CXFA_FFDoc::GetDocType() { return m_dwDocType; } -FX_INT32 CXFA_FFDoc::StartLoad() +int32_t CXFA_FFDoc::StartLoad() { m_pNotify = FX_NEW CXFA_FFNotify(this); IXFA_DocParser* pDocParser = IXFA_DocParser::Create(m_pNotify); - FX_INT32 iStatus = pDocParser->StartParse(m_pStream); + int32_t iStatus = pDocParser->StartParse(m_pStream); m_pDocument = pDocParser->GetDocument(); return iStatus; } -FX_BOOL XFA_GetPDFContentsFromPDFXML(IFDE_XMLNode *pPDFElement, FX_LPBYTE &pByteBuffer, FX_INT32& iBufferSize) +FX_BOOL XFA_GetPDFContentsFromPDFXML(IFDE_XMLNode *pPDFElement, FX_LPBYTE &pByteBuffer, int32_t& iBufferSize) { IFDE_XMLElement* pDocumentElement = NULL; for (IFDE_XMLNode *pXMLNode = pPDFElement->GetNodeItem(IFDE_XMLNode::FirstChild); pXMLNode; pXMLNode = pXMLNode->GetNodeItem(IFDE_XMLNode::NextSibling)) { @@ -74,7 +74,7 @@ FX_BOOL XFA_GetPDFContentsFromPDFXML(IFDE_XMLNode *pPDFElement, FX_LPBYTE &pByte CFX_WideString wsPDFContent; pChunkElement->GetTextData(wsPDFContent); iBufferSize = FX_Base64DecodeW(wsPDFContent, wsPDFContent.GetLength(), NULL); - pByteBuffer = FX_Alloc(FX_BYTE, iBufferSize + 1); + pByteBuffer = FX_Alloc(uint8_t, iBufferSize + 1); if (!pByteBuffer) { return FALSE; } @@ -98,9 +98,9 @@ void XFA_XPDPacket_MergeRootNode(CXFA_Node *pOriginRoot, CXFA_Node* pNewRoot) } } } -FX_INT32 CXFA_FFDoc::DoLoad(IFX_Pause *pPause ) +int32_t CXFA_FFDoc::DoLoad(IFX_Pause *pPause ) { - FX_INT32 iStatus = m_pDocument->GetParser()->DoParse(pPause); + int32_t iStatus = m_pDocument->GetParser()->DoParse(pPause); if (iStatus == XFA_PARSESTATUS_Done && !m_pPDFDoc) { CXFA_Node* pPDFNode = (CXFA_Node*)m_pDocument->GetXFANode(XFA_HASHCODE_Pdf); if (!pPDFNode) { @@ -110,7 +110,7 @@ FX_INT32 CXFA_FFDoc::DoLoad(IFX_Pause *pPause ) if (pPDFXML->GetType() != FDE_XMLNODE_Element) { return XFA_PARSESTATUS_SyntaxErr; } - FX_INT32 iBufferSize = 0; + int32_t iBufferSize = 0; FX_LPBYTE pByteBuffer = NULL; IFX_FileRead* pXFAReader = NULL; if (XFA_GetPDFContentsFromPDFXML(pPDFXML, pByteBuffer, iBufferSize)) { @@ -183,10 +183,10 @@ void CXFA_FFDoc::StopLoad() } IXFA_DocView* CXFA_FFDoc::CreateDocView(FX_DWORD dwView ) { - CXFA_FFDocView* pDocView = (CXFA_FFDocView*)m_mapTypeToDocView.GetValueAt((FX_LPVOID)(FX_UINTPTR)dwView); + CXFA_FFDocView* pDocView = (CXFA_FFDocView*)m_mapTypeToDocView.GetValueAt((FX_LPVOID)(uintptr_t)dwView); if (!pDocView) { pDocView = FX_NEW CXFA_FFDocView(this); - m_mapTypeToDocView.SetAt((FX_LPVOID)(FX_UINTPTR)dwView, pDocView); + m_mapTypeToDocView.SetAt((FX_LPVOID)(uintptr_t)dwView, pDocView); } return pDocView; } @@ -237,7 +237,7 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) if (pElementXFA == NULL) { return FALSE; } - FX_INT32 iObjType = pElementXFA->GetType(); + int32_t iObjType = pElementXFA->GetType(); CFX_ArrayTemplate xfaStreams; if (iObjType == PDFOBJ_ARRAY) { CPDF_Array* pXFAArray = (CPDF_Array*)pElementXFA; @@ -327,14 +327,14 @@ CPDF_Document* CXFA_FFDoc::GetPDFDoc() return m_pPDFDoc; } #define _FXLIB_NEW_VERSION_ -CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(FX_WSTR wsName, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi) +CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(FX_WSTR wsName, int32_t &iImageXDpi, int32_t &iImageYDpi) { if (!m_pPDFDoc) { return NULL; } FX_DWORD dwHash = FX_HashCode_String_GetW(wsName.GetPtr(), wsName.GetLength(), FALSE); FX_IMAGEDIB_AND_DPI *imageDIBDpi = NULL; - if (m_mapNamedImages.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)imageDIBDpi)) { + if (m_mapNamedImages.Lookup((void*)(uintptr_t)dwHash, (void*&)imageDIBDpi)) { iImageXDpi = imageDIBDpi->iImageXDpi; iImageYDpi = imageDIBDpi->iImageYDpi; return (CFX_DIBitmap*)imageDIBDpi->pDibSource; @@ -356,8 +356,8 @@ CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(FX_WSTR wsName, FX_INT32 &iImageXDpi, CFX_ByteString bsName = PDF_EncodeText(wsName.GetPtr(), wsName.GetLength()); CPDF_Object* pObject = nametree.LookupValue(bsName); if (!pObject) { - FX_INT32 iCount = nametree.GetCount(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = nametree.GetCount(); + for (int32_t i = 0; i < iCount; i++) { CFX_ByteString bsTemp; CPDF_Object* pTempObject = nametree.LookupValue(i, bsTemp); if (bsTemp == bsName) { @@ -369,8 +369,8 @@ CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(FX_WSTR wsName, FX_INT32 &iImageXDpi, #else CPDF_Object* pObject = nametree.LookupValue(wsName); if (!pObject) { - FX_INT32 iCount = nametree.GetCount(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = nametree.GetCount(); + for (int32_t i = 0; i < iCount; i++) { CFX_WideString wsTemp; CPDF_Object* pTempObject = nametree.LookupValue(i, wsTemp); if (wsTemp == wsName) { @@ -396,7 +396,7 @@ CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(FX_WSTR wsName, FX_INT32 &iImageXDpi, imageDIBDpi->iImageYDpi = iImageYDpi; pImageFileRead->Release(); } - m_mapNamedImages.SetAt((void*)(FX_UINTPTR)dwHash, imageDIBDpi); + m_mapNamedImages.SetAt((void*)(uintptr_t)dwHash, imageDIBDpi); return (CFX_DIBitmap*)imageDIBDpi->pDibSource; } IFDE_XMLElement* CXFA_FFDoc::GetPackageData(FX_WSTR wsPackage) diff --git a/xfa/src/fxfa/src/app/xfa_ffdoc.h b/xfa/src/fxfa/src/app/xfa_ffdoc.h index 964573f201..a8c5b80370 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdoc.h +++ b/xfa/src/fxfa/src/app/xfa_ffdoc.h @@ -16,8 +16,8 @@ class IXFA_Locale; typedef struct _FX_IMAGEDIB_AND_DPI { CFX_DIBSource* pDibSource; - FX_INT32 iImageXDpi; - FX_INT32 iImageYDpi; + int32_t iImageXDpi; + int32_t iImageYDpi; } FX_IMAGEDIB_AND_DPI; class CXFA_FFDoc : public IXFA_Doc @@ -30,8 +30,8 @@ public: return m_pDocProvider; } FX_DWORD GetDocType(); - FX_INT32 StartLoad(); - FX_INT32 DoLoad(IFX_Pause *pPause = NULL); + int32_t StartLoad(); + int32_t DoLoad(IFX_Pause *pPause = NULL); void StopLoad(); IXFA_DocView* CreateDocView(FX_DWORD dwView = 0); FX_BOOL OpenDoc(IFX_FileRead* pStream, FX_BOOL bTakeOverFile); @@ -49,7 +49,7 @@ public: CXFA_FFDocView* GetDocView(IXFA_DocLayout* pLayout); CXFA_FFDocView* GetDocView(); CPDF_Document* GetPDFDoc(); - CFX_DIBitmap* GetPDFNamedImage(FX_WSTR wsName, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi); + CFX_DIBitmap* GetPDFNamedImage(FX_WSTR wsName, int32_t &iImageXDpi, int32_t &iImageYDpi); IFDE_XMLElement* GetPackageData(FX_WSTR wsPackage); FX_BOOL SavePackage(FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext = NULL); FX_BOOL ImportData(IFX_FileRead* pStream, FX_BOOL bXDP = TRUE); diff --git a/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp b/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp index 9d76ca19e2..ccc734ecad 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp @@ -26,11 +26,11 @@ FX_DWORD CXFA_FFDocHandler::GetDocType(IXFA_Doc* hDoc) { return static_cast(hDoc)->GetDocType(); } -FX_INT32 CXFA_FFDocHandler::StartLoad(IXFA_Doc* hDoc) +int32_t CXFA_FFDocHandler::StartLoad(IXFA_Doc* hDoc) { return static_cast(hDoc)->StartLoad(); } -FX_INT32 CXFA_FFDocHandler::DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause ) +int32_t CXFA_FFDocHandler::DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause ) { return static_cast(hDoc)->DoLoad(pPause); } @@ -43,11 +43,11 @@ IXFA_DocView* CXFA_FFDocHandler::CreateDocView(IXFA_Doc* hDoc, FX_DWORD dwView ) { return static_cast(hDoc)->CreateDocView(dwView); } -FX_INT32 CXFA_FFDocHandler::CountPackages(IXFA_Doc* hDoc) +int32_t CXFA_FFDocHandler::CountPackages(IXFA_Doc* hDoc) { return 0; } -void CXFA_FFDocHandler::GetPackageName(IXFA_Doc* hDoc, FX_INT32 iPackage, CFX_WideStringC &wsPackage) +void CXFA_FFDocHandler::GetPackageName(IXFA_Doc* hDoc, int32_t iPackage, CFX_WideStringC &wsPackage) { } IFDE_XMLElement* CXFA_FFDocHandler::GetPackageData(IXFA_Doc* hDoc, FX_WSTR wsPackage) diff --git a/xfa/src/fxfa/src/app/xfa_ffdochandler.h b/xfa/src/fxfa/src/app/xfa_ffdochandler.h index 95abc6ad33..a421610d29 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdochandler.h +++ b/xfa/src/fxfa/src/app/xfa_ffdochandler.h @@ -15,13 +15,13 @@ public: virtual void ReleaseDoc(IXFA_Doc* hDoc); virtual IXFA_DocProvider* GetDocProvider(IXFA_Doc* hDoc); virtual FX_DWORD GetDocType(IXFA_Doc* hDoc); - virtual FX_INT32 StartLoad(IXFA_Doc* hDoc); - virtual FX_INT32 DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause = NULL); + virtual int32_t StartLoad(IXFA_Doc* hDoc); + virtual int32_t DoLoad(IXFA_Doc* hDoc, IFX_Pause *pPause = NULL); virtual void StopLoad(IXFA_Doc* hDoc); virtual IXFA_DocView* CreateDocView(IXFA_Doc* hDoc, FX_DWORD dwView = 0); - virtual FX_INT32 CountPackages(IXFA_Doc* hDoc); - virtual void GetPackageName(IXFA_Doc* hDoc, FX_INT32 iPackage, CFX_WideStringC &wsPackage); + virtual int32_t CountPackages(IXFA_Doc* hDoc); + virtual void GetPackageName(IXFA_Doc* hDoc, int32_t iPackage, CFX_WideStringC &wsPackage); virtual IFDE_XMLElement* GetPackageData(IXFA_Doc* hDoc, FX_WSTR wsPackage); virtual FX_BOOL SavePackage(IXFA_Doc* hDoc, FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext = NULL); virtual FX_BOOL CloseDoc(IXFA_Doc* hDoc); diff --git a/xfa/src/fxfa/src/app/xfa_ffdocview.cpp b/xfa/src/fxfa/src/app/xfa_ffdocview.cpp index 7f80c416b2..dcf6c28816 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdocview.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffdocview.cpp @@ -86,13 +86,13 @@ void CXFA_FFDocView::InitLayout(CXFA_Node* pNode) ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Initialize); ExecEventActivityByDeepFirst(pNode, XFA_EVENT_IndexChange); } -FX_INT32 CXFA_FFDocView::StartLayout(FX_INT32 iStartPage ) +int32_t CXFA_FFDocView::StartLayout(int32_t iStartPage ) { m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_Start; m_pDoc->GetXFADoc()->DoProtoMerge(); m_pDoc->GetXFADoc()->DoDataMerge(); m_pXFADocLayout = GetXFALayout(); - FX_INT32 iStatus = m_pXFADocLayout->StartLayout(); + int32_t iStatus = m_pXFADocLayout->StartLayout(); if (iStatus < 0) { return iStatus; } @@ -107,9 +107,9 @@ FX_INT32 CXFA_FFDocView::StartLayout(FX_INT32 iStartPage ) m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_Start; return iStatus; } -FX_INT32 CXFA_FFDocView::DoLayout(IFX_Pause *pPause ) +int32_t CXFA_FFDocView::DoLayout(IFX_Pause *pPause ) { - FX_INT32 iStatus = 100; + int32_t iStatus = 100; iStatus = m_pXFADocLayout->DoLayout(pPause); if (iStatus != 100) { return iStatus; @@ -150,20 +150,20 @@ void CXFA_FFDocView::StopLayout() } m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_End; } -FX_INT32 CXFA_FFDocView::GetLayoutStatus() +int32_t CXFA_FFDocView::GetLayoutStatus() { return m_iStatus; } void CXFA_FFDocView::ShowNullTestMsg() { - FX_INT32 iCount = m_arrNullTestMsg.GetSize(); + int32_t iCount = m_arrNullTestMsg.GetSize(); CXFA_FFApp* pApp = m_pDoc->GetApp(); IXFA_AppProvider* pAppProvider = pApp->GetAppProvider(); if (pAppProvider && iCount) { - FX_INT32 iRemain = iCount > 7 ? iCount - 7 : 0; + int32_t iRemain = iCount > 7 ? iCount - 7 : 0; iCount -= iRemain; CFX_WideString wsMsg; - for (FX_INT32 i = 0; i < iCount; i++) { + for (int32_t i = 0; i < iCount; i++) { wsMsg += m_arrNullTestMsg[i] + FX_WSTRC(L"\n"); } if (iRemain > 0) { @@ -187,8 +187,8 @@ void CXFA_FFDocView::UpdateDocView() return; } LockUpdate(); - FX_INT32 iNewAdds = m_NewAddedNodes.GetSize(); - for (FX_INT32 i = 0; i < iNewAdds; i++) { + int32_t iNewAdds = m_NewAddedNodes.GetSize(); + for (int32_t i = 0; i < iNewAdds; i++) { CXFA_Node* pNode = (CXFA_Node*)m_NewAddedNodes[i]; InitCalculate(pNode); InitValidate(pNode); @@ -208,14 +208,14 @@ void CXFA_FFDocView::UpdateDocView() this->RunInvalidate(); UnlockUpdate(); } -FX_INT32 CXFA_FFDocView::CountPageViews() +int32_t CXFA_FFDocView::CountPageViews() { if (!m_pXFADocLayout) { return 0; } return m_pXFADocLayout->CountPages(); } -IXFA_PageView* CXFA_FFDocView::GetPageView(FX_INT32 nIndex) +IXFA_PageView* CXFA_FFDocView::GetPageView(int32_t nIndex) { if (!m_pXFADocLayout) { return NULL; @@ -280,7 +280,7 @@ void CXFA_FFDocView::ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc ) m_pDoc->GetDocProvider()->SetChangeMark(m_pDoc); } } -FX_INT32 CXFA_FFDocView::ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc ) +int32_t CXFA_FFDocView::ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc ) { if (pParam == NULL) { return XFA_EVENTERROR_Error; @@ -431,7 +431,7 @@ void CXFA_FFDocView::DeleteLayoutItem(CXFA_FFWidget* pWidget) m_pOldFocusWidget = NULL; } } -static FX_INT32 XFA_ProcessEvent(CXFA_FFDocView* pDocView, CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam) +static int32_t XFA_ProcessEvent(CXFA_FFDocView* pDocView, CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam) { if (!pParam || pParam->m_eType == XFA_EVENT_Unknown) { return XFA_EVENTERROR_NotExist; @@ -461,12 +461,12 @@ static FX_INT32 XFA_ProcessEvent(CXFA_FFDocView* pDocView, CXFA_WidgetAcc* pWidg default: break; } - FX_INT32 iRet = pWidgetAcc->ProcessEvent(gs_EventActivity[pParam->m_eType], pParam); + int32_t iRet = pWidgetAcc->ProcessEvent(gs_EventActivity[pParam->m_eType], pParam); return iRet; } -FX_INT32 CXFA_FFDocView::ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady, FX_BOOL bRecursive, CXFA_Node* pExclude) +int32_t CXFA_FFDocView::ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady, FX_BOOL bRecursive, CXFA_Node* pExclude) { - FX_INT32 iRet = XFA_EVENTERROR_NotExist; + int32_t iRet = XFA_EVENTERROR_NotExist; if (pFormNode == pExclude) { return iRet; } @@ -528,7 +528,7 @@ CXFA_WidgetAcc* CXFA_FFDocView::GetWidgetAccByName(FX_WSTR wsName, CXFA_WidgetAc wsExpression = L"$form." + wsName; } XFA_RESOLVENODE_RS resoveNodeRS; - FX_INT32 iRet = pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwStyle); + int32_t iRet = pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwStyle); if (iRet < 1) { return NULL; } @@ -540,7 +540,7 @@ CXFA_WidgetAcc* CXFA_FFDocView::GetWidgetAccByName(FX_WSTR wsName, CXFA_WidgetAc } return NULL; } -void CXFA_FFDocView::OnPageEvent(IXFA_LayoutPage *pSender, XFA_PAGEEVENT eEvent, FX_INT32 iPageIndex) +void CXFA_FFDocView::OnPageEvent(IXFA_LayoutPage *pSender, XFA_PAGEEVENT eEvent, int32_t iPageIndex) { FX_BOOL bNofify = m_iStatus >= XFA_DOCVIEW_LAYOUTSTATUS_End; if (eEvent == XFA_PAGEEVENT_PageRemoved) { @@ -620,8 +620,8 @@ FX_BOOL CXFA_FFDocView::RunLayout() } void CXFA_FFDocView::RunSubformIndexChange() { - FX_INT32 iSubforms = m_IndexChangedSubforms.GetSize(); - for (FX_INT32 i = 0; i < iSubforms; i++) { + int32_t iSubforms = m_IndexChangedSubforms.GetSize(); + for (int32_t i = 0; i < iSubforms; i++) { CXFA_Node* pSubformNode = (CXFA_Node*)m_IndexChangedSubforms[i]; CXFA_WidgetAcc* pWidgetAcc = (CXFA_WidgetAcc*)pSubformNode->GetWidgetData(); if (!pWidgetAcc) { @@ -667,7 +667,7 @@ FX_BOOL CXFA_FFDocView::IsStaticNotify() } void CXFA_FFDocView::AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) { - FX_INT32 iAccs = m_CalculateAccs.GetSize(); + int32_t iAccs = m_CalculateAccs.GetSize(); CXFA_WidgetAcc* pCurrentAcc = (iAccs < 1) ? (CXFA_WidgetAcc*)NULL : (CXFA_WidgetAcc*)m_CalculateAccs[iAccs - 1]; if (pCurrentAcc != pWidgetAcc) { m_CalculateAccs.Add(pWidgetAcc); @@ -676,27 +676,27 @@ void CXFA_FFDocView::AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) void CXFA_FFDocView::AddCalculateNodeNotify(CXFA_Node* pNodeChange) { CXFA_CalcData* pGlobalData = (CXFA_CalcData*)pNodeChange->GetUserData(XFA_CalcData); - FX_INT32 iCount = pGlobalData ? pGlobalData->m_Globals.GetSize() : 0; - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = pGlobalData ? pGlobalData->m_Globals.GetSize() : 0; + for (int32_t i = 0; i < iCount; i++) { CXFA_WidgetAcc* pResultAcc = (CXFA_WidgetAcc*)pGlobalData->m_Globals[i]; if (pResultAcc->GetNode()->HasFlag(XFA_NODEFLAG_HasRemoved)) { continue; } - FX_INT32 iAccs = m_CalculateAccs.GetSize(); + int32_t iAccs = m_CalculateAccs.GetSize(); CXFA_WidgetAcc* pCurrentAcc = (iAccs < 1) ? (CXFA_WidgetAcc*)NULL : (CXFA_WidgetAcc*)m_CalculateAccs[iAccs - 1]; if (pCurrentAcc != pResultAcc) { m_CalculateAccs.Add(pResultAcc); } } } -void CXFA_FFDocView::RunCalculateRecursive(FX_INT32& iIndex) +void CXFA_FFDocView::RunCalculateRecursive(int32_t& iIndex) { while (iIndex < m_CalculateAccs.GetSize()) { CXFA_WidgetAcc* pCurAcc = (CXFA_WidgetAcc*)m_CalculateAccs[iIndex]; AddCalculateNodeNotify(pCurAcc->GetNode()); - FX_INT32 iRefCount = (FX_INT32)(FX_UINTPTR)pCurAcc->GetNode()->GetUserData(XFA_CalcRefCount); + int32_t iRefCount = (int32_t)(uintptr_t)pCurAcc->GetNode()->GetUserData(XFA_CalcRefCount); iRefCount++; - pCurAcc->GetNode()->SetUserData(XFA_CalcRefCount, (FX_LPVOID)(FX_UINTPTR)iRefCount); + pCurAcc->GetNode()->SetUserData(XFA_CalcRefCount, (FX_LPVOID)(uintptr_t)iRefCount); if (iRefCount > 11) { break; } @@ -707,19 +707,19 @@ void CXFA_FFDocView::RunCalculateRecursive(FX_INT32& iIndex) RunCalculateRecursive(iIndex); } } -FX_INT32 CXFA_FFDocView::RunCalculateWidgets() +int32_t CXFA_FFDocView::RunCalculateWidgets() { if (!m_pDoc->GetDocProvider()->IsCalculationsEnabled(m_pDoc)) { return XFA_EVENTERROR_Disabled; } - FX_INT32 iCounts = m_CalculateAccs.GetSize(); - FX_INT32 iIndex = 0; + int32_t iCounts = m_CalculateAccs.GetSize(); + int32_t iIndex = 0; if (iCounts > 0) { RunCalculateRecursive(iIndex); } - for (FX_INT32 i = 0; i < m_CalculateAccs.GetSize(); i++) { + for (int32_t i = 0; i < m_CalculateAccs.GetSize(); i++) { CXFA_WidgetAcc* pCurAcc = (CXFA_WidgetAcc*)m_CalculateAccs[i]; - pCurAcc->GetNode()->SetUserData(XFA_CalcRefCount, (FX_LPVOID)(FX_UINTPTR)0); + pCurAcc->GetNode()->SetUserData(XFA_CalcRefCount, (FX_LPVOID)(uintptr_t)0); } m_CalculateAccs.RemoveAll(); return XFA_EVENTERROR_Sucess; @@ -749,8 +749,8 @@ FX_BOOL CXFA_FFDocView::RunValidate() if (!m_pDoc->GetDocProvider()->IsValidationsEnabled(m_pDoc)) { return FALSE; } - FX_INT32 iCounts = m_ValidateAccs.GetSize(); - for (FX_INT32 i = 0; i < iCounts; i++) { + int32_t iCounts = m_ValidateAccs.GetSize(); + for (int32_t i = 0; i < iCounts; i++) { CXFA_WidgetAcc* pAcc = (CXFA_WidgetAcc*)m_ValidateAccs[i]; if (pAcc->GetNode()->HasFlag(XFA_NODEFLAG_HasRemoved)) { continue; @@ -772,8 +772,8 @@ FX_BOOL CXFA_FFDocView::RunEventLayoutReady() } void CXFA_FFDocView::RunBindItems() { - FX_INT32 iCount = m_bindItems.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = m_bindItems.GetSize(); + for (int32_t i = 0; i < iCount; i++) { if (((CXFA_Node*)m_bindItems[i])->HasFlag(XFA_NODEFLAG_HasRemoved)) { continue; } @@ -789,7 +789,7 @@ void CXFA_FFDocView::RunBindItems() FX_DWORD dwStyle = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_ALL; XFA_RESOLVENODE_RS rs; pScriptContext->ResolveObjects(pWidgetNode, wsRef, rs, dwStyle); - FX_INT32 iCount = rs.nodes.GetSize(); + int32_t iCount = rs.nodes.GetSize(); pAcc->DeleteItem(-1); if (rs.dwFlags != XFA_RESOVENODE_RSTYPE_Nodes || iCount < 1) { continue; @@ -803,7 +803,7 @@ void CXFA_FFDocView::RunBindItems() CFX_WideString wsValue, wsLabel; FX_DWORD uValueHash = FX_HashCode_String_GetW(CFX_WideString(wsValueRef), wsValueRef.GetLength()); FX_DWORD uLableHash = FX_HashCode_String_GetW(CFX_WideString(wsLabelRef), wsLabelRef.GetLength()); - for (FX_INT32 i = 0; i < iCount; i++) { + for (int32_t i = 0; i < iCount; i++) { CXFA_Object* refObj = rs.nodes[i]; if(!refObj->IsNode()) { continue; diff --git a/xfa/src/fxfa/src/app/xfa_ffdocview.h b/xfa/src/fxfa/src/app/xfa_ffdocview.h index e3f2d643e2..e7493e653d 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdocview.h +++ b/xfa/src/fxfa/src/app/xfa_ffdocview.h @@ -38,17 +38,17 @@ public: ~CXFA_FFDocView(); virtual IXFA_Doc* GetDoc() { return m_pDoc; } - virtual FX_INT32 StartLayout(FX_INT32 iStartPage = 0); - virtual FX_INT32 DoLayout(IFX_Pause *pPause = NULL); + virtual int32_t StartLayout(int32_t iStartPage = 0); + virtual int32_t DoLayout(IFX_Pause *pPause = NULL); virtual void StopLayout(); - virtual FX_INT32 GetLayoutStatus(); + virtual int32_t GetLayoutStatus(); virtual void UpdateDocView(); - virtual FX_INT32 CountPageViews(); - virtual IXFA_PageView* GetPageView(FX_INT32 nIndex); + virtual int32_t CountPageViews(); + virtual IXFA_PageView* GetPageView(int32_t nIndex); virtual IXFA_Widget* GetWidgetByName(FX_WSTR wsName); virtual CXFA_WidgetAcc* GetWidgetAccByName(FX_WSTR wsName); virtual void ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc = NULL); - virtual FX_INT32 ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc = NULL); + virtual int32_t ProcessWidgetEvent(CXFA_EventParam* pParam, CXFA_WidgetAcc* pWidgetAcc = NULL); virtual IXFA_WidgetHandler* GetWidgetHandler(); virtual IXFA_WidgetIterator* CreateWidgetIterator(); virtual IXFA_WidgetAccIterator* CreateWidgetAccIterator(XFA_WIDGETORDER eOrder = XFA_WIDGETORDER_PreOrder); @@ -58,7 +58,7 @@ public: CXFA_FFWidget* GetWidgetByName(FX_WSTR wsName, CXFA_FFWidget* pRefWidget = NULL); CXFA_WidgetAcc* GetWidgetAccByName(FX_WSTR wsName, CXFA_WidgetAcc* pRefWidgetAcc = NULL); IXFA_DocLayout* GetXFALayout() const; - void OnPageEvent(IXFA_LayoutPage *pSender, XFA_PAGEEVENT eEvent, FX_INT32 iPageIndex); + void OnPageEvent(IXFA_LayoutPage *pSender, XFA_PAGEEVENT eEvent, int32_t iPageIndex); void LockUpdate(); void UnlockUpdate(); FX_BOOL IsUpdateLocked(); @@ -77,7 +77,7 @@ public: void AddValidateWidget(CXFA_WidgetAcc* pWidget); void AddCalculateNodeNotify(CXFA_Node* pNodeChange); void AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc); - FX_INT32 RunCalculateWidgets(); + int32_t RunCalculateWidgets(); FX_BOOL IsStaticNotify(); FX_BOOL RunLayout(); void RunSubformIndexChange(); @@ -86,7 +86,7 @@ public: CXFA_WidgetAcc* GetFocusWidgetAcc(); void SetFocusWidgetAcc(CXFA_WidgetAcc* pWidgetAcc); void DeleteLayoutItem(CXFA_FFWidget* pWidget); - FX_INT32 ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_Node* pExclude = NULL); + int32_t ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_Node* pExclude = NULL); FX_BOOL m_bLayoutEvent; CFX_WideStringArray m_arrNullTestMsg; CXFA_FFWidget* m_pListFocusWidget; @@ -96,7 +96,7 @@ protected: void RunBindItems(); FX_BOOL InitCalculate(CXFA_Node* pNode); void InitLayout(CXFA_Node* pNode); - void RunCalculateRecursive(FX_INT32& iIndex); + void RunCalculateRecursive(int32_t& iIndex); void ShowNullTestMsg(); FX_BOOL ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc); CXFA_Node* GetRootSubform(); @@ -114,7 +114,7 @@ protected: CFX_PtrArray m_NewAddedNodes; CFX_PtrArray m_IndexChangedSubforms; XFA_DOCVIEW_LAYOUTSTATUS m_iStatus; - FX_INT32 m_iLock; + int32_t m_iLock; friend class CXFA_FFNotify; }; class CXFA_FFDocWidgetIterator : public IXFA_WidgetIterator diff --git a/xfa/src/fxfa/src/app/xfa_ffexclgroup.cpp b/xfa/src/fxfa/src/app/xfa_ffexclgroup.cpp index 75d5f7e5c4..6256724a29 100644 --- a/xfa/src/fxfa/src/app/xfa_ffexclgroup.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffexclgroup.cpp @@ -18,7 +18,7 @@ CXFA_FFExclGroup::CXFA_FFExclGroup(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* p CXFA_FFExclGroup::~CXFA_FFExclGroup() { } -void CXFA_FFExclGroup::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFExclGroup::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; diff --git a/xfa/src/fxfa/src/app/xfa_ffexclgroup.h b/xfa/src/fxfa/src/app/xfa_ffexclgroup.h index bc8acd6789..c8d8ef51cc 100644 --- a/xfa/src/fxfa/src/app/xfa_ffexclgroup.h +++ b/xfa/src/fxfa/src/app/xfa_ffexclgroup.h @@ -12,7 +12,7 @@ public: CXFA_FFExclGroup(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); virtual ~CXFA_FFExclGroup(); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); protected: }; #endif diff --git a/xfa/src/fxfa/src/app/xfa_fffield.cpp b/xfa/src/fxfa/src/app/xfa_fffield.cpp index 34b73b55b0..87d3adad80 100644 --- a/xfa/src/fxfa/src/app/xfa_fffield.cpp +++ b/xfa/src/fxfa/src/app/xfa_fffield.cpp @@ -53,7 +53,7 @@ FX_BOOL CXFA_FFField::GetBBox(CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDraw mt.TransformRect(rtBox); return TRUE; } -void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; @@ -276,7 +276,7 @@ void CXFA_FFField::CapPlacement() } m_rtUI.Normalize(); } -void CXFA_FFField::CapTopBottomPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, FX_INT32 iCapPlacement) +void CXFA_FFField::CapTopBottomPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, int32_t iCapPlacement) { CFX_RectF rtUIMargin; m_pDataAcc->GetUIMargin(rtUIMargin); @@ -302,7 +302,7 @@ void CXFA_FFField::CapTopBottomPlacement(CXFA_Caption caption, const CFX_RectF & } } } -void CXFA_FFField::CapLeftRightPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, FX_INT32 iCapPlacement) +void CXFA_FFField::CapLeftRightPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, int32_t iCapPlacement) { CFX_RectF rtUIMargin; m_pDataAcc->GetUIMargin(rtUIMargin); @@ -466,7 +466,7 @@ FX_BOOL CXFA_FFField::OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) TranslateFWLMessage(&ms); return TRUE; } -FX_BOOL CXFA_FFField::OnMouseWheel(FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy) +FX_BOOL CXFA_FFField::OnMouseWheel(FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy) { return FALSE; if (!m_pNormalWidget) { @@ -714,13 +714,13 @@ FX_BOOL CXFA_FFField::ProcessCommittedData() m_pDocView->AddValidateWidget(m_pDataAcc); return TRUE; } -FX_INT32 CXFA_FFField::CalculateOverride() +int32_t CXFA_FFField::CalculateOverride() { CXFA_WidgetAcc* pAcc = m_pDataAcc->GetExclGroup(); if (!pAcc) { return CalculateWidgetAcc(m_pDataAcc); } - FX_INT32 iOverride = 0; + int32_t iOverride = 0; if (CalculateWidgetAcc(pAcc) == 0) { return 0; } @@ -741,7 +741,7 @@ FX_INT32 CXFA_FFField::CalculateOverride() } return 1; } -FX_INT32 CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc) +int32_t CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc) { CXFA_Calculate calc = pAcc->GetCalculate(); if (!calc) { @@ -749,7 +749,7 @@ FX_INT32 CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc) } XFA_VERSION version = pAcc->GetDoc()->GetXFADoc()->GetCurVersionMode(); if (calc) { - FX_INT32 iOverride = calc.GetOverride(); + int32_t iOverride = calc.GetOverride(); switch (iOverride) { case XFA_ATTRIBUTEENUM_Error: { if (version <= XFA_VERSION_204) { @@ -823,7 +823,7 @@ void CXFA_FFField::TranslateFWLMessage(CFWL_Message* pMessage) { GetApp()->GetWidgetMgrDelegate()->OnProcessMessageToForm(pMessage); } -FX_INT32 CXFA_FFField::OnProcessMessage(CFWL_Message *pMessage) +int32_t CXFA_FFField::OnProcessMessage(CFWL_Message *pMessage) { return FWL_ERR_Succeeded; } diff --git a/xfa/src/fxfa/src/app/xfa_fffield.h b/xfa/src/fxfa/src/app/xfa_fffield.h index c2f7e680e2..16dd3d65a7 100644 --- a/xfa/src/fxfa/src/app/xfa_fffield.h +++ b/xfa/src/fxfa/src/app/xfa_fffield.h @@ -16,7 +16,7 @@ public: virtual ~CXFA_FFField(); virtual FX_BOOL GetBBox(CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); virtual FX_BOOL IsLoaded(); virtual FX_BOOL LoadWidget(); virtual void UnloadWidget(); @@ -29,7 +29,7 @@ public: virtual FX_BOOL OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnLButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); - virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy); + virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); @@ -53,8 +53,8 @@ protected: void LayoutCaption(); void RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL); - FX_INT32 CalculateOverride(); - FX_INT32 CalculateWidgetAcc(CXFA_WidgetAcc* pAcc); + int32_t CalculateOverride(); + int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc); FX_BOOL ProcessCommittedData(); virtual FX_BOOL CommitData(); virtual FX_BOOL IsDataChanged(); @@ -62,11 +62,11 @@ protected: void DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix); void TranslateFWLMessage(CFWL_Message* pMessage); void CapPlacement(); - void CapTopBottomPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, FX_INT32 iCapPlacement); - void CapLeftRightPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, FX_INT32 iCapPlacement); + void CapTopBottomPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, int32_t iCapPlacement); + void CapLeftRightPlacement(CXFA_Caption caption, const CFX_RectF &rtWidget, int32_t iCapPlacement); void SetEditScrollOffset(); public: - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: diff --git a/xfa/src/fxfa/src/app/xfa_ffimage.cpp b/xfa/src/fxfa/src/app/xfa_ffimage.cpp index a12b1ff9dc..78eef33978 100644 --- a/xfa/src/fxfa/src/app/xfa_ffimage.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffimage.cpp @@ -36,7 +36,7 @@ void CXFA_FFImage::UnloadWidget() { GetDataAcc()->SetImageImage(NULL); } -void CXFA_FFImage::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFImage::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; @@ -53,17 +53,17 @@ void CXFA_FFImage::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWOR if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) { XFA_RectWidthoutMargin(rtImage, mgWidget); } - FX_INT32 iHorzAlign = XFA_ATTRIBUTEENUM_Left; - FX_INT32 iVertAlign = XFA_ATTRIBUTEENUM_Top; + int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left; + int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top; if (CXFA_Para para = m_pDataAcc->GetPara()) { iHorzAlign = para.GetHorizontalAlign(); iVertAlign = para.GetVerticalAlign(); } CXFA_Value value = m_pDataAcc->GetFormValue(); CXFA_Image imageObj = value.GetImage(); - FX_INT32 iAspect = imageObj.GetAspect(); - FX_INT32 iImageXDpi = 0; - FX_INT32 iImageYDpi = 0; + int32_t iAspect = imageObj.GetAspect(); + int32_t iImageXDpi = 0; + int32_t iImageYDpi = 0; m_pDataAcc->GetImageDpi(iImageXDpi, iImageYDpi); XFA_DrawImage(pGS, rtImage, &mtRotate, pDIBitmap, iAspect, iImageXDpi, iImageYDpi, iHorzAlign, iVertAlign); } diff --git a/xfa/src/fxfa/src/app/xfa_ffimage.h b/xfa/src/fxfa/src/app/xfa_ffimage.h index f6b985c304..dd785725ad 100644 --- a/xfa/src/fxfa/src/app/xfa_ffimage.h +++ b/xfa/src/fxfa/src/app/xfa_ffimage.h @@ -11,7 +11,7 @@ class CXFA_FFImage : public CXFA_FFDraw public: CXFA_FFImage(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); virtual ~CXFA_FFImage(); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); virtual FX_BOOL IsLoaded(); virtual FX_BOOL LoadWidget(); virtual void UnloadWidget(); diff --git a/xfa/src/fxfa/src/app/xfa_ffimageedit.cpp b/xfa/src/fxfa/src/app/xfa_ffimageedit.cpp index 2075d90d21..0174ee71c5 100644 --- a/xfa/src/fxfa/src/app/xfa_ffimageedit.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffimageedit.cpp @@ -45,7 +45,7 @@ void CXFA_FFImageEdit::UnloadWidget() m_pDataAcc->SetImageEditImage(NULL); CXFA_FFField::UnloadWidget(); } -void CXFA_FFImageEdit::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFImageEdit::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; @@ -62,20 +62,20 @@ void CXFA_FFImageEdit::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_ if (CFX_DIBitmap* pDIBitmap = m_pDataAcc->GetImageEditImage()) { CFX_RectF rtImage; m_pNormalWidget->GetWidgetRect(rtImage); - FX_INT32 iHorzAlign = XFA_ATTRIBUTEENUM_Left; - FX_INT32 iVertAlign = XFA_ATTRIBUTEENUM_Top; + int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left; + int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top; if (CXFA_Para para = m_pDataAcc->GetPara()) { iHorzAlign = para.GetHorizontalAlign(); iVertAlign = para.GetVerticalAlign(); } - FX_INT32 iAspect = XFA_ATTRIBUTEENUM_Fit; + int32_t iAspect = XFA_ATTRIBUTEENUM_Fit; if (CXFA_Value value = m_pDataAcc->GetFormValue()) { if (CXFA_Image imageObj = value.GetImage()) { iAspect = imageObj.GetAspect(); } } - FX_INT32 iImageXDpi = 0; - FX_INT32 iImageYDpi = 0; + int32_t iImageXDpi = 0; + int32_t iImageYDpi = 0; m_pDataAcc->GetImageEditDpi(iImageXDpi, iImageYDpi); XFA_DrawImage(pGS, rtImage, &mtRotate, pDIBitmap, iAspect, iImageXDpi, iImageYDpi, iHorzAlign, iVertAlign); } @@ -106,7 +106,7 @@ FX_BOOL CXFA_FFImageEdit::OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT pAppProvider->LoadString(XFA_IDS_ImageFilter, wsFilter); CFX_WideStringArray wsPathArray; pAppProvider->ShowFileDialog(wsTitle, wsFilter, wsPathArray); - FX_INT32 iSize = wsPathArray.GetSize(); + int32_t iSize = wsPathArray.GetSize(); if (iSize < 1) { return TRUE; } @@ -129,7 +129,7 @@ FX_BOOL CXFA_FFImageEdit::OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT CFX_WideString wsImage; IFX_FileRead* pFileRead = FX_CreateFileRead(wsFilePath); if (pFileRead != NULL) { - FX_INT32 nDataSize = pFileRead->GetSize(); + int32_t nDataSize = pFileRead->GetSize(); if (nDataSize > 0) { CFX_ByteString bsBuf; FX_LPSTR pImageBuffer = bsBuf.GetBuffer(nDataSize); @@ -173,7 +173,7 @@ FX_BOOL CXFA_FFImageEdit::UpdateFWLData() m_pDataAcc->LoadImageEditImage(); return TRUE; } -FX_INT32 CXFA_FFImageEdit::OnProcessMessage(CFWL_Message *pMessage) +int32_t CXFA_FFImageEdit::OnProcessMessage(CFWL_Message *pMessage) { return m_pOldDelegate->OnProcessMessage(pMessage); } diff --git a/xfa/src/fxfa/src/app/xfa_ffimageedit.h b/xfa/src/fxfa/src/app/xfa_ffimageedit.h index 7ba8333103..9ca9928af8 100644 --- a/xfa/src/fxfa/src/app/xfa_ffimageedit.h +++ b/xfa/src/fxfa/src/app/xfa_ffimageedit.h @@ -12,11 +12,11 @@ public: CXFA_FFImageEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); virtual ~CXFA_FFImageEdit(); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); virtual FX_BOOL LoadWidget(); virtual void UnloadWidget(); virtual FX_BOOL OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: diff --git a/xfa/src/fxfa/src/app/xfa_ffnotify.cpp b/xfa/src/fxfa/src/app/xfa_ffnotify.cpp index 81119e6e47..d42e7e611c 100644 --- a/xfa/src/fxfa/src/app/xfa_ffnotify.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffnotify.cpp @@ -50,7 +50,7 @@ void CXFA_FFNotify::OnPageEvent(IXFA_LayoutPage *pSender, XFA_PAGEEVENT eEvent, if (!pDocView) { return; } - pDocView->OnPageEvent(pSender, eEvent, (FX_INT32)(FX_UINTPTR)pParam); + pDocView->OnPageEvent(pSender, eEvent, (int32_t)(uintptr_t)pParam); } void CXFA_FFNotify::OnNodeEvent(CXFA_Node *pSender, XFA_NODEEVENT eEvent, FX_LPVOID pParam , FX_LPVOID pParam2 , FX_LPVOID pParam3, FX_LPVOID pParam4) { @@ -91,9 +91,9 @@ void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender, FX_DWORD dwEvent while (pWidget) { if (pWidget->IsLoaded()) { if (pWidgetAcc->IsListBox()) { - ((CXFA_FFListBox*)pWidget)->InsertItem((FX_WSTR)(FX_LPCWSTR)pParam, (FX_INT32)(FX_UINTPTR)pAdditional2); + ((CXFA_FFListBox*)pWidget)->InsertItem((FX_WSTR)(FX_LPCWSTR)pParam, (int32_t)(uintptr_t)pAdditional2); } else { - ((CXFA_FFComboBox*)pWidget)->InsertItem((FX_WSTR)(FX_LPCWSTR)pParam, (FX_INT32)(FX_UINTPTR)pAdditional2); + ((CXFA_FFComboBox*)pWidget)->InsertItem((FX_WSTR)(FX_LPCWSTR)pParam, (int32_t)(uintptr_t)pAdditional2); } } if (bStaticNotify) { @@ -118,9 +118,9 @@ void CXFA_FFNotify::OnWidgetDataEvent(CXFA_WidgetData* pSender, FX_DWORD dwEvent while (pWidget) { if (pWidget->IsLoaded()) { if (pWidgetAcc->IsListBox()) { - ((CXFA_FFListBox*)pWidget)->DeleteItem((FX_INT32)(FX_UINTPTR)pParam); + ((CXFA_FFListBox*)pWidget)->DeleteItem((int32_t)(uintptr_t)pParam); } else { - ((CXFA_FFComboBox*)pWidget)->DeleteItem((FX_INT32)(FX_UINTPTR)pParam); + ((CXFA_FFComboBox*)pWidget)->DeleteItem((int32_t)(uintptr_t)pParam); } } if (bStaticNotify) { @@ -248,7 +248,7 @@ void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node *pItem, FX_FLOAT &fCalcWidth, } pAcc->StartWidgetLayout(fCalcWidth, fCalcHeight); } -FX_BOOL CXFA_FFNotify::FindSplitPos(CXFA_Node *pItem, FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeightPos) +FX_BOOL CXFA_FFNotify::FindSplitPos(CXFA_Node *pItem, int32_t iBlockIndex, FX_FLOAT &fCalcHeightPos) { CXFA_WidgetAcc *pAcc = (CXFA_WidgetAcc*)pItem->GetWidgetData(); if (!pAcc) { @@ -270,14 +270,14 @@ FX_BOOL CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) CXFA_EventParam EventParam; EventParam.m_eType = XFA_EVENT_Unknown; FXJSE_HVALUE pRetValue = NULL; - FX_INT32 iRet = pWidgetAcc->ExecuteScript(CXFA_Script(pScript), &EventParam, &pRetValue); + int32_t iRet = pWidgetAcc->ExecuteScript(CXFA_Script(pScript), &EventParam, &pRetValue); if (iRet == XFA_EVENTERROR_Sucess && pRetValue) { bRet = FXJSE_Value_ToBoolean(pRetValue); FXJSE_Value_Release(pRetValue); } return bRet; } -FX_INT32 CXFA_FFNotify::ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady, FX_BOOL bRecursive, CXFA_WidgetAcc* pExclude) +int32_t CXFA_FFNotify::ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady, FX_BOOL bRecursive, CXFA_WidgetAcc* pExclude) { CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); if (!pDocView) { @@ -347,7 +347,7 @@ void CXFA_FFNotify::ResetData(CXFA_WidgetData* pWidgetData) } pDocView->ResetWidgetData((CXFA_WidgetAcc*)pWidgetData); } -FX_INT32 CXFA_FFNotify::GetLayoutStatus() +int32_t CXFA_FFNotify::GetLayoutStatus() { CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); return pDocView ? pDocView->GetLayoutStatus() : 0; @@ -422,7 +422,7 @@ void CXFA_FFNotify::OnValueChanging(CXFA_Node *pSender, FX_LPVOID pParam, FX_LPV FX_DWORD dwPacket = pSender->GetPacketID(); if (dwPacket & XFA_XDPPACKET_Datasets) { } else if (pSender->IsFormContainer()) { - XFA_ATTRIBUTE eAttr = (XFA_ATTRIBUTE)(FX_UINTPTR)pParam; + XFA_ATTRIBUTE eAttr = (XFA_ATTRIBUTE)(uintptr_t)pParam; if (eAttr == XFA_ATTRIBUTE_Presence) { CXFA_WidgetAcc* pWidgetAcc = (CXFA_WidgetAcc*)pSender->GetWidgetData(); if (!pWidgetAcc) { @@ -444,7 +444,7 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node *pSender, FX_LPVOID pParam, FX_LPVO return; } FX_DWORD dwPacket = pSender->GetPacketID(); - XFA_ATTRIBUTE eAttr = (XFA_ATTRIBUTE)(FX_UINTPTR)pParam; + XFA_ATTRIBUTE eAttr = (XFA_ATTRIBUTE)(uintptr_t)pParam; if (dwPacket & XFA_XDPPACKET_Form) { CXFA_Node* pParentNode = (CXFA_Node*)pParam3; CXFA_Node* pWidgetNode = (CXFA_Node*)pParam4; @@ -544,9 +544,9 @@ void CXFA_FFNotify::OnChildRemoved(CXFA_Node *pSender, FX_LPVOID pParam, FX_LPVO void CXFA_FFNotify::OnLayoutItemAdd(CXFA_FFDocView* pDocView, IXFA_DocLayout *pLayout, CXFA_LayoutItem *pSender, FX_LPVOID pParam, FX_LPVOID pParam2) { CXFA_FFWidget* pWidget = (CXFA_FFWidget*)(CXFA_ContentLayoutItemImpl*)pSender; - FX_INT32 iPageIdx = (FX_INT32)(FX_UINTPTR)pParam; + int32_t iPageIdx = (int32_t)(uintptr_t)pParam; IXFA_PageView* pNewPageView = pDocView->GetPageView(iPageIdx); - FX_DWORD dwStatus = (FX_DWORD)(FX_UINTPTR)pParam2; + FX_DWORD dwStatus = (FX_DWORD)(uintptr_t)pParam2; FX_DWORD dwFilter = XFA_WIDGETSTATUS_Visible | XFA_WIDGETSTATUS_Viewable | XFA_WIDGETSTATUS_Printable; pWidget->ModifyStatus(dwStatus, dwFilter); if (pDocView->GetLayoutStatus() >= XFA_DOCVIEW_LAYOUTSTATUS_End) { @@ -592,7 +592,7 @@ void CXFA_FFNotify::OnLayoutItemStatustChanged(CXFA_FFDocView* pDocView, IXFA_Do if (!pWidget) { return; } - FX_DWORD dwStatus = (FX_DWORD)(FX_UINTPTR)pParam; + FX_DWORD dwStatus = (FX_DWORD)(uintptr_t)pParam; if (dwStatus == 0) { CXFA_LayoutItem* pPreItem = pSender->GetPrev(); if (pPreItem) { diff --git a/xfa/src/fxfa/src/app/xfa_ffnotify.h b/xfa/src/fxfa/src/app/xfa_ffnotify.h index 383b0770cb..d289a1074a 100644 --- a/xfa/src/fxfa/src/app/xfa_ffnotify.h +++ b/xfa/src/fxfa/src/app/xfa_ffnotify.h @@ -20,9 +20,9 @@ public: virtual void OnLayoutEvent(IXFA_DocLayout *pLayout, CXFA_LayoutItem *pSender, XFA_LAYOUTEVENT eEvent, FX_LPVOID pParam = NULL, FX_LPVOID pParam2 = NULL); virtual void StartFieldDrawLayout(CXFA_Node *pItem, FX_FLOAT &fCalcWidth, FX_FLOAT &fCalcHeight); - virtual FX_BOOL FindSplitPos(CXFA_Node *pItem, FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeightPos); + virtual FX_BOOL FindSplitPos(CXFA_Node *pItem, int32_t iBlockIndex, FX_FLOAT &fCalcHeightPos); virtual FX_BOOL RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem); - virtual FX_INT32 ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_WidgetAcc * pExclude = NULL); + virtual int32_t ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_WidgetAcc * pExclude = NULL); virtual void AddCalcValidate(CXFA_Node* pNode); virtual IXFA_Doc* GetHDOC(); virtual IXFA_DocProvider* GetDocProvider(); @@ -32,7 +32,7 @@ public: virtual void OpenDropDownList(IXFA_Widget* hWidget); virtual CFX_WideString GetCurrentDateTime(); virtual void ResetData(CXFA_WidgetData* pWidgetData = NULL); - virtual FX_INT32 GetLayoutStatus(); + virtual int32_t GetLayoutStatus(); virtual void RunNodeInitialize(CXFA_Node* pNode); virtual void RunSubformIndexChange(CXFA_Node* pSubformNode); virtual CXFA_Node* GetFocusWidgetNode(); diff --git a/xfa/src/fxfa/src/app/xfa_ffpageview.cpp b/xfa/src/fxfa/src/app/xfa_ffpageview.cpp index ef340859ea..11384b141e 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpageview.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffpageview.cpp @@ -30,7 +30,7 @@ IXFA_DocView* CXFA_FFPageView::GetDocView() { return m_pDocView; } -FX_INT32 CXFA_FFPageView::GetPageViewIndex() +int32_t CXFA_FFPageView::GetPageViewIndex() { return GetLayoutPage()->GetPageIndex(); } @@ -40,7 +40,7 @@ void CXFA_FFPageView::GetPageViewRect(CFX_RectF &rtPage) GetLayoutPage()->GetPageSize(sz); rtPage.Set(0, 0, sz); } -void CXFA_FFPageView::GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, FX_INT32 iRotate) +void CXFA_FFPageView::GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, int32_t iRotate) { CFX_SizeF sz; GetLayoutPage()->GetPageSize(sz); @@ -48,7 +48,7 @@ void CXFA_FFPageView::GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, F fdePage.Set(0, 0, sz.x, sz.y); FDE_GetPageMatrix(mt, fdePage, rtDisp, iRotate, 0); } -FX_INT32 CXFA_FFPageView::LoadPageView(IFX_Pause *pPause ) +int32_t CXFA_FFPageView::LoadPageView(IFX_Pause *pPause ) { if (m_bLoaded) { return 100; @@ -77,7 +77,7 @@ IXFA_Widget* CXFA_FFPageView::GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy) continue; } CXFA_WidgetAcc* pAcc = pWidget->GetDataAcc(); - FX_INT32 type = pAcc->GetClassID(); + int32_t type = pAcc->GetClassID(); if (type != XFA_ELEMENT_Field && type != XFA_ELEMENT_Draw) { continue; } @@ -216,7 +216,7 @@ void CXFA_FFTabOrderPageWidgetIterator::Reset() IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToFirst() { if (m_TabOrderWidgetArray.GetSize() > 0) { - for (FX_INT32 i = 0; i < m_TabOrderWidgetArray.GetSize(); i++) { + for (int32_t i = 0; i < m_TabOrderWidgetArray.GetSize(); i++) { if (XFA_PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, m_bIgnorerelevant)) { m_iCurWidget = i; return m_TabOrderWidgetArray[m_iCurWidget]; @@ -228,7 +228,7 @@ IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToFirst() IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToLast() { if (m_TabOrderWidgetArray.GetSize() > 0) { - for (FX_INT32 i = m_TabOrderWidgetArray.GetSize() - 1; i >= 0; i--) { + for (int32_t i = m_TabOrderWidgetArray.GetSize() - 1; i >= 0; i--) { if (XFA_PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, m_bIgnorerelevant)) { m_iCurWidget = i; return m_TabOrderWidgetArray[m_iCurWidget]; @@ -239,7 +239,7 @@ IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToLast() } IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToNext() { - for (FX_INT32 i = m_iCurWidget + 1; i < m_TabOrderWidgetArray.GetSize(); i++) { + for (int32_t i = m_iCurWidget + 1; i < m_TabOrderWidgetArray.GetSize(); i++) { if (XFA_PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, m_bIgnorerelevant)) { m_iCurWidget = i; return m_TabOrderWidgetArray[m_iCurWidget]; @@ -250,7 +250,7 @@ IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToNext() } IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::MoveToPrevious() { - for (FX_INT32 i = m_iCurWidget - 1; i >= 0; i--) { + for (int32_t i = m_iCurWidget - 1; i >= 0; i--) { if (XFA_PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, m_bIgnorerelevant)) { m_iCurWidget = i; return m_TabOrderWidgetArray[m_iCurWidget]; @@ -268,7 +268,7 @@ IXFA_Widget* CXFA_FFTabOrderPageWidgetIterator::GetCurrentWidget() } FX_BOOL CXFA_FFTabOrderPageWidgetIterator::SetCurrentWidget(IXFA_Widget* hWidget) { - FX_INT32 iWidgetIndex = m_TabOrderWidgetArray.Find(static_cast(hWidget)); + int32_t iWidgetIndex = m_TabOrderWidgetArray.Find(static_cast(hWidget)); if (iWidgetIndex >= 0) { m_iCurWidget = iWidgetIndex; return TRUE; @@ -299,7 +299,7 @@ void CXFA_FFTabOrderPageWidgetIterator::CreateTabOrderWidgetArray() m_TabOrderWidgetArray.RemoveAll(); CXFA_WidgetArray SpaceOrderWidgetArray; CreateSpaceOrderWidgetArray(SpaceOrderWidgetArray); - FX_INT32 nWidgetCount = SpaceOrderWidgetArray.GetSize(); + int32_t nWidgetCount = SpaceOrderWidgetArray.GetSize(); if (nWidgetCount < 1) { return; } @@ -309,7 +309,7 @@ void CXFA_FFTabOrderPageWidgetIterator::CreateTabOrderWidgetArray() m_TabOrderWidgetArray.Add(hWidget); CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc(); if (pWidgetAcc->GetUIType() == XFA_ELEMENT_ExclGroup) { - FX_INT32 iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget) + 1; + int32_t iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget) + 1; while (TRUE) { CXFA_FFWidget* pRadio = SpaceOrderWidgetArray[(iWidgetIndex) % nWidgetCount]; if (pRadio->GetDataAcc()->GetExclGroup() != pWidgetAcc) { @@ -326,11 +326,11 @@ void CXFA_FFTabOrderPageWidgetIterator::CreateTabOrderWidgetArray() continue; } } - FX_INT32 iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget); + int32_t iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget); hWidget = SpaceOrderWidgetArray[(iWidgetIndex + 1) % nWidgetCount]; } } -static FX_INT32 XFA_TabOrderWidgetComparator(const void* phWidget1, const void* phWidget2) +static int32_t XFA_TabOrderWidgetComparator(const void* phWidget1, const void* phWidget2) { CXFA_FFWidget* pWidget1 = (*(CXFA_TabParam**)phWidget1)->m_pWidget; CXFA_FFWidget* pWidget2 = (*(CXFA_TabParam**)phWidget2)->m_pWidget; @@ -381,11 +381,11 @@ void CXFA_FFTabOrderPageWidgetIterator::OrderContainer(CXFA_LayoutItemIterator* pSearchItem = sIterator->MoveToNext(); } } - FX_INT32 iChildren = tabParams.GetSize(); + int32_t iChildren = tabParams.GetSize(); if (iChildren > 1) { FXSYS_qsort(tabParams.GetData(), iChildren, sizeof(FX_LPVOID), XFA_TabOrderWidgetComparator); } - for (FX_INT32 iStart = 0; iStart < iChildren; iStart++) { + for (int32_t iStart = 0; iStart < iChildren; iStart++) { CXFA_TabParam* pParam = (CXFA_TabParam*)tabParams[iStart]; pContainer->m_Children.Add(pParam->m_pWidget); if (pParam->m_Children.GetSize() > 0) { diff --git a/xfa/src/fxfa/src/app/xfa_ffpageview.h b/xfa/src/fxfa/src/app/xfa_ffpageview.h index dd0a481ffb..b80248bf0a 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpageview.h +++ b/xfa/src/fxfa/src/app/xfa_ffpageview.h @@ -14,10 +14,10 @@ public: CXFA_FFPageView(CXFA_FFDocView* pDocView, CXFA_Node* pPageArea); ~CXFA_FFPageView(); virtual IXFA_DocView* GetDocView(); - virtual FX_INT32 GetPageViewIndex(); + virtual int32_t GetPageViewIndex(); virtual void GetPageViewRect(CFX_RectF &rtPage); - virtual void GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, FX_INT32 iRotate); - virtual FX_INT32 LoadPageView(IFX_Pause *pPause = NULL); + virtual void GetDisplayMatrix(CFX_Matrix &mt, const CFX_Rect &rtDisp, int32_t iRotate); + virtual int32_t LoadPageView(IFX_Pause *pPause = NULL); virtual void UnloadPageView(); FX_BOOL IsPageViewLoaded(); @@ -87,7 +87,7 @@ protected: CXFA_WidgetArray m_TabOrderWidgetArray; CXFA_FFPageView* m_pPageView; FX_DWORD m_dwFilter; - FX_INT32 m_iCurWidget; + int32_t m_iCurWidget; FX_BOOL m_bIgnorerelevant; CXFA_FFWidget* GetTraverseWidget(CXFA_FFWidget* pWidget); CXFA_FFWidget* FindWidgetByName(FX_WSTR wsWidgetName, CXFA_FFWidget* pRefWidget); diff --git a/xfa/src/fxfa/src/app/xfa_ffpath.cpp b/xfa/src/fxfa/src/app/xfa_ffpath.cpp index 2f8b71a50a..1cf993b737 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpath.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffpath.cpp @@ -19,7 +19,7 @@ CXFA_FFLine::CXFA_FFLine(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) CXFA_FFLine::~CXFA_FFLine() { } -void CXFA_FFLine::GetRectFromHand(CFX_RectF &rect, FX_INT32 iHand, FX_FLOAT fLineWidth) +void CXFA_FFLine::GetRectFromHand(CFX_RectF &rect, int32_t iHand, FX_FLOAT fLineWidth) { FX_FLOAT fHalfWidth = fLineWidth / 2.0f; if (rect.height < 1.0f) { @@ -50,7 +50,7 @@ void CXFA_FFLine::GetRectFromHand(CFX_RectF &rect, FX_INT32 iHand, FX_FLOAT fLin } } } -void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; @@ -61,10 +61,10 @@ void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD } CXFA_Line lineObj = value.GetLine(); FX_ARGB lineColor = 0xFF000000; - FX_INT32 iStrokeType = 0; + int32_t iStrokeType = 0; FX_FLOAT fLineWidth = 1.0f; FX_BOOL bSlope = lineObj.GetSlop(); - FX_INT32 iCap = 0; + int32_t iCap = 0; CXFA_Edge edge = lineObj.GetEdge(); if (edge.IsExistInXML()) { if (edge.GetPresence() != XFA_ATTRIBUTEENUM_Visible) { @@ -109,7 +109,7 @@ CXFA_FFArc::CXFA_FFArc(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) CXFA_FFArc::~CXFA_FFArc() { } -void CXFA_FFArc::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFArc::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; @@ -138,7 +138,7 @@ CXFA_FFRectangle::CXFA_FFRectangle(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* p CXFA_FFRectangle::~CXFA_FFRectangle() { } -void CXFA_FFRectangle::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFRectangle::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; diff --git a/xfa/src/fxfa/src/app/xfa_ffpath.h b/xfa/src/fxfa/src/app/xfa_ffpath.h index 08828f3b84..aed4a67a0b 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpath.h +++ b/xfa/src/fxfa/src/app/xfa_ffpath.h @@ -11,22 +11,22 @@ class CXFA_FFLine : public CXFA_FFDraw public: CXFA_FFLine(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); virtual ~CXFA_FFLine(); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); private: - void GetRectFromHand(CFX_RectF &rect, FX_INT32 iHand, FX_FLOAT fLineWidth); + void GetRectFromHand(CFX_RectF &rect, int32_t iHand, FX_FLOAT fLineWidth); }; class CXFA_FFArc : public CXFA_FFDraw { public: CXFA_FFArc(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); virtual ~CXFA_FFArc(); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); }; class CXFA_FFRectangle : public CXFA_FFDraw { public: CXFA_FFRectangle(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); virtual ~CXFA_FFRectangle(); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); }; #endif diff --git a/xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp b/xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp index 125cb4f5b7..4ea2ac48ec 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp @@ -26,7 +26,7 @@ CXFA_FFPushButton::~CXFA_FFPushButton() { CXFA_FFPushButton::UnloadWidget(); } -void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; @@ -208,7 +208,7 @@ void CXFA_FFPushButton::RenderHighlightCaption(CFX_Graphics* pGS, CFX_Matrix* pM } } } -FX_INT32 CXFA_FFPushButton::OnProcessMessage(CFWL_Message *pMessage) +int32_t CXFA_FFPushButton::OnProcessMessage(CFWL_Message *pMessage) { return m_pOldDelegate->OnProcessMessage(pMessage); } diff --git a/xfa/src/fxfa/src/app/xfa_ffpushbutton.h b/xfa/src/fxfa/src/app/xfa_ffpushbutton.h index 07503292f5..e82b8904b8 100644 --- a/xfa/src/fxfa/src/app/xfa_ffpushbutton.h +++ b/xfa/src/fxfa/src/app/xfa_ffpushbutton.h @@ -15,12 +15,12 @@ class CXFA_FFPushButton : public CXFA_FFField public: CXFA_FFPushButton(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); virtual ~CXFA_FFPushButton(); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); virtual FX_BOOL LoadWidget(); virtual void UnloadWidget(); virtual FX_BOOL LayoutWidget(); virtual void UpdateWidgetProperty(); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); protected: diff --git a/xfa/src/fxfa/src/app/xfa_ffsignature.cpp b/xfa/src/fxfa/src/app/xfa_ffsignature.cpp index a7f48c7033..ed4beca66e 100644 --- a/xfa/src/fxfa/src/app/xfa_ffsignature.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffsignature.cpp @@ -22,7 +22,7 @@ FX_BOOL CXFA_FFSignature::LoadWidget() { return CXFA_FFField::LoadWidget(); } -void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; @@ -66,7 +66,7 @@ FX_BOOL CXFA_FFSignature::OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy { return FALSE; } -FX_BOOL CXFA_FFSignature::OnMouseWheel(FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy) +FX_BOOL CXFA_FFSignature::OnMouseWheel(FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy) { return FALSE; } diff --git a/xfa/src/fxfa/src/app/xfa_ffsignature.h b/xfa/src/fxfa/src/app/xfa_ffsignature.h index f7848d8b32..f82856b607 100644 --- a/xfa/src/fxfa/src/app/xfa_ffsignature.h +++ b/xfa/src/fxfa/src/app/xfa_ffsignature.h @@ -12,7 +12,7 @@ public: CXFA_FFSignature(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); virtual ~CXFA_FFSignature(); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); virtual FX_BOOL LoadWidget(); virtual FX_BOOL OnMouseEnter(); virtual FX_BOOL OnMouseExit(); @@ -20,7 +20,7 @@ public: virtual FX_BOOL OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnLButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); - virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy); + virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); diff --git a/xfa/src/fxfa/src/app/xfa_fftext.cpp b/xfa/src/fxfa/src/app/xfa_fftext.cpp index 1d121a330a..2d153c2968 100644 --- a/xfa/src/fxfa/src/app/xfa_fftext.cpp +++ b/xfa/src/fxfa/src/app/xfa_fftext.cpp @@ -20,7 +20,7 @@ CXFA_FFText::CXFA_FFText(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) CXFA_FFText::~CXFA_FFText() { } -void CXFA_FFText::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFText::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; @@ -166,11 +166,11 @@ FX_LPCWSTR CXFA_FFText::GetLinkURLAtPoint(FX_FLOAT fx, FX_FLOAT fy) FX_FLOAT x(fx), y(fy); FWLToClient(x, y); const CXFA_PieceLineArray* pPieceLines = pTextLayout->GetPieceLines(); - FX_INT32 iCount = pPieceLines->GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = pPieceLines->GetSize(); + for (int32_t i = 0; i < iCount; i++) { CXFA_PieceLine *pPieceLine = pPieceLines->GetAt(i); - FX_INT32 iPieces = pPieceLine->m_textPieces.GetSize(); - for (FX_INT32 j = 0; j < iPieces; j++) { + int32_t iPieces = pPieceLine->m_textPieces.GetSize(); + for (int32_t j = 0; j < iPieces; j++) { XFA_LPTEXTPIECE pPiece = pPieceLine->m_textPieces.GetAt(j); if (pPiece->pLinkData && pPiece->rtPiece.Contains(x, y)) { return pPiece->pLinkData->GetLinkURL(); diff --git a/xfa/src/fxfa/src/app/xfa_fftext.h b/xfa/src/fxfa/src/app/xfa_fftext.h index d686a97f4c..0210b55610 100644 --- a/xfa/src/fxfa/src/app/xfa_fftext.h +++ b/xfa/src/fxfa/src/app/xfa_fftext.h @@ -16,7 +16,7 @@ public: virtual FX_BOOL OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_DWORD OnHitTest(FX_FLOAT fx, FX_FLOAT fy); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); virtual FX_BOOL IsLoaded(); virtual FX_BOOL LayoutWidget(); private: diff --git a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp index 5d50c52e84..afdfd1fee8 100644 --- a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp +++ b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp @@ -69,11 +69,11 @@ void CXFA_FFTextEdit::UpdateWidgetProperty() dwExtendedStyle |= FWL_STYLEEXT_EDT_MultiLine; } XFA_ELEMENT eType = XFA_ELEMENT_UNKNOWN; - FX_INT32 iMaxChars = m_pDataAcc->GetMaxChars(eType); + int32_t iMaxChars = m_pDataAcc->GetMaxChars(eType); if (eType == XFA_ELEMENT_ExData) { iMaxChars = 0; } - FX_INT32 iNumCells = m_pDataAcc->GetNumberOfCells(); + int32_t iNumCells = m_pDataAcc->GetNumberOfCells(); if (iNumCells == 0) { dwExtendedStyle |= FWL_STYLEEXT_EDT_CombText; pWidget->SetLimit(iMaxChars > 0 ? iMaxChars : 1); @@ -208,7 +208,7 @@ FX_DWORD CXFA_FFTextEdit::GetAlignment() { FX_DWORD dwExtendedStyle = 0; if (CXFA_Para para = m_pDataAcc->GetPara()) { - FX_INT32 iHorz = para.GetHorizontalAlign(); + int32_t iHorz = para.GetHorizontalAlign(); switch(iHorz) { case XFA_ATTRIBUTEENUM_Center: dwExtendedStyle |= FWL_STYLEEXT_EDT_HCenter; @@ -227,7 +227,7 @@ FX_DWORD CXFA_FFTextEdit::GetAlignment() dwExtendedStyle |= FWL_STYLEEXT_EDT_HNear; break; } - FX_INT32 iVert = para.GetVerticalAlign(); + int32_t iVert = para.GetVerticalAlign(); switch(iVert) { case XFA_ATTRIBUTEENUM_Middle: dwExtendedStyle |= FWL_STYLEEXT_EDT_VCenter; @@ -254,7 +254,7 @@ FX_BOOL CXFA_FFTextEdit::UpdateFWLData() FX_BOOL bUpdate = FALSE; if (m_pDataAcc->GetUIType() == XFA_ELEMENT_TextEdit && m_pDataAcc->GetNumberOfCells() < 0) { XFA_ELEMENT elementType = XFA_ELEMENT_UNKNOWN; - FX_INT32 iMaxChars = m_pDataAcc->GetMaxChars(elementType); + int32_t iMaxChars = m_pDataAcc->GetMaxChars(elementType); if (elementType == XFA_ELEMENT_ExData) { iMaxChars = eType == XFA_VALUEPICTURE_Edit ? iMaxChars : 0; } @@ -294,7 +294,7 @@ FX_BOOL CXFA_FFTextEdit::Redo() } FX_BOOL CXFA_FFTextEdit::CanCopy() { - FX_INT32 nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges(); + int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges(); return nCount > 0; } FX_BOOL CXFA_FFTextEdit::CanCut() @@ -302,7 +302,7 @@ FX_BOOL CXFA_FFTextEdit::CanCut() if (m_pNormalWidget->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly) { return FALSE; } - FX_INT32 nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges(); + int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges(); return nCount > 0; } FX_BOOL CXFA_FFTextEdit::CanPaste() @@ -327,7 +327,7 @@ FX_BOOL CXFA_FFTextEdit::Paste(const CFX_WideString &wsPaste) } FX_BOOL CXFA_FFTextEdit::SelectAll() { - FX_INT32 nCount = ((CFWL_Edit*)m_pNormalWidget)->GetTextLength(); + int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->GetTextLength(); return ((CFWL_Edit*)m_pNormalWidget)->AddSelRange(0, nCount); } FX_BOOL CXFA_FFTextEdit::Delete() @@ -366,13 +366,13 @@ void CXFA_FFTextEdit::OnTextChanged(IFWL_Widget *pWidget, const CFX_WideString & if (m_pDataAcc->GetUIType() == XFA_ELEMENT_DateTimeEdit) { CFWL_DateTimePicker* pDateTime = (CFWL_DateTimePicker*)pEdit; pDateTime->GetEditText(eParam.m_wsNewText); - FX_INT32 iSels = pDateTime->CountSelRanges(); + int32_t iSels = pDateTime->CountSelRanges(); if (iSels ) { eParam.m_iSelEnd = pDateTime->GetSelRange(0, eParam.m_iSelStart); } } else { pEdit->GetText(eParam.m_wsNewText); - FX_INT32 iSels = pEdit->CountSelRanges(); + int32_t iSels = pEdit->CountSelRanges(); if (iSels ) { eParam.m_iSelEnd = pEdit->GetSelRange(0, eParam.m_iSelStart); } @@ -404,7 +404,7 @@ FX_BOOL CXFA_FFTextEdit::GetSuggestWords(FX_BSTR sWord, CFX_ByteStringArray &sSu } return GetDoc()->GetDocProvider()->GetSuggestWords(GetDoc(), sWord, sSuggest); } -FX_INT32 CXFA_FFTextEdit::OnProcessMessage(CFWL_Message *pMessage) +int32_t CXFA_FFTextEdit::OnProcessMessage(CFWL_Message *pMessage) { return m_pOldDelegate->OnProcessMessage(pMessage); } @@ -485,7 +485,7 @@ void CXFA_FFNumericEdit::UpdateWidgetProperty() if (m_pDataAcc->GetHorizontalScrollPolicy() != XFA_ATTRIBUTEENUM_Off) { dwExtendedStyle |= FWL_STYLEEXT_EDT_AutoHScroll; } - FX_INT32 iNumCells = m_pDataAcc->GetNumberOfCells(); + int32_t iNumCells = m_pDataAcc->GetNumberOfCells(); if (iNumCells > 0) { dwExtendedStyle |= FWL_STYLEEXT_EDT_CombText; pWidget->SetLimit(iNumCells); @@ -515,9 +515,9 @@ FX_BOOL CXFA_FFNumericEdit::OnValidate(IFWL_Widget *pWidget, CFX_WideString &wsT if (!wsPattern.IsEmpty()) { return TRUE; } - FX_INT32 iLeads = 0; + int32_t iLeads = 0; m_pDataAcc->GetLeadDigits(iLeads); - FX_INT32 iFracs = 0; + int32_t iFracs = 0; m_pDataAcc->GetFracDigits(iFracs); CFX_WideString wsFormat; CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(m_pDataAcc); @@ -661,7 +661,7 @@ void CXFA_FFDateTimeEdit::UpdateWidgetProperty() dwExtendedStyle |= GetAlignment(); m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF); FX_DWORD dwEditStyles = FWL_STYLEEXT_EDT_LastLineHeight; - FX_INT32 iNumCells = m_pDataAcc->GetNumberOfCells(); + int32_t iNumCells = m_pDataAcc->GetNumberOfCells(); if (iNumCells > 0) { dwEditStyles |= FWL_STYLEEXT_EDT_CombText; pWidget->SetEditLimit(iNumCells); @@ -678,7 +678,7 @@ FX_DWORD CXFA_FFDateTimeEdit::GetAlignment() { FX_DWORD dwExtendedStyle = 0; if (CXFA_Para para = m_pDataAcc->GetPara()) { - FX_INT32 iHorz = para.GetHorizontalAlign(); + int32_t iHorz = para.GetHorizontalAlign(); switch(iHorz) { case XFA_ATTRIBUTEENUM_Center: dwExtendedStyle |= FWL_STYLEEXT_DTP_EditHCenter; @@ -697,7 +697,7 @@ FX_DWORD CXFA_FFDateTimeEdit::GetAlignment() dwExtendedStyle |= FWL_STYLEEXT_DTP_EditHNear; break; } - FX_INT32 iVert = para.GetVerticalAlign(); + int32_t iVert = para.GetVerticalAlign(); switch(iVert) { case XFA_ATTRIBUTEENUM_Middle: dwExtendedStyle |= FWL_STYLEEXT_DTP_EditVCenter; @@ -816,7 +816,7 @@ FX_BOOL CXFA_FFDateTimeEdit::DeSelect() { return ((CFWL_DateTimePicker*)m_pNormalWidget)->DeSelect(); } -void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget *pWidget, FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) +void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget *pWidget, int32_t iYear, int32_t iMonth, int32_t iDay) { CFX_WideString wsPicture; m_pDataAcc->GetPictureContent(wsPicture, XFA_VALUEPICTURE_Edit); diff --git a/xfa/src/fxfa/src/app/xfa_fftextedit.h b/xfa/src/fxfa/src/app/xfa_fftextedit.h index ecfe3bda83..ece1a4b9e3 100644 --- a/xfa/src/fxfa/src/app/xfa_fftextedit.h +++ b/xfa/src/fxfa/src/app/xfa_fftextedit.h @@ -47,7 +47,7 @@ public: void OnAddDoRecord(IFWL_Widget *pWidget); FX_BOOL CheckWord(FX_BSTR sWord); FX_BOOL GetSuggestWords(FX_BSTR sWord, CFX_ByteStringArray &sSuggest); - virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage); + virtual int32_t OnProcessMessage(CFWL_Message *pMessage); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL); }; @@ -111,7 +111,7 @@ protected: virtual FX_BOOL UpdateFWLData(); virtual FX_BOOL IsDataChanged(); public: - void OnSelectChanged(IFWL_Widget *pWidget, FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay); + void OnSelectChanged(IFWL_Widget *pWidget, int32_t iYear, int32_t iMonth, int32_t iDay); virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent); }; #endif diff --git a/xfa/src/fxfa/src/app/xfa_ffwidget.cpp b/xfa/src/fxfa/src/app/xfa_ffwidget.cpp index 0967da1284..f747bdd2f9 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidget.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffwidget.cpp @@ -102,7 +102,7 @@ FX_BOOL CXFA_FFWidget::GetToolTip(CFX_WideString &wsToolTip) } return GetCaptionText(wsToolTip); } -void CXFA_FFWidget::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate ) +void CXFA_FFWidget::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate ) { if (!IsMatchVisibleStatus(dwStatus)) { return; @@ -206,7 +206,7 @@ FX_BOOL CXFA_FFWidget::OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) { return FALSE; } -FX_BOOL CXFA_FFWidget::OnMouseWheel(FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy) +FX_BOOL CXFA_FFWidget::OnMouseWheel(FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy) { return FALSE; } @@ -279,7 +279,7 @@ void CXFA_FFWidget::Rotate2Normal(FX_FLOAT &fx, FX_FLOAT &fy) mtReverse.SetReverse(mt); mtReverse.TransformPoint(fx, fy); } -static void XFA_GetMatrix(CFX_Matrix &m, FX_INT32 iRotate, FX_INT32 at, const CFX_RectF& rt) +static void XFA_GetMatrix(CFX_Matrix &m, int32_t iRotate, int32_t at, const CFX_RectF& rt) { if (!iRotate) { return; @@ -329,7 +329,7 @@ static void XFA_GetMatrix(CFX_Matrix &m, FX_INT32 iRotate, FX_INT32 at, const CF void CXFA_FFWidget::GetRotateMatrix(CFX_Matrix &mt) { mt.Set(1, 0, 0, 1, 0, 0); - FX_INT32 iRotate = m_pDataAcc->GetRotate(); + int32_t iRotate = m_pDataAcc->GetRotate(); if (!iRotate) { return; } @@ -440,7 +440,7 @@ void CXFA_FFWidget::SetButtonDown(FX_BOOL bSet) { bSet ? m_dwStatus |= XFA_WIDGETSTATUS_ButtonDown : m_dwStatus &= ~XFA_WIDGETSTATUS_ButtonDown; } -FX_INT32 XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, FX_INT32 iStrokeType, FX_INT32 iCapType) +int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, int32_t iStrokeType, int32_t iCapType) { switch(iStrokeType) { case XFA_ATTRIBUTEENUM_DashDot: { @@ -484,7 +484,7 @@ FX_INT32 XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, FX_INT32 iStrokeType pGraphics->SetLineDash(FX_DASHSTYLE_Solid); return FX_DASHSTYLE_Solid; } -CFX_GraphStateData::LineCap XFA_LineCapToFXGE(FX_INT32 iLineCap) +CFX_GraphStateData::LineCap XFA_LineCapToFXGE(int32_t iLineCap) { switch(iLineCap) { case XFA_ATTRIBUTEENUM_Round: @@ -515,7 +515,7 @@ protected: FX_DWORD m_Flags; CFX_ImageTransformer* m_pTransformer; FX_LPVOID m_DeviceHandle; - FX_INT32 m_BlendType; + int32_t m_BlendType; FX_BOOL m_Result; FX_BOOL m_bPrint; FX_BOOL StartDIBSource(); @@ -686,7 +686,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, in } else { FX_DWORD fill_argb = (mask_argb); if (bitmap_alpha < 255) { - ((FX_BYTE*)&fill_argb)[3] = ((FX_BYTE*)&fill_argb)[3] * bitmap_alpha / 255; + ((uint8_t*)&fill_argb)[3] = ((uint8_t*)&fill_argb)[3] * bitmap_alpha / 255; } if (m_pDevice->SetBitMask(pDIBitmap, left, top, fill_argb)) { return; @@ -752,7 +752,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, in return; } } -void XFA_DrawImage(CFX_Graphics* pGS, const CFX_RectF &rtImage, CFX_Matrix* pMatrix, CFX_DIBitmap* pDIBitmap, FX_INT32 iAspect, FX_INT32 iImageXDpi, FX_INT32 iImageYDpi, FX_INT32 iHorzAlign, FX_INT32 iVertAlign) +void XFA_DrawImage(CFX_Graphics* pGS, const CFX_RectF &rtImage, CFX_Matrix* pMatrix, CFX_DIBitmap* pDIBitmap, int32_t iAspect, int32_t iImageXDpi, int32_t iImageYDpi, int32_t iHorzAlign, int32_t iVertAlign) { if (rtImage.IsEmpty()) { return; @@ -817,7 +817,7 @@ void XFA_DrawImage(CFX_Graphics* pGS, const CFX_RectF &rtImage, CFX_Matrix* pMat } pRenderDevice->RestoreState(); } -const static FX_BYTE g_inv_base64[128] = { +const static uint8_t g_inv_base64[128] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, @@ -835,10 +835,10 @@ const static FX_BYTE g_inv_base64[128] = { 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 255, 255, 255, 255, 255, }; -static FX_LPBYTE XFA_RemoveBase64Whitespace(FX_LPCBYTE pStr, FX_INT32 iLen) +static FX_LPBYTE XFA_RemoveBase64Whitespace(FX_LPCBYTE pStr, int32_t iLen) { FX_LPBYTE pCP; - FX_INT32 i = 0, j = 0; + int32_t i = 0, j = 0; if (iLen == 0) { iLen = FXSYS_strlen((FX_CHAR*)pStr); } @@ -853,7 +853,7 @@ static FX_LPBYTE XFA_RemoveBase64Whitespace(FX_LPCBYTE pStr, FX_INT32 iLen) pCP[j] = '\0'; return pCP; } -static FX_INT32 XFA_Base64Decode(FX_LPCSTR pStr, FX_LPBYTE pOutBuffer) +static int32_t XFA_Base64Decode(FX_LPCSTR pStr, FX_LPBYTE pOutBuffer) { if (pStr == NULL) { return 0; @@ -862,8 +862,8 @@ static FX_INT32 XFA_Base64Decode(FX_LPCSTR pStr, FX_LPBYTE pOutBuffer) if (pBuffer == NULL) { return 0; } - FX_INT32 iLen = FXSYS_strlen((FX_CHAR*)pBuffer); - FX_INT32 i = 0, j = 0; + int32_t iLen = FXSYS_strlen((FX_CHAR*)pBuffer); + int32_t i = 0, j = 0; FX_DWORD dwLimb = 0; for (; i + 3 < iLen; i += 4) { if (pBuffer[i] == '=' || pBuffer[i + 1] == '=' @@ -874,14 +874,14 @@ static FX_INT32 XFA_Base64Decode(FX_LPCSTR pStr, FX_LPBYTE pOutBuffer) if (pBuffer[i + 2] == '=') { dwLimb = ((FX_DWORD)g_inv_base64[pBuffer[i]] << 6) | ((FX_DWORD)g_inv_base64[pBuffer[i + 1]]); - pOutBuffer[j] = (FX_BYTE)(dwLimb >> 4) & 0xFF; + pOutBuffer[j] = (uint8_t)(dwLimb >> 4) & 0xFF; j++; } else { dwLimb = ((FX_DWORD)g_inv_base64[pBuffer[i]] << 12) | ((FX_DWORD)g_inv_base64[pBuffer[i + 1]] << 6) | ((FX_DWORD)g_inv_base64[pBuffer[i + 2]]); - pOutBuffer[j] = (FX_BYTE)(dwLimb >> 10) & 0xFF; - pOutBuffer[j + 1] = (FX_BYTE)(dwLimb >> 2) & 0xFF; + pOutBuffer[j] = (uint8_t)(dwLimb >> 10) & 0xFF; + pOutBuffer[j + 1] = (uint8_t)(dwLimb >> 2) & 0xFF; j += 2; } } else { @@ -889,9 +889,9 @@ static FX_INT32 XFA_Base64Decode(FX_LPCSTR pStr, FX_LPBYTE pOutBuffer) ((FX_DWORD)g_inv_base64[pBuffer[i + 1]] << 12) | ((FX_DWORD)g_inv_base64[pBuffer[i + 2]] << 6) | ((FX_DWORD)g_inv_base64[pBuffer[i + 3]]); - pOutBuffer[j] = (FX_BYTE)(dwLimb >> 16) & 0xff; - pOutBuffer[j + 1] = (FX_BYTE)(dwLimb >> 8) & 0xff; - pOutBuffer[j + 2] = (FX_BYTE)(dwLimb) & 0xff; + pOutBuffer[j] = (uint8_t)(dwLimb >> 16) & 0xff; + pOutBuffer[j + 1] = (uint8_t)(dwLimb >> 8) & 0xff; + pOutBuffer[j + 2] = (uint8_t)(dwLimb) & 0xff; j += 3; } } @@ -899,7 +899,7 @@ static FX_INT32 XFA_Base64Decode(FX_LPCSTR pStr, FX_LPBYTE pOutBuffer) return j; } static FX_CHAR g_base64_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -FX_LPSTR XFA_Base64Encode(FX_LPCBYTE buf, FX_INT32 buf_len) +FX_LPSTR XFA_Base64Encode(FX_LPCBYTE buf, int32_t buf_len) { FX_LPSTR out = NULL; int i, j; @@ -959,7 +959,7 @@ FXCODEC_IMAGE_TYPE XFA_GetImageType(FX_WSTR wsType) } return FXCODEC_IMAGE_UNKNOWN; } -CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &bNameImage, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi) +CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &bNameImage, int32_t &iImageXDpi, int32_t &iImageYDpi) { CFX_WideString wsHref; pImage->GetHref(wsHref); @@ -978,9 +978,9 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &b XFA_ATTRIBUTEENUM iEncoding = (XFA_ATTRIBUTEENUM)pImage->GetTransferEncoding(); if (iEncoding == XFA_ATTRIBUTEENUM_Base64) { CFX_ByteString bsData = wsImage.UTF8Encode(); - FX_INT32 iLength = bsData.GetLength(); + int32_t iLength = bsData.GetLength(); pImageBuffer = FDE_Alloc(iLength); - FX_INT32 iRead = XFA_Base64Decode((FX_LPCSTR)bsData, pImageBuffer); + int32_t iRead = XFA_Base64Decode((FX_LPCSTR)bsData, pImageBuffer); if (iRead > 0) { pImageFileRead = FX_CreateMemoryStream(pImageBuffer, iRead); } @@ -1013,7 +1013,7 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &b pImageFileRead->Release(); return pBitmap; } -static FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type, FX_INT32 iComponents, FX_INT32 iBitsPerComponent) +static FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type, int32_t iComponents, int32_t iBitsPerComponent) { FXDIB_Format dibFormat = FXDIB_Argb; switch (type) { @@ -1021,7 +1021,7 @@ static FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type, FX_INT32 iComponen case FXCODEC_IMAGE_JPG: case FXCODEC_IMAGE_TIF: { dibFormat = FXDIB_Rgb32; - FX_INT32 bpp = iComponents * iBitsPerComponent; + int32_t bpp = iComponents * iBitsPerComponent; if (bpp <= 24) { dibFormat = FXDIB_Rgb; } @@ -1033,7 +1033,7 @@ static FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type, FX_INT32 iComponen } return dibFormat; } -CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, FXCODEC_IMAGE_TYPE type, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi) +CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, FXCODEC_IMAGE_TYPE type, int32_t &iImageXDpi, int32_t &iImageYDpi) { CFX_GEModule* pGeModule = CFX_GEModule::Get(); if (!pGeModule) { @@ -1049,12 +1049,12 @@ CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, FXCODEC_IMAG FXCODEC_STATUS status = pProgressiveDecoder->LoadImageInfo(pImageFileRead, type, &dibAttr); switch (dibAttr.m_wDPIUnit) { case FXCODEC_RESUNIT_CENTIMETER: - dibAttr.m_nXDPI = (FX_INT32)(dibAttr.m_nXDPI * 2.54f); - dibAttr.m_nYDPI = (FX_INT32)(dibAttr.m_nYDPI * 2.54f); + dibAttr.m_nXDPI = (int32_t)(dibAttr.m_nXDPI * 2.54f); + dibAttr.m_nYDPI = (int32_t)(dibAttr.m_nYDPI * 2.54f); break; case FXCODEC_RESUNIT_METER: - dibAttr.m_nXDPI = (FX_INT32)(dibAttr.m_nXDPI / (FX_FLOAT)100 * 2.54f); - dibAttr.m_nYDPI = (FX_INT32)(dibAttr.m_nYDPI / (FX_FLOAT)100 * 2.54f); + dibAttr.m_nXDPI = (int32_t)(dibAttr.m_nXDPI / (FX_FLOAT)100 * 2.54f); + dibAttr.m_nYDPI = (int32_t)(dibAttr.m_nYDPI / (FX_FLOAT)100 * 2.54f); break;; default: break; @@ -1063,13 +1063,13 @@ CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, FXCODEC_IMAG iImageYDpi = dibAttr.m_nYDPI > 1 ? dibAttr.m_nYDPI : (96); if (pProgressiveDecoder->GetWidth() > 0 && pProgressiveDecoder->GetHeight() > 0) { type = pProgressiveDecoder->GetType(); - FX_INT32 iComponents = pProgressiveDecoder->GetNumComponents(); - FX_INT32 iBpc = pProgressiveDecoder->GetBPC(); + int32_t iComponents = pProgressiveDecoder->GetNumComponents(); + int32_t iBpc = pProgressiveDecoder->GetBPC(); FXDIB_Format dibFormat = XFA_GetDIBFormat(type, iComponents, iBpc); pBitmap = FX_NEW CFX_DIBitmap(); pBitmap->Create(pProgressiveDecoder->GetWidth(), pProgressiveDecoder->GetHeight(), dibFormat); pBitmap->Clear(0xffffffff); - FX_INT32 nFrames; + int32_t nFrames; if ((pProgressiveDecoder->GetFrames(nFrames) == FXCODEC_STATUS_DECODE_READY) && (nFrames > 0)) { pProgressiveDecoder->StartDecode(pBitmap, 0, 0, pBitmap->GetWidth(), pBitmap->GetHeight()); pProgressiveDecoder->ContinueDecode(); @@ -1126,14 +1126,14 @@ static void XFA_BOX_GetPath_Arc(CXFA_Box box, CFX_RectF rtDraw, CFX_Path &fillPa sweepAngle = -sweepAngle * FX_PI / 180.0f; fillPath.AddArc(rtDraw.left, rtDraw.top, rtDraw.width, rtDraw.height, startAngle, sweepAngle); } -static void XFA_BOX_GetPath(CXFA_Box box, const CXFA_StrokeArray &strokes, CFX_RectF rtWidget, CFX_Path &path, FX_INT32 nIndex, FX_BOOL bStart, FX_BOOL bCorner) +static void XFA_BOX_GetPath(CXFA_Box box, const CXFA_StrokeArray &strokes, CFX_RectF rtWidget, CFX_Path &path, int32_t nIndex, FX_BOOL bStart, FX_BOOL bCorner) { FXSYS_assert(nIndex >= 0 && nIndex < 8); FX_BOOL bInverted, bRound; FX_FLOAT fRadius1, fRadius2, sx, sy, vx, vy, nx, ny, offsetY, offsetX, offsetEX, offsetEY; CFX_PointF cpStart, cp, cp1, cp2; CFX_RectF rtRadius; - FX_INT32 n = (nIndex & 1) ? nIndex - 1 : nIndex; + int32_t n = (nIndex & 1) ? nIndex - 1 : nIndex; CXFA_Corner corner1 = (CXFA_Node*)strokes[n]; CXFA_Corner corner2 = (CXFA_Node*)strokes[(n + 2) % 8]; fRadius1 = bCorner ? corner1.GetRadius() : 0; @@ -1283,7 +1283,7 @@ static void XFA_BOX_GetFillPath(CXFA_Box box, const CXFA_StrokeArray &strokes, C fThickness = 0; } FX_FLOAT fHalf = fThickness / 2; - FX_INT32 iHand = box.GetHand(); + int32_t iHand = box.GetHand(); if (iHand == XFA_ATTRIBUTEENUM_Left) { rtWidget.Inflate(fHalf, fHalf); } else if (iHand == XFA_ATTRIBUTEENUM_Right) { @@ -1293,7 +1293,7 @@ static void XFA_BOX_GetFillPath(CXFA_Box box, const CXFA_StrokeArray &strokes, C return; } FX_BOOL bSameStyles = TRUE; - FX_INT32 i; + int32_t i; CXFA_Stroke stroke1 = strokes[0]; for (i = 1; i < 8; i ++) { CXFA_Stroke stroke2 = strokes[i]; @@ -1331,7 +1331,7 @@ static void XFA_BOX_GetFillPath(CXFA_Box box, const CXFA_StrokeArray &strokes, C FX_FLOAT fRadius1, fRadius2, sx, sy, vx, vy, nx, ny; CFX_PointF cp, cp1, cp2; CFX_RectF rtRadius; - for (FX_INT32 i = 0; i < 8; i += 2) { + for (int32_t i = 0; i < 8; i += 2) { CXFA_Corner corner1 = (CXFA_Node*)strokes[i]; CXFA_Corner corner2 = (CXFA_Node*)strokes[(i + 2) % 8]; fRadius1 = corner1.GetRadius(); @@ -1420,7 +1420,7 @@ static void XFA_BOX_Fill_Radial(CXFA_Box box, CFX_Graphics* pGS, CFX_Path &fillP CXFA_Fill fill = box.GetFill(); FX_ARGB crStart, crEnd; crStart = fill.GetColor(); - FX_INT32 iType = fill.GetRadial(crEnd); + int32_t iType = fill.GetRadial(crEnd); CFX_Shading shading; if (iType != XFA_ATTRIBUTEENUM_ToEdge) { FX_ARGB temp = crEnd; @@ -1437,8 +1437,8 @@ static void XFA_BOX_Fill_Pattern(CXFA_Box box, CFX_Graphics* pGS, CFX_Path &fill CXFA_Fill fill = box.GetFill(); FX_ARGB crStart, crEnd; crStart = fill.GetColor(); - FX_INT32 iType = fill.GetPattern(crEnd); - FX_INT32 iHatch = FX_HATCHSTYLE_Cross; + int32_t iType = fill.GetPattern(crEnd); + int32_t iHatch = FX_HATCHSTYLE_Cross; switch(iType) { case XFA_ATTRIBUTEENUM_CrossDiagonal: iHatch = FX_HATCHSTYLE_DiagonalCross; @@ -1469,7 +1469,7 @@ static void XFA_BOX_Fill_Linear(CXFA_Box box, CFX_Graphics* pGS, CFX_Path &fillP CXFA_Fill fill = box.GetFill(); FX_ARGB crStart, crEnd; crStart = fill.GetColor(); - FX_INT32 iType = fill.GetLinear(crEnd); + int32_t iType = fill.GetLinear(crEnd); CFX_PointF ptStart, ptEnd; switch(iType) { case XFA_ATTRIBUTEENUM_ToRight: @@ -1508,7 +1508,7 @@ static void XFA_BOX_Fill(CXFA_Box box, const CXFA_StrokeArray &strokes, CFX_Grap fillPath.Create(); XFA_BOX_GetFillPath(box, strokes, rtWidget, fillPath, (dwFlags & XFA_DRAWBOX_ForceRound) != 0); fillPath.Close(); - FX_INT32 eType = fill.GetFillType(); + int32_t eType = fill.GetFillType(); switch(eType) { case XFA_ELEMENT_Radial: XFA_BOX_Fill_Radial(box, pGS, fillPath, rtWidget, pMatrix); @@ -1522,11 +1522,11 @@ static void XFA_BOX_Fill(CXFA_Box box, const CXFA_StrokeArray &strokes, CFX_Grap default: { FX_ARGB cr; if (eType == XFA_ELEMENT_Stipple) { - FX_INT32 iRate = fill.GetStipple(cr); + int32_t iRate = fill.GetStipple(cr); if (iRate == 0) { iRate = 100; } - FX_INT32 a = 0; + int32_t a = 0; FX_COLORREF rgb; ArgbDecode(cr, a, rgb); cr = ArgbEncode(iRate * a / 100, rgb); @@ -1570,7 +1570,7 @@ static void XFA_BOX_StrokeArc(CXFA_Box box, CFX_Graphics* pGS, CFX_RectF rtWidge } FX_BOOL bVisible = FALSE; FX_FLOAT fThickness = 0; - FX_INT32 i3DType = box.Get3DStyle(bVisible, fThickness); + int32_t i3DType = box.Get3DStyle(bVisible, fThickness); if (i3DType) { if (bVisible && fThickness >= 0.001f) { dwFlags |= XFA_DRAWBOX_Lowered3D; @@ -1580,7 +1580,7 @@ static void XFA_BOX_StrokeArc(CXFA_Box box, CFX_Graphics* pGS, CFX_RectF rtWidge if (fHalf < 0) { fHalf = 0; } - FX_INT32 iHand = box.GetHand(); + int32_t iHand = box.GetHand(); if (iHand == XFA_ATTRIBUTEENUM_Left) { rtWidget.Inflate(fHalf, fHalf); } else if (iHand == XFA_ATTRIBUTEENUM_Right) { @@ -1713,7 +1713,7 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box, const CXFA_StrokeArray &strokes, C { FX_BOOL bVisible = FALSE; FX_FLOAT fThickness = 0; - FX_INT32 i3DType = box.Get3DStyle(bVisible, fThickness); + int32_t i3DType = box.Get3DStyle(bVisible, fThickness); if (i3DType) { if (!bVisible || fThickness < 0.001f) { return; @@ -1736,7 +1736,7 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box, const CXFA_StrokeArray &strokes, C } FX_BOOL bClose = FALSE; FX_BOOL bSameStyles = TRUE; - FX_INT32 i; + int32_t i; CXFA_Stroke stroke1 = strokes[0]; for (i = 1; i < 8; i ++) { CXFA_Stroke stroke2 = strokes[i]; @@ -1804,7 +1804,7 @@ static void XFA_BOX_Stroke(CXFA_Box box, const CXFA_StrokeArray &strokes, CFX_Gr return; } FX_BOOL bVisible = FALSE; - for (FX_INT32 j = 0; j < 4; j ++) { + for (int32_t j = 0; j < 4; j ++) { bVisible |= strokes[j * 2 + 1].IsVisible(); if (bVisible) { break; @@ -1813,14 +1813,14 @@ static void XFA_BOX_Stroke(CXFA_Box box, const CXFA_StrokeArray &strokes, CFX_Gr if (!bVisible) { return; } - for (FX_INT32 i = 1; i < 8; i += 2) { + for (int32_t i = 1; i < 8; i += 2) { CXFA_Edge edge = (CXFA_Node*)strokes[i]; FX_FLOAT fThickness = edge.GetThickness(); if (fThickness < 0) { fThickness = 0; } FX_FLOAT fHalf = fThickness / 2; - FX_INT32 iHand = box.GetHand(); + int32_t iHand = box.GetHand(); switch (i) { case 1: if (iHand == XFA_ATTRIBUTEENUM_Left) { @@ -1863,7 +1863,7 @@ void XFA_DrawBox(CXFA_Box box, CFX_Graphics* pGS, const CFX_RectF &rtWidget, CFX if (!box || box.GetPresence() != XFA_ATTRIBUTEENUM_Visible) { return; } - FX_INT32 iType = box.GetClassID(); + int32_t iType = box.GetClassID(); if (iType != XFA_ELEMENT_Arc && iType != XFA_ELEMENT_Border && iType != XFA_ELEMENT_Rectangle) { return; } diff --git a/xfa/src/fxfa/src/app/xfa_ffwidget.h b/xfa/src/fxfa/src/app/xfa_ffwidget.h index 8f19e71a0e..80f4be4d30 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidget.h +++ b/xfa/src/fxfa/src/app/xfa_ffwidget.h @@ -36,7 +36,7 @@ public: m_Globals.RemoveAll(); } CFX_PtrArray m_Globals; - FX_INT32 m_iRefCount; + int32_t m_iRefCount; }; class CXFA_FFWidget : public IXFA_Widget, public CFX_PrivateData, public CXFA_ContentLayoutItemImpl { @@ -52,7 +52,7 @@ public: virtual FX_BOOL GetBBox(CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE); CXFA_WidgetAcc* GetDataAcc(); FX_BOOL GetToolTip(CFX_WideString &wsToolTip); - virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, FX_INT32 iRotate = 0); + virtual void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_DWORD dwStatus = 0, int32_t iRotate = 0); virtual FX_BOOL IsLoaded(); virtual FX_BOOL LoadWidget(); @@ -66,7 +66,7 @@ public: virtual FX_BOOL OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnLButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); - virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy); + virtual FX_BOOL OnMouseWheel(FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonDblClk(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); @@ -188,15 +188,15 @@ protected: CXFA_WidgetAcc* m_pDataAcc; CFX_RectF m_rtWidget; }; -FX_INT32 XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, FX_INT32 iStrokeType, FX_INT32 iCapType); -CFX_GraphStateData::LineCap XFA_LineCapToFXGE(FX_INT32 iLineCap); -void XFA_DrawImage(CFX_Graphics* pGS, const CFX_RectF &rtImage, CFX_Matrix* pMatrix, CFX_DIBitmap* pDIBitmap, FX_INT32 iAspect, FX_INT32 iImageXDpi, FX_INT32 iImageYDpi, FX_INT32 iHorzAlign = XFA_ATTRIBUTEENUM_Left, FX_INT32 iVertAlign = XFA_ATTRIBUTEENUM_Top); -CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &bNameImage, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi); -CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, FXCODEC_IMAGE_TYPE type, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi); +int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, int32_t iStrokeType, int32_t iCapType); +CFX_GraphStateData::LineCap XFA_LineCapToFXGE(int32_t iLineCap); +void XFA_DrawImage(CFX_Graphics* pGS, const CFX_RectF &rtImage, CFX_Matrix* pMatrix, CFX_DIBitmap* pDIBitmap, int32_t iAspect, int32_t iImageXDpi, int32_t iImageYDpi, int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left, int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top); +CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc *pDoc, CXFA_Image *pImage, FX_BOOL &bNameImage, int32_t &iImageXDpi, int32_t &iImageYDpi); +CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, FXCODEC_IMAGE_TYPE type, int32_t &iImageXDpi, int32_t &iImageYDpi); FXCODEC_IMAGE_TYPE XFA_GetImageType(FX_WSTR wsType); -FX_LPSTR XFA_Base64Encode(FX_LPCBYTE buf, FX_INT32 buf_len); +FX_LPSTR XFA_Base64Encode(FX_LPCBYTE buf, int32_t buf_len); void XFA_RectWidthoutMargin(CFX_RectF &rt, const CXFA_Margin &mg, FX_BOOL bUI = FALSE); -FX_FLOAT XFA_GetEdgeThickness(const CXFA_StrokeArray &strokes, FX_BOOL b3DStyle, FX_INT32 nIndex); +FX_FLOAT XFA_GetEdgeThickness(const CXFA_StrokeArray &strokes, FX_BOOL b3DStyle, int32_t nIndex); CXFA_FFWidget* XFA_GetWidgetFromLayoutItem(CXFA_LayoutItem* pLayoutItem); FX_BOOL XFA_IsCreateWidget(XFA_ELEMENT iType); #define XFA_DRAWBOX_ForceRound 1 diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp index a154d76392..3f105d98d6 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp @@ -109,8 +109,8 @@ public: CFX_DIBitmap* m_pDIBitmap; FX_BOOL m_bNamedImage; - FX_INT32 m_iImageXDpi; - FX_INT32 m_iImageYDpi; + int32_t m_iImageXDpi; + int32_t m_iImageYDpi; }; class CXFA_FieldLayoutData : public CXFA_WidgetLayoutData { @@ -198,8 +198,8 @@ public: } CFX_DIBitmap* m_pDIBitmap; FX_BOOL m_bNamedImage; - FX_INT32 m_iImageXDpi; - FX_INT32 m_iImageYDpi; + int32_t m_iImageXDpi; + int32_t m_iImageYDpi; }; CXFA_WidgetAcc::CXFA_WidgetAcc(CXFA_FFDocView* pDocView, CXFA_Node* pNode) : CXFA_WidgetData(pNode) @@ -214,7 +214,7 @@ CXFA_WidgetAcc::~CXFA_WidgetAcc() m_pLayoutData = NULL; } } -FX_BOOL CXFA_WidgetAcc::GetName(CFX_WideString &wsName, FX_INT32 iNameType ) +FX_BOOL CXFA_WidgetAcc::GetName(CFX_WideString &wsName, int32_t iNameType ) { if (iNameType == 0) { m_pNode->TryCData(XFA_ATTRIBUTE_Name, wsName); @@ -346,17 +346,17 @@ IXFA_AppProvider* CXFA_WidgetAcc::GetAppProvider() { return GetApp()->GetAppProvider(); } -FX_INT32 CXFA_WidgetAcc::ProcessEvent(FX_INT32 iActivity, CXFA_EventParam* pEventParam) +int32_t CXFA_WidgetAcc::ProcessEvent(int32_t iActivity, CXFA_EventParam* pEventParam) { if (this->GetClassID() == XFA_ELEMENT_Draw) { return XFA_EVENTERROR_NotExist; } - FX_INT32 iRet = XFA_EVENTERROR_NotExist; + int32_t iRet = XFA_EVENTERROR_NotExist; CXFA_NodeArray eventArray; - FX_INT32 iCounts = GetEventByActivity(iActivity, eventArray, pEventParam->m_bIsFormReady); - for (FX_INT32 i = 0; i < iCounts; i++) { + int32_t iCounts = GetEventByActivity(iActivity, eventArray, pEventParam->m_bIsFormReady); + for (int32_t i = 0; i < iCounts; i++) { CXFA_Event event(eventArray[i]); - FX_INT32 result = ProcessEvent(event, pEventParam); + int32_t result = ProcessEvent(event, pEventParam); if (i == 0) { iRet = result; } else if (result == XFA_EVENTERROR_Sucess) { @@ -365,7 +365,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessEvent(FX_INT32 iActivity, CXFA_EventParam* pEven } return iRet; } -FX_INT32 CXFA_WidgetAcc::ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEventParam) +int32_t CXFA_WidgetAcc::ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEventParam) { if (!event) { return XFA_EVENTERROR_NotExist; @@ -389,7 +389,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEvent } return XFA_EVENTERROR_NotExist; } -FX_INT32 CXFA_WidgetAcc::ProcessCalculate() +int32_t CXFA_WidgetAcc::ProcessCalculate() { if (this->GetClassID() == XFA_ELEMENT_Draw) { return XFA_EVENTERROR_NotExist; @@ -404,7 +404,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessCalculate() CXFA_EventParam EventParam; EventParam.m_eType = XFA_EVENT_Calculate; CXFA_Script script = calc.GetScript(); - FX_INT32 iRet = ExecuteScript(script, &EventParam); + int32_t iRet = ExecuteScript(script, &EventParam); if (iRet == XFA_EVENTERROR_Sucess) { if (GetRawValue() != EventParam.m_wsResult) { FX_BOOL bNotify = GetDoc()->GetDocType() == XFA_DOCTYPE_Static; @@ -418,7 +418,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessCalculate() } return iRet; } -void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, FX_INT32 iRet, FXJSE_HVALUE pRetValue, FX_BOOL bVersionFlag) +void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, int32_t iRet, FXJSE_HVALUE pRetValue, FX_BOOL bVersionFlag) { if (iRet == XFA_EVENTERROR_Sucess && pRetValue) { if (FXJSE_Value_IsBoolean(pRetValue) && !FXJSE_Value_ToBoolean(pRetValue)) { @@ -430,7 +430,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, FX_INT32 pAppProvider->LoadString(XFA_IDS_AppName, wsTitle); CFX_WideString wsScriptMsg; validate.GetScriptMessageText(wsScriptMsg); - FX_INT32 eScriptTest = validate.GetScriptTest(); + int32_t eScriptTest = validate.GetScriptTest(); if (eScriptTest == XFA_ATTRIBUTEENUM_Warning) { if (this->GetNode()->HasFlag(XFA_NODEFLAG_UserInteractive)) { return; @@ -454,7 +454,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, FX_INT32 } } } -FX_INT32 CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, FX_BOOL bVersionFlag) +int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, FX_BOOL bVersionFlag) { CFX_WideString wsRawValue = GetRawValue(); if (!wsRawValue.IsEmpty()) { @@ -477,7 +477,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, FX_BO validate.GetFormatMessageText(wsFormatMsg); CFX_WideString wsTitle; pAppProvider->LoadString(XFA_IDS_AppName, wsTitle); - FX_INT32 eFormatTest = validate.GetFormatTest(); + int32_t eFormatTest = validate.GetFormatTest(); if (eFormatTest == XFA_ATTRIBUTEENUM_Error) { if (wsFormatMsg.IsEmpty()) { GetValidateMessage(pAppProvider, wsFormatMsg, TRUE, bVersionFlag); @@ -503,7 +503,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, FX_BO } return XFA_EVENTERROR_NotExist; } -FX_INT32 CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, FX_INT32 iFlags, FX_BOOL bVersionFlag) +int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, int32_t iFlags, FX_BOOL bVersionFlag) { CFX_WideString wsValue; this->GetValue(wsValue, XFA_VALUEPICTURE_Raw); @@ -513,11 +513,11 @@ FX_INT32 CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, FX_INT3 if (this->m_bIsNull && (this->m_bPreNull == this->m_bIsNull)) { return XFA_EVENTERROR_Sucess; } - FX_INT32 eNullTest = validate.GetNullTest(); + int32_t eNullTest = validate.GetNullTest(); CFX_WideString wsNullMsg; validate.GetNullMessageText(wsNullMsg); if (iFlags & 0x01) { - FX_INT32 iRet = XFA_EVENTERROR_Sucess; + int32_t iRet = XFA_EVENTERROR_Sucess; if (eNullTest != XFA_ATTRIBUTEENUM_Disabled) { iRet = XFA_EVENTERROR_Error; } @@ -609,7 +609,7 @@ void CXFA_WidgetAcc::GetValidateMessage(IXFA_AppProvider* pAppProvider, CFX_Wide pAppProvider->LoadString(XFA_IDS_ValidateWarning, wsWarning); wsMessage.Format(wsWarning, (FX_LPCWSTR)wsCaptionName, (FX_LPCWSTR)wsCaptionName); } -FX_INT32 CXFA_WidgetAcc::ProcessValidate(FX_INT32 iFlags) +int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) { if (this->GetClassID() == XFA_ELEMENT_Draw) { return XFA_EVENTERROR_NotExist; @@ -620,9 +620,9 @@ FX_INT32 CXFA_WidgetAcc::ProcessValidate(FX_INT32 iFlags) } FX_BOOL bInitDoc = ((CXFA_Node*)validate)->HasFlag(XFA_NODEFLAG_NeedsInitApp); FX_BOOL bStatus = m_pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End; - FX_INT32 iFormat = 0; + int32_t iFormat = 0; FXJSE_HVALUE pRetValue = NULL; - FX_INT32 iRet = XFA_EVENTERROR_NotExist; + int32_t iRet = XFA_EVENTERROR_NotExist; CXFA_Script script = validate.GetScript(); if (script) { CXFA_EventParam eParam; @@ -652,7 +652,7 @@ FX_INT32 CXFA_WidgetAcc::ProcessValidate(FX_INT32 iFlags) } return iRet | iFormat; } -FX_INT32 CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, CXFA_EventParam* pEventParam, FXJSE_HVALUE* pRetValue) +int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, CXFA_EventParam* pEventParam, FXJSE_HVALUE* pRetValue) { FXSYS_assert(pEventParam); if (!script) { @@ -681,7 +681,7 @@ FX_INT32 CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, CXFA_EventParam* pEve FXJSE_HVALUE hRetValue = FXJSE_Value_Create(pContext->GetRuntime()); FX_BOOL bRet = FALSE; bRet = pContext->RunScript((XFA_SCRIPTLANGTYPE)eScriptType, wsExpression, hRetValue, m_pNode); - FX_INT32 iRet = XFA_EVENTERROR_Error; + int32_t iRet = XFA_EVENTERROR_Error; if (bRet) { iRet = XFA_EVENTERROR_Sucess; if (pEventParam->m_eType == XFA_EVENT_Calculate || pEventParam->m_eType == XFA_EVENT_InitCalculate) { @@ -701,8 +701,8 @@ FX_INT32 CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, CXFA_EventParam* pEve m_pDocView->AddValidateWidget(this); } } - FX_INT32 iRefs = refNodes.GetSize(); - for (FX_INT32 r = 0; r < iRefs; r++) { + int32_t iRefs = refNodes.GetSize(); + for (int32_t r = 0; r < iRefs; r++) { CXFA_WidgetAcc* pRefAcc = (CXFA_WidgetAcc*)refNodes[r]->GetWidgetData(); if (pRefAcc && pRefAcc == this) { continue; @@ -773,7 +773,7 @@ void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF &szCap) } LoadCaption(); XFA_ELEMENT eUIType = (XFA_ELEMENT)GetUIType(); - FX_INT32 iCapPlacement = caption.GetPlacementType(); + int32_t iCapPlacement = caption.GetPlacementType(); FX_FLOAT fCapReserve = caption.GetReserve(); FX_BOOL bVert = iCapPlacement == XFA_ATTRIBUTEENUM_Top || iCapPlacement == XFA_ATTRIBUTEENUM_Bottom; FX_BOOL bReserveExit = fCapReserve > 0.01; @@ -826,7 +826,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF &size) size.x += rtUIMargin.left + rtUIMargin.width; size.y += rtUIMargin.top + rtUIMargin.height; if (szCap.x > 0 && szCap.y > 0) { - FX_INT32 iCapPlacement = this->GetCaption().GetPlacementType(); + int32_t iCapPlacement = this->GetCaption().GetPlacementType(); switch(iCapPlacement) { case XFA_ATTRIBUTEENUM_Left: case XFA_ATTRIBUTEENUM_Right: @@ -924,7 +924,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF &size) szCap.Set(0, 0); CalcCaptionSize(szCap); FX_BOOL bCapExit = szCap.x > 0.01 && szCap.y > 0.01; - FX_INT32 iCapPlacement = XFA_ATTRIBUTEENUM_Unknown; + int32_t iCapPlacement = XFA_ATTRIBUTEENUM_Unknown; if (bCapExit) { iCapPlacement = this->GetCaption().GetPlacementType(); switch(iCapPlacement) { @@ -993,8 +993,8 @@ FX_BOOL CXFA_WidgetAcc::CalculateImageAutoSize(CFX_SizeF &size) CFX_RectF rtImage, rtFit; rtImage.Set(0, 0, 0, 0); rtFit.Set(0, 0, 0, 0); - FX_INT32 iImageXDpi = 0; - FX_INT32 iImageYDpi = 0; + int32_t iImageXDpi = 0; + int32_t iImageYDpi = 0; GetImageDpi(iImageXDpi, iImageYDpi); rtImage.width = XFA_UnitPx2Pt((FX_FLOAT)pBitmap->GetWidth(), (FX_FLOAT)iImageXDpi); rtImage.height = XFA_UnitPx2Pt((FX_FLOAT)pBitmap->GetHeight(), (FX_FLOAT)iImageYDpi); @@ -1023,8 +1023,8 @@ FX_BOOL CXFA_WidgetAcc::CalculateImageEditAutoSize(CFX_SizeF &size) CFX_RectF rtImage, rtFit; rtImage.Set(0, 0, 0, 0); rtFit.Set(0, 0, 0, 0); - FX_INT32 iImageXDpi = 0; - FX_INT32 iImageYDpi = 0; + int32_t iImageXDpi = 0; + int32_t iImageYDpi = 0; GetImageEditDpi(iImageXDpi, iImageYDpi); rtImage.width = XFA_UnitPx2Pt((FX_FLOAT)pBitmap->GetWidth(), (FX_FLOAT)iImageXDpi); rtImage.height = XFA_UnitPx2Pt((FX_FLOAT)pBitmap->GetHeight(), (FX_FLOAT)iImageYDpi); @@ -1053,12 +1053,12 @@ FX_BOOL CXFA_WidgetAcc::LoadImageEditImage() InitLayoutData(); return ((CXFA_ImageEditData*)m_pLayoutData)->LoadImageData(this); } -void CXFA_WidgetAcc::GetImageDpi(FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi) +void CXFA_WidgetAcc::GetImageDpi(int32_t &iImageXDpi, int32_t &iImageYDpi) { iImageXDpi = ((CXFA_ImageLayoutData*)m_pLayoutData)->m_iImageXDpi; iImageYDpi = ((CXFA_ImageLayoutData*)m_pLayoutData)->m_iImageYDpi; } -void CXFA_WidgetAcc::GetImageEditDpi(FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi) +void CXFA_WidgetAcc::GetImageEditDpi(int32_t &iImageXDpi, int32_t &iImageYDpi) { iImageXDpi = ((CXFA_ImageEditData*)m_pLayoutData)->m_iImageXDpi; iImageYDpi = ((CXFA_ImageEditData*)m_pLayoutData)->m_iImageYDpi; @@ -1210,7 +1210,7 @@ void CXFA_WidgetAcc::CalculateAccWidthAndHeight(XFA_ELEMENT eUIType, FX_FLOAT& f m_pLayoutData->m_fWidgetHeight = sz.y; fCalcHeight = sz.y; } -FX_BOOL CXFA_WidgetAcc::FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight) +FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT &fCalcHeight) { XFA_ELEMENT eUIType = (XFA_ELEMENT)GetUIType(); if (eUIType == XFA_ELEMENT_Subform) { @@ -1273,7 +1273,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight fCapReserve = 0; } } - FX_INT32 iLinesCount = 0; + int32_t iLinesCount = 0; FX_FLOAT fHeight = m_pLayoutData->m_fWidgetHeight; CFX_WideString wsText; this->GetValue(wsText, XFA_VALUEPICTURE_Display); @@ -1291,9 +1291,9 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight ((CXFA_FieldLayoutData*)m_pLayoutData)->m_pFieldSplitArray = FX_NEW CFX_FloatArray; } CFX_FloatArray* pFieldArray = ((CXFA_FieldLayoutData*)m_pLayoutData)->m_pFieldSplitArray; - FX_INT32 iFieldSplitCount = pFieldArray->GetSize(); - for (FX_INT32 i = 0; i < iBlockIndex * 3; i += 3) { - iLinesCount -= (FX_INT32)pFieldArray->GetAt(i + 1); + int32_t iFieldSplitCount = pFieldArray->GetSize(); + for (int32_t i = 0; i < iBlockIndex * 3; i += 3) { + iLinesCount -= (int32_t)pFieldArray->GetAt(i + 1); fHeight -= pFieldArray->GetAt(i + 2); } if (iLinesCount == 0) { @@ -1327,7 +1327,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight fStartOffset = 0; } } - for (FX_INT32 i = iBlockIndex - 1; iBlockIndex > 0 && i < iBlockIndex; i++) { + for (int32_t i = iBlockIndex - 1; iBlockIndex > 0 && i < iBlockIndex; i++) { fStartOffset = pFieldArray->GetAt(i * 3) - pFieldArray->GetAt(i * 3 + 2); if (fStartOffset < 0.1f) { fStartOffset = 0; @@ -1380,7 +1380,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight return TRUE; } FX_FLOAT fTextNum = fCalcHeight + XFA_FLOAT_PERCISION - fCapReserve - fStartOffset; - FX_INT32 iLineNum = (FX_INT32)((fTextNum + (fLineHeight - fFontSize)) / fLineHeight); + int32_t iLineNum = (int32_t)((fTextNum + (fLineHeight - fFontSize)) / fLineHeight); if (iLineNum >= iLinesCount) { if (fCalcHeight - fStartOffset - fTextHeight >= fFontSize) { if (iFieldSplitCount / 3 == (iBlockIndex + 1)) { @@ -1399,7 +1399,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight return TRUE; } } else { - iLineNum = (FX_INT32)(fTextNum / fLineHeight); + iLineNum = (int32_t)(fTextNum / fLineHeight); } } if (iLineNum > 0) { diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp index 856c0792bb..d43c5a6312 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.cpp @@ -40,7 +40,7 @@ CXFA_WidgetAcc* CXFA_FFWidgetHandler::GetDataAcc(IXFA_Widget* hWidget) { return static_cast(hWidget)->GetDataAcc(); } -void CXFA_FFWidgetHandler::GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, FX_INT32 iNameType ) +void CXFA_FFWidgetHandler::GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, int32_t iNameType ) { static_cast(hWidget)->GetDataAcc()->GetName(wsName, iNameType); } @@ -108,7 +108,7 @@ FX_BOOL CXFA_FFWidgetHandler::OnMouseMove(IXFA_Widget* hWidget, FX_DWORD dwFlags m_pDocView->RunInvalidate(); return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy) +FX_BOOL CXFA_FFWidgetHandler::OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy) { static_cast(hWidget)->Rotate2Normal(fx, fy); FX_BOOL bRet = static_cast(hWidget)->OnMouseWheel(dwFlags, zDelta, fx, fy); @@ -210,7 +210,7 @@ FX_BOOL CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE CXFA_NodeArray eventArray; return pWidgetAcc->GetEventByActivity(gs_EventActivity[eEventType], eventArray); } -FX_INT32 CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam) +int32_t CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam) { if (!pParam || pParam->m_eType == XFA_EVENT_Unknown) { return XFA_EVENTERROR_NotExist; @@ -240,7 +240,7 @@ FX_INT32 CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_Eve default: break; } - FX_INT32 iRet = pWidgetAcc->ProcessEvent(gs_EventActivity[pParam->m_eType], pParam); + int32_t iRet = pWidgetAcc->ProcessEvent(gs_EventActivity[pParam->m_eType], pParam); return iRet; } IXFA_Widget* CXFA_FFWidgetHandler::CreateWidget(IXFA_Widget* hParent, XFA_WIDGETTYPE eType, IXFA_Widget* hBefore ) diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.h b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.h index 28c6c84651..7c47b8d1a1 100644 --- a/xfa/src/fxfa/src/app/xfa_ffwidgethandler.h +++ b/xfa/src/fxfa/src/app/xfa_ffwidgethandler.h @@ -18,7 +18,7 @@ public: virtual FX_DWORD GetStatus(IXFA_Widget* hWidget); virtual FX_BOOL GetBBox(IXFA_Widget* hWidget, CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE); virtual CXFA_WidgetAcc* GetDataAcc(IXFA_Widget* hWidget); - virtual void GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, FX_INT32 iNameType = 0); + virtual void GetName(IXFA_Widget* hWidget, CFX_WideString &wsName, int32_t iNameType = 0); virtual FX_BOOL GetToolTip(IXFA_Widget* hWidget, CFX_WideString &wsToolTip); virtual void SetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback); virtual FX_LPVOID GetPrivateData(IXFA_Widget* hWidget, FX_LPVOID module_id); @@ -28,7 +28,7 @@ public: virtual FX_BOOL OnLButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnLButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnMouseMove(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); - virtual FX_BOOL OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_SHORT zDelta, FX_FLOAT fx, FX_FLOAT fy); + virtual FX_BOOL OnMouseWheel(IXFA_Widget* hWidget, FX_DWORD dwFlags, int16_t zDelta, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonDown(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonUp(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); virtual FX_BOOL OnRButtonDblClk(IXFA_Widget* hWidget, FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); @@ -40,7 +40,7 @@ public: virtual FX_BOOL OnSetCursor(IXFA_Widget* hWidget, FX_FLOAT fx, FX_FLOAT fy); virtual void RenderWidget(IXFA_Widget* hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix = NULL, FX_BOOL bHighlight = FALSE); virtual FX_BOOL HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType); - virtual FX_INT32 ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam); + virtual int32_t ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam); protected: CXFA_Node* CreateWidgetFormItem(XFA_WIDGETTYPE eType, CXFA_Node* pParent, CXFA_Node* pBefore) const; diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp index 5cacacfff6..127278fb46 100644 --- a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp +++ b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp @@ -966,9 +966,9 @@ void XFA_LocalFontNameToEnglishName(FX_WSTR wsLocalName, CFX_WideString &wsEngli wsEnglishName = wsLocalName; #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ || _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ FX_DWORD dwLocalNameHash = FX_HashCode_String_GetW(wsLocalName.GetPtr(), wsLocalName.GetLength(), TRUE); - FX_INT32 iStart = 0; - FX_INT32 iEnd = sizeof(g_XFAFontsMap) / sizeof(XFA_FONTINFO) - 1; - FX_INT32 iMid = 0; + int32_t iStart = 0; + int32_t iEnd = sizeof(g_XFAFontsMap) / sizeof(XFA_FONTINFO) - 1; + int32_t iMid = 0; do { iMid = (iStart + iEnd) / 2; FX_DWORD dwFontNameHash = g_XFAFontsMap[iMid].dwFontNameHash; @@ -989,9 +989,9 @@ const XFA_FONTINFO* XFA_GetFontINFOByFontName(FX_WSTR wsFontName) CFX_WideString wsFontNameTemp = wsFontName; wsFontNameTemp.Remove(L' '); FX_DWORD dwCurFontNameHash = FX_HashCode_String_GetW(wsFontNameTemp, wsFontNameTemp.GetLength(), TRUE); - FX_INT32 iStart = 0; - FX_INT32 iEnd = sizeof(g_XFAFontsMap) / sizeof(XFA_FONTINFO) - 1; - FX_INT32 iMid = 0; + int32_t iStart = 0; + int32_t iEnd = sizeof(g_XFAFontsMap) / sizeof(XFA_FONTINFO) - 1; + int32_t iMid = 0; const XFA_FONTINFO *pFontInfo = NULL; do { iMid = (iStart + iEnd) / 2; @@ -1021,8 +1021,8 @@ IXFA_FontMgr::~IXFA_FontMgr() } CXFA_DefFontMgr::~CXFA_DefFontMgr() { - FX_INT32 iCounts = m_CacheFonts.GetSize(); - for (FX_INT32 i = 0; i < iCounts; i++) { + int32_t iCounts = m_CacheFonts.GetSize(); + for (int32_t i = 0; i < iCounts; i++) { ((IFX_Font*)m_CacheFonts[i])->Release(); } m_CacheFonts.RemoveAll(); @@ -1054,7 +1054,7 @@ IFX_Font* CXFA_DefFontMgr::GetFont(IXFA_Doc* hDoc, FX_WSTR wsFontFamily, FX_DWOR dwStyle |= FX_FONTSTYLE_Italic; } FX_LPCWSTR pReplace = pCurFont->pReplaceFont; - FX_INT32 iLength = FXSYS_wcslen(pReplace); + int32_t iLength = FXSYS_wcslen(pReplace); while (iLength > 0) { FX_LPCWSTR pNameText = pReplace; while (*pNameText != L',' && iLength > 0) { @@ -1204,10 +1204,10 @@ IFX_Font* CXFA_PDFFontMgr::GetFont(FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, CFX_ByteString CXFA_PDFFontMgr::PsNameToFontName(const CFX_ByteString& strPsName, FX_BOOL bBold, FX_BOOL bItalic) { - FX_INT32 nCount = sizeof(g_XFAPDFFontName) / sizeof(XFA_PDFFONTNAME); - for (FX_INT32 i = 0; i < nCount; i++) { + int32_t nCount = sizeof(g_XFAPDFFontName) / sizeof(XFA_PDFFONTNAME); + for (int32_t i = 0; i < nCount; i++) { if (strPsName == g_XFAPDFFontName[i].lpPsName) { - FX_INT32 index = 1 + ((bItalic << 1) | bBold); + int32_t index = 1 + ((bItalic << 1) | bBold); return *(&g_XFAPDFFontName[i].lpPsName + index); } } @@ -1217,17 +1217,17 @@ FX_BOOL CXFA_PDFFontMgr::PsNameMatchDRFontName(FX_BSTR bsPsName, FX_BOOL bBold, { CFX_ByteString bsDRName = bsDRFontName; bsDRName.Remove('-'); - FX_INT32 iPsLen = bsPsName.GetLength(); - FX_INT32 nIndex = bsDRName.Find(bsPsName); + int32_t iPsLen = bsPsName.GetLength(); + int32_t nIndex = bsDRName.Find(bsPsName); if (nIndex != -1 && !bStrictMatch) { return TRUE; } if (nIndex != 0) { return FALSE; } - FX_INT32 iDifferLength = bsDRName.GetLength() - iPsLen; + int32_t iDifferLength = bsDRName.GetLength() - iPsLen; if (iDifferLength > 1 || (bBold || bItalic)) { - FX_INT32 iBoldIndex = bsDRName.Find(FX_BSTRC("Bold")); + int32_t iBoldIndex = bsDRName.Find(FX_BSTRC("Bold")); FX_BOOL bBoldFont = iBoldIndex > 0; if (bBold ^ bBoldFont) { return FALSE; @@ -1284,7 +1284,7 @@ FX_BOOL CXFA_PDFFontMgr::PsNameMatchDRFontName(FX_BSTR bsPsName, FX_BOOL bBold, } return TRUE; } -FX_BOOL CXFA_PDFFontMgr::GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode) +FX_BOOL CXFA_PDFFontMgr::GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode) { if (wUnicode != 0x20 || bCharCode) { return FALSE; diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.h b/xfa/src/fxfa/src/app/xfa_fontmgr.h index 9de1348293..f612664644 100644 --- a/xfa/src/fxfa/src/app/xfa_fontmgr.h +++ b/xfa/src/fxfa/src/app/xfa_fontmgr.h @@ -29,7 +29,7 @@ public: CXFA_PDFFontMgr(CXFA_FFDoc* pDoc); ~CXFA_PDFFontMgr(); IFX_Font* GetFont(FX_WSTR wsFontFamily, FX_DWORD dwFontStyles, CPDF_Font** pPDFFont, FX_BOOL bStrictMatch = TRUE); - FX_BOOL GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode); + FX_BOOL GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode); CFX_MapPtrToPtr m_FDE2PDFFont; protected: IFX_Font* FindFont(CFX_ByteString strFamilyName, FX_BOOL bBold, FX_BOOL bItalic, CPDF_Font** pPDFFont, FX_BOOL bStrictMatch = TRUE); diff --git a/xfa/src/fxfa/src/app/xfa_fwladapter.h b/xfa/src/fxfa/src/app/xfa_fwladapter.h index 8e830142c4..1ddfcf4113 100644 --- a/xfa/src/fxfa/src/app/xfa_fwladapter.h +++ b/xfa/src/fxfa/src/app/xfa_fwladapter.h @@ -22,7 +22,7 @@ public: } virtual void OnPreOpen(IFWL_Widget *pWidget) {} virtual void OnPostOpen(IFWL_Widget *pWidget) {} - virtual void OnSelectChanged(IFWL_Widget *pWidget, FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay) {} + virtual void OnSelectChanged(IFWL_Widget *pWidget, int32_t iYear, int32_t iMonth, int32_t iDay) {} virtual void OnTextChanged(IFWL_Widget *pWidget, const CFX_WideString &wsChanged) {} virtual void OnTextFull(IFWL_Widget *pWidget) {} virtual FX_BOOL OnValidate(IFWL_Widget *pWidget, CFX_WideString &wsText) diff --git a/xfa/src/fxfa/src/app/xfa_fwltheme.cpp b/xfa/src/fxfa/src/app/xfa_fwltheme.cpp index 036d6f1157..ca9bf5e890 100644 --- a/xfa/src/fxfa/src/app/xfa_fwltheme.cpp +++ b/xfa/src/fxfa/src/app/xfa_fwltheme.cpp @@ -65,7 +65,7 @@ static FX_LPCWSTR g_FWLTheme_CalFonts[] = { FWL_ERR CXFA_FWLTheme::Initialize() { m_pTextOut = IFDE_TextOut::Create(); - for (FX_INT32 i = 0; NULL == m_pCalendarFont && i < sizeof(g_FWLTheme_CalFonts) / sizeof(FX_LPCWSTR); i++) { + for (int32_t i = 0; NULL == m_pCalendarFont && i < sizeof(g_FWLTheme_CalFonts) / sizeof(FX_LPCWSTR); i++) { m_pCalendarFont = IFX_Font::LoadFont(g_FWLTheme_CalFonts[i], 0, 0, m_pApp->GetFDEFontMgr()); } if (NULL == m_pCalendarFont) @@ -349,7 +349,7 @@ FX_BOOL CXFA_FWLCheckBoxTP::DrawBackground(CFWL_ThemeBackground *pParams) } return TRUE; } -void CXFA_FWLCheckBoxTP::DrawCheckSign(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_RectF *pRtBox, FX_INT32 iState, CFX_Matrix* pMatrix) +void CXFA_FWLCheckBoxTP::DrawCheckSign(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_RectF *pRtBox, int32_t iState, CFX_Matrix* pMatrix) { CFX_RectF rtSign(*pRtBox); FX_DWORD dwColor = 0xFF000000; diff --git a/xfa/src/fxfa/src/app/xfa_fwltheme.h b/xfa/src/fxfa/src/app/xfa_fwltheme.h index 34003b4eb1..37b8d1336a 100644 --- a/xfa/src/fxfa/src/app/xfa_fwltheme.h +++ b/xfa/src/fxfa/src/app/xfa_fwltheme.h @@ -81,7 +81,7 @@ public: CXFA_FWLCheckBoxTP(); virtual FX_BOOL DrawBackground(CFWL_ThemeBackground *pParams); protected: - void DrawCheckSign(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_RectF *pRtBox, FX_INT32 iState, CFX_Matrix* pMatrix); + void DrawCheckSign(IFWL_Widget *pWidget, CFX_Graphics *pGraphics, const CFX_RectF *pRtBox, int32_t iState, CFX_Matrix* pMatrix); }; class CXFA_FWLEditTP : public CFWL_EditTP { diff --git a/xfa/src/fxfa/src/app/xfa_rendercontext.cpp b/xfa/src/fxfa/src/app/xfa_rendercontext.cpp index 5447506b24..c89dc3e4a0 100644 --- a/xfa/src/fxfa/src/app/xfa_rendercontext.cpp +++ b/xfa/src/fxfa/src/app/xfa_rendercontext.cpp @@ -27,7 +27,7 @@ CXFA_RenderContext::~CXFA_RenderContext() { StopRender(); } -FX_INT32 CXFA_RenderContext::StartRender(IXFA_PageView* pPageView, CFX_Graphics* pGS, const CFX_Matrix& matrix, const CXFA_RenderOptions& options) +int32_t CXFA_RenderContext::StartRender(IXFA_PageView* pPageView, CFX_Graphics* pGS, const CFX_Matrix& matrix, const CXFA_RenderOptions& options) { m_pPageView = pPageView; m_pGS = pGS; @@ -45,9 +45,9 @@ FX_INT32 CXFA_RenderContext::StartRender(IXFA_PageView* pPageView, CFX_Graphics* m_pWidget = m_pWidgetIterator->MoveToNext(); return XFA_RENDERSTATUS_Ready; } -FX_INT32 CXFA_RenderContext::DoRender(IFX_Pause* pPause) +int32_t CXFA_RenderContext::DoRender(IFX_Pause* pPause) { - FX_INT32 iCount = 0; + int32_t iCount = 0; while(m_pWidget) { CXFA_FFWidget* pWidget = (CXFA_FFWidget*)m_pWidget; CFX_RectF rtWidgetBox; diff --git a/xfa/src/fxfa/src/app/xfa_rendercontext.h b/xfa/src/fxfa/src/app/xfa_rendercontext.h index cb514c5cdf..79931b2751 100644 --- a/xfa/src/fxfa/src/app/xfa_rendercontext.h +++ b/xfa/src/fxfa/src/app/xfa_rendercontext.h @@ -15,8 +15,8 @@ public: { delete this; } - virtual FX_INT32 StartRender(IXFA_PageView* pPageView, CFX_Graphics* pGS, const CFX_Matrix& matrix, const CXFA_RenderOptions& options); - virtual FX_INT32 DoRender(IFX_Pause* pPause = NULL); + virtual int32_t StartRender(IXFA_PageView* pPageView, CFX_Graphics* pGS, const CFX_Matrix& matrix, const CXFA_RenderOptions& options); + virtual int32_t DoRender(IFX_Pause* pPause = NULL); virtual void StopRender(); protected: IXFA_WidgetIterator* m_pWidgetIterator; diff --git a/xfa/src/fxfa/src/app/xfa_textlayout.cpp b/xfa/src/fxfa/src/app/xfa_textlayout.cpp index 510b627b21..3043b772b8 100644 --- a/xfa/src/fxfa/src/app/xfa_textlayout.cpp +++ b/xfa/src/fxfa/src/app/xfa_textlayout.cpp @@ -43,13 +43,13 @@ void CXFA_CSSTagProvider::SetAttribute(const CFX_WideString &wsAttr, const CFX_W *pValue = wsValue; m_Attributes.SetAt(pName, pValue); } -void CXFA_TextParseContext::SetDecls(const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount) +void CXFA_TextParseContext::SetDecls(const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount) { if (iDeclCount <= 0 || ppDeclArray == NULL) { return; } m_dwMatchedDecls = iDeclCount; - FX_INT32 iBytes = iDeclCount * sizeof(IFDE_CSSDeclaration*); + int32_t iBytes = iDeclCount * sizeof(IFDE_CSSDeclaration*); m_ppMatchedDecls = (IFDE_CSSDeclaration**)FDE_Alloc(iBytes); FX_memcpy(m_ppMatchedDecls, ppDeclArray, iBytes); } @@ -257,7 +257,7 @@ void CXFA_TextParser::ParseRichText(IFDE_XMLNode *pXMLNode, IFDE_CSSComputedStyl IFDE_CSSAccelerator *pCSSAccel = m_pSelector->InitAccelerator(); pCSSAccel->OnEnterTag(&tagProvider); CFDE_CSSDeclarationArray DeclArray; - FX_INT32 iMatchedDecls = m_pSelector->MatchDeclarations(&tagProvider, DeclArray); + int32_t iMatchedDecls = m_pSelector->MatchDeclarations(&tagProvider, DeclArray); const IFDE_CSSDeclaration **ppMatchDecls = (const IFDE_CSSDeclaration **)DeclArray.GetData(); m_pSelector->ComputeStyle(&tagProvider, ppMatchDecls, iMatchedDecls, pNewStyle); pCSSAccel->OnLeaveTag(&tagProvider); @@ -299,7 +299,7 @@ void CXFA_TextParser::ParseTagInfo(IFDE_XMLNode *pXMLNode, CXFA_CSSTagProvider & pXMLElement->GetLocalTagName(wsName); tagProvider.SetTagNameObj(wsName); FX_DWORD dwHashCode = FX_HashCode_String_GetW(wsName, wsName.GetLength(), TRUE); - static const FX_INT32 s_iCount = sizeof(s_XFATagName) / sizeof(FX_DWORD); + static const int32_t s_iCount = sizeof(s_XFATagName) / sizeof(FX_DWORD); CFX_DSPATemplate lookup; tagProvider.m_bTagAviliable = lookup.Lookup(dwHashCode, s_XFATagName, s_iCount) > -1; CFX_WideString wsValue; @@ -312,9 +312,9 @@ void CXFA_TextParser::ParseTagInfo(IFDE_XMLNode *pXMLNode, CXFA_CSSTagProvider & tagProvider.m_bContent = TRUE; } } -FX_INT32 CXFA_TextParser::GetVAlgin(IXFA_TextProvider *pTextProvider) const +int32_t CXFA_TextParser::GetVAlgin(IXFA_TextProvider *pTextProvider) const { - FX_INT32 iAlign = XFA_ATTRIBUTEENUM_Top; + int32_t iAlign = XFA_ATTRIBUTEENUM_Top; CXFA_Para para = pTextProvider->GetParaNode(); if (para.IsExistInXML()) { iAlign = para.GetVerticalAlign(); @@ -330,7 +330,7 @@ FX_FLOAT CXFA_TextParser::GetTabInterval(IFDE_CSSComputedStyle *pStyle) const } return 36; } -FX_INT32 CXFA_TextParser::CountTabs(IFDE_CSSComputedStyle *pStyle) const +int32_t CXFA_TextParser::CountTabs(IFDE_CSSComputedStyle *pStyle) const { CFX_WideString wsValue; if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"xfa-tab-count"), wsValue)) { @@ -363,7 +363,7 @@ IFX_Font* CXFA_TextParser::GetFont(IXFA_TextProvider *pTextProvider, IFDE_CSSCom } if (pStyle) { IFDE_CSSFontStyle *pFontStyle = pStyle->GetFontStyles(); - FX_INT32 iCount = pFontStyle->CountFontFamilies(); + int32_t iCount = pFontStyle->CountFontFamilies(); if (iCount > 0) { wsFamily = pFontStyle->GetFontFamily(iCount - 1); } @@ -391,7 +391,7 @@ FX_FLOAT CXFA_TextParser::GetFontSize(IXFA_TextProvider *pTextProvider, IFDE_CSS } return 10; } -FX_INT32 CXFA_TextParser::GetHorScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, IFDE_XMLNode *pXMLNode) const +int32_t CXFA_TextParser::GetHorScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, IFDE_XMLNode *pXMLNode) const { if (pStyle != NULL) { CFX_WideString wsValue; @@ -407,11 +407,11 @@ FX_INT32 CXFA_TextParser::GetHorScale(IXFA_TextProvider *pTextProvider, IFDE_CSS } } if (CXFA_Font font = pTextProvider->GetFontNode()) { - return (FX_INT32)font.GetHorizontalScale(); + return (int32_t)font.GetHorizontalScale(); } return 100; } -FX_INT32 CXFA_TextParser::GetVerScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const +int32_t CXFA_TextParser::GetVerScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const { if (pStyle != NULL) { CFX_WideString wsValue; @@ -420,11 +420,11 @@ FX_INT32 CXFA_TextParser::GetVerScale(IXFA_TextProvider *pTextProvider, IFDE_CSS } } if (CXFA_Font font = pTextProvider->GetFontNode()) { - return (FX_INT32)font.GetVerticalScale(); + return (int32_t)font.GetVerticalScale(); } return 100; } -void CXFA_TextParser::GetUnderline(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, FX_INT32 &iUnderline, FX_INT32 &iPeriod) const +void CXFA_TextParser::GetUnderline(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, int32_t &iUnderline, int32_t &iPeriod) const { iUnderline = 0; iPeriod = XFA_ATTRIBUTEENUM_All; @@ -451,7 +451,7 @@ void CXFA_TextParser::GetUnderline(IXFA_TextProvider *pTextProvider, IFDE_CSSCom } } } -void CXFA_TextParser::GetLinethrough(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, FX_INT32 &iLinethrough) const +void CXFA_TextParser::GetLinethrough(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, int32_t &iLinethrough) const { if (pStyle) { FX_DWORD dwDecoration = pStyle->GetParagraphStyles()->GetTextDecoration(); @@ -572,10 +572,10 @@ FX_BOOL CXFA_TextParser::GetTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_TextTab && !pStyle->GetCustomStyle(FX_WSTRC(L"tab-stops"), wsValue)) { return FALSE; } - FX_INT32 iLength = wsValue.GetLength(); + int32_t iLength = wsValue.GetLength(); FX_LPCWSTR pTabStops = wsValue; - FX_INT32 iCur = 0; - FX_INT32 iLast = 0; + int32_t iCur = 0; + int32_t iLast = 0; CFX_WideString wsAlign; XFA_TABSTOPSSTATUS eStatus = XFA_TABSTOPSSTATUS_None; FX_WCHAR ch; @@ -607,7 +607,7 @@ FX_BOOL CXFA_TextParser::GetTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_TextTab if (ch != 'l') { eStatus = XFA_TABSTOPSSTATUS_Location; } else { - FX_INT32 iCount = 0; + int32_t iCount = 0; while (iCur < iLength) { ch = pTabStops[iCur]; iCur++; @@ -679,8 +679,8 @@ CXFA_TextLayout::~CXFA_TextLayout() } void CXFA_TextLayout::Unload() { - FX_INT32 iCount = m_pieceLines.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = m_pieceLines.GetSize(); + for (int32_t i = 0; i < iCount; i++) { CXFA_PieceLine *pLine = m_pieceLines.GetAt(i); FDE_DeleteWith(CXFA_PieceLine, m_pAllocator, pLine); } @@ -752,7 +752,7 @@ void CXFA_TextLayout::InitBreak(FX_FLOAT fLineWidth) FX_FLOAT fStart = 0; FX_FLOAT fStartPos = 0; if (para.IsExistInXML()) { - FX_INT32 iAlign = FX_RTFLINEALIGNMENT_Left; + int32_t iAlign = FX_RTFLINEALIGNMENT_Left; switch (para.GetHorizontalAlign()) { case XFA_ATTRIBUTEENUM_Center: iAlign = FX_RTFLINEALIGNMENT_Center; @@ -788,8 +788,8 @@ void CXFA_TextLayout::InitBreak(FX_FLOAT fLineWidth) m_pBreak->SetLineWidth(fStart, fLineWidth); m_pBreak->SetLinePos(fStartPos); if (font.IsExistInXML()) { - m_pBreak->SetHorizontalScale((FX_INT32)font.GetHorizontalScale()); - m_pBreak->SetVerticalScale((FX_INT32)font.GetVerticalScale()); + m_pBreak->SetHorizontalScale((int32_t)font.GetHorizontalScale()); + m_pBreak->SetVerticalScale((int32_t)font.GetVerticalScale()); m_pBreak->SetCharSpace(font.GetLetterSpacing()); } FX_FLOAT fFontSize = m_textParser.GetFontSize(m_pTextProvider, NULL); @@ -805,7 +805,7 @@ void CXFA_TextLayout::InitBreak(IFDE_CSSComputedStyle *pStyle, FDE_CSSDISPLAY eD } IFDE_CSSParagraphStyle *pParaStyle = pStyle->GetParagraphStyles(); if (eDisplay == FDE_CSSDISPLAY_Block || eDisplay == FDE_CSSDISPLAY_ListItem) { - FX_INT32 iAlign = FX_RTFLINEALIGNMENT_Left; + int32_t iAlign = FX_RTFLINEALIGNMENT_Left; switch (pParaStyle->GetTextAlign()) { case FDE_CSSTEXTALIGN_Right: iAlign = FX_RTFLINEALIGNMENT_Right; @@ -863,7 +863,7 @@ void CXFA_TextLayout::InitBreak(IFDE_CSSComputedStyle *pStyle, FDE_CSSDISPLAY eD m_pTabstopContext = FX_NEW CXFA_TextTabstopsContext; } m_textParser.GetTabstops(pStyle, m_pTabstopContext); - for (FX_INT32 i = 0; i < m_pTabstopContext->m_iTabCount; i++) { + for (int32_t i = 0; i < m_pTabstopContext->m_iTabCount; i++) { XFA_TABSTOPS *pTab = m_pTabstopContext->m_tabstops.GetDataPtr(i); m_pBreak->AddPositionedTab(pTab->fTabstops); } @@ -876,7 +876,7 @@ void CXFA_TextLayout::InitBreak(IFDE_CSSComputedStyle *pStyle, FDE_CSSDISPLAY eD m_pBreak->SetVerticalScale(m_textParser.GetVerScale(m_pTextProvider, pStyle)); m_pBreak->SetCharSpace(pParaStyle->GetLetterSpacing().GetValue()); } -FX_INT32 CXFA_TextLayout::GetText(CFX_WideString &wsText) +int32_t CXFA_TextLayout::GetText(CFX_WideString &wsText) { GetTextDataNode(); wsText.Empty(); @@ -891,7 +891,7 @@ FX_FLOAT CXFA_TextLayout::GetLayoutHeight() if (m_pLoader == NULL) { return 0; } - FX_INT32 iCount = m_pLoader->m_lineHeights.GetSize(); + int32_t iCount = m_pLoader->m_lineHeights.GetSize(); if (iCount == 0 && m_pLoader->m_fWidth > 0) { CFX_SizeF szMax, szDef; szMax.Set(m_pLoader->m_fWidth, m_pLoader->m_fHeight); @@ -905,7 +905,7 @@ FX_FLOAT CXFA_TextLayout::GetLayoutHeight() FX_FLOAT fHeight = m_pLoader->m_fHeight; if (fHeight < 0.1f) { fHeight = 0; - for (FX_INT32 i = 0; i < iCount; i++) { + for (int32_t i = 0; i < iCount; i++) { fHeight += m_pLoader->m_lineHeights.ElementAt(i); } } @@ -935,12 +935,12 @@ FX_FLOAT CXFA_TextLayout::StartLayout(FX_FLOAT fWidth ) } return fWidth; } -FX_BOOL CXFA_TextLayout::DoLayout(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight, FX_FLOAT fContentAreaHeight , FX_FLOAT fTextHeight ) +FX_BOOL CXFA_TextLayout::DoLayout(int32_t iBlockIndex, FX_FLOAT &fCalcHeight, FX_FLOAT fContentAreaHeight , FX_FLOAT fTextHeight ) { if (m_pLoader == NULL) { return FALSE; } - FX_INT32 iBlockCount = m_Blocks.GetSize(); + int32_t iBlockCount = m_Blocks.GetSize(); FX_FLOAT fHeight = fTextHeight; if (fHeight < 0) { fHeight = GetLayoutHeight(); @@ -953,7 +953,7 @@ FX_BOOL CXFA_TextLayout::DoLayout(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight, F if (iBlockCount == 0 && fHeight > 0) { fHeight = fTextHeight - GetLayoutHeight(); if (fHeight > 0) { - FX_INT32 iAlign = m_textParser.GetVAlgin(m_pTextProvider); + int32_t iAlign = m_textParser.GetVAlgin(m_pTextProvider); if (iAlign == XFA_ATTRIBUTEENUM_Middle) { fHeight /= 2.0f; } else if (iAlign != XFA_ATTRIBUTEENUM_Bottom) { @@ -963,7 +963,7 @@ FX_BOOL CXFA_TextLayout::DoLayout(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight, F } } FX_FLOAT fLinePos = m_pLoader->m_fStartLineOffset; - FX_INT32 iLineIndex = 0; + int32_t iLineIndex = 0; if (iBlockCount > 1) { if (iBlockCount >= (iBlockIndex + 1) * 2) { iLineIndex = m_Blocks.ElementAt(iBlockIndex * 2); @@ -971,13 +971,13 @@ FX_BOOL CXFA_TextLayout::DoLayout(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight, F iLineIndex = m_Blocks.ElementAt(iBlockCount - 1) + m_Blocks.ElementAt(iBlockCount - 2); } if (m_pLoader->m_BlocksHeight.GetSize() > 0) { - for (FX_INT32 i = 0; i < iBlockIndex; i++) { + for (int32_t i = 0; i < iBlockIndex; i++) { fLinePos -= m_pLoader->m_BlocksHeight.ElementAt(i * 2 + 1); } } } - FX_INT32 iCount = m_pLoader->m_lineHeights.GetSize(); - FX_INT32 i = 0; + int32_t iCount = m_pLoader->m_lineHeights.GetSize(); + int32_t i = 0; for (i = iLineIndex; i < iCount; i++) { FX_FLOAT fLineHeight = m_pLoader->m_lineHeights.ElementAt(i); if ((i == iLineIndex) && (fLineHeight - fContentAreaHeight > 0.001)) { @@ -1010,9 +1010,9 @@ FX_BOOL CXFA_TextLayout::DoLayout(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight, F } return FALSE; } -FX_INT32 CXFA_TextLayout::CountBlocks() const +int32_t CXFA_TextLayout::CountBlocks() const { - FX_INT32 iCount = m_Blocks.GetSize() / 2; + 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) @@ -1063,7 +1063,7 @@ FX_BOOL CXFA_TextLayout::Layout(const CFX_SizeF &size, FX_FLOAT* fHeight) } return TRUE; } -FX_BOOL CXFA_TextLayout::Layout(FX_INT32 iBlock) +FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) { if (m_pLoader == NULL || iBlock < 0 || iBlock >= CountBlocks()) { return FALSE; @@ -1077,8 +1077,8 @@ FX_BOOL CXFA_TextLayout::Layout(FX_INT32 iBlock) CXFA_Node *pNode = NULL; CFX_SizeF szText; szText.Set(m_pLoader->m_fWidth, m_pLoader->m_fHeight); - FX_INT32 iCount = m_Blocks.GetSize(); - FX_INT32 iBlocksHeightCount = m_pLoader->m_BlocksHeight.GetSize(); + int32_t iCount = m_Blocks.GetSize(); + int32_t iBlocksHeightCount = m_pLoader->m_BlocksHeight.GetSize(); iBlocksHeightCount /= 2; if (iBlock < iBlocksHeightCount) { return TRUE; @@ -1087,7 +1087,7 @@ FX_BOOL CXFA_TextLayout::Layout(FX_INT32 iBlock) Unload(); m_pBreak = CreateBreak(TRUE); fLinePos = m_pLoader->m_fStartLineOffset; - for (FX_INT32 i = 0; i < iBlocksHeightCount; i++) { + for (int32_t i = 0; i < iBlocksHeightCount; i++) { fLinePos -= m_pLoader->m_BlocksHeight.ElementAt(i * 2 + 1); } m_pLoader->m_iChar = 0; @@ -1161,24 +1161,24 @@ FX_BOOL CXFA_TextLayout::Layout(FX_INT32 iBlock) } return TRUE; } -void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, FX_INT32 iBlockIndex) +void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex) { if (!m_pLoader) { return; } - FX_INT32 iCountHeight = m_pLoader->m_lineHeights.GetSize(); + int32_t iCountHeight = m_pLoader->m_lineHeights.GetSize(); if (iCountHeight == 0) { return; } FX_BOOL bEndItem = TRUE; - FX_INT32 iBlockCount = m_Blocks.GetSize(); + int32_t iBlockCount = m_Blocks.GetSize(); FX_FLOAT fLinePos = m_pLoader->m_fStartLineOffset; - FX_INT32 iLineIndex = 0; + int32_t iLineIndex = 0; if (iBlockIndex > 0) { - FX_INT32 iBlockHeightCount = m_pLoader->m_BlocksHeight.GetSize(); + int32_t iBlockHeightCount = m_pLoader->m_BlocksHeight.GetSize(); iBlockHeightCount /= 2; if (iBlockHeightCount >= iBlockIndex) { - for (FX_INT32 i = 0; i < iBlockIndex; i++) { + for (int32_t i = 0; i < iBlockIndex; i++) { fLinePos -= m_pLoader->m_BlocksHeight.ElementAt(i * 2 + 1); } } else { @@ -1186,7 +1186,7 @@ void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, FX_INT32 iBlockIndex) } iLineIndex = m_Blocks.ElementAt(iBlockCount - 1) + m_Blocks.ElementAt(iBlockCount - 2); } - FX_INT32 i = 0; + int32_t i = 0; for (i = iLineIndex; i < iCountHeight; i++) { FX_FLOAT fLineHeight = m_pLoader->m_lineHeights.ElementAt(i); if (fLinePos + fLineHeight - rtText.height > 0.001) { @@ -1202,7 +1202,7 @@ void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, FX_INT32 iBlockIndex) m_Blocks.Add(i - iLineIndex); } } -FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice *pFxDevice, const CFX_Matrix &tmDoc2Device, const CFX_RectF &rtClip, FX_INT32 iBlock ) +FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice *pFxDevice, const CFX_Matrix &tmDoc2Device, const CFX_RectF &rtClip, int32_t iBlock ) { IFDE_RenderDevice *pDevice = IFDE_RenderDevice::Create(pFxDevice); if (pDevice == NULL) { @@ -1214,16 +1214,16 @@ FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice *pFxDevice, const CFX_Matri IFDE_Pen *pPen = IFDE_Pen::Create(); FXSYS_assert(pDevice != NULL && pSolidBrush != NULL && pPen != NULL); if (m_pieceLines.GetSize() == 0) { - FX_INT32 iBlockCount = CountBlocks(); - for (FX_INT32 i = 0; i < iBlockCount; i++) { + int32_t iBlockCount = CountBlocks(); + for (int32_t i = 0; i < iBlockCount; i++) { Layout(i); } } FXTEXT_CHARPOS *pCharPos = NULL; - FX_INT32 iCharCount = 0; - FX_INT32 iLineStart = 0; - FX_INT32 iPieceLines = m_pieceLines.GetSize(); - FX_INT32 iCount = m_Blocks.GetSize(); + int32_t iCharCount = 0; + int32_t iLineStart = 0; + int32_t iPieceLines = m_pieceLines.GetSize(); + int32_t iCount = m_Blocks.GetSize(); if (iCount > 0) { iBlock *= 2; if (iBlock < iCount) { @@ -1233,16 +1233,16 @@ FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice *pFxDevice, const CFX_Matri iPieceLines = 0; } } - for (FX_INT32 i = 0; i < iPieceLines; i++) { + for (int32_t i = 0; i < iPieceLines; i++) { if(i + iLineStart >= m_pieceLines.GetSize()) { break; } CXFA_PieceLine *pPieceLine = m_pieceLines.GetAt(i + iLineStart); - FX_INT32 iPieces = pPieceLine->m_textPieces.GetSize(); - FX_INT32 j = 0; + int32_t iPieces = pPieceLine->m_textPieces.GetSize(); + int32_t j = 0; for (j = 0; j < iPieces; j++) { XFA_LPCTEXTPIECE pPiece = pPieceLine->m_textPieces.GetAt(j); - FX_INT32 iChars = pPiece->iChars; + int32_t iChars = pPiece->iChars; if (iCharCount < iChars) { if (pCharPos != NULL) { FDE_Free(pCharPos); @@ -1281,11 +1281,11 @@ void CXFA_TextLayout::UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom) default: return; } - FX_INT32 iCount = m_pieceLines.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = m_pieceLines.GetSize(); + for (int32_t i = 0; i < iCount; i++) { CXFA_PieceLine *pPieceLine = m_pieceLines.GetAt(i); - FX_INT32 iPieces = pPieceLine->m_textPieces.GetSize(); - for (FX_INT32 j = 0; j < iPieces; j++) { + int32_t iPieces = pPieceLine->m_textPieces.GetSize(); + for (int32_t j = 0; j < iPieces; j++) { XFA_LPTEXTPIECE pPiece = pPieceLine->m_textPieces.GetAt(j); CFX_RectF &rect = pPiece->rtPiece; rect.top += fHeight; @@ -1326,7 +1326,7 @@ void CXFA_TextLayout::LoadText(CXFA_Node *pNode, const CFX_SizeF &szText, FX_FLO if (fSpaceAbove < 0.1f) { fSpaceAbove = 0; } - FX_INT32 verAlign = para.GetVerticalAlign(); + int32_t verAlign = para.GetVerticalAlign(); switch (verAlign) { case XFA_ATTRIBUTEENUM_Top: case XFA_ATTRIBUTEENUM_Middle: @@ -1345,7 +1345,7 @@ void CXFA_TextLayout::LoadText(CXFA_Node *pNode, const CFX_SizeF &szText, FX_FLO EndBreak(FX_RTFBREAK_ParagraphBreak, fLinePos, bSavePieces); } } -FX_BOOL CXFA_TextLayout::LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF &szText, FX_FLOAT &fLinePos, IFDE_CSSComputedStyle *pParentStyle, FX_BOOL bSavePieces, CXFA_LinkUserData* pLinkData, FX_BOOL bEndBreak, FX_BOOL bIsOl, FX_INT32 iLiCount) +FX_BOOL CXFA_TextLayout::LoadRichText(IFDE_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) { if (pXMLNode == NULL) { return FALSE; @@ -1398,7 +1398,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF & wsLinkContent.ReleaseBuffer(wsLinkContent.GetLength()); } } - FX_INT32 iTabCount = m_textParser.CountTabs(bContentNode ? pParentStyle : pStyle); + int32_t iTabCount = m_textParser.CountTabs(bContentNode ? pParentStyle : pStyle); FX_BOOL bSpaceRun = m_textParser.IsSpaceRun(bContentNode ? pParentStyle : pStyle); CFX_WideString wsText; if (bContentNode && iTabCount == 0) { @@ -1421,7 +1421,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF & m_textParser.GetEmbbedObj(m_pTextProvider, pXMLNode, wsText); } } - FX_INT32 iLength = wsText.GetLength(); + int32_t iLength = wsText.GetLength(); if (iLength > 0 && bContentNode && !bSpaceRun) { ProcessText(wsText); } @@ -1527,12 +1527,12 @@ FX_BOOL CXFA_TextLayout::LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF & FX_BOOL CXFA_TextLayout::AppendChar(const CFX_WideString &wsText, FX_FLOAT &fLinePos, FX_FLOAT fSpaceAbove, FX_BOOL bSavePieces) { FX_DWORD dwStatus = 0; - FX_INT32 iChar = 0; + int32_t iChar = 0; if (m_pLoader) { iChar = m_pLoader->m_iChar; } - FX_INT32 iLength = wsText.GetLength(); - for (FX_INT32 i = iChar; i < iLength; i++) { + int32_t iLength = wsText.GetLength(); + for (int32_t i = iChar; i < iLength; i++) { FX_WCHAR wch = wsText.GetAt(i); if (wch == 0xA0) { wch = 0x20; @@ -1567,14 +1567,14 @@ FX_BOOL CXFA_TextLayout::IsEnd(FX_BOOL bSavePieces) } void CXFA_TextLayout::ProcessText(CFX_WideString &wsText) { - FX_INT32 iLen = wsText.GetLength(); + int32_t iLen = wsText.GetLength(); if (iLen == 0) { return; } FX_LPWSTR psz = wsText.GetBuffer(iLen); - FX_INT32 iTrimLeft = 0; + int32_t iTrimLeft = 0; FX_WCHAR wch = 0, wPrev = 0; - for (FX_INT32 i = 0; i < iLen; i++) { + for (int32_t i = 0; i < iLen; i++) { wch = psz[i]; if (wch < 0x20) { wch = 0x20; @@ -1603,13 +1603,13 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_PieceLine * if (pStyle == NULL || pPieceLine == NULL) { return; } - FX_INT32 iPieces = pPieceLine->m_textPieces.GetSize(); + int32_t iPieces = pPieceLine->m_textPieces.GetSize(); if (iPieces == 0) { return; } XFA_LPTEXTPIECE pPiece = pPieceLine->m_textPieces.GetAt(iPieces - 1); - FX_INT32 &iTabstopsIndex = m_pTabstopContext->m_iTabIndex; - FX_INT32 iCount = m_textParser.CountTabs(pStyle); + int32_t &iTabstopsIndex = m_pTabstopContext->m_iTabIndex; + int32_t iCount = m_textParser.CountTabs(pStyle); if (iTabstopsIndex > m_pTabstopContext->m_iTabCount - 1) { return; } @@ -1633,8 +1633,8 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_PieceLine * || dwAlgin == FX_HashCode_String_GetW(L"before", 6)) { fLeft = pPiece->rtPiece.width; } else if (dwAlgin == FX_HashCode_String_GetW(L"decimal", 7)) { - FX_INT32 iChars = pPiece->iChars; - for (FX_INT32 i = 0; i < iChars; i++) { + int32_t iChars = pPiece->iChars; + for (int32_t i = 0; i < iChars; i++) { if (pPiece->pszText[i] == L'.') { break; } @@ -1650,7 +1650,7 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_PieceLine * } void CXFA_TextLayout::AppendTextLine(FX_DWORD dwStatus, FX_FLOAT &fLinePos, FX_BOOL bSavePieces, FX_BOOL bEndBreak) { - FX_INT32 iPieces = m_pBreak->CountBreakPieces(); + int32_t iPieces = m_pBreak->CountBreakPieces(); if (iPieces < 1) { return; } @@ -1662,7 +1662,7 @@ void CXFA_TextLayout::AppendTextLine(FX_DWORD dwStatus, FX_FLOAT &fLinePos, FX_B m_pTabstopContext->Reset(); } FX_FLOAT fLineStep = 0, fBaseLine = 0; - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < iPieces; i++) { const CFX_RTFPiece *pPiece = m_pBreak->GetBreakPiece(i); CXFA_TextUserData *pUserData = (CXFA_TextUserData*)pPiece->m_pUserData; @@ -1672,7 +1672,7 @@ void CXFA_TextLayout::AppendTextLine(FX_DWORD dwStatus, FX_FLOAT &fLinePos, FX_B FX_FLOAT fVerScale = pPiece->m_iVerticalScale / 100.0f; XFA_LPTEXTPIECE pTP = (XFA_LPTEXTPIECE)m_pAllocator->Alloc(sizeof(XFA_TEXTPIECE)); pTP->pszText = (FX_LPWSTR)m_pAllocator->Alloc(pPiece->m_iChars * sizeof(FX_WCHAR)); - pTP->pWidths = (FX_INT32*)m_pAllocator->Alloc(pPiece->m_iChars * sizeof(FX_INT32)); + pTP->pWidths = (int32_t*)m_pAllocator->Alloc(pPiece->m_iChars * sizeof(int32_t)); pTP->iChars = pPiece->m_iChars; pPiece->GetString(pTP->pszText); pPiece->GetWidths(pTP->pWidths); @@ -1721,7 +1721,7 @@ void CXFA_TextLayout::AppendTextLine(FX_DWORD dwStatus, FX_FLOAT &fLinePos, FX_B } else { FX_FLOAT fLineStep = 0; FX_FLOAT fLineWidth = 0; - for (FX_INT32 i = 0; i < iPieces; i++) { + for (int32_t i = 0; i < iPieces; i++) { const CFX_RTFPiece *pPiece = m_pBreak->GetBreakPiece(i); CXFA_TextUserData *pUserData = (CXFA_TextUserData*)pPiece->m_pUserData; if (pUserData != NULL) { @@ -1781,17 +1781,17 @@ void CXFA_TextLayout::AppendTextLine(FX_DWORD dwStatus, FX_FLOAT &fLinePos, FX_B } m_iLines++; } -void CXFA_TextLayout::RenderString(IFDE_RenderDevice *pDevice, IFDE_SolidBrush *pBrush, CXFA_PieceLine *pPieceLine, FX_INT32 iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device) +void CXFA_TextLayout::RenderString(IFDE_RenderDevice *pDevice, IFDE_SolidBrush *pBrush, CXFA_PieceLine *pPieceLine, int32_t iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device) { XFA_LPCTEXTPIECE pPiece = pPieceLine->m_textPieces.GetAt(iPiece); - FX_INT32 iCount = GetDisplayPos(pPiece, pCharPos); + int32_t iCount = GetDisplayPos(pPiece, pCharPos); if (iCount > 0) { pBrush->SetColor(pPiece->dwColor); pDevice->DrawString(pBrush, pPiece->pFont, pCharPos, iCount, pPiece->fFontSize, &tmDoc2Device); } pPieceLine->m_charCounts.Add(iCount); } -void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXFA_PieceLine *pPieceLine, FX_INT32 iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device) +void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXFA_PieceLine *pPieceLine, int32_t iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device) { XFA_TEXTPIECE *pPiece = pPieceLine->m_textPieces.GetAt(iPiece); FX_BOOL bNoUnderline = pPiece->iUnderline < 1 || pPiece->iUnderline > 2; @@ -1801,14 +1801,14 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXF } pPen->SetColor(pPiece->dwColor); IFDE_Path *pPath = IFDE_Path::Create(); - FX_INT32 iChars = GetDisplayPos(pPiece, pCharPos); + int32_t iChars = GetDisplayPos(pPiece, pCharPos); if (iChars > 0) { CFX_PointF pt1, pt2; FX_FLOAT fEndY = pCharPos[0].m_OriginY + 1.05f; - FX_INT32 i = 0; + int32_t i = 0; if (pPiece->iPeriod == XFA_ATTRIBUTEENUM_Word) { - for (FX_INT32 i = 0; i < pPiece->iUnderline; i++) { - for (FX_INT32 j = 0; j < iChars; j++) { + for (int32_t i = 0; i < pPiece->iUnderline; i++) { + for (int32_t j = 0; j < iChars; j++) { pt1.x = pCharPos[j].m_OriginX; pt2.x = pt1.x + pCharPos[j].m_FontCharWidth * pPiece->fFontSize / 1000.0f; pt1.y = pt2.y = fEndY; @@ -1819,7 +1819,7 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXF } else { pt1.x = pCharPos[0].m_OriginX; pt2.x = pCharPos[iChars - 1].m_OriginX + pCharPos[iChars - 1].m_FontCharWidth * pPiece->fFontSize / 1000.0f; - for (FX_INT32 i = 0; i < pPiece->iUnderline; i++) { + for (int32_t i = 0; i < pPiece->iUnderline; i++) { pt1.y = pt2.y = fEndY; pPath->AddLine(pt1, pt2); fEndY += 2.0f; @@ -1837,8 +1837,8 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXF if (bNoLineThrough && (bNoUnderline || pPiece->iPeriod != XFA_ATTRIBUTEENUM_All)) { goto XFA_RenderPathRet; } - FX_INT32 iCharsTmp = 0; - FX_INT32 iPiecePrev = iPiece, iPieceNext = iPiece; + int32_t iCharsTmp = 0; + int32_t iPiecePrev = iPiece, iPieceNext = iPiece; while (iPiecePrev > 0) { iPiecePrev--; iCharsTmp = pPieceLine->m_charCounts.GetAt(iPiecePrev); @@ -1850,7 +1850,7 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXF goto XFA_RenderPathRet; } iCharsTmp = 0; - FX_INT32 iPieces = pPieceLine->m_textPieces.GetSize(); + int32_t iPieces = pPieceLine->m_textPieces.GetSize(); while (iPieceNext < iPieces - 1) { iPieceNext++; iCharsTmp = pPieceLine->m_charCounts.GetAt(iPieceNext); @@ -1877,7 +1877,7 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXF CFX_PointF pt1, pt2; pt1.x = fOrgX, pt2.x = fEndX; FX_FLOAT fEndY = pCharPos[0].m_OriginY + 1.05f; - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < pPiece->iUnderline; i++) { pt1.y = pt2.y = fEndY; pPath->AddLine(pt1, pt2); @@ -1894,7 +1894,7 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXF XFA_RenderPathRet: pPath->Release(); } -FX_INT32 CXFA_TextLayout::GetDisplayPos(XFA_LPCTEXTPIECE pPiece, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode ) +int32_t CXFA_TextLayout::GetDisplayPos(XFA_LPCTEXTPIECE pPiece, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode ) { if (pPiece == NULL) { return 0; @@ -1907,7 +1907,7 @@ FX_INT32 CXFA_TextLayout::GetDisplayPos(XFA_LPCTEXTPIECE pPiece, FXTEXT_CHARPOS } FX_BOOL CXFA_TextLayout::ToRun(XFA_LPCTEXTPIECE pPiece, FX_RTFTEXTOBJ &tr) { - FX_INT32 iLength = pPiece->iChars; + int32_t iLength = pPiece->iChars; if (iLength < 1) { return FALSE; } diff --git a/xfa/src/fxfa/src/app/xfa_textlayout.h b/xfa/src/fxfa/src/app/xfa_textlayout.h index a47189cb3f..96d94956d6 100644 --- a/xfa/src/fxfa/src/app/xfa_textlayout.h +++ b/xfa/src/fxfa/src/app/xfa_textlayout.h @@ -64,7 +64,7 @@ public: { return m_eDisplay; } - void SetDecls(const IFDE_CSSDeclaration **ppDeclArray, FX_INT32 iDeclCount); + void SetDecls(const IFDE_CSSDeclaration **ppDeclArray, int32_t iDeclCount); const IFDE_CSSDeclaration** GetDecls() { return (const IFDE_CSSDeclaration**)m_ppMatchedDecls; @@ -93,17 +93,17 @@ public: return m_pAllocator != NULL; } - FX_INT32 GetVAlgin(IXFA_TextProvider *pTextProvider) const; + int32_t GetVAlgin(IXFA_TextProvider *pTextProvider) const; FX_FLOAT GetTabInterval(IFDE_CSSComputedStyle *pStyle) const; - FX_INT32 CountTabs(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); IFX_Font* GetFont(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const; FX_FLOAT GetFontSize(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const; - FX_INT32 GetHorScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, IFDE_XMLNode *pXMLNode) const; - FX_INT32 GetVerScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const; - void GetUnderline(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, FX_INT32 &iUnderline, FX_INT32 &iPeriod) const; - void GetLinethrough(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, FX_INT32 &iLinethrough) const; + int32_t GetHorScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, IFDE_XMLNode *pXMLNode) const; + int32_t GetVerScale(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const; + void GetUnderline(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, int32_t &iUnderline, int32_t &iPeriod) const; + void GetLinethrough(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, int32_t &iLinethrough) const; FX_ARGB GetColor(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const; FX_FLOAT GetBaseline(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle) const; FX_FLOAT GetLineHeight(IXFA_TextProvider *pTextProvider, IFDE_CSSComputedStyle *pStyle, FX_BOOL bFirst, FX_FLOAT fVerScale) const; @@ -140,9 +140,9 @@ public: FX_FLOAT m_fHeight; FX_FLOAT m_fLastPos; FX_FLOAT m_fStartLineOffset; - FX_INT32 m_iChar; - FX_INT32 m_iLines; - FX_INT32 m_iTotalLines; + int32_t m_iChar; + int32_t m_iLines; + int32_t m_iTotalLines; IFDE_XMLNode *m_pXMLNode; CXFA_Node *m_pNode; IFDE_CSSComputedStyle *m_pParentStyle; @@ -237,14 +237,14 @@ protected: }; typedef struct _XFA_TEXTPIECE : public CFX_Target { FX_LPWSTR pszText; - FX_INT32 iChars; - FX_INT32 *pWidths; - FX_INT32 iHorScale; - FX_INT32 iVerScale; - FX_INT32 iBidiLevel; - FX_INT32 iUnderline; - FX_INT32 iPeriod; - FX_INT32 iLineThrough; + int32_t iChars; + int32_t *pWidths; + int32_t iHorScale; + int32_t iVerScale; + int32_t iBidiLevel; + int32_t iUnderline; + int32_t iPeriod; + int32_t iLineThrough; IFX_Font *pFont; FX_ARGB dwColor; FX_FLOAT fFontSize; @@ -284,7 +284,7 @@ public: CXFA_TextTabstopsContext() : m_iTabCount(0), m_iTabIndex(-1), m_bTabstops(FALSE), m_fTabWidth(0), m_fLeft(0) {} void Append(FX_DWORD dwAlign, FX_FLOAT fTabstops) { - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < m_iTabCount; i++) { XFA_TABSTOPS *pTabstop = m_tabstops.GetDataPtr(i); if (fTabstops < pTabstop->fTabstops) { @@ -311,8 +311,8 @@ public: m_fLeft = 0; } CFX_ArrayTemplate m_tabstops; - FX_INT32 m_iTabCount; - FX_INT32 m_iTabIndex; + int32_t m_iTabCount; + int32_t m_iTabIndex; FX_BOOL m_bTabstops; FX_FLOAT m_fTabWidth; FX_FLOAT m_fLeft; @@ -322,15 +322,15 @@ class CXFA_TextLayout public: CXFA_TextLayout(IXFA_TextProvider *pTextProvider); virtual ~CXFA_TextLayout(); - FX_INT32 GetText(CFX_WideString &wsText); + int32_t GetText(CFX_WideString &wsText); FX_FLOAT GetLayoutHeight(); FX_FLOAT StartLayout(FX_FLOAT fWidth = -1); - FX_BOOL DoLayout(FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeight, FX_FLOAT fContentAreaHeight = -1, FX_FLOAT fTextHeight = -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 = NULL); - void ItemBlocks(const CFX_RectF& rtText, FX_INT32 iBlockIndex); - FX_BOOL DrawString(CFX_RenderDevice *pFxDevice, const CFX_Matrix &tmDoc2Device, const CFX_RectF &rtClip, FX_INT32 iBlock = 0); + 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 { @@ -347,7 +347,7 @@ private: FX_BOOL Loader(const CFX_SizeF &szText, FX_FLOAT &fLinePos, FX_BOOL bSavePieces = TRUE); void LoadText(CXFA_Node *pNode, const CFX_SizeF &szText, FX_FLOAT &fLinePos, FX_BOOL bSavePieces); - FX_BOOL LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF &szText, FX_FLOAT &fLinePos, IFDE_CSSComputedStyle *pParentStyle, FX_BOOL bSavePieces, CXFA_LinkUserData* pLinkData = NULL, FX_BOOL bEndBreak = TRUE, FX_BOOL bIsOl = FALSE, FX_INT32 iLiCount = 0); + FX_BOOL LoadRichText(IFDE_XMLNode *pXMLNode, const CFX_SizeF &szText, FX_FLOAT &fLinePos, IFDE_CSSComputedStyle *pParentStyle, FX_BOOL bSavePieces, CXFA_LinkUserData* pLinkData = NULL, 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); @@ -359,16 +359,16 @@ private: void UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom); void RenderString(IFDE_RenderDevice *pDevice, IFDE_SolidBrush *pBrush, CXFA_PieceLine *pPieceLine, - FX_INT32 iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device); - void RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXFA_PieceLine *pPieceLine, FX_INT32 iPiece, + int32_t iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device); + void RenderPath(IFDE_RenderDevice *pDevice, IFDE_Pen *pPen, CXFA_PieceLine *pPieceLine, int32_t iPiece, FXTEXT_CHARPOS *pCharPos, const CFX_Matrix &tmDoc2Device); - FX_INT32 GetDisplayPos(XFA_LPCTEXTPIECE pPiece, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE); + int32_t GetDisplayPos(XFA_LPCTEXTPIECE pPiece, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE); FX_BOOL ToRun(XFA_LPCTEXTPIECE pPiece, FX_RTFTEXTOBJ &tr); void DoTabstops(IFDE_CSSComputedStyle *pStyle, CXFA_PieceLine *pPieceLine); - FX_BOOL Layout(FX_INT32 iBlock); - FX_INT32 CountBlocks() const; + FX_BOOL Layout(int32_t iBlock); + int32_t CountBlocks() const; IXFA_TextProvider *m_pTextProvider; CXFA_Node *m_pTextDataNode; FX_BOOL m_bRichText; @@ -377,7 +377,7 @@ private: FX_DWORD m_dwTextData; CXFA_LoaderContext *m_pLoader; - FX_INT32 m_iLines; + int32_t m_iLines; FX_FLOAT m_fMaxWidth; CXFA_TextParser m_textParser; diff --git a/xfa/src/fxfa/src/common/fxfa_localevalue.h b/xfa/src/fxfa/src/common/fxfa_localevalue.h index b6a3db5096..c9cec57336 100644 --- a/xfa/src/fxfa/src/common/fxfa_localevalue.h +++ b/xfa/src/fxfa/src/common/fxfa_localevalue.h @@ -37,8 +37,8 @@ public: FX_BOOL ValidateCanonicalDate(const CFX_WideString& wsDate, CFX_Unitime& unDate); FX_BOOL ValidateCanonicalTime(const CFX_WideString& wsTime); FX_BOOL ValidateCanonicalDateTime(const CFX_WideString& wsDateTime); - void GetNumbericFormat(CFX_WideString &wsFormat, FX_INT32 nIntLen, FX_INT32 nDecLen, FX_BOOL bSign = TRUE); - FX_BOOL ValidateNumericTemp(CFX_WideString& wsNumeric, CFX_WideString& wsFormat, IFX_Locale* pLocale = NULL, FX_INT32* pos = NULL); + 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 = NULL, int32_t* pos = NULL); CFX_WideString GetValue() const; FX_DWORD GetType() const; diff --git a/xfa/src/fxfa/src/common/xfa_doclayout.h b/xfa/src/fxfa/src/common/xfa_doclayout.h index d5aaaa9cf8..d360faa62c 100644 --- a/xfa/src/fxfa/src/common/xfa_doclayout.h +++ b/xfa/src/fxfa/src/common/xfa_doclayout.h @@ -15,8 +15,8 @@ public: IXFA_LayoutPage* GetPage() const; CXFA_Node* GetFormNode() const; void GetRect(CFX_RectF &rtLayout, FX_BOOL bRelative = FALSE) const; - FX_INT32 GetIndex() const; - FX_INT32 GetCount() const; + int32_t GetIndex() const; + int32_t GetCount() const; CXFA_LayoutItem* GetParent() const; CXFA_LayoutItem* GetFirst() const; CXFA_LayoutItem* GetPrev() const; @@ -88,7 +88,7 @@ class IXFA_LayoutPage { public: IXFA_DocLayout* GetLayout() const; - FX_INT32 GetPageIndex() const; + int32_t GetPageIndex() const; void GetPageSize(CFX_SizeF &size); CXFA_Node* GetMasterPage() const; }; @@ -96,11 +96,11 @@ class IXFA_DocLayout { public: virtual CXFA_Document* GetDocument() const = 0; - virtual FX_INT32 StartLayout(FX_BOOL bForceRestart = FALSE) = 0; - virtual FX_INT32 DoLayout(IFX_Pause *pPause = NULL) = 0; + virtual int32_t StartLayout(FX_BOOL bForceRestart = FALSE) = 0; + virtual int32_t DoLayout(IFX_Pause *pPause = NULL) = 0; virtual FX_BOOL IncrementLayout() = 0; - virtual FX_INT32 CountPages() const = 0; - virtual IXFA_LayoutPage* GetPage(FX_INT32 index) const = 0; + virtual int32_t CountPages() const = 0; + virtual IXFA_LayoutPage* GetPage(int32_t index) const = 0; virtual CXFA_LayoutItem* GetLayoutItem(CXFA_Node *pFormItem) = 0; }; diff --git a/xfa/src/fxfa/src/common/xfa_document.h b/xfa/src/fxfa/src/common/xfa_document.h index e082321f22..1a45bd4126 100644 --- a/xfa/src/fxfa/src/common/xfa_document.h +++ b/xfa/src/fxfa/src/common/xfa_document.h @@ -72,9 +72,9 @@ public: virtual CXFA_LayoutItem* OnCreateLayoutItem(CXFA_Node *pNode) = 0; virtual void OnLayoutEvent(IXFA_DocLayout *pLayout, CXFA_LayoutItem *pSender, XFA_LAYOUTEVENT eEvent, FX_LPVOID pParam = NULL, FX_LPVOID pParam2 = NULL) = 0; virtual void StartFieldDrawLayout(CXFA_Node *pItem, FX_FLOAT &fCalcWidth, FX_FLOAT &fCalcHeight) = 0; - virtual FX_BOOL FindSplitPos(CXFA_Node *pItem, FX_INT32 iBlockIndex, FX_FLOAT &fCalcHeightPos) = 0; + virtual FX_BOOL FindSplitPos(CXFA_Node *pItem, int32_t iBlockIndex, FX_FLOAT &fCalcHeightPos) = 0; virtual FX_BOOL RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) = 0; - virtual FX_INT32 ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_WidgetAcc* pExclude = NULL) = 0; + virtual int32_t ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, FX_BOOL bIsFormReady = FALSE, FX_BOOL bRecursive = TRUE, CXFA_WidgetAcc* pExclude = NULL) = 0; virtual void AddCalcValidate(CXFA_Node* pNode) = 0; virtual IXFA_Doc* GetHDOC() = 0; virtual IXFA_DocProvider* GetDocProvider() = 0; @@ -84,7 +84,7 @@ public: virtual void OpenDropDownList(IXFA_Widget* hWidget) = 0; virtual CFX_WideString GetCurrentDateTime() = 0; virtual void ResetData(CXFA_WidgetData* pWidgetData = NULL) = 0; - virtual FX_INT32 GetLayoutStatus() = 0; + virtual int32_t GetLayoutStatus() = 0; virtual void RunNodeInitialize(CXFA_Node* pNode) = 0; virtual void RunSubformIndexChange(CXFA_Node* pSubformNode) = 0; virtual CXFA_Node* GetFocusWidgetNode() = 0; diff --git a/xfa/src/fxfa/src/common/xfa_fm2jsapi.h b/xfa/src/fxfa/src/common/xfa_fm2jsapi.h index cdb4fe94f6..10b96dd44e 100644 --- a/xfa/src/fxfa/src/common/xfa_fm2jsapi.h +++ b/xfa/src/fxfa/src/common/xfa_fm2jsapi.h @@ -14,7 +14,7 @@ extern "C" typedef struct XFA_HFM2JSCONTEXT_ { FX_LPVOID* pData; }* XFA_HFM2JSCONTEXT; -FX_INT32 XFA_FM2JS_Translate(FX_WSTR wsFormcalc, CFX_WideTextBuf& wsJavascript, CFX_WideString& wsError); +int32_t XFA_FM2JS_Translate(FX_WSTR wsFormcalc, CFX_WideTextBuf& wsJavascript, CFX_WideString& wsError); XFA_HFM2JSCONTEXT XFA_FM2JS_ContextCreate(); void XFA_FM2JS_ContextInitialize(XFA_HFM2JSCONTEXT hFM2JSContext, FXJSE_HRUNTIME hScriptRuntime, FXJSE_HCONTEXT hScriptContext, diff --git a/xfa/src/fxfa/src/common/xfa_object.h b/xfa/src/fxfa/src/common/xfa_object.h index d2b0f1df96..7c4acd4105 100644 --- a/xfa/src/fxfa/src/common/xfa_object.h +++ b/xfa/src/fxfa/src/common/xfa_object.h @@ -80,9 +80,9 @@ public: } XFA_ELEMENT GetClassID() const; void GetClassName(CFX_WideStringC &wsName) const; - FX_UINT32 GetClassHashCode() const; + uint32_t GetClassHashCode() const; void Script_ObjectClass_ClassName(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute); - void ThrowScriptErrorMessage(FX_INT32 iStringID, ...); + void ThrowScriptErrorMessage(int32_t iStringID, ...); protected: CXFA_Document *m_pDocument; FX_DWORD m_uFlags; @@ -115,15 +115,15 @@ typedef struct _XFA_MAPDATABLOCK { return (FX_LPBYTE)this + sizeof(_XFA_MAPDATABLOCK); } XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo; - FX_INT32 iBytes; + int32_t iBytes; } XFA_MAPDATABLOCK, * XFA_LPMAPDATABLOCK; typedef struct _XFA_MAPMODULEDATA { CFX_MapPtrToPtr m_ValueMap; CFX_MapPtrTemplate m_BufferMap; } XFA_MAPMODULEDATA, * XFA_LPMAPMODULEDATA; -#define XFA_CalcRefCount (FX_LPVOID)(FX_UINTPTR)FXBSTR_ID('X', 'F', 'A', 'R') -#define XFA_CalcData (FX_LPVOID)(FX_UINTPTR)FXBSTR_ID('X', 'F', 'A', 'C') -#define XFA_LAYOUTITEMKEY (FX_LPVOID)(FX_UINTPTR)FXBSTR_ID('L', 'Y', 'I', 'M') +#define XFA_CalcRefCount (FX_LPVOID)(uintptr_t)FXBSTR_ID('X', 'F', 'A', 'R') +#define XFA_CalcData (FX_LPVOID)(uintptr_t)FXBSTR_ID('X', 'F', 'A', 'C') +#define XFA_LAYOUTITEMKEY (FX_LPVOID)(uintptr_t)FXBSTR_ID('L', 'Y', 'I', 'M') class CXFA_Node : public CXFA_Object { public: @@ -176,7 +176,7 @@ public: FX_BOOL SetBoolean(XFA_ATTRIBUTE eAttr, FX_BOOL bValue, FX_BOOL bNotify = FALSE) { - return SetValue(eAttr, XFA_ATTRIBUTETYPE_Boolean, (FX_LPVOID)(FX_UINTPTR)bValue, bNotify); + return SetValue(eAttr, XFA_ATTRIBUTETYPE_Boolean, (FX_LPVOID)(uintptr_t)bValue, bNotify); } FX_BOOL TryBoolean(XFA_ATTRIBUTE eAttr, FX_BOOL &bValue, FX_BOOL bUseDefault = TRUE); FX_BOOL GetBoolean(XFA_ATTRIBUTE eAttr) @@ -184,19 +184,19 @@ public: FX_BOOL bValue; return TryBoolean(eAttr, bValue, TRUE) ? bValue : FALSE; } - FX_BOOL SetInteger(XFA_ATTRIBUTE eAttr, FX_INT32 iValue, FX_BOOL bNotify = FALSE) + FX_BOOL SetInteger(XFA_ATTRIBUTE eAttr, int32_t iValue, FX_BOOL bNotify = FALSE) { - return SetValue(eAttr, XFA_ATTRIBUTETYPE_Integer, (FX_LPVOID)(FX_UINTPTR)iValue, bNotify); + return SetValue(eAttr, XFA_ATTRIBUTETYPE_Integer, (FX_LPVOID)(uintptr_t)iValue, bNotify); } - FX_BOOL TryInteger(XFA_ATTRIBUTE eAttr, FX_INT32 &iValue, FX_BOOL bUseDefault = TRUE); - FX_INT32 GetInteger(XFA_ATTRIBUTE eAttr) + FX_BOOL TryInteger(XFA_ATTRIBUTE eAttr, int32_t &iValue, FX_BOOL bUseDefault = TRUE); + int32_t GetInteger(XFA_ATTRIBUTE eAttr) { - FX_INT32 iValue; + int32_t iValue; return TryInteger(eAttr, iValue, TRUE) ? iValue : 0; } FX_BOOL SetEnum(XFA_ATTRIBUTE eAttr, XFA_ATTRIBUTEENUM eValue, FX_BOOL bNotify = FALSE) { - return SetValue(eAttr, XFA_ATTRIBUTETYPE_Enum, (FX_LPVOID)(FX_UINTPTR)eValue, bNotify); + return SetValue(eAttr, XFA_ATTRIBUTETYPE_Enum, (FX_LPVOID)(uintptr_t)eValue, bNotify); } FX_BOOL TryEnum(XFA_ATTRIBUTE eAttr, XFA_ATTRIBUTEENUM &eValue, FX_BOOL bUseDefault = TRUE); XFA_ATTRIBUTEENUM GetEnum(XFA_ATTRIBUTE eAttr) @@ -234,16 +234,16 @@ public: FX_LPVOID pData; return TryUserData(pKey, pData, bProtoAlso) ? pData : NULL; } - CXFA_Node* GetProperty(FX_INT32 index, XFA_ELEMENT eProperty, FX_BOOL bCreateProperty = TRUE); - FX_INT32 CountChildren(XFA_ELEMENT eElement, FX_BOOL bOnlyChild = FALSE); - CXFA_Node* GetChild(FX_INT32 index, XFA_ELEMENT eElement, FX_BOOL bOnlyChild = FALSE); - FX_INT32 InsertChild(FX_INT32 index, CXFA_Node *pNode); + CXFA_Node* GetProperty(int32_t index, XFA_ELEMENT eProperty, FX_BOOL bCreateProperty = TRUE); + int32_t CountChildren(XFA_ELEMENT eElement, FX_BOOL bOnlyChild = FALSE); + CXFA_Node* GetChild(int32_t index, XFA_ELEMENT eElement, FX_BOOL bOnlyChild = FALSE); + int32_t InsertChild(int32_t index, CXFA_Node *pNode); FX_BOOL InsertChild(CXFA_Node *pNode, CXFA_Node* pBeforeNode = NULL); FX_BOOL RemoveChild(CXFA_Node *pNode, FX_BOOL bNotify = TRUE); CXFA_Node* Clone(FX_BOOL bRecursive); CXFA_Node* GetNodeItem(XFA_NODEITEM eItem) const; CXFA_Node* GetNodeItem(XFA_NODEITEM eItem, XFA_OBJECTTYPE eType) const; - FX_INT32 GetNodeList(CXFA_NodeArray &nodes, FX_DWORD dwTypeFilter = XFA_NODEFILTER_Children | XFA_NODEFILTER_Properties, XFA_ELEMENT eElementFilter = XFA_ELEMENT_UNKNOWN, FX_INT32 iLevel = 1); + int32_t GetNodeList(CXFA_NodeArray &nodes, FX_DWORD dwTypeFilter = XFA_NODEFILTER_Children | XFA_NODEFILTER_Properties, XFA_ELEMENT eElementFilter = XFA_ELEMENT_UNKNOWN, int32_t iLevel = 1); CXFA_Node* CreateSamePacketNode(XFA_ELEMENT eElement, FX_DWORD dwFlags = XFA_NODEFLAG_Initialized); CXFA_Node* CloneTemplateToForm(FX_BOOL bRecursive); CXFA_Node* GetTemplateNode(); @@ -251,9 +251,9 @@ public: CXFA_Node* GetDataDescriptionNode(); void SetDataDescriptionNode(CXFA_Node* pDataDescriptionNode); CXFA_Node* GetBindData(); - FX_INT32 GetBindItems(CXFA_NodeArray& formItems); - FX_INT32 AddBindItem(CXFA_Node* pFormNode); - FX_INT32 RemoveBindItem(CXFA_Node* pFormNode); + int32_t GetBindItems(CXFA_NodeArray& formItems); + int32_t AddBindItem(CXFA_Node* pFormNode); + int32_t RemoveBindItem(CXFA_Node* pFormNode); FX_BOOL HasBindItem(); CXFA_WidgetData* GetWidgetData(); CXFA_WidgetData* GetContainerWidgetData(); @@ -265,8 +265,8 @@ public: CXFA_Node* GetNextSameNameSibling(FX_DWORD dwNodeNameHash) const; CXFA_Node* GetNextSameNameSibling(FX_WSTR wsNodeName) const; CXFA_Node* GetNextSameClassSibling(XFA_ELEMENT eNodeClass) const; - FX_INT32 GetNodeSameNameIndex() const; - FX_INT32 GetNodeSameClassIndex() const; + int32_t GetNodeSameNameIndex() const; + int32_t GetNodeSameClassIndex() const; void GetSOMExpression(CFX_WideString& wsSOMExpression); CXFA_Node* GetInstanceMgrOfSubform(); @@ -367,7 +367,7 @@ public: void Script_Subform_ExecValidate(CFXJSE_Arguments* pArguments); void Script_Subform_GetInvalidObjects(CFXJSE_Arguments* pArguments); - FX_INT32 Subform_and_SubformSet_InstanceIndex(); + int32_t Subform_and_SubformSet_InstanceIndex(); void Script_Template_FormNodes(CFXJSE_Arguments* pArguments); void Script_Template_Remerge(CFXJSE_Arguments* pArguments); void Script_Template_ExecInitialize(CFXJSE_Arguments* pArguments); @@ -384,8 +384,8 @@ public: void Script_InstanceManager_SetInstances(CFXJSE_Arguments* pArguments); void Script_InstanceManager_AddInstance(CFXJSE_Arguments* pArguments); void Script_InstanceManager_InsertInstance(CFXJSE_Arguments* pArguments); - FX_INT32 InstanceManager_SetInstances(FX_INT32 iCount); - FX_INT32 InstanceManager_MoveInstance(FX_INT32 iTo, FX_INT32 iFrom); + int32_t InstanceManager_SetInstances(int32_t iCount); + int32_t InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom); void Script_Occur_Max(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute); void Script_Occur_Min(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute); void Script_Desc_Metadata(CFXJSE_Arguments* pArguments); @@ -434,7 +434,7 @@ protected: void OnRemoved(CXFA_Node *pParent, CXFA_Node *pRemoved, FX_BOOL bNotify); void OnChanging(XFA_ATTRIBUTE eAttr, FX_LPVOID pNewValue, FX_BOOL bNotify); void OnChanged(XFA_ATTRIBUTE eAttr, FX_LPVOID pNewValue, FX_BOOL bNotify, FX_BOOL bScriptModify = FALSE); - FX_INT32 execSingleEventByName(FX_WSTR wsEventName, XFA_ELEMENT eElementType); + int32_t execSingleEventByName(FX_WSTR wsEventName, XFA_ELEMENT eElementType); FX_BOOL SetScriptContent(const CFX_WideString& wsContent, const CFX_WideString& wsXMLValue, FX_BOOL bNotify = TRUE, FX_BOOL bScriptModify = FALSE, FX_BOOL bSyncData = TRUE); CFX_WideString GetScriptContent(FX_BOOL bScriptModify = FALSE); XFA_LPMAPMODULEDATA GetMapModuleData(FX_BOOL bCreateNew); @@ -442,8 +442,8 @@ protected: FX_BOOL GetMapModuleValue(FX_LPVOID pKey, FX_LPVOID &pValue); void SetMapModuleString(FX_LPVOID pKey, FX_WSTR wsValue); FX_BOOL GetMapModuleString(FX_LPVOID pKey, CFX_WideStringC &wsValue); - void SetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID pValue, FX_INT32 iBytes, XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = NULL); - FX_BOOL GetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID &pValue, FX_INT32 &iBytes, FX_BOOL bProtoAlso = TRUE); + void SetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID pValue, int32_t iBytes, XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = NULL); + FX_BOOL GetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID &pValue, int32_t &iBytes, FX_BOOL bProtoAlso = TRUE); FX_BOOL HasMapModuleKey(FX_LPVOID pKey, FX_BOOL bProtoAlso = FALSE); void RemoveMapModuleKey(FX_LPVOID pKey = NULL); void MergeAllData(FX_LPVOID pDstModule, FX_BOOL bUseSrcAttr = TRUE); @@ -472,13 +472,13 @@ public: { return (XFA_ELEMENT)m_eNodeClass; } - FX_UINT32 GetScriptObjHash() + uint32_t GetScriptObjHash() { return m_uScriptHash; } protected: XFA_ELEMENT m_eNodeClass; - FX_UINT32 m_uScriptHash; + uint32_t m_uScriptHash; }; class CXFA_ThisProxy : public CXFA_Object { @@ -511,11 +511,11 @@ public: return XFA_ELEMENT_NodeList; } CXFA_Node* NamedItem(FX_WSTR wsName); - virtual FX_INT32 GetLength() = 0; + 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 CXFA_Node* Item(FX_INT32 iIndex) = 0; + virtual CXFA_Node* Item(int32_t iIndex) = 0; void Script_ListClass_Append(CFXJSE_Arguments* pArguments); void Script_ListClass_Insert(CFXJSE_Arguments* pArguments); @@ -530,11 +530,11 @@ class CXFA_ArrayNodeList : public CXFA_NodeList public: CXFA_ArrayNodeList(CXFA_Document* pDocument); void SetArrayNodeList(const CXFA_NodeArray &srcArray); - virtual FX_INT32 GetLength(); + virtual int32_t GetLength(); virtual FX_BOOL Append(CXFA_Node* pNode); virtual FX_BOOL Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode); virtual FX_BOOL Remove(CXFA_Node* pNode); - virtual CXFA_Node* Item(FX_INT32 iIndex); + virtual CXFA_Node* Item(int32_t iIndex); protected: CXFA_NodeArray m_array; }; @@ -543,11 +543,11 @@ class CXFA_AttachNodeList : public CXFA_NodeList public: CXFA_AttachNodeList(CXFA_Document* pDocument, CXFA_Node* pAttachNode); - virtual FX_INT32 GetLength(); + virtual int32_t GetLength(); virtual FX_BOOL Append(CXFA_Node* pNode); virtual FX_BOOL Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode); virtual FX_BOOL Remove(CXFA_Node* pNode); - virtual CXFA_Node* Item(FX_INT32 iIndex); + virtual CXFA_Node* Item(int32_t iIndex); protected: CXFA_Node* m_pAttachNode; }; diff --git a/xfa/src/fxfa/src/common/xfa_parser.h b/xfa/src/fxfa/src/common/xfa_parser.h index 2b1f1e62a8..b534acd03c 100644 --- a/xfa/src/fxfa/src/common/xfa_parser.h +++ b/xfa/src/fxfa/src/common/xfa_parser.h @@ -12,9 +12,9 @@ class IXFA_Parser public: static IXFA_Parser* Create(IXFA_ObjFactory *pFactory, FX_BOOL bDocumentParser = FALSE); virtual void Release() = 0; - virtual FX_INT32 StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP) = 0; - virtual FX_INT32 DoParse(IFX_Pause *pPause = NULL) = 0; - virtual FX_INT32 ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause = NULL) = 0; + virtual int32_t StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP) = 0; + virtual int32_t DoParse(IFX_Pause *pPause = NULL) = 0; + virtual int32_t ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause = NULL) = 0; virtual void ConstructXFANode(CXFA_Node* pXFANode, IFDE_XMLNode* pXMLNode) = 0; virtual IXFA_ObjFactory* GetFactory() const = 0; virtual CXFA_Node* GetRootNode() const = 0; diff --git a/xfa/src/fxfa/src/common/xfa_script.h b/xfa/src/fxfa/src/common/xfa_script.h index a61dc959b3..5be9077083 100644 --- a/xfa/src/fxfa/src/common/xfa_script.h +++ b/xfa/src/fxfa/src/common/xfa_script.h @@ -35,13 +35,13 @@ public: CXFA_HVALUEArray(FXJSE_HRUNTIME hRunTime) : m_hRunTime(hRunTime) {}; ~CXFA_HVALUEArray() { - for (FX_INT32 i = 0; i < GetSize(); i++) { + for (int32_t i = 0; i < GetSize(); i++) { FXJSE_Value_Release(GetAt(i)); } } void GetAttributeObject(CXFA_ObjArray& objArray) { - for (FX_INT32 i = 0; i < GetSize(); i++) { + for (int32_t i = 0; i < GetSize(); i++) { CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(GetAt(i), NULL); objArray.Add(pObject); } @@ -54,11 +54,11 @@ typedef struct _XFA_RESOLVENODE_RS { { nodes.RemoveAll(); } - FX_INT32 GetAttributeResult(CXFA_HVALUEArray& hValueArray) const + int32_t GetAttributeResult(CXFA_HVALUEArray& hValueArray) const { if (pScriptAttribute && pScriptAttribute->eValueType == XFA_SCRIPT_Object) { FXJSE_HRUNTIME hRunTime = hValueArray.m_hRunTime; - for (FX_INT32 i = 0; i < nodes.GetSize(); i++) { + for (int32_t i = 0; i < nodes.GetSize(); i++) { FXJSE_HVALUE hValue = FXJSE_Value_Create(hRunTime); (nodes[i]->*(pScriptAttribute->lpfnCallback))(hValue, FALSE, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute); hValueArray.Add(hValue); @@ -71,11 +71,11 @@ typedef struct _XFA_RESOLVENODE_RS { XFA_RESOVENODE_RSTYPE dwFlags; } XFA_RESOLVENODE_RS, * XFA_LPRESOLVENODE_RS; typedef struct _XFA_JSBUILTININFO { - FX_UINT32 uUnicodeHash; + uint32_t uUnicodeHash; FX_LPCSTR pName; } XFA_JSBUILTININFO, * XFA_LPJSBUILTININFO; typedef XFA_JSBUILTININFO const * XFA_LPCJSBUILTININFO; -XFA_LPCJSBUILTININFO XFA_GetJSBuiltinByHash(FX_UINT32 uHashCode); +XFA_LPCJSBUILTININFO XFA_GetJSBuiltinByHash(uint32_t uHashCode); class IXFA_ScriptContext { public: @@ -85,13 +85,13 @@ public: virtual void SetEventParam(CXFA_EventParam* pEventParam) = 0; virtual CXFA_EventParam* GetEventParam() = 0; virtual FX_BOOL RunScript(XFA_SCRIPTLANGTYPE eScriptType, FX_WSTR wsScript, FXJSE_HVALUE hRetValue, CXFA_Object* pThisObject = NULL) = 0; - virtual FX_INT32 ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, FX_DWORD dwStyles = XFA_RESOLVENODE_Children, CXFA_Node* bindNode = NULL) = 0; + virtual int32_t ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, FX_DWORD dwStyles = XFA_RESOLVENODE_Children, CXFA_Node* bindNode = NULL) = 0; virtual FXJSE_HVALUE GetJSValueFromMap(CXFA_Object* pObject) = 0; virtual void CacheList(CXFA_NodeList* pList) = 0; virtual CXFA_Object* GetThisObject() const = 0; virtual FXJSE_HRUNTIME GetRuntime() const = 0; - virtual FX_INT32 GetIndexByName(CXFA_Node* refNode) = 0; - virtual FX_INT32 GetIndexByClassName(CXFA_Node* refNode) = 0; + virtual int32_t GetIndexByName(CXFA_Node* refNode) = 0; + virtual int32_t GetIndexByClassName(CXFA_Node* refNode) = 0; virtual void GetSomExpression(CXFA_Node* refNode, CFX_WideString &wsExpression) = 0; virtual void SetNodesOfRunScript(CXFA_NodeArray *pArray) = 0; diff --git a/xfa/src/fxfa/src/common/xfa_utils.h b/xfa/src/fxfa/src/common/xfa_utils.h index b666397e83..abb9dd208a 100644 --- a/xfa/src/fxfa/src/common/xfa_utils.h +++ b/xfa/src/fxfa/src/common/xfa_utils.h @@ -70,7 +70,7 @@ public: NodeType* MoveToPrev() { NodeType *pCurrent = GetCurrent(); - FX_INT32 nStackLength = m_NodeStack.GetSize(); + int32_t nStackLength = m_NodeStack.GetSize(); if(nStackLength == 1) { return NULL; } else if(nStackLength > 1) { @@ -210,7 +210,7 @@ public: void* pKey = NULL; void* pValue = NULL; CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue); - rKey = (KeyType)(FX_UINTPTR)pKey; + rKey = (KeyType)(uintptr_t)pKey; } }; class CXFA_Node; @@ -218,10 +218,10 @@ class CXFA_WidgetData; #include "fxfa_localevalue.h" CXFA_Node* XFA_CreateUIChild(CXFA_Node* pNode, XFA_ELEMENT& eWidgetType); CXFA_LocaleValue XFA_GetLocaleValue(CXFA_WidgetData* pWidgetData); -CFX_WideString XFA_NumericLimit(const CFX_WideString &wsValue, FX_INT32 iLead, FX_INT32 iTread); +CFX_WideString XFA_NumericLimit(const CFX_WideString &wsValue, int32_t iLead, int32_t iTread); FX_DOUBLE XFA_WideStringToDouble(const CFX_WideString &wsStringVal); FX_DOUBLE XFA_ByteStringToDouble(FX_BSTR szStringVal); -FX_INT32 XFA_MapRotation(FX_INT32 nRotation); +int32_t XFA_MapRotation(int32_t nRotation); #ifndef XFA_PARSE_HAS_LINEIDENTIFIER #define XFA_PARSE_HAS_LINEIDENTIFIER #endif diff --git a/xfa/src/fxfa/src/fm2js/xfa_expression.cpp b/xfa/src/fxfa/src/fm2js/xfa_expression.cpp index 7b230de528..47e5cb440f 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_expression.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_expression.cpp @@ -35,8 +35,8 @@ CXFA_FMFunctionDefinition::~CXFA_FMFunctionDefinition() m_pArguments = 0; } if (m_pExpressions) { - FX_INT32 expc = m_pExpressions->GetSize(); - FX_INT32 index = 0; + int32_t expc = m_pExpressions->GetSize(); + int32_t index = 0; CXFA_FMExpression *e = 0; while (index < expc) { e = (CXFA_FMExpression *)m_pExpressions->GetAt(index); @@ -66,8 +66,8 @@ void CXFA_FMFunctionDefinition::ToJavaScript(CFX_WideTextBuf& javascript) } javascript << FX_WSTRC(L"("); if (m_pArguments != 0) { - FX_INT32 argc = m_pArguments->GetSize(); - FX_INT32 index = 0; + int32_t argc = m_pArguments->GetSize(); + int32_t index = 0; CFX_WideStringC identifier = 0; while (index < argc) { identifier = m_pArguments->GetAt(index); @@ -88,8 +88,8 @@ void CXFA_FMFunctionDefinition::ToJavaScript(CFX_WideTextBuf& javascript) javascript << RUNTIMEFUNCTIONRETURNVALUE; javascript << FX_WSTRC(L" = null;\n"); if (m_pExpressions) { - FX_INT32 expc = m_pExpressions->GetSize(); - FX_INT32 index = 0; + int32_t expc = m_pExpressions->GetSize(); + int32_t index = 0; CXFA_FMExpression *e = 0; while (index < expc) { e = (CXFA_FMExpression *)m_pExpressions->GetAt(index); @@ -229,8 +229,8 @@ CXFA_FMBlockExpression::CXFA_FMBlockExpression(FX_DWORD line, CFX_PtrArray *pExp CXFA_FMBlockExpression::~CXFA_FMBlockExpression() { if (m_pExpressionList) { - FX_INT32 expc = m_pExpressionList->GetSize(); - FX_INT32 index = 0; + int32_t expc = m_pExpressionList->GetSize(); + int32_t index = 0; CXFA_FMExpression *e = 0; while (index < expc) { e = (CXFA_FMExpression *)m_pExpressionList->GetAt(index); @@ -246,8 +246,8 @@ void CXFA_FMBlockExpression::ToJavaScript(CFX_WideTextBuf& javascript) { javascript << FX_WSTRC(L"{\n"); if (m_pExpressionList) { - FX_INT32 expc = m_pExpressionList->GetSize(); - FX_INT32 index = 0; + int32_t expc = m_pExpressionList->GetSize(); + int32_t index = 0; CXFA_FMExpression *e = 0; while (index < expc) { e = (CXFA_FMExpression *)m_pExpressionList->GetAt(index); @@ -261,8 +261,8 @@ void CXFA_FMBlockExpression::ToImpliedReturnJS(CFX_WideTextBuf& javascript) { javascript << FX_WSTRC(L"{\n"); if (m_pExpressionList) { - FX_INT32 expc = m_pExpressionList->GetSize(); - FX_INT32 index = 0; + int32_t expc = m_pExpressionList->GetSize(); + int32_t index = 0; CXFA_FMExpression *e = 0; while (index < expc) { e = (CXFA_FMExpression *)m_pExpressionList->GetAt(index); @@ -451,7 +451,7 @@ void CXFA_FMContinueExpression::ToImpliedReturnJS(CFX_WideTextBuf& javascript) javascript << FX_WSTRC(L" = 0;\n"); javascript << FX_WSTRC(L"continue;\n"); } -CXFA_FMForExpression::CXFA_FMForExpression(FX_DWORD line, FX_WSTR wsVariant, CXFA_FMSimpleExpression *pAssignment, CXFA_FMSimpleExpression *pAccessor, FX_INT32 iDirection, CXFA_FMSimpleExpression *pStep, CXFA_FMExpression *pList) +CXFA_FMForExpression::CXFA_FMForExpression(FX_DWORD line, FX_WSTR wsVariant, CXFA_FMSimpleExpression *pAssignment, CXFA_FMSimpleExpression *pAccessor, int32_t iDirection, CXFA_FMSimpleExpression *pStep, CXFA_FMExpression *pList) : CXFA_FMLoopExpression(line), m_wsVariant(wsVariant), m_pAssignment(pAssignment), @@ -594,8 +594,8 @@ CXFA_FMForeachExpression::~CXFA_FMForeachExpression() m_pList = 0; } if (m_pAccessors) { - FX_INT32 size = m_pAccessors->GetSize(); - FX_INT32 index = 0; + int32_t size = m_pAccessors->GetSize(); + int32_t index = 0; CXFA_FMSimpleExpression *e = 0; while (index < size) { e = (CXFA_FMSimpleExpression *)m_pAccessors->GetAt(index); @@ -623,8 +623,8 @@ void CXFA_FMForeachExpression::ToJavaScript(CFX_WideTextBuf& javascript) javascript << FX_WSTRC(L" = "); javascript << XFA_FM_EXPTypeToString(CONCATFMOBJECT); javascript << FX_WSTRC(L"("); - FX_INT32 iSize = m_pAccessors->GetSize(); - FX_INT32 index = 0; + int32_t iSize = m_pAccessors->GetSize(); + int32_t index = 0; CXFA_FMSimpleExpression *s = 0; while(index < iSize) { s = (CXFA_FMSimpleExpression *)m_pAccessors->GetAt(index); @@ -677,8 +677,8 @@ void CXFA_FMForeachExpression::ToImpliedReturnJS(CFX_WideTextBuf& javascript) javascript << FX_WSTRC(L" = "); javascript << XFA_FM_EXPTypeToString(CONCATFMOBJECT); javascript << FX_WSTRC(L"("); - FX_INT32 iSize = m_pAccessors->GetSize(); - FX_INT32 index = 0; + int32_t iSize = m_pAccessors->GetSize(); + int32_t index = 0; CXFA_FMSimpleExpression *s = 0; while(index < iSize) { s = (CXFA_FMSimpleExpression *)m_pAccessors->GetAt(index); diff --git a/xfa/src/fxfa/src/fm2js/xfa_expression.h b/xfa/src/fxfa/src/fm2js/xfa_expression.h index 6a51925527..a3781fa26d 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_expression.h +++ b/xfa/src/fxfa/src/fm2js/xfa_expression.h @@ -145,7 +145,7 @@ class CXFA_FMForExpression : public CXFA_FMLoopExpression { public: CXFA_FMForExpression(FX_DWORD line, FX_WSTR wsVariant, CXFA_FMSimpleExpression *pAssignment, - CXFA_FMSimpleExpression *pAccessor, FX_INT32 iDirection, CXFA_FMSimpleExpression *pStep, CXFA_FMExpression *pList); + CXFA_FMSimpleExpression *pAccessor, int32_t iDirection, CXFA_FMSimpleExpression *pStep, CXFA_FMExpression *pList); virtual ~CXFA_FMForExpression(); virtual void ToJavaScript(CFX_WideTextBuf& javascript); virtual void ToImpliedReturnJS(CFX_WideTextBuf&); @@ -153,7 +153,7 @@ private: CFX_WideStringC m_wsVariant; CXFA_FMSimpleExpression * m_pAssignment; CXFA_FMSimpleExpression *m_pAccessor; - FX_INT32 m_iDirection; + int32_t m_iDirection; CXFA_FMSimpleExpression *m_pStep; CXFA_FMExpression *m_pList; }; diff --git a/xfa/src/fxfa/src/fm2js/xfa_fm2jsapi.cpp b/xfa/src/fxfa/src/fm2js/xfa_fm2jsapi.cpp index 8a1b1226f4..0ffec233dd 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_fm2jsapi.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_fm2jsapi.cpp @@ -9,14 +9,14 @@ extern "C" { #endif -FX_INT32 XFA_FM2JS_Translate(FX_WSTR wsFormcalc, CFX_WideTextBuf& wsJavascript, CFX_WideString& wsError) +int32_t XFA_FM2JS_Translate(FX_WSTR wsFormcalc, CFX_WideTextBuf& wsJavascript, CFX_WideString& wsError) { if (wsFormcalc.IsEmpty()) { wsJavascript.Clear(); wsError.Empty(); return 0; } - FX_INT32 status = 0; + int32_t status = 0; CXFA_FMProgram program; status = program.Init(wsFormcalc); if(status) { diff --git a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp index be74852098..84a7747e7a 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp @@ -8,13 +8,13 @@ #include #define FINANCIAL_PRECISION 0.00000001 struct XFA_FMHtmlReserveCode { - FX_UINT32 m_uCode; + uint32_t m_uCode; FX_LPCWSTR m_htmlReserve; }; struct XFA_FMHtmlHashedReserveCode { - FX_UINT32 m_uHash; + uint32_t m_uHash; FX_LPCWSTR m_htmlReserve; - FX_UINT32 m_uCode; + uint32_t m_uCode; }; static XFA_FMHtmlHashedReserveCode reservesForDecode [] = { {0x00018b62, L"Mu", 924}, @@ -547,12 +547,12 @@ void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); - FX_UINT32 uCount = 0; + int32_t argc = args.GetLength(); + uint32_t uCount = 0; FX_DOUBLE dSum = 0.0; if(argc >= 1) { FXJSE_HVALUE argValue = 0; - for(FX_INT32 i = 0; i < argc; i++) { + for(int32_t i = 0; i < argc; i++) { argValue = args.GetValue(i); if(FXJSE_Value_IsNull(argValue)) { FXJSE_Value_Release(argValue); @@ -560,14 +560,14 @@ void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else if(FXJSE_Value_IsArray(argValue)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if(iLength > 2) { FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue); FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(hruntime); if(FXJSE_Value_IsNull(propertyValue)) { - for(FX_INT32 j = 2; j < iLength; j++) { + for(int32_t j = 2; j < iLength; j++) { FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue); FXJSE_HVALUE defaultPropValue = FXJSE_Value_Create(hruntime); GetObjectDefaultValue(jsObjectValue, defaultPropValue); @@ -581,7 +581,7 @@ void CXFA_FM2JSContext::Avg(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(hruntime); - for(FX_INT32 j = 2; j < iLength; j++) { + for(int32_t j = 2; j < iLength; j++) { FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue); FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr, newPropertyValue); if (!FXJSE_Value_IsNull(newPropertyValue)) { @@ -628,10 +628,10 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); - FX_UINT32 uCount = 0; + int32_t argc = args.GetLength(); + uint32_t uCount = 0; FXJSE_HVALUE argValue = 0; - for(FX_INT32 i = 0; i < argc; i++) { + for(int32_t i = 0; i < argc; i++) { argValue = args.GetValue(i); if(FXJSE_Value_IsNull(argValue)) { FXJSE_Value_Release(argValue); @@ -639,7 +639,7 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } else if(FXJSE_Value_IsArray(argValue)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if(iLength > 2) { FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); @@ -648,7 +648,7 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue); FXJSE_Value_GetObjectPropByIdx(argValue, 2, jsObjectValue); if(FXJSE_Value_IsNull(propertyValue)) { - for(FX_INT32 i = 2; i < iLength; i++) { + for(int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue); GetObjectDefaultValue(jsObjectValue, newPropertyValue); if (!FXJSE_Value_IsNull(newPropertyValue)) { @@ -658,7 +658,7 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } else { CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); - for(FX_INT32 i = 2; i < iLength; i++) { + for(int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue); FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr, newPropertyValue); uCount += (FXJSE_Value_IsNull(newPropertyValue) ? 0 : 1); @@ -683,7 +683,7 @@ void CXFA_FM2JSContext::Count(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar FXJSE_Value_Release(argValue); } argValue = 0; - FXJSE_Value_SetInteger(args.GetReturnValue(), (FX_INT32)uCount); + FXJSE_Value_SetInteger(args.GetReturnValue(), (int32_t)uCount); } void CXFA_FM2JSContext::Floor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { @@ -705,11 +705,11 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); - FX_UINT32 uCount = 0; + int32_t argc = args.GetLength(); + uint32_t uCount = 0; FX_DOUBLE dMaxValue = 0.0; FXJSE_HVALUE argValue = 0; - for(FX_INT32 i = 0; i < argc; i++) { + for(int32_t i = 0; i < argc; i++) { argValue = args.GetValue(i); if(FXJSE_Value_IsNull(argValue)) { FXJSE_Value_Release(argValue); @@ -717,7 +717,7 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else if(FXJSE_Value_IsArray(argValue)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if(iLength > 2) { FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); @@ -726,7 +726,7 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue); FXJSE_Value_GetObjectPropByIdx(argValue, 2, jsObjectValue); if(FXJSE_Value_IsNull(propertyValue)) { - for(FX_INT32 i = 2; i < iLength; i++) { + for(int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue); GetObjectDefaultValue(jsObjectValue, newPropertyValue); if(!FXJSE_Value_IsNull(newPropertyValue)) { @@ -744,7 +744,7 @@ void CXFA_FM2JSContext::Max(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else { CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); - for(FX_INT32 i = 2; i < iLength; i++) { + for(int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue); FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr, newPropertyValue); if(!FXJSE_Value_IsNull(newPropertyValue)) { @@ -805,11 +805,11 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); - FX_UINT32 uCount = 0; + int32_t argc = args.GetLength(); + uint32_t uCount = 0; FX_DOUBLE dMinValue = 0.0; FXJSE_HVALUE argValue = 0; - for(FX_INT32 i = 0; i < argc; i++) { + for(int32_t i = 0; i < argc; i++) { argValue = args.GetValue(i); if(FXJSE_Value_IsNull(argValue)) { FXJSE_Value_Release(argValue); @@ -817,7 +817,7 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else if(FXJSE_Value_IsArray(argValue)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if(iLength > 2) { FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); @@ -826,7 +826,7 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu FXJSE_Value_GetObjectPropByIdx(argValue, 1, propertyValue); FXJSE_Value_GetObjectPropByIdx(argValue, 2, jsObjectValue); if(FXJSE_Value_IsNull(propertyValue)) { - for(FX_INT32 i = 2; i < iLength; i++) { + for(int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue); GetObjectDefaultValue(jsObjectValue, newPropertyValue); if(!FXJSE_Value_IsNull(newPropertyValue)) { @@ -844,7 +844,7 @@ void CXFA_FM2JSContext::Min(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else { CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); - for(FX_INT32 i = 2; i < iLength; i++) { + for(int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argValue, i, jsObjectValue); FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr, newPropertyValue); if(!FXJSE_Value_IsNull(newPropertyValue)) { @@ -916,7 +916,7 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu if(FXJSE_Value_IsArray(argOne)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argOne, FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if(iLength > 2) { FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); @@ -944,7 +944,7 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu if(FXJSE_Value_IsArray(argTwo)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argTwo, FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if(iLength > 2) { FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); @@ -970,7 +970,7 @@ void CXFA_FM2JSContext::Mod(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu dDividor = HValueToDouble(hThis, argTwo); } if(dDividor) { - FXJSE_Value_SetDouble(args.GetReturnValue(), dDividend - dDividor * (FX_INT32)(dDividend / dDividor)); + FXJSE_Value_SetDouble(args.GetReturnValue(), dDividend - dDividor * (int32_t)(dDividend / dDividor)); } else { pContext->ThrowScriptErrorMessage(XFA_IDS_DIVIDE_ZERO); } @@ -985,8 +985,8 @@ void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); - FX_UINT8 uPrecision = 0; + int32_t argc = args.GetLength(); + uint8_t uPrecision = 0; if(argc == 1) { FXJSE_HVALUE argOne = args.GetValue(0); if(FXJSE_Value_IsNull(argOne)) { @@ -1071,7 +1071,7 @@ void CXFA_FM2JSContext::Round(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } else if(dPrecision > 12.0) { uPrecision = 12; } else { - uPrecision = (FX_UINT8)dPrecision; + uPrecision = (uint8_t)dPrecision; } CFX_Decimal decimalValue((FX_FLOAT)dValue, uPrecision); CFX_WideString wsValue = decimalValue; @@ -1087,12 +1087,12 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); - FX_UINT32 uCount = 0; + int32_t argc = args.GetLength(); + uint32_t uCount = 0; FX_DOUBLE dSum = 0.0; if(argc) { FXJSE_HVALUE argValue = 0; - for(FX_INT32 i = 0; i < argc; i++) { + for(int32_t i = 0; i < argc; i++) { argValue = args.GetValue(i); if(FXJSE_Value_IsNull(argValue)) { FXJSE_Value_Release(argValue); @@ -1100,7 +1100,7 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else if(FXJSE_Value_IsArray(argValue)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argValue, FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if(iLength > 2) { FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); @@ -1108,7 +1108,7 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(hruntime); FXJSE_HVALUE newPropertyValue = FXJSE_Value_Create(hruntime); if(FXJSE_Value_IsNull(propertyValue)) { - for(FX_INT32 j = 2; j < iLength; j++) { + for(int32_t j = 2; j < iLength; j++) { FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue); GetObjectDefaultValue(jsObjectValue, newPropertyValue); if (!FXJSE_Value_IsNull(newPropertyValue)) { @@ -1119,7 +1119,7 @@ void CXFA_FM2JSContext::Sum(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else { CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); - for(FX_INT32 j = 2; j < iLength; j++) { + for(int32_t j = 2; j < iLength; j++) { FXJSE_Value_GetObjectPropByIdx(argValue, j, jsObjectValue); FXJSE_Value_GetObjectProp(jsObjectValue, propertyStr, newPropertyValue); if (!FXJSE_Value_IsNull(newPropertyValue)) { @@ -1170,7 +1170,7 @@ void CXFA_FM2JSContext::Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg bufferMon.Format("%02d", pTmStruct->tm_mon + 1); bufferDay.Format("%02d", pTmStruct->tm_mday); CFX_ByteString bufferCurrent = bufferYear + bufferMon + bufferDay; - FX_INT32 dDays = DateString2Num(bufferCurrent); + int32_t dDays = DateString2Num(bufferCurrent); FXJSE_Value_SetInteger(args.GetReturnValue(), dDays); } else { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); @@ -1179,7 +1179,7 @@ void CXFA_FM2JSContext::Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg } void CXFA_FM2JSContext::Date2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if ((argc > 0) && (argc < 4)) { FX_BOOL bFlags = FALSE; CFX_ByteString dateString; @@ -1234,10 +1234,10 @@ void CXFA_FM2JSContext::Date2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE } void CXFA_FM2JSContext::DateFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (argc < 3) { FX_BOOL bFlags = FALSE; - FX_INT32 iStyle = 0; + int32_t iStyle = 0; CFX_ByteString szLocal; FXJSE_HVALUE argStyle = 0; FXJSE_HVALUE argLocal = 0; @@ -1246,7 +1246,7 @@ void CXFA_FM2JSContext::DateFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_ if (FXJSE_Value_IsNull(argStyle)) { bFlags = TRUE; } - iStyle = (FX_INT32)HValueToFloat(hThis, argStyle); + iStyle = (int32_t)HValueToFloat(hThis, argStyle); if (iStyle > 4 || iStyle < 0) { iStyle = 0; } @@ -1289,8 +1289,8 @@ void CXFA_FM2JSContext::IsoDate2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFX } else { CFX_ByteString szArgString; HValueToUTF8String(argOne, szArgString); - FX_INT32 dDays = DateString2Num(szArgString); - FXJSE_Value_SetInteger(args.GetReturnValue(), (FX_INT32)dDays); + int32_t dDays = DateString2Num(szArgString); + FXJSE_Value_SetInteger(args.GetReturnValue(), (int32_t)dDays); } FXJSE_Value_Release(argOne); } else { @@ -1320,15 +1320,15 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFX CXFA_LocaleValue timeValue(XFA_VT_TIME, CFX_WideString::FromUTF8(szArgString, szArgString.GetLength()), (CXFA_LocaleMgr*)pMgr); if (timeValue.IsValid()) { CFX_Unitime uniTime = timeValue.GetTime(); - FX_INT32 hour = uniTime.GetHour(); - FX_INT32 min = uniTime.GetMinute(); - FX_INT32 second = uniTime.GetSecond(); - FX_INT32 milSecond = uniTime.GetMillisecond(); + int32_t hour = uniTime.GetHour(); + int32_t min = uniTime.GetMinute(); + int32_t second = uniTime.GetSecond(); + int32_t milSecond = uniTime.GetMillisecond(); IFX_Locale* pDefLocale = pMgr->GetDefLocale(); FXSYS_assert(pDefLocale); FX_TIMEZONE tzLocale; pDefLocale->GetTimeZone(tzLocale); - FX_INT32 mins = hour * 60 + min; + int32_t mins = hour * 60 + min; mins -= (tzLocale.tzHour * 60); while (mins > 1440) { mins -= 1440; @@ -1338,7 +1338,7 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFX } hour = mins / 60; min = mins % 60; - FX_INT32 iResult = hour * 3600000 + min * 60000 + second * 1000 + milSecond + 1; + int32_t iResult = hour * 3600000 + min * 60000 + second * 1000 + milSecond + 1; FXJSE_Value_SetInteger(args.GetReturnValue(), iResult); } else { FXJSE_Value_SetInteger(args.GetReturnValue(), 0); @@ -1351,10 +1351,10 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFX } void CXFA_FM2JSContext::LocalDateFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (argc < 3) { FX_BOOL bFlags = FALSE; - FX_INT32 iStyle = 0; + int32_t iStyle = 0; CFX_ByteString szLocal; FXJSE_HVALUE argStyle = 0; FXJSE_HVALUE argLocal = 0; @@ -1363,7 +1363,7 @@ void CXFA_FM2JSContext::LocalDateFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF if (FXJSE_Value_IsNull(argStyle)) { bFlags = TRUE; } - iStyle = (FX_INT32)HValueToFloat(hThis, argStyle); + iStyle = (int32_t)HValueToFloat(hThis, argStyle); if (iStyle > 4 || iStyle < 0) { iStyle = 0; } @@ -1399,10 +1399,10 @@ void CXFA_FM2JSContext::LocalDateFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF } void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (argc < 3) { FX_BOOL bFlags = FALSE; - FX_INT32 iStyle = 0; + int32_t iStyle = 0; CFX_ByteString szLocal; FXJSE_HVALUE argStyle = 0; FXJSE_HVALUE argLocal = 0; @@ -1411,7 +1411,7 @@ void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF if (FXJSE_Value_IsNull(argStyle)) { bFlags = TRUE; } - iStyle = (FX_INT32)HValueToFloat(hThis, argStyle); + iStyle = (int32_t)HValueToFloat(hThis, argStyle); if (iStyle > 4 || iStyle < 0) { iStyle = 0; } @@ -1447,10 +1447,10 @@ void CXFA_FM2JSContext::LocalTimeFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF } void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if ((argc > 0) && (argc < 4)) { FX_BOOL bFlags = FALSE; - FX_INT32 dDate; + int32_t dDate; CFX_ByteString formatString; CFX_ByteString localString; FXJSE_HVALUE dateValue = GetSimpleHValue(hThis, args, 0); @@ -1459,7 +1459,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE if(HValueIsNull(hThis, dateValue)) { bFlags = TRUE; } else { - dDate = (FX_INT32)HValueToFloat(hThis, dateValue); + dDate = (int32_t)HValueToFloat(hThis, dateValue); bFlags = dDate < 1; } if(argc > 1) { @@ -1479,10 +1479,10 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE } } if (!bFlags) { - FX_INT32 iYear = 1900; - FX_INT32 iMonth = 1; - FX_INT32 iDay = 1; - FX_INT32 i = 0; + int32_t iYear = 1900; + int32_t iMonth = 1; + int32_t iDay = 1; + int32_t i = 0; while (dDate > 0) { if (iMonth == 2) { if ((!((iYear + i) % 4) && ((iYear + i) % 100)) || !((iYear + i) % 400)) { @@ -1495,7 +1495,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE iDay = 1; dDate -= 29; } else { - iDay += static_cast(dDate) - 1; + iDay += static_cast(dDate) - 1; dDate = 0; } } else { @@ -1508,7 +1508,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE iDay = 1; dDate -= 28; } else { - iDay += static_cast(dDate) - 1; + iDay += static_cast(dDate) - 1; dDate = 0; } } @@ -1523,7 +1523,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE iDay = 1; dDate -= 30; } else { - iDay += static_cast(dDate) - 1; + iDay += static_cast(dDate) - 1; dDate = 0; } } else { @@ -1536,7 +1536,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE iDay = 1; dDate -= 31; } else { - iDay += static_cast(dDate) - 1; + iDay += static_cast(dDate) - 1; dDate = 0; } } @@ -1551,7 +1551,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE iDay = 1; dDate -= 30; } else { - iDay += static_cast(dDate) - 1; + iDay += static_cast(dDate) - 1; dDate = 0; } } else { @@ -1564,7 +1564,7 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE iDay = 1; dDate -= 31; } else { - iDay += static_cast(dDate) - 1; + iDay += static_cast(dDate) - 1; dDate = 0; } } @@ -1595,10 +1595,10 @@ void CXFA_FM2JSContext::Num2Date(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE } void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if ((argc > 0) && (argc < 4)) { FX_BOOL bFlags = FALSE; - FX_INT32 iTime; + int32_t iTime; CFX_ByteString formatString; CFX_ByteString localString; FXJSE_HVALUE timeValue = GetSimpleHValue(hThis, args, 0); @@ -1607,7 +1607,7 @@ void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJ if(FXJSE_Value_IsNull(timeValue)) { bFlags = TRUE; } else { - iTime = (FX_INT32)HValueToFloat(hThis, timeValue); + iTime = (int32_t)HValueToFloat(hThis, timeValue); if (FXSYS_abs(iTime) < 1.0) { bFlags = TRUE; } @@ -1652,7 +1652,7 @@ void CXFA_FM2JSContext::Num2GMTime(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJ } void CXFA_FM2JSContext::Num2Time(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if ((argc > 0) && (argc < 4)) { FX_BOOL bFlags = FALSE; FX_FLOAT fTime; @@ -1687,7 +1687,7 @@ void CXFA_FM2JSContext::Num2Time(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE } if (!bFlags) { CFX_ByteString szLocalTimeString; - Num2AllTime(hThis, (FX_INT32)fTime, formatString, localString, FALSE, szLocalTimeString); + Num2AllTime(hThis, (int32_t)fTime, formatString, localString, FALSE, szLocalTimeString); if (szLocalTimeString.IsEmpty()) { szLocalTimeString = FX_BSTRC(""); } @@ -1713,9 +1713,9 @@ void CXFA_FM2JSContext::Time(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg time_t now; time(&now); struct tm *pGmt = gmtime(&now); - FX_INT32 iGMHour = pGmt->tm_hour; - FX_INT32 iGMMin = pGmt->tm_min; - FX_INT32 iGMSec = pGmt->tm_sec; + int32_t iGMHour = pGmt->tm_hour; + int32_t iGMMin = pGmt->tm_min; + int32_t iGMSec = pGmt->tm_sec; FXJSE_Value_SetInteger(args.GetReturnValue(), ((iGMHour * 3600 + iGMMin * 60 + iGMSec) * 1000)); } else { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); @@ -1724,7 +1724,7 @@ void CXFA_FM2JSContext::Time(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg } void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if ((argc > 0) && (argc < 4)) { FX_BOOL bFlags = FALSE; CFX_ByteString timeString; @@ -1779,11 +1779,11 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE wsFormat, pLocale, (CXFA_LocaleMgr*)pMgr); if (timeValue.IsValid()) { CFX_Unitime uniTime = timeValue.GetTime(); - FX_INT32 hour = uniTime.GetHour(); - FX_INT32 min = uniTime.GetMinute(); - FX_INT32 second = uniTime.GetSecond(); - FX_INT32 milSecond = uniTime.GetMillisecond(); - FX_INT32 mins = hour * 60 + min; + int32_t hour = uniTime.GetHour(); + int32_t min = uniTime.GetMinute(); + int32_t second = uniTime.GetSecond(); + int32_t milSecond = uniTime.GetMillisecond(); + int32_t mins = hour * 60 + min; IXFA_TimeZoneProvider* pProvider = IXFA_TimeZoneProvider::Get(); if (pProvider != NULL) { FX_TIMEZONE tz; @@ -1798,7 +1798,7 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE hour = mins / 60; min = mins % 60; } - FX_INT32 iResult = hour * 3600000 + min * 60000 + second * 1000 + milSecond + 1; + int32_t iResult = hour * 3600000 + min * 60000 + second * 1000 + milSecond + 1; FXJSE_Value_SetInteger(args.GetReturnValue(), iResult); } else { FXJSE_Value_SetInteger(args.GetReturnValue(), 0); @@ -1820,10 +1820,10 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE } void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (argc < 3) { FX_BOOL bFlags = FALSE; - FX_INT32 iStyle = 0; + int32_t iStyle = 0; CFX_ByteString szLocal; FXJSE_HVALUE argStyle = 0; FXJSE_HVALUE argLocal = 0; @@ -1832,7 +1832,7 @@ void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_ if (FXJSE_Value_IsNull(argStyle)) { bFlags = TRUE; } - iStyle = (FX_INT32)HValueToFloat(hThis, argStyle); + iStyle = (int32_t)HValueToFloat(hThis, argStyle); if (iStyle > 4 || iStyle < 0) { iStyle = 0; } @@ -1866,7 +1866,7 @@ void CXFA_FM2JSContext::TimeFmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_ pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"TimeFmt"); } } -FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(FX_LPCSTR pData, FX_INT32 iLength, FX_INT32 &iStyle, FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay) +FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(FX_LPCSTR pData, int32_t iLength, int32_t &iStyle, int32_t &iYear, int32_t &iMonth, int32_t &iDay) { iYear = 0; iMonth = 1; @@ -1877,7 +1877,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(FX_LPCSTR pData, FX_INT32 iLength, FX } FX_CHAR strYear[5]; strYear[4] = '\0'; - for (FX_INT32 i = 0; i < 4; ++i) { + for (int32_t i = 0; i < 4; ++i) { if (*(pData + i) <= '9' && *(pData + i) >= '0') { strYear[i] = *(pData + i); } else { @@ -1898,7 +1898,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(FX_LPCSTR pData, FX_INT32 iLength, FX } FX_CHAR strTemp[3]; strTemp[2] = '\0'; - FX_INT32 iPosOff = 0; + int32_t iPosOff = 0; if (iStyle == 0) { iPosOff = 4; if (iLength == 4) { @@ -1979,7 +1979,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateFormat(FX_LPCSTR pData, FX_INT32 iLength, FX iRet = TRUE; return iRet; } -FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(FX_LPCSTR pData, FX_INT32 iLength, FX_INT32 &iHour, FX_INT32 &iMinute, FX_INT32 &iSecond, FX_INT32 &iMilliSecond, FX_INT32 &iZoneHour, FX_INT32 &iZoneMinute) +FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(FX_LPCSTR 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; @@ -1990,12 +1990,12 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(FX_LPCSTR pData, FX_INT32 iLength, FX if (!pData) { return FALSE; } - FX_INT32 iRet = FALSE; + int32_t iRet = FALSE; FX_CHAR strTemp[3]; strTemp[2] = '\0'; - FX_INT32 iIndex = 0; - FX_INT32 iZone = 0; - FX_INT32 i = iIndex; + int32_t iIndex = 0; + int32_t iZone = 0; + int32_t i = iIndex; while (i < iLength) { if ((*(pData + i) > '9' || *(pData + i) < '0') && *(pData + i) != ':' ) { iZone = i; @@ -2006,7 +2006,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(FX_LPCSTR pData, FX_INT32 iLength, FX if (i == iLength) { iZone = iLength; } - FX_INT32 iPos = 0; + int32_t iPos = 0; while (iIndex < iZone) { if (iIndex >= iZone) { break; @@ -2070,7 +2070,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(FX_LPCSTR pData, FX_INT32 iLength, FX } iIndex += 3; } - FX_INT32 iSign = 1; + int32_t iSign = 1; if (*(pData + iIndex) == 'z' || *(pData + iIndex) == 'Z') { iRet = 1; return iRet; @@ -2121,7 +2121,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoTimeFormat(FX_LPCSTR pData, FX_INT32 iLength, FX iRet = TRUE; return iRet; } -FX_BOOL CXFA_FM2JSContext::IsIsoDateTimeFormat(FX_LPCSTR pData, FX_INT32 iLength, FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay, FX_INT32 &iHour, FX_INT32 &iMinute, FX_INT32 &iSecond, FX_INT32 &iMillionSecond, FX_INT32 &iZoneHour, FX_INT32 &iZoneMinute) +FX_BOOL CXFA_FM2JSContext::IsIsoDateTimeFormat(FX_LPCSTR 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; @@ -2132,8 +2132,8 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateTimeFormat(FX_LPCSTR pData, FX_INT32 iLength if (!pData) { return FALSE; } - FX_INT32 iRet = FALSE; - FX_INT32 iIndex = 0; + int32_t iRet = FALSE; + int32_t iIndex = 0; while (*(pData + iIndex) != 'T' && *(pData + iIndex) != 't') { if (iIndex >= iLength) { return iRet; @@ -2143,7 +2143,7 @@ FX_BOOL CXFA_FM2JSContext::IsIsoDateTimeFormat(FX_LPCSTR pData, FX_INT32 iLength if (iIndex != 8 && iIndex != 10) { return iRet; } - FX_INT32 iStyle = -1; + int32_t iStyle = -1; iRet = IsIsoDateFormat(pData, iIndex , iStyle, iYear, iMonth, iDay); if (!iRet) { return iRet; @@ -2328,21 +2328,21 @@ FX_BOOL CXFA_FM2JSContext::GetGMTTime(FXJSE_HOBJECT hThis, FX_BSTR szTime, FX_BS strGMTTime = FX_UTF8Encode(wsRet, wsRet.GetLength()); return TRUE; } -FX_INT32 CXFA_FM2JSContext::DateString2Num(FX_BSTR szDateString) +int32_t CXFA_FM2JSContext::DateString2Num(FX_BSTR szDateString) { FX_BOOL bFlags = FALSE; - FX_INT32 iLength = szDateString.GetLength(); + int32_t iLength = szDateString.GetLength(); FX_BOOL iRet = FALSE; - FX_INT32 iStyle = -1; - FX_INT32 iYear = 0; - FX_INT32 iMonth = 0; - FX_INT32 iDay = 0; - FX_INT32 iHour = 0; - FX_INT32 iMinute = 0; - FX_INT32 iSecond = 0; - FX_INT32 iMillionSecond = 0; - FX_INT32 iZoneHour = 0; - FX_INT32 iZoneMinute = 0; + int32_t iStyle = -1; + int32_t iYear = 0; + int32_t iMonth = 0; + int32_t iDay = 0; + int32_t iHour = 0; + int32_t iMinute = 0; + int32_t iSecond = 0; + int32_t iMillionSecond = 0; + int32_t iZoneHour = 0; + int32_t iZoneMinute = 0; if (iLength <= 10) { iRet = IsIsoDateFormat(szDateString.GetCStr(), iLength, iStyle, iYear, iMonth, iDay); } else { @@ -2352,7 +2352,7 @@ FX_INT32 CXFA_FM2JSContext::DateString2Num(FX_BSTR szDateString) bFlags = TRUE; } FX_FLOAT dDays = 0; - FX_INT32 i = 1; + int32_t i = 1; if (iYear < 1900) { bFlags = TRUE; } @@ -2396,10 +2396,10 @@ FX_INT32 CXFA_FM2JSContext::DateString2Num(FX_BSTR szDateString) } else { dDays = 0; } - return (FX_INT32)dDays; + return (int32_t)dDays; } #define XFA_N 19 -static FX_BYTE g_sAltTable_Date[] = { +static uint8_t g_sAltTable_Date[] = { XFA_N, XFA_N, XFA_N, 3, 9, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, 2, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, @@ -2409,7 +2409,7 @@ static FX_BYTE g_sAltTable_Date[] = { XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, }; -static FX_BYTE g_sAltTable_Time[] = { +static uint8_t g_sAltTable_Time[] = { 14, XFA_N, XFA_N, 3, 9, XFA_N, XFA_N, 15, XFA_N, XFA_N, XFA_N, XFA_N, 6, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, 7, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, @@ -2419,12 +2419,12 @@ static FX_BYTE g_sAltTable_Time[] = { XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, XFA_N, }; -static void XFA_FM_AlternateDateTimeSymbols(CFX_WideString &wsPattern, const CFX_WideString &wsAltSymbols, FX_BYTE *pAltTable) +static void XFA_FM_AlternateDateTimeSymbols(CFX_WideString &wsPattern, const CFX_WideString &wsAltSymbols, uint8_t *pAltTable) { - FX_INT32 nLength = wsPattern.GetLength(); + int32_t nLength = wsPattern.GetLength(); FX_BOOL bInConstRange = FALSE; FX_BOOL bEscape = FALSE; - FX_INT32 i = 0, n = 0; + int32_t i = 0, n = 0; while (i < nLength) { FX_WCHAR wc = wsPattern[i]; if (wc == L'\'') { @@ -2439,7 +2439,7 @@ static void XFA_FM_AlternateDateTimeSymbols(CFX_WideString &wsPattern, const CFX continue; } if (!bInConstRange && (n = wc - L'A') >= 0 && n <= (L'a' - L'A')) { - FX_INT32 nAlt = (FX_INT32)pAltTable[n]; + int32_t nAlt = (int32_t)pAltTable[n]; if (nAlt != XFA_N) { wsPattern.SetAt(i, wsAltSymbols[nAlt]); } @@ -2449,7 +2449,7 @@ static void XFA_FM_AlternateDateTimeSymbols(CFX_WideString &wsPattern, const CFX } } #undef XFA_N -void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard) +void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard) { FX_LOCALEDATETIMESUBCATEGORY strStyle; switch (iStyle) { @@ -2499,7 +2499,7 @@ void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis, FX_INT32 iStyle, } strFormat = FX_UTF8Encode(strRet, strRet.GetLength()); } -void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard) +void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard) { FX_LOCALEDATETIMESUBCATEGORY strStyle; switch (iStyle) { @@ -2550,22 +2550,22 @@ void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis, FX_INT32 iStyle, } strFormat = FX_UTF8Encode(strRet, strRet.GetLength()); } -void CXFA_FM2JSContext::GetStandardDateFormat(FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat) +void CXFA_FM2JSContext::GetStandardDateFormat(FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat) { GetLocalDateFormat(hThis, iStyle, szLocalStr, strFormat, TRUE); } -void CXFA_FM2JSContext::GetStandardTimeFormat(FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat) +void CXFA_FM2JSContext::GetStandardTimeFormat(FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat) { GetLocalTimeFormat(hThis, iStyle, szLocalStr, strFormat, TRUE); } -void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis, FX_INT32 iTime, FX_BSTR szFormat, FX_BSTR szLocale, FX_BOOL bGM, CFX_ByteString &strTime) +void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis, int32_t iTime, FX_BSTR szFormat, FX_BSTR szLocale, FX_BOOL bGM, CFX_ByteString &strTime) { - FX_INT32 iHour = 0; - FX_INT32 iMin = 0; - FX_INT32 iSec = 0; - FX_INT32 iZoneHour = 0; - FX_INT32 iZoneMin = 0; - FX_INT32 iZoneSec = 0; + int32_t iHour = 0; + int32_t iMin = 0; + int32_t iSec = 0; + int32_t iZoneHour = 0; + int32_t iZoneMin = 0; + int32_t iZoneSec = 0; iHour = static_cast(iTime) / 3600000; iMin = (static_cast(iTime) - iHour * 3600000) / 60000; iSec = (static_cast(iTime) - iHour * 3600000 - iMin * 60000) / 1000; @@ -2575,7 +2575,7 @@ void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis, FX_INT32 iTime, FX_BSTR iMin += iZoneMin; iSec += iZoneSec; } - FX_INT32 iRet = 0; + int32_t iRet = 0; CFX_ByteString strIsoTime; strIsoTime.Format("%02d:%02d:%02d", iHour, iMin, iSec); if (bGM) { @@ -2588,18 +2588,18 @@ void CXFA_FM2JSContext::Num2AllTime(FXJSE_HOBJECT hThis, FX_INT32 iTime, FX_BSTR } return; } -void CXFA_FM2JSContext::GetLocalTimeZone(FX_INT32 &iHour, FX_INT32 &iMin, FX_INT32 &iSec) +void CXFA_FM2JSContext::GetLocalTimeZone(int32_t &iHour, int32_t &iMin, int32_t &iSec) { time_t now; time(&now); struct tm *pGmt = gmtime(&now); - FX_INT32 iGMHour = pGmt->tm_hour; - FX_INT32 iGMMin = pGmt->tm_min; - FX_INT32 iGMSec = pGmt->tm_sec; + int32_t iGMHour = pGmt->tm_hour; + int32_t iGMMin = pGmt->tm_min; + int32_t iGMSec = pGmt->tm_sec; struct tm *pLocal = localtime(&now); - FX_INT32 iLocalHour = pLocal->tm_hour; - FX_INT32 iLocalMin = pLocal->tm_min; - FX_INT32 iLocalSec = pLocal->tm_sec; + int32_t iLocalHour = pLocal->tm_hour; + int32_t iLocalMin = pLocal->tm_min; + int32_t iLocalSec = pLocal->tm_sec; iHour = iLocalHour - iGMHour; iMin = iLocalMin - iGMMin; iSec = iLocalSec - iGMSec; @@ -2628,7 +2628,7 @@ void CXFA_FM2JSContext::Apr(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else { FX_DOUBLE r = 2 * (nPeriods * nPayment - nPrincipal) / (nPeriods * nPrincipal); FX_DOUBLE nTemp = 1; - for (FX_INT32 i = 0; i < nPeriods; ++i) { + for (int32_t i = 0; i < nPeriods; ++i) { nTemp *= (1 + r); } FX_DOUBLE nRet = r * nTemp / (nTemp - 1) - nPayment / nPrincipal; @@ -2641,7 +2641,7 @@ void CXFA_FM2JSContext::Apr(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } r = r - nRet / nDerivative; nTemp = 1; - for (FX_INT32 i = 0; i < nPeriods; ++i) { + for (int32_t i = 0; i < nPeriods; ++i) { nTemp *= (1 + r); } nRet = r * nTemp / (nTemp - 1) - nPayment / nPrincipal; @@ -2766,8 +2766,8 @@ void CXFA_FM2JSContext::IPmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg } else { FX_FLOAT fResult = 0; FX_FLOAT nRateOfMonth = nRate / 12; - FX_INT32 iNums = (FX_INT32)((FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount)) - FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount - nRateOfMonth))) / FXSYS_log10((FX_FLOAT)(1 + nRateOfMonth))); - FX_INT32 iEnd = (FX_INT32)(nFirstMonth + nNumberOfMonths - 1); + int32_t iNums = (int32_t)((FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount)) - FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount - nRateOfMonth))) / FXSYS_log10((FX_FLOAT)(1 + nRateOfMonth))); + int32_t iEnd = (int32_t)(nFirstMonth + nNumberOfMonths - 1); if (iEnd > iNums) { iEnd = iNums; } @@ -2777,7 +2777,7 @@ void CXFA_FM2JSContext::IPmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg fResult = 0; } if(!bFlags) { - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < nFirstMonth - 1; ++i) { nPrincpalAmount -= nPayment - nPrincpalAmount * nRateOfMonth; } @@ -2802,11 +2802,11 @@ void CXFA_FM2JSContext::IPmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg void CXFA_FM2JSContext::NPV(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (argc > 2) { FX_BOOL bFlags = FALSE; FXJSE_HVALUE *argValues = FX_Alloc(FXJSE_HVALUE, argc); - for (FX_INT32 i = 0; i < argc; i++) { + for (int32_t i = 0; i < argc; i++) { argValues[i] = GetSimpleHValue(hThis, args, i); if (HValueIsNull(hThis, argValues[i])) { bFlags = TRUE; @@ -2819,14 +2819,14 @@ void CXFA_FM2JSContext::NPV(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH); } else { FX_DOUBLE *pData = FX_Alloc(FX_DOUBLE, argc - 1); - for (FX_INT32 i = 1; i < argc; i++) { + for (int32_t i = 1; i < argc; i++) { pData[i - 1] = HValueToDouble(hThis, argValues[i]); } FX_DOUBLE nSum = 0; - FX_INT32 iIndex = 0; - for (FX_INT32 i = 0; i < argc - 1; i++) { + int32_t iIndex = 0; + for (int32_t i = 0; i < argc - 1; i++) { FX_DOUBLE nTemp = 1; - for (FX_INT32 j = 0; j <= i; j++) { + for (int32_t j = 0; j <= i; j++) { nTemp *= 1 + nRate; } FX_DOUBLE nNum = *(pData + iIndex++); @@ -2839,7 +2839,7 @@ void CXFA_FM2JSContext::NPV(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else { FXJSE_Value_SetNull(args.GetReturnValue()); } - for (FX_INT32 i = 0; i < argc; i++) { + for (int32_t i = 0; i < argc; i++) { FXJSE_Value_Release(argValues[i]); } FX_Free(argValues); @@ -2872,7 +2872,7 @@ void CXFA_FM2JSContext::Pmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu FX_FLOAT nSum = 0; FX_FLOAT nTmp = 1 + nRate; nSum = nTmp; - for (FX_INT32 i = 0; i < nPeriods - 1; ++i) { + for (int32_t i = 0; i < nPeriods - 1; ++i) { nSum *= nTmp; } FXJSE_Value_SetFloat(args.GetReturnValue(), (nPrincipal * nRate * nSum) / (nSum - 1)); @@ -2914,10 +2914,10 @@ void CXFA_FM2JSContext::PPmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg if(bFlags) { pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH); } else { - FX_INT32 iEnd = (FX_INT32)(nFirstMonth + nNumberOfMonths - 1); + int32_t iEnd = (int32_t)(nFirstMonth + nNumberOfMonths - 1); FX_FLOAT nSum = 0; FX_FLOAT nRateOfMonth = nRate / 12; - FX_INT32 iNums = (FX_INT32)((FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount)) - FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount - nRateOfMonth))) / FXSYS_log10((FX_FLOAT)(1 + nRateOfMonth))); + int32_t iNums = (int32_t)((FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount)) - FXSYS_log10((FX_FLOAT)(nPayment / nPrincpalAmount - nRateOfMonth))) / FXSYS_log10((FX_FLOAT)(1 + nRateOfMonth))); if (iEnd > iNums) { iEnd = iNums; } @@ -2925,7 +2925,7 @@ void CXFA_FM2JSContext::PPmt(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg bFlags = TRUE; } if(!bFlags) { - FX_INT32 i = 0; + int32_t i = 0; for (i = 0; i < nFirstMonth - 1; ++i) { nPrincpalAmount -= nPayment - nPrincpalAmount * nRateOfMonth; } @@ -2973,7 +2973,7 @@ void CXFA_FM2JSContext::PV(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argum pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH); } else { FX_DOUBLE nTemp = 1; - for (FX_INT32 i = 0; i < nPeriod; ++i) { + for (int32_t i = 0; i < nPeriod; ++i) { nTemp *= 1 + nRate; } nTemp = 1 / nTemp; @@ -3055,14 +3055,14 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (argc > 1) { FXJSE_HVALUE argOne = args.GetValue(0); FX_BOOL argOneIsNull = FALSE; - FX_INT32 iIndex = 0; + int32_t iIndex = 0; argOneIsNull = HValueIsNull(hThis, argOne); if (!argOneIsNull) { - iIndex = (FX_INT32)HValueToFloat(hThis, argOne); + iIndex = (int32_t)HValueToFloat(hThis, argOne); } FXJSE_Value_Release(argOne); if (argOneIsNull) { @@ -3072,14 +3072,14 @@ void CXFA_FM2JSContext::Choose(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A } else { FX_BOOL bFound = FALSE; FX_BOOL bStopCounterFlags = FALSE; - FX_INT32 iArgIndex = 1; - FX_INT32 iValueIndex = 0; + int32_t iArgIndex = 1; + int32_t iValueIndex = 0; while(!bFound && !bStopCounterFlags && (iArgIndex < argc)) { FXJSE_HVALUE argIndexValue = args.GetValue(iArgIndex); if (FXJSE_Value_IsArray(argIndexValue)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argIndexValue, FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if (iLength > 3) { bStopCounterFlags = TRUE; @@ -3160,14 +3160,14 @@ void CXFA_FM2JSContext::HasValue(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE } void CXFA_FM2JSContext::Oneof(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if(argc > 1) { FX_BOOL bFlags = FALSE; FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); FXJSE_HVALUE *parametersValue = 0; - FX_INT32 iCount = 0; + int32_t iCount = 0; unfoldArgs(hThis, args, parametersValue, iCount, 1); - for(FX_INT32 i = 0; i < iCount; i++) { + for(int32_t i = 0; i < iCount; i++) { if(simpleValueCompare(hThis, argOne, parametersValue[i])) { bFlags = TRUE; break; @@ -3175,7 +3175,7 @@ void CXFA_FM2JSContext::Oneof(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } FXJSE_Value_SetInteger(args.GetReturnValue(), bFlags); FXJSE_Value_Release(argOne); - for (FX_INT32 i = 0; i < iCount; i++) { + for (int32_t i = 0; i < iCount; i++) { FXJSE_Value_Release(parametersValue[i]); } FX_Free(parametersValue); @@ -3187,7 +3187,7 @@ void CXFA_FM2JSContext::Oneof(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } void CXFA_FM2JSContext::Within(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if(argc == 3) { FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); if(FXJSE_Value_IsNull(argOne)) { @@ -3220,7 +3220,7 @@ void CXFA_FM2JSContext::Within(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A } void CXFA_FM2JSContext::If(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (args.GetLength() == 3) { FXJSE_HVALUE argCondition = GetSimpleHValue(hThis, args, 0); FXJSE_HVALUE argFirstValue = GetSimpleHValue(hThis, args, 1); @@ -3271,20 +3271,20 @@ void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu FXJSE_HVALUE argOne = args.GetValue(0); if (FXJSE_Value_IsNull(argOne)) { FXJSE_HVALUE rgValues[3]; - for (FX_INT32 i = 0; i < 3; i++) { + for (int32_t i = 0; i < 3; i++) { rgValues[i] = FXJSE_Value_Create(hruntime); } FXJSE_Value_SetInteger(rgValues[0], 4); FXJSE_Value_SetNull(rgValues[1]); FXJSE_Value_SetNull(rgValues[2]); FXJSE_Value_SetArray(args.GetReturnValue(), 3, rgValues); - for (FX_INT32 i = 0; i < 3; i++) { + for (int32_t i = 0; i < 3; i++) { FXJSE_Value_Release(rgValues[i]); } } else if (FXJSE_Value_IsArray(argOne)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argOne, FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); FXSYS_assert(iLength >= 3); FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); @@ -3295,14 +3295,14 @@ void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH); } else if(FXJSE_Value_IsNull(propertyValue) && (!FXJSE_Value_IsNull(jsObjectValue))) { FXJSE_HVALUE rgValues[3]; - for (FX_INT32 i = 0; i < 3; i++) { + for (int32_t i = 0; i < 3; i++) { rgValues[i] = FXJSE_Value_Create(hruntime); } FXJSE_Value_SetInteger(rgValues[0], 3); FXJSE_Value_SetNull(rgValues[1]); FXJSE_Value_Set(rgValues[2], jsObjectValue); FXJSE_Value_SetArray(args.GetReturnValue(), 3, rgValues); - for (FX_INT32 i = 0; i < 3; i++) { + for (int32_t i = 0; i < 3; i++) { FXJSE_Value_Release(rgValues[i]); } } else { @@ -3312,14 +3312,14 @@ void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu FXJSE_Value_Release(propertyValue); } else if(FXJSE_Value_IsObject(argOne)) { FXJSE_HVALUE rgValues[3]; - for (FX_INT32 i = 0; i < 3; i++) { + for (int32_t i = 0; i < 3; i++) { rgValues[i] = FXJSE_Value_Create(hruntime); } FXJSE_Value_SetInteger(rgValues[0], 3); FXJSE_Value_SetNull(rgValues[1]); FXJSE_Value_Set(rgValues[2], argOne); FXJSE_Value_SetArray(args.GetReturnValue(), 3, rgValues); - for (FX_INT32 i = 0; i < 3; i++) { + for (int32_t i = 0; i < 3; i++) { FXJSE_Value_Release(rgValues[i]); } } else if(FXJSE_Value_IsBoolean(argOne) || FXJSE_Value_IsUTF8String(argOne) || FXJSE_Value_IsNumber(argOne)) { @@ -3360,8 +3360,8 @@ void CXFA_FM2JSContext::UnitType(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE unitspanString.MakeLower(); CFX_WideString wsTypeString = CFX_WideString::FromUTF8(unitspanString, unitspanString.GetLength()); FX_LPCWSTR pData = wsTypeString; - FX_INT32 u = 0; - FX_INT32 uLen = wsTypeString.GetLength(); + int32_t u = 0; + int32_t uLen = wsTypeString.GetLength(); while (*(pData + u) == 0x20 || *(pData + u) == 0x09 || *(pData + u) == 0x0B || *(pData + u) == 0x0C || *(pData + u) == 0x0A || *(pData + u) == 0x0D) { u++; } @@ -3435,7 +3435,7 @@ void CXFA_FM2JSContext::UnitType(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE } void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if ((argc == 1) || (argc == 2)) { FXJSE_HVALUE unitspanValue = GetSimpleHValue(hThis, args, 0); FXJSE_HVALUE unitValue = 0; @@ -3449,12 +3449,12 @@ void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJS HValueToUTF8String(unitspanValue, unitspanString); FX_LPCSTR pData = unitspanString; if (pData) { - FX_INT32 u = 0; + int32_t u = 0; while (*(pData + u) == 0x20 || *(pData + u) == 0x09 || *(pData + u) == 0x0B || *(pData + u) == 0x0C || *(pData + u) == 0x0A || *(pData + u) == 0x0D) { FX_CHAR ch = *(pData + u); ++u; } - FX_INT32 uStart = u; + int32_t uStart = u; while (u < unitspanString.GetLength()) { if ((*(pData + u) > '9' || *(pData + u) < '0') && *(pData + u) != '.' && *(pData + u) != '-') { break; @@ -3466,7 +3466,7 @@ void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJS while (*(pData + u) == ' ' || *(pData + u) == 0x09 || *(pData + u) == 0x0B || *(pData + u) == 0x0C || *(pData + u) == 0x0A || *(pData + u) == 0x0D) { ++u; } - FX_INT32 uLen = unitspanString.GetLength(); + int32_t uLen = unitspanString.GetLength(); while (u < uLen) { if (*(pData + u) == ' ') { break; @@ -3480,7 +3480,7 @@ void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJS CFX_ByteString unitTempString; HValueToUTF8String(unitValue, unitTempString); FX_LPCSTR pData = unitTempString; - FX_INT32 u = 0; + int32_t u = 0; while (*(pData + u) == ' ' || *(pData + u) == 0x09 || *(pData + u) == 0x0B || *(pData + u) == 0x0C || *(pData + u) == 0x0A || *(pData + u) == 0x0D) { ++u; } @@ -3493,7 +3493,7 @@ void CXFA_FM2JSContext::UnitValue(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJS while (*(pData + u) == ' ' || *(pData + u) == 0x09 || *(pData + u) == 0x0B || *(pData + u) == 0x0C || *(pData + u) == 0x0A || *(pData + u) == 0x0D) { ++u; } - FX_INT32 uLen = unitTempString.GetLength(); + int32_t uLen = unitTempString.GetLength(); while (u < uLen) { if (*(pData + u) == ' ') { break; @@ -3612,12 +3612,12 @@ void CXFA_FM2JSContext::Concat(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (argc >= 1) { CFX_ByteString resultString; FX_BOOL bAllNull = TRUE; FXJSE_HVALUE *argValues = FX_Alloc(FXJSE_HVALUE, argc); - for (FX_INT32 i = 0; i < argc; i++) { + for (int32_t i = 0; i < argc; i++) { argValues[i] = GetSimpleHValue(hThis, args, i); if(!HValueIsNull(hThis, argValues[i])) { CFX_ByteString valueStr; @@ -3626,7 +3626,7 @@ void CXFA_FM2JSContext::Concat(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A bAllNull = FALSE; } } - for(FX_INT32 i = 0; i < argc; i++) { + for(int32_t i = 0; i < argc; i++) { FXJSE_Value_Release(argValues[i]); } FX_Free(argValues); @@ -3643,7 +3643,7 @@ void CXFA_FM2JSContext::Decode(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if(argc == 1) { FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); if (HValueIsNull(hThis, argOne)) { @@ -3686,8 +3686,8 @@ void CXFA_FM2JSContext::DecodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu { CFX_WideString wsURLString = CFX_WideString::FromUTF8(szURLString.GetCStr(), szURLString.GetLength()); FX_LPCWSTR pData = wsURLString; - FX_INT32 iLen = wsURLString.GetLength(); - FX_INT32 i = 0; + int32_t iLen = wsURLString.GetLength(); + int32_t i = 0; FX_WCHAR ch = 0; FX_WCHAR chTemp = 0; CFX_WideTextBuf wsResultBuf; @@ -3695,7 +3695,7 @@ void CXFA_FM2JSContext::DecodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu ch = *(pData + i); if ('%' == ch) { chTemp = 0; - FX_INT32 iCount = 0; + int32_t iCount = 0; while (iCount < 2) { ++i; ch = *(pData + i); @@ -3738,10 +3738,10 @@ void CXFA_FM2JSContext::DecodeHTML(FX_BSTR szHTMLString, CFX_ByteTextBuf &szResu { CFX_WideString wsHTMLString = CFX_WideString::FromUTF8(szHTMLString.GetCStr(), szHTMLString.GetLength()); FX_WCHAR strString[9]; - FX_INT32 iStrIndex = 0; - FX_INT32 iLen = wsHTMLString.GetLength(); - FX_INT32 i = 0; - FX_INT32 iCode = 0; + int32_t iStrIndex = 0; + int32_t iLen = wsHTMLString.GetLength(); + int32_t i = 0; + int32_t iCode = 0; FX_WCHAR ch = 0; FX_LPCWSTR pData = wsHTMLString; CFX_WideTextBuf wsResultBuf; @@ -3791,7 +3791,7 @@ void CXFA_FM2JSContext::DecodeHTML(FX_BSTR szHTMLString, CFX_ByteTextBuf &szResu ++i; continue; } - FX_UINT32 iData = 0; + uint32_t iData = 0; if (HTMLSTR2Code(strString, iData)) { wsResultBuf.AppendChar((FX_WCHAR)iData); } else { @@ -3808,10 +3808,10 @@ void CXFA_FM2JSContext::DecodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu { CFX_WideString wsXMLString = CFX_WideString::FromUTF8(szXMLString.GetCStr(), szXMLString.GetLength()); FX_WCHAR strString[9]; - FX_INT32 iStrIndex = 0; - FX_INT32 iLen = wsXMLString.GetLength(); - FX_INT32 i = 0; - FX_INT32 iCode = 0; + int32_t iStrIndex = 0; + int32_t iLen = wsXMLString.GetLength(); + int32_t i = 0; + int32_t iCode = 0; FX_WCHAR ch = 0; FX_LPCWSTR pData = wsXMLString; CFX_WideTextBuf wsXMLBuf; @@ -3868,7 +3868,7 @@ void CXFA_FM2JSContext::DecodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu L"lt", L"gt" }; - FX_INT32 iIndex = 0; + int32_t iIndex = 0; while (iIndex < 5) { if (FXSYS_memcmp(strString, strName[iIndex], FXSYS_wcslen(strName[iIndex])) == 0) { break; @@ -3907,7 +3907,7 @@ void CXFA_FM2JSContext::Encode(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if(argc == 1) { FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); if (HValueIsNull(hThis, argOne)) { @@ -3951,7 +3951,7 @@ void CXFA_FM2JSContext::EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu CFX_WideString wsURLString = CFX_WideString::FromUTF8(szURLString.GetCStr(), szURLString.GetLength()); CFX_WideTextBuf wsResultBuf; FX_WCHAR ch = 0; - FX_INT32 iLength = wsURLString.GetLength(); + int32_t iLength = wsURLString.GetLength(); FX_WCHAR strEncode[4]; strEncode[0] = '%'; strEncode[3] = 0; @@ -3959,13 +3959,13 @@ void CXFA_FM2JSContext::EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu FX_WCHAR strReserved[] = {';', '/', '?', ':', '@', '=', '&'}; FX_WCHAR strSpecial[] = {'$', '-', '+', '!', '*', '\'', '(', ')', ','}; const FX_LPCWSTR strCode = L"0123456789abcdef"; - for (FX_INT32 u = 0; u < iLength; ++u) { + for (int32_t u = 0; u < iLength; ++u) { ch = wsURLString.GetAt(u); - FX_INT32 i = 0; - FX_INT32 iCount = sizeof(strUnsafe) / sizeof(strUnsafe[0]); + int32_t i = 0; + int32_t iCount = sizeof(strUnsafe) / sizeof(strUnsafe[0]); while (i < iCount) { if (ch == strUnsafe[i]) { - FX_INT32 iIndex = ch / 16; + int32_t iIndex = ch / 16; strEncode[1] = strCode[iIndex]; strEncode[2] = strCode[ch - iIndex * 16]; wsResultBuf << FX_WSTRC(strEncode); @@ -3980,7 +3980,7 @@ void CXFA_FM2JSContext::EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu iCount = sizeof(strReserved) / sizeof(strReserved[0]); while (i < iCount) { if (ch == strReserved[i]) { - FX_INT32 iIndex = ch / 16; + int32_t iIndex = ch / 16; strEncode[1] = strCode[iIndex]; strEncode[2] = strCode[ch - iIndex * 16]; wsResultBuf << FX_WSTRC(strEncode); @@ -4004,19 +4004,19 @@ void CXFA_FM2JSContext::EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu continue; } if (ch >= 0x80 && ch <= 0xff) { - FX_INT32 iIndex = ch / 16; + int32_t iIndex = ch / 16; strEncode[1] = strCode[iIndex]; strEncode[2] = strCode[ch - iIndex * 16]; wsResultBuf << FX_WSTRC(strEncode); } else if ((ch >= 0x0 && ch <= 0x1f) || ch == 0x7f) { - FX_INT32 iIndex = ch / 16; + int32_t iIndex = ch / 16; strEncode[1] = strCode[iIndex]; strEncode[2] = strCode[ch - iIndex * 16]; wsResultBuf << FX_WSTRC(strEncode); } else if (ch >= 0x20 && ch <= 0x7e) { wsResultBuf.AppendChar(ch); } else { - FX_INT32 iRadix = 16; + int32_t iRadix = 16; CFX_WideString strTmp; while (ch >= iRadix) { FX_WCHAR tmp = strCode[ch % iRadix]; @@ -4024,11 +4024,11 @@ void CXFA_FM2JSContext::EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResu strTmp += tmp; } strTmp += strCode[ch]; - FX_INT32 iLen = strTmp.GetLength(); + int32_t iLen = strTmp.GetLength(); if (iLen < 2) { break; } - FX_INT32 iIndex = 0; + int32_t iIndex = 0; if (iLen % 2 != 0) { strEncode[1] = '0'; strEncode[2] = strTmp.GetAt(iLen - 1); @@ -4064,11 +4064,11 @@ void CXFA_FM2JSContext::EncodeHTML(FX_BSTR szHTMLString, CFX_ByteTextBuf &szResu strEncode[7] = ';'; strEncode[8] = 0; CFX_WideTextBuf wsResultBuf; - FX_UINT32 ch = 0; - FX_INT32 iLen = wsHTMLString.GetLength(); - FX_INT32 i = 0; + uint32_t ch = 0; + int32_t iLen = wsHTMLString.GetLength(); + int32_t i = 0; FX_LPCWSTR pData = wsHTMLString; - FX_INT32 iIndex = 0; + int32_t iIndex = 0; CFX_WideString htmlReserve; while (i < iLen) { ch = *(pData + i); @@ -4088,8 +4088,8 @@ void CXFA_FM2JSContext::EncodeHTML(FX_BSTR szHTMLString, CFX_ByteTextBuf &szResu strEncode[6] = 0; wsResultBuf << FX_WSTRC(strEncode); } else { - FX_INT32 iBigByte = ch / 256; - FX_INT32 iLittleByte = ch % 256; + int32_t iBigByte = ch / 256; + int32_t iLittleByte = ch % 256; strEncode[3] = strCode[iBigByte / 16]; strEncode[4] = strCode[iBigByte % 16]; strEncode[5] = strCode[iLittleByte / 16]; @@ -4130,9 +4130,9 @@ void CXFA_FM2JSContext::EncodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu }; const FX_LPCWSTR strCode = L"0123456789abcdef"; FX_WCHAR ch = 0; - FX_INT32 iLength = wsXMLString.GetLength(); - FX_INT32 iIndex = 0; - FX_INT32 u = 0; + int32_t iLength = wsXMLString.GetLength(); + int32_t iIndex = 0; + int32_t u = 0; FX_LPCWSTR pData = wsXMLString; for (u = 0; u < iLength; ++u) { ch = *(pData + u); @@ -4173,8 +4173,8 @@ void CXFA_FM2JSContext::EncodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu strEncode[6] = 0; wsResultBuf << FX_WSTRC(strEncode); } else { - FX_INT32 iBigByte = ch / 256; - FX_INT32 iLittleByte = ch % 256; + int32_t iBigByte = ch / 256; + int32_t iLittleByte = ch % 256; strEncode[3] = strCode[iBigByte / 16]; strEncode[4] = strCode[iBigByte % 16]; strEncode[5] = strCode[iLittleByte / 16]; @@ -4188,13 +4188,13 @@ void CXFA_FM2JSContext::EncodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResu wsResultBuf.AppendChar(0); szResultBuf = FX_UTF8Encode(wsResultBuf.GetBuffer(), wsResultBuf.GetLength()); } -FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(FX_WSTR pData, FX_UINT32 &iCode) +FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(FX_WSTR pData, uint32_t &iCode) { - FX_INT32 iLength = pData.GetLength(); - FX_UINT32 uHash = FX_HashCode_String_GetW(pData.GetPtr(), iLength); + int32_t iLength = pData.GetLength(); + uint32_t uHash = FX_HashCode_String_GetW(pData.GetPtr(), iLength); XFA_FMHtmlHashedReserveCode htmlhashedreservecode; - FX_INT32 iStart = 0, iEnd = (sizeof(reservesForDecode) / sizeof(reservesForDecode[0])) - 1; - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iStart = 0, iEnd = (sizeof(reservesForDecode) / sizeof(reservesForDecode[0])) - 1; + int32_t iMid = (iStart + iEnd) / 2; do { iMid = (iStart + iEnd) / 2; htmlhashedreservecode = reservesForDecode[iMid]; @@ -4209,11 +4209,11 @@ FX_BOOL CXFA_FM2JSContext::HTMLSTR2Code(FX_WSTR pData, FX_UINT32 &iCode) } while (iStart <= iEnd); return FALSE; } -FX_BOOL CXFA_FM2JSContext::HTMLCode2STR(FX_UINT32 iCode, CFX_WideString &wsHTMLReserve) +FX_BOOL CXFA_FM2JSContext::HTMLCode2STR(uint32_t iCode, CFX_WideString &wsHTMLReserve) { XFA_FMHtmlReserveCode htmlreservecode; - FX_INT32 iStart = 0, iEnd = (sizeof(reservesForEncode) / sizeof(reservesForEncode[0])) - 1; - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iStart = 0, iEnd = (sizeof(reservesForEncode) / sizeof(reservesForEncode[0])) - 1; + int32_t iMid = (iStart + iEnd) / 2; do { iMid = (iStart + iEnd) / 2; htmlreservecode = reservesForEncode[iMid]; @@ -4260,8 +4260,8 @@ static FX_BOOL XFA_PATTERN_STRING_Type(FX_BSTR szPattern, FX_DWORD& patternType) patternType = XFA_VT_NULL; wsPattern.MakeLower(); FX_LPCWSTR pData = wsPattern; - FX_INT32 iLength = wsPattern.GetLength(); - FX_INT32 iIndex = 0; + int32_t iLength = wsPattern.GetLength(); + int32_t iIndex = 0; FX_BOOL bSingleQuotation = FALSE; FX_WCHAR patternChar; while (iIndex < iLength) { @@ -4308,7 +4308,7 @@ static FX_BOOL XFA_PATTERN_STRING_Type(FX_BSTR szPattern, FX_DWORD& patternType) void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (argc >= 2) { FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1); @@ -4406,7 +4406,7 @@ void CXFA_FM2JSContext::Left(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg } else { CFX_ByteString sourceString; HValueToUTF8String(argOne, sourceString); - FX_INT32 count = HValueToInteger(hThis, argTwo); + int32_t count = HValueToInteger(hThis, argTwo); if (count < 0) { count = 0; } @@ -4438,7 +4438,7 @@ void CXFA_FM2JSContext::Len(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } void CXFA_FM2JSContext::Lower(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if ((argc > 0) && (argc < 3)) { CFX_ByteString argString; FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); @@ -4453,9 +4453,9 @@ void CXFA_FM2JSContext::Lower(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar CFX_WideTextBuf lowStringBuf; CFX_WideString wsArgString = CFX_WideString::FromUTF8(argString, argString.GetLength()); FX_LPCWSTR pData = wsArgString; - FX_INT32 iLen = argString.GetLength(); - FX_INT32 i = 0; - FX_INT32 ch = 0; + int32_t iLen = argString.GetLength(); + int32_t i = 0; + int32_t ch = 0; while (i < iLen) { ch = *(pData + i); if (ch >= 0x41 && ch <= 0x5A) { @@ -4629,7 +4629,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } void CXFA_FM2JSContext::Replace(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if ((argc == 2) || (argc == 3)) { FX_BOOL bFlags = FALSE; FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); @@ -4648,17 +4648,17 @@ void CXFA_FM2JSContext::Replace(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_ argThree = GetSimpleHValue(hThis, args, 2); HValueToUTF8String(argThree, threeString); } - FX_INT32 iSrcLen = oneString.GetLength(); - FX_INT32 iFindLen = twoString.GetLength(); + int32_t iSrcLen = oneString.GetLength(); + int32_t iFindLen = twoString.GetLength(); CFX_ByteTextBuf resultString; - FX_INT32 iFindIndex = 0; - FX_BYTE ch = 0; - for (FX_INT32 u = 0; u < iSrcLen; ++u) { + int32_t iFindIndex = 0; + uint8_t ch = 0; + for (int32_t u = 0; u < iSrcLen; ++u) { ch = oneString.GetAt(u); if (ch == twoString.GetAt(iFindIndex)) { - FX_INT32 iTemp = u + 1; + int32_t iTemp = u + 1; ++iFindIndex; - FX_BYTE chTemp = 0; + uint8_t chTemp = 0; while (iFindIndex < iFindLen) { chTemp = oneString.GetAt(iTemp); if (chTemp == twoString.GetAt(iFindIndex)) { @@ -4708,7 +4708,7 @@ void CXFA_FM2JSContext::Right(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } else { CFX_ByteString sourceString; HValueToUTF8String(argOne, sourceString); - FX_INT32 count = HValueToInteger(hThis, argTwo); + int32_t count = HValueToInteger(hThis, argTwo); if (count < 0) { count = 0; } @@ -4748,11 +4748,11 @@ void CXFA_FM2JSContext::Space(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar if (FXJSE_Value_IsNull(argOne)) { FXJSE_Value_SetNull(args.GetReturnValue()); } else { - FX_INT32 count = 0; + int32_t count = 0; count = HValueToInteger(hThis, argOne); count = (count < 0) ? 0 : count; CFX_ByteTextBuf spaceString; - FX_INT32 index = 0; + int32_t index = 0; while (index < count) { spaceString.AppendByte(' '); index++; @@ -4767,12 +4767,12 @@ void CXFA_FM2JSContext::Space(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if ((argc > 0) && (argc < 4)) { FX_BOOL bFlags = FALSE; FX_FLOAT fNumber; - FX_INT32 iWidth = 10; - FX_INT32 iPrecision = 0; + int32_t iWidth = 10; + int32_t iPrecision = 0; FXJSE_HVALUE numberValue = GetSimpleHValue(hThis, args, 0); FXJSE_HVALUE widthValue = 0; FXJSE_HVALUE precisionValue = 0; @@ -4783,11 +4783,11 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } if(argc > 1) { widthValue = GetSimpleHValue(hThis, args, 1); - iWidth = (FX_INT32)HValueToFloat(hThis, widthValue); + iWidth = (int32_t)HValueToFloat(hThis, widthValue); } if (argc == 3) { precisionValue = GetSimpleHValue(hThis, args, 2); - iPrecision = (FX_INT32)HValueToFloat(hThis, precisionValue); + iPrecision = (int32_t)HValueToFloat(hThis, precisionValue); if (iPrecision < 0) { iPrecision = 0; } @@ -4802,8 +4802,8 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu formatStr += "f"; numberString.Format(formatStr, fNumber); FX_LPCSTR pData = numberString; - FX_INT32 iLength = numberString.GetLength(); - FX_INT32 u = 0; + int32_t iLength = numberString.GetLength(); + int32_t u = 0; while (u < iLength) { if (*(pData + u) == '.') { break; @@ -4812,7 +4812,7 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } CFX_ByteTextBuf resultBuf; if (u > iWidth || (iPrecision + u) >= iWidth) { - FX_INT32 i = 0; + int32_t i = 0; while (i < iWidth) { resultBuf.AppendChar('*'); ++i; @@ -4821,14 +4821,14 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } else { if (u == iLength) { if (iLength > iWidth) { - FX_INT32 i = 0; + int32_t i = 0; while (i < iWidth) { resultBuf.AppendChar('*'); ++i; } } else { - FX_INT32 i = 0; - FX_INT32 iSpace = iWidth - iLength; + int32_t i = 0; + int32_t iSpace = iWidth - iLength; while (i < iSpace) { resultBuf.AppendChar(' '); ++i; @@ -4836,13 +4836,13 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu resultBuf << pData; } } else { - FX_INT32 iLeavingSpace = 0; + int32_t iLeavingSpace = 0; if (iPrecision == 0) { iLeavingSpace = iWidth - (u + iPrecision); } else { iLeavingSpace = iWidth - (u + iPrecision + 1); } - FX_INT32 i = 0; + int32_t i = 0; while (i < iLeavingSpace) { resultBuf.AppendChar(' '); ++i; @@ -4890,14 +4890,14 @@ void CXFA_FM2JSContext::Str(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu } void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if ((argc == 3) || (argc == 4)) { FX_BOOL bFlags = FALSE; CFX_ByteString sourceString; CFX_ByteString insertString; - FX_INT32 iLength = 0; - FX_INT32 iStart = 0; - FX_INT32 iDelete = 0; + int32_t iLength = 0; + int32_t iStart = 0; + int32_t iDelete = 0; FXJSE_HVALUE sourceValue = GetSimpleHValue(hThis, args, 0); FXJSE_HVALUE startValue = GetSimpleHValue(hThis, args, 1); FXJSE_HVALUE deleteValue = GetSimpleHValue(hThis, args, 2); @@ -4907,14 +4907,14 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } else { HValueToUTF8String(sourceValue, sourceString); iLength = sourceString.GetLength(); - iStart = (FX_INT32)HValueToFloat(hThis, startValue); + iStart = (int32_t)HValueToFloat(hThis, startValue); if (iStart < 1) { iStart = 1; } if (iStart > iLength) { iStart = iLength; } - iDelete = (FX_INT32)HValueToFloat(hThis, deleteValue); + iDelete = (int32_t)HValueToFloat(hThis, deleteValue); if (iDelete <= 0) { iDelete = 0; } @@ -4925,7 +4925,7 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } iStart -= 1; CFX_ByteTextBuf resultString; - FX_INT32 i = 0; + int32_t i = 0; while (i < iStart) { resultString.AppendChar(sourceString.GetAt(i)); ++i; @@ -4951,7 +4951,7 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if(argc == 3) { FXJSE_HVALUE stringValue = GetSimpleHValue(hThis, args, 0); FXJSE_HVALUE startValue = GetSimpleHValue(hThis, args, 1); @@ -4960,15 +4960,15 @@ void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A FXJSE_Value_SetNull(args.GetReturnValue()); } else { CFX_ByteString szSourceStr; - FX_INT32 iStart = 0; - FX_INT32 iCount = 0; + int32_t iStart = 0; + int32_t iCount = 0; HValueToUTF8String(stringValue, szSourceStr); - FX_INT32 iLength = szSourceStr.GetLength(); + int32_t iLength = szSourceStr.GetLength(); if (iLength == 0) { FXJSE_Value_SetUTF8String(args.GetReturnValue(), FX_BSTRC("")); } else { - iStart = (FX_INT32)HValueToFloat(hThis, startValue); - iCount = (FX_INT32)HValueToFloat(hThis, endValue); + iStart = (int32_t)HValueToFloat(hThis, startValue); + iCount = (int32_t)HValueToFloat(hThis, endValue); if (iStart < 1) { iStart = 1; } @@ -4992,13 +4992,13 @@ void CXFA_FM2JSContext::Substr(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_A } void CXFA_FM2JSContext::Uuid(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if((argc == 0) || (argc == 1)) { - FX_INT32 iNum = 0; + int32_t iNum = 0; FXJSE_HVALUE argOne = 0; if(argc == 1) { argOne = GetSimpleHValue(hThis, args, 0); - iNum = (FX_INT32)HValueToFloat(hThis, argOne); + iNum = (int32_t)HValueToFloat(hThis, argOne); } FX_GUID guid; FX_GUID_CreateV4(&guid); @@ -5015,7 +5015,7 @@ void CXFA_FM2JSContext::Uuid(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg } void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if ((argc > 0) && (argc < 3)) { CFX_ByteString argString; FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); @@ -5030,9 +5030,9 @@ void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar CFX_WideTextBuf upperStringBuf; CFX_WideString wsArgString = CFX_WideString::FromUTF8(argString, argString.GetLength()); FX_LPCWSTR pData = wsArgString; - FX_INT32 iLen = wsArgString.GetLength(); - FX_INT32 i = 0; - FX_INT32 ch = 0; + int32_t iLen = wsArgString.GetLength(); + int32_t i = 0; + int32_t ch = 0; while (i < iLen) { ch = *(pData + i); if (ch >= 0x61 && ch <= 0x7A) { @@ -5059,11 +5059,11 @@ void CXFA_FM2JSContext::Upper(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Ar } void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if ((argc > 0) && (argc < 4)) { FX_BOOL bFlags = FALSE; FX_FLOAT fNumber; - FX_INT32 iIdentifier = 0; + int32_t iIdentifier = 0; CFX_ByteString localeString; FXJSE_HVALUE numberValue = GetSimpleHValue(hThis, args, 0); FXJSE_HVALUE identifierValue = 0; @@ -5078,7 +5078,7 @@ void CXFA_FM2JSContext::WordNum(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_ if (FXJSE_Value_IsNull(identifierValue)) { bFlags = TRUE; } else { - iIdentifier = (FX_INT32)HValueToFloat(hThis, identifierValue); + iIdentifier = (int32_t)HValueToFloat(hThis, identifierValue); } } if (argc == 3) { @@ -5121,9 +5121,9 @@ void CXFA_FM2JSContext::TrillionUS(FX_BSTR szData, CFX_ByteTextBuf &strBuf) CFX_ByteStringC pTens[] = {"Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"}; CFX_ByteStringC pLastTens[] = {"Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"}; CFX_ByteStringC pComm[] = {" Hundred ", " Thousand ", " Million ", " Billion ", "Trillion"}; - FX_INT32 iComm = 0; + int32_t iComm = 0; FX_LPCSTR pData = szData.GetCStr(); - FX_INT32 iLength = szData.GetLength(); + int32_t iLength = szData.GetLength(); if (iLength > 12) { iComm = 4; } else if (iLength > 9) { @@ -5133,8 +5133,8 @@ void CXFA_FM2JSContext::TrillionUS(FX_BSTR szData, CFX_ByteTextBuf &strBuf) } else if (iLength > 3) { iComm = 1; } - FX_INT32 iIndex = 0; - FX_INT32 iFirstCount = iLength % 3; + int32_t iIndex = 0; + int32_t iFirstCount = iLength % 3; if (iFirstCount == 0) { iFirstCount = 3; } @@ -5205,13 +5205,13 @@ void CXFA_FM2JSContext::TrillionUS(FX_BSTR szData, CFX_ByteTextBuf &strBuf) iIndex += 3; } } -void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf &strBuf) +void CXFA_FM2JSContext::WordUS(FX_BSTR szData, int32_t iStyle, CFX_ByteTextBuf &strBuf) { FX_LPCSTR pData = szData.GetCStr(); - FX_INT32 iLength = szData.GetLength(); + int32_t iLength = szData.GetLength(); switch (iStyle) { case 0: { - FX_INT32 iIndex = 0; + int32_t iIndex = 0; while (iIndex < iLength) { if (*(pData + iIndex) == '.') { break; @@ -5220,7 +5220,7 @@ void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf } iLength = iIndex; iIndex = 0; - FX_INT32 iCount = 0; + int32_t iCount = 0; while (iIndex < iLength) { iCount = (iLength - iIndex) % 12; if (!iCount && iLength - iIndex > 0) { @@ -5235,7 +5235,7 @@ void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf } break; case 1: { - FX_INT32 iIndex = 0; + int32_t iIndex = 0; while (iIndex < iLength) { if (*(pData + iIndex) == '.') { break; @@ -5244,7 +5244,7 @@ void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf } iLength = iIndex; iIndex = 0; - FX_INT32 iCount = 0; + int32_t iCount = 0; while (iIndex < iLength) { iCount = (iLength - iIndex) % 12; if (!iCount && iLength - iIndex > 0) { @@ -5260,16 +5260,16 @@ void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf } break; case 2: { - FX_INT32 iIndex = 0; + int32_t iIndex = 0; while (iIndex < iLength) { if (*(pData + iIndex) == '.') { break; } ++iIndex; } - FX_INT32 iInteger = iIndex; + int32_t iInteger = iIndex; iIndex = 0; - FX_INT32 iCount = 0; + int32_t iCount = 0; while (iIndex < iInteger) { iCount = (iInteger - iIndex) % 12; if (!iCount && iLength - iIndex > 0) { @@ -5285,7 +5285,7 @@ void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf if (iInteger < iLength) { strBuf << FX_BSTRC(" And "); iIndex = iInteger + 1; - FX_INT32 iCount = 0; + int32_t iCount = 0; while (iIndex < iLength) { iCount = (iLength - iIndex) % 12; if (!iCount && iLength - iIndex > 0) { @@ -5308,7 +5308,7 @@ void CXFA_FM2JSContext::WordUS(FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (argc == 1) { CXFA_Document *pDoc = pContext->GetDocument(); if(!pDoc) { @@ -5323,8 +5323,8 @@ void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu HValueToUTF8String(argOne, urlString); IFX_FileRead* pFile = pAppProvider->DownloadURL(CFX_WideString::FromUTF8(urlString, urlString.GetLength())); if (pFile) { - FX_INT32 size = pFile->GetSize(); - FX_LPBYTE pData = FX_Alloc(FX_BYTE, size); + int32_t size = pFile->GetSize(); + FX_LPBYTE pData = FX_Alloc(uint8_t, size); if(pData) { pFile->ReadBlock(pData, size); FXJSE_Value_SetUTF8String(args.GetReturnValue(), CFX_ByteStringC(pData, size)); @@ -5340,7 +5340,7 @@ void CXFA_FM2JSContext::Get(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Argu void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if((argc >= 2) && (argc <= 5)) { CXFA_Document *pDoc = pContext->GetDocument(); if(!pDoc) { @@ -5403,7 +5403,7 @@ void CXFA_FM2JSContext::Post(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arg void CXFA_FM2JSContext::Put(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if((argc == 2) || (argc == 3)) { CXFA_Document *pDoc = pContext->GetDocument(); if(!pDoc) { @@ -5454,13 +5454,13 @@ void CXFA_FM2JSContext::assign_value_operator(FXJSE_HOBJECT hThis, FX_BSTR szFun if (FXJSE_Value_IsArray(lValue)) { FXJSE_HVALUE leftLengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(lValue, FX_BSTRC("length"), leftLengthValue); - FX_INT32 iLeftLength = FXJSE_Value_ToInteger(leftLengthValue); + int32_t iLeftLength = FXJSE_Value_ToInteger(leftLengthValue); FXJSE_Value_Release(leftLengthValue); FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(hruntime); FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectPropByIdx(lValue, 1, propertyValue); if (FXJSE_Value_IsNull(propertyValue)) { - for (FX_INT32 i = 2; i < iLeftLength; i++) { + for (int32_t i = 2; i < iLeftLength; i++) { FXJSE_Value_GetObjectPropByIdx(lValue, i, jsObjectValue); bSetStatus = SetObjectDefaultValue(jsObjectValue, rValue); if (!bSetStatus) { @@ -5471,7 +5471,7 @@ void CXFA_FM2JSContext::assign_value_operator(FXJSE_HOBJECT hThis, FX_BSTR szFun } else { CFX_ByteString propertyStr; FXJSE_Value_ToUTF8String(propertyValue, propertyStr); - for (FX_INT32 i = 2; i < iLeftLength; i++) { + for (int32_t i = 2; i < iLeftLength; i++) { FXJSE_Value_GetObjectPropByIdx(lValue, i, jsObjectValue); FXJSE_Value_SetObjectProp(jsObjectValue, propertyStr, rValue); } @@ -5799,7 +5799,7 @@ void CXFA_FM2JSContext::divide_operator(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, } void CXFA_FM2JSContext::positive_operator(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 iLength = args.GetLength(); + int32_t iLength = args.GetLength(); if (iLength == 1) { FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); if (FXJSE_Value_IsNull(argOne)) { @@ -5815,7 +5815,7 @@ void CXFA_FM2JSContext::positive_operator(FXJSE_HOBJECT hThis, FX_BSTR szFuncNam } void CXFA_FM2JSContext::negative_operator(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 iLength = args.GetLength(); + int32_t iLength = args.GetLength(); if (iLength == 1) { FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); if (FXJSE_Value_IsNull(argOne)) { @@ -5831,7 +5831,7 @@ void CXFA_FM2JSContext::negative_operator(FXJSE_HOBJECT hThis, FX_BSTR szFuncNam } void CXFA_FM2JSContext::logical_not_operator(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 iLength = args.GetLength(); + int32_t iLength = args.GetLength(); if (iLength == 1) { FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); if (FXJSE_Value_IsNull(argOne)) { @@ -5850,14 +5850,14 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if((argc == 4) || (argc == 5)) { FX_BOOL bIsStar = TRUE; FXJSE_HVALUE argAccessor = args.GetValue(0); CFX_ByteString bsAccessorName = args.GetUTF8String(1); CFX_ByteString szName = args.GetUTF8String(2); - FX_INT32 iIndexFlags = args.GetInt32(3); - FX_INT32 iIndexValue = 0; + int32_t iIndexFlags = args.GetInt32(3); + int32_t iIndexValue = 0; FXJSE_HVALUE argIndex = NULL; if(argc == 5) { bIsStar = FALSE; @@ -5869,20 +5869,20 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF if(FXJSE_Value_IsArray(argAccessor)) { FXJSE_HVALUE hLengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argAccessor, FX_BSTRC("length"), hLengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(hLengthValue); + int32_t iLength = FXJSE_Value_ToInteger(hLengthValue); FXJSE_Value_Release(hLengthValue); - FX_INT32 iCounter = 0; + int32_t iCounter = 0; FXJSE_HVALUE **hResolveValues = FX_Alloc(FXJSE_HVALUE*, iLength - 2); - FX_INT32 *iSizes = FX_Alloc(FX_INT32, iLength - 2); - for (FX_INT32 i = 0; i < (iLength - 2); i++) { + int32_t *iSizes = FX_Alloc(int32_t, iLength - 2); + for (int32_t i = 0; i < (iLength - 2); i++) { iSizes[i] = 0; } FXJSE_HVALUE hJSObjValue = FXJSE_Value_Create(hruntime); FX_BOOL bAttribute = FALSE; - for(FX_INT32 i = 2; i < iLength; i++) { + for(int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argAccessor, i, hJSObjValue); XFA_RESOLVENODE_RS resoveNodeRS; - FX_INT32 iRet = ResolveObjects(hThis, hJSObjValue, szSomExp, resoveNodeRS, TRUE, szName.IsEmpty()); + int32_t iRet = ResolveObjects(hThis, hJSObjValue, szSomExp, resoveNodeRS, TRUE, szName.IsEmpty()); if(iRet > 0) { ParseResolveResult(hThis, resoveNodeRS, hJSObjValue, hResolveValues[i - 2], iSizes[i - 2], bAttribute); iCounter += iSizes[i - 2]; @@ -5891,7 +5891,7 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF FXJSE_Value_Release(hJSObjValue); if (iCounter > 0) { FXJSE_HVALUE *rgValues = FX_Alloc(FXJSE_HVALUE, iCounter + 2); - for(FX_INT32 i = 0; i < (iCounter + 2); i++) { + for(int32_t i = 0; i < (iCounter + 2); i++) { rgValues[i] = FXJSE_Value_Create(hruntime); } FXJSE_Value_SetInteger(rgValues[0], 1); @@ -5900,15 +5900,15 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF } else { FXJSE_Value_SetNull(rgValues[1]); } - FX_INT32 iIndex = 2; - for(FX_INT32 i = 0; i < iLength - 2; i++) { - for(FX_INT32 j = 0; j < iSizes[i]; j++) { + int32_t iIndex = 2; + for(int32_t i = 0; i < iLength - 2; i++) { + for(int32_t j = 0; j < iSizes[i]; j++) { FXJSE_Value_Set(rgValues[iIndex], hResolveValues[i][j]); iIndex++; } } FXJSE_Value_SetArray(args.GetReturnValue(), (iCounter + 2), rgValues); - for(FX_INT32 i = 0; i < (iCounter + 2); i++) { + for(int32_t i = 0; i < (iCounter + 2); i++) { FXJSE_Value_Release(rgValues[i]); } FX_Free(rgValues); @@ -5917,8 +5917,8 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF CFX_WideString wsSomExpression = CFX_WideString::FromUTF8(szSomExp, szSomExp.GetLength()); pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT, (FX_LPCWSTR)wsPropertyName, (FX_LPCWSTR)wsSomExpression); } - for(FX_INT32 i = 0; i < iLength - 2; i++) { - for(FX_INT32 j = 0; j < iSizes[i]; j++) { + for(int32_t i = 0; i < iLength - 2; i++) { + for(int32_t j = 0; j < iSizes[i]; j++) { FXJSE_Value_Release(hResolveValues[i][j]); } if (iSizes[i] > 0) { @@ -5929,7 +5929,7 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF FX_Free(iSizes); } else { XFA_RESOLVENODE_RS resoveNodeRS; - FX_INT32 iRet = 0; + int32_t iRet = 0; if (FXJSE_Value_IsObject(argAccessor) || (FXJSE_Value_IsNull(argAccessor) && bsAccessorName.IsEmpty())) { iRet = ResolveObjects(hThis, argAccessor, szSomExp, resoveNodeRS, TRUE, szName.IsEmpty()); } else if (!FXJSE_Value_IsObject(argAccessor) && !bsAccessorName.IsEmpty()) { @@ -5940,11 +5940,11 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF } if(iRet > 0) { FXJSE_HVALUE *hResolveValues; - FX_INT32 iSize = 0; + int32_t iSize = 0; FX_BOOL bAttribute = FALSE; ParseResolveResult(hThis, resoveNodeRS, argAccessor, hResolveValues, iSize, bAttribute); FXJSE_HVALUE *rgValues = FX_Alloc(FXJSE_HVALUE, iSize + 2); - for(FX_INT32 i = 0; i < (iSize + 2); i++) { + for(int32_t i = 0; i < (iSize + 2); i++) { rgValues[i] = FXJSE_Value_Create(hruntime); } FXJSE_Value_SetInteger(rgValues[0], 1); @@ -5953,15 +5953,15 @@ void CXFA_FM2JSContext::dot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF } else { FXJSE_Value_SetNull(rgValues[1]); } - for(FX_INT32 i = 0; i < iSize; i++) { + for(int32_t i = 0; i < iSize; i++) { FXJSE_Value_Set(rgValues[i + 2], hResolveValues[i]); } FXJSE_Value_SetArray(args.GetReturnValue(), (iSize + 2), rgValues); - for(FX_INT32 i = 0; i < (iSize + 2); i++) { + for(int32_t i = 0; i < (iSize + 2); i++) { FXJSE_Value_Release(rgValues[i]); } FX_Free(rgValues); - for(FX_INT32 i = 0; i < iSize; i++) { + for(int32_t i = 0; i < iSize; i++) { FXJSE_Value_Release(hResolveValues[i]); } FX_Free(hResolveValues); @@ -5983,14 +5983,14 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if((argc == 4) || (argc == 5)) { FX_BOOL bIsStar = TRUE; FXJSE_HVALUE argAccessor = args.GetValue(0); CFX_ByteString bsAccessorName = args.GetUTF8String(1); CFX_ByteString szName = args.GetUTF8String(2); - FX_INT32 iIndexFlags = args.GetInt32(3); - FX_INT32 iIndexValue = 0; + int32_t iIndexFlags = args.GetInt32(3); + int32_t iIndexValue = 0; FXJSE_HVALUE argIndex = NULL; if(argc == 5) { bIsStar = FALSE; @@ -6002,16 +6002,16 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, if(FXJSE_Value_IsArray(argAccessor)) { FXJSE_HVALUE hLengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argAccessor, FX_BSTRC("length"), hLengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(hLengthValue); - FX_INT32 iCounter = 0; + int32_t iLength = FXJSE_Value_ToInteger(hLengthValue); + int32_t iCounter = 0; FXJSE_HVALUE **hResolveValues = FX_Alloc(FXJSE_HVALUE*, iLength - 2); - FX_INT32 *iSizes = FX_Alloc(FX_INT32, iLength - 2); + int32_t *iSizes = FX_Alloc(int32_t, iLength - 2); FXJSE_HVALUE hJSObjValue = FXJSE_Value_Create(hruntime); FX_BOOL bAttribute = FALSE; - for(FX_INT32 i = 2; i < iLength; i++) { + for(int32_t i = 2; i < iLength; i++) { FXJSE_Value_GetObjectPropByIdx(argAccessor, i, hJSObjValue); XFA_RESOLVENODE_RS resoveNodeRS; - FX_INT32 iRet = ResolveObjects(hThis, hJSObjValue, szSomExp, resoveNodeRS, FALSE); + int32_t iRet = ResolveObjects(hThis, hJSObjValue, szSomExp, resoveNodeRS, FALSE); if(iRet > 0) { ParseResolveResult(hThis, resoveNodeRS, hJSObjValue, hResolveValues[i - 2], iSizes[i - 2], bAttribute); iCounter += iSizes[i - 2]; @@ -6020,7 +6020,7 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, FXJSE_Value_Release(hJSObjValue); if (iCounter > 0) { FXJSE_HVALUE *rgValues = FX_Alloc(FXJSE_HVALUE, iCounter + 2); - for(FX_INT32 i = 0; i < (iCounter + 2); i++) { + for(int32_t i = 0; i < (iCounter + 2); i++) { rgValues[i] = FXJSE_Value_Create(hruntime); } FXJSE_Value_SetInteger(rgValues[0], 1); @@ -6029,15 +6029,15 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, } else { FXJSE_Value_SetNull(rgValues[1]); } - FX_INT32 iIndex = 2; - for(FX_INT32 i = 0; i < iLength - 2; i++) { - for(FX_INT32 j = 0; j < iSizes[i]; j++) { + int32_t iIndex = 2; + for(int32_t i = 0; i < iLength - 2; i++) { + for(int32_t j = 0; j < iSizes[i]; j++) { FXJSE_Value_Set(rgValues[iIndex], hResolveValues[i][j]); iIndex++; } } FXJSE_Value_SetArray(args.GetReturnValue(), (iCounter + 2), rgValues); - for(FX_INT32 i = 0; i < (iCounter + 2); i++) { + for(int32_t i = 0; i < (iCounter + 2); i++) { FXJSE_Value_Release(rgValues[i]); } FX_Free(rgValues); @@ -6046,8 +6046,8 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFX_WideString wsSomExpression = CFX_WideString::FromUTF8(szSomExp, szSomExp.GetLength()); pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT, (FX_LPCWSTR)wsPropertyName, (FX_LPCWSTR)wsSomExpression); } - for(FX_INT32 i = 0; i < iLength - 2; i++) { - for(FX_INT32 j = 0; j < iSizes[i]; j++) { + for(int32_t i = 0; i < iLength - 2; i++) { + for(int32_t j = 0; j < iSizes[i]; j++) { FXJSE_Value_Release(hResolveValues[i][j]); } FX_Free(hResolveValues[i]); @@ -6057,7 +6057,7 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, FXJSE_Value_Release(hLengthValue); } else { XFA_RESOLVENODE_RS resoveNodeRS; - FX_INT32 iRet = 0; + int32_t iRet = 0; if (FXJSE_Value_IsObject(argAccessor) || (FXJSE_Value_IsNull(argAccessor) && bsAccessorName.IsEmpty())) { iRet = ResolveObjects(hThis, argAccessor, szSomExp, resoveNodeRS, FALSE); } else if (!FXJSE_Value_IsObject(argAccessor) && !bsAccessorName.IsEmpty()) { @@ -6068,11 +6068,11 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, } if(iRet > 0) { FXJSE_HVALUE *hResolveValues; - FX_INT32 iSize = 0; + int32_t iSize = 0; FX_BOOL bAttribute = FALSE; ParseResolveResult(hThis, resoveNodeRS, argAccessor, hResolveValues, iSize, bAttribute); FXJSE_HVALUE *rgValues = FX_Alloc(FXJSE_HVALUE, iSize + 2); - for(FX_INT32 i = 0; i < (iSize + 2); i++) { + for(int32_t i = 0; i < (iSize + 2); i++) { rgValues[i] = FXJSE_Value_Create(hruntime); } FXJSE_Value_SetInteger(rgValues[0], 1); @@ -6081,15 +6081,15 @@ void CXFA_FM2JSContext::dotdot_accessor(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, } else { FXJSE_Value_SetNull(rgValues[1]); } - for(FX_INT32 i = 0; i < iSize; i++) { + for(int32_t i = 0; i < iSize; i++) { FXJSE_Value_Set(rgValues[i + 2], hResolveValues[i]); } FXJSE_Value_SetArray(args.GetReturnValue(), (iSize + 2), rgValues); - for(FX_INT32 i = 0; i < (iSize + 2); i++) { + for(int32_t i = 0; i < (iSize + 2); i++) { FXJSE_Value_Release(rgValues[i]); } FX_Free(rgValues); - for(FX_INT32 i = 0; i < iSize; i++) { + for(int32_t i = 0; i < iSize; i++) { FXJSE_Value_Release(hResolveValues[i]); } FX_Free(hResolveValues); @@ -6111,7 +6111,7 @@ void CXFA_FM2JSContext::eval_translation (FXJSE_HOBJECT hThis, FX_BSTR szFuncNam { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (argc == 1) { FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); CFX_ByteString argString; @@ -6137,7 +6137,7 @@ void CXFA_FM2JSContext::eval_translation (FXJSE_HOBJECT hThis, FX_BSTR szFuncNam } void CXFA_FM2JSContext::is_fm_object(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 iLength = args.GetLength(); + int32_t iLength = args.GetLength(); if (iLength == 1) { FXJSE_HVALUE argOne = args.GetValue(0); FXJSE_Value_SetBoolean(args.GetReturnValue(), FXJSE_Value_IsObject(argOne)); @@ -6148,7 +6148,7 @@ void CXFA_FM2JSContext::is_fm_object(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF } void CXFA_FM2JSContext::is_fm_array(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args) { - FX_INT32 iLength = args.GetLength(); + int32_t iLength = args.GetLength(); if (iLength == 1) { FXJSE_HVALUE argOne = args.GetValue(0); FX_BOOL bIsArray = FXJSE_Value_IsArray(argOne); @@ -6162,7 +6162,7 @@ void CXFA_FM2JSContext::get_fm_value(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 iLength = args.GetLength(); + int32_t iLength = args.GetLength(); if (iLength == 1) { FXJSE_HVALUE argOne = args.GetValue(0); if(FXJSE_Value_IsArray(argOne)) { @@ -6193,13 +6193,13 @@ void CXFA_FM2JSContext::get_fm_jsobj(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CF { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (argc == 1) { FXJSE_HVALUE argOne = args.GetValue(0); if(FXJSE_Value_IsArray(argOne)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argOne, FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXSYS_assert(iLength >= 3); FXJSE_Value_Release(lengthValue); FXJSE_Value_GetObjectPropByIdx(argOne, 2, args.GetReturnValue()); @@ -6215,29 +6215,29 @@ void CXFA_FM2JSContext::fm_var_filter(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, C { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); if (argc == 1) { FXJSE_HVALUE argOne = args.GetValue(0); if(FXJSE_Value_IsArray(argOne)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argOne, FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXSYS_assert(iLength >= 3); FXJSE_Value_Release(lengthValue); FXJSE_HVALUE flagsValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectPropByIdx(argOne, 0, flagsValue); - FX_INT32 iFlags = FXJSE_Value_ToInteger(flagsValue); + int32_t iFlags = FXJSE_Value_ToInteger(flagsValue); FXJSE_Value_Release(flagsValue); if(iFlags == 4) { FXJSE_HVALUE rgValues[3]; - for(FX_INT32 i = 0; i < 3; i++) { + for(int32_t i = 0; i < 3; i++) { rgValues[i] = FXJSE_Value_Create(hruntime); } FXJSE_Value_SetInteger(rgValues[0], 3); FXJSE_Value_SetNull(rgValues[1]); FXJSE_Value_SetNull(rgValues[2]); FXJSE_Value_SetArray(args.GetReturnValue(), 3, rgValues); - for(FX_INT32 i = 0; i < 3; i++) { + for(int32_t i = 0; i < 3; i++) { FXJSE_Value_Release(rgValues[i]); } } else if(iFlags == 3) { @@ -6268,31 +6268,31 @@ void CXFA_FM2JSContext::concat_fm_object(FXJSE_HOBJECT hThis, FX_BSTR szFuncName { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_UINT32 iLength = 0; - FX_INT32 argCount = args.GetLength(); + uint32_t iLength = 0; + int32_t argCount = args.GetLength(); FXJSE_HVALUE *argValues = FX_Alloc(FXJSE_HVALUE, argCount); - for(FX_INT32 i = 0; i < argCount; i++) { + for(int32_t i = 0; i < argCount; i++) { argValues[i] = args.GetValue(i); if(FXJSE_Value_IsArray(argValues[i])) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argValues[i], FX_BSTRC("length"), lengthValue); - FX_INT32 length = FXJSE_Value_ToInteger(lengthValue); + int32_t length = FXJSE_Value_ToInteger(lengthValue); iLength = iLength + ((length > 2) ? (length - 2) : 0); FXJSE_Value_Release(lengthValue); } iLength += 1; } FXJSE_HVALUE *returnValues = FX_Alloc(FXJSE_HVALUE, iLength); - for(FX_INT32 i = 0; i < (FX_INT32)iLength; i++) { + for(int32_t i = 0; i < (int32_t)iLength; i++) { returnValues[i] = FXJSE_Value_Create(hruntime); } - FX_INT32 index = 0; - for(FX_INT32 i = 0; i < argCount; i++) { + int32_t index = 0; + for(int32_t i = 0; i < argCount; i++) { if(FXJSE_Value_IsArray(argValues[i])) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argValues[i], FX_BSTRC("length"), lengthValue); - FX_INT32 length = FXJSE_Value_ToInteger(lengthValue); - for(FX_INT32 j = 2; j < length; j++) { + int32_t length = FXJSE_Value_ToInteger(lengthValue); + for(int32_t j = 2; j < length; j++) { FXJSE_Value_GetObjectPropByIdx(argValues[i], j, returnValues[index]); index++; } @@ -6302,25 +6302,25 @@ void CXFA_FM2JSContext::concat_fm_object(FXJSE_HOBJECT hThis, FX_BSTR szFuncName index++; } FXJSE_Value_SetArray(args.GetReturnValue(), iLength, returnValues); - for(FX_INT32 i = 0; i < argCount; i++) { + for(int32_t i = 0; i < argCount; i++) { FXJSE_Value_Release(argValues[i]); } FX_Free(argValues); - for(FX_INT32 i = 0; i < (FX_INT32)iLength; i++) { + for(int32_t i = 0; i < (int32_t)iLength; i++) { FXJSE_Value_Release(returnValues[i]); } FX_Free(returnValues); } -FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, FX_UINT32 index) +FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, uint32_t index) { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FXSYS_assert(index < (FX_UINT32)args.GetLength()); + FXSYS_assert(index < (uint32_t)args.GetLength()); FXJSE_HVALUE argIndex = args.GetValue(index); if (FXJSE_Value_IsArray(argIndex)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argIndex, FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); FXJSE_HVALUE simpleValue = FXJSE_Value_Create(hruntime); if (iLength > 2) { @@ -6359,7 +6359,7 @@ FX_BOOL CXFA_FM2JSContext::HValueIsNull(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) if (FXJSE_Value_IsNull(arg)) { isNull = TRUE; } else if (FXJSE_Value_IsArray(arg)) { - FX_INT32 iLength = hvalue_get_array_length(hThis, arg); + int32_t iLength = hvalue_get_array_length(hThis, arg); if (iLength > 2) { FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(hruntime); @@ -6397,11 +6397,11 @@ FX_BOOL CXFA_FM2JSContext::HValueIsNull(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) } return isNull; } -FX_INT32 CXFA_FM2JSContext::hvalue_get_array_length(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) +int32_t CXFA_FM2JSContext::hvalue_get_array_length(FXJSE_HOBJECT hThis, FXJSE_HVALUE arg) { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 iLength = 0; + int32_t iLength = 0; if (FXJSE_Value_IsArray(arg)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(arg, FX_BSTRC("length"), lengthValue); @@ -6429,19 +6429,19 @@ FX_BOOL CXFA_FM2JSContext::simpleValueCompare(FXJSE_HOBJECT hThis, FXJSE_HVALUE } return bReturn; } -void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, FXJSE_HVALUE *&resultValues, FX_INT32 &iCount, FX_INT32 iStart) +void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, FXJSE_HVALUE *&resultValues, int32_t &iCount, int32_t iStart) { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); iCount = 0; - FX_INT32 argc = args.GetLength(); + int32_t argc = args.GetLength(); FXJSE_HVALUE *argsValue = FX_Alloc(FXJSE_HVALUE, argc); - for (FX_INT32 i = iStart; i < argc; i++) { + for (int32_t i = iStart; i < argc; i++) { argsValue[i] = args.GetValue(i); if (FXJSE_Value_IsArray(argsValue[i])) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argsValue[i], FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); iCount += ((iLength > 2) ? (iLength - 2) : 0); } else { @@ -6449,22 +6449,22 @@ void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, } } resultValues = FX_Alloc(FXJSE_HVALUE, iCount); - for (FX_INT32 i = 0; i < iCount; i++) { + for (int32_t i = 0; i < iCount; i++) { resultValues[i] = FXJSE_Value_Create(hruntime); } - FX_INT32 index = 0; - for (FX_INT32 i = iStart; i < argc; i++) { + int32_t index = 0; + for (int32_t i = iStart; i < argc; i++) { if (FXJSE_Value_IsArray(argsValue[i])) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argsValue[i], FX_BSTRC("length"), lengthValue); - FX_INT32 iLength = FXJSE_Value_ToInteger(lengthValue); + int32_t iLength = FXJSE_Value_ToInteger(lengthValue); FXJSE_Value_Release(lengthValue); if (iLength > 2) { FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); FXJSE_HVALUE jsObjectValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectPropByIdx(argsValue[i], 1, propertyValue); if (FXJSE_Value_IsNull(propertyValue)) { - for (FX_INT32 j = 2; j < iLength; j++) { + for (int32_t j = 2; j < iLength; j++) { FXJSE_Value_GetObjectPropByIdx(argsValue[i], j, jsObjectValue); GetObjectDefaultValue(jsObjectValue, resultValues[index]); index++; @@ -6472,7 +6472,7 @@ void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, } else { CFX_ByteString propertyString; FXJSE_Value_ToUTF8String(propertyValue, propertyString); - for (FX_INT32 j = 2; j < iLength; j++) { + for (int32_t j = 2; j < iLength; j++) { FXJSE_Value_GetObjectPropByIdx(argsValue[i], j, jsObjectValue); FXJSE_Value_GetObjectProp(jsObjectValue, propertyString, resultValues[index]); index++; @@ -6489,7 +6489,7 @@ void CXFA_FM2JSContext::unfoldArgs(FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, index++; } } - for (FX_INT32 i = iStart; i < argc; i++) { + for (int32_t i = iStart; i < argc; i++) { FXJSE_Value_Release(argsValue[i]); } FX_Free(argsValue); @@ -6513,7 +6513,7 @@ FX_BOOL CXFA_FM2JSContext::SetObjectDefaultValue(FXJSE_HVALUE hObjectValue, FXJS } return bSuccess; } -void CXFA_FM2JSContext::GenerateSomExpression(FX_BSTR szName, FX_INT32 iIndexFlags, FX_INT32 iIndexValue, FX_BOOL bIsStar, CFX_ByteString& szSomExp) +void CXFA_FM2JSContext::GenerateSomExpression(FX_BSTR szName, int32_t iIndexFlags, int32_t iIndexValue, FX_BOOL bIsStar, CFX_ByteString& szSomExp) { if(bIsStar) { szSomExp = szName + FX_BSTRC("[*]"); @@ -6548,17 +6548,17 @@ FX_BOOL CXFA_FM2JSContext::GetObjectByName(FXJSE_HOBJECT hThis, FXJSE_HVALUE acc IXFA_ScriptContext* pScriptContext = pDoc->GetScriptContext(); XFA_RESOLVENODE_RS resoveNodeRS; FX_DWORD dwFlags = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent; - FX_INT32 iRet = pScriptContext->ResolveObjects(pScriptContext->GetThisObject(), CFX_WideString::FromUTF8(szAccessorName.GetCStr(), szAccessorName.GetLength()), resoveNodeRS, dwFlags); + int32_t iRet = pScriptContext->ResolveObjects(pScriptContext->GetThisObject(), CFX_WideString::FromUTF8(szAccessorName.GetCStr(), szAccessorName.GetLength()), resoveNodeRS, dwFlags); if (iRet >= 1 && resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { FXJSE_Value_Set(accessorValue, pScriptContext->GetJSValueFromMap(resoveNodeRS.nodes.GetAt(0))); bFlags = TRUE; } return bFlags; } -FX_INT32 CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis, FXJSE_HVALUE hRefValue, FX_BSTR bsSomExp, XFA_RESOLVENODE_RS &resoveNodeRS, FX_BOOL bdotAccessor , FX_BOOL bHasNoResolveName ) +int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis, FXJSE_HVALUE hRefValue, FX_BSTR bsSomExp, XFA_RESOLVENODE_RS &resoveNodeRS, FX_BOOL bdotAccessor , FX_BOOL bHasNoResolveName ) { CFX_WideString wsSomExpression = CFX_WideString::FromUTF8(bsSomExp.GetCStr(), bsSomExp.GetLength()); - FX_INT32 iRet = -1; + int32_t iRet = -1; CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); CXFA_Document *pDoc = pContext->GetDocument(); if(!pDoc) { @@ -6598,7 +6598,7 @@ FX_INT32 CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis, FXJSE_HVALUE hRe iRet = pScriptContext->ResolveObjects(pNode, wsSomExpression, resoveNodeRS, dFlags); return iRet; } -void CXFA_FM2JSContext::ParseResolveResult(FXJSE_HOBJECT hThis, const XFA_RESOLVENODE_RS &resoveNodeRS, FXJSE_HVALUE hParentValue, FXJSE_HVALUE *&resultValues, FX_INT32 &iSize, FX_BOOL &bAttribute) +void CXFA_FM2JSContext::ParseResolveResult(FXJSE_HOBJECT hThis, const XFA_RESOLVENODE_RS &resoveNodeRS, FXJSE_HVALUE hParentValue, FXJSE_HVALUE *&resultValues, int32_t &iSize, FX_BOOL &bAttribute) { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hRuntime = pContext->GetScriptRuntime(); @@ -6608,13 +6608,13 @@ void CXFA_FM2JSContext::ParseResolveResult(FXJSE_HOBJECT hThis, const XFA_RESOLV bAttribute = FALSE; iSize = resoveNodeRS.nodes.GetSize(); resultValues = FX_Alloc(FXJSE_HVALUE, iSize); - for (FX_INT32 i = 0; i < iSize; i++) { + for (int32_t i = 0; i < iSize; i++) { resultValues[i] = FXJSE_Value_Create(hRuntime); FXJSE_Value_Set(resultValues[i], pContext->GetDocument()->GetScriptContext()->GetJSValueFromMap(resoveNodeRS.nodes.GetAt(i))); } } else { CXFA_HVALUEArray objectProperties(hRuntime); - FX_INT32 iRet = resoveNodeRS.GetAttributeResult(objectProperties); + int32_t iRet = resoveNodeRS.GetAttributeResult(objectProperties); bAttribute = (iRet == 0); if (bAttribute) { if (FXJSE_Value_IsObject(hParentValue)) { @@ -6626,18 +6626,18 @@ void CXFA_FM2JSContext::ParseResolveResult(FXJSE_HOBJECT hThis, const XFA_RESOLV } else { iSize = iRet; resultValues = FX_Alloc(FXJSE_HVALUE, iSize); - for (FX_INT32 i = 0; i < iSize; i++) { + for (int32_t i = 0; i < iSize; i++) { resultValues[i] = FXJSE_Value_Create(hRuntime); FXJSE_Value_Set(resultValues[i], objectProperties[i]); } } } } -FX_INT32 CXFA_FM2JSContext::HValueToInteger(FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue) +int32_t CXFA_FM2JSContext::HValueToInteger(FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue) { CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FX_INT32 iValue = 0; + int32_t iValue = 0; if(FXJSE_Value_IsArray(hValue)) { FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); FXJSE_HVALUE jsobjectValue = FXJSE_Value_Create(hruntime); @@ -7170,7 +7170,7 @@ void CXFA_FM2JSContext::Release() { delete this; } -void CXFA_FM2JSContext::ThrowScriptErrorMessage(FX_INT32 iStringID, ...) +void CXFA_FM2JSContext::ThrowScriptErrorMessage(int32_t iStringID, ...) { IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider(); FXSYS_assert(pAppProvider); diff --git a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.h b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.h index 466050d662..923401b901 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.h +++ b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.h @@ -33,22 +33,22 @@ public: static void Time2Num (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); static void TimeFmt (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); - static FX_BOOL IsIsoDateFormat (FX_LPCSTR pData, FX_INT32 iLength, FX_INT32 &iStyle, FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay); - static FX_BOOL IsIsoTimeFormat (FX_LPCSTR pData, FX_INT32 iLength, FX_INT32 &iHour, FX_INT32 &iMinute, FX_INT32 &iSecond, FX_INT32 &iMilliSecond, FX_INT32 &iZoneHour, FX_INT32 &iZoneMinute); - static FX_BOOL IsIsoDateTimeFormat (FX_LPCSTR pData, FX_INT32 iLength, FX_INT32 &iYear, FX_INT32 &iMonth, FX_INT32 &iDay, FX_INT32 &iHour, FX_INT32 &iMinute, FX_INT32 &iSecond, FX_INT32 &iMillionSecond, FX_INT32 &iZoneHour, FX_INT32 &iZoneMinute); + static FX_BOOL IsIsoDateFormat (FX_LPCSTR pData, int32_t iLength, int32_t &iStyle, int32_t &iYear, int32_t &iMonth, int32_t &iDay); + static FX_BOOL IsIsoTimeFormat (FX_LPCSTR 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 (FX_LPCSTR 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 (FXJSE_HOBJECT hThis, FX_BSTR szDate, FX_BSTR szFormat, FX_BSTR szLocale, CFX_ByteString &strIsoDate); static FX_BOOL Local2IsoTime (FXJSE_HOBJECT hThis, FX_BSTR szTime, FX_BSTR szFormat, FX_BSTR szLocale, CFX_ByteString &strIsoTime); static FX_BOOL IsoDate2Local (FXJSE_HOBJECT hThis, FX_BSTR szDate, FX_BSTR szFormat, FX_BSTR szLocale, CFX_ByteString &strLocalDate); static FX_BOOL IsoTime2Local (FXJSE_HOBJECT hThis, FX_BSTR szTime, FX_BSTR szFormat, FX_BSTR szLocale, CFX_ByteString &strLocalTime); static FX_BOOL GetGMTTime (FXJSE_HOBJECT hThis, FX_BSTR szTime, FX_BSTR szFormat, FX_BSTR szLocale, CFX_ByteString &strGMTTime); - static FX_INT32 DateString2Num (FX_BSTR szDateString); - static void GetLocalDateFormat (FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard); - static void GetLocalTimeFormat (FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard); - static void GetStandardDateFormat (FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat); - static void GetStandardTimeFormat (FXJSE_HOBJECT hThis, FX_INT32 iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat); + static int32_t DateString2Num (FX_BSTR szDateString); + static void GetLocalDateFormat (FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard); + static void GetLocalTimeFormat (FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat, FX_BOOL bStandard); + static void GetStandardDateFormat (FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat); + static void GetStandardTimeFormat (FXJSE_HOBJECT hThis, int32_t iStyle, FX_BSTR szLocalStr, CFX_ByteString &strFormat); - static void Num2AllTime (FXJSE_HOBJECT hThis, FX_INT32 iTime, FX_BSTR szFormat, FX_BSTR szLocale, FX_BOOL bGM, CFX_ByteString &strTime); - static void GetLocalTimeZone (FX_INT32 &iHour, FX_INT32 &iMin, FX_INT32 &iSec); + static void Num2AllTime (FXJSE_HOBJECT hThis, int32_t iTime, FX_BSTR szFormat, FX_BSTR szLocale, FX_BOOL bGM, CFX_ByteString &strTime); + static void GetLocalTimeZone (int32_t &iHour, int32_t &iMin, int32_t &iSec); static void Apr (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); static void CTerm (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); @@ -81,8 +81,8 @@ public: static void EncodeURL (FX_BSTR szURLString, CFX_ByteTextBuf &szResultBuf); static void EncodeHTML (FX_BSTR szHTMLString, CFX_ByteTextBuf &szResultBuf); static void EncodeXML (FX_BSTR szXMLString, CFX_ByteTextBuf &szResultBuf); - static FX_BOOL HTMLSTR2Code (FX_WSTR pData, FX_UINT32 &iCode); - static FX_BOOL HTMLCode2STR (FX_UINT32 iCode, CFX_WideString &wsHTMLReserve); + static FX_BOOL HTMLSTR2Code (FX_WSTR pData, uint32_t &iCode); + static FX_BOOL HTMLCode2STR (uint32_t iCode, CFX_WideString &wsHTMLReserve); static void Format (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); static void Left (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); static void Len (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); @@ -100,7 +100,7 @@ public: static void Upper (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); static void WordNum (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); static void TrillionUS (FX_BSTR szData, CFX_ByteTextBuf &strBuf); - static void WordUS (FX_BSTR szData, FX_INT32 iStyle, CFX_ByteTextBuf &strBuf); + static void WordUS (FX_BSTR szData, int32_t iStyle, CFX_ByteTextBuf &strBuf); static void Get (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); static void Post (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); @@ -132,19 +132,19 @@ public: static void fm_var_filter (FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); static void concat_fm_object(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); - static FX_INT32 hvalue_get_array_length (FXJSE_HOBJECT hThis, FXJSE_HVALUE arg); + static int32_t hvalue_get_array_length (FXJSE_HOBJECT hThis, FXJSE_HVALUE arg); static FX_BOOL simpleValueCompare (FXJSE_HOBJECT hThis, FXJSE_HVALUE firstValue, FXJSE_HVALUE secondValue); - static void unfoldArgs (FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, FXJSE_HVALUE *&resultValues, FX_INT32 &iCount, FX_INT32 iStart = 0); + static void unfoldArgs (FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, FXJSE_HVALUE *&resultValues, int32_t &iCount, int32_t iStart = 0); static void GetObjectDefaultValue(FXJSE_HVALUE hObjectValue, FXJSE_HVALUE hDefaultValue); static FX_BOOL SetObjectDefaultValue(FXJSE_HVALUE hObjectValue, FXJSE_HVALUE hNewValue); - static void GenerateSomExpression(FX_BSTR szName, FX_INT32 iIndexFlags, FX_INT32 iIndexValue, FX_BOOL bIsStar, CFX_ByteString& szSomExp); + static void GenerateSomExpression(FX_BSTR szName, int32_t iIndexFlags, int32_t iIndexValue, FX_BOOL bIsStar, CFX_ByteString& szSomExp); static FX_BOOL GetObjectByName(FXJSE_HOBJECT hThis, FXJSE_HVALUE accessorValue, FX_BSTR szAccessorName); - static FX_INT32 ResolveObjects(FXJSE_HOBJECT hThis, FXJSE_HVALUE hParentValue, FX_BSTR bsSomExp, XFA_RESOLVENODE_RS &resoveNodeRS, FX_BOOL bdotAccessor = TRUE, FX_BOOL bHasNoResolveName = FALSE); - static void ParseResolveResult(FXJSE_HOBJECT hThis, const XFA_RESOLVENODE_RS& resoveNodeRS, FXJSE_HVALUE hParentValue, FXJSE_HVALUE *&resultValues, FX_INT32 &iSize, FX_BOOL &bAttribute); + static int32_t ResolveObjects(FXJSE_HOBJECT hThis, FXJSE_HVALUE hParentValue, FX_BSTR bsSomExp, XFA_RESOLVENODE_RS &resoveNodeRS, FX_BOOL bdotAccessor = TRUE, FX_BOOL bHasNoResolveName = FALSE); + static void ParseResolveResult(FXJSE_HOBJECT hThis, const XFA_RESOLVENODE_RS& resoveNodeRS, FXJSE_HVALUE hParentValue, FXJSE_HVALUE *&resultValues, int32_t &iSize, FX_BOOL &bAttribute); - static FXJSE_HVALUE GetSimpleHValue (FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, FX_UINT32 index); + static FXJSE_HVALUE GetSimpleHValue (FXJSE_HOBJECT hThis, CFXJSE_Arguments &args, uint32_t index); static FX_BOOL HValueIsNull (FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue); - static FX_INT32 HValueToInteger (FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue); + static int32_t HValueToInteger (FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue); static FX_DOUBLE StringToDouble(FX_BSTR szStringVal); static FX_FLOAT HValueToFloat (FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue); static FX_DOUBLE HValueToDouble (FXJSE_HOBJECT hThis, FXJSE_HVALUE hValue); @@ -163,7 +163,7 @@ public: { return m_pDocument; } - void ThrowScriptErrorMessage(FX_INT32 iStringID, ...); + void ThrowScriptErrorMessage(int32_t iStringID, ...); private: FXJSE_HRUNTIME m_hScriptRuntime; FXJSE_CLASS m_fmClass; diff --git a/xfa/src/fxfa/src/fm2js/xfa_fmparse.cpp b/xfa/src/fxfa/src/fm2js/xfa_fmparse.cpp index 5bc76c21e8..a3e127f3c6 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_fmparse.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_fmparse.cpp @@ -23,7 +23,7 @@ CXFA_FMParse::~CXFA_FMParse() m_pScript = 0; m_pToken = 0; } -FX_INT32 CXFA_FMParse::Init(FX_WSTR wsFormcalc, CXFA_FMErrorInfo *pErrorInfo) +int32_t CXFA_FMParse::Init(FX_WSTR wsFormcalc, CXFA_FMErrorInfo *pErrorInfo) { m_pScript = wsFormcalc.GetPtr(); m_uLength = wsFormcalc.GetLength(); @@ -153,8 +153,8 @@ CXFA_FMExpression * CXFA_FMParse::ParseFunction() if (m_pErrorInfo->message.IsEmpty()) { e = FX_NEW CXFA_FMFunctionDefinition(line, 0, ident, pArguments, pExpressions); } else { - FX_INT32 size = 0; - FX_INT32 index = 0; + int32_t size = 0; + int32_t index = 0; if (pArguments) { pArguments->RemoveAll(); delete pArguments; @@ -622,8 +622,8 @@ CXFA_FMSimpleExpression *CXFA_FMParse::ParsePostExpression(CXFA_FMSimpleExpressi e = 0; } } else { - FX_INT32 iSize = pArray->GetSize(); - for (FX_INT32 i = 0; i < iSize; ++i) { + int32_t iSize = pArray->GetSize(); + for (int32_t i = 0; i < iSize; ++i) { CXFA_FMSimpleExpression *pTemp = (CXFA_FMSimpleExpression *)pArray->GetAt(i); delete pTemp; } @@ -677,8 +677,8 @@ CXFA_FMSimpleExpression *CXFA_FMParse::ParsePostExpression(CXFA_FMSimpleExpressi e = 0; } } else { - FX_INT32 iSize = pArray->GetSize(); - for (FX_INT32 i = 0; i < iSize; ++i) { + int32_t iSize = pArray->GetSize(); + for (int32_t i = 0; i < iSize; ++i) { CXFA_FMSimpleExpression *pTemp = (CXFA_FMSimpleExpression *)pArray->GetAt(i); delete pTemp; } @@ -882,8 +882,8 @@ CXFA_FMExpression * CXFA_FMParse::ParseBlockExpression() if (m_pErrorInfo->message.IsEmpty()) { pExp = FX_NEW CXFA_FMBlockExpression(line, expression); } else { - FX_INT32 size = expression->GetSize(); - FX_INT32 index = 0; + int32_t size = expression->GetSize(); + int32_t index = 0; while(index < size) { e = (CXFA_FMExpression *)expression->GetAt(index); delete e; @@ -1033,7 +1033,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseForExpression() CFX_WideString ws_TempString = m_pToken->m_wstring; Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(m_pToken->m_type), FX_LPCWSTR(ws_TempString)); } - FX_INT32 iDirection = 0; + int32_t iDirection = 0; if (m_pToken->m_type == TOKupto) { iDirection = 1; } else if (m_pToken->m_type == TOKdownto) { @@ -1112,8 +1112,8 @@ CXFA_FMExpression * CXFA_FMParse::ParseForeachExpression() } else { if (pAccessors) { CXFA_FMSimpleExpression *s = 0; - FX_INT32 size = pAccessors->GetSize(); - FX_INT32 index = 0; + int32_t size = pAccessors->GetSize(); + int32_t index = 0; while(index < size) { s = (CXFA_FMSimpleExpression *)pAccessors->GetAt(index); delete s; diff --git a/xfa/src/fxfa/src/fm2js/xfa_fmparse.h b/xfa/src/fxfa/src/fm2js/xfa_fmparse.h index d3adca7075..496a3dfa6e 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_fmparse.h +++ b/xfa/src/fxfa/src/fm2js/xfa_fmparse.h @@ -11,7 +11,7 @@ class CXFA_FMParse public: CXFA_FMParse(); ~CXFA_FMParse(); - FX_INT32 Init(FX_WSTR wsFormcalc, CXFA_FMErrorInfo *pErrorInfo); + int32_t Init(FX_WSTR wsFormcalc, CXFA_FMErrorInfo *pErrorInfo); void NextToken(); void Check(XFA_FM_TOKEN op); void Error(FX_DWORD lineNum, XFA_FM_ERRMSG msg, ...); diff --git a/xfa/src/fxfa/src/fm2js/xfa_lexer.cpp b/xfa/src/fxfa/src/fm2js/xfa_lexer.cpp index 29594c760b..7ce3355861 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_lexer.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_lexer.cpp @@ -16,7 +16,7 @@ struct XFA_FMDChar { --p; return p; } - static FX_UINT16 get(FX_LPCWSTR p) + static uint16_t get(FX_LPCWSTR p) { return *p; } @@ -50,7 +50,7 @@ struct XFA_FMDChar { } static FX_BOOL isAvalid(FX_LPCWSTR p, FX_BOOL flag = 0); static FX_BOOL string2number(FX_LPCWSTR s, FX_DOUBLE *pValue, FX_LPCWSTR &pEnd); - static FX_BOOL isUnicodeAlpha(FX_UINT16 ch); + static FX_BOOL isUnicodeAlpha(uint16_t ch); }; inline FX_BOOL XFA_FMDChar::isAvalid(FX_LPCWSTR p, FX_BOOL flag) { @@ -74,7 +74,7 @@ inline FX_BOOL XFA_FMDChar::string2number(FX_LPCWSTR s, FX_DOUBLE *pValue, FX_LP } return 0; } -inline FX_BOOL XFA_FMDChar::isUnicodeAlpha(FX_UINT16 ch) +inline FX_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 == ')' @@ -195,7 +195,7 @@ CXFA_FMToken *CXFA_FMLexer::NextToken() } CXFA_FMToken * CXFA_FMLexer::Scan() { - FX_UINT16 ch = 0; + uint16_t ch = 0; CXFA_FMToken * p = FX_NEW CXFA_FMToken(m_uCurrentLine); if (!XFA_FMDChar::isAvalid(m_ptr)) { ch = XFA_FMDChar::get(m_ptr); @@ -444,7 +444,7 @@ FX_DWORD CXFA_FMLexer::Number(CXFA_FMToken *t, FX_LPCWSTR p, FX_LPCWSTR &pEnd) FX_DWORD CXFA_FMLexer::String(CXFA_FMToken *t, FX_LPCWSTR p, FX_LPCWSTR &pEnd) { FX_LPCWSTR pStart = p; - FX_UINT16 ch = 0; + uint16_t ch = 0; XFA_FMDChar::inc(p); ch = XFA_FMDChar::get(p); while (ch) { @@ -482,7 +482,7 @@ NEXT: FX_DWORD CXFA_FMLexer::Identifiers(CXFA_FMToken *t, FX_LPCWSTR p, FX_LPCWSTR &pEnd) { FX_LPCWSTR pStart = p; - FX_UINT16 ch = 0; + uint16_t ch = 0; ch = XFA_FMDChar::get(p); XFA_FMDChar::inc(p); if (!XFA_FMDChar::isAvalid(p)) { @@ -536,10 +536,10 @@ void CXFA_FMLexer::Comment( FX_LPCWSTR p, FX_LPCWSTR &pEnd ) } XFA_FM_TOKEN CXFA_FMLexer::IsKeyword(FX_WSTR str) { - FX_INT32 iLength = str.GetLength(); - FX_UINT32 uHash = FX_HashCode_String_GetW(str.GetPtr(), iLength, TRUE); - FX_INT32 iStart = KEYWORD_START, iEnd = KEYWORD_END; - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iLength = str.GetLength(); + uint32_t uHash = FX_HashCode_String_GetW(str.GetPtr(), iLength, TRUE); + int32_t iStart = KEYWORD_START, iEnd = KEYWORD_END; + int32_t iMid = (iStart + iEnd) / 2; XFA_FMKeyword keyword; do { iMid = (iStart + iEnd) / 2; diff --git a/xfa/src/fxfa/src/fm2js/xfa_lexer.h b/xfa/src/fxfa/src/fm2js/xfa_lexer.h index 3047a5028d..709307046b 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_lexer.h +++ b/xfa/src/fxfa/src/fm2js/xfa_lexer.h @@ -23,7 +23,7 @@ enum XFA_FM_TOKEN { }; struct XFA_FMKeyword { XFA_FM_TOKEN m_type; - FX_UINT32 m_uHash; + uint32_t m_uHash; FX_LPCWSTR m_keword; }; FX_LPCWSTR XFA_FM_KeywordToString(XFA_FM_TOKEN op); diff --git a/xfa/src/fxfa/src/fm2js/xfa_program.cpp b/xfa/src/fxfa/src/fm2js/xfa_program.cpp index d291e7a614..51faea0e91 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_program.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_program.cpp @@ -16,11 +16,11 @@ CXFA_FMProgram::~CXFA_FMProgram() m_globalFunction = 0; } } -FX_INT32 CXFA_FMProgram::Init(FX_WSTR wsFormcalc) +int32_t CXFA_FMProgram::Init(FX_WSTR wsFormcalc) { return m_parse.Init(wsFormcalc, &m_pErrorInfo); } -FX_INT32 CXFA_FMProgram::ParseProgram() +int32_t CXFA_FMProgram::ParseProgram() { CFX_PtrArray * expressions = 0; m_parse.NextToken(); @@ -30,7 +30,7 @@ FX_INT32 CXFA_FMProgram::ParseProgram() expressions = m_parse.ParseTopExpression(); if (!m_pErrorInfo.message.IsEmpty()) { CXFA_FMExpression *e = 0; - for (FX_INT32 u = 0; u < expressions->GetSize(); ++u) { + for (int32_t u = 0; u < expressions->GetSize(); ++u) { e = (CXFA_FMExpression *)expressions->GetAt(u); if (e) { delete e; @@ -42,7 +42,7 @@ FX_INT32 CXFA_FMProgram::ParseProgram() m_globalFunction = FX_NEW CXFA_FMFunctionDefinition(1, 1, FX_WSTRC(L""), 0, expressions); return 0; } -FX_INT32 CXFA_FMProgram::TranslateProgram(CFX_WideTextBuf &wsJavaScript) +int32_t CXFA_FMProgram::TranslateProgram(CFX_WideTextBuf &wsJavaScript) { m_globalFunction->ToJavaScript(wsJavaScript); wsJavaScript.AppendChar(0); diff --git a/xfa/src/fxfa/src/fm2js/xfa_program.h b/xfa/src/fxfa/src/fm2js/xfa_program.h index 157d1e1faa..a7453d4d1d 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_program.h +++ b/xfa/src/fxfa/src/fm2js/xfa_program.h @@ -11,9 +11,9 @@ class CXFA_FMProgram public: CXFA_FMProgram(); ~CXFA_FMProgram(); - FX_INT32 Init(FX_WSTR wsFormcalc); - FX_INT32 ParseProgram(); - FX_INT32 TranslateProgram(CFX_WideTextBuf &wsJavaScript); + int32_t Init(FX_WSTR wsFormcalc); + int32_t ParseProgram(); + int32_t TranslateProgram(CFX_WideTextBuf &wsJavaScript); CXFA_FMErrorInfo& GetError() { return m_pErrorInfo; diff --git a/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp b/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp index dc4f24449b..d52ab7c076 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.cpp @@ -168,7 +168,7 @@ void CXFA_FMStringExpression::ToJavaScript(CFX_WideTextBuf& javascript) if (tempStr.GetLength() > 2) { javascript.AppendChar(L'\"'); FX_WCHAR oneChar; - for (FX_INT16 i = 1; i < tempStr.GetLength() - 1; i++) { + for (int16_t i = 1; i < tempStr.GetLength() - 1; i++) { oneChar = tempStr[i]; switch (oneChar) { case L'\"': { @@ -489,8 +489,8 @@ CXFA_FMCallExpression::CXFA_FMCallExpression(FX_DWORD line, CXFA_FMSimpleExpress CXFA_FMCallExpression::~CXFA_FMCallExpression() { if (m_pArguments) { - FX_INT32 argc = m_pArguments->GetSize(); - FX_INT32 index = 0; + int32_t argc = m_pArguments->GetSize(); + int32_t index = 0; CXFA_FMSimpleExpression *e = 0; while (index < argc) { e = (CXFA_FMSimpleExpression *)m_pArguments->GetAt(index); @@ -504,11 +504,11 @@ CXFA_FMCallExpression::~CXFA_FMCallExpression() } FX_BOOL CXFA_FMCallExpression::IsBuildInFunc(CFX_WideTextBuf& funcName) { - FX_INT32 iLength = funcName.GetLength(); - FX_UINT32 uHash = FX_HashCode_String_GetW(funcName.GetBuffer(), iLength, TRUE); + int32_t iLength = funcName.GetLength(); + uint32_t uHash = FX_HashCode_String_GetW(funcName.GetBuffer(), iLength, TRUE); XFA_FMBuildInFunc buildinfunction; - FX_INT32 iStart = 0, iEnd = (sizeof(buildInFuncs) / sizeof(buildInFuncs[0])) - 1; - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iStart = 0, iEnd = (sizeof(buildInFuncs) / sizeof(buildInFuncs[0])) - 1; + int32_t iMid = (iStart + iEnd) / 2; do { iMid = (iStart + iEnd) / 2; buildinfunction = buildInFuncs[iMid]; @@ -526,12 +526,12 @@ FX_BOOL CXFA_FMCallExpression::IsBuildInFunc(CFX_WideTextBuf& funcName) } FX_DWORD CXFA_FMCallExpression::IsSomMethodWithObjPara(FX_WSTR methodName) { - FX_INT32 iLength = methodName.GetLength(); - FX_UINT32 uHash = FX_HashCode_String_GetW(methodName.GetPtr(), iLength); + int32_t iLength = methodName.GetLength(); + uint32_t uHash = FX_HashCode_String_GetW(methodName.GetPtr(), iLength); XFA_FMSOMMethod somMethodWithObjPara; FX_DWORD parameters = 0x00; - FX_INT32 iStart = 0, iEnd = (sizeof(gs_FMSomMethods) / sizeof(gs_FMSomMethods[0])) - 1; - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iStart = 0, iEnd = (sizeof(gs_FMSomMethods) / sizeof(gs_FMSomMethods[0])) - 1; + int32_t iMid = (iStart + iEnd) / 2; do { iMid = (iStart + iEnd) / 2; somMethodWithObjPara = gs_FMSomMethods[iMid]; @@ -554,8 +554,8 @@ void CXFA_FMCallExpression::ToJavaScript(CFX_WideTextBuf& javascript) javascript << funcName; javascript << FX_WSTRC(L"("); if (m_pArguments) { - FX_INT32 argc = m_pArguments->GetSize(); - FX_INT32 index = 0; + int32_t argc = m_pArguments->GetSize(); + int32_t index = 0; FX_DWORD methodPara = IsSomMethodWithObjPara(funcName.GetWideString()); if (methodPara > 0) { CXFA_FMSimpleExpression *e = 0; @@ -623,8 +623,8 @@ void CXFA_FMCallExpression::ToJavaScript(CFX_WideTextBuf& javascript) } javascript << FX_WSTRC(L"catch(accessExceptions)\n{\nreturn 0;\n}\n}\n).call(this)\n"); } else if (m_pArguments) { - FX_INT32 argc = m_pArguments->GetSize(); - FX_INT32 index = 0; + int32_t argc = m_pArguments->GetSize(); + int32_t index = 0; CXFA_FMSimpleExpression *e = 0; while (index < argc) { e = (CXFA_FMSimpleExpression *)m_pArguments->GetAt(index); diff --git a/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.h b/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.h index b492b80e04..7d9f9d5f79 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.h +++ b/xfa/src/fxfa/src/fm2js/xfa_simpleexpression.h @@ -35,11 +35,11 @@ enum XFA_FM_SimpleExpressionType { }; CFX_WideStringC XFA_FM_EXPTypeToString(XFA_FM_SimpleExpressionType simpleExpType); struct XFA_FMBuildInFunc { - FX_UINT32 m_uHash; + uint32_t m_uHash; FX_LPCWSTR m_buildinfunc; }; struct XFA_FMSOMMethod { - FX_UINT32 m_uHash; + uint32_t m_uHash; FX_LPCWSTR m_wsSomMethodName; FX_DWORD m_dParameters; }; diff --git a/xfa/src/fxfa/src/parser/xfa_basic_data.cpp b/xfa/src/fxfa/src/parser/xfa_basic_data.cpp index fa452b57fb..c061b80a34 100644 --- a/xfa/src/fxfa/src/parser/xfa_basic_data.cpp +++ b/xfa/src/fxfa/src/parser/xfa_basic_data.cpp @@ -291,7 +291,7 @@ extern const XFA_ATTRIBUTEENUMINFO g_XFAEnumData[] = { {0xfefc4885, L"urlencoded", XFA_ATTRIBUTEENUM_Urlencoded}, {0xff795ad2, L"lowered", XFA_ATTRIBUTEENUM_Lowered}, }; -extern const FX_INT32 g_iXFAEnumCount = sizeof(g_XFAEnumData) / sizeof(XFA_ATTRIBUTEENUMINFO); +extern const int32_t g_iXFAEnumCount = sizeof(g_XFAEnumData) / sizeof(XFA_ATTRIBUTEENUMINFO); static const CXFA_Measurement g_XFAMeasurementData[] = { CXFA_Measurement(0, XFA_UNIT_In), CXFA_Measurement(0, XFA_UNIT_Pt), @@ -548,7 +548,7 @@ extern const XFA_ATTRIBUTEINFO g_XFAAttributeData[] = { {0xf889e747, L"xdpContent", XFA_ATTRIBUTE_XdpContent, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (FX_LPVOID)NULL}, {0xfea53ec6, L"decipherOnly", XFA_ATTRIBUTE_DecipherOnly, XFA_ATTRIBUTETYPE_Cdata, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, (FX_LPVOID)NULL}, }; -extern const FX_INT32 g_iXFAAttributeCount = sizeof(g_XFAAttributeData) / sizeof(XFA_ATTRIBUTEINFO); +extern const int32_t g_iXFAAttributeCount = sizeof(g_XFAAttributeData) / sizeof(XFA_ATTRIBUTEINFO); extern const XFA_NOTSUREATTRIBUTE g_XFANotsureAttributes[] = { {XFA_ELEMENT_SubformSet, XFA_ATTRIBUTE_Relation, XFA_ATTRIBUTETYPE_Enum, (FX_LPVOID)XFA_ATTRIBUTEENUM_Ordered}, {XFA_ELEMENT_NumberPattern, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum, (FX_LPVOID)XFA_ATTRIBUTEENUM_Numeric}, @@ -599,7 +599,7 @@ extern const XFA_NOTSUREATTRIBUTE g_XFANotsureAttributes[] = { {XFA_ELEMENT_Occur, XFA_ATTRIBUTE_Max, XFA_ATTRIBUTETYPE_Integer, (FX_LPVOID)1}, {XFA_ELEMENT_NumberSymbol, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTETYPE_Enum, (FX_LPVOID)XFA_ATTRIBUTEENUM_Decimal}, }; -extern const FX_INT32 g_iXFANotsureCount = sizeof(g_XFANotsureAttributes) / sizeof(XFA_NOTSUREATTRIBUTE); +extern const int32_t g_iXFANotsureCount = sizeof(g_XFANotsureAttributes) / sizeof(XFA_NOTSUREATTRIBUTE); extern const XFA_ELEMENTINFO g_XFAElementData[] = { {0x23ee3, L"ps", XFA_ELEMENT_Ps, XFA_XDPPACKET_Config, XFA_OBJECTTYPE_Node}, {0x25363, L"to", XFA_ELEMENT_To, XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode}, @@ -914,7 +914,7 @@ extern const XFA_ELEMENTINFO g_XFAElementData[] = { {0xfcbd606c, L"tagged", XFA_ELEMENT_Tagged, XFA_XDPPACKET_Config, XFA_OBJECTTYPE_ContentNode}, {0xff063802, L"items", XFA_ELEMENT_Items, XFA_XDPPACKET_Template | XFA_XDPPACKET_Form, XFA_OBJECTTYPE_Node}, }; -extern const FX_INT32 g_iXFAElementCount = sizeof(g_XFAElementData) / sizeof(XFA_ELEMENTINFO); +extern const int32_t g_iXFAElementCount = sizeof(g_XFAElementData) / sizeof(XFA_ELEMENTINFO); extern const XFA_ELEMENTHIERARCHY g_XFAElementPropertyIndex[] = { {0, 8}, {8, 0}, {8, 14}, {22, 0}, {22, 0}, {22, 6}, {28, 0}, {28, 0}, {28, 1}, {29, 3}, {32, 0}, {32, 0}, {32, 0}, {32, 3}, {35, 1}, {36, 0}, {36, 0}, {36, 2}, {38, 0}, {38, 0}, {38, 0}, {38, 4}, {42, 0}, {42, 0}, {42, 1}, {43, 0}, {43, 8}, {51, 19}, {70, 0}, {70, 0}, {70, 2}, {72, 1}, {73, 0}, {73, 2}, {75, 4}, {79, 1}, {80, 1}, {81, 0}, {81, 0}, {81, 3}, @@ -1040,7 +1040,7 @@ extern const XFA_ELEMENTHIERARCHY g_XFAElementAttributeIndex[] = { {1037, 2}, {1039, 0}, {1039, 4}, {1043, 2}, {1045, 0}, {1045, 2}, {1047, 3}, {1050, 2}, {1052, 5}, {1057, 2}, {1059, 2}, {1061, 4}, {1065, 3}, {1068, 0}, {1068, 4}, {1072, 2}, {1074, 2}, {1076, 3}, {1079, 4}, {1083, 8}, {1091, 5}, {1096, 0}, {1096, 4}, {1100, 6}, {1106, 2}, {1108, 1}, {1109, 2}, {1111, 2}, {1113, 2}, {1115, 1}, {1116, 2}, {1118, 7}, }; -extern const FX_BYTE g_XFAElementAttributeData[] = { +extern const uint8_t g_XFAElementAttributeData[] = { XFA_ATTRIBUTE_Name, XFA_ATTRIBUTE_Desc, XFA_ATTRIBUTE_Lock, XFA_ATTRIBUTE_Desc, XFA_ATTRIBUTE_Lock, XFA_ATTRIBUTE_Id, XFA_ATTRIBUTE_Use, XFA_ATTRIBUTE_Usehref, XFA_ATTRIBUTE_Id, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTE_Max, XFA_ATTRIBUTE_Use, XFA_ATTRIBUTE_EofAction, XFA_ATTRIBUTE_CursorType, XFA_ATTRIBUTE_LockType, XFA_ATTRIBUTE_BofAction, XFA_ATTRIBUTE_Usehref, XFA_ATTRIBUTE_CursorLocation, XFA_ATTRIBUTE_Desc, XFA_ATTRIBUTE_Lock, XFA_ATTRIBUTE_Id, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTE_Use, XFA_ATTRIBUTE_Relation, XFA_ATTRIBUTE_Relevant, XFA_ATTRIBUTE_Usehref, XFA_ATTRIBUTE_Desc, XFA_ATTRIBUTE_Lock, XFA_ATTRIBUTE_Name, XFA_ATTRIBUTE_Id, @@ -1172,7 +1172,7 @@ extern const XFA_PACKETINFO g_XFAPacketData[] = { {0xcd309ff4, L"form", XFA_XDPPACKET_Form, L"http://www.xfa.org/schema/xfa-form/", XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE}, {0xe14c801c, L"connectionSet", XFA_XDPPACKET_ConnectionSet, L"http://www.xfa.org/schema/xfa-connection-set/", XFA_XDPPACKET_FLAGS_NOMATCH | XFA_XDPPACKET_FLAGS_SUPPORTONE}, }; -extern const FX_INT32 g_iXFAPacketCount = sizeof(g_XFAPacketData) / sizeof(XFA_PACKETINFO); +extern const int32_t g_iXFAPacketCount = sizeof(g_XFAPacketData) / sizeof(XFA_PACKETINFO); extern const XFA_SCRIPTHIERARCHY g_XFAScriptIndex[] = { {0, 0, 0, 2, 316}, {0, 0, 2, 2, 316}, {0, 0, 4, 2, 316}, {0, 0, 6, 8, 316}, {0, 0, 14, 4, 316}, {0, 0, 18, 5, 317}, {0, 0, 23, 2, 316}, {0, 0, 25, 1, 316}, {0, 0, 26, 12, 316}, {0, 0, 38, 2, 316}, {0, 0, 40, 1, 316}, {0, 0, 41, 3, 316}, {0, 0, 44, 2, 316}, {0, 0, 46, 6, 316}, {0, 0, 52, 0, 316}, {0, 0, 52, 2, 319}, {0, 0, 54, 2, 316}, {0, 0, 56, 6, 316}, {0, 0, 62, 0, 316}, {0, 0, 62, 0, 316}, {0, 0, 62, 2, 316}, {0, 0, 64, 2, 316}, {0, 0, 66, 6, 316}, {0, 0, 72, 4, 316}, {0, 0, 76, 7, 316}, {0, 0, 83, 2, 320}, {0, 0, 85, 3, 316}, {0, 0, 88, 3, 316}, {0, 0, 91, 2, 320}, {0, 0, 93, 6, 320}, {0, 0, 99, 4, 316}, {0, 0, 103, 2, 316}, {0, 0, 105, 3, 319}, {0, 0, 108, 4, 316}, {0, 0, 112, 3, 316}, {0, 0, 115, 2, 316}, {0, 0, 117, 6, 316}, {0, 0, 123, 12, 316}, {0, 0, 135, 2, 316}, {0, 0, 137, 5, 316}, @@ -1240,7 +1240,7 @@ extern const XFA_METHODINFO g_SomMethodData[] = { {0xe006a76b, L"assignNode", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_NodeClass_AssignNode}, {0x7303fcea, L"getDelta", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_ContainerClass_GetDelta}, {0xe7742c9d, L"getDeltas", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_ContainerClass_GetDeltas}, {0x30ff6aad, L"clearErrorList", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_ModelClass_ClearErrorList}, {0x712c6afa, L"createNode", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_ModelClass_CreateNode}, {0x83a6411d, L"isCompatibleNS", (XFA_METHOD_CALLBACK)&CXFA_Node::Script_ModelClass_IsCompatibleNS}, }; -extern const FX_INT32 g_iSomMethodCount = sizeof(g_SomMethodData) / sizeof(XFA_METHODINFO); +extern const int32_t g_iSomMethodCount = sizeof(g_SomMethodData) / sizeof(XFA_METHODINFO); extern const _XFA_SCRIPTATTRIBUTEINFO g_SomAttributeData[] = { {0xbe52dfbf, L"desc", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String, XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic}, {0xf6b47749, L"lock", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL, XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic}, {0xbe52dfbf, L"desc", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String, XFA_ATTRIBUTE_Desc, XFA_SCRIPT_Basic}, {0xf6b47749, L"lock", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_BOOL, XFA_ATTRIBUTE_Lock, XFA_SCRIPT_Basic}, {0xc0811ed, L"use", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String, XFA_ATTRIBUTE_Use, XFA_SCRIPT_Basic}, {0xbc254332, L"usehref", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Attribute_String, XFA_ATTRIBUTE_Usehref, XFA_SCRIPT_Basic}, @@ -1603,4 +1603,4 @@ extern const _XFA_SCRIPTATTRIBUTEINFO g_SomAttributeData[] = { {0x97c1c65, L"context", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_ModelClass_Context, -1, XFA_SCRIPT_Object}, {0x58be2870, L"aliasNode", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_ModelClass_AliasNode, -1, XFA_SCRIPT_Object}, {0xa52682bd, L"{default}", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1, XFA_SCRIPT_Basic}, {0xd6e27f1d, L"value", (XFA_ATTRIBUTE_CALLBACK)&CXFA_Node::Script_Som_DefaultValue, -1, XFA_SCRIPT_Basic}, }; -extern const FX_INT32 g_iSomAttributeCount = sizeof(g_SomAttributeData) / sizeof(XFA_ATTRIBUTEINFO); +extern const int32_t g_iSomAttributeCount = sizeof(g_SomAttributeData) / sizeof(XFA_ATTRIBUTEINFO); diff --git a/xfa/src/fxfa/src/parser/xfa_basic_imp.cpp b/xfa/src/fxfa/src/parser/xfa_basic_imp.cpp index d97ec44fc8..618b7a2945 100644 --- a/xfa/src/fxfa/src/parser/xfa_basic_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_basic_imp.cpp @@ -18,36 +18,36 @@ #include "xfa_debug_parser.h" #include "xfa_basic_imp.h" extern const XFA_PACKETINFO g_XFAPacketData[]; -extern const FX_INT32 g_iXFAPacketCount; +extern const int32_t g_iXFAPacketCount; extern const XFA_ATTRIBUTEENUMINFO g_XFAEnumData[]; -extern const FX_INT32 g_iXFAEnumCount; +extern const int32_t g_iXFAEnumCount; extern const XFA_ATTRIBUTEINFO g_XFAAttributeData[]; -extern const FX_INT32 g_iXFAAttributeCount; +extern const int32_t g_iXFAAttributeCount; extern const XFA_ELEMENTINFO g_XFAElementData[]; -extern const FX_INT32 g_iXFAElementCount; +extern const int32_t g_iXFAElementCount; extern const XFA_ELEMENTHIERARCHY g_XFAElementChildrenIndex[]; extern const FX_WORD g_XFAElementChildrenData[]; extern const XFA_ELEMENTHIERARCHY g_XFAElementAttributeIndex[]; -extern const FX_BYTE g_XFAElementAttributeData[]; +extern const uint8_t g_XFAElementAttributeData[]; extern const XFA_NOTSUREATTRIBUTE g_XFANotsureAttributes[]; -extern const FX_INT32 g_iXFANotsureCount; +extern const int32_t g_iXFANotsureCount; extern const XFA_ELEMENTHIERARCHY g_XFAElementPropertyIndex[]; extern const XFA_PROPERTY g_XFAElementPropertyData[]; extern const XFA_SCRIPTHIERARCHY g_XFAScriptIndex[]; extern const XFA_METHODINFO g_SomMethodData[]; -extern const FX_INT32 g_iSomMethodCount; +extern const int32_t g_iSomMethodCount; extern const XFA_SCRIPTATTRIBUTEINFO g_SomAttributeData[]; -extern const FX_INT32 g_iSomAttributeCount; +extern const int32_t g_iSomAttributeCount; XFA_LPCPACKETINFO XFA_GetPacketByName(FX_WSTR wsName) { - FX_INT32 iLength = wsName.GetLength(); + int32_t iLength = wsName.GetLength(); if (iLength == 0) { return NULL; } - FX_UINT32 uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength); - FX_INT32 iStart = 0, iEnd = g_iXFAPacketCount - 1; + uint32_t uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength); + int32_t iStart = 0, iEnd = g_iXFAPacketCount - 1; do { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; XFA_LPCPACKETINFO pInfo = g_XFAPacketData + iMid; if (uHash == pInfo->uHash) { return pInfo; @@ -61,9 +61,9 @@ XFA_LPCPACKETINFO XFA_GetPacketByName(FX_WSTR wsName) } XFA_LPCPACKETINFO XFA_GetPacketByID(FX_DWORD dwPacket) { - FX_INT32 iStart = 0, iEnd = g_iXFAPacketCount - 1; + int32_t iStart = 0, iEnd = g_iXFAPacketCount - 1; do { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; FX_DWORD dwFind = (g_XFAPacketData + iMid)->eName; if (dwPacket == dwFind) { return g_XFAPacketData + iMid; @@ -77,14 +77,14 @@ XFA_LPCPACKETINFO XFA_GetPacketByID(FX_DWORD dwPacket) } XFA_LPCATTRIBUTEENUMINFO XFA_GetAttributeEnumByName(FX_WSTR wsName) { - FX_INT32 iLength = wsName.GetLength(); + int32_t iLength = wsName.GetLength(); if (iLength == 0) { return NULL; } - FX_UINT32 uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength); - FX_INT32 iStart = 0, iEnd = g_iXFAEnumCount - 1; + uint32_t uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength); + int32_t iStart = 0, iEnd = g_iXFAEnumCount - 1; do { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; XFA_LPCATTRIBUTEENUMINFO pInfo = g_XFAEnumData + iMid; if (uHash == pInfo->uHash) { return pInfo; @@ -100,20 +100,20 @@ XFA_LPCATTRIBUTEENUMINFO XFA_GetAttributeEnumByID(XFA_ATTRIBUTEENUM eName) { return g_XFAEnumData + eName; } -FX_INT32 XFA_GetAttributeCount() +int32_t XFA_GetAttributeCount() { return g_iXFAAttributeCount; } XFA_LPCATTRIBUTEINFO XFA_GetAttributeByName(FX_WSTR wsName) { - FX_INT32 iLength = wsName.GetLength(); + int32_t iLength = wsName.GetLength(); if (iLength == 0) { return NULL; } - FX_UINT32 uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength); - FX_INT32 iStart = 0, iEnd = g_iXFAAttributeCount - 1; + uint32_t uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength); + int32_t iStart = 0, iEnd = g_iXFAAttributeCount - 1; do { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; XFA_LPCATTRIBUTEINFO pInfo = g_XFAAttributeData + iMid; if (uHash == pInfo->uHash) { return pInfo; @@ -154,7 +154,7 @@ XFA_ATTRIBUTEENUM XFA_GetAttributeDefaultValue_Enum(XFA_ELEMENT eElement, XFA_AT { FX_LPVOID pValue; if (XFA_GetAttributeDefaultValue(pValue, eElement, eAttribute, XFA_ATTRIBUTETYPE_Enum, dwPacket)) { - return (XFA_ATTRIBUTEENUM)(FX_UINTPTR)pValue; + return (XFA_ATTRIBUTEENUM)(uintptr_t)pValue; } return XFA_ATTRIBUTEENUM_Unknown; } @@ -170,15 +170,15 @@ FX_BOOL XFA_GetAttributeDefaultValue_Boolean(XFA_ELEMENT eElement, XFA_ATTRIBUTE { FX_LPVOID pValue; if (XFA_GetAttributeDefaultValue(pValue, eElement, eAttribute, XFA_ATTRIBUTETYPE_Boolean, dwPacket)) { - return (FX_BOOL)(FX_UINTPTR)pValue; + return (FX_BOOL)(uintptr_t)pValue; } return FALSE; } -FX_INT32 XFA_GetAttributeDefaultValue_Integer(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket) +int32_t XFA_GetAttributeDefaultValue_Integer(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket) { FX_LPVOID pValue; if (XFA_GetAttributeDefaultValue(pValue, eElement, eAttribute, XFA_ATTRIBUTETYPE_Integer, dwPacket)) { - return (FX_INT32)(FX_UINTPTR)pValue; + return (int32_t)(uintptr_t)pValue; } return 0; } @@ -190,20 +190,20 @@ CXFA_Measurement XFA_GetAttributeDefaultValue_Measure(XFA_ELEMENT eElement, XFA_ } return CXFA_Measurement(); } -FX_INT32 XFA_GetElementCount() +int32_t XFA_GetElementCount() { return g_iXFAElementCount; } XFA_LPCELEMENTINFO XFA_GetElementByName(FX_WSTR wsName) { - FX_INT32 iLength = wsName.GetLength(); + int32_t iLength = wsName.GetLength(); if (iLength == 0) { return NULL; } - FX_UINT32 uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength); - FX_INT32 iStart = 0, iEnd = g_iXFAElementCount - 1; + uint32_t uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength); + int32_t iStart = 0, iEnd = g_iXFAElementCount - 1; do { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; XFA_LPCELEMENTINFO pInfo = g_XFAElementData + iMid; if (uHash == pInfo->uHash) { return pInfo; @@ -219,7 +219,7 @@ XFA_LPCELEMENTINFO XFA_GetElementByID(XFA_ELEMENT eName) { return (eName < g_iXFAElementCount) ? (g_XFAElementData + eName) : NULL; } -FX_LPCWORD XFA_GetElementChildren(XFA_ELEMENT eElement, FX_INT32 &iCount) +FX_LPCWORD XFA_GetElementChildren(XFA_ELEMENT eElement, int32_t &iCount) { if (eElement >= g_iXFAElementCount) { return NULL; @@ -228,7 +228,7 @@ FX_LPCWORD XFA_GetElementChildren(XFA_ELEMENT eElement, FX_INT32 &iCount) iCount = pElement->wCount; return g_XFAElementChildrenData + pElement->wStart; } -FX_LPCBYTE XFA_GetElementAttributes(XFA_ELEMENT eElement, FX_INT32 &iCount) +FX_LPCBYTE XFA_GetElementAttributes(XFA_ELEMENT eElement, int32_t &iCount) { if (eElement >= g_iXFAElementCount) { return NULL; @@ -239,13 +239,13 @@ FX_LPCBYTE XFA_GetElementAttributes(XFA_ELEMENT eElement, FX_INT32 &iCount) } XFA_LPCATTRIBUTEINFO XFA_GetAttributeOfElement(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket) { - FX_INT32 iCount = 0; + int32_t iCount = 0; FX_LPCBYTE pAttr = XFA_GetElementAttributes(eElement, iCount); if (pAttr == NULL || iCount < 1) { return NULL; } - CFX_DSPATemplate search; - FX_INT32 index = search.Lookup(eAttribute, pAttr, iCount); + CFX_DSPATemplate search; + int32_t index = search.Lookup(eAttribute, pAttr, iCount); if (index < 0) { return NULL; } @@ -258,13 +258,13 @@ XFA_LPCATTRIBUTEINFO XFA_GetAttributeOfElement(XFA_ELEMENT eElement, XFA_ATTRIBU } XFA_LPCELEMENTINFO XFA_GetChildOfElement(XFA_ELEMENT eElement, XFA_ELEMENT eChild, FX_DWORD dwPacket) { - FX_INT32 iCount = 0; + int32_t iCount = 0; FX_LPCWORD pChild = XFA_GetElementChildren(eElement, iCount); if (pChild == NULL || iCount < 1) { return NULL; } CFX_DSPATemplate search; - FX_INT32 index = search.Lookup(eChild, pChild, iCount); + int32_t index = search.Lookup(eChild, pChild, iCount); if (index < 0) { return NULL; } @@ -275,7 +275,7 @@ XFA_LPCELEMENTINFO XFA_GetChildOfElement(XFA_ELEMENT eElement, XFA_ELEMENT eChil } return (dwPacket & pInfo->dwPackets) ? pInfo : NULL; } -XFA_LPCPROPERTY XFA_GetElementProperties(XFA_ELEMENT eElement, FX_INT32 &iCount) +XFA_LPCPROPERTY XFA_GetElementProperties(XFA_ELEMENT eElement, int32_t &iCount) { if (eElement >= g_iXFAElementCount) { return NULL; @@ -286,12 +286,12 @@ XFA_LPCPROPERTY XFA_GetElementProperties(XFA_ELEMENT eElement, FX_INT32 &iCount) } XFA_LPCPROPERTY XFA_GetPropertyOfElement(XFA_ELEMENT eElement, XFA_ELEMENT eProperty, FX_DWORD dwPacket) { - FX_INT32 iCount = 0; + int32_t iCount = 0; XFA_LPCPROPERTY pProperty = XFA_GetElementProperties(eElement, iCount); if (pProperty == NULL || iCount < 1) { return NULL; } - FX_INT32 iStart = 0, iEnd = iCount - 1, iMid; + int32_t iStart = 0, iEnd = iCount - 1, iMid; do { iMid = (iStart + iEnd) / 2; XFA_ELEMENT eName = (XFA_ELEMENT)pProperty[iMid].eName; @@ -315,9 +315,9 @@ XFA_LPCPROPERTY XFA_GetPropertyOfElement(XFA_ELEMENT eElement, XFA_ELEMENT eProp } XFA_LPCNOTSUREATTRIBUTE XFA_GetNotsureAttribute(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, XFA_ATTRIBUTETYPE eType) { - FX_INT32 iStart = 0, iEnd = g_iXFANotsureCount - 1; + int32_t iStart = 0, iEnd = g_iXFANotsureCount - 1; do { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; XFA_LPCNOTSUREATTRIBUTE pAttr = g_XFANotsureAttributes + iMid; if (eElement == pAttr->eElement) { if (pAttr->eAttribute == eAttribute) { @@ -326,7 +326,7 @@ XFA_LPCNOTSUREATTRIBUTE XFA_GetNotsureAttribute(XFA_ELEMENT eElement, XFA_ATTRIB } return NULL; } else { - FX_INT32 iBefore = iMid - 1; + int32_t iBefore = iMid - 1; if(iBefore >= 0) { pAttr = g_XFANotsureAttributes + iBefore; while(eElement == pAttr->eElement) { @@ -343,7 +343,7 @@ XFA_LPCNOTSUREATTRIBUTE XFA_GetNotsureAttribute(XFA_ELEMENT eElement, XFA_ATTRIB pAttr = g_XFANotsureAttributes + iBefore; } } - FX_INT32 iAfter = iMid + 1; + int32_t iAfter = iMid + 1; if(iAfter <= g_iXFANotsureCount - 1) { pAttr = g_XFANotsureAttributes + iAfter; while(eElement == pAttr->eElement) { @@ -370,28 +370,28 @@ XFA_LPCNOTSUREATTRIBUTE XFA_GetNotsureAttribute(XFA_ELEMENT eElement, XFA_ATTRIB } while (iStart <= iEnd); return NULL; } -FX_INT32 XFA_GetMethodCount() +int32_t XFA_GetMethodCount() { return g_iSomMethodCount; } XFA_LPCMETHODINFO XFA_GetMethodByName(XFA_ELEMENT eElement, FX_WSTR wsMethodName) { - FX_INT32 iLength = wsMethodName.GetLength(); + int32_t iLength = wsMethodName.GetLength(); if (iLength == 0) { return NULL; } - FX_INT32 iElementIndex = eElement; + int32_t iElementIndex = eElement; while(iElementIndex != -1) { XFA_LPCSCRIPTHIERARCHY scriptIndex = g_XFAScriptIndex + iElementIndex; - FX_INT32 icount = scriptIndex->wMethodCount; + int32_t icount = scriptIndex->wMethodCount; if(icount == 0) { iElementIndex = scriptIndex->wParentIndex; continue; } - FX_UINT32 uHash = FX_HashCode_String_GetW(wsMethodName.GetPtr(), iLength); - FX_INT32 iStart = scriptIndex->wMethodStart, iEnd = iStart + icount - 1; + uint32_t uHash = FX_HashCode_String_GetW(wsMethodName.GetPtr(), iLength); + int32_t iStart = scriptIndex->wMethodStart, iEnd = iStart + icount - 1; do { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; XFA_LPCMETHODINFO pInfo = g_SomMethodData + iMid; if (uHash == pInfo->uHash) { return pInfo; @@ -407,22 +407,22 @@ XFA_LPCMETHODINFO XFA_GetMethodByName(XFA_ELEMENT eElement, FX_WSTR wsMethodName } XFA_LPCSCRIPTATTRIBUTEINFO XFA_GetScriptAttributeByName(XFA_ELEMENT eElement, FX_WSTR wsAttributeName) { - FX_INT32 iLength = wsAttributeName.GetLength(); + int32_t iLength = wsAttributeName.GetLength(); if (iLength == 0) { return NULL; } - FX_INT32 iElementIndex = eElement; + int32_t iElementIndex = eElement; while(iElementIndex != -1) { XFA_LPCSCRIPTHIERARCHY scriptIndex = g_XFAScriptIndex + iElementIndex; - FX_INT32 icount = scriptIndex->wAttributeCount; + int32_t icount = scriptIndex->wAttributeCount; if(icount == 0) { iElementIndex = scriptIndex->wParentIndex; continue; } - FX_UINT32 uHash = FX_HashCode_String_GetW(wsAttributeName.GetPtr(), iLength); - FX_INT32 iStart = scriptIndex->wAttributeStart, iEnd = iStart + icount - 1; + uint32_t uHash = FX_HashCode_String_GetW(wsAttributeName.GetPtr(), iLength); + int32_t iStart = scriptIndex->wAttributeStart, iEnd = iStart + icount - 1; do { - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iMid = (iStart + iEnd) / 2; XFA_LPCSCRIPTATTRIBUTEINFO pInfo = g_SomAttributeData + iMid; if (uHash == pInfo->uHash) { return pInfo; @@ -443,8 +443,8 @@ void CXFA_Measurement::Set(FX_WSTR wsMeasure) m_eUnit = XFA_UNIT_Unknown; return; } - FX_INT32 iUsedLen = 0; - FX_INT32 iOffset = (wsMeasure.GetAt(0) == L'=') ? 1 : 0; + int32_t iUsedLen = 0; + int32_t iOffset = (wsMeasure.GetAt(0) == L'=') ? 1 : 0; FX_FLOAT fValue = FX_wcstof(wsMeasure.GetPtr() + iOffset, wsMeasure.GetLength() - iOffset, &iUsedLen); XFA_UNIT eUnit = GetUnit(wsMeasure.Mid(iOffset + iUsedLen)); Set(fValue, eUnit); @@ -581,11 +581,11 @@ FX_DWORD CXFA_WideTextRead::GetAccessModes() const { return FX_STREAMACCESS_Read | FX_STREAMACCESS_Text; } -FX_INT32 CXFA_WideTextRead::GetLength() const +int32_t CXFA_WideTextRead::GetLength() const { return m_wsBuffer.GetLength() * sizeof(FX_WCHAR); } -FX_INT32 CXFA_WideTextRead::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) +int32_t CXFA_WideTextRead::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { switch (eSeek) { case FX_STREAMSEEK_Begin: @@ -606,7 +606,7 @@ FX_INT32 CXFA_WideTextRead::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) } return GetPosition(); } -FX_INT32 CXFA_WideTextRead::GetPosition() +int32_t CXFA_WideTextRead::GetPosition() { return m_iPosition * sizeof(FX_WCHAR); } @@ -614,7 +614,7 @@ FX_BOOL CXFA_WideTextRead::IsEOF() const { return m_iPosition >= m_wsBuffer.GetLength(); } -FX_INT32 CXFA_WideTextRead::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize ) +int32_t CXFA_WideTextRead::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize ) { if (iMaxLength > m_wsBuffer.GetLength() - m_iPosition) { iMaxLength = m_wsBuffer.GetLength() - m_iPosition; diff --git a/xfa/src/fxfa/src/parser/xfa_basic_imp.h b/xfa/src/fxfa/src/parser/xfa_basic_imp.h index 71bcbb6167..cbffe4e635 100644 --- a/xfa/src/fxfa/src/parser/xfa_basic_imp.h +++ b/xfa/src/fxfa/src/parser/xfa_basic_imp.h @@ -22,31 +22,31 @@ public: virtual IFX_Stream* Retain(); virtual FX_DWORD GetAccessModes() const; - virtual FX_INT32 GetLength() const; - virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); - virtual FX_INT32 GetPosition(); + virtual int32_t GetLength() const; + virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset); + virtual int32_t GetPosition(); virtual FX_BOOL IsEOF() const; - virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) + virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) { return 0; } - virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL); - virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) + virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL); + virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) { return 0; } - virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) + virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength) { return 0; } virtual void Flush() {} - virtual FX_BOOL SetLength(FX_INT32 iLength) + virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; } - virtual FX_INT32 GetBOM(FX_BYTE bom[4]) const + virtual int32_t GetBOM(uint8_t bom[4]) const { return 0; } @@ -56,7 +56,7 @@ public: virtual void Lock() {} virtual void Unlock() {} - virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength) + virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength) { return NULL; } @@ -67,7 +67,7 @@ public: } protected: CFX_WideString m_wsBuffer; - FX_INT32 m_iPosition; - FX_INT32 m_iRefCount; + int32_t m_iPosition; + int32_t m_iRefCount; }; #endif diff --git a/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp b/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp index f496e484ce..4e9e8eda30 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp @@ -21,7 +21,7 @@ #include "xfa_document_datadescription_imp.h" #include "xfa_document_datamerger_imp.h" #include "xfa_document_layout_imp.h" -static FX_BOOL XFA_GetOccurInfo(CXFA_Node* pOccurNode, FX_INT32& iMin, FX_INT32& iMax, FX_INT32& iInit) +static FX_BOOL XFA_GetOccurInfo(CXFA_Node* pOccurNode, int32_t& iMin, int32_t& iMax, int32_t& iInit) { if(!pOccurNode) { return FALSE; @@ -134,11 +134,11 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, CXFA_Node* pDa if (pWidgetData->GetChoiceListOpen() == XFA_ATTRIBUTEENUM_MultiSelect) { CFX_WideStringArray wsSelTextArray; pWidgetData->GetSelectedItemsValue(wsSelTextArray); - FX_INT32 iSize = wsSelTextArray.GetSize(); + int32_t iSize = wsSelTextArray.GetSize(); if (iSize >= 1) { CXFA_Node *pValue = NULL; IFDE_XMLNode *pValueXMLNode = NULL; - for (FX_INT32 i = 0; i < iSize; i++) { + for (int32_t i = 0; i < iSize; i++) { pValue = pDataNode->CreateSamePacketNode(XFA_ELEMENT_DataValue); pValue->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"value")); pValueXMLNode = pValue->CreateXMLMappingNode(); @@ -277,11 +277,11 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, CXFA_Node* pDa if (pWidgetData->GetChoiceListOpen() == XFA_ATTRIBUTEENUM_MultiSelect) { CXFA_NodeArray items; pDataNode->GetNodeList(items); - FX_INT32 iCounts = items.GetSize(); + int32_t iCounts = items.GetSize(); if (iCounts > 0) { wsNormailizeValue.Empty(); CFX_WideString wsItem; - for (FX_INT32 i = 0; i < iCounts; i++) { + for (int32_t i = 0; i < iCounts; i++) { items[i]->TryContent(wsItem); wsItem = (iCounts == 1) ? wsItem : wsItem + FX_WSTRC(L"\n"); wsNormailizeValue += wsItem; @@ -545,7 +545,7 @@ static CXFA_Node* XFA_DataMerge_FindMatchingDataNode(CXFA_Document* pDocument, C continue; } CXFA_Node* pTemplateNodeOccur = pCurTemplateNode->GetFirstChildByClass(XFA_ELEMENT_Occur); - FX_INT32 iMin, iMax, iInit; + int32_t iMin, iMax, iInit; if(pTemplateNodeOccur && XFA_GetOccurInfo(pTemplateNodeOccur, iMin, iMax, iInit) && iMax == 0) { pCurTemplateNode = pIterator->MoveToNext(); continue; @@ -609,10 +609,10 @@ static CXFA_Node* XFA_DataMerge_FindMatchingDataNode(CXFA_Document* pDocument, C } static void XFA_DataMerge_SortRecurseRecord(CFX_ArrayTemplate& rgRecords, CXFA_Node* pDataScope, FX_BOOL bChoiceMode = FALSE) { - FX_INT32 iCount = rgRecords.GetSize(); + int32_t iCount = rgRecords.GetSize(); CFX_ArrayTemplate rgResultRecord; for (CXFA_Node* pChildNode = pDataScope->GetNodeItem(XFA_NODEITEM_FirstChild); pChildNode; pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { - for(FX_INT32 i = 0; i < iCount; i ++) { + for(int32_t i = 0; i < iCount; i ++) { CXFA_Node* pNode = rgRecords[i].pDataChild; if (pChildNode == pNode) { XFA_DataMerge_RecurseRecord sNewRecord = {rgRecords[i].pTemplateChild, pNode}; @@ -628,7 +628,7 @@ static void XFA_DataMerge_SortRecurseRecord(CFX_ArrayTemplate 0) { if (!bChoiceMode) { - for (FX_INT32 i = 0; i < iCount; i++) { + for (int32_t i = 0; i < iCount; i++) { XFA_DataMerge_RecurseRecord sNewRecord = {rgRecords[i].pTemplateChild, rgRecords[i].pDataChild}; rgResultRecord.Add(sNewRecord); } @@ -669,12 +669,12 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet(CXFA_Document* pDocumen } } } - FX_INT32 iMax = 1, iInit = 1, iMin = 1; + int32_t iMax = 1, iInit = 1, iMin = 1; if(!bOneInstance) { XFA_GetOccurInfo(pOccurNode, iMin, iMax, iInit); } XFA_ATTRIBUTEENUM eRelation = eElement == XFA_ELEMENT_SubformSet ? pTemplateNode->GetEnum(XFA_ATTRIBUTE_Relation) : XFA_ATTRIBUTEENUM_Ordered; - FX_INT32 iCurRepeatIndex = 0; + int32_t iCurRepeatIndex = 0; XFA_ATTRIBUTEENUM eParentBindMatch = XFA_ATTRIBUTEENUM_None; if (bDataMerge) { CXFA_NodeIteratorTemplate sNodeIterator(pTemplateNode); @@ -702,7 +702,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet(CXFA_Document* pDocumen subformArray.Add(pSubformNode); } FX_POSITION position = subformMapArray.GetStartPosition(); - for(FX_INT32 iIndex = 0; iIndex < subformArray.GetSize(); iIndex ++) { + for(int32_t iIndex = 0; iIndex < subformArray.GetSize(); iIndex ++) { CXFA_Node* pSubform = subformArray[iIndex]; CXFA_Node* pDataNode = (CXFA_Node*)subformMapArray.GetValueAt(pSubform); for (CXFA_Node *pTemplateChild = pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild); pTemplateChild; pTemplateChild = pTemplateChild->GetNodeItem(XFA_NODEITEM_NextSibling)) { @@ -762,11 +762,11 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet(CXFA_Document* pDocumen case XFA_ATTRIBUTEENUM_Unordered: { if(rgItemMatchList.GetSize()) { XFA_DataMerge_SortRecurseRecord(rgItemMatchList, pDataScope); - for(FX_INT32 i = 0, count = rgItemMatchList.GetSize(); i < count; i ++) { + for(int32_t i = 0, count = rgItemMatchList.GetSize(); i < count; i ++) { pDocument->DataMerge_CopyContainer(rgItemMatchList[i].pTemplateChild, pSubformSetNode, pDataScope); } } - for(FX_INT32 i = 0, count = rgItemUnmatchList.GetSize(); i < count; i ++) { + for(int32_t i = 0, count = rgItemUnmatchList.GetSize(); i < count; i ++) { pDocument->DataMerge_CopyContainer(rgItemUnmatchList[i], pSubformSetNode, pDataScope); } } @@ -790,7 +790,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet(CXFA_Document* pDocumen } } if(iCurRepeatIndex == 0 && bAccessedDataDOM == FALSE) { - FX_INT32 iLimit = iMax; + int32_t iLimit = iMax; if (pInstMgrNode && pTemplateNode->GetNameHash() == 0) { iLimit = subformArray.GetSize(); if (iLimit < iMin) { @@ -823,7 +823,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet(CXFA_Document* pDocumen } } } - FX_INT32 iMinimalLimit = iCurRepeatIndex == 0 ? iInit : iMin; + int32_t iMinimalLimit = iCurRepeatIndex == 0 ? iInit : iMin; for (; iCurRepeatIndex < iMinimalLimit; iCurRepeatIndex++) { CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer(pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray); FXSYS_assert(pSubformSetNode); @@ -1111,7 +1111,7 @@ void CXFA_Document::DataMerge_UpdateBindingRelations(CXFA_Node* pFormUpdateRoot) } CXFA_Node * CXFA_Document::GetNotBindNode(CXFA_ObjArray& arrayNodes) { - for(FX_INT32 i = 0; i < arrayNodes.GetSize(); i++) { + for(int32_t i = 0; i < arrayNodes.GetSize(); i++) { CXFA_Object* pObject = arrayNodes[i]; if(!pObject->IsNode()) { continue; diff --git a/xfa/src/fxfa/src/parser/xfa_document_imp.cpp b/xfa/src/fxfa/src/parser/xfa_document_imp.cpp index ad1ff99253..d634079f58 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_imp.cpp @@ -282,9 +282,9 @@ XFA_VERSION CXFA_Document::RecognizeXFAVersionNumber(CFX_WideString& wsTemplateN if(nDotPos == (FX_STRSIZE)-1) { return XFA_VERSION_UNKNOWN; } - FX_INT8 iMajor = FXSYS_wtoi(wsTemplateNS.Mid(nPrefixLength, nDotPos - nPrefixLength)); - FX_INT8 iMinor = FXSYS_wtoi(wsTemplateNS.Mid(nDotPos + 1, wsTemplateNS.GetLength() - nDotPos - 2)); - XFA_VERSION eVersion = (XFA_VERSION)((FX_INT32)iMajor * 100 + iMinor); + int8_t iMajor = FXSYS_wtoi(wsTemplateNS.Mid(nPrefixLength, nDotPos - nPrefixLength)); + int8_t iMinor = FXSYS_wtoi(wsTemplateNS.Mid(nDotPos + 1, wsTemplateNS.GetLength() - nDotPos - 2)); + XFA_VERSION eVersion = (XFA_VERSION)((int32_t)iMajor * 100 + iMinor); if(eVersion < XFA_VERSION_MIN || eVersion > XFA_VERSION_MAX) { return XFA_VERSION_UNKNOWN; } @@ -401,7 +401,7 @@ void CXFA_Document::DoProtoMerge() if(!wsSOM.IsEmpty()) { FX_DWORD dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; XFA_RESOLVENODE_RS resoveNodeRS; - FX_INT32 iRet = m_pScriptContext->ResolveObjects(pUseHrefNode, wsSOM, resoveNodeRS, dwFlag); + int32_t iRet = m_pScriptContext->ResolveObjects(pUseHrefNode, wsSOM, resoveNodeRS, dwFlag); if(iRet > 0 && resoveNodeRS.nodes[0]->IsNode()) { pProtoNode = (CXFA_Node*)resoveNodeRS.nodes[0]; } diff --git a/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp b/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp index 5ca9bb7a9b..03557dd548 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp @@ -51,7 +51,7 @@ CXFA_Document* CXFA_LayoutProcessor::GetDocument() const { return m_pDocument; } -FX_INT32 CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart) +int32_t CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart) { if (!bForceRestart && !IsNeedLayout()) { return 100; @@ -85,7 +85,7 @@ FX_INT32 CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart) m_nProgressCounter = 1; return 0; } -FX_INT32 CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause ) +int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause ) { if (m_nProgressCounter < 1) { return -1; @@ -120,7 +120,7 @@ FX_BOOL CXFA_LayoutProcessor::IncrementLayout() StartLayout(TRUE); return DoLayout(NULL) == 100; } - for (FX_INT32 i = 0, c = m_rgChangedContainers.GetSize(); i < c; i++) { + for (int32_t i = 0, c = m_rgChangedContainers.GetSize(); i < c; i++) { CXFA_Node *pNode = m_rgChangedContainers[i]; CXFA_Node *pParentNode = pNode->GetNodeItem(XFA_NODEITEM_Parent, XFA_OBJECTTYPE_ContainerNode); if(!pParentNode) { @@ -133,11 +133,11 @@ FX_BOOL CXFA_LayoutProcessor::IncrementLayout() m_rgChangedContainers.RemoveAll(); return TRUE; } -FX_INT32 CXFA_LayoutProcessor::CountPages() const +int32_t CXFA_LayoutProcessor::CountPages() const { return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPageCount() : 0; } -IXFA_LayoutPage* CXFA_LayoutProcessor::GetPage(FX_INT32 index) const +IXFA_LayoutPage* CXFA_LayoutProcessor::GetPage(int32_t index) const { return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetPage(index) : NULL; } diff --git a/xfa/src/fxfa/src/parser/xfa_document_layout_imp.h b/xfa/src/fxfa/src/parser/xfa_document_layout_imp.h index b1c9e0bc14..0572b89dcc 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_layout_imp.h +++ b/xfa/src/fxfa/src/parser/xfa_document_layout_imp.h @@ -16,11 +16,11 @@ public: CXFA_LayoutProcessor(CXFA_Document* pDocument); ~CXFA_LayoutProcessor(); virtual CXFA_Document* GetDocument() const; - virtual FX_INT32 StartLayout(FX_BOOL bForceRestart = FALSE); - virtual FX_INT32 DoLayout(IFX_Pause *pPause = NULL); + virtual int32_t StartLayout(FX_BOOL bForceRestart = FALSE); + virtual int32_t DoLayout(IFX_Pause *pPause = NULL); virtual FX_BOOL IncrementLayout(); - virtual FX_INT32 CountPages() const; - virtual IXFA_LayoutPage* GetPage(FX_INT32 index) const; + virtual int32_t CountPages() const; + virtual IXFA_LayoutPage* GetPage(int32_t index) const; virtual CXFA_LayoutItem* GetLayoutItem(CXFA_Node *pFormItem); void AddChangedContainer(CXFA_Node* pContainer); @@ -46,7 +46,7 @@ protected: CXFA_ItemLayoutProcessor* m_pRootItemLayoutProcessor; CXFA_LayoutPageMgr* m_pLayoutPageMgr; CXFA_NodeArray m_rgChangedContainers; - FX_UINT32 m_nProgressCounter; + uint32_t m_nProgressCounter; FX_BOOL m_bNeeLayout; }; #endif diff --git a/xfa/src/fxfa/src/parser/xfa_document_serialize.cpp b/xfa/src/fxfa/src/parser/xfa_document_serialize.cpp index 6df2483a1e..f9c22e8149 100644 --- a/xfa/src/fxfa/src/parser/xfa_document_serialize.cpp +++ b/xfa/src/fxfa/src/parser/xfa_document_serialize.cpp @@ -74,8 +74,8 @@ FX_BOOL CXFA_DataImporter::ImportData(IFX_FileRead* pDataDocument) CFX_WideString XFA_ExportEncodeAttribute(const CFX_WideString& str) { CFX_WideTextBuf textBuf; - FX_INT32 iLen = str.GetLength(); - for (FX_INT32 i = 0; i < iLen; i++) { + int32_t iLen = str.GetLength(); + for (int32_t i = 0; i < iLen; i++) { switch (str[i]) { case '&': textBuf << FX_WSTRC(L"&"); @@ -101,8 +101,8 @@ CFX_WideString XFA_ExportEncodeAttribute(const CFX_WideString& str) CFX_WideString XFA_ExportEncodeContent(FX_WSTR str) { CFX_WideTextBuf textBuf; - FX_INT32 iLen = str.GetLength(); - for (FX_INT32 i = 0; i < iLen; i++) { + int32_t iLen = str.GetLength(); + for (int32_t i = 0; i < iLen; i++) { FX_WCHAR ch = str.GetAt(i); if (!FDE_IsXMLValidChar(ch)) { continue; @@ -202,7 +202,7 @@ static void XFA_DataExporter_RecognizeXFAVersionNumber(CXFA_Node *pTemplateRoot, static void XFA_DataExporter_RegenerateFormFile_Changed(CXFA_Node* pNode, CFX_WideTextBuf& buf, FX_BOOL bSaveXML = FALSE) { CFX_WideString wsAttrs; - FX_INT32 iAttrs = 0; + int32_t iAttrs = 0; FX_LPCBYTE pAttrs = XFA_GetElementAttributes(pNode->GetClassID(), iAttrs); while (iAttrs--) { XFA_LPCATTRIBUTEINFO pAttr = XFA_GetAttributeByID((XFA_ATTRIBUTE)pAttrs[iAttrs]); @@ -251,8 +251,8 @@ static void XFA_DataExporter_RegenerateFormFile_Changed(CXFA_Node* pNode, CFX_Wi break; } CFX_WideStringArray wsSelTextArray; - FX_INT32 iStart = 0; - FX_INT32 iEnd = wsRawValue.Find(L'\n', iStart); + int32_t iStart = 0; + int32_t iEnd = wsRawValue.Find(L'\n', iStart); iEnd = (iEnd == -1) ? wsRawValue.GetLength() : iEnd; while (iEnd >= iStart) { wsSelTextArray.Add(wsRawValue.Mid(iStart, iEnd - iStart)); @@ -274,7 +274,7 @@ static void XFA_DataExporter_RegenerateFormFile_Changed(CXFA_Node* pNode, CFX_Wi buf << FX_WSTRC(L"<"); buf << bodyTagName; buf << FX_WSTRC(L" xmlns=\"\"\n>"); - for (FX_INT32 i = 0; i < wsSelTextArray.GetSize(); i++) { + for (int32_t i = 0; i < wsSelTextArray.GetSize(); i++) { buf << FX_WSTRC(L""); buf << XFA_ExportEncodeContent(wsSelTextArray[i]); buf << FX_WSTRC(L""); @@ -364,7 +364,7 @@ static void XFA_DataExporter_RegenerateFormFile_Container(CXFA_Node* pNode, IFX_ CFX_WideString wsOutput; XFA_SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), TRUE, wsOutput); CFX_WideString wsAttrs; - FX_INT32 iAttrs = 0; + int32_t iAttrs = 0; FX_LPCBYTE pAttrs = XFA_GetElementAttributes(pNode->GetClassID(), iAttrs); while (iAttrs--) { XFA_LPCATTRIBUTEINFO pAttr = XFA_GetAttributeByID((XFA_ATTRIBUTE)pAttrs[iAttrs]); @@ -521,7 +521,7 @@ void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node *pDataNode) if (!pDataNode || pDataNode->GetClassID() == XFA_ELEMENT_DataValue) { return; } - FX_INT32 iChildNum = 0; + int32_t iChildNum = 0; for (CXFA_Node *pChildNode = pDataNode->GetNodeItem(XFA_NODEITEM_FirstChild); pChildNode; pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { iChildNum++; XFA_DataExporter_DealWithDataGroupNode(pChildNode); diff --git a/xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp b/xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp index fb592b4c97..b276abca30 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp +++ b/xfa/src/fxfa/src/parser/xfa_layout_appadapter.cpp @@ -25,7 +25,7 @@ IXFA_DocLayout* IXFA_LayoutPage::GetLayout() const CXFA_ContainerLayoutItemImpl* pThis = (CXFA_ContainerLayoutItemImpl*)this; return pThis->m_pFormNode->GetDocument()->GetLayoutProcessor(); } -FX_INT32 IXFA_LayoutPage::GetPageIndex() const +int32_t IXFA_LayoutPage::GetPageIndex() const { CXFA_ContainerLayoutItemImpl* pThis = (CXFA_ContainerLayoutItemImpl*)this; return pThis->m_pFormNode->GetDocument()->GetLayoutProcessor()->GetLayoutPageMgr()->GetPageIndex((IXFA_LayoutPage*)this); @@ -120,10 +120,10 @@ CXFA_LayoutItem* CXFA_LayoutItem::GetLast() const } return (CXFA_LayoutItem*)pCurNode; } -FX_INT32 CXFA_LayoutItem::GetIndex() const +int32_t CXFA_LayoutItem::GetIndex() const { CXFA_ContentLayoutItemImpl* pThis = (CXFA_ContentLayoutItemImpl*)this; - FX_INT32 iIndex = 0; + int32_t iIndex = 0; CXFA_ContentLayoutItemImpl* pCurNode = pThis; while(pCurNode->m_pPrev) { pCurNode = pCurNode->m_pPrev; @@ -131,10 +131,10 @@ FX_INT32 CXFA_LayoutItem::GetIndex() const } return iIndex; } -FX_INT32 CXFA_LayoutItem::GetCount() const +int32_t CXFA_LayoutItem::GetCount() const { CXFA_ContentLayoutItemImpl* pThis = (CXFA_ContentLayoutItemImpl*)this; - FX_INT32 iCount = 1; + int32_t iCount = 1; CXFA_ContentLayoutItemImpl* pCurNode = NULL; pCurNode = pThis; while(pCurNode->m_pPrev) { diff --git a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp index 228086734b..4ebc248ec2 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp +++ b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp @@ -274,7 +274,7 @@ void CXFA_ItemLayoutProcessor::SplitLayoutItem(CXFA_ContentLayoutItemImpl* pLayo pSecondLayoutItem->AddChild(pChildItem); } else { if(lHeightForKeep < XFA_LAYOUT_FLOAT_PERCISION) { - for(FX_INT32 iIndex = 0; iIndex < keepLayoutItems.GetSize(); iIndex ++) { + for(int32_t iIndex = 0; iIndex < keepLayoutItems.GetSize(); iIndex ++) { CXFA_ContentLayoutItemImpl *pPreItem = keepLayoutItems[iIndex]; pLayoutItem->RemoveChild(pPreItem); pPreItem->m_sPos.y -= fSplitPos; @@ -713,7 +713,7 @@ static inline void XFA_ItemLayoutProcessor_CalculateContainerComponentSizeFromCo void CXFA_ItemLayoutProcessor::CalculatePositionedContainerPos(CXFA_Node* pNode, FX_FLOAT fWidth, FX_FLOAT fHeight, FX_FLOAT& fAbsoluteX, FX_FLOAT& fAbsoluteY) { XFA_ATTRIBUTEENUM eAnchorType = pNode->GetEnum(XFA_ATTRIBUTE_AnchorType); - FX_INT32 nAnchorType = 0; + int32_t nAnchorType = 0; switch(eAnchorType) { case XFA_ATTRIBUTEENUM_TopLeft: nAnchorType = 0; @@ -745,16 +745,16 @@ void CXFA_ItemLayoutProcessor::CalculatePositionedContainerPos(CXFA_Node* pNode, default: break; } - static const FX_UINT8 nNextPos[4][9] = { {0, 1, 2, 3, 4, 5, 6, 7, 8}, + static const uint8_t nNextPos[4][9] = { {0, 1, 2, 3, 4, 5, 6, 7, 8}, {6, 3, 0, 7, 4, 1, 8, 5, 2}, {8, 7, 6, 5, 4, 3, 2, 1, 0}, {2, 5, 8, 1, 4, 7, 0, 3, 6} }; FX_FLOAT fAnchorX = pNode->GetMeasure(XFA_ATTRIBUTE_X).ToUnit(XFA_UNIT_Pt); FX_FLOAT fAnchorY = pNode->GetMeasure(XFA_ATTRIBUTE_Y).ToUnit(XFA_UNIT_Pt); - FX_INT32 nRotate = FXSYS_round(pNode->GetMeasure(XFA_ATTRIBUTE_Rotate).GetValue()); + int32_t nRotate = FXSYS_round(pNode->GetMeasure(XFA_ATTRIBUTE_Rotate).GetValue()); nRotate = XFA_MapRotation(nRotate) / 90; - FX_INT32 nAbsoluteAnchorType = nNextPos[nRotate][nAnchorType]; + int32_t nAbsoluteAnchorType = nNextPos[nRotate][nAnchorType]; fAbsoluteX = fAnchorX; fAbsoluteY = fAnchorY; switch(nAbsoluteAnchorType / 3) { @@ -867,7 +867,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer(CXFA_LayoutContext* p if(m_pCurChildNode == XFA_LAYOUT_INVALIDNODE) { XFA_ItemLayoutProcessor_GotoNextContainerNode(m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE); } - FX_INT32 iColIndex = 0; + int32_t iColIndex = 0; for(; m_pCurChildNode; XFA_ItemLayoutProcessor_GotoNextContainerNode(m_pCurChildNode, m_nCurChildNodeStage, m_pFormNode, FALSE)) { if (m_nCurChildNodeStage != XFA_ItemLayoutProcessorStages_Container) { continue; @@ -880,14 +880,14 @@ void CXFA_ItemLayoutProcessor::DoLayoutPositionedContainer(CXFA_LayoutContext* p pProcessor->m_pPageMgrCreateItem = m_pPageMgrCreateItem; #endif if (pContext && pContext->m_prgSpecifiedColumnWidths) { - FX_INT32 iColSpan = m_pCurChildNode->GetInteger(XFA_ATTRIBUTE_ColSpan); + int32_t iColSpan = m_pCurChildNode->GetInteger(XFA_ATTRIBUTE_ColSpan); if (iColSpan <= pContext->m_prgSpecifiedColumnWidths->GetSize() - iColIndex) { pContext->m_fCurColumnWidth = 0; pContext->m_bCurColumnWidthAvaiable = TRUE; if(iColSpan == -1) { iColSpan = pContext->m_prgSpecifiedColumnWidths->GetSize(); } - for (FX_INT32 i = 0; i < iColSpan; i++) { + for (int32_t i = 0; i < iColSpan; i++) { pContext->m_fCurColumnWidth += pContext->m_prgSpecifiedColumnWidths->GetAt(iColIndex + i); } if(pContext->m_fCurColumnWidth == 0) { @@ -993,16 +993,16 @@ static inline void XFA_ItemLayoutProcessor_RelocateTableRowCells(CXFA_ContentLay FX_FLOAT fContentCurrentHeight = pLayoutRow->m_sSize.y - fTopInset - fBottomInset; FX_FLOAT fContentCalculatedWidth = 0, fContentCalculatedHeight = 0; FX_FLOAT fCurrentColX = 0; - FX_INT32 nCurrentColIdx = 0; + int32_t nCurrentColIdx = 0; FX_BOOL bMetWholeRowCell = FALSE; for(CXFA_ContentLayoutItemImpl* pLayoutChild = (CXFA_ContentLayoutItemImpl*)pLayoutRow->m_pFirstChild; pLayoutChild; pLayoutChild = (CXFA_ContentLayoutItemImpl*)pLayoutChild->m_pNextSibling) { - FX_INT32 nOriginalColSpan = pLayoutChild->m_pFormNode->GetInteger(XFA_ATTRIBUTE_ColSpan); - FX_INT32 nColSpan = nOriginalColSpan; + int32_t nOriginalColSpan = pLayoutChild->m_pFormNode->GetInteger(XFA_ATTRIBUTE_ColSpan); + int32_t nColSpan = nOriginalColSpan; FX_FLOAT fColSpanWidth = 0; if(nColSpan == -1 || nCurrentColIdx + nColSpan > rgSpecifiedColumnWidths.GetSize()) { nColSpan = rgSpecifiedColumnWidths.GetSize() - nCurrentColIdx; } - for(FX_INT32 i = 0; i < nColSpan; i ++) { + for(int32_t i = 0; i < nColSpan; i ++) { fColSpanWidth += rgSpecifiedColumnWidths[nCurrentColIdx + i]; } if (nColSpan != nOriginalColSpan) { @@ -1101,9 +1101,9 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) if (pLayoutNode->TryCData(XFA_ATTRIBUTE_ColumnWidths, wsColumnWidths)) { CFX_WideStringArray widths; if (FX_SeparateStringW(wsColumnWidths.GetPtr(), wsColumnWidths.GetLength(), L' ', widths) > 0) { - FX_INT32 iCols = widths.GetSize(); + int32_t iCols = widths.GetSize(); CFX_WideString wsWidth; - for (FX_INT32 i = 0; i < iCols; i++) { + for (int32_t i = 0; i < iCols; i++) { wsWidth = widths[i]; wsWidth.TrimLeft(L' '); if (!wsWidth.IsEmpty()) { @@ -1113,7 +1113,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) } } } - FX_INT32 iSpecifiedColumnCount = m_rgSpecifiedColumnWidths.GetSize(); + int32_t iSpecifiedColumnCount = m_rgSpecifiedColumnWidths.GetSize(); CXFA_LayoutContext layoutContext; layoutContext.m_prgSpecifiedColumnWidths = &m_rgSpecifiedColumnWidths; CXFA_LayoutContext* pLayoutContext = iSpecifiedColumnCount > 0 ? &layoutContext : NULL; @@ -1138,10 +1138,10 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) m_pLayoutItem->AddChild(pProcessor->ExtractLayoutItem()); delete pProcessor; } - FX_INT32 iRowCount = 0, iColCount = 0; + int32_t iRowCount = 0, iColCount = 0; { CFX_ArrayTemplate rgRowItems; - CFX_ArrayTemplate rgRowItemsSpan; + CFX_ArrayTemplate rgRowItemsSpan; CFX_ArrayTemplate rgRowItemsWidth; for(CXFA_ContentLayoutItemImpl* pLayoutChild = (CXFA_ContentLayoutItemImpl*)m_pLayoutItem->m_pFirstChild; pLayoutChild; pLayoutChild = (CXFA_ContentLayoutItemImpl*)pLayoutChild->m_pNextSibling) { if(pLayoutChild->m_pFormNode->GetClassID() != XFA_ELEMENT_Subform) { @@ -1156,7 +1156,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) } if (CXFA_ContentLayoutItemImpl* pRowLayoutCell = (CXFA_ContentLayoutItemImpl*)pLayoutChild->m_pFirstChild) { rgRowItems.Add(pRowLayoutCell); - FX_INT32 iColSpan = pRowLayoutCell->m_pFormNode->GetInteger(XFA_ATTRIBUTE_ColSpan); + int32_t iColSpan = pRowLayoutCell->m_pFormNode->GetInteger(XFA_ATTRIBUTE_ColSpan); rgRowItemsSpan.Add(iColSpan); rgRowItemsWidth.Add(pRowLayoutCell->m_sSize.x); } @@ -1167,7 +1167,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) while(bMoreColumns) { bMoreColumns = FALSE; FX_BOOL bAutoCol = FALSE; - for(FX_INT32 i = 0; i < iRowCount; i ++) { + for(int32_t i = 0; i < iRowCount; i ++) { while(rgRowItems[i] != NULL && (rgRowItemsSpan[i] <= 0 || !XFA_ItemLayoutProcessor_IsTakingSpace(rgRowItems[i]->m_pFormNode))) { CXFA_ContentLayoutItemImpl* pNewCell = (CXFA_ContentLayoutItemImpl*)rgRowItems[i]->m_pNextSibling; if(rgRowItemsSpan[i] < 0 && XFA_ItemLayoutProcessor_IsTakingSpace(rgRowItems[i]->m_pFormNode)) { @@ -1184,7 +1184,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) bMoreColumns = TRUE; if (rgRowItemsSpan[i] == 1) { if (iColCount >= iSpecifiedColumnCount) { - for (FX_INT32 j = 0, c = iColCount + 1 - m_rgSpecifiedColumnWidths.GetSize(); j < c; j ++) { + for (int32_t j = 0, c = iColCount + 1 - m_rgSpecifiedColumnWidths.GetSize(); j < c; j ++) { m_rgSpecifiedColumnWidths.Add(0); } } @@ -1198,7 +1198,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) } if(bMoreColumns) { FX_FLOAT fFinalColumnWidth = m_rgSpecifiedColumnWidths[iColCount]; - for(FX_INT32 i = 0; i < iRowCount; i ++) { + for(int32_t i = 0; i < iRowCount; i ++) { if(!rgRowItems[i]) { continue; } @@ -1257,7 +1257,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) XFA_ItemLayoutProcessor_CalculateContainerComponentSizeFromContentSize(m_pFormNode, bContainerWidthAutoSize, fContentCalculatedWidth, fContainerWidth, bContainerHeightAutoSize, fContentCalculatedHeight, fContainerHeight); SetCurrentComponentSize(fContainerWidth, fContainerHeight); } -static FX_UINT8 XFA_ItemLayoutProcessor_HAlignEnumToInt(XFA_ATTRIBUTEENUM eHAlign) +static uint8_t XFA_ItemLayoutProcessor_HAlignEnumToInt(XFA_ATTRIBUTEENUM eHAlign) { switch(eHAlign) { case XFA_ATTRIBUTEENUM_Center: @@ -1427,7 +1427,7 @@ FX_FLOAT CXFA_ItemLayoutProcessor::InsertKeepLayoutItems() m_pLayoutItem = CreateContentLayoutItem(m_pFormNode); m_pLayoutItem->m_sSize.Set(0, 0); } - for(FX_INT32 iIndex = m_arrayKeepItems.GetSize() - 1; iIndex >= 0 ; iIndex --) { + for(int32_t iIndex = m_arrayKeepItems.GetSize() - 1; iIndex >= 0 ; iIndex --) { XFA_ItemLayoutProcessor_AddLeaderAfterSplit(this, m_arrayKeepItems[iIndex]); fTotalHeight += m_arrayKeepItems[iIndex]->m_sSize.y; } @@ -1449,7 +1449,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::ProcessKeepForSplite(CXFA_ItemLayoutProcessor* CFX_ArrayTemplate keepLayoutItems; if(pParentProcessor->JudgePutNextPage(pParentProcessor->m_pLayoutItem, fChildHeight, keepLayoutItems)) { m_arrayKeepItems.RemoveAll(); - for(FX_INT32 iIndex = 0; iIndex < keepLayoutItems.GetSize(); iIndex++) { + for(int32_t iIndex = 0; iIndex < keepLayoutItems.GetSize(); iIndex++) { CXFA_ContentLayoutItemImpl* pItem = keepLayoutItems.GetAt(iIndex); pParentProcessor->m_pLayoutItem->RemoveChild(pItem); fContentCurRowY -= pItem->m_sSize.y; @@ -1531,12 +1531,12 @@ void CXFA_ItemLayoutProcessor::ProcessUnUseOverFlow(CXFA_Node* pLeaderNode, CXFA } } static XFA_ItemLayoutProcessorResult XFA_ItemLayoutProcessor_InsertFlowedItem(CXFA_ItemLayoutProcessor* pThis, CXFA_ItemLayoutProcessor*& pProcessor, - FX_BOOL bContainerWidthAutoSize, FX_BOOL bContainerHeightAutoSize, FX_FLOAT fContainerHeight, XFA_ATTRIBUTEENUM eFlowStrategy, FX_UINT8& uCurHAlignState, CFX_ArrayTemplate (&rgCurLineLayoutItems)[3], + FX_BOOL bContainerWidthAutoSize, FX_BOOL bContainerHeightAutoSize, FX_FLOAT fContainerHeight, XFA_ATTRIBUTEENUM eFlowStrategy, uint8_t& uCurHAlignState, CFX_ArrayTemplate (&rgCurLineLayoutItems)[3], FX_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, CXFA_LayoutContext* pLayoutContext = NULL, FX_BOOL bNewRow = FALSE) { FX_BOOL bTakeSpace = XFA_ItemLayoutProcessor_IsTakingSpace(pProcessor->m_pFormNode); - FX_UINT8 uHAlign = XFA_ItemLayoutProcessor_HAlignEnumToInt(pThis->m_pCurChildNode->GetEnum(XFA_ATTRIBUTE_HAlign)); + uint8_t uHAlign = XFA_ItemLayoutProcessor_HAlignEnumToInt(pThis->m_pCurChildNode->GetEnum(XFA_ATTRIBUTE_HAlign)); if(bContainerWidthAutoSize) { uHAlign = 0; } @@ -1883,7 +1883,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( FX_FLOAT fContentCurRowAvailWidth = fContentWidthLimit; m_fWidthLimite = fContentCurRowAvailWidth; CFX_ArrayTemplate rgCurLineLayoutItems[3]; - FX_UINT8 uCurHAlignState = (eFlowStrategy != XFA_ATTRIBUTEENUM_Rl_tb ? 0 : 2); + uint8_t uCurHAlignState = (eFlowStrategy != XFA_ATTRIBUTEENUM_Rl_tb ? 0 : 2); if (pLayoutChild) { for (CXFA_ContentLayoutItemImpl* pLayoutNext = pLayoutChild; pLayoutNext; pLayoutNext = (CXFA_ContentLayoutItemImpl*)pLayoutNext->m_pNextSibling) { if (pLayoutNext->m_pNextSibling == NULL && m_pCurChildPreprocessor && m_pCurChildPreprocessor->m_pFormNode == pLayoutNext->m_pFormNode) { @@ -1891,7 +1891,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( m_pCurChildPreprocessor->m_pLayoutItem = pLayoutNext; break; } - FX_UINT8 uHAlign = XFA_ItemLayoutProcessor_HAlignEnumToInt(pLayoutNext->m_pFormNode->GetEnum(XFA_ATTRIBUTE_HAlign)); + uint8_t uHAlign = XFA_ItemLayoutProcessor_HAlignEnumToInt(pLayoutNext->m_pFormNode->GetEnum(XFA_ATTRIBUTE_HAlign)); rgCurLineLayoutItems[uHAlign].Add(pLayoutNext); if (eFlowStrategy == XFA_ATTRIBUTEENUM_Lr_tb) { if (uHAlign > uCurHAlignState) { @@ -1936,7 +1936,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( case XFA_ItemLayoutProcessorStages_None: break; case XFA_ItemLayoutProcessorStages_BreakBefore: { - for(FX_INT32 iIndex = 0; iIndex < m_arrayKeepItems.GetSize(); iIndex++) { + for(int32_t iIndex = 0; iIndex < m_arrayKeepItems.GetSize(); iIndex++) { CXFA_ContentLayoutItemImpl* pItem = m_arrayKeepItems.GetAt(iIndex); m_pLayoutItem->RemoveChild(pItem); fContentCalculatedHeight -= pItem->m_sSize.y; @@ -2152,12 +2152,12 @@ SuspendAndCreateNewRow: FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate(&rgCurLineLayoutItems)[3], XFA_ATTRIBUTEENUM eFlowStrategy, FX_BOOL bContainerHeightAutoSize, FX_BOOL bContainerWidthAutoSize, FX_FLOAT& fContentCalculatedWidth, FX_FLOAT& fContentCalculatedHeight, FX_FLOAT& fContentCurRowY, FX_FLOAT fContentCurRowHeight, FX_FLOAT fContentWidthLimit, FX_BOOL bRootForceTb) { - FX_INT32 nGroupLengths[3] = {0, 0, 0}; + int32_t nGroupLengths[3] = {0, 0, 0}; FX_FLOAT fGroupWidths[3] = {0, 0, 0}; - FX_INT32 nTotalLength = 0; - for(FX_INT32 i = 0; i < 3; i ++) { + int32_t nTotalLength = 0; + for(int32_t i = 0; i < 3; i ++) { nGroupLengths[i] = rgCurLineLayoutItems[i].GetSize(); - for(FX_INT32 c = nGroupLengths[i], j = 0; j < c; j++) { + for(int32_t c = nGroupLengths[i], j = 0; j < c; j++) { nTotalLength++; if(XFA_ItemLayoutProcessor_IsTakingSpace(rgCurLineLayoutItems[i][j]->m_pFormNode)) { fGroupWidths[i] += rgCurLineLayoutItems[i][j]->m_sSize.x; @@ -2179,7 +2179,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate if (eFlowStrategy != XFA_ATTRIBUTEENUM_Rl_tb) { FX_FLOAT fCurPos; fCurPos = 0; - for(FX_INT32 c = nGroupLengths[0], j = 0; j < c; j++) { + for(int32_t c = nGroupLengths[0], j = 0; j < c; j++) { if(bRootForceTb) { FX_FLOAT fAbsoluteX, fAbsoluteY; CalculatePositionedContainerPos(rgCurLineLayoutItems[0][j]->m_pFormNode, rgCurLineLayoutItems[0][j]->m_sSize.x, rgCurLineLayoutItems[0][j]->m_sSize.y, fAbsoluteX, fAbsoluteY); @@ -2194,7 +2194,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate m_fLastRowWidth = fCurPos; } fCurPos = (fContentWidthLimit + fGroupWidths[0] - fGroupWidths[1] - fGroupWidths[2]) / 2; - for(FX_INT32 c = nGroupLengths[1], j = 0; j < c; j++) { + for(int32_t c = nGroupLengths[1], j = 0; j < c; j++) { if(bRootForceTb) { FX_FLOAT fAbsoluteX, fAbsoluteY; CalculatePositionedContainerPos(rgCurLineLayoutItems[1][j]->m_pFormNode, rgCurLineLayoutItems[1][j]->m_sSize.x, rgCurLineLayoutItems[1][j]->m_sSize.y, fAbsoluteX, fAbsoluteY); @@ -2209,7 +2209,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate m_fLastRowWidth = fCurPos; } fCurPos = fContentWidthLimit - fGroupWidths[2]; - for(FX_INT32 c = nGroupLengths[2], j = 0; j < c; j++) { + for(int32_t c = nGroupLengths[2], j = 0; j < c; j++) { if(bRootForceTb) { FX_FLOAT fAbsoluteX, fAbsoluteY; CalculatePositionedContainerPos(rgCurLineLayoutItems[2][j]->m_pFormNode, rgCurLineLayoutItems[2][j]->m_sSize.x, rgCurLineLayoutItems[2][j]->m_sSize.y, fAbsoluteX, fAbsoluteY); @@ -2226,7 +2226,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate } else { FX_FLOAT fCurPos; fCurPos = fGroupWidths[0]; - for(FX_INT32 c = nGroupLengths[0], j = 0; j < c; j++) { + for(int32_t c = nGroupLengths[0], j = 0; j < c; j++) { if(XFA_ItemLayoutProcessor_IsTakingSpace(rgCurLineLayoutItems[0][j]->m_pFormNode)) { fCurPos -= rgCurLineLayoutItems[0][j]->m_sSize.x; } @@ -2235,7 +2235,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate m_fLastRowWidth = fCurPos; } fCurPos = (fContentWidthLimit + fGroupWidths[0] + fGroupWidths[1] - fGroupWidths[2]) / 2; - for(FX_INT32 c = nGroupLengths[1], j = 0; j < c; j++) { + for(int32_t c = nGroupLengths[1], j = 0; j < c; j++) { if(XFA_ItemLayoutProcessor_IsTakingSpace(rgCurLineLayoutItems[1][j]->m_pFormNode)) { fCurPos -= rgCurLineLayoutItems[1][j]->m_sSize.x; } @@ -2244,7 +2244,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(CFX_ArrayTemplate m_fLastRowWidth = fCurPos; } fCurPos = fContentWidthLimit; - for(FX_INT32 c = nGroupLengths[2], j = 0; j < c; j++) { + for(int32_t c = nGroupLengths[2], j = 0; j < c; j++) { if(XFA_ItemLayoutProcessor_IsTakingSpace(rgCurLineLayoutItems[2][j]->m_pFormNode)) { fCurPos -= rgCurLineLayoutItems[2][j]->m_sSize.x; } @@ -2300,7 +2300,7 @@ void CXFA_ItemLayoutProcessor::DoLayoutField() FX_FLOAT fHeight = -1; FX_FLOAT fWidth = -1; pNotify->StartFieldDrawLayout(m_pFormNode, fWidth, fHeight); - FX_INT32 nRotate = FXSYS_round(m_pFormNode->GetMeasure(XFA_ATTRIBUTE_Rotate).GetValue()); + int32_t nRotate = FXSYS_round(m_pFormNode->GetMeasure(XFA_ATTRIBUTE_Rotate).GetValue()); nRotate = XFA_MapRotation(nRotate); if(nRotate == 90 || nRotate == 270) { FX_FLOAT fTmp = fWidth; @@ -2381,14 +2381,14 @@ FX_BOOL CXFA_ItemLayoutProcessor::JudgeLeaderOrTrailerForOccur(CXFA_Node* pFormN pTemplate = pFormNode; } CXFA_Occur NodeOccur = pTemplate->GetFirstChildByClass(XFA_ELEMENT_Occur); - FX_INT32 iMax = NodeOccur.GetMax(); + int32_t iMax = NodeOccur.GetMax(); if (iMax > -1) { - FX_INT32 iCount = (FX_INT32)(FX_UINTPTR)m_PendingNodesCount.GetValueAt(pTemplate); + int32_t iCount = (int32_t)(uintptr_t)m_PendingNodesCount.GetValueAt(pTemplate); if (iCount >= iMax) { return FALSE; } iCount++; - m_PendingNodesCount.SetAt(pTemplate, (FX_LPVOID)(FX_UINTPTR)(iCount)); + m_PendingNodesCount.SetAt(pTemplate, (FX_LPVOID)(uintptr_t)(iCount)); return TRUE; } return TRUE; diff --git a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h index 68bd59910e..27cb5b2c2e 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h +++ b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.h @@ -6,7 +6,7 @@ #ifndef _XFA_LAYOUT_ITEMLAYOUT_H_ #define _XFA_LAYOUT_ITEMLAYOUT_H_ -#define XFA_LAYOUT_INVALIDNODE ((CXFA_Node*)(FX_INTPTR)-1) +#define XFA_LAYOUT_INVALIDNODE ((CXFA_Node*)(intptr_t)-1) #define XFA_LAYOUT_FLOAT_PERCISION (0.0005f) #include "float.h" #define XFA_LAYOUT_FLOAT_MAX FLT_MAX diff --git a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp index bc2d8104fd..d5814b921b 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp +++ b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp @@ -69,7 +69,7 @@ FX_BOOL CXFA_LayoutPageMgr::InitLayoutPage(CXFA_Node* pFormNode) } InitPageSetMap(); CXFA_Node* pPageArea = NULL; - FX_INT32 iCount = 0; + int32_t iCount = 0; for (pPageArea = m_pTemplatePageSetRoot->GetNodeItem(XFA_NODEITEM_FirstChild); pPageArea; pPageArea = pPageArea->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pPageArea->GetClassID() == XFA_ELEMENT_PageArea) { iCount++; @@ -251,11 +251,11 @@ static CXFA_Node* XFA_ResolveBreakTarget(CXFA_Node* pPageSetRoot, FX_BOOL bNewEx CFX_WideString wsTargetAll = wsTargetExpr; wsTargetAll.TrimLeft(); wsTargetAll.TrimRight(); - FX_INT32 iSpliteIndex = 0; + int32_t iSpliteIndex = 0; FX_BOOL bTargetAllFind = TRUE; while(iSpliteIndex != -1) { CFX_WideString wsTargetExpr; - FX_INT32 iSpliteNextIndex = 0; + int32_t iSpliteNextIndex = 0; if(!bTargetAllFind) { iSpliteNextIndex = wsTargetAll.Find(' ', iSpliteIndex); wsTargetExpr = wsTargetAll.Mid(iSpliteIndex, iSpliteNextIndex - iSpliteIndex); @@ -277,7 +277,7 @@ static CXFA_Node* XFA_ResolveBreakTarget(CXFA_Node* pPageSetRoot, FX_BOOL bNewEx wsProcessedTarget = wsTargetExpr.Mid(4, wsTargetExpr.GetLength() - 5); } XFA_RESOLVENODE_RS rs; - FX_INT32 iCount = pDocument->GetScriptContext()->ResolveObjects(pPageSetRoot, wsProcessedTarget, rs, XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent); + int32_t iCount = pDocument->GetScriptContext()->ResolveObjects(pPageSetRoot, wsProcessedTarget, rs, XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent); if(iCount > 0 && rs.nodes[0]->IsNode()) { return (CXFA_Node*)rs.nodes[0]; } @@ -368,7 +368,7 @@ void CXFA_LayoutPageMgr::AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, CXFA_ContainerLayoutItemImpl* pContainerItem = (CXFA_ContainerLayoutItemImpl*)pNotify->OnCreateLayoutItem(pNewPageArea); m_PageArray.Add(pContainerItem); m_nAvailPages++; - pNotify->OnPageEvent((IXFA_LayoutPage*)pContainerItem, XFA_PAGEEVENT_PageAdded, (FX_LPVOID)(FX_UINTPTR)m_nAvailPages); + pNotify->OnPageEvent((IXFA_LayoutPage*)pContainerItem, XFA_PAGEEVENT_PageAdded, (FX_LPVOID)(uintptr_t)m_nAvailPages); pNewPageAreaLayoutItem = pContainerItem; } pNewRecord->pCurPageSet->AddChild(pNewPageAreaLayoutItem); @@ -429,7 +429,7 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() case XFA_ATTRIBUTEENUM_SimplexPaginated: case XFA_ATTRIBUTEENUM_DuplexPaginated: { CXFA_LayoutItemImpl* pLastPageAreaLayoutItem = NULL; - FX_INT32 nPageAreaCount = 0; + int32_t nPageAreaCount = 0; for(CXFA_LayoutItemImpl* pPageAreaLayoutItem = pPageSetLayoutItem->m_pFirstChild; pPageAreaLayoutItem; pPageAreaLayoutItem = pPageAreaLayoutItem->m_pNextSibling) { if(pPageAreaLayoutItem->m_pFormNode->GetClassID() != XFA_ELEMENT_PageArea) { continue; @@ -471,7 +471,7 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() } rgUsedHeights.Add(fUsedHeight); } - FX_INT32 iCurContentAreaIndex = -1; + int32_t iCurContentAreaIndex = -1; for(CXFA_Node* pContentAreaNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); pContentAreaNode; pContentAreaNode = pContentAreaNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if(pContentAreaNode->GetClassID() != XFA_ELEMENT_ContentArea) { continue; @@ -509,18 +509,18 @@ void CXFA_LayoutPageMgr::FinishPaginatedPageSets() } } } -FX_INT32 CXFA_LayoutPageMgr::GetPageCount() const +int32_t CXFA_LayoutPageMgr::GetPageCount() const { return m_PageArray.GetSize(); } -IXFA_LayoutPage* CXFA_LayoutPageMgr::GetPage(FX_INT32 index) const +IXFA_LayoutPage* CXFA_LayoutPageMgr::GetPage(int32_t index) const { if (m_PageArray.GetSize() > index) { return (IXFA_LayoutPage*)m_PageArray[index]; } return NULL; } -FX_INT32 CXFA_LayoutPageMgr::GetPageIndex(IXFA_LayoutPage* pPage) const +int32_t CXFA_LayoutPageMgr::GetPageIndex(IXFA_LayoutPage* pPage) const { return m_PageArray.Find((CXFA_ContainerLayoutItemImpl*)pPage); } @@ -807,7 +807,7 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet(CXFA_Node* pPageSet, CXFA_No if(pPageSet == NULL && pStartChild == NULL) { return FALSE; } - FX_INT32 iPageSetCount = 0; + int32_t iPageSetCount = 0; if(IsPageSetRootOrderedOccurrence()) { return FindPageAreaFromPageSet_Ordered(pPageSet, pStartChild, pTargetPageArea, pTargetContentArea, bNewPage, bQuery); } @@ -816,10 +816,10 @@ FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet(CXFA_Node* pPageSet, CXFA_No } FX_BOOL CXFA_LayoutPageMgr::FindPageAreaFromPageSet_Ordered(CXFA_Node* pPageSet, CXFA_Node* pStartChild, CXFA_Node* pTargetPageArea, CXFA_Node* pTargetContentArea, FX_BOOL bNewPage, FX_BOOL bQuery) { - FX_INT32 iPageSetCount = 0; + int32_t iPageSetCount = 0; if(!pStartChild && !bQuery) { m_pPageSetMap.Lookup(pPageSet, iPageSetCount); - FX_INT32 iMax = -1; + int32_t iMax = -1; CXFA_Node* pOccurNode = pPageSet->GetFirstChildByClass(XFA_ELEMENT_Occur); if(pOccurNode) { pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE); @@ -965,7 +965,7 @@ FX_BOOL CXFA_LayoutPageMgr::MatchPageAreaOddOrEven(CXFA_Node* pPageArea, FX_BOOL XFA_ATTRIBUTEENUM eOddOrEven = XFA_ATTRIBUTEENUM_Any; pPageArea->TryEnum(XFA_ATTRIBUTE_OddOrEven, eOddOrEven); if (eOddOrEven != XFA_ATTRIBUTEENUM_Any) { - FX_INT32 iPageCount = GetPageCount(); + int32_t iPageCount = GetPageCount(); if (bLastMatch) { return eOddOrEven == XFA_ATTRIBUTEENUM_Odd ? iPageCount % 2 == 1 : iPageCount % 2 == 0; } @@ -985,7 +985,7 @@ CXFA_Node* CXFA_LayoutPageMgr::GetNextAvailPageArea(CXFA_Node* pTargetPageArea, return m_pCurPageArea; } if(IsPageSetRootOrderedOccurrence()) { - FX_INT32 iMax = -1; + int32_t iMax = -1; CXFA_Node* pOccurNode = m_pCurPageArea->GetFirstChildByClass(XFA_ELEMENT_Occur); if(pOccurNode) { pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE); @@ -1086,19 +1086,19 @@ void CXFA_LayoutPageMgr::InitPageSetMap() } } } -FX_INT32 CXFA_LayoutPageMgr::CreateMinPageRecord(CXFA_Node* pPageArea, FX_BOOL bTargetPageArea, FX_BOOL bCreateLast) +int32_t CXFA_LayoutPageMgr::CreateMinPageRecord(CXFA_Node* pPageArea, FX_BOOL bTargetPageArea, FX_BOOL bCreateLast) { if(pPageArea == NULL) { return 0; } CXFA_Node* pOccurNode = pPageArea->GetFirstChildByClass(XFA_ELEMENT_Occur); - FX_INT32 iMin = 0; + int32_t iMin = 0; if((pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, FALSE)) || bTargetPageArea) { CXFA_Node* pContentArea = pPageArea->GetFirstChildByClass(XFA_ELEMENT_ContentArea); if (iMin < 1 && bTargetPageArea && !pContentArea) { iMin = 1; } - FX_INT32 i = 0; + int32_t i = 0; if(bCreateLast) { i = m_nCurPageCount; } @@ -1115,7 +1115,7 @@ void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet, FX_BOOL bCr if(pPageSet == NULL) { return; } - FX_INT32 iCurSetCount = 0; + int32_t iCurSetCount = 0; if(!m_pPageSetMap.Lookup(pPageSet, iCurSetCount)) { return; } @@ -1123,10 +1123,10 @@ void CXFA_LayoutPageMgr::CreateMinPageSetRecord(CXFA_Node* pPageSet, FX_BOOL bCr iCurSetCount = 0; } CXFA_Node* pOccurNode = pPageSet->GetFirstChildByClass(XFA_ELEMENT_Occur); - FX_INT32 iMin = 0; + int32_t iMin = 0; if(pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, FALSE)) { if(iCurSetCount < iMin) { - for(FX_INT32 i = 0; i < iMin - iCurSetCount; i++) { + for(int32_t i = 0; i < iMin - iCurSetCount; i++) { for(CXFA_Node *pCurrentPageNode = pPageSet->GetNodeItem(XFA_NODEITEM_FirstChild); pCurrentPageNode; pCurrentPageNode = pCurrentPageNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if(pCurrentPageNode->GetClassID() == XFA_ELEMENT_PageArea) { CreateMinPageRecord(pCurrentPageNode, FALSE); @@ -1179,11 +1179,11 @@ FX_BOOL CXFA_LayoutPageMgr::GetNextAvailContentHeight(FX_FLOAT fChildHeight) } CXFA_Node* pPageNode = GetCurrentContainerRecord()->pCurPageArea->m_pFormNode; CXFA_Node* pOccurNode = pPageNode->GetFirstChildByClass(XFA_ELEMENT_Occur); - FX_INT32 iMax = 0; + int32_t iMax = 0; if(pOccurNode && pOccurNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, FALSE)) { if(m_nCurPageCount == iMax) { CXFA_Node* pSrcPage = m_pCurPageArea; - FX_INT32 nSrcPageCount = m_nCurPageCount; + int32_t nSrcPageCount = m_nCurPageCount; FX_POSITION psSrcRecord = m_rgProposedContainerRecord.GetTailPosition(); CXFA_Node* pNextPage = GetNextAvailPageArea(NULL, NULL, FALSE, TRUE); m_pCurPageArea = pSrcPage; @@ -1367,7 +1367,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() IXFA_DocLayout* pDocLayout = pDocument->GetDocLayout(); CXFA_ContainerLayoutItemImpl* pRootLayout = this->GetRootLayoutItem(); { - for(FX_INT32 iIndex = 0; iIndex < pDocument->m_pPendingPageSet.GetSize(); iIndex ++) { + for(int32_t iIndex = 0; iIndex < pDocument->m_pPendingPageSet.GetSize(); iIndex ++) { CXFA_NodeIteratorTemplate sIterator(pDocument->m_pPendingPageSet.GetAt(iIndex)); for(CXFA_Node *pNode = sIterator.GetCurrent(); pNode; pNode = sIterator.MoveToNext()) { if(pNode->IsContainerNode()) { @@ -1381,7 +1381,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() } } } - FX_INT32 iIndex = 0; + int32_t iIndex = 0; CXFA_Node* pPendingPageSet = NULL; for(; pRootLayout; pRootLayout = (CXFA_ContainerLayoutItemImpl* )pRootLayout->m_pNextSibling) { pPendingPageSet = NULL; @@ -1419,7 +1419,7 @@ void CXFA_LayoutPageMgr::MergePageSetContents() CXFA_ContainerLayoutItemImpl* pFormLayout = pContainerItem; CXFA_Node* pParentNode = pContainerItem->m_pParent->m_pFormNode; FX_BOOL bIsExistForm = TRUE; - for(FX_INT32 iLevel = 0; iLevel < 3; iLevel ++) { + for(int32_t iLevel = 0; iLevel < 3; iLevel ++) { pFormLayout = (CXFA_ContainerLayoutItemImpl*)pFormLayout->m_pFirstChild; if(iLevel == 2) { while(pFormLayout && !XFA_ItemLayoutProcessor_IsTakingSpace(pFormLayout->m_pFormNode)) { @@ -1535,7 +1535,7 @@ void CXFA_LayoutPageMgr::LayoutPageSetContents() } } } -void XFA_SyncContainer(IXFA_Notify* pNotify, IXFA_DocLayout* pDocLayout, CXFA_LayoutItemImpl* pContainerItem, FX_DWORD dwRelevant, FX_BOOL bVisible, FX_INT32 nPageIndex) +void XFA_SyncContainer(IXFA_Notify* pNotify, IXFA_DocLayout* pDocLayout, CXFA_LayoutItemImpl* pContainerItem, FX_DWORD dwRelevant, FX_BOOL bVisible, int32_t nPageIndex) { FX_BOOL bVisibleItem = FALSE; FX_DWORD dwStatus = 0; @@ -1548,7 +1548,7 @@ void XFA_SyncContainer(IXFA_Notify* pNotify, IXFA_DocLayout* pDocLayout, CXFA_La dwRelevantContainer = XFA_GetRelevant(pContainerItem->m_pFormNode, dwRelevant); dwStatus = (bVisibleItem ? XFA_LAYOUTSTATUS_Visible : 0) | dwRelevantContainer; } - pNotify->OnLayoutEvent(pDocLayout, (CXFA_LayoutItem*)pContainerItem, XFA_LAYOUTEVENT_ItemAdded, (FX_LPVOID)(FX_UINTPTR)nPageIndex, (FX_LPVOID)(FX_UINTPTR)dwStatus); + pNotify->OnLayoutEvent(pDocLayout, (CXFA_LayoutItem*)pContainerItem, XFA_LAYOUTEVENT_ItemAdded, (FX_LPVOID)(uintptr_t)nPageIndex, (FX_LPVOID)(uintptr_t)dwStatus); CXFA_LayoutItemImpl *pChild = pContainerItem->m_pFirstChild; while (pChild) { if (!pChild->IsContentLayoutItem()) { @@ -1564,7 +1564,7 @@ void CXFA_LayoutPageMgr::SyncLayoutData() MergePageSetContents(); LayoutPageSetContents(); IXFA_Notify* pNotify = m_pTemplatePageSetRoot->GetDocument()->GetParser()->GetNotify(); - FX_INT32 nPageIdx = -1; + int32_t nPageIdx = -1; CXFA_ContainerLayoutItemImpl* pRootLayoutItem = this->GetRootLayoutItem(); for(; pRootLayoutItem; pRootLayoutItem = (CXFA_ContainerLayoutItemImpl*)pRootLayoutItem->m_pNextSibling) { CXFA_NodeIteratorTemplate iteratorParent(pRootLayoutItem); @@ -1592,8 +1592,8 @@ void CXFA_LayoutPageMgr::SyncLayoutData() } } } - FX_INT32 nPage = m_PageArray.GetSize(); - for (FX_INT32 i = nPage - 1; i >= m_nAvailPages; i--) { + int32_t nPage = m_PageArray.GetSize(); + for (int32_t i = nPage - 1; i >= m_nAvailPages; i--) { CXFA_ContainerLayoutItemImpl* pPage = m_PageArray[i]; m_PageArray.RemoveAt(i); pNotify->OnPageEvent((IXFA_LayoutPage*)pPage, XFA_PAGEEVENT_PageRemoved); diff --git a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h index 4faf9e30db..bf82a35323 100644 --- a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h +++ b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.h @@ -29,9 +29,9 @@ public: void SubmitContentItem(CXFA_ContentLayoutItemImpl* pContentLayoutItem, XFA_ItemLayoutProcessorResult eStatus); void FinishPaginatedPageSets(); void SyncLayoutData(); - FX_INT32 GetPageCount() const; - IXFA_LayoutPage* GetPage(FX_INT32 index) const; - FX_INT32 GetPageIndex(IXFA_LayoutPage* pPage) const; + int32_t GetPageCount() const; + IXFA_LayoutPage* GetPage(int32_t index) const; + int32_t GetPageIndex(IXFA_LayoutPage* pPage) const; inline CXFA_ContainerLayoutItemImpl* GetRootLayoutItem() const { return m_pPageSetLayoutItemRoot; @@ -59,7 +59,7 @@ protected: 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); - FX_INT32 CreateMinPageRecord(CXFA_Node* pPageArea, FX_BOOL bTargetPageArea, FX_BOOL bCreateLast = FALSE); + int32_t CreateMinPageRecord(CXFA_Node* pPageArea, FX_BOOL bTargetPageArea, FX_BOOL bCreateLast = FALSE); void CreateMinPageSetRecord(CXFA_Node* pPageSet, FX_BOOL bCreateAll = FALSE); void CreateNextMinRecord(CXFA_Node* pRecordNode); FX_BOOL FindPageAreaFromPageSet(CXFA_Node* pPageSet, CXFA_Node* pStartChild, CXFA_Node* pTargetPageArea = NULL, CXFA_Node* pTargetContentArea = NULL, FX_BOOL bNewPage = FALSE, FX_BOOL bQuery = FALSE); @@ -86,11 +86,11 @@ protected: FX_POSITION m_pCurrentContainerRecord; CFX_PtrList m_rgProposedContainerRecord; CXFA_Node* m_pCurPageArea; - FX_INT32 m_nAvailPages; - FX_INT32 m_nCurPageCount; + int32_t m_nAvailPages; + int32_t m_nCurPageCount; XFA_ATTRIBUTEENUM m_ePageSetMode; FX_BOOL m_bCreateOverFlowPage; - CFX_MapPtrTemplate m_pPageSetMap; + CFX_MapPtrTemplate m_pPageSetMap; #ifdef _XFA_LAYOUTITEM_MAPCACHE_ void SaveLayoutItem(CXFA_LayoutItemImpl* pParentLayoutItem); CFX_MapPtrToPtr m_NodeToContent; diff --git a/xfa/src/fxfa/src/parser/xfa_locale.cpp b/xfa/src/fxfa/src/parser/xfa_locale.cpp index 52a1b4c265..83c61d1a72 100644 --- a/xfa/src/fxfa/src/parser/xfa_locale.cpp +++ b/xfa/src/fxfa/src/parser/xfa_locale.cpp @@ -93,11 +93,11 @@ void CXFA_XMLLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const } wsDtSymbol = pNumberSymbols->GetContent(0); } -void CXFA_XMLLocale::GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const +void CXFA_XMLLocale::GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const { wsMonthName = GetCalendarSymbol(FX_BSTRC("month"), nMonth, bAbbr); } -void CXFA_XMLLocale::GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const +void CXFA_XMLLocale::GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const { wsDayName = GetCalendarSymbol(FX_BSTRC("day"), nWeek, bAbbr); } @@ -208,8 +208,8 @@ void CXFA_XMLLocale::GetNumPattern(FX_LOCALENUMSUBCATEGORY eType, CFX_WideString } void CXFA_XMLLocale::GetPattern(CXML_Element* pElement, FX_BSTR bsTag, FX_WSTR wsName, CFX_WideString& wsPattern) const { - FX_INT32 iCount = pElement->CountElements(FX_BSTRC(""), bsTag); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = pElement->CountElements(FX_BSTRC(""), bsTag); + for (int32_t i = 0; i < iCount; i++) { CXML_Element* pChild = pElement->GetElement(FX_BSTRC(""), bsTag, i); if (pChild->GetAttrValue(FX_BSTRC("name")) == wsName) { wsPattern = pChild->GetContent(0); @@ -263,11 +263,11 @@ void CXFA_NodeLocale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const CXFA_Node *pSymbols = m_pLocale ? m_pLocale->GetChild(0, XFA_ELEMENT_DateTimeSymbols) : NULL; wsDtSymbol = pSymbols ? pSymbols->GetContent() : CFX_WideString(); } -void CXFA_NodeLocale::GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const +void CXFA_NodeLocale::GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const { wsMonthName = GetCalendarSymbol(XFA_ELEMENT_MonthNames, nMonth, bAbbr); } -void CXFA_NodeLocale::GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const +void CXFA_NodeLocale::GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const { wsDayName = GetCalendarSymbol(XFA_ELEMENT_DayNames, nWeek, bAbbr); } diff --git a/xfa/src/fxfa/src/parser/xfa_locale.h b/xfa/src/fxfa/src/parser/xfa_locale.h index ccea088741..2df6201c56 100644 --- a/xfa/src/fxfa/src/parser/xfa_locale.h +++ b/xfa/src/fxfa/src/parser/xfa_locale.h @@ -15,8 +15,8 @@ public: virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString& wsNumSymbol) const; virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const; - virtual void GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const; - virtual void GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const; + virtual void GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const; + virtual void GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const; virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM = TRUE) const; virtual void GetTimeZone(FX_TIMEZONE& tz) const; virtual void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const; @@ -41,8 +41,8 @@ public: virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString& wsNumSymbol) const; virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const; - virtual void GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const; - virtual void GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const; + virtual void GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const; + virtual void GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const; virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM = TRUE) const; virtual void GetTimeZone(FX_TIMEZONE& tz) const; virtual void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const; diff --git a/xfa/src/fxfa/src/parser/xfa_localemgr.cpp b/xfa/src/fxfa/src/parser/xfa_localemgr.cpp index 8c56c95dc9..cc136ae2ac 100644 --- a/xfa/src/fxfa/src/parser/xfa_localemgr.cpp +++ b/xfa/src/fxfa/src/parser/xfa_localemgr.cpp @@ -17,7 +17,7 @@ #include "../common/xfa_fm2jsapi.h" #include "xfa_debug_parser.h" #include "xfa_locale.h" -const FX_BYTE g_enUS_Locale[] = { +const uint8_t g_enUS_Locale[] = { 0x78, 0x9C, 0x95, 0x56, 0xD1, 0x6E, 0x9B, 0x30, 0x14, 0x7D, 0x9F, 0xB4, 0x7F, 0x40, 0xD6, 0x2A, 0xB5, 0x52, 0x56, 0x6F, 0x8F, 0xA9, 0x88, 0xA5, 0x6C, 0x24, 0x9B, 0x3A, 0xD1, 0x55, 0x22, 0x55, 0xB5, 0xBE, 0x4C, 0x0E, 0xDC, 0x05, 0x34, 0xB0, 0x23, 0x83, 0x37, 0x05, 0xED, 0xE3, 0x67, 0x07, 0xC3, 0xC0, 0xF6, 0x24, 0xC2, 0x4B, 0x7C, 0xCF, 0x3D, 0xE7, 0xE6, 0xDE, @@ -51,7 +51,7 @@ const FX_BYTE g_enUS_Locale[] = { 0x20, 0xF2, 0x94, 0x44, 0xB3, 0x45, 0x63, 0xCB, 0x5D, 0x09, 0xB6, 0x7B, 0xD5, 0x58, 0xF7, 0x55, 0xA4, 0x96, 0x7F, 0x01, 0x75, 0x37, 0x1B, 0x8B, }; -const FX_BYTE g_enGB_Locale[] = { +const uint8_t g_enGB_Locale[] = { 0x78, 0x9C, 0x95, 0x56, 0xD1, 0x6E, 0xD3, 0x30, 0x14, 0x7D, 0x47, 0xE2, 0x1F, 0xA2, 0x88, 0x49, 0x20, 0x6D, 0x33, 0x3C, 0x6E, 0xEA, 0x2C, 0x75, 0xEB, 0xD6, 0x32, 0xC8, 0xA8, 0x48, 0xC5, 0xC4, 0x5E, 0x90, 0x9B, 0x78, 0x8D, 0x59, 0x62, 0x57, 0x4E, 0xCC, 0x94, 0xFC, 0x02, 0x9F, 0xC0, 0x23, 0xCF, 0x08, 0xF1, 0x01, 0xBC, 0xF0, 0x2F, 0x48, 0xFB, 0x0C, 0x6E, 0x1A, @@ -91,7 +91,7 @@ const FX_BYTE g_enGB_Locale[] = { 0xF7, 0x5B, 0x7E, 0x14, 0x98, 0xAB, 0x72, 0x32, 0xE7, 0xED, 0x16, 0x92, 0x2F, 0x06, 0x90, 0xBC, 0x5C, 0xF1, 0xD5, 0x67, 0xB1, 0xE1, 0xE9, 0xE6, 0xD0, 0xFD, 0x9E, 0x95, 0x51, 0xF5, 0x19, 0x0B, 0xCB, 0x7F, 0x8E, 0x69, 0xAC, 0xD0 }; -const FX_BYTE g_zhCN_Locale[] = { +const uint8_t g_zhCN_Locale[] = { 0x78, 0x9C, 0xED, 0x56, 0x41, 0x4F, 0xD4, 0x40, 0x14, 0xBE, 0x9B, 0xF8, 0x1F, 0x9A, 0x46, 0x52, 0x4D, 0x58, 0x46, 0x8F, 0x90, 0xD2, 0x64, 0x03, 0x08, 0x06, 0xBB, 0x21, 0x96, 0x68, 0xE0, 0x62, 0xBA, 0xED, 0xB0, 0x2D, 0x6C, 0x3B, 0x64, 0xB6, 0x0D, 0x6E, 0x4F, 0x18, 0x82, 0x82, 0xC2, 0x45, 0x89, 0x9A, 0x80, 0xE1, 0x64, 0x3C, 0x28, 0x9E, 0x8C, 0x01, 0x22, 0xF1, @@ -133,7 +133,7 @@ const FX_BYTE g_zhCN_Locale[] = { 0x43, 0x12, 0xEA, 0x93, 0x21, 0x9B, 0x02, 0x73, 0xD8, 0x68, 0x39, 0xA9, 0x1D, 0xFA, 0x8D, 0x55, 0xD2, 0xE3, 0xF1, 0x7D, 0xD1, 0xCD, 0x33, 0x63, 0x51, 0xFC, 0x15, 0x0D, 0xCB, 0xBF, 0xC0, 0xE4, 0x3D, 0x40 }; -const FX_BYTE g_zhTW_Locale[] = { +const uint8_t g_zhTW_Locale[] = { 0x78, 0x9C, 0xED, 0x57, 0xCD, 0x4F, 0xD4, 0x40, 0x14, 0x3F, 0x63, 0xE2, 0xFF, 0x30, 0x69, 0x20, 0xD5, 0x04, 0xA8, 0x1E, 0x21, 0xA5, 0xC9, 0xC6, 0x45, 0x30, 0x58, 0x42, 0xEC, 0x46, 0x22, 0x17, 0x33, 0xDB, 0x0E, 0xDB, 0xC2, 0xB6, 0x43, 0x66, 0xDB, 0xC0, 0xF6, 0x24, 0x12, 0x14, 0x14, 0x62, 0xA2, 0xC4, 0x8F, 0x80, 0xE1, 0x64, 0x3C, 0x28, 0x89, 0x07, 0x0F, 0x2C, @@ -176,7 +176,7 @@ const FX_BYTE g_zhTW_Locale[] = { 0xF0, 0x6A, 0x0D, 0x5F, 0x21, 0x77, 0xF4, 0x2A, 0x6D, 0xCF, 0x69, 0xAC, 0xE0, 0x00, 0x19, 0xDE, 0x1E, 0x2C, 0xB6, 0xD4, 0x7B, 0xCA, 0x52, 0xF8, 0x67, 0x41, 0xF9, 0x03, 0x11, 0xC2, 0x4A, 0xC9 }; -const FX_BYTE g_zhHK_Locale[] = { +const uint8_t g_zhHK_Locale[] = { 0x78, 0x9C, 0xA5, 0x57, 0x4D, 0x4F, 0x13, 0x41, 0x18, 0x3E, 0x63, 0xE2, 0x7F, 0x98, 0x6C, 0x20, 0x0B, 0x09, 0x50, 0x8A, 0x9F, 0x25, 0xCB, 0x26, 0x44, 0x90, 0x9A, 0x5A, 0x43, 0x2C, 0xD1, 0xC8, 0xC5, 0x6C, 0x77, 0x87, 0xEE, 0x42, 0x77, 0x87, 0x4C, 0xB7, 0xC1, 0x6E, 0x3C, 0x88, 0x04, 0xA5, 0x5A, 0x2E, 0x4A, 0x54, 0x02, 0x86, 0x78, 0x50, 0x0F, 0x48, 0xBC, 0x78, @@ -222,7 +222,7 @@ const FX_BYTE g_zhHK_Locale[] = { 0x52, 0xAB, 0x1A, 0xA5, 0x15, 0x64, 0x33, 0x9D, 0xDD, 0xED, 0x47, 0x2E, 0x70, 0x9E, 0x42, 0xCA, 0xF9, 0x27, 0x42, 0xFC, 0x0B, 0xD9, 0x0E, 0x4B, 0xED }; -const FX_BYTE g_jaJP_Locale[] = { +const uint8_t g_jaJP_Locale[] = { 0x78, 0x9C, 0xED, 0x56, 0xCB, 0x6E, 0xD3, 0x40, 0x14, 0x5D, 0x17, 0x89, 0x7F, 0x18, 0x59, 0x20, 0x83, 0xD4, 0xD6, 0x0D, 0xEF, 0x56, 0xAE, 0xA5, 0x8A, 0x96, 0x86, 0x16, 0xA3, 0x08, 0x57, 0xA0, 0x76, 0x83, 0x26, 0xF6, 0x34, 0x99, 0x36, 0x9E, 0xA9, 0x26, 0xB6, 0x4A, 0xBC, 0xE2, 0x21, 0x20, 0x48, 0x74, 0x01, 0x1B, 0x04, 0x44, 0x62, 0x55, 0x40, 0x02, 0x04, 0x8B, @@ -264,7 +264,7 @@ const FX_BYTE g_jaJP_Locale[] = { 0xC6, 0xD2, 0x0C, 0x5A, 0x8A, 0xA6, 0x77, 0x5C, 0xD2, 0xD8, 0xA2, 0x3E, 0x33, 0x18, 0x89, 0x7F, 0xAA, 0x25, 0xE6, 0xA9, 0x2A, 0xC1, 0x87, 0xBD, 0xF6, 0x17, 0x6C, 0x42, 0x08, 0x21 }; -const FX_BYTE g_koKR_Locale[] = { +const uint8_t g_koKR_Locale[] = { 0x78, 0x9C, 0xED, 0x56, 0x4D, 0x6B, 0xD4, 0x40, 0x18, 0x3E, 0x57, 0xF0, 0x3F, 0x0C, 0xC1, 0x12, 0x85, 0x76, 0xB7, 0xEB, 0x77, 0x4B, 0x1A, 0x28, 0x6E, 0x6D, 0x65, 0x8D, 0x94, 0xA6, 0x58, 0xEC, 0x45, 0x66, 0x93, 0xE9, 0x26, 0xED, 0x26, 0x53, 0x26, 0x09, 0x75, 0x73, 0xAE, 0x52, 0xF0, 0xE2, 0xA1, 0x87, 0xEA, 0x6E, 0xB1, 0x07, 0x11, 0x2A, 0x88, 0x22, 0x22, 0x1E, @@ -307,7 +307,7 @@ const FX_BYTE g_koKR_Locale[] = { 0x3E, 0x9A, 0x72, 0x3B, 0x81, 0xDD, 0xF7, 0x47, 0xD2, 0x64, 0x9C, 0xA1, 0x05, 0x53, 0x2D, 0x75, 0x9E, 0x42, 0x3D, 0xFC, 0xFC, 0x17, 0xFF, 0x01, 0xDC, 0xF1, 0x18, 0xD3 }; -const FX_BYTE g_esES_Locale[] = { +const uint8_t g_esES_Locale[] = { 0x78, 0x9C, 0x9D, 0x56, 0xCF, 0x6B, 0xD4, 0x40, 0x14, 0xBE, 0x0B, 0xFE, 0x0F, 0x21, 0x58, 0x56, 0xA1, 0xDD, 0xD1, 0x63, 0xCB, 0x36, 0x50, 0xDA, 0xDA, 0x95, 0x1A, 0x59, 0x9A, 0xAA, 0xD8, 0x8B, 0x4C, 0x92, 0xE9, 0xEE, 0xB4, 0xC9, 0xCC, 0x32, 0x49, 0x2C, 0x9B, 0xA3, 0xE0, 0x41, 0x10, 0x0B, 0xDE, 0x8A, 0x27, 0x0F, 0x1E, 0x04, 0x8B, 0x77, 0x51, 0x3C, 0xF4, 0x3F, @@ -350,7 +350,7 @@ const FX_BYTE g_esES_Locale[] = { 0x43, 0x39, 0x99, 0xF1, 0x70, 0x01, 0xC9, 0xE1, 0x2D, 0x48, 0xF6, 0x24, 0x61, 0xC3, 0x23, 0x3E, 0xE5, 0xA9, 0xE6, 0xD0, 0x6C, 0xCF, 0x64, 0x94, 0xFD, 0xFC, 0xC2, 0xF2, 0x2F, 0x7C, 0xDC, 0xCC, 0x2F, }; -const FX_BYTE g_esLA_Locale[] = { +const uint8_t g_esLA_Locale[] = { 0x78, 0x9C, 0x9D, 0x56, 0xCD, 0x4E, 0xDC, 0x30, 0x10, 0x3E, 0x53, 0xA9, 0xEF, 0x60, 0x45, 0x45, 0x80, 0x04, 0x9B, 0xF6, 0xB8, 0x28, 0x44, 0x5A, 0x01, 0xA5, 0x15, 0x0D, 0x5A, 0x75, 0x51, 0x4B, 0xB9, 0x54, 0x4E, 0x62, 0x36, 0x86, 0xC4, 0x5E, 0x39, 0x09, 0x68, 0xA3, 0xBE, 0x40, 0x4F, 0x3D, 0xF4, 0xD4, 0x63, 0x2B, 0x21, 0xB5, 0x07, 0xD4, 0x47, 0xE8, 0x81, 0x67, @@ -393,7 +393,7 @@ const FX_BYTE g_esLA_Locale[] = { 0xD6, 0x3C, 0x66, 0xD3, 0x73, 0x9E, 0x31, 0xF3, 0x22, 0xB3, 0x11, 0x57, 0x3B, 0x4F, 0x43, 0xCF, 0x3F, 0xEF, 0xCD, 0xBF, 0xC4, 0xB5, 0xD4, 0x04 }; -const FX_BYTE g_deDE_Loacale[] = { +const uint8_t g_deDE_Loacale[] = { 0x78, 0x9C, 0x95, 0x56, 0x4D, 0x6F, 0xD4, 0x30, 0x10, 0xBD, 0x23, 0xF1, 0x1F, 0xAC, 0x88, 0xAA, 0x20, 0xB5, 0x1B, 0x38, 0xB6, 0xDA, 0x46, 0x5A, 0x75, 0xFB, 0x41, 0x4B, 0xCA, 0xAA, 0x69, 0x41, 0xF4, 0x82, 0xBC, 0x89, 0xBB, 0x71, 0x9B, 0xD8, 0x2B, 0xC7, 0x69, 0xB5, 0x39, 0xF2, 0x37, 0xB8, 0x72, 0x04, 0x71, 0xE4, 0x04, 0x17, 0xFE, 0x09, 0x52, 0x25, 0x7E, 0x06, @@ -434,7 +434,7 @@ const FX_BYTE g_deDE_Loacale[] = { 0x0A, 0xCC, 0x59, 0x39, 0x19, 0x7A, 0xB3, 0x82, 0x04, 0x6F, 0xFA, 0xC7, 0x49, 0xFE, 0x22, 0x67, 0xB3, 0x2B, 0xBE, 0xE4, 0xA9, 0xE6, 0xDC, 0xFB, 0x3D, 0x2B, 0xA3, 0xEA, 0x73, 0x16, 0x96, 0xFF, 0x00, 0x29, 0x27, 0xAF, 0x17, }; -const FX_BYTE g_frFR_Locale[] = { +const uint8_t g_frFR_Locale[] = { 0x78, 0x9C, 0x95, 0x56, 0x4D, 0x6F, 0xD3, 0x40, 0x10, 0xBD, 0x23, 0xF1, 0x1F, 0x56, 0x16, 0x55, 0x41, 0x6A, 0xBD, 0x70, 0x4C, 0x95, 0x5A, 0xAA, 0xFA, 0x15, 0x28, 0x46, 0x51, 0x53, 0x40, 0xF4, 0x82, 0x36, 0xF6, 0x36, 0xDE, 0xD4, 0xDE, 0x8D, 0xD6, 0x76, 0x4A, 0x7C, 0xE4, 0x3F, 0x70, 0xE2, 0xC2, 0xB5, 0x12, 0x88, 0x03, 0x47, 0xC4, 0x85, 0xFE, 0x13, 0x24, 0x10, @@ -476,7 +476,7 @@ const FX_BYTE g_frFR_Locale[] = { 0x7A, 0xBE, 0x86, 0x34, 0x12, 0x1D, 0x48, 0xEE, 0x22, 0xE5, 0x93, 0xA9, 0x58, 0xF2, 0x54, 0x73, 0xF8, 0x76, 0xCF, 0xF2, 0xA8, 0xF8, 0xD2, 0x85, 0xE5, 0x3F, 0x5D, 0x49, 0xBE, 0x1B }; -const FX_BYTE g_itIT_Locale[] = { +const uint8_t g_itIT_Locale[] = { 0x78, 0x9C, 0x95, 0x56, 0xD1, 0x6A, 0xD4, 0x40, 0x14, 0x7D, 0x17, 0xFC, 0x87, 0x21, 0x58, 0x50, 0x68, 0x3B, 0xFA, 0xD8, 0x92, 0x06, 0x4A, 0x5B, 0xBB, 0xA5, 0x46, 0x96, 0xEE, 0xAA, 0xD8, 0x17, 0x99, 0x64, 0xA6, 0xD9, 0xB1, 0xC9, 0xCC, 0x32, 0x49, 0x5A, 0x92, 0x47, 0xF1, 0xC1, 0x37, 0x7F, 0x42, 0x10, 0x41, 0xF1, 0x23, 0xFC, 0x13, 0xA1, 0xE2, 0x67, 0x78, 0xB3, @@ -517,7 +517,7 @@ const FX_BYTE g_itIT_Locale[] = { 0x53, 0x60, 0x46, 0xD5, 0x64, 0xE8, 0xC5, 0x1A, 0xD2, 0x4C, 0x8E, 0x20, 0xF9, 0x45, 0x2E, 0xA2, 0xF7, 0x72, 0xC5, 0xD3, 0xCD, 0xE1, 0xDB, 0x3D, 0xAB, 0xA2, 0xFA, 0xD3, 0x16, 0x96, 0xFF, 0x00, 0x20, 0x8B, 0xBE, 0xF7 }; -const FX_BYTE g_ptBR_Locale[] = { +const uint8_t g_ptBR_Locale[] = { 0x78, 0x9C, 0x9D, 0x56, 0x3D, 0x6F, 0xD4, 0x40, 0x10, 0xAD, 0x83, 0xC4, 0x7F, 0x58, 0x59, 0x89, 0x0E, 0xA4, 0x24, 0x86, 0x92, 0xC8, 0x67, 0xE9, 0x92, 0x0B, 0x39, 0x94, 0x18, 0x9D, 0xCE, 0x11, 0x88, 0x34, 0x68, 0x6D, 0xEF, 0xD9, 0x9B, 0xD8, 0xBB, 0xC7, 0xDA, 0x4E, 0xB0, 0x6B, 0x1A, 0x3A, 0x28, 0x29, 0x53, 0x20, 0x2A, 0x44, 0x83, 0x44, 0x49, 0x91, 0xDF, 0x82, @@ -560,7 +560,7 @@ const FX_BYTE g_ptBR_Locale[] = { 0xD6, 0x4E, 0xAA, 0x04, 0x67, 0xBD, 0x30, 0x9D, 0x0E, 0x82, 0x69, 0x51, 0x48, 0xEC, 0x4B, 0x9A, 0x22, 0xB3, 0x24, 0xD3, 0xC1, 0x56, 0x39, 0x4F, 0x45, 0xCE, 0xFE, 0xF7, 0xD5, 0x3F, 0x30, 0xBB, 0xD9, 0x9B }; -const FX_BYTE g_nlNL_Locale[] = { +const uint8_t g_nlNL_Locale[] = { 0x78, 0x9C, 0x95, 0x56, 0x4D, 0x4F, 0xDC, 0x30, 0x10, 0x3D, 0x53, 0xA9, 0xFF, 0xC1, 0x8A, 0x8A, 0x68, 0x25, 0x96, 0x2D, 0x47, 0x50, 0x88, 0xB4, 0x05, 0x0A, 0x15, 0x04, 0xAD, 0x58, 0xDA, 0xAA, 0x5C, 0x2A, 0x6F, 0x62, 0x76, 0xBD, 0x24, 0xF6, 0xCA, 0x89, 0x41, 0xC9, 0xB1, 0x52, 0x8F, 0xFD, 0x27, 0xAD, 0xDA, 0x5B, 0xFF, 0x4F, 0xA5, 0x4A, 0xFC, 0x8C, 0x8E, 0xF3, @@ -601,7 +601,7 @@ const FX_BYTE g_nlNL_Locale[] = { 0xF6, 0xFE, 0x34, 0x70, 0x17, 0xAA, 0x4B, 0x74, 0xDE, 0x4B, 0x9B, 0xF1, 0x41, 0x34, 0x37, 0x91, 0x6C, 0xB1, 0xE2, 0x19, 0x33, 0x2F, 0x32, 0x1B, 0x6D, 0xB5, 0xF3, 0xB4, 0xC7, 0xF9, 0xA7, 0xBA, 0xF3, 0x0F, 0xD5, 0xFA, 0xC0, 0xFA }; -const FX_BYTE g_ruRU_Locale[] = { +const uint8_t g_ruRU_Locale[] = { 0x78, 0x9C, 0xAD, 0x57, 0x4D, 0x4F, 0x13, 0x41, 0x18, 0x3E, 0x63, 0xE2, 0x7F, 0x98, 0x6C, 0x24, 0x68, 0x02, 0xAD, 0x1E, 0x25, 0x65, 0x13, 0x22, 0x0A, 0x06, 0xD7, 0x90, 0x16, 0x34, 0x72, 0x31, 0xDB, 0xDD, 0xA1, 0x5D, 0xE8, 0xEE, 0x90, 0xE9, 0x6E, 0xB0, 0x7B, 0x2A, 0x85, 0xE8, 0x05, 0x25, 0xE1, 0xA0, 0x47, 0xF4, 0xE4, 0xC9, 0x50, 0xBE, 0x12, 0x82, 0xB6, 0x24, @@ -753,12 +753,12 @@ CXFA_LocaleMgr::CXFA_LocaleMgr(CXFA_Node* pLocaleSet, CFX_WideString wsDeflcid) } CXFA_LocaleMgr::~CXFA_LocaleMgr() { - FX_INT32 iCount = m_LocaleArray.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = m_LocaleArray.GetSize(); + for (int32_t i = 0; i < iCount; i++) { ((IFX_Locale*)m_LocaleArray[i])->Release(); } - FX_INT32 iXmls = m_XMLLocaleArray.GetSize(); - for (FX_INT32 j = 0; j < iXmls; j++) { + int32_t iXmls = m_XMLLocaleArray.GetSize(); + for (int32_t j = 0; j < iXmls; j++) { ((IFX_Locale*)m_XMLLocaleArray[j])->Release(); } } @@ -840,15 +840,15 @@ IFX_Locale* CXFA_LocaleMgr::GetLocale(FX_WORD lcid) } IFX_Locale* CXFA_LocaleMgr::GetLocaleByName(FX_WSTR wsLocaleName) { - FX_INT32 iCount = m_LocaleArray.GetSize(); - FX_INT32 i = 0; + int32_t iCount = m_LocaleArray.GetSize(); + int32_t i = 0; for (i = 0; i < iCount; i++) { IFX_Locale* pLocale = ((IFX_Locale*)m_LocaleArray[i]); if (pLocale->GetName() == wsLocaleName) { return pLocale; } } - FX_INT32 iLen = wsLocaleName.GetLength(); + int32_t iLen = wsLocaleName.GetLength(); if (iLen < 2) { return NULL; } @@ -913,12 +913,12 @@ CXFA_TimeZoneProvider::CXFA_TimeZoneProvider() { #if _FXM_PLATFORM_==_FXM_PLATFORM_WINDOWS_ _tzset(); - m_tz.tzHour = (FX_INT8)(_timezone / 3600 * -1); - m_tz.tzMinute = (FX_INT8)((FXSYS_abs(_timezone) % 3600) / 60); + m_tz.tzHour = (int8_t)(_timezone / 3600 * -1); + m_tz.tzMinute = (int8_t)((FXSYS_abs(_timezone) % 3600) / 60); #else tzset(); - m_tz.tzHour = (FX_INT8)(timezone / 3600 * -1); - m_tz.tzMinute = (FX_INT8)((FXSYS_abs((int)timezone) % 3600) / 60); + m_tz.tzHour = (int8_t)(timezone / 3600 * -1); + m_tz.tzMinute = (int8_t)((FXSYS_abs((int)timezone) % 3600) / 60); #endif } CXFA_TimeZoneProvider::~CXFA_TimeZoneProvider() diff --git a/xfa/src/fxfa/src/parser/xfa_localevalue.cpp b/xfa/src/fxfa/src/parser/xfa_localevalue.cpp index 46ea47dc5d..3f9d066122 100644 --- a/xfa/src/fxfa/src/parser/xfa_localevalue.cpp +++ b/xfa/src/fxfa/src/parser/xfa_localevalue.cpp @@ -100,8 +100,8 @@ FX_BOOL CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue, const CFX CFX_WideStringArray wsPatterns; pFormat->SplitFormatString(wsPattern, wsPatterns); FX_BOOL bRet = FALSE; - FX_INT32 iCount = wsPatterns.GetSize(); - FX_INT32 i = 0; + int32_t iCount = wsPatterns.GetSize(); + int32_t i = 0; for (; i < iCount && !bRet; i++) { CFX_WideString wsFormat = wsPatterns[i]; FX_LOCALECATEGORY eCategory = pFormat->GetCategory(wsFormat); @@ -199,9 +199,9 @@ FX_FLOAT CXFA_LocaleValue::GetNum() const { if (m_bValid && (m_dwType == XFA_VT_BOOLEAN || m_dwType == XFA_VT_INTEGER || m_dwType == XFA_VT_DECIMAL || m_dwType == XFA_VT_FLOAT)) { - FX_INT64 nIntegral = 0; + int64_t nIntegral = 0; FX_DWORD dwFractional = 0; - FX_INT32 nExponent = 0; + int32_t nExponent = 0; int cc = 0; FX_BOOL bNegative = FALSE, bExpSign = FALSE; FX_LPCWSTR str = (FX_LPCWSTR)m_wsValue; @@ -275,10 +275,10 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const { if (m_bValid && (m_dwType == XFA_VT_BOOLEAN || m_dwType == XFA_VT_INTEGER || m_dwType == XFA_VT_DECIMAL || m_dwType == XFA_VT_FLOAT)) { - FX_INT64 nIntegral = 0; + int64_t nIntegral = 0; FX_DWORD dwFractional = 0; - FX_INT32 nExponent = 0; - FX_INT32 cc = 0; + int32_t nExponent = 0; + int32_t cc = 0; FX_BOOL bNegative = FALSE, bExpSign = FALSE; FX_LPCWSTR str = (FX_LPCWSTR)m_wsValue; int len = m_wsValue.GetLength(); @@ -294,7 +294,7 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const bNegative = TRUE; cc++; } - FX_INT32 nIntegralLen = 0; + int32_t nIntegralLen = 0; while (cc < len) { if (str[cc] == '.' || !XFA_IsDigit(str[cc]) || nIntegralLen > 17) { break; @@ -304,7 +304,7 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const nIntegralLen++; } nIntegral = bNegative ? -nIntegral : nIntegral; - FX_INT32 scale = 0; + int32_t scale = 0; FX_DOUBLE fraction = 0.0; if (cc < len && str[cc] == '.') { cc ++; @@ -369,7 +369,7 @@ CFX_Unitime CXFA_LocaleValue::GetTime() const CFX_Unitime CXFA_LocaleValue::GetDateTime() const { if (m_bValid && m_dwType == XFA_VT_DATETIME) { - FX_INT32 index = m_wsValue.Find('T'); + int32_t index = m_wsValue.Find('T'); CFX_Unitime dt; FX_DateFromCanonical(m_wsValue.Left(index), dt); FXSYS_assert(m_pLocaleMgr); @@ -454,8 +454,8 @@ FX_BOOL CXFA_LocaleValue::FormatPatterns(CFX_WideString& wsResult, const CFX_Wid IFX_FormatString* pFormat = IFX_FormatString::Create(m_pLocaleMgr, FALSE); CFX_WideStringArray wsPatterns; pFormat->SplitFormatString(wsFormat, wsPatterns); - FX_INT32 iCount = wsPatterns.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = wsPatterns.GetSize(); + for (int32_t i = 0; i < iCount; i++) { bRet = FormatSinglePattern(wsResult, wsPatterns[i], pLocale, eValueType); if (bRet) { break; @@ -650,7 +650,7 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalDate(const CFX_WideString& wsDate, CF return FALSE; } CFX_Unitime ut; - ut.Set(wYear, static_cast(wMonth), static_cast(wDay)); + ut.Set(wYear, static_cast(wMonth), static_cast(wDay)); unDate = unDate + ut; return TRUE; } @@ -718,7 +718,7 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalTime(const CFX_WideString& wsTime) if (pTime[nIndex] == 'Z') { nIndex++; } else if (pTime[nIndex] == '-' || pTime[nIndex] == '+') { - FX_SHORT nOffsetH = 0, nOffsetM = 0; + int16_t nOffsetH = 0, nOffsetM = 0; nIndex++; nStart = nIndex; while (pTime[nIndex] != '\0' && nIndex - nStart < wCountH && nIndex < nLen) { @@ -796,8 +796,8 @@ FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue, const CFX_WideStringArray wsPatterns; pFormat->SplitFormatString(wsPattern, wsPatterns); FX_BOOL bRet = FALSE; - FX_INT32 iCount = wsPatterns.GetSize(); - for (FX_INT32 i = 0; i < iCount && !bRet; i++) { + int32_t iCount = wsPatterns.GetSize(); + for (int32_t i = 0; i < iCount && !bRet; i++) { CFX_WideString wsFormat = wsPatterns[i]; FX_LOCALECATEGORY eCategory = pFormat->GetCategory(wsFormat); eCategory = XFA_ValugeCategory(eCategory, m_dwType); @@ -867,17 +867,17 @@ FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue, const } return bRet; } -void CXFA_LocaleValue::GetNumbericFormat(CFX_WideString &wsFormat, FX_INT32 nIntLen, FX_INT32 nDecLen, FX_BOOL bSign ) +void CXFA_LocaleValue::GetNumbericFormat(CFX_WideString &wsFormat, int32_t nIntLen, int32_t nDecLen, FX_BOOL bSign ) { FXSYS_assert(wsFormat.IsEmpty()); FXSYS_assert(nIntLen >= -1 && nDecLen >= -1); - FX_INT32 nTotalLen \ + int32_t nTotalLen \ = (nIntLen >= 0 ? nIntLen : 2) \ + (bSign ? 1 : 0) \ + (nDecLen >= 0 ? nDecLen : 2) \ + (nDecLen == 0 ? 0 : 1); FX_LPWSTR lpBuf = wsFormat.GetBuffer(nTotalLen); - FX_INT32 nPos = 0; + int32_t nPos = 0; if (bSign) { lpBuf[nPos++] = L's'; } @@ -904,14 +904,14 @@ void CXFA_LocaleValue::GetNumbericFormat(CFX_WideString &wsFormat, FX_INT32 nInt } wsFormat.ReleaseBuffer(nTotalLen); } -FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric, CFX_WideString& wsFormat, IFX_Locale* pLocale , FX_INT32* pos ) +FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric, CFX_WideString& wsFormat, IFX_Locale* pLocale , int32_t* pos ) { if (wsFormat.IsEmpty() || wsNumeric.IsEmpty()) { return TRUE; } FX_LPCWSTR pNum = FX_LPCWSTR(wsNumeric); FX_LPCWSTR pFmt = FX_LPCWSTR(wsFormat); - FX_INT32 n = 0, nf = 0; + int32_t n = 0, nf = 0; FX_WCHAR c = pNum[n]; FX_WCHAR cf = pFmt[nf]; if (cf == L's') { @@ -921,8 +921,8 @@ FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric, CFX_Wid ++nf; } FX_BOOL bLimit = TRUE; - FX_INT32 nCount = wsNumeric.GetLength(); - FX_INT32 nCountFmt = wsFormat.GetLength(); + int32_t nCount = wsNumeric.GetLength(); + int32_t nCountFmt = wsFormat.GetLength(); while (n < nCount && (bLimit ? nf < nCountFmt : TRUE) && XFA_IsDigit(c = pNum[n])) { if (bLimit == TRUE) { if ((cf = pFmt[nf]) == L'*') { diff --git a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp index f275780952..153110492f 100644 --- a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp @@ -29,7 +29,7 @@ void CXFA_Object::GetClassName(CFX_WideStringC &wsName) const ASSERT(pElement != NULL); wsName = pElement->pName; } -FX_UINT32 CXFA_Object::GetClassHashCode() const +uint32_t CXFA_Object::GetClassHashCode() const { XFA_LPCELEMENTINFO pElement = XFA_GetElementByID(GetClassID()); ASSERT(pElement != NULL); @@ -59,7 +59,7 @@ void CXFA_Object::Script_ObjectClass_ClassName(FXJSE_HVALUE hValue, FX_BOOL bSet ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); } } -void CXFA_Object::ThrowScriptErrorMessage(FX_INT32 iStringID, ...) +void CXFA_Object::ThrowScriptErrorMessage(int32_t iStringID, ...) { IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider(); FXSYS_assert(pAppProvider); @@ -225,7 +225,7 @@ CXFA_Node* CXFA_Node::GetNodeItem(XFA_NODEITEM eItem, XFA_OBJECTTYPE eType) cons } return pNode; } -FX_INT32 CXFA_Node::GetNodeList(CXFA_NodeArray &nodes, FX_DWORD dwTypeFilter , XFA_ELEMENT eElementFilter , FX_INT32 iLevel ) +int32_t CXFA_Node::GetNodeList(CXFA_NodeArray &nodes, FX_DWORD dwTypeFilter , XFA_ELEMENT eElementFilter , int32_t iLevel ) { if (--iLevel < 0) { return nodes.GetSize(); @@ -273,12 +273,12 @@ FX_INT32 CXFA_Node::GetNodeList(CXFA_NodeArray &nodes, FX_DWORD dwTypeFilter , X pChild = pChild->m_pNext; } if (bFilterOneOfProperties && nodes.GetSize() < 1) { - FX_INT32 iProperties = 0; + int32_t iProperties = 0; XFA_LPCPROPERTY pProperty = XFA_GetElementProperties(GetClassID(), iProperties); if (pProperty == NULL || iProperties < 1) { return 0; } - for (FX_INT32 i = 0; i < iProperties; i++) { + for (int32_t i = 0; i < iProperties; i++) { if (pProperty[i].uFlags & XFA_PROPERTYFLAG_DefaultOneOf) { IXFA_ObjFactory *pFactory = m_pDocument->GetParser()->GetFactory(); XFA_LPCPACKETINFO pPacket = XFA_GetPacketByID(GetPacketID()); @@ -335,7 +335,7 @@ CXFA_Node* CXFA_Node::GetBindData() ASSERT(GetPacketID() == XFA_XDPPACKET_Form); return (CXFA_Node*)GetObject(XFA_ATTRIBUTE_BindingNode); } -FX_INT32 CXFA_Node::GetBindItems(CXFA_NodeArray& formItems) +int32_t CXFA_Node::GetBindItems(CXFA_NodeArray& formItems) { if (m_uFlags & XFA_NODEFLAG_BindFormItems) { CXFA_NodeArray* pItems = NULL; @@ -356,7 +356,7 @@ static void XFA_DataNodeDeleteBindItem(FX_LPVOID pData) } } static XFA_MAPDATABLOCKCALLBACKINFO deleteBindItemCallBack = {XFA_DataNodeDeleteBindItem, NULL}; -FX_INT32 CXFA_Node::AddBindItem(CXFA_Node* pFormNode) +int32_t CXFA_Node::AddBindItem(CXFA_Node* pFormNode) { ASSERT(pFormNode); if (m_uFlags & XFA_NODEFLAG_BindFormItems) { @@ -382,14 +382,14 @@ FX_INT32 CXFA_Node::AddBindItem(CXFA_Node* pFormNode) m_uFlags |= XFA_NODEFLAG_BindFormItems; return 2; } -FX_INT32 CXFA_Node::RemoveBindItem(CXFA_Node* pFormNode) +int32_t CXFA_Node::RemoveBindItem(CXFA_Node* pFormNode) { if (m_uFlags & XFA_NODEFLAG_BindFormItems) { CXFA_NodeArray* pItems = NULL; TryObject(XFA_ATTRIBUTE_BindingNode, (FX_LPVOID&)pItems); ASSERT(pItems); - FX_INT32 iIndex = pItems->Find(pFormNode); - FX_INT32 iCount = pItems->GetSize(); + int32_t iIndex = pItems->Find(pFormNode); + int32_t iCount = pItems->GetSize(); if (iIndex >= 0) { if (iIndex != iCount - 1) { pItems->SetAt(iIndex, pItems->GetAt(iCount - 1)); @@ -451,7 +451,7 @@ CXFA_WidgetData* CXFA_Node::GetContainerWidgetData() pFieldWidgetData = NULL; CXFA_NodeArray formNodes; pDataNode->GetBindItems(formNodes); - for (FX_INT32 i = 0; i < formNodes.GetSize(); i++) { + for (int32_t i = 0; i < formNodes.GetSize(); i++) { CXFA_Node* pFormNode = formNodes.GetAt(i); if (!pFormNode || pFormNode->HasFlag(XFA_NODEFLAG_HasRemoved)) { continue; @@ -600,7 +600,7 @@ void CXFA_Node::SetDataDescriptionNode(CXFA_Node* pDataDescriptionNode) } void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resolveNode"); return; @@ -618,7 +618,7 @@ void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) } FX_DWORD dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; XFA_RESOLVENODE_RS resoveNodeRS; - FX_INT32 iRet = pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwFlag); + int32_t iRet = pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwFlag); if (iRet < 1) { return FXJSE_Value_SetNull(pArguments->GetReturnValue()); } @@ -641,7 +641,7 @@ void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_TreeClass_ResolveNodes(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resolveNodes"); return; @@ -670,10 +670,10 @@ void CXFA_Node::Script_Som_ResolveNodeList(FXJSE_HVALUE hValue, CFX_WideString w if(refNode == NULL) { refNode = this; } - FX_INT32 iRet = pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwFlag); + int32_t iRet = pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwFlag); CXFA_ArrayNodeList* pNodeList = FX_NEW CXFA_ArrayNodeList(m_pDocument); if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { - for (FX_INT32 i = 0; i < resoveNodeRS.nodes.GetSize(); i++) { + for (int32_t i = 0; i < resoveNodeRS.nodes.GetSize(); i++) { if (resoveNodeRS.nodes[i]->IsNode()) { pNodeList->Append((CXFA_Node*)resoveNodeRS.nodes[i]); } @@ -683,7 +683,7 @@ void CXFA_Node::Script_Som_ResolveNodeList(FXJSE_HVALUE hValue, CFX_WideString w if (resoveNodeRS.GetAttributeResult(hValueArray) > 0) { CXFA_ObjArray objectArray; hValueArray.GetAttributeObject(objectArray); - for (FX_INT32 i = 0; i < objectArray.GetSize(); i++) { + for (int32_t i = 0; i < objectArray.GetSize(); i++) { if (objectArray[i]->IsNode()) { pNodeList->Append((CXFA_Node*)objectArray[i]); } @@ -774,7 +774,7 @@ void CXFA_Node::Script_TreeClass_SomExpression(FXJSE_HVALUE hValue, FX_BOOL bSet } void CXFA_Node::Script_NodeClass_ApplyXSL(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"applyXSL"); return; @@ -785,14 +785,14 @@ void CXFA_Node::Script_NodeClass_ApplyXSL(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_NodeClass_AssignNode(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 3) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"assignNode"); return; } CFX_WideString wsExpression; CFX_WideString wsValue; - FX_INT32 iAction = 0; + int32_t iAction = 0; if (iLength >= 1) { CFX_ByteString bsExpression = pArguments->GetUTF8String(0); wsExpression = CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength()); @@ -807,7 +807,7 @@ void CXFA_Node::Script_NodeClass_AssignNode(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_NodeClass_Clone(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"clone"); return; @@ -819,7 +819,7 @@ void CXFA_Node::Script_NodeClass_Clone(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_NodeClass_GetAttribute(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getAttribute"); return; @@ -836,13 +836,13 @@ void CXFA_Node::Script_NodeClass_GetAttribute(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 2) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getElement"); return; } CFX_WideString wsExpression; - FX_INT32 iValue = 0; + int32_t iValue = 0; if (iLength >= 1) { CFX_ByteString bsExpression = pArguments->GetUTF8String(0); wsExpression = CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength()); @@ -856,14 +856,14 @@ void CXFA_Node::Script_NodeClass_GetElement(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_NodeClass_IsPropertySpecified(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 3) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"isPropertySpecified"); return; } CFX_WideString wsExpression; FX_BOOL bParent = TRUE; - FX_INT32 iIndex = 0; + int32_t iIndex = 0; if (iLength >= 1) { CFX_ByteString bsExpression = pArguments->GetUTF8String(0); wsExpression = CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength()); @@ -891,7 +891,7 @@ void CXFA_Node::Script_NodeClass_IsPropertySpecified(CFXJSE_Arguments* pArgument } void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 3) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"loadXML"); return; @@ -917,7 +917,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) return; } IFDE_XMLNode* pXMLNode = NULL; - FX_INT32 iParserStatus = pParser->ParseXMLData(wsExpression, pXMLNode, NULL); + int32_t iParserStatus = pParser->ParseXMLData(wsExpression, pXMLNode, NULL); if (iParserStatus != XFA_PARSESTATUS_Done || !pXMLNode) { pParser->Release(); pParser = NULL; @@ -962,7 +962,7 @@ void CXFA_Node::Script_NodeClass_LoadXML(CFXJSE_Arguments* pArguments) if (bOverwrite) { CXFA_Node *pChild = this->GetNodeItem(XFA_NODEITEM_FirstChild); CXFA_Node* pNewChild = pFakeRoot->GetNodeItem(XFA_NODEITEM_FirstChild); - FX_INT32 index = 0; + int32_t index = 0; while (pNewChild) { CXFA_Node* pItem = pNewChild->GetNodeItem(XFA_NODEITEM_NextSibling); pFakeRoot->RemoveChild(pNewChild); @@ -1016,7 +1016,7 @@ void CXFA_Node::Script_NodeClass_SaveFilteredXML(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 0 || iLength > 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"saveXML"); return; @@ -1090,7 +1090,7 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_NodeClass_SetAttribute(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 2) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"setAttribute"); return; @@ -1105,7 +1105,7 @@ void CXFA_Node::Script_NodeClass_SetAttribute(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_NodeClass_SetElement(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1 && iLength != 2) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"setElement"); return; @@ -1165,7 +1165,7 @@ void CXFA_Node::Script_NodeClass_OneOfChild(FXJSE_HVALUE hValue, FX_BOOL bSettin ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET); } else { CXFA_NodeArray properts; - FX_INT32 iSize = this->GetNodeList(properts, XFA_NODEFILTER_OneOfProperty); + int32_t iSize = this->GetNodeList(properts, XFA_NODEFILTER_OneOfProperty); if (iSize > 0) { FXJSE_Value_Set(hValue, m_pDocument->GetScriptContext()->GetJSValueFromMap(properts[0])); } @@ -1188,7 +1188,7 @@ void CXFA_Node::Script_ModelClass_CreateNode(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_ModelClass_IsCompatibleNS(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"isCompatibleNS"); return; @@ -1412,7 +1412,7 @@ void CXFA_Node::Script_Attribute_String(FXJSE_HVALUE hValue, FX_BOOL bSetting, X if(!wsSOM.IsEmpty()) { FX_DWORD dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; XFA_RESOLVENODE_RS resoveNodeRS; - FX_INT32 iRet = m_pDocument->GetScriptContext()->ResolveObjects(pProtoRoot, wsSOM, resoveNodeRS, dwFlag); + int32_t iRet = m_pDocument->GetScriptContext()->ResolveObjects(pProtoRoot, wsSOM, resoveNodeRS, dwFlag); if(iRet > 0 && resoveNodeRS.nodes[0]->IsNode()) { pProtoNode = (CXFA_Node*)resoveNodeRS.nodes[0]; } @@ -1456,7 +1456,7 @@ void CXFA_Node::Script_Attribute_StringRead(FXJSE_HVALUE hValue, FX_BOOL bSettin } void CXFA_Node::Script_WsdlConnection_Execute(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if ((argc == 0) || (argc == 1)) { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); } else { @@ -1465,7 +1465,7 @@ void CXFA_Node::Script_WsdlConnection_Execute(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Delta_Restore(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"restore"); @@ -1575,7 +1575,7 @@ void CXFA_Node::Script_Som_DefaultValue(FXJSE_HVALUE hValue, FX_BOOL bSetting, X CXFA_NodeArray formNodes; this->GetBindItems(formNodes); CFX_WideString wsPicture; - for (FX_INT32 i = 0; i < formNodes.GetSize(); i++) { + for (int32_t i = 0; i < formNodes.GetSize(); i++) { CXFA_Node* pFormNode = formNodes.GetAt(i); if (!pFormNode || pFormNode->HasFlag(XFA_NODEFLAG_HasRemoved)) { continue; @@ -1630,7 +1630,7 @@ void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ if (!(FXJSE_Value_IsNull(hValue) || FXJSE_Value_IsUndefined(hValue))) { FXJSE_Value_ToUTF8String(hValue, newValue); } - FX_INT32 iValue = FXSYS_atoi(newValue); + int32_t iValue = FXSYS_atoi(newValue); CFX_WideString wsNewValue = (iValue == 0) ? FX_WSTRC(L"0") : FX_WSTRC(L"1"); CFX_WideString wsFormatValue(wsNewValue); CXFA_WidgetData* pContainerWidgetData = GetContainerWidgetData(); @@ -1645,10 +1645,10 @@ void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ } struct XFA_ExecEventParaInfo { public: - FX_UINT32 m_uHash; + uint32_t m_uHash; FX_LPCWSTR m_lpcEventName; XFA_EVENTTYPE m_eventType; - FX_UINT32 m_validFlags; + uint32_t m_validFlags; }; static const XFA_ExecEventParaInfo gs_eventParaInfos[] = { {0x02a6c55a, L"postSubmit", XFA_EVENT_PostSubmit, 0}, @@ -1679,11 +1679,11 @@ static const XFA_ExecEventParaInfo gs_eventParaInfos[] = { }; const XFA_ExecEventParaInfo* GetEventParaInfoByName(FX_WSTR wsEventName) { - FX_INT32 iLength = wsEventName.GetLength(); - FX_UINT32 uHash = FX_HashCode_String_GetW(wsEventName.GetPtr(), iLength); + int32_t iLength = wsEventName.GetLength(); + uint32_t uHash = FX_HashCode_String_GetW(wsEventName.GetPtr(), iLength); const XFA_ExecEventParaInfo* eventParaInfo = NULL; - FX_INT32 iStart = 0, iEnd = (sizeof(gs_eventParaInfos) / sizeof(gs_eventParaInfos[0])) - 1; - FX_INT32 iMid = (iStart + iEnd) / 2; + int32_t iStart = 0, iEnd = (sizeof(gs_eventParaInfos) / sizeof(gs_eventParaInfos[0])) - 1; + int32_t iMid = (iStart + iEnd) / 2; do { iMid = (iStart + iEnd) / 2; eventParaInfo = &gs_eventParaInfos[iMid]; @@ -1697,15 +1697,15 @@ const XFA_ExecEventParaInfo* GetEventParaInfoByName(FX_WSTR wsEventName) } while (iStart <= iEnd); return NULL; } -void XFA_STRING_TO_RGB(CFX_WideString &strRGB, FX_INT32 &r, FX_INT32 &g, FX_INT32 &b) +void XFA_STRING_TO_RGB(CFX_WideString &strRGB, int32_t &r, int32_t &g, int32_t &b) { r = 0; g = 0; b = 0; FX_WCHAR zero = '0'; - FX_INT32 iIndex = 0; - FX_INT32 iLen = strRGB.GetLength(); - for (FX_INT32 i = 0; i < iLen; ++i) { + int32_t iIndex = 0; + int32_t iLen = strRGB.GetLength(); + for (int32_t i = 0; i < iLen; ++i) { FX_WCHAR ch = strRGB.GetAt(i); if (ch == L',') { ++iIndex; @@ -1713,7 +1713,7 @@ void XFA_STRING_TO_RGB(CFX_WideString &strRGB, FX_INT32 &r, FX_INT32 &g, FX_INT3 if (iIndex > 2) { break; } - FX_INT32 iValue = ch - zero; + int32_t iValue = ch - zero; if (iValue >= 0 && iValue <= 9) { switch (iIndex) { case 0: @@ -1736,23 +1736,23 @@ void CXFA_Node::Script_Som_BorderColor(FXJSE_HVALUE hValue, FX_BOOL bSetting, XF return; } CXFA_Border border = pWidgetData->GetBorder(TRUE); - FX_INT32 iSize = border.CountEdges(); + int32_t iSize = border.CountEdges(); CFX_WideString strColor; if (bSetting) { CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); strColor = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()); - FX_INT32 r = 0, g = 0, b = 0; + int32_t r = 0, g = 0, b = 0; XFA_STRING_TO_RGB(strColor, r, g, b); FX_ARGB rgb = ArgbEncode(100, r, g, b); - for (FX_INT32 i = 0; i < iSize; ++i) { + for (int32_t i = 0; i < iSize; ++i) { CXFA_Edge edge = border.GetEdge(i); edge.SetColor(rgb); } } else { CXFA_Edge edge = border.GetEdge(0); FX_ARGB color = edge.GetColor(); - FX_INT32 a, r, g, b; + int32_t a, r, g, b; ArgbDecode(color, a, r, g, b); strColor.Format(L"%d,%d,%d", r, g, b); FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(strColor)); @@ -1765,13 +1765,13 @@ void CXFA_Node::Script_Som_BorderWidth(FXJSE_HVALUE hValue, FX_BOOL bSetting, XF return; } CXFA_Border border = pWidgetData->GetBorder(TRUE); - FX_INT32 iSize = border.CountEdges(); + int32_t iSize = border.CountEdges(); CFX_WideString wsThickness; if (bSetting) { CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); wsThickness = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()); - for (FX_INT32 i = 0; i < iSize; ++i) { + for (int32_t i = 0; i < iSize; ++i) { CXFA_Edge edge = border.GetEdge(i); CXFA_Measurement thickness(wsThickness); edge.SetMSThickness(thickness); @@ -1800,13 +1800,13 @@ void CXFA_Node::Script_Som_FillColor(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); wsColor = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()); - FX_INT32 r, g, b; + int32_t r, g, b; XFA_STRING_TO_RGB(wsColor, r, g, b); FX_ARGB color = ArgbEncode(0xff, r, g, b); borderfill.SetColor(color); } else { FX_ARGB color = borderfill.GetColor(); - FX_INT32 a, r, g, b; + int32_t a, r, g, b; ArgbDecode(color, a, r, g, b); wsColor.Format(L"%d,%d,%d", r, g, b); FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsColor)); @@ -1871,8 +1871,8 @@ void CXFA_Node::Script_Field_DefaultValue(FXJSE_HVALUE hValue, FX_BOOL bSetting, CFX_WideString wsNewText = CFX_WideString::FromUTF8(newValue, newValue.GetLength()); CXFA_Node *pUIChild = pWidgetData->GetUIChild(); if (pUIChild->GetClassID() == XFA_ELEMENT_NumericEdit) { - FX_INT32 iLeadDigits = 0; - FX_INT32 iFracDigits = 0; + int32_t iLeadDigits = 0; + int32_t iFracDigits = 0; pWidgetData->GetLeadDigits(iLeadDigits); pWidgetData->GetFracDigits(iFracDigits); wsNewText = XFA_NumericLimit(wsNewText, iLeadDigits, iFracDigits); @@ -1945,13 +1945,13 @@ void CXFA_Node::Script_Som_FontColor(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ CFX_ByteString bsValue; FXJSE_Value_ToUTF8String(hValue, bsValue); wsColor = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()); - FX_INT32 r, g, b; + int32_t r, g, b; XFA_STRING_TO_RGB(wsColor, r, g, b); FX_ARGB color = ArgbEncode(0xff, r, g, b); font.SetColor(color); } else { FX_ARGB color = font.GetColor(); - FX_INT32 a, r, g, b; + int32_t a, r, g, b; ArgbDecode(color, a, r, g, b); wsColor.Format(L"%d,%d,%d", r, g, b); FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsColor)); @@ -1992,7 +1992,7 @@ void CXFA_Node::Script_Som_Mandatory(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ wsValue = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()); validate.SetNullTest(wsValue); } else { - FX_INT32 iValue = validate.GetNullTest(); + int32_t iValue = validate.GetNullTest(); XFA_LPCATTRIBUTEENUMINFO pInfo = XFA_GetAttributeEnumByID((XFA_ATTRIBUTEENUM)iValue); if (pInfo) { wsValue = pInfo->pName; @@ -2019,7 +2019,7 @@ void CXFA_Node::Script_Field_SelectedIndex(FXJSE_HVALUE hValue, FX_BOOL bSetting return; } if (bSetting) { - FX_INT32 iIndex = FXJSE_Value_ToInteger(hValue); + int32_t iIndex = FXJSE_Value_ToInteger(hValue); if (iIndex == -1) { pWidgetData->ClearAllSelections(); return; @@ -2039,10 +2039,10 @@ void CXFA_Node::Script_Field_ClearItems(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Field_ExecEvent(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 1) { CFX_ByteString eventString = pArguments->GetUTF8String(0); - FX_INT32 iRet = execSingleEventByName(CFX_WideString::FromUTF8(eventString, eventString.GetLength()), XFA_ELEMENT_Field); + int32_t iRet = execSingleEventByName(CFX_WideString::FromUTF8(eventString, eventString.GetLength()), XFA_ELEMENT_Field); if (eventString == FX_BSTRC("validate")) { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); } @@ -2052,7 +2052,7 @@ void CXFA_Node::Script_Field_ExecEvent(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Field_ExecInitialize(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { @@ -2065,7 +2065,7 @@ void CXFA_Node::Script_Field_ExecInitialize(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Field_DeleteItem(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"deleteItem"); return; @@ -2074,7 +2074,7 @@ void CXFA_Node::Script_Field_DeleteItem(CFXJSE_Arguments* pArguments) if (!pWidgetData) { return; } - FX_INT32 iIndex = pArguments->GetInt32(0); + int32_t iIndex = pArguments->GetInt32(0); FX_BOOL bValue = pWidgetData->DeleteItem(iIndex, TRUE, TRUE); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { @@ -2083,12 +2083,12 @@ void CXFA_Node::Script_Field_DeleteItem(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Field_GetSaveItem(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getSaveItem"); return; } - FX_INT32 iIndex = pArguments->GetInt32(0); + int32_t iIndex = pArguments->GetInt32(0); if (iIndex < 0) { FXJSE_Value_SetNull(pArguments->GetReturnValue()); return; @@ -2108,7 +2108,7 @@ void CXFA_Node::Script_Field_GetSaveItem(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Field_BoundItem(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"boundItem"); return; @@ -2128,7 +2128,7 @@ void CXFA_Node::Script_Field_BoundItem(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getItemState"); return; @@ -2137,7 +2137,7 @@ void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments) if (!pWidgetData) { return; } - FX_INT32 iIndex = pArguments->GetInt32(0); + int32_t iIndex = pArguments->GetInt32(0); FX_BOOL bValue = pWidgetData->GetItemState(iIndex); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { @@ -2146,7 +2146,7 @@ void CXFA_Node::Script_Field_GetItemState(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Field_ExecCalculate(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { @@ -2162,12 +2162,12 @@ void CXFA_Node::Script_Field_SetItems(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Field_GetDisplayItem(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getDisplayItem"); return; } - FX_INT32 iIndex = pArguments->GetInt32(0); + int32_t iIndex = pArguments->GetInt32(0); if (iIndex < 0) { FXJSE_Value_SetNull(pArguments->GetReturnValue()); return; @@ -2187,7 +2187,7 @@ void CXFA_Node::Script_Field_GetDisplayItem(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Field_SetItemState(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 2) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"setItemState"); return; @@ -2196,7 +2196,7 @@ void CXFA_Node::Script_Field_SetItemState(CFXJSE_Arguments* pArguments) if (!pWidgetData) { return; } - FX_INT32 iIndex = pArguments->GetInt32(0); + int32_t iIndex = pArguments->GetInt32(0); FX_BOOL bAdd = pArguments->GetInt32(1) == 0 ? FALSE : TRUE; if (bAdd) { pWidgetData->SetItemState(iIndex, TRUE, TRUE, TRUE); @@ -2208,7 +2208,7 @@ void CXFA_Node::Script_Field_SetItemState(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Field_AddItem(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 2) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"addItem"); return; @@ -2231,13 +2231,13 @@ void CXFA_Node::Script_Field_AddItem(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Field_ExecValidate(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); } else { - FX_INT32 iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate, FALSE, FALSE); + int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate, FALSE, FALSE); FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); } } else { @@ -2276,7 +2276,7 @@ void CXFA_Node::Script_ExclGroup_Transient(FXJSE_HVALUE hValue, FX_BOOL bSetting } void CXFA_Node::Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 1) { CFX_ByteString eventString = pArguments->GetUTF8String(0); execSingleEventByName(CFX_WideString::FromUTF8(eventString, eventString.GetLength()), XFA_ELEMENT_ExclGroup); @@ -2286,7 +2286,7 @@ void CXFA_Node::Script_ExclGroup_ExecEvent(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_ExclGroup_SelectedMember(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if ((argc == 0) || (argc == 1)) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { @@ -2312,7 +2312,7 @@ void CXFA_Node::Script_ExclGroup_SelectedMember(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_ExclGroup_ExecInitialize(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { @@ -2325,7 +2325,7 @@ void CXFA_Node::Script_ExclGroup_ExecInitialize(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_ExclGroup_ExecCalculate(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { @@ -2338,23 +2338,23 @@ void CXFA_Node::Script_ExclGroup_ExecCalculate(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_ExclGroup_ExecValidate(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); } else { - FX_INT32 iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); + int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); } } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate"); } } -static CXFA_Node* XFA_ScriptInstanceManager_GetItem(CXFA_Node *pInstMgrNode, FX_INT32 iIndex) +static CXFA_Node* XFA_ScriptInstanceManager_GetItem(CXFA_Node *pInstMgrNode, int32_t iIndex) { ASSERT(pInstMgrNode); - FX_INT32 iCount = 0; + int32_t iCount = 0; FX_DWORD dwNameHash = 0; for(CXFA_Node* pNode = pInstMgrNode->GetNodeItem(XFA_NODEITEM_NextSibling); pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { XFA_ELEMENT eCurType = pNode->GetClassID(); @@ -2385,8 +2385,8 @@ static CXFA_Node* XFA_ScriptInstanceManager_GetItem(CXFA_Node *pInstMgrNode, FX_ void CXFA_Node::Script_Som_InstanceIndex(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { - FX_INT32 iTo = FXJSE_Value_ToInteger(hValue); - FX_INT32 iFrom = Subform_and_SubformSet_InstanceIndex(); + int32_t iTo = FXJSE_Value_ToInteger(hValue); + int32_t iFrom = Subform_and_SubformSet_InstanceIndex(); CXFA_Node *pManagerNode = NULL; for (CXFA_Node *pNode = GetNodeItem(XFA_NODEITEM_PrevSibling); pNode != NULL; pNode = pNode->GetNodeItem(XFA_NODEITEM_PrevSibling)) { if (pNode->GetClassID() == XFA_ELEMENT_InstanceManager) { @@ -2450,7 +2450,7 @@ void CXFA_Node::Script_Subform_Locale(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA } void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 1) { CFX_ByteString eventString = pArguments->GetUTF8String(0); execSingleEventByName(CFX_WideString::FromUTF8(eventString, eventString.GetLength()), XFA_ELEMENT_Subform); @@ -2460,7 +2460,7 @@ void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Subform_ExecInitialize(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { @@ -2473,7 +2473,7 @@ void CXFA_Node::Script_Subform_ExecInitialize(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Subform_ExecCalculate(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { @@ -2486,13 +2486,13 @@ void CXFA_Node::Script_Subform_ExecCalculate(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Subform_ExecValidate(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); } else { - FX_INT32 iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); + int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); } } else { @@ -2501,15 +2501,15 @@ void CXFA_Node::Script_Subform_ExecValidate(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Subform_GetInvalidObjects(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"getInvalidObjects"); } } -FX_INT32 CXFA_Node::Subform_and_SubformSet_InstanceIndex() +int32_t CXFA_Node::Subform_and_SubformSet_InstanceIndex() { - FX_INT32 index = 0; + int32_t index = 0; for (CXFA_Node *pNode = GetNodeItem(XFA_NODEITEM_PrevSibling); pNode != NULL; pNode = pNode->GetNodeItem(XFA_NODEITEM_PrevSibling)) { if ((pNode->GetClassID() == XFA_ELEMENT_Subform) || (pNode->GetClassID() == XFA_ELEMENT_SubformSet)) { index++; @@ -2521,7 +2521,7 @@ FX_INT32 CXFA_Node::Subform_and_SubformSet_InstanceIndex() } void CXFA_Node::Script_Template_FormNodes(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 1) { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), TRUE); } else { @@ -2530,7 +2530,7 @@ void CXFA_Node::Script_Template_FormNodes(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Template_Remerge(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { m_pDocument->DoDataRemerge(TRUE); } else { @@ -2539,7 +2539,7 @@ void CXFA_Node::Script_Template_Remerge(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Template_ExecInitialize(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { @@ -2553,7 +2553,7 @@ void CXFA_Node::Script_Template_ExecInitialize(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Template_CreateNode(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if ((argc > 0) && (argc < 4)) { CFX_WideString strTagName; CFX_WideString strName; @@ -2593,7 +2593,7 @@ void CXFA_Node::Script_Template_CreateNode(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Template_Recalculate(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 1) { FX_BOOL bScriptFlags = pArguments->GetInt32(0) == 0 ? FALSE : TRUE; FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), TRUE); @@ -2603,7 +2603,7 @@ void CXFA_Node::Script_Template_Recalculate(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Template_ExecCalculate(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { @@ -2617,7 +2617,7 @@ void CXFA_Node::Script_Template_ExecCalculate(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Template_ExecValidate(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { @@ -2631,7 +2631,7 @@ void CXFA_Node::Script_Template_ExecValidate(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Manifest_Evaluate(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { CXFA_WidgetData* pWidgetData = GetWidgetData(); if (!pWidgetData) { @@ -2663,10 +2663,10 @@ void CXFA_Node::Script_InstanceManager_Min(FXJSE_HVALUE hValue, FX_BOOL bSetting FXJSE_Value_SetInteger(hValue, nodeOccur.GetMin()); } } -static FX_INT32 XFA_ScriptInstanceManager_GetCount(CXFA_Node *pInstMgrNode) +static int32_t XFA_ScriptInstanceManager_GetCount(CXFA_Node *pInstMgrNode) { ASSERT(pInstMgrNode); - FX_INT32 iCount = 0; + int32_t iCount = 0; FX_DWORD dwNameHash = 0; for(CXFA_Node* pNode = pInstMgrNode->GetNodeItem(XFA_NODEITEM_NextSibling); pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { XFA_ELEMENT eCurType = pNode->GetClassID(); @@ -2691,15 +2691,15 @@ static FX_INT32 XFA_ScriptInstanceManager_GetCount(CXFA_Node *pInstMgrNode) } return iCount; } -static void XFA_ScriptInstanceManager_ReorderDataNodes_SortNodeArrayByDocumentIdx(const CXFA_NodeSet& rgNodeSet, CXFA_NodeArray& rgNodeArray, CFX_ArrayTemplate& rgIdxArray) +static void XFA_ScriptInstanceManager_ReorderDataNodes_SortNodeArrayByDocumentIdx(const CXFA_NodeSet& rgNodeSet, CXFA_NodeArray& rgNodeArray, CFX_ArrayTemplate& rgIdxArray) { - FX_INT32 iCount = rgNodeSet.GetCount(); + int32_t iCount = rgNodeSet.GetCount(); rgNodeArray.SetSize(iCount); rgIdxArray.SetSize(iCount); if(iCount == 0) { return; } - FX_INT32 iIndex = -1, iTotalIndex = -1; + int32_t iIndex = -1, iTotalIndex = -1; CXFA_Node* pNode = NULL; FX_POSITION pos = rgNodeSet.GetStartPosition(); rgNodeSet.GetNextAssoc(pos, pNode); @@ -2782,10 +2782,10 @@ static void XFA_ScriptInstanceManager_ReorderDataNodes(CXFA_NodeSet& sSet1, CXFA } if(pDualNodeArray->firstNodeList.GetCount() != 0 && pDualNodeArray->secondNodeList.GetCount() != 0) { CXFA_NodeArray rgNodeArray1, rgNodeArray2; - CFX_ArrayTemplate rgIdxArray1, rgIdxArray2; + CFX_ArrayTemplate rgIdxArray1, rgIdxArray2; XFA_ScriptInstanceManager_ReorderDataNodes_SortNodeArrayByDocumentIdx(pDualNodeArray->firstNodeList, rgNodeArray1, rgIdxArray1); XFA_ScriptInstanceManager_ReorderDataNodes_SortNodeArrayByDocumentIdx(pDualNodeArray->secondNodeList, rgNodeArray2, rgIdxArray2); - FX_INT32 iLimit; + int32_t iLimit; CXFA_Node *pParentNode = NULL, *pBeforeNode = NULL; if(bInsertBefore) { iLimit = rgIdxArray2[0]; @@ -2797,7 +2797,7 @@ static void XFA_ScriptInstanceManager_ReorderDataNodes(CXFA_NodeSet& sSet1, CXFA pParentNode = pLastNode->GetNodeItem(XFA_NODEITEM_Parent); pBeforeNode = pLastNode->GetNodeItem(XFA_NODEITEM_NextSibling); } - for(FX_INT32 iIdx = 0, iCount = rgIdxArray1.GetSize(); iIdx < iCount; iIdx++) { + for(int32_t iIdx = 0, iCount = rgIdxArray1.GetSize(); iIdx < iCount; iIdx++) { CXFA_Node* pCurNode = rgNodeArray1[iIdx]; pParentNode->RemoveChild(pCurNode); pParentNode->InsertChild(pCurNode, pBeforeNode); @@ -2809,7 +2809,7 @@ static void XFA_ScriptInstanceManager_ReorderDataNodes(CXFA_NodeSet& sSet1, CXFA } rgNodeListMap.RemoveAll(); } -static void XFA_ScriptInstanceManager_InsertItem(CXFA_Node *pInstMgrNode, CXFA_Node *pNewInstance, FX_INT32 iPos, FX_INT32 iCount = -1, FX_BOOL bMoveDataBindingNodes = TRUE) +static void XFA_ScriptInstanceManager_InsertItem(CXFA_Node *pInstMgrNode, CXFA_Node *pNewInstance, int32_t iPos, int32_t iCount = -1, FX_BOOL bMoveDataBindingNodes = TRUE) { if(iCount < 0) { iCount = XFA_ScriptInstanceManager_GetCount(pInstMgrNode); @@ -2912,7 +2912,7 @@ static CXFA_Node* XFA_ScriptInstanceManager_CreateInstance(CXFA_Node *pInstMgrNo void CXFA_Node::Script_InstanceManager_Count(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) { if (bSetting) { - FX_INT32 iDesired = FXJSE_Value_ToInteger(hValue); + int32_t iDesired = FXJSE_Value_ToInteger(hValue); InstanceManager_SetInstances(iDesired); } else { FXJSE_Value_SetInteger(hValue, XFA_ScriptInstanceManager_GetCount(this)); @@ -2920,13 +2920,13 @@ void CXFA_Node::Script_InstanceManager_Count(FXJSE_HVALUE hValue, FX_BOOL bSetti } void CXFA_Node::Script_InstanceManager_MoveInstance(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc != 2) { FXJSE_Value_SetUndefined(pArguments->GetReturnValue()); return; } - FX_INT32 iFrom = pArguments->GetInt32(0); - FX_INT32 iTo = pArguments->GetInt32(1); + int32_t iFrom = pArguments->GetInt32(0); + int32_t iTo = pArguments->GetInt32(1); InstanceManager_MoveInstance(iTo, iFrom); IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { @@ -2943,19 +2943,19 @@ void CXFA_Node::Script_InstanceManager_MoveInstance(CFXJSE_Arguments* pArguments } void CXFA_Node::Script_InstanceManager_RemoveInstance(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc != 1) { FXJSE_Value_SetUndefined(pArguments->GetReturnValue()); return; } - FX_INT32 iIndex = pArguments->GetInt32(0); - FX_INT32 iCount = XFA_ScriptInstanceManager_GetCount(this); + int32_t iIndex = pArguments->GetInt32(0); + int32_t iCount = XFA_ScriptInstanceManager_GetCount(this); if (iIndex < 0 || iIndex >= iCount) { ThrowScriptErrorMessage(XFA_IDS_INDEX_OUT_OF_BOUNDS); return; } CXFA_Occur nodeOccur = GetOccurNode(); - FX_INT32 iMin = nodeOccur.GetMin(); + int32_t iMin = nodeOccur.GetMin(); if (iCount - 1 < iMin) { ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"min"); return; @@ -2964,7 +2964,7 @@ void CXFA_Node::Script_InstanceManager_RemoveInstance(CFXJSE_Arguments* pArgumen XFA_ScriptInstanceManager_RemoveItem(this, pRemoveInstance); IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (pNotify) { - for (FX_INT32 i = iIndex; i < iCount - 1; i++) { + for (int32_t i = iIndex; i < iCount - 1; i++) { CXFA_Node *pSubformInstance = XFA_ScriptInstanceManager_GetItem(this, i); if (pSubformInstance && pSubformInstance->GetClassID() == XFA_ELEMENT_Subform) { pNotify->RunSubformIndexChange(pSubformInstance); @@ -2979,17 +2979,17 @@ void CXFA_Node::Script_InstanceManager_RemoveInstance(CFXJSE_Arguments* pArgumen } void CXFA_Node::Script_InstanceManager_SetInstances(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc != 1) { FXJSE_Value_SetUndefined(pArguments->GetReturnValue()); return; } - FX_INT32 iDesired = pArguments->GetInt32(0); + int32_t iDesired = pArguments->GetInt32(0); InstanceManager_SetInstances(iDesired); } void CXFA_Node::Script_InstanceManager_AddInstance(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if ((argc != 0) && (argc != 1)) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"addInstance"); return; @@ -2998,9 +2998,9 @@ void CXFA_Node::Script_InstanceManager_AddInstance(CFXJSE_Arguments* pArguments) if (argc == 1) { fFlags = pArguments->GetInt32(0) == 0 ? FALSE : TRUE; } - FX_INT32 iCount = XFA_ScriptInstanceManager_GetCount(this); + int32_t iCount = XFA_ScriptInstanceManager_GetCount(this); CXFA_Occur nodeOccur = GetOccurNode(); - FX_INT32 iMax = nodeOccur.GetMax(); + int32_t iMax = nodeOccur.GetMax(); if (iMax >= 0 && iCount >= iMax) { ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"max"); return; @@ -3021,23 +3021,23 @@ void CXFA_Node::Script_InstanceManager_AddInstance(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_InstanceManager_InsertInstance(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if ((argc != 1) && (argc != 2)) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"insertInstance"); return; } - FX_INT32 iIndex = pArguments->GetInt32(0); + int32_t iIndex = pArguments->GetInt32(0); FX_BOOL bBind = FALSE; if (argc == 2) { bBind = pArguments->GetInt32(1) == 0 ? FALSE : TRUE; } CXFA_Occur nodeOccur = GetOccurNode(); - FX_INT32 iCount = XFA_ScriptInstanceManager_GetCount(this); + int32_t iCount = XFA_ScriptInstanceManager_GetCount(this); if (iIndex < 0 || iIndex > iCount) { ThrowScriptErrorMessage(XFA_IDS_INDEX_OUT_OF_BOUNDS); return; } - FX_INT32 iMax = nodeOccur.GetMax(); + int32_t iMax = nodeOccur.GetMax(); if (iMax >= 0 && iCount >= iMax) { ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"max"); return; @@ -3056,11 +3056,11 @@ void CXFA_Node::Script_InstanceManager_InsertInstance(CFXJSE_Arguments* pArgumen } pLayoutPro->AddChangedContainer((CXFA_Node*)m_pDocument->GetXFANode(XFA_HASHCODE_Form)); } -FX_INT32 CXFA_Node::InstanceManager_SetInstances(FX_INT32 iDesired) +int32_t CXFA_Node::InstanceManager_SetInstances(int32_t iDesired) { CXFA_Occur nodeOccur = GetOccurNode(); - FX_INT32 iMax = nodeOccur.GetMax(); - FX_INT32 iMin = nodeOccur.GetMin(); + int32_t iMax = nodeOccur.GetMax(); + int32_t iMin = nodeOccur.GetMin(); if (iDesired < iMin) { ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"min"); return 1; @@ -3069,7 +3069,7 @@ FX_INT32 CXFA_Node::InstanceManager_SetInstances(FX_INT32 iDesired) ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"max"); return 2; } - FX_INT32 iCount = XFA_ScriptInstanceManager_GetCount(this); + int32_t iCount = XFA_ScriptInstanceManager_GetCount(this); if (iDesired == iCount) { return 0; } @@ -3113,9 +3113,9 @@ FX_INT32 CXFA_Node::InstanceManager_SetInstances(FX_INT32 iDesired) pLayoutPro->AddChangedContainer((CXFA_Node*)m_pDocument->GetXFANode(XFA_HASHCODE_Form)); return 0; } -FX_INT32 CXFA_Node::InstanceManager_MoveInstance(FX_INT32 iTo, FX_INT32 iFrom) +int32_t CXFA_Node::InstanceManager_MoveInstance(int32_t iTo, int32_t iFrom) { - FX_INT32 iCount = XFA_ScriptInstanceManager_GetCount(this); + int32_t iCount = XFA_ScriptInstanceManager_GetCount(this); if (iFrom > iCount || iTo > iCount - 1) { ThrowScriptErrorMessage(XFA_IDS_INDEX_OUT_OF_BOUNDS); return 1; @@ -3137,7 +3137,7 @@ void CXFA_Node::Script_Occur_Max(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTR { CXFA_Occur occur(this); if (bSetting) { - FX_INT32 iMax = FXJSE_Value_ToInteger(hValue); + int32_t iMax = FXJSE_Value_ToInteger(hValue); occur.SetMax(iMax); } else { FXJSE_Value_SetInteger(hValue, occur.GetMax()); @@ -3147,7 +3147,7 @@ void CXFA_Node::Script_Occur_Min(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTR { CXFA_Occur occur(this); if (bSetting) { - FX_INT32 iMin = FXJSE_Value_ToInteger(hValue); + int32_t iMin = FXJSE_Value_ToInteger(hValue); occur.SetMin(iMin); } else { FXJSE_Value_SetInteger(hValue, occur.GetMin()); @@ -3155,7 +3155,7 @@ void CXFA_Node::Script_Occur_Min(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTR } void CXFA_Node::Script_Desc_Metadata(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if ((argc == 0) || (argc == 1)) { FXJSE_Value_SetUTF8String(pArguments->GetReturnValue(), FX_BSTRC("")); } else { @@ -3164,12 +3164,12 @@ void CXFA_Node::Script_Desc_Metadata(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Form_FormNodes(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 1) { CXFA_Node * pDataNode = (CXFA_Node *)pArguments->GetObject(0); if (pDataNode) { CXFA_NodeArray formItems; - FX_INT32 iSize = pDataNode->GetBindItems(formItems); + int32_t iSize = pDataNode->GetBindItems(formItems); CXFA_ArrayNodeList *pFormNodes = FX_NEW CXFA_ArrayNodeList(m_pDocument); pFormNodes->SetArrayNodeList(formItems); FXJSE_Value_SetObject(pArguments->GetReturnValue(), (CXFA_Object*)pFormNodes, m_pDocument->GetScriptContext()->GetJseNormalClass()); @@ -3182,7 +3182,7 @@ void CXFA_Node::Script_Form_FormNodes(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Form_Remerge(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { m_pDocument->DoDataRemerge(TRUE); } else { @@ -3191,7 +3191,7 @@ void CXFA_Node::Script_Form_Remerge(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Form_ExecInitialize(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { @@ -3208,7 +3208,7 @@ void CXFA_Node::Script_Form_Recalculate(CFXJSE_Arguments* pArguments) if (pEventParam->m_eType == XFA_EVENT_Calculate || pEventParam->m_eType == XFA_EVENT_InitCalculate) { return; } - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 1) { FX_BOOL bScriptFlags = pArguments->GetInt32(0) == 0 ? FALSE : TRUE; IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); @@ -3227,7 +3227,7 @@ void CXFA_Node::Script_Form_Recalculate(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Form_ExecCalculate(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { @@ -3240,13 +3240,13 @@ void CXFA_Node::Script_Form_ExecCalculate(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Form_ExecValidate(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); } else { - FX_INT32 iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); + int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); } } else { @@ -3267,7 +3267,7 @@ void CXFA_Node::Script_Form_Checksum(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ } void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 1) { CFX_ByteString bsAttributeName = pArguments->GetUTF8String(0); CFX_WideString wsAttributeValue; @@ -3282,7 +3282,7 @@ void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Packet_SetAttribute(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 2) { CFX_ByteString bsValue = pArguments->GetUTF8String(0); CFX_ByteString bsName = pArguments->GetUTF8String(1); @@ -3297,7 +3297,7 @@ void CXFA_Node::Script_Packet_SetAttribute(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Packet_RemoveAttribute(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 1) { CFX_ByteString bsName = pArguments->GetUTF8String(0); CFX_WideString wsName = CFX_WideString::FromUTF8(bsName, bsName.GetLength()); @@ -3335,7 +3335,7 @@ void CXFA_Node::Script_Packet_Content(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA } void CXFA_Node::Script_Source_Next(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"next"); @@ -3343,7 +3343,7 @@ void CXFA_Node::Script_Source_Next(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_CancelBatch(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"cancelBatch"); @@ -3351,7 +3351,7 @@ void CXFA_Node::Script_Source_CancelBatch(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_First(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"first"); @@ -3359,7 +3359,7 @@ void CXFA_Node::Script_Source_First(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_UpdateBatch(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"updateBatch"); @@ -3367,7 +3367,7 @@ void CXFA_Node::Script_Source_UpdateBatch(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_Previous(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"previous"); @@ -3375,7 +3375,7 @@ void CXFA_Node::Script_Source_Previous(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_IsBOF(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"isBOF"); @@ -3383,7 +3383,7 @@ void CXFA_Node::Script_Source_IsBOF(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_IsEOF(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"isEOF"); @@ -3391,7 +3391,7 @@ void CXFA_Node::Script_Source_IsEOF(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_Cancel(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"cancel"); @@ -3399,7 +3399,7 @@ void CXFA_Node::Script_Source_Cancel(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_Update(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"update"); @@ -3407,7 +3407,7 @@ void CXFA_Node::Script_Source_Update(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_Open(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"open"); @@ -3415,7 +3415,7 @@ void CXFA_Node::Script_Source_Open(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_Delete(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"delete"); @@ -3423,7 +3423,7 @@ void CXFA_Node::Script_Source_Delete(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_AddNew(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"addNew"); @@ -3431,7 +3431,7 @@ void CXFA_Node::Script_Source_AddNew(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_Requery(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"requery"); @@ -3439,7 +3439,7 @@ void CXFA_Node::Script_Source_Requery(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_Resync(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resync"); @@ -3447,7 +3447,7 @@ void CXFA_Node::Script_Source_Resync(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_Close(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"close"); @@ -3455,7 +3455,7 @@ void CXFA_Node::Script_Source_Close(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_Last(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"last"); @@ -3463,7 +3463,7 @@ void CXFA_Node::Script_Source_Last(CFXJSE_Arguments* pArguments) } void CXFA_Node::Script_Source_HasDataChanged(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if (argc == 0) { } else { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"hasDataChanged"); @@ -3507,11 +3507,11 @@ enum XFA_KEYTYPE { FX_LPVOID XFA_GetMapKey_Custom(FX_WSTR wsKey) { FX_DWORD dwKey = FX_HashCode_String_GetW(wsKey.GetPtr(), wsKey.GetLength()); - return (FX_LPVOID)(FX_UINTPTR)((dwKey << 1) | XFA_KEYTYPE_Custom); + return (FX_LPVOID)(uintptr_t)((dwKey << 1) | XFA_KEYTYPE_Custom); } FX_LPVOID XFA_GetMapKey_Element(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute) { - return (FX_LPVOID)(FX_UINTPTR)((eElement << 16) | (eAttribute << 8) | XFA_KEYTYPE_Element); + return (FX_LPVOID)(uintptr_t)((eElement << 16) | (eAttribute << 8) | XFA_KEYTYPE_Element); } static inline FX_BOOL XFA_NodeData_PrepareKey(XFA_ELEMENT eElem, XFA_ATTRIBUTE eAttr, FX_LPVOID &pKey) { @@ -3540,7 +3540,7 @@ FX_BOOL CXFA_Node::SetAttribute(XFA_ATTRIBUTE eAttr, FX_WSTR wsValue, FX_BOOL bN switch (eType) { case XFA_ATTRIBUTETYPE_Enum: { XFA_LPCATTRIBUTEENUMINFO pEnum = XFA_GetAttributeEnumByName(wsValue); - return SetEnum(pAttr->eName, pEnum ? pEnum->eName : (XFA_ATTRIBUTEENUM)(FX_INTPTR)(pAttr->pDefValue), bNotify); + return SetEnum(pAttr->eName, pEnum ? pEnum->eName : (XFA_ATTRIBUTEENUM)(intptr_t)(pAttr->pDefValue), bNotify); } break; case XFA_ATTRIBUTETYPE_Cdata: @@ -3596,7 +3596,7 @@ FX_BOOL CXFA_Node::GetAttribute(XFA_ATTRIBUTE eAttr, CFX_WideString &wsValue, FX } break; case XFA_ATTRIBUTETYPE_Integer: { - FX_INT32 iValue; + int32_t iValue; if (!TryInteger(pAttr->eName, iValue, bUseDefault)) { return FALSE; } @@ -3653,16 +3653,16 @@ FX_BOOL CXFA_Node::TryBoolean(XFA_ATTRIBUTE eAttr, FX_BOOL &bValue, FX_BOOL bUse if (!GetValue(eAttr, XFA_ATTRIBUTETYPE_Boolean, bUseDefault, pValue)) { return FALSE; } - bValue = (FX_BOOL)(FX_UINTPTR)pValue; + bValue = (FX_BOOL)(uintptr_t)pValue; return TRUE; } -FX_BOOL CXFA_Node::TryInteger(XFA_ATTRIBUTE eAttr, FX_INT32 &iValue, FX_BOOL bUseDefault) +FX_BOOL CXFA_Node::TryInteger(XFA_ATTRIBUTE eAttr, int32_t &iValue, FX_BOOL bUseDefault) { FX_LPVOID pValue = NULL; if (!GetValue(eAttr, XFA_ATTRIBUTETYPE_Integer, bUseDefault, pValue)) { return FALSE; } - iValue = (FX_INT32)(FX_UINTPTR)pValue; + iValue = (int32_t)(uintptr_t)pValue; return TRUE; } FX_BOOL CXFA_Node::TryEnum(XFA_ATTRIBUTE eAttr, XFA_ATTRIBUTEENUM &eValue, FX_BOOL bUseDefault) @@ -3671,7 +3671,7 @@ FX_BOOL CXFA_Node::TryEnum(XFA_ATTRIBUTE eAttr, XFA_ATTRIBUTEENUM &eValue, FX_BO if (!GetValue(eAttr, XFA_ATTRIBUTETYPE_Enum, bUseDefault, pValue)) { return FALSE; } - eValue = (XFA_ATTRIBUTEENUM)(FX_UINTPTR)pValue; + eValue = (XFA_ATTRIBUTEENUM)(uintptr_t)pValue; return TRUE; } FX_BOOL CXFA_Node::SetMeasure(XFA_ATTRIBUTE eAttr, CXFA_Measurement mValue, FX_BOOL bNotify ) @@ -3692,7 +3692,7 @@ FX_BOOL CXFA_Node::TryMeasure(XFA_ATTRIBUTE eAttr, CXFA_Measurement &mValue, FX_ return FALSE; } FX_LPVOID pValue; - FX_INT32 iBytes; + int32_t iBytes; if(GetMapModuleBuffer(pKey, pValue, iBytes) && iBytes == sizeof(mValue)) { FX_memcpy(&mValue, pValue, sizeof(mValue)); return TRUE; @@ -3906,13 +3906,13 @@ FX_BOOL CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr, XFA_ATTRIBUTETYPE eType, FX_LPV if (pInfo) { switch (eType) { case XFA_ATTRIBUTETYPE_Enum: - ((IFDE_XMLElement*)m_pXMLNode)->SetString(pInfo->pName, XFA_GetAttributeEnumByID((XFA_ATTRIBUTEENUM)(FX_UINTPTR)pValue)->pName); + ((IFDE_XMLElement*)m_pXMLNode)->SetString(pInfo->pName, XFA_GetAttributeEnumByID((XFA_ATTRIBUTEENUM)(uintptr_t)pValue)->pName); break; case XFA_ATTRIBUTETYPE_Boolean: ((IFDE_XMLElement*)m_pXMLNode)->SetString(pInfo->pName, pValue ? FX_WSTRC(L"1") : FX_WSTRC(L"0")); break; case XFA_ATTRIBUTETYPE_Integer: - ((IFDE_XMLElement*)m_pXMLNode)->SetInteger(pInfo->pName, (FX_INT32)(FX_UINTPTR)pValue); + ((IFDE_XMLElement*)m_pXMLNode)->SetInteger(pInfo->pName, (int32_t)(uintptr_t)pValue); break; default: FXSYS_assert(0); @@ -3946,7 +3946,7 @@ FX_BOOL CXFA_Node::SetUserData(FX_LPVOID pKey, FX_LPVOID pData, XFA_MAPDATABLOCK } FX_BOOL CXFA_Node::TryUserData(FX_LPVOID pKey, FX_LPVOID &pData, FX_BOOL bProtoAlso) { - FX_INT32 iBytes = 0; + int32_t iBytes = 0; if (!GetMapModuleBuffer(pKey, pData, iBytes, bProtoAlso)) { return FALSE; } @@ -3967,11 +3967,11 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, const CFX_W CXFA_Node *pBind = GetBindData(); if (bSyncData && pBind) { CFX_WideStringArray wsSaveTextArray; - FX_INT32 iSize = 0; + int32_t iSize = 0; if (!wsContent.IsEmpty()) { - FX_INT32 iStart = 0; - FX_INT32 iLength = wsContent.GetLength(); - FX_INT32 iEnd = wsContent.Find(L'\n', iStart); + int32_t iStart = 0; + int32_t iLength = wsContent.GetLength(); + int32_t iEnd = wsContent.Find(L'\n', iStart); iEnd = (iEnd == -1) ? iLength : iEnd; while (iEnd >= iStart) { wsSaveTextArray.Add(wsContent.Mid(iStart, iEnd - iStart)); @@ -3992,9 +3992,9 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, const CFX_W } } else { CXFA_NodeArray valueNodes; - FX_INT32 iDatas = pBind->GetNodeList(valueNodes, XFA_NODEFILTER_Children, XFA_ELEMENT_DataValue); + int32_t iDatas = pBind->GetNodeList(valueNodes, XFA_NODEFILTER_Children, XFA_ELEMENT_DataValue); if (iDatas < iSize) { - FX_INT32 iAddNodes = iSize - iDatas; + int32_t iAddNodes = iSize - iDatas; CXFA_Node *pValueNodes = NULL; while (iAddNodes-- > 0) { pValueNodes = pBind->CreateSamePacketNode(XFA_ELEMENT_DataValue); @@ -4004,12 +4004,12 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, const CFX_W } pValueNodes = NULL; } else if (iDatas > iSize) { - FX_INT32 iDelNodes = iDatas - iSize; + int32_t iDelNodes = iDatas - iSize; while (iDelNodes-- > 0) { pBind->RemoveChild(pBind->GetNodeItem(XFA_NODEITEM_FirstChild)); } } - FX_INT32 i = 0; + int32_t i = 0; for (CXFA_Node *pValueNode = pBind->GetNodeItem(XFA_NODEITEM_FirstChild); pValueNode; pValueNode = pValueNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { pValueNode->SetAttributeValue(wsSaveTextArray[i], wsSaveTextArray[i], FALSE); i++; @@ -4017,7 +4017,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, const CFX_W } CXFA_NodeArray nodeArray; pBind->GetBindItems(nodeArray); - for (FX_INT32 i = 0; i < nodeArray.GetSize(); i++) { + for (int32_t i = 0; i < nodeArray.GetSize(); i++) { CXFA_Node* pNode = nodeArray[i]; if (pNode == this) { continue; @@ -4039,7 +4039,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, const CFX_W pBindNode->SetScriptContent(wsContent, wsXMLValue, bNotify, bScriptModify, FALSE); CXFA_NodeArray nodeArray; pBindNode->GetBindItems(nodeArray); - for (FX_INT32 i = 0; i < nodeArray.GetSize(); i++) { + for (int32_t i = 0; i < nodeArray.GetSize(); i++) { CXFA_Node* pNode = nodeArray[i]; if (pNode == this) { continue; @@ -4101,7 +4101,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, const CFX_W if (pBindNode && bSyncData) { CXFA_NodeArray nodeArray; pBindNode->GetBindItems(nodeArray); - for (FX_INT32 i = 0; i < nodeArray.GetSize(); i++) { + for (int32_t i = 0; i < nodeArray.GetSize(); i++) { CXFA_Node* pNode = nodeArray[i]; pNode->SetScriptContent(wsContent, wsContent, bNotify, bScriptModify, FALSE); } @@ -4234,7 +4234,7 @@ FX_BOOL CXFA_Node::TryNamespace(CFX_WideString& wsNamespace) return pModelNode->TryNamespace(wsNamespace); } } -CXFA_Node* CXFA_Node::GetProperty(FX_INT32 index, XFA_ELEMENT eProperty, FX_BOOL bCreateProperty ) +CXFA_Node* CXFA_Node::GetProperty(int32_t index, XFA_ELEMENT eProperty, FX_BOOL bCreateProperty ) { XFA_ELEMENT eElement = GetClassID(); FX_DWORD dwPacket = GetPacketID(); @@ -4243,7 +4243,7 @@ CXFA_Node* CXFA_Node::GetProperty(FX_INT32 index, XFA_ELEMENT eProperty, FX_BOOL return NULL; } CXFA_Node *pNode = m_pChild; - FX_INT32 iCount = 0; + int32_t iCount = 0; for(; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pNode->GetClassID() == eProperty) { iCount ++; @@ -4277,10 +4277,10 @@ CXFA_Node* CXFA_Node::GetProperty(FX_INT32 index, XFA_ELEMENT eProperty, FX_BOOL } return pNewNode; } -FX_INT32 CXFA_Node::CountChildren(XFA_ELEMENT eElement, FX_BOOL bOnlyChild) +int32_t CXFA_Node::CountChildren(XFA_ELEMENT eElement, FX_BOOL bOnlyChild) { CXFA_Node *pNode = m_pChild; - FX_INT32 iCount = 0; + int32_t iCount = 0; for(; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pNode->GetClassID() == eElement || eElement == XFA_ELEMENT_UNKNOWN) { if(bOnlyChild) { @@ -4294,11 +4294,11 @@ FX_INT32 CXFA_Node::CountChildren(XFA_ELEMENT eElement, FX_BOOL bOnlyChild) } return iCount; } -CXFA_Node* CXFA_Node::GetChild(FX_INT32 index, XFA_ELEMENT eElement, FX_BOOL bOnlyChild) +CXFA_Node* CXFA_Node::GetChild(int32_t index, XFA_ELEMENT eElement, FX_BOOL bOnlyChild) { FXSYS_assert(index > -1); CXFA_Node *pNode = m_pChild; - FX_INT32 iCount = 0; + int32_t iCount = 0; for(; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pNode->GetClassID() == eElement || eElement == XFA_ELEMENT_UNKNOWN) { if(bOnlyChild) { @@ -4315,7 +4315,7 @@ CXFA_Node* CXFA_Node::GetChild(FX_INT32 index, XFA_ELEMENT eElement, FX_BOOL bOn } return NULL; } -FX_INT32 CXFA_Node::InsertChild(FX_INT32 index, CXFA_Node *pNode) +int32_t CXFA_Node::InsertChild(int32_t index, CXFA_Node *pNode) { ASSERT(pNode != NULL && pNode->m_pNext == NULL); pNode->m_pParent = this; @@ -4332,7 +4332,7 @@ FX_INT32 CXFA_Node::InsertChild(FX_INT32 index, CXFA_Node *pNode) m_pLastChild->m_pNext = pNode; } else { CXFA_Node *pPrev = m_pChild; - FX_INT32 iCount = 0; + int32_t iCount = 0; while (++iCount != index && pPrev->m_pNext) { pPrev = pPrev->m_pNext; } @@ -4367,7 +4367,7 @@ FX_BOOL CXFA_Node::InsertChild(CXFA_Node *pNode, CXFA_Node *pBeforeNode) } FX_BOOL bWasPurgeNode = m_pDocument->RemovePurgeNode(pNode); FXSYS_assert(bWasPurgeNode == TRUE); - FX_INT32 nIndex = -1; + int32_t nIndex = -1; pNode->m_pParent = this; if (m_pChild == NULL || pBeforeNode == m_pChild) { pNode->m_pNext = m_pChild; @@ -4508,7 +4508,7 @@ CXFA_Node* CXFA_Node::GetNextSameClassSibling(XFA_ELEMENT eElement) const } return NULL; } -FX_INT32 CXFA_Node::GetNodeSameNameIndex() const +int32_t CXFA_Node::GetNodeSameNameIndex() const { IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { @@ -4516,7 +4516,7 @@ FX_INT32 CXFA_Node::GetNodeSameNameIndex() const } return pScriptContext->GetIndexByName((CXFA_Node*)this); } -FX_INT32 CXFA_Node::GetNodeSameClassIndex() const +int32_t CXFA_Node::GetNodeSameClassIndex() const { IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { @@ -4612,22 +4612,22 @@ void CXFA_Node::OnChanging(XFA_ATTRIBUTE eAttr, FX_LPVOID pNewValue, FX_BOOL bNo if (bNotify && HasFlag(XFA_NODEFLAG_Initialized)) { IXFA_Notify *pNotify = m_pDocument->GetParser()->GetNotify(); if (pNotify) { - pNotify->OnNodeEvent(this, XFA_NODEEVENT_ValueChanging, (FX_LPVOID)(FX_UINTPTR)eAttr, pNewValue); + pNotify->OnNodeEvent(this, XFA_NODEEVENT_ValueChanging, (FX_LPVOID)(uintptr_t)eAttr, pNewValue); } } } void CXFA_Node::OnChanged(XFA_ATTRIBUTE eAttr, FX_LPVOID pNewValue, FX_BOOL bNotify, FX_BOOL bScriptModify) { if (bNotify && HasFlag(XFA_NODEFLAG_Initialized)) { - Script_Attribute_SendAttributeChangeMessage((FX_LPVOID)(FX_UINTPTR)eAttr, pNewValue, bScriptModify); + Script_Attribute_SendAttributeChangeMessage((FX_LPVOID)(uintptr_t)eAttr, pNewValue, bScriptModify); } } -FX_INT32 CXFA_Node::execSingleEventByName(FX_WSTR wsEventName, XFA_ELEMENT eElementType) +int32_t CXFA_Node::execSingleEventByName(FX_WSTR wsEventName, XFA_ELEMENT eElementType) { - FX_INT32 iRet = XFA_EVENTERROR_NotExist; + int32_t iRet = XFA_EVENTERROR_NotExist; const XFA_ExecEventParaInfo* eventParaInfo = GetEventParaInfoByName(wsEventName); if (eventParaInfo) { - FX_UINT32 validFlags = eventParaInfo->m_validFlags; + uint32_t validFlags = eventParaInfo->m_validFlags; IXFA_Notify * pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return iRet; @@ -4730,14 +4730,14 @@ void CXFA_Node::SetMapModuleString(FX_LPVOID pKey, FX_WSTR wsValue) FX_BOOL CXFA_Node::GetMapModuleString(FX_LPVOID pKey, CFX_WideStringC &wsValue) { FX_LPVOID pValue; - FX_INT32 iBytes; + int32_t iBytes; if (!GetMapModuleBuffer(pKey, pValue, iBytes)) { return FALSE; } wsValue = CFX_WideStringC((FX_LPCWSTR)pValue, iBytes / sizeof(FX_WCHAR)); return TRUE; } -void CXFA_Node::SetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID pValue, FX_INT32 iBytes, XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo ) +void CXFA_Node::SetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID pValue, int32_t iBytes, XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo ) { XFA_LPMAPMODULEDATA pMoudle = this->GetMapModuleData(TRUE); if (!pMoudle) { @@ -4745,12 +4745,12 @@ void CXFA_Node::SetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID pValue, FX_INT32 iB } XFA_LPMAPDATABLOCK &pBuffer = pMoudle->m_BufferMap[pKey]; if (pBuffer == NULL) { - pBuffer = (XFA_LPMAPDATABLOCK)FX_Alloc(FX_BYTE, sizeof(XFA_MAPDATABLOCK) + iBytes); + pBuffer = (XFA_LPMAPDATABLOCK)FX_Alloc(uint8_t, sizeof(XFA_MAPDATABLOCK) + iBytes); } else if (pBuffer->iBytes != iBytes) { if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); } - pBuffer = (XFA_LPMAPDATABLOCK)FX_Realloc(FX_BYTE, pBuffer, sizeof(XFA_MAPDATABLOCK) + iBytes); + pBuffer = (XFA_LPMAPDATABLOCK)FX_Realloc(uint8_t, pBuffer, sizeof(XFA_MAPDATABLOCK) + iBytes); } else if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); } @@ -4761,7 +4761,7 @@ void CXFA_Node::SetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID pValue, FX_INT32 iB pBuffer->iBytes = iBytes; FXSYS_memcpy(pBuffer->GetData(), pValue, iBytes); } -FX_BOOL CXFA_Node::GetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID &pValue, FX_INT32 &iBytes, FX_BOOL bProtoAlso) +FX_BOOL CXFA_Node::GetMapModuleBuffer(FX_LPVOID pKey, FX_LPVOID &pValue, int32_t &iBytes, FX_BOOL bProtoAlso) { XFA_LPMAPDATABLOCK pBuffer = NULL; CXFA_Node* pNode = this; @@ -4865,12 +4865,12 @@ void CXFA_Node::MergeAllData(FX_LPVOID pDstModule, FX_BOOL bUseSrcAttr ) continue; } if (pBuffer == NULL) { - pBuffer = (XFA_LPMAPDATABLOCK)FX_Alloc(FX_BYTE, sizeof(XFA_MAPDATABLOCK) + pSrcBuffer->iBytes); + pBuffer = (XFA_LPMAPDATABLOCK)FX_Alloc(uint8_t, sizeof(XFA_MAPDATABLOCK) + pSrcBuffer->iBytes); } else if (pBuffer->iBytes != pSrcBuffer->iBytes) { if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); } - pBuffer = (XFA_LPMAPDATABLOCK)FX_Realloc(FX_BYTE, pBuffer, sizeof(XFA_MAPDATABLOCK) + pSrcBuffer->iBytes); + pBuffer = (XFA_LPMAPDATABLOCK)FX_Realloc(uint8_t, pBuffer, sizeof(XFA_MAPDATABLOCK) + pSrcBuffer->iBytes); } else if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); } @@ -4948,9 +4948,9 @@ CXFA_NodeList::CXFA_NodeList(CXFA_Document* pDocument) } CXFA_Node* CXFA_NodeList::NamedItem(FX_WSTR wsName) { - FX_INT32 iCount = GetLength(); + int32_t iCount = GetLength(); FX_DWORD dwHashCode = FX_HashCode_String_GetW(wsName.GetPtr(), wsName.GetLength()); - for (FX_INT32 i = 0; i < iCount; i++) { + for (int32_t i = 0; i < iCount; i++) { CXFA_Node* ret = Item(i); if (dwHashCode == ret->GetNameHash()) { return ret; @@ -4960,7 +4960,7 @@ CXFA_Node* CXFA_NodeList::NamedItem(FX_WSTR wsName) } void CXFA_NodeList::Script_ListClass_Append(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if(argc == 1) { CXFA_Node *pNode = (CXFA_Node *)pArguments->GetObject(0); if(pNode) { @@ -4974,7 +4974,7 @@ void CXFA_NodeList::Script_ListClass_Append(CFXJSE_Arguments* pArguments) } void CXFA_NodeList::Script_ListClass_Insert(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if(argc == 2) { CXFA_Node *pNewNode = (CXFA_Node *)pArguments->GetObject(0); CXFA_Node *pBeforeNode = (CXFA_Node *)pArguments->GetObject(1); @@ -4989,7 +4989,7 @@ void CXFA_NodeList::Script_ListClass_Insert(CFXJSE_Arguments* pArguments) } void CXFA_NodeList::Script_ListClass_Remove(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if(argc == 1) { CXFA_Node *pNode = (CXFA_Node *)pArguments->GetObject(0); if(pNode) { @@ -5003,9 +5003,9 @@ void CXFA_NodeList::Script_ListClass_Remove(CFXJSE_Arguments* pArguments) } void CXFA_NodeList::Script_ListClass_Item(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if(argc == 1) { - FX_INT32 iIndex = pArguments->GetInt32(0); + int32_t iIndex = pArguments->GetInt32(0); if((iIndex >= 0) && (iIndex + 1 <= GetLength())) { FXJSE_Value_Set(pArguments->GetReturnValue(), m_pDocument->GetScriptContext()->GetJSValueFromMap(Item(iIndex))); } else { @@ -5017,7 +5017,7 @@ void CXFA_NodeList::Script_ListClass_Item(CFXJSE_Arguments* pArguments) } void CXFA_NodeList::Script_TreelistClass_NamedItem(CFXJSE_Arguments* pArguments) { - FX_INT32 argc = pArguments->GetLength(); + int32_t argc = pArguments->GetLength(); if(argc == 1) { CFX_ByteString szName = pArguments->GetUTF8String(0); CXFA_Node* pNode = NamedItem(CFX_WideString::FromUTF8(szName, szName.GetLength())); @@ -5047,7 +5047,7 @@ void CXFA_ArrayNodeList::SetArrayNodeList(const CXFA_NodeArray &srcArray) m_array.Copy(srcArray); } } -FX_INT32 CXFA_ArrayNodeList::GetLength() +int32_t CXFA_ArrayNodeList::GetLength() { return m_array.GetSize(); } @@ -5061,8 +5061,8 @@ FX_BOOL CXFA_ArrayNodeList::Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) if (pBeforeNode == NULL) { m_array.Add(pNewNode); } else { - FX_INT32 iSize = m_array.GetSize(); - for (FX_INT32 i = 0; i < iSize; ++i) { + int32_t iSize = m_array.GetSize(); + for (int32_t i = 0; i < iSize; ++i) { if (m_array[i] == pBeforeNode) { m_array.InsertAt(i, pNewNode); break; @@ -5073,8 +5073,8 @@ FX_BOOL CXFA_ArrayNodeList::Insert(CXFA_Node* pNewNode, CXFA_Node* pBeforeNode) } FX_BOOL CXFA_ArrayNodeList::Remove(CXFA_Node* pNode) { - FX_INT32 iSize = m_array.GetSize(); - for (FX_INT32 i = 0; i < iSize; ++i) { + int32_t iSize = m_array.GetSize(); + for (int32_t i = 0; i < iSize; ++i) { if (m_array[i] == pNode) { m_array.RemoveAt(i); break; @@ -5082,9 +5082,9 @@ FX_BOOL CXFA_ArrayNodeList::Remove(CXFA_Node* pNode) } return TRUE; } -CXFA_Node* CXFA_ArrayNodeList::Item(FX_INT32 iIndex) +CXFA_Node* CXFA_ArrayNodeList::Item(int32_t iIndex) { - FX_INT32 iSize = m_array.GetSize(); + int32_t iSize = m_array.GetSize(); if (iIndex >= 0 && iIndex < iSize) { return m_array[iIndex]; } @@ -5095,7 +5095,7 @@ CXFA_AttachNodeList::CXFA_AttachNodeList(CXFA_Document* pDocument, CXFA_Node* pA { m_pAttachNode = pAttachNode; } -FX_INT32 CXFA_AttachNodeList::GetLength() +int32_t CXFA_AttachNodeList::GetLength() { return m_pAttachNode->CountChildren(XFA_ELEMENT_UNKNOWN, m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform ? TRUE : FALSE); } @@ -5119,7 +5119,7 @@ FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { return m_pAttachNode->RemoveChild(pNode); } -CXFA_Node* CXFA_AttachNodeList::Item(FX_INT32 iIndex) +CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) { return m_pAttachNode->GetChild(iIndex, XFA_ELEMENT_UNKNOWN, m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform ? TRUE : FALSE); } diff --git a/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp b/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp index c6ece3691b..1cc9d4aa03 100644 --- a/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_objectacc_imp.cpp @@ -18,7 +18,7 @@ #include "xfa_debug_parser.h" static FX_ARGB XFA_WStringToColor(FX_WSTR wsValue) { - FX_BYTE r = 0, g = 0, b = 0; + uint8_t r = 0, g = 0, b = 0; if (wsValue.GetLength() == 0) { return 0xff000000; } @@ -91,7 +91,7 @@ CXFA_Fill::CXFA_Fill(CXFA_Node* pNode) CXFA_Fill::~CXFA_Fill() { } -FX_INT32 CXFA_Fill::GetPresence() +int32_t CXFA_Fill::GetPresence() { return m_pNode->GetEnum(XFA_ATTRIBUTE_Presence); } @@ -117,11 +117,11 @@ FX_ARGB CXFA_Fill::GetColor(FX_BOOL bText) } return 0xFFFFFFFF; } -FX_INT32 CXFA_Fill::GetFillType() +int32_t CXFA_Fill::GetFillType() { CXFA_Node* pChild = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); while (pChild) { - FX_INT32 eType = pChild->GetClassID(); + int32_t eType = pChild->GetClassID(); if (eType != XFA_ELEMENT_Color && eType != XFA_ELEMENT_Extras) { return eType; } @@ -129,7 +129,7 @@ FX_INT32 CXFA_Fill::GetFillType() } return XFA_ELEMENT_Solid; } -FX_INT32 CXFA_Fill::GetPattern(FX_ARGB& foreColor) +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)) { @@ -141,10 +141,10 @@ FX_INT32 CXFA_Fill::GetPattern(FX_ARGB& foreColor) } return pNode->GetEnum(XFA_ATTRIBUTE_Type); } -FX_INT32 CXFA_Fill::GetStipple(FX_ARGB& stippleColor) +int32_t CXFA_Fill::GetStipple(FX_ARGB& stippleColor) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Stipple); - FX_INT32 eAttr = 50; + int32_t eAttr = 50; pNode->TryInteger(XFA_ATTRIBUTE_Rate, eAttr); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_ELEMENT_Color)) { CFX_WideStringC wsColor; @@ -155,7 +155,7 @@ FX_INT32 CXFA_Fill::GetStipple(FX_ARGB& stippleColor) } return eAttr; } -FX_INT32 CXFA_Fill::GetLinear(FX_ARGB& endColor) +int32_t CXFA_Fill::GetLinear(FX_ARGB& endColor) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Linear); XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_ToRight; @@ -169,7 +169,7 @@ FX_INT32 CXFA_Fill::GetLinear(FX_ARGB& endColor) } return eAttr; } -FX_INT32 CXFA_Fill::GetRadial(FX_ARGB& endColor) +int32_t CXFA_Fill::GetRadial(FX_ARGB& endColor) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Radial); XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_ToEdge; @@ -183,15 +183,15 @@ FX_INT32 CXFA_Fill::GetRadial(FX_ARGB& endColor) } return eAttr; } -FX_BOOL CXFA_Fill::SetPresence(FX_INT32 iPresence) +FX_BOOL CXFA_Fill::SetPresence(int32_t iPresence) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Presence, (XFA_ATTRIBUTEENUM)iPresence); } -FX_BOOL CXFA_Fill::SetFillType(FX_INT32 iType) +FX_BOOL CXFA_Fill::SetFillType(int32_t iType) { return FALSE; } -FX_BOOL CXFA_Fill::SetPattern(FX_INT32 iPattern, FX_ARGB foreColor) +FX_BOOL CXFA_Fill::SetPattern(int32_t iPattern, FX_ARGB foreColor) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Pattern); CXFA_Node* pColor = pNode->GetProperty(0, XFA_ELEMENT_Color); @@ -202,7 +202,7 @@ FX_BOOL CXFA_Fill::SetPattern(FX_INT32 iPattern, FX_ARGB foreColor) pColor->SetCData(XFA_ATTRIBUTE_Value, wsColor); return pNode->SetEnum(XFA_ATTRIBUTE_Type, (XFA_ATTRIBUTEENUM)iPattern); } -FX_BOOL CXFA_Fill::SetStipple(FX_INT32 iStipple, FX_ARGB stippleColor) +FX_BOOL CXFA_Fill::SetStipple(int32_t iStipple, FX_ARGB stippleColor) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Stipple); CXFA_Node* pColor = pNode->GetProperty(0, XFA_ELEMENT_Color); @@ -213,7 +213,7 @@ FX_BOOL CXFA_Fill::SetStipple(FX_INT32 iStipple, FX_ARGB stippleColor) pColor->SetCData(XFA_ATTRIBUTE_Value, wsColor); return pNode->SetEnum(XFA_ATTRIBUTE_Rate, (XFA_ATTRIBUTEENUM)iStipple); } -FX_BOOL CXFA_Fill::SetLinear(FX_INT32 iLinear, FX_ARGB endColor) +FX_BOOL CXFA_Fill::SetLinear(int32_t iLinear, FX_ARGB endColor) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Linear); CXFA_Node* pColor = pNode->GetProperty(0, XFA_ELEMENT_Color); @@ -224,7 +224,7 @@ FX_BOOL CXFA_Fill::SetLinear(FX_INT32 iLinear, FX_ARGB endColor) pColor->SetCData(XFA_ATTRIBUTE_Value, wsColor); return pNode->SetEnum(XFA_ATTRIBUTE_Type, (XFA_ATTRIBUTEENUM)iLinear); } -FX_BOOL CXFA_Fill::SetRadial(FX_INT32 iRadial, FX_ARGB endColor) +FX_BOOL CXFA_Fill::SetRadial(int32_t iRadial, FX_ARGB endColor) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Radial); CXFA_Node* pColor = pNode->GetProperty(0, XFA_ELEMENT_Color); @@ -287,14 +287,14 @@ FX_FLOAT CXFA_Font::GetHorizontalScale() { CFX_WideString wsValue; m_pNode->TryCData(XFA_ATTRIBUTE_FontHorizontalScale, wsValue); - FX_INT32 iScale = FXSYS_wtoi((FX_LPCWSTR)wsValue); + int32_t iScale = FXSYS_wtoi((FX_LPCWSTR)wsValue); return iScale > 0 ? (FX_FLOAT)iScale : 100.0f; } FX_FLOAT CXFA_Font::GetVerticalScale() { CFX_WideString wsValue; m_pNode->TryCData(XFA_ATTRIBUTE_FontVerticalScale, wsValue); - FX_INT32 iScale = FXSYS_wtoi((FX_LPCWSTR)wsValue); + int32_t iScale = FXSYS_wtoi((FX_LPCWSTR)wsValue); return iScale > 0 ? (FX_FLOAT)iScale : 100.0f; } FX_FLOAT CXFA_Font::GetLetterSpacing() @@ -309,37 +309,37 @@ FX_FLOAT CXFA_Font::GetLetterSpacing() } return ms.ToUnit(XFA_UNIT_Pt); } -FX_INT32 CXFA_Font::GetLineThrough() +int32_t CXFA_Font::GetLineThrough() { - FX_INT32 iValue = 0; + int32_t iValue = 0; m_pNode->TryInteger(XFA_ATTRIBUTE_LineThrough, iValue); return iValue; } -FX_INT32 CXFA_Font::GetLineThroughPeriod() +int32_t CXFA_Font::GetLineThroughPeriod() { XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_All; m_pNode->TryEnum(XFA_ATTRIBUTE_LineThroughPeriod, eAttr); return eAttr; } -FX_INT32 CXFA_Font::GetOverline() +int32_t CXFA_Font::GetOverline() { - FX_INT32 iValue = 0; + int32_t iValue = 0; m_pNode->TryInteger(XFA_ATTRIBUTE_Overline, iValue); return iValue; } -FX_INT32 CXFA_Font::GetOverlinePeriod() +int32_t CXFA_Font::GetOverlinePeriod() { XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_All; m_pNode->TryEnum(XFA_ATTRIBUTE_OverlinePeriod, eAttr); return eAttr; } -FX_INT32 CXFA_Font::GetUnderline() +int32_t CXFA_Font::GetUnderline() { - FX_INT32 iValue = 0; + int32_t iValue = 0; m_pNode->TryInteger(XFA_ATTRIBUTE_Underline, iValue); return iValue; } -FX_INT32 CXFA_Font::GetUnderlinePeriod() +int32_t CXFA_Font::GetUnderlinePeriod() { XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_All; m_pNode->TryEnum(XFA_ATTRIBUTE_UnderlinePeriod, eAttr); @@ -393,40 +393,40 @@ FX_BOOL CXFA_Font::SetBaselineShift(FX_FLOAT fBaselineShift) FX_BOOL CXFA_Font::SetHorizontalScale(FX_FLOAT fHorizontalScale) { CFX_WideString wsValue; - wsValue.Format(L"%d", (FX_INT32)fHorizontalScale); + wsValue.Format(L"%d", (int32_t)fHorizontalScale); return m_pNode->SetCData(XFA_ATTRIBUTE_FontHorizontalScale, wsValue); } FX_BOOL CXFA_Font::SetVerticalScale(FX_FLOAT fVerticalScale) { CFX_WideString wsValue; - wsValue.Format(L"%d", (FX_INT32)fVerticalScale); + wsValue.Format(L"%d", (int32_t)fVerticalScale); return m_pNode->SetCData(XFA_ATTRIBUTE_FontVerticalScale, wsValue); } FX_BOOL CXFA_Font::SetLetterSpacing(FX_FLOAT fLetterSpacing, XFA_UNIT eUnit) { return FALSE; } -FX_BOOL CXFA_Font::SetLineThrough(FX_INT32 iLineThrough) +FX_BOOL CXFA_Font::SetLineThrough(int32_t iLineThrough) { return m_pNode->SetInteger(XFA_ATTRIBUTE_LineThrough, iLineThrough); } -FX_BOOL CXFA_Font::SetLineThroughPeriod(FX_INT32 iLineThroughPeriod) +FX_BOOL CXFA_Font::SetLineThroughPeriod(int32_t iLineThroughPeriod) { return m_pNode->SetEnum(XFA_ATTRIBUTE_LineThroughPeriod, (XFA_ATTRIBUTEENUM)iLineThroughPeriod); } -FX_BOOL CXFA_Font::SetOverline(FX_INT32 iOverline) +FX_BOOL CXFA_Font::SetOverline(int32_t iOverline) { return m_pNode->SetInteger(XFA_ATTRIBUTE_Overline, iOverline); } -FX_BOOL CXFA_Font::SetOverlinePeriod(FX_INT32 iOverlinePeriod) +FX_BOOL CXFA_Font::SetOverlinePeriod(int32_t iOverlinePeriod) { return m_pNode->SetEnum(XFA_ATTRIBUTE_OverlinePeriod, (XFA_ATTRIBUTEENUM)iOverlinePeriod); } -FX_BOOL CXFA_Font::SetUnderline(FX_INT32 iUnderline) +FX_BOOL CXFA_Font::SetUnderline(int32_t iUnderline) { return m_pNode->SetInteger(XFA_ATTRIBUTE_Underline, iUnderline); } -FX_BOOL CXFA_Font::SetUnderlinePeriod(FX_INT32 iUnderlinePeriod) +FX_BOOL CXFA_Font::SetUnderlinePeriod(int32_t iUnderlinePeriod) { return m_pNode->SetEnum(XFA_ATTRIBUTE_UnderlinePeriod, (XFA_ATTRIBUTEENUM)iUnderlinePeriod); } @@ -434,13 +434,13 @@ CXFA_Caption::CXFA_Caption(CXFA_Node* pNode) : CXFA_Data(pNode) { } -FX_INT32 CXFA_Caption::GetPresence() +int32_t CXFA_Caption::GetPresence() { XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Visible; m_pNode->TryEnum(XFA_ATTRIBUTE_Presence, eAttr); return eAttr; } -FX_INT32 CXFA_Caption::GetPlacementType() +int32_t CXFA_Caption::GetPlacementType() { XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Left; m_pNode->TryEnum(XFA_ATTRIBUTE_Placement, eAttr); @@ -468,11 +468,11 @@ CXFA_Para CXFA_Caption::GetPara() { return CXFA_Para(m_pNode ? m_pNode->GetChild(0, XFA_ELEMENT_Para) : NULL); } -FX_BOOL CXFA_Caption::SetPresence(FX_INT32 iPresence) +FX_BOOL CXFA_Caption::SetPresence(int32_t iPresence) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Presence, (XFA_ATTRIBUTEENUM)iPresence); } -FX_BOOL CXFA_Caption::SetPlacementType(FX_INT32 iType) +FX_BOOL CXFA_Caption::SetPlacementType(int32_t iType) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Placement, (XFA_ATTRIBUTEENUM)iType); } @@ -485,13 +485,13 @@ CXFA_Para::CXFA_Para(CXFA_Node* pNode) : CXFA_Data(pNode) { } -FX_INT32 CXFA_Para::GetHorizontalAlign() +int32_t CXFA_Para::GetHorizontalAlign() { XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Left; m_pNode->TryEnum(XFA_ATTRIBUTE_HAlign, eAttr); return eAttr; } -FX_INT32 CXFA_Para::GetVerticalAlign() +int32_t CXFA_Para::GetVerticalAlign() { XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_Top; m_pNode->TryEnum(XFA_ATTRIBUTE_VAlign, eAttr); @@ -515,9 +515,9 @@ FX_FLOAT CXFA_Para::GetMarginRight() m_pNode->TryMeasure(XFA_ATTRIBUTE_MarginRight, ms); return ms.ToUnit(XFA_UNIT_Pt); } -FX_INT32 CXFA_Para::GetOrphans() +int32_t CXFA_Para::GetOrphans() { - FX_INT32 iValue = 0; + int32_t iValue = 0; m_pNode->TryInteger(XFA_ATTRIBUTE_Orphans, iValue); return iValue; } @@ -545,17 +545,17 @@ FX_FLOAT CXFA_Para::GetTextIndent() m_pNode->TryMeasure(XFA_ATTRIBUTE_TextIndent, ms); return ms.ToUnit(XFA_UNIT_Pt); } -FX_INT32 CXFA_Para::GetWidows() +int32_t CXFA_Para::GetWidows() { - FX_INT32 iValue = 0; + int32_t iValue = 0; m_pNode->TryInteger(XFA_ATTRIBUTE_Widows, iValue); return iValue; } -FX_BOOL CXFA_Para::SetHorizontalAlign(FX_INT32 iHorizontalAlign) +FX_BOOL CXFA_Para::SetHorizontalAlign(int32_t iHorizontalAlign) { return m_pNode->SetEnum(XFA_ATTRIBUTE_HAlign, (XFA_ATTRIBUTEENUM)iHorizontalAlign); } -FX_BOOL CXFA_Para::SetVerticalAlign(FX_INT32 iVerticalAlign) +FX_BOOL CXFA_Para::SetVerticalAlign(int32_t iVerticalAlign) { return m_pNode->SetEnum(XFA_ATTRIBUTE_VAlign, (XFA_ATTRIBUTEENUM)iVerticalAlign); } @@ -574,7 +574,7 @@ FX_BOOL CXFA_Para::SetMarginRight(FX_FLOAT fMarginRight) CXFA_Measurement ms(fMarginRight, XFA_UNIT_Pt); return m_pNode->SetMeasure(XFA_ATTRIBUTE_MarginRight, ms); } -FX_BOOL CXFA_Para::SetOrphans(FX_INT32 iOrphans) +FX_BOOL CXFA_Para::SetOrphans(int32_t iOrphans) { return m_pNode->SetInteger(XFA_ATTRIBUTE_Orphans, iOrphans); } @@ -598,7 +598,7 @@ FX_BOOL CXFA_Para::SetTextIndent(FX_FLOAT fTextIndent) CXFA_Measurement ms(fTextIndent, XFA_UNIT_Pt); return m_pNode->SetMeasure(XFA_ATTRIBUTE_TextIndent, ms); } -FX_BOOL CXFA_Para::SetWidows(FX_INT32 iWidows) +FX_BOOL CXFA_Para::SetWidows(int32_t iWidows) { return m_pNode->SetInteger(XFA_ATTRIBUTE_Widows, iWidows); } @@ -607,7 +607,7 @@ CXFA_Keep::CXFA_Keep(CXFA_Node *pNode, CXFA_Node *pParent) , m_pParent(pParent) { } -FX_INT32 CXFA_Keep::GetIntact() +int32_t CXFA_Keep::GetIntact() { XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_None; switch (m_pParent->GetClassID()) { @@ -628,27 +628,27 @@ FX_INT32 CXFA_Keep::GetIntact() m_pNode->TryEnum(XFA_ATTRIBUTE_Intact, eAttr, FALSE); return eAttr; } -FX_INT32 CXFA_Keep::GetNext() +int32_t CXFA_Keep::GetNext() { XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_None; m_pNode->TryEnum(XFA_ATTRIBUTE_Next, eAttr); return eAttr; } -FX_INT32 CXFA_Keep::GetPrevious() +int32_t CXFA_Keep::GetPrevious() { XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_None; m_pNode->TryEnum(XFA_ATTRIBUTE_Previous, eAttr); return eAttr; } -FX_BOOL CXFA_Keep::SetIntact(FX_INT32 iIntact) +FX_BOOL CXFA_Keep::SetIntact(int32_t iIntact) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Intact, (XFA_ATTRIBUTEENUM)iIntact); } -FX_BOOL CXFA_Keep::SetNext(FX_INT32 iNext) +FX_BOOL CXFA_Keep::SetNext(int32_t iNext) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Next, (XFA_ATTRIBUTEENUM)iNext); } -FX_BOOL CXFA_Keep::SetPrevious(FX_INT32 iPrevious) +FX_BOOL CXFA_Keep::SetPrevious(int32_t iPrevious) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Previous, (XFA_ATTRIBUTEENUM)iPrevious); } @@ -656,15 +656,15 @@ CXFA_Event::CXFA_Event(CXFA_Node* pNode) : CXFA_Data(pNode) { } -FX_INT32 CXFA_Event::GetActivity() +int32_t CXFA_Event::GetActivity() { return m_pNode->GetEnum(XFA_ATTRIBUTE_Activity); } -FX_INT32 CXFA_Event::GetEventType() +int32_t CXFA_Event::GetEventType() { CXFA_Node* pChild = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); while (pChild) { - FX_INT32 eType = pChild->GetClassID(); + int32_t eType = pChild->GetClassID(); if (eType != XFA_ELEMENT_Extras) { return eType; } @@ -676,12 +676,12 @@ void CXFA_Event::GetRef(CFX_WideStringC &wsRef) { m_pNode->TryCData(XFA_ATTRIBUTE_Ref, wsRef); } -FX_INT32 CXFA_Event::GetExecuteRunAt() +int32_t CXFA_Event::GetExecuteRunAt() { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Execute); return pNode->GetEnum(XFA_ATTRIBUTE_RunAt); } -FX_INT32 CXFA_Event::GetExecuteType() +int32_t CXFA_Event::GetExecuteType() { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Execute); return pNode->GetEnum(XFA_ATTRIBUTE_ExecuteType); @@ -701,7 +701,7 @@ CXFA_Submit CXFA_Event::GetSubmit() { return m_pNode->GetChild(0, XFA_ELEMENT_Submit); } -FX_INT32 CXFA_Event::GetSignDataOperation() +int32_t CXFA_Event::GetSignDataOperation() { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_SignData); return pNode->GetEnum(XFA_ATTRIBUTE_Operation); @@ -714,20 +714,20 @@ void CXFA_Event::GetSignDataTarget(CFX_WideString &wsTarget) wsTarget = wsCData; } } -FX_BOOL CXFA_Event::SetActivity(FX_INT32 iActivity) +FX_BOOL CXFA_Event::SetActivity(int32_t iActivity) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Activity, (XFA_ATTRIBUTEENUM)iActivity); } -FX_BOOL CXFA_Event::SetEventType(FX_INT32 iEventType) +FX_BOOL CXFA_Event::SetEventType(int32_t iEventType) { return FALSE; } -FX_BOOL CXFA_Event::SetExecuteRunAt(FX_INT32 iExecuteRunAt) +FX_BOOL CXFA_Event::SetExecuteRunAt(int32_t iExecuteRunAt) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Execute); return pNode->SetEnum(XFA_ATTRIBUTE_RunAt, (XFA_ATTRIBUTEENUM)iExecuteRunAt); } -FX_BOOL CXFA_Event::SetExecuteType(FX_INT32 iExecuteType) +FX_BOOL CXFA_Event::SetExecuteType(int32_t iExecuteType) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Execute); return pNode->SetEnum(XFA_ATTRIBUTE_ExecuteType, (XFA_ATTRIBUTEENUM)iExecuteType); @@ -737,7 +737,7 @@ FX_BOOL CXFA_Event::SetExecuteConnection(const CFX_WideString& wsConnection) CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_Execute); return pNode->SetCData(XFA_ATTRIBUTE_Connection, wsConnection); } -FX_BOOL CXFA_Event::SetSignDataOperation(FX_INT32 iOperation) +FX_BOOL CXFA_Event::SetSignDataOperation(int32_t iOperation) { CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_ELEMENT_SignData); return pNode->SetEnum(XFA_ATTRIBUTE_Operation, (XFA_ATTRIBUTEENUM)iOperation); @@ -773,7 +773,7 @@ XFA_SCRIPTTYPE CXFA_Script::GetContentType() } return XFA_SCRIPTTYPE_Formcalc; } -FX_INT32 CXFA_Script::GetRunAt() +int32_t CXFA_Script::GetRunAt() { return m_pNode->GetEnum(XFA_ATTRIBUTE_RunAt); } @@ -800,7 +800,7 @@ FX_BOOL CXFA_Script::SetContentType(XFA_SCRIPTTYPE eType) } return m_pNode->SetCData(XFA_ATTRIBUTE_ContentType, wsType); } -FX_BOOL CXFA_Script::SetRunAt(FX_INT32 iRunAt) +FX_BOOL CXFA_Script::SetRunAt(int32_t iRunAt) { return m_pNode->SetEnum(XFA_ATTRIBUTE_RunAt, (XFA_ATTRIBUTEENUM)iRunAt); } @@ -816,7 +816,7 @@ FX_BOOL CXFA_Submit::IsSubmitEmbedPDF() { return m_pNode->GetBoolean(XFA_ATTRIBUTE_EmbedPDF); } -FX_INT32 CXFA_Submit::GetSubmitFormat() +int32_t CXFA_Submit::GetSubmitFormat() { return m_pNode->GetEnum(XFA_ATTRIBUTE_Format); } @@ -860,7 +860,7 @@ void CXFA_Submit::GetSubmitXDPContent(CFX_WideStringC &wsContent) { m_pNode->TryCData(XFA_ATTRIBUTE_XdpContent, wsContent); } -FX_BOOL CXFA_Submit::SetSubmitFormat(FX_INT32 iSubmitFormat) +FX_BOOL CXFA_Submit::SetSubmitFormat(int32_t iSubmitFormat) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Format, (XFA_ATTRIBUTEENUM)iSubmitFormat); } @@ -977,7 +977,7 @@ FX_BOOL CXFA_Value::SetChildValueContent(const CFX_WideString& wsContent, FX_BOO } return pNode->SetContent(wsContent, wsFormatContent, bNotify); } -FX_INT32 CXFA_Line::GetHand() +int32_t CXFA_Line::GetHand() { return m_pNode->GetEnum(XFA_ATTRIBUTE_Hand); } @@ -990,11 +990,11 @@ CXFA_Edge CXFA_Line::GetEdge() { return CXFA_Edge(m_pNode->GetChild(0, XFA_ELEMENT_Edge)); } -FX_BOOL CXFA_Line::SetHand(FX_INT32 iHand) +FX_BOOL CXFA_Line::SetHand(int32_t iHand) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Hand, (XFA_ATTRIBUTEENUM)iHand); } -FX_BOOL CXFA_Line::SetSlop(FX_INT32 iSlop) +FX_BOOL CXFA_Line::SetSlop(int32_t iSlop) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Slope, (XFA_ATTRIBUTEENUM)iSlop); } @@ -1006,7 +1006,7 @@ void CXFA_Text::GetName(CFX_WideStringC &wsName) { m_pNode->TryCData(XFA_ATTRIBUTE_Name, wsName); } -FX_INT32 CXFA_Text::GetMaxChars() +int32_t CXFA_Text::GetMaxChars() { return m_pNode->GetInteger(XFA_ATTRIBUTE_MaxChars); } @@ -1031,7 +1031,7 @@ FX_BOOL CXFA_Text::SetName(const CFX_WideString& wsName) { return m_pNode->SetCData(XFA_ATTRIBUTE_Name, wsName); } -FX_BOOL CXFA_Text::SetMaxChars(FX_INT32 iMaxChars) +FX_BOOL CXFA_Text::SetMaxChars(int32_t iMaxChars) { return m_pNode->SetInteger(XFA_ATTRIBUTE_MaxChars, iMaxChars); } @@ -1051,7 +1051,7 @@ void CXFA_ExData::GetHref(CFX_WideStringC &wsHref) { m_pNode->TryCData(XFA_ATTRIBUTE_Href, wsHref); } -FX_INT32 CXFA_ExData::GetMaxLength() +int32_t CXFA_ExData::GetMaxLength() { return m_pNode->GetInteger(XFA_ATTRIBUTE_MaxLength); } @@ -1059,7 +1059,7 @@ void CXFA_ExData::GetRid(CFX_WideStringC &wsRid) { m_pNode->TryCData(XFA_ATTRIBUTE_Rid, wsRid); } -FX_INT32 CXFA_ExData::GetTransferEncoding() +int32_t CXFA_ExData::GetTransferEncoding() { return m_pNode->GetEnum(XFA_ATTRIBUTE_TransferEncoding); } @@ -1075,7 +1075,7 @@ FX_BOOL CXFA_ExData::SetHref(const CFX_WideString& wsHref) { return m_pNode->SetCData(XFA_ATTRIBUTE_Href, wsHref); } -FX_BOOL CXFA_ExData::SetMaxLength(FX_INT32 iMaxLength) +FX_BOOL CXFA_ExData::SetMaxLength(int32_t iMaxLength) { return m_pNode->SetInteger(XFA_ATTRIBUTE_MaxLength, iMaxLength); } @@ -1083,7 +1083,7 @@ FX_BOOL CXFA_ExData::SetRid(const CFX_WideString& wsRid) { return m_pNode->SetCData(XFA_ATTRIBUTE_Rid, wsRid); } -FX_BOOL CXFA_ExData::SetTransferEncoding(FX_INT32 iTransferEncoding) +FX_BOOL CXFA_ExData::SetTransferEncoding(int32_t iTransferEncoding) { return m_pNode->SetEnum(XFA_ATTRIBUTE_TransferEncoding, (XFA_ATTRIBUTEENUM)iTransferEncoding); } @@ -1101,7 +1101,7 @@ CXFA_Image::CXFA_Image(CXFA_Node* pNode, FX_BOOL bDefValue) , m_bDefValue(bDefValue) { } -FX_INT32 CXFA_Image::GetAspect() +int32_t CXFA_Image::GetAspect() { return m_pNode->GetEnum(XFA_ATTRIBUTE_Aspect); } @@ -1116,7 +1116,7 @@ FX_BOOL CXFA_Image::GetHref(CFX_WideString &wsHref) } return m_pNode->GetAttribute(FX_WSTRC(L"href"), wsHref); } -FX_INT32 CXFA_Image::GetTransferEncoding() +int32_t CXFA_Image::GetTransferEncoding() { if (m_bDefValue) { return m_pNode->GetEnum(XFA_ATTRIBUTE_TransferEncoding); @@ -1127,7 +1127,7 @@ FX_BOOL CXFA_Image::GetContent(CFX_WideString &wsText) { return m_pNode->TryContent(wsText); } -FX_BOOL CXFA_Image::SetAspect(FX_INT32 iAspect) +FX_BOOL CXFA_Image::SetAspect(int32_t iAspect) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Aspect, (XFA_ATTRIBUTEENUM)iAspect); } @@ -1142,7 +1142,7 @@ FX_BOOL CXFA_Image::SetHref(const CFX_WideString& wsHref) } return m_pNode->SetAttribute(XFA_ATTRIBUTE_Href, wsHref); } -FX_BOOL CXFA_Image::SetTransferEncoding(FX_INT32 iTransferEncoding) +FX_BOOL CXFA_Image::SetTransferEncoding(int32_t iTransferEncoding) { if (m_bDefValue) { return m_pNode->SetEnum(XFA_ATTRIBUTE_TransferEncoding, (XFA_ATTRIBUTEENUM)iTransferEncoding); @@ -1162,7 +1162,7 @@ CXFA_Calculate::CXFA_Calculate(CXFA_Node* pNode) : CXFA_Data(pNode) { } -FX_INT32 CXFA_Calculate::GetOverride() +int32_t CXFA_Calculate::GetOverride() { XFA_ATTRIBUTEENUM eAtt = XFA_ATTRIBUTEENUM_Error; m_pNode->TryEnum(XFA_ATTRIBUTE_Override, eAtt, FALSE); @@ -1181,7 +1181,7 @@ void CXFA_Calculate::GetMessageText(CFX_WideString &wsMessage) } } } -FX_BOOL CXFA_Calculate::SetOverride(FX_INT32 iOverride) +FX_BOOL CXFA_Calculate::SetOverride(int32_t iOverride) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Override, (XFA_ATTRIBUTEENUM)iOverride); } @@ -1197,11 +1197,11 @@ CXFA_Validate::CXFA_Validate(CXFA_Node* pNode) : CXFA_Data(pNode) { } -FX_INT32 CXFA_Validate::GetFormatTest() +int32_t CXFA_Validate::GetFormatTest() { return m_pNode->GetEnum(XFA_ATTRIBUTE_FormatTest); } -FX_BOOL CXFA_Validate::SetTestValue(FX_INT32 iType, CFX_WideString &wsValue, XFA_ATTRIBUTEENUM eName) +FX_BOOL CXFA_Validate::SetTestValue(int32_t iType, CFX_WideString &wsValue, XFA_ATTRIBUTEENUM eName) { XFA_LPCATTRIBUTEENUMINFO pInfo = XFA_GetAttributeEnumByName(wsValue); if (pInfo) { @@ -1218,11 +1218,11 @@ FX_BOOL CXFA_Validate::SetNullTest(CFX_WideString wsValue) { return SetTestValue(XFA_ATTRIBUTE_NullTest, wsValue, XFA_ATTRIBUTEENUM_Disabled); } -FX_INT32 CXFA_Validate::GetNullTest() +int32_t CXFA_Validate::GetNullTest() { return m_pNode->GetEnum(XFA_ATTRIBUTE_NullTest); } -FX_INT32 CXFA_Validate::GetScriptTest() +int32_t CXFA_Validate::GetScriptTest() { return m_pNode->GetEnum(XFA_ATTRIBUTE_ScriptTest); } @@ -1302,11 +1302,11 @@ CXFA_Variables::CXFA_Variables(CXFA_Node* pNode) : CXFA_Data(pNode) { } -FX_INT32 CXFA_Variables::CountScripts() +int32_t CXFA_Variables::CountScripts() { return m_pNode->CountChildren(XFA_ELEMENT_Script); } -CXFA_Script CXFA_Variables::GetScript(FX_INT32 nIndex) +CXFA_Script CXFA_Variables::GetScript(int32_t nIndex) { return m_pNode->GetChild(nIndex, XFA_ELEMENT_Script); } @@ -1314,7 +1314,7 @@ CXFA_Bind::CXFA_Bind(CXFA_Node* pNode) : CXFA_Data(pNode) { } -FX_INT32 CXFA_Bind::GetMatch() +int32_t CXFA_Bind::GetMatch() { return m_pNode->GetEnum(XFA_ATTRIBUTE_Match); } @@ -1328,7 +1328,7 @@ void CXFA_Bind::GetPicture(CFX_WideString &wsPicture) pPicture->TryContent(wsPicture); } } -FX_BOOL CXFA_Bind::SetMatch(FX_INT32 iMatch) +FX_BOOL CXFA_Bind::SetMatch(int32_t iMatch) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Match, (XFA_ATTRIBUTEENUM)iMatch); } @@ -1399,49 +1399,49 @@ FX_BOOL CXFA_BindItems::SetRef(const CFX_WideString& wsRef) { return m_pNode->SetCData(XFA_ATTRIBUTE_Ref, wsRef); } -FX_INT32 CXFA_Box::GetBreak() const +int32_t CXFA_Box::GetBreak() const { if (!m_pNode) { return XFA_ATTRIBUTEENUM_Close; } return m_pNode->GetEnum(XFA_ATTRIBUTE_Break); } -FX_INT32 CXFA_Box::GetHand() const +int32_t CXFA_Box::GetHand() const { if (!m_pNode) { return XFA_ATTRIBUTEENUM_Even; } return m_pNode->GetEnum(XFA_ATTRIBUTE_Hand); } -FX_INT32 CXFA_Box::GetPresence() const +int32_t CXFA_Box::GetPresence() const { if (!m_pNode) { return XFA_ATTRIBUTEENUM_Hidden; } return m_pNode->GetEnum(XFA_ATTRIBUTE_Presence); } -FX_INT32 CXFA_Box::CountCorners() const +int32_t CXFA_Box::CountCorners() const { if (!m_pNode) { return 0; } return m_pNode->CountChildren(XFA_ELEMENT_Corner); } -CXFA_Corner CXFA_Box::GetCorner(FX_INT32 nIndex) const +CXFA_Corner CXFA_Box::GetCorner(int32_t nIndex) const { if (!m_pNode) { return NULL; } return CXFA_Corner(m_pNode->GetProperty(nIndex, XFA_ELEMENT_Corner, nIndex == 0)); } -FX_INT32 CXFA_Box::CountEdges() const +int32_t CXFA_Box::CountEdges() const { if (!m_pNode) { return 0; } return m_pNode->CountChildren(XFA_ELEMENT_Edge); } -CXFA_Edge CXFA_Box::GetEdge(FX_INT32 nIndex) const +CXFA_Edge CXFA_Box::GetEdge(int32_t nIndex) const { if (!m_pNode) { return NULL; @@ -1455,7 +1455,7 @@ static void XFA_BOX_GetStrokes(CXFA_Node *pNode, CXFA_StrokeArray &strokes, FX_B return; } strokes.SetSize(8); - FX_INT32 i, j; + int32_t i, j; for (i = 0, j = 0; i < 4; i ++) { CXFA_Corner corner = CXFA_Corner(pNode->GetProperty(i, XFA_ELEMENT_Corner, i == 0)); if (corner.IsExistInXML() || i == 0) { @@ -1539,12 +1539,12 @@ CXFA_Margin CXFA_Box::GetMargin() const } static FX_BOOL XFA_BOX_SameStyles(const CXFA_StrokeArray &strokes) { - FX_INT32 iCount = strokes.GetSize(); + int32_t iCount = strokes.GetSize(); if (iCount < 1) { return TRUE; } CXFA_Stroke stroke1 = strokes[0]; - for (FX_INT32 i = 1; i < iCount; i ++) { + for (int32_t i = 1; i < iCount; i ++) { CXFA_Stroke stroke2 = strokes[i]; if (!stroke2.IsExistInXML()) { continue; @@ -1566,14 +1566,14 @@ FX_BOOL CXFA_Box::SameStyles() const XFA_BOX_GetStrokes(m_pNode, strokes, TRUE); return XFA_BOX_SameStyles(strokes); } -static FX_INT32 XFA_BOX_3DStyle(const CXFA_StrokeArray &strokes, CXFA_Stroke &stroke) +static int32_t XFA_BOX_3DStyle(const CXFA_StrokeArray &strokes, CXFA_Stroke &stroke) { - FX_INT32 iCount = strokes.GetSize(); + int32_t iCount = strokes.GetSize(); if (iCount < 1) { return 0; } stroke = strokes[0]; - for (FX_INT32 i = 1; i < iCount; i ++) { + for (int32_t i = 1; i < iCount; i ++) { CXFA_Stroke find = strokes[i]; if (!find.IsExistInXML()) { continue; @@ -1585,14 +1585,14 @@ static FX_INT32 XFA_BOX_3DStyle(const CXFA_StrokeArray &strokes, CXFA_Stroke &st break; } } - FX_INT32 iType = stroke.GetStrokeType(); + int32_t iType = stroke.GetStrokeType(); if (iType == XFA_ATTRIBUTEENUM_Lowered || iType == XFA_ATTRIBUTEENUM_Raised || iType == XFA_ATTRIBUTEENUM_Etched || iType == XFA_ATTRIBUTEENUM_Embossed) { return iType; } return 0; } -FX_INT32 CXFA_Box::Get3DStyle(FX_BOOL &bVisible, FX_FLOAT &fThickness) const +int32_t CXFA_Box::Get3DStyle(FX_BOOL &bVisible, FX_FLOAT &fThickness) const { if (IsArc()) { return 0; @@ -1600,25 +1600,25 @@ FX_INT32 CXFA_Box::Get3DStyle(FX_BOOL &bVisible, FX_FLOAT &fThickness) const CXFA_StrokeArray strokes; XFA_BOX_GetStrokes(m_pNode, strokes, TRUE); CXFA_Stroke stroke(NULL); - FX_INT32 iType = XFA_BOX_3DStyle(strokes, stroke); + int32_t iType = XFA_BOX_3DStyle(strokes, stroke); if (iType) { bVisible = stroke.IsVisible(); fThickness = stroke.GetThickness(); } return iType; } -FX_INT32 CXFA_Stroke::GetPresence() const +int32_t CXFA_Stroke::GetPresence() const { return m_pNode ? m_pNode->GetEnum(XFA_ATTRIBUTE_Presence) : XFA_ATTRIBUTEENUM_Invisible; } -FX_INT32 CXFA_Stroke::GetCapType() const +int32_t CXFA_Stroke::GetCapType() const { if (!m_pNode) { return XFA_ATTRIBUTEENUM_Square; } return m_pNode->GetEnum(XFA_ATTRIBUTE_Cap); } -FX_INT32 CXFA_Stroke::GetStrokeType() const +int32_t CXFA_Stroke::GetStrokeType() const { return m_pNode ? m_pNode->GetEnum(XFA_ATTRIBUTE_Stroke) : XFA_ATTRIBUTEENUM_Solid; } @@ -1670,7 +1670,7 @@ void CXFA_Stroke::SetColor(FX_ARGB argb) wsColor.Format(L"%d,%d,%d", r, g, b); pNode->SetCData(XFA_ATTRIBUTE_Value, wsColor); } -FX_INT32 CXFA_Stroke::GetJoinType() const +int32_t CXFA_Stroke::GetJoinType() const { return m_pNode ? m_pNode->GetEnum(XFA_ATTRIBUTE_Join) : XFA_ATTRIBUTEENUM_Square; } @@ -1704,7 +1704,7 @@ FX_BOOL CXFA_Stroke::SameStyles(CXFA_Stroke stroke, FX_DWORD dwFlags) const } return TRUE; } -FX_FLOAT XFA_GetEdgeThickness(const CXFA_StrokeArray &strokes, FX_BOOL b3DStyle, FX_INT32 nIndex) +FX_FLOAT XFA_GetEdgeThickness(const CXFA_StrokeArray &strokes, FX_BOOL b3DStyle, int32_t nIndex) { FX_FLOAT fThickness = 0; { @@ -1741,7 +1741,7 @@ CFX_WideString CXFA_WidgetData::GetRawValue() { return m_pNode->GetContent(); } -FX_INT32 CXFA_WidgetData::GetAccess(FX_BOOL bTemplate) +int32_t CXFA_WidgetData::GetAccess(FX_BOOL bTemplate) { if (bTemplate) { CXFA_Node* pNode = m_pNode->GetTemplateNode(); @@ -1752,7 +1752,7 @@ FX_INT32 CXFA_WidgetData::GetAccess(FX_BOOL bTemplate) } CXFA_Node* pNode = m_pNode; while (pNode) { - FX_INT32 iAcc = pNode->GetEnum(XFA_ATTRIBUTE_Access); + int32_t iAcc = pNode->GetEnum(XFA_ATTRIBUTE_Access); if (iAcc != XFA_ATTRIBUTEENUM_Open) { return iAcc; } @@ -1764,20 +1764,20 @@ FX_BOOL CXFA_WidgetData::GetAccessKey(CFX_WideStringC &wsAccessKey) { return m_pNode->TryCData(XFA_ATTRIBUTE_AccessKey, wsAccessKey); } -FX_INT32 CXFA_WidgetData::GetAnchorType() +int32_t CXFA_WidgetData::GetAnchorType() { return m_pNode->GetEnum(XFA_ATTRIBUTE_AnchorType); } -FX_INT32 CXFA_WidgetData::GetColSpan() +int32_t CXFA_WidgetData::GetColSpan() { return m_pNode->GetInteger(XFA_ATTRIBUTE_ColSpan); } -FX_INT32 CXFA_WidgetData::GetPresence() +int32_t CXFA_WidgetData::GetPresence() { return m_pNode->GetEnum(XFA_ATTRIBUTE_Presence); CXFA_Node* pNode = m_pNode; while (pNode && pNode->GetObjectType() == XFA_OBJECTTYPE_ContainerNode) { - FX_INT32 iAcc = pNode->GetEnum(XFA_ATTRIBUTE_Presence); + int32_t iAcc = pNode->GetEnum(XFA_ATTRIBUTE_Presence); if ( iAcc != XFA_ATTRIBUTEENUM_Visible) { return iAcc; } @@ -1785,13 +1785,13 @@ FX_INT32 CXFA_WidgetData::GetPresence() } return XFA_ATTRIBUTEENUM_Visible; } -FX_INT32 CXFA_WidgetData::GetRotate() +int32_t CXFA_WidgetData::GetRotate() { CXFA_Measurement ms; if (!m_pNode->TryMeasure(XFA_ATTRIBUTE_Rotate, ms, FALSE)) { return 0; } - FX_INT32 iRotate = FXSYS_round(ms.GetValue()); + int32_t iRotate = FXSYS_round(ms.GetValue()); iRotate = XFA_MapRotation(iRotate); return iRotate / 90 * 90; } @@ -1823,12 +1823,12 @@ void CXFA_WidgetData::GetEventList(CXFA_NodeArray &events) { m_pNode->GetNodeList(events, 0, XFA_ELEMENT_Event); } -FX_INT32 CXFA_WidgetData::GetEventByActivity(FX_INT32 iActivity, CXFA_NodeArray &events, FX_BOOL bIsFormReady) +int32_t CXFA_WidgetData::GetEventByActivity(int32_t iActivity, CXFA_NodeArray &events, FX_BOOL bIsFormReady) { CXFA_NodeArray allEvents; GetEventList(allEvents); - FX_INT32 iCount = allEvents.GetSize(); - for (FX_INT32 i = 0; i < iCount; i++) { + int32_t iCount = allEvents.GetSize(); + for (int32_t i = 0; i < iCount; i++) { CXFA_Event event(allEvents[i]); if (event.GetActivity() == iActivity) { if (iActivity == XFA_ATTRIBUTEENUM_Ready) { @@ -1911,7 +1911,7 @@ CXFA_BindItems CXFA_WidgetData::GetBindItems() { return m_pNode->GetChild(0, XFA_ELEMENT_BindItems); } -FX_BOOL CXFA_WidgetData::SetAccess(FX_INT32 iAccess, FX_BOOL bNotify) +FX_BOOL CXFA_WidgetData::SetAccess(int32_t iAccess, FX_BOOL bNotify) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Access, (XFA_ATTRIBUTEENUM)iAccess, bNotify); } @@ -1919,19 +1919,19 @@ FX_BOOL CXFA_WidgetData::SetAccessKey(const CFX_WideString& wsAccessKey) { return m_pNode->SetCData(XFA_ATTRIBUTE_AccessKey, wsAccessKey); } -FX_BOOL CXFA_WidgetData::SetAnchorType(FX_INT32 iType) +FX_BOOL CXFA_WidgetData::SetAnchorType(int32_t iType) { return m_pNode->SetEnum(XFA_ATTRIBUTE_AnchorType, (XFA_ATTRIBUTEENUM)iType); } -FX_BOOL CXFA_WidgetData::SetColSpan(FX_INT32 iColSpan) +FX_BOOL CXFA_WidgetData::SetColSpan(int32_t iColSpan) { return m_pNode->SetInteger(XFA_ATTRIBUTE_ColSpan, (XFA_ATTRIBUTEENUM)iColSpan); } -FX_BOOL CXFA_WidgetData::SetPresence(FX_INT32 iPresence) +FX_BOOL CXFA_WidgetData::SetPresence(int32_t iPresence) { return m_pNode->SetEnum(XFA_ATTRIBUTE_Presence, (XFA_ATTRIBUTEENUM)iPresence); } -FX_BOOL CXFA_WidgetData::SetRotate(FX_INT32 iRotate) +FX_BOOL CXFA_WidgetData::SetRotate(int32_t iRotate) { iRotate = XFA_MapRotation(iRotate); CXFA_Measurement ms((FX_FLOAT)iRotate, XFA_UNIT_Angle); @@ -1977,7 +1977,7 @@ FX_BOOL CXFA_WidgetData::SetName(const CFX_WideString& wsName) { return m_pNode->SetCData(XFA_ATTRIBUTE_Name, wsName); } -FX_BOOL CXFA_WidgetData::SetButtonHighlight(FX_INT32 iButtonHighlight) +FX_BOOL CXFA_WidgetData::SetButtonHighlight(int32_t iButtonHighlight) { CXFA_Node* pUiChildNode = GetUIChild(); return pUiChildNode->SetEnum(XFA_ATTRIBUTE_Highlight, (XFA_ATTRIBUTEENUM)iButtonHighlight); @@ -1990,12 +1990,12 @@ FX_BOOL CXFA_WidgetData::SetButtonDown(const CFX_WideString& wsDown, FX_BOOL bRi { return FALSE; } -FX_BOOL CXFA_WidgetData::SetCheckButtonShape(FX_INT32 iCheckButtonShape) +FX_BOOL CXFA_WidgetData::SetCheckButtonShape(int32_t iCheckButtonShape) { CXFA_Node* pUiChildNode = GetUIChild(); return pUiChildNode->SetEnum(XFA_ATTRIBUTE_Shape, (XFA_ATTRIBUTEENUM)iCheckButtonShape); } -FX_BOOL CXFA_WidgetData::SetCheckButtonMark(FX_INT32 iCheckButtonMark) +FX_BOOL CXFA_WidgetData::SetCheckButtonMark(int32_t iCheckButtonMark) { CXFA_Node* pUiChildNode = GetUIChild(); return pUiChildNode->SetEnum(XFA_ATTRIBUTE_Mark, (XFA_ATTRIBUTEENUM)iCheckButtonMark); @@ -2058,7 +2058,7 @@ void CXFA_WidgetData::GetUIMargin(CFX_RectF &rtUIMargin) } rtUIMargin.Set(fLeftInset, fTopInset, fRightInset, fBottomInset); } -FX_INT32 CXFA_WidgetData::GetButtonHighlight() +int32_t CXFA_WidgetData::GetButtonHighlight() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) { @@ -2100,7 +2100,7 @@ FX_BOOL CXFA_WidgetData::GetButtonDown(CFX_WideString &wsDown, FX_BOOL &bRichTex } return FALSE; } -FX_INT32 CXFA_WidgetData::GetCheckButtonShape() +int32_t CXFA_WidgetData::GetCheckButtonShape() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) { @@ -2108,7 +2108,7 @@ FX_INT32 CXFA_WidgetData::GetCheckButtonShape() } return XFA_GetAttributeDefaultValue_Enum(XFA_ELEMENT_CheckButton, XFA_ATTRIBUTE_Shape, XFA_XDPPACKET_Form); } -FX_INT32 CXFA_WidgetData::GetCheckButtonMark() +int32_t CXFA_WidgetData::GetCheckButtonMark() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) { @@ -2147,7 +2147,7 @@ XFA_CHECKSTATE CXFA_WidgetData::GetCheckState() } if (CXFA_Node* pItems = m_pNode->GetChild(0, XFA_ELEMENT_Items)) { CXFA_Node* pText = pItems->GetNodeItem(XFA_NODEITEM_FirstChild); - FX_INT32 i = 0; + int32_t i = 0; while(pText) { CFX_WideString wsContent; if (pText->TryContent(wsContent) && (wsContent == wsValue)) { @@ -2203,7 +2203,7 @@ void CXFA_WidgetData::SetCheckState(XFA_CHECKSTATE eCheckState, FX_BOOL bNotify) if (!pItems) { return; } - FX_INT32 i = -1; + int32_t i = -1; CXFA_Node* pText = pItems->GetNodeItem(XFA_NODEITEM_FirstChild); CFX_WideString wsContent; while (pText) { @@ -2316,7 +2316,7 @@ CXFA_Node* CXFA_WidgetData::GetExclGroupNextMember(CXFA_Node* pNode) } return NULL; } -FX_INT32 CXFA_WidgetData::GetChoiceListCommitOn() +int32_t CXFA_WidgetData::GetChoiceListCommitOn() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) { @@ -2332,7 +2332,7 @@ FX_BOOL CXFA_WidgetData::IsChoiceListAllowTextEntry() } return XFA_GetAttributeDefaultValue_Boolean(XFA_ELEMENT_ChoiceList, XFA_ATTRIBUTE_TextEntry, XFA_XDPPACKET_Form); } -FX_INT32 CXFA_WidgetData::GetChoiceListOpen() +int32_t CXFA_WidgetData::GetChoiceListOpen() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) { @@ -2342,14 +2342,14 @@ FX_INT32 CXFA_WidgetData::GetChoiceListOpen() } FX_BOOL CXFA_WidgetData::IsListBox() { - FX_INT32 iOpenMode = GetChoiceListOpen(); + int32_t iOpenMode = GetChoiceListOpen(); return (iOpenMode == XFA_ATTRIBUTEENUM_Always || iOpenMode == XFA_ATTRIBUTEENUM_MultiSelect); } -FX_INT32 CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue) +int32_t CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue) { CXFA_NodeArray pItems; CXFA_Node* pItem = NULL; - FX_INT32 iCount = 0; + int32_t iCount = 0; CXFA_Node* pNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pNode->GetClassID() != XFA_ELEMENT_Items) { @@ -2375,12 +2375,12 @@ FX_INT32 CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue) pItems.RemoveAll(); return pItem->CountChildren(XFA_ELEMENT_UNKNOWN); } -FX_BOOL CXFA_WidgetData::GetChoiceListItem(CFX_WideString &wsText, FX_INT32 nIndex, FX_BOOL bSaveValue ) +FX_BOOL CXFA_WidgetData::GetChoiceListItem(CFX_WideString &wsText, int32_t nIndex, FX_BOOL bSaveValue ) { wsText.Empty(); CXFA_NodeArray pItemsArray; CXFA_Node* pItems = NULL; - FX_INT32 iCount = 0; + int32_t iCount = 0; CXFA_Node* pNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pNode->GetClassID() != XFA_ELEMENT_Items) { @@ -2416,7 +2416,7 @@ void CXFA_WidgetData::GetChoiceListItems(CFX_WideStringArray &wsTextArray, FX_BO { CXFA_NodeArray pItems; CXFA_Node* pItem = NULL; - FX_INT32 iCount = 0; + int32_t iCount = 0; CXFA_Node* pNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pNode->GetClassID() != XFA_ELEMENT_Items) { @@ -2445,20 +2445,20 @@ void CXFA_WidgetData::GetChoiceListItems(CFX_WideStringArray &wsTextArray, FX_BO pNode->TryContent(wsTextArray.Add()); } } -FX_INT32 CXFA_WidgetData::CountSelectedItems() +int32_t CXFA_WidgetData::CountSelectedItems() { CFX_WideStringArray wsValueArray; GetSelectedItemsValue(wsValueArray); if (IsListBox() || !IsChoiceListAllowTextEntry()) { return wsValueArray.GetSize(); } - FX_INT32 iSelected = 0; + int32_t iSelected = 0; CFX_WideStringArray wsSaveTextArray; GetChoiceListItems(wsSaveTextArray, TRUE); - FX_INT32 iValues = wsValueArray.GetSize(); - for (FX_INT32 i = 0; i < iValues; i++) { - FX_INT32 iSaves = wsSaveTextArray.GetSize(); - for (FX_INT32 j = 0; j < iSaves; j++) { + int32_t iValues = wsValueArray.GetSize(); + for (int32_t i = 0; i < iValues; i++) { + int32_t iSaves = wsSaveTextArray.GetSize(); + for (int32_t j = 0; j < iSaves; j++) { if (wsValueArray[i] == wsSaveTextArray[j]) { iSelected++; break; @@ -2467,15 +2467,15 @@ FX_INT32 CXFA_WidgetData::CountSelectedItems() } return iSelected; } -FX_INT32 CXFA_WidgetData::GetSelectedItem(FX_INT32 nIndex ) +int32_t CXFA_WidgetData::GetSelectedItem(int32_t nIndex ) { CFX_WideStringArray wsValueArray; GetSelectedItemsValue(wsValueArray); - FX_INT32 iSelected = 0; + int32_t iSelected = 0; CFX_WideStringArray wsSaveTextArray; GetChoiceListItems(wsSaveTextArray, TRUE); - FX_INT32 iSaves = wsSaveTextArray.GetSize(); - for (FX_INT32 j = 0; j < iSaves; j++) { + int32_t iSaves = wsSaveTextArray.GetSize(); + for (int32_t j = 0; j < iSaves; j++) { if (wsValueArray[nIndex] == wsSaveTextArray[j]) { return j; } @@ -2486,15 +2486,15 @@ void CXFA_WidgetData::GetSelectedItems(CFX_Int32Array &iSelArray) { CFX_WideStringArray wsValueArray; GetSelectedItemsValue(wsValueArray); - FX_INT32 iValues = wsValueArray.GetSize(); + int32_t iValues = wsValueArray.GetSize(); if (iValues < 1) { return; } CFX_WideStringArray wsSaveTextArray; GetChoiceListItems(wsSaveTextArray, TRUE); - FX_INT32 iSaves = wsSaveTextArray.GetSize(); - for (FX_INT32 i = 0; i < iValues; i++) { - for (FX_INT32 j = 0; j < iSaves; j++) { + int32_t iSaves = wsSaveTextArray.GetSize(); + for (int32_t i = 0; i < iValues; i++) { + for (int32_t j = 0; j < iSaves; j++) { if (wsValueArray[i] == wsSaveTextArray[j]) { iSelArray.Add(j); break; @@ -2507,9 +2507,9 @@ void CXFA_WidgetData::GetSelectedItemsValue(CFX_WideStringArray &wsSelTextArray) CFX_WideString wsValue = GetRawValue(); if (GetChoiceListOpen() == XFA_ATTRIBUTEENUM_MultiSelect) { if (!wsValue.IsEmpty()) { - FX_INT32 iStart = 0; - FX_INT32 iLength = wsValue.GetLength(); - FX_INT32 iEnd = wsValue.Find(L'\n', iStart); + int32_t iStart = 0; + int32_t iLength = wsValue.GetLength(); + int32_t iEnd = wsValue.Find(L'\n', iStart); iEnd = (iEnd == -1) ? iLength : iEnd; while (iEnd >= iStart) { wsSelTextArray.Add(wsValue.Mid(iStart, iEnd - iStart)); @@ -2527,7 +2527,7 @@ void CXFA_WidgetData::GetSelectedItemsValue(CFX_WideStringArray &wsSelTextArray) wsSelTextArray.Add(wsValue); } } -FX_BOOL CXFA_WidgetData::GetItemState(FX_INT32 nIndex) +FX_BOOL CXFA_WidgetData::GetItemState(int32_t nIndex) { if (nIndex < 0) { return FALSE; @@ -2539,15 +2539,15 @@ FX_BOOL CXFA_WidgetData::GetItemState(FX_INT32 nIndex) } CFX_WideStringArray wsValueArray; GetSelectedItemsValue(wsValueArray); - FX_INT32 iValues = wsValueArray.GetSize(); - for (FX_INT32 j = 0; j < iValues; j++) { + int32_t iValues = wsValueArray.GetSize(); + for (int32_t j = 0; j < iValues; j++) { if (wsValueArray[j] == wsSaveTextArray[nIndex]) { return TRUE; } } return FALSE; } -void CXFA_WidgetData::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected, FX_BOOL bNotify, FX_BOOL bScriptModify, FX_BOOL bSyncData) +void CXFA_WidgetData::SetItemState(int32_t nIndex, FX_BOOL bSelected, FX_BOOL bNotify, FX_BOOL bScriptModify, FX_BOOL bSyncData) { if (nIndex < 0) { return; @@ -2557,11 +2557,11 @@ void CXFA_WidgetData::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected, FX_BOOL b if (wsSaveTextArray.GetSize() <= nIndex) { return; } - FX_INT32 iSel = -1; + int32_t iSel = -1; CFX_WideStringArray wsValueArray; GetSelectedItemsValue(wsValueArray); - FX_INT32 iValues = wsValueArray.GetSize(); - for (FX_INT32 j = 0; j < iValues; j++) { + int32_t iValues = wsValueArray.GetSize(); + for (int32_t j = 0; j < iValues; j++) { if (wsValueArray[j] == wsSaveTextArray[nIndex]) { iSel = j; break; @@ -2580,7 +2580,7 @@ void CXFA_WidgetData::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected, FX_BOOL b } else if (iSel >= 0) { CFX_Int32Array iSelArray; GetSelectedItems(iSelArray); - for (FX_INT32 i = 0; i < iSelArray.GetSize(); i++) { + for (int32_t i = 0; i < iSelArray.GetSize(); i++) { if (iSelArray[i] == nIndex) { iSelArray.RemoveAt(i); break; @@ -2604,12 +2604,12 @@ void CXFA_WidgetData::SetItemState(FX_INT32 nIndex, FX_BOOL bSelected, FX_BOOL b void CXFA_WidgetData::SetSelectdItems(CFX_Int32Array &iSelArray, FX_BOOL bNotify, FX_BOOL bScriptModify, FX_BOOL bSyncData) { CFX_WideString wsValue; - FX_INT32 iSize = iSelArray.GetSize(); + int32_t iSize = iSelArray.GetSize(); if (iSize >= 1) { CFX_WideStringArray wsSaveTextArray; GetChoiceListItems(wsSaveTextArray, TRUE); CFX_WideString wsItemValue; - for (FX_INT32 i = 0; i < iSize; i++) { + for (int32_t i = 0; i < iSize; i++) { wsItemValue = (iSize == 1) ? wsSaveTextArray[iSelArray[i]] : wsSaveTextArray[iSelArray[i]] + FX_WSTRC(L"\n"); wsValue += wsItemValue; } @@ -2631,14 +2631,14 @@ void CXFA_WidgetData::ClearAllSelections() SyncValue(CFX_WideString(), FALSE); } } -void CXFA_WidgetData::InsertItem(const CFX_WideString &wsLabel, const CFX_WideString &wsValue, FX_INT32 nIndex , FX_BOOL bNotify ) +void CXFA_WidgetData::InsertItem(const CFX_WideString &wsLabel, const CFX_WideString &wsValue, int32_t nIndex , FX_BOOL bNotify ) { CFX_WideString wsNewValue(wsValue); if (wsNewValue.IsEmpty()) { wsNewValue = wsLabel; } CXFA_NodeArray listitems; - FX_INT32 iCount = 0; + int32_t iCount = 0; CXFA_Node *pItemNode = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pItemNode; pItemNode = pItemNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { if (pItemNode->GetClassID() != XFA_ELEMENT_Items) { @@ -2656,7 +2656,7 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString &wsLabel, const CFX_WideSt pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, TRUE); InsertListTextItem(pSaveItems, wsNewValue, nIndex); } else if (iCount > 1) { - for (FX_INT32 i = 0; i < 2; i++) { + for (int32_t i = 0; i < 2; i++) { CXFA_Node* pNode = listitems[i]; FX_BOOL bHasSave = pNode->GetBoolean(XFA_ATTRIBUTE_Save); if (bHasSave) { @@ -2675,7 +2675,7 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString &wsLabel, const CFX_WideSt pSaveItems->SetEnum(XFA_ATTRIBUTE_Presence, XFA_ATTRIBUTEENUM_Hidden); listitems.RemoveAll(); CXFA_Node *pListNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); - FX_INT32 i = 0; + int32_t i = 0; while(pListNode) { CFX_WideString wsOldValue; pListNode->TryContent(wsOldValue); @@ -2689,11 +2689,11 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString &wsLabel, const CFX_WideSt if(!bNotify) { return; } - m_pNode->GetDocument()->GetNotify()->OnWidgetDataEvent(this, XFA_WIDGETEVENT_ListItemAdded, (FX_LPVOID)(FX_LPCWSTR)wsLabel, (FX_LPVOID)(FX_LPCWSTR)wsValue, (FX_LPVOID)(FX_UINTPTR)nIndex); + m_pNode->GetDocument()->GetNotify()->OnWidgetDataEvent(this, XFA_WIDGETEVENT_ListItemAdded, (FX_LPVOID)(FX_LPCWSTR)wsLabel, (FX_LPVOID)(FX_LPCWSTR)wsValue, (FX_LPVOID)(uintptr_t)nIndex); } void CXFA_WidgetData::GetItemLabel(FX_WSTR wsValue, CFX_WideString &wsLabel) { - FX_INT32 iCount = 0; + int32_t iCount = 0; CXFA_NodeArray listitems; CXFA_Node* pItems = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pItems; pItems = pItems->GetNodeItem(XFA_NODEITEM_NextSibling)) { @@ -2716,7 +2716,7 @@ void CXFA_WidgetData::GetItemLabel(FX_WSTR wsValue, CFX_WideString &wsLabel) pSaveItems = listitems[1]; } iCount = 0; - FX_INT32 iSearch = -1; + int32_t iSearch = -1; CFX_WideString wsContent; CXFA_Node* pChildItem = pSaveItems->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pChildItem; pChildItem = pChildItem->GetNodeItem(XFA_NODEITEM_NextSibling)) { @@ -2737,7 +2737,7 @@ void CXFA_WidgetData::GetItemLabel(FX_WSTR wsValue, CFX_WideString &wsLabel) } void CXFA_WidgetData::GetItemValue(FX_WSTR wsLabel, CFX_WideString &wsValue) { - FX_INT32 iCount = 0; + int32_t iCount = 0; CXFA_NodeArray listitems; CXFA_Node* pItems = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pItems; pItems = pItems->GetNodeItem(XFA_NODEITEM_NextSibling)) { @@ -2760,7 +2760,7 @@ void CXFA_WidgetData::GetItemValue(FX_WSTR wsLabel, CFX_WideString &wsValue) pSaveItems = listitems[1]; } iCount = 0; - FX_INT32 iSearch = -1; + int32_t iSearch = -1; CFX_WideString wsContent; CXFA_Node* pChildItem = pLabelItems->GetNodeItem(XFA_NODEITEM_FirstChild); for (; pChildItem; pChildItem = pChildItem->GetNodeItem(XFA_NODEITEM_NextSibling)) { @@ -2779,7 +2779,7 @@ void CXFA_WidgetData::GetItemValue(FX_WSTR wsLabel, CFX_WideString &wsValue) } } } -FX_BOOL CXFA_WidgetData::DeleteItem(FX_INT32 nIndex, FX_BOOL bNotify, FX_BOOL bScriptModify, FX_BOOL bSyncData) +FX_BOOL CXFA_WidgetData::DeleteItem(int32_t nIndex, FX_BOOL bNotify, FX_BOOL bScriptModify, FX_BOOL bSyncData) { FX_BOOL bSetValue = FALSE; CXFA_Node* pItems = m_pNode->GetNodeItem(XFA_NODEITEM_FirstChild); @@ -2796,7 +2796,7 @@ FX_BOOL CXFA_WidgetData::DeleteItem(FX_INT32 nIndex, FX_BOOL bNotify, FX_BOOL bS SetItemState(nIndex, FALSE, TRUE, bScriptModify, bSyncData); bSetValue = TRUE; } - FX_INT32 i = 0; + int32_t i = 0; CXFA_Node* pNode = pItems->GetNodeItem(XFA_NODEITEM_FirstChild); while (pNode) { if (i == nIndex) { @@ -2811,10 +2811,10 @@ FX_BOOL CXFA_WidgetData::DeleteItem(FX_INT32 nIndex, FX_BOOL bNotify, FX_BOOL bS if(!bNotify) { return TRUE; } - m_pNode->GetDocument()->GetNotify()->OnWidgetDataEvent(this, XFA_WIDGETEVENT_ListItemRemoved, (FX_LPVOID)(FX_UINTPTR)nIndex); + m_pNode->GetDocument()->GetNotify()->OnWidgetDataEvent(this, XFA_WIDGETEVENT_ListItemRemoved, (FX_LPVOID)(uintptr_t)nIndex); return TRUE; } -FX_INT32 CXFA_WidgetData::GetHorizontalScrollPolicy() +int32_t CXFA_WidgetData::GetHorizontalScrollPolicy() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) { @@ -2822,7 +2822,7 @@ FX_INT32 CXFA_WidgetData::GetHorizontalScrollPolicy() } return XFA_ATTRIBUTEENUM_Auto; } -FX_INT32 CXFA_WidgetData::GetNumberOfCells() +int32_t CXFA_WidgetData::GetNumberOfCells() { CXFA_Node* pUIChild = GetUIChild(); if (!pUIChild) { @@ -2842,7 +2842,7 @@ CFX_WideString CXFA_WidgetData::GetBarcodeType() CXFA_Node* pUIChild = GetUIChild(); return pUIChild ? pUIChild->GetCData(XFA_ATTRIBUTE_Type) : NULL; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(FX_INT32& val) +FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); CFX_WideString wsCharEncoding; @@ -2857,7 +2857,7 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(FX_INT32& val) } return FALSE; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_Checksum(FX_INT32& val) +FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_Checksum(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); XFA_ATTRIBUTEENUM eChecksum; @@ -2881,7 +2881,7 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_Checksum(FX_INT32& val) } return FALSE; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_DataLength(FX_INT32& val) +FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_DataLength(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); CFX_WideString wsDataLength; @@ -2915,7 +2915,7 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_EndChar(FX_CHAR& val) } return FALSE; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ECLevel(FX_INT32& val) +FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ECLevel(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); CFX_WideString wsECLevel; @@ -2925,22 +2925,22 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ECLevel(FX_INT32& val) } return FALSE; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ModuleWidth(FX_INT32& val) +FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ModuleWidth(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); CXFA_Measurement mModuleWidthHeight; if (pUIChild->TryMeasure(XFA_ATTRIBUTE_ModuleWidth, mModuleWidthHeight)) { - val = (FX_INT32)mModuleWidthHeight.ToUnit(XFA_UNIT_Pt); + val = (int32_t)mModuleWidthHeight.ToUnit(XFA_UNIT_Pt); return TRUE; } return FALSE; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ModuleHeight(FX_INT32& val) +FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_ModuleHeight(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); CXFA_Measurement mModuleWidthHeight; if (pUIChild->TryMeasure(XFA_ATTRIBUTE_ModuleHeight, mModuleWidthHeight)) { - val = (FX_INT32)mModuleWidthHeight.ToUnit(XFA_UNIT_Pt); + val = (int32_t)mModuleWidthHeight.ToUnit(XFA_UNIT_Pt); return TRUE; } return FALSE; @@ -2955,7 +2955,7 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_PrintChecksum(FX_BOOL& val) } return FALSE; } -FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_TextLocation(FX_INT32& val) +FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_TextLocation(int32_t& val) { CXFA_Node* pUIChild = GetUIChild(); XFA_ATTRIBUTEENUM eTextLocation; @@ -3002,7 +3002,7 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val) if(ptPos >= 0) { fRatio = (FX_FLOAT)FXSYS_wtoi(wsWideNarrowRatio); } else { - FX_INT32 fA, fB; + int32_t fA, fB; fA = FXSYS_wtoi(wsWideNarrowRatio.Left(ptPos)); fB = FXSYS_wtoi(wsWideNarrowRatio.Mid(ptPos + 1)); if(fB) { @@ -3045,7 +3045,7 @@ FX_BOOL CXFA_WidgetData::IsMultiLine() } return XFA_GetAttributeDefaultValue_Boolean(XFA_ELEMENT_TextEdit, XFA_ATTRIBUTE_MultiLine, XFA_XDPPACKET_Form); } -FX_INT32 CXFA_WidgetData::GetVerticalScrollPolicy() +int32_t CXFA_WidgetData::GetVerticalScrollPolicy() { CXFA_Node* pUIChild = GetUIChild(); if (pUIChild) { @@ -3053,7 +3053,7 @@ FX_INT32 CXFA_WidgetData::GetVerticalScrollPolicy() } return XFA_GetAttributeDefaultValue_Enum(XFA_ELEMENT_TextEdit, XFA_ATTRIBUTE_VScrollPolicy, XFA_XDPPACKET_Form); } -FX_INT32 CXFA_WidgetData::GetMaxChars(XFA_ELEMENT& eType) +int32_t CXFA_WidgetData::GetMaxChars(XFA_ELEMENT& eType) { if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_ELEMENT_Value)) { if (CXFA_Node* pChild = pNode->GetNodeItem(XFA_NODEITEM_FirstChild)) { @@ -3063,7 +3063,7 @@ FX_INT32 CXFA_WidgetData::GetMaxChars(XFA_ELEMENT& eType) return pChild->GetInteger(XFA_ATTRIBUTE_MaxChars); case XFA_ELEMENT_ExData: { eType = XFA_ELEMENT_ExData; - FX_INT32 iMax = pChild->GetInteger(XFA_ATTRIBUTE_MaxLength); + int32_t iMax = pChild->GetInteger(XFA_ATTRIBUTE_MaxLength); return iMax < 0 ? 0 : iMax; } default: @@ -3073,7 +3073,7 @@ FX_INT32 CXFA_WidgetData::GetMaxChars(XFA_ELEMENT& eType) } return 0; } -FX_BOOL CXFA_WidgetData::GetFracDigits(FX_INT32 &iFracDigits) +FX_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)) { @@ -3083,7 +3083,7 @@ FX_BOOL CXFA_WidgetData::GetFracDigits(FX_INT32 &iFracDigits) iFracDigits = -1; return FALSE; } -FX_BOOL CXFA_WidgetData::GetLeadDigits(FX_INT32 &iLeadDigits) +FX_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)) { @@ -3106,22 +3106,22 @@ static CFX_WideString XFA_NumericNormalize(const CFX_WideString &wsValue, IFX_Lo wsNewValue.TrimLeft(L" "); wsNewValue.TrimLeft(L"0"); wsNewValue.TrimRight(L" "); - FX_INT32 iCount = wsNewValue.GetLength(); + int32_t iCount = wsNewValue.GetLength(); if (iCount == 0) { return FX_WSTRC(L"0"); } - FX_INT32 iIndex = 0; + int32_t iIndex = 0; CFX_WideString wsRet; FX_LPWSTR pRetBuffer = wsRet.GetBuffer(iCount); - FX_INT32 iDestCount = 0; - FX_INT32 i = 0; + int32_t iDestCount = 0; + int32_t i = 0; if (wsNewValue[i] == L'-') { pRetBuffer[iIndex++] = '-'; } else if (wsNewValue[i] == L'+') { i++; } FX_BOOL bHasPoint = FALSE; - FX_INT32 nCharStart = -1; + int32_t nCharStart = -1; for ( ; i < iCount; i ++) { FX_WCHAR wc = wsNewValue[i]; if (XFA_IsDigit(wc)) { @@ -3152,18 +3152,18 @@ static CFX_WideString XFA_NumericNormalize(const CFX_WideString &wsValue, IFX_Lo wsRet.ReleaseBuffer(iCount); return wsRet; } -CFX_WideString XFA_NumericLimit(const CFX_WideString &wsValue, FX_INT32 iLead, FX_INT32 iTread) +CFX_WideString XFA_NumericLimit(const CFX_WideString &wsValue, int32_t iLead, int32_t iTread) { if ((iLead == - 1) && (iTread == -1)) { return wsValue; } CFX_WideString wsRet; - FX_INT32 iLead_ = 0, iTread_ = -1; - FX_INT32 iCount = wsValue.GetLength(); + int32_t iLead_ = 0, iTread_ = -1; + int32_t iCount = wsValue.GetLength(); if (iCount == 0) { return wsValue; } - FX_INT32 i = 0; + int32_t i = 0; if (wsValue[i] == L'-') { wsRet += L'-'; i++; @@ -3222,8 +3222,8 @@ FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue, XFA_VALUEPICTUR widgetValue = CXFA_LocaleValue(widgetValue.GetType(), wsNewText, wsPicture, pLocale, pLocalMgr); wsNewText = widgetValue.GetValue(); if (uiType == XFA_ELEMENT_NumericEdit) { - FX_INT32 iLeadDigits = 0; - FX_INT32 iFracDigits = 0; + int32_t iLeadDigits = 0; + int32_t iFracDigits = 0; GetLeadDigits(iLeadDigits); GetFracDigits(iFracDigits); wsNewText = XFA_NumericLimit(wsNewText, iLeadDigits, iFracDigits); @@ -3233,8 +3233,8 @@ FX_BOOL CXFA_WidgetData::SetValue(const CFX_WideString& wsValue, XFA_VALUEPICTUR } else { if (uiType == XFA_ELEMENT_NumericEdit) { if (wsNewText != FX_WSTRC(L"0")) { - FX_INT32 iLeadDigits = 0; - FX_INT32 iFracDigits = 0; + int32_t iLeadDigits = 0; + int32_t iFracDigits = 0; GetLeadDigits(iLeadDigits); GetFracDigits(iFracDigits); wsNewText = XFA_NumericLimit(wsNewText, iLeadDigits, iFracDigits); @@ -3369,8 +3369,8 @@ static FX_BOOL XFA_SplitDateTime(const CFX_WideString& wsDateTime, CFX_WideStrin } wsDate = wsDateTime.Left(nSplitIndex); if (!wsDate.IsEmpty()) { - FX_INT32 iCount = wsDate.GetLength(); - FX_INT32 i = 0; + int32_t iCount = wsDate.GetLength(); + int32_t i = 0; for (i = 0; i < iCount; i++) { if (wsDate[i] >= '0' && wsDate[i] <= '9') { break; @@ -3382,8 +3382,8 @@ static FX_BOOL XFA_SplitDateTime(const CFX_WideString& wsDateTime, CFX_WideStrin } wsTime = wsDateTime.Right(wsDateTime.GetLength() - nSplitIndex - 1); if (!wsTime.IsEmpty()) { - FX_INT32 iCount = wsTime.GetLength(); - FX_INT32 i = 0; + int32_t iCount = wsTime.GetLength(); + int32_t i = 0; for (i = 0; i < iCount; i++) { if (wsTime[i] >= '0' && wsTime[i] <= '9') { break; @@ -3460,7 +3460,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString &wsValue, XFA_VALUEPICTURE eVal switch(uiType) { case XFA_ELEMENT_ChoiceList: { if (eValueType == XFA_VALUEPICTURE_Display) { - FX_INT32 iSelItemIndex = GetSelectedItem(0); + int32_t iSelItemIndex = GetSelectedItem(0); if (iSelItemIndex >= 0) { GetChoiceListItem(wsValue, iSelItemIndex); wsPicture.Empty(); @@ -3559,7 +3559,7 @@ FX_BOOL CXFA_WidgetData::GetFormatDataValue(FX_WSTR wsValue, CFX_WideString &wsF if (!pValueChild) { return FALSE; } - FX_INT32 iVTType = XFA_VT_NULL; + int32_t iVTType = XFA_VT_NULL; XFA_ELEMENT eType = pValueChild->GetClassID(); switch (eType) { case XFA_ELEMENT_Decimal: @@ -3627,8 +3627,8 @@ void CXFA_WidgetData::NormalizeNumStr(const CFX_WideString& wsValue, CFX_WideStr } wsOutput = wsValue; wsOutput.TrimLeft('0'); - FX_INT32 dot_index = wsOutput.Find('.'); - FX_INT32 iFracDigits = 0; + int32_t dot_index = wsOutput.Find('.'); + int32_t iFracDigits = 0; if (!wsOutput.IsEmpty() && dot_index >= 0 && (!GetFracDigits(iFracDigits) || iFracDigits != -1)) { wsOutput.TrimRight(L"0"); wsOutput.TrimRight(L"."); @@ -3650,16 +3650,16 @@ void CXFA_WidgetData::FormatNumStr(const CFX_WideString& wsValue, IFX_Locale* pL bNeg = TRUE; wsSrcNum.Delete(0, 1); } - FX_INT32 len = wsSrcNum.GetLength(); - FX_INT32 dot_index = wsSrcNum.Find('.'); + int32_t len = wsSrcNum.GetLength(); + int32_t dot_index = wsSrcNum.Find('.'); if (dot_index == -1) { dot_index = len; } - FX_INT32 cc = dot_index - 1; + int32_t cc = dot_index - 1; if (cc >= 0) { int nPos = dot_index % 3; wsOutput.Empty(); - for (FX_INT32 i = 0; i < dot_index; i++) { + for (int32_t i = 0; i < dot_index; i++) { if (i % 3 == nPos && i != 0) { wsOutput += wsGroupSymbol; } @@ -3690,7 +3690,7 @@ void CXFA_WidgetData::SyncValue(const CFX_WideString& wsValue, FX_BOOL bNotify) } m_pNode->SetContent(wsValue, wsFormatValue, bNotify); } -void CXFA_WidgetData::InsertListTextItem(CXFA_Node* pItems, FX_WSTR wsText, FX_INT32 nIndex ) +void CXFA_WidgetData::InsertListTextItem(CXFA_Node* pItems, FX_WSTR wsText, int32_t nIndex ) { CXFA_Node* pText = pItems->CreateSamePacketNode(XFA_ELEMENT_Text); pItems->InsertChild(nIndex, pText); @@ -3712,9 +3712,9 @@ CXFA_Manifest CXFA_WidgetData::GetManifest(FX_BOOL bModified) } CXFA_Occur::CXFA_Occur(CXFA_Node *pNode) : CXFA_Data(pNode) { } -FX_INT32 CXFA_Occur::GetMax() +int32_t CXFA_Occur::GetMax() { - FX_INT32 iMax = 1; + int32_t iMax = 1; if (m_pNode) { if(!m_pNode->TryInteger(XFA_ATTRIBUTE_Max, iMax, TRUE)) { iMax = GetMin(); @@ -3722,9 +3722,9 @@ FX_INT32 CXFA_Occur::GetMax() } return iMax; } -FX_INT32 CXFA_Occur::GetMin() +int32_t CXFA_Occur::GetMin() { - FX_INT32 iMin = 1; + int32_t iMin = 1; if (m_pNode) { if(!m_pNode->TryInteger(XFA_ATTRIBUTE_Min, iMin, TRUE) || iMin < 0) { iMin = 1; @@ -3732,18 +3732,18 @@ FX_INT32 CXFA_Occur::GetMin() } return iMin; } -FX_INT32 CXFA_Occur::GetInitial() +int32_t CXFA_Occur::GetInitial() { - FX_INT32 iInit = 1; + int32_t iInit = 1; if (m_pNode) { - FX_INT32 iMin = GetMin(); + int32_t iMin = GetMin(); if(!m_pNode->TryInteger(XFA_ATTRIBUTE_Initial, iInit, TRUE) || iInit < iMin) { iInit = iMin; } } return iInit; } -FX_BOOL CXFA_Occur::GetOccurInfo(FX_INT32& iMin, FX_INT32& iMax, FX_INT32& iInit) +FX_BOOL CXFA_Occur::GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit) { if(!m_pNode) { return FALSE; @@ -3763,21 +3763,21 @@ FX_BOOL CXFA_Occur::GetOccurInfo(FX_INT32& iMin, FX_INT32& iMax, FX_INT32& iInit } return TRUE; } -void CXFA_Occur::SetMax(FX_INT32 iMax) +void CXFA_Occur::SetMax(int32_t iMax) { iMax = (iMax != -1 && iMax < 1) ? 1 : iMax; m_pNode->SetInteger(XFA_ATTRIBUTE_Max, iMax, FALSE); - FX_INT32 iMin = GetMin(); + int32_t iMin = GetMin(); if (iMax != -1 && iMax < iMin) { iMin = iMax; m_pNode->SetInteger(XFA_ATTRIBUTE_Min, iMin, FALSE); } } -void CXFA_Occur::SetMin(FX_INT32 iMin) +void CXFA_Occur::SetMin(int32_t iMin) { iMin = (iMin < 0) ? 1 : iMin; m_pNode->SetInteger(XFA_ATTRIBUTE_Min, iMin, FALSE); - FX_INT32 iMax = GetMax(); + int32_t iMax = GetMax(); if (iMax > 0 && iMax < iMin) { iMax = iMin; m_pNode->SetInteger(XFA_ATTRIBUTE_Max, iMax, FALSE); @@ -3933,9 +3933,9 @@ CFX_WideString CXFA_Filter::GetlockDocumentContent() } return wsContent; } -FX_INT32 CXFA_Filter::GetMDPPermissions() +int32_t CXFA_Filter::GetMDPPermissions() { - FX_INT32 iPermissions = 2; + int32_t iPermissions = 2; if (m_pNode) { CXFA_Node* pMDPNode = m_pNode->GetProperty(0, XFA_ELEMENT_Mdp); if (!pMDPNode->TryInteger(XFA_ATTRIBUTE_Permissions, iPermissions, TRUE)) { @@ -3993,11 +3993,11 @@ XFA_ATTRIBUTEENUM CXFA_WrapCertificate::GetType() { return XFA_GetEnumTypeAttribute(m_pNode); } -FX_INT32 CXFA_WrapCertificate::CountCertificates() +int32_t CXFA_WrapCertificate::CountCertificates() { return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_Certificate) : 0; } -CXFA_Certificate CXFA_WrapCertificate::GetCertificate(FX_INT32 nIndex) +CXFA_Certificate CXFA_WrapCertificate::GetCertificate(int32_t nIndex) { return CXFA_Certificate((nIndex > -1 && m_pNode) ? m_pNode->GetChild(nIndex, XFA_ELEMENT_Certificate) : NULL); } @@ -4005,11 +4005,11 @@ XFA_ATTRIBUTEENUM CXFA_Oids::GetOidsType() { return XFA_GetEnumTypeAttribute(m_pNode); } -FX_INT32 CXFA_Oids::CountOids() +int32_t CXFA_Oids::CountOids() { return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_Oid) : 0; } -CFX_WideString CXFA_Oids::GetOidContent(FX_INT32 nIndex) +CFX_WideString CXFA_Oids::GetOidContent(int32_t nIndex) { if (nIndex <= -1 || !m_pNode) { return FX_WSTRC(L""); @@ -4026,11 +4026,11 @@ XFA_ATTRIBUTEENUM CXFA_SubjectDNs::GetSubjectDNsType() { return XFA_GetEnumTypeAttribute(m_pNode); } -FX_INT32 CXFA_SubjectDNs::CountSubjectDNs() +int32_t CXFA_SubjectDNs::CountSubjectDNs() { return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_SubjectDN) : 0; } -CFX_WideString CXFA_SubjectDNs::GetSubjectDNString(FX_INT32 nIndex, XFA_ATTRIBUTE eAttribute) +CFX_WideString CXFA_SubjectDNs::GetSubjectDNString(int32_t nIndex, XFA_ATTRIBUTE eAttribute) { if (nIndex <= -1 || !m_pNode) { return FX_WSTRC(L""); @@ -4043,7 +4043,7 @@ CFX_WideString CXFA_SubjectDNs::GetSubjectDNString(FX_INT32 nIndex, XFA_ATTRIBUT pSubjectDNNode->GetAttribute(eAttribute, wsAttributeValue, FALSE); return wsAttributeValue; } -CFX_WideString CXFA_SubjectDNs::GetSubjectDNContent(FX_INT32 nIndex) +CFX_WideString CXFA_SubjectDNs::GetSubjectDNContent(int32_t nIndex) { if (nIndex <= -1 || !m_pNode) { return FX_WSTRC(L""); @@ -4060,11 +4060,11 @@ XFA_ATTRIBUTEENUM CXFA_DigestMethods::GetDigestMethodsType() { return XFA_GetEnumTypeAttribute(m_pNode); } -FX_INT32 CXFA_DigestMethods::CountDigestMethods() +int32_t CXFA_DigestMethods::CountDigestMethods() { return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_DigestMethod) : 0; } -CFX_WideString CXFA_DigestMethods::GetDigestMethodContent(FX_INT32 nIndex) +CFX_WideString CXFA_DigestMethods::GetDigestMethodContent(int32_t nIndex) { if (nIndex <= -1 || !m_pNode) { return FX_WSTRC(L""); @@ -4081,11 +4081,11 @@ XFA_ATTRIBUTEENUM CXFA_Encodings::GetEncodingsType() { return XFA_GetEnumTypeAttribute(m_pNode); } -FX_INT32 CXFA_Encodings::CountEncodings() +int32_t CXFA_Encodings::CountEncodings() { return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_Encoding) : 0; } -CFX_WideString CXFA_Encodings::GetEncodingContent(FX_INT32 nIndex) +CFX_WideString CXFA_Encodings::GetEncodingContent(int32_t nIndex) { if (nIndex <= -1 || !m_pNode) { return FX_WSTRC(L""); @@ -4102,11 +4102,11 @@ XFA_ATTRIBUTEENUM CXFA_EncryptionMethods::GetEncryptionMethodsType() { return XFA_GetEnumTypeAttribute(m_pNode); } -FX_INT32 CXFA_EncryptionMethods::CountEncryptionMethods() +int32_t CXFA_EncryptionMethods::CountEncryptionMethods() { return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_EncryptionMethod) : 0; } -CFX_WideString CXFA_EncryptionMethods::GetEncryptionMethodContent(FX_INT32 nIndex) +CFX_WideString CXFA_EncryptionMethods::GetEncryptionMethodContent(int32_t nIndex) { if (nIndex <= -1 || !m_pNode) { return FX_WSTRC(L""); @@ -4123,11 +4123,11 @@ XFA_ATTRIBUTEENUM CXFA_Reasons::GetReasonsType() { return XFA_GetEnumTypeAttribute(m_pNode); } -FX_INT32 CXFA_Reasons::CountReasons() +int32_t CXFA_Reasons::CountReasons() { return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_Reason) : 0; } -CFX_WideString CXFA_Reasons::GetReasonContent(FX_INT32 nIndex) +CFX_WideString CXFA_Reasons::GetReasonContent(int32_t nIndex) { if (nIndex <= -1 || !m_pNode) { return FX_WSTRC(L""); @@ -4144,11 +4144,11 @@ XFA_ATTRIBUTEENUM CXFA_Manifest::GetAction() { return XFA_GetEnumTypeAttribute(m_pNode, XFA_ATTRIBUTE_Action, XFA_ATTRIBUTEENUM_Include); } -FX_INT32 CXFA_Manifest::CountReives() +int32_t CXFA_Manifest::CountReives() { return m_pNode ? m_pNode->CountChildren(XFA_ELEMENT_Ref) : 0; } -CFX_WideString CXFA_Manifest::GetRefContent(FX_INT32 nIndex) +CFX_WideString CXFA_Manifest::GetRefContent(int32_t nIndex) { if (nIndex <= -1 || !m_pNode) { return FX_WSTRC(L""); diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp index a8e9772669..71ceebf764 100644 --- a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp @@ -60,7 +60,7 @@ static IFDE_XMLNode* XFA_FDEExtension_GetDocumentNode(IFDE_XMLDoc *pXMLDoc, FX_B } return NULL; } -FX_INT32 CXFA_SimpleParser::StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID) +int32_t CXFA_SimpleParser::StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID) { CloseParser(); m_pFileRead = pStream; @@ -86,12 +86,12 @@ FX_INT32 CXFA_SimpleParser::StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePac m_ePacketID = ePacketID; return XFA_PARSESTATUS_Ready; } -FX_INT32 CXFA_SimpleParser::DoParse(IFX_Pause *pPause) +int32_t CXFA_SimpleParser::DoParse(IFX_Pause *pPause) { if (m_pXMLDoc == NULL || m_ePacketID == XFA_XDPPACKET_UNKNOWN) { return XFA_PARSESTATUS_StatusErr; } - FX_INT32 iRet = m_pXMLDoc->DoLoad(pPause); + int32_t iRet = m_pXMLDoc->DoLoad(pPause); if (iRet < 0) { return XFA_PARSESTATUS_SyntaxErr; } @@ -109,7 +109,7 @@ FX_INT32 CXFA_SimpleParser::DoParse(IFX_Pause *pPause) } return XFA_PARSESTATUS_Done; } -FX_INT32 CXFA_SimpleParser::ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause) +int32_t CXFA_SimpleParser::ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause) { CloseParser(); pXMLNode = NULL; @@ -132,7 +132,7 @@ FX_INT32 CXFA_SimpleParser::ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNo if (!m_pXMLDoc->LoadXML(pParser)) { return XFA_PARSESTATUS_StatusErr; } - FX_INT32 iRet = m_pXMLDoc->DoLoad(pPause); + int32_t iRet = m_pXMLDoc->DoLoad(pPause); if (iRet < 0 || iRet >= 100) { m_pXMLDoc->CloseXML(); } @@ -285,7 +285,7 @@ static FX_BOOL XFA_FDEExtension_FindAttributeWithNS(IFDE_XMLElement *pElement, F CFX_WideString wsAttrName; CFX_WideString wsAttrValue; CFX_WideString wsAttrNS; - for(FX_INT32 iAttrCount = pElement->CountAttributes(), i = 0; i < iAttrCount; i ++) { + for(int32_t iAttrCount = pElement->CountAttributes(), i = 0; i < iAttrCount; i ++) { pElement->GetAttribute(i, wsAttrName, wsAttrValue); FX_STRSIZE iFind = wsAttrName.Find(L':', 0); CFX_WideString wsNSPrefix; @@ -354,8 +354,8 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(IFDE_XMLNode* pXMLDocumentNod pXFARootNode->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"xfa")); { IFDE_XMLElement* pElement = (IFDE_XMLElement*)pXMLDocumentNode; - FX_INT32 iAttributeCount = pElement->CountAttributes(); - for(FX_INT32 i = 0; i < iAttributeCount; i++) { + int32_t iAttributeCount = pElement->CountAttributes(); + for(int32_t i = 0; i < iAttributeCount; i++) { CFX_WideString wsAttriName, wsAttriValue; pElement->GetAttribute(i, wsAttriName, wsAttriValue); if(wsAttriName == FX_WSTRC(L"uuid")) { @@ -706,7 +706,7 @@ CXFA_Node* CXFA_SimpleParser::NormalLoader(CXFA_Node* pXFANode, IFDE_XMLNode* pX pXFAChild->SetAttribute(XFA_ATTRIBUTE_Name, wsTagName); } FX_BOOL IsNeedValue = TRUE; - for(FX_INT32 i = 0, count = pXMLElement->CountAttributes(); i < count; i++) { + for(int32_t i = 0, count = pXMLElement->CountAttributes(); i < count; i++) { CFX_WideString wsAttrQualifiedName; CFX_WideString wsAttrName; CFX_WideString wsAttrValue; @@ -968,7 +968,7 @@ void CXFA_SimpleParser::ParseDataGroup(CXFA_Node* pXFANode, IFDE_XMLNode* pXMLNo pXFAChild->SetCData(XFA_ATTRIBUTE_Name, wsNodeName); FX_BOOL bNeedValue = TRUE; if (1) { - for(FX_INT32 i = 0, count = pXMLElement->CountAttributes(); i < count; i++) { + for(int32_t i = 0, count = pXMLElement->CountAttributes(); i < count; i++) { CFX_WideString wsAttrQualifiedName; CFX_WideString wsAttrValue; CFX_WideString wsAttrName; @@ -1158,7 +1158,7 @@ void CXFA_SimpleParser::ParseInstruction(CXFA_Node *pXFANode, IFDE_XMLInstructio } CFX_WideString wsTargetName; pXMLInstruction->GetTargetName(wsTargetName); - FX_INT32 iDataCount = pXMLInstruction->CountData(); + int32_t iDataCount = pXMLInstruction->CountData(); if (wsTargetName == FX_WSTRC(L"originalXFAVersion")) { CFX_WideString wsData; if(pXMLInstruction->GetData(0, wsData) && (pXFANode->GetDocument()->RecognizeXFAVersionNumber(wsData) != XFA_VERSION_UNKNOWN)) { @@ -1201,29 +1201,29 @@ CXFA_DocumentParser::~CXFA_DocumentParser() { CloseParser(); } -FX_INT32 CXFA_DocumentParser::StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID ) +int32_t CXFA_DocumentParser::StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID ) { CloseParser(); - FX_INT32 nRetStatus = m_nodeParser.StartParse(pStream, ePacketID); + int32_t nRetStatus = m_nodeParser.StartParse(pStream, ePacketID); if(nRetStatus == XFA_PARSESTATUS_Ready) { m_pDocument = FX_NEW CXFA_Document(this); m_nodeParser.SetFactory(m_pDocument); } return nRetStatus; } -FX_INT32 CXFA_DocumentParser::DoParse(IFX_Pause *pPause ) +int32_t CXFA_DocumentParser::DoParse(IFX_Pause *pPause ) { - FX_INT32 nRetStatus = m_nodeParser.DoParse(pPause); + int32_t nRetStatus = m_nodeParser.DoParse(pPause); if (nRetStatus >= XFA_PARSESTATUS_Done) { FXSYS_assert(m_pDocument); m_pDocument->SetRoot(m_nodeParser.GetRootNode()); } return nRetStatus; } -FX_INT32 CXFA_DocumentParser::ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause) +int32_t CXFA_DocumentParser::ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause) { CloseParser(); - FX_INT32 nRetStatus = m_nodeParser.ParseXMLData(wsXML, pXMLNode, NULL); + int32_t nRetStatus = m_nodeParser.ParseXMLData(wsXML, pXMLNode, NULL); if(nRetStatus == XFA_PARSESTATUS_Done && pXMLNode) { m_pDocument = FX_NEW CXFA_Document(this); m_nodeParser.SetFactory(m_pDocument); @@ -1279,7 +1279,7 @@ CXFA_XMLParser::~CXFA_XMLParser() m_ws1.Empty(); m_ws2.Empty(); } -FX_INT32 CXFA_XMLParser::DoParser(IFX_Pause *pPause) +int32_t CXFA_XMLParser::DoParser(IFX_Pause *pPause) { if (m_dwStatus == FDE_XMLSYNTAXSTATUS_Error) { return -1; @@ -1287,7 +1287,7 @@ FX_INT32 CXFA_XMLParser::DoParser(IFX_Pause *pPause) if (m_dwStatus == FDE_XMLSYNTAXSTATUS_EOS) { return 100; } - FX_INT32 iCount = 0; + int32_t iCount = 0; while (TRUE) { m_dwStatus = m_pParser->DoSyntaxParse(); switch (m_dwStatus) { diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp.h b/xfa/src/fxfa/src/parser/xfa_parser_imp.h index 626141a02c..cdfbe70917 100644 --- a/xfa/src/fxfa/src/parser/xfa_parser_imp.h +++ b/xfa/src/fxfa/src/parser/xfa_parser_imp.h @@ -18,9 +18,9 @@ public: delete this; } - virtual FX_INT32 StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP); - virtual FX_INT32 DoParse(IFX_Pause *pPause = NULL); - virtual FX_INT32 ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause = NULL); + virtual int32_t StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP); + virtual int32_t DoParse(IFX_Pause *pPause = NULL); + virtual int32_t ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause = NULL); virtual void ConstructXFANode(CXFA_Node* pXFANode, IFDE_XMLNode* pXMLNode); virtual IXFA_ObjFactory* GetFactory() const { @@ -72,9 +72,9 @@ public: { delete this; } - virtual FX_INT32 StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP); - virtual FX_INT32 DoParse(IFX_Pause *pPause = NULL); - virtual FX_INT32 ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause = NULL); + virtual int32_t StartParse(IFX_FileRead *pStream, XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP); + virtual int32_t DoParse(IFX_Pause *pPause = NULL); + virtual int32_t ParseXMLData(const CFX_WideString &wsXML, IFDE_XMLNode* &pXMLNode, IFX_Pause *pPause = NULL); virtual void ConstructXFANode(CXFA_Node* pXFANode, IFDE_XMLNode* pXMLNode); virtual IXFA_ObjFactory* GetFactory() const { @@ -113,7 +113,7 @@ public: { delete this; } - virtual FX_INT32 DoParser(IFX_Pause *pPause); + virtual int32_t DoParser(IFX_Pause *pPause); protected: IFDE_XMLNode *m_pRoot; IFX_Stream *m_pStream; diff --git a/xfa/src/fxfa/src/parser/xfa_script_eventpseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_eventpseudomodel.cpp index fb83349961..6e06a0fd8f 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_eventpseudomodel.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_eventpseudomodel.cpp @@ -35,7 +35,7 @@ void Script_EventPseudoModel_StringProperty(FXJSE_HVALUE hValue, CFX_WideString& FXJSE_Value_SetUTF8String(hValue, FX_UTF8Encode(wsValue)); } } -void Script_EventPseudoModel_InterProperty(FXJSE_HVALUE hValue, FX_INT32& iValue, FX_BOOL bSetting) +void Script_EventPseudoModel_InterProperty(FXJSE_HVALUE hValue, int32_t& iValue, FX_BOOL bSetting) { if (bSetting) { iValue = FXJSE_Value_ToInteger(hValue); diff --git a/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp index f4254f0bbc..5a1eff1a4a 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.cpp @@ -84,7 +84,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_CurrentPage(FXJSE_HVALUE hV pNotify->GetDocProvider()->SetCurrentPage(hDoc, FXJSE_Value_ToInteger(hValue)); return; } - FX_INT32 iCurrentPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc); + int32_t iCurrentPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc); FXJSE_Value_SetInteger(hValue, iCurrentPage); } void CScript_HostPseudoModel::Script_HostPseudoModel_Language(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) @@ -112,7 +112,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_NumPages(FXJSE_HVALUE hValu ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_NUMPAGES); return; } - FX_INT32 iNumPages = pNotify->GetDocProvider()->CountPages(hDoc); + int32_t iNumPages = pNotify->GetDocProvider()->CountPages(hDoc); FXJSE_Value_SetInteger(hValue, iNumPages); } void CScript_HostPseudoModel::Script_HostPseudoModel_Platform(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute) @@ -241,7 +241,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_GotoURL(CFXJSE_Arguments* p if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { return; } - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"gotoURL"); return; @@ -263,7 +263,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(CFXJSE_Arguments* if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { return; } - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"openList"); return; @@ -293,7 +293,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(CFXJSE_Arguments* } FX_DWORD dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; XFA_RESOLVENODE_RS resoveNodeRS; - FX_INT32 iRet = pScriptContext->ResolveObjects(pObject, wsExpression, resoveNodeRS, dwFlag); + int32_t iRet = pScriptContext->ResolveObjects(pObject, wsExpression, resoveNodeRS, dwFlag); if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) { FXJSE_Value_Release(hValue); return; @@ -315,7 +315,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_OpenList(CFXJSE_Arguments* } void CScript_HostPseudoModel::Script_HostPseudoModel_Response(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 4) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"response"); return; @@ -356,21 +356,21 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentInBatch(CFXJSE_Argu if (!pNotify) { return; } - FX_INT32 iCur = pNotify->GetAppProvider()->GetCurDocumentInBatch(); + int32_t iCur = pNotify->GetAppProvider()->GetCurDocumentInBatch(); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { FXJSE_Value_SetInteger(hValue, iCur); } } -static FX_INT32 XFA_FilterName(FX_WSTR wsExpression, FX_INT32 nStart, CFX_WideString &wsFilter) +static int32_t XFA_FilterName(FX_WSTR wsExpression, int32_t nStart, CFX_WideString &wsFilter) { FXSYS_assert(nStart > -1); - FX_INT32 iLength = wsExpression.GetLength(); + int32_t iLength = wsExpression.GetLength(); if (nStart >= iLength) { return iLength; } FX_LPWSTR pBuf = wsFilter.GetBuffer(iLength - nStart); - FX_INT32 nCount = 0; + int32_t nCount = 0; FX_LPCWSTR pSrc = wsExpression.GetPtr(); FX_WCHAR wCur; while (nStart < iLength) { @@ -387,7 +387,7 @@ static FX_INT32 XFA_FilterName(FX_WSTR wsExpression, FX_INT32 nStart, CFX_WideSt } void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 0 || iLength > 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resetData"); return; @@ -405,10 +405,10 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData(CFXJSE_Arguments* pNotify->ResetData(); return; } - FX_INT32 iStart = 0; + int32_t iStart = 0; CFX_WideString wsName; CXFA_Node* pNode = NULL; - FX_INT32 iExpLength = wsExpression.GetLength(); + int32_t iExpLength = wsExpression.GetLength(); while (iStart < iExpLength) { iStart = XFA_FilterName(wsExpression, iStart, wsName); IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); @@ -421,7 +421,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ResetData(CFXJSE_Arguments* } FX_DWORD dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; XFA_RESOLVENODE_RS resoveNodeRS; - FX_INT32 iRet = pScriptContext->ResolveObjects(pObject, wsName, resoveNodeRS, dwFlag); + int32_t iRet = pScriptContext->ResolveObjects(pObject, wsName, resoveNodeRS, dwFlag); if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) { continue; } @@ -437,7 +437,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Beep(CFXJSE_Arguments* pArg if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { return; } - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 0 || iLength > 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"beep"); return; @@ -457,7 +457,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(CFXJSE_Arguments* if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { return; } - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"setFocus"); return; @@ -488,7 +488,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_SetFocus(CFXJSE_Arguments* } FX_DWORD dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; XFA_RESOLVENODE_RS resoveNodeRS; - FX_INT32 iRet = pScriptContext->ResolveObjects(pObject, wsExpression, resoveNodeRS, dwFlag); + int32_t iRet = pScriptContext->ResolveObjects(pObject, wsExpression, resoveNodeRS, dwFlag); if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) { FXJSE_Value_Release(hValue); return; @@ -516,7 +516,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_MessageBox(CFXJSE_Arguments if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { return; } - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 4) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"messageBox"); return; @@ -551,13 +551,13 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_MessageBox(CFXJSE_Arguments dwButtonType = XFA_MB_OK; } } - FX_INT32 iValue = pNotify->GetAppProvider()->MsgBox(wsMessage, bsTitle, dwMessageType, dwButtonType); + int32_t iValue = pNotify->GetAppProvider()->MsgBox(wsMessage, bsTitle, dwMessageType, dwButtonType); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { FXJSE_Value_SetInteger(hValue, iValue); } } -FX_BOOL CScript_HostPseudoModel::Script_HostPseudoModel_ValidateArgsForMsg(CFXJSE_Arguments* pArguments, FX_INT32 iArgIndex, CFX_WideString& wsValue) +FX_BOOL CScript_HostPseudoModel::Script_HostPseudoModel_ValidateArgsForMsg(CFXJSE_Arguments* pArguments, int32_t iArgIndex, CFX_WideString& wsValue) { if(pArguments == NULL || iArgIndex < 0) { return FALSE; @@ -588,7 +588,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentCountInBatch(CFXJSE if (!pNotify) { return; } - FX_INT32 iValue = pNotify->GetAppProvider()->GetDocumentCountInBatch(); + int32_t iValue = pNotify->GetAppProvider()->GetDocumentCountInBatch(); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { FXJSE_Value_SetInteger(hValue, iValue); @@ -599,7 +599,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Print(CFXJSE_Arguments* pAr if (!m_pDocument->GetScriptContext()->IsRunAtClient()) { return; } - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 8) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"print"); return; @@ -617,11 +617,11 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Print(CFXJSE_Arguments* pAr if(bShowDialog) { dwOptions |= XFA_PRINTOPT_ShowDialog; } - FX_INT32 nStartPage = 0; + int32_t nStartPage = 0; if (iLength >= 2) { nStartPage = pArguments->GetInt32(1); } - FX_INT32 nEndPage = 0; + int32_t nEndPage = 0; if (iLength >= 3) { nEndPage = pArguments->GetInt32(2); } @@ -665,7 +665,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_Print(CFXJSE_Arguments* pAr } void CScript_HostPseudoModel::Script_HostPseudoModel_ImportData(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 0 || iLength > 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"importData"); return; @@ -684,7 +684,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_ImportData(CFXJSE_Arguments } void CScript_HostPseudoModel::Script_HostPseudoModel_ExportData(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 0 || iLength > 2) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"exportData"); return; @@ -712,8 +712,8 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_PageUp(CFXJSE_Arguments* pA return; } IXFA_Doc* hDoc = pNotify->GetHDOC(); - FX_INT32 nCurPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc); - FX_INT32 nNewPage = 0; + int32_t nCurPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc); + int32_t nNewPage = 0; if (nCurPage <= 1) { return; } @@ -727,12 +727,12 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_PageDown(CFXJSE_Arguments* return; } IXFA_Doc* hDoc = pNotify->GetHDOC(); - FX_INT32 nCurPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc); - FX_INT32 nPageCount = pNotify->GetDocProvider()->CountPages(hDoc); + int32_t nCurPage = pNotify->GetDocProvider()->GetCurrentPage(hDoc); + int32_t nPageCount = pNotify->GetDocProvider()->CountPages(hDoc); if (!nPageCount || nCurPage == nPageCount) { return; } - FX_INT32 nNewPage = 0; + int32_t nNewPage = 0; if (nCurPage >= nPageCount) { nNewPage = nPageCount - 1; } else { diff --git a/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.h b/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.h index 118680e792..ef9d81d3ce 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.h +++ b/xfa/src/fxfa/src/parser/xfa_script_hostpseudomodel.h @@ -45,6 +45,6 @@ public: void Script_HostPseudoModel_CurrentDateTime(CFXJSE_Arguments* pArguments); protected: void Script_HostPseudoModel_LoadString(FXJSE_HVALUE hValue, IXFA_Notify* pNotify, FX_DWORD dwFlag); - FX_BOOL Script_HostPseudoModel_ValidateArgsForMsg(CFXJSE_Arguments* pArguments, FX_INT32 iArgIndex, CFX_WideString& wsValue); + FX_BOOL Script_HostPseudoModel_ValidateArgsForMsg(CFXJSE_Arguments* pArguments, int32_t iArgIndex, CFX_WideString& wsValue); }; #endif diff --git a/xfa/src/fxfa/src/parser/xfa_script_imp.cpp b/xfa/src/fxfa/src/parser/xfa_script_imp.cpp index cd196f585d..be10dff62a 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_imp.cpp @@ -53,7 +53,7 @@ CXFA_ScriptContext::~CXFA_ScriptContext() m_pResolveProcessor = NULL; } m_upObjectArray.RemoveAll(); - for (FX_INT32 i = 0; i < m_CacheListArray.GetSize(); i++) { + for (int32_t i = 0; i < m_CacheListArray.GetSize(); i++) { delete ((CXFA_NodeList*)m_CacheListArray[i]); } m_CacheListArray.RemoveAll(); @@ -93,7 +93,7 @@ FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType, FX_WSTR ws } CFX_WideTextBuf wsJavaScript; CFX_WideString wsErrorInfo; - FX_INT32 iFlags = XFA_FM2JS_Translate(wsScript, wsJavaScript, wsErrorInfo); + int32_t iFlags = XFA_FM2JS_Translate(wsScript, wsJavaScript, wsErrorInfo); if(iFlags) { FXJSE_Value_SetUndefined(hRetValue); return FALSE; @@ -162,7 +162,7 @@ void CXFA_ScriptContext::GlobalPropertySetter(FXJSE_HOBJECT hObject, FX_BSTR szP FX_BOOL CXFA_ScriptContext::QueryNodeByFlag(CXFA_Node* refNode, FX_WSTR propname, FXJSE_HVALUE hValue, FX_DWORD dwFlag, FX_BOOL bSetting) { XFA_RESOLVENODE_RS resolveRs; - FX_INT32 iRet = ResolveObjects(refNode, propname, resolveRs, dwFlag); + int32_t iRet = ResolveObjects(refNode, propname, resolveRs, dwFlag); FX_BOOL bResult = FALSE; if (iRet > 0) { bResult = TRUE; @@ -190,7 +190,7 @@ void CXFA_ScriptContext::GlobalPropertyGetter(FXJSE_HOBJECT hObject, FX_BSTR szP XFA_FM2JS_GlobalPropertyGetter(lpScriptContext->m_hFM2JSContext, hValue); return; } - FX_UINT32 uHashCode = FX_HashCode_String_GetW(wsPropName, wsPropName.GetLength()); + uint32_t uHashCode = FX_HashCode_String_GetW(wsPropName, wsPropName.GetLength()); if(uHashCode != XFA_HASHCODE_Layout) { CXFA_Object * pObject = lpScriptContext->GetDocument()->GetXFANode(uHashCode); if (pObject) { @@ -299,7 +299,7 @@ void CXFA_ScriptContext::NormalPropertySetter(FXJSE_HOBJECT hObject, FX_BSTR szP } } } -FX_INT32 CXFA_ScriptContext::NormalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn) +int32_t CXFA_ScriptContext::NormalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn) { CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL); if(pObject == NULL) { @@ -317,7 +317,7 @@ FX_INT32 CXFA_ScriptContext::NormalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR } return FXJSE_ClassPropType_Property; } -FX_INT32 CXFA_ScriptContext::GlobalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn) +int32_t CXFA_ScriptContext::GlobalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn) { CXFA_Object* pObject = (CXFA_Object*)FXJSE_Value_ToObject(hObject, NULL); if(pObject == NULL) { @@ -524,7 +524,7 @@ void CXFA_ScriptContext::AddJSBuiltinObject(XFA_LPCJSBUILTININFO pBuitinObject) } m_JSBuiltInObjects.SetAt(pBuitinObject->pName, (void*)pBuitinObject); } -FX_INT32 CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, FX_DWORD dwStyles, CXFA_Node* bindNode) +int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, FX_DWORD dwStyles, CXFA_Node* bindNode) { if (wsExpression.IsEmpty()) { return 0; @@ -542,9 +542,9 @@ FX_INT32 CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpr m_pResolveProcessor->GetNodeHelper()->m_pCreateParent = NULL; m_pResolveProcessor->GetNodeHelper()->m_iCurAllStart = -1; CXFA_ResolveNodesData rndFind; - FX_INT32 nStart = 0; - FX_INT32 nLevel = 0; - FX_INT32 nRet = -1; + int32_t nStart = 0; + int32_t nLevel = 0; + int32_t nRet = -1; rndFind.m_pSC = this; CXFA_ObjArray findNodes; if (refNode != NULL) { @@ -552,10 +552,10 @@ FX_INT32 CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpr } else { findNodes.Add(m_pDocument->GetRoot()); } - FX_INT32 nNodes = 0; + int32_t nNodes = 0; while (TRUE) { nNodes = findNodes.GetSize(); - FX_INT32 i = 0; + int32_t i = 0; rndFind.m_dwStyles = dwStyles; m_pResolveProcessor->m_iCurStart = nStart; nStart = m_pResolveProcessor->XFA_ResolveNodes_GetFilter(wsExpression, nStart, rndFind); @@ -614,7 +614,7 @@ FX_INT32 CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpr rndFind.m_Nodes.SetAt(0, (CXFA_Object*)FXJSE_Value_ToObject(hValue, NULL)); FXJSE_Value_Release(hValue); } - FX_INT32 iSize = m_upObjectArray.GetSize(); + int32_t iSize = m_upObjectArray.GetSize(); if (iSize) { m_upObjectArray.RemoveAt(iSize - 1); } @@ -686,12 +686,12 @@ FXJSE_HVALUE CXFA_ScriptContext::GetJSValueFromMap(CXFA_Object* pObject) } return (FXJSE_HVALUE)pValue; } -FX_INT32 CXFA_ScriptContext::GetIndexByName(CXFA_Node* refNode) +int32_t CXFA_ScriptContext::GetIndexByName(CXFA_Node* refNode) { CXFA_NodeHelper* lpNodeHelper = m_pResolveProcessor->GetNodeHelper(); return lpNodeHelper->XFA_GetIndex(refNode, XFA_LOGIC_Transparent, lpNodeHelper->XFA_NodeIsProperty(refNode), FALSE); } -FX_INT32 CXFA_ScriptContext::GetIndexByClassName(CXFA_Node* refNode) +int32_t CXFA_ScriptContext::GetIndexByClassName(CXFA_Node* refNode) { CXFA_NodeHelper* lpNodeHelper = m_pResolveProcessor->GetNodeHelper(); return lpNodeHelper->XFA_GetIndex(refNode, XFA_LOGIC_Transparent, lpNodeHelper->XFA_NodeIsProperty(refNode), TRUE); @@ -731,10 +731,10 @@ static const XFA_JSBUILTININFO gs_JSBUILTINData[] = { {0x8108b9a9, "Number"}, {0xe07e3fbe, "Date"}, }; -const FX_INT32 g_iJSBuiltinCount = sizeof(XFA_JSBUILTININFO) / sizeof(XFA_JSBUILTININFO); -XFA_LPCJSBUILTININFO XFA_GetJSBuiltinByHash(FX_UINT32 uHashCode) +const int32_t g_iJSBuiltinCount = sizeof(XFA_JSBUILTININFO) / sizeof(XFA_JSBUILTININFO); +XFA_LPCJSBUILTININFO XFA_GetJSBuiltinByHash(uint32_t uHashCode) { - FX_INT32 iStart = 0, iEnd = g_iJSBuiltinCount - 1, iMid; + int32_t iStart = 0, iEnd = g_iJSBuiltinCount - 1, iMid; do { iMid = (iStart + iEnd) / 2; XFA_LPCJSBUILTININFO pInfo = gs_JSBUILTINData + iMid; diff --git a/xfa/src/fxfa/src/parser/xfa_script_imp.h b/xfa/src/fxfa/src/parser/xfa_script_imp.h index 9ffb8bcda0..fc43583e8d 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_imp.h +++ b/xfa/src/fxfa/src/parser/xfa_script_imp.h @@ -27,7 +27,7 @@ public: } virtual FX_BOOL RunScript(XFA_SCRIPTLANGTYPE eScriptType, FX_WSTR wsScript, FXJSE_HVALUE hRetValue, CXFA_Object* pThisObject = NULL); - virtual FX_INT32 ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, FX_DWORD dwStyles = XFA_RESOLVENODE_Children, CXFA_Node* bindNode = NULL); + virtual int32_t ResolveObjects(CXFA_Object* refNode, FX_WSTR wsExpression, XFA_RESOLVENODE_RS& resolveNodeRS, FX_DWORD dwStyles = XFA_RESOLVENODE_Children, CXFA_Node* bindNode = NULL); virtual FXJSE_HVALUE GetJSValueFromMap(CXFA_Object* pObject); virtual void CacheList(CXFA_NodeList* pList) { @@ -42,8 +42,8 @@ public: return m_hJsRuntime; } - virtual FX_INT32 GetIndexByName(CXFA_Node* refNode); - virtual FX_INT32 GetIndexByClassName(CXFA_Node* refNode); + virtual int32_t GetIndexByName(CXFA_Node* refNode); + virtual int32_t GetIndexByClassName(CXFA_Node* refNode); virtual void GetSomExpression(CXFA_Node* refNode, CFX_WideString &wsExpression); virtual void SetNodesOfRunScript(CXFA_NodeArray *pArray); @@ -68,8 +68,8 @@ public: static void NormalPropertyGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FXJSE_HVALUE hValue); static void NormalPropertySetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FXJSE_HVALUE hValue); static void NormalMethodCall(FXJSE_HOBJECT hThis, FX_BSTR szFuncName, CFXJSE_Arguments &args); - static FX_INT32 NormalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn); - static FX_INT32 GlobalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn); + static int32_t NormalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn); + static int32_t GlobalPropTypeGetter(FXJSE_HOBJECT hObject, FX_BSTR szPropName, FX_BOOL bQueryIn); FX_BOOL RunVariablesScript(CXFA_Node* pScriptNode); CXFA_Object* GetVariablesThis(CXFA_Object* pObject, FX_BOOL bScriptNode = FALSE); void ReleaseVariablesMap(); diff --git a/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp index 25efee719d..e28b0b7658 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.cpp @@ -38,12 +38,12 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Ready(FXJSE_HVALUE hVal ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_READY); return; } - FX_INT32 iStatus = pNotify->GetLayoutStatus(); + int32_t iStatus = pNotify->GetLayoutStatus(); FXJSE_Value_SetBoolean(hValue, iStatus >= 2); } void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY(CFXJSE_Arguments* pArguments, XFA_LAYOUTMODEL_HWXY layoutModel) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if ( iLength < 1 || iLength > 3) { FX_LPCWSTR methodName = NULL; switch (layoutModel) { @@ -65,7 +65,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY(CFXJSE_Arguments* } CXFA_Node* pNode = NULL; CFX_WideString wsUnit = FX_WSTRC(L"pt"); - FX_INT32 iIndex = 0; + int32_t iIndex = 0; if (iLength >= 1) { pNode = (CXFA_Node*)pArguments->GetObject(0); } @@ -144,10 +144,10 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_NumberedPageCount(CFXJS if (!pDocLayout) { return; } - FX_INT32 iPageCount = 0; - FX_INT32 iPageNum = pDocLayout->CountPages(); + int32_t iPageCount = 0; + int32_t iPageNum = pDocLayout->CountPages(); if (bNumbered) { - for (FX_INT32 i = 0; i < iPageNum; i++) { + for (int32_t i = 0; i < iPageNum; i++) { IXFA_LayoutPage* pLayoutPage = pDocLayout->GetPage(i); if (!pLayoutPage) { continue; @@ -171,7 +171,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageCount(CFXJSE_Argume } void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageSpan(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"pageSpan"); return; @@ -193,9 +193,9 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageSpan(CFXJSE_Argumen FXJSE_Value_SetInteger(hValue, -1); return; } - FX_INT32 iLast = pLayoutItem->GetLast()->GetPage()->GetPageIndex(); - FX_INT32 iFirst = pLayoutItem->GetFirst()->GetPage()->GetPageIndex(); - FX_INT32 iPageSpan = iLast - iFirst + 1; + int32_t iLast = pLayoutItem->GetLast()->GetPage()->GetPageIndex(); + int32_t iFirst = pLayoutItem->GetFirst()->GetPage()->GetPageIndex(); + int32_t iPageSpan = iLast - iFirst + 1; if (hValue) { FXJSE_Value_SetInteger(hValue, iPageSpan); } @@ -204,7 +204,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Page(CFXJSE_Arguments* { Script_LayoutPseudoModel_PageImp(pArguments, FALSE); } -void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_GetObjArray(IXFA_DocLayout* pDocLayout, FX_INT32 iPageNo, const CFX_WideString &wsType, FX_BOOL bOnPageArea, CXFA_NodeArray &retArray) +void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_GetObjArray(IXFA_DocLayout* pDocLayout, int32_t iPageNo, const CFX_WideString &wsType, FX_BOOL bOnPageArea, CXFA_NodeArray &retArray) { CXFA_ContainerLayoutItemImpl* pLayoutPage = (CXFA_ContainerLayoutItemImpl*)pDocLayout->GetPage(iPageNo); if (!pLayoutPage) { @@ -327,12 +327,12 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_GetObjArray(IXFA_DocLay } void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageContent(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 3) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"pageContent"); return; } - FX_INT32 iIndex = 0; + int32_t iIndex = 0; CFX_WideString wsType; FX_BOOL bOnPageArea = FALSE; if (iLength >= 1) { @@ -370,7 +370,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageCountInBatch(CFX return; } IXFA_Doc* hDoc = pNotify->GetHDOC(); - FX_INT32 iPageCount = pNotify->GetDocProvider()->AbsPageCountInBatch(hDoc); + int32_t iPageCount = pNotify->GetDocProvider()->AbsPageCountInBatch(hDoc); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { FXJSE_Value_SetInteger(hValue, iPageCount); @@ -383,7 +383,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetCountInBatch(CFXJS return; } IXFA_Doc* hDoc = pNotify->GetHDOC(); - FX_INT32 iPageCount = pNotify->GetDocProvider()->SheetCountInBatch(hDoc); + int32_t iPageCount = pNotify->GetDocProvider()->SheetCountInBatch(hDoc); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { FXJSE_Value_SetInteger(hValue, iPageCount); @@ -407,7 +407,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageSpan(CFXJSE_Argu } void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageInBatch(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"absPageInBatch"); return; @@ -432,7 +432,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageInBatch(CFXJSE_A return; } IXFA_Doc* hDoc = pNotify->GetHDOC(); - FX_INT32 iPageCount = pNotify->GetDocProvider()->AbsPageInBatch(hDoc, hWidget); + int32_t iPageCount = pNotify->GetDocProvider()->AbsPageInBatch(hDoc, hWidget); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { FXJSE_Value_SetInteger(hValue, iPageCount); @@ -440,7 +440,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageInBatch(CFXJSE_A } void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetInBatch(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"sheetInBatch"); return; @@ -465,7 +465,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetInBatch(CFXJSE_Arg return; } IXFA_Doc* hDoc = pNotify->GetHDOC(); - FX_INT32 iPageCount = pNotify->GetDocProvider()->SheetInBatch(hDoc, hWidget); + int32_t iPageCount = pNotify->GetDocProvider()->SheetInBatch(hDoc, hWidget); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { FXJSE_Value_SetInteger(hValue, iPageCount); @@ -488,7 +488,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPage(CFXJSE_Argument } void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageImp(CFXJSE_Arguments* pArguments, FX_BOOL bAbsPage) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 1) { FX_LPCWSTR methodName; if (bAbsPage) { @@ -503,7 +503,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageImp(CFXJSE_Argument if (iLength >= 1) { pNode = (CXFA_Node*)pArguments->GetObject(0); } - FX_INT32 iPage = 0; + int32_t iPage = 0; FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (!pNode && hValue) { FXJSE_Value_SetInteger(hValue, iPage); diff --git a/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.h b/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.h index c94742aa3f..d5ee57f77f 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.h +++ b/xfa/src/fxfa/src/parser/xfa_script_layoutpseudomodel.h @@ -42,7 +42,7 @@ public: void Script_LayoutPseudoModel_SheetCount(CFXJSE_Arguments* pArguments); void Script_LayoutPseudoModel_AbsPage(CFXJSE_Arguments* pArguments); protected: - void Script_LayoutPseudoModel_GetObjArray(IXFA_DocLayout* pDocLayout, FX_INT32 iPageNo, const CFX_WideString &wsType, FX_BOOL bOnPageArea, CXFA_NodeArray &retArray); + void Script_LayoutPseudoModel_GetObjArray(IXFA_DocLayout* pDocLayout, int32_t iPageNo, const CFX_WideString &wsType, FX_BOOL bOnPageArea, CXFA_NodeArray &retArray); void Script_LayoutPseudoModel_PageImp(CFXJSE_Arguments* pArguments, FX_BOOL bAbsPage); }; #endif diff --git a/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp b/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp index fc757e689d..0c793b2692 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp @@ -33,14 +33,14 @@ CXFA_Node* CXFA_NodeHelper::XFA_ResolveNodes_GetOneChild(CXFA_Node* parent, FX_ return NULL; } CXFA_NodeArray siblings; - FX_UINT32 uNameHash = FX_HashCode_String_GetW(pwsName, FXSYS_wcslen(pwsName)); + uint32_t uNameHash = FX_HashCode_String_GetW(pwsName, FXSYS_wcslen(pwsName)); XFA_NodeAcc_TraverseAnySiblings(parent, uNameHash, &siblings, bIsClassName); if (siblings.GetSize() == 0) { return NULL; } return siblings[0]; } -FX_INT32 CXFA_NodeHelper::XFA_CountSiblings(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, CXFA_NodeArray *pSiblings, FX_BOOL bIsClassName) +int32_t CXFA_NodeHelper::XFA_CountSiblings(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, CXFA_NodeArray *pSiblings, FX_BOOL bIsClassName) { CXFA_Node* parent = XFA_ResolveNodes_GetParent(pNode, XFA_LOGIC_NoTransparent); if(parent == NULL) { @@ -59,16 +59,16 @@ FX_INT32 CXFA_NodeHelper::XFA_CountSiblings(CXFA_Node* pNode, XFA_LOGIC_TYPE eL return XFA_NodeAcc_TraverseSiblings(parent, pNode->GetNameHash(), pSiblings, eLogicType, bIsClassName); } } -FX_INT32 CXFA_NodeHelper::XFA_NodeAcc_TraverseAnySiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, FX_BOOL bIsClassName ) +int32_t CXFA_NodeHelper::XFA_NodeAcc_TraverseAnySiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, FX_BOOL bIsClassName ) { if(parent == NULL || pSiblings == NULL) { return 0; } - FX_INT32 nCount = 0; - FX_INT32 i = 0; + int32_t nCount = 0; + int32_t i = 0; CXFA_NodeArray properties; parent->GetNodeList(properties, XFA_NODEFILTER_Properties); - FX_INT32 nProperties = properties.GetSize(); + int32_t nProperties = properties.GetSize(); for (i = 0; i < nProperties; ++i) { CXFA_Node* child = properties[i]; if(bIsClassName) { @@ -89,7 +89,7 @@ FX_INT32 CXFA_NodeHelper::XFA_NodeAcc_TraverseAnySiblings(CXFA_Node* parent, FX_ } CXFA_NodeArray children; parent->GetNodeList(children, XFA_NODEFILTER_Children); - FX_INT32 nChildren = children.GetSize(); + int32_t nChildren = children.GetSize(); for (i = 0; i < nChildren; i ++) { CXFA_Node* child = children[i]; if(bIsClassName) { @@ -114,17 +114,17 @@ FX_INT32 CXFA_NodeHelper::XFA_NodeAcc_TraverseAnySiblings(CXFA_Node* parent, FX_ } return nCount; } -FX_INT32 CXFA_NodeHelper::XFA_NodeAcc_TraverseSiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsClassName, FX_BOOL bIsFindProperty) +int32_t CXFA_NodeHelper::XFA_NodeAcc_TraverseSiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsClassName, FX_BOOL bIsFindProperty) { if (parent == NULL || pSiblings == NULL) { return 0; } - FX_INT32 nCount = 0; - FX_INT32 i = 0; + int32_t nCount = 0; + int32_t i = 0; if(bIsFindProperty) { CXFA_NodeArray properties; parent->GetNodeList(properties, XFA_NODEFILTER_Properties); - FX_INT32 nProperties = properties.GetSize(); + int32_t nProperties = properties.GetSize(); for (i = 0; i < nProperties; ++i) { CXFA_Node* child = properties[i]; if(bIsClassName) { @@ -151,7 +151,7 @@ FX_INT32 CXFA_NodeHelper::XFA_NodeAcc_TraverseSiblings(CXFA_Node* parent, FX_DW } CXFA_NodeArray children; parent->GetNodeList(children, XFA_NODEFILTER_Children); - FX_INT32 nChildren = children.GetSize(); + int32_t nChildren = children.GetSize(); for (i = 0; i < nChildren; i ++) { CXFA_Node* child = children[i]; if(child->GetClassID() == XFA_ELEMENT_Variables) { @@ -204,7 +204,7 @@ CXFA_Node* CXFA_NodeHelper::XFA_ResolveNodes_GetParent(CXFA_Node* pNode, XFA_LO } return parent; } -FX_INT32 CXFA_NodeHelper::XFA_GetIndex(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsProperty , FX_BOOL bIsClassIndex ) +int32_t CXFA_NodeHelper::XFA_GetIndex(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsProperty , FX_BOOL bIsClassIndex ) { CXFA_Node* parent = XFA_ResolveNodes_GetParent(pNode, XFA_LOGIC_NoTransparent); if(parent == NULL) { @@ -221,8 +221,8 @@ FX_INT32 CXFA_NodeHelper::XFA_GetIndex(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicT dwHashName = pNode->GetClassHashCode(); } CXFA_NodeArray siblings; - FX_INT32 iSize = XFA_NodeAcc_TraverseSiblings(parent, dwHashName, &siblings, eLogicType, bIsClassIndex); - for (FX_INT32 i = 0; i < iSize; ++i) { + int32_t iSize = XFA_NodeAcc_TraverseSiblings(parent, dwHashName, &siblings, eLogicType, bIsClassIndex); + for (int32_t i = 0; i < iSize; ++i) { CXFA_Node* child = siblings[i]; if (child == pNode) { return i; @@ -274,7 +274,7 @@ FX_BOOL CXFA_NodeHelper::XFA_NodeIsTransparent(CXFA_Node* refNode) } FX_BOOL CXFA_NodeHelper::XFA_CreateNode_ForCondition(CFX_WideString & wsCondition) { - FX_INT32 iLen = wsCondition.GetLength(); + int32_t iLen = wsCondition.GetLength(); CFX_WideString wsIndex = FX_WSTRC(L"0");; FX_BOOL bAll = FALSE; if(iLen == 0) { @@ -282,7 +282,7 @@ FX_BOOL CXFA_NodeHelper::XFA_CreateNode_ForCondition(CFX_WideString & wsConditio return FALSE; } if(wsCondition.GetAt(0) == '[') { - FX_INT32 i = 1; + int32_t i = 1; for (; i < iLen; ++i) { FX_WCHAR ch = wsCondition[i]; if (ch == ' ') { @@ -304,7 +304,7 @@ FX_BOOL CXFA_NodeHelper::XFA_CreateNode_ForCondition(CFX_WideString & wsConditio m_iCreateFlag = XFA_RESOLVENODE_RSTYPE_CreateNodeOne; wsIndex = wsCondition.Mid(i, iLen - 1 - i); } - FX_INT32 iIndex = wsIndex.GetInteger(); + int32_t iIndex = wsIndex.GetInteger(); m_iCreateCount = iIndex; return TRUE; } @@ -333,7 +333,7 @@ FX_BOOL CXFA_NodeHelper::XFA_ResolveNodes_CreateNode(CFX_WideString wsName, CFX_ if(lpElement == NULL) { return FALSE; } - for(FX_INT32 iIndex = 0; iIndex < m_iCreateCount; iIndex ++) { + for(int32_t iIndex = 0; iIndex < m_iCreateCount; iIndex ++) { CXFA_Node* pNewNode = m_pCreateParent->CreateSamePacketNode(lpElement->eName); if(pNewNode) { m_pCreateParent->InsertChild(pNewNode); @@ -348,7 +348,7 @@ FX_BOOL CXFA_NodeHelper::XFA_ResolveNodes_CreateNode(CFX_WideString wsName, CFX_ if(bLastNode) { eClassType = m_eLastCreateType; } - for(FX_INT32 iIndex = 0; iIndex < m_iCreateCount; iIndex ++) { + for(int32_t iIndex = 0; iIndex < m_iCreateCount; iIndex ++) { CXFA_Node* pNewNode = m_pCreateParent->CreateSamePacketNode(eClassType); if(pNewNode) { pNewNode->SetAttribute(XFA_ATTRIBUTE_Name, wsName); diff --git a/xfa/src/fxfa/src/parser/xfa_script_nodehelper.h b/xfa/src/fxfa/src/parser/xfa_script_nodehelper.h index 2c3faea324..ea3e180385 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_nodehelper.h +++ b/xfa/src/fxfa/src/parser/xfa_script_nodehelper.h @@ -19,10 +19,10 @@ public: CXFA_Node* XFA_ResolveNodes_GetOneChild(CXFA_Node* parent, FX_LPCWSTR pwsName, FX_BOOL bIsClassName = FALSE); CXFA_Node* XFA_ResolveNodes_GetParent(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent); - FX_INT32 XFA_NodeAcc_TraverseSiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsClassName = FALSE, FX_BOOL bIsFindProperty = TRUE); - FX_INT32 XFA_NodeAcc_TraverseAnySiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, FX_BOOL bIsClassName = FALSE); - FX_INT32 XFA_CountSiblings(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, CXFA_NodeArray *pSiblings, FX_BOOL bIsClassName = FALSE); - FX_INT32 XFA_GetIndex(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent, FX_BOOL bIsProperty = FALSE, FX_BOOL bIsClassIndex = FALSE); + int32_t XFA_NodeAcc_TraverseSiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, XFA_LOGIC_TYPE eLogicType, FX_BOOL bIsClassName = FALSE, FX_BOOL bIsFindProperty = TRUE); + int32_t XFA_NodeAcc_TraverseAnySiblings(CXFA_Node* parent, FX_DWORD dNameHash, CXFA_NodeArray* pSiblings, FX_BOOL bIsClassName = FALSE); + int32_t XFA_CountSiblings(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType, CXFA_NodeArray *pSiblings, FX_BOOL bIsClassName = FALSE); + int32_t XFA_GetIndex(CXFA_Node* pNode, XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent, FX_BOOL bIsProperty = FALSE, FX_BOOL bIsClassIndex = FALSE); void XFA_GetNameExpression(CXFA_Node* refNode, CFX_WideString &wsName, FX_BOOL bIsAllPath, XFA_LOGIC_TYPE eLogicType = XFA_LOGIC_NoTransparent); FX_BOOL XFA_NodeIsTransparent(CXFA_Node* refNode); FX_BOOL XFA_ResolveNodes_CreateNode(CFX_WideString wsName, CFX_WideString wsCondition, FX_BOOL bLastNode, CXFA_ScriptContext* pScriptContext); @@ -32,9 +32,9 @@ public: public: XFA_ELEMENT m_eLastCreateType; CXFA_Node* m_pCreateParent; - FX_INT32 m_iCreateCount; + int32_t m_iCreateCount; XFA_RESOVENODE_RSTYPE m_iCreateFlag; - FX_INT32 m_iCurAllStart; + int32_t m_iCurAllStart; CXFA_Node* m_pAllStartParent; }; diff --git a/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp b/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp index c133f6b6f1..a79a8bf9ca 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp @@ -31,7 +31,7 @@ CXFA_ResolveProcessor::~CXFA_ResolveProcessor(void) m_pNodeHelper = NULL; } } -FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData &rnd) +int32_t CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData &rnd) { if (rnd.m_CurNode == NULL) { return -1; @@ -77,13 +77,13 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData &rnd) } return rnd.m_Nodes.GetSize(); } - FX_INT32 nRet = XFA_ResolveNodes_Normal(rnd); + int32_t nRet = XFA_ResolveNodes_Normal(rnd); if (nRet < 1 && rnd.m_uHashName == XFA_HASHCODE_Xfa) { rnd.m_Nodes.Add(rnd.m_pSC->GetDocument()->GetRoot()); } return rnd.m_Nodes.GetSize(); } -FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_AnyChild(CXFA_ResolveNodesData &rnd) +int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_AnyChild(CXFA_ResolveNodesData &rnd) { CFX_WideString wsName = rnd.m_wsName.Right(rnd.m_wsName.GetLength() - 1); CFX_WideString wsCondition = rnd.m_wsCondition; @@ -106,12 +106,12 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_AnyChild(CXFA_ResolveNodesData XFA_ResolveNode_FilterCondition(rnd, wsCondition); return rnd.m_Nodes.GetSize(); } -FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Dollar(CXFA_ResolveNodesData &rnd) +int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Dollar(CXFA_ResolveNodesData &rnd) { CXFA_ObjArray &nodes = rnd.m_Nodes; CFX_WideString wsName = rnd.m_wsName; CFX_WideString wsCondition = rnd.m_wsCondition; - FX_INT32 iNameLen = wsName.GetLength(); + int32_t iNameLen = wsName.GetLength(); if (iNameLen == 1) { nodes.Add(rnd.m_CurNode); return 1; @@ -133,7 +133,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Dollar(CXFA_ResolveNodesData &r } return rnd.m_Nodes.GetSize(); } -FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Excalmatory(CXFA_ResolveNodesData &rnd) +int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Excalmatory(CXFA_ResolveNodesData &rnd) { if (rnd.m_nLevel > 0) { return 0; @@ -157,7 +157,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Excalmatory(CXFA_ResolveNodesDa } return rnd.m_Nodes.GetSize(); } -FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_NumberSign(CXFA_ResolveNodesData &rnd) +int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_NumberSign(CXFA_ResolveNodesData &rnd) { FX_DWORD dwStyles = rnd.m_dwStyles; CFX_WideString wsName = rnd.m_wsName.Right(rnd.m_wsName.GetLength() - 1); @@ -187,7 +187,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_NumberSign(CXFA_ResolveNodesDat } return rnd.m_Nodes.GetSize(); } -FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_ForAttributeRs(CXFA_Object* curNode, CXFA_ResolveNodesData &rnd, FX_WSTR strAttr) +int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_ForAttributeRs(CXFA_Object* curNode, CXFA_ResolveNodesData &rnd, FX_WSTR strAttr) { XFA_LPCSCRIPTATTRIBUTEINFO lpScriptAttribute = XFA_GetScriptAttributeByName(curNode->GetClassID(), strAttr); if(lpScriptAttribute) { @@ -198,7 +198,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_ForAttributeRs(CXFA_Object* cur } return 0; } -FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &rnd) +int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &rnd) { if (rnd.m_nLevel > 32) { return 0; @@ -208,10 +208,10 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &r } CXFA_Node* curNode = (CXFA_Node*)rnd.m_CurNode; CXFA_ObjArray &nodes = rnd.m_Nodes; - FX_INT32 nNum = nodes.GetSize(); + int32_t nNum = nodes.GetSize(); FX_DWORD dwStyles = rnd.m_dwStyles; CFX_WideString &wsName = rnd.m_wsName; - FX_UINT32 uNameHash = rnd.m_uHashName; + uint32_t uNameHash = rnd.m_uHashName; CFX_WideString &wsCondition = rnd.m_wsCondition; CXFA_ResolveNodesData rndFind; rndFind.m_wsName = rnd.m_wsName; @@ -244,7 +244,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &r pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling); } if((dwStyles & XFA_RESOLVENODE_Properties) && pVariablesNode) { - FX_UINT32 uPropHash = pVariablesNode->GetClassHashCode(); + uint32_t uPropHash = pVariablesNode->GetClassHashCode(); if (uPropHash == uNameHash) { nodes.Add(pVariablesNode); } else { @@ -272,7 +272,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &r if(pPageSetNode && (dwStyles & XFA_RESOLVENODE_Properties)) { children.Add(pPageSetNode); } - for(FX_INT32 i = 0; i < children.GetSize(); i++) { + for(int32_t i = 0; i < children.GetSize(); i++) { CXFA_Node* child = children[i]; if (dwStyles & XFA_RESOLVENODE_TagName) { if (child->GetClassHashCode() == uNameHash) { @@ -324,10 +324,10 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &r } if (dwStyles & XFA_RESOLVENODE_Properties) { FX_BOOL bSetFlag = FALSE; - for(FX_INT32 i = 0; i < properties.GetSize(); i++) { + for(int32_t i = 0; i < properties.GetSize(); i++) { CXFA_Node* childProperty = properties[i]; if(childProperty->IsUnnamed()) { - FX_UINT32 uPropHash = childProperty->GetClassHashCode(); + uint32_t uPropHash = childProperty->GetClassHashCode(); XFA_ELEMENT eName = childProperty->GetClassID(); if (uPropHash == uNameHash) { nodes.Add(childProperty); @@ -362,7 +362,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &r } } CXFA_Node* parentNode = m_pNodeHelper->XFA_ResolveNodes_GetParent((CXFA_Node *)curNode, XFA_LOGIC_NoTransparent); - FX_UINT32 uCurClassHash = curNode->GetClassHashCode(); + uint32_t uCurClassHash = curNode->GetClassHashCode(); if (parentNode == NULL) { if(uCurClassHash == uNameHash) { nodes.Add((CXFA_Node*)curNode); @@ -477,7 +477,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &r } return 0; } -FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Asterisk(CXFA_ResolveNodesData &rnd) +int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Asterisk(CXFA_ResolveNodesData &rnd) { CXFA_Node* curNode = (CXFA_Node*)rnd.m_CurNode; CXFA_ObjArray &nodes = rnd.m_Nodes; @@ -486,20 +486,20 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_Asterisk(CXFA_ResolveNodesData nodes.Append((CXFA_ObjArray &)array); return nodes.GetSize(); } -FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_PopStack(CFX_Int32Array &stack) +int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_PopStack(CFX_Int32Array &stack) { - FX_INT32 nType = -1; - FX_INT32 iSize = stack.GetSize() - 1; + int32_t nType = -1; + int32_t iSize = stack.GetSize() - 1; if (iSize > -1) { nType = stack[iSize]; stack.RemoveAt(iSize, 1); } return nType; } -FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, FX_INT32 nStart, CXFA_ResolveNodesData &rnd) +int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, int32_t nStart, CXFA_ResolveNodesData &rnd) { FXSYS_assert(nStart > -1); - FX_INT32 iLength = wsExpression.GetLength(); + int32_t iLength = wsExpression.GetLength(); if (nStart >= iLength) { return 0; } @@ -507,11 +507,11 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, CFX_WideString& wsCondition = rnd.m_wsCondition; FX_LPWSTR pNameBuf = wsName.GetBuffer(iLength - nStart); FX_LPWSTR pConditionBuf = wsCondition.GetBuffer(iLength - nStart); - FX_INT32 nCount = 0; - FX_INT32 nNameCount = 0; - FX_INT32 nConditionCount = 0; + int32_t nCount = 0; + int32_t nNameCount = 0; + int32_t nConditionCount = 0; CFX_Int32Array stack; - FX_INT32 nType = -1; + int32_t nType = -1; FX_LPCWSTR pSrc = wsExpression.GetPtr(); FX_WCHAR wPrev = 0, wCur; FX_BOOL bIsCondition = FALSE; @@ -594,13 +594,13 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, rnd.m_uHashName = FX_HashCode_String_GetW(wsName, wsName.GetLength()); return nStart; } -void CXFA_ResolveProcessor::XFA_ResolveNode_ConditionArray(FX_INT32 iCurIndex, CFX_WideString wsCondition, FX_INT32 iFoundCount, CXFA_ResolveNodesData &rnd) +void CXFA_ResolveProcessor::XFA_ResolveNode_ConditionArray(int32_t iCurIndex, CFX_WideString wsCondition, int32_t iFoundCount, CXFA_ResolveNodesData &rnd) { CXFA_NodeArray &findNodes = (CXFA_NodeArray&)rnd.m_Nodes; - FX_INT32 iLen = wsCondition.GetLength(); + int32_t iLen = wsCondition.GetLength(); FX_BOOL bRelative = FALSE; FX_BOOL bAll = FALSE; - FX_INT32 i = 1; + int32_t i = 1; for (; i < iLen; ++i) { FX_WCHAR ch = wsCondition[i]; if (ch == ' ') { @@ -642,7 +642,7 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_ConditionArray(FX_INT32 iCurIndex, C } CFX_WideString wsIndex; wsIndex = wsCondition.Mid(i, iLen - 1 - i); - FX_INT32 iIndex = wsIndex.GetInteger(); + int32_t iIndex = wsIndex.GetInteger(); if (bRelative) { iIndex += iCurIndex; } @@ -658,7 +658,7 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_ConditionArray(FX_INT32 iCurIndex, C findNodes.Add(ret); } } -void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter(FX_INT32 iCurIndex, CFX_WideString wsCondition, FX_INT32 iFoundCount, CXFA_ResolveNodesData &rnd) +void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter(int32_t iCurIndex, CFX_WideString wsCondition, int32_t iFoundCount, CXFA_ResolveNodesData &rnd) { CXFA_NodeArray &findNodes = (CXFA_NodeArray&)rnd.m_Nodes; FXSYS_assert(iFoundCount == findNodes.GetSize()); @@ -674,7 +674,7 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter(FX_INT32 iCurIndex } pContext = rnd.m_pSC; wsExpression = wsCondition.Mid(2, wsCondition.GetLength() - 3); - for(FX_INT32 i = iFoundCount - 1; i >= 0; i--) { + for(int32_t i = iFoundCount - 1; i >= 0; i--) { CXFA_Object* node = findNodes[i]; FX_BOOL bRet = FALSE; FXJSE_HVALUE pRetValue = FXJSE_Value_Create(rnd.m_pSC->GetRuntime()); @@ -689,9 +689,9 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter(FX_INT32 iCurIndex void CXFA_ResolveProcessor::XFA_ResolveNode_FilterCondition(CXFA_ResolveNodesData &rnd, CFX_WideString wsCondition) { CXFA_NodeArray &findNodes = (CXFA_NodeArray&)rnd.m_Nodes; - FX_INT32 iCurrIndex = 0; + int32_t iCurrIndex = 0; const CXFA_NodeArray &array = rnd.m_pSC->GetUpObjectArray(); - FX_INT32 iSize = array.GetSize(); + int32_t iSize = array.GetSize(); if (iSize) { CXFA_Node* curNode = array[iSize - 1]; FX_BOOL bIsProperty = m_pNodeHelper->XFA_NodeIsProperty(curNode); @@ -701,10 +701,10 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_FilterCondition(CXFA_ResolveNodesDat iCurrIndex = m_pNodeHelper->XFA_GetIndex(curNode, XFA_LOGIC_Transparent, bIsProperty, FALSE); } } - FX_INT32 iFoundCount = findNodes.GetSize(); + int32_t iFoundCount = findNodes.GetSize(); wsCondition.TrimLeft(); wsCondition.TrimRight(); - FX_INT32 iLen = wsCondition.GetLength(); + int32_t iLen = wsCondition.GetLength(); if (!iLen) { if (rnd.m_dwStyles & XFA_RESOLVENODE_ALL) { return; @@ -755,7 +755,7 @@ void CXFA_ResolveProcessor::XFA_ResolveNodes_SetStylesForChild(FX_DWORD dwParent dwSubStyles |= XFA_RESOLVENODE_ALL; rnd.m_dwStyles = dwSubStyles; } -FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNode_SetResultCreateNode(XFA_RESOLVENODE_RS& resolveNodeRS, CFX_WideString &wsLastCondition) +int32_t CXFA_ResolveProcessor::XFA_ResolveNode_SetResultCreateNode(XFA_RESOLVENODE_RS& resolveNodeRS, CFX_WideString &wsLastCondition) { if(m_pNodeHelper->m_pCreateParent) { resolveNodeRS.nodes.Add(m_pNodeHelper->m_pCreateParent); @@ -770,7 +770,7 @@ FX_INT32 CXFA_ResolveProcessor::XFA_ResolveNode_SetResultCreateNode(XFA_RESOLVEN } return resolveNodeRS.nodes.GetSize(); } -void CXFA_ResolveProcessor::XFA_ResolveNode_SetIndexDataBind(CFX_WideString &wsNextCondition, FX_INT32 &iIndex, FX_INT32 iCount) +void CXFA_ResolveProcessor::XFA_ResolveNode_SetIndexDataBind(CFX_WideString &wsNextCondition, int32_t &iIndex, int32_t iCount) { if(m_pNodeHelper->XFA_CreateNode_ForCondition(wsNextCondition)) { if(m_pNodeHelper->m_eLastCreateType == XFA_ELEMENT_DataGroup) { diff --git a/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.h b/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.h index 3555b0a470..39153ecfcc 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.h +++ b/xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.h @@ -31,9 +31,9 @@ public: CXFA_ScriptContext* m_pSC; CXFA_Object* m_CurNode; CFX_WideString m_wsName; - FX_UINT32 m_uHashName; + uint32_t m_uHashName; CFX_WideString m_wsCondition; - FX_INT32 m_nLevel; + int32_t m_nLevel; CXFA_ObjArray m_Nodes; FX_DWORD m_dwStyles; XFA_LPCSCRIPTATTRIBUTEINFO m_pScriptAttribute; @@ -44,22 +44,22 @@ class CXFA_ResolveProcessor public: CXFA_ResolveProcessor(void); ~CXFA_ResolveProcessor(void); - FX_INT32 XFA_ResolveNodes(CXFA_ResolveNodesData &rnd); - FX_INT32 XFA_ResolveNodes_AnyChild(CXFA_ResolveNodesData &rnd); - FX_INT32 XFA_ResolveNodes_Dollar(CXFA_ResolveNodesData &rnd); - FX_INT32 XFA_ResolveNodes_Excalmatory(CXFA_ResolveNodesData &rnd); - FX_INT32 XFA_ResolveNodes_NumberSign(CXFA_ResolveNodesData &rnd); - FX_INT32 XFA_ResolveNodes_Asterisk(CXFA_ResolveNodesData &rnd); - FX_INT32 XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &rnd); - FX_INT32 XFA_ResolveNodes_ForAttributeRs(CXFA_Object* curNode, CXFA_ResolveNodesData &rnd, FX_WSTR strAttr); - void XFA_ResolveNode_ConditionArray(FX_INT32 iCurIndex, CFX_WideString wsCondition, FX_INT32 iFoundCount, CXFA_ResolveNodesData &rnd); - void XFA_ResolveNode_DoPredicateFilter(FX_INT32 iCurIndex, CFX_WideString wsCondition, FX_INT32 iFoundCount, CXFA_ResolveNodesData &rnd); - FX_INT32 XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, FX_INT32 nStart, CXFA_ResolveNodesData &rnd); + int32_t XFA_ResolveNodes(CXFA_ResolveNodesData &rnd); + int32_t XFA_ResolveNodes_AnyChild(CXFA_ResolveNodesData &rnd); + int32_t XFA_ResolveNodes_Dollar(CXFA_ResolveNodesData &rnd); + int32_t XFA_ResolveNodes_Excalmatory(CXFA_ResolveNodesData &rnd); + int32_t XFA_ResolveNodes_NumberSign(CXFA_ResolveNodesData &rnd); + int32_t XFA_ResolveNodes_Asterisk(CXFA_ResolveNodesData &rnd); + int32_t XFA_ResolveNodes_Normal(CXFA_ResolveNodesData &rnd); + int32_t XFA_ResolveNodes_ForAttributeRs(CXFA_Object* curNode, CXFA_ResolveNodesData &rnd, FX_WSTR strAttr); + void XFA_ResolveNode_ConditionArray(int32_t iCurIndex, CFX_WideString wsCondition, int32_t iFoundCount, CXFA_ResolveNodesData &rnd); + void XFA_ResolveNode_DoPredicateFilter(int32_t iCurIndex, CFX_WideString wsCondition, int32_t iFoundCount, CXFA_ResolveNodesData &rnd); + int32_t XFA_ResolveNodes_GetFilter(FX_WSTR wsExpression, int32_t nStart, CXFA_ResolveNodesData &rnd); void XFA_ResolveNode_FilterCondition(CXFA_ResolveNodesData &rnd, CFX_WideString wsCondition); - FX_INT32 XFA_ResolveNodes_PopStack(CFX_Int32Array &stack); + int32_t XFA_ResolveNodes_PopStack(CFX_Int32Array &stack); void XFA_ResolveNodes_SetStylesForChild(FX_DWORD dwParentStyles, CXFA_ResolveNodesData &rnd); - FX_INT32 XFA_ResolveNode_SetResultCreateNode(XFA_RESOLVENODE_RS& resolveNodeRS, CFX_WideString &wsLastCondition); - void XFA_ResolveNode_SetIndexDataBind(CFX_WideString &wsNextCondition, FX_INT32 &iIndex, FX_INT32 iCount); + int32_t XFA_ResolveNode_SetResultCreateNode(XFA_RESOLVENODE_RS& resolveNodeRS, CFX_WideString &wsLastCondition); + void XFA_ResolveNode_SetIndexDataBind(CFX_WideString &wsNextCondition, int32_t &iIndex, int32_t iCount); CXFA_NodeHelper* GetNodeHelper() { return m_pNodeHelper; @@ -67,6 +67,6 @@ public: private: CXFA_NodeHelper* m_pNodeHelper; public: - FX_INT32 m_iCurStart; + int32_t m_iCurStart; }; #endif diff --git a/xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp b/xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp index 6e94791f40..3173d14ed4 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_signaturepseudomodel.cpp @@ -27,7 +27,7 @@ CScript_SignaturePseudoModel::~CScript_SignaturePseudoModel() } void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Verify(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 4) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"verify"); return; @@ -41,7 +41,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Verify(CFXJSE_Arg if (iLength >= 1) { pNode = (CXFA_Node*)pArguments->GetObject(0); } - FX_INT32 bVerify = pNotify->GetDocProvider()->Verify(hDoc, pNode); + int32_t bVerify = pNotify->GetDocProvider()->Verify(hDoc, pNode); FXJSE_HVALUE hValue = pArguments->GetReturnValue(); if (hValue) { FXJSE_Value_SetInteger(hValue, bVerify); @@ -49,7 +49,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Verify(CFXJSE_Arg } void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 3 || iLength > 7) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"sign"); return; @@ -81,7 +81,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Sign(CFXJSE_Argum } void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Enumerate(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength != 0) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"enumerate"); return; @@ -96,7 +96,7 @@ void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Enumerate(CFXJSE_ } void CScript_SignaturePseudoModel::Script_SignaturePseudoModel_Clear(CFXJSE_Arguments* pArguments) { - FX_INT32 iLength = pArguments->GetLength(); + int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 2) { ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"clear"); return; diff --git a/xfa/src/fxfa/src/parser/xfa_utils_imp.cpp b/xfa/src/fxfa/src/parser/xfa_utils_imp.cpp index e4f7545f98..a15690cdcd 100644 --- a/xfa/src/fxfa/src/parser/xfa_utils_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_utils_imp.cpp @@ -146,7 +146,7 @@ CXFA_LocaleValue XFA_GetLocaleValue(CXFA_WidgetData* pWidgetData) if (!pValueChild) { return CXFA_LocaleValue(); } - FX_INT32 iVTType = XFA_VT_NULL; + int32_t iVTType = XFA_VT_NULL; XFA_ELEMENT eType = pValueChild->GetClassID(); switch (eType) { case XFA_ELEMENT_Decimal: @@ -189,7 +189,7 @@ void XFA_GetPlainTextFromRichText(IFDE_XMLNode *pXMLNode, CFX_WideString &wsPlai IFDE_XMLElement *pXMLElement = (IFDE_XMLElement*)pXMLNode; CFX_WideString wsTag; pXMLElement->GetLocalTagName(wsTag); - FX_UINT32 uTag = FX_HashCode_String_GetW(wsTag, wsTag.GetLength(), TRUE); + uint32_t uTag = FX_HashCode_String_GetW(wsTag, wsTag.GetLength(), TRUE); if (uTag == 0x0001f714) { wsPlainText += L"\n"; } else if (uTag == 0x00000070) { @@ -301,20 +301,20 @@ FX_DOUBLE XFA_WideStringToDouble(const CFX_WideString &wsStringVal) wsValue.TrimLeft(); wsValue.TrimRight(); FX_BOOL bValid = TRUE; - FX_INT64 nIntegral = 0; + int64_t nIntegral = 0; FX_DWORD dwFractional = 0; - FX_INT32 nExponent = 0; - FX_INT32 cc = 0; + int32_t nExponent = 0; + int32_t cc = 0; FX_BOOL bNegative = FALSE, bExpSign = FALSE; FX_LPCWSTR str = (FX_LPCWSTR)wsValue; - FX_INT32 len = wsValue.GetLength(); + int32_t len = wsValue.GetLength(); if (str[0] == '+') { cc++; } else if (str[0] == '-') { bNegative = TRUE; cc++; } - FX_INT32 nIntegralLen = 0; + int32_t nIntegralLen = 0; while (cc < len) { if (str[cc] == '.' || str[cc] == 'E' || str[cc] == 'e' || nIntegralLen > 17) { break; @@ -327,7 +327,7 @@ FX_DOUBLE XFA_WideStringToDouble(const CFX_WideString &wsStringVal) nIntegralLen++; } nIntegral = bNegative ? -nIntegral : nIntegral; - FX_INT32 scale = 0; + int32_t scale = 0; FX_DOUBLE fraction = 0.0; if (cc < len && str[cc] == '.') { cc ++; @@ -382,7 +382,7 @@ FX_DOUBLE XFA_ByteStringToDouble(FX_BSTR szStringVal) return XFA_WideStringToDouble(wsValue); } -FX_INT32 XFA_MapRotation(FX_INT32 nRotation) { +int32_t XFA_MapRotation(int32_t nRotation) { nRotation = nRotation % 360; nRotation = nRotation < 0 ? nRotation + 360 : nRotation; return nRotation; diff --git a/xfa/src/fxgraphics/src/fx_graphics.cpp b/xfa/src/fxgraphics/src/fx_graphics.cpp index 56f6cee026..ee746b7fce 100644 --- a/xfa/src/fxgraphics/src/fx_graphics.cpp +++ b/xfa/src/fxgraphics/src/fx_graphics.cpp @@ -11,8 +11,8 @@ class CAGG_Graphics public: CAGG_Graphics(); FX_ERR Create(CFX_Graphics * owner, - FX_INT32 width, - FX_INT32 height, + int32_t width, + int32_t height, FXDIB_Format format); virtual ~CAGG_Graphics(); private: @@ -50,8 +50,8 @@ FX_ERR CFX_Graphics::Create(CFX_RenderDevice * renderDevice, } return FX_ERR_Indefinite; } -FX_ERR CFX_Graphics::Create(FX_INT32 width, - FX_INT32 height, +FX_ERR CFX_Graphics::Create(int32_t width, + int32_t height, FXDIB_Format format, FX_BOOL isNative , FX_BOOL isAntialiasing ) @@ -76,7 +76,7 @@ CFX_Graphics::~CFX_Graphics() _info._graphState.SetDashCount(0); _type = FX_CONTEXT_None; } -FX_ERR CFX_Graphics::GetDeviceCap(const FX_INT32 capID, FX_DeviceCap & capVal) +FX_ERR CFX_Graphics::GetDeviceCap(const int32_t capID, FX_DeviceCap & capVal) { switch (_type) { case FX_CONTEXT_Device: { @@ -94,7 +94,7 @@ FX_ERR CFX_Graphics::IsPrinterDevice(FX_BOOL & isPrinter) switch (_type) { case FX_CONTEXT_Device: { _FX_RETURN_VALUE_IF_FAIL(_renderDevice, FX_ERR_Property_Invalid); - FX_INT32 deviceClass = _renderDevice->GetDeviceClass(); + int32_t deviceClass = _renderDevice->GetDeviceClass(); if (deviceClass == FXDC_PRINTER) { isPrinter = TRUE; } else { @@ -152,11 +152,11 @@ FX_ERR CFX_Graphics::RestoreGraphState() case FX_CONTEXT_Device: { _FX_RETURN_VALUE_IF_FAIL(_renderDevice, FX_ERR_Property_Invalid); _renderDevice->RestoreState(); - FX_INT32 size = _infoStack.GetSize(); + int32_t size = _infoStack.GetSize(); if (size <= 0) { return FX_ERR_Intermediate_Value_Invalid; } - FX_INT32 topIndex = size - 1; + int32_t topIndex = size - 1; TInfo * info = (TInfo *) _infoStack.GetAt(topIndex); _FX_RETURN_VALUE_IF_FAIL(info, FX_ERR_Intermediate_Value_Invalid); _info._graphState.Copy(info->_graphState); @@ -206,7 +206,7 @@ FX_ERR CFX_Graphics::SetLineCap(CFX_GraphStateData::LineCap lineCap) } } } -FX_ERR CFX_Graphics::GetDashCount(FX_INT32 & dashCount) +FX_ERR CFX_Graphics::GetDashCount(int32_t & dashCount) { switch (_type) { case FX_CONTEXT_Device: { @@ -238,7 +238,7 @@ FX_ERR CFX_Graphics::GetLineDash(FX_FLOAT & dashPhase, FX_FLOAT * dashArray) } FX_ERR CFX_Graphics::SetLineDash(FX_FLOAT dashPhase, FX_FLOAT * dashArray, - FX_INT32 dashCount) + int32_t dashCount) { if (dashCount > 0 && !dashArray) { return FX_ERR_Parameter_Invalid; @@ -253,7 +253,7 @@ FX_ERR CFX_Graphics::SetLineDash(FX_FLOAT dashPhase, } _info._graphState.m_DashPhase = dashPhase; _info._graphState.SetDashCount(dashCount); - for (FX_INT32 i = 0; i < dashCount; i++) { + for (int32_t i = 0; i < dashCount; i++) { _info._graphState.m_DashArray[i] = dashArray[i] * scale; } return FX_ERR_Succeeded; @@ -616,7 +616,7 @@ FX_ERR CFX_Graphics::SetCharSpacing(const FX_FLOAT spacing) } } } -FX_ERR CFX_Graphics::SetTextDrawingMode(const FX_INT32 mode) +FX_ERR CFX_Graphics::SetTextDrawingMode(const int32_t mode) { switch (_type) { case FX_CONTEXT_Device: { @@ -650,7 +650,7 @@ FX_ERR CFX_Graphics::CalcTextRect(CFX_RectF & rect, switch (_type) { case FX_CONTEXT_Device: { _FX_RETURN_VALUE_IF_FAIL(_renderDevice, FX_ERR_Property_Invalid); - FX_INT32 length = text.GetLength(); + int32_t length = text.GetLength(); FX_DWORD * charCodes = FX_Alloc(FX_DWORD, length); FXTEXT_CHARPOS * charPos = FX_Alloc(FXTEXT_CHARPOS, length * sizeof (FXTEXT_CHARPOS)); @@ -709,17 +709,17 @@ FX_ERR CFX_Graphics::Transfer(CFX_Graphics * graphics, CFX_DIBitmap * bitmap = graphics->_renderDevice->GetBitmap(); FX_BOOL result = FX_ERR_Indefinite; CFX_DIBitmap bmp; - result = bmp.Create((FX_INT32) dstRect.width, - (FX_INT32) dstRect.height, + result = bmp.Create((int32_t) dstRect.width, + (int32_t) dstRect.height, bitmap->GetFormat()); _FX_RETURN_VALUE_IF_FAIL(result, FX_ERR_Intermediate_Value_Invalid); result = graphics->_renderDevice->GetDIBits(&bmp, - (FX_INT32) srcLeft, - (FX_INT32) srcTop); + (int32_t) srcLeft, + (int32_t) srcTop); _FX_RETURN_VALUE_IF_FAIL(result, FX_ERR_Method_Not_Supported); result = _renderDevice->SetDIBits(&bmp, - (FX_INT32) dstRect.left, - (FX_INT32) dstRect.top); + (int32_t) dstRect.left, + (int32_t) dstRect.top); _FX_RETURN_VALUE_IF_FAIL(result, FX_ERR_Method_Not_Supported); return FX_ERR_Succeeded; } @@ -746,12 +746,12 @@ FX_ERR CFX_Graphics::InverseRect(const CFX_RectF & rect) if (r.IsEmpty()) { return FX_ERR_Parameter_Invalid; } - FX_ARGB* pBuf = (FX_ARGB*)(bitmap->GetBuffer() + FX_INT32(r.top) * bitmap->GetPitch()); - FX_INT32 bottom = (FX_INT32)r.bottom(); - FX_INT32 right = (FX_INT32)r.right(); - for (FX_INT32 i = (FX_INT32)r.top; i < bottom; i ++) { - FX_ARGB* pLine = pBuf + (FX_INT32)r.left; - for (FX_INT32 j = (FX_INT32)r.left; j < right; j ++) { + FX_ARGB* pBuf = (FX_ARGB*)(bitmap->GetBuffer() + int32_t(r.top) * bitmap->GetPitch()); + int32_t bottom = (int32_t)r.bottom(); + int32_t right = (int32_t)r.right(); + for (int32_t i = (int32_t)r.top; i < bottom; i ++) { + FX_ARGB* pLine = pBuf + (int32_t)r.left; + for (int32_t j = (int32_t)r.left; j < right; j ++) { FX_ARGB c = *pLine; *pLine ++ = (c & 0xFF000000) | (0xFFFFFF - (c & 0x00FFFFFF)); } @@ -772,14 +772,14 @@ FX_ERR CFX_Graphics::XorDIBitmap(const CFX_DIBitmap * srcBitmap, const CFX_RectF if (r.IsEmpty()) { return FX_ERR_Parameter_Invalid; } - FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + FX_INT32(r.top) * srcBitmap->GetPitch()); - FX_ARGB* pDstBuf = (FX_ARGB*)(dst->GetBuffer() + FX_INT32(r.top) * dst->GetPitch()); - FX_INT32 bottom = (FX_INT32)r.bottom(); - FX_INT32 right = (FX_INT32)r.right(); - for (FX_INT32 i = (FX_INT32)r.top; i < bottom; i ++) { - FX_ARGB* pSrcLine = pSrcBuf + (FX_INT32)r.left; - FX_ARGB* pDstLine = pDstBuf + (FX_INT32)r.left; - for (FX_INT32 j = (FX_INT32)r.left; j < right; j ++) { + FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + int32_t(r.top) * srcBitmap->GetPitch()); + FX_ARGB* pDstBuf = (FX_ARGB*)(dst->GetBuffer() + int32_t(r.top) * dst->GetPitch()); + int32_t bottom = (int32_t)r.bottom(); + int32_t right = (int32_t)r.right(); + for (int32_t i = (int32_t)r.top; i < bottom; i ++) { + FX_ARGB* pSrcLine = pSrcBuf + (int32_t)r.left; + FX_ARGB* pDstLine = pDstBuf + (int32_t)r.left; + for (int32_t j = (int32_t)r.left; j < right; j ++) { FX_ARGB c = *pDstLine; *pDstLine ++ = ArgbEncode(FXARGB_A(c), (c & 0xFFFFFF) ^ (*pSrcLine & 0xFFFFFF)); pSrcLine ++; @@ -802,14 +802,14 @@ FX_ERR CFX_Graphics::EqvDIBitmap(const CFX_DIBitmap * srcBitmap, const CFX_RectF if (r.IsEmpty()) { return FX_ERR_Parameter_Invalid; } - FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + FX_INT32(r.top) * srcBitmap->GetPitch()); - FX_ARGB* pDstBuf = (FX_ARGB*)(dst->GetBuffer() + FX_INT32(r.top) * dst->GetPitch()); - FX_INT32 bottom = (FX_INT32)r.bottom(); - FX_INT32 right = (FX_INT32)r.right(); - for (FX_INT32 i = (FX_INT32)r.top; i < bottom; i ++) { - FX_ARGB* pSrcLine = pSrcBuf + (FX_INT32)r.left; - FX_ARGB* pDstLine = pDstBuf + (FX_INT32)r.left; - for (FX_INT32 j = (FX_INT32)r.left; j < right; j ++) { + FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + int32_t(r.top) * srcBitmap->GetPitch()); + FX_ARGB* pDstBuf = (FX_ARGB*)(dst->GetBuffer() + int32_t(r.top) * dst->GetPitch()); + int32_t bottom = (int32_t)r.bottom(); + int32_t right = (int32_t)r.right(); + for (int32_t i = (int32_t)r.top; i < bottom; i ++) { + FX_ARGB* pSrcLine = pSrcBuf + (int32_t)r.left; + FX_ARGB* pDstLine = pDstBuf + (int32_t)r.left; + for (int32_t j = (int32_t)r.left; j < right; j ++) { FX_ARGB c = *pDstLine; *pDstLine ++ = ArgbEncode(FXARGB_A(c), ~((c & 0xFFFFFF) ^ (*pSrcLine & 0xFFFFFF))); pSrcLine ++; @@ -934,7 +934,7 @@ FX_ERR CFX_Graphics::RenderDeviceDrawImage(CFX_DIBSource * source, point.x, point.y); m2.Concat(m1); - FX_INT32 left, top; + int32_t left, top; CFX_DIBitmap * bmp1 = source->FlipImage(FALSE, TRUE); CFX_DIBitmap * bmp2 = bmp1->TransformTo((CFX_AffineMatrix *) &m2, left, top); CFX_RectF r; @@ -974,12 +974,12 @@ FX_ERR CFX_Graphics::RenderDeviceStretchImage(CFX_DIBSource * source, if (matrix) { m1.Concat(*matrix); } - CFX_DIBitmap * bmp1 = source->StretchTo((FX_INT32) rect.Width(), - (FX_INT32) rect.Height()); + CFX_DIBitmap * bmp1 = source->StretchTo((int32_t) rect.Width(), + (int32_t) rect.Height()); CFX_Matrix m2; m2.Set(rect.Width(), 0.0, 0.0, rect.Height(), rect.left, rect.top); m2.Concat(m1); - FX_INT32 left, top; + int32_t left, top; CFX_DIBitmap * bmp2 = bmp1->FlipImage(FALSE, TRUE); CFX_DIBitmap * bmp3 = bmp2->TransformTo((CFX_AffineMatrix *) &m2, left, top); CFX_RectF r; @@ -1014,7 +1014,7 @@ FX_ERR CFX_Graphics::RenderDeviceShowText(const CFX_PointF & point, const CFX_WideString & text, CFX_Matrix * matrix) { - FX_INT32 length = text.GetLength(); + int32_t length = text.GetLength(); FX_DWORD * charCodes = FX_Alloc(FX_DWORD, length); FXTEXT_CHARPOS * charPos = FX_Alloc(FXTEXT_CHARPOS, length * sizeof (FXTEXT_CHARPOS)); @@ -1054,19 +1054,19 @@ FX_ERR CFX_Graphics::FillPathWithPattern(CFX_Path * path, { CFX_Pattern * pattern = _info._fillColor->_pattern; CFX_DIBitmap * bitmap = _renderDevice->GetBitmap(); - FX_INT32 width = bitmap->GetWidth(); - FX_INT32 height = bitmap->GetHeight(); + int32_t width = bitmap->GetWidth(); + int32_t height = bitmap->GetHeight(); CFX_DIBitmap bmp; bmp.Create(width, height, FXDIB_Argb); _renderDevice->GetDIBits(&bmp, 0, 0); switch (pattern->_type) { case FX_PATTERN_Bitmap: { - FX_INT32 xStep = FXSYS_round(pattern->_x1Step); - FX_INT32 yStep = FXSYS_round(pattern->_y1Step); - FX_INT32 xCount = width / xStep + 1; - FX_INT32 yCount = height / yStep + 1; - for (FX_INT32 i = 0; i <= yCount; i++) { - for (FX_INT32 j = 0; j <= xCount; j++) { + int32_t xStep = FXSYS_round(pattern->_x1Step); + int32_t yStep = FXSYS_round(pattern->_y1Step); + int32_t xCount = width / xStep + 1; + int32_t yCount = height / yStep + 1; + for (int32_t i = 0; i <= yCount; i++) { + for (int32_t j = 0; j <= xCount; j++) { bmp.TransferBitmap(j * xStep, i * yStep, xStep, @@ -1098,8 +1098,8 @@ FX_ERR CFX_Graphics::FillPathWithPattern(CFX_Path * path, CFX_FxgeDevice device; device.Attach(&bmp); device.FillRect(&rect, _info._fillColor->_pattern->_backArgb); - for (FX_INT32 j = rect.bottom; j < rect.top; j += mask.GetHeight()) { - for (FX_INT32 i = rect.left; i < rect.right; i += mask.GetWidth()) { + for (int32_t j = rect.bottom; j < rect.top; j += mask.GetHeight()) { + for (int32_t i = rect.left; i < rect.right; i += mask.GetWidth()) { device.SetBitMask(&mask, i, j, _info._fillColor->_pattern->_foreArgb); } } @@ -1119,8 +1119,8 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path, CFX_Matrix * matrix) { CFX_DIBitmap * bitmap = _renderDevice->GetBitmap(); - FX_INT32 width = bitmap->GetWidth(); - FX_INT32 height = bitmap->GetHeight(); + int32_t width = bitmap->GetWidth(); + int32_t height = bitmap->GetHeight(); FX_FLOAT start_x = _info._fillColor->_shading->_beginPoint.x; FX_FLOAT start_y = _info._fillColor->_shading->_beginPoint.y; FX_FLOAT end_x = _info._fillColor->_shading->_endPoint.x; @@ -1128,16 +1128,16 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path, CFX_DIBitmap bmp; bmp.Create(width, height, FXDIB_Argb); _renderDevice->GetDIBits(&bmp, 0, 0); - FX_INT32 pitch = bmp.GetPitch(); + int32_t pitch = bmp.GetPitch(); FX_BOOL result = FALSE; switch (_info._fillColor->_shading->_type) { case FX_SHADING_Axial: { FX_FLOAT x_span = end_x - start_x; FX_FLOAT y_span = end_y - start_y; FX_FLOAT axis_len_square = FXSYS_Mul(x_span, x_span) + FXSYS_Mul(y_span, y_span); - for (FX_INT32 row = 0; row < height; row++) { + for (int32_t row = 0; row < height; row++) { FX_DWORD * dib_buf = (FX_DWORD *) (bmp.GetBuffer() + row * pitch); - for (FX_INT32 column = 0; column < width; column++) { + for (int32_t column = 0; column < width; column++) { FX_FLOAT x = (FX_FLOAT)(column); FX_FLOAT y = (FX_FLOAT)(row); FX_FLOAT scale = FXSYS_Div(FXSYS_Mul(x - start_x, x_span) + FXSYS_Mul(y - start_y, y_span), @@ -1153,7 +1153,7 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path, } scale = 1.0f; } - FX_INT32 index = (FX_INT32)(scale * (FX_SHADING_Steps - 1)); + int32_t index = (int32_t)(scale * (FX_SHADING_Steps - 1)); dib_buf[column] = _info._fillColor->_shading->_argbArray[index]; } } @@ -1164,9 +1164,9 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path, FX_FLOAT start_r = _info._fillColor->_shading->_beginRadius; FX_FLOAT end_r = _info._fillColor->_shading->_endRadius; FX_FLOAT a = FXSYS_Mul(start_x - end_x, start_x - end_x) + FXSYS_Mul(start_y - end_y, start_y - end_y) - FXSYS_Mul(start_r - end_r, start_r - end_r); - for (FX_INT32 row = 0; row < height; row++) { + for (int32_t row = 0; row < height; row++) { FX_DWORD * dib_buf = (FX_DWORD *) (bmp.GetBuffer() + row * pitch); - for (FX_INT32 column = 0; column < width; column++) { + for (int32_t column = 0; column < width; column++) { FX_FLOAT x = (FX_FLOAT)(column); FX_FLOAT y = (FX_FLOAT)(row); FX_FLOAT b = -2 * (FXSYS_Mul(x - start_x, end_x - start_x) + FXSYS_Mul(y - start_y, end_y - start_y) + @@ -1211,7 +1211,7 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path, } s = 1.0f; } - int index = (FX_INT32)(s * (FX_SHADING_Steps - 1)); + int index = (int32_t)(s * (FX_SHADING_Steps - 1)); dib_buf[column] = _info._fillColor->_shading->_argbArray[index]; } } @@ -1240,7 +1240,7 @@ FX_ERR CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource * source, CFX_Matrix * ma CFX_Matrix m; m.Set((FX_FLOAT)source->GetWidth(), 0, 0, (FX_FLOAT)source->GetHeight(), 0, 0); m.Concat(*matrix); - FX_INT32 left, top; + int32_t left, top; CFX_DIBitmap * bmp1 = source->FlipImage(FALSE, TRUE); CFX_DIBitmap * bmp2 = bmp1->TransformTo((CFX_AffineMatrix *) &m, left, top); _renderDevice->SetDIBits(bmp2, left, top); @@ -1258,7 +1258,7 @@ FX_ERR CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource * source, CFX_Matrix * ma FX_ERR CFX_Graphics::CalcTextInfo(const CFX_WideString & text, FX_DWORD * charCodes, FXTEXT_CHARPOS * charPos, CFX_RectF & rect) { IFX_FontEncoding * encoding = FXGE_CreateUnicodeEncoding(_info._font); - FX_INT32 length = text.GetLength(); + int32_t length = text.GetLength(); FX_FLOAT penX = (FX_FLOAT) rect.left; FX_FLOAT penY = (FX_FLOAT) rect.top; FX_FLOAT left = (FX_FLOAT)(0); @@ -1274,7 +1274,7 @@ FX_ERR CFX_Graphics::CalcTextInfo(const CFX_WideString & text, FX_DWORD * charCo charPos[0].m_AdjustMatrix[2] = 0; charPos[0].m_AdjustMatrix[3] = 1; penX += (FX_FLOAT)(charPos[0].m_FontCharWidth) * _info._fontSize / 1000 + _info._fontSpacing; - for (FX_INT32 i = 1; i < length; i++) { + for (int32_t i = 1; i < length; i++) { charCodes[i] = text.GetAt(i); charPos[i].m_OriginX = penX + left; charPos[i].m_OriginY = penY + top; @@ -1298,8 +1298,8 @@ CAGG_Graphics::CAGG_Graphics() _owner = NULL; } FX_ERR CAGG_Graphics::Create(CFX_Graphics * owner, - FX_INT32 width, - FX_INT32 height, + int32_t width, + int32_t height, FXDIB_Format format) { if (owner->_renderDevice) { @@ -1638,21 +1638,21 @@ CFX_Shading::~CFX_Shading() } FX_ERR CFX_Shading::InitArgbArray() { - FX_INT32 a1, r1, g1, b1; + int32_t a1, r1, g1, b1; ArgbDecode(_beginArgb, a1, r1, g1, b1); - FX_INT32 a2, r2, g2, b2; + int32_t a2, r2, g2, b2; ArgbDecode(_endArgb, a2, r2, g2, b2); FX_FLOAT f = (FX_FLOAT) (FX_SHADING_Steps - 1); FX_FLOAT aScale = (FX_FLOAT) (1.0 * (a2 - a1) / f); FX_FLOAT rScale = (FX_FLOAT) (1.0 * (r2 - r1) / f); FX_FLOAT gScale = (FX_FLOAT) (1.0 * (g2 - g1) / f); FX_FLOAT bScale = (FX_FLOAT) (1.0 * (b2 - b1) / f); - FX_INT32 a3, r3, g3, b3; - for (FX_INT32 i = 0; i < FX_SHADING_Steps; i++) { - a3 = (FX_INT32) (i * aScale); - r3 = (FX_INT32) (i * rScale); - g3 = (FX_INT32) (i * gScale); - b3 = (FX_INT32) (i * bScale); + int32_t a3, r3, g3, b3; + for (int32_t i = 0; i < FX_SHADING_Steps; i++) { + a3 = (int32_t) (i * aScale); + r3 = (int32_t) (i * rScale); + g3 = (int32_t) (i * gScale); + b3 = (int32_t) (i * bScale); _argbArray[i] = FXARGB_TODIB(FXARGB_MAKE((a1 + a3), (r1 + r3), (g1 + g3), diff --git a/xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp b/xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp index 388fbc5ad5..99d3519dc8 100644 --- a/xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp +++ b/xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp @@ -21,7 +21,7 @@ FX_BOOL CFX_MetafileInterpreter::SetCurrentElement(CXML_Element * element) _element = element; return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineCap(FX_INT32 & lineCap) +FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineCap(int32_t & lineCap) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * lineCapElement = _element->GetElement(0); @@ -30,8 +30,8 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineCap(FX_INT32 & lineCap) return TRUE; } FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(FX_FLOAT & dashPhase, - FX_INT32 & dashArray, - FX_INT32 & dashCount) + int32_t & dashArray, + int32_t & dashCount) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * dashPhaseElement = _element->GetElement(0); @@ -42,10 +42,10 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(FX_FLOAT & dashPhase, dashArray = dashArrayElement->GetAttrInteger("FX_FLOAT *"); CXML_Element * dashCountElement = _element->GetElement(2); _FX_RETURN_VALUE_IF_FAIL(dashCountElement, FALSE); - dashCount = dashCountElement->GetAttrInteger("FX_INT32"); + dashCount = dashCountElement->GetAttrInteger("int32_t"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(FX_INT32 & dashStyle) +FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(int32_t & dashStyle) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * dashStyleElement = _element->GetElement(0); @@ -53,7 +53,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(FX_INT32 & dashStyle) dashStyle = dashStyleElement->GetAttrInteger("FX_DashStyle"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineJoin(FX_INT32 & lineJoin) +FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineJoin(int32_t & lineJoin) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * lineJoinElement = _element->GetElement(0); @@ -70,7 +70,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetMiterLimit(FX_FLOAT & miterLimit) return TRUE; } FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineWidth(FX_FLOAT & lineWidth, - FX_INT32 & isActOnDash) + int32_t & isActOnDash) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * lineWidthElement = _element->GetElement(0); @@ -81,7 +81,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineWidth(FX_FLOAT & lineWidth, isActOnDash = isActOnDashElement->GetAttrInteger("FX_BOOL"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_SetStrokeColor(FX_INT32 & color) +FX_BOOL CFX_MetafileInterpreter::ParamOf_SetStrokeColor(int32_t & color) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * colorElement = _element->GetElement(0); @@ -89,7 +89,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetStrokeColor(FX_INT32 & color) color = colorElement->GetAttrInteger("CFX_Color *"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFillColor(FX_INT32 & color) +FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFillColor(int32_t & color) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * colorElement = _element->GetElement(0); @@ -97,7 +97,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFillColor(FX_INT32 & color) color = colorElement->GetAttrInteger("CFX_Color *"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_StrokePath(FX_INT32 & path, FX_INT32 & matrix) +FX_BOOL CFX_MetafileInterpreter::ParamOf_StrokePath(int32_t & path, int32_t & matrix) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * pathElement = _element->GetElement(0); @@ -108,9 +108,9 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_StrokePath(FX_INT32 & path, FX_INT32 & matrix = matrixElement->GetAttrInteger("CFX_Matrix *"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_FillPath(FX_INT32 & path, - FX_INT32 & fillMode, - FX_INT32 & matrix) +FX_BOOL CFX_MetafileInterpreter::ParamOf_FillPath(int32_t & path, + int32_t & fillMode, + int32_t & matrix) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * pathElement = _element->GetElement(0); @@ -124,9 +124,9 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_FillPath(FX_INT32 & path, matrix = matrixElement->GetAttrInteger("CFX_Matrix *"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_ClipPath(FX_INT32 & path, - FX_INT32 & fillMode, - FX_INT32 & matrix) +FX_BOOL CFX_MetafileInterpreter::ParamOf_ClipPath(int32_t & path, + int32_t & fillMode, + int32_t & matrix) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * pathElement = _element->GetElement(0); @@ -140,9 +140,9 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_ClipPath(FX_INT32 & path, matrix = matrixElement->GetAttrInteger("CFX_Matrix *"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_DrawImage(FX_INT32 & source, - FX_INT32 & point, - FX_INT32 & matrix) +FX_BOOL CFX_MetafileInterpreter::ParamOf_DrawImage(int32_t & source, + int32_t & point, + int32_t & matrix) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * sourceElement = _element->GetElement(0); @@ -156,9 +156,9 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_DrawImage(FX_INT32 & source, matrix = matrixElement->GetAttrInteger("CFX_Matrix *"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_StretchImage(FX_INT32 & source, - FX_INT32 & rect, - FX_INT32 & matrix) +FX_BOOL CFX_MetafileInterpreter::ParamOf_StretchImage(int32_t & source, + int32_t & rect, + int32_t & matrix) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * sourceElement = _element->GetElement(0); @@ -172,7 +172,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_StretchImage(FX_INT32 & source, matrix = matrixElement->GetAttrInteger("CFX_Matrix *"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_ConcatMatrix(FX_INT32 & matrix) +FX_BOOL CFX_MetafileInterpreter::ParamOf_ConcatMatrix(int32_t & matrix) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * matrixElement = _element->GetElement(0); @@ -180,7 +180,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_ConcatMatrix(FX_INT32 & matrix) matrix = matrixElement->GetAttrInteger("CFX_Matrix *"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_SetClipRect(FX_INT32 & rect) +FX_BOOL CFX_MetafileInterpreter::ParamOf_SetClipRect(int32_t & rect) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * rectElement = _element->GetElement(0); @@ -188,7 +188,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetClipRect(FX_INT32 & rect) rect = rectElement->GetAttrInteger("CFX_RectF *"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFont(FX_INT32 & font) +FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFont(int32_t & font) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * fontElement = _element->GetElement(0); @@ -220,17 +220,17 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetCharSpacing(FX_FLOAT & spacing) spacing = spacingElement->GetAttrFloat("FX_FLOAT"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_SetTextDrawingMode(FX_INT32 & mode) +FX_BOOL CFX_MetafileInterpreter::ParamOf_SetTextDrawingMode(int32_t & mode) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * modeElement = _element->GetElement(0); _FX_RETURN_VALUE_IF_FAIL(modeElement, FALSE); - mode = modeElement->GetAttrInteger("FX_INT32"); + mode = modeElement->GetAttrInteger("int32_t"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_SetText(FX_INT32 & point, - FX_INT32 & text, - FX_INT32 & matrix) +FX_BOOL CFX_MetafileInterpreter::ParamOf_SetText(int32_t & point, + int32_t & text, + int32_t & matrix) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * pointElement = _element->GetElement(0); @@ -244,7 +244,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetText(FX_INT32 & point, matrix = matrixElement->GetAttrInteger("CFX_Matrix *"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(FX_INT32 & graphics, FX_INT32 & matrix) +FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(int32_t & graphics, int32_t & matrix) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * graphicsElement = _element->GetElement(0); @@ -255,11 +255,11 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(FX_INT32 & graphics, FX_INT32 matrix = matrixElement->GetAttrInteger("CFX_Matrix *"); return TRUE; } -FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(FX_INT32 & graphics, +FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(int32_t & graphics, FX_FLOAT & srcLeft, FX_FLOAT & srcTop, - FX_INT32 & dstRect, - FX_INT32 & matrix) + int32_t & dstRect, + int32_t & matrix) { _FX_RETURN_VALUE_IF_FAIL(_element, FALSE); CXML_Element * graphicsElement = _element->GetElement(0); diff --git a/xfa/src/fxgraphics/src/fx_metafile_interpreter.h b/xfa/src/fxgraphics/src/fx_metafile_interpreter.h index 64b63852ac..f28aa66a34 100644 --- a/xfa/src/fxgraphics/src/fx_metafile_interpreter.h +++ b/xfa/src/fxgraphics/src/fx_metafile_interpreter.h @@ -14,39 +14,39 @@ public: FX_BOOL SetCurrentElement(CXML_Element * element); - FX_BOOL ParamOf_SetLineCap(FX_INT32 & lineCap); + FX_BOOL ParamOf_SetLineCap(int32_t & lineCap); FX_BOOL ParamOf_SetLineDash(FX_FLOAT & dashPhase, - FX_INT32 & dashArray, - FX_INT32 & dashCount); - FX_BOOL ParamOf_SetLineDash(FX_INT32 & dashStyle); - FX_BOOL ParamOf_SetLineJoin(FX_INT32 & lineJoin); + int32_t & dashArray, + int32_t & dashCount); + FX_BOOL ParamOf_SetLineDash(int32_t & dashStyle); + FX_BOOL ParamOf_SetLineJoin(int32_t & lineJoin); FX_BOOL ParamOf_SetMiterLimit(FX_FLOAT & miterLimit); - FX_BOOL ParamOf_SetLineWidth(FX_FLOAT & lineWidth, FX_INT32 & isActOnDash); + FX_BOOL ParamOf_SetLineWidth(FX_FLOAT & lineWidth, int32_t & isActOnDash); - FX_BOOL ParamOf_SetStrokeColor(FX_INT32 & color); - FX_BOOL ParamOf_SetFillColor(FX_INT32 & color); + FX_BOOL ParamOf_SetStrokeColor(int32_t & color); + FX_BOOL ParamOf_SetFillColor(int32_t & color); - FX_BOOL ParamOf_StrokePath(FX_INT32 & path, FX_INT32 & matrix); - FX_BOOL ParamOf_FillPath(FX_INT32 & path, FX_INT32 & fillMode, FX_INT32 & matrix); - FX_BOOL ParamOf_ClipPath(FX_INT32 & path, FX_INT32 & fillMode, FX_INT32 & matrix); + FX_BOOL ParamOf_StrokePath(int32_t & path, int32_t & matrix); + FX_BOOL ParamOf_FillPath(int32_t & path, int32_t & fillMode, int32_t & matrix); + FX_BOOL ParamOf_ClipPath(int32_t & path, int32_t & fillMode, int32_t & matrix); - FX_BOOL ParamOf_DrawImage(FX_INT32 & source, FX_INT32 & point, FX_INT32 & matrix); - FX_BOOL ParamOf_StretchImage(FX_INT32 & source, FX_INT32 & rect, FX_INT32 & matrix); + FX_BOOL ParamOf_DrawImage(int32_t & source, int32_t & point, int32_t & matrix); + FX_BOOL ParamOf_StretchImage(int32_t & source, int32_t & rect, int32_t & matrix); - FX_BOOL ParamOf_ConcatMatrix(FX_INT32 & matrix); - FX_BOOL ParamOf_SetClipRect(FX_INT32 & rect); - FX_BOOL ParamOf_SetFont(FX_INT32 & font); + FX_BOOL ParamOf_ConcatMatrix(int32_t & matrix); + FX_BOOL ParamOf_SetClipRect(int32_t & rect); + FX_BOOL ParamOf_SetFont(int32_t & font); FX_BOOL ParamOf_SetFontSize(FX_FLOAT & size); FX_BOOL ParamOf_SetFontHScale(FX_FLOAT & scale); FX_BOOL ParamOf_SetCharSpacing(FX_FLOAT & spacing); - FX_BOOL ParamOf_SetTextDrawingMode(FX_INT32 & mode); - FX_BOOL ParamOf_SetText(FX_INT32 & point, FX_INT32 & text, FX_INT32 & matrix); - FX_BOOL ParamOf_Transfer(FX_INT32 & graphics, FX_INT32 & matrix); - FX_BOOL ParamOf_Transfer(FX_INT32 & graphics, + FX_BOOL ParamOf_SetTextDrawingMode(int32_t & mode); + FX_BOOL ParamOf_SetText(int32_t & point, int32_t & text, int32_t & matrix); + FX_BOOL ParamOf_Transfer(int32_t & graphics, int32_t & matrix); + FX_BOOL ParamOf_Transfer(int32_t & graphics, FX_FLOAT & srcLeft, FX_FLOAT & srcTop, - FX_INT32 & dstRect, - FX_INT32 & matrix); + int32_t & dstRect, + int32_t & matrix); private: CXML_Element * _element; diff --git a/xfa/src/fxgraphics/src/pre.h b/xfa/src/fxgraphics/src/pre.h index ab0df3d9ac..701a48d85d 100644 --- a/xfa/src/fxgraphics/src/pre.h +++ b/xfa/src/fxgraphics/src/pre.h @@ -33,9 +33,9 @@ enum { }; #define FX_HATCHSTYLE_Total 53 struct FX_HATCHDATA { - FX_INT32 width; - FX_INT32 height; - FX_BYTE maskBits[64]; + int32_t width; + int32_t height; + uint8_t maskBits[64]; }; typedef FX_HATCHDATA const * FX_LPCHATCHDATA; static const FX_HATCHDATA hatchBitmapData[FX_HATCHSTYLE_Total] = { diff --git a/xfa/src/fxjse/src/class.cpp b/xfa/src/fxjse/src/class.cpp index e29d4ce306..735a77f1f1 100644 --- a/xfa/src/fxjse/src/class.cpp +++ b/xfa/src/fxjse/src/class.cpp @@ -22,7 +22,7 @@ void FXJSE_DefineFunctions(FXJSE_HCONTEXT hContext, const FXJSE_FUNCTION* lpFunc CFXJSE_ScopeUtil_IsolateHandleContext scope(lpContext); v8::Isolate *pIsolate = lpContext->GetRuntime(); v8::Local hGlobalObject = FXJSE_GetGlobalObjectFromContext(scope.GetLocalContext()); - for(FX_INT32 i = 0; i < nNum; i++) { + for(int32_t i = 0; i < nNum; i++) { hGlobalObject->ForceSet(v8::String::NewFromUtf8(pIsolate, lpFunctions[i].name), v8::Function::New(pIsolate, FXJSE_V8FunctionCallback_Wrapper, v8::External::New(pIsolate, const_cast(lpFunctions + i))), static_cast(v8::ReadOnly | v8::DontDelete)); @@ -133,12 +133,12 @@ FXJSE_HRUNTIME CFXJSE_Arguments::GetRuntime() const const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast(this); return reinterpret_cast(lpArguments->m_pRetValue->GetIsolate()); } -FX_INT32 CFXJSE_Arguments::GetLength() const +int32_t CFXJSE_Arguments::GetLength() const { const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast(this); return lpArguments->m_pInfo->Length(); } -FXJSE_HVALUE CFXJSE_Arguments::GetValue(FX_INT32 index) const +FXJSE_HVALUE CFXJSE_Arguments::GetValue(int32_t index) const { const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast(this); CFXJSE_Value* lpArgValue = CFXJSE_Value::Create(v8::Isolate::GetCurrent()); @@ -146,29 +146,29 @@ FXJSE_HVALUE CFXJSE_Arguments::GetValue(FX_INT32 index) const lpArgValue->ForceSetValue((*lpArguments->m_pInfo)[index]); return reinterpret_cast(lpArgValue); } -FX_BOOL CFXJSE_Arguments::GetBoolean(FX_INT32 index) const +FX_BOOL CFXJSE_Arguments::GetBoolean(int32_t index) const { const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast(this); return (*lpArguments->m_pInfo)[index]->BooleanValue() ? TRUE : FALSE; } -FX_INT32 CFXJSE_Arguments::GetInt32(FX_INT32 index) const +int32_t CFXJSE_Arguments::GetInt32(int32_t index) const { const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast(this); - return static_cast((*lpArguments->m_pInfo)[index]->NumberValue()); + return static_cast((*lpArguments->m_pInfo)[index]->NumberValue()); } -FX_FLOAT CFXJSE_Arguments::GetFloat(FX_INT32 index) const +FX_FLOAT CFXJSE_Arguments::GetFloat(int32_t index) const { const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast(this); return static_cast((*lpArguments->m_pInfo)[index]->NumberValue()); } -CFX_ByteString CFXJSE_Arguments::GetUTF8String(FX_INT32 index) const +CFX_ByteString CFXJSE_Arguments::GetUTF8String(int32_t index) const { const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast(this); v8::Local hString = (*lpArguments->m_pInfo)[index]->ToString(); v8::String::Utf8Value szStringVal(hString); return CFX_ByteString(*szStringVal); } -FX_LPVOID CFXJSE_Arguments::GetObject(FX_INT32 index, FXJSE_HCLASS hClass ) const +FX_LPVOID CFXJSE_Arguments::GetObject(int32_t index, FXJSE_HCLASS hClass ) const { const CFXJSE_ArgumentsImpl* lpArguments = reinterpret_cast(this); v8::Local hValue = (*lpArguments->m_pInfo)[index]; @@ -220,7 +220,7 @@ CFXJSE_Class* CFXJSE_Class::Create(CFXJSE_Context* lpContext, const FXJSE_CLASS* SetUpNamedPropHandler(pIsolate, hObjectTemplate, lpClassDefinition); } if(lpClassDefinition->propNum) { - for(FX_INT32 i = 0; i < lpClassDefinition->propNum; i++) { + for(int32_t i = 0; i < lpClassDefinition->propNum; i++) { hObjectTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(pIsolate, lpClassDefinition->properties[i].name), lpClassDefinition->properties[i].getProc ? FXJSE_V8GetterCallback_Wrapper : NULL, lpClassDefinition->properties[i].setProc ? FXJSE_V8SetterCallback_Wrapper : NULL, @@ -229,7 +229,7 @@ CFXJSE_Class* CFXJSE_Class::Create(CFXJSE_Context* lpContext, const FXJSE_CLASS* } } if(lpClassDefinition->methNum) { - for(FX_INT32 i = 0; i < lpClassDefinition->methNum; i++) { + for(int32_t i = 0; i < lpClassDefinition->methNum; i++) { hObjectTemplate->Set(v8::String::NewFromUtf8(pIsolate, lpClassDefinition->methods[i].name), v8::FunctionTemplate::New(pIsolate, FXJSE_V8FunctionCallback_Wrapper, v8::External::New(pIsolate, const_cast(lpClassDefinition->methods + i))), diff --git a/xfa/src/fxjse/src/context.cpp b/xfa/src/fxjse/src/context.cpp index d78729fc35..d2b10db38d 100644 --- a/xfa/src/fxjse/src/context.cpp +++ b/xfa/src/fxjse/src/context.cpp @@ -51,7 +51,7 @@ static FX_LPCSTR szCompatibleModeScripts[] = { }; void FXJSE_Context_EnableCompatibleMode(FXJSE_HCONTEXT hContext, FX_DWORD dwCompatibleFlags) { - for (FX_UINT32 i = 0; i < (FX_UINT32)FXJSE_COMPATIBLEMODEFLAGCOUNT; i++) { + for (uint32_t i = 0; i < (uint32_t)FXJSE_COMPATIBLEMODEFLAGCOUNT; i++) { if (dwCompatibleFlags & (1 << i)) { FXJSE_ExecuteScript(hContext, szCompatibleModeScripts[i], NULL, NULL); } @@ -113,7 +113,7 @@ FX_BOOL FXJSE_ReturnValue_GetMessage(FXJSE_HVALUE hRetValue, CFX_ByteString& utf utf8Message = *hStringVal1; return TRUE; } -FX_BOOL FXJSE_ReturnValue_GetLineInfo(FXJSE_HVALUE hRetValue, FX_INT32& nLine, FX_INT32& nCol) +FX_BOOL FXJSE_ReturnValue_GetLineInfo(FXJSE_HVALUE hRetValue, int32_t& nLine, int32_t& nCol) { CFXJSE_Value* lpValue = reinterpret_cast(hRetValue); if(!lpValue) { @@ -163,7 +163,7 @@ CFXJSE_Context* CFXJSE_Context::Create(v8::Isolate* pIsolate, const FXJSE_CLASS* } CFXJSE_Context::~CFXJSE_Context() { - for(FX_INT32 i = 0, count = m_rgClasses.GetSize(); i < count; i++) { + for(int32_t i = 0, count = m_rgClasses.GetSize(); i < count; i++) { CFXJSE_Class* pClass = m_rgClasses[i]; if(pClass) { delete pClass; diff --git a/xfa/src/fxjse/src/dynprop.cpp b/xfa/src/fxjse/src/dynprop.cpp index 3fc6c494eb..7c78f6f90a 100644 --- a/xfa/src/fxjse/src/dynprop.cpp +++ b/xfa/src/fxjse/src/dynprop.cpp @@ -32,7 +32,7 @@ static void FXJSE_DynPropGetterAdapter_MethodCallback (const v8::FunctionCallbac static void FXJSE_DynPropGetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, FX_BSTR szPropName, FXJSE_HVALUE hValue) { ASSERT(lpClass); - FX_INT32 nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE); + int32_t nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE); if(nPropType == FXJSE_ClassPropType_Property) { if(lpClass->dynPropGetter) { lpClass->dynPropGetter(hObject, szPropName, hValue); @@ -54,7 +54,7 @@ static void FXJSE_DynPropGetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HO static void FXJSE_DynPropSetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, FX_BSTR szPropName, FXJSE_HVALUE hValue) { ASSERT(lpClass); - FX_INT32 nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE); + int32_t nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE); if(nPropType != FXJSE_ClassPropType_Method) { if(lpClass->dynPropSetter) { lpClass->dynPropSetter(hObject, szPropName, hValue); @@ -64,13 +64,13 @@ static void FXJSE_DynPropSetterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HO static FX_BOOL FXJSE_DynPropQueryAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, FX_BSTR szPropName) { ASSERT(lpClass); - FX_INT32 nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, TRUE); + int32_t nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, TRUE); return nPropType != FXJSE_ClassPropType_None; } static FX_BOOL FXJSE_DynPropDeleterAdapter (const FXJSE_CLASS* lpClass, FXJSE_HOBJECT hObject, FX_BSTR szPropName) { ASSERT(lpClass); - FX_INT32 nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE); + int32_t nPropType = lpClass->dynPropTypeGetter == NULL ? FXJSE_ClassPropType_Property : lpClass->dynPropTypeGetter(hObject, szPropName, FALSE); if(nPropType != FXJSE_ClassPropType_Method) { if(lpClass->dynPropDeleter) { return lpClass->dynPropDeleter(hObject, szPropName); @@ -230,7 +230,7 @@ static void FXJSE_V8_NamedPropertyQueryCallback(v8::Local property, if(FXJSE_DynPropQueryAdapter(lpClass, reinterpret_cast(lpThisValue), szFxPropName)) { info.GetReturnValue().Set(v8::DontDelete); } else { - const FX_INT32 iV8Absent = 64; + const int32_t iV8Absent = 64; info.GetReturnValue().Set(iV8Absent); } delete lpThisValue; diff --git a/xfa/src/fxjse/src/runtime.cpp b/xfa/src/fxjse/src/runtime.cpp index d880606551..6f0dbf7601 100644 --- a/xfa/src/fxjse/src/runtime.cpp +++ b/xfa/src/fxjse/src/runtime.cpp @@ -111,7 +111,7 @@ void CFXJSE_RuntimeList::AppendRuntime(v8::Isolate* pIsolate) } void CFXJSE_RuntimeList::RemoveRuntime(v8::Isolate* pIsolate, CFXJSE_RuntimeList::RuntimeDisposeCallback lpfnDisposeCallback) { - FX_INT32 iIdx = m_RuntimeList.Find(pIsolate, 0); + int32_t iIdx = m_RuntimeList.Find(pIsolate, 0); if(iIdx >= 0) { m_RuntimeList.RemoveAt(iIdx, 1); } @@ -121,9 +121,9 @@ void CFXJSE_RuntimeList::RemoveRuntime(v8::Isolate* pIsolate, CFXJSE_RuntimeList } void CFXJSE_RuntimeList::RemoveAllRuntimes(CFXJSE_RuntimeList::RuntimeDisposeCallback lpfnDisposeCallback) { - FX_INT32 iSize = m_RuntimeList.GetSize(); + int32_t iSize = m_RuntimeList.GetSize(); if(lpfnDisposeCallback) { - for(FX_INT32 iIdx = 0; iIdx < iSize; iIdx++) { + for(int32_t iIdx = 0; iIdx < iSize; iIdx++) { lpfnDisposeCallback(m_RuntimeList[iIdx]); } } diff --git a/xfa/src/fxjse/src/value.cpp b/xfa/src/fxjse/src/value.cpp index 21939e8747..783961657a 100644 --- a/xfa/src/fxjse/src/value.cpp +++ b/xfa/src/fxjse/src/value.cpp @@ -84,7 +84,7 @@ void FXJSE_Value_ToUTF8String (FXJSE_HVALUE hValue, CFX_ByteString& szStrOutput ASSERT(lpValue); return lpValue->ToString(szStrOutput); } -FX_INT32 FXJSE_Value_ToInteger (FXJSE_HVALUE hValue) +int32_t FXJSE_Value_ToInteger (FXJSE_HVALUE hValue) { CFXJSE_Value* lpValue = reinterpret_cast(hValue); ASSERT(lpValue); @@ -121,7 +121,7 @@ void FXJSE_Value_SetUTF8String (FXJSE_HVALUE hValue, FX_BSTR szString) ASSERT(lpValue); return lpValue->SetString(szString); } -void FXJSE_Value_SetInteger (FXJSE_HVALUE hValue, FX_INT32 nInteger) +void FXJSE_Value_SetInteger (FXJSE_HVALUE hValue, int32_t nInteger) { CFXJSE_Value* lpValue = reinterpret_cast(hValue); ASSERT(lpValue); @@ -150,7 +150,7 @@ void FXJSE_Value_SetObject (FXJSE_HVALUE hValue, FX_LPVOID lpObject, FXJSE_HCL lpValue->SetHostObject(lpObject, lpClass); } } -void FXJSE_Value_SetArray (FXJSE_HVALUE hValue, FX_UINT32 uValueCount, FXJSE_HVALUE* rgValues) +void FXJSE_Value_SetArray (FXJSE_HVALUE hValue, uint32_t uValueCount, FXJSE_HVALUE* rgValues) { CFXJSE_Value* lpValue = reinterpret_cast(hValue); return lpValue->SetArray(uValueCount, reinterpret_cast(rgValues)); @@ -181,14 +181,14 @@ FX_BOOL FXJSE_Value_SetObjectProp (FXJSE_HVALUE hValue, FX_BSTR szPropName, FX ASSERT(lpValue && lpPropValue); return lpValue->SetObjectProperty(szPropName, lpPropValue); } -FX_BOOL FXJSE_Value_GetObjectPropByIdx (FXJSE_HVALUE hValue, FX_UINT32 uPropIdx, FXJSE_HVALUE hPropValue) +FX_BOOL FXJSE_Value_GetObjectPropByIdx (FXJSE_HVALUE hValue, uint32_t uPropIdx, FXJSE_HVALUE hPropValue) { CFXJSE_Value* lpValue = reinterpret_cast(hValue); CFXJSE_Value* lpPropValue = reinterpret_cast(hPropValue); ASSERT(lpValue && lpPropValue); return lpValue->GetObjectProperty(uPropIdx, lpPropValue); } -FX_BOOL FXJSE_Value_SetObjectPropByIdx (FXJSE_HVALUE hValue, FX_UINT32 uPropIdx, FXJSE_HVALUE hPropValue) +FX_BOOL FXJSE_Value_SetObjectPropByIdx (FXJSE_HVALUE hValue, uint32_t uPropIdx, FXJSE_HVALUE hPropValue) { CFXJSE_Value* lpValue = reinterpret_cast(hValue); CFXJSE_Value* lpPropValue = reinterpret_cast(hPropValue); @@ -222,7 +222,7 @@ FX_BOOL FXJSE_Value_SetFunctionBind (FXJSE_HVALUE hValue, FXJSE_HVALUE hOldFunc ASSERT(lpValue && lpOldFunction && lpNewThis); return lpValue->SetFunctionBind(lpOldFunction, lpNewThis); } -FX_BOOL FXJSE_Value_CallFunction(FXJSE_HVALUE hFunction, FXJSE_HVALUE hThis, FXJSE_HVALUE hRetValue, FX_UINT32 nArgCount, FXJSE_HVALUE* lpArgs) +FX_BOOL FXJSE_Value_CallFunction(FXJSE_HVALUE hFunction, FXJSE_HVALUE hThis, FXJSE_HVALUE hRetValue, uint32_t nArgCount, FXJSE_HVALUE* lpArgs) { CFXJSE_Value* lpFunction = reinterpret_cast(hFunction); CFXJSE_Value* lpThis = reinterpret_cast(hThis); @@ -293,25 +293,25 @@ V8_INLINE static double FXJSE_ftod(FX_FLOAT fNumber) ASSERT(FALSE); return fNumber; } - FX_UINT32 nFloatBits = (FX_UINT32&)fNumber; - FX_UINT8 nExponent = (FX_UINT8)(nFloatBits >> 16 >> 7 ); + uint32_t nFloatBits = (uint32_t&)fNumber; + uint8_t nExponent = (uint8_t)(nFloatBits >> 16 >> 7 ); if(nExponent == 0 || nExponent == 255) { return fNumber; } - FX_INT8 nErrExp = nExponent - 127 - 23; + int8_t nErrExp = nExponent - 127 - 23; if(nErrExp >= 0) { return fNumber; } double dwError = pow(2.0, nErrExp), dwErrorHalf = dwError / 2; double dNumber = fNumber, dNumberAbs = fabs(fNumber); double dNumberAbsMin = dNumberAbs - dwErrorHalf, dNumberAbsMax = dNumberAbs + dwErrorHalf; - FX_INT32 iErrPos = 0; + int32_t iErrPos = 0; if(floor(dNumberAbsMin) == floor(dNumberAbsMax)) { dNumberAbsMin = fmod(dNumberAbsMin, 1.0); dNumberAbsMax = fmod(dNumberAbsMax, 1.0); - FX_INT32 iErrPosMin = 1, iErrPosMax = 38; + int32_t iErrPosMin = 1, iErrPosMax = 38; do { - FX_INT32 iMid = (iErrPosMin + iErrPosMax) / 2; + int32_t iMid = (iErrPosMin + iErrPosMax) / 2; double dPow = pow(10.0, iMid); if(floor(dNumberAbsMin * dPow) == floor(dNumberAbsMax * dPow)) { iErrPosMin = iMid + 1; @@ -339,12 +339,12 @@ void CFXJSE_Value::SetHostObject(FX_LPVOID lpObject, CFXJSE_Class* lpClass) FXJSE_UpdateObjectBinding(hObject, lpObject); m_hValue.Reset(m_pIsolate, hObject); } -void CFXJSE_Value::SetArray(FX_UINT32 uValueCount, CFXJSE_Value** rgValues) +void CFXJSE_Value::SetArray(uint32_t uValueCount, CFXJSE_Value** rgValues) { CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate); v8::Local hArrayObject = v8::Array::New(m_pIsolate, uValueCount); if (rgValues) { - for(FX_UINT32 i = 0; i < uValueCount; i++) { + for(uint32_t i = 0; i < uValueCount; i++) { if(rgValues[i]) { hArrayObject->Set(i, v8::Local::New(m_pIsolate, rgValues[i]->DirectGetValue())); } @@ -379,7 +379,7 @@ FX_BOOL CFXJSE_Value::GetObjectProperty(FX_BSTR szPropName, CFXJSE_Value* lpProp lpPropValue->ForceSetValue(hPropValue); return TRUE; } -FX_BOOL CFXJSE_Value::SetObjectProperty(FX_UINT32 uPropIdx, CFXJSE_Value* lpPropValue) +FX_BOOL CFXJSE_Value::SetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropValue) { CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate); v8::Local hObject = v8::Local::New(m_pIsolate, m_hValue); @@ -389,7 +389,7 @@ FX_BOOL CFXJSE_Value::SetObjectProperty(FX_UINT32 uPropIdx, CFXJSE_Value* lpProp v8::Local hPropValue = v8::Local::New(m_pIsolate, lpPropValue->DirectGetValue()); return (FX_BOOL)hObject.As()->Set(uPropIdx, hPropValue); } -FX_BOOL CFXJSE_Value::GetObjectProperty(FX_UINT32 uPropIdx, CFXJSE_Value* lpPropValue) +FX_BOOL CFXJSE_Value::GetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropValue) { CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate); v8::Local hObject = v8::Local::New(m_pIsolate, m_hValue); @@ -453,8 +453,8 @@ FX_BOOL CFXJSE_Value::SetFunctionBind(CFXJSE_Value* lpOldFunction, CFXJSE_Value* m_hValue.Reset(m_pIsolate, hBoundFunction); return TRUE; } -#define FXJSE_INVALID_PTR ((FX_LPVOID)(FX_INTPTR)-1) -FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, FX_UINT32 nArgCount, FXJSE_HVALUE* lpArgs) +#define FXJSE_INVALID_PTR ((FX_LPVOID)(intptr_t)-1) +FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, uint32_t nArgCount, FXJSE_HVALUE* lpArgs) { CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate); v8::Local hFunctionValue = v8::Local::New(m_pIsolate, DirectGetValue()); @@ -473,7 +473,7 @@ FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, F if (!lpLocalArgs) { return FALSE; } - for (FX_UINT32 i = 0; i < nArgCount; i++) { + for (uint32_t i = 0; i < nArgCount; i++) { new (lpLocalArgs + i) v8::Local; CFXJSE_Value* lpArg = (CFXJSE_Value*)lpArgs[i]; if(lpArg) { @@ -505,7 +505,7 @@ FX_BOOL CFXJSE_Value::Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, F lpRetValue->ForceSetValue(hReturnValue); } if(lpLocalArgs) { - for (FX_UINT32 i = 0; i < nArgCount; i++) { + for (uint32_t i = 0; i < nArgCount; i++) { lpLocalArgs[i].~Local(); } FX_Free(lpLocalArgs); diff --git a/xfa/src/fxjse/src/value.h b/xfa/src/fxjse/src/value.h index 547ae9251f..482015811b 100644 --- a/xfa/src/fxjse/src/value.h +++ b/xfa/src/fxjse/src/value.h @@ -128,12 +128,12 @@ public: v8::Local hValue = v8::Local::New(m_pIsolate, m_hValue); return static_cast(hValue->NumberValue()); } - V8_INLINE FX_INT32 ToInteger() const + V8_INLINE int32_t ToInteger() const { ASSERT(!m_hValue.IsEmpty()); CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate); v8::Local hValue = v8::Local::New(m_pIsolate, m_hValue); - return static_cast(hValue->NumberValue()); + return static_cast(hValue->NumberValue()); } V8_INLINE void ToString(CFX_ByteString& szStrOutput) const { @@ -164,7 +164,7 @@ public: v8::Local hValue = v8::Boolean::New(m_pIsolate, bBoolean != FALSE); m_hValue.Reset(m_pIsolate, hValue); } - V8_INLINE void SetInteger(FX_INT32 nInteger) + V8_INLINE void SetInteger(int32_t nInteger) { CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate); v8::Local hValue = v8::Integer::New(m_pIsolate, nInteger); @@ -192,18 +192,18 @@ public: m_hValue.Reset(m_pIsolate, hValue); } void SetHostObject(FX_LPVOID lpObject, CFXJSE_Class* lpClass); - void SetArray(FX_UINT32 uValueCount, CFXJSE_Value** rgValues); + void SetArray(uint32_t uValueCount, CFXJSE_Value** rgValues); void SetDate(FXJSE_DOUBLE dDouble); public: FX_BOOL GetObjectProperty(FX_BSTR szPropName, CFXJSE_Value* lpPropValue); FX_BOOL SetObjectProperty(FX_BSTR szPropName, CFXJSE_Value* lpPropValue); - FX_BOOL GetObjectProperty(FX_UINT32 uPropIdx, CFXJSE_Value* lpPropValue); - FX_BOOL SetObjectProperty(FX_UINT32 uPropIdx, CFXJSE_Value* lpPropValue); + FX_BOOL GetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropValue); + FX_BOOL SetObjectProperty(uint32_t uPropIdx, CFXJSE_Value* lpPropValue); FX_BOOL DeleteObjectProperty(FX_BSTR szPropName); FX_BOOL HasObjectOwnProperty(FX_BSTR szPropName, FX_BOOL bUseTypeGetter); FX_BOOL SetObjectOwnProperty(FX_BSTR szPropName, CFXJSE_Value* lpPropValue); FX_BOOL SetFunctionBind(CFXJSE_Value* lpOldFunction, CFXJSE_Value* lpNewThis); - FX_BOOL Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, FX_UINT32 nArgCount, FXJSE_HVALUE* lpArgs); + FX_BOOL Call(CFXJSE_Value* lpReceiver, CFXJSE_Value* lpRetValue, uint32_t nArgCount, FXJSE_HVALUE* lpArgs); public: V8_INLINE v8::Isolate* GetIsolate() const { -- cgit v1.2.3