When an apostrophe or quotation mark is typed, autocorrect replaces it with the matching typographic quote. This was done in two edits: the typed straight character was inserted first, then replaced with the typographic one. Since each edit is its own undo step, undoing the autocorrect first turned the quote back into a straight quote and only a second undo removed it. In languages that never use straight quotes, for example French, typing 'un and undoing left a stray straight quote in the text. Build the typographic quote with a single edit, so one undo removes the whole quote. The change is limited to the quote handling. Autocorrections that insert a character and then act on something else, such as turning a web or mail address into a link after a space, keep their existing per-step undo Change-Id: Ibf47fb8f37d29d5ba180ed692f730d20e9f3e431 Signed-off-by: Pranam Lashkari <lpranam@collabora.com> Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5897 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CPCI <releng@collaboraoffice.com> (cherry picked from commit e2ba52e1996f81ff3b93fa70ecf625b7709d07fb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207621 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins