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

Unified Diff: fpdfsdk/cpdfsdk_baannot.cpp

Issue 2345063002: Use string pools in some dictionaries (Closed)
Patch Set: more Created 4 years, 3 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
Index: fpdfsdk/cpdfsdk_baannot.cpp
diff --git a/fpdfsdk/cpdfsdk_baannot.cpp b/fpdfsdk/cpdfsdk_baannot.cpp
index e023ae79f1417a76e9d1f436545b46056f007edb..98b41531481ebaaaf5fe485d2aa607c6c3715caa 100644
--- a/fpdfsdk/cpdfsdk_baannot.cpp
+++ b/fpdfsdk/cpdfsdk_baannot.cpp
@@ -162,28 +162,25 @@ int CPDFSDK_BAAnnot::GetStructParent() const {
// border
void CPDFSDK_BAAnnot::SetBorderWidth(int nWidth) {
CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArrayFor("Border");
-
if (pBorder) {
pBorder->SetAt(2, new CPDF_Number(nWidth));
} else {
CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDictFor("BS");
-
if (!pBSDict) {
pBSDict = new CPDF_Dictionary;
m_pAnnot->GetAnnotDict()->SetFor("BS", pBSDict);
}
-
pBSDict->SetIntegerFor("W", nWidth);
}
}
int CPDFSDK_BAAnnot::GetBorderWidth() const {
- if (CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArrayFor("Border")) {
+ if (CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArrayFor("Border"))
return pBorder->GetIntegerAt(2);
- }
- if (CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDictFor("BS")) {
+
+ if (CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDictFor("BS"))
return pBSDict->GetIntegerFor("W", 1);
- }
+
return 1;
}

Powered by Google App Engine
This is Rietveld 408576698