Forbid wrong compiler generated copy constructors

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.
This commit is contained in:
Georg Baum 2015-09-20 19:43:06 +02:00
parent 141026b6b1
commit 1ad4d9e657
9 changed files with 27 additions and 4 deletions

View File

@ -27,6 +27,9 @@ namespace lyx {
class Thesaurus class Thesaurus
{ {
/// noncopyable
Thesaurus(Thesaurus const &);
void operator=(Thesaurus const &);
public: public:
/// ///
Thesaurus(); Thesaurus();

View File

@ -47,6 +47,9 @@ enum UndoKind {
class Undo class Undo
{ {
/// noncopyable
Undo(Undo const &);
void operator=(Undo const &);
public: public:
Undo(Buffer &); Undo(Buffer &);

View File

@ -25,6 +25,9 @@ namespace lyx {
*/ */
class FileDialog class FileDialog
{ {
/// noncopyable
FileDialog(FileDialog const &);
void operator=(FileDialog const &);
public: public:
/// label, directory path button /// label, directory path button
typedef std::pair<QString, QString> Button; typedef std::pair<QString, QString> Button;

View File

@ -269,8 +269,12 @@ typedef shared_ptr<Dialog> DialogPtr;
} // namespace anon } // namespace anon
struct GuiView::GuiViewPrivate class GuiView::GuiViewPrivate
{ {
/// noncopyable
GuiViewPrivate(GuiViewPrivate const &);
void operator=(GuiViewPrivate const &);
public:
GuiViewPrivate(GuiView * gv) GuiViewPrivate(GuiView * gv)
: gv_(gv), current_work_area_(0), current_main_work_area_(0), : gv_(gv), current_work_area_(0), current_main_work_area_(0),
layout_(0), autosave_timeout_(5000), layout_(0), autosave_timeout_(5000),

View File

@ -287,7 +287,7 @@ private:
bool goToFileRow(std::string const & argument); bool goToFileRow(std::string const & argument);
/// ///
struct GuiViewPrivate; class GuiViewPrivate;
GuiViewPrivate & d; GuiViewPrivate & d;
public: public:

View 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), Private(LayoutBox * parent, GuiView & gv) : p(parent), owner_(gv),
inset_(0), inset_(0),
// set the layout model with two columns // set the layout model with two columns

View File

@ -61,7 +61,7 @@ private Q_SLOTS:
private: private:
friend class LayoutItemDelegate; friend class LayoutItemDelegate;
struct Private; class Private;
Private * const d; Private * const d;
}; };

View File

@ -58,6 +58,9 @@ private:
class Menus class Menus
{ {
/// noncopyable
Menus(Menus const &);
void operator=(Menus const &);
public: public:
Menus(); Menus();
~Menus(); ~Menus();

View File

@ -34,6 +34,9 @@ class TocTypeModel;
/// There is one TocModel per list in the TocBackend. /// There is one TocModel per list in the TocBackend.
class TocModel class TocModel
{ {
/// noncopyable
TocModel(TocModel const &);
void operator=(TocModel const &);
public: public:
/// ///
TocModel(QObject * parent); TocModel(QObject * parent);