diff options
Diffstat (limited to 'core/src/fpdftext')
-rw-r--r-- | core/src/fpdftext/fpdf_text.cpp | 16 | ||||
-rw-r--r-- | core/src/fpdftext/fpdf_text_int.cpp | 15 |
2 files changed, 8 insertions, 23 deletions
diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp index 0659024d90..0b53338ea0 100644 --- a/core/src/fpdftext/fpdf_text.cpp +++ b/core/src/fpdftext/fpdf_text.cpp @@ -187,9 +187,6 @@ CTextBaseLine* CTextPage::InsertTextBox(CTextBaseLine* pBaseLine, } if (pBaseLine == NULL) { pBaseLine = new CTextBaseLine; - if (NULL == pBaseLine) { - return NULL; - } pBaseLine->m_BaseLine = basey; m_BaseLines.InsertAt(i, pBaseLine); } @@ -461,12 +458,10 @@ void CTextPage::FindColumns() { CTextColumn* pColumn = FindColumn(pTextBox->m_Right); if (pColumn == NULL) { pColumn = new CTextColumn; - if (pColumn) { - pColumn->m_Count = 1; - pColumn->m_AvgPos = pTextBox->m_Right; - pColumn->m_TextPos = -1; - m_TextColumns.Add(pColumn); - } + pColumn->m_Count = 1; + pColumn->m_AvgPos = pTextBox->m_Right; + pColumn->m_TextPos = -1; + m_TextColumns.Add(pColumn); } else { pColumn->m_AvgPos = (pColumn->m_Count * pColumn->m_AvgPos + pTextBox->m_Right) / @@ -540,9 +535,6 @@ void CTextBaseLine::InsertTextBox(FX_FLOAT leftx, } } CTextBox* pText = new CTextBox; - if (NULL == pText) { - return; - } pText->m_Text = text; pText->m_Left = leftx; pText->m_Right = rightx; diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp index 55e997c177..b343c1d566 100644 --- a/core/src/fpdftext/fpdf_text_int.cpp +++ b/core/src/fpdftext/fpdf_text_int.cpp @@ -84,18 +84,15 @@ CPDFText_ParseOptions::CPDFText_ParseOptions() IPDF_TextPage* IPDF_TextPage::CreateTextPage( const CPDF_Page* pPage, CPDFText_ParseOptions ParserOptions) { - CPDF_TextPage* pTextPageEx = new CPDF_TextPage(pPage, ParserOptions); - return pTextPageEx; + return new CPDF_TextPage(pPage, ParserOptions); } IPDF_TextPage* IPDF_TextPage::CreateTextPage(const CPDF_Page* pPage, int flags) { - CPDF_TextPage* pTextPage = new CPDF_TextPage(pPage, flags); - return pTextPage; + return new CPDF_TextPage(pPage, flags); } IPDF_TextPage* IPDF_TextPage::CreateTextPage(const CPDF_PageObjects* pObjs, int flags) { - CPDF_TextPage* pTextPage = new CPDF_TextPage(pObjs, flags); - return pTextPage; + return new CPDF_TextPage(pObjs, flags); } IPDF_TextPageFind* IPDF_TextPageFind::CreatePageFind( const IPDF_TextPage* pTextPage) { @@ -2736,11 +2733,7 @@ FX_BOOL CPDF_LinkExtract::CheckMailLink(CFX_WideString& str) { FX_BOOL CPDF_LinkExtract::AppendToLinkList(int start, int count, const CFX_WideString& strUrl) { - CPDF_LinkExt* linkInfo = NULL; - linkInfo = new CPDF_LinkExt; - if (!linkInfo) { - return FALSE; - } + CPDF_LinkExt* linkInfo = new CPDF_LinkExt; linkInfo->m_strUrl = strUrl; linkInfo->m_Start = start; linkInfo->m_Count = count; |