Merge to XFA: Use stdint.h types throughout PDFium.
[pdfium.git] / xfa / src / fxfa / src / app / xfa_fftextedit.cpp
index b2e5299..afdfd1f 100644 (file)
@@ -69,11 +69,11 @@ void CXFA_FFTextEdit::UpdateWidgetProperty()
         dwExtendedStyle |= FWL_STYLEEXT_EDT_MultiLine;\r
     }\r
     XFA_ELEMENT eType = XFA_ELEMENT_UNKNOWN;\r
-    FX_INT32 iMaxChars = m_pDataAcc->GetMaxChars(eType);\r
+    int32_t iMaxChars = m_pDataAcc->GetMaxChars(eType);\r
     if (eType == XFA_ELEMENT_ExData) {\r
         iMaxChars = 0;\r
     }\r
-    FX_INT32 iNumCells = m_pDataAcc->GetNumberOfCells();\r
+    int32_t iNumCells = m_pDataAcc->GetNumberOfCells();\r
     if (iNumCells == 0) {\r
         dwExtendedStyle |= FWL_STYLEEXT_EDT_CombText;\r
         pWidget->SetLimit(iMaxChars > 0 ? iMaxChars : 1);\r
@@ -138,7 +138,7 @@ FX_BOOL CXFA_FFTextEdit::OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy)
     }\r
     CFX_PointF pt;\r
     pt.Set(fx, fy);\r
-    GetDoc()->GetDocProvider()->PopupMenu((XFA_HWIDGET)this, pt, NULL);\r
+    GetDoc()->GetDocProvider()->PopupMenu(this, pt, NULL);\r
     return TRUE;\r
 }\r
 FX_BOOL CXFA_FFTextEdit::OnSetFocus(CXFA_FFWidget* pOldWidget)\r
