]> git.lyx.org Git - lyx.git/commitdiff
Forbid wrong compiler generated copy constructors
authorGeorg Baum <baum@lyx.org>
Sun, 20 Sep 2015 17:43:06 +0000 (19:43 +0200)
committerGeorg Baum <baum@lyx.org>
Sun, 20 Sep 2015 17:43:06 +0000 (19:43 +0200)
This fixes cppcheck warnings (style) 'class x' does not have a copy constructor
which is recommended since the class contains a pointer to allocated memory.

src/Thesaurus.h
src/Undo.h
src/frontends/qt4/FileDialog.h
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h
src/frontends/qt4/LayoutBox.cpp
src/frontends/qt4/LayoutBox.h
src/frontends/qt4/Menus.h
src/frontends/qt4/TocModel.h

index e27f2c239adac5e2a3943f7b11bc3cd0e2f94638..52987cdd1377fdea6bcf41ad4701e927590e1b98 100644 (file)
@@ -27,6 +27,9 @@ namespace lyx {
 
 class Thesaurus
 {
+       /// noncopyable
+       Thesaurus(Thesaurus const &);
+       void operator=(Thesaurus const &);
 public:
        ///
        Thesaurus();
index 1bd6450d7c3a03749952c322961a87c6d51e1099..bacce0307e8258139f1e2fd41f0f00fd90223313 100644 (file)
@@ -47,6 +47,9 @@ enum UndoKind {
 
 class Undo
 {
+       /// noncopyable
+       Undo(Undo const &);
+       void operator=(Undo const &);
 public:
 
        Undo(Buffer &);
index 99a98369dccc6f0085e1ee073956192d2323eb2d..fe75b5bf1e97403be8e6f9b84646622cce2b1f88 100644 (file)
@@ -25,6 +25,9 @@ namespace lyx {
  */
 class FileDialog
 {
+       /// noncopyable
+       FileDialog(FileDialog const &);
+       void operator=(FileDialog const &);
 public:
        /// label, directory path button
        typedef std::pair<QString, QString> Button;
index ed7835fcca2d419ebcf98da81f18b24c723d16e7..b3a697cb86461fad84182c25ada941c9b026ab65 100644 (file)
@@ -269,8 +269,12 @@ typedef shared_ptr<Dialog> DialogPtr;
 } // namespace anon
 
 
-struct GuiView::GuiViewPrivate
+class GuiView::GuiViewPrivate
 {
+       /// noncopyable
+       GuiViewPrivate(GuiViewPrivate const &);
+       void operator=(GuiViewPrivate const &);
+public:
        GuiViewPrivate(GuiView * gv)
                : gv_(gv), current_work_area_(0), current_main_work_area_(0),
                layout_(0), autosave_timeout_(5000),
index 74aad81f83d0fd24f11567381b25e9cd699a6add..c3ccdbd80a678a0f7f18b38e18594ae2e528578a 100644 (file)
@@ -287,7 +287,7 @@ private:
        bool goToFileRow(std::string const & argument);
 
        ///
-       struct GuiViewPrivate;
+       class GuiViewPrivate;
        GuiViewPrivate & d;
 
 public:
index 0a4da449377c949c43cc5f6b3fe8552fe9c772e9..1054a098121fdba9527ae9ee284ce6692ee20631 100644 (file)
@@ -103,8 +103,12 @@ public:
 //
 /////////////////////////////////////////////////////////////////////
 
-struct LayoutBox::Private
+class LayoutBox::Private
 {
+       /// noncopyable
+       Private(Private const &);
+       void operator=(Private const &);
+public:
        Private(LayoutBox * parent, GuiView & gv) : p(parent), owner_(gv),
                inset_(0),
                // set the layout model with two columns
index 0b37e7e82a881bdddcde49fd281610fe9c8abf74..3ea92325f13852decab9496c31476e5d9d1f2dc1 100644 (file)
@@ -61,7 +61,7 @@ private Q_SLOTS:
 
 private:
        friend class LayoutItemDelegate;
-       struct Private;
+       class Private;
        Private * const d;
 };
 
index 0ee073e9fbc4eba0f66ae3986f9ae5658f3b404e..9bc78e348073cbf067b6f05e8641e2996be62c8c 100644 (file)
@@ -58,6 +58,9 @@ private:
 
 class Menus
 {
+       /// noncopyable
+       Menus(Menus const &);
+       void operator=(Menus const &);
 public:
        Menus();
        ~Menus();
index 6b4315b36bdbb538a81bf0b1c2f9e75e9379d40d..4d4d442719bb86d8fef5c7e7141e5fbd48cdfc67 100644 (file)
@@ -34,6 +34,9 @@ class TocTypeModel;
 /// There is one TocModel per list in the TocBackend.
 class TocModel
 {
+       /// noncopyable
+       TocModel(TocModel const &);
+       void operator=(TocModel const &);
 public:
        ///
        TocModel(QObject * parent);