$OpenBSD: patch-poppler_XRef_cc,v 1.4 2009/10/26 19:23:46 kili Exp $ --- poppler/XRef.cc.orig Sun Sep 14 22:35:48 2008 +++ poppler/XRef.cc Sun Oct 26 12:45:54 2008 @@ -850,45 +850,38 @@ void XRef::setEncryption(int permFlagsA, GBool ownerPa } GBool XRef::okToPrint(GBool ignoreOwnerPW) { - return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permPrint); + return (1); } // we can print at high res if we are only doing security handler revision // 2 (and we are allowed to print at all), or with security handler rev // 3 and we are allowed to print, and bit 12 is set. GBool XRef::okToPrintHighRes(GBool ignoreOwnerPW) { - if (2 == encRevision) { - return (okToPrint(ignoreOwnerPW)); - } else if (encRevision >= 3) { - return (okToPrint(ignoreOwnerPW) && (permFlags & permHighResPrint)); - } else { - // something weird - unknown security handler version - return gFalse; - } + return (1); } GBool XRef::okToChange(GBool ignoreOwnerPW) { - return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permChange); + return (1); } GBool XRef::okToCopy(GBool ignoreOwnerPW) { - return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permCopy); + return (1); } GBool XRef::okToAddNotes(GBool ignoreOwnerPW) { - return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permNotes); + return (1); } GBool XRef::okToFillForm(GBool ignoreOwnerPW) { - return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permFillForm); + return (1); } GBool XRef::okToAccessibility(GBool ignoreOwnerPW) { - return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permAccessibility); + return (1); } GBool XRef::okToAssemble(GBool ignoreOwnerPW) { - return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permAssemble); + return (1); } Object *XRef::fetch(int num, int gen, Object *obj) {