diff options
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/fpdf_editimg.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/fpdf_editpage.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/fpdf_flatten.cpp | 6 |
3 files changed, 4 insertions, 8 deletions
diff --git a/fpdfsdk/fpdf_editimg.cpp b/fpdfsdk/fpdf_editimg.cpp index a062990afe..04d7af0f41 100644 --- a/fpdfsdk/fpdf_editimg.cpp +++ b/fpdfsdk/fpdf_editimg.cpp @@ -298,8 +298,8 @@ FPDFImageObj_GetImageMetadata(FPDF_PAGEOBJECT image_object, metadata->width = nPixelWidth; metadata->height = nPixelHeight; - const float nWidth = pObj->m_Right - pObj->m_Left; - const float nHeight = pObj->m_Top - pObj->m_Bottom; + const float nWidth = pObj->GetRect().Width(); + const float nHeight = pObj->GetRect().Height(); constexpr int nPointsPerInch = 72; if (nWidth != 0 && nHeight != 0) { metadata->horizontal_dpi = nPixelWidth / nWidth * nPointsPerInch; diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp index d9a9bef26a..193dd76091 100644 --- a/fpdfsdk/fpdf_editpage.cpp +++ b/fpdfsdk/fpdf_editpage.cpp @@ -729,7 +729,7 @@ FPDFPageObj_GetBounds(FPDF_PAGEOBJECT pageObject, return false; CPDF_PageObject* pPageObj = CPDFPageObjectFromFPDFPageObject(pageObject); - CFX_FloatRect bbox = pPageObj->GetRect(); + const CFX_FloatRect& bbox = pPageObj->GetRect(); *left = bbox.left; *bottom = bbox.bottom; *right = bbox.right; diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp index a27d79f09e..6f9adf136d 100644 --- a/fpdfsdk/fpdf_flatten.cpp +++ b/fpdfsdk/fpdf_flatten.cpp @@ -52,11 +52,7 @@ void GetContentsRect(CPDF_Document* pDoc, pPDFPage->ParseContent(); for (const auto& pPageObject : *pPDFPage->GetPageObjectList()) { - CFX_FloatRect rc; - rc.left = pPageObject->m_Left; - rc.right = pPageObject->m_Right; - rc.bottom = pPageObject->m_Bottom; - rc.top = pPageObject->m_Top; + const CFX_FloatRect& rc = pPageObject->GetRect(); if (IsValidRect(rc, pDict->GetRectFor(pdfium::page_object::kMediaBox))) pRectArray->push_back(rc); } |