diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-02-16 18:29:26 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-02-16 18:29:26 +0100 |
commit | b252e975820b8ca377f4727ef09c1e025861bbb6 (patch) | |
tree | 021e785e998b6fe337a8c158c32c8fffe99506ce /sw | |
parent | 5764230f546cd20dd4e5787d2b9277812527b775 (diff) | |
parent | 35bc17462a86b42345062708f7f1a57f3efd5779 (diff) |
CWS-TOOLING: integrate CWS cbosdo01
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/comcore.hrc | 3 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 46 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/shells/textsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/utlui/utlui.src | 4 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/wrtsh1.cxx | 2 |
6 files changed, 43 insertions, 18 deletions
diff --git a/sw/inc/comcore.hrc b/sw/inc/comcore.hrc index c02af7ad0070..dbd638266a89 100644 --- a/sw/inc/comcore.hrc +++ b/sw/inc/comcore.hrc @@ -115,8 +115,9 @@ #define STR_AUTOFMTREDL_SET_TMPL_HEADLINE 18 #define STR_AUTOFMTREDL_SET_NUMBULET 19 #define STR_AUTOFMTREDL_DEL_MORELINES 20 +#define STR_AUTOFMTREDL_NON_BREAK_SPACE 21 // !!!!!!!!!!!!!!!!!!!!!!!!!! das Ende immer richtig setzen !!!!!!!!!!!! -#define STR_AUTOFMTREDL_END 21 +#define STR_AUTOFMTREDL_END 22 #endif diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 35f4a90d4a7e..2f92c268c2d9 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -316,6 +316,7 @@ void SwAutoFormat::_SetRedlineTxt( USHORT nActionId ) case STR_AUTOFMTREDL_FRACTION: case STR_AUTOFMTREDL_DASH: case STR_AUTOFMTREDL_ORDINAL: + case STR_AUTOFMTREDL_NON_BREAK_SPACE: nSeqNo = ++nRedlAutoFmtSeqId; break; } @@ -1891,12 +1892,17 @@ void SwAutoFormat::BuildHeadLine( USHORT nLvl ) // dann lasse doch mal das AutoCorrect auf den akt. TextNode los void SwAutoFormat::AutoCorrect( xub_StrLen nPos ) { + SvxAutoCorrect* pATst = SvxAutoCorrCfg::Get()->GetAutoCorrect(); + long aSvxFlags = pATst->GetFlags( ); + bool bReplaceQuote = ( aSvxFlags & ChgQuotes ) > 0; + bool bReplaceSglQuote = ( aSvxFlags & ChgSglQuotes ) > 0; + if( aFlags.bAFmtByInput || - (!aFlags.bAutoCorrect && !aFlags.bReplaceQuote && + (!aFlags.bAutoCorrect && !bReplaceQuote && !bReplaceSglQuote && !aFlags.bCptlSttSntnc && !aFlags.bCptlSttWrd && - !aFlags.bChgFracionSymbol && !aFlags.bChgOrdinalNumber && + !aFlags.bChgOrdinalNumber && !aFlags.bChgToEnEmDash && !aFlags.bSetINetAttr && - !aFlags.bChgWeightUnderl) ) + !aFlags.bChgWeightUnderl && !aFlags.bAddNonBrkSpace) ) return; const String* pTxt = &pAktTxtNd->GetTxt(); @@ -1905,7 +1911,8 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos ) BOOL bGetLanguage = aFlags.bChgOrdinalNumber || aFlags.bChgToEnEmDash || aFlags.bSetINetAttr || - aFlags.bCptlSttWrd || aFlags.bCptlSttSntnc; + aFlags.bCptlSttWrd || aFlags.bCptlSttSntnc || + aFlags.bAddNonBrkSpace; aDelPam.DeleteMark(); @@ -1913,7 +1920,6 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos ) aDelPam.GetPoint()->nContent.Assign( pAktTxtNd, 0 ); SwAutoCorrDoc aACorrDoc( *pEditShell, aDelPam ); - SvxAutoCorrect* pATst = SvxAutoCorrCfg::Get()->GetAutoCorrect(); SwTxtFrmInfo aFInfo( 0 ); @@ -1929,8 +1935,8 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos ) if( nPos == pTxt->Len() ) break; // das wars - if( aFlags.bReplaceQuote && - ( '\"' == cChar || '\'' == cChar ) && + if( ( ( bReplaceQuote && '\"' == cChar ) || + ( bReplaceSglQuote && '\'' == cChar ) ) && ( !nPos || ' ' == pTxt->GetChar( nPos-1 ) ) ) { // -------------------------------------- @@ -1983,7 +1989,7 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos ) { case '\"': case '\'': - if( aFlags.bReplaceQuote ) + if( ( cChar == '\"' && bReplaceQuote ) || ( cChar == '\'' && bReplaceSglQuote ) ) { // -------------------------------------- // beachte: Sonderfall Symbolfonts !!! @@ -2068,6 +2074,18 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos ) } } break; + case '/': + if ( aFlags.bAddNonBrkSpace ) + { + LanguageType eLang = (bGetLanguage && pAktTxtNd) + ? pAktTxtNd->GetLang( nSttPos ) + : LANGUAGE_SYSTEM; + + SetRedlineTxt( STR_AUTOFMTREDL_NON_BREAK_SPACE ); + if ( pATst->FnAddNonBrkSpace( aACorrDoc, *pTxt, nSttPos, nPos, eLang ) ) + --nPos; + } + break; case '.': case '!': @@ -2076,7 +2094,6 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos ) bFirstSent = TRUE; //alle Wortrenner loesen die Autokorrektur aus! // break; - default: //alle Wortrenner loesen die Autokorrektur aus! // case ' ': @@ -2125,10 +2142,13 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos ) ? pAktTxtNd->GetLang( nSttPos ) : LANGUAGE_SYSTEM; - if( ( aFlags.bChgFracionSymbol && - SetRedlineTxt( STR_AUTOFMTREDL_FRACTION ) && - pATst->FnChgFractionSymbol( aACorrDoc, *pTxt, nSttPos, nPos ) ) || - ( aFlags.bChgOrdinalNumber && + if ( aFlags.bAddNonBrkSpace ) + { + SetRedlineTxt( STR_AUTOFMTREDL_NON_BREAK_SPACE ); + pATst->FnAddNonBrkSpace( aACorrDoc, *pTxt, nSttPos, nPos, eLang ); + } + + if( ( aFlags.bChgOrdinalNumber && SetRedlineTxt( STR_AUTOFMTREDL_ORDINAL ) && pATst->FnChgOrdinalNumber( aACorrDoc, *pTxt, nSttPos, nPos, eLang ) ) || ( aFlags.bChgToEnEmDash && diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 64e17e391f05..7042317fad17 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -2278,7 +2278,7 @@ KEYINPUT_CHECKTABLE_INSDEL: else if( !aKeyEvent.GetRepeat() && pACorr && bIsAutoCorrectChar && pACfg->IsAutoFmtByInput() && pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd | - ChgFractionSymbol | ChgOrdinalNumber | + ChgOrdinalNumber | ChgToEnEmDash | SetINetAttr | Autocorrect ) && '\"' != aCh && '\'' != aCh && '*' != aCh && '_' != aCh && @@ -2310,7 +2310,7 @@ KEYINPUT_CHECKTABLE_INSDEL: { if( pACorr && pACfg->IsAutoFmtByInput() && pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd | - ChgFractionSymbol | ChgOrdinalNumber | + ChgOrdinalNumber | ChgToEnEmDash | SetINetAttr | Autocorrect ) && !rSh.HasReadonlySel() ) diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index 9367d9ba6d8a..f4d2e5dd305a 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -196,7 +196,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) SvxAutoCorrect* pACorr = pACfg->GetAutoCorrect(); if( pACorr && pACfg->IsAutoFmtByInput() && pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd | - ChgFractionSymbol | ChgOrdinalNumber | + AddNonBrkSpace | ChgOrdinalNumber | ChgToEnEmDash | SetINetAttr | Autocorrect )) rSh.AutoCorrect( *pACorr, cIns ); else diff --git a/sw/source/ui/utlui/utlui.src b/sw/source/ui/utlui/utlui.src index a67fe47aca4b..cc49d885d5eb 100644 --- a/sw/source/ui/utlui/utlui.src +++ b/sw/source/ui/utlui/utlui.src @@ -122,6 +122,10 @@ Resource RID_SHELLRES_AUTOFMTSTRS { Text [ en-US ] = "Combine paragraphs"; }; + String STR_AUTOFMTREDL_NON_BREAK_SPACE +1 + { + Text [ en-US ] = "Add non breaking space"; + }; }; diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index e444670b863a..a314b940c29c 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -159,7 +159,7 @@ SvxAutoCorrect* lcl_IsAutoCorr() { SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect(); if( pACorr && !pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd | - ChgFractionSymbol | ChgOrdinalNumber | + AddNonBrkSpace | ChgOrdinalNumber | ChgToEnEmDash | SetINetAttr | Autocorrect )) pACorr = 0; return pACorr; |