diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-02-29 11:24:29 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-02-29 11:24:29 -0800 |
commit | d5e7b355b8c4c22ff770547797cbc536bdc95d5b (patch) | |
tree | 4c0607b1701f23753a71b42c02b74764dd4bfd38 /core/src/fpdfapi/fpdf_page | |
parent | a74e9c9d3b0d98c5d6042d7ca739cd921a4524db (diff) | |
download | pdfium-d5e7b355b8c4c22ff770547797cbc536bdc95d5b.tar.xz |
Fixup FX_RECT and FX_SMALL_RECT classes.
Put these first, so later on more complicated classes can
have constructors that take these as arguments.
Add better constructors, and call appropriately. Also don't
be afraid to return these from methods since RVO.
R=dsinclair@chromium.org
Review URL: https://codereview.chromium.org/1745683002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page.cpp | 3 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp index f05c4bea92..301fca8969 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp @@ -251,8 +251,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX, } m_pCharPos[i - 1] = curpos; } - FX_RECT char_rect; - pFont->GetCharBBox(charcode, char_rect, level); + FX_RECT char_rect = pFont->GetCharBBox(charcode, level); FX_FLOAT charwidth; if (!bVertWriting) { if (min_y > char_rect.top) { diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp index 44492b1a54..a294d3bce7 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp @@ -123,10 +123,10 @@ CFX_FloatRect CPDF_ClipPath::GetClipBox() const { bLayerStarted = FALSE; } else { if (!bLayerStarted) { - layer_rect = pTextObj->GetBBox(NULL); + layer_rect = CFX_FloatRect(pTextObj->GetBBox(nullptr)); bLayerStarted = TRUE; } else { - layer_rect.Union(pTextObj->GetBBox(NULL)); + layer_rect.Union(CFX_FloatRect(pTextObj->GetBBox(nullptr))); } } } |