From kde-commits Fri Apr 21 15:53:58 2006 From: Leo Savernik Date: Fri, 21 Apr 2006 15:53:58 +0000 To: kde-commits Subject: branches/KDE/3.5/kdelibs/kdeprint/cups Message-Id: <1145634838.519588.20660.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=114563484624517 SVN commit 532298 by savernik: revert last in order to support older versions of cups as advertised M +14 -4 ipprequest.cpp --- branches/KDE/3.5/kdelibs/kdeprint/cups/ipprequest.cpp #532297:532298 @@ -510,8 +510,18 @@ cupsEncodeOptions(request_, n, options); cupsFreeOptions(n, options); - // find and remove that annoying "document-format" attribute - ipp_attribute_t *attr = ippFindAttribute(request_, "document-format", IPP_TAG_NAME); - ippDeleteAttribute(request_, attr); - + // find an remove that annoying "document-format" attribute + // (can't use IppDeleteAttribute as cups 1.0.9 doesn't have that) + ipp_attribute_t *attr = request_->attrs; + while (attr) + { + if (attr->next && strcmp(attr->next->name, "document-format") == 0) + { + ipp_attribute_t *attr2 = attr->next; + attr->next = attr2->next; + _ipp_free_attr(attr2); + break; + } + attr = attr->next; + } }