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

Unified Diff: core/fxge/ge/fx_ge_ps.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/ge/fx_ge_device.cpp ('k') | core/fxge/include/fx_ge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/ge/fx_ge_ps.cpp
diff --git a/core/fxge/ge/fx_ge_ps.cpp b/core/fxge/ge/fx_ge_ps.cpp
index 98253336a15c6ad30fd2de43c3a3e3c7d6b20e40..b112cf363047b8f69172965cc4c1adb755da7364 100644
--- a/core/fxge/ge/fx_ge_ps.cpp
+++ b/core/fxge/ge/fx_ge_ps.cpp
@@ -77,19 +77,25 @@ void CFX_PSRenderer::SaveState() {
OUTPUT_PS("q\n");
m_ClipBoxStack.Add(m_ClipBox);
}
-void CFX_PSRenderer::RestoreState(FX_BOOL bKeepSaved) {
+
+void CFX_PSRenderer::RestoreState(bool bKeepSaved) {
StartRendering();
if (bKeepSaved) {
OUTPUT_PS("Q\nq\n");
} else {
OUTPUT_PS("Q\n");
}
- m_bColorSet = m_bGraphStateSet = FALSE;
- m_ClipBox = m_ClipBoxStack.GetAt(m_ClipBoxStack.GetSize() - 1);
- if (!bKeepSaved) {
- m_ClipBoxStack.RemoveAt(m_ClipBoxStack.GetSize() - 1);
- }
+ m_bColorSet = FALSE;
+ m_bGraphStateSet = FALSE;
+ int size = m_ClipBoxStack.GetSize();
+ if (!size)
+ return;
+
+ m_ClipBox = m_ClipBoxStack.GetAt(size - 1);
+ if (!bKeepSaved)
+ m_ClipBoxStack.RemoveAt(size - 1);
}
+
void CFX_PSRenderer::OutputPath(const CFX_PathData* pPathData,
const CFX_Matrix* pObject2Device) {
int nPoints = pPathData->GetPointCount();
« no previous file with comments | « core/fxge/ge/fx_ge_device.cpp ('k') | core/fxge/include/fx_ge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698