mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
draw AP widget to js, separation of AP widgets drawing
This commit is contained in:
@ -31,6 +31,7 @@
|
||||
#include "UTF8.h"
|
||||
#include "PDF417Barcode.h"
|
||||
#include "AcroForm.h"
|
||||
#include "GlobalParams.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
@ -561,7 +562,10 @@ void AcroForm::scanField(Object *fieldRef) {
|
||||
void AcroForm::draw(int pageNum, Gfx *gfx, GBool printing) {
|
||||
int i;
|
||||
|
||||
int formField = globalParams->getDrawFormField();
|
||||
for (i = 0; i < fields->getLength(); ++i) {
|
||||
if (formField >= 0 && formField != i)
|
||||
continue;
|
||||
((AcroFormField *)fields->get(i))->draw(pageNum, gfx, printing);
|
||||
}
|
||||
}
|
||||
|
||||
@ -754,6 +754,7 @@ GlobalParams::GlobalParams(const char *cfgFileName) {
|
||||
printCommands = gFalse;
|
||||
errQuiet = gFalse;
|
||||
debugLogFile = NULL;
|
||||
drawFormField = -1;
|
||||
|
||||
cidToUnicodeCache = new CharCodeToUnicodeCache(cidToUnicodeCacheSize);
|
||||
unicodeToUnicodeCache =
|
||||
@ -3168,7 +3169,14 @@ GBool GlobalParams::getDrawContent() {
|
||||
return draw;
|
||||
}
|
||||
|
||||
int GlobalParams::getDrawFormField() {
|
||||
int formField;
|
||||
|
||||
lockGlobalParams;
|
||||
formField = drawFormField;
|
||||
unlockGlobalParams;
|
||||
return formField;
|
||||
}
|
||||
|
||||
GString *GlobalParams::getPaperColor() {
|
||||
GString *s;
|
||||
@ -3732,6 +3740,12 @@ void GlobalParams::setDrawContent(GBool draw) {
|
||||
unlockGlobalParams;
|
||||
}
|
||||
|
||||
void GlobalParams::setDrawFormField(int formField) {
|
||||
lockGlobalParams;
|
||||
drawFormField = formField;
|
||||
unlockGlobalParams;
|
||||
}
|
||||
|
||||
void GlobalParams::setOverprintPreview(GBool preview) {
|
||||
lockGlobalParams;
|
||||
overprintPreview = preview;
|
||||
|
||||
@ -326,6 +326,7 @@ public:
|
||||
GBool getDrawAnnotations();
|
||||
GBool getDrawFormFields();
|
||||
GBool getDrawContent();
|
||||
int getDrawFormField();
|
||||
GBool getOverprintPreview() { return overprintPreview; }
|
||||
GString *getPaperColor();
|
||||
GString *getMatteColor();
|
||||
@ -395,6 +396,7 @@ public:
|
||||
void setDrawAnnotations(GBool draw);
|
||||
void setDrawFormFields(GBool draw);
|
||||
void setDrawContent(GBool draw);
|
||||
void setDrawFormField(int formField);
|
||||
void setOverprintPreview(GBool preview);
|
||||
void setMapNumericCharNames(GBool map);
|
||||
void setMapUnknownCharNames(GBool map);
|
||||
@ -594,6 +596,7 @@ private:
|
||||
GBool printCommands; // print the drawing commands
|
||||
GBool errQuiet; // suppress error messages?
|
||||
GString *debugLogFile; // path for debug log file
|
||||
int drawFormField;
|
||||
|
||||
CharCodeToUnicodeCache *cidToUnicodeCache;
|
||||
CharCodeToUnicodeCache *unicodeToUnicodeCache;
|
||||
|
||||
Reference in New Issue
Block a user