HtmlText Mode switch fix Control panel fix (cherry picked from commit b7d2cd06001a3d6a2f8a01e1261795b7da0eb461)