summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_edit.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-10 09:40:14 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-10 09:40:14 -0800
commit98329fe75b9c3e5422344a37d787fb22c89c2ca2 (patch)
treea1e7f3d35bc97695b074756ab7ef531c17c6262d /xfa/fwl/core/ifwl_edit.cpp
parent50feafc7f367a87b7e4e689421eb7ae1484660d9 (diff)
downloadpdfium-98329fe75b9c3e5422344a37d787fb22c89c2ca2.tar.xz
Cleanup IFWL_Widget visibility and virtual parameters
This Cl cleans up the IFWL_Widget class including: * Making members and methods private where possible * Removing virtual methods that are never overridden * Removing methods that do nothing * Removing unchecked FWL_Error return codes Review-Url: https://codereview.chromium.org/2488953003
Diffstat (limited to 'xfa/fwl/core/ifwl_edit.cpp')
-rw-r--r--xfa/fwl/core/ifwl_edit.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/xfa/fwl/core/ifwl_edit.cpp b/xfa/fwl/core/ifwl_edit.cpp
index 7b3d083c3e..aa18d2f576 100644
--- a/xfa/fwl/core/ifwl_edit.cpp
+++ b/xfa/fwl/core/ifwl_edit.cpp
@@ -92,7 +92,7 @@ FWL_Type IFWL_Edit::GetClassID() const {
return FWL_Type::Edit;
}
-FWL_Error IFWL_Edit::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
+void IFWL_Edit::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (bAutoSize) {
rect.Set(0, 0, 0, 0);
if (m_pEdtEngine) {
@@ -124,7 +124,6 @@ FWL_Error IFWL_Edit::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
}
}
}
- return FWL_Error::Succeeded;
}
void IFWL_Edit::SetStates(uint32_t dwStates, bool bSet) {
@@ -135,25 +134,21 @@ void IFWL_Edit::SetStates(uint32_t dwStates, bool bSet) {
IFWL_Widget::SetStates(dwStates, bSet);
}
-FWL_Error IFWL_Edit::SetWidgetRect(const CFX_RectF& rect) {
- return IFWL_Widget::SetWidgetRect(rect);
-}
-FWL_Error IFWL_Edit::Update() {
+void IFWL_Edit::Update() {
if (IsLocked()) {
- return FWL_Error::Indefinite;
+ return;
}
if (!m_pProperties->m_pThemeProvider) {
m_pProperties->m_pThemeProvider = GetAvailableTheme();
}
Layout();
if (m_rtClient.IsEmpty()) {
- return FWL_Error::Indefinite;
+ return;
}
UpdateEditEngine();
UpdateVAlignment();
UpdateScroll();
InitCaret();
- return FWL_Error::Succeeded;
}
FWL_WidgetHit IFWL_Edit::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
@@ -322,14 +317,13 @@ void IFWL_Edit::DrawSpellCheck(CFX_Graphics* pGraphics,
}
pGraphics->RestoreGraphState();
}
-FWL_Error IFWL_Edit::DrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
+void IFWL_Edit::DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) {
if (!pGraphics)
- return FWL_Error::Indefinite;
+ return;
if (!m_pProperties->m_pThemeProvider)
- return FWL_Error::Indefinite;
+ return;
if (m_rtClient.IsEmpty()) {
- return FWL_Error::Indefinite;
+ return;
}
IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
if (!m_pWidgetMgr->IsFormDisabled()) {
@@ -348,11 +342,10 @@ FWL_Error IFWL_Edit::DrawWidget(CFX_Graphics* pGraphics,
if (HasEdge()) {
DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix);
}
- return FWL_Error::Succeeded;
}
-FWL_Error IFWL_Edit::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
+void IFWL_Edit::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
if (!pThemeProvider)
- return FWL_Error::Indefinite;
+ return;
if (m_pHorzScrollBar) {
m_pHorzScrollBar->SetThemeProvider(pThemeProvider);
}
@@ -363,7 +356,6 @@ FWL_Error IFWL_Edit::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
m_pCaret->SetThemeProvider(pThemeProvider);
}
m_pProperties->m_pThemeProvider = pThemeProvider;
- return FWL_Error::Succeeded;
}
FWL_Error IFWL_Edit::SetText(const CFX_WideString& wsText) {