From c77e8f73397613f278eaeef2cae44debc6a684c8 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 29 Jul 2014 08:55:54 -0700 Subject: Remove a few unused variables, functions, and tables. Found by clang's -Wunused-variable, -Wunused-function, -Wunused-const-variable. BUG=none R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/404653005 --- core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp | 1 - .../src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp | 15 ----- core/src/fpdfdoc/doc_ap.cpp | 1 - core/src/fpdftext/fpdf_text.cpp | 4 -- core/src/fpdftext/fpdf_text_int.cpp | 12 ---- core/src/fxcrt/fx_basic_bstring.cpp | 2 +- core/src/fxcrt/fx_xml_parser.cpp | 3 - core/src/fxge/apple/fx_quartz_device.cpp | 1 - core/src/fxge/dib/fx_dib_composite.cpp | 1 - core/src/fxge/dib/fx_dib_engine.cpp | 16 +++--- core/src/fxge/dib/fx_dib_main.cpp | 1 - core/src/fxge/dib/fx_dib_transform.cpp | 1 - core/src/fxge/ge/fx_ge_font.cpp | 1 - core/src/fxge/ge/fx_ge_fontmap.cpp | 4 +- core/src/fxge/ge/fx_ge_path.cpp | 1 - core/src/fxge/ge/fx_ge_text.cpp | 64 ---------------------- fpdfsdk/src/fxedit/fxet_pageobjs.cpp | 24 -------- 17 files changed, 9 insertions(+), 143 deletions(-) diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp index bd1187645c..2cee90c24a 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp @@ -184,7 +184,6 @@ static FX_BOOL _CMap_GetCodeRange(_CMap_CodeRange& range, FX_BSTR first, FX_BSTR if (first.GetLength() == 0 || first.GetAt(0) != '<') { return FALSE; } - int num = 0; int i; for (i = 1; i < first.GetLength(); i ++) if (first.GetAt(i) == '>') { diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index caf40544dc..26877ec418 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -636,7 +636,6 @@ FX_BOOL CPDF_Parser::RebuildCrossRef() } for (FX_DWORD i = 0; i < size; i ++) { FX_BYTE byte = buffer[i]; - FX_LPBYTE pData = buffer + i; switch (status) { case 0: if (_PDF_CharType[byte] == 'W') { @@ -1381,7 +1380,6 @@ CPDF_Object* CPDF_Parser::ParseIndirectObjectAt(CPDF_IndirectObjects* pObjList, if (bsWord == FX_BSTRC("endobj")) { endOffset = m_Syntax.SavePos(); } - FX_DWORD objSize = endOffset - objOffset; m_Syntax.RestorePos(SavedPos); if (pObj && !objnum) { pObj->m_ObjNum = real_objnum; @@ -1623,7 +1621,6 @@ FX_DWORD CPDF_Parser::LoadLinearizedMainXRefTable() m_pTrailer = NULL; } m_Syntax.RestorePos(m_LastXRefOffset - m_Syntax.m_HeaderOffset); - FX_FILESIZE dwSavedPos = m_Syntax.SavePos(); FX_BYTE ch = 0; FX_DWORD dwCount = 0; m_Syntax.GetNextChar(ch); @@ -2047,7 +2044,6 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWO } return NULL; } - FX_FILESIZE wordOffset = m_Pos - word.GetLength(); if (bIsNumber) { FX_FILESIZE SavedPos = m_Pos; CFX_ByteString nextword = GetNextWord(bIsNumber); @@ -2095,7 +2091,6 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWO if (bTypeOnly) { return (CPDF_Object*)PDFOBJ_STRING; } - FX_FILESIZE SavedPos = m_Pos - 1; CFX_ByteString str = ReadString(); if (m_pCryptoHandler && bDecrypt) { m_pCryptoHandler->Decrypt(objnum, gennum, str); @@ -2107,7 +2102,6 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWO if (bTypeOnly) { return (CPDF_Object*)PDFOBJ_STRING; } - FX_FILESIZE SavedPos = m_Pos - 1; CFX_ByteString str = ReadHexString(); if (m_pCryptoHandler && bDecrypt) { m_pCryptoHandler->Decrypt(objnum, gennum, str); @@ -2120,9 +2114,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWO return (CPDF_Object*)PDFOBJ_ARRAY; } CPDF_Array* pArray = CPDF_Array::Create(); - FX_FILESIZE firstPos = m_Pos - 1; while (1) { - FX_FILESIZE SavedPos = m_Pos; CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, level + 1); if (pObj == NULL) { return pArray; @@ -2432,7 +2424,6 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict, PARSE_CONTEXT CPDF_CryptoHandler* pCryptoHandler = objnum == (FX_DWORD)m_MetadataObjnum ? NULL : m_pCryptoHandler; if (pCryptoHandler == NULL) { - FX_FILESIZE SavedPos = m_Pos; GetNextWord(); if (m_WordSize < 9 || FXSYS_memcmp32(m_WordBuffer, "endstream", 9)) { m_Pos = StreamStartPos; @@ -3357,7 +3348,6 @@ FX_BOOL CPDF_DataAvail::CheckPages(IFX_DownloadHints* pHints) } return FALSE; } - FX_BOOL bNeedLoad = FALSE; if (!GetPageKids(m_pCurrentParser, pPages)) { pPages->Release(); m_docStatus = PDF_DATAAVAIL_ERROR; @@ -3391,7 +3381,6 @@ FX_BOOL CPDF_DataAvail::CheckHeader(IFX_DownloadHints* pHints) } FX_BOOL CPDF_DataAvail::CheckFirstPage(IFX_DownloadHints *pHints) { - FX_DWORD dwFirstPageEndOffset = 0; CPDF_Dictionary* pDict = m_pLinearized->GetDict(); CPDF_Object *pEndOffSet = pDict ? pDict->GetElement(FX_BSTRC("E")) : NULL; if (!pEndOffSet) { @@ -3508,7 +3497,6 @@ FX_BOOL CPDF_DataAvail::IsLinearizedFile(FX_LPBYTE pData, FX_DWORD dwLen) m_syntaxParser.InitParser((IFX_FileStream*)file, offset); m_syntaxParser.RestorePos(m_syntaxParser.m_HeaderOffset + 9); FX_BOOL bNumber = FALSE; - FX_FILESIZE dwSavePos = m_syntaxParser.SavePos(); CFX_ByteString wordObjNum = m_syntaxParser.GetNextWord(bNumber); if (!bNumber) { return FALSE; @@ -3586,7 +3574,6 @@ FX_DWORD CPDF_DataAvail::CheckCrossRefStream(IFX_DownloadHints* pHints, FX_FILES CFX_SmartPointer file(FX_CreateMemoryStream(pBuf, (size_t)iSize, FALSE)); m_parser.m_Syntax.InitParser((IFX_FileStream*)file, 0); FX_BOOL bNumber = FALSE; - FX_FILESIZE dwSavePos = m_parser.m_Syntax.SavePos(); CFX_ByteString objnum = m_parser.m_Syntax.GetNextWord(bNumber); if (!bNumber) { return -1; @@ -3768,7 +3755,6 @@ FX_BOOL CPDF_DataAvail::CheckAllCrossRefStream(IFX_DownloadHints *pHints) } FX_BOOL CPDF_DataAvail::CheckCrossRef(IFX_DownloadHints* pHints) { - FX_FILESIZE dwSavePos = m_Pos; FX_INT32 iSize = 0; CFX_ByteString token; if (!GetNextToken(token)) { @@ -4403,7 +4389,6 @@ FX_BOOL CPDF_SortObjNumArray::BinarySearch(FX_DWORD value, FX_INT32 &iNext) FX_INT32 iMid = 0; while (iLow <= iHigh) { iMid = (iLow + iHigh) / 2; - FX_DWORD tt = m_number_array.GetAt(iMid); if (m_number_array.GetAt(iMid) == value) { iNext = iMid; return TRUE; diff --git a/core/src/fpdfdoc/doc_ap.cpp b/core/src/fpdfdoc/doc_ap.cpp index 0e2a75ad2c..ccc800aa1a 100644 --- a/core/src/fpdfdoc/doc_ap.cpp +++ b/core/src/fpdfdoc/doc_ap.cpp @@ -309,7 +309,6 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict if (!pDefFont) { return FALSE; } - CFX_CharMap* pCharMap = pDefFont->GetCharMap(); CPDF_Rect rcAnnot = pAnnotDict->GetRect("Rect"); FX_INT32 nRotate = 0; if (CPDF_Dictionary * pMKDict = pAnnotDict->GetDict("MK")) { diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp index 048ebde2be..defad925b9 100644 --- a/core/src/fpdftext/fpdf_text.cpp +++ b/core/src/fpdftext/fpdf_text.cpp @@ -128,8 +128,6 @@ void CTextPage::ProcessObject(CPDF_PageObject* pObject) segment_left = char_left; segment = ""; } - CFX_WideString wCh = pText->GetFont()->UnicodeFromCharCode(charcode); - FX_DWORD ch = wCh.GetLength() > 0 ? wCh.GetAt(0) : charcode; if (space_count > 1) { pBaseLine = InsertTextBox(pBaseLine, baseline, leftx + segment_left, leftx + segment_right, topy, bottomy, spacew, fontsize_v, segment, pFont); @@ -381,7 +379,6 @@ void NormalizeString(CFX_WideString& str) i = j; j = n; for(; n <= i; n += 3) { - int ret = order.GetAt(n); int start = order.GetAt(n - 2); int count1 = order.GetAt(n - 1); int end = start + count1 ; @@ -561,7 +558,6 @@ FX_BOOL CTextBaseLine::CanMerge(CTextBaseLine* pOther) FX_FLOAT dy = (FX_FLOAT)FXSYS_fabs(m_BaseLine - pOther->m_BaseLine); for (int i = 0; i < m_TextList.GetSize(); i ++) { CTextBox* pText = (CTextBox*)m_TextList.GetAt(i); - FX_FLOAT width = pText->m_Right - pText->m_Left; for (int j = 0; j < pOther->m_TextList.GetSize(); j ++) { CTextBox* pOtherText = (CTextBox*)pOther->m_TextList.GetAt(j); FX_FLOAT inter_left, inter_right; diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp index 8736575952..ddf4762058 100644 --- a/core/src/fpdftext/fpdf_text_int.cpp +++ b/core/src/fpdftext/fpdf_text_int.cpp @@ -318,7 +318,6 @@ int CPDF_TextPage::GetIndexAtPos(CPDF_Point point , FX_FLOAT xTorelance, FX_FLOA if (!m_IsParsered) { return -3; } - FX_FLOAT distance = 0; int pos = 0; int NearPos = -1; double xdif = 5000, ydif = 5000; @@ -409,9 +408,6 @@ void CPDF_TextPage::GetRectsArrayByRect(CFX_FloatRect rect, CFX_RectArray& resRe if (info_curchar.m_Flag == FPDFTEXT_CHAR_GENERATED) { continue; } - if(pos == 494) { - int a = 0; - } if (IsRectIntersect(rect, info_curchar.m_CharBox)) { if(!pCurObj) { pCurObj = info_curchar.m_pTextObj; @@ -816,9 +812,6 @@ int CPDF_TextPage::CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT ri FX_BOOL segmentStatus = 0; FX_BOOL IsContainPreChar = FALSE; while (pos < nCount) { - if(pos == 493) { - int a = 0; - } PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(pos); if(bContains && rect.Contains(charinfo.m_CharBox)) { if (segmentStatus == 0 || segmentStatus == 2) { @@ -1293,7 +1286,6 @@ void CPDF_TextPage::CloseTempLine() i = j; j = n; for(; n <= i; n += 3) { - int ret = order.GetAt(n); int start = order.GetAt(n - 2); int count1 = order.GetAt(n - 1); int end = start + count1 ; @@ -2183,7 +2175,6 @@ CPDF_TextPageFind::CPDF_TextPageFind(const IPDF_TextPage* pTextPage) if (!pTextPage) { return; } - CPDF_ModuleMgr* pPDFModule = CPDF_ModuleMgr::Get(); m_pTextPage = pTextPage; m_strText = m_pTextPage->GetPageText(); int nCount = pTextPage->CountChars(); @@ -2500,9 +2491,6 @@ FX_BOOL CPDF_TextPageFind::IsMatchWholeWord(CFX_WideString csPageText, int start if(startPos + char_count < csPageText.GetLength()) { char_right = csPageText.GetAt(startPos + char_count); } - if(char_left == 0x61) { - int a = 0; - } if ((char_left > 'A' && char_left < 'a') || (char_left > 'a' && char_left < 'z') || (char_left > 0xfb00 && char_left < 0xfb06) || (char_left >= '0' && char_left <= '9') || (char_right > 'A' && char_right < 'a') || (char_right > 'a' && char_right < 'z') || (char_right > 0xfb00 && char_right < 0xfb06) || (char_right >= '0' && char_right <= '9')) { return FALSE; diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp index f14ff2ba5d..60153fa45a 100644 --- a/core/src/fxcrt/fx_basic_bstring.cpp +++ b/core/src/fxcrt/fx_basic_bstring.cpp @@ -947,7 +947,7 @@ CFX_ByteString CFX_ByteString::LoadFromFile(FX_BSTR filename) FXSYS_fseek(file, 0, FXSYS_SEEK_SET); CFX_ByteString str; FX_LPSTR buf = str.GetBuffer(len); - size_t readCnt = FXSYS_fread(buf, 1, len, file); + FXSYS_fread(buf, 1, len, file); str.ReleaseBuffer(len); FXSYS_fclose(file); return str; diff --git a/core/src/fxcrt/fx_xml_parser.cpp b/core/src/fxcrt/fx_xml_parser.cpp index d41880a6c4..05fc7d5fbe 100644 --- a/core/src/fxcrt/fx_xml_parser.cpp +++ b/core/src/fxcrt/fx_xml_parser.cpp @@ -863,9 +863,6 @@ void CXML_AttrMap::RemoveAll() if (!m_pMap) { return; } - for (int i = 0; i < m_pMap->GetSize(); i ++) { - CXML_AttrItem& item = (*m_pMap)[i]; - } m_pMap->RemoveAll(); delete m_pMap; m_pMap = NULL; diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp index 7cb94f1093..050d8744bd 100644 --- a/core/src/fxge/apple/fx_quartz_device.cpp +++ b/core/src/fxge/apple/fx_quartz_device.cpp @@ -853,7 +853,6 @@ FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars a / 255.f); SaveState(); if (pGlyphMatrix) { - CGAffineTransform ctm = CGContextGetCTM(_context); CGPoint origin = CGPointMake( glyph_positions[0].x, glyph_positions[0].y); origin = CGPointApplyAffineTransform(origin, matrix_cg); CGContextTranslateCTM(_context, origin.x, origin.y); diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp index da555de9d5..375b7c110e 100644 --- a/core/src/fxge/dib/fx_dib_composite.cpp +++ b/core/src/fxge/dib/fx_dib_composite.cpp @@ -2951,7 +2951,6 @@ inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP } inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp) { - int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { if (src_Bpp == 4) { FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan)); diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp index 803d906ff9..b436f88bd6 100644 --- a/core/src/fxge/dib/fx_dib_engine.cpp +++ b/core/src/fxge/dib/fx_dib_engine.cpp @@ -421,7 +421,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) case 5: { for (int col = m_DestClip.left; col < m_DestClip.right; col ++) { PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col); - int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0; + int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) { int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; unsigned long argb_cmyk = m_pSrcPalette[src_scan[j]]; @@ -449,7 +449,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) case 6: { for (int col = m_DestClip.left; col < m_DestClip.right; col ++) { PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col); - int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0; + int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) { int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; pixel_weight = pixel_weight * src_scan_mask[j] / 255; @@ -466,7 +466,6 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) dest_a += pixel_weight; } if (m_Flags & FXDIB_BICUBIC_INTERPOL) { - dest_k = dest_k < 0 ? 0 : dest_k > 16711680 ? 16711680 : dest_k; dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c; dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m; dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y; @@ -482,7 +481,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) case 7: { for (int col = m_DestClip.left; col < m_DestClip.right; col ++) { PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col); - int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0; + int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) { int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; FX_LPCBYTE src_pixel = src_scan + j * Bpp; @@ -505,7 +504,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) case 8: { for (int col = m_DestClip.left; col < m_DestClip.right; col ++) { PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col); - int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0; + int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) { int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; FX_LPCBYTE src_pixel = src_scan + j * Bpp; @@ -601,7 +600,7 @@ void CStretchEngine::StretchVert() case 7: { for (int col = m_DestClip.left; col < m_DestClip.right; col ++) { unsigned char* src_scan = m_pInterBuf + (col - m_DestClip.left) * DestBpp; - int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0; + int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) { int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; FX_LPCBYTE src_pixel = src_scan + (j - m_SrcClip.top) * m_InterPitch; @@ -629,7 +628,7 @@ void CStretchEngine::StretchVert() if (m_DestFormat != FXDIB_Argb) { src_scan_mask = m_pExtraAlphaBuf + (col - m_DestClip.left); } - int dest_a = 0, dest_k = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; + int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0; for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) { int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; FX_LPCBYTE src_pixel = src_scan + (j - m_SrcClip.top) * m_InterPitch; @@ -835,7 +834,7 @@ FX_BOOL CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause) return FALSE; } int result_width = m_ClipRect.Width(), result_height = m_ClipRect.Height(); - int src_width = m_pSource->GetWidth(), src_height = m_pSource->GetHeight(); + int src_height = m_pSource->GetHeight(); for (; m_LineIndex < result_height; m_LineIndex ++) { int dest_y, src_y; if (m_bFlipY) { @@ -855,7 +854,6 @@ FX_BOOL CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause) return TRUE; } m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width); - FX_LPBYTE scan_extra_alpha = NULL; if (m_pMaskScanline) { m_pSource->m_pAlphaMask->DownSampleScanline(src_y, m_pMaskScanline, 1, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width); } diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp index 3e1e8cf91b..7e8cb0c3db 100644 --- a/core/src/fxge/dib/fx_dib_main.cpp +++ b/core/src/fxge/dib/fx_dib_main.cpp @@ -447,7 +447,6 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int h if (width == 0 || height == 0) { return TRUE; } - int src_pitch = pMask->GetPitch(); int src_bpp = pMask->GetBPP(); int alpha; FX_DWORD dst_color; diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp index 16d791b4ee..65afdd6b3a 100644 --- a/core/src/fxge/dib/fx_dib_transform.cpp +++ b/core/src/fxge/dib/fx_dib_transform.cpp @@ -538,7 +538,6 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) int Bpp = m_Storer.GetBitmap()->GetBPP() / 8; int destBpp = pTransformed->GetBPP() / 8; if (Bpp == 1) { - FX_BOOL bHasAlpha = m_Storer.GetBitmap()->HasAlpha(); FX_DWORD argb[256]; FX_ARGB* pPal = m_Storer.GetBitmap()->GetPalette(); if (pPal) { diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp index f3254ea3de..817f3712d9 100644 --- a/core/src/fxge/ge/fx_ge_font.cpp +++ b/core/src/fxge/ge/fx_ge_font.cpp @@ -40,7 +40,6 @@ CFX_Font::~CFX_Font() #endif if (m_Face) { #ifdef FOXIT_CHROME_BUILD - FXFT_Library library = FXFT_Get_Face_FreeType(m_Face); if (FXFT_Get_Face_External_Stream(m_Face)) { FXFT_Clear_Face_External_Stream(m_Face); } diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index 1b47f1ff14..f5d378d55b 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -975,8 +975,6 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru FX_BOOL bItalic = FALSE; FX_DWORD nStyle = 0; FX_BOOL bStyleAvail = FALSE; - FX_BOOL bFamilyStyleIsWhole = FALSE; - FX_BOOL bNextF = FALSE; if (iBaseFont < 12) { family = g_Base14FontNames[iBaseFont]; if ((iBaseFont % 4) == 1 || (iBaseFont % 4) == 2) { @@ -1535,7 +1533,7 @@ FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE } if (datasize && size >= datasize && pFile) { FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET); - size_t readCnt = FXSYS_fread(buffer, datasize, 1, pFile); + FXSYS_fread(buffer, datasize, 1, pFile); } if (pFile) { FXSYS_fclose(pFile); diff --git a/core/src/fxge/ge/fx_ge_path.cpp b/core/src/fxge/ge/fx_ge_path.cpp index cd3ff0efbe..b96a2f1163 100644 --- a/core/src/fxge/ge/fx_ge_path.cpp +++ b/core/src/fxge/ge/fx_ge_path.cpp @@ -405,7 +405,6 @@ void CFX_PathData::Transform(const CFX_AffineMatrix* pMatrix) pMatrix->Transform(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY); } } -const int g_Distant[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const { if (m_PointCount < 3) { diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp index 40acc5fe34..80af2ff197 100644 --- a/core/src/fxge/ge/fx_ge_text.cpp +++ b/core/src/fxge/ge/fx_ge_text.cpp @@ -78,28 +78,6 @@ static void _AdjustGlyphSpace(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars) next_origin_f = this_origin_f; } } -static const FX_BYTE g_GdipGamma_bgw[9] = {0, 0, 63, 120, 0, 168, 210, 239, 255}; -static const FX_BYTE g_GdipGamma_fgw[9] = {0, 0, 16, 45, 0, 87, 135, 192, 255}; -static const FX_BYTE g_GdipGammaAdjust_47[48] = { - 0, 30, 33, 34, 35, 36, 37, 38, 38, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 42, 43, - 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 45, 46, - 46, 46, 46, 46, 46, 46, 46, 47 -}; -static const FX_BYTE g_GdipGammaAdjust_75[76] = { - 0, 46, 50, 52, 54, 55, 56, 57, 58, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 64, 65, - 65, 65, 66, 66, 66, 67, 67, 67, 67, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 70, 70, 70, - 70, 70, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73, - 73, 74, 74, 74, 74, 74, 74, 74, 74, 75 -}; -static const FX_BYTE g_GdipGammaAdjust_81[82] = { - 0, 49, 53, 56, 58, 59, 60, 61, 62, 63, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 69, 70, 70, 70, - 71, 71, 71, 72, 72, 72, 72, 73, 73, 73, 73, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 76, 76, 76, 76, - 76, 76, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 80, - 80, 80, 80, 80, 80, 80, 80, 81 -}; -static void _Adjust_alpha(int background, int foreground, int& src_alpha, int text_flags, int a) -{ -} static const FX_BYTE g_TextGammaAdjust[256] = { 0, 2, 3, 4, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 38, @@ -1213,48 +1191,6 @@ CFX_SizeGlyphCache::~CFX_SizeGlyphCache() #else #define CONTRAST_RAMP_STEP 1 #endif -static const FX_BYTE g_adjust_contrast11[256] = { - 0, 0, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, 17, 18, 19, 21, 22, 24, 25, 26, 28, 29, 31, - 32, 33, 35, 36, 38, 39, 40, 42, 43, 45, 46, 48, 49, 51, 52, 54, 55, 56, 58, 59, 61, 62, 64, 65, - 67, 68, 70, 71, 72, 74, 75, 77, 78, 80, 81, 83, 84, 86, 87, 89, 90, 91, 93, 94, 96, 97, 99, 100, - 101, 103, 104, 106, 107, 109, 110, 111, 113, 114, 116, 117, 118, 120, 121, 123, 124, 125, 127, - 128, 130, 131, 132, 134, 135, 136, 138, 139, 140, 142, 143, 144, 146, 147, 148, 149, 151, 152, - 153, 155, 156, 157, 158, 160, 161, 162, 163, 165, 166, 167, 168, 169, 171, 172, 173, 174, 175, - 177, 178, 179, 180, 181, 182, 183, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 215, 216, 217, 218, 219, 220, 221, 221, 222, 223, 224, 224, 225, 226, 227, 227, 228, 229, 230, - 230, 231, 232, 232, 233, 234, 234, 235, 236, 236, 237, 237, 238, 239, 239, 240, 240, 241, 241, - 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 246, 247, 247, 248, 248, 248, 249, 249, 249, - 250, 250, 250, 251, 251, 251, 251, 252, 252, 252, 252, 253, 253, 253, 253, 253, 253, 254, 254, - 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 255, -}; -static const FX_BYTE g_adjust_contrast15[256] = { - 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 42, 43, 45, 46, 47, 48, 50, 51, - 52, 54, 55, 56, 58, 59, 60, 62, 63, 64, 66, 67, 68, 70, 71, 73, 74, 75, 77, 78, 80, 81, 82, 84, 85, 87, - 88, 90, 91, 93, 94, 95, 97, 98, 100, 101, 103, 104, 106, 107, 109, 110, 111, 113, 114, 116, 117, 119, - 120, 122, 123, 125, 126, 128, 129, 130, 132, 133, 135, 136, 138, 139, 141, 142, 143, 145, 146, 148, - 149, 150, 152, 153, 155, 156, 157, 159, 160, 161, 163, 164, 166, 167, 168, 170, 171, 172, 174, 175, - 176, 177, 179, 180, 181, 183, 184, 185, 186, 188, 189, 190, 191, 192, 194, 195, 196, 197, 198, 199, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 227, 228, 229, 230, 231, 232, 232, 233, 234, 235, 235, 236, 237, - 237, 238, 239, 239, 240, 241, 241, 242, 242, 243, 244, 244, 245, 245, 246, 246, 247, 247, 248, 248, - 248, 249, 249, 250, 250, 250, 251, 251, 251, 252, 252, 252, 252, 253, 253, 253, 253, 253, 254, 254, - 254, 254, 254, 254, 254, 254, 254, 254, 254, 255, -}; -static void _CalcContrastRamp(FX_LPBYTE ramp, int level) -{ - int contrast_min = 0, contrast_max = 255 - level, i; - for (i = 0; i < contrast_min; i ++) { - ramp[i] = 0; - } - for (i = contrast_min; i < contrast_max; i ++) { - ramp[i] = 255 * (i - contrast_min) / (contrast_max - contrast_min); - } - for (i = contrast_max; i < 256; i ++) { - ramp[i] = 255; - } -} void CFX_Font::AdjustMMParams(int glyph_index, int dest_width, int weight) { FXFT_MM_Var pMasters = NULL; diff --git a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp index 33d57edc4e..e5cbf4efad 100644 --- a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp +++ b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp @@ -469,30 +469,6 @@ static CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjects* pPageObjs, FX_ return pTxtObj; } -/* -List of currently supported standard fonts: -Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique -Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique -Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic -Symbol, ZapfDingbats -*/ - -const char* g_sFXEDITStandardFontName[] = {"Courier", "Courier-Bold", "Courier-BoldOblique", "Courier-Oblique", - "Helvetica", "Helvetica-Bold", "Helvetica-BoldOblique", "Helvetica-Oblique", - "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", - "Symbol", "ZapfDingbats"}; - -static FX_BOOL FX_EDIT_IsStandardFont(const CFX_ByteString& sFontName) -{ - for (FX_INT32 i=0; i<14; i++) - { - if (sFontName == g_sFXEDITStandardFontName[i]) - return TRUE; - } - - return FALSE; -} - void IFX_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF crText, CFX_ArrayTemplate& ObjArray) { -- cgit v1.2.3