summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-08-30 12:38:27 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-02 16:28:57 +0000
commit4edd7ed8bc2c75a23babe9893fdbe58dd7bcf562 (patch)
tree3c3646e8cdc5632ed7e807bbd767b3a497704816 /editeng
parent1de7b0009a09d3cc819ba86e8dd26f846656ae79 (diff)
Resolves: tdf#96369 don't superscript ordinals for mixed text and numbers
e.g. 5th is ok, but foo5th is not this is basically a regression from commit 17e6b8fd05af8fff86847c0ef1e8cc9ad013a1bd Date: Thu Apr 7 13:33:48 2011 +0200 where the older code would only do the conversion if the string before the number was comprised of non-letters, so go back to that logic. Change-Id: I928c365eb11891e78331bbd165dbdb9541ac0361 (cherry picked from commit 776e2e2635487523cd1757f382f54487b36b5ad3) Reviewed-on: https://gerrit.libreoffice.org/28495 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/misc/svxacorr.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 5545432fd11c..0bfd925c8a99 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -461,13 +461,12 @@ bool SvxAutoCorrect::FnChgOrdinalNumber(
bool bFoundEnd = false;
bool isValidNumber = true;
sal_Int32 i = nEndPos;
-
while (i > nSttPos)
{
i--;
bool isDigit = rCC.isDigit(rTxt, i);
if (bFoundEnd)
- isValidNumber |= isDigit;
+ isValidNumber &= (isDigit || !rCC.isLetter(rTxt, i));
if (isDigit && !bFoundEnd)
{