From 34a6a0b44316f5c1e1986ece3d27a6b084642c3d Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 5 Apr 2014 16:45:55 +0000 Subject: [PATCH] GridCtrl: fixed for C++11 git-svn-id: svn://ultimatepp.org/upp/trunk@7177 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/srcdoc.tpp/Tutorial$en-us.tpp | 8 +++++++- uppsrc/GridCtrl/GridCtrl.cpp | 2 -- uppsrc/GridCtrl/GridCtrl.h | 4 +++- uppsrc/GridCtrl/GridDisplay.h | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/uppsrc/Core/srcdoc.tpp/Tutorial$en-us.tpp b/uppsrc/Core/srcdoc.tpp/Tutorial$en-us.tpp index bf923a68a..a51ce8252 100644 --- a/uppsrc/Core/srcdoc.tpp/Tutorial$en-us.tpp +++ b/uppsrc/Core/srcdoc.tpp/Tutorial$en-us.tpp @@ -114,7 +114,13 @@ define interface contract using&] [s7; -|struct Distribution : [* Moveable] `{&] [s7; -|-|String text;&] [s7; -|-|Vector data;&] +[s7; &] +[s7; -|-|rval`_default(Distribution);&] +[s7; -|-|Distribution() `{`}&] [s7; -|`};&] +[s5; Note that rval`_default macro is helper to restore default deleted +r`-value constructor in C`+`+11 and default constructor is also +default deleted in C`+`+11.&] [s5; Now to add Distribution elements you cannot use Add with parameter, because it requires elements to have default deep`-copy constructor `- and Distribution does not have one, as Vector has default @@ -667,7 +673,7 @@ and operators <, <`=, >, >`=:&] [s7; -|&] [s7; -|y.b `= `"a`";&] [s7; -|&] -[s7; -|DUMP(SgnCompare(y));&] +[s7; -|DUMP(SgnCompare(x, y));&] [s7; -|DUMP(x < y);&] [s7; -|&] [s7; &] diff --git a/uppsrc/GridCtrl/GridCtrl.cpp b/uppsrc/GridCtrl/GridCtrl.cpp index 4fecb84b5..38d22d69c 100644 --- a/uppsrc/GridCtrl/GridCtrl.cpp +++ b/uppsrc/GridCtrl/GridCtrl.cpp @@ -1826,8 +1826,6 @@ void GridCtrl::RemoveColumn(int n, int count) r.Add(hitems[n + i].id); } - int id = hitems[n].id; - hitems.Remove(n, count); rowbkp.Remove(r); summary.Remove(r); diff --git a/uppsrc/GridCtrl/GridCtrl.h b/uppsrc/GridCtrl/GridCtrl.h index 22056a4a3..100c4a8ef 100644 --- a/uppsrc/GridCtrl/GridCtrl.h +++ b/uppsrc/GridCtrl/GridCtrl.h @@ -231,6 +231,9 @@ class CtrlsHolder : public Ctrl class GridClipboard : Moveable { public: + rval_default(GridClipboard); + GridClipboard() {} + struct ClipboardData : Moveable { int col, row; @@ -1860,7 +1863,6 @@ class GridText : Ctrl const Id* column; Color fg, bg; Font fnt; - int align; public: diff --git a/uppsrc/GridCtrl/GridDisplay.h b/uppsrc/GridCtrl/GridDisplay.h index d797d950f..fcbc7fd55 100644 --- a/uppsrc/GridCtrl/GridDisplay.h +++ b/uppsrc/GridCtrl/GridDisplay.h @@ -72,7 +72,7 @@ class GridDisplay void SetDefault(); - ~GridDisplay() {}; + virtual ~GridDisplay() {}; void SetLeftImage(const Image &img) { leftImg = img; } void SetRightImage(const Image &img) { rightImg = img; }