Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: xfa/fxfa/parser/cxfa_widgetdata.cpp

Issue 1979723003: Make CFX_WideString(const CFX_WideString&) explicit. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Override Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/parser/cxfa_widgetdata.h ('k') | xfa/fxfa/parser/xfa_document_datadescription_imp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/cxfa_widgetdata.cpp
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index 7ca020fe6fd2123e304b571629c551522d2fcbf3..6ef88cdc741b55c90cb0570fdc9b1da9aecdfcf1 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -888,19 +888,19 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel,
if (iCount < 1) {
CXFA_Node* pItems = m_pNode->CreateSamePacketNode(XFA_ELEMENT_Items);
m_pNode->InsertChild(-1, pItems);
- InsertListTextItem(pItems, wsLabel.AsStringC(), nIndex);
+ InsertListTextItem(pItems, wsLabel, nIndex);
CXFA_Node* pSaveItems = m_pNode->CreateSamePacketNode(XFA_ELEMENT_Items);
m_pNode->InsertChild(-1, pSaveItems);
pSaveItems->SetBoolean(XFA_ATTRIBUTE_Save, TRUE);
- InsertListTextItem(pSaveItems, wsNewValue.AsStringC(), nIndex);
+ InsertListTextItem(pSaveItems, wsNewValue, nIndex);
} else if (iCount > 1) {
for (int32_t i = 0; i < 2; i++) {
CXFA_Node* pNode = listitems[i];
FX_BOOL bHasSave = pNode->GetBoolean(XFA_ATTRIBUTE_Save);
if (bHasSave)
- InsertListTextItem(pNode, wsNewValue.AsStringC(), nIndex);
+ InsertListTextItem(pNode, wsNewValue, nIndex);
else
- InsertListTextItem(pNode, wsLabel.AsStringC(), nIndex);
+ InsertListTextItem(pNode, wsLabel, nIndex);
}
} else {
CXFA_Node* pNode = listitems[0];
@@ -916,12 +916,12 @@ void CXFA_WidgetData::InsertItem(const CFX_WideString& wsLabel,
while (pListNode) {
CFX_WideString wsOldValue;
pListNode->TryContent(wsOldValue);
- InsertListTextItem(pSaveItems, wsOldValue.AsStringC(), i);
+ InsertListTextItem(pSaveItems, wsOldValue, i);
i++;
pListNode = pListNode->GetNodeItem(XFA_NODEITEM_NextSibling);
}
- InsertListTextItem(pNode, wsLabel.AsStringC(), nIndex);
- InsertListTextItem(pSaveItems, wsNewValue.AsStringC(), nIndex);
+ InsertListTextItem(pNode, wsLabel, nIndex);
+ InsertListTextItem(pSaveItems, wsNewValue, nIndex);
}
if (!bNotify)
return;
@@ -1074,7 +1074,8 @@ int32_t CXFA_WidgetData::GetNumberOfCells() {
CFX_WideString CXFA_WidgetData::GetBarcodeType() {
CXFA_Node* pUIChild = GetUIChild();
- return pUIChild ? pUIChild->GetCData(XFA_ATTRIBUTE_Type) : NULL;
+ return pUIChild ? CFX_WideString(pUIChild->GetCData(XFA_ATTRIBUTE_Type))
+ : nullptr;
}
FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(int32_t& val) {
@@ -1084,7 +1085,8 @@ FX_BOOL CXFA_WidgetData::GetBarcodeAttribute_CharEncoding(int32_t& val) {
if (wsCharEncoding.CompareNoCase(L"UTF-16")) {
val = CHAR_ENCODING_UNICODE;
return TRUE;
- } else if (wsCharEncoding.CompareNoCase(L"UTF-8")) {
+ }
+ if (wsCharEncoding.CompareNoCase(L"UTF-8")) {
val = CHAR_ENCODING_UTF8;
return TRUE;
}
@@ -1475,8 +1477,8 @@ IFX_Locale* CXFA_WidgetData::GetLocal() {
if (wsLocaleName == FX_WSTRC(L"ambient")) {
pLocale = m_pNode->GetDocument()->GetLocalMgr()->GetDefLocale();
} else {
- pLocale = m_pNode->GetDocument()->GetLocalMgr()->GetLocaleByName(
- wsLocaleName.AsStringC());
+ pLocale =
+ m_pNode->GetDocument()->GetLocalMgr()->GetLocaleByName(wsLocaleName);
}
}
return pLocale;
@@ -1739,7 +1741,7 @@ void CXFA_WidgetData::SyncValue(const CFX_WideString& wsValue,
}
void CXFA_WidgetData::InsertListTextItem(CXFA_Node* pItems,
- const CFX_WideStringC& wsText,
+ const CFX_WideString& wsText,
int32_t nIndex) {
CXFA_Node* pText = pItems->CreateSamePacketNode(XFA_ELEMENT_Text);
pItems->InsertChild(nIndex, pText);
« no previous file with comments | « xfa/fxfa/parser/cxfa_widgetdata.h ('k') | xfa/fxfa/parser/xfa_document_datadescription_imp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698