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

Unified Diff: core/fpdfdoc/cpdf_annot.cpp

Issue 2278153005: CPDF_Annot::GetRect() should return CFX_FloatRect. (Closed)
Patch Set: Created 4 years, 4 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 | « no previous file | core/fpdfdoc/cpdf_annotlist.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_annot.cpp
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp
index 76d3f9c6d4855b08f2e109b307627b3b27a297aa..e70ee27a98413f702c20f8fa8f9be61ebe80dd38 100644
--- a/core/fpdfdoc/cpdf_annot.cpp
+++ b/core/fpdfdoc/cpdf_annot.cpp
@@ -55,12 +55,13 @@ CFX_ByteString CPDF_Annot::GetSubType() const {
return m_sSubtype;
}
-void CPDF_Annot::GetRect(CFX_FloatRect& rect) const {
- if (!m_pAnnotDict) {
- return;
- }
- rect = m_pAnnotDict->GetRectBy("Rect");
+CFX_FloatRect CPDF_Annot::GetRect() const {
+ if (!m_pAnnotDict)
+ return CFX_FloatRect();
+
+ CFX_FloatRect rect = m_pAnnotDict->GetRectBy("Rect");
rect.Normalize();
+ return rect;
}
uint32_t CPDF_Annot::GetFlags() const {
@@ -133,9 +134,7 @@ static CPDF_Form* FPDFDOC_Annot_GetMatrix(const CPDF_Page* pPage,
CFX_FloatRect form_bbox = pForm->m_pFormDict->GetRectBy("BBox");
CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrixBy("Matrix");
form_matrix.TransformRect(form_bbox);
- CFX_FloatRect arect;
- pAnnot->GetRect(arect);
- matrix.MatchRect(arect, form_bbox);
+ matrix.MatchRect(pAnnot->GetRect(), form_bbox);
matrix.Concat(*pUser2Device);
return pForm;
}
@@ -272,8 +271,7 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice,
graph_state.m_DashArray[0] = graph_state.m_DashArray[1] = 3 * 1.0f;
}
}
- CFX_FloatRect rect;
- GetRect(rect);
+ CFX_FloatRect rect = GetRect();
CFX_PathData path;
width /= 2;
path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width,
« no previous file with comments | « no previous file | core/fpdfdoc/cpdf_annotlist.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698