summaryrefslogtreecommitdiff
path: root/xfa/src/fxfa
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-25 11:17:16 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-25 11:17:16 -0800
commitea1ae9915d1702ab62af520b1487f70a553fc6ae (patch)
tree2fb77cd9537fa4e5a9b02895343d5abe20b51356 /xfa/src/fxfa
parentf014768833406e68234eeb4f8ba94cabf766dff3 (diff)
downloadpdfium-ea1ae9915d1702ab62af520b1487f70a553fc6ae.tar.xz
Make CFX_PSVTemplate simpler.
Add default ctor so we don't have to zero these out. Also, make CFX_VTemplate simpler. Also, remove the Set() method in favor of assignment. Also, remove CFX_FloatPoint define. Also, remove unused (and wrong) CFX_VTemplate methods. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1733523003 .
Diffstat (limited to 'xfa/src/fxfa')
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp8
-rw-r--r--xfa/src/fxfa/src/app/xfa_fffield.cpp19
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp3
-rw-r--r--xfa/src/fxfa/src/app/xfa_fftextedit.cpp8
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffwidget.cpp23
-rw-r--r--xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp10
-rw-r--r--xfa/src/fxfa/src/app/xfa_fwltheme.cpp1
-rw-r--r--xfa/src/fxfa/src/app/xfa_textlayout.cpp15
-rw-r--r--xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp19
-rw-r--r--xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp56
10 files changed, 73 insertions, 89 deletions
diff --git a/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp b/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp
index 67b5cc3110..2d68887d0e 100644
--- a/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffchoicelist.cpp
@@ -293,12 +293,10 @@ void CXFA_FFComboBox::UpdateWidgetProperty() {
FX_BOOL CXFA_FFComboBox::OnRButtonUp(FX_DWORD dwFlags,
FX_FLOAT fx,
FX_FLOAT fy) {
- if (!CXFA_FFField::OnRButtonUp(dwFlags, fx, fy)) {
+ if (!CXFA_FFField::OnRButtonUp(dwFlags, fx, fy))
return FALSE;
- }
- CFX_PointF pt;
- pt.Set(fx, fy);
- GetDoc()->GetDocProvider()->PopupMenu(this, pt, NULL);
+
+ GetDoc()->GetDocProvider()->PopupMenu(this, CFX_PointF(fx, fy), nullptr);
return TRUE;
}
FX_BOOL CXFA_FFComboBox::OnKillFocus(CXFA_FFWidget* pNewWidget) {
diff --git a/xfa/src/fxfa/src/app/xfa_fffield.cpp b/xfa/src/fxfa/src/app/xfa_fffield.cpp
index 63fb9f07d8..7616dcbdb3 100644
--- a/xfa/src/fxfa/src/app/xfa_fffield.cpp
+++ b/xfa/src/fxfa/src/app/xfa_fffield.cpp
@@ -217,11 +217,8 @@ void CXFA_FFField::CapPlacement() {
CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout();
if (fCapReserve <= 0 && pCapTextLayout) {
CFX_SizeF size;
- size.Set(0, 0);
CFX_SizeF minSize;
- minSize.Set(0, 0);
CFX_SizeF maxSize;
- maxSize.Set(0, 0);
pCapTextLayout->CalcSize(minSize, maxSize, size);
if (iCapPlacement == XFA_ATTRIBUTEENUM_Top ||
iCapPlacement == XFA_ATTRIBUTEENUM_Bottom) {
@@ -646,16 +643,14 @@ FX_BOOL CXFA_FFField::PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) {
}
void CXFA_FFField::LayoutCaption() {
CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout();
- if (!pCapTextLayout) {
+ if (!pCapTextLayout)
return;
- }
- CFX_SizeF size;
- size.Set(m_rtCaption.width, m_rtCaption.height);
+
FX_FLOAT fHeight = 0;
- pCapTextLayout->Layout(size, &fHeight);
- if (m_rtCaption.height < fHeight) {
+ pCapTextLayout->Layout(CFX_SizeF(m_rtCaption.width, m_rtCaption.height),
+ &fHeight);
+ if (m_rtCaption.height < fHeight)
m_rtCaption.height = fHeight;
- }
}
void CXFA_FFField::RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix) {
CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout();
@@ -665,9 +660,7 @@ void CXFA_FFField::RenderCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix) {
CXFA_Caption caption = m_pDataAcc->GetCaption();
if (caption && caption.GetPresence() == XFA_ATTRIBUTEENUM_Visible) {
if (!pCapTextLayout->IsLoaded()) {
- CFX_SizeF size;
- size.Set(m_rtCaption.width, m_rtCaption.height);
- pCapTextLayout->Layout(size);
+ pCapTextLayout->Layout(CFX_SizeF(m_rtCaption.width, m_rtCaption.height));
}
CFX_RectF rtWidget;
GetRectWithoutRotate(rtWidget);
diff --git a/xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp b/xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp
index 3b5a462188..e6efa13b86 100644
--- a/xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffpushbutton.cpp
@@ -162,8 +162,7 @@ void CXFA_FFPushButton::LoadHighlightCaption() {
}
}
void CXFA_FFPushButton::LayoutHighlightCaption() {
- CFX_SizeF sz;
- sz.Set(m_rtCaption.width, m_rtCaption.height);
+ CFX_SizeF sz(m_rtCaption.width, m_rtCaption.height);
LayoutCaption();
if (m_pRolloverTextLayout) {
m_pRolloverTextLayout->Layout(sz);
diff --git a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp
index cb907b5dff..e9fd220272 100644
--- a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp
+++ b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp
@@ -140,12 +140,10 @@ FX_BOOL CXFA_FFTextEdit::OnRButtonDown(FX_DWORD dwFlags,
FX_BOOL CXFA_FFTextEdit::OnRButtonUp(FX_DWORD dwFlags,
FX_FLOAT fx,
FX_FLOAT fy) {
- if (!CXFA_FFField::OnRButtonUp(dwFlags, fx, fy)) {
+ if (!CXFA_FFField::OnRButtonUp(dwFlags, fx, fy))
return FALSE;
- }
- CFX_PointF pt;
- pt.Set(fx, fy);
- GetDoc()->GetDocProvider()->PopupMenu(this, pt, NULL);
+
+ GetDoc()->GetDocProvider()->PopupMenu(this, CFX_PointF(fx, fy), nullptr);
return TRUE;
}
FX_BOOL CXFA_FFTextEdit::OnSetFocus(CXFA_FFWidget* pOldWidget) {
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidget.cpp b/xfa/src/fxfa/src/app/xfa_ffwidget.cpp
index 0f48d5d4a5..47042f71af 100644
--- a/xfa/src/fxfa/src/app/xfa_ffwidget.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffwidget.cpp
@@ -1510,26 +1510,27 @@ static void XFA_BOX_Fill_Linear(CXFA_Box box,
CFX_RectF rtFill,
CFX_Matrix* pMatrix) {
CXFA_Fill fill = box.GetFill();
- FX_ARGB crStart, crEnd;
- crStart = fill.GetColor();
+ FX_ARGB crStart = fill.GetColor();
+ FX_ARGB crEnd;
int32_t iType = fill.GetLinear(crEnd);
- CFX_PointF ptStart, ptEnd;
+ CFX_PointF ptStart;
+ CFX_PointF ptEnd;
switch (iType) {
case XFA_ATTRIBUTEENUM_ToRight:
- ptStart.Set(rtFill.left, rtFill.top);
- ptEnd.Set(rtFill.right(), rtFill.top);
+ ptStart = CFX_PointF(rtFill.left, rtFill.top);
+ ptEnd = CFX_PointF(rtFill.right(), rtFill.top);
break;
case XFA_ATTRIBUTEENUM_ToBottom:
- ptStart.Set(rtFill.left, rtFill.top);
- ptEnd.Set(rtFill.left, rtFill.bottom());
+ ptStart = CFX_PointF(rtFill.left, rtFill.top);
+ ptEnd = CFX_PointF(rtFill.left, rtFill.bottom());
break;
case XFA_ATTRIBUTEENUM_ToLeft:
- ptStart.Set(rtFill.right(), rtFill.top);
- ptEnd.Set(rtFill.left, rtFill.top);
+ ptStart = CFX_PointF(rtFill.right(), rtFill.top);
+ ptEnd = CFX_PointF(rtFill.left, rtFill.top);
break;
case XFA_ATTRIBUTEENUM_ToTop:
- ptStart.Set(rtFill.left, rtFill.bottom());
- ptEnd.Set(rtFill.left, rtFill.top);
+ ptStart = CFX_PointF(rtFill.left, rtFill.bottom());
+ ptEnd = CFX_PointF(rtFill.left, rtFill.top);
break;
default:
break;
diff --git a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp
index 0178a281e7..a51017bce1 100644
--- a/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffwidgetacc.cpp
@@ -778,7 +778,6 @@ void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) {
szCap.x = fCapReserve;
}
CFX_SizeF minSize;
- minSize.Set(0, 0);
pCapTextLayout->CalcSize(minSize, szCap, szCap);
if (bReserveExit) {
bVert ? szCap.y = fCapReserve : szCap.x = fCapReserve;
@@ -814,7 +813,6 @@ void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) {
}
FX_BOOL CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF& size) {
CFX_SizeF szCap;
- szCap.Set(0, 0);
CalcCaptionSize(szCap);
CFX_RectF rtUIMargin;
GetUIMargin(rtUIMargin);
@@ -913,7 +911,6 @@ FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) {
if (size.x > 0) {
CFX_SizeF szOrz = size;
CFX_SizeF szCap;
- szCap.Set(0, 0);
CalcCaptionSize(szCap);
FX_BOOL bCapExit = szCap.x > 0.01 && szCap.y > 0.01;
int32_t iCapPlacement = XFA_ATTRIBUTEENUM_Unknown;
@@ -975,7 +972,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateImageAutoSize(CFX_SizeF& size) {
if (!GetImageImage()) {
LoadImageImage();
}
- size.Set(0, 0);
+ size.clear();
if (CFX_DIBitmap* pBitmap = GetImageImage()) {
CFX_RectF rtImage, rtFit;
rtImage.Set(0, 0, 0, 0);
@@ -1006,7 +1003,7 @@ FX_BOOL CXFA_WidgetAcc::CalculateImageEditAutoSize(CFX_SizeF& size) {
if (!GetImageEditImage()) {
LoadImageEditImage();
}
- size.Set(0, 0);
+ size.clear();
if (CFX_DIBitmap* pBitmap = GetImageEditImage()) {
CFX_RectF rtImage, rtFit;
rtImage.Set(0, 0, 0, 0);
@@ -1150,8 +1147,7 @@ void CXFA_WidgetAcc::StartWidgetLayout(FX_FLOAT& fCalcWidth,
void CXFA_WidgetAcc::CalculateAccWidthAndHeight(XFA_ELEMENT eUIType,
FX_FLOAT& fWidth,
FX_FLOAT& fCalcHeight) {
- CFX_SizeF sz;
- sz.Set(fWidth, m_pLayoutData->m_fWidgetHeight);
+ CFX_SizeF sz(fWidth, m_pLayoutData->m_fWidgetHeight);
switch (eUIType) {
case XFA_ELEMENT_Barcode:
case XFA_ELEMENT_ChoiceList:
diff --git a/xfa/src/fxfa/src/app/xfa_fwltheme.cpp b/xfa/src/fxfa/src/app/xfa_fwltheme.cpp
index 2d497a29b8..fe4a2af9c9 100644
--- a/xfa/src/fxfa/src/app/xfa_fwltheme.cpp
+++ b/xfa/src/fxfa/src/app/xfa_fwltheme.cpp
@@ -36,7 +36,6 @@ CXFA_FWLTheme::CXFA_FWLTheme(CXFA_FFApp* pApp) : m_pApp(pApp) {
m_fCapacity = 0;
m_pCalendarFont = NULL;
m_Rect.Set(0, 0, 0, 0);
- m_SizeAboveBelow.Set(0, 0);
m_pCheckBoxTP = new CXFA_FWLCheckBoxTP;
m_pListBoxTP = new CFWL_ListBoxTP;
m_pPictureBoxTP = new CFWL_PictureBoxTP;
diff --git a/xfa/src/fxfa/src/app/xfa_textlayout.cpp b/xfa/src/fxfa/src/app/xfa_textlayout.cpp
index d1495c4add..1c1dad7e42 100644
--- a/xfa/src/fxfa/src/app/xfa_textlayout.cpp
+++ b/xfa/src/fxfa/src/app/xfa_textlayout.cpp
@@ -897,9 +897,8 @@ FX_FLOAT CXFA_TextLayout::GetLayoutHeight() {
}
int32_t iCount = m_pLoader->m_lineHeights.GetSize();
if (iCount == 0 && m_pLoader->m_fWidth > 0) {
- CFX_SizeF szMax, szDef;
- szMax.Set(m_pLoader->m_fWidth, m_pLoader->m_fHeight);
- szDef.Set(0, 0);
+ CFX_SizeF szMax(m_pLoader->m_fWidth, m_pLoader->m_fHeight);
+ CFX_SizeF szDef;
m_pLoader->m_bSaveLineHeight = TRUE;
m_pLoader->m_fLastPos = 0;
CalcSize(szMax, szMax, szDef);
@@ -928,9 +927,8 @@ FX_FLOAT CXFA_TextLayout::StartLayout(FX_FLOAT fWidth) {
}
m_pLoader->m_fWidth = fWidth;
if (fWidth < 0) {
- CFX_SizeF szMax, szDef;
- szMax.Set(0, 0);
- szDef.Set(0, 0);
+ CFX_SizeF szMax;
+ CFX_SizeF szDef;
m_pLoader->m_bSaveLineHeight = TRUE;
m_pLoader->m_fLastPos = 0;
CalcSize(szMax, szMax, szDef);
@@ -1045,7 +1043,7 @@ FX_BOOL CXFA_TextLayout::CalcSize(const CFX_SizeF& minSize,
delete m_pTabstopContext;
m_pTabstopContext = NULL;
}
- defaultSize.Set(m_fMaxWidth, fLinePos);
+ defaultSize = CFX_SizeF(m_fMaxWidth, fLinePos);
return TRUE;
}
FX_BOOL CXFA_TextLayout::Layout(const CFX_SizeF& size, FX_FLOAT* fHeight) {
@@ -1082,8 +1080,7 @@ FX_BOOL CXFA_TextLayout::Layout(int32_t iBlock) {
m_iLines = 0;
FX_FLOAT fLinePos = 0;
CXFA_Node* pNode = NULL;
- CFX_SizeF szText;
- szText.Set(m_pLoader->m_fWidth, m_pLoader->m_fHeight);
+ CFX_SizeF szText(m_pLoader->m_fWidth, m_pLoader->m_fHeight);
int32_t iCount = m_Blocks.GetSize();
int32_t iBlocksHeightCount = m_pLoader->m_BlocksHeight.GetSize();
iBlocksHeightCount /= 2;
diff --git a/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp b/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp
index 71fc72ce5a..b9b37ad1e1 100644
--- a/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_document_layout_imp.cpp
@@ -96,7 +96,7 @@ int32_t CXFA_LayoutProcessor::DoLayout(IFX_Pause* pPause) {
CXFA_ContentLayoutItem* pLayoutItem =
m_pRootItemLayoutProcessor->ExtractLayoutItem();
if (pLayoutItem) {
- pLayoutItem->m_sPos.Set(fPosX, fPosY);
+ pLayoutItem->m_sPos = CFX_PointF(fPosX, fPosY);
}
m_pLayoutPageMgr->SubmitContentItem(pLayoutItem, eStatus);
} while (eStatus != XFA_ItemLayoutProcessorResult_Done &&
@@ -186,15 +186,16 @@ int32_t CXFA_ContainerLayoutItem::GetPageIndex() const {
->GetPageIndex(this);
}
void CXFA_ContainerLayoutItem::GetPageSize(CFX_SizeF& size) {
- size.Set(0, 0);
+ size.clear();
CXFA_Node* pMedium = m_pFormNode->GetFirstChildByClass(XFA_ELEMENT_Medium);
- if (pMedium) {
- size.x = pMedium->GetMeasure(XFA_ATTRIBUTE_Short).ToUnit(XFA_UNIT_Pt);
- size.y = pMedium->GetMeasure(XFA_ATTRIBUTE_Long).ToUnit(XFA_UNIT_Pt);
- if (pMedium->GetEnum(XFA_ATTRIBUTE_Orientation) ==
- XFA_ATTRIBUTEENUM_Landscape) {
- size.Set(size.y, size.x);
- }
+ if (!pMedium)
+ return;
+
+ size = CFX_SizeF(pMedium->GetMeasure(XFA_ATTRIBUTE_Short).ToUnit(XFA_UNIT_Pt),
+ pMedium->GetMeasure(XFA_ATTRIBUTE_Long).ToUnit(XFA_UNIT_Pt));
+ if (pMedium->GetEnum(XFA_ATTRIBUTE_Orientation) ==
+ XFA_ATTRIBUTEENUM_Landscape) {
+ size = CFX_SizeF(size.y, size.x);
}
}
CXFA_Node* CXFA_ContainerLayoutItem::GetMasterPage() const {
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
index be29f8322e..4627c4c555 100644
--- a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
@@ -391,17 +391,18 @@ void CXFA_LayoutItem::GetRect(CFX_RectF& rtLayout, FX_BOOL bRelative) const {
if (CXFA_Node* pMarginNode =
pLayoutItem->m_pFormNode->GetFirstChildByClass(
XFA_ELEMENT_Margin)) {
- sPos.Add(pMarginNode->GetMeasure(XFA_ATTRIBUTE_LeftInset)
- .ToUnit(XFA_UNIT_Pt),
- pMarginNode->GetMeasure(XFA_ATTRIBUTE_TopInset)
- .ToUnit(XFA_UNIT_Pt));
+ sPos += CFX_PointF(pMarginNode->GetMeasure(XFA_ATTRIBUTE_LeftInset)
+ .ToUnit(XFA_UNIT_Pt),
+ pMarginNode->GetMeasure(XFA_ATTRIBUTE_TopInset)
+ .ToUnit(XFA_UNIT_Pt));
}
} else {
if (pLayoutItem->m_pFormNode->GetClassID() == XFA_ELEMENT_ContentArea) {
- sPos.Add(pLayoutItem->m_pFormNode->GetMeasure(XFA_ATTRIBUTE_X)
- .ToUnit(XFA_UNIT_Pt),
- pLayoutItem->m_pFormNode->GetMeasure(XFA_ATTRIBUTE_Y)
- .ToUnit(XFA_UNIT_Pt));
+ sPos +=
+ CFX_PointF(pLayoutItem->m_pFormNode->GetMeasure(XFA_ATTRIBUTE_X)
+ .ToUnit(XFA_UNIT_Pt),
+ pLayoutItem->m_pFormNode->GetMeasure(XFA_ATTRIBUTE_Y)
+ .ToUnit(XFA_UNIT_Pt));
break;
} else if (pLayoutItem->m_pFormNode->GetClassID() ==
XFA_ELEMENT_PageArea) {
@@ -1283,7 +1284,7 @@ static inline void XFA_ItemLayoutProcessor_RelocateTableRowCells(
if (nOriginalColSpan == -1) {
bMetWholeRowCell = TRUE;
}
- pLayoutChild->m_sPos.Set(fCurrentColX, 0);
+ pLayoutChild->m_sPos = CFX_PointF(fCurrentColX, 0);
pLayoutChild->m_sSize.x = fColSpanWidth;
if (XFA_ItemLayoutProcessor_IsTakingSpace(pLayoutChild->m_pFormNode)) {
fCurrentColX += fColSpanWidth;
@@ -1364,7 +1365,7 @@ static inline void XFA_ItemLayoutProcessor_RelocateTableRowCells(
pLayoutRow->m_pFormNode, bContainerWidthAutoSize, fContentCalculatedWidth,
fContainerWidth, bContainerHeightAutoSize, fContentCalculatedHeight,
fContainerHeight);
- pLayoutRow->m_sSize.Set(fContainerWidth, fContainerHeight);
+ pLayoutRow->m_sSize = CFX_SizeF(fContainerWidth, fContainerHeight);
}
void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) {
if (m_pLayoutItem)
@@ -1762,10 +1763,10 @@ static FX_FLOAT XFA_ItemLayoutProcessor_InsertPendingItems(
if (pProcessor->m_PendingNodes.empty()) {
return fTotalHeight;
}
- if (pProcessor->m_pLayoutItem == NULL) {
+ if (!pProcessor->m_pLayoutItem) {
pProcessor->m_pLayoutItem =
pProcessor->CreateContentLayoutItem(pCurChildNode);
- pProcessor->m_pLayoutItem->m_sSize.Set(0, 0);
+ pProcessor->m_pLayoutItem->m_sSize.clear();
}
while (!pProcessor->m_PendingNodes.empty()) {
std::unique_ptr<CXFA_ItemLayoutProcessor> pPendingProcessor(
@@ -1793,9 +1794,9 @@ static FX_FLOAT XFA_ItemLayoutProcessor_InsertPendingItems(
FX_FLOAT CXFA_ItemLayoutProcessor::InsertKeepLayoutItems() {
FX_FLOAT fTotalHeight = 0;
if (m_arrayKeepItems.GetSize()) {
- if (m_pLayoutItem == NULL) {
+ if (!m_pLayoutItem) {
m_pLayoutItem = CreateContentLayoutItem(m_pFormNode);
- m_pLayoutItem->m_sSize.Set(0, 0);
+ m_pLayoutItem->m_sSize.clear();
}
for (int32_t iIndex = m_arrayKeepItems.GetSize() - 1; iIndex >= 0;
iIndex--) {
@@ -2787,9 +2788,10 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(
rgCurLineLayoutItems[0][j]->m_sSize.x,
rgCurLineLayoutItems[0][j]->m_sSize.y,
fAbsoluteX, fAbsoluteY);
- rgCurLineLayoutItems[0][j]->m_sPos.Set(fAbsoluteX, fAbsoluteY);
+ rgCurLineLayoutItems[0][j]->m_sPos = CFX_PointF(fAbsoluteX, fAbsoluteY);
} else {
- rgCurLineLayoutItems[0][j]->m_sPos.Set(fCurPos, fContentCurRowY);
+ rgCurLineLayoutItems[0][j]->m_sPos =
+ CFX_PointF(fCurPos, fContentCurRowY);
if (XFA_ItemLayoutProcessor_IsTakingSpace(
rgCurLineLayoutItems[0][j]->m_pFormNode)) {
fCurPos += rgCurLineLayoutItems[0][j]->m_sSize.x;
@@ -2808,9 +2810,10 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(
rgCurLineLayoutItems[1][j]->m_sSize.x,
rgCurLineLayoutItems[1][j]->m_sSize.y,
fAbsoluteX, fAbsoluteY);
- rgCurLineLayoutItems[1][j]->m_sPos.Set(fAbsoluteX, fAbsoluteY);
+ rgCurLineLayoutItems[1][j]->m_sPos = CFX_PointF(fAbsoluteX, fAbsoluteY);
} else {
- rgCurLineLayoutItems[1][j]->m_sPos.Set(fCurPos, fContentCurRowY);
+ rgCurLineLayoutItems[1][j]->m_sPos =
+ CFX_PointF(fCurPos, fContentCurRowY);
if (XFA_ItemLayoutProcessor_IsTakingSpace(
rgCurLineLayoutItems[1][j]->m_pFormNode)) {
fCurPos += rgCurLineLayoutItems[1][j]->m_sSize.x;
@@ -2827,9 +2830,10 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(
rgCurLineLayoutItems[2][j]->m_sSize.x,
rgCurLineLayoutItems[2][j]->m_sSize.y,
fAbsoluteX, fAbsoluteY);
- rgCurLineLayoutItems[2][j]->m_sPos.Set(fAbsoluteX, fAbsoluteY);
+ rgCurLineLayoutItems[2][j]->m_sPos = CFX_PointF(fAbsoluteX, fAbsoluteY);
} else {
- rgCurLineLayoutItems[2][j]->m_sPos.Set(fCurPos, fContentCurRowY);
+ rgCurLineLayoutItems[2][j]->m_sPos =
+ CFX_PointF(fCurPos, fContentCurRowY);
if (XFA_ItemLayoutProcessor_IsTakingSpace(
rgCurLineLayoutItems[2][j]->m_pFormNode)) {
fCurPos += rgCurLineLayoutItems[2][j]->m_sSize.x;
@@ -2846,7 +2850,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(
rgCurLineLayoutItems[0][j]->m_pFormNode)) {
fCurPos -= rgCurLineLayoutItems[0][j]->m_sSize.x;
}
- rgCurLineLayoutItems[0][j]->m_sPos.Set(fCurPos, fContentCurRowY);
+ rgCurLineLayoutItems[0][j]->m_sPos = CFX_PointF(fCurPos, fContentCurRowY);
m_pLayoutItem->AddChild(rgCurLineLayoutItems[0][j]);
m_fLastRowWidth = fCurPos;
}
@@ -2858,7 +2862,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(
rgCurLineLayoutItems[1][j]->m_pFormNode)) {
fCurPos -= rgCurLineLayoutItems[1][j]->m_sSize.x;
}
- rgCurLineLayoutItems[1][j]->m_sPos.Set(fCurPos, fContentCurRowY);
+ rgCurLineLayoutItems[1][j]->m_sPos = CFX_PointF(fCurPos, fContentCurRowY);
m_pLayoutItem->AddChild(rgCurLineLayoutItems[1][j]);
m_fLastRowWidth = fCurPos;
}
@@ -2868,7 +2872,7 @@ FX_BOOL CXFA_ItemLayoutProcessor::CalculateRowChildPosition(
rgCurLineLayoutItems[2][j]->m_pFormNode)) {
fCurPos -= rgCurLineLayoutItems[2][j]->m_sSize.x;
}
- rgCurLineLayoutItems[2][j]->m_sPos.Set(fCurPos, fContentCurRowY);
+ rgCurLineLayoutItems[2][j]->m_sPos = CFX_PointF(fCurPos, fContentCurRowY);
m_pLayoutItem->AddChild(rgCurLineLayoutItems[2][j]);
m_fLastRowWidth = fCurPos;
}
@@ -2990,13 +2994,11 @@ void CXFA_ItemLayoutProcessor::GetCurrentComponentSize(FX_FLOAT& fWidth,
}
void CXFA_ItemLayoutProcessor::SetCurrentComponentPos(FX_FLOAT fAbsoluteX,
FX_FLOAT fAbsoluteY) {
- ASSERT(m_pLayoutItem);
- m_pLayoutItem->m_sPos.Set(fAbsoluteX, fAbsoluteY);
+ m_pLayoutItem->m_sPos = CFX_PointF(fAbsoluteX, fAbsoluteY);
}
void CXFA_ItemLayoutProcessor::SetCurrentComponentSize(FX_FLOAT fWidth,
FX_FLOAT fHeight) {
- ASSERT(m_pLayoutItem);
- m_pLayoutItem->m_sSize.Set(fWidth, fHeight);
+ m_pLayoutItem->m_sSize = CFX_SizeF(fWidth, fHeight);
}
FX_BOOL CXFA_ItemLayoutProcessor::JudgeLeaderOrTrailerForOccur(
CXFA_Node* pFormNode) {