Commit bf636b2d authored by Awakening's avatar Awakening
Browse files

Don't switch to the same editor tab again

If we do, we're converting the contents of the other tab to the current tab,
and reverting all changes we've made (even if we saved).

BUG:424213
parent 8bf0fc58
...@@ -425,7 +425,8 @@ void SvgTextEditor::switchTextEditorTab(bool convertData) ...@@ -425,7 +425,8 @@ void SvgTextEditor::switchTextEditorTab(bool convertData)
disconnect(m_currentEditor->document(), SIGNAL(modificationChanged(bool)), this, SLOT(setModified(bool))); disconnect(m_currentEditor->document(), SIGNAL(modificationChanged(bool)), this, SLOT(setModified(bool)));
} }
if (isRichTextEditorActive()) { // do not switch to the same tab again, otherwise we're losing current changes
if (m_currentEditor != m_textEditorWidget.richTextEdit && isRichTextEditorActive()) {
//first, make buttons checkable //first, make buttons checkable
enableRichTextActions(true); enableRichTextActions(true);
enableSvgTextActions(false); enableSvgTextActions(false);
...@@ -444,7 +445,7 @@ void SvgTextEditor::switchTextEditorTab(bool convertData) ...@@ -444,7 +445,7 @@ void SvgTextEditor::switchTextEditorTab(bool convertData)
doc->clearUndoRedoStacks(); doc->clearUndoRedoStacks();
} }
m_currentEditor = m_textEditorWidget.richTextEdit; m_currentEditor = m_textEditorWidget.richTextEdit;
} else if (isSvgSourceEditorActive()) { } else if (m_currentEditor != m_textEditorWidget.svgTextEdit && isSvgSourceEditorActive()) {
//first, make buttons uncheckable //first, make buttons uncheckable
enableRichTextActions(false); enableRichTextActions(false);
enableSvgTextActions(true); enableSvgTextActions(true);
......
Supports Markdown
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