Re: Crash in 2.3.x

2021-10-11 Thread Jürgen Spitzmüller
Am Montag, dem 11.10.2021 um 21:37 +0200 schrieb Pavel Sanda:
> I quickly went through the original patch now, just wanted to double
> check that in two points - parent on GuiPrefs.cpp:3450 and
> item(character) on BulletsModule.cpp:162 we can't reach null (it was
> not self-obvious from the code to me).

There was no null check in the old code here, but to be sure, you can
add safety checks at these places.

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: Crash in 2.3.x

2021-10-11 Thread Pavel Sanda
On Mon, Oct 11, 2021 at 06:43:16PM +0200, Jürgen Spitzmüller wrote:
> Am Montag, dem 11.10.2021 um 17:55 +0200 schrieb Pavel Sanda:
> > Bisect suggests the following commit:
> > 
> > commit da0d01cc107d112d8b640dce92bfa6e943c1569c
> > Author: Juergen Spitzmueller 
> > Date:   Sat Mar 13 11:29:54 2021 +0100
> > 
> >     Backport deprecation fix
> 
> Attached patch fixes it.

Thanks, Juergen.

I quickly went through the original patch now, just wanted to double check
that in two points - parent on GuiPrefs.cpp:3450 and item(character) on 
BulletsModule.cpp:162
we can't reach null (it was not self-obvious from the code to me).

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in 2.3.x

2021-10-11 Thread Jürgen Spitzmüller
Am Montag, dem 11.10.2021 um 17:55 +0200 schrieb Pavel Sanda:
> Bisect suggests the following commit:
> 
> commit da0d01cc107d112d8b640dce92bfa6e943c1569c
> Author: Juergen Spitzmueller 
> Date:   Sat Mar 13 11:29:54 2021 +0100
> 
>     Backport deprecation fix

Attached patch fixes it.

OK to commit, Riki?

Jürgen

diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp
index 5e91c62fe6..e9bdbaf522 100644
--- a/src/frontends/qt4/GuiPrefs.cpp
+++ b/src/frontends/qt4/GuiPrefs.cpp
@@ -3340,7 +3340,8 @@ void PrefShortcuts::on_searchLE_textEdited()
 	for (int i = 0; i < matched.size(); ++i)
 		if (!isAlwaysHidden(*matched[i])) {
 			matched[i]->setHidden(false);
-			matched[i]->parent()->setExpanded(true);
+			if (matched[i]->parent())
+matched[i]->parent()->setExpanded(true);
 		}
 }
 


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: Crash in 2.3.x

2021-10-11 Thread Pavel Sanda
On Mon, Oct 11, 2021 at 04:27:19PM +0200, Kornel Benko wrote:
> Am Mon, 11 Oct 2021 15:51:07 +0200
> schrieb Pavel Sanda :
> 
> > On Mon, Oct 11, 2021 at 03:39:18PM +0200, Pavel Sanda wrote:
> > > Hi,
> > > 
> > > can anyone reproduce the following crash recipy? :
> > > 1. Preferences -> Shortcuts -> Show keybindings containing
> > > 2. Press "i"
> > > 3. Kaboom
> > > 
> > > Current 2.3.x branch on stable debian.   
> > 
> > (gdb) bt
> > #0  0x77ca32d8 in QTreeWidgetItem::treeModel(QTreeWidget*) const ()
> > from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 #1  0x77ca3a0b in
> > QTreeWidgetItem::setExpanded(bool) () from 
> > /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
> > #2  0x55eef1a4 in 
> > lyx::frontend::PrefShortcuts::on_searchLE_textEdited() () #3
> > 0x55ef3fb1 in 
> > lyx::frontend::PrefShortcuts::qt_static_metacall(QObject*,
> > QMetaObject::Call, int, void**) () #4  0x55ef4026 in
> > lyx::frontend::PrefShortcuts::qt_metacall(QMetaObject::Call, int, void**) ()
> > 
> > > Pavel  
> 
> Same here.
> Thread 1 "lyx2.3" received signal SIGSEGV, Segmentation fault.
> 0x56c8d753 in QTreeWidgetItem::setExpanded (this=0x0, aexpand=true)
> at /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtreewidget.h:407
> 407   { if (view) view->setItemExpanded(this, aexpand); }
> 
> this == 0 looks not good.
> 
>   Kornel

Bisect suggests the following commit:

commit da0d01cc107d112d8b640dce92bfa6e943c1569c
Author: Juergen Spitzmueller 
Date:   Sat Mar 13 11:29:54 2021 +0100

Backport deprecation fix

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in 2.3.x

2021-10-11 Thread Kornel Benko
Am Mon, 11 Oct 2021 15:51:07 +0200
schrieb Pavel Sanda :

> On Mon, Oct 11, 2021 at 03:39:18PM +0200, Pavel Sanda wrote:
> > Hi,
> > 
> > can anyone reproduce the following crash recipy? :
> > 1. Preferences -> Shortcuts -> Show keybindings containing
> > 2. Press "i"
> > 3. Kaboom
> > 
> > Current 2.3.x branch on stable debian.   
> 
> (gdb) bt
> #0  0x77ca32d8 in QTreeWidgetItem::treeModel(QTreeWidget*) const ()
> from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 #1  0x77ca3a0b in
> QTreeWidgetItem::setExpanded(bool) () from 
> /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
> #2  0x55eef1a4 in 
> lyx::frontend::PrefShortcuts::on_searchLE_textEdited() () #3
> 0x55ef3fb1 in 
> lyx::frontend::PrefShortcuts::qt_static_metacall(QObject*,
> QMetaObject::Call, int, void**) () #4  0x55ef4026 in
> lyx::frontend::PrefShortcuts::qt_metacall(QMetaObject::Call, int, void**) ()
> 
> > Pavel  

