diff options
author | tsepez <tsepez@chromium.org> | 2016-04-14 09:49:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-14 09:49:44 -0700 |
commit | 774bdde253b8394aa2ac791e273508ff006d813a (patch) | |
tree | f00993d262bfda76d129c14dc8a11053e019542f | |
parent | 725a49f7a64a3537c081cd23cf7d5d6578efdfa1 (diff) | |
download | pdfium-774bdde253b8394aa2ac791e273508ff006d813a.tar.xz |
Replace calls to deprecated CFX_{Wide,Byte}String::Empty()
Use the more standard name "clear()" instead.
Review URL: https://codereview.chromium.org/1888103002
27 files changed, 84 insertions, 88 deletions
diff --git a/core/fpdftext/fpdf_text_int.cpp b/core/fpdftext/fpdf_text_int.cpp index a1e3fda7b1..8de65cb07a 100644 --- a/core/fpdftext/fpdf_text_int.cpp +++ b/core/fpdftext/fpdf_text_int.cpp @@ -2185,7 +2185,7 @@ void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) { } m_csFindWhatArray.push_back(curStr); if (pos == csWord.GetLength() - 1) { - csWord.Empty(); + csWord.clear(); break; } csWord = csWord.Right(csWord.GetLength() - pos - 1); @@ -2258,7 +2258,7 @@ FX_BOOL CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString, while (iSubString--) { lpszFullString = FXSYS_wcschr(lpszFullString, chSep); if (!lpszFullString) { - rString.Empty(); + rString.clear(); return FALSE; } lpszFullString++; @@ -2278,7 +2278,7 @@ FX_BOOL CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString, CFX_WideString CPDF_TextPageFind::MakeReverse(const CFX_WideString& str) { CFX_WideString str2; - str2.Empty(); + str2.clear(); int nlen = str.GetLength(); for (int i = nlen - 1; i >= 0; i--) { str2 += str.GetAt(i); diff --git a/core/fxcodec/codec/fx_codec_gif.cpp b/core/fxcodec/codec/fx_codec_gif.cpp index b7362ca4b3..13576412c2 100644 --- a/core/fxcodec/codec/fx_codec_gif.cpp +++ b/core/fxcodec/codec/fx_codec_gif.cpp @@ -160,7 +160,7 @@ int32_t CCodec_GifModule::LoadFrame(FXGIF_Context* ctx, if (size) { pAttribute->m_strAuthor = CFX_ByteString(buf, size); } else { - pAttribute->m_strAuthor.Empty(); + pAttribute->m_strAuthor.clear(); } buf += size; size = *buf++; diff --git a/core/fxcodec/lgif/fx_gif.cpp b/core/fxcodec/lgif/fx_gif.cpp index 059fa9a70b..53298c831a 100644 --- a/core/fxcodec/lgif/fx_gif.cpp +++ b/core/fxcodec/lgif/fx_gif.cpp @@ -647,7 +647,7 @@ int32_t gif_decode_extension(gif_decompress_struct_p gif_ptr) { gif_ptr->skip_size = skip_size_org; return 2; } - gif_ptr->cmt_data_ptr->Empty(); + gif_ptr->cmt_data_ptr->clear(); while (*data_size_ptr != GIF_BLOCK_TERMINAL) { uint8_t data_size = *data_size_ptr; if (gif_read_data(gif_ptr, &data_ptr, *data_size_ptr) == NULL || diff --git a/core/fxcrt/fx_basic_buffer.cpp b/core/fxcrt/fx_basic_buffer.cpp index 7f85c95d3f..1e5d0554d1 100644 --- a/core/fxcrt/fx_basic_buffer.cpp +++ b/core/fxcrt/fx_basic_buffer.cpp @@ -290,7 +290,7 @@ CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(CFX_ByteString& str) { } int len; operator>>(len); - str.Empty(); + str.clear(); if (len <= 0 || m_LoadingPos + len > m_LoadingSize) { return *this; } diff --git a/core/fxcrt/include/fx_string.h b/core/fxcrt/include/fx_string.h index 9d7d66741b..7024691e35 100644 --- a/core/fxcrt/include/fx_string.h +++ b/core/fxcrt/include/fx_string.h @@ -159,8 +159,6 @@ class CFX_ByteString { ~CFX_ByteString(); - // Deprecated -- use clear(). - void Empty() { m_pData.Reset(); } void clear() { m_pData.Reset(); } static CFX_ByteString FromUnicode(const FX_WCHAR* ptr, FX_STRSIZE len = -1); @@ -503,8 +501,6 @@ class CFX_WideString { return CFX_WideStringC(c_str(), GetLength()); } - // Deprecated -- use clear(). - void Empty() { m_pData.Reset(); } void clear() { m_pData.Reset(); } FX_STRSIZE GetLength() const { return m_pData ? m_pData->m_nDataLength : 0; } diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp index f75aa53a54..620838185e 100644 --- a/fpdfsdk/pdfwindow/PWL_Edit.cpp +++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp @@ -46,7 +46,7 @@ void CPWL_Edit::SetText(const FX_WCHAR* csText) { int32_t nCount = pXML->CountChildren(); FX_BOOL bFirst = TRUE; - swText.Empty(); + swText.clear(); for (int32_t i = 0; i < nCount; i++) { if (CXML_Element* pSubElement = pXML->GetElement(i)) { diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp index 8e9c30e2ba..fe4e019eb7 100644 --- a/xfa/fde/tto/fde_textout.cpp +++ b/xfa/fde/tto/fde_textout.cpp @@ -571,7 +571,7 @@ void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr, } m_pTxtBreak->SetLineWidth(fLineWidth); m_ttoLines.RemoveAll(TRUE); - m_wsText.Empty(); + m_wsText.clear(); LoadText(pwsStr, iLength, rect); if (m_dwStyles & FDE_TTOSTYLE_Ellipsis) { ReplaceWidthEllipsis(); diff --git a/xfa/fde/xml/fde_xml_imp.cpp b/xfa/fde/xml/fde_xml_imp.cpp index f678cf5cf8..16fc9622a9 100644 --- a/xfa/fde/xml/fde_xml_imp.cpp +++ b/xfa/fde/xml/fde_xml_imp.cpp @@ -681,7 +681,7 @@ void CFDE_XMLElement::GetLocalTagName(CFX_WideString& wsTag) const { void CFDE_XMLElement::GetNamespacePrefix(CFX_WideString& wsPrefix) const { FX_STRSIZE iFind = m_wsTag.Find(L':', 0); if (iFind < 0) { - wsPrefix.Empty(); + wsPrefix.clear(); } else { wsPrefix = m_wsTag.Left(iFind); } @@ -693,7 +693,7 @@ void CFDE_XMLElement::GetNamespaceURI(CFX_WideString& wsNamespace) const { wsAttri += L":"; wsAttri += wsPrefix; } - wsNamespace.Empty(); + wsNamespace.clear(); CFDE_XMLNode* pNode = (CFDE_XMLNode*)this; while (pNode != NULL) { if (pNode->GetType() != FDE_XMLNODE_Element) { @@ -1086,8 +1086,8 @@ CFDE_XMLDOMParser::CFDE_XMLDOMParser(CFDE_XMLNode* pRoot, } CFDE_XMLDOMParser::~CFDE_XMLDOMParser() { m_NodeStack.RemoveAll(); - m_ws1.Empty(); - m_ws2.Empty(); + m_ws1.clear(); + m_ws2.clear(); } int32_t CFDE_XMLDOMParser::DoParser(IFX_Pause* pPause) { @@ -1132,7 +1132,7 @@ int32_t CFDE_XMLDOMParser::DoParser(IFX_Pause* pPause) { m_pParser->GetTargetName(m_ws1); m_pChild = new CFDE_XMLInstruction(m_ws1); m_pParent->InsertChildNode(m_pChild); - m_ws1.Empty(); + m_ws1.clear(); break; case FDE_XmlSyntaxResult::TagName: m_pParser->GetTagName(m_ws1); @@ -1155,7 +1155,7 @@ int32_t CFDE_XMLDOMParser::DoParser(IFX_Pause* pPause) { } else if (m_pChild->GetType() == FDE_XMLNODE_Instruction) { ((CFDE_XMLInstruction*)m_pChild)->SetString(m_ws1, m_ws2); } - m_ws1.Empty(); + m_ws1.clear(); break; case FDE_XmlSyntaxResult::Text: m_pParser->GetTextData(m_ws1); @@ -1180,7 +1180,7 @@ int32_t CFDE_XMLDOMParser::DoParser(IFX_Pause* pPause) { } m_pParser->GetTargetData(m_ws1); ((CFDE_XMLInstruction*)m_pChild)->AppendData(m_ws1); - m_ws1.Empty(); + m_ws1.clear(); break; default: break; @@ -1205,8 +1205,8 @@ CFDE_XMLSAXParser::CFDE_XMLSAXParser(FDE_XMLREADERHANDLER* pHandler, m_ws2() {} CFDE_XMLSAXParser::~CFDE_XMLSAXParser() { m_TagStack.RemoveAll(); - m_ws1.Empty(); - m_ws2.Empty(); + m_ws1.clear(); + m_ws2.clear(); } int32_t CFDE_XMLSAXParser::DoParser(IFX_Pause* pPause) { FDE_XmlSyntaxResult syntaxParserResult; @@ -1247,7 +1247,7 @@ int32_t CFDE_XMLSAXParser::DoParser(IFX_Pause* pPause) { Push(xmlTag); m_pHandler->OnTagEnter(m_pHandler, FDE_XMLNODE_Instruction, m_pTagTop->wsTagName); - m_ws1.Empty(); + m_ws1.clear(); } break; case FDE_XmlSyntaxResult::TagName: { m_pParser->GetTargetName(m_ws1); @@ -1270,7 +1270,7 @@ int32_t CFDE_XMLSAXParser::DoParser(IFX_Pause* pPause) { if (m_pTagTop->eType == FDE_XMLNODE_Element) { m_pHandler->OnAttribute(m_pHandler, m_ws1, m_ws2); } - m_ws1.Empty(); + m_ws1.clear(); break; case FDE_XmlSyntaxResult::CData: m_pParser->GetTextData(m_ws1); @@ -1283,7 +1283,7 @@ int32_t CFDE_XMLSAXParser::DoParser(IFX_Pause* pPause) { case FDE_XmlSyntaxResult::TargetData: m_pParser->GetTargetData(m_ws1); m_pHandler->OnData(m_pHandler, FDE_XMLNODE_Instruction, m_ws1); - m_ws1.Empty(); + m_ws1.clear(); break; default: break; @@ -1380,7 +1380,7 @@ int32_t CFDE_BlockBuffer::DeleteTextChars(int32_t iCount, FX_BOOL bDirection) { void CFDE_BlockBuffer::GetTextData(CFX_WideString& wsTextData, int32_t iStart, int32_t iLength) const { - wsTextData.Empty(); + wsTextData.clear(); int32_t iMaybeDataLength = m_iBufferSize - 1 - m_iStartPosition; if (iStart < 0 || iStart > iMaybeDataLength) { return; diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp index 6e707bf9cf..9e8c824118 100644 --- a/xfa/fgas/font/fgas_stdfontmgr.cpp +++ b/xfa/fgas/font/fgas_stdfontmgr.cpp @@ -1380,7 +1380,7 @@ void CFX_FontMgrImp::GetNames(const uint8_t* name_table, uint16_t nPlatformID = GetUInt16(lpNameRecord + j * 12 + 0); uint16_t nNameLength = GetUInt16(lpNameRecord + j * 12 + 8); uint16_t nNameOffset = GetUInt16(lpNameRecord + j * 12 + 10); - wsFamily.Empty(); + wsFamily.clear(); if (nPlatformID != 1) { for (uint16_t k = 0; k < nNameLength / 2; k++) { FX_WCHAR wcTemp = GetUInt16(lpStr + nNameOffset + k * 2); diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp index dc4b3d220c..6e0add1fa5 100644 --- a/xfa/fgas/localization/fgas_locale.cpp +++ b/xfa/fgas/localization/fgas_locale.cpp @@ -765,7 +765,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, break; } } - wsSubCategory.Empty(); + wsSubCategory.clear(); if (!pLocale) { pLocale = m_pLocaleMgr->GetDefLocale(); } @@ -838,7 +838,7 @@ static FX_BOOL FX_GetNumericDotIndex(const CFX_WideString& wsNum, FX_BOOL CFX_FormatString::ParseText(const CFX_WideString& wsSrcText, const CFX_WideString& wsPattern, CFX_WideString& wsValue) { - wsValue.Empty(); + wsValue.clear(); if (wsSrcText.IsEmpty() || wsPattern.IsEmpty()) { return FALSE; } @@ -1663,7 +1663,7 @@ void FX_ParseNumString(const CFX_WideString& wsNum, CFX_WideString& wsResult) { FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_WideString& wsPattern, CFX_WideString& wsValue) { - wsValue.Empty(); + wsValue.clear(); if (wsSrcNum.IsEmpty() || wsPattern.IsEmpty()) { return FALSE; } @@ -2242,7 +2242,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat( default: break; } - wsTempPattern.Empty(); + wsTempPattern.clear(); continue; } ccf++; @@ -2255,7 +2255,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat( } else if (eCategory == FX_LOCALECATEGORY_Date) { wsDatePattern = wsTempPattern; } - wsTempPattern.Empty(); + wsTempPattern.clear(); } } else { wsTempPattern += pStr[ccf]; @@ -2273,7 +2273,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat( pLocale = m_pLocaleMgr->GetDefLocale(); } if (!iFindCategory) { - wsTimePattern.Empty(); + wsTimePattern.clear(); wsDatePattern = wsPattern; } return (FX_DATETIMETYPE)iFindCategory; @@ -3123,7 +3123,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum, } if (cc >= 0) { int nPos = dot_index % 3; - wsOutput.Empty(); + wsOutput.clear(); for (int32_t i = 0; i < dot_index; i++) { if (i % 3 == nPos && i != 0) { wsOutput += wsGroupSymbol; @@ -3540,7 +3540,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, } if (cc >= 0) { int nPos = dot_index % 3; - wsOutput.Empty(); + wsOutput.clear(); for (int32_t i = 0; i < dot_index; i++) { if (i % 3 == nPos && i != 0) { wsOutput += wsGroupSymbol; @@ -4254,7 +4254,7 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime, if (eCategory == FX_DATETIMETYPE_Unknown) { if (eDateTimeType == FX_DATETIMETYPE_Time) { wsTimePattern = wsDatePattern; - wsDatePattern.Empty(); + wsDatePattern.clear(); } eCategory = eDateTimeType; } diff --git a/xfa/fwl/basewidget/fwl_editimp.cpp b/xfa/fwl/basewidget/fwl_editimp.cpp index 95cf273ec2..1bc876f691 100644 --- a/xfa/fwl/basewidget/fwl_editimp.cpp +++ b/xfa/fwl/basewidget/fwl_editimp.cpp @@ -459,7 +459,7 @@ void CFWL_EditImp::DrawSpellCheck(CFX_Graphics* pGraphics, AddSpellCheckObj(pathSpell, nStart, sLatinWord.GetLength(), fOffSetX, fOffSetY); } - sLatinWord.Empty(); + sLatinWord.clear(); } } checkWordEvent.bsWord = sLatinWord; @@ -661,14 +661,14 @@ FX_BOOL CFWL_EditImp::Copy(CFX_WideString& wsCopy) { if (nCount == 0) { return FALSE; } - wsCopy.Empty(); + wsCopy.clear(); CFX_WideString wsTemp; int32_t nStart, nLength; for (int32_t i = 0; i < nCount; i++) { nLength = m_pEdtEngine->GetSelRange(i, nStart); m_pEdtEngine->GetText(wsTemp, nStart, nLength); wsCopy += wsTemp; - wsTemp.Empty(); + wsTemp.clear(); } return TRUE; } @@ -679,14 +679,14 @@ FX_BOOL CFWL_EditImp::Cut(CFX_WideString& wsCut) { if (nCount == 0) { return FALSE; } - wsCut.Empty(); + wsCut.clear(); CFX_WideString wsTemp; int32_t nStart, nLength; for (int32_t i = 0; i < nCount; i++) { nLength = m_pEdtEngine->GetSelRange(i, nStart); m_pEdtEngine->GetText(wsTemp, nStart, nLength); wsCut += wsTemp; - wsTemp.Empty(); + wsTemp.clear(); } m_pEdtEngine->Delete(0); return TRUE; diff --git a/xfa/fwl/core/fwl_targetimp.cpp b/xfa/fwl/core/fwl_targetimp.cpp index e3e768085a..1e63efe0a0 100644 --- a/xfa/fwl/core/fwl_targetimp.cpp +++ b/xfa/fwl/core/fwl_targetimp.cpp @@ -27,7 +27,7 @@ IFWL_Target::~IFWL_Target() { CFWL_TargetImp::CFWL_TargetImp() {} CFWL_TargetImp::~CFWL_TargetImp() {} FWL_ERR CFWL_TargetImp::GetClassName(CFX_WideString& wsClass) const { - wsClass.Empty(); + wsClass.clear(); return FWL_ERR_Succeeded; } uint32_t CFWL_TargetImp::GetClassID() const { diff --git a/xfa/fxfa/app/xfa_checksum.cpp b/xfa/fxfa/app/xfa_checksum.cpp index 69cb8350a3..56b0c88d63 100644 --- a/xfa/fxfa/app/xfa_checksum.cpp +++ b/xfa/fxfa/app/xfa_checksum.cpp @@ -134,7 +134,7 @@ FX_BOOL CXFA_ChecksumContext::StartChecksum() { FinishChecksum(); m_pByteContext = FX_Alloc(uint8_t, 128); CRYPT_SHA1Start(m_pByteContext); - m_bsChecksum.Empty(); + m_bsChecksum.clear(); m_pSAXReader = FX_SAXReader_Create(); return m_pSAXReader != NULL; } diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp index 42d0835460..2d1f8ace6e 100644 --- a/xfa/fxfa/app/xfa_fwltheme.cpp +++ b/xfa/fxfa/app/xfa_fwltheme.cpp @@ -268,7 +268,7 @@ void* CXFA_FWLTheme::GetCapacity(CFWL_ThemePart* pThemePart, if (CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pThemePart->m_pWidget)) { IXFA_AppProvider* pAppProvider = pWidget->GetAppProvider(); - m_wsResource.Empty(); + m_wsResource.clear(); pAppProvider->LoadString( XFA_IDS_StringWeekDay_Sun + dwCapacity - FWL_WGTCAPACITY_MAX - 5, m_wsResource); diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp index ce1ce7021e..80342a383e 100644 --- a/xfa/fxfa/app/xfa_textlayout.cpp +++ b/xfa/fxfa/app/xfa_textlayout.cpp @@ -517,7 +517,7 @@ FX_FLOAT CXFA_TextParser::GetLineHeight(CXFA_TextProvider* pTextProvider, FX_BOOL CXFA_TextParser::GetEmbbedObj(CXFA_TextProvider* pTextProvider, CFDE_XMLNode* pXMLNode, CFX_WideString& wsValue) { - wsValue.Empty(); + wsValue.clear(); if (pXMLNode == NULL) { return FALSE; } @@ -543,7 +543,7 @@ FX_BOOL CXFA_TextParser::GetEmbbedObj(CXFA_TextProvider* pTextProvider, if (!bURI && ws != FX_WSTRC(L"som")) { return FALSE; } - ws.Empty(); + ws.clear(); pElement->GetString(FX_WSTRC(L"xfa:embedMode").c_str(), ws); if (ws.IsEmpty()) { ws = L"formatted"; @@ -645,7 +645,7 @@ FX_BOOL CXFA_TextParser::GetTabstops( CXFA_Measurement ms(CFX_WideStringC(pTabStops + iLast, iCur - iLast)); FX_FLOAT fPos = ms.ToUnit(XFA_UNIT_Pt); pTabstopContext->Append(dwHashCode, fPos); - wsAlign.Empty(); + wsAlign.clear(); eStatus = XFA_TABSTOPSSTATUS_None; } iCur++; @@ -888,7 +888,7 @@ void CXFA_TextLayout::InitBreak(IFDE_CSSComputedStyle* pStyle, } int32_t CXFA_TextLayout::GetText(CFX_WideString& wsText) { GetTextDataNode(); - wsText.Empty(); + wsText.clear(); if (m_bRichText) { } else { wsText = m_pTextDataNode->GetContent(); diff --git a/xfa/fxfa/fm2js/xfa_fm2jsapi.cpp b/xfa/fxfa/fm2js/xfa_fm2jsapi.cpp index 38e5f2389f..147869dfb1 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jsapi.cpp +++ b/xfa/fxfa/fm2js/xfa_fm2jsapi.cpp @@ -20,7 +20,7 @@ int32_t XFA_FM2JS_Translate(const CFX_WideStringC& wsFormcalc, CFX_WideString& wsError) { if (wsFormcalc.IsEmpty()) { wsJavascript.Clear(); - wsError.Empty(); + wsError.clear(); return 0; } int32_t status = 0; diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp index ee7e6223fe..cc148c72ea 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp +++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp @@ -4127,7 +4127,7 @@ void CXFA_FM2JSContext::EncodeHTML(const CFX_ByteStringC& szHTMLString, CFX_WideString htmlReserve; while (i < iLen) { ch = *(pData + i); - htmlReserve.Empty(); + htmlReserve.clear(); if (HTMLCode2STR(ch, htmlReserve)) { wsResultBuf.AppendChar(L'&'); wsResultBuf << htmlReserve; diff --git a/xfa/fxfa/include/fxfa.h b/xfa/fxfa/include/fxfa.h index eb99e59110..1f2b00b4ec 100644 --- a/xfa/fxfa/include/fxfa.h +++ b/xfa/fxfa/include/fxfa.h @@ -150,7 +150,7 @@ class IXFA_AppProvider { virtual void GetAppType(CFX_WideString& wsAppType) = 0; virtual void SetFoxitAppType(const CFX_WideStringC& wsFoxitAppType) {} virtual void GetFoxitAppType(CFX_WideString& wsFoxitAppType) { - wsFoxitAppType.Empty(); + wsFoxitAppType.clear(); } /** @@ -174,7 +174,7 @@ class IXFA_AppProvider { */ virtual void GetVersion(CFX_WideString& wsVersion) = 0; virtual void GetFoxitVersion(CFX_WideString& wsFoxitVersion) { - wsFoxitVersion.Empty(); + wsFoxitVersion.clear(); } /** @@ -182,7 +182,7 @@ class IXFA_AppProvider { */ virtual void GetAppName(CFX_WideString& wsName) = 0; virtual void GetFoxitAppName(CFX_WideString& wsFoxitName) { - wsFoxitName.Empty(); + wsFoxitName.clear(); } /** @@ -436,25 +436,25 @@ class CXFA_EventParam { CXFA_EventParam() { m_pTarget = NULL; m_eType = XFA_EVENT_Unknown; - m_wsResult.Empty(); + m_wsResult.clear(); Reset(); } void Reset() { - m_wsChange.Empty(); + m_wsChange.clear(); m_iCommitKey = 0; - m_wsFullText.Empty(); + m_wsFullText.clear(); m_bKeyDown = FALSE; m_bModifier = FALSE; - m_wsNewContentType.Empty(); - m_wsNewText.Empty(); - m_wsPrevContentType.Empty(); - m_wsPrevText.Empty(); + m_wsNewContentType.clear(); + m_wsNewText.clear(); + m_wsPrevContentType.clear(); + m_wsPrevText.clear(); m_bReenter = FALSE; m_iSelEnd = 0; m_iSelStart = 0; m_bShift = FALSE; - m_wsSoapFaultCode.Empty(); - m_wsSoapFaultString.Empty(); + m_wsSoapFaultCode.clear(); + m_wsSoapFaultString.clear(); m_bIsFormReady = FALSE; m_iValidateActivities = XFA_VALIDATE_preSubmit; } diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index 681516d8e8..16380011fe 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -413,7 +413,7 @@ void CXFA_WidgetData::SetCheckState(XFA_CHECKSTATE eCheckState, if (pItemchild) wsChildValue = pItemchild->GetContent(); else - wsChildValue.Empty(); + wsChildValue.clear(); } CXFA_WidgetData ch(pChild); ch.SyncValue(wsChildValue, bNotify); @@ -504,7 +504,7 @@ void CXFA_WidgetData::SetSelectedMemberByValue(const CFX_WideStringC& wsValue, if (pItemchild) wsChildValue = pItemchild->GetContent(); else - wsChildValue.Empty(); + wsChildValue.clear(); } else { wsExclGroup = wsValue; } @@ -606,7 +606,7 @@ int32_t CXFA_WidgetData::CountChoiceListItems(FX_BOOL bSaveValue) { FX_BOOL CXFA_WidgetData::GetChoiceListItem(CFX_WideString& wsText, int32_t nIndex, FX_BOOL bSaveValue) { - wsText.Empty(); + wsText.clear(); CXFA_NodeArray pItemsArray; CXFA_Node* pItems = NULL; int32_t iCount = 0; @@ -1507,7 +1507,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue, int32_t iSelItemIndex = GetSelectedItem(0); if (iSelItemIndex >= 0) { GetChoiceListItem(wsValue, iSelItemIndex); - wsPicture.Empty(); + wsPicture.clear(); } } } break; @@ -1709,7 +1709,7 @@ void CXFA_WidgetData::FormatNumStr(const CFX_WideString& wsValue, int32_t cc = dot_index - 1; if (cc >= 0) { int nPos = dot_index % 3; - wsOutput.Empty(); + wsOutput.clear(); for (int32_t i = 0; i < dot_index; i++) { if (i % 3 == nPos && i != 0) wsOutput += wsGroupSymbol; diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp index a75a8ea72c..a271b10286 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp @@ -290,7 +290,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, pDataNode->GetNodeList(items); int32_t iCounts = items.GetSize(); if (iCounts > 0) { - wsNormailizeValue.Empty(); + wsNormailizeValue.clear(); CFX_WideString wsItem; for (int32_t i = 0; i < iCounts; i++) { items[i]->TryContent(wsItem); diff --git a/xfa/fxfa/parser/xfa_document_serialize.cpp b/xfa/fxfa/parser/xfa_document_serialize.cpp index 4c826b6e59..87707d84e6 100644 --- a/xfa/fxfa/parser/xfa_document_serialize.cpp +++ b/xfa/fxfa/parser/xfa_document_serialize.cpp @@ -189,7 +189,7 @@ FX_BOOL XFA_DataExporter_ContentNodeNeedtoExport(CXFA_Node* pContentNode) { static void XFA_DataExporter_RecognizeXFAVersionNumber( CXFA_Node* pTemplateRoot, CFX_WideString& wsVersionNumber) { - wsVersionNumber.Empty(); + wsVersionNumber.clear(); if (!pTemplateRoot) { return; } @@ -336,7 +336,7 @@ static void XFA_DataExporter_RegenerateFormFile_Changed( } if (!bSaveXML && !wsChildren.IsEmpty() && pNode->GetClassID() == XFA_ELEMENT_Items) { - wsChildren.Empty(); + wsChildren.clear(); bSaveXML = TRUE; CXFA_Node* pChildNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); while (pChildNode) { diff --git a/xfa/fxfa/parser/xfa_localemgr.cpp b/xfa/fxfa/parser/xfa_localemgr.cpp index f2b3f1f000..9b605b0844 100644 --- a/xfa/fxfa/parser/xfa_localemgr.cpp +++ b/xfa/fxfa/parser/xfa_localemgr.cpp @@ -1247,7 +1247,7 @@ void CXFA_LocaleMgr::SetDefLocale(IFX_Locale* pLocale) { } CFX_WideStringC CXFA_LocaleMgr::GetConfigLocaleName(CXFA_Node* pConfig) { if (!(m_dwLocaleFlags & 0x01)) { - m_wsConfigLocale.Empty(); + m_wsConfigLocale.clear(); if (pConfig) { CXFA_Node* pChildfConfig = pConfig->GetFirstChildByClass(XFA_ELEMENT_Acrobat); diff --git a/xfa/fxfa/parser/xfa_localevalue.cpp b/xfa/fxfa/parser/xfa_localevalue.cpp index e36595d840..6dd8377465 100644 --- a/xfa/fxfa/parser/xfa_localevalue.cpp +++ b/xfa/fxfa/parser/xfa_localevalue.cpp @@ -142,7 +142,7 @@ FX_BOOL CXFA_LocaleValue::ValidateValue(const CFX_WideString& wsValue, } case FX_LOCALECATEGORY_Text: bRet = pFormat->ParseText(wsValue, wsFormat, wsOutput); - wsOutput.Empty(); + wsOutput.clear(); if (!bRet) { bRet = pFormat->FormatText(wsValue, wsFormat, wsOutput); } @@ -464,7 +464,7 @@ FX_BOOL CXFA_LocaleValue::FormatPatterns(CFX_WideString& wsResult, const CFX_WideString& wsFormat, IFX_Locale* pLocale, XFA_VALUEPICTURE eValueType) const { - wsResult.Empty(); + wsResult.clear(); FX_BOOL bRet = FALSE; CFX_FormatString* pFormat = nullptr; @@ -492,7 +492,7 @@ FX_BOOL CXFA_LocaleValue::FormatSinglePattern( if (pLocale) { m_pLocaleMgr->SetDefLocale(pLocale); } - wsResult.Empty(); + wsResult.clear(); FX_BOOL bRet = FALSE; CFX_FormatString* pFormat = nullptr; @@ -822,7 +822,7 @@ FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue, case FX_LOCALECATEGORY_Null: bRet = pFormat->ParseNull(wsValue, wsFormat); if (bRet) { - m_wsValue.Empty(); + m_wsValue.clear(); } break; case FX_LOCALECATEGORY_Zero: diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp index 87941af070..2979e3700a 100644 --- a/xfa/fxfa/parser/xfa_object_imp.cpp +++ b/xfa/fxfa/parser/xfa_object_imp.cpp @@ -4468,7 +4468,7 @@ CXFA_Node* CXFA_Node::GetModelNode() { } } FX_BOOL CXFA_Node::TryNamespace(CFX_WideString& wsNamespace) { - wsNamespace.Empty(); + wsNamespace.clear(); if (GetObjectType() == XFA_OBJECTTYPE_ModelNode || GetClassID() == XFA_ELEMENT_Packet) { CFDE_XMLNode* pXMLNode = GetXMLMappingNode(); diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp index 4bb47ddc5d..002197c55d 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.cpp +++ b/xfa/fxfa/parser/xfa_parser_imp.cpp @@ -217,7 +217,7 @@ FX_BOOL XFA_FDEExtension_ResolveNamespaceQualifier( return TRUE; } } - wsNamespaceURI.Empty(); + wsNamespaceURI.clear(); return bRet; } static inline void XFA_FDEExtension_GetElementTagNamespaceURI( @@ -227,7 +227,7 @@ static inline void XFA_FDEExtension_GetElementTagNamespaceURI( pElement->GetNamespacePrefix(wsNodeStr); if (!XFA_FDEExtension_ResolveNamespaceQualifier( pElement, wsNodeStr.AsStringC(), wsNamespaceURI)) { - wsNamespaceURI.Empty(); + wsNamespaceURI.clear(); } } static FX_BOOL XFA_FDEExtension_MatchNodeName( @@ -285,7 +285,7 @@ static FX_BOOL XFA_FDEExtension_ResolveAttribute( } if (!XFA_FDEExtension_ResolveNamespaceQualifier( pElement, wsNSPrefix.AsStringC(), wsNamespaceURI)) { - wsNamespaceURI.Empty(); + wsNamespaceURI.clear(); return FALSE; } return TRUE; @@ -1318,7 +1318,7 @@ void CXFA_SimpleParser::ParseInstruction(CXFA_Node* pXFANode, if (pXMLInstruction->GetData(0, wsData) && (pXFANode->GetDocument()->RecognizeXFAVersionNumber(wsData) != XFA_VERSION_UNKNOWN)) { - wsData.Empty(); + wsData.clear(); if (pXMLInstruction->GetData(1, wsData) && wsData == FX_WSTRC(L"v2.7-scripting:1")) { pXFANode->GetDocument()->SetFlag(XFA_DOCFLAG_Scripting, TRUE); @@ -1419,8 +1419,8 @@ CXFA_XMLParser::~CXFA_XMLParser() { m_pParser->Release(); } m_NodeStack.RemoveAll(); - m_ws1.Empty(); - m_ws2.Empty(); + m_ws1.clear(); + m_ws2.clear(); } int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) { if (m_syntaxParserResult == FDE_XmlSyntaxResult::Error) @@ -1485,7 +1485,7 @@ int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) { } else { m_pChild = NULL; } - m_ws1.Empty(); + m_ws1.clear(); break; case FDE_XmlSyntaxResult::TagName: m_pParser->GetTagName(m_ws1); @@ -1520,7 +1520,7 @@ int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) { static_cast<CFDE_XMLElement*>(m_pChild)->SetString(m_ws1, m_ws2); } } - m_ws1.Empty(); + m_ws1.clear(); break; case FDE_XmlSyntaxResult::Text: m_pParser->GetTextData(m_ws1); @@ -1546,7 +1546,7 @@ int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) { m_pParser->GetTargetData(m_ws1); static_cast<CFDE_XMLInstruction*>(m_pChild)->AppendData(m_ws1); } - m_ws1.Empty(); + m_ws1.clear(); break; default: break; diff --git a/xfa/fxfa/parser/xfa_script_nodehelper.cpp b/xfa/fxfa/parser/xfa_script_nodehelper.cpp index 1b79ad94be..bb722c6bb9 100644 --- a/xfa/fxfa/parser/xfa_script_nodehelper.cpp +++ b/xfa/fxfa/parser/xfa_script_nodehelper.cpp @@ -261,7 +261,7 @@ void CXFA_NodeHelper::XFA_GetNameExpression(CXFA_Node* refNode, CFX_WideString& wsName, FX_BOOL bIsAllPath, XFA_LOGIC_TYPE eLogicType) { - wsName.Empty(); + wsName.clear(); if (bIsAllPath) { XFA_GetNameExpression(refNode, wsName, FALSE, eLogicType); CFX_WideString wsParent; diff --git a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp index 09f513714c..38271da656 100644 --- a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp +++ b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp @@ -262,7 +262,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Normal( rndFind.m_CurNode = pVariablesNode; XFA_ResolveNodes_SetStylesForChild(dwStyles, rndFind); CFX_WideString wsSaveCondition = rndFind.m_wsCondition; - rndFind.m_wsCondition.Empty(); + rndFind.m_wsCondition.clear(); XFA_ResolveNodes_Normal(rndFind); rndFind.m_wsCondition = wsSaveCondition; if (rndFind.m_Nodes.GetSize() > 0) { @@ -300,7 +300,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Normal( } rndFind.m_CurNode = child; CFX_WideString wsSaveCondition = rndFind.m_wsCondition; - rndFind.m_wsCondition.Empty(); + rndFind.m_wsCondition.clear(); XFA_ResolveNodes_Normal(rndFind); rndFind.m_wsCondition = wsSaveCondition; if (rndFind.m_Nodes.GetSize() > 0) { @@ -444,7 +444,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_Normal( if (bInnerSearch) { rndFind.m_CurNode = child; CFX_WideString wsOriginCondition = rndFind.m_wsCondition; - rndFind.m_wsCondition.Empty(); + rndFind.m_wsCondition.clear(); uint32_t dwOriginStyle = rndFind.m_dwStyles; rndFind.m_dwStyles = dwOriginStyle | XFA_RESOLVENODE_ALL; XFA_ResolveNodes_Normal(rndFind); |