From 5a11744e9a8de85e83c048d520f1bd4455ec5a7f Mon Sep 17 00:00:00 2001
From: Rene Brun <Rene.Brun@cern.ch>
Date: Tue, 22 Jan 2008 16:11:46 +0000
Subject: [PATCH] From Matevz: Fix effc++ warnings in gui/ and xmlparser/.

git-svn-id: http://root.cern.ch/svn/root/trunk@21809 27541ba8-7e3a-0410-8455-c3a389f83636
---
 gui/inc/TGDNDManager.h       | 12 ++++++++++--
 gui/inc/TGFont.h             | 20 ++++++++++++++++++++
 xmlparser/inc/TDOMParser.h   |  3 +++
 xmlparser/inc/TXMLDocument.h |  3 +++
 xmlparser/inc/TXMLNode.h     |  3 +++
 xmlparser/inc/TXMLParser.h   |  4 ++++
 6 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/gui/inc/TGDNDManager.h b/gui/inc/TGDNDManager.h
index 8323eaeb9f8..964050a3a22 100755
--- a/gui/inc/TGDNDManager.h
+++ b/gui/inc/TGDNDManager.h
@@ -65,9 +65,13 @@ public:
 //_____________________________________________________________________________
 
 class TDNDData : public TObject {
+private:
+   TDNDData(const TDNDData&);            // Not implemented
+   TDNDData& operator=(const TDNDData&); // Not implemented
+
 public:
-   TDNDData(Atom_t dt = kNone, void *d = 0, Int_t len = 0, Atom_t act = kNone)
-           { fDataType = dt; fData = d; fDataLength = len; fAction = act; }
+   TDNDData(Atom_t dt = kNone, void *d = 0, Int_t len = 0, Atom_t act = kNone) :
+      fDataType(dt), fAction(act), fData(d), fDataLength(len) {}
    ~TDNDData() {}
 
    Atom_t    fDataType;       // Data type description
@@ -82,6 +86,10 @@ public:
 
 class TGDNDManager : public TObject {
 
+private:
+   TGDNDManager(const TGDNDManager&);            // Not implemented
+   TGDNDManager& operator=(const TGDNDManager&); // Not implemented
+
 protected:
    TGFrame       *fMain;                         // pointer on TGMainFrame
    Atom_t         fVersion;                      // not really an Atom, but a long
diff --git a/gui/inc/TGFont.h b/gui/inc/TGFont.h
index 6256c1483c9..cc2595ab671 100644
--- a/gui/inc/TGFont.h
+++ b/gui/inc/TGFont.h
@@ -89,6 +89,26 @@ struct FontAttributes_t {
       fSlant     (kFontSlantRoman),
       fUnderline (0),
       fOverstrike(0) { }
+
+   FontAttributes_t(const FontAttributes_t& f): // copy constructor
+      fFamily    (f.fFamily),
+      fPointsize (f.fPointsize),
+      fWeight    (f.fWeight),
+      fSlant     (f.fSlant),
+      fUnderline (f.fUnderline),
+      fOverstrike(f.fOverstrike) { }
+
+   FontAttributes_t& operator=(const FontAttributes_t& f) // assignment operator
+   {
+      fFamily     = f.fFamily;
+      fPointsize  = f.fPointsize;
+      fWeight     = f.fWeight;
+      fSlant      = f.fSlant;
+      fUnderline  = f.fUnderline;
+      fOverstrike = f.fOverstrike;
+      return *this;
+   }
+
 };
 
 
diff --git a/xmlparser/inc/TDOMParser.h b/xmlparser/inc/TDOMParser.h
index 89f0b171cc3..f323ae7fc85 100644
--- a/xmlparser/inc/TDOMParser.h
+++ b/xmlparser/inc/TDOMParser.h
@@ -38,6 +38,9 @@
 class TDOMParser : public TXMLParser {
 
 private:
+   TDOMParser(const TDOMParser&);            // Not implemented
+   TDOMParser& operator=(const TDOMParser&); // Not implemented
+
    TXMLDocument *fTXMLDoc;      // xmlDoc
 
    Int_t ParseContext();
diff --git a/xmlparser/inc/TXMLDocument.h b/xmlparser/inc/TXMLDocument.h
index 3de149e7608..174153c7499 100644
--- a/xmlparser/inc/TXMLDocument.h
+++ b/xmlparser/inc/TXMLDocument.h
@@ -37,6 +37,9 @@ class TXMLNode;
 class TXMLDocument : public TObject {
 
 private:
+   TXMLDocument(const TXMLDocument&);            // Not implemented
+   TXMLDocument& operator=(const TXMLDocument&); // Not implemented
+
    _xmlDoc  *fXMLDoc;           // libxml xml doc
    TXMLNode *fRootNode;         // the root node 
 
diff --git a/xmlparser/inc/TXMLNode.h b/xmlparser/inc/TXMLNode.h
index 65b1b1c2e24..f0110077724 100644
--- a/xmlparser/inc/TXMLNode.h
+++ b/xmlparser/inc/TXMLNode.h
@@ -40,6 +40,9 @@ struct _xmlNode;
 class TXMLNode : public TObject {
 
 private:
+   TXMLNode(const TXMLNode&);            // Not implemented
+   TXMLNode& operator=(const TXMLNode&); // Not implemented
+
    _xmlNode *fXMLNode;        // libxml node
 
    TXMLNode *fParent;         // Parent node
diff --git a/xmlparser/inc/TXMLParser.h b/xmlparser/inc/TXMLParser.h
index e69aa970ae4..825286eb363 100644
--- a/xmlparser/inc/TXMLParser.h
+++ b/xmlparser/inc/TXMLParser.h
@@ -45,6 +45,10 @@ struct   _xmlParserCtxt;
 
 class TXMLParser : public TObject, public TQObject {
 
+private:
+   TXMLParser(const TXMLParser&);            // Not implemented
+   TXMLParser& operator=(const TXMLParser&); // Not implemented
+
 protected:
    _xmlParserCtxt     *fContext;          // parse the xml file
    Bool_t              fValidate;         // to validate the parse context
-- 
GitLab