From e909fc21e8f5ee75bc50b013897baf728f2abb6d Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 5 Jun 2012 14:14:02 +0200 Subject: [PATCH] comment --- src/internfile/mimehandler.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/internfile/mimehandler.h b/src/internfile/mimehandler.h index 87640a74..301815f6 100644 --- a/src/internfile/mimehandler.h +++ b/src/internfile/mimehandler.h @@ -57,9 +57,14 @@ public: // We don't use this for now virtual bool set_document_uri(const std::string &) {return false;} - /// This does nothing right now but should be called from the - /// subclass method in case we need some common processing one day - /// (was used for xattrs at some point). + // This does nothing right now but should be called from the + // subclass method in case we need some common processing one day + // (was used for xattrs at some point). Yes this is the "call + // super" anti-pattern, bad, but we have several layers of derived + // classes, so that implementing the template method approach (by + // having a pure virtual called from here and implemented in the + // subclass) would have to be repeated in each derived class. It's + // just simpler this way. virtual bool set_document_file(const string & /*file_path*/) {return true;} // Default implementations @@ -94,6 +99,8 @@ public: return m_reason; } + // "Call super" anti-pattern again. Must be called from derived + // classes which reimplement clear() virtual void clear() { Dijon::Filter::clear(); m_forPreview = m_havedoc = false;