diff options
Diffstat (limited to 'fpdfsdk/src')
-rw-r--r-- | fpdfsdk/src/fxedit/fxet_list.cpp | 11 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/app.cpp | 13 | ||||
-rw-r--r-- | fpdfsdk/src/pdfwindow/PWL_Wnd.cpp | 4 |
3 files changed, 10 insertions, 18 deletions
diff --git a/fpdfsdk/src/fxedit/fxet_list.cpp b/fpdfsdk/src/fxedit/fxet_list.cpp index 70dc8d5262..ff4723e514 100644 --- a/fpdfsdk/src/fxedit/fxet_list.cpp +++ b/fpdfsdk/src/fxedit/fxet_list.cpp @@ -128,12 +128,11 @@ void CFX_List::SetFontSize(FX_FLOAT fFontSize) { } void CFX_List::AddItem(const FX_WCHAR* str) { - if (CFX_ListItem* pListItem = new CFX_ListItem()) { - pListItem->SetFontMap(m_pFontMap); - pListItem->SetFontSize(m_fFontSize); - pListItem->SetText(str); - m_aListItems.Add(pListItem); - } + CFX_ListItem* pListItem = new CFX_ListItem(); + pListItem->SetFontMap(m_pFontMap); + pListItem->SetFontSize(m_fFontSize); + pListItem->SetText(str); + m_aListItems.Add(pListItem); } void CFX_List::ReArrange(int32_t nItemIndex) { diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp index 24f00ca262..1b84508fd6 100644 --- a/fpdfsdk/src/javascript/app.cpp +++ b/fpdfsdk/src/javascript/app.cpp @@ -298,19 +298,12 @@ FX_BOOL app::alert(IFXJS_Context* cc, if (swMsg == L"") { CJS_Array carray(isolate); if (params[0].ConvertToArray(carray)) { - int iLenth = carray.GetLength(); + int iLength = carray.GetLength(); CJS_Value* pValue = new CJS_Value(isolate); - // if (iLenth == 1) - // pValue = new - // CJS_Value(isolate); - // else if (iLenth > 1) - // pValue = new - // CJS_Value[iLenth]; - - for (int i = 0; i < iLenth; i++) { + for (int i = 0; i < iLength; ++i) { carray.GetElement(i, *pValue); swMsg += (*pValue).ToCFXWideString(); - if (i < iLenth - 1) + if (i < iLength - 1) swMsg += L", "; } diff --git a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp index 81bbbbfe8e..7b765f3e4f 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp @@ -685,8 +685,8 @@ void CPWL_Wnd::CreateVScrollBar(const PWL_CREATEPARAM& cp) { scp.eCursorType = FXCT_ARROW; scp.nTransparency = PWL_SCROLLBAR_TRANSPARANCY; - if ((m_pVScrollBar = new CPWL_ScrollBar(SBT_VSCROLL))) - m_pVScrollBar->Create(scp); + m_pVScrollBar = new CPWL_ScrollBar(SBT_VSCROLL); + m_pVScrollBar->Create(scp); } } |