summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2010-01-21 13:58:49 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-01-21 13:58:49 +0100
commit2d6003db679da5167d9c39afaa75c9c635c85b57 (patch)
tree1f1313f477b650550e648fc96e1e4b05ec34fa9e /svx
parentd0885b85995e09cad46f25087c13e5005e50abdf (diff)
cbosdo01: Changed the behaviour of nbsp autocorr
* The Non-breaking space insertion autocorrection is now done when typing the :!?; character instead of the word separator following it. * Removed the custom quote replacement option in autocorrection.
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/svxacorr.hxx2
-rw-r--r--svx/inc/svx/swafopt.hxx1
-rw-r--r--svx/source/editeng/acorrcfg.cxx161
-rw-r--r--svx/source/editeng/editeng.cxx4
-rw-r--r--svx/source/editeng/svxacorr.cxx28
-rw-r--r--svx/source/editeng/swafopt.cxx2
6 files changed, 107 insertions, 91 deletions
diff --git a/svx/inc/svx/svxacorr.hxx b/svx/inc/svx/svxacorr.hxx
index 6615b181f23d..0a389a622f43 100644
--- a/svx/inc/svx/svxacorr.hxx
+++ b/svx/inc/svx/svxacorr.hxx
@@ -385,6 +385,8 @@ public:
// (used to avoid occasional 'collisions' with (Thai) input-sequence-checking)
static sal_Bool IsAutoCorrectChar( sal_Unicode cChar );
+ sal_Bool NeedsHardspaceAutocorr( sal_Unicode cChar );
+
CharClass& GetCharClass( LanguageType eLang )
{
if( !pCharClass || eLang != eCharClassLang )
diff --git a/svx/inc/svx/swafopt.hxx b/svx/inc/svx/swafopt.hxx
index 3a2987121ce5..852a8e97f646 100644
--- a/svx/inc/svx/swafopt.hxx
+++ b/svx/inc/svx/swafopt.hxx
@@ -52,7 +52,6 @@ struct SVX_DLLPUBLIC SvxSwAutoFmtFlags
BYTE nRightMargin;
- BOOL bReplaceQuote : 1;
BOOL bAutoCorrect : 1;
BOOL bCptlSttSntnc : 1;
BOOL bCptlSttWrd : 1;
diff --git a/svx/source/editeng/acorrcfg.cxx b/svx/source/editeng/acorrcfg.cxx
index 13d517adfd92..1bb41561b4d7 100644
--- a/svx/source/editeng/acorrcfg.cxx
+++ b/svx/source/editeng/acorrcfg.cxx
@@ -372,35 +372,34 @@ Sequence<OUString> SvxSwAutoCorrCfg::GetPropertyNames()
"Format/Option/ChangeToBullets/SpecialCharacter/FontFamily", //18
"Format/Option/ChangeToBullets/SpecialCharacter/FontCharset", //19
"Format/Option/ChangeToBullets/SpecialCharacter/FontPitch", //20
- "Format/Option/ReplaceQuote", //21
- "Format/Option/CombineParagraphs", //22
- "Format/Option/CombineValue", //23
- "Format/Option/DelSpacesAtStartEnd", //24
- "Format/Option/DelSpacesBetween", //25
- "Format/ByInput/Enable", //26
- "Format/ByInput/ChangeDash", //27
- "Format/ByInput/ApplyNumbering/Enable", //28
- "Format/ByInput/ChangeToBorders", //29
- "Format/ByInput/ChangeToTable", //30
- "Format/ByInput/ReplaceStyle", //31
- "Format/ByInput/DelSpacesAtStartEnd", //32
- "Format/ByInput/DelSpacesBetween", //33
- "Completion/Enable", //34
- "Completion/MinWordLen", //35
- "Completion/MaxListLen", //36
- "Completion/CollectWords", //37
- "Completion/EndlessList", //38
- "Completion/AppendBlank", //39
- "Completion/ShowAsTip", //40
- "Completion/AcceptKey", //41
- "Completion/KeepList", //42
- "Format/ByInput/ApplyNumbering/SpecialCharacter/Char", //43
- "Format/ByInput/ApplyNumbering/SpecialCharacter/Font", //44
- "Format/ByInput/ApplyNumbering/SpecialCharacter/FontFamily", //45
- "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset", //46
- "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch" //47
+ "Format/Option/CombineParagraphs", //21
+ "Format/Option/CombineValue", //22
+ "Format/Option/DelSpacesAtStartEnd", //23
+ "Format/Option/DelSpacesBetween", //24
+ "Format/ByInput/Enable", //25
+ "Format/ByInput/ChangeDash", //26
+ "Format/ByInput/ApplyNumbering/Enable", //27
+ "Format/ByInput/ChangeToBorders", //28
+ "Format/ByInput/ChangeToTable", //29
+ "Format/ByInput/ReplaceStyle", //30
+ "Format/ByInput/DelSpacesAtStartEnd", //31
+ "Format/ByInput/DelSpacesBetween", //32
+ "Completion/Enable", //33
+ "Completion/MinWordLen", //34
+ "Completion/MaxListLen", //35
+ "Completion/CollectWords", //36
+ "Completion/EndlessList", //37
+ "Completion/AppendBlank", //38
+ "Completion/ShowAsTip", //39
+ "Completion/AcceptKey", //40
+ "Completion/KeepList", //41
+ "Format/ByInput/ApplyNumbering/SpecialCharacter/Char", //42
+ "Format/ByInput/ApplyNumbering/SpecialCharacter/Font", //43
+ "Format/ByInput/ApplyNumbering/SpecialCharacter/FontFamily", //44
+ "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset", //45
+ "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch" //46
};
- const int nCount = 48;
+ const int nCount = 47;
Sequence<OUString> aNames(nCount);
OUString* pNames = aNames.getArray();
for(int i = 0; i < nCount; i++)
@@ -475,78 +474,77 @@ void SvxSwAutoCorrCfg::Load(sal_Bool bInit)
rSwFlags.aBulletFont.SetPitch(FontPitch(nVal));
}
break; // "Format/Option/ChangeToBullets/SpecialCharacter/FontPitch",
- case 21: rSwFlags.bReplaceQuote = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/ReplaceQuote",
- case 22: rSwFlags.bRightMargin = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/CombineParagraphs",
- case 23:
+ case 21: rSwFlags.bRightMargin = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/CombineParagraphs",
+ case 22:
{
sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
rSwFlags.nRightMargin =
sal::static_int_cast< BYTE >(nVal);
}
break; // "Format/Option/CombineValue",
- case 24: rSwFlags.bAFmtDelSpacesAtSttEnd = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/DelSpacesAtStartEnd",
- case 25: rSwFlags.bAFmtDelSpacesBetweenLines = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/DelSpacesBetween",
- case 26: rParent.bAutoFmtByInput = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/Enable",
- case 27: rSwFlags.bChgToEnEmDash = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ChangeDash",
- case 28: rSwFlags.bSetNumRule = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ApplyNumbering/Enable",
- case 29: rSwFlags.bSetBorder = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ChangeToBorders",
- case 30: rSwFlags.bCreateTable = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ChangeToTable",
- case 31: rSwFlags.bReplaceStyles = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ReplaceStyle",
- case 32: rSwFlags.bAFmtByInpDelSpacesAtSttEnd = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/DelSpacesAtStartEnd",
- case 33: rSwFlags.bAFmtByInpDelSpacesBetweenLines = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/DelSpacesBetween",
- case 34: rSwFlags.bAutoCompleteWords = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/Enable",
- case 35:
+ case 23: rSwFlags.bAFmtDelSpacesAtSttEnd = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/DelSpacesAtStartEnd",
+ case 24: rSwFlags.bAFmtDelSpacesBetweenLines = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/DelSpacesBetween",
+ case 25: rParent.bAutoFmtByInput = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/Enable",
+ case 26: rSwFlags.bChgToEnEmDash = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ChangeDash",
+ case 27: rSwFlags.bSetNumRule = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ApplyNumbering/Enable",
+ case 28: rSwFlags.bSetBorder = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ChangeToBorders",
+ case 29: rSwFlags.bCreateTable = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ChangeToTable",
+ case 30: rSwFlags.bReplaceStyles = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/ReplaceStyle",
+ case 31: rSwFlags.bAFmtByInpDelSpacesAtSttEnd = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/DelSpacesAtStartEnd",
+ case 32: rSwFlags.bAFmtByInpDelSpacesBetweenLines = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/ByInput/DelSpacesBetween",
+ case 33: rSwFlags.bAutoCompleteWords = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/Enable",
+ case 34:
{
sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
rSwFlags.nAutoCmpltWordLen =
sal::static_int_cast< USHORT >(nVal);
}
break; // "Completion/MinWordLen",
- case 36:
+ case 35:
{
sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
rSwFlags.nAutoCmpltListLen =
sal::static_int_cast< USHORT >(nVal);
}
break; // "Completion/MaxListLen",
- case 37: rSwFlags.bAutoCmpltCollectWords = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/CollectWords",
- case 38: rSwFlags.bAutoCmpltEndless = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/EndlessList",
- case 39: rSwFlags.bAutoCmpltAppendBlanc = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/AppendBlank",
- case 40: rSwFlags.bAutoCmpltShowAsTip = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/ShowAsTip",
- case 41:
+ case 36: rSwFlags.bAutoCmpltCollectWords = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/CollectWords",
+ case 37: rSwFlags.bAutoCmpltEndless = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/EndlessList",
+ case 38: rSwFlags.bAutoCmpltAppendBlanc = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/AppendBlank",
+ case 39: rSwFlags.bAutoCmpltShowAsTip = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/ShowAsTip",
+ case 40:
{
sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
rSwFlags.nAutoCmpltExpandKey =
sal::static_int_cast< USHORT >(nVal);
}
break; // "Completion/AcceptKey"
- case 42 :rSwFlags.bAutoCmpltKeepList = *(sal_Bool*)pValues[nProp].getValue(); break;//"Completion/KeepList"
- case 43 :
+ case 41 :rSwFlags.bAutoCmpltKeepList = *(sal_Bool*)pValues[nProp].getValue(); break;//"Completion/KeepList"
+ case 42 :
{
sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
rSwFlags.cByInputBullet =
sal::static_int_cast< sal_Unicode >(nVal);
}
break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/Char",
- case 44 :
+ case 43 :
{
OUString sTemp; pValues[nProp] >>= sTemp;
rSwFlags.aByInputBulletFont.SetName(sTemp);
}
break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/Font",
- case 45 :
+ case 44 :
{
sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
rSwFlags.aByInputBulletFont.SetFamily(FontFamily(nVal));
}
break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontFamily",
- case 46 :
+ case 45 :
{
sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
rSwFlags.aByInputBulletFont.SetCharSet(CharSet(nVal));
}
break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset",
- case 47 :
+ case 46 :
{
sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
rSwFlags.aByInputBulletFont.SetPitch(FontPitch(nVal));
@@ -622,49 +620,48 @@ void SvxSwAutoCorrCfg::Commit()
case 20:
pValues[nProp] <<= (sal_Int32)rSwFlags.aBulletFont.GetPitch();
break; // "Format/Option/ChangeToBullets/SpecialCharacter/FontPitch",
- case 21: bVal = rSwFlags.bReplaceQuote; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/ReplaceQuote",
- case 22: bVal = rSwFlags.bRightMargin; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/CombineParagraphs",
- case 23:
+ case 21: bVal = rSwFlags.bRightMargin; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/CombineParagraphs",
+ case 22:
pValues[nProp] <<= (sal_Int32)rSwFlags.nRightMargin;
break; // "Format/Option/CombineValue",
- case 24: bVal = rSwFlags.bAFmtDelSpacesAtSttEnd; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/DelSpacesAtStartEnd",
- case 25: bVal = rSwFlags.bAFmtDelSpacesBetweenLines; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/DelSpacesBetween",
- case 26: bVal = rParent.bAutoFmtByInput; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/Enable",
- case 27: bVal = rSwFlags.bChgToEnEmDash; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ChangeDash",
- case 28: bVal = rSwFlags.bSetNumRule; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ApplyNumbering/Enable",
- case 29: bVal = rSwFlags.bSetBorder; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ChangeToBorders",
- case 30: bVal = rSwFlags.bCreateTable; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ChangeToTable",
- case 31: bVal = rSwFlags.bReplaceStyles; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ReplaceStyle",
- case 32: bVal = rSwFlags.bAFmtByInpDelSpacesAtSttEnd; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/DelSpacesAtStartEnd",
- case 33: bVal = rSwFlags.bAFmtByInpDelSpacesBetweenLines; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/DelSpacesBetween",
- case 34: bVal = rSwFlags.bAutoCompleteWords; pValues[nProp].setValue(&bVal, rType); break; // "Completion/Enable",
- case 35:
+ case 23: bVal = rSwFlags.bAFmtDelSpacesAtSttEnd; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/DelSpacesAtStartEnd",
+ case 24: bVal = rSwFlags.bAFmtDelSpacesBetweenLines; pValues[nProp].setValue(&bVal, rType); break; // "Format/Option/DelSpacesBetween",
+ case 25: bVal = rParent.bAutoFmtByInput; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/Enable",
+ case 26: bVal = rSwFlags.bChgToEnEmDash; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ChangeDash",
+ case 27: bVal = rSwFlags.bSetNumRule; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ApplyNumbering/Enable",
+ case 28: bVal = rSwFlags.bSetBorder; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ChangeToBorders",
+ case 29: bVal = rSwFlags.bCreateTable; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ChangeToTable",
+ case 30: bVal = rSwFlags.bReplaceStyles; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/ReplaceStyle",
+ case 31: bVal = rSwFlags.bAFmtByInpDelSpacesAtSttEnd; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/DelSpacesAtStartEnd",
+ case 32: bVal = rSwFlags.bAFmtByInpDelSpacesBetweenLines; pValues[nProp].setValue(&bVal, rType); break; // "Format/ByInput/DelSpacesBetween",
+ case 33: bVal = rSwFlags.bAutoCompleteWords; pValues[nProp].setValue(&bVal, rType); break; // "Completion/Enable",
+ case 34:
pValues[nProp] <<= (sal_Int32)rSwFlags.nAutoCmpltWordLen;
break; // "Completion/MinWordLen",
- case 36:
+ case 35:
pValues[nProp] <<= (sal_Int32)rSwFlags.nAutoCmpltListLen;
break; // "Completion/MaxListLen",
- case 37: bVal = rSwFlags.bAutoCmpltCollectWords; pValues[nProp].setValue(&bVal, rType); break; // "Completion/CollectWords",
- case 38: bVal = rSwFlags.bAutoCmpltEndless; pValues[nProp].setValue(&bVal, rType); break; // "Completion/EndlessList",
- case 39: bVal = rSwFlags.bAutoCmpltAppendBlanc; pValues[nProp].setValue(&bVal, rType); break; // "Completion/AppendBlank",
- case 40: bVal = rSwFlags.bAutoCmpltShowAsTip; pValues[nProp].setValue(&bVal, rType); break; // "Completion/ShowAsTip",
- case 41:
+ case 36: bVal = rSwFlags.bAutoCmpltCollectWords; pValues[nProp].setValue(&bVal, rType); break; // "Completion/CollectWords",
+ case 37: bVal = rSwFlags.bAutoCmpltEndless; pValues[nProp].setValue(&bVal, rType); break; // "Completion/EndlessList",
+ case 38: bVal = rSwFlags.bAutoCmpltAppendBlanc; pValues[nProp].setValue(&bVal, rType); break; // "Completion/AppendBlank",
+ case 39: bVal = rSwFlags.bAutoCmpltShowAsTip; pValues[nProp].setValue(&bVal, rType); break; // "Completion/ShowAsTip",
+ case 40:
pValues[nProp] <<= (sal_Int32)rSwFlags.nAutoCmpltExpandKey;
break; // "Completion/AcceptKey"
- case 42 :bVal = rSwFlags.bAutoCmpltKeepList; pValues[nProp].setValue(&bVal, rType); break;// "Completion/KeepList"
- case 43 :
+ case 41 :bVal = rSwFlags.bAutoCmpltKeepList; pValues[nProp].setValue(&bVal, rType); break;// "Completion/KeepList"
+ case 42 :
pValues[nProp] <<= (sal_Int32)rSwFlags.cByInputBullet;
break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/Char",
- case 44 :
+ case 43 :
pValues[nProp] <<= OUString(rSwFlags.aByInputBulletFont.GetName());
break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/Font",
- case 45 :
+ case 44 :
pValues[nProp] <<= (sal_Int32)rSwFlags.aByInputBulletFont.GetFamily();
break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontFamily",
- case 46 :
+ case 45 :
pValues[nProp] <<= (sal_Int32)rSwFlags.aByInputBulletFont.GetCharSet();
break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset",
- case 47 :
+ case 46 :
pValues[nProp] <<= (sal_Int32)rSwFlags.aByInputBulletFont.GetPitch();
break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch",
}
diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx
index 58a735529d2c..fdf9c76cbce3 100644
--- a/svx/source/editeng/editeng.cxx
+++ b/svx/source/editeng/editeng.cxx
@@ -1146,9 +1146,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
pEditView->pImpEditView->DrawSelection();
// Autokorrektur ?
if ( ( pImpEditEngine->GetStatus().DoAutoCorrect() ) &&
- ( ( nCharCode == ' ' ) || ( nCharCode == '*' ) ||
- ( nCharCode == '\"' ) || ( nCharCode == '\'' ) ||
- ( nCharCode == '_' ) ))
+ SvxAutoCorrect::IsAutoCorrectChar( nCharCode ) )
{
aCurSel = pImpEditEngine->AutoCorrect( aCurSel, nCharCode, !pEditView->IsInsertMode() );
}
diff --git a/svx/source/editeng/svxacorr.cxx b/svx/source/editeng/svxacorr.cxx
index 68744b9bd05d..c1847bb3a269 100644
--- a/svx/source/editeng/svxacorr.cxx
+++ b/svx/source/editeng/svxacorr.cxx
@@ -336,7 +336,13 @@ sal_Bool SvxAutoCorrect::IsAutoCorrectChar( sal_Unicode cChar )
cChar == ' ' || cChar == '\'' || cChar == '\"' ||
cChar == '*' || cChar == '_' ||
cChar == '.' || cChar == ',' || cChar == ';' ||
- cChar == ':' || cChar == '?' || cChar == '!';
+ cChar == ':' || cChar == '?' || cChar == '!' || cChar == '/';
+}
+
+sal_Bool SvxAutoCorrect::NeedsHardspaceAutocorr( sal_Unicode cChar )
+{
+ return cChar == ';' || cChar == ':' || cChar == '?' || cChar == '!' ||
+ cChar == '/' /*case for the urls exception*/;
}
/* -----------------19.11.98 10:15-------------------
@@ -710,6 +716,17 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace(
}
}
}
+ else if ( cChar == '/' )
+ {
+ // Remove the hardspace right before to avoid formatting URLs
+ sal_Unicode cPrevChar = rTxt.GetChar( nEndPos - 1 );
+ sal_Unicode cMaybeSpaceChar = rTxt.GetChar( nEndPos - 2 );
+ if ( cPrevChar == ':' && cMaybeSpaceChar == CHAR_HARDBLANK )
+ {
+ rDoc.Delete( nEndPos - 2, nEndPos - 1 );
+ bRet = true;
+ }
+ }
}
return bRet;
@@ -1226,6 +1243,13 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
rDoc.Insert( nInsPos, cChar );
else
rDoc.Replace( nInsPos, cChar );
+
+ // Hardspaces autocorrection
+ if ( NeedsHardspaceAutocorr( cChar ) && IsAutoCorrFlag( AddNonBrkSpace ) &&
+ FnAddNonBrkSpace( rDoc, rTxt, 0, nInsPos, rDoc.GetLanguage( nInsPos, FALSE ) ) )
+ {
+ nRet = AddNonBrkSpace;
+ }
}
if( !nInsPos )
@@ -1322,8 +1346,6 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
if( ( IsAutoCorrFlag( nRet = ChgOrdinalNumber ) &&
FnChgOrdinalNumber( rDoc, rTxt, nCapLttrPos, nInsPos, eLang ) ) ||
- ( IsAutoCorrFlag( nRet = AddNonBrkSpace ) &&
- FnAddNonBrkSpace( rDoc, rTxt, nCapLttrPos, nInsPos - 1, eLang ) ) ||
( IsAutoCorrFlag( nRet = SetINetAttr ) &&
( ' ' == cChar || '\t' == cChar || 0x0a == cChar || !cChar ) &&
FnSetINetAttr( rDoc, rTxt, nCapLttrPos, nInsPos, eLang ) ) )
diff --git a/svx/source/editeng/swafopt.cxx b/svx/source/editeng/swafopt.cxx
index a2dd84ab2c37..1950523be879 100644
--- a/svx/source/editeng/swafopt.cxx
+++ b/svx/source/editeng/swafopt.cxx
@@ -44,7 +44,6 @@ SvxSwAutoFmtFlags::SvxSwAutoFmtFlags()
RTL_CONSTASCII_STRINGPARAM( "StarSymbol" )),
Size( 0, 14 ) )
{
- bReplaceQuote =
bAutoCorrect =
bCptlSttSntnc =
bCptlSttWrd =
@@ -104,7 +103,6 @@ SvxSwAutoFmtFlags::SvxSwAutoFmtFlags()
SvxSwAutoFmtFlags& SvxSwAutoFmtFlags::operator=( const SvxSwAutoFmtFlags& rAFFlags )
{
bAutoCorrect = rAFFlags.bAutoCorrect;
- bReplaceQuote = rAFFlags.bReplaceQuote;
bCptlSttSntnc = rAFFlags.bCptlSttSntnc;
bCptlSttWrd = rAFFlags.bCptlSttWrd;
bChkFontAttr = rAFFlags.bChkFontAttr;