diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-18 14:23:18 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-18 18:40:16 +0000 |
commit | 275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch) | |
tree | 2029b9158ec044764ceff122fe5fb5d0a3f123d1 /xfa/fwl | |
parent | 450fbeaaabf1ab340c1018de2e58f1950657517e (diff) | |
download | pdfium-275e260a6cd4a8e506ba974feb85ebcd926c1739.tar.xz |
Convert string class names
Automated using git grep & sed.
Replace StringC classes with StringView classes.
Remove the CFX_ prefix and put string classes in fxcrt namespace.
Change AsStringC() to AsStringView().
Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*,
Foo).
Couple of tests needed to have their names regularlized.
BUG=pdfium:894
Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d
Reviewed-on: https://pdfium-review.googlesource.com/14151
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fwl')
31 files changed, 108 insertions, 110 deletions
diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp index 166827dcb1..1f2a978171 100644 --- a/xfa/fwl/cfwl_barcode.cpp +++ b/xfa/fwl/cfwl_barcode.cpp @@ -67,7 +67,7 @@ void CFWL_Barcode::SetType(BC_TYPE type) { m_dwStatus = XFA_BCS_NeedUpdate; } -void CFWL_Barcode::SetText(const CFX_WideString& wsText) { +void CFWL_Barcode::SetText(const WideString& wsText) { m_pBarcodeEngine.reset(); m_dwStatus = XFA_BCS_NeedUpdate; CFWL_Edit::SetText(wsText); @@ -204,7 +204,7 @@ void CFWL_Barcode::GenerateBarcodeImageCache() { if (m_dwAttributeMask & FWL_BCDATTRIBUTE_TRUNCATED) m_pBarcodeEngine->SetTruncated(m_bTruncated); - m_dwStatus = m_pBarcodeEngine->Encode(GetText().AsStringC()) + m_dwStatus = m_pBarcodeEngine->Encode(GetText().AsStringView()) ? XFA_BCS_EncodeSuccess : 0; } diff --git a/xfa/fwl/cfwl_barcode.h b/xfa/fwl/cfwl_barcode.h index 48bdeabdd3..2fc79608b3 100644 --- a/xfa/fwl/cfwl_barcode.h +++ b/xfa/fwl/cfwl_barcode.h @@ -49,7 +49,7 @@ class CFWL_Barcode : public CFWL_Edit { void OnProcessEvent(CFWL_Event* pEvent) override; // CFWL_Edit - void SetText(const CFX_WideString& wsText) override; + void SetText(const WideString& wsText) override; void SetType(BC_TYPE type); bool IsProtectedType() const; diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp index cbfbd9a447..143d797fbd 100644 --- a/xfa/fwl/cfwl_combobox.cpp +++ b/xfa/fwl/cfwl_combobox.cpp @@ -69,7 +69,7 @@ FWL_Type CFWL_ComboBox::GetClassID() const { return FWL_Type::ComboBox; } -void CFWL_ComboBox::AddString(const CFX_WideStringC& wsText) { +void CFWL_ComboBox::AddString(const WideStringView& wsText) { m_pListBox->AddString(wsText); } @@ -208,7 +208,7 @@ void CFWL_ComboBox::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { m_pEdit->SetThemeProvider(pThemeProvider); } -CFX_WideString CFWL_ComboBox::GetTextByIndex(int32_t iIndex) const { +WideString CFWL_ComboBox::GetTextByIndex(int32_t iIndex) const { CFWL_ListItem* pItem = static_cast<CFWL_ListItem*>( m_pListBox->GetItem(m_pListBox.get(), iIndex)); return pItem ? pItem->GetText() : L""; @@ -219,7 +219,7 @@ void CFWL_ComboBox::SetCurSel(int32_t iSel) { bool bClearSel = iSel < 0 || iSel >= iCount; if (IsDropDownStyle() && m_pEdit) { if (bClearSel) { - m_pEdit->SetText(CFX_WideString()); + m_pEdit->SetText(WideString()); } else { CFWL_ListItem* hItem = m_pListBox->GetItem(this, iSel); m_pEdit->SetText(hItem ? hItem->GetText() : L""); @@ -245,7 +245,7 @@ void CFWL_ComboBox::RemoveStates(uint32_t dwStates) { CFWL_Widget::RemoveStates(dwStates); } -void CFWL_ComboBox::SetEditText(const CFX_WideString& wsText) { +void CFWL_ComboBox::SetEditText(const WideString& wsText) { if (!m_pEdit) return; @@ -253,7 +253,7 @@ void CFWL_ComboBox::SetEditText(const CFX_WideString& wsText) { m_pEdit->Update(); } -CFX_WideString CFWL_ComboBox::GetEditText() const { +WideString CFWL_ComboBox::GetEditText() const { if (m_pEdit) return m_pEdit->GetText(); if (!m_pListBox) @@ -348,7 +348,7 @@ void CFWL_ComboBox::ShowDropList(bool bActivate) { } void CFWL_ComboBox::MatchEditText() { - CFX_WideString wsText = m_pEdit->GetText(); + WideString wsText = m_pEdit->GetText(); int32_t iMatch = m_pListBox->MatchItem(wsText); if (iMatch != m_iCurSel) { m_pListBox->ChangeSelected(iMatch); @@ -861,7 +861,7 @@ void CFWL_ComboBox::DoSubCtrlKey(CFWL_MessageKey* pMsg) { int32_t iCurSel = m_iCurSel; bool bDropDown = IsDropDownStyle(); if (bDropDown && m_pEdit) { - CFX_WideString wsText = m_pEdit->GetText(); + WideString wsText = m_pEdit->GetText(); iCurSel = m_pListBox->MatchItem(wsText); if (iCurSel >= 0) { CFWL_ListItem* hItem = m_pListBox->GetItem(this, iCurSel); @@ -990,7 +990,7 @@ void CFWL_ComboBox::DisForm_OnKey(CFWL_MessageKey* pMsg) { bool bMatchEqual = false; int32_t iCurSel = m_iCurSel; if (m_pEdit) { - CFX_WideString wsText = m_pEdit->GetText(); + WideString wsText = m_pEdit->GetText(); iCurSel = pComboList->MatchItem(wsText); if (iCurSel >= 0) { CFWL_ListItem* item = m_pListBox->GetSelItem(iCurSel); diff --git a/xfa/fwl/cfwl_combobox.h b/xfa/fwl/cfwl_combobox.h index 7242b1f450..923e2d8b9a 100644 --- a/xfa/fwl/cfwl_combobox.h +++ b/xfa/fwl/cfwl_combobox.h @@ -59,16 +59,16 @@ class CFWL_ComboBox : public CFWL_Widget { void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; - CFX_WideString GetTextByIndex(int32_t iIndex) const; + WideString GetTextByIndex(int32_t iIndex) const; int32_t GetCurSel() const { return m_iCurSel; } void SetCurSel(int32_t iSel); - void AddString(const CFX_WideStringC& wsText); + void AddString(const WideStringView& wsText); void RemoveAt(int32_t iIndex); void RemoveAll(); - void SetEditText(const CFX_WideString& wsText); - CFX_WideString GetEditText() const; + void SetEditText(const WideString& wsText); + WideString GetEditText() const; void OpenDropDownList(bool bActivate); @@ -83,11 +83,9 @@ class CFWL_ComboBox : public CFWL_Widget { return EditCanCopy(); } bool EditCanSelectAll() const { return m_pEdit->GetTextLength() > 0; } - bool EditCopy(CFX_WideString& wsCopy) const { return m_pEdit->Copy(wsCopy); } - bool EditCut(CFX_WideString& wsCut) { return m_pEdit->Cut(wsCut); } - bool EditPaste(const CFX_WideString& wsPaste) { - return m_pEdit->Paste(wsPaste); - } + bool EditCopy(WideString& wsCopy) const { return m_pEdit->Copy(wsCopy); } + bool EditCut(WideString& wsCut) { return m_pEdit->Cut(wsCut); } + bool EditPaste(const WideString& wsPaste) { return m_pEdit->Paste(wsPaste); } void EditSelectAll() { m_pEdit->SelectAll(); } void EditDelete() { m_pEdit->ClearText(); } void EditDeSelect() { m_pEdit->ClearSelection(); } diff --git a/xfa/fwl/cfwl_combolist.cpp b/xfa/fwl/cfwl_combolist.cpp index f334f027e7..1180acf5c8 100644 --- a/xfa/fwl/cfwl_combolist.cpp +++ b/xfa/fwl/cfwl_combolist.cpp @@ -25,14 +25,14 @@ CFWL_ComboList::CFWL_ComboList( ASSERT(pOuter); } -int32_t CFWL_ComboList::MatchItem(const CFX_WideString& wsMatch) { +int32_t CFWL_ComboList::MatchItem(const WideString& wsMatch) { if (wsMatch.IsEmpty()) return -1; int32_t iCount = CountItems(this); for (int32_t i = 0; i < iCount; i++) { CFWL_ListItem* hItem = GetItem(this, i); - CFX_WideString wsText = hItem ? hItem->GetText() : L""; + WideString wsText = hItem ? hItem->GetText() : L""; auto pos = wsText.Find(wsMatch.c_str()); if (pos.has_value() && pos.value() == 0) return i; diff --git a/xfa/fwl/cfwl_combolist.h b/xfa/fwl/cfwl_combolist.h index b7ba6b5780..a4d513559e 100644 --- a/xfa/fwl/cfwl_combolist.h +++ b/xfa/fwl/cfwl_combolist.h @@ -22,7 +22,7 @@ class CFWL_ComboList : public CFWL_ListBox { // CFWL_ListBox. void OnProcessMessage(CFWL_Message* pMessage) override; - int32_t MatchItem(const CFX_WideString& wsMatch); + int32_t MatchItem(const WideString& wsMatch); void ChangeSelected(int32_t iSel); diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp index c8d7c5dc19..cd58dc7f92 100644 --- a/xfa/fwl/cfwl_datetimepicker.cpp +++ b/xfa/fwl/cfwl_datetimepicker.cpp @@ -160,7 +160,7 @@ void CFWL_DateTimePicker::SetCurSel(int32_t iYear, m_pMonthCal->SetSelect(iYear, iMonth, iDay); } -void CFWL_DateTimePicker::SetEditText(const CFX_WideString& wsText) { +void CFWL_DateTimePicker::SetEditText(const WideString& wsText) { if (!m_pEdit) return; @@ -171,7 +171,7 @@ void CFWL_DateTimePicker::SetEditText(const CFX_WideString& wsText) { DispatchEvent(&ev); } -CFX_WideString CFWL_DateTimePicker::GetEditText() const { +WideString CFWL_DateTimePicker::GetEditText() const { return m_pEdit ? m_pEdit->GetText() : L""; } @@ -211,7 +211,7 @@ void CFWL_DateTimePicker::DrawDropDownButton(CXFA_Graphics* pGraphics, void CFWL_DateTimePicker::FormatDateString(int32_t iYear, int32_t iMonth, int32_t iDay, - CFX_WideString& wsText) { + WideString& wsText) { if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_ShortDateFormat) == FWL_STYLEEXT_DTP_ShortDateFormat) { wsText.Format(L"%d-%d-%d", iYear, iMonth, iDay); @@ -307,7 +307,7 @@ void CFWL_DateTimePicker::ProcessSelChanged(int32_t iYear, m_iMonth = iMonth; m_iDay = iDay; - CFX_WideString wsText; + WideString wsText; FormatDateString(m_iYear, m_iMonth, m_iDay, wsText); m_pEdit->SetText(wsText); m_pEdit->Update(); diff --git a/xfa/fwl/cfwl_datetimepicker.h b/xfa/fwl/cfwl_datetimepicker.h index ece489e276..276fea451d 100644 --- a/xfa/fwl/cfwl_datetimepicker.h +++ b/xfa/fwl/cfwl_datetimepicker.h @@ -49,8 +49,8 @@ class CFWL_DateTimePicker : public CFWL_Widget { void GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); void SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); - void SetEditText(const CFX_WideString& wsText); - CFX_WideString GetEditText() const; + void SetEditText(const WideString& wsText); + WideString GetEditText() const; bool HasSelection() const { return m_pEdit->HasSelection(); } // Returns <start, end> indices of the selection. @@ -75,7 +75,7 @@ class CFWL_DateTimePicker : public CFWL_Widget { void FormatDateString(int32_t iYear, int32_t iMonth, int32_t iDay, - CFX_WideString& wsText); + WideString& wsText); void ResetEditAlignment(); void InitProxyForm(); void OnFocusChanged(CFWL_Message* pMsg, bool bSet); diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp index ffe324cefd..1bec1503fc 100644 --- a/xfa/fwl/cfwl_edit.cpp +++ b/xfa/fwl/cfwl_edit.cpp @@ -189,12 +189,12 @@ void CFWL_Edit::DrawSpellCheck(CXFA_Graphics* pGraphics, pGraphics->ConcatMatrix(pMatrix); CFWL_EventCheckWord checkWordEvent(this); - CFX_ByteString sLatinWord; + ByteString sLatinWord; CXFA_Path pathSpell; int32_t nStart = 0; float fOffSetX = m_rtEngine.left - m_fScrollOffsetX; float fOffSetY = m_rtEngine.top - m_fScrollOffsetY + m_fVAlignOffset; - CFX_WideString wsSpell = GetText(); + WideString wsSpell = GetText(); int32_t nContentLen = wsSpell.GetLength(); for (int i = 0; i < nContentLen; i++) { if (FxEditIsLatinWord(wsSpell[i])) { @@ -270,7 +270,7 @@ void CFWL_Edit::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { m_pProperties->m_pThemeProvider = pThemeProvider; } -void CFWL_Edit::SetText(const CFX_WideString& wsText) { +void CFWL_Edit::SetText(const WideString& wsText) { m_EdtEngine.Clear(); m_EdtEngine.Insert(0, wsText); } @@ -279,7 +279,7 @@ int32_t CFWL_Edit::GetTextLength() const { return m_EdtEngine.GetLength(); } -CFX_WideString CFWL_Edit::GetText() const { +WideString CFWL_Edit::GetText() const { return m_EdtEngine.GetText(); } @@ -322,7 +322,7 @@ void CFWL_Edit::SetAliasChar(wchar_t wAlias) { m_EdtEngine.SetAliasChar(wAlias); } -bool CFWL_Edit::Copy(CFX_WideString& wsCopy) { +bool CFWL_Edit::Copy(WideString& wsCopy) { if (!m_EdtEngine.HasSelection()) return false; @@ -330,7 +330,7 @@ bool CFWL_Edit::Copy(CFX_WideString& wsCopy) { return true; } -bool CFWL_Edit::Cut(CFX_WideString& wsCut) { +bool CFWL_Edit::Cut(WideString& wsCut) { if (!m_EdtEngine.HasSelection()) return false; @@ -338,7 +338,7 @@ bool CFWL_Edit::Cut(CFX_WideString& wsCut) { return true; } -bool CFWL_Edit::Paste(const CFX_WideString& wsPaste) { +bool CFWL_Edit::Paste(const WideString& wsPaste) { if (m_EdtEngine.HasSelection()) m_EdtEngine.ReplaceSelectedText(wsPaste); else @@ -396,7 +396,7 @@ void CFWL_Edit::OnCaretChanged() { } } -void CFWL_Edit::OnTextChanged(const CFX_WideString& prevText) { +void CFWL_Edit::OnTextChanged(const WideString& prevText) { if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_VAlignMask) UpdateVAlignment(); @@ -412,7 +412,7 @@ void CFWL_Edit::OnSelChanged() { RepaintRect(GetClientRect()); } -bool CFWL_Edit::OnValidate(const CFX_WideString& wsText) { +bool CFWL_Edit::OnValidate(const WideString& wsText) { CFWL_Widget* pDst = GetOuter(); if (!pDst) pDst = this; @@ -1050,7 +1050,7 @@ bool CFWL_Edit::ValidateNumberChar(wchar_t cNum) { if (!m_bSetRange) return true; - CFX_WideString wsText = m_EdtEngine.GetText(); + WideString wsText = m_EdtEngine.GetText(); if (wsText.IsEmpty()) return cNum != L'0'; @@ -1060,9 +1060,9 @@ bool CFWL_Edit::ValidateNumberChar(wchar_t cNum) { return false; int32_t nLen = wsText.GetLength(); - CFX_WideString l = wsText.Left(m_CursorPosition); - CFX_WideString r = wsText.Right(nLen - m_CursorPosition); - CFX_WideString wsNew = l + cNum + r; + WideString l = wsText.Left(m_CursorPosition); + WideString r = wsText.Right(nLen - m_CursorPosition); + WideString wsNew = l + cNum + r; return wsNew.GetInteger() <= m_iMax; } @@ -1369,7 +1369,7 @@ void CFWL_Edit::OnChar(CFWL_MessageKey* pMsg) { if (pMsg->m_dwFlags & kEditingModifier) break; - m_EdtEngine.Insert(m_CursorPosition, CFX_WideString(c)); + m_EdtEngine.Insert(m_CursorPosition, WideString(c)); SetCursorPosition(m_CursorPosition + 1); break; } diff --git a/xfa/fwl/cfwl_edit.h b/xfa/fwl/cfwl_edit.h index 310cb81578..e85baaaa38 100644 --- a/xfa/fwl/cfwl_edit.h +++ b/xfa/fwl/cfwl_edit.h @@ -65,10 +65,10 @@ class CFWL_Edit : public CFWL_Widget, public CFDE_TextEditEngine::Delegate { void OnDrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; - virtual void SetText(const CFX_WideString& wsText); + virtual void SetText(const WideString& wsText); int32_t GetTextLength() const; - CFX_WideString GetText() const; + WideString GetText() const; void ClearText(); void SelectAll(); @@ -80,9 +80,9 @@ class CFWL_Edit : public CFWL_Widget, public CFDE_TextEditEngine::Delegate { int32_t GetLimit() const; void SetLimit(int32_t nLimit); void SetAliasChar(wchar_t wAlias); - bool Copy(CFX_WideString& wsCopy); - bool Cut(CFX_WideString& wsCut); - bool Paste(const CFX_WideString& wsPaste); + bool Copy(WideString& wsCopy); + bool Cut(WideString& wsCut); + bool Paste(const WideString& wsPaste); bool Undo(); bool Redo(); bool CanUndo(); @@ -93,9 +93,9 @@ class CFWL_Edit : public CFWL_Widget, public CFDE_TextEditEngine::Delegate { // CFDE_TextEditEngine::Delegate void NotifyTextFull() override; void OnCaretChanged() override; - void OnTextChanged(const CFX_WideString& prevText) override; + void OnTextChanged(const WideString& prevText) override; void OnSelChanged() override; - bool OnValidate(const CFX_WideString& wsText) override; + bool OnValidate(const WideString& wsText) override; void SetScrollOffset(float fScrollOffset) override; protected: @@ -171,8 +171,8 @@ class CFWL_Edit : public CFWL_Widget, public CFDE_TextEditEngine::Delegate { std::unique_ptr<CFWL_ScrollBar> m_pVertScrollBar; std::unique_ptr<CFWL_ScrollBar> m_pHorzScrollBar; std::unique_ptr<CFWL_Caret> m_pCaret; - CFX_WideString m_wsCache; - CFX_WideString m_wsFont; + WideString m_wsCache; + WideString m_wsFont; }; #endif // XFA_FWL_CFWL_EDIT_H_ diff --git a/xfa/fwl/cfwl_eventcheckword.h b/xfa/fwl/cfwl_eventcheckword.h index 3de1e75c24..fafe3d3278 100644 --- a/xfa/fwl/cfwl_eventcheckword.h +++ b/xfa/fwl/cfwl_eventcheckword.h @@ -14,7 +14,7 @@ class CFWL_EventCheckWord : public CFWL_Event { explicit CFWL_EventCheckWord(CFWL_Widget* pSrcTarget); ~CFWL_EventCheckWord() override; - CFX_ByteString bsWord; + ByteString bsWord; bool bCheckWord; }; diff --git a/xfa/fwl/cfwl_eventtextchanged.h b/xfa/fwl/cfwl_eventtextchanged.h index 8ae27627b5..4494f08075 100644 --- a/xfa/fwl/cfwl_eventtextchanged.h +++ b/xfa/fwl/cfwl_eventtextchanged.h @@ -14,7 +14,7 @@ class CFWL_EventTextChanged : public CFWL_Event { explicit CFWL_EventTextChanged(CFWL_Widget* pSrcTarget); ~CFWL_EventTextChanged() override; - CFX_WideString wsPrevText; + WideString wsPrevText; }; #endif // XFA_FWL_CFWL_EVENTTEXTCHANGED_H_ diff --git a/xfa/fwl/cfwl_eventvalidate.h b/xfa/fwl/cfwl_eventvalidate.h index 512161212a..b8feff1120 100644 --- a/xfa/fwl/cfwl_eventvalidate.h +++ b/xfa/fwl/cfwl_eventvalidate.h @@ -14,7 +14,7 @@ class CFWL_EventValidate : public CFWL_Event { explicit CFWL_EventValidate(CFWL_Widget* pSrcTarget); ~CFWL_EventValidate() override; - CFX_WideString wsInsert; + WideString wsInsert; bool bValidate; }; diff --git a/xfa/fwl/cfwl_form.cpp b/xfa/fwl/cfwl_form.cpp index 5e59f274b4..4761693d3e 100644 --- a/xfa/fwl/cfwl_form.cpp +++ b/xfa/fwl/cfwl_form.cpp @@ -45,8 +45,8 @@ FWL_Type CFWL_Form::GetClassID() const { return FWL_Type::Form; } -bool CFWL_Form::IsInstance(const CFX_WideStringC& wsClass) const { - if (wsClass == CFX_WideStringC(FWL_CLASS_Form)) +bool CFWL_Form::IsInstance(const WideStringView& wsClass) const { + if (wsClass == WideStringView(FWL_CLASS_Form)) return true; return CFWL_Widget::IsInstance(wsClass); } diff --git a/xfa/fwl/cfwl_form.h b/xfa/fwl/cfwl_form.h index 78fee4b915..014ed22798 100644 --- a/xfa/fwl/cfwl_form.h +++ b/xfa/fwl/cfwl_form.h @@ -34,7 +34,7 @@ class CFWL_Form : public CFWL_Widget { // CFWL_Widget FWL_Type GetClassID() const override; - bool IsInstance(const CFX_WideStringC& wsClass) const override; + bool IsInstance(const WideStringView& wsClass) const override; CFX_RectF GetClientRect() override; void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; diff --git a/xfa/fwl/cfwl_formproxy.cpp b/xfa/fwl/cfwl_formproxy.cpp index 123cf2509a..d03c1488cd 100644 --- a/xfa/fwl/cfwl_formproxy.cpp +++ b/xfa/fwl/cfwl_formproxy.cpp @@ -24,8 +24,8 @@ FWL_Type CFWL_FormProxy::GetClassID() const { return FWL_Type::FormProxy; } -bool CFWL_FormProxy::IsInstance(const CFX_WideStringC& wsClass) const { - if (wsClass == CFX_WideStringC(FWL_CLASS_FormProxy)) +bool CFWL_FormProxy::IsInstance(const WideStringView& wsClass) const { + if (wsClass == WideStringView(FWL_CLASS_FormProxy)) return true; return CFWL_Form::IsInstance(wsClass); } diff --git a/xfa/fwl/cfwl_formproxy.h b/xfa/fwl/cfwl_formproxy.h index 630719505d..498ff42a3e 100644 --- a/xfa/fwl/cfwl_formproxy.h +++ b/xfa/fwl/cfwl_formproxy.h @@ -22,7 +22,7 @@ class CFWL_FormProxy : public CFWL_Form { // CFWL_Widget FWL_Type GetClassID() const override; - bool IsInstance(const CFX_WideStringC& wsClass) const override; + bool IsInstance(const WideStringView& wsClass) const override; void Update() override; void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; diff --git a/xfa/fwl/cfwl_listbox.cpp b/xfa/fwl/cfwl_listbox.cpp index 210ec1f06e..0ddb65bc1a 100644 --- a/xfa/fwl/cfwl_listbox.cpp +++ b/xfa/fwl/cfwl_listbox.cpp @@ -444,7 +444,7 @@ void CFWL_ListBox::DrawItem(CXFA_Graphics* pGraphics, if (!pItem) return; - CFX_WideString wsText = pItem->GetText(); + WideString wsText = pItem->GetText(); if (wsText.GetLength() <= 0) return; @@ -907,9 +907,9 @@ int32_t CFWL_ListBox::GetItemIndex(CFWL_Widget* pWidget, CFWL_ListItem* pItem) { return it != m_ItemArray.end() ? it - m_ItemArray.begin() : -1; } -CFWL_ListItem* CFWL_ListBox::AddString(const CFX_WideStringC& wsAdd) { +CFWL_ListItem* CFWL_ListBox::AddString(const WideStringView& wsAdd) { m_ItemArray.emplace_back( - pdfium::MakeUnique<CFWL_ListItem>(CFX_WideString(wsAdd))); + pdfium::MakeUnique<CFWL_ListItem>(WideString(wsAdd))); return m_ItemArray.back().get(); } diff --git a/xfa/fwl/cfwl_listbox.h b/xfa/fwl/cfwl_listbox.h index 4704a8a840..4a7818c38d 100644 --- a/xfa/fwl/cfwl_listbox.h +++ b/xfa/fwl/cfwl_listbox.h @@ -53,7 +53,7 @@ class CFWL_ListBox : public CFWL_Widget { CFWL_ListItem* GetItem(const CFWL_Widget* pWidget, int32_t nIndex) const; int32_t GetItemIndex(CFWL_Widget* pWidget, CFWL_ListItem* pItem); - CFWL_ListItem* AddString(const CFX_WideStringC& wsAdd); + CFWL_ListItem* AddString(const WideStringView& wsAdd); void RemoveAt(int32_t iIndex); void DeleteString(CFWL_ListItem* pItem); void DeleteAll(); diff --git a/xfa/fwl/cfwl_listitem.cpp b/xfa/fwl/cfwl_listitem.cpp index a8ea8a6452..f8a7b753aa 100644 --- a/xfa/fwl/cfwl_listitem.cpp +++ b/xfa/fwl/cfwl_listitem.cpp @@ -6,7 +6,7 @@ #include "xfa/fwl/cfwl_listitem.h" -CFWL_ListItem::CFWL_ListItem(const CFX_WideString& text) +CFWL_ListItem::CFWL_ListItem(const WideString& text) : m_dwStates(0), m_wsText(text) { m_rtItem.Reset(); } diff --git a/xfa/fwl/cfwl_listitem.h b/xfa/fwl/cfwl_listitem.h index aac67fcb51..62c3a98bd7 100644 --- a/xfa/fwl/cfwl_listitem.h +++ b/xfa/fwl/cfwl_listitem.h @@ -12,7 +12,7 @@ class CFWL_ListItem { public: - explicit CFWL_ListItem(const CFX_WideString& text); + explicit CFWL_ListItem(const WideString& text); ~CFWL_ListItem(); CFX_RectF GetRect() const { return m_rtItem; } @@ -21,12 +21,12 @@ class CFWL_ListItem { uint32_t GetStates() const { return m_dwStates; } void SetStates(uint32_t dwStates) { m_dwStates = dwStates; } - CFX_WideString GetText() const { return m_wsText; } + WideString GetText() const { return m_wsText; } private: CFX_RectF m_rtItem; uint32_t m_dwStates; - CFX_WideString m_wsText; + WideString m_wsText; }; #endif // XFA_FWL_CFWL_LISTITEM_H_ diff --git a/xfa/fwl/cfwl_monthcalendar.cpp b/xfa/fwl/cfwl_monthcalendar.cpp index 11712fefa4..82cef65c3c 100644 --- a/xfa/fwl/cfwl_monthcalendar.cpp +++ b/xfa/fwl/cfwl_monthcalendar.cpp @@ -32,9 +32,9 @@ namespace { -CFX_WideString GetCapacityForDay(IFWL_ThemeProvider* pTheme, - CFWL_ThemePart& params, - uint32_t day) { +WideString GetCapacityForDay(IFWL_ThemeProvider* pTheme, + CFWL_ThemePart& params, + uint32_t day) { ASSERT(day < 7); if (day == 0) @@ -52,9 +52,9 @@ CFX_WideString GetCapacityForDay(IFWL_ThemeProvider* pTheme, return L"Sat"; } -CFX_WideString GetCapacityForMonth(IFWL_ThemeProvider* pTheme, - CFWL_ThemePart& params, - uint32_t month) { +WideString GetCapacityForMonth(IFWL_ThemeProvider* pTheme, + CFWL_ThemePart& params, + uint32_t month) { ASSERT(month < 12); if (month == 0) @@ -430,7 +430,7 @@ CFX_SizeF CFWL_MonthCalendar::CalcSize() { float fDayMaxW = 0.0f; float fDayMaxH = 0.0f; for (int day = 10; day <= 31; day++) { - CFX_WideString wsDay; + WideString wsDay; wsDay.Format(L"%d", day); CFX_SizeF sz = CalcTextSize(wsDay, m_pProperties->m_pThemeProvider, false); fDayMaxW = (fDayMaxW >= sz.width) ? fDayMaxW : sz.width; @@ -462,7 +462,7 @@ CFX_SizeF CFWL_MonthCalendar::CalcSize() { m_szHead.width + MONTHCAL_HEADER_BTN_HMARGIN * 2 + m_szCell.width * 2; fs.width = std::max(fs.width, fMonthMaxW); - CFX_WideString wsToday = GetTodayText(m_iYear, m_iMonth, m_iDay); + WideString wsToday = GetTodayText(m_iYear, m_iMonth, m_iDay); m_wsToday = L"Today" + wsToday; m_szToday = CalcTextSize(wsToday, m_pProperties->m_pThemeProvider, false); m_szToday.height = (m_szToday.height >= m_szCell.height) ? m_szToday.height @@ -579,7 +579,7 @@ void CFWL_MonthCalendar::ResetDateItem() { if (iDayOfWeek >= 7) iDayOfWeek = 0; - CFX_WideString wsDay; + WideString wsDay; wsDay.Format(L"%d", i + 1); uint32_t dwStates = 0; if (m_iYear == m_iCurYear && m_iMonth == m_iCurMonth && m_iDay == (i + 1)) @@ -674,21 +674,21 @@ void CFWL_MonthCalendar::JumpToToday() { AddSelDay(m_iDay); } -CFX_WideString CFWL_MonthCalendar::GetHeadText(int32_t iYear, int32_t iMonth) { +WideString CFWL_MonthCalendar::GetHeadText(int32_t iYear, int32_t iMonth) { ASSERT(iMonth > 0 && iMonth < 13); static const wchar_t* const pMonth[] = {L"January", L"February", L"March", L"April", L"May", L"June", L"July", L"August", L"September", L"October", L"November", L"December"}; - CFX_WideString wsHead; + WideString wsHead; wsHead.Format(L"%s, %d", pMonth[iMonth - 1], iYear); return wsHead; } -CFX_WideString CFWL_MonthCalendar::GetTodayText(int32_t iYear, - int32_t iMonth, - int32_t iDay) { - CFX_WideString wsToday; +WideString CFWL_MonthCalendar::GetTodayText(int32_t iYear, + int32_t iMonth, + int32_t iDay) { + WideString wsToday; wsToday.Format(L", %d/%d/%d", iDay, iMonth, iYear); return wsToday; } @@ -893,7 +893,7 @@ CFWL_MonthCalendar::DATEINFO::DATEINFO(int32_t day, int32_t dayofweek, uint32_t dwSt, CFX_RectF rc, - CFX_WideString& wsday) + WideString& wsday) : iDay(day), iDayOfWeek(dayofweek), dwStates(dwSt), diff --git a/xfa/fwl/cfwl_monthcalendar.h b/xfa/fwl/cfwl_monthcalendar.h index 6e0d4711f1..50e6843507 100644 --- a/xfa/fwl/cfwl_monthcalendar.h +++ b/xfa/fwl/cfwl_monthcalendar.h @@ -80,14 +80,14 @@ class CFWL_MonthCalendar : public CFWL_Widget { int32_t dayofweek, uint32_t dwSt, CFX_RectF rc, - CFX_WideString& wsday); + WideString& wsday); ~DATEINFO(); int32_t iDay; int32_t iDayOfWeek; uint32_t dwStates; CFX_RectF rect; - CFX_WideString wsDay; + WideString wsDay; }; void DrawBackground(CXFA_Graphics* pGraphics, @@ -141,8 +141,8 @@ class CFWL_MonthCalendar : public CFWL_Widget { void RemoveSelDay(); void AddSelDay(int32_t iDay); void JumpToToday(); - CFX_WideString GetHeadText(int32_t iYear, int32_t iMonth); - CFX_WideString GetTodayText(int32_t iYear, int32_t iMonth, int32_t iDay); + WideString GetHeadText(int32_t iYear, int32_t iMonth); + WideString GetTodayText(int32_t iYear, int32_t iMonth, int32_t iDay); int32_t GetDayAtPoint(const CFX_PointF& point) const; CFX_RectF GetDayRect(int32_t iDay); void OnLButtonDown(CFWL_MessageMouse* pMsg); @@ -163,8 +163,8 @@ class CFWL_MonthCalendar : public CFWL_Widget { CFX_RectF m_rtTodayFlag; CFX_RectF m_rtWeekNum; CFX_RectF m_rtWeekNumSep; - CFX_WideString m_wsHead; - CFX_WideString m_wsToday; + WideString m_wsHead; + WideString m_wsToday; std::vector<std::unique_ptr<DATEINFO>> m_arrDates; int32_t m_iCurYear; int32_t m_iCurMonth; diff --git a/xfa/fwl/cfwl_themetext.h b/xfa/fwl/cfwl_themetext.h index 2a42615d6f..91a3f385df 100644 --- a/xfa/fwl/cfwl_themetext.h +++ b/xfa/fwl/cfwl_themetext.h @@ -15,7 +15,7 @@ class CFWL_ThemeText : public CFWL_ThemePart { public: CFWL_ThemeText() : m_pGraphics(nullptr) {} - CFX_WideString m_wsText; + WideString m_wsText; FDE_TextStyle m_dwTTOStyles; FDE_TextAlignment m_iTTOAlign; CXFA_Graphics* m_pGraphics; diff --git a/xfa/fwl/cfwl_widget.cpp b/xfa/fwl/cfwl_widget.cpp index 9071f0fb0e..b9b04cf1f4 100644 --- a/xfa/fwl/cfwl_widget.cpp +++ b/xfa/fwl/cfwl_widget.cpp @@ -63,7 +63,7 @@ CFWL_Widget::~CFWL_Widget() { m_pWidgetMgr->RemoveWidget(this); } -bool CFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const { +bool CFWL_Widget::IsInstance(const WideStringView& wsClass) const { return false; } @@ -315,7 +315,7 @@ CFWL_Widget* CFWL_Widget::GetRootOuter() { return pRet; } -CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString& wsText, +CFX_SizeF CFWL_Widget::CalcTextSize(const WideString& wsText, IFWL_ThemeProvider* pTheme, bool bMultiLine) { if (!pTheme) @@ -336,7 +336,7 @@ CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString& wsText, return CFX_SizeF(rect.width, rect.height); } -void CFWL_Widget::CalcTextRect(const CFX_WideString& wsText, +void CFWL_Widget::CalcTextRect(const WideString& wsText, IFWL_ThemeProvider* pTheme, const FDE_TextStyle& dwTTOStyles, FDE_TextAlignment iTTOAlign, diff --git a/xfa/fwl/cfwl_widget.h b/xfa/fwl/cfwl_widget.h index 1c5f84d62e..16a818e708 100644 --- a/xfa/fwl/cfwl_widget.h +++ b/xfa/fwl/cfwl_widget.h @@ -53,7 +53,7 @@ class CFWL_Widget : public IFWL_WidgetDelegate { ~CFWL_Widget() override; virtual FWL_Type GetClassID() const = 0; - virtual bool IsInstance(const CFX_WideStringC& wsClass) const; + virtual bool IsInstance(const WideStringView& wsClass) const; virtual CFX_RectF GetAutosizedWidgetRect(); virtual CFX_RectF GetWidgetRect(); virtual CFX_RectF GetClientRect(); @@ -127,10 +127,10 @@ class CFWL_Widget : public IFWL_WidgetDelegate { float GetBorderSize(bool bCX); CFX_RectF GetRelativeRect(); IFWL_ThemeProvider* GetAvailableTheme(); - CFX_SizeF CalcTextSize(const CFX_WideString& wsText, + CFX_SizeF CalcTextSize(const WideString& wsText, IFWL_ThemeProvider* pTheme, bool bMultiLine); - void CalcTextRect(const CFX_WideString& wsText, + void CalcTextRect(const WideString& wsText, IFWL_ThemeProvider* pTheme, const FDE_TextStyle& dwTTOStyles, FDE_TextAlignment iTTOAlign, diff --git a/xfa/fwl/cfx_barcode.cpp b/xfa/fwl/cfx_barcode.cpp index 8b51f2d741..9d667c67b9 100644 --- a/xfa/fwl/cfx_barcode.cpp +++ b/xfa/fwl/cfx_barcode.cpp @@ -294,7 +294,7 @@ bool CFX_Barcode::SetTruncated(bool truncated) { : false; } -bool CFX_Barcode::Encode(const CFX_WideStringC& contents) { +bool CFX_Barcode::Encode(const WideStringView& contents) { return m_pBCEngine && m_pBCEngine->Encode(contents); } diff --git a/xfa/fwl/cfx_barcode.h b/xfa/fwl/cfx_barcode.h index 32a6db57cc..eec4648e82 100644 --- a/xfa/fwl/cfx_barcode.h +++ b/xfa/fwl/cfx_barcode.h @@ -27,7 +27,7 @@ class CFX_Barcode { bool Create(BC_TYPE type); BC_TYPE GetType(); - bool Encode(const CFX_WideStringC& contents); + bool Encode(const WideStringView& contents); bool RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matrix); diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.h b/xfa/fwl/theme/cfwl_monthcalendartp.h index 57438a0551..6a1b9be360 100644 --- a/xfa/fwl/theme/cfwl_monthcalendartp.h +++ b/xfa/fwl/theme/cfwl_monthcalendartp.h @@ -45,7 +45,7 @@ class CFWL_MonthCalendarTP : public CFWL_WidgetTP { FWLTHEME_STATE GetState(uint32_t dwFWLStates); std::unique_ptr<MCThemeData> m_pThemeData; - CFX_WideString wsResource; + WideString wsResource; private: void SetThemeData(); diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp index 4d6503f845..1eade9c70b 100644 --- a/xfa/fwl/theme/cfwl_widgettp.cpp +++ b/xfa/fwl/theme/cfwl_widgettp.cpp @@ -53,7 +53,7 @@ void CFWL_WidgetTP::DrawText(CFWL_ThemeText* pParams) { pMatrix->Concat(*pGraphics->GetMatrix()); m_pTextOut->SetMatrix(*pMatrix); m_pTextOut->DrawLogicText(pGraphics->GetRenderDevice(), - CFX_WideStringC(pParams->m_wsText.c_str(), iLen), + WideStringView(pParams->m_wsText.c_str(), iLen), pParams->m_rtPart); } @@ -260,14 +260,14 @@ CFWL_FontData::CFWL_FontData() : m_dwStyles(0), m_dwCodePage(0) {} CFWL_FontData::~CFWL_FontData() {} -bool CFWL_FontData::Equal(const CFX_WideStringC& wsFontFamily, +bool CFWL_FontData::Equal(const WideStringView& wsFontFamily, uint32_t dwFontStyles, uint16_t wCodePage) { return m_wsFamily == wsFontFamily && m_dwStyles == dwFontStyles && m_dwCodePage == wCodePage; } -bool CFWL_FontData::LoadFont(const CFX_WideStringC& wsFontFamily, +bool CFWL_FontData::LoadFont(const WideStringView& wsFontFamily, uint32_t dwFontStyles, uint16_t dwCodePage) { m_wsFamily = wsFontFamily; @@ -304,7 +304,7 @@ CFWL_FontManager::CFWL_FontManager() {} CFWL_FontManager::~CFWL_FontManager() {} CFX_RetainPtr<CFGAS_GEFont> CFWL_FontManager::FindFont( - const CFX_WideStringC& wsFontFamily, + const WideStringView& wsFontFamily, uint32_t dwFontStyles, uint16_t wCodePage) { for (const auto& pData : m_FontsArray) { diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h index 229b9ea7c3..dd36778704 100644 --- a/xfa/fwl/theme/cfwl_widgettp.h +++ b/xfa/fwl/theme/cfwl_widgettp.h @@ -106,16 +106,16 @@ class CFWL_FontData { CFWL_FontData(); virtual ~CFWL_FontData(); - bool Equal(const CFX_WideStringC& wsFontFamily, + bool Equal(const WideStringView& wsFontFamily, uint32_t dwFontStyles, uint16_t wCodePage); - bool LoadFont(const CFX_WideStringC& wsFontFamily, + bool LoadFont(const WideStringView& wsFontFamily, uint32_t dwFontStyles, uint16_t wCodePage); CFX_RetainPtr<CFGAS_GEFont> GetFont() const { return m_pFont; } protected: - CFX_WideString m_wsFamily; + WideString m_wsFamily; uint32_t m_dwStyles; uint32_t m_dwCodePage; #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ @@ -130,7 +130,7 @@ class CFWL_FontManager { static CFWL_FontManager* GetInstance(); static void DestroyInstance(); - CFX_RetainPtr<CFGAS_GEFont> FindFont(const CFX_WideStringC& wsFontFamily, + CFX_RetainPtr<CFGAS_GEFont> FindFont(const WideStringView& wsFontFamily, uint32_t dwFontStyles, uint16_t dwCodePage); |