Re: [LyX/master] Fix Qt deprecation warns for setTextColor()

2020-03-19 Thread Scott Kostyshak
On Thu, Mar 19, 2020 at 03:44:41PM +0100, Jürgen Spitzmüller wrote:
> Am Donnerstag, den 19.03.2020, 15:11 +0100 schrieb Scott Kostyshak:
> > commit 8583410617c756e072ee997f918395d6f29b8246
> > Author: Scott Kostyshak 
> > Date:   Thu Mar 19 10:16:19 2020 -0400
> > 
> > Fix Qt deprecation warns for setTextColor()
> > 
> > This commit fixes the following warning from Qt 5.14:
> 
> Thanks for this initiative, Scott.
> 
> It's a pleasure to see these annoying warnings disappear by and by.

Thanks, Jürgen. There's not many left. However, I think that Qt 5.15
will bring a whole new bag of fun warnings/errors. At least we are a
little closer to being prepared for Qt 6.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Fix Qt deprecation warns for setTextColor()

2020-03-19 Thread Jürgen Spitzmüller
Am Donnerstag, den 19.03.2020, 15:11 +0100 schrieb Scott Kostyshak:
> commit 8583410617c756e072ee997f918395d6f29b8246
> Author: Scott Kostyshak 
> Date:   Thu Mar 19 10:16:19 2020 -0400
> 
> Fix Qt deprecation warns for setTextColor()
> 
> This commit fixes the following warning from Qt 5.14:

Thanks for this initiative, Scott.

It's a pleasure to see these annoying warnings disappear by and by.

Jürgen


signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: warns

2010-12-21 Thread Abdelrazak Younes

On 12/20/2010 02:00 PM, Pavel Sanda wrote:

Abdelrazak Younes wrote:
   

I don't think this could happen but yes, better safe than sorry :-)
 

dunno how much is this related to the last changes but is see new assert
in bugzilla with  lyx::RandomAccessListlyx::Paragraph::operator[] keyword...
#7188
   


I don't think this related.

Abdel.



Re: warns

2010-12-21 Thread Abdelrazak Younes

On 12/20/2010 02:00 PM, Pavel Sanda wrote:

Abdelrazak Younes wrote:
   

I don't think this could happen but yes, better safe than sorry :-)
 

dunno how much is this related to the last changes but is see new assert
in bugzilla with  lyx::RandomAccessList::operator[] keyword...
#7188
   


I don't think this related.

Abdel.



Re: warns

2010-12-20 Thread Pavel Sanda
Abdelrazak Younes wrote:
 I don't think this could happen but yes, better safe than sorry :-)

dunno how much is this related to the last changes but is see new assert
in bugzilla with  lyx::RandomAccessListlyx::Paragraph::operator[] keyword...
#7188

pavel


Re: warns

2010-12-20 Thread Pavel Sanda
Abdelrazak Younes wrote:
> I don't think this could happen but yes, better safe than sorry :-)

dunno how much is this related to the last changes but is see new assert
in bugzilla with  lyx::RandomAccessList::operator[] keyword...
#7188

pavel


warns

2010-12-19 Thread Pavel Sanda
  CXXoutput_xhtml.o
  output_latex.cpp: In function 'void lyx::TeXOnePar(const lyx::Buffer, const 
lyx::Text, lyx::pit_type, lyx::odocstream, lyx::TexRow, const 
lyx::OutputParams, const std::string, int, int)':
  output_latex.cpp:408: warning: comparison between signed and unsigned integer 
expressions
  output_latex.cpp: In function 'void lyx::latexParagraphs(const lyx::Buffer, 
const lyx::Text, lyx::odocstream, lyx::TexRow, const lyx::OutputParams, 
const std::string)':
  output_latex.cpp:980: warning: 'lastpit' may be used uninitialized in this 
function



Re: warns

2010-12-19 Thread Richard Heck

On 12/19/2010 05:00 PM, Pavel Sanda wrote:

   CXXoutput_xhtml.o
   output_latex.cpp: In function 'void lyx::TeXOnePar(const lyx::Buffer, const lyx::Text, 
lyx::pit_type, lyx::odocstream, lyx::TexRow, const lyx::OutputParams, const 
std::string, int, int)':
   output_latex.cpp:408: warning: comparison between signed and unsigned 
integer expressions
   output_latex.cpp: In function 'void lyx::latexParagraphs(const lyx::Buffer, const 
lyx::Text, lyx::odocstream, lyx::TexRow, const lyx::OutputParams, const 
std::string)':
   output_latex.cpp:980: warning: 'lastpit' may be used uninitialized in this 
