]> git.lyx.org Git - lyx.git/commit
Force a Buffer * argument to MathData constructor
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 24 Apr 2024 10:04:23 +0000 (12:04 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 24 Apr 2024 14:26:57 +0000 (16:26 +0200)
commit57d713065545ac53a62a641d12a8b8c2c62c22fc
tree4404513ff92609e476e22c950e475a6a370e858a
parentf3c5ff9cb72c5231f1e1e81452e67d6f12dadecb
Force a Buffer * argument to MathData constructor

In order to ensure that MathData objects have a valid buffer, the
default MathData() constructor is deleted. This means that a buffer
shall be specified for each MathData object created.

This is fairly mechanical, actually. In particular, in most
InsetMathXxx cases, in MathData and in MathParser, the available
buffer_ member is used.

More specific cases:
- lyxfind.cpp takes the buffer from the Cursor

- calls to vector<MathData>::resize take an additional
  MathData(buffer_) parameter. There are cases where resize actually
  remove cells, and in this case clear() or even erase() have been
  used.

- in InsetMathMacroTemplate, the optional parameters of the
  constructors cannot be allowed anymore (a default value cannot
  depend on another parameter). Therefore there a now two constructors
  instead.

- in MathAutoCorrect.cpp, the MathData objects are not bound to a
  buffer, so that std::nullptr is used instead.

- in MathExtern, use a buffer when one is specified, std::nulptr
  instead.
16 files changed:
src/lyxfind.cpp
src/mathed/InsetMath.cpp
src/mathed/InsetMathGrid.cpp
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathMacro.cpp
src/mathed/InsetMathMacroTemplate.cpp
src/mathed/InsetMathMacroTemplate.h
src/mathed/InsetMathNest.cpp
src/mathed/InsetMathRef.cpp
src/mathed/InsetMathScript.cpp
src/mathed/InsetMathSpace.cpp
src/mathed/MathAutoCorrect.cpp
src/mathed/MathData.cpp
src/mathed/MathData.h
src/mathed/MathExtern.cpp
src/mathed/MathParser.cpp