summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-06-08 14:17:24 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-08 14:17:24 -0700
commit6aac8a822ef227b80173f23ea3169b28a6712bba (patch)
treecbc58444ac269f977e935740aee2dafab9c9c6ee /core
parentc1835615f386d8e6e30df89b6517ebf605335a0e (diff)
downloadpdfium-6aac8a822ef227b80173f23ea3169b28a6712bba.tar.xz
Remove even more const casting from core.
Make the return types/arguments match reality. Review-Url: https://codereview.chromium.org/2053483002
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/fpdf_font/include/cpdf_font.h2
-rw-r--r--core/fpdfdoc/doc_form.cpp7
-rw-r--r--core/fpdfdoc/doc_utils.cpp4
-rw-r--r--core/fpdfdoc/include/fpdf_doc.h2
-rw-r--r--core/fxge/include/fx_font.h5
5 files changed, 9 insertions, 11 deletions
diff --git a/core/fpdfapi/fpdf_font/include/cpdf_font.h b/core/fpdfapi/fpdf_font/include/cpdf_font.h
index 31badd2656..548283ee79 100644
--- a/core/fpdfapi/fpdf_font/include/cpdf_font.h
+++ b/core/fpdfapi/fpdf_font/include/cpdf_font.h
@@ -71,7 +71,7 @@ class CPDF_Font {
virtual uint32_t CharCodeFromUnicode(FX_WCHAR Unicode) const;
const CFX_ByteString& GetBaseFont() const { return m_BaseFont; }
- const CFX_SubstFont* GetSubstFont() const { return m_Font.GetSubstFont(); }
+ CFX_SubstFont* GetSubstFont() const { return m_Font.GetSubstFont(); }
uint32_t GetFlags() const { return m_Flags; }
FX_BOOL IsEmbedded() const { return IsType3Font() || m_pFontFile != nullptr; }
CPDF_StreamAcc* GetFontFile() const { return m_pFontFile; }
diff --git a/core/fpdfdoc/doc_form.cpp b/core/fpdfdoc/doc_form.cpp
index 25a9f0b72d..b2c5d8cdf7 100644
--- a/core/fpdfdoc/doc_form.cpp
+++ b/core/fpdfdoc/doc_form.cpp
@@ -989,16 +989,15 @@ CPDF_FormField* CPDF_InterForm::AddTerminalField(CPDF_Dictionary* pFieldDict) {
}
return pField;
}
-CPDF_FormControl* CPDF_InterForm::AddControl(const CPDF_FormField* pField,
+CPDF_FormControl* CPDF_InterForm::AddControl(CPDF_FormField* pField,
CPDF_Dictionary* pWidgetDict) {
const auto it = m_ControlMap.find(pWidgetDict);
if (it != m_ControlMap.end())
return it->second;
- CPDF_FormControl* pControl =
- new CPDF_FormControl((CPDF_FormField*)pField, pWidgetDict);
+ CPDF_FormControl* pControl = new CPDF_FormControl(pField, pWidgetDict);
m_ControlMap[pWidgetDict] = pControl;
- ((CPDF_FormField*)pField)->m_ControlList.Add(pControl);
+ pField->m_ControlList.Add(pControl);
return pControl;
}
diff --git a/core/fpdfdoc/doc_utils.cpp b/core/fpdfdoc/doc_utils.cpp
index 05197380a6..ccef7feb57 100644
--- a/core/fpdfdoc/doc_utils.cpp
+++ b/core/fpdfdoc/doc_utils.cpp
@@ -467,7 +467,7 @@ CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict,
if (!pFind) {
continue;
}
- CFX_SubstFont* pSubst = (CFX_SubstFont*)pFind->GetSubstFont();
+ CFX_SubstFont* pSubst = pFind->GetSubstFont();
if (!pSubst) {
continue;
}
@@ -486,7 +486,7 @@ CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict,
CFX_SubstFont* pSubst;
CPDF_Font* pFont = GetDefaultInterFormFont(pFormDict, pDocument);
if (pFont) {
- pSubst = (CFX_SubstFont*)pFont->GetSubstFont();
+ pSubst = pFont->GetSubstFont();
if (pSubst && pSubst->m_Charset == (int)charSet) {
FindInterFormFont(pFormDict, pFont, csNameTag);
return pFont;
diff --git a/core/fpdfdoc/include/fpdf_doc.h b/core/fpdfdoc/include/fpdf_doc.h
index 0f65ee02b6..2722003743 100644
--- a/core/fpdfdoc/include/fpdf_doc.h
+++ b/core/fpdfdoc/include/fpdf_doc.h
@@ -533,7 +533,7 @@ class CPDF_InterForm {
void LoadField(CPDF_Dictionary* pFieldDict, int nLevel = 0);
CPDF_Object* GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* name);
CPDF_FormField* AddTerminalField(CPDF_Dictionary* pFieldDict);
- CPDF_FormControl* AddControl(const CPDF_FormField* pField,
+ CPDF_FormControl* AddControl(CPDF_FormField* pField,
CPDF_Dictionary* pWidgetDict);
void FDF_ImportField(CPDF_Dictionary* pField,
const CFX_WideString& parent_name,
diff --git a/core/fxge/include/fx_font.h b/core/fxge/include/fx_font.h
index 13143d518b..b38ecaed33 100644
--- a/core/fxge/include/fx_font.h
+++ b/core/fxge/include/fx_font.h
@@ -77,8 +77,10 @@ class CFX_Font {
int italic_angle,
int CharsetCP,
FX_BOOL bVertical = FALSE);
+
FX_BOOL LoadEmbedded(const uint8_t* data, uint32_t size);
FXFT_Face GetFace() const { return m_Face; }
+ CFX_SubstFont* GetSubstFont() const { return m_pSubstFont; }
#ifdef PDF_ENABLE_XFA
FX_BOOL LoadFile(IFX_FileRead* pFile,
@@ -86,11 +88,8 @@ class CFX_Font {
int* pFaceCount = nullptr);
FX_BOOL LoadClone(const CFX_Font* pFont);
- CFX_SubstFont* GetSubstFont() const { return m_pSubstFont; }
void SetFace(FXFT_Face face) { m_Face = face; }
void SetSubstFont(CFX_SubstFont* subst) { m_pSubstFont = subst; }
-#else // PDF_ENABLE_XFA
- const CFX_SubstFont* GetSubstFont() const { return m_pSubstFont; }
#endif // PDF_ENABLE_XFA
CFX_PathData* LoadGlyphPath(uint32_t glyph_index, int dest_width = 0);