Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Persch
poppler
Commits
f846c9a2
Commit
f846c9a2
authored
Nov 14, 2018
by
Albert Astals Cid
Browse files
JBIG2Stream: Move Object instead of copying it
parent
09952b05
Changes
3
Hide whitespace changes
Inline
Side-by-side
poppler/JBIG2Stream.cc
View file @
f846c9a2
...
...
@@ -1174,7 +1174,7 @@ JBIG2CodeTable::~JBIG2CodeTable() {
// JBIG2Stream
//------------------------------------------------------------------------
JBIG2Stream
::
JBIG2Stream
(
Stream
*
strA
,
Object
*
globalsStreamA
,
Object
*
globalsStreamRefA
)
:
JBIG2Stream
::
JBIG2Stream
(
Stream
*
strA
,
Object
&&
globalsStreamA
,
Object
*
globalsStreamRefA
)
:
FilterStream
(
strA
)
{
pageBitmap
=
nullptr
;
...
...
@@ -1199,8 +1199,8 @@ JBIG2Stream::JBIG2Stream(Stream *strA, Object *globalsStreamA, Object *globalsSt
huffDecoder
=
new
JBIG2HuffmanDecoder
();
mmrDecoder
=
new
JBIG2MMRDecoder
();
if
(
globalsStreamA
->
isStream
())
{
globalsStream
=
globalsStreamA
->
copy
(
);
if
(
globalsStreamA
.
isStream
())
{
globalsStream
=
std
::
move
(
globalsStreamA
);
if
(
globalsStreamRefA
->
isRef
())
globalsStreamRef
=
globalsStreamRefA
->
getRef
();
}
...
...
poppler/JBIG2Stream.h
View file @
f846c9a2
...
...
@@ -43,7 +43,7 @@ class JBIG2MMRDecoder;
class
JBIG2Stream
:
public
FilterStream
{
public:
JBIG2Stream
(
Stream
*
strA
,
Object
*
globalsStreamA
,
Object
*
globalsStreamRefA
);
JBIG2Stream
(
Stream
*
strA
,
Object
&&
globalsStreamA
,
Object
*
globalsStreamRefA
);
~
JBIG2Stream
();
StreamKind
getKind
()
override
{
return
strJBIG2
;
}
void
reset
()
override
;
...
...
poppler/Stream.cc
View file @
f846c9a2
...
...
@@ -213,7 +213,7 @@ Stream *Stream::makeFilter(const char *name, Stream *str, Object *params, int re
int
encoding
;
bool
endOfLine
,
byteAlign
,
endOfBlock
,
black
,
damagedRowsBeforeError
;
int
columns
,
rows
;
Object
globals
,
obj
;
Object
obj
;
if
(
!
strcmp
(
name
,
"ASCIIHexDecode"
)
||
!
strcmp
(
name
,
"AHx"
))
{
str
=
new
ASCIIHexStream
(
str
);
...
...
@@ -325,12 +325,13 @@ Stream *Stream::makeFilter(const char *name, Stream *str, Object *params, int re
}
str
=
new
FlateStream
(
str
,
pred
,
columns
,
colors
,
bits
);
}
else
if
(
!
strcmp
(
name
,
"JBIG2Decode"
))
{
Object
globals
;
if
(
params
->
isDict
())
{
XRef
*
xref
=
params
->
getDict
()
->
getXRef
();
obj
=
params
->
dictLookupNF
(
"JBIG2Globals"
);
globals
=
obj
.
fetch
(
xref
,
recursion
);
}
str
=
new
JBIG2Stream
(
str
,
&
globals
,
&
obj
);
str
=
new
JBIG2Stream
(
str
,
std
::
move
(
globals
)
,
&
obj
);
}
else
if
(
!
strcmp
(
name
,
"JPXDecode"
))
{
#ifdef HAVE_JPX_DECODER
str
=
new
JPXStream
(
str
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment