diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-09 13:24:12 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-09 13:24:12 -0700 |
commit | bfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (patch) | |
tree | 4cfbe682869d89900f33751c37f6a84865beeb0a /xfa/src/fee | |
parent | b116136da234afcad018bb44a3ccb64b9ad2a554 (diff) | |
download | pdfium-bfa9a824a20f37c2dd7111012b46c929cf2ed8a0.tar.xz |
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
Diffstat (limited to 'xfa/src/fee')
-rw-r--r-- | xfa/src/fee/include/fx_wordbreak.h | 6 | ||||
-rw-r--r-- | xfa/src/fee/include/ifde_txtedtbuf.h | 14 | ||||
-rw-r--r-- | xfa/src/fee/include/ifde_txtedtengine.h | 90 | ||||
-rw-r--r-- | xfa/src/fee/include/ifde_txtedtpage.h | 18 | ||||
-rw-r--r-- | xfa/src/fee/src/fee/fde_txtedtblock.cpp | 196 | ||||
-rw-r--r-- | xfa/src/fee/src/fee/fde_txtedtblock.h | 106 | ||||
-rw-r--r-- | xfa/src/fee/src/fee/fde_txtedtbuf.cpp | 92 | ||||
-rw-r--r-- | xfa/src/fee/src/fee/fde_txtedtbuf.h | 44 | ||||
-rw-r--r-- | xfa/src/fee/src/fee/fde_txtedtengine.cpp | 630 | ||||
-rw-r--r-- | xfa/src/fee/src/fee/fde_txtedtengine.h | 190 | ||||
-rw-r--r-- | xfa/src/fee/src/fee/fde_txtedtpage.cpp | 124 | ||||
-rw-r--r-- | xfa/src/fee/src/fee/fde_txtedtpage.h | 46 | ||||
-rw-r--r-- | xfa/src/fee/src/fee/fde_txtedtparag.cpp | 42 | ||||
-rw-r--r-- | xfa/src/fee/src/fee/fde_txtedtparag.h | 14 | ||||
-rw-r--r-- | xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.cpp | 18 | ||||
-rw-r--r-- | xfa/src/fee/src/fx_wordbreak/fx_wordbreak_impl.h | 14 | ||||
-rw-r--r-- | xfa/src/fee/src/fx_wordbreak/fx_wordbreakdata.cpp | 2 |
17 files changed, 823 insertions, 823 deletions
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<CFDE_TxtEdtField*> m_FieldArr;
CFX_ArrayTemplate<CFDE_TxtEdtField*> 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<FX_INT32> PosArr;
- FX_INT32 nLength = wsText.GetLength();
- FX_INT32 i = 0;
+ CFX_ArrayTemplate<int32_t> 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<IFDE_TxtEdtPage*> m_PagePtrArray;
CFX_ArrayTemplate<CFDE_TxtEdtParag*> m_ParagPtrArray;
CFX_ArrayTemplate<FDE_LPTXTEDTSELRANGE> 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<FX_INT32> LineBaseArr;
+ int32_t nEndIndex = m_nCharStart + m_nCharCount;
+ CFX_ArrayTemplate<int32_t> 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,
|