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
{
/// noncopyable
Thesaurus(Thesaurus const &);
void operator=(Thesaurus const &);
public:
///
Thesaurus();

View File

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

View 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;

View 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),

View File

@ -287,7 +287,7 @@ private:
bool goToFileRow(std::string const & argument);
///
struct GuiViewPrivate;
class GuiViewPrivate;
GuiViewPrivate & d;
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),
inset_(0),
// set the layout model with two columns

View File

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

View File

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

View 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);