Commit 281d5cbd authored by Albert Astals Cid's avatar Albert Astals Cid

Object::getName return const char instead of char

parent 8fe1a5b9
......@@ -1089,7 +1089,7 @@ GBool FormFieldButton::setState(char *state)
if (!isOn && noAllOff)
return gFalse; // Don't allow to set all radio to off
char *current = getAppearanceState();
const char *current = getAppearanceState();
GBool currentFound = gFalse, newFound = gFalse;
for (int i = 0; i < numChildren; i++) {
......
......@@ -382,7 +382,7 @@ public:
GBool setState (char *state);
GBool getState(const char *state) const;
char *getAppearanceState() { return appearanceState.isName() ? appearanceState.getName() : NULL; }
const char *getAppearanceState() const { return appearanceState.isName() ? appearanceState.getName() : nullptr; }
void fillChildrenSiblingsID () override;
......
......@@ -398,7 +398,7 @@ const GfxFont *GfxResources::lookupFont(const char *name) const {
return doLookupFont(name);
}
Object GfxResources::lookupXObject(char *name) {
Object GfxResources::lookupXObject(const char *name) {
GfxResources *resPtr;
for (resPtr = this; resPtr; resPtr = resPtr->next) {
......@@ -412,7 +412,7 @@ Object GfxResources::lookupXObject(char *name) {
return Object(objNull);
}
Object GfxResources::lookupXObjectNF(char *name) {
Object GfxResources::lookupXObjectNF(const char *name) {
GfxResources *resPtr;
for (resPtr = this; resPtr; resPtr = resPtr->next) {
......@@ -426,7 +426,7 @@ Object GfxResources::lookupXObjectNF(char *name) {
return Object(objNull);
}
Object GfxResources::lookupMarkedContentNF(char *name) {
Object GfxResources::lookupMarkedContentNF(const char *name) {
GfxResources *resPtr;
for (resPtr = this; resPtr; resPtr = resPtr->next) {
......@@ -454,7 +454,7 @@ Object GfxResources::lookupColorSpace(const char *name) {
return Object(objNull);
}
GfxPattern *GfxResources::lookupPattern(char *name, OutputDev *out, GfxState *state) {
GfxPattern *GfxResources::lookupPattern(const char *name, OutputDev *out, GfxState *state) {
GfxResources *resPtr;
GfxPattern *pattern;
......@@ -477,7 +477,7 @@ GfxPattern *GfxResources::lookupPattern(char *name, OutputDev *out, GfxState *st
return nullptr;
}
GfxShading *GfxResources::lookupShading(char *name, OutputDev *out, GfxState *state) {
GfxShading *GfxResources::lookupShading(const char *name, OutputDev *out, GfxState *state) {
GfxResources *resPtr;
GfxShading *shading;
......@@ -494,7 +494,7 @@ GfxShading *GfxResources::lookupShading(char *name, OutputDev *out, GfxState *st
return nullptr;
}
Object GfxResources::lookupGState(char *name) {
Object GfxResources::lookupGState(const char *name) {
Object obj = lookupGStateNF(name);
if (obj.isNull())
return Object(objNull);
......@@ -511,7 +511,7 @@ Object GfxResources::lookupGState(char *name) {
return obj;
}
Object GfxResources::lookupGStateNF(char *name) {
Object GfxResources::lookupGStateNF(const char *name) {
GfxResources *resPtr;
for (resPtr = this; resPtr; resPtr = resPtr->next) {
......@@ -4143,7 +4143,7 @@ void Gfx::doIncCharCount(const GooString *s) {
//------------------------------------------------------------------------
void Gfx::opXObject(Object args[], int numArgs) {
char *name;
const char *name;
if (!ocState && !out->needCharCount()) {
return;
......@@ -5031,11 +5031,11 @@ void Gfx::opBeginMarkedContent(Object args[], int numArgs) {
pushMarkedContent();
OCGs *contentConfig = catalog->getOptContentConfig();
char* name0 = args[0].getName();
const char* name0 = args[0].getName();
if ( strncmp( name0, "OC", 2) == 0 && contentConfig) {
if ( numArgs >= 2 ) {
if (args[1].isName()) {
char* name1 = args[1].getName();
const char* name1 = args[1].getName();
MarkedContentStack *mc = mcStack;
mc->kind = gfxMCOptionalContent;
Object markedContent = res->lookupMarkedContentNF( name1 );
......
......@@ -118,14 +118,14 @@ public:
GfxFont *lookupFont(const char *name);
const GfxFont *lookupFont(const char *name) const;
Object lookupXObject(char *name);
Object lookupXObjectNF(char *name);
Object lookupMarkedContentNF(char *name);
Object lookupXObject(const char *name);
Object lookupXObjectNF(const char *name);
Object lookupMarkedContentNF(const char *name);
Object lookupColorSpace(const char *name);
GfxPattern *lookupPattern(char *name, OutputDev *out, GfxState *state);
GfxShading *lookupShading(char *name, OutputDev *out, GfxState *state);
Object lookupGState(char *name);
Object lookupGStateNF(char *name);
GfxPattern *lookupPattern(const char *name, OutputDev *out, GfxState *state);
GfxShading *lookupShading(const char *name, OutputDev *out, GfxState *state);
Object lookupGState(const char *name);
Object lookupGStateNF(const char *name);
GfxResources *getNext() { return next; }
......
......@@ -871,7 +871,7 @@ const char *GfxFont::getAlternateName(const char *name) {
// Parse character names of the form 'Axx', 'xx', 'Ann', 'ABnn', or
// 'nn', where 'A' and 'B' are any letters, 'xx' is two hex digits,
// and 'nn' is decimal digits.
static GBool parseNumericName(char *s, GBool hex, unsigned int *u) {
static GBool parseNumericName(const char *s, GBool hex, unsigned int *u) {
char *endptr;
// Strip leading alpha characters.
......@@ -2528,7 +2528,7 @@ int GfxFontDict::hashFontObject(Object *obj) {
void GfxFontDict::hashFontObject1(Object *obj, FNVHash *h) {
Object obj2;
const GooString *s;
char *p;
const char *p;
double r;
int n, i;
......
......@@ -654,7 +654,7 @@ LinkMovie::LinkMovie(const Object *obj) {
tmp = obj->dictLookup("Operation");
if (tmp.isName()) {
char *name = tmp.getName();
const char *name = tmp.getName();
if (!strcmp(name, "Play")) {
operation = operationTypePlay;
......@@ -834,7 +834,7 @@ LinkOCGState::LinkOCGState(const Object *obj) {
if (stList)
stateList->append(stList);
char *name = obj2.getName();
const char *name = obj2.getName();
stList = new StateList();
stList->list = new GooList();
if (!strcmp (name, "ON")) {
......@@ -915,7 +915,7 @@ LinkHide::~LinkHide() {
// LinkUnknown
//------------------------------------------------------------------------
LinkUnknown::LinkUnknown(char *actionA) {
LinkUnknown::LinkUnknown(const char *actionA) {
action = new GooString(actionA);
}
......
......@@ -508,7 +508,7 @@ class LinkUnknown: public LinkAction {
public:
// Build a LinkUnknown with the specified action type.
LinkUnknown(char *actionA);
LinkUnknown(const char *actionA);
// Destructor.
~LinkUnknown();
......
......@@ -69,7 +69,7 @@ void MarkedContentOutputDev::endPage()
}
void MarkedContentOutputDev::beginMarkedContent(char *name, Dict *properties)
void MarkedContentOutputDev::beginMarkedContent(const char *name, Dict *properties)
{
int id = -1;
if (properties)
......
......@@ -109,7 +109,7 @@ public:
CharCode c, int nBytes,
Unicode *u, int uLen) override;
void beginMarkedContent(char *name, Dict *properties) override;
void beginMarkedContent(const char *name, Dict *properties) override;
void endMarkedContent(GfxState *state) override;
const TextSpanArray& getTextSpans() const;
......
......@@ -125,7 +125,7 @@ void MovieActivationParameters::parseMovieActivation(const Object* aDict) {
obj1 = aDict->dictLookup("Mode");
if (obj1.isName()) {
char* name = obj1.getName();
const char* name = obj1.getName();
if (!strcmp(name, "Once")) {
repeatMode = repeatModeOnce;
} else if (!strcmp(name, "Open")) {
......
......@@ -242,7 +242,7 @@ public:
// because the object it's not expected to have a NULL string.
GooString *takeString() {
OBJECT_TYPE_CHECK(objString); GooString *s = string; string = nullptr; return s; }
char *getName() const { OBJECT_TYPE_CHECK(objName); return cString; }
const char *getName() const { OBJECT_TYPE_CHECK(objName); return cString; }
Array *getArray() const { OBJECT_TYPE_CHECK(objArray); return array; }
Dict *getDict() const { OBJECT_TYPE_CHECK(objDict); return dict; }
Stream *getStream() const { OBJECT_TYPE_CHECK(objStream); return stream; }
......
......@@ -160,13 +160,13 @@ void OutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
void OutputDev::endMarkedContent(GfxState *state) {
}
void OutputDev::beginMarkedContent(char *name, Dict *properties) {
void OutputDev::beginMarkedContent(const char *name, Dict *properties) {
}
void OutputDev::markPoint(char *name) {
void OutputDev::markPoint(const char *name) {
}
void OutputDev::markPoint(char *name, Dict *properties) {
void OutputDev::markPoint(const char *name, Dict *properties) {
}
......
......@@ -309,9 +309,9 @@ public:
//----- grouping operators
virtual void endMarkedContent(GfxState *state);
virtual void beginMarkedContent(char *name, Dict *properties);
virtual void markPoint(char *name);
virtual void markPoint(char *name, Dict *properties);
virtual void beginMarkedContent(const char *name, Dict *properties);
virtual void markPoint(const char *name);
virtual void markPoint(const char *name, Dict *properties);
......
......@@ -177,7 +177,7 @@ void MediaParameters::parseMediaPlayParameters(Object* obj) {
if (tmp.isDict()) {
Object oname = tmp.dictLookup("S");
if (oname.isName()) {
char* name = oname.getName();
const char* name = oname.getName();
if (!strcmp(name, "F"))
duration = -1; // infinity
else if (!strcmp(name, "T")) {
......
......@@ -208,7 +208,7 @@ Stream *Stream::addFilters(Dict *dict, int recursion) {
return str;
}
Stream *Stream::makeFilter(char *name, Stream *str, Object *params, int recursion, Dict *dict) {
Stream *Stream::makeFilter(const char *name, Stream *str, Object *params, int recursion, Dict *dict) {
int pred; // parameters
int colors;
int bits;
......
......@@ -238,7 +238,7 @@ private:
virtual GBool hasGetChars() { return false; }
virtual int getChars(int nChars, Guchar *buffer);
Stream *makeFilter(char *name, Stream *str, Object *params, int recursion = 0, Dict *dict = nullptr);
Stream *makeFilter(const char *name, Stream *str, Object *params, int recursion = 0, Dict *dict = nullptr);
int ref; // reference count
#ifdef MULTITHREADED
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment