Encapsulate CFWL_ThemeBackground::m_pPath
Change-Id: Ied95e7dfe247f727c3057354b0bfb32ba03e29f8
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/96491
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index ce2f507..06bb3cd 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -343,7 +343,7 @@
CFWL_ThemeBackground param(this, pGraphics);
param.m_matrix = mtMatrix;
param.m_iPart = CFWL_ThemePart::Part::kBackground;
- param.m_pPath = &path;
+ param.SetPath(&path);
GetThemeProvider()->DrawBackground(param);
}
@@ -366,7 +366,7 @@
CFWL_ThemeBackground param(this, pGraphics);
param.m_matrix = mtMatrix;
param.m_iPart = CFWL_ThemePart::Part::kCombTextLine;
- param.m_pPath = &path;
+ param.SetPath(&path);
GetThemeProvider()->DrawBackground(param);
}
pGraphics->RestoreGraphState();
diff --git a/xfa/fwl/cfwl_themebackground.h b/xfa/fwl/cfwl_themebackground.h
index 56c2972..bb34f01 100644
--- a/xfa/fwl/cfwl_themebackground.h
+++ b/xfa/fwl/cfwl_themebackground.h
@@ -19,10 +19,11 @@
~CFWL_ThemeBackground();
CFGAS_GEGraphics* GetGraphics() const { return m_pGraphics.Get(); }
-
- UnownedPtr<const CFGAS_GEPath> m_pPath;
+ const CFGAS_GEPath* GetPath() const { return m_pPath.Get(); }
+ void SetPath(const CFGAS_GEPath* pPath) { m_pPath = pPath; }
private:
+ UnownedPtr<const CFGAS_GEPath> m_pPath;
UnownedPtr<CFGAS_GEGraphics> const m_pGraphics;
};
diff --git a/xfa/fwl/theme/cfwl_edittp.cpp b/xfa/fwl/theme/cfwl_edittp.cpp
index 39c65f9..b4e0de6 100644
--- a/xfa/fwl/theme/cfwl_edittp.cpp
+++ b/xfa/fwl/theme/cfwl_edittp.cpp
@@ -24,15 +24,14 @@
break;
}
case CFWL_ThemePart::Part::kBackground: {
- if (pParams.m_pPath) {
+ const CFGAS_GEPath* pParamsPath = pParams.GetPath();
+ if (pParamsPath) {
CFGAS_GEGraphics* pGraphics = pParams.GetGraphics();
pGraphics->SaveGraphState();
pGraphics->SetFillColor(CFGAS_GEColor(FWLTHEME_COLOR_BKSelected));
- if (pParams.m_pPath) {
- pGraphics->FillPath(*pParams.m_pPath,
- CFX_FillRenderOptions::FillType::kWinding,
- pParams.m_matrix);
- }
+ pGraphics->FillPath(*pParamsPath,
+ CFX_FillRenderOptions::FillType::kWinding,
+ pParams.m_matrix);
pGraphics->RestoreGraphState();
} else {
CFGAS_GEPath path;
@@ -63,8 +62,9 @@
pWidget->GetBorderColorAndThickness(&cr, &fWidth);
pParams.GetGraphics()->SetStrokeColor(CFGAS_GEColor(cr));
pParams.GetGraphics()->SetLineWidth(fWidth);
- if (pParams.m_pPath)
- pParams.GetGraphics()->StrokePath(*pParams.m_pPath, pParams.m_matrix);
+ const CFGAS_GEPath* pParamsPath = pParams.GetPath();
+ if (pParamsPath)
+ pParams.GetGraphics()->StrokePath(*pParamsPath, pParams.m_matrix);
break;
}
default: