[LyX/master] Revert "Improve structure of updateMacros"

Scott Kostyshak skostysh at lyx.org
Wed Nov 11 17:17:38 UTC 2020


On Wed, Nov 11, 2020 at 05:13:51PM +0100, Richard Kimberly Heck wrote:
> commit fdd0a6f84923f1d4a1f82457a3e256a2ee706f6b
> Author: Richard Kimberly Heck <rikiheck at lyx.org>
> Date:   Wed Nov 11 11:24:59 2020 -0500
> 
>     Revert "Improve structure of updateMacros"
>     
>     The problem here is that the check against TEXT_CODE only
>     catches InsetText, and not its subclasses. Same for the check
>     against MATH_HULL_CODE. So there is reason not to check codes
>     here.
>     
>     This reverts commit 5a54ccfa87057fd3220d7193b40ac2dd37a9e6e1.
> ---
> [cut] 
> diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp
> index ce1f4b5..39d5f80 100644
> --- a/src/mathed/MathData.cpp
> +++ b/src/mathed/MathData.cpp
> @@ -403,8 +403,8 @@ void MathData::updateMacros(Cursor * cur, MacroContext const & mc,
>  {
>  	// If we are editing a macro, we cannot update it immediately,
>  	// otherwise wrong undo steps will be recorded (bug 6208).
> -	InsetMath const * inmath = cur ? cur->inset().asInsetMath() : nullptr;
> -	InsetMathMacro const * inmacro = inmath ? inmath->asMacro() : nullptr;
> +	InsetMath const * inmath = cur ? cur->inset().asInsetMath() : 0;
> +	InsetMathMacro const * inmacro = inmath ? inmath->asMacro() : 0;
>  	docstring const edited_name = inmacro ? inmacro->name() : docstring();

Should we still keep the above nullptr changes?

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20201111/30b0f311/attachment.asc>


More information about the lyx-devel mailing list