Re: [LyX/master] Prevent accidental usage of wrong copy constructor
Le 11/11/2014 20:58, Georg Baum a écrit : commit 8f93600d3fa8182ba43973075cf37e7ecb2be8d3 Author: Georg Baum b...@lyx.org Date: Tue Nov 11 07:22:14 2014 +0100 Prevent accidental usage of wrong copy constructor Is this what we use boost:noncopyable for in some places? It would be nice to keep the same form in all these places. diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 103428a..37e26a8 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -282,6 +282,10 @@ private: class Paragraph::Private { + // Enforce our own copy constructor by declaring the standard one and + // the assignment operator private without implementing them. + Private(Private const ); + Private operator=(Private const ); public: /// Private(Paragraph * owner, Layout const layout);
Re: [LyX/master] Fix overflow of inset over text (see #9224)
Am 14.11.2014 um 11:21 schrieb Jean-Marc Lasgouttes: commit 81badf8550f2fd5e614a22261c4885d747a72106 Author: Jean-Marc Lasgouttes lasgout...@lyx.org Date: Fri Nov 14 11:13:38 2014 +0100 + static_castchar_type(row.sel_end), + row.begin_margin_sel, + row.end_margin_sel, + row.separator, + d.wid, d.asc, d.des }; Hi JMarc, this change triggers a compiler warning: ParagraphMetrics.cpp(108): warning C4244: 'initialization': conversion of 'const double' in 'const lyx::char_type', possible dataloss regards Uwe
Re: [LyX/master] Prevent accidental usage of wrong copy constructor
Jean-Marc Lasgouttes wrote: Le 11/11/2014 20:58, Georg Baum a écrit : commit 8f93600d3fa8182ba43973075cf37e7ecb2be8d3 Author: Georg Baum b...@lyx.org Date: Tue Nov 11 07:22:14 2014 +0100 Prevent accidental usage of wrong copy constructor Is this what we use boost:noncopyable for in some places? It would be nice to keep the same form in all these places. This used to be boost::noncopyable a long time ago, but IIRC this is now considered evil, because it pulls in a header just for very little benefit. Please correct me if I am wrong, I'll change this if that is the case. Georg
[RFC] should we disallow to insert floats, tables, figures and notes when cursor is in math
In http://www.lyx.org/trac/ticket/704 John Levon once complained about that we allow to insert floats etc. while the cursor is in math. Currently we still allow this but place the float before the formula. This might not what the user expects (he might have it behind the formula or wonders why the float is not placed into the math). So in my opinion we should disallow these insertions when the cursor is in math. But as you can read in the bug I already changed my opinion. So what do you think, should we disallow these insertions or keep it as it is? thanks and regards Uwe
Re: [LyX/master] Prevent accidental usage of wrong copy constructor
On 14/11/2014 18:48, Georg Baum wrote: Jean-Marc Lasgouttes wrote: Le 11/11/2014 20:58, Georg Baum a écrit : commit 8f93600d3fa8182ba43973075cf37e7ecb2be8d3 Author: Georg Baum b...@lyx.org Date: Tue Nov 11 07:22:14 2014 +0100 Prevent accidental usage of wrong copy constructor Is this what we use boost:noncopyable for in some places? It would be nice to keep the same form in all these places. This used to be boost::noncopyable a long time ago, but IIRC this is now considered evil, because it pulls in a header just for very little benefit. Please correct me if I am wrong, I'll change this if that is the case. I think you are right. Nitpick: private stuff is at the end of the class not at the top. Abdel. PS: I got some nice ideas today about teletext charset handling thanks to the work we did together on Unicode ;-)
Re: [LyX/master] Fix recursive math macro crash (bug #9140)
Georg Baum wrote: commit 0f2069b8a5967aac1b4f841214294f1fe21d2cad Author: Georg Baum b...@lyx.org Date: Fri Nov 14 21:30:42 2014 +0100 Fix recursive math macro crash (bug #9140) This is different from bug #8999, since in this case a new macro instance is created. You still get a TeX capacity exceeded error if you try to typeset the exported document, but this is the same as for bug #8999 and better than a crash. Richard, OK for branch? Georg
Re: [LyX/master] Prevent accidental usage of wrong copy constructor
Abdelrazak Younes wrote: Nitpick: private stuff is at the end of the class not at the top. Sure, but the private noncopyable stuff is the only thing I prefer at the top, since it is then near the other contructors. Abdel. PS: I got some nice ideas today about teletext charset handling thanks to the work we did together on Unicode ;-) :-) I also make use of what I learned back then on a regular basis. Georg
Re: [LyX/master] Fix recursive math macro crash (bug #9140)
On 11/14/2014 08:34 PM, Georg Baum wrote: Georg Baum wrote: commit 0f2069b8a5967aac1b4f841214294f1fe21d2cad Author: Georg Baum b...@lyx.org Date: Fri Nov 14 21:30:42 2014 +0100 Fix recursive math macro crash (bug #9140) This is different from bug #8999, since in this case a new macro instance is created. You still get a TeX capacity exceeded error if you try to typeset the exported document, but this is the same as for bug #8999 and better than a crash. Richard, OK for branch? OK. Richard
Re: [LyX/master] Prevent accidental usage of wrong copy constructor
On 11/14/2014 09:02 PM, Jean-Marc Lasgouttes wrote: I agree with you actually. My points were probably: * we should get rid of the few users of boost::noncopyable * ot would be better to use the terse style of comments we use elsewhere. It turns out there are only three places we use it. Now there are zero. Richard Le 14 novembre 2014 18:48:34 CET, Georg Baum georg.b...@post.rwth-aachen.de a écrit : Jean-Marc Lasgouttes wrote: Le 11/11/2014 20:58, Georg Baum a écrit : commit 8f93600d3fa8182ba43973075cf37e7ecb2be8d3 Author: Georg Baum b...@lyx.org Date: Tue Nov 11 07:22:14 2014 +0100 Prevent accidental usage of wrong copy constructor Is this what we use boost:noncopyable for in some places? It would be nice to keep the same form in all these places. This used to be boost::noncopyable a long time ago, but IIRC this is now considered evil, because it pulls in a header just for very little benefit. Please correct me if I am wrong, I'll change this if that is the case. Georg
Re: [LyX/master] Prevent accidental usage of wrong copy constructor
Le 11/11/2014 20:58, Georg Baum a écrit : commit 8f93600d3fa8182ba43973075cf37e7ecb2be8d3 Author: Georg BaumDate: Tue Nov 11 07:22:14 2014 +0100 Prevent accidental usage of wrong copy constructor Is this what we use boost:noncopyable for in some places? It would be nice to keep the same form in all these places. diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 103428a..37e26a8 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -282,6 +282,10 @@ private: class Paragraph::Private { + // Enforce our own "copy" constructor by declaring the standard one and + // the assignment operator private without implementing them. + Private(Private const &); + Private & operator=(Private const &); public: /// Private(Paragraph * owner, Layout const & layout);
Re: [LyX/master] Fix overflow of inset over text (see #9224)
Am 14.11.2014 um 11:21 schrieb Jean-Marc Lasgouttes: commit 81badf8550f2fd5e614a22261c4885d747a72106 Author: Jean-Marc LasgouttesDate: Fri Nov 14 11:13:38 2014 +0100 + static_cast(row.sel_end), + row.begin_margin_sel, + row.end_margin_sel, + row.separator, + d.wid, d.asc, d.des }; Hi JMarc, this change triggers a compiler warning: ParagraphMetrics.cpp(108): warning C4244: 'initialization': conversion of 'const double' in 'const lyx::char_type', possible dataloss regards Uwe
Re: [LyX/master] Prevent accidental usage of wrong copy constructor
Jean-Marc Lasgouttes wrote: > Le 11/11/2014 20:58, Georg Baum a écrit : >> commit 8f93600d3fa8182ba43973075cf37e7ecb2be8d3 >> Author: Georg Baum>> Date: Tue Nov 11 07:22:14 2014 +0100 >> >> Prevent accidental usage of wrong copy constructor > > Is this what we use boost:noncopyable for in some places? It would be > nice to keep the same form in all these places. This used to be boost::noncopyable a long time ago, but IIRC this is now considered evil, because it pulls in a header just for very little benefit. Please correct me if I am wrong, I'll change this if that is the case. Georg
[RFC] should we disallow to insert floats, tables, figures and notes when cursor is in math
In http://www.lyx.org/trac/ticket/704 John Levon once complained about that we allow to insert floats etc. while the cursor is in math. Currently we still allow this but place the float before the formula. This might not what the user expects (he might have it behind the formula or wonders why the float is not placed into the math). So in my opinion we should disallow these insertions when the cursor is in math. But as you can read in the bug I already changed my opinion. So what do you think, should we disallow these insertions or keep it as it is? thanks and regards Uwe
Re: [LyX/master] Prevent accidental usage of wrong copy constructor
On 14/11/2014 18:48, Georg Baum wrote: Jean-Marc Lasgouttes wrote: Le 11/11/2014 20:58, Georg Baum a écrit : commit 8f93600d3fa8182ba43973075cf37e7ecb2be8d3 Author: Georg BaumDate: Tue Nov 11 07:22:14 2014 +0100 Prevent accidental usage of wrong copy constructor Is this what we use boost:noncopyable for in some places? It would be nice to keep the same form in all these places. This used to be boost::noncopyable a long time ago, but IIRC this is now considered evil, because it pulls in a header just for very little benefit. Please correct me if I am wrong, I'll change this if that is the case. I think you are right. Nitpick: private stuff is at the end of the class not at the top. Abdel. PS: I got some nice ideas today about teletext charset handling thanks to the work we did together on Unicode ;-)
Re: [LyX/master] Fix recursive math macro crash (bug #9140)
Georg Baum wrote: > commit 0f2069b8a5967aac1b4f841214294f1fe21d2cad > Author: Georg Baum> Date: Fri Nov 14 21:30:42 2014 +0100 > > Fix recursive math macro crash (bug #9140) > > This is different from bug #8999, since in this case a new macro > instance is created. You still get a TeX capacity exceeded error if > you try to typeset the exported document, but this is the same as for > bug #8999 and better than a crash. Richard, OK for branch? Georg
Re: [LyX/master] Prevent accidental usage of wrong copy constructor
Abdelrazak Younes wrote: > Nitpick: private stuff is at the end of the class not at the top. Sure, but the private noncopyable stuff is the only thing I prefer at the top, since it is then near the other contructors. > Abdel. > > PS: I got some nice ideas today about teletext charset handling thanks > to the work we did together on Unicode ;-) :-) I also make use of what I learned back then on a regular basis. Georg
Re: [LyX/master] Fix recursive math macro crash (bug #9140)
On 11/14/2014 08:34 PM, Georg Baum wrote: Georg Baum wrote: commit 0f2069b8a5967aac1b4f841214294f1fe21d2cad Author: Georg BaumDate: Fri Nov 14 21:30:42 2014 +0100 Fix recursive math macro crash (bug #9140) This is different from bug #8999, since in this case a new macro instance is created. You still get a TeX capacity exceeded error if you try to typeset the exported document, but this is the same as for bug #8999 and better than a crash. Richard, OK for branch? OK. Richard
Re: [LyX/master] Prevent accidental usage of wrong copy constructor
On 11/14/2014 09:02 PM, Jean-Marc Lasgouttes wrote: I agree with you actually. My points were probably: * we should get rid of the few users of boost::noncopyable * ot would be better to use the terse style of comments we use elsewhere. It turns out there are only three places we use it. Now there are zero. Richard Le 14 novembre 2014 18:48:34 CET, Georg Bauma écrit : Jean-Marc Lasgouttes wrote: Le 11/11/2014 20:58, Georg Baum a écrit : commit 8f93600d3fa8182ba43973075cf37e7ecb2be8d3 Author: Georg Baum Date: Tue Nov 11 07:22:14 2014 +0100 Prevent accidental usage of wrong copy constructor Is this what we use boost:noncopyable for in some places? It would be nice to keep the same form in all these places. This used to be boost::noncopyable a long time ago, but IIRC this is now considered evil, because it pulls in a header just for very little benefit. Please correct me if I am wrong, I'll change this if that is the case. Georg