[Libreoffice-commits] .: 2 commits - editeng/source
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Feb 21 13:22:56 PST 2011
editeng/source/misc/svxacorr.cxx | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
New commits:
commit 7b0386a2e06ea0fc64ae5654c47bf2a65d167635
Author: Sébastien Le Ray <sebastien-libreoffice at orniz.org>
Date: Mon Feb 21 08:44:51 2011 +0100
Disable protocols capitalization
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 0c08373..70c9728 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -836,7 +836,6 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
}
} while( 0 == ( bAtStart = (pStart == pStr)) );
-
if( !pWordStt ||
rCC.isDigit(
aText, sal::static_int_cast< xub_StrLen >( pStr - pStart ) ) ||
@@ -844,6 +843,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
rCC.getCharacterType(
aText,
sal::static_int_cast< xub_StrLen >( pWordStt - pStart ) ) ) ||
+ INetURLObject::CompareProtocolScheme(rTxt.Copy(pWordStt - pStart, pDelim - pWordStt + 1)) != INET_PROT_NOT_VALID ||
0x1 == *pWordStt || 0x2 == *pWordStt )
return FALSE; // no character to be replaced, or already ok
commit 3f9c193d3755c29a81d644739c3e64662975ca75
Author: Sébastien Le Ray <sebastien-libreoffice at orniz.org>
Date: Mon Feb 21 00:38:25 2011 +0100
Better protocols handling in french autocorrect
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index ed14c46..0c08373 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -654,8 +654,14 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace(
{
// Get the last word delimiter position
xub_StrLen nSttWdPos = nEndPos;
- while( nSttWdPos && !IsWordDelim( rTxt.GetChar( --nSttWdPos )))
+ bool bWasWordDelim = false;
+ while( nSttWdPos && !(bWasWordDelim = IsWordDelim( rTxt.GetChar( --nSttWdPos ))))
;
+
+ if(INetURLObject::CompareProtocolScheme(rTxt.Copy(nSttWdPos + (bWasWordDelim ? 1 : 0), nEndPos - nSttWdPos + 1)) != INET_PROT_NOT_VALID) {
+ return FALSE;
+ }
+
// Check the presence of "://" in the word
xub_StrLen nStrPos = rTxt.Search( String::CreateFromAscii( "://" ), nSttWdPos + 1 );
@@ -791,11 +797,11 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
xub_StrLen nSttPos, xub_StrLen nEndPos,
LanguageType eLang )
{
- // Two capital letters at the beginning of a paragraph?
+
if( !rTxt.Len() || nEndPos <= nSttPos )
return FALSE;
- CharClass& rCC = GetCharClass( eLang );
+ CharClass& rCC = GetCharClass( eLang );
String aText( rTxt );
const sal_Unicode *pStart = aText.GetBuffer(),
*pStr = pStart + nEndPos,
More information about the Libreoffice-commits
mailing list