diff options
author | Lei Zhang <thestig@chromium.org> | 2015-08-17 18:36:43 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-08-17 18:36:43 -0700 |
commit | 1b0023986bc22ce362097b25deb9746b693ef235 (patch) | |
tree | 4d18ffc5f9eff4ac4659531621be8d2c28e3c71c /xfa/src/fxbarcode | |
parent | a0f67247277f666d80899985eda3c19f3641b9bf (diff) | |
download | pdfium-1b0023986bc22ce362097b25deb9746b693ef235.tar.xz |
Merge to XFA: Cleanup CFX_UnicodeEncoding and remove IFX_FontEncoding.
Similarly, Clean up CFX_UnicodeEncodingEx and remove IFX_FontEncodingEx.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1296753003 .
(cherry picked from commit 52a48aadc19b2dee8abeb702269bb168eb6b6999)
Review URL: https://codereview.chromium.org/1297083002 .
Diffstat (limited to 'xfa/src/fxbarcode')
-rw-r--r-- | xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp b/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp index aaab954380..8332986bae 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp +++ b/xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp @@ -20,6 +20,7 @@ * limitations under the License.
*/
+#include "../../../../third_party/base/nonstd_unique_ptr.h"
#include "../barcode.h"
#include "../BC_Writer.h"
#include "../common/BC_CommonBitMatrix.h"
@@ -129,11 +130,9 @@ void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString& text, FX_FLOAT geWidth,
int32_t fontSize,
FX_FLOAT& charsLen) {
-#ifdef FXFM_ENCODING_NONE
- IFX_FontEncodingEx* encoding = FX_CreateFontEncodingEx(cFont);
-#else
- IFX_FontEncoding* encoding = FXGE_CreateUnicodeEncoding(cFont);
-#endif
+ nonstd::unique_ptr<CFX_UnicodeEncodingEx> encoding(
+ FX_CreateFontEncodingEx(cFont));
+
int32_t length = text.GetLength();
FX_DWORD* pCharCode = FX_Alloc(FX_DWORD, text.GetLength());
FX_FLOAT charWidth = 0;
@@ -174,8 +173,6 @@ void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString& text, (FX_FLOAT)(charPos[i].m_FontCharWidth) * (FX_FLOAT)fontSize / 1000.0f;
}
FX_Free(pCharCode);
- delete encoding;
- encoding = NULL;
}
void CBC_OneDimWriter::ShowDeviceChars(CFX_RenderDevice* device,
const CFX_Matrix* matrix,
|