Merge to XFA: Remove typdefs for pointer types in fx_system.h.
[pdfium.git] / xfa / src / fee / src / fee / fde_txtedtblock.cpp
index 2d71cd3..7b8ecf4 100644 (file)
@@ -18,7 +18,7 @@ CFDE_TxtEdtBlock::CFDE_TxtEdtBlock(CFDE_TxtEdtEngine * pEngine, const CFX_WideSt
     , m_nIndex(0)\r
     , m_nPosition(nPosition)\r
 {\r
-    FX_LPCWSTR lpBuf = FX_LPCWSTR(wsBlock);\r
+    const FX_WCHAR* lpBuf = const FX_WCHAR*(wsBlock);\r
     int32_t nCount     = wsBlock.GetLength();\r
     int32_t i          = 0;\r
     CFX_WideString wsFix;\r
@@ -166,7 +166,7 @@ CFDE_TxtEdtFieldFormatParser::~CFDE_TxtEdtFieldFormatParser()
 FX_BOOL CFDE_TxtEdtFieldFormatParser::Parse(const CFX_WideString &wsFormat)\r
 {\r
     m_wsFormat = wsFormat;\r
-    FX_LPCWSTR pBuf    = FX_LPCWSTR(m_wsFormat);\r
+    const FX_WCHAR*    pBuf    = const FX_WCHAR*(m_wsFormat);\r
     int32_t    nCount  = m_wsFormat.GetLength();\r
     nCount -= 2;\r
     int32_t i = 0;\r
@@ -206,8 +206,8 @@ int32_t CFDE_TxtEdtFieldFormatParser::CountItems() const
 void CFDE_TxtEdtFieldFormatParser::GetItem(int32_t nIndex, CFX_WideString &wsKey, CFX_WideString &wsValue) const\r
 {\r
     FDE_LPTXTEDTFORMATITEM lpItem = m_ItemArr[nIndex];\r
-    FX_LPCWSTR lpSrcBuf = FX_LPCWSTR(m_wsFormat);\r
-    FX_LPWSTR lpDstBuf = wsKey.GetBuffer(lpItem->nKeyCount);\r
+    const FX_WCHAR* lpSrcBuf = const FX_WCHAR*(m_wsFormat);\r
+    FX_WCHAR* lpDstBuf = wsKey.GetBuffer(lpItem->nKeyCount);\r
     FXSYS_memcpy(lpDstBuf, lpSrcBuf + lpItem->nKeyStart, lpItem->nKeyCount * sizeof(FX_WCHAR));\r
     wsKey.ReleaseBuffer(lpItem->nKeyCount);\r
     lpDstBuf = wsValue.GetBuffer(lpItem->nValCount);\r
@@ -300,8 +300,8 @@ int32_t CFDE_TxtEdtField::Delete(int32_t nIndex, int32_t nCount,
         default:\r
             break;\r
     }\r
-    FX_LPWSTR lpBuf = wsDel.GetBuffer(nCount);\r
-    FXSYS_memcpy(lpBuf, FX_LPCWSTR(m_wsField) + nInnerIndex, nCount * sizeof(FX_WCHAR));\r
+    FX_WCHAR* lpBuf = wsDel.GetBuffer(nCount);\r
+    FXSYS_memcpy(lpBuf, const FX_WCHAR*(m_wsField) + nInnerIndex, nCount * sizeof(FX_WCHAR));\r
     wsDel.ReleaseBuffer(nCount);\r
     m_wsField  = wsTemp;\r
     nCaret             = nIndex + (m_bReserveSpace && !m_bLeftAlignment) ? nCount : 0;\r
@@ -336,8 +336,8 @@ int32_t CFDE_TxtEdtField::Replace(int32_t nIndex, int32_t nCount, const CFX_Wide
         default:\r
             break;\r
     }\r
-    FX_LPWSTR  lpBuffer = wsDel.GetBuffer(nCount);\r
-    FX_LPCWSTR lpSrcBuf = FX_LPCWSTR(m_wsField);\r
+    FX_WCHAR*  lpBuffer = wsDel.GetBuffer(nCount);\r
+    const FX_WCHAR*    lpSrcBuf = const FX_WCHAR*(m_wsField);\r
     FXSYS_memcpy(lpBuffer, lpSrcBuf + nInnerIndexBK, nCount * sizeof(FX_WCHAR));\r
     wsDel.ReleaseBuffer(nCount);\r
     m_wsField  = wsTemp;\r
@@ -349,12 +349,12 @@ void CFDE_TxtEdtField::GetDisplayText(CFX_WideString &wsDisplay)
     CFX_WideString wsField;\r
     GetNormalizedFieldText(wsField);\r
     int32_t nLength    = wsField.GetLength() + FDE_FORMAT_EDIT_FIELD_HADERSIZE + FDE_FORMAT_EDIT_FIELD_TAILSIZE;\r
-    FX_LPWSTR lpBuffer = wsDisplay.GetBuffer(nLength);\r
+    FX_WCHAR* lpBuffer = wsDisplay.GetBuffer(nLength);\r
     lpBuffer[0]                                = FDE_TXTEDT_FORMATBLOCK_BGN;\r
     lpBuffer[nLength - 1]      = FDE_TXTEDT_FORMATBLOCK_END;\r
     FX_DWORD nAddress = (FX_DWORD)this;\r
     FXSYS_memcpy(lpBuffer + 1, &nAddress, sizeof(FX_DWORD));\r
-    FXSYS_memcpy(lpBuffer + 3, FX_LPCWSTR(wsField), (nLength - 4) * sizeof(FX_WCHAR));\r
+    FXSYS_memcpy(lpBuffer + 3, const FX_WCHAR*(wsField), (nLength - 4) * sizeof(FX_WCHAR));\r
     wsDisplay.ReleaseBuffer(nLength);\r
 }\r
 int32_t CFDE_TxtEdtField::GetDisplayLength()\r
@@ -548,7 +548,7 @@ int32_t CFDE_TxtEdtField_Float::Validate(const CFX_WideString & wsText) const
     if (m_nLength != -1 && (nLength > m_nLength)) {\r
         return FDE_FORMAT_FIELD_VALIDATE_F_FULL;\r
     }\r
-    FX_LPCWSTR lpBuf = FX_LPCWSTR(wsText);\r
+    const FX_WCHAR* lpBuf = const FX_WCHAR*(wsText);\r
     int32_t i = 0;\r
     if (m_bSigned) {\r
         FX_WCHAR wcTemp = lpBuf[0];\r
@@ -613,7 +613,7 @@ void CFDE_TxtEdtField_Password::GetNormalizedFieldText(CFX_WideString &wsField)
 {\r
     int32_t nFiledLength       = m_wsField.GetLength();\r
     int32_t nLength            = m_bReserveSpace ? m_nLength : nFiledLength;\r
-    FX_LPWSTR lpBuf                    = wsField.GetBuffer(nLength);\r
+    FX_WCHAR* lpBuf                    = wsField.GetBuffer(nLength);\r
     int32_t nSpaceLength       = nLength - nFiledLength;\r
     int32_t nFirstPart         = m_bLeftAlignment ? nFiledLength : nSpaceLength;\r
     FX_WCHAR wFirstChar                = m_bLeftAlignment ? m_wcAlias : L' ';\r
@@ -655,12 +655,12 @@ CFDE_TxtEdtField_Fixed::CFDE_TxtEdtField_Fixed(const CFX_WideString &wsField, in
 void CFDE_TxtEdtField_Fixed::GetDisplayText(CFX_WideString &wsDisplay)\r
 {\r
     int32_t nLength    = m_wsField.GetLength() + FDE_FORMAT_EDIT_FIELD_HADERSIZE + FDE_FORMAT_EDIT_FIELD_TAILSIZE;\r
-    FX_LPWSTR lpBuffer = wsDisplay.GetBuffer(nLength);\r
+    FX_WCHAR* lpBuffer = wsDisplay.GetBuffer(nLength);\r
     lpBuffer[0]                                = FDE_TXTEDT_FORMATBLOCK_BGN;\r
     lpBuffer[nLength - 1]      = FDE_TXTEDT_FORMATBLOCK_END;\r
     FX_DWORD nAddress = (FX_DWORD)this;\r
     FXSYS_memcpy(lpBuffer + 1, &nAddress, sizeof(FX_DWORD));\r
-    FXSYS_memcpy(lpBuffer + 3, FX_LPCWSTR(m_wsField), (nLength - 4) * sizeof(FX_WCHAR));\r
+    FXSYS_memcpy(lpBuffer + 3, const FX_WCHAR*(m_wsField), (nLength - 4) * sizeof(FX_WCHAR));\r
     wsDisplay.ReleaseBuffer(nLength);\r
 }\r
 int32_t CFDE_TxtEdtField_Fixed::NormalizeCaretPos(int32_t nIndex, FDE_FORMAT_CARET_DIRECTION eDirection ) const\r