Change bool type to fix warnings.
Switching the Is{SHIFT|CTRL|ALT|}KeyDown methods to bool from FX_BOOL generated
cfx_systemhandler.cpp(129): warning C4800: 'FX_BOOL': forcing value to bool
'true' or 'false' (performance warning)
on the win_chromium_x64_rel_ng and win8_chromium_ng bots. This CL switches
back to FX_BOOL. Attempting to move everything to bool has huge ripple effects.
I removed IsINSERTKeyDown as it was always false.
Review-Url: https://codereview.chromium.org/1929963002
diff --git a/fpdfsdk/cfx_systemhandler.cpp b/fpdfsdk/cfx_systemhandler.cpp
index 95a940d..c5f5334 100644
--- a/fpdfsdk/cfx_systemhandler.cpp
+++ b/fpdfsdk/cfx_systemhandler.cpp
@@ -126,17 +126,13 @@
}
bool CFX_SystemHandler::IsSHIFTKeyDown(uint32_t nFlag) const {
- return m_pEnv->FFI_IsSHIFTKeyDown(nFlag);
+ return !!m_pEnv->FFI_IsSHIFTKeyDown(nFlag);
}
bool CFX_SystemHandler::IsCTRLKeyDown(uint32_t nFlag) const {
- return m_pEnv->FFI_IsCTRLKeyDown(nFlag);
+ return !!m_pEnv->FFI_IsCTRLKeyDown(nFlag);
}
bool CFX_SystemHandler::IsALTKeyDown(uint32_t nFlag) const {
- return m_pEnv->FFI_IsALTKeyDown(nFlag);
-}
-
-bool CFX_SystemHandler::IsINSERTKeyDown(uint32_t nFlag) const {
- return m_pEnv->FFI_IsINSERTKeyDown(nFlag);
+ return !!m_pEnv->FFI_IsALTKeyDown(nFlag);
}
diff --git a/fpdfsdk/cfx_systemhandler.h b/fpdfsdk/cfx_systemhandler.h
index ec57353..e77120a 100644
--- a/fpdfsdk/cfx_systemhandler.h
+++ b/fpdfsdk/cfx_systemhandler.h
@@ -68,7 +68,6 @@
bool IsSHIFTKeyDown(uint32_t nFlag) const;
bool IsCTRLKeyDown(uint32_t nFlag) const;
bool IsALTKeyDown(uint32_t nFlag) const;
- bool IsINSERTKeyDown(uint32_t nFlag) const;
FX_SYSTEMTIME GetLocalTime();
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index 8fbc0d7..cd89a92 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -115,8 +115,6 @@
return (nFlag & FWL_EVENTFLAG_AltKey) != 0;
}
- FX_BOOL FFI_IsINSERTKeyDown(uint32_t nFlag) const { return FALSE; }
-
FPDF_PAGE FFI_GetPage(FPDF_DOCUMENT document, int nPageIndex) {
if (m_pInfo && m_pInfo->FFI_GetPage)
return m_pInfo->FFI_GetPage(m_pInfo, document, nPageIndex);
diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
index a659658..23349b4 100644
--- a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
+++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
@@ -284,8 +284,6 @@
case FWL_VKEY_Unknown:
break;
default:
- if (IsINSERTpressed(nFlag))
- Delete();
InsertWord(word, GetCharSet());
break;
}
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
index 8883ceb..bb424ff 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
@@ -1029,11 +1029,3 @@
return FALSE;
}
-
-FX_BOOL CPWL_Wnd::IsINSERTpressed(uint32_t nFlag) const {
- if (CFX_SystemHandler* pSystemHandler = GetSystemHandler()) {
- return pSystemHandler->IsINSERTKeyDown(nFlag);
- }
-
- return FALSE;
-}
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.h b/fpdfsdk/pdfwindow/PWL_Wnd.h
index dec3f9f..319e6da 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.h
@@ -425,7 +425,6 @@
FX_BOOL IsCTRLpressed(uint32_t nFlag) const;
FX_BOOL IsSHIFTpressed(uint32_t nFlag) const;
FX_BOOL IsALTpressed(uint32_t nFlag) const;
- FX_BOOL IsINSERTpressed(uint32_t nFlag) const;
private:
void AddChild(CPWL_Wnd* pWnd);