summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/PWL_Wnd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_Wnd.cpp')
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
index d3b3b9b754..8fd7b16212 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
@@ -247,8 +247,8 @@ void CPWL_Wnd::InvalidateFocusHandler(IPWL_FocusHandler* handler) {
}
void CPWL_Wnd::InvalidateProvider(IPWL_Provider* provider) {
- if (m_sPrivateParam.pProvider == provider)
- m_sPrivateParam.pProvider = nullptr;
+ if (m_sPrivateParam.pProvider.Get() == provider)
+ m_sPrivateParam.pProvider.Reset();
}
void CPWL_Wnd::Destroy() {
@@ -268,7 +268,7 @@ void CPWL_Wnd::Destroy() {
m_bCreated = false;
}
DestroyMsgControl();
- FXSYS_memset(&m_sPrivateParam, 0, sizeof(PWL_CREATEPARAM));
+ m_sPrivateParam.Reset();
m_Children.clear();
m_pVScrollBar = nullptr;
}
@@ -399,8 +399,10 @@ void CPWL_Wnd::InvalidateRect(CFX_FloatRect* pRect) {
rcWin.bottom += PWL_INVALIDATE_INFLATE;
if (CFX_SystemHandler* pSH = GetSystemHandler()) {
- if (CPDFSDK_Widget* widget = m_sPrivateParam.pAttachedWidget)
+ if (CPDFSDK_Widget* widget = static_cast<CPDFSDK_Widget*>(
+ m_sPrivateParam.pAttachedWidget.Get())) {
pSH->InvalidateRect(widget, rcWin);
+ }
}
}
}
@@ -800,7 +802,7 @@ IPWL_FocusHandler* CPWL_Wnd::GetFocusHandler() const {
}
IPWL_Provider* CPWL_Wnd::GetProvider() const {
- return m_sPrivateParam.pProvider;
+ return m_sPrivateParam.pProvider.Get();
}
IPVT_FontMap* CPWL_Wnd::GetFontMap() const {
@@ -845,7 +847,6 @@ CFX_Matrix CPWL_Wnd::GetWindowMatrix() const {
CFX_Matrix mt = GetChildToRoot();
if (IPWL_Provider* pProvider = GetProvider())
mt.Concat(pProvider->GetWindowMatrix(GetAttachedData()));
-
return mt;
}