Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit aa530e9f authored by C. Boemann's avatar C. Boemann

Try a bit harder to have a undostack, and don't crash if we don't

parent 8ebe16d9
......@@ -661,13 +661,17 @@ void KoStyleManager::beginEdit()
void KoStyleManager::endEdit()
{
Q_ASSERT (d->changeCommand);
d->undoStack->push(d->changeCommand);
if (d->undoStack) {
d->undoStack->push(d->changeCommand);
}
d->changeCommand = 0;
}
void KoStyleManager::add(QTextDocument *document)
{
d->undoStack = KoTextDocument(document).undoStack();
if (!d->undoStack) {
d->undoStack = KoTextDocument(document).undoStack();
}
foreach(ChangeFollower *cf, d->documentUpdaterProxies) {
if (cf->document() == document) {
return; // already present.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment