summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2013-11-19 19:55:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-11-25 05:25:25 -0600
commit0299cfaca263b1cc635980fdd8497346d5cb8513 (patch)
treea79f75184b78469cc1f469fd65680ed42881aad7
parentcfcd8112c0cb459646ea8c17bd889c945e75f3a5 (diff)
fdo#67742 Avoid autocorr of "--" before "-"
LibO 4.1 now uses '-' as word separator for AutoCorrection Then the sequence "---" is detected as word "--" and autocorrect as "–". This avoids autocorrection of "---", as word or as border This commit detects the sequence "---" and report autocorrection. Modified for LibO 4.1 (OUString => String) Change-Id: I1342c2ff83dd42683e683b3bb27280d61179b9a2 Reviewed-on: https://gerrit.libreoffice.org/6747 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--editeng/source/misc/svxacorr.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index cc61b5e443e2..a5e227902f85 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1330,6 +1330,11 @@ SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
sal_Bool bChgWord = rDoc.ChgAutoCorrWord( nCapLttrPos, nInsPos,
*this, ppPara );
+ // since LibO 4.1, '-' is a word separator
+ // fdo#67742 avoid "--" to be replaced by "–" if next is "-"
+ if( rTxt.Len() >= 3 &&
+ rTxt.Equals( String("---"), rTxt.Len()-3, 3 ) )
+ break;
if( !bChgWord )
{
xub_StrLen nCapLttrPos1 = nCapLttrPos, nInsPos1 = nInsPos;