From 44fc192f29a77c5864fabffe5ab63937dacdfd21 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 6 Feb 2015 16:51:37 -0800 Subject: Cleanup: Fix some unused-function warnings. BUG=pdfium:29 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/891113002 --- core/src/fpdfapi/fpdf_basic_module.cpp | 17 ------------ .../fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 1 - core/src/fpdfdoc/doc_basic.cpp | 32 +++++++++++----------- core/src/fxge/ge/fx_ge_fontmap.cpp | 13 --------- fpdfsdk/src/fxedit/fxet_pageobjs.cpp | 22 --------------- 5 files changed, 16 insertions(+), 69 deletions(-) diff --git a/core/src/fpdfapi/fpdf_basic_module.cpp b/core/src/fpdfapi/fpdf_basic_module.cpp index edccda5743..82658ab51e 100644 --- a/core/src/fpdfapi/fpdf_basic_module.cpp +++ b/core/src/fpdfapi/fpdf_basic_module.cpp @@ -61,23 +61,6 @@ FX_BOOL CPDF_ModuleMgr::DownloadModule(FX_LPCSTR module_name) } return m_pDownloadCallback(module_name); } -static CFX_ByteString _GetPath(const CFX_ByteString& folder, FX_LPCSTR name) -{ - FX_STRSIZE folder_len = folder.GetLength(); -#if _FX_OS_ == _FX_SYMBIAN_ || _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - if (folder[folder_len - 1] == '\\') { - return folder + name; - } else { - return (folder + "\\") + name; - } -#else - if (folder[folder_len - 1] == '/') { - return folder + name; - } else { - return (folder + "/") + name; - } -#endif -} void CPDF_ModuleMgr::NotifyModuleAvailable(FX_LPCSTR module_name) { if (FXSYS_strcmp(module_name, ADDIN_NAME_CJK) == 0) { diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index 45d0078e8a..4583bc1b25 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -329,7 +329,6 @@ int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* p if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) { return 0; } - const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder(); int ret = CreateDecoder(); if (ret != 1) { if (!ret) { diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp index 459ae87a0a..496ed86122 100644 --- a/core/src/fpdfdoc/doc_basic.cpp +++ b/core/src/fpdfdoc/doc_basic.cpp @@ -250,6 +250,7 @@ CPDF_Array* CPDF_NameTree::LookupNamedDest(CPDF_Document* pDoc, FX_BSTR sName) } return NULL; } +#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ static CFX_WideString ChangeSlashToPlatform(FX_LPCWSTR str) { CFX_WideString result; @@ -257,10 +258,8 @@ static CFX_WideString ChangeSlashToPlatform(FX_LPCWSTR str) if (*str == '/') { #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ result += ':'; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - result += '\\'; #else - result += *str; + result += '\\'; #endif } else { result += *str; @@ -269,6 +268,20 @@ static CFX_WideString ChangeSlashToPlatform(FX_LPCWSTR str) } return result; } +static CFX_WideString ChangeSlashToPDF(FX_LPCWSTR str) +{ + CFX_WideString result; + while (*str) { + if (*str == '\\' || *str == ':') { + result += '/'; + } else { + result += *str; + } + str++; + } + return result; +} +#endif static CFX_WideString FILESPEC_DecodeFileName(FX_WSTR filepath) { if (filepath.GetLength() <= 1) { @@ -349,19 +362,6 @@ FX_BOOL CPDF_FileSpec::IsURL() const } return ((CPDF_Dictionary*)m_pObj)->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL"); } -static CFX_WideString ChangeSlashToPDF(FX_LPCWSTR str) -{ - CFX_WideString result; - while (*str) { - if (*str == '\\' || *str == ':') { - result += '/'; - } else { - result += *str; - } - str++; - } - return result; -} CFX_WideString FILESPEC_EncodeFileName(FX_WSTR filepath) { if (filepath.GetLength() <= 1) { diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index 22c399150d..079c485b01 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -748,19 +748,6 @@ FX_DWORD _GetCodePageRangeFromCharset(int charset) } return 1 << 21; } -static int CP2CharSet(int cp) -{ - if(cp == 932) { - return FXFONT_SHIFTJIS_CHARSET; - } else if(cp == 936) { - return FXFONT_GB2312_CHARSET; - } else if(cp == 949) { - return FXFONT_HANGEUL_CHARSET; - } else if(cp == 950) { - return FXFONT_CHINESEBIG5_CHARSET; - } - return FXFONT_DEFAULT_CHARSET; -} FXFT_Face CFX_FontMapper::UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseFont, int italic_angle, int weight, int picthfamily) { if (iBaseFont < 12) { diff --git a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp index e5cbf4efad..7b64b33ba1 100644 --- a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp +++ b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp @@ -397,28 +397,6 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device pDevice->RestoreState(); } -static void AddLineToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crStroke, - const CPDF_Point& pt1, const CPDF_Point& pt2) -{ - CPDF_PathObject* pPathObj = new CPDF_PathObject; - CPDF_PathData* pPathData = pPathObj->m_Path.GetModify(); - - pPathData->SetPointCount(2); - pPathData->SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO); - pPathData->SetPoint(1, pt2.x, pt2.y, FXPT_LINETO); - - FX_FLOAT rgb[3]; - rgb[0] = FXARGB_R(crStroke) / 255.0f; - rgb[1] = FXARGB_G(crStroke) / 255.0f; - rgb[2] = FXARGB_B(crStroke) / 255.0f; - pPathObj->m_ColorState.SetStrokeColor(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3); - - CFX_GraphStateData* pData = pPathObj->m_GraphState.GetModify(); - pData->m_LineWidth = 1; - - pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pPathObj); -} - static void AddRectToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crFill, const CPDF_Rect& rcFill) { CPDF_PathObject* pPathObj = new CPDF_PathObject; -- cgit v1.2.3