Same here.
Thread 1 "lyx2.3" received signal SIGSEGV, Segmentation fault.
0x56c8d753 in QTreeWidgetItem::setExpanded (this=0x0, aexpand=true)
at /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtreewidget.h:407
407 { if (view) view->setItemExpanded(this, aexpand); }

this == 0 looks not good.

Kornel



pgpdJpXFAwr32.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash in 2.3.x

2021-10-11 Thread Pavel Sanda
On Mon, Oct 11, 2021 at 03:39:18PM +0200, Pavel Sanda wrote:
> Hi,
> 
> can anyone reproduce the following crash recipy? :
> 1. Preferences -> Shortcuts -> Show keybindings containing
> 2. Press "i"
> 3. Kaboom
> 
> Current 2.3.x branch on stable debian. 

(gdb) bt
#0  0x77ca32d8 in QTreeWidgetItem::treeModel(QTreeWidget*) const () 
from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#1  0x77ca3a0b in QTreeWidgetItem::setExpanded(bool) () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#2  0x55eef1a4 in 
lyx::frontend::PrefShortcuts::on_searchLE_textEdited() ()
#3  0x55ef3fb1 in 
lyx::frontend::PrefShortcuts::qt_static_metacall(QObject*, QMetaObject::Call, 
int, void**) ()
#4  0x55ef4026 in 
lyx::frontend::PrefShortcuts::qt_metacall(QMetaObject::Call, int, void**) ()

> Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Crash in 2.3.x

2021-10-11 Thread Pavel Sanda
Hi,

can anyone reproduce the following crash recipy? :
1. Preferences -> Shortcuts -> Show keybindings containing
2. Press "i"
3. Kaboom

Current 2.3.x branch on stable debian. 
Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: lua-widow-control

2021-10-11 Thread Dr Eberhard Lisse

Jürgen,

sure, attached to a button like microtype is, perhaps even in the same
screen :-)-O

greetings, el

On 11/10/2021 13:57, Jürgen Spitzmüller wrote:

Am Montag, dem 11.10.2021 um 13:37 +0200 schrieb Dr Eberhard Lisse:

Is this something that one would like as default, ie included by LyX?


I think, similar to microtype et al., this is only sensible as an
(opt- in) option.  Total removal of widows and orphans (which also can
be achieved by tweaking TeX dimens) also has drawbacks.  There is no
one- fits-all solution (otherwise it would be default in TeX itself).

Jürgen




--
To email me replace 'nospam' with 'el'

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: lua-widow-control

2021-10-11 Thread Jürgen Spitzmüller
Am Montag, dem 11.10.2021 um 13:37 +0200 schrieb Dr Eberhard Lisse:
> Is this something that one would like as default, ie included by LyX?

I think, similar to microtype et al., this is only sensible as an (opt-
in) option. Total removal of widows and orphans (which also can be
achieved by tweaking TeX dimens) also has drawbacks. There is no one-
fits-all solution (otherwise it would be default in TeX itself).

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


lua-widow-control

2021-10-11 Thread Dr Eberhard Lisse

Is this something that one would like as default, ie included by LyX?

el

On 11/10/2021 10:21, CTAN Announcements wrote:

Max Chernoff submitted the

 lua-widow-control

package.

Version:  1.0.0 2021-10-09
License:  other-free cc-by-sa-4

Summary description: Automatically remove widows and orphans from any
document

Announcement text:
--
  
  Lua-widow-control is a Plain TeX/LaTeX/ConTeXt package that removes

  widows and orphans without any user intervention.  Using the power
  of LuaTeX, it does so without stretching any glue or shortening any
  pages.  Instead, lua-widow-control automatically lengthens a
  paragraph on a page where a widow or orphan would otherwise occur.

  Unmodified TeX has very few ways of preventing widows and orphans.
  In documents with figures, section headings, and equations, TeX can
  stretch the vertical glue between items in order to prevent widows
  and orphans, but many documents have no figures or headings.  TeX
  can also shorten the page by 1 line, but this will give each page a
  different length which can make a document look uneven.  The typical
  solution is to strategically insert \looseness=1, but this requires
  manual editing every time that the document is edited.
  Lua-widow-control is essentially an automation of the \looseness
  method: it uses Lua callbacks to find "stretchy" paragraphs, then it
  lengthens them to remove widows and orphans.

  Lua-widow-control is compatible with all LuaTeX-based formats.  All
  that is required is to load the package at the start of your
  document.  
  
  To load: 
- Plain LuaTeX: \input lua-widow-control

- LuaLaTeX: \usepackage{lua-widow-control}
- ConTeXt (LMTX): \usemodule[lua-widow-control]

--

The package’s Catalogue entry can be viewed at
https://ctan.org/pkg/lua-widow-control

The package’s files themselves can be inspected at
https://mirrors.ctan.org/macros/luatex/generic/lua-widow-control/

[...]


--
To email me replace 'nospam' with 'el'



--
To email me replace 'nospam' with 'el'

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel