mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Update all paragraphs layouts when undoing bufferparams
When undo restores a previous BufferParams instance, it should also update all the layout pointers in the document's paragraphs. Fixes #9916.
This commit is contained in:
parent
8d00943aab
commit
82b6dc8aa9
@ -21,6 +21,8 @@
|
|||||||
#include "BufferParams.h"
|
#include "BufferParams.h"
|
||||||
#include "buffer_funcs.h"
|
#include "buffer_funcs.h"
|
||||||
#include "Cursor.h"
|
#include "Cursor.h"
|
||||||
|
#include "CutAndPaste.h"
|
||||||
|
#include "ErrorList.h"
|
||||||
#include "Paragraph.h"
|
#include "Paragraph.h"
|
||||||
#include "ParagraphList.h"
|
#include "ParagraphList.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
@ -29,6 +31,7 @@
|
|||||||
#include "mathed/MathData.h"
|
#include "mathed/MathData.h"
|
||||||
|
|
||||||
#include "insets/Inset.h"
|
#include "insets/Inset.h"
|
||||||
|
#include "insets/InsetText.h"
|
||||||
|
|
||||||
#include "support/debug.h"
|
#include "support/debug.h"
|
||||||
#include "support/gettext.h"
|
#include "support/gettext.h"
|
||||||
@ -453,7 +456,13 @@ void Undo::Private::doTextUndoOrRedo(CursorData & cur, UndoElementStack & stack,
|
|||||||
// This is a params undo element
|
// This is a params undo element
|
||||||
delete otherstack.top().bparams;
|
delete otherstack.top().bparams;
|
||||||
otherstack.top().bparams = new BufferParams(buffer_.params());
|
otherstack.top().bparams = new BufferParams(buffer_.params());
|
||||||
|
DocumentClassConstPtr olddc = buffer_.params().documentClassPtr();
|
||||||
buffer_.params() = *undo.bparams;
|
buffer_.params() = *undo.bparams;
|
||||||
|
// The error list is not supposed to be helpful here.
|
||||||
|
ErrorList el;
|
||||||
|
cap::switchBetweenClasses(olddc, buffer_.params().documentClassPtr(),
|
||||||
|
static_cast<InsetText &>(buffer_.inset()), el);
|
||||||
|
LATTEST(el.empty());
|
||||||
} else if (dit.inMathed()) {
|
} else if (dit.inMathed()) {
|
||||||
// We stored the full cell here as there is not much to be
|
// We stored the full cell here as there is not much to be
|
||||||
// gained by storing just 'a few' paragraphs (most if not
|
// gained by storing just 'a few' paragraphs (most if not
|
||||||
|
Loading…
Reference in New Issue
Block a user