summaryrefslogtreecommitdiff
path: root/xfa/fgas/font/cfgas_gefont.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-10 19:29:25 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-10 19:29:25 +0000
commit7d865b611bf5b029723ec3143180d23c95c907e8 (patch)
treec9e01b101f39d11520385cdd0f005cd4b01a9794 /xfa/fgas/font/cfgas_gefont.cpp
parente5c3ebd923a21c6c82bd214ca27a5d7396b852c2 (diff)
downloadpdfium-7d865b611bf5b029723ec3143180d23c95c907e8.tar.xz
Remove CFX_Rect.
It is rarely used and FX_RECT is the more common integer rect type. Change-Id: I7c5b875321c2d587becedcd058bb3a57fd1f0b61 Reviewed-on: https://pdfium-review.googlesource.com/30053 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fgas/font/cfgas_gefont.cpp')
-rw-r--r--xfa/fgas/font/cfgas_gefont.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp
index 83b7ad68d7..6b2cb0f03b 100644
--- a/xfa/fgas/font/cfgas_gefont.cpp
+++ b/xfa/fgas/font/cfgas_gefont.cpp
@@ -185,7 +185,7 @@ bool CFGAS_GEFont::GetCharWidth(wchar_t wUnicode, int32_t& iWidth) {
return iWidth > 0;
}
-bool CFGAS_GEFont::GetCharBBox(wchar_t wUnicode, CFX_Rect* bbox) {
+bool CFGAS_GEFont::GetCharBBox(wchar_t wUnicode, FX_RECT* bbox) {
auto it = m_BBoxMap.find(wUnicode);
if (it != m_BBoxMap.end()) {
*bbox = it->second;
@@ -205,21 +205,18 @@ bool CFGAS_GEFont::GetCharBBox(wchar_t wUnicode, CFX_Rect* bbox) {
if (!m_pFont->GetGlyphBBox(iGlyph, rtBBox))
return false;
- CFX_Rect rt(rtBBox.left, rtBBox.top, rtBBox.Width(), rtBBox.Height());
- m_BBoxMap[wUnicode] = rt;
- *bbox = rt;
+ m_BBoxMap[wUnicode] = rtBBox;
+ *bbox = rtBBox;
return true;
}
-bool CFGAS_GEFont::GetBBox(CFX_Rect* bbox) {
- FX_RECT rt(0, 0, 0, 0);
+bool CFGAS_GEFont::GetBBox(FX_RECT* bbox) {
+ // TODO(thestig): Pass directly into GetBBox().
+ FX_RECT rt;
if (!m_pFont->GetBBox(rt))
return false;
- bbox->left = rt.left;
- bbox->width = rt.Width();
- bbox->top = rt.bottom;
- bbox->height = -rt.Height();
+ *bbox = rt;
return true;
}