diff options
author | László Németh <nemeth@numbertext.org> | 2020-06-23 18:49:46 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-06-26 09:01:20 +0200 |
commit | 77b213890a96d144d9cfacdfd35ac0bba68b9f7a (patch) | |
tree | ed07e76887e1eae390a4492467c9bdd8140c0a7d /editeng | |
parent | 46308ce281ae93e22c0b051b68dad1ee21c6646e (diff) |
tdf#133524 add option to angle quote AutoCorrect
in Localized Options page of AutoCorrect Options
dialog window:
[x] Replace << and >> with angle quotes
Note: this is optional part of Double Quotes replacement.
Change-Id: Ib0c7e8837a89c3772c5db76720811d440e62183a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97094
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/misc/acorrcfg.cxx | 22 | ||||
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 5 | ||||
-rw-r--r-- | editeng/source/misc/swafopt.cxx | 1 |
3 files changed, 21 insertions, 7 deletions
diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx index d3e9f75b8413..03d238953b10 100644 --- a/editeng/source/misc/acorrcfg.cxx +++ b/editeng/source/misc/acorrcfg.cxx @@ -110,9 +110,10 @@ Sequence<OUString> SvxBaseAutoCorrCfg::GetPropertyNames() "DoubleQuoteAtStart", // 15 "DoubleQuoteAtEnd", // 16 "CorrectAccidentalCapsLock", // 17 - "TransliterateRTL" // 18 + "TransliterateRTL", // 18 + "ChangeAngleQuotes" // 19 }; - const int nCount = 19; + const int nCount = 20; Sequence<OUString> aNames(nCount); OUString* pNames = aNames.getArray(); for(int i = 0; i < nCount; i++) @@ -219,12 +220,16 @@ void SvxBaseAutoCorrCfg::Load(bool bInit) if(*o3tl::doAccess<bool>(pValues[nProp])) nFlags |= ACFlags::TransliterateRTL; break;//"TransliterateRTL" + case 19: + if(*o3tl::doAccess<bool>(pValues[nProp])) + nFlags |= ACFlags::ChgAngleQuotes; + break;//"ChangeAngleQuotes" } } } if( nFlags != ACFlags::NONE ) rParent.pAutoCorrect->SetAutoCorrFlag( nFlags ); - rParent.pAutoCorrect->SetAutoCorrFlag( ( static_cast<ACFlags>(0x7fff) & ~nFlags ), false ); + rParent.pAutoCorrect->SetAutoCorrFlag( ( static_cast<ACFlags>(0xffff) & ~nFlags ), false ); } SvxBaseAutoCorrCfg::SvxBaseAutoCorrCfg(SvxAutoCorrCfg& rPar) : @@ -272,8 +277,11 @@ void SvxBaseAutoCorrCfg::ImplCommit() // "DoubleQuoteAtEnd" css::uno::Any(bool(nFlags & ACFlags::CorrectCapsLock)), // "CorrectAccidentalCapsLock" - css::uno::Any(bool(nFlags & ACFlags::TransliterateRTL))}); + css::uno::Any(bool(nFlags & ACFlags::TransliterateRTL)), // "TransliterateRTL" + css::uno::Any(bool(nFlags & ACFlags::ChgAngleQuotes))}); + // "ChangeAngleQuotes" + } void SvxBaseAutoCorrCfg::Notify( const Sequence<OUString>& /* aPropertyNames */) @@ -332,9 +340,10 @@ Sequence<OUString> SvxSwAutoCorrCfg::GetPropertyNames() "Format/ByInput/ApplyNumbering/SpecialCharacter/FontFamily", //44 "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset", //45 "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch", //46 - "Format/Option/TransliterateRTL" //47 + "Format/Option/TransliterateRTL", //47 + "Format/Option/ChangeAngleQuotes" //48 }; - const int nCount = 48; + const int nCount = 49; Sequence<OUString> aNames(nCount); OUString* pNames = aNames.getArray(); for(int i = 0; i < nCount; i++) @@ -485,6 +494,7 @@ void SvxSwAutoCorrCfg::Load(bool bInit) } break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch", case 47 : rSwFlags.bTransliterateRTL = *o3tl::doAccess<bool>(pValues[nProp]); break; // "Format/Option/TransliterateRTL", + case 48 : rSwFlags.bChgAngleQuotes = *o3tl::doAccess<bool>(pValues[nProp]); break; // "Format/Option/ChangeAngleQuotes", } } } diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 4b271993cd68..4f55ea951167 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -286,6 +286,7 @@ ACFlags SvxAutoCorrect::GetDefaultFlags() | ACFlags::ChgToEnEmDash | ACFlags::AddNonBrkSpace | ACFlags::TransliterateRTL + | ACFlags::ChgAngleQuotes | ACFlags::ChgWeightUnderl | ACFlags::SetINetAttr | ACFlags::ChgQuotes @@ -1380,7 +1381,9 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt, break; } // tdf#133524 change "<<" and ">>" to double angle quotation marks - else if ( IsAutoCorrFlag( ACFlags::ChgQuotes ) && ('<' == cChar || '>' == cChar) && + else if ( IsAutoCorrFlag( ACFlags::ChgQuotes ) && + IsAutoCorrFlag( ACFlags::ChgAngleQuotes ) && + ('<' == cChar || '>' == cChar) && nInsPos > 0 && cChar == rTxt[ nInsPos-1 ] ) { const LanguageType eLang = GetDocLanguage( rDoc, nInsPos ); diff --git a/editeng/source/misc/swafopt.cxx b/editeng/source/misc/swafopt.cxx index f682c690ae32..bd6fbcf45695 100644 --- a/editeng/source/misc/swafopt.cxx +++ b/editeng/source/misc/swafopt.cxx @@ -32,6 +32,7 @@ SvxSwAutoFormatFlags::SvxSwAutoFormatFlags() bAddNonBrkSpace = bChgOrdinalNumber = bTransliterateRTL = + bChgAngleQuotes = bChgToEnEmDash = bChgWeightUnderl = bSetINetAttr = |