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

Unified Diff: core/src/fpdfdoc/doc_tagged.cpp

Issue 1417823005: Add type cast definitions for CPDF_Name. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 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 | « core/src/fpdfdoc/doc_link.cpp ('k') | fpdfsdk/src/formfiller/FFL_Utils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_tagged.cpp
diff --git a/core/src/fpdfdoc/doc_tagged.cpp b/core/src/fpdfdoc/doc_tagged.cpp
index d9d439f7304f21b5694629e329c5b2b951684758..ac29d901186b4eb3468407479be81fe7addfd1ec 100644
--- a/core/src/fpdfdoc/doc_tagged.cpp
+++ b/core/src/fpdfdoc/doc_tagged.cpp
@@ -417,11 +417,11 @@ CFX_ByteString CPDF_StructElementImpl::GetName(
FX_BOOL bInheritable,
int subindex) {
CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
- if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NAME) {
- return default_value;
- }
- return pAttr->GetString();
+ if (ToName(pAttr))
+ return pAttr->GetString();
+ return default_value;
}
+
FX_ARGB CPDF_StructElementImpl::GetColor(const CFX_ByteStringC& owner,
const CFX_ByteStringC& name,
FX_ARGB default_value,
« no previous file with comments | « core/src/fpdfdoc/doc_link.cpp ('k') | fpdfsdk/src/formfiller/FFL_Utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698