void CPDF_FileSpec::SetFileName(const CFX_WideStringC& wsFileName) { if (!m_pObj) return; CFX_WideString wsStr = EncodeFileName(wsFileName); if (m_pObj->IsString()) { m_pObj->SetString(CFX_ByteString::FromUnicode(wsStr)); } else if (CPDF_Dictionary* pDict = m_pObj->AsDictionary()) { pDict->SetAtString("F", CFX_ByteString::FromUnicode(wsStr)); pDict->SetAtString("UF", PDF_EncodeText(wsStr)); } }
void CPDF_FileSpec::SetFileName(const WideString& wsFileName) { if (!m_pWritableObj) { NOTREACHED(); return; } WideString wsStr = EncodeFileName(wsFileName); if (m_pObj->IsString()) { m_pWritableObj->SetString(wsStr.ToDefANSI()); } else if (CPDF_Dictionary* pDict = m_pWritableObj->AsDictionary()) { pDict->SetNewFor<CPDF_String>(pdfium::stream::kF, wsStr.ToDefANSI(), false); pDict->SetNewFor<CPDF_String>("UF", PDF_EncodeText(wsStr), false); } }