Commit 91cb7c0a585ccaf8eab389da9f7351534440ee56

Authored by Jay Berkenbilt
1 parent 0b2288c1

fix many typos in comments and strings

git-svn-id: svn+q:///qpdf/trunk@651 71b93d88-0707-0410-a8cf-f5a4172ac649
ChangeLog
1 2009-02-20 Jay Berkenbilt <ejb@ql.org> 1 2009-02-20 Jay Berkenbilt <ejb@ql.org>
2 2
  3 + * Fix many typos in comments and strings.
  4 +
3 * qpdf/qpdf.cc: in --check mode, if there are warnings but no 5 * qpdf/qpdf.cc: in --check mode, if there are warnings but no
4 errors, exit with a status of 3. 6 errors, exit with a status of 3.
5 7
include/qpdf/Pipeline.hh
@@ -19,10 +19,10 @@ @@ -19,10 +19,10 @@
19 // The client is required to call finish() before destroying a 19 // The client is required to call finish() before destroying a
20 // Pipeline in order to avoid loss of data. A Pipeline class should 20 // Pipeline in order to avoid loss of data. A Pipeline class should
21 // not throw an exception in the destructor if this hasn't been done 21 // not throw an exception in the destructor if this hasn't been done
22 -// though since doing so causes too mcuh trouble when deleting 22 +// though since doing so causes too much trouble when deleting
23 // pipelines during error conditions. 23 // pipelines during error conditions.
24 // 24 //
25 -// Some pipelines are resuable (i.e., you can call write() after 25 +// Some pipelines are reusable (i.e., you can call write() after
26 // calling finish() and can call finish() multiple times) while others 26 // calling finish() and can call finish() multiple times) while others
27 // are not. It is up to the caller to use a pipeline according to its 27 // are not. It is up to the caller to use a pipeline according to its
28 // own restrictions. 28 // own restrictions.
include/qpdf/Pl_Buffer.hh
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 // accumulated so far. getBuffer() may be called only after calling 13 // accumulated so far. getBuffer() may be called only after calling
14 // finish() and before calling any subsequent write(). At that point, 14 // finish() and before calling any subsequent write(). At that point,
15 // a dynamically allocated Buffer object is returned and the internal 15 // a dynamically allocated Buffer object is returned and the internal
16 -// buffer is reset. The caller is responseible for deleting the 16 +// buffer is reset. The caller is responsible for deleting the
17 // returned Buffer. 17 // returned Buffer.
18 // 18 //
19 // For this pipeline, "next" may be null. If a next pointer is 19 // For this pipeline, "next" may be null. If a next pointer is
include/qpdf/QPDF.hh
@@ -47,7 +47,7 @@ class QPDF @@ -47,7 +47,7 @@ class QPDF
47 void setIgnoreXRefStreams(bool); 47 void setIgnoreXRefStreams(bool);
48 48
49 // By default, any warnings are issued to stderr as they are 49 // By default, any warnings are issued to stderr as they are
50 - // encountered. If this is called with a true value, reporitng of 50 + // encountered. If this is called with a true value, reporting of
51 // warnings is suppressed. You may still retrieve warnings by 51 // warnings is suppressed. You may still retrieve warnings by
52 // calling getWarnings. 52 // calling getWarnings.
53 void setSuppressWarnings(bool); 53 void setSuppressWarnings(bool);
include/qpdf/QPDFWriter.hh
@@ -190,7 +190,7 @@ class QPDFWriter @@ -190,7 +190,7 @@ class QPDFWriter
190 190
191 // Calls finish on the current pipeline and pops the pipeline 191 // Calls finish on the current pipeline and pops the pipeline
192 // stack until the top of stack is a previous active top of stack, 192 // stack until the top of stack is a previous active top of stack,
193 - // and restores the pipeline to that point. Deletes any piplines 193 + // and restores the pipeline to that point. Deletes any pipelines
194 // that it pops. If the bp argument is non-null and any of the 194 // that it pops. If the bp argument is non-null and any of the
195 // stack items are of type Pl_Buffer, the buffer is retrieved. 195 // stack items are of type Pl_Buffer, the buffer is retrieved.
196 void popPipelineStack(PointerHolder<Buffer>* bp = 0); 196 void popPipelineStack(PointerHolder<Buffer>* bp = 0);
libqpdf/Pl_QPDFTokenizer.cc
@@ -58,7 +58,7 @@ Pl_QPDFTokenizer::processChar(char ch) @@ -58,7 +58,7 @@ Pl_QPDFTokenizer::processChar(char ch)
58 { 58 {
59 if (this->pass_through) 59 if (this->pass_through)
60 { 60 {
61 - // We're not noramlizing anymore -- just write this without 61 + // We're not normalizing anymore -- just write this without
62 // looking at it. 62 // looking at it.
63 writeNext(&ch, 1); 63 writeNext(&ch, 1);
64 return; 64 return;
@@ -79,12 +79,12 @@ Pl_QPDFTokenizer::processChar(char ch) @@ -79,12 +79,12 @@ Pl_QPDFTokenizer::processChar(char ch)
79 { 79 {
80 // Uh oh.... we're not sophisticated enough to handle 80 // Uh oh.... we're not sophisticated enough to handle
81 // inline images safely. We'd have to to set up all the 81 // inline images safely. We'd have to to set up all the
82 - // filters and pipe the iamge data through it until the 82 + // filters and pipe the image data through it until the
83 // filtered output was the right size for an image of the 83 // filtered output was the right size for an image of the
84 // specified dimensions. Then we'd either have to write 84 // specified dimensions. Then we'd either have to write
85 // out raw image data or continue to write filtered data, 85 // out raw image data or continue to write filtered data,
86 // resuming normalization when we get to the end. 86 // resuming normalization when we get to the end.
87 - // Insetad, for now, we'll just turn off noramlization for 87 + // Instead, for now, we'll just turn off normalization for
88 // the remainder of this stream. 88 // the remainder of this stream.
89 this->pass_through = true; 89 this->pass_through = true;
90 if (this->unread_char) 90 if (this->unread_char)
libqpdf/QPDF.cc
@@ -465,7 +465,7 @@ QPDF::reconstruct_xref(QPDFExc&amp; e) @@ -465,7 +465,7 @@ QPDF::reconstruct_xref(QPDFExc&amp; e)
465 // streams. 465 // streams.
466 466
467 throw QPDFExc(this->file.getName() + ": unable to find trailer " 467 throw QPDFExc(this->file.getName() + ": unable to find trailer "
468 - "dictionary while recovering damanged file"); 468 + "dictionary while recovering damaged file");
469 } 469 }
470 470
471 // We could iterate through the objects looking for streams and 471 // We could iterate through the objects looking for streams and
libqpdf/QPDFObjectHandle.cc
@@ -186,7 +186,7 @@ QPDFObjectHandle::getRealValue() @@ -186,7 +186,7 @@ QPDFObjectHandle::getRealValue()
186 return dynamic_cast<QPDF_Real*>(obj.getPointer())->getVal(); 186 return dynamic_cast<QPDF_Real*>(obj.getPointer())->getVal();
187 } 187 }
188 188
189 -// Name acessors 189 +// Name accessors
190 190
191 std::string 191 std::string
192 QPDFObjectHandle::getName() 192 QPDFObjectHandle::getName()
@@ -211,7 +211,7 @@ QPDFObjectHandle::getUTF8Value() @@ -211,7 +211,7 @@ QPDFObjectHandle::getUTF8Value()
211 return dynamic_cast<QPDF_String*>(obj.getPointer())->getUTF8Val(); 211 return dynamic_cast<QPDF_String*>(obj.getPointer())->getUTF8Val();
212 } 212 }
213 213
214 -// Array acessors 214 +// Array accessors
215 215
216 int 216 int
217 QPDFObjectHandle::getArrayNItems() 217 QPDFObjectHandle::getArrayNItems()
@@ -236,7 +236,7 @@ QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const&amp; item) @@ -236,7 +236,7 @@ QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const&amp; item)
236 return dynamic_cast<QPDF_Array*>(obj.getPointer())->setItem(n, item); 236 return dynamic_cast<QPDF_Array*>(obj.getPointer())->setItem(n, item);
237 } 237 }
238 238
239 -// Dictionary accesors 239 +// Dictionary accessors
240 240
241 bool 241 bool
242 QPDFObjectHandle::hasKey(std::string const& key) 242 QPDFObjectHandle::hasKey(std::string const& key)
@@ -323,7 +323,7 @@ QPDFObjectHandle::getPageImages() @@ -323,7 +323,7 @@ QPDFObjectHandle::getPageImages()
323 // value is null or an empty dictionary, you are supposed to walk 323 // value is null or an empty dictionary, you are supposed to walk
324 // up the page tree until you find a /Resources dictionary. As of 324 // up the page tree until you find a /Resources dictionary. As of
325 // this writing, I don't have any test files that use inherited 325 // this writing, I don't have any test files that use inherited
326 - // resources, and hand-generating one won't be a good test beacuse 326 + // resources, and hand-generating one won't be a good test because
327 // any mistakes in my understanding would be present in both the 327 // any mistakes in my understanding would be present in both the
328 // code and the test file. 328 // code and the test file.
329 329
libqpdf/QPDFTokenizer.cc
@@ -259,7 +259,7 @@ QPDFTokenizer::presentCharacter(char ch) @@ -259,7 +259,7 @@ QPDFTokenizer::presentCharacter(char ch)
259 { 259 {
260 if (strchr(" \t\n\v\f\r()<>[]{}/%", ch) != 0) 260 if (strchr(" \t\n\v\f\r()<>[]{}/%", ch) != 0)
261 { 261 {
262 - // A C-loacle whitespace character or delimiter terminates 262 + // A C-locale whitespace character or delimiter terminates
263 // token. It is important to unread the whitespace 263 // token. It is important to unread the whitespace
264 // character even though it is ignored since it may be the 264 // character even though it is ignored since it may be the
265 // newline after a stream keyword. Removing it here could 265 // newline after a stream keyword. Removing it here could
libqpdf/QPDFWriter.cc
@@ -160,7 +160,7 @@ QPDFWriter::setR3EncryptionParameters( @@ -160,7 +160,7 @@ QPDFWriter::setR3EncryptionParameters(
160 // None 160 // None
161 // Only Document Assembly 161 // Only Document Assembly
162 // Only Form Field Fill-in or Signing 162 // Only Form Field Fill-in or Signing
163 - // Comment AUthoring, Form Field Fill-in or Signing 163 + // Comment Authoring, Form Field Fill-in or Signing
164 // General Editing, Comment and Form Field Authoring 164 // General Editing, Comment and Form Field Authoring
165 165
166 // Allowed printing menu: 166 // Allowed printing menu:
@@ -197,7 +197,7 @@ QPDFWriter::setR3EncryptionParameters( @@ -197,7 +197,7 @@ QPDFWriter::setR3EncryptionParameters(
197 switch (modify) 197 switch (modify)
198 { 198 {
199 case r3m_none: 199 case r3m_none:
200 - clear.insert(11); // document essembly 200 + clear.insert(11); // document assembly
201 201
202 case r3m_assembly: 202 case r3m_assembly:
203 clear.insert(9); // filling in form fields 203 clear.insert(9); // filling in form fields
@@ -226,7 +226,7 @@ QPDFWriter::setEncryptionParameters( @@ -226,7 +226,7 @@ QPDFWriter::setEncryptionParameters(
226 // PDF specification refers to bits with the low bit numbered 1. 226 // PDF specification refers to bits with the low bit numbered 1.
227 // We have to convert this into a bit field. 227 // We have to convert this into a bit field.
228 228
229 - // Specification always requirse bits 1 and 2 to be cleared. 229 + // Specification always requires bits 1 and 2 to be cleared.
230 bits_to_clear.insert(1); 230 bits_to_clear.insert(1);
231 bits_to_clear.insert(2); 231 bits_to_clear.insert(2);
232 232
@@ -754,7 +754,7 @@ QPDFWriter::unparseObject(QPDFObjectHandle object, int level, @@ -754,7 +754,7 @@ QPDFWriter::unparseObject(QPDFObjectHandle object, int level,
754 { 754 {
755 // Don't filter if the stream is already compressed with 755 // Don't filter if the stream is already compressed with
756 // FlateDecode. We don't want to make it worse by getting 756 // FlateDecode. We don't want to make it worse by getting
757 - // rid of a predictor or otherwising messing with it. We 757 + // rid of a predictor or otherwise messing with it. We
758 // should also avoid messing with anything that's 758 // should also avoid messing with anything that's
759 // compressed with a lossy compression scheme, but we 759 // compressed with a lossy compression scheme, but we
760 // don't support any of those right now. 760 // don't support any of those right now.
libqpdf/QPDF_Name.cc
@@ -22,7 +22,7 @@ QPDF_Name::normalizeName(std::string const&amp; name) @@ -22,7 +22,7 @@ QPDF_Name::normalizeName(std::string const&amp; name)
22 for (unsigned int i = 1; i < name.length(); ++i) 22 for (unsigned int i = 1; i < name.length(); ++i)
23 { 23 {
24 char ch = name[i]; 24 char ch = name[i];
25 - // Don't use locale/ctype here; follow PDF spec guidlines. 25 + // Don't use locale/ctype here; follow PDF spec guidelines.
26 if (strchr("#()<>[]{}/%", ch) || (ch < 33) || (ch > 126)) 26 if (strchr("#()<>[]{}/%", ch) || (ch < 33) || (ch > 126))
27 { 27 {
28 sprintf(num, "#%02x", (unsigned char) ch); 28 sprintf(num, "#%02x", (unsigned char) ch);
libqpdf/QPDF_linearization.cc
@@ -2083,7 +2083,7 @@ QPDF::generateHintStream(std::map&lt;int, QPDFXRefEntry&gt; const&amp; xref, @@ -2083,7 +2083,7 @@ QPDF::generateHintStream(std::map&lt;int, QPDFXRefEntry&gt; const&amp; xref,
2083 calculateHOutline(xref, lengths, obj_renumber); 2083 calculateHOutline(xref, lengths, obj_renumber);
2084 2084
2085 // Write the hint stream itself into a compressed memory buffer. 2085 // Write the hint stream itself into a compressed memory buffer.
2086 - // Write through a couter so we can get offsets. 2086 + // Write through a counter so we can get offsets.
2087 Pl_Buffer hint_stream("hint stream"); 2087 Pl_Buffer hint_stream("hint stream");
2088 Pl_Flate f("compress hint stream", &hint_stream, Pl_Flate::a_deflate); 2088 Pl_Flate f("compress hint stream", &hint_stream, Pl_Flate::a_deflate);
2089 Pl_Count c("count", &f); 2089 Pl_Count c("count", &f);
libqpdf/QUtil.cc
@@ -152,7 +152,7 @@ QUtil::toUTF8(unsigned long uval) @@ -152,7 +152,7 @@ QUtil::toUTF8(unsigned long uval)
152 // '0' for its (n+1)th highest bit where n is the total number of 152 // '0' for its (n+1)th highest bit where n is the total number of
153 // bytes required. Subsequent bytes start with '10' and have the 153 // bytes required. Subsequent bytes start with '10' and have the
154 // remaining 6 bits free for encoding. For example, an 11-bit 154 // remaining 6 bits free for encoding. For example, an 11-bit
155 - // unicode value can be stored in two bytes where the first is 155 + // Unicode value can be stored in two bytes where the first is
156 // 110zzzzz, the second is 10zzzzzz, and the z's represent the 156 // 110zzzzz, the second is 10zzzzzz, and the z's represent the
157 // remaining bits. 157 // remaining bits.
158 158
libqpdf/qpdf/MD5.hh
@@ -37,7 +37,7 @@ class MD5 @@ -37,7 +37,7 @@ class MD5
37 // testing) 37 // testing)
38 void print(); 38 void print();
39 39
40 - // returns the digest as a hexademical string 40 + // returns the digest as a hexadecimal string
41 std::string unparse(); 41 std::string unparse();
42 42
43 // Convenience functions 43 // Convenience functions
libqpdf/qpdf/QPDF_Dictionary.hh
@@ -23,7 +23,7 @@ class QPDF_Dictionary: public QPDFObject @@ -23,7 +23,7 @@ class QPDF_Dictionary: public QPDFObject
23 QPDFObjectHandle getKey(std::string const&); 23 QPDFObjectHandle getKey(std::string const&);
24 std::set<std::string> getKeys(); 24 std::set<std::string> getKeys();
25 25
26 - // Repalce value of key, adding it if it does not exist 26 + // Replace value of key, adding it if it does not exist
27 void replaceKey(std::string const& key, QPDFObjectHandle const&); 27 void replaceKey(std::string const& key, QPDFObjectHandle const&);
28 // Remove key, doing nothing if key does not exist 28 // Remove key, doing nothing if key does not exist
29 void removeKey(std::string const& key); 29 void removeKey(std::string const& key);
qpdf/qpdf.cc
@@ -107,7 +107,7 @@ Values for stream data options:\n\ @@ -107,7 +107,7 @@ Values for stream data options:\n\
107 preserve leave all stream data as is\n\ 107 preserve leave all stream data as is\n\
108 uncompress uncompress stream data when possible\n\ 108 uncompress uncompress stream data when possible\n\
109 \n\ 109 \n\
110 -Values for object strea mode:\n\ 110 +Values for object stream mode:\n\
111 \n\ 111 \n\
112 preserve preserve original object streams (default)\n\ 112 preserve preserve original object streams (default)\n\
113 disable don't write any object streams\n\ 113 disable don't write any object streams\n\
@@ -142,8 +142,11 @@ stream data to be written to standard output.\n\ @@ -142,8 +142,11 @@ stream data to be written to standard output.\n\
142 If --filtered-stream-data is given and --normalize-content=y is also\n\ 142 If --filtered-stream-data is given and --normalize-content=y is also\n\
143 given, qpdf will attempt to normalize the stream data as if it is a\n\ 143 given, qpdf will attempt to normalize the stream data as if it is a\n\
144 page content stream. This attempt will be made even if it is not a\n\ 144 page content stream. This attempt will be made even if it is not a\n\
145 -page content stream, in which case it will produce unusuable results.\n\ 145 +page content stream, in which case it will produce unusable results.\n\
146 \n\ 146 \n\
  147 +Ordinarily, qpdf exits with a status of 0 on success or a status of 2\n\
  148 +if any errors occurred. In --check mode, if there were warnings but not\n\
  149 +errors, qpdf exits with a status of 3.\n\
147 \n"; 150 \n";
148 151
149 void usage(std::string const& msg) 152 void usage(std::string const& msg)
qpdf/qtest/qpdf/bad7-recover.out
1 WARNING: bad7.pdf: offset 0: file is damaged 1 WARNING: bad7.pdf: offset 0: file is damaged
2 WARNING: bad7.pdf: offset 698: expected trailer dictionary 2 WARNING: bad7.pdf: offset 698: expected trailer dictionary
3 WARNING: Attempting to reconstruct cross-reference table 3 WARNING: Attempting to reconstruct cross-reference table
4 -bad7.pdf: unable to find trailer dictionary while recovering damanged file 4 +bad7.pdf: unable to find trailer dictionary while recovering damaged file