summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2013-10-10 20:16:07 +0200
committerEike Rathke <erack@redhat.com>2013-11-03 16:58:53 +0100
commitebb867f2b7d268eba5f39d387713fc2dac99a06d (patch)
tree0fe10efd13ac35cf1f5d2deaeb430f867f393ff4
parent148770af39a82f52a5d267e40941684791df4c66 (diff)
fdo#69762 Scientific number AutoCorrect as ordinal
In French, ordinal number autocorrection transforms 2e-3 in 2^e-3 which is annoying in Calc. This patch avoids autocorrection with [digit][e|E]- Reviewed-on: https://gerrit.libreoffice.org/6204 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 938881340e9203d3b265596b8c7359bb27560912) Backported. Change-Id: Iaaff4f8d6e667fc84a68d7c11e1a96da13594a18 Signed-off-by: Eike Rathke <erack@redhat.com>
-rw-r--r--editeng/source/misc/svxacorr.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 9e3b325266e0..cc61b5e443e2 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1376,6 +1376,9 @@ SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
}
if( ( IsAutoCorrFlag( nRet = ChgOrdinalNumber ) &&
+ (nInsPos >= 2 ) && // fdo#69762 avoid autocorrect for 2e-3
+ ( '-' != cChar || 'E' != toupper(rTxt.GetChar(nInsPos-1)) ||
+ '0' > rTxt.GetChar(nInsPos-2) || '9' < rTxt.GetChar(nInsPos-2) ) &&
FnChgOrdinalNumber( rDoc, rTxt, nCapLttrPos, nInsPos, eLang ) ) ||
( IsAutoCorrFlag( nRet = SetINetAttr ) &&
( ' ' == cChar || '\t' == cChar || 0x0a == cChar || !cChar ) &&