diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-04-16 14:29:43 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-04-16 14:29:43 -0700 |
commit | 7f6b6677665588a27b9d14babc6358840454ce17 (patch) | |
tree | 9ea6afdb2786e592a9ac4dc2423220ab5a24b259 /core/src/fpdftext/fpdf_text.cpp | |
parent | cfc1a654ef3e8b65bc447815d35932c185bf1422 (diff) | |
download | pdfium-7f6b6677665588a27b9d14babc6358840454ce17.tar.xz |
Replace FX_NEW with new, remove tests from fpdftext
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1085363003
Diffstat (limited to 'core/src/fpdftext/fpdf_text.cpp')
-rw-r--r-- | core/src/fpdftext/fpdf_text.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp index d6d6de9a83..3781b2abb9 100644 --- a/core/src/fpdftext/fpdf_text.cpp +++ b/core/src/fpdftext/fpdf_text.cpp @@ -169,10 +169,7 @@ CTextBaseLine* CTextPage::InsertTextBox(CTextBaseLine* pBaseLine, FX_FLOAT basey } } if (pBaseLine == NULL) { - pBaseLine = FX_NEW CTextBaseLine; - if (NULL == pBaseLine) { - return NULL; - } + pBaseLine = new CTextBaseLine; pBaseLine->m_BaseLine = basey; m_BaseLines.InsertAt(i, pBaseLine); } @@ -453,13 +450,11 @@ void CTextPage::FindColumns() CTextBox* pTextBox = (CTextBox*)pBaseLine->m_TextList.GetAt(j); CTextColumn* pColumn = FindColumn(pTextBox->m_Right); if (pColumn == NULL) { - pColumn = FX_NEW CTextColumn; - if (pColumn) { - pColumn->m_Count = 1; - pColumn->m_AvgPos = pTextBox->m_Right; - pColumn->m_TextPos = -1; - m_TextColumns.Add(pColumn); - } + pColumn = new CTextColumn; + 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) / (pColumn->m_Count + 1); @@ -532,10 +527,7 @@ void CTextBaseLine::InsertTextBox(FX_FLOAT leftx, FX_FLOAT rightx, FX_FLOAT topy break; } } - CTextBox* pText = FX_NEW CTextBox; - if (NULL == pText) { - return; - } + CTextBox* pText = new CTextBox; pText->m_Text = text; pText->m_Left = leftx; pText->m_Right = rightx; |