summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/pdfwindow
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-27 11:55:29 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-27 11:55:29 -0700
commitff46aaf499edcf153ee2f57c7016587aa96dcfa0 (patch)
tree0a0d92713af476897899b126d180cc6294433d10 /fpdfsdk/src/pdfwindow
parentaafeff816e22c1333c17d8a0eb4fe8927c28142d (diff)
downloadpdfium-ff46aaf499edcf153ee2f57c7016587aa96dcfa0.tar.xz
FX Bool considered harmful, part 3
Try to reland this patch after fixing underlying issues that caused it to be reverted. fx_system.h is the only manual edit. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1258093002 .
Diffstat (limited to 'fpdfsdk/src/pdfwindow')
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Button.cpp14
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Caret.cpp22
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp100
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Edit.cpp228
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp108
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_FontMap.cpp18
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Icon.cpp8
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_IconList.cpp60
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Label.cpp2
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ListBox.cpp80
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp8
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Note.cpp194
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp94
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Signature.cpp20
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp36
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Utils.cpp104
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Wnd.cpp94
17 files changed, 595 insertions, 595 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_Button.cpp b/fpdfsdk/src/pdfwindow/PWL_Button.cpp
index 84962285c4..1712bd24fc 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Button.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Button.cpp
@@ -12,7 +12,7 @@
/* ------------------------------- CPWL_Button ---------------------------------- */
CPWL_Button::CPWL_Button() :
- m_bMouseDown(FALSE)
+ m_bMouseDown(false)
{
}
@@ -31,23 +31,23 @@ void CPWL_Button::OnCreate(PWL_CREATEPARAM & cp)
cp.eCursorType = FXCT_HAND;
}
-FX_BOOL CPWL_Button::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Button::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point, nFlag);
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
SetCapture();
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_Button::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Button::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point, nFlag);
ReleaseCapture();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
- return TRUE;
+ return true;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
index 84a8b3d186..deccf06449 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
@@ -16,7 +16,7 @@
//////////////////////////////////////////////////////////////////////
CPWL_Caret::CPWL_Caret() :
- m_bFlash(FALSE),
+ m_bFlash(false),
m_ptHead(0,0),
m_ptFoot(0,0),
m_fWidth(0.4f),
@@ -135,7 +135,7 @@ CPDF_Rect CPWL_Caret::GetCaretRect() const
m_ptHead.y);
}
-void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
+void CPWL_Caret::SetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
{
if (bVisible)
{
@@ -147,9 +147,9 @@ void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPD
m_ptHead = ptHead;
m_ptFoot = ptFoot;
- m_bFlash = TRUE;
- //Move(GetCaretRect(),FALSE,TRUE);
- Move(m_rcInvalid, FALSE, TRUE);
+ m_bFlash = true;
+ //Move(GetCaretRect(),false,true);
+ Move(m_rcInvalid, false, true);
}
}
else
@@ -160,11 +160,11 @@ void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPD
EndTimer();
BeginTimer(PWL_CARET_FLASHINTERVAL);
- CPWL_Wnd::SetVisible(TRUE);
- m_bFlash = TRUE;
+ CPWL_Wnd::SetVisible(true);
+ m_bFlash = true;
- //Move(GetCaretRect(),FALSE,TRUE);
- Move(m_rcInvalid, FALSE, TRUE);
+ //Move(GetCaretRect(),false,true);
+ Move(m_rcInvalid, false, true);
}
}
else
@@ -172,11 +172,11 @@ void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPD
m_ptHead = CPDF_Point(0, 0);
m_ptFoot = CPDF_Point(0, 0);
- m_bFlash = FALSE;
+ m_bFlash = false;
if (IsVisible())
{
EndTimer();
- CPWL_Wnd::SetVisible(FALSE);
+ CPWL_Wnd::SetVisible(false);
}
}
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
index f5c8a815d4..6c5dd5516e 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
@@ -22,14 +22,14 @@
/* ---------------------------- CPWL_CBListBox ---------------------------- */
-FX_BOOL CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
if (m_bMouseDown)
{
ReleaseCapture();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
if (ClientHitTest(point))
{
@@ -38,23 +38,23 @@ FX_BOOL CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
pParent->OnNotify(this,PNM_LBUTTONUP,0,PWL_MAKEDWORD(point.x,point.y));
}
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(FALSE,bExit, nFlag);
- if (bExit) return FALSE;
+ bool bExit = false;
+ OnNotifySelChanged(false,bExit, nFlag);
+ if (bExit) return false;
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
+bool CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, bool & bExit, FX_DWORD nFlag)
{
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
switch (nChar)
{
default:
- return FALSE;
+ return false;
case FWL_VKEY_Up:
case FWL_VKEY_Down:
case FWL_VKEY_Home:
@@ -88,25 +88,25 @@ FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWO
break;
}
- OnNotifySelChanged(TRUE,bExit, nFlag);
+ OnNotifySelChanged(true,bExit, nFlag);
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_CBListBox::OnCharWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
+bool CPWL_CBListBox::OnCharWithExit(FX_WORD nChar, bool & bExit, FX_DWORD nFlag)
{
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
- if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return FALSE;
+ if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return false;
if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow())
{
pComboBox->SetSelectText();
}
- OnNotifySelChanged(TRUE,bExit,nFlag);
+ OnNotifySelChanged(true,bExit,nFlag);
- return TRUE;
+ return true;
}
/* ---------------------------- CPWL_CBButton ---------------------------- */
@@ -177,7 +177,7 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p
}
}
-FX_BOOL CPWL_CBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_CBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
@@ -188,16 +188,16 @@ FX_BOOL CPWL_CBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
pParent->OnNotify(this,PNM_LBUTTONDOWN,0,PWL_MAKEDWORD(point.x,point.y));
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_CBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_CBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point, nFlag);
ReleaseCapture();
- return TRUE;
+ return true;
}
/* ---------------------------- CPWL_ComboBox ---------------------------- */
@@ -205,7 +205,7 @@ FX_BOOL CPWL_CBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
CPWL_ComboBox::CPWL_ComboBox() : m_pEdit(NULL),
m_pButton(NULL),
m_pList(NULL),
- m_bPopup(FALSE),
+ m_bPopup(false),
m_nPopupWhere(0),
m_nSelectItem(-1),
m_pFillerNotify(NULL)
@@ -231,7 +231,7 @@ void CPWL_ComboBox::SetFocus()
void CPWL_ComboBox::KillFocus()
{
- SetPopup(FALSE);
+ SetPopup(false);
CPWL_Wnd::KillFocus();
}
@@ -439,15 +439,15 @@ void CPWL_ComboBox::RePosChildWnd()
}
if (m_pButton)
- m_pButton->Move(rcButton,TRUE,FALSE);
+ m_pButton->Move(rcButton,true,false);
if (m_pEdit)
- m_pEdit->Move(rcEdit,TRUE,FALSE);
+ m_pEdit->Move(rcEdit,true,false);
if (m_pList)
{
- m_pList->SetVisible(TRUE);
- m_pList->Move(rcList,TRUE,FALSE);
+ m_pList->SetVisible(true);
+ m_pList->Move(rcList,true,false);
m_pList->ScrollToListItem(m_nSelectItem);
}
}
@@ -461,7 +461,7 @@ void CPWL_ComboBox::RePosChildWnd()
rcButton.left = rcClient.left;
if (m_pButton)
- m_pButton->Move(rcButton,TRUE,FALSE);
+ m_pButton->Move(rcButton,true,false);
CPDF_Rect rcEdit = rcClient;
rcEdit.right = rcButton.left - 1.0f;
@@ -473,10 +473,10 @@ void CPWL_ComboBox::RePosChildWnd()
rcEdit.right = rcEdit.left;
if (m_pEdit)
- m_pEdit->Move(rcEdit,TRUE,FALSE);
+ m_pEdit->Move(rcEdit,true,false);
if (m_pList)
- m_pList->SetVisible(FALSE);
+ m_pList->SetVisible(false);
}
}
@@ -491,7 +491,7 @@ CPDF_Rect CPWL_ComboBox::GetFocusRect() const
return CPDF_Rect();
}
-void CPWL_ComboBox::SetPopup(FX_BOOL bPopup)
+void CPWL_ComboBox::SetPopup(bool bPopup)
{
if (!m_pList) return;
if (bPopup == m_bPopup) return;
@@ -528,21 +528,21 @@ void CPWL_ComboBox::SetPopup(FX_BOOL bPopup)
}
m_nPopupWhere = nWhere;
- Move(rcWindow, TRUE, TRUE);
+ Move(rcWindow, true, true);
}
}
}
else
{
m_bPopup = bPopup;
- Move(m_rcOldWindow, TRUE, TRUE);
+ Move(m_rcOldWindow, true, true);
}
}
-FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
- if (!m_pList) return FALSE;
- if (!m_pEdit) return FALSE;
+ if (!m_pList) return false;
+ if (!m_pEdit) return false;
m_nSelectItem = -1;
@@ -551,47 +551,47 @@ FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
case FWL_VKEY_Up:
if (m_pList->GetCurSel() > 0)
{
- FX_BOOL bExit = FALSE;
+ bool bExit = false;
if (m_pList->OnKeyDownWithExit(nChar,bExit,nFlag))
{
- if (bExit) return FALSE;
+ if (bExit) return false;
SetSelectText();
}
}
- return TRUE;
+ return true;
case FWL_VKEY_Down:
if (m_pList->GetCurSel() < m_pList->GetCount() - 1)
{
- FX_BOOL bExit = FALSE;
+ bool bExit = false;
if (m_pList->OnKeyDownWithExit(nChar,bExit,nFlag))
{
- if (bExit) return FALSE;
+ if (bExit) return false;
SetSelectText();
}
}
- return TRUE;
+ return true;
}
if (HasFlag(PCBS_ALLOWCUSTOMTEXT))
return m_pEdit->OnKeyDown(nChar,nFlag);
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
if (!m_pList)
- return FALSE;
+ return false;
if (!m_pEdit)
- return FALSE;
+ return false;
m_nSelectItem = -1;
if (HasFlag(PCBS_ALLOWCUSTOMTEXT))
return m_pEdit->OnChar(nChar,nFlag);
- FX_BOOL bExit = FALSE;
- return m_pList->OnCharWithExit(nChar,bExit,nFlag) ? bExit : FALSE;
+ bool bExit = false;
+ return m_pList->OnCharWithExit(nChar,bExit,nFlag) ? bExit : false;
}
void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -613,7 +613,7 @@ void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
SetSelectText();
SelectAll();
m_pEdit->SetFocus();
- SetPopup(FALSE);
+ SetPopup(false);
return;
}
}
@@ -622,7 +622,7 @@ void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam);
}
-FX_BOOL CPWL_ComboBox::IsPopup() const
+bool CPWL_ComboBox::IsPopup() const
{
return m_bPopup;
}
@@ -637,7 +637,7 @@ void CPWL_ComboBox::SetSelectText()
m_nSelectItem = m_pList->GetCurSel();
}
-FX_BOOL CPWL_ComboBox::IsModified() const
+bool CPWL_ComboBox::IsModified() const
{
return m_pEdit->IsModified();
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
index 58d8a79da1..303ae963f4 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
@@ -19,14 +19,14 @@
CPWL_Edit::CPWL_Edit() : m_pFillerNotify(NULL),
m_pSpellCheck(NULL),
- m_bFocus(FALSE)
+ m_bFocus(false)
{
m_pFormFiller = NULL;
}
CPWL_Edit::~CPWL_Edit()
{
- ASSERT(m_bFocus == FALSE);
+ ASSERT(m_bFocus == false);
}
CFX_ByteString CPWL_Edit::GetClassName() const
@@ -49,7 +49,7 @@ void CPWL_Edit::SetText(const FX_WCHAR* csText)
if (CXML_Element * pXML = CXML_Element::Parse(sValue.c_str(), sValue.GetLength()))
{
int32_t nCount = pXML->CountChildren();
- FX_BOOL bFirst = TRUE;
+ bool bFirst = true;
swText.Empty();
@@ -67,7 +67,7 @@ void CPWL_Edit::SetText(const FX_WCHAR* csText)
swSection += pSubElement->GetContent(j);
}
- if (bFirst)bFirst = FALSE;
+ if (bFirst)bFirst = false;
else
swText += FWL_VKEY_Return;
swText += swSection;
@@ -90,7 +90,7 @@ void CPWL_Edit::RePosChildWnd()
rcWindow.bottom,
rcWindow.right + PWL_SCROLLBAR_WIDTH,
rcWindow.top);
- pVSB->Move(rcVScroll, TRUE, FALSE);
+ pVSB->Move(rcVScroll, true, false);
}
if (m_pEditCaret && !HasFlag(PES_TEXTOVERFLOW))
@@ -114,39 +114,39 @@ CPDF_Rect CPWL_Edit::GetClientRect() const
return rcClient;
}
-void CPWL_Edit::SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat, FX_BOOL bPaint/* = TRUE*/)
+void CPWL_Edit::SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat, bool bPaint/* = true*/)
{
m_pEdit->SetAlignmentH((int32_t)nFormat, bPaint);
}
-void CPWL_Edit::SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat, FX_BOOL bPaint/* = TRUE*/)
+void CPWL_Edit::SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat, bool bPaint/* = true*/)
{
m_pEdit->SetAlignmentV((int32_t)nFormat, bPaint);
}
-FX_BOOL CPWL_Edit::CanSelectAll() const
+bool CPWL_Edit::CanSelectAll() const
{
return GetSelectWordRange() != m_pEdit->GetWholeWordRange();
}
-FX_BOOL CPWL_Edit::CanClear() const
+bool CPWL_Edit::CanClear() const
{
return !IsReadOnly() && m_pEdit->IsSelected();
}
-FX_BOOL CPWL_Edit::CanCopy() const
+bool CPWL_Edit::CanCopy() const
{
return !HasFlag(PES_PASSWORD) && !HasFlag(PES_NOREAD) && m_pEdit->IsSelected();
}
-FX_BOOL CPWL_Edit::CanCut() const
+bool CPWL_Edit::CanCut() const
{
return CanCopy() && !IsReadOnly();
}
-FX_BOOL CPWL_Edit::CanPaste() const
+bool CPWL_Edit::CanPaste() const
{
- if (IsReadOnly()) return FALSE;
+ if (IsReadOnly()) return false;
CFX_WideString swClipboard;
if (IFX_SystemHandler* pSH = GetSystemHandler())
@@ -175,13 +175,13 @@ void CPWL_Edit::PasteText()
if (m_pFillerNotify)
{
- FX_BOOL bRC = TRUE;
- FX_BOOL bExit = FALSE;
+ bool bRC = true;
+ bool bExit = false;
CFX_WideString strChangeEx;
int nSelStart = 0;
int nSelEnd = 0;
GetSel(nSelStart, nSelEnd);
- m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), 0 , swClipboard, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, 0);
+ m_pFillerNotify->OnBeforeKeyStroke(true, GetAttachedData(), 0 , swClipboard, strChangeEx, nSelStart, nSelEnd, true, bRC, bExit, 0);
if (!bRC) return;
if (bExit) return;
}
@@ -194,8 +194,8 @@ void CPWL_Edit::PasteText()
if (m_pFillerNotify)
{
- FX_BOOL bExit = FALSE;
- m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,0);
+ bool bExit = false;
+ m_pFillerNotify->OnAfterKeyStroke(true, GetAttachedData(), bExit,0);
if (bExit) return;
}
}
@@ -227,52 +227,52 @@ void CPWL_Edit::OnCreated()
m_rcOldWindow = GetWindowRect();
m_pEdit->SetOprNotify(this);
- m_pEdit->EnableOprNotify(TRUE);
+ m_pEdit->EnableOprNotify(true);
}
void CPWL_Edit::SetParamByFlag()
{
if (HasFlag(PES_RIGHT))
{
- m_pEdit->SetAlignmentH(2, FALSE);
+ m_pEdit->SetAlignmentH(2, false);
}
else if (HasFlag(PES_MIDDLE))
{
- m_pEdit->SetAlignmentH(1, FALSE);
+ m_pEdit->SetAlignmentH(1, false);
}
else
{
- m_pEdit->SetAlignmentH(0, FALSE);
+ m_pEdit->SetAlignmentH(0, false);
}
if (HasFlag(PES_BOTTOM))
{
- m_pEdit->SetAlignmentV(2, FALSE);
+ m_pEdit->SetAlignmentV(2, false);
}
else if (HasFlag(PES_CENTER))
{
- m_pEdit->SetAlignmentV(1, FALSE);
+ m_pEdit->SetAlignmentV(1, false);
}
else
{
- m_pEdit->SetAlignmentV(0, FALSE);
+ m_pEdit->SetAlignmentV(0, false);
}
if (HasFlag(PES_PASSWORD))
{
- m_pEdit->SetPasswordChar('*', FALSE);
+ m_pEdit->SetPasswordChar('*', false);
}
- m_pEdit->SetMultiLine(HasFlag(PES_MULTILINE), FALSE);
- m_pEdit->SetAutoReturn(HasFlag(PES_AUTORETURN), FALSE);
- m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE), FALSE);
- m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL), FALSE);
+ m_pEdit->SetMultiLine(HasFlag(PES_MULTILINE), false);
+ m_pEdit->SetAutoReturn(HasFlag(PES_AUTORETURN), false);
+ m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE), false);
+ m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL), false);
m_pEdit->EnableUndo(HasFlag(PES_UNDO));
if (HasFlag(PES_TEXTOVERFLOW))
{
SetClipRect(CPDF_Rect(0.0f,0.0f,0.0f,0.0f));
- m_pEdit->SetTextOverflow(TRUE, FALSE);
+ m_pEdit->SetTextOverflow(true, false);
}
else
{
@@ -304,7 +304,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
case PBS_SOLID:
{
sLine << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n";
+ << CPWL_Utils::GetColorAppStream(GetBorderColor(),false) << " 2 J 0 j\n";
for (int32_t i=1;i<nCharArray;i++)
{
@@ -320,7 +320,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
case PBS_DASH:
{
sLine << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n"
+ << CPWL_Utils::GetColorAppStream(GetBorderColor(),false) << " 2 J 0 j\n"
<< "[" << GetBorderDash().nDash << " "
<< GetBorderDash().nGap << "] "
<< GetBorderDash().nPhase << " d\n";
@@ -383,7 +383,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
{
CFX_ByteString sSpellCheck = CPWL_Utils::GetSpellCheckAppStream(m_pEdit, m_pSpellCheck, ptOffset, &wrVisible);
if (sSpellCheck.GetLength() > 0)
- sText << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,1,0,0),FALSE) << sSpellCheck;
+ sText << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,1,0,0),false) << sSpellCheck;
}
if (sText.GetLength() > 0)
@@ -487,7 +487,7 @@ IFX_SystemHandler* pSysHandler = GetSystemHandler();
}
}
-FX_BOOL CPWL_Edit::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Edit::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
@@ -496,16 +496,16 @@ FX_BOOL CPWL_Edit::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
if (m_bMouseDown)
InvalidateRect();
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
SetCapture();
m_pEdit->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDblClk(point, nFlag);
@@ -514,7 +514,7 @@ FX_BOOL CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
m_pEdit->SelectAll();
}
- return TRUE;
+ return true;
}
#define WM_PWLEDIT_UNDO 0x01
@@ -526,16 +526,16 @@ FX_BOOL CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
#define WM_PWLEDIT_SELECTALL 0x07
#define WM_PWLEDIT_SUGGEST 0x08
-FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- if (m_bMouseDown) return FALSE;
+ if (m_bMouseDown) return false;
CPWL_Wnd::OnRButtonUp(point, nFlag);
- if (!HasFlag(PES_TEXTOVERFLOW) && !ClientHitTest(point)) return TRUE;
+ if (!HasFlag(PES_TEXTOVERFLOW) && !ClientHitTest(point)) return true;
IFX_SystemHandler* pSH = GetSystemHandler();
- if (!pSH) return FALSE;
+ if (!pSH) return false;
SetFocus();
@@ -543,7 +543,7 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
CFX_WideString swLatin = m_pEdit->GetRangeText(wrLatin);
FX_HMENU hPopup = pSH->CreatePopupMenu();
- if (!hPopup) return FALSE;
+ if (!hPopup) return false;
CFX_ByteStringArray sSuggestWords;
CPDF_Point ptPopup = point;
@@ -587,9 +587,9 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
pSH->AppendMenuItem(hPopup, 0, L"");
if (!m_pEdit->CanUndo())
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_UNDO, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_UNDO, false);
if (!m_pEdit->CanRedo())
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_REDO, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_REDO, false);
}
pSH->AppendMenuItem(hPopup, WM_PWLEDIT_CUT,
@@ -603,32 +603,32 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
CFX_WideString swText = pSH->GetClipboardText(GetAttachedHWnd());
if (swText.IsEmpty())
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, false);
if (!m_pEdit->IsSelected())
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, false);
}
if (IsReadOnly())
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, false);
}
if (HasFlag(PES_PASSWORD))
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, false);
}
if (HasFlag(PES_NOREAD))
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, false);
}
pSH->AppendMenuItem(hPopup, 0, L"");
@@ -637,7 +637,7 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
if (m_pEdit->GetTotalWords() == 0)
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_SELECTALL, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_SELECTALL, false);
}
int32_t x, y;
@@ -699,12 +699,12 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
pSH->DestroyMenu(hPopup);
- return TRUE;
+ return true;
}
void CPWL_Edit::OnSetFocus()
{
- SetEditCaret(TRUE);
+ SetEditCaret(true);
if (!IsReadOnly())
{
@@ -712,15 +712,15 @@ void CPWL_Edit::OnSetFocus()
pFocusHandler->OnSetFocus(this);
}
- m_bFocus = TRUE;
+ m_bFocus = true;
}
void CPWL_Edit::OnKillFocus()
{
- ShowVScrollBar(FALSE);
+ ShowVScrollBar(false);
m_pEdit->SelectNone();
- SetCaret(FALSE, CPDF_Point(0.0f,0.0f), CPDF_Point(0.0f,0.0f));
+ SetCaret(false, CPDF_Point(0.0f,0.0f), CPDF_Point(0.0f,0.0f));
SetCharSet(0);
@@ -730,20 +730,20 @@ void CPWL_Edit::OnKillFocus()
pFocusHandler->OnKillFocus(this);
}
- m_bFocus = FALSE;
+ m_bFocus = false;
}
-void CPWL_Edit::SetHorzScale(int32_t nHorzScale, FX_BOOL bPaint/* = TRUE*/)
+void CPWL_Edit::SetHorzScale(int32_t nHorzScale, bool bPaint/* = true*/)
{
m_pEdit->SetHorzScale(nHorzScale, bPaint);
}
-void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint/* = TRUE*/)
+void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace, bool bPaint/* = true*/)
{
m_pEdit->SetCharSpace(fCharSpace, bPaint);
}
-void CPWL_Edit::SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint/* = TRUE*/)
+void CPWL_Edit::SetLineLeading(FX_FLOAT fLineLeading, bool bPaint/* = true*/)
{
m_pEdit->SetLineLeading(fLineLeading, bPaint);
}
@@ -813,7 +813,7 @@ CPDF_Point CPWL_Edit::GetWordRightBottomPoint(const CPVT_WordPlace& wpWord)
return pt;
}
-FX_BOOL CPWL_Edit::IsTextFull() const
+bool CPWL_Edit::IsTextFull() const
{
return m_pEdit->IsTextFull();
}
@@ -840,7 +840,7 @@ void CPWL_Edit::SetCharArray(int32_t nCharArray)
if (HasFlag(PES_CHARARRAY) && nCharArray > 0)
{
m_pEdit->SetCharArray(nCharArray);
- m_pEdit->SetTextOverflow(TRUE);
+ m_pEdit->SetTextOverflow(true);
if (HasFlag(PWS_AUTOFONTSIZE))
{
@@ -849,7 +849,7 @@ void CPWL_Edit::SetCharArray(int32_t nCharArray)
FX_FLOAT fFontSize = GetCharArrayAutoFontSize(pFontMap->GetPDFFont(0), GetClientRect(), nCharArray);
if (fFontSize > 0.0f)
{
- m_pEdit->SetAutoFontSize(FALSE);
+ m_pEdit->SetAutoFontSize(false);
m_pEdit->SetFontSize(fFontSize);
}
}
@@ -873,7 +873,7 @@ CPDF_Rect CPWL_Edit::GetFocusRect() const
return CPDF_Rect();
}
-void CPWL_Edit::ShowVScrollBar(FX_BOOL bShow)
+void CPWL_Edit::ShowVScrollBar(bool bShow)
{
if (CPWL_ScrollBar * pScroll = GetVScrollBar())
{
@@ -881,35 +881,35 @@ void CPWL_Edit::ShowVScrollBar(FX_BOOL bShow)
{
if (!pScroll->IsVisible())
{
- pScroll->SetVisible(TRUE);
+ pScroll->SetVisible(true);
CPDF_Rect rcWindow = GetWindowRect();
m_rcOldWindow = rcWindow;
rcWindow.right += PWL_SCROLLBAR_WIDTH;
- Move(rcWindow, TRUE, TRUE);
+ Move(rcWindow, true, true);
}
}
else
{
if (pScroll->IsVisible())
{
- pScroll->SetVisible(FALSE);
- Move(m_rcOldWindow, TRUE, TRUE);
+ pScroll->SetVisible(false);
+ Move(m_rcOldWindow, true, true);
}
}
}
}
-FX_BOOL CPWL_Edit::IsVScrollBarVisible() const
+bool CPWL_Edit::IsVScrollBarVisible() const
{
if (CPWL_ScrollBar * pScroll = GetVScrollBar())
{
return pScroll->IsVisible();
}
- return FALSE;
+ return false;
}
-void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled)
+void CPWL_Edit::EnableSpellCheck(bool bEnabled)
{
if (bEnabled)
AddFlag(PES_SPELLCHECK);
@@ -917,16 +917,16 @@ void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled)
RemoveFlag(PES_SPELLCHECK);
}
-FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
- if (m_bMouseDown) return TRUE;
+ if (m_bMouseDown) return true;
if (nChar == FWL_VKEY_Delete)
{
if (m_pFillerNotify)
{
- FX_BOOL bRC = TRUE;
- FX_BOOL bExit = FALSE;
+ bool bRC = true;
+ bool bExit = false;
CFX_WideString strChange;
CFX_WideString strChangeEx;
@@ -936,27 +936,27 @@ FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
if (nSelStart == nSelEnd)
nSelEnd = nSelStart + 1;
- m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), FWL_VKEY_Delete, strChange, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, nFlag);
- if (!bRC) return FALSE;
- if (bExit) return FALSE;
+ m_pFillerNotify->OnBeforeKeyStroke(true, GetAttachedData(), FWL_VKEY_Delete, strChange, strChangeEx, nSelStart, nSelEnd, true, bRC, bExit, nFlag);
+ if (!bRC) return false;
+ if (bExit) return false;
}
}
- FX_BOOL bRet = CPWL_EditCtrl::OnKeyDown(nChar, nFlag);
+ bool bRet = CPWL_EditCtrl::OnKeyDown(nChar, nFlag);
if (nChar == FWL_VKEY_Delete)
{
if (m_pFillerNotify)
{
- FX_BOOL bExit = FALSE;
- m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,nFlag);
- if (bExit) return FALSE;
+ bool bExit = false;
+ m_pFillerNotify->OnAfterKeyStroke(true, GetAttachedData(), bExit,nFlag);
+ if (bExit) return false;
}
}
//In case of implementation swallow the OnKeyDown event.
if(IsProceedtoOnChar(nChar, nFlag))
- return TRUE;
+ return true;
return bRet;
}
@@ -965,11 +965,11 @@ FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
*In case of implementation swallow the OnKeyDown event.
*If the event is swallowed, implementation may do other unexpected things, which is not the control means to do.
*/
-FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
+bool CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
{
- FX_BOOL bCtrl = IsCTRLpressed(nFlag);
- FX_BOOL bAlt = IsALTpressed(nFlag);
+ bool bCtrl = IsCTRLpressed(nFlag);
+ bool bAlt = IsALTpressed(nFlag);
if(bCtrl && !bAlt)
{
//hot keys for edit control.
@@ -980,7 +980,7 @@ FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
case 'X':
case 'A':
case 'Z':
- return TRUE;
+ return true;
default:
break;
}
@@ -992,22 +992,22 @@ FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
case FWL_VKEY_Back:
case FWL_VKEY_Return:
case FWL_VKEY_Space:
- return TRUE;
+ return true;
default:
break;
}
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
- if (m_bMouseDown) return TRUE;
+ if (m_bMouseDown) return true;
- FX_BOOL bRC = TRUE;
- FX_BOOL bExit = FALSE;
+ bool bRC = true;
+ bool bExit = false;
- FX_BOOL bCtrl = IsCTRLpressed(nFlag);
+ bool bCtrl = IsCTRLpressed(nFlag);
if (!bCtrl)
{
if (m_pFillerNotify)
@@ -1036,12 +1036,12 @@ FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
}
CFX_WideString strChangeEx;
- m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), nKeyCode, swChange, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, nFlag);
+ m_pFillerNotify->OnBeforeKeyStroke(true, GetAttachedData(), nKeyCode, swChange, strChangeEx, nSelStart, nSelEnd, true, bRC, bExit, nFlag);
}
}
- if (!bRC) return TRUE;
- if (bExit) return FALSE;
+ if (!bRC) return true;
+ if (bExit) return false;
if (IFX_Edit_FontMap * pFontMap = GetFontMap())
{
@@ -1052,21 +1052,21 @@ FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
SetCharSet(nNewCharSet);
}
}
- FX_BOOL bRet = CPWL_EditCtrl::OnChar(nChar,nFlag);
+ bool bRet = CPWL_EditCtrl::OnChar(nChar,nFlag);
if (!bCtrl)
{
if (m_pFillerNotify)
{
- m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,nFlag);
- if (bExit) return FALSE;
+ m_pFillerNotify->OnAfterKeyStroke(true, GetAttachedData(), bExit,nFlag);
+ if (bExit) return false;
}
}
return bRet;
}
-FX_BOOL CPWL_Edit::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Edit::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
if (HasFlag(PES_MULTILINE))
{
@@ -1082,10 +1082,10 @@ FX_BOOL CPWL_Edit::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD
}
SetScrollPos(ptScroll);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void CPWL_Edit::OnInsertReturn(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
@@ -1205,22 +1205,22 @@ CPVT_WordRange CPWL_Edit::CombineWordRange(const CPVT_WordRange& wr1, const CPVT
CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CPDF_Point& point) const
{
- return GetSameWordsRange(m_pEdit->SearchWordPlace(point), TRUE, FALSE);
+ return GetSameWordsRange(m_pEdit->SearchWordPlace(point), true, false);
}
CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CPVT_WordPlace & place) const
{
- return GetSameWordsRange(place, TRUE, FALSE);
+ return GetSameWordsRange(place, true, false);
}
CPVT_WordRange CPWL_Edit::GetArabicWordsRange(const CPVT_WordPlace & place) const
{
- return GetSameWordsRange(place, FALSE, TRUE);
+ return GetSameWordsRange(place, false, true);
}
#define PWL_ISARABICWORD(word) ((word >= 0x0600 && word <= 0x06FF) || (word >= 0xFB50 && word <= 0xFEFC))
-CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, FX_BOOL bLatin, FX_BOOL bArabic) const
+CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, bool bLatin, bool bArabic) const
{
CPVT_WordRange range;
diff --git a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
index 0d14587f66..11e1fe7d37 100644
--- a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
@@ -22,7 +22,7 @@
CPWL_EditCtrl::CPWL_EditCtrl() :
m_pEdit(NULL),
m_pEditCaret(NULL),
- m_bMouseDown(FALSE),
+ m_bMouseDown(false),
m_pEditNotify(NULL),
m_nCharSet(DEFAULT_CHARSET),
m_nCodePage(0)
@@ -50,7 +50,7 @@ void CPWL_EditCtrl::OnCreated()
m_pEdit->Initialize();
}
-FX_BOOL CPWL_EditCtrl::IsWndHorV()
+bool CPWL_EditCtrl::IsWndHorV()
{
CPDF_Matrix mt = GetWindowMatrix();
CPDF_Point point1(0,1);
@@ -167,17 +167,17 @@ FX_FLOAT CPWL_EditCtrl::GetFontSize() const
return m_pEdit->GetFontSize();
}
-FX_BOOL CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
- if (m_bMouseDown) return TRUE;
+ if (m_bMouseDown) return true;
- FX_BOOL bRet = CPWL_Wnd::OnKeyDown(nChar,nFlag);
+ bool bRet = CPWL_Wnd::OnKeyDown(nChar,nFlag);
//FILTER
switch (nChar)
{
default:
- return FALSE;
+ return false;
case FWL_VKEY_Delete:
case FWL_VKEY_Up:
case FWL_VKEY_Down:
@@ -209,35 +209,35 @@ FX_BOOL CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
case FWL_VKEY_Delete:
Delete();
- return TRUE;
+ return true;
case FWL_VKEY_Insert:
if (IsSHIFTpressed(nFlag))
PasteText();
- return TRUE;
+ return true;
case FWL_VKEY_Up:
- m_pEdit->OnVK_UP(IsSHIFTpressed(nFlag),FALSE);
- return TRUE;
+ m_pEdit->OnVK_UP(IsSHIFTpressed(nFlag),false);
+ return true;
case FWL_VKEY_Down:
- m_pEdit->OnVK_DOWN(IsSHIFTpressed(nFlag),FALSE);
- return TRUE;
+ m_pEdit->OnVK_DOWN(IsSHIFTpressed(nFlag),false);
+ return true;
case FWL_VKEY_Left:
- m_pEdit->OnVK_LEFT(IsSHIFTpressed(nFlag),FALSE);
- return TRUE;
+ m_pEdit->OnVK_LEFT(IsSHIFTpressed(nFlag),false);
+ return true;
case FWL_VKEY_Right:
- m_pEdit->OnVK_RIGHT(IsSHIFTpressed(nFlag),FALSE);
- return TRUE;
+ m_pEdit->OnVK_RIGHT(IsSHIFTpressed(nFlag),false);
+ return true;
case FWL_VKEY_Home:
m_pEdit->OnVK_HOME(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- return TRUE;
+ return true;
case FWL_VKEY_End:
m_pEdit->OnVK_END(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- return TRUE;
+ return true;
case FWL_VKEY_Unknown:
if (!IsSHIFTpressed(nFlag))
Clear();
else
CutText();
- return TRUE;
+ return true;
default:
break;
}
@@ -245,9 +245,9 @@ FX_BOOL CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
return bRet;
}
-FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
- if (m_bMouseDown) return TRUE;
+ if (m_bMouseDown) return true;
CPWL_Wnd::OnChar(nChar,nFlag);
@@ -256,14 +256,14 @@ FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
case 0x0A:
case 0x1B:
- return FALSE;
+ return false;
default:
break;
}
- FX_BOOL bCtrl = IsCTRLpressed(nFlag);
- FX_BOOL bAlt = IsALTpressed(nFlag);
- FX_BOOL bShift = IsSHIFTpressed(nFlag);
+ bool bCtrl = IsCTRLpressed(nFlag);
+ bool bAlt = IsALTpressed(nFlag);
+ bool bShift = IsSHIFTpressed(nFlag);
FX_WORD word = nChar;
@@ -273,29 +273,29 @@ FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
case 'C' - 'A' + 1:
CopyText();
- return TRUE;
+ return true;
case 'V' - 'A' + 1:
PasteText();
- return TRUE;
+ return true;
case 'X' - 'A' + 1:
CutText();
- return TRUE;
+ return true;
case 'A' - 'A' + 1:
SelectAll();
- return TRUE;
+ return true;
case 'Z' - 'A' + 1:
if (bShift)
Redo();
else
Undo();
- return TRUE;
+ return true;
default:
if (nChar < 32)
- return FALSE;
+ return false;
}
}
- if (IsReadOnly()) return TRUE;
+ if (IsReadOnly()) return true;
if (m_pEdit->IsSelected() && word == FWL_VKEY_Back)
word = FWL_VKEY_Unknown;
@@ -319,10 +319,10 @@ FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
break;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_EditCtrl::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
@@ -331,16 +331,16 @@ FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
if (m_bMouseDown)
InvalidateRect();
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
SetCapture();
m_pEdit->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_EditCtrl::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
@@ -351,20 +351,20 @@ FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
SetFocus();
ReleaseCapture();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_EditCtrl::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_EditCtrl::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnMouseMove(point,nFlag);
if (m_bMouseDown)
- m_pEdit->OnMouseMove(point,FALSE,FALSE);
+ m_pEdit->OnMouseMove(point,false,false);
- return TRUE;
+ return true;
}
CPDF_Rect CPWL_EditCtrl::GetContentRect() const
@@ -372,7 +372,7 @@ CPDF_Rect CPWL_EditCtrl::GetContentRect() const
return m_pEdit->GetContentRect();
}
-void CPWL_EditCtrl::SetEditCaret(FX_BOOL bVisible)
+void CPWL_EditCtrl::SetEditCaret(bool bVisible)
{
CPDF_Point ptHead(0,0),ptFoot(0,0);
@@ -418,18 +418,18 @@ void CPWL_EditCtrl::GetCaretPos(int32_t& x, int32_t& y) const
PWLtoWnd(ptHead, x, y);
}
-void CPWL_EditCtrl::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
+void CPWL_EditCtrl::SetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
{
if (m_pEditCaret)
{
if (!IsFocused() || m_pEdit->IsSelected())
- bVisible = FALSE;
+ bVisible = false;
m_pEditCaret->SetCaret(bVisible, ptHead, ptFoot);
}
}
-FX_BOOL CPWL_EditCtrl::IsModified() const
+bool CPWL_EditCtrl::IsModified() const
{
return m_pEdit->IsModified();
}
@@ -466,7 +466,7 @@ void CPWL_EditCtrl::Paint()
m_pEdit->Paint();
}
-void CPWL_EditCtrl::EnableRefresh(FX_BOOL bRefresh)
+void CPWL_EditCtrl::EnableRefresh(bool bRefresh)
{
if (m_pEdit)
m_pEdit->EnableRefresh(bRefresh);
@@ -578,7 +578,7 @@ void CPWL_EditCtrl::CutText()
{
}
-void CPWL_EditCtrl::ShowVScrollBar(FX_BOOL bShow)
+void CPWL_EditCtrl::ShowVScrollBar(bool bShow)
{
}
@@ -612,12 +612,12 @@ void CPWL_EditCtrl::Backspace()
m_pEdit->Backspace();
}
-FX_BOOL CPWL_EditCtrl::CanUndo() const
+bool CPWL_EditCtrl::CanUndo() const
{
return !IsReadOnly() && m_pEdit->CanUndo();
}
-FX_BOOL CPWL_EditCtrl::CanRedo() const
+bool CPWL_EditCtrl::CanRedo() const
{
return !IsReadOnly() && m_pEdit->CanRedo();
}
@@ -651,11 +651,11 @@ void CPWL_EditCtrl::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
if (IsFloatBigger(Info.fPlateWidth,Info.fContentMax-Info.fContentMin)
|| IsFloatEqual(Info.fPlateWidth,Info.fContentMax-Info.fContentMin))
{
- ShowVScrollBar(FALSE);
+ ShowVScrollBar(false);
}
else
{
- ShowVScrollBar(TRUE);
+ ShowVScrollBar(true);
}
}
@@ -664,7 +664,7 @@ void CPWL_EditCtrl::IOnSetScrollPosY(FX_FLOAT fy)
OnNotify(this, PNM_SETSCROLLPOS,SBT_VSCROLL, (intptr_t)&fy);
}
-void CPWL_EditCtrl::IOnSetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot, const CPVT_WordPlace& place)
+void CPWL_EditCtrl::IOnSetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot, const CPVT_WordPlace& place)
{
PWL_CARET_INFO cInfo;
cInfo.bVisible = bVisible;
@@ -717,6 +717,6 @@ void CPWL_EditCtrl::SetReadyToInput()
if (m_bMouseDown)
{
ReleaseCapture();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
}
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
index 50b321dfac..2f02973f82 100644
--- a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
@@ -72,7 +72,7 @@ CFX_ByteString CPWL_FontMap::GetPDFFontAlias(int32_t nFontIndex)
return "";
}
-FX_BOOL CPWL_FontMap::KnowWord(int32_t nFontIndex, FX_WORD word)
+bool CPWL_FontMap::KnowWord(int32_t nFontIndex, FX_WORD word)
{
if (nFontIndex >=0 && nFontIndex < m_aData.GetSize())
{
@@ -82,7 +82,7 @@ FX_BOOL CPWL_FontMap::KnowWord(int32_t nFontIndex, FX_WORD word)
}
}
- return FALSE;
+ return false;
}
int32_t CPWL_FontMap::GetWordFontIndex(FX_WORD word, int32_t nCharset, int32_t nFontIndex)
@@ -106,13 +106,13 @@ int32_t CPWL_FontMap::GetWordFontIndex(FX_WORD word, int32_t nCharset, int32_t n
}
}
- int32_t nNewFontIndex = GetFontIndex(GetNativeFontName(nCharset), nCharset, TRUE);
+ int32_t nNewFontIndex = GetFontIndex(GetNativeFontName(nCharset), nCharset, true);
if (nNewFontIndex >= 0)
{
if (KnowWord(nNewFontIndex, word))
return nNewFontIndex;
}
- nNewFontIndex = GetFontIndex("Arial Unicode MS", DEFAULT_CHARSET, FALSE);
+ nNewFontIndex = GetFontIndex("Arial Unicode MS", DEFAULT_CHARSET, false);
if (nNewFontIndex >= 0)
{
if (KnowWord(nNewFontIndex, word))
@@ -189,7 +189,7 @@ void CPWL_FontMap::Initial(const FX_CHAR* fontname)
if (sFontName.IsEmpty())
sFontName = DEFAULT_FONT_NAME;
- GetFontIndex(sFontName, ANSI_CHARSET, FALSE);
+ GetFontIndex(sFontName, ANSI_CHARSET, false);
}
@@ -206,15 +206,15 @@ const char* g_sDEStandardFontName[] = {"Courier", "Courier-Bold", "Courier-BoldO
"Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic",
"Symbol", "ZapfDingbats"};
-FX_BOOL CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName)
+bool CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName)
{
for (int32_t i=0; i<14; i++)
{
if (sFontName == g_sDEStandardFontName[i])
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
int32_t CPWL_FontMap::FindFont(const CFX_ByteString& sFontName, int32_t nCharset)
@@ -234,7 +234,7 @@ int32_t CPWL_FontMap::FindFont(const CFX_ByteString& sFontName, int32_t nCharset
return -1;
}
-int32_t CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName, int32_t nCharset, FX_BOOL bFind)
+int32_t CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName, int32_t nCharset, bool bFind)
{
int32_t nFontIndex = FindFont(EncodeFontAlias(sFontName, nCharset), nCharset);
if (nFontIndex >= 0)
diff --git a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
index 71174dfb0a..85c4bc06c9 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
@@ -145,12 +145,12 @@ int32_t CPWL_Icon::GetScaleMethod()
return 0;
}
-FX_BOOL CPWL_Icon::IsProportionalScale()
+bool CPWL_Icon::IsProportionalScale()
{
if (m_pIconFit)
return m_pIconFit->IsProportionalScale();
- return FALSE;
+ return false;
}
void CPWL_Icon::GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom)
@@ -175,12 +175,12 @@ void CPWL_Icon::GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom)
}
}
-FX_BOOL CPWL_Icon::GetFittingBounds()
+bool CPWL_Icon::GetFittingBounds()
{
if (m_pIconFit)
return m_pIconFit->GetFittingBounds();
- return FALSE;
+ return false;
}
void CPWL_Icon::GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale)
diff --git a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
index 157eba633d..ecbb0fd3c0 100644
--- a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
@@ -22,7 +22,7 @@
CPWL_IconList_Item::CPWL_IconList_Item() :
m_nIconIndex(-1),
m_pData(NULL),
- m_bSelected(FALSE),
+ m_bSelected(false),
m_pText(NULL)
{
}
@@ -67,7 +67,7 @@ void CPWL_IconList_Item::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matr
m_crIcon, m_pText->GetTextColor(), GetTransparency());
}
-void CPWL_IconList_Item::SetSelect(FX_BOOL bSelected)
+void CPWL_IconList_Item::SetSelect(bool bSelected)
{
m_bSelected = bSelected;
@@ -78,7 +78,7 @@ void CPWL_IconList_Item::SetSelect(FX_BOOL bSelected)
}
-FX_BOOL CPWL_IconList_Item::IsSelected() const
+bool CPWL_IconList_Item::IsSelected() const
{
return m_bSelected;
}
@@ -121,7 +121,7 @@ void CPWL_IconList_Item::RePosChildWnd()
rcClient.left += (PWL_IconList_ITEM_ICON_LEFTMARGIN + PWL_IconList_ITEM_WIDTH + PWL_IconList_ITEM_ICON_LEFTMARGIN);
- m_pText->Move(rcClient, TRUE, FALSE);
+ m_pText->Move(rcClient, true, false);
}
void CPWL_IconList_Item::SetIconFillColor(const CPWL_Color& color)
@@ -151,8 +151,8 @@ void CPWL_IconList_Item::OnDisabled()
CPWL_IconList_Content::CPWL_IconList_Content(int32_t nListCount) :
m_nSelectIndex(-1),
m_pNotify(NULL),
- m_bEnableNotify(TRUE),
- m_bMouseDown(FALSE),
+ m_bEnableNotify(true),
+ m_bMouseDown(false),
m_nListCount(nListCount)
{
}
@@ -192,29 +192,29 @@ void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM & cp)
}
}
-FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
SetFocus();
SetCapture();
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
int32_t nItemIndex = FindItemIndex(point);
SetSelect(nItemIndex);
ScrollToItem(nItemIndex);
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
ReleaseCapture();
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
if (m_bMouseDown)
{
@@ -223,10 +223,10 @@ FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nF
ScrollToItem(nItemIndex);
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
switch (nChar)
{
@@ -237,7 +237,7 @@ FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
SetSelect(nItemIndex);
ScrollToItem(nItemIndex);
}
- return TRUE;
+ return true;
case FWL_VKEY_Down:
if (m_nSelectIndex < m_nListCount-1)
{
@@ -245,10 +245,10 @@ FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
SetSelect(nItemIndex);
ScrollToItem(nItemIndex);
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
int32_t CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point)
@@ -307,8 +307,8 @@ void CPWL_IconList_Content::SetSelect(int32_t nIndex)
{
if (m_nSelectIndex != nIndex)
{
- SelectItem(m_nSelectIndex, FALSE);
- SelectItem(nIndex, TRUE);
+ SelectItem(m_nSelectIndex, false);
+ SelectItem(nIndex, true);
m_nSelectIndex = nIndex;
if (IPWL_IconList_Notify* pNotify = GetNotify())
@@ -333,12 +333,12 @@ void CPWL_IconList_Content::SetNotify(IPWL_IconList_Notify* pNotify)
m_pNotify = pNotify;
}
-void CPWL_IconList_Content::EnableNotify(FX_BOOL bNotify)
+void CPWL_IconList_Content::EnableNotify(bool bNotify)
{
m_bEnableNotify = bNotify;
}
-void CPWL_IconList_Content::SelectItem(int32_t nItemIndex, FX_BOOL bSelect)
+void CPWL_IconList_Content::SelectItem(int32_t nItemIndex, bool bSelect)
{
if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
{
@@ -423,7 +423,7 @@ void CPWL_IconList::RePosChildWnd()
CPWL_Wnd::RePosChildWnd();
if (m_pListContent)
- m_pListContent->Move(GetClientRect(), TRUE, FALSE);
+ m_pListContent->Move(GetClientRect(), true, false);
}
void CPWL_IconList::CreateChildWnd(const PWL_CREATEPARAM & cp)
@@ -442,7 +442,7 @@ void CPWL_IconList::OnCreated()
{
pScrollBar->RemoveFlag(PWS_AUTOTRANSPARENT);
pScrollBar->SetTransparency(255);
- pScrollBar->SetNotifyForever(TRUE);
+ pScrollBar->SetNotifyForever(true);
}
}
@@ -463,7 +463,7 @@ void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
{
if (!pScrollBar->IsVisible())
{
- pScrollBar->SetVisible(TRUE);
+ pScrollBar->SetVisible(true);
RePosChildWnd();
}
else
@@ -474,7 +474,7 @@ void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
{
if (pScrollBar->IsVisible())
{
- pScrollBar->SetVisible(FALSE);
+ pScrollBar->SetVisible(false);
RePosChildWnd();
}
@@ -522,7 +522,7 @@ void CPWL_IconList::SetNotify(IPWL_IconList_Notify* pNotify)
m_pListContent->SetNotify(pNotify);
}
-void CPWL_IconList::EnableNotify(FX_BOOL bNotify)
+void CPWL_IconList::EnableNotify(bool bNotify)
{
m_pListContent->EnableNotify(bNotify);
}
@@ -552,7 +552,7 @@ void CPWL_IconList::SetIconFillColor(const CPWL_Color& color)
m_pListContent->SetIconFillColor(color);
}
-FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
CPDF_Point ptScroll = m_pListContent->GetScrollPos();
CPDF_Rect rcScroll = m_pListContent->GetScrollArea();
@@ -583,10 +583,10 @@ FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_D
if (CPWL_ScrollBar* pScrollBar = GetVScrollBar())
pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptNew.y);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Label.cpp b/fpdfsdk/src/pdfwindow/PWL_Label.cpp
index e1780c69a8..3e231d5244 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Label.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Label.cpp
@@ -39,7 +39,7 @@ void CPWL_Label::OnCreated()
if (HasFlag(PES_TEXTOVERFLOW))
{
SetClipRect(CPDF_Rect(0.0f,0.0f,0.0f,0.0f));
- m_pEdit->SetTextOverflow(TRUE);
+ m_pEdit->SetTextOverflow(true);
}
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
index 48fb409b7b..d0e9cc6dfd 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
@@ -49,7 +49,7 @@ void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
{
if (pScroll->IsVisible())
{
- pScroll->SetVisible(FALSE);
+ pScroll->SetVisible(false);
m_pList->RePosChildWnd();
}
}
@@ -57,7 +57,7 @@ void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
{
if (!pScroll->IsVisible())
{
- pScroll->SetVisible(TRUE);
+ pScroll->SetVisible(true);
m_pList->RePosChildWnd();
}
}
@@ -79,8 +79,8 @@ void CPWL_List_Notify::IOnInvalidateRect(CPDF_Rect * pRect)
CPWL_ListBox::CPWL_ListBox() :
m_pList(NULL),
m_pListNotify(NULL),
- m_bMouseDown(FALSE),
- m_bHoverSel(FALSE),
+ m_bMouseDown(false),
+ m_bHoverSel(false),
m_pFillerNotify(NULL)
{
m_pList = IFX_List::NewList();
@@ -229,16 +229,16 @@ void CPWL_ListBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pU
}
}
-FX_BOOL CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
CPWL_Wnd::OnKeyDown(nChar, nFlag);
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
switch (nChar)
{
default:
- return FALSE;
+ return false;
case FWL_VKEY_Up:
case FWL_VKEY_Down:
case FWL_VKEY_Home:
@@ -272,33 +272,33 @@ FX_BOOL CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
break;
}
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(TRUE,bExit,nFlag);
+ bool bExit = false;
+ OnNotifySelChanged(true,bExit,nFlag);
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
CPWL_Wnd::OnChar(nChar,nFlag);
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
- if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return FALSE;
+ if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return false;
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(TRUE,bExit, nFlag);
+ bool bExit = false;
+ OnNotifySelChanged(true,bExit, nFlag);
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
if (ClientHitTest(point))
{
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
SetFocus();
SetCapture();
@@ -306,31 +306,31 @@ FX_BOOL CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
m_pList->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_ListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
if (m_bMouseDown)
{
ReleaseCapture();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
}
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(FALSE,bExit,nFlag);
+ bool bExit = false;
+ OnNotifySelChanged(false,bExit,nFlag);
- return TRUE;
+ return true;
}
-void CPWL_ListBox::SetHoverSel(FX_BOOL bHoverSel)
+void CPWL_ListBox::SetHoverSel(bool bHoverSel)
{
m_bHoverSel = bHoverSel;
}
-FX_BOOL CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnMouseMove(point, nFlag);
@@ -346,7 +346,7 @@ FX_BOOL CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
m_pList->OnMouseMove(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return TRUE;
+ return true;
}
void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -405,19 +405,19 @@ void CPWL_ListBox::RePosChildWnd()
m_pList->SetPlateRect(GetListRect());
}
-void CPWL_ListBox::OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL & bExit, FX_DWORD nFlag)
+void CPWL_ListBox::OnNotifySelChanged(bool bKeyDown, bool & bExit, FX_DWORD nFlag)
{
if (m_pFillerNotify)
{
- FX_BOOL bRC = TRUE;
+ bool bRC = true;
CFX_WideString swChange = GetText();
CFX_WideString strChangeEx;
int nSelStart = 0;
int nSelEnd = swChange.GetLength();
- m_pFillerNotify->OnBeforeKeyStroke(FALSE, GetAttachedData(), 0, swChange, strChangeEx, nSelStart, nSelEnd, bKeyDown, bRC, bExit, nFlag);
+ m_pFillerNotify->OnBeforeKeyStroke(false, GetAttachedData(), 0, swChange, strChangeEx, nSelStart, nSelEnd, bKeyDown, bRC, bExit, nFlag);
if (bExit) return;
- m_pFillerNotify->OnAfterKeyStroke(FALSE, GetAttachedData(), bExit,nFlag);
+ m_pFillerNotify->OnAfterKeyStroke(false, GetAttachedData(), bExit,nFlag);
}
}
@@ -498,12 +498,12 @@ void CPWL_ListBox::Reset()
m_pList->Cancel();
}
-FX_BOOL CPWL_ListBox::IsMultipleSel() const
+bool CPWL_ListBox::IsMultipleSel() const
{
if (m_pList)
return m_pList->IsMultipleSel();
- return FALSE;
+ return false;
}
int32_t CPWL_ListBox::GetCaretIndex() const
@@ -522,12 +522,12 @@ int32_t CPWL_ListBox::GetCurSel() const
return -1;
}
-FX_BOOL CPWL_ListBox::IsItemSelected(int32_t nItemIndex) const
+bool CPWL_ListBox::IsItemSelected(int32_t nItemIndex) const
{
if (m_pList)
return m_pList->IsItemSelected(nItemIndex);
- return FALSE;
+ return false;
}
int32_t CPWL_ListBox::GetTopVisibleIndex() const
@@ -578,9 +578,9 @@ CPDF_Rect CPWL_ListBox::GetListRect() const
return CPWL_Utils::DeflateRect(GetWindowRect(),(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
}
-FX_BOOL CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
if (zDelta < 0)
{
@@ -591,8 +591,8 @@ FX_BOOL CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DW
m_pList->OnVK_UP(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(FALSE,bExit, nFlag);
- return TRUE;
+ bool bExit = false;
+ OnNotifySelChanged(false,bExit, nFlag);
+ return true;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
index 3077e6293f..d2deacb4d2 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
@@ -52,7 +52,7 @@ CPDF_Rect CPWL_ListCtrl::GetScrollArea() const
void CPWL_ListCtrl::ResetFace()
{
- ResetAll(FALSE, 0);
+ ResetAll(false, 0);
}
void CPWL_ListCtrl::ResetContent(int32_t nStart)
@@ -60,7 +60,7 @@ void CPWL_ListCtrl::ResetContent(int32_t nStart)
if (nStart < 0)
nStart = 0;
if (nStart >= 0 && nStart < m_aChildren.GetSize())
- ResetAll(TRUE, nStart);
+ ResetAll(true, nStart);
}
FX_FLOAT CPWL_ListCtrl::GetContentsHeight(FX_FLOAT fLimitWidth)
@@ -91,7 +91,7 @@ FX_FLOAT CPWL_ListCtrl::GetContentsHeight(FX_FLOAT fLimitWidth)
return fRet;
}
-void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, int32_t nStart)
+void CPWL_ListCtrl::ResetAll(bool bMove, int32_t nStart)
{
CPDF_Rect rcClient = GetClientRect();
@@ -119,7 +119,7 @@ void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, int32_t nStart)
if (bMove)
{
FX_FLOAT fItemHeight = pChild->GetItemHeight(fWidth - fLeft - fRight);
- pChild->Move(CPDF_Rect(fLeft, fy-fItemHeight, fWidth - fRight, fy), TRUE, FALSE);
+ pChild->Move(CPDF_Rect(fLeft, fy-fItemHeight, fWidth - fRight, fy), true, false);
fy -= fItemHeight;
fy -= m_fItemSpace;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Note.cpp b/fpdfsdk/src/pdfwindow/PWL_Note.cpp
index 7ed1115a82..f3c5816c8d 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Note.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Note.cpp
@@ -60,13 +60,13 @@ void CPWL_Note_Options::RePosChildWnd()
if (rcClient.Width() > 15.0f)
{
rcClient.right -= 15.0f;
- m_pText->Move(rcClient, TRUE, FALSE);
- m_pText->SetVisible(TRUE);
+ m_pText->Move(rcClient, true, false);
+ m_pText->SetVisible(true);
}
else
{
- m_pText->Move(CPDF_Rect(0,0,0,0), TRUE, FALSE);
- m_pText->SetVisible(FALSE);
+ m_pText->Move(CPDF_Rect(0,0,0,0), true, false);
+ m_pText->SetVisible(false);
}
}
}
@@ -122,9 +122,9 @@ CPDF_Rect CPWL_Note_Options::GetContentRect() const
/* ------------------------------- CPWL_Note_Edit ------------------------------ */
-CPWL_Note_Edit::CPWL_Note_Edit() : m_bEnableNotify(TRUE),
+CPWL_Note_Edit::CPWL_Note_Edit() : m_bEnableNotify(true),
m_fOldItemHeight(0.0f),
- m_bSizeChanged(FALSE),
+ m_bSizeChanged(false),
m_fOldMin(0.0f),
m_fOldMax(0.0f)
{
@@ -136,33 +136,33 @@ CPWL_Note_Edit::~CPWL_Note_Edit()
void CPWL_Note_Edit::RePosChildWnd()
{
- m_bEnableNotify = FALSE;
+ m_bEnableNotify = false;
CPWL_Edit::RePosChildWnd();
- m_bEnableNotify = TRUE;
+ m_bEnableNotify = true;
m_fOldItemHeight = GetContentRect().Height();
}
void CPWL_Note_Edit::SetText(const FX_WCHAR* csText)
{
- m_bEnableNotify = FALSE;
+ m_bEnableNotify = false;
CPWL_Edit::SetText(csText);
- m_bEnableNotify = TRUE;
+ m_bEnableNotify = true;
m_fOldItemHeight = GetContentRect().Height();
}
void CPWL_Note_Edit::OnSetFocus()
{
- m_bEnableNotify = FALSE;
+ m_bEnableNotify = false;
CPWL_Edit::OnSetFocus();
- m_bEnableNotify = TRUE;
+ m_bEnableNotify = true;
- EnableSpellCheck(TRUE);
+ EnableSpellCheck(true);
}
void CPWL_Note_Edit::OnKillFocus()
{
- EnableSpellCheck(FALSE);
+ EnableSpellCheck(false);
if (CPWL_Wnd* pParent = GetParentWindow())
{
@@ -193,7 +193,7 @@ void CPWL_Note_Edit::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, int
if (!IsFloatEqual(pInfo->fContentMax, m_fOldMax) ||
!IsFloatEqual(pInfo->fContentMin, m_fOldMin))
{
- m_bSizeChanged = TRUE;
+ m_bSizeChanged = true;
if (CPWL_Wnd * pParent = GetParentWindow())
{
pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
@@ -218,7 +218,7 @@ void CPWL_Note_Edit::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, int
if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
{
PWL_CARET_INFO newInfo = *pInfo;
- newInfo.bVisible = TRUE;
+ newInfo.bVisible = true;
newInfo.ptHead = ChildToParent(pInfo->ptHead);
newInfo.ptFoot = ChildToParent(pInfo->ptFoot);
@@ -239,18 +239,18 @@ FX_FLOAT CPWL_Note_Edit::GetItemHeight(FX_FLOAT fLimitWidth)
if (!m_bSizeChanged)
return m_fOldItemHeight;
- m_bSizeChanged = FALSE;
+ m_bSizeChanged = false;
- EnableNotify(FALSE);
- EnableRefresh(FALSE);
- m_pEdit->EnableNotify(FALSE);
+ EnableNotify(false);
+ EnableRefresh(false);
+ m_pEdit->EnableNotify(false);
- Move(CPDF_Rect(0,0,fLimitWidth,0), TRUE, FALSE);
+ Move(CPDF_Rect(0,0,fLimitWidth,0), true, false);
FX_FLOAT fRet = GetContentRect().Height();
- m_pEdit->EnableNotify(TRUE);
- EnableNotify(TRUE);
- EnableRefresh(TRUE);
+ m_pEdit->EnableNotify(true);
+ EnableNotify(true);
+ EnableRefresh(true);
return fRet;
}
@@ -349,7 +349,7 @@ void CPWL_Note_Icon::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix*
/* --------------------------------- CPWL_Note_CloseBox ---------------------------------- */
-CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(FALSE)
+CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(false)
{
}
@@ -387,19 +387,19 @@ void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matr
0, CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), FXFILL_ALTERNATE);
}
-FX_BOOL CPWL_Note_CloseBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Note_CloseBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
SetBorderStyle(PBS_INSET);
InvalidateRect(NULL);
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
return CPWL_Button::OnLButtonDown(point,nFlag);
}
-FX_BOOL CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
SetBorderStyle(PBS_BEVELED);
InvalidateRect(NULL);
@@ -429,18 +429,18 @@ void CPWL_Note_Contents::CreateChildWnd(const PWL_CREATEPARAM & cp)
ecp.pParentWnd = this;
ecp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_MULTILINE | PES_AUTORETURN | PES_TEXTOVERFLOW | PES_UNDO | PES_SPELLCHECK;
- m_pEdit->EnableNotify(FALSE);
+ m_pEdit->EnableNotify(false);
m_pEdit->Create(ecp);
- m_pEdit->EnableNotify(TRUE);
+ m_pEdit->EnableNotify(true);
}
void CPWL_Note_Contents::SetText(const CFX_WideString& sText)
{
if (m_pEdit)
{
- m_pEdit->EnableNotify(FALSE);
+ m_pEdit->EnableNotify(false);
m_pEdit->SetText(sText.c_str());
- m_pEdit->EnableNotify(TRUE);
+ m_pEdit->EnableNotify(true);
OnNotify(m_pEdit, PNM_NOTEEDITCHANGED, 0, 0);
}
}
@@ -551,9 +551,9 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
int32_t nIndex = GetItemIndex(pWnd);
if (nIndex < 0) nIndex = 0;
- m_pEdit->EnableNotify(FALSE);
+ m_pEdit->EnableNotify(false);
ResetContent(nIndex);
- m_pEdit->EnableNotify(TRUE);
+ m_pEdit->EnableNotify(true);
for (int32_t i=nIndex+1, sz=m_aChildren.GetSize(); i<sz; i++)
{
@@ -576,7 +576,7 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
{
PWL_CARET_INFO newInfo = *pInfo;
- newInfo.bVisible = TRUE;
+ newInfo.bVisible = true;
newInfo.ptHead = ChildToParent(pInfo->ptHead);
newInfo.ptFoot = ChildToParent(pInfo->ptFoot);
@@ -588,9 +588,9 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
return;
case PNM_NOTERESET:
{
- m_pEdit->EnableNotify(FALSE);
+ m_pEdit->EnableNotify(false);
ResetContent(0);
- m_pEdit->EnableNotify(TRUE);
+ m_pEdit->EnableNotify(true);
for (int32_t i=1, sz=m_aChildren.GetSize(); i<sz; i++)
{
@@ -598,9 +598,9 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
pChild->OnNotify(this, PNM_NOTERESET, 0, 0);
}
- m_pEdit->EnableNotify(FALSE);
+ m_pEdit->EnableNotify(false);
ResetContent(0);
- m_pEdit->EnableNotify(TRUE);
+ m_pEdit->EnableNotify(true);
}
return;
}
@@ -608,19 +608,19 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
}
-FX_BOOL CPWL_Note_Contents::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Note_Contents::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
- if (CPWL_Wnd::OnLButtonDown(point,nFlag)) return TRUE;
+ if (CPWL_Wnd::OnLButtonDown(point,nFlag)) return true;
if (!m_pEdit->IsFocused())
{
m_pEdit->SetFocus();
}
- return TRUE;
+ return true;
}
-void CPWL_Note_Contents::SetEditFocus(FX_BOOL bLast)
+void CPWL_Note_Contents::SetEditFocus(bool bLast)
{
if (!m_pEdit->IsFocused())
{
@@ -634,7 +634,7 @@ CPWL_Edit* CPWL_Note_Contents::GetEdit() const
return m_pEdit;
}
-void CPWL_Note_Contents::EnableModify(FX_BOOL bEnabled)
+void CPWL_Note_Contents::EnableModify(bool bEnabled)
{
if (!bEnabled)
m_pEdit->AddFlag(PWS_READONLY);
@@ -654,7 +654,7 @@ void CPWL_Note_Contents::EnableModify(FX_BOOL bEnabled)
}
}
-void CPWL_Note_Contents::EnableRead(FX_BOOL bEnabled)
+void CPWL_Note_Contents::EnableRead(bool bEnabled)
{
if (!bEnabled)
m_pEdit->AddFlag(PES_NOREAD);
@@ -683,8 +683,8 @@ CPWL_NoteItem::CPWL_NoteItem() :
m_pPrivateData(NULL),
m_sAuthor(L""),
m_fOldItemHeight(0.0f),
- m_bSizeChanged(FALSE),
- m_bAllowModify(TRUE)
+ m_bSizeChanged(false),
+ m_bAllowModify(true)
{
}
@@ -748,7 +748,7 @@ void CPWL_NoteItem::RePosChildWnd()
rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetContentRect().Width() + 1.0f, rcClient.right);
rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().Height();
rcSubject.Normalize();
- m_pSubject->Move(rcSubject, TRUE, FALSE);
+ m_pSubject->Move(rcSubject, true, false);
m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubject));
CPDF_Rect rcDate = rcClient;
@@ -756,7 +756,7 @@ void CPWL_NoteItem::RePosChildWnd()
rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect().Width() - 1.0f, rcSubject.right);
rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Height();
rcDate.Normalize();
- m_pDateTime->Move(rcDate, TRUE, FALSE);
+ m_pDateTime->Move(rcDate, true, false);
m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDate));
CPDF_Rect rcContents = rcClient;
@@ -765,7 +765,7 @@ void CPWL_NoteItem::RePosChildWnd()
rcContents.top = rcDate.bottom - POPUP_ITEM_HEAD_BOTTOM;
rcContents.bottom += POPUP_ITEM_BOTTOMWIDTH;
rcContents.Normalize();
- m_pContents->Move(rcContents, TRUE, FALSE);
+ m_pContents->Move(rcContents, true, false);
m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcContents));
}
@@ -1038,7 +1038,7 @@ FX_FLOAT CPWL_NoteItem::GetItemHeight(FX_FLOAT fLimitWidth)
if (!m_bSizeChanged)
return m_fOldItemHeight;
- m_bSizeChanged = FALSE;
+ m_bSizeChanged = false;
ASSERT(m_pSubject != NULL);
ASSERT(m_pDateTime != NULL);
@@ -1066,26 +1066,26 @@ FX_FLOAT CPWL_NoteItem::GetItemRightMargin()
return POPUP_ITEM_SIDEMARGIN;
}
-FX_BOOL CPWL_NoteItem::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
+bool CPWL_NoteItem::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
{
if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point)))
{
- SetNoteFocus(FALSE);
+ SetNoteFocus(false);
}
CPWL_Wnd::OnLButtonDown(point,nFlag);
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_NoteItem::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_NoteItem::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point)))
{
- SetNoteFocus(FALSE);
+ SetNoteFocus(false);
PopupNoteItemMenu(point);
- return TRUE;
+ return true;
}
return CPWL_Wnd::OnRButtonUp(point,nFlag);
@@ -1096,7 +1096,7 @@ void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
switch (msg)
{
case PNM_NOTEEDITCHANGED:
- m_bSizeChanged = TRUE;
+ m_bSizeChanged = true;
if (CPWL_Wnd* pParent = GetParentWindow())
{
@@ -1107,7 +1107,7 @@ void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
{
PWL_CARET_INFO newInfo = *pInfo;
- newInfo.bVisible = TRUE;
+ newInfo.bVisible = true;
newInfo.ptHead = ChildToParent(pInfo->ptHead);
newInfo.ptFoot = ChildToParent(pInfo->ptFoot);
@@ -1118,7 +1118,7 @@ void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
}
return;
case PNM_NOTERESET:
- m_bSizeChanged = TRUE;
+ m_bSizeChanged = true;
m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
return;
@@ -1178,18 +1178,18 @@ void CPWL_NoteItem::OnContentsValidate()
}
}
-void CPWL_NoteItem::SetNoteFocus(FX_BOOL bLast)
+void CPWL_NoteItem::SetNoteFocus(bool bLast)
{
m_pContents->SetEditFocus(bLast);
}
-void CPWL_NoteItem::EnableModify(FX_BOOL bEnabled)
+void CPWL_NoteItem::EnableModify(bool bEnabled)
{
m_pContents->EnableModify(bEnabled);
m_bAllowModify = bEnabled;
}
-void CPWL_NoteItem::EnableRead(FX_BOOL bEnabled)
+void CPWL_NoteItem::EnableRead(bool bEnabled)
{
m_pContents->EnableRead(bEnabled);
}
@@ -1205,9 +1205,9 @@ CPWL_Note::CPWL_Note(IPopup_Note* pPopupNote, IPWL_NoteNotify* pNoteNotify, IPWL
m_pContentsBar(NULL),
m_pOptions(NULL),
m_pNoteNotify(pNoteNotify),
- m_bResizing(FALSE),
+ m_bResizing(false),
m_rcCaption(0,0,0,0),
- m_bEnalbleNotify(TRUE),
+ m_bEnalbleNotify(true),
m_pPopupNote(pPopupNote)
{
}
@@ -1221,7 +1221,7 @@ IPWL_NoteItem* CPWL_Note::Reply()
return CreateNoteItem();
}
-void CPWL_Note::EnableNotify(FX_BOOL bEnabled)
+void CPWL_Note::EnableNotify(bool bEnabled)
{
m_bEnalbleNotify = bEnabled;
}
@@ -1243,19 +1243,19 @@ void CPWL_Note::RePosChildWnd()
}
}
-FX_BOOL CPWL_Note::ResetScrollBar()
+bool CPWL_Note::ResetScrollBar()
{
- FX_BOOL bScrollChanged = FALSE;
+ bool bScrollChanged = false;
if (ScrollBarShouldVisible())
{
if (!m_pContentsBar->IsVisible())
{
- m_pContentsBar->SetVisible(TRUE);
+ m_pContentsBar->SetVisible(true);
if (m_pContentsBar->IsVisible())
{
m_pContentsBar->InvalidateRect(NULL);
- bScrollChanged = TRUE;
+ bScrollChanged = true;
}
}
}
@@ -1263,10 +1263,10 @@ FX_BOOL CPWL_Note::ResetScrollBar()
{
if (m_pContentsBar->IsVisible())
{
- m_pContentsBar->SetVisible(FALSE);
+ m_pContentsBar->SetVisible(false);
m_pContentsBar->InvalidateRect(NULL);
- bScrollChanged = TRUE;
+ bScrollChanged = true;
}
}
@@ -1277,7 +1277,7 @@ FX_BOOL CPWL_Note::ResetScrollBar()
rcContents.right = rcNote.right - 3.0f;
if (m_pContentsBar->IsVisible())
rcContents.right -= PWL_SCROLLBAR_WIDTH;
- m_pContents->Move(rcContents, TRUE, TRUE);
+ m_pContents->Move(rcContents, true, true);
m_pContents->SetScrollPos(CPDF_Point(0.0f,0.0f));
m_pContents->InvalidateRect(NULL);
}
@@ -1285,7 +1285,7 @@ FX_BOOL CPWL_Note::ResetScrollBar()
return bScrollChanged;
}
-FX_BOOL CPWL_Note::ScrollBarShouldVisible()
+bool CPWL_Note::ScrollBarShouldVisible()
{
CPDF_Rect rcContentsFact = m_pContents->GetScrollArea();
CPDF_Rect rcContentsClient = m_pContents->GetClientRect();
@@ -1305,7 +1305,7 @@ void CPWL_Note::RePosNoteChildren()
{
if (m_bResizing) return;
- m_bResizing = TRUE;
+ m_bResizing = true;
if (IsValid())
{
@@ -1327,7 +1327,7 @@ void CPWL_Note::RePosNoteChildren()
rcIcon.right = rcIcon.left + 14.0f;
rcIcon.bottom = rcIcon.top - 14.0f;
rcIcon.Normalize();
- m_pIcon->Move(rcIcon, TRUE, FALSE);
+ m_pIcon->Move(rcIcon, true, false);
m_pIcon->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcIcon));
CPDF_Rect rcCloseBox = rcClient;
@@ -1336,7 +1336,7 @@ void CPWL_Note::RePosNoteChildren()
rcCloseBox.left = rcCloseBox.right - 14.0f;
rcCloseBox.bottom = rcCloseBox.top - 14.0f;
rcCloseBox.Normalize();
- m_pCloseBox->Move(rcCloseBox, TRUE, FALSE);
+ m_pCloseBox->Move(rcCloseBox, true, false);
m_pCloseBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcCloseBox));
CPDF_Rect rcDate = rcClient;
@@ -1345,7 +1345,7 @@ void CPWL_Note::RePosNoteChildren()
rcDate.top = rcClient.top - 2.0f;
rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Height();
rcDate.Normalize();
- m_pDateTime->Move(rcDate, TRUE, FALSE);
+ m_pDateTime->Move(rcDate, true, false);
m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDate));
CPDF_Rect rcSubject = rcClient;
@@ -1354,7 +1354,7 @@ void CPWL_Note::RePosNoteChildren()
rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetContentRect().Width() + 1.0f, rcDate.left - 1.0f);
rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().Height();
rcSubject.Normalize();
- m_pSubject->Move(rcSubject, TRUE, FALSE);
+ m_pSubject->Move(rcSubject, true, false);
m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubject));
CPDF_Rect rcOptions = rcClient;
@@ -1362,7 +1362,7 @@ void CPWL_Note::RePosNoteChildren()
rcOptions.top = rcSubject.bottom - 4.0f;
rcOptions.bottom = rcOptions.top - m_pOptions->GetContentRect().Height();
rcOptions.Normalize();
- m_pOptions->Move(rcOptions, TRUE, FALSE);
+ m_pOptions->Move(rcOptions, true, false);
m_pOptions->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcOptions));
CPDF_Rect rcAuthor = rcClient;
@@ -1371,21 +1371,21 @@ void CPWL_Note::RePosNoteChildren()
rcAuthor.right = PWL_MIN(rcSubject.left + m_pAuthor->GetContentRect().Width() + 1.0f, rcOptions.left - 1.0f);
rcAuthor.bottom = rcAuthor.top - m_pAuthor->GetContentRect().Height();
rcAuthor.Normalize();
- m_pAuthor->Move(rcAuthor, TRUE, FALSE);
+ m_pAuthor->Move(rcAuthor, true, false);
m_pAuthor->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcAuthor));
CPDF_Rect rcLBBox = rcClient;
rcLBBox.top = rcLBBox.bottom + 7.0f;
rcLBBox.right = rcLBBox.left + 7.0f;
rcLBBox.Normalize();
- m_pLBBox->Move(rcLBBox, TRUE, FALSE);
+ m_pLBBox->Move(rcLBBox, true, false);
m_pLBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcLBBox));
CPDF_Rect rcRBBox = rcClient;
rcRBBox.top = rcRBBox.bottom + 7.0f;
rcRBBox.left = rcRBBox.right - 7.0f;
rcRBBox.Normalize();
- m_pRBBox->Move(rcRBBox, TRUE, FALSE);
+ m_pRBBox->Move(rcRBBox, true, false);
m_pRBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcRBBox));
CPDF_Rect rcContents = rcClient;
@@ -1396,20 +1396,20 @@ void CPWL_Note::RePosNoteChildren()
rcContents.right -= PWL_SCROLLBAR_WIDTH;
rcContents.bottom += 14.0f;
rcContents.Normalize();
- m_pContents->Move(rcContents, FALSE, FALSE);
+ m_pContents->Move(rcContents, false, false);
m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcContents));
CPDF_Rect rcContentsBar = rcContents;
rcContentsBar.right = rcClient.right - 3.0f;
rcContentsBar.left = rcContentsBar.right - PWL_SCROLLBAR_WIDTH;
rcContentsBar.Normalize();
- m_pContentsBar->Move(rcContentsBar, TRUE, FALSE);
+ m_pContentsBar->Move(rcContentsBar, true, false);
m_rcCaption = rcClient;
m_rcCaption.bottom = rcContents.top;
}
- m_bResizing = FALSE;
+ m_bResizing = false;
}
//0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close / 5-options
@@ -1507,7 +1507,7 @@ void CPWL_Note::CreateChildWnd(const PWL_CREATEPARAM & cp)
scp.sBackgroundColor = CPWL_Color(COLORTYPE_RGB, 240/255.0f, 240/255.0f, 240/255.0f);
scp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_BACKGROUND;
m_pContentsBar->Create(scp);
- m_pContentsBar->SetNotifyForever(TRUE);
+ m_pContentsBar->SetNotifyForever(true);
}
void CPWL_Note::SetSubjectName(const CFX_WideString& sName)
@@ -1538,7 +1538,7 @@ CFX_WideString CPWL_Note::GetAuthorName() const
return L"";
}
-FX_BOOL CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
CPDF_Point ptScroll = m_pContents->GetScrollPos();
CPDF_Rect rcScroll = m_pContents->GetScrollArea();
@@ -1566,11 +1566,11 @@ FX_BOOL CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD
m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (intptr_t)&ptNew.y);
m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptNew.y);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -1591,7 +1591,7 @@ void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t
if (FXSYS_memcmp(&m_OldScrollInfo, &sInfo, sizeof(PWL_SCROLL_INFO)) != 0)
{
- FX_BOOL bScrollChanged = FALSE;
+ bool bScrollChanged = false;
if (lParam < 3) //·ÀÖ¹ËÀÑ­»· mantis:15759
{
@@ -1704,7 +1704,7 @@ void CPWL_Note::SetBkColor(const CPWL_Color& color)
m_pRBBox->SetTextColor(sTextColor);
}
-FX_BOOL CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
+bool CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
{
if (m_pOptions->WndHitTest(m_pOptions->ParentToChild(point)))
{
@@ -1717,14 +1717,14 @@ FX_BOOL CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
KillFocus();
pNotify->OnPopupMenu(x, y);
- return TRUE;
+ return true;
}
}
return CPWL_Wnd::OnLButtonDown(point,nFlag);
}
-FX_BOOL CPWL_Note::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Note::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
return CPWL_Wnd::OnRButtonUp(point,nFlag);
}
@@ -1748,12 +1748,12 @@ void CPWL_Note::SetIconType(int32_t nType)
m_pIcon->SetIconType(nType);
}
-void CPWL_Note::EnableModify(FX_BOOL bEnabled)
+void CPWL_Note::EnableModify(bool bEnabled)
{
m_pContents->EnableModify(bEnabled);
}
-void CPWL_Note::EnableRead(FX_BOOL bEnabled)
+void CPWL_Note::EnableRead(bool bEnabled)
{
m_pContents->EnableRead(bEnabled);
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
index 6d61705222..4287bc2753 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
@@ -47,7 +47,7 @@ void PWL_FLOATRANGE::Set(FX_FLOAT min,FX_FLOAT max)
}
}
-FX_BOOL PWL_FLOATRANGE::In(FX_FLOAT x) const
+bool PWL_FLOATRANGE::In(FX_FLOAT x) const
{
return (IsFloatBigger(x,fMin) || IsFloatEqual(x, fMin)) &&
(IsFloatSmaller(x, fMax) || IsFloatEqual(x, fMax));
@@ -99,14 +99,14 @@ void PWL_SCROLL_PRIVATEDATA::SetBigStep(FX_FLOAT step)
fBigStep = step;
}
-FX_BOOL PWL_SCROLL_PRIVATEDATA::SetPos(FX_FLOAT pos)
+bool PWL_SCROLL_PRIVATEDATA::SetPos(FX_FLOAT pos)
{
if (ScrollRange.In(pos))
{
fScrollPos = pos;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void PWL_SCROLL_PRIVATEDATA::AddSmall()
@@ -140,7 +140,7 @@ CPWL_SBButton::CPWL_SBButton(PWL_SCROLLBAR_TYPE eScrollBarType,PWL_SBBUTTON_TYPE
m_eScrollBarType = eScrollBarType;
m_eSBButtonType = eButtonType;
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
}
CPWL_SBButton::~CPWL_SBButton()
@@ -359,7 +359,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p
rcDraw = CPWL_Utils::DeflateRect(rectWnd,1.0f);
if (IsEnabled())
- CPWL_Utils::DrawShadow(pDevice, pUser2Device, TRUE, FALSE, rcDraw, nTransparancy, 80, 220);
+ CPWL_Utils::DrawShadow(pDevice, pUser2Device, true, false, rcDraw, nTransparancy, 80, 220);
else
CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcDraw, ArgbEncode(255,255,255,255));
@@ -402,7 +402,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p
//draw background
rcDraw = CPWL_Utils::DeflateRect(rectWnd,1.0f);
if (IsEnabled())
- CPWL_Utils::DrawShadow(pDevice, pUser2Device, TRUE, FALSE, rcDraw, nTransparancy, 80, 220);
+ CPWL_Utils::DrawShadow(pDevice, pUser2Device, true, false, rcDraw, nTransparancy, 80, 220);
else
CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcDraw, ArgbEncode(255,255,255,255));
@@ -565,33 +565,33 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p
}
}
-FX_BOOL CPWL_SBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_SBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
if (CPWL_Wnd * pParent = GetParentWindow())
pParent->OnNotify(this,PNM_LBUTTONDOWN,0,(intptr_t)&point);
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
SetCapture();
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_SBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_SBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
if (CPWL_Wnd * pParent = GetParentWindow())
pParent->OnNotify(this,PNM_LBUTTONUP,0,(intptr_t)&point);
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
ReleaseCapture();
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_SBButton::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_SBButton::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnMouseMove(point,nFlag);
@@ -603,12 +603,12 @@ FX_BOOL CPWL_SBButton::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
if (m_bMouseDown && (m_eSBButtonType == PSBT_MIN || m_eSBButtonType == PSBT_MAX))
{
if (!pParent->OnNotify(this,PNM_LBUTTONDOWN,nFlags,(intptr_t)&point))
- return FALSE;
+ return false;
}
*/
}
- return TRUE;
+ return true;
}
/* ------------------------------- CPWL_ScrollBar ---------------------------------- */
@@ -618,9 +618,9 @@ CPWL_ScrollBar::CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType):
m_pMinButton(NULL),
m_pMaxButton(NULL),
m_pPosButton(NULL),
- m_bMouseDown(FALSE),
- m_bMinOrMax(FALSE),
- m_bNotifyForever(TRUE)
+ m_bMouseDown(false),
+ m_bMinOrMax(false),
+ m_bNotifyForever(true)
{
}
@@ -665,7 +665,7 @@ void CPWL_ScrollBar::RePosChildWnd()
rcMaxButton = CPDF_Rect(rcClient.right - fBWidth,rcClient.bottom,
rcClient.right,rcClient.top);
}
- else SetVisible(FALSE);
+ else SetVisible(false);
}
break;
case SBT_VSCROLL:
@@ -687,16 +687,16 @@ void CPWL_ScrollBar::RePosChildWnd()
rcMaxButton = CPDF_Rect(rcClient.left,rcClient.bottom,
rcClient.right,rcClient.bottom + fBWidth);
}
- else SetVisible(FALSE);
+ else SetVisible(false);
}
break;
}
if (m_pMinButton)
- m_pMinButton->Move(rcMinButton, TRUE, FALSE);
+ m_pMinButton->Move(rcMinButton, true, false);
if (m_pMaxButton)
- m_pMaxButton->Move(rcMaxButton, TRUE, FALSE);
- MovePosButton(FALSE);
+ m_pMaxButton->Move(rcMaxButton, true, false);
+ MovePosButton(false);
}
void CPWL_ScrollBar::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
@@ -708,7 +708,7 @@ void CPWL_ScrollBar::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
CFX_ByteTextBuf sButton;
sButton << "q\n";
- sButton << "0 w\n" << CPWL_Utils::GetColorAppStream(GetBackgroundColor(),TRUE);
+ sButton << "0 w\n" << CPWL_Utils::GetColorAppStream(GetBackgroundColor(),true);
sButton << rectWnd.left << " " << rectWnd.bottom << " "
<< rectWnd.right - rectWnd.left << " " << rectWnd.top - rectWnd.bottom << " re b Q\n";
@@ -734,7 +734,7 @@ void CPWL_ScrollBar::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix*
}
}
-FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ScrollBar::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
@@ -777,22 +777,22 @@ FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
if (rcMinArea.Contains(point.x,point.y))
{
m_sData.SubBig();
- MovePosButton(TRUE);
+ MovePosButton(true);
NotifyScrollWindow();
}
if (rcMaxArea.Contains(point.x,point.y))
{
m_sData.AddBig();
- MovePosButton(TRUE);
+ MovePosButton(true);
NotifyScrollWindow();
}
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ScrollBar::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
@@ -806,9 +806,9 @@ FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
}
EndTimer();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
- return TRUE;
+ return true;
}
void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -922,7 +922,7 @@ void CPWL_ScrollBar::CreateButtons(const PWL_CREATEPARAM & cp)
if (!m_pPosButton)
{
m_pPosButton = new CPWL_SBButton(m_sbType,PSBT_POS);
- m_pPosButton->SetVisible(FALSE);
+ m_pPosButton->SetVisible(false);
m_pPosButton->Create(scp);
}
}
@@ -943,12 +943,12 @@ void CPWL_ScrollBar::SetScrollRange(FX_FLOAT fMin,FX_FLOAT fMax,FX_FLOAT fClient
if (IsFloatSmaller(m_sData.ScrollRange.GetWidth(), 0.0f))
{
- m_pPosButton->SetVisible(FALSE);
+ m_pPosButton->SetVisible(false);
}
else
{
- m_pPosButton->SetVisible(TRUE);
- MovePosButton(TRUE);
+ m_pPosButton->SetVisible(true);
+ MovePosButton(true);
}
}
}
@@ -960,7 +960,7 @@ void CPWL_ScrollBar::SetScrollPos(FX_FLOAT fPos)
m_sData.SetPos(fPos);
if (!IsFloatEqual(m_sData.fScrollPos, fOldPos))
- MovePosButton(TRUE);
+ MovePosButton(true);
}
void CPWL_ScrollBar::SetScrollStep(FX_FLOAT fBigStep,FX_FLOAT fSmallStep)
@@ -969,7 +969,7 @@ void CPWL_ScrollBar::SetScrollStep(FX_FLOAT fBigStep,FX_FLOAT fSmallStep)
m_sData.SetSmallStep(fSmallStep);
}
-void CPWL_ScrollBar::MovePosButton(FX_BOOL bRefresh)
+void CPWL_ScrollBar::MovePosButton(bool bRefresh)
{
ASSERT (m_pPosButton != NULL);
ASSERT (m_pMinButton != NULL);
@@ -1031,17 +1031,17 @@ void CPWL_ScrollBar::MovePosButton(FX_BOOL bRefresh)
break;
}
- m_pPosButton->Move(rcPosButton,TRUE,bRefresh);
+ m_pPosButton->Move(rcPosButton,true,bRefresh);
}
}
void CPWL_ScrollBar::OnMinButtonLBDown(const CPDF_Point & point)
{
m_sData.SubSmall();
- MovePosButton(TRUE);
+ MovePosButton(true);
NotifyScrollWindow();
- m_bMinOrMax = TRUE;
+ m_bMinOrMax = true;
EndTimer();
BeginTimer(100);
@@ -1058,10 +1058,10 @@ void CPWL_ScrollBar::OnMinButtonMouseMove(const CPDF_Point & point)
void CPWL_ScrollBar::OnMaxButtonLBDown(const CPDF_Point & point)
{
m_sData.AddSmall();
- MovePosButton(TRUE);
+ MovePosButton(true);
NotifyScrollWindow();
- m_bMinOrMax = FALSE;
+ m_bMinOrMax = false;
EndTimer();
BeginTimer(100);
@@ -1077,7 +1077,7 @@ void CPWL_ScrollBar::OnMaxButtonMouseMove(const CPDF_Point & point)
void CPWL_ScrollBar::OnPosButtonLBDown(const CPDF_Point & point)
{
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
if (m_pPosButton)
{
@@ -1104,7 +1104,7 @@ void CPWL_ScrollBar::OnPosButtonLBUp(const CPDF_Point & point)
if (!m_bNotifyForever)
NotifyScrollWindow();
}
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
}
void CPWL_ScrollBar::OnPosButtonMouseMove(const CPDF_Point & point)
@@ -1163,7 +1163,7 @@ void CPWL_ScrollBar::OnPosButtonMouseMove(const CPDF_Point & point)
if (!IsFloatEqual(fOldScrollPos, m_sData.fScrollPos))
{
- MovePosButton(TRUE);
+ MovePosButton(true);
if (m_bNotifyForever)
NotifyScrollWindow();
@@ -1297,7 +1297,7 @@ void CPWL_ScrollBar::TimerProc()
if (FXSYS_memcmp(&m_sData, &sTemp, sizeof(PWL_SCROLL_PRIVATEDATA)) != 0)
{
- MovePosButton(TRUE);
+ MovePosButton(true);
NotifyScrollWindow();
}
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
index 76b2bd333a..23be71a29d 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
@@ -70,9 +70,9 @@ CPWL_Signature::CPWL_Signature() :
m_pText(NULL),
m_pDescription(NULL),
m_pImage(NULL),
- m_bTextExist(TRUE),
- m_bImageExist(FALSE),
- m_bFlagExist(TRUE)
+ m_bTextExist(true),
+ m_bImageExist(false),
+ m_bFlagExist(true)
{
}
@@ -80,21 +80,21 @@ CPWL_Signature::~CPWL_Signature()
{
}
-void CPWL_Signature::SetTextFlag(FX_BOOL bTextExist)
+void CPWL_Signature::SetTextFlag(bool bTextExist)
{
m_bTextExist = bTextExist;
RePosChildWnd();
}
-void CPWL_Signature::SetImageFlag(FX_BOOL bImageExist)
+void CPWL_Signature::SetImageFlag(bool bImageExist)
{
m_bImageExist = bImageExist;
RePosChildWnd();
}
-void CPWL_Signature::SetFoxitFlag(FX_BOOL bFlagExist)
+void CPWL_Signature::SetFoxitFlag(bool bFlagExist)
{
m_bFlagExist = bFlagExist;
}
@@ -135,7 +135,7 @@ void CPWL_Signature::RePosChildWnd()
CPDF_Rect rcText = rcClient;
CPDF_Rect rcDescription = rcClient;
- FX_BOOL bTextVisible = m_bTextExist && m_pText->GetText().GetLength() > 0;
+ bool bTextVisible = m_bTextExist && m_pText->GetText().GetLength() > 0;
if ((bTextVisible || m_bImageExist) &&
m_pDescription->GetText().GetLength() > 0)
@@ -155,9 +155,9 @@ void CPWL_Signature::RePosChildWnd()
m_pText->SetVisible(bTextVisible);
m_pImage->SetVisible(m_bImageExist);
- m_pText->Move(rcText, TRUE, FALSE);
- m_pImage->Move(rcText, TRUE, FALSE);
- m_pDescription->Move(rcDescription, TRUE, FALSE);
+ m_pText->Move(rcText, true, false);
+ m_pImage->Move(rcText, true, false);
+ m_pDescription->Move(rcDescription, true, false);
}
void CPWL_Signature::CreateChildWnd(const PWL_CREATEPARAM & cp)
diff --git a/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp b/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
index 90fa8f880d..7bb38c4bfe 100644
--- a/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
@@ -32,7 +32,7 @@ CPDF_Rect CPWL_PushButton::GetFocusRect() const
/* --------------------------- CPWL_CheckBox ---------------------------- */
-CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(FALSE)
+CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(false)
{
}
@@ -45,33 +45,33 @@ CFX_ByteString CPWL_CheckBox::GetClassName() const
return "CPWL_CheckBox";
}
-void CPWL_CheckBox::SetCheck(FX_BOOL bCheck)
+void CPWL_CheckBox::SetCheck(bool bCheck)
{
m_bChecked = bCheck;
}
-FX_BOOL CPWL_CheckBox::IsChecked() const
+bool CPWL_CheckBox::IsChecked() const
{
return m_bChecked;
}
-FX_BOOL CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- if (IsReadOnly()) return FALSE;
+ if (IsReadOnly()) return false;
SetCheck(!IsChecked());
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_CheckBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_CheckBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
SetCheck(!IsChecked());
- return TRUE;
+ return true;
}
/* --------------------------- CPWL_RadioButton ---------------------------- */
-CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(FALSE)
+CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(false)
{
}
@@ -84,27 +84,27 @@ CFX_ByteString CPWL_RadioButton::GetClassName() const
return "CPWL_RadioButton";
}
-FX_BOOL CPWL_RadioButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_RadioButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- if (IsReadOnly()) return FALSE;
+ if (IsReadOnly()) return false;
- SetCheck(TRUE);
- return TRUE;
+ SetCheck(true);
+ return true;
}
-void CPWL_RadioButton::SetCheck(FX_BOOL bCheck)
+void CPWL_RadioButton::SetCheck(bool bCheck)
{
m_bChecked = bCheck;
}
-FX_BOOL CPWL_RadioButton::IsChecked() const
+bool CPWL_RadioButton::IsChecked() const
{
return m_bChecked;
}
-FX_BOOL CPWL_RadioButton::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_RadioButton::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
- SetCheck(TRUE);
- return TRUE;
+ SetCheck(true);
+ return true;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
index b9ba7661af..4e4ac94238 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
@@ -87,13 +87,13 @@ CPDF_Rect CPWL_Utils::OffsetRect(const CPDF_Rect & rect,FX_FLOAT x,FX_FLOAT y)
rect.right + x,rect.top + y);
}
-FX_BOOL CPWL_Utils::ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcChild)
+bool CPWL_Utils::ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcChild)
{
return rcChild.left >= rcParent.left && rcChild.bottom >= rcParent.bottom &&
rcChild.right <= rcParent.right && rcChild.top <= rcParent.top;
}
-FX_BOOL CPWL_Utils::IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2)
+bool CPWL_Utils::IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2)
{
FX_FLOAT left = rect1.left > rect2.left ? rect1.left : rect2.left;
FX_FLOAT right = rect1.right < rect2.right ? rect1.right : rect2.right;
@@ -420,7 +420,7 @@ CFX_ByteString CPWL_Utils::GetRectFillAppStream(const CPDF_Rect & rect,const CPW
{
CFX_ByteTextBuf sAppStream;
- CFX_ByteString sColor = GetColorAppStream(color,TRUE);
+ CFX_ByteString sColor = GetColorAppStream(color,true);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << sColor;
@@ -435,7 +435,7 @@ CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CPDF_Rect & rect,const C
{
CFX_ByteTextBuf sAppStream;
- CFX_ByteString sColor = GetColorAppStream(color,TRUE);
+ CFX_ByteString sColor = GetColorAppStream(color,true);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << sColor << CPWL_Utils::GetAP_Circle(rect) << "f\nQ\n";
@@ -458,7 +458,7 @@ CPDF_Rect CPWL_Utils::GetCenterSquare(const CPDF_Rect & rect)
}
CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange,
- FX_BOOL bContinuous, FX_WORD SubWord)
+ bool bContinuous, FX_WORD SubWord)
{
return IFX_Edit::GetEditAppearanceStream(pEdit,ptOffset,pRange,bContinuous,SubWord);
}
@@ -498,7 +498,7 @@ static CFX_ByteString GetWordSpellCheckAppearanceStream(IFX_Edit_Iterator* pIter
FX_FLOAT fY = 0.0f;
FX_FLOAT fStep = 0.0f;
- FX_BOOL bBreak = FALSE;
+ bool bBreak = false;
if (pIterator)
{
@@ -538,7 +538,7 @@ static CFX_ByteString GetWordSpellCheckAppearanceStream(IFX_Edit_Iterator* pIter
fEndX = word.ptWord.x + word.fWidth;
}
- bBreak = TRUE;
+ bBreak = true;
}
else
{
@@ -569,7 +569,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
{
pIterator->SetAt(pRange->BeginPos);
- FX_BOOL bLatinWord = FALSE;
+ bool bLatinWord = false;
CPVT_WordPlace wpWordStart;
CFX_ByteString sWord;
@@ -587,7 +587,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
if (!bLatinWord)
{
wpWordStart = place;
- bLatinWord = TRUE;
+ bLatinWord = true;
}
sWord += (char)word.Word;
@@ -602,7 +602,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
pIterator->SetAt(place);
}
- bLatinWord = FALSE;
+ bLatinWord = false;
}
sWord.Empty();
@@ -614,7 +614,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
{
if (!pSpellCheck->CheckWord(sWord))
sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
- bLatinWord = FALSE;
+ bLatinWord = false;
sWord.Empty();
}
}
@@ -625,7 +625,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
if (!pSpellCheck->CheckWord(sWord))
sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
- bLatinWord = FALSE;
+ bLatinWord = false;
sWord.Empty();
}
}
@@ -636,7 +636,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_FontMap * pFontMap,
const CFX_WideString & sText, int32_t nAlignmentH, int32_t nAlignmentV,
- FX_FLOAT fFontSize, FX_BOOL bMultiLine, FX_BOOL bAutoReturn, const CPWL_Color & crText)
+ FX_FLOAT fFontSize, bool bMultiLine, bool bAutoReturn, const CPWL_Color & crText)
{
CFX_ByteTextBuf sRet;
@@ -649,7 +649,7 @@ CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_Fo
pEdit->SetMultiLine(bMultiLine);
pEdit->SetAutoReturn(bAutoReturn);
if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(TRUE);
+ pEdit->SetAutoFontSize(true);
else
pEdit->SetFontSize(fFontSize);
@@ -683,10 +683,10 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
pEdit->SetFontMap(pFontMap);
pEdit->SetAlignmentH(1);
pEdit->SetAlignmentV(1);
- pEdit->SetMultiLine(FALSE);
- pEdit->SetAutoReturn(FALSE);
+ pEdit->SetMultiLine(false);
+ pEdit->SetAutoReturn(false);
if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(TRUE);
+ pEdit->SetAutoFontSize(true);
else
pEdit->SetFontSize(fFontSize);
@@ -892,7 +892,7 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
if (!rcIcon.IsEmpty())
{
- Icon.Move(rcIcon, FALSE, FALSE);
+ Icon.Move(rcIcon, false, false);
sTemp << Icon.GetImageAppStream();
}
@@ -923,7 +923,7 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
return "";
}
-CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color & color,const FX_BOOL & bFillOrStroke)
+CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color & color,const bool & bFillOrStroke)
{
CFX_ByteTextBuf sColorStream;
@@ -967,7 +967,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
{
default:
case PBS_SOLID:
- sColor = CPWL_Utils::GetColorAppStream(color,TRUE);
+ sColor = CPWL_Utils::GetColorAppStream(color,true);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -978,7 +978,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
}
break;
case PBS_DASH:
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(color,false);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -992,7 +992,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
break;
case PBS_BEVELED:
case PBS_INSET:
- sColor = CPWL_Utils::GetColorAppStream(crLeftTop,TRUE);
+ sColor = CPWL_Utils::GetColorAppStream(crLeftTop,true);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -1004,7 +1004,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l f\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crRightBottom,TRUE);
+ sColor = CPWL_Utils::GetColorAppStream(crRightBottom,true);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -1016,7 +1016,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l f\n";
}
- sColor = CPWL_Utils::GetColorAppStream(color,TRUE);
+ sColor = CPWL_Utils::GetColorAppStream(color,true);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -1026,7 +1026,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
}
break;
case PBS_UNDERLINED:
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(color,false);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -1065,7 +1065,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
case PBS_SOLID:
case PBS_UNDERLINED:
{
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(color,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fWidth << " w\n" << sColor
@@ -1076,7 +1076,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
break;
case PBS_DASH:
{
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(color,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fWidth << " w\n"
@@ -1090,7 +1090,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
{
FX_FLOAT fHalfWidth = fWidth / 2.0f;
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(color,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1098,7 +1098,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
<< " S\nQ\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crLeftTop,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(crLeftTop,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1106,7 +1106,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
<< " S\nQ\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crRightBottom,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(crRightBottom,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1119,7 +1119,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
{
FX_FLOAT fHalfWidth = fWidth / 2.0f;
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(color,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1127,7 +1127,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
<< " S\nQ\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crLeftTop,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(crLeftTop,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1135,7 +1135,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
<< " S\nQ\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crRightBottom,FALSE);
+ sColor = CPWL_Utils::GetColorAppStream(crRightBottom,false);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1208,42 +1208,42 @@ CPWL_Color CPWL_Utils::DevideColor(const CPWL_Color & sColor,FX_FLOAT fColorDevi
CFX_ByteString CPWL_Utils::GetAppStream_Check(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Check(rcBBox) << "f\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Check(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Circle(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Circle(rcBBox) << "f\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Circle(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Cross(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,FALSE) << CPWL_Utils::GetAP_Cross(rcBBox) << "S\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,false) << CPWL_Utils::GetAP_Cross(rcBBox) << "S\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Diamond(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n1 w\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Diamond(rcBBox) << "f\nQ\n";
+ sAP << "q\n1 w\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Diamond(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Square(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Square(rcBBox) << "f\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Square(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Star(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Star(rcBBox) << "f\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Star(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
@@ -1299,7 +1299,7 @@ CFX_ByteString CPWL_Utils::GetDropButtonAppStream(const CPDF_Rect & rcBBox)
if (!rcBBox.IsEmpty())
{
- sAppStream << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,220.0f/255.0f,220.0f/255.0f,220.0f/255.0f),TRUE);
+ sAppStream << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,220.0f/255.0f,220.0f/255.0f,220.0f/255.0f),true);
sAppStream << rcBBox.left << " " << rcBBox.bottom << " "
<< rcBBox.right - rcBBox.left << " " << rcBBox.top - rcBBox.bottom << " re f\n";
sAppStream << "Q\n";
@@ -1474,7 +1474,7 @@ void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devi
}
void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- FX_BOOL bVertical, FX_BOOL bHorizontal, CPDF_Rect rect,
+ bool bVertical, bool bHorizontal, CPDF_Rect rect,
int32_t nTransparancy, int32_t nStartGray, int32_t nEndGray)
{
FX_FLOAT fStepGray = 1.0f;
@@ -1638,7 +1638,7 @@ static void AddSpellCheckObj(CFX_PathData & PathData, IFX_Edit* pEdit, const CPV
FX_FLOAT fY = 0.0f;
FX_FLOAT fStep = 0.0f;
- FX_BOOL bBreak = FALSE;
+ bool bBreak = false;
if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
{
@@ -1678,7 +1678,7 @@ static void AddSpellCheckObj(CFX_PathData & PathData, IFX_Edit* pEdit, const CPV
fEndX = word.ptWord.x + word.fWidth;
}
- bBreak = TRUE;
+ bBreak = true;
}
else
{
@@ -1700,7 +1700,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
const FX_COLORREF crSpell = ArgbEncode(255,255,0,0);
//for spellcheck
- FX_BOOL bLatinWord = FALSE;
+ bool bLatinWord = false;
CPVT_WordPlace wpWordStart;
CFX_ByteString sLatinWord;
@@ -1744,7 +1744,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
if (!bLatinWord)
{
wpWordStart = place;
- bLatinWord = TRUE;
+ bLatinWord = true;
}
sLatinWord += (char)word.Word;
@@ -1761,7 +1761,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
pIterator->SetAt(place);
}
}
- bLatinWord = FALSE;
+ bLatinWord = false;
}
sLatinWord.Empty();
@@ -1781,7 +1781,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
pIterator->SetAt(place);
}
}
- bLatinWord = FALSE;
+ bLatinWord = false;
}
sLatinWord.Empty();
@@ -1806,12 +1806,12 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
pDevice->RestoreState();
}
-FX_BOOL CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color)
+bool CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color)
{
switch (color.nColorType)
{
case COLORTYPE_TRANSPARENT:
- return FALSE;
+ return false;
case COLORTYPE_GRAY:
return color.fColor1 < 0.5f;
case COLORTYPE_RGB:
@@ -1820,7 +1820,7 @@ FX_BOOL CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color)
return color.fColor1 + color.fColor2 + color.fColor3 + color.fColor4 > 2.0f;
}
- return TRUE;
+ return true;
}
CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color)
@@ -1851,8 +1851,8 @@ CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color)
CFX_ByteString CPWL_Utils::GetIconAppStream(int32_t nType, const CPDF_Rect& rect, const CPWL_Color& crFill,
const CPWL_Color& crStroke)
{
- CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, FALSE);
- sAppStream += CPWL_Utils::GetColorAppStream(crFill, TRUE);
+ CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, false);
+ sAppStream += CPWL_Utils::GetColorAppStream(crFill, true);
CFX_ByteString sPath;
CFX_PathData path;
diff --git a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
index 433b3c6846..f214fb30a2 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
@@ -123,40 +123,40 @@ public:
m_pMainKeyboardWnd = NULL;
}
- FX_BOOL IsWndCreated(const CPWL_Wnd * pWnd) const
+ bool IsWndCreated(const CPWL_Wnd * pWnd) const
{
return m_pCreatedWnd == pWnd;
}
- FX_BOOL IsMainCaptureMouse(const CPWL_Wnd * pWnd) const
+ bool IsMainCaptureMouse(const CPWL_Wnd * pWnd) const
{
return pWnd == m_pMainMouseWnd;
}
- FX_BOOL IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
+ bool IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
{
if (pWnd)
for( int32_t i=0,sz=m_aMousePath.GetSize(); i<sz; i++)
if (m_aMousePath.GetAt(i) == pWnd)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
- FX_BOOL IsMainCaptureKeyboard(const CPWL_Wnd * pWnd) const
+ bool IsMainCaptureKeyboard(const CPWL_Wnd * pWnd) const
{
return pWnd == m_pMainKeyboardWnd;
}
- FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
+ bool IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
{
if (pWnd)
for( int32_t i=0,sz=m_aKeyboardPath.GetSize(); i<sz; i++)
if (m_aKeyboardPath.GetAt(i) == pWnd)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
void SetFocus(CPWL_Wnd * pWnd)
@@ -225,16 +225,16 @@ CPWL_Wnd::CPWL_Wnd() :
m_pVScrollBar(NULL),
m_rcWindow(),
m_rcClip(),
- m_bCreated(FALSE),
- m_bVisible(FALSE),
- m_bNotifying(FALSE),
- m_bEnabled(TRUE)
+ m_bCreated(false),
+ m_bVisible(false),
+ m_bNotifying(false),
+ m_bEnabled(true)
{
}
CPWL_Wnd::~CPWL_Wnd()
{
- ASSERT(m_bCreated == FALSE);
+ ASSERT(m_bCreated == false);
}
CFX_ByteString CPWL_Wnd::GetClassName() const
@@ -272,7 +272,7 @@ void CPWL_Wnd::Create(const PWL_CREATEPARAM & cp)
OnCreated();
RePosChildWnd();
- m_bCreated = TRUE;
+ m_bCreated = true;
}
}
@@ -308,7 +308,7 @@ void CPWL_Wnd::Destroy()
if (m_sPrivateParam.pParentWnd)
m_sPrivateParam.pParentWnd->OnNotify(this, PNM_REMOVECHILD);
- m_bCreated = FALSE;
+ m_bCreated = false;
}
DestroyMsgControl();
@@ -318,7 +318,7 @@ void CPWL_Wnd::Destroy()
m_pVScrollBar = NULL;
}
-void CPWL_Wnd::Move(const CPDF_Rect & rcNew, FX_BOOL bReset,FX_BOOL bRefresh)
+void CPWL_Wnd::Move(const CPDF_Rect & rcNew, bool bReset,bool bRefresh)
{
if (IsValid())
{
@@ -494,7 +494,7 @@ void CPWL_Wnd::InvalidateRect(CPDF_Rect* pRect)
}
#define PWL_IMPLEMENT_KEY_METHOD(key_method_name)\
-FX_BOOL CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag)\
+bool CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag)\
{\
if (IsValid() && IsVisible() && IsEnabled())\
{\
@@ -512,11 +512,11 @@ FX_BOOL CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag)\
}\
}\
}\
- return FALSE;\
+ return false;\
}
#define PWL_IMPLEMENT_MOUSE_METHOD(mouse_method_name)\
-FX_BOOL CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\
+bool CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\
{\
if (IsValid() && IsVisible() && IsEnabled())\
{\
@@ -550,7 +550,7 @@ FX_BOOL CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\
SetCursor();\
}\
}\
- return FALSE;\
+ return false;\
}
PWL_IMPLEMENT_KEY_METHOD(OnKeyDown)
@@ -567,7 +567,7 @@ PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonDown)
PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonUp)
PWL_IMPLEMENT_MOUSE_METHOD(OnMouseMove)
-FX_BOOL CPWL_Wnd::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_Wnd::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
if (IsValid() && IsVisible() && IsEnabled())
{
@@ -586,7 +586,7 @@ FX_BOOL CPWL_Wnd::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD
}
}
}
- return FALSE;
+ return false;
}
void CPWL_Wnd::AddChild(CPWL_Wnd * pWnd)
@@ -624,7 +624,7 @@ void CPWL_Wnd::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t
}
}
-FX_BOOL CPWL_Wnd::IsValid() const
+bool CPWL_Wnd::IsValid() const
{
return m_bCreated;
}
@@ -677,7 +677,7 @@ CPDF_Rect CPWL_Wnd::GetWindowCenterSquare() const
return CPWL_Utils::GetCenterSquare(CPWL_Utils::DeflateRect(GetWindowRect(),0.1f));
}
-FX_BOOL CPWL_Wnd::HasFlag(FX_DWORD dwFlags) const
+bool CPWL_Wnd::HasFlag(FX_DWORD dwFlags) const
{
return (m_sPrivateParam.dwFlags & dwFlags) != 0;
}
@@ -865,12 +865,12 @@ void CPWL_Wnd::OnKillFocus()
{
}
-FX_BOOL CPWL_Wnd::WndHitTest(const CPDF_Point & point) const
+bool CPWL_Wnd::WndHitTest(const CPDF_Point & point) const
{
return IsValid() && IsVisible() && GetWindowRect().Contains(point.x,point.y);
}
-FX_BOOL CPWL_Wnd::ClientHitTest(const CPDF_Point & point) const
+bool CPWL_Wnd::ClientHitTest(const CPDF_Point & point) const
{
return IsValid() && IsVisible() && GetClientRect().Contains(point.x,point.y);
}
@@ -883,7 +883,7 @@ const CPWL_Wnd* CPWL_Wnd::GetRootWnd() const
return this;
}
-void CPWL_Wnd::SetVisible(FX_BOOL bVisible)
+void CPWL_Wnd::SetVisible(bool bVisible)
{
if (IsValid())
{
@@ -915,7 +915,7 @@ CPDF_Rect CPWL_Wnd::GetClipRect() const
return m_rcClip;
}
-FX_BOOL CPWL_Wnd::IsReadOnly() const
+bool CPWL_Wnd::IsReadOnly() const
{
return HasFlag(PWS_READONLY);
}
@@ -931,7 +931,7 @@ void CPWL_Wnd::RePosChildWnd()
rcContent.right-1.0f,
rcContent.top);
- if (pVSB) pVSB->Move(rcVScroll,TRUE,FALSE);
+ if (pVSB) pVSB->Move(rcVScroll,true,false);
}
void CPWL_Wnd::CreateChildWnd(const PWL_CREATEPARAM & cp)
@@ -968,33 +968,33 @@ CPWL_MsgControl* CPWL_Wnd::GetMsgControl() const
return m_sPrivateParam.pMsgControl;
}
-FX_BOOL CPWL_Wnd::IsCaptureMouse() const
+bool CPWL_Wnd::IsCaptureMouse() const
{
return IsWndCaptureMouse(this);
}
-FX_BOOL CPWL_Wnd::IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
+bool CPWL_Wnd::IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
{
if (CPWL_MsgControl * pCtrl = GetMsgControl())
return pCtrl->IsWndCaptureMouse(pWnd);
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_Wnd::IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
+bool CPWL_Wnd::IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
{
if (CPWL_MsgControl * pCtrl = GetMsgControl())
return pCtrl->IsWndCaptureKeyboard(pWnd);
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_Wnd::IsFocused() const
+bool CPWL_Wnd::IsFocused() const
{
if (CPWL_MsgControl * pCtrl = GetMsgControl())
return pCtrl->IsMainCaptureKeyboard(this);
- return FALSE;
+ return false;
}
CPDF_Rect CPWL_Wnd::GetFocusRect() const
@@ -1217,7 +1217,7 @@ const CPWL_Wnd* CPWL_Wnd::GetFocused() const
return NULL;
}
-void CPWL_Wnd::EnableWindow(FX_BOOL bEnable)
+void CPWL_Wnd::EnableWindow(bool bEnable)
{
if (m_bEnabled != bEnable)
{
@@ -1238,7 +1238,7 @@ void CPWL_Wnd::EnableWindow(FX_BOOL bEnable)
}
}
-FX_BOOL CPWL_Wnd::IsEnabled()
+bool CPWL_Wnd::IsEnabled()
{
return m_bEnabled;
}
@@ -1251,42 +1251,42 @@ void CPWL_Wnd::OnDisabled()
{
}
-FX_BOOL CPWL_Wnd::IsCTRLpressed(FX_DWORD nFlag) const
+bool CPWL_Wnd::IsCTRLpressed(FX_DWORD nFlag) const
{
if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
{
return pSystemHandler->IsCTRLKeyDown(nFlag);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_Wnd::IsSHIFTpressed(FX_DWORD nFlag) const
+bool CPWL_Wnd::IsSHIFTpressed(FX_DWORD nFlag) const
{
if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
{
return pSystemHandler->IsSHIFTKeyDown(nFlag);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_Wnd::IsALTpressed(FX_DWORD nFlag) const
+bool CPWL_Wnd::IsALTpressed(FX_DWORD nFlag) const
{
if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
{
return pSystemHandler->IsALTKeyDown(nFlag);
}
- return FALSE;
+ return false;
}
-FX_BOOL CPWL_Wnd::IsINSERTpressed(FX_DWORD nFlag) const
+bool CPWL_Wnd::IsINSERTpressed(FX_DWORD nFlag) const
{
if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
{
return pSystemHandler->IsINSERTKeyDown(nFlag);
}
- return FALSE;
+ return false;
}