summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-27 14:53:20 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-27 14:53:20 -0700
commitd191c3a7f43272019d166bb1fa040eca60650e7d (patch)
tree03b5e72b39f18f4fd0f6cac254bde13d7bdb3bcf
parent93253e8d623cd3e0751ea45df1e414be1495335e (diff)
downloadpdfium-d191c3a7f43272019d166bb1fa040eca60650e7d.tar.xz
Fix FX_BOOL / int inconsistencies, XFA branch
Precursor to automatic FX_BOOL deprecation. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1260743002 .
-rw-r--r--fpdfsdk/src/fpdfview.cpp2
-rw-r--r--xfa/src/fee/src/fee/fde_txtedtengine.cpp11
-rw-r--r--xfa/src/fwl/src/basewidget/include/fwl_editimp.h26
3 files changed, 20 insertions, 19 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 1fbdb74710..d66252018a 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -263,7 +263,7 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BY
return pDocument;
}
-DLLEXPORT FX_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document, int* docType)
+DLLEXPORT FPDF_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document, int* docType)
{
if (!document)
return FALSE;
diff --git a/xfa/src/fee/src/fee/fde_txtedtengine.cpp b/xfa/src/fee/src/fee/fde_txtedtengine.cpp
index 1f4bd62f28..ec88996950 100644
--- a/xfa/src/fee/src/fee/fde_txtedtengine.cpp
+++ b/xfa/src/fee/src/fee/fde_txtedtengine.cpp
@@ -133,13 +133,12 @@ void CFDE_TxtEdtEngine::SetTextByStream(IFX_Stream *pStream)
uint8_t bom[4];
int32_t nPos = pStream->GetBOM(bom);
pStream->Seek(FX_STREAMSEEK_Begin, nPos);
- int32_t bEos = FALSE;
int32_t nPlateSize = FX_MIN(nStreamLength, m_pTxtBuf->GetChunkSize());
FX_WCHAR* lpwstr = (FX_WCHAR*)FDE_Alloc(nPlateSize * sizeof(FX_WCHAR));
FXSYS_assert(lpwstr);
- int32_t nRead = 0;
+ FX_BOOL bEos = false;
while (!bEos) {
- nRead = pStream->ReadString(lpwstr, nPlateSize, bEos);
+ int32_t nRead = pStream->ReadString(lpwstr, nPlateSize, bEos);
bPreIsCR = ReplaceParagEnd(lpwstr, nRead, bPreIsCR);
m_pTxtBuf->Insert(nIndex, lpwstr, nRead);
nIndex += nRead;
@@ -2547,7 +2546,7 @@ void CFDE_TxtEdtDoRecord_DeleteRange::Serialize(CFX_ByteString &bsDoRecord) cons
CFX_ArchiveSaver ArchiveSaver;
ArchiveSaver << int32_t(FDE_TXTEDT_DORECORD_DEL);
ArchiveSaver << (int32_t)(uintptr_t)m_pEngine;
- ArchiveSaver << m_bSel;
+ ArchiveSaver << (int32_t)m_bSel;
ArchiveSaver << m_nIndex;
ArchiveSaver << m_nCaret;
ArchiveSaver << m_wsRange;
@@ -2566,7 +2565,9 @@ void CFDE_TxtEdtDoRecord_DeleteRange::Deserialize(const CFX_ByteStringC& bsDoRec
int32_t nEngine = 0;
ArchiveLoader >> nEngine;
m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine;
- ArchiveLoader >> m_bSel;
+ int32_t iSel = 0;
+ ArchiveLoader >> iSel;
+ m_bSel = !!iSel;
ArchiveLoader >> m_nIndex;
ArchiveLoader >> m_nCaret;
ArchiveLoader >> m_wsRange;
diff --git a/xfa/src/fwl/src/basewidget/include/fwl_editimp.h b/xfa/src/fwl/src/basewidget/include/fwl_editimp.h
index 3f5f7c0218..532e055f99 100644
--- a/xfa/src/fwl/src/basewidget/include/fwl_editimp.h
+++ b/xfa/src/fwl/src/basewidget/include/fwl_editimp.h
@@ -64,22 +64,22 @@ public:
virtual FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant);
virtual FWL_ERR SetOuter(IFWL_Widget *pOuter);
virtual FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax);
- virtual void On_CaretChanged(IFDE_TxtEdtEngine *pEdit, int32_t nPage, FX_BOOL bVisible = TRUE);
- virtual void On_TextChanged(IFDE_TxtEdtEngine * pEdit, FDE_TXTEDT_TEXTCHANGE_INFO &ChangeInfo);
- virtual void On_PageCountChanged(IFDE_TxtEdtEngine *pEdit) {}
- virtual void On_SelChanged(IFDE_TxtEdtEngine *pEdit);
- virtual FX_BOOL On_PageLoad(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex, int32_t nPurpose);
- virtual FX_BOOL On_PageUnload(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex, int32_t nPurpose);
- virtual FX_BOOL On_PageChange(IFDE_TxtEdtEngine *pEdit, FX_BOOL bPageUp = TRUE)
+ void On_CaretChanged(IFDE_TxtEdtEngine *pEdit, int32_t nPage, FX_BOOL bVisible = true) override;
+ void On_TextChanged(IFDE_TxtEdtEngine * pEdit, FDE_TXTEDT_TEXTCHANGE_INFO &ChangeInfo) override;
+ void On_PageCountChanged(IFDE_TxtEdtEngine *pEdit) override {}
+ void On_SelChanged(IFDE_TxtEdtEngine *pEdit) override;
+ FX_BOOL On_PageLoad(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex, int32_t nPurpose) override;
+ FX_BOOL On_PageUnload(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex, int32_t nPurpose) override;
+ FX_BOOL On_PageChange(IFDE_TxtEdtEngine *pEdit, int32_t nPageIndex) override
{
return TRUE;
}
- virtual void On_AddDoRecord(IFDE_TxtEdtEngine *pEdit, const CFX_ByteStringC& bsDoRecord);
- virtual FX_BOOL On_ValidateField(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex, int32_t nFieldIndex, \
- const CFX_WideString &wsFieldText, int32_t nCharIndex);
- virtual FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex);
- virtual FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex, CFX_WideString &wsBlockText);
- virtual FX_BOOL On_Validate(IFDE_TxtEdtEngine * pEdit, CFX_WideString &wsText);
+ void On_AddDoRecord(IFDE_TxtEdtEngine *pEdit, const CFX_ByteStringC& bsDoRecord) override;
+ FX_BOOL On_ValidateField(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex, int32_t nFieldIndex, \
+ const CFX_WideString &wsFieldText, int32_t nCharIndex) override;
+ FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex) override;
+ FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine *pEdit, int32_t nBlockIndex, CFX_WideString &wsBlockText) override;
+ FX_BOOL On_Validate(IFDE_TxtEdtEngine * pEdit, CFX_WideString &wsText) override;
virtual FWL_ERR SetBackgroundColor(FX_DWORD color);
virtual FWL_ERR SetFont(const CFX_WideString &wsFont, FX_FLOAT fSize);
void SetScrollOffset(FX_FLOAT fScrollOffset);