diff --git a/ChangeLog b/ChangeLog index db68a815..a1eff198 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-02-20 Jay Berkenbilt + * Fix many typos in comments and strings. + * qpdf/qpdf.cc: in --check mode, if there are warnings but no errors, exit with a status of 3. diff --git a/include/qpdf/Pipeline.hh b/include/qpdf/Pipeline.hh index cfc00471..d925d9c6 100644 --- a/include/qpdf/Pipeline.hh +++ b/include/qpdf/Pipeline.hh @@ -19,10 +19,10 @@ // The client is required to call finish() before destroying a // 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 -// though since doing so causes too mcuh trouble when deleting +// though since doing so causes too much trouble when deleting // 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 // are not. It is up to the caller to use a pipeline according to its // own restrictions. diff --git a/include/qpdf/Pl_Buffer.hh b/include/qpdf/Pl_Buffer.hh index abbd5241..c16440eb 100644 --- a/include/qpdf/Pl_Buffer.hh +++ b/include/qpdf/Pl_Buffer.hh @@ -13,7 +13,7 @@ // accumulated so far. getBuffer() may be called only after calling // finish() and before calling any subsequent write(). At that point, // 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. // // For this pipeline, "next" may be null. If a next pointer is diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index f57d4c94..6081d18b 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -47,7 +47,7 @@ class QPDF void setIgnoreXRefStreams(bool); // 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 // calling getWarnings. void setSuppressWarnings(bool); diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh index 5cb1f85b..217115e8 100644 --- a/include/qpdf/QPDFWriter.hh +++ b/include/qpdf/QPDFWriter.hh @@ -190,7 +190,7 @@ class QPDFWriter // Calls finish on the current pipeline and pops the pipeline // 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 // stack items are of type Pl_Buffer, the buffer is retrieved. void popPipelineStack(PointerHolder* bp = 0); diff --git a/libqpdf/Pl_QPDFTokenizer.cc b/libqpdf/Pl_QPDFTokenizer.cc index 27b8c680..96328408 100644 --- a/libqpdf/Pl_QPDFTokenizer.cc +++ b/libqpdf/Pl_QPDFTokenizer.cc @@ -58,7 +58,7 @@ Pl_QPDFTokenizer::processChar(char ch) { 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. writeNext(&ch, 1); return; @@ -79,12 +79,12 @@ Pl_QPDFTokenizer::processChar(char ch) { // Uh oh.... we're not sophisticated enough to handle // 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 // specified dimensions. Then we'd either have to write // out raw image data or continue to write filtered data, // 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. this->pass_through = true; if (this->unread_char) diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index a90cddc2..0fe738f4 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -465,7 +465,7 @@ QPDF::reconstruct_xref(QPDFExc& e) // streams. 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 diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 1571c114..03ef2fe4 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -186,7 +186,7 @@ QPDFObjectHandle::getRealValue() return dynamic_cast(obj.getPointer())->getVal(); } -// Name acessors +// Name accessors std::string QPDFObjectHandle::getName() @@ -211,7 +211,7 @@ QPDFObjectHandle::getUTF8Value() return dynamic_cast(obj.getPointer())->getUTF8Val(); } -// Array acessors +// Array accessors int QPDFObjectHandle::getArrayNItems() @@ -236,7 +236,7 @@ QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const& item) return dynamic_cast(obj.getPointer())->setItem(n, item); } -// Dictionary accesors +// Dictionary accessors bool QPDFObjectHandle::hasKey(std::string const& key) @@ -323,7 +323,7 @@ QPDFObjectHandle::getPageImages() // value is null or an empty dictionary, you are supposed to walk // up the page tree until you find a /Resources dictionary. As of // 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 // code and the test file. diff --git a/libqpdf/QPDFTokenizer.cc b/libqpdf/QPDFTokenizer.cc index d1f3a4af..1d3d153f 100644 --- a/libqpdf/QPDFTokenizer.cc +++ b/libqpdf/QPDFTokenizer.cc @@ -259,7 +259,7 @@ QPDFTokenizer::presentCharacter(char ch) { 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 // character even though it is ignored since it may be the // newline after a stream keyword. Removing it here could diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc index 23d0d93e..9051f87a 100644 --- a/libqpdf/QPDFWriter.cc +++ b/libqpdf/QPDFWriter.cc @@ -160,7 +160,7 @@ QPDFWriter::setR3EncryptionParameters( // None // Only Document Assembly // 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 // Allowed printing menu: @@ -197,7 +197,7 @@ QPDFWriter::setR3EncryptionParameters( switch (modify) { case r3m_none: - clear.insert(11); // document essembly + clear.insert(11); // document assembly case r3m_assembly: clear.insert(9); // filling in form fields @@ -226,7 +226,7 @@ QPDFWriter::setEncryptionParameters( // PDF specification refers to bits with the low bit numbered 1. // 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(2); @@ -754,7 +754,7 @@ QPDFWriter::unparseObject(QPDFObjectHandle object, int level, { // Don't filter if the stream is already compressed with // 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 // compressed with a lossy compression scheme, but we // don't support any of those right now. diff --git a/libqpdf/QPDF_Name.cc b/libqpdf/QPDF_Name.cc index 2dac795f..c640fe83 100644 --- a/libqpdf/QPDF_Name.cc +++ b/libqpdf/QPDF_Name.cc @@ -22,7 +22,7 @@ QPDF_Name::normalizeName(std::string const& name) for (unsigned int i = 1; i < name.length(); ++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)) { sprintf(num, "#%02x", (unsigned char) ch); diff --git a/libqpdf/QPDF_linearization.cc b/libqpdf/QPDF_linearization.cc index a649936c..9a1c7b05 100644 --- a/libqpdf/QPDF_linearization.cc +++ b/libqpdf/QPDF_linearization.cc @@ -2083,7 +2083,7 @@ QPDF::generateHintStream(std::map const& xref, calculateHOutline(xref, lengths, obj_renumber); // 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_Flate f("compress hint stream", &hint_stream, Pl_Flate::a_deflate); Pl_Count c("count", &f); diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index d6b503fb..0ffc6e26 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -152,7 +152,7 @@ QUtil::toUTF8(unsigned long uval) // '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 // 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 // remaining bits. diff --git a/libqpdf/qpdf/MD5.hh b/libqpdf/qpdf/MD5.hh index 4009bee3..eb0b9680 100644 --- a/libqpdf/qpdf/MD5.hh +++ b/libqpdf/qpdf/MD5.hh @@ -37,7 +37,7 @@ class MD5 // testing) void print(); - // returns the digest as a hexademical string + // returns the digest as a hexadecimal string std::string unparse(); // Convenience functions diff --git a/libqpdf/qpdf/QPDF_Dictionary.hh b/libqpdf/qpdf/QPDF_Dictionary.hh index 6a79fb69..b960050a 100644 --- a/libqpdf/qpdf/QPDF_Dictionary.hh +++ b/libqpdf/qpdf/QPDF_Dictionary.hh @@ -23,7 +23,7 @@ class QPDF_Dictionary: public QPDFObject QPDFObjectHandle getKey(std::string const&); std::set 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&); // Remove key, doing nothing if key does not exist void removeKey(std::string const& key); diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc index c7f3cbe0..2cf25ac0 100644 --- a/qpdf/qpdf.cc +++ b/qpdf/qpdf.cc @@ -107,7 +107,7 @@ Values for stream data options:\n\ preserve leave all stream data as is\n\ uncompress uncompress stream data when possible\n\ \n\ -Values for object strea mode:\n\ +Values for object stream mode:\n\ \n\ preserve preserve original object streams (default)\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\ 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, in which case it will produce unusuable results.\n\ +page content stream, in which case it will produce unusable results.\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"; void usage(std::string const& msg) diff --git a/qpdf/qtest/qpdf/bad7-recover.out b/qpdf/qtest/qpdf/bad7-recover.out index 56b99f9d..bd694b65 100644 --- a/qpdf/qtest/qpdf/bad7-recover.out +++ b/qpdf/qtest/qpdf/bad7-recover.out @@ -1,4 +1,4 @@ WARNING: bad7.pdf: offset 0: file is damaged WARNING: bad7.pdf: offset 698: expected trailer dictionary 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