Sfoglia il codice sorgente

LibPDF: Rename m_disable_encryption to m_enable_encryption

Double negation is confusing.

No behavior change.
Nico Weber 2 anni fa
parent
commit
63670f27de

+ 3 - 3
Userland/Libraries/LibPDF/Parser.cpp

@@ -17,7 +17,7 @@ namespace PDF {
 PDFErrorOr<Vector<Operator>> Parser::parse_operators(Document* document, ReadonlyBytes bytes)
 {
     Parser parser(document, bytes);
-    parser.m_disable_encryption = true;
+    parser.m_enable_encryption = false;
     return parser.parse_operators();
 }
 
@@ -260,7 +260,7 @@ NonnullRefPtr<StringObject> Parser::parse_string()
 
     auto string_object = make_object<StringObject>(string, is_binary_string);
 
-    if (m_document->security_handler() && !m_disable_encryption)
+    if (m_document->security_handler() && m_enable_encryption)
         m_document->security_handler()->decrypt(string_object, m_current_reference_stack.last());
 
     auto unencrypted_string = string_object->string();
@@ -471,7 +471,7 @@ PDFErrorOr<NonnullRefPtr<StreamObject>> Parser::parse_stream(NonnullRefPtr<DictO
 
     auto stream_object = make_object<StreamObject>(dict, MUST(ByteBuffer::copy(bytes)));
 
-    if (m_document->security_handler() && !m_disable_encryption)
+    if (m_document->security_handler() && m_enable_encryption)
         m_document->security_handler()->decrypt(stream_object, m_current_reference_stack.last());
 
     if (dict->contains(CommonNames::Filter)) {

+ 1 - 1
Userland/Libraries/LibPDF/Parser.h

@@ -72,7 +72,7 @@ protected:
     Reader m_reader;
     WeakPtr<Document> m_document;
     Vector<Reference> m_current_reference_stack;
-    bool m_disable_encryption { false };
+    bool m_enable_encryption { true };
 };
 
 };