function

Fixed. The latter was potentially serious. If the for loop never got 
executed, it would be uninitalized.


rh



Re: warns

2010-12-19 Thread Abdelrazak Younes

On 12/20/2010 02:37 AM, Richard Heck wrote:

On 12/19/2010 05:00 PM, Pavel Sanda wrote:

   CXXoutput_xhtml.o
   output_latex.cpp: In function 'void lyx::TeXOnePar(const 
lyx::Buffer, const lyx::Text, lyx::pit_type, lyx::odocstream, 
lyx::TexRow, const lyx::OutputParams, const std::string, int, int)':
   output_latex.cpp:408: warning: comparison between signed and 
unsigned integer expressions
   output_latex.cpp: In function 'void lyx::latexParagraphs(const 
lyx::Buffer, const lyx::Text, lyx::odocstream, lyx::TexRow, const 
lyx::OutputParams, const std::string)':
   output_latex.cpp:980: warning: 'lastpit' may be used uninitialized 
in this function



Fixed.


Thanks.

The latter was potentially serious. If the for loop never got 
executed, it would be uninitalized.


I don't think this could happen but yes, better safe than sorry :-)

Abdel.



warns

2010-12-19 Thread Pavel Sanda
  CXXoutput_xhtml.o
  output_latex.cpp: In function 'void lyx::TeXOnePar(const lyx::Buffer&, const 
lyx::Text&, lyx::pit_type, lyx::odocstream&, lyx::TexRow&, const 
lyx::OutputParams&, const std::string&, int, int)':
  output_latex.cpp:408: warning: comparison between signed and unsigned integer 
expressions
  output_latex.cpp: In function 'void lyx::latexParagraphs(const lyx::Buffer&, 
const lyx::Text&, lyx::odocstream&, lyx::TexRow&, const lyx::OutputParams&, 
const std::string&)':
  output_latex.cpp:980: warning: 'lastpit' may be used uninitialized in this 
function



Re: warns

2010-12-19 Thread Richard Heck

On 12/19/2010 05:00 PM, Pavel Sanda wrote:

   CXXoutput_xhtml.o
   output_latex.cpp: In function 'void lyx::TeXOnePar(const lyx::Buffer&, const lyx::Text&, 
lyx::pit_type, lyx::odocstream&, lyx::TexRow&, const lyx::OutputParams&, const 
std::string&, int, int)':
   output_latex.cpp:408: warning: comparison between signed and unsigned 
integer expressions
   output_latex.cpp: In function 'void lyx::latexParagraphs(const lyx::Buffer&, const 
lyx::Text&, lyx::odocstream&, lyx::TexRow&, const lyx::OutputParams&, const 
std::string&)':
   output_latex.cpp:980: warning: 'lastpit' may be used uninitialized in this 
function

Fixed. The latter was potentially serious. If the for loop never got 
executed, it would be uninitalized.


rh



Re: warns

2010-12-19 Thread Abdelrazak Younes

On 12/20/2010 02:37 AM, Richard Heck wrote:

On 12/19/2010 05:00 PM, Pavel Sanda wrote:

   CXXoutput_xhtml.o
   output_latex.cpp: In function 'void lyx::TeXOnePar(const 
lyx::Buffer&, const lyx::Text&, lyx::pit_type, lyx::odocstream&, 
lyx::TexRow&, const lyx::OutputParams&, const std::string&, int, int)':
   output_latex.cpp:408: warning: comparison between signed and 
unsigned integer expressions
   output_latex.cpp: In function 'void lyx::latexParagraphs(const 
lyx::Buffer&, const lyx::Text&, lyx::odocstream&, lyx::TexRow&, const 
lyx::OutputParams&, const std::string&)':
   output_latex.cpp:980: warning: 'lastpit' may be used uninitialized 
in this function



Fixed.


Thanks.

The latter was potentially serious. If the for loop never got 
executed, it would be uninitalized.


I don't think this could happen but yes, better safe than sorry :-)

Abdel.



[Patch] #6550: LyX warns that Any Changes will be lost even when there are no changes.

2010-10-25 Thread John McCabe-Dansted
When my file is modified externally and I select
   File-Revert to Saved
I get the following warning.
   Any changes will be lost. Are you sure you want to revert to the
saved version
of the document ...

I get this warning even when the buffer is clean so there are no
changes to be lost. I would not expect to get this warning when the
Buffer is clean because:
1) when the Buffer is clean, at best the warning forces me to waste a
mouse click.
2) Typically it forces me to stop and think Do I really have unsaved changes?
3) At worst it is Crying wolf so when I finally do accidentally
select Revert to Saved when I have unsaved changes I will select
Revert without thinking.

