Chromium Code Reviews| Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp |
| diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp |
| index 82bfbb56ebb8017be889fed8600409f4ed7d08ec..123ae8ba76da2b91291c14fae630401c9cf63431 100644 |
| --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp |
| +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp |
| @@ -100,12 +100,10 @@ CFX_WideString CFDF_Document::GetWin32Path() const { |
| CPDF_Dictionary* pDict = |
| m_pRootDict ? m_pRootDict->GetDict(FX_BSTRC("FDF")) : NULL; |
| CPDF_Object* pFileSpec = pDict ? pDict->GetElementValue(FX_BSTRC("F")) : NULL; |
| - if (pFileSpec == NULL) { |
| + if (!pFileSpec) |
| return CFX_WideString(); |
| - } |
| - if (pFileSpec->GetType() == PDFOBJ_STRING) { |
| + if (pFileSpec->IsString()) |
| return FPDF_FileSpec_GetWin32Path(m_pRootDict->GetDict(FX_BSTRC("FDF"))); |
| - } |
| return FPDF_FileSpec_GetWin32Path(pFileSpec); |
| } |
| static CFX_WideString ChangeSlash(const FX_WCHAR* str) { |
| @@ -138,8 +136,10 @@ void FPDF_FileSpec_SetWin32Path(CPDF_Object* pFileSpec, |
| } else { |
| result = ChangeSlash(filepath.c_str()); |
| } |
| - if (pFileSpec->GetType() == PDFOBJ_STRING) { |
| + |
| + if (pFileSpec->IsString()) { |
| pFileSpec->SetString(CFX_ByteString::FromUnicode(result)); |
| + |
|
Lei Zhang
2015/10/21 16:55:56
no trailing blank line
dsinclair
2015/10/21 17:08:05
Done.
|
| } else if (CPDF_Dictionary* pFileDict = pFileSpec->AsDictionary()) { |
| pFileDict->SetAtString(FX_BSTRC("F"), CFX_ByteString::FromUnicode(result)); |
| pFileDict->SetAtString(FX_BSTRC("UF"), PDF_EncodeText(result)); |