aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_Stream.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDF_Stream.cc')
-rw-r--r--libqpdf/QPDF_Stream.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/libqpdf/QPDF_Stream.cc b/libqpdf/QPDF_Stream.cc
index 7b84d10c..384652e2 100644
--- a/libqpdf/QPDF_Stream.cc
+++ b/libqpdf/QPDF_Stream.cc
@@ -39,6 +39,7 @@ QPDF_Stream::QPDF_Stream(QPDF* qpdf, int objid, int generation,
"stream object instantiated with non-dictionary "
"object for dictionary");
}
+ setStreamDescription();
}
QPDF_Stream::~QPDF_Stream()
@@ -85,6 +86,35 @@ QPDF_Stream::getTypeName() const
return "stream";
}
+void
+QPDF_Stream::setDescription(QPDF* qpdf, std::string const& description)
+{
+ this->QPDFObject::setDescription(qpdf, description);
+ setDictDescription();
+}
+
+void
+QPDF_Stream::setStreamDescription()
+{
+ setDescription(
+ this->qpdf,
+ "stream object " + QUtil::int_to_string(this->objid) + " " +
+ QUtil::int_to_string(this->generation));
+}
+
+void
+QPDF_Stream::setDictDescription()
+{
+ QPDF* qpdf = 0;
+ std::string description;
+ if ((! this->stream_dict.hasObjectDescription()) &&
+ getDescription(qpdf, description))
+ {
+ this->stream_dict.setObjectDescription(
+ qpdf, description + " -> stream dictionary");
+ }
+}
+
QPDFObjectHandle
QPDF_Stream::getDict() const
{
@@ -688,6 +718,7 @@ void
QPDF_Stream::replaceDict(QPDFObjectHandle new_dict)
{
this->stream_dict = new_dict;
+ setDictDescription();
QPDFObjectHandle length_obj = new_dict.getKey("/Length");
if (length_obj.isInteger())
{