From 38eaf4b11383e24a00192132b683cc07e38622a6 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 15 Nov 2016 12:33:06 -0800 Subject: Cleanup cfwl_* files. This Cl cleans up the visibility, method usage and return values in the remaining CFWL files. Review-Url: https://codereview.chromium.org/2498163002 --- xfa/fwl/core/cfwl_edit.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'xfa/fwl/core/cfwl_edit.cpp') diff --git a/xfa/fwl/core/cfwl_edit.cpp b/xfa/fwl/core/cfwl_edit.cpp index c7acf18f77..dc01e2213a 100644 --- a/xfa/fwl/core/cfwl_edit.cpp +++ b/xfa/fwl/core/cfwl_edit.cpp @@ -17,6 +17,10 @@ IFWL_Edit* ToEdit(IFWL_Widget* widget) { return static_cast(widget); } +const IFWL_Edit* ToEdit(const IFWL_Widget* widget) { + return static_cast(widget); +} + } // namespace CFWL_Edit::CFWL_Edit(const IFWL_App* app) : CFWL_Widget(app) {} @@ -39,20 +43,20 @@ void CFWL_Edit::SetText(const CFX_WideString& wsText) { void CFWL_Edit::GetText(CFX_WideString& wsText, int32_t nStart, - int32_t nCount) { + int32_t nCount) const { if (GetWidget()) ToEdit(GetWidget())->GetText(wsText, nStart, nCount); } -int32_t CFWL_Edit::CountSelRanges() { +int32_t CFWL_Edit::CountSelRanges() const { return GetWidget() ? ToEdit(GetWidget())->CountSelRanges() : 0; } -int32_t CFWL_Edit::GetSelRange(int32_t nIndex, int32_t& nStart) { +int32_t CFWL_Edit::GetSelRange(int32_t nIndex, int32_t& nStart) const { return GetWidget() ? ToEdit(GetWidget())->GetSelRange(nIndex, nStart) : 0; } -int32_t CFWL_Edit::GetLimit() { +int32_t CFWL_Edit::GetLimit() const { return GetWidget() ? ToEdit(GetWidget())->GetLimit() : -1; } -- cgit v1.2.3