diff --git a/lib/ippprintjob.h b/lib/ippprintjob.h index efe6a81..dbc2f5f 100644 --- a/lib/ippprintjob.h +++ b/lib/ippprintjob.h @@ -45,18 +45,6 @@ class IppPrintJob List additionalDocumentFormats(); - IppPrintJob& operator=(const IppPrintJob& other) - { - opAttrs = other.opAttrs; - jobAttrs = other.jobAttrs; - printParams = other.printParams; - _printerAttrs = other._printerAttrs; - targetFormat = other.targetFormat; - oneStage = other.oneStage; - margins = other.margins; - return *this; - }; - typedef std::pair ConvertKey; typedef std::function ConvertFun; diff --git a/lib/setting.h b/lib/setting.h index 5f8a22d..916b006 100644 --- a/lib/setting.h +++ b/lib/setting.h @@ -6,9 +6,16 @@ template class Setting { + // Settings must be immune to copying/assignment, + // so they keep pointing to the Attrs of their parent IppPrintJob. + // Thus, no need to expose copying/assignment to anything else. +protected: + friend class IppPrintJob; + Setting(Setting&) {} + Setting& operator=(const Setting&) {return *this;}; + public: Setting() = delete; - Setting& operator=(const Setting& other) = delete; Setting(IppAttrs* printerAttrs, IppAttrs* attrs, IppMsg::Tag tag, std::string name, std::string subKey = "") : _printerAttrs(printerAttrs), _attrs(attrs), _tag(tag), _name(name), _subKey(subKey) {}