diff --git a/src/gui/qgsrichtexteditor.cpp b/src/gui/qgsrichtexteditor.cpp index d8775783886f..fb7aed3d0f2b 100644 --- a/src/gui/qgsrichtexteditor.cpp +++ b/src/gui/qgsrichtexteditor.cpp @@ -318,12 +318,12 @@ QString QgsRichTextEditor::toHtml() const void QgsRichTextEditor::editSource( bool enabled ) { - if ( enabled ) + if ( enabled && mStackedWidget->currentIndex() == 0 ) { mSourceEdit->setText( mTextEdit->toHtml() ); mStackedWidget->setCurrentIndex( 1 ); } - else + else if ( !enabled && mStackedWidget->currentIndex() == 1 ) { mTextEdit->setHtml( mSourceEdit->text() ); mStackedWidget->setCurrentIndex( 0 );