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
Masamichi Hosoda
poppler
Commits
bfc65726
Commit
bfc65726
authored
Feb 28, 2009
by
Carlos Garcia Campos
Browse files
Return an error code instead of a GBool when saving
parent
f7c88148
Changes
2
Hide whitespace changes
Inline
Side-by-side
poppler/PDFDoc.cc
View file @
bfc65726
...
...
@@ -462,14 +462,14 @@ GBool PDFDoc::isLinearized() {
return
lin
;
}
GBool
PDFDoc
::
saveAs
(
GooString
*
name
,
PDFWriteMode
mode
)
{
int
PDFDoc
::
saveAs
(
GooString
*
name
,
PDFWriteMode
mode
)
{
FILE
*
f
;
OutStream
*
outStr
;
GBool
res
;
int
res
;
if
(
!
(
f
=
fopen
(
name
->
getCString
(),
"wb"
)))
{
error
(
-
1
,
"Couldn't open file '%s'"
,
name
->
getCString
());
return
gFals
e
;
return
errOpenFil
e
;
}
outStr
=
new
FileOutStream
(
f
,
0
);
res
=
saveAs
(
outStr
,
mode
);
...
...
@@ -478,7 +478,7 @@ GBool PDFDoc::saveAs(GooString *name, PDFWriteMode mode) {
return
res
;
}
GBool
PDFDoc
::
saveAs
(
OutStream
*
outStr
,
PDFWriteMode
mode
)
{
int
PDFDoc
::
saveAs
(
OutStream
*
outStr
,
PDFWriteMode
mode
)
{
// we don't support files with Encrypt at the moment
Object
obj
;
...
...
@@ -486,7 +486,7 @@ GBool PDFDoc::saveAs(OutStream *outStr, PDFWriteMode mode) {
if
(
!
obj
.
isNull
())
{
obj
.
free
();
return
gFalse
;
return
errEncrypted
;
}
obj
.
free
();
...
...
@@ -511,17 +511,17 @@ GBool PDFDoc::saveAs(OutStream *outStr, PDFWriteMode mode) {
}
}
return
gTru
e
;
return
errNon
e
;
}
GBool
PDFDoc
::
saveWithoutChangesAs
(
GooString
*
name
)
{
int
PDFDoc
::
saveWithoutChangesAs
(
GooString
*
name
)
{
FILE
*
f
;
OutStream
*
outStr
;
GBool
res
;
int
res
;
if
(
!
(
f
=
fopen
(
name
->
getCString
(),
"wb"
)))
{
error
(
-
1
,
"Couldn't open file '%s'"
,
name
->
getCString
());
return
gFals
e
;
return
errOpenFil
e
;
}
outStr
=
new
FileOutStream
(
f
,
0
);
...
...
@@ -533,7 +533,7 @@ GBool PDFDoc::saveWithoutChangesAs(GooString *name) {
return
res
;
}
GBool
PDFDoc
::
saveWithoutChangesAs
(
OutStream
*
outStr
)
{
int
PDFDoc
::
saveWithoutChangesAs
(
OutStream
*
outStr
)
{
int
c
;
str
->
reset
();
...
...
@@ -542,7 +542,7 @@ GBool PDFDoc::saveWithoutChangesAs(OutStream *outStr) {
}
str
->
close
();
return
gTru
e
;
return
errNon
e
;
}
void
PDFDoc
::
saveIncrementalUpdate
(
OutStream
*
outStr
)
...
...
poppler/PDFDoc.h
View file @
bfc65726
...
...
@@ -197,13 +197,13 @@ public:
double
getPDFVersion
()
{
return
pdfVersion
;
}
// Save this file with another name.
GBool
saveAs
(
GooString
*
name
,
PDFWriteMode
mode
=
writeStandard
);
int
saveAs
(
GooString
*
name
,
PDFWriteMode
mode
=
writeStandard
);
// Save this file in the given output stream.
GBool
saveAs
(
OutStream
*
outStr
,
PDFWriteMode
mode
=
writeStandard
);
int
saveAs
(
OutStream
*
outStr
,
PDFWriteMode
mode
=
writeStandard
);
// Save this file with another name without saving changes
GBool
saveWithoutChangesAs
(
GooString
*
name
);
int
saveWithoutChangesAs
(
GooString
*
name
);
// Save this file in the given output stream without saving changes
GBool
saveWithoutChangesAs
(
OutStream
*
outStr
);
int
saveWithoutChangesAs
(
OutStream
*
outStr
);
// Return a pointer to the GUI (XPDFCore or WinPDFCore object).
void
*
getGUIData
()
{
return
guiData
;
}
...
...
Write
Preview
Markdown
is supported
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