summaryrefslogtreecommitdiff
path: root/xfa/fxfa
diff options
context:
space:
mode:
authorJane Liu <janeliulwq@google.com>2017-08-22 10:50:06 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-22 16:42:55 +0000
commit878b27de2fa8e5bdc3b910c98846f4b43185d4aa (patch)
treef21a9528354ebf533a637f5ea0e8edaa44be7427 /xfa/fxfa
parentaac59a0e59052366e260396165a759b5b0e80188 (diff)
downloadpdfium-878b27de2fa8e5bdc3b910c98846f4b43185d4aa.tar.xz
Converted CFX_Matrix::TransformRect() to take in consts
Currently, all three of CFX_Matrix::TransformRect() take in rect values and modify them in place. This CL converts them to take in constant values and return the transformed values instead, and fixes all the call sites. Bug=pdfium:874 Change-Id: I9c274df3b14e9d88c100ba0530068e06e8fec32b Reviewed-on: https://pdfium-review.googlesource.com/11550 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
Diffstat (limited to 'xfa/fxfa')
-rw-r--r--xfa/fxfa/cxfa_fffield.cpp6
-rw-r--r--xfa/fxfa/cxfa_ffpushbutton.cpp2
-rw-r--r--xfa/fxfa/cxfa_fftext.cpp3
-rw-r--r--xfa/fxfa/cxfa_fwladapterwidgetmgr.cpp4
4 files changed, 6 insertions, 9 deletions
diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp
index 31003417a8..bfc9e4edbc 100644
--- a/xfa/fxfa/cxfa_fffield.cpp
+++ b/xfa/fxfa/cxfa_fffield.cpp
@@ -52,9 +52,7 @@ CFX_RectF CXFA_FFField::GetBBox(uint32_t dwStatus, bool bDrawFocus) {
return CFX_RectF();
}
- CFX_RectF rtBox = m_rtUI;
- GetRotateMatrix().TransformRect(rtBox);
- return rtBox;
+ return GetRotateMatrix().TransformRect(m_rtUI);
}
void CXFA_FFField::RenderWidget(CXFA_Graphics* pGS,
@@ -619,7 +617,7 @@ void CXFA_FFField::RenderCaption(CXFA_Graphics* pGS, CFX_Matrix* pMatrix) {
CFX_RenderDevice* pRenderDevice = pGS->GetRenderDevice();
CFX_Matrix mt(1, 0, 0, 1, m_rtCaption.left, m_rtCaption.top);
if (pMatrix) {
- pMatrix->TransformRect(rtClip);
+ rtClip = pMatrix->TransformRect(rtClip);
mt.Concat(*pMatrix);
}
pCapTextLayout->DrawString(pRenderDevice, mt, rtClip);
diff --git a/xfa/fxfa/cxfa_ffpushbutton.cpp b/xfa/fxfa/cxfa_ffpushbutton.cpp
index d201e42c86..63079cfaa0 100644
--- a/xfa/fxfa/cxfa_ffpushbutton.cpp
+++ b/xfa/fxfa/cxfa_ffpushbutton.cpp
@@ -176,7 +176,7 @@ void CXFA_FFPushButton::RenderHighlightCaption(CXFA_Graphics* pGS,
rtClip.Intersect(GetRectWithoutRotate());
CFX_Matrix mt(1, 0, 0, 1, m_rtCaption.left, m_rtCaption.top);
if (pMatrix) {
- pMatrix->TransformRect(rtClip);
+ rtClip = pMatrix->TransformRect(rtClip);
mt.Concat(*pMatrix);
}
diff --git a/xfa/fxfa/cxfa_fftext.cpp b/xfa/fxfa/cxfa_fftext.cpp
index 6246ec5731..274f3bfb61 100644
--- a/xfa/fxfa/cxfa_fftext.cpp
+++ b/xfa/fxfa/cxfa_fftext.cpp
@@ -61,8 +61,7 @@ void CXFA_FFText::RenderWidget(CXFA_Graphics* pGS,
}
CFX_Matrix mt(1, 0, 0, 1, rtText.left, rtText.top);
- CFX_RectF rtClip = rtText;
- mtRotate.TransformRect(rtClip);
+ CFX_RectF rtClip = mtRotate.TransformRect(rtText);
mt.Concat(mtRotate);
pTextLayout->DrawString(pRenderDevice, mt, rtClip, GetIndex());
}
diff --git a/xfa/fxfa/cxfa_fwladapterwidgetmgr.cpp b/xfa/fxfa/cxfa_fwladapterwidgetmgr.cpp
index 4dacd0300b..6fdd553712 100644
--- a/xfa/fxfa/cxfa_fwladapterwidgetmgr.cpp
+++ b/xfa/fxfa/cxfa_fwladapterwidgetmgr.cpp
@@ -30,8 +30,8 @@ bool CXFA_FWLAdapterWidgetMgr::GetPopupPos(CFWL_Widget* pWidget,
const CFX_RectF& rtAnchor,
CFX_RectF& rtPopup) {
CXFA_FFWidget* pFFWidget = pWidget->GetLayoutItem();
- CFX_RectF rtRotateAnchor(rtAnchor);
- pFFWidget->GetRotateMatrix().TransformRect(rtRotateAnchor);
+ CFX_RectF rtRotateAnchor =
+ pFFWidget->GetRotateMatrix().TransformRect(rtAnchor);
pFFWidget->GetDoc()->GetDocEnvironment()->GetPopupPos(
pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, rtPopup);
return true;