aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFPageObjectHelper.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-09-26 21:11:27 +0200
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-11-19 20:10:42 +0100
commit743a735ee008a4bd70cfac97634f350d9a2d46f1 (patch)
tree5cea25afcdcffba7d661c80b664fe8abaae5124e /libqpdf/QPDFPageObjectHelper.cc
parentf69ed209d093155e9921487056142370d0a6d0ce (diff)
downloadqpdf-743a735ee008a4bd70cfac97634f350d9a2d46f1.tar.zst
Use QPDF::newStream in library
Diffstat (limited to 'libqpdf/QPDFPageObjectHelper.cc')
-rw-r--r--libqpdf/QPDFPageObjectHelper.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/libqpdf/QPDFPageObjectHelper.cc b/libqpdf/QPDFPageObjectHelper.cc
index 7da09cf5..761a16f4 100644
--- a/libqpdf/QPDFPageObjectHelper.cc
+++ b/libqpdf/QPDFPageObjectHelper.cc
@@ -785,10 +785,10 @@ QPDFPageObjectHelper::getMatrixForTransformations(bool invert)
QPDFObjectHandle
QPDFPageObjectHelper::getFormXObjectForPage(bool handle_transformations)
{
- QPDF& qpdf = this->oh.getQPDF(
- "QPDFPageObjectHelper::getFormXObjectForPage called with a direct "
- "object");
- QPDFObjectHandle result = QPDFObjectHandle::newStream(&qpdf);
+ auto result = this->oh
+ .getQPDF("QPDFPageObjectHelper::getFormXObjectForPage "
+ "called with a direct object")
+ .newStream();
QPDFObjectHandle newdict = result.getDict();
newdict.replaceKey("/Type", QPDFObjectHandle::newName("/XObject"));
newdict.replaceKey("/Subtype", QPDFObjectHandle::newName("/Form"));
@@ -1062,8 +1062,7 @@ QPDFPageObjectHelper::flattenRotation(QPDFAcroFormDocumentHelper* afdh)
}
std::string cm_str = std::string("q\n") + cm.unparse() + " cm\n";
this->oh.addPageContents(QPDFObjectHandle::newStream(&qpdf, cm_str), true);
- this->oh.addPageContents(
- QPDFObjectHandle::newStream(&qpdf, "\nQ\n"), false);
+ this->oh.addPageContents(qpdf.newStream("\nQ\n"), false);
this->oh.removeKey("/Rotate");
QPDFObjectHandle rotate_obj = getAttribute("/Rotate", false);
if (!rotate_obj.isNull()) {