diff options
author | László Németh <nemeth@numbertext.org> | 2020-06-01 19:31:38 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-06-02 18:40:06 +0200 |
commit | da64ec8c8a91db6a6ec9657898f081d5ee67e739 (patch) | |
tree | 2bd7d3ddf24ce6c5adeb3c29dd46ead2e1215c0a /cui/source/tabpages/autocdlg.cxx | |
parent | 2d6395b87218cbf3512aa9b54807a859205006f0 (diff) |
tdf#133589 AutoCorrect: transliterate to Old Hungarian
In right-to-left paragraph mode, transliterate
Hungarian text word by word during typing, also
add the associated checkbox to Localized Options
page of AutoCorrect dialog window.
Old Hungarian (ISO 15924: Hung) is a historical
and renewed script which is still in use to
transliterate Hungarian writing.
As a localized AutoCorrect feature, the patch supports
the followings:
– word-by-word transliteration of Hungarian texts only
in right-to-left paragraph mode.
– consonant disambiguation of digraphs and trigraphs
based on hyphenation (now pattern-based Huhyphn
dictionary of libhyphen, planned dictionary based
Hunspell later)
– transliteration by extended hu-Hung module of
Numbertext library.
Note: transliteration of the selected text using
AutoCorrect Apply function has't been implemented, yet.
Change-Id: Iee0f18e2485c974c35acf0a3abc3a49c2cf80196
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95303
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'cui/source/tabpages/autocdlg.cxx')
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 5b623de576ef..74e1ef127659 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -1525,7 +1525,8 @@ namespace { enum OfaQuoteOptions { ADD_NONBRK_SPACE, - REPLACE_1ST + REPLACE_1ST, + TRANSLITERATE_RTL }; } @@ -1545,6 +1546,7 @@ OfaQuoteTabPage::OfaQuoteTabPage(weld::Container* pPage, weld::DialogController* : SfxTabPage(pPage, pController, "cui/ui/applylocalizedpage.ui", "ApplyLocalizedPage", &rSet) , sNonBrkSpace(CuiResId(RID_SVXSTR_NON_BREAK_SPACE)) , sOrdinal(CuiResId(RID_SVXSTR_ORDINAL)) + , sTransliterateRTL(CuiResId(RID_SVXSTR_OLD_HUNGARIAN)) , cSglStartQuote(0) , cSglEndQuote(0) , cStartQuote(0) @@ -1619,6 +1621,7 @@ bool OfaQuoteTabPage::FillItemSet( SfxItemSet* ) int nPos = 0; pAutoCorrect->SetAutoCorrFlag(ACFlags::AddNonBrkSpace, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST) == TRISTATE_TRUE); pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgOrdinalNumber, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST) == TRISTATE_TRUE); + pAutoCorrect->SetAutoCorrFlag(ACFlags::TransliterateRTL, m_xCheckLB->get_toggle(nPos++, CBCOL_FIRST) == TRISTATE_TRUE); } bool bModified = false; @@ -1637,6 +1640,12 @@ bool OfaQuoteTabPage::FillItemSet( SfxItemSet* ) pOpt->bChgOrdinalNumber = bCheck; pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgOrdinalNumber, m_xSwCheckLB->get_toggle(REPLACE_1ST, CBCOL_SECOND) == TRISTATE_TRUE); + + bCheck = m_xSwCheckLB->get_toggle(TRANSLITERATE_RTL, CBCOL_FIRST) == TRISTATE_TRUE; + bModified |= pOpt->bTransliterateRTL != bCheck; + pOpt->bTransliterateRTL = bCheck; + pAutoCorrect->SetAutoCorrFlag(ACFlags::TransliterateRTL, + m_xSwCheckLB->get_toggle(TRANSLITERATE_RTL, CBCOL_SECOND) == TRISTATE_TRUE); } pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgQuotes, m_xDoubleTypoCB->get_active()); @@ -1696,11 +1705,14 @@ void OfaQuoteTabPage::Reset( const SfxItemSet* ) CreateEntry(*m_xSwCheckLB, sNonBrkSpace, CBCOL_BOTH, 2); CreateEntry(*m_xSwCheckLB, sOrdinal, CBCOL_BOTH, 2); + CreateEntry(*m_xSwCheckLB, sTransliterateRTL, CBCOL_BOTH, 2); m_xSwCheckLB->set_toggle(ADD_NONBRK_SPACE, pOpt->bAddNonBrkSpace ? TRISTATE_TRUE : TRISTATE_FALSE, CBCOL_FIRST); m_xSwCheckLB->set_toggle(ADD_NONBRK_SPACE, bool(nFlags & ACFlags::AddNonBrkSpace) ? TRISTATE_TRUE : TRISTATE_FALSE, CBCOL_SECOND); m_xSwCheckLB->set_toggle(REPLACE_1ST, pOpt->bChgOrdinalNumber ? TRISTATE_TRUE : TRISTATE_FALSE, CBCOL_FIRST); m_xSwCheckLB->set_toggle(REPLACE_1ST, bool(nFlags & ACFlags::ChgOrdinalNumber) ? TRISTATE_TRUE : TRISTATE_FALSE, CBCOL_SECOND); + m_xSwCheckLB->set_toggle(TRANSLITERATE_RTL, pOpt->bTransliterateRTL ? TRISTATE_TRUE : TRISTATE_FALSE, CBCOL_FIRST); + m_xSwCheckLB->set_toggle(TRANSLITERATE_RTL, bool(nFlags & ACFlags::TransliterateRTL) ? TRISTATE_TRUE : TRISTATE_FALSE, CBCOL_SECOND); m_xSwCheckLB->thaw(); } @@ -1713,10 +1725,12 @@ void OfaQuoteTabPage::Reset( const SfxItemSet* ) CreateEntry(*m_xCheckLB, sNonBrkSpace, CBCOL_FIRST, 1); CreateEntry(*m_xCheckLB, sOrdinal, CBCOL_FIRST, 1); + CreateEntry(*m_xCheckLB, sTransliterateRTL, CBCOL_FIRST, 1); int nPos = 0; m_xCheckLB->set_toggle(nPos++, bool(nFlags & ACFlags::AddNonBrkSpace) ? TRISTATE_TRUE : TRISTATE_FALSE, CBCOL_FIRST); m_xCheckLB->set_toggle(nPos++, bool(nFlags & ACFlags::ChgOrdinalNumber) ? TRISTATE_TRUE : TRISTATE_FALSE, CBCOL_FIRST); + m_xCheckLB->set_toggle(nPos++, bool(nFlags & ACFlags::TransliterateRTL) ? TRISTATE_TRUE : TRISTATE_FALSE, CBCOL_FIRST); m_xCheckLB->thaw(); } |