diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-18 12:47:11 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-18 12:47:11 -0700 |
commit | 2c28619de8051661c7f66f2192c6fb9ef14ee905 (patch) | |
tree | 4bd15bf0bb72e4127403548bf2f40230bbdd352b /core/src/fpdftext/fpdf_text_int.cpp | |
parent | 0c1bd7c6ad378ea97a2f54cb0c4761716f6d1057 (diff) | |
download | pdfium-2c28619de8051661c7f66f2192c6fb9ef14ee905.tar.xz |
Replace some Release() calls with virtual destructors.
Required fixing xfa-specific code.
Original Review URL: https://codereview.chromium.org/1192013002.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1176413004.
Diffstat (limited to 'core/src/fpdftext/fpdf_text_int.cpp')
-rw-r--r-- | core/src/fpdftext/fpdf_text_int.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp index 4ad2cd4e77..84edf812d7 100644 --- a/core/src/fpdftext/fpdf_text_int.cpp +++ b/core/src/fpdftext/fpdf_text_int.cpp @@ -4,13 +4,15 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "../../include/fpdfapi/fpdf_resource.h" -#include "../../include/fpdfapi/fpdf_pageobj.h" -#include "../../include/fpdftext/fpdf_text.h" -#include "../../include/fpdfapi/fpdf_page.h" -#include "../../include/fpdfapi/fpdf_module.h" #include <ctype.h> #include <algorithm> + +#include "../../../third_party/base/nonstd_unique_ptr.h" +#include "../../include/fpdfapi/fpdf_module.h" +#include "../../include/fpdfapi/fpdf_page.h" +#include "../../include/fpdfapi/fpdf_pageobj.h" +#include "../../include/fpdfapi/fpdf_resource.h" +#include "../../include/fpdftext/fpdf_text.h" #include "text_int.h" namespace { @@ -1228,7 +1230,7 @@ void CPDF_TextPage::CloseTempLine() if (count1 <= 0) { return; } - IFX_BidiChar* BidiChar = IFX_BidiChar::Create(); + nonstd::unique_ptr<IFX_BidiChar> pBidiChar(IFX_BidiChar::Create()); CFX_WideString str = m_TempTextBuf.GetWideString(); CFX_WordArray order; FX_BOOL bR2L = FALSE; @@ -1249,8 +1251,8 @@ void CPDF_TextPage::CloseTempLine() } else { bPrevSpace = FALSE; } - if(BidiChar && BidiChar->AppendChar(str.GetAt(i))) { - int32_t ret = BidiChar->GetBidiInfo(start, count); + if(pBidiChar->AppendChar(str.GetAt(i))) { + int32_t ret = pBidiChar->GetBidiInfo(start, count); order.Add(start); order.Add(count); order.Add(ret); @@ -1263,8 +1265,8 @@ void CPDF_TextPage::CloseTempLine() } } } - if(BidiChar && BidiChar->EndChar()) { - int32_t ret = BidiChar->GetBidiInfo(start, count); + if(pBidiChar->EndChar()) { + int32_t ret = pBidiChar->GetBidiInfo(start, count); order.Add(start); order.Add(count); order.Add(ret); @@ -1361,7 +1363,6 @@ void CPDF_TextPage::CloseTempLine() order.RemoveAll(); m_TempCharList.RemoveAll(); m_TempTextBuf.Delete(0, m_TempTextBuf.GetLength()); - BidiChar->Release(); } void CPDF_TextPage::ProcessTextObject(CPDF_TextObject* pTextObj, const CFX_AffineMatrix& formMatrix, FX_POSITION ObjPos) { |