Fix spacing problems in previews with math macros (#13120)

This occurs on the legacy path when no cropping tools are available.

(cherry picked from commit 9ffacb341d)
This commit is contained in:
Juergen Spitzmueller 2024-11-06 18:26:14 +01:00
parent b86361ab5a
commit a8d90cde6f
2 changed files with 8 additions and 2 deletions

View File

@ -817,8 +817,11 @@ void InsetMathHull::usedMacros(MathData const & md, DocIterator const & pos,
if (data) { if (data) {
odocstringstream macro_def; odocstringstream macro_def;
data->write(macro_def, true); data->write(macro_def, true);
macro_def << endl; // Empty lines will generate full rows
defs.insert(macro_def.str()); // with legacy preview and tightpage (#13120).
// So remove all preceding and trailing line breaks
// and re-add one at the end of the snippet
defs.insert(trim(macro_def.str(), "\n") + "\n");
asArray(data->definition(), ar); asArray(data->definition(), ar);
} }
usedMacros(ar, pos, macros, defs); usedMacros(ar, pos, macros, defs);

View File

@ -72,6 +72,9 @@ What's new
- Fix loading order of fancyhdr (bug 13118). - Fix loading order of fancyhdr (bug 13118).
- Fix spacing problems in previews with math macros under specific
circumstances (bug 13120).
* USER INTERFACE * USER INTERFACE