Commit d57ceff1 authored by Albert Astals Cid's avatar Albert Astals Cid

Gfx: Save unneeded copy() calls

parent 00843164
...@@ -4214,7 +4214,6 @@ void Gfx::doImage(Object *ref, Stream *str, bool inlineImg) { ...@@ -4214,7 +4214,6 @@ void Gfx::doImage(Object *ref, Stream *str, bool inlineImg) {
bool maskInvert; bool maskInvert;
bool maskInterpolate; bool maskInterpolate;
Stream *maskStr; Stream *maskStr;
Object obj1;
int i, n; int i, n;
// get info from the stream // get info from the stream
...@@ -4227,14 +4226,14 @@ void Gfx::doImage(Object *ref, Stream *str, bool inlineImg) { ...@@ -4227,14 +4226,14 @@ void Gfx::doImage(Object *ref, Stream *str, bool inlineImg) {
// check for optional content key // check for optional content key
if (ref) { if (ref) {
obj1 = dict->lookupNF("OC").copy(); const Object &objOC = dict->lookupNF("OC");
if (catalog->getOptContentConfig() && !catalog->getOptContentConfig()->optContentIsVisible(&obj1)) { if (catalog->getOptContentConfig() && !catalog->getOptContentConfig()->optContentIsVisible(&objOC)) {
return; return;
} }
} }
// get size // get size
obj1 = dict->lookup("Width"); Object obj1 = dict->lookup("Width");
if (obj1.isNull()) { if (obj1.isNull()) {
obj1 = dict->lookup("W"); obj1 = dict->lookup("W");
} }
...@@ -4691,8 +4690,8 @@ void Gfx::doForm(Object *str) { ...@@ -4691,8 +4690,8 @@ void Gfx::doForm(Object *str) {
// check for optional content key // check for optional content key
ocSaved = ocState; ocSaved = ocState;
obj1 = dict->lookupNF("OC").copy(); const Object &objOC = dict->lookupNF("OC");
if (catalog->getOptContentConfig() && !catalog->getOptContentConfig()->optContentIsVisible(&obj1)) { if (catalog->getOptContentConfig() && !catalog->getOptContentConfig()->optContentIsVisible(&objOC)) {
if (out->needCharCount()) { if (out->needCharCount()) {
ocState = false; ocState = false;
} else { } else {
......
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