diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-10-18 21:39:40 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-18 21:39:40 +0000 |
commit | 0e5bab1b8402b65fa09a36a2b141bbf22291f822 (patch) | |
tree | e6d714f10fc9c552ea043073d17047f969f28f13 /fxjs/cjs_printparamsobj.h | |
parent | ae2aec8712aa4c52454737467869b9d256baa05f (diff) | |
download | pdfium-0e5bab1b8402b65fa09a36a2b141bbf22291f822.tar.xz |
Remove PrintParams object.
The only way to theoretically get one is via doc.getPrintParams(),
and it always returns in error.
Even if one were returend to JS, there aren't any methods/callbacks
to change its properties.
Even if there were methods to change its properties, the information
it stores doesn't align with what is in the JS spec for this object.
Even if it were aligned with the JS spec, the way we check for its
presence as the ninth parameter in CJS_Document::print() doesn't
match the way its use is documented in the spec as the sole
first parameter.
Instead implement the older, simpler behaviour as spec'd prior to
6.0, and toss this enhancement altogether.
Move function to check the result of ExpandKeywordParams() to
js_define.h so other files can use it. Update comment in that
file to remove reference to deprecated enum.
Expand test for API and introduce callback to log parameters.
Change-Id: I047e2be0d2afbad91d6b58c6c74bbea083fed330
Reviewed-on: https://pdfium-review.googlesource.com/c/44271
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fxjs/cjs_printparamsobj.h')
-rw-r--r-- | fxjs/cjs_printparamsobj.h | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/fxjs/cjs_printparamsobj.h b/fxjs/cjs_printparamsobj.h deleted file mode 100644 index f8b055729c..0000000000 --- a/fxjs/cjs_printparamsobj.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2017 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FXJS_CJS_PRINTPARAMSOBJ_H_ -#define FXJS_CJS_PRINTPARAMSOBJ_H_ - -#include "fxjs/cjs_object.h" - -class CJS_PrintParamsObj final : public CJS_Object { - public: - static int GetObjDefnID(); - static void DefineJSObjects(CFXJS_Engine* pEngine); - - CJS_PrintParamsObj(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime); - ~CJS_PrintParamsObj() override; - - bool GetUI() const { return bUI; } - int GetStart() const { return nStart; } - int GetEnd() const { return nEnd; } - bool GetSilent() const { return bSilent; } - bool GetShrinkToFit() const { return bShrinkToFit; } - bool GetPrintAsImage() const { return bPrintAsImage; } - bool GetReverse() const { return bReverse; } - bool GetAnnotations() const { return bAnnotations; } - - private: - static int ObjDefnID; - - bool bUI = true; - int nStart = 0; - int nEnd = 0; - bool bSilent = false; - bool bShrinkToFit = false; - bool bPrintAsImage = false; - bool bReverse = false; - bool bAnnotations = true; -}; - -#endif // FXJS_CJS_PRINTPARAMSOBJ_H_ |