@@ -208,7 +208,7 @@ FX_DWORD CXFA_FFTextEdit::GetAlignment()
 {\r
     FX_DWORD dwExtendedStyle = 0;\r
     if (CXFA_Para para = m_pDataAcc->GetPara()) {\r
-        FX_INT32 iHorz = para.GetHorizontalAlign();\r
+        int32_t iHorz = para.GetHorizontalAlign();\r
         switch(iHorz) {\r
             case XFA_ATTRIBUTEENUM_Center:\r
                 dwExtendedStyle |= FWL_STYLEEXT_EDT_HCenter;\r
@@ -227,7 +227,7 @@ FX_DWORD CXFA_FFTextEdit::GetAlignment()
                 dwExtendedStyle |= FWL_STYLEEXT_EDT_HNear;\r
                 break;\r
         }\r
-        FX_INT32 iVert = para.GetVerticalAlign();\r
+        int32_t iVert = para.GetVerticalAlign();\r
         switch(iVert) {\r
             case XFA_ATTRIBUTEENUM_Middle:\r
                 dwExtendedStyle |= FWL_STYLEEXT_EDT_VCenter;\r
@@ -254,7 +254,7 @@ FX_BOOL CXFA_FFTextEdit::UpdateFWLData()
     FX_BOOL bUpdate = FALSE;\r
     if (m_pDataAcc->GetUIType() == XFA_ELEMENT_TextEdit && m_pDataAcc->GetNumberOfCells() < 0) {\r
         XFA_ELEMENT elementType = XFA_ELEMENT_UNKNOWN;\r
-        FX_INT32 iMaxChars = m_pDataAcc->GetMaxChars(elementType);\r
+        int32_t iMaxChars = m_pDataAcc->GetMaxChars(elementType);\r
         if (elementType == XFA_ELEMENT_ExData) {\r
             iMaxChars = eType == XFA_VALUEPICTURE_Edit ? iMaxChars : 0;\r
         }\r
@@ -294,7 +294,7 @@ FX_BOOL CXFA_FFTextEdit::Redo()
 }\r
 FX_BOOL CXFA_FFTextEdit::CanCopy()\r
 {\r
-    FX_INT32 nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges();\r
+    int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges();\r
     return nCount > 0;\r
 }\r
 FX_BOOL CXFA_FFTextEdit::CanCut()\r
@@ -302,7 +302,7 @@ FX_BOOL CXFA_FFTextEdit::CanCut()
     if (m_pNormalWidget->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly) {\r
         return FALSE;\r
     }\r
-    FX_INT32 nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges();\r
+    int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges();\r
     return nCount > 0;\r
 }\r
 FX_BOOL CXFA_FFTextEdit::CanPaste()\r
@@ -327,7 +327,7 @@ FX_BOOL CXFA_FFTextEdit::Paste(const CFX_WideString &wsPaste)
 }\r
 FX_BOOL CXFA_FFTextEdit::SelectAll()\r
 {\r
-    FX_INT32 nCount = ((CFWL_Edit*)m_pNormalWidget)->GetTextLength();\r
+    int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->GetTextLength();\r
     return ((CFWL_Edit*)m_pNormalWidget)->AddSelRange(0, nCount);\r
 }\r
 FX_BOOL CXFA_FFTextEdit::Delete()\r
@@ -366,13 +366,13 @@ void CXFA_FFTextEdit::OnTextChanged(IFWL_Widget *pWidget, const CFX_WideString &
     if (m_pDataAcc->GetUIType() == XFA_ELEMENT_DateTimeEdit) {\r
         CFWL_DateTimePicker* pDateTime = (CFWL_DateTimePicker*)pEdit;\r
         pDateTime->GetEditText(eParam.m_wsNewText);\r
-        FX_INT32 iSels = pDateTime->CountSelRanges();\r
+        int32_t iSels = pDateTime->CountSelRanges();\r
         if (iSels ) {\r
             eParam.m_iSelEnd = pDateTime->GetSelRange(0, eParam.m_iSelStart);\r
         }\r
     } else {\r
         pEdit->GetText(eParam.m_wsNewText);\r
-        FX_INT32 iSels = pEdit->CountSelRanges();\r
+        int32_t iSels = pEdit->CountSelRanges();\r
         if (iSels ) {\r
             eParam.m_iSelEnd = pEdit->GetSelRange(0, eParam.m_iSelStart);\r
         }\r
@@ -388,23 +388,23 @@ void CXFA_FFTextEdit::OnTextFull(IFWL_Widget *pWidget)
 }\r
 void CXFA_FFTextEdit::OnAddDoRecord(IFWL_Widget *pWidget)\r
 {\r
-    GetDoc()->GetDocProvider()->AddDoRecord((XFA_HWIDGET)this);\r
+    GetDoc()->GetDocProvider()->AddDoRecord(this);\r
 }\r
 FX_BOOL CXFA_FFTextEdit::CheckWord(FX_BSTR sWord)\r
 {\r
     if (sWord.IsEmpty() || m_pDataAcc->GetUIType() != XFA_ELEMENT_TextEdit) {\r
         return TRUE;\r
     }\r
-    return GetDoc()->GetDocProvider()->CheckWord((XFA_HDOC)GetDoc(), sWord);\r
+    return GetDoc()->GetDocProvider()->CheckWord(GetDoc(), sWord);\r
 }\r
 FX_BOOL CXFA_FFTextEdit::GetSuggestWords(FX_BSTR sWord, CFX_ByteStringArray &sSuggest)\r
 {\r
     if (m_pDataAcc->GetUIType() != XFA_ELEMENT_TextEdit) {\r
         return FALSE;\r
     }\r
-    return GetDoc()->GetDocProvider()->GetSuggestWords((XFA_HDOC)GetDoc(), sWord, sSuggest);\r
+    return GetDoc()->GetDocProvider()->GetSuggestWords(GetDoc(), sWord, sSuggest);\r
 }\r
-FX_INT32 CXFA_FFTextEdit::OnProcessMessage(CFWL_Message *pMessage)\r
+int32_t CXFA_FFTextEdit::OnProcessMessage(CFWL_Message *pMessage)\r
 {\r
     return m_pOldDelegate->OnProcessMessage(pMessage);\r
 }\r
@@ -485,7 +485,7 @@ void CXFA_FFNumericEdit::UpdateWidgetProperty()
     if (m_pDataAcc->GetHorizontalScrollPolicy() != XFA_ATTRIBUTEENUM_Off) {\r
         dwExtendedStyle |= FWL_STYLEEXT_EDT_AutoHScroll;\r
     }\r
-    FX_INT32 iNumCells = m_pDataAcc->GetNumberOfCells();\r
+    int32_t iNumCells = m_pDataAcc->GetNumberOfCells();\r
     if (iNumCells > 0) {\r
         dwExtendedStyle |= FWL_STYLEEXT_EDT_CombText;\r
         pWidget->SetLimit(iNumCells);\r
@@ -515,9 +515,9 @@ FX_BOOL CXFA_FFNumericEdit::OnValidate(IFWL_Widget *pWidget, CFX_WideString &wsT
     if (!wsPattern.IsEmpty()) {\r
         return TRUE;\r
     }\r
-    FX_INT32 iLeads = 0;\r
+    int32_t iLeads = 0;\r
     m_pDataAcc->GetLeadDigits(iLeads);\r
-    FX_INT32 iFracs = 0;\r
+    int32_t iFracs = 0;\r
     m_pDataAcc->GetFracDigits(iFracs);\r
     CFX_WideString wsFormat;\r
     CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(m_pDataAcc);\r
@@ -661,7 +661,7 @@ void CXFA_FFDateTimeEdit::UpdateWidgetProperty()
     dwExtendedStyle |= GetAlignment();\r
     m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF);\r
     FX_DWORD dwEditStyles = FWL_STYLEEXT_EDT_LastLineHeight;\r
-    FX_INT32 iNumCells = m_pDataAcc->GetNumberOfCells();\r
+    int32_t iNumCells = m_pDataAcc->GetNumberOfCells();\r
     if (iNumCells > 0) {\r
         dwEditStyles |= FWL_STYLEEXT_EDT_CombText;\r
         pWidget->SetEditLimit(iNumCells);\r
@@ -678,7 +678,7 @@ FX_DWORD CXFA_FFDateTimeEdit::GetAlignment()
 {\r
     FX_DWORD dwExtendedStyle = 0;\r
     if (CXFA_Para para = m_pDataAcc->GetPara()) {\r
-        FX_INT32 iHorz = para.GetHorizontalAlign();\r
+        int32_t iHorz = para.GetHorizontalAlign();\r
         switch(iHorz) {\r
             case XFA_ATTRIBUTEENUM_Center:\r
                 dwExtendedStyle |= FWL_STYLEEXT_DTP_EditHCenter;\r
@@ -697,7 +697,7 @@ FX_DWORD CXFA_FFDateTimeEdit::GetAlignment()
                 dwExtendedStyle |= FWL_STYLEEXT_DTP_EditHNear;\r
                 break;\r
         }\r
-        FX_INT32 iVert = para.GetVerticalAlign();\r
+        int32_t iVert = para.GetVerticalAlign();\r
         switch(iVert) {\r
             case XFA_ATTRIBUTEENUM_Middle:\r
                 dwExtendedStyle |= FWL_STYLEEXT_DTP_EditVCenter;\r
@@ -816,7 +816,7 @@ FX_BOOL CXFA_FFDateTimeEdit::DeSelect()
 {\r
     return ((CFWL_DateTimePicker*)m_pNormalWidget)->DeSelect();\r
 }\r
-void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget *pWidget, FX_INT32 iYear, FX_INT32 iMonth, FX_INT32 iDay)\r
+void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget *pWidget, int32_t iYear, int32_t iMonth, int32_t iDay)\r
 {\r
     CFX_WideString wsPicture;\r
     m_pDataAcc->GetPictureContent(wsPicture, XFA_VALUEPICTURE_Edit);\r
@@ -829,7 +829,7 @@ void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget *pWidget, FX_INT32 iYear,
     CFWL_DateTimePicker* pDateTime = (CFWL_DateTimePicker*)m_pNormalWidget;\r
     pDateTime->SetEditText(wsDate);\r
     pDateTime->Update();\r
-    GetDoc()->GetDocProvider()->SetFocusWidget((XFA_HDOC)GetDoc(), NULL);\r
+    GetDoc()->GetDocProvider()->SetFocusWidget(GetDoc(), NULL);\r
     CXFA_EventParam eParam;\r
     eParam.m_eType = XFA_EVENT_Change;\r
     eParam.m_pTarget = m_pDataAcc;\r