[LyX/master] Amend 44816adce63: Be careful before using buffer parameters in colAlign

Richard Kimberly Heck rikiheck at lyx.org
Mon Jun 1 16:28:04 UTC 2020


On 6/1/20 3:59 AM, Kornel Benko wrote:
> commit 38ec7471e79b33e283afe2fa64a4ab4e4afa3528
> Author: Kornel Benko <kornel at lyx.org>
> Date:   Mon Jun 1 10:20:38 2020 +0200
>
>     Amend 44816adce63: Be careful before using buffer parameters in colAlign
>     
>     The LASSERT(isBufferValid()..) leads to crash in find-adv dialog
> ---
>  src/mathed/InsetMathGrid.cpp |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp
> index b6d90ee..5a5d454 100644
> --- a/src/mathed/InsetMathGrid.cpp
> +++ b/src/mathed/InsetMathGrid.cpp
> @@ -1821,9 +1821,17 @@ char InsetMathGrid::colAlign(HullType type, col_type col) const
>  	case hullMultline:
>  		return 'c';
>  	case hullGather:
> +		#if 0
> +		// Partly revert 44816adce63
> +		// because the following test leads to crash
> +		// Open a new lyx-file
> +		// select findadv dialog
> +		// in the search-field enter math
> +		// use math-mutate gather ===> crash (because isValidBuffer() == false)
>  		LASSERT(isBufferValid(),
>  				LYXERR0("Buffer not set correctly. Please report!");
>  				return 'c';);
> +		#endif
>  		if (buffer().params().is_math_indent)
>  			return 'l';
>  		else
I've fixed it properly.

Riki





More information about the lyx-devel mailing list