diff options
author | László Németh <nemeth@numbertext.org> | 2020-06-23 18:49:46 +0200 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2020-06-30 19:44:42 +0200 |
commit | 7ffc9d592299a71c86f11a57bc2cd5037927f522 (patch) | |
tree | 24d11494247a83f2698949f48397d3bb7a886f26 /editeng | |
parent | 62b4803b32963f9529e6380f14a5b7d4edb8c4ff (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.
Note: fix also redundant loading of new localized option
added by commit da64ec8c8a91db6a6ec9657898f081d5ee67e739
(tdf#133589 AutoCorrect: transliterate to Old Hungarian)
Conflicts:
cui/source/tabpages/autocdlg.cxx
editeng/source/misc/svxacorr.cxx
Change-Id: Ib0c7e8837a89c3772c5db76720811d440e62183a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97094
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry-picked from commit 77b213890a96d144d9cfacdfd35ac0bba68b9f7a
and commit 076c95b27bf0e9be1fa1c077674cf974b22210fd)
Change-Id: I3877ae930fa3e1e813a4b93b9ec4c2b18f8f5dd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97359
Tested-by: Jenkins
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/misc/acorrcfg.cxx | 25 | ||||
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 7 | ||||
-rw-r--r-- | editeng/source/misc/swafopt.cxx | 1 |
3 files changed, 20 insertions, 13 deletions
diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx index d3e9f75b8413..aa08f4196664 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,8 @@ 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 }; - const int nCount = 48; + const int nCount = 47; Sequence<OUString> aNames(nCount); OUString* pNames = aNames.getArray(); for(int i = 0; i < nCount; i++) @@ -484,7 +491,6 @@ void SvxSwAutoCorrCfg::Load(bool bInit) rSwFlags.aByInputBulletFont.SetPitch(FontPitch(nVal)); } break;// "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch", - case 47 : rSwFlags.bTransliterateRTL = *o3tl::doAccess<bool>(pValues[nProp]); break; // "Format/Option/TransliterateRTL", } } } @@ -586,11 +592,8 @@ void SvxSwAutoCorrCfg::ImplCommit() // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontFamily" css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetCharSet())), // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset" - css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetPitch())), + css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetPitch()))}); // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch" - css::uno::Any(rSwFlags.bTransliterateRTL)}); - // "Format/Option/TransliterateRTL" - } void SvxSwAutoCorrCfg::Notify( const Sequence<OUString>& /* aPropertyNames */ ) diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 32d4d6e9fa5f..983660bab918 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 @@ -1382,8 +1383,10 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt, InsertQuote( rDoc, nInsPos, cChar, bSttQuote, bInsert, eLang, eType ); break; } - // tdf#133524 change "<<" and ">>" to double angle quoation marks - else if ( IsAutoCorrFlag( ACFlags::ChgQuotes ) && ('<' == cChar || '>' == cChar) && + // tdf#133524 change "<<" and ">>" to double angle quotation marks + 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 = |