Remove const form of CPDF_Type3Char::GetBitmap()
We already have a non-const ref in the caller (if we treat it as such).
-- remove duplicate call to GetBitmap().
Bug: pdfium:1843
Change-Id: I0eec735b054416ec16deffcda44e7d05e33e68ce
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/95452
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/font/cpdf_type3char.cpp b/core/fpdfapi/font/cpdf_type3char.cpp
index 27751f9..60eed8a 100644
--- a/core/fpdfapi/font/cpdf_type3char.cpp
+++ b/core/fpdfapi/font/cpdf_type3char.cpp
@@ -85,7 +85,3 @@
RetainPtr<CFX_DIBitmap> CPDF_Type3Char::GetBitmap() {
return m_pBitmap;
}
-
-const RetainPtr<CFX_DIBitmap>& CPDF_Type3Char::GetBitmap() const {
- return m_pBitmap;
-}
diff --git a/core/fpdfapi/font/cpdf_type3char.h b/core/fpdfapi/font/cpdf_type3char.h
index e757698..0d02c63 100644
--- a/core/fpdfapi/font/cpdf_type3char.h
+++ b/core/fpdfapi/font/cpdf_type3char.h
@@ -32,7 +32,6 @@
void WillBeDestroyed();
RetainPtr<CFX_DIBitmap> GetBitmap();
- const RetainPtr<CFX_DIBitmap>& GetBitmap() const;
bool colored() const { return m_bColored; }
int width() const { return m_Width; }
diff --git a/core/fpdfapi/render/cpdf_type3cache.cpp b/core/fpdfapi/render/cpdf_type3cache.cpp
index 45b35e1..78c149b 100644
--- a/core/fpdfapi/render/cpdf_type3cache.cpp
+++ b/core/fpdfapi/render/cpdf_type3cache.cpp
@@ -127,14 +127,17 @@
CPDF_Type3GlyphMap* pSize,
uint32_t charcode,
const CFX_Matrix& mtMatrix) {
- const CPDF_Type3Char* pChar = m_pFont->LoadChar(charcode);
- if (!pChar || !pChar->GetBitmap())
+ CPDF_Type3Char* pChar = m_pFont->LoadChar(charcode);
+ if (!pChar)
+ return nullptr;
+
+ RetainPtr<CFX_DIBitmap> pBitmap = pChar->GetBitmap();
+ if (!pBitmap)
return nullptr;
CFX_Matrix text_matrix(mtMatrix.a, mtMatrix.b, mtMatrix.c, mtMatrix.d, 0, 0);
CFX_Matrix image_matrix = pChar->matrix() * text_matrix;
- RetainPtr<CFX_DIBitmap> pBitmap = pChar->GetBitmap();
RetainPtr<CFX_DIBitmap> pResBitmap;
int left = 0;
int top = 0;