diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index af4fd26110..d0a4bb801a 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -1682,7 +1682,7 @@ bool wxRichTextParagraphLayoutBox::SetStyle(const wxRichTextRange& range, const // Removes the given style from the paragraph wxRichTextRemoveStyle(newPara->GetAttributes(), style); } - if (resetExistingStyle) + else if (resetExistingStyle) newPara->GetAttributes() = wholeStyle; else { @@ -1762,7 +1762,7 @@ bool wxRichTextParagraphLayoutBox::SetStyle(const wxRichTextRange& range, const // Removes the given style from the paragraph wxRichTextRemoveStyle(child->GetAttributes(), style); } - if (resetExistingStyle) + else if (resetExistingStyle) child->GetAttributes() = characterAttributes; else {