Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Unified Diff: xfa/fwl/core/ifwl_edit.cpp

Issue 2469893004: Unify CFWL_WidgetProperties and CFWL_WidgetImpProperties. (Closed)
Patch Set: review cleanup Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/ifwl_edit.h ('k') | xfa/fwl/core/ifwl_form.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/ifwl_edit.cpp
diff --git a/xfa/fwl/core/ifwl_edit.cpp b/xfa/fwl/core/ifwl_edit.cpp
index 111df727335d2993f680991913a7d5a95cf07a47..7b3d083c3ec6c31cecfb439a2e79befe80ce7f20 100644
--- a/xfa/fwl/core/ifwl_edit.cpp
+++ b/xfa/fwl/core/ifwl_edit.cpp
@@ -53,9 +53,9 @@ void AddSquigglyPath(CFX_Path* pPathData,
} // namespace
IFWL_Edit::IFWL_Edit(const IFWL_App* app,
- const CFWL_WidgetImpProperties& properties,
+ std::unique_ptr<CFWL_WidgetProperties> properties,
IFWL_Widget* pOuter)
- : IFWL_Widget(app, properties, pOuter),
+ : IFWL_Widget(app, std::move(properties), pOuter),
m_fVAlignOffset(0.0f),
m_fScrollOffsetX(0.0f),
m_fScrollOffsetY(0.0f),
@@ -1449,13 +1449,14 @@ void IFWL_Edit::InitScrollBar(bool bVert) {
if ((bVert && m_pVertScrollBar) || (!bVert && m_pHorzScrollBar)) {
return;
}
- CFWL_WidgetImpProperties prop;
- prop.m_dwStyleExes = bVert ? FWL_STYLEEXT_SCB_Vert : FWL_STYLEEXT_SCB_Horz;
- prop.m_dwStates = FWL_WGTSTATE_Disabled | FWL_WGTSTATE_Invisible;
- prop.m_pParent = this;
- prop.m_pThemeProvider = m_pProperties->m_pThemeProvider;
- IFWL_ScrollBar* sb = new IFWL_ScrollBar(m_pOwnerApp, prop, this);
+ auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>();
+ prop->m_dwStyleExes = bVert ? FWL_STYLEEXT_SCB_Vert : FWL_STYLEEXT_SCB_Horz;
+ prop->m_dwStates = FWL_WGTSTATE_Disabled | FWL_WGTSTATE_Invisible;
+ prop->m_pParent = this;
+ prop->m_pThemeProvider = m_pProperties->m_pThemeProvider;
+
+ IFWL_ScrollBar* sb = new IFWL_ScrollBar(m_pOwnerApp, std::move(prop), this);
if (bVert)
m_pVertScrollBar.reset(sb);
else
@@ -1554,8 +1555,8 @@ bool IFWL_Edit::ValidateNumberChar(FX_WCHAR cNum) {
void IFWL_Edit::InitCaret() {
if (!m_pCaret) {
if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_InnerCaret)) {
- CFWL_WidgetImpProperties prop;
- m_pCaret.reset(new IFWL_Caret(m_pOwnerApp, prop, this));
+ m_pCaret.reset(new IFWL_Caret(
+ m_pOwnerApp, pdfium::MakeUnique<CFWL_WidgetProperties>(), this));
m_pCaret->SetParent(this);
m_pCaret->SetStates(m_pProperties->m_dwStates);
}
« no previous file with comments | « xfa/fwl/core/ifwl_edit.h ('k') | xfa/fwl/core/ifwl_form.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698