Merge to XFA: Remove FX_BSTR and FX_WSTR typedefs.
[pdfium.git] / xfa / src / fxfa / src / app / xfa_ffbarcode.cpp
index 44fe252..3b04a27 100644 (file)
@@ -12,7 +12,7 @@
 #include "xfa_ffpageview.h"\r
 #include "xfa_fftextedit.h"\r
 #include "xfa_ffbarcode.h"\r
-static XFA_LPCBARCODETYPEENUMINFO XFA_GetBarcodeTypeByName(FX_WSTR wsName);\r
+static XFA_LPCBARCODETYPEENUMINFO XFA_GetBarcodeTypeByName(const CFX_WideStringC& wsName);\r
 CXFA_FFBarcode::CXFA_FFBarcode(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc)\r
     : CXFA_FFTextEdit(pPageView, pDataAcc)\r
 {\r
@@ -40,7 +40,7 @@ FX_BOOL CXFA_FFBarcode::LoadWidget()
     m_pNormalWidget->UnlockUpdate();\r
     return CXFA_FFField::LoadWidget();\r
 }\r
-void CXFA_FFBarcode::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , FX_INT32 iRotate )\r
+void CXFA_FFBarcode::RenderWidget(CFX_Graphics* pGS, CFX_Matrix* pMatrix , FX_DWORD dwStatus , int32_t iRotate )\r
 {\r
     if (!IsMatchVisibleStatus(dwStatus)) {\r
         return;\r
@@ -69,7 +69,7 @@ void CXFA_FFBarcode::UpdateWidgetProperty()
     XFA_LPCBARCODETYPEENUMINFO pBarcodeTypeInfo = XFA_GetBarcodeTypeByName(wsType);\r
     pBarCodeWidget->SetType(pBarcodeTypeInfo->eBCType);\r
     CXFA_WidgetAcc *pAcc = GetDataAcc();\r
-    FX_INT32 intVal;\r
+    int32_t intVal;\r
     FX_CHAR  charVal;\r
     FX_BOOL  boolVal;\r
     FX_FLOAT floatVal;\r
@@ -107,7 +107,7 @@ void CXFA_FFBarcode::UpdateWidgetProperty()
         pBarCodeWidget->SetTruncated(boolVal);\r
     }\r
     if (pAcc->GetBarcodeAttribute_WideNarrowRatio(floatVal))   {\r
-        pBarCodeWidget->SetWideNarrowRatio((FX_INT32)floatVal);\r
+        pBarCodeWidget->SetWideNarrowRatio((int32_t)floatVal);\r
     }\r
     if (pBarcodeTypeInfo->eName == XFA_BARCODETYPE_code3Of9\r
             || pBarcodeTypeInfo->eName == XFA_BARCODETYPE_ean8\r
@@ -136,80 +136,80 @@ FX_BOOL   CXFA_FFBarcode::OnRButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy
     return CXFA_FFTextEdit::OnRButtonDown(dwFlags, fx, fy);\r
 }\r
 extern const XFA_BARCODETYPEENUMINFO g_XFABarCodeTypeEnumData[] = {\r
-    {0x7fb4a18, (FX_LPCWSTR)L"ean13", XFA_BARCODETYPE_ean13, BC_EAN13},\r
-    {0x8d13a3d, (FX_LPCWSTR)L"code11", XFA_BARCODETYPE_code11, BC_UNKNOWN},\r
-    {0x8d149a8, (FX_LPCWSTR)L"code49", XFA_BARCODETYPE_code49, BC_UNKNOWN},\r
-    {0x8d16347, (FX_LPCWSTR)L"code93", XFA_BARCODETYPE_code93, BC_UNKNOWN},\r
-    {0x91a92e2, (FX_LPCWSTR)L"upsMaxicode", XFA_BARCODETYPE_upsMaxicode, BC_UNKNOWN},\r
-    {0xa7d48dc, (FX_LPCWSTR)L"fim", XFA_BARCODETYPE_fim, BC_UNKNOWN},\r
-    {0xb359fe9, (FX_LPCWSTR)L"msi", XFA_BARCODETYPE_msi, BC_UNKNOWN},\r
-    {0x121f738c, (FX_LPCWSTR)L"code2Of5Matrix", XFA_BARCODETYPE_code2Of5Matrix, BC_UNKNOWN},\r
-    {0x15358616, (FX_LPCWSTR)L"ucc128", XFA_BARCODETYPE_ucc128, BC_UNKNOWN},\r
-    {0x1f4bfa05, (FX_LPCWSTR)L"rfid", XFA_BARCODETYPE_rfid, BC_UNKNOWN},\r
-    {0x1fda71bc, (FX_LPCWSTR)L"rss14Stacked", XFA_BARCODETYPE_rss14Stacked, BC_UNKNOWN},\r
-    {0x22065087, (FX_LPCWSTR)L"ean8add2", XFA_BARCODETYPE_ean8add2, BC_UNKNOWN},\r
-    {0x2206508a, (FX_LPCWSTR)L"ean8add5", XFA_BARCODETYPE_ean8add5, BC_UNKNOWN},\r
-    {0x2278366c, (FX_LPCWSTR)L"codabar", XFA_BARCODETYPE_codabar, BC_CODABAR},\r
-    {0x2a039a8d, (FX_LPCWSTR)L"telepen", XFA_BARCODETYPE_telepen, BC_UNKNOWN},\r
-    {0x323ed337, (FX_LPCWSTR)L"upcApwcd", XFA_BARCODETYPE_upcApwcd, BC_UNKNOWN},\r
-    {0x347a1846, (FX_LPCWSTR)L"postUSIMB", XFA_BARCODETYPE_postUSIMB, BC_UNKNOWN},\r
-    {0x391bb836, (FX_LPCWSTR)L"code128", XFA_BARCODETYPE_code128, BC_CODE128},\r
-    {0x398eddaf, (FX_LPCWSTR)L"dataMatrix", XFA_BARCODETYPE_dataMatrix, BC_DATAMATRIX},\r
-    {0x3cff60a8, (FX_LPCWSTR)L"upcEadd2", XFA_BARCODETYPE_upcEadd2, BC_UNKNOWN},\r
-    {0x3cff60ab, (FX_LPCWSTR)L"upcEadd5", XFA_BARCODETYPE_upcEadd5, BC_UNKNOWN},\r
-    {0x402cb188, (FX_LPCWSTR)L"code2Of5Standard", XFA_BARCODETYPE_code2Of5Standard, BC_UNKNOWN},\r
-    {0x411764f7, (FX_LPCWSTR)L"aztec", XFA_BARCODETYPE_aztec, BC_UNKNOWN},\r
-    {0x44d4e84c, (FX_LPCWSTR)L"ean8", XFA_BARCODETYPE_ean8, BC_EAN8},\r
-    {0x48468902, (FX_LPCWSTR)L"ucc128sscc", XFA_BARCODETYPE_ucc128sscc, BC_UNKNOWN},\r
-    {0x4880aea4, (FX_LPCWSTR)L"upcAadd2", XFA_BARCODETYPE_upcAadd2, BC_UNKNOWN},\r
-    {0x4880aea7, (FX_LPCWSTR)L"upcAadd5", XFA_BARCODETYPE_upcAadd5, BC_UNKNOWN},\r
-    {0x54f18256, (FX_LPCWSTR)L"code2Of5Industrial", XFA_BARCODETYPE_code2Of5Industrial, BC_UNKNOWN},\r
-    {0x58e15f25, (FX_LPCWSTR)L"rss14Limited", XFA_BARCODETYPE_rss14Limited, BC_UNKNOWN},\r
-    {0x5c08d1b9, (FX_LPCWSTR)L"postAUSReplyPaid", XFA_BARCODETYPE_postAUSReplyPaid, BC_UNKNOWN},\r
-    {0x5fa700bd, (FX_LPCWSTR)L"rss14", XFA_BARCODETYPE_rss14, BC_UNKNOWN},\r
-    {0x631a7e35, (FX_LPCWSTR)L"logmars", XFA_BARCODETYPE_logmars, BC_UNKNOWN},\r
-    {0x6a236236, (FX_LPCWSTR)L"pdf417", XFA_BARCODETYPE_pdf417, BC_PDF417},\r
-    {0x6d098ece, (FX_LPCWSTR)L"upcean2", XFA_BARCODETYPE_upcean2, BC_UNKNOWN},\r
-    {0x6d098ed1, (FX_LPCWSTR)L"upcean5", XFA_BARCODETYPE_upcean5, BC_UNKNOWN},\r
-    {0x76b04eed, (FX_LPCWSTR)L"code3Of9extended", XFA_BARCODETYPE_code3Of9extended, BC_UNKNOWN},\r
-    {0x7c7db84a, (FX_LPCWSTR)L"maxicode", XFA_BARCODETYPE_maxicode, BC_UNKNOWN},\r
-    {0x8266f7f7, (FX_LPCWSTR)L"ucc128random", XFA_BARCODETYPE_ucc128random, BC_UNKNOWN},\r
-    {0x83eca147, (FX_LPCWSTR)L"postUSDPBC", XFA_BARCODETYPE_postUSDPBC, BC_UNKNOWN},\r
-    {0x8dd71de0, (FX_LPCWSTR)L"postAUSStandard", XFA_BARCODETYPE_postAUSStandard, BC_UNKNOWN},\r
-    {0x98adad85, (FX_LPCWSTR)L"plessey", XFA_BARCODETYPE_plessey, BC_UNKNOWN},\r
-    {0x9f84cce6, (FX_LPCWSTR)L"ean13pwcd", XFA_BARCODETYPE_ean13pwcd, BC_UNKNOWN},\r
-    {0xb514fbe9, (FX_LPCWSTR)L"upcA", XFA_BARCODETYPE_upcA, BC_UPCA},\r
-    {0xb514fbed, (FX_LPCWSTR)L"upcE", XFA_BARCODETYPE_upcE, BC_UNKNOWN},\r
-    {0xb5c6a853, (FX_LPCWSTR)L"ean13add2", XFA_BARCODETYPE_ean13add2, BC_UNKNOWN},\r
-    {0xb5c6a856, (FX_LPCWSTR)L"ean13add5", XFA_BARCODETYPE_ean13add5, BC_UNKNOWN},\r
-    {0xb81fc512, (FX_LPCWSTR)L"postUKRM4SCC", XFA_BARCODETYPE_postUKRM4SCC, BC_UNKNOWN},\r
-    {0xbad34b22, (FX_LPCWSTR)L"code128SSCC", XFA_BARCODETYPE_code128SSCC, BC_UNKNOWN},\r
-    {0xbfbe0cf6, (FX_LPCWSTR)L"postUS5Zip", XFA_BARCODETYPE_postUS5Zip, BC_UNKNOWN},\r
-    {0xc56618e8, (FX_LPCWSTR)L"pdf417macro", XFA_BARCODETYPE_pdf417macro, BC_UNKNOWN},\r
-    {0xca730f8a, (FX_LPCWSTR)L"code2Of5Interleaved", XFA_BARCODETYPE_code2Of5Interleaved, BC_UNKNOWN},\r
-    {0xd0097ac6, (FX_LPCWSTR)L"rss14Expanded", XFA_BARCODETYPE_rss14Expanded, BC_UNKNOWN},\r
-    {0xd25a0240, (FX_LPCWSTR)L"postAUSCust2", XFA_BARCODETYPE_postAUSCust2, BC_UNKNOWN},\r
-    {0xd25a0241, (FX_LPCWSTR)L"postAUSCust3", XFA_BARCODETYPE_postAUSCust3, BC_UNKNOWN},\r
-    {0xd53ed3e7, (FX_LPCWSTR)L"rss14Truncated", XFA_BARCODETYPE_rss14Truncated, BC_UNKNOWN},\r
-    {0xe72bcd57, (FX_LPCWSTR)L"code128A", XFA_BARCODETYPE_code128A, BC_UNKNOWN},\r
-    {0xe72bcd58, (FX_LPCWSTR)L"code128B", XFA_BARCODETYPE_code128B, BC_CODE128_B},\r
-    {0xe72bcd59, (FX_LPCWSTR)L"code128C", XFA_BARCODETYPE_code128C, BC_CODE128_C},\r
-    {0xee83c50f, (FX_LPCWSTR)L"rss14StackedOmni", XFA_BARCODETYPE_rss14StackedOmni, BC_UNKNOWN},\r
-    {0xf2a18f7e, (FX_LPCWSTR)L"QRCode", XFA_BARCODETYPE_QRCode, BC_QR_CODE},\r
-    {0xfaeaf37f, (FX_LPCWSTR)L"postUSStandard", XFA_BARCODETYPE_postUSStandard, BC_UNKNOWN},\r
-    {0xfb48155c, (FX_LPCWSTR)L"code3Of9", XFA_BARCODETYPE_code3Of9, BC_CODE39},\r
+    {0x7fb4a18, L"ean13", XFA_BARCODETYPE_ean13, BC_EAN13},\r
+    {0x8d13a3d, L"code11", XFA_BARCODETYPE_code11, BC_UNKNOWN},\r
+    {0x8d149a8, L"code49", XFA_BARCODETYPE_code49, BC_UNKNOWN},\r
+    {0x8d16347, L"code93", XFA_BARCODETYPE_code93, BC_UNKNOWN},\r
+    {0x91a92e2, L"upsMaxicode", XFA_BARCODETYPE_upsMaxicode, BC_UNKNOWN},\r
+    {0xa7d48dc, L"fim", XFA_BARCODETYPE_fim, BC_UNKNOWN},\r
+    {0xb359fe9, L"msi", XFA_BARCODETYPE_msi, BC_UNKNOWN},\r
+    {0x121f738c, L"code2Of5Matrix", XFA_BARCODETYPE_code2Of5Matrix, BC_UNKNOWN},\r
+    {0x15358616, L"ucc128", XFA_BARCODETYPE_ucc128, BC_UNKNOWN},\r
+    {0x1f4bfa05, L"rfid", XFA_BARCODETYPE_rfid, BC_UNKNOWN},\r
+    {0x1fda71bc, L"rss14Stacked", XFA_BARCODETYPE_rss14Stacked, BC_UNKNOWN},\r
+    {0x22065087, L"ean8add2", XFA_BARCODETYPE_ean8add2, BC_UNKNOWN},\r
+    {0x2206508a, L"ean8add5", XFA_BARCODETYPE_ean8add5, BC_UNKNOWN},\r
+    {0x2278366c, L"codabar", XFA_BARCODETYPE_codabar, BC_CODABAR},\r
+    {0x2a039a8d, L"telepen", XFA_BARCODETYPE_telepen, BC_UNKNOWN},\r
+    {0x323ed337, L"upcApwcd", XFA_BARCODETYPE_upcApwcd, BC_UNKNOWN},\r
+    {0x347a1846, L"postUSIMB", XFA_BARCODETYPE_postUSIMB, BC_UNKNOWN},\r
+    {0x391bb836, L"code128", XFA_BARCODETYPE_code128, BC_CODE128},\r
+    {0x398eddaf, L"dataMatrix", XFA_BARCODETYPE_dataMatrix, BC_DATAMATRIX},\r
+    {0x3cff60a8, L"upcEadd2", XFA_BARCODETYPE_upcEadd2, BC_UNKNOWN},\r
+    {0x3cff60ab, L"upcEadd5", XFA_BARCODETYPE_upcEadd5, BC_UNKNOWN},\r
+    {0x402cb188, L"code2Of5Standard", XFA_BARCODETYPE_code2Of5Standard, BC_UNKNOWN},\r
+    {0x411764f7, L"aztec", XFA_BARCODETYPE_aztec, BC_UNKNOWN},\r
+    {0x44d4e84c, L"ean8", XFA_BARCODETYPE_ean8, BC_EAN8},\r
+    {0x48468902, L"ucc128sscc", XFA_BARCODETYPE_ucc128sscc, BC_UNKNOWN},\r
+    {0x4880aea4, L"upcAadd2", XFA_BARCODETYPE_upcAadd2, BC_UNKNOWN},\r
+    {0x4880aea7, L"upcAadd5", XFA_BARCODETYPE_upcAadd5, BC_UNKNOWN},\r
+    {0x54f18256, L"code2Of5Industrial", XFA_BARCODETYPE_code2Of5Industrial, BC_UNKNOWN},\r
+    {0x58e15f25, L"rss14Limited", XFA_BARCODETYPE_rss14Limited, BC_UNKNOWN},\r
+    {0x5c08d1b9, L"postAUSReplyPaid", XFA_BARCODETYPE_postAUSReplyPaid, BC_UNKNOWN},\r
+    {0x5fa700bd, L"rss14", XFA_BARCODETYPE_rss14, BC_UNKNOWN},\r
+    {0x631a7e35, L"logmars", XFA_BARCODETYPE_logmars, BC_UNKNOWN},\r
+    {0x6a236236, L"pdf417", XFA_BARCODETYPE_pdf417, BC_PDF417},\r
+    {0x6d098ece, L"upcean2", XFA_BARCODETYPE_upcean2, BC_UNKNOWN},\r
+    {0x6d098ed1, L"upcean5", XFA_BARCODETYPE_upcean5, BC_UNKNOWN},\r
+    {0x76b04eed, L"code3Of9extended", XFA_BARCODETYPE_code3Of9extended, BC_UNKNOWN},\r
+    {0x7c7db84a, L"maxicode", XFA_BARCODETYPE_maxicode, BC_UNKNOWN},\r
+    {0x8266f7f7, L"ucc128random", XFA_BARCODETYPE_ucc128random, BC_UNKNOWN},\r
+    {0x83eca147, L"postUSDPBC", XFA_BARCODETYPE_postUSDPBC, BC_UNKNOWN},\r
+    {0x8dd71de0, L"postAUSStandard", XFA_BARCODETYPE_postAUSStandard, BC_UNKNOWN},\r
+    {0x98adad85, L"plessey", XFA_BARCODETYPE_plessey, BC_UNKNOWN},\r
+    {0x9f84cce6, L"ean13pwcd", XFA_BARCODETYPE_ean13pwcd, BC_UNKNOWN},\r
+    {0xb514fbe9, L"upcA", XFA_BARCODETYPE_upcA, BC_UPCA},\r
+    {0xb514fbed, L"upcE", XFA_BARCODETYPE_upcE, BC_UNKNOWN},\r
+    {0xb5c6a853, L"ean13add2", XFA_BARCODETYPE_ean13add2, BC_UNKNOWN},\r
+    {0xb5c6a856, L"ean13add5", XFA_BARCODETYPE_ean13add5, BC_UNKNOWN},\r
+    {0xb81fc512, L"postUKRM4SCC", XFA_BARCODETYPE_postUKRM4SCC, BC_UNKNOWN},\r
+    {0xbad34b22, L"code128SSCC", XFA_BARCODETYPE_code128SSCC, BC_UNKNOWN},\r
+    {0xbfbe0cf6, L"postUS5Zip", XFA_BARCODETYPE_postUS5Zip, BC_UNKNOWN},\r
+    {0xc56618e8, L"pdf417macro", XFA_BARCODETYPE_pdf417macro, BC_UNKNOWN},\r
+    {0xca730f8a, L"code2Of5Interleaved", XFA_BARCODETYPE_code2Of5Interleaved, BC_UNKNOWN},\r
+    {0xd0097ac6, L"rss14Expanded", XFA_BARCODETYPE_rss14Expanded, BC_UNKNOWN},\r
+    {0xd25a0240, L"postAUSCust2", XFA_BARCODETYPE_postAUSCust2, BC_UNKNOWN},\r
+    {0xd25a0241, L"postAUSCust3", XFA_BARCODETYPE_postAUSCust3, BC_UNKNOWN},\r
+    {0xd53ed3e7, L"rss14Truncated", XFA_BARCODETYPE_rss14Truncated, BC_UNKNOWN},\r
+    {0xe72bcd57, L"code128A", XFA_BARCODETYPE_code128A, BC_UNKNOWN},\r
+    {0xe72bcd58, L"code128B", XFA_BARCODETYPE_code128B, BC_CODE128_B},\r
+    {0xe72bcd59, L"code128C", XFA_BARCODETYPE_code128C, BC_CODE128_C},\r
+    {0xee83c50f, L"rss14StackedOmni", XFA_BARCODETYPE_rss14StackedOmni, BC_UNKNOWN},\r
+    {0xf2a18f7e, L"QRCode", XFA_BARCODETYPE_QRCode, BC_QR_CODE},\r
+    {0xfaeaf37f, L"postUSStandard", XFA_BARCODETYPE_postUSStandard, BC_UNKNOWN},\r
+    {0xfb48155c, L"code3Of9", XFA_BARCODETYPE_code3Of9, BC_CODE39},\r
 };\r
-extern const FX_INT32 g_iXFABarcodeTypeCount = sizeof(g_XFABarCodeTypeEnumData) / sizeof(XFA_BARCODETYPEENUMINFO);\r
-static XFA_LPCBARCODETYPEENUMINFO XFA_GetBarcodeTypeByName(FX_WSTR wsName)\r
+extern const int32_t g_iXFABarcodeTypeCount = sizeof(g_XFABarCodeTypeEnumData) / sizeof(XFA_BARCODETYPEENUMINFO);\r
+static XFA_LPCBARCODETYPEENUMINFO XFA_GetBarcodeTypeByName(const CFX_WideStringC& wsName)\r
 {\r
-    FX_INT32 iLength = wsName.GetLength();\r
+    int32_t iLength = wsName.GetLength();\r
     if (iLength == 0) {\r
         return NULL;\r
     }\r
-    FX_UINT32 uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength, TRUE);\r
-    FX_INT32 iStart = 0, iEnd = g_iXFABarcodeTypeCount - 1;\r
+    uint32_t uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength, TRUE);\r
+    int32_t iStart = 0, iEnd = g_iXFABarcodeTypeCount - 1;\r
     do {\r
-        FX_INT32 iMid = (iStart + iEnd) / 2;\r
+        int32_t iMid = (iStart + iEnd) / 2;\r
         XFA_LPCBARCODETYPEENUMINFO pInfo = g_XFABarCodeTypeEnumData + iMid;\r
         if (uHash == pInfo->uHash) {\r
             return pInfo;\r