Rename some Empty() methods to Clear().
Make it obvious they are non-const methods that reset a container,
rather than const methods that indicates whether the container is empty
or not.
- CPWL_EditImpl::Empty()
- CPWL_FontMap::Empty()
- CPWL_ListCtrl::Empty()
Bug: pdfium:553
Change-Id: Ice7459055df8c1a50a86d7be8a96383230e96c42
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/61510
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfdoc/cba_fontmap.cpp b/core/fpdfdoc/cba_fontmap.cpp
index e2f935c..3820f07 100644
--- a/core/fpdfdoc/cba_fontmap.cpp
+++ b/core/fpdfdoc/cba_fontmap.cpp
@@ -78,7 +78,7 @@
}
CBA_FontMap::~CBA_FontMap() {
- Empty();
+ Clear();
}
RetainPtr<CPDF_Font> CBA_FontMap::GetPDFFont(int32_t nFontIndex) {
@@ -156,7 +156,7 @@
}
void CBA_FontMap::Reset() {
- Empty();
+ Clear();
m_pDefaultFont = nullptr;
m_sDefaultFontName.clear();
}
@@ -370,7 +370,7 @@
CharCodeFromUnicode(nFontIndex, word) >= 0;
}
-void CBA_FontMap::Empty() {
+void CBA_FontMap::Clear() {
m_Data.clear();
m_NativeFont.clear();
}
diff --git a/core/fpdfdoc/cba_fontmap.h b/core/fpdfdoc/cba_fontmap.h
index ae14809..9d7d43f 100644
--- a/core/fpdfdoc/cba_fontmap.h
+++ b/core/fpdfdoc/cba_fontmap.h
@@ -66,7 +66,7 @@
bool KnowWord(int32_t nFontIndex, uint16_t word);
- void Empty();
+ void Clear();
int32_t GetFontIndex(const ByteString& sFontName,
int32_t nCharset,
bool bFind);
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index 0705478..a9ee19e 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -810,7 +810,7 @@
}
void CPWL_EditImpl::SetText(const WideString& sText) {
- Empty();
+ Clear();
DoInsertText(CPVT_WordPlace(0, 0, -1), sText, FX_CHARSET_Default);
Paint();
}
@@ -1650,7 +1650,7 @@
return true;
}
-bool CPWL_EditImpl::Empty() {
+bool CPWL_EditImpl::Clear() {
if (m_pVT->IsValid()) {
m_pVT->DeleteWords(GetWholeWordRange());
SetCaret(m_pVT->GetBeginWordPlace());
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.h b/fpdfsdk/pwl/cpwl_edit_impl.h
index 1e36b2e..e9ac7de 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.h
+++ b/fpdfsdk/pwl/cpwl_edit_impl.h
@@ -346,7 +346,7 @@
bool CanRedo() const;
CPVT_WordRange GetVisibleWordRange() const;
- bool Empty();
+ bool Clear();
CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place,
const WideString& sText,
diff --git a/fpdfsdk/pwl/cpwl_list_box.cpp b/fpdfsdk/pwl/cpwl_list_box.cpp
index 56712a8..a0e2039 100644
--- a/fpdfsdk/pwl/cpwl_list_box.cpp
+++ b/fpdfsdk/pwl/cpwl_list_box.cpp
@@ -317,7 +317,7 @@
}
void CPWL_ListBox::ResetContent() {
- m_pList->Empty();
+ m_pList->Clear();
}
void CPWL_ListBox::Reset() {
diff --git a/fpdfsdk/pwl/cpwl_list_impl.cpp b/fpdfsdk/pwl/cpwl_list_impl.cpp
index 37a6ea2..a7ceeb9 100644
--- a/fpdfsdk/pwl/cpwl_list_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_list_impl.cpp
@@ -108,7 +108,7 @@
m_bMultiple(false) {}
CPWL_ListCtrl::~CPWL_ListCtrl() {
- Empty();
+ Clear();
}
CFX_PointF CPWL_ListCtrl::InToOut(const CFX_PointF& point) const {
@@ -525,7 +525,7 @@
return nItemIndex;
}
-void CPWL_ListCtrl::Empty() {
+void CPWL_ListCtrl::Clear() {
m_ListItems.clear();
InvalidateItem(-1);
}
diff --git a/fpdfsdk/pwl/cpwl_list_impl.h b/fpdfsdk/pwl/cpwl_list_impl.h
index dee6b61..c7a86ab 100644
--- a/fpdfsdk/pwl/cpwl_list_impl.h
+++ b/fpdfsdk/pwl/cpwl_list_impl.h
@@ -73,7 +73,7 @@
void Select(int32_t nItemIndex);
void Deselect(int32_t nItemIndex);
void SetCaret(int32_t nItemIndex);
- void Empty();
+ void Clear();
void Cancel();
WideString GetText() const;