mirror of
https://github.com/qpdf/qpdf.git
synced 2024-06-03 19:00:51 +00:00
fix many typos in comments and strings
git-svn-id: svn+q:///qpdf/trunk@651 71b93d88-0707-0410-a8cf-f5a4172ac649
This commit is contained in:
parent
0b2288c19d
commit
91cb7c0a58
|
@ -1,5 +1,7 @@
|
||||||
2009-02-20 Jay Berkenbilt <ejb@ql.org>
|
2009-02-20 Jay Berkenbilt <ejb@ql.org>
|
||||||
|
|
||||||
|
* Fix many typos in comments and strings.
|
||||||
|
|
||||||
* qpdf/qpdf.cc: in --check mode, if there are warnings but no
|
* qpdf/qpdf.cc: in --check mode, if there are warnings but no
|
||||||
errors, exit with a status of 3.
|
errors, exit with a status of 3.
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
// The client is required to call finish() before destroying a
|
// The client is required to call finish() before destroying a
|
||||||
// Pipeline in order to avoid loss of data. A Pipeline class should
|
// Pipeline in order to avoid loss of data. A Pipeline class should
|
||||||
// not throw an exception in the destructor if this hasn't been done
|
// not throw an exception in the destructor if this hasn't been done
|
||||||
// though since doing so causes too mcuh trouble when deleting
|
// though since doing so causes too much trouble when deleting
|
||||||
// pipelines during error conditions.
|
// pipelines during error conditions.
|
||||||
//
|
//
|
||||||
// Some pipelines are resuable (i.e., you can call write() after
|
// Some pipelines are reusable (i.e., you can call write() after
|
||||||
// calling finish() and can call finish() multiple times) while others
|
// calling finish() and can call finish() multiple times) while others
|
||||||
// are not. It is up to the caller to use a pipeline according to its
|
// are not. It is up to the caller to use a pipeline according to its
|
||||||
// own restrictions.
|
// own restrictions.
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// accumulated so far. getBuffer() may be called only after calling
|
// accumulated so far. getBuffer() may be called only after calling
|
||||||
// finish() and before calling any subsequent write(). At that point,
|
// finish() and before calling any subsequent write(). At that point,
|
||||||
// a dynamically allocated Buffer object is returned and the internal
|
// a dynamically allocated Buffer object is returned and the internal
|
||||||
// buffer is reset. The caller is responseible for deleting the
|
// buffer is reset. The caller is responsible for deleting the
|
||||||
// returned Buffer.
|
// returned Buffer.
|
||||||
//
|
//
|
||||||
// For this pipeline, "next" may be null. If a next pointer is
|
// For this pipeline, "next" may be null. If a next pointer is
|
||||||
|
|
|
@ -47,7 +47,7 @@ class QPDF
|
||||||
void setIgnoreXRefStreams(bool);
|
void setIgnoreXRefStreams(bool);
|
||||||
|
|
||||||
// By default, any warnings are issued to stderr as they are
|
// By default, any warnings are issued to stderr as they are
|
||||||
// encountered. If this is called with a true value, reporitng of
|
// encountered. If this is called with a true value, reporting of
|
||||||
// warnings is suppressed. You may still retrieve warnings by
|
// warnings is suppressed. You may still retrieve warnings by
|
||||||
// calling getWarnings.
|
// calling getWarnings.
|
||||||
void setSuppressWarnings(bool);
|
void setSuppressWarnings(bool);
|
||||||
|
|
|
@ -190,7 +190,7 @@ class QPDFWriter
|
||||||
|
|
||||||
// Calls finish on the current pipeline and pops the pipeline
|
// Calls finish on the current pipeline and pops the pipeline
|
||||||
// stack until the top of stack is a previous active top of stack,
|
// stack until the top of stack is a previous active top of stack,
|
||||||
// and restores the pipeline to that point. Deletes any piplines
|
// and restores the pipeline to that point. Deletes any pipelines
|
||||||
// that it pops. If the bp argument is non-null and any of the
|
// that it pops. If the bp argument is non-null and any of the
|
||||||
// stack items are of type Pl_Buffer, the buffer is retrieved.
|
// stack items are of type Pl_Buffer, the buffer is retrieved.
|
||||||
void popPipelineStack(PointerHolder<Buffer>* bp = 0);
|
void popPipelineStack(PointerHolder<Buffer>* bp = 0);
|
||||||
|
|
|
@ -58,7 +58,7 @@ Pl_QPDFTokenizer::processChar(char ch)
|
||||||
{
|
{
|
||||||
if (this->pass_through)
|
if (this->pass_through)
|
||||||
{
|
{
|
||||||
// We're not noramlizing anymore -- just write this without
|
// We're not normalizing anymore -- just write this without
|
||||||
// looking at it.
|
// looking at it.
|
||||||
writeNext(&ch, 1);
|
writeNext(&ch, 1);
|
||||||
return;
|
return;
|
||||||
|
@ -79,12 +79,12 @@ Pl_QPDFTokenizer::processChar(char ch)
|
||||||
{
|
{
|
||||||
// Uh oh.... we're not sophisticated enough to handle
|
// Uh oh.... we're not sophisticated enough to handle
|
||||||
// inline images safely. We'd have to to set up all the
|
// inline images safely. We'd have to to set up all the
|
||||||
// filters and pipe the iamge data through it until the
|
// filters and pipe the image data through it until the
|
||||||
// filtered output was the right size for an image of the
|
// filtered output was the right size for an image of the
|
||||||
// specified dimensions. Then we'd either have to write
|
// specified dimensions. Then we'd either have to write
|
||||||
// out raw image data or continue to write filtered data,
|
// out raw image data or continue to write filtered data,
|
||||||
// resuming normalization when we get to the end.
|
// resuming normalization when we get to the end.
|
||||||
// Insetad, for now, we'll just turn off noramlization for
|
// Instead, for now, we'll just turn off normalization for
|
||||||
// the remainder of this stream.
|
// the remainder of this stream.
|
||||||
this->pass_through = true;
|
this->pass_through = true;
|
||||||
if (this->unread_char)
|
if (this->unread_char)
|
||||||
|
|
|
@ -465,7 +465,7 @@ QPDF::reconstruct_xref(QPDFExc& e)
|
||||||
// streams.
|
// streams.
|
||||||
|
|
||||||
throw QPDFExc(this->file.getName() + ": unable to find trailer "
|
throw QPDFExc(this->file.getName() + ": unable to find trailer "
|
||||||
"dictionary while recovering damanged file");
|
"dictionary while recovering damaged file");
|
||||||
}
|
}
|
||||||
|
|
||||||
// We could iterate through the objects looking for streams and
|
// We could iterate through the objects looking for streams and
|
||||||
|
|
|
@ -186,7 +186,7 @@ QPDFObjectHandle::getRealValue()
|
||||||
return dynamic_cast<QPDF_Real*>(obj.getPointer())->getVal();
|
return dynamic_cast<QPDF_Real*>(obj.getPointer())->getVal();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Name acessors
|
// Name accessors
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
QPDFObjectHandle::getName()
|
QPDFObjectHandle::getName()
|
||||||
|
@ -211,7 +211,7 @@ QPDFObjectHandle::getUTF8Value()
|
||||||
return dynamic_cast<QPDF_String*>(obj.getPointer())->getUTF8Val();
|
return dynamic_cast<QPDF_String*>(obj.getPointer())->getUTF8Val();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Array acessors
|
// Array accessors
|
||||||
|
|
||||||
int
|
int
|
||||||
QPDFObjectHandle::getArrayNItems()
|
QPDFObjectHandle::getArrayNItems()
|
||||||
|
@ -236,7 +236,7 @@ QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const& item)
|
||||||
return dynamic_cast<QPDF_Array*>(obj.getPointer())->setItem(n, item);
|
return dynamic_cast<QPDF_Array*>(obj.getPointer())->setItem(n, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dictionary accesors
|
// Dictionary accessors
|
||||||
|
|
||||||
bool
|
bool
|
||||||
QPDFObjectHandle::hasKey(std::string const& key)
|
QPDFObjectHandle::hasKey(std::string const& key)
|
||||||
|
@ -323,7 +323,7 @@ QPDFObjectHandle::getPageImages()
|
||||||
// value is null or an empty dictionary, you are supposed to walk
|
// value is null or an empty dictionary, you are supposed to walk
|
||||||
// up the page tree until you find a /Resources dictionary. As of
|
// up the page tree until you find a /Resources dictionary. As of
|
||||||
// this writing, I don't have any test files that use inherited
|
// this writing, I don't have any test files that use inherited
|
||||||
// resources, and hand-generating one won't be a good test beacuse
|
// resources, and hand-generating one won't be a good test because
|
||||||
// any mistakes in my understanding would be present in both the
|
// any mistakes in my understanding would be present in both the
|
||||||
// code and the test file.
|
// code and the test file.
|
||||||
|
|
||||||
|
|
|
@ -259,7 +259,7 @@ QPDFTokenizer::presentCharacter(char ch)
|
||||||
{
|
{
|
||||||
if (strchr(" \t\n\v\f\r()<>[]{}/%", ch) != 0)
|
if (strchr(" \t\n\v\f\r()<>[]{}/%", ch) != 0)
|
||||||
{
|
{
|
||||||
// A C-loacle whitespace character or delimiter terminates
|
// A C-locale whitespace character or delimiter terminates
|
||||||
// token. It is important to unread the whitespace
|
// token. It is important to unread the whitespace
|
||||||
// character even though it is ignored since it may be the
|
// character even though it is ignored since it may be the
|
||||||
// newline after a stream keyword. Removing it here could
|
// newline after a stream keyword. Removing it here could
|
||||||
|
|
|
@ -160,7 +160,7 @@ QPDFWriter::setR3EncryptionParameters(
|
||||||
// None
|
// None
|
||||||
// Only Document Assembly
|
// Only Document Assembly
|
||||||
// Only Form Field Fill-in or Signing
|
// Only Form Field Fill-in or Signing
|
||||||
// Comment AUthoring, Form Field Fill-in or Signing
|
// Comment Authoring, Form Field Fill-in or Signing
|
||||||
// General Editing, Comment and Form Field Authoring
|
// General Editing, Comment and Form Field Authoring
|
||||||
|
|
||||||
// Allowed printing menu:
|
// Allowed printing menu:
|
||||||
|
@ -197,7 +197,7 @@ QPDFWriter::setR3EncryptionParameters(
|
||||||
switch (modify)
|
switch (modify)
|
||||||
{
|
{
|
||||||
case r3m_none:
|
case r3m_none:
|
||||||
clear.insert(11); // document essembly
|
clear.insert(11); // document assembly
|
||||||
|
|
||||||
case r3m_assembly:
|
case r3m_assembly:
|
||||||
clear.insert(9); // filling in form fields
|
clear.insert(9); // filling in form fields
|
||||||
|
@ -226,7 +226,7 @@ QPDFWriter::setEncryptionParameters(
|
||||||
// PDF specification refers to bits with the low bit numbered 1.
|
// PDF specification refers to bits with the low bit numbered 1.
|
||||||
// We have to convert this into a bit field.
|
// We have to convert this into a bit field.
|
||||||
|
|
||||||
// Specification always requirse bits 1 and 2 to be cleared.
|
// Specification always requires bits 1 and 2 to be cleared.
|
||||||
bits_to_clear.insert(1);
|
bits_to_clear.insert(1);
|
||||||
bits_to_clear.insert(2);
|
bits_to_clear.insert(2);
|
||||||
|
|
||||||
|
@ -754,7 +754,7 @@ QPDFWriter::unparseObject(QPDFObjectHandle object, int level,
|
||||||
{
|
{
|
||||||
// Don't filter if the stream is already compressed with
|
// Don't filter if the stream is already compressed with
|
||||||
// FlateDecode. We don't want to make it worse by getting
|
// FlateDecode. We don't want to make it worse by getting
|
||||||
// rid of a predictor or otherwising messing with it. We
|
// rid of a predictor or otherwise messing with it. We
|
||||||
// should also avoid messing with anything that's
|
// should also avoid messing with anything that's
|
||||||
// compressed with a lossy compression scheme, but we
|
// compressed with a lossy compression scheme, but we
|
||||||
// don't support any of those right now.
|
// don't support any of those right now.
|
||||||
|
|
|
@ -22,7 +22,7 @@ QPDF_Name::normalizeName(std::string const& name)
|
||||||
for (unsigned int i = 1; i < name.length(); ++i)
|
for (unsigned int i = 1; i < name.length(); ++i)
|
||||||
{
|
{
|
||||||
char ch = name[i];
|
char ch = name[i];
|
||||||
// Don't use locale/ctype here; follow PDF spec guidlines.
|
// Don't use locale/ctype here; follow PDF spec guidelines.
|
||||||
if (strchr("#()<>[]{}/%", ch) || (ch < 33) || (ch > 126))
|
if (strchr("#()<>[]{}/%", ch) || (ch < 33) || (ch > 126))
|
||||||
{
|
{
|
||||||
sprintf(num, "#%02x", (unsigned char) ch);
|
sprintf(num, "#%02x", (unsigned char) ch);
|
||||||
|
|
|
@ -2083,7 +2083,7 @@ QPDF::generateHintStream(std::map<int, QPDFXRefEntry> const& xref,
|
||||||
calculateHOutline(xref, lengths, obj_renumber);
|
calculateHOutline(xref, lengths, obj_renumber);
|
||||||
|
|
||||||
// Write the hint stream itself into a compressed memory buffer.
|
// Write the hint stream itself into a compressed memory buffer.
|
||||||
// Write through a couter so we can get offsets.
|
// Write through a counter so we can get offsets.
|
||||||
Pl_Buffer hint_stream("hint stream");
|
Pl_Buffer hint_stream("hint stream");
|
||||||
Pl_Flate f("compress hint stream", &hint_stream, Pl_Flate::a_deflate);
|
Pl_Flate f("compress hint stream", &hint_stream, Pl_Flate::a_deflate);
|
||||||
Pl_Count c("count", &f);
|
Pl_Count c("count", &f);
|
||||||
|
|
|
@ -152,7 +152,7 @@ QUtil::toUTF8(unsigned long uval)
|
||||||
// '0' for its (n+1)th highest bit where n is the total number of
|
// '0' for its (n+1)th highest bit where n is the total number of
|
||||||
// bytes required. Subsequent bytes start with '10' and have the
|
// bytes required. Subsequent bytes start with '10' and have the
|
||||||
// remaining 6 bits free for encoding. For example, an 11-bit
|
// remaining 6 bits free for encoding. For example, an 11-bit
|
||||||
// unicode value can be stored in two bytes where the first is
|
// Unicode value can be stored in two bytes where the first is
|
||||||
// 110zzzzz, the second is 10zzzzzz, and the z's represent the
|
// 110zzzzz, the second is 10zzzzzz, and the z's represent the
|
||||||
// remaining bits.
|
// remaining bits.
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ class MD5
|
||||||
// testing)
|
// testing)
|
||||||
void print();
|
void print();
|
||||||
|
|
||||||
// returns the digest as a hexademical string
|
// returns the digest as a hexadecimal string
|
||||||
std::string unparse();
|
std::string unparse();
|
||||||
|
|
||||||
// Convenience functions
|
// Convenience functions
|
||||||
|
|
|
@ -23,7 +23,7 @@ class QPDF_Dictionary: public QPDFObject
|
||||||
QPDFObjectHandle getKey(std::string const&);
|
QPDFObjectHandle getKey(std::string const&);
|
||||||
std::set<std::string> getKeys();
|
std::set<std::string> getKeys();
|
||||||
|
|
||||||
// Repalce value of key, adding it if it does not exist
|
// Replace value of key, adding it if it does not exist
|
||||||
void replaceKey(std::string const& key, QPDFObjectHandle const&);
|
void replaceKey(std::string const& key, QPDFObjectHandle const&);
|
||||||
// Remove key, doing nothing if key does not exist
|
// Remove key, doing nothing if key does not exist
|
||||||
void removeKey(std::string const& key);
|
void removeKey(std::string const& key);
|
||||||
|
|
|
@ -107,7 +107,7 @@ Values for stream data options:\n\
|
||||||
preserve leave all stream data as is\n\
|
preserve leave all stream data as is\n\
|
||||||
uncompress uncompress stream data when possible\n\
|
uncompress uncompress stream data when possible\n\
|
||||||
\n\
|
\n\
|
||||||
Values for object strea mode:\n\
|
Values for object stream mode:\n\
|
||||||
\n\
|
\n\
|
||||||
preserve preserve original object streams (default)\n\
|
preserve preserve original object streams (default)\n\
|
||||||
disable don't write any object streams\n\
|
disable don't write any object streams\n\
|
||||||
|
@ -142,8 +142,11 @@ stream data to be written to standard output.\n\
|
||||||
If --filtered-stream-data is given and --normalize-content=y is also\n\
|
If --filtered-stream-data is given and --normalize-content=y is also\n\
|
||||||
given, qpdf will attempt to normalize the stream data as if it is a\n\
|
given, qpdf will attempt to normalize the stream data as if it is a\n\
|
||||||
page content stream. This attempt will be made even if it is not a\n\
|
page content stream. This attempt will be made even if it is not a\n\
|
||||||
page content stream, in which case it will produce unusuable results.\n\
|
page content stream, in which case it will produce unusable results.\n\
|
||||||
\n\
|
\n\
|
||||||
|
Ordinarily, qpdf exits with a status of 0 on success or a status of 2\n\
|
||||||
|
if any errors occurred. In --check mode, if there were warnings but not\n\
|
||||||
|
errors, qpdf exits with a status of 3.\n\
|
||||||
\n";
|
\n";
|
||||||
|
|
||||||
void usage(std::string const& msg)
|
void usage(std::string const& msg)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
WARNING: bad7.pdf: offset 0: file is damaged
|
WARNING: bad7.pdf: offset 0: file is damaged
|
||||||
WARNING: bad7.pdf: offset 698: expected trailer dictionary
|
WARNING: bad7.pdf: offset 698: expected trailer dictionary
|
||||||
WARNING: Attempting to reconstruct cross-reference table
|
WARNING: Attempting to reconstruct cross-reference table
|
||||||
bad7.pdf: unable to find trailer dictionary while recovering damanged file
|
bad7.pdf: unable to find trailer dictionary while recovering damaged file
|
||||||
|
|
Loading…
Reference in New Issue
Block a user