summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-25 12:03:18 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-25 19:16:31 +0000
commit797ca5cad52edde7c65da45a15216f20b1bfd8fd (patch)
tree811a96d5f505e7cff89395cea7dff89604fc9133 /xfa/fxfa/app
parent3a4c408554f2f2ffb5a143f6dadcdd528fcf106e (diff)
downloadpdfium-797ca5cad52edde7c65da45a15216f20b1bfd8fd.tar.xz
Mass conversion of all const-lifetime class members
Sed + minimal conversions to compile, including moving some constructors into the .cpp file. Any that caused ASAN issues during the tests were omitted rather than trying to resolve the underlying issue. Change-Id: I00a421f33b253eb4071ffd9af3f2922c7443b335 Reviewed-on: https://pdfium-review.googlesource.com/5891 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/app')
-rw-r--r--xfa/fxfa/app/xfa_ffcheckbutton.cpp4
-rw-r--r--xfa/fxfa/app/xfa_ffchoicelist.cpp8
-rw-r--r--xfa/fxfa/app/xfa_fffield.cpp16
-rw-r--r--xfa/fxfa/app/xfa_ffnotify.cpp6
-rw-r--r--xfa/fxfa/app/xfa_ffnotify.h2
-rw-r--r--xfa/fxfa/app/xfa_ffpushbutton.cpp4
-rw-r--r--xfa/fxfa/app/xfa_fftextedit.cpp12
-rw-r--r--xfa/fxfa/app/xfa_fwltheme.h2
8 files changed, 27 insertions, 27 deletions
diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
index 9837e0aa7b..76531cecdd 100644
--- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
@@ -320,7 +320,7 @@ void CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) {
m_pDocView->AddCalculateWidgetAcc(pFFExclGroup);
pFFExclGroup->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam);
}
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam);
} else {
SetFWLCheckState(m_pDataAcc->GetCheckState());
@@ -329,7 +329,7 @@ void CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) {
eParam.m_pTarget = pFFExclGroup;
pFFExclGroup->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam);
}
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam);
break;
}
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp
index b191f838ce..e24e7f77b7 100644
--- a/xfa/fxfa/app/xfa_ffchoicelist.cpp
+++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp
@@ -166,7 +166,7 @@ bool CXFA_FFListBox::UpdateFWLData() {
void CXFA_FFListBox::OnSelectChanged(CFWL_Widget* pWidget) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_Change;
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
m_pDataAcc->GetValue(eParam.m_wsPrevText, XFA_VALUEPICTURE_Raw);
auto* pListBox = ToListBox(m_pNormalWidget.get());
@@ -342,7 +342,7 @@ bool CXFA_FFComboBox::IsDataChanged() {
void CXFA_FFComboBox::FWLEventSelChange(CXFA_EventParam* pParam) {
pParam->m_eType = XFA_EVENT_Change;
- pParam->m_pTarget = m_pDataAcc;
+ pParam->m_pTarget = m_pDataAcc.Get();
pParam->m_wsNewText = ToComboBox(m_pNormalWidget.get())->GetEditText();
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, pParam);
}
@@ -514,14 +514,14 @@ void CXFA_FFComboBox::OnSelectChanged(CFWL_Widget* pWidget, bool bLButtonUp) {
void CXFA_FFComboBox::OnPreOpen(CFWL_Widget* pWidget) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_PreOpen;
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_PreOpen, &eParam);
}
void CXFA_FFComboBox::OnPostOpen(CFWL_Widget* pWidget) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_PostOpen;
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_PostOpen, &eParam);
}
diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp
index 186f573182..425ba30843 100644
--- a/xfa/fxfa/app/xfa_fffield.cpp
+++ b/xfa/fxfa/app/xfa_fffield.cpp
@@ -639,14 +639,14 @@ bool CXFA_FFField::ProcessCommittedData() {
return false;
m_pDocView->SetChangeMark();
- m_pDocView->AddValidateWidget(m_pDataAcc);
+ m_pDocView->AddValidateWidget(m_pDataAcc.Get());
return true;
}
int32_t CXFA_FFField::CalculateOverride() {
CXFA_WidgetAcc* pAcc = m_pDataAcc->GetExclGroup();
if (!pAcc)
- return CalculateWidgetAcc(m_pDataAcc);
+ return CalculateWidgetAcc(m_pDataAcc.Get());
if (CalculateWidgetAcc(pAcc) == 0)
return 0;
@@ -745,26 +745,26 @@ void CXFA_FFField::OnProcessMessage(CFWL_Message* pMessage) {}
void CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) {
switch (pEvent->GetType()) {
case CFWL_Event::Type::Mouse: {
- CFWL_EventMouse* event = (CFWL_EventMouse*)pEvent;
+ CFWL_EventMouse* event = static_cast<CFWL_EventMouse*>(pEvent);
if (event->m_dwCmd == FWL_MouseCommand::Enter) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_MouseEnter;
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseEnter, &eParam);
} else if (event->m_dwCmd == FWL_MouseCommand::Leave) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_MouseExit;
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseExit, &eParam);
} else if (event->m_dwCmd == FWL_MouseCommand::LeftButtonDown) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_MouseDown;
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseDown, &eParam);
} else if (event->m_dwCmd == FWL_MouseCommand::LeftButtonUp) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_MouseUp;
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseUp, &eParam);
}
break;
@@ -772,7 +772,7 @@ void CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) {
case CFWL_Event::Type::Click: {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_Click;
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam);
break;
}
diff --git a/xfa/fxfa/app/xfa_ffnotify.cpp b/xfa/fxfa/app/xfa_ffnotify.cpp
index 475fa09eda..b07b625538 100644
--- a/xfa/fxfa/app/xfa_ffnotify.cpp
+++ b/xfa/fxfa/app/xfa_ffnotify.cpp
@@ -251,7 +251,7 @@ void CXFA_FFNotify::AddCalcValidate(CXFA_Node* pNode) {
}
CXFA_FFDoc* CXFA_FFNotify::GetHDOC() {
- return m_pDoc;
+ return m_pDoc.Get();
}
IXFA_DocEnvironment* CXFA_FFNotify::GetDocEnvironment() const {
@@ -468,7 +468,7 @@ void CXFA_FFNotify::OnChildAdded(CXFA_Node* pSender) {
!(pDocView->m_bInLayoutStatus) &&
(pDocView->GetLayoutStatus() == XFA_DOCVIEW_LAYOUTSTATUS_End);
if (bLayoutReady)
- m_pDoc->GetDocEnvironment()->SetChangeMark(m_pDoc);
+ m_pDoc->GetDocEnvironment()->SetChangeMark(m_pDoc.Get());
}
void CXFA_FFNotify::OnChildRemoved() {
@@ -480,7 +480,7 @@ void CXFA_FFNotify::OnChildRemoved() {
!(pDocView->m_bInLayoutStatus) &&
(pDocView->GetLayoutStatus() == XFA_DOCVIEW_LAYOUTSTATUS_End);
if (bLayoutReady)
- m_pDoc->GetDocEnvironment()->SetChangeMark(m_pDoc);
+ m_pDoc->GetDocEnvironment()->SetChangeMark(m_pDoc.Get());
}
void CXFA_FFNotify::OnLayoutItemAdded(CXFA_LayoutProcessor* pLayout,
diff --git a/xfa/fxfa/app/xfa_ffnotify.h b/xfa/fxfa/app/xfa_ffnotify.h
index c002ed4c15..930d3b6a90 100644
--- a/xfa/fxfa/app/xfa_ffnotify.h
+++ b/xfa/fxfa/app/xfa_ffnotify.h
@@ -71,7 +71,7 @@ class CXFA_FFNotify {
void SetFocusWidgetNode(CXFA_Node* pNode);
private:
- CXFA_FFDoc* const m_pDoc;
+ CFX_UnownedPtr<CXFA_FFDoc> const m_pDoc;
};
#endif // XFA_FXFA_APP_XFA_FFNOTIFY_H_
diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp
index 9d9cf070b4..b596996b6c 100644
--- a/xfa/fxfa/app/xfa_ffpushbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp
@@ -141,7 +141,7 @@ void CXFA_FFPushButton::LoadHighlightCaption() {
if (m_pDataAcc->GetButtonRollover(wsRollover, bRichText)) {
if (!m_pRollProvider) {
m_pRollProvider = pdfium::MakeUnique<CXFA_TextProvider>(
- m_pDataAcc, XFA_TEXTPROVIDERTYPE_Rollover);
+ m_pDataAcc.Get(), XFA_TEXTPROVIDERTYPE_Rollover);
}
m_pRolloverTextLayout =
pdfium::MakeUnique<CXFA_TextLayout>(m_pRollProvider.get());
@@ -150,7 +150,7 @@ void CXFA_FFPushButton::LoadHighlightCaption() {
if (m_pDataAcc->GetButtonDown(wsDown, bRichText)) {
if (!m_pDownProvider) {
m_pDownProvider = pdfium::MakeUnique<CXFA_TextProvider>(
- m_pDataAcc, XFA_TEXTPROVIDERTYPE_Down);
+ m_pDataAcc.Get(), XFA_TEXTPROVIDERTYPE_Down);
}
m_pDownTextLayout =
pdfium::MakeUnique<CXFA_TextLayout>(m_pDownProvider.get());
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index a1030f538a..41305efcc8 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -307,7 +307,7 @@ void CXFA_FFTextEdit::OnTextChanged(CFWL_Widget* pWidget,
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_Change;
eParam.m_wsChange = wsChanged;
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
eParam.m_wsPrevText = wsPrevText;
CFWL_Edit* pEdit = static_cast<CFWL_Edit*>(m_pNormalWidget.get());
if (m_pDataAcc->GetUIType() == XFA_Element::DateTimeEdit) {
@@ -328,7 +328,7 @@ void CXFA_FFTextEdit::OnTextChanged(CFWL_Widget* pWidget,
void CXFA_FFTextEdit::OnTextFull(CFWL_Widget* pWidget) {
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_Full;
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Full, &eParam);
}
@@ -450,7 +450,7 @@ bool CXFA_FFNumericEdit::OnValidate(CFWL_Widget* pWidget,
m_pDataAcc->GetFracDigits(iFracs);
CFX_WideString wsFormat;
- CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(m_pDataAcc);
+ CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(m_pDataAcc.Get());
widgetValue.GetNumbericFormat(wsFormat, iLeads, iFracs);
return widgetValue.ValidateNumericTemp(wsText, wsFormat,
m_pDataAcc->GetLocal());
@@ -545,7 +545,7 @@ bool CXFA_FFDateTimeEdit::LoadWidget() {
switch (value.GetChildValueClassID()) {
case XFA_Element::Date: {
if (!wsText.IsEmpty()) {
- CXFA_LocaleValue lcValue = XFA_GetLocaleValue(m_pDataAcc);
+ CXFA_LocaleValue lcValue = XFA_GetLocaleValue(m_pDataAcc.Get());
CFX_DateTime date = lcValue.GetDate();
if (date.IsSet())
pWidget->SetCurSel(date.GetYear(), date.GetMonth(), date.GetDay());
@@ -647,7 +647,7 @@ bool CXFA_FFDateTimeEdit::UpdateFWLData() {
auto* normalWidget = static_cast<CFWL_DateTimePicker*>(m_pNormalWidget.get());
normalWidget->SetEditText(wsText);
if (IsFocused() && !wsText.IsEmpty()) {
- CXFA_LocaleValue lcValue = XFA_GetLocaleValue(m_pDataAcc);
+ CXFA_LocaleValue lcValue = XFA_GetLocaleValue(m_pDataAcc.Get());
CFX_DateTime date = lcValue.GetDate();
if (lcValue.IsValid()) {
if (date.IsSet())
@@ -690,7 +690,7 @@ void CXFA_FFDateTimeEdit::OnSelectChanged(CFWL_Widget* pWidget,
CXFA_EventParam eParam;
eParam.m_eType = XFA_EVENT_Change;
- eParam.m_pTarget = m_pDataAcc;
+ eParam.m_pTarget = m_pDataAcc.Get();
m_pDataAcc->GetValue(eParam.m_wsNewText, XFA_VALUEPICTURE_Raw);
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam);
}
diff --git a/xfa/fxfa/app/xfa_fwltheme.h b/xfa/fxfa/app/xfa_fwltheme.h
index 33ea8e80a5..7563c69ed9 100644
--- a/xfa/fxfa/app/xfa_fwltheme.h
+++ b/xfa/fxfa/app/xfa_fwltheme.h
@@ -61,7 +61,7 @@ class CXFA_FWLTheme final : public IFWL_ThemeProvider {
std::unique_ptr<CFDE_TextOut> m_pTextOut;
CFX_RetainPtr<CFGAS_GEFont> m_pCalendarFont;
CFX_WideString m_wsResource;
- CXFA_FFApp* const m_pApp;
+ CFX_UnownedPtr<CXFA_FFApp> const m_pApp;
CFX_RectF m_Rect;
};