How does the attached patch against trunk look?

Note that this is the same as the patch below except that it has been
reformatted to fit in 80 columns. I have been using the patch below
for 8 months without noticing any regressions.
  http://www.lyx.org/trac/attachment/ticket/6550/GuiView.patch

I trust that reformatting the presentation of the text does not
require a re-translation?
I.e _(aa) vs. _(a a)

-- 
John C. McCabe-Dansted
Index: frontends/qt4/GuiView.cpp
===
--- frontends/qt4/GuiView.cpp	(revision 35426)
+++ frontends/qt4/GuiView.cpp	(working copy)
@@ -3036,11 +3036,21 @@
 
 		case LFUN_BUFFER_RELOAD: {
 			LASSERT(doc_buffer, break);
-			docstring const file = makeDisplayPath(doc_buffer-absFileName(), 20);
-			docstring text = bformat(_(Any changes will be lost. Are you sure 
- you want to revert to the saved version of the document %1$s?), file);
-			int const ret = Alert::prompt(_(Revert to saved document?),
-text, 1, 1, _(Revert), _(Cancel));
+			int ret;
+			
+			if (doc_buffer-isClean()) {
+ret = 0;
+			} else {
+docstring const file = makeDisplayPath(
+	doc_buffer-absFileName(), 20);
+docstring text = bformat(_(
+	Any changes will be lost. Are you sure
+	 you want to revert to the saved 
+	version of the document %1$s?), file);
+ret = Alert::prompt(
+	_(Revert to saved document?),
+	text, 1, 1, _(Revert), _(Cancel));
+			}
 
 			if (ret == 0) {
 doc_buffer-markClean();


Re: [Patch] #6550: LyX warns that Any Changes will be lost even when there are no changes.

2010-10-25 Thread Vincent van Ravesteijn
Committed.

Vincent


[Patch] #6550: LyX warns that "Any Changes will be lost" even when there are no changes.

2010-10-25 Thread John McCabe-Dansted
When my file is modified externally and I select
   File->Revert to Saved
I get the following warning.
   "Any changes will be lost. Are you sure you want to revert to the
saved version
of the document ..."

I get this warning even when the buffer is clean so there are no
changes to be lost. I would not expect to get this warning when the
Buffer is clean because:
1) when the Buffer is clean, at best the warning forces me to waste a
mouse click.
2) Typically it forces me to stop and think "Do I really have unsaved changes"?
3) At worst it is "Crying wolf" so when I finally do accidentally
select Revert to Saved when I have unsaved changes I will select
"Revert" without thinking.

How does the attached patch against trunk look?

Note that this is the same as the patch below except that it has been
reformatted to fit in 80 columns. I have been using the patch below
for 8 months without noticing any regressions.
  http://www.lyx.org/trac/attachment/ticket/6550/GuiView.patch

I trust that reformatting the presentation of the text does not
require a re-translation?
I.e _("aa") vs. _("a" "a")

-- 
John C. McCabe-Dansted
Index: frontends/qt4/GuiView.cpp
===
--- frontends/qt4/GuiView.cpp	(revision 35426)
+++ frontends/qt4/GuiView.cpp	(working copy)
@@ -3036,11 +3036,21 @@
 
 		case LFUN_BUFFER_RELOAD: {
 			LASSERT(doc_buffer, break);
-			docstring const file = makeDisplayPath(doc_buffer->absFileName(), 20);
-			docstring text = bformat(_("Any changes will be lost. Are you sure "
- "you want to revert to the saved version of the document %1$s?"), file);
-			int const ret = Alert::prompt(_("Revert to saved document?"),
-text, 1, 1, _(""), _(""));
+			int ret;
+			
+			if (doc_buffer->isClean()) {
+ret = 0;
+			} else {
+docstring const file = makeDisplayPath(
+	doc_buffer->absFileName(), 20);
+docstring text = bformat(_(
+	"Any changes will be lost. Are you sure"
+	" you want to revert to the saved "
+	"version of the document %1$s?"), file);
+ret = Alert::prompt(
+	_("Revert to saved document?"),
+	text, 1, 1, _(""), _(""));
+			}
 
 			if (ret == 0) {
 doc_buffer->markClean();


Re: [Patch] #6550: LyX warns that "Any Changes will be lost" even when there are no changes.

2010-10-25 Thread Vincent van Ravesteijn
Committed.

Vincent