diff options
author | tsepez <tsepez@chromium.org> | 2016-11-02 15:43:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-02 15:43:19 -0700 |
commit | d19e912dd469e4bdad9f3020e1f6eb98f10f3470 (patch) | |
tree | 239cb568a80445f14a1ab9b63dcaaddcce67e1cc /xfa/fxfa/app | |
parent | 12f3e4a58f05850b93af35619cb04f0231d86acc (diff) | |
download | pdfium-d19e912dd469e4bdad9f3020e1f6eb98f10f3470.tar.xz |
Remove FX_BOOL from xfa.
Review-Url: https://codereview.chromium.org/2467203003
Diffstat (limited to 'xfa/fxfa/app')
39 files changed, 1223 insertions, 1255 deletions
diff --git a/xfa/fxfa/app/cxfa_eventparam.cpp b/xfa/fxfa/app/cxfa_eventparam.cpp index 551f7f87d7..bcce7219bc 100644 --- a/xfa/fxfa/app/cxfa_eventparam.cpp +++ b/xfa/fxfa/app/cxfa_eventparam.cpp @@ -11,15 +11,15 @@ CXFA_EventParam::CXFA_EventParam() : m_pTarget(nullptr), m_eType(XFA_EVENT_Unknown), - m_bCancelAction(FALSE), + m_bCancelAction(false), m_iCommitKey(0), - m_bKeyDown(FALSE), - m_bModifier(FALSE), - m_bReenter(FALSE), + m_bKeyDown(false), + m_bModifier(false), + m_bReenter(false), m_iSelEnd(0), m_iSelStart(0), - m_bShift(FALSE), - m_bIsFormReady(FALSE), + m_bShift(false), + m_bIsFormReady(false), m_iValidateActivities(XFA_VALIDATE_preSubmit) {} CXFA_EventParam::~CXFA_EventParam() {} @@ -28,21 +28,21 @@ CXFA_EventParam::CXFA_EventParam(const CXFA_EventParam& other) = default; void CXFA_EventParam::Reset() { m_wsChange.clear(); - m_bCancelAction = FALSE; + m_bCancelAction = false; m_iCommitKey = 0; m_wsFullText.clear(); - m_bKeyDown = FALSE; - m_bModifier = FALSE; + m_bKeyDown = false; + m_bModifier = false; m_wsNewContentType.clear(); m_wsNewText.clear(); m_wsPrevContentType.clear(); m_wsPrevText.clear(); - m_bReenter = FALSE; + m_bReenter = false; m_iSelEnd = 0; m_iSelStart = 0; - m_bShift = FALSE; + m_bShift = false; m_wsSoapFaultCode.clear(); m_wsSoapFaultString.clear(); - m_bIsFormReady = FALSE; + m_bIsFormReady = false; m_iValidateActivities = XFA_VALIDATE_preSubmit; } diff --git a/xfa/fxfa/app/xfa_checksum.cpp b/xfa/fxfa/app/xfa_checksum.cpp index 351ae73a03..01035f8ea4 100644 --- a/xfa/fxfa/app/xfa_checksum.cpp +++ b/xfa/fxfa/app/xfa_checksum.cpp @@ -100,7 +100,7 @@ CXFA_SAXContext* CXFA_SAXReaderHandler::OnTagEnter( const CFX_ByteStringC& bsTagName, CFX_SAXItem::Type eType, uint32_t dwStartPos) { - UpdateChecksum(TRUE); + UpdateChecksum(true); if (eType != CFX_SAXItem::Type::Tag && eType != CFX_SAXItem::Type::Instruction) { return nullptr; @@ -130,7 +130,7 @@ void CXFA_SAXReaderHandler::OnTagBreak(CXFA_SAXContext* pTag) { return; pTag->m_TextBuf << ">"; - UpdateChecksum(FALSE); + UpdateChecksum(false); } void CXFA_SAXReaderHandler::OnTagData(CXFA_SAXContext* pTag, @@ -160,7 +160,7 @@ void CXFA_SAXReaderHandler::OnTagClose(CXFA_SAXContext* pTag, else if (pTag->m_eNode == CFX_SAXItem::Type::Tag) textBuf << "></" << pTag->m_bsTagName.AsStringC() << ">"; - UpdateChecksum(FALSE); + UpdateChecksum(false); } void CXFA_SAXReaderHandler::OnTagEnd(CXFA_SAXContext* pTag, @@ -170,7 +170,7 @@ void CXFA_SAXReaderHandler::OnTagEnd(CXFA_SAXContext* pTag, return; pTag->m_TextBuf << "</" << bsTagName << ">"; - UpdateChecksum(FALSE); + UpdateChecksum(false); } void CXFA_SAXReaderHandler::OnTargetData(CXFA_SAXContext* pTag, @@ -182,21 +182,21 @@ void CXFA_SAXReaderHandler::OnTargetData(CXFA_SAXContext* pTag, if (eType == CFX_SAXItem::Type::Comment) { m_SAXContext.m_TextBuf << "<!--" << bsData << "-->"; - UpdateChecksum(FALSE); + UpdateChecksum(false); } else { pTag->m_TextBuf << " " << bsData; } } -void CXFA_SAXReaderHandler::UpdateChecksum(FX_BOOL bCheckSpace) { +void CXFA_SAXReaderHandler::UpdateChecksum(bool bCheckSpace) { int32_t iLength = m_SAXContext.m_TextBuf.GetLength(); if (iLength < 1) { return; } uint8_t* pBuffer = m_SAXContext.m_TextBuf.GetBuffer(); - FX_BOOL bUpdata = TRUE; + bool bUpdata = true; if (bCheckSpace) { - bUpdata = FALSE; + bUpdata = false; for (int32_t i = 0; i < iLength; i++) { bUpdata = (pBuffer[i] > 0x20); if (bUpdata) { @@ -225,11 +225,11 @@ void CXFA_ChecksumContext::StartChecksum() { m_pSAXReader = new CFX_SAXReader; } -FX_BOOL CXFA_ChecksumContext::UpdateChecksum(IFX_SeekableReadStream* pSrcFile, - FX_FILESIZE offset, - size_t size) { +bool CXFA_ChecksumContext::UpdateChecksum(IFX_SeekableReadStream* pSrcFile, + FX_FILESIZE offset, + size_t size) { if (!m_pSAXReader || !pSrcFile) - return FALSE; + return false; if (size < 1) size = pSrcFile->GetSize(); @@ -240,7 +240,7 @@ FX_BOOL CXFA_ChecksumContext::UpdateChecksum(IFX_SeekableReadStream* pSrcFile, CFX_SaxParseMode_NotSkipSpace | CFX_SaxParseMode_NotConvert_amp | CFX_SaxParseMode_NotConvert_lt | CFX_SaxParseMode_NotConvert_gt | CFX_SaxParseMode_NotConvert_sharp) < 0) { - return FALSE; + return false; } return m_pSAXReader->ContinueParse(nullptr) > 99; } diff --git a/xfa/fxfa/app/xfa_ffapp.cpp b/xfa/fxfa/app/xfa_ffapp.cpp index db97c6371a..c5dcad848c 100644 --- a/xfa/fxfa/app/xfa_ffapp.cpp +++ b/xfa/fxfa/app/xfa_ffapp.cpp @@ -89,9 +89,9 @@ CXFA_FFDocHandler* CXFA_FFApp::GetDocHandler() { CXFA_FFDoc* CXFA_FFApp::CreateDoc(IXFA_DocEnvironment* pDocEnvironment, IFX_SeekableReadStream* pStream, - FX_BOOL bTakeOverFile) { + bool bTakeOverFile) { std::unique_ptr<CXFA_FFDoc> pDoc(new CXFA_FFDoc(this, pDocEnvironment)); - FX_BOOL bSuccess = pDoc->OpenDoc(pStream, bTakeOverFile); + bool bSuccess = pDoc->OpenDoc(pStream, bTakeOverFile); return bSuccess ? pDoc.release() : nullptr; } @@ -101,7 +101,7 @@ CXFA_FFDoc* CXFA_FFApp::CreateDoc(IXFA_DocEnvironment* pDocEnvironment, return nullptr; std::unique_ptr<CXFA_FFDoc> pDoc(new CXFA_FFDoc(this, pDocEnvironment)); - FX_BOOL bSuccess = pDoc->OpenDoc(pPDFDoc); + bool bSuccess = pDoc->OpenDoc(pPDFDoc); return bSuccess ? pDoc.release() : nullptr; } @@ -149,5 +149,5 @@ IFWL_AdapterTimerMgr* CXFA_FFApp::GetTimerMgr() const { } void CXFA_FFApp::ClearEventTargets() { - m_pFWLApp->GetNoteDriver()->ClearEventTargets(FALSE); + m_pFWLApp->GetNoteDriver()->ClearEventTargets(false); } diff --git a/xfa/fxfa/app/xfa_ffbarcode.cpp b/xfa/fxfa/app/xfa_ffbarcode.cpp index 181b3be80c..a971e959ca 100644 --- a/xfa/fxfa/app/xfa_ffbarcode.cpp +++ b/xfa/fxfa/app/xfa_ffbarcode.cpp @@ -122,7 +122,7 @@ CXFA_FFBarcode::CXFA_FFBarcode(CXFA_FFPageView* pPageView, CXFA_FFBarcode::~CXFA_FFBarcode() {} -FX_BOOL CXFA_FFBarcode::LoadWidget() { +bool CXFA_FFBarcode::LoadWidget() { CFWL_Barcode* pFWLBarcode = new CFWL_Barcode(GetFWLApp()); pFWLBarcode->Initialize(); @@ -179,7 +179,7 @@ void CXFA_FFBarcode::UpdateWidgetProperty() { CXFA_WidgetAcc* pAcc = GetDataAcc(); int32_t intVal; FX_CHAR charVal; - FX_BOOL boolVal; + bool boolVal; FX_FLOAT floatVal; if (pAcc->GetBarcodeAttribute_CharEncoding(intVal)) { pBarCodeWidget->SetCharEncoding((BC_CHAR_ENCODING)intVal); @@ -221,28 +221,24 @@ void CXFA_FFBarcode::UpdateWidgetProperty() { pBarcodeTypeInfo->eName == XFA_BARCODETYPE_ean8 || pBarcodeTypeInfo->eName == XFA_BARCODETYPE_ean13 || pBarcodeTypeInfo->eName == XFA_BARCODETYPE_upcA) { - pBarCodeWidget->SetPrintChecksum(TRUE); + pBarCodeWidget->SetPrintChecksum(true); } } -FX_BOOL CXFA_FFBarcode::OnLButtonDown(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFBarcode::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget; if (!pBarCodeWidget || pBarCodeWidget->IsProtectedType()) { - return FALSE; + return false; } if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { - return FALSE; + return false; } return CXFA_FFTextEdit::OnLButtonDown(dwFlags, fx, fy); } -FX_BOOL CXFA_FFBarcode::OnRButtonDown(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFBarcode::OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget; if (!pBarCodeWidget || pBarCodeWidget->IsProtectedType()) { - return FALSE; + return false; } return CXFA_FFTextEdit::OnRButtonDown(dwFlags, fx, fy); } diff --git a/xfa/fxfa/app/xfa_ffbarcode.h b/xfa/fxfa/app/xfa_ffbarcode.h index 5d0484a4bd..d2b5df3517 100644 --- a/xfa/fxfa/app/xfa_ffbarcode.h +++ b/xfa/fxfa/app/xfa_ffbarcode.h @@ -17,13 +17,13 @@ class CXFA_FFBarcode : public CXFA_FFTextEdit { ~CXFA_FFBarcode() override; // CXFA_FFTextEdit - FX_BOOL LoadWidget() override; + bool LoadWidget() override; void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; void UpdateWidgetProperty() override; - FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; }; enum XFA_BARCODETYPEENUM { diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp index 9365ccf0a4..391d76ca49 100644 --- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp +++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp @@ -26,7 +26,7 @@ CXFA_FFCheckButton::CXFA_FFCheckButton(CXFA_FFPageView* pPageView, CXFA_FFCheckButton::~CXFA_FFCheckButton() {} -FX_BOOL CXFA_FFCheckButton::LoadWidget() { +bool CXFA_FFCheckButton::LoadWidget() { CFWL_CheckBox* pCheckBox = new CFWL_CheckBox(GetFWLApp()); pCheckBox->Initialize(); m_pNormalWidget = pCheckBox; @@ -88,7 +88,7 @@ void CXFA_FFCheckButton::UpdateWidgetProperty() { pCheckBox->ModifyStylesEx( dwStyleEx, FWL_STYLEEXT_CKB_SignShapeMask | FWL_STYLEEXT_CKB_3State); } -FX_BOOL CXFA_FFCheckButton::PerformLayout() { +bool CXFA_FFCheckButton::PerformLayout() { CXFA_FFWidget::PerformLayout(); FX_FLOAT fCheckSize = m_pDataAcc->GetCheckButtonSize(); CXFA_Margin mgWidget = m_pDataAcc->GetMargin(); @@ -180,7 +180,7 @@ FX_BOOL CXFA_FFCheckButton::PerformLayout() { if (m_pNormalWidget) { m_pNormalWidget->Update(); } - return TRUE; + return true; } void CXFA_FFCheckButton::CapLeftRightPlacement(CXFA_Margin mgCap) { XFA_RectWidthoutMargin(m_rtCaption, mgCap); @@ -241,13 +241,13 @@ void CXFA_FFCheckButton::RenderWidget(CFX_Graphics* pGS, GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), pGS, &mt); } -FX_BOOL CXFA_FFCheckButton::OnLButtonUp(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFCheckButton::OnLButtonUp(uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { if (!m_pNormalWidget || !IsButtonDown()) - return FALSE; + return false; - SetButtonDown(FALSE); + SetButtonDown(false); CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::LeftButtonUp; ms.m_dwFlags = dwFlags; @@ -256,7 +256,7 @@ FX_BOOL CXFA_FFCheckButton::OnLButtonUp(uint32_t dwFlags, FWLToClient(ms.m_fx, ms.m_fy); ms.m_pDstTarget = m_pNormalWidget->GetWidget(); TranslateFWLMessage(&ms); - return TRUE; + return true; } XFA_CHECKSTATE CXFA_FFCheckButton::FWLState2XFAState() { @@ -268,32 +268,32 @@ XFA_CHECKSTATE CXFA_FFCheckButton::FWLState2XFAState() { return XFA_CHECKSTATE_Off; } -FX_BOOL CXFA_FFCheckButton::CommitData() { +bool CXFA_FFCheckButton::CommitData() { XFA_CHECKSTATE eCheckState = FWLState2XFAState(); m_pDataAcc->SetCheckState(eCheckState, true); - return TRUE; + return true; } -FX_BOOL CXFA_FFCheckButton::IsDataChanged() { +bool CXFA_FFCheckButton::IsDataChanged() { XFA_CHECKSTATE eCheckState = FWLState2XFAState(); return m_pDataAcc->GetCheckState() != eCheckState; } void CXFA_FFCheckButton::SetFWLCheckState(XFA_CHECKSTATE eCheckState) { if (eCheckState == XFA_CHECKSTATE_Neutral) { - m_pNormalWidget->SetStates(FWL_STATE_CKB_Neutral, TRUE); + m_pNormalWidget->SetStates(FWL_STATE_CKB_Neutral, true); } else { m_pNormalWidget->SetStates(FWL_STATE_CKB_Checked, eCheckState == XFA_CHECKSTATE_On); } } -FX_BOOL CXFA_FFCheckButton::UpdateFWLData() { +bool CXFA_FFCheckButton::UpdateFWLData() { if (!m_pNormalWidget) { - return FALSE; + return false; } XFA_CHECKSTATE eState = m_pDataAcc->GetCheckState(); SetFWLCheckState(eState); m_pNormalWidget->Update(); - return TRUE; + return true; } void CXFA_FFCheckButton::OnProcessMessage(CFWL_Message* pMessage) { diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.h b/xfa/fxfa/app/xfa_ffcheckbutton.h index 0c2cb755ac..dcd68935af 100644 --- a/xfa/fxfa/app/xfa_ffcheckbutton.h +++ b/xfa/fxfa/app/xfa_ffcheckbutton.h @@ -20,11 +20,11 @@ class CXFA_FFCheckButton : public CXFA_FFField { CFX_Matrix* pMatrix, uint32_t dwStatus) override; - FX_BOOL LoadWidget() override; - FX_BOOL PerformLayout() override; - FX_BOOL UpdateFWLData() override; + bool LoadWidget() override; + bool PerformLayout() override; + bool UpdateFWLData() override; void UpdateWidgetProperty() override; - FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, @@ -33,8 +33,8 @@ class CXFA_FFCheckButton : public CXFA_FFField { void SetFWLCheckState(XFA_CHECKSTATE eCheckState); protected: - FX_BOOL CommitData() override; - FX_BOOL IsDataChanged() override; + bool CommitData() override; + bool IsDataChanged() override; void CapLeftRightPlacement(CXFA_Margin mgCap); void AddUIMargin(int32_t iCapPlacement); diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp index 1575889815..7a20730410 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.cpp +++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp @@ -31,7 +31,7 @@ CXFA_FFListBox::~CXFA_FFListBox() { } } -FX_BOOL CXFA_FFListBox::LoadWidget() { +bool CXFA_FFListBox::LoadWidget() { CFWL_ListBox* pListBox = new CFWL_ListBox(GetFWLApp()); pListBox->Initialize(); pListBox->ModifyStyles(FWL_WGTSTYLE_VScroll | FWL_WGTSTYLE_NoBackground, @@ -48,7 +48,7 @@ FX_BOOL CXFA_FFListBox::LoadWidget() { m_pNormalWidget->LockUpdate(); CFX_WideStringArray wsLabelArray; - m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE); + m_pDataAcc->GetChoiceListItems(wsLabelArray, false); int32_t iItems = wsLabelArray.GetSize(); for (int32_t i = 0; i < iItems; i++) { pListBox->AddString(wsLabelArray[i].AsStringC()); @@ -64,44 +64,44 @@ FX_BOOL CXFA_FFListBox::LoadWidget() { int32_t iSelCount = iSelArray.GetSize(); for (int32_t j = 0; j < iSelCount; j++) { IFWL_ListItem* item = pListBox->GetItem(iSelArray[j]); - pListBox->SetSelItem(item, TRUE); + pListBox->SetSelItem(item, true); } m_pNormalWidget->UnlockUpdate(); return CXFA_FFField::LoadWidget(); } -FX_BOOL CXFA_FFListBox::OnKillFocus(CXFA_FFWidget* pNewFocus) { +bool CXFA_FFListBox::OnKillFocus(CXFA_FFWidget* pNewFocus) { if (!ProcessCommittedData()) UpdateFWLData(); CXFA_FFField::OnKillFocus(pNewFocus); - return TRUE; + return true; } -FX_BOOL CXFA_FFListBox::CommitData() { +bool CXFA_FFListBox::CommitData() { CFWL_ListBox* pListBox = static_cast<CFWL_ListBox*>(m_pNormalWidget); int32_t iSels = pListBox->CountSelItems(); CFX_Int32Array iSelArray; for (int32_t i = 0; i < iSels; ++i) iSelArray.Add(pListBox->GetSelIndex(i)); - m_pDataAcc->SetSelectedItems(iSelArray, true, FALSE, TRUE); - return TRUE; + m_pDataAcc->SetSelectedItems(iSelArray, true, false, true); + return true; } -FX_BOOL CXFA_FFListBox::IsDataChanged() { +bool CXFA_FFListBox::IsDataChanged() { CFX_Int32Array iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); int32_t iOldSels = iSelArray.GetSize(); CFWL_ListBox* pListBox = (CFWL_ListBox*)m_pNormalWidget; int32_t iSels = pListBox->CountSelItems(); if (iOldSels != iSels) - return TRUE; + return true; for (int32_t i = 0; i < iSels; ++i) { IFWL_ListItem* hlistItem = pListBox->GetItem(iSelArray[i]); if (!(pListBox->GetItemStates(hlistItem) & FWL_ITEMSTATE_LTB_Selected)) - return TRUE; + return true; } - return FALSE; + return false; } uint32_t CXFA_FFListBox::GetAlignment() { @@ -128,9 +128,9 @@ uint32_t CXFA_FFListBox::GetAlignment() { } return dwExtendedStyle; } -FX_BOOL CXFA_FFListBox::UpdateFWLData() { +bool CXFA_FFListBox::UpdateFWLData() { if (!m_pNormalWidget) { - return FALSE; + return false; } CFWL_ListBox* pListBox = ((CFWL_ListBox*)m_pNormalWidget); CFX_ArrayTemplate<IFWL_ListItem*> selItemArray; @@ -141,12 +141,12 @@ FX_BOOL CXFA_FFListBox::UpdateFWLData() { IFWL_ListItem* lpItemSel = pListBox->GetSelItem(iSelArray[j]); selItemArray.Add(lpItemSel); } - pListBox->SetSelItem(pListBox->GetSelItem(-1), FALSE); + pListBox->SetSelItem(pListBox->GetSelItem(-1), false); for (int32_t i = 0; i < iSelCount; i++) { - ((CFWL_ListBox*)m_pNormalWidget)->SetSelItem(selItemArray[i], TRUE); + ((CFWL_ListBox*)m_pNormalWidget)->SetSelItem(selItemArray[i], true); } m_pNormalWidget->Update(); - return TRUE; + return true; } void CXFA_FFListBox::OnSelectChanged(IFWL_Widget* pWidget, const CFX_Int32Array& arrSels) { @@ -161,7 +161,7 @@ void CXFA_FFListBox::OnSelectChanged(IFWL_Widget* pWidget, } m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam); } -void CXFA_FFListBox::SetItemState(int32_t nIndex, FX_BOOL bSelected) { +void CXFA_FFListBox::SetItemState(int32_t nIndex, bool bSelected) { IFWL_ListItem* item = ((CFWL_ListBox*)m_pNormalWidget)->GetSelItem(nIndex); ((CFWL_ListBox*)m_pNormalWidget)->SetSelItem(item, bSelected); m_pNormalWidget->Update(); @@ -213,26 +213,26 @@ CXFA_FFComboBox::CXFA_FFComboBox(CXFA_FFPageView* pPageView, CXFA_FFComboBox::~CXFA_FFComboBox() {} -FX_BOOL CXFA_FFComboBox::GetBBox(CFX_RectF& rtBox, - uint32_t dwStatus, - FX_BOOL bDrawFocus) { +bool CXFA_FFComboBox::GetBBox(CFX_RectF& rtBox, + uint32_t dwStatus, + bool bDrawFocus) { if (bDrawFocus) - return FALSE; + return false; return CXFA_FFWidget::GetBBox(rtBox, dwStatus); } -FX_BOOL CXFA_FFComboBox::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { +bool CXFA_FFComboBox::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { - return FALSE; + return false; } CFX_RectF rtWidget; ((CFWL_ComboBox*)m_pNormalWidget)->GetBBox(rtWidget); if (rtWidget.Contains(fx, fy)) { - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_FFComboBox::LoadWidget() { +bool CXFA_FFComboBox::LoadWidget() { CFWL_ComboBox* pComboBox = new CFWL_ComboBox(GetFWLApp()); pComboBox->Initialize(); m_pNormalWidget = (CFWL_Widget*)pComboBox; @@ -247,7 +247,7 @@ FX_BOOL CXFA_FFComboBox::LoadWidget() { m_pNormalWidget->LockUpdate(); CFX_WideStringArray wsLabelArray; - m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE); + m_pDataAcc->GetChoiceListItems(wsLabelArray, false); int32_t iItems = wsLabelArray.GetSize(); for (int32_t i = 0; i < iItems; i++) { pComboBox->AddString(wsLabelArray[i].AsStringC()); @@ -291,30 +291,28 @@ void CXFA_FFComboBox::UpdateWidgetProperty() { } pComboBox->EditModifyStylesEx(dwEditStyles, 0xFFFFFFFF); } -FX_BOOL CXFA_FFComboBox::OnRButtonUp(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFComboBox::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!CXFA_FFField::OnRButtonUp(dwFlags, fx, fy)) - return FALSE; + return false; GetDoc()->GetDocEnvironment()->PopupMenu(this, CFX_PointF(fx, fy)); - return TRUE; + return true; } -FX_BOOL CXFA_FFComboBox::OnKillFocus(CXFA_FFWidget* pNewWidget) { - FX_BOOL flag = ProcessCommittedData(); +bool CXFA_FFComboBox::OnKillFocus(CXFA_FFWidget* pNewWidget) { + bool flag = ProcessCommittedData(); if (!flag) { UpdateFWLData(); } CXFA_FFField::OnKillFocus(pNewWidget); - return TRUE; + return true; } void CXFA_FFComboBox::OpenDropDownList() { - ((CFWL_ComboBox*)m_pNormalWidget)->OpenDropDownList(TRUE); + ((CFWL_ComboBox*)m_pNormalWidget)->OpenDropDownList(true); } -FX_BOOL CXFA_FFComboBox::CommitData() { +bool CXFA_FFComboBox::CommitData() { return m_pDataAcc->SetValue(m_wsNewValue, XFA_VALUEPICTURE_Raw); } -FX_BOOL CXFA_FFComboBox::IsDataChanged() { +bool CXFA_FFComboBox::IsDataChanged() { CFWL_ComboBox* pFWLcombobox = ((CFWL_ComboBox*)m_pNormalWidget); CFX_WideString wsText; pFWLcombobox->GetEditText(wsText); @@ -323,16 +321,16 @@ FX_BOOL CXFA_FFComboBox::IsDataChanged() { CFX_WideString wsSel; pFWLcombobox->GetTextByIndex(iCursel, wsSel); if (wsSel == wsText) { - m_pDataAcc->GetChoiceListItem(wsText, iCursel, TRUE); + m_pDataAcc->GetChoiceListItem(wsText, iCursel, true); } } CFX_WideString wsOldValue; m_pDataAcc->GetValue(wsOldValue, XFA_VALUEPICTURE_Raw); if (wsOldValue != wsText) { m_wsNewValue = wsText; - return TRUE; + return true; } - return FALSE; + return false; } void CXFA_FFComboBox::FWLEventSelChange(CXFA_EventParam* pParam) { pParam->m_eType = XFA_EVENT_Change; @@ -379,9 +377,9 @@ uint32_t CXFA_FFComboBox::GetAlignment() { } return dwExtendedStyle; } -FX_BOOL CXFA_FFComboBox::UpdateFWLData() { +bool CXFA_FFComboBox::UpdateFWLData() { if (!m_pNormalWidget) { - return FALSE; + return false; } CFX_Int32Array iSelArray; m_pDataAcc->GetSelectedItems(iSelArray); @@ -395,62 +393,62 @@ FX_BOOL CXFA_FFComboBox::UpdateFWLData() { ((CFWL_ComboBox*)m_pNormalWidget)->SetEditText(wsText); } m_pNormalWidget->Update(); - return TRUE; + return true; } -FX_BOOL CXFA_FFComboBox::CanUndo() { +bool CXFA_FFComboBox::CanUndo() { return m_pDataAcc->IsChoiceListAllowTextEntry() && ((CFWL_ComboBox*)m_pNormalWidget)->EditCanUndo(); } -FX_BOOL CXFA_FFComboBox::CanRedo() { +bool CXFA_FFComboBox::CanRedo() { return m_pDataAcc->IsChoiceListAllowTextEntry() && ((CFWL_ComboBox*)m_pNormalWidget)->EditCanRedo(); } -FX_BOOL CXFA_FFComboBox::Undo() { +bool CXFA_FFComboBox::Undo() { return m_pDataAcc->IsChoiceListAllowTextEntry() && ((CFWL_ComboBox*)m_pNormalWidget)->EditUndo(); } -FX_BOOL CXFA_FFComboBox::Redo() { +bool CXFA_FFComboBox::Redo() { return m_pDataAcc->IsChoiceListAllowTextEntry() && ((CFWL_ComboBox*)m_pNormalWidget)->EditRedo(); } -FX_BOOL CXFA_FFComboBox::CanCopy() { +bool CXFA_FFComboBox::CanCopy() { return ((CFWL_ComboBox*)m_pNormalWidget)->EditCanCopy(); } -FX_BOOL CXFA_FFComboBox::CanCut() { +bool CXFA_FFComboBox::CanCut() { if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { - return FALSE; + return false; } return m_pDataAcc->IsChoiceListAllowTextEntry() && ((CFWL_ComboBox*)m_pNormalWidget)->EditCanCut(); } -FX_BOOL CXFA_FFComboBox::CanPaste() { +bool CXFA_FFComboBox::CanPaste() { return m_pDataAcc->IsChoiceListAllowTextEntry() && (m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open); } -FX_BOOL CXFA_FFComboBox::CanSelectAll() { +bool CXFA_FFComboBox::CanSelectAll() { return ((CFWL_ComboBox*)m_pNormalWidget)->EditCanSelectAll(); } -FX_BOOL CXFA_FFComboBox::Copy(CFX_WideString& wsCopy) { +bool CXFA_FFComboBox::Copy(CFX_WideString& wsCopy) { return ((CFWL_ComboBox*)m_pNormalWidget)->EditCopy(wsCopy); } -FX_BOOL CXFA_FFComboBox::Cut(CFX_WideString& wsCut) { +bool CXFA_FFComboBox::Cut(CFX_WideString& wsCut) { return m_pDataAcc->IsChoiceListAllowTextEntry() && ((CFWL_ComboBox*)m_pNormalWidget)->EditCut(wsCut); } -FX_BOOL CXFA_FFComboBox::Paste(const CFX_WideString& wsPaste) { +bool CXFA_FFComboBox::Paste(const CFX_WideString& wsPaste) { return m_pDataAcc->IsChoiceListAllowTextEntry() && ((CFWL_ComboBox*)m_pNormalWidget)->EditPaste(wsPaste); } -FX_BOOL CXFA_FFComboBox::SelectAll() { +bool CXFA_FFComboBox::SelectAll() { return ((CFWL_ComboBox*)m_pNormalWidget)->EditSelectAll(); } -FX_BOOL CXFA_FFComboBox::Delete() { +bool CXFA_FFComboBox::Delete() { return ((CFWL_ComboBox*)m_pNormalWidget)->EditDelete(); } -FX_BOOL CXFA_FFComboBox::DeSelect() { +bool CXFA_FFComboBox::DeSelect() { return ((CFWL_ComboBox*)m_pNormalWidget)->EditDeSelect(); } -void CXFA_FFComboBox::SetItemState(int32_t nIndex, FX_BOOL bSelected) { +void CXFA_FFComboBox::SetItemState(int32_t nIndex, bool bSelected) { if (bSelected) { ((CFWL_ComboBox*)m_pNormalWidget)->SetCurSel(nIndex); } else { @@ -483,7 +481,7 @@ void CXFA_FFComboBox::OnTextChanged(IFWL_Widget* pWidget, } void CXFA_FFComboBox::OnSelectChanged(IFWL_Widget* pWidget, const CFX_Int32Array& arrSels, - FX_BOOL bLButtonUp) { + bool bLButtonUp) { CXFA_EventParam eParam; m_pDataAcc->GetValue(eParam.m_wsPrevText, XFA_VALUEPICTURE_Raw); FWLEventSelChange(&eParam); diff --git a/xfa/fxfa/app/xfa_ffchoicelist.h b/xfa/fxfa/app/xfa_ffchoicelist.h index 712959d56c..9ce6cccd11 100644 --- a/xfa/fxfa/app/xfa_ffchoicelist.h +++ b/xfa/fxfa/app/xfa_ffchoicelist.h @@ -16,22 +16,22 @@ class CXFA_FFListBox : public CXFA_FFField { ~CXFA_FFListBox() override; // CXFA_FFField - FX_BOOL LoadWidget() override; - FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override; + bool LoadWidget() override; + bool OnKillFocus(CXFA_FFWidget* pNewWidget) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; void OnSelectChanged(IFWL_Widget* pWidget, const CFX_Int32Array& arrSels); - void SetItemState(int32_t nIndex, FX_BOOL bSelected); + void SetItemState(int32_t nIndex, bool bSelected); void InsertItem(const CFX_WideStringC& wsLabel, int32_t nIndex = -1); void DeleteItem(int32_t nIndex); protected: - FX_BOOL CommitData() override; - FX_BOOL UpdateFWLData() override; - FX_BOOL IsDataChanged() override; + bool CommitData() override; + bool UpdateFWLData() override; + bool IsDataChanged() override; uint32_t GetAlignment(); @@ -44,28 +44,28 @@ class CXFA_FFComboBox : public CXFA_FFField { ~CXFA_FFComboBox() override; // CXFA_FFField - FX_BOOL GetBBox(CFX_RectF& rtBox, - uint32_t dwStatus, - FX_BOOL bDrawFocus = FALSE) override; - FX_BOOL LoadWidget() override; + bool GetBBox(CFX_RectF& rtBox, + uint32_t dwStatus, + bool bDrawFocus = false) override; + bool LoadWidget() override; void UpdateWidgetProperty() override; - FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override; - FX_BOOL CanUndo() override; - FX_BOOL CanRedo() override; - FX_BOOL Undo() override; - FX_BOOL Redo() override; - - FX_BOOL CanCopy() override; - FX_BOOL CanCut() override; - FX_BOOL CanPaste() override; - FX_BOOL CanSelectAll() override; - FX_BOOL Copy(CFX_WideString& wsCopy) override; - FX_BOOL Cut(CFX_WideString& wsCut) override; - FX_BOOL Paste(const CFX_WideString& wsPaste) override; - FX_BOOL SelectAll() override; - FX_BOOL Delete() override; - FX_BOOL DeSelect() override; + bool OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnKillFocus(CXFA_FFWidget* pNewWidget) override; + bool CanUndo() override; + bool CanRedo() override; + bool Undo() override; + bool Redo() override; + + bool CanCopy() override; + bool CanCut() override; + bool CanPaste() override; + bool CanSelectAll() override; + bool Copy(CFX_WideString& wsCopy) override; + bool Cut(CFX_WideString& wsCut) override; + bool Paste(const CFX_WideString& wsPaste) override; + bool SelectAll() override; + bool Delete() override; + bool DeSelect() override; // IFWL_WidgetDelegate void OnProcessMessage(CFWL_Message* pMessage) override; @@ -78,19 +78,19 @@ class CXFA_FFComboBox : public CXFA_FFField { void OnTextChanged(IFWL_Widget* pWidget, const CFX_WideString& wsChanged); void OnSelectChanged(IFWL_Widget* pWidget, const CFX_Int32Array& arrSels, - FX_BOOL bLButtonUp); + bool bLButtonUp); void OnPreOpen(IFWL_Widget* pWidget); void OnPostOpen(IFWL_Widget* pWidget); - void SetItemState(int32_t nIndex, FX_BOOL bSelected); + void SetItemState(int32_t nIndex, bool bSelected); void InsertItem(const CFX_WideStringC& wsLabel, int32_t nIndex = -1); void DeleteItem(int32_t nIndex); protected: // CXFA_FFField - FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL CommitData() override; - FX_BOOL UpdateFWLData() override; - FX_BOOL IsDataChanged() override; + bool PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override; + bool CommitData() override; + bool UpdateFWLData() override; + bool IsDataChanged() override; uint32_t GetAlignment(); void FWLEventSelChange(CXFA_EventParam* pParam); diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp index cfb5e9fc47..5439b1fe47 100644 --- a/xfa/fxfa/app/xfa_ffdoc.cpp +++ b/xfa/fxfa/app/xfa_ffdoc.cpp @@ -155,7 +155,7 @@ CXFA_FFDoc::CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocEnvironment* pDocEnvironment) m_pNotify(nullptr), m_pPDFDoc(nullptr), m_dwDocType(XFA_DOCTYPE_Static), - m_bOwnStream(TRUE) {} + m_bOwnStream(true) {} CXFA_FFDoc::~CXFA_FFDoc() { CloseDoc(); @@ -172,9 +172,9 @@ int32_t CXFA_FFDoc::StartLoad() { return iStatus; } -FX_BOOL XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement, - uint8_t*& pByteBuffer, - int32_t& iBufferSize) { +bool XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement, + uint8_t*& pByteBuffer, + int32_t& iBufferSize) { CFDE_XMLElement* pDocumentElement = nullptr; for (CFDE_XMLNode* pXMLNode = pPDFElement->GetNodeItem(CFDE_XMLNode::FirstChild); @@ -190,7 +190,7 @@ FX_BOOL XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement, } } if (!pDocumentElement) { - return FALSE; + return false; } CFDE_XMLElement* pChunkElement = nullptr; for (CFDE_XMLNode* pXMLNode = @@ -207,7 +207,7 @@ FX_BOOL XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement, } } if (!pChunkElement) { - return FALSE; + return false; } CFX_WideString wsPDFContent; pChunkElement->GetTextData(wsPDFContent); @@ -216,7 +216,7 @@ FX_BOOL XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement, pByteBuffer = FX_Alloc(uint8_t, iBufferSize + 1); pByteBuffer[iBufferSize] = '0'; // FIXME: I bet this is wrong. Base64DecodeW(wsPDFContent.c_str(), wsPDFContent.GetLength(), pByteBuffer); - return TRUE; + return true; } void XFA_XPDPacket_MergeRootNode(CXFA_Node* pOriginRoot, CXFA_Node* pNewRoot) { CXFA_Node* pChildNode = pNewRoot->GetNodeItem(XFA_NODEITEM_FirstChild); @@ -290,27 +290,26 @@ CXFA_FFDocView* CXFA_FFDoc::GetDocView() { return it != m_TypeToDocViewMap.end() ? it->second.get() : nullptr; } -FX_BOOL CXFA_FFDoc::OpenDoc(IFX_SeekableReadStream* pStream, - FX_BOOL bTakeOverFile) { +bool CXFA_FFDoc::OpenDoc(IFX_SeekableReadStream* pStream, bool bTakeOverFile) { m_bOwnStream = bTakeOverFile; m_pStream = pStream; - return TRUE; + return true; } -FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) { +bool CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) { if (!pPDFDoc) - return FALSE; + return false; CPDF_Dictionary* pRoot = pPDFDoc->GetRoot(); if (!pRoot) - return FALSE; + return false; CPDF_Dictionary* pAcroForm = pRoot->GetDictFor("AcroForm"); if (!pAcroForm) - return FALSE; + return false; CPDF_Object* pElementXFA = pAcroForm->GetDirectObjectFor("XFA"); if (!pElementXFA) - return FALSE; + return false; std::vector<CPDF_Stream*> xfaStreams; if (pElementXFA->IsArray()) { @@ -323,7 +322,7 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) { xfaStreams.push_back((CPDF_Stream*)pElementXFA); } if (xfaStreams.empty()) - return FALSE; + return false; IFX_SeekableReadStream* pFileRead = new CXFA_FileRead(xfaStreams); m_pPDFDoc = pPDFDoc; @@ -332,11 +331,11 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) { m_pStream = nullptr; } m_pStream = pFileRead; - m_bOwnStream = TRUE; - return TRUE; + m_bOwnStream = true; + return true; } -FX_BOOL CXFA_FFDoc::CloseDoc() { +bool CXFA_FFDoc::CloseDoc() { for (const auto& pair : m_TypeToDocViewMap) pair.second->RunDocClose(); @@ -360,7 +359,7 @@ FX_BOOL CXFA_FFDoc::CloseDoc() { m_HashToDibDpiMap.clear(); m_pApp->ClearEventTargets(); - return TRUE; + return true; } void CXFA_FFDoc::SetDocType(uint32_t dwType) { m_dwDocType = dwType; @@ -445,7 +444,7 @@ bool CXFA_FFDoc::SavePackage(XFA_HashCode code, pFile, pNode, 0, bsChecksum.GetLength() ? bsChecksum.c_str() : nullptr); } -FX_BOOL CXFA_FFDoc::ImportData(IFX_SeekableReadStream* pStream, FX_BOOL bXDP) { +bool CXFA_FFDoc::ImportData(IFX_SeekableReadStream* pStream, bool bXDP) { std::unique_ptr<CXFA_DataImporter> importer( new CXFA_DataImporter(m_pDocumentParser->GetDocument())); return importer->ImportData(pStream); diff --git a/xfa/fxfa/app/xfa_ffdochandler.cpp b/xfa/fxfa/app/xfa_ffdochandler.cpp index fae72cb3a1..db73531ccc 100644 --- a/xfa/fxfa/app/xfa_ffdochandler.cpp +++ b/xfa/fxfa/app/xfa_ffdochandler.cpp @@ -41,18 +41,18 @@ XFA_ATTRIBUTEENUM CXFA_FFDocHandler::GetRestoreState(CXFA_FFDoc* hDoc) { return pSubForm->GetEnum(XFA_ATTRIBUTE_RestoreState); } -FX_BOOL CXFA_FFDocHandler::RunDocScript(CXFA_FFDoc* hDoc, - XFA_SCRIPTTYPE eScriptType, - const CFX_WideStringC& wsScript, - CFXJSE_Value* pRetValue, - CFXJSE_Value* pThisValue) { +bool CXFA_FFDocHandler::RunDocScript(CXFA_FFDoc* hDoc, + XFA_SCRIPTTYPE eScriptType, + const CFX_WideStringC& wsScript, + CFXJSE_Value* pRetValue, + CFXJSE_Value* pThisValue) { CXFA_Document* pXFADoc = hDoc->GetXFADoc(); if (!pXFADoc) - return FALSE; + return false; CXFA_ScriptContext* pScriptContext = pXFADoc->GetScriptContext(); if (!pScriptContext) - return FALSE; + return false; return pScriptContext->RunScript( (XFA_SCRIPTLANGTYPE)eScriptType, wsScript, pRetValue, diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp index f82cc5eafb..477bd54457 100644 --- a/xfa/fxfa/app/xfa_ffdocview.cpp +++ b/xfa/fxfa/app/xfa_ffdocview.cpp @@ -52,9 +52,9 @@ const XFA_ATTRIBUTEENUM gs_EventActivity[] = { }; CXFA_FFDocView::CXFA_FFDocView(CXFA_FFDoc* pDoc) - : m_bLayoutEvent(FALSE), + : m_bLayoutEvent(false), m_pListFocusWidget(nullptr), - m_bInLayoutStatus(FALSE), + m_bInLayoutStatus(false), m_pDoc(pDoc), m_pXFADocLayout(nullptr), m_pFocusAcc(nullptr), @@ -69,9 +69,9 @@ CXFA_FFDocView::~CXFA_FFDocView() { void CXFA_FFDocView::InitLayout(CXFA_Node* pNode) { RunBindItems(); - ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Initialize, FALSE, TRUE, + ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Initialize, false, true, nullptr); - ExecEventActivityByDeepFirst(pNode, XFA_EVENT_IndexChange, FALSE, TRUE, + ExecEventActivityByDeepFirst(pNode, XFA_EVENT_IndexChange, false, true, nullptr); } int32_t CXFA_FFDocView::StartLayout(int32_t iStartPage) { @@ -91,7 +91,7 @@ int32_t CXFA_FFDocView::StartLayout(int32_t iStartPage) { InitLayout(pRootItem); InitCalculate(pRootItem); InitValidate(pRootItem); - ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, TRUE, TRUE, nullptr); + ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, true, true, nullptr); m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_Start; return iStatus; } @@ -124,16 +124,16 @@ void CXFA_FFDocView::StopLayout() { InitLayout(pPageSetNode); InitCalculate(pPageSetNode); InitValidate(pPageSetNode); - ExecEventActivityByDeepFirst(pPageSetNode, XFA_EVENT_Ready, TRUE, TRUE, + ExecEventActivityByDeepFirst(pPageSetNode, XFA_EVENT_Ready, true, true, nullptr); - ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, FALSE, TRUE, + ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, false, true, nullptr); - ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_DocReady, FALSE, TRUE, + ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_DocReady, false, true, nullptr); RunCalculateWidgets(); RunValidate(); if (RunLayout()) { - ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, FALSE, TRUE, + ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, false, true, nullptr); } m_CalculateAccs.RemoveAll(); @@ -181,7 +181,7 @@ void CXFA_FFDocView::UpdateDocView() { CXFA_Node* pNode = m_NewAddedNodes[i]; InitCalculate(pNode); InitValidate(pNode); - ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Ready, TRUE, TRUE, nullptr); + ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Ready, true, true, nullptr); } m_NewAddedNodes.RemoveAll(); RunSubformIndexChange(); @@ -191,7 +191,7 @@ void CXFA_FFDocView::UpdateDocView() { if (RunLayout() && m_bLayoutEvent) { RunEventLayoutReady(); } - m_bLayoutEvent = FALSE; + m_bLayoutEvent = false; m_CalculateAccs.RemoveAll(); RunInvalidate(); UnlockUpdate(); @@ -212,11 +212,11 @@ CXFA_FFPageView* CXFA_FFDocView::GetPageView(int32_t nIndex) { CXFA_LayoutProcessor* CXFA_FFDocView::GetXFALayout() const { return m_pDoc->GetXFADoc()->GetDocLayout(); } -FX_BOOL CXFA_FFDocView::ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc) { +bool CXFA_FFDocView::ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc) { CXFA_Node* pNode = pWidgetAcc->GetNode(); XFA_Element eType = pNode->GetElementType(); if (eType != XFA_Element::Field && eType != XFA_Element::ExclGroup) { - return FALSE; + return false; } pWidgetAcc->ResetData(); pWidgetAcc->UpdateUIDisplay(); @@ -224,11 +224,11 @@ FX_BOOL CXFA_FFDocView::ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc) { AddValidateWidget(pWidgetAcc); validate.GetNode()->SetFlag(XFA_NodeFlag_NeedsInitApp, false); } - return TRUE; + return true; } void CXFA_FFDocView::ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc) { - m_bLayoutEvent = TRUE; - FX_BOOL bChanged = FALSE; + m_bLayoutEvent = true; + bool bChanged = false; CXFA_Node* pFormNode = nullptr; if (pWidgetAcc) { bChanged = ResetSingleWidgetAccData(pWidgetAcc); @@ -279,7 +279,7 @@ int32_t CXFA_FFDocView::ProcessWidgetEvent(CXFA_EventParam* pParam, wsValidateStr = pValidateNode->GetContent(); } } - FX_BOOL bValidate = FALSE; + bool bValidate = false; switch (pParam->m_iValidateActivities) { case XFA_VALIDATE_preSubmit: bValidate = wsValidateStr.Find(L"preSubmit") != -1; @@ -308,7 +308,7 @@ int32_t CXFA_FFDocView::ProcessWidgetEvent(CXFA_EventParam* pParam, pNode = pRootItem->GetChild(0, XFA_Element::Subform); } ExecEventActivityByDeepFirst(pNode, pParam->m_eType, pParam->m_bIsFormReady, - TRUE, nullptr); + true, nullptr); return XFA_EVENTERROR_Success; } CXFA_FFWidgetHandler* CXFA_FFDocView::GetWidgetHandler() { @@ -335,10 +335,10 @@ void CXFA_FFDocView::KillFocus() { m_pFocusWidget = nullptr; m_pOldFocusWidget = nullptr; } -FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) { +bool CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) { CXFA_FFWidget* pNewFocus = hWidget; if (m_pOldFocusWidget == pNewFocus) { - return FALSE; + return false; } CXFA_FFWidget* pOldFocus = m_pOldFocusWidget; m_pOldFocusWidget = pNewFocus; @@ -357,7 +357,7 @@ FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) { } } if (m_pFocusWidget == m_pOldFocusWidget) { - return FALSE; + return false; } pNewFocus = m_pOldFocusWidget; if (m_pListFocusWidget && pNewFocus == m_pListFocusWidget) { @@ -365,7 +365,7 @@ FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) { m_pFocusWidget = nullptr; m_pListFocusWidget = nullptr; m_pOldFocusWidget = nullptr; - return FALSE; + return false; } if (pNewFocus && (pNewFocus->GetStatus() & XFA_WidgetStatus_Visible)) { if (!pNewFocus->IsLoaded()) { @@ -376,7 +376,7 @@ FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) { m_pFocusAcc = pNewFocus ? pNewFocus->GetDataAcc() : nullptr; m_pFocusWidget = pNewFocus; m_pOldFocusWidget = m_pFocusWidget; - return TRUE; + return true; } CXFA_WidgetAcc* CXFA_FFDocView::GetFocusWidgetAcc() { return m_pFocusAcc; @@ -437,8 +437,8 @@ static int32_t XFA_ProcessEvent(CXFA_FFDocView* pDocView, } int32_t CXFA_FFDocView::ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, - FX_BOOL bIsFormReady, - FX_BOOL bRecursive, + bool bIsFormReady, + bool bRecursive, CXFA_Node* pExclude) { int32_t iRet = XFA_EVENTERROR_NotExist; if (pFormNode == pExclude) { @@ -535,7 +535,7 @@ void CXFA_FFDocView::LockUpdate() { void CXFA_FFDocView::UnlockUpdate() { m_iLock--; } -FX_BOOL CXFA_FFDocView::IsUpdateLocked() { +bool CXFA_FFDocView::IsUpdateLocked() { return m_iLock > 0; } void CXFA_FFDocView::ClearInvalidateList() { @@ -564,23 +564,23 @@ void CXFA_FFDocView::RunInvalidate() { m_mapPageInvalidate.clear(); } -FX_BOOL CXFA_FFDocView::RunLayout() { +bool CXFA_FFDocView::RunLayout() { LockUpdate(); - m_bInLayoutStatus = TRUE; + m_bInLayoutStatus = true; if (!m_pXFADocLayout->IncrementLayout() && m_pXFADocLayout->StartLayout() < 100) { m_pXFADocLayout->DoLayout(); UnlockUpdate(); - m_bInLayoutStatus = FALSE; + m_bInLayoutStatus = false; m_pDoc->GetDocEnvironment()->PageViewEvent(nullptr, XFA_PAGEVIEWEVENT_StopLayout); - return TRUE; + return true; } - m_bInLayoutStatus = FALSE; + m_bInLayoutStatus = false; m_pDoc->GetDocEnvironment()->PageViewEvent(nullptr, XFA_PAGEVIEWEVENT_StopLayout); UnlockUpdate(); - return FALSE; + return false; } void CXFA_FFDocView::RunSubformIndexChange() { int32_t iSubforms = m_IndexChangedSubforms.GetSize(); @@ -612,7 +612,7 @@ void CXFA_FFDocView::RunDocClose() { if (!pRootItem) { return; } - ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_DocClose, FALSE, TRUE, + ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_DocClose, false, true, nullptr); } void CXFA_FFDocView::DestroyDocView() { @@ -623,7 +623,7 @@ void CXFA_FFDocView::DestroyDocView() { m_BindItems.RemoveAll(); m_CalculateAccs.RemoveAll(); } -FX_BOOL CXFA_FFDocView::IsStaticNotify() { +bool CXFA_FFDocView::IsStaticNotify() { return m_pDoc->GetDocType() == XFA_DOCTYPE_Static; } void CXFA_FFDocView::AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) { @@ -690,22 +690,22 @@ void CXFA_FFDocView::AddValidateWidget(CXFA_WidgetAcc* pWidget) { if (m_ValidateAccs.Find(pWidget) < 0) m_ValidateAccs.Add(pWidget); } -FX_BOOL CXFA_FFDocView::InitCalculate(CXFA_Node* pNode) { - ExecEventActivityByDeepFirst(pNode, XFA_EVENT_InitCalculate, FALSE, TRUE, +bool CXFA_FFDocView::InitCalculate(CXFA_Node* pNode) { + ExecEventActivityByDeepFirst(pNode, XFA_EVENT_InitCalculate, false, true, nullptr); - return TRUE; + return true; } -FX_BOOL CXFA_FFDocView::InitValidate(CXFA_Node* pNode) { +bool CXFA_FFDocView::InitValidate(CXFA_Node* pNode) { if (!m_pDoc->GetDocEnvironment()->IsValidationsEnabled(m_pDoc)) { - return FALSE; + return false; } - ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Validate, FALSE, TRUE, nullptr); + ExecEventActivityByDeepFirst(pNode, XFA_EVENT_Validate, false, true, nullptr); m_ValidateAccs.RemoveAll(); - return TRUE; + return true; } -FX_BOOL CXFA_FFDocView::RunValidate() { +bool CXFA_FFDocView::RunValidate() { if (!m_pDoc->GetDocEnvironment()->IsValidationsEnabled(m_pDoc)) { - return FALSE; + return false; } int32_t iCounts = m_ValidateAccs.GetSize(); for (int32_t i = 0; i < iCounts; i++) { @@ -716,18 +716,18 @@ FX_BOOL CXFA_FFDocView::RunValidate() { pAcc->ProcessValidate(); } m_ValidateAccs.RemoveAll(); - return TRUE; + return true; } -FX_BOOL CXFA_FFDocView::RunEventLayoutReady() { +bool CXFA_FFDocView::RunEventLayoutReady() { CXFA_Node* pRootItem = ToNode(m_pDoc->GetXFADoc()->GetXFAObject(XFA_HASHCODE_Form)); if (!pRootItem) { - return FALSE; + return false; } - ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, FALSE, TRUE, + ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready, false, true, nullptr); RunLayout(); - return TRUE; + return true; } void CXFA_FFDocView::RunBindItems() { for (int32_t i = 0; i < m_BindItems.GetSize(); i++) { @@ -849,8 +849,8 @@ CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() { return nullptr; } -FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) { - return FALSE; +bool CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) { + return false; } void CXFA_WidgetAccIterator::SkipTree() { diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp index b14df7ee15..073e99786a 100644 --- a/xfa/fxfa/app/xfa_fffield.cpp +++ b/xfa/fxfa/app/xfa_fffield.cpp @@ -30,9 +30,9 @@ CXFA_FFField::~CXFA_FFField() { CXFA_FFField::UnloadWidget(); } -FX_BOOL CXFA_FFField::GetBBox(CFX_RectF& rtBox, - uint32_t dwStatus, - FX_BOOL bDrawFocus) { +bool CXFA_FFField::GetBBox(CFX_RectF& rtBox, + uint32_t dwStatus, + bool bDrawFocus) { if (!bDrawFocus) return CXFA_FFWidget::GetBBox(rtBox, dwStatus); @@ -44,9 +44,9 @@ FX_BOOL CXFA_FFField::GetBBox(CFX_RectF& rtBox, CFX_Matrix mt; GetRotateMatrix(mt); mt.TransformRect(rtBox); - return TRUE; + return true; } - return FALSE; + return false; } void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, @@ -64,7 +64,7 @@ void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); RenderCaption(pGS, &mtRotate); - DrawHighlight(pGS, &mtRotate, dwStatus, FALSE); + DrawHighlight(pGS, &mtRotate, dwStatus, false); CFX_RectF rtWidget; m_pNormalWidget->GetWidgetRect(rtWidget); CFX_Matrix mt; @@ -76,7 +76,7 @@ void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus, - FX_BOOL bEllipse) { + bool bEllipse) { if (m_rtUI.IsEmpty() || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { return; } @@ -101,7 +101,7 @@ void CXFA_FFField::DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix) { pGS->SetStrokeColor(&cr); FX_FLOAT DashPattern[2] = {1, 1}; pGS->SetLineDash(0.0f, DashPattern, 2); - pGS->SetLineWidth(0, FALSE); + pGS->SetLineWidth(0, false); CFX_Path path; path.Create(); path.AddRectangle(m_rtUI.left, m_rtUI.top, m_rtUI.width, m_rtUI.height); @@ -113,14 +113,14 @@ void CXFA_FFField::SetFWLThemeProvider() { m_pNormalWidget->GetWidget()->SetThemeProvider(GetApp()->GetFWLTheme()); } } -FX_BOOL CXFA_FFField::IsLoaded() { +bool CXFA_FFField::IsLoaded() { return m_pNormalWidget && CXFA_FFWidget::IsLoaded(); } -FX_BOOL CXFA_FFField::LoadWidget() { +bool CXFA_FFField::LoadWidget() { SetFWLThemeProvider(); m_pDataAcc->LoadCaption(); PerformLayout(); - return TRUE; + return true; } void CXFA_FFField::UnloadWidget() { delete m_pNormalWidget; @@ -144,7 +144,7 @@ void CXFA_FFField::SetEditScrollOffset() { ((CFWL_Edit*)m_pNormalWidget)->SetScrollOffset(fScrollOffset); } } -FX_BOOL CXFA_FFField::PerformLayout() { +bool CXFA_FFField::PerformLayout() { CXFA_FFWidget::PerformLayout(); CapPlacement(); LayoutCaption(); @@ -153,7 +153,7 @@ FX_BOOL CXFA_FFField::PerformLayout() { if (m_pNormalWidget) { m_pNormalWidget->Update(); } - return TRUE; + return true; } void CXFA_FFField::CapPlacement() { CFX_RectF rtWidget; @@ -343,26 +343,26 @@ void CXFA_FFField::SetFWLRect() { } m_pNormalWidget->SetWidgetRect(rtUi); } -FX_BOOL CXFA_FFField::OnMouseEnter() { +bool CXFA_FFField::OnMouseEnter() { if (!m_pNormalWidget) { - return FALSE; + return false; } CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::Enter; ms.m_pDstTarget = m_pNormalWidget->GetWidget(); ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnMouseExit() { +bool CXFA_FFField::OnMouseExit() { if (!m_pNormalWidget) { - return FALSE; + return false; } CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::Leave; ms.m_pDstTarget = m_pNormalWidget->GetWidget(); TranslateFWLMessage(&ms); - return TRUE; + return true; } void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) { if (!m_pNormalWidget) { @@ -373,20 +373,18 @@ void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) { fx -= rtWidget.left; fy -= rtWidget.top; } -FX_BOOL CXFA_FFField::OnLButtonDown(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFField::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { - return FALSE; + return false; } if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { - return FALSE; + return false; } if (!PtInActiveRect(fx, fy)) { - return FALSE; + return false; } - SetButtonDown(TRUE); + SetButtonDown(true); CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown; ms.m_dwFlags = dwFlags; @@ -395,16 +393,16 @@ FX_BOOL CXFA_FFField::OnLButtonDown(uint32_t dwFlags, FWLToClient(ms.m_fx, ms.m_fy); ms.m_pDstTarget = m_pNormalWidget->GetWidget(); TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { +bool CXFA_FFField::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { - return FALSE; + return false; } if (!IsButtonDown()) { - return FALSE; + return false; } - SetButtonDown(FALSE); + SetButtonDown(false); CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::LeftButtonUp; ms.m_dwFlags = dwFlags; @@ -413,13 +411,11 @@ FX_BOOL CXFA_FFField::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { FWLToClient(ms.m_fx, ms.m_fy); ms.m_pDstTarget = m_pNormalWidget->GetWidget(); TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnLButtonDblClk(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFField::OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { - return FALSE; + return false; } CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::LeftButtonDblClk; @@ -429,11 +425,11 @@ FX_BOOL CXFA_FFField::OnLButtonDblClk(uint32_t dwFlags, FWLToClient(ms.m_fx, ms.m_fy); ms.m_pDstTarget = m_pNormalWidget->GetWidget(); TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { +bool CXFA_FFField::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { - return FALSE; + return false; } CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::Move; @@ -443,14 +439,14 @@ FX_BOOL CXFA_FFField::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { FWLToClient(ms.m_fx, ms.m_fy); ms.m_pDstTarget = m_pNormalWidget->GetWidget(); TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnMouseWheel(uint32_t dwFlags, - int16_t zDelta, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFField::OnMouseWheel(uint32_t dwFlags, + int16_t zDelta, + FX_FLOAT fx, + FX_FLOAT fy) { if (!m_pNormalWidget) { - return FALSE; + return false; } CFWL_MsgMouseWheel ms; ms.m_dwFlags = dwFlags; @@ -461,22 +457,20 @@ FX_BOOL CXFA_FFField::OnMouseWheel(uint32_t dwFlags, ms.m_fDeltaY = 0; ms.m_pDstTarget = m_pNormalWidget->GetWidget(); TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnRButtonDown(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFField::OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { - return FALSE; + return false; } if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { - return FALSE; + return false; } if (!PtInActiveRect(fx, fy)) { - return FALSE; + return false; } - SetButtonDown(TRUE); + SetButtonDown(true); CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::RightButtonDown; ms.m_dwFlags = dwFlags; @@ -485,16 +479,16 @@ FX_BOOL CXFA_FFField::OnRButtonDown(uint32_t dwFlags, FWLToClient(ms.m_fx, ms.m_fy); ms.m_pDstTarget = m_pNormalWidget->GetWidget(); TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { +bool CXFA_FFField::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { - return FALSE; + return false; } if (!IsButtonDown()) { - return FALSE; + return false; } - SetButtonDown(FALSE); + SetButtonDown(false); CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::RightButtonUp; ms.m_dwFlags = dwFlags; @@ -503,13 +497,11 @@ FX_BOOL CXFA_FFField::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { FWLToClient(ms.m_fx, ms.m_fy); ms.m_pDstTarget = m_pNormalWidget->GetWidget(); TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnRButtonDblClk(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFField::OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { - return FALSE; + return false; } CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::RightButtonDblClk; @@ -519,13 +511,13 @@ FX_BOOL CXFA_FFField::OnRButtonDblClk(uint32_t dwFlags, FWLToClient(ms.m_fx, ms.m_fy); ms.m_pDstTarget = m_pNormalWidget->GetWidget(); TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) { +bool CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) { CXFA_FFWidget::OnSetFocus(pOldWidget); if (!m_pNormalWidget) { - return FALSE; + return false; } CFWL_MsgSetFocus ms; ms.m_pDstTarget = m_pNormalWidget->GetWidget(); @@ -533,9 +525,9 @@ FX_BOOL CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) { TranslateFWLMessage(&ms); m_dwStatus |= XFA_WidgetStatus_Focused; AddInvalidateRect(); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) { +bool CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) { if (!m_pNormalWidget) { return CXFA_FFWidget::OnKillFocus(pNewWidget); } @@ -546,11 +538,11 @@ FX_BOOL CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) { m_dwStatus &= ~XFA_WidgetStatus_Focused; AddInvalidateRect(); CXFA_FFWidget::OnKillFocus(pNewWidget); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { +bool CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { - return FALSE; + return false; } CFWL_MsgKey ms; ms.m_dwCmd = FWL_KeyCommand::KeyDown; @@ -559,11 +551,11 @@ FX_BOOL CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { ms.m_pDstTarget = m_pNormalWidget->GetWidget(); ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { +bool CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { - return FALSE; + return false; } CFWL_MsgKey ms; ms.m_dwCmd = FWL_KeyCommand::KeyUp; @@ -572,20 +564,20 @@ FX_BOOL CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { ms.m_pDstTarget = m_pNormalWidget->GetWidget(); ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) { +bool CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) { if (!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { - return FALSE; + return false; } if (dwChar == FWL_VKEY_Tab) { - return TRUE; + return true; } if (!m_pNormalWidget) { - return FALSE; + return false; } if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { - return FALSE; + return false; } CFWL_MsgKey ms; ms.m_dwCmd = FWL_KeyCommand::Char; @@ -594,7 +586,7 @@ FX_BOOL CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) { ms.m_pDstTarget = m_pNormalWidget->GetWidget(); ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); - return TRUE; + return true; } FWL_WidgetHit CXFA_FFField::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { if (m_pNormalWidget) { @@ -611,19 +603,19 @@ FWL_WidgetHit CXFA_FFField::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { return FWL_WidgetHit::Titlebar; return FWL_WidgetHit::Border; } -FX_BOOL CXFA_FFField::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { - return TRUE; +bool CXFA_FFField::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { + return true; } -FX_BOOL CXFA_FFField::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { +bool CXFA_FFField::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { - return FALSE; + return false; } CFX_RectF rtWidget; m_pNormalWidget->GetWidgetRect(rtWidget); if (rtWidget.Contains(fx, fy)) { - return TRUE; + return true; } - return FALSE; + return false; } void CXFA_FFField::LayoutCaption() { CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout(); @@ -660,22 +652,22 @@ void CXFA_FFField::RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix) { pCapTextLayout->DrawString(pRenderDevice, mt, rtClip); } } -FX_BOOL CXFA_FFField::ProcessCommittedData() { +bool CXFA_FFField::ProcessCommittedData() { if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { - return FALSE; + return false; } if (!IsDataChanged()) { - return FALSE; + return false; } if (CalculateOverride() != 1) { - return FALSE; + return false; } if (!CommitData()) { - return FALSE; + return false; } m_pDocView->SetChangeMark(); m_pDocView->AddValidateWidget(m_pDataAcc); - return TRUE; + return true; } int32_t CXFA_FFField::CalculateOverride() { CXFA_WidgetAcc* pAcc = m_pDataAcc->GetExclGroup(); @@ -773,11 +765,11 @@ int32_t CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc) { } return 1; } -FX_BOOL CXFA_FFField::CommitData() { - return FALSE; +bool CXFA_FFField::CommitData() { + return false; } -FX_BOOL CXFA_FFField::IsDataChanged() { - return FALSE; +bool CXFA_FFField::IsDataChanged() { + return false; } void CXFA_FFField::TranslateFWLMessage(CFWL_Message* pMessage) { GetApp()->GetWidgetMgrDelegate()->OnProcessMessageToForm(pMessage); diff --git a/xfa/fxfa/app/xfa_fffield.h b/xfa/fxfa/app/xfa_fffield.h index 8481018189..17d33da754 100644 --- a/xfa/fxfa/app/xfa_fffield.h +++ b/xfa/fxfa/app/xfa_fffield.h @@ -21,37 +21,37 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { ~CXFA_FFField() override; // CXFA_FFWidget - FX_BOOL GetBBox(CFX_RectF& rtBox, - uint32_t dwStatus, - FX_BOOL bDrawFocus = FALSE) override; + bool GetBBox(CFX_RectF& rtBox, + uint32_t dwStatus, + bool bDrawFocus = false) override; void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; - FX_BOOL IsLoaded() override; - FX_BOOL LoadWidget() override; + bool IsLoaded() override; + bool LoadWidget() override; void UnloadWidget() override; - FX_BOOL PerformLayout() override; - FX_BOOL OnMouseEnter() override; - FX_BOOL OnMouseExit() override; - FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnMouseWheel(uint32_t dwFlags, - int16_t zDelta, - FX_FLOAT fx, - FX_FLOAT fy) override; - FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool PerformLayout() override; + bool OnMouseEnter() override; + bool OnMouseExit() override; + bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnMouseWheel(uint32_t dwFlags, + int16_t zDelta, + FX_FLOAT fx, + FX_FLOAT fy) override; + bool OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget) override; - FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override; - FX_BOOL OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) override; - FX_BOOL OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) override; - FX_BOOL OnChar(uint32_t dwChar, uint32_t dwFlags) override; + bool OnSetFocus(CXFA_FFWidget* pOldWidget) override; + bool OnKillFocus(CXFA_FFWidget* pNewWidget) override; + bool OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) override; + bool OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) override; + bool OnChar(uint32_t dwChar, uint32_t dwFlags) override; FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) override; + bool OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) override; // IFWL_WidgetDelegate void OnProcessMessage(CFWL_Message* pMessage) override; @@ -63,7 +63,7 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { uint32_t UpdateUIProperty(); protected: - FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override; + bool PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override; virtual void SetFWLRect(); void SetFWLThemeProvider(); @@ -74,13 +74,13 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { int32_t CalculateOverride(); int32_t CalculateWidgetAcc(CXFA_WidgetAcc* pAcc); - FX_BOOL ProcessCommittedData(); - virtual FX_BOOL CommitData(); - virtual FX_BOOL IsDataChanged(); + bool ProcessCommittedData(); + virtual bool CommitData(); + virtual bool IsDataChanged(); void DrawHighlight(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus, - FX_BOOL bEllipse = FALSE); + bool bEllipse = false); void DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix); void TranslateFWLMessage(CFWL_Message* pMessage); void CapPlacement(); diff --git a/xfa/fxfa/app/xfa_ffimage.cpp b/xfa/fxfa/app/xfa_ffimage.cpp index bcd1d4a9ce..c387cc2690 100644 --- a/xfa/fxfa/app/xfa_ffimage.cpp +++ b/xfa/fxfa/app/xfa_ffimage.cpp @@ -17,12 +17,12 @@ CXFA_FFImage::CXFA_FFImage(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) CXFA_FFImage::~CXFA_FFImage() { CXFA_FFImage::UnloadWidget(); } -FX_BOOL CXFA_FFImage::IsLoaded() { +bool CXFA_FFImage::IsLoaded() { return !!GetDataAcc()->GetImageImage(); } -FX_BOOL CXFA_FFImage::LoadWidget() { +bool CXFA_FFImage::LoadWidget() { if (GetDataAcc()->GetImageImage()) { - return TRUE; + return true; } GetDataAcc()->LoadImageImage(); return CXFA_FFDraw::LoadWidget(); diff --git a/xfa/fxfa/app/xfa_ffimage.h b/xfa/fxfa/app/xfa_ffimage.h index d0afc5b431..cc5320eb36 100644 --- a/xfa/fxfa/app/xfa_ffimage.h +++ b/xfa/fxfa/app/xfa_ffimage.h @@ -18,8 +18,8 @@ class CXFA_FFImage : public CXFA_FFDraw { void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; - FX_BOOL IsLoaded() override; - FX_BOOL LoadWidget() override; + bool IsLoaded() override; + bool LoadWidget() override; void UnloadWidget() override; }; diff --git a/xfa/fxfa/app/xfa_ffimageedit.cpp b/xfa/fxfa/app/xfa_ffimageedit.cpp index 4b77ccf73d..216cf5b9bf 100644 --- a/xfa/fxfa/app/xfa_ffimageedit.cpp +++ b/xfa/fxfa/app/xfa_ffimageedit.cpp @@ -22,7 +22,7 @@ CXFA_FFImageEdit::CXFA_FFImageEdit(CXFA_FFPageView* pPageView, CXFA_FFImageEdit::~CXFA_FFImageEdit() { CXFA_FFImageEdit::UnloadWidget(); } -FX_BOOL CXFA_FFImageEdit::LoadWidget() { +bool CXFA_FFImageEdit::LoadWidget() { CFWL_PictureBox* pPictureBox = new CFWL_PictureBox(GetFWLApp()); pPictureBox->Initialize(); m_pNormalWidget = pPictureBox; @@ -37,10 +37,10 @@ FX_BOOL CXFA_FFImageEdit::LoadWidget() { CXFA_FFField::LoadWidget(); if (m_pDataAcc->GetImageEditImage()) { - return TRUE; + return true; } UpdateFWLData(); - return TRUE; + return true; } void CXFA_FFImageEdit::UnloadWidget() { m_pDataAcc->SetImageEditImage(nullptr); @@ -84,16 +84,16 @@ void CXFA_FFImageEdit::RenderWidget(CFX_Graphics* pGS, } } -FX_BOOL CXFA_FFImageEdit::OnLButtonDown(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFImageEdit::OnLButtonDown(uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) - return FALSE; + return false; if (!PtInActiveRect(fx, fy)) - return FALSE; + return false; - SetButtonDown(TRUE); + SetButtonDown(true); CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown; ms.m_dwFlags = dwFlags; @@ -102,7 +102,7 @@ FX_BOOL CXFA_FFImageEdit::OnLButtonDown(uint32_t dwFlags, ms.m_pDstTarget = m_pNormalWidget->GetWidget(); FWLToClient(ms.m_fx, ms.m_fy); TranslateFWLMessage(&ms); - return TRUE; + return true; } void CXFA_FFImageEdit::SetFWLRect() { @@ -116,13 +116,13 @@ void CXFA_FFImageEdit::SetFWLRect() { rtUIMargin.height); m_pNormalWidget->SetWidgetRect(rtImage); } -FX_BOOL CXFA_FFImageEdit::CommitData() { - return TRUE; +bool CXFA_FFImageEdit::CommitData() { + return true; } -FX_BOOL CXFA_FFImageEdit::UpdateFWLData() { +bool CXFA_FFImageEdit::UpdateFWLData() { m_pDataAcc->SetImageEditImage(nullptr); m_pDataAcc->LoadImageEditImage(); - return TRUE; + return true; } void CXFA_FFImageEdit::OnProcessMessage(CFWL_Message* pMessage) { diff --git a/xfa/fxfa/app/xfa_ffimageedit.h b/xfa/fxfa/app/xfa_ffimageedit.h index c8f31e2fc4..b6f6ae1ffe 100644 --- a/xfa/fxfa/app/xfa_ffimageedit.h +++ b/xfa/fxfa/app/xfa_ffimageedit.h @@ -18,9 +18,9 @@ class CXFA_FFImageEdit : public CXFA_FFField { void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; - FX_BOOL LoadWidget() override; + bool LoadWidget() override; void UnloadWidget() override; - FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, @@ -28,8 +28,8 @@ class CXFA_FFImageEdit : public CXFA_FFField { protected: void SetFWLRect() override; - FX_BOOL UpdateFWLData() override; - FX_BOOL CommitData() override; + bool UpdateFWLData() override; + bool CommitData() override; IFWL_WidgetDelegate* m_pOldDelegate; }; diff --git a/xfa/fxfa/app/xfa_ffnotify.cpp b/xfa/fxfa/app/xfa_ffnotify.cpp index 2f3eac6e16..4e14ab0203 100644 --- a/xfa/fxfa/app/xfa_ffnotify.cpp +++ b/xfa/fxfa/app/xfa_ffnotify.cpp @@ -180,15 +180,15 @@ void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node* pItem, pAcc->StartWidgetLayout(fCalcWidth, fCalcHeight); } -FX_BOOL CXFA_FFNotify::FindSplitPos(CXFA_Node* pItem, - int32_t iBlockIndex, - FX_FLOAT& fCalcHeightPos) { +bool CXFA_FFNotify::FindSplitPos(CXFA_Node* pItem, + int32_t iBlockIndex, + FX_FLOAT& fCalcHeightPos) { CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pItem->GetWidgetData()); return pAcc && pAcc->FindSplitPos(iBlockIndex, fCalcHeightPos); } -FX_BOOL CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) { - FX_BOOL bRet = FALSE; +bool CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) { + bool bRet = false; CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); if (!pDocView) { return bRet; @@ -211,8 +211,8 @@ FX_BOOL CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) { } int32_t CXFA_FFNotify::ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, - FX_BOOL bIsFormReady, - FX_BOOL bRecursive, + bool bIsFormReady, + bool bRecursive, CXFA_WidgetAcc* pExclude) { CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); if (!pDocView) { @@ -380,7 +380,7 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender, } XFA_Element eType = pParentNode->GetElementType(); - FX_BOOL bIsContainerNode = pParentNode->IsContainerNode(); + bool bIsContainerNode = pParentNode->IsContainerNode(); CXFA_WidgetAcc* pWidgetAcc = static_cast<CXFA_WidgetAcc*>(pWidgetNode->GetWidgetData()); if (!pWidgetAcc) @@ -440,7 +440,7 @@ void CXFA_FFNotify::OnChildAdded(CXFA_Node* pSender) { if (!pDocView) { return; } - FX_BOOL bLayoutReady = + bool bLayoutReady = !(pDocView->m_bInLayoutStatus) && (pDocView->GetLayoutStatus() == XFA_DOCVIEW_LAYOUTSTATUS_End); if (bLayoutReady) diff --git a/xfa/fxfa/app/xfa_ffnotify.h b/xfa/fxfa/app/xfa_ffnotify.h index bc764e1533..d9530a895e 100644 --- a/xfa/fxfa/app/xfa_ffnotify.h +++ b/xfa/fxfa/app/xfa_ffnotify.h @@ -46,14 +46,14 @@ class CXFA_FFNotify { void StartFieldDrawLayout(CXFA_Node* pItem, FX_FLOAT& fCalcWidth, FX_FLOAT& fCalcHeight); - FX_BOOL FindSplitPos(CXFA_Node* pItem, - int32_t iBlockIndex, - FX_FLOAT& fCalcHeightPos); - FX_BOOL RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem); + bool FindSplitPos(CXFA_Node* pItem, + int32_t iBlockIndex, + FX_FLOAT& fCalcHeightPos); + bool RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem); int32_t ExecEventByDeepFirst(CXFA_Node* pFormNode, XFA_EVENTTYPE eEventType, - FX_BOOL bIsFormReady = FALSE, - FX_BOOL bRecursive = TRUE, + bool bIsFormReady = false, + bool bRecursive = true, CXFA_WidgetAcc* pExclude = nullptr); void AddCalcValidate(CXFA_Node* pNode); CXFA_FFDoc* GetHDOC(); diff --git a/xfa/fxfa/app/xfa_ffpageview.cpp b/xfa/fxfa/app/xfa_ffpageview.cpp index 899a311d6c..5ef108693a 100644 --- a/xfa/fxfa/app/xfa_ffpageview.cpp +++ b/xfa/fxfa/app/xfa_ffpageview.cpp @@ -26,8 +26,8 @@ void GetPageMatrix(CFX_Matrix& pageMatrix, int32_t iRotate, uint32_t dwCoordinatesType) { ASSERT(iRotate >= 0 && iRotate <= 3); - FX_BOOL bFlipX = (dwCoordinatesType & 0x01) != 0; - FX_BOOL bFlipY = (dwCoordinatesType & 0x02) != 0; + bool bFlipX = (dwCoordinatesType & 0x01) != 0; + bool bFlipY = (dwCoordinatesType & 0x02) != 0; CFX_Matrix m; m.Set((bFlipX ? -1.0f : 1.0f), 0, 0, (bFlipY ? -1.0f : 1.0f), 0, 0); if (iRotate == 0 || iRotate == 2) { @@ -71,8 +71,8 @@ void GetPageMatrix(CFX_Matrix& pageMatrix, bool PageWidgetFilter(CXFA_FFWidget* pWidget, uint32_t dwFilter, - FX_BOOL bTraversal, - FX_BOOL bIgnorerelevant) { + bool bTraversal, + bool bIgnorerelevant) { CXFA_WidgetAcc* pWidgetAcc = pWidget->GetDataAcc(); if (!!(dwFilter & XFA_WidgetStatus_Focused) && @@ -194,13 +194,13 @@ CXFA_FFWidget* CXFA_FFPageWidgetIterator::GetCurrentWidget() { CXFA_LayoutItem* pLayoutItem = m_sIterator.GetCurrent(); return pLayoutItem ? XFA_GetWidgetFromLayoutItem(pLayoutItem) : nullptr; } -FX_BOOL CXFA_FFPageWidgetIterator::SetCurrentWidget(CXFA_FFWidget* hWidget) { +bool CXFA_FFPageWidgetIterator::SetCurrentWidget(CXFA_FFWidget* hWidget) { return hWidget && m_sIterator.SetCurrent(hWidget); } CXFA_FFWidget* CXFA_FFPageWidgetIterator::GetWidget( CXFA_LayoutItem* pLayoutItem) { if (CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pLayoutItem)) { - if (!PageWidgetFilter(pWidget, m_dwFilter, FALSE, m_bIgnorerelevant)) { + if (!PageWidgetFilter(pWidget, m_dwFilter, false, m_bIgnorerelevant)) { return nullptr; } if (!pWidget->IsLoaded() && @@ -231,7 +231,7 @@ void CXFA_FFTabOrderPageWidgetIterator::Reset() { CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToFirst() { if (m_TabOrderWidgetArray.GetSize() > 0) { for (int32_t i = 0; i < m_TabOrderWidgetArray.GetSize(); i++) { - if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, + if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, true, m_bIgnorerelevant)) { m_iCurWidget = i; return m_TabOrderWidgetArray[m_iCurWidget]; @@ -243,7 +243,7 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToFirst() { CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToLast() { if (m_TabOrderWidgetArray.GetSize() > 0) { for (int32_t i = m_TabOrderWidgetArray.GetSize() - 1; i >= 0; i--) { - if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, + if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, true, m_bIgnorerelevant)) { m_iCurWidget = i; return m_TabOrderWidgetArray[m_iCurWidget]; @@ -254,7 +254,7 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToLast() { } CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToNext() { for (int32_t i = m_iCurWidget + 1; i < m_TabOrderWidgetArray.GetSize(); i++) { - if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, + if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, true, m_bIgnorerelevant)) { m_iCurWidget = i; return m_TabOrderWidgetArray[m_iCurWidget]; @@ -265,7 +265,7 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToNext() { } CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::MoveToPrevious() { for (int32_t i = m_iCurWidget - 1; i >= 0; i--) { - if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, TRUE, + if (PageWidgetFilter(m_TabOrderWidgetArray[i], m_dwFilter, true, m_bIgnorerelevant)) { m_iCurWidget = i; return m_TabOrderWidgetArray[m_iCurWidget]; @@ -280,14 +280,14 @@ CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetCurrentWidget() { } return nullptr; } -FX_BOOL CXFA_FFTabOrderPageWidgetIterator::SetCurrentWidget( +bool CXFA_FFTabOrderPageWidgetIterator::SetCurrentWidget( CXFA_FFWidget* hWidget) { int32_t iWidgetIndex = m_TabOrderWidgetArray.Find(hWidget); if (iWidgetIndex >= 0) { m_iCurWidget = iWidgetIndex; - return TRUE; + return true; } - return FALSE; + return false; } CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetTraverseWidget( CXFA_FFWidget* pWidget) { @@ -324,7 +324,7 @@ void CXFA_FFTabOrderPageWidgetIterator::CreateTabOrderWidgetArray() { CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc(); if (pWidgetAcc->GetUIType() == XFA_Element::ExclGroup) { int32_t iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget) + 1; - while (TRUE) { + while (true) { CXFA_FFWidget* pRadio = SpaceOrderWidgetArray[(iWidgetIndex) % nWidgetCount]; if (pRadio->GetDataAcc()->GetExclGroup() != pWidgetAcc) { @@ -362,14 +362,14 @@ void CXFA_FFTabOrderPageWidgetIterator::OrderContainer( CXFA_LayoutItemIterator* sIterator, CXFA_LayoutItem* pContainerItem, CXFA_TabParam* pContainer, - FX_BOOL& bCurrentItem, - FX_BOOL& bContentArea, - FX_BOOL bMarsterPage) { + bool& bCurrentItem, + bool& bContentArea, + bool bMarsterPage) { CFX_ArrayTemplate<CXFA_TabParam*> tabParams; CXFA_LayoutItem* pSearchItem = sIterator->MoveToNext(); while (pSearchItem) { if (!pSearchItem->IsContentLayoutItem()) { - bContentArea = TRUE; + bContentArea = true; pSearchItem = sIterator->MoveToNext(); continue; } @@ -383,7 +383,7 @@ void CXFA_FFTabOrderPageWidgetIterator::OrderContainer( continue; } if (pContainerItem && (pSearchItem->GetParent() != pContainerItem)) { - bCurrentItem = TRUE; + bCurrentItem = true; break; } CXFA_TabParam* pParam = new CXFA_TabParam; @@ -396,7 +396,7 @@ void CXFA_FFTabOrderPageWidgetIterator::OrderContainer( } if (bCurrentItem) { pSearchItem = sIterator->GetCurrent(); - bCurrentItem = FALSE; + bCurrentItem = false; } else { pSearchItem = sIterator->MoveToNext(); } @@ -421,17 +421,17 @@ void CXFA_FFTabOrderPageWidgetIterator::CreateSpaceOrderWidgetArray( CXFA_LayoutItemIterator sIterator; sIterator.Init(m_pPageView); CXFA_TabParam* pParam = new CXFA_TabParam; - FX_BOOL bCurrentItem = FALSE; - FX_BOOL bContentArea = FALSE; + bool bCurrentItem = false; + bool bContentArea = false; OrderContainer(&sIterator, nullptr, pParam, bCurrentItem, bContentArea); if (pParam->m_Children.GetSize() > 0) { WidgetArray.Append(pParam->m_Children); } sIterator.Reset(); - bCurrentItem = FALSE; - bContentArea = FALSE; + bCurrentItem = false; + bContentArea = false; pParam->m_Children.RemoveAll(); - OrderContainer(&sIterator, nullptr, pParam, bCurrentItem, bContentArea, TRUE); + OrderContainer(&sIterator, nullptr, pParam, bCurrentItem, bContentArea, true); if (pParam->m_Children.GetSize() > 0) { WidgetArray.Append(pParam->m_Children); } diff --git a/xfa/fxfa/app/xfa_ffpath.cpp b/xfa/fxfa/app/xfa_ffpath.cpp index 7ef13b63ff..c5c91a459c 100644 --- a/xfa/fxfa/app/xfa_ffpath.cpp +++ b/xfa/fxfa/app/xfa_ffpath.cpp @@ -63,7 +63,7 @@ void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, FX_ARGB lineColor = 0xFF000000; int32_t iStrokeType = 0; FX_FLOAT fLineWidth = 1.0f; - FX_BOOL bSlope = lineObj.GetSlop(); + bool bSlope = lineObj.GetSlop(); int32_t iCap = 0; CXFA_Edge edge = lineObj.GetEdge(); if (edge) { @@ -95,7 +95,7 @@ void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS, } CFX_Color color(lineColor); pGS->SaveGraphState(); - pGS->SetLineWidth(fLineWidth, TRUE); + pGS->SetLineWidth(fLineWidth, true); XFA_StrokeTypeSetLineDash(pGS, iStrokeType, iCap); pGS->SetStrokeColor(&color); pGS->SetLineCap(XFA_LineCapToFXGE(iCap)); diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp index 2439eae78f..12fabb5a1e 100644 --- a/xfa/fxfa/app/xfa_ffpushbutton.cpp +++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp @@ -50,7 +50,7 @@ void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS, GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), pGS, &mt); } -FX_BOOL CXFA_FFPushButton::LoadWidget() { +bool CXFA_FFPushButton::LoadWidget() { ASSERT(!m_pNormalWidget); CFWL_PushButton* pPushButton = new CFWL_PushButton(GetFWLApp()); pPushButton->Initialize(); @@ -99,7 +99,7 @@ void CXFA_FFPushButton::UnloadWidget() { CXFA_FFField::UnloadWidget(); } -FX_BOOL CXFA_FFPushButton::PerformLayout() { +bool CXFA_FFPushButton::PerformLayout() { CXFA_FFWidget::PerformLayout(); CFX_RectF rtWidget; GetRectWithoutRotate(rtWidget); @@ -117,7 +117,7 @@ FX_BOOL CXFA_FFPushButton::PerformLayout() { if (m_pNormalWidget) { m_pNormalWidget->Update(); } - return TRUE; + return true; } FX_FLOAT CXFA_FFPushButton::GetLineWidth() { CXFA_Border border = m_pDataAcc->GetBorder(); @@ -138,7 +138,7 @@ void CXFA_FFPushButton::LoadHighlightCaption() { if (caption && caption.GetPresence() != XFA_ATTRIBUTEENUM_Hidden) { { CFX_WideString wsRollover; - FX_BOOL bRichText; + bool bRichText; if (m_pDataAcc->GetButtonRollover(wsRollover, bRichText)) { if (!m_pRollProvider) { m_pRollProvider = diff --git a/xfa/fxfa/app/xfa_ffpushbutton.h b/xfa/fxfa/app/xfa_ffpushbutton.h index e7c9bd7746..d5fe0b279f 100644 --- a/xfa/fxfa/app/xfa_ffpushbutton.h +++ b/xfa/fxfa/app/xfa_ffpushbutton.h @@ -25,9 +25,9 @@ class CXFA_FFPushButton : public CXFA_FFField { void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; - FX_BOOL LoadWidget() override; + bool LoadWidget() override; void UnloadWidget() override; - FX_BOOL PerformLayout() override; + bool PerformLayout() override; void UpdateWidgetProperty() override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; diff --git a/xfa/fxfa/app/xfa_ffsignature.cpp b/xfa/fxfa/app/xfa_ffsignature.cpp index 3402d43fcb..7b8da0cea7 100644 --- a/xfa/fxfa/app/xfa_ffsignature.cpp +++ b/xfa/fxfa/app/xfa_ffsignature.cpp @@ -15,7 +15,7 @@ CXFA_FFSignature::CXFA_FFSignature(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) : CXFA_FFField(pPageView, pDataAcc) {} CXFA_FFSignature::~CXFA_FFSignature() {} -FX_BOOL CXFA_FFSignature::LoadWidget() { +bool CXFA_FFSignature::LoadWidget() { return CXFA_FFField::LoadWidget(); } void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, @@ -33,64 +33,58 @@ void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); RenderCaption(pGS, &mtRotate); - DrawHighlight(pGS, &mtRotate, dwStatus, FALSE); + DrawHighlight(pGS, &mtRotate, dwStatus, false); } -FX_BOOL CXFA_FFSignature::OnMouseEnter() { - return FALSE; -} -FX_BOOL CXFA_FFSignature::OnMouseExit() { - return FALSE; -} -FX_BOOL CXFA_FFSignature::OnLButtonDown(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { - return FALSE; -} -FX_BOOL CXFA_FFSignature::OnLButtonUp(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { - return FALSE; -} -FX_BOOL CXFA_FFSignature::OnLButtonDblClk(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { - return FALSE; -} -FX_BOOL CXFA_FFSignature::OnMouseMove(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { - return FALSE; -} -FX_BOOL CXFA_FFSignature::OnMouseWheel(uint32_t dwFlags, - int16_t zDelta, +bool CXFA_FFSignature::OnMouseEnter() { + return false; +} +bool CXFA_FFSignature::OnMouseExit() { + return false; +} +bool CXFA_FFSignature::OnLButtonDown(uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { + return false; +} +bool CXFA_FFSignature::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { + return false; +} +bool CXFA_FFSignature::OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { - return FALSE; + return false; } -FX_BOOL CXFA_FFSignature::OnRButtonDown(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { - return FALSE; +bool CXFA_FFSignature::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { + return false; } -FX_BOOL CXFA_FFSignature::OnRButtonUp(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { - return FALSE; +bool CXFA_FFSignature::OnMouseWheel(uint32_t dwFlags, + int16_t zDelta, + FX_FLOAT fx, + FX_FLOAT fy) { + return false; } -FX_BOOL CXFA_FFSignature::OnRButtonDblClk(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { - return FALSE; +bool CXFA_FFSignature::OnRButtonDown(uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { + return false; +} +bool CXFA_FFSignature::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { + return false; +} +bool CXFA_FFSignature::OnRButtonDblClk(uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { + return false; } -FX_BOOL CXFA_FFSignature::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { - return FALSE; +bool CXFA_FFSignature::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { + return false; } -FX_BOOL CXFA_FFSignature::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { - return FALSE; +bool CXFA_FFSignature::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { + return false; } -FX_BOOL CXFA_FFSignature::OnChar(uint32_t dwChar, uint32_t dwFlags) { - return FALSE; +bool CXFA_FFSignature::OnChar(uint32_t dwChar, uint32_t dwFlags) { + return false; } FWL_WidgetHit CXFA_FFSignature::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { if (m_pNormalWidget) { @@ -107,6 +101,6 @@ FWL_WidgetHit CXFA_FFSignature::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { return FWL_WidgetHit::Titlebar; return FWL_WidgetHit::Client; } -FX_BOOL CXFA_FFSignature::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { - return FALSE; +bool CXFA_FFSignature::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { + return false; } diff --git a/xfa/fxfa/app/xfa_ffsignature.h b/xfa/fxfa/app/xfa_ffsignature.h index 3cfe9ab2c6..28053b758e 100644 --- a/xfa/fxfa/app/xfa_ffsignature.h +++ b/xfa/fxfa/app/xfa_ffsignature.h @@ -18,26 +18,26 @@ class CXFA_FFSignature final : public CXFA_FFField { void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; - FX_BOOL LoadWidget() override; - FX_BOOL OnMouseEnter() override; - FX_BOOL OnMouseExit() override; - FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnMouseWheel(uint32_t dwFlags, - int16_t zDelta, - FX_FLOAT fx, - FX_FLOAT fy) override; - FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool LoadWidget() override; + bool OnMouseEnter() override; + bool OnMouseExit() override; + bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnMouseWheel(uint32_t dwFlags, + int16_t zDelta, + FX_FLOAT fx, + FX_FLOAT fy) override; + bool OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) override; - FX_BOOL OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) override; - FX_BOOL OnChar(uint32_t dwChar, uint32_t dwFlags) override; + bool OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) override; + bool OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) override; + bool OnChar(uint32_t dwChar, uint32_t dwFlags) override; FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) override; + bool OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) override; }; #endif // XFA_FXFA_APP_XFA_FFSIGNATURE_H_ diff --git a/xfa/fxfa/app/xfa_fftext.cpp b/xfa/fxfa/app/xfa_fftext.cpp index b8ad6716d0..c7e4f04d3c 100644 --- a/xfa/fxfa/app/xfa_fftext.cpp +++ b/xfa/fxfa/app/xfa_fftext.cpp @@ -62,23 +62,23 @@ void CXFA_FFText::RenderWidget(CFX_Graphics* pGS, } } } -FX_BOOL CXFA_FFText::IsLoaded() { +bool CXFA_FFText::IsLoaded() { CXFA_TextLayout* pTextLayout = m_pDataAcc->GetTextLayout(); return pTextLayout && !pTextLayout->m_bHasBlock; } -FX_BOOL CXFA_FFText::PerformLayout() { +bool CXFA_FFText::PerformLayout() { CXFA_FFDraw::PerformLayout(); CXFA_TextLayout* pTextLayout = m_pDataAcc->GetTextLayout(); if (!pTextLayout) { - return FALSE; + return false; } if (!pTextLayout->m_bHasBlock) { - return TRUE; + return true; } pTextLayout->m_Blocks.RemoveAll(); CXFA_LayoutItem* pItem = this; if (!pItem->GetPrev() && !pItem->GetNext()) { - return TRUE; + return true; } pItem = pItem->GetFirst(); while (pItem) { @@ -98,46 +98,46 @@ FX_BOOL CXFA_FFText::PerformLayout() { pTextLayout->ItemBlocks(rtText, pItem->GetIndex()); pItem = pItem->GetNext(); } - pTextLayout->m_bHasBlock = FALSE; - return TRUE; + pTextLayout->m_bHasBlock = false; + return true; } -FX_BOOL CXFA_FFText::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { +bool CXFA_FFText::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { CFX_RectF rtBox; GetRectWithoutRotate(rtBox); if (!rtBox.Contains(fx, fy)) { - return FALSE; + return false; } const FX_WCHAR* wsURLContent = GetLinkURLAtPoint(fx, fy); if (!wsURLContent) { - return FALSE; + return false; } - SetButtonDown(TRUE); - return TRUE; + SetButtonDown(true); + return true; } -FX_BOOL CXFA_FFText::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { +bool CXFA_FFText::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { CFX_RectF rtBox; GetRectWithoutRotate(rtBox); if (!rtBox.Contains(fx, fy)) { - return FALSE; + return false; } const FX_WCHAR* wsURLContent = GetLinkURLAtPoint(fx, fy); if (!wsURLContent) { - return FALSE; + return false; } - return TRUE; + return true; } -FX_BOOL CXFA_FFText::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { +bool CXFA_FFText::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!IsButtonDown()) { - return FALSE; + return false; } - SetButtonDown(FALSE); + SetButtonDown(false); const FX_WCHAR* wsURLContent = GetLinkURLAtPoint(fx, fy); if (!wsURLContent) { - return FALSE; + return false; } CXFA_FFDoc* pDoc = GetDoc(); pDoc->GetDocEnvironment()->GotoURL(pDoc, wsURLContent); - return TRUE; + return true; } FWL_WidgetHit CXFA_FFText::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { CFX_RectF rtBox; diff --git a/xfa/fxfa/app/xfa_fftext.h b/xfa/fxfa/app/xfa_fftext.h index 38e7676ac1..71f36e2769 100644 --- a/xfa/fxfa/app/xfa_fftext.h +++ b/xfa/fxfa/app/xfa_fftext.h @@ -15,15 +15,15 @@ class CXFA_FFText : public CXFA_FFDraw { ~CXFA_FFText() override; // CXFA_FFWidget - FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; FWL_WidgetHit OnHitTest(FX_FLOAT fx, FX_FLOAT fy) override; void RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix, uint32_t dwStatus) override; - FX_BOOL IsLoaded() override; - FX_BOOL PerformLayout() override; + bool IsLoaded() override; + bool PerformLayout() override; private: const FX_WCHAR* GetLinkURLAtPoint(FX_FLOAT fx, FX_FLOAT fy); diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp index ffbcac1e17..2b47ae2495 100644 --- a/xfa/fxfa/app/xfa_fftextedit.cpp +++ b/xfa/fxfa/app/xfa_fftextedit.cpp @@ -36,7 +36,7 @@ CXFA_FFTextEdit::~CXFA_FFTextEdit() { } } -FX_BOOL CXFA_FFTextEdit::LoadWidget() { +bool CXFA_FFTextEdit::LoadWidget() { CFWL_Edit* pFWLEdit = new CFWL_Edit(GetFWLApp()); pFWLEdit->Initialize(); m_pNormalWidget = pFWLEdit; @@ -100,18 +100,18 @@ void CXFA_FFTextEdit::UpdateWidgetProperty() { m_pNormalWidget->ModifyStyles(dwStyle, 0xFFFFFFFF); m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF); } -FX_BOOL CXFA_FFTextEdit::OnLButtonDown(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFTextEdit::OnLButtonDown(uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { if (!PtInActiveRect(fx, fy)) { - return FALSE; + return false; } if (!IsFocused()) { m_dwStatus |= XFA_WidgetStatus_Focused; UpdateFWLData(); AddInvalidateRect(); } - SetButtonDown(TRUE); + SetButtonDown(true); CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown; ms.m_dwFlags = dwFlags; @@ -120,23 +120,23 @@ FX_BOOL CXFA_FFTextEdit::OnLButtonDown(uint32_t dwFlags, ms.m_pDstTarget = m_pNormalWidget->GetWidget(); FWLToClient(ms.m_fx, ms.m_fy); TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFTextEdit::OnRButtonDown(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFTextEdit::OnRButtonDown(uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { - return FALSE; + return false; } if (!PtInActiveRect(fx, fy)) { - return FALSE; + return false; } if (!IsFocused()) { m_dwStatus |= XFA_WidgetStatus_Focused; UpdateFWLData(); AddInvalidateRect(); } - SetButtonDown(TRUE); + SetButtonDown(true); CFWL_MsgMouse ms; ms.m_dwCmd = FWL_MouseCommand::RightButtonDown; ms.m_dwFlags = dwFlags; @@ -144,18 +144,16 @@ FX_BOOL CXFA_FFTextEdit::OnRButtonDown(uint32_t dwFlags, ms.m_fy = fy; FWLToClient(ms.m_fx, ms.m_fy); TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFTextEdit::OnRButtonUp(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFTextEdit::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { if (!CXFA_FFField::OnRButtonUp(dwFlags, fx, fy)) - return FALSE; + return false; GetDoc()->GetDocEnvironment()->PopupMenu(this, CFX_PointF(fx, fy)); - return TRUE; + return true; } -FX_BOOL CXFA_FFTextEdit::OnSetFocus(CXFA_FFWidget* pOldWidget) { +bool CXFA_FFTextEdit::OnSetFocus(CXFA_FFWidget* pOldWidget) { m_dwStatus &= ~XFA_WidgetStatus_TextEditValueChanged; if (!IsFocused()) { m_dwStatus |= XFA_WidgetStatus_Focused; @@ -167,9 +165,9 @@ FX_BOOL CXFA_FFTextEdit::OnSetFocus(CXFA_FFWidget* pOldWidget) { ms.m_pDstTarget = m_pNormalWidget->GetWidget(); ms.m_pSrcTarget = nullptr; TranslateFWLMessage(&ms); - return TRUE; + return true; } -FX_BOOL CXFA_FFTextEdit::OnKillFocus(CXFA_FFWidget* pNewWidget) { +bool CXFA_FFTextEdit::OnKillFocus(CXFA_FFWidget* pNewWidget) { CFWL_MsgKillFocus ms; ms.m_pDstTarget = m_pNormalWidget->GetWidget(); ms.m_pSrcTarget = nullptr; @@ -181,17 +179,17 @@ FX_BOOL CXFA_FFTextEdit::OnKillFocus(CXFA_FFWidget* pNewWidget) { AddInvalidateRect(); CXFA_FFWidget::OnKillFocus(pNewWidget); m_dwStatus &= ~XFA_WidgetStatus_TextEditValueChanged; - return TRUE; + return true; } -FX_BOOL CXFA_FFTextEdit::CommitData() { +bool CXFA_FFTextEdit::CommitData() { CFX_WideString wsText; ((CFWL_Edit*)m_pNormalWidget)->GetText(wsText); if (m_pDataAcc->SetValue(wsText, XFA_VALUEPICTURE_Edit)) { m_pDataAcc->UpdateUIDisplay(this); - return TRUE; + return true; } ValidateNumberField(wsText); - return FALSE; + return false; } void CXFA_FFTextEdit::ValidateNumberField(const CFX_WideString& wsText) { CXFA_WidgetAcc* pAcc = GetDataAcc(); @@ -210,7 +208,7 @@ void CXFA_FFTextEdit::ValidateNumberField(const CFX_WideString& wsText) { } } } -FX_BOOL CXFA_FFTextEdit::IsDataChanged() { +bool CXFA_FFTextEdit::IsDataChanged() { return (m_dwStatus & XFA_WidgetStatus_TextEditValueChanged) != 0; } uint32_t CXFA_FFTextEdit::GetAlignment() { @@ -250,15 +248,15 @@ uint32_t CXFA_FFTextEdit::GetAlignment() { } return dwExtendedStyle; } -FX_BOOL CXFA_FFTextEdit::UpdateFWLData() { +bool CXFA_FFTextEdit::UpdateFWLData() { if (!m_pNormalWidget) { - return FALSE; + return false; } XFA_VALUEPICTURE eType = XFA_VALUEPICTURE_Display; if (IsFocused()) { eType = XFA_VALUEPICTURE_Edit; } - FX_BOOL bUpdate = FALSE; + bool bUpdate = false; if (m_pDataAcc->GetUIType() == XFA_Element::TextEdit && m_pDataAcc->GetNumberOfCells() < 0) { XFA_Element elementType = XFA_Element::Unknown; @@ -268,7 +266,7 @@ FX_BOOL CXFA_FFTextEdit::UpdateFWLData() { } if (((CFWL_Edit*)m_pNormalWidget)->GetLimit() != iMaxChars) { ((CFWL_Edit*)m_pNormalWidget)->SetLimit(iMaxChars); - bUpdate = TRUE; + bUpdate = true; } } if (m_pDataAcc->GetUIType() == XFA_Element::Barcode) { @@ -276,7 +274,7 @@ FX_BOOL CXFA_FFTextEdit::UpdateFWLData() { if (eType == XFA_VALUEPICTURE_Edit) m_pDataAcc->GetBarcodeAttribute_DataLength(nDataLen); static_cast<CFWL_Edit*>(m_pNormalWidget)->SetLimit(nDataLen); - bUpdate = TRUE; + bUpdate = true; } CFX_WideString wsText; m_pDataAcc->GetValue(wsText, eType); @@ -284,76 +282,74 @@ FX_BOOL CXFA_FFTextEdit::UpdateFWLData() { ((CFWL_Edit*)m_pNormalWidget)->GetText(wsOldText); if (wsText != wsOldText || (eType == XFA_VALUEPICTURE_Edit && bUpdate)) { ((CFWL_Edit*)m_pNormalWidget)->SetText(wsText); - bUpdate = TRUE; + bUpdate = true; } if (bUpdate) { m_pNormalWidget->Update(); } - return TRUE; + return true; } -FX_BOOL CXFA_FFTextEdit::CanUndo() { +bool CXFA_FFTextEdit::CanUndo() { return ((CFWL_Edit*)m_pNormalWidget)->CanUndo(); } -FX_BOOL CXFA_FFTextEdit::CanRedo() { +bool CXFA_FFTextEdit::CanRedo() { return ((CFWL_Edit*)m_pNormalWidget)->CanRedo(); } -FX_BOOL CXFA_FFTextEdit::Undo() { +bool CXFA_FFTextEdit::Undo() { return ((CFWL_Edit*)m_pNormalWidget)->Undo(); } -FX_BOOL CXFA_FFTextEdit::Redo() { +bool CXFA_FFTextEdit::Redo() { return ((CFWL_Edit*)m_pNormalWidget)->Redo(); } -FX_BOOL CXFA_FFTextEdit::CanCopy() { +bool CXFA_FFTextEdit::CanCopy() { int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges(); return nCount > 0; } -FX_BOOL CXFA_FFTextEdit::CanCut() { +bool CXFA_FFTextEdit::CanCut() { if (m_pNormalWidget->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly) { - return FALSE; + return false; } int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges(); return nCount > 0; } -FX_BOOL CXFA_FFTextEdit::CanPaste() { +bool CXFA_FFTextEdit::CanPaste() { return m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open; } -FX_BOOL CXFA_FFTextEdit::CanSelectAll() { +bool CXFA_FFTextEdit::CanSelectAll() { return ((CFWL_Edit*)m_pNormalWidget)->GetTextLength() > 0; } -FX_BOOL CXFA_FFTextEdit::Copy(CFX_WideString& wsCopy) { +bool CXFA_FFTextEdit::Copy(CFX_WideString& wsCopy) { return ((CFWL_Edit*)m_pNormalWidget)->Copy(wsCopy); } -FX_BOOL CXFA_FFTextEdit::Cut(CFX_WideString& wsCut) { +bool CXFA_FFTextEdit::Cut(CFX_WideString& wsCut) { return ((CFWL_Edit*)m_pNormalWidget)->Cut(wsCut); } -FX_BOOL CXFA_FFTextEdit::Paste(const CFX_WideString& wsPaste) { +bool CXFA_FFTextEdit::Paste(const CFX_WideString& wsPaste) { return ((CFWL_Edit*)m_pNormalWidget)->Paste(wsPaste); } -FX_BOOL CXFA_FFTextEdit::SelectAll() { +bool CXFA_FFTextEdit::SelectAll() { int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->GetTextLength(); return ((CFWL_Edit*)m_pNormalWidget)->AddSelRange(0, nCount) >= 0; } -FX_BOOL CXFA_FFTextEdit::Delete() { +bool CXFA_FFTextEdit::Delete() { return ((CFWL_Edit*)m_pNormalWidget)->Delete(); } -FX_BOOL CXFA_FFTextEdit::DeSelect() { +bool CXFA_FFTextEdit::DeSelect() { return ((CFWL_Edit*)m_pNormalWidget)->ClearSelections() == FWL_Error::Succeeded; } -FX_BOOL CXFA_FFTextEdit::GetSuggestWords( - CFX_PointF pointf, - std::vector<CFX_ByteString>& sSuggest) { +bool CXFA_FFTextEdit::GetSuggestWords(CFX_PointF pointf, + std::vector<CFX_ByteString>& sSuggest) { if (m_pDataAcc->GetUIType() != XFA_Element::TextEdit) { - return FALSE; + return false; } FWLToClient(pointf.x, pointf.y); return ((CFWL_Edit*)m_pNormalWidget)->GetSuggestWords(pointf, sSuggest); } -FX_BOOL CXFA_FFTextEdit::ReplaceSpellCheckWord( - CFX_PointF pointf, - const CFX_ByteStringC& bsReplace) { +bool CXFA_FFTextEdit::ReplaceSpellCheckWord(CFX_PointF pointf, + const CFX_ByteStringC& bsReplace) { if (m_pDataAcc->GetUIType() != XFA_Element::TextEdit) { - return FALSE; + return false; } FWLToClient(pointf.x, pointf.y); return ((CFWL_Edit*)m_pNormalWidget) @@ -392,10 +388,10 @@ void CXFA_FFTextEdit::OnTextFull(IFWL_Widget* pWidget) { m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Full, &eParam); } -FX_BOOL CXFA_FFTextEdit::CheckWord(const CFX_ByteStringC& sWord) { +bool CXFA_FFTextEdit::CheckWord(const CFX_ByteStringC& sWord) { if (sWord.IsEmpty() || m_pDataAcc->GetUIType() != XFA_Element::TextEdit) - return TRUE; - return FALSE; + return true; + return false; } void CXFA_FFTextEdit::OnProcessMessage(CFWL_Message* pMessage) { @@ -423,7 +419,7 @@ void CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) { } case CFWL_EventType::GetSuggestedWords: { CFWL_EvtEdtGetSuggestWords* event = (CFWL_EvtEdtGetSuggestWords*)pEvent; - event->bSuggestWords = FALSE; + event->bSuggestWords = false; break; } default: @@ -441,7 +437,7 @@ CXFA_FFNumericEdit::CXFA_FFNumericEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) : CXFA_FFTextEdit(pPageView, pDataAcc) {} CXFA_FFNumericEdit::~CXFA_FFNumericEdit() {} -FX_BOOL CXFA_FFNumericEdit::LoadWidget() { +bool CXFA_FFNumericEdit::LoadWidget() { CFWL_Edit* pWidget = new CFWL_Edit(GetFWLApp()); pWidget->Initialize(); m_pNormalWidget = pWidget; @@ -498,12 +494,12 @@ void CXFA_FFNumericEdit::OnProcessEvent(CFWL_Event* pEvent) { CXFA_FFTextEdit::OnProcessEvent(pEvent); } -FX_BOOL CXFA_FFNumericEdit::OnValidate(IFWL_Widget* pWidget, - CFX_WideString& wsText) { +bool CXFA_FFNumericEdit::OnValidate(IFWL_Widget* pWidget, + CFX_WideString& wsText) { CFX_WideString wsPattern; m_pDataAcc->GetPictureContent(wsPattern, XFA_VALUEPICTURE_Edit); if (!wsPattern.IsEmpty()) { - return TRUE; + return true; } int32_t iLeads = 0; m_pDataAcc->GetLeadDigits(iLeads); @@ -521,7 +517,7 @@ CXFA_FFPasswordEdit::CXFA_FFPasswordEdit(CXFA_FFPageView* pPageView, CXFA_FFPasswordEdit::~CXFA_FFPasswordEdit() {} -FX_BOOL CXFA_FFPasswordEdit::LoadWidget() { +bool CXFA_FFPasswordEdit::LoadWidget() { CFWL_Edit* pWidget = new CFWL_Edit(GetFWLApp()); pWidget->Initialize(); m_pNormalWidget = pWidget; @@ -572,26 +568,26 @@ CXFA_FFDateTimeEdit::CXFA_FFDateTimeEdit(CXFA_FFPageView* pPageView, CXFA_FFDateTimeEdit::~CXFA_FFDateTimeEdit() {} -FX_BOOL CXFA_FFDateTimeEdit::GetBBox(CFX_RectF& rtBox, - uint32_t dwStatus, - FX_BOOL bDrawFocus) { +bool CXFA_FFDateTimeEdit::GetBBox(CFX_RectF& rtBox, + uint32_t dwStatus, + bool bDrawFocus) { if (bDrawFocus) - return FALSE; + return false; return CXFA_FFWidget::GetBBox(rtBox, dwStatus); } -FX_BOOL CXFA_FFDateTimeEdit::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { +bool CXFA_FFDateTimeEdit::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { if (!m_pNormalWidget) { - return FALSE; + return false; } CFX_RectF rtWidget; ((CFWL_DateTimePicker*)m_pNormalWidget)->GetBBox(rtWidget); if (rtWidget.Contains(fx, fy)) { - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_FFDateTimeEdit::LoadWidget() { +bool CXFA_FFDateTimeEdit::LoadWidget() { CFWL_DateTimePicker* pWidget = new CFWL_DateTimePicker(GetFWLApp()); pWidget->Initialize(); m_pNormalWidget = pWidget; @@ -687,18 +683,18 @@ uint32_t CXFA_FFDateTimeEdit::GetAlignment() { } return dwExtendedStyle; } -FX_BOOL CXFA_FFDateTimeEdit::CommitData() { +bool CXFA_FFDateTimeEdit::CommitData() { CFX_WideString wsText; ((CFWL_DateTimePicker*)m_pNormalWidget)->GetEditText(wsText); if (m_pDataAcc->SetValue(wsText, XFA_VALUEPICTURE_Edit)) { m_pDataAcc->UpdateUIDisplay(this); - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CXFA_FFDateTimeEdit::UpdateFWLData() { +bool CXFA_FFDateTimeEdit::UpdateFWLData() { if (!m_pNormalWidget) { - return FALSE; + return false; } XFA_VALUEPICTURE eType = XFA_VALUEPICTURE_Display; if (IsFocused()) { @@ -718,11 +714,11 @@ FX_BOOL CXFA_FFDateTimeEdit::UpdateFWLData() { } } m_pNormalWidget->Update(); - return TRUE; + return true; } -FX_BOOL CXFA_FFDateTimeEdit::IsDataChanged() { +bool CXFA_FFDateTimeEdit::IsDataChanged() { if (m_dwStatus & XFA_WidgetStatus_TextEditValueChanged) { - return TRUE; + return true; } CFX_WideString wsText; ((CFWL_DateTimePicker*)m_pNormalWidget)->GetEditText(wsText); @@ -730,49 +726,49 @@ FX_BOOL CXFA_FFDateTimeEdit::IsDataChanged() { m_pDataAcc->GetValue(wsOldValue, XFA_VALUEPICTURE_Edit); return wsOldValue != wsText; } -FX_BOOL CXFA_FFDateTimeEdit::CanUndo() { +bool CXFA_FFDateTimeEdit::CanUndo() { return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanUndo(); } -FX_BOOL CXFA_FFDateTimeEdit::CanRedo() { +bool CXFA_FFDateTimeEdit::CanRedo() { return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanRedo(); } -FX_BOOL CXFA_FFDateTimeEdit::Undo() { +bool CXFA_FFDateTimeEdit::Undo() { return ((CFWL_DateTimePicker*)m_pNormalWidget)->Undo(); } -FX_BOOL CXFA_FFDateTimeEdit::Redo() { +bool CXFA_FFDateTimeEdit::Redo() { return ((CFWL_DateTimePicker*)m_pNormalWidget)->Redo(); } -FX_BOOL CXFA_FFDateTimeEdit::CanCopy() { +bool CXFA_FFDateTimeEdit::CanCopy() { return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanCopy(); } -FX_BOOL CXFA_FFDateTimeEdit::CanCut() { +bool CXFA_FFDateTimeEdit::CanCut() { if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { - return FALSE; + return false; } return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanCut(); } -FX_BOOL CXFA_FFDateTimeEdit::CanPaste() { +bool CXFA_FFDateTimeEdit::CanPaste() { return m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open; } -FX_BOOL CXFA_FFDateTimeEdit::CanSelectAll() { +bool CXFA_FFDateTimeEdit::CanSelectAll() { return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanSelectAll(); } -FX_BOOL CXFA_FFDateTimeEdit::Copy(CFX_WideString& wsCopy) { +bool CXFA_FFDateTimeEdit::Copy(CFX_WideString& wsCopy) { return ((CFWL_DateTimePicker*)m_pNormalWidget)->Copy(wsCopy); } -FX_BOOL CXFA_FFDateTimeEdit::Cut(CFX_WideString& wsCut) { +bool CXFA_FFDateTimeEdit::Cut(CFX_WideString& wsCut) { return ((CFWL_DateTimePicker*)m_pNormalWidget)->Cut(wsCut); } -FX_BOOL CXFA_FFDateTimeEdit::Paste(const CFX_WideString& wsPaste) { +bool CXFA_FFDateTimeEdit::Paste(const CFX_WideString& wsPaste) { return ((CFWL_DateTimePicker*)m_pNormalWidget)->Paste(wsPaste); } -FX_BOOL CXFA_FFDateTimeEdit::SelectAll() { +bool CXFA_FFDateTimeEdit::SelectAll() { return ((CFWL_DateTimePicker*)m_pNormalWidget)->SelectAll(); } -FX_BOOL CXFA_FFDateTimeEdit::Delete() { +bool CXFA_FFDateTimeEdit::Delete() { return ((CFWL_DateTimePicker*)m_pNormalWidget)->Delete(); } -FX_BOOL CXFA_FFDateTimeEdit::DeSelect() { +bool CXFA_FFDateTimeEdit::DeSelect() { return ((CFWL_DateTimePicker*)m_pNormalWidget)->DeSelect(); } void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget* pWidget, diff --git a/xfa/fxfa/app/xfa_fftextedit.h b/xfa/fxfa/app/xfa_fftextedit.h index 048008d700..917d6cf17e 100644 --- a/xfa/fxfa/app/xfa_fftextedit.h +++ b/xfa/fxfa/app/xfa_fftextedit.h @@ -17,31 +17,31 @@ class CXFA_FFTextEdit : public CXFA_FFField { ~CXFA_FFTextEdit() override; // CXFA_FFField - FX_BOOL LoadWidget() override; + bool LoadWidget() override; void UpdateWidgetProperty() override; - FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget) override; - FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override; - FX_BOOL CanUndo() override; - FX_BOOL CanRedo() override; - FX_BOOL Undo() override; - FX_BOOL Redo() override; - FX_BOOL CanCopy() override; - FX_BOOL CanCut() override; - FX_BOOL CanPaste() override; - FX_BOOL CanSelectAll() override; - FX_BOOL Copy(CFX_WideString& wsCopy) override; - FX_BOOL Cut(CFX_WideString& wsCut) override; - FX_BOOL Paste(const CFX_WideString& wsPaste) override; - FX_BOOL SelectAll() override; - FX_BOOL Delete() override; - FX_BOOL DeSelect() override; - FX_BOOL GetSuggestWords(CFX_PointF pointf, - std::vector<CFX_ByteString>& sSuggest) override; - FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, - const CFX_ByteStringC& bsReplace) override; + bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; + bool OnSetFocus(CXFA_FFWidget* pOldWidget) override; + bool OnKillFocus(CXFA_FFWidget* pNewWidget) override; + bool CanUndo() override; + bool CanRedo() override; + bool Undo() override; + bool Redo() override; + bool CanCopy() override; + bool CanCut() override; + bool CanPaste() override; + bool CanSelectAll() override; + bool Copy(CFX_WideString& wsCopy) override; + bool Cut(CFX_WideString& wsCut) override; + bool Paste(const CFX_WideString& wsPaste) override; + bool SelectAll() override; + bool Delete() override; + bool DeSelect() override; + bool GetSuggestWords(CFX_PointF pointf, + std::vector<CFX_ByteString>& sSuggest) override; + bool ReplaceSpellCheckWord(CFX_PointF pointf, + const CFX_ByteStringC& bsReplace) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, @@ -51,12 +51,12 @@ class CXFA_FFTextEdit : public CXFA_FFField { const CFX_WideString& wsChanged, const CFX_WideString& wsPrevText); void OnTextFull(IFWL_Widget* pWidget); - FX_BOOL CheckWord(const CFX_ByteStringC& sWord); + bool CheckWord(const CFX_ByteStringC& sWord); protected: - FX_BOOL CommitData() override; - FX_BOOL UpdateFWLData() override; - FX_BOOL IsDataChanged() override; + bool CommitData() override; + bool UpdateFWLData() override; + bool IsDataChanged() override; uint32_t GetAlignment(); void ValidateNumberField(const CFX_WideString& wsText); @@ -70,12 +70,12 @@ class CXFA_FFNumericEdit : public CXFA_FFTextEdit { ~CXFA_FFNumericEdit() override; // CXFA_FFTextEdit - FX_BOOL LoadWidget() override; + bool LoadWidget() override; void UpdateWidgetProperty() override; void OnProcessEvent(CFWL_Event* pEvent) override; public: - FX_BOOL OnValidate(IFWL_Widget* pWidget, CFX_WideString& wsText); + bool OnValidate(IFWL_Widget* pWidget, CFX_WideString& wsText); }; class CXFA_FFPasswordEdit : public CXFA_FFTextEdit { @@ -84,7 +84,7 @@ class CXFA_FFPasswordEdit : public CXFA_FFTextEdit { ~CXFA_FFPasswordEdit() override; // CXFA_FFTextEdit - FX_BOOL LoadWidget() override; + bool LoadWidget() override; void UpdateWidgetProperty() override; protected: @@ -102,26 +102,26 @@ class CXFA_FFDateTimeEdit : public CXFA_FFTextEdit { ~CXFA_FFDateTimeEdit() override; // CXFA_FFTextEdit - FX_BOOL GetBBox(CFX_RectF& rtBox, - uint32_t dwStatus, - FX_BOOL bDrawFocus = FALSE) override; - FX_BOOL LoadWidget() override; + bool GetBBox(CFX_RectF& rtBox, + uint32_t dwStatus, + bool bDrawFocus = false) override; + bool LoadWidget() override; void UpdateWidgetProperty() override; - FX_BOOL CanUndo() override; - FX_BOOL CanRedo() override; - FX_BOOL Undo() override; - FX_BOOL Redo() override; - FX_BOOL CanCopy() override; - FX_BOOL CanCut() override; - FX_BOOL CanPaste() override; - FX_BOOL CanSelectAll() override; - FX_BOOL Copy(CFX_WideString& wsCopy) override; - FX_BOOL Cut(CFX_WideString& wsCut) override; - FX_BOOL Paste(const CFX_WideString& wsPaste) override; - FX_BOOL SelectAll() override; - FX_BOOL Delete() override; - FX_BOOL DeSelect() override; + bool CanUndo() override; + bool CanRedo() override; + bool Undo() override; + bool Redo() override; + bool CanCopy() override; + bool CanCut() override; + bool CanPaste() override; + bool CanSelectAll() override; + bool Copy(CFX_WideString& wsCopy) override; + bool Cut(CFX_WideString& wsCut) override; + bool Paste(const CFX_WideString& wsPaste) override; + bool SelectAll() override; + bool Delete() override; + bool DeSelect() override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnSelectChanged(IFWL_Widget* pWidget, @@ -130,10 +130,10 @@ class CXFA_FFDateTimeEdit : public CXFA_FFTextEdit { int32_t iDay); protected: - FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override; - FX_BOOL CommitData() override; - FX_BOOL UpdateFWLData() override; - FX_BOOL IsDataChanged() override; + bool PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override; + bool CommitData() override; + bool UpdateFWLData() override; + bool IsDataChanged() override; uint32_t GetAlignment(); }; diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp index a21fbcab62..89b3053b57 100644 --- a/xfa/fxfa/app/xfa_ffwidget.cpp +++ b/xfa/fxfa/app/xfa_ffwidget.cpp @@ -91,21 +91,21 @@ void CXFA_FFWidget::ModifyStatus(uint32_t dwAdded, uint32_t dwRemoved) { m_dwStatus = (m_dwStatus & ~dwRemoved) | dwAdded; } -FX_BOOL CXFA_FFWidget::GetBBox(CFX_RectF& rtBox, - uint32_t dwStatus, - FX_BOOL bDrawFocus) { +bool CXFA_FFWidget::GetBBox(CFX_RectF& rtBox, + uint32_t dwStatus, + bool bDrawFocus) { if (bDrawFocus) - return FALSE; + return false; if (m_pPageView) m_pPageView->GetPageViewRect(rtBox); - return TRUE; + return true; } CXFA_WidgetAcc* CXFA_FFWidget::GetDataAcc() { return m_pDataAcc; } -FX_BOOL CXFA_FFWidget::GetToolTip(CFX_WideString& wsToolTip) { +bool CXFA_FFWidget::GetToolTip(CFX_WideString& wsToolTip) { if (CXFA_Assist assist = m_pDataAcc->GetAssist()) { if (CXFA_ToolTip toolTip = assist.GetToolTip()) { return toolTip.GetTip(wsToolTip); @@ -131,20 +131,20 @@ void CXFA_FFWidget::RenderWidget(CFX_Graphics* pGS, DrawBorder(pGS, border, rtBorder, pMatrix); } } -FX_BOOL CXFA_FFWidget::IsLoaded() { +bool CXFA_FFWidget::IsLoaded() { return !!m_pPageView; } -FX_BOOL CXFA_FFWidget::LoadWidget() { +bool CXFA_FFWidget::LoadWidget() { PerformLayout(); - return TRUE; + return true; } void CXFA_FFWidget::UnloadWidget() {} -FX_BOOL CXFA_FFWidget::PerformLayout() { +bool CXFA_FFWidget::PerformLayout() { ReCacheWidgetRect(); - return TRUE; + return true; } -FX_BOOL CXFA_FFWidget::UpdateFWLData() { - return FALSE; +bool CXFA_FFWidget::UpdateFWLData() { + return false; } void CXFA_FFWidget::UpdateWidgetProperty() {} void CXFA_FFWidget::DrawBorder(CFX_Graphics* pGS, @@ -176,62 +176,58 @@ void CXFA_FFWidget::AddInvalidateRect(const CFX_RectF* pRect) { } m_pDocView->AddInvalidateRect(m_pPageView, rtWidget); } -FX_BOOL CXFA_FFWidget::GetCaptionText(CFX_WideString& wsCap) { +bool CXFA_FFWidget::GetCaptionText(CFX_WideString& wsCap) { CXFA_TextLayout* pCapTextlayout = m_pDataAcc->GetCaptionTextLayout(); if (!pCapTextlayout) { - return FALSE; + return false; } pCapTextlayout->GetText(wsCap); - return TRUE; + return true; } bool CXFA_FFWidget::IsFocused() { return !!(m_dwStatus & XFA_WidgetStatus_Focused); } -FX_BOOL CXFA_FFWidget::OnMouseEnter() { - return FALSE; +bool CXFA_FFWidget::OnMouseEnter() { + return false; } -FX_BOOL CXFA_FFWidget::OnMouseExit() { - return FALSE; +bool CXFA_FFWidget::OnMouseExit() { + return false; } -FX_BOOL CXFA_FFWidget::OnLButtonDown(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { - return FALSE; +bool CXFA_FFWidget::OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { + return false; } -FX_BOOL CXFA_FFWidget::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { - return FALSE; +bool CXFA_FFWidget::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { + return false; } -FX_BOOL CXFA_FFWidget::OnLButtonDblClk(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { - return FALSE; -} -FX_BOOL CXFA_FFWidget::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { - return FALSE; -} -FX_BOOL CXFA_FFWidget::OnMouseWheel(uint32_t dwFlags, - int16_t zDelta, +bool CXFA_FFWidget::OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { - return FALSE; + return false; +} +bool CXFA_FFWidget::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { + return false; +} +bool CXFA_FFWidget::OnMouseWheel(uint32_t dwFlags, + int16_t zDelta, + FX_FLOAT fx, + FX_FLOAT fy) { + return false; } -FX_BOOL CXFA_FFWidget::OnRButtonDown(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { - return FALSE; +bool CXFA_FFWidget::OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { + return false; } -FX_BOOL CXFA_FFWidget::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { - return FALSE; +bool CXFA_FFWidget::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { + return false; } -FX_BOOL CXFA_FFWidget::OnRButtonDblClk(uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { - return FALSE; +bool CXFA_FFWidget::OnRButtonDblClk(uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { + return false; } -FX_BOOL CXFA_FFWidget::OnSetFocus(CXFA_FFWidget* pOldWidget) { +bool CXFA_FFWidget::OnSetFocus(CXFA_FFWidget* pOldWidget) { CXFA_FFWidget* pParent = GetParent(); if (pParent && !pParent->IsAncestorOf(pOldWidget)) { pParent->OnSetFocus(pOldWidget); @@ -241,9 +237,9 @@ FX_BOOL CXFA_FFWidget::OnSetFocus(CXFA_FFWidget* pOldWidget) { eParam.m_eType = XFA_EVENT_Enter; eParam.m_pTarget = m_pDataAcc; m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Enter, &eParam); - return TRUE; + return true; } -FX_BOOL CXFA_FFWidget::OnKillFocus(CXFA_FFWidget* pNewWidget) { +bool CXFA_FFWidget::OnKillFocus(CXFA_FFWidget* pNewWidget) { m_dwStatus &= ~XFA_WidgetStatus_Focused; EventKillFocus(); if (pNewWidget) { @@ -252,78 +248,78 @@ FX_BOOL CXFA_FFWidget::OnKillFocus(CXFA_FFWidget* pNewWidget) { pParent->OnKillFocus(pNewWidget); } } - return TRUE; + return true; } -FX_BOOL CXFA_FFWidget::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { - return FALSE; +bool CXFA_FFWidget::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { + return false; } -FX_BOOL CXFA_FFWidget::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { - return FALSE; +bool CXFA_FFWidget::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { + return false; } -FX_BOOL CXFA_FFWidget::OnChar(uint32_t dwChar, uint32_t dwFlags) { - return FALSE; +bool CXFA_FFWidget::OnChar(uint32_t dwChar, uint32_t dwFlags) { + return false; } FWL_WidgetHit CXFA_FFWidget::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { return FWL_WidgetHit::Unknown; } -FX_BOOL CXFA_FFWidget::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { - return FALSE; +bool CXFA_FFWidget::OnSetCursor(FX_FLOAT fx, FX_FLOAT fy) { + return false; } -FX_BOOL CXFA_FFWidget::CanUndo() { - return FALSE; +bool CXFA_FFWidget::CanUndo() { + return false; } -FX_BOOL CXFA_FFWidget::CanRedo() { - return FALSE; +bool CXFA_FFWidget::CanRedo() { + return false; } -FX_BOOL CXFA_FFWidget::Undo() { - return FALSE; +bool CXFA_FFWidget::Undo() { + return false; } -FX_BOOL CXFA_FFWidget::Redo() { - return FALSE; +bool CXFA_FFWidget::Redo() { + return false; } -FX_BOOL CXFA_FFWidget::CanCopy() { - return FALSE; +bool CXFA_FFWidget::CanCopy() { + return false; } -FX_BOOL CXFA_FFWidget::CanCut() { - return FALSE; +bool CXFA_FFWidget::CanCut() { + return false; } -FX_BOOL CXFA_FFWidget::CanPaste() { - return FALSE; +bool CXFA_FFWidget::CanPaste() { + return false; } -FX_BOOL CXFA_FFWidget::CanSelectAll() { - return FALSE; +bool CXFA_FFWidget::CanSelectAll() { + return false; } -FX_BOOL CXFA_FFWidget::CanDelete() { +bool CXFA_FFWidget::CanDelete() { return CanCut(); } -FX_BOOL CXFA_FFWidget::CanDeSelect() { +bool CXFA_FFWidget::CanDeSelect() { return CanCopy(); } -FX_BOOL CXFA_FFWidget::Copy(CFX_WideString& wsCopy) { - return FALSE; +bool CXFA_FFWidget::Copy(CFX_WideString& wsCopy) { + return false; } -FX_BOOL CXFA_FFWidget::Cut(CFX_WideString& wsCut) { - return FALSE; +bool CXFA_FFWidget::Cut(CFX_WideString& wsCut) { + return false; } -FX_BOOL CXFA_FFWidget::Paste(const CFX_WideString& wsPaste) { - return FALSE; +bool CXFA_FFWidget::Paste(const CFX_WideString& wsPaste) { + return false; } -FX_BOOL CXFA_FFWidget::SelectAll() { - return FALSE; +bool CXFA_FFWidget::SelectAll() { + return false; } -FX_BOOL CXFA_FFWidget::Delete() { - return FALSE; +bool CXFA_FFWidget::Delete() { + return false; } -FX_BOOL CXFA_FFWidget::DeSelect() { - return FALSE; +bool CXFA_FFWidget::DeSelect() { + return false; } -FX_BOOL CXFA_FFWidget::GetSuggestWords(CFX_PointF pointf, - std::vector<CFX_ByteString>& sSuggest) { - return FALSE; +bool CXFA_FFWidget::GetSuggestWords(CFX_PointF pointf, + std::vector<CFX_ByteString>& sSuggest) { + return false; } -FX_BOOL CXFA_FFWidget::ReplaceSpellCheckWord(CFX_PointF pointf, - const CFX_ByteStringC& bsReplace) { - return FALSE; +bool CXFA_FFWidget::ReplaceSpellCheckWord(CFX_PointF pointf, + const CFX_ByteStringC& bsReplace) { + return false; } void CXFA_FFWidget::Rotate2Normal(FX_FLOAT& fx, FX_FLOAT& fy) { CFX_Matrix mt; @@ -402,7 +398,7 @@ void CXFA_FFWidget::GetRotateMatrix(CFX_Matrix& mt) { XFA_ATTRIBUTEENUM at = XFA_ATTRIBUTEENUM_TopLeft; XFA_GetMatrix(mt, iRotate, at, rcWidget); } -FX_BOOL CXFA_FFWidget::IsLayoutRectEmpty() { +bool CXFA_FFWidget::IsLayoutRectEmpty() { CFX_RectF rtLayout; GetRectWithoutRotate(rtLayout); return rtLayout.width < 0.1f && rtLayout.height < 0.1f; @@ -419,27 +415,27 @@ CXFA_FFWidget* CXFA_FFWidget::GetParent() { } return nullptr; } -FX_BOOL CXFA_FFWidget::IsAncestorOf(CXFA_FFWidget* pWidget) { +bool CXFA_FFWidget::IsAncestorOf(CXFA_FFWidget* pWidget) { if (!pWidget) { - return FALSE; + return false; } CXFA_Node* pNode = m_pDataAcc->GetNode(); CXFA_Node* pChildNode = pWidget->GetDataAcc()->GetNode(); while (pChildNode) { if (pChildNode == pNode) { - return TRUE; + return true; } pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_Parent); } - return FALSE; + return false; } -FX_BOOL CXFA_FFWidget::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { +bool CXFA_FFWidget::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) { CFX_RectF rtWidget; GetWidgetRect(rtWidget); if (rtWidget.Contains(fx, fy)) { - return TRUE; + return true; } - return FALSE; + return false; } CXFA_FFDocView* CXFA_FFWidget::GetDocView() { return m_pDocView; @@ -491,10 +487,10 @@ void CXFA_FFWidget::EventKillFocus() { eParam.m_pTarget = m_pDataAcc; m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Exit, &eParam); } -FX_BOOL CXFA_FFWidget::IsButtonDown() { +bool CXFA_FFWidget::IsButtonDown() { return (m_dwStatus & XFA_WidgetStatus_ButtonDown) != 0; } -void CXFA_FFWidget::SetButtonDown(FX_BOOL bSet) { +void CXFA_FFWidget::SetButtonDown(bool bSet) { bSet ? m_dwStatus |= XFA_WidgetStatus_ButtonDown : m_dwStatus &= ~XFA_WidgetStatus_ButtonDown; } @@ -560,17 +556,17 @@ class CXFA_ImageRenderer { CXFA_ImageRenderer(); ~CXFA_ImageRenderer(); - FX_BOOL Start(CFX_RenderDevice* pDevice, - CFX_DIBSource* pDIBSource, - FX_ARGB bitmap_argb, - int bitmap_alpha, - const CFX_Matrix* pImage2Device, - uint32_t flags, - int blendType = FXDIB_BLEND_NORMAL); - FX_BOOL Continue(IFX_Pause* pPause); + bool Start(CFX_RenderDevice* pDevice, + CFX_DIBSource* pDIBSource, + FX_ARGB bitmap_argb, + int bitmap_alpha, + const CFX_Matrix* pImage2Device, + uint32_t flags, + int blendType = FXDIB_BLEND_NORMAL); + bool Continue(IFX_Pause* pPause); protected: - FX_BOOL StartDIBSource(); + bool StartDIBSource(); void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int top, @@ -590,8 +586,8 @@ class CXFA_ImageRenderer { std::unique_ptr<CFX_ImageTransformer> m_pTransformer; void* m_DeviceHandle; int32_t m_BlendType; - FX_BOOL m_Result; - FX_BOOL m_bPrint; + bool m_Result; + bool m_bPrint; }; CXFA_ImageRenderer::CXFA_ImageRenderer() @@ -603,21 +599,21 @@ CXFA_ImageRenderer::CXFA_ImageRenderer() m_Flags(0), m_DeviceHandle(nullptr), m_BlendType(FXDIB_BLEND_NORMAL), - m_Result(TRUE), - m_bPrint(FALSE) {} + m_Result(true), + m_bPrint(false) {} CXFA_ImageRenderer::~CXFA_ImageRenderer() { if (m_DeviceHandle) m_pDevice->CancelDIBits(m_DeviceHandle); } -FX_BOOL CXFA_ImageRenderer::Start(CFX_RenderDevice* pDevice, - CFX_DIBSource* pDIBSource, - FX_ARGB bitmap_argb, - int bitmap_alpha, - const CFX_Matrix* pImage2Device, - uint32_t flags, - int blendType) { +bool CXFA_ImageRenderer::Start(CFX_RenderDevice* pDevice, + CFX_DIBSource* pDIBSource, + FX_ARGB bitmap_argb, + int bitmap_alpha, + const CFX_Matrix* pImage2Device, + uint32_t flags, + int blendType) { m_pDevice = pDevice; m_pDIBSource = pDIBSource; m_FillArgb = bitmap_argb; @@ -628,15 +624,15 @@ FX_BOOL CXFA_ImageRenderer::Start(CFX_RenderDevice* pDevice, return StartDIBSource(); } -FX_BOOL CXFA_ImageRenderer::StartDIBSource() { +bool CXFA_ImageRenderer::StartDIBSource() { if (m_pDevice->StartDIBitsWithBlend(m_pDIBSource, m_BitmapAlpha, m_FillArgb, &m_ImageMatrix, m_Flags, m_DeviceHandle, m_BlendType)) { if (m_DeviceHandle) { m_Status = 3; - return TRUE; + return true; } - return FALSE; + return false; } CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect(); FX_RECT image_rect = image_rect_f.GetOuterRect(); @@ -645,8 +641,8 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() { if ((FXSYS_fabs(m_ImageMatrix.b) >= 0.5f || m_ImageMatrix.a == 0) || (FXSYS_fabs(m_ImageMatrix.c) >= 0.5f || m_ImageMatrix.d == 0)) { if (m_bPrint && !(m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) { - m_Result = FALSE; - return FALSE; + m_Result = false; + return false; } CFX_DIBSource* pDib = m_pDIBSource; if (m_pDIBSource->HasAlpha() && @@ -654,8 +650,8 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() { !(m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) { m_pCloneConvert.reset(m_pDIBSource->CloneConvert(FXDIB_Rgb)); if (!m_pCloneConvert) { - m_Result = FALSE; - return FALSE; + m_Result = false; + return false; } pDib = m_pCloneConvert.get(); } @@ -665,7 +661,7 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() { m_pTransformer.reset( new CFX_ImageTransformer(pDib, &m_ImageMatrix, m_Flags, &clip_box)); m_pTransformer->Start(); - return TRUE; + return true; } if (m_ImageMatrix.a < 0) { dest_width = -dest_width; @@ -680,7 +676,7 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() { if (m_pDevice->StretchDIBitsWithFlagsAndBlend( m_pDIBSource, dest_left, dest_top, dest_width, dest_height, m_Flags, m_BlendType)) { - return FALSE; + return false; } } if (m_pDIBSource->IsAlphaMask()) { @@ -690,12 +686,12 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() { if (m_pDevice->StretchBitMaskWithFlags(m_pDIBSource, dest_left, dest_top, dest_width, dest_height, m_FillArgb, m_Flags)) { - return FALSE; + return false; } } if (m_bPrint && !(m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) { - m_Result = FALSE; - return TRUE; + m_Result = false; + return true; } FX_RECT clip_box = m_pDevice->GetClipBox(); FX_RECT dest_rect = clip_box; @@ -707,19 +703,19 @@ FX_BOOL CXFA_ImageRenderer::StartDIBSource() { m_pDIBSource->StretchTo(dest_width, dest_height, m_Flags, &dest_clip)); if (pStretched) { CompositeDIBitmap(pStretched.get(), dest_rect.left, dest_rect.top, - m_FillArgb, m_BitmapAlpha, m_BlendType, FALSE); + m_FillArgb, m_BitmapAlpha, m_BlendType, false); } - return FALSE; + return false; } -FX_BOOL CXFA_ImageRenderer::Continue(IFX_Pause* pPause) { +bool CXFA_ImageRenderer::Continue(IFX_Pause* pPause) { if (m_Status == 2) { if (m_pTransformer->Continue(pPause)) - return TRUE; + return true; std::unique_ptr<CFX_DIBitmap> pBitmap(m_pTransformer->DetachBitmap()); if (!pBitmap) - return FALSE; + return false; if (pBitmap->IsAlphaMask()) { if (m_BitmapAlpha != 255) @@ -734,12 +730,12 @@ FX_BOOL CXFA_ImageRenderer::Continue(IFX_Pause* pPause) { pBitmap.get(), m_pTransformer->result().left, m_pTransformer->result().top, m_BlendType); } - return FALSE; + return false; } if (m_Status == 3) return m_pDevice->ContinueDIBits(m_DeviceHandle, pPause); - return FALSE; + return false; } void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, @@ -773,8 +769,8 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, } } } - FX_BOOL bBackAlphaRequired = blend_mode && bIsolated; - FX_BOOL bGetBackGround = + bool bBackAlphaRequired = blend_mode && bIsolated; + bool bGetBackGround = ((m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT)) || (!(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT) && (m_pDevice->GetRenderCaps() & FXRC_GET_BITS) && !bBackAlphaRequired); @@ -789,9 +785,9 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, top + pDIBitmap->GetHeight()); rect.Intersect(m_pDevice->GetClipBox()); CFX_DIBitmap* pClone = nullptr; - FX_BOOL bClone = FALSE; + bool bClone = false; if (m_pDevice->GetBackDrop() && m_pDevice->GetBitmap()) { - bClone = TRUE; + bClone = true; pClone = m_pDevice->GetBackDrop()->Clone(&rect); CFX_DIBitmap* pForeBitmap = m_pDevice->GetBitmap(); pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(), @@ -828,8 +824,8 @@ void CXFA_ImageRenderer::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, return; } CXFA_ImageRenderer imageRender; - FX_BOOL bRet = imageRender.Start(m_pDevice, pCloneConvert, m_FillArgb, - m_BitmapAlpha, &m_ImageMatrix, m_Flags); + bool bRet = imageRender.Start(m_pDevice, pCloneConvert, m_FillArgb, + m_BitmapAlpha, &m_ImageMatrix, m_Flags); while (bRet) { bRet = imageRender.Continue(nullptr); } @@ -902,8 +898,8 @@ void XFA_DrawImage(CFX_Graphics* pGS, mtImage.Concat(rtFit.width, 0, 0, rtFit.height, rtFit.left, rtFit.top); mtImage.Concat(*pMatrix); CXFA_ImageRenderer imageRender; - FX_BOOL bRet = imageRender.Start(pRenderDevice, pDIBitmap, 0, 255, &mtImage, - FXDIB_INTERPOL); + bool bRet = imageRender.Start(pRenderDevice, pDIBitmap, 0, 255, &mtImage, + FXDIB_INTERPOL); while (bRet) { bRet = imageRender.Continue(nullptr); } @@ -1046,7 +1042,7 @@ FXCODEC_IMAGE_TYPE XFA_GetImageType(const CFX_WideString& wsType) { } CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc* pDoc, CXFA_Image* pImage, - FX_BOOL& bNameImage, + bool& bNameImage, int32_t& iImageXDpi, int32_t& iImageYDpi) { CFX_WideString wsHref; @@ -1085,7 +1081,7 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc* pDoc, CFX_DIBitmap* pBitmap = pDoc->GetPDFNamedImage(wsURL.AsStringC(), iImageXDpi, iImageYDpi); if (pBitmap) { - bNameImage = TRUE; + bNameImage = true; return pBitmap; } } @@ -1095,7 +1091,7 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc* pDoc, FX_Free(pImageBuffer); return nullptr; } - bNameImage = FALSE; + bNameImage = false; CFX_DIBitmap* pBitmap = XFA_LoadImageFromBuffer(pImageFileRead, type, iImageXDpi, iImageYDpi); FX_Free(pImageBuffer); @@ -1175,7 +1171,7 @@ CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_SeekableReadStream* pImageFileRead, delete pProgressiveDecoder; return pBitmap; } -void XFA_RectWidthoutMargin(CFX_RectF& rt, const CXFA_Margin& mg, FX_BOOL bUI) { +void XFA_RectWidthoutMargin(CFX_RectF& rt, const CXFA_Margin& mg, bool bUI) { if (!mg) { return; } @@ -1191,7 +1187,7 @@ CXFA_FFWidget* XFA_GetWidgetFromLayoutItem(CXFA_LayoutItem* pLayoutItem) { return static_cast<CXFA_FFWidget*>(pLayoutItem); return nullptr; } -FX_BOOL XFA_IsCreateWidget(XFA_Element eType) { +bool XFA_IsCreateWidget(XFA_Element eType) { return eType == XFA_Element::Field || eType == XFA_Element::Draw || eType == XFA_Element::Subform || eType == XFA_Element::ExclGroup; } @@ -1211,8 +1207,8 @@ static void XFA_BOX_GetPath_Arc(CXFA_Box box, rtDraw.width = a + a; rtDraw.height = b + b; FX_FLOAT startAngle = 0, sweepAngle = 360; - FX_BOOL bStart = box.GetStartAngle(startAngle); - FX_BOOL bEnd = box.GetSweepAngle(sweepAngle); + bool bStart = box.GetStartAngle(startAngle); + bool bEnd = box.GetSweepAngle(sweepAngle); if (!bStart && !bEnd) { fillPath.AddEllipse(rtDraw); return; @@ -1227,18 +1223,18 @@ static void XFA_BOX_GetPath(CXFA_Box box, CFX_RectF rtWidget, CFX_Path& path, int32_t nIndex, - FX_BOOL bStart, - FX_BOOL bCorner) { + bool bStart, + bool bCorner) { ASSERT(nIndex >= 0 && nIndex < 8); int32_t n = (nIndex & 1) ? nIndex - 1 : nIndex; CXFA_Corner corner1(strokes[n].GetNode()); CXFA_Corner corner2(strokes[(n + 2) % 8].GetNode()); FX_FLOAT fRadius1 = bCorner ? corner1.GetRadius() : 0.0f; FX_FLOAT fRadius2 = bCorner ? corner2.GetRadius() : 0.0f; - FX_BOOL bInverted = corner1.IsInverted(); + bool bInverted = corner1.IsInverted(); FX_FLOAT offsetY = 0.0f; FX_FLOAT offsetX = 0.0f; - FX_BOOL bRound = corner1.GetJoinType() == XFA_ATTRIBUTEENUM_Round; + bool bRound = corner1.GetJoinType() == XFA_ATTRIBUTEENUM_Round; FX_FLOAT halfAfter = 0.0f; FX_FLOAT halfBefore = 0.0f; CXFA_Stroke stroke = strokes[nIndex]; @@ -1411,12 +1407,12 @@ static void XFA_BOX_GetFillPath(CXFA_Box box, XFA_BOX_GetPath_Arc(box, rtWidget, fillPath, dwFlags); return; } - FX_BOOL bSameStyles = TRUE; + bool bSameStyles = true; CXFA_Stroke stroke1 = strokes[0]; for (int32_t i = 1; i < 8; i++) { CXFA_Stroke stroke2 = strokes[i]; if (!stroke1.SameStyles(stroke2)) { - bSameStyles = FALSE; + bSameStyles = false; break; } stroke1 = stroke2; @@ -1427,7 +1423,7 @@ static void XFA_BOX_GetFillPath(CXFA_Box box, CXFA_Stroke stroke2 = strokes[i]; if (!stroke1.SameStyles(stroke2, XFA_STROKE_SAMESTYLE_NoPresence | XFA_STROKE_SAMESTYLE_Corner)) { - bSameStyles = FALSE; + bSameStyles = false; break; } stroke1 = stroke2; @@ -1435,10 +1431,10 @@ static void XFA_BOX_GetFillPath(CXFA_Box box, if (bSameStyles) { stroke1 = strokes[0]; if (stroke1.IsInverted()) { - bSameStyles = FALSE; + bSameStyles = false; } if (stroke1.GetJoinType() != XFA_ATTRIBUTEENUM_Square) { - bSameStyles = FALSE; + bSameStyles = false; } } } @@ -1460,8 +1456,8 @@ static void XFA_BOX_GetFillPath(CXFA_Box box, CXFA_Corner corner2(strokes[(i + 2) % 8].GetNode()); FX_FLOAT fRadius1 = corner1.GetRadius(); FX_FLOAT fRadius2 = corner2.GetRadius(); - FX_BOOL bInverted = corner1.IsInverted(); - FX_BOOL bRound = corner1.GetJoinType() == XFA_ATTRIBUTEENUM_Round; + bool bInverted = corner1.IsInverted(); + bool bRound = corner1.GetJoinType() == XFA_ATTRIBUTEENUM_Round; if (bRound) { sy = FX_PI / 2; } @@ -1560,7 +1556,7 @@ static void XFA_BOX_Fill_Radial(CXFA_Box box, FXSYS_sqrt(rtFill.Width() * rtFill.Width() + rtFill.Height() * rtFill.Height()) / 2, - TRUE, TRUE, crStart, crEnd); + true, true, crStart, crEnd); CFX_Color cr(&shading); pGS->SetFillColor(&cr); pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); @@ -1631,7 +1627,7 @@ static void XFA_BOX_Fill_Linear(CXFA_Box box, default: break; } - CFX_Shading shading(ptStart, ptEnd, FALSE, FALSE, crStart, crEnd); + CFX_Shading shading(ptStart, ptEnd, false, false, crStart, crEnd); CFX_Color cr(&shading); pGS->SetFillColor(&cr); pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); @@ -1699,7 +1695,7 @@ static void XFA_BOX_StrokePath(CXFA_Stroke stroke, if (stroke.IsCorner() && fThickness > 2 * stroke.GetRadius()) { fThickness = 2 * stroke.GetRadius(); } - pGS->SetLineWidth(fThickness, TRUE); + pGS->SetLineWidth(fThickness, true); pGS->SetLineCap(CFX_GraphStateData::LineCapButt); XFA_StrokeTypeSetLineDash(pGS, stroke.GetStrokeType(), XFA_ATTRIBUTEENUM_Butt); @@ -1717,7 +1713,7 @@ static void XFA_BOX_StrokeArc(CXFA_Box box, if (!edge || !edge.IsVisible()) { return; } - FX_BOOL bVisible = FALSE; + bool bVisible = false; FX_FLOAT fThickness = 0; int32_t i3DType = box.Get3DStyle(bVisible, fThickness); if (i3DType) { @@ -1880,7 +1876,7 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box, CFX_Graphics* pGS, CFX_RectF rtWidget, CFX_Matrix* pMatrix) { - FX_BOOL bVisible = FALSE; + bool bVisible = false; FX_FLOAT fThickness = 0; int32_t i3DType = box.Get3DStyle(bVisible, fThickness); if (i3DType) { @@ -1903,25 +1899,25 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box, } return; } - FX_BOOL bClose = FALSE; - FX_BOOL bSameStyles = TRUE; + bool bClose = false; + bool bSameStyles = true; CXFA_Stroke stroke1 = strokes[0]; for (int32_t i = 1; i < 8; i++) { CXFA_Stroke stroke2 = strokes[i]; if (!stroke1.SameStyles(stroke2)) { - bSameStyles = FALSE; + bSameStyles = false; break; } stroke1 = stroke2; } if (bSameStyles) { stroke1 = strokes[0]; - bClose = TRUE; + bClose = true; for (int32_t i = 2; i < 8; i += 2) { CXFA_Stroke stroke2 = strokes[i]; if (!stroke1.SameStyles(stroke2, XFA_STROKE_SAMESTYLE_NoPresence | XFA_STROKE_SAMESTYLE_Corner)) { - bSameStyles = FALSE; + bSameStyles = false; break; } stroke1 = stroke2; @@ -1929,25 +1925,25 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box, if (bSameStyles) { stroke1 = strokes[0]; if (stroke1.IsInverted()) { - bSameStyles = FALSE; + bSameStyles = false; } if (stroke1.GetJoinType() != XFA_ATTRIBUTEENUM_Square) { - bSameStyles = FALSE; + bSameStyles = false; } } } - FX_BOOL bStart = TRUE; + bool bStart = true; CFX_Path path; path.Create(); for (int32_t i = 0; i < 8; i++) { CXFA_Stroke stroke = strokes[i]; if ((i % 1) == 0 && stroke.GetRadius() < 0) { - FX_BOOL bEmpty = path.IsEmpty(); + bool bEmpty = path.IsEmpty(); if (!bEmpty) { XFA_BOX_StrokePath(stroke, &path, pGS, pMatrix); path.Clear(); } - bStart = TRUE; + bStart = true; continue; } XFA_BOX_GetPath(box, strokes, rtWidget, path, i, bStart, !bSameStyles); @@ -1958,7 +1954,7 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box, path.Clear(); } } - FX_BOOL bEmpty = path.IsEmpty(); + bool bEmpty = path.IsEmpty(); if (!bEmpty) { if (bClose) { path.Close(); diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp index a5cfafc5f7..64d76a6d2a 100644 --- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp +++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp @@ -72,7 +72,7 @@ class CXFA_ImageLayoutData : public CXFA_WidgetLayoutData { public: CXFA_ImageLayoutData() : m_pDIBitmap(nullptr), - m_bNamedImage(FALSE), + m_bNamedImage(false), m_iImageXDpi(0), m_iImageYDpi(0) {} @@ -81,17 +81,17 @@ class CXFA_ImageLayoutData : public CXFA_WidgetLayoutData { delete m_pDIBitmap; } - FX_BOOL LoadImageData(CXFA_WidgetAcc* pAcc) { + bool LoadImageData(CXFA_WidgetAcc* pAcc) { if (m_pDIBitmap) - return TRUE; + return true; CXFA_Value value = pAcc->GetFormValue(); if (!value) - return FALSE; + return false; CXFA_Image imageObj = value.GetImage(); if (!imageObj) - return FALSE; + return false; CXFA_FFDoc* pFFDoc = pAcc->GetDoc(); pAcc->SetImageImage(XFA_LoadImageData(pFFDoc, &imageObj, m_bNamedImage, @@ -100,7 +100,7 @@ class CXFA_ImageLayoutData : public CXFA_WidgetLayoutData { } CFX_DIBitmap* m_pDIBitmap; - FX_BOOL m_bNamedImage; + bool m_bNamedImage; int32_t m_iImageXDpi; int32_t m_iImageYDpi; }; @@ -110,16 +110,16 @@ class CXFA_FieldLayoutData : public CXFA_WidgetLayoutData { CXFA_FieldLayoutData() {} ~CXFA_FieldLayoutData() override {} - FX_BOOL LoadCaption(CXFA_WidgetAcc* pAcc) { + bool LoadCaption(CXFA_WidgetAcc* pAcc) { if (m_pCapTextLayout) - return TRUE; + return true; CXFA_Caption caption = pAcc->GetCaption(); if (!caption || caption.GetPresence() == XFA_ATTRIBUTEENUM_Hidden) - return FALSE; + return false; m_pCapTextProvider.reset( new CXFA_TextProvider(pAcc, XFA_TEXTPROVIDERTYPE_Caption)); m_pCapTextLayout.reset(new CXFA_TextLayout(m_pCapTextProvider.get())); - return TRUE; + return true; } std::unique_ptr<CXFA_TextLayout> m_pCapTextLayout; @@ -136,7 +136,7 @@ class CXFA_ImageEditData : public CXFA_FieldLayoutData { public: CXFA_ImageEditData() : m_pDIBitmap(nullptr), - m_bNamedImage(FALSE), + m_bNamedImage(false), m_iImageXDpi(0), m_iImageYDpi(0) {} @@ -145,13 +145,13 @@ class CXFA_ImageEditData : public CXFA_FieldLayoutData { delete m_pDIBitmap; } - FX_BOOL LoadImageData(CXFA_WidgetAcc* pAcc) { + bool LoadImageData(CXFA_WidgetAcc* pAcc) { if (m_pDIBitmap) - return TRUE; + return true; CXFA_Value value = pAcc->GetFormValue(); if (!value) - return FALSE; + return false; CXFA_Image imageObj = value.GetImage(); CXFA_FFDoc* pFFDoc = pAcc->GetDoc(); @@ -161,7 +161,7 @@ class CXFA_ImageEditData : public CXFA_FieldLayoutData { } CFX_DIBitmap* m_pDIBitmap; - FX_BOOL m_bNamedImage; + bool m_bNamedImage; int32_t m_iImageXDpi; int32_t m_iImageYDpi; }; @@ -173,7 +173,7 @@ CXFA_WidgetAcc::CXFA_WidgetAcc(CXFA_FFDocView* pDocView, CXFA_Node* pNode) CXFA_WidgetAcc::~CXFA_WidgetAcc() {} -FX_BOOL CXFA_WidgetAcc::GetName(CFX_WideString& wsName, int32_t iNameType) { +bool CXFA_WidgetAcc::GetName(CFX_WideString& wsName, int32_t iNameType) { if (iNameType == 0) { m_pNode->TryCData(XFA_ATTRIBUTE_Name, wsName); return !wsName.IsEmpty(); @@ -185,17 +185,17 @@ FX_BOOL CXFA_WidgetAcc::GetName(CFX_WideString& wsName, int32_t iNameType) { wsName.Delete(0, wsPre.GetLength()); } } - return TRUE; + return true; } CXFA_Node* CXFA_WidgetAcc::GetDatasets() { return m_pNode->GetBindData(); } -FX_BOOL CXFA_WidgetAcc::ProcessValueChanged() { +bool CXFA_WidgetAcc::ProcessValueChanged() { m_pDocView->AddValidateWidget(this); m_pDocView->AddCalculateWidgetAcc(this); m_pDocView->RunCalculateWidgets(); m_pDocView->RunValidate(); - return TRUE; + return true; } void CXFA_WidgetAcc::ResetData() { CFX_WideString wsValue; @@ -262,7 +262,7 @@ void CXFA_WidgetAcc::SetImageEdit(const CFX_WideString& wsContentType, } CFX_WideString wsFormatValue(wsData); GetFormatDataValue(wsData, wsFormatValue); - m_pNode->SetContent(wsData, wsFormatValue, TRUE); + m_pNode->SetContent(wsData, wsFormatValue, true); CXFA_Node* pBind = GetDatasets(); if (!pBind) { image.SetTransferEncoding(XFA_ATTRIBUTEENUM_Base64); @@ -369,7 +369,7 @@ int32_t CXFA_WidgetAcc::ProcessCalculate() { void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, int32_t iRet, CFXJSE_Value* pRetValue, - FX_BOOL bVersionFlag) { + bool bVersionFlag) { if (iRet == XFA_EVENTERROR_Success && pRetValue) { if (pRetValue->IsBoolean() && !pRetValue->ToBoolean()) { IXFA_AppProvider* pAppProvider = GetAppProvider(); @@ -385,7 +385,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, if (GetNode()->IsUserInteractive()) return; if (wsScriptMsg.IsEmpty()) - GetValidateMessage(pAppProvider, wsScriptMsg, FALSE, bVersionFlag); + GetValidateMessage(pAppProvider, wsScriptMsg, false, bVersionFlag); if (bVersionFlag) { pAppProvider->MsgBox(wsScriptMsg, wsTitle, XFA_MBICON_Warning, @@ -398,7 +398,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, } } else { if (wsScriptMsg.IsEmpty()) { - GetValidateMessage(pAppProvider, wsScriptMsg, TRUE, bVersionFlag); + GetValidateMessage(pAppProvider, wsScriptMsg, true, bVersionFlag); } pAppProvider->MsgBox(wsScriptMsg, wsTitle, XFA_MBICON_Error, XFA_MB_OK); } @@ -406,7 +406,7 @@ void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, } } int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, - FX_BOOL bVersionFlag) { + bool bVersionFlag) { CFX_WideString wsRawValue = GetRawValue(); if (!wsRawValue.IsEmpty()) { CFX_WideString wsPicture; @@ -431,7 +431,7 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, int32_t eFormatTest = validate.GetFormatTest(); if (eFormatTest == XFA_ATTRIBUTEENUM_Error) { if (wsFormatMsg.IsEmpty()) { - GetValidateMessage(pAppProvider, wsFormatMsg, TRUE, bVersionFlag); + GetValidateMessage(pAppProvider, wsFormatMsg, true, bVersionFlag); } pAppProvider->MsgBox(wsFormatMsg, wsTitle, XFA_MBICON_Error, XFA_MB_OK); return XFA_EVENTERROR_Success; @@ -439,7 +439,7 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, if (GetNode()->IsUserInteractive()) return XFA_EVENTERROR_NotExist; if (wsFormatMsg.IsEmpty()) - GetValidateMessage(pAppProvider, wsFormatMsg, FALSE, bVersionFlag); + GetValidateMessage(pAppProvider, wsFormatMsg, false, bVersionFlag); if (bVersionFlag) { pAppProvider->MsgBox(wsFormatMsg, wsTitle, XFA_MBICON_Warning, @@ -457,7 +457,7 @@ int32_t CXFA_WidgetAcc::ProcessFormatTestValidate(CXFA_Validate validate, } int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, int32_t iFlags, - FX_BOOL bVersionFlag) { + bool bVersionFlag) { CFX_WideString wsValue; GetValue(wsValue, XFA_VALUEPICTURE_Raw); if (!wsValue.IsEmpty()) { @@ -507,7 +507,7 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, } case XFA_ATTRIBUTEENUM_Warning: { if (GetNode()->IsUserInteractive()) - return TRUE; + return true; if (wsNullMsg.IsEmpty()) { GetValidateCaptionName(wsCaptionName, bVersionFlag); @@ -529,7 +529,7 @@ int32_t CXFA_WidgetAcc::ProcessNullTestValidate(CXFA_Validate validate, return XFA_EVENTERROR_Success; } void CXFA_WidgetAcc::GetValidateCaptionName(CFX_WideString& wsCaptionName, - FX_BOOL bVersionFlag) { + bool bVersionFlag) { if (!bVersionFlag) { CXFA_Caption caption = GetCaption(); if (caption) { @@ -548,8 +548,8 @@ void CXFA_WidgetAcc::GetValidateCaptionName(CFX_WideString& wsCaptionName, } void CXFA_WidgetAcc::GetValidateMessage(IXFA_AppProvider* pAppProvider, CFX_WideString& wsMessage, - FX_BOOL bError, - FX_BOOL bVersionFlag) { + bool bError, + bool bVersionFlag) { CFX_WideString wsCaptionName; GetValidateCaptionName(wsCaptionName, bVersionFlag); CFX_WideString wsError; @@ -576,9 +576,8 @@ int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) { if (!validate) { return XFA_EVENTERROR_NotExist; } - FX_BOOL bInitDoc = validate.GetNode()->NeedsInitApp(); - FX_BOOL bStatus = - m_pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End; + bool bInitDoc = validate.GetNode()->NeedsInitApp(); + bool bStatus = m_pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End; int32_t iFormat = 0; CFXJSE_Value* pRetValue = nullptr; int32_t iRet = XFA_EVENTERROR_NotExist; @@ -593,9 +592,9 @@ int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) { : &pRetValue); } XFA_VERSION version = GetDoc()->GetXFADoc()->GetCurVersionMode(); - FX_BOOL bVersionFlag = FALSE; + bool bVersionFlag = false; if (version < XFA_VERSION_208) { - bVersionFlag = TRUE; + bVersionFlag = true; } if (bInitDoc) { validate.GetNode()->ClearFlag(XFA_NodeFlag_NeedsInitApp); @@ -647,9 +646,9 @@ int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, std::unique_ptr<CFXJSE_Value> pTmpRetValue( new CFXJSE_Value(pContext->GetRuntime())); ++m_nRecursionDepth; - FX_BOOL bRet = pContext->RunScript((XFA_SCRIPTLANGTYPE)eScriptType, - wsExpression.AsStringC(), - pTmpRetValue.get(), m_pNode); + bool bRet = pContext->RunScript((XFA_SCRIPTLANGTYPE)eScriptType, + wsExpression.AsStringC(), pTmpRetValue.get(), + m_pNode); --m_nRecursionDepth; int32_t iRet = XFA_EVENTERROR_Error; if (bRet) { @@ -772,7 +771,7 @@ void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) { } } } -FX_BOOL CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF& size) { +bool CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF& size) { CFX_SizeF szCap; CalcCaptionSize(szCap); CFX_RectF rtUIMargin; @@ -799,7 +798,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF& size) { } return CalculateWidgetAutoSize(size); } -FX_BOOL CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) { +bool CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) { CXFA_Margin mgWidget = GetMargin(); if (mgWidget) { FX_FLOAT fLeftInset, fTopInset, fRightInset, fBottomInset; @@ -837,7 +836,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) { size.y = std::min(size.y, fMax); } } - return TRUE; + return true; } void CXFA_WidgetAcc::CalculateTextContentSize(CFX_SizeF& size) { FX_FLOAT fFontSize = GetFontSize(); @@ -871,12 +870,12 @@ void CXFA_WidgetAcc::CalculateTextContentSize(CFX_SizeF& size) { layoutData->m_pTextOut->CalcLogicSize(wsText.c_str(), wsText.GetLength(), size); } -FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) { +bool CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) { if (size.x > 0) { CFX_SizeF szOrz = size; CFX_SizeF szCap; CalcCaptionSize(szCap); - FX_BOOL bCapExit = szCap.x > 0.01 && szCap.y > 0.01; + bool bCapExit = szCap.x > 0.01 && szCap.y > 0.01; int32_t iCapPlacement = XFA_ATTRIBUTEENUM_Unknown; if (bCapExit) { iCapPlacement = GetCaption().GetPlacementType(); @@ -923,16 +922,16 @@ FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) { CalculateTextContentSize(size); return CalculateFieldAutoSize(size); } -FX_BOOL CXFA_WidgetAcc::CalculateCheckButtonAutoSize(CFX_SizeF& size) { +bool CXFA_WidgetAcc::CalculateCheckButtonAutoSize(CFX_SizeF& size) { FX_FLOAT fCheckSize = GetCheckButtonSize(); size.x = size.y = fCheckSize; return CalculateFieldAutoSize(size); } -FX_BOOL CXFA_WidgetAcc::CalculatePushButtonAutoSize(CFX_SizeF& size) { +bool CXFA_WidgetAcc::CalculatePushButtonAutoSize(CFX_SizeF& size) { CalcCaptionSize(size); return CalculateWidgetAutoSize(size); } -FX_BOOL CXFA_WidgetAcc::CalculateImageAutoSize(CFX_SizeF& size) { +bool CXFA_WidgetAcc::CalculateImageAutoSize(CFX_SizeF& size) { if (!GetImageImage()) { LoadImageImage(); } @@ -963,7 +962,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateImageAutoSize(CFX_SizeF& size) { } return CalculateWidgetAutoSize(size); } -FX_BOOL CXFA_WidgetAcc::CalculateImageEditAutoSize(CFX_SizeF& size) { +bool CXFA_WidgetAcc::CalculateImageEditAutoSize(CFX_SizeF& size) { if (!GetImageEditImage()) { LoadImageEditImage(); } @@ -994,12 +993,12 @@ FX_BOOL CXFA_WidgetAcc::CalculateImageEditAutoSize(CFX_SizeF& size) { } return CalculateFieldAutoSize(size); } -FX_BOOL CXFA_WidgetAcc::LoadImageImage() { +bool CXFA_WidgetAcc::LoadImageImage() { InitLayoutData(); return static_cast<CXFA_ImageLayoutData*>(m_pLayoutData.get()) ->LoadImageData(this); } -FX_BOOL CXFA_WidgetAcc::LoadImageEditImage() { +bool CXFA_WidgetAcc::LoadImageEditImage() { InitLayoutData(); return static_cast<CXFA_ImageEditData*>(m_pLayoutData.get()) ->LoadImageData(this); @@ -1016,7 +1015,7 @@ void CXFA_WidgetAcc::GetImageEditDpi(int32_t& iImageXDpi, int32_t& iImageYDpi) { iImageXDpi = pData->m_iImageXDpi; iImageYDpi = pData->m_iImageYDpi; } -FX_BOOL CXFA_WidgetAcc::CalculateTextAutoSize(CFX_SizeF& size) { +bool CXFA_WidgetAcc::CalculateTextAutoSize(CFX_SizeF& size) { LoadText(); CXFA_TextLayout* pTextLayout = static_cast<CXFA_TextLayoutData*>(m_pLayoutData.get())->GetTextLayout(); @@ -1156,17 +1155,16 @@ void CXFA_WidgetAcc::CalculateAccWidthAndHeight(XFA_Element eUIType, m_pLayoutData->m_fWidgetHeight = sz.y; fCalcHeight = sz.y; } -FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, - FX_FLOAT& fCalcHeight) { +bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight) { XFA_Element eUIType = GetUIType(); if (eUIType == XFA_Element::Subform) { - return FALSE; + return false; } if (eUIType != XFA_Element::Text && eUIType != XFA_Element::TextEdit && eUIType != XFA_Element::NumericEdit && eUIType != XFA_Element::PasswordEdit) { fCalcHeight = 0; - return TRUE; + return true; } FX_FLOAT fTopInset = 0; FX_FLOAT fBottomInset = 0; @@ -1198,10 +1196,10 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, fCalcHeight = fCalcHeight + fTopInset; } if (fabs(fHeight - fCalcHeight) < XFA_FLOAT_PERCISION) { - return FALSE; + return false; } } - return TRUE; + return true; } XFA_ATTRIBUTEENUM iCapPlacement = XFA_ATTRIBUTEENUM_Unknown; FX_FLOAT fCapReserve = 0; @@ -1214,12 +1212,12 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, if (iCapPlacement == XFA_ATTRIBUTEENUM_Top && fCalcHeight < fCapReserve + fTopInset) { fCalcHeight = 0; - return TRUE; + return true; } if (iCapPlacement == XFA_ATTRIBUTEENUM_Bottom && m_pLayoutData->m_fWidgetHeight - fCapReserve - fBottomInset) { fCalcHeight = 0; - return TRUE; + return true; } if (iCapPlacement != XFA_ATTRIBUTEENUM_Top) { fCapReserve = 0; @@ -1251,7 +1249,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, fHeight -= pFieldArray->GetAt(i + 2); } if (iLinesCount == 0) { - return FALSE; + return false; } FX_FLOAT fLineHeight = GetLineHeight(); FX_FLOAT fFontSize = GetFontSize(); @@ -1293,33 +1291,33 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, pFieldArray->Add(fStartOffset); } XFA_VERSION version = GetDoc()->GetXFADoc()->GetCurVersionMode(); - FX_BOOL bCanSplitNoContent = FALSE; + bool bCanSplitNoContent = false; XFA_ATTRIBUTEENUM eLayoutMode; GetNode() ->GetNodeItem(XFA_NODEITEM_Parent) - ->TryEnum(XFA_ATTRIBUTE_Layout, eLayoutMode, TRUE); + ->TryEnum(XFA_ATTRIBUTE_Layout, eLayoutMode, true); if ((eLayoutMode == XFA_ATTRIBUTEENUM_Position || eLayoutMode == XFA_ATTRIBUTEENUM_Tb || eLayoutMode == XFA_ATTRIBUTEENUM_Row || eLayoutMode == XFA_ATTRIBUTEENUM_Table) && version > XFA_VERSION_208) { - bCanSplitNoContent = TRUE; + bCanSplitNoContent = true; } if ((eLayoutMode == XFA_ATTRIBUTEENUM_Tb || eLayoutMode == XFA_ATTRIBUTEENUM_Row || eLayoutMode == XFA_ATTRIBUTEENUM_Table) && version <= XFA_VERSION_208) { if (fStartOffset < fCalcHeight) { - bCanSplitNoContent = TRUE; + bCanSplitNoContent = true; } else { fCalcHeight = 0; - return TRUE; + return true; } } if (bCanSplitNoContent) { if ((fCalcHeight - fTopInset - fSpaceAbove < fLineHeight)) { fCalcHeight = 0; - return TRUE; + return true; } if (fStartOffset + XFA_FLOAT_PERCISION >= fCalcHeight) { if (iFieldSplitCount / 3 == (iBlockIndex + 1)) { @@ -1329,7 +1327,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, pFieldArray->Add(0); pFieldArray->Add(fCalcHeight); } - return FALSE; + return false; } if (fCalcHeight - fStartOffset < fLineHeight) { fCalcHeight = fStartOffset; @@ -1340,7 +1338,7 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, pFieldArray->Add(0); pFieldArray->Add(fCalcHeight); } - return TRUE; + return true; } FX_FLOAT fTextNum = fCalcHeight + XFA_FLOAT_PERCISION - fCapReserve - fStartOffset; @@ -1355,13 +1353,13 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, pFieldArray->Add((FX_FLOAT)iLinesCount); pFieldArray->Add(fCalcHeight); } - return FALSE; + return false; } if (fHeight - fStartOffset - fTextHeight < fFontSize) { iLineNum -= 1; if (iLineNum == 0) { fCalcHeight = 0; - return TRUE; + return true; } } else { iLineNum = (int32_t)(fTextNum / fLineHeight); @@ -1378,14 +1376,14 @@ FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, pFieldArray->Add(fSplitHeight); } if (fabs(fSplitHeight - fCalcHeight) < XFA_FLOAT_PERCISION) { - return FALSE; + return false; } fCalcHeight = fSplitHeight; - return TRUE; + return true; } } fCalcHeight = 0; - return TRUE; + return true; } void CXFA_WidgetAcc::InitLayoutData() { if (m_pLayoutData) { @@ -1434,7 +1432,7 @@ void CXFA_WidgetAcc::StartTextLayout(FX_FLOAT& fCalcWidth, } if (fCalcWidth < 0 && fCalcHeight < 0) { FX_FLOAT fMaxWidth = -1; - FX_BOOL bRet = GetWidth(fMaxWidth); + bool bRet = GetWidth(fMaxWidth); if (bRet) { FX_FLOAT fWidth = GetWidthWithoutMargin(fMaxWidth); pTextLayout->StartLayout(fWidth); @@ -1456,7 +1454,7 @@ void CXFA_WidgetAcc::StartTextLayout(FX_FLOAT& fCalcWidth, pTextLayout->DoLayout(0, fTextHeight, -1, fTextHeight); fCalcHeight = m_pLayoutData->m_fWidgetHeight; } -FX_BOOL CXFA_WidgetAcc::LoadCaption() { +bool CXFA_WidgetAcc::LoadCaption() { InitLayoutData(); return static_cast<CXFA_FieldLayoutData*>(m_pLayoutData.get()) ->LoadCaption(this); @@ -1553,15 +1551,15 @@ FX_ARGB CXFA_WidgetAcc::GetTextColor() { } return 0xFF000000; } -CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { - bRichText = FALSE; +CXFA_Node* CXFA_TextProvider::GetTextNode(bool& bRichText) { + bRichText = false; if (m_pTextNode) { if (m_pTextNode->GetElementType() == XFA_Element::ExData) { CFX_WideString wsContentType; m_pTextNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, - FALSE); + false); if (wsContentType == FX_WSTRC(L"text/html")) { - bRichText = TRUE; + bRichText = true; } } return m_pTextNode; @@ -1575,9 +1573,9 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); if (pChildNode && pChildNode->GetElementType() == XFA_Element::ExData) { CFX_WideString wsContentType; - pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); + pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, false); if (wsContentType == FX_WSTRC(L"text/html")) { - bRichText = TRUE; + bRichText = true; } } return pChildNode; @@ -1592,7 +1590,7 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { if (pXMLChild->GetType() == FDE_XMLNODE_Element) { CFDE_XMLElement* pElement = static_cast<CFDE_XMLElement*>(pXMLChild); if (XFA_RecognizeRichText(pElement)) { - bRichText = TRUE; + bRichText = true; } } } @@ -1610,9 +1608,9 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); if (pChildNode && pChildNode->GetElementType() == XFA_Element::ExData) { CFX_WideString wsContentType; - pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); + pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, false); if (wsContentType == FX_WSTRC(L"text/html")) { - bRichText = TRUE; + bRichText = true; } } return pChildNode; @@ -1655,20 +1653,20 @@ CXFA_Font CXFA_TextProvider::GetFontNode() { } return m_pWidgetAcc->GetFont(); } -FX_BOOL CXFA_TextProvider::IsCheckButtonAndAutoWidth() { +bool CXFA_TextProvider::IsCheckButtonAndAutoWidth() { XFA_Element eType = m_pWidgetAcc->GetUIType(); if (eType == XFA_Element::CheckButton) { FX_FLOAT fWidth = 0; return !m_pWidgetAcc->GetWidth(fWidth); } - return FALSE; + return false; } -FX_BOOL CXFA_TextProvider::GetEmbbedObj(FX_BOOL bURI, - FX_BOOL bRaw, - const CFX_WideString& wsAttr, - CFX_WideString& wsValue) { +bool CXFA_TextProvider::GetEmbbedObj(bool bURI, + bool bRaw, + const CFX_WideString& wsAttr, + CFX_WideString& wsValue) { if (m_eType != XFA_TEXTPROVIDERTYPE_Text) { - return FALSE; + return false; } if (bURI) { CXFA_Node* pWidgetNode = m_pWidgetAcc->GetNode(); @@ -1689,8 +1687,8 @@ FX_BOOL CXFA_TextProvider::GetEmbbedObj(FX_BOOL bURI, } if (pEmbAcc) { pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display); - return TRUE; + return true; } } - return FALSE; + return false; } diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.h b/xfa/fxfa/app/xfa_ffwidgetacc.h index 9261d41ee7..092254b2d8 100644 --- a/xfa/fxfa/app/xfa_ffwidgetacc.h +++ b/xfa/fxfa/app/xfa_ffwidgetacc.h @@ -27,15 +27,15 @@ class CXFA_TextProvider { } ~CXFA_TextProvider() {} - CXFA_Node* GetTextNode(FX_BOOL& bRichText); + CXFA_Node* GetTextNode(bool& bRichText); CXFA_Para GetParaNode(); CXFA_Font GetFontNode(); - FX_BOOL IsCheckButtonAndAutoWidth(); + bool IsCheckButtonAndAutoWidth(); CXFA_FFDoc* GetDocNode() { return m_pWidgetAcc->GetDoc(); } - FX_BOOL GetEmbbedObj(FX_BOOL bURI, - FX_BOOL bRaw, - const CFX_WideString& wsAttr, - CFX_WideString& wsValue); + bool GetEmbbedObj(bool bURI, + bool bRaw, + const CFX_WideString& wsAttr, + CFX_WideString& wsValue); protected: CXFA_WidgetAcc* m_pWidgetAcc; diff --git a/xfa/fxfa/app/xfa_ffwidgethandler.cpp b/xfa/fxfa/app/xfa_ffwidgethandler.cpp index 854b1ac384..551d8f6595 100644 --- a/xfa/fxfa/app/xfa_ffwidgethandler.cpp +++ b/xfa/fxfa/app/xfa_ffwidgethandler.cpp @@ -22,29 +22,29 @@ CXFA_FFWidgetHandler::CXFA_FFWidgetHandler(CXFA_FFDocView* pDocView) CXFA_FFWidgetHandler::~CXFA_FFWidgetHandler() {} -FX_BOOL CXFA_FFWidgetHandler::OnMouseEnter(CXFA_FFWidget* hWidget) { +bool CXFA_FFWidgetHandler::OnMouseEnter(CXFA_FFWidget* hWidget) { m_pDocView->LockUpdate(); - FX_BOOL bRet = hWidget->OnMouseEnter(); + bool bRet = hWidget->OnMouseEnter(); m_pDocView->UnlockUpdate(); m_pDocView->UpdateDocView(); return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnMouseExit(CXFA_FFWidget* hWidget) { +bool CXFA_FFWidgetHandler::OnMouseExit(CXFA_FFWidget* hWidget) { m_pDocView->LockUpdate(); - FX_BOOL bRet = hWidget->OnMouseExit(); + bool bRet = hWidget->OnMouseExit(); m_pDocView->UnlockUpdate(); m_pDocView->UpdateDocView(); return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnLButtonDown(CXFA_FFWidget* hWidget, - uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFWidgetHandler::OnLButtonDown(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { m_pDocView->LockUpdate(); hWidget->Rotate2Normal(fx, fy); - FX_BOOL bRet = hWidget->OnLButtonDown(dwFlags, fx, fy); + bool bRet = hWidget->OnLButtonDown(dwFlags, fx, fy); if (bRet && m_pDocView->SetFocus(hWidget)) { m_pDocView->GetDoc()->GetDocEnvironment()->SetFocusWidget( m_pDocView->GetDoc(), hWidget); @@ -54,56 +54,56 @@ FX_BOOL CXFA_FFWidgetHandler::OnLButtonDown(CXFA_FFWidget* hWidget, return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnLButtonUp(CXFA_FFWidget* hWidget, - uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFWidgetHandler::OnLButtonUp(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { m_pDocView->LockUpdate(); hWidget->Rotate2Normal(fx, fy); - m_pDocView->m_bLayoutEvent = TRUE; - FX_BOOL bRet = hWidget->OnLButtonUp(dwFlags, fx, fy); + m_pDocView->m_bLayoutEvent = true; + bool bRet = hWidget->OnLButtonUp(dwFlags, fx, fy); m_pDocView->UnlockUpdate(); m_pDocView->UpdateDocView(); return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnLButtonDblClk(CXFA_FFWidget* hWidget, - uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFWidgetHandler::OnLButtonDblClk(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { hWidget->Rotate2Normal(fx, fy); - FX_BOOL bRet = hWidget->OnLButtonDblClk(dwFlags, fx, fy); + bool bRet = hWidget->OnLButtonDblClk(dwFlags, fx, fy); m_pDocView->RunInvalidate(); return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnMouseMove(CXFA_FFWidget* hWidget, - uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFWidgetHandler::OnMouseMove(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { hWidget->Rotate2Normal(fx, fy); - FX_BOOL bRet = hWidget->OnMouseMove(dwFlags, fx, fy); + bool bRet = hWidget->OnMouseMove(dwFlags, fx, fy); m_pDocView->RunInvalidate(); return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnMouseWheel(CXFA_FFWidget* hWidget, - uint32_t dwFlags, - int16_t zDelta, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFWidgetHandler::OnMouseWheel(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + int16_t zDelta, + FX_FLOAT fx, + FX_FLOAT fy) { hWidget->Rotate2Normal(fx, fy); - FX_BOOL bRet = hWidget->OnMouseWheel(dwFlags, zDelta, fx, fy); + bool bRet = hWidget->OnMouseWheel(dwFlags, zDelta, fx, fy); m_pDocView->RunInvalidate(); return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnRButtonDown(CXFA_FFWidget* hWidget, - uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFWidgetHandler::OnRButtonDown(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { hWidget->Rotate2Normal(fx, fy); - FX_BOOL bRet = hWidget->OnRButtonDown(dwFlags, fx, fy); + bool bRet = hWidget->OnRButtonDown(dwFlags, fx, fy); if (bRet && m_pDocView->SetFocus(hWidget)) { m_pDocView->GetDoc()->GetDocEnvironment()->SetFocusWidget( m_pDocView->GetDoc(), hWidget); @@ -112,47 +112,47 @@ FX_BOOL CXFA_FFWidgetHandler::OnRButtonDown(CXFA_FFWidget* hWidget, return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnRButtonUp(CXFA_FFWidget* hWidget, - uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFWidgetHandler::OnRButtonUp(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { hWidget->Rotate2Normal(fx, fy); - FX_BOOL bRet = hWidget->OnRButtonUp(dwFlags, fx, fy); + bool bRet = hWidget->OnRButtonUp(dwFlags, fx, fy); m_pDocView->RunInvalidate(); return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnRButtonDblClk(CXFA_FFWidget* hWidget, - uint32_t dwFlags, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFWidgetHandler::OnRButtonDblClk(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy) { hWidget->Rotate2Normal(fx, fy); - FX_BOOL bRet = hWidget->OnRButtonDblClk(dwFlags, fx, fy); + bool bRet = hWidget->OnRButtonDblClk(dwFlags, fx, fy); m_pDocView->RunInvalidate(); return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnKeyDown(CXFA_FFWidget* hWidget, - uint32_t dwKeyCode, - uint32_t dwFlags) { - FX_BOOL bRet = hWidget->OnKeyDown(dwKeyCode, dwFlags); +bool CXFA_FFWidgetHandler::OnKeyDown(CXFA_FFWidget* hWidget, + uint32_t dwKeyCode, + uint32_t dwFlags) { + bool bRet = hWidget->OnKeyDown(dwKeyCode, dwFlags); m_pDocView->RunInvalidate(); m_pDocView->UpdateDocView(); return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnKeyUp(CXFA_FFWidget* hWidget, - uint32_t dwKeyCode, - uint32_t dwFlags) { - FX_BOOL bRet = hWidget->OnKeyUp(dwKeyCode, dwFlags); +bool CXFA_FFWidgetHandler::OnKeyUp(CXFA_FFWidget* hWidget, + uint32_t dwKeyCode, + uint32_t dwFlags) { + bool bRet = hWidget->OnKeyUp(dwKeyCode, dwFlags); m_pDocView->RunInvalidate(); return bRet; } -FX_BOOL CXFA_FFWidgetHandler::OnChar(CXFA_FFWidget* hWidget, - uint32_t dwChar, - uint32_t dwFlags) { - FX_BOOL bRet = hWidget->OnChar(dwChar, dwFlags); +bool CXFA_FFWidgetHandler::OnChar(CXFA_FFWidget* hWidget, + uint32_t dwChar, + uint32_t dwFlags) { + bool bRet = hWidget->OnChar(dwChar, dwFlags); m_pDocView->RunInvalidate(); return bRet; } @@ -167,9 +167,9 @@ FWL_WidgetHit CXFA_FFWidgetHandler::OnHitTest(CXFA_FFWidget* hWidget, return hWidget->OnHitTest(fx, fy); } -FX_BOOL CXFA_FFWidgetHandler::OnSetCursor(CXFA_FFWidget* hWidget, - FX_FLOAT fx, - FX_FLOAT fy) { +bool CXFA_FFWidgetHandler::OnSetCursor(CXFA_FFWidget* hWidget, + FX_FLOAT fx, + FX_FLOAT fy) { hWidget->Rotate2Normal(fx, fy); return hWidget->OnSetCursor(fx, fy); } @@ -177,34 +177,34 @@ FX_BOOL CXFA_FFWidgetHandler::OnSetCursor(CXFA_FFWidget* hWidget, void CXFA_FFWidgetHandler::RenderWidget(CXFA_FFWidget* hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix, - FX_BOOL bHighlight) { + bool bHighlight) { hWidget->RenderWidget(pGS, pMatrix, bHighlight ? XFA_WidgetStatus_Highlight : 0); } -FX_BOOL CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc, - XFA_EVENTTYPE eEventType) { +bool CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc, + XFA_EVENTTYPE eEventType) { if (!pWidgetAcc || eEventType == XFA_EVENT_Unknown) - return FALSE; + return false; if (pWidgetAcc->GetElementType() == XFA_Element::Draw) - return FALSE; + return false; switch (eEventType) { case XFA_EVENT_Calculate: { CXFA_Calculate calc = pWidgetAcc->GetCalculate(); if (!calc) - return FALSE; + return false; if (calc.GetScript()) - return TRUE; - return FALSE; + return true; + return false; } case XFA_EVENT_Validate: { CXFA_Validate val = pWidgetAcc->GetValidate(); if (!val) - return FALSE; + return false; if (val.GetScript()) - return TRUE; - return FALSE; + return true; + return false; } default: break; @@ -324,22 +324,22 @@ CXFA_Node* CXFA_FFWidgetHandler::CreatePushButton(CXFA_Node* pParent, CXFA_Node* pCaption = CreateCopyNode(XFA_Element::Caption, pField); CXFA_Node* pValue = CreateCopyNode(XFA_Element::Value, pCaption); CXFA_Node* pText = CreateCopyNode(XFA_Element::Text, pValue); - pText->SetContent(L"Button", L"Button", FALSE); + pText->SetContent(L"Button", L"Button", false); CXFA_Node* pPara = CreateCopyNode(XFA_Element::Para, pCaption); - pPara->SetEnum(XFA_ATTRIBUTE_VAlign, XFA_ATTRIBUTEENUM_Middle, FALSE); - pPara->SetEnum(XFA_ATTRIBUTE_HAlign, XFA_ATTRIBUTEENUM_Center, FALSE); + pPara->SetEnum(XFA_ATTRIBUTE_VAlign, XFA_ATTRIBUTEENUM_Middle, false); + pPara->SetEnum(XFA_ATTRIBUTE_HAlign, XFA_ATTRIBUTEENUM_Center, false); CreateFontNode(pCaption); CXFA_Node* pBorder = CreateCopyNode(XFA_Element::Border, pField); - pBorder->SetEnum(XFA_ATTRIBUTE_Hand, XFA_ATTRIBUTEENUM_Right, FALSE); + pBorder->SetEnum(XFA_ATTRIBUTE_Hand, XFA_ATTRIBUTEENUM_Right, false); CXFA_Node* pEdge = CreateCopyNode(XFA_Element::Edge, pBorder); - pEdge->SetEnum(XFA_ATTRIBUTE_Stroke, XFA_ATTRIBUTEENUM_Raised, FALSE); + pEdge->SetEnum(XFA_ATTRIBUTE_Stroke, XFA_ATTRIBUTEENUM_Raised, false); CXFA_Node* pFill = CreateCopyNode(XFA_Element::Fill, pBorder); CXFA_Node* pColor = CreateCopyNode(XFA_Element::Color, pFill); - pColor->SetCData(XFA_ATTRIBUTE_Value, L"212, 208, 200", FALSE); + pColor->SetCData(XFA_ATTRIBUTE_Value, L"212, 208, 200", false); CXFA_Node* pBind = CreateCopyNode(XFA_Element::Bind, pField); pBind->SetEnum(XFA_ATTRIBUTE_Match, XFA_ATTRIBUTEENUM_None); @@ -419,7 +419,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreatePasswordEdit(CXFA_Node* pParent, CXFA_Node* pBefore) const { CXFA_Node* pField = CreateField(XFA_Element::PasswordEdit, pParent, pBefore); CXFA_Node* pBind = CreateCopyNode(XFA_Element::Bind, pField); - pBind->SetEnum(XFA_ATTRIBUTE_Match, XFA_ATTRIBUTEENUM_None, FALSE); + pBind->SetEnum(XFA_ATTRIBUTE_Match, XFA_ATTRIBUTEENUM_None, false); return pField; } @@ -481,7 +481,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateFormItem(XFA_Element eElement, CXFA_Node* pParent, CXFA_Node* pBefore) const { CXFA_Node* pTemplateParent = pParent ? pParent->GetTemplateNode() : nullptr; - CXFA_Node* pNewFormItem = pTemplateParent->CloneTemplateToForm(FALSE); + CXFA_Node* pNewFormItem = pTemplateParent->CloneTemplateToForm(false); if (pParent) pParent->InsertChild(pNewFormItem, pBefore); return pNewFormItem; @@ -494,7 +494,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateCopyNode(XFA_Element eElement, CXFA_Node* pNewNode = CreateTemplateNode(eElement, pTemplateParent, pBefore ? pBefore->GetTemplateNode() : nullptr) - ->Clone(FALSE); + ->Clone(false); if (pParent) pParent->InsertChild(pNewNode, pBefore); return pNewNode; @@ -513,7 +513,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateTemplateNode(XFA_Element eElement, CXFA_Node* CXFA_FFWidgetHandler::CreateFontNode(CXFA_Node* pParent) const { CXFA_Node* pFont = CreateCopyNode(XFA_Element::Font, pParent); - pFont->SetCData(XFA_ATTRIBUTE_Typeface, L"Myriad Pro", FALSE); + pFont->SetCData(XFA_ATTRIBUTE_Typeface, L"Myriad Pro", false); return pFont; } @@ -523,16 +523,16 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateMarginNode(CXFA_Node* pParent, CXFA_Node* pMargin = CreateCopyNode(XFA_Element::Margin, pParent); if (dwFlags & 0x01) pMargin->SetMeasure(XFA_ATTRIBUTE_LeftInset, - CXFA_Measurement(fInsets[0], XFA_UNIT_Pt), FALSE); + CXFA_Measurement(fInsets[0], XFA_UNIT_Pt), false); if (dwFlags & 0x02) pMargin->SetMeasure(XFA_ATTRIBUTE_TopInset, - CXFA_Measurement(fInsets[1], XFA_UNIT_Pt), FALSE); + CXFA_Measurement(fInsets[1], XFA_UNIT_Pt), false); if (dwFlags & 0x04) pMargin->SetMeasure(XFA_ATTRIBUTE_RightInset, - CXFA_Measurement(fInsets[2], XFA_UNIT_Pt), FALSE); + CXFA_Measurement(fInsets[2], XFA_UNIT_Pt), false); if (dwFlags & 0x08) pMargin->SetMeasure(XFA_ATTRIBUTE_BottomInset, - CXFA_Measurement(fInsets[3], XFA_UNIT_Pt), FALSE); + CXFA_Measurement(fInsets[3], XFA_UNIT_Pt), false); return pMargin; } diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp index 6e54c41408..589dcd42f2 100644 --- a/xfa/fxfa/app/xfa_fontmgr.cpp +++ b/xfa/fxfa/app/xfa_fontmgr.cpp @@ -2017,7 +2017,7 @@ CFGAS_GEFont* CXFA_FontMgr::GetFont(CXFA_FFDoc* hDoc, CFGAS_GEFont* pFont = nullptr; if (pMgr) { pFont = - pMgr->GetFont(wsEnglishName.AsStringC(), dwFontStyles, &pPDFFont, TRUE); + pMgr->GetFont(wsEnglishName.AsStringC(), dwFontStyles, &pPDFFont, true); if (pFont) return pFont; } @@ -2027,7 +2027,7 @@ CFGAS_GEFont* CXFA_FontMgr::GetFont(CXFA_FFDoc* hDoc, if (!pFont && pMgr) { pPDFFont = nullptr; pFont = pMgr->GetFont(wsEnglishName.AsStringC(), dwFontStyles, &pPDFFont, - FALSE); + false); if (pFont) return pFont; } diff --git a/xfa/fxfa/app/xfa_fwladapter.cpp b/xfa/fxfa/app/xfa_fwladapter.cpp index 693dfaebf4..d827ad101f 100644 --- a/xfa/fxfa/app/xfa_fwladapter.cpp +++ b/xfa/fxfa/app/xfa_fwladapter.cpp @@ -27,11 +27,11 @@ FWL_Error CXFA_FWLAdapterWidgetMgr::RepaintWidget(IFWL_Widget* pWidget, return FWL_Error::Succeeded; } -FX_BOOL CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget, - FX_FLOAT fMinHeight, - FX_FLOAT fMaxHeight, - const CFX_RectF& rtAnchor, - CFX_RectF& rtPopup) { +bool CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget, + FX_FLOAT fMinHeight, + FX_FLOAT fMaxHeight, + const CFX_RectF& rtAnchor, + CFX_RectF& rtPopup) { CXFA_FFWidget* pFFWidget = static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem()); CFX_Matrix mt; @@ -40,5 +40,5 @@ FX_BOOL CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget, mt.TransformRect(rtRotateAnchor); pFFWidget->GetDoc()->GetDocEnvironment()->GetPopupPos( pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, rtPopup); - return TRUE; + return true; } diff --git a/xfa/fxfa/app/xfa_fwladapter.h b/xfa/fxfa/app/xfa_fwladapter.h index 0fbf0d9ee7..cb10399ae7 100644 --- a/xfa/fxfa/app/xfa_fwladapter.h +++ b/xfa/fxfa/app/xfa_fwladapter.h @@ -19,11 +19,11 @@ class CXFA_FWLAdapterWidgetMgr { ~CXFA_FWLAdapterWidgetMgr(); FWL_Error RepaintWidget(IFWL_Widget* pWidget, const CFX_RectF* pRect); - FX_BOOL GetPopupPos(IFWL_Widget* pWidget, - FX_FLOAT fMinHeight, - FX_FLOAT fMaxHeight, - const CFX_RectF& rtAnchor, - CFX_RectF& rtPopup); + bool GetPopupPos(IFWL_Widget* pWidget, + FX_FLOAT fMinHeight, + FX_FLOAT fMaxHeight, + const CFX_RectF& rtAnchor, + CFX_RectF& rtPopup); }; #endif // XFA_FXFA_APP_XFA_FWLADAPTER_H_ diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp index 8a4aadb753..291cc5133a 100644 --- a/xfa/fxfa/app/xfa_textlayout.cpp +++ b/xfa/fxfa/app/xfa_textlayout.cpp @@ -23,7 +23,7 @@ #include "xfa/fxfa/xfa_fontmgr.h" CXFA_CSSTagProvider::CXFA_CSSTagProvider() - : m_bTagAvailable(FALSE), m_bContent(FALSE) {} + : m_bTagAvailable(false), m_bContent(false) {} CXFA_CSSTagProvider::~CXFA_CSSTagProvider() {} @@ -112,7 +112,7 @@ void CXFA_TextParser::InitCSSData(CXFA_TextProvider* pTextProvider) { } CXFA_LoaderContext::CXFA_LoaderContext() - : m_bSaveLineHeight(FALSE), + : m_bSaveLineHeight(false), m_fWidth(0), m_fHeight(0), m_fLastPos(0), @@ -341,8 +341,8 @@ void CXFA_TextParser::ParseTagInfo(CFDE_XMLNode* pXMLNode, tagProvider.SetAttribute(L"style", wsValue); } } else if (pXMLNode->GetType() == FDE_XMLNODE_Text) { - tagProvider.m_bTagAvailable = TRUE; - tagProvider.m_bContent = TRUE; + tagProvider.m_bTagAvailable = true; + tagProvider.m_bContent = true; } } @@ -365,13 +365,13 @@ int32_t CXFA_TextParser::CountTabs(IFDE_CSSComputedStyle* pStyle) const { return 0; } -FX_BOOL CXFA_TextParser::IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const { +bool CXFA_TextParser::IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const { CFX_WideString wsValue; if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"xfa-spacerun"), wsValue)) { wsValue.MakeLower(); return wsValue == FX_WSTRC(L"yes"); } - return FALSE; + return false; } CFGAS_GEFont* CXFA_TextParser::GetFont(CXFA_TextProvider* pTextProvider, IFDE_CSSComputedStyle* pStyle) const { @@ -520,7 +520,7 @@ FX_FLOAT CXFA_TextParser::GetBaseline(CXFA_TextProvider* pTextProvider, } FX_FLOAT CXFA_TextParser::GetLineHeight(CXFA_TextProvider* pTextProvider, IFDE_CSSComputedStyle* pStyle, - FX_BOOL bFirst, + bool bFirst, FX_FLOAT fVerScale) const { FX_FLOAT fLineHeight = 0; if (pStyle) { @@ -541,20 +541,20 @@ FX_FLOAT CXFA_TextParser::GetLineHeight(CXFA_TextProvider* pTextProvider, fLineHeight *= fVerScale; return fLineHeight; } -FX_BOOL CXFA_TextParser::GetEmbbedObj(CXFA_TextProvider* pTextProvider, - CFDE_XMLNode* pXMLNode, - CFX_WideString& wsValue) { +bool CXFA_TextParser::GetEmbbedObj(CXFA_TextProvider* pTextProvider, + CFDE_XMLNode* pXMLNode, + CFX_WideString& wsValue) { wsValue.clear(); if (!pXMLNode) { - return FALSE; + return false; } - FX_BOOL bRet = FALSE; + bool bRet = false; if (pXMLNode->GetType() == FDE_XMLNODE_Element) { CFDE_XMLElement* pElement = static_cast<CFDE_XMLElement*>(pXMLNode); CFX_WideString wsAttr; pElement->GetString(L"xfa:embed", wsAttr); if (wsAttr.IsEmpty()) { - return FALSE; + return false; } if (wsAttr.GetAt(0) == L'#') { wsAttr.Delete(0); @@ -566,9 +566,9 @@ FX_BOOL CXFA_TextParser::GetEmbbedObj(CXFA_TextProvider* pTextProvider, } else { ws.MakeLower(); } - FX_BOOL bURI = (ws == FX_WSTRC(L"uri")); + bool bURI = (ws == FX_WSTRC(L"uri")); if (!bURI && ws != FX_WSTRC(L"som")) { - return FALSE; + return false; } ws.clear(); pElement->GetString(L"xfa:embedMode", ws); @@ -577,9 +577,9 @@ FX_BOOL CXFA_TextParser::GetEmbbedObj(CXFA_TextProvider* pTextProvider, } else { ws.MakeLower(); } - FX_BOOL bRaw = (ws == FX_WSTRC(L"raw")); + bool bRaw = (ws == FX_WSTRC(L"raw")); if (!bRaw && ws != FX_WSTRC(L"formatted")) { - return FALSE; + return false; } bRet = pTextProvider->GetEmbbedObj(bURI, bRaw, wsAttr, wsValue); } @@ -599,16 +599,15 @@ enum XFA_TABSTOPSSTATUS { XFA_TABSTOPSSTATUS_Leader, XFA_TABSTOPSSTATUS_Location, }; -FX_BOOL CXFA_TextParser::GetTabstops( - IFDE_CSSComputedStyle* pStyle, - CXFA_TextTabstopsContext* pTabstopContext) { +bool CXFA_TextParser::GetTabstops(IFDE_CSSComputedStyle* pStyle, + CXFA_TextTabstopsContext* pTabstopContext) { if (!pStyle || !pTabstopContext) { - return FALSE; + return false; } CFX_WideString wsValue; if (!pStyle->GetCustomStyle(FX_WSTRC(L"xfa-tab-stops"), wsValue) && !pStyle->GetCustomStyle(FX_WSTRC(L"tab-stops"), wsValue)) { - return FALSE; + return false; } int32_t iLength = wsValue.GetLength(); const FX_WCHAR* pTabStops = wsValue.c_str(); @@ -686,17 +685,17 @@ FX_BOOL CXFA_TextParser::GetTabstops( FX_FLOAT fPos = ms.ToUnit(XFA_UNIT_Pt); pTabstopContext->Append(dwHashCode, fPos); } - return TRUE; + return true; } CXFA_TextLayout::CXFA_TextLayout(CXFA_TextProvider* pTextProvider) - : m_bHasBlock(FALSE), + : m_bHasBlock(false), m_pTextProvider(pTextProvider), m_pTextDataNode(nullptr), - m_bRichText(FALSE), + m_bRichText(false), m_iLines(0), m_fMaxWidth(0), - m_bBlockContinue(TRUE) { + m_bBlockContinue(true) { ASSERT(m_pTextProvider); } @@ -763,7 +762,7 @@ CFDE_XMLNode* CXFA_TextLayout::GetXMLContainerNode() { } return pXMLContainer; } -CFX_RTFBreak* CXFA_TextLayout::CreateBreak(FX_BOOL bDefault) { +CFX_RTFBreak* CXFA_TextLayout::CreateBreak(bool bDefault) { uint32_t dwStyle = FX_RTFLAYOUTSTYLE_ExpandTab; if (!bDefault) { dwStyle |= FX_RTFLAYOUTSTYLE_Pagination; @@ -929,10 +928,10 @@ FX_FLOAT CXFA_TextLayout::GetLayoutHeight() { if (iCount == 0 && m_pLoader->m_fWidth > 0) { CFX_SizeF szMax(m_pLoader->m_fWidth, m_pLoader->m_fHeight); CFX_SizeF szDef; - m_pLoader->m_bSaveLineHeight = TRUE; + m_pLoader->m_bSaveLineHeight = true; m_pLoader->m_fLastPos = 0; CalcSize(szMax, szMax, szDef); - m_pLoader->m_bSaveLineHeight = FALSE; + m_pLoader->m_bSaveLineHeight = false; return szDef.y; } FX_FLOAT fHeight = m_pLoader->m_fHeight; @@ -959,20 +958,20 @@ FX_FLOAT CXFA_TextLayout::StartLayout(FX_FLOAT fWidth) { if (fWidth < 0) { CFX_SizeF szMax; CFX_SizeF szDef; - m_pLoader->m_bSaveLineHeight = TRUE; + m_pLoader->m_bSaveLineHeight = true; m_pLoader->m_fLastPos = 0; CalcSize(szMax, szMax, szDef); - m_pLoader->m_bSaveLineHeight = FALSE; + m_pLoader->m_bSaveLineHeight = false; fWidth = szDef.x; } return fWidth; } -FX_BOOL CXFA_TextLayout::DoLayout(int32_t iBlockIndex, - FX_FLOAT& fCalcHeight, - FX_FLOAT fContentAreaHeight, - FX_FLOAT fTextHeight) { +bool CXFA_TextLayout::DoLayout(int32_t iBlockIndex, + FX_FLOAT& fCalcHeight, + FX_FLOAT fContentAreaHeight, + FX_FLOAT fTextHeight) { if (!m_pLoader) { - return FALSE; + return false; } int32_t iBlockCount = m_Blocks.GetSize(); FX_FLOAT fHeight = fTextHeight; @@ -981,9 +980,9 @@ FX_BOOL CXFA_TextLayout::DoLayout(int32_t iBlockIndex, } m_pLoader->m_fHeight = fHeight; if (fContentAreaHeight < 0) { - return FALSE; + return false; } - m_bHasBlock = TRUE; + m_bHasBlock = true; if (iBlockCount == 0 && fHeight > 0) { fHeight = fTextHeight - GetLayoutHeight(); if (fHeight > 0) { @@ -1017,7 +1016,7 @@ FX_BOOL CXFA_TextLayout::DoLayout(int32_t iBlockIndex, FX_FLOAT fLineHeight = m_pLoader->m_lineHeights.ElementAt(i); if ((i == iLineIndex) && (fLineHeight - fContentAreaHeight > 0.001)) { fCalcHeight = 0; - return TRUE; + return true; } if (fLinePos + fLineHeight - fContentAreaHeight > 0.001) { if (iBlockCount >= (iBlockIndex + 1) * 2) { @@ -1038,65 +1037,65 @@ FX_BOOL CXFA_TextLayout::DoLayout(int32_t iBlockIndex, m_pLoader->m_BlocksHeight.Add(fCalcHeight); } } - return TRUE; + return true; } fCalcHeight = fLinePos; - return TRUE; + return true; } fLinePos += fLineHeight; } - return FALSE; + return false; } int32_t CXFA_TextLayout::CountBlocks() const { int32_t iCount = m_Blocks.GetSize() / 2; return iCount > 0 ? iCount : 1; } -FX_BOOL CXFA_TextLayout::CalcSize(const CFX_SizeF& minSize, - const CFX_SizeF& maxSize, - CFX_SizeF& defaultSize) { +bool CXFA_TextLayout::CalcSize(const CFX_SizeF& minSize, + const CFX_SizeF& maxSize, + CFX_SizeF& defaultSize) { defaultSize.x = maxSize.x; if (defaultSize.x < 1) defaultSize.x = 0xFFFF; - m_pBreak.reset(CreateBreak(FALSE)); + m_pBreak.reset(CreateBreak(false)); FX_FLOAT fLinePos = 0; m_iLines = 0; m_fMaxWidth = 0; - Loader(defaultSize, fLinePos, FALSE); + Loader(defaultSize, fLinePos, false); if (fLinePos < 0.1f) fLinePos = m_textParser.GetFontSize(m_pTextProvider, nullptr); m_pTabstopContext.reset(); defaultSize = CFX_SizeF(m_fMaxWidth, fLinePos); - return TRUE; + return true; } -FX_BOOL CXFA_TextLayout::Layout(const CFX_SizeF& size, FX_FLOAT* fHeight) { +bool CXFA_TextLayout::Layout(const CFX_SizeF& size, FX_FLOAT* fHeight) { if (size.x < 1) - return FALSE; + return false; Unload(); - m_pBreak.reset(CreateBreak(TRUE)); + m_pBreak.reset(CreateBreak(true)); if (m_pLoader) { m_pLoader->m_iTotalLines = -1; m_pLoader->m_iChar = 0; } m_iLines = 0; FX_FLOAT fLinePos = 0; - Loader(size, fLinePos, TRUE); + Loader(size, fLinePos, true); UpdateAlign(size.y, fLinePos); m_pTabstopContext.reset(); if (fHeight) *fHeight = fLinePos; - return TRUE; + return true; } -FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) { +bool CXFA_TextLayout::Layout(int32_t iBlock) { if (!m_pLoader || iBlock < 0 || iBlock >= CountBlocks()) - return FALSE; + return false; if (m_pLoader->m_fWidth < 1) - return FALSE; + return false; m_pLoader->m_iTotalLines = -1; m_iLines = 0; @@ -1107,10 +1106,10 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) { int32_t iBlocksHeightCount = m_pLoader->m_BlocksHeight.GetSize(); iBlocksHeightCount /= 2; if (iBlock < iBlocksHeightCount) - return TRUE; + return true; if (iBlock == iBlocksHeightCount) { Unload(); - m_pBreak.reset(CreateBreak(TRUE)); + m_pBreak.reset(CreateBreak(true)); fLinePos = m_pLoader->m_fStartLineOffset; for (int32_t i = 0; i < iBlocksHeightCount; i++) { fLinePos -= m_pLoader->m_BlocksHeight.ElementAt(i * 2 + 1); @@ -1118,7 +1117,7 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) { m_pLoader->m_iChar = 0; if (iCount > 1) m_pLoader->m_iTotalLines = m_Blocks.ElementAt(iBlock * 2 + 1); - Loader(szText, fLinePos, TRUE); + Loader(szText, fLinePos, true); if (iCount == 0 && m_pLoader->m_fStartLineOffset < 0.1f) UpdateAlign(szText.y, fLinePos); } else if (m_pTextDataNode) { @@ -1129,16 +1128,16 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) { if (m_bRichText) { CFDE_XMLNode* pContainerNode = GetXMLContainerNode(); if (!pContainerNode) { - return TRUE; + return true; } CFDE_XMLNode* pXMLNode = m_pLoader->m_pXMLNode; if (!pXMLNode) - return TRUE; + return true; CFDE_XMLNode* pSaveXMLNode = m_pLoader->m_pXMLNode; for (; pXMLNode; pXMLNode = pXMLNode->GetNodeItem(CFDE_XMLNode::NextSibling)) { if (!LoadRichText(pXMLNode, szText, fLinePos, m_pLoader->m_pParentStyle, - TRUE)) { + true)) { break; } } @@ -1147,7 +1146,7 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) { if (pXMLNode == pContainerNode) break; if (!LoadRichText(pXMLNode, szText, fLinePos, m_pLoader->m_pParentStyle, - TRUE, nullptr, FALSE)) { + true, nullptr, false)) { break; } pSaveXMLNode = pXMLNode; @@ -1157,7 +1156,7 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) { for (; pXMLNode; pXMLNode = pXMLNode->GetNodeItem(CFDE_XMLNode::NextSibling)) { if (!LoadRichText(pXMLNode, szText, fLinePos, - m_pLoader->m_pParentStyle, TRUE)) { + m_pLoader->m_pParentStyle, true)) { break; } } @@ -1165,15 +1164,15 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) { } else { pNode = m_pLoader->m_pNode; if (!pNode) - return TRUE; - LoadText(pNode, szText, fLinePos, TRUE); + return true; + LoadText(pNode, szText, fLinePos, true); } } if (iBlock == iCount) { m_pTabstopContext.reset(); m_pLoader.reset(); } - return TRUE; + return true; } void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex) { if (!m_pLoader) { @@ -1183,7 +1182,7 @@ void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex) { if (iCountHeight == 0) { return; } - FX_BOOL bEndItem = TRUE; + bool bEndItem = true; int32_t iBlockCount = m_Blocks.GetSize(); FX_FLOAT fLinePos = m_pLoader->m_fStartLineOffset; int32_t iLineIndex = 0; @@ -1206,7 +1205,7 @@ void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex) { if (fLinePos + fLineHeight - rtText.height > 0.001) { m_Blocks.Add(iLineIndex); m_Blocks.Add(i - iLineIndex); - bEndItem = FALSE; + bEndItem = false; break; } fLinePos += fLineHeight; @@ -1216,15 +1215,15 @@ void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex) { m_Blocks.Add(i - iLineIndex); } } -FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice, - const CFX_Matrix& tmDoc2Device, - const CFX_RectF& rtClip, - int32_t iBlock) { +bool CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice, + const CFX_Matrix& tmDoc2Device, + const CFX_RectF& rtClip, + int32_t iBlock) { if (!pFxDevice) - return FALSE; + return false; std::unique_ptr<CFDE_RenderDevice> pDevice( - new CFDE_RenderDevice(pFxDevice, FALSE)); + new CFDE_RenderDevice(pFxDevice, false)); pDevice->SaveState(); pDevice->SetClipRect(rtClip); @@ -1303,15 +1302,15 @@ void CXFA_TextLayout::UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom) { } } } -FX_BOOL CXFA_TextLayout::Loader(const CFX_SizeF& szText, - FX_FLOAT& fLinePos, - FX_BOOL bSavePieces) { +bool CXFA_TextLayout::Loader(const CFX_SizeF& szText, + FX_FLOAT& fLinePos, + bool bSavePieces) { if (!m_pAllocator) { m_pAllocator = IFX_MemoryAllocator::Create(FX_ALLOCTYPE_Static, 256, 0); } GetTextDataNode(); if (!m_pTextDataNode) - return TRUE; + return true; if (m_bRichText) { CFDE_XMLNode* pXMLContainer = GetXMLContainerNode(); @@ -1327,12 +1326,12 @@ FX_BOOL CXFA_TextLayout::Loader(const CFX_SizeF& szText, } else { LoadText(m_pTextDataNode, szText, fLinePos, bSavePieces); } - return TRUE; + return true; } void CXFA_TextLayout::LoadText(CXFA_Node* pNode, const CFX_SizeF& szText, FX_FLOAT& fLinePos, - FX_BOOL bSavePieces) { + bool bSavePieces) { InitBreak(szText.x); CXFA_Para para = m_pTextProvider->GetParaNode(); FX_FLOAT fSpaceAbove = 0; @@ -1353,57 +1352,57 @@ void CXFA_TextLayout::LoadText(CXFA_Node* pNode, } CFX_WideString wsText = pNode->GetContent(); wsText.TrimRight(L" "); - FX_BOOL bRet = AppendChar(wsText, fLinePos, fSpaceAbove, bSavePieces); + bool bRet = AppendChar(wsText, fLinePos, fSpaceAbove, bSavePieces); if (bRet && m_pLoader) { m_pLoader->m_pNode = pNode; } else { EndBreak(FX_RTFBREAK_ParagraphBreak, fLinePos, bSavePieces); } } -FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, - const CFX_SizeF& szText, - FX_FLOAT& fLinePos, - IFDE_CSSComputedStyle* pParentStyle, - FX_BOOL bSavePieces, - CXFA_LinkUserData* pLinkData, - FX_BOOL bEndBreak, - FX_BOOL bIsOl, - int32_t iLiCount) { +bool CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, + const CFX_SizeF& szText, + FX_FLOAT& fLinePos, + IFDE_CSSComputedStyle* pParentStyle, + bool bSavePieces, + CXFA_LinkUserData* pLinkData, + bool bEndBreak, + bool bIsOl, + int32_t iLiCount) { if (!pXMLNode) { - return FALSE; + return false; } CXFA_TextParseContext* pContext = m_textParser.GetParseContextFromMap(pXMLNode); FDE_CSSDISPLAY eDisplay = FDE_CSSDISPLAY_None; - FX_BOOL bContentNode = FALSE; + bool bContentNode = false; FX_FLOAT fSpaceBelow = 0; IFDE_CSSComputedStyle* pStyle = nullptr; CFX_WideString wsName; if (bEndBreak) { - FX_BOOL bCurOl = FALSE; - FX_BOOL bCurLi = FALSE; + bool bCurOl = false; + bool bCurLi = false; CFDE_XMLElement* pElement = nullptr; if (pContext) { if (m_bBlockContinue || (m_pLoader && pXMLNode == m_pLoader->m_pXMLNode)) { - m_bBlockContinue = TRUE; + m_bBlockContinue = true; } if (pXMLNode->GetType() == FDE_XMLNODE_Text) { - bContentNode = TRUE; + bContentNode = true; } else if (pXMLNode->GetType() == FDE_XMLNODE_Element) { pElement = static_cast<CFDE_XMLElement*>(pXMLNode); pElement->GetLocalTagName(wsName); } if (wsName == FX_WSTRC(L"ol")) { - bIsOl = TRUE; - bCurOl = TRUE; + bIsOl = true; + bCurOl = true; } - if (m_bBlockContinue || bContentNode == FALSE) { + if (m_bBlockContinue || bContentNode == false) { eDisplay = pContext->GetDisplay(); if (eDisplay != FDE_CSSDISPLAY_Block && eDisplay != FDE_CSSDISPLAY_Inline && eDisplay != FDE_CSSDISPLAY_ListItem) { - return TRUE; + return true; } pStyle = m_textParser.ComputeStyle(pXMLNode, pParentStyle); InitBreak(bContentNode ? pParentStyle : pStyle, eDisplay, szText.x, @@ -1434,7 +1433,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, } int32_t iTabCount = m_textParser.CountTabs(bContentNode ? pParentStyle : pStyle); - FX_BOOL bSpaceRun = + bool bSpaceRun = m_textParser.IsSpaceRun(bContentNode ? pParentStyle : pStyle); CFX_WideString wsText; if (bContentNode && iTabCount == 0) { @@ -1442,7 +1441,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, } else if (wsName == FX_WSTRC(L"br")) { wsText = L'\n'; } else if (wsName == FX_WSTRC(L"li")) { - bCurLi = TRUE; + bCurLi = true; if (bIsOl) { wsText.Format(L"%d. ", iLiCount); } else { @@ -1499,14 +1498,14 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, } if (pStyle) pStyle->Release(); - return FALSE; + return false; } - return TRUE; + return true; } } } } - FX_BOOL ret = TRUE; + bool ret = true; for (CFDE_XMLNode* pChildNode = pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild); pChildNode; @@ -1516,9 +1515,9 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, } ret = LoadRichText(pChildNode, szText, fLinePos, pContext ? pStyle : pParentStyle, bSavePieces, - pLinkData, TRUE, bIsOl, iLiCount); - if (ret == FALSE) { - return FALSE; + pLinkData, true, bIsOl, iLiCount); + if (ret == false) { + return false; } } if (m_pLoader) { @@ -1561,18 +1560,18 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, pXMLNode->GetNodeItem(CFDE_XMLNode::NextSibling); m_pLoader->m_pParentStyle = pParentStyle; } - return FALSE; + return false; } } } if (pStyle) pStyle->Release(); - return TRUE; + return true; } -FX_BOOL CXFA_TextLayout::AppendChar(const CFX_WideString& wsText, - FX_FLOAT& fLinePos, - FX_FLOAT fSpaceAbove, - FX_BOOL bSavePieces) { +bool CXFA_TextLayout::AppendChar(const CFX_WideString& wsText, + FX_FLOAT& fLinePos, + FX_FLOAT fSpaceAbove, + bool bSavePieces) { uint32_t dwStatus = 0; int32_t iChar = 0; if (m_pLoader) { @@ -1589,7 +1588,7 @@ FX_BOOL CXFA_TextLayout::AppendChar(const CFX_WideString& wsText, if (IsEnd(bSavePieces)) { if (m_pLoader) m_pLoader->m_iChar = i; - return TRUE; + return true; } if (dwStatus == FX_RTFBREAK_ParagraphBreak && m_bRichText) { fLinePos += fSpaceAbove; @@ -1599,16 +1598,16 @@ FX_BOOL CXFA_TextLayout::AppendChar(const CFX_WideString& wsText, if (m_pLoader) { m_pLoader->m_iChar = 0; } - return FALSE; + return false; } -FX_BOOL CXFA_TextLayout::IsEnd(FX_BOOL bSavePieces) { +bool CXFA_TextLayout::IsEnd(bool bSavePieces) { if (!bSavePieces) { - return FALSE; + return false; } if (m_pLoader && m_pLoader->m_iTotalLines > 0) { return m_iLines >= m_pLoader->m_iTotalLines; } - return FALSE; + return false; } void CXFA_TextLayout::ProcessText(CFX_WideString& wsText) { int32_t iLen = wsText.GetLength(); @@ -1634,10 +1633,10 @@ void CXFA_TextLayout::ProcessText(CFX_WideString& wsText) { } void CXFA_TextLayout::EndBreak(uint32_t dwStatus, FX_FLOAT& fLinePos, - FX_BOOL bSavePieces) { + bool bSavePieces) { dwStatus = m_pBreak->EndBreak(dwStatus); if (dwStatus > FX_RTFBREAK_PieceBreak) { - AppendTextLine(dwStatus, fLinePos, bSavePieces, TRUE); + AppendTextLine(dwStatus, fLinePos, bSavePieces, true); } } void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle* pStyle, @@ -1660,7 +1659,7 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle* pStyle, } if (iCount > 0) { iTabstopsIndex++; - m_pTabstopContext->m_bTabstops = TRUE; + m_pTabstopContext->m_bTabstops = true; FX_FLOAT fRight = 0; if (iPieces > 1) { XFA_TextPiece* p = pPieceLine->m_textPieces.GetAt(iPieces - 2); @@ -1690,7 +1689,7 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle* pStyle, } m_pTabstopContext->m_fLeft = std::min(fLeft, m_pTabstopContext->m_fTabWidth); - m_pTabstopContext->m_bTabstops = FALSE; + m_pTabstopContext->m_bTabstops = false; m_pTabstopContext->m_fTabWidth = 0; } pPiece->rtPiece.left -= m_pTabstopContext->m_fLeft; @@ -1698,8 +1697,8 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle* pStyle, } void CXFA_TextLayout::AppendTextLine(uint32_t dwStatus, FX_FLOAT& fLinePos, - FX_BOOL bSavePieces, - FX_BOOL bEndBreak) { + bool bSavePieces, + bool bEndBreak) { int32_t iPieces = m_pBreak->CountBreakPieces(); if (iPieces < 1) { return; @@ -1865,8 +1864,8 @@ void CXFA_TextLayout::RenderPath(CFDE_RenderDevice* pDevice, FXTEXT_CHARPOS* pCharPos, const CFX_Matrix& tmDoc2Device) { XFA_TextPiece* pPiece = pPieceLine->m_textPieces.GetAt(iPiece); - FX_BOOL bNoUnderline = pPiece->iUnderline < 1 || pPiece->iUnderline > 2; - FX_BOOL bNoLineThrough = pPiece->iLineThrough < 1 || pPiece->iLineThrough > 2; + bool bNoUnderline = pPiece->iUnderline < 1 || pPiece->iUnderline > 2; + bool bNoLineThrough = pPiece->iLineThrough < 1 || pPiece->iLineThrough > 2; if (bNoUnderline && bNoLineThrough) { return; } @@ -1970,7 +1969,7 @@ void CXFA_TextLayout::RenderPath(CFDE_RenderDevice* pDevice, int32_t CXFA_TextLayout::GetDisplayPos(const XFA_TextPiece* pPiece, FXTEXT_CHARPOS* pCharPos, - FX_BOOL bCharCode) { + bool bCharCode) { if (!pPiece) { return 0; } @@ -1980,10 +1979,10 @@ int32_t CXFA_TextLayout::GetDisplayPos(const XFA_TextPiece* pPiece, } return m_pBreak->GetDisplayPos(&tr, pCharPos, bCharCode); } -FX_BOOL CXFA_TextLayout::ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ& tr) { +bool CXFA_TextLayout::ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ& tr) { int32_t iLength = pPiece->iChars; if (iLength < 1) { - return FALSE; + return false; } tr.pStr = pPiece->pszText; tr.pFont = pPiece->pFont; @@ -1997,7 +1996,7 @@ FX_BOOL CXFA_TextLayout::ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ& tr) { tr.iVerticalScale = pPiece->iVerScale; tr.dwLayoutStyles = FX_RTFLAYOUTSTYLE_ExpandTab; tr.iHorizontalScale = pPiece->iHorScale; - return TRUE; + return true; } CXFA_LinkUserData::CXFA_LinkUserData(IFX_MemoryAllocator* pAllocator, @@ -2069,7 +2068,7 @@ CXFA_PieceLine::~CXFA_PieceLine() {} CXFA_TextTabstopsContext::CXFA_TextTabstopsContext() : m_iTabCount(0), m_iTabIndex(-1), - m_bTabstops(FALSE), + m_bTabstops(false), m_fTabWidth(0), m_fLeft(0) {} @@ -2098,7 +2097,7 @@ void CXFA_TextTabstopsContext::RemoveAll() { void CXFA_TextTabstopsContext::Reset() { m_iTabIndex = -1; - m_bTabstops = FALSE; + m_bTabstops = false; m_fTabWidth = 0; m_fLeft = 0; } diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h index 36bf87d6d9..b299f52904 100644 --- a/xfa/fxfa/app/xfa_textlayout.h +++ b/xfa/fxfa/app/xfa_textlayout.h @@ -44,8 +44,8 @@ class CXFA_CSSTagProvider { m_Attributes.insert({wsAttr, wsValue}); } - FX_BOOL m_bTagAvailable; - FX_BOOL m_bContent; + bool m_bTagAvailable; + bool m_bContent; protected: CFX_WideString m_wsTagName; @@ -83,14 +83,14 @@ class CXFA_TextParser { IFDE_CSSComputedStyle* CreateRootStyle(CXFA_TextProvider* pTextProvider); IFDE_CSSComputedStyle* ComputeStyle(CFDE_XMLNode* pXMLNode, IFDE_CSSComputedStyle* pParentStyle); - FX_BOOL IsParsed() const { return !!m_pAllocator; } + bool IsParsed() const { return !!m_pAllocator; } int32_t GetVAlign(CXFA_TextProvider* pTextProvider) const; FX_FLOAT GetTabInterval(IFDE_CSSComputedStyle* pStyle) const; int32_t CountTabs(IFDE_CSSComputedStyle* pStyle) const; - FX_BOOL IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const; - FX_BOOL GetTabstops(IFDE_CSSComputedStyle* pStyle, - CXFA_TextTabstopsContext* pTabstopContext); + bool IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const; + bool GetTabstops(IFDE_CSSComputedStyle* pStyle, + CXFA_TextTabstopsContext* pTabstopContext); CFGAS_GEFont* GetFont(CXFA_TextProvider* pTextProvider, IFDE_CSSComputedStyle* pStyle) const; FX_FLOAT GetFontSize(CXFA_TextProvider* pTextProvider, @@ -113,11 +113,11 @@ class CXFA_TextParser { IFDE_CSSComputedStyle* pStyle) const; FX_FLOAT GetLineHeight(CXFA_TextProvider* pTextProvider, IFDE_CSSComputedStyle* pStyle, - FX_BOOL bFirst, + bool bFirst, FX_FLOAT fVerScale) const; - FX_BOOL GetEmbbedObj(CXFA_TextProvider* pTextProvider, - CFDE_XMLNode* pXMLNode, - CFX_WideString& wsValue); + bool GetEmbbedObj(CXFA_TextProvider* pTextProvider, + CFDE_XMLNode* pXMLNode, + CFX_WideString& wsValue); CXFA_TextParseContext* GetParseContextFromMap(CFDE_XMLNode* pXMLNode); protected: @@ -142,7 +142,7 @@ class CXFA_LoaderContext { CXFA_LoaderContext(); ~CXFA_LoaderContext(); - FX_BOOL m_bSaveLineHeight; + bool m_bSaveLineHeight; FX_FLOAT m_fWidth; FX_FLOAT m_fHeight; FX_FLOAT m_fLastPos; @@ -245,7 +245,7 @@ class CXFA_TextTabstopsContext { CFX_ArrayTemplate<XFA_TABSTOPS> m_tabstops; int32_t m_iTabCount; int32_t m_iTabIndex; - FX_BOOL m_bTabstops; + bool m_bTabstops; FX_FLOAT m_fTabWidth; FX_FLOAT m_fLeft; }; @@ -258,63 +258,63 @@ class CXFA_TextLayout { int32_t GetText(CFX_WideString& wsText); FX_FLOAT GetLayoutHeight(); FX_FLOAT StartLayout(FX_FLOAT fWidth = -1); - FX_BOOL DoLayout(int32_t iBlockIndex, - FX_FLOAT& fCalcHeight, - FX_FLOAT fContentAreaHeight = -1, - FX_FLOAT fTextHeight = -1); - - FX_BOOL CalcSize(const CFX_SizeF& minSize, - const CFX_SizeF& maxSize, - CFX_SizeF& defaultSize); - FX_BOOL Layout(const CFX_SizeF& size, FX_FLOAT* fHeight = nullptr); + bool DoLayout(int32_t iBlockIndex, + FX_FLOAT& fCalcHeight, + FX_FLOAT fContentAreaHeight = -1, + FX_FLOAT fTextHeight = -1); + + bool CalcSize(const CFX_SizeF& minSize, + const CFX_SizeF& maxSize, + CFX_SizeF& defaultSize); + bool Layout(const CFX_SizeF& size, FX_FLOAT* fHeight = nullptr); void ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex); - FX_BOOL DrawString(CFX_RenderDevice* pFxDevice, - const CFX_Matrix& tmDoc2Device, - const CFX_RectF& rtClip, - int32_t iBlock = 0); - FX_BOOL IsLoaded() const { return m_pieceLines.GetSize() > 0; } + bool DrawString(CFX_RenderDevice* pFxDevice, + const CFX_Matrix& tmDoc2Device, + const CFX_RectF& rtClip, + int32_t iBlock = 0); + bool IsLoaded() const { return m_pieceLines.GetSize() > 0; } void Unload(); const CXFA_PieceLineArray* GetPieceLines(); - FX_BOOL m_bHasBlock; + bool m_bHasBlock; CFX_Int32Array m_Blocks; private: void GetTextDataNode(); CFDE_XMLNode* GetXMLContainerNode(); - CFX_RTFBreak* CreateBreak(FX_BOOL bDefault); + CFX_RTFBreak* CreateBreak(bool bDefault); void InitBreak(FX_FLOAT fLineWidth); void InitBreak(IFDE_CSSComputedStyle* pStyle, FDE_CSSDISPLAY eDisplay, FX_FLOAT fLineWidth, CFDE_XMLNode* pXMLNode, IFDE_CSSComputedStyle* pParentStyle = nullptr); - FX_BOOL Loader(const CFX_SizeF& szText, - FX_FLOAT& fLinePos, - FX_BOOL bSavePieces = TRUE); + bool Loader(const CFX_SizeF& szText, + FX_FLOAT& fLinePos, + bool bSavePieces = true); void LoadText(CXFA_Node* pNode, const CFX_SizeF& szText, FX_FLOAT& fLinePos, - FX_BOOL bSavePieces); - FX_BOOL LoadRichText(CFDE_XMLNode* pXMLNode, - const CFX_SizeF& szText, - FX_FLOAT& fLinePos, - IFDE_CSSComputedStyle* pParentStyle, - FX_BOOL bSavePieces, - CXFA_LinkUserData* pLinkData = nullptr, - FX_BOOL bEndBreak = TRUE, - FX_BOOL bIsOl = FALSE, - int32_t iLiCount = 0); - FX_BOOL AppendChar(const CFX_WideString& wsText, - FX_FLOAT& fLinePos, - FX_FLOAT fSpaceAbove, - FX_BOOL bSavePieces); + bool bSavePieces); + bool LoadRichText(CFDE_XMLNode* pXMLNode, + const CFX_SizeF& szText, + FX_FLOAT& fLinePos, + IFDE_CSSComputedStyle* pParentStyle, + bool bSavePieces, + CXFA_LinkUserData* pLinkData = nullptr, + bool bEndBreak = true, + bool bIsOl = false, + int32_t iLiCount = 0); + bool AppendChar(const CFX_WideString& wsText, + FX_FLOAT& fLinePos, + FX_FLOAT fSpaceAbove, + bool bSavePieces); void AppendTextLine(uint32_t dwStatus, FX_FLOAT& fLinePos, - FX_BOOL bSavePieces, - FX_BOOL bEndBreak = FALSE); - void EndBreak(uint32_t dwStatus, FX_FLOAT& fLinePos, FX_BOOL bDefault); - FX_BOOL IsEnd(FX_BOOL bSavePieces); + bool bSavePieces, + bool bEndBreak = false); + void EndBreak(uint32_t dwStatus, FX_FLOAT& fLinePos, bool bDefault); + bool IsEnd(bool bSavePieces); void ProcessText(CFX_WideString& wsText); void UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom); void RenderString(CFDE_RenderDevice* pDevice, @@ -331,15 +331,15 @@ class CXFA_TextLayout { const CFX_Matrix& tmDoc2Device); int32_t GetDisplayPos(const XFA_TextPiece* pPiece, FXTEXT_CHARPOS* pCharPos, - FX_BOOL bCharCode = FALSE); - FX_BOOL ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ& tr); + bool bCharCode = false); + bool ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ& tr); void DoTabstops(IFDE_CSSComputedStyle* pStyle, CXFA_PieceLine* pPieceLine); - FX_BOOL Layout(int32_t iBlock); + bool Layout(int32_t iBlock); int32_t CountBlocks() const; CXFA_TextProvider* m_pTextProvider; CXFA_Node* m_pTextDataNode; - FX_BOOL m_bRichText; + bool m_bRichText; std::unique_ptr<IFX_MemoryAllocator> m_pAllocator; std::unique_ptr<CFX_RTFBreak> m_pBreak; std::unique_ptr<CXFA_LoaderContext> m_pLoader; @@ -348,7 +348,7 @@ class CXFA_TextLayout { CXFA_TextParser m_textParser; CXFA_PieceLineArray m_pieceLines; std::unique_ptr<CXFA_TextTabstopsContext> m_pTabstopContext; - FX_BOOL m_bBlockContinue; + bool m_bBlockContinue; }; #endif // XFA_FXFA_APP_XFA_TEXTLAYOUT_H_ |