diff options
author | m-holger <m-holger@kubitscheck.org> | 2024-02-12 19:40:21 +0100 |
---|---|---|
committer | m-holger <m-holger@kubitscheck.org> | 2024-02-16 12:00:20 +0100 |
commit | 9589fad1e5bde7c51f01c0de16ac0b5ccb7051e0 (patch) | |
tree | 9357fc9099cefcb06f587597d0606d50260aeca8 /libqpdf/QPDF_Real.cc | |
parent | 9379b768118f465e94f826bed1daacbbc94938fc (diff) | |
download | qpdf-9589fad1e5bde7c51f01c0de16ac0b5ccb7051e0.tar.zst |
Reimplement QPDFObjectHandle::getJSON in terms of writeJSON
Diffstat (limited to 'libqpdf/QPDF_Real.cc')
-rw-r--r-- | libqpdf/QPDF_Real.cc | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/libqpdf/QPDF_Real.cc b/libqpdf/QPDF_Real.cc index af96c9df..f4304397 100644 --- a/libqpdf/QPDF_Real.cc +++ b/libqpdf/QPDF_Real.cc @@ -39,25 +39,6 @@ QPDF_Real::unparse() return this->val; } -JSON -QPDF_Real::getJSON(int json_version) -{ - // While PDF allows .x or -.x, JSON does not. Rather than converting from string to double and - // back, just handle this as a special case for JSON. - std::string result; - if (this->val.length() == 0) { - // Can't really happen... - result = "0"; - } else if (this->val.at(0) == '.') { - result = "0" + this->val; - } else if ((this->val.length() >= 2) && (this->val.at(0) == '-') && (this->val.at(1) == '.')) { - result = "-0." + this->val.substr(2); - } else { - result = this->val; - } - return JSON::makeNumber(result); -} - void QPDF_Real::writeJSON(int json_version, JSON::Writer& p) { |