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

Unified Diff: core/fxge/agg/fx_agg_driver.cpp

Issue 2009803003: Remove default argument from RestoreState() methods. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 7 months 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 | « core/fxge/agg/fx_agg_driver.h ('k') | core/fxge/apple/apple_int.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/agg/fx_agg_driver.cpp
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index 6726877d992c283064f0e4816f82e7119b4fd86e..86326f6caf738c5666250b24fb8eb79703e631ef 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -284,21 +284,21 @@ void CFX_AggDeviceDriver::SaveState() {
m_StateStack.Add(pClip);
}
-void CFX_AggDeviceDriver::RestoreState(FX_BOOL bKeepSaved) {
- if (m_StateStack.GetSize() == 0) {
- delete m_pClipRgn;
- m_pClipRgn = nullptr;
- return;
- }
- CFX_ClipRgn* pSavedClip = m_StateStack[m_StateStack.GetSize() - 1];
+void CFX_AggDeviceDriver::RestoreState(bool bKeepSaved) {
delete m_pClipRgn;
m_pClipRgn = nullptr;
+
+ int size = m_StateStack.GetSize();
+ if (!size)
+ return;
+
+ CFX_ClipRgn* pSavedClip = m_StateStack[size - 1];
if (bKeepSaved) {
if (pSavedClip) {
m_pClipRgn = new CFX_ClipRgn(*pSavedClip);
}
} else {
- m_StateStack.RemoveAt(m_StateStack.GetSize() - 1);
+ m_StateStack.RemoveAt(size - 1);
m_pClipRgn = pSavedClip;
}
}
« no previous file with comments | « core/fxge/agg/fx_agg_driver.h ('k') | core/fxge/apple/apple_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698