Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2097)

Unified Diff: core/src/fpdftext/fpdf_text.cpp

Issue 1085363003: Replace FX_NEW with new, remove tests from fpdftext (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/src/fpdftext/fpdf_text_int.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdftext/fpdf_text.cpp
diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp
index d6d6de9a83bd51e89cdb757a07dd437e5cc39094..3781b2abb9f0b4a089d47a7724d215b37476146d 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;
« no previous file with comments | « no previous file | core/src/fpdftext/fpdf_text_int.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698