summaryrefslogtreecommitdiff
path: root/core/src/fpdftext/fpdf_text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdftext/fpdf_text.cpp')
-rw-r--r--core/src/fpdftext/fpdf_text.cpp22
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;