summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-02-25 12:08:02 -0800
committerLei Zhang <thestig@chromium.org>2016-02-25 12:08:02 -0800
commit6941d29a825a815bebf93e07c3f2e2274399c7a4 (patch)
tree222d611e79399d49dce45be9bbb1e0bd0efbfcb3 /xfa
parent6b7b5a52f42aa9b37be5307915885d5f4566c326 (diff)
downloadpdfium-6941d29a825a815bebf93e07c3f2e2274399c7a4.tar.xz
Remove set but unsed variables.
And other nearby dead code. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1740613002 .
Diffstat (limited to 'xfa')
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp4
-rw-r--r--xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp2
-rw-r--r--xfa/src/fwl/src/core/fwl_gridimp.cpp7
-rw-r--r--xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp2
-rw-r--r--xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp1
-rw-r--r--xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp2
-rw-r--r--xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp2
-rw-r--r--xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp2
-rw-r--r--xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp2
-rw-r--r--xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp2
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp62
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffConfigAcc.h27
-rw-r--r--xfa/src/fxfa/src/app/xfa_fftextedit.cpp6
-rw-r--r--xfa/src/fxfa/src/app/xfa_fontmgr.cpp17
-rw-r--r--xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp14
-rw-r--r--xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp5
-rw-r--r--xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp17
-rw-r--r--xfa/src/fxfa/src/parser/xfa_object_imp.cpp3
18 files changed, 21 insertions, 156 deletions
diff --git a/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp b/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp
index 6eca31c9ee..b5c59f35f6 100644
--- a/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_datetimepickerimp.cpp
@@ -1020,7 +1020,6 @@ int32_t CFWL_DateTimePickerImpDelegate::OnProcessMessage(
if (!pMessage)
return 0;
FX_DWORD dwMsgCode = pMessage->GetClassID();
- int32_t iRet = 1;
switch (dwMsgCode) {
case FWL_MSGHASH_SetFocus:
case FWL_MSGHASH_KillFocus: {
@@ -1051,7 +1050,8 @@ int32_t CFWL_DateTimePickerImpDelegate::OnProcessMessage(
}
break;
}
- default: { iRet = 0; }
+ default:
+ break;
}
if (dwMsgCode == FWL_MSGHASH_Key &&
m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) {
diff --git a/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp b/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp
index aee5cb60c3..2ce286b955 100644
--- a/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_monthcalendarimp.cpp
@@ -322,8 +322,6 @@ void CFWL_MonthCalendarImp::DrawWeek(CFX_Graphics* pGraphics,
params.m_pGraphics = pGraphics;
params.m_dwStates = FWL_PARTSTATE_MCD_Normal;
params.m_iTTOAlign = FDE_TTOALIGNMENT_Center;
- int32_t iWeek;
- iWeek = m_pDateTime->GetDayOfWeek();
CFX_RectF rtDayOfWeek;
if (pMatrix) {
params.m_matrix.Concat(*pMatrix);
diff --git a/xfa/src/fwl/src/core/fwl_gridimp.cpp b/xfa/src/fwl/src/core/fwl_gridimp.cpp
index e9dd74e296..b7d255ce32 100644
--- a/xfa/src/fwl/src/core/fwl_gridimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_gridimp.cpp
@@ -1164,16 +1164,11 @@ void CFWL_GridImp::SetAllWidgetsRect() {
GetWidgetMargin(pWidget, FWL_GRIDMARGIN_Top, fTopMargin);
FX_BOOL bBottomMargin =
GetWidgetMargin(pWidget, FWL_GRIDMARGIN_Bottom, fBottomMargin);
- FWL_LAYOUTDATA ltd;
- ltd.fWidth = 0;
- ltd.fHeight = 0;
if (pInfo->m_Size[FWL_GRIDSIZE_Width].eUnit == FWL_GRIDUNIT_Fixed) {
SetWidgetActualWidth(pInfo, pInfo->m_Size[FWL_GRIDSIZE_Width].fLength);
- ltd.fWidth = pInfo->m_fActualWidth;
} else {
if (bLeftMargin && bRightMargin) {
SetWidgetActualWidth(pInfo, fColumnWidth - fLeftMargin - fRightMargin);
- ltd.fWidth = pInfo->m_fActualWidth;
} else {
CFX_RectF rtAuto;
pWidget->GetWidgetRect(rtAuto, TRUE);
@@ -1182,11 +1177,9 @@ void CFWL_GridImp::SetAllWidgetsRect() {
}
if (pInfo->m_Size[FWL_GRIDSIZE_Height].eUnit == FWL_GRIDUNIT_Fixed) {
SetWidgetActualHeight(pInfo, pInfo->m_Size[FWL_GRIDSIZE_Height].fLength);
- ltd.fHeight = pInfo->m_fActualHeight;
} else {
if (bTopMargin && bBottomMargin) {
SetWidgetActualHeight(pInfo, fRowHeight - fTopMargin - fBottomMargin);
- ltd.fHeight = pInfo->m_fActualHeight;
} else {
CFX_RectF rtAuto;
pWidget->GetWidgetRect(rtAuto, TRUE);
diff --git a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp
index a1be45e291..01ececb4b7 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp
@@ -138,7 +138,7 @@ int32_t CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString& sb, int32_t& e) {
} else if ((c >= 'A') && (c <= 'Z')) {
sb += (FX_WCHAR)(c - 65 + 14);
return 1;
- } else if ((c >= '\0') && (c <= 0x1f)) {
+ } else if (c <= 0x1f) {
sb += (FX_WCHAR)'\0';
sb += c;
return 2;
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp
index 02a202b27d..79e47177a6 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp
@@ -83,7 +83,6 @@ CBC_CommonDecoderResult* CBC_DataMatrixDecodedBitStreamParser::Decode(
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
break;
default:
- NULL;
e = BCExceptionFormatException;
return NULL;
}
diff --git a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp
index 61e8f7dec2..ec340f30e7 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp
@@ -50,7 +50,7 @@ int32_t CBC_TextEncoder::encodeChar(FX_WCHAR c,
sb += (FX_WCHAR)(c - 97 + 14);
return 1;
}
- if (c >= '\0' && c <= 0x1f) {
+ if (c <= 0x1f) {
sb += (FX_WCHAR)'\0';
sb += c;
return 2;
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp b/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp
index 5f0ad98d65..689cf4c87e 100644
--- a/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp
+++ b/xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp
@@ -67,7 +67,6 @@ CFX_ByteString CBC_OnedCode39Reader::DecodeRow(int32_t rowNumber,
CFX_Int32Array counters;
counters.SetSize(9);
FX_CHAR decodedChar;
- int32_t lastStart;
do {
RecordPattern(row, nextStart, &counters, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
@@ -79,7 +78,6 @@ CFX_ByteString CBC_OnedCode39Reader::DecodeRow(int32_t rowNumber,
decodedChar = PatternToChar(pattern, e);
BC_EXCEPTION_CHECK_ReturnValue(e, "");
result += decodedChar;
- lastStart = nextStart;
for (int32_t i = 0; i < counters.GetSize(); i++) {
nextStart += counters[i];
}
diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp
index de71b2074a..1a026da98f 100644
--- a/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp
+++ b/xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp
@@ -207,7 +207,6 @@ void CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents,
device->FillRect(&re, m_backgroundColor);
}
FX_FLOAT blank = 0.0;
- FX_FLOAT charsWidth = 0;
iLen = tempStr.GetLength();
if (pOutBitmap == NULL) {
strWidth = (int32_t)(strWidth * m_outputHScale);
@@ -239,7 +238,6 @@ void CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents,
}
tempStr = str.Mid(7, 6);
iLen = tempStr.GetLength();
- charsWidth = 0.0f;
CalcTextInfo(tempStr, pCharPos + 7, m_pFont, (FX_FLOAT)strWidth, iFontSize,
blank);
if (pOutBitmap) {
diff --git a/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp
index 61fe75aae3..9981575112 100644
--- a/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp
+++ b/xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp
@@ -182,7 +182,6 @@ void CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents,
if (pOutBitmap) {
geBitmap.Attach(pOutBitmap);
}
- FX_FLOAT charsWidth = 0;
int32_t iFontSize = (int32_t)fabs(m_fFontSize);
int32_t iTextHeight = iFontSize + 1;
if (pOutBitmap == NULL) {
@@ -233,7 +232,6 @@ void CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents,
}
tempStr = str.Mid(4, 4);
iLen = tempStr.GetLength();
- charsWidth = 0.0f;
CalcTextInfo(tempStr, pCharPos + 4, m_pFont, (FX_FLOAT)strWidth, iFontSize,
blank);
if (pOutBitmap) {
diff --git a/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp
index 55c50318a5..fe4a8e7824 100644
--- a/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp
+++ b/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp
@@ -130,7 +130,6 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
if (pOutBitmap) {
geBitmap.Attach(pOutBitmap);
}
- FX_FLOAT charsWidth = 0;
iLen = tempStr.GetLength();
int32_t iFontSize = (int32_t)fabs(m_fFontSize);
int32_t iTextHeight = iFontSize + 1;
@@ -200,7 +199,6 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
}
tempStr = str.Mid(6, 5);
iLen = tempStr.GetLength();
- charsWidth = 0.0f;
CalcTextInfo(tempStr, pCharPos + 6, m_pFont, strWidth, iFontSize, blank);
if (pOutBitmap) {
FX_RECT rect2(0, 0, (int)strWidth, iTextHeight);
diff --git a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp b/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp
deleted file mode 100644
index 2a31533771..0000000000
--- a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/src/foxitlib.h"
-#include "xfa/src/fxfa/src/app/xfa_ffConfigAcc.h"
-#include "xfa/src/fxfa/src/common/xfa_object.h"
-
-CXFA_FFConfigAcc::CXFA_FFConfigAcc(CXFA_Node* pNode)
- : m_pNode(pNode), m_pPsMapNode(NULL) {}
-CXFA_FFConfigAcc::~CXFA_FFConfigAcc() {}
-int32_t CXFA_FFConfigAcc::CountChildren() {
- GetPsMapNode();
- if (m_pPsMapNode == NULL) {
- return 0;
- }
- int32_t iCount = 0;
- CXFA_Node* pNode = m_pPsMapNode->GetNodeItem(XFA_NODEITEM_FirstChild);
- for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) {
- iCount++;
- }
- return iCount;
-}
-FX_BOOL CXFA_FFConfigAcc::GetFontInfo(int32_t index,
- CFX_WideString& wsFontFamily,
- CFX_WideString& wsPsName,
- FX_BOOL bBold,
- FX_BOOL bItalic) {
- if (index < 0 || index >= CountChildren()) {
- return FALSE;
- }
- CXFA_Node* pFontNode = m_pPsMapNode->GetChild(index, XFA_ELEMENT_Font);
- if (pFontNode == NULL) {
- return FALSE;
- }
- wsFontFamily.Empty();
- wsPsName.Empty();
- bBold = FALSE;
- bItalic = FALSE;
- pFontNode->GetAttribute(XFA_ATTRIBUTE_Typeface, wsFontFamily);
- pFontNode->GetAttribute(XFA_ATTRIBUTE_PsName, wsPsName);
- CFX_WideString wsValue;
- pFontNode->GetAttribute(XFA_ATTRIBUTE_Weight, wsValue);
- wsValue.MakeLower();
- if (wsValue == FX_WSTRC(L"bold")) {
- bBold = TRUE;
- }
- pFontNode->GetAttribute(XFA_ATTRIBUTE_Posture, wsValue);
- wsValue.MakeLower();
- if (wsValue == FX_WSTRC(L"italic")) {
- bItalic = TRUE;
- }
- return wsFontFamily.GetLength() > 0;
-}
-void CXFA_FFConfigAcc::GetPsMapNode() {
- if (m_pNode == NULL) {
- return;
- }
- m_pPsMapNode = m_pNode->GetChild(0, XFA_ELEMENT_PsMap);
-}
diff --git a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.h b/xfa/src/fxfa/src/app/xfa_ffConfigAcc.h
deleted file mode 100644
index c26876a4e3..0000000000
--- a/xfa/src/fxfa/src/app/xfa_ffConfigAcc.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_SRC_FXFA_SRC_APP_XFA_FFCONFIGACC_H_
-#define XFA_SRC_FXFA_SRC_APP_XFA_FFCONFIGACC_H_
-
-class CXFA_FFConfigAcc {
- public:
- CXFA_FFConfigAcc(CXFA_Node* pNode);
- ~CXFA_FFConfigAcc();
- int32_t CountChildren();
- FX_BOOL GetFontInfo(int32_t index,
- CFX_WideString& wsFontFamily,
- CFX_WideString& wsPsName,
- FX_BOOL bBold,
- FX_BOOL bItalic);
-
- private:
- void GetPsMapNode();
- CXFA_Node* m_pNode;
- CXFA_Node* m_pPsMapNode;
-};
-
-#endif // XFA_SRC_FXFA_SRC_APP_XFA_FFCONFIGACC_H_
diff --git a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp
index e9fd220272..361f70573c 100644
--- a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp
+++ b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp
@@ -601,11 +601,9 @@ FX_BOOL CXFA_FFDateTimeEdit::LoadWidget() {
CFX_WideString wsText;
m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display);
pWidget->SetEditText(wsText);
- XFA_DATETIMETYPE eType = XFA_DATETIMETYPE_DateAndTime;
if (CXFA_Value value = m_pDataAcc->GetFormValue()) {
switch (value.GetChildValueClassID()) {
case XFA_ELEMENT_Date: {
- eType = XFA_DATETIMETYPE_Date;
if (!wsText.IsEmpty()) {
CXFA_LocaleValue lcValue = XFA_GetLocaleValue(m_pDataAcc);
CFX_Unitime date = lcValue.GetDate();
@@ -614,11 +612,7 @@ FX_BOOL CXFA_FFDateTimeEdit::LoadWidget() {
}
}
} break;
- case XFA_ELEMENT_Time:
- eType = XFA_DATETIMETYPE_Time;
- break;
default:
- eType = XFA_DATETIMETYPE_DateAndTime;
break;
}
}
diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp
index 3474e0aa90..c5d175abec 100644
--- a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp
+++ b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp
@@ -7,7 +7,6 @@
#include <algorithm>
#include "xfa/src/foxitlib.h"
-#include "xfa/src/fxfa/src/app/xfa_ffConfigAcc.h"
#include "xfa/src/fxfa/src/app/xfa_ffapp.h"
#include "xfa/src/fxfa/src/app/xfa_ffdoc.h"
#include "xfa/src/fxfa/src/app/xfa_fontmgr.h"
@@ -1759,20 +1758,17 @@ CXFA_DefFontMgr::~CXFA_DefFontMgr() {
}
m_CacheFonts.RemoveAll();
}
+
IFX_Font* CXFA_DefFontMgr::GetFont(IXFA_Doc* hDoc,
const CFX_WideStringC& wsFontFamily,
FX_DWORD dwFontStyles,
FX_WORD wCodePage) {
CFX_WideString wsFontName = wsFontFamily;
- IFX_FontMgr* pFDEFontMgr = ((CXFA_FFDoc*)hDoc)->GetApp()->GetFDEFontMgr();
- const XFA_FONTINFO* pCurFont = NULL;
- FX_BOOL bGetFontInfo = TRUE;
- IFX_Font* pFont = pFDEFontMgr->LoadFont((const FX_WCHAR*)wsFontName,
- dwFontStyles, wCodePage);
- if (!pFont && hDoc) {
- if (bGetFontInfo) {
- pCurFont = XFA_GetFontINFOByFontName(wsFontName);
- }
+ IFX_FontMgr* pFDEFontMgr =
+ static_cast<CXFA_FFDoc*>(hDoc)->GetApp()->GetFDEFontMgr();
+ IFX_Font* pFont = pFDEFontMgr->LoadFont(wsFontName, dwFontStyles, wCodePage);
+ if (!pFont) {
+ const XFA_FONTINFO* pCurFont = XFA_GetFontINFOByFontName(wsFontName);
if (pCurFont && pCurFont->pReplaceFont) {
FX_DWORD dwStyle = 0;
if (dwFontStyles & FX_FONTSTYLE_Bold) {
@@ -1806,6 +1802,7 @@ IFX_Font* CXFA_DefFontMgr::GetFont(IXFA_Doc* hDoc,
}
return pFont;
}
+
IFX_Font* CXFA_DefFontMgr::GetDefaultFont(IXFA_Doc* hDoc,
const CFX_WideStringC& wsFontFamily,
FX_DWORD dwFontStyles,
diff --git a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp
index 132f8a39c2..69fbbfb2de 100644
--- a/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/src/fxfa/src/fm2js/xfa_fm2jscontext.cpp
@@ -4058,7 +4058,7 @@ void CXFA_FM2JSContext::EncodeURL(const CFX_ByteStringC& szURLString,
strEncode[1] = strCode[iIndex];
strEncode[2] = strCode[ch - iIndex * 16];
wsResultBuf << FX_WSTRC(strEncode);
- } else if ((ch >= 0x0 && ch <= 0x1f) || ch == 0x7f) {
+ } else if (ch <= 0x1f || ch == 0x7f) {
int32_t iIndex = ch / 16;
strEncode[1] = strCode[iIndex];
strEncode[2] = strCode[ch - iIndex * 16];
@@ -4718,16 +4718,13 @@ void CXFA_FM2JSContext::Replace(FXJSE_HOBJECT hThis,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
if ((argc == 2) || (argc == 3)) {
- FX_BOOL bFlags = FALSE;
FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
FXJSE_HVALUE argTwo = GetSimpleHValue(hThis, args, 1);
FXJSE_HVALUE argThree = 0;
CFX_ByteString oneString;
CFX_ByteString twoString;
CFX_ByteString threeString;
- if ((HValueIsNull(hThis, argOne)) || (HValueIsNull(hThis, argTwo))) {
- bFlags = TRUE;
- } else {
+ if (!HValueIsNull(hThis, argOne) && !HValueIsNull(hThis, argTwo)) {
HValueToUTF8String(argOne, oneString);
HValueToUTF8String(argTwo, twoString);
}
@@ -4995,7 +4992,6 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis,
CFXJSE_Arguments& args) {
int32_t argc = args.GetLength();
if ((argc == 3) || (argc == 4)) {
- FX_BOOL bFlags = FALSE;
CFX_ByteString sourceString;
CFX_ByteString insertString;
int32_t iLength = 0;
@@ -5005,10 +5001,8 @@ void CXFA_FM2JSContext::Stuff(FXJSE_HOBJECT hThis,
FXJSE_HVALUE startValue = GetSimpleHValue(hThis, args, 1);
FXJSE_HVALUE deleteValue = GetSimpleHValue(hThis, args, 2);
FXJSE_HVALUE insertValue = 0;
- if ((FXJSE_Value_IsNull(sourceValue)) || (FXJSE_Value_IsNull(startValue)) ||
- (FXJSE_Value_IsNull(deleteValue))) {
- bFlags = TRUE;
- } else {
+ if (!FXJSE_Value_IsNull(sourceValue) && !FXJSE_Value_IsNull(startValue) &&
+ !FXJSE_Value_IsNull(deleteValue)) {
HValueToUTF8String(sourceValue, sourceString);
iLength = sourceString.GetLength();
iStart = (int32_t)HValueToFloat(hThis, startValue);
diff --git a/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp b/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp
index 7e812860bf..c2a53ac70e 100644
--- a/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_document_datamerger_imp.cpp
@@ -141,11 +141,10 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode,
int32_t iSize = wsSelTextArray.GetSize();
if (iSize >= 1) {
CXFA_Node* pValue = NULL;
- IFDE_XMLNode* pValueXMLNode = NULL;
for (int32_t i = 0; i < iSize; i++) {
pValue = pDataNode->CreateSamePacketNode(XFA_ELEMENT_DataValue);
pValue->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"value"));
- pValueXMLNode = pValue->CreateXMLMappingNode();
+ pValue->CreateXMLMappingNode();
pDataNode->InsertChild(pValue);
pValue->SetCData(XFA_ATTRIBUTE_Value, wsSelTextArray[i]);
}
@@ -170,7 +169,6 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode,
break;
case XFA_ELEMENT_ExclGroup: {
CXFA_Node* pChecked = NULL;
- XFA_ELEMENT eValueType = XFA_ELEMENT_UNKNOWN;
CXFA_Node* pChild = pFormNode->GetNodeItem(XFA_NODEITEM_FirstChild);
for (; pChild; pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling)) {
if (pChild->GetClassID() != XFA_ELEMENT_Field) {
@@ -196,7 +194,6 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode,
CFX_WideString wsContent;
if (pText->TryContent(wsContent) && (wsContent == wsValue)) {
pChecked = pChild;
- eValueType = pText->GetClassID();
wsFormatedValue = wsValue;
pDataNode->SetAttributeValue(wsValue, wsFormatedValue);
pFormNode->SetCData(XFA_ATTRIBUTE_Value, wsContent);
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
index 4627c4c555..e1282c1f9e 100644
--- a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
@@ -1384,16 +1384,13 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) {
FX_FLOAT fContentCalculatedWidth = 0, fContentCalculatedHeight = 0;
CXFA_Node* pMarginNode =
m_pFormNode->GetFirstChildByClass(XFA_ELEMENT_Margin);
- FX_FLOAT fLeftInset = 0, fTopInset = 0, fRightInset = 0, fBottomInset = 0;
+ FX_FLOAT fLeftInset = 0;
+ FX_FLOAT fRightInset = 0;
if (pMarginNode) {
fLeftInset =
pMarginNode->GetMeasure(XFA_ATTRIBUTE_LeftInset).ToUnit(XFA_UNIT_Pt);
- fTopInset =
- pMarginNode->GetMeasure(XFA_ATTRIBUTE_TopInset).ToUnit(XFA_UNIT_Pt);
fRightInset =
pMarginNode->GetMeasure(XFA_ATTRIBUTE_RightInset).ToUnit(XFA_UNIT_Pt);
- fBottomInset =
- pMarginNode->GetMeasure(XFA_ATTRIBUTE_BottomInset).ToUnit(XFA_UNIT_Pt);
}
FX_FLOAT fContentWidthLimit =
bContainerWidthAutoSize ? XFA_LAYOUT_FLOAT_MAX
@@ -1711,16 +1708,13 @@ static void XFA_ItemLayoutProcessor_AddLeaderAfterSplit(
XFA_ItemLayoutProcessor_UpdatePendedItemLayout(pProcessor, pLeaderLayoutItem);
CXFA_Node* pMarginNode =
pProcessor->m_pFormNode->GetFirstChildByClass(XFA_ELEMENT_Margin);
- FX_FLOAT fLeftInset = 0, fTopInset = 0, fRightInset = 0, fBottomInset = 0;
+ FX_FLOAT fLeftInset = 0;
+ FX_FLOAT fRightInset = 0;
if (pMarginNode) {
fLeftInset =
pMarginNode->GetMeasure(XFA_ATTRIBUTE_LeftInset).ToUnit(XFA_UNIT_Pt);
- fTopInset =
- pMarginNode->GetMeasure(XFA_ATTRIBUTE_TopInset).ToUnit(XFA_UNIT_Pt);
fRightInset =
pMarginNode->GetMeasure(XFA_ATTRIBUTE_RightInset).ToUnit(XFA_UNIT_Pt);
- fBottomInset =
- pMarginNode->GetMeasure(XFA_ATTRIBUTE_BottomInset).ToUnit(XFA_UNIT_Pt);
}
FX_FLOAT fHeight = pLeaderLayoutItem->m_sSize.y;
for (CXFA_ContentLayoutItem* pChildItem =
@@ -2510,7 +2504,6 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
}
} break;
case XFA_ItemLayoutProcessorStages_BreakAfter: {
- XFA_ItemLayoutProcessorResult eResult;
CXFA_Node *pLeaderNode = NULL, *pTrailerNode = NULL;
FX_BOOL bCreatePage = FALSE;
if (bUseBreakControl && m_pPageMgr &&
@@ -2524,7 +2517,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer(
#ifndef _XFA_LAYOUTITEM_ProcessCACHE_
pProcessor->m_pPageMgrCreateItem = m_pPageMgrCreateItem;
#endif
- eResult = XFA_ItemLayoutProcessor_InsertFlowedItem(
+ XFA_ItemLayoutProcessor_InsertFlowedItem(
this, pProcessor, bContainerWidthAutoSize,
bContainerHeightAutoSize, fContainerHeight, eFlowStrategy,
uCurHAlignState, rgCurLineLayoutItems, FALSE,
diff --git a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp
index cef42f8ba5..acbbaa754b 100644
--- a/xfa/src/fxfa/src/parser/xfa_object_imp.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_object_imp.cpp
@@ -2948,14 +2948,11 @@ static void XFA_ScriptInstanceManager_ReorderDataNodes(CXFA_NodeSet& sSet1,
pDualNodeArray->firstNodeList, rgNodeArray1, rgIdxArray1);
XFA_ScriptInstanceManager_ReorderDataNodes_SortNodeArrayByDocumentIdx(
pDualNodeArray->secondNodeList, rgNodeArray2, rgIdxArray2);
- int32_t iLimit;
CXFA_Node *pParentNode = NULL, *pBeforeNode = NULL;
if (bInsertBefore) {
- iLimit = rgIdxArray2[0];
pBeforeNode = rgNodeArray2[0];
pParentNode = pBeforeNode->GetNodeItem(XFA_NODEITEM_Parent);
} else {
- iLimit = rgIdxArray2[rgIdxArray2.GetSize() - 1];
CXFA_Node* pLastNode = rgNodeArray2[rgIdxArray2.GetSize() - 1];
pParentNode = pLastNode->GetNodeItem(XFA_NODEITEM_Parent);
pBeforeNode = pLastNode->GetNodeItem(XFA_NODEITEM_NextSibling);