summaryrefslogtreecommitdiff
path: root/editeng/source/misc/svxacorr.cxx
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2010-03-15 18:16:49 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-03-15 18:16:49 +0100
commitf9737418248615db43e881d6fddfd4b15a482e4d (patch)
treeac72b8f1a00899f2ce38fd25699636845d5e428a /editeng/source/misc/svxacorr.cxx
parentbb60fade4844d9687717cd3cf33affb8172cad81 (diff)
[cbosdo05] Fixed a usability problem introduced by cbosdo01
Removing the non-breaking space when the character typed immediately after the punctuation mark if the last character typed isn't a blank.
Diffstat (limited to 'editeng/source/misc/svxacorr.cxx')
-rw-r--r--editeng/source/misc/svxacorr.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index ebc025fea7..f7c40c002a 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -363,7 +363,7 @@ SvxAutoCorrect::SvxAutoCorrect( const String& rShareAutocorrFile,
sUserAutoCorrFile( rUserAutocorrFile ),
pLangTable( new SvxAutoCorrLanguageTable_Impl ),
pLastFileTable( new SvxAutoCorrLastFileAskTable_Impl ),
- pCharClass( 0 ),
+ pCharClass( 0 ), bRunNext( false ),
cStartDQuote( 0 ), cEndDQuote( 0 ), cStartSQuote( 0 ), cEndSQuote( 0 )
{
nFlags = SvxAutoCorrect::GetDefaultFlags();
@@ -380,7 +380,7 @@ SvxAutoCorrect::SvxAutoCorrect( const SvxAutoCorrect& rCpy )
pLangTable( new SvxAutoCorrLanguageTable_Impl ),
pLastFileTable( new SvxAutoCorrLastFileAskTable_Impl ),
- pCharClass( 0 ),
+ pCharClass( 0 ), bRunNext( false ),
nFlags( rCpy.nFlags & ~(ChgWordLstLoad|CplSttLstLoad|WrdSttLstLoad)),
cStartDQuote( rCpy.cStartDQuote ), cEndDQuote( rCpy.cEndDQuote ),
@@ -711,6 +711,9 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace(
}
}
+ // Run on the next character if nbsp added
+ bRunNext = bRet;
+
return bRet;
}
@@ -1189,9 +1192,21 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
BOOL bInsert )
{
ULONG nRet = 0;
+ bRunNext = false; // if it was set, then it has to be turned off
+
do{ // only for middle check loop !!
if( cChar )
{
+ // Remove the NBSP if it wasn't an autocorrection
+ if ( !IsAutoCorrectChar( cChar ) && IsAutoCorrFlag( AddNonBrkSpace ) )
+ {
+ if ( NeedsHardspaceAutocorr( rTxt.GetChar( nInsPos - 1 ) ) &&
+ isblank( (unsigned char) cChar) == 0 )
+ {
+ rDoc.Delete( nInsPos - 2, nInsPos - 1 );
+ }
+ }
+
//JP 10.02.97: doppelte Spaces verhindern
if( nInsPos && ' ' == cChar &&
IsAutoCorrFlag( IgnoreDoubleSpace